diff --git a/web/src/views/backend/crud/design.vue b/web/src/views/backend/crud/design.vue index d0b55e4f..0cdfbfd6 100644 --- a/web/src/views/backend/crud/design.vue +++ b/web/src/views/backend/crud/design.vue @@ -665,17 +665,21 @@ const showRemoteSelectPre = (index: number, hideDelField = false) => { state.remoteSelectPre.form.controllerFile = state.fields[index].form['remote-controller'].value state.remoteSelectPre.form.modelFile = state.fields[index].form['remote-model'].value state.remoteSelectPre.form.joinField = state.fields[index].form['relation-fields'].value.split(',') - getTableFieldList(state.fields[index].form['remote-table'].value).then((res) => { - const fieldSelect: anyObj = {} - for (const key in res.data.fieldList) { - fieldSelect[key] = (key ? key + ' - ' : '') + res.data.fieldList[key] - } - state.remoteSelectPre.fieldList = fieldSelect - }) - getFileData(state.fields[index].form['remote-table'].value).then((res) => { - state.remoteSelectPre.modelFileList = res.data.modelFileList - state.remoteSelectPre.controllerFileList = res.data.controllerFileList - }) + if (isEmpty(state.remoteSelectPre.fieldList)) { + getTableFieldList(state.fields[index].form['remote-table'].value).then((res) => { + const fieldSelect: anyObj = {} + for (const key in res.data.fieldList) { + fieldSelect[key] = (key ? key + ' - ' : '') + res.data.fieldList[key] + } + state.remoteSelectPre.fieldList = fieldSelect + }) + } + if (isEmpty(state.remoteSelectPre.modelFileList) || isEmpty(state.remoteSelectPre.controllerFileList)) { + getFileData(state.fields[index].form['remote-table'].value).then((res) => { + state.remoteSelectPre.modelFileList = res.data.modelFileList + state.remoteSelectPre.controllerFileList = res.data.controllerFileList + }) + } } }) .finally(() => {