{"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\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\bizComponents\\control\\HtCheckbox.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\bizComponents\\control\\HtCheckbox.vue","mtime":1675071991194},{"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\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport _toConsumableArray from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.regexp.search\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\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 \"@/components/bizComponents/utils.js\";\nexport default {\n  name: \"ht-checkbox\",\n  props: [\"validate\", \"value\", \"name\", \"permission\", \"cklist\", \"linkage\", \"ganged\", \"styles\", \"isVertical\", \"tooltipplacement\"],\n  data: function data() {\n    return {\n      inputVal: [],\n      inputValnew: \"\",\n      options: [],\n      config: {}\n    };\n  },\n  watch: {\n    inputVal: function inputVal(newVal, oldVal) {\n      this.$emit(\"input\", newVal);\n    }\n  },\n  computed: {\n    inputWriteable: function inputWriteable() {\n      var getWriteable = utils.getWriteable(this.permission);\n\n      if (!utils.getWriteable(this.permission) && this.inputVal.length > 0 && this.inputValnew == \"\") {\n        var inputValArr = [];\n\n        for (var i = 0; i < this.inputVal.length; i++) {\n          for (var a = 0; a < this.options.length; a++) {\n            if (this.options[a].key == this.inputVal[i]) {\n              inputValArr.push(this.options[a].value);\n              break;\n            }\n          }\n        }\n\n        this.inputValnew = inputValArr.join(\",\");\n      }\n\n      return getWriteable;\n    },\n    inputValidate: function inputValidate() {\n      var validateObj = this.$store.state.index.validate;\n      return utils.addRequiredOrNot(this.permission, this.validate, validateObj, this);\n    },\n    inputName: function inputName() {\n      var labeldesc = \"\";\n\n      if (this.$slots && this.$slots.labeldesc && this.$slots.labeldesc[0].children && this.$slots.labeldesc[0].children[0].text) {\n        labeldesc = this.$slots.labeldesc[0].children[0].text;\n        return this.name ? this.name : utils.getName() + \"-\" + labeldesc;\n      } else {\n        return this.name ? this.name : utils.getName();\n      }\n    }\n  },\n  mounted: function mounted() {\n    var _me = this;\n\n    var exp = this.linkage;\n\n    if (exp && exp.length > 0 && (this.$parent.isView || this.$parent.$parent.$parent.isView)) {\n      var pInst = utils.getOnlineFormInstance(_me);\n      _me.traces = {};\n      exp.forEach(function (m) {\n        m.effect.forEach(function (m) {\n          var path = \"permission.fields.\".concat(m.target);\n          var oldVal = utils.getValueByPath(pInst, path);\n          _me.traces[path] = oldVal;\n        });\n\n        _me.$watch(\"inputVal\", function (newVal, oldVal) {\n          if (newVal !== oldVal) {\n            // m.effect.forEach(ef => {\n            //     const p = `permission.fields.${ef.target}`;\n            //     let val = _me.traces[p];\n            //     _me.$store.dispatch(\"index/delValidate\",ef);\n            //     utils.setValueByPath(pInst, p, val);\n            //   });\n            newVal.forEach(function (newValue) {\n              if (newValue === m.value) {\n                m.effect.forEach(function (ef) {\n                  var p = \"permission.fields.\".concat(ef.target);\n                  var val = _me.traces[p];\n\n                  _me.$store.dispatch(\"index/linkageValidate\", ef);\n\n                  utils.setValueByPath(pInst, p, ef.type);\n                });\n              }\n            });\n          }\n        }, {\n          immediate: true\n        });\n      });\n    }\n  },\n  created: function created() {\n    var _this2 = this;\n\n    this.options = this.cklist ? JSON.parse(this.cklist) : [];\n\n    if (this.ganged && this.ganged.alias && this.options.length < 1) {\n      this.$store.dispatch(\"bizForm/getByAliasCq\", this.ganged.alias).then(function (res) {\n        _this2.config = res;\n\n        _this2.search();\n      });\n    }\n\n    if (this.value && this.value.indexOf(\"[\") != -1) {\n      var checkboxval = this.value.substr(0, this.value.length - 1);\n      checkboxval = checkboxval.substr(1);\n      var checkboxval2 = checkboxval.split(\",\");\n      var checkvalnew = [];\n\n      for (var i = 0; i < checkboxval2.length; i++) {\n        checkvalnew.push(checkboxval2[i].trim());\n      }\n\n      this.inputVal = checkvalnew;\n    } else if (this.value) {\n      this.inputVal = _toConsumableArray(this.value);\n    }\n\n    this.$validator = this.$root.$validator;\n  },\n  methods: {\n    search: function search(currentPage, param) {\n      if (!this.config) return;\n      var str = this.config;\n\n      var _this = this;\n\n      var ganged = this.ganged;\n      this.pageSize = str.pageSize; // if(str.needPage === 1){\n\n      var pageBean = {\n        pageBean: {\n          page: currentPage ? currentPage : 1,\n          pageSize: str.pageSize,\n          showTotal: \"true\"\n        }\n      };\n\n      if (param) {\n        if (str.dsType == \"dataSource\") {\n          var Base64 = require('js-base64').Base64;\n\n          str.currentPage = currentPage ? currentPage : 1;\n\n          if (JSON.stringify(ganged.bind) === '{}') {\n            str.queryData = Base64.encode(JSON.stringify([{\n              \"key\": ganged.valueBind,\n              \"value\": param\n            }]));\n          } else {\n            var queryData = [];\n\n            for (var key in ganged.bind) {\n              if (ganged.bind[key]) {\n                var pInst = utils.getOnlineFormInstance(_this);\n                var val = utils.getValueByPath(pInst, ganged.bind[key]);\n\n                if (val) {\n                  queryData.push({\n                    \"key\": key,\n                    \"value\": val\n                  });\n                } else {\n                  queryData.push({\n                    \"key\": key,\n                    \"value\": param\n                  });\n                }\n              }\n            }\n\n            str.queryData = Base64.encode(JSON.stringify(queryData));\n          }\n        } else {\n          var templatePa = this.config.dataParam;\n\n          if (this.config.requestType == 'POST' && templatePa) {\n            var conditionfield = JSON.parse(str.conditionfield);\n            conditionfield.forEach(function (ele) {\n              var pInst = utils.getOnlineFormInstance(_this);\n              var val = utils.getValueByPath(pInst, ganged.bind[ele.field]);\n\n              if (val) {\n                templatePa = templatePa.replace(new RegExp(\"\\\\{\" + ele.field + \"\\\\}\", \"g\"), val);\n              } else {\n                templatePa = templatePa.replace(new RegExp(\"\\\\{\" + ele.field + \"\\\\}\", \"g\"), param);\n              }\n            });\n          } else {}\n\n          str.pageBean = utils.parseToJson(templatePa);\n        }\n      } else {\n        str.pageBean = pageBean;\n        str.currentPage = currentPage ? currentPage : 1;\n        str.queryData = \"\";\n      } //}\n\n\n      this.$store.dispatch(\"bizForm/selectQuery\", str).then(function (res) {\n        _this.total = res.total;\n        _this.options = [];\n        res.rows.forEach(function (m) {\n          var option = {};\n\n          if (_this.ganged.valueBind) {\n            option.value = m[ganged.valueBind];\n          }\n\n          if (_this.ganged.labelBind) {\n            option.key = m[ganged.labelBind];\n          }\n\n          _this.options.push(option);\n        });\n      });\n    }\n  }\n};",null]}