Browse Source

通知管理/系统日志

master
xuhuajiao 1 year ago
parent
commit
e0efd944ac
  1. 56
      src/api/system/logs.js
  2. 85
      src/views/system/log/errorLog/index.vue
  3. 6
      src/views/system/log/index.vue
  4. 83
      src/views/system/log/loginLog/index.vue
  5. 93
      src/views/system/log/operateLog/index.vue
  6. 149
      src/views/system/log/search.vue
  7. 25
      src/views/system/notifyManage/index.vue
  8. 8
      src/views/system/notifyManage/module/detail.vue
  9. 8
      src/views/system/notifyManage/module/selectObj.vue

56
src/api/system/logs.js

@ -1,56 +1,29 @@
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs' import qs from 'qs'
// 报警日志 手动处理
export function warnRemark(data) {
// 清空登录日志
export function FetchClearLoginLog(data) {
return request({ return request({
url: 'api/alarmlog/remark',
url: '/api/log/clearLoginLog',
method: 'post', method: 'post',
data data
}) })
} }
// ------通知管理-------
export function getNoticeList(params) {
// 清空操作日志
export function FetchClearLog(data) {
return request({ return request({
url: 'api/notice/initNotice',
method: 'get',
params
})
}
// 获取用户
export function getAllUser(params) {
return request({
url: 'api/users/all',
method: 'get',
params
})
}
// 获取设备
export function getAllDev(params) {
return request({
url: 'api/device/all',
method: 'get',
params
})
}
// 发布
export function noticeCreate(data) {
return request({
url: 'api/notice/create',
url: '/api/log/clearLog',
method: 'post', method: 'post',
data data
}) })
} }
// 删除
export function noticeDel(data) {
// 清空报错日志
export function FetchClearErrorLog(data) {
return request({ return request({
url: '/api/notice/delete',
method: 'delete',
url: '/api/log/clearErrorLog',
method: 'post',
data data
}) })
} }
@ -83,12 +56,9 @@ export function userMsgDel(data) {
} }
export default { export default {
warnRemark,
noticeCreate,
getNoticeList,
getAllUser,
getAllDev,
noticeDel,
FetchClearLoginLog,
FetchClearLog,
FetchClearErrorLog,
getUserNotice, getUserNotice,
isread, isread,
userMsgDel userMsgDel

85
src/views/system/log/errorLog/index.vue

@ -1,8 +1,8 @@
<template> <template>
<div>
<Search />
<div style="height: calc(100vh - 236px);">
<Search :is-log-type="isLogType" @handleClearErrorData="handleDelt" />
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler" @cell-dblclick="tableDoubleClick">
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" height="calc(100vh - 435px)" @selection-change="crud.selectionChangeHandler" @row-click="clickRowHandler" @cell-dblclick="tableDoubleClick">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" type="expand"> <el-table-column align="center" type="expand">
<template slot-scope="props"> <template slot-scope="props">
@ -16,10 +16,10 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="account" label="账号" />
<el-table-column align="center" prop="username" label="用户名" />
<el-table-column prop="username" label="所属全宗" align="center" />
<el-table-column prop="det" label="所属部门" align="center" />
<el-table-column align="center" prop="username" label="账号" />
<el-table-column align="center" prop="nickName" label="用户名" />
<el-table-column prop="fondsName" label="所属全宗" align="center" />
<el-table-column prop="deptsName" label="所属部门" align="center" />
<el-table-column align="center" prop="requestIp" label="IP" /> <el-table-column align="center" prop="requestIp" label="IP" />
<el-table-column align="center" :show-overflow-tooltip="true" prop="address" label="IP来源" /> <el-table-column align="center" :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column align="center" prop="description" label="内容描述" /> <el-table-column align="center" prop="description" label="内容描述" />
@ -29,11 +29,6 @@
<div>{{ scope.row.createTime | parseTime }}</div> <div>{{ scope.row.createTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="异常详情" width="100px">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="info(scope.row.id)">查看详情</el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
<el-dialog :visible.sync="dialog" title="异常详情" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body top="30px"> <el-dialog :visible.sync="dialog" title="异常详情" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body top="30px">
<span class="dialog-right-top" /> <span class="dialog-right-top" />
@ -43,25 +38,15 @@
</div> </div>
</el-dialog> </el-dialog>
<!--分页组件--> <!--分页组件-->
<pagination />
<!-- 清空 -->
<el-dialog :visible.sync="delVisible" title="确认清空" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body>
<div class="setting-dialog">
<p class="delMsg" style="padding-top:20px">确认清空所有操作日志吗?</p>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmDelAll">确定</el-button>
</div>
</div>
</el-dialog>
<pagination v-if="crud.data.length !== 0" />
</div> </div>
</template> </template>
<script> <script>
import { getErrDetail, delAllError } from '@/api/monitor/log'
// import { FetchClearErrorLog } from '@/api/system/logs'
import Search from '@/views/system/log/search.vue' import Search from '@/views/system/log/search.vue'
import CRUD, { presenter } from '@crud/crud' import CRUD, { presenter } from '@crud/crud'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
export default { export default {
name: 'ErrorLog', name: 'ErrorLog',
components: { Search, pagination }, components: { Search, pagination },
@ -71,7 +56,9 @@ export default {
mixins: [presenter()], mixins: [presenter()],
data() { data() {
return { return {
errorInfo: '', dialog: false, delVisible: false
isLogType: 'error',
errorInfo: '',
dialog: false
} }
}, },
created() { created() {
@ -79,43 +66,39 @@ export default {
add: false, add: false,
edit: false, edit: false,
del: false, del: false,
download: true,
reset: true,
download: false,
reset: false,
group: false group: false
} }
}, },
methods: { methods: {
//
info(id) {
this.dialog = true
getErrDetail(id).then(res => {
this.errorInfo = res.exception
})
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row) //
}, },
// table - // table -
tableDoubleClick(row) { tableDoubleClick(row) {
this.dialog = true this.dialog = true
getErrDetail(row.id).then(res => {
this.errorInfo = res.exception
})
// getErrDetail(row.id).then(res => {
// this.errorInfo = res.exception
// })
}, },
confirmDelAll() {
// this.$confirm(`?`, '', {
// confirmButtonText: '',
handleDelt() {
console.log('清空异常日志')
// this.$confirm('' + this.crud.title + '<span></span>', '', {
// confirmButtonText: '',
// cancelButtonText: '', // cancelButtonText: '',
// type: 'warning'
// type: 'warning',
// dangerouslyUseHTMLString: true
// }).then(() => { // }).then(() => {
this.crud.delAllLoading = true
delAllError().then(res => {
this.crud.delAllLoading = false
this.crud.dleChangePage(1)
this.crud.delSuccessNotify()
this.crud.toQuery()
this.delVisible = false
}).catch(err => {
this.crud.delAllLoading = false
console.log(err.response.data.message)
})
// this.crud.delAllLoading = true
// FetchClearErrorLog().then(() => {
// this.crud.notify('', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.crud.delAllLoading = false
// this.crud.refresh()
// }).catch(err => {
// this.crud.delAllLoading = false
// console.log(err)
// })
// }).catch(() => { // }).catch(() => {
// }) // })
} }

6
src/views/system/log/index.vue

@ -17,9 +17,9 @@
</template> </template>
<script> <script>
import loginLog from './loginLog/index.vue'
import operateLog from './operateLog/index.vue'
import errorLog from './errorLog/index.vue'
import loginLog from './loginLog/index'
import operateLog from './operateLog/index'
import errorLog from './errorLog/index'
export default { export default {
name: 'LogManage', name: 'LogManage',

83
src/views/system/log/loginLog/index.vue

@ -1,12 +1,13 @@
<template> <template>
<div>
<Search />
<div style="height: calc(100vh - 236px);">
<Search :is-log-type="isLogType" @handleClearData="handleDelt" />
<el-table <el-table
ref="table" ref="table"
:data="crud.data" :data="crud.data"
style="width: 100%;" style="width: 100%;"
height="calc(100vh - 435px)"
@row-click="clickRowHandler" @row-click="clickRowHandler"
@selection-change="selectionChangeHandler"
@selection-change="crud.selectionChangeHandler"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column prop="account" label="账号" min-width="150" align="center" /> <el-table-column prop="account" label="账号" min-width="150" align="center" />
@ -25,26 +26,29 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination />
<pagination v-if="crud.data.length !== 0" />
</div> </div>
</template> </template>
<script> <script>
import { FetchClearLoginLog } from '@/api/system/logs'
import CRUD, { presenter, crud, header } from '@crud/crud' import CRUD, { presenter, crud, header } from '@crud/crud'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import Search from '@/views/system/log/search.vue' import Search from '@/views/system/log/search.vue'
import { mapGetters } from 'vuex'
import { parseTime, saveAs, getBlob } from '@/utils/index'
import qs from 'qs'
// import { parseTime, saveAs, getBlob } from '@/utils/index'
export default { export default {
name: 'LoginLog', name: 'LoginLog',
components: { pagination, Search }, components: { pagination, Search },
filters: { filters: {
parseRole(val) { parseRole(val) {
const arr = val.split(',')
const arr1 = arr.filter(item => item.includes('name'))
const role = arr1[0].split('=')[1]
const regex = /name=(.*)\)/
const match = regex.exec(val)
let role = ''
if (match) {
role = match[1]
} else {
role = val
}
return role return role
} }
}, },
@ -52,49 +56,54 @@ export default {
cruds() { cruds() {
return CRUD({ return CRUD({
url: 'api/log/initLoginLog', url: 'api/log/initLoginLog',
// sort: ['update_time,desc'],
// crudMethod: caseCrudMethod,
sort: [],
optShow: { optShow: {
add: false, add: false,
edit: false, edit: false,
del: false, del: false,
download: true,
reset: true,
download: false,
reset: false,
group: false group: false
} }
}) })
}, },
data() { data() {
return { return {
selections: [],
keyWord: '',
queryTime: null
isLogType: 'login',
selections: []
} }
}, },
computed: {
...mapGetters([
'baseApi'
])
},
methods: { methods: {
//
handleDownload() {
this.crud.downloadLoading = true
const fileName = parseTime(new Date()) + '-登录日志'
getBlob(this.baseApi + '/api/loginlogs/download' + '?' + qs.stringify(this.crud.query, { indices: false }), function(blob) {
saveAs(blob, fileName)
handleDelt() {
this.$confirm('此操作将清空所选数据' + this.crud.title + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.crud.delAllLoading = true
FetchClearLoginLog().then(() => {
this.crud.notify('清空成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.delAllLoading = false
this.crud.refresh()
}).catch(err => {
this.crud.delAllLoading = false
console.log(err)
})
}).catch(() => {
}) })
this.crud.downloadLoading = false
},
test() {
console.log(this.crud, 'crud')
}, },
//
// handleDownload() {
// this.crud.downloadLoading = true
// const fileName = parseTime(new Date()) + '-'
// getBlob(this.baseApi + '/api/loginlogs/download' + '?' + qs.stringify(this.crud.query, { indices: false }), function(blob) {
// saveAs(blob, fileName)
// })
// this.crud.downloadLoading = false
// },
clickRowHandler(row) { clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row) // this.$refs.table.toggleRowSelection(row) //
},
selectionChangeHandler(val) {
this.selections = val
} }
} }
} }

93
src/views/system/log/operateLog/index.vue

@ -1,11 +1,13 @@
<template> <template>
<div>
<Search />
<!-- height="calc(100vh - 356px)" -->
<div style="height: calc(100vh - 236px);">
<Search :is-log-type="isLogType" @handleClearOperateData="handleDelt" />
<el-table <el-table
ref="table" ref="table"
:data="crud.data" :data="crud.data"
style="width: 100%;" style="width: 100%;"
height="calc(100vh - 435px)"
@row-click="clickRowHandler"
@selection-change="crud.selectionChangeHandler"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column type="expand"> <el-table-column type="expand">
@ -20,11 +22,10 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column type="index" label="序号" width="100" align="center" /> -->
<el-table-column prop="account" label="账号" align="center" />
<el-table-column prop="username" label="用户名" align="center" />
<el-table-column prop="username" label="所属全宗" align="center" />
<el-table-column prop="det" label="所属部门" align="center" />
<el-table-column align="center" prop="username" label="账号" />
<el-table-column align="center" prop="nickName" label="用户名" />
<el-table-column prop="fondsName" label="所属全宗" align="center" />
<el-table-column prop="deptsName" label="所属部门" align="center" />
<el-table-column prop="requestIp" label="IP" align="center" /> <el-table-column prop="requestIp" label="IP" align="center" />
<el-table-column prop="address" label="IP来源" align="center" /> <el-table-column prop="address" label="IP来源" align="center" />
<el-table-column prop="description" label="内容描述" align="center" /> <el-table-column prop="description" label="内容描述" align="center" />
@ -41,25 +42,19 @@
<div>{{ scope.row.createTime | parseTime }}</div> <div>{{ scope.row.createTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="" label="操作时间" align="center" min-width="180" /> -->
<!-- <el-table-column prop="" label="操作" align="center" min-width="100">
<el-button size="mini" style="background:#3A99FD" @click="handleListen">查看监控</el-button>
</el-table-column> -->
</el-table> </el-table>
<pagination />
<!-- 查看监控 -->
<!-- <Listen ref="listenDom" /> -->
<pagination v-if="crud.data.length !== 0" />
</div> </div>
</template> </template>
<script> <script>
// import { FetchClearLog } from '@/api/system/logs'
import Search from '@/views/system/log/search.vue'
import CRUD, { presenter, crud } from '@crud/crud' import CRUD, { presenter, crud } from '@crud/crud'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import Search from '@/views/system/log/search.vue'
import { delAllInfo } from '@/api/monitor/log'
export default { export default {
name: 'LoginLog',
name: 'OperateLog',
components: { pagination, Search }, components: { pagination, Search },
mixins: [presenter(), crud()], mixins: [presenter(), crud()],
cruds() { cruds() {
@ -70,53 +65,41 @@ export default {
add: false, add: false,
edit: false, edit: false,
del: false, del: false,
download: true,
reset: true,
download: false,
reset: false,
group: false group: false
} }
}) })
}, },
data() { data() {
return { return {
selections: [],
keyWord: '',
oprType: 0,
oprTypeOptions: [
{ value: 0, label: '全部' },
{ value: 1, label: '成功' },
{ value: 2, label: '失败' }
],
optionVal: 1,
options: [
{ value: 1, label: '操作人' },
{ value: 2, label: '所属部门' }
],
queryTime: null
isLogType: 'operate',
selections: []
} }
}, },
methods: { methods: {
// clickRowHandler(row) {
// this.$refs.table.toggleRowSelection(row) //
// },
// selectionChangeHandler(val) {
// this.selections = val
// },
//
handleListen() {
this.$refs.listenDom.dialogVisible = true
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row) //
}, },
confirmDelAll() {
this.crud.delAllLoading = true
delAllInfo().then(res => {
this.crud.delAllLoading = false
this.crud.dleChangePage(1)
this.crud.delSuccessNotify()
this.crud.toQuery()
this.delVisible = false
}).catch(err => {
this.crud.delAllLoading = false
console.log(err.response.data.message)
})
handleDelt() {
console.log('清空操作日志')
// this.$confirm('' + this.crud.title + '<span></span>', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// dangerouslyUseHTMLString: true
// }).then(() => {
// this.crud.delAllLoading = true
// FetchClearLog().then(() => {
// this.crud.notify('', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.crud.delAllLoading = false
// this.crud.refresh()
// }).catch(err => {
// this.crud.delAllLoading = false
// console.log(err)
// })
// }).catch(() => {
// })
} }
} }
} }

149
src/views/system/log/search.vue

@ -1,18 +1,16 @@
<template> <template>
<div class="head-container"> <div class="head-container">
<!-- <crudOperation /> -->
<!-- <el-button v-permission="permission.download" :loading="crud.downloadLoading" :disabled="!selections.length" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> -->
<div class="head-search"> <div class="head-search">
<el-input <el-input
v-model="query.blurry"
v-model="keyWord"
size="small" size="small"
clearable clearable
placeholder="请输入关键词" placeholder="请输入关键词"
style="width: 300px;" style="width: 300px;"
class="input-prepend filter-item" class="input-prepend filter-item"
@clear="crud.toQuery"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
> >
<!-- <el-select slot="prepend" v-model="optionVal" style="width: 100px" @keyup.enter.native="crud.toQuery"> -->
<el-select slot="prepend" v-model="optionVal" style="width: 92px"> <el-select slot="prepend" v-model="optionVal" style="width: 92px">
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -22,12 +20,19 @@
/> />
</el-select> </el-select>
</el-input> </el-input>
<date-range-picker v-model="query.createTime" class="date-item" />
<rrOperation />
<date-range-picker v-model="blurryTime" class="date-item" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery">搜索</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
</div> </div>
<crudOperation :permission="permission">
<crudOperation>
<template v-slot:left> <template v-slot:left>
<el-button :loading="crud.downloadLoading" size="mini" @click="delVisible=true"><i class="iconfont icon-shanchu" />清空</el-button>
<el-button :loading="crud.downloadLoading" size="mini" @click="handleComfiredDelt"><i class="iconfont icon-shanchu" />清空</el-button>
</template>
<template v-slot:right>
<el-button :loading="crud.downloadLoading" size="mini" :disabled="crud.selections.length === 0" @click="doExport(crud.selections)">
<i class="iconfont icon-daochu" />
导出
</el-button>
</template> </template>
</crudOperation> </crudOperation>
<!-- <el-button :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> --> <!-- <el-button :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> -->
@ -41,7 +46,6 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="delVisible = false">取消</el-button> <el-button type="text" @click="delVisible = false">取消</el-button>
<el-button type="primary">继续</el-button> <el-button type="primary">继续</el-button>
<!-- @click="confirmDelAll" -->
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -49,26 +53,129 @@
</template> </template>
<script> <script>
import { header, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import CRUD, { header, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import { mapGetters } from 'vuex'
import { exportFile } from '@/utils/index'
import qs from 'qs'
export default { export default {
components: { rrOperation, DateRangePicker, crudOperation },
components: { DateRangePicker, crudOperation },
mixins: [header(), crud()], mixins: [header(), crud()],
props: {
isLogType: {
type: String,
default: ''
}
},
data() { data() {
return { return {
blurryTime: [],
delVisible: false, delVisible: false,
optionVal: 1,
options: [
{ value: 1, label: '用户名' },
{ value: 2, label: '所属部门' },
{ value: 3, label: '登录账号' },
{ value: 4, label: '请求方法' },
{ value: 5, label: '请求参数' }
],
permission: {}
keyWord: '',
optionVal: 'username',
options: []
}
},
computed: {
...mapGetters([
'baseApi'
])
},
created() {
if (this.isLogType === 'error') {
this.options = [
{ value: 'username', label: '用户名' },
{ value: 'account', label: '登录账号' },
{ value: 'method', label: '请求方法' },
{ value: 'params', label: '请求参数' }
]
} else {
this.options = [
{ value: 'username', label: '用户名' },
{ value: 'det', label: '所属部门' },
{ value: 'account', label: '登录账号' }
]
} }
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query[this.optionVal] = this.keyWord
if (this.blurryTime) {
this.crud.query.startTime = this.blurryTime[0]
this.crud.query.endTime = this.blurryTime[1]
} else {
this.crud.query.startTime = null
this.crud.query.endTime = null
}
},
resetQuery() {
if (this.isLogType === 'error') {
this.options = [
{ value: 'username', label: '用户名' },
{ value: 'account', label: '登录账号' },
{ value: 'method', label: '请求方法' },
{ value: 'params', label: '请求参数' }
]
} else {
this.options = [
{ value: 'username', label: '用户名' },
{ value: 'det', label: '所属部门' },
{ value: 'account', label: '登录账号' }
]
}
this.keyWord = ''
this.crud.query[this.optionVal] = this.keyWord
this.blurryTime = null
this.crud.query.startTime = null
this.crud.query.endTime = null
this.crud.toQuery()
},
handleComfiredDelt() {
if (this.isLogType === 'login') {
this.$emit('handleClearData')
} else if (this.isLogType === 'operate') {
this.$emit('handleClearOperateData')
} else {
this.$emit('handleClearErrorData')
}
},
doExport(data) {
console.log(data)
crud.downloadLoading = true
this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const ids = []
data.forEach(val => {
ids.push(val.id)
})
if (this.isLogType === 'login') {
console.log('导出 - 登录日志')
const params = {
'deptsIds': ids
}
exportFile(this.baseApi + '/api/depts/download?' + qs.stringify(params, { indices: false }))
} else if (this.isLogType === 'operate') {
console.log('导出 - 操作日志')
const params = {
'deptsIds': ids
}
exportFile(this.baseApi + '/api/depts/download?' + qs.stringify(params, { indices: false }))
} else {
console.log('导出 - 错误日志')
const params = {
'deptsIds': ids
}
exportFile(this.baseApi + '/api/depts/download?' + qs.stringify(params, { indices: false }))
}
}).catch(() => {
})
}
} }
} }
</script> </script>

