|
|
@@ -3,19 +3,26 @@ import type { Ref } from 'vue';
|
|
|
|
|
|
import type { IFormConfig, IFormDesignMethods, IVFormComponent } from './types';
|
|
|
|
|
|
-import { onMounted, provide, ref } from 'vue';
|
|
|
+import { computed, onMounted, provide, ref } from 'vue';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
|
|
|
-import { Card, Tabs } from 'ant-design-vue';
|
|
|
+import { BcPage, VbenScrollbar } from '@vben/common-ui';
|
|
|
|
|
|
-import ControlConfig from './components/control-config.vue';
|
|
|
-import FormConfig from './components/form-config.vue';
|
|
|
import FormEdit from './components/form/index.vue';
|
|
|
+import FormSetting from './components/setting/index.vue';
|
|
|
+import Tools from './components/tools/index.vue';
|
|
|
import Widget from './components/widget/index.vue';
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'FormDesign',
|
|
|
});
|
|
|
|
|
|
+const route = useRoute();
|
|
|
+
|
|
|
+const keyValue = computed(() => {
|
|
|
+ return route.params?.id ?? -1;
|
|
|
+});
|
|
|
+
|
|
|
const formConfig = ref<IFormConfig>({
|
|
|
config: {
|
|
|
wrapperClass: 'grid-cols-1',
|
|
|
@@ -38,27 +45,24 @@ provide<IFormDesignMethods>('formDesignMethods', {
|
|
|
setSelectSchema,
|
|
|
});
|
|
|
|
|
|
-onMounted(async () => {});
|
|
|
+onMounted(async () => {
|
|
|
+ // eslint-disable-next-line no-console
|
|
|
+ console.log('keyValue', keyValue.value);
|
|
|
+});
|
|
|
</script>
|
|
|
<template>
|
|
|
- <div class="flex h-full w-full">
|
|
|
- <div class="w-[300px]">
|
|
|
+ <BcPage auto-content-height :default-layout="[20, 60, 20]">
|
|
|
+ <template #left>
|
|
|
<Widget />
|
|
|
- </div>
|
|
|
- <div class="h-full flex-1 pl-2 pr-2">
|
|
|
- <Card title="设计区域" class="h-full w-full">
|
|
|
+ </template>
|
|
|
+ <template #right>
|
|
|
+ <FormSetting />
|
|
|
+ </template>
|
|
|
+ <div class="relative h-full">
|
|
|
+ <Tools class="h-[46px]" />
|
|
|
+ <VbenScrollbar class="h-[calc(100%-46px)]">
|
|
|
<FormEdit />
|
|
|
- </Card>
|
|
|
- </div>
|
|
|
- <div class="w-[300px]">
|
|
|
- <Tabs>
|
|
|
- <Tabs.TabPane key="1" tab="组件属性">
|
|
|
- <ControlConfig />
|
|
|
- </Tabs.TabPane>
|
|
|
- <Tabs.TabPane key="2" tab="表单属性">
|
|
|
- <FormConfig v-model:config="formConfig.config" />
|
|
|
- </Tabs.TabPane>
|
|
|
- </Tabs>
|
|
|
+ </VbenScrollbar>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </BcPage>
|
|
|
</template>
|