mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
perf: ticket
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
:close="handleClose"
|
||||
:reject="handleReject"
|
||||
>
|
||||
<IBox v-if="hasActionPerm && object.status !== 'closed'" class="box">
|
||||
<IBox v-if="hasActionPerm && object.status.value !== 'closed'" class="box">
|
||||
<div slot="header" class="clearfix ibox-title">
|
||||
<i class="fa fa-edit" /> {{ $tc('common.Actions') }}
|
||||
</div>
|
||||
@@ -198,12 +198,12 @@ export default {
|
||||
const nodeLength = this.requestForm.nodes.length
|
||||
if (assetLength === 0 && nodeLength === 0) {
|
||||
return this.$message.error(this.$tc('common.SelectAtLeastOneAssetOrNodeErrMsg'))
|
||||
} else if (this.requestForm.systemusers.length === 0) {
|
||||
} else if (this.requestForm.accounts.length === 0) {
|
||||
return this.$message.error(this.$tc('common.RequiredSystemUserErrMsg'))
|
||||
}
|
||||
}
|
||||
this.$axios.patch(`/api/v1/tickets/apply-asset-tickets/${this.object.id}/approve/`, {
|
||||
apply_system_users: this.requestForm.systemusers ? this.requestForm.systemusers : [],
|
||||
apply_accounts: this.requestForm.accounts ? this.requestForm.accounts : [],
|
||||
apply_nodes: this.requestForm.nodes ? this.requestForm.nodes : [],
|
||||
apply_assets: this.requestForm.assets ? this.requestForm.assets : [],
|
||||
apply_actions: this.requestForm.actions,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<el-form-item style="float: right">
|
||||
<template v-if="hasActionPerm">
|
||||
<el-button
|
||||
:disabled="object.status === 'closed'"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleApprove"
|
||||
@@ -35,7 +35,7 @@
|
||||
<i class="fa fa-check" /> {{ $t('tickets.Accept') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="object.status === 'closed'"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="handleReject"
|
||||
@@ -45,7 +45,7 @@
|
||||
</template>
|
||||
<el-button
|
||||
v-if="isSelfTicket"
|
||||
:disabled="object.status === 'closed'"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleClose"
|
||||
@@ -53,7 +53,7 @@
|
||||
<i class="fa fa-times" /> {{ $t('tickets.Close') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="object.status === 'closed'"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
type="info"
|
||||
size="small"
|
||||
@click="handleComment"
|
||||
@@ -111,7 +111,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
switch (this.object.type) {
|
||||
switch (this.object.type.value) {
|
||||
case 'login_confirm':
|
||||
this.type_api = 'apply-login-tickets'
|
||||
break
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
:title="$tc('common.ApplyInfo')"
|
||||
/>
|
||||
<Details
|
||||
v-if="object['state'] === 'approved' && assignedCardItems.length > 0"
|
||||
v-if="object.state.value === 'approved' && assignedCardItems.length > 0"
|
||||
:detail-card-items="assignedCardItems"
|
||||
:title="$tc('tickets.AssignedInfo')"
|
||||
/>
|
||||
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.object.state === 'approved' && this.object.type === 'login_asset_confirm') {
|
||||
if (this.object.state.value === 'approved' && this.object.type.value === 'login_asset_confirm') {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
|
||||
@@ -23,25 +23,25 @@
|
||||
{{ assignee }}
|
||||
</span>
|
||||
</div>
|
||||
<el-button v-if="item.assignees_display.length > 5" type="text" @click="lookOver(item.assignees_display)">
|
||||
<el-button v-if="item.assignees.length > 5" type="text" @click="lookOver(item.assignees_display)">
|
||||
{{ $tc('tickets.CheckViewAcceptor') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.state.value ==='closed'" slot="description">
|
||||
<div>{{ $t('tickets.Assignee') }}:{{ object.rel_snapshot.applicant }}</div>
|
||||
<div v-if="item.state ==='closed'" slot="description">
|
||||
<div>{{ $t('tickets.Assignee') }}: {{ object.rel_snapshot.applicant }}</div>
|
||||
<div>{{ $t('common.dateFinished') }}: {{ toSafeLocalDateStr(item.approval_date) }}</div>
|
||||
</div>
|
||||
<div v-if="item.state.value !=='pending' && item.state.value !=='closed'" slot="description">
|
||||
<div> {{ $t('tickets.Assignee') }}:{{ item.processor_display }}</div>
|
||||
<div v-if="item.state !=='pending' && item.state !=='closed'" slot="description">
|
||||
<div> {{ $t('tickets.Assignee') }}: {{ item.processor_display }}</div>
|
||||
<div>{{ $t('common.dateFinished') }}: {{ toSafeLocalDateStr(item.approval_date) }}</div>
|
||||
</div>
|
||||
</el-step>
|
||||
<el-step
|
||||
:title="`${this.$t('tickets.FinishedTicket')}`"
|
||||
>
|
||||
<div v-if="object['status'].value === 'closed'" slot="description">
|
||||
<div>{{ `${this.$t('common.dateFinished')}: ${toSafeLocalDateStr(object.date_updated)}` }}</div>
|
||||
<div v-if="object.status.value === 'closed'" slot="description">
|
||||
<div>{{ $t('common.dateFinished') }}: {{ toSafeLocalDateStr(object.date_updated) }}</div>
|
||||
</div>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
@@ -75,15 +75,12 @@ export default {
|
||||
computed: {
|
||||
ticketSteps() {
|
||||
let countApprove = 0
|
||||
// this.process_map.sort((a, b) => a.approval_level - b.approval_level)
|
||||
// return []
|
||||
this.process_map.forEach(item => {
|
||||
if (item.state === 'approved') {
|
||||
countApprove += 1
|
||||
}
|
||||
})
|
||||
if (countApprove === this.process_map.length) {
|
||||
// // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
||||
return this.process_map.length + 2
|
||||
} else {
|
||||
return this.STATUS.open + countApprove
|
||||
|
||||
Reference in New Issue
Block a user