1 line
8.3 KiB
JSON
1 line
8.3 KiB
JSON
{"remainingRequest":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js!E:\\hz-zhhq-web\\src\\store\\modules\\tagsView.js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\store\\modules\\tagsView.js","mtime":1737610069397},{"path":"E:\\hz-zhhq-web\\babel.config.js","mtime":1737610069371},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _toConsumableArray2 = _interopRequireDefault(require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/toConsumableArray.js\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/slicedToArray.js\"));\nrequire(\"core-js/modules/web.dom.iterable\");\nvar _createForOfIteratorHelper2 = _interopRequireDefault(require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js\"));\nrequire(\"core-js/modules/es6.function.name\");\nrequire(\"core-js/modules/es7.array.includes\");\nrequire(\"core-js/modules/es6.string.includes\");\nvar state = {\n visitedViews: [],\n cachedViews: []\n};\nvar mutations = {\n ADD_VISITED_VIEW: function ADD_VISITED_VIEW(state, view) {\n if (state.visitedViews.some(function (v) {\n return v.path === view.path;\n })) return;\n state.visitedViews.push(Object.assign({}, view, {\n title: view.meta.title || 'no-name'\n }));\n },\n ADD_CACHED_VIEW: function ADD_CACHED_VIEW(state, view) {\n if (state.cachedViews.includes(view.name)) return;\n if (!view.meta.noCache) {\n state.cachedViews.push(view.name);\n }\n },\n DEL_VISITED_VIEW: function DEL_VISITED_VIEW(state, view) {\n var _iterator = (0, _createForOfIteratorHelper2.default)(state.visitedViews.entries()),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = (0, _slicedToArray2.default)(_step.value, 2),\n i = _step$value[0],\n v = _step$value[1];\n if (v.path === view.path) {\n state.visitedViews.splice(i, 1);\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n },\n DEL_CACHED_VIEW: function DEL_CACHED_VIEW(state, view) {\n var _iterator2 = (0, _createForOfIteratorHelper2.default)(state.cachedViews),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var i = _step2.value;\n if (i === view.name) {\n var index = state.cachedViews.indexOf(i);\n state.cachedViews.splice(index, 1);\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n },\n DEL_OTHERS_VISITED_VIEWS: function DEL_OTHERS_VISITED_VIEWS(state, view) {\n state.visitedViews = state.visitedViews.filter(function (v) {\n return v.meta.affix || v.path === view.path;\n });\n },\n DEL_OTHERS_CACHED_VIEWS: function DEL_OTHERS_CACHED_VIEWS(state, view) {\n var _iterator3 = (0, _createForOfIteratorHelper2.default)(state.cachedViews),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var i = _step3.value;\n if (i === view.name) {\n var index = state.cachedViews.indexOf(i);\n state.cachedViews = state.cachedViews.slice(index, index + 1);\n break;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n },\n DEL_ALL_VISITED_VIEWS: function DEL_ALL_VISITED_VIEWS(state) {\n // keep affix tags\n var affixTags = state.visitedViews.filter(function (tag) {\n return tag.meta.affix;\n });\n state.visitedViews = affixTags;\n },\n DEL_ALL_CACHED_VIEWS: function DEL_ALL_CACHED_VIEWS(state) {\n state.cachedViews = [];\n },\n UPDATE_VISITED_VIEW: function UPDATE_VISITED_VIEW(state, view) {\n var _iterator4 = (0, _createForOfIteratorHelper2.default)(state.visitedViews),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var v = _step4.value;\n if (v.path === view.path) {\n v = Object.assign(v, view);\n break;\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n }\n};\nvar actions = {\n addView: function addView(_ref, view) {\n var dispatch = _ref.dispatch;\n dispatch('addVisitedView', view);\n dispatch('addCachedView', view);\n },\n addVisitedView: function addVisitedView(_ref2, view) {\n var commit = _ref2.commit;\n commit('ADD_VISITED_VIEW', view);\n },\n addCachedView: function addCachedView(_ref3, view) {\n var commit = _ref3.commit;\n commit('ADD_CACHED_VIEW', view);\n },\n delView: function delView(_ref4, view) {\n var dispatch = _ref4.dispatch,\n state = _ref4.state;\n return new Promise(function (resolve) {\n dispatch('delVisitedView', view);\n dispatch('delCachedView', view);\n resolve({\n visitedViews: (0, _toConsumableArray2.default)(state.visitedViews),\n cachedViews: (0, _toConsumableArray2.default)(state.cachedViews)\n });\n });\n },\n delVisitedView: function delVisitedView(_ref5, view) {\n var commit = _ref5.commit,\n state = _ref5.state;\n return new Promise(function (resolve) {\n commit('DEL_VISITED_VIEW', view);\n resolve((0, _toConsumableArray2.default)(state.visitedViews));\n });\n },\n delCachedView: function delCachedView(_ref6, view) {\n var commit = _ref6.commit,\n state = _ref6.state;\n return new Promise(function (resolve) {\n commit('DEL_CACHED_VIEW', view);\n resolve((0, _toConsumableArray2.default)(state.cachedViews));\n });\n },\n delOthersViews: function delOthersViews(_ref7, view) {\n var dispatch = _ref7.dispatch,\n state = _ref7.state;\n return new Promise(function (resolve) {\n dispatch('delOthersVisitedViews', view);\n dispatch('delOthersCachedViews', view);\n resolve({\n visitedViews: (0, _toConsumableArray2.default)(state.visitedViews),\n cachedViews: (0, _toConsumableArray2.default)(state.cachedViews)\n });\n });\n },\n delOthersVisitedViews: function delOthersVisitedViews(_ref8, view) {\n var commit = _ref8.commit,\n state = _ref8.state;\n return new Promise(function (resolve) {\n commit('DEL_OTHERS_VISITED_VIEWS', view);\n resolve((0, _toConsumableArray2.default)(state.visitedViews));\n });\n },\n delOthersCachedViews: function delOthersCachedViews(_ref9, view) {\n var commit = _ref9.commit,\n state = _ref9.state;\n return new Promise(function (resolve) {\n commit('DEL_OTHERS_CACHED_VIEWS', view);\n resolve((0, _toConsumableArray2.default)(state.cachedViews));\n });\n },\n delAllViews: function delAllViews(_ref10, view) {\n var dispatch = _ref10.dispatch,\n state = _ref10.state;\n return new Promise(function (resolve) {\n dispatch('delAllVisitedViews', view);\n dispatch('delAllCachedViews', view);\n resolve({\n visitedViews: (0, _toConsumableArray2.default)(state.visitedViews),\n cachedViews: (0, _toConsumableArray2.default)(state.cachedViews)\n });\n });\n },\n delAllVisitedViews: function delAllVisitedViews(_ref11) {\n var commit = _ref11.commit,\n state = _ref11.state;\n return new Promise(function (resolve) {\n commit('DEL_ALL_VISITED_VIEWS');\n resolve((0, _toConsumableArray2.default)(state.visitedViews));\n });\n },\n delAllCachedViews: function delAllCachedViews(_ref12) {\n var commit = _ref12.commit,\n state = _ref12.state;\n return new Promise(function (resolve) {\n commit('DEL_ALL_CACHED_VIEWS');\n resolve((0, _toConsumableArray2.default)(state.cachedViews));\n });\n },\n updateVisitedView: function updateVisitedView(_ref13, view) {\n var commit = _ref13.commit;\n commit('UPDATE_VISITED_VIEW', view);\n }\n};\nvar _default = exports.default = {\n namespaced: true,\n state: state,\n mutations: mutations,\n actions: actions\n};",null]} |