bug 标准化活动
This commit is contained in:
@@ -91,22 +91,24 @@ export default {
|
||||
return {
|
||||
data: {},
|
||||
graph: null,
|
||||
loadEnd: false
|
||||
loadEnd: false,
|
||||
selectedNodeId: null,
|
||||
lastQueryId: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
mapData: {
|
||||
handler () {
|
||||
console.log(this.mapData)
|
||||
this.data = JSON.parse(JSON.stringify(this.mapData))
|
||||
if (this.loadEnd) {
|
||||
if (this.loadEnd && this.data.id) {
|
||||
this.initMindMap()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
deep: true
|
||||
},
|
||||
loadEnd () {
|
||||
if (this.loadEnd) {
|
||||
if (this.loadEnd && this.data.id) {
|
||||
this.initMindMap()
|
||||
}
|
||||
}
|
||||
@@ -118,8 +120,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initMindMap () {
|
||||
if (this.graph) {
|
||||
this.graph.destroy()
|
||||
this.graph = null
|
||||
}
|
||||
G6.registerNode('tree-node', {
|
||||
drawShape: (cfg, group) => {
|
||||
console.log('自定义节点了',cfg)
|
||||
const nodeColorIndex = cfg.depth % NODE_COLOR.length
|
||||
const nodeStyle = NODE_COLOR[nodeColorIndex]
|
||||
// 节点整体的内容
|
||||
@@ -186,13 +193,13 @@ export default {
|
||||
nodeContainer.attr({
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.nodeWidth + this.expendCollapseIconR + NODE_ICON_MARGIN,
|
||||
width: this.nodeWidth + this.expendCollapseIconR + NODE_ICON_MARGIN + this.expendCollapseIconR,
|
||||
height: this.nodeHeight
|
||||
})
|
||||
return nodeContainer
|
||||
},
|
||||
setState (name, value, item) {
|
||||
console.log(item)
|
||||
console.log(name, value)
|
||||
const group = item.getContainer()
|
||||
const nodeDom = group.get('children')
|
||||
const nodeBox = nodeDom[1]
|
||||
@@ -272,13 +279,27 @@ export default {
|
||||
},
|
||||
handleSelectedNode (event) {
|
||||
const { item } = event
|
||||
if (this.selectedNodeId && this.selectedNodeId !== item._cfg.id) {
|
||||
this.graph.findById(this.selectedNodeId).getModel().selected = false
|
||||
this.graph.setItemState(this.selectedNodeId, 'selected', false)
|
||||
}
|
||||
item.getModel().selected = !item.getModel().selected
|
||||
this.graph.setItemState(item, 'selected', item.getModel().selected)
|
||||
this.graph.refreshItem(item)
|
||||
this.graph.setItemState(item._cfg.id, 'selected', item.getModel().selected)
|
||||
this.selectedNodeId = item._cfg.id
|
||||
this.graph.refreshItem(item._cfg.id)
|
||||
this.graph.layout()
|
||||
},
|
||||
/**
|
||||
* 查询,定位高亮
|
||||
* @param nodeId
|
||||
*/
|
||||
searchNode (nodeId) {
|
||||
const item = this.graph.findById(nodeId)
|
||||
this.graph.setItemState(nodeId, 'selected', true)
|
||||
if (this.lastQueryId) {
|
||||
this.graph.setItemState(this.lastQueryId, 'selected', false)
|
||||
}
|
||||
this.lastQueryId = nodeId
|
||||
const matrix = item.get('group').getMatrix()
|
||||
const point = {
|
||||
x: matrix[6],
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<!--</a-tabs>-->
|
||||
|
||||
<breadcrumb v-if="!isEmbedded"/>
|
||||
<div style="margin: 12px 12px 0;">
|
||||
<div :style="!isEmbedded ? 'margin: 12px 12px 0;' : ''">
|
||||
<!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
|
||||
<keep-alive v-if="multipage">
|
||||
<router-view v-if="reloadFlag" />
|
||||
|
||||
@@ -104,7 +104,7 @@ const updatePageHeight = () => {
|
||||
const obj = {
|
||||
'primary-color': '#D52C26',
|
||||
'user-info-height': isEmbedded ? '0px' : '59px', // 用户信息的高度
|
||||
'breadcrumb-height': isEmbedded ? '12px' : '45px' // 面包屑的高度
|
||||
'breadcrumb-height': isEmbedded ? '0px' : '45px' // 面包屑的高度
|
||||
}
|
||||
// 计算表格竖向滚动条使用
|
||||
const storeObj = Object.assign(obj, {
|
||||
|
||||
Reference in New Issue
Block a user