{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\dict\\DictSelectUtils.js","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\dict\\DictSelectUtils.js","mtime":1675071991756},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\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/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.split\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { 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 = o[Symbol.iterator](); }, 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; } } }; }\n\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); }\n\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\n/**\r\n * 字典 util\r\n */\n\n/**\r\n * 获取字典数组\r\n * @param dictCode 字典Code\r\n * @return List<Map>\r\n */\nfunction getDictItemsFromCache(dictCode) {\n  if (!dictCode) {\n    return '字典Code不能为空!';\n  }\n\n  if (sessionStorage.getItem('dict_data')) {\n    var dict_data = JSON.parse(sessionStorage.getItem('dict_data'));\n\n    if (dict_data[dictCode]) {\n      var distItem = dict_data[dictCode]; // // 格式使用hotent的，key 是值  value 是显示值\n      // distItem.forEach(item=>{\n      //     item.key = item.value\n      //     item.value = item.name\n      // })\n\n      return distItem;\n    }\n  }\n}\n/**\r\n * 字典值替换文本通用方法\r\n * @param dictOptions  字典数组\r\n * @param text  字典值\r\n * @return String\r\n */\n\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\n    var _iterator = _createForOfIteratorHelper(splitText),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var txt = _step.value;\n        var dictText = txt;\n\n        var _iterator2 = _createForOfIteratorHelper(dictOptions),\n            _step2;\n\n        try {\n          for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n            var dictItem = _step2.value;\n\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\n        result.push(dictText);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n\n    return result.join(',');\n  }\n\n  return text; // --update-end----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---\n}\n/**\r\n * 字典值替换文本通用方法(多选)\r\n * @param dictOptions  字典数组\r\n * @param text  字典值\r\n * @return String\r\n */\n\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\n      try {\n        for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n          var dictItem = _step3.value;\n\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\n  if (!text || text == 'null' || !dictOptions || dictOptions.length == 0) {\n    return \"\";\n  }\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\n  if (re == \"\") {\n    return text;\n  }\n\n  return re.substring(0, re.length - 1);\n}\n/**\r\n * 翻译字段值对应的文本\r\n * @param children\r\n * @returns string\r\n */\n\n\nfunction filterDictTextByCache(dictCode, key) {\n  if (key == null || key.length == 0) {\n    return;\n  }\n\n  if (!dictCode) {\n    return '字典Code不能为空!';\n  } //优先从缓存中读取字典配置\n\n\n  if (this.getDictItemsFromCache(dictCode)) {\n    var item = this.getDictItemsFromCache(dictCode).filter(function (t) {\n      return t[\"value\"] == key;\n    });\n\n    if (item && item.length > 0) {\n      return item[0][\"text\"];\n    }\n  }\n}\n/** 通过code获取字典数组 */\n\n\nfunction getDictItems(_x, _x2) {\n  return _getDictItems.apply(this, arguments);\n}\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) {\n        switch (_context.prev = _context.next) {\n          case 0:\n            if (!this.getDictItemsFromCache(dictCode)) {\n              _context.next = 3;\n              break;\n            }\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\n          case 3:\n          case \"end\":\n            return _context.stop();\n        }\n      }\n    }, _callee, this);\n  }));\n  return _getDictItems.apply(this, arguments);\n}\n\nexport default {\n  getDictItemsFromCache: getDictItemsFromCache,\n  filterDictText: filterDictText,\n  filterMultiDictText: filterMultiDictText,\n  filterDictTextByCache: filterDictTextByCache,\n  getDictItems: getDictItems\n};",null]}