Commit 8a548ab9 by liyuhang19990520

跟节点图片

parent 9f628497
......@@ -82,6 +82,7 @@
import { get } from "@/utils/http.js";
import utils from "@/utils/util.js";
import SeeksRelationGraph from "relation-graph";
// import SeeksRelationGraph from "@/utils/gxt.js";
export default {
name: "SeeksRelationGraphDemo",
components: { SeeksRelationGraph },
......@@ -270,13 +271,13 @@ export default {
ajlbdmStr = resData?.ajlbdmStr;
ajlbdm = resData?.ajlbdm;
isXsAj = resData?.isXsAj;
nodePhoto = resData?.edzzplj;
nodePhoto = resData?.edzzplj || resData?.img;
}
//如果没有调用接口或者不存在
if (!nodePhoto) {
nodePhoto = this.selectIcon(this.nodedata.type, false);
} else {
nodePhoto += "data:image/jpg;base64,";
nodePhoto = "data:image/jpg;base64," + nodePhoto;
}
this.activeIdArr = [this.nodedata.name];
//创建根节点
......@@ -383,7 +384,6 @@ export default {
if (this.type == "shce") {
setTimeout(() => {
let arr = seeksRGGraph.getNodes();
console.log(arr);
arr.forEach((i) => {
if (i.data.type == "person" && !i.data.shcePhoto) {
this.callApi("/shceapi/ryksh/getQgckZp", {
......@@ -677,7 +677,6 @@ export default {
this.callApi(str, obj).then((res) => {
//获取所有的节点对象
let nodeAllData = this.$refs.seeksRelationGraph.getNodes();
console.log(nodeAllData, 2222222);
let nodeArr = [];
let linkArr = [];
let responseData = res.data.rows || res.rows || res.data;
......@@ -716,7 +715,6 @@ export default {
linkArr.push(linkObj);
this.linkAll.push(linkObj);
} else if (this.linkAll.length > 0) {
console.log(this.linkAll);
let index = this.linkAll.findIndex((i) => {
return (
i.from == linkObj.from &&
......@@ -730,7 +728,6 @@ export default {
}
}
});
console.log(nodeArr, linkArr);
this.$refs.seeksRelationGraph.appendJsonData(
{
nodes: nodeArr,
......@@ -785,6 +782,7 @@ export default {
*/
deleLinkAll(id) {
let lines = this.$refs.seeksRelationGraph.getLines();
let getGraphJsonData = this.$refs.seeksRelationGraph.getGraphJsonData();
this.linkAll = [];
lines.forEach((e) => {
if (e.relations.length == 1) {
......@@ -797,15 +795,26 @@ export default {
to: e.toNode.id,
});
} else if (e.relations.length > 1) {
e.relations.forEach((j) => {
this.linkAll.push({
color: "#1789DB",
fontColor: "#000",
from: e.fromNode.id,
isHide: false,
text: j.text,
to: e.toNode.id,
});
e.relations.forEach((j, index) => {
if (index == 0) {
this.linkAll.push({
color: "#1789DB",
fontColor: "#000",
from: e.fromNode.id,
isHide: false,
text: j.text,
to: e.toNode.id,
});
} else {
this.linkAll.push({
color: "#1789DB",
fontColor: "#000",
from: e.toNode.id,
isHide: false,
text: j.text,
to: e.fromNode.id,
});
}
});
}
});
......
......@@ -913,7 +913,7 @@ export default {
});
self.excelHeader = this.$route.meta.title;
if (this.cxUrl == "/api/ksh/getHdList") {
postJson(this.cxUrl, JSON.stringify(json)).then((res) => {
postJson(this.cxUrl, json).then((res) => {
if (res.code === 200) {
require.ensure([], () => {
const {
......
/*
* @Author: your name
* @Date: 2021-06-20 11:48:40
* @LastEditTime: 2021-10-11 14:17:49
* @LastEditTime: 2021-10-14 11:36:56
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \control_platform\src\settings.js
......@@ -22,5 +22,5 @@ module.exports = {
// 湖南可视化
BaseURL3: "/hnapi",
// 打包方式阿里云(aly) 和 公安网(gaw)
packType: 'gaw'
packType: 'aly'
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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