{"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\\DisplaySetting.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\dataTemplate\\DisplaySetting.vue","mtime":1675071992131},{"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/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport _toConsumableArray from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 EipDataTemplateDialog = function EipDataTemplateDialog() {\n return import('@/components/dialog/EipDataTemplateDialog.vue');\n};\n\nvar BTN_TYPE = {\n isShow: '1',\n notShow: '2'\n};\nexport default {\n components: {\n eipAuthDialog: eipAuthDialog,\n EipDataTemplateDialog: EipDataTemplateDialog\n },\n name: 'display-setting',\n props: ['data'],\n data: function data() {\n return {\n btnType: BTN_TYPE,\n //移动端显示隐藏按钮\n activeName: 'formatter',\n reportName: '',\n conditionField: [],\n dataTemplate: {},\n displaySettingFields: [],\n displayFields: [],\n permissionMap: {},\n permissionList: [],\n rightList: [{\n key: '',\n value: '请选择'\n }, {\n key: 'none',\n value: '无'\n }, {\n key: 'everyone',\n value: '所有人'\n }],\n tabHeight: \"\".concat(document.documentElement.clientHeight) - 245,\n currentAuthRow: null,\n settingVisible: false,\n selectedRow: {},\n proSetting2: true,\n formFieldList: [],\n urlParams: [],\n defaultRight: '[{\"type\":\"everyone\",\"id\":\"\",\"name\":\"\",\"script\":\"\"}]',\n sqlConfigDialog: false,\n sql: '',\n sqlConfigRow: {},\n isShowRuleSettingDialog: false,\n cmOptions: {\n value: ' ',\n mode: 'javascript',\n readOnly: false,\n tabSize: 3,\n theme: 'base16-light',\n lineNumbers: true,\n line: true\n },\n diyScript: '',\n ruleSettingIndex: '',\n dialogRuleData: '',\n multipleSelection: [],\n rightLab: ''\n };\n },\n computed: {\n calOptions: function calOptions() {\n return [{\n key: 100,\n value: '按100计算'\n }, {\n key: 10,\n value: '按10计算'\n }, {\n key: 1,\n value: '按1计算'\n }, {\n key: this.selectedRow.diyProRule,\n value: '输入统计总数'\n }];\n }\n },\n mounted: function mounted() {\n if (this.data.bpmDataTemplate.displayField) {\n var displayFields = JSON.parse(this.data.bpmDataTemplate.displayField);\n\n for (var i = 0; i < displayFields.length; i++) {\n if (!displayFields[i].formatterData) {\n displayFields[i].formatterData = [];\n }\n\n if (!displayFields[i].ruleSettings) {\n displayFields[i].ruleSettings = [];\n }\n }\n\n this.data.bpmDataTemplate.displayField = JSON.stringify(displayFields);\n }\n\n this.dataTemplate = this.data.bpmDataTemplate;\n this.displaySettingFields = _toConsumableArray(this.data.fields);\n this.templates = this.data.templates;\n this.permissionMap = this.data.permissionList;\n this.initData();\n },\n methods: {\n btnChange: function btnChange(row) {\n this.$set(row, 'mpDisplay', row.mpDisplay === '1' ? '2' : '1');\n },\n dialogOk: function dialogOk() {\n var _this2 = this;\n\n var conditionField = this.conditionField;\n var isDislogClose = true;\n this.selectedRow.parameter = [];\n conditionField.forEach(function (item) {\n _this2.selectedRow.parameter.push({\n property: item.key,\n value: item.parameter,\n group: 'main',\n operation: item.qt,\n relation: 'AND'\n });\n });\n\n if (this.selectedRow.urlType == 'url' && this.urlParams) {\n this.urlParams.forEach(function (param) {\n var paramText = /^[a-zA-Z][a-zA-Z0-9]+$/;\n\n if (!paramText.test(param.name)) {\n isDislogClose = false;\n\n _this2.$message.warning('参数名称格式有误');\n }\n });\n\n if (isDislogClose) {\n this.selectedRow.urlParams = _toConsumableArray(this.urlParams);\n this.urlParams = [];\n }\n }\n\n if (isDislogClose) {\n this.settingVisible = false;\n }\n },\n onDataTemplateConfirm: function onDataTemplateConfirm(selectedNode) {\n var _this3 = this;\n\n if (selectedNode && selectedNode.length > 0) {\n this.$nextTick(function () {\n _this3.conditionField = [];\n var conditionField = JSON.parse(selectedNode[0].conditionField);\n conditionField.forEach(function (item) {\n var obj = {\n key: item.colPrefix + item.name,\n parameter: '',\n qt: item.qt,\n value: item.cm\n };\n\n _this3.conditionField.push(obj);\n });\n _this3.reportName = selectedNode[0].name;\n _this3.selectedRow.reportNameConfigure = {\n alias: selectedNode[0].alias,\n reportName: selectedNode[0].name,\n conditionField: _this3.conditionField\n };\n });\n } else {\n this.reportName = '';\n this.conditionField = [];\n this.selectedRow.reportNameConfigure = {};\n }\n },\n //保存显示列数据\n saveDisplayField: function saveDisplayField() {\n this.dataTemplate.displayField = this.displayFields ? JSON.stringify(this.displayFields) : null;\n },\n validateDisplayField: function validateDisplayField() {\n for (var i = 0; i < this.displayFields.length; i++) {\n if (this.displayFields[i].customColumn && !this.displayFields[i].name) {\n this.$message.warning(\"\\u8BF7\\u5B8C\\u5584\\u663E\\u793A\\u5B57\\u6BB5\\u7B2C\".concat(i + 1, \"\\u5217\\u865A\\u62DF\\u5B57\\u6BB5\\u7684\\u5217\\u540D\"));\n return false;\n }\n }\n\n return true;\n },\n //初始化处理\n initData: function initData() {\n if (this.dataTemplate.displayField) {\n this.displayFields = JSON.parse(this.dataTemplate.displayField);\n }\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\n if (this.dataTemplate.formField) {\n this.formFieldList = [];\n var formFieldList = JSON.parse(this.dataTemplate.formField);\n var fieldMap = {};\n\n var _this = this;\n\n formFieldList.forEach(function (ffield) {\n if (!fieldMap[ffield.name]) {\n _this.formFieldList.push(ffield);\n\n fieldMap[ffield.name] = true;\n }\n });\n }\n },\n showDataTemplateDialog: function showDataTemplateDialog() {\n this.$refs.dataTemplateDialog.showDialog();\n },\n columnFilter: function columnFilter(type) {\n return type != 'sub' && type != 'tabs';\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 showFlowField: row.showFlowField,\n right: this.defaultRight\n };\n this.displayFields.push(fileds);\n }\n },\n //将字段列表中的已选字段加入到显示字段列表\n allFillToDisplay: function allFillToDisplay() {\n var _this4 = 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 (!_this4.isInDisplayFields(obj.name)) {\n var fileds = {\n name: obj.name,\n desc: obj.desc,\n type: obj.type,\n showFlowField: obj.showFlowField,\n right: _this4.defaultRight\n };\n\n _this4.displayFields.push(fileds);\n }\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 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 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 //删除显示字段\n remove: function remove(index) {\n this.displayFields.splice(index, 1);\n },\n //判断字段是否已在显示字段列表中\n isInDisplayFields: function isInDisplayFields(name) {\n var isIn = false;\n\n if (this.displayFields && this.displayFields.length > 0) {\n this.displayFields.forEach(function (obj) {\n if (obj.name == name) {\n isIn = true;\n return;\n }\n });\n }\n\n return isIn;\n },\n //显示权限信息\n rightToDesc: function rightToDesc(right) {\n if (right) {\n right = JSON.parse(right);\n } else {\n return '无';\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 rightRenderHeader: function rightRenderHeader(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.displayFields && _this.displayFields.length > 0) {\n _this.displayFields.forEach(function (field) {\n if (field.right) {\n field.right = JSON.parse(field.right);\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 setting: function setting(row) {\n this.settingVisible = true;\n this.selectedRow = row;\n\n if (this.selectedRow.reportNameConfigure) {\n this.reportName = this.selectedRow.reportNameConfigure.reportName;\n this.conditionField = this.selectedRow.reportNameConfigure.conditionField == undefined ? [] : this.selectedRow.reportNameConfigure.conditionField;\n }\n\n if (!this.selectedRow.ruleSettings) {\n this.selectedRow.ruleSettings = [];\n }\n\n this.selectedRow.diyProRule = 0;\n\n if (!this.selectedRow.formatterData) {\n this.selectedRow.formatterData = [];\n }\n /* this.selectedRow.ruleSetting = 100;*/\n\n\n if (this.selectedRow.proSetting) {\n this.proSetting2 = true;\n } else {\n this.selectedRow.proSetting = false;\n this.proSetting2 = false;\n }\n\n if (this.selectedRow.urlType == 'url' && this.selectedRow.urlParams && this.selectedRow.urlParams.length > 0) {\n this.urlParams = _toConsumableArray(this.selectedRow.urlParams);\n }\n },\n addSetting: function addSetting() {\n this.selectedRow.formatterData.push({\n key_: '',\n value_: ''\n });\n },\n removeSetting: function removeSetting(index) {\n this.selectedRow.formatterData.splice(index, 1);\n },\n removeProSetting: function removeProSetting(index) {\n this.selectedRow.ruleSettings.splice(index, 1);\n },\n cancelSetting: function cancelSetting() {\n this.settingVisible = false;\n this.selectedRow.formatterData = [];\n },\n urlParamsAdd: function urlParamsAdd() {\n this.urlParams.push({\n name: '',\n field: ''\n });\n },\n urlParamsRemove: function urlParamsRemove(item) {\n this.urlParams.remove(item);\n },\n initMpDisplay: function initMpDisplay(row) {\n this.$set(row, 'mpDisplay', '2');\n },\n // 添加自定义列值\n addCustomColumn: function addCustomColumn() {\n this.displayFields.push({\n desc: '',\n name: '',\n right: '[{\"type\":\"everyone\",\"id\":\"\",\"name\":\"\",\"script\":\"\"}]',\n showFlowField: true,\n type: 'varchar',\n sql: '',\n customColumn: true\n });\n },\n delCustomColumn: function delCustomColumn() {\n var names = this.multipleSelection.map(function (item) {\n return item.name;\n });\n this.displayFields = this.displayFields.filter(function (item) {\n return !names.includes(item.name);\n });\n },\n sqlDialogShow: function sqlDialogShow(row) {\n this.sqlConfigDialog = true;\n this.sqlConfigRow = row;\n\n if (row.sql) {\n this.sql = row.sql;\n }\n },\n sqlConfigOk: function sqlConfigOk() {\n var _this5 = this;\n\n this.displayFields.forEach(function (field) {\n if (field.name == _this5.sqlConfigRow.name) {\n field.sql = _this5.sql;\n _this5.sql = '';\n }\n });\n this.sqlConfigDialog = false;\n },\n //添加显示设置\n addProSetting: function addProSetting() {\n this.selectedRow.ruleSettings.push({\n proColor: '',\n proRule: ''\n });\n },\n //弹窗规则设置对话框\n showRuleSettingDialog: function showRuleSettingDialog(proRule, index) {\n this.ruleSettingIndex = index;\n this.dialogRuleData = proRule;\n this.isShowRuleSettingDialog = true;\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(' ' + myValue + ' ', pos); //adds a new line\n },\n methodOk: function methodOk() {\n this.selectedRow.ruleSettings[this.ruleSettingIndex].proRule = this.dialogRuleData;\n this.dialogRuleData = '';\n this.isShowRuleSettingDialog = false;\n },\n proSwitchChange: function proSwitchChange(data) {\n this.selectedRow.proSetting = data;\n\n if (data) {\n this.selectedRow.diyProRule = 0;\n }\n },\n diyProRuleChange: function diyProRuleChange(val) {\n this.$set(this.selectedRow, 'diyProRule', val);\n\n if (val == 1 || val == 10 || val == 100) {\n this.$set(this.selectedRow, 'diyProRule', 0);\n }\n\n this.$set(this.selectedRow, 'ruleSetting', val);\n },\n handleSelectionChange: function handleSelectionChange(val) {\n this.multipleSelection = val;\n }\n }\n};",null]}