feat:系统接入

main
031026 2024-04-15 13:58:48 +08:00
parent 770d9da1b6
commit b732b59aa9
9 changed files with 887 additions and 5 deletions

View File

@ -0,0 +1,66 @@
import request from '@/utils/request'
// 查询数据接入基本信息列表
export function listSource(query) {
return request({
url: '/source/source/list',
method: 'get',
params: query
})
}
// 查询数据接入基本信息详细
export function getSource(id) {
return request({
url: '/source/source/' + id,
method: 'get'
})
}
export function typeList() {
return request({
url: '/source/type/typeList',
method: 'get'
})
}
// 新增数据接入基本信息
export function addSource(data) {
return request({
url: '/source/source/add',
method: 'post',
data: data
})
}
// 修改数据接入基本信息
export function updateSource(data) {
return request({
url: '/source/source/'+data.id,
method: 'put',
data: data
})
}
// 删除数据接入基本信息
export function delSource(id) {
return request({
url: '/source/source/' + id,
method: 'delete'
})
}
export function connectTest(id) {
return request({
url: '/source/source/connect?id=' + id,
method: 'post'
})
}
export function synchronization(data) {
return request({
url: '/source/structure/'+data.id,
method: 'post'
})
}

View File

@ -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) {
return request({

View File

@ -7,10 +7,13 @@
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
<div class="right-menu">
<!-- <el-badge :value="messageTotal" class="item" style="margin-bottom: 25px;margin-right: 10px">-->
<!-- <el-button size="small" @click="noticeTableList()"></el-button>-->
<!-- </el-badge>-->
<template v-if="device!=='mobile'">
<i class="el-icon-message-solid" @click="noticeTableList"></i>
<search id="header-search" class="right-menu-item"/>
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
<el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect"/>
</el-tooltip>
@ -35,6 +38,81 @@
</el-dropdown-menu>
</el-dropdown>
</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">
<!-- <div slot="header" class="clearfix">-->
<!-- <span>卡片名称</span>-->
<!-- <el-button style="float: right"> </el-button>-->
<!-- </div>-->
<!-- <div v-for="o in 4" :key="o" class="text item">-->
<!-- {{'列表内容 ' + o }}-->
<!-- </div>-->
<el-descriptions class="margin-top" :title="notice.noticeTitle" :column="2" :size="size" border>
<template slot="extra">
<el-button size="small" @click="readNotice(notice)"></el-button>
</template>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
消息发布时间
</template>
{{notice.createTime}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
消息发布人
</template>
{{notice.createBy}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
消息类型
</template>
<dict-tag :options="dict.type.sys_notice_type" :value="notice.noticeType"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-office-building"></i>
消息当前状态
</template>
<dict-tag :options="dict.type.is_read" :value="notice.isRead"/>
</el-descriptions-item>
</el-descriptions>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button @click="noticeTableVisible = false"> </el-button>
<el-button type="primary" @click="noticeTableVisible = false"> </el-button>
</span>
</el-dialog>
<el-dialog
:title="noticeInfo.noticeTitle"
:visible.sync="noticeVisble"
width="30%">
<editor v-model="noticeInfo.noticeContent" :min-height="192"/>
<span slot="footer" class="dialog-footer">
<el-button @click="noticeVisble = false"> </el-button>
<el-button type="primary" @click="noticeVisble = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -46,8 +124,51 @@ import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import {getNoticeList, updateAsUserDept} from "@/api/system/notice";
export default {
dicts: ['is_read', 'sys_notice_type'],
data() {
return {
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: {
Breadcrumb,
TopNav,
@ -80,6 +201,23 @@ export default {
}
},
methods: {
getNoticeList() {
getNoticeList(this.form).then(res => {
console.log(res)
this.noticeAttr = res.data
})
},
readNotice(row) {
this.noticeInfo = row
this.noticeVisble = true
updateAsUserDept(row.id).then(res => {
this.getNoticeList()
})
},
noticeTableList() {
this.getNoticeList()
this.noticeTableVisible = true
},
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
},

View File

@ -3,6 +3,7 @@
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
<div :class="{'fixed-header':fixedHeader}">
<navbar/>
<tags-view v-if="needTagsView"/>

View File

@ -0,0 +1,514 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form-item label="接入源名称" prop="sourceName">
<el-input
v-model="queryParams.sourceName"
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="databaseName">
<el-input
v-model="queryParams.databaseName"
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="['source:source: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="['source:source: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="['source:source: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="['source:source:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="accessList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="接入源名称" align="center" prop="sourceName" />
<el-table-column label="数据来源系统名称" align="center" prop="systemName" />
<el-table-column label="主机地址" align="center" prop="hostAddress" />
<el-table-column label="主机端口" align="center" prop="hostNumber" />
<el-table-column label="数据接入类型" align="center">
<template slot-scope="scope">
<template v-if="scope.row.accessId === 1">MySql</template>
<template v-else-if="scope.row.accessId === 2">Oracle</template>
</template>
</el-table-column>
<el-table-column label="数据库名称" align="center" prop="databaseName" />
<el-table-column label="备注" align="center" prop="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-connection"
@click="syncAssetsStructure(scope.row)"
v-hasPermi="['source:structure:synchronization']"
>同步资产结构</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['source:source:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="connect(scope.row)"
v-hasPermi="['source:source:connect']"
>测试连接</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['source:source: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="80%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<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.sourceName" 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.hostAddress" placeholder="请输入主机地址" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="主机端口" prop="port">
<el-input v-model="form.hostNumber" placeholder="请输入主机地址" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="数据接入类型" prop="type">
<el-select style="width: 100%" v-model="form.accessId">
<el-option
v-for="item in type"
:key="item.id"
:label="item.accessName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="数据库名称" prop="databaseName">
<el-input v-model="form.databaseName" 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.connectionParameters" 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.initialize" placeholder="请输入初始连接数量" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="最大连接数量" prop="maxNum">
<el-input v-model="form.maxInitialize" placeholder="请输入最大连接数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="最大等待时间" prop="maxWaitTime">
<el-input v-model="form.maxWaitingTime" placeholder="请输入最大等待时间" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="最大等待次数" prop="maxWaitSize">
<el-input v-model="form.maxIsoFrequency" 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 {listSource, getSource, delSource, addSource, updateSource, typeList, connectTest, synchronization} from "@/api/source/source";
export default {
name: "Source",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
accessList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
sourceName: null,
systemName: null,
databaseName: null
},
type:[],
//
form: {},
//
rules: {
sourceName: [
{required: true, message: "接入源名称不能为空", trigger: "blur"}
],
systemName: [
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
],
accessId: [
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
],
hostAddress: [
{required: true, message: "主机地址不能为空", trigger: "blur"}
],
hostNumber: [
{required: true, message: "主键端口号不能为空", trigger: "blur"}
],
databaseName: [
{required: true, message: "数据库名称不能为空", trigger: "blur"}
],
connectionParameters: [
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
],
initialize: [
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
],
maxInitialize: [
{required: true, message: "最大连接数量不能为空", trigger: "blur"}
],
maxWaitingTime: [
{required: true, message: "最大等待时间不能为空", trigger: "blur"}
],
maxIsoFrequency: [
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
]
},
dataSourceParamList: [
{
name: null,
val: null
}
]
};
},
created() {
this.getList();
},
methods: {
syncAssetsStructure(row){
console.log(row)
synchronization(row).then(res=>{
console.log(res)
})
},
//
connect(row){
connectTest(row.id).then(res=>{
if (res.code == 200) {
this.$message.success(res.data)
}else {
this.$message.success(res.msg)
}
})
},
//
addParam(){
this.dataSourceParamList.push({
name: null,
val: null
})
},
//
deleteParam(index){
if (index != null){
this.dataSourceParamList.splice(index, 1);
}else {
this.dataSourceParamList = []
}
this.processParam();
},
processParam(){
this.form.connectionParameters = this.dataSourceParamList
.filter(item => item.name != null || item.val != null)
.map(item => {
return item.name + "=" + item.val;
}).join("&")
console.log(this.form.connectionParameters)
},
/** 查询数据接入基本信息列表 */
getList() {
this.loading = true;
listSource(this.queryParams).then(response => {
this.accessList = response.data.rows;
console.log(this.accessList)
this.total = response.data.total;
this.loading = false;
});
typeList().then(res=>{
this.type=res.data
})
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
sourceName: null,
systemName: null,
hostAddress: null,
hostNumber: null,
accessId: null,
connectionParameters: null,
initialize: 5,
maxInitialize: 20,
maxWaitingTime: 3000,
maxIsoFrequency: 3,
databaseName: 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 = "添加数据接入基本信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
this.form = row;
this.dataSourceParamList = [];
getSource(id).then(response => {
this.form.connectionParameters.split("&").forEach(param => {
let paramArr = param.split("=");
this.dataSourceParamList.push({
name: paramArr[0],
val: paramArr[1]
})
})
this.form = response.data;
this.open = true;
this.title = "修改数据接入基本信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSource(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSource(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 delSource(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('source/source/export', {
...this.queryParams
}, `source_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -234,7 +234,9 @@ export default {
getList() {
this.loading = true;
listDept(this.queryParams).then(response => {
console.log(response.data)
this.deptList = this.handleTree(response.data, "deptId");
console.log(this.deptList)
this.loading = false;
});
},

View File

@ -99,6 +99,14 @@
</el-table-column>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<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
v-hasPermi="['system:notice:edit']"
icon="el-icon-edit"
@ -148,6 +156,17 @@
</el-select>
</el-form-item>
</el-col>
<el-col v-show="form.noticeType == 2">
<span style="margin-right: 15px;margin-left: 10px"><b>公告时间</b></span>
<el-date-picker
v-model="form.time"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-col>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
@ -171,18 +190,85 @@
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
<el-tabs v-show="form.noticeType == 1" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="部门" name="section">
{{ form.sectionList }}
<el-cascader
v-model="form.sectionList"
:options="options1"
:props="props"
style="width: 350px"
clearable>
</el-cascader>
</el-tab-pane>
<el-tab-pane label="特定人员" name="personnel">
{{ form.personnelList }}
<el-select v-model="form.personnelList" multiple placeholder="请选择特定人员">
<el-option
v-for="item in options"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-tab-pane>
</el-tabs>
</el-dialog>
<el-dialog
title="通知详情"
:visible.sync="numVisable"
width="40%">
<el-row :gutter="20">
<el-col :span="6">
<div>
<el-statistic
:value="asUserDeptNum.num"
title="总共通知数量"
></el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic
:value="asUserDeptNum.readNum"
title="已阅读通知数量"
></el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic
:value="asUserDeptNum.noReadNum"
title="未阅读通知数量"
></el-statistic>
</div>
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="numVisable = false"> </el-button>
<el-button type="primary" @click="numVisable = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {addNotice, delNotice, getNotice, listNotice, 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 {
name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
data() {
return {
sectionList:[],
personnelList:[],
props: { multiple: true },
options1: [],
options: [],
activeName: '部门',
//
loading: true,
//
@ -209,6 +295,13 @@ export default {
createBy: undefined,
status: undefined
},
queryParam: {
pageNum: 1,
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
},
//
form: {},
//
@ -219,13 +312,37 @@ export default {
noticeType: [
{required: true, message: "公告类型不能为空", trigger: "change"}
]
}
},
asUserDeptNum: {},
numVisable: false
};
},
created() {
this.getList();
},
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() {
this.loading = true;
@ -247,7 +364,9 @@ export default {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
status: "0"
status: "0",
sectionList:[],
personnelList:[]
};
this.resetForm("form");
},
@ -272,6 +391,24 @@ export default {
this.reset();
this.open = true;
this.title = "添加公告";
listDept(this.queryParam).then(response => {
this.options1 = this.handleTree(response.data, "deptId");
console.log(this.options1)
this.options1.forEach(op => {
this.$set(op, 'value', op.deptId);
delete op.deptId;
this.$set(op, 'label', op.deptName);
delete op.deptName;
if (op.children){
this.recursion(op.children)
}
})
this.loading = false;
})
listUser(this.addDateRange(this.queryParams, [])).then(response => {
this.options = response.data.rows;
console.log(this.options)
})
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -630,6 +630,7 @@ export default {
}).then(({value}) => {
resetUserPwd(row.userId, value).then(response => {
this.$modal.msgSuccess("修改成功,新密码是:" + value);
list(this.queryParam).then(res=>{
const userList = res.data.rows
userList.forEach(userInfo=>{

View File

@ -182,6 +182,7 @@ export default {
submitForm() {
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
const genForm = this.$refs.genInfo.$refs.genInfoForm;
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
const validateResult = res.data.every(item => !!item);
if (validateResult) {