diff --git a/src/resources/assets/languages/page/en.json b/src/resources/assets/languages/page/en.json index 4be6117e19301e9094633e66c1019dafec48614c..9128dd02d595794e868091b572ff8da79c76feb1 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\")", + "autoexeccombopeditinfooptypetip":"Query class: Only assets with read-only permissions in the resource center can be used as execution targets; Operations: Only assets with 'automated operations' permissions in the resource center and group management can be used as execution targets;" } \ 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..6951ef40ce589e70411b368b54122a31ea8a0d8c 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\")", + "autoexeccombopeditinfooptypetip":"查询类:在配置管理,具备‘只读’权限的资产,才可以作为执行目标;\n操作类:在配置管理,团体管理中具备‘自动化操作’权限的资产,才可以作为执行目标;" } \ 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 eb4f9860f14cedb4c1ca417f37a83bb0df1f120f..387fe46b2924e2d288c7cc2aaccf3a55071d0fb1 100644 --- a/src/resources/assets/languages/term/en.json +++ b/src/resources/assets/languages/term/en.json @@ -193,7 +193,10 @@ "writecitip": "Select constants or specify the model for data writing through form mapping. If the parent model is an abstract model and does not support adding configuration items, data needs to be written into the child model.", "abstractcireltip": "Firstly, configure the parent model, complete the mapping of common attributes in the parent model, and specify the model for data writing. After completing the configuration of the parent model, return to the current interface before clicking on the sub model to configure the mapping of non-public (non inherited) attributes in the sub model.", "subci": "Submodel", - "selectrelpath": "Select relationship path" + "selectrelpath": "Select relationship path", + "grouptypedescreadonly": "Read only: View configuration items, which can be used as the execution target for the query class combination tool in automation.", + "grouptypedescmaintain": "Maintenance: Add modifications to configuration items based on read-only permissions.", + "grouptypedescautoexec": "Automated operations: On the basis of read-only permissions, add execution targets that can be used as a combination tool for operations in automation" }, "process": { "workordercenter": "Work Center", diff --git a/src/resources/assets/languages/term/zh.json b/src/resources/assets/languages/term/zh.json index 5855db8205c18fe90fe4201b366a316b8acdfb30..1856f25895a9f1969a7dd3f1a75fd5174b835eea 100644 --- a/src/resources/assets/languages/term/zh.json +++ b/src/resources/assets/languages/term/zh.json @@ -183,6 +183,9 @@ "noaddcidirectory": "未添加模型目录,", "currentcatalogcitenodeletedescrition": "当前目录节点已被引用,请解除引用后删除", "autoexec": "自动化操作", + "grouptypedescreadonly": "只读:查看配置项,可作为自动化中,【查询类】组合工具的执行目标。", + "grouptypedescmaintain": "维护:在只读权限的基础上,增加对配置项进行修改。", + "grouptypedescautoexec": "自动化操作:在只读权限基础上,增加可作为自动化中,【操作类】组合工具的执行目标", "abstractciallowextend": "被继承模型只能是抽象模型", "asyncpolicy": "同步策略", "globaleditmodetip": "全局模式,不给属性代表删除", diff --git a/src/views/pages/autoexec/components/common/addTarget/add-filters.vue b/src/views/pages/autoexec/components/common/addTarget/add-filters.vue index f1b48e9f3bf17a9f486751747a7f74d191fb1cf0..4892880b76e435b9f8698a5571b2c968da5eaabf 100644 --- a/src/views/pages/autoexec/components/common/addTarget/add-filters.vue +++ b/src/views/pages/autoexec/components/common/addTarget/add-filters.vue @@ -36,7 +36,9 @@ export default { filters: { }, mixins: [addtargetmixin], - props: {}, + props: { + opType: String + }, data() { return { searchVal: {} diff --git a/src/views/pages/autoexec/components/common/addTarget/add-input.vue b/src/views/pages/autoexec/components/common/addTarget/add-input.vue index 6a19a942ef1917375287107e09513c29daac2941..c5186a222da87c7742972e6c0d98febf0c93ed10 100644 --- a/src/views/pages/autoexec/components/common/addTarget/add-input.vue +++ b/src/views/pages/autoexec/components/common/addTarget/add-input.vue @@ -83,7 +83,9 @@ export default { }, filtes: {}, mixins: [addtargetmixin], - props: {}, + props: { + opType: String + }, data() { return { showNumber: 15, @@ -198,7 +200,8 @@ export default { validinputnodelist(list) { let data = { filter: this.defaultSearchValue, - inputNodeList: list + inputNodeList: list, + cmdbGroupType: opType }; return this.$api.autoexec.action.validinputnodelist(data).then(res => { if (res.Status == 'OK') { diff --git a/src/views/pages/autoexec/components/common/addTarget/add-node.vue b/src/views/pages/autoexec/components/common/addTarget/add-node.vue index 1e7257f4490baa09e98e210808fd6ec875c2cb3c..9c05f52322939fc9c5aaa7cbb9b05252035e5322 100644 --- a/src/views/pages/autoexec/components/common/addTarget/add-node.vue +++ b/src/views/pages/autoexec/components/common/addTarget/add-node.vue @@ -97,7 +97,8 @@ export default { //展示文件数 type: Number, default: 4 - } + }, + opType: String }, data() { return { @@ -148,7 +149,8 @@ export default { searchNodeList(param) { let data = { currentPage: this.currentPage, - pageSize: this.pageSize + pageSize: this.pageSize, + cmdbGroupType: this.opType }; if (param) { Object.assign(data, param); @@ -165,7 +167,8 @@ export default { type == 'pageSize' && (this.pageSize = value); let param = { currentPage: type == 'currentPage' ? value : this.currentPage, - pageSize: type == 'pageSize' ? value : this.pageSize + pageSize: type == 'pageSize' ? value : this.pageSize, + cmdbGroupType: this.opType }; param = Object.assign(param, this.searchVal); this.searchNodeList(param); @@ -233,7 +236,7 @@ export default { }, advancedModeSearch(searchVal) { // 复杂模式搜索 - let params = Object.assign({currentPage: 1, pageSize: 10}, searchVal); + let params = Object.assign({currentPage: 1, pageSize: 10, cmdbGroupType: this.opType}, searchVal); this.loadingShow = true; this.$api.autoexec.action.searchResourceCustomList(params).then(res => { if (res.Status == 'OK') { diff --git a/src/views/pages/autoexec/components/common/addTarget/target-detail.vue b/src/views/pages/autoexec/components/common/addTarget/target-detail.vue index a68cdbff4f705c4bf1a5d6e4d6cb5a2059445529..8bd49cec946211ebca6f70466416210e48d1229c 100644 --- a/src/views/pages/autoexec/components/common/addTarget/target-detail.vue +++ b/src/views/pages/autoexec/components/common/addTarget/target-detail.vue @@ -25,6 +25,7 @@ :defaultValue="executeNodeConfig.filter" :canEdit="canEdit" :defaultSearchValue="defaultSearchValue" + :opType="opType" > { if (res.Status == 'OK') { this.tableData = res.Return; @@ -189,6 +191,7 @@ export default { advancedModeSearch(searchVal) { // 复杂模式搜索 let params = Object.assign({currentPage: 1, pageSize: 10}, searchVal); + params.cmdbGroupType = this.opType; this.complexModeSearchValue = searchVal; this.loadingShow = true; this.$api.autoexec.action.searchResourceCustomList(params).then(res => { diff --git a/src/views/pages/autoexec/components/param/edit/node.vue b/src/views/pages/autoexec/components/param/edit/node.vue index 047d6df5b5ad1bd61c803070ff98dbbcdfb1057a..caa716d8466f5cfea2f7e3bae45d9e8739054fdc 100644 --- a/src/views/pages/autoexec/components/param/edit/node.vue +++ b/src/views/pages/autoexec/components/param/edit/node.vue @@ -32,6 +32,7 @@ :visible="showDialog" :config="config" :disabled="disabled || readonly" + :opType="opType" @on-ok="onOk" @close="endAdd" > @@ -63,7 +64,8 @@ export default { event: 'change' }, props: { - desc: String + desc: String, + opType: String }, data() { return { diff --git a/src/views/pages/autoexec/components/param/edit/node/node-dialog.vue b/src/views/pages/autoexec/components/param/edit/node/node-dialog.vue index c7f0a6fe39b623d396a86ac5b17ca19a90fec048..f9a7209f10b477045f677ab4c3c72ccaee4504e8 100644 --- a/src/views/pages/autoexec/components/param/edit/node/node-dialog.vue +++ b/src/views/pages/autoexec/components/param/edit/node/node-dialog.vue @@ -127,7 +127,8 @@ export default { disabled: { type: Boolean, default: false - } + }, + opType: String }, data() { let _this = this; @@ -210,6 +211,7 @@ export default { }, searchNodeList() { let data = Object.assign({}, this.searchParams, this.searchVal); + data.cmdbGroupType = this.opType; this.$api.autoexec.action.getNodeList(data).then(res => { if (res.Status == 'OK') { this.tableData = res.Return; diff --git a/src/views/pages/autoexec/detail/action-detail.vue b/src/views/pages/autoexec/detail/action-detail.vue index 00ecf4d12874316e72f6c3dc44e53d91d64a4d89..85acb2eb2e93040051209df643a6f492f83623af 100644 --- a/src/views/pages/autoexec/detail/action-detail.vue +++ b/src/views/pages/autoexec/detail/action-detail.vue @@ -171,6 +171,7 @@
@@ -230,6 +232,7 @@ :executeConfig="executeConfig" :runtimeParamList="runtimeParamList" :isEditSetting="effectiveEditable" + :opType="opType" @close="closeExecute" > @@ -334,6 +337,7 @@ export default { showBasicInfoEditDialog: false, editBasicInfo: { name: '', + opType: 'readonly', typeId: '', owner: '', viewAuthorityList: '', @@ -358,6 +362,18 @@ export default { label: this.$t('page.name'), validateList: ['required', 'name-special', { name: 'searchUrl', url: 'api/rest/autoexec/combop/basic/info/save', key: 'name' }] }, + opType: { + type: 'radio', + label: this.$t('page.actiontype'), + value: '', + dataList: [], + validateList: ['required'], + onChange: (value, opt) => { + _this.opTypeName = opt.text; + }, + tooltip: this.$t('page.autoexeccombopeditinfooptypetip'), + isHidden: true + }, typeId: { type: 'select', name: 'typeId', @@ -483,7 +499,8 @@ export default { loading: true, isShowTestDialog: false, configExpired: 0, - configExpiredReason: {} + configExpiredReason: {}, + opType: 'readonly' //操作类型 }; }, beforeCreate() {}, @@ -501,6 +518,7 @@ export default { if (this.$route.query.versionStatus) { this.versionStatus = this.$route.query.versionStatus; } + this.getOpType(); }, beforeMount() {}, async mounted() { @@ -560,8 +578,11 @@ export default { this.name = result.name; this.isActive = result.isActive; this.operationType = result.operationType; + this.isResourcecenterAuth = result.isResourcecenterAuth; + this.$set(this.editBasicInfoForm.opType, 'isHidden', result.isResourcecenterAuth === '0'); this.$set(this.basicInfo, 'name', result.name); this.$set(this.basicInfo, 'typeName', result.typeName); + this.$set(this.basicInfo, 'opTypeName', result.opTypeName); this.$set(this.basicInfo, 'owner', result.owner); this.$set(this.basicInfo, 'viewAuthorityList', result.viewAuthorityList); this.$set(this.basicInfo, 'editAuthorityList', result.editAuthorityList); @@ -571,6 +592,7 @@ export default { this.activeVersionId = result.activeVersionId; this.versionName = result.name; this.versionId = result.specifyVersionId; + this.opType = result.opType; } }); if (this.versionId != null) { @@ -1365,8 +1387,11 @@ export default { this.$api.autoexec.action.getActionBasicInfo(data).then(res => { if (res.Status == 'OK') { const result = res.Return; + this.$set(this.editBasicInfoForm.opType, 'isHidden', result.isResourcecenterAuth === '0'); + this.$set(this.editBasicInfo, 'name', result.isResourcecenterAuth); this.$set(this.editBasicInfo, 'name', result.name); this.$set(this.editBasicInfo, 'typeId', result.typeId); + this.$set(this.editBasicInfo, 'opType', result.opType); this.$set(this.editBasicInfo, 'owner', result.owner); this.$set(this.editBasicInfo, 'viewAuthorityList', result.viewAuthorityList); this.$set(this.editBasicInfo, 'editAuthorityList', result.editAuthorityList); @@ -1388,6 +1413,7 @@ export default { } this.$set(this.editBasicInfo, 'id', this.id); this.$set(this.editBasicInfo, 'typeName', this.typeName); + this.$set(this.editBasicInfo, 'opTypeName', this.opTypeName); const notifyPolicyConfig = noticeSetting.getData(); if (notifyPolicyConfig?.policyId) { this.editBasicInfo.config.invokeNotifyPolicyConfig = notifyPolicyConfig; @@ -1398,6 +1424,7 @@ export default { if (res.Status == 'OK') { this.$set(this.basicInfo, 'name', this.editBasicInfo.name); this.$set(this.basicInfo, 'typeName', this.editBasicInfo.typeName); + this.$set(this.basicInfo, 'opTypeName', this.editBasicInfo.opTypeName); this.$set(this.basicInfo, 'owner', this.editBasicInfo.owner); this.$set(this.basicInfo, 'viewAuthorityList', this.editBasicInfo.viewAuthorityList); this.$set(this.basicInfo, 'editAuthorityList', this.editBasicInfo.editAuthorityList); @@ -1444,6 +1471,14 @@ export default { }); } this.isShowTestDialog = false; + }, + getOpType() { + let data = { enumClass: 'neatlogic.framework.autoexec.constvalue.AutoexecCombopOpType' }; + this.$api.autoexec.action.getParamsTypeLit(data).then(res => { + if (res.Status == 'OK') { + this.editBasicInfoForm.opType.dataList = res.Return; + } + }); } }, computed: { diff --git a/src/views/pages/autoexec/detail/actionDetail/basic-info.vue b/src/views/pages/autoexec/detail/actionDetail/basic-info.vue index 08632217c0f04e19db88213a039850d7cb7cdfe2..f1b07ab897ab4c98d709f1da4766ac3159dc89d7 100644 --- a/src/views/pages/autoexec/detail/actionDetail/basic-info.vue +++ b/src/views/pages/autoexec/detail/actionDetail/basic-info.vue @@ -32,7 +32,8 @@ export default { }, filters: {}, props: { - dataConfig: {type: Object, default: () => {}} + dataConfig: {type: Object, default: () => {}}, + isResourcecenterAuth: Boolean }, data() { let _this = this; @@ -47,6 +48,16 @@ export default { width: '100%', readonly: true }, + opTypeName: { + type: 'text', + name: 'opTypeName', + value: '', + maxlength: 50, + label: this.$t('page.actiontype'), + width: '100%', + readonly: true, + isHidden: this.isResourcecenterAuth + }, typeName: { type: 'text', name: 'typeName', diff --git a/src/views/pages/autoexec/detail/actionDetail/execute-setting.vue b/src/views/pages/autoexec/detail/actionDetail/execute-setting.vue index 01828b1c310cbbe10a5637305c2bac32a2ae4bcf..ea3ba475870ab2d60573b3d558466a7c6df9fe62 100644 --- a/src/views/pages/autoexec/detail/actionDetail/execute-setting.vue +++ b/src/views/pages/autoexec/detail/actionDetail/execute-setting.vue @@ -48,12 +48,18 @@ :canEdit="isEditSetting" :type="settingConfig.whenToSpecify" :required="true" + :opType="opType" >
- +
@@ -64,6 +70,7 @@ :defaultValue="settingConfig.executeNodeConfig.paramList" :paramList="nodeTypeParamList" :canEdit="isEditSetting" + :opType="opType" >
@@ -107,7 +114,8 @@ export default { default: () => {} }, runtimeParamList: Array, - isEditSetting: Boolean + isEditSetting: Boolean, + opType: String }, data() { let _this = this; @@ -249,7 +257,8 @@ export default { executeUser: null, filter: executeNodeConfig.filter || {}, selectNodeList: executeNodeConfig.selectNodeList || [], - inputNodeList: executeNodeConfig.inputNodeList || [] + inputNodeList: executeNodeConfig.inputNodeList || [], + cmdbGroupType: this.opType }; if (this.$refs.executeUser) { this.$set(this.settingConfig, 'executeUser', this.$refs.executeUser.save()); diff --git a/src/views/pages/autoexec/detail/actionDetail/params-setting.vue b/src/views/pages/autoexec/detail/actionDetail/params-setting.vue index b503b4001e859bd6aff5daf2e0e7e764e72cac11..cd454657d2dfa06b35df9e9971db2a7c50cb9782 100644 --- a/src/views/pages/autoexec/detail/actionDetail/params-setting.vue +++ b/src/views/pages/autoexec/detail/actionDetail/params-setting.vue @@ -20,6 +20,7 @@ :typeList="paramsTypeList" :isEdit="isEditSetting" :setValidComponentsList="setValidComponentsList" + :opType="opType" > [] - } + }, + opType: String }, data() { let _this = this; diff --git a/src/views/pages/autoexec/detail/actionDetail/params/param-detail.vue b/src/views/pages/autoexec/detail/actionDetail/params/param-detail.vue index 7db127282dde2c58597c5b3f8ab85115d8a1be7d..c21b024f266e7f7fa0667a4740b72d95a3858b28 100644 --- a/src/views/pages/autoexec/detail/actionDetail/params/param-detail.vue +++ b/src/views/pages/autoexec/detail/actionDetail/params/param-detail.vue @@ -77,6 +77,7 @@ :disabled="!isEdit" :setValidComponentsList="setValidComponentsList" :isRequired="item.isRequired && !item.editable" + :opType="opType" @getConfig="(config)=>{getParamConfig(index,config)}" > @@ -151,7 +152,8 @@ export default { type: Boolean, default: true }, - setValidComponentsList: Array + setValidComponentsList: Array, + opType: String }, data() { return { diff --git a/src/views/pages/autoexec/detail/runnerDetail/add-target.vue b/src/views/pages/autoexec/detail/runnerDetail/add-target.vue index 4c304b30c79df1ba2979357151bad924b4525512..0907e18cc1f1be31397daf8950cc10c06dbfd551 100644 --- a/src/views/pages/autoexec/detail/runnerDetail/add-target.vue +++ b/src/views/pages/autoexec/detail/runnerDetail/add-target.vue @@ -330,7 +330,8 @@ export default { //true不需要提示校验信息 let data = { protocolId: this.executeValue.protocolId ? this.executeValue.protocolId : null, - executeUser: null + executeUser: null, + cmdbGroupType: opType }; if (this.executeValue.executeUser && this.executeValue.executeUser.value) { if (this.executeValue.executeUser.mappingMode === 'constant') { diff --git a/src/views/pages/autoexec/manage/action-manage.vue b/src/views/pages/autoexec/manage/action-manage.vue index 2e2db793bcd440772ef518b83ebd3c43a8224d48..cfffb58fae92a41454a1eea24ee106e9f795bb1f 100644 --- a/src/views/pages/autoexec/manage/action-manage.vue +++ b/src/views/pages/autoexec/manage/action-manage.vue @@ -218,6 +218,13 @@ export default { label: this.$t('page.name'), validateList: ['required', 'name-special', { name: 'searchUrl', url: 'api/rest/autoexec/combop/basic/info/save', key: 'name' }] }, + opType: { + type: 'radio', + label: this.$t('page.actiontype'), + value: '', + dataList: [], + validateList: ['required'] + }, typeId: { type: 'select', name: 'typeId', @@ -346,6 +353,7 @@ export default { this.$set(this.searchVal, 'typeId', typeId); } this.searchAction(); + this.getOpType(); }, beforeMount() {}, mounted() {}, @@ -409,6 +417,7 @@ export default { initActionConfig() { return { name: '', + opType: 'readonly', typeId: '', viewAuthorityList: ['common#alluser'], editAuthorityList: ['common#alluser'], @@ -581,6 +590,14 @@ export default { if (versionStatus == 'passed') { this.theadList[index++] = { title: ' ', key: 'action', align: 'right', width: 10 }; } + }, + getOpType() { + let data = { enumClass: 'neatlogic.framework.autoexec.constvalue.AutoexecCombopOpType' }; + this.$api.autoexec.action.getParamsTypeLit(data).then(res => { + if (res.Status == 'OK') { + this.addActionForm.opType.dataList = res.Return; + } + }); } }, computed: { diff --git a/src/views/pages/cmdb/group/group-edit.vue b/src/views/pages/cmdb/group/group-edit.vue index 7c2b9325e56e8f3980f82d8297003ba32f815aa2..2391c07e587ee6b21b003a14db204e507436025f 100644 --- a/src/views/pages/cmdb/group/group-edit.vue +++ b/src/views/pages/cmdb/group/group-edit.vue @@ -252,7 +252,7 @@ export default { type: { type: 'radio', label: this.$t('page.type'), - desc: '只读:查看配置项,可作为自动化中,【查询类】组合工具的执行目标。维护:在只读权限的基础上,增加对配置项进行修改。自动化操作:在只读权限基础上,增加可作为自动化中,【操作类】组合工具的执行目标', + desc: this.$t('term.cmdb.grouptypedescreadonly') + this.$t('term.cmdb.grouptypedescmaintain') + this.$t('term.cmdb.grouptypedescautoexec'), dataList: [ { value: 'readonly', text: this.$t('page.readonly') }, { value: 'maintain', text: this.$t('page.maintain') }, @@ -310,6 +310,14 @@ export default { this.isLoading = false; this.groupData = res.Return; for (let key in this.formConfig) { + //系统配置-》配置信息管理 is.resourcecenter.auth 控制是否显示 “操作类” + if (key === 'type' && this.groupData.isResourcecenterAuth !== '1') { + var typeDataList = this.formConfig[key].dataList.filter(item => { + return item.value !== 'autoexec'; + }); + this.formConfig[key].dataList = typeDataList; + this.formConfig[key].desc = this.$t('term.cmdb.grouptypedescreadonly') + this.$t('term.cmdb.grouptypedescmaintain'); + } this.formConfig[key].value = this.groupData[key]; } if (this.groupData.ciGroupList && this.groupData.ciGroupList.length > 0) {