فهرست منبع

feat:conflict

ananzhusen 1 ماه پیش
والد
کامیت
3d999ecac2
1فایلهای تغییر یافته به همراه20 افزوده شده و 3 حذف شده
  1. 20 3
      src/views/components/Graphics.vue

+ 20 - 3
src/views/components/Graphics.vue

@@ -451,15 +451,17 @@ import DataSource from './DataSource.vue';
 import Structure from './Structure.vue';
 import { useDot } from '@/services/common';
 import { getToken  } from '@le5le/auth-token';
+import { activedGroup, activeAssets, useProject } from '@/services/project';
 
+const { data:projectData } = useProject();
 const { dot } = useDot();
 const { user } = useUser();
 const { setFolder, getFolder } = useFolder();
 const router = useRouter();
 const route = useRoute();
 const { select } = useSelection();
-const activedGroup = ref('');
-const activeAssets = ref('system');
+// const activedGroup = ref('');
+// const activeAssets = ref('system');
 let groups = reactive([]);
 let moveGroups = reactive<any>({
   '方案':[],
@@ -657,7 +659,15 @@ const assetsChange = (value) => {
       activedGroup.value = '数据';
     }
   }else if(value === 'structure'){
-    groups = structureGroups;
+    groups = deepClone(structureGroups);
+    if(projectData.tree?.length){
+      groups.unshift(
+        {
+        icon: 'layers',
+        name: '工程',
+        key: '',
+      });
+    }
     activedGroup.value = '图层';
   }
   groupChange(activedGroup.value);
@@ -845,6 +855,13 @@ const groupChange = async (name: string) => {
 
   searchGraphics();
 };
+
+defineExpose({
+  assetsChange,
+  groupChange
+})
+
+
 // TODO 获取方案文件
 //获取方案文件夹
 const getCollectionImageList = async (name?: string, collection?: string, system?:boolean, template?:boolean) => {