소스 검색

[Feat 0000] 可配置首页表修改

houzekong 4 달 전
부모
커밋
dd048ae761
2개의 변경된 파일16개의 추가작업 그리고 15개의 파일을 삭제
  1. 11 11
      src/views/vent/deviceManager/configurationTable/configuration.data.ts
  2. 5 4
      src/views/vent/deviceManager/configurationTable/index.vue

+ 11 - 11
src/views/vent/deviceManager/configurationTable/configuration.data.ts

@@ -39,7 +39,7 @@ export const searchFormSchema: FormSchema[] = [
   {
     label: '设备类型',
     field: 'deviceType',
-    component: 'JDictSelectTag',
+    component: 'Input',
     componentProps: {
       dictCode: 'devicekind',
       placeholder: '请选择设备类型',
@@ -71,16 +71,16 @@ export const formSchema: FormSchema[] = [
     component: 'Input',
     required: true,
   },
-  {
-    label: '设备类型',
-    field: 'deviceType',
-    component: 'JDictSelectTag',
-    required: true,
-    componentProps: {
-      dictCode: 'devicekind',
-      placeholder: '请选择设备类型',
-    },
-  },
+  // {
+  //   label: '设备类型',
+  //   field: 'deviceType',
+  //   component: 'JDictSelectTag',
+  //   required: true,
+  //   componentProps: {
+  //     dictCode: 'devicekind',
+  //     placeholder: '请选择设备类型',
+  //   },
+  // },
   {
     label: '所属页面',
     field: 'pageType',

+ 5 - 4
src/views/vent/deviceManager/configurationTable/index.vue

@@ -37,9 +37,10 @@
   import { BasicModal } from '/@/components/Modal';
   import CodeEditor from '/@/components/CodeEditor/src/CodeEditor.vue';
   import { ModulePresetMap } from './options';
+  import _ from 'lodash-es';
   import helpContext from './types?raw';
 
-  const formData = reactive({});
+  const formData = reactive<any>({});
   const isUpdate = ref(false);
   const deviceType = ref('');
   const formSchemaData = ref(formSchema);
@@ -141,7 +142,7 @@
 
   function handleConfig(record) {
     Object.assign(formData, toRaw(record));
-    configJSON.value = record.moduleData || '';
+    configJSON.value = _.pick(formData, ['deviceType', 'pageType', 'moduleName', 'moduleData', 'showStyle']);
     configModalCtx.openModal();
   }
 
@@ -150,8 +151,8 @@
     isUpdate.value = true;
     try {
       saveOrUpdateHandler({
-        ...formData,
-        moduleData: JSON.parse(configJSON.value),
+        id: formData.id,
+        ...JSON.parse(configJSON.value),
       })
         .then(() => {
           message.success('保存成功');