feat()增加了同步和测试,完成了选中不同节点展示不同效果
parent
32b2c54503
commit
99701fef6d
|
@ -56,3 +56,13 @@ export function selectTable(libraryName) {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function synchronization(data) {
|
||||
return request({
|
||||
url: '/system/access/synchronization',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@ export function listSelectSysUser(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function listSqlJdbc(data) {
|
||||
export function selJDBCStream(data) {
|
||||
return request({
|
||||
url: '/system/accredit/listSqlJdbc',
|
||||
method: 'get',
|
||||
url: '/system/accredit/selJDBCStream',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -61,4 +61,17 @@ export function selNameListStructure(tableName) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态/是否增加字典
|
||||
* @param data
|
||||
* @returns {AxiosPromise}
|
||||
*/
|
||||
export function updateListStructure(data) {
|
||||
return request({
|
||||
url: '/system/accredit/updateListStructure',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -113,6 +113,10 @@
|
|||
<el-table-column label="介绍" align="center" prop="intor" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||
@click="synchronizations(scope.row)"
|
||||
v-has-permi="['system:access:edit']"
|
||||
>同步</el-button>
|
||||
<el-button size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
|
@ -274,8 +278,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listAccess, getAccess, delAccess, addAccess, updateAccess } from "@/api/system/access";
|
||||
import { listSqlJdbc } from "@/api/system/accredit";
|
||||
import { listAccess, getAccess, delAccess, addAccess, updateAccess, synchronization } from "@/api/system/access";
|
||||
import { selJDBCStream } from "@/api/system/accredit";
|
||||
|
||||
export default {
|
||||
name: "Access",
|
||||
|
@ -376,6 +380,12 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 同步
|
||||
synchronizations(row){
|
||||
synchronization(row).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
},
|
||||
// 添加参数
|
||||
addParam(){
|
||||
this.dataSourceParamList.push({
|
||||
|
@ -408,6 +418,7 @@ export default {
|
|||
this.accessList = response.data.rows;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
console.log(this.accessList)
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
|
@ -458,25 +469,10 @@ export default {
|
|||
},
|
||||
/** 测试 **/
|
||||
handleCes(row) {
|
||||
listSqlJdbc().then(res => {
|
||||
console.log(res.data)
|
||||
console.log(row)
|
||||
selJDBCStream(row).then(res => {
|
||||
this.$message.success(res.data)
|
||||
})
|
||||
// this.$router.push({
|
||||
// path:'/',
|
||||
// name:'',
|
||||
// params:{
|
||||
// row:row
|
||||
// }
|
||||
// })
|
||||
// if (row){
|
||||
// this.$modal.msgSuccess("测试成功")
|
||||
// }else {
|
||||
// this.$refs["form"].validate(val => {
|
||||
// if (val) {
|
||||
// this.$modal.msgSuccess("测试成功");
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
|
|
@ -26,19 +26,13 @@
|
|||
<el-table
|
||||
ref="deptTable"
|
||||
v-loading="loading"
|
||||
:data="deptList"
|
||||
:data="depts"
|
||||
:default-expand-all="true"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="deptId"
|
||||
>
|
||||
: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" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="创建时间" prop="createTime" ></el-table-column>
|
||||
<el-table-column align="center" label="操作" prop="createTime" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
|
@ -103,6 +97,7 @@ export default {
|
|||
},
|
||||
// 部门列表
|
||||
deptList: [],
|
||||
depts: [],
|
||||
// 用户列表
|
||||
userList: []
|
||||
};
|
||||
|
@ -114,12 +109,14 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
init() {
|
||||
//部门
|
||||
listDeptVo().then(res => {
|
||||
this.deptList = res.data
|
||||
this.depts = res.data
|
||||
console.log(this.depts)
|
||||
})
|
||||
//用户
|
||||
listSelectSysUser().then(res => {
|
||||
this.userList = res.data
|
||||
console.log(res.data)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
v-loading="loading"
|
||||
:data="deptList"
|
||||
:default-expand-all="true"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="deptId"
|
||||
>
|
||||
: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>
|
||||
|
@ -132,11 +130,9 @@ export default {
|
|||
init(){
|
||||
listDeptVo().then(res => {
|
||||
this.deptList = res.data
|
||||
console.log(res.data)
|
||||
})
|
||||
listSelectSysUser().then(res => {
|
||||
this.userList = res.data
|
||||
console.log(res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<span>资产模型详细信息</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:data="childrenList"
|
||||
style="width: 100%;">
|
||||
<el-table-column prop="tableName" label="表名" />
|
||||
<el-table-column prop="columnLassName" label="类型" />
|
||||
|
@ -29,6 +29,21 @@
|
|||
<el-table-column prop="isNull" label="非空" />
|
||||
<el-table-column prop="schemaName" label="默认" />
|
||||
<el-table-column prop="columnComments" label="注解" />
|
||||
<el-table-column prop="yesOrNo" label="是否字典"/>
|
||||
<el-table-column prop="dictionary" label="映射字典">
|
||||
<template slot-scope="scope">
|
||||
<el-popover v-if="scope.row.yesOrNo === 'Y'"
|
||||
placement="left"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<el-table :data="dictMap[scope.row.dictionary]">
|
||||
<el-table-column prop="label" label="标签"></el-table-column>
|
||||
<el-table-column prop="val" label="值"></el-table-column>
|
||||
</el-table>
|
||||
<el-tag slot="reference">{{scope.row.dictionary}}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="update(scope.row)">编辑</el-button>
|
||||
|
@ -93,23 +108,63 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="知否字典">
|
||||
<el-switch
|
||||
v-model="form.yesOrNo"
|
||||
active-value="Y"
|
||||
inactive-value="N"
|
||||
active-color="#132545"
|
||||
inactive-color="#ff458"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-row v-if="form.yesOrNo === 'Y'">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="字典">
|
||||
<el-select v-model="form.dictionary">
|
||||
<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.dictionary]" striped border>
|
||||
<el-table-column property="label" label="标签"></el-table-column>
|
||||
<el-table-column property="val" label="值"></el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="formStatus = false">取 消</el-button>
|
||||
<el-button type="primary" @click="formStatus = false">确 定</el-button>
|
||||
<el-button type="primary" @click="updYesTrue(form)">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listListstructure,selNameListStructure } from '@/api/system/accredit'
|
||||
import {
|
||||
listListstructure,
|
||||
selNameListStructure,
|
||||
updateListStructure
|
||||
} from '@/api/system/accredit'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
tableName: String,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
name: 'OverallAssetStructure',
|
||||
data() {
|
||||
return {
|
||||
tableName: this.$route.query.tableName,
|
||||
tableData: [],
|
||||
childrenList: [],
|
||||
form: {
|
||||
tableName: '',
|
||||
columnLassName: '',
|
||||
|
@ -120,16 +175,18 @@ export default {
|
|||
isNull: '',
|
||||
schemaName: '',
|
||||
columnComments: '',
|
||||
id: ''
|
||||
id: '',
|
||||
yesOrNo: '',
|
||||
dictionary: ''
|
||||
},
|
||||
formStatus: false,
|
||||
dictMap: {
|
||||
"system_sex": [
|
||||
dictMap:{
|
||||
"性别(system_sex)": [
|
||||
{ label: '男', val: '1', isEdit: false },
|
||||
{ label: '女', val: '2', isEdit: false },
|
||||
{ label: '未知', val: '0', isEdit: false },
|
||||
],
|
||||
"system_y_n": [
|
||||
"开关(system_y_n)": [
|
||||
{ label: '是', val: '1', isEdit: false },
|
||||
{ label: '否', val: '0', isEdit: false }
|
||||
],
|
||||
|
@ -138,14 +195,29 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
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() {
|
||||
if (this.title == null){
|
||||
listListstructure().then(res => {
|
||||
this.tableData = res.data
|
||||
this.childrenList = res.data
|
||||
})
|
||||
|
||||
console.log(this.childrenList)
|
||||
}else{
|
||||
selNameListStructure(this.title).then(res => {
|
||||
this.childrenList = res.data
|
||||
})
|
||||
console.log(this.childrenList)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
|
|
|
@ -41,21 +41,39 @@
|
|||
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
|
||||
<i class="el-icon-question" slot="reference"></i>
|
||||
</el-popover>
|
||||
<el-popover
|
||||
placement="right"
|
||||
width="400"
|
||||
trigger="click">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="18">
|
||||
<el-input v-model="dictAddName"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button @click="addDict">确定</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" slot="reference">新增字典</el-button>
|
||||
</el-popover>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
|
||||
<el-card class="box-card" style="height: 300px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{key}}</span>
|
||||
<el-button style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
@click="val.push({ label: null, val: null, isEdit: true })"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<el-table :data="val" style="width: 100%" height="280px">
|
||||
<el-table-column prop="label" label="标签" width="180">
|
||||
<el-table-column prop="label" label="标签">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.isEdit">{{scope.row.label}}</span>
|
||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.label" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="值" width="180">
|
||||
<el-table-column prop="val" label="值">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.isEdit">{{scope.row.val}}</span>
|
||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.val" size="mini"></el-input>
|
||||
|
@ -72,7 +90,7 @@
|
|||
>修改</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.isEdit"
|
||||
@click="scope.row.isEdit = false"
|
||||
@click="editConfirm(scope.row)"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-finished"
|
||||
|
@ -107,11 +125,12 @@ export default {
|
|||
title: {
|
||||
type: String,
|
||||
default: "-"
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
activeName: null,
|
||||
dictAddName: null,
|
||||
dictMap: {
|
||||
"性别(system_sex)": [
|
||||
{ label: '男', val: '1', isEdit: false },
|
||||
|
@ -130,9 +149,30 @@ export default {
|
|||
CountTo
|
||||
},
|
||||
methods: {
|
||||
editConfirm(row) {
|
||||
if (!row.label || !row.val) {
|
||||
this.$message.error('字典标签或字典值,不可为空');
|
||||
return;
|
||||
}
|
||||
row.isEdit = false;
|
||||
},
|
||||
addDict() {
|
||||
if (!this.dictAddName){
|
||||
this.$message.error('数据字典,不可为空');
|
||||
return;
|
||||
}
|
||||
this.dictMap[this.dictAddName] = []
|
||||
this.dictAddName = null
|
||||
},
|
||||
handleSetLineChartData(type) {
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
},
|
||||
init() {
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<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"/>
|
||||
<overall-asset-structure v-if="showAssets === 'dataTable'" :title="tableName"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
@ -34,7 +34,7 @@ export default {
|
|||
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
||||
data() {
|
||||
return {
|
||||
tableName: [],
|
||||
tableName: '',
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'childrenList',
|
||||
|
@ -77,6 +77,7 @@ export default {
|
|||
const {data} = node;
|
||||
this.showAssets = data.type;
|
||||
if (data.type === 'dataTable') {
|
||||
this.tableName = data.name
|
||||
return resolve([])
|
||||
}
|
||||
setTimeout(() => {
|
||||
|
@ -84,14 +85,14 @@ 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}
|
||||
})
|
||||
if (data.as == undefined){
|
||||
console.log(1)
|
||||
this.tableName = '';
|
||||
}else{
|
||||
console.log(2)
|
||||
this.tableName = data.name
|
||||
}
|
||||
},
|
||||
thisTable() {
|
||||
|
|
Loading…
Reference in New Issue