Commit b1345b72 by liyuhang19990520

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

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