数据对象同步功能添加

hc_zhufu
zzq 2024-05-21 15:41:35 +08:00
parent 4ee21ae6c9
commit 173de51fde
3 changed files with 57 additions and 34 deletions

View File

@ -21,7 +21,15 @@
title="数据对象选择"
@ok="modalSuReClick"
>
<BasicTable @register="registerDataTable" />
<BasicTable @register="registerDataTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'stateSlot'">
<div>
<span class="tbBtnBox" @click="tbBtnClick(record)"></span>
</div>
</template>
</template>
</BasicTable>
<template #centerFooter>
<a-button type="success" @click="handleAddForm"> </a-button>
</template>
@ -130,6 +138,23 @@
clearImportSelectedRowKeys();
}, 200);
}
function tbBtnClick(record: Recordable) {
let obj = [
{
name: record.tableName,
description: record.description,
},
];
let param = {
dbCode: receiceDbCode.value,
tableList: obj,
};
importDataBaseTable(param).then((res: Recordable) => {
console.log(res);
message.success('同步成功', 2);
reload();
});
}
function dataBaseClick() {
let rows = getImportSelectRows();
let param = {
@ -144,4 +169,13 @@
});
}
</script>
<style lang="less"></style>
<style lang="less">
.tbBtnBox {
padding: 2px 8px;
background: #67c23a;
color: #fff;
font-size: 13px;
border-radius: 3px;
cursor: pointer;
}
</style>

View File

@ -13,19 +13,8 @@ export const columns: BasicColumn[] = [
},
{
title: '状态',
dataIndex: 'state',
customRender: ({ record }) => {
const status = record.state;
let enable;
if (status == '1') {
enable = true;
} else {
enable = false;
}
const color = enable ? '#67c23a' : '#e6a23c';
const text = enable ? '同步' : '异步';
return h(Tag, { color: color }, () => text);
},
dataIndex: 'stateSlot',
key: 'stateSlot',
},
];
export const searchFormSchema: FormSchema[] = [

View File

@ -48,39 +48,39 @@ export const formSchema: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{
{
label: 'MySql',
value: 'MySql'
value: 'MySql',
},
{
{
label: 'SqlServer',
value: 'SqlServer'
value: 'SqlServer',
},
{
{
label: 'Oracle',
value: 'Oracle'
value: 'Oracle',
},
{
{
label: 'PostgreSQL',
value: 'PostgreSQL'
value: 'PostgreSQL',
},
{
{
label: '达梦',
value: 'Dameng'
value: 'Dameng',
},
{
{
label: '人大金仓',
value: 'Kdbndp'
}
]
}
value: 'Kdbndp',
},
],
},
},
{
field: 'serverAddress',
label: '服务器地址',
component: 'Input',
required: true,
},
},
{
field: 'dbConnection',
label: '连接串',
@ -98,6 +98,6 @@ export const formSchema: FormSchema[] = [
{
field: 'description',
label: '说明',
component: 'InputTextArea'
}
];
component: 'InputTextArea',
},
];