{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\eipControl\\EipInput.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\eipControl\\EipInput.vue","mtime":1667327529247},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\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\r\nimport utils from \"@/utils.js\";\r\nimport FormMath from \"@/math.js\";\r\nimport sub_pio_mixin from \"@/sub-permission-mixin.js\";\r\nimport { Message } from \"element-ui\";\r\n\r\nexport default {\r\n  name: \"eip-input\",\r\n  props: [\r\n    \"readonly\",\r\n    \"validate\",\r\n    \"value\",\r\n    \"name\",\r\n    \"modelExpression\",\r\n    \"permission\",\r\n    \"mathExp\",\r\n    \"atter\",\r\n    \"type\",\r\n    \"dateCalcExp\",\r\n    \"configAttributes\",\r\n    \"placeholder\",\r\n    \"precision\",\r\n    \"stepStrictly\",\r\n    \"min\",\r\n    \"max\",\r\n    \"filterthousandBit\",\r\n    \"filtercurrency\",\r\n    \"step\",\r\n    \"bindPreAndSufFixjson\",\r\n    \"company\",\r\n  ],\r\n  mixins: [sub_pio_mixin],//混入方式引入表单组件中公共属性，处理子表、孙表行内联动（切面修改permission）\r\n  data() {\r\n    return {\r\n      style_width: \"width:100%\",\r\n      width: \"100%\",\r\n      unwatchAry: [],\r\n      isEdit: true,\r\n      showViewe: \"\",\r\n      thousandBit: \"0\",\r\n      format: \"\",\r\n      isShow: true,\r\n      identityMap: {},\r\n      newValidate: null,\r\n      bindPreAndSufFix: null,\r\n      numberPrefix: false,\r\n    };\r\n  },\r\n  computed: {\r\n    inputVal: {\r\n      get() {\r\n        return this.value;\r\n      },\r\n      set(val) {\r\n        this.$emit(\"input\", val);\r\n      },\r\n    },\r\n    inputName: function() {\r\n      let labeldesc = \"\";\r\n      if (\r\n        this.$slots &&\r\n        this.$slots.labeldesc &&\r\n        this.$slots.labeldesc[0].children &&\r\n        this.$slots.labeldesc[0].children[0].text\r\n      ) {\r\n        labeldesc = this.$slots.labeldesc[0].children[0].text;\r\n        return this.name ? this.name : utils.getName() + \"-\" + labeldesc;\r\n      } else {\r\n        return this.name ? this.name : utils.getName();\r\n      }\r\n    },\r\n    inputValidate: function() {\r\n      if (this.newValidate) {\r\n        return this.newValidate;\r\n      }\r\n      return this.validate;\r\n    },\r\n  },\r\n  async mounted() {\r\n    const _me = this;\r\n    this.permission_sub = _.cloneDeep(this.permission);\r\n    const pInst = utils.getOnlineFormInstance(_me);\r\n    this.checkIdentity();\r\n    // //检查流水号\r\n    // if (this.configAttributes) {\r\n    //   this.isEdit = !this.configAttributes.isInputEdit;\r\n    //   //判断是否绑定流水号\r\n    //   if (this.configAttributes.bindIdentityAlias) {\r\n    //     this.isEdit = false;\r\n    //     if (this.value) return;\r\n    //     var alias = this.configAttributes.bindIdentityAlias;\r\n    //     const res = await this.$store.dispatch(\"menu/getNextIdByAlias\", alias);\r\n    //     if (res.state) {\r\n    //       this.$emit(\"input\", res.value);\r\n    //       if (res.value) {\r\n    //         var match = /(\\{(.*)\\}).*$/.exec(res.value);\r\n    //         //判断流水号中是否表达式如{kjbt.csfjsc}\r\n    //         if (match) {\r\n    //           this.$emit(\"input\", res.value.replace(match[1], \"\"));\r\n\r\n    //           let paramDom = document.querySelector(\r\n    //             '[model-name=\"data.' + match[2] + '\"]'\r\n    //           );\r\n    //           let _me = this;\r\n    //           if (paramDom && paramDom.__vue__) {\r\n    //             paramDom.__vue__.$watch(\r\n    //               \"value\",\r\n    //               function(newVal, oldVal) {\r\n    //                 if (\r\n    //                   _me.modelExpression == paramDom.__vue__.modelExpression\r\n    //                 ) {\r\n    //                   Message.error(\"流水号生成规则字段不能绑定流水号显示字段\");\r\n    //                   return;\r\n    //                 }\r\n    //                 if (newVal != oldVal) {\r\n    //                   _me.$emit(\"input\", res.value.replace(match[1], newVal));\r\n    //                 }\r\n    //               },\r\n    //               { immediate: true }\r\n    //             );\r\n    //           }\r\n    //         }\r\n    //       }\r\n    //     } else {\r\n    //       //Message.error(res.message);\r\n    //     }\r\n    //   }\r\n    // }\r\n    // _me.$watch(\"inputVal\", function(newVal, oldVal) {\r\n    //   pInst.$watch(\r\n    //     \"identityMap\",\r\n    //     function(newVal, oldVal) {\r\n    //       if (newVal && newVal !== oldVal) {\r\n    //         for (const key in newVal) {\r\n    //           if (_me.atter == key) {\r\n    //             let item = newVal[key];\r\n    //             utils.setValueByPath(\r\n    //               pInst,\r\n    //               item.key,\r\n    //               item.value.replace(item.expression, _me.value)\r\n    //             );\r\n    //           }\r\n    //         }\r\n    //       }\r\n    //     },\r\n    //     { immediate: true }\r\n    //   );\r\n    // });\r\n    if (this.filtercurrency && (!isNaN(this.inputVal) && this.inputVal)) {\r\n      this.format = FormMath.convertCurrency(this.inputVal);\r\n    }\r\n    if (this.filterthousandBit && (!isNaN(this.inputVal) && this.inputVal)) {\r\n      this.format = this.format + \"   \" + utils.thousandBit(this.inputVal);\r\n    }\r\n    if (this.bindPreAndSufFixjson) {\r\n      this.bindPreAndSufFix = JSON.parse(this.bindPreAndSufFixjson);\r\n    }\r\n    this.numberPrefix = false;\r\n    if (\r\n      (this.type == \"number\" &&\r\n        this.bindPreAndSufFix &&\r\n        this.bindPreAndSufFix.preFix) ||\r\n      this.bindPreAndSufFix.preFix\r\n    ) {\r\n      this.numberPrefix = true;\r\n    }\r\n  },\r\n  methods: {\r\n    readonlyFormat(val) {\r\n      //暂无表达式 如有表达式使用  eval(val) 并且控件配置项要把表达式构建传递到eipInput\r\n      if (this.bindPreAndSufFix) {\r\n        if (!this.bindPreAndSufFix.preFix) {\r\n          this.bindPreAndSufFix.preFix = \"\";\r\n        }\r\n        if (!this.bindPreAndSufFix.sufSix) {\r\n          this.bindPreAndSufFix.sufSix = \"\";\r\n        }\r\n        if (this.value) {\r\n          return (\r\n            this.bindPreAndSufFix.preFix +\r\n            this.value +\r\n            this.bindPreAndSufFix.sufSix\r\n          );\r\n        }\r\n      } else if (this.company) {\r\n        return this.value + this.company;\r\n      }\r\n    },\r\n    numberBlur() {\r\n      if (this.filtercurrency && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.isShow = false;\r\n        this.showViewe = FormMath.convertCurrency(this.inputVal);\r\n      }\r\n      if (this.filterthousandBit && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.thousandBit = utils.thousandBit(this.inputVal);\r\n      }\r\n    },\r\n    numberFocus() {\r\n      if (this.filtercurrency && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.isShow = true;\r\n        this.showViewe = \"\";\r\n      }\r\n      if (this.filterthousandBit && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.thousandBit = \"0\";\r\n      }\r\n    },\r\n    convertCurrency: _.debounce(function() {\r\n      if (this.filtercurrency && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.isShow = false;\r\n        this.showViewe = FormMath.convertCurrency(this.inputVal);\r\n      }\r\n    }, 1000),\r\n    convertThousanBit: _.debounce(function() {\r\n      if (this.filterthousandBit && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.thousandBit = utils.thousandBit(this.inputVal);\r\n      }\r\n    }, 1000),\r\n    numberChange() {\r\n      if (this.filtercurrency && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.convertCurrency();\r\n      }\r\n      if (this.filterthousandBit && (!isNaN(this.inputVal) && this.inputVal)) {\r\n        this.convertThousanBit();\r\n      }\r\n    },\r\n    //数据报表\r\n    async checkIdentity(){\r\n      //检查流水号\r\n      if (this.configAttributes) {\r\n        this.isEdit = !this.configAttributes.isInputEdit;\r\n        //判断是否绑定流水号\r\n        if (this.configAttributes.bindIdentityAlias) {\r\n          this.isEdit = false;\r\n          if (this.value) return;\r\n          var alias = this.configAttributes.bindIdentityAlias;\r\n          const res = await this.$store.dispatch(\"menu/getNextIdByAlias\", alias);\r\n          if (res.state) {\r\n            this.$emit(\"input\", res.value);\r\n            if (res.value) {\r\n              var match = /(\\{(.*)\\}).*$/.exec(res.value);\r\n              //判断流水号中是否表达式如{kjbt.csfjsc}\r\n              if (match) {\r\n                this.$emit(\"input\", res.value.replace(match[1], \"\"));\r\n\r\n                let paramDom = document.querySelector(\r\n                  '[model-name=\"data.' + match[2] + '\"]'\r\n                );\r\n                let _me = this;\r\n                if (paramDom && paramDom.__vue__) {\r\n                  paramDom.__vue__.$watch(\r\n                    \"value\",\r\n                    function(newVal, oldVal) {\r\n                      if (\r\n                        _me.modelExpression == paramDom.__vue__.modelExpression\r\n                      ) {\r\n                        Message.error(\"流水号生成规则字段不能绑定流水号显示字段\");\r\n                        return;\r\n                      }\r\n                      if (newVal != oldVal) {\r\n                        _me.$emit(\"input\", res.value.replace(match[1], newVal));\r\n                      }\r\n                    },\r\n                    { immediate: true }\r\n                  );\r\n                }\r\n              }\r\n            }\r\n          } else {\r\n            //Message.error(res.message);\r\n          }\r\n        }\r\n      }\r\n    }\r\n\r\n\r\n  },\r\n  beforeDestroy() {},\r\n  destroyed() {},\r\n  created() {\r\n    if (\r\n      this.bindPreAndSufFixjson !=\"{}\" &&\r\n      (JSON.parse(this.bindPreAndSufFixjson).preFix != \"\" ||\r\n      JSON.parse(this.bindPreAndSufFixjson).sufSix != \"\")\r\n    ) {\r\n      if (this.type == \"number\") {\r\n        this.style_width = \"width:57%\";\r\n      } else {\r\n        this.style_width = \"width:87%\";\r\n      }\r\n    }\r\n    if (this.type == \"number\" && this.permission_sub == \"r\") {\r\n      this.style_width = \"\";\r\n    }\r\n    this.$validator = this.$root.$validator;\r\n  },\r\n  watch: {\r\n    value(newValue, oldValue) {\r\n      this.checkIdentity();\r\n    }\r\n  },\r\n};\r\n",null]}