修复军标管理bug

This commit is contained in:
takeshita
2025-11-27 10:09:29 +08:00
parent 6d0107cd50
commit a3b9c0a64b
2 changed files with 42 additions and 21 deletions

View File

@ -204,9 +204,16 @@ export default {
// } // }
if (this.selectedGraphLabelType == data.type_id) {
this.graphTableData = [];
this.$nextTick(() => {
this.$refs.myTree && this.$refs.myTree.setCurrentKey(null);
});
this.selectedGraphLabelType = null
}
else {
this.graphTableData = [...data.children]; this.graphTableData = [...data.children];
this.graphTableSelectData = data.children; this.graphTableSelectData = data.children;
if (data.sonNode.length) {
let junbiaos = []; let junbiaos = [];
this.selectedGraphLabelType = data.type_id; this.selectedGraphLabelType = data.type_id;
this.JByuanshishuju.forEach((item) => { this.JByuanshishuju.forEach((item) => {
@ -215,6 +222,7 @@ export default {
}); });
this.graphTableData.push(...junbiaos); this.graphTableData.push(...junbiaos);
} }
}, },
tongbu() { tongbu() {
tongbus((res) => { tongbus((res) => {
@ -583,7 +591,7 @@ export default {
.catch(() => { }); .catch(() => { });
} }
}, },
delGraphLabel(jun_biao_id) { delGraphLabel(jun_biao_id, p_id) {
console.log(this.graphLabelTypeList); console.log(this.graphLabelTypeList);
let msg = "确定删除?"; let msg = "确定删除?";
this.$confirm(msg, "警告", { this.$confirm(msg, "警告", {
@ -595,10 +603,23 @@ export default {
delGraphLabels({ jun_biao_id }, (res) => { delGraphLabels({ jun_biao_id }, (res) => {
//刷新当前页 //刷新当前页
// this.pageModelList(); // this.pageModelList();
this.getGraphLabelTypeList(); // this.getGraphLabelTypeList();
this.graphTableData = this.graphTableData.filter( this.graphTableData = this.graphTableData.filter(
(item) => item.jun_biao_id !== jun_biao_id (item) => {
return item.jun_biao_id !== jun_biao_id
}
); );
if(p_id) {
setProperty(
this.graphLabelTypeList,
"sonNode",
"type_id",
p_id,
"children",
this.graphTableData,
"assign"
);
}
}); });
}) })
.catch(() => { }); .catch(() => { });
@ -1239,8 +1260,8 @@ export default {
"type_id", "type_id",
obj.p_id, obj.p_id,
"children", "children",
[..._that.graphTableSelectData, obj], obj,
"assign" "append"
); );
}); });
}); });

View File

@ -683,7 +683,7 @@
$t("headerTitles.graphLabel.edit") $t("headerTitles.graphLabel.edit")
}} }}
</el-button> </el-button>
<el-button @click="delGraphLabel(scope.row.jun_biao_id)" type="danger" size="mini"> <el-button @click="delGraphLabel(scope.row.jun_biao_id, scope.row.p_id)" type="danger" size="mini">
{{ $t("headerTitles.graphLabel.delete") }} {{ $t("headerTitles.graphLabel.delete") }}
</el-button> </el-button>
</template> </template>