From 16257dd099d9811fb5caf78047ffc2425c401e0e Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 05 八月 2024 03:11:20 +0800 Subject: [PATCH] 工单工艺路线更新 --- src/views/demo/page/form/high/index.vue | 80 +++++++++++++++++++--------------------- 1 files changed, 38 insertions(+), 42 deletions(-) diff --git a/src/views/demo/page/form/high/index.vue b/src/views/demo/page/form/high/index.vue index 44f5db1..2f2e5b6 100644 --- a/src/views/demo/page/form/high/index.vue +++ b/src/views/demo/page/form/high/index.vue @@ -4,67 +4,63 @@ title="楂樼骇琛ㄥ崟" content=" 楂樼骇琛ㄥ崟甯歌浜庝竴娆℃�ц緭鍏ュ拰鎻愪氦澶ф壒閲忔暟鎹殑鍦烘櫙銆�" > - <a-card title="浠撳簱绠$悊" :bordered="false"> + <Card title="浠撳簱绠$悊" :bordered="false"> <BasicForm @register="register" /> - </a-card> - <a-card title="浠诲姟绠$悊" :bordered="false" class="!mt-5"> + </Card> + <Card title="浠诲姟绠$悊" :bordered="false" class="!mt-5"> <BasicForm @register="registerTask" /> - </a-card> - <a-card title="鎴愬憳绠$悊" :bordered="false" class="!mt-5"> + </Card> + <Card title="鎴愬憳绠$悊" :bordered="false" class="!mt-5"> <PersonTable ref="tableRef" /> - </a-card> + </Card> <template #rightFooter> <a-button type="primary" @click="submitAll"> 鎻愪氦 </a-button> </template> </PageWrapper> </template> -<script lang="ts"> - import { BasicForm, useForm } from '/@/components/Form'; - import { defineComponent, ref } from 'vue'; +<script lang="ts" setup> + import { BasicForm, useForm } from '@/components/Form'; + import { ref } from 'vue'; import PersonTable from './PersonTable.vue'; - import { PageWrapper } from '/@/components/Page'; + import { PageWrapper } from '@/components/Page'; import { schemas, taskSchemas } from './data'; import { Card } from 'ant-design-vue'; - export default defineComponent({ - name: 'FormHightPage', - components: { BasicForm, PersonTable, PageWrapper, [Card.name]: Card }, - setup() { - const tableRef = ref<{ getDataSource: () => any } | null>(null); + defineOptions({ name: 'FormHightPage' }); - const [register, { validate }] = useForm({ - layout: 'vertical', - baseColProps: { - span: 6, - }, - schemas: schemas, - showActionButtonGroup: false, - }); + const tableRef = ref<{ getDataSource: () => any } | null>(null); - const [registerTask, { validate: validateTaskForm }] = useForm({ - layout: 'vertical', - baseColProps: { - span: 6, - }, - schemas: taskSchemas, - showActionButtonGroup: false, - }); + const [register, { validate }] = useForm({ + layout: 'vertical', + baseColProps: { + span: 6, + }, + schemas: schemas, + showActionButtonGroup: false, + }); - async function submitAll() { - try { - if (tableRef.value) { - console.log('table data:', tableRef.value.getDataSource()); - } + const [registerTask, { validate: validateTaskForm }] = useForm({ + layout: 'vertical', + baseColProps: { + span: 6, + }, + schemas: taskSchemas, + showActionButtonGroup: false, + }); - const [values, taskValues] = await Promise.all([validate(), validateTaskForm()]); - console.log('form data:', values, taskValues); - } catch (error) {} + async function submitAll() { + try { + if (tableRef.value) { + console.log('table data:', tableRef.value.getDataSource()); } - return { register, registerTask, submitAll, tableRef }; - }, - }); + const [values, taskValues] = await Promise.all([validate(), validateTaskForm()]); + console.log('form data:', values, taskValues); + } catch (error) { + console.log(error); + } + } </script> <style lang="less" scoped> .high-form { -- Gitblit v1.9.3