|
@@ -2,49 +2,147 @@
|
|
|
<el-row class="message">
|
|
<el-row class="message">
|
|
|
<el-col :span="4" class="colLeft">
|
|
<el-col :span="4" class="colLeft">
|
|
|
<div class="menu">
|
|
<div class="menu">
|
|
|
- <div class="menuItem" :class="{'active':menuIndex === index}" @click="menuIndex = index" v-for="(item, index) in menuList" :key="item+index">
|
|
|
|
|
|
|
+ <div class="menuItem" :class="{'active':menuIndex === index}" @click="handleClick(item,index)" v-for="(item, index) in menuList" :key="item+index">
|
|
|
<el-badge :value="item.value" :max="99">{{ item.text }}</el-badge>
|
|
<el-badge :value="item.value" :max="99">{{ item.text }}</el-badge>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="20" class="colRight">
|
|
<el-col :span="20" class="colRight">
|
|
|
<div class="message-list">
|
|
<div class="message-list">
|
|
|
- <el-row :gutter="20" class="message-item" v-for="(item, index) in message" :key="index">
|
|
|
|
|
|
|
+ <el-row style="cursor: pointer" :gutter="20" class="message-item" v-for="(item, index) in menuList[menuIndex].list" :key="index">
|
|
|
<el-col :span="3" style="text-align: right; color: #cccccc">
|
|
<el-col :span="3" style="text-align: right; color: #cccccc">
|
|
|
- <p>16:52:02</p>
|
|
|
|
|
- <p>2024.12.03</p>
|
|
|
|
|
|
|
+ <p @click="handleItemClick(item, index)">{{ item.time }}</p>
|
|
|
|
|
+ <p></p>
|
|
|
|
|
+ <p @click="handleItemClick(item, index)">{{item.day}}</p>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="21">
|
|
<el-col :span="21">
|
|
|
- <p class="title">标题</p>
|
|
|
|
|
- <p class="content">内容</p>
|
|
|
|
|
|
|
+ <p class="title" @click="handleItemClick(item, index)">{{ item.title }}</p>
|
|
|
|
|
+ <p class="content" @click="handleItemClick(item, index)" :class="{'custom': item.state !== '0'}" v-html="item.content"></p>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <div v-if="menuList[menuIndex].list.length===0" style="height: 100%;display: flex; align-items: center; justify-content: center">
|
|
|
|
|
+ <el-empty description="暂无数据"></el-empty>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="flex-box">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ @current-change="handlePageChange"
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ :current-page="pageNum"
|
|
|
|
|
+ :page-sizes="[10, 20, 30, 40]"
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="total">
|
|
|
|
|
+ </el-pagination>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import {updateMessage} from "../../http/moudules/letter";
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
menuList: [
|
|
menuList: [
|
|
|
{
|
|
{
|
|
|
text: '增员信息',
|
|
text: '增员信息',
|
|
|
- value: 100
|
|
|
|
|
|
|
+ value: 0,
|
|
|
|
|
+ type: 1,
|
|
|
|
|
+ list: [],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
text: '待我审批',
|
|
text: '待我审批',
|
|
|
- value: 0
|
|
|
|
|
|
|
+ value: 0,
|
|
|
|
|
+ type: 3,
|
|
|
|
|
+ list: [],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
text: '审批结果',
|
|
text: '审批结果',
|
|
|
- value: 0
|
|
|
|
|
|
|
+ value: 0,
|
|
|
|
|
+ type: 2,
|
|
|
|
|
+ list: [],
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
menuIndex: 0,
|
|
menuIndex: 0,
|
|
|
- message: [1,2,3,4,5,6,7,8,9,10]
|
|
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ msgType: 1
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ methods:{
|
|
|
|
|
+ initData(type) {
|
|
|
|
|
+ this.$api.letter.getMessage({
|
|
|
|
|
+ msgType: type?type:null,
|
|
|
|
|
+ pageNum: this.pageNum,
|
|
|
|
|
+ pageSize: this.pageSize
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if(res.code === 200) {
|
|
|
|
|
+ this.total = res.data.total
|
|
|
|
|
+ this.menuList.forEach(item => {
|
|
|
|
|
+ if(item.type === type) {
|
|
|
|
|
+ item.value = res.data.list.filter(item => item.state === '0').length
|
|
|
|
|
+ item.list = res.data.list.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ time: item.sendTime?item.sendTime.split(' ')[1]:'',
|
|
|
|
|
+ day: item.sendTime?item.sendTime.split(' ')[0]:'',
|
|
|
|
|
+ highList: item.highLight?item.highLight.split(';'):[],
|
|
|
|
|
+ ...item
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.menuList.forEach(item => {
|
|
|
|
|
+ item.list.forEach(sub => {
|
|
|
|
|
+ if(sub.highList.length>0) {
|
|
|
|
|
+ sub.highList.forEach(str => {
|
|
|
|
|
+ sub.content = `${sub.content.substring(0,sub.content.indexOf(str))}<a style="color: ${sub.state === '0'?'#00C2FF':'#cccccc'}">${sub.content.substring(sub.content.indexOf(str),sub.content.indexOf(str)+str.length)}</a>${sub.content.substring(sub.content.indexOf(str)+str.length, sub.content.length-1)}`
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleClick(item, index) {
|
|
|
|
|
+ this.menuIndex = index
|
|
|
|
|
+ this.msgType = item.type
|
|
|
|
|
+ this.initData(this.msgType)
|
|
|
|
|
+ },
|
|
|
|
|
+ handlePageChange(page) {
|
|
|
|
|
+ this.pageNum = page
|
|
|
|
|
+ this.initData(this.msgType)
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSizeChange(size) {
|
|
|
|
|
+ this.pageSize = size
|
|
|
|
|
+ this.initData(this.msgType)
|
|
|
|
|
+ },
|
|
|
|
|
+ handleItemClick(item, index) {
|
|
|
|
|
+ console.log(123, item)
|
|
|
|
|
+ if(item.state === '0') {
|
|
|
|
|
+ this.$api.letter.updateMessage(item.id).then(res => {
|
|
|
|
|
+ if(res.code === 200) {
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ this.initData(this.msgType)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if(item.jump === '1') {
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: item.jumpUrl
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.initData(1);
|
|
|
|
|
+ this.initData(2);
|
|
|
|
|
+ this.initData(3);
|
|
|
|
|
+ this.initData();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -65,6 +163,7 @@ export default {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
.menuItem{
|
|
.menuItem{
|
|
|
|
|
+ cursor: pointer;
|
|
|
padding: 10px 20px;
|
|
padding: 10px 20px;
|
|
|
width: calc(100% - 40px);
|
|
width: calc(100% - 40px);
|
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
@@ -80,6 +179,8 @@ export default {
|
|
|
.message-list{
|
|
.message-list{
|
|
|
margin: 10px 40px;
|
|
margin: 10px 40px;
|
|
|
width: calc(100% - 80px);
|
|
width: calc(100% - 80px);
|
|
|
|
|
+ height: calc(100% - 60px);
|
|
|
|
|
+ overflow-y: auto;
|
|
|
.message-item{
|
|
.message-item{
|
|
|
border-bottom: 1px solid #cccccc;
|
|
border-bottom: 1px solid #cccccc;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -90,7 +191,14 @@ export default {
|
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
|
|
+ .custom{
|
|
|
|
|
+ color: #ccc;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .flex-box{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|