b9a74b694547a6d4fdc94688f05d7b62.json 11 KB

1
  1. {"remainingRequest":"D:\\jiayue\\cemp-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\jiayue\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jiayue\\cemp-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jiayue\\cemp-ui\\src\\page\\index\\sidebar\\sidebarItem.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jiayue\\cemp-ui\\src\\page\\index\\sidebar\\sidebarItem.vue","mtime":1619070292874},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport _defineProperty from \"D:/jiayue/cemp-ui/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es6.number.constructor\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\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 { mapGetters } from \"vuex\";\nimport { validatenull as _validatenull } from \"@/util/validate\";\nimport config from \"./config.js\";\nexport default {\n name: \"sidebarItem\",\n data: function data() {\n return {\n config: config\n };\n },\n props: {\n menu: {\n type: Array\n },\n screen: {\n type: Number\n },\n first: {\n type: Boolean,\n default: false\n },\n props: {\n type: Object,\n default: function _default() {\n return {};\n }\n },\n collapse: {\n type: Boolean\n }\n },\n created: function created() {},\n mounted: function mounted() {},\n computed: _objectSpread(_objectSpread({}, mapGetters([\"roles\"])), {}, {\n labelKey: function labelKey() {\n return this.props.label || this.config.propsDefault.label;\n },\n pathKey: function pathKey() {\n return this.props.path || this.config.propsDefault.path;\n },\n iconKey: function iconKey() {\n return this.props.icon || this.config.propsDefault.icon;\n },\n childrenKey: function childrenKey() {\n return this.props.children || this.config.propsDefault.children;\n },\n nowTagValue: function nowTagValue() {\n return this.$router.$avueRouter.getValue(this.$route);\n }\n }),\n methods: {\n vaildAvtive: function vaildAvtive(item) {\n var _this = this;\n\n var groupFlag = (item[\"group\"] || []).some(function (ele) {\n return _this.$route.path.includes(ele);\n });\n return this.nowTagValue === item[this.pathKey] || groupFlag;\n },\n vaildRoles: function vaildRoles(item) {\n item.meta = item.meta || {};\n return item.meta.roles ? item.meta.roles.includes(this.roles) : true;\n },\n validatenull: function validatenull(val) {\n return _validatenull(val);\n },\n open: function open(item) {\n if (this.screen <= 1) this.$store.commit(\"SET_COLLAPSE\");\n this.$router.$avueRouter.group = item.group;\n this.$router.push({\n path: this.$router.$avueRouter.getPath({\n name: item[this.labelKey],\n src: item[this.pathKey]\n }),\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,IAAA,CAAA,KAAA,OAAA;AAFA,SAAA,CADA;AAKA,QAAA,KAAA,EAAA,IAAA,CAAA;AALA,OAAA,EAMA,KANA,CAMA,YAAA,CAAA,CANA;AAOA;AAxBA;AAhDA,CAAA","sourcesContent":["<template>\r\n <div class=\"menu-wrapper\">\r\n <template v-for=\"item in menu\">\r\n <el-menu-item v-if=\"validatenull(item[childrenKey]) && vaildRoles(item)\"\r\n :index=\"item[pathKey]\"\r\n @click=\"open(item)\"\r\n :key=\"item[labelKey]\"\r\n :class=\"{'is-active':vaildAvtive(item)}\">\r\n <i :class=\"item[iconKey]\"></i>\r\n <span slot=\"title\"\r\n :alt=\"item[pathKey]\">{{item[labelKey]}}</span>\r\n </el-menu-item>\r\n <el-submenu v-else-if=\"!validatenull(item[childrenKey])&&vaildRoles(item)\"\r\n :index=\"item[pathKey]\"\r\n :key=\"item[labelKey]\">\r\n <template slot=\"title\">\r\n <i :class=\"item[iconKey]\"></i>\r\n <span slot=\"title\"\r\n :class=\"{'el-menu--display':collapse && first}\">{{item[labelKey]}}</span>\r\n </template>\r\n <template v-for=\"(child,cindex) in item[childrenKey]\">\r\n <el-menu-item :index=\"child[pathKey],cindex\"\r\n @click=\"open(child)\"\r\n :class=\"{'is-active':vaildAvtive(child)}\"\r\n v-if=\"validatenull(child[childrenKey])\"\r\n :key=\"child[labelKey]\">\r\n <i :class=\"child[iconKey]\"></i>\r\n <span slot=\"title\">{{child[labelKey]}}</span>\r\n </el-menu-item>\r\n <sidebar-item v-else\r\n :menu=\"[child]\"\r\n :key=\"cindex\"\r\n :props=\"props\"\r\n :screen=\"screen\"\r\n :collapse=\"collapse\"></sidebar-item>\r\n </template>\r\n </el-submenu>\r\n </template>\r\n </div>\r\n</template>\r\n<script>\r\nimport { mapGetters } from \"vuex\";\r\nimport { validatenull } from \"@/util/validate\";\r\nimport config from \"./config.js\";\r\nexport default {\r\n name: \"sidebarItem\",\r\n data() {\r\n return {\r\n config: config\r\n };\r\n },\r\n props: {\r\n menu: {\r\n type: Array\r\n },\r\n screen: {\r\n type: Number\r\n },\r\n first: {\r\n type: Boolean,\r\n default: false\r\n },\r\n props: {\r\n type: Object,\r\n default: () => {\r\n return {};\r\n }\r\n },\r\n collapse: {\r\n type: Boolean\r\n }\r\n },\r\n created() {},\r\n mounted() {},\r\n computed: {\r\n ...mapGetters([\"roles\"]),\r\n labelKey() {\r\n return this.props.label || this.config.propsDefault.label;\r\n },\r\n pathKey() {\r\n return this.props.path || this.config.propsDefault.path;\r\n },\r\n iconKey() {\r\n return this.props.icon || this.config.propsDefault.icon;\r\n },\r\n childrenKey() {\r\n return this.props.children || this.config.propsDefault.children;\r\n },\r\n nowTagValue() {\r\n return this.$router.$avueRouter.getValue(this.$route);\r\n }\r\n },\r\n methods: {\r\n vaildAvtive(item) {\r\n const groupFlag = (item[\"group\"] || []).some(ele =>\r\n this.$route.path.includes(ele)\r\n );\r\n return this.nowTagValue === item[this.pathKey] || groupFlag;\r\n },\r\n vaildRoles(item) {\r\n item.meta = item.meta || {};\r\n return item.meta.roles ? item.meta.roles.includes(this.roles) : true;\r\n },\r\n validatenull(val) {\r\n return validatenull(val);\r\n },\r\n open(item) {\r\n if (this.screen <= 1) this.$store.commit(\"SET_COLLAPSE\");\r\n this.$router.$avueRouter.group = item.group;\r\n this.$router.push({\r\n path: this.$router.$avueRouter.getPath({\r\n name: item[this.labelKey],\r\n src: item[this.pathKey]\r\n }),\r\n query: item.query\r\n }).catch(() => {});\r\n }\r\n }\r\n};\r\n</script>\r\n\r\n"],"sourceRoot":"src/page/index/sidebar"}]}