Просмотр исходного кода

feat(store): 在计划存储中添加计算属性getPlan

fix(component): 将参数1类型标签更改为设备名称

feat(view): 为课程搜索组件添加edit属性控制显示

refactor(view): 移除评价日志列表中的冗余字段

feat(view): 在评价裁判列表中添加操作名称字段

refactor(view): 使用getPlan初始化计划选项并简化学员选项

refactor(view): 根据edit属性动态生成搜索表单项
zhanghaijun месяцев назад: 9
Родитель
Сommit
1ac10b8516

+ 1 - 1
src/components/business/EasyProcess/node/operation_drawer.vue

@@ -36,7 +36,7 @@
       { prop: 'subCategoryName', label: '子分类名称', component: 'Input' },
       {
         prop: 'param1Type',
-        label: '参数1类型',
+        label: '设备名称',
         component: 'ApiDict',
         colSpan: 10,
         componentProps: { code: 'param_type', placeholder: '请选择类型' },

+ 6 - 0
src/store/modules/plan.store.ts

@@ -22,6 +22,12 @@ export const usePlanStore = defineStore(
       trainingImplementationID,
       trainingPlanID,
       trainingPlanName,
+      getPlan: computed(() => {
+        if (trainingImplementationID.value && trainingPlanID.value) {
+          return [trainingImplementationID.value, trainingPlanID.value]
+        }
+        return []
+      }),
       updatePlan,
       updateStudent
     }

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

@@ -1,6 +1,6 @@
 <template>
   <div class="page-content">
-    <course-search ref="courseSearchRef" v-show="showSearchBar" @search="getCourseData"></course-search>
+    <course-search ref="courseSearchRef" v-show="showSearchBar" @search="getCourseData" :edit="true"></course-search>
     <el-card class="art-table-card" shadow="never">
       <ArtTableHeader v-model:showSearchBar="showSearchBar" :loading="loading" @refresh="() => getCourseData({})" layout="search,refresh">
         <template #left>

+ 2 - 5
src/views/train/course/list/course.plan.ts

@@ -27,7 +27,7 @@ export const usePlanOptions = () => {
   const { userInfo, getUserType } = toRefs(useUserStore())
   const planStore = usePlanStore()
   // 培训计划选项
-  const planActive = ref<string[]>([])
+  const planActive = ref<string[]>(planStore.getPlan)
   const planDate = ref<PlanItem[]>([])
   const getTrainPlanOptions = async () => {
     const { data } = await request.post<PlanItem[]>('/course/tmsplan', {}, { showErrorMessage: false })
@@ -76,10 +76,7 @@ export const usePlanOptions = () => {
     // ]
   }
   const studentOptions = computed<{ label: string; value: string }[]>(() => {
-    return studentData.value.map((item) => ({
-      value: item.XYEMPID || '',
-      label: item.XYXM || ''
-    }))
+    return studentData.value.map((item) => ({ value: item.XYEMPID || '', label: item.XYXM || '' }))
   })
   // 监听培训计划选项变化,更新学员列表
 

+ 35 - 20
src/views/train/course/list/search.vue

@@ -16,6 +16,8 @@
   import { useDictStore } from '@/store/modules/dict'
   import { usePlanOptions } from './course.plan'
 
+  const props = withDefaults(defineProps<{ edit?: boolean }>(), { edit: false })
+
   const { planId, getUserType, planActive, planOptions, studentActive, studentOptions } = usePlanOptions()
   const dictStore = useDictStore()
 
@@ -41,29 +43,42 @@
     trainPlan: ''
   })
 
-  const formItems = computed(() => [
-    { label: '课程ID', key: 'courseID', type: 'input', placeholder: '请输入课程ID', clearable: true },
-    { label: '课程名称', key: 'courseName', type: 'input', placeholder: '请输入课程名称', clearable: true },
-    { 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') || [] },
-    { label: '创建人', key: 'creator', type: 'input', placeholder: '请输入创建人', clearable: true },
-    {
-      label: '* 培训计划',
-      key: 'PXSSID',
-      type: 'input',
-      placeholder: '请选择培训计划',
-      clearable: true,
-      options: [],
-      rules: [{ required: true, message: '请选择培训计划', trigger: ['change'] }]
-    },
-    ...(getUserType.value === 2
-      ? [{ label: '* 学员名单', key: 'XYEMPID', type: 'input', placeholder: '请选择学员', clearable: true, options: [], rules: [{ required: true, message: '请选择学员', trigger: ['change'] }] }]
-      : [])
-  ])
+  const formItems = computed(() => {
+    const items = [
+      { label: '课程ID', key: 'courseID', type: 'input', placeholder: '请输入课程ID', clearable: true },
+      { label: '课程名称', key: 'courseName', type: 'input', placeholder: '请输入课程名称', clearable: true },
+      { 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') || [] },
+      { label: '创建人', key: 'creator', type: 'input', placeholder: '请输入创建人', clearable: true }
+    ]
+    if (props.edit) {
+      return items
+    } else {
+      return [
+        ...items,
+        {
+          label: '* 培训计划',
+          key: 'PXSSID',
+          type: 'input',
+          placeholder: '请选择培训计划',
+          clearable: true,
+          options: [],
+          rules: [{ required: true, message: '请选择培训计划', trigger: ['change'] }]
+        },
+        ...(getUserType.value === 2
+          ? [{ label: '* 学员名单', key: 'XYEMPID', type: 'input', placeholder: '请选择学员', clearable: true, options: [], rules: [{ required: true, message: '请选择学员', trigger: ['change'] }] }]
+          : [])
+      ]
+    }
+  })
 
   const courseSearchHandle = async () => {
     await courseSearchRef.value.validate()
+    if (props.edit) {
+      emit('search', { ...courseFormData, PXSSID: undefined })
+      return
+    }
     if (planActive.value.length === 0) {
       ElMessage.error('请选择培训计划')
       return

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

@@ -33,9 +33,9 @@
       columnsFactory: () => [
         { type: 'globalIndex', width: 80, label: '序号' },
         { prop: 'courseName', label: '课程名称' },
-        { prop: 'runOperID', label: '运行操作ID' },
+        // { prop: 'runOperID', label: '运行操作ID' },
         { prop: 'runLogID', label: '运行记录编号' },
-        { prop: 'runCourseID', label: '运行课程ID' },
+        // { prop: 'runCourseID', label: '运行课程ID' },
         { prop: 'operName', label: '操作名称' },
         { prop: 'operParam1', label: '操作参数1' },
         { prop: 'operParam2', label: '操作参数2' },

+ 1 - 0
src/views/train/evaluation/list-referee.vue

@@ -46,6 +46,7 @@
         { 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: 'evaName', label: '节点名称', width: '250px' },
+        { prop: 'operName', label: '操作名称' },
         { prop: 'operTime', label: '操作时间', formatter: (row: RefereeData) => formatSecondsToHHMMSS(Number(row.operTime ?? 0)) },
         { prop: 'evaDeduction', label: '评价失分' },
         { prop: 'evaScore', label: '评价赋分' },