数据源管理
parent
07b86dc261
commit
b40d3be7a1
|
@ -0,0 +1,63 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询kvt列表
|
||||||
|
export function listKvt(query) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询kvt详细
|
||||||
|
export function getKvt(id) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增kvt
|
||||||
|
|
||||||
|
export function addKvt(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改kvt
|
||||||
|
|
||||||
|
export function updateKvt(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/'+data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除kvt
|
||||||
|
|
||||||
|
export function delKvt(id) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 测试连接
|
||||||
|
|
||||||
|
export function connectionTest(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/connectionTest/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 选择数据库
|
||||||
|
export function dataTypeList() {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/dataTypeList/',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询用户与部门中间列表
|
||||||
|
export function listDept(query) {
|
||||||
|
return request({
|
||||||
|
url: '/product/dept/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询用户与部门中间详细
|
||||||
|
export function getDept(id) {
|
||||||
|
return request({
|
||||||
|
url: '/product/dept/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增用户与部门中间
|
||||||
|
export function addDept(data) {
|
||||||
|
return request({
|
||||||
|
url: '/product/dept',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改用户与部门中间
|
||||||
|
export function updateDept(data) {
|
||||||
|
return request({
|
||||||
|
url: '/product/dept',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除用户与部门中间
|
||||||
|
export function delDept(id) {
|
||||||
|
return request({
|
||||||
|
url: '/product/dept/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -9,6 +9,28 @@ export function listNotice(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateAsUserDept(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/userDept/UpdateAsUserDept?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getNum(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/userDept/GetNum?noticeId=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getNoticeList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/GetNoticeList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询公告详细
|
// 查询公告详细
|
||||||
export function getNotice(noticeId) {
|
export function getNotice(noticeId) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
<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">
|
||||||
|
|
||||||
<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"/>
|
||||||
|
|
||||||
|
@ -35,6 +37,73 @@
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<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 ":key="notice.id">
|
||||||
|
<el-descriptions class="margin-top" :title="notice.noticeTitle" :column="2" 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-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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -46,8 +115,51 @@ 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() {
|
||||||
|
return {
|
||||||
|
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: {
|
components: {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
TopNav,
|
TopNav,
|
||||||
|
@ -80,6 +192,25 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getNoticeList(){
|
||||||
|
getNoticeList(this.form).then(
|
||||||
|
res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.noticeAttr=res.data;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
readNotice(row){
|
||||||
|
this.noticeIngo=row;
|
||||||
|
this.noticeVisble=true;
|
||||||
|
updateAsUserDept(row.id).then(res=>{
|
||||||
|
this.getNoticeList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
noticeTableList(){
|
||||||
|
this.getNoticeList();
|
||||||
|
this.noticeTableVisible=true;
|
||||||
|
},
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
},
|
},
|
||||||
|
|
|
@ -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;
|
||||||
// 获取错误信息
|
// 获取错误信息
|
||||||
|
|
|
@ -0,0 +1,598 @@
|
||||||
|
<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-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入接入源名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="数据来源系统名称" prop="systemName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.systemName"
|
||||||
|
placeholder="请输入数据来源系统名称"
|
||||||
|
clearable
|
||||||
|
@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="port">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.port"
|
||||||
|
placeholder="请输入端口地址"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户名" prop="port">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.username"
|
||||||
|
placeholder="请输入用户名"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="密码" prop="port">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.password"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="数据库名称" prop="databaseName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.databaseName"
|
||||||
|
placeholder="请输入数据库名称"
|
||||||
|
clearable
|
||||||
|
@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-date-picker clearable
|
||||||
|
v-model="queryParams.maxWaitTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择最大等待时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</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>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['kvt:kvt:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['kvt:kvt:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['kvt:kvt:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['kvt:kvt:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="kvtList" @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="systemName" />
|
||||||
|
<el-table-column label="数据接入类型" align="center" prop="type" />
|
||||||
|
<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="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" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.maxWaitTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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="connectionTest(scope.row)"
|
||||||
|
>测试连接</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['kvt:kvt:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['kvt:kvt:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改kvt对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>基础配置信息</span>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="接入源名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入接入源名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="数据来源系统名称" prop="systemName">
|
||||||
|
<el-input v-model="form.systemName" 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-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="端口地址" prop="port">
|
||||||
|
<el-input v-model="form.port" placeholder="请输入端口地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="数据库类型" prop="databaseName">
|
||||||
|
<el-select v-model="form.dateTypeId" placeholder="请输入数据库类型" >
|
||||||
|
<el-option v-for="index in dataTypes" :label="index.typeName" :value="index.id" :key="index.typeName"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="数据库名称" prop="databaseName">
|
||||||
|
<el-input v-model="form.databaseName" placeholder="请输入数据库名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="用户名" prop="username">
|
||||||
|
<el-input v-model="form.username" placeholder="请输入用户名" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="密码" prop="password">
|
||||||
|
<el-input v-model="form.password" placeholder="请输入密码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>数据连接参数</span>
|
||||||
|
</div>
|
||||||
|
<el-col :sm="24">
|
||||||
|
<el-form-item label="数据连接参数" prop="connectionParam">
|
||||||
|
<el-input v-model="form.connectionParam" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-row :gutter="10" style="margin: 10px 0">
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button type="primary" @click="addParam()">新增参数</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button type="danger" @click="deleteParam(null)">清空参数</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :md="8" :xs="12" style="margin: 10px 0" v-for="(dataSourceParam, dataSourceParamIndex) in dataSourceParamList">
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-input v-model="dataSourceParam.name" placeholder="请输入参数键" @keyup.native="processParam"/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1"><span style="font-size: 28px; margin: 0 3px 0 0;">:</span></el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-input v-model="dataSourceParam.val" placeholder="请输入参数值" @keyup.native="processParam"/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="3">
|
||||||
|
<el-button type="danger" @click="deleteParam(dataSourceParamIndex)">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 20px">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>连接池配置</span>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="初始连接数量" prop="initNum">
|
||||||
|
<el-input v-model="form.initNum" 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-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-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="最大等待次数" prop="maxWaitSize">
|
||||||
|
<el-input v-model="form.maxWaitSize" placeholder="请输入最大等待次数" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 20px">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>其他信息</span>
|
||||||
|
</div>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listKvt, getKvt, delKvt, addKvt, updateKvt, connectionTest, dataTypeList } from '@/api/kvt/kvt'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Kvt",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// kvt表格数据
|
||||||
|
kvtList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: null,
|
||||||
|
systemName: null,
|
||||||
|
type: null,
|
||||||
|
host: null,
|
||||||
|
port: null,
|
||||||
|
databaseName: null,
|
||||||
|
connectionParam: null,
|
||||||
|
initNum: null,
|
||||||
|
maxNum: null,
|
||||||
|
maxWaitTime: null,
|
||||||
|
maxWaitSize: null,
|
||||||
|
username: null,
|
||||||
|
password: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{required: true, message: "接入源名称不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
systemName: [
|
||||||
|
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
type: [
|
||||||
|
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
host: [
|
||||||
|
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
port: [
|
||||||
|
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
databaseName: [
|
||||||
|
{required: true, message: "数据库名称不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
connectionParam: [
|
||||||
|
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
initNum: [
|
||||||
|
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
maxNum: [
|
||||||
|
{required: true, message: "最大连接数量不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
maxWaitTime: [
|
||||||
|
{required: true, message: "最大等待时间不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
maxWaitSize: [
|
||||||
|
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
username: [
|
||||||
|
{required: true, message: "用户名不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
password: [
|
||||||
|
{required: true, message: "密码不能为空", trigger: "blur"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// 条件参数内容
|
||||||
|
dataSourceParamList: [
|
||||||
|
{
|
||||||
|
name: null,
|
||||||
|
val: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataTypes: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.dataTypeList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
dataTypeList(){
|
||||||
|
dataTypeList().then(res=> {
|
||||||
|
console.log(res)
|
||||||
|
this.dataTypes =res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 添加参数
|
||||||
|
addParam(){
|
||||||
|
this.dataSourceParamList.push({
|
||||||
|
name: null,
|
||||||
|
val: null
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 删除参数
|
||||||
|
deleteParam(index){
|
||||||
|
if (index != null){
|
||||||
|
this.dataSourceParamList.splice(index, 1);
|
||||||
|
}else {
|
||||||
|
this.dataSourceParamList = []
|
||||||
|
}
|
||||||
|
this.processParam();
|
||||||
|
},
|
||||||
|
// 处理参数
|
||||||
|
processParam(){
|
||||||
|
this.form.connectionParam = this.dataSourceParamList
|
||||||
|
.filter(item => item.name != null || item.val != null)
|
||||||
|
.map(item => {
|
||||||
|
return item.name + "=" + item.val;
|
||||||
|
}).join("&")
|
||||||
|
console.log(this.form.connectionParam)
|
||||||
|
},
|
||||||
|
//测试连接
|
||||||
|
connectionTest(row){
|
||||||
|
connectionTest(row).then(res=>{
|
||||||
|
console.log(row)
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 查询kvt列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listKvt(this.queryParams).then(response => {
|
||||||
|
this.kvtList = response.data.rows;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
name: null,
|
||||||
|
systemName: null,
|
||||||
|
type: null,
|
||||||
|
host: null,
|
||||||
|
port: null,
|
||||||
|
username: null,
|
||||||
|
password: null,
|
||||||
|
databaseName: null,
|
||||||
|
connectionParam: null,
|
||||||
|
initNum: null,
|
||||||
|
maxNum: null,
|
||||||
|
maxWaitTime: null,
|
||||||
|
maxWaitSize: null,
|
||||||
|
remark: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加kvt";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getKvt(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.dataSourceParamList = [];
|
||||||
|
this.form.connectionParam.split("&").forEach(param => {
|
||||||
|
let paramArr = param.split("=");
|
||||||
|
this.dataSourceParamList.push({
|
||||||
|
name: paramArr[0],
|
||||||
|
val: paramArr[1]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改kvt";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateKvt(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addKvt(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除kvt编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delKvt(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('kvt/kvt/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `kvt_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,282 @@
|
||||||
|
<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="${comment}" prop="userId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请输入${comment}"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="noticeId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.noticeId"
|
||||||
|
placeholder="请输入${comment}"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="isRead">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.isRead"
|
||||||
|
placeholder="请输入${comment}"
|
||||||
|
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>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['product:dept:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['product:dept:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['product:dept:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['product:dept:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="deptList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="id" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="userId" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="noticeId" />
|
||||||
|
<el-table-column label="${comment}" align="center" prop="isRead" />
|
||||||
|
<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="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['product:dept:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['product:dept:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改用户与部门中间对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="${comment}" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="noticeId">
|
||||||
|
<el-input v-model="form.noticeId" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="isRead">
|
||||||
|
<el-input v-model="form.isRead" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listDept, getDept, delDept, addDept, updateDept } from "@/api/product/dept";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Dept",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 用户与部门中间表格数据
|
||||||
|
deptList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
userId: null,
|
||||||
|
noticeId: null,
|
||||||
|
isRead: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询用户与部门中间列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listDept(this.queryParams).then(response => {
|
||||||
|
this.deptList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
userId: null,
|
||||||
|
noticeId: null,
|
||||||
|
isRead: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加用户与部门中间";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getDept(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改用户与部门中间";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateDept(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addDept(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除用户与部门中间编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delDept(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('product/dept/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `dept_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -99,6 +99,14 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<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
|
||||||
|
v-hasPermi="['system:notice:edit']"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="noticeDetails(scope.row.noticeId)"
|
||||||
|
>通知详情
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:notice:edit']"
|
v-hasPermi="['system:notice:edit']"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
@ -148,6 +156,17 @@
|
||||||
</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 v-model="form.status">
|
||||||
|
@ -171,18 +190,84 @@
|
||||||
<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"
|
||||||
|
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, listNotice, 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";
|
||||||
|
|
||||||
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 {
|
||||||
|
props: { multiple: true },
|
||||||
|
sectionList:[],
|
||||||
|
personnelList:[],
|
||||||
|
options1: [],
|
||||||
|
options: [],
|
||||||
|
activeName: '部门',
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -209,6 +294,13 @@ export default {
|
||||||
createBy: undefined,
|
createBy: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
},
|
},
|
||||||
|
queryParam: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
noticeTitle: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
status: undefined
|
||||||
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -219,13 +311,37 @@ export default {
|
||||||
noticeType: [
|
noticeType: [
|
||||||
{required: true, message: "公告类型不能为空", trigger: "change"}
|
{required: true, message: "公告类型不能为空", trigger: "change"}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
asUserDeptNum: {},
|
||||||
|
numVisable: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
noticeDetails(noticeId) {
|
||||||
|
this.numVisable = true
|
||||||
|
getNum(noticeId).then(res => {
|
||||||
|
this.asUserDeptNum = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//部门递归
|
||||||
|
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) {
|
||||||
|
|
||||||
|
},
|
||||||
/** 查询公告列表 */
|
/** 查询公告列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -247,7 +363,9 @@ 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");
|
||||||
},
|
},
|
||||||
|
@ -272,6 +390,24 @@ 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) {
|
||||||
|
|
|
@ -374,13 +374,17 @@ import {
|
||||||
import {getToken} from "@/utils/auth";
|
import {getToken} from "@/utils/auth";
|
||||||
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 {forceLogout, list} from "@/api/monitor/online";
|
||||||
export default {
|
export default {
|
||||||
name: "User",
|
name: "User",
|
||||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
||||||
components: {Treeselect},
|
components: {Treeselect},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// queryParam: {
|
||||||
|
// ipaddr: undefined,
|
||||||
|
// userName: undefined
|
||||||
|
// },
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -508,7 +512,9 @@ export default {
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getDeptTree() {
|
getDeptTree() {
|
||||||
deptTreeSelect().then(response => {
|
deptTreeSelect().then(response => {
|
||||||
|
console.log("aaa",response)
|
||||||
this.deptOptions = response.data;
|
this.deptOptions = response.data;
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 筛选节点
|
// 筛选节点
|
||||||
|
@ -518,6 +524,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 节点单击事件
|
// 节点单击事件
|
||||||
handleNodeClick(data) {
|
handleNodeClick(data) {
|
||||||
|
console.log("bbb",data)
|
||||||
this.queryParams.deptId = data.id;
|
this.queryParams.deptId = data.id;
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
@ -625,6 +632,14 @@ 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);
|
||||||
|
// list(this.queryParam).then(res => {
|
||||||
|
// const userList = res.data.rows
|
||||||
|
// userList.forEach(userInfo => {
|
||||||
|
// if (userInfo.userName == row.userName){
|
||||||
|
// forceLogout(userInfo.tokenId);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue