diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 50c831023..390cf293c 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -302,6 +302,7 @@ "Close": "关闭", "Command filter": "命令过滤器", "Comment": "备注", + "Number": "编号", "Confirm": "确认", "Create": "创建", "CreatedBy": "创建者", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 99337e6fe..d8e8e65da 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -289,6 +289,7 @@ "Close": "Close", "Command filter": "Command filter", "Comment": "Comment", + "Number": "Number", "Confirm": "Confirm", "Create": "Create", "CreatedBy": "Created by", diff --git a/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue index 810997054..900ce4be8 100644 --- a/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue @@ -40,66 +40,73 @@ export default { }, computed: { detailCardItems() { + const obj = this.object || {} return [ + { + key: this.$t('common.Number'), + value: obj.serial_num + }, { key: this.$t('tickets.status'), - value: this.object.status, + value: obj.status, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('tickets.type'), - value: this.object.type_display + value: obj.type_display }, { key: this.$t('tickets.user'), - value: this.object['applicant_display'] + value: obj['applicant_display'] }, { key: this.$t('tickets.OrgName'), - value: this.object['org_name'] + value: obj['org_name'] }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(this.object.date_created) + value: toSafeLocalDateStr(obj.date_created) }, { key: this.$t('common.Comment'), - value: this.object.comment + value: obj.comment } ] }, specialCardItems() { + const meta = this.object.meta || {} return [ { key: this.$t('applications.appType'), - value: `${this.object.meta['apply_category_display']} / ${this.object.meta['apply_type_display']} ` + value: `${meta['apply_category_display']} / ${meta['apply_type_display']} ` }, { key: this.$t('applications.appName'), - value: this.object.meta.apply_applications_display.join(', ') + value: meta?.apply_applications_display?.join(', ') || '' }, { key: this.$t('tickets.SystemUser'), - value: this.object.meta.apply_system_users_display.join(', ') + value: meta?.apply_system_users_display?.join(', ') || '' }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(this.object.meta.apply_date_start) + value: toSafeLocalDateStr(meta.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(this.object.meta.apply_date_expired) + value: toSafeLocalDateStr(meta.apply_date_expired) } ] }, assignedCardItems() { const vm = this + const meta = this.object.meta || {} return [ { key: this.$t('tickets.PermissionName'), - value: this.object.meta.apply_permission_name, + value: meta.apply_permission_name, formatter: function(item, value) { const to = { name: 'ApplicationPermissionDetail', params: { id: vm.object.id }, query: { oid: vm.object.org_id }} if (vm.object.status === 'closed' && vm.object.state === 'approved') { @@ -111,19 +118,19 @@ export default { }, { key: this.$t('applications.appName'), - value: this.object.meta.apply_applications_display.join(', ') + value: meta?.apply_applications_display?.join(', ') || '' }, { key: this.$t('tickets.SystemUser'), - value: this.object.meta.apply_system_users_display.join(', ') + value: meta?.apply_system_users_display?.join(', ') || '' }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(this.object.meta.apply_date_start) + value: toSafeLocalDateStr(meta.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(this.object.meta.apply_date_expired) + value: toSafeLocalDateStr(meta.apply_date_expired) } ] }, diff --git a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue index 6df2fd008..58d948576 100644 --- a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue @@ -38,66 +38,73 @@ export default { }, computed: { detailCardItems() { + const obj = this.object || {} return [ + { + key: this.$t('common.Number'), + value: obj.serial_num + }, { key: this.$t('tickets.status'), - value: this.object.state, + value: obj.state, formatter: (item, val) => { return { this.statusMap.title } } }, { key: this.$t('tickets.type'), - value: this.object.type_display + value: obj.type_display }, { key: this.$t('tickets.user'), - value: this.object['applicant_display'] + value: obj['applicant_display'] }, { key: this.$t('tickets.OrgName'), - value: this.object.org_name + value: obj.org_name }, { key: this.$t('common.dateCreated'), - value: toSafeLocalDateStr(this.object.date_created) + value: toSafeLocalDateStr(obj.date_created) }, { key: this.$t('common.Comment'), - value: this.object.comment + value: obj.comment } ] }, specialCardItems() { + const meta = this.object.meta || {} return [ { key: this.$t('perms.Node'), - value: this.object.meta.apply_nodes_display.join(', ') + value: meta?.apply_nodes_display?.join(', ') || '' }, { key: this.$t('tickets.Asset'), - value: this.object.meta.apply_assets_display.join(', ') + value: meta?.apply_assets_display?.join(', ') || '' }, { key: this.$t('tickets.SystemUser'), - value: this.object.meta.apply_system_users_display.join(', ') + value: meta?.apply_system_users_display?.join(', ') || '' }, { key: this.$t('assets.Action'), - value: forMatAction(this, this.object.meta['apply_actions_display']) + value: forMatAction(this, meta['apply_actions_display']) }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(this.object.meta.apply_date_start) + value: toSafeLocalDateStr(meta.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(this.object.meta.apply_date_expired) + value: toSafeLocalDateStr(meta.apply_date_expired) } ] }, assignedCardItems() { const vm = this + const meta = this.object.meta || {} return [ { key: this.$t('tickets.PermissionName'), @@ -113,27 +120,27 @@ export default { }, { key: this.$t('perms.Node'), - value: this.object.meta.apply_nodes_display.join(', ') + value: meta?.apply_nodes_display?.join(', ') || '' }, { key: this.$t('assets.Asset'), - value: this.object.meta.apply_assets_display.join(', ') + value: meta?.apply_assets_display?.join(', ') || '' }, { key: this.$t('tickets.SystemUser'), - value: this.object.meta.apply_system_users_display.join(', ') + value: meta?.apply_system_users_display?.join(', ') || '' }, { key: this.$t('assets.Action'), - value: forMatAction(this, this.object.meta['apply_actions_display']) + value: forMatAction(this, meta['apply_actions_display']) }, { key: this.$t('common.dateStart'), - value: toSafeLocalDateStr(this.object.meta.apply_date_start) + value: toSafeLocalDateStr(meta?.apply_date_start) }, { key: this.$t('common.dateExpired'), - value: toSafeLocalDateStr(this.object.meta.apply_date_expired) + value: toSafeLocalDateStr(meta?.apply_date_expired) } ] }, diff --git a/src/views/tickets/TicketListTable.vue b/src/views/tickets/TicketListTable.vue index b9a1a45fc..8b728cb48 100644 --- a/src/views/tickets/TicketListTable.vue +++ b/src/views/tickets/TicketListTable.vue @@ -26,6 +26,11 @@ export default { ticketTableConfig: { url: this.url, columns: [ + { + prop: 'serial_num', + label: this.$t('common.Number'), + sortable: 'custom' + }, { prop: 'title', label: this.$t('tickets.title'),