[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
@@ -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>