Browse Source

fix:表单发布字段列表增加创建时间选项

全蛋 4 months ago
parent
commit
f2a36099d4

+ 9 - 1
src/components/CreateCodeStep/src/ViewDesignStep.vue

@@ -498,6 +498,8 @@
   });
   });
   const { notification } = useMessage();
   const { notification } = useMessage();
   const generatorConfig = inject<GeneratorConfig>('generatorConfig') as GeneratorConfig;
   const generatorConfig = inject<GeneratorConfig>('generatorConfig') as GeneratorConfig;
+  console.log('generatorConfig', generatorConfig);
+  // generatorConfig!.formJson!.list.push()
   const current = inject<Ref<number>>('current') as Ref<number>;
   const current = inject<Ref<number>>('current') as Ref<number>;
   const designType = inject<string>('designType', '');
   const designType = inject<string>('designType', '');
   const tableInfo = inject<Ref<TableInfo[]>>('tableInfo', ref([]));
   const tableInfo = inject<Ref<TableInfo[]>>('tableInfo', ref([]));
@@ -1007,6 +1009,7 @@
                 columns.splice(oldIndex, 1);
                 columns.splice(oldIndex, 1);
               }
               }
               generatorConfig!.listConfig!.columnConfigs = cloneDeep(columns);
               generatorConfig!.listConfig!.columnConfigs = cloneDeep(columns);
+              console.log(generatorConfig!.listConfig!.columnConfigs);
               columnTableKey.value++;
               columnTableKey.value++;
             },
             },
           });
           });
@@ -1174,7 +1177,12 @@
   };
   };
 
 
   const selectOption = computed(() => {
   const selectOption = computed(() => {
-    return filterMainComponent(generatorConfig?.formJson?.list);
+    const list = filterMainComponent(generatorConfig?.formJson?.list);
+    list.push({
+      label: '创建时间',
+      value: 'create_date',
+    });
+    return list;
   });
   });
 
 
   const querySelectOption = computed(() => {
   const querySelectOption = computed(() => {

+ 1 - 1
src/components/Form/src/components/SubForm.vue

@@ -379,7 +379,7 @@
       });
       });
       if (props.uniqueKey) {
       if (props.uniqueKey) {
         //     判断是否data.value里有相同的数据
         //     判断是否data.value里有相同的数据
-        const isExist = data.value.some((item) => item[props.uniqueKey] === x[mapIndex]);
+        const isExist = data.value.some((item) => item[props.uniqueKey!] === x[mapIndex]);
         if (!isExist) {
         if (!isExist) {
           data.value.push(dataObj);
           data.value.push(dataObj);
         }
         }

+ 1 - 1
src/views/educational/textbookSubscription/components/view.vue

@@ -75,7 +75,7 @@
   const { createMessage } = useMessage();
   const { createMessage } = useMessage();
   const handleExport = async () => {
   const handleExport = async () => {
     try {
     try {
-      const data = await postWfTextbookSubscriptionTextbookSubscriptionExportQuery({
+      const data: any = await postWfTextbookSubscriptionTextbookSubscriptionExportQuery({
         wfTextbookSubscriptionId: itemId.value,
         wfTextbookSubscriptionId: itemId.value,
       });
       });
       downloadByData(
       downloadByData(