添加了为超级管理员动态加载租户选项的功能
This commit is contained in:
parent
56006d3376
commit
a3dca2e61a
@ -87,6 +87,8 @@ const props = defineProps({
|
||||
const containerStyle = ref('form-container')
|
||||
|
||||
const emit = defineEmits(['setNewsDialogInvisible']);
|
||||
|
||||
const options = ref([])
|
||||
const setNewsDialogInvisible = (changed) => {
|
||||
emit('setNewsDialogInvisible', changed);
|
||||
};
|
||||
@ -204,6 +206,18 @@ const fetchNewsDetail = async () => {
|
||||
fileList.value.push({url: res.data.imagePath});
|
||||
}
|
||||
|
||||
const fetchOptions = async () => {
|
||||
const params = {
|
||||
token: token.value,
|
||||
}
|
||||
try{
|
||||
const res = await axios.get('/api/tenant/getTenantOptions',{params});
|
||||
options.value = res.data.options;
|
||||
} catch (e) {
|
||||
await ElMessageBox.alert(e.response.data.message);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
token.value = store.getters['authentication/token'];
|
||||
form.value.token = token.value;
|
||||
@ -231,6 +245,8 @@ onMounted(() => {
|
||||
fetchNewsDetail();
|
||||
}
|
||||
|
||||
fetchOptions()
|
||||
|
||||
config.value = {
|
||||
toolbar: {
|
||||
items: [
|
||||
@ -489,9 +505,12 @@ onMounted(() => {
|
||||
</ElFormItem>
|
||||
<ElFormItem label="选择租户" required>
|
||||
<ElSelect v-model="form.tenant" placeholder="请选择" class="dynamic-width-select">
|
||||
<ElOption label="Option 1" value="option1"></ElOption>
|
||||
<ElOption label="Option 2" value="option2"></ElOption>
|
||||
<ElOption label="Option 3" value="option3"></ElOption>
|
||||
<ElOption
|
||||
v-for="option in options"
|
||||
:key="option"
|
||||
:label="option"
|
||||
:value="option"
|
||||
></ElOption>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user