asd26269546 2 år sedan
förälder
incheckning
35c75a185a

+ 2 - 2
src/components/main/components/side-menu/side-menu.vue

@@ -3,7 +3,7 @@
 		<slot></slot>
 		<Menu theme="dark"  v-show="!collapsed" width="auto" active-name="1"  @on-select="handleSelect">
 			<div v-for="i in menuList" :key="i.id">
-				<MenuItem :name="i.id" v-if="!i.children || i.children.length == 0">
+				<MenuItem :name="i.id" v-if="!i.children || i.children.length == 0" :to="i.path">
 					<Icon type="ios-paper" />
 					{{i.name}}
 				</MenuItem>
@@ -12,7 +12,7 @@
 						<Icon type="ios-stats" />
 						{{i.name}}
 					</template>
-					<MenuItem :name="i.id + jindex" v-for="(j,jindex) in i.children" :key="j.id">{{j.name}}</MenuItem>
+					<MenuItem  :to="j.path" :name="i.id + jindex" v-for="(j,jindex) in i.children" :key="j.id">{{j.name}}</MenuItem>
 				</Submenu>
 			</div>
 		</Menu>

+ 21 - 7
src/view/base-manage/material-maintenance/material-maintenance.vue

@@ -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 => {

+ 15 - 9
src/view/system-manage/menu.vue

@@ -204,7 +204,7 @@ export default {
           ...data,
           deviceType: 1,
           parentId: target.value || ''
-        }).then(res => {
+        }).then(res => { 
           if (res.code === 0) {
             this.$Message.info(res.msg)
             this.getList()
@@ -297,15 +297,21 @@ export default {
       })
     },
     getList () {
-      GetMenuZTreeChildren({
-        deviceType: 1
-      }).then(res => {
-        if (res.code === 0) {
-          this.data = res.result
-          this.initTree(this.data)
-          this.params.total = res.result.totalCount
-        }
+      const v = this
+      v.$get('/api/blade-system/menu/menu-list').then(res=>{
+        //v.initTree(res.data)
+        this.data = res.data
+        // console.log(res)
       })
+      // GetMenuZTreeChildren({
+      //   deviceType: 1
+      // }).then(res => {
+      //   if (res.code === 0) {
+      //     this.data = res.result
+      //     this.initTree(this.data)
+      //     this.params.total = res.result.totalCount
+      //   }
+      // })
     },
     getList2 () {
       GetMenuZTreeChildren({