chore: updateschema
This commit is contained in:
parent
eba762c023
commit
460020bee2
@ -3,7 +3,6 @@ import type { FormSchemaGetter, VxeGridProps } from '#/adapter';
|
|||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
defaultValue: '',
|
|
||||||
fieldName: 'dataName',
|
fieldName: 'dataName',
|
||||||
label: '数据源',
|
label: '数据源',
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
@ -10,7 +10,13 @@ import { message, Modal, Popconfirm, Space } from 'ant-design-vue';
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter';
|
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter';
|
||||||
import { batchGenCode, generatedList, genRemove, syncDb } from '#/api/tool/gen';
|
import {
|
||||||
|
batchGenCode,
|
||||||
|
generatedList,
|
||||||
|
genRemove,
|
||||||
|
getDataSourceNames,
|
||||||
|
syncDb,
|
||||||
|
} from '#/api/tool/gen';
|
||||||
import { downloadByData } from '#/utils/file/download';
|
import { downloadByData } from '#/utils/file/download';
|
||||||
|
|
||||||
import codePreviewModal from './code-preview-modal.vue';
|
import codePreviewModal from './code-preview-modal.vue';
|
||||||
@ -84,6 +90,23 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取数据源
|
||||||
|
const ret = await getDataSourceNames();
|
||||||
|
const dataSourceOptions = [{ label: '全部', value: '' }];
|
||||||
|
const transOptions = ret.map((item) => ({ label: item, value: item }));
|
||||||
|
dataSourceOptions.push(...transOptions);
|
||||||
|
// 更新selectOptions
|
||||||
|
tableApi.formApi.updateSchema([
|
||||||
|
{
|
||||||
|
fieldName: 'dataName',
|
||||||
|
componentProps: {
|
||||||
|
options: dataSourceOptions,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
const [CodePreviewModal, previewModalApi] = useVbenModal({
|
const [CodePreviewModal, previewModalApi] = useVbenModal({
|
||||||
connectedComponent: codePreviewModal,
|
connectedComponent: codePreviewModal,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user