|
@@ -707,15 +707,15 @@ const getCollectionImageList = async (name?: string, collection?: string, userFl
|
|
|
// tags: name !== '组件' ? name : undefined,
|
|
|
// },
|
|
|
userFlag,
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- id: 1,
|
|
|
- name: 1,
|
|
|
- tags: 1,
|
|
|
- folder: 1,
|
|
|
- component: 1,
|
|
|
- filename: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // tags: 1,
|
|
|
+ // folder: 1,
|
|
|
+ // component: 1,
|
|
|
+ // filename: 1,
|
|
|
+ // },
|
|
|
};
|
|
|
const config = {
|
|
|
params: {
|
|
@@ -907,12 +907,13 @@ const getPrivateGroups = async () => {
|
|
|
let ret: any = await axios.post(
|
|
|
'/api/data/folders/list',
|
|
|
{
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- _id: 1,
|
|
|
- name: 1,
|
|
|
- list: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // _id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // list: 1,
|
|
|
+ // },
|
|
|
+ projection:'image,_id,name,list',
|
|
|
// query: {
|
|
|
// type: `v-components`,
|
|
|
// },
|
|
@@ -953,12 +954,13 @@ const getUserComponents = async () => {
|
|
|
let ret: any = await axios.post(
|
|
|
'/api/data/folders/list',
|
|
|
{
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- _id: 1,
|
|
|
- name: 1,
|
|
|
- list: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // _id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // list: 1,
|
|
|
+ // },
|
|
|
+ projection:'image,_id,name,list',
|
|
|
// query: {
|
|
|
// type: `v.component`,
|
|
|
// },
|
|
@@ -993,12 +995,13 @@ const getUserProjects = async (type: string) => {
|
|
|
let ret: any = await axios.post(
|
|
|
'/api/data/folders/list',
|
|
|
{
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- _id: 1,
|
|
|
- name: 1,
|
|
|
- list: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // _id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // list: 1,
|
|
|
+ // },
|
|
|
+ projection:'image,_id,name,list',
|
|
|
// query: {
|
|
|
// type,
|
|
|
// },
|
|
@@ -1027,12 +1030,13 @@ const getPrivateProjects = async (type: string) => {
|
|
|
// folder: '',
|
|
|
// tags: type === 'v-template' ? '模板' : '方案',
|
|
|
// },
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- _id: 1,
|
|
|
- name: 1,
|
|
|
- tags: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // _id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // tags: 1,
|
|
|
+ // },
|
|
|
+ projection:'image,_id,name,tags'
|
|
|
};
|
|
|
const config = {
|
|
|
params: {
|
|
@@ -1222,12 +1226,13 @@ const getPrivateGraphics = async () => {
|
|
|
if (item.name === '默认') {
|
|
|
const data = {
|
|
|
// query: { folder: '' },
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- _id: 1,
|
|
|
- name: 1,
|
|
|
- component: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // _id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // component: 1,
|
|
|
+ // },
|
|
|
+ projection:'image,_id,name,component'
|
|
|
};
|
|
|
const config = {
|
|
|
params: {
|
|
@@ -1241,11 +1246,12 @@ const getPrivateGraphics = async () => {
|
|
|
}
|
|
|
} else if (item.name === '3D') {
|
|
|
const data = {
|
|
|
- projection: {
|
|
|
- image: 1,
|
|
|
- _id: 1,
|
|
|
- name: 1,
|
|
|
- },
|
|
|
+ // projection: {
|
|
|
+ // image: 1,
|
|
|
+ // _id: 1,
|
|
|
+ // name: 1,
|
|
|
+ // },
|
|
|
+ projection:'image,_id,name'
|
|
|
};
|
|
|
const config = {
|
|
|
params: {
|
|
@@ -1639,7 +1645,7 @@ const onMenu = async (val: string) => {
|
|
|
if (imageDrive && filename.startsWith(imageDrive)) {
|
|
|
filename = filename.slice(imageDrive.length);
|
|
|
}
|
|
|
- let fullname: string =
|
|
|
+ let path: string =
|
|
|
contextmenu.component.filename || contextmenu.component.image;
|
|
|
//更新缩略图位置
|
|
|
// await axios.post('/api/files/update', {
|
|
@@ -1648,7 +1654,10 @@ const onMenu = async (val: string) => {
|
|
|
// });
|
|
|
// 原接口路径是 /api/file/{fullname}
|
|
|
// 因为img的路径中包含file,所以做如下拼接
|
|
|
- await axios.patch(`/api${fullname}`, {
|
|
|
+ if(!path.startsWith('/api')) {
|
|
|
+ path = '/api' + path;
|
|
|
+ }
|
|
|
+ await axios.patch(`${path}`, {
|
|
|
// filenames: [filename],
|
|
|
directory: `/大屏/${activedGroup.value}/${val || '默认'}`,
|
|
|
});
|
|
@@ -1785,6 +1794,9 @@ const delComponent = async () => {
|
|
|
if(fullname.startsWith('/file')) {
|
|
|
fullname = fullname.slice('/file'.length);
|
|
|
}
|
|
|
+ if(fullname.startsWith('/api/file/')) {
|
|
|
+ fullname = fullname.slice('/api/file/'.length);
|
|
|
+ }
|
|
|
await axios.post(`/api/files/delete`, {
|
|
|
fullnames: [fullname],
|
|
|
physically: false,
|