|
@@ -157,27 +157,48 @@ export default {
|
|
|
this.init(true)
|
|
|
},
|
|
|
methods: {
|
|
|
- async init(arg = false) {
|
|
|
+ init(arg = false) {
|
|
|
if(arg) {
|
|
|
- let res = await classApi.getAllByCategoryId()
|
|
|
- this.classifyList = this.formatData(res.data.children)
|
|
|
- this.initClassifyList = JSON.parse(JSON.stringify(this.classifyList))
|
|
|
+ // let res = await classApi.getAllByCategoryId()
|
|
|
+ // this.classifyList = this.formatData(res.data.children)
|
|
|
+ // this.initClassifyList = JSON.parse(JSON.stringify(this.classifyList))
|
|
|
// this.formatDataAddPstr(this.classifyList)
|
|
|
+ classApi.getAllByCategoryId().then(res => {
|
|
|
+ this.classifyList = this.formatData(res.data.children)
|
|
|
+ this.initClassifyList = JSON.parse(JSON.stringify(this.classifyList))
|
|
|
+ this.formatDataAddPstr(this.classifyList)
|
|
|
+ })
|
|
|
}
|
|
|
- let raw = await api.findAllNodes()
|
|
|
- this.tabPaneList = raw.data.map(item => {
|
|
|
+ // let raw = await api.findAllNodes()
|
|
|
+ // this.tabPaneList = raw.data.map(item => {
|
|
|
+ // let categoryArr = []
|
|
|
+ // for(let i=0;i<item.category.length;i++) {
|
|
|
+ // categoryArr.push({
|
|
|
+ // value:item.category[i],label:item.categoryName[i]
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // return {
|
|
|
+ // pkId: item.pkId,
|
|
|
+ // flowerName: item.flowerName,
|
|
|
+ // categoryId: categoryArr,
|
|
|
+ // knowledgeApprovalNode: item.knowledgeApprovalNode
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ api.findAllNodes().then(raw => {
|
|
|
+ this.tabPaneList = raw.data.map(item => {
|
|
|
let categoryArr = []
|
|
|
for(let i=0;i<item.category.length;i++) {
|
|
|
categoryArr.push({
|
|
|
value:item.category[i],label:item.categoryName[i]
|
|
|
})
|
|
|
}
|
|
|
- return {
|
|
|
- pkId: item.pkId,
|
|
|
- flowerName: item.flowerName,
|
|
|
- categoryId: categoryArr,
|
|
|
- knowledgeApprovalNode: item.knowledgeApprovalNode
|
|
|
- }
|
|
|
+ return {
|
|
|
+ pkId: item.pkId,
|
|
|
+ flowerName: item.flowerName,
|
|
|
+ categoryId: categoryArr,
|
|
|
+ knowledgeApprovalNode: item.knowledgeApprovalNode
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
this.begintabPaneLength = this.tabPaneList.length
|
|
|
// newData={value:element.pkId,label:element.name}
|