mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
fix: 修复创建应用工单action (#1971)
* fix: 修复创建应用工单action * 调整结构 Co-authored-by: feng626 <1304903146@qq.com>
This commit is contained in:
@@ -22,6 +22,10 @@ export default {
|
||||
choices: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
actions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -74,6 +78,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
choicesIDs() {
|
||||
if (this.actions) {
|
||||
return this.actions
|
||||
}
|
||||
if (this.choices.length === 0) {
|
||||
return [
|
||||
'all', 'connect', 'upload_file', 'download_file', 'updownload',
|
||||
|
||||
@@ -38,11 +38,7 @@ export default {
|
||||
apply_date_expired: date_expired,
|
||||
apply_date_start: date_start,
|
||||
org_id: '',
|
||||
type: 'apply_application',
|
||||
apply_actions: [
|
||||
'all', 'connect', 'updownload', 'upload_file', 'download_file',
|
||||
'clipboard_copy_paste', 'clipboard_copy', 'clipboard_paste'
|
||||
]
|
||||
type: 'apply_application'
|
||||
},
|
||||
fields: [
|
||||
[this.$t('common.Basic'), ['title', 'type', 'org_id', 'comment']],
|
||||
@@ -66,7 +62,10 @@ export default {
|
||||
apply_actions: {
|
||||
label: this.$t('perms.Actions'),
|
||||
component: PermissionFormActionField,
|
||||
helpText: this.$t('common.actionsTips')
|
||||
helpText: this.$t('common.actionsTips'),
|
||||
el: {
|
||||
actions: []
|
||||
}
|
||||
},
|
||||
apply_applications: {
|
||||
type: 'assetSelect',
|
||||
@@ -115,6 +114,11 @@ export default {
|
||||
apply_applications: [],
|
||||
apply_system_users: []
|
||||
})
|
||||
this.$axios.get(
|
||||
`/api/v1/perms/application-permissions/applications/actions/?category=${event[0]}`,
|
||||
).then(res => {
|
||||
this.fieldsMeta.apply_actions.el.actions = res
|
||||
})
|
||||
this.fieldsMeta.apply_applications.el.ajax.url = `/api/v1/applications/applications/suggestion/?oid=${vm.org_id}&category=${event[0]}&type=${event[1]}`
|
||||
this.fieldsMeta.apply_system_users.el.ajax.url = event[0] === 'remote_app' ? `/api/v1/assets/system-users/suggestion/?oid=${vm.org_id}&protocol=rdp` : `/api/v1/assets/system-users/suggestion/?oid=${vm.org_id}&protocol=${event[1]}`
|
||||
}
|
||||
|
||||
@@ -33,7 +33,12 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('assets.Action')" required>
|
||||
<PermissionFormActionField v-model="requestForm.actions" :value="requestForm.actions" style="width: 30% !important" />
|
||||
<PermissionFormActionField
|
||||
v-model="requestForm.actions"
|
||||
:value="requestForm.actions"
|
||||
:actions="actions"
|
||||
style="width: 30% !important"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -61,6 +66,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
statusMap: this.object.status === 'open' ? STATUS_MAP['pending'] : STATUS_MAP[this.object.state],
|
||||
actions: this.dynamicActions(),
|
||||
requestForm: {
|
||||
applications: this.object.apply_applications,
|
||||
systemusers: this.object.apply_system_users,
|
||||
@@ -213,6 +219,16 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dynamicActions() {
|
||||
const category = this.object.apply_category
|
||||
const actions = []
|
||||
this.$axios.get(
|
||||
`/api/v1/perms/application-permissions/applications/actions/?category=${category}`,
|
||||
).then(res => {
|
||||
actions.push(...res)
|
||||
})
|
||||
return actions
|
||||
},
|
||||
formatTime(dateStr) {
|
||||
return formatTime(getDateTimeStamp(dateStr))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user