{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/admin/projects/dms/src/dealer_admin/src/views/system/menu/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/system/menu/index.vue","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport * as API from \"@/api/menu\";\nimport waves from \"@/directive/waves\"; // waves directive\nimport {parseTime} from \"@/utils\";\nimport Form from \"./components/form\";\n\n\nexport default {\n  name: \"Menu\",\n  components: {Form},\n  directives: {waves},\n  data() {\n    return {\n      pic_base_url: process.env.VUE_APP_BASE_PIC,\n      picbase: \"\",\n      tableKey: 0,\n      list: [],\n      total: 0,\n      listLoading: true,\n      listQuery: {\n      },\n      isAdmin: false, //记录,只有是admin用户才有删除权限\n      menuStyleMap:{},\n      menuStyleKey:{},\n    };\n  },\n  created() {\n    this.$forceUpdate();\n    this.getMenuStyleMap();\n    this.getMenuStyleKey();\n    this.getList();\n    this.picbase = process.env.VUE_APP_BASE_PIC;\n  },\n  methods: {\n    addNewProject(parent_code,style) {\n      this.$nextTick(() => {\n        this.$refs.fromType.init(null,parent_code,style);\n      });\n    },\n    async getMenuStyleMap(){\n      const res = await API.getMenuStyleMap();\n      this.menuStyleMap = res.result.map;\n    },\n    async getMenuStyleKey(){\n      const res = await API.getMenuStyleKey();\n      this.menuStyleKey = res.result.key;\n    },\n    async getList() {\n      this.listLoading = true;\n      const res = await API.list(this.listQuery);\n      let list = res.result.list;\n      console.log(\"list:\",list);\n      if(list && list.length > 0){\n        list = this.menu_merge(list,'');\n        console.log(\"list:\",list);\n      }\n      this.list = [];\n      this.list = list;\n      console.log(this.list);\n      this.listLoading = false;\n    },\n    menu_merge(node,pid = ''){\n      var arr = [];\n      node.forEach((v, index) => {\n        if(v['parent_code'] == pid){\n              v['children'] = this.menu_merge(node,v['code']);\n              arr.push(v);\n          }\n      });\n      if(arr.length <= 0) return null;\n      else return arr;\n    },\n    async delHandle(id) {\n      this.$confirm(\"确认删除???\", \"提示\")\n        .then(async _ => {\n          console.log(\"确认\");\n          const res = await API.del(id);\n          if (res.__error === 0) {\n            this.$message({\n              message: \"成功\",\n              type: \"success\"\n            });\n            this.getList();\n          }\n        })\n        .catch(_ => {\n          console.log(\"取消\");\n        });\n    },\n    async handleDisable(id) {\n      await this.$confirm(`确认？`, \"提示\", {\n        type: \"warning\"\n      });\n      if (id) {\n        this.btnLoading = true;\n        await API.set({id});\n        this.btnLoading = false;\n        await this.getList();\n      }\n    },\n    fromHandle(id) {\n      this.$nextTick(() => {\n        this.$refs.fromType.init(id);\n      });\n    },\n    handleFilter() {\n      this.listQuery.page = 1;\n      this.getList();\n    },\n    handleModifyStatus(row, status) {\n      this.$confirm(`确认进行此操作吗？`, \"提示\", {\n        type: \"warning\"\n      });\n      this.$message({\n        message: \"操作Success\",\n        type: \"success\"\n      });\n      row.status = status;\n    },\n    sortByID(order) {\n      if (order === \"ascending\") {\n        this.listQuery.sort = \"+id\";\n      } else {\n        this.listQuery.sort = \"-id\";\n      }\n      this.handleFilter();\n    }\n  }\n};\n",null]}