Parcourir la source

fix: change term

DESKTOP-USV654P\pc il y a 1 semaine
Parent
commit
75240cb791

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 commit:
 	git add . && \
-	git commit --no-verify -m "fix: change maintenance"
+	git commit --no-verify -m "fix: change term"
 
 checkPre:
 	git checkout pre

+ 1 - 1
src/views/evaluate/maintenance/term.vue

@@ -224,7 +224,6 @@
   const handleSuccess = async (baseData, isUpdate) => {
     const formData = getFieldsValue();
     const { field, item, index } = baseData;
-
     if (!isUpdate) {
       const dataRow = formData[`${field}`] || [];
       dataRow.push({ ...item });
@@ -290,6 +289,7 @@
   const handleDetailDelete = (record: EditRecordRow, field: string) => {
     currentEditKeyRef.value = '';
     const formData = getFieldsValue();
+    console.log('formData', formData, record);
     formData[`${field}`] = formData[`${field}`].filter((item) => item.key !== record.key);
     setFieldsValue(formData);
   };

+ 6 - 1
src/views/evaluate/maintenance/termEdit.vue

@@ -52,6 +52,7 @@
   import { problemOptions } from './data.config';
   import { Button } from '/@/components/Button';
   import { Input, InputNumber } from 'ant-design-vue';
+  import { cloneDeep } from 'vue-json-pretty/types/utils';
 
   const isUpdate = ref(true);
   const modelRef = ref({});
@@ -125,6 +126,7 @@
 
     modelRef.value = { ...data.baseData };
     const formatData = { ...data.baseData.item };
+    // console.log('formatData', modelRef.value);
     formatData.type = formatData.type || '1';
     if (formatData.type !== '1') {
       if (formatData.optionJson) {
@@ -157,9 +159,12 @@
         if (!checkScore(values)) return false;
         values.optionJson = JSON.stringify(values.optionJson);
       }
+
       const postParams: any = unref(modelRef);
+      const key = postParams.item.key;
       Object.assign(postParams, { item: values });
-
+      postParams.item.key = key;
+      // console.log('postParams', postParams);
       //   createMessage.success('操作成功');
       closeModal();
       emit('success', postParams, unref(isUpdate));