Prechádzať zdrojové kódy

右键清除表单数据

duy 2 rokov pred
rodič
commit
a636ad5a6f

+ 8 - 0
src/api/modules/data-fill/wbs.js

@@ -315,4 +315,12 @@ export default {
             params: form,
         }, msg)
     },
+    //清除表单信息
+    async rmTabdataInfo(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/exceltab/rm-tabdata-info',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
 }

+ 16 - 3
src/views/data-fill/collapse-form/index.vue

@@ -642,7 +642,7 @@ const setTableFormMenu = (info) => {
     newArr.push({ label: '关联试验数据', key: 'test' })
     newArr.push({ label: '关联试验文件', key: 'file' })
     newArr.push({ label: '公式参数', key: 'formula' })
-    // newArr.push({ label: '清除数据', key: 'clear' })
+    newArr.push({ label: '清除数据', key: 'clear' })
     tableFormMenu.value = newArr
 }
 
@@ -671,12 +671,25 @@ const handleMenuSelect = async ({ key }) => {
         formulaModalLoading.value = false
         formulaModal.value = true
     } else if (key === 'clear') {
-        const { pkeyId } = tableFormItemNode.value
+        const { pkeyId, index } = tableFormItemNode.value
         const refs = await getFormRef(pkeyId)
         delMessageV2(async (action, instance, done) => {
             if (action === 'confirm') {
                 instance.confirmButtonLoading = true
-                refs?.getTableFormInfo(1)
+                const { error, code, msg } = await wbsApi.rmTabdataInfo({
+                        pkeyId: pkeyId,
+                })
+                if (!error && code === 200 ) {
+                    window.$message.success(msg)
+                   await refs?.getTableFormInfo(pkeyId)
+                   nextTick(()=>{
+                    listDatas.value[index].isTableForm = true
+                   })
+                  
+                 
+                } else {
+                    window.$message.error(msg)
+                }
                 instance.confirmButtonLoading = false
                 done()
             } else {

+ 1 - 0
src/views/home/index-static.vue

@@ -129,6 +129,7 @@ import { ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 const userStore = useAppStore()
 const userInfo = ref(userStore.getUserInfo)
+import avatarPng from '~src/assets/images/avatar.png'
 //监听
 watch(() => [
     userStore.getUserInfo,