|
@@ -263,6 +263,7 @@ export default {
|
|
</div>
|
|
</div>
|
|
`;
|
|
`;
|
|
} else if (modelInfo.MindType == 2) {//产品
|
|
} else if (modelInfo.MindType == 2) {//产品
|
|
|
|
+ console.log(modelInfo)
|
|
return `
|
|
return `
|
|
<div class="model-edit-card">
|
|
<div class="model-edit-card">
|
|
<div class="img" onclick="vm.checkImg('${ (modelInfo.systemFileList && modelInfo.systemFileList.length > 0)? this.$commonJS.checkViewer(modelInfo.systemFileList[0].guid): ""}')">
|
|
<div class="img" onclick="vm.checkImg('${ (modelInfo.systemFileList && modelInfo.systemFileList.length > 0)? this.$commonJS.checkViewer(modelInfo.systemFileList[0].guid): ""}')">
|
|
@@ -737,33 +738,36 @@ export default {
|
|
await this.$api.queryProduct(params).then(response=>{
|
|
await this.$api.queryProduct(params).then(response=>{
|
|
if(response.code == 200){
|
|
if(response.code == 200){
|
|
if(response.data.data.length>0){
|
|
if(response.data.data.length>0){
|
|
|
|
+ currentData.hasChildren = true
|
|
currentData.children = response.data.data.map(item=>{
|
|
currentData.children = response.data.data.map(item=>{
|
|
item.MindId = `产品${item.id}`
|
|
item.MindId = `产品${item.id}`
|
|
item.MindType = 2
|
|
item.MindType = 2
|
|
item.expanded = false
|
|
item.expanded = false
|
|
item.topic = this.getModelCardDom(item)
|
|
item.topic = this.getModelCardDom(item)
|
|
- this.jm.enable_edit();
|
|
|
|
- this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
|
- this.jm.disable_edit();
|
|
|
|
|
|
+ // this.jm.enable_edit();
|
|
|
|
+ // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
|
+ // this.jm.disable_edit();
|
|
return item
|
|
return item
|
|
})
|
|
})
|
|
- currentData.hasChildren = true
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}else if(currentData.MindType == 2){
|
|
}else if(currentData.MindType == 2){
|
|
var params = {
|
|
var params = {
|
|
- type: 1,
|
|
|
|
|
|
+ type: currentData.MindType,
|
|
typeId: currentData.id
|
|
typeId: currentData.id
|
|
}
|
|
}
|
|
await this.$api.queryTreeNodeTree(params).then(res => {
|
|
await this.$api.queryTreeNodeTree(params).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
var data = res.data.data
|
|
var data = res.data.data
|
|
- var data = this.deepChildren(data,currentData)
|
|
|
|
- console.log(data)
|
|
|
|
|
|
+ if(data.length>0){
|
|
|
|
+ currentData.hasChildren = true
|
|
|
|
+ var data = this.deepChildren(data,currentData)
|
|
|
|
+ console.log(data)
|
|
|
|
+ }
|
|
currentData.children = data
|
|
currentData.children = data
|
|
- currentData.hasChildren = true
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}else if(currentData.MindType == 0){
|
|
}else if(currentData.MindType == 0){
|
|
@@ -773,17 +777,18 @@ export default {
|
|
await this.$api.queryProductCategory(params).then(response=>{
|
|
await this.$api.queryProductCategory(params).then(response=>{
|
|
if(response.code == 200){
|
|
if(response.code == 200){
|
|
if(response.data.data.length>0){
|
|
if(response.data.data.length>0){
|
|
|
|
+ currentData.hasChildren = true
|
|
currentData.children = response.data.data.map(item=>{
|
|
currentData.children = response.data.data.map(item=>{
|
|
item.MindId = `产品类别${item.id}`
|
|
item.MindId = `产品类别${item.id}`
|
|
item.MindType = 1
|
|
item.MindType = 1
|
|
item.expanded = false
|
|
item.expanded = false
|
|
item.topic = this.getModelCardDom(item)
|
|
item.topic = this.getModelCardDom(item)
|
|
- this.jm.enable_edit();
|
|
|
|
- this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
|
- this.jm.disable_edit();
|
|
|
|
|
|
+ // this.jm.enable_edit();
|
|
|
|
+ // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
|
+ // this.jm.disable_edit();
|
|
return item
|
|
return item
|
|
})
|
|
})
|
|
- currentData.hasChildren = true
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -797,20 +802,22 @@ export default {
|
|
data[i].MindId = `架构${data[i].id}`
|
|
data[i].MindId = `架构${data[i].id}`
|
|
data[i].MindType = 3
|
|
data[i].MindType = 3
|
|
data[i].expanded = false
|
|
data[i].expanded = false
|
|
- data[i].topic = this.getModelCardDom(data[i])
|
|
|
|
|
|
+
|
|
data[i].currentName = currentData.name
|
|
data[i].currentName = currentData.name
|
|
data[i].currentId = currentData.id
|
|
data[i].currentId = currentData.id
|
|
data[i].currentType = currentData.MindType
|
|
data[i].currentType = currentData.MindType
|
|
- this.jm.enable_edit();
|
|
|
|
- this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
|
- this.jm.disable_edit();
|
|
|
|
|
|
+ // this.jm.enable_edit();
|
|
|
|
+ // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
|
+ // this.jm.disable_edit();
|
|
if(data[i].child && data[i].child.length>0){
|
|
if(data[i].child && data[i].child.length>0){
|
|
data[i].hasChildren = true
|
|
data[i].hasChildren = true
|
|
|
|
+ data[i].topic = this.getModelCardDom(data[i])
|
|
data[i].children = data[i].child
|
|
data[i].children = data[i].child
|
|
this.deepChildren(data[i].child,currentData)
|
|
this.deepChildren(data[i].child,currentData)
|
|
}else{
|
|
}else{
|
|
data[i].hasChildren = false
|
|
data[i].hasChildren = false
|
|
data[i].children = []
|
|
data[i].children = []
|
|
|
|
+ data[i].topic = this.getModelCardDom(data[i])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return data
|
|
return data
|
|
@@ -822,7 +829,6 @@ export default {
|
|
await this.getData()
|
|
await this.getData()
|
|
await this.initData(this.currentData)
|
|
await this.initData(this.currentData)
|
|
this.mind.data = this.currentData
|
|
this.mind.data = this.currentData
|
|
-
|
|
|
|
this.jm = jsMind.show(this.options, this.mind);
|
|
this.jm = jsMind.show(this.options, this.mind);
|
|
|
|
|
|
// 自定义拖拽完成事件
|
|
// 自定义拖拽完成事件
|
|
@@ -852,10 +858,11 @@ export default {
|
|
padding: 10px;
|
|
padding: 10px;
|
|
border: 1px solid black;
|
|
border: 1px solid black;
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+ justify-content: flex-start;
|
|
align-items: center;
|
|
align-items: center;
|
|
.img{
|
|
.img{
|
|
cursor: crosshair;
|
|
cursor: crosshair;
|
|
- width: 100px;
|
|
|
|
|
|
+ min-width: 100px;
|
|
height: 100px;
|
|
height: 100px;
|
|
}
|
|
}
|
|
.icon{
|
|
.icon{
|