Przeglądaj źródła

feat(故障系统): 支持多线路故障配置

refactor(课程运行): 优化课程运行状态判断逻辑
style(计时器组件): 调整计时器样式布局
fix(操作抽屉): 动态更新参数类型标签
docs(字典配置): 添加557线路故障配置数据
zhanghaijun 9 miesięcy temu
rodzic
commit
6ea22967ac

+ 47 - 7
develop/course/json/dict.json

@@ -146,9 +146,9 @@
     ]
   },
   {
-    "code": "FaultSetCtrl",
-    "name": "FaultSet",
-    "remark": "故障控制列表",
+    "code": "FaultSetCtrl_556",
+    "name": "故障控制列表",
+    "remark": "匹配线路556",
     "sort": 1,
     "items": [
       { "value": "10001", "label": "差动电流(高压侧)", "remark": "556", "sort": 1},
@@ -169,9 +169,9 @@
     ]
   },
   {
-    "code": "FaultSetStatus",
-    "name": "FaultStatus",
-    "remark": "故障状态表",
+    "code": "FaultSetStatus_556",
+    "name": "故障状态表",
+    "remark": "匹配线路556",
     "sort": 1,
     "items": [
       { "value": "10001", "label": "差动电流(高压侧)", "remark": "556", "sort": 1},
@@ -204,5 +204,45 @@
       { "value": "10028", "label": "213合位指示回路常", "remark": "556", "sort": 28},
       { "value": "10029", "label": "213分位指示回路常", "remark": "556", "sort": 29}
     ]
-  }
+  },
+  {
+        "code": "FaultSetCtrl_557",
+        "name": "故障控制列表",
+        "remark": "匹配线路557",
+        "sort": 1,
+        "items": [
+            {"value": "10101","label": "10kV受电保护电流","remark": "557","sort": 1},
+            {"value": "10102","label": "10kV馈线保护电流","remark": "557","sort": 2},
+            {"value": "10103","label": "10kV调前引入保护电流","remark": "557","sort": 3},
+            {"value": "10104","label": "10kV自闭一保护电流","remark": "557","sort": 4},
+            {"value": "10105","label": "10kV进线线路电压","remark": "557","sort": 5},
+            {"value": "10106","label": "10kVI段母线电压","remark": "557","sort": 6},
+            {"value": "10107","label": "10kV调后母线电压","remark": "557","sort": 7},
+            {"value": "10108","label": "10kV自闭一柜线路电压","remark": "557","sort": 8}
+        ]
+    },
+    {
+        "code": "FaultSetStatus_557",
+        "name": "故障状态表",
+        "remark": "匹配线路557",
+        "sort": 1,
+        "items": [
+            {"value": "10101","label": "10kV受电保护电流","remark": "557","sort": 1},
+            {"value": "10102","label": "10kV馈线保护电流","remark": "557","sort": 2},
+            {"value": "10103","label": "10kV调前引入保护电流","remark": "557","sort": 3},
+            {"value": "10104","label": "10kV自闭一保护电流","remark": "557","sort": 4},
+            {"value": "10105","label": "10kV进线线路电压","remark": "557","sort": 5},
+            {"value": "10106","label": "10kVI段母线电压","remark": "557","sort": 6},
+            {"value": "10107","label": "10kV调后母线电压","remark": "557","sort": 7},
+            {"value": "10108","label": "10kV自闭一柜线路电压","remark": "557","sort": 8},
+            {"value": "10109","label": "10kV受电开关合位指示回路异常","remark": "557","sort": 9},
+            {"value": "10110","label": "10kV受电开关分位指示回路异常","remark": "557","sort": 10},
+            {"value": "10111","label": "10kV馈线开关合位指示回路异常","remark": "557","sort": 11},
+            {"value": "10112","label": "10kV馈线开关分位指示回路异常","remark": "557","sort": 12},
+            {"value": "10113","label": "10kV调前引入开关合位指示回路异常","remark": "557","sort": 13},
+            {"value": "10114","label": "10kV调前引入开关分位指示回路异常","remark": "557","sort": 14},
+            {"value": "10115","label": "10kV自闭1开关合位指示回路异常","remark": "557","sort": 15},
+            {"value": "10116","label": "10kV自闭1开关分位指示回路异常","remark": "557","sort": 16}
+        ]
+    }
 ]

+ 34 - 13
src/components/business/EasyProcess/node/operation_drawer.vue

@@ -22,21 +22,15 @@
   const templateList = ref<ProcessOperate[]>([])
   const templateSelected = ref<ProcessOperate>()
 
