|
@@ -263,7 +263,6 @@ export default {
|
|
|
</div>
|
|
|
`;
|
|
|
} else if (modelInfo.MindType == 2) {//产品
|
|
|
- console.log(modelInfo)
|
|
|
return `
|
|
|
<div class="model-edit-card">
|
|
|
<div class="img" onclick="vm.checkImg('${ (modelInfo.systemFileList && modelInfo.systemFileList.length > 0)? this.$commonJS.checkViewer(modelInfo.systemFileList[0].guid): ""}')">
|
|
@@ -271,8 +270,8 @@ export default {
|
|
|
</div>
|
|
|
<div class="patent">
|
|
|
<p class="model-title-p"><span>${ modelInfo.name}</span></p>
|
|
|
- <p class="model-title-p model-patent" onclick="check(${modelInfo.id},${modelInfo.MindType},'${modelInfo.name}','1')">商品化专利:<span>${modelInfo.productPatentNum}</span></p>
|
|
|
- <p class="model-title-p model-patent" onclick="check(${modelInfo.id},${modelInfo.MindType},'${modelInfo.name}','2')">相关专利:<span>${modelInfo.patentNum}</span></p>
|
|
|
+ <p class="model-title-p model-patent" onclick="check(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.name}','${modelInfo.categoryId}')">商品化专利:<span>${modelInfo.productPatentNum}</span></p>
|
|
|
+ <p class="model-title-p model-patent1" onclick="check1(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.name}','${modelInfo.categoryId}')">相关专利:<span>${modelInfo.patentNum}</span></p>
|
|
|
</div>
|
|
|
<div class="icon" style="display:${modelInfo.hasChildren? "block":"none"}">
|
|
|
>>>
|
|
@@ -287,7 +286,7 @@ export default {
|
|
|
</div>
|
|
|
<div class="patent">
|
|
|
<p class="model-title-p"><span>${ modelInfo.name}</span></p>
|
|
|
- <p class="model-title-p model-patent" onclick="check(${modelInfo.id},${modelInfo.MindType},'${modelInfo.pathName}','${modelInfo.productName}')">相关专利:<span>${modelInfo.patentNum}</span></p>
|
|
|
+ <p class="model-title-p model-patent1" onclick="check1(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.pathName}','${modelInfo.productName}')">相关专利:<span>${modelInfo.patentNum}</span></p>
|
|
|
</div>
|
|
|
<div class="icon" style="display:${ modelInfo.hasChildren? "block":"none"}">
|
|
|
>>>
|
|
@@ -297,35 +296,40 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- //查看相关专利
|
|
|
- check(id, type,name,productName) {
|
|
|
- // console.log(id,type,name)
|
|
|
- // console.log(name.lastIndexOf('/') == name.length-1)
|
|
|
- // if(name.lastIndexOf('/') == name.length-1){
|
|
|
- // name = name.substring(0, str.length - 1);
|
|
|
- // }
|
|
|
+ /**
|
|
|
+ * 查看相关专利
|
|
|
+ * @param {*} id 产品id或者架构id
|
|
|
+ * @param {*} type 类型2是产品3是架构
|
|
|
+ * @param {*} name 产品名称或者架构路径
|
|
|
+ * @param {*} categoryId 架构id
|
|
|
+ */
|
|
|
+ check(id, type,name,categoryId) {
|
|
|
if (type == 2) {//产品
|
|
|
- const router = this.$router.resolve({
|
|
|
- path: "/relatedPatentsIndex",
|
|
|
- query: {
|
|
|
- id: id,
|
|
|
- name:name,
|
|
|
- queryType:productName
|
|
|
- },
|
|
|
- });
|
|
|
- window.open(router.href, "_blank");
|
|
|
- } else if (type == 3) {//架构
|
|
|
- name =productName + '/' + name.substring(0, name.length - 1);
|
|
|
- const router = this.$router.resolve({
|
|
|
- path: "/relatedPatentsIndex",
|
|
|
+ var form = {
|
|
|
+ name:name,
|
|
|
+ id:id,
|
|
|
+ type:type,
|
|
|
+ categoryId:categoryId
|
|
|
+ }
|
|
|
+ let router = this.$router.resolve({
|
|
|
+ path: '/frameworkIndex',
|
|
|
query: {
|
|
|
- structureId: id,
|
|
|
- name:name
|
|
|
- },
|
|
|
- });
|
|
|
- window.open(router.href, "_blank");
|
|
|
- }
|
|
|
+ row: JSON.stringify(form),
|
|
|
+ }
|
|
|
+ })
|
|
|
+ window.open(router.href, '_blank')
|
|
|
+ }
|
|
|
+ // else if (type == 3) {//架构
|
|
|
+ // name =productName + '/' + name.substring(0, name.length - 1);
|
|
|
+ // const router = this.$router.resolve({
|
|
|
+ // path: "/relatedPatentsIndex",
|
|
|
+ // query: {
|
|
|
+ // structureId: id,
|
|
|
+ // name:name
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // window.open(router.href, "_blank");
|
|
|
+ // }
|
|
|
this.next = false;
|
|
|
},
|
|
|
// 筛选树结构
|
|
@@ -468,108 +472,108 @@ export default {
|
|
|
const selectedNode = this.jm.get_selected_node();
|
|
|
if (selectedNode) {
|
|
|
if (selectedNode.children.length == 0) {
|
|
|
- if (selectedNode.data.rowType == 1) {//查询产品
|
|
|
- var queryParams = {
|
|
|
- productCategoryId: selectedNode.data.ids,
|
|
|
- };
|
|
|
- this.$api.queryProducts(queryParams).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.jm.enable_edit();
|
|
|
- res.data.list.forEach((item) => {
|
|
|
- var data = {
|
|
|
- expanded: false,
|
|
|
- rowType: 2,
|
|
|
- ids: item.id,
|
|
|
- productName:item.productName,
|
|
|
- children: [],
|
|
|
- };
|
|
|
- this.jm.toggle_node(selectedNode.id);
|
|
|
- data.children = item.children ? item.children : [];
|
|
|
- item.type = 2;
|
|
|
- this.jm.add_node(
|
|
|
- selectedNode.id,
|
|
|
- "产品" + item.id,
|
|
|
- this.getModelCardDom(item),
|
|
|
- data
|
|
|
- );
|
|
|
- });
|
|
|
- this.jm.disable_edit();
|
|
|
- }
|
|
|
- });
|
|
|
- } else if (selectedNode.data.rowType == 2) {//查询产品架构
|
|
|
- var queryParams = {
|
|
|
- productId: selectedNode.data.ids,
|
|
|
- structureId: 0,
|
|
|
- };
|
|
|
- this.$api.queryStructures(queryParams).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.jm.enable_edit();
|
|
|
-
|
|
|
- res.data.children.forEach((item) => {
|
|
|
- var data = {
|
|
|
- expanded: false,
|
|
|
- rowType: 3,
|
|
|
- ids: item.id,
|
|
|
- productId: selectedNode.data.ids,
|
|
|
- productName:selectedNode.data.productName,
|
|
|
- };
|
|
|
- this.jm.toggle_node(selectedNode.id);
|
|
|
- data.children = item.children ? item.children : [];
|
|
|
- item.productName=selectedNode.data.productName,
|
|
|
- item.type = 3;
|
|
|
- this.jm.add_node(
|
|
|
- selectedNode.id,
|
|
|
- "架构" + item.id,
|
|
|
- this.getModelCardDom(item),
|
|
|
- data
|
|
|
- );
|
|
|
- // if(item.children&& item.children.length>0){
|
|
|
- // this.deepChildren(item.id,item.children)
|
|
|
- // }
|
|
|
- });
|
|
|
-
|
|
|
- this.jm.disable_edit();
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- if ((selectedNode.data.children&&selectedNode.data.children.length==0) ||( selectedNode.data.hasChildren && selectedNode.data.hasChildren.length==0)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- var queryParams = {
|
|
|
- structureId: selectedNode.data.ids,
|
|
|
- productId: selectedNode.data.productId,
|
|
|
- };
|
|
|
- this.$api.queryStructures(queryParams).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.jm.enable_edit();
|
|
|
-
|
|
|
- res.data.children.forEach((item) => {
|
|
|
- var data = {
|
|
|
- expanded: false,
|
|
|
- rowType: 3,
|
|
|
- ids: item.id,
|
|
|
- productId: selectedNode.data.productId,
|
|
|
- productName:selectedNode.data.productName,
|
|
|
- };
|
|
|
- this.jm.toggle_node(selectedNode.id);
|
|
|
- data.children = item.children ? item.children : [];
|
|
|
- item.productName=selectedNode.data.productName,
|
|
|
- item.type = 3;
|
|
|
- this.jm.add_node(
|
|
|
- selectedNode.id,
|
|
|
- "架构" + item.id,
|
|
|
- this.getModelCardDom(item),
|
|
|
- data
|
|
|
- );
|
|
|
- // if(item.children&& item.children.length>0){
|
|
|
- // this.deepChildren(item.id,item.children)
|
|
|
- // }
|
|
|
- });
|
|
|
-
|
|
|
- this.jm.disable_edit();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (selectedNode.data.rowType == 1) {//查询产品
|
|
|
+ // var queryParams = {
|
|
|
+ // productCategoryId: selectedNode.data.ids,
|
|
|
+ // };
|
|
|
+ // this.$api.queryProducts(queryParams).then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.jm.enable_edit();
|
|
|
+ // res.data.list.forEach((item) => {
|
|
|
+ // var data = {
|
|
|
+ // expanded: false,
|
|
|
+ // rowType: 2,
|
|
|
+ // ids: item.id,
|
|
|
+ // productName:item.productName,
|
|
|
+ // children: [],
|
|
|
+ // };
|
|
|
+ // this.jm.toggle_node(selectedNode.id);
|
|
|
+ // data.children = item.children ? item.children : [];
|
|
|
+ // item.type = 2;
|
|
|
+ // this.jm.add_node(
|
|
|
+ // selectedNode.id,
|
|
|
+ // "产品" + item.id,
|
|
|
+ // this.getModelCardDom(item),
|
|
|
+ // data
|
|
|
+ // );
|
|
|
+ // });
|
|
|
+ // this.jm.disable_edit();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else if (selectedNode.data.rowType == 2) {//查询产品架构
|
|
|
+ // var queryParams = {
|
|
|
+ // productId: selectedNode.data.ids,
|
|
|
+ // structureId: 0,
|
|
|
+ // };
|
|
|
+ // this.$api.queryStructures(queryParams).then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.jm.enable_edit();
|
|
|
+
|
|
|
+ // res.data.children.forEach((item) => {
|
|
|
+ // var data = {
|
|
|
+ // expanded: false,
|
|
|
+ // rowType: 3,
|
|
|
+ // ids: item.id,
|
|
|
+ // productId: selectedNode.data.ids,
|
|
|
+ // productName:selectedNode.data.productName,
|
|
|
+ // };
|
|
|
+ // this.jm.toggle_node(selectedNode.id);
|
|
|
+ // data.children = item.children ? item.children : [];
|
|
|
+ // item.productName=selectedNode.data.productName,
|
|
|
+ // item.type = 3;
|
|
|
+ // this.jm.add_node(
|
|
|
+ // selectedNode.id,
|
|
|
+ // "架构" + item.id,
|
|
|
+ // this.getModelCardDom(item),
|
|
|
+ // data
|
|
|
+ // );
|
|
|
+ // // if(item.children&& item.children.length>0){
|
|
|
+ // // this.deepChildren(item.id,item.children)
|
|
|
+ // // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ // this.jm.disable_edit();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // if ((selectedNode.data.children&&selectedNode.data.children.length==0) ||( selectedNode.data.hasChildren && selectedNode.data.hasChildren.length==0)) {
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // var queryParams = {
|
|
|
+ // structureId: selectedNode.data.ids,
|
|
|
+ // productId: selectedNode.data.productId,
|
|
|
+ // };
|
|
|
+ // this.$api.queryStructures(queryParams).then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.jm.enable_edit();
|
|
|
+
|
|
|
+ // res.data.children.forEach((item) => {
|
|
|
+ // var data = {
|
|
|
+ // expanded: false,
|
|
|
+ // rowType: 3,
|
|
|
+ // ids: item.id,
|
|
|
+ // productId: selectedNode.data.productId,
|
|
|
+ // productName:selectedNode.data.productName,
|
|
|
+ // };
|
|
|
+ // this.jm.toggle_node(selectedNode.id);
|
|
|
+ // data.children = item.children ? item.children : [];
|
|
|
+ // item.productName=selectedNode.data.productName,
|
|
|
+ // item.type = 3;
|
|
|
+ // this.jm.add_node(
|
|
|
+ // selectedNode.id,
|
|
|
+ // "架构" + item.id,
|
|
|
+ // this.getModelCardDom(item),
|
|
|
+ // data
|
|
|
+ // );
|
|
|
+ // // if(item.children&& item.children.length>0){
|
|
|
+ // // this.deepChildren(item.id,item.children)
|
|
|
+ // // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ // this.jm.disable_edit();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
} else {
|
|
|
this.jm.toggle_node(selectedNode.id);
|
|
|
}
|
|
@@ -705,10 +709,12 @@ export default {
|
|
|
await this.$api.queryProductCategory(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
this.currentData = response.data.data[0]
|
|
|
- this.currentData.MindId = `产品类别${this.currentData.id}`
|
|
|
+ this.currentData.MindId = this.currentData.id
|
|
|
+ this.currentData.id = `产品类别${this.currentData.id}`
|
|
|
this.currentData.MindType= this.type
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
} else if (this.type == 2) {//产品
|
|
|
let params = {
|
|
|
searchQuery:`product_id=${this.id}`,//检索条件
|
|
@@ -716,98 +722,234 @@ export default {
|
|
|
await this.$api.queryProduct(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
this.currentData = response.data.data[0]
|
|
|
- this.currentData.MindId = `产品${this.currentData.id}`
|
|
|
+ this.currentData.MindId = this.currentData.id
|
|
|
+ this.currentData.id = `产品${this.currentData.id}`
|
|
|
this.currentData.MindType= this.type
|
|
|
}
|
|
|
})
|
|
|
}else if (this.type == 0){//全部
|
|
|
this.currentData = {}
|
|
|
- this.currentData.MindId = `产品${this.currentData.id}`
|
|
|
+ this.currentData.MindId = `root`
|
|
|
+ this.currentData.id = `root`
|
|
|
this.currentData.MindType= this.type
|
|
|
}
|
|
|
this.currentData.expanded = false
|
|
|
- this.currentData.topic = this.getModelCardDom(this.currentData)
|
|
|
+ await this.LoadData(this.currentData)
|
|
|
+ // this.currentData.topic = this.getModelCardDom(this.currentData)
|
|
|
},
|
|
|
|
|
|
- //初始化JsMind数据
|
|
|
- async initData(currentData){
|
|
|
+ //装载数据
|
|
|
+ async LoadData(currentData){
|
|
|
+ if(currentData.MindType == 1){//产品类别
|
|
|
+ var data1 = currentData
|
|
|
+ //装载产品
|
|
|
+ const [products] = await Promise.allSettled([this.initData(data1)])
|
|
|
+ var productList = products.status =='fulfilled'?products.value:[]
|
|
|
+ if(productList.length>0){
|
|
|
+ data1.hasChildren = true
|
|
|
+ data1.children = productList.map(item=>{
|
|
|
+ item.MindId = item.id
|
|
|
+ item.id = `产品${item.id}`
|
|
|
+ item.MindType = 2
|
|
|
+ item.expanded = false
|
|
|
+ item.topic = this.getModelCardDom(item)
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ data1.topic = this.getModelCardDom(data1)
|
|
|
+
|
|
|
+
|
|
|
+ //装载架构
|
|
|
+ var data2 = data1.children
|
|
|
+ // 获取需要返回的架构数组以及funList
|
|
|
+ var treeList = [], funList = []
|
|
|
+ for(var i = 0;i<data2.length;i++){
|
|
|
+ treeList.push(`tree${i+1}`)
|
|
|
+ funList.push(this.initData(data2[i]))
|
|
|
+ }
|
|
|
+ treeList = await Promise.allSettled(funList)
|
|
|
+ for(var i = 0;i<data2.length;i++){
|
|
|
+ var trees = treeList[i].status =='fulfilled'?treeList[i].value:[]
|
|
|
+ if(trees.length>0){
|
|
|
+ data2[i].hasChildren = true
|
|
|
+ this.deepChildren(trees,data2[i])
|
|
|
+ }
|
|
|
+ data2[i].topic = this.getModelCardDom(data2[i])
|
|
|
+ data2[i].children = trees
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(currentData.MindType == 2){//产品
|
|
|
+ var data1 = currentData
|
|
|
+ //装载架构
|
|
|
+ const [tree] = await Promise.allSettled([this.initData(data1)])
|
|
|
+ var trees = tree.status =='fulfilled'?tree.value:[]
|
|
|
+ if(trees.length>0){
|
|
|
+ data1.hasChildren = true
|
|
|
+ this.deepChildren(trees,data1)
|
|
|
+ }
|
|
|
+ data1.topic = this.getModelCardDom(data1)
|
|
|
+ data1.children = trees
|
|
|
+ }else if(currentData.MindType == 0){//全部
|
|
|
+ var data1 = currentData
|
|
|
+ //装载产品类别
|
|
|
+ const [category] = await Promise.allSettled([this.initData(data1)])
|
|
|
+ var categoryList = category.status =='fulfilled'?category.value:[]
|
|
|
+ if(categoryList.length>0){
|
|
|
+ data1.hasChildren = true
|
|
|
+ data1.children = categoryList.map(item=>{
|
|
|
+ item.MindId = item.id
|
|
|
+ item.id = `产品类别${item.id}`
|
|
|
+ item.MindType = 1
|
|
|
+ item.expanded = false
|
|
|
+ item.topic = this.getModelCardDom(item)
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ data1.topic = this.getModelCardDom(data1)
|
|
|
+
|
|
|
+ //装载产品
|
|
|
+ var data2 = data1.children
|
|
|
+ // 获取需要返回的架构数组以及funList
|
|
|
+ var productList = [], funList = []
|
|
|
+ for(var i = 0;i<data2.length;i++){
|
|
|
+ productList.push(`product${i+1}`)
|
|
|
+ funList.push(this.initData(data2[i]))
|
|
|
+ }
|
|
|
+ productList = await Promise.allSettled(funList)
|
|
|
+ for(var i = 0;i<data2.length;i++){
|
|
|
+ var product = productList[i].status =='fulfilled'?productList[i].value:[]
|
|
|
+ if(product.length>0){
|
|
|
+ data2[i].hasChildren = true
|
|
|
+ data2[i].children = product.map(item=>{
|
|
|
+ item.MindId = item.id
|
|
|
+ item.id = `产品${item.id}`
|
|
|
+ item.MindType = 2
|
|
|
+ item.expanded = false
|
|
|
+ item.topic = this.getModelCardDom(item)
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ data2[i].topic = this.getModelCardDom(data2[i])
|
|
|
+ }
|
|
|
+
|
|
|
+ //装载架构
|
|
|
+ var data3 = data2.children
|
|
|
+ // 获取需要返回的架构数组以及funList
|
|
|
+ var treeList = [], funList = []
|
|
|
+ for(var i = 0;i<data3.length;i++){
|
|
|
+ treeList.push(`tree${i+1}`)
|
|
|
+ funList.push(this.initData(data3[i]))
|
|
|
+ }
|
|
|
+ treeList = await Promise.allSettled(funList)
|
|
|
+ for(var i = 0;i<data3.length;i++){
|
|
|
+ var trees = treeList[i].status =='fulfilled'?treeList[i].value:[]
|
|
|
+ if(trees.length>0){
|
|
|
+ data3[i].hasChildren = true
|
|
|
+ this.deepChildren(trees,data3[i])
|
|
|
+ }
|
|
|
+ data3[i].topic = this.getModelCardDom(data3[i])
|
|
|
+ data3[i].children = trees
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //初始化JsMind数据
|
|
|
+ async initData(currentData){
|
|
|
if(currentData.MindType == 1){
|
|
|
let params = {
|
|
|
- searchQuery:`product_id=${currentData.id}`,//检索条件
|
|
|
+ searchQuery:`category_id=${currentData.MindId}`,//检索条件
|
|
|
}
|
|
|
- await this.$api.queryProduct(params).then(response=>{
|
|
|
- if(response.code == 200){
|
|
|
- if(response.data.data.length>0){
|
|
|
- currentData.hasChildren = true
|
|
|
- currentData.children = response.data.data.map(item=>{
|
|
|
- item.MindId = `产品${item.id}`
|
|
|
- item.MindType = 2
|
|
|
- item.expanded = false
|
|
|
- item.topic = this.getModelCardDom(item)
|
|
|
- // this.jm.enable_edit();
|
|
|
- // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
- // this.jm.disable_edit();
|
|
|
- return item
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }else if(currentData.MindType == 2){
|
|
|
+ return await this.$api.queryProduct(params).then(response=> response.data.data)
|
|
|
+ }else if(currentData.MindType == 2){//产品
|
|
|
var params = {
|
|
|
type: currentData.MindType,
|
|
|
- typeId: currentData.id
|
|
|
+ typeId: currentData.MindId
|
|
|
}
|
|
|
- await this.$api.queryTreeNodeTree(params).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- var data = res.data.data
|
|
|
- if(data.length>0){
|
|
|
- currentData.hasChildren = true
|
|
|
- var data = this.deepChildren(data,currentData)
|
|
|
- }
|
|
|
- currentData.children = data
|
|
|
- }
|
|
|
- })
|
|
|
+ return await this.$api.queryTreeNodeTree(params).then(response=> response.data.data)
|
|
|
}else if(currentData.MindType == 0){
|
|
|
let params = {
|
|
|
searchQuery:'',//检索条件
|
|
|
}
|
|
|
- await this.$api.queryProductCategory(params).then(response=>{
|
|
|
- if(response.code == 200){
|
|
|
- if(response.data.data.length>0){
|
|
|
- currentData.hasChildren = true
|
|
|
- currentData.children = response.data.data.map(item=>{
|
|
|
- item.MindId = `产品类别${item.id}`
|
|
|
- item.MindType = 1
|
|
|
- item.expanded = false
|
|
|
- item.topic = this.getModelCardDom(item)
|
|
|
- // this.jm.enable_edit();
|
|
|
- // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
- // this.jm.disable_edit();
|
|
|
- return item
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ return await this.$api.queryProductCategory(params).then(response=> response.data.data)
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ // //初始化JsMind数据
|
|
|
+ // async initData(currentData){
|
|
|
+ // if(currentData.MindType == 1){
|
|
|
+ // let params = {
|
|
|
+ // searchQuery:`product_id=${currentData.id}`,//检索条件
|
|
|
+ // }
|
|
|
+ // await this.$api.queryProduct(params).then(response=>{
|
|
|
+ // if(response.code == 200){
|
|
|
+ // if(response.data.data.length>0){
|
|
|
+ // currentData.hasChildren = true
|
|
|
+ // currentData.children = response.data.data.map(item=>{
|
|
|
+ // item.MindId = `产品${item.id}`
|
|
|
+ // item.MindType = 2
|
|
|
+ // item.expanded = false
|
|
|
+ // item.topic = this.getModelCardDom(item)
|
|
|
+ // // this.jm.enable_edit();
|
|
|
+ // // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
+ // // this.jm.disable_edit();
|
|
|
+ // return item
|
|
|
+ // })
|
|
|
+
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }else if(currentData.MindType == 2){
|
|
|
+ // var params = {
|
|
|
+ // type: currentData.MindType,
|
|
|
+ // typeId: currentData.id
|
|
|
+ // }
|
|
|
+ // await this.$api.queryTreeNodeTree(params).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // var data = res.data.data
|
|
|
+ // if(data.length>0){
|
|
|
+ // currentData.hasChildren = true
|
|
|
+ // var data = this.deepChildren(data,currentData)
|
|
|
+ // }
|
|
|
+ // currentData.children = data
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }else if(currentData.MindType == 0){
|
|
|
+ // let params = {
|
|
|
+ // searchQuery:'',//检索条件
|
|
|
+ // }
|
|
|
+ // await this.$api.queryProductCategory(params).then(response=>{
|
|
|
+ // if(response.code == 200){
|
|
|
+ // if(response.data.data.length>0){
|
|
|
+ // currentData.hasChildren = true
|
|
|
+ // currentData.children = response.data.data.map(item=>{
|
|
|
+ // item.MindId = `产品类别${item.id}`
|
|
|
+ // item.MindType = 1
|
|
|
+ // item.expanded = false
|
|
|
+ // item.topic = this.getModelCardDom(item)
|
|
|
+ // // this.jm.enable_edit();
|
|
|
+ // // this.jm.update_node(item.MindId,this.getModelCardDom(item) )
|
|
|
+ // // this.jm.disable_edit();
|
|
|
+ // return item
|
|
|
+ // })
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // },
|
|
|
|
|
|
//递归
|
|
|
deepChildren(data,currentData){
|
|
|
for(var i = 0;i<data.length;i++){
|
|
|
- data[i].MindId = `架构${data[i].id}`
|
|
|
+ data[i].MindId = data[i].id
|
|
|
+ data[i].id = `架构${data[i].id}`
|
|
|
data[i].MindType = 3
|
|
|
data[i].expanded = false
|
|
|
|
|
|
data[i].currentName = currentData.name
|
|
|
data[i].currentId = currentData.id
|
|
|
data[i].currentType = currentData.MindType
|
|
|
- // 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){
|
|
|
data[i].hasChildren = true
|
|
|
data[i].topic = this.getModelCardDom(data[i])
|
|
@@ -826,7 +968,7 @@ export default {
|
|
|
async mounted() {
|
|
|
window.check = this.check;
|
|
|
await this.getData()
|
|
|
- await this.initData(this.currentData)
|
|
|
+ // await this.initData(this.currentData)
|
|
|
this.mind.data = this.currentData
|
|
|
this.jm = jsMind.show(this.options, this.mind);
|
|
|
|