|
|
@@ -37,6 +37,63 @@
|
|
|
</view>
|
|
|
</uni-collapse-item>
|
|
|
</uni-collapse>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <uni-collapse>
|
|
|
+ <uni-collapse-item title-border="show" :border="true" :show-animation="true" :open="false">
|
|
|
+ <template v-slot:title>
|
|
|
+ <uni-section title="公告" type="line" titleFontSize="20px"></uni-section>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <view class="segmented_control_container">
|
|
|
+ <uni-segmented-control :current="current2" :values="items" @clickItem="onClickItem2"
|
|
|
+ styleType="text" activeColor="#409eff"></uni-segmented-control>
|
|
|
+ </view>
|
|
|
+ <view class="content">
|
|
|
+ <view @click="handleToDetail(message)" v-for="(message, index) in notices" :key="index"
|
|
|
+ :class="message.if_read ? ' ' : 'message_container_unread'" class="message_container">
|
|
|
+ <uni-card :is-full="true">
|
|
|
+ <template v-slot:title>
|
|
|
+ <uni-row>
|
|
|
+ <view class="message_top_container">
|
|
|
+ <uni-col :span="24">
|
|
|
+ <text class="message_user">
|
|
|
+ {{ message.name }}
|
|
|
+ </text>
|
|
|
+ </uni-col>
|
|
|
+ </view>
|
|
|
+ </uni-row>
|
|
|
+ <uni-row>
|
|
|
+ <view class="message_mid_container">
|
|
|
+ <uni-col :span="16">
|
|
|
+ <text class="message_title hidden_over">
|
|
|
+ <text :class="message.icon" class="ygoa-icon"></text>
|
|
|
+ <text class="message_title_text">{{ message.title }}</text>
|
|
|
+ </text>
|
|
|
+ </uni-col>
|
|
|
+ <uni-col :span="8">
|
|
|
+ <text class="message_time">
|
|
|
+ {{ message.sendtime }}
|
|
|
+ </text>
|
|
|
+ </uni-col>
|
|
|
+ </view>
|
|
|
+ </uni-row>
|
|
|
+ </template>
|
|
|
+ <!-- <view class="message_bottom_container">
|
|
|
+ <text class="message_content hidden_over">
|
|
|
+ {{ message.content }}
|
|
|
+ </text>
|
|
|
+ </view> -->
|
|
|
+ </uni-card>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-collapse-item>
|
|
|
+ </uni-collapse>
|
|
|
+
|
|
|
+
|
|
|
<uni-collapse>
|
|
|
<uni-collapse-item title-border="show" :border="true" :show-animation="true" :open="true">
|
|
|
<template v-slot:title>
|
|
|
@@ -88,7 +145,8 @@
|
|
|
</uni-collapse-item>
|
|
|
</uni-collapse>
|
|
|
<view class="fab_button">
|
|
|
- <uni-fab :pattern="{icon:'headphones'}" :popMenu="false" horizontal="right" @fabClick="clickFabButton"></uni-fab>
|
|
|
+ <uni-fab :pattern="{icon:'headphones'}" :popMenu="false" horizontal="right"
|
|
|
+ @fabClick="clickFabButton"></uni-fab>
|
|
|
</view>
|
|
|
<view class="checkIn_button">
|
|
|
<uni-fab :pattern="{icon:'calendar'}" :popMenu="false" horizontal="left" @fabClick="clickCheckIn"></uni-fab>
|
|
|
@@ -97,12 +155,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { onMounted, reactive, ref } from 'vue';
|
|
|
+ import { callWithErrorHandling, onMounted, reactive, ref } from 'vue';
|
|
|
import $tab from '@/plugins/tab.js';
|
|
|
import processList from '@/components/ygoa/processList.vue'
|
|
|
import { useUserStore } from '@/store/user.js'
|
|
|
+ import { GetMessageList, GetNoticeList } from '@/api/message.js';
|
|
|
onMounted(() => {
|
|
|
onClickItem({ currentIndex: 0 })
|
|
|
+ onClickItem2({ currentIndex: 0 })
|
|
|
})
|
|
|
const userStore = useUserStore()
|
|
|
function clickCheckIn() {
|
|
|
@@ -114,8 +174,11 @@
|
|
|
const items = reactive(['全部', '已读', '未读'])
|
|
|
// 分段器选项
|
|
|
const current = ref(-1)
|
|
|
+ const current2 = ref(0)
|
|
|
// 消息列表
|
|
|
- let messages = reactive([])
|
|
|
+ let messages = ref([])
|
|
|
+ //公告列表
|
|
|
+ let notices = ref([]);
|
|
|
// 待办列表
|
|
|
let processes = reactive([
|
|
|
{
|
|
|
@@ -155,31 +218,70 @@
|
|
|
step: 0
|
|
|
},
|
|
|
])
|
|
|
+ // const msg = reactive({
|
|
|
+ // msgId: '1',
|
|
|
+ // title: '账户2 的加班申请',
|
|
|
+ // userName: '账户2',
|
|
|
+ // createTime: '2024/10/10',
|
|
|
+ // icon: 'icon-announce',
|
|
|
+ // is_read: '1',
|
|
|
+ // msgType: '0',//0消息或1公告
|
|
|
+ // })
|
|
|
|
|
|
// 点击消息分段器
|
|
|
function onClickItem({ currentIndex }) {
|
|
|
current.value = currentIndex
|
|
|
+ console.log("onClickItem", currentIndex);
|
|
|
switch (currentIndex) {
|
|
|
case 0:
|
|
|
- messages = [
|
|
|
+ messages.value = [
|
|
|
{
|
|
|
- id: 1,
|
|
|
- user: "账户1",
|
|
|
- title: "已读公告1",
|
|
|
+ id: 3,
|
|
|
+ user: "账户3",
|
|
|
+ title: "未读公告3未读公告3未读公告3未读公告3未读公告3未读公告3",
|
|
|
content: "消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容",
|
|
|
time: "2024/10/10",
|
|
|
icon: 'icon-announce',
|
|
|
- is_read: 1
|
|
|
+ is_read: 0
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
- user: "账户2",
|
|
|
- title: "已读通知2",
|
|
|
+ id: 4,
|
|
|
+ user: "账户4",
|
|
|
+ title: "未读通知4",
|
|
|
content: "消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容",
|
|
|
time: "2024/10/10",
|
|
|
icon: 'icon-notify',
|
|
|
+ is_read: 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ console.log("case1")
|
|
|
+ messages.value = [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ user: "账户1",
|
|
|
+ title: "已读公告1",
|
|
|
+ content: "消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容",
|
|
|
+ time: "2024/10/10",
|
|
|
+ icon: 'icon-announce',
|
|
|
is_read: 1
|
|
|
},
|
|
|
+ // {
|
|
|
+ // id: 2,
|
|
|
+ // user: "账户2",
|
|
|
+ // title: "已读通知2",
|
|
|
+ // content: "消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容",
|
|
|
+ // time: "2024/10/10",
|
|
|
+ // icon: 'icon-notify',
|
|
|
+ // is_read: 1
|
|
|
+ // }
|
|
|
+ ];
|
|
|
+ console.log(messages.value);
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ messages.value = [
|
|
|
{
|
|
|
id: 3,
|
|
|
user: "账户3",
|
|
|
@@ -200,8 +302,30 @@
|
|
|
}
|
|
|
]
|
|
|
break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点击公告分段器
|
|
|
+ function onClickItem2({ currentIndex }) {
|
|
|
+ current2.value = currentIndex;
|
|
|
+ console.log(currentIndex);
|
|
|
+ switch (currentIndex) {
|
|
|
+ case 0:
|
|
|
+ // console.log('userStore', JSON.parse(JSON.stringify(userStore.user)))
|
|
|
+ const params1 = {
|
|
|
+ "notice_title": "",
|
|
|
+ "p": "1",
|
|
|
+ "pSize": "5",
|
|
|
+ "userId": userStore.user.useId,
|
|
|
+ "unitId": userStore.user.unitId,
|
|
|
+ }
|
|
|
+ GetNoticeList(params1).then(res => {
|
|
|
+ // console.log(res);
|
|
|
+ notices.value=res.returnParams.noticelist.list;
|
|
|
+ })
|
|
|
+ break;
|
|
|
case 1:
|
|
|
- messages = [
|
|
|
+ notices.value = [
|
|
|
{
|
|
|
id: 1,
|
|
|
user: "账户1",
|
|
|
@@ -223,7 +347,7 @@
|
|
|
]
|
|
|
break;
|
|
|
case 2:
|
|
|
- messages = [
|
|
|
+ notices.value = [
|
|
|
{
|
|
|
id: 3,
|
|
|
user: "账户3",
|