|
@@ -381,14 +381,28 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ treeInit(data){
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ const element = data[i];
|
|
|
+ element.name = element.roleName = element.title
|
|
|
+ if(element.children && element.children.length > 0) this.treeInit(element.children)
|
|
|
+ }
|
|
|
+ },
|
|
|
getTree () {
|
|
|
- GetMaterialCategoryZTree().then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.treeData = res.result
|
|
|
- this.hiddenDelBtn(this.treeData)
|
|
|
- this.formConfig[9].list = JSON.parse(JSON.stringify(this.treeData))
|
|
|
- }
|
|
|
- })
|
|
|
+ const v = this
|
|
|
+ // v.$post('/api/iot-management/classify/tree').then(res=>{
|
|
|
+ // v.treeInit(res.data)
|
|
|
+ // this.treeData = res.data
|
|
|
+ // console.log(res)
|
|
|
+ // this.formConfig[9].list = JSON.parse(JSON.stringify(this.treeData))
|
|
|
+ // })
|
|
|
+ // GetMaterialCategoryZTree().then(res => {
|
|
|
+ // if (res.code === 0) {
|
|
|
+ // this.treeData = res.result
|
|
|
+ // this.hiddenDelBtn(this.treeData)
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
hiddenDelBtn (data = []) {
|
|
|
data.forEach(item => {
|