数据接入

master
rouchen 2024-04-22 13:58:20 +08:00
parent b40d3be7a1
commit 19db7eb300
9 changed files with 1514 additions and 1 deletions

View File

@ -61,3 +61,24 @@ export function dataTypeList() {
method: 'post'
})
}
export function selectName(name) {
return request({
url: '/kvt/kvt/selectName?name='+ name,
method: 'post'
})
}
export function AssetStructureList() {
return request({
url: '/kvt/kvt/AssetStructureList',
method: 'post'
})
}
export function synchronizationAdd(data) {
return request({
url: '/kvt/kvt/synchronizationAdd',
method: 'post',
data
})
}

View File

@ -0,0 +1,157 @@
<template>
<div>
<el-card>
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions border :column="2">
<el-descriptions-item label="表名称">sys_user</el-descriptions-item>
<el-descriptions-item label="表备注">用户表</el-descriptions-item>
<el-descriptions-item label="数据量">12536</el-descriptions-item>
<el-descriptions-item label="是否核心">
<el-tag size="small"></el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card style=" margin-top: 20px;">
<div slot="header" class="clearfix">
<span>资产模型详细信息</span>
</div>
<el-table
:data="tableData"
style="width: 100%;">
<el-table-column prop="name" label="名称" />
<el-table-column prop="comment" label="注释" />
<el-table-column prop="isPrimaryKey" label="是否主键" >
<template slot-scope="scope">
<el-tag size="small" :type="scope.row.isPrimaryKey === 'Y' ? 'success' : ''">
{{scope.row.isPrimaryKey}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="type" label="类型" />
<el-table-column prop="mappingType" label="映射类型" />
<el-table-column prop="length" label="长度" />
<el-table-column prop="decimalPlaces" label="小数位" />
<el-table-column prop="isNull" label="是否为空" >
<template slot-scope="scope">
<el-tag size="small" :type="scope.row.isNull === 'Y' ? 'success' : 'danger'">
{{scope.row.isNull}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="defaultValue" label="默认值" />
<el-table-column prop="isDict" label="是否字典" >
<template slot-scope="scope">
<el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success">
{{scope.row.isDict}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="dictKey" label="映射字典" >
<template slot-scope="scope">
<el-popover
v-if="scope.row.isDict === 'Y'"
placement="left"
width="200"
trigger="hover">
<el-table :data="[
{ label: '男', value: '1' },
{ label: '女', value: '2' },
{ label: '未知', value: '0' },
]">
<el-table-column property="label" label="字典标签"/>
<el-table-column property="value" label="字典值"/>
</el-table>
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="id" label="操作" >
<template slot-scope="scope">
<el-button type="text">编辑</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
export default {
name: 'OverallAssetStructure',
data() {
return {
tableData: [
{
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: "-",
}, ]
}
},
}
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,178 @@
<template>
<el-row :gutter="40" class="panel-group">
<div class="title-header">
整体数据资产结构概述
</div>
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
<div class="card-panel-icon-wrapper icon-people">
<svg-icon class-name="card-panel-icon" icon-class="database"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
数据接入
</div>
<count-to :duration="2600" :end-val="4" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon class-name="card-panel-icon" icon-class="table"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
资产模型
</div>
<count-to :duration="3000" :end-val="96" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon class-name="card-panel-icon" icon-class="field"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
数据模型
</div>
<count-to :duration="3200" :end-val="560" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
components: {
CountTo
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
}
}
}
</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>

View File

@ -0,0 +1,187 @@
<template>
<el-row :gutter="40" class="panel-group">
<div class="title-header">
{{title}} - 资产结构概述
</div>
<el-col :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon class-name="card-panel-icon" icon-class="table"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
资产模型
</div>
<count-to :duration="3000" :end-val="15" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon class-name="card-panel-icon" icon-class="field"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
数据模型
</div>
<count-to :duration="3200" :end-val="230" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :span="24">
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="sys_user(用户表)" name="first">
<overall-asset-structure/>
</el-tab-pane>
<el-tab-pane label="sys_dept(部门表)" name="second">sys_dept(部门表)</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
import OverallAssetStructure from './OverallAssetStructure.vue'
export default {
props: {
title: {
type: String,
default: "-"
}
},
data() {
return {
activeName: 'first',
}
},
components: {
OverallAssetStructure,
CountTo
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
}
}
}
</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>

View File

