{"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\\dataTemplate\\TemplateDynamicView.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\dataTemplate\\TemplateDynamicView.vue","mtime":1667804638821},{"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.array.from\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport _toConsumableArray from \"D:/jenkins/workspace/cssc-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/cssc-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _defineProperty from \"D:/jenkins/workspace/cssc-fvue/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.search\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.sort\";\nimport \"core-js/modules/es6.function.name\";\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\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//\nimport { Loading } from 'element-ui';\nimport HtCheckbox from '@/components/control/HtCheckbox.vue';\nimport HtDialog from '@/components/control/HtDialog.vue';\nimport HtDialogBtn from '@/components/control/htDialogBtn.vue';\nimport EipSelect from '@/components/eipControl/EipSelect.vue';\nimport VRuntimeTemplate from 'v-runtime-template';\nimport utils from '@/utils.js';\nimport { Base64 } from 'js-base64';\nimport Vue from 'vue';\nimport QRCode from 'qrcode';\nimport req from '@/request.js';\nimport form from '@/api/form.js';\nimport dialog from '@/api/dialogApi.js';\n\nvar TemplateBatchUpdateDialog = function TemplateBatchUpdateDialog() {\n return import('@/components/dialog/TemplateBatchUpdateDialog.vue');\n};\n\nexport default {\n name: 'template-dynamic-view',\n props: {\n templateKey: String,\n html: String,\n templateInfo: Object,\n parameterqQuerys: String,\n single: {\n default: 'true'\n },\n defKey: String,\n taskType: {\n default: ''\n },\n dataView: Object,\n isJoinFlow: {\n default: false\n }\n },\n data: function data() {\n return {\n refreshTime: new Date().getTime(),\n showDateView: true\n };\n },\n created: function created() {\n this.init();\n },\n watch: {\n html: function html(newVal) {\n if (newVal) {\n this.init();\n }\n }\n },\n methods: {\n init: function init() {\n Vue.component('ht-dataview-runtime-template', {\n template: this.html,\n props: {\n templateKey: String,\n templateInfo: Object,\n single: String,\n defKey: String,\n taskType: {\n default: ''\n },\n dataView: Object,\n isJoinFlow: {\n default: false\n },\n parameterqQuerys: String\n },\n data: function data() {\n return {\n treeQuerys: [],\n alias_new: 'statement',\n loading: false,\n QRCodeurl: '',\n QRCodeDialog: false,\n html: '',\n tableData: {\n selectRows: [],\n querys: ''\n },\n dialogExportVisible: false,\n exportData: {\n getType: 'all',\n expField: []\n },\n displayFields: [],\n exportSellection: [],\n searchForm: {\n F_xb: '',\n F_xm: ''\n },\n queryForm: {\n queryData: ''\n },\n formType: false,\n labelPosition: 'left',\n incons: 'el-icon-arrow-down',\n options: {\n fullscreen: true,\n lock: true\n },\n rowTemplateId: null,\n rowId: null,\n QRCodeShow: true,\n QRCodeDesc: [],\n tree: [],\n customDialog: [],\n tableHeight: 0.685 * window.innerHeight,\n dialogSubVisible: false,\n tabs: [],\n ents: [],\n modifyRecord: {\n pagination: {\n pageBean: {\n page: 1,\n pageSize: 10,\n total: 0\n }\n }\n },\n recordList: [],\n recordRefId: '',\n dialogRecordVisible: false,\n recordTableLoading: false,\n modifyDetailDialogVisible: false,\n currentModify: {},\n refId: '',\n querySubValue: '',\n subTableLoading: false,\n currentTabName: '',\n currentTab: {},\n exportType: 'main',\n subDisplayFields: [],\n subDisplayFieldsList: [],\n notPrint: false,\n displayField: {},\n treeList: [],\n rows: [],\n pagination: {\n page: 1,\n pageSize: 10\n },\n paginationLayout: 'total, sizes, prev, pager, next, jumper',\n total: 0,\n permission: {\n print: true,\n add: true,\n del: true,\n export: true,\n edit: true,\n hidden: false\n },\n showRightMenu: true,\n listSelectable: true,\n filters: {},\n sorter: null,\n dialogSunVisible: false,\n //孙表对话框\n sunTabs: [],\n //孙表数据\n querySunValue: '',\n operateColWidth: '240',\n summaryFields: [],\n dialogVisible: false,\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n logData: [],\n notSortableFields: ['bpm_status_', 'bpm_proc_inst_id_', 'bpm_subject_', 'bpm_proc_def_name_', 'bpm_create_time_', 'bpm_end_time_', 'bpm_is_forbidden_', 'bpm_creator_'],\n defaultValueList: [],\n //批量更新数据\n ignoredAlias: ['appCenterFront'],\n QRCodePattern: true,\n QRCodeType: '',\n isMobile: false,\n activeNames: ['1'],\n switchMap: {},\n filterMap: {}\n };\n },\n components: {\n VRuntimeTemplate: VRuntimeTemplate,\n HtCheckbox: HtCheckbox,\n HtDialog: HtDialog,\n HtDialogBtn: HtDialogBtn,\n TemplateBatchUpdateDialog: TemplateBatchUpdateDialog,\n EipSelect: EipSelect\n },\n watch: {\n ents: {\n handler: function handler(newVal, oldValue) {\n if (newVal && newVal.length >= 1 && newVal != oldValue) {\n this.getSubData(this, this.refId);\n }\n },\n deep: true,\n immediate: true\n },\n templateInfo: {\n handler: function handler(newVal, oldVal) {\n var _this = this;\n\n if (newVal && newVal.id) {\n var loading = this.$loading(this.options);\n\n var _me = this;\n\n _me.templateInfo = newVal;\n\n if (_me.templateInfo.displayField) {\n var displayField = utils.parseToJson(_me.templateInfo.displayField);\n\n for (var i = 0; i < displayField.length; i++) {\n if (displayField[i].type) {\n this.displayFields.push(displayField[i]);\n }\n }\n }\n\n if (_me.templateInfo.conditionField) {\n var conditionField = utils.parseToJson(_me.templateInfo.conditionField);\n\n for (var i = 0; i < conditionField.length; i++) {\n var fieldName = 'F_' + conditionField[i].name;\n this.$set(this.searchForm, fieldName, '');\n }\n }\n\n var params = {\n templateId: _me.templateInfo.id\n };\n var pageBean = {\n pageBean: {\n page: '1',\n pageSize: newVal.pageSize,\n showTotal: 'true'\n }\n }; //初次加载默认pageBean\n\n params.pagination = pageBean;\n\n if (_me.isJoinFlow) {\n params.isJoinFlow = true;\n params.taskType = _me.taskType;\n params.defKey = _me.defKey;\n }\n\n if (_me.dataView) {\n _me.handelBindFiledValua(); //关联查询字段\n\n\n if (_me.dataView.selectList && _me.dataView.selectList.length > 0) {\n params.selectList = _me.dataView.selectList;\n }\n\n params.refIdValue = _me.dataView.refIdValue;\n }\n\n if (this.parameterqQuerys) {\n var querys = JSON.parse(Base64.decode(decodeURIComponent(this.parameterqQuerys)));\n params.pagination.querys = querys;\n }\n\n var defaultQuery = this.buildDefaultQuerys();\n\n if (defaultQuery.length > 0) {\n if (params.pagination.querys) {\n params.pagination.querys.concat(defaultQuery);\n } else {\n params.pagination.querys = defaultQuery;\n }\n } //如果有设置默认排序,优先使用默认排序\n\n\n if (this.templateInfo.sortField) {\n var sortField = JSON.parse(this.templateInfo.sortField);\n var sorter = [];\n\n for (var x = 0; x < sortField.length; x++) {\n sorter.push({\n 'property': sortField[x].name,\n 'direction': sortField[x].sort\n });\n }\n\n params.pagination.sorter = sorter;\n }\n\n var this_ = this;\n\n if (params.templateId) {\n this.$store.dispatch('form/getBpmTemplateByPagination', params).then(function (response) {\n this_.rows = response.data.rows;\n this_.total = response.data.total;\n this_.pagination.page = response.data.page;\n this_.pagination.pageSize = response.data.pageSize;\n loading.close();\n this_.initSwitchStatus();\n\n if (this_.$el && this_.$el.querySelector) {\n var topBtnDom = this_.$el.querySelector('div.top_btn_col');\n\n if (!topBtnDom || !topBtnDom.querySelector('i.el-icon-delete') && !topBtnDom.querySelector('i.el-icon-edit') && !topBtnDom.querySelector('i.el-icon-s-grid')) {\n this_.listSelectable = false;\n }\n\n setTimeout(function () {\n var tdDom = this_.$el.querySelector('td.right_menu');\n\n if (!tdDom || !tdDom.querySelector('button') && tdDom.querySelector('switch')) {\n this_.showRightMenu = false;\n }\n }, 200);\n }\n });\n } else {\n loading.close();\n }\n\n if (newVal.treeField && newVal.treeField !== '{}') {\n var treeField = JSON.parse(newVal.treeField);\n this.initTree(treeField);\n form.getSubEntsByFormKey(this.templateInfo.formKey, function (resp) {\n resp.data.forEach(function (item) {\n var subDisplayFields = [];\n item.attributeList.forEach(function (attr) {\n subDisplayFields.push({\n desc: attr.comment,\n name: attr.fieldName,\n type: attr.columnType\n });\n });\n\n _this.subDisplayFields.push({\n fields: subDisplayFields,\n name: item.name,\n comment: item.comment\n });\n });\n });\n }\n\n if (newVal.summaryField) {\n this.summaryFields = JSON.parse(newVal.summaryField);\n }\n }\n },\n deep: true,\n immediate: true\n },\n currentTabName: function currentTabName(newVal) {\n if (newVal) {\n this.querySubValue = '';\n }\n }\n },\n computed: {\n showDraftList: function showDraftList() {\n //如果当前页面被嵌入iframe里面不显示草稿\n return window.self === window.top;\n }\n },\n mounted: function mounted() {\n this.handelBindFiledValua();\n var this_ = this;\n this.$root.$on('form-reload-success', function () {\n this_.handelBindFiledValua();\n });\n this.$emit(\"afterMounted\");\n },\n methods: {\n loadData: function loadData(param, cb) {\n var _this2 = this;\n\n var querys = param.querys || [];\n var hasDefaultQuery = false;\n this.handelBindFiledValua();\n var pID = this.dataView.refIdValue;\n querys.forEach(function (q) {\n if (q.property == 'PId') {\n hasDefaultQuery = true;\n }\n });\n\n if (!hasDefaultQuery) {\n querys.push({\n operation: 'EQUAL',\n group: 'defalut',\n property: 'PId',\n relation: 'AND',\n value: pID\n });\n querys.push({\n operation: 'EQUAL',\n group: 'defalut',\n property: 'boAlias',\n relation: 'AND',\n value: this.templateInfo.boDefAlias\n });\n }\n\n param.querys = querys;\n req.post(window.context.form + '/form/formDataImportLog/v1/listJson', param).then(function (data) {\n var response = data.data;\n _this2.logData = response.rows;\n _this2.pageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n }).finally(function () {\n return cb();\n });\n },\n handelBindFiledValua: function handelBindFiledValua() {\n //数据视图控件\n var _me = this;\n\n if (this.dataView) {\n var pInst = utils.getOnlineFormInstance(this.$parent.$parent.$parent.$parent);\n\n if (!pInst[this.dataView.boDefAlias]) {\n this.dataView.boDefAlias = Object.keys(pInst.data)[0];\n }\n\n var refIdValue = utils.getValueByPath(pInst, 'data.' + this.dataView.boDefAlias + '.id_');\n\n if (sessionStorage.getItem('formImportTempRefId') && !refIdValue) {\n refIdValue = sessionStorage.getItem('formImportTempRefId');\n } else if (!refIdValue) {\n //导入的时候没有关键的外键,则为其自动添加\n refIdValue = new Date().getTime();\n sessionStorage.setItem('formImportTempRefId', refIdValue);\n }\n\n _me.dataView.refIdValue = refIdValue;\n\n if (pInst.permission && pInst.permission.table && pInst.permission.table[this.templateInfo.boDefAlias]) {\n this.permission = pInst.permission.table[this.templateInfo.boDefAlias];\n }\n\n if (this.permission.hidden) {\n this.$parent.showDateView = false;\n } //关联查询字段\n\n\n var selectList = this.dataView.selectList;\n\n if (selectList && selectList.length > 0) {\n for (var i = 0; i < selectList.length; i++) {\n if (selectList[i].selectField) {\n var path = 'data.' + this.dataView.boDefAlias + '.' + selectList[i].selectField;\n var value = utils.getValueByPath(pInst, path);\n selectList[i].selectValue = value; //添加监听\n\n pInst.$watch(path, function (newVal, oldVal) {\n // 监听中使用间隔请求,减少请求次数\n clearTimeout(this.timeout);\n this.timeout = setTimeout(function () {\n if (newVal !== oldVal) {\n //_me.setDataViewValue(_me.dataView);\n _me.search();\n }\n }, 500);\n });\n }\n }\n } //关联填充字段\n\n\n var bindList = this.dataView.bindList;\n\n if (bindList && bindList.length > 0) {\n for (var i = 0; i < bindList.length; i++) {\n if (bindList[i].fillField) {\n var _path = 'data.' + this.dataView.boDefAlias + '.' + bindList[i].fillField;\n\n var _value = utils.getValueByPath(pInst, _path);\n\n bindList[i].fillValue = _value;\n pInst.$watch(_path, function (newVal, oldVal) {\n // 监听中使用间隔请求,减少请求次数\n clearTimeout(this.timeout);\n this.timeout = setTimeout(function () {\n if (newVal !== oldVal) {\n //_me.setDataViewValue(_me.dataView);\n _me.search();\n }\n }, 500);\n });\n }\n }\n }\n }\n },\n printList: function printList() {\n var _this3 = this;\n\n this.notPrint = true;\n setTimeout(function () {\n document.body.innerHTML = document.getElementById('printData').innerHTML;\n window.print();\n location.reload();\n }, 200);\n setTimeout(function () {\n _this3.notPrint = false;\n }, 200);\n },\n printDetail: function printDetail(templateId, id, action) {\n //数据随机添加到其他菜单下面时获取当前菜单的别名\n if (sessionStorage.menu_alias) {\n this.alias_new = sessionStorage.menu_alias;\n }\n\n var url = '/' + this.alias_new + '/template/form/' + this.templateKey + '/' + action + '/true';\n\n if (id) {\n url = url + '?id=' + id + '&';\n } else {\n url += '?';\n }\n\n var startFlowStr = 'startFlow=false';\n var path = url + startFlowStr;\n\n if (path.indexOf('othermenu') != -1) {\n path = path.replace('/othermenu', '/statement');\n }\n\n this.$router.push({\n path: path,\n query: {\n isPrint: true\n }\n });\n },\n complete: function complete(row, taskType) {\n var _this4 = this;\n\n if (taskType == 'todo') {\n var url = window.context.bpmRunTime + '/runtime/task/v1/getBpmTaskByInstId?instId=' + row.bpm_proc_inst_id_;\n req.get(url).then(function (res) {\n if (res.data.length == 0) {\n _this4.$message.error('此任务已被处理或不存在!');\n } else if (res.data.length == 1) {\n _this4.$router.push(\"/reportModuleInst/\" + res.data[0].id + \"/0\" + \"/\" + _this4.defKey + \"/true/\" + _this4.templateKey);\n } else {\n _this4.$message.error('暂不支持!');\n }\n });\n } else if (taskType == \"done\") {\n this.$router.push('/reportModuleInstDone/' + row.bpm_proc_inst_id_ + '/doneList/' + this.defKey + '/' + this.templateKey);\n } else if (taskType == \"request\") {\n this.$router.push('/reportModuleInstDone/' + row.bpm_proc_inst_id_ + '/request/' + this.defKey + '/' + this.templateKey);\n } else if (taskType == \"todoRead\") {\n var pageBean = {\n \"page\": 1,\n \"pageSize\": 10,\n \"showTotal\": \"true\"\n };\n var status = row.bpm_status_;\n req.post('${bpmRunTime}/runtime/task/v1/getNoticeTodoReadList', {\n pageBean: pageBean,\n querys: [{\n property: \"proc_inst_id_\",\n value: row.bpm_proc_inst_id_,\n operation: 'EQUAL',\n relation: 'AND'\n }]\n }).then(function (response) {\n if (response.data.rows && response.data.rows.length > 0) {\n var id = response.data.rows[0].id;\n var _url = \"\";\n 7;\n\n if (status == 'FOLLOW') {\n _url = '/reportModuleInstTaskRead/' + id + '/FOLLOW/' + _this4.defKey + '/' + _this4.templateKey;\n } else if (status == 'COMMU') {\n _url = '/reportModuleInst/' + id + '/0/' + _this4.defKey + '/true/' + _this4.templateKey;\n } else {\n _url = '/reportModuleInstRead/' + row.bpm_proc_inst_id_ + '/read/' + id + '/' + _this4.defKey + \"/\" + _this4.templateKey;\n }\n\n _this4.$router.push(_url);\n }\n });\n } else if (taskType == \"doneRead\") {\n var _pageBean = {\n \"page\": 1,\n \"pageSize\": 10,\n \"showTotal\": \"true\"\n };\n req.post('${bpmRunTime}/runtime/task/v1/getNoticeDoneReadList', {\n pageBean: _pageBean,\n querys: [{\n property: \"proc_inst_id_\",\n value: row.bpm_proc_inst_id_,\n operation: 'EQUAL',\n relation: 'AND'\n }]\n }).then(function (response) {\n if (response.data.rows && response.data.rows.length > 0) {\n var id = response.data.rows[0].id;\n\n _this4.$router.push('/reportModuleInstDone/' + row.bpm_proc_inst_id_ + '/read/done/' + id + '/' + _this4.defKey + \"/\" + _this4.templateKey);\n }\n });\n } else if (taskType == \"myRead\") {\n var _pageBean2 = {\n \"page\": 1,\n \"pageSize\": 10,\n \"showTotal\": \"true\"\n };\n req.post('${bpmRunTime}/runtime/task/v1/getMyNoticeReadList', {\n pageBean: _pageBean2,\n querys: [{\n property: \"proc_inst_id_\",\n value: row.bpm_proc_inst_id_,\n operation: 'EQUAL',\n relation: 'AND'\n }]\n }).then(function (response) {\n if (response.data.rows && response.data.rows.length > 0) {\n var id = response.data.rows[0].id;\n\n _this4.$router.push('/reportModuleInstMyRead/' + row.bpm_proc_inst_id_ + '/' + id + '/myRead/' + _this4.defKey + \"/\" + _this4.templateKey);\n }\n });\n } else if (taskType == \"myDelegate\") {\n this.$router.push('/reportModuleInstRead/' + row.bpm_proc_inst_id_ + '/delegate/' + this.defKey + \"/\" + this.templateKey);\n }\n },\n //下载全部选中的二维码\n downloadAllQRCode: function downloadAllQRCode(templateId, mobileFormAlias, display, pkField, QRCodePattern) {\n var _this5 = this;\n\n this.QRCodePattern = QRCodePattern;\n var _selectData = this.$refs.multipleTemplateTable.selection;\n\n if (_selectData.length === 0) {\n this.$message.error('请至少选中一条数据!');\n return;\n }\n\n this.loading = true;\n var account = Base64.encode(this.$store.state.login.currentUser.account);\n var token = this.$store.state.login.currentUser.token;\n var mobile = window.context.mobile;\n var QRCodeurl = '';\n var zip = new JSZip(); // 创建一个名为images的新的文件目录\n\n var img = zip.folder('images');\n var plist = [];\n\n for (var x = 0; x < _selectData.length; x++) {\n if (this.QRCodePattern) {\n QRCodeurl = mobile + '/QRCodeForm/' + this.templateKey + '/get' + '?id=' + _selectData[x][pkField] + '&token=' + token;\n } else {\n QRCodeurl = mobile + '/QRCodeForm/' + this.templateKey + '/edit' + '?id=' + _selectData[x][pkField];\n }\n\n var msg = document.createElement('canvas');\n QRCode.toCanvas(msg, QRCodeurl, function (error) {\n console.log(error);\n });\n\n var _canvas = document.createElement('div');\n\n _canvas.setAttribute('id', 'QRCodeAndDescAll' + x);\n\n _canvas.setAttribute('style', 'text-align:center;width:' + msg.width + 'px;');\n\n _canvas.appendChild(msg); //创建底部的描述信息\n\n\n for (var Y = 0; Y < display.length; Y++) {\n var item = JSON.parse(display[Y]);\n\n if (_selectData[x][item.name]) {\n var desc = document.createElement('div');\n desc.innerHTML = item.desc + ':' + _selectData[x][item.name];\n\n _canvas.appendChild(desc);\n }\n }\n\n document.getElementById('QRCodeAndDescAll').appendChild(_canvas);\n plist.push(this.downloadQRCodeAndDesc('#QRCodeAndDescAll' + x, _canvas));\n }\n\n Promise.all(plist).then(function (result) {\n document.getElementById('QRCodeAndDescAll').innerHTML = '';\n\n for (var _x = 0; _x < result.length; _x++) {\n var canvas = result[_x];\n var image = canvas.toDataURL().split(';base64,')[1]; // 这个images文件目录中创建一个base64数据为imgData的图像,图像名是smile.gif\n\n img.file(_x + '.png', image, {\n base64: true\n });\n } // 把打包内容异步转成blob二进制格式\n\n\n zip.generateAsync({\n type: 'blob'\n }).then(function (content) {\n var eleLink = document.createElement('a');\n eleLink.download = '二维码.zip';\n eleLink.style.display = 'none'; // 下载内容转变成blob地址\n\n eleLink.href = URL.createObjectURL(content); // 触发点击\n\n document.body.appendChild(eleLink);\n eleLink.click(); // 然后移除\n\n document.body.removeChild(eleLink);\n });\n _this5.loading = false;\n });\n },\n onCopy: function onCopy(e) {\n this.$message.success('内容已复制到剪切板!');\n },\n // 复制失败时的回调函数\n onError: function onError(e) {\n this.$message.error('抱歉,复制失败!');\n },\n downloadQRCode: function downloadQRCode() {\n var plist = [];\n\n var _canvas = document.querySelector('#QRCodeAndDesc');\n\n plist.push(this.downloadQRCodeAndDesc('#QRCodeAndDesc', _canvas));\n Promise.all(plist).then(function (result) {\n var canvas = result[0];\n var link = document.createElement('a');\n link.href = canvas.toDataURL(); //下载链接\n\n link.setAttribute('download', '二维码.jpg');\n link.style.display = 'none'; //a标签隐藏\n\n document.body.appendChild(link);\n link.click();\n });\n },\n //把二维码与二维码说明一起下载成图片\n downloadQRCodeAndDesc: function downloadQRCodeAndDesc(classs, _canvas) {\n var p2 = new Promise(function (resolve, reject) {\n var canvas2 = document.createElement('canvas');\n var w = parseInt(window.getComputedStyle(_canvas).width);\n var h = parseInt(window.getComputedStyle(_canvas).height); //将canvas画布放大若干倍,然后盛放在较小的容器内,就显得不模糊了\n\n canvas2.width = w * 2;\n canvas2.height = h * 2;\n canvas2.style.width = w + 'px';\n canvas2.style.height = h + 'px'; //可以按照自己的需求,对context的参数修改,translate指的是偏移量\n\n var context = canvas2.getContext('2d');\n context.scale(2, 2);\n return html2canvas(document.querySelector(classs), {\n canvas: canvas2\n }).then(function (canvas) {\n resolve(canvas);\n });\n });\n return p2;\n },\n QRCodeDialogClose: function QRCodeDialogClose() {\n this.QRCodeType = '';\n this.QRCodeDialog = false;\n },\n foundQRCode: function foundQRCode() {\n /*this.QRCodeurl =\r\n window.context.front +\r\n \"/QRCodeForm/\" +\r\n this.templateKey +\r\n \"/get\" +\r\n \"?id=\" +\r\n this.rowId +\r\n \"&token=\" +\r\n this.$store.state.login.currentUser.token;*/\n if (this.QRCodeType == 'add') {\n var isStartFlow = this.templateInfo.defId ? 'true' : 'false';\n this.QRCodeurl = req.getContext().mobile + '/template/form/' + this.templateKey + '/add/?startFlow=' + isStartFlow;\n\n if (this.QRCodePattern) {\n var token = this.$store.state.login.currentUser.token;\n this.QRCodeurl += '&token=' + token;\n }\n } else {\n //不论需不需要登录,访问的都是明细页面\n if (this.QRCodePattern) {\n //免登录\n this.QRCodeurl = req.getContext().mobile + '/QRCodeForm/' + this.templateKey + '/get?id=' + this.rowId + '&token=' + this.$store.state.login.currentUser.token;\n } else {\n //需要登录\n this.QRCodeurl = req.getContext().mobile + '/QRCodeForm/' + this.templateKey + '/get?id=' + this.rowId;\n }\n } // Base64.encode(this.$store.state.login.currentUser.account);\n\n\n var msg = document.getElementById('QRCode');\n QRCode.toCanvas(msg, this.QRCodeurl, function (error) {\n console.log(error);\n });\n this.QRCodeShow = true;\n },\n getQRCode: function getQRCode(templateId, id, mobileFormAlias, display, index, QRCodePattern) {\n this.QRCodePattern = QRCodePattern;\n this.QRCodeDesc = [];\n\n for (var x = 0; x < display.length; x++) {\n var item = JSON.parse(display[x]);\n\n if (this.rows[index][item.name]) {\n this.QRCodeDesc.push(item.desc + ':' + this.rows[index][item.name]);\n }\n }\n\n this.mobileFormAlias = mobileFormAlias;\n this.QRCodeShow = false;\n this.QRCodeDialog = true;\n this.rowTemplateId = templateId;\n this.rowId = id;\n },\n handleSizeChange: function handleSizeChange(size) {\n //每页下拉显示数据\n this.pagination.pageSize = size;\n this.search();\n },\n handleCurrentChange: function handleCurrentChange(currentPage) {\n //点击第几页\n this.pagination.page = currentPage;\n this.search();\n },\n getParam: function getParam() {\n var params = {};\n\n if (str == 'find') {\n // this.$store.dispatch(\"form/setBpmTemplatePaginationPageNum\", 1);\n this.pagination.page = 1;\n } //判断为合并查询还是分开查询\n\n\n if (this.formType) {\n params = this.getQueryFilter();\n } else {\n //判断是否配置了合并查询\n if ($('.search-query').length > 0) {\n params = this.getConditionQuery();\n } else {\n params = this.getQueryFilter();\n }\n }\n\n if (params.pagination && params.pagination && params.pagination.querys) {\n var tempQueryS = [];\n var betweenConditions = {};\n params.pagination.querys.forEach(function (q) {\n if (q.value && (q.operation != 'BETWEEN' || q.value.constructor == Array)) {\n tempQueryS.push(q);\n } else if (q.value) {\n var conditions = q;\n\n if (betweenConditions[q.property]) {\n conditions = betweenConditions[q.property];\n conditions.value = [conditions.value];\n conditions.value.push(q.value);\n }\n\n betweenConditions[q.property] = conditions;\n }\n });\n\n for (var key in betweenConditions) {\n tempQueryS.push(betweenConditions[key]);\n }\n\n params.pagination.querys = tempQueryS;\n }\n\n return params;\n },\n search: function search(str) {\n var loading = this.$loading(this.options);\n var params = {};\n\n if (str == 'find') {\n // this.$store.dispatch(\"form/setBpmTemplatePaginationPageNum\", 1);\n this.pagination.page = 1;\n } //判断为合并查询还是分开查询\n\n\n if (this.formType) {\n params = this.getQueryFilter();\n } else {\n //判断是否配置了合并查询\n if ($('.search-query').length > 0) {\n params = this.getConditionQuery();\n } else {\n params = this.getQueryFilter();\n }\n }\n\n if (params.pagination && params.pagination.querys) {\n var tempQueryS = [];\n var betweenConditions = {};\n params.pagination.querys.forEach(function (q) {\n if (q.value && (q.operation != 'BETWEEN' || q.value.constructor == Array)) {\n tempQueryS.push(q);\n } else if (q.value) {\n var conditions = q;\n\n if (betweenConditions[q.property]) {\n conditions = betweenConditions[q.property];\n conditions.value = [conditions.value];\n conditions.value.push(q.value);\n }\n\n betweenConditions[q.property] = conditions;\n }\n });\n\n for (var key in betweenConditions) {\n tempQueryS.push(betweenConditions[key]);\n }\n\n params.pagination.querys = tempQueryS;\n params.pagination.querys = params.pagination.querys ? params.pagination.querys.concat(this.treeQuerys) : this.treeQuerys;\n } //把过滤树的条件也拼接进去\n\n\n if (this.treeQuerys && this.treeQuerys.length > 0) {\n params.pagination.querys = params.pagination.querys ? params.pagination.querys.concat(this.treeQuerys) : this.treeQuerys;\n } //数据视图控件\n\n\n if (this.dataView) {\n this.handelBindFiledValua();\n params.refIdValue = this.dataView.refIdValue; //关联查询字段\n\n if (this.dataView.selectList && this.dataView.selectList.length > 0) {\n params.selectList = this.dataView.selectList;\n }\n }\n\n var this_ = this;\n\n if (this_.isJoinFlow) {\n params.isJoinFlow = true;\n params.taskType = this_.taskType;\n params.defKey = this_.defKey;\n }\n\n if ($.isEmptyObject(this.searchForm)) {\n this.$store.dispatch('form/getBpmTemplateByPagination', params).then(function (response) {\n this_.rows = response.data.rows;\n this_.total = response.data.total;\n this_.pagination.page = response.data.page;\n this_.pagination.pageSize = response.data.pageSize;\n loading.close();\n });\n } else {\n this.$store.dispatch('form/getBpmTemplateByPagination', params).then(function (response) {\n this_.rows = response.data.rows;\n this_.total = response.data.total;\n this_.pagination.page = response.data.page;\n this_.pagination.pageSize = response.data.pageSize;\n loading.close();\n });\n }\n },\n getQueryFilter: function getQueryFilter() {\n var _this6 = this;\n\n var operationMap = this.getSearchItems();\n var fieldTypeMap = this.getFieldType();\n var specialMap = this.getSpecialMap();\n var querys = []; //查询条件\n\n var queryFilter = {};\n var pageBean = {\n pageBean: this.pagination\n };\n var params = {\n templateId: this.templateInfo.id\n };\n params.pagination = pageBean;\n\n if ($.isEmptyObject(this.searchForm)) {\n return params;\n } else {\n var _loop = function _loop(key) {\n if (typeof _this6.searchForm[key] != 'undefined' && _this6.searchForm[key] != '' && _this6.searchForm[key] != null) {\n if (_this6.searchForm[key] instanceof Array) {\n for (var i = 0; i < _this6.searchForm[key].length; i++) {\n querys.push({\n property: key,\n value: _this6.searchForm[key][i],\n group: 'main',\n operation: operationMap[key],\n relation: 'AND'\n });\n }\n } else if (_this6.searchForm[key].includes(',') && !specialMap[key]) {\n var arr = _this6.searchForm[key].split(',');\n\n arr.forEach(function (v) {\n querys.push({\n property: key,\n value: v,\n group: 'main',\n operation: operationMap[key],\n relation: 'AND'\n });\n });\n } else {\n var value = _this6.searchForm[key]; //整数类型\n\n if (fieldTypeMap[key] && fieldTypeMap[key] == 'number') {\n value = parseFloat(_this6.searchForm[key]);\n }\n\n querys.push({\n property: key,\n value: value,\n group: 'main',\n operation: operationMap[key],\n relation: 'AND'\n });\n }\n }\n };\n\n for (var key in this.searchForm) {\n _loop(key);\n }\n\n this.clearQueryByGroupName(querys, 'filter'); // 将过滤条件添加查询参数数组中\n\n if (this.filters && Object.keys(this.filters).length > 0) {\n var prefix = this.templateInfo.isExternal === 1 ? \"\" : \"F_\";\n Object.keys(this.filters).forEach(function (k) {\n var filter = _this6.filters[k];\n var query = {\n property: prefix + k,\n value: filter[0],\n group: 'filter',\n relation: 'AND'\n };\n\n if (filter.length == 1) {\n query.operation = 'EQUAL';\n querys.push(query);\n } else if (filter.length > 1) {\n query.operation = 'IN';\n query.value = filter;\n querys.push(query);\n }\n });\n }\n\n queryFilter = {\n pageBean: this.pagination,\n querys: querys\n }; //如果有设置默认排序,优先使用默认排序\n\n if (this.templateInfo.sortField) {\n var sortField = JSON.parse(this.templateInfo.sortField);\n var sorter = [];\n\n for (var x = 0; x < sortField.length; x++) {\n sorter.push({\n 'property': sortField[x].name,\n 'direction': sortField[x].sort\n });\n }\n\n queryFilter.sorter = sorter;\n }\n\n if (this.sorter && this.sorter.length > 0) {\n queryFilter.sorter = this.sorter;\n }\n\n params.pagination = queryFilter;\n return params;\n }\n },\n // 通过分组名称清除对应查询条件\n clearQueryByGroupName: function clearQueryByGroupName(querys, groupName) {\n // 待删除的查询条件\n var toDelete = [];\n querys && querys.forEach(function (query) {\n if (query.group == groupName) {\n toDelete.push(query);\n }\n });\n toDelete.forEach(function (d) {\n querys.remove(d);\n });\n },\n handleSortChange: function handleSortChange(column) {\n if (!column.order) {\n this.sorter = null;\n } else {\n this.sorter = [{\n property: column.prop,\n direction: column.order == 'ascending' ? 'ASC' : 'DESC'\n }];\n }\n\n this.search();\n },\n handleFilterChange: function handleFilterChange(m) {\n var _this7 = this;\n\n this.filters = _objectSpread(_objectSpread({}, this.filters), m);\n Object.keys(this.filters).forEach(function (k) {\n if (!_this7.filters[k] || _this7.filters[k].length == 0) {\n delete _this7.filters[k];\n }\n });\n this.search();\n },\n getSearchItems: function getSearchItems() {\n var searchItems = $('.search-item');\n var operationMap = {};\n var operationType = {\n like: 'LIKE',\n equal: 'EQUAL',\n between: 'BETWEEN',\n left_like: 'LEFT_LIKE',\n right_like: 'RIGHT_LIKE'\n };\n\n if (searchItems) {\n for (var i = 0; i < searchItems.length; i++) {\n var operation = '=';\n\n if (typeof $(searchItems[i]).attr('ht-query') != 'undefined') {\n operation = $(searchItems[i]).attr('operation');\n operationMap[$(searchItems[i]).attr('ht-query')] = typeof operationType[operation] != 'undefined' ? operationType[operation] : operation;\n } else if (typeof $(searchItems[i]).children().attr('ht-query') != 'undefined') {\n operation = $(searchItems[i]).children().attr('operation');\n operationMap[$(searchItems[i]).children().attr('ht-query')] = typeof operationType[operation] != 'undefined' ? operationType[operation] : operation;\n }\n }\n }\n\n return operationMap;\n },\n getFieldType: function getFieldType() {\n var searchItems = $('.search-item');\n var operationMap = {};\n var operationType = {\n number: 'number',\n text: 'text'\n };\n\n if (searchItems) {\n for (var i = 0; i < searchItems.length; i++) {\n var operation = '=';\n\n if (typeof $(searchItems[i]).attr('ht-query') != 'undefined') {\n operation = $(searchItems[i]).attr('type');\n operationMap[$(searchItems[i]).attr('ht-query')] = typeof operationType[operation] != 'undefined' ? operationType[operation] : operation;\n } else if (typeof $(searchItems[i]).children().attr('ht-query') != 'undefined') {\n operation = $(searchItems[i]).children().attr('type');\n operationMap[$(searchItems[i]).children().attr('ht-query')] = typeof operationType[operation] != 'undefined' ? operationType[operation] : operation;\n }\n }\n }\n\n return operationMap;\n },\n //获取特殊查询情况(自定义对话框)\n getSpecialMap: function getSpecialMap() {\n var searchItems = $(\".search-item\");\n var fieldQueryMap = {}; //查询条件字段\n\n if (searchItems) {\n for (var i = 0; i < searchItems.length; i++) {\n if (typeof $(searchItems[i]).attr(\"ht-query\") != \"undefined\") {\n //查询条件字段\n fieldQueryMap[$(searchItems[i]).attr(\"ht-query\")] = typeof $(searchItems[i]).attr(\"special-query\") != \"undefined\" ? true : false;\n } else if (typeof $(searchItems[i]).children().attr(\"ht-query\") != \"undefined\") {\n //查询条件字段\n fieldQueryMap[$(searchItems[i]).children().attr(\"ht-query\")] = typeof $(searchItems[i]).children().attr(\"special-query\") != \"undefined\" ? true : false;\n }\n }\n }\n\n return fieldQueryMap;\n },\n getConditionQuery: function getConditionQuery() {\n var _this8 = this;\n\n var searchAll = $('.search-query');\n var values = '';\n var querys = []; //查询条件\n\n var queryFilter = {};\n var pageBean = {\n pageBean: this.pagination\n };\n var params = {\n templateId: this.templateInfo.id\n };\n params.pagination = pageBean; // 将过滤条件添加查询参数数组中\n\n if (this.filters && Object.keys(this.filters).length > 0) {\n var prefix = this.templateInfo.isExternal === 1 ? \"\" : \"F_\";\n Object.keys(this.filters).forEach(function (k) {\n var filter = _this8.filters[k];\n var query = {\n property: prefix + k,\n value: filter[0],\n group: 'filter',\n relation: 'AND'\n };\n\n if (filter.length == 1) {\n query.operation = 'EQUAL';\n querys.push(query);\n } else if (filter.length > 1) {\n query.operation = 'IN';\n query.value = filter;\n querys.push(query);\n }\n });\n }\n\n if (this.queryForm.queryData == '') {\n queryFilter = {\n pageBean: this.pagination,\n querys: querys\n };\n params.pagination = queryFilter;\n return params;\n } else {\n if (typeof $($(searchAll[0]).children()[0]).attr('ht-quick-search') != 'undefined') {\n values = $($(searchAll[0]).children()[0]).attr('ht-quick-search');\n var arr = values.split(',');\n\n var _iterator = _createForOfIteratorHelper(arr),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var value = _step.value;\n querys.push({\n property: value,\n value: this.queryForm.queryData,\n group: 'main',\n operation: 'LIKE',\n relation: 'OR'\n });\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }\n\n queryFilter = {\n pageBean: this.pagination,\n querys: querys\n };\n params.pagination = queryFilter;\n return params;\n },\n //打开高级检索\n advanced: function advanced() {\n this.formType = !this.formType;\n\n if (this.formType) {\n this.incons = 'el-icon-arrow-up';\n this.queryForm.queryData = '';\n } else {\n this.incons = 'el-icon-arrow-down';\n this.searchForm = {};\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('find');\n }\n },\n reset: function reset(flag) {\n this.queryForm.queryData = '';\n\n if (this.templateInfo.conditionField) {\n var conditionField = utils.parseToJson(this.templateInfo.conditionField);\n\n for (var i = 0; i < conditionField.length; i++) {\n var fieldName = 'F_' + conditionField[i].name;\n this.$set(this.searchForm, fieldName, '');\n this.$set(this.searchForm, conditionField[i].name, '');\n }\n }\n\n this.filters = {};\n this.$refs.multipleTemplateTable.clearFilter();\n\n if (!flag) {\n this.search('find');\n }\n },\n handleSelectionChange: function handleSelectionChange(val) {\n this.tableData.selectRows = val;\n },\n deleted: function deleted() {\n var _this9 = this;\n\n if (this.tableData.selectRows == null || this.tableData.selectRows.length == 0) {\n this.$message.warning('请选择文件删除!');\n return false;\n }\n\n this.$confirm('此操作将删除该文件, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n var s = [];\n\n for (var i = 0; i < _this9.tableData.selectRows.length; i++) {\n s.push(_this9.tableData.selectRows[i][_this9.templateInfo.pkField]);\n }\n\n var data = {\n ids: s.join(','),\n boAlias: _this9.templateInfo.boDefAlias\n };\n\n _this9.$store.dispatch('form/deleteTemplateDataById', data).then(function () {\n _this9.pagination.page = 1;\n\n _this9.search();\n });\n }).catch(function () {\n _this9.$message({\n type: 'info',\n message: '已取消删除'\n });\n });\n },\n del: function del(id) {\n var _this10 = this;\n\n this.$confirm('此操作将删除该数据, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n var data = {\n ids: id,\n boAlias: _this10.templateInfo.boDefAlias\n };\n\n _this10.$store.dispatch('form/deleteTemplateDataById', data).then(function () {\n _this10.pagination.page = 1;\n\n _this10.search();\n });\n }).catch(function () {\n _this10.$message({\n type: 'info',\n message: '已取消删除'\n });\n });\n },\n operating: function operating(templateId, id, action, defId, isStartFlow, openType) {\n //isStartFlow (false:可以发起流程,true:不可以发起流程)\n if (this.templateInfo.manageField && !isStartFlow) {\n //先配置不能发起流程\n if (action == \"add\" && isStartFlow == \"\") {\n isStartFlow = true;\n }\n\n if (action == \"edit\" && isStartFlow === false) {\n isStartFlow = true;\n } //再判断是否可以发起流程\n\n\n var manageField = JSON.parse(this.templateInfo.manageField); //判断是否配置了发起流程按钮\n\n for (var k = 0; k < manageField.length; k++) {\n if (action == \"add\" && manageField[k].name == \"startFlow\") {\n isStartFlow = false;\n break;\n } else if (action == \"edit\" && manageField[k].name == \"startFlow\") {\n isStartFlow = false;\n break;\n }\n }\n }\n\n if (!templateId) {\n templateId = this.templateInfo.id;\n action = action == 'select' ? 'get' : 'add';\n } //数据视图随机添加到其他菜单下面时获取当前菜单的别名 并且当前数据视图不是表单里的数据视图 dataView\n\n\n if (sessionStorage.menu_alias && !this.dataView && !this.ignoredAlias.includes(sessionStorage.menu_alias)) {\n this.alias_new = sessionStorage.menu_alias;\n }\n\n var url = '/' + this.alias_new + '/template/form/' + this.templateKey + '/' + action;\n\n if (this.isJoinFlow) {\n this.alias_new = \"statement\";\n }\n\n if (this.single == 'true') {\n url = '/' + this.alias_new + '/template/form/' + this.templateKey + '/' + action + '/true';\n } //判断数据视图控件\n\n\n var isDataView = false;\n\n if (this.dataView) {\n if (this.dataView.boDefAlias && this.dataView.boDefAlias != \"\") {\n isDataView = true;\n }\n }\n\n if (openType == \"new\" || this.isJoinFlow || isDataView) {\n url += \"/new\";\n }\n\n if (id) {\n url = url + '?id=' + id + '&';\n } else {\n url += '?';\n }\n\n var startFlowStr = 'startFlow=false';\n\n if (action == 'add' && defId && isStartFlow === false) {\n startFlowStr = 'startFlow=true';\n } else if (id && isStartFlow === false && defId) {\n startFlowStr = 'startFlow=true';\n }\n\n var dataUrl = '';\n\n if (this.dataView) {\n if (this.dataView.bindList && this.dataView.bindList.length > 0) {\n var bindList = [];\n\n for (var i = 0; i < this.dataView.bindList.length; i++) {\n var item = {\n key: this.dataView.bindList[i].bindFilld,\n value: this.dataView.bindList[i].fillValue\n };\n bindList.push(item);\n }\n\n dataUrl = '&bindList=' + encodeURIComponent(Base64.encode(JSON.stringify(bindList)));\n }\n }\n\n var path = url + startFlowStr;\n\n if (dataUrl != '') {\n path = url + startFlowStr + dataUrl;\n }\n\n debugger; //TODO 如果是模块开发 全部已新窗口打开\n\n if (openType == 'new' || this.isJoinFlow || isDataView) {\n window.open(this.$router.resolve(path.replace(this.alias_new, \"statement\") + '&isNewPage=true').href, '_blank');\n } else {\n if (path.indexOf('othermenu') != -1) {\n path = path.replace('/othermenu', '/statement');\n }\n\n this.$router.push(path);\n }\n },\n openUrl: function openUrl(url, type, row, fieldName) {\n if (row && fieldName) {\n url = this.handledUrlParams(url, row, fieldName);\n }\n\n if (type == 'new') {\n window.open(url, '_blank');\n } else {\n window.location.href = url;\n }\n },\n handledUrlParams: function handledUrlParams(url, row, fieldName) {\n if (this.templateInfo.displayField) {\n var displayFields = JSON.parse(this.templateInfo.displayField);\n displayFields.forEach(function (display) {\n if (display.name == fieldName) {\n if (display.urlParams && display.urlParams.length > 0) {\n var urlParams = display.urlParams;\n var suffix = '';\n urlParams.forEach(function (param) {\n if (suffix) {\n suffix += '&';\n }\n\n suffix = suffix + param.name + '=' + row[param.field];\n });\n\n if (suffix) {\n if (url.indexOf('?') != -1) {\n url = url + '&' + suffix;\n } else {\n url = url + '?' + suffix;\n }\n\n return url;\n }\n }\n\n return url;\n }\n });\n }\n\n return url;\n },\n viewReport: function viewReport(data, jsonStr, openType) {\n var item = JSON.parse(Base64.decode(jsonStr));\n var conditionField = item.conditionField;\n var querys = [];\n\n if (conditionField && conditionField.length > 0) {\n conditionField.forEach(function (obj) {\n if (obj.parameter) {\n querys.push({\n property: obj.key,\n value: data[obj.parameter],\n group: 'main',\n operation: obj.qt,\n relation: 'AND'\n });\n }\n });\n } //数据随机添加到其他菜单下面时获取当前菜单的别名\n\n\n if (sessionStorage.menu_alias) {\n this.alias_new = sessionStorage.menu_alias;\n }\n\n var url = '/' + this.alias_new + '/template/preview/' + item.alias + '/false/' + encodeURIComponent(Base64.encode(JSON.stringify(querys))); //url 转码防止有斜杠 导致路由跳转不对\n\n if (openType == 'new') {\n window.open(this.$router.resolve(url).href, '_blank');\n } else {\n this.$router.push(url);\n }\n },\n startFlow: function startFlow(id) {\n var _this11 = this;\n\n var data = {\n defKey: this.templateInfo.defId,\n businessKey: id,\n boAlias: this.templateInfo.boDefAlias\n };\n var loadingInstance = Loading.service({\n fullscreen: true\n }); //开始\n\n this.$store.dispatch('storeProcess/startForm', data).then(function (result) {\n loadingInstance.close(); // 结束\n\n if (result.state) {\n _this11.$message.success(result.message);\n\n _this11.search();\n } else {\n _this11.disabled = false;\n\n _this11.$message.error(result.message);\n }\n });\n },\n //点击导出按钮\n exports: function exports(exportSettingFields) {\n var _this12 = this;\n\n var displayFields = [];\n\n if (exportSettingFields) {\n displayFields = JSON.parse(Base64.decode(exportSettingFields));\n }\n\n if (displayFields.length == 0 && this.templateInfo.displayField) {\n displayFields = JSON.parse(this.templateInfo.displayField);\n }\n\n this.exportType = 'main';\n this.displayFields = [];\n displayFields.forEach(function (item) {\n if (item.type) {\n _this12.displayFields.push(item);\n }\n });\n this.dialogExportVisible = true;\n },\n importCommand: function importCommand(params) {\n switch (params.command) {\n case 'downloadTempFile':\n this.downloadMainTempFile();\n break;\n\n case 'importMain':\n this.importMain();\n break;\n\n case 'log':\n this.openLog();\n break;\n\n default:\n break;\n }\n },\n openLog: function openLog() {\n this.dialogVisible = true;\n },\n downloadMainTempFile: function downloadMainTempFile() {\n var customTemplateId = '';\n\n if (this.templateInfo && this.templateInfo.manageField) {\n var manageFieldList = JSON.parse(this.templateInfo.manageField);\n\n for (var index = 0; index < manageFieldList.length; index++) {\n var manage = manageFieldList[index];\n\n if (manage.name == 'import') {\n if (manage.importTemplate && manage.importTemplate.length > 0) {\n customTemplateId = manage.importTemplate[0].id;\n }\n\n break;\n }\n }\n }\n\n if (customTemplateId) {\n this.$store.dispatch('menu/downloadFile', customTemplateId);\n } else {\n var loadingInstance = Loading.service({\n fullscreen: true\n }); //开始\n\n this.$store.dispatch('form/downloadMainTempFile', this.templateInfo.alias).then(function () {\n loadingInstance.close(); // 结束\n }).catch(function (c) {\n loadingInstance.close();\n });\n }\n },\n importMain: function importMain(param) {\n var _this13 = this;\n\n var formData = new FormData();\n formData.append('file', param.file);\n var params = {\n data: formData,\n alias: this.templateInfo.alias\n };\n\n if (this.dataView) {\n this.handelBindFiledValua();\n params.bindFilld = this.dataView.bindFilld || '';\n params.fillValue = this.dataView.fillValue || '';\n params.refIdValue = this.dataView.refIdValue;\n }\n\n var loadingInstance = Loading.service({\n fullscreen: true\n }); //开始\n\n form.mainImport(params, function (data) {\n loadingInstance.close(); // 结束\n\n if (data.state) {\n //导入成功之后重新渲染当前组件\n _this13.$parent.refreshTime = new Date().getTime();\n\n _this13.$message({\n type: 'success',\n message: data.message\n });\n\n param.onSuccess();\n\n if (sessionStorage.getItem('formImportTempRefId')) {\n var json = JSON.parse(data.value);\n json.boAlias = _this13.dataView.boDefAlias;\n var oldConf = sessionStorage.getItem('formImportTempJson');\n\n if (!oldConf) {\n sessionStorage.setItem('formImportTempJson', JSON.stringify([json]));\n } else {\n var oldJosn = JSON.parse(oldConf);\n var isInOldJosn = false;\n\n for (var index = 0; index < oldJosn.length; index++) {\n var old = oldJosn[index];\n\n if (old.tabName == json.tabName && old.bindFilld == json.bindFilld) {\n isInOldJosn = true;\n break;\n }\n }\n\n if (!isInOldJosn) {\n oldJosn.push(json);\n }\n\n sessionStorage.setItem('formImportTempJson', JSON.stringify(oldJosn));\n }\n }\n\n _this13.search();\n } else {\n param.onError();\n }\n });\n },\n //显示子表对话框\n showSubList: function showSubList(refId) {\n this.refId = refId;\n this.getSubEntsByFormKey(refId);\n },\n //显示修改记录\n openRecordList: function openRecordList(refId) {\n var _this14 = this;\n\n this.dialogRecordVisible = true;\n this.recordRefId = refId;\n var param = {\n pageBean: {\n page: 1,\n pageSize: 10,\n showTotal: true\n },\n sorter: [{\n direction: 'ASC',\n property: 'modifyTime'\n }],\n querys: [{\n property: 'ref_id_',\n value: this.recordRefId,\n group: 'main',\n operation: 'EQUAL',\n relation: 'AND'\n }]\n };\n this.recordTableLoading = true;\n var url = '${bpmRunTime}/bpm/boDataModifyRecord/v1/listJson';\n req.post(url, param).then(function (resp) {\n _this14.recordTableLoading = false;\n _this14.recordList = resp.data.rows;\n _this14.modifyRecord.pagination.pageBean = {\n pageSize: resp.data.pageSize,\n page: resp.data.page,\n total: resp.data.total\n };\n });\n },\n handleRecordCurrentChange: function handleRecordCurrentChange(index, modifyRecord) {\n var _this15 = this;\n\n modifyRecord.pagination.pageBean.page = index;\n var param = {\n pageBean: modifyRecord.pagination.pageBean,\n sorter: [{\n direction: 'ASC',\n property: 'modifyTime'\n }],\n querys: [{\n property: 'ref_id_',\n value: this.recordRefId,\n group: 'main',\n operation: 'EQUAL',\n relation: 'AND'\n }]\n };\n this.recordTableLoading = true;\n var url = '${bpmRunTime}/bpm/boDataModifyRecord/v1/listJson';\n req.post(url, param).then(function (resp) {\n _this15.recordTableLoading = false;\n _this15.recordList = resp.data.rows;\n _this15.modifyRecord.pagination.pageBean = {\n pageSize: resp.data.pageSize,\n page: resp.data.page,\n total: resp.data.total\n };\n });\n },\n //取消修改记录对话框\n recordCancel: function recordCancel() {\n this.dialogRecordVisible = false;\n this.recordList = [];\n this.recordRefId = '';\n this.modifyRecord = {\n pagination: {\n pageBean: {\n page: 1,\n pageSize: 10,\n total: 0\n }\n }\n };\n },\n //\n openModifyDetail: function openModifyDetail(row) {\n this.currentModify = row;\n this.modifyDetailDialogVisible = true;\n },\n //查看修改记录详情\n showModifyRecord: function showModifyRecord(id, refId) {\n var url = '/statement/template/form/' + this.templateKey + '/get/true' + '?id=' + refId + '&startFlow=false&recordId=' + id + '&isNewPage=true';\n window.open(this.$router.resolve(url).href, '_blank');\n },\n //确定导出\n submitExport: function submitExport() {\n if (!this.exportData || this.exportData.expField.length < 1) {\n this.$message({\n type: 'info',\n message: '请选择要导出的字段!'\n });\n return;\n }\n\n if (this.exportType === 'main') this.exportMain();else this.exportSubData(this.exportData.expField, this.refId, this.currentTab.entName);\n },\n exportMain: function exportMain() {\n var _this16 = this;\n\n var expField = '';\n\n for (var i = 0; i < this.exportData.expField.length; i++) {\n if (i > 0) {\n expField += ',';\n }\n\n expField += this.exportData.expField[i].name;\n }\n\n expField = Base64.encode(expField);\n var data = {\n boAlias: this.templateInfo.alias,\n getType: this.exportData.getType,\n expField: expField,\n filterKey: ''\n };\n data.query = this.getQueryFilter().pagination;\n\n if (this.dataView && this.dataView.bindSelectd) {\n data.query.querys.push({\n value: this.dataView.selectValue,\n operation: 'EQUAL',\n property: 'F_' + this.dataView.bindSelectd\n });\n }\n\n var loadingInstance = Loading.service({\n fullscreen: true\n }); //开始\n\n this.$store.dispatch('form/templateExport', data).then(function () {\n loadingInstance.close(); // 结束\n\n _this16.dialogExportVisible = false;\n });\n\n for (var _i = 0; _i < this.subDisplayFieldsList.length; _i++) {\n this.exportSubData(this.$refs['subExportTable'][_i].selection, '', this.subDisplayFieldsList[_i].name);\n this.$set(this.$refs['subExportTable'][_i], 'selection', []);\n }\n },\n exportSubData: function exportSubData(expFields, refId, alias) {\n var _this17 = this;\n\n var expField = [];\n\n for (var i = 0; i < expFields.length; i++) {\n expField.push({\n key: expFields[i].name,\n value: expFields[i].desc\n });\n }\n\n var data = {\n alias: alias,\n refId: refId,\n type: this.exportData.getType,\n expField: JSON.stringify(expField),\n filterKey: ''\n };\n data.queryFilter = this.currentTab.pagination;\n var loadingInstance = Loading.service({\n fullscreen: true\n });\n form.subExport(data, function (resp) {\n loadingInstance.close();\n _this17.dialogExportVisible = false;\n });\n },\n //取消导出\n exportCancel: function exportCancel() {\n this.dialogExportVisible = false;\n this.exportData.expField = [];\n },\n //取消子表对话框\n subCancel: function subCancel() {\n this.dialogSubVisible = false;\n this.tabs = [];\n this.ents = [];\n },\n sunCancel: function sunCancel() {\n this.dialogSunVisible = false;\n this.sunTabs = [];\n },\n handleExportSelectionChange: function handleExportSelectionChange(val) {\n this.exportData.expField = [];\n\n if (val) {\n this.exportData.expField = val;\n }\n },\n //全选\n handleExportSelectAll: function handleExportSelectAll() {\n this.exportData.expField = this.displayFields;\n },\n //排序\n sort: function sort(index, type) {\n if ('up' == type) {\n if (index === 0) {\n this.$message({\n message: '已经是列表中第一位',\n type: 'warning'\n });\n } else {\n var temp = this.displayFields[index - 1];\n this.$set(this.displayFields, index - 1, this.displayFields[index]);\n this.$set(this.displayFields, index, temp);\n }\n } else {\n if (index === this.displayFields.length - 1) {\n this.$message({\n message: '已经是列表中最后一位',\n type: 'warning'\n });\n } else {\n this.isTransition = true;\n var i = this.displayFields[index + 1];\n this.$set(this.displayFields, index + 1, this.displayFields[index]);\n this.$set(this.displayFields, index, i);\n }\n }\n },\n getSunData: function () {\n var _getSunData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(tab, row) {\n var ents, pk, refId, i, _tab;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n ents = tab.childEnts;\n pk = tab.pkKey;\n refId = '';\n\n if (row[pk.toLocaleLowerCase()]) {\n refId = row[pk.toLocaleLowerCase()];\n } else {\n refId = row[pk.toUpperCase()];\n }\n\n this.subTableLoading = true;\n\n if (!(ents && ents.length > 0)) {\n _context.next = 15;\n break;\n }\n\n i = 0;\n\n case 7:\n if (!(i < ents.length)) {\n _context.next = 15;\n break;\n }\n\n _context.next = 10;\n return this.getBoData(ents[i], refId);\n\n case 10:\n _tab = _context.sent;\n this.sunTabs.push(_tab);\n\n case 12:\n i++;\n _context.next = 7;\n break;\n\n case 15:\n this.subTableLoading = false;\n this.dialogSunVisible = true;\n\n case 17:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function getSunData(_x2, _x3) {\n return _getSunData.apply(this, arguments);\n }\n\n return getSunData;\n }(),\n getBoData: function getBoData(ent, refId) {\n var _this18 = this;\n\n var attributeList = ent.attributeList;\n var tab = {\n refId: refId,\n pkKey: ent.pkKey,\n name: ent.tableName,\n entName: ent.name,\n title: ent.comment,\n attributeList: attributeList,\n comment: ent.comment,\n pagination: {\n pageBean: {\n pageSize: 10,\n page: 1,\n total: 0\n }\n }\n };\n tab.childEnts = [];\n\n if (ent.childEnts && ent.childEnts.length > 0) {\n tab.childEnts = ent.childEnts;\n }\n\n return new Promise(function (resolve, reject) {\n _this18.$store.dispatch('form/getSubDataPagination', {\n pagination: tab.pagination,\n name: ent.name,\n refId: refId\n }).then(function (data) {\n if (data && data.rows.length > 0) {\n tab.dataList = data.rows;\n tab.pagination.pageBean.pageSize = data.pageSize;\n tab.pagination.pageBean.page = data.page;\n tab.pagination.pageBean.total = data.total;\n } else {\n tab.dataList = [];\n tab.pagination.pageBean.pageSize = 1;\n tab.pagination.pageBean.page = 1;\n tab.pagination.pageBean.total = 0;\n }\n\n resolve(tab);\n });\n });\n },\n getSubEntsByFormKey: function getSubEntsByFormKey(refId) {\n /*if (!this.ents || this.ents.length < 1) {\r\n form.getSubEntsByFormKey(this.templateInfo.formKey, (resp) => {\r\n // 子表与孙表字段名设置小写\r\n for (let i = 0; i < resp.data.length; i++) {\r\n resp.data[i].attributeList.forEach(attribute => {\r\n attribute.fieldName = attribute.fieldName.toLowerCase();\r\n })\r\n resp.data[i].childEnts.forEach(showChildEnt => {\r\n showChildEnt.attributeList.forEach(attribute => {\r\n attribute.fieldName = attribute.fieldName.toLowerCase();\r\n })\r\n })\r\n }\r\n this.ents = resp.data;\r\n });\r\n } else {*/\n this.getSubData(this, refId);\n /* }*/\n },\n getSubData: function () {\n var _getSubData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_me, refId) {\n var ents, i, tab;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n //let ents = this.ents;\n ents = JSON.parse(_me.templateInfo.subField);\n\n if (!(ents && ents.length > 0)) {\n _context2.next = 13;\n break;\n }\n\n i = 0;\n\n case 3:\n if (!(i < ents.length)) {\n _context2.next = 13;\n break;\n }\n\n ents[i].attributeList.forEach(function (attr) {\n attr.fieldName = attr.fieldName.toLowerCase();\n });\n ents[i].childEnts.forEach(function (showChildEnt) {\n showChildEnt.attributeList.forEach(function (attribute) {\n attribute.fieldName = attribute.fieldName.toLowerCase();\n });\n });\n _context2.next = 8;\n return this.getBoData(ents[i], refId);\n\n case 8:\n tab = _context2.sent;\n this.tabs.push(tab);\n\n case 10:\n i++;\n _context2.next = 3;\n break;\n\n case 13:\n this.dialogSubVisible = true;\n\n case 14:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function getSubData(_x4, _x5) {\n return _getSubData.apply(this, arguments);\n }\n\n return getSubData;\n }(),\n nodeClick: function nodeClick(node) {\n var loading = this.$loading(this.options); // this.$store.dispatch(\"form/setBpmTemplatePaginationPageNum\", 1);\n\n this.pagination.page = 1; //每次点击过滤树,应该把右边的table 与分页全部重置为初始\n\n var pageBean = {\n pageBean: {\n page: 1,\n pageSize: this.pagination.pageSize\n }\n };\n pageBean.querys = [];\n\n if (!node.id || node.id != -1) {\n var treeField = JSON.parse(this.templateInfo.treeField);\n treeField.querys.forEach(function (item) {\n if (item.key_ && item.value_) {\n pageBean.querys.push({\n property: '$TREE$' + item.key_,\n value: node[item.value_],\n group: 'main',\n operation: 'EQUAL',\n relation: 'AND'\n });\n }\n });\n } //把过滤树的查询条件存一份起来,右边的搜索与分页才能同时使用\n\n\n this.treeQuerys = pageBean.querys;\n var params = {\n templateId: this.templateInfo.id,\n pagination: pageBean\n };\n this.reset(true); //数据视图控件\n\n if (this.dataView) {\n if (this.dataView.selectList && this.dataView.selectList.length > 0) {\n params.selectList = this.dataView.selectList;\n }\n }\n\n var this_ = this;\n\n if (this_.isJoinFlow) {\n params.isJoinFlow = true;\n params.taskType = this_.taskType;\n params.defKey = this_.defKey;\n }\n\n this.$store.dispatch('form/getBpmTemplateByPagination', params).then(function (response) {\n this_.rows = response.data.rows;\n this_.total = response.data.total;\n this_.pagination.page = response.data.page;\n this_.pagination.pageSize = response.data.pageSize;\n loading.close();\n });\n },\n //加载树的信息\n toTreeData: function toTreeData(data, id, pid, name, pvalue) {\n // 建立个树形结构,需要定义个最顶层的父节点,pvalue是0\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 //初始化树\n initTree: function initTree(treeField) {\n var this_ = this;\n form.getByAlias(treeField.alias, function (res) {\n this_.customDialog = res;\n dialog.getTreeData({\n requestType: 'GET',\n url: '${form}/form/customDialog/v1/getTreeData?alias=' + treeField.alias + '&mapParam='\n }, function (resp) {\n if (this_.customDialog.displayfield) {\n var displayfield = JSON.parse(this_.customDialog.displayfield);\n this_.displayField = displayfield;\n this_.treeList = resp.data;\n var head = {};\n head[displayfield.displayName] = '全部';\n head.id = -1;\n this_.tree.push(head);\n }\n });\n });\n },\n loadTree: function loadTree(node, resolve) {\n var _this19 = this;\n\n if (node) {\n if (node.data.id === -1) {\n var tree = this.toTreeData(this.treeList, this.displayField.id, this.displayField.pid, this.displayField.displayName, this.displayField.pvalue ? this.displayField.pvalue : '0');\n resolve(tree);\n } else {\n resolve(this.treeList.filter(function (value) {\n return value[_this19.displayField.pid] === node.data[_this19.displayField.id];\n }));\n }\n } else {\n resolve([]);\n }\n },\n handleSubCurrentChange: function handleSubCurrentChange(index, tab) {\n var _this20 = this;\n\n tab.pagination.pageBean.page = index;\n this.subTableLoading = true;\n this.$store.dispatch('form/getSubDataPagination', {\n pagination: tab.pagination,\n name: tab.entName,\n refId: tab.refId ? tab.refId : this.refId\n }).then(function (resp) {\n tab.pagination.pageBean = {\n pageSize: resp.pageSize,\n page: resp.page,\n total: resp.total\n };\n tab.dataList = resp.rows;\n }).finally(function () {\n _this20.subTableLoading = false;\n });\n },\n querySubTable: function querySubTable(tab) {\n var _this21 = this;\n\n tab.pagination.querys = [];\n\n if (this.querySubValue) {\n tab.attributeList.forEach(function (item) {\n //pgSql使用模糊查询,类型不匹配时会报错,此处只保留varchar类型\n // if (item.dataType == 'varchar') {\n tab.pagination.querys.push({\n property: item.fieldName,\n value: _this21.querySubValue,\n group: 'other',\n operation: 'LIKE',\n relation: 'OR'\n }); // }\n });\n } else if (this.querySunValue) {\n tab.attributeList.forEach(function (item) {\n // if (item.dataType == 'varchar') {\n tab.pagination.querys.push({\n property: item.fieldName,\n value: _this21.querySunValue,\n group: 'other',\n operation: 'LIKE',\n relation: 'OR'\n }); // }\n });\n }\n\n this.handleSubCurrentChange(1, tab);\n },\n importSub: function importSub(param) {\n var _this22 = this;\n\n var formData = new FormData();\n formData.append('file', param.file);\n var params = {\n data: formData,\n alias: this.currentTab.entName,\n refId: this.refId\n };\n form.subImport(params, function (data) {\n if (data.state) {\n _this22.$message({\n type: 'success',\n message: data.message\n });\n\n param.onSuccess();\n\n _this22.handleSubCurrentChange(1, _this22.currentTab);\n } else {\n _this22.$message.error(data.message);\n\n param.onError();\n }\n });\n },\n exportSub: function exportSub(tab) {\n var _this23 = this;\n\n this.exportType = 'sub';\n this.currentTab = tab;\n this.displayFields = [];\n this.subDisplayFieldsList = [];\n tab.attributeList.forEach(function (item) {\n _this23.displayFields.push({\n desc: item.comment,\n name: item.fieldName,\n type: item.columnType\n });\n });\n this.dialogExportVisible = true;\n },\n importButton: function importButton(tab) {\n this.currentTab = tab;\n },\n myDraftList: function myDraftList() {\n //数据视图随机添加到其他菜单下面时获取当前菜单的别名 并且当前数据视图不是表单里的数据视图 dataView\n if (sessionStorage.menu_alias && !this.dataView && !this.ignoredAlias.includes(sessionStorage.menu_alias)) {\n this.alias_new = sessionStorage.menu_alias;\n }\n\n var dataViewFlag = false; //判断当前数据视图是不是表单里的数据视图\n\n if (this.dataView) {\n if (this.dataView.boDefAlias && this.dataView.boDefAlias != \"\") {\n dataViewFlag = true;\n }\n }\n\n var path = '/' + this.alias_new + '/draftList/' + this.templateInfo.alias + '/' + dataViewFlag;\n\n if (this.openType == \"new\" || dataViewFlag) {\n path += \"?isNew=true\";\n }\n\n if (dataViewFlag) {\n window.open(path, '_blank');\n } else {\n this.$router.push(path);\n } // let url =\n // \"/statement/draftList?tempAlias=\" + ;\n // const { href } = this.$router.push({\n // path: url,\n // });\n // window.open(href, \"_blank\");\n\n },\n initSwitchStatus: function initSwitchStatus() {\n //初始化开关状态\n var manages = utils.parseToJson(this.templateInfo.manageField);\n\n for (var i = 0; i < manages.length; i++) {\n if (manages[i].name === 'switch') {\n var fieldName = manages[i].bind;\n this.$set(this.switchMap, fieldName, {});\n this.switchMap[fieldName].on = manages[i].switchOn;\n this.switchMap[fieldName].off = manages[i].switchOff;\n this.switchMap[fieldName].onLabel = manages[i].switchOnLabel;\n this.switchMap[fieldName].offLabel = manages[i].switchOffLabel;\n }\n }\n },\n switchChange: function switchChange(pkVal, on, off, fieldName, row, defaultTrue) {\n var this_ = this;\n var val = row[fieldName];\n\n if (val != on && val != off) {\n if (defaultTrue == \"true\") {\n this.$set(row, fieldName, off);\n val = off;\n } else {\n this.$set(row, fieldName, on);\n val = on;\n }\n }\n\n this_.$confirm('将会修改该数据,是否继续?', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n var form = window.context.form;\n var formAlias = this_.templateInfo.formKey; //表单别名\n\n var dataDefAlias = this_.templateInfo.boDefAlias; //数据建模别名\n\n req.get(form + '/form/dataTemplate/v1/getForm/' + formAlias + '/' + dataDefAlias + '?id=' + pkVal + '&action=get&recordId=').then(function (resp) {\n var boData = resp.data.data;\n boData[dataDefAlias][fieldName] = val;\n var saveData = {\n boAlias: this_.templateInfo.boDefAlias,\n boData: resp.data.data\n };\n this_.$store.dispatch('form/boSave', saveData).then(function (result) {\n if (result.state) {\n this_.$message({\n type: 'success',\n message: '保存成功'\n });\n } else {\n this_.$message({\n type: 'error',\n message: '保存失败'\n });\n }\n });\n });\n }).catch(function () {\n var form = window.context.form;\n var formAlias = this_.templateInfo.formKey; //表单别名\n\n var dataDefAlias = this_.templateInfo.boDefAlias; //数据建模别名\n\n req.get(form + '/form/dataTemplate/v1/getForm/' + formAlias + '/' + dataDefAlias + '?id=' + pkVal + '&action=get&recordId=').then(function (resp) {\n this_.$set(row, fieldName, resp.data.data[dataDefAlias][fieldName]);\n });\n });\n },\n display: function display(mpDisplay) {\n //pc端的数据报表不需要做本方法的处理,直接返回true即可。\n return true;\n },\n getFixed: function getFixed(fixed) {\n return fixed;\n },\n summary: function summary(method, field, decimal) {\n var list = this.rows.filter(function (item) {\n return item[field] !== undefined && item[field] !== '';\n }).map(function (item) {\n return new Number(item[field]);\n });\n\n if (!list || list.length == 0) {\n return;\n }\n\n if (method === 'count') {\n return list.length;\n } else if (method === 'sum') {\n return list.reduce(function (a, b) {\n return a + b;\n }).toFixed(decimal);\n } else if (method === 'min') {\n return Math.min.apply(Math, _toConsumableArray(list)).toFixed(decimal);\n } else if (method === 'max') {\n return Math.max.apply(Math, _toConsumableArray(list)).toFixed(decimal);\n } else if (method === 'avg') {\n return (list.reduce(function (a, b) {\n return a + b;\n }) / list.length).toFixed(decimal);\n }\n },\n getColor: function getColor(data, row) {\n var resuColor = 'color:black';\n var decode = Base64.decode(data);\n var colorRule = JSON.parse(decode);\n\n if (colorRule && colorRule instanceof Array) {\n colorRule.forEach(function (rule) {\n var Fn = Function('data', rule.proRule);\n\n if (Fn(row)) {\n resuColor = 'color:' + rule.proColor;\n }\n });\n }\n\n return resuColor;\n },\n getProValue: function getProValue(value, rule) {\n return Math.round(value / rule * 10000) / 100; // 小数点后两位百分比\n },\n getProColor: function getProColor(data, row) {\n var resuColor = '#409eff';\n var decode = Base64.decode(data);\n /*decode=decode.replace(/\\s*!/g,\"\");*/\n\n var colorRule = JSON.parse(decode);\n\n if (colorRule && colorRule instanceof Array) {\n colorRule.forEach(function (rule) {\n var Fn = Function('data', rule.proRule);\n\n if (Fn(row)) {\n resuColor = rule.proColor;\n }\n });\n }\n\n return resuColor;\n },\n isSortable: function isSortable(field) {\n var isClob = false;\n this.displayFields.forEach(function (item) {\n if (item.name === field && item.type === 'clob') {\n isClob = true;\n }\n });\n return !this.notSortableFields.includes(field) && !isClob;\n },\n customEvilJS: function customEvilJS(row, htScript) {\n var Fn = Function('_req', 'row', '_this', Base64.decode(htScript)); //一个变量指向Function,防止有些前端编译工具报错\n\n var result = Fn(req, row, this);\n },\n batchUpdate: function batchUpdate(title, base64Json, base64Fileds) {\n if (this.tableData.selectRows == null || this.tableData.selectRows.length == 0) {\n this.$message.warning('请选择数据');\n return false;\n }\n\n var defaultValueList = [];\n var outForm = [];\n\n if (base64Json) {\n //是否有用户自己输入的字段\n var res = true;\n var batchUpdateData = JSON.parse(Base64.decode(base64Json));\n var filedsObj = JSON.parse(Base64.decode(base64Fileds));\n batchUpdateData.forEach(function (item) {\n if (item.valueType == 1) {\n var isRequired = false;\n\n if (item.isRequired) {\n isRequired = true;\n }\n\n var obj = {\n name: item.name,\n desc: filedsObj[item.name],\n outType: item.outValueType,\n single: false,\n selectCurrent: false,\n isRequired: isRequired\n };\n\n if (item.outValueType == 'select') {\n var selectConfig = JSON.parse(item.outConfig);\n obj.ganged = {\n alias: '',\n valueBind: '',\n noInit: '',\n labelBind: '',\n bind: {}\n };\n\n if (selectConfig.customQuery) {\n var ganged = {\n alias: selectConfig.customQuery.alias,\n valueBind: selectConfig.customQuery.valueBind,\n noInit: '',\n labelBind: selectConfig.customQuery.labelBind,\n bind: {}\n };\n obj.ganged = ganged;\n }\n\n obj.selectData = selectConfig.selectData;\n } else if (item.outValueType == 'dialog') {\n var _selectConfig = JSON.parse(item.outConfig);\n\n var dialogConfig = _selectConfig.dialogConfig;\n var mappingConf = [];\n var parameter = _selectConfig.parameter;\n\n for (var key in parameter) {\n var value = parameter[key] || \"\";\n mappingConf.push({\n from: key,\n target: [value],\n targetSub: [value]\n });\n }\n\n var custdialog = {\n selectNum: dialogConfig.selectNum,\n conditions: [],\n mappingConf: mappingConf,\n custQueryJson: [],\n alias: dialogConfig.alias,\n type: dialogConfig.custDialog\n };\n obj.custdialog = {\n name: '请选择',\n custDialog: custdialog,\n resultField: dialogConfig.resultField\n };\n } else if (item.outConfig && (item.outValueType != 'input' || item.outValueType != 'data' || item.outValueType != 'number')) {\n var outConfig = JSON.parse(item.outConfig);\n var _parameter = outConfig.parameter;\n\n for (var key in _parameter) {\n if (!_parameter[key]) {\n delete _parameter[key];\n } else {\n _parameter[key] = 'data.' + _parameter[key];\n }\n }\n\n if (outConfig.selectCurrent) {\n obj.selectCurrent = outConfig.selectCurrent;\n }\n\n if (outConfig.isSingle) {\n obj.single = outConfig.isSingle;\n }\n\n obj.bindConfig = _parameter;\n }\n\n outForm.push(obj);\n res = false;\n } else {\n defaultValueList.push({\n key: item.name,\n value: item.defaultValue\n });\n }\n });\n\n if (res) {\n this.updateBo(defaultValueList);\n } else {\n this.defaultValueList = defaultValueList;\n this.$refs.templateBatchUpdateDialog.showDialog(title, outForm);\n }\n } else {\n this.$message({\n type: 'info',\n message: '未设置更新内容'\n });\n }\n },\n onConfirm: function onConfirm(data) {\n var defaultValueList = [];\n\n for (var key in data) {\n defaultValueList.push({\n key: key,\n value: data[key]\n });\n }\n\n var boData = this.defaultValueList ? this.defaultValueList.concat(defaultValueList) : this.defaultValue;\n this.updateBo(boData);\n },\n updateBo: function updateBo(defaultValueList) {\n var _this24 = this;\n\n this.$confirm('此操作将批量更新数据, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n var selectRows = _this24.tableData.selectRows;\n\n for (var i = 0; i < selectRows.length; i++) {\n selectRows[i].formKey = _this24.templateInfo.formKey;\n\n for (var j = 0; j < defaultValueList.length; j++) {\n selectRows[i][defaultValueList[j].key] = defaultValueList[j].value;\n }\n }\n\n var data = {\n boData: selectRows,\n boAlias: _this24.templateInfo.boDefAlias\n };\n\n _this24.$store.dispatch('form/batchUpdateTemplateData', data).then(function (data) {\n if (data.state) {\n _this24.$message({\n type: 'success',\n message: data.message\n });\n\n _this24.search();\n }\n });\n }).catch(function () {\n _this24.$message({\n type: 'info',\n message: '已取消更新'\n });\n });\n },\n addCommand: function addCommand(command) {\n if (command == 'notLogin' || command == 'login') {\n this.getAddQRCode(command);\n }\n },\n getAddQRCode: function getAddQRCode(command) {\n this.QRCodePattern = command == 'notLogin' ? true : false;\n this.QRCodeDesc = [];\n this.QRCodeType = 'add';\n this.QRCodeShow = false;\n this.QRCodeDialog = true;\n },\n showSearchPane: function showSearchPane() {\n return true;\n },\n buildDefaultQuerys: function buildDefaultQuerys() {\n var this_ = this;\n var querys = [];\n var conditions = JSON.parse(this_.templateInfo.conditionField);\n var prefix = this.templateInfo.isExternal == 1 ? \"\" : \"F_\"; //条件字段默认值判断\n\n conditions.forEach(function (condition) {\n if (condition.defaultValue) {\n var field = condition.colPrefix + condition.na;\n this_.$set(this_.searchForm, field, condition.defaultValue);\n var value = condition.defaultValue;\n\n if (condition.ty == 'number') {\n value = parseFloat(value);\n }\n\n querys.push({\n property: field,\n value: value,\n group: \"main\",\n operation: condition.qt.toUpperCase(),\n relation: 'AND'\n });\n }\n }); //筛选字段默认值判断\n\n var filters = JSON.parse(this_.templateInfo.filteringField);\n filters.forEach(function (filter) {\n if (filter.defaultValue && filter.defaultValue.length > 0) {\n this_.filterMap[filter.name] = filter.defaultValue;\n filter.defaultValue.forEach(function (val) {\n querys.push({\n property: prefix + filter.name,\n value: val,\n group: \"defVal_\" + filter.name,\n operation: \"EQUAL\",\n relation: \"OR\"\n });\n });\n }\n });\n this_.$on(\"afterMounted\", function () {\n var headerColumns = this_.$refs.multipleTemplateTable.$refs.tableHeader.columns;\n headerColumns.forEach(function (column) {\n if (this_.filterMap.hasOwnProperty(column.property)) {\n this_.filterMap[column.property].forEach(function (val) {\n column.filteredValue.push(val);\n });\n }\n });\n });\n return querys;\n }\n }\n });\n }\n }\n};",null]}