-  const [BasicForm, formApi] = useForm({
-    labelWidth: '150px',
-    rules: {
-      name: [{ required: true, message: '请输入操作名称', trigger: ['blur'] }],
-      role: [{ required: true, message: '请选择角色', trigger: ['change'] }],
-      templateID: [{ required: true, message: '请选择操作模板', trigger: ['change'] }]
-    },
-    schema: [
+  const getShema = (param1: string = '参数1类型', param2: string = '参数2类型', param3: string = '参数3类型', param4: string = '参数4类型', param5: string = '参数5类型') => {
+    return [
       { prop: 'divider', label: '', labelWidth: '0px', component: 'Divider', colSpan: 24, componentProps: { title: '操作信息' } },
       { prop: 'templateID', label: '操作模板', component: 'Input' },
       { prop: 'categoryName', label: '分类名称', component: 'Input' },
       { prop: 'subCategoryName', label: '子分类名称', component: 'Input' },
       {
         prop: 'param1Type',
-        label: '设备名称',
+        label: param1 || '参数1类型',
         component: 'ApiDict',
         colSpan: 10,
         componentProps: { code: 'param_type', placeholder: '请选择类型' },
@@ -53,7 +47,7 @@
       },
       {
         prop: 'param2Type',
-        label: '参数2类型',
+        label: param2 || '参数2类型',
         component: 'ApiDict',
         componentProps: { code: 'param_type', placeholder: '请选择类型' },
         colSpan: 10,
@@ -70,7 +64,7 @@
       },
       {
         prop: 'param3Type',
-        label: '参数3类型',
+        label: param3 || '参数3类型',
         component: 'ApiDict',
         componentProps: { code: 'param_type', placeholder: '请选择类型' },
         colSpan: 10,
@@ -87,7 +81,7 @@
       },
       {
         prop: 'param4Type',
-        label: '参数4类型',
+        label: param4 || '参数4类型',
         component: 'ApiDict',
         componentProps: { code: 'param_type', placeholder: '请选择类型' },
         colSpan: 10,
@@ -104,7 +98,7 @@
       },
       {
         prop: 'param5Type',
-        label: '参数5类型',
+        label: param5 || '参数5类型',
         component: 'ApiDict',
         componentProps: { code: 'param_type', placeholder: '请选择类型' },
         colSpan: 10,
@@ -148,8 +142,35 @@
         }
       }
     ]
+  }
+
+  const [BasicForm, formApi] = useForm({
+    labelWidth: '150px',
+    rules: {
+      name: [{ required: true, message: '请输入操作名称', trigger: ['blur'] }],
+      role: [{ required: true, message: '请选择角色', trigger: ['change'] }],
+      templateID: [{ required: true, message: '请选择操作模板', trigger: ['change'] }]
+    },
+    schema: getShema(
+      templateSelected.value?.param1Desc || '参数1类型',
+      templateSelected.value?.param2Desc || '参数2类型',
+      templateSelected.value?.param3Desc || '参数3类型',
+      templateSelected.value?.param4Desc || '参数4类型',
+      templateSelected.value?.param5Desc || '参数5类型'
+    )
   })
 
+  watch(
+    () => templateSelected.value,
+    (val) => {
+      if (val) {
+        formApi.setState({
+          schema: getShema(val?.param1Desc || '参数1类型', val?.param2Desc || '参数2类型', val?.param3Desc || '参数3类型', val?.param4Desc || '参数4类型', val?.param5Desc || '参数5类型')
+        })
+      }
+    }
+  )
+
   const handleTemplateChange = (val: string) => {
     if (val) {
       const template = templateList.value.find((item) => item.templateID == val)

+ 0 - 1
src/views/train/course/list/course.plan.ts

@@ -2,7 +2,6 @@ import request from '@/api'
 import { CascaderOption } from 'element-plus'
 import { usePlanStore } from '@/store/modules/plan.store'
 import { useUserStore } from '@/store/modules/user'
-import { ref, computed, toRefs, watch, onMounted } from 'vue'
 
 export interface OptionItem {
   value: string

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

@@ -185,10 +185,10 @@
   }
   const currentCourseRunning = (currentCourseID: string) => {
     return (
-      (props.isRun && runCourseID && String(runCourseID.value) !== 'null') ||
-      String(runCourseID.value) !== '' ||
-      String(runCourseID.value) !== '0' ||
-      String(runCourseID.value) === String(currentCourseID)
+      props.isRun &&
+      runCourseID &&
+      String(runCourseID.value) !== 'null' &&
+      (String(runCourseID.value) == '' || String(runCourseID.value) == '0' || String(runCourseID.value) === String(currentCourseID))
     )
   }
   defineExpose({ currentCourseRunning })

+ 8 - 8
src/views/train/course/trainer_run/index.vue

@@ -14,10 +14,10 @@
       <div class="course-info flex-1">
         <course-detail :course="course"></course-detail>
       </div>
-      <div class="timer w-[320px] text-center">
-        <div>{{ hours }}</div>
-        <div>{{ minutes }}</div>
-        <div>{{ seconds }}</div>
+      <div class="timer text-center">
+        <div class="w-[58px] text-center">{{ hours }}</div>
+        <div class="w-[58px] text-center">{{ minutes }}</div>
+        <div class="w-[58px] text-center">{{ seconds }}</div>
       </div>
     </div>
     <div class="flex h-full flex-1 flex-row gap-4" style="max-height: calc(200px + 100vh)">
@@ -201,10 +201,10 @@
     }
   }
   .timer {
-    width: 320px;
+    width: 460px;
     height: 73px;
     background-image: url('@imgs/train/timer.webp');
-    background-size: auto 100%;
+    background-size: 100% 100%;
     background-repeat: no-repeat;
     background-position: center;
     font-weight: bold;
@@ -212,9 +212,9 @@
     align-items: start;
     justify-content: center;
     font-size: 26px;
-    gap: 36px;
+    gap: 50px;
     margin-top: 26px;
-    padding: 5px 0 0 92px;
+    padding: 5px 0 0 154px;
     * > div {
       flex: 1;
     }

+ 13 - 2
src/views/train/course/trainer_teacher/course.run.hooks.ts

@@ -1,7 +1,8 @@
-import { CourseRunServer } from '@/api/course.api'
+import { Course, CourseRunServer, CourseServer } from '@/api/course.api'
 
 export const useCourseRunStatus = () => {
   const runCourseID = ref<number>()
+  const courseDetail = ref<Course>()
 
   const getRunStatusData = async () => {
     const { data } = await CourseRunServer.status()
@@ -12,6 +13,14 @@ export const useCourseRunStatus = () => {
     }
   }
 
+  const getCourseDetail = async () => {
+    if (!runCourseID.value) return
+    const { data } = await CourseServer.detail(String(runCourseID.value))
+    if (data) courseDetail.value = data
+  }
+
+  watch(runCourseID, getCourseDetail)
+
   let timer: ReturnType<typeof setInterval> | null = null
 
   onMounted(() => {
@@ -27,6 +36,8 @@ export const useCourseRunStatus = () => {
   })
 
   return {
-    runCourseID
+    runCourseID,
+    courseDetail,
+    lineNo: computed(() => String(courseDetail.value?.lineNo ?? 556))
   }
 }

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

@@ -23,9 +23,9 @@
         <EvaluationScore :core="runRecord?.courseScore ?? 0" />
       </div>
       <div class="timer mr-4">
-        <div>{{ hours }}</div>
-        <div>{{ minutes }}</div>
-        <div>{{ seconds }}</div>
+        <div class="w-[58px] text-center">{{ hours }}</div>
+        <div class="w-[58px] text-center">{{ minutes }}</div>
+        <div class="w-[58px] text-center">{{ seconds }}</div>
       </div>
     </div>
     <ListEvaluation :runLogID="runId" :courseID="runRecord?.runCourseID ?? 0" @refresh="findRunRecord" />
@@ -96,10 +96,10 @@
     background-size: auto 100%;
     background-repeat: no-repeat;
     .timer {
-      width: 270px;
+      width: 460px;
       height: 73px;
       background-image: url('@imgs/train/timer.webp');
-      background-size: auto 100%;
+      background-size: 100% 100%;
       background-repeat: no-repeat;
       background-position: center;
       font-weight: bold;
@@ -107,9 +107,9 @@
       align-items: start;
       justify-content: center;
       font-size: 26px;
-      gap: 36px;
-      margin-top: 12px;
-      padding: 5px 0 0 92px;
+      gap: 50px;
+      margin-top: 26px;
+      padding: 5px 0 0 154px;
       * > div {
         flex: 1;
       }

+ 1 - 1
src/views/train/fault/device-list.vue

@@ -21,7 +21,7 @@
 
   const faultList = ref<DictItem[]>([])
   const listFaultList = async () => {
-    const list = await dictStore.getDictByType('FaultSetStatus')
+    const list = await dictStore.getDictByType('FaultSetStatus_556')
     faultList.value = list
   }