{"remainingRequest":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\artfess-module\\src\\components\\HtUserSelector.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\artfess-module\\src\\components\\HtUserSelector.vue","mtime":1675232038590},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\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//\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 utils from \"@/utils.js\";\nimport HtFieldTail from \"@/components/HtFieldTail.vue\";\nimport Selector from \"@/components/common/Selector.vue\";\nimport { setTimeout } from \"timers\";\nexport default {\n  name: \"ht-user-selector\",\n  props: {\n    demensions: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    orgs: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    loadOrgTree: {\n      type: Function\n    },\n    roles: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    loadRoleTree: {\n      type: Function\n    },\n    validate: [String, Object],\n    value: String,\n    name: String,\n    placeholder: {\n      type: String,\n      default: \"请输入内容\"\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    single: {\n      type: Boolean,\n      default: false\n    },\n    roleTreeSupportFilter: {\n      type: Boolean,\n      default: false\n    },\n    config: Object,\n    data: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    tableColumns: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    pagination: {\n      type: Object,\n      default: function _default() {\n        return {\n          page: 1,\n          pageSize: 50,\n          total: 0\n        };\n      }\n    },\n    selectLabel: {\n      type: String,\n      default: \"fullname\"\n    },\n    defaultDemension: {\n      type: [String, Number],\n      default: \"\"\n    },\n    quickSearchProps: {\n      type: String,\n      required: true\n    },\n    nodeKey: {\n      type: String,\n      default: \"id\"\n    },\n    defaultExpandedKeys: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    appendToBody: {\n      type: Boolean,\n      default: false\n    }\n  },\n  components: {\n    HtFieldTail: HtFieldTail,\n    Selector: Selector\n  },\n  data: function data() {\n    return {\n      el_aside_w: \"210px\",\n      inputName: null,\n      writeable: true,\n      inputSuffixHeight: 30,\n      selectors: [],\n      dialogVisible: false,\n      currentDemension: null,\n      activeName: \"org\",\n      primaryField: this.selectLabel\n    };\n  },\n  computed: {\n    inputWriteable: function inputWriteable() {\n      return this.writeable ? utils.getWriteable(this.permission) : this.writeable;\n    },\n    inputValidate: function inputValidate() {\n      return utils.addRequiredOrNot(this.permission, this.validate, this);\n    }\n  },\n  watch: {\n    // 当所选择的数据发生变化时，同步到v-model中\n    selectors: function selectors(newVal) {\n      var _this = this;\n\n      var ary = [],\n          idAry = [],\n          fullnameAry = [],\n          mobileAry = [],\n          emailAry = [],\n          postNameAry = [],\n          orgNameAry = [],\n          accountAry = [];\n\n      if (newVal && newVal.constructor === Array && newVal.length > 0) {\n        newVal.forEach(function (m) {\n          ary.push(m.fullname);\n\n          if (m.hasOwnProperty(\"id\")) {\n            idAry.push(m.id);\n          }\n\n          if (m.hasOwnProperty(\"fullname\")) {\n            fullnameAry.push(m.fullname);\n          }\n\n          if (m.hasOwnProperty(\"account\")) {\n            accountAry.push(m.account);\n          }\n\n          if (m.hasOwnProperty(\"mobile\")) {\n            mobileAry.push(m.mobile);\n          }\n\n          if (m.hasOwnProperty(\"email\")) {\n            emailAry.push(m.email);\n          }\n\n          if (m.hasOwnProperty(\"postName\")) {\n            postNameAry.push(m.postName);\n          }\n\n          if (m.hasOwnProperty(\"orgName\")) {\n            orgNameAry.push(m.orgName);\n          }\n        });\n      }\n\n      if (this.config) {\n        // 配置了id的绑定关系，则回填到指定属性上\n        if (this.config.hasOwnProperty(\"id\")) {\n          utils.setValueByConfigKey(this, this.config, \"id\", idAry.join(\",\"));\n          this.primaryField = \"id\";\n        } // 配置了fullname的绑定关系，则回填到指定的属性上\n\n\n        if (this.config.hasOwnProperty(\"fullname\")) {\n          utils.setValueByConfigKey(this, this.config, \"fullname\", fullnameAry.join(\",\"));\n        } // 配置了account的绑定关系，则回填到指定的属性上\n\n\n        if (this.config.hasOwnProperty(\"account\")) {\n          utils.setValueByConfigKey(this, this.config, \"account\", accountAry.join(\",\"));\n          this.primaryField = this.primaryField == \"id\" ? \"id\" : \"account\";\n        } // 配置了mobile的绑定关系，则回填到指定的属性上\n\n\n        if (this.config.hasOwnProperty(\"mobile\")) {\n          utils.setValueByConfigKey(this, this.config, \"mobile\", mobileAry.join(\",\"));\n        } // 配置了email的绑定关系，则回填到指定的属性上\n\n\n        if (this.config.hasOwnProperty(\"email\")) {\n          utils.setValueByConfigKey(this, this.config, \"email\", emailAry.join(\",\"));\n        } // 配置了post绑定关系，则回填到指定的属性上\n\n\n        if (this.config.hasOwnProperty(\"postName\")) {\n          utils.setValueByConfigKey(this, this.config, \"postName\", postNameAry.join(\",\"));\n        } // 配置了org绑定关系，则回填到指定的属性上\n\n\n        if (this.config.hasOwnProperty(\"orgName\")) {\n          utils.setValueByConfigKey(this, this.config, \"orgName\", orgNameAry.join(\",\"));\n        }\n      } // 通过valueChange事件发布值变更消息\n\n\n      setTimeout(function () {\n        _this.$emit(\"valueChange\", ary.join(\",\"));\n\n        _this.calacInputSuffixHeight();\n\n        if (_this.$refs.inputEl) {\n          _this.$refs.inputEl.focus();\n\n          _this.$refs.inputEl.blur();\n        }\n      }, 10);\n    },\n    value: function value(newVal) {\n      // 父级传递进来的value发生变更时，需要同步到当前所选数据中\n      this.valueInit();\n    },\n    defaultDemension: function defaultDemension(newVal, oldVal) {\n      if (newVal && newVal != oldVal) {\n        this.currentDemension = newVal;\n        this.changeDemension();\n      }\n    }\n  },\n  mounted: function mounted() {\n    // 组件第一次挂载时，同步value到当前所选数据中\n    this.valueInit();\n  },\n  created: function created() {\n    this.inputName = this.name ? this.name : utils.getName();\n    this.$validator = this.$root.$validator;\n\n    if (this.$smallScreenDialog) {\n      this.el_aside_w = \"180px\";\n    }\n  },\n  methods: {\n    // 同步value到当前所选数据中\n    valueInit: function valueInit() {\n      var tmpAry = [];\n\n      if (this.value) {\n        var idAry = [],\n            accountAry = [],\n            fullnameAry = [],\n            mobileAry = [],\n            postNameAry = [],\n            orgNameAry = [],\n            emailAry = [];\n\n        if (this.config) {\n          // 配置了id绑定关系，则获取id的值\n          if (this.config.hasOwnProperty(\"id\")) {\n            var idVal = utils.getValueByConfigKey(this, this.config, \"id\");\n\n            if (idVal) {\n              idAry = idVal.split(\",\").trim();\n            }\n          } // 配置了fullname绑定关系，则获取fullname的值\n\n\n          if (this.config.hasOwnProperty(\"fullname\")) {\n            var fullnameVal = utils.getValueByConfigKey(this, this.config, \"fullname\");\n\n            if (fullnameVal) {\n              fullnameAry = fullnameVal.split(\",\").trim();\n            }\n          } // 配置了account绑定关系，则获取account的值\n\n\n          if (this.config.hasOwnProperty(\"account\")) {\n            var accountVal = utils.getValueByConfigKey(this, this.config, \"account\");\n\n            if (accountVal) {\n              accountAry = accountVal.split(\",\").trim();\n            }\n          } // 配置了mobile绑定关系，则获取mobile的值\n\n\n          if (this.config.hasOwnProperty(\"mobile\")) {\n            var mobileVal = utils.getValueByConfigKey(this, this.config, \"mobile\");\n\n            if (mobileVal) {\n              mobileAry = mobileVal.split(\",\").trim();\n            }\n          } // 配置了post绑定关系，则获取post的值\n\n\n          if (this.config.hasOwnProperty(\"postName\")) {\n            var postVal = utils.getValueByConfigKey(this, this.config, \"postName\");\n\n            if (postVal) {\n              postNameAry = postVal.split(\",\").trim();\n            }\n          } // 配置了org绑定关系，则获取org的值\n\n\n          if (this.config.hasOwnProperty(\"orgName\")) {\n            var orgVal = utils.getValueByConfigKey(this, this.config, \"orgName\");\n\n            if (orgVal) {\n              orgNameAry = orgVal.split(\",\").trim();\n            }\n          } // 配置了email绑定关系，则获取email的值\n\n\n          if (this.config.hasOwnProperty(\"email\")) {\n            var emailVal = utils.getValueByConfigKey(this, this.config, \"email\");\n\n            if (emailVal) {\n              emailAry = emailVal.split(\",\").trim();\n            }\n          }\n        } // 将fullname、id、code从逗号分割的字符串解析为json对象格式的数组\n\n\n        var valAry = this.value.split(\",\").trim();\n        valAry.forEach(function (m, index) {\n          var item = {\n            fullname: m\n          };\n\n          if (idAry.length > index) {\n            item[\"id\"] = idAry[index];\n          }\n\n          if (accountAry.length > index) {\n            item[\"account\"] = accountAry[index];\n          }\n\n          if (fullnameAry.length > index) {\n            item[\"fullname\"] = fullnameAry[index];\n          }\n\n          if (mobileAry.length > index) {\n            item[\"mobile\"] = mobileAry[index];\n          }\n\n          if (emailAry.length > index) {\n            item[\"email\"] = emailAry[index];\n          }\n\n          if (postNameAry.length > index) {\n            item[\"postName\"] = postNameAry[index];\n          }\n\n          if (orgNameAry.length > index) {\n            item[\"orgName\"] = orgNameAry[index];\n          }\n\n          tmpAry.push(item);\n        });\n      } // 对数组做深度对比，如果值不完全相等，则进行赋值操作\n\n\n      if (!utils.arrayEquals(tmpAry, this.selectors)) {\n        this.selectors = tmpAry;\n      }\n    },\n    showDialog: function showDialog() {\n      var _this2 = this;\n\n      if (!this.inputWriteable) {\n        return;\n      }\n\n      this.loadDemensions();\n      this.dialogVisible = true;\n      setTimeout(function () {\n        _this2.$refs.selector.onShow();\n      });\n    },\n    handleClose: function handleClose(done) {\n      this.$refs.selector.onHide();\n      done && done();\n    },\n    handleDialogSure: function handleDialogSure() {\n      this.dialogVisible = false;\n      this.$refs.selector.onHide(true);\n    },\n    handleDialogCancel: function handleDialogCancel() {\n      this.dialogVisible = false;\n      this.$refs.selector.onHide();\n    },\n    handleRemove: function handleRemove(item) {\n      this.selectors.remove(item);\n    },\n    clear: function clear() {\n      this.selectors = [];\n    },\n    // 更新当前输入框的高度来适配已选数据的高度\n    calacInputSuffixHeight: function calacInputSuffixHeight() {\n      if (!this.$refs.tagSpans) return;\n\n      if (this.$refs.tagSpans.offsetHeight) {\n        this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5;\n      } else {\n        this.inputSuffixHeight = 30;\n      }\n    },\n    load: function load(param, cb) {\n      this.$emit(\"load\", param, cb);\n    },\n    changeDemension: function changeDemension() {\n      this.$emit(\"changeDemension\", this.currentDemension);\n    },\n    handleNodeClick: function handleNodeClick(data) {\n      this.$emit(\"loadOrgUser\", data);\n    },\n    handleRoleNodeClick: function handleRoleNodeClick(data) {\n      this.$emit(\"loadRoleUser\", data);\n    },\n    loadDemensions: function loadDemensions() {\n      this.$emit(\"loadDemensions\");\n    }\n  }\n};",null]}