fix:解决正确ip配置时,数据库连接会一直等待,最后连接超时问题

master
20300 2024-04-29 14:25:42 +08:00
parent be3c2204aa
commit 08242584db
6 changed files with 96 additions and 300 deletions

View File

@ -5,17 +5,17 @@
<el-row> <el-row>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName"> <el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.name" disabled/> <el-input v-model="baseInfo.dataSource.name" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName"> <el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/> <el-input v-model="baseInfo.dataSource.fromSystem" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName"> <el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/> <el-input v-model="baseInfo.dataSource.dataSourceDatabaseName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -66,7 +66,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
style="display: block" style="display: block"
v-model="scope.row.isAuth" v-model="scope.row.havePermissions"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
active-text="已授权" active-text="已授权"

View File

@ -4,33 +4,33 @@
<el-form ref="form" :model="baseInfo" label-width="120px"> <el-form ref="form" :model="baseInfo" label-width="120px">
<el-row> <el-row>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName"> <el-form-item label="数据接入名称" prop="name">
<el-input v-model="baseInfo.name" disabled/> <el-input v-model="baseInfo.dataSource.name" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName"> <el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/> <el-input v-model="baseInfo.dataSource.fromSystem" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName"> <el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/> <el-input v-model="baseInfo.dataSource.dataSourceDatabaseName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="表名称" prop="nickName"> <el-form-item label="表名称" prop="nickName">
<el-input v-model="baseInfo.tableName" disabled/> <el-input v-model="baseInfo.dataTable.tableName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="表中文名" prop="nickName"> <el-form-item label="表中文名" prop="nickName">
<el-input v-model="baseInfo.tableAsName" disabled/> <el-input v-model="baseInfo.dataTable.tableAnnotation" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据量" prop="nickName"> <el-form-item label="数据量" prop="nickName">
<el-input v-model="baseInfo.total" disabled/> <el-input v-model="baseInfo.dataTable.recordCount" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -77,11 +77,11 @@
<el-table-column align="center" label="用户邮箱" prop="email"/> <el-table-column align="center" label="用户邮箱" prop="email"/>
<el-table-column align="center" label="用户手机号" prop="phonenumber"/> <el-table-column align="center" label="用户手机号" prop="phonenumber"/>
<el-table-column align="center" label="创建时间" prop="createTime" /> <el-table-column align="center" label="创建时间" prop="createTime" />
<el-table-column align="center" label="操作" prop="createTime" > <el-table-column align="center" label="操作" prop="havePermissions" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
style="display: block" style="display: block"
v-model="scope.row.isAuth" v-model="scope.row.havePermissions"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
active-text="已授权" active-text="已授权"
@ -112,251 +112,36 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 1,
// //
baseInfo: { baseInfo: {},
name: "测试1",
systemName: "云计算系统",
databaseName: "yunjisuan",
tableName: "sys_user",
tableAsName: "用户表",
total: "12546条",
},
// //
deptList: [], deptList: [],
// //
userList: [] userList: []
}; };
}, },
props: {
userAndDeptDataPermissionsListResp: {
type: Object
}
},
watch: {
userAndDeptDataPermissionsListResp: {
handler(newValue,oldValue){
this.baseInfo = newValue.dataInfo
this.deptList = this.handleTree(newValue.deptDataPermissionList,"deptId")
console.log("前台deptList:",this.deptList)
this.userList = newValue.userDataPermissionsList
}
}
},
created() { created() {
this.loading = true; this.loading = true;
setTimeout(() => this.loading = false, 200) setTimeout(() => this.loading = false, 200)
this.init()
}, },
methods: { methods: {
parseTime, parseTime,
init(){ updatePermissions(row){
let response = { console.log("修改权限:",row)
"code": 200,
"msg": "操作成功",
"data": [
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 100,
"parentId": 0,
"ancestors": "0",
"deptName": "muyu牧鱼科技",
"orderNum": 0,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 101,
"parentId": 100,
"ancestors": "0,100",
"deptName": "深圳总公司",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 102,
"parentId": 100,
"ancestors": "0,100",
"deptName": "长沙分公司",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 103,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "研发部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 104,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "市场部门",
"isAuth": true,
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 105,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "测试部门",
"orderNum": 3,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 106,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "财务部门",
"orderNum": 4,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 107,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "运维部门",
"orderNum": 5,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 108,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "市场部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 109,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "财务部门",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
}
]
}
this.deptList = this.handleTree(response.data, "deptId");
this.userList = [
{
"createBy": "admin",
"createTime": "2023-04-23 16:11:38",
"updateBy": null,
"updateTime": null,
"remark": "管理员",
"userId": 1,
"deptId": 103,
"userName": "admin",
"nickName": "智能车联",
"email": "ry@163.com",
"phonenumber": "15888888888",
"isAuth": true,
"dept": {
"deptName": "研发部门"
}
},
{
"createBy": "admin",
"createTime": "2023-04-23 16:11:38",
"updateBy": null,
"updateTime": null,
"remark": "测试员",
"userId": 2,
"deptId": 105,
"userName": "ry",
"nickName": "智能车联",
"email": "ry@qq.com",
"phonenumber": "15666666666",
"dept": {
"deptName": "测试部门"
}
}
]
} }
}, },
}; };

