Commit 9e152b90 authored by 皮倩雯's avatar 皮倩雯

fix: '解决组态平台删除模型接口多次调用问题'

parent cf79b6ef
Pipeline #50935 skipped with stages
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-04-06 11:38:46 * @Date: 2022-04-06 11:38:46
* @LastEditTime: 2022-05-20 14:23:36 * @LastEditTime: 2022-05-23 10:22:19
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -126,6 +126,7 @@ const DrawBoardManage = () => { ...@@ -126,6 +126,7 @@ const DrawBoardManage = () => {
setPickItem(aa); setPickItem(aa);
updateTableData(e, searchWord); updateTableData(e, searchWord);
} else { } else {
console.log(pickItem);
if (!pickItem) { if (!pickItem) {
updateTableData('', searchWord); updateTableData('', searchWord);
} else { } else {
...@@ -593,20 +594,26 @@ const DrawBoardManage = () => { ...@@ -593,20 +594,26 @@ const DrawBoardManage = () => {
}; };
const deleteModalData = () => { const deleteModalData = () => {
setTableLoading(true);
DelModelType({ id: changeObj.ID }).then(res => { DelModelType({ id: changeObj.ID }).then(res => {
setTableLoading(false);
if (res.code === 0) { if (res.code === 0) {
setDeleteModalVisible(false); setDeleteModalVisible(false);
notification.success({ notification.success({
message: '删除成功', message: '删除成功',
duration: 2, duration: 2,
}); });
updateTrees();
if (pickItem.name == changeObj.name) { if (pickItem.name == changeObj.name) {
setPickItem(''); setPickItem('');
setChangeObj(''); setChangeObj('');
updateTableDataAll('', searchWord); setTreeLoading(true);
typeList().then(res => {
setTreeLoading(false);
if (res.code === 0) {
updateTableDataAll('', searchWord);
setTreeData(res.data);
}
});
} else {
updateTrees();
} }
} else { } else {
notification.error({ notification.error({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment