|
|
|
@ -5,7 +5,7 @@ import { PropType, reactive, watch } from 'vue'
|
|
|
|
|
import { useValidator } from '@/hooks/web/useValidator'
|
|
|
|
|
import { OPERATION_TYPE_LIST,RULE_TYPE_LIST,getRepStoreGeyDataSource,getRepStoreGeySchema,getRepStoreGeyTables } from '../constants';
|
|
|
|
|
import {ref} from "vue"
|
|
|
|
|
|
|
|
|
|
import { randomCode } from '@/utils';
|
|
|
|
|
const { required } = useValidator()
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
@ -27,6 +27,7 @@ let gradeShow = ref(true);//下面的三个高级选项是否隐藏
|
|
|
|
|
let dataSource = reactive({
|
|
|
|
|
dscode:'',
|
|
|
|
|
dsname:'',
|
|
|
|
|
stroageschema:"",//选中的schema信息
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const formSchema = reactive<FormSchema[]>([
|
|
|
|
@ -48,9 +49,10 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
|
on:{
|
|
|
|
|
change:async (value)=>{
|
|
|
|
|
dataSource = value?formSchema[1].componentProps.options.find(item=>item.dscode==value):{};
|
|
|
|
|
editStoreContent('dscode');
|
|
|
|
|
if(dataSource.dscode){
|
|
|
|
|
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):[];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -98,6 +100,11 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
|
componentProps: {
|
|
|
|
|
options:RULE_TYPE_LIST,
|
|
|
|
|
style:{width:'100%'},
|
|
|
|
|
on:{
|
|
|
|
|
change:()=>{
|
|
|
|
|
editStoreContent();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
value:'1'
|
|
|
|
|
},
|
|
|
|
@ -111,6 +118,15 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
|
componentProps:{
|
|
|
|
|
options:[],
|
|
|
|
|
filterable:true,
|
|
|
|
|
on:{
|
|
|
|
|
change:async (value)=>{
|
|
|
|
|
dataSource.stroageschema = value;
|
|
|
|
|
editStoreContent('schema');
|
|
|
|
|
if(dataSource.dscode && dataSource.stroageschema){
|
|
|
|
|
formSchema[6].componentProps.options = await getRepStoreGeyTables(dataSource)?await getRepStoreGeyTables(dataSource):[];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
@ -126,6 +142,11 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
|
componentProps:{
|
|
|
|
|
options:[],
|
|
|
|
|
filterable:true,
|
|
|
|
|
on:{
|
|
|
|
|
change:()=>{
|
|
|
|
|
editStoreContent();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
@ -190,186 +211,196 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
|
// style:{width:'100%'}
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"controlShowGrade",
|
|
|
|
|
// label: `高级(点击${gradeShow.value?'展开':'收起'})`,
|
|
|
|
|
// component:"Divider",
|
|
|
|
|
// componentProps:{
|
|
|
|
|
// contentPosition:"center",
|
|
|
|
|
// borderStyle :'dashed',
|
|
|
|
|
// style:{
|
|
|
|
|
// fontSize:"20px !important",
|
|
|
|
|
// color:'rgb(29 127 29) !important',
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// },
|
|
|
|
|
// onClick:()=>{
|
|
|
|
|
// gradeShow.value = !gradeShow.value;
|
|
|
|
|
// formSchema.forEach(item=>{
|
|
|
|
|
// if(item.field == 'controlShowGrade'){
|
|
|
|
|
// item.label = `高级(点击${gradeShow.value?'展开':'收起'})`;
|
|
|
|
|
// }
|
|
|
|
|
// for(let i in item){
|
|
|
|
|
// if(i == 'remove' || i == 'hidden'){
|
|
|
|
|
// item[i] = gradeShow.value;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
// class:'cursor-pointer'
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"",
|
|
|
|
|
// label:"校验结果信息",
|
|
|
|
|
// component:"Divider",
|
|
|
|
|
// remove:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"chkDscode",
|
|
|
|
|
// label:"校验结果信息数据源",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"chkSchema",
|
|
|
|
|
// label:"schema",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"chkTablename",
|
|
|
|
|
// label:"物理表",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"",
|
|
|
|
|
// label:"日志数据",
|
|
|
|
|
// component:"Divider",
|
|
|
|
|
// remove:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"logDscode",
|
|
|
|
|
// label:"校验结果信息数据源",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"logSchema",
|
|
|
|
|
// label:"schema",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"logTablename",
|
|
|
|
|
// label:"物理表",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"",
|
|
|
|
|
// label:"抽样数据",
|
|
|
|
|
// component:"Divider",
|
|
|
|
|
// remove:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"resDscode",
|
|
|
|
|
// label:"校验结果信息数据源",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"resSchema",
|
|
|
|
|
// label:"schema",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field:"resTablename",
|
|
|
|
|
// label:"物理表",
|
|
|
|
|
// component:"Select",
|
|
|
|
|
// colProps:{
|
|
|
|
|
// span:24
|
|
|
|
|
// },
|
|
|
|
|
// componentProps: {
|
|
|
|
|
// filterable:true,
|
|
|
|
|
// style:{
|
|
|
|
|
// width:"100%"
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// hidden:gradeShow.value
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
field:"controlShowGrade",
|
|
|
|
|
label: `高级(点击${gradeShow.value?'展开':'收起'})`,
|
|
|
|
|
component:"Divider",
|
|
|
|
|
componentProps:{
|
|
|
|
|
contentPosition:"center",
|
|
|
|
|
borderStyle :'dashed',
|
|
|
|
|
style:{
|
|
|
|
|
fontSize:"20px !important",
|
|
|
|
|
color:'rgb(29 127 29) !important',
|
|
|
|
|
width:"100%"
|
|
|
|
|
},
|
|
|
|
|
onClick:()=>{
|
|
|
|
|
gradeShow.value = !gradeShow.value;
|
|
|
|
|
formSchema.forEach(item=>{
|
|
|
|
|
if(item.field == 'controlShowGrade'){
|
|
|
|
|
item.label = `高级(点击${gradeShow.value?'展开':'收起'})`;
|
|
|
|
|
}
|
|
|
|
|
for(let i in item){
|
|
|
|
|
if(i == 'remove' || i == 'hidden'){
|
|
|
|
|
item[i] = gradeShow.value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
class:'cursor-pointer'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"",
|
|
|
|
|
label:"校验结果信息",
|
|
|
|
|
component:"Divider",
|
|
|
|
|
remove:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"chkDscode",
|
|
|
|
|
label:"校验结果信息数据源",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"chkSchema",
|
|
|
|
|
label:"schema",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"chkTablename",
|
|
|
|
|
label:"物理表",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"",
|
|
|
|
|
label:"日志数据",
|
|
|
|
|
component:"Divider",
|
|
|
|
|
remove:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"logDscode",
|
|
|
|
|
label:"校验结果信息数据源",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"logSchema",
|
|
|
|
|
label:"schema",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"logTablename",
|
|
|
|
|
label:"物理表",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"",
|
|
|
|
|
label:"抽样数据",
|
|
|
|
|
component:"Divider",
|
|
|
|
|
remove:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"resDscode",
|
|
|
|
|
label:"校验结果信息数据源",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"resSchema",
|
|
|
|
|
label:"schema",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
field:"modelCode",
|
|
|
|
|
label:"模型编码",
|
|
|
|
|
hidden:true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field:"resTablename",
|
|
|
|
|
label:"物理表",
|
|
|
|
|
component:"Select",
|
|
|
|
|
colProps:{
|
|
|
|
|
span:24
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
filterable:true,
|
|
|
|
|
style:{
|
|
|
|
|
width:"100%"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hidden:gradeShow.value
|
|
|
|
|
field:"ruleId",
|
|
|
|
|
label:"规则编码",
|
|
|
|
|
hidden:true
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
//获取基础信息中的数据源信息
|
|
|
|
@ -389,6 +420,33 @@ const rules = reactive({
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//修改数据集合信息
|
|
|
|
|
const editStoreContent = async (editColumn:string = '')=>{
|
|
|
|
|
const formData = await getFormData();
|
|
|
|
|
switch(editColumn){
|
|
|
|
|
case 'dscode':
|
|
|
|
|
formData.schema = "";
|
|
|
|
|
formData.tableName = "";
|
|
|
|
|
break;
|
|
|
|
|
case 'schema':
|
|
|
|
|
formData.tableName = "";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(formData.dscode && formData.schema && formData.tableName){
|
|
|
|
|
switch(formData.storeType){
|
|
|
|
|
case "1":
|
|
|
|
|
formData.storeContent = `${formData.schema}.${formData.tableName}`
|
|
|
|
|
break;
|
|
|
|
|
case "2":
|
|
|
|
|
formData.storeContent = `select * from ${formData.schema}.${formData.tableName}`
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
formData.storeContent = '';
|
|
|
|
|
}
|
|
|
|
|
setValues(formData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const submit = async () => {
|
|
|
|
|
const elForm = await getElFormExpose()
|
|
|
|
|
const valid = await elForm?.validate().catch((err) => {
|
|
|
|
|