{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\jenkins\\workspace\\xypm-web-prod\\src\\components\\dict\\DictSelectUtils.js","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\src\\components\\dict\\DictSelectUtils.js","mtime":1667333350024},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\babel.config.js","mtime":1667333346259},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\eslint-loader\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/xypm-web-prod/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xypm-web-prod/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.split\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n/**\r\n * 字典 util\r\n */\n\n/**\r\n * 获取字典数组\r\n * @param dictCode 字典Code\r\n * @return List\r\n */\nfunction getDictItemsFromCache(dictCode) {\n if (!dictCode) {\n return '字典Code不能为空!';\n }\n if (sessionStorage.getItem('dict_data')) {\n var dict_data = JSON.parse(sessionStorage.getItem('dict_data'));\n if (dict_data[dictCode]) {\n var distItem = dict_data[dictCode];\n // // 格式使用hotent的,key 是值 value 是显示值\n // distItem.forEach(item=>{\n // item.key = item.value\n // item.value = item.name\n // })\n return distItem;\n }\n }\n}\n/**\r\n * 字典值替换文本通用方法\r\n * @param dictOptions 字典数组\r\n * @param text 字典值\r\n * @return String\r\n */\nfunction filterDictText(dictOptions, text) {\n // --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---\n if (text != null && dictOptions instanceof Array) {\n var result = [];\n // 允许多个逗号分隔\n var splitText = text.toString().trim().split(',');\n var _iterator = _createForOfIteratorHelper(splitText),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var txt = _step.value;\n var dictText = txt;\n var _iterator2 = _createForOfIteratorHelper(dictOptions),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var dictItem = _step2.value;\n if (txt === dictItem.value.toString()) {\n dictText = dictItem.text;\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n result.push(dictText);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return result.join(',');\n }\n return text;\n // --update-end----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---\n}\n\n/**\r\n * 字典值替换文本通用方法(多选)\r\n * @param dictOptions 字典数组\r\n * @param text 字典值\r\n * @return String\r\n */\nfunction filterMultiDictText(dictOptions, text) {\n //js “!text” 认为0为空,所以做提前处理\n if (text === 0 || text === '0') {\n if (dictOptions) {\n var _iterator3 = _createForOfIteratorHelper(dictOptions),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var dictItem = _step3.value;\n if (text == dictItem.value) {\n return dictItem.text;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }\n if (!text || text == 'null' || !dictOptions || dictOptions.length == 0) {\n return \"\";\n }\n var re = \"\";\n text = text.toString();\n var arr = text.split(\",\");\n dictOptions.forEach(function (option) {\n if (option) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === option.value) {\n re += option.text + \",\";\n break;\n }\n }\n }\n });\n if (re == \"\") {\n return text;\n }\n return re.substring(0, re.length - 1);\n}\n\n/**\r\n * 翻译字段值对应的文本\r\n * @param children\r\n * @returns string\r\n */\nfunction filterDictTextByCache(dictCode, key) {\n if (key == null || key.length == 0) {\n return;\n }\n if (!dictCode) {\n return '字典Code不能为空!';\n }\n //优先从缓存中读取字典配置\n if (this.getDictItemsFromCache(dictCode)) {\n var item = this.getDictItemsFromCache(dictCode).filter(function (t) {\n return t[\"value\"] == key;\n });\n if (item && item.length > 0) {\n return item[0][\"text\"];\n }\n }\n}\n\n/** 通过code获取字典数组 */\nfunction getDictItems(_x, _x2) {\n return _getDictItems.apply(this, arguments);\n}\nfunction _getDictItems() {\n _getDictItems = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dictCode, params) {\n var desformDictItems;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!this.getDictItemsFromCache(dictCode)) {\n _context.next = 3;\n break;\n }\n desformDictItems = this.getDictItemsFromCache(dictCode).map(function (item) {\n return _objectSpread(_objectSpread({}, item), {}, {\n label: item.text\n });\n });\n return _context.abrupt(\"return\", desformDictItems);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n return _getDictItems.apply(this, arguments);\n}\nexport default {\n getDictItemsFromCache: getDictItemsFromCache,\n filterDictText: filterDictText,\n filterMultiDictText: filterMultiDictText,\n filterDictTextByCache: filterDictTextByCache,\n getDictItems: getDictItems\n};",null]}