e54df8bd1d6c12cca35719cd0946d6f6.json 6.5 KB

1
  1. {"remainingRequest":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/src/layout/components/Sidebar/SidebarItem.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/src/layout/components/Sidebar/SidebarItem.vue","mtime":1708395041882},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/cache-loader/dist/cjs.js","mtime":1708395146433},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/babel-loader/lib/index.js","mtime":1708395147257},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/cache-loader/dist/cjs.js","mtime":1708395146433},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/index.js","mtime":1708395147382}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KDQppbXBvcnQgcGF0aCBmcm9tICdwYXRoJw0KaW1wb3J0IHsgaXNFeHRlcm5hbCB9IGZyb20gJ0AvdXRpbHMvdmFsaWRhdGUnDQppbXBvcnQgSXRlbSBmcm9tICcuL0l0ZW0nDQppbXBvcnQgQXBwTGluayBmcm9tICcuL0xpbmsnDQppbXBvcnQgRml4aU9TQnVnIGZyb20gJy4vRml4aU9TQnVnJw0KDQpleHBvcnQgZGVmYXVsdCB7DQogIG5hbWU6ICdTaWRlYmFySXRlbScsDQogIGNvbXBvbmVudHM6IHsgSXRlbSwgQXBwTGluayB9LA0KICBtaXhpbnM6IFtGaXhpT1NCdWddLA0KICBwcm9wczogew0KICAgIC8vIHJvdXRlIG9iamVjd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sZCA9IHsgLi4uIHBhcmVudCwgcGF0aDogJycsIG5vU2hvd2luZ0NoaWxkcmVuOiB0cnVlIH0NCiAgICAgICAgcmV0dXJuIHRydWUNCiAgICAgIH0NCg0KICAgICAgcmV0dXJuIGZhbHNlDQogICAgfSwNCiAgICByZXNvbHZlUGF0aChyb3V0ZVBhdGgpIHsNCiAgICAgIGlmIChpc0V4dGVybmFsKHJvdXRlUGF0aCkpIHsNCiAgICAgICAgcmV0dXJuIHJvdXRlUGF0aA0KICAgICAgfQ0KICAgICAgaWYgKGlzRXh0ZXJuYWwodGhpcy5iYXNlUGF0aCkpIHsNCiAgICAgICAgcmV0dXJuIHRoaXMuYmFzZVBhdGgNCiAgICAgIH0NCiAgICAgIHJldHVybiBwYXRoLnJlc29sdmUodGhpcy5iYXNlUGF0aCwgcm91dGVQYXRoKQ0KICAgIH0NCiAgfQ0KfQ0K"},{"version":3,"sources":["SidebarItem.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"SidebarItem.vue","sourceRoot":"src/layout/components/Sidebar","sourcesContent":["<template>\r\n <div v-if=\"!item.hidden\">\r\n <template v-if=\"hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow\">\r\n <app-link v-if=\"onlyOneChild.meta\" :to=\"resolvePath(onlyOneChild.path)\">\r\n <el-menu-item :index=\"resolvePath(onlyOneChild.path)\" :class=\"{'submenu-title-noDropdown':!isNest}\"> \r\n <!-- <item :icon=\"onlyOneChild.meta.icon||(item.meta&&item.meta.icon)\" :title=\"onlyOneChild.meta.title\" /> -->\r\n <item :icon=\"onlyOneChild.meta.icon||(item.meta&&item.meta.icon)\" :title=\"onlyOneChild.meta.title\" />\r\n </el-menu-item>\r\n </app-link>\r\n </template>\r\n\r\n <el-submenu v-else ref=\"subMenu\" :index=\"resolvePath(item.path)\" popper-append-to-body>\r\n <template slot=\"title\">\r\n <!-- <item v-if=\"item.meta\" :icon=\"item.meta && item.meta.icon\" :title=\"item.meta.title\" /> -->\r\n <item v-if=\"item.meta\" :icon=\"item.meta && item.meta.icon\" :title=\"item.meta.title\" />\r\n </template>\r\n <sidebar-item\r\n v-for=\"child in item.children\"\r\n :key=\"child.path\"\r\n :is-nest=\"true\"\r\n :item=\"child\"\r\n :base-path=\"resolvePath(child.path)\"\r\n class=\"nest-menu\"\r\n />\r\n </el-submenu>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport path from 'path'\r\nimport { isExternal } from '@/utils/validate'\r\nimport Item from './Item'\r\nimport AppLink from './Link'\r\nimport FixiOSBug from './FixiOSBug'\r\n\r\nexport default {\r\n name: 'SidebarItem',\r\n components: { Item, AppLink },\r\n mixins: [FixiOSBug],\r\n props: {\r\n // route object\r\n item: {\r\n type: Object,\r\n required: true\r\n },\r\n isNest: {\r\n type: Boolean,\r\n default: false\r\n },\r\n basePath: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n data() {\r\n this.onlyOneChild = null\r\n return {}\r\n },\r\n methods: {\r\n hasOneShowingChild(children = [], parent) {\r\n const showingChildren = children.filter(item => {\r\n if (item.hidden) {\r\n return false\r\n } else {\r\n this.onlyOneChild = item\r\n return true\r\n }\r\n })\r\n\r\n // When there is only one child router, the child router is displayed by default\r\n if (showingChildren.length === 1) {\r\n return true\r\n }\r\n\r\n // Show parent if there are no child router to display\r\n if (showingChildren.length === 0) {\r\n this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }\r\n return true\r\n }\r\n\r\n return false\r\n },\r\n resolvePath(routePath) {\r\n if (isExternal(routePath)) {\r\n return routePath\r\n }\r\n if (isExternal(this.basePath)) {\r\n return this.basePath\r\n }\r\n return path.resolve(this.basePath, routePath)\r\n }\r\n }\r\n}\r\n</script>\r\n"]}]}