@ -0,0 +1,124 @@
<template>
<el-container :style="{height: mainHeight + 'px'}">
<el-aside>
<el-tree :data="assetStructureList"
:expand-on-click-node="false"
:load="expandTable"
lazy
@node-click="(data) => showAssets=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-container>
<el-main>
<OverallAssets v-if="showAssets == null"/>
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"/>
<overall-asset-structure v-if="showAssets === 'dataTable'" :title="title"/>
</el-main>
</el-container>
</el-container>
</template>
<script>
import OverallAssets from './dashboard/OverallAssets.vue'
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
export default {
name: 'assetStructure',
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
data() {
return {
mainHeight: window.innerHeight - 85,
defaultProps: {
children: 'childrenList',
label: 'name'
},
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,
title: null
}
},
methods: {
expandTable( node, resolve){
console.log(node)
console.log("resolve",resolve)
if (node.level === 0) return resolve(this.assetStructureList);
const {data} = node;
this.showAssets = data.type;
if (data.type === 'dataTable') {
return resolve([])
}
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
setTimeout(() => {
resolve(this.childrenList)
}, 500);
}
}
}
</script>
<style scoped lang="scss">
.el-aside {
margin: 0;
padding: 0;
width: 400px;
background-color: white;
}
.el-main {
background-color: #f1f1f1;
}
.custom-tree-node{
height: 30px;
}
</style>

View File

@ -0,0 +1,345 @@
<template>
<div class="app-container">
<h4 class="form-header h4">基本信息</h4>
<el-form ref="form" :model="baseInfo" label-width="120px">
<el-row>
<el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.name" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs type="border-card" v-model="activeName">
<el-tab-pane label="部门授权" name="dept">
<el-table
ref="deptTable"
v-loading="loading"
:data="deptList"
:default-expand-all="true"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="部门名称" prop="deptName" ></el-table-column>
<el-table-column label="部门负责人" prop="leader" ></el-table-column>
<el-table-column label="邮箱" prop="email" ></el-table-column>
<el-table-column align="center" label="创建时间" prop="createTime" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" prop="createTime" >
<template slot-scope="scope">
<el-switch
style="display: block"
v-model="scope.row.isAuth"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
<el-tab-pane label="用户授权" name="user">
<el-table ref="table" v-loading="loading" :data="userList">
<el-table-column align="center" label="用户名称" prop="userName"/>
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户部门" prop="dept.deptName"/>
<el-table-column align="center" label="用户邮箱" prop="email"/>
<el-table-column align="center" label="用户手机号" prop="phonenumber"/>
<el-table-column align="center" label="创建时间" prop="createTime" />
<el-table-column align="center" label="操作" prop="createTime" >
<template slot-scope="scope">
<el-switch
style="display: block"
v-model="scope.row.isAuth"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { parseTime } from '@/utils/muyu'
export default {
name: "AuthDataSource",
data() {
return {
//
loading: true,
activeName: "dept",
//
total: 0,
pageNum: 1,
pageSize: 1,
//
baseInfo: {
name: "测试1",
systemName: "云计算系统",
databaseName: "yunjisuan",
},
//
deptList: [],
//
userList: []
};
},
created() {
this.loading = true;
setTimeout(() => this.loading = false, 200)
this.init()
},
methods: {
parseTime,
init(){
let response = {
"code": 200,
"msg": "操作成功",
"data": [
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 100,
"parentId": 0,
"ancestors": "0",
"deptName": "muyu牧鱼科技",
"orderNum": 0,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 101,
"parentId": 100,
"ancestors": "0,100",
"deptName": "深圳总公司",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 102,
"parentId": 100,
"ancestors": "0,100",
"deptName": "长沙分公司",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 103,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "研发部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 104,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "市场部门",
"isAuth": true,
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 105,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "测试部门",
"orderNum": 3,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 106,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "财务部门",
"orderNum": 4,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 107,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "运维部门",
"orderNum": 5,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 108,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "市场部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 109,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "财务部门",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
}
]
}
this.deptList = this.handleTree(response.data, "deptId");
this.userList = [
{
"createBy": "admin",
"createTime": "2023-04-23 16:11:38",
"updateBy": null,
"updateTime": null,
"remark": "管理员",
"userId": 1,
"deptId": 103,
"userName": "admin",
"nickName": "智能车联",
"email": "ry@163.com",
"phonenumber": "15888888888",
"isAuth": true,
"dept": {
"deptName": "研发部门"
}
},
{
"createBy": "admin",
"createTime": "2023-04-23 16:11:38",
"updateBy": null,
"updateTime": null,
"remark": "测试员",
"userId": 2,
"deptId": 105,
"userName": "ry",
"nickName": "智能车联",
"email": "ry@qq.com",
"phonenumber": "15666666666",
"dept": {
"deptName": "测试部门"
}
}
]
}
},
};
</script>

View File

