Commit eb7c71e5 authored by LiXuyang's avatar LiXuyang

Merge remote-tracking branch 'origin/master'

parents f6b1fa48 ea7086f4
......@@ -94,6 +94,8 @@
return { ...response };
},
rowKey: 'key',
showHeader:false,
striped:false,
columns:guideModeTableColumns7,
pagination:false,
showIndexColumn: false,
......
......@@ -634,6 +634,8 @@ export const guideModeTableColumns1: BasicColumn[] = [
title: '参数类型',
dataIndex: 'parameterType',
width: 150,
edit: true,
editable: true,
},
{
title: '注释',
......@@ -656,7 +658,9 @@ export const guideModeTableColumns1: BasicColumn[] = [
{
title: '默认值',
dataIndex: 'defaultValue',
width: 150
width: 150,
edit: true,
editable: true,
},
{
title: '示例值',
......@@ -698,7 +702,9 @@ export const guideModeTableColumns2: BasicColumn[] = [
{
title: '参数类型',
dataIndex: 'parameterType',
width: 150
width: 150,
edit: true,
editable: true,
},
{
title: '参数映射字段',
......@@ -753,7 +759,9 @@ export const guideModeTableColumns3: BasicColumn[] = [
{
title: '参数类型',
dataIndex: 'parameterType',
width: 150
width: 150,
edit: true,
editable: true,
},
{
title: '是否必填',
......@@ -989,44 +997,27 @@ export const versionSearchFormSchema: FormSchema[] = [
];
/**SQL模式-步骤1 列表表头1*/
export const step1TableColumns1: BasicColumn[] = [
{
"title": '参数',
"dataIndex": 'parameter',
"width": 150,
edit: true,
editable: true,
{
title: '参数',
dataIndex: 'parameter',
width: 150,
},
{
"title": '别名',
"dataIndex": 'alias',
"width": 150,
title: '别名',
dataIndex: 'alias',
width: 150,
edit: true,
editable: true,
},
{
title: '来源SQL',
dataIndex: 'sourceSql',
edit: true,
editable: true,
editComponent: 'Select',
editComponentProps: {
options: [
{
label: 'S1',
value: '1',
},
{
label: 'S2',
value: '2',
},
],
},
width: 150,
},
{
"title": '',
"dataIndex": 'sql',
"width": 150,
title: '',
dataIndex: 'sql',
width: 150,
},
{
title: '参数类型',
......@@ -1049,16 +1040,16 @@ export const step1TableColumns1: BasicColumn[] = [
width: 150,
},
{
"title": '注释',
"dataIndex": 'comment',
"width": 150,
title: '注释',
dataIndex: 'comment',
width: 150,
edit: true,
editable: true,
},
{
"title": '默认值',
"dataIndex": 'defaultValue',
"width": 150,
title: '默认值',
dataIndex: 'defaultValue',
width: 150,
edit: true,
editable: true,
}
......@@ -1066,43 +1057,26 @@ export const step1TableColumns1: BasicColumn[] = [
/**SQL模式-步骤1 列表表头2*/
export const step1TableColumns2: BasicColumn[] = [
{
"title": '参数',
"dataIndex": 'parameter',
"width": 150,
edit: true,
editable: true,
title: '参数',
dataIndex: 'parameter',
width: 150,
},
{
"title": '别名',
"dataIndex": 'alias',
"width": 150,
title: '别名',
dataIndex: 'alias',
width: 150,
edit: true,
editable: true,
},
{
title: '来源SQL',
dataIndex: 'sourceSql',
edit: true,
editable: true,
editComponent: 'Select',
editComponentProps: {
options: [
{
label: 'S1',
value: '1',
},
{
label: 'S2',
value: '2',
},
],
},
width: 150,
},
{
"title": '',
"dataIndex": 'sql',
"width": 150,
title: '',
dataIndex: 'sql',
width: 150,
},
{
title: '参数类型',
......
......@@ -353,29 +353,29 @@ export const step1TableData1: any[] = [
{
parameter:'id',
alias:'id',
sourceSql:'1',
sourceSql:'S1',
sql:'SELECT name,birthday,sum(weight) as weight_total from yl_test.yl_table_01 WHERE id< #{id} GROUP BY name,birthday,id HAVING weight_total > #{weight_total} ORDER BY id limit #{offset},#{maxRows} SELECT name,birthday from yl_test.yl_table_01 WHERE id<${id} GROUP BY name,birthday,id HAVING weight_total > #{weight_total} ORDER BY id limit #{offset},#{maxRows}',
parameterType:'String',
comment:'',
defaultValue:'默认值'
defaultValue:''
},
{
parameter:'weight_total',
alias:'weight_total',
sourceSql:'1',
sourceSql:'S1',
sql:'SELECT name,birthday,sum(weight) as weight_total from yl_test.yl_table_01 WHERE id< #{id} GROUP BY name,birthday,id HAVING weight_total > #{weight_total} ORDER BY id limit #{offset},#{maxRows} SELECT name,birthday from yl_test.yl_table_01 WHERE id<${id} GROUP BY name,birthday,id HAVING weight_total > #{weight_total} ORDER BY id limit #{offset},#{maxRows}',
parameterType:'String',
comment:'',
defaultValue:'默认值'
defaultValue:''
},
{
parameter:'offset',
alias:'offset',
sourceSql:'1',
sourceSql:'S1',
sql:'SELECT name,birthday,sum(weight) as weight_total from yl_test.yl_table_01 WHERE id< #{id} GROUP BY name,birthday,id HAVING weight_total > #{weight_total} ORDER BY id limit #{offset},#{maxRows} SELECT name,birthday from yl_test.yl_table_01 WHERE id<${id} GROUP BY name,birthday,id HAVING weight_total > #{weight_total} ORDER BY id limit #{offset},#{maxRows}',
parameterType:'String',
comment:'',
defaultValue:'默认值'
defaultValue:''
}
];
/**SQL模式-步骤1 列表数据2*/
......
......@@ -7,7 +7,7 @@
<template v-for="item in cardData" :key="item.title">
<Col :span="6">
<List.Item>
<Card :hoverable="true" :class="`${prefixCls}__card`">
<Card :hoverable="true" @click="updateCardClass(item)" :class="{'cardItemClass':selectItem === item.title}">
<div :class="`${prefixCls}__card-title`">
<Icon class="icon" v-if="item.icon" :icon="item.icon" :color="item.color" />
{{ item.title }}
......@@ -55,6 +55,7 @@
const { createMessage } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectItem = ref('');
const prefixCls = 'list-card';
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
......@@ -110,6 +111,11 @@
});
}
/**改变card样式*/
function updateCardClass(item){
console.log('item:',item)
selectItem.value = item.title
}
/**数组对象转成树*/
function handleTree(data, id, parentId, children, rootId) {
......@@ -215,4 +221,7 @@
margin-right: 30px;
}
}
.cardItemClass{
border: 2px solid rgba(42, 125, 201, 0.56);
}
</style>
......@@ -19,7 +19,7 @@
<div>
<BasicTable @register="registerTable1">
<template #toolbar>
<a-button type="primary" @click="addButton">添加</a-button>
<a-button type="primary" @click="addButton1">添加</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
......@@ -42,7 +42,7 @@
</BasicTable>
<BasicTable @register="registerTable2">
<template #toolbar>
<a-button type="primary" @click="addButton">添加</a-button>
<a-button type="primary" @click="addButton2">添加</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
......@@ -66,7 +66,7 @@
<BasicTable @register="registerTable3"/>
<BasicTable @register="registerTable4">
<template #toolbar>
<a-button type="primary" @click="addButton">添加</a-button>
<a-button type="primary" @click="addButton4">添加</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
......@@ -89,7 +89,7 @@
</BasicTable>
<BasicTable @register="registerTable5">
<template #toolbar>
<a-button type="primary" @click="addButton">添加</a-button>
<a-button type="primary" @click="addButton5">添加</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
......@@ -162,6 +162,11 @@
defineOptions({ name: 'Metadata' });
const route = useRoute();
const optionValue = ref('')
const tableData1 = ref(guideModelTableData1)
const tableData2 = ref(guideModelTableData2)
const tableData3 = ref(guideModelTableData3)
const tableData4 = ref(guideModelTableData4)
const tableData5 = ref(guideModelTableData5)
const startContrastFlag = ref(false)
const title = ref('员工薪资查询-向导模式')
const options = ref<any>([
......@@ -183,20 +188,20 @@
},
});
const [registerTable1] = useTable({
const [registerTable1,{reload:reload1}] = useTable({
title: '请求参数',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: guideModelTableData1.length,
total: tableData1.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: guideModelTableData1 };
return { ...response,data: tableData1.value };
},
columns:guideModeTableColumns1,
useSearchForm: false,
......@@ -206,25 +211,25 @@
bordered: true,
scroll: { y: 300 },
actionColumn: {
width: 200,
width: 100,
title: '操作',
dataIndex: 'action',
},
});
const [registerTable2] = useTable({
const [registerTable2,{reload:reload2}] = useTable({
title: '行权限参数',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: guideModelTableData2.length,
total: tableData2.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: guideModelTableData2 };
return { ...response,data: tableData2.value };
},
columns:guideModeTableColumns2,
useSearchForm: false,
......@@ -239,20 +244,20 @@
dataIndex: 'action',
},
});
const [registerTable3] = useTable({
const [registerTable3,{reload:reload3}] = useTable({
title: '分页参数',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: guideModelTableData3.length,
total: tableData3.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: guideModelTableData3 };
return { ...response,data: tableData3.value };
},
columns:guideModeTableColumns3,
useSearchForm: false,
......@@ -262,20 +267,20 @@
bordered: true,
scroll: { y: 300 },
});
const [registerTable4] = useTable({
const [registerTable4,{reload:reload4}] = useTable({
title: '返回参数',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: guideModelTableData4.length,
total: tableData4.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: guideModelTableData4 };
return { ...response,data: tableData4.value };
},
columns:guideModeTableColumns4,
useSearchForm: false,
......@@ -290,20 +295,20 @@
dataIndex: 'action',
},
});
const [registerTable5] = useTable({
const [registerTable5,{reload:reload5}] = useTable({
title: '排序参数',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: guideModelTableData5.length,
total: tableData5.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: guideModelTableData5 };
return { ...response,data: tableData5.value };
},
columns:guideModeTableColumns5,
useSearchForm: false,
......@@ -392,6 +397,55 @@
})
}
/**添加按钮1*/
function addButton1() {
const param = {
column: '',
parameterCode: '',
parameterType: '',
comment: '',
required: false,
defaultValue:'',
exampleValue:''
}
tableData1.value.push(param)
reload1()
}
/**添加按钮2*/
function addButton2() {
const param = {
column: '',
parameterCode: '',
parameterType: '',
parameterMappingFields:'',
}
tableData2.value.push(param)
reload2()
}
/**添加按钮4*/
function addButton4() {
const param = {
column: '',
parameterCode: '',
comment: '',
exampleValue:''
}
tableData4.value.push(param)
reload4()
}
/**添加按钮5*/
function addButton5() {
const param = {
column: '',
orderType:''
}
tableData5.value.push(param)
reload5()
}
/**保存*/
function saveButton() {
createMessage.success('保存成功');
......
......@@ -24,7 +24,17 @@
<div style="display: flex; justify-content: flex-start;">
<a-button type="primary" @click="" style="margin-right: 10px">解析</a-button>
<a-button type="primary" @click="settingSQLButton" style="margin-right: 10px">SQL设置</a-button>
<a-button type="primary" @click="" style="margin-right: 10px">从SQL文件获取SQL</a-button>
<BasicUpload
:maxSize="20"
:maxNumber="10"
@change="handleChange"
:api="uploadApi"
:accept="['image/*']"
>
<template #uploadBtnName>
<span>从SQL文件获取SQL</span>
</template>
</BasicUpload>
</div>
<div class="w-full">
<Tabs defaultActiveKey="原始入参" @change="handleChangeTab">
......@@ -69,6 +79,7 @@
import SqlSettingModal from './sqlSettingModal.vue'
import MetadataPreviewDrawer from './MetadataPreviewDrawer.vue'
import { useDrawer } from '@/components/Drawer';
import { BasicUpload } from '@/components/Upload';
const [registerMetadataPreviewDrawer, { openDrawer:openMetadataPreviewDrawer }] = useDrawer();
const [registerRunModal, { openModal: openRunModal }] = useModal();
......@@ -174,7 +185,6 @@
});
}
/**初始化*/
onMounted(() => {
optionValue.value = '1'
......
......@@ -46,8 +46,18 @@
<BasicTable @register="registerTable1">
<template #toolbar>
<a-button type="primary" @click="typeManageButton">导入原始入参</a-button>
<a-button type="primary" @click="typeManageButton">添加参数</a-button>
<BasicUpload
:maxSize="20"
:maxNumber="10"
@change="handleChange"
:api="uploadApi"
:accept="['image/*']"
>
<template #uploadBtnName>
<span>导入原始入参</span>
</template>
</BasicUpload>
<a-button type="primary" @click="addParamButton">添加参数</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
......@@ -95,9 +105,11 @@
import CodeEditor from "@/components/CodeEditor/src/CodeEditor.vue";
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns,step2TableColumns1,step2TableColumns2 } from './api.data';
import { BasicUpload } from '@/components/Upload';
const { createMessage } = useMessage();
const emit = defineEmits(['next']);
const tableData1 = ref(step2TableData1)
const optionValue1 = ref('')
const optionValue2 = ref('')
const optionValue3 = ref('')
......@@ -134,7 +146,7 @@
const sql = ref(step1SQLData[0].sql);
const show = ref(false)
const json = ref('{ "category": "SERVICE", "page": 1, "size": 10, "searchText": "", "uuid": "5B86749FD7CFB3CFF8100794FE15D3E", "sortRules": [], "filterRules": [], "timeRangeFilters": [], "fieldFuzzySearch": [], "childrenRequest": null, "catalogFlag": false }')
const [registerTable1] = useTable({
const [registerTable1,{reload:reload1}] = useTable({
title: '',
api: async (params) => {
var data = [];
......@@ -142,13 +154,13 @@
pageNu: "1",
pageSize: "10",
pages: "1",
total: step2TableData1.length,
total: tableData1.value.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: step2TableData1 };
return { ...response,data: tableData1.value };
},
columns:step2TableColumns1,
useSearchForm: false,
......@@ -209,6 +221,22 @@
show.value = true
}
/**添加参数*/
function addParamButton(){
const param = {
parameterCode:'',
parameterLocation:'',
Xpath:'',
dataType:'',
comment:'',
isNeed:'',
defaultValue:'',
exampleValue:''
}
tableData1.value.push(param)
reload1()
}
/**初始化*/
onMounted(() => {
optionValue1.value = '映射规则'
......
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