Commit 34922ebe authored by mengzixuan's avatar mengzixuan

feat: 工程投资计划,新建

parent b07198be
......@@ -2,7 +2,7 @@ import { ProjectParams, ProjectListGetResultModel, ProjectModel } from './model/
import { defHttp } from '@/utils/http/axios';
enum Api {
GetList = '/statement/list/page',
GetList = '/statement/list/page',
}
export const getEngineeringList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
......@@ -4,7 +4,6 @@ import { Switch } from 'ant-design-vue';
import { setRoleStatus } from '@/api/demo/system';
import { useMessage } from '@/hooks/web/useMessage';
type CheckedType = boolean | string | number;
export const columns: (
| { dataIndex: string; width: number; title: string }
......@@ -127,12 +126,51 @@ export const searchFormSchema: FormSchema[] = [
];
export const formSchema: FormSchema[] = [
// {
// field: 'projectName',
// label: '项目名称',
// required: true,
// component: 'Input',
// },
{
field: 'projectName',
label: '项目名称',
component: 'Input',
required: true,
componentProps: {
placeholder: 'XXXX项目',
disabled: true,
style: {
background: 'none',
border: 'none',
},
},
colProps: { span: 8 },
},
{
field: 'projectName',
label: '建设地点',
component: 'Input',
required: true,
componentProps: {
placeholder: '华苑片区',
disabled: true,
style: {
background: 'none',
border: 'none',
},
},
colProps: { span: 8 },
},
{
field: 'projectName',
label: '建设模式',
component: 'Input',
required: true,
componentProps: {
placeholder: '自建',
disabled: true,
style: {
background: 'none',
border: 'none',
},
},
colProps: { span: 8 },
},
// {
// field: 'isReserveProject',
// label: '是否为储备项目',
......@@ -157,27 +195,4 @@ export const formSchema: FormSchema[] = [
// ],
// },
// },
// {
// label: '建设模式',
// field: 'constructionMode',
// component: 'InputTextArea',
// },
// {
// label: '项目类型',
// field: 'projectType',
// required: true,
// component: 'Input',
// },
// {
// label: '项目概况',
// field: 'projectOverview',
// required: true,
// component: 'InputTextArea',
// },
// {
// label: '建设目的及项目功能',
// field: 'constructionPurpose',
// required: true,
// component: 'InputTextArea',
// },
];
<template>
<PageWrapper :title="getTitle" :contentBackground="false" headerSticky>
<template #extra>
<a-button type="primary" danger> 删除 </a-button>
</template>
<PageCard v-for="(item, index) in tabsFormSchema" :key="index" :title="item.name">
<BasicForm @register="item.Form[0]" />
</PageCard>
<a-button type="primary" @click="addItem"> 添加 </a-button>
</PageWrapper>
</template>
<script lang="ts" setup>
import { unref, computed, onMounted, ref, reactive } from 'vue';
<script>
import { useRoute } from 'vue-router';
import { PageWrapper } from '@/components/Page';
import PageCard from '@/components/Page/src/PageCard.vue';
import { BasicForm, useForm, FormProps, UseFormReturnType } from '@/components/Form';
import { formSchema } from './data';
</script>
const getTitle = computed(() => (!unref(isUpdate) ? '新增2024年工程项目投资计划(工程)' : '编辑2024年工程项目投资计划(工程)'));
const isUpdate = ref(false);
onMounted(() => {
const route = useRoute();
const id = route.query.id; // 获取名为id的参数
console.log(route.query);
});
type TabsFormType = {
name: string;
forceRender?: boolean;
Form: UseFormReturnType;
};
const baseFormConfig: Partial<FormProps> = {
showActionButtonGroup: false,
labelWidth: 100,
layout: 'vertical',
};
<style scoped>
const tabsFormSchema = reactive<TabsFormType[]>([]);
async function addItem() {
tabsFormSchema.push({
name: '序号' + (tabsFormSchema.length + 1),
forceRender: true,
Form: useForm(Object.assign({ schemas: formSchema }, baseFormConfig) as FormProps),
});
}
</script>
<style lang="less" scoped>
// .vben-page-wrapper-content-bg {
// background-color: transparent;
// }
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment