|
@@ -218,7 +218,6 @@ import searchLayout from "@/components/grid/searchLayout";
|
|
|
import tableList from "@/components/grid/TableList";
|
|
|
import toolbarTab from "@/components/toolbar/toolbarTab";
|
|
|
import realSceneList from "./components/realSceneList";
|
|
|
-// import viewTree from "./components/viewTree";
|
|
|
import viewTree from "./components/elTree";
|
|
|
|
|
|
export default {
|
|
@@ -253,6 +252,21 @@ export default {
|
|
|
callback();
|
|
|
};
|
|
|
|
|
|
+ let validateSublistName = (rule, value, callback) => {
|
|
|
+ this.nodeList = [];
|
|
|
+ this.deepFirstSearch(this.getDataWay.data[0], this.nodeList);
|
|
|
+
|
|
|
+ let names = this.nodeList
|
|
|
+ .filter((i) => i.id != this.form.id)
|
|
|
+ .map((i) => i.sublistName);
|
|
|
+ if (names.includes(value)) {
|
|
|
+ callback(new Error(rule.message));
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return {
|
|
|
packageId: "",
|
|
|
share: "",
|
|
@@ -320,10 +334,16 @@ export default {
|
|
|
sublistName: "",
|
|
|
weight: "",
|
|
|
remarks: "",
|
|
|
+ id: "",
|
|
|
},
|
|
|
rules: {
|
|
|
sublistName: [
|
|
|
{ required: true, message: "请输入", trigger: "blur" },
|
|
|
+ {
|
|
|
+ validator: validateSublistName,
|
|
|
+ message: "指标名称重复",
|
|
|
+ trigger: ["blur"],
|
|
|
+ },
|
|
|
],
|
|
|
weight: [
|
|
|
{ required: true, message: "请输入", trigger: "blur" },
|
|
@@ -374,6 +394,7 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
+ this.nodeList = [];
|
|
|
this.deepFirstSearch(
|
|
|
this.getDataWay.data[0],
|
|
|
this.nodeList,
|
|
@@ -403,6 +424,7 @@ export default {
|
|
|
this.form.sublistName = row.sublistName;
|
|
|
this.form.weight = row.weight;
|
|
|
this.form.remarks = row.remarks;
|
|
|
+ this.form.id = row.id;
|
|
|
|
|
|
this.curNode = row;
|
|
|
},
|
|
@@ -437,6 +459,7 @@ export default {
|
|
|
this.curNode.sublistName = this.form.sublistName;
|
|
|
this.curNode.weight = this.form.weight;
|
|
|
this.curNode.remarks = this.form.remarks;
|
|
|
+ // 为了预览展示
|
|
|
this.curNode.treeNode =
|
|
|
this.form.sublistName +
|
|
|
" (" +
|
|
@@ -474,6 +497,7 @@ export default {
|
|
|
this.curNode.children.push(node);
|
|
|
}
|
|
|
|
|
|
+ this.nodeList = [];
|
|
|
// 遍历当前树 拿到所有节点的平行展开数组
|
|
|
this.deepFirstSearch(
|
|
|
this.getDataWay.data[0],
|
|
@@ -494,6 +518,7 @@ export default {
|
|
|
this.form.sublistName = "";
|
|
|
this.form.weight = "";
|
|
|
this.form.remarks = "";
|
|
|
+ this.form.id = "";
|
|
|
this.curNode = {};
|
|
|
this.indicatorsVisible = false;
|
|
|
},
|
|
@@ -567,6 +592,7 @@ export default {
|
|
|
this.curNode.sceneNaturalIds = this.checkedIdsB.join(",");
|
|
|
this.curNode.sceneStatueIds = this.checkedIdsC.join(",");
|
|
|
|
|
|
+ this.nodeList = [];
|
|
|
// 遍历当前树 拿到所有节点的平行展开数组
|
|
|
this.deepFirstSearch(this.getDataWay.data[0], this.nodeList);
|
|
|
|