feat: 添加命令复核工单逻辑

This commit is contained in:
Bai
2021-04-26 18:47:16 +08:00
committed by Jiangjie.Bai
parent 4d11e638e8
commit 6a40ab1a4c
5 changed files with 168 additions and 1 deletions

View File

@@ -48,5 +48,12 @@ export default [
component: () => import('@/views/tickets/RequestApplicationPerm/Detail/index'),
meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets/tickets' },
hidden: true
},
{
path: 'tickets/command-confirm/:id',
name: 'CommandConfirmDetail',
component: () => import('@/views/tickets/CommandConfirm/Detail/index'),
meta: { title: i18n.t('route.CommandConfirm'), activeMenu: '/tickets/tickets' },
hidden: true
}
]

View File

@@ -28,7 +28,7 @@ export default {
action: 0
},
fields: [
[this.$t('common.Basic'), ['filter', 'type', 'content', 'priority', 'action', 'comment']]
[this.$t('common.Basic'), ['filter', 'type', 'content', 'priority', 'action', 'reviewers', 'comment']]
],
fieldsMeta: {
filter: {
@@ -66,6 +66,18 @@ export default {
priority: {
// helpText: '优先级可选范围为1-1001最低优先级100最高优先级'
// helpText: this.$t('assets.CommandFilterRulePriorityHelpText')
},
reviewers: {
hidden: (item) => item.action !== 2,
el: {
value: [],
ajax: {
url: '/api/v1/users/users/?fields_size=mini',
transformOption: (item) => {
return { label: item.name + '(' + item.username + ')', value: item.id }
}
}
}
}
},
getNextRoute(res, method) {

View File

@@ -0,0 +1,96 @@
<template>
<GenericTicketDetail :object="object" :detail-card-items="detailCardItems" :special-card-items="specialCardItems" />
</template>
<script>
import { STATUS_MAP } from '../../const'
import { toSafeLocalDateStr } from '@/utils/common'
import GenericTicketDetail from '@/views/tickets/components/GenericTicketDetail'
export default {
name: 'CommandConfirmTicketDetail',
components: {
GenericTicketDetail
},
props: {
object: {
type: Object,
default: () => ({})
}
},
data() {
return {
statusMap: this.object.status === 'open' ? STATUS_MAP[this.object.status] : STATUS_MAP[this.object.action],
imageUrl: require('@/assets/img/admin.png'),
form: {
comments: ''
},
comments: ''
}
},
computed: {
detailCardItems() {
return [
{
key: this.$t('tickets.Applicant'),
value: this.object.applicant_display
},
{
key: this.$t('tickets.type'),
value: this.object.type_display
},
{
key: this.$t('tickets.status'),
value: this.object.status,
formatter: (item, val) => {
return <el-tag type={this.statusMap.type} size='mini'> { this.statusMap.title }</el-tag>
}
},
{
key: this.$t('tickets.Assignees'),
value: this.object.assignees_display
},
{
key: this.$t('tickets.Assignee'),
value: this.object.processor_display
},
{
key: this.$t('common.dateCreated'),
value: toSafeLocalDateStr(this.object.date_created)
}
]
},
specialCardItems() {
return [
{
key: this.$t('tickets.ApplyRunUser'),
value: this.object.meta.apply_run_user
},
{
key: this.$t('tickets.ApplyRunAsset'),
value: this.object.meta.apply_run_asset
},
{
key: this.$t('tickets.ApplyRunSystemUser'),
value: this.object.meta.apply_run_system_user
},
{
key: this.$t('tickets.ApplyRunCommand'),
value: this.object.meta.apply_run_command
},
{
key: this.$t('tickets.ApplyFromSession'),
value: this.object.meta.apply_from_session_id
},
{
key: this.$t('tickets.ApplyFromCMDFilterRule'),
value: this.object.meta.apply_from_cmd_filter_rule_id
}
]
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,50 @@
<template>
<GenericDetailPage :object.sync="ticket" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<component :is="config.activeMenu" :object="ticket" />
</GenericDetailPage>
</template>
<script>
import { GenericDetailPage, TabPage } from '@/layout/components'
import TicketDetail from './TicketDetail'
export default {
components: {
GenericDetailPage,
TicketDetail,
TabPage
},
data() {
return {
ticket: { title: '', user_display: '', type_display: '', status: '', assignees_display: '', date_created: '' },
config: {
activeMenu: 'TicketDetail',
url: '',
submenu: [
{
title: this.$t('route.TicketDetail'),
name: 'TicketDetail'
}
],
actions: {
detailApiUrl: `/api/v1/tickets/tickets/${this.$route.params.id}/`
},
getObjectName: this.getObjectName,
hasRightSide: false
}
}
},
mounted() {
},
methods: {
getObjectName() {
return this.ticket.title
}
}
}
</script>
<style scoped>
</style>

View File

@@ -38,6 +38,8 @@ export default {
return 'AppsTicketDetail'
} else if (row.type === 'login_asset_confirm') {
return 'loginAssetTicketDetail'
} else if (row.type === 'command_confirm') {
return 'CommandConfirmDetail'
} else {
return 'TicketDetail'
}