type(table,access,authorization)根据表单查询相应的表结构和表框架
parent
4d648c5950
commit
32b2c54503
|
@ -8,18 +8,10 @@ export function tableNameList() {
|
|||
})
|
||||
}
|
||||
|
||||
export function tableNameList2(data) {
|
||||
return request({
|
||||
url: '/system/accredit/tableNameList2',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function selectTableXml(tableName) {
|
||||
return request({
|
||||
url: '/system/accredit/selectTableXml/' + tableName,
|
||||
method: 'get'
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -39,4 +31,34 @@ export function listSelectSysUser(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function listSqlJdbc(data) {
|
||||
return request({
|
||||
url: '/system/accredit/listSqlJdbc',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function listListstructure(data) {
|
||||
return request({
|
||||
url: '/system/accredit/listListstructure',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 根据表名查询表框架
|
||||
export function selNameTableList(name) {
|
||||
return request({
|
||||
url: '/system/accredit/selNameTableList/'+ name,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// 根据表名获取表结构
|
||||
export function selNameListStructure(tableName) {
|
||||
return request({
|
||||
url: '/system/accredit/selNameListStructure/'+ tableName,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -275,6 +275,7 @@
|
|||
|
||||
<script>
|
||||
import { listAccess, getAccess, delAccess, addAccess, updateAccess } from "@/api/system/access";
|
||||
import { listSqlJdbc } from "@/api/system/accredit";
|
||||
|
||||
export default {
|
||||
name: "Access",
|
||||
|
@ -457,13 +458,16 @@ export default {
|
|||
},
|
||||
/** 测试 **/
|
||||
handleCes(row) {
|
||||
this.$router.push({
|
||||
path:'/',
|
||||
name:'',
|
||||
params:{
|
||||
row:row
|
||||
}
|
||||
listSqlJdbc().then(res => {
|
||||
console.log(res.data)
|
||||
})
|
||||
// this.$router.push({
|
||||
// path:'/',
|
||||
// name:'',
|
||||
// params:{
|
||||
// row:row
|
||||
// }
|
||||
// })
|
||||
// if (row){
|
||||
// this.$modal.msgSuccess("测试成功")
|
||||
// }else {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
:load="expandTable"
|
||||
:expand-on-click-node="false"
|
||||
lazy
|
||||
@node-click="(data) => showAuth=data.type"
|
||||
@node-click="selName"
|
||||
:props="defaultProps">
|
||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tableNameList, tableNameList2 } from '@/api/system/accredit'
|
||||
import { tableNameList } from '@/api/system/accredit'
|
||||
import AuthDataSource from './auth/AuthDataSource.vue'
|
||||
import AuthTable from './auth/AuthTable.vue'
|
||||
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
|
@ -68,29 +68,7 @@ export default {
|
|||
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: []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// 计算属性 类似于data概念",
|
||||
|
@ -110,12 +88,12 @@ export default {
|
|||
}, 500);
|
||||
},
|
||||
thisLib() {
|
||||
// tableNameList().then(res => {
|
||||
// this.childrenList = res.data;
|
||||
// })
|
||||
// tableNameList2().then(res => {
|
||||
// console.log(res.data)
|
||||
// })
|
||||
tableNameList().then(res => {
|
||||
this.childrenList = res.data;
|
||||
})
|
||||
},
|
||||
selName(data) {
|
||||
this.showAuth=data.type
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
|
|
|
@ -20,53 +20,15 @@
|
|||
<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="tableName" label="表名" />
|
||||
<el-table-column prop="columnLassName" label="类型" />
|
||||
<el-table-column prop="columnTypeName" label="映射类型" />
|
||||
<el-table-column prop="columnName" label="字段名称" />
|
||||
<el-table-column prop="precisions" label="长度" />
|
||||
<el-table-column prop="scale" label="小数" />
|
||||
<el-table-column prop="isNull" label="非空" />
|
||||
<el-table-column prop="schemaName" label="默认" />
|
||||
<el-table-column prop="columnComments" label="注解" />
|
||||
<el-table-column prop="id" label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="update(scope.row)">编辑</el-button>
|
||||
|
@ -74,92 +36,60 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus">
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="form.name" readonly autocomplete="off"></el-input>
|
||||
<el-form-item label="表名">
|
||||
<el-input v-model="form.tableName" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注释">
|
||||
<el-input v-model="form.comment" readonly autocomplete="off"></el-input>
|
||||
<el-form-item label="类型">
|
||||
<el-input v-model="form.columnLassName" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="映射类型">
|
||||
<el-input v-model="form.columnTypeName" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否主键">
|
||||
<el-tag size="small" :type="form.isPrimaryKey === 'Y' ? 'success' : 'danger'">
|
||||
{{form.isPrimaryKey}}
|
||||
</el-tag>
|
||||
<el-form-item label="字段名称">
|
||||
<el-input v-model="form.columnName" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数据类型">
|
||||
<el-input v-model="form.type" readonly autocomplete="off"></el-input>
|
||||
<el-form-item label="长度">
|
||||
<el-input v-model="form.precisions" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数据长度">
|
||||
<el-input v-model="form.length" readonly autocomplete="off"></el-input>
|
||||
<el-form-item label="小数">
|
||||
<el-input v-model="form.scale" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="小数位">
|
||||
<el-input v-model="form.decimalPlaces" readonly autocomplete="off"></el-input>
|
||||
<el-form-item label="非空">
|
||||
<el-input v-model="form.isNull" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否为空">
|
||||
<el-tag size="small" :type="form.isNull === 'Y' ? 'success' : 'danger'">
|
||||
{{form.isNull}}
|
||||
</el-tag>
|
||||
<el-form-item label="默认">
|
||||
<el-input v-model="form.schemaName" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认值">
|
||||
<el-input v-model="form.defaultValue" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="映射字段">
|
||||
<el-input v-model="form.mappingType" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否字典">
|
||||
<el-switch
|
||||
v-model="form.isDict"
|
||||
active-value="Y"
|
||||
inactive-value="N"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.isDict === 'Y'">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="字典">
|
||||
<el-select v-model="form.dictKey">
|
||||
<el-option v-for="(value, key) in dictMap" :key="key" :label="key" :value="key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<el-table :data="dictMap[form.dictKey]" striped border>
|
||||
<el-table-column property="label" label="字典标签"/>
|
||||
<el-table-column property="val" label="字典值"/>
|
||||
</el-table>
|
||||
<el-form-item label="注解">
|
||||
<el-input v-model="form.columnComments" readonly autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -172,78 +102,26 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listListstructure,selNameListStructure } from '@/api/system/accredit'
|
||||
|
||||
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: "-",
|
||||
}, ],
|
||||
form: {},
|
||||
tableName: this.$route.query.tableName,
|
||||
tableData: [],
|
||||
form: {
|
||||
tableName: '',
|
||||
columnLassName: '',
|
||||
columnTypeName: '',
|
||||
columnName: '',
|
||||
precisions: '',
|
||||
scale: '',
|
||||
isNull: '',
|
||||
schemaName: '',
|
||||
columnComments: '',
|
||||
id: ''
|
||||
},
|
||||
formStatus: false,
|
||||
dictMap: {
|
||||
"system_sex": [
|
||||
|
@ -262,7 +140,17 @@ export default {
|
|||
update(row) {
|
||||
this.form = row;
|
||||
this.formStatus = true;
|
||||
},
|
||||
init() {
|
||||
listListstructure().then(res => {
|
||||
this.tableData = res.data
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -54,6 +54,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
console.log(type)
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
import OverallSpecificAssets from "@/views/assets/table/dashboard/OverallSpecificAssets.vue";
|
||||
import OverallAssetStructure from "@/views/assets/table/dashboard/OverallAssetStructure.vue";
|
||||
import OverallAssets from "@/views/assets/table/dashboard/OverallAssets.vue";
|
||||
import { tableNameList } from "@/api/system/accredit";
|
||||
import { tableNameList, selNameListStructure, selNameTableList } from "@/api/system/accredit";
|
||||
|
||||
export default {
|
||||
name: 'table',
|
||||
|
@ -66,29 +66,7 @@ export default {
|
|||
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: []
|
||||
}
|
||||
],
|
||||
childrenList: [],
|
||||
showAssets: null,
|
||||
title: null
|
||||
}
|
||||
|
@ -106,18 +84,25 @@ export default {
|
|||
}, 500);
|
||||
},
|
||||
showAssetsFun(data){
|
||||
console.log(data)
|
||||
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
||||
this.showAssets = data.type;
|
||||
if (data.as!=undefined){
|
||||
this.$router.push({
|
||||
path:OverallAssetStructure,
|
||||
query:{tableName: data.name}
|
||||
})
|
||||
}
|
||||
},
|
||||
thisLib() {
|
||||
thisTable() {
|
||||
tableNameList().then(res => {
|
||||
this.tableName = res.data
|
||||
this.childrenList = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.thisLib()
|
||||
this.thisTable()
|
||||
},
|
||||
// 生命周期 - 挂载完成(可以访问DOM元素)",
|
||||
mounted() {
|
||||
|
|
Loading…
Reference in New Issue