25
src/views/system/notifyManage/index.vue

@ -28,31 +28,31 @@
@row-dblclick="handleDbClick" @row-dblclick="handleDbClick"
> >
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="noticeType" label="消息类型" align="center" min-width="100">
<el-table-column prop="noticaType" label="消息类型" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.noticeType===0">系统消息</span>
<span v-if="scope.row.noticaType === 0">系统消息</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="noticeTitle" :show-overflow-tooltip="true" label="标题" min-width="150" align="center" /> <el-table-column prop="noticeTitle" :show-overflow-tooltip="true" label="标题" min-width="150" align="center" />
<el-table-column prop="noticeContext" :show-overflow-tooltip="true" label="内容" align="center" min-width="200" /> <el-table-column prop="noticeContext" :show-overflow-tooltip="true" label="内容" align="center" min-width="200" />
<el-table-column :show-overflow-tooltip="true" label="发送对象" align="center" min-width="200"> <el-table-column :show-overflow-tooltip="true" label="发送对象" align="center" min-width="200">
<template v-if="scope.row.noticeDevices.length !== 0" slot-scope="scope">
{{ scope.row.noticeDevices.join(',') }}
<template v-if="scope.row.noticeDevices !== ''" slot-scope="scope">
{{ scope.row.noticeDevices }}
<!-- <div class="tag-hidden"> <!-- <div class="tag-hidden">
<el-tag v-for="(item,i) in scope.row.noticeDevices" :key="i" style="margin-left:3px; color: #fff">{{ item }}</el-tag> <el-tag v-for="(item,i) in scope.row.noticeDevices" :key="i" style="margin-left:3px; color: #fff">{{ item }}</el-tag>
</div> --> </div> -->
</template> </template>
<template v-if="scope.row.noticeUsers.length !== 0" slot-scope="scope">
<template v-if="scope.row.noticeUsers !== ''" slot-scope="scope">
<!-- <div class="tag-hidden"> <!-- <div class="tag-hidden">
<el-tag v-for="(item,i) in scope.row.noticeUsers" :key="i" style="margin-left:3px; color: #fff">{{ item }}</el-tag>
<el-tag v-for="(item,i) in scope.row.noticeUsers" :key="i" style="margin-left:3px; ">{{ item.pushUserName }}</el-tag>
</div> --> </div> -->
{{ scope.row.noticeUsers.join(',') }}
{{ scope.row.noticeUsers }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_by" label="创建人" align="center" min-width="100" />
<el-table-column prop="create_time" label="创建时间" align="center" min-width="180">
<el-table-column prop="createBy" label="创建人" align="center" min-width="100" />
<el-table-column prop="createTime" label="创建时间" align="center" min-width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
<div>{{ scope.row.createTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -85,7 +85,7 @@
</el-form-item> </el-form-item>
<el-form-item label="发送对象" prop="userId"> <el-form-item label="发送对象" prop="userId">
<div class="send-obj"> <div class="send-obj">
<span v-if="pushObjItem.length === 0">点击下方按钮选择对象</span>
<span v-if="pushObjItem.length === 0" style="color: rgb(206,209,216)">点击下方按钮选择对象</span>
<el-tag <el-tag
v-for="tag in pushObjItem" v-for="tag in pushObjItem"
v-else v-else
@ -218,5 +218,8 @@ export default {
padding: 0 10px; padding: 0 10px;
border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px;
border: 1px solid #E6E8ED; border: 1px solid #E6E8ED;
.el-tag{
margin-right: 10px;
}
} }
</style> </style>

8
src/views/system/notifyManage/module/detail.vue

@ -17,13 +17,13 @@
<div class="notify-item"> <div class="notify-item">
<span class="notify-title">发送对象</span> <span class="notify-title">发送对象</span>
<div class="notify-cont"> <div class="notify-cont">
<p v-if="rowData.noticeDevices.length !== 0">{{ rowData.noticeDevices.join('') }}</p>
<p v-if="rowData.noticeUsers.length !== 0">{{ rowData.noticeUsers.join('') }}</p>
<p v-if="rowData.noticeDevices && rowData.noticeDevices !== ''">{{ rowData.noticeDevices }}</p>
<p v-if="rowData.noticeUsers && rowData.noticeUsers !== ''">{{ rowData.noticeUsers }}</p>
</div> </div>
</div> </div>
<div class="notify-create"> <div class="notify-create">
<span>创建人{{ rowData.create_by }}</span>
<span>创建时间{{ rowData.create_time | parseTime }}</span>
<span>创建人{{ rowData.createBy }}</span>
<span>创建时间{{ rowData.createTime | parseTime }}</span>
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">

8
src/views/system/notifyManage/module/selectObj.vue

@ -28,9 +28,13 @@
<div class="obj-list"> <div class="obj-list">
<!-- <i class="el-icon-circle-plus-outline" /> --> <!-- <i class="el-icon-circle-plus-outline" /> -->
<p class="obj-title">用户列表</p> <p class="obj-title">用户列表</p>
<div v-for="user in userListWithCheck" :key="user.userId">
<el-checkbox v-model="user.checked" @change="handleChange(user)">{{ user.username }}</el-checkbox>
<div v-if="userListWithCheck.length !== 0">
<div v-for="user in userListWithCheck" :key="user.userId">
<el-checkbox v-model="user.checked" @change="handleChange(user)">{{ user.username }}</el-checkbox>
</div>
</div> </div>
<div v-else style="font-size:12px; text-align: center; line-height: 80px; color: #999;">暂无数据</div>
</div> </div>
<div class="obj-selected"> <div class="obj-selected">
<p class="obj-title">已选中<i class="iconfont icon-shanchu" @click="clearSelectAll" /></p> <p class="obj-title">已选中<i class="iconfont icon-shanchu" @click="clearSelectAll" /></p>

Loading…
Cancel
Save