bill hace 1 año
padre
commit
b3971f8e6d
Se han modificado 4 ficheros con 14 adiciones y 6 borrados
  1. 2 2
      src/view/map/map-right.vue
  2. 8 3
      src/view/map/pc4Helper.ts
  3. 3 1
      src/view/scene-select.vue
  4. 1 0
      src/view/scene.vue

+ 2 - 2
src/view/map/map-right.vue

@@ -93,7 +93,7 @@
         type="primary"
         :icon="Download"
         style="width: 100%"
-        @click="exportFile(getSelectPoints(), 2)"
+        @click="exportFile(getSelectPoints(), 2, relics?.name)"
       >
         导出本体边界坐标
       </el-button>
@@ -101,7 +101,7 @@
         type="primary"
         :icon="Download"
         style="width: 100%; margin-top: 20px; margin-left: 0"
-        @click="exportFile(getSelectPoints(), 1)"
+        @click="exportFile(getSelectPoints(), 1, relics?.name)"
       >
         导出绘制矢量数据
       </el-button>

+ 8 - 3
src/view/map/pc4Helper.ts

@@ -10,11 +10,16 @@ import {
   downloadPointsXLSL2,
 } from "@/util/pc4xlsl";
 
-export const exportFile = async (points: ScenePoint[], type: number) => {
+export const exportFile = async (
+  points: ScenePoint[],
+  type: number,
+  name: string = ""
+) => {
   if (!points.length) {
     ElMessage.error("请选择要导出的点位");
     return;
   }
+  name = name ? name + "-" : "";
   points = points.filter((point) => !!point.pos);
 
   if (points.length === 0) {
@@ -25,13 +30,13 @@ export const exportFile = async (points: ScenePoint[], type: number) => {
     await downloadPointsXLSL1(
       points.map((point) => point.pos),
       points.map((point) => ({ title: point.name, desc: point.name })),
-      "绘制矢量数据"
+      name + "绘制矢量数据"
     );
   } else if (type === 2) {
     await downloadPointsXLSL2(
       points.map((point) => point.pos),
       points.map((point) => ({ title: point.name, desc: "无" })),
-      "本体边界坐标"
+      name + "本体边界坐标"
     );
   } else {
     await downloadPointsXLSL(

+ 3 - 1
src/view/scene-select.vue

@@ -40,7 +40,7 @@ const tableProps = {
       ({ sceneCode }) => !originSceneCodes.includes(sceneCode)
       // || !val.some((scene) => scene.sceneCode === sceneCode)
     );
-    console.log(val, [...simpleScenes.value]);
+    console.log(val, [...simpleScenes.value], originSceneCodes);
 
     let tip = false;
     simpleScenes.value.push(
@@ -81,6 +81,7 @@ const tableProps = {
     tip = false;
   },
   tableDataChange(val: Scene[]) {
+    loaded.value = false;
     originScenes.value = val;
     setTimeout(checkedTable);
   },
@@ -91,6 +92,7 @@ let time: NodeJS.Timeout;
 const checkedTable = () => {
   if (tableProps.tableRef.value) {
     tableProps.tableRef.value!.clearSelection();
+    console.log("1");
     scenes.value.forEach((item) => {
       tableProps.tableRef.value!.toggleRowSelection(item, true);
     });

+ 1 - 0
src/view/scene.vue

@@ -72,6 +72,7 @@
       <el-table
         :data="sceneArray"
         border
+        row-key="'sceneCode'"
         @selection-change="(val) => tableProps && tableProps.selectionChange(val)"
         :ref="(table) => tableProps && (tableProps.tableRef.value = table)"
       >