feat()资产授权
parent
aa4a06151a
commit
c3af4a6d0c
|
@ -110,4 +110,18 @@ export function listUserMiddle2(databaseName) {
|
|||
})
|
||||
}
|
||||
|
||||
export function updateMiddle(mid,statusId) {
|
||||
return request({
|
||||
url: '/system/accredit/updateMiddle?mid=' + mid + "&statusId=" + statusId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUserMiddle(mid,statusId) {
|
||||
return request({
|
||||
url: '/system/accredit/updateUserMiddle?mid=' + mid + "&statusId=" + statusId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,9 +35,13 @@
|
|||
<el-table-column align="center" label="创建时间" prop="createTime"></el-table-column>
|
||||
<el-table-column align="center" label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="'value:' + scope.row.statusId"></el-tooltip>
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.isAuth"
|
||||
v-model="scope.row.statusId"
|
||||
@change="updDept(scope.row)"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="已授权"
|
||||
|
@ -56,11 +60,14 @@
|
|||
<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" >
|
||||
<el-table-column align="center" label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.isAuth"
|
||||
v-model="scope.row.statusId"
|
||||
@change="updUser(scope.row)"
|
||||
active-value= "0"
|
||||
inactive-value= "1"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="已授权"
|
||||
|
@ -76,7 +83,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listMiddle2, listUserMiddle2 } from '@/api/system/accredit'
|
||||
import { listMiddle2, listUserMiddle2, updateUserMiddle, updateMiddle } from '@/api/system/accredit'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
@ -115,6 +122,29 @@ export default {
|
|||
this.init()
|
||||
},
|
||||
methods: {
|
||||
updDept(row) {
|
||||
if (row.statusId == 0){
|
||||
updateMiddle(row.mid,1).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}else {
|
||||
updateMiddle(row.mid,0).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
updUser(row) {
|
||||
if (row.statusId == 0){
|
||||
updateUserMiddle(row.mid,1).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}else {
|
||||
updateUserMiddle(row.mid,0).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
init() {
|
||||
this.baseInfo = this.stats
|
||||
//部门
|
||||
|
|
|
@ -48,11 +48,14 @@
|
|||
<el-table-column label="部门负责人" prop="leader" ></el-table-column>
|
||||
<el-table-column label="邮箱" prop="email" ></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" ></el-table-column>
|
||||
<el-table-column align="center" label="操作" prop="createTime" >
|
||||
<el-table-column align="center" label="操作" prop="statusId" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.isAuth"
|
||||
v-model="scope.row.statusId"
|
||||
@change="updDept(scope.row)"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="已授权"
|
||||
|
@ -71,11 +74,12 @@
|
|||
<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" >
|
||||
<el-table-column align="center" label="操作" prop="statusId" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.mid"
|
||||
v-model="scope.row.statusId"
|
||||
@change="updUser(scope.row)"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
|
@ -94,7 +98,7 @@
|
|||
|
||||
<script>
|
||||
|
||||
import { listMiddle, listUserMiddle } from "@/api/system/accredit";
|
||||
import { listMiddle, listUserMiddle ,updateUserMiddle, updateMiddle } from "@/api/system/accredit";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
@ -124,7 +128,6 @@ export default {
|
|||
asas: "",
|
||||
dataTotal: "",
|
||||
},
|
||||
|
||||
// 部门列表
|
||||
deptList: [],
|
||||
// 用户列表
|
||||
|
@ -137,6 +140,29 @@ export default {
|
|||
this.init()
|
||||
},
|
||||
methods: {
|
||||
updDept(row) {
|
||||
if (row.mid,row.statusId === 0){
|
||||
updateMiddle(row.mid,1).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}else {
|
||||
updateMiddle(row.mid,0).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
updUser(row) {
|
||||
if (row.mid,row.statusId === 0){
|
||||
updateUserMiddle(row.mid,1).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}else {
|
||||
updateUserMiddle(row.mid,0).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
init(){
|
||||
this.baseInfo = this.stats
|
||||
//部门
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
<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 v-model="table" border :column="2">
|
||||
<el-descriptions-item label="表名称">{{ table.tableName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="表备注">{{ table.asas }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据量">{{ table.dataTotal }}</el-descriptions-item>
|
||||
<el-descriptions-item label="是否核心">
|
||||
<el-tag size="small">是</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
@ -167,6 +167,9 @@ export default {
|
|||
tableParams: {
|
||||
type: Object
|
||||
},
|
||||
// stats: {
|
||||
// type: Object
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
handler(val) {
|
||||
|
@ -180,6 +183,11 @@ export default {
|
|||
return {
|
||||
childrenList: [],
|
||||
databaseName: '',
|
||||
table: {
|
||||
tableName: 'one',
|
||||
asas: '单元格',
|
||||
dataTotal: '3',
|
||||
},
|
||||
form: {
|
||||
tableName: '',
|
||||
columnLassName: '',
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
</el-col>
|
||||
<el-col :span="24" style="margin-top: 20px">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="checkTableName">
|
||||
<el-tab-pane v-for="table in tableList" :label="table.tableName+'('+table.tableAsName+')'"
|
||||
<el-tab-pane v-for="table in tableList" :label="table.tableName+'('+table.asas+')'"
|
||||
:name="table.tableName">
|
||||
<overall-asset-structure v-if="table.tableName === tableParams.tableName" :table-params="tableParams"/>
|
||||
</el-tab-pane>
|
||||
|
@ -136,6 +136,9 @@ export default {
|
|||
title: {
|
||||
type: String,
|
||||
default: "-"
|
||||
},
|
||||
overallName: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -144,7 +147,9 @@ export default {
|
|||
dictAddName: null,
|
||||
dictMap: [],
|
||||
tableList: [],
|
||||
listStatus: [],
|
||||
tableParams: null,
|
||||
stats: null,
|
||||
dictData: {
|
||||
dictCode: '',
|
||||
dictType: '',
|
||||
|
@ -165,6 +170,7 @@ export default {
|
|||
checkTableName(checkTab){
|
||||
console.log(checkTab)
|
||||
this.tableParams = this.tableList.findLast(item => item.tableName === checkTab.name)
|
||||
this.stats = this.type.find(item => item.tableName === checkTab.name)
|
||||
},
|
||||
updData(row) {
|
||||
selectDictData(row).then(res => {
|
||||
|
@ -211,19 +217,20 @@ export default {
|
|||
listDictType().then(res => {
|
||||
this.dictMap = res.data
|
||||
})
|
||||
let rows = [
|
||||
{
|
||||
tableName: "sys_user",
|
||||
tableAsName: "用户表"
|
||||
},
|
||||
{
|
||||
tableName: "sys_dept",
|
||||
tableAsName: "部门表"
|
||||
},
|
||||
];
|
||||
this.tableList = rows;
|
||||
this.activeName = rows[0].tableName;
|
||||
this.tableParams = rows[0]
|
||||
this.listStatus =this.overallName
|
||||
// let rows = [
|
||||
// {
|
||||
// tableName: "sys_user",
|
||||
// asas: "用户表"
|
||||
// },
|
||||
// {
|
||||
// tableName: "sys_dept",
|
||||
// asas: "部门表"
|
||||
// },
|
||||
// ];
|
||||
this.tableList = this.listStatus;
|
||||
this.activeName = this.listStatus[0].tableName;
|
||||
this.tableParams = this.listStatus[0]
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
|
|
|
@ -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'" :table-params="tableParams" :stats="stats" />
|
||||
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title" :overall-name="overallName"/>
|
||||
<overall-asset-structure v-if="showAssets === 'dataTable'" :table-params="tableParams"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
@ -43,7 +43,8 @@ export default {
|
|||
showAssets: null,
|
||||
tableParams: null,
|
||||
stats: null,
|
||||
title: null
|
||||
title: null,
|
||||
overallName: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -62,12 +63,15 @@ export default {
|
|||
this.title = data.name + '(' + data.databaseName + '-' + data.systemName + ')'
|
||||
this.showAssets = data.type;
|
||||
this.stats = data
|
||||
console.log(this.stats)
|
||||
|
||||
if (data.type === 'dataSource') {
|
||||
this.overallName = data.tableLists
|
||||
}
|
||||
if (data.type === 'dataTable'){
|
||||
this.tableParams = {
|
||||
tableName: data.tableName,
|
||||
databaseName: data.databaseName
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
selectFrimary().then(res => {
|
||||
|
|
Loading…
Reference in New Issue