From 06e147582ff225aa3eb9358c5a2d72cbbe1659a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E9=98=94?= Date: Thu, 21 Nov 2024 10:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E5=9E=8B=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/RepStore/components/Write.vue | 93 +++++++++++++++---- src/views/dataset/RepStore/constants.ts | 4 +- 2 files changed, 79 insertions(+), 18 deletions(-) diff --git a/src/views/dataset/RepStore/components/Write.vue b/src/views/dataset/RepStore/components/Write.vue index 8d78e17..e3b0c3d 100644 --- a/src/views/dataset/RepStore/components/Write.vue +++ b/src/views/dataset/RepStore/components/Write.vue @@ -28,6 +28,7 @@ let dataSource = reactive({ dscode:'', dsname:'', }); + const formSchema = reactive([ { field: '', @@ -42,6 +43,8 @@ const formSchema = reactive([ span:24 }, componentProps: { + filterable:true, + options:[], on:{ change:async (value)=>{ dataSource = value?formSchema[1].componentProps.options.find(item=>item.dscode==value):{}; @@ -49,12 +52,13 @@ const formSchema = reactive([ formSchema[5].componentProps.options = await getRepStoreGeySchema(dataSource)?await getRepStoreGeySchema(dataSource):[]; formSchema[6].componentProps.options = await getRepStoreGeyTables(dataSource)?await getRepStoreGeyTables(dataSource):[]; } - // formSchema.find(item=>item.field=='schema')?.componentProps.optionsApi = async ()=>{return await getRepStoreGeySchema(dataSource);} - // formSchema.find(item=>item.field=='tableName')?.componentProps.optionsApi = async ()=>{return await getRepStoreGeyTables(dataSource);} } + }, + style:{ + width:"100%" } }, - optionApi: async ()=>{return await getRepStoreGeyDataSource()} + // optionApi: async ()=>{return await getRepStoreGeyDataSource()} }, { field: 'redscode', @@ -63,7 +67,13 @@ const formSchema = reactive([ colProps:{ span:24 }, - optionApi: async ()=>{return await getRepStoreGeyDataSource()} + componentProps: { + options:[], + style:{ + width:"100%" + } + } + // optionApi: async ()=>{return await getRepStoreGeyDataSource()} }, { field: 'storeOperateType', @@ -99,7 +109,11 @@ const formSchema = reactive([ }, component: 'Select', componentProps:{ - options:[] + options:[], + filterable:true, + style:{ + width:"100%" + } } }, { @@ -110,7 +124,11 @@ const formSchema = reactive([ }, component: 'Select', componentProps:{ - options:[] + options:[], + filterable:true, + style:{ + width:"100%" + } } }, { @@ -121,7 +139,9 @@ const formSchema = reactive([ span:24 }, componentProps: { - + style:{ + width:"100%" + } }, }, { @@ -133,6 +153,9 @@ const formSchema = reactive([ }, componentProps: { type:'textarea', + style:{ + width:"100%" + } }, }, { @@ -177,6 +200,7 @@ const formSchema = reactive([ style:{ fontSize:"20px !important", color:'rgb(29 127 29) !important', + width:"100%" }, onClick:()=>{ gradeShow.value = !gradeShow.value; @@ -208,7 +232,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -220,7 +247,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -232,7 +262,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -250,7 +283,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -262,7 +298,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -274,7 +313,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -292,7 +334,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -304,7 +349,10 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, @@ -316,11 +364,21 @@ const formSchema = reactive([ span:24 }, componentProps: { - + filterable:true, + style:{ + width:"100%" + } }, hidden:gradeShow.value }, ]) +//获取基础信息中的数据源信息 +const getDataSourceList = async ()=>{ + const dataSourceList = await getRepStoreGeyDataSource(); + formSchema[1].componentProps.options = dataSourceList; + formSchema[2].componentProps.options = dataSourceList; +} +getDataSourceList(); const rules = reactive({ dscode: [required()],//数据源不能为空 @@ -350,6 +408,9 @@ watch( () => props.currentRow, (currentRow) => { if (!currentRow) return + if(currentRow.beginDate && currentRow.endDate){ + currentRow.date = [currentRow.beginDate,currentRow.endDate]; + } setValues(currentRow) }, { diff --git a/src/views/dataset/RepStore/constants.ts b/src/views/dataset/RepStore/constants.ts index fe720a6..3d6efbe 100644 --- a/src/views/dataset/RepStore/constants.ts +++ b/src/views/dataset/RepStore/constants.ts @@ -48,7 +48,7 @@ export async function getRepStoreGeySchema(params){ let SCHEMA_LIST = []; await RepStoreGeySchema(params).then(res=>{ if(res.head.code == 0){ - SCHEMA_LIST = res.body.list; + SCHEMA_LIST = res.body.schemas; } }) return SCHEMA_LIST; @@ -59,7 +59,7 @@ export async function getRepStoreGeyTables(params){ let TABLE_LIST = []; await RepStoreGeyTables(params).then(res=>{ if(res.head.code == 0){ - TABLE_LIST = res.body.list; + TABLE_LIST = res.body.tables; } }) return TABLE_LIST;