Kaynağa Gözat

清除所有数据修改

duy 1 hafta önce
ebeveyn
işleme
826a5b1289
1 değiştirilmiş dosya ile 25 ekleme ve 11 silme
  1. 25 11
      src/views/data-fill/collapse-form/index.vue

+ 25 - 11
src/views/data-fill/collapse-form/index.vue

@@ -2515,12 +2515,24 @@ const clearSaveClick = async (type)=>{
                 type:type,
             })
             if (!error && code === 200) {
-                listDatas.value[index].isTableRender = false
-                if (type === 2) {
-                      listDatas.value.forEach((item) => {
-                            item.isTableRender = false
-                        })
-                }
+                
+                
+                // listDatas.value[index].isTableRender = false
+                
+                // 重新获取表单信息(清除数据后的新数据)
+                await refs?.getTableFormInfo(pkeyId)
+                await nextTick()
+                
+                // 重新启用表格渲染
+                listDatas.value[index].isTableRender = true
+                listDatas.value[index].isTableForm = true
+                
+                // 获取重新加载后的表单数据
+                const itemFormData = refs?.getFormData()
+                
+                // 主动调用保存接口 - 使用重新加载后的数据
+                await tableFormSaveClick(itemFormData)
+                
                 if (DragModalTableForm.value.length > 0) {
                     let draindex = arrIndex(
                         DragModalTableForm.value,
@@ -2529,10 +2541,12 @@ const clearSaveClick = async (type)=>{
                     )
                     DragModalTableForm.value[draindex].isTableRender = false
                 }
-                await refs?.getTableFormInfo(pkeyId)
-                await nextTick()
-                listDatas.value[index].isTableRender = true
-                listDatas.value[index].isTableForm = true
+                if (type === 2) {
+                      listDatas.value.forEach((item) => {
+                        item.isTableRender = false
+                    })
+            }
+            
                 if (DragModalTableForm.value.length > 0) {
                     let draindex = arrIndex(
                         DragModalTableForm.value,
@@ -2546,7 +2560,7 @@ const clearSaveClick = async (type)=>{
                     await refs?.getTableFormInfo(pkeyId)
                     windowClick(listDatas.value[index], index)
                 }
-                window.$message.success(msg)
+                // window.$message.success(msg)
               clearShow.value = false
 
             } else {