mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
perf: url is null set remote false
This commit is contained in:
@@ -39,7 +39,8 @@ export default {
|
|||||||
submitBtnSize: 'mini',
|
submitBtnSize: 'mini',
|
||||||
submitBtnText: this.$t('Add'),
|
submitBtnText: this.$t('Add'),
|
||||||
hasReset: false,
|
hasReset: false,
|
||||||
onSubmit: () => {},
|
onSubmit: () => {
|
||||||
|
},
|
||||||
submitMethod: () => 'post',
|
submitMethod: () => 'post',
|
||||||
getUrl: () => '',
|
getUrl: () => '',
|
||||||
cleanFormValue(data) {
|
cleanFormValue(data) {
|
||||||
@@ -86,7 +87,11 @@ export default {
|
|||||||
this.formConfig.fieldsMeta.protocols.el.hidden = true
|
this.formConfig.fieldsMeta.protocols.el.hidden = true
|
||||||
}
|
}
|
||||||
this.resourceType = val
|
this.resourceType = val
|
||||||
|
if (url) {
|
||||||
this.formConfig.fieldsMeta.value.el.ajax.url = url
|
this.formConfig.fieldsMeta.value.el.ajax.url = url
|
||||||
|
} else {
|
||||||
|
this.formConfig.fieldsMeta.attr.el.remote = false
|
||||||
|
}
|
||||||
this.formConfig.fieldsMeta.value.el.options = options
|
this.formConfig.fieldsMeta.value.el.options = options
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,9 +156,18 @@ export default {
|
|||||||
tableConfig: {
|
tableConfig: {
|
||||||
columns: [
|
columns: [
|
||||||
{ prop: 'attr', label: this.$t('ResourceType'), formatter: tableFormatter('resource_type') },
|
{ 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: 'protocols', label: this.$t('Other'), formatter: tableFormatter('protocols') },
|
||||||
{ prop: 'action', label: this.$t('Action'), align: 'center', width: '100px', formatter: (row, col, cellValue, index) => {
|
{
|
||||||
|
prop: 'action',
|
||||||
|
label: this.$t('Action'),
|
||||||
|
align: 'center',
|
||||||
|
width: '100px',
|
||||||
|
formatter: (row, col, cellValue, index) => {
|
||||||
return (
|
return (
|
||||||
<div className='input-button'>
|
<div className='input-button'>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -161,11 +175,12 @@ export default {
|
|||||||
size='mini'
|
size='mini'
|
||||||
style={{ 'flexShrink': 0 }}
|
style={{ 'flexShrink': 0 }}
|
||||||
type='danger'
|
type='danger'
|
||||||
onClick={ this.handleDelete(index) }
|
onClick={this.handleDelete(index)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
],
|
],
|
||||||
totalData: this.value || [],
|
totalData: this.value || [],
|
||||||
hasPagination: false
|
hasPagination: false
|
||||||
@@ -177,7 +192,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.nameOptions.map((o) => { this.globalResource[o.value] = o.label })
|
this.nameOptions.map((o) => {
|
||||||
|
this.globalResource[o.value] = o.label
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.$emit('input', this.tableConfig.totalData)
|
this.$emit('input', this.tableConfig.totalData)
|
||||||
@@ -218,9 +235,11 @@ export default {
|
|||||||
::v-deep .el-form-item:nth-child(-n+3) {
|
::v-deep .el-form-item:nth-child(-n+3) {
|
||||||
width: 43.5%;
|
width: 43.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-form-item:last-child {
|
::v-deep .el-form-item:last-child {
|
||||||
width: 6%;
|
width: 6%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-input {
|
.action-input {
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user