diff --git a/src/resources/api/cmdb/ci/ci.js b/src/resources/api/cmdb/ci/ci.js index 0b7840861b88de6e0ab354025ceb8b71e94eab12..f646a76c884ba587aaf3435843be7ec4042f2460 100644 --- a/src/resources/api/cmdb/ci/ci.js +++ b/src/resources/api/cmdb/ci/ci.js @@ -193,6 +193,9 @@ const ci = { getCiForprocessmapping(params) { //获取模型信息(流程图cmdb节点关系映射专用) return axios.post('/api/rest/cmdb/ci/get/forprocessmapping', params); + }, + searchCiListAttr(params) { + return axios.post('/api/rest/cmdb/ci/listattr', params); } }; diff --git a/src/resources/api/cmdb/customview/customview.js b/src/resources/api/cmdb/customview/customview.js index bf821e205d65701545a74a8f30c44614f797a830..41ec8adbae17a7f965bcfabaef5c6819d047ea55 100644 --- a/src/resources/api/cmdb/customview/customview.js +++ b/src/resources/api/cmdb/customview/customview.js @@ -45,6 +45,10 @@ const customview = { }, deleteCustomViewTemplate(id) { return axios.post('/api/rest/cmdb/customview/template/delete', { customViewId: id }); + }, + searchCustomAttrData(params) { + // 查询公共自定义视图属性接口 + return axios.post('/api/rest/cmdb/customview/attr/get', params); } }; diff --git a/src/resources/assets/languages/page/en.json b/src/resources/assets/languages/page/en.json index 4be6117e19301e9094633e66c1019dafec48614c..18fe60813f18934eedd34f5b26e612584c638d15 100644 --- a/src/resources/assets/languages/page/en.json +++ b/src/resources/assets/languages/page/en.json @@ -960,5 +960,6 @@ "existiscoverimport": "{type}【{target}】 already exists. Do you want to continue importing and overwrite it", "userauthfailedpleaselogin": "authentication failed, please log in", "partial": "local", - "rolerule": "The request for login authentication needs to carry a header as a rule expression. If the value of the expression after execution is true, the role will take effect, otherwise it will not take effect. For example: \"${DATA.env}\"==\"sit\"ß&&(\"${DATA.test}\"=\"1\" | | \"${DATA.test2}\"==\"aaa\")" + "rolerule": "The request for login authentication needs to carry a header as a rule expression. If the value of the expression after execution is true, the role will take effect, otherwise it will not take effect. For example: \"${DATA.env}\"==\"sit\"ß&&(\"${DATA.test}\"=\"1\" | | \"${DATA.test2}\"==\"aaa\")", + "datasources": "data sources" } \ No newline at end of file diff --git a/src/resources/assets/languages/page/zh.json b/src/resources/assets/languages/page/zh.json index cf21b6d1adfa04a4a9fee4d332d492a5dfba7e53..1c74c6c0d97c7d7a4ab2360f6bfdb1bc796b63f8 100644 --- a/src/resources/assets/languages/page/zh.json +++ b/src/resources/assets/languages/page/zh.json @@ -962,5 +962,6 @@ "existiscoverimport": "{type}【{target}】已存在,是否继续导入并覆盖", "userauthfailedpleaselogin": "认证失败,请重新登录", "partial": "局部", - "rolerule": "登录认证的请求需要携带Header做规则表达式(注意表达式中header参数全小写),如果表达式执行后的值为true则该角色生效,false和语法异常都不生效 。 如:\"${DATA.env}\"==\"sit\"&&(\"${DATA.test}\"==\"1\"||\"${DATA.test2}\"==\"aaa\")" + "rolerule": "登录认证的请求需要携带Header做规则表达式(注意表达式中header参数全小写),如果表达式执行后的值为true则该角色生效,false和语法异常都不生效 。 如:\"${DATA.env}\"==\"sit\"&&(\"${DATA.test}\"==\"1\"||\"${DATA.test2}\"==\"aaa\")", + "datasources": "数据来源" } \ No newline at end of file diff --git a/src/resources/assets/languages/term/en.json b/src/resources/assets/languages/term/en.json index 7dc25857ed074d04a785596834f4e5c0f214296f..27ece7d50a63bd6ea1717184c91b3d02e49b6954 100644 --- a/src/resources/assets/languages/term/en.json +++ b/src/resources/assets/languages/term/en.json @@ -527,7 +527,8 @@ "eoadealwithusertip": "After setting the processor for the template, the processor cannot be modified during the editing process", "approvalstep": "Approval steps", "approvalprocess": "Approval process", - "approvalprocesstip": "At least one node must be added outside the [Create Sign off] node" + "approvalprocesstip": "At least one node must be added outside the [Create Sign off] node", + "matchmapping": "Matching mapping" }, "autoexec": { "addrootdirectory": "Add root directory", diff --git a/src/resources/assets/languages/term/zh.json b/src/resources/assets/languages/term/zh.json index 3900fa1ccbf41dc7367794845fb1fad03f3ba974..7f9e17261cfc10fd8aadcace94427e94bf1e5346 100644 --- a/src/resources/assets/languages/term/zh.json +++ b/src/resources/assets/languages/term/zh.json @@ -526,7 +526,8 @@ "eoadealwithusertip": "模板设置处理人后,编辑流程时中不可修改处理人", "approvalstep": "审批步骤", "approvalprocess": "审批流", - "approvalprocesstip": "在【创建签报】节点之外,至少要添加一个节点" + "approvalprocesstip": "在【创建签报】节点之外,至少要添加一个节点", + "matchmapping": "匹配映射" }, "autoexec": { "addrootdirectory": "添加根目录", diff --git a/src/views/pages/process/flow/flow-edit.vue b/src/views/pages/process/flow/flow-edit.vue index 6a5dcde480b98f977bf27e2cd512fb2364527133..e482b46cbb36991202f59726667e25e430a3a42b 100644 --- a/src/views/pages/process/flow/flow-edit.vue +++ b/src/views/pages/process/flow/flow-edit.vue @@ -1082,7 +1082,6 @@ export default { }, //获取分派器下拉列表 getWorkerdispatcher() { - let _this = this; let data = {}; this.$api.process.process .workerdispatcher(data) diff --git a/src/views/pages/process/flow/flow-valid.js b/src/views/pages/process/flow/flow-valid.js index 60bef187025f7d98409d0168529a340d80a093f1..b5740c8166abeb1b68867ddb241bd1c89fe91f62 100644 --- a/src/views/pages/process/flow/flow-valid.js +++ b/src/views/pages/process/flow/flow-valid.js @@ -1,7 +1,8 @@ import utils from '@/resources/assets/js/util.js'; import { $t } from '@/resources/init.js'; let valid = { - common(nodeConfig, d, that) { //公共校验方法 校验名称 + common(nodeConfig, d, that) { + //公共校验方法 校验名称 let validList = this.poliyUser(nodeConfig, d, that) || []; if (!nodeConfig.name) { validList.push({ @@ -24,7 +25,8 @@ let valid = { } return validList; }, - poliyUser(nodeConfig, d, that) { //分派处理人校验 + poliyUser(nodeConfig, d, that) { + //分派处理人校验 // 分派处理人校验 let validList = []; let nodeData = nodeConfig.stepConfig || {}; @@ -32,11 +34,13 @@ let valid = { let isStart = parentNodes.find(d => { return d.getConfig() && d.getConfig().handler === 'start'; }); - if (isStart) { //如果是开始节点 + if (isStart) { + //如果是开始节点 return validList; } let extendsHandlerList = ['condition', 'distributary', 'changehandle', 'timer']; - if (!nodeData.workerPolicyConfig && extendsHandlerList.indexOf(nodeConfig.handler) < 0) { //分派处理人必填 + if (!nodeData.workerPolicyConfig && extendsHandlerList.indexOf(nodeConfig.handler) < 0) { + //分派处理人必填 validList.push({ name: $t('form.validate.required', { target: $t('term.process.poliyuser') }), href: '#assignData' @@ -52,10 +56,10 @@ let valid = { let errorText = $t('form.validate.required', { target: $t('term.process.poliyuser') }); if (isChecked) { let keyConfig = { - 'prestepassign': { value: 'processStepUuidList', text: $t('term.process.prestepassignvalid') }, //由前置步骤处理人指定 - 'copy': { value: 'processStepUuid', text: $t('term.process.copyworkerpolicyvalid') }, //复制前置步骤处理人 - 'form': { value: 'attributeUuidList', text: $t('term.process.formworkerpolicyvalid') }, //表单值 - 'assign': { value: 'workerList', text: $t('term.process.assignworkerpolicyvalid') }//自定义 + prestepassign: { value: 'processStepUuidList', text: $t('term.process.prestepassignvalid') }, //由前置步骤处理人指定 + copy: { value: 'processStepUuid', text: $t('term.process.copyworkerpolicyvalid') }, //复制前置步骤处理人 + form: { value: 'attributeUuidList', text: $t('term.process.formworkerpolicyvalid') }, //表单值 + assign: { value: 'workerList', text: $t('term.process.assignworkerpolicyvalid') } //自定义 }; for (let i = 0; i < policyList.length; i++) { if (policyList[i].isChecked == 1) { @@ -81,7 +85,8 @@ let valid = { errorText = keyConfig[type].text; break; } - } else if (policyList[i].type == 'automatic') { //分派器 + } else if (policyList[i].type == 'automatic') { + //分派器 if (policyList[i].config.handler && policyList[i].config.handler != '') { if (policyList[i].config.handlerConfig != {}) { let newObj = that.automaticList.find(d => d.handler === policyList[i].config.handler); @@ -100,7 +105,7 @@ let valid = { for (let key in row) { if (row.hasOwnProperty(key)) { let val = row[key]; - if (that.$utils.isEmpty(val)) { + if (that.$utils.isEmpty(val) || this.validCmdbDispatcher(policyList[i].config.handler, key, val)) { isChecked = 0; errorText = $t('term.process.assignconfigvalid'); break; @@ -132,11 +137,13 @@ let valid = { } return validList; }, - omnipotent(nodeConfig, d, that) { //通用节点 + omnipotent(nodeConfig, d, that) { + //通用节点 let validList = []; return validList; }, - automatic(nodeConfig, d, that) { //auto 自动处理节点校验 + automatic(nodeConfig, d, that) { + //auto 自动处理节点校验 let validList = []; let nodeData = nodeConfig.stepConfig || {}; if (nodeConfig.handler === 'automatic') { @@ -172,7 +179,8 @@ let valid = { } return validList; }, - changecreate(nodeConfig, d, that) { //变更创建的校验 + changecreate(nodeConfig, d, that) { + //变更创建的校验 let validList = []; let nodeData = nodeConfig.stepConfig || {}; if (nodeConfig.handler === 'changecreate') { @@ -200,7 +208,8 @@ let valid = { } return validList; }, - changehandle(nodeConfig, d, that) { //变更处理的校验 + changehandle(nodeConfig, d, that) { + //变更处理的校验 let validList = []; let nodeData = nodeConfig.stepConfig || {}; let allPrevNodes = d.getAllPrevNodes(); @@ -219,7 +228,8 @@ let valid = { } return validList; }, - cientitysync(nodeConfig, d, that) { //配置项同步 + cientitysync(nodeConfig, d, that) { + //配置项同步 let validList = []; //20210518_这里的数据结构:原来nodeConfig.config的数据都变成nodeConfig.stepConfig里的数据 let nodeData = nodeConfig.stepConfig || {}; @@ -246,7 +256,8 @@ let valid = { } return validList; }, - cmdbsync(nodeConfig, d, that) { //cmdb + cmdbsync(nodeConfig, d, that) { + //cmdb let validList = []; let nodeData = nodeConfig.stepConfig || {}; let ciEntityConfig = nodeData.ciEntityConfig || {}; @@ -266,7 +277,8 @@ let valid = { } return validList; }, - autoexec(nodeConfig, d, that) { //自动化节点 + autoexec(nodeConfig, d, that) { + //自动化节点 let validList = []; let nodeData = nodeConfig.stepConfig || {}; let autoexecConfig = nodeData.autoexecConfig || {}; @@ -279,14 +291,15 @@ let valid = { } if (that.$utils.isEmpty(autoexecConfig.configList)) { validList.push({ - name: $t('form.validate.leastonetarget', { 'target': $t('term.autoexec.job') }), + name: $t('form.validate.leastonetarget', { target: $t('term.autoexec.job') }), href: '#autoexecCombop' }); } } return validList; }, - timer(nodeConfig, d, that) { //定时节点 + timer(nodeConfig, d, that) { + //定时节点 let validList = []; let validObj = { name: $t('form.validate.required', { target: $t('term.process.circulationtime') }), @@ -309,11 +322,25 @@ let valid = { } } return validList; + }, + handleDispatcherName(dispatcherName) { + // 处理分派器名称 neatlogic.module.cmdb.workerdispatcher.handler.CmdbDispatcher 截取最后一个CmdbDispatcher + const arr = (dispatcherName && dispatcherName.split('.')) || []; + return arr[arr.length - 1]; + }, + validCmdbDispatcher(handler, key, filterList) { + // 验证cmdb分派器,匹配映射,两个数组时,有一个为空时,数据校验不通过问题 + // [{"formAttributeUuid": "ca04365ff49c4c80b39cf802e857eeaa","key": 441733552807936},{key: '441733846409216', formAttributeUuid: ''}] + if (key !== 'filterList' || this.handleDispatcherName(handler) !== 'CmdbDispatcher') { + return false; + } + return filterList.some(item => !item.formAttributeUuid || !item.key); } }; let setInitData = { - changehandle(nodeConfig, d, that) { //变更处理的校验 + changehandle(nodeConfig, d, that) { + //变更处理的校验 // 变更处理,关联变更自动填充变更创建//特殊处理变更创建和处理(第一次保存不点击节点)-------------------------- if (!nodeConfig.stepConfig.linkedChange) { let allNode = d.getAllPrevNodes(); @@ -329,4 +356,3 @@ let setInitData = { } }; export { valid, setInitData }; - diff --git a/src/views/pages/process/flow/flowedit/components/nodesetting/assign-setting.vue b/src/views/pages/process/flow/flowedit/components/nodesetting/assign-setting.vue index 93525779a80a01a9266e83c74bca26c9c88bac2d..1eae654953e5fa9959df9e9577846490ec4a18f0 100644 --- a/src/views/pages/process/flow/flowedit/components/nodesetting/assign-setting.vue +++ b/src/views/pages/process/flow/flowedit/components/nodesetting/assign-setting.vue @@ -201,7 +201,13 @@ -