From 2c84e4ffa6c28bb98ee8c30af7ad18c9bbcd141e Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Sun, 12 Sep 2021 20:59:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=8D=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 4 ++ .../AssetPermission/AssetPermissionList.vue | 4 +- ...questApplicationPermTicketCreateUpdate.vue | 21 ++++++--- .../RequestAssetPermTicketCreateUpdate.vue | 17 ++++++-- .../tickets/TicketFlow/FlowCreateUpdate.vue | 4 ++ .../tickets/TicketFlow/FlowRuleField.vue | 43 +++++++++++-------- 6 files changed, 63 insertions(+), 30 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index c43c5acbe..0337a5261 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -947,6 +947,10 @@ "OneAssignee": "一级受理人", "TwoAssigneeType": "二级受理人类型", "TwoAssignee": "二级受理人", + "SuperAdmin": "超级管理员", + "OrgAdmin": "组织管理员", + "SuperOrgAdmin": "超级管理员+组织管理员", + "CustomUser": "自定义用户", "ApprovalLevel": "审批级别", "FlowDetail": "流程详情", "PermissionName": "授权规则名称", diff --git a/src/views/perms/AssetPermission/AssetPermissionList.vue b/src/views/perms/AssetPermission/AssetPermissionList.vue index 044c94426..6136566e6 100644 --- a/src/views/perms/AssetPermission/AssetPermissionList.vue +++ b/src/views/perms/AssetPermission/AssetPermissionList.vue @@ -26,12 +26,12 @@ export default { columns: [ 'name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', - 'date_expired', 'is_valid', 'is_expired', 'is_active', + 'date_expired', 'is_valid', 'is_expired', 'is_active', 'from_ticket', 'created_by', 'date_created', 'comment', 'org_name', 'actions' ], columnsShow: { min: ['name', 'actions'], - default: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'actions'] + default: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'from_ticket', 'actions'] }, columnsMeta: { name: { diff --git a/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue b/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue index e24f3ea80..9200f9f99 100644 --- a/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue +++ b/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue @@ -18,9 +18,14 @@ export default { }, data() { + const vm = this const now = new Date() const date_expired = getDaysFuture(7, now).toISOString() const date_start = now.toISOString() + // eslint-disable-next-line no-unused-vars + var org_id = '' + // eslint-disable-next-line no-unused-vars + var apply_category_type = [] return { hasDetailInMsg: false, loading: true, @@ -67,7 +72,7 @@ export default { ajax: { url: '', transformOption: (item) => { - return { label: item.name + ' (' + item.type_display + ')', value: item.id } + return { label: item.name, value: item.id } } } } @@ -161,8 +166,9 @@ export default { }, on: { change: ([event], updateForm) => { - this.fieldsMeta.meta.fieldsMeta.apply_applications.el.ajax.url = `/api/v1/applications/applications/?category=${event[0]}&type=${event[1]}` - this.fieldsMeta.meta.fieldsMeta.apply_system_users.el.ajax.url = event[0] === 'remote_app' ? `/api/v1/assets/system-users/?protocol=rdp` : `/api/v1/assets/system-users/?protocol=${event[1]}` + this.apply_category_type = event + this.fieldsMeta.meta.fieldsMeta.apply_applications.el.ajax.url = `/api/v1/applications/applications/suggestion/?oid=${vm.org_id}&category=${event[0]}&type=${event[1]}` + this.fieldsMeta.meta.fieldsMeta.apply_system_users.el.ajax.url = event[0] === 'remote_app' ? `/api/v1/assets/system-users/suggestion/?oid=${vm.org_id}&protocol=rdp` : `/api/v1/assets/system-users/suggestion/?oid=${vm.org_id}&protocol=${event[1]}` } } } @@ -176,9 +182,12 @@ export default { return { label: item.name, value: item.id } }) }, - on: { - changeOptions: ([event], updateForm) => { - this.fieldsMeta.assignees.el.ajax.url = `/api/v1/tickets/assignees/?org_id=${event[0].value}` + hidden: (form) => { + this.org_id = form['org_id'] + apply_category_type = this.apply_category_type + if (apply_category_type) { + this.fieldsMeta.meta.fieldsMeta.apply_applications.el.ajax.url = `/api/v1/applications/applications/suggestions/?oid=${vm.org_id}&category=${apply_category_type[0]}&type=${apply_category_type[1]}` + this.fieldsMeta.meta.fieldsMeta.apply_system_users.el.ajax.url = apply_category_type[0] === 'remote_app' ? `/api/v1/assets/system-users/suggestions/?oid=${vm.org_id}&protocol=rdp` : `/api/v1/assets/system-users/suggestions/?oid=${vm.org_id}&protocol=${apply_category_type[1]}` } } } diff --git a/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue b/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue index 4f766540b..a41d13e22 100644 --- a/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue +++ b/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue @@ -5,7 +5,6 @@