@ -0,0 +1,363 @@
<template>
<div class="app-container">
<h4 class="form-header h4">基本信息</h4>
<el-form ref="form" :model="baseInfo" label-width="120px">
<el-row>
<el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.name" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="表名称" prop="nickName">
<el-input v-model="baseInfo.tableName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="表中文名" prop="nickName">
<el-input v-model="baseInfo.tableAsName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据量" prop="nickName">
<el-input v-model="baseInfo.total" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs type="border-card" v-model="activeName">
<el-tab-pane label="部门授权" name="dept">
<el-table
ref="deptTable"
v-loading="loading"
:data="deptList"
:default-expand-all="true"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="部门名称" prop="deptName" ></el-table-column>
<el-table-column label="部门负责人" prop="leader" ></el-table-column>
<el-table-column label="邮箱" prop="email" ></el-table-column>
<el-table-column align="center" label="创建时间" prop="createTime" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" prop="createTime" >
<template slot-scope="scope">
<el-switch
style="display: block"
v-model="scope.row.isAuth"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
<el-tab-pane label="用户授权" name="user">
<el-table ref="table" v-loading="loading" :data="userList">
<el-table-column align="center" label="用户名称" prop="userName"/>
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户部门" prop="dept.deptName"/>
<el-table-column align="center" label="用户邮箱" prop="email"/>
<el-table-column align="center" label="用户手机号" prop="phonenumber"/>
<el-table-column align="center" label="创建时间" prop="createTime" />
<el-table-column align="center" label="操作" prop="createTime" >
<template slot-scope="scope">
<el-switch
style="display: block"
v-model="scope.row.isAuth"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { parseTime } from '@/utils/muyu'
export default {
name: "AuthTable",
data() {
return {
//
loading: true,
activeName: "dept",
//
total: 0,
pageNum: 1,
pageSize: 1,
//
baseInfo: {
name: "测试1",
systemName: "云计算系统",
databaseName: "yunjisuan",
tableName: "sys_user",
tableAsName: "用户表",
total: "12546条",
},
//
deptList: [],
//
userList: []
};
},
created() {
this.loading = true;
setTimeout(() => this.loading = false, 200)
this.init()
},
methods: {
parseTime,
init(){
let response = {
"code": 200,
"msg": "操作成功",
"data": [
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 100,
"parentId": 0,
"ancestors": "0",
"deptName": "muyu牧鱼科技",
"orderNum": 0,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 101,
"parentId": 100,
"ancestors": "0,100",
"deptName": "深圳总公司",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 102,
"parentId": 100,
"ancestors": "0,100",
"deptName": "长沙分公司",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 103,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "研发部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 104,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "市场部门",
"isAuth": true,
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 105,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "测试部门",
"orderNum": 3,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 106,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "财务部门",
"orderNum": 4,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 107,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "运维部门",
"orderNum": 5,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 108,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "市场部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 109,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "财务部门",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
}
]
}
this.deptList = this.handleTree(response.data, "deptId");
this.userList = [
{
"createBy": "admin",
"createTime": "2023-04-23 16:11:38",
"updateBy": null,
"updateTime": null,
"remark": "管理员",
"userId": 1,
"deptId": 103,
"userName": "admin",
"nickName": "智能车联",
"email": "ry@163.com",
"phonenumber": "15888888888",
"isAuth": true,
"dept": {
"deptName": "研发部门"
}
},
{
"createBy": "admin",
"createTime": "2023-04-23 16:11:38",
"updateBy": null,
"updateTime": null,
"remark": "测试员",
"userId": 2,
"deptId": 105,
"userName": "ry",
"nickName": "智能车联",
"email": "ry@qq.com",
"phonenumber": "15666666666",
"dept": {
"deptName": "测试部门"
}
}
]
}
},
};
</script>

View File

@ -0,0 +1,118 @@
<template>
<el-container :style="{height: mainHeight + 'px'}">
<el-aside>
<el-tree :data="assetStructureList"
: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-container>
<el-main>
<auth-data-source v-if="showAuth === 'dataSource'"/>
<auth-table v-else-if="showAuth === 'dataTable'"/>
</el-main>
</el-container>
</el-container>
</template>
<script>
import AuthDataSource from './auth/AuthDataSource.vue'
import AuthTable from './auth/AuthTable.vue'
export default {
name: 'assetStructure',
components: { AuthTable, AuthDataSource },
data() {
return {
mainHeight: window.innerHeight - 85,
defaultProps: {
children: 'childrenList',
label: 'name'
},
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: {
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 lang="scss">
.el-aside {
margin: 0;
padding: 0;
width: 400px;
background-color: white;
}
.el-main {
background-color: #f1f1f1;
}
.custom-tree-node{
height: 30px;
}
</style>

View File

@ -178,6 +178,13 @@
icon="el-icon-edit"
@click="connectionTest(scope.row)"
>测试连接</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="synchronizationAdd(scope.row)"
v-hasPermi="['kvt:kvt:edit']"
>同步</el-button>
<el-button
size="mini"
type="text"
@ -339,7 +346,16 @@
</template>
<script>
import { listKvt, getKvt, delKvt, addKvt, updateKvt, connectionTest, dataTypeList } from '@/api/kvt/kvt'
import {
listKvt,
getKvt,
delKvt,
addKvt,
updateKvt,
connectionTest,
dataTypeList,
synchronizationAdd
} from '@/api/kvt/kvt'
export default {
name: "Kvt",
@ -440,6 +456,10 @@ export default {
this.dataTypeList()
},
methods: {
//
synchronizationAdd(row){
synchronizationAdd(row).then(res=>{})
},
dataTypeList(){
dataTypeList().then(res=> {
console.log(res)