1 line
6.0 KiB
JSON
1 line
6.0 KiB
JSON
|
|
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\components\\HeaderSearch\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\components\\HeaderSearch\\index.vue","mtime":1732871026472},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\babel.config.js","mtime":1732871025888},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nrequire(\"core-js/modules/es6.regexp.search\");\nvar _toConsumableArray2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/toConsumableArray.js\"));\nvar _createForOfIteratorHelper2 = _interopRequireDefault(require(\"D:/data/hanguodoushan/acs2/nladmin-ui/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js\"));\nvar _fuse = _interopRequireDefault(require(\"fuse.js\"));\nvar _path = _interopRequireDefault(require(\"path\"));\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n// fuse is a lightweight fuzzy-search module\n// make search results more in line with expectations\nvar _default = exports.default = {\n name: 'HeaderSearch',\n data: function data() {\n return {\n search: '',\n options: [],\n searchPool: [],\n show: false,\n fuse: undefined\n };\n },\n computed: {\n routes: function routes() {\n return this.$store.state.permission.routers;\n }\n },\n watch: {\n routes: function routes() {\n this.searchPool = this.generateRoutes(this.routes);\n },\n searchPool: function searchPool(list) {\n this.initFuse(list);\n },\n show: function show(value) {\n if (value) {\n document.body.addEventListener('click', this.close);\n } else {\n document.body.removeEventListener('click', this.close);\n }\n }\n },\n mounted: function mounted() {\n this.searchPool = this.generateRoutes(this.routes);\n },\n methods: {\n click: function click() {\n this.show = !this.show;\n if (this.show) {\n this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus();\n }\n },\n close: function close() {\n this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur();\n this.options = [];\n this.show = false;\n },\n change: function change(val) {\n var _this = this;\n if (this.ishttp(val.path)) {\n // http(s):// 路径新窗口打开\n window.open(val.path, '_blank');\n } else {\n this.$router.push(val.path);\n }\n this.search = '';\n this.options = [];\n this.$nextTick(function () {\n _this.show = false;\n });\n },\n initFuse: function initFuse(list) {\n this.fuse = new _fuse.default(list, {\n shouldSort: true,\n threshold: 0.4,\n location: 0,\n distance: 100,\n maxPatternLength: 32,\n minMatchCharLength: 1,\n keys: [{\n name: 'title',\n weight: 0.7\n }, {\n name: 'path',\n weight: 0.3\n }]\n });\n },\n // Filter out t
|