{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\dataTemplate\\ManageSetting.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\dataTemplate\\ManageSetting.vue","mtime":1675071992163},{"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.array.find\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.map\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar eipAuthDialog = function eipAuthDialog() {\n return import('@/components/dialog/EipAuthDialog.vue');\n};\n\nvar ImportJarSelector = function ImportJarSelector() {\n return import('@/components/form/dataTemplate/ImportCheckJarManager.vue');\n};\n\nvar flowFormAuth = function flowFormAuth() {\n return import('@/components/flow/FlowFormAuth.vue');\n};\n\nimport { mapState } from 'vuex';\nimport { Base64 } from 'js-base64';\nimport utils from '@/hotent-ui-util.js';\nimport deepmerge from 'deepmerge';\nvar BTN_TYPE = {\n isShow: '1',\n notShow: '2'\n};\nexport default {\n components: {\n eipAuthDialog: eipAuthDialog,\n ImportJarSelector: ImportJarSelector,\n flowFormAuth: flowFormAuth\n },\n name: 'manage-setting',\n props: ['data'],\n data: function data() {\n return {\n btnType: BTN_TYPE,\n dialogVisible: false,\n dialogModel: {},\n url: {},\n dataTemplate: {},\n manageFields: [],\n permissionMap: {},\n permissionList: [],\n displayExportSettingFields: [],\n exportSettingFields: [],\n customQuerys: [],\n customDialogs: [],\n displayField: [],\n btnoptions: [],\n defaultBtnOptions: [{\n key: 'add',\n value: '新增',\n disabled: false\n }, {\n key: 'edit',\n value: '编辑',\n disabled: false\n }, {\n key: 'del',\n value: '删除',\n disabled: false\n }, {\n key: 'detail',\n value: '明细',\n disabled: false\n }, {\n key: 'record',\n value: '修改记录',\n disabled: false\n }, {\n key: 'printDetail',\n value: '打印明细',\n disabled: false\n }, {\n key: 'sub',\n value: '子表数据',\n disabled: false\n }, {\n key: 'sun',\n value: '查看孙表',\n disabled: false\n }, {\n key: 'export',\n value: '导出',\n disabled: false\n }, {\n key: 'js',\n value: 'js按钮',\n disabled: false\n }, {\n key: 'import',\n value: '导入',\n limit: 1000,\n importTemplate: [],\n jarId: '',\n jarDesc: '',\n disabled: false\n }, {\n key: 'produceQRCode',\n value: '生成二维码',\n disabled: false\n }, {\n key: 'print',\n value: '打印',\n disabled: false\n }, {\n key: 'url',\n value: 'URL按钮',\n disabled: false\n }, {\n key: 'switch',\n value: '开关',\n disabled: false\n }, {\n key: 'batchUpdate',\n value: '更新数据',\n disabled: false\n }],\n tabHeight: \"\".concat(document.documentElement.clientHeight) - 280,\n currentAuthRow: null,\n dialogTitle: '',\n switchOn: '',\n switchOff: '',\n switchDefaultTrue: false,\n switchOptions: [{\n value: true,\n label: '默认为开'\n }, {\n value: false,\n label: '默认为关'\n }],\n switchOnLabel: '',\n switchOffLabel: '',\n files: [],\n curSelectIndex: 0,\n diyScript: '',\n index: 0,\n dialogMethodVisible: false,\n dialogRuleData: '',\n displaySettingFields: [],\n cmOptions: {\n value: '',\n mode: 'javascript',\n readOnly: false,\n smartIndent: true,\n tabSize: 1,\n theme: 'base16-light',\n lineNumbers: true,\n line: true,\n lineWiseCopyCut: true,\n showCursorWhenSelecting: true\n },\n outvalueTypeList: [{\n key: 'input',\n value: '文本框'\n }, {\n key: 'data',\n value: '日期'\n }, {\n key: 'number',\n value: '数字'\n }, {\n key: 'select',\n value: '下拉框'\n }, {\n key: 'dialog',\n value: '对话框'\n }, {\n key: 'user',\n value: '用户选择器'\n }, {\n key: 'org',\n value: '组织选择器'\n }, {\n key: 'post',\n value: '岗位选择器'\n }, {\n key: 'job',\n value: '职位选择器'\n }, {\n key: 'dem',\n value: '维度选择器'\n }, {\n key: 'role',\n value: '角色选择器'\n }],\n batchUpdateVisible: false,\n exportUpdateVisible: false,\n batchUpdateData: [],\n outConfig: {\n choiceType: 'static',\n parameter: {},\n selectData: [],\n customQuery: {\n alias: '',\n valueBind: '',\n labelBind: ''\n },\n dialogConfig: {\n name: '请选择'\n }\n },\n outIndex: '',\n outValueTypeVisible: false,\n filedsObj: {},\n refreshTime: new Date().getTime()\n };\n },\n watch: {\n 'data.bpmDataTemplate.subject': function dataBpmDataTemplateSubject(newVal) {\n //判断是否绑定了流程,绑定了流程功能按钮可以选择发起流程按钮\n if (newVal) {\n this.btnoptions.push({\n key: 'startFlow',\n value: '发起流程',\n disabled: false\n });\n this.defaultBtnOptions.push({\n key: 'startFlow',\n value: '发起流程',\n disabled: false\n });\n } else {\n this.btnoptions = this.btnoptions.filter(function (b) {\n return b.key != 'startFlow';\n });\n this.defaultBtnOptions = this.btnoptions.filter(function (b) {\n return b.key != 'startFlow';\n });\n this.manageFields = this.manageFields.filter(function (f) {\n return f.name != 'startFlow';\n });\n }\n },\n deep: true,\n immediate: true\n },\n computed: mapState({\n header: function header(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n },\n actionUrl: function actionUrl() {\n return window.context.portal + '/file/v1/upload';\n }\n }),\n mounted: function mounted() {\n var _this2 = this;\n\n this.dataTemplate = this.data.bpmDataTemplate;\n\n if (this.data.displaySettingFields) {\n this.displaySettingFields = JSON.parse(this.data.displaySettingFields).filter(function (item) {\n return item.isFlowField != true;\n });\n this.displayExportSettingFields = deepmerge({}, this.displaySettingFields, {\n clone: true\n });\n } //判断是否绑定了流程,绑定了流程功能按钮可以选择发起流程按钮\n\n\n if (this.data.bpmDataTemplate.subject) {\n this.btnoptions.push({\n key: 'startFlow',\n value: '发起流程',\n disabled: false\n });\n this.defaultBtnOptions.push({\n key: 'startFlow',\n value: '发起流程',\n disabled: false\n });\n }\n\n this.manageFields = this.dataTemplate.manageField ? JSON.parse(this.dataTemplate.manageField) : [];\n this.displayField = this.dataTemplate.displayField ? JSON.parse(this.dataTemplate.displayField) : [];\n this.permissionMap = this.data.permissionList;\n\n if (this.permissionMap) {\n for (var key in this.permissionMap) {\n this.permissionList.push({\n type: key,\n title: this.permissionMap[key]\n });\n }\n\n this.displaySettingFields.forEach(function (item) {\n _this2.filedsObj[item.name] = item.desc;\n });\n }\n\n var manageFields = JSON.parse(this.dataTemplate.manageField);\n var alreadyAddedFields = new Map();\n\n if (manageFields) {\n manageFields.forEach(function (manageField) {\n alreadyAddedFields.set(manageField.name, manageField.name);\n\n _this2.defaultBtnOptions.forEach(function (btn) {\n if (manageField.name === btn.key && !(btn.key == 'js' || btn.key == 'url' || btn.key == 'switch' || btn.key == 'batchUpdate')) {\n btn.disabled = true;\n }\n });\n });\n }\n\n this.btnoptions = this.defaultBtnOptions.filter(function (btn) {\n return !alreadyAddedFields.has(btn.key);\n });\n },\n methods: {\n isDisabled: function isDisabled(row) {\n return row ? row.name != 'add' && row.name != 'edit' && row.name != 'detail' && row.name != 'del' : false;\n },\n btnChange: function btnChange(row) {\n this.$set(row, 'mpDisplay', row.mpDisplay === '1' ? '2' : '1');\n },\n diyScriptChange: function diyScriptChange(myValue) {\n var cm = this.$refs.scriptText.codemirror;\n var doc = cm.getDoc();\n var cursor = doc.getCursor(); //gets the line number in the cursor position\n\n var line = doc.getLine(cursor.line); //get the line contents\n\n var pos = {\n line: cursor.line,\n ch: line.length - 1 //set the character position to the end of the line\n\n };\n doc.replaceRange(' ' + 'row.' + myValue + ' ', pos); //adds a new line\n },\n setButtonJs: function setButtonJs(row, index) {\n this.index = index;\n\n if (row.jsValue) {\n this.dialogRuleData = Base64.decode(row.jsValue);\n }\n\n this.dialogMethodVisible = true;\n },\n methodOk: function methodOk() {\n this.dialogMethodVisible = false;\n this.manageFields[this.index].jsValue = Base64.encode(this.dialogRuleData);\n },\n selectJar: function selectJar() {\n this.$refs.importJarSelector && this.$refs.importJarSelector.show();\n },\n downloadTemplate: function downloadTemplate() {\n this.$http.post('${form}/form/dataTemplate/v1/downloadMainTempByFormKey/' + this.dataTemplate.formKey, this.dataTemplate.formKey, this.dataTemplate.formKey, 'arraybuffer');\n },\n beforeUpload: function beforeUpload(file) {\n var _this3 = this;\n\n if (this.manageFields[this.curSelectIndex].importTemplate && this.manageFields[this.curSelectIndex].importTemplate.length > 0) {\n if (this.manageFields[this.curSelectIndex].importTemplate.length == 1) {\n return new Promise(function (resolve, reject) {\n _this3.$confirm('已有模板, 是否确认覆盖?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n resolve();\n }).catch(function () {\n reject();\n });\n });\n } else {\n this.$message.waring('最多只能上传一个模板');\n return false;\n }\n } else {\n return true;\n }\n },\n handleImportClick: function handleImportClick(scope) {\n this.curSelectIndex = scope.$index;\n },\n handleRemove: function handleRemove(file, fileList) {\n if (fileList && fileList.length == 1) {\n return;\n }\n\n var this_ = this;\n setTimeout(function () {\n this_.manageFields[this_.curSelectIndex].importTemplate = [];\n }, 50);\n },\n success: function success(response, file, fileList) {\n this.files = [];\n\n for (var i = 0; i < fileList.length; i++) {\n if (fileList[i].response) {\n var value = fileList[i].response;\n var arrarFile = {};\n arrarFile.id = value.fileId;\n arrarFile.name = value.fileName;\n arrarFile.size = value.size;\n this.files.push(arrarFile);\n }\n }\n\n this.manageFields[this.curSelectIndex].importTemplate = this.files;\n },\n jarSelectorOnConfirm: function jarSelectorOnConfirm(d) {\n this.$set(this.manageFields[this.curSelectIndex], 'jarId', d.id);\n this.$set(this.manageFields[this.curSelectIndex], 'jarDesc', d.desc);\n },\n copy: function copy(index) {\n var obj = JSON.parse(JSON.stringify(this.manageFields[index]));\n this.manageFields.push(obj);\n },\n //保存按钮数据\n saveManageField: function saveManageField() {\n //处理开关字段\n if (this.manageFields) {\n this.dataTemplate.manageField = JSON.stringify(this.manageFields);\n } else {\n this.dataTemplate.manageField = null;\n }\n },\n validateManageField: function validateManageField() {\n //开关按钮校验,开关按钮必须绑定一列,开时值和关时值必填\n var this_ = this;\n var fields = this_.manageFields;\n\n for (var i = 0; i < fields.length; i++) {\n if (fields[i].name === 'switch') {\n if (!fields[i].bind) {\n this_.$message.warning('请选择开关的绑定字段');\n return;\n }\n\n if (!fields[i].switchOn || !fields[i].switchOff) {\n this_.$message({\n type: 'warning',\n message: '请完善开关的开时值和关时值'\n });\n return false;\n }\n\n if (!fields[i].desc || !fields[i].name) {\n this_.$message({\n type: 'warning',\n message: '请完善开关信息'\n });\n return false;\n }\n }\n }\n\n return true;\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.manageFields[index - 1];\n this.$set(this.manageFields, index - 1, this.manageFields[index]);\n this.$set(this.manageFields, index, temp);\n }\n } else {\n if (index === this.manageFields.length - 1) {\n this.$message({\n message: '已经是列表中最后一位',\n type: 'warning'\n });\n } else {\n var i = this.manageFields[index + 1];\n this.$set(this.manageFields, index + 1, this.manageFields[index]);\n this.$set(this.manageFields, index, i);\n }\n }\n },\n //删除显示字段\n remove: function remove(index) {\n var manageField = this.manageFields[index];\n var btn = this.defaultBtnOptions.filter(function (btn) {\n return manageField.name === btn.key;\n })[0];\n this.btnoptions.push(btn);\n this.manageFields.splice(index, 1);\n this.defaultBtnOptions.forEach(function (button) {\n if (button.key === btn.key) {\n button.disabled = false;\n return;\n }\n });\n },\n //添加管理按钮\n addManageBtns: function addManageBtns() {\n if (this.btnoptions.length > 0) {\n var btn = this.btnoptions.shift();\n\n if (btn && (btn.key == 'js' || btn.key == 'url' || btn.key == 'switch' || btn.key == 'batchUpdate')) {\n this.btnoptions.unshift(btn);\n }\n\n this.defaultBtnOptions.forEach(function (button) {\n if (button.key === btn.key && !(btn.key == 'js' || btn.key == 'url' || btn.key == 'switch' || btn.key == 'batchUpdate')) {\n button.disabled = true;\n }\n });\n var manageField = {\n desc: btn.value,\n name: btn.key,\n type: '1',\n openType: 'old',\n QRCodePattern: false,\n disabled: false\n };\n\n if (!this.noRights) {\n manageField.right = JSON.stringify([{\n type: 'everyone'\n }]);\n }\n\n if (btn.key === 'import') {\n manageField.limit = 1000;\n }\n\n this.manageFields.push(manageField);\n } else {\n this.$message({\n type: 'warning',\n message: '所有按钮都添加好了, 不能继续再添加!'\n });\n }\n },\n //处理按钮切换\n handleManageChange: function handleManageChange(row) {\n var _this4 = this;\n\n //切换按钮类型置空映射字段\n if (row.display) {\n row.display = [];\n this.refreshTime = new Date().getTime();\n }\n\n this.defaultBtnOptions.forEach(function (btn) {\n if (btn.key == row.name) {\n if (btn.limit) {\n row.limit = btn.limit;\n }\n\n row.desc = btn.value;\n }\n\n btn.disabled = false;\n });\n var alreadyAddedFields = new Map();\n this.manageFields.forEach(function (manageField) {\n alreadyAddedFields.set(manageField.name, manageField.name);\n\n _this4.defaultBtnOptions.forEach(function (btn) {\n if (manageField.name === btn.key && !(btn.key == 'js' || btn.key == 'url' || btn.key == 'switch' || btn.key == 'batchUpdate')) {\n btn.disabled = true;\n }\n });\n });\n this.btnoptions = this.defaultBtnOptions.filter(function (btn) {\n return !alreadyAddedFields.has(btn.key);\n }); //如果按钮类型不是新增、编辑、明细、删除时,移动端显示\n\n if (row.name != 'add' && row.name != 'edit' && row.name != 'detail' && row.name != 'del') {\n row.mpDisplay = '2';\n }\n },\n //打开设置权限\n setFieldRightDialog: function setFieldRightDialog(row) {\n var conf = {\n right: JSON.parse(row.right),\n permissionList: this.permissionList\n };\n this.currentAuthRow = row;\n this.$refs.eipAuthDialog.showDialog(conf);\n },\n //设置权限\n authDialogOnConfirm: function authDialogOnConfirm(data) {\n if (this.currentAuthRow) {\n this.currentAuthRow.right = JSON.stringify(data);\n }\n },\n //显示权限信息\n rightToDesc: function rightToDesc(right) {\n if (right) {\n try {\n right = JSON.parse(right);\n } catch (error) {}\n }\n\n var desc = '';\n\n var _this = this;\n\n right.forEach(function (r) {\n if (desc) {\n desc += ' 和 ';\n }\n\n var str = _this.permissionMap[r.type];\n\n if (r.name) {\n str += ':' + r.name;\n } else if (r.id) {\n str += ':' + r.id;\n }\n\n desc += str;\n });\n return desc;\n },\n //标题统一权限设置\n mrightRenderHeader: function mrightRenderHeader(h, para) {\n //下拉框选项\n var _this = this;\n\n var rights = [{\n key: '',\n value: '请选择'\n }, {\n key: 'none',\n value: '无'\n }, {\n key: 'everyone',\n value: '所有人'\n }];\n var rightMap = {\n '': '请选择',\n none: '无',\n everyone: '所有人'\n }; //下拉框内容包裹在一个div里面\n\n return h('div', {}, [h('span', {\n //div里面有一个文字提示:下拉框所属内容\n style: {},\n class: 'level-font-class'\n }, para.column.label), h('el-select', {\n //el-select实现下拉框\n size: 'mini',\n style: {\n width: '120px',\n marginLeft: '10px'\n },\n on: {\n input: function input(value) {\n //随着下拉框的不同,文字框里的内容在边\n _this.rightLab = rightMap[value];\n\n if (value && _this.manageFields && _this.manageFields.length > 0) {\n _this.manageFields.forEach(function (field) {\n if (field.right) {\n try {\n field.right = JSON.parse(field.right);\n } catch (error) {}\n }\n\n if (field.right[0].hasOwnProperty('v')) {\n field.right[0] = {\n v: value\n };\n } else {\n field.right[0] = {\n type: value\n };\n }\n\n field.right = JSON.stringify(field.right);\n });\n }\n }\n },\n props: {\n value: _this.rightLab //文字框的内容取决于这个value,如果value不存在,会报错\n\n }\n }, [//下拉框里面填充选项,通过rights遍历map,为每一个选项赋值。\n rights.map(function (item) {\n return h('el-option', {\n props: {\n value: item.key,\n label: item.value\n }\n });\n })])]);\n },\n //URL按钮和开关按钮设置事件\n setButtonValue: function setButtonValue(option, row) {\n this.dialogVisible = true;\n\n if (option === 'url') {\n this.dialogTitle = '设置Url地址';\n this.url = row.url;\n } else if (option === 'switch') {\n this.dialogTitle = '设置开关值';\n this.switchOn = row.switchOn;\n this.switchOff = row.switchOff;\n this.switchOnLabel = row.switchOnLabel;\n this.switchOffLabel = row.switchOffLabel;\n }\n\n this.dialogModel = row;\n },\n //设置URL按钮和开关后确认\n dialogOnconfirm: function dialogOnconfirm() {\n if (this.dialogTitle === '设置开关值') {\n this.dialogModel.switchOn = this.switchOn;\n this.dialogModel.switchOff = this.switchOff;\n this.dialogModel.isActive = 'off';\n this.dialogModel.switchDefaultTrue = this.switchDefaultTrue;\n this.dialogModel.switchOnLabel = this.switchOnLabel;\n this.dialogModel.switchOffLabel = this.switchOffLabel;\n\n if (!this.switchOn || !this.switchOff) {\n this.$message({\n type: 'warning',\n message: '开关需要设置开时值和关时值'\n });\n }\n } else if (this.dialogTitle === '设置Url地址') {\n this.dialogModel.url = this.url;\n }\n\n this.dialogVisible = false;\n },\n initMpDisplay: function initMpDisplay(row) {\n this.$set(row, 'mpDisplay', '2');\n },\n setAuth: function setAuth(row) {\n var param = {\n formKey: this.dataTemplate.formKey,\n dataKey: this.dataTemplate.alias,\n type: row.name === 'add' ? 3 : row.name === 'edit' ? 4 : 5\n };\n this.$refs.flowFormAuth.showDialog(param);\n },\n batchUpdateOk: function batchUpdateOk() {\n var _this5 = this;\n\n var me_ = this;\n utils.validateForm(this, 'form').then(function (r) {\n me_.batchUpdateVisible = false;\n me_.manageFields[me_.index].batchUpdateData = Base64.encode(JSON.stringify(me_.batchUpdateData));\n me_.manageFields[me_.index].filedsObj = Base64.encode(JSON.stringify(me_.filedsObj));\n }).catch(function (items) {\n _this5.$message.error(\"\\u8FD8\\u6709\\u5185\\u5BB9\\u672A\\u586B\\u5199\\u3002\");\n });\n },\n fillToDisplay: function fillToDisplay(row, event, column) {\n var isIn = this.isInDisplayFields(row.name);\n\n if (!isIn) {\n var fileds = {\n name: row.name,\n desc: row.desc,\n type: row.type\n };\n this.exportSettingFields.push(fileds);\n }\n },\n isInDisplayFields: function isInDisplayFields(name) {\n var isIn = false;\n\n if (this.exportSettingFields && this.exportSettingFields.length > 0) {\n this.exportSettingFields.forEach(function (obj) {\n if (obj.name == name) {\n isIn = true;\n return;\n }\n });\n }\n\n return isIn;\n },\n allFillToDisplay: function allFillToDisplay() {\n var _this6 = this;\n\n var selectrows = this.$refs.displaySettingTable.store.states.selection;\n\n if (!selectrows || selectrows.length < 1) {\n this.$message({\n message: '请在左侧列表中选择要显示的字段',\n type: 'warning'\n });\n }\n\n selectrows.forEach(function (obj) {\n if (!_this6.isInDisplayFields(obj.name)) {\n var fileds = {\n name: obj.name,\n desc: obj.desc,\n type: obj.type\n };\n\n _this6.exportSettingFields.push(fileds);\n }\n });\n },\n removeExport: function removeExport(index) {\n this.exportSettingFields.splice(index, 1);\n },\n setExport: function setExport(row, index) {\n this.exportSettingFields = [];\n\n if (row.exportSettingFields) {\n this.exportSettingFields = JSON.parse(Base64.decode(row.exportSettingFields));\n }\n\n this.index = index;\n var displayExportSettingFields = [];\n this.displaySettingFields.forEach(function (obj) {\n displayExportSettingFields.push({\n name: obj.name,\n desc: obj.desc,\n type: obj.type\n });\n });\n\n if (this.data.displaySettingFields) {\n var displayField = JSON.parse(this.data.displaySettingFields);\n displayField.forEach(function (item) {\n var findObj = displayExportSettingFields.find(function (row) {\n return item.name == row.name;\n });\n\n if (findObj == undefined) {\n displayExportSettingFields.push({\n name: item.name,\n desc: item.desc,\n type: item.type\n });\n }\n });\n }\n\n this.displayExportSettingFields = displayExportSettingFields;\n this.exportUpdateVisible = true;\n },\n exportOk: function exportOk() {\n if (this.exportSettingFields) {\n this.manageFields[this.index].exportSettingFields = Base64.encode(JSON.stringify(this.exportSettingFields));\n } else {\n this.manageFields[this.index].exportSettingFields = '';\n }\n\n this.exportUpdateVisible = false;\n },\n setButtonUpdate: function setButtonUpdate(row, index) {\n this.$set(this, 'batchUpdateData', this.$options.data().batchUpdateData);\n\n if (row.batchUpdateData) {\n this.batchUpdateData = JSON.parse(Base64.decode(row.batchUpdateData));\n }\n\n this.batchUpdateVisible = true;\n this.index = index;\n },\n resetOutConfig: function resetOutConfig(row, index) {\n debugger;\n\n if (row.outValueType && row.outValueType != 'input' && row.outValueType != 'data' && row.outValueType != 'number') {\n this.outConfig = {\n type: row.outValueType,\n choiceType: 'static',\n parameter: {},\n selectData: [],\n customQuery: {\n alias: '',\n valueBind: '',\n labelBind: ''\n },\n dialogConfig: {\n name: '请选择'\n }\n };\n row.outConfig = JSON.stringify(this.outConfig);\n }\n },\n setOutValue: function setOutValue(row, index) {\n Object.assign(this.$data.outConfig, this.$options.data().outConfig);\n this.outIndex = index;\n this.outConfig.type = row.outValueType;\n this.outConfig.bind = row.name;\n\n if (row.outConfig) {\n this.outConfig = JSON.parse(row.outConfig);\n\n if (!this.outConfig.customQuery) {\n this.outConfig.customQuery = {\n valueBind: '',\n labelBind: ''\n };\n }\n }\n\n this.outValueTypeVisible = true;\n },\n outValueOk: function outValueOk() {\n this.batchUpdateData[this.outIndex].outConfig = JSON.stringify(this.outConfig);\n this.outValueTypeVisible = false;\n },\n addBatchUpdategData: function addBatchUpdategData() {\n this.batchUpdateData.push({});\n },\n afterCustomQueryLoadData: function afterCustomQueryLoadData(data) {\n this.customQuerys = data.rows;\n },\n afterCustomDialogLoadData: function afterCustomDialogLoadData(data) {\n this.customDialogs = data;\n },\n changeCustDialog: function changeCustDialog(value) {\n var _this = this;\n\n _this.outConfig.dialogConfig.conditions = [];\n this.outConfig.dialogConfig.mappingConf = [];\n this.outConfig.dialogConfig.custQueryJson = [];\n this.outConfig.dialogConfig.selectNum = '';\n var obj = this.customDialogs.find(function (item) {\n return item.alias == value;\n });\n\n if (obj) {\n this.outConfig.dialogConfig.selectNum = obj.selectNum;\n var treeData;\n\n if (obj.style === 2) {\n var combineConfig = JSON.parse(obj.combinationRule);\n var listDialog = this.customDialogs.find(function (item) {\n return item.alias == combineConfig.rightDialog;\n });\n treeData = JSON.parse(listDialog.resultfield);\n this.outConfig.dialogConfig.type = 'combiDialog';\n }\n\n if (obj.listDialog && obj.listDialog.resultfield) {\n treeData = eval('(' + obj.listDialog.resultfield + ')');\n this.outConfig.dialogConfig.type = 'combiDialog';\n }\n\n if (obj.resultfield && obj.resultfield !== '[]') {\n treeData = eval('(' + obj.resultfield + ')');\n this.outConfig.dialogConfig.type = 'custDialog';\n }\n\n for (var q = 0, f; f = treeData[q++];) {\n f.field = f.comment;\n }\n\n this.outConfig.dialogConfig.resultField = treeData;\n var conditionList = eval('(' + obj.conditionfield + ')');\n var conditions = []; //只处理类型等于1的对话框参数(defaultType:1:用户输入,2:固定值 ,3:参数传入)\n\n if (conditionList && conditionList.length > 0) {\n for (var j = 0, c; c = conditionList[j++];) {\n if (c.defaultType == '3') {\n var has = false;\n if (!has) conditions.push(c);\n }\n }\n }\n\n this.outConfig.dialogConfig.conditions = conditions;\n }\n },\n setCurrentCustomQuery: function setCurrentCustomQuery() {\n var _this = this;\n\n _this.outConfig.customQuery.labelBind = '';\n _this.outConfig.customQuery.valueBind = '';\n\n _this.customQuerys.forEach(function (item) {\n if (_this.outConfig.customQuery.alias == item.alias) {\n if (typeof item.conditionfield == 'string') {\n item.conditionfield = JSON.parse(item.conditionfield); //parseToJson(item.customQuery.conditionfield);\n\n item.resultfield = JSON.parse(item.resultfield); // parseToJson(item.customQuery.resultfield);\n } //把当前对象克隆一份到控件属性配置\n\n\n Object.assign(_this.outConfig.customQuery, item);\n\n _this.slimCustomQuery(_this.outConfig.customQuery);\n }\n });\n },\n slimCustomQuery: function slimCustomQuery(customQuery) {\n if (customQuery && customQuery.constructor == Object) {\n // 删除多余的属性\n delete customQuery['id'];\n delete customQuery['createTime'];\n delete customQuery['pkVal'];\n delete customQuery['objName'];\n delete customQuery['needPage'];\n delete customQuery['pageSize'];\n delete customQuery['dsalias'];\n delete customQuery['dataParam'];\n delete customQuery['sortfield'];\n delete customQuery['diySql'];\n delete customQuery['isTable'];\n delete customQuery['sqlBuildType']; // delete customQuery[\"dsType\"];\n\n delete customQuery['url'];\n delete customQuery['header'];\n delete customQuery['requestType'];\n delete customQuery['pageKey'];\n delete customQuery['pageSizeKey'];\n delete customQuery['totalKey'];\n delete customQuery['listKey'];\n }\n }\n }\n};",null]}