feat()选中不同节点展示不同效果重写
parent
22708ed023
commit
4ce26e6362
|
@ -54,9 +54,9 @@ export function selNameTableList(name) {
|
|||
})
|
||||
}
|
||||
// 根据表名获取表结构
|
||||
export function selNameListStructure(tableName) {
|
||||
export function selNameListStructure(tableName,databaseName) {
|
||||
return request({
|
||||
url: '/system/accredit/selNameListStructure/'+ tableName,
|
||||
url: '/system/accredit/selNameListStructure?tableName=' + tableName + '&databaseName=' + databaseName,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
@ -74,11 +74,6 @@ export function updateListStructure(data) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看父类表
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export function selectFrimary(data) {
|
||||
return request({
|
||||
url: '/system/accredit/selectFrimary',
|
||||
|
@ -87,9 +82,30 @@ export function selectFrimary(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function listMiddle(name) {
|
||||
export function listMiddle(tableName,databaseName) {
|
||||
return request({
|
||||
url: '/system/accredit/listMiddle?name=' + name,
|
||||
url: '/system/accredit/listMiddle?tableName=' + tableName + '&databaseName=' + databaseName,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMiddle2(databaseName) {
|
||||
return request({
|
||||
url: '/system/accredit/listMiddle2?databaseName=' + databaseName,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function listUserMiddle(tableName,databaseName) {
|
||||
return request({
|
||||
url: '/system/accredit/listUserMiddle?tableName=' + tableName + '&databaseName=' + databaseName,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function listUserMiddle2(databaseName) {
|
||||
return request({
|
||||
url: '/system/accredit/listUserMiddle2?databaseName=' + databaseName,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -414,7 +414,6 @@ export default {
|
|||
const {data} = node;
|
||||
this.showAssets = data.type;
|
||||
if (data.type === 'dataTable') {
|
||||
this.tableName = data.name
|
||||
return resolve([])
|
||||
}
|
||||
setTimeout(() => {
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
<el-table
|
||||
ref="deptTable"
|
||||
v-loading="loading"
|
||||
:data="depts"
|
||||
:data="deptList"
|
||||
:default-expand-all="true"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<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" ></el-table-column>
|
||||
<el-table-column align="center" label="操作" prop="createTime" >
|
||||
<el-table-column align="center" label="创建时间" prop="createTime"></el-table-column>
|
||||
<el-table-column align="center" label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
|
@ -76,9 +76,17 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listDeptVo, listSelectSysUser } from '@/api/system/accredit'
|
||||
import { listMiddle2, listUserMiddle2 } from '@/api/system/accredit'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: Object
|
||||
},
|
||||
stats: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
name: "AuthDataSource",
|
||||
data() {
|
||||
return {
|
||||
|
@ -97,7 +105,6 @@ export default {
|
|||
},
|
||||
// 部门列表
|
||||
deptList: [],
|
||||
depts: [],
|
||||
// 用户列表
|
||||
userList: []
|
||||
};
|
||||
|
@ -109,13 +116,13 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.baseInfo = this.stats
|
||||
//部门
|
||||
listDeptVo().then(res => {
|
||||
this.depts = res.data
|
||||
console.log(this.depts)
|
||||
listMiddle2(this.title.databaseName).then(res => {
|
||||
this.deptList = res.data
|
||||
})
|
||||
//用户
|
||||
listSelectSysUser().then(res => {
|
||||
listUserMiddle2(this.title.databaseName).then(res => {
|
||||
this.userList = res.data
|
||||
})
|
||||
},
|
||||
|
|
|
@ -75,7 +75,9 @@
|
|||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.isAuth"
|
||||
v-model="scope.row.mid"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="已授权"
|
||||
|
@ -92,9 +94,14 @@
|
|||
|
||||
<script>
|
||||
|
||||
import { listDeptVo, listSelectSysUser } from "@/api/system/accredit";
|
||||
import { listMiddle, listUserMiddle } from "@/api/system/accredit";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: Object
|
||||
},
|
||||
},
|
||||
name: "AuthTable",
|
||||
data() {
|
||||
return {
|
||||
|
@ -128,10 +135,13 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
init(){
|
||||
listDeptVo().then(res => {
|
||||
console.log(this.title.databaseName)
|
||||
console.log(this.title.tableName)
|
||||
listMiddle(this.title.tableName,this.title.databaseName).then(res => {
|
||||
this.deptList = res.data
|
||||
console.log(res.data)
|
||||
})
|
||||
listSelectSysUser().then(res => {
|
||||
listUserMiddle(this.title.tableName,this.title.databaseName).then(res => {
|
||||
this.userList = res.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -9,21 +9,21 @@
|
|||
: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 v-if="data.type === 'dataTable'">{{ data.tableName + '-'+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'"/>
|
||||
<auth-data-source v-if="showAuth === 'dataSource'" :title="title" :stats="stats" />
|
||||
<auth-table v-else-if="showAuth === 'dataTable'" :title="title" />
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tableNameList } from '@/api/system/accredit'
|
||||
import { tableNameList, selectFrimary } from '@/api/system/accredit'
|
||||
import AuthDataSource from './auth/AuthDataSource.vue'
|
||||
import AuthTable from './auth/AuthTable.vue'
|
||||
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
|
@ -35,39 +35,15 @@ export default {
|
|||
data() {
|
||||
// 这里存放数据"
|
||||
return {
|
||||
tableName: [],
|
||||
title: null,
|
||||
stats: null,
|
||||
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"
|
||||
},
|
||||
],
|
||||
assetStructureList: [],
|
||||
childrenList: []
|
||||
}
|
||||
},
|
||||
|
@ -84,21 +60,29 @@ export default {
|
|||
return resolve([])
|
||||
}
|
||||
setTimeout(() => {
|
||||
resolve(this.childrenList)
|
||||
resolve(data.tableLists)
|
||||
}, 500);
|
||||
},
|
||||
thisLib() {
|
||||
init() {
|
||||
selectFrimary().then(res => {
|
||||
this.assetStructureList = res.data
|
||||
})
|
||||
tableNameList().then(res => {
|
||||
this.childrenList = res.data;
|
||||
})
|
||||
},
|
||||
selName(data) {
|
||||
this.showAuth=data.type
|
||||
this.stats = data
|
||||
this.title = {
|
||||
tableName: data.name,
|
||||
databaseName: data.databaseName
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.thisLib()
|
||||
this.init()
|
||||
},
|
||||
// 生命周期 - 挂载完成(可以访问DOM元素)",
|
||||
mounted() {
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
</el-table>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<el-tag slot="reference">{{scope.row.dictionary}}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
|
@ -158,7 +157,6 @@
|
|||
</template>
|
||||
<script>
|
||||
import {
|
||||
listListstructure,
|
||||
selNameListStructure,
|
||||
updateListStructure
|
||||
} from '@/api/system/accredit'
|
||||
|
@ -166,14 +164,23 @@ import { listDictType, selectDictType } from "@/api/system/dicts";
|
|||
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String
|
||||
tableParams: {
|
||||
type: Object
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
handler(val) {
|
||||
if (val != null) {
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
},
|
||||
name: 'OverallAssetStructure',
|
||||
data() {
|
||||
return {
|
||||
childrenList: [],
|
||||
tableName: '',
|
||||
databaseName: '',
|
||||
form: {
|
||||
tableName: '',
|
||||
columnLassName: '',
|
||||
|
@ -189,11 +196,6 @@ export default {
|
|||
dictionary: ''
|
||||
},
|
||||
formStatus: false,
|
||||
tableName: '',
|
||||
dictMap:{
|
||||
dictType: '',
|
||||
dictDataList: []
|
||||
},
|
||||
dictMap2:{
|
||||
dictType: '',
|
||||
dictDataList: []
|
||||
|
@ -202,47 +204,30 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
selData(thanName){
|
||||
selectDictType(thanName).then(res => {
|
||||
this.dictMap = res.data
|
||||
|
||||
})
|
||||
},
|
||||
selData2(thanName){
|
||||
selectDictType(thanName).then(res => {
|
||||
this.dictMap2 = res.data
|
||||
})
|
||||
},
|
||||
update(row) {
|
||||
console.log(row)
|
||||
this.form = row;
|
||||
this.formStatus = true;
|
||||
},
|
||||
updYesTrue(row) {
|
||||
console.log(row)
|
||||
updateListStructure(row).then(res => {
|
||||
this.$message.success(res.data)
|
||||
this.formStatus = false
|
||||
})
|
||||
},
|
||||
init() {
|
||||
console.log(this.title)
|
||||
if (this.title === undefined){
|
||||
listListstructure().then(res => {
|
||||
selNameListStructure(this.tableParams.tableName,this.tableParams.databaseName).then(res => {
|
||||
this.childrenList = res.data
|
||||
})
|
||||
}else{
|
||||
selNameListStructure(this.title).then(res => {
|
||||
this.childrenList = res.data
|
||||
})
|
||||
}
|
||||
listDictType().then(res => {
|
||||
this.dictOut = res.data
|
||||
console.log(this.dictOut)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.init()
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ export default {
|
|||
title: {
|
||||
type: String,
|
||||
default: "-"
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -163,17 +163,16 @@ export default {
|
|||
return val
|
||||
},
|
||||
checkTableName(checkTab){
|
||||
console.log(checkTab)
|
||||
this.tableParams = this.tableList.findLast(item => item.tableName === checkTab.name)
|
||||
},
|
||||
updData(row) {
|
||||
console.log(row)
|
||||
selectDictData(row).then(res => {
|
||||
this.dictData = res.data
|
||||
})
|
||||
row.isEdit = true
|
||||
},
|
||||
editConfirm(row) {
|
||||
console.log(row)
|
||||
if (!row.dictLabel || !row.dictValue) {
|
||||
this.$message.error('字典标签或字典值,不可为空');
|
||||
return;
|
||||
|
@ -184,7 +183,6 @@ export default {
|
|||
row.isEdit = false;
|
||||
},
|
||||
delType(row) {
|
||||
console.log(row)
|
||||
deleteDictType(row).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<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="tableName"/>
|
||||
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title" />
|
||||
<overall-asset-structure v-if="showAssets === 'dataTable'" :table-params="tableParams" />
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
@ -33,7 +33,6 @@ export default {
|
|||
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
||||
data() {
|
||||
return {
|
||||
tableName: {},
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'childrenList',
|
||||
|
@ -42,6 +41,8 @@ export default {
|
|||
assetStructureList: [],
|
||||
childrenList: [],
|
||||
showAssets: null,
|
||||
tableParams: null,
|
||||
stats: null,
|
||||
title: null
|
||||
}
|
||||
},
|
||||
|
@ -57,15 +58,15 @@ export default {
|
|||
resolve(data.tableLists)
|
||||
}, 500);
|
||||
},
|
||||
showAssetsFun(data){
|
||||
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
||||
showAssetsFun(data) {
|
||||
this.title = data.name + '(' + data.databaseName + '-' + data.systemName + ')'
|
||||
this.showAssets = data.type;
|
||||
if (data.as === undefined){
|
||||
this.tableName = data.databaseName
|
||||
}else{
|
||||
this.tableName = data.name
|
||||
this.stats = data
|
||||
console.log(this.stats)
|
||||
this.tableParams = {
|
||||
tableName: data.name,
|
||||
databaseName: data.databaseName
|
||||
}
|
||||
|
||||
},
|
||||
init() {
|
||||
selectFrimary().then(res => {
|
||||
|
|
Loading…
Reference in New Issue