|
@@ -49,7 +49,7 @@
|
|
<span>{{ scope.row.sublistName }}</span>
|
|
<span>{{ scope.row.sublistName }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="权重" slot="weight" align="center">
|
|
|
|
|
|
+ <el-table-column label="权重%" slot="weight" align="center">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
<span v-if="scope.row.weightErr" style="color: red">{{
|
|
<span v-if="scope.row.weightErr" style="color: red">{{
|
|
scope.row.weight
|
|
scope.row.weight
|
|
@@ -193,6 +193,23 @@
|
|
<el-button @click="scenarioListsCancel">取 消</el-button>
|
|
<el-button @click="scenarioListsCancel">取 消</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="模板预览"
|
|
|
|
+ :visible.sync="templateViewVisible"
|
|
|
|
+ width="90%"
|
|
|
|
+ class="templateViewDia"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
+ :before-close="templateViewClose"
|
|
|
|
+ >
|
|
|
|
+ <view-tree :data="treeData"></view-tree>
|
|
|
|
+ <span slot="footer">
|
|
|
|
+ <el-button type="primary" @click="templateViewClose"
|
|
|
|
+ >关 闭</el-button
|
|
|
|
+ >
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -201,13 +218,21 @@ import searchLayout from "@/components/grid/searchLayout";
|
|
import tableList from "@/components/grid/TableList";
|
|
import tableList from "@/components/grid/TableList";
|
|
import toolbarTab from "@/components/toolbar/toolbarTab";
|
|
import toolbarTab from "@/components/toolbar/toolbarTab";
|
|
import realSceneList from "./components/realSceneList";
|
|
import realSceneList from "./components/realSceneList";
|
|
|
|
+// import viewTree from "./components/viewTree";
|
|
|
|
+import viewTree from "./components/elTree";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "scenePacketList", // 场景数据包
|
|
name: "scenePacketList", // 场景数据包
|
|
- components: { searchLayout, tableList, toolbarTab, realSceneList },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ searchLayout,
|
|
|
|
+ tableList,
|
|
|
|
+ toolbarTab,
|
|
|
|
+ realSceneList,
|
|
|
|
+ viewTree,
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
let validateNum = (rule, value, callback) => {
|
|
let validateNum = (rule, value, callback) => {
|
|
- if (value == 0) {
|
|
|
|
|
|
+ if (value == 0 || value > 100) {
|
|
callback(new Error(rule.message));
|
|
callback(new Error(rule.message));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -223,7 +248,7 @@ export default {
|
|
!/^[1-9]+[0]*$/.test(value) && callback(new Error(rule.message));
|
|
!/^[1-9]+[0]*$/.test(value) && callback(new Error(rule.message));
|
|
callback();
|
|
callback();
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
return {
|
|
return {
|
|
packageId: "",
|
|
packageId: "",
|
|
share: "",
|
|
share: "",
|
|
@@ -239,7 +264,7 @@ export default {
|
|
template: true,
|
|
template: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label: "权重",
|
|
|
|
|
|
+ label: "权重%",
|
|
prop: "weight",
|
|
prop: "weight",
|
|
template: true,
|
|
template: true,
|
|
},
|
|
},
|
|
@@ -278,6 +303,7 @@ export default {
|
|
seq: 0,
|
|
seq: 0,
|
|
sublistName: "一级指标",
|
|
sublistName: "一级指标",
|
|
weight: 100,
|
|
weight: 100,
|
|
|
|
+ treeNode: "一级指标" + " (" + 100 + "%)",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
@@ -299,7 +325,7 @@ export default {
|
|
{ required: true, message: "请输入", trigger: "blur" },
|
|
{ required: true, message: "请输入", trigger: "blur" },
|
|
{
|
|
{
|
|
validator: validateNum,
|
|
validator: validateNum,
|
|
- message: "请输入正整数",
|
|
|
|
|
|
+ message: "请输入大不于100的正整数",
|
|
trigger: ["blur"],
|
|
trigger: ["blur"],
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -326,6 +352,8 @@ export default {
|
|
checkedIdsB: [], // 自然驾驶列表已选
|
|
checkedIdsB: [], // 自然驾驶列表已选
|
|
checkedIdsC: [], // 标准法规列表已选
|
|
checkedIdsC: [], // 标准法规列表已选
|
|
isRoot: false, // 是否是根节点
|
|
isRoot: false, // 是否是根节点
|
|
|
|
+ templateViewVisible: false,
|
|
|
|
+ treeData: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
@@ -333,10 +361,8 @@ export default {
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
viewTree() {
|
|
viewTree() {
|
|
- this.$router.push({
|
|
|
|
- path: "/templateView",
|
|
|
|
- query: { packageId: this.packageId },
|
|
|
|
- });
|
|
|
|
|
|
+ this.templateViewVisible = true;
|
|
|
|
+ this.treeData = this.getDataWay.data;
|
|
},
|
|
},
|
|
delRow(row) {
|
|
delRow(row) {
|
|
this.$confirm("确认是否删除?", "提示", {
|
|
this.$confirm("确认是否删除?", "提示", {
|
|
@@ -407,6 +433,11 @@ export default {
|
|
this.curNode.sublistName = this.form.sublistName;
|
|
this.curNode.sublistName = this.form.sublistName;
|
|
this.curNode.weight = this.form.weight;
|
|
this.curNode.weight = this.form.weight;
|
|
this.curNode.remarks = this.form.remarks;
|
|
this.curNode.remarks = this.form.remarks;
|
|
|
|
+ this.curNode.treeNode =
|
|
|
|
+ this.form.sublistName +
|
|
|
|
+ " (" +
|
|
|
|
+ this.form.weight +
|
|
|
|
+ "%)";
|
|
} else {
|
|
} else {
|
|
// 新增节点
|
|
// 新增节点
|
|
++this.idIndex;
|
|
++this.idIndex;
|
|
@@ -427,6 +458,11 @@ export default {
|
|
seq: 0,
|
|
seq: 0,
|
|
sublistName: this.form.sublistName,
|
|
sublistName: this.form.sublistName,
|
|
weight: this.form.weight,
|
|
weight: this.form.weight,
|
|
|
|
+ treeNode:
|
|
|
|
+ this.form.sublistName +
|
|
|
|
+ " (" +
|
|
|
|
+ this.form.weight +
|
|
|
|
+ "%)",
|
|
};
|
|
};
|
|
if (!this.curNode.children) {
|
|
if (!this.curNode.children) {
|
|
this.curNode.children = [];
|
|
this.curNode.children = [];
|
|
@@ -440,6 +476,8 @@ export default {
|
|
this.nodeList
|
|
this.nodeList
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ // console.log(this.getDataWay.data[0]);
|
|
|
|
+
|
|
this.checkWeightValidate();
|
|
this.checkWeightValidate();
|
|
|
|
|
|
this.indicatorsCancel();
|
|
this.indicatorsCancel();
|
|
@@ -567,7 +605,7 @@ export default {
|
|
let total = 0;
|
|
let total = 0;
|
|
let arr = [];
|
|
let arr = [];
|
|
element.children.forEach((item) => {
|
|
element.children.forEach((item) => {
|
|
- console.log(this.nodeList);
|
|
|
|
|
|
+ // console.log(this.nodeList);
|
|
total += +this.nodeList.find((i) => i.id === item.id)
|
|
total += +this.nodeList.find((i) => i.id === item.id)
|
|
.weight;
|
|
.weight;
|
|
arr.push(item.id);
|
|
arr.push(item.id);
|
|
@@ -578,8 +616,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.rowWeightErrTrue(this.getDataWay.data[0], ids);
|
|
this.rowWeightErrTrue(this.getDataWay.data[0], ids);
|
|
- console.log(6);
|
|
|
|
- console.log(this.getDataWay.data[0]);
|
|
|
|
|
|
+ // console.log(this.getDataWay.data[0]);
|
|
},
|
|
},
|
|
// 深度优先遍历
|
|
// 深度优先遍历
|
|
/* deepFirstSearch(node, nodeList) {
|
|
/* deepFirstSearch(node, nodeList) {
|
|
@@ -718,6 +755,10 @@ export default {
|
|
}
|
|
}
|
|
this.sceneNumUpdate(node);
|
|
this.sceneNumUpdate(node);
|
|
},
|
|
},
|
|
|
|
+ templateViewClose() {
|
|
|
|
+ this.templateViewVisible = false;
|
|
|
|
+ this.treeData = [];
|
|
|
|
+ },
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -771,5 +812,17 @@ export default {
|
|
padding: 30px 0;
|
|
padding: 30px 0;
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .templateViewDia {
|
|
|
|
+ /deep/ .el-dialog {
|
|
|
|
+ max-height: 80%;
|
|
|
|
+ overflow: auto;
|
|
|
|
+
|
|
|
|
+ .el-dialog__body {
|
|
|
|
+ max-height: calc(100%-130px);
|
|
|
|
+ overflow: auto;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|