From 93c133349a5ccd7a328371fa113dce69d5611f21 Mon Sep 17 00:00:00 2001
From: liuyu <yu.liu@cqgbkj.com>
Date: 星期二, 22 九月 2026 09:25:39 +0800
Subject: [PATCH] feat(tms): 完成课程考试自测等页面与接口对接

---
 apps/jnpf-web-apps-main/src/views/x/tms/signMode/Form.vue |   43 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/apps/jnpf-web-apps-main/src/views/x/tms/signMode/Form.vue b/apps/jnpf-web-apps-main/src/views/x/tms/signMode/Form.vue
index 85d3092..a943bc3 100644
--- a/apps/jnpf-web-apps-main/src/views/x/tms/signMode/Form.vue
+++ b/apps/jnpf-web-apps-main/src/views/x/tms/signMode/Form.vue
@@ -6,13 +6,18 @@
 import { BasicModal, useModalInner } from '@jnpf/ui/modal';
 
 import { createSignMode, getSignModeInfo, updateSignMode } from '#/api/x/tms/signMode';
-
-import { ENABLE_OPTIONS, YES_NO_OPTIONS } from './constants';
+import { useBaseStore } from '#/store';
+import {
+  TMS_DIC,
+  TMS_DIC_FIELD_NAMES,
+  loadTmsDic,
+} from '#/views/x/tms/shared/dic';
 
 defineOptions({ name: 'TmsSignModeForm' });
 
 const emit = defineEmits(['register', 'reload']);
 const { createMessage } = useMessage();
+const baseStore = useBaseStore();
 
 const state = reactive({ id: '' });
 const { id } = toRefs(state);
@@ -48,7 +53,11 @@
       label: '椤诲尮閰嶅悕鍗�',
       component: 'Select',
       defaultValue: '1',
-      componentProps: { placeholder: '璇烽�夋嫨', options: YES_NO_OPTIONS },
+      componentProps: {
+        placeholder: '璇烽�夋嫨',
+        options: [],
+        fieldNames: TMS_DIC_FIELD_NAMES,
+      },
       rules: [{ required: true, message: '蹇呭~', trigger: 'change' }],
     },
     {
@@ -56,7 +65,11 @@
       label: '鍚敤鐘舵��',
       component: 'Select',
       defaultValue: '1',
-      componentProps: { placeholder: '璇烽�夋嫨', options: ENABLE_OPTIONS },
+      componentProps: {
+        placeholder: '璇烽�夋嫨',
+        options: [],
+        fieldNames: TMS_DIC_FIELD_NAMES,
+      },
       rules: [{ required: true, message: '蹇呭~', trigger: 'change' }],
     },
     {
@@ -69,6 +82,23 @@
 });
 
 const [registerModal, { closeModal, changeLoading, changeOkLoading }] = useModalInner(init);
+
+async function loadDicOptions() {
+  const [yesNo, enable] = await Promise.all([
+    loadTmsDic(baseStore, TMS_DIC.yesNo),
+    loadTmsDic(baseStore, TMS_DIC.enableStatus),
+  ]);
+  updateSchema([
+    {
+      field: 'matchRoster',
+      componentProps: { placeholder: '璇烽�夋嫨', options: yesNo, fieldNames: TMS_DIC_FIELD_NAMES },
+    },
+    {
+      field: 'enabled',
+      componentProps: { placeholder: '璇烽�夋嫨', options: enable, fieldNames: TMS_DIC_FIELD_NAMES },
+    },
+  ]);
+}
 
 async function init(data: { id?: string }) {
   changeLoading(true);
@@ -84,9 +114,8 @@
     },
   });
   try {
-    if (state.id) {
-      setFieldsValue(await getSignModeInfo(state.id));
-    }
+    await loadDicOptions();
+    if (state.id) setFieldsValue(await getSignModeInfo(state.id));
   } finally {
     changeLoading(false);
   }

--
Gitblit v1.8.0