{"remainingRequest":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\eipControl\\EipTreeselect.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\eipControl\\EipTreeselect.vue","mtime":1667804639118},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/cssc-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.regexp.search\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.regexp.split\";\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 hotentUtils from \"@/hotent-ui-util.js\";\nimport sub_pio_mixin from \"@/sub-permission-mixin.js\";\nimport req from \"@/request.js\";\nexport default {\n name: \"eip-treeselect\",\n props: [\"validate\", \"value\", \"name\", \"permission\", \"multiple\", \"selectlist\", \"ganged\", \"filterable\", \"allowCreate\", \"styles\", \"customQuery\"],\n mixins: [sub_pio_mixin],\n //混入方式引入表单组件中公共属性,处理子表、孙表行内联动(切面修改permission_sub_sub)\n data: function data() {\n return {\n config: {},\n total: 10,\n pageSize: 5,\n currentPage: 1,\n options: [],\n tempoptions: [],\n valueDesc: \"\",\n tagFormatValue: [],\n defaultProps: {\n children: \"children\",\n label: \"value\"\n },\n newValidate: null,\n curSubIndex: null\n };\n },\n watch: {\n valueDesc: function valueDesc(newVal, oldVal) {\n if (newVal && newVal != oldVal) {\n this.tagFormatValue = newVal.split(\",\");\n }\n }\n },\n computed: {\n inputVal: {\n get: function get() {\n if (this.multiple) {\n if (this.value) {\n if (this.$refs.treeselectElTree) {\n var checkedNodes = this.$refs.treeselectElTree.getCheckedNodes();\n\n var _iterator = _createForOfIteratorHelper(checkedNodes),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var data = _step.value;\n\n if (!this.value.split(\",\").includes(data.key)) {\n this.$refs.treeselectElTree.setChecked(data, false);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n return this.value.split(\",\");\n } else {\n if (this.$refs.treeselectElTree) {\n var _checkedNodes = this.$refs.treeselectElTree.getCheckedNodes();\n\n var _iterator2 = _createForOfIteratorHelper(_checkedNodes),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _data = _step2.value;\n this.$refs.treeselectElTree.setChecked(_data, false);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n return [];\n }\n } else if (this.value || this.value === 0) {\n return this.value + \"\";\n } else {\n return this.value;\n }\n },\n set: function set(val) {\n if (this.multiple) {\n this.$emit(\"input\", val.join(\",\"));\n } else {\n this.$emit(\"input\", val);\n\n if (!this.multiple && val) {\n //判断对话框是否绑定了关联查询\n if (this.customQuery && this.customQuery.custQueryJson && this.customQuery.custQueryJson.length > 0) {\n var custQueryJson = this.customQuery.custQueryJson;\n\n for (var i = 0; i < custQueryJson.length; i++) {\n if (custQueryJson[i].conditionfield.length > 0) {\n this.doQuery(custQueryJson[i]);\n } else {\n console.error(\"[\" + custQueryJson[i].comment + \"]关联查询取值参数未绑定表单字段\");\n }\n }\n }\n }\n }\n }\n },\n inputWriteable: function inputWriteable() {\n return utils.getWriteable(this.permission_sub);\n },\n inputValidate: function inputValidate() {\n if (this.newValidate) {\n return this.newValidate;\n }\n\n var validateObj = this.$store.state.index.validate;\n return utils.addRequiredOrNot(this.permission_sub, 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 this.options = this.selectlist ? this.selectlist : [];\n\n var _me = this;\n\n var _hotentUtils$getSubSc = hotentUtils.getSubScopeElAndIndex(_me.$el),\n subScopeEl = _hotentUtils$getSubSc.subScopeEl;\n\n if (subScopeEl) {\n this.curSubIndex = subScopeEl.dataset[\"index\"];\n }\n\n var ganged = this.ganged; //判断是否有参数绑定\n\n if (ganged && ganged.bind && JSON.stringify(ganged.bind) != \"{}\" && this.config) {\n var bind = ganged.bind;\n var formVm = utils.getOnlineFormInstance(_me);\n\n for (var key in bind) {\n var paramDom = null;\n\n if (this.curSubIndex == null) {\n paramDom = document.querySelector('[model-name=\"' + bind[key] + '\"]');\n } else {\n var subFiledName = bind[key].split(\".\")[3];\n paramDom = subScopeEl.querySelector('[model-name=\"item.' + subFiledName + '\"]');\n }\n\n if (paramDom && paramDom.__vue__) {\n paramDom.__vue__.$watch(\"value\", function (newVal, oldVal) {\n if (newVal != oldVal) {\n _me.search(false, newVal, true);\n }\n });\n }\n }\n }\n },\n created: function created() {\n this.options = this.selectlist ? this.selectlist : []; //动态传入\n\n if (this.ganged && this.ganged.alias && this.options.length < 1 && this.ganged) {\n var this_ = this;\n this_.$store.dispatch(\"form/getByAliasCq\", this_.ganged.alias).then(function (res) {\n this_.config = res;\n var objIsEmpty = this_.objIsEmpty(this_.ganged.bind);\n\n if (this_.ganged && !objIsEmpty) {\n this_.handelInitGangedsearch();\n } else {\n this_.search(false, \"\");\n }\n });\n }\n\n this.$validator = this.$root.$validator;\n },\n methods: {\n //判断对象里面的值是否为空\n objIsEmpty: function objIsEmpty(obj) {\n for (var key in obj) {\n if (obj[key]) {\n return false;\n }\n }\n\n return true;\n },\n doQuery: function () {\n var _doQuery = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(param) {\n var paramLoadData, pInst, i, bindVal, obj, queryUrl, requestMethod;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n paramLoadData = [];\n pInst = utils.getOnlineFormInstance(this); //获取关联查询绑定的表单参数\n\n for (i = 0; i < param.conditionfield.length; i++) {\n if (param.conditionfield[i].fieldPath != \"\") {\n bindVal = utils.getValueByPath(pInst, param.conditionfield[i].fieldPath, null);\n obj = {\n key: param.conditionfield[i].field,\n value: bindVal\n };\n paramLoadData.push(obj);\n }\n }\n\n queryUrl = param.dsType == \"dataSource\" ? \"${form}/form/customQuery/v1/doQuery?alias=\" + param.alias + \"&page=1\" : param.url;\n requestMethod = \"POST\"; //如果关联数据列表查询数据不是数据源则请求方法为restful配置的请求方式\n\n if (param.dsType != 'dataSource') {\n requestMethod = param.requestType;\n } //查询数据\n\n\n req.request({\n url: queryUrl,\n method: requestMethod,\n data: paramLoadData\n }).then(function (res) {\n //判断是否有关联查询数据返回\n if (res.data.rows.length > 0) {\n //获取关联查询返回的表单参数\n for (var _i = 0; _i < param.resultfield.length; _i++) {\n if (param.resultfield[_i].fieldPath != \"\") {\n var val = \"\";\n\n for (var j = 0; j < res.data.rows.length; j++) {\n if (res.data.rows[j][param.resultfield[_i].comment]) {\n val = val + res.data.rows[j][param.resultfield[_i].comment] + \",\";\n }\n }\n\n val = val.substring(0, val.length - 1); //赋值给绑定的字段\n\n utils.setValueByPath(pInst, param.resultfield[_i].fieldPath, val, null);\n }\n }\n } else {\n //获取关联查询返回的表单参数\n for (var _i2 = 0; _i2 < param.resultfield.length; _i2++) {\n if (param.resultfield[_i2].fieldPath != \"\") {\n //赋值给绑定的字段\n utils.setValueByPath(pInst, param.resultfield[_i2].fieldPath, \"\", null);\n }\n }\n }\n });\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function doQuery(_x) {\n return _doQuery.apply(this, arguments);\n }\n\n return doQuery;\n }(),\n handelInitGangedsearch: function handelInitGangedsearch() {\n var _me = this;\n\n var _hotentUtils$getSubSc2 = hotentUtils.getSubScopeElAndIndex(_me.$el),\n subScopeEl = _hotentUtils$getSubSc2.subScopeEl;\n\n if (subScopeEl) {\n this.curSubIndex = subScopeEl.dataset[\"index\"];\n }\n\n var ganged = this.ganged; //判断是否有参数绑定\n\n if (ganged && JSON.stringify(ganged.bind) != \"{}\" && this.config) {\n var bind = ganged.bind;\n var formVm = utils.getOnlineFormInstance(_me);\n\n if (this.curSubIndex == null) {\n for (var key in bind) {\n var pInst = utils.getOnlineFormInstance(_me);\n var val = utils.getValueByPath(pInst, bind[key]);\n\n _me.search(false, val);\n }\n } else {\n for (var key in bind) {\n var subFiledName = bind[key].split(\".\")[3];\n var paramDom = subScopeEl.querySelector('[model-name=\"item.' + subFiledName + '\"]');\n\n if (paramDom && paramDom.__vue__ && paramDom.__vue__.value) {\n var newVal = paramDom.__vue__.value + \"\";\n\n _me.search(false, newVal);\n }\n }\n }\n }\n },\n clear: function clear() {\n if (this.multiple) {\n this.tempoptions = [];\n this.$nextTick(function () {\n this.$refs.treeselectElTree.setCheckedKeys([], true);\n });\n } else {\n this.$refs.treeselectElTree.setCurrentNode({});\n }\n },\n clickNative: function clickNative() {\n var _this2 = this;\n\n //动态传入\n if (this.ganged && this.ganged.alias && this.options.length < 1) {\n this.$store.dispatch(\"form/getByAliasCq\", this.ganged.alias).then(function (res) {\n _this2.config = res;\n\n _this2.search();\n });\n }\n },\n selectBlur: function selectBlur(val) {\n this.search();\n },\n handleCheckChange: function handleCheckChange(data) {\n if (this.multiple) {\n var checkedNodes = this.$refs.treeselectElTree.getCheckedNodes();\n var modelValue = [];\n this.tempoptions = checkedNodes;\n\n var _iterator3 = _createForOfIteratorHelper(checkedNodes),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _data2 = _step3.value;\n modelValue.push(_data2.key);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n this.$emit(\"input\", modelValue.join(\",\"));\n }\n },\n handleNodeClick: function handleNodeClick(data) {\n var _this3 = this;\n\n this.$refs.treeselectElTree.setChecked(data, true);\n\n if (!this.multiple) {\n this.$emit(\"input\", data.key);\n\n if (data.key) {\n //判断对话框是否绑定了关联查询\n if (this.customQuery && this.customQuery.custQueryJson && this.customQuery.custQueryJson.length > 0) {\n var custQueryJson = this.customQuery.custQueryJson;\n\n for (var i = 0; i < custQueryJson.length; i++) {\n if (custQueryJson[i].conditionfield.length > 0) {\n this.doQuery(custQueryJson[i]);\n } else {\n console.error(\"[\" + custQueryJson[i].comment + \"]关联查询取值参数未绑定表单字段\");\n }\n }\n }\n }\n\n this.$refs.treeselect.blur();\n setTimeout(function () {\n _this3.$validator.validate();\n });\n } else if (this.multiple) {\n var checkedNodes = this.$refs.treeselectElTree.getCheckedNodes();\n var modelValue = [];\n this.tempoptions = checkedNodes;\n\n var _iterator4 = _createForOfIteratorHelper(checkedNodes),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var _data3 = _step4.value;\n modelValue.push(_data3.key);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n this.$emit(\"input\", modelValue.join(\",\"));\n }\n },\n filterNode: function filterNode(value, data) {\n if (!value) return true;\n return data.value.indexOf(value) !== -1;\n },\n filterMethod: function filterMethod(query) {\n this.$refs.treeselectElTree.filter(query);\n },\n remoteMethod: function remoteMethod(val) {\n if (val) {\n this.search(false, val);\n } else {\n this.param = \"\";\n this.search();\n }\n },\n handleCurrentChange: function handleCurrentChange(currentPage) {\n this.currentPage = currentPage;\n this.search(currentPage);\n },\n search: function search(currentPage, param, gangedChange) {\n var _this4 = this;\n\n this.options = [];\n\n if (gangedChange) {\n this.$emit(\"input\", \"\");\n }\n\n var objIsEmpty = this.objIsEmpty(this.ganged.bind);\n if (!this.config || this.ganged.bind && !objIsEmpty && !param) 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 var pInst = utils.getOnlineFormInstance(_this);\n var val = utils.getValueByPath(pInst, ganged.bind[key], this.curSubIndex);\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 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(\"form/selectQuery\", str).then(function (res) {\n if (_this4.config && _this4.config.dsType === \"restful\") {\n _this.options = res.rows; //tree数组转list\n\n _this4.addSelectList(_this.options); //处理只读回填显示\n\n\n if (_this.inputVal && _this.inputVal.constructor == Array && _this.inputVal.length > 0) {\n for (var i = 0; i < _this.inputVal.length; i++) {\n _this4.findDesc(_this.options, _this.inputVal[i]);\n } //默认选中树节点\n\n\n if (_this4.inputWriteable) {\n _this4.$refs.treeselectElTree.setCheckedKeys(_this.inputVal);\n }\n } else {\n _this4.findDesc(_this.options, _this.inputVal);\n }\n\n if (_this4.valueDesc != \"\") {\n _this4.valueDesc = _this4.valueDesc.substring(0, _this4.valueDesc.length - 1);\n }\n\n return;\n }\n\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.key = m[ganged.valueBind] + \"\";\n }\n\n if (_this.ganged.labelBind) {\n option.value = m[ganged.labelBind];\n }\n\n _this.options.push(option);\n }); //tree数组转list\n\n _this4.addSelectList(_this.options);\n\n if (_this.inputVal && _this.inputVal.constructor == Array && _this.inputVal.length > 0) {\n for (var j = 0; j < _this.inputVal.length; j++) {\n _this4.findDesc(_this.options, _this.inputVal[j]);\n } //默认选中树节点\n\n\n _this4.$nextTick(function () {\n _this.$refs.treeselectElTree && _this.$refs.treeselectElTree.setCheckedKeys(_this.inputVal);\n });\n } else {\n _this4.findDesc(_this.options, _this.inputVal);\n }\n\n if (_this4.valueDesc != \"\") {\n _this4.valueDesc = _this4.valueDesc.substring(0, _this4.valueDesc.length - 1);\n }\n });\n },\n findDesc: function findDesc(list, key) {\n if (list && list.length > 0) {\n for (var i = 0; i < list.length; i++) {\n if (list[i].key == key) {\n this.valueDesc += list[i].value + \",\";\n return;\n }\n\n if (list[i].children) {\n this.findDesc(list[i].children, key);\n }\n }\n }\n },\n addSelectList: function addSelectList(list) {\n var _this5 = this;\n\n if (list && list.length > 0) {\n list.forEach(function (l) {\n _this5.tempoptions.push(l);\n\n if (l.children) {\n _this5.addSelectList(l.children);\n }\n });\n }\n }\n }\n};",null]}