{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js??ref--0-0!/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/babel.config.js","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/thread-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":["import \"core-js/modules/web.dom.iterable\";\nimport _regeneratorRuntime from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/regeneratorRuntime.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator.js\";\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//\n\nimport * as API from \"@/api/menu\";\nimport waves from \"@/directive/waves\"; // waves directive\nimport { parseTime } from \"@/utils\";\nimport Form from \"./components/form\";\nexport default {\n  name: \"Menu\",\n  components: {\n    Form: Form\n  },\n  directives: {\n    waves: waves\n  },\n  data: function 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      isAdmin: false,\n      //记录,只有是admin用户才有删除权限\n      menuStyleMap: {},\n      menuStyleKey: {}\n    };\n  },\n  created: function 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: function addNewProject(parent_code, style) {\n      var _this = this;\n      this.$nextTick(function () {\n        _this.$refs.fromType.init(null, parent_code, style);\n      });\n    },\n    getMenuStyleMap: function () {\n      var _getMenuStyleMap = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n        var res;\n        return _regeneratorRuntime().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              _context.next = 2;\n              return API.getMenuStyleMap();\n            case 2:\n              res = _context.sent;\n              this.menuStyleMap = res.result.map;\n            case 4:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function getMenuStyleMap() {\n        return _getMenuStyleMap.apply(this, arguments);\n      }\n      return getMenuStyleMap;\n    }(),\n    getMenuStyleKey: function () {\n      var _getMenuStyleKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n        var res;\n        return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              _context2.next = 2;\n              return API.getMenuStyleKey();\n            case 2:\n              res = _context2.sent;\n              this.menuStyleKey = res.result.key;\n            case 4:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function getMenuStyleKey() {\n        return _getMenuStyleKey.apply(this, arguments);\n      }\n      return getMenuStyleKey;\n    }(),\n    getList: function () {\n      var _getList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n        var res, list;\n        return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              this.listLoading = true;\n              _context3.next = 3;\n              return API.list(this.listQuery);\n            case 3:\n              res = _context3.sent;\n              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            case 11:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function getList() {\n        return _getList.apply(this, arguments);\n      }\n      return getList;\n    }(),\n    menu_merge: function menu_merge(node) {\n      var _this2 = this;\n      var pid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n      var arr = [];\n      node.forEach(function (v, index) {\n        if (v['parent_code'] == pid) {\n          v['children'] = _this2.menu_merge(node, v['code']);\n          arr.push(v);\n        }\n      });\n      if (arr.length <= 0) return null;else return arr;\n    },\n    delHandle: function () {\n      var _delHandle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(id) {\n        var _this3 = this;\n        return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n          while (1) switch (_context5.prev = _context5.next) {\n            case 0:\n              this.$confirm(\"确认删除???\", \"提示\").then(/*#__PURE__*/function () {\n                var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_) {\n                  var res;\n                  return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n                    while (1) switch (_context4.prev = _context4.next) {\n                      case 0:\n                        console.log(\"确认\");\n                        _context4.next = 3;\n                        return API.del(id);\n                      case 3:\n                        res = _context4.sent;\n                        if (res.__error === 0) {\n                          _this3.$message({\n                            message: \"成功\",\n                            type: \"success\"\n                          });\n                          _this3.getList();\n                        }\n                      case 5:\n                      case \"end\":\n                        return _context4.stop();\n                    }\n                  }, _callee4);\n                }));\n                return function (_x2) {\n                  return _ref.apply(this, arguments);\n                };\n              }()).catch(function (_) {\n                console.log(\"取消\");\n              });\n            case 1:\n            case \"end\":\n              return _context5.stop();\n          }\n        }, _callee5, this);\n      }));\n      function delHandle(_x) {\n        return _delHandle.apply(this, arguments);\n      }\n      return delHandle;\n    }(),\n    handleDisable: function () {\n      var _handleDisable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {\n        return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n          while (1) switch (_context6.prev = _context6.next) {\n            case 0:\n              _context6.next = 2;\n              return this.$confirm(\"\\u786E\\u8BA4\\uFF1F\", \"提示\", {\n                type: \"warning\"\n              });\n            case 2:\n              if (!id) {\n                _context6.next = 9;\n                break;\n              }\n              this.btnLoading = true;\n              _context6.next = 6;\n              return API.set({\n                id: id\n              });\n            case 6:\n              this.btnLoading = false;\n              _context6.next = 9;\n              return this.getList();\n            case 9:\n            case \"end\":\n              return _context6.stop();\n          }\n        }, _callee6, this);\n      }));\n      function handleDisable(_x3) {\n        return _handleDisable.apply(this, arguments);\n      }\n      return handleDisable;\n    }(),\n    fromHandle: function fromHandle(id) {\n      var _this4 = this;\n      this.$nextTick(function () {\n        _this4.$refs.fromType.init(id);\n      });\n    },\n    handleFilter: function handleFilter() {\n      this.listQuery.page = 1;\n      this.getList();\n    },\n    handleModifyStatus: function handleModifyStatus(row, status) {\n      this.$confirm(\"\\u786E\\u8BA4\\u8FDB\\u884C\\u6B64\\u64CD\\u4F5C\\u5417\\uFF1F\", \"提示\", {\n        type: \"warning\"\n      });\n      this.$message({\n        message: \"操作Success\",\n        type: \"success\"\n      });\n      row.status = status;\n    },\n    sortByID: function 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};",null]}