{"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\\HtInput.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\artfess-module\\src\\components\\HtInput.vue","mtime":1675232038574},{"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.function.name\";\nimport \"core-js/modules/es6.array.find\";\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//\nimport utils from \"@/utils.js\";\nimport FormMath from \"@/math.js\";\nimport HtFieldTail from \"@/components/HtFieldTail.vue\";\nexport default {\n  name: \"ht-input\",\n  props: {\n    validate: [String, Object],\n    value: [String, Number],\n    format: [String, Number],\n    name: String,\n    size: {\n      type: String,\n      default: \"small\"\n    },\n    controlsPosition: {\n      type: String,\n      default: \"right\"\n    },\n    width: [String, Number],\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    clearable: {\n      type: Boolean,\n      default: true\n    },\n    showPassword: {\n      type: Boolean,\n      default: false\n    },\n    mathExp: String,\n    type: {\n      type: String,\n      default: \"text\"\n    },\n    dateCalcExp: Object,\n    placeholder: {\n      type: String,\n      default: \"请输入内容\"\n    },\n    readonly: {\n      type: Boolean,\n      default: false\n    },\n    disabled: {\n      type: Boolean,\n      default: false\n    },\n    min: Number,\n    max: Number,\n    step: {\n      type: Number,\n      default: 1\n    },\n    stepStrictly: {\n      type: Boolean,\n      default: false\n    },\n    precision: Number,\n    cols: {\n      type: Number,\n      default: 60\n    },\n    rows: {\n      type: Number,\n      default: 2\n    },\n    autosize: {\n      type: [Boolean, Object],\n      default: false\n    },\n    prefixIcon: String,\n    suffixIcon: String,\n    tabindex: String,\n    modelExpression: {\n      type: String,\n      default: \"\"\n    },\n    minlength: {\n      type: Number\n    },\n    maxlength: {\n      type: Number\n    },\n    showWordLimit: {\n      type: Boolean,\n      default: false\n    },\n    readonlyFormat: {\n      type: Function\n    }\n  },\n  components: {\n    HtFieldTail: HtFieldTail\n  },\n  data: function data() {\n    return {\n      unwatchAry: [],\n      inputName: null,\n      writeable: true,\n      newValidate: null\n    };\n  },\n  computed: {\n    inputVal: {\n      get: function get() {\n        if (!utils.isEmpty(this.format) && !this.inputWriteable) {\n          return this.format;\n        }\n\n        if (this.readonlyFormat && !this.inputWriteable) {\n          var resultVal = this.readonlyFormat(this.value);\n\n          if (!utils.isEmpty(resultVal)) {\n            return resultVal;\n          }\n        }\n\n        if (utils.isEmpty(this.value)) {\n          return \"\";\n        }\n\n        return this.value;\n      },\n      set: function set(val) {\n        this.$emit(\"input\", val);\n      }\n    },\n    colsVal: function colsVal() {\n      return this.type == \"textarea\" ? this.cols : null;\n    },\n    rowsVal: function rowsVal() {\n      return this.type == \"textarea\" ? this.rows : null;\n    },\n    inputWriteable: function inputWriteable() {\n      return this.writeable ? utils.getWriteable(this.permission) : this.writeable;\n    },\n    inputValidate: function inputValidate() {\n      if (this.newValidate) {\n        return this.newValidate;\n      }\n\n      return utils.addRequiredOrNot(this.permission, this.validate, this);\n    },\n    inputWidth: function inputWidth() {\n      return this.width ? typeof this.width == \"string\" ? {\n        width: this.width\n      } : {\n        width: \"\".concat(this.width, \"px\")\n      } : null;\n    }\n  },\n  mounted: function mounted() {\n    var _me = this;\n\n    var exp = this.mathExp;\n    var formVm = utils.getOnlineFormInstance(_me); // 数学运算表达式\n\n    if (exp) {\n      var elAttr = this.$vnode.data.model.expression;\n\n      if (this.modelExpression) {\n        elAttr = this.modelExpression;\n      }\n\n      var fields = FormMath.parseFuncexpField(exp);\n      formVm.$on(elAttr, function (args) {\n        if (args.hasOwnProperty(\"index\")) {\n          var _utils$getSubScopeElA = utils.getSubScopeElAndIndex(_me.$el),\n              subScopeEl = _utils$getSubScopeElA.subScopeEl,\n              index = _utils$getSubScopeElA.index;\n\n          if (subScopeEl != null && index === null) {\n            throw \"要计算子表行数据的输入框不在包含data-subname属性的元素中.\";\n          }\n\n          if (index == args.index) {\n            _me.$emit(\"input\", args.result);\n          }\n        } else {\n          _me.$emit(\"input\", args.result);\n        }\n      });\n      fields.forEach(function (ele) {\n        if (formVm.watchMap.has(ele)) {\n          var ary = formVm.watchMap.get(ele);\n          ary.push({\n            target: elAttr,\n            exp: exp\n          });\n          formVm.watchMap.set(ele, ary.unique(\"target\"));\n        } else {\n          formVm.watchMap.set(ele, [{\n            target: elAttr,\n            exp: exp\n          }]);\n        }\n      });\n    } // 日期计算表达式\n\n\n    if (this.dateCalcExp) {\n      // 计算日期间隔\n      var handleDateCalc = function handleDateCalc(startVal, endVal) {\n        _me.$emit(\"input\", utils.dateCalc(startVal, endVal, _me.dateCalcExp.diffType));\n      }; // 获取是否在子表中每一行进行日期计算\n\n\n      var _utils$getSubScopeElA2 = utils.getSubScopeElAndIndex(_me.$el),\n          subScopeEl = _utils$getSubScopeElA2.subScopeEl,\n          index = _utils$getSubScopeElA2.index;\n\n      if (subScopeEl) {\n        var startScope = utils.getSubInputScopeByModelExpression(subScopeEl, this.dateCalcExp.start);\n        var endScope = utils.getSubInputScopeByModelExpression(subScopeEl, this.dateCalcExp.end); // 对于子表中某行的日期计算，需要找到日期控件对应的vm实例\n\n        startScope.$watch(\"inputVal\", function (newVal, oldVal) {\n          if (newVal !== oldVal) {\n            handleDateCalc(startScope.value, endScope.value);\n          }\n        }, {\n          immediate: true\n        });\n        endScope.$watch(\"inputVal\", function (newVal, oldVal) {\n          if (newVal !== oldVal) {\n            handleDateCalc(startScope.value, endScope.value);\n          }\n        }, {\n          immediate: true\n        });\n      } else {\n        var cb = function cb(newVal, oldVal) {\n          if (newVal !== oldVal) {\n            var startVal = utils.getValueByPath(formVm, _me.dateCalcExp.start, index);\n            var endVal = utils.getValueByPath(formVm, _me.dateCalcExp.end, index);\n            handleDateCalc(startVal, endVal);\n          }\n        }; // 主表中的日期计算，在表单上通过v-model的表达式来监控值变更\n\n\n        formVm.$watch(this.dateCalcExp.start, cb, {\n          immediate: true\n        });\n        formVm.$watch(this.dateCalcExp.end, cb, {\n          immediate: true\n        });\n      }\n    }\n  },\n  beforeDestroy: function beforeDestroy() {\n    var that = this;\n\n    var watcher = that._watchers.find(function (m) {\n      return m.expression == \"inputVal\";\n    });\n\n    if (watcher && watcher.cb) {\n      // 单行文本销毁时，触发一次change事件，更新计算公式\n      watcher.cb(\"0\", that.inputVal, true);\n    }\n  },\n  destroyed: function destroyed() {\n    this.unwatchAry && this.unwatchAry.forEach(function (unwatch) {\n      unwatch.call();\n    });\n  },\n  created: function created() {\n    this.inputName = this.name ? this.name : utils.getName();\n    this.$validator = this.$root.$validator;\n  },\n  methods: {\n    handleBlur: function handleBlur(event) {\n      this.$emit(\"blur\", event);\n    },\n    handleFocus: function handleFocus(event) {\n      this.$emit(\"focus\", event);\n    },\n    handleChange: function handleChange(val) {\n      this.$emit(\"change\", val);\n    },\n    handleInput: function handleInput(val) {\n      this.$emit(\"input\", val);\n    },\n    handleClear: function handleClear() {\n      this.$emit(\"clear\");\n    }\n  }\n};",null]}