数据对象同步功能添加

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="数据对象选择" title="数据对象选择"
@ok="modalSuReClick" @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> <template #centerFooter>
<a-button type="success" @click="handleAddForm"> </a-button> <a-button type="success" @click="handleAddForm"> </a-button>
</template> </template>
@ -130,6 +138,23 @@
clearImportSelectedRowKeys(); clearImportSelectedRowKeys();
}, 200); }, 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() { function dataBaseClick() {
let rows = getImportSelectRows(); let rows = getImportSelectRows();
let param = { let param = {
@ -144,4 +169,13 @@
}); });
} }
</script> </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: '状态', title: '状态',
dataIndex: 'state', dataIndex: 'stateSlot',
customRender: ({ record }) => { key: 'stateSlot',
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);
},
}, },
]; ];
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [

View File

@ -50,30 +50,30 @@ export const formSchema: FormSchema[] = [
options: [ options: [
{ {
label: 'MySql', label: 'MySql',
value: 'MySql' value: 'MySql',
}, },
{ {
label: 'SqlServer', label: 'SqlServer',
value: 'SqlServer' value: 'SqlServer',
}, },
{ {
label: 'Oracle', label: 'Oracle',
value: 'Oracle' value: 'Oracle',
}, },
{ {
label: 'PostgreSQL', label: 'PostgreSQL',
value: 'PostgreSQL' value: 'PostgreSQL',
}, },
{ {
label: '达梦', label: '达梦',
value: 'Dameng' value: 'Dameng',
}, },
{ {
label: '人大金仓', label: '人大金仓',
value: 'Kdbndp' value: 'Kdbndp',
} },
] ],
} },
}, },
{ {
field: 'serverAddress', field: 'serverAddress',
@ -98,6 +98,6 @@ export const formSchema: FormSchema[] = [
{ {
field: 'description', field: 'description',
label: '说明', label: '说明',
component: 'InputTextArea' component: 'InputTextArea',
} },
]; ];