Commit b1345b72 by liyuhang19990520

即是根节点又是子节点判断

parent a34065a0
No preview for this file type
......@@ -14,8 +14,9 @@
slot-scope="{ node }"
:class="{
w100h100: true,
highlight: judgeHeightLine(node),
gen: negativeHeightLine(node),
highlight: judgeHeightLine(node),
yellow: yellowActiveHeightLine(node),
}"
>
<div
......@@ -316,10 +317,15 @@ export default {
if (this.nodedata) {
let nodes;
if (this.type == "hnthfx") {
nodes = this.nodeArr.filter((i) => i.data.more == true);
console.log(nodes, 222222222222222);
nodes = this.nodeArr.filter(
(i) => i.data.gen == true && i.data.parentId == "1111"
);
}
responseData.forEach((item) => {
if (nodes && nodes.length > 0) {
let sonParentNodes = nodes.find((j) => j.id == item.name);
if(sonParentNodes) return
}
this.linkArr.push({
from: this.nodedata.name,
isHide: this.type == "hnthfx" ? true : false,
......@@ -329,6 +335,7 @@ export default {
fontColor: "#000",
});
});
console.log(nodes, this.linkArr, 222222222222222);
}
//如果返回的数据有children数组 则计算link
this.createLink(responseData);
......@@ -362,7 +369,7 @@ export default {
} else if (this.type == "hnthfx") {
this.toolbarBoo = true;
let nodes = seeksRGGraph.getNodes();
//即是根节点也是子节点背景图变黑
//湖南可视化染色
setTimeout(() => {
if (nodes.length > 0) {
nodes.forEach((i) => {
......@@ -395,17 +402,24 @@ export default {
});
},
gainImg() {
this.g_loading = true;
let _this = this;
this.callApi("/hnapi/hnksh/getAndSaveImg", this.params).then((res) => {
this.g_loading = false;
if (res.success && res.code == 200) {
this.$message.success("获取成功");
setTimeout(() => {
location.reload();
_this.activeIdArr = [];
_this.nodeArr = [];
_this.linkArr = [];
_this.linkAll = [];
_this.genData = [];
_this.setGraphData();
}, 200);
location.reload();
} else if (res.success && res.code == 207) {
this.$message.warning(res.message);
} else if (res.code == 207) {
this.$notify.info({
title: "提示",
message: res.message,
duration: 3000,
});
}
});
},
......@@ -422,10 +436,16 @@ export default {
this.highLightArr.includes(node.data.ajlbdm);
return boo;
},
//黑色背景高亮
negativeHeightLine(node) {
let boo = node.data.str;
return boo;
},
//黄色背景高亮
yellowActiveHeightLine(node) {
let boo = node.data.yellow;
return boo;
},
/**
* @description: 存储节点的各个信息
* @param {*} selfObj 自己定义的对象
......@@ -453,7 +473,7 @@ export default {
* @param {*} boo 是否是初始化时自动获取数据
* @return {*}
*/
createNode(data, boo) {
createNode(data, boo, parentId) {
let _this = this;
//先给根节点上色,在管后面的节点
data.forEach((item) => {
......@@ -474,7 +494,7 @@ export default {
data: this.setNodeData(
{
str,
parentId: this?.nodedata?.name || 0,
parentId: parentId || this?.nodedata?.name || 0,
describe: this.filterDescribe(item.describe),
nodePhoto: base64,
},
......@@ -489,7 +509,7 @@ export default {
Array.isArray(item.children) &&
item.children.length > 0
) {
this.createNode(item.children);
this.createNode(item.children, null, item.name);
}
});
},
......@@ -783,6 +803,11 @@ $marginTop: 308px;
box-shadow: 0 0 30px #6670fb;
border-radius: 50%;
}
.yellow {
border: 2px solid yellow;
box-shadow: 0 0 30px yellow;
border-radius: 50%;
}
.backImg {
border-radius: 50%;
cursor: pointer;
......
/*
* @Author: your name
* @Date: 2021-06-20 11:48:40
* @LastEditTime: 2021-09-24 17:26:48
* @LastEditTime: 2021-09-26 09:35:22
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \control_platform\src\settings.js
......
......@@ -160,7 +160,9 @@ export default {
created() {
let user = util.getCookie("hnUser");
if (!user) {
setTimeout(() => {
this.$message.error("请输入正确的身份证号");
}, 200);
}
this.$set(this.cxFormData, "username", util.getCookie("hnUser"));
},
......
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