{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\components\\dict\\DictSelect.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\dict\\DictSelect.vue","mtime":1675214576839},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _toConsumableArray from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.number.constructor\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport dictUtils from \"./DictSelectUtils\";\nexport default {\n  name: 'DictSelect',\n  props: {\n    hiddenValue: String,\n    filterable: {\n      type: Boolean,\n      default: false\n    },\n    multiple: {\n      type: Boolean,\n      default: false\n    },\n    dictCode: String,\n    placeholder: String,\n    triggerChange: Boolean,\n    disabled: Boolean,\n    value: [String, Number, Array],\n    type: String,\n    dictCodeName: Array,\n    isShowInbody: {\n      type: Boolean,\n      default: false\n    },\n    needLabel: Boolean,\n    // 将值和文本都返回\n    hasDefaultOption: {\n      type: Boolean,\n      default: false\n    },\n    // 请选择的默认项,\n    validate: [String, Object],\n    clearable: Boolean,\n    size: String,\n    readonly: {\n      type: Boolean,\n      default: false\n    },\n    permission: {\n      type: String,\n      default: 'w',\n      validator: function validator(value) {\n        return ['b', 'w', 'r', 'n'].indexOf(value) !== -1;\n      }\n    }\n  },\n  data: function data() {\n    return {\n      dictOptions: [],\n      tagType: ''\n    };\n  },\n  watch: {\n    dictCode: {\n      immediate: true,\n      handler: function handler() {\n        this.initDictData();\n      }\n    }\n  },\n  created: function created() {\n    if (!this.type || this.type === 'list') {\n      this.tagType = 'select';\n    } else {\n      this.tagType = this.type;\n    }\n  },\n  computed: {\n    getValue: function getValue() {\n      // debugger    \n      if (this.type != 'cascader') {\n        return this.value != null ? this.value.toString() : null;\n      } else {\n        return this.value;\n      }\n    }\n  },\n  methods: {\n    focus: function focus() {\n      this.$refs.selectDict.focus();\n    },\n    reloadDict: function reloadDict() {\n      this.initDictData();\n    },\n    initDictData: function initDictData() {\n      var _this = this;\n\n      if (dictUtils.getDictItemsFromCache(this.dictCode)) {\n        var dictItems = dictUtils.getDictItemsFromCache(this.dictCode);\n\n        if (this.hiddenValue) {\n          var arr = [];\n          dictItems.forEach(function (item) {\n            if (item.value !== _this.hiddenValue) {\n              arr.push(item);\n            }\n\n            _this.dictOptions = arr;\n          });\n        } else if (this.type == 'cascader') {\n          // 级联\n          this.dictOptions = this.formatDictOptions(dictItems, this.dictCodeName[0]);\n        } else {\n          this.dictOptions = dictItems;\n\n          if (this.hasDefaultOption && this.tagType == 'select') {\n            this.dictOptions.unshift({\n              value: '请选择',\n              key: undefined\n            });\n          }\n        }\n      }\n    },\n    // 如果是级联字典,处理字典数据结构\n    formatDictOptions: function formatDictOptions(options, dictName) {\n      var _this2 = this;\n\n      var tempOpt = _toConsumableArray(options);\n\n      tempOpt.forEach(function (item) {\n        if (item.lowerDic && item.lowerDic[dictName]) {\n          item.children = item.lowerDic[dictName];\n\n          _this2.formatDictOptions(item.children, _this2.dictCodeName[1]);\n        }\n      }); // console.log(tempOpt, \"tempOpt\");\n\n      return tempOpt;\n    },\n    handleInput: function handleInput(val, selectObj) {\n      this.$emit('input', val, selectObj);\n      this.$emit('select', val, selectObj);\n    },\n    setCurrentDictOptions: function setCurrentDictOptions(dictOptions) {\n      this.dictOptions = dictOptions;\n    },\n    getCurrentDictOptions: function getCurrentDictOptions() {\n      return this.dictOptions;\n    }\n  }\n};",null]}