Преглед изворни кода

feat: 优化评价模块和设备菜单功能

zhanghaijun пре 11 месеци
родитељ
комит
bd2abd1c71

+ 2 - 2
develop/course/json/device/menus.json

@@ -1,5 +1,5 @@
 {
-    "left": [
+    "right": [
         {
             "device": "400501001",
             "name": "母线",
@@ -65,7 +65,7 @@
             ]
         }
     ],
-    "right": [
+    "left": [
         {
             "device": "400500005",
             "name": "断路器1",

+ 34 - 15
src/components/business/meta2d/Meta2dView.vue

@@ -6,6 +6,7 @@
   示例:https://github.com/le5le-com/meta2d.js/tree/main/examples/diagram-editor-vue3
   Github: https://github.com/le5le-com/meta2d.js
   Gitee:https://gitee.com/le5le/meta2d.js
+  事件监听:https://doc.le5le.com/document/119626293?id=119626293
 -->
 <template>
   <div class="relative">
@@ -15,8 +16,8 @@
 </template>
 
 <script lang="ts" setup>
-  import { onMounted, onUnmounted, ref, watch, nextTick } from 'vue'
-  import { Meta2d, Pen } from '@meta2d/core'
+  import { onMounted, onUnmounted, ref, nextTick } from 'vue'
+  import { Meta2d, Pen, Point } from '@meta2d/core'
   // import { Meta2d, Pen, register, registerAnchors, registerCanvasDraw } from '@meta2d/core'
   // import { flowPens, flowAnchors } from '@meta2d/flow-diagram'
   // import { activityDiagram, activityDiagramByCtx } from '@meta2d/activity-diagram'
@@ -33,7 +34,7 @@
     preview: false
   })
 
-  const metaDta = ref<any>({})
+  const metaDta = ref<any>()
 
   // 组件内部引用
   const container = ref<HTMLDivElement | null>(null)
@@ -63,9 +64,26 @@
     // registerCanvasDraw(ftaPensbyCtx())
     // registerAnchors(ftaAnchors())
 
+    // meta2d.on<(Pen & { x: number; y: number })[]>('active', (event) => {
+    //   if (!event || event?.length === 0) return
+    //   const item = event.find((item: any) => item?.id)
+    //   if (!item) return
+    //   const tags: string[] = []
+    //   if (item?.id) tags.push(item?.id)
+    //   if (item?.parentId) tags.push(item?.parentId)
+    //   if (item?.tags && item.tags.length > 0) tags.push(...item.tags)
+    //   console.log('active', item)
+    //   showDeviceMenu('click', item.x, item.y, tags)
+    // })
+
+    meta2d.on<Point & Pen>('click', (event) => {
+      console.log('event', event)
+    })
+
     // click 事件 - 鼠标单击时触发
-    meta2d.on<{ x: number; y: number; pen?: Pen }>('click', (event) => {
+    meta2d.on<Point & { pen: Pen }>('click', (event) => {
       if (!event?.pen) return
+      console.log('click', event)
       const tags: string[] = []
       if (event.pen?.id) tags.push(event.pen?.id)
       if (event.pen?.parentId) tags.push(event.pen?.parentId)
@@ -77,6 +95,7 @@
     // contextmenu 事件 - 鼠标右击时触发
     meta2d.on<{ pen?: Pen; e: { x: number; y: number } }>('contextmenu', (event) => {
       if (!event?.pen) return
+      console.log('contextmenu', event)
       const tags: string[] = []
       if (event.pen?.id) tags.push(event.pen?.id)
       if (event.pen?.parentId) tags.push(event.pen?.parentId)
@@ -97,7 +116,7 @@
   }
 
   const openData = () => {
-    const rawData = unref(metaDta) || {}
+    const rawData = unref(metaDta) || props.data
     const data = JSON.parse(JSON.stringify(rawData))
     if (data && data.pens && data.pens.length > 0) {
       if (props.preview) data.locked = 1
@@ -113,16 +132,16 @@
   }
 
   // 支持外部更新数据
-  watch(
-    () => props.data,
-    (val) => {
-      if (val) {
-        metaDta.value = val
-        openData()
-      }
-    },
-    { deep: true }
-  )
+  // watch(
+  //   () => props.data,
+  //   (val) => {
+  //     if (val) {
+  //       metaDta.value = val
+  //       openData()
+  //     }
+  //   },
+  //   { deep: true }
+  // )
 
   onMounted(() =>
     nextTick(() => {

+ 9 - 6
src/components/business/meta2d/device_menu.vue

@@ -14,6 +14,7 @@
 
   const menuRef = ref<InstanceType<typeof ArtMenuRight>>()
   const deviceTtags = ref<string[]>([])
+  const menuType = ref<string>('')
 
   // 右键菜单选项
   const menuItems = ref<MenuItemType[]>([])
@@ -34,12 +35,13 @@
   const sendCommand = async (label: string, status: number) => {
     const tag = deviceTtags.value.find((item) => item.startsWith('{'))
     if (!tag) return
-    await request.post('/serverctrl/seteqpmtoper', {
-      LqpTtStTD: tag,
-      CMDType: 0,
-      fValue: status
-    })
-    ElMessage.success(`指令[${label}]下发成功`)
+    if (menuType.value === 'click') {
+      await request.post('/serverctrl/seteqpmtoper', { EqpmtStrID: tag, CMDType: 0, EqpmtStatus: status })
+      ElMessage.success(`设备故障指令[${label}]下发成功`)
+    } else {
+      await request.post('/serverctrl/seteqpmtfault', { EqpmtStrID: tag, EventType: 1, EventId: status })
+      ElMessage.success(`设备控制指令[${label}]下发成功`)
+    }
   }
 
   // 左键菜单
@@ -75,6 +77,7 @@
   defineExpose({
     show: (type: string, x: number, y: number, tags: string[]) => {
       deviceTtags.value = tags || []
+      menuType.value = type
       switch (type) {
         case 'click':
           menuItems.value = findMenu(leftMenu.value, tags)

+ 3 - 2
src/views/dashboard/console/index.vue

@@ -70,8 +70,9 @@
   const router = useRouter()
 
   const openPage = (url: string) => {
-    const routeUrl = router.resolve(url)
-    window.open(window.location.origin + routeUrl.href, '_blank')
+    router.push(url)
+    // const routeUrl = router.resolve(url)
+    // window.open(window.location.origin + routeUrl.href, '_blank')
   }
 </script>
 

+ 7 - 7
src/views/train/course/list/index.vue

@@ -40,6 +40,13 @@
             <dic v-else></dic>
             <div class="type-tag">{{ (item.totalDuration ?? 0) + ' 分钟' }}</div>
           </div>
+          <div v-if="isRun && runCourseID && String(runCourseID) === String(item.courseID)" class="absolute inset-0 flex flex-col items-center justify-center bg-black/40 text-white backdrop-blur-sm">
+            <svg xmlns="http://www.w3.org/2000/svg" class="mb-2 h-10 w-10 animate-pulse" fill="currentColor" viewBox="0 0 16 16">
+              <path d="M6.79 5.093A.5.5 0 0 1 7.5 5.5v5a.5.5 0 0 1-.79.407L4.5 8.972V7.028l2.29-1.935z" />
+              <path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4z" />
+            </svg>
+            <span class="text-sm font-semibold">▶ 正在开课</span>
+          </div>
         </div>
         <div class="course-foot space-y-1">
           <div class="flex justify-between">
@@ -72,13 +79,6 @@
               <el-button type="primary" size="default" class="w-1/4" :icon="CopyDocument" @click="handleChange('copy', item)">复制 </el-button>
             </el-button-group>
           </slot>
-          <div v-if="isRun && runCourseID && String(runCourseID) === String(item.courseID)" class="absolute inset-0 flex flex-col items-center justify-center bg-black/40 text-white backdrop-blur-sm">
-            <svg xmlns="http://www.w3.org/2000/svg" class="mb-2 h-10 w-10 animate-pulse" fill="currentColor" viewBox="0 0 16 16">
-              <path d="M6.79 5.093A.5.5 0 0 1 7.5 5.5v5a.5.5 0 0 1-.79.407L4.5 8.972V7.028l2.29-1.935z" />
-              <path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4z" />
-            </svg>
-            <span class="text-sm font-semibold">▶ 正在开课</span>
-          </div>
         </div>
       </div>
     </div>

+ 0 - 1
src/views/train/course/list/search.vue

@@ -33,7 +33,6 @@
   const formItems = computed(() => [
     { label: '课程ID', key: 'courseID', type: 'input', placeholder: '请输入课程ID', clearable: true },
     { label: '课程名称', key: 'courseName', type: 'input', placeholder: '请输入课程名称', clearable: true },
-    { label: '培训计划', key: 'trainPlan', type: 'datetime', props: { style: { width: '100%' }, placeholder: '请选择日期', type: 'date', valueFormat: 'YYYY-MM-DD' } },
     { label: '课程分类', key: 'typeID', type: 'select', placeholder: '请选择课程分类', clearable: true, options: dictStore.getDictWithCode('course_category') || [] },
     { label: '线路号', key: 'lineNo', type: 'select', placeholder: '请输入线路号', clearable: true, options: dictStore.getDictWithCode('course_line') || [] },
     { label: '运行图', key: 'runningMap', type: 'select', placeholder: '请输入运行图', clearable: true, options: dictStore.getDictWithCode('course_run_map') || [] },

+ 1 - 1
src/views/train/course/trainer_teacher/record-list.vue

@@ -83,7 +83,7 @@
   const searchFormData = ref<{ trainerName: string; runDateTime: string[] }>({ trainerName: '', runDateTime: [] })
 
   const searchItems = [
-    { label: '教员名称', key: 'trainerName', type: 'input', placeholder: '请输入教员名称', clearable: true, span: 8 },
+    { label: '人员名称', key: 'trainerName', type: 'input', placeholder: '请输入教员名称', clearable: true, span: 8 },
     {
       label: '运行时间',
       key: 'runDateTime',

+ 1 - 1
src/views/train/evaluation/index.vue

@@ -28,7 +28,7 @@
         <div>{{ seconds }}</div>
       </div>
     </div>
-    <ListEvaluation :runLogID="runLogID" @refresh="findRunRecord" />
+    <ListEvaluation :runLogID="runLogID" :courseID="runRecord?.runCourseID ?? 0" @refresh="findRunRecord" />
   </div>
 </template>
 

+ 14 - 12
src/views/train/evaluation/list-referee-add.vue

@@ -9,6 +9,7 @@
   import { RefereeAddRequest, RefereeServer } from './referee.api'
 
   const runLogID = ref<number>(0)
+  const courseId = ref<number>(0)
   const emit = defineEmits<{ (e: 'success'): void }>()
 
   const [Dialog, dialogApi] = useDialog({
@@ -18,9 +19,9 @@
       formApi.validate().then(async () => {
         const values = await formApi.getValues()
         const params: RefereeAddRequest = {
-          seqNo: values.seqNo,
+          seqNo: 0,
           runLogID: runLogID.value,
-          runCourseID: values.runCourseID,
+          runCourseID: courseId.value,
           evaType: values.evaType,
           evaName: values.evaName,
           evaTargetRole: values.evaTargetRole,
@@ -39,15 +40,15 @@
   const [BasicForm, formApi] = useForm({
     labelWidth: '120px',
     schema: [
-      { colSpan: 12, prop: 'seqNo', label: '序号', component: 'InputNumber', defaultValue: 10, componentProps: { min: 1, max: 200 }, rules: [{ required: true, message: '请输入序号' }] },
-      {
-        colSpan: 12,
-        prop: 'runCourseID',
-        label: '课程id',
-        component: 'ApiSelect',
-        componentProps: { api: '/course/list', labelField: 'courseName', valueField: 'courseID' },
-        rules: [{ required: true, message: '请输入课程id' }]
-      },
+      // { colSpan: 12, prop: 'seqNo', label: '序号', component: 'InputNumber', defaultValue: 10, componentProps: { min: 1, max: 200 }, rules: [{ required: true, message: '请输入序号' }] },
+      // {
+      //   colSpan: 12,
+      //   prop: 'runCourseID',
+      //   label: '课程id',
+      //   component: 'ApiSelect',
+      //   componentProps: { api: '/course/list', labelField: 'courseName', valueField: 'courseID' },
+      //   rules: [{ required: true, message: '请输入课程id' }]
+      // },
       {
         colSpan: 12,
         prop: 'evaType',
@@ -89,8 +90,9 @@
     ]
   })
   defineExpose({
-    show(num: number) {
+    show(num: number, course: number) {
       runLogID.value = num
+      courseId.value = course
       dialogApi.open()
     }
   })

+ 2 - 2
src/views/train/evaluation/list-referee.vue

@@ -62,7 +62,7 @@
         { prop: 'targetRoleName', label: '评价目标角色' },
         { prop: 'evaSource', label: '评价来源', formatter: (row: RefereeData) => (row.evaSource === 0 ? '流程图' : row.evaSource === 1 ? '教员自定义' : '未知') },
         { prop: 'evaType', label: '评价类型', formatter: (row: RefereeData) => (row.evaType === 0 ? '主观评价' : row.evaType === 1 ? '客观评价' : '未知') },
-        { prop: 'operName', label: '节点名称', width: '250px' },
+        { prop: 'evaName', label: '节点名称', width: '250px' },
         { prop: 'operScore', label: '操作得分' },
         { prop: 'operTime', label: '操作时间' },
         { prop: 'evaDeduction', label: '评价失分', useSlot: true, width: 180 },
@@ -78,7 +78,7 @@
       return
     }
     if (prop === 'isOperated') {
-      await RefereeServer.isOperated(row.runLogID, row.runOperID, Number(row.isOperated))
+      await RefereeServer.isOperated(row.runLogID, row.seqNo, Number(row.isOperated))
     } else {
       await RefereeServer.update({
         seqNo: row.seqNo,

+ 2 - 2
src/views/train/evaluation/list.vue

@@ -22,7 +22,7 @@
   import ListReferee from './list-referee.vue'
   import { RefereeServer } from './referee.api'
   import request from '@/api'
-  const props = defineProps({ runLogID: { type: Number, default: 0 } })
+  const props = defineProps({ runLogID: { type: Number, default: 0 }, courseID: { type: Number, default: 0 } })
   // tabs
   const activeTab = ref<'operation' | 'referee'>('referee')
 
@@ -35,7 +35,7 @@
     ElMessage.success('操作记录导出成功')
   }
   const refereeTableRef = ref()
-  const addReferee = () => refereeTableRef.value?.add()
+  const addReferee = () => refereeTableRef.value?.add(props.runLogID, props.courseID)
   const exportReferee = async () => {
     await RefereeServer.export(props.runLogID)
     ElMessage.success('点子考评导出成功')

+ 1 - 1
src/views/train/evaluation/referee.api.ts

@@ -28,5 +28,5 @@ export class RefereeServer {
   public static add = (data: RefereeAddRequest) => request.post('/evalog/add', data)
   public static remove = (runLogID: number, runOperID: number) => request.post('/evalog/delete', { runLogID, runOperID })
   public static update = (data: RefereeAddRequest) => request.post('/evalog/update', data)
-  public static isOperated = (runLogID: number, runOperID: number, isOperated: number) => request.post('/eva/setoperated', { runLogID, runOperID, isOperated })
+  public static isOperated = (runLogID: number, seqNo: number, isOperated: number) => request.post('/eva/setoperated', { runLogID, seqNo, isOperated })
 }

+ 0 - 593
src/views/train/fault/demo.json

@@ -1,593 +0,0 @@
-{
-    "x": 67,
-    "y": 134,
-    "scale": 1,
-    "pens": [
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "18e65f",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "18e65f",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "18e65f",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "18e65f",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "center": {
-                "x": 566,
-                "y": 344
-            },
-            "children": [
-                "dc890e4",
-                "4244017"
-            ],
-            "componentId": "019a4484-9d89-7ed0-972f-115ec21073ff",
-            "ex": 616,
-            "ey": 394,
-            "fontSize": 12,
-            "form": [
-                {
-                    "dataIds": {
-                        "dataId": "d-1-a-001",
-                        "name": "车辆"
-                    },
-                    "isNotString": true,
-                    "key": "showChild",
-                    "language": "json",
-                    "name": "状态变更",
-                    "title": "json",
-                    "type": "text"
-                }
-            ],
-            "height": 100,
-            "id": "18e65f",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "name": "combine",
-            "originId": "13ead0f",
-            "rotate": 0,
-            "showChild": 0,
-            "tags": [
-                "动力变压器",
-                "400500003"
-            ],
-            "width": 100,
-            "x": 388,
-            "y": 262
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "dc890e4",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "dc890e4",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "dc890e4",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "dc890e4",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "canvasLayer": 2,
-            "children": [],
-            "ex": 1,
-            "ey": 1,
-            "fontSize": 12,
-            "form": [
-                {
-                    "key": "text",
-                    "name": "文本",
-                    "type": "text"
-                }
-            ],
-            "height": 1,
-            "id": "dc890e4",
-            "image": "https://haijunit.icu/course/oss/icon/%E5%8A%A8%E5%8A%9B%E5%8F%98%E5%8E%8B%E5%99%A8%E5%A4%B1%E7%94%B5.svg",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 0,
-            "locked": 0,
-            "name": "square",
-            "originId": "7fd3e723",
-            "parentId": "18e65f",
-            "rotate": 0,
-            "tags": [
-                "动力变压器失电",
-                "400500003"
-            ],
-            "text": "",
-            "width": 1,
-            "x": 0,
-            "y": 0
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "4244017",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "4244017",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "4244017",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "4244017",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "canvasLayer": 2,
-            "children": [],
-            "ex": 1,
-            "ey": 1,
-            "fontSize": 12,
-            "form": [
-                {
-                    "key": "text",
-                    "name": "文本",
-                    "type": "text"
-                }
-            ],
-            "height": 1,
-            "id": "4244017",
-            "image": "https://haijunit.icu/course/oss/icon/%E5%8A%A8%E5%8A%9B%E5%8F%98%E5%8E%8B%E5%99%A8%E5%B8%A6%E7%94%B5.svg",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 0,
-            "locked": 0,
-            "name": "square",
-            "originId": "158e2c13",
-            "parentId": "18e65f",
-            "rotate": 0,
-            "tags": [
-                "400500003",
-                "动力变压器带电"
-            ],
-            "text": "",
-            "width": 1,
-            "x": 0,
-            "y": 0
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "70a9a770",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "70a9a770",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "70a9a770",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "70a9a770",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "borderRadius": 0.1,
-            "children": [],
-            "color": "rgba(48, 238, 220, 1)",
-            "fontSize": 12,
-            "height": 50,
-            "id": "70a9a770",
-            "lineAnimateImages": [],
-            "lineCap": "butt",
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "name": "rectangle",
-            "rotate": 0,
-            "text": "组件:动力变压器",
-            "width": 200,
-            "x": 338,
-            "y": 197
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "3779cde",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "3779cde",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "3779cde",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "3779cde",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "borderRadius": 0.1,
-            "children": [],
-            "color": "rgba(48, 238, 220, 1)",
-            "fontSize": 12,
-            "height": 50,
-            "id": "3779cde",
-            "lineAnimateImages": [],
-            "lineCap": "butt",
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "name": "rectangle",
-            "rotate": 0,
-            "text": "图元组合状态",
-            "width": 200,
-            "x": 906,
-            "y": 182
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "fda63a3",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "fda63a3",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "fda63a3",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "fda63a3",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "canvasLayer": 2,
-            "children": [],
-            "fontSize": 12,
-            "form": [
-                {
-                    "key": "text",
-                    "name": "文本",
-                    "type": "text"
-                }
-            ],
-            "height": 100,
-            "id": "fda63a3",
-            "image": "https://haijunit.icu/course/oss/icon/%E5%A4%87%E8%87%AA%E6%8A%95%E5%88%86%E9%97%B8.svg",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "name": "square",
-            "rotate": 0,
-            "tags": [
-                "备自投分闸"
-            ],
-            "text": "",
-            "width": 100,
-            "x": 906,
-            "y": 283
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "0ffa34f",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "0ffa34f",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "0ffa34f",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "0ffa34f",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "center": {
-                "x": 1056,
-                "y": 433
-            },
-            "children": [
-                "e7276ed",
-                "4dcf52a0"
-            ],
-            "ex": 1106,
-            "ey": 483,
-            "fontSize": 12,
-            "height": 100,
-            "id": "0ffa34f",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "name": "combine",
-            "rotate": 0,
-            "showChild": 0,
-            "tags": [
-                "备自投"
-            ],
-            "width": 100,
-            "x": 1006,
-            "y": 383
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "e7276ed",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "e7276ed",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "e7276ed",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "e7276ed",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "canvasLayer": 2,
-            "children": [],
-            "ex": 1,
-            "ey": 1,
-            "fontSize": 12,
-            "form": [
-                {
-                    "key": "text",
-                    "name": "文本",
-                    "type": "text"
-                }
-            ],
-            "height": 1,
-            "id": "e7276ed",
-            "image": "https://haijunit.icu/course/oss/icon/%E5%A4%87%E8%87%AA%E6%8A%95%E5%88%86%E9%97%B8.svg",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "locked": 0,
-            "name": "square",
-            "parentId": "0ffa34f",
-            "rotate": 0,
-            "tags": [
-                "备自投分闸"
-            ],
-            "text": "",
-            "width": 1,
-            "x": 0,
-            "y": 0
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "4dcf52a0",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "4dcf52a0",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "4dcf52a0",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "4dcf52a0",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "canvasLayer": 2,
-            "children": [],
-            "ex": 1,
-            "ey": 1,
-            "fontSize": 12,
-            "form": [
-                {
-                    "key": "text",
-                    "name": "文本",
-                    "type": "text"
-                }
-            ],
-            "height": 1,
-            "id": "4dcf52a0",
-            "image": "https://haijunit.icu/course/oss/icon/%E5%A4%87%E8%87%AA%E6%8A%95%E5%90%88%E9%97%B8.svg",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "locked": 0,
-            "name": "square",
-            "parentId": "0ffa34f",
-            "rotate": 0,
-            "tags": [
-                "备自投合闸"
-            ],
-            "text": "",
-            "width": 1,
-            "x": 0,
-            "y": 0
-        },
-        {
-            "anchors": [
-                {
-                    "id": "0",
-                    "penId": "64ff99b1",
-                    "x": 0.5,
-                    "y": 0
-                },
-                {
-                    "id": "1",
-                    "penId": "64ff99b1",
-                    "x": 1,
-                    "y": 0.5
-                },
-                {
-                    "id": "2",
-                    "penId": "64ff99b1",
-                    "x": 0.5,
-                    "y": 1
-                },
-                {
-                    "id": "3",
-                    "penId": "64ff99b1",
-                    "x": 0,
-                    "y": 0.5
-                }
-            ],
-            "canvasLayer": 2,
-            "children": [],
-            "fontSize": 12,
-            "form": [
-                {
-                    "key": "text",
-                    "name": "文本",
-                    "type": "text"
-                }
-            ],
-            "height": 100,
-            "id": "64ff99b1",
-            "image": "https://haijunit.icu/course/oss/icon/%E5%A4%87%E8%87%AA%E6%8A%95%E5%90%88%E9%97%B8.svg",
-            "lineAnimateImages": [],
-            "lineHeight": 1.5,
-            "lineWidth": 1,
-            "name": "square",
-            "rotate": 0,
-            "tags": [
-                "备自投合闸"
-            ],
-            "text": "",
-            "width": 100,
-            "x": 1006,
-            "y": 283
-        }
-    ],
-    "origin": {
-        "x": 0,
-        "y": 0
-    },
-    "center": {
-        "x": 0,
-        "y": 0
-    },
-    "paths": {},
-    "template": "78269ffe",
-    "lineAnimateDraws": {},
-    "name": "测试示例",
-    "shared": false,
-    "system": false,
-    "folder": "元器示例图纸",
-    "view": 0,
-    "star": 0,
-    "favorite": 0,
-    "ownerId": "0199f791-a05d-7524-b511-a90acf3c0ba5",
-    "ownerName": "wu",
-    "editorId": "0199f791-a05d-7524-b511-a90acf3c0ba5",
-    "editorName": "wu",
-    "search_vector": "'例':3 '测试':1 '示':2 '示例':4",
-    "createdAt": "2025-11-02T20:30:55.080264+08:00",
-    "updatedAt": "2025-11-02T20:33:13.614057+08:00",
-    "activeColor": "#278df8",
-    "background": "rgba(0, 0, 0, 1)",
-    "color": "#222222",
-    "component": false,
-    "dataPoints": [
-        "d-1-a-001"
-    ],
-    "gridColor": "#e2e2e2",
-    "gridSize": 20,
-    "iot": {},
-    "ruleColor": "#888888",
-    "version": "1.0.84"
-}

+ 1 - 1
src/views/train/fault/index.vue

@@ -7,7 +7,7 @@
       </div>
     </div>
     <div class="flex-1">
-      <Meta2dView :data="graphData" :preview="true" />
+      <Meta2dView :data="dataJson" :preview="true" />
     </div>
     <Dialog>
       <ArtTable ref="tableRef" :loading="loading" :columns="columns" :data="tableData"></ArtTable>