Compare commits
No commits in common. "main" and "etl-ui" have entirely different histories.
|
@ -28,7 +28,6 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
|
||||||
if (report) {
|
if (report) {
|
||||||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
run(`vue-cli-service build ${args}`)
|
run(`vue-cli-service build ${args}`)
|
||||||
|
|
|
@ -16,3 +16,11 @@ export function forceLogout(tokenId) {
|
||||||
method: 'delete'
|
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'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询数据接入基本信息列表
|
// 查询数据源列表
|
||||||
export function listSource(query) {
|
export function listDetabase(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/source/source/list',
|
url: '/source/source/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -9,33 +9,51 @@ export function listSource(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询数据接入基本信息详细
|
// 查询数据源详细
|
||||||
export function getSource(id) {
|
export function getDetabase(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/source/source/' + id,
|
url: '/source/source/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//测试数据库连接
|
||||||
export function typeList() {
|
export function testConnection(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/source/type/typeList',
|
url: '/source/source/testConnection/',
|
||||||
method: 'get'
|
method: 'post',
|
||||||
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//查询数据库名称
|
||||||
|
|
||||||
|
export function selectDatabaseList(data) {
|
||||||
// 新增数据接入基本信息
|
|
||||||
export function addSource(data) {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/source/source/add',
|
url: '/source/source/selectDatabaseList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改数据接入基本信息
|
//查询数据库下表名
|
||||||
export function updateSource(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) {
|
||||||
return request({
|
return request({
|
||||||
url: '/source/source/'+data.id,
|
url: '/source/source/'+data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
@ -43,24 +61,10 @@ export function updateSource(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除数据接入基本信息
|
// 删除数据源
|
||||||
export function delSource(id) {
|
export function delDetabase(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/source/source/' + id,
|
url: '/source/source/' + id,
|
||||||
method: 'delete'
|
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,
|
url: '/system/menu/' + menuId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,28 +9,27 @@ export function listNotice(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateAsUserDept(id) {
|
/*公告列表*/
|
||||||
|
export function noticList() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/userDept/UpdateAsUserDept?id=' + id,
|
url: '/system/notice/noticList',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/*公告详情列表*/
|
||||||
export function getNum(id) {
|
export function noticListDetail() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/userDept/GetNum?noticeId=' + id,
|
url: '/system/notice/noticListDetail',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//阅读公告
|
||||||
export function getNoticeList(data) {
|
export function readNotic(noticeId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/notice/GetNoticeList',
|
url: '/system/notice/readNotic/?noticeId=' + noticeId,
|
||||||
method: 'post',
|
method: 'get'
|
||||||
data
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询公告详细
|
// 查询公告详细
|
||||||
export function getNotice(noticeId) {
|
export function getNotice(noticeId) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -7,13 +7,14 @@
|
||||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<!-- <el-badge :value="messageTotal" class="item" style="margin-bottom: 25px;margin-right: 10px">-->
|
<el-badge :value="12" style="margin-right: 50px" class="item">
|
||||||
<!-- <el-button size="small" @click="noticeTableList()">公告</el-button>-->
|
<el-button size="mini" @click="drawer = true">公告</el-button>
|
||||||
<!-- </el-badge>-->
|
</el-badge>
|
||||||
|
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<i class="el-icon-message-solid" @click="noticeTableList"></i>
|
|
||||||
<search id="header-search" class="right-menu-item"/>
|
<search id="header-search" class="right-menu-item"/>
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||||
|
|
||||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -38,81 +39,63 @@
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
<el-drawer
|
||||||
|
title="我是标题"
|
||||||
|
:visible.sync="drawer"
|
||||||
|
:with-header="false">
|
||||||
|
<span>
|
||||||
|
<el-tabs type="border-card">
|
||||||
|
|
||||||
<el-dialog
|
<el-tab-pane>
|
||||||
title="公告"
|
<el-card>
|
||||||
:visible.sync="noticeTableVisible"
|
<el-button @click="all">全部</el-button>
|
||||||
width="50%">
|
<el-button @click="notice">通知</el-button>
|
||||||
<el-radio-group v-model="form.noticeType" @change="getNoticeList">
|
<el-button @click="announcementList">公告</el-button>
|
||||||
<el-radio-button label="">全部</el-radio-button>
|
</el-card>
|
||||||
<el-radio-button label="1">通知</el-radio-button>
|
<el-button @click="readNotic">通知已读</el-button>
|
||||||
<el-radio-button label="2">公告</el-radio-button>
|
<el-button @click="noReadNotic">通知未读</el-button>
|
||||||
</el-radio-group>
|
<el-button @click="announcementListReadNotic">公告已读</el-button>
|
||||||
<br> <br>
|
<el-button @click="announcementListNoReadNotic">公告未读</el-button>
|
||||||
<el-radio-group v-model="form.isRead" @change="getNoticeList">
|
<el-descriptions class="margin-top" v-for="(notice, index) in inform" :title=notice.noticeTitle :column="3" border>
|
||||||
<el-radio-button label="">全部</el-radio-button>
|
<template slot="extra">
|
||||||
<el-radio-button label="0">已读</el-radio-button>
|
<el-button type="primary" size="small" @click="readMessage(notice)">阅读消息</el-button>
|
||||||
<el-radio-button label="1">未读</el-radio-button>
|
</template>
|
||||||
</el-radio-group>
|
<el-descriptions-item>
|
||||||
<br><br><br>
|
<template slot="label">
|
||||||
<el-card class="box-card" v-for="notice in noticeAttr">
|
<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>
|
||||||
|
|
||||||
<!-- <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>
|
</span>
|
||||||
</el-dialog>
|
</el-drawer>
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -124,49 +107,15 @@ import Hamburger from '@/components/Hamburger'
|
||||||
import Screenfull from '@/components/Screenfull'
|
import Screenfull from '@/components/Screenfull'
|
||||||
import SizeSelect from '@/components/SizeSelect'
|
import SizeSelect from '@/components/SizeSelect'
|
||||||
import Search from '@/components/HeaderSearch'
|
import Search from '@/components/HeaderSearch'
|
||||||
import {getNoticeList, updateAsUserDept} from "@/api/system/notice";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dicts: ['is_read', 'sys_notice_type'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
noticeVisble: false,
|
drawer: false,
|
||||||
noticeInfo: {},
|
notic: [],
|
||||||
noticeAttr: [
|
/*通知*/
|
||||||
{
|
inform: []
|
||||||
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: {
|
components: {
|
||||||
|
@ -198,25 +147,93 @@ export default {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.settings.topNav
|
return this.$store.state.settings.topNav
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.noticList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getNoticeList() {
|
|
||||||
getNoticeList(this.form).then(res => {
|
/*全部*/
|
||||||
console.log(res)
|
all(){
|
||||||
this.noticeAttr = res.data
|
this.inform = []
|
||||||
|
this.notic.forEach(item => {
|
||||||
|
this.inform.push(item)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
readNotice(row) {
|
/*通知*/
|
||||||
this.noticeInfo = row
|
notice(){
|
||||||
this.noticeVisble = true
|
this.inform = []
|
||||||
updateAsUserDept(row.id).then(res => {
|
this.notic.forEach(item => {
|
||||||
this.getNoticeList()
|
if (item.noticeType === '1') {
|
||||||
|
this.inform.push(item)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
noticeTableList() {
|
/*通知已读*/
|
||||||
this.getNoticeList()
|
readNotic(){
|
||||||
this.noticeTableVisible = true
|
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
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
|
@ -237,6 +254,7 @@ export default {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.navbar {
|
.navbar {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
@ -281,6 +299,7 @@ export default {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.right-menu-item {
|
.right-menu-item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||||
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
|
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
|
||||||
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
||||||
|
|
||||||
<div :class="{'fixed-header':fixedHeader}">
|
<div :class="{'fixed-header':fixedHeader}">
|
||||||
<navbar/>
|
<navbar/>
|
||||||
<tags-view v-if="needTagsView"/>
|
<tags-view v-if="needTagsView"/>
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
const TokenKey = 'Admin-Token'
|
const TokenKey = 'Admin-Token'
|
||||||
|
|
||||||
const ExpiresInKey = 'Admin-Expires-In'
|
const ExpiresInKey = 'Admin-Expires-In'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function getToken() {
|
export function getToken() {
|
||||||
return Cookies.get(TokenKey)
|
return Cookies.get(TokenKey)
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ service.interceptors.request.use(config => {
|
||||||
|
|
||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
service.interceptors.response.use(res => {
|
service.interceptors.response.use(res => {
|
||||||
debugger
|
|
||||||
// 未设置状态码则默认成功状态
|
// 未设置状态码则默认成功状态
|
||||||
const code = res.data.code || 200;
|
const code = res.data.code || 200;
|
||||||
// 获取错误信息
|
// 获取错误信息
|
||||||
|
|
|
@ -80,7 +80,7 @@ export default {
|
||||||
},
|
},
|
||||||
loginRules: {
|
loginRules: {
|
||||||
username: [
|
username: [
|
||||||
{required: true, trigger: "blur", message: "请输入您的账号/邮箱"}
|
{required: true, trigger: "blur", message: "请输入您的账号"}
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{required: true, trigger: "blur", message: "请输入您的密码"}
|
{required: true, trigger: "blur", message: "请输入您的密码"}
|
||||||
|
|
|
@ -77,7 +77,8 @@ export default {
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
ipaddr: undefined,
|
ipaddr: undefined,
|
||||||
userName: undefined
|
userName: undefined,
|
||||||
|
name:undefined,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -113,7 +114,8 @@ export default {
|
||||||
this.$modal.msgSuccess("强退成功");
|
this.$modal.msgSuccess("强退成功");
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="接入源名称" prop="sourceName">
|
<el-form-item label="接入源名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.sourceName"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入接入源名称"
|
placeholder="请输入接入源名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
|
@ -17,6 +17,14 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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-form-item label="数据库名称" prop="databaseName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.databaseName"
|
v-model="queryParams.databaseName"
|
||||||
|
@ -25,6 +33,46 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<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>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
@ -77,29 +125,32 @@
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="accessList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="detabaseList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="接入源名称" align="center" prop="sourceName" />
|
<el-table-column label="数据源密码" align="center" prop="id" />
|
||||||
|
<el-table-column label="接入源名称" align="center" prop="name" />
|
||||||
<el-table-column label="数据来源系统名称" align="center" prop="systemName" />
|
<el-table-column label="数据来源系统名称" align="center" prop="systemName" />
|
||||||
<el-table-column label="主机地址" align="center" prop="hostAddress" />
|
<el-table-column label="主机地址" align="center" prop="host" />
|
||||||
<el-table-column label="主机端口" align="center" prop="hostNumber" />
|
<el-table-column label="主机端口" align="center" prop="port" />
|
||||||
<el-table-column label="数据接入类型" align="center">
|
<el-table-column label="用户名" align="center" prop="username" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="用户密码" align="center" prop="password" />
|
||||||
<template v-if="scope.row.accessId === 1">MySql</template>
|
<el-table-column label="数据接入类型" align="center" prop="type" />
|
||||||
<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="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" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-connection"
|
icon="el-icon-edit"
|
||||||
@click="syncAssetsStructure(scope.row)"
|
@click="testContest(scope.row)"
|
||||||
v-hasPermi="['source:structure:synchronization']"
|
v-hasPermi="['source:source:testConnection']"
|
||||||
>同步资产结构</el-button>
|
>测试连接</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -107,14 +158,6 @@
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['source:source:edit']"
|
v-hasPermi="['source:source:edit']"
|
||||||
>修改</el-button>
|
>修改</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
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -134,7 +177,7 @@
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改数据接入对话框 -->
|
<!-- 添加或修改数据源对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||||
<el-card>
|
<el-card>
|
||||||
|
@ -144,7 +187,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="接入源名称" prop="name">
|
<el-form-item label="接入源名称" prop="name">
|
||||||
<el-input v-model="form.sourceName" placeholder="请输入接入源名称" />
|
<el-input v-model="form.name" placeholder="请输入接入源名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
|
@ -153,34 +196,50 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</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-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="主机地址" prop="host">
|
<el-form-item label="主机地址" prop="host">
|
||||||
<el-input v-model="form.hostAddress" placeholder="请输入主机地址" />
|
<el-input v-model="form.host" placeholder="请输入主机地址" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="主机端口" prop="port">
|
<el-form-item label="主机端口" prop="port">
|
||||||
<el-input v-model="form.hostNumber" placeholder="请输入主机地址" />
|
<el-input v-model="form.port" placeholder="请输入主机端口" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="数据接入类型" prop="type">
|
<el-form-item label="数据接入类型" prop="type">
|
||||||
<el-select style="width: 100%" v-model="form.accessId">
|
<el-select style="width: 100%" v-model="form.type">
|
||||||
<el-option
|
<el-option label="MySql" value="MySql">MySql</el-option>
|
||||||
v-for="item in type"
|
<el-option label="Oracle" value="Oracle">Oracle</el-option>
|
||||||
:key="item.id"
|
|
||||||
:label="item.accessName"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="数据库名称" prop="databaseName">
|
<el-form-item label="数据库名称" prop="databaseName">
|
||||||
<el-input v-model="form.databaseName" placeholder="请输入数据库名称" />
|
<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-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -191,7 +250,7 @@
|
||||||
</div>
|
</div>
|
||||||
<el-col :sm="24">
|
<el-col :sm="24">
|
||||||
<el-form-item label="数据连接参数" prop="connectionParam">
|
<el-form-item label="数据连接参数" prop="connectionParam">
|
||||||
<el-input v-model="form.connectionParameters" placeholder="请输入内容" />
|
<el-input v-model="form.connectionParam" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-row :gutter="10" style="margin: 10px 0">
|
<el-row :gutter="10" style="margin: 10px 0">
|
||||||
|
@ -226,24 +285,24 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="初始连接数量" prop="initNum">
|
<el-form-item label="初始连接数量" prop="initNum">
|
||||||
<el-input v-model="form.initialize" placeholder="请输入初始连接数量" />
|
<el-input v-model="form.initNum" placeholder="请输入初始连接数量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="最大连接数量" prop="maxNum">
|
<el-form-item label="最大连接数量" prop="maxNum">
|
||||||
<el-input v-model="form.maxInitialize" placeholder="请输入最大连接数量" />
|
<el-input v-model="form.maxNum" placeholder="请输入最大连接数量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="最大等待时间" prop="maxWaitTime">
|
<el-form-item label="最大等待时间" prop="maxWaitTime">
|
||||||
<el-input v-model="form.maxWaitingTime" placeholder="请输入最大等待时间" />
|
<el-input v-model="form.maxWaitTime" placeholder="请输入最大等待时间" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="最大等待次数" prop="maxWaitSize">
|
<el-form-item label="最大等待次数" prop="maxWaitSize">
|
||||||
<el-input v-model="form.maxIsoFrequency" placeholder="请输入最大等待次数" />
|
<el-input v-model="form.maxWaitSize" placeholder="请输入最大等待次数" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -267,10 +326,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listSource, getSource, delSource, addSource, updateSource, typeList, connectTest, synchronization} from "@/api/source/source";
|
import {
|
||||||
|
listDetabase,
|
||||||
|
getDetabase,
|
||||||
|
delDetabase,
|
||||||
|
addDetabase,
|
||||||
|
updateDetabase,
|
||||||
|
testConnection, selectDatabaseList
|
||||||
|
} from "@/api/source/source";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Source",
|
name: "source",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
@ -285,8 +351,8 @@ export default {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 数据接入基本信息表格数据
|
// 数据源表格数据
|
||||||
accessList: [],
|
detabaseList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
@ -295,113 +361,99 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
sourceName: null,
|
name: null,
|
||||||
systemName: null,
|
systemName: null,
|
||||||
databaseName: null
|
host: null,
|
||||||
|
type: null,
|
||||||
|
databaseName: null,
|
||||||
|
connectionParam: null,
|
||||||
|
initNum: null,
|
||||||
|
maxNum: null,
|
||||||
|
maxWaitTime: null,
|
||||||
|
maxWaitSize: null,
|
||||||
},
|
},
|
||||||
type:[],
|
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
sourceName: [
|
id: [
|
||||||
{required: true, message: "接入源名称不能为空", trigger: "blur"}
|
{ 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: [
|
dataSourceParamList: [
|
||||||
{
|
{
|
||||||
name: null,
|
name: null,
|
||||||
val: null
|
val: null
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
/*数据库名称列表*/
|
||||||
|
databaseList:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch:{
|
||||||
|
"form.type":{
|
||||||
|
handler(){
|
||||||
|
this.checkDatabaseList();
|
||||||
|
},
|
||||||
|
deep:true
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.processParam()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncAssetsStructure(row){
|
/*监测*/
|
||||||
console.log(row)
|
checkDatabaseList(){
|
||||||
synchronization(row).then(res=>{
|
if( this.form.username && this.form.password && this.form.host && this.form.type){
|
||||||
console.log(res)
|
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
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//测试连接
|
// 新增参数
|
||||||
connect(row){
|
|
||||||
connectTest(row.id).then(res=>{
|
|
||||||
if (res.code == 200) {
|
|
||||||
this.$message.success(res.data)
|
|
||||||
}else {
|
|
||||||
this.$message.success(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 添加参数
|
|
||||||
addParam(){
|
addParam(){
|
||||||
this.dataSourceParamList.push({
|
this.dataSourceParamList.push({
|
||||||
name: null,
|
name: null,
|
||||||
val: null
|
val: null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 删除参数
|
//删除参数
|
||||||
deleteParam(index){
|
deleteParam(index){
|
||||||
if (index != null){
|
console.log(index)
|
||||||
this.dataSourceParamList.splice(index, 1);
|
if(index==null){
|
||||||
}else {
|
this.dataSourceParamList=[]
|
||||||
this.dataSourceParamList = []
|
}else{
|
||||||
|
this.dataSourceParamList.splice(index,1)
|
||||||
}
|
}
|
||||||
this.processParam();
|
this.processParam()
|
||||||
},
|
},
|
||||||
|
// 处理参数
|
||||||
processParam(){
|
processParam(){
|
||||||
this.form.connectionParameters = this.dataSourceParamList
|
this.form.connectionParam=this.dataSourceParamList
|
||||||
.filter(item => item.name != null || item.val != null)
|
.filter(item=>item.name!=null || item.val!=null)
|
||||||
.map(item => {
|
.map(item=>{
|
||||||
return item.name + "=" + item.val;
|
return item.name+"="+item.val
|
||||||
}).join("&")
|
}).join("&")
|
||||||
console.log(this.form.connectionParameters)
|
console.log(this.form.connectionParam)
|
||||||
},
|
},
|
||||||
/** 查询数据接入基本信息列表 */
|
/** 查询数据源列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listSource(this.queryParams).then(response => {
|
listDetabase(this.queryParams).then(response => {
|
||||||
this.accessList = response.data.rows;
|
this.detabaseList = response.data.rows;
|
||||||
console.log(this.accessList)
|
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
typeList().then(res=>{
|
|
||||||
this.type=res.data
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -412,17 +464,16 @@ export default {
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
sourceName: null,
|
name: null,
|
||||||
systemName: null,
|
systemName: null,
|
||||||
hostAddress: null,
|
host: null,
|
||||||
hostNumber: null,
|
type: null,
|
||||||
accessId: null,
|
|
||||||
connectionParameters: null,
|
|
||||||
initialize: 5,
|
|
||||||
maxInitialize: 20,
|
|
||||||
maxWaitingTime: 3000,
|
|
||||||
maxIsoFrequency: 3,
|
|
||||||
databaseName: null,
|
databaseName: null,
|
||||||
|
connectionParam: null,
|
||||||
|
initNum: null,
|
||||||
|
maxNum: null,
|
||||||
|
maxWaitTime: null,
|
||||||
|
maxWaitSize: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
|
@ -451,25 +502,46 @@ export default {
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加数据接入基本信息";
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate: function (row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids
|
this.form = row
|
||||||
this.form = row;
|
|
||||||
this.dataSourceParamList = [];
|
this.dataSourceParamList = [];
|
||||||
getSource(id).then(response => {
|
this.form.connectionParam.split("&").forEach(param => {
|
||||||
this.form.connectionParameters.split("&").forEach(param => {
|
var split = param.split("=");
|
||||||
let paramArr = param.split("=");
|
this.dataSourceParamList.push({
|
||||||
this.dataSourceParamList.push({
|
name: split[0],
|
||||||
name: paramArr[0],
|
val: split[1]
|
||||||
val: paramArr[1]
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getDetabase(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改数据接入基本信息";
|
this.title = "修改数据源";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
|
@ -477,14 +549,13 @@ export default {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateSource(this.form).then(response => {
|
updateDetabase(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
addDetabase(this.form).then(response => {
|
||||||
addSource(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -496,8 +567,8 @@ export default {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除数据接入基本信息编号为"' + ids + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除数据源编号为"' + ids + '"的数据项?').then(function() {
|
||||||
return delSource(ids);
|
return delDetabase(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
@ -507,7 +578,7 @@ export default {
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('source/source/export', {
|
this.download('source/source/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `source_${new Date().getTime()}.xlsx`)
|
}, `source${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,246 @@
|
||||||
|
<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,9 +234,7 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listDept(this.queryParams).then(response => {
|
listDept(this.queryParams).then(response => {
|
||||||
console.log(response.data)
|
|
||||||
this.deptList = this.handleTree(response.data, "deptId");
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
console.log(this.deptList)
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -311,6 +311,7 @@ export default {
|
||||||
refreshTable: true,
|
refreshTable: true,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
parentId: 0,
|
||||||
menuName: undefined,
|
menuName: undefined,
|
||||||
visible: undefined
|
visible: undefined
|
||||||
},
|
},
|
||||||
|
@ -342,6 +343,7 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listMenu(this.queryParams).then(response => {
|
listMenu(this.queryParams).then(response => {
|
||||||
|
console.log(response)
|
||||||
this.menuList = this.handleTree(response.data, "menuId");
|
this.menuList = this.handleTree(response.data, "menuId");
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -100,12 +100,11 @@
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:notice:edit']"
|
icon="el-icon-search"
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="noticeDetails(scope.row.noticeId)"
|
@click="noticDetail(scope.row)"
|
||||||
>通知详情
|
>查看详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:notice:edit']"
|
v-hasPermi="['system:notice:edit']"
|
||||||
|
@ -136,17 +135,17 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改公告对话框 -->
|
<!-- 添加或修改公告对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="780px">
|
<el-dialog :title="title" :visible.sync="open" append-to-body width="780px" class="dialog" >
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="公告标题" prop="noticeTitle">
|
<el-form-item label="公告标题" prop="noticeTitle">
|
||||||
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题"/>
|
<el-input :disabled="isTitleDisabled" v-model="form.noticeTitle" placeholder="请输入公告标题"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="公告类型" prop="noticeType">
|
<el-form-item label="公告类型" prop="noticeType">
|
||||||
<el-select v-model="form.noticeType" placeholder="请选择公告类型">
|
<el-select :disabled="isTitleDisabled" v-model="form.noticeType" placeholder="请选择公告类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.sys_notice_type"
|
v-for="dict in dict.type.sys_notice_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -156,20 +155,9 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col :span="24">
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group :disabled="isTitleDisabled" v-model="form.status">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_notice_status"
|
v-for="dict in dict.type.sys_notice_status"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -179,96 +167,124 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col :span="24">
|
||||||
<el-form-item label="内容">
|
<el-form-item label="内容">
|
||||||
<editor v-model="form.noticeContent" :min-height="192"/>
|
<editor v-model="form.noticeContent" :min-height="50"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</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>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addNotice, delNotice, getNotice, getNum, listNotice, updateNotice} from "@/api/system/notice";
|
import {
|
||||||
|
addNotice,
|
||||||
|
delNotice,
|
||||||
|
getNotice,
|
||||||
|
listNotice,
|
||||||
|
noticList,
|
||||||
|
noticListDetail,
|
||||||
|
updateNotice
|
||||||
|
} from "@/api/system/notice";
|
||||||
import {listDept} from "@/api/system/dept";
|
import {listDept} from "@/api/system/dept";
|
||||||
import {listUser} from "@/api/system/user";
|
import {listUser} from "@/api/system/user";
|
||||||
|
import {listPost} from "@/api/system/post";
|
||||||
|
|
||||||
|
const cityOptions = ['上海', '北京', '广州', '深圳'];
|
||||||
export default {
|
export default {
|
||||||
name: "Notice",
|
name: "Notice",
|
||||||
dicts: ['sys_notice_status', 'sys_notice_type'],
|
dicts: ['sys_notice_status', 'sys_notice_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
sectionList:[],
|
|
||||||
personnelList:[],
|
|
||||||
props: { multiple: true },
|
|
||||||
options1: [],
|
|
||||||
options: [],
|
|
||||||
activeName: '部门',
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -295,15 +311,17 @@ export default {
|
||||||
createBy: undefined,
|
createBy: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
},
|
},
|
||||||
queryParam: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
noticeTitle: undefined,
|
|
||||||
createBy: undefined,
|
|
||||||
status: undefined
|
|
||||||
},
|
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {
|
||||||
|
userNames: "",
|
||||||
|
createBy: "",
|
||||||
|
},
|
||||||
|
/*阅读量*/
|
||||||
|
read:{
|
||||||
|
totalNum: 2,
|
||||||
|
readEd: 2,
|
||||||
|
noRead: 2,
|
||||||
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
noticeTitle: [
|
noticeTitle: [
|
||||||
|
@ -313,34 +331,145 @@ export default {
|
||||||
{required: true, message: "公告类型不能为空", trigger: "change"}
|
{required: true, message: "公告类型不能为空", trigger: "change"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
asUserDeptNum: {},
|
dept: [],
|
||||||
numVisable: false
|
//多选
|
||||||
|
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 = "公告详情";
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
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: {
|
methods: {
|
||||||
noticeDetails(noticeId) {
|
|
||||||
this.numVisable = true
|
/*多选框*/
|
||||||
getNum(noticeId).then(res => {
|
handleCheckAllChange(val) {
|
||||||
this.asUserDeptNum = res.data
|
this.checkedCities = val ? this.cities : [];
|
||||||
})
|
this.isIndeterminate = false;
|
||||||
},
|
},
|
||||||
//部门递归
|
handleCheckedCitiesChange(value) {
|
||||||
recursion(data) {
|
let userNames = "";
|
||||||
data.forEach(da => {
|
let checkedCount = value.length;
|
||||||
this.$set(da, 'value', da.deptId);
|
this.checkAll = checkedCount === this.cities.length;
|
||||||
delete da.deptId;
|
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
|
||||||
this.$set(da, 'label', da.deptName);
|
userNames += "," + value + ",";
|
||||||
delete da.deptName;
|
//去掉最后一个,号
|
||||||
if (da.children){
|
userNames = userNames.substring(1, userNames.length - 1);
|
||||||
this.recursion(da.children)
|
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;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//tab选择
|
/*选中特定人员tab框*/
|
||||||
handleClick(tab, event) {
|
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;
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 查询公告列表 */
|
/** 查询公告列表 */
|
||||||
|
@ -364,9 +493,7 @@ export default {
|
||||||
noticeTitle: undefined,
|
noticeTitle: undefined,
|
||||||
noticeType: undefined,
|
noticeType: undefined,
|
||||||
noticeContent: undefined,
|
noticeContent: undefined,
|
||||||
status: "0",
|
status: "0"
|
||||||
sectionList:[],
|
|
||||||
personnelList:[]
|
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -391,24 +518,6 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加公告";
|
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) {
|
handleUpdate(row) {
|
||||||
|
@ -431,6 +540,7 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
console.log(this.form)
|
||||||
addNotice(this.form).then(response => {
|
addNotice(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
@ -454,3 +564,4 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -372,10 +372,9 @@ import {
|
||||||
updateUser
|
updateUser
|
||||||
} from "@/api/system/user";
|
} from "@/api/system/user";
|
||||||
import {getToken} from "@/utils/auth";
|
import {getToken} from "@/utils/auth";
|
||||||
|
|
||||||
import {forceLogout, list} from "@/api/monitor/online";
|
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import {findTokenId, forceLogout} from "@/api/monitor/online";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "User",
|
name: "User",
|
||||||
|
@ -383,10 +382,6 @@ export default {
|
||||||
components: {Treeselect},
|
components: {Treeselect},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParam:{
|
|
||||||
ipaddr: undefined,
|
|
||||||
userName: undefined
|
|
||||||
},
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -484,6 +479,12 @@ export default {
|
||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
/*强退*/
|
||||||
|
tokenParams: {
|
||||||
|
ipaddr: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
name:undefined,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -557,7 +558,7 @@ export default {
|
||||||
status: "0",
|
status: "0",
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
postIds: [],
|
postIds: [],
|
||||||
roleIds: []
|
roleIds: [],
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -621,6 +622,15 @@ export default {
|
||||||
},
|
},
|
||||||
/** 重置密码按钮操作 */
|
/** 重置密码按钮操作 */
|
||||||
handleResetPwd(row) {
|
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 + '"的新密码', "提示", {
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
|
@ -630,15 +640,10 @@ export default {
|
||||||
}).then(({value}) => {
|
}).then(({value}) => {
|
||||||
resetUserPwd(row.userId, value).then(response => {
|
resetUserPwd(row.userId, value).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
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(() => {
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
|
|
|
@ -182,7 +182,6 @@ export default {
|
||||||
submitForm() {
|
submitForm() {
|
||||||
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
||||||
const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
||||||
|
|
||||||
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
|
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
|
||||||
const validateResult = res.data.every(item => !!item);
|
const validateResult = res.data.every(item => !!item);
|
||||||
if (validateResult) {
|
if (validateResult) {
|
||||||
|
|
Loading…
Reference in New Issue