From 4a6c9150b5b3341a847ca665e072e7d975a8a8cf Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Wed, 23 Oct 2024 16:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B9=A6-=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=2010.?= =?UTF-8?q?23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/controller/ProjectController.java | 2 +- .../xiangmushu/JiBenXinXiDemo.vue | 41 ++++++++++++++++--- .../kejigongguan/xiangmushu/jiBenXinXi.api.ts | 14 +++++-- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java index 87397e2..6eaabe8 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java @@ -70,7 +70,7 @@ public class ProjectController extends JeecgController @ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询") @GetMapping(value = "/getById") public Result getById(Project project,HttpServletRequest req) { - return Result.OK(projectService.getById(project.getId())); + return Result.OK(projectService.getById("1847214041989091329")); } /** diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue index c32b2e5..d067d06 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue @@ -23,7 +23,7 @@ import { PageWrapper } from '@/components/Page'; import { projectBaseInfoSchemas, userSchemas, departSchemas } from './jiBenXinXi'; import { Card } from 'ant-design-vue'; import {defHttp} from "@/utils/http/axios"; -import {save4shenbao} from './jiBenXinXi.api'; +import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './jiBenXinXi.api'; import { useRouter } from 'vue-router'; export default defineComponent({ @@ -31,7 +31,7 @@ export default defineComponent({ components: { BasicForm, PageWrapper, [Card.name]: Card }, setup() { const { currentRoute, back } = useRouter(); - const [registerProjectInfo, { validate: validateProjectInfoForm }] = useForm({ + const [registerProjectInfo, { validate: validateProjectInfoForm ,setFieldsValue}] = useForm({ baseColProps: { span: 6, }, @@ -40,8 +40,16 @@ export default defineComponent({ schemas: projectBaseInfoSchemas, showActionButtonGroup: false, }); + const uploadValue = async() => { + const baseInfoObj = await getProjectById(); + console.log('baseInfoObj',JSON.stringify(baseInfoObj)) + await setFieldsValue(baseInfoObj) + } + setTimeout(()=>{ + uploadValue() - const [registerUser, { validate: validateUserForm }] = useForm({ + },0) + const [registerUser, formMethods] = useForm({ baseColProps: { span: 6, }, @@ -50,8 +58,19 @@ export default defineComponent({ schemas: userSchemas, showActionButtonGroup: false, }); + const setFieldValues = formMethods.setFieldsValue; + const uploadValue2 = async() => { + console.log( formMethods.setFieldsValue,' formMethods.setFieldsValue') + const userInfoObj = await getUserByProjectId(); + console.log('userInfoObj',JSON.stringify(userInfoObj)) + // await setFieldValues({currentPerfession:1}) + await setFieldValues({userInfoObj}) + } + setTimeout(()=>{ + uploadValue2() - const [registerDepart, { validate: validateDepartForm }] = useForm({ + },200) + const [registerDepart, formMethods2] = useForm({ baseColProps: { span: 6, }, @@ -60,10 +79,20 @@ export default defineComponent({ schemas: departSchemas, showActionButtonGroup: false, }); - + const setFieldValues2 = formMethods2.setFieldsValue; + const uploadValue3 = async() => { + console.log( formMethods2.setFieldsValue,' formMethods.setFieldsValue') + const departInfoObj = await getDepartByProjectId(); + console.log('departInfoObj',JSON.stringify(departInfoObj)) + // await setFieldValues2({bankNo:1,category:'2'}) + await setFieldValues2({departInfoObj}) + } + setTimeout(()=>{ + uploadValue3() + },200) async function submitAll() { try { - Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]).then(function (results) { + Promise.all([validateProjectInfoForm(), formMethods.validate(), formMethods2.validate()]).then(function (results) { const params = {...results[0], ...results[1], ...results[2]} console.log('results', JSON.stringify(params)); save4shenbao(params); diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts index 00c08af..e29114a 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts @@ -5,7 +5,9 @@ const {createConfirm} = useMessage(); enum Api { list = '/project/project/list', - getOne = '/project/project/getById', + projectInfo = '/project/project/getById', + userInfo = '/project/project/getById', + departInfo = '/project/project/getById', save = '/project/project/add', shenbao = '/project/project/save4shenbao', edit = '/project/project/edit', @@ -32,8 +34,14 @@ export const list = (params) => defHttp.get({url: Api.list, params}); -export const getById = (params) => - defHttp.get({url: Api.getOne, params}); +export const getProjectById = (params) => + defHttp.get({url: Api.projectInfo, params}); + +export const getUserByProjectId = (params) => + defHttp.get({url: Api.userInfo, params}); + +export const getDepartByProjectId = (params) => + defHttp.get({url: Api.departInfo, params}); /** * 删除单个