{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\components\\eipControl\\EipSubDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\components\\eipControl\\EipSubDialog.vue","mtime":1667280203998},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.constructor\";\nimport _toConsumableArray from \"D:/jenkins/workspace/examine-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"D:/jenkins/workspace/examine-fvue/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/examine-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/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.split\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { mapState } from \"vuex\";\nimport utils from \"@/utils.js\";\nimport hotentUiUtils from \"@/hotent-ui-util.js\";\nimport { Message } from \"element-ui\";\nimport req from \"@/request.js\";\nimport sub_pio_mixin from \"@/sub-permission-mixin.js\";\nimport EipTag from \"@/components/eipControl/EipTag.vue\";\nimport EipSelectDia from \"@/components/eipControl/EipSelectDia.vue\";\nexport default {\n components: {\n EipTag: EipTag,\n EipSelectDia: EipSelectDia\n },\n name: \"eip-dialog\",\n props: [\"validate\", \"value\", \"name\", \"permission\", \"atter\", \"single\", \"selectorconfig\", \"custdialog\", \"placeholder\", \"tooltipplacement\", 'initFillData', 'initFillDataType', 'relation', 'maxRow'],\n mixins: [sub_pio_mixin],\n //混入方式引入表单组件中公共属性,处理子表、孙表行内联动(切面修改permission_sub)\n data: function data() {\n return {\n data: {\n qxdd: {}\n },\n inputSuffixWidth: 0,\n placeholderBo: \"\",\n quickSearch: \"\",\n //填写提示\n conditionBind: [],\n //参数查询字段\n nodeKey: \"ID_\",\n //树形数据父Id\n customDialogShowList: false,\n customDialogShowTree: false,\n selectOrgProps: {\n label: \"name\"\n },\n style: \"\",\n //对话框宽高\n selectOrgs: null,\n inputSuffixHeight: 33,\n config: null,\n updating: false,\n displayfield: [],\n //显示字段\n customDialog: {},\n queryParam: \"\",\n //查询条件输入的值\n props1: [],\n showData: [],\n checkBoxDataAll: [],\n //选中对象的集合\n defaultProps: {\n children: \"children\",\n label: \"label\"\n },\n propsData: [],\n querysShow: false,\n //是否显示搜索框\n undefineda: \"\",\n isCurrentChange: false,\n //是否不执行 orgTableSelection方法\n pagination: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n param: [],\n //绑定的表单字段\n treeList: [],\n displayField: {},\n queryParams: [],\n placeholders: [],\n oldselectOrgs: [],\n combinationTreeData: [],\n combiTreeDisplayField: [],\n combinationTreeQuerys: [],\n combinationRule: {},\n toggleBtn: \"el-icon-arrow-left\",\n treeShow: true,\n transtionWidth: \"25%\",\n leftTreeTitle: \"\",\n writeable: true,\n isShow: true\n };\n },\n watch: {\n props1: function props1(newVal, oldVal) {\n //树形\n if (this.showData != undefined && this.showData.length > 0) {\n var this_ = this;\n var data = [];\n\n for (var i = 0; i < this.showData.length; i++) {\n data.push(this.showData[i]);\n }\n\n setTimeout(function () {\n for (var _i = 0; _i < data.length; _i++) {\n this_.$refs.tree.setChecked(data[_i], true);\n this_.checkNode(data[_i], this_);\n }\n }, 200);\n }\n }\n },\n mounted: function mounted() {\n var requestType = window.location.href.split('?')[0].split('/');\n var isDoneList = window.location.href.split('/');\n\n if (requestType[requestType.length - 1] == 'get' || requestType[requestType.length - 2] == 'get' || isDoneList[isDoneList.length - 1] == 'doneList') {\n this.isShow = false;\n } else {\n if (this.initFillData == 'true') {\n this.initTemplateData();\n }\n }\n },\n computed: mapState({\n total: function total(state) {\n return state.dialog.total;\n },\n dialogData: function dialogData(state) {\n return state.dialog.rows;\n },\n inputVal: function inputVal() {\n if (!this.value || this.value == \"||[]\") {\n this.checkBoxDataAll = []; // this.showData = [];\n\n return null;\n } else {\n var nameAry = this.value.split(\",\");\n\n if (this.value.indexOf(\"||\") > 0) {\n nameAry = this.value.split(\"||\")[0].split(\",\"); // this.showData=JSON.parse(this.value.split(\"||\")[1]);\n } // this.showData =this.selectOrgs;\n\n\n var idAry = null;\n var accountAry = null;\n var result = [];\n nameAry.forEach(function (m, i) {\n var n = {\n value: m\n };\n result.push(n);\n });\n return result;\n }\n },\n inputWriteable: function inputWriteable() {\n return this.writeable ? utils.getWriteable(this.permission_sub) : this.writeable;\n },\n inputValidate: function inputValidate() {\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 bindSet: function bindSet() {\n return this.selectorconfig ? this.selectorconfig.bind : null;\n }\n }),\n created: function created() {\n if (!this.placeholder) {\n this.placeholderBo = \"请选择内容\";\n } else {\n this.placeholderBo = this.placeholder;\n }\n\n this.$validator = this.$root.$validator;\n },\n methods: {\n selectAll: function selectAll(selection) {\n if (this.oldselectOrgs != null && selection.length > 0) {\n for (var x = 0; x < selection.length; x++) {\n if (this.indexArray(this.oldselectOrgs, selection[x]) === -1) {\n this.oldselectOrgs.push(selection[x]);\n }\n }\n\n this.selectOrgs = _.cloneDeep(this.oldselectOrgs);\n } else {\n this.selectOrgs = _.cloneDeep(selection);\n }\n },\n checkNode: function checkNode(data, this_, pnode) {\n if (data.Pid) {\n var node = this_.$refs.tree.getNode(data.Pid);\n node.indeterminate = true;\n\n if (node.data.Pid) {\n this_.$refs.tree.getNode(node.data.Pid).indeterminate = true;\n this.checkNode(this_.$refs.tree.getNode(node.data.Pid).data, this_, this_.$refs.tree.getNode(node.data.Pid));\n }\n\n if (!node.indeterminate) {\n node.indeterminate = true;\n }\n } else if (pnode && !pnode.indeterminate) {\n pnode.indeterminate = true;\n }\n },\n //回车查询\n searchEnterFun: function searchEnterFun(e) {\n var keyCode = window.event ? e.keyCode : e.which;\n\n if (keyCode == 13) {\n this.search();\n }\n },\n handleSizeChange: function handleSizeChange(size) {\n this.isCurrentChange = true; //每页下拉显示数据\n\n this.pagination.pageSize = size;\n this.search();\n },\n handleCurrentChange: function handleCurrentChange(currentPage) {\n var this_ = this;\n\n if (this.selectOrgs != undefined && this.selectOrgs.length > 0) {\n this.selectOrgs.forEach(function (row) {\n var res = this_.indexArray(this_.checkBoxDataAll, row);\n\n if (res == -1) {\n this_.checkBoxDataAll.push(row);\n }\n });\n }\n\n this.isCurrentChange = true; //点击第几页\n\n this.pagination.page = currentPage;\n this.search();\n },\n checkList: function checkList() {\n var this_ = this;\n setTimeout(function () {\n //列表\n if (this_.checkBoxDataAll != undefined && this_.checkBoxDataAll.length > 0) {\n this_.checkBoxDataAll.forEach(function (row) {\n var res = this_.indexArray(this_.dialogData, row);\n this_.undefineda = res;\n\n if (res != -1) {\n this_.isCurrentChange = true;\n this_.toggleRowSelection(res, true);\n }\n });\n }\n }, 300);\n },\n toggleRowSelection: function toggleRowSelection(res, val) {\n this.$refs.orgTable.toggleRowSelection(this.dialogData[res], val);\n },\n showDialog: function showDialog(item) {\n var _this2 = this;\n\n var this_ = this; //第二次点击子表回填对话框 第一次选中的数据不是选中状态\n\n if (this_.selectOrgs) {\n this_.selectOrgs.empty();\n this_.checkBoxDataAll.empty();\n }\n\n var alias = this.custdialog.custDialog.alias;\n this.$store.dispatch('form/getByAlias', alias).then(function (customDialog) {\n if (!customDialog || !customDialog.alias) {\n Message.error('对话框别名【' + alias + '】不存在!');\n return;\n }\n\n if (customDialog.style == 1) {\n var displaylist = JSON.parse(customDialog.displayfield);\n this_.nodeKey = displaylist.id;\n } //对话框按表单字段查询(参数传入的)\n\n\n var bindList = this_.custdialog.custDialog.conditions;\n this_.param = []; //绑定的表单字段\n\n if (bindList.length > 0) {\n bindList.forEach(function (ele) {\n //绑定表单字段\n if (ele.defaultType == '3' && ele.bind) {\n var obj = {};\n obj.field = ele.field;\n obj.bind = ele.bind;\n this_.param.push(obj);\n }\n });\n } //判断对话框查询是否有条件\n\n\n var userInputList = JSON.parse(customDialog.conditionfield);\n this_.quickSearch = ''; //填写提示 placeholder\n\n this_.conditionBind = [];\n var queryParams = [];\n var placeholders = [];\n\n if (userInputList.length > 0) {\n userInputList.forEach(function (ele) {\n var obj = {}; //条件查询参数(用户输入的) 文本框输入\n\n if (ele.defaultType == '1') {\n obj[ele.field] = '';\n queryParams.push(obj);\n this_.conditionBind.push(ele);\n placeholders.push('请输入' + ele.comment);\n }\n });\n\n _this2.$set(_this2, 'queryParams', queryParams);\n\n _this2.$set(_this2, 'placeholders', placeholders);\n } //判断是否显示条件查询输入框\n\n\n if (this_.quickSearch != '') {\n this_.querysShow = true;\n } else {\n this_.querysShow = true;\n }\n\n this_.quickSearch = '请输入' + _this2.quickSearch + '查询';\n this_.style = 'height:' + customDialog.height + 'px';\n\n if (window.screen.height && window.screen.height <= 900) {\n _this2.style = 'height:440px';\n }\n\n if (customDialog.style == 0 || customDialog.style == 2) {\n //列表\n this_.customDialogShow({\n alias: alias,\n customDialog: customDialog\n });\n } else if (customDialog.style == 1) {\n //树形\n this_.pageParam = {\n alias: alias,\n customDialog: customDialog\n };\n this_.customDialog = customDialog;\n var param = {};\n this_.conditionfieldTree = []; //判断是否存在条件\n\n if (customDialog.conditionfield) {\n this_.conditionfieldTree = JSON.parse(customDialog.conditionfield);\n\n if (this_.conditionfieldTree.length > 0) {\n for (var i = this_.conditionfieldTree.length - 1; i >= 0; i--) {\n //判断条件字段是否是动态传入(defaultType:4:动态传入,2:固定值 )\n if (this_.conditionfieldTree[i].defaultType == \"4\") {\n param[this_.conditionfieldTree[i].field] = this_.conditionfieldTree[i].comment;\n }\n }\n }\n } //有动态传入的字段\n\n\n if (JSON.stringify(param) != \"{}\") {\n this_.dialogVisible = true;\n } else {\n //无动态传入的字段\n this_.customDialogTreeShow(this_.pageParam);\n }\n }\n });\n },\n //判断数据是否包含某个对象,并返回数据包含对象的下标\n indexArray: function indexArray(array, item) {\n if (array.length == 0) {\n return -1;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (JSON.stringify(array[i]) == JSON.stringify(item)) {\n return i;\n }\n }\n\n return -1;\n },\n //点击列表某一个复选框时触发\n onTableSelect: function onTableSelect(rows, row) {\n this.isCurrentChange = false; //判断点击列表数据时复选框是否勾选 selected:true不勾选,false勾选\n\n var selected = this.selectOrgs && this.selectOrgs.length > 0 && this.indexArray(this.selectOrgs, row) !== -1;\n\n if (selected) {\n this.isCurrentChange = true;\n var res = this.indexArray(this.selectOrgs, row);\n this.selectOrgs.splice(res, 1);\n }\n },\n //点击列表某一条数据时触发\n orgRowClick: function orgRowClick(row, column, event) {\n if (this.customDialog.selectNum === 1) {\n $(event.currentTarget.children[0].children[0].children[0]).trigger(\"click\");\n this.selectOrgs = [];\n this.selectOrgs.push(row);\n } else if (this.customDialog.selectNum != 1) {\n this.isCurrentChange = false; //判断点击列表数据时复选框是否勾选 selected:true不勾选,false勾选\n\n var selected = this.selectOrgs && this.selectOrgs.length > 0 && this.indexArray(this.selectOrgs, row) !== -1;\n\n if (selected) {\n this.isCurrentChange = true;\n var res = this.indexArray(this.selectOrgs, row);\n this.selectOrgs.splice(res, 1);\n }\n\n this.$refs.orgTable.toggleRowSelection(row);\n }\n },\n //列表复选框有改变时触发\n orgTableSelection: function orgTableSelection(selection) {\n //全选的情况特殊处理(为了与原本功能逻辑不冲突,先复制一份旧的选中数据.然后拿到全选事件中去计算)\n this.oldselectOrgs = _.cloneDeep(this.selectOrgs); //多选\n\n if (this.customDialog.selectNum != 1 && !this.isCurrentChange) {\n if (selection && selection.length > 0) {\n if (selection.length == 1 && (!this.selectOrgs || this.selectOrgs.length == 0)) {\n this.selectOrgs = selection;\n } else if ((!this.selectOrgs || this.selectOrgs.length == 0) && selection.length > 1) {\n if (!this.selectOrgs) {\n this.selectOrgs = [];\n }\n\n for (var i = selection.length - 1; i >= 0; i--) {\n this.selectOrgs.push(selection[i]);\n }\n } else if (this.isCurrentChange && selection.length >= 10) {\n if (!this.selectOrgs) {\n this.selectOrgs = [];\n } else {\n for (var u = this.selectOrgs.length - 1; u >= 0; u--) {\n var res = this.indexArray(selection, this.selectOrgs[u]);\n\n if (res != -1) {\n this.selectOrgs.splice(res, 1);\n }\n }\n }\n\n for (var _i2 = 0; _i2 < selection.length; _i2++) {\n this.selectOrgs.push(selection[_i2]);\n }\n } else {\n for (var _i3 = selection.length - 1; _i3 >= 0; _i3--) {\n this.selectOrgs.push(selection[_i3]);\n break;\n }\n }\n }\n }\n },\n dialogConfirm: function dialogConfirm() {\n if (!this.selectOrgs || this.selectOrgs.length == 0) {\n this.$message.error(\"请选择数据回填\");\n return;\n }\n\n this.queryParam = \"\";\n this.customDialogShowList = false;\n this.calacInputSuffixHeight();\n this.syncInputValue();\n },\n //重置\n reset: function reset() {\n var _this3 = this;\n\n this.queryParams.forEach(function (paramObj) {\n for (var key in paramObj) {\n _this3.queryParams[key] = \"\";\n }\n }); //组合树重置\n\n if (this.$refs.combinationTree) {\n var nodes = this.$refs.combinationTree.store.nodesMap;\n\n for (var key in nodes) {\n nodes[key].expanded = false;\n }\n }\n\n this.combinationTreeQuerys.splice(0);\n this.search(true);\n },\n //查询\n search: function search(resetPagintion) {\n var _this4 = this;\n\n var querys = []; //查询条件\n\n var queryFilter = {};\n\n if (JSON.stringify(this.pagination) == \"{}\") {\n this.pagination = {\n page: 1,\n pageSize: 20,\n showTotal: \"true\"\n };\n }\n\n var pageBean = {\n pageBean: this.pagination\n };\n\n if (resetPagintion) {\n pageBean.pageBean = {\n page: 1,\n pageSize: 20,\n showTotal: \"true\"\n };\n } //用户输入的\n\n\n if (this.queryParams.length != 0 && this.queryParams[0] != \"\") {\n this.conditionBind.forEach(function (item, index) {\n querys.push({\n property: item.field,\n value: _this4.queryParams[item.field],\n group: \"main\",\n operation: \"LIKE\",\n relation: \"AND\"\n });\n });\n } //参数传入的查询拼接\n\n\n if (this.param) {\n var pInst = utils.getOnlineFormInstance(this);\n this.param.forEach(function (item) {\n querys.push({\n property: item.field,\n value: utils.getValueByPath(pInst, item.bind),\n group: \"main\",\n operation: \"LIKE\",\n relation: \"AND\"\n });\n });\n } //来自组合对话框的\n\n\n if (this.combinationTreeQuerys && this.combinationTreeQuerys.length != 0) {\n for (var i = 0; i < this.combinationTreeQuerys.length; i++) {\n querys.push(this.combinationTreeQuerys[i]);\n }\n }\n\n if (querys.length > 0) {\n queryFilter = {\n pageBean: pageBean.pageBean,\n querys: querys\n };\n this.customDialog.pageBean = queryFilter;\n this.$store.dispatch(\"dialog/getlistJson\", this.customDialog).then(function () {\n _this4.checkList();\n });\n } else {\n this.customDialog.pageBean = pageBean;\n this.$store.dispatch(\"dialog/getlistJson\", this.customDialog).then(function () {\n _this4.checkList();\n });\n }\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 io = 0; io < param.resultfield.length; io++) {\n if (param.resultfield[io].fieldPath != \"\") {\n var val = \"\";\n\n for (var j = 0; j < res.data.rows.length; j++) {\n if (res.data.rows[j][param.resultfield[io].field]) {\n val = val + res.data.rows[j][param.resultfield[io].field] + \",\";\n }\n }\n\n val = val.substring(0, val.length - 1);\n var pathArr = param.resultfield[io].fieldPath.split(\".\");\n\n if (pathArr.length == 3) {\n //主表\n utils.setValueByPath(pInst, param.resultfield[io].fieldPath, val, null);\n } else if (pathArr.length == 4) {\n //子表\n var subData = pInst.data[pathArr[1]][pathArr[2]];\n\n if (subData.length == 0) {\n //子表没数据的情况\n var subTabName = pathArr[2].replace(\"sub_\", \"\"); //得到子表的所有字段\n\n var subInitData = pInst.data[pathArr[1]].initData[subTabName] || {}; //把数组里面的值为 null 转换为空字符串\n\n var str = JSON.stringify(subInitData).replace(/null/g, '\"\"');\n\n var _subData = JSON.parse(str);\n\n for (var key in _subData) {\n //点添加时判断要新增子表记录中的孙表是否有值\n if (key.indexOf(\"sub_\") == 0 && _subData[key].length > 0) {\n _subData[key] = []; //有则清空\n } //点添加时判断要新增子表记录中的字段是否有值\n\n\n if (_subData[key]) {\n _subData[key] = \"\"; //有则清空\n }\n } //新增一条数据\n\n\n pInst.data[pathArr[1]][pathArr[2]].push(_subData); //对话框关联查询返回的值赋值给绑定的字段\n\n utils.setValueByPath(pInst, param.resultfield[io].fieldPath, val, 0);\n } else {\n //子表有数据的情况\n for (var p = 0; p < subData.length; p++) {\n //对话框关联查询返回的值赋值给绑定的字段\n utils.setValueByPath(pInst, param.resultfield[io].fieldPath, val, p);\n }\n }\n }\n }\n }\n } else {\n //没有返回的值则清空\n //获取关联查询返回的表单参数\n for (var iop = 0; iop < param.resultfield.length; iop++) {\n if (param.resultfield[iop].fieldPath != \"\") {\n var _pathArr = param.resultfield[iop].fieldPath.split(\".\");\n\n if (_pathArr.length == 3) {\n //主表\n //赋值给绑定的字段\n utils.setValueByPath(pInst, param.resultfield[iop].fieldPath, \"\", null);\n } else if (_pathArr.length == 4) {\n //子表\n var _subData2 = pInst.data[_pathArr[1]][_pathArr[2]];\n\n for (var _p = 0; _p < _subData2.length; _p++) {\n //对话框关联查询返回的值赋值给绑定的字段\n utils.setValueByPath(pInst, param.resultfield[iop].fieldPath, \"\", _p);\n }\n }\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 // 同步选择结果\n syncInputValue: function syncInputValue() {\n var _this5 = this;\n\n var returnStr = JSON.parse(this.customDialog.resultfield); //拿到返回的字段\n\n var field = new Array([returnStr.length]);\n var comment = new Array([returnStr.length]);\n var str = [];\n var ids = [];\n\n for (var i = 0; i < returnStr.length; i++) {\n field[i] = this.customDialog.dsType == 'dataSource' ? returnStr[i].field.toLowerCase() : returnStr[i].field;\n comment[i] = this.customDialog.dsType == 'dataSource' ? returnStr[i].comment.toLowerCase() : returnStr[i].comment;\n }\n\n var this_ = this;\n this.selectOrgs.forEach(function (row) {\n if (this_.checkBoxDataAll || this_.checkBoxDataAll.length < 1) {\n this_.checkBoxDataAll.push(row);\n } else if (JSON.stringify(this_.indexArray).indexOf(JSON.stringify(row)) == -1) {\n this_.checkBoxDataAll.push(row);\n }\n });\n var s = this.selectOrgs;\n\n if (this.customDialog.selectNum === 1) {\n var temp = '';\n\n for (var i = 0; i < comment.length; i++) {\n var encodeStr = encodeURIComponent(s[0][field[i]]);\n temp += '\"' + comment[i] + '\":\"' + encodeStr + '\",';\n }\n\n if (temp != '') {\n temp = '{' + temp.substring(0, temp.length - 1) + '}';\n }\n\n str.push(utils.parseToJson(temp));\n ids.push(s[0].id);\n } else {\n for (var i = 0; i < s.length; i++) {\n var temp = '';\n\n for (var j = 0; j < comment.length; j++) {\n var _encodeStr = encodeURIComponent(s[i][field[j]]);\n\n temp += '\"' + comment[j] + '\":\"' + _encodeStr + '\",';\n }\n\n if (temp != '') {\n temp = '{' + temp.substring(0, temp.length - 1) + '}';\n }\n\n str.push(utils.parseToJson(temp));\n ids.push(s[i].id);\n }\n }\n\n var returnData = str;\n\n var _this = this;\n\n var formInst = utils.getOnlineFormInstance(this); //处理自动回填配置\n\n this.instId = formInst.$parent.instId;\n var custDialog = this.custdialog;\n var fillOrg = {};\n\n if (custDialog.orgConfig && custDialog.orgConfig.name && this.fillOrg.id) {\n var namePath = custDialog.orgConfig.name.split('.');\n var orgNameField = namePath[namePath.length - 1];\n fillOrg[orgNameField] = this.fillOrg.name;\n\n if (custDialog.orgConfig.id) {\n var idPath = custDialog.orgConfig.id.split('.');\n var orgIdField = idPath[idPath.length - 1];\n fillOrg[orgIdField] = this.fillOrg.id;\n }\n\n if (custDialog.orgConfig.code) {\n var codePath = custDialog.orgConfig.code.split('.');\n var orgCodeField = codePath[codePath.length - 1];\n fillOrg[orgCodeField] = this.fillOrg.code;\n }\n }\n\n if (custDialog.orgConfig.instId) {\n var instIdPath = custDialog.orgConfig.instId.split('.');\n var instIdField = instIdPath[instIdPath.length - 1];\n fillOrg[instIdField] = this.instId;\n }\n\n try {\n var returnSize = returnData.length; //判断是否是一对一子表\n\n if (_this.relation && _this.relation == 'onetoone') {\n if (returnSize > 1) {\n this_.$message.error(\"一对一子表只能选择一条数据\");\n this_.customDialogShowList = true;\n return;\n }\n }\n\n returnData.forEach(function (row) {\n var targetArray = null;\n var subLineData = {};\n\n _this5.custdialog.custDialog.mappingConf.forEach(function (con) {\n if (con.target[0]) {\n targetArray = con.target[0].split('.');\n var from = '';\n\n if (_this.customDialog.dsType == 'restful') {\n from = con.from;\n } else {\n from = con.from.toLowerCase();\n }\n\n if (row[from] == undefined) {\n from = from.toUpperCase();\n }\n\n subLineData[targetArray[targetArray.length - 1]] = decodeURIComponent(row[from]);\n }\n });\n\n if (targetArray) {\n var subBo = formInst['data'][targetArray[0]][targetArray[1]]; //判断是否大于子表数据最大行数\n\n if (this_.maxRow != 0 && subBo.length + returnSize > this_.maxRow) {\n this_.$message.error(\"子表数据已超过最大行数【\" + this_.maxRow + \"】\");\n this_.customDialogShowList = true;\n throw new Error(\"EndIterative\");\n } //子表中的孙表实体(可能存在多个)\n\n\n var sunBos = utils.getSomeAttributeFromParentElement(_this.$el, 'sunBos'); //如果存在孙表实体则手动添加空孙表数组对象\n\n if (sunBos) {\n var arrayBo = sunBos.split(',');\n\n for (var _i4 = 0; _i4 < arrayBo.length; _i4++) {\n var key = 'sub_' + arrayBo[_i4];\n var value = new Array();\n subLineData[key] = value;\n }\n } //判断是否是一对一子表\n\n\n if (_this.relation && _this.relation == 'onetoone') {\n subBo.empty();\n }\n\n if (fillOrg && JSON.stringify(fillOrg) != '{}') {\n subLineData = _objectSpread(_objectSpread({}, subLineData), fillOrg);\n }\n\n subBo.push(subLineData);\n returnSize--;\n }\n });\n } catch (e) {\n if (e.message != \"EndIterative\") throw e;\n }\n\n ;\n },\n //取消按钮\n dialogCancel: function dialogCancel() {\n var _this6 = this;\n\n var this_ = this;\n this_.queryParam = \"\";\n this_.$store.dispatch(\"dialog/setDialogData\", []).then(function () {\n this_.customDialogShowList = false; //判断是否是点击了确认再点击取消的 inputVal没有值则表示直接点击的取消\n\n if (!this_.inputVal) {\n this_.selectOrgs = [];\n } else {\n this_.selectOrgs = _toConsumableArray(this_.showData);\n _this6.checkBoxDataAll = _toConsumableArray(this_.selectOrgs);\n }\n });\n },\n dialogTreeConfirm: function dialogTreeConfirm() {\n var _this7 = this;\n\n var this_ = this;\n\n if (this_.propsData.length == 0) {\n this_.$message.error(\"请选择数据回填\");\n return;\n }\n\n this.$store.dispatch('dialog/setDialogData', []);\n var returnStr = JSON.parse(this.customDialog.resultfield);\n var field = new Array([returnStr.length]);\n var comment = new Array([returnStr.length]);\n var str = [];\n\n for (var i = 0; i < returnStr.length; i++) {\n field[i] = returnStr[i].field;\n comment[i] = returnStr[i].comment;\n }\n\n if (this.customDialog.selectNum === 1) {\n var nodes = this.propsData[0];\n var temp = '';\n\n for (var i = 0; i < comment.length; i++) {\n temp += '\"' + comment[i] + '\":\"' + nodes[field[i]] + '\",';\n }\n\n if (temp != '') {\n temp = '{' + temp.substring(0, temp.length - 1) + '}';\n }\n\n str.push(utils.parseToJson(temp));\n } else {\n var nodes = this.propsData;\n nodes.forEach(function (item, k) {\n var temp = '';\n\n for (var i = 0; i < comment.length; i++) {\n temp += '\"' + comment[i] + '\":\"' + nodes[field[i]] + '\",';\n temp += '\"' + comment[i] + '\":\"' + nodes[k][field[i]] + '\",';\n }\n\n if (temp != '') {\n temp = '{' + temp.substring(0, temp.length - 1) + '}';\n }\n\n str.push(utils.parseToJson(temp));\n });\n }\n\n var returnData = str;\n var formInst = utils.getOnlineFormInstance(this);\n\n try {\n var returnSize = returnData.length; //判断是否是一对一子表\n\n if (this_.relation && this_.relation == 'onetoone') {\n if (returnSize > 1) {\n this_.$message.error(\"一对一子表只能选择一条数据\");\n this_.customDialogShowTree = true;\n return;\n }\n }\n\n returnData.forEach(function (row) {\n var targetArray = null;\n var subLineData = {};\n\n _this7.custdialog.custDialog.mappingConf.forEach(function (con) {\n if (con.target[0]) {\n targetArray = con.target[0].split('.');\n var from = '';\n\n if (this_.customDialog.dsType == 'restful') {\n from = con.from;\n } else {\n from = con.from.toLowerCase();\n }\n\n if (row[from] == undefined) {\n from = from.toUpperCase();\n }\n\n subLineData[targetArray[targetArray.length - 1]] = decodeURIComponent(row[from]);\n }\n });\n\n if (targetArray) {\n var subBo = formInst['data'][targetArray[0]][targetArray[1]]; //判断是否大于子表数据最大行数\n\n if (this_.maxRow != 0 && subBo.length + returnSize > this_.maxRow) {\n this_.$message.error(\"子表数据已超过最大行数【\" + this_.maxRow + \"】\");\n this_.customDialogShowTree = true;\n throw new Error(\"EndIterative\");\n } //子表中的孙表实体(可能存在多个)\n\n\n var sunBos = utils.getSomeAttributeFromParentElement(this_.$el, 'sunBos'); //如果存在孙表实体则手动添加空孙表数组对象\n\n if (sunBos) {\n var arrayBo = sunBos.split(',');\n\n for (var _i5 = 0; _i5 < arrayBo.length; _i5++) {\n var key = 'sub_' + arrayBo[_i5];\n var value = new Array();\n subLineData[key] = value;\n }\n } //判断是否是一对一子表\n\n\n if (this_.relation && this_.relation == 'onetoone') {\n subBo.empty();\n }\n\n subBo.push(subLineData);\n returnSize--;\n }\n });\n this.customDialogShowTree = false;\n } catch (e) {\n if (e.message != \"EndIterative\") throw e;\n }\n\n ;\n },\n dialogCancelTree: function dialogCancelTree() {\n this.$store.dispatch(\"dialog/setDialogData\", []);\n this.customDialogShowTree = false;\n },\n getChecked: function getChecked(data, checked, indeterminate) {\n if (this.customDialog.selectNum === 1) {\n this.propsData = [];\n this.propsData.push(data);\n } else {\n this.propsData = this.$refs.tree.getCheckedNodes();\n }\n },\n treeClick: function treeClick(data, n, i) {\n if (this.customDialog.selectNum === 1) {\n this.propsData = [];\n this.propsData.push(data);\n }\n },\n clearAllSelectOrgs: function clearAllSelectOrgs() {\n this.selectOrgs = null;\n this.$refs.orgTable.clearSelection();\n },\n removeSelectOrg: function removeSelectOrg(item) {\n var _this8 = this;\n\n if (this.customDialog.selectNum === 1) {\n this.$emit(\"input\", \"\");\n this.selectOrgs.splice(item, 1);\n this.showData.splice(item, 1);\n } else {\n this.inputVal.splice(item, 1); // let removeId = this.showData[item];\n //树形\n\n if (this.propsData.length > 0) {\n this.propsData.splice(item, 1);\n }\n\n if (this.showData.length > 0) {\n this.showData.splice(item, 1);\n } //列表\n\n\n if (this.selectOrgs != null) {\n this.selectOrgs.splice(item, 1);\n this.checkBoxDataAll.splice(item, 1);\n this.selectOrgs.forEach(function (row) {\n // if(item.id ==removeId ){\n _this8.isCurrentChange = true;\n\n _this8.toggleRowSelection(row, false); // }\n\n });\n }\n\n this.calacInputSuffixHeight();\n var value = \"\";\n this.inputVal.forEach(function (val) {\n value += val.value + \",\";\n });\n\n if (value.length > 0) {\n value = value.substring(0, value.length - 1);\n }\n\n if (value != \"\") {\n value = value + \"||\" + JSON.stringify(this.showData);\n }\n\n this.$emit(\"input\", value);\n }\n\n this.syncInputValue();\n },\n calacInputSuffixHeight: function calacInputSuffixHeight() {\n var _this9 = this;\n\n setTimeout(function () {\n if (!_this9.$refs.tagSpans) return;\n\n if (_this9.$refs.tagSpans.offsetHeight) {\n _this9.inputSuffixHeight = _this9.$refs.tagSpans.offsetHeight + 5;\n } else {\n _this9.inputSuffixHeight = 30;\n } // 触发验证\n\n\n _this9.$validator.validate();\n }, 0);\n },\n customDialogShow: function customDialogShow(pageParam) {\n this.customDialogShowList = true;\n this.customDialog = pageParam.customDialog;\n this.customDialog.queryUrl = this.customDialog.dsType == \"dataSource\" ? \"${form}/form/customDialog/v1/getListData?alias=\" + this.customDialog.alias + \"&mapParam=\" + (this.customDialog.mapParam ? this.customDialog.mapParam : \"\") : this.customDialog.url;\n\n if (this.dialogData.length < 1) {\n this.pagination = {\n page: 1,\n pageSize: 20,\n showTotal: \"true\"\n };\n this.search();\n this.displayfield = JSON.parse(pageParam.customDialog.displayfield);\n\n if (this.customDialog.dsType == \"dataSource\") {\n for (var i = 0; i < this.displayfield.length; i++) {\n this.displayfield[i].field = this.displayfield[i].field.toLowerCase();\n }\n }\n } else if (this.dialogData.length > 1) {\n this.search();\n }\n\n if (this.dialogData.length > 0 && this.displayfield.length == 0) {\n this.search();\n this.displayfield = JSON.parse(pageParam.customDialog.displayfield);\n\n if (this.customDialog.dsType == \"dataSource\") {\n for (var i = 0; i < this.displayfield.length; i++) {\n this.displayfield[i].field = this.displayfield[i].field.toLowerCase();\n }\n }\n }\n },\n customDialogTreeShow: function customDialogTreeShow(pageParam) {\n this.customDialog = pageParam.customDialog;\n var customDialog = this.customDialog;\n var mapParam = \"\";\n\n if (pageParam.param != undefined) {\n mapParam = JSON.stringify(pageParam.param);\n mapParam = mapParam.substring(1, mapParam.length - 1);\n }\n\n var requestType = customDialog.dsType == \"dataSource\" ? \"GET\" : customDialog.requestType ? customDialog.requestType : \"POST\";\n var url = \"${form}/form/customDialog/v1/getTreeData?alias=\" + pageParam.alias + \"&mapParam=\" + mapParam;\n var paramsObj = {};\n\n if (customDialog.dsType != \"dataSource\") {\n url = customDialog.url;\n var templatePa = customDialog.dataParam;\n\n if (customDialog.conditionfield) {\n var conditions = JSON.parse(customDialog.conditionfield);\n\n for (var i = 0; i < conditions.length; i++) {\n var con = conditions[i];\n\n if (requestType == \"POST\") {\n if (templatePa) {\n templatePa = templatePa.replace(new RegExp(\"\\\\{\" + con.field + \"\\\\}\", \"g\"), con.defaultValue);\n } else {\n paramsObj[con.field] = con.defaultValue;\n }\n } else {\n var ljChar = url.indexOf(\"?\") == -1 ? \"?\" : \"&\";\n url = url + ljChar + con.field + \"=\" + con.defaultValue;\n }\n }\n\n if (templatePa) {\n paramsObj = JSON.parse(templatePa);\n }\n }\n }\n\n var requestParams = {};\n requestParams.requestType = requestType;\n requestParams.url = url;\n requestParams.paramsObj = paramsObj;\n this.searchTree(requestParams);\n this.customDialogShowTree = true;\n },\n //树形查询\n searchTree: function searchTree(requestParams) {\n var this_ = this;\n var query = requestParams.requestType == \"POST\" ? req.post(requestParams.url, requestParams.paramsObj) : req.get(requestParams.url);\n query.then(function (response) {\n //显示字段配置\n var displayfield = JSON.parse(this_.customDialog.displayfield);\n this_.displayField = displayfield; //把对话框配置的显示字段显示名称赋值给树形的显示值\n\n this_.defaultProps.label = displayfield.displayName;\n this_.treeList = response.data; //得到要加载树的信息\n\n this_.props1 = this_.toTreeData(response.data, displayfield.id, displayfield.pid, displayfield.displayName, displayfield.pvalue ? displayfield.pvalue : 0);\n });\n },\n //加载树的信息\n toTreeData: function toTreeData(data, id, pid, name, pvalue) {\n // 建立个树形结构,需要定义个最顶层的父节点,pvalue是0\n return this.translateDataToTree(data, pid, id, name, pvalue);\n },\n translateDataToTree: function translateDataToTree(data, pid, id, name, pvalue) {\n //把树数据有子节点的数据全部过滤掉(只留父节点的数据)\n var parents = data.filter(function (value) {\n return value[id] == value[pid] || value[pid] == null || value[pid] == pvalue;\n });\n\n if (!parents) {\n parents = data.filter(function (value) {\n return value[pid] !== \"undefined\" && value[pid] != null && value[id] != value[pid];\n });\n }\n\n return parents;\n },\n loadTree: function loadTree(node, resolve) {\n var _this10 = this;\n\n if (node) {\n var this_ = this;\n var displayField = this_.customDialog.style == 2 ? this_.combiTreeDisplayField : this_.displayField;\n resolve(this.treeList.filter(function (value) {\n return value[displayField.pid] === node.data[displayField.id];\n }));\n\n if (this.showData && this.showData.length > 0) {\n setTimeout(function () {\n _this10.showData.forEach(function (v) {\n if (v.Pid == node.key) {\n this_.$refs.tree.setChecked(v, true);\n } else {\n this_.checkNode(v, this_);\n }\n });\n }, 400);\n }\n }\n },\n afterOpen: function afterOpen() {\n //打开对话框之后加载树\n this.loadCombinationTree();\n },\n loadCombinationTree: function loadCombinationTree() {\n var _this11 = this;\n\n if (this.customDialog.style != 2) {\n return;\n }\n\n var combinationRule = JSON.parse(this.customDialog.combinationRule);\n this.combinationRule = combinationRule;\n var treeAlias = combinationRule.leftTree; //获取对话框数据\n\n req.get(\"${form}/form/customDialog/v1/getByAlias?alias=\" + treeAlias).then(function (resp) {\n var treeDialog = resp.data;\n _this11.leftTreeTitle = treeDialog.name;\n var reqParam = {};\n var requestType = treeDialog.dsType == \"dataSource\" ? \"GET\" : treeDialog.requestType ? treeDialog.requestType : \"POST\";\n var url = \"${form}/form/customDialog/v1/getTreeData?alias=\" + treeAlias + \"&mapParam=\";\n var paramsObj = {};\n\n if (treeDialog.dsType != \"dataSource\") {\n url = treeDialog.url;\n var templatePa = treeDialog.dataParam;\n\n if (treeDialog.conditionfield) {\n var conditions = JSON.parse(treeDialog.conditionfield);\n\n for (var i = 0; i < conditions.length; i++) {\n var con = conditions[i];\n\n if (requestType == \"POST\") {\n if (templatePa) {\n templatePa = templatePa.replace(new RegExp(\"\\\\{\" + con.field + \"\\\\}\", \"g\"), con.defaultValue);\n } else {\n paramsObj[con.field] = con.defaultValue;\n }\n } else {\n var ljChar = url.indexOf(\"?\") == -1 ? \"?\" : \"&\";\n url = url + ljChar + con.field + \"=\" + con.defaultValue;\n }\n }\n\n if (templatePa) {\n paramsObj = JSON.parse(templatePa);\n }\n }\n }\n\n var requestParams = {};\n requestParams.requestType = requestType;\n requestParams.url = url;\n requestParams.paramsObj = paramsObj;\n\n _this11.$store.dispatch(\"dialog/getTreeData\", requestParams).then(function (resp) {\n if (treeDialog.displayfield && treeDialog.resultfield) {\n var displayField = JSON.parse(treeDialog.displayfield);\n var resultfield = JSON.parse(treeDialog.resultfield);\n _this11.defaultProps.label = displayField.displayName;\n _this11.treeList = resp;\n _this11.combiTreeDisplayField = displayField;\n _this11.combinationTreeData = _this11.toTreeData(resp, displayField.id, displayField.pid, displayField.displayName, displayField.pvalue ? displayField.pvalue : \"0\", resultfield);\n }\n });\n });\n },\n combiTreeClick: function combiTreeClick(paramObj, node, nodeComponent) {\n //组合对话框点击左树\n //清空旧的\n this.combinationTreeQuerys.splice(0);\n var combinationRule = JSON.parse(this.customDialog.combinationRule);\n\n if (!combinationRule.rules || combinationRule.rules.length == 0) {\n return;\n }\n\n var rules = combinationRule.rules;\n\n for (var i = 0; i < rules.length; i++) {\n var value = paramObj[rules[i].treeField];\n var property = rules[i].listField;\n this.combinationTreeQuerys.push({\n property: property,\n value: value,\n group: \"treeGroup\",\n operation: this.getOperation(rules[i].condition),\n relation: \"AND\"\n });\n }\n\n this.search();\n },\n //获取运算符号\n getOperation: function getOperation(old) {\n if (!old) {\n return \"\";\n }\n\n if (old == \"EQ\") {\n return \"EQUAL\";\n }\n\n if (old == \"LK\") {\n return \"LIKE\";\n }\n\n if (old == \"LFK\") {\n return \"LIKE\";\n }\n\n if (old == \"IN\") {\n return \"IN\";\n }\n },\n toggleTree: function toggleTree() {\n if (this.treeShow) {\n this.treeShow = false;\n this.transtionWidth = \"0%\";\n this.toggleBtn = \"el-icon-arrow-right\";\n } else {\n this.treeShow = true;\n this.transtionWidth = \"25%\";\n this.toggleBtn = \"el-icon-arrow-left\";\n }\n },\n initTemplateData: function initTemplateData() {\n var _this = this;\n\n var custdialog = this.custdialog.custDialog;\n\n if (!custdialog || !custdialog.mappingConf || custdialog.mappingConf.length < 1) {\n return;\n }\n\n var targetPath = this.getTargetPath(custdialog.mappingConf);\n var paths = targetPath.split('.');\n var formInst = utils.getOnlineFormInstance(this);\n\n if (!formInst.initFillData) {\n return;\n } //如果已有数据则不需要再次初始化\n\n\n var curData = formInst['data'][paths[0]][paths[1]];\n var initType = this.initFillDataType;\n\n if ((!initType || initType == 'empty') && curData.length > 0 && !(curData.length == 1 && JSON.stringify(curData[0]) == '[]')) {\n return;\n } else if (initType == 'cover') {\n formInst['data'][paths[0]][paths[1]] = [];\n }\n\n var loading = this.$loading({\n lock: true,\n text: '正在初始化填报模板...',\n spinner: 'el-icon-loading',\n background: 'rgba(0, 0, 0, 0.7)'\n });\n var myCustomDialog = null;\n this.$http.get('${form}/form/customDialog/v1/getByAlias?alias=' + custdialog.alias).then(function (resp) {\n myCustomDialog = resp.data;\n _this.customDialog = resp.data;\n }, function (error) {\n _this.closeLoading(loading);\n\n _this.$message({\n message: \"获取自定义对话框失败!\",\n type: \"error\"\n });\n }).then(function () {\n var currentUser = JSON.parse(sessionStorage.getItem(\"currentUser\"));\n\n if (!_this.custdialog.orgConfig.code && !_this.custdialog.orgConfig.name && !_this.custdialog.orgConfig.id) {\n _this.closeLoading(loading);\n\n _this.toFillInitData(_this, myCustomDialog.dsType, formInst['data']);\n } else if (localStorage.getItem(\"curFillOrg_\" + currentUser.account)) {\n _this.closeLoading(loading);\n\n _this.fillOrg = JSON.parse(localStorage.getItem(\"curFillOrg_\" + currentUser.account));\n\n _this.toFillInitData(_this, myCustomDialog.dsType, formInst['data']);\n } else {\n _this.$http.get('${uc}/api/org/v1/org/getFillOrg').then(function (resp) {\n _this.closeLoading(loading);\n\n var rep = resp.data;\n\n if (rep.state) {\n _this.fillOrg = rep.value;\n localStorage.setItem(\"curFillOrg_\" + currentUser.account, JSON.stringify(rep.value));\n\n _this.toFillInitData(_this, myCustomDialog.dsType, formInst['data']);\n } else {\n _this.$message({\n message: rep.message,\n type: \"warning\"\n });\n }\n }, function (error) {\n _this.closeLoading(loading);\n\n _this.$message({\n message: \"获取当前用户填制单位失败!\",\n type: \"warning\"\n });\n });\n }\n });\n },\n closeLoading: function closeLoading(loading) {\n setTimeout(function () {\n loading.close();\n }, 2000);\n },\n getTargetPath: function getTargetPath(mappingConf) {\n var target = '';\n\n if (mappingConf && mappingConf.length > 0) {\n mappingConf.forEach(function (map) {\n if (map['target'] && map['target'].length == 1 && map['target'][0]) {\n target = map['target'][0];\n return target;\n }\n });\n }\n\n return target;\n },\n toFillInitData: function toFillInitData(_this, dsType, curData) {\n var custdialog = this.custdialog.custDialog;\n var params = []; //绑定的表单字段\n\n if (custdialog.conditions) {\n //对话框按表单字段查询(参数传入的)\n var bindList = custdialog.conditions;\n\n if (bindList.length > 0) {\n bindList.forEach(function (ele) {\n //绑定表单字段\n if (ele.defaultType == \"3\" && ele.bind) {\n var obj = {};\n obj.field = ele.field;\n var bindArray = ele.bind.split('.');\n\n if (bindArray.length == 3) {\n obj.bind = curData[bindArray[1]][bindArray[2]];\n params.push(obj);\n }\n }\n });\n }\n }\n\n var url = '${form}/form/customDialog/v1/getListData?alias=' + custdialog.alias;\n\n if (params.length > 0) {\n var paStr = '';\n params.forEach(function (pa) {\n if (paStr) {\n paStr += ',';\n }\n\n paStr = paStr + '\"' + pa.field + '\":\"' + pa.bind + '\"';\n });\n url = url + '&mapParam=' + paStr;\n } else {\n url = url + '&mapParam=';\n }\n\n var param = {\n pageBean: {\n page: 1,\n pageSize: 1000,\n showTotal: true\n }\n };\n\n _this.$http.post(url, param).then(function (resp) {\n var response = resp.data;\n\n if (response.rows) {\n _this.syncInitTableValue(response.rows, dsType);\n }\n }, function (error) {\n _this.$message({\n message: \"获取初始化数据失败!\",\n type: \"error\"\n });\n });\n },\n syncInitTableValue: function syncInitTableValue(s, dsType) {\n var custDialog = this.custdialog;\n var returnStr = JSON.parse(this.customDialog.resultfield); //拿到返回的字段\n\n var field = new Array([returnStr.length]);\n var comment = new Array([returnStr.length]);\n var str = [];\n var ids = [];\n\n for (var i = 0; i < returnStr.length; i++) {\n field[i] = dsType == \"dataSource\" ? returnStr[i].field.toLowerCase() : returnStr[i].field;\n comment[i] = dsType == \"dataSource\" ? returnStr[i].comment.toLowerCase() : returnStr[i].comment;\n }\n\n if (this.customDialog.selectNum === 1) {\n var temp = \"\";\n\n for (var i = 0; i < comment.length; i++) {\n var va = s[0][field[i]];\n va = typeof va == 'undefined' ? '' : va;\n temp += '\"' + comment[i] + '\":\"' + va + '\",';\n }\n\n if (temp != \"\") {\n temp = \"{\" + temp.substring(0, temp.length - 1) + \"}\";\n }\n\n str.push(utils.parseToJson(temp));\n ids.push(s[0].id);\n } else {\n for (var i = 0; i < s.length; i++) {\n var temp = \"\";\n\n for (var j = 0; j < comment.length; j++) {\n var _va = s[i][field[j]];\n _va = typeof _va == 'undefined' ? '' : _va;\n temp += '\"' + comment[j] + '\":\"' + _va + '\",';\n }\n\n if (temp != \"\") {\n temp = \"{\" + temp.substring(0, temp.length - 1) + \"}\";\n }\n\n str.push(utils.parseToJson(temp));\n ids.push(s[i].id);\n }\n }\n\n var formInst = utils.getOnlineFormInstance(this);\n this.instId = formInst.$parent.instId; //处理填制部门\n\n var fillOrg = {};\n\n if (custDialog.orgConfig && custDialog.orgConfig.name && this.fillOrg.id) {\n var namePath = custDialog.orgConfig.name.split('.');\n var orgNameField = namePath[namePath.length - 1];\n fillOrg[orgNameField] = this.fillOrg.name;\n\n if (custDialog.orgConfig.id) {\n var idPath = custDialog.orgConfig.id.split('.');\n var orgIdField = idPath[idPath.length - 1];\n fillOrg[orgIdField] = this.fillOrg.id;\n }\n\n if (custDialog.orgConfig.code) {\n var codePath = custDialog.orgConfig.code.split('.');\n var orgCodeField = codePath[codePath.length - 1];\n fillOrg[orgCodeField] = this.fillOrg.code;\n }\n }\n\n if (custDialog.orgConfig.instId) {\n var instIdPath = custDialog.orgConfig.instId.split('.');\n var instIdField = instIdPath[instIdPath.length - 1];\n fillOrg[instIdField] = this.instId;\n }\n\n var returnData = str;\n\n var _this = this;\n\n returnData.forEach(function (row) {\n var subLineData = {};\n var targetArray = null;\n custDialog.custDialog.mappingConf.forEach(function (con) {\n if (con.target[0]) {\n targetArray = con.target[0].split(\".\");\n var from = \"\";\n\n if (_this.customDialog.dsType == \"restful\") {\n from = con.from;\n } else {\n from = con.from.toLowerCase();\n }\n\n subLineData[targetArray[targetArray.length - 1]] = row[from];\n }\n });\n\n if (fillOrg && JSON.stringify(fillOrg) != '{}') {\n subLineData = _objectSpread(_objectSpread({}, subLineData), fillOrg);\n }\n\n formInst['data'][targetArray[0]][targetArray[1]].push(subLineData);\n });\n }\n }\n};",null]}