[add] 文档动态和我的消息迁移

This commit is contained in:
lideqin
2023-08-18 16:26:45 +08:00
parent 4f7c939bb3
commit 6b1a7feaed
6 changed files with 487 additions and 123 deletions
+19
View File
@@ -438,6 +438,25 @@ module.exports = {
fileUploaded: 'File uploaded, please wait'
}
},
// 消息中心
message: {
// 文档动态
docDynamics: {
messageContent: 'Message Content',
notificationTime: 'Notification Time'
},
// 我的消息
my: {
messageContent: 'Message Content',
messageType: 'Message Type',
allLabelsRead: 'Mark as Read',
subscriptionNotification: 'Subscription Notification',
warningInformation: 'Warning Information',
forwardPush: 'Forward Push',
notificationTime: 'Notification Time',
areAllLabelsRead: 'Are All Mark as Read'
}
},
// 标准选择器
standardSelect: {
standardSelection: 'Standard Selection'
+19
View File
@@ -438,6 +438,25 @@ module.exports = {
fileUploaded: '文件上传中,请稍后'
}
},
// 消息中心
message: {
// 文档动态
docDynamics: {
messageContent: '消息内容',
notificationTime: '通知时间'
},
// 我的消息
my: {
messageContent: '消息内容',
messageType: '消息类型',
allLabelsRead: '标记已读',
subscriptionNotification: '订阅通知',
warningInformation: '预警信息',
forwardPush: '转发推送',
notificationTime: '通知时间',
areAllLabelsRead: '是否全部标记已读'
}
},
// 标准选择器
standardSelect: {
standardSelection: '标准选择'
@@ -394,5 +394,5 @@ export default {
</script>
<style scoped lang="less">
@import'~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,122 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8" style="line-height: 48px">
<a-form-item :label="$t('message.docDynamics.messageContent')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-input :placeholder="$t('pleaseEnter')+$t('message.docDynamics.messageContent')"
v-model="queryParam.msgContent">
</j-input>
</a-form-item>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" @click="searchReset">{{$t('reset')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div class="table-operator">
<div @click="msgContentClick" class="operator-text">
<a-icon type="delete"/>
{{$t('batchDelete')}}
</div>
</div>
<a-table
:components="drag(columns,'columns')"
ref="table"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
:dataSource="dataSource"
:scroll="{x: '100%'}"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="msgContent" slot-scope="text,scope">
<a :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" :title="text" @click="msgContentClick(scope)">
{{text}}
</a>
</span>
</a-table>
</a-card>
</template>
<script>
import { getAction } from '@/api/manage'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'DocumentDynamics',
mixins: [JeroListMixin, ResizeHeader, ResizeColumnProvide],
data () {
return {
queryParam: {},
selectedRowKeys: [],
columns: [
{
title: this.$t('message.docDynamics.messageContent'),
align: 'left',
dataIndex: 'msgContent',
ellipsis: true,
width: 700,
scopedSlots: { customRender: 'msgContent' }
},
{
title: this.$t('message.docDynamics.notificationTime'),
align: 'left',
width: 200,
dataIndex: 'createTime'
}
],
url: {
list: '/home/homeDocumentDynamicEO/page',
deleteUrl: '/home/homeDocumentDynamicEO/deleteBatch'
},
loading: false
}
},
methods: {
onSelectChange (value) {
this.selectedRowKeys = value
},
msgContentClick (row) {
row.isCustomContentList = true
this.$router.push({
path: '/modules/message/detail',
query: row
})
},
handleDel () {
if (this.selectedRowKeys.length > 0) {
this.$confirm({
content: this.$t('confirmBatchDeletion'),
onOk: () => {
getAction(this.url.deleteUrl, { ids: this.selectedRowKeys.join(',') }).then((res) => {
if (res.success) {
this.selectedRowKeys = []
this.$message.success(this.$t('operationSuccessful'))
this.loadData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('pleaseSelectData'))
}
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,95 @@
<template>
<div class="box">
<div class="box-header">
<a-icon type="left-circle" @click="iconClick" class="icon" theme="filled"/>
<span class="box-header-left-text">
{{this.$route.query.msgContent}}
</span>
<span class="box-header-right-text">
{{$t('message.docDynamics.notificationTime')}}: {{this.$route.query.sendTime || this.$route.query.createTime}}
</span>
</div>
<div class="box-content" v-html="this.$route.query.msgContentInfo">
<!-- {{this.$route.query.msgContentInfo}}-->
</div>
</div>
</template>
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: 'MessageDetails',
methods: {
iconClick () {
if (this.$route.query.isCustomContentList) {
this.$router.push({
path: '/modules/message/documentDynamics'
})
} else {
this.$router.push({
path: '/isps/userAnnouncement'
})
}
}
},
mounted () {
if (this.$route.query.msgContentInfo && this.$route.query.msgContentInfo.includes('downLoadFile')) {
const index = this.$route.query.msgContentInfo.indexOf('target')
this.$route.query.msgContentInfo = this.$route.query.msgContentInfo.slice(0, index - 2) + '&token=' + Vue.ls.get(ACCESS_TOKEN) + '\' ' +
this.$route.query.msgContentInfo.slice(index)
}
}
}
</script>
<style scoped lang="less">
.box {
width: 100%;
}
.box-header {
padding: 0 32px;
height: 68px;
line-height: 68px;
border-bottom: 2px #eff1f3 solid;
}
.icon {
font-size: 32px;
color: #00A0E9;
margin-right: 30px;
display: inline-block;
float: left;
line-height: 75px;
}
.box-header-left-text {
width: calc(100% - 420px);
font-size: 18px;
display: inline-block;
color: #040B29;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-header-right-text {
font-size: 16px;
float: right;
display: inline-block;
line-height: 88px;
color: #040B29;
opacity: 0.5;
}
.box-content {
padding: 40px 70px;
box-sizing: border-box;
color: #040B29;
font-size: 16px;
text-indent: 24px;
/*letter-spacing: 1px*/
}
</style>
+231 -122
View File
@@ -6,20 +6,30 @@
<a-row :gutter="24">
<a-col :span="6">
<a-form-item label="标题">
<a-input placeholder="请输入标题" v-model="queryParam.titile"></a-input>
<a-form-item :label="$t('message.my.messageContent')">
<a-input :placeholder="$t('pleaseEnter') + $t('message.my.messageContent')" v-model="queryParam.msgContent"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="发布人">
<a-input placeholder="请输入发布人" v-model="queryParam.sender"></a-input>
<a-form-item :label="$t('message.my.messageType')">
<a-select class="box-input"
:placeholder="$t('pleaseSelect')+$t('message.my.messageType')"
v-model="queryParam.msgCategory">
<a-select-option :value="undefined">{{ $t('pleaseSelect') }}</a-select-option>
<a-select-option v-for="(item, key) in Object.keys(msgCategoryQuery)"
:key="key" :value="item">
<span style="display: inline-block;width: 100%" :title="msgCategoryQuery[item]">
{{ msgCategoryQuery[item] }}
</span>
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button @click="searchReset" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</span>
</a-col>
@@ -28,165 +38,264 @@
</div>
<div class="table-operator">
<a-button type="primary" @click="readAll" icon="book">全部标注已读</a-button>
<div @click="readAll" class="operator-text" :title="$t('message.my.allLabelsRead')">
<a-icon type="eye" />
{{ $t('message.my.allLabelsRead') }}
</div>
<div @click="handleDel" class="operator-text">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div>
<a-table
:components="drag(columns,'columns')"
ref="table"
size="default"
bordered
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
:dataSource="dataSource"
:scroll="{x: '100%'}"
:pagination="ipagination"
:expandIconAsCell="false"
:expandIconColumnIndex="5"
:expandIcon="expandIcon"
:expandRowByClick="true"
:loading="loading"
@expand="expandChange"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="showAnnouncement(record)">查看</a>
<span slot="msgTitile" slot-scope="text,scope">
<!-- @click="msgContentClick(scope)"-->
<a :style="{'color':scope.readFlag === 0 ? 'red':'#00A0E9'}"
:title="language === 'zh-cn' && scope.msgContentCn? scope.msgContentCn : scope.msgContent">
{{ language === 'zh-cn' && scope.msgContentCn ? scope.msgContentCn : scope.msgContent }}
</a>
</span>
<span slot="msgCategory" slot-scope="text">
<!-- :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" @click="msgContentClick(scope)"-->
<span :title="msgCategoryQuery[text]">
{{ msgCategoryQuery[text] }}
</span>
</span>
<p slot="expandedRowRender" slot-scope="record" style="margin: 0;padding-left: 58px;">
<span v-html="language === 'zh-cn' && record.msgContentInfoCn? record.msgContentInfoCn : record.msgContentInfo">
</span>
</p>
</a-table>
<show-announcement ref="ShowAnnouncement"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
<!-- <show-announcement ref="ShowAnnouncement"></show-announcement>-->
<!-- <dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>-->
</a-card>
</template>
<script>
// import { filterObj } from '@/utils/util'
import { getAction, postAction } from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
// import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
// import DynamicNotice from '../../components/tools/DynamicNotice'
import { getAction, deleteAction } from '@/api/manage'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import DynamicNotice from '../../components/tools/DynamicNotice'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: 'UserAnnouncementList',
mixins: [JeroListMixin],
components: {
DynamicNotice,
ShowAnnouncement
},
mixins: [JeroListMixin, ResizeHeader, ResizeColumnProvide],
// components: {
// DynamicNotice,
// ShowAnnouncement
// },
data () {
return {
description: '系统通告表管理页面',
queryParam: {},
columns: [{
title: '标题',
align: 'center',
dataIndex: 'titile'
}, {
title: '消息类型',
align: 'center',
dataIndex: 'msgCategory',
customRender: function (text) {
if ((text + '') === '1') {
return '通知公告'
} else if ((text + '') === '2') {
return '系统消息'
} else {
return text
}
selectedRowKeys: [],
msgCategoryQuery: {
1: this.$t('message.my.subscriptionNotification'),
2: this.$t('message.my.warningInformation'),
3: this.$t('message.my.forwardPush')
// '4': this.$t('CollectinguthenticationParameters'),
// '6':this.$t('RegulationListConfirmationTask'),
// '7':this.$t('RegulationListConfirmationNotification'),
// '8':this.$t('RegulationTaskConfirmation'),
// '9':this.$t('DesignComplianceTask'),
// '10':this.$t('PreHomoTask'),
// '11':this.$t('ValidationTask'),
// '12':this.$t('DesignComplianceNotification'),
// '13':this.$t('PreHomoNotification'),
// '14':this.$t('ValidationComplianceNotification'),
// '15':this.$t('RegulationTaskConfirmationNotification'),
// '17':this.$t('listConfirmation'),
// '18':this.$t('taskAffirm'),
// '19':this.$t('complianceConfirmation'),
// '20':this.$t('collectionLegislativeComments'),
// '21':this.$t('regulatoryAndTechnicalAssessment'),
},
columns: [
{
title: this.$t('message.my.MessageContent'),
align: 'left',
dataIndex: 'msgContent',
ellipsis: true,
width: 450,
scopedSlots: { customRender: 'msgTitile' }
},
{
title: this.$t('message.my.messageType'),
align: 'left',
ellipsis: true,
dataIndex: 'msgCategory',
width: 150,
scopedSlots: { customRender: 'msgCategory' }
},
{
title: this.$t('message.my.notificationTime'),
align: 'left',
ellipsis: true,
width: 180,
dataIndex: 'sendTime'
}
}, {
title: '发布人',
align: 'center',
dataIndex: 'sender'
}, {
title: '发布时间',
align: 'center',
dataIndex: 'sendTime'
}, {
title: '优先级',
align: 'center',
dataIndex: 'priority',
customRender: function (text) {
if ((text + '') === 'L') {
return '低'
} else if ((text + '') === 'M') {
return '中'
} else if ((text + '') === 'H') {
return '高'
} else {
return text
}
}
}, {
title: '阅读状态',
align: 'center',
dataIndex: 'readFlag',
customRender: function (text) {
if ((text + '') === '0') {
return '未读'
} else if ((text + '') === '1') {
return '已读'
} else {
return text
}
}
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}],
// {
// title: '',
// align: 'left',
// ellipsis: true,
// width: 50
// }
],
url: {
list: '/sys/sysAnnouncementSend/getMyAnnouncementSend',
editCementSend: 'sys/sysAnnouncementSend/editByAnntIdAndUserId',
readAllMsg: 'sys/sysAnnouncementSend/readAll'
readAllMsg: 'sys/sysAnnouncementSend/readAll',
deleteUrl: 'sys/sysAnnouncementSend/deleteBatch'
},
loading: false,
openPath: '',
formData: ''
formData: '',
language: ''
}
},
mounted () {
this.language = localStorage.getItem('language') || ''
},
methods: {
handleDetail: function (record) {
this.$refs.sysAnnouncementModal.detail(record)
this.$refs.sysAnnouncementModal.title = '查看'
},
showAnnouncement (record) {
postAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => {
if (res.success) {
this.loadData()
this.syncHeadNotic(record.anntId)
expandIcon (props) {
if (props.expanded) {
return <a-icon type = 'down' onClick = { e => {
props.onExpand(props.record, e)
}
})
if (record.openType === 'component') {
this.openPath = record.openPage
this.formData = { id: record.busId }
this.$refs.showDynamNotice.detail()
}
/>
} else {
this.$refs.ShowAnnouncement.detail(record)
return <a-icon type="right" onClick={e => {
props.onExpand(props.record, e)
}
}
/>
}
},
syncHeadNotic (anntId) {
getAction('sys/annountCement/syncNotic', { anntId: anntId })
loadData (arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
// 加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
const params = this.getQueryParams()// 查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
if (res.result.current > 1 && res.result.records.length === 0) {
this.loadData(1)
return
}
this.dataSource = res.result.records || res.result
if (this.dataSource && this.dataSource.length > 0) {
this.dataSource.forEach(val => {
if (val.msgContentInfoCn && val.msgContentInfoCn.includes('/common/downLoadFile')) {
const index = val.msgContentInfoCn.indexOf('target')
val.msgContentInfoCn = val.msgContentInfoCn.slice(0, index - 2) + '&token=' + Vue.ls.get(ACCESS_TOKEN) + '\' ' +
val.msgContentInfoCn.slice(index)
}
if (val.msgContentInfo && val.msgContentInfo.includes('/common/downLoadFile')) {
const index = val.msgContentInfo.indexOf('target')
val.msgContentInfo = val.msgContentInfo.slice(0, index - 2) + '&token=' + Vue.ls.get(ACCESS_TOKEN) + '\' ' +
val.msgContentInfo.slice(index)
}
})
}
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}
if (res.code === 510) {
this.$message.warning(res.message)
}
this.loading = false
})
},
expandChange (isTrue, val) {
if (isTrue) {
if (val.readFlag === '0') {
this.msgContentClick(val)
}
}
},
readAll () {
const that = this
that.$confirm({
title: '确认操作',
content: '是否全部标注已读?',
onOk: function () {
postAction(that.url.readAllMsg).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData()
that.syncHeadNotic()
}
})
}
})
if (this.selectedRowKeys.length > 0) {
this.$confirm({
content: this.$t('message.my.areAllLabelsRead'),
onOk: () => {
const selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
getAction(this.url.readAllMsg, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) {
this.selectedRowKeys = []
this.$message.success(this.$t('operationSuccessful'))
this.loadData()
} else {
this.$message.success(this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('pleaseSelectData'))
}
},
onSelectChange (value) {
this.selectedRowKeys = value
},
msgContentClick (row) {
getAction(this.url.readAllMsg, { ids: row.id })
},
handleDel () {
if (this.selectedRowKeys.length > 0) {
this.$confirm({
content: this.$t('confirmBatchDeletion'),
onOk: () => {
const selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
deleteAction(this.url.deleteUrl, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) {
this.selectedRowKeys = []
this.$message.success(this.$t('operationSuccessful'))
this.loadData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('pleaseSelectData'))
}
}
}
}
</script>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>