Bläddra i källkod

fix: 修改需求

bill 1 dag sedan
förälder
incheckning
e96500bb4a

+ 14 - 10
src/core/components/serial/index.ts

@@ -31,7 +31,7 @@ export { default as GroupComponent } from "./serial-group.vue";
 export { default as Component } from "./serial.vue";
 export { default as TempComponent } from "./temp-serial.vue";
 
-export const defaultTableStyle = installGlobalStyle('serialTable', {
+export const defaultTableStyle = installGlobalStyle("serialTable", {
   right: 44,
   top: 175,
   fontSize: 16,
@@ -42,16 +42,16 @@ export const defaultTableStyle = installGlobalStyle('serialTable', {
   repColCount: 1,
   tableStrokeWidth: 1,
 });
-export const shapeName = ui18n.t('shape.serial.name');
+export const shapeName = ui18n.t("shape.serial.name");
 export const addMode = "dot";
-export const defaultStyle = installGlobalStyle('serial', {
+export const defaultStyle = installGlobalStyle("serial", {
   ...circleDefaultStyle,
   strokeWidth: 2,
 });
 
 export const fixedStrokeOptions: number[] = [];
 export const autoGenTable = ref(true);
-export type SerialData = CircleData & { joinIds?: string[] };
+export type SerialData = CircleData & { joinIds?: string[], hideSerial?: boolean };
 
 export const getSerialFontW = (data: SerialData) => {
   const fontSize = data.fontSize || defaultStyle.fontSize;
@@ -163,7 +163,7 @@ export const delItemRaw = (
 };
 
 export const joinKey = "serial-table";
-export const tableTitle = ui18n.t('shape.serial.tableTitle');
+export const tableTitle = ui18n.t("shape.serial.tableTitle");
 export const delItem = (store: DrawStore, item: SerialData) => {
   const table = store
     .getTypeItems("table")
@@ -214,7 +214,7 @@ const getTempContents = () => {
     tempContents.push(
       {
         key: "preset-col",
-        content: ui18n.t('shape.serial.head1'),
+        content: ui18n.t("shape.serial.head1"),
         readonly: true,
         notdel: true,
         width: defaultTableStyle.nameColWidth,
@@ -224,7 +224,7 @@ const getTempContents = () => {
       },
       {
         key: "preset-col",
-        content: ui18n.t('shape.serial.head2'),
+        content: ui18n.t("shape.serial.head2"),
         readonly: true,
         notdel: true,
         width: defaultTableStyle.valueColWidth,
@@ -331,21 +331,23 @@ export const syncTable = (table: TableData, items: SerialData[]) => {
     let colNdx = (i % colCount) * 2;
     const val = item.desc || oldData[item.id] || "";
     if (colNdx) {
-      table.content[rowNdx][colNdx].content = item.content!;
+      table.content[rowNdx][colNdx].content = item.hideSerial ? '' : item.content!;
       table.content[rowNdx][colNdx + 1].content = val;
       table.content[rowNdx][colNdx + 1].joinId = item.id;
     } else {
-      table.height += tempRow[0].height;
+      table.height += defaultTableStyle.colHeight;
       let cols = [
         {
           ...tempRow[0],
-          content: item.content!,
+          height: defaultTableStyle.colHeight,
+          content: item.hideSerial ? '' : item.content!,
           readonly: false,
           hidden: false,
           key: "serial-name",
         },
         {
           ...tempRow[1],
+          height: defaultTableStyle.colHeight,
           content: val,
           readonly: false,
           hidden: false,
@@ -357,6 +359,7 @@ export const syncTable = (table: TableData, items: SerialData[]) => {
         cols.push(
           {
             ...tempRow[2],
+            height: defaultTableStyle.colHeight,
             readonly: false,
             content: "",
             hidden: false,
@@ -364,6 +367,7 @@ export const syncTable = (table: TableData, items: SerialData[]) => {
           },
           {
             ...tempRow[3],
+            height: defaultTableStyle.colHeight,
             content: "",
             readonly: false,
             hidden: false,

+ 1 - 1
src/example/components/slide/actions.ts

@@ -224,7 +224,7 @@ export const paper = {
       key: "a4",
       name: ui18n.t('sys.actions.paper.A4_h'),
       handler: (draw: Draw) =>
-        setPaper(draw, paperConfigs.a4.size, paperConfigs.a4.scale),
+        setPaper(draw, paperConfigs.a4.size, paperConfigs.a4.scale)
     },
     // {
     //   value: uuid(),

+ 2 - 2
src/example/fuse/enter-case.ts

@@ -27,8 +27,8 @@ window.platform.login = (isBack = true) => {
           // userName: "super-admin",
 
           password: encodePwd('Aa123456'),
-          username: "super-admin",
-          userName: "super-admin",
+          username: "20迈",
+          userName: "20迈",
 
         })
         .then((res) => {

+ 2 - 2
src/example/fuse/enter.ts

@@ -19,8 +19,8 @@ window.platform.login = (isBack = true) => {
         password: encodePwd("Aa123456"),
         // username: "super-admin",
         // userName: "super-admin",
-        username: "潘少爷",
-        userName: "潘少爷",
+        username: "20迈",
+        userName: "20迈",
         
       })
       .then((res) => {

+ 6 - 2
src/example/fuse/views/tabulation/index.vue

@@ -196,12 +196,14 @@ const setMapHandler = async (config: { url: string; size: Size }) => {
       }
       return {
         ...item,
+        hideSerial: false,
         desc,
       };
     });
 
     // 找出没有关联的痕迹物证
-    overview.image?.forEach((image) => {
+    const images = [...(overview.image || []), ...(overview.icon || [])]
+    images?.forEach((image) => {
       if (
         image.key !== "trace" ||
         syncSerials.some((item) => item.joinIds?.includes(image.id))
@@ -211,6 +213,7 @@ const setMapHandler = async (config: { url: string; size: Size }) => {
       syncSerials.push({
         id: image.id,
         content: getCurrentNdxRaw(syncSerials),
+        hideSerial: true,
         desc: image.name || "",
       } as any);
     });
@@ -228,7 +231,8 @@ const setMapHandler = async (config: { url: string; size: Size }) => {
       }
     }
 
-    syncTable(table, syncSerials);
+    draw.value?.runHook(() => syncTable(table, syncSerials))
+    
 
     if (serialTable.value) {
       d.history.preventTrack(() => {

+ 6 - 29
src/example/fuse/views/tabulation/slide.vue

@@ -7,12 +7,11 @@ import Slide from "../../../components/slide/slide.vue";
 import {
   paper as paperRaw,
   text,
-  serial,
   table,
   test,
   PaperKey,
   draw as drawMenuRaw,
-  selectMap,
+  initViewport,
 } from "../../../components/slide/actions.ts";
 import { useDraw } from "../../../components/container/use-draw.ts";
 import { computed, nextTick, reactive, watch } from "vue";
@@ -43,14 +42,14 @@ const paper = reactive({
 const drawMenu = copy(drawMenuRaw);
 drawMenu.children!.shift();
 drawMenu.children!.shift();
-drawMenu.name = ui18n.t('tagging.name');
+drawMenu.name = ui18n.t("tagging.name");
 
 let tileGroups: TileGroup[];
 loading(window.platform.getTileGroups()).then((data: any) => (tileGroups = data));
 
 const mark = {
   icon: "info",
-  name: ui18n.t('mark.name'),
+  name: ui18n.t("mark.name"),
   value: uuid(),
   defSelect: true,
   children: [
@@ -62,31 +61,7 @@ const mark = {
   ],
 };
 
-const menus = reactive([
-  paper,
-  // {
-  //   value: uuid(),
-  //   icon: "map",
-  //   name: "地图",
-  //   handler: async () => {
-  //     const result = await selectMap({
-  //       search: window.platform.searchAddress,
-  //       activeGroupIndex: 0,
-  //       tileGroups,
-  //     });
-  //     emit("updateMapImage", { url: result.url, size: result.info.size });
-  //   },
-  // },
-  drawMenu,
-  // {
-  //   icon: "legend",
-  //   name: "图例",
-  //   value: uuid(),
-  //   mount: (props: any) =>
-  //     h(SlideIcons, { ...props, groups: [iconGroups[iconGroups.length - 1]] }),
-  // },
-  mark,
-]);
+const menus = reactive([paper, drawMenu, mark]);
 
 const setPaperAfterHandler = async (paperKey: PaperKey, _oldPaperKey?: PaperKey) => {
   let isUpdate = false;
@@ -106,7 +81,9 @@ const setPaperAfterHandler = async (paperKey: PaperKey, _oldPaperKey?: PaperKey)
   //   }
   // }
   paperRaw.children.find((item) => item.key === paperKey)!.handler(draw);
+
   await nextTick();
+  initViewport(draw, 0.05);
   if (!isUpdate) return;
 
   const data = await genTabulationData(

+ 1 - 1
src/lang/locales/zh.json

@@ -38,7 +38,7 @@
   },
   "cover": {
     "fixProportion": "缩放比例",
-    "itemName": "比例",
+    "itemName": "视图",
     "showProportion": "显示比例"
   },
   "describes": {