feat:数据授权
parent
7a77754b15
commit
6b6063da8a
|
@ -0,0 +1,30 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 根据表id查询授权信息
|
||||||
|
export function getAssetAccreditByDataAssetId(id) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/assetAccredit/GetAssetAccreditByDataAssetId?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function addAssetAccredit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/assetAccredit',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function deleteAssetAccreditByAssetIds(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/assetAccredit/DeleteAssetAccreditByAssetIds',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,16 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
export function getAssetsModelListByTableIds(ids) {
|
|
||||||
return request({
|
|
||||||
url: '/dataSource/assets/getAssetsModelList',
|
|
||||||
method: 'post',
|
|
||||||
data: ids
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getAssetsModelByDataTableId(id) {
|
|
||||||
return request({
|
|
||||||
url: '/dataSource/assets/getAssetsModelByDataTableId?id='+id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/data/insert',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改【请填写功能名称】
|
||||||
|
export function updateData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/data/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,24 +1,28 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getDictionaryRespByDataSourceId(id) {
|
|
||||||
|
|
||||||
|
// 根据key删除字典详细
|
||||||
|
export function deleteDictionary(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/dict/getDictionaryByDataSourceId?dataSourceId='+id,
|
url: '/dataSource/dictionary/DeleteDictionary?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function insertDictionary(dictionary) {
|
// 新增【请填写功能名称】
|
||||||
|
export function addDictionary(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/dict/insertDictionary',
|
url: '/dataSource/dictionary',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dictionary
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function insertDictionaryInfo(dictionaryInfo) {
|
|
||||||
|
export function getDictionaryList(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/dict/insertDictionarySelect',
|
url: '/dataSource/dictionary/GetDictionaryList?dataSourceId=' + id,
|
||||||
method: 'post',
|
method: 'get'
|
||||||
data: dictionaryInfo
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,63 +1,109 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getDataSourceList(dataSourceQueryReq) {
|
// 查询【请填写功能名称】列表
|
||||||
|
export function listSource(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/getDataSourceList',
|
url: '/dataSource/source/list',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dataSourceQueryReq
|
data: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllDataType() {
|
export function statisticsInfo(){
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/dataType/getAllDataType',
|
url: '/dataSource/source/Statistics',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function editDataSource(dataSource) {
|
export function dataAssetList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/editDataSource',
|
url: '/dataSource/source/DataAssetList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dataSource
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function dataSynchronization(dataSourceResp) {
|
export function assetModelList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/dataSynchronization',
|
url: '/dataSource/source/AssetModelList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dataSourceResp
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function testConnect(dataSourceResp) {
|
export function assetsList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/testConnect',
|
url: '/dataSource/source/AssetsList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dataSourceResp
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function queryStructure(dataSourceResp) {
|
export function synchronousData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/queryStructure',
|
url: '/dataSource/source/SynchronousData',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dataSourceResp
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function queryBigStructure() {
|
export function structureList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/queryBigStructure',
|
url: '/dataSource/source/StructureList',
|
||||||
method: 'post'
|
method: 'post',
|
||||||
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function queryTableStructure(tableStructureQueryReq) {
|
// 查询【请填写功能名称】详细
|
||||||
|
export function getSource(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/queryTableStructure',
|
url: '/dataSource/source/' + id,
|
||||||
method: 'post',
|
method: 'get'
|
||||||
data: tableStructureQueryReq
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function addSource(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/source',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 测试连接
|
||||||
|
export function testConnection(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/source/TestConnection',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改【请填写功能名称】
|
||||||
|
export function updateSource(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/source/handleDelete/id',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改字段数据
|
||||||
|
export function updateAssetModel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/model/UpdateAssetModel',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除【请填写功能名称】
|
||||||
|
export function delSource(id) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/source/handleDelete' + id,
|
||||||
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 根据数据源id查询授权信息
|
||||||
|
export function getSourceAccreditByDataSourceId(id) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/sourceAccredit/GetSourceAccreditByDataSourceId?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function addSourceAccredit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/sourceAccredit/insertSourceAccredit',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function deleteSourceAccreditBySourceIds(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/sourceAccredit/DeleteSourceAccreditBySourceIds',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
|
@ -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="title.dataSourceName" 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="title.systemName" 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="title.databaseName" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -44,6 +44,7 @@
|
||||||
<el-switch
|
<el-switch
|
||||||
style="display: block"
|
style="display: block"
|
||||||
v-model="scope.row.isAuth"
|
v-model="scope.row.isAuth"
|
||||||
|
@change="authChange(scope.row)"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
|
@ -52,7 +53,6 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="用户授权" name="user">
|
<el-tab-pane label="用户授权" name="user">
|
||||||
<el-table ref="table" v-loading="loading" :data="userList">
|
<el-table ref="table" v-loading="loading" :data="userList">
|
||||||
|
@ -67,6 +67,7 @@
|
||||||
<el-switch
|
<el-switch
|
||||||
style="display: block"
|
style="display: block"
|
||||||
v-model="scope.row.isAuth"
|
v-model="scope.row.isAuth"
|
||||||
|
@change="authChange(scope.row)"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
|
@ -75,7 +76,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
<pagination v-show="userQueryParams.total> 0" :limit.sync="userQueryParams.pageSize" :page.sync="userQueryParams.pageNum" :total="userQueryParams.total"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
@ -84,262 +85,144 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { parseTime } from '@/utils/muyu'
|
import { parseTime } from '@/utils/muyu'
|
||||||
|
import {listDept} from "@/api/system/dept";
|
||||||
|
import {listUser} from "@/api/system/user";
|
||||||
|
import {
|
||||||
|
addAccredit,
|
||||||
|
addSourceAccredit,
|
||||||
|
deleteSourceAccreditBySourceIds,
|
||||||
|
getSourceAccreditByDataSourceId
|
||||||
|
} from "@/api/dataSource/sourceAccredit";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
watch:{
|
||||||
|
'title':{
|
||||||
|
handler(val) {
|
||||||
|
this.getSourceAccreditByDataSourceId()
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
title:{}
|
||||||
|
},
|
||||||
name: "AuthDataSource",
|
name: "AuthDataSource",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
activeName: "dept",
|
activeName: "dept",
|
||||||
// 分页信息
|
// 用户查询参数
|
||||||
total: 0,
|
userQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1,
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
|
sourceAccreditReq:{
|
||||||
|
deptIds: null,
|
||||||
|
userId: null,
|
||||||
|
dataSourceId: null
|
||||||
|
},
|
||||||
// 基本信息
|
// 基本信息
|
||||||
baseInfo: {
|
baseInfo: {
|
||||||
name: "测试1",
|
|
||||||
systemName: "云计算系统",
|
|
||||||
databaseName: "yunjisuan",
|
|
||||||
},
|
},
|
||||||
// 部门列表
|
// 部门列表
|
||||||
deptList: [],
|
deptList: [],
|
||||||
// 用户列表
|
// 用户列表
|
||||||
userList: []
|
userList: [],
|
||||||
|
userAccreditIds: [],
|
||||||
|
deptAccreditIds: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loading = true;
|
// this.loading = true;
|
||||||
setTimeout(() => this.loading = false, 200)
|
// setTimeout(() => this.loading = false, 200)
|
||||||
this.init()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
recursion(deptInfo){
|
||||||
|
let ids =[]
|
||||||
|
ids.push(deptInfo.deptId)
|
||||||
|
if (deptInfo.children){
|
||||||
|
deptInfo.children.forEach(item => {
|
||||||
|
ids.push(item.deptId)
|
||||||
|
if (item.children){
|
||||||
|
ids.push(...this.recursion(item))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return ids
|
||||||
|
},
|
||||||
|
authChange(row) {
|
||||||
|
this.loading = true
|
||||||
|
this.sourceAccreditReq={
|
||||||
|
deptIds:null,
|
||||||
|
userId: null,
|
||||||
|
dataSourceId: null
|
||||||
|
}
|
||||||
|
if (row.nickName){
|
||||||
|
this.sourceAccreditReq.userId = row.userId
|
||||||
|
this.sourceAccreditReq.dataSourceId = this.title.id
|
||||||
|
}else{
|
||||||
|
let ids=this.recursion(row)
|
||||||
|
const uniqueIds = [...new Set(ids)];
|
||||||
|
this.sourceAccreditReq.deptIds = uniqueIds
|
||||||
|
this.sourceAccreditReq.dataSourceId = this.title.id
|
||||||
|
}
|
||||||
|
if (row.isAuth){
|
||||||
|
addSourceAccredit(this.sourceAccreditReq).then(res => {
|
||||||
|
this.getSourceAccreditByDataSourceId()
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
deleteSourceAccreditBySourceIds(this.sourceAccreditReq).then(res => {
|
||||||
|
this.getSourceAccreditByDataSourceId()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
parseTime,
|
parseTime,
|
||||||
init(){
|
getSourceAccreditByDataSourceId(){
|
||||||
let response = {
|
if (this.title.id != undefined){
|
||||||
"code": 200,
|
getSourceAccreditByDataSourceId(this.title.id).then(response => {
|
||||||
"msg": "操作成功",
|
this.deptAccreditIds = response.data.deptAccreditModelIds
|
||||||
"data": [
|
this.userAccreditIds = response.data.userAccreditModelIds
|
||||||
{
|
setTimeout(() => this.getList(), 50)
|
||||||
"createBy": 1,
|
setTimeout(() => this.getUserList(), 50)
|
||||||
"createTime": "2023-09-29 11:47:27",
|
this.loading = false
|
||||||
"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": []
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
|
},
|
||||||
|
recursionAuth(deptInfo){
|
||||||
|
deptInfo.isAuth = this.deptAccreditIds.indexOf(deptInfo.deptId) > -1
|
||||||
|
if (deptInfo.children){
|
||||||
|
deptInfo.children.forEach(item => {
|
||||||
|
item.isAuth = this.deptAccreditIds.indexOf(item.deptId) > -1
|
||||||
|
if (item.children){
|
||||||
|
this.recursionAuth(item)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询部门列表 */
|
||||||
|
getList() {
|
||||||
|
listDept(this.queryParams).then(response => {
|
||||||
this.deptList = this.handleTree(response.data, "deptId");
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
this.userList = [
|
this.deptList.forEach(dept => {
|
||||||
{
|
// dept.isAuth = this.deptAccreditIds.indexOf(dept.deptId) > -1
|
||||||
"createBy": "admin",
|
this.recursionAuth(dept)
|
||||||
"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",
|
getUserList() {
|
||||||
"createTime": "2023-04-23 16:11:38",
|
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||||
"updateBy": null,
|
this.userList = response.data.rows;
|
||||||
"updateTime": null,
|
this.userList.forEach(user => {
|
||||||
"remark": "测试员",
|
user.isAuth = this.userAccreditIds.indexOf(user.userId) > -1
|
||||||
"userId": 2,
|
})
|
||||||
"deptId": 105,
|
this.userQueryParams.total = response.data.total;
|
||||||
"userName": "ry",
|
|
||||||
"nickName": "数据处理",
|
|
||||||
"email": "ry@qq.com",
|
|
||||||
"phonenumber": "15666666666",
|
|
||||||
"dept": {
|
|
||||||
"deptName": "测试部门"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<h4 class="form-header h4">基本信息</h4>
|
<h4 class="form-header h4">基本信息</h4>
|
||||||
<el-form ref="form" :model="baseInfo" label-width="120px">
|
<el-form ref="form" :model="title" 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="nickName">
|
||||||
<el-input v-model="baseInfo.name" disabled/>
|
<el-input v-model="title.dataSourceName" 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="title.systemName" 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="title.databaseName" 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="title.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="title.tableComment" 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="title.tableCount" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -39,7 +39,6 @@
|
||||||
<el-tabs type="border-card" v-model="activeName">
|
<el-tabs type="border-card" v-model="activeName">
|
||||||
<el-tab-pane label="部门授权" name="dept">
|
<el-tab-pane label="部门授权" name="dept">
|
||||||
<el-table
|
<el-table
|
||||||
ref="deptTable"
|
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="deptList"
|
:data="deptList"
|
||||||
:default-expand-all="true"
|
:default-expand-all="true"
|
||||||
|
@ -47,18 +46,20 @@
|
||||||
row-key="deptId"
|
row-key="deptId"
|
||||||
>
|
>
|
||||||
<el-table-column label="部门名称" prop="deptName" ></el-table-column>
|
<el-table-column label="部门名称" prop="deptName" ></el-table-column>
|
||||||
<el-table-column label="部门负责人" prop="leader" ></el-table-column>
|
<el-table-column label="排序" prop="orderNum" ></el-table-column>
|
||||||
|
<el-table-column label="负责人" prop="leader" ></el-table-column>
|
||||||
<el-table-column label="邮箱" prop="email" ></el-table-column>
|
<el-table-column label="邮箱" prop="email" ></el-table-column>
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" >
|
<el-table-column align="center" label="创建时间" prop="createTime" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" prop="createTime" >
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||||
<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.isAuth"
|
||||||
|
@change="authChange(scope.row)"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
|
@ -67,7 +68,6 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="用户授权" name="user">
|
<el-tab-pane label="用户授权" name="user">
|
||||||
<el-table ref="table" v-loading="loading" :data="userList">
|
<el-table ref="table" v-loading="loading" :data="userList">
|
||||||
|
@ -82,6 +82,7 @@
|
||||||
<el-switch
|
<el-switch
|
||||||
style="display: block"
|
style="display: block"
|
||||||
v-model="scope.row.isAuth"
|
v-model="scope.row.isAuth"
|
||||||
|
@change="authChange(scope.row)"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
|
@ -90,7 +91,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
<pagination v-show="userQueryParams.total> 0" :limit.sync="userQueryParams.pageSize" :page.sync="userQueryParams.pageNum" :total="userQueryParams.total"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
@ -99,265 +100,137 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { parseTime } from '@/utils/muyu'
|
import { parseTime } from '@/utils/muyu'
|
||||||
|
import {listDept} from "@/api/system/dept";
|
||||||
|
import {listUser} from "@/api/system/user";
|
||||||
|
import {addAccredit, deleteSourceAccreditBySourceIds, getSourceAccreditByDataSourceId} from "@/api/dataSource/sourceAccredit";
|
||||||
|
import {addAssetAccredit, deleteAssetAccreditByAssetIds, getAssetAccreditByDataAssetId} from "@/api/dataSource/assetAccredit";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
watch:{
|
||||||
|
'title':{
|
||||||
|
handler(val) {
|
||||||
|
this.getAssetAccreditByDataAssetId()
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
title:{}
|
||||||
|
},
|
||||||
name: "AuthTable",
|
name: "AuthTable",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
refreshTable: true,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
activeName: "dept",
|
activeName: "dept",
|
||||||
// 分页信息
|
// 分页信息
|
||||||
total: 0,
|
// 用户查询参数
|
||||||
|
userQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1,
|
pageSize: 10,
|
||||||
// 基本信息
|
total: 0
|
||||||
baseInfo: {
|
|
||||||
name: "测试1",
|
|
||||||
systemName: "云计算系统",
|
|
||||||
databaseName: "yunjisuan",
|
|
||||||
tableName: "sys_user",
|
|
||||||
tableAsName: "用户表",
|
|
||||||
total: "12546条",
|
|
||||||
},
|
},
|
||||||
// 部门列表
|
// 部门列表
|
||||||
deptList: [],
|
deptList: [],
|
||||||
// 用户列表
|
// 用户列表
|
||||||
userList: []
|
userList: [],
|
||||||
|
deptAccreditIds:[],
|
||||||
|
userAccreditIds:[],
|
||||||
|
AssetAccreditReq:{
|
||||||
|
deptIds: null,
|
||||||
|
userId: null,
|
||||||
|
dataAssetId: null
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loading = true;
|
|
||||||
setTimeout(() => this.loading = false, 200)
|
|
||||||
this.init()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
parseTime,
|
recursion(deptInfo){
|
||||||
init(){
|
let ids =[]
|
||||||
let response = {
|
ids.push(deptInfo.deptId)
|
||||||
"code": 200,
|
if (deptInfo.children){
|
||||||
"msg": "操作成功",
|
deptInfo.children.forEach(item => {
|
||||||
"data": [
|
ids.push(item.deptId)
|
||||||
{
|
if (item.children){
|
||||||
"createBy": 1,
|
ids.push(...this.recursion(item))
|
||||||
"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": []
|
|
||||||
}
|
}
|
||||||
]
|
})
|
||||||
}
|
}
|
||||||
|
return ids
|
||||||
|
},
|
||||||
|
authChange(row) {
|
||||||
|
this.loading = true
|
||||||
|
this.AssetAccreditReq={
|
||||||
|
deptIds:null,
|
||||||
|
userId: null,
|
||||||
|
dataAssetId: null
|
||||||
|
}
|
||||||
|
if (row.nickName){
|
||||||
|
this.AssetAccreditReq.userId = row.userId
|
||||||
|
this.AssetAccreditReq.dataAssetId = this.title.id
|
||||||
|
}else{
|
||||||
|
let ids=this.recursion(row)
|
||||||
|
const uniqueIds = [...new Set(ids)];
|
||||||
|
this.AssetAccreditReq.deptIds = uniqueIds
|
||||||
|
this.AssetAccreditReq.dataAssetId = this.title.id
|
||||||
|
}
|
||||||
|
if (row.isAuth){
|
||||||
|
addAssetAccredit(this.AssetAccreditReq).then(res => {
|
||||||
|
this.getAssetAccreditByDataAssetId()
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
deleteAssetAccreditByAssetIds(this.AssetAccreditReq).then(res => {
|
||||||
|
this.getAssetAccreditByDataAssetId()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
recursionAuth(deptInfo){
|
||||||
|
deptInfo.isAuth = this.deptAccreditIds.indexOf(deptInfo.deptId) > -1
|
||||||
|
if (deptInfo.children){
|
||||||
|
deptInfo.children.forEach(item => {
|
||||||
|
item.isAuth = this.deptAccreditIds.indexOf(item.deptId) > -1
|
||||||
|
if (item.children){
|
||||||
|
this.recursionAuth(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getAssetAccreditByDataAssetId() {
|
||||||
|
if (this.title.id != undefined) {
|
||||||
|
getAssetAccreditByDataAssetId(this.title.id).then(response => {
|
||||||
|
this.deptAccreditIds = response.data.deptAccreditModelIds
|
||||||
|
this.userAccreditIds = response.data.userAccreditModelIds
|
||||||
|
setTimeout(() => this.getList(), 50)
|
||||||
|
setTimeout(() => this.getUserList(), 50)
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询部门列表 */
|
||||||
|
getList() {
|
||||||
|
listDept(this.queryParams).then(response => {
|
||||||
this.deptList = this.handleTree(response.data, "deptId");
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
this.userList = [
|
this.deptList.forEach(dept => {
|
||||||
{
|
this.recursionAuth(dept)
|
||||||
"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",
|
getUserList() {
|
||||||
"createTime": "2023-04-23 16:11:38",
|
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||||
"updateBy": null,
|
this.userList = response.data.rows;
|
||||||
"updateTime": null,
|
this.userList.forEach(user => {
|
||||||
"remark": "测试员",
|
user.isAuth = this.userAccreditIds.indexOf(user.userId) > -1
|
||||||
"userId": 2,
|
})
|
||||||
"deptId": 105,
|
this.userQueryParams.total = response.data.total;
|
||||||
"userName": "ry",
|
|
||||||
"nickName": "数据处理",
|
|
||||||
"email": "ry@qq.com",
|
|
||||||
"phonenumber": "15666666666",
|
|
||||||
"dept": {
|
|
||||||
"deptName": "测试部门"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
parseTime,
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,22 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container :style="{height: mainHeight + 'px'}">
|
<el-container :style="{height: mainHeight + 'px'}">
|
||||||
<el-aside>
|
<el-aside>
|
||||||
<el-tree :data="assetStructureList"
|
<el-menu :default-openeds="['1', '3']">
|
||||||
:load="expandTable"
|
<el-tree :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||||
:expand-on-click-node="false"
|
</el-menu>
|
||||||
lazy
|
|
||||||
@node-click="(data) => showAuth=data.type"
|
|
||||||
:props="defaultProps">
|
|
||||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
|
||||||
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
|
||||||
<div v-if="data.type === 'dataTable'">{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}</div>
|
|
||||||
</div>
|
|
||||||
</el-tree>
|
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-main>
|
<el-main>
|
||||||
<auth-data-source v-if="showAuth === 'dataSource'"/>
|
<auth-data-source v-if="showAuth === 'dataSource'" :title="title"/>
|
||||||
<auth-table v-else-if="showAuth === 'dataTable'"/>
|
<auth-table v-else-if="showAuth === 'dataTable'" :title="title"/>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
@ -25,70 +17,58 @@
|
||||||
|
|
||||||
import AuthDataSource from './auth/AuthDataSource.vue'
|
import AuthDataSource from './auth/AuthDataSource.vue'
|
||||||
import AuthTable from './auth/AuthTable.vue'
|
import AuthTable from './auth/AuthTable.vue'
|
||||||
|
import {dataAssetList, listSource} from "@/api/dataSource/source";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'assetStructure',
|
name: 'assetStructure',
|
||||||
components: { AuthTable, AuthDataSource },
|
components: { AuthTable, AuthDataSource },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
req:{
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
dataSourceName: null,
|
||||||
|
linkAddress: null
|
||||||
|
},
|
||||||
|
title: {},
|
||||||
|
sourceList: [],
|
||||||
mainHeight: window.innerHeight - 85,
|
mainHeight: window.innerHeight - 85,
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'childrenList',
|
children: 'tableList',
|
||||||
label: 'name'
|
label: 'label'
|
||||||
},
|
},
|
||||||
showAuth: null,
|
showAuth: null
|
||||||
assetStructureList: [
|
|
||||||
{
|
|
||||||
name: "测试1",
|
|
||||||
systemName: "云计算系统",
|
|
||||||
databaseName: "yunjisuan",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试2",
|
|
||||||
systemName: "网站系统",
|
|
||||||
databaseName: "wangzhan",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试3",
|
|
||||||
systemName: "物联网系统",
|
|
||||||
databaseName: "wulianwang",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试4",
|
|
||||||
systemName: "传媒系统",
|
|
||||||
databaseName: "chuanmei",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
],
|
|
||||||
childrenList: [
|
|
||||||
{
|
|
||||||
name: "sys_user",
|
|
||||||
as: "用户表",
|
|
||||||
dataTotal: 635847,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "sys_dept",
|
|
||||||
as: "部门表",
|
|
||||||
dataTotal: 362548,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "sys_notice",
|
|
||||||
as: "通知公告",
|
|
||||||
dataTotal: 6347,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleNodeClick(data) {
|
||||||
|
if (data.dataType === 'dataSource'){
|
||||||
|
dataAssetList(data).then(res => {
|
||||||
|
res.data.forEach(table => {
|
||||||
|
table.dataType = "dataTable"
|
||||||
|
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)"
|
||||||
|
})
|
||||||
|
data.tableList = res.data
|
||||||
|
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||||
|
this.title = data
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.sourceList.forEach(source => {
|
||||||
|
if (source.tableList!=null){
|
||||||
|
source.tableList.forEach(table => {
|
||||||
|
if (table.tableName === data.tableName){
|
||||||
|
data.dataSourceName = source.dataSourceName
|
||||||
|
data.systemName = source.systemName
|
||||||
|
data.databaseName = source.databaseName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.title= data
|
||||||
|
}
|
||||||
|
this.showAuth = data.dataType
|
||||||
|
},
|
||||||
expandTable( node, resolve){
|
expandTable( node, resolve){
|
||||||
if (node.level === 0) return resolve(this.assetStructureList);
|
if (node.level === 0) return resolve(this.assetStructureList);
|
||||||
const {data} = node;
|
const {data} = node;
|
||||||
|
@ -98,8 +78,32 @@ export default {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
resolve(this.childrenList)
|
resolve(this.childrenList)
|
||||||
}, 500);
|
}, 500);
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.assetsCompute={
|
||||||
|
assetsModuleSum: 0,
|
||||||
|
dataModuleSum: 0,
|
||||||
|
dataSourceSum: 0
|
||||||
}
|
}
|
||||||
|
listSource(this.req).then(response => {
|
||||||
|
this.sourceList = response.data.rows;
|
||||||
|
this.sourceList.forEach(source => {
|
||||||
|
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||||
|
source.dataType = 'dataSource'
|
||||||
|
if (source.tableList!=null){
|
||||||
|
source.tableList.forEach(table => {
|
||||||
|
table.label = table.tableName+'-'+table.tableComment+'('+table.tableCount+'条)'
|
||||||
|
table.dataType = 'dataTable'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
this.total = response.data.total;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
@ -1,50 +1,52 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container :style="{height: mainHeight + 'px'}">
|
<el-container :style="{height: mainHeight + 'px'}">
|
||||||
<el-aside>
|
<el-aside>
|
||||||
<el-tree :data="assetStructureList"
|
<el-tree style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||||
:load="expandTable"
|
|
||||||
:expand-on-click-node="false"
|
|
||||||
lazy
|
|
||||||
@node-click="(data) => showAuth=data.type"
|
|
||||||
:props="defaultProps">
|
|
||||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
|
||||||
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
|
||||||
<div v-if="data.type === 'dataTable'">{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}</div>
|
|
||||||
</div>
|
|
||||||
</el-tree>
|
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-card>
|
<data-source-show v-if="showAssets === 'dataSource'" :source="source"></data-source-show>
|
||||||
<div slot="header" class="clearfix">
|
<data-asset-show v-if="showAssets === 'dataTable'" :asset="asset" :source="source"></data-asset-show>
|
||||||
<span>资产模型基本信息</span>
|
<!-- <el-card>-->
|
||||||
</div>
|
<!-- <div slot="header" class="clearfix">-->
|
||||||
<el-descriptions border :column="2">
|
<!-- <span>资产模型基本信息</span>-->
|
||||||
<el-descriptions-item label="表名称">sys_user</el-descriptions-item>
|
<!-- </div>-->
|
||||||
<el-descriptions-item label="表备注">用户表</el-descriptions-item>
|
<!-- <el-descriptions border :column="2">-->
|
||||||
<el-descriptions-item label="数据量">12536</el-descriptions-item>
|
<!-- <el-descriptions-item label="表名称">{{asset.tableName}}</el-descriptions-item>-->
|
||||||
<el-descriptions-item label="是否核心">
|
<!-- <el-descriptions-item label="表备注">{{asset.tableComment}}</el-descriptions-item>-->
|
||||||
<el-tag size="small">是</el-tag>
|
<!-- <el-descriptions-item label="数据量">{{asset.tableCount}}</el-descriptions-item>-->
|
||||||
</el-descriptions-item>
|
<!-- <el-descriptions-item label="是否核心">-->
|
||||||
</el-descriptions>
|
<!-- <el-tag size="small">是</el-tag>-->
|
||||||
</el-card>
|
<!-- </el-descriptions-item>-->
|
||||||
|
<!-- </el-descriptions>-->
|
||||||
|
<!-- </el-card>-->
|
||||||
|
|
||||||
<el-card class="box-card" style="margin-top: 20px">
|
<!-- <el-card class="box-card" style="margin-top: 20px">-->
|
||||||
<div slot="header" class="clearfix">
|
<!-- <div slot="header" class="clearfix">-->
|
||||||
<span>模型数据</span>
|
<!-- <span>模型数据</span>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<el-row :gutter="20">
|
<!-- <el-row v-if="kvtList.length > 0" :gutter="20">-->
|
||||||
<el-col :span="6" v-for="asset in assetShowList" style="margin-top: 20px">
|
<!-- <el-col :span="6" v-for="(kvt,index) in kvtList[0]" style="margin-top: 20px">-->
|
||||||
<el-descriptions :title="asset.key" direction="vertical" border :column="1">
|
<!-- <el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">-->
|
||||||
<el-descriptions-item label="Type">
|
<!-- <el-descriptions-item label="Type">-->
|
||||||
<el-tag size="small">{{asset.type}}</el-tag>
|
<!-- <el-tag size="small">{{kvt.type}}</el-tag>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item label="Value">{{asset.value}}</el-descriptions-item>
|
<!-- <el-descriptions-item label="Value">{{kvt.value=='' ? 'null':kvt.value}}</el-descriptions-item>-->
|
||||||
</el-descriptions>
|
<!-- </el-descriptions>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
</el-row>
|
<!-- </el-row>-->
|
||||||
|
<!-- <el-row v-if="kvtList.length == 0" :gutter="20">-->
|
||||||
|
<!-- <el-col :span="6" v-for="(value,index) in structure" style="margin-top: 20px">-->
|
||||||
|
<!-- <el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">-->
|
||||||
|
<!-- <el-descriptions-item label="Type">-->
|
||||||
|
<!-- <el-tag size="small">{{value}}</el-tag>-->
|
||||||
|
<!-- </el-descriptions-item>-->
|
||||||
|
<!-- <el-descriptions-item label="Value">null</el-descriptions-item>-->
|
||||||
|
<!-- </el-descriptions>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- </el-row>-->
|
||||||
|
|
||||||
</el-card>
|
<!-- </el-card>-->
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
@ -52,77 +54,101 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import {dataAssetList, listSource, structureList} from "@/api/dataSource/source";
|
||||||
|
import DataSourceShow from "@/views/dataSource/assetShow/modules/dataSourceShow.vue";
|
||||||
|
import DataAssetShow from "@/views/dataSource/assetShow/modules/dataAssetShow.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AssetShow",
|
name: "AssetShow",
|
||||||
|
components: {DataAssetShow, DataSourceShow},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showAssets: '',
|
||||||
|
source: {},
|
||||||
|
asset: {},
|
||||||
|
sourceList: [],
|
||||||
mainHeight: window.innerHeight - 85,
|
mainHeight: window.innerHeight - 85,
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'childrenList',
|
children: 'tableList',
|
||||||
label: 'name'
|
label: 'label'
|
||||||
},
|
},
|
||||||
showAuth: null,
|
showAuth: null,
|
||||||
assetStructureList: [
|
|
||||||
{
|
|
||||||
name: "测试1",
|
|
||||||
systemName: "云计算系统",
|
|
||||||
databaseName: "yunjisuan",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试2",
|
|
||||||
systemName: "网站系统",
|
|
||||||
databaseName: "wangzhan",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试3",
|
|
||||||
systemName: "物联网系统",
|
|
||||||
databaseName: "wulianwang",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试4",
|
|
||||||
systemName: "传媒系统",
|
|
||||||
databaseName: "chuanmei",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
],
|
|
||||||
childrenList: [
|
|
||||||
{
|
|
||||||
name: "sys_user",
|
|
||||||
as: "用户表",
|
|
||||||
dataTotal: 635847,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "sys_dept",
|
|
||||||
as: "部门表",
|
|
||||||
dataTotal: 362548,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "sys_notice",
|
|
||||||
as: "通知公告",
|
|
||||||
dataTotal: 6347,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
assetShowList: [
|
assetShowList: [
|
||||||
{key: "测试.sys_user.id", type: "String", value: 1},
|
{key: "测试.sys_user.id", type: "String", value: 1},
|
||||||
{key: "测试.sys_user.name", type: "String", value: "张三"},
|
{key: "测试.sys_user.name", type: "String", value: "张三"},
|
||||||
{key: "测试.sys_user.age", type: "Integer", value: 18},
|
{key: "测试.sys_user.age", type: "Integer", value: 18},
|
||||||
{key: "测试.sys_user.email", type: "String", value: "123@136.com"},
|
{key: "测试.sys_user.email", type: "String", value: "123@136.com"},
|
||||||
{key: "测试.sys_user.sex", type: "String", value: "Y"},
|
{key: "测试.sys_user.sex", type: "String", value: "Y"},
|
||||||
]
|
],
|
||||||
|
kvtList: [],
|
||||||
|
structure: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getList() {
|
||||||
|
listSource({}).then(response => {
|
||||||
|
this.sourceList = response.data.rows;
|
||||||
|
this.sourceList.forEach(source => {
|
||||||
|
if (source.type=='PostGreSql'){
|
||||||
|
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')'
|
||||||
|
}else{
|
||||||
|
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||||
|
}
|
||||||
|
|
||||||
|
source.dataType = 'dataSource'
|
||||||
|
if (source.tableList!=null){
|
||||||
|
source.tableList.forEach(table => {
|
||||||
|
table.label = table.tableName+'-'+table.tableComment+'('+table.tableCount+'条)'
|
||||||
|
table.dataType = 'dataTable'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// structureList(){
|
||||||
|
// structureList(this.source).then(res => {
|
||||||
|
// console.log(res)
|
||||||
|
// this.kvtList = res.data.kvtList
|
||||||
|
// this.structure = res.data.structure
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
handleNodeClick(data) {
|
||||||
|
if (data.dataType === 'dataSource'){
|
||||||
|
this.source = data
|
||||||
|
dataAssetList(data).then(res => {
|
||||||
|
res.data.forEach(table => {
|
||||||
|
table.dataType = "dataTable"
|
||||||
|
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)"
|
||||||
|
})
|
||||||
|
data.tableList = res.data
|
||||||
|
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||||
|
this.title = data
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.asset= data
|
||||||
|
this.sourceList.forEach(source => {
|
||||||
|
if (source.tableList!=null){
|
||||||
|
source.tableList.forEach(table => {
|
||||||
|
if (table.tableName === data.tableName){
|
||||||
|
this.source = source
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log(this.source)
|
||||||
|
// this.source.sql = 'select * from '+(data.modeName == null ? '' : data.modeName+'.')+data.tableName +' limit 1'
|
||||||
|
// setTimeout(() => {
|
||||||
|
// this.structureList()
|
||||||
|
// }, 50);
|
||||||
|
|
||||||
|
}
|
||||||
|
this.showAssets = data.dataType
|
||||||
|
},
|
||||||
expandTable( node, resolve){
|
expandTable( node, resolve){
|
||||||
if (node.level === 0) return resolve(this.assetStructureList);
|
if (node.level === 0) return resolve(this.assetStructureList);
|
||||||
const {data} = node;
|
const {data} = node;
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>资产模型基本信息</span>
|
||||||
|
</div>
|
||||||
|
<el-descriptions border :column="2">
|
||||||
|
<el-descriptions-item label="表名称">{{asset.tableName}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="表备注">{{asset.tableComment}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="数据量">{{asset.tableCount}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否核心">
|
||||||
|
<el-tag size="small">是</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card" style="margin-top: 20px">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>模型数据</span>
|
||||||
|
</div>
|
||||||
|
<el-row v-if="kvtList.length > 0" :gutter="20">
|
||||||
|
<el-col :span="6" v-for="(kvt,index) in kvtList[0]" style="margin-top: 20px">
|
||||||
|
<el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">
|
||||||
|
<el-descriptions-item label="Type">
|
||||||
|
<el-tag size="small">{{kvt.type}}</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Value">{{kvt.value=='' ? 'null':kvt.value}}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-if="kvtList.length == 0" :gutter="20">
|
||||||
|
<el-col :span="6" v-for="(value,index) in structure" style="margin-top: 20px">
|
||||||
|
<el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">
|
||||||
|
<el-descriptions-item label="Type">
|
||||||
|
<el-tag size="small">{{value}}</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Value">null</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {dataAssetList, listSource, structureList} from "@/api/dataSource/source";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
watch:{
|
||||||
|
'asset':{
|
||||||
|
handler(val){
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
|
'source':{
|
||||||
|
handler(val){
|
||||||
|
this.structureList()
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
asset:{},
|
||||||
|
source: {}
|
||||||
|
},
|
||||||
|
name: "dataAssetShow",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sourceList: [],
|
||||||
|
mainHeight: window.innerHeight - 85,
|
||||||
|
defaultProps: {
|
||||||
|
children: 'tableList',
|
||||||
|
label: 'label'
|
||||||
|
},
|
||||||
|
showAuth: null,
|
||||||
|
assetShowList: [
|
||||||
|
{key: "测试.sys_user.id", type: "String", value: 1},
|
||||||
|
{key: "测试.sys_user.name", type: "String", value: "张三"},
|
||||||
|
{key: "测试.sys_user.age", type: "Integer", value: 18},
|
||||||
|
{key: "测试.sys_user.email", type: "String", value: "123@136.com"},
|
||||||
|
{key: "测试.sys_user.sex", type: "String", value: "Y"},
|
||||||
|
],
|
||||||
|
kvtList: [],
|
||||||
|
structure: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
structureList(){
|
||||||
|
this.source.sql = 'select * from '+(this.source.modeName == null ? '' : this.source.modeName+'.')+this.asset.tableName +' limit 1'
|
||||||
|
structureList(this.source).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.kvtList = res.data.kvtList
|
||||||
|
this.structure = res.data.structure
|
||||||
|
})
|
||||||
|
},
|
||||||
|
expandTable( node, resolve){
|
||||||
|
if (node.level === 0) return resolve(this.assetStructureList);
|
||||||
|
const {data} = node;
|
||||||
|
if (data.type === 'dataTable') {
|
||||||
|
return resolve([])
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve(this.childrenList)
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,160 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-row :gutter="40" class="panel-group">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-tabs v-model="activeName" type="border-card">
|
||||||
|
<el-tab-pane v-for="tableAsset in source.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||||
|
<data-asset-show v-if="activeName == tableAsset.tableName" :asset="tableAsset" :source="source"/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import DataAssetShow from "./dataAssetShow.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
watch:{
|
||||||
|
'source':{
|
||||||
|
handler(val){
|
||||||
|
setTimeout(() => this.inio(), 200)
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
source:{}
|
||||||
|
},
|
||||||
|
name: "dataSourceShow",
|
||||||
|
components: {DataAssetShow},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
inio(){
|
||||||
|
this.activeName = this.source.tableList[0].tableName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.panel-group {
|
||||||
|
margin-top: 18px;
|
||||||
|
|
||||||
|
.card-panel-col {
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-panel {
|
||||||
|
height: 108px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #666;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
||||||
|
border-color: rgba(0, 0, 0, .05);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.card-panel-icon-wrapper {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-people {
|
||||||
|
background: #40c9c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-message {
|
||||||
|
background: #36a3f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-money {
|
||||||
|
background: #f4516c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-shopping {
|
||||||
|
background: #34bfa3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-people {
|
||||||
|
color: #40c9c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-message {
|
||||||
|
color: #36a3f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-money {
|
||||||
|
color: #f4516c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-shopping {
|
||||||
|
color: #34bfa3
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-panel-icon-wrapper {
|
||||||
|
float: left;
|
||||||
|
margin: 14px 0 0 14px;
|
||||||
|
padding: 16px;
|
||||||
|
transition: all 0.38s ease-out;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-panel-icon {
|
||||||
|
float: left;
|
||||||
|
font-size: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-panel-description {
|
||||||
|
float: right;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 26px;
|
||||||
|
margin-left: 0px;
|
||||||
|
|
||||||
|
.card-panel-text {
|
||||||
|
line-height: 18px;
|
||||||
|
color: rgba(0, 0, 0, 0.45);
|
||||||
|
font-size: 16px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-panel-num {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 550px) {
|
||||||
|
.card-panel-description {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-panel-icon-wrapper {
|
||||||
|
float: none !important;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 !important;
|
||||||
|
|
||||||
|
.svg-icon {
|
||||||
|
display: block;
|
||||||
|
margin: 14px auto !important;
|
||||||
|
float: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title-header{
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 46px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,13 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="tableParams != null">
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>资产模型基本信息</span>
|
<span>资产模型基本信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-descriptions border :column="2">
|
<el-descriptions border :column="2">
|
||||||
<el-descriptions-item label="表名称">{{tableParams.tableName}}</el-descriptions-item>
|
<el-descriptions-item label="表名称">{{title.tableName}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="表备注">{{tableParams.tableAsName}}</el-descriptions-item>
|
<el-descriptions-item label="表备注">{{title.tableComment}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="数据量">12536</el-descriptions-item>
|
<el-descriptions-item label="数据量">{{title.tableCount}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="是否核心">
|
<el-descriptions-item label="是否核心">
|
||||||
<el-tag size="small">是</el-tag>
|
<el-tag size="small">是</el-tag>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
@ -55,13 +55,9 @@
|
||||||
placement="left"
|
placement="left"
|
||||||
width="200"
|
width="200"
|
||||||
trigger="hover">
|
trigger="hover">
|
||||||
<el-table :data="[
|
<el-table :data="scope.row.dictionaryDatas">
|
||||||
{ label: '男', value: '1' },
|
|
||||||
{ label: '女', value: '2' },
|
|
||||||
{ label: '未知', value: '0' },
|
|
||||||
]">
|
|
||||||
<el-table-column property="label" label="字典标签"/>
|
<el-table-column property="label" label="字典标签"/>
|
||||||
<el-table-column property="value" label="字典值"/>
|
<el-table-column property="val" label="字典值"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
@ -150,13 +146,13 @@
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="字典">
|
<el-form-item label="字典">
|
||||||
<el-select v-model="form.dictKey">
|
<el-select v-model="form.dictKey">
|
||||||
<el-option v-for="(value, key) in dictMap" :key="key" :label="key" :value="key"></el-option>
|
<el-option v-for="dict in dictMap" :key="dict.id" :label="dict.dictionaryName+'('+dict.dictionaryKey+')'" :value="dict.dictionaryKey"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-table :data="dictMap[form.dictKey]" striped border>
|
<el-table :data="dictionaryDataList" striped border>
|
||||||
<el-table-column property="label" label="字典标签"/>
|
<el-table-column property="label" label="字典标签"/>
|
||||||
<el-table-column property="val" label="字典值"/>
|
<el-table-column property="val" label="字典值"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -166,120 +162,75 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="formStatus = false">取 消</el-button>
|
<el-button @click="formStatus = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="formStatus = false">确 定</el-button>
|
<el-button type="primary" @click="updDict()">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {assetModelList, updateAssetModel, updateSource} from "@/api/dataSource/source";
|
||||||
|
import {getDictionaryList} from "@/api/dataSource/dictionary";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'OverallAssetStructure',
|
name: 'OverallAssetStructure',
|
||||||
props: {
|
watch:{
|
||||||
tableParams: {
|
'title': {
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
tableParams: {
|
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val != null){
|
this.getDictionaryList()
|
||||||
this.init()
|
this.assetModelList()
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
|
'form.dictKey':{
|
||||||
|
handler(val) {
|
||||||
|
this.dictMap.forEach(dict => {
|
||||||
|
if (dict.dictionaryKey === val){
|
||||||
|
this.dictionaryDataList = dict.dictionaryDataList
|
||||||
|
this.form.dictionaryId = dict.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
props: {
|
||||||
immediate: true
|
title: {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [
|
dictionaryDataList:[],
|
||||||
{
|
form:{},
|
||||||
id: 1,
|
|
||||||
name: "id",
|
|
||||||
comment: "主键",
|
|
||||||
isPrimaryKey: "Y",
|
|
||||||
type: "bigint",
|
|
||||||
mappingType: "Long",
|
|
||||||
length: "-",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, {
|
|
||||||
id: 2,
|
|
||||||
name: "name",
|
|
||||||
comment: "姓名",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "varchar",
|
|
||||||
mappingType: "String",
|
|
||||||
length: "64",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, {
|
|
||||||
id: 3,
|
|
||||||
name: "sex",
|
|
||||||
comment: "性别",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "char",
|
|
||||||
mappingType: "String",
|
|
||||||
length: "1",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "Y",
|
|
||||||
dictKey: "system_sex",
|
|
||||||
}, {
|
|
||||||
id: 4,
|
|
||||||
name: "price",
|
|
||||||
comment: "金额",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "double",
|
|
||||||
mappingType: "BigDecimal",
|
|
||||||
length: "10",
|
|
||||||
decimalPlaces: "2",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "0.00",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, {
|
|
||||||
id: 5,
|
|
||||||
name: "create_time",
|
|
||||||
comment: "创建时间",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "datetime",
|
|
||||||
mappingType: "Date",
|
|
||||||
length: "-",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "Y",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, ],
|
|
||||||
form: {},
|
|
||||||
formStatus: false,
|
formStatus: false,
|
||||||
dictMap: {
|
tableData: [],
|
||||||
"system_sex": [
|
dictMap: {}
|
||||||
{ label: '男', val: '1', isEdit: false },
|
|
||||||
{ label: '女', val: '2', isEdit: false },
|
|
||||||
{ label: '未知', val: '0', isEdit: false },
|
|
||||||
],
|
|
||||||
"system_y_n": [
|
|
||||||
{ label: '是', val: '1', isEdit: false },
|
|
||||||
{ label: '否', val: '0', isEdit: false }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(){
|
assetModelList(){
|
||||||
console.log("查询")
|
assetModelList(this.title).then(res => {
|
||||||
|
this.tableData = res.data
|
||||||
|
this.formStatus = false
|
||||||
|
console.log(this.tableData)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
update(row) {
|
updDict(){
|
||||||
|
console.log(this.form)
|
||||||
|
updateAssetModel(this.form).then(res => {
|
||||||
|
this.assetModelList()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
getDictionaryList() {
|
||||||
|
getDictionaryList(this.title.dataSourceId).then(res => {
|
||||||
|
this.dictMap = res.data
|
||||||
|
console.log(this.dictMap)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async update(row) {
|
||||||
|
this.getDictionaryList()
|
||||||
this.form = row;
|
this.form = row;
|
||||||
this.formStatus = true;
|
this.formStatus = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
||||||
<div class="card-panel-icon-wrapper icon-people">
|
<div class="card-panel-icon-wrapper icon-people">
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="database"/>
|
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-panel-description">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
数据接入
|
数据接入
|
||||||
</div>
|
</div>
|
||||||
<count-to :duration="2600" :end-val="4" :start-val="0" class="card-panel-num"/>
|
<count-to :duration="2600" :end-val="statisticsInfo.dataAsset" :start-val="0" class="card-panel-num"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -25,20 +25,20 @@
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
资产模型
|
资产模型
|
||||||
</div>
|
</div>
|
||||||
<count-to :duration="3000" :end-val="96" :start-val="0" class="card-panel-num"/>
|
<count-to :duration="3000" :end-val="statisticsInfo.assetModel" :start-val="0" class="card-panel-num"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
||||||
<div class="card-panel-icon-wrapper icon-money">
|
<div class="card-panel-icon-wrapper icon-money">
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="field"/>
|
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-panel-description">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
数据模型
|
数据模型
|
||||||
</div>
|
</div>
|
||||||
<count-to :duration="3200" :end-val="560" :start-val="0" class="card-panel-num"/>
|
<count-to :duration="3200" :end-val="statisticsInfo.dataModel" :start-val="0" class="card-panel-num"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -47,15 +47,30 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CountTo from 'vue-count-to'
|
import CountTo from 'vue-count-to'
|
||||||
|
import {statisticsInfo} from "@/api/dataSource/source";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
CountTo
|
CountTo
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statisticsInfo: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.$emit('handleSetLineChartData', type)
|
this.$emit('handleSetLineChartData', type)
|
||||||
|
},
|
||||||
|
statistics(){
|
||||||
|
statisticsInfo().then(res => {
|
||||||
|
this.statisticsInfo = res.data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.statistics()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<el-row :gutter="40" class="panel-group">
|
<el-row :gutter="40" class="panel-group">
|
||||||
<div class="title-header">
|
<div class="title-header">
|
||||||
{{title}} - 资产结构概述
|
{{title.dataSourceName+'('+title.databaseName+'-'+title.systemName+')'}} - 资产结构概述
|
||||||
</div>
|
</div>
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
||||||
|
@ -12,20 +12,20 @@
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
资产模型
|
资产模型
|
||||||
</div>
|
</div>
|
||||||
<count-to :duration="3000" :end-val="15" :start-val="0" class="card-panel-num"/>
|
<count-to :duration="3000" :end-val="assetModel" :start-val="0" class="card-panel-num"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
||||||
<div class="card-panel-icon-wrapper icon-money">
|
<div class="card-panel-icon-wrapper icon-money">
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="field"/>
|
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-panel-description">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
数据模型
|
数据模型
|
||||||
</div>
|
</div>
|
||||||
<count-to :duration="3200" :end-val="230" :start-val="0" class="card-panel-num"/>
|
<count-to :duration="3200" :end-val="dataModel" :start-val="0" class="card-panel-num"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -43,54 +43,63 @@
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
width="400"
|
width="200px"
|
||||||
trigger="click">
|
trigger="click">
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="18">
|
<el-form :inline="true" :model="dictInfo" class="demo-form-inline">
|
||||||
<el-input v-model="dictAddName"></el-input>
|
<el-form-item label="字典名称:">
|
||||||
</el-col>
|
<el-input v-model="dictInfo.dictionaryName" style="width: 150px"></el-input>
|
||||||
<el-col :span="6">
|
</el-form-item>
|
||||||
|
<el-form-item label="字典Key:">
|
||||||
|
<el-input v-model="dictInfo.dictionaryKey" style="width: 150px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
<el-button @click="addDict">确定</el-button>
|
<el-button @click="addDict">确定</el-button>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-form>
|
||||||
|
|
||||||
<el-button style="float: right; padding: 3px 0" type="text" slot="reference">新增字典</el-button>
|
<el-button style="float: right; padding: 3px 0" type="text" slot="reference">新增字典</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
|
<el-col v-for="dict in dictMap" :md="8" :sm="24" :xs="12">
|
||||||
<el-card class="box-card" style="height: 300px">
|
<el-card class="box-card" style="height: 300px">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{key}}</span>
|
<span>{{dict.dictionaryName+'('+dict.dictionaryKey+')'}}</span>
|
||||||
<el-button style="float: right; padding: 3px 0"
|
<el-button style="float: right; padding: 3px 0"
|
||||||
type="text"
|
type="text"
|
||||||
@click="val.push({ label: null, val: null, isEdit: true })"
|
@click="deleteDictionary(dict.id)"
|
||||||
|
>删除</el-button>
|
||||||
|
<el-button style="float: right; padding: 3px 0;margin-right: 8px"
|
||||||
|
type="text"
|
||||||
|
@click="dict.dictionaryDataList.push({ label: null, val: null, edit: true })"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="val" style="width: 100%" height="280px">
|
<el-table :data="dict.dictionaryDataList" style="width: 100%" height="280px">
|
||||||
<el-table-column prop="label" label="标签">
|
<el-table-column prop="label" label="标签">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.label}}</span>
|
<span v-if="!scope.row.edit">{{scope.row.label}}</span>
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.label" size="mini"></el-input>
|
<el-input v-if="scope.row.edit" v-model="scope.row.label" size="mini"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="val" label="值">
|
<el-table-column prop="val" label="值">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.val}}</span>
|
<span v-if="!scope.row.edit">{{scope.row.val}}</span>
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.val" size="mini"></el-input>
|
<el-input v-if="scope.row.edit" v-model="scope.row.val" size="mini"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="val" label="操作">
|
<el-table-column prop="val" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!scope.row.isEdit"
|
v-if="!scope.row.edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="scope.row.isEdit = true"
|
@click="scope.row.edit = true"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.edit"
|
||||||
@click="editConfirm(scope.row)"
|
@click="editConfirm(dict,scope.row)"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-finished"
|
icon="el-icon-finished"
|
||||||
|
@ -104,11 +113,10 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" style="margin-top: 20px">
|
<el-col :span="24">
|
||||||
<el-tabs v-model="activeName" type="border-card" @tab-click="checkTableName">
|
<el-tabs v-model="activeName" type="border-card">
|
||||||
<el-tab-pane v-for="table in tableList" :label="table.tableName+'('+table.tableAsName+')'"
|
<el-tab-pane v-for="tableAsset in title.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||||
:name="table.tableName">
|
<overall-asset-structure ref="assetStru" v-if="activeName == tableAsset.tableName" :title="tableAsset"/>
|
||||||
<overall-asset-structure v-if="table.tableName === tableParams.tableName" :table-params="tableParams"/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -119,73 +127,111 @@
|
||||||
<script>
|
<script>
|
||||||
import CountTo from 'vue-count-to'
|
import CountTo from 'vue-count-to'
|
||||||
import OverallAssetStructure from './OverallAssetStructure.vue'
|
import OverallAssetStructure from './OverallAssetStructure.vue'
|
||||||
|
import {addDictionary, deleteDictionary, getDictionaryList} from "@/api/dataSource/dictionary";
|
||||||
|
import {addData, updateData} from "@/api/dataSource/data";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
watch:{
|
||||||
title: {
|
'title':{
|
||||||
type: String,
|
handler(val){
|
||||||
default: "-"
|
this.getDictionaryList()
|
||||||
|
this.activeName = val.tableList[0].tableName
|
||||||
|
this.assetModel = 0
|
||||||
|
this.dataModel = 0
|
||||||
|
val.tableList.forEach(table => {
|
||||||
|
if (table.tableCount!=null){
|
||||||
|
this.dataModel = parseInt(this.dataModel) + parseInt(table.tableCount);
|
||||||
}
|
}
|
||||||
|
if (table.fields!=null){
|
||||||
|
this.assetModel = parseInt(this.assetModel) + parseInt(table.fields);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title:{}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: null,
|
dictInfo: {
|
||||||
dictAddName: null,
|
dictionaryName: null,
|
||||||
dictMap: {
|
dictionaryKey: null,
|
||||||
"性别(system_sex)": [
|
dataSourceId: null
|
||||||
{ label: '男', val: '1', isEdit: false },
|
|
||||||
{ label: '女', val: '2', isEdit: false },
|
|
||||||
{ label: '未知', val: '0', isEdit: false },
|
|
||||||
],
|
|
||||||
"开关(system_y_n)": [
|
|
||||||
{ label: '是', val: '1', isEdit: false },
|
|
||||||
{ label: '否', val: '0', isEdit: false }
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
tableList: [],
|
dictMap: {},
|
||||||
tableParams: null
|
activeName: '',
|
||||||
|
assetModel: 0,
|
||||||
|
dataModel: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
OverallAssetStructure,
|
OverallAssetStructure,
|
||||||
CountTo
|
CountTo
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
checkTableName(checkTab){
|
deleteDictionary(id) {
|
||||||
this.tableParams = this.tableList.findLast(item => item.tableName === checkTab.name)
|
deleteDictionary(id).then(res => {
|
||||||
|
this.getDictionaryList()
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.assetStru.assetModelList()
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
init(){
|
getDictionaryList() {
|
||||||
let rows = [
|
getDictionaryList(this.title.id).then(res => {
|
||||||
{
|
this.dictMap = res.data
|
||||||
tableName: "sys_user",
|
})
|
||||||
tableAsName: "用户表"
|
|
||||||
},
|
},
|
||||||
{
|
editConfirm(dict,row){
|
||||||
tableName: "sys_dept",
|
|
||||||
tableAsName: "部门表"
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableList = rows;
|
|
||||||
this.activeName = rows[0].tableName;
|
|
||||||
this.tableParams = rows[0]
|
|
||||||
},
|
|
||||||
editConfirm(row){
|
|
||||||
if (!row.label || !row.val) {
|
if (!row.label || !row.val) {
|
||||||
this.$message.error('字典标签或字典值,不可为空');
|
this.$message.error('字典标签或字典值,不可为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.isEdit = false;
|
console.log(row)
|
||||||
|
if (row.id) {
|
||||||
|
console.log('修改')
|
||||||
|
updateData(row).then(res => {
|
||||||
|
row.edit = false;
|
||||||
|
this.getDictionaryList()
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.assetStru.assetModelList()
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
console.log('添加')
|
||||||
|
row.dictionaryId=dict.id
|
||||||
|
addData(row).then(res => {
|
||||||
|
row.edit = false;
|
||||||
|
this.getDictionaryList()
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.assetStru.assetModelList()
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
addDict(){
|
addDict(){
|
||||||
if (!this.dictAddName){
|
if (!this.dictInfo.dictionaryName){
|
||||||
this.$message.error('数据字典,不可为空');
|
this.$message.error('字典名称,不可为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.dictMap[this.dictAddName] = []
|
if (!this.dictInfo.dictionaryKey){
|
||||||
this.dictAddName = null
|
this.$message.error('字典Key,不可为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.dictInfo.dataSourceId = this.title.id
|
||||||
|
addDictionary(this.dictInfo).then(res => {
|
||||||
|
this.dictInfo = {
|
||||||
|
dictionaryName: null,
|
||||||
|
dictionaryKey: null,
|
||||||
|
dataSourceId: null
|
||||||
|
}
|
||||||
|
this.getDictionaryList()
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.$emit('handleSetLineChartData', type)
|
this.$emit('handleSetLineChartData', type)
|
||||||
|
|
|
@ -1,126 +1,178 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<el-container :style="{height: mainHeight + 'px'}">
|
<el-container :style="{height: mainHeight + 'px'}">
|
||||||
<el-aside>
|
<el-aside width="400px" style="background-color: rgb(238, 241, 246);height: 80%">
|
||||||
<el-tree :data="assetStructureList"
|
<el-tree style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||||
:expand-on-click-node="false"
|
|
||||||
:load="expandTable"
|
|
||||||
lazy
|
|
||||||
@node-click="showAssetsFun"
|
|
||||||
:props="defaultProps">
|
|
||||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
|
||||||
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
|
||||||
<div v-if="data.type === 'dataTable'">{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}</div>
|
|
||||||
</div>
|
|
||||||
</el-tree>
|
|
||||||
</el-aside>
|
</el-aside>
|
||||||
|
|
||||||
<el-container>
|
<el-container>
|
||||||
|
|
||||||
<el-main>
|
<el-main>
|
||||||
|
<el-tabs v-model="activeName">
|
||||||
|
<el-tab-pane label="资产结构" name="structure">
|
||||||
<OverallAssets v-if="showAssets == null"/>
|
<OverallAssets v-if="showAssets == null"/>
|
||||||
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"/>
|
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"/>
|
||||||
<overall-asset-structure v-if="showAssets === 'dataTable'" :table-params="tableParams" :title="title"/>
|
<overall-asset-structure v-if="showAssets === 'dataTable'" :title="title"/>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="资产数据" name="data">
|
||||||
|
<el-card style="height: 280px">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>查询语句</span>
|
||||||
|
</div>
|
||||||
|
<el-input type="textarea" v-model="source.sql" style="width: 1080px;" :rows="6"></el-input>
|
||||||
|
<el-button style="float: right;margin-top: 20px" @click="sql()">查询</el-button>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
<br>
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>数据资产</span>
|
||||||
|
</div>
|
||||||
|
<el-table :data="structureList" v-if="structureList!=null">
|
||||||
|
<el-table-column v-for="(assets,index) in assetsList" :label="index+' ('+assets+')'" width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row[index].value}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
|
<!-- <el-dialog title="数据结构" :visible.sync="dialogTableVisible">-->
|
||||||
|
<!-- <el-table :data="tableAssets">-->
|
||||||
|
<!-- <el-table-column property="field" label="字段名" width="150"></el-table-column>-->
|
||||||
|
<!-- <el-table-column property="type" label="类型" width="150"></el-table-column>-->
|
||||||
|
<!-- <el-table-column property="null" label="是否为空" width="150"></el-table-column>-->
|
||||||
|
<!-- <el-table-column property="key" label="键" width="150"></el-table-column>-->
|
||||||
|
<!-- <el-table-column property="default" label="默认值" width="150"></el-table-column>-->
|
||||||
|
<!-- </el-table>-->
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">-->
|
||||||
|
<!-- <el-button @click="dialogTableVisible = false">取 消</el-button>-->
|
||||||
|
<!-- <el-button type="primary" @click="dialogTableVisible = false">确 定</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </el-dialog>-->
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OverallAssets from './dashboard/OverallAssets.vue'
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
|
import {assetModelList, assetsList, dataAssetList, listSource, statisticsInfo, structureList} from "@/api/dataSource/source";
|
||||||
|
import OverallAssetStructure from "@/views/dataSource/assetStructure/dashboard/OverallAssetStructure.vue";
|
||||||
|
import OverallSpecificAssets from "@/views/dataSource/assetStructure/dashboard/OverallSpecificAssets.vue";
|
||||||
|
import OverallAssets from "@/views/dataSource/assetStructure/dashboard/OverallAssets.vue";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'assetStructure',
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
components: {OverallAssetStructure, OverallSpecificAssets, OverallAssets},
|
||||||
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mainHeight: window.innerHeight - 85,
|
mainHeight: window.innerHeight - 85,
|
||||||
defaultProps: {
|
assetsCompute:{
|
||||||
children: 'childrenList',
|
assetsModuleSum: 0,
|
||||||
label: 'name'
|
dataModuleSum: 0,
|
||||||
|
dataSourceSum: 0
|
||||||
},
|
},
|
||||||
assetStructureList: [
|
|
||||||
{
|
|
||||||
name: "测试1",
|
|
||||||
systemName: "云计算系统",
|
|
||||||
databaseName: "yunjisuan",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试2",
|
|
||||||
systemName: "网站系统",
|
|
||||||
databaseName: "wangzhan",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试3",
|
|
||||||
systemName: "物联网系统",
|
|
||||||
databaseName: "wulianwang",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试4",
|
|
||||||
systemName: "传媒系统",
|
|
||||||
databaseName: "chuanmei",
|
|
||||||
type: "dataSource"
|
|
||||||
},
|
|
||||||
],
|
|
||||||
childrenList: [
|
|
||||||
{
|
|
||||||
name: "sys_user",
|
|
||||||
as: "用户表",
|
|
||||||
dataTotal: 635847,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "sys_dept",
|
|
||||||
as: "部门表",
|
|
||||||
dataTotal: 362548,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "sys_notice",
|
|
||||||
as: "通知公告",
|
|
||||||
dataTotal: 6347,
|
|
||||||
type: "dataTable",
|
|
||||||
childrenList: []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
showAssets: null,
|
showAssets: null,
|
||||||
title: null,
|
title: {},
|
||||||
tableParams: null
|
activeName: 'structure',
|
||||||
}
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
dataSourceName: null,
|
||||||
|
linkAddress: null
|
||||||
},
|
},
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 【请填写功能名称】表格数据
|
||||||
|
sourceList: [],
|
||||||
|
assetsList:[],
|
||||||
|
structureList:[],
|
||||||
|
tableAssets:[],
|
||||||
|
defaultProps: {
|
||||||
|
children: 'tableList',
|
||||||
|
label: 'label'
|
||||||
|
},
|
||||||
|
sourceData:{},
|
||||||
|
source: {
|
||||||
|
sql: ''
|
||||||
|
},
|
||||||
|
statisticsInfo:{}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
methods: {
|
methods: {
|
||||||
expandTable( node, resolve){
|
test(data){
|
||||||
if (node.level === 0) return resolve(this.assetStructureList);
|
this.sourceData = data
|
||||||
const {data} = node;
|
|
||||||
this.showAssets = data.type;
|
|
||||||
if (data.type === 'dataTable') {
|
|
||||||
this.tableParams = {
|
|
||||||
tableName: data.name,
|
|
||||||
tableAsName: data.as
|
|
||||||
}
|
|
||||||
return resolve([])
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
resolve(this.childrenList)
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
showAssetsFun(data){
|
handleNodeClick(data) {
|
||||||
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
this.source = data
|
||||||
this.showAssets = data.type;
|
if (data.dataType === 'dataSource'){
|
||||||
if (data.type === "dataTable"){
|
dataAssetList(data).then(res => {
|
||||||
this.tableParams = {
|
res.data.forEach(table => {
|
||||||
tableName: data.name,
|
table.dataType = "dataTable"
|
||||||
tableAsName: data.as
|
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)"
|
||||||
|
})
|
||||||
|
data.tableList = res.data
|
||||||
|
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||||
|
this.title = data
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.title= data
|
||||||
}
|
}
|
||||||
|
this.showAssets = data.dataType
|
||||||
|
},
|
||||||
|
sql(){
|
||||||
|
structureList(this.source).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.structureList = res.data.kvtList
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
listSource({}).then(response => {
|
||||||
|
this.sourceList = response.data.rows;
|
||||||
|
this.sourceList.forEach(source => {
|
||||||
|
if (source.type=='PostGreSql'){
|
||||||
|
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')'
|
||||||
|
}else{
|
||||||
|
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
source.dataType = 'dataSource'
|
||||||
|
if (source.tableList!=null){
|
||||||
|
source.tableList.forEach(table => {
|
||||||
|
table.label = table.tableName+'-'+table.tableComment+'('+table.tableCount+'条)'
|
||||||
|
table.dataType = 'dataTable'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
this.total = response.data.total;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped>
|
||||||
.el-aside {
|
.el-aside {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -1,27 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 数据访问(数据接人)-->
|
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="接入源名称" prop="name">
|
<el-form-item label="数据源名称" prop="dataSourceName" label-width="100px">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.dataSourceName"
|
v-model="queryParams.dataSourceName"
|
||||||
placeholder="请输入接入源名称"
|
placeholder="请输入数据源名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据来源系统名称" prop="systemName">
|
<el-form-item label="数据源链接地址" prop="linkAddress" label-width="120px">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.systemName"
|
v-model="queryParams.linkAddress"
|
||||||
placeholder="请输入数据来源系统名称"
|
placeholder="请输入数据源链接地址"
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="数据库名称" prop="databaseName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.databaseName"
|
|
||||||
placeholder="请输入数据库名称"
|
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
|
@ -40,7 +31,7 @@
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:access:add']"
|
v-hasPermi="['system:source:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
|
@ -51,7 +42,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:access:remove']"
|
v-hasPermi="['system:source:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
|
@ -61,50 +52,50 @@
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['system:access:export']"
|
v-hasPermi="['system:source:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="accessList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="sourceList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="接入源名称" align="center" prop="dataSourceName" />
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<el-table-column label="数据来源系统名称" align="center" prop="systemName" />
|
<el-table-column label="数据源名称" align="center" prop="dataSourceName" />
|
||||||
<el-table-column label="主机地址" align="center" prop="linkAddress" />
|
<el-table-column label="数据源连接地址" align="center" prop="linkAddress" />
|
||||||
<el-table-column label="主机地址" align="center" prop="port" />
|
<el-table-column label="数据源连接端口" align="center" prop="port" />
|
||||||
<el-table-column label="数据接入类型" align="center" prop="type" />
|
|
||||||
<el-table-column label="数据库名称" align="center" prop="databaseName" />
|
<el-table-column label="数据库名称" align="center" prop="databaseName" />
|
||||||
|
<el-table-column label="连接用户名" align="center" prop="username" />
|
||||||
|
<el-table-column label="连接密码" align="center" prop="password" />
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="模式名称" align="center" prop="modeName" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-connection"
|
icon="el-icon-edit"
|
||||||
@click="syncAssetsStructure(scope.row)"
|
@click="testConnection(scope.row)"
|
||||||
v-hasPermi="['system:access:edit']"
|
>测试连接</el-button>
|
||||||
>同步资产结构</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-video-play"
|
icon="el-icon-edit"
|
||||||
@click="testConnection(scope.row)"
|
@click="synchronousData(scope.row)"
|
||||||
v-hasPermi="['system:access:edit']"
|
>同步资产</el-button>
|
||||||
>测试</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['system:access:edit']"
|
v-hasPermi="['system:source:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['system:access:remove']"
|
v-hasPermi="['system:source:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -118,8 +109,8 @@
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改数据接入对话框 -->
|
<!-- 添加或修改【请填写功能名称】对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="1150px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
|
@ -127,7 +118,7 @@
|
||||||
</div>
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="接入源名称" prop="name">
|
<el-form-item label="接入源名称" prop="dataSourceName">
|
||||||
<el-input v-model="form.dataSourceName" placeholder="请输入接入源名称" />
|
<el-input v-model="form.dataSourceName" placeholder="请输入接入源名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -139,7 +130,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="主机地址" prop="linkAddress">
|
<el-form-item label="主机IP" prop="linkAddress">
|
||||||
<el-input v-model="form.linkAddress" placeholder="请输入主机地址" />
|
<el-input v-model="form.linkAddress" placeholder="请输入主机地址" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -154,7 +145,7 @@
|
||||||
<el-form-item label="数据接入类型" prop="type">
|
<el-form-item label="数据接入类型" prop="type">
|
||||||
<el-select style="width: 100%" v-model="form.type">
|
<el-select style="width: 100%" v-model="form.type">
|
||||||
<el-option label="MySql" value="MySql">MySql</el-option>
|
<el-option label="MySql" value="MySql">MySql</el-option>
|
||||||
<el-option label="Oracle" value="Oracle">Oracle</el-option>
|
<el-option label="PostGreSql" value="PostGreSql">PostGreSql</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -164,15 +155,22 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row v-show="form.type === 'PostGreSql'">
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="模式名称" prop="modeName">
|
||||||
|
<el-input v-model="form.modeName" 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="username">
|
<el-form-item label="连接用户名" prop="username">
|
||||||
<el-input v-model="form.username" placeholder="请输入数据库用户" />
|
<el-input v-model="form.username" placeholder="请输入连接用户名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="数据库密码" prop="password">
|
<el-form-item label="连接密码" prop="password">
|
||||||
<el-input v-model="form.password" placeholder="请输入数据库密码" />
|
<el-input v-model="form.password" placeholder="请输入连接密码" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -250,21 +248,39 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="testConnection(null)">测 试</el-button>
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
import {dataSynchronization, editDataSource, getDataSourceList} from "@/api/dataSource/source";
|
listSource,
|
||||||
|
getSource,
|
||||||
|
delSource,
|
||||||
|
addSource,
|
||||||
|
updateSource,
|
||||||
|
testConnection,
|
||||||
|
synchronousData
|
||||||
|
} from "@/api/dataSource/source";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Access",
|
watch:{
|
||||||
|
'form.type':{
|
||||||
|
handler(val) {
|
||||||
|
if(val != 'PostGre'){
|
||||||
|
this.form.modeName = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
name: "Source",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
@ -279,8 +295,8 @@ export default {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 数据接入表格数据
|
// 数据源表格数据
|
||||||
accessList: [],
|
sourceList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
@ -289,9 +305,8 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
name: null,
|
dataSourceName: null,
|
||||||
systemName: null,
|
linkAddress: null
|
||||||
databaseName: null
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
@ -306,24 +321,15 @@ export default {
|
||||||
type: [
|
type: [
|
||||||
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
|
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
linkAddress: [
|
host: [
|
||||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
port: [
|
port: [
|
||||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
username: [
|
|
||||||
{required: true, message: "数据库用户不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
password: [
|
|
||||||
{required: true, message: "数据库密码不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
databaseName: [
|
databaseName: [
|
||||||
{required: true, message: "数据库名称不能为空", trigger: "blur"}
|
{required: true, message: "数据库名称不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
connectionParam: [
|
|
||||||
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
initNum: [
|
initNum: [
|
||||||
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
|
@ -337,26 +343,30 @@ export default {
|
||||||
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
|
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// 条件参数内容
|
|
||||||
dataSourceParamList: [
|
dataSourceParamList: [
|
||||||
{
|
{
|
||||||
name: null,
|
name: null,
|
||||||
val: null
|
val: null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncAssetsStructure(row){
|
synchronousData(data) {
|
||||||
dataSynchronization(row).then(res=>{
|
synchronousData(data).then(res => {
|
||||||
if (res.code == 200){
|
if (res.code === 200) {
|
||||||
this.$modal.msgSuccess("同步资产结构成功");
|
this.$message({
|
||||||
}else {
|
message: "同步成功",
|
||||||
this.$modal.msgError("同步资产结构失败");
|
type: "success"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: "同步失败",
|
||||||
|
type: "error"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -385,18 +395,31 @@ export default {
|
||||||
}).join("&")
|
}).join("&")
|
||||||
console.log(this.form.connectionParam)
|
console.log(this.form.connectionParam)
|
||||||
},
|
},
|
||||||
/** 查询数据接入列表 */
|
/** 测试连接 */
|
||||||
getList(){
|
testConnection(row) {
|
||||||
getDataSourceList(this.queryParams).then(res=>{
|
testConnection(row).then(res => {
|
||||||
this.loading = true;
|
if (res.code === 200) {
|
||||||
this.accessList= res.data.rows;
|
this.$message({
|
||||||
this.total=res.data.total;
|
message: "连接成功",
|
||||||
this.loading=false;
|
type: "success"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: "连接失败",
|
||||||
|
type: "error"
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/** 查询数据源列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listSource(this.queryParams).then(response => {
|
||||||
|
this.sourceList = response.data.rows;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
@ -406,19 +429,20 @@ export default {
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
name: null,
|
dataSourceName: null,
|
||||||
type: null,
|
type: null,
|
||||||
systemName: null,
|
systemName: null,
|
||||||
host: null,
|
|
||||||
port: null,
|
|
||||||
databaseName: null,
|
|
||||||
username: null,
|
username: null,
|
||||||
password: null,
|
password: null,
|
||||||
|
linkAddress: null,
|
||||||
|
port: null,
|
||||||
|
databaseName: null,
|
||||||
connectionParam: null,
|
connectionParam: null,
|
||||||
initNum: 5,
|
initNum: null,
|
||||||
maxNum: 20,
|
maxNum: null,
|
||||||
maxWaitTime: 3000,
|
maxWaitTime: null,
|
||||||
maxWaitSize: 3,
|
maxWaitSize: null,
|
||||||
|
modeName: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
|
@ -440,22 +464,24 @@ export default {
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map(item => item.id)
|
||||||
this.single = selection.length !== 1
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
this.dataSourceParamList = [];
|
||||||
this.title = "添加数据接入";
|
this.title = "添加数据接入";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
getSource(row.id).then(res => {
|
||||||
this.form = row;
|
console.log(res)
|
||||||
|
this.form = res.data;
|
||||||
|
console.log(this.form)
|
||||||
this.dataSourceParamList = [];
|
this.dataSourceParamList = [];
|
||||||
|
if (this.form.connectionParam){
|
||||||
this.form.connectionParam.split("&").forEach(param => {
|
this.form.connectionParam.split("&").forEach(param => {
|
||||||
let paramArr = param.split("=");
|
let paramArr = param.split("=");
|
||||||
this.dataSourceParamList.push({
|
this.dataSourceParamList.push({
|
||||||
|
@ -463,43 +489,47 @@ export default {
|
||||||
val: paramArr[1]
|
val: paramArr[1]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改数据接入";
|
this.title = "修改数据接入";
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
editDataSource(this.form).then(res=>{
|
if (this.form.id != null) {
|
||||||
this.$modal.msgSuccess("编辑成功");
|
updateSource(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList()
|
this.getList();
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
} else {
|
||||||
/** 测试连接 */
|
addSource(this.form).then(response => {
|
||||||
testConnection(row) {
|
this.$modal.msgSuccess("新增成功");
|
||||||
if (row){
|
this.open = false;
|
||||||
this.$modal.msgSuccess("测试连接成功");
|
this.getList();
|
||||||
}else {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.$modal.msgSuccess("测试连接成功");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除数据接入编号为"' + ids + '"的数据项?').then(() => {
|
this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delSource(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.$modal.msgSuccess("导出成功");
|
this.download('system/source/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `source_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -229,6 +229,7 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
dataSourceName:undefined,
|
||||||
tableName: undefined,
|
tableName: undefined,
|
||||||
tableComment: undefined
|
tableComment: undefined
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue