From aa94c1792c9c1522acd117251e0e7341c2455127 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9C=E6=80=80=E7=A3=8A=E2=80=9D?= <2280131253@qq.com>
Date: Wed, 12 Jan 2022 14:12:56 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E5=8D=95=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=92=8C=E8=AF=A6=E6=83=85=E6=B7=BB=E5=8A=A0=E7=BC=96=E5=8F=B7?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/i18n/langs/cn.json | 1 +
src/i18n/langs/en.json | 1 +
.../Detail/TicketDetail.vue | 39 ++++++++++-------
.../RequestAssetPerm/Detail/TicketDetail.vue | 43 +++++++++++--------
src/views/tickets/TicketListTable.vue | 5 +++
5 files changed, 55 insertions(+), 34 deletions(-)
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'),