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

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

parent cf79b6ef
Pipeline #50935 skipped with stages
......@@ -7,7 +7,7 @@
* @Description:
* @Author: leizhe
* @Date: 2022-04-06 11:38:46
* @LastEditTime: 2022-05-20 14:23:36
* @LastEditTime: 2022-05-23 10:22:19
* @LastEditors: leizhe
*/
import React, { useState, useEffect } from 'react';
......@@ -126,6 +126,7 @@ const DrawBoardManage = () => {
setPickItem(aa);
updateTableData(e, searchWord);
} else {
console.log(pickItem);
if (!pickItem) {
updateTableData('', searchWord);
} else {
......@@ -593,20 +594,26 @@ const DrawBoardManage = () => {
};
const deleteModalData = () => {
setTableLoading(true);
DelModelType({ id: changeObj.ID }).then(res => {
setTableLoading(false);
if (res.code === 0) {
setDeleteModalVisible(false);
notification.success({
message: '删除成功',
duration: 2,
});
updateTrees();
if (pickItem.name == changeObj.name) {
setPickItem('');
setChangeObj('');
updateTableDataAll('', searchWord);
setTreeLoading(true);
typeList().then(res => {
setTreeLoading(false);
if (res.code === 0) {
updateTableDataAll('', searchWord);
setTreeData(res.data);
}
});
} else {
updateTrees();
}
} else {
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