Merge remote-tracking branch 'origin/master'

master
面包骑士 2024-09-01 20:59:44 +08:00
commit d34f61c622
6 changed files with 234 additions and 32 deletions

View File

@ -58,3 +58,24 @@ export function synchronous(data) {
data: data data: data
}) })
} }
//根据基础表ID和SQL语句查询数据
export function findTableValue(basicId,sql) {
return request({
url: '/source/value/findTableValue',
method: 'post',
params: {basicId:basicId,sql:sql}
})
}
export function findByTableName() {
return request({
url: '/source/tableInfo/findTableInfo',
method: 'GET',
})
}
//根据基础表ID和表名查询数据
export function findTableValueList(basicId,tableName) {
return request({
url: "/source/value/findTableValueByTableName?basicId="+basicId+"&tableName="+tableName,
method: 'post',
})
}

View File

@ -69,5 +69,18 @@ export function findTableInfoList() {
method: 'get', method: 'get',
}) })
} }
export function selectColumn() {
return request({
url: '/source/tableInfo/selectColumn',
method: 'get',
})
}
export function findTableName(id) {
return request({
url: '/source/tableInfo/findTableName',
method: 'post',
params: {id}
})
}

View File

@ -1,18 +1,88 @@
<template> <template>
<div> <div>
<el-container>
<el-aside width="30%"> <el-aside width="30%">
<el-tree :data="dataList" :props="defaultProps" @node-click="handleNodeClick"> <el-tree :data="dataList" :props="defaultProps" @node-click="handleNodeClick">
</el-tree> </el-tree>
</el-aside> </el-aside>
<el-tabs type="border-card" v-model="idType">
<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"
@change="(val)=>accreditChange(val,scope.row,scope.row.deptId)"
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"
@change="(val)=>accreditChange(val,scope.row,scope.row.userId)"
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>
</el-container>
</div> </div>
</template> </template>
<script setup> <script setup>
import {findTableInfoList} from "@/api/tableData/data"; import {findTableInfoList} from "@/api/tableData/data";
import {listDept} from "@/api/system/dept";
import {listUser} from "@/api/system/user";
export default { export default {
name:'Accredit', name:'Accredit',
data() { data() {
return { return {
//
deptList: [],
//
userList: [],
deptData:[],
dataList:[ dataList:[
{ {
children:[], children:[],
@ -27,7 +97,7 @@ export default {
}, },
created() { created() {
this.findTableInfoList(); this.findTableInfoList();
this.init();
}, },
methods:{ methods:{
findTableInfoList(){ findTableInfoList(){
@ -35,6 +105,19 @@ export default {
this.dataList=res.data this.dataList=res.data
}) })
}, },
init() {
listDept().then(res => {
this.deptData = res.data
this.deptList = this.handleTree(res.data, "deptId");
})
listUser().then(res => {
console.log(res)
this.userList = res.data.rows
})
// setTimeout(() => {
// this.setAuth();
// }, 600);
},
}, },
} }
</script> </script>

View File

@ -1,40 +1,125 @@
<template> <template>
<div> <div>
<el-aside width="30%"> <el-container>
<el-tree :data="dataList" :props="defaultProps" @node-click="handleNodeClick"> <el-aside width="400px">
</el-tree>
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</el-aside> </el-aside>
<el-main>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: xx-large"></span>
<template>
<el-descriptions class="margin-top" title="资产模型基本信息" :column="2" border>
<el-descriptions-item>
<template slot="label">表名称</template>
{{ tableBasic.tableName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">表备注</template>
{{ tableBasic.tableRemark }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">数据量</template>
{{ tableBasic.dataNum }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">是否核心</template>
<dict-tag :options="dict.type.sys_yes_no" :value="tableBasic.center"/>
</el-descriptions-item>
</el-descriptions>
</template>
</div>
</el-card>
<el-card class="box-card" style="margin-top: 20px">
<div slot="header" class="clearfix">
<span>模型数据</span>
</div>
<el-row :gutter="20">
<el-col :span="6" v-for="DataValue in assetShowList" style="margin-top: 20px">
<el-descriptions :title="tableBasic.tableRemark+'.'+tableBasic.tableName+'.'+DataValue.key" direction="vertical"
border :column="1">
<el-descriptions-item label="Type">
<el-tag size="small">{{ DataValue.type }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="Value">{{ DataValue.value }}</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</el-card>
<!-- <el-table-->
<!-- :data="DataValue"-->
<!-- style="width: 100%">-->
<!-- <el-table-column-->
<!-- prop="key"-->
<!-- label="key"-->
<!-- width="180">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="label"-->
<!-- label="label"-->
<!-- width="180">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="type"-->
<!-- label="type">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="value"-->
<!-- label="value">-->
<!-- </el-table-column>-->
<!-- </el-table>-->
</el-main>
</el-container>
</div> </div>
</template> </template>
<script setup> <script setup>
import {findTableInfoList} from "@/api/tableData/data"; import {findByTableName, findTableValueList} from "@/api/source/source";
export default { export default {
name: 'Show', name: 'Show',
dicts: ['sys_yes_no'],
data() { data() {
return { return {
dataList:[ data:[],
{
children:[],
}
],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'tableName' label: 'tableName'
}, },
tableBasic:{},
tableStructure:[],
assetShowList: [],
kvtList: [],
DataValue:[],
}; };
}, },
created() { created() {
this.findTableInfoList(); this.findByTableName();
}, },
methods: { methods: {
findTableInfoList(){ findByTableName(){
findTableInfoList().then(res=>{ findByTableName().then((res)=>{
this.dataList=res.data this.data = res.data
}) })
}, },
handleNodeClick(data) {
console.log("...." + data)
this.tableBasic = data
if (data.children == null) {
findTableValueList(data.basicId, data.tableName).then(res => {
this.assetShowList = res.data;
this.DataValue = res.data;
})
}
}
}, },
} }
</script> </script>

View File

@ -314,10 +314,10 @@ export default {
testConnection(dataSource).then(res => { testConnection(dataSource).then(res => {
console.log(res) console.log(res)
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.msg) this.$message.success("连接成功")
this.getList() this.getList()
} else { } else {
this.$message.error(res.msg) this.$message.error("连接失败")
} }
}) })
}, },

View File

@ -3,22 +3,13 @@
<el-container> <el-container>
<el-aside width="30%"> <el-aside width="30%">
<el-tree :data="dataList" :props="defaultProps" @node-click="handleNodeClick"> <el-tree :data="dataList" :props="defaultProps" @node-click="handleNodeClick">
<div v-if="tableList.type === 'dataSource'">{{
tableList.name + '(' + tableList.databaseName + '-' + tableList.systemName + ')'
}}
</div>
<div v-if="tableList.type === 'dataTable'">{{
tableList.tableName + '-' + tableList.tableRemark + '(' + tableList.dataNum + '条)'
}}
</div>
</el-tree> </el-tree>
</el-aside> </el-aside>
<el-main> <el-main>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>资产模型基本信息</span> <span>资产结构基本信息</span>
</div> </div>
<el-descriptions class="margin-top" title="带边框列表" :column="2" border> <el-descriptions class="margin-top" title="带边框列表" :column="2" border>
<el-descriptions-item> <el-descriptions-item>
@ -42,7 +33,7 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>资产模型详细信息</span> <span>资产结构详细信息</span>
</div> </div>
<el-table <el-table
:data="tableData" style="width: 100%"> :data="tableData" style="width: 100%">
@ -73,7 +64,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import {findTableInfoList, selectTableData} from "@/api/tableData/data"; import {findTableInfoList, selectColumn, selectTableData} from "@/api/tableData/data";
export default { export default {
name: 'Type', name: 'Type',
@ -92,14 +83,22 @@ export default {
children: 'children', children: 'children',
label: 'tableName' label: 'tableName'
}, },
columnList:[],
}; };
}, },
created() { created() {
this.findTableInfoList(); this.findTableInfoList();
this.selectColumnList();
}, },
methods: { methods: {
selectColumnList(){
selectColumn().then(res=>{
console.log(res.data)
this.columnList=res.data
})
},
findTableInfoList(){ findTableInfoList(){
findTableInfoList().then(res=>{ findTableInfoList().then(res=>{
this.dataList=res.data this.dataList=res.data
@ -108,6 +107,7 @@ export default {
handleNodeClick(data) { handleNodeClick(data) {
this.tableList=data this.tableList=data
selectTableData(data.id).then(res=>{ selectTableData(data.id).then(res=>{
console.log(res.data)
this.tableData=res.data; this.tableData=res.data;
}) })
console.log(data); console.log(data);