Merge branch 'master' into b_lms2
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
<template>
|
||||
<el-popover
|
||||
placement="top-end"
|
||||
width="450"
|
||||
width="900"
|
||||
trigger="manual"
|
||||
v-model="visible">
|
||||
点击信息标识已读
|
||||
<div style="margin: 5px" v-loading="loading">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane :label="d.label" :name="d.value" v-for="d in dict.notice_type" :key="d.id">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" >
|
||||
<el-tab-pane :label="d.label" :name="d.value" v-for="d in dict.notice_type" :key="d.id" >
|
||||
<el-empty v-if="notReadMsgList && notReadMsgList[d.value-1] && notReadMsgList[d.value-1].length === 0" description="暂无信息" ></el-empty>
|
||||
<div v-for="o in notReadMsgList[d.value-1]" :key="o.notice_id">
|
||||
<a href="javascript:" @click="showMessage(o)">
|
||||
<el-row @click="showMessage">
|
||||
<el-col :span="6">
|
||||
<el-col :span="2">
|
||||
<el-tag type="danger">{{ dict.label.notice_type[o.notice_type] }}</el-tag>
|
||||
</el-col>
|
||||
<el-col :span="9" style="font-weight: bolder">{{o.notice_title}}</el-col>
|
||||
<el-col :span="9" style="color: #cccccc">{{o.create_time}}</el-col>
|
||||
<el-col :span="15" style="font-weight: bolder">{{o.notice_title}}</el-col>
|
||||
<el-col :span="7" style="color: #cccccc">{{o.create_time}}</el-col>
|
||||
</el-row>
|
||||
<el-divider ></el-divider>
|
||||
</a>
|
||||
@@ -38,6 +39,7 @@
|
||||
<script>
|
||||
import crudNotice from './sysNotice'
|
||||
import { NOTICE_MESSAGE_UPDATE, NOTICE_SHOW_MESSAGE } from './VueBaseCode'
|
||||
import crudStage from '@/api/logicflow/stage'
|
||||
export default {
|
||||
dicts: ['deal_status', 'have_read_type', 'notice_type'],
|
||||
name: 'NoticeIcon',
|
||||
@@ -45,7 +47,7 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
visible: false,
|
||||
activeName: '1',
|
||||
activeName: '2',
|
||||
// 未读消息数量
|
||||
notReadMsgCount: 0,
|
||||
// 消息内容
|
||||
@@ -85,6 +87,19 @@ export default {
|
||||
this.notReadMsgCount = res
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
// js提供的clearInterval方法用来清除定时器
|
||||
console.log('定时器销毁')
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
// 定时获取消息数量
|
||||
initStageData() {
|
||||
// todo: 定时器
|
||||
this.timer = setInterval(() => {
|
||||
console.log('定时器启动')
|
||||
this.receivedCount()
|
||||
}, 50000)
|
||||
},
|
||||
/**
|
||||
* 查看消息
|
||||
*/
|
||||
@@ -92,6 +107,7 @@ export default {
|
||||
// 标记已读
|
||||
crudNotice.read(message.notice_id).then(() => {
|
||||
this.receivedCount()
|
||||
this.getMessage()
|
||||
})
|
||||
this.$bus.emit(NOTICE_SHOW_MESSAGE, message)
|
||||
this.visible = false
|
||||
@@ -113,6 +129,7 @@ export default {
|
||||
mounted() {
|
||||
this.getMessage()
|
||||
this.receivedCount()
|
||||
this.initStageData()
|
||||
this.$bus.on(NOTICE_MESSAGE_UPDATE, this.receivedCount) // 监听事件
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
const id = '123'
|
||||
// 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
|
||||
// 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
|
||||
const socketUrl = process.env.VUE_APP_WS_API + id
|
||||
const socketUrl = window.g.prod.VUE_APP_BASE_API + id
|
||||
this.socket = new WebSocket(socketUrl)
|
||||
// 监听socket打开
|
||||
this.socket.onopen = function() {
|
||||
|
||||
@@ -383,6 +383,10 @@ export default {
|
||||
person_name: [
|
||||
{ required: true, message: '请输入用户姓名', trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入用户密码', trigger: 'blur' },
|
||||
{ pattern: /^(?=.*\d)(?=.*[A-z])[\da-zA-Z]{6,12}$/, message: '长度6位以上,数字+密码', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
syncDrawer: false,
|
||||
@@ -469,7 +473,7 @@ export default {
|
||||
},
|
||||
// 新增前将多选的值设置为空
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
this.form.password = '123456'
|
||||
this.form.password = 'HL123456'
|
||||
this.roleDatas = []
|
||||
},
|
||||
// 初始化编辑时候的角色与岗位
|
||||
@@ -627,10 +631,10 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
row.password = '123456'
|
||||
row.password = 'HL123456'
|
||||
crudUser.edit(row).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('密码重置成功,密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.notify('密码重置成功,密码:HL123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user