434e169b044c12170acf257d7014e62c.json 7.3 KB

1
  1. {"remainingRequest":"D:\\jiayue\\pig-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jiayue\\pig-ui\\src\\page\\index\\sidebar\\sidebarItem.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jiayue\\pig-ui\\src\\page\\index\\sidebar\\sidebarItem.vue","mtime":1619070292874},{"path":"D:\\jiayue\\pig-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jiayue\\pig-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jiayue\\pig-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jiayue\\pig-ui\\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\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",{"version":3,"sources":["sidebarItem.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"sidebarItem.vue","sourceRoot":"src/page/index/sidebar","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"]}]}