View File

@ -7,15 +7,15 @@
lazy lazy
@node-click="(data) => showAssets=data.type"> @node-click="(data) => showAssets=data.type">
<div class="custom-tree-node" slot-scope="{ node, data }"> <div class="custom-tree-node" slot-scope="{ node, data }">
<div @click="getDeptAndUser(data.dataSource)" v-if="data.type === 'dataSource'">{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}</div> <div @click="getDeptAndUser(data,'dataSource',null)" v-if="data.type === 'dataSource'">{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}</div>
<div v-if="data.type === 'dataTable'">{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+')' }}</div> <div @click="getDeptAndUser(data,'dataTable',data.dataTable)" v-if="data.type === 'dataTable'">{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+')' }}</div>
</div> </div>
</el-tree> </el-tree>
</el-aside> </el-aside>
<el-container> <el-container>
<el-main> <el-main>
<auth-data-source :userAndDeptDataPermissionsListResp="userAndDeptDataPermissionsListResp" v-if="showAssets === 'dataSource'"/> <auth-data-source :userAndDeptDataPermissionsListResp="userAndDeptDataPermissionsListResp" v-if="showAssets === 'dataSource'"/>
<auth-table v-else-if="showAssets === 'dataTable'"/> <auth-table :userAndDeptDataPermissionsListResp="userAndDeptDataPermissionsListResp" v-else-if="showAssets === 'dataTable'"/>
</el-main> </el-main>
</el-container> </el-container>
</el-container> </el-container>
@ -48,12 +48,29 @@ export default {
} }
}, },
methods: { methods: {
getDeptAndUser(dataSource){ getDeptAndUser(dataObject,dataType,dataTable){
this.dataType = "dataSource" console.log(dataObject,dataType)
getAllUserAndDept(this.dataType,dataSource.id).then( let id = null;
if (dataType == "dataSource"){
id = dataObject.dataSource.id;
}else if (dataType == "dataTable"){
id = dataObject.dataTable.id
console.log(this.assetStructureList)
console.log(dataTable)
this.assetStructureList.forEach(
assetsStr => {
if ( assetsStr.dataSource.id == dataTable.dataSourceId){
console.log("进来咯")
dataObject = assetsStr
}
}
)
dataObject.dataTable = dataTable
}
getAllUserAndDept(dataType,id).then(
res => { res => {
this.userAndDeptDataPermissionsListResp = res.data this.userAndDeptDataPermissionsListResp = res.data
this.userAndDeptDataPermissionsListResp.dataInfo = dataSource this.userAndDeptDataPermissionsListResp.dataInfo = dataObject
console.log("后台响应对象:",this.userAndDeptDataPermissionsListResp) console.log("后台响应对象:",this.userAndDeptDataPermissionsListResp)
} }
) )

View File

@ -63,7 +63,7 @@
<span>{{dictionaryInfoResp.dictionary.dictionaryName}}</span> <span>{{dictionaryInfoResp.dictionary.dictionaryName}}</span>
<el-button style="float: right; padding: 3px 0" <el-button style="float: right; padding: 3px 0"
type="text" type="text"
@click="dictionaryInfoResp.dictionaryInfoList.push({ dictionaryInfoTag: null, dictionaryInfoValue: null, isEdit: true })" @click="dictionaryInfoResp.dictionaryInfoList.push({dictionaryInfoTag: null, dictionaryInfoValue: null, isEdit: true })"
>新增</el-button> >新增</el-button>
</div> </div>
<el-table :data="dictionaryInfoResp.dictionaryInfoList" style="width: 100%" height="280px"> <el-table :data="dictionaryInfoResp.dictionaryInfoList" style="width: 100%" height="280px">
@ -125,10 +125,7 @@ export default {
assetsModelRespArrayList:{ assetsModelRespArrayList:{
// variable // variable
handler(item1,item2){ handler(item1,item2){
console.log("新值",item1)
this.activeName=item1[0].dataTable.tableName this.activeName=item1[0].dataTable.tableName
console.log("name:",this.activeName)
console.log("旧址",item2)
} }
} }
}, },
@ -145,6 +142,7 @@ export default {
}, },
data() { data() {
return { return {
flagDictionaryId:null,
nowTime: null, nowTime: null,
activeName: '', activeName: '',
dictionary: {}, dictionary: {},
@ -156,20 +154,9 @@ export default {
CountTo CountTo
}, },
methods: { methods: {
updateEdit(row) {
this.$set(row,'isEdit',true)
console.log("行对象:"+row)
// this.dictionaryInfoRespList.forEach(dictionaryInfoResp => {
// dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
// if (dictionaryInfo.id == row){
// console.log("",dictionaryInfo.isEdit)
// this.$set(dictionaryInfo,'isEdit',true)
// dictionaryInfo.isEdit = true
// }
// })
// })
},
editConfirm(row,dictId){ editConfirm(row,dictId){
console.log("获得的dictID",dictId)
row.dictionaryId = dictId row.dictionaryId = dictId
console.log("字典信息",row) console.log("字典信息",row)
if (row.dictionaryInfoTag.length == 0 || row.dictionaryInfoValue.length == 0) { if (row.dictionaryInfoTag.length == 0 || row.dictionaryInfoValue.length == 0) {
@ -194,7 +181,7 @@ export default {
this.$set(dictionaryInfo,'isEdit',false) this.$set(dictionaryInfo,'isEdit',false)
}) })
}) })
this.$emit('handleSetLineChartData', this.giveObj) this.handleSetLineChartData(this.giveObj)
} }
) )
}, },
@ -206,12 +193,21 @@ export default {
this.$message.error('数据字典,不可为空'); this.$message.error('数据字典,不可为空');
return; return;
} }
let dictionaryInfoArrayList = {}
this.dictionary.dataSourceId = this.dataSourceObj.dataSource.id this.dictionary.dataSourceId = this.dataSourceObj.dataSource.id
dictionaryInfoArrayList.dictionary = this.dictionary
dictionaryInfoArrayList.dictionaryInfoList = []
insertDictionary(this.dictionary).then( insertDictionary(this.dictionary).then(
res => { res => {
console.log(res) console.log("让我看看",res)
dictionaryInfoArrayList.dictionary.id = res.data
this.dictionaryInfoRespList.push(dictionaryInfoArrayList)
this.dictionary = {} this.dictionary = {}
this.getDictionaryResp() this.getDictionaryResp()
if (res.code == 200){
this.$message.success("添加成功")
}
} }
) )
}, },

