{"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\\views\\form\\customDialog\\CustomDialogShowDetail.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\form\\customDialog\\CustomDialogShowDetail.vue","mtime":1675071992928},{"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 \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 req from \"@/request.js\";\nimport hotentUiUtils from '@/hotent-ui-util.js';\nexport default {\n name: \"custom-dialog-show-detail\",\n props: {\n //自定义对话框的别名\n alias: {\n type: String,\n required: true\n },\n //自定义对话框的配置\n customDialog: {\n type: Object,\n required: true\n }\n },\n mounted: function mounted() {\n var displayfield = JSON.stringify(this.customDialog.displayfield).toLowerCase();\n this.customDialog.displayfield = JSON.parse(displayfield);\n this.afterOpen();\n },\n data: function data() {\n return {\n customDialogPostParam: [],\n //为REST接口且请求类型是POST,条件字段是固定值的参数\n customDialogGetUrl: \"\",\n //为REST接口且请求类型是GET,条件字段是固定值的请求地址\n selectionRadio: [],\n //ht-table列表单选选择的数据\n textRadio: \"\",\n //ht-table列表数据的单选按钮\n selectable: true,\n //表示ht-table列表第一列是否显示复选框\n isShowSearch: false,\n //是否显示高级搜索\n nopagination: false,\n //是否隐藏分页组件,false:显示,true:隐藏\n tableData: [],\n //ht-table列表数据\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n combinationTreeData: [],\n treeShow: true,\n leftTreeTitle: \"\",\n defaultProps: {\n childen: 'children',\n label: 'label'\n },\n nodeKey: \"ID_\",\n treeList: [],\n combinationTreeQuerys: [],\n queryParam: {}\n };\n },\n created: function created() {\n this.initData();\n },\n methods: {\n //显示对话框\n initData: function initData() {\n this.customDialogPostParam = []; //清空为REST接口且请求类型是POST,条件字段是固定值的参数\n\n this.customDialogGetUrl = \"\"; //清空为REST接口且请求类型是GET,条件字段是固定值的请求地址\n\n this.selectionRadio = []; //清空ht-table列表单选选择的数据\n\n this.textRadio = \"\"; //清空ht-table列表数据单选按钮的选中状态\n\n this.isShowSearch = false; //不显示高级搜索\n //是否单选 1:单选;-1:多选\n\n if (this.customDialog.selectNum == 1) {\n this.selectable = false;\n } else {\n this.selectable = true;\n } //是否显示分页组件,true:显示,false:隐藏\n\n\n if (this.customDialog.needPage) {\n this.nopagination = false;\n } else {\n this.nopagination = true;\n } //判断是否有条件查询,且数据来源是数据源或者数据来源是REST接口且请求类型是POST\n\n\n if (this.customDialog.conditionfield.length > 0 && (this.customDialog.dsType == \"dataSource\" || this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"POST\")) {\n for (var i = this.customDialog.conditionfield.length - 1; i >= 0; i--) {\n //判断条件字段是否是参数传入并控制器的类型为单行文本框 (controllerType有值就代表控制器的类型为单行文本框,defaultType:1:参数传入,2:固定值 )\n if (this.customDialog.conditionfield[i].controllerType && this.customDialog.conditionfield[i].defaultType == \"1\") {\n this.isShowSearch = true; //显示高级搜索\n //如果条件字段为data类型,则控制器的类型为日期类型\n\n if (this.customDialog.conditionfield[i].dbType == \"date\") {\n this.customDialog.conditionfield[i].type = \"date\";\n } else {\n this.customDialog.conditionfield[i].type = \"text\";\n }\n } else {\n if (this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"POST\") {\n this.customDialogPostParam.push(this.customDialog.conditionfield[i]); //为REST接口且请求类型是POST,条件字段是固定值的参数\n } //如果是条件字段固定值就清除\n\n\n this.customDialog.conditionfield.splice(i, 1);\n }\n }\n } //判断是否有条件查询,且数据来源是REST接口且请求类型是GET\n\n\n if (this.customDialog.conditionfield.length > 0 && this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"GET\") {\n for (var _i = this.customDialog.conditionfield.length - 1; _i >= 0; _i--) {\n //判断条件字段是否是固定值(defaultType:1:参数传入,2:固定值 )\n if (this.customDialog.conditionfield[_i].defaultType == \"2\") {\n //判断请求地址是否带有 ?\n if (this.customDialog.url.indexOf(\"?\") == -1) {\n //无\n this.customDialog.url = this.customDialog.url + \"?\" + this.customDialog.conditionfield[_i].comment + \"=\" + this.customDialog.conditionfield[_i].defaultValue;\n } else {\n //有\n this.customDialog.url = this.customDialog.url + \"&\" + this.customDialog.conditionfield[_i].comment + \"=\" + this.customDialog.conditionfield[_i].defaultValue;\n } //如果是条件字段固定值就清除\n\n\n this.customDialog.conditionfield.splice(_i, 1);\n this.customDialogGetUrl = this.customDialog.url; //判断条件字段是否是参数传入并控制器的类型为单行文本框(controllerType有值就代表控制器的类型为单行文本框,defaultType:1:参数传入,2:固定值 )\n } else if (this.customDialog.conditionfield[_i].controllerType && this.customDialog.conditionfield[_i].defaultType == \"1\") {\n this.isShowSearch = true; //显示高级搜索\n }\n }\n }\n },\n //加载数据\n loadData: function () {\n var _loadData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(param, cb) {\n var i, _i2, operation, obj, ctx, exp, _i3, j, queryUrl, requestMethod, response, rows, newRows, _loop, _i4;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.queryParam = param; //判断是否有来自组合对话框树型部分的查询参数\n\n if (this.combinationTreeQuerys && this.combinationTreeQuerys.length > 0) {\n if (!param.querys) {\n param.querys = [];\n }\n\n for (i = 0; i < this.combinationTreeQuerys.length; i++) {\n param.querys.push(this.combinationTreeQuerys[i]);\n }\n } //为REST接口且请求类型是POST,条件字段是固定值的参数\n\n\n if (this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"POST\" && this.customDialogPostParam.length > 0) {\n for (_i2 = 0; _i2 < this.customDialogPostParam.length; _i2++) {\n operation = this.getOperation(this.customDialogPostParam[_i2].condition); //构建查询条件\n\n obj = {\n group: \"main\",\n operation: operation,\n property: this.customDialogPostParam[_i2].field,\n relation: \"AND\",\n value: this.customDialogPostParam[_i2].defaultValue\n };\n\n if (param.querys && param.querys.length > 0) {\n param.querys.push(obj);\n } else {\n param.querys = [];\n param.querys.push(obj);\n }\n }\n } // post restful接口,并且配置了post参数。则以post参数作为请求参数\n\n\n if (this.customDialog.dsType != 'dataSource' && this.customDialog.requestType == 'POST' && this.customDialog.dataParam && this.customDialog.dataParam.constructor == String) {\n // 构建上下文数据对象\n ctx = {};\n param && param.querys && param.querys.forEach(function (element) {\n ctx[element.property] = element.value;\n });\n exp = hotentUiUtils.parseExp(this.customDialog.dataParam, ctx);\n\n try {\n param = JSON.parse(exp);\n } catch (e) {\n this.$message.error(\"POST\\u53C2\\u6570\\u4E0D\\u662F\\u6709\\u6548\\u7684JSON\\u683C\\u5F0F\".concat(query.dataParam));\n }\n } //判断是否有条件查询,且数据来源是REST接口且请求类型是GET,并且判断参数传入是否填写了查询条件\n\n\n if (this.customDialog.conditionfield.length > 0 && this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"GET\" && param.querys && param.querys.length > 0) {\n for (_i3 = this.customDialog.conditionfield.length - 1; _i3 >= 0; _i3--) {\n //判断条件字段是否是参数传入并控制器的类型为单行文本框(controllerType有值就代表控制器的类型为单行文本框,defaultType:1:参数传入,2:固定值 )\n if (this.customDialog.conditionfield[_i3].controllerType && this.customDialog.conditionfield[_i3].defaultType == \"1\") {\n //参数传入填写了查询条件\n for (j = 0; j < param.querys.length; j++) {\n //判断为REST接口且请求类型是GET,条件字段是固定值的请求地址是否为空\n if (this.customDialogGetUrl != \"\") {\n this.customDialog.url = this.customDialogGetUrl; //赋值为REST接口且请求类型是GET,条件字段是固定值的请求地址\n } else {\n this.customDialogGetUrl = this.customDialog.url;\n } //判断请求地址是否带有 ?\n\n\n if (this.customDialog.url.indexOf(\"?\") == -1) {\n //无\n this.customDialog.url = this.customDialog.url + \"?\" + param.querys[j].property + \"=\" + param.querys[j].value;\n } else {\n //有\n this.customDialog.url = this.customDialog.url + \"&\" + param.querys[j].property + \"=\" + param.querys[j].value;\n }\n }\n }\n }\n } else {\n //判断为REST接口且请求类型是GET,条件字段是固定值的请求地址是否为空\n if (this.customDialogGetUrl != \"\") {\n this.customDialog.url = this.customDialogGetUrl; //赋值为REST接口且请求类型是GET,条件字段是固定值的请求地址\n }\n }\n\n queryUrl = this.customDialog.dsType == \"dataSource\" ? \"${form}/form/customDialog/v1/getListData?alias=\" + this.alias + \"&mapParam=\" : this.customDialog.url;\n requestMethod = \"POST\"; //如果自定义对话框列表查询数据不是数据源则请求方法为restful配置的请求方式\n\n if (this.customDialog.dsType != \"dataSource\") {\n requestMethod = this.customDialog.requestType;\n } //查询数据\n\n\n _context.next = 10;\n return req.request({\n url: queryUrl,\n method: requestMethod,\n data: param\n }).finally(function () {\n return cb && cb();\n });\n\n case 10:\n response = _context.sent;\n\n //如果数据来源是REST接口,且请求类型是GET\n if (this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"GET\") {\n this.tableData = response.data;\n this.nopagination = true; //隐藏分页组件\n } //如果数据来源是REST接口且请求类型是POST\n\n\n if (this.customDialog.dsType != \"dataSource\" && this.customDialog.requestType == \"POST\") {\n rows = response.data[this.customDialog.listKey];\n newRows = [];\n\n if (rows.length > 0) {\n _loop = function _loop(_i4) {\n var data = rows[_i4];\n var keys = Object.keys(data);\n var objRows = {};\n keys.forEach(function (key) {\n objRows[key.toLowerCase()] = data[key];\n });\n newRows.push(objRows);\n };\n\n for (_i4 = 0; _i4 < rows.length; _i4++) {\n _loop(_i4);\n }\n }\n\n if (newRows.length > 0) {\n this.tableData = newRows;\n } else {\n this.tableData = rows;\n } //如果有分页\n\n\n if (response.data[this.customDialog.pageKey]) {\n this.pageResult = {\n page: response.data[this.customDialog.pageKey],\n pageSize: response.data[this.customDialog.pageSizeKey],\n total: response.data[this.customDialog.totalKey]\n };\n this.nopagination = false; //显示分页组件\n } else {\n this.nopagination = true; //隐藏分页组件\n }\n } //如果数据来源是数据源\n\n\n if (this.customDialog.dsType == \"dataSource\") {\n if (response.data && response.data.rows) {\n this.tableData = response.data.rows; //如果有分页\n\n if (response.data.page) {\n this.pageResult = {\n page: response.data.page,\n pageSize: response.data.pageSize,\n total: response.data.total\n };\n this.nopagination = false; //显示分页组件\n } else {\n this.nopagination = true; //隐藏分页组件\n }\n } else {\n this.tableData = [];\n this.nopagination = true; //隐藏分页组件\n }\n }\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function loadData(_x, _x2) {\n return _loadData.apply(this, arguments);\n }\n\n return loadData;\n }(),\n //点击列表某一条数据时触发\n orgRowClick: function orgRowClick(row, column, event) {\n //是否单选 1:单选;-1:多选\n if (this.customDialog.selectNum === 1) {\n //选中单选按钮\n this.textRadio = event.currentTarget.children[0].children[0].children[0].__vue__.$refs.radio.value;\n this.selectionRadio = [row];\n this.$emit(\"orgRowClick\", row);\n } else {\n //点击列表数据选中复选框\n this.$refs.htTable.$refs.htTable.toggleRowSelection(row);\n }\n },\n afterOpen: function afterOpen() {\n //打开对话框之后加载树\n this.loadCombinationTree();\n },\n loadCombinationTree: function loadCombinationTree() {\n var _this = 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 _this.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 req.get(url).then(function (resp) {\n resp = resp.data;\n\n if (treeDialog.displayfield && treeDialog.resultfield) {\n var displayField = JSON.parse(treeDialog.displayfield);\n var resultfield = JSON.parse(treeDialog.resultfield);\n _this.defaultProps.label = displayField.displayName;\n _this.treeList = resp;\n _this.combiTreeDisplayField = displayField;\n _this.combinationTreeData = _this.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 } //this.search();\n\n\n this.loadData(this.queryParam);\n },\n //获取运算符号\n getOperation: function getOperation(old) {\n if (!old) {\n return \"\";\n } else if (old == \"EQ\") {\n return \"EQUAL\";\n } else if (old == \"EIC\") {\n return \"EQUAL_IGNORE_CASE\";\n } else if (old == \"LT\") {\n return \"LESS\";\n } else if (old == \"GT\") {\n return \"GREAT\";\n } else if (old == \"LE\") {\n return \"LESS_EQUAL\";\n } else if (old == \"GE\") {\n return \"GREAT_EQUAL\";\n } else if (old == \"NE\") {\n return \"NOT_EQUAL\";\n } else if (old == \"LK\") {\n return \"LIKE\";\n } else if (old == \"LFK\") {\n return \"LEFT_LIKE\";\n } else if (old == \"RHK\") {\n return \"RIGHT_LIKE\";\n } else if (old == \"ISNULL\") {\n return \"IS_NULL\";\n } else if (old == \"NOTNULL\") {\n return \"NOTNULL\";\n } else if (old == \"IN\") {\n return \"IN\";\n } else if (old == \"BETWEEN\") {\n return \"BETWEEN\";\n } else {\n return \"LIKE\";\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 loadTree: function loadTree(node, resolve) {\n var _this2 = 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 _this2.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 toTreeData: function toTreeData(data, id, pid, name, pvalue, returnStr) {\n // 建立个树形结构,需要定义个最顶层的父节点,pvalue是0\n // let ztree=translateDataToTree(data,pid,id,name);\n // function translateDataToTree(data,pid,id,name) {\n // //把树数据有子节点的数据全部过滤掉(只留父节点的数据)\n var parents = data.filter(function (value) {\n return value[id] == value[pid] || value[pid] == null || value[pid] == null || value[pid] == 0;\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 }\n};",null]}