diff --git a/src/views/assets/Cloud/Strategy/components/ActionInput.vue b/src/views/assets/Cloud/Strategy/components/ActionInput.vue index b3cd79448..632784159 100644 --- a/src/views/assets/Cloud/Strategy/components/ActionInput.vue +++ b/src/views/assets/Cloud/Strategy/components/ActionInput.vue @@ -39,7 +39,8 @@ export default { submitBtnSize: 'mini', submitBtnText: this.$t('Add'), hasReset: false, - onSubmit: () => {}, + onSubmit: () => { + }, submitMethod: () => 'post', getUrl: () => '', cleanFormValue(data) { @@ -86,7 +87,11 @@ export default { this.formConfig.fieldsMeta.protocols.el.hidden = true } this.resourceType = val - this.formConfig.fieldsMeta.value.el.ajax.url = url + if (url) { + this.formConfig.fieldsMeta.value.el.ajax.url = url + } else { + this.formConfig.fieldsMeta.attr.el.remote = false + } this.formConfig.fieldsMeta.value.el.options = options } } @@ -151,21 +156,31 @@ export default { tableConfig: { columns: [ { prop: 'attr', label: this.$t('ResourceType'), formatter: tableFormatter('resource_type') }, - { prop: 'value', label: this.$t('Resource'), formatter: tableFormatter('resource', () => { return this.globalResource }) }, + { + prop: 'value', label: this.$t('Resource'), formatter: tableFormatter('resource', () => { + return this.globalResource + }) + }, { prop: 'protocols', label: this.$t('Other'), formatter: tableFormatter('protocols') }, - { prop: 'action', label: this.$t('Action'), align: 'center', width: '100px', formatter: (row, col, cellValue, index) => { - return ( -
- -
- ) - } } + { + prop: 'action', + label: this.$t('Action'), + align: 'center', + width: '100px', + formatter: (row, col, cellValue, index) => { + return ( +
+ +
+ ) + } + } ], totalData: this.value || [], hasPagination: false @@ -177,7 +192,9 @@ export default { }, methods: { init() { - this.nameOptions.map((o) => { this.globalResource[o.value] = o.label }) + this.nameOptions.map((o) => { + this.globalResource[o.value] = o.label + }) }, onSubmit() { this.$emit('input', this.tableConfig.totalData) @@ -218,9 +235,11 @@ export default { ::v-deep .el-form-item:nth-child(-n+3) { width: 43.5%; } + ::v-deep .el-form-item:last-child { width: 6%; } + .action-input { margin-top: -10px; }