parent
d327a1e278
commit
48aba02087
@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<TabComponent
|
||||
ref="tabComponent"
|
||||
:initial-tabs="tabs"
|
||||
:req-fun="openDB"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
tabs: [
|
||||
{
|
||||
"title": "开发KIS",
|
||||
"name": "kisMssql",
|
||||
"dbType": "mssql",
|
||||
"url": "jdbc:sqlserver://192.168.3.28:1433;DatabaseName=KIS;encrypt=true;trustServerCertificate=true;",
|
||||
"username": "sa",
|
||||
"password": "mssql_whdZeB",
|
||||
"driverClassName": "com.microsoft.sqlserver.jdbc.SQLServerDriver"
|
||||
},
|
||||
{
|
||||
"title": "本地KIS",
|
||||
"name": "localKis",
|
||||
"dbType": "mssql",
|
||||
"url": "jdbc:sqlserver://192.168.3.252:1433;DatabaseName=KIS_Sample;trustServerCertificate=true;sslProtocol=TLSv1.2;",
|
||||
"username": "sa",
|
||||
"password": "abc123456.",
|
||||
"driverClassName": "com.microsoft.sqlserver.jdbc.SQLServerDriver"
|
||||
},
|
||||
],
|
||||
addTabDialogVisible: false,
|
||||
activeTab: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async openDB(data) {
|
||||
await this.closeDialog();
|
||||
/*try {
|
||||
const response = await request({
|
||||
method: 'put',
|
||||
url: "", // 确保 URL 是正确的
|
||||
data: data
|
||||
});
|
||||
|
||||
if (response.data.success) {
|
||||
const newTab = response.data.tab;
|
||||
this.tabs.push(newTab);
|
||||
this.activeTab = (this.tabs.length - 1).toString();
|
||||
this.addTabDialogVisible = false;
|
||||
this.$message.success('标签页添加成功');
|
||||
} else {
|
||||
this.$message.error('标签页添加失败');
|
||||
}
|
||||
} catch (error) {
|
||||
await this.closeDialog();
|
||||
this.$message.error('请求失败,请稍后再试');
|
||||
console.error(error);
|
||||
}*/
|
||||
},
|
||||
async closeDialog() {
|
||||
if (this.$refs.tabComponent) {
|
||||
this.$refs.tabComponent.handleClose();
|
||||
} else {
|
||||
console.error('TabComponent ref is not defined');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// console.log('App mounted', this.$refs.tabComponent);
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue