From 57e54522202d06c3a1230394a9c530c6a1623d35 Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Sun, 19 Jun 2022 19:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tickets/BaseTicketList.vue | 7 +++- .../CommandConfirm/Detail/TicketDetail.vue | 41 ++++++++++--------- .../LoginAssetConfirm/Detail/TicketDetail.vue | 21 +++++----- .../LoginConfirm/Detail/TicketDetail.vue | 21 +++++----- .../Detail/TicketDetail.vue | 37 +++++++++-------- .../RequestAssetPerm/Detail/TicketDetail.vue | 41 ++++++++++--------- .../tickets/TicketDetail/TicketDetail.vue | 13 +++--- 7 files changed, 93 insertions(+), 88 deletions(-) diff --git a/src/views/tickets/BaseTicketList.vue b/src/views/tickets/BaseTicketList.vue index e48956dbf..7770f619f 100644 --- a/src/views/tickets/BaseTicketList.vue +++ b/src/views/tickets/BaseTicketList.vue @@ -61,9 +61,12 @@ export default { } }, { - prop: 'applicant_display', + prop: 'applicant', label: this.$t('tickets.user'), - sortable: 'custom' + sortable: 'custom', + formatter: row => { + return row.rel_snapshot.applicant + } }, { prop: 'type_display', diff --git a/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue b/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue index 7efca2040..9c9f36fc0 100644 --- a/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue +++ b/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue @@ -30,74 +30,75 @@ export default { }, computed: { detailCardItems() { + const { object } = this return [ { key: this.$t('tickets.Applicant'), - value: this.object.rel_snapshot.applicant + value: object.rel_snapshot.applicant }, { key: this.$t('tickets.type'), - value: this.object.type_display + value: object.type_display }, { key: this.$t('tickets.status'), - value: this.object.status, + value: object.status, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(this.object.date_created) + value: toSafeLocalDateStr(object.date_created) } ] }, specialCardItems() { - const vm = this + const { object } = this return [ { key: this.$t('tickets.ApplyRunUser'), - value: this.object.rel_snapshot.apply_run_user + value: object.rel_snapshot.apply_run_user }, { key: this.$t('tickets.ApplyRunAsset'), - value: this.object.rel_snapshot.apply_run_asset + value: object.rel_snapshot.apply_run_asset }, { key: this.$t('tickets.ApplyRunSystemUser'), - value: this.object.rel_snapshot.apply_run_system_user + value: object.rel_snapshot.apply_run_system_user }, { key: this.$t('tickets.ApplyRunCommand'), - value: this.object.apply_run_command + value: object.apply_run_command }, { key: this.$t('tickets.ApplyFromSession'), - value: this.object.apply_from_session, + value: object.apply_from_session, formatter: function(item, value) { - const to = { name: 'SessionDetail', params: { id: value }, query: { oid: vm.object.org_id }} - if (!vm.$hasPerm('terminal.view_session')) { - return {vm.$t('sessions.session')} + const to = { name: 'SessionDetail', params: { id: value }, query: { oid: object.org_id }} + if (!this.$hasPerm('terminal.view_session')) { + return {this.$t('sessions.session')} } - return {vm.$t('sessions.session')} + return {this.$t('sessions.session')} } }, { key: this.$t('tickets.ApplyFromCMDFilterRule'), value: { - cmdFilterRuleId: this.object.apply_from_cmd_filter_rule, - cmdFilterId: this.object.apply_from_cmd_filter + cmdFilterRuleId: object.apply_from_cmd_filter_rule, + cmdFilterId: object.apply_from_cmd_filter }, formatter: function(item, value) { const to = { name: 'CommandFilterRulesUpdate', params: { id: value.cmdFilterRuleId }, - query: { filter: value.cmdFilterId, oid: vm.object.org_id } + query: { filter: value.cmdFilterId, oid: object.org_id } } - if (!vm.$hasPerm('assets.change_commandfilterrule')) { - return {vm.$t('assets.CommandFilterRules')} + if (!this.$hasPerm('assets.change_commandfilterrule')) { + return {this.$t('assets.CommandFilterRules')} } - return {vm.$t('assets.CommandFilterRules')} + return {this.$t('assets.CommandFilterRules')} } } ] diff --git a/src/views/tickets/LoginAssetConfirm/Detail/TicketDetail.vue b/src/views/tickets/LoginAssetConfirm/Detail/TicketDetail.vue index 2c605d1e0..f18b3d40b 100644 --- a/src/views/tickets/LoginAssetConfirm/Detail/TicketDetail.vue +++ b/src/views/tickets/LoginAssetConfirm/Detail/TicketDetail.vue @@ -30,44 +30,43 @@ export default { }, computed: { detailCardItems() { + const { object } = this return [ { key: this.$t('tickets.Applicant'), - value: this.object.rel_snapshot.applicant + value: object.rel_snapshot.applicant }, { key: this.$t('tickets.type'), - value: this.object.type_display + value: object.type_display }, { key: this.$t('tickets.status'), - value: this.object.status, + value: object.status, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(this.object.date_created) + value: toSafeLocalDateStr(object.date_created) } ] }, specialCardItems() { - return this.object.type === 'login_confirm' ? [] : [ - // apply_login_asset: "114.118.2.76(114.118.2.76)" - // apply_login_system_user: "root()" - // apply_login_user: "Administrator(admin)" + const { object } = this + return object.type === 'login_confirm' ? [] : [ { key: this.$t('acl.apply_login_asset'), - value: this.object.rel_snapshot.apply_login_asset + value: object.rel_snapshot.apply_login_asset }, { key: this.$t('acl.apply_login_system_user'), - value: this.object.rel_snapshot.apply_login_system_user + value: object.rel_snapshot.apply_login_system_user }, { key: this.$t('acl.apply_login_user'), - value: this.object.rel_snapshot.apply_login_user + value: object.rel_snapshot.apply_login_user } ] } diff --git a/src/views/tickets/LoginConfirm/Detail/TicketDetail.vue b/src/views/tickets/LoginConfirm/Detail/TicketDetail.vue index 2c605d1e0..f18b3d40b 100644 --- a/src/views/tickets/LoginConfirm/Detail/TicketDetail.vue +++ b/src/views/tickets/LoginConfirm/Detail/TicketDetail.vue @@ -30,44 +30,43 @@ export default { }, computed: { detailCardItems() { + const { object } = this return [ { key: this.$t('tickets.Applicant'), - value: this.object.rel_snapshot.applicant + value: object.rel_snapshot.applicant }, { key: this.$t('tickets.type'), - value: this.object.type_display + value: object.type_display }, { key: this.$t('tickets.status'), - value: this.object.status, + value: object.status, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(this.object.date_created) + value: toSafeLocalDateStr(object.date_created) } ] }, specialCardItems() { - return this.object.type === 'login_confirm' ? [] : [ - // apply_login_asset: "114.118.2.76(114.118.2.76)" - // apply_login_system_user: "root()" - // apply_login_user: "Administrator(admin)" + const { object } = this + return object.type === 'login_confirm' ? [] : [ { key: this.$t('acl.apply_login_asset'), - value: this.object.rel_snapshot.apply_login_asset + value: object.rel_snapshot.apply_login_asset }, { key: this.$t('acl.apply_login_system_user'), - value: this.object.rel_snapshot.apply_login_system_user + value: object.rel_snapshot.apply_login_system_user }, { key: this.$t('acl.apply_login_user'), - value: this.object.rel_snapshot.apply_login_user + value: object.rel_snapshot.apply_login_user } ] } diff --git a/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue index c4893f048..e5b12540c 100644 --- a/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue @@ -39,48 +39,48 @@ export default { }, computed: { detailCardItems() { - const obj = this.object || {} + const { object } = this return [ { key: this.$t('common.Number'), - value: obj.serial_num + value: object.serial_num }, { key: this.$t('tickets.status'), - value: obj.status, + value: object.status, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('tickets.type'), - value: obj.type_display + value: object.type_display }, { key: this.$t('tickets.user'), - value: obj.rel_snapshot.applicant + value: object.rel_snapshot.applicant }, { key: this.$t('tickets.OrgName'), - value: obj.org_name + value: object.org_name }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(obj.date_created) + value: toSafeLocalDateStr(object.date_created) }, { key: this.$t('common.Comment'), - value: obj.comment + value: object.comment } ] }, specialCardItems() { - const vm = this - const rel_snapshot = this.object.rel_snapshot + const { object } = this + const rel_snapshot = object.rel_snapshot return [ { key: this.$t('applications.appType'), - value: `${vm.object.apply_category} / ${vm.object.apply_type} ` + value: `${object.apply_category} / ${object.apply_type} ` }, { key: this.$t('applications.appName'), @@ -92,24 +92,25 @@ export default { }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(vm.object.apply_date_start) + value: toSafeLocalDateStr(object.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(vm.object.apply_date_expired) + value: toSafeLocalDateStr(object.apply_date_expired) } ] }, assignedCardItems() { const vm = this - const rel_snapshot = this.object.rel_snapshot + const { object } = this + const rel_snapshot = object.rel_snapshot return [ { key: this.$t('tickets.PermissionName'), value: vm.object.apply_permission_name, formatter: function(item, value) { - const to = { name: 'ApplicationPermissionDetail', params: { id: vm.object.id }, query: { oid: vm.object.org_id }} - if (vm.$hasPerm('perms.view_applicationpermission') && vm.object.status === 'closed' && vm.object.state === 'approved') { + const to = { name: 'ApplicationPermissionDetail', params: { id: object.id }, query: { oid: object.org_id }} + if (vm.$hasPerm('perms.view_applicationpermission') && object.status === 'closed' && object.state === 'approved') { return { value } } else { return { value } @@ -126,11 +127,11 @@ export default { }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(vm.object.apply_date_start) + value: toSafeLocalDateStr(object.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(vm.object.apply_date_expired) + value: toSafeLocalDateStr(object.apply_date_expired) } ] }, diff --git a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue index f28287916..ca1e1c76e 100644 --- a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue @@ -40,44 +40,44 @@ export default { }, computed: { detailCardItems() { - const obj = this.object || {} + const { object } = this return [ { key: this.$t('common.Number'), - value: obj.serial_num + value: object.serial_num }, { key: this.$t('tickets.status'), - value: obj.state, + value: object.state, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('tickets.type'), - value: obj.type_display + value: object.type_display }, { key: this.$t('tickets.user'), - value: obj.rel_snapshot.applicant + value: object.rel_snapshot.applicant }, { key: this.$t('tickets.OrgName'), - value: obj.org_name + value: object.org_name }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(obj.date_created) + value: toSafeLocalDateStr(object.date_created) }, { key: this.$t('common.Comment'), - value: obj.comment + value: object.comment } ] }, specialCardItems() { - const vm = this - const rel_snapshot = this.object.rel_snapshot + const { object } = this + const rel_snapshot = object.rel_snapshot return [ { key: this.$t('perms.Node'), @@ -93,28 +93,29 @@ export default { }, { key: this.$t('assets.Action'), - value: forMatAction(this, vm.object.apply_actions_display) + value: forMatAction(this, object.apply_actions_display) }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(vm.object.apply_date_start) + value: toSafeLocalDateStr(object.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(vm.object.apply_date_expired) + value: toSafeLocalDateStr(object.apply_date_expired) } ] }, assignedCardItems() { const vm = this - const rel_snapshot = this.object.rel_snapshot + const { object } = this + const rel_snapshot = object.rel_snapshot return [ { key: this.$t('tickets.PermissionName'), - value: this.object.apply_permission_name, + value: object.apply_permission_name, formatter: function(item, value) { - const to = { name: 'AssetPermissionDetail', params: { id: vm.object.id }, query: { oid: vm.object.org_id }} - if (vm.$hasPerm('perms.view_assetpermission') && vm.object.status === 'closed' && vm.object.state === 'approved') { + const to = { name: 'AssetPermissionDetail', params: { id: object.id }, query: { oid: object.org_id }} + if (vm.$hasPerm('perms.view_assetpermission') && object.status === 'closed' && object.state === 'approved') { return { value } } else { return { value } @@ -135,15 +136,15 @@ export default { }, { key: this.$t('assets.Action'), - value: forMatAction(this, vm.object.apply_actions_display) + value: forMatAction(this, object.apply_actions_display) }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(vm.object.apply_date_start) + value: toSafeLocalDateStr(object.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(vm.object.apply_date_expired) + value: toSafeLocalDateStr(object.apply_date_expired) } ] } diff --git a/src/views/tickets/TicketDetail/TicketDetail.vue b/src/views/tickets/TicketDetail/TicketDetail.vue index 207eb53a7..fc415bda2 100644 --- a/src/views/tickets/TicketDetail/TicketDetail.vue +++ b/src/views/tickets/TicketDetail/TicketDetail.vue @@ -30,33 +30,34 @@ export default { }, computed: { detailCardItems() { + const { object } = this return [ { key: this.$t('tickets.Applicant'), - value: this.object.rel_snapshot.applicant + value: object.rel_snapshot.applicant }, { key: this.$t('tickets.type'), - value: this.object.type_display + value: object.type_display }, { key: this.$t('tickets.status'), - value: this.object.status, + value: object.status, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('tickets.Assignees'), - value: this.object.process_map[this.object.approval_step - 1].assignees_display.join(',') + value: object.process_map[object.approval_step - 1].assignees_display.join(',') }, { key: this.$t('tickets.Assignee'), - value: this.object.process_map[this.object.approval_step - 1].processor_display + value: object.process_map[object.approval_step - 1].processor_display }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(this.object.date_created) + value: toSafeLocalDateStr(object.date_created) } ] }