View File

@ -26,7 +26,7 @@
import OverallAssets from './dashboard/OverallAssets.vue' import OverallAssets from './dashboard/OverallAssets.vue'
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue' import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue' import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
import {queryBigStructure, queryTableStructure} from "@/api/dataSource/data"; import {queryBigStructure} from "@/api/dataSource/data";
import {getAssetsModelByDataTableId, getAssetsModelListByTableIds} from "@/api/dataSource/assets"; import {getAssetsModelByDataTableId, getAssetsModelListByTableIds} from "@/api/dataSource/assets";
import {getDictionaryRespByDataSourceId} from "@/api/dataSource/dictionary"; import {getDictionaryRespByDataSourceId} from "@/api/dataSource/dictionary";

View File

@ -116,13 +116,6 @@
@click="dataSynchronization(scope.row)" @click="dataSynchronization(scope.row)"
v-hasPermi="['system:access:remove']" v-hasPermi="['system:access:remove']"
>同步数据</el-button> >同步数据</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="queryDataBase(scope.row)"
v-hasPermi="['system:access:remove']"
>查询此数据库</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -166,6 +159,18 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="用户名" prop="dataSourceUsername">
<el-input v-model="form.dataSourceUsername" placeholder="请输入用户名" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="密码" prop="dataSourcePassword">
<el-input v-model="form.dataSourcePassword" placeholder="请输入密码" />
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="数据接入类型" prop="type"> <el-form-item label="数据接入类型" prop="type">
@ -259,16 +264,6 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="查询结构" :visible.sync="dialogTableVisible">
<el-form>
<el-form-item label="选择表" prop="type">
<el-select style="width: 100%" v-model="selectTableName">
<el-option v-for="table in tableList" :label="table" :value="table" ></el-option>
</el-select>
</el-form-item>
</el-form>
<el-button @click="queryTableStructure"></el-button>
</el-dialog>
</div> </div>
</template> </template>
@ -431,10 +426,10 @@ export default {
dataSourcePort: null, dataSourcePort: null,
dataSourceDatabaseName: null, dataSourceDatabaseName: null,
additionalConfiguration: null, additionalConfiguration: null,
initialNumberOfConnections: 5, initialNumberOfConnections: null,
maximumNumberOfConnections: 20, maximumNumberOfConnections: null,
maximumWaitingTime: 3000, maximumWaitingTime: null,
maximumWaitingTimes: 3, maximumWaitingTimes: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
@ -460,6 +455,7 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.dataSourceParamList = []
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加数据接入"; this.title = "添加数据接入";
@ -469,13 +465,15 @@ export default {
this.reset(); this.reset();
this.form = row; this.form = row;
this.dataSourceParamList = []; this.dataSourceParamList = [];
this.form.additionalConfiguration.split("&").forEach(param => { if (this.form.additionalConfiguration!=undefined){
let paramArr = param.split("="); this.form.additionalConfiguration.split("&").forEach(param => {
this.dataSourceParamList.push({ let paramArr = param.split("=");
name: paramArr[0], this.dataSourceParamList.push({
val: paramArr[1] name: paramArr[0],
val: paramArr[1]
})
}) })
}) }
this.open = true; this.open = true;
this.title = "修改数据接入"; this.title = "修改数据接入";
}, },