Merge pull request #1960 from jumpserver/pr@dev@ticket_app_add_action

feat: 应用工单支持选择动作
This commit is contained in:
feng626 2022-07-22 16:25:10 +08:00 committed by GitHub
commit c83abe32c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 9 deletions

View File

@ -13,6 +13,7 @@ import Select2 from '@/components/FormFields/Select2'
import { getDaysFuture } from '@/utils/common'
import { Required } from '@/components/DataForm/rules'
import { ApplicationCascader } from '@/views/applications/const'
import PermissionFormActionField from '@/views/perms/components/PermissionFormActionField'
import { mapState, mapGetters } from 'vuex'
import store from '@/store'
@ -37,14 +38,17 @@ export default {
apply_date_expired: date_expired,
apply_date_start: date_start,
org_id: '',
type: 'apply_application'
type: 'apply_application',
apply_actions: [
'all', 'connect', 'updownload', 'upload_file', 'download_file',
'clipboard_copy_paste', 'clipboard_copy', 'clipboard_paste'
]
},
fields: [
[this.$t('common.Basic'), ['title', 'type', 'org_id', 'comment']],
[this.$t('tickets.RequestPerm'), [
'apply_category_type', 'apply_applications', 'apply_system_users',
'apply_date_start', 'apply_date_expired'
'apply_actions', 'apply_date_start', 'apply_date_expired'
]]
],
fieldsMeta: {
@ -59,6 +63,11 @@ export default {
disabled: true
}
},
apply_actions: {
label: this.$t('perms.Actions'),
component: PermissionFormActionField,
helpText: this.$t('common.actionsTips')
},
apply_applications: {
type: 'assetSelect',
component: Select2,

View File

@ -32,6 +32,9 @@
type="datetime"
/>
</el-form-item>
<el-form-item :label="$t('assets.Action')" required>
<PermissionFormActionField v-model="requestForm.actions" :value="requestForm.actions" style="width: 30% !important" />
</el-form-item>
</el-form>
</template>
</IBox>
@ -40,14 +43,15 @@
<script>
import IBox from '@/components/IBox'
import { formatTime, getDateTimeStamp } from '@/utils/index'
import { toSafeLocalDateStr } from '@/utils/common'
import { toSafeLocalDateStr, forMatAction } from '@/utils/common'
import Select2 from '@/components/FormFields/Select2'
import { formatTime, getDateTimeStamp } from '@/utils/index'
import GenericTicketDetail from '@/views/tickets/components/GenericTicketDetail'
import PermissionFormActionField from '@/views/perms/components/PermissionFormActionField'
import { STATUS_MAP } from '../../const'
export default {
name: '',
components: { GenericTicketDetail, IBox, Select2 },
components: { GenericTicketDetail, IBox, Select2, PermissionFormActionField },
props: {
object: {
type: Object,
@ -60,6 +64,7 @@ export default {
requestForm: {
applications: this.object.apply_applications,
systemusers: this.object.apply_system_users,
actions: this.object.apply_actions,
apply_date_expired: this.object.apply_date_expired,
apply_date_start: this.object.apply_date_start
},
@ -152,6 +157,10 @@ export default {
key: this.$t('tickets.SystemUser'),
value: rel_snapshot.apply_system_users.join(', ')
},
{
key: this.$t('assets.Action'),
value: forMatAction(this, object.apply_actions_display)
},
{
key: this.$t('common.dateStart'),
value: toSafeLocalDateStr(object.apply_date_start)
@ -224,6 +233,7 @@ export default {
apply_type: this.object.apply_type,
apply_system_users: this.requestForm.systemusers ? this.requestForm.systemusers : [],
apply_applications: this.requestForm.applications ? this.requestForm.applications : [],
apply_actions: this.requestForm.actions,
apply_date_start: this.requestForm.apply_date_start,
apply_date_expired: this.requestForm.apply_date_expired,
org_id: this.object.org_id

View File

@ -47,11 +47,11 @@
<script>
import { formatTime, getDateTimeStamp } from '@/utils/index'
import { toSafeLocalDateStr, forMatAction } from '@/utils/common'
import { STATUS_MAP } from '../../const'
import GenericTicketDetail from '@/views/tickets/components/GenericTicketDetail'
import Select2 from '@/components/FormFields/Select2'
import IBox from '@/components/IBox'
import Select2 from '@/components/FormFields/Select2'
import GenericTicketDetail from '@/views/tickets/components/GenericTicketDetail'
import PermissionFormActionField from '@/views/perms/components/PermissionFormActionField'
import { STATUS_MAP } from '../../const'
export default {
name: '',
components: { GenericTicketDetail, IBox, Select2, PermissionFormActionField },