mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-12 06:28:42 +00:00
Merge pull request #1960 from jumpserver/pr@dev@ticket_app_add_action
feat: 应用工单支持选择动作
This commit is contained in:
commit
c83abe32c6
@ -13,6 +13,7 @@ import Select2 from '@/components/FormFields/Select2'
|
|||||||
import { getDaysFuture } from '@/utils/common'
|
import { getDaysFuture } from '@/utils/common'
|
||||||
import { Required } from '@/components/DataForm/rules'
|
import { Required } from '@/components/DataForm/rules'
|
||||||
import { ApplicationCascader } from '@/views/applications/const'
|
import { ApplicationCascader } from '@/views/applications/const'
|
||||||
|
import PermissionFormActionField from '@/views/perms/components/PermissionFormActionField'
|
||||||
import { mapState, mapGetters } from 'vuex'
|
import { mapState, mapGetters } from 'vuex'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|
||||||
@ -37,14 +38,17 @@ export default {
|
|||||||
apply_date_expired: date_expired,
|
apply_date_expired: date_expired,
|
||||||
apply_date_start: date_start,
|
apply_date_start: date_start,
|
||||||
org_id: '',
|
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: [
|
fields: [
|
||||||
[this.$t('common.Basic'), ['title', 'type', 'org_id', 'comment']],
|
[this.$t('common.Basic'), ['title', 'type', 'org_id', 'comment']],
|
||||||
[this.$t('tickets.RequestPerm'), [
|
[this.$t('tickets.RequestPerm'), [
|
||||||
'apply_category_type', 'apply_applications', 'apply_system_users',
|
'apply_category_type', 'apply_applications', 'apply_system_users',
|
||||||
'apply_date_start', 'apply_date_expired'
|
'apply_actions', 'apply_date_start', 'apply_date_expired'
|
||||||
]]
|
]]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@ -59,6 +63,11 @@ export default {
|
|||||||
disabled: true
|
disabled: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
apply_actions: {
|
||||||
|
label: this.$t('perms.Actions'),
|
||||||
|
component: PermissionFormActionField,
|
||||||
|
helpText: this.$t('common.actionsTips')
|
||||||
|
},
|
||||||
apply_applications: {
|
apply_applications: {
|
||||||
type: 'assetSelect',
|
type: 'assetSelect',
|
||||||
component: Select2,
|
component: Select2,
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
type="datetime"
|
type="datetime"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
</IBox>
|
</IBox>
|
||||||
@ -40,14 +43,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import IBox from '@/components/IBox'
|
import IBox from '@/components/IBox'
|
||||||
import { formatTime, getDateTimeStamp } from '@/utils/index'
|
import { toSafeLocalDateStr, forMatAction } from '@/utils/common'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
|
||||||
import Select2 from '@/components/FormFields/Select2'
|
import Select2 from '@/components/FormFields/Select2'
|
||||||
|
import { formatTime, getDateTimeStamp } from '@/utils/index'
|
||||||
import GenericTicketDetail from '@/views/tickets/components/GenericTicketDetail'
|
import GenericTicketDetail from '@/views/tickets/components/GenericTicketDetail'
|
||||||
|
import PermissionFormActionField from '@/views/perms/components/PermissionFormActionField'
|
||||||
import { STATUS_MAP } from '../../const'
|
import { STATUS_MAP } from '../../const'
|
||||||
export default {
|
export default {
|
||||||
name: '',
|
name: '',
|
||||||
components: { GenericTicketDetail, IBox, Select2 },
|
components: { GenericTicketDetail, IBox, Select2, PermissionFormActionField },
|
||||||
props: {
|
props: {
|
||||||
object: {
|
object: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -60,6 +64,7 @@ export default {
|
|||||||
requestForm: {
|
requestForm: {
|
||||||
applications: this.object.apply_applications,
|
applications: this.object.apply_applications,
|
||||||
systemusers: this.object.apply_system_users,
|
systemusers: this.object.apply_system_users,
|
||||||
|
actions: this.object.apply_actions,
|
||||||
apply_date_expired: this.object.apply_date_expired,
|
apply_date_expired: this.object.apply_date_expired,
|
||||||
apply_date_start: this.object.apply_date_start
|
apply_date_start: this.object.apply_date_start
|
||||||
},
|
},
|
||||||
@ -152,6 +157,10 @@ export default {
|
|||||||
key: this.$t('tickets.SystemUser'),
|
key: this.$t('tickets.SystemUser'),
|
||||||
value: rel_snapshot.apply_system_users.join(', ')
|
value: rel_snapshot.apply_system_users.join(', ')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: this.$t('assets.Action'),
|
||||||
|
value: forMatAction(this, object.apply_actions_display)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: this.$t('common.dateStart'),
|
key: this.$t('common.dateStart'),
|
||||||
value: toSafeLocalDateStr(object.apply_date_start)
|
value: toSafeLocalDateStr(object.apply_date_start)
|
||||||
@ -224,6 +233,7 @@ export default {
|
|||||||
apply_type: this.object.apply_type,
|
apply_type: this.object.apply_type,
|
||||||
apply_system_users: this.requestForm.systemusers ? this.requestForm.systemusers : [],
|
apply_system_users: this.requestForm.systemusers ? this.requestForm.systemusers : [],
|
||||||
apply_applications: this.requestForm.applications ? this.requestForm.applications : [],
|
apply_applications: this.requestForm.applications ? this.requestForm.applications : [],
|
||||||
|
apply_actions: this.requestForm.actions,
|
||||||
apply_date_start: this.requestForm.apply_date_start,
|
apply_date_start: this.requestForm.apply_date_start,
|
||||||
apply_date_expired: this.requestForm.apply_date_expired,
|
apply_date_expired: this.requestForm.apply_date_expired,
|
||||||
org_id: this.object.org_id
|
org_id: this.object.org_id
|
||||||
|
@ -47,11 +47,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import { formatTime, getDateTimeStamp } from '@/utils/index'
|
import { formatTime, getDateTimeStamp } from '@/utils/index'
|
||||||
import { toSafeLocalDateStr, forMatAction } from '@/utils/common'
|
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 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 PermissionFormActionField from '@/views/perms/components/PermissionFormActionField'
|
||||||
|
import { STATUS_MAP } from '../../const'
|
||||||
export default {
|
export default {
|
||||||
name: '',
|
name: '',
|
||||||
components: { GenericTicketDetail, IBox, Select2, PermissionFormActionField },
|
components: { GenericTicketDetail, IBox, Select2, PermissionFormActionField },
|
||||||
|
Loading…
Reference in New Issue
Block a user