Compare commits
No commits in common. "etl-ui" and "main" have entirely different histories.
|
@ -28,6 +28,7 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
|
|||
if (report) {
|
||||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||
}
|
||||
|
||||
})
|
||||
} else {
|
||||
run(`vue-cli-service build ${args}`)
|
||||
|
|
|
@ -16,11 +16,3 @@ export function forceLogout(tokenId) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function findTokenId(query) {
|
||||
return request({
|
||||
url: '/system/online/findTokenId',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询数据源列表
|
||||
export function listDetabase(query) {
|
||||
// 查询数据接入基本信息列表
|
||||
export function listSource(query) {
|
||||
return request({
|
||||
url: '/source/source/list',
|
||||
method: 'get',
|
||||
|
@ -9,51 +9,33 @@ export function listDetabase(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询数据源详细
|
||||
export function getDetabase(id) {
|
||||
// 查询数据接入基本信息详细
|
||||
export function getSource(id) {
|
||||
return request({
|
||||
url: '/source/source/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//测试数据库连接
|
||||
export function testConnection(data) {
|
||||
|
||||
export function typeList() {
|
||||
return request({
|
||||
url: '/source/source/testConnection/',
|
||||
method: 'post',
|
||||
data: data
|
||||
url: '/source/type/typeList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//查询数据库名称
|
||||
|
||||
export function selectDatabaseList(data) {
|
||||
|
||||
// 新增数据接入基本信息
|
||||
export function addSource(data) {
|
||||
return request({
|
||||
url: '/source/source/selectDatabaseList',
|
||||
url: '/source/source/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//查询数据库下表名
|
||||
export function selectedDatabaseList(data) {
|
||||
return request({
|
||||
url: '/source/source/selectedDatabaseList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增数据源
|
||||
export function addDetabase(data) {
|
||||
return request({
|
||||
url: '/source/source',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改数据源
|
||||
export function updateDetabase(data) {
|
||||
// 修改数据接入基本信息
|
||||
export function updateSource(data) {
|
||||
return request({
|
||||
url: '/source/source/'+data.id,
|
||||
method: 'put',
|
||||
|
@ -61,10 +43,24 @@ export function updateDetabase(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 删除数据源
|
||||
export function delDetabase(id) {
|
||||
// 删除数据接入基本信息
|
||||
export function delSource(id) {
|
||||
return request({
|
||||
url: '/source/source/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function connectTest(id) {
|
||||
return request({
|
||||
url: '/source/source/connect?id=' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function synchronization(data) {
|
||||
return request({
|
||||
url: '/source/structure/'+data.id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -57,4 +57,4 @@ export function delMenu(menuId) {
|
|||
url: '/system/menu/' + menuId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
}
|
|
@ -9,27 +9,28 @@ export function listNotice(query) {
|
|||
})
|
||||
}
|
||||
|
||||
/*公告列表*/
|
||||
export function noticList() {
|
||||
export function updateAsUserDept(id) {
|
||||
return request({
|
||||
url: '/system/notice/noticList',
|
||||
url: '/system/userDept/UpdateAsUserDept?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
/*公告详情列表*/
|
||||
export function noticListDetail() {
|
||||
|
||||
export function getNum(id) {
|
||||
return request({
|
||||
url: '/system/notice/noticListDetail',
|
||||
url: '/system/userDept/GetNum?noticeId=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//阅读公告
|
||||
export function readNotic(noticeId) {
|
||||
|
||||
export function getNoticeList(data) {
|
||||
return request({
|
||||
url: '/system/notice/readNotic/?noticeId=' + noticeId,
|
||||
method: 'get'
|
||||
url: '/system/notice/GetNoticeList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询公告详细
|
||||
export function getNotice(noticeId) {
|
||||
return request({
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
||||
|
||||
<div class="right-menu">
|
||||
<el-badge :value="12" style="margin-right: 50px" class="item">
|
||||
<el-button size="mini" @click="drawer = true">公告</el-button>
|
||||
</el-badge>
|
||||
|
||||
<!-- <el-badge :value="messageTotal" class="item" style="margin-bottom: 25px;margin-right: 10px">-->
|
||||
<!-- <el-button size="small" @click="noticeTableList()">公告</el-button>-->
|
||||
<!-- </el-badge>-->
|
||||
<template v-if="device!=='mobile'">
|
||||
<i class="el-icon-message-solid" @click="noticeTableList"></i>
|
||||
<search id="header-search" class="right-menu-item"/>
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||
|
||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
||||
</el-tooltip>
|
||||
|
@ -39,63 +38,81 @@
|
|||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<el-drawer
|
||||
title="我是标题"
|
||||
:visible.sync="drawer"
|
||||
:with-header="false">
|
||||
<span>
|
||||
<el-tabs type="border-card">
|
||||
|
||||
<el-tab-pane>
|
||||
<el-card>
|
||||
<el-button @click="all">全部</el-button>
|
||||
<el-button @click="notice">通知</el-button>
|
||||
<el-button @click="announcementList">公告</el-button>
|
||||
</el-card>
|
||||
<el-button @click="readNotic">通知已读</el-button>
|
||||
<el-button @click="noReadNotic">通知未读</el-button>
|
||||
<el-button @click="announcementListReadNotic">公告已读</el-button>
|
||||
<el-button @click="announcementListNoReadNotic">公告未读</el-button>
|
||||
<el-descriptions class="margin-top" v-for="(notice, index) in inform" :title=notice.noticeTitle :column="3" border>
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="small" @click="readMessage(notice)">阅读消息</el-button>
|
||||
</template>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
消息发布时间
|
||||
</template>
|
||||
{{notice.createTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item style="width: 200px">
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
消息发布人
|
||||
</template>
|
||||
{{notice.createBy}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item >
|
||||
<template slot="label">
|
||||
<i class="el-icon-tickets"></i>
|
||||
当前状态
|
||||
</template>
|
||||
<el-tag size="small" v-if="notice.flag==='0'">未读</el-tag>
|
||||
<el-tag type="success" size="small" v-if="notice.flag==='1'">已读</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
消息类型
|
||||
</template>
|
||||
<el-tag size="small" v-if="notice.noticeType==='1'">通知</el-tag>
|
||||
<el-tag size="small" v-if="notice.noticeType==='2'">公告</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-dialog
|
||||
title="公告"
|
||||
:visible.sync="noticeTableVisible"
|
||||
width="50%">
|
||||
<el-radio-group v-model="form.noticeType" @change="getNoticeList">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="1">通知</el-radio-button>
|
||||
<el-radio-button label="2">公告</el-radio-button>
|
||||
</el-radio-group>
|
||||
<br> <br>
|
||||
<el-radio-group v-model="form.isRead" @change="getNoticeList">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">已读</el-radio-button>
|
||||
<el-radio-button label="1">未读</el-radio-button>
|
||||
</el-radio-group>
|
||||
<br><br><br>
|
||||
<el-card class="box-card" v-for="notice in noticeAttr">
|
||||
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>卡片名称</span>-->
|
||||
<!-- <el-button style="float: right">阅 读 消 息</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-for="o in 4" :key="o" class="text item">-->
|
||||
<!-- {{'列表内容 ' + o }}-->
|
||||
<!-- </div>-->
|
||||
<el-descriptions class="margin-top" :title="notice.noticeTitle" :column="2" :size="size" border>
|
||||
<template slot="extra">
|
||||
<el-button size="small" @click="readNotice(notice)">阅读消息</el-button>
|
||||
</template>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
消息发布时间
|
||||
</template>
|
||||
{{notice.createTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
消息发布人
|
||||
</template>
|
||||
{{notice.createBy}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-tickets"></i>
|
||||
消息类型
|
||||
</template>
|
||||
<dict-tag :options="dict.type.sys_notice_type" :value="notice.noticeType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
消息当前状态
|
||||
</template>
|
||||
<dict-tag :options="dict.type.is_read" :value="notice.isRead"/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="noticeTableVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="noticeTableVisible = false">确 定</el-button>
|
||||
</span>
|
||||
</el-drawer>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:title="noticeInfo.noticeTitle"
|
||||
:visible.sync="noticeVisble"
|
||||
width="30%">
|
||||
<editor v-model="noticeInfo.noticeContent" :min-height="192"/>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="noticeVisble = false">取 消</el-button>
|
||||
<el-button type="primary" @click="noticeVisble = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -107,15 +124,49 @@ import Hamburger from '@/components/Hamburger'
|
|||
import Screenfull from '@/components/Screenfull'
|
||||
import SizeSelect from '@/components/SizeSelect'
|
||||
import Search from '@/components/HeaderSearch'
|
||||
|
||||
import {getNoticeList, updateAsUserDept} from "@/api/system/notice";
|
||||
|
||||
export default {
|
||||
dicts: ['is_read', 'sys_notice_type'],
|
||||
data() {
|
||||
return {
|
||||
drawer: false,
|
||||
notic: [],
|
||||
/*通知*/
|
||||
inform: []
|
||||
noticeVisble: false,
|
||||
noticeInfo: {},
|
||||
noticeAttr: [
|
||||
{
|
||||
createTime: '',
|
||||
createBy: 'admin',
|
||||
noticeType: '1',
|
||||
isRead: '1',
|
||||
noticeTitle: '哈哈',
|
||||
noticeContent: '嘻嘻嘻嘻嘻',
|
||||
noticeId: 1,
|
||||
},
|
||||
{
|
||||
createTime: '',
|
||||
createBy: 'admin',
|
||||
noticeType: '2',
|
||||
isRead: '0',
|
||||
noticeTitle: '哈撒大大哈',
|
||||
noticeContent: '嘻嘻嘻嘻阿尽快嘻',
|
||||
noticeId: 2,
|
||||
},
|
||||
{
|
||||
createTime: '',
|
||||
createBy: 'admin',
|
||||
noticeType: '1',
|
||||
isRead: '0',
|
||||
noticeTitle: '哈哈是',
|
||||
noticeContent: '嘻嘻嘻萨达嘻嘻',
|
||||
noticeId: 3,
|
||||
}
|
||||
],
|
||||
form: {
|
||||
noticeType: '',
|
||||
isRead: ''
|
||||
},
|
||||
messageTotal: undefined,
|
||||
noticeTableVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -147,93 +198,25 @@ export default {
|
|||
get() {
|
||||
return this.$store.state.settings.topNav
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
created() {
|
||||
this.noticList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
/*全部*/
|
||||
all(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
this.inform.push(item)
|
||||
getNoticeList() {
|
||||
getNoticeList(this.form).then(res => {
|
||||
console.log(res)
|
||||
this.noticeAttr = res.data
|
||||
})
|
||||
},
|
||||
/*通知*/
|
||||
notice(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
if (item.noticeType === '1') {
|
||||
this.inform.push(item)
|
||||
}
|
||||
readNotice(row) {
|
||||
this.noticeInfo = row
|
||||
this.noticeVisble = true
|
||||
updateAsUserDept(row.id).then(res => {
|
||||
this.getNoticeList()
|
||||
})
|
||||
},
|
||||
/*通知已读*/
|
||||
readNotic(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
if (item.noticeType === '1' && item.flag == 1) {
|
||||
this.inform.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
/*公告已读*/
|
||||
announcementListReadNotic(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
if (item.noticeType === '2' && item.flag == 1) {
|
||||
this.inform.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
/*通知未读*/
|
||||
noReadNotic(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
if (item.noticeType === '1' && item.flag == 0) {
|
||||
this.inform.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
/*通知未读*/
|
||||
announcementListNoReadNotic(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
if (item.noticeType === '2' && item.flag == 0) {
|
||||
this.inform.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
/*公告*/
|
||||
announcementList(){
|
||||
this.inform = []
|
||||
this.notic.forEach(item => {
|
||||
if (item.noticeType === '2') {
|
||||
this.inform.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
/*阅读*/
|
||||
readMessage(notice){
|
||||
|
||||
readNotic(notice.noticeId).then(
|
||||
res=>{
|
||||
this. noticList()
|
||||
}
|
||||
)
|
||||
this.$router.push({ path: '/system/notice', query: { openDialog: 'true' ,noticeId: notice.noticeId} });
|
||||
},
|
||||
/*打开公告*/
|
||||
noticList() {
|
||||
noticList().then(
|
||||
res => {
|
||||
console.log(res)
|
||||
this.notic = res.data
|
||||
}
|
||||
)
|
||||
noticeTableList() {
|
||||
this.getNoticeList()
|
||||
this.noticeTableVisible = true
|
||||
},
|
||||
toggleSideBar() {
|
||||
this.$store.dispatch('app/toggleSideBar')
|
||||
|
@ -254,7 +237,6 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
height: 50px;
|
||||
|
@ -299,7 +281,6 @@ export default {
|
|||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
.right-menu-item {
|
||||
display: inline-block;
|
||||
padding: 0 8px;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
|
||||
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
||||
|
||||
<div :class="{'fixed-header':fixedHeader}">
|
||||
<navbar/>
|
||||
<tags-view v-if="needTagsView"/>
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
import Cookies from 'js-cookie'
|
||||
import request from "@/utils/request";
|
||||
|
||||
const TokenKey = 'Admin-Token'
|
||||
|
||||
const ExpiresInKey = 'Admin-Expires-In'
|
||||
|
||||
|
||||
|
||||
export function getToken() {
|
||||
return Cookies.get(TokenKey)
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ service.interceptors.request.use(config => {
|
|||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
|
||||
debugger
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
|
|
|
@ -80,7 +80,7 @@ export default {
|
|||
},
|
||||
loginRules: {
|
||||
username: [
|
||||
{required: true, trigger: "blur", message: "请输入您的账号"}
|
||||
{required: true, trigger: "blur", message: "请输入您的账号/邮箱"}
|
||||
],
|
||||
password: [
|
||||
{required: true, trigger: "blur", message: "请输入您的密码"}
|
||||
|
|
|
@ -77,8 +77,7 @@ export default {
|
|||
// 查询参数
|
||||
queryParams: {
|
||||
ipaddr: undefined,
|
||||
userName: undefined,
|
||||
name:undefined,
|
||||
userName: undefined
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -114,8 +113,7 @@ export default {
|
|||
this.$modal.msgSuccess("强退成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="接入源名称" prop="name">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
|
||||
<el-form-item label="接入源名称" prop="sourceName">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
v-model="queryParams.sourceName"
|
||||
placeholder="请输入接入源名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
@ -17,14 +17,6 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主机地址" prop="host">
|
||||
<el-input
|
||||
v-model="queryParams.host"
|
||||
placeholder="请输入主机地址"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据库名称" prop="databaseName">
|
||||
<el-input
|
||||
v-model="queryParams.databaseName"
|
||||
|
@ -33,46 +25,6 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据连接参数" prop="connectionParam">
|
||||
<el-input
|
||||
v-model="queryParams.connectionParam"
|
||||
placeholder="请输入数据连接参数"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="初始连接数量" prop="initNum">
|
||||
<el-input
|
||||
v-model="queryParams.initNum"
|
||||
placeholder="请输入初始连接数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大连接数量" prop="maxNum">
|
||||
<el-input
|
||||
v-model="queryParams.maxNum"
|
||||
placeholder="请输入最大连接数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大等待时间" prop="maxWaitTime">
|
||||
<el-input
|
||||
v-model="queryParams.maxWaitTime"
|
||||
placeholder="请输入最大等待时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大等待次数" prop="maxWaitSize">
|
||||
<el-input
|
||||
v-model="queryParams.maxWaitSize"
|
||||
placeholder="请输入最大等待次数"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -125,32 +77,29 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="detabaseList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="accessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="数据源密码" align="center" prop="id" />
|
||||
<el-table-column label="接入源名称" align="center" prop="name" />
|
||||
<el-table-column label="接入源名称" align="center" prop="sourceName" />
|
||||
<el-table-column label="数据来源系统名称" align="center" prop="systemName" />
|
||||
<el-table-column label="主机地址" align="center" prop="host" />
|
||||
<el-table-column label="主机端口" align="center" prop="port" />
|
||||
<el-table-column label="用户名" align="center" prop="username" />
|
||||
<el-table-column label="用户密码" align="center" prop="password" />
|
||||
<el-table-column label="数据接入类型" align="center" prop="type" />
|
||||
<el-table-column label="主机地址" align="center" prop="hostAddress" />
|
||||
<el-table-column label="主机端口" align="center" prop="hostNumber" />
|
||||
<el-table-column label="数据接入类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<template v-if="scope.row.accessId === 1">MySql</template>
|
||||
<template v-else-if="scope.row.accessId === 2">Oracle</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据库名称" align="center" prop="databaseName" />
|
||||
<el-table-column label="数据连接参数" align="center" prop="connectionParam" />
|
||||
<el-table-column label="初始连接数量" align="center" prop="initNum" />
|
||||
<el-table-column label="最大连接数量" align="center" prop="maxNum" />
|
||||
<el-table-column label="最大等待时间" align="center" prop="maxWaitTime" />
|
||||
<el-table-column label="最大等待次数" align="center" prop="maxWaitSize" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="testContest(scope.row)"
|
||||
v-hasPermi="['source:source:testConnection']"
|
||||
>测试连接</el-button>
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-connection"
|
||||
@click="syncAssetsStructure(scope.row)"
|
||||
v-hasPermi="['source:structure:synchronization']"
|
||||
>同步资产结构</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -158,6 +107,14 @@
|
|||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['source:source:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="connect(scope.row)"
|
||||
v-hasPermi="['source:source:connect']"
|
||||
|
||||
>测试连接</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -177,7 +134,7 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改数据源对话框 -->
|
||||
<!-- 添加或修改数据接入对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||
<el-card>
|
||||
|
@ -187,7 +144,7 @@
|
|||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="接入源名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入接入源名称" />
|
||||
<el-input v-model="form.sourceName" placeholder="请输入接入源名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
|
@ -196,50 +153,34 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row >
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="form.username" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入用户密码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="主机地址" prop="host">
|
||||
<el-input v-model="form.host" placeholder="请输入主机地址" />
|
||||
<el-input v-model="form.hostAddress" placeholder="请输入主机地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="主机端口" prop="port">
|
||||
<el-input v-model="form.port" placeholder="请输入主机端口" />
|
||||
<el-input v-model="form.hostNumber" placeholder="请输入主机地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="数据接入类型" prop="type">
|
||||
<el-select style="width: 100%" v-model="form.type">
|
||||
<el-option label="MySql" value="MySql">MySql</el-option>
|
||||
<el-option label="Oracle" value="Oracle">Oracle</el-option>
|
||||
<el-select style="width: 100%" v-model="form.accessId">
|
||||
<el-option
|
||||
v-for="item in type"
|
||||
:key="item.id"
|
||||
:label="item.accessName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="数据库名称" prop="databaseName">
|
||||
<el-select v-model="form.databaseName" placeholder="请选择数据库名称">
|
||||
<el-option
|
||||
v-for="item in databaseList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
{{item}}
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input v-model="form.databaseName" placeholder="请输入数据库名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -250,7 +191,7 @@
|
|||
</div>
|
||||
<el-col :sm="24">
|
||||
<el-form-item label="数据连接参数" prop="connectionParam">
|
||||
<el-input v-model="form.connectionParam" placeholder="请输入内容" />
|
||||
<el-input v-model="form.connectionParameters" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row :gutter="10" style="margin: 10px 0">
|
||||
|
@ -285,24 +226,24 @@
|
|||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="初始连接数量" prop="initNum">
|
||||
<el-input v-model="form.initNum" placeholder="请输入初始连接数量" />
|
||||
<el-input v-model="form.initialize" placeholder="请输入初始连接数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="最大连接数量" prop="maxNum">
|
||||
<el-input v-model="form.maxNum" placeholder="请输入最大连接数量" />
|
||||
<el-input v-model="form.maxInitialize" placeholder="请输入最大连接数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="最大等待时间" prop="maxWaitTime">
|
||||
<el-input v-model="form.maxWaitTime" placeholder="请输入最大等待时间" />
|
||||
<el-input v-model="form.maxWaitingTime" placeholder="请输入最大等待时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="最大等待次数" prop="maxWaitSize">
|
||||
<el-input v-model="form.maxWaitSize" placeholder="请输入最大等待次数" />
|
||||
<el-input v-model="form.maxIsoFrequency" placeholder="请输入最大等待次数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -326,17 +267,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listDetabase,
|
||||
getDetabase,
|
||||
delDetabase,
|
||||
addDetabase,
|
||||
updateDetabase,
|
||||
testConnection, selectDatabaseList
|
||||
} from "@/api/source/source";
|
||||
import {listSource, getSource, delSource, addSource, updateSource, typeList, connectTest, synchronization} from "@/api/source/source";
|
||||
|
||||
export default {
|
||||
name: "source",
|
||||
name: "Source",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -351,8 +285,8 @@ export default {
|
|||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 数据源表格数据
|
||||
detabaseList: [],
|
||||
// 数据接入基本信息表格数据
|
||||
accessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
@ -361,99 +295,113 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
sourceName: null,
|
||||
systemName: null,
|
||||
host: null,
|
||||
type: null,
|
||||
databaseName: null,
|
||||
connectionParam: null,
|
||||
initNum: null,
|
||||
maxNum: null,
|
||||
maxWaitTime: null,
|
||||
maxWaitSize: null,
|
||||
databaseName: null
|
||||
},
|
||||
type:[],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "数据源密码不能为空", trigger: "blur" }
|
||||
sourceName: [
|
||||
{required: true, message: "接入源名称不能为空", trigger: "blur"}
|
||||
],
|
||||
systemName: [
|
||||
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
|
||||
],
|
||||
accessId: [
|
||||
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
|
||||
],
|
||||
hostAddress: [
|
||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||
],
|
||||
hostNumber: [
|
||||
{required: true, message: "主键端口号不能为空", trigger: "blur"}
|
||||
],
|
||||
databaseName: [
|
||||
{required: true, message: "数据库名称不能为空", trigger: "blur"}
|
||||
],
|
||||
connectionParameters: [
|
||||
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
|
||||
],
|
||||
initialize: [
|
||||
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
||||
],
|
||||
maxInitialize: [
|
||||
{required: true, message: "最大连接数量不能为空", trigger: "blur"}
|
||||
],
|
||||
maxWaitingTime: [
|
||||
{required: true, message: "最大等待时间不能为空", trigger: "blur"}
|
||||
],
|
||||
maxIsoFrequency: [
|
||||
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
dataSourceParamList: [
|
||||
{
|
||||
name: null,
|
||||
val: null
|
||||
}
|
||||
],
|
||||
/*数据库名称列表*/
|
||||
databaseList:[]
|
||||
]
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
"form.type":{
|
||||
handler(){
|
||||
this.checkDatabaseList();
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.processParam()
|
||||
},
|
||||
methods: {
|
||||
/*监测*/
|
||||
checkDatabaseList(){
|
||||
if( this.form.username && this.form.password && this.form.host && this.form.type){
|
||||
let databaseConnect={};
|
||||
databaseConnect.username=this.form.username;
|
||||
databaseConnect.password=this.form.password;
|
||||
databaseConnect.host=this.form.host;
|
||||
databaseConnect.type=this.form.type;
|
||||
console.log(databaseConnect)
|
||||
selectDatabaseList(databaseConnect).then(
|
||||
res=>{
|
||||
console.log(res.data)
|
||||
this.databaseList=res.data
|
||||
}
|
||||
)
|
||||
}
|
||||
syncAssetsStructure(row){
|
||||
console.log(row)
|
||||
synchronization(row).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
// 新增参数
|
||||
//测试连接
|
||||
connect(row){
|
||||
connectTest(row.id).then(res=>{
|
||||
if (res.code == 200) {
|
||||
this.$message.success(res.data)
|
||||
}else {
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加参数
|
||||
addParam(){
|
||||
this.dataSourceParamList.push({
|
||||
name: null,
|
||||
val: null
|
||||
})
|
||||
},
|
||||
//删除参数
|
||||
// 删除参数
|
||||
deleteParam(index){
|
||||
console.log(index)
|
||||
if(index==null){
|
||||
this.dataSourceParamList=[]
|
||||
}else{
|
||||
this.dataSourceParamList.splice(index,1)
|
||||
if (index != null){
|
||||
this.dataSourceParamList.splice(index, 1);
|
||||
}else {
|
||||
this.dataSourceParamList = []
|
||||
}
|
||||
this.processParam()
|
||||
this.processParam();
|
||||
},
|
||||
// 处理参数
|
||||
processParam(){
|
||||
this.form.connectionParam=this.dataSourceParamList
|
||||
.filter(item=>item.name!=null || item.val!=null)
|
||||
.map(item=>{
|
||||
return item.name+"="+item.val
|
||||
this.form.connectionParameters = this.dataSourceParamList
|
||||
.filter(item => item.name != null || item.val != null)
|
||||
.map(item => {
|
||||
return item.name + "=" + item.val;
|
||||
}).join("&")
|
||||
console.log(this.form.connectionParam)
|
||||
console.log(this.form.connectionParameters)
|
||||
},
|
||||
/** 查询数据源列表 */
|
||||
/** 查询数据接入基本信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDetabase(this.queryParams).then(response => {
|
||||
this.detabaseList = response.data.rows;
|
||||
listSource(this.queryParams).then(response => {
|
||||
this.accessList = response.data.rows;
|
||||
console.log(this.accessList)
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
typeList().then(res=>{
|
||||
this.type=res.data
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
@ -464,16 +412,17 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
sourceName: null,
|
||||
systemName: null,
|
||||
host: null,
|
||||
type: null,
|
||||
hostAddress: null,
|
||||
hostNumber: null,
|
||||
accessId: null,
|
||||
connectionParameters: null,
|
||||
initialize: 5,
|
||||
maxInitialize: 20,
|
||||
maxWaitingTime: 3000,
|
||||
maxIsoFrequency: 3,
|
||||
databaseName: null,
|
||||
connectionParam: null,
|
||||
initNum: null,
|
||||
maxNum: null,
|
||||
maxWaitTime: null,
|
||||
maxWaitSize: null,
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
|
@ -502,46 +451,25 @@ export default {
|
|||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加数据源";
|
||||
},
|
||||
/*测试连接*/
|
||||
testContest(row){
|
||||
let params = {}
|
||||
params.host=row.host
|
||||
params.port=row.port
|
||||
params.username=row.username
|
||||
params.password=row.password
|
||||
params.connectionParam=row.connectionParam
|
||||
params.databaseName=row.databaseName
|
||||
params.type=row.type
|
||||
console.log(params)
|
||||
testConnection(params).then(
|
||||
res=>{
|
||||
if (res.code == 200) {
|
||||
this.$message.success(res.data)
|
||||
}else {
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
}
|
||||
)
|
||||
this.title = "添加数据接入基本信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate: function (row) {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.form = row
|
||||
this.dataSourceParamList = [];
|
||||
this.form.connectionParam.split("&").forEach(param => {
|
||||
var split = param.split("=");
|
||||
this.dataSourceParamList.push({
|
||||
name: split[0],
|
||||
val: split[1]
|
||||
})
|
||||
})
|
||||
const id = row.id || this.ids
|
||||
getDetabase(id).then(response => {
|
||||
this.form = row;
|
||||
this.dataSourceParamList = [];
|
||||
getSource(id).then(response => {
|
||||
this.form.connectionParameters.split("&").forEach(param => {
|
||||
let paramArr = param.split("=");
|
||||
this.dataSourceParamList.push({
|
||||
name: paramArr[0],
|
||||
val: paramArr[1]
|
||||
})
|
||||
})
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改数据源";
|
||||
this.title = "修改数据接入基本信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
@ -549,13 +477,14 @@ export default {
|
|||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateDetabase(this.form).then(response => {
|
||||
updateSource(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addDetabase(this.form).then(response => {
|
||||
|
||||
addSource(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
@ -567,8 +496,8 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据源编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delDetabase(ids);
|
||||
this.$modal.confirm('是否确认删除数据接入基本信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delSource(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
@ -578,7 +507,7 @@ export default {
|
|||
handleExport() {
|
||||
this.download('source/source/export', {
|
||||
...this.queryParams
|
||||
}, `source${new Date().getTime()}.xlsx`)
|
||||
}, `source_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,246 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-container style="height: 80%; border: 1px solid #eee">
|
||||
<el-aside width="400px" style="background-color: rgb(238, 241, 246)">
|
||||
<el-menu @select="handleSelectdata">
|
||||
<el-submenu
|
||||
v-for="(item, index) in menuList"
|
||||
:key="index"
|
||||
:index="item.id"
|
||||
>
|
||||
<span slot="title" @click="handSubmenuTitle(item)">{{ item.name }}</span>
|
||||
<el-menu-item
|
||||
v-for="(database, dbIndex) in item.databaseList"
|
||||
:key="dbIndex"
|
||||
:index="item.id + '-' + (dbIndex + 1)"
|
||||
class="custom-menu-item"
|
||||
>
|
||||
<span>{{ database}}</span>
|
||||
<el-select
|
||||
clearable
|
||||
v-model="select[dbIndex]"
|
||||
style="margin-left: 10px"
|
||||
class="custom-select"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
{{item}}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
|
||||
<el-container>
|
||||
<el-main>
|
||||
<el-card style="height: 500px">
|
||||
<el-container>
|
||||
<el-header style="height: 200px">
|
||||
<h1 style=" margin-top: -2px; font-size: 50px; text-align: center; width: 100%; font-weight: 600; line-height: 100px ">{{title}}--资产结构概述</h1>
|
||||
|
||||
<el-row style="margin-top: -50px" justify="center">
|
||||
<el-col :span="12">
|
||||
<el-card style="width: 80%;" class="centered-card"></el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card style="width: 80%;" class="centered-card"></el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-header>
|
||||
<el-container>
|
||||
<el-aside width="200px">Aside</el-aside>
|
||||
<el-container>
|
||||
<el-main>Main</el-main>
|
||||
<el-footer>Footer</el-footer>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</el-container>
|
||||
<textarea v-model="selectSqlResp.sql" style="height: 400px;width: 100%">
|
||||
|
||||
</textarea>
|
||||
<el-button type="primary" @click="selectSql">查询</el-button>
|
||||
</el-card>
|
||||
<el-card style="height: 100%">
|
||||
|
||||
</el-card>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
listDetabase,
|
||||
selectDatabaseList,
|
||||
selectedDatabase,
|
||||
selectedDatabaseList,
|
||||
selectedMenu
|
||||
} from "@/api/source/source";
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
data() {
|
||||
const item = {
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄'
|
||||
};
|
||||
return {
|
||||
tableData: Array(20).fill(item),
|
||||
menuList:[
|
||||
|
||||
],
|
||||
/*数据源查询条件*/
|
||||
queryParams: {},
|
||||
databaseList:[],
|
||||
tableList:[],
|
||||
select:[],
|
||||
selectSqlResp:{},
|
||||
title:''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
watch:{
|
||||
"select":{
|
||||
handler(val){
|
||||
val.forEach(item=>{
|
||||
if(item){
|
||||
this.selectSqlResp.tableName=item
|
||||
}
|
||||
})
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectSql(){
|
||||
console.log(this.selectSqlResp)
|
||||
},
|
||||
/*选中标题*/
|
||||
handSubmenuTitle(item){
|
||||
this.title=item.name
|
||||
let databaseConnect={};
|
||||
item.databaseList=[]
|
||||
databaseConnect.username=item.username;
|
||||
databaseConnect.password=item.password;
|
||||
databaseConnect.host=item.host;
|
||||
databaseConnect.type=item.type;
|
||||
selectDatabaseList(databaseConnect).then(
|
||||
res=>{
|
||||
/*所有数据库*/
|
||||
//item.databaseList=res.data
|
||||
res.data.forEach(item1=>{
|
||||
if(item1==item.databaseName){
|
||||
item.databaseList.push(item1)
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
console.log(item)
|
||||
},
|
||||
/*选中下拉*/
|
||||
handleSelectdata(key){
|
||||
console.log(key)
|
||||
const [menuId, databaseIndex] = key.split('-').map(Number);
|
||||
console.log(menuId, databaseIndex)
|
||||
const selectedMenu = this.menuList.find(item => item.id == menuId);
|
||||
console.log(selectedMenu)
|
||||
if (selectedMenu) {
|
||||
const selectedDatabase = selectedMenu.databaseList[databaseIndex - 1];
|
||||
console.log(selectedDatabase);
|
||||
//根据selectedDatabase 名字 找下面包含的表
|
||||
let databaseConnect={};
|
||||
databaseConnect.username=selectedMenu.username;
|
||||
databaseConnect.password=selectedMenu.password;
|
||||
databaseConnect.host=selectedMenu.host;
|
||||
databaseConnect.port=selectedMenu.port;
|
||||
databaseConnect.type=selectedMenu.type;
|
||||
databaseConnect.tableName=selectedDatabase
|
||||
|
||||
console.log(databaseConnect)
|
||||
selectedDatabaseList(databaseConnect).then(
|
||||
res=>{
|
||||
this.tableList=res.data
|
||||
console.log(res.data)
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
/** 查询数据源列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDetabase(this.queryParams).then(response => {
|
||||
const menuListWithStringIds = response.data.rows.map(item => ({
|
||||
...item, // 复制对象的其他属性
|
||||
id: String(item.id),
|
||||
name: item.name,
|
||||
host: item.host,
|
||||
port: item.port,
|
||||
username: item.username,
|
||||
password: item.password,
|
||||
type: item.type,
|
||||
connectionParam: item.connectionParam,
|
||||
databaseName: item.databaseName,
|
||||
databaseList:[
|
||||
|
||||
]
|
||||
}));
|
||||
|
||||
this.menuList=menuListWithStringIds
|
||||
console.log(this.menuList)
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.centered-card {
|
||||
display: flex;
|
||||
justify-content: center; /* 水平居中 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
flex-direction: column; /* 如果需要垂直堆叠内容 */
|
||||
}
|
||||
|
||||
.el-header {
|
||||
background-color: #B3C0D1;
|
||||
color: #333;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.el-aside {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.custom-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.custom-select {
|
||||
margin-left: 10px; /* 根据需要调整间距 */
|
||||
}
|
||||
|
||||
.el-header, .el-footer {
|
||||
background-color: white;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
|
||||
.el-main {
|
||||
background-color: #E9EEF3;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
line-height: 160px;
|
||||
}
|
||||
</style>
|
|
@ -234,7 +234,9 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listDept(this.queryParams).then(response => {
|
||||
console.log(response.data)
|
||||
this.deptList = this.handleTree(response.data, "deptId");
|
||||
console.log(this.deptList)
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -311,7 +311,6 @@ export default {
|
|||
refreshTable: true,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
parentId: 0,
|
||||
menuName: undefined,
|
||||
visible: undefined
|
||||
},
|
||||
|
@ -343,7 +342,6 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listMenu(this.queryParams).then(response => {
|
||||
console.log(response)
|
||||
this.menuList = this.handleTree(response.data, "menuId");
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
|
@ -100,11 +100,12 @@
|
|||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
icon="el-icon-search"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="noticDetail(scope.row)"
|
||||
>查看详情
|
||||
@click="noticeDetails(scope.row.noticeId)"
|
||||
>通知详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
|
@ -135,17 +136,17 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="780px" class="dialog" >
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="780px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
<el-input :disabled="isTitleDisabled" v-model="form.noticeTitle" placeholder="请输入公告标题"/>
|
||||
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告类型" prop="noticeType">
|
||||
<el-select :disabled="isTitleDisabled" v-model="form.noticeType" placeholder="请选择公告类型">
|
||||
<el-select v-model="form.noticeType" placeholder="请选择公告类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_notice_type"
|
||||
:key="dict.value"
|
||||
|
@ -155,9 +156,20 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-show="form.noticeType == 2">
|
||||
<span style="margin-right: 15px;margin-left: 10px"><b>公告时间</b></span>
|
||||
<el-date-picker
|
||||
v-model="form.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group :disabled="isTitleDisabled" v-model="form.status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_notice_status"
|
||||
:key="dict.value"
|
||||
|
@ -167,124 +179,96 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.noticeType==='2' && title !== '公告详情'">
|
||||
<el-form-item label="公告时间">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
-
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容">
|
||||
<editor v-model="form.noticeContent" :min-height="50"/>
|
||||
<editor v-model="form.noticeContent" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.noticeType==='1' && title !== '公告详情'">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="通知人员">
|
||||
<div class="block">
|
||||
<el-cascader
|
||||
placeholder="试试搜索:指南"
|
||||
:options="dept"
|
||||
value="id"
|
||||
show-all-levels:true
|
||||
@change="handleChange"
|
||||
:props="{ multiple: true }"
|
||||
filterable></el-cascader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="cities.length>0">
|
||||
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
|
||||
</el-checkbox>
|
||||
<div style="margin: 15px 0;"></div>
|
||||
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
|
||||
<el-checkbox v-for="city in cities"
|
||||
:label="city"
|
||||
:key="city"
|
||||
:value="city">
|
||||
{{ city }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if=" title === '公告详情'">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<div>
|
||||
<el-statistic title="总通知">
|
||||
<template slot="formatter">
|
||||
{{ read.totalNum }}
|
||||
</template>
|
||||
</el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div>
|
||||
<el-statistic title="已阅读">
|
||||
<template slot="formatter">
|
||||
{{ read.readEd }}
|
||||
</template>
|
||||
</el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div>
|
||||
<el-statistic title="未阅读">
|
||||
<template slot="formatter">
|
||||
{{ read.noRead }}
|
||||
</template>
|
||||
</el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
<el-tabs v-show="form.noticeType == 1" v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="部门" name="section">
|
||||
{{ form.sectionList }}
|
||||
<el-cascader
|
||||
v-model="form.sectionList"
|
||||
:options="options1"
|
||||
:props="props"
|
||||
style="width: 350px"
|
||||
clearable>
|
||||
</el-cascader>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="特定人员" name="personnel">
|
||||
{{ form.personnelList }}
|
||||
<el-select v-model="form.personnelList" multiple placeholder="请选择特定人员">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.userId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="通知详情"
|
||||
:visible.sync="numVisable"
|
||||
width="40%">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<div>
|
||||
<el-statistic
|
||||
:value="asUserDeptNum.num"
|
||||
title="总共通知数量"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div>
|
||||
<el-statistic
|
||||
:value="asUserDeptNum.readNum"
|
||||
title="已阅读通知数量"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div>
|
||||
<el-statistic
|
||||
:value="asUserDeptNum.noReadNum"
|
||||
title="未阅读通知数量"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="numVisable = false">取 消</el-button>
|
||||
<el-button type="primary" @click="numVisable = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addNotice,
|
||||
delNotice,
|
||||
getNotice,
|
||||
listNotice,
|
||||
noticList,
|
||||
noticListDetail,
|
||||
updateNotice
|
||||
} from "@/api/system/notice";
|
||||
import {addNotice, delNotice, getNotice, getNum, listNotice, updateNotice} from "@/api/system/notice";
|
||||
import {listDept} from "@/api/system/dept";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {listPost} from "@/api/system/post";
|
||||
|
||||
const cityOptions = ['上海', '北京', '广州', '深圳'];
|
||||
export default {
|
||||
name: "Notice",
|
||||
dicts: ['sys_notice_status', 'sys_notice_type'],
|
||||
data() {
|
||||
return {
|
||||
sectionList:[],
|
||||
personnelList:[],
|
||||
props: { multiple: true },
|
||||
options1: [],
|
||||
options: [],
|
||||
activeName: '部门',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -311,17 +295,15 @@ export default {
|
|||
createBy: undefined,
|
||||
status: undefined
|
||||
},
|
||||
queryParam: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
userNames: "",
|
||||
createBy: "",
|
||||
},
|
||||
/*阅读量*/
|
||||
read:{
|
||||
totalNum: 2,
|
||||
readEd: 2,
|
||||
noRead: 2,
|
||||
},
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
noticeTitle: [
|
||||
|
@ -331,145 +313,34 @@ export default {
|
|||
{required: true, message: "公告类型不能为空", trigger: "change"}
|
||||
]
|
||||
},
|
||||
dept: [],
|
||||
//多选
|
||||
options: [],
|
||||
/*用户查询参数*/
|
||||
userListFind: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
deptId: undefined
|
||||
},
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
/*多选*/
|
||||
checkAll: false,
|
||||
checkedCities: [],
|
||||
cities: [],
|
||||
isIndeterminate: true,
|
||||
/*详情*/
|
||||
noticDetail(row) {
|
||||
/*公告已阅读*/
|
||||
noticListDetail().then(
|
||||
res => {
|
||||
res.data.forEach(item => {
|
||||
if(item.noticeId === row.noticeId){
|
||||
this.read.readEd=item.readNum;
|
||||
this.read.totalNum=item.totalNum;
|
||||
this.read.noRead=item.totalNum-item.readNum;
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
this.reset();
|
||||
const noticeId = row.noticeId || this.ids
|
||||
getNotice(noticeId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "公告详情";
|
||||
});
|
||||
|
||||
}
|
||||
asUserDeptNum: {},
|
||||
numVisable: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDeptList();
|
||||
const shouldOpenDialog = this.$route.query.openDialog === 'true';
|
||||
const noticeId = this.$route.query.noticeId
|
||||
if (shouldOpenDialog) {
|
||||
/*公告已阅读*/
|
||||
noticListDetail().then(
|
||||
res => {
|
||||
res.data.forEach(item => {
|
||||
if(item.noticeId ===noticeId){
|
||||
this.read.readEd=item.readNum;
|
||||
this.read.totalNum=item.totalNum;
|
||||
this.read.noRead=item.totalNum-item.readNum;
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
this.reset();
|
||||
getNotice(noticeId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "公告详情";
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
isTitleDisabled() {
|
||||
return this.title === '公告详情';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
/*多选框*/
|
||||
handleCheckAllChange(val) {
|
||||
this.checkedCities = val ? this.cities : [];
|
||||
this.isIndeterminate = false;
|
||||
},
|
||||
handleCheckedCitiesChange(value) {
|
||||
let userNames = "";
|
||||
let checkedCount = value.length;
|
||||
this.checkAll = checkedCount === this.cities.length;
|
||||
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
|
||||
userNames += "," + value + ",";
|
||||
//去掉最后一个,号
|
||||
userNames = userNames.substring(1, userNames.length - 1);
|
||||
this.form.userNames = userNames;
|
||||
|
||||
},
|
||||
getDeptList() {
|
||||
this.loading = true;
|
||||
listDept(this.queryParams).then(response => {
|
||||
this.options = this.handleTree(response.data, "deptId");
|
||||
// 递归函数,用于转换children的格式
|
||||
function convertChildren(item) {
|
||||
return {
|
||||
id: item.deptId,
|
||||
value: item.deptId,
|
||||
label: item.deptName,
|
||||
children: item.children && item.children.length > 0? item.children.map(convertChildren) : undefined
|
||||
};
|
||||
}
|
||||
|
||||
// 转换整个options数组
|
||||
const data = this.options.map(convertChildren);
|
||||
this.dept = data;
|
||||
noticeDetails(noticeId) {
|
||||
this.numVisable = true
|
||||
getNum(noticeId).then(res => {
|
||||
this.asUserDeptNum = res.data
|
||||
})
|
||||
},
|
||||
/*选中特定人员tab框*/
|
||||
handleChange(val) {
|
||||
const userList1 = [];
|
||||
console.log(val)
|
||||
const lastNumbers = val.map(array => {
|
||||
// 过滤掉 Observer 对象,只保留数字
|
||||
const filteredArray = array.filter(item => typeof item === 'number');
|
||||
// 获取最后一个数字
|
||||
return filteredArray[filteredArray.length - 1];
|
||||
});
|
||||
const promises = lastNumbers.map(item => {
|
||||
this.userListFind.deptId = item;
|
||||
return listUser(this.addDateRange(this.userListFind, this.dateRange)).then(response => {
|
||||
console.log(response)
|
||||
if (response.data.rows.length > 0) {
|
||||
response.data.rows.forEach(item => {
|
||||
userList1.push(
|
||||
item.userName
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this.cities = userList1;
|
||||
|
||||
//部门递归
|
||||
recursion(data) {
|
||||
data.forEach(da => {
|
||||
this.$set(da, 'value', da.deptId);
|
||||
delete da.deptId;
|
||||
this.$set(da, 'label', da.deptName);
|
||||
delete da.deptName;
|
||||
if (da.children){
|
||||
this.recursion(da.children)
|
||||
}
|
||||
})
|
||||
},
|
||||
//tab选择
|
||||
handleClick(tab, event) {
|
||||
|
||||
},
|
||||
/** 查询公告列表 */
|
||||
|
@ -493,7 +364,9 @@ export default {
|
|||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0"
|
||||
status: "0",
|
||||
sectionList:[],
|
||||
personnelList:[]
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -518,6 +391,24 @@ export default {
|
|||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加公告";
|
||||
listDept(this.queryParam).then(response => {
|
||||
this.options1 = this.handleTree(response.data, "deptId");
|
||||
console.log(this.options1)
|
||||
this.options1.forEach(op => {
|
||||
this.$set(op, 'value', op.deptId);
|
||||
delete op.deptId;
|
||||
this.$set(op, 'label', op.deptName);
|
||||
delete op.deptName;
|
||||
if (op.children){
|
||||
this.recursion(op.children)
|
||||
}
|
||||
})
|
||||
this.loading = false;
|
||||
})
|
||||
listUser(this.addDateRange(this.queryParams, [])).then(response => {
|
||||
this.options = response.data.rows;
|
||||
console.log(this.options)
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
@ -540,7 +431,6 @@ export default {
|
|||
this.getList();
|
||||
});
|
||||
} else {
|
||||
console.log(this.form)
|
||||
addNotice(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
|
@ -564,4 +454,3 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -372,9 +372,10 @@ import {
|
|||
updateUser
|
||||
} from "@/api/system/user";
|
||||
import {getToken} from "@/utils/auth";
|
||||
|
||||
import {forceLogout, list} from "@/api/monitor/online";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {findTokenId, forceLogout} from "@/api/monitor/online";
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
|
@ -382,6 +383,10 @@ export default {
|
|||
components: {Treeselect},
|
||||
data() {
|
||||
return {
|
||||
queryParam:{
|
||||
ipaddr: undefined,
|
||||
userName: undefined
|
||||
},
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -479,12 +484,6 @@ export default {
|
|||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
/*强退*/
|
||||
tokenParams: {
|
||||
ipaddr: undefined,
|
||||
userName: undefined,
|
||||
name:undefined,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -558,7 +557,7 @@ export default {
|
|||
status: "0",
|
||||
remark: undefined,
|
||||
postIds: [],
|
||||
roleIds: [],
|
||||
roleIds: []
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -622,15 +621,6 @@ export default {
|
|||
},
|
||||
/** 重置密码按钮操作 */
|
||||
handleResetPwd(row) {
|
||||
let tokenId="";
|
||||
this.tokenParams.name=row.userName
|
||||
findTokenId(this.tokenParams).then(
|
||||
res=>{
|
||||
console.log(res.data)
|
||||
tokenId=res.data
|
||||
}
|
||||
)
|
||||
|
||||
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
@ -640,10 +630,15 @@ export default {
|
|||
}).then(({value}) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
if(tokenId!==""){
|
||||
forceLogout(tokenId)
|
||||
}
|
||||
|
||||
list(this.queryParam).then(res=>{
|
||||
const userList = res.data.rows
|
||||
userList.forEach(userInfo=>{
|
||||
if (userInfo.userName==row.userName){
|
||||
forceLogout(userInfo.tokenId)
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
|
|
|
@ -182,6 +182,7 @@ export default {
|
|||
submitForm() {
|
||||
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
||||
const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
||||
|
||||
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
|
||||
const validateResult = res.data.every(item => !!item);
|
||||
if (validateResult) {
|
||||
|
|
Loading…
Reference in New Issue