|
@@ -123,7 +123,7 @@ import { ruleCreate } from "@/api/labsl";
|
|
|
import { dictCategoryQuery, dictQuery, PartiInstancQuery } from "@/api/datacenter";
|
|
|
import { equipQuery } from "@/api/equipcomponent";
|
|
|
import { array2Tree, mapTree } from "@/utils/utils";
|
|
|
-
|
|
|
+import bus from "@/bus/bus";
|
|
|
export default {
|
|
|
name: "addEquipmentDialog",
|
|
|
props: {
|
|
@@ -272,6 +272,8 @@ export default {
|
|
|
* 显示弹窗时的处理
|
|
|
*/
|
|
|
initModal() {
|
|
|
+ this.tableDataBak = [];
|
|
|
+ this.tableData = [];
|
|
|
// 查询设备实例树
|
|
|
this.getCategory();
|
|
|
// 分区类型 列表
|
|
@@ -436,8 +438,13 @@ export default {
|
|
|
console.log(res);
|
|
|
if (res.result === "success") {
|
|
|
this.$message.success("添加成功");
|
|
|
- this.dialogTableVisible = false;
|
|
|
- this.showPopover = false;
|
|
|
+ // 接口成功之后,发出添加设备指令
|
|
|
+ bus.$emit("addEquipment", this.tableDataBak);
|
|
|
+ let timer = setTimeout(() => {
|
|
|
+ this.dialogTableVisible = false;
|
|
|
+ this.showPopover = false;
|
|
|
+ }, 1000);
|
|
|
+ timer = null;
|
|
|
} else {
|
|
|
this.$message.error(res.message || "添加失败");
|
|
|
}
|