修改模型规则

main
于阔 9 months ago
parent b77aacb812
commit 06e147582f

@ -28,6 +28,7 @@ let dataSource = reactive({
dscode:'', dscode:'',
dsname:'', dsname:'',
}); });
const formSchema = reactive<FormSchema[]>([ const formSchema = reactive<FormSchema[]>([
{ {
field: '', field: '',
@ -42,6 +43,8 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
options:[],
on:{ on:{
change:async (value)=>{ change:async (value)=>{
dataSource = value?formSchema[1].componentProps.options.find(item=>item.dscode==value):{}; dataSource = value?formSchema[1].componentProps.options.find(item=>item.dscode==value):{};
@ -49,12 +52,13 @@ const formSchema = reactive<FormSchema[]>([
formSchema[5].componentProps.options = await getRepStoreGeySchema(dataSource)?await getRepStoreGeySchema(dataSource):[]; formSchema[5].componentProps.options = await getRepStoreGeySchema(dataSource)?await getRepStoreGeySchema(dataSource):[];
formSchema[6].componentProps.options = await getRepStoreGeyTables(dataSource)?await getRepStoreGeyTables(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', field: 'redscode',
@ -63,7 +67,13 @@ const formSchema = reactive<FormSchema[]>([
colProps:{ colProps:{
span:24 span:24
}, },
optionApi: async ()=>{return await getRepStoreGeyDataSource()} componentProps: {
options:[],
style:{
width:"100%"
}
}
// optionApi: async ()=>{return await getRepStoreGeyDataSource()}
}, },
{ {
field: 'storeOperateType', field: 'storeOperateType',
@ -99,7 +109,11 @@ const formSchema = reactive<FormSchema[]>([
}, },
component: 'Select', component: 'Select',
componentProps:{ componentProps:{
options:[] options:[],
filterable:true,
style:{
width:"100%"
}
} }
}, },
{ {
@ -110,7 +124,11 @@ const formSchema = reactive<FormSchema[]>([
}, },
component: 'Select', component: 'Select',
componentProps:{ componentProps:{
options:[] options:[],
filterable:true,
style:{
width:"100%"
}
} }
}, },
{ {
@ -121,7 +139,9 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
style:{
width:"100%"
}
}, },
}, },
{ {
@ -133,6 +153,9 @@ const formSchema = reactive<FormSchema[]>([
}, },
componentProps: { componentProps: {
type:'textarea', type:'textarea',
style:{
width:"100%"
}
}, },
}, },
{ {
@ -177,6 +200,7 @@ const formSchema = reactive<FormSchema[]>([
style:{ style:{
fontSize:"20px !important", fontSize:"20px !important",
color:'rgb(29 127 29) !important', color:'rgb(29 127 29) !important',
width:"100%"
}, },
onClick:()=>{ onClick:()=>{
gradeShow.value = !gradeShow.value; gradeShow.value = !gradeShow.value;
@ -208,7 +232,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -220,7 +247,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -232,7 +262,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -250,7 +283,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -262,7 +298,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -274,7 +313,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -292,7 +334,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -304,7 +349,10 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
@ -316,11 +364,21 @@ const formSchema = reactive<FormSchema[]>([
span:24 span:24
}, },
componentProps: { componentProps: {
filterable:true,
style:{
width:"100%"
}
}, },
hidden:gradeShow.value hidden:gradeShow.value
}, },
]) ])
//
const getDataSourceList = async ()=>{
const dataSourceList = await getRepStoreGeyDataSource();
formSchema[1].componentProps.options = dataSourceList;
formSchema[2].componentProps.options = dataSourceList;
}
getDataSourceList();
const rules = reactive({ const rules = reactive({
dscode: [required()],// dscode: [required()],//
@ -350,6 +408,9 @@ watch(
() => props.currentRow, () => props.currentRow,
(currentRow) => { (currentRow) => {
if (!currentRow) return if (!currentRow) return
if(currentRow.beginDate && currentRow.endDate){
currentRow.date = [currentRow.beginDate,currentRow.endDate];
}
setValues(currentRow) setValues(currentRow)
}, },
{ {

@ -48,7 +48,7 @@ export async function getRepStoreGeySchema(params){
let SCHEMA_LIST = []; let SCHEMA_LIST = [];
await RepStoreGeySchema(params).then(res=>{ await RepStoreGeySchema(params).then(res=>{
if(res.head.code == 0){ if(res.head.code == 0){
SCHEMA_LIST = res.body.list; SCHEMA_LIST = res.body.schemas;
} }
}) })
return SCHEMA_LIST; return SCHEMA_LIST;
@ -59,7 +59,7 @@ export async function getRepStoreGeyTables(params){
let TABLE_LIST = []; let TABLE_LIST = [];
await RepStoreGeyTables(params).then(res=>{ await RepStoreGeyTables(params).then(res=>{
if(res.head.code == 0){ if(res.head.code == 0){
TABLE_LIST = res.body.list; TABLE_LIST = res.body.tables;
} }
}) })
return TABLE_LIST; return TABLE_LIST;

Loading…
Cancel
Save