|
|
@@ -14,7 +14,7 @@
|
|
|
</template>
|
|
|
<view class="process_container">
|
|
|
<view class="process_list">
|
|
|
- <process-list ref="processListRef" :list="processes" @clickSegment="getProcessData"
|
|
|
+ <process-list ref="processListRef" @clickSegment="getProcessData"
|
|
|
@clickItem="handleToProcessDetail" @scrollToBottom="getProcessPage" :current="0" :pSize="5"
|
|
|
:pageNo="1" contentHeight="69.5vh"></process-list>
|
|
|
</view>
|
|
|
@@ -23,12 +23,12 @@
|
|
|
</uni-collapse>
|
|
|
|
|
|
<!-- 公告列表 -->
|
|
|
- <message-list :list="notices" @clickSegment="getNoticeData" @clickItem="handleToNoticeDetail"
|
|
|
+ <message-list @clickSegment="getNoticeData" @clickItem="handleToNoticeDetail"
|
|
|
@scrollToBottom="getNoticePage" :pSize="5" :pageNo="1" :anime="true" :open="false"
|
|
|
title="公告"></message-list>
|
|
|
|
|
|
<!-- 消息列表 -->
|
|
|
- <message-list ref="msgListRef" @readMsg="setAllMsgRead" :unReadNum="unReadNum" :list="messages"
|
|
|
+ <message-list ref="msgListRef" @readMsg="setAllMsgRead" :unReadNum="unReadNum"
|
|
|
@clickSegment="getMessageData" @clickItem="handleToMessageDetail" @scrollToBottom="getMessagePage"
|
|
|
:defaultCurrent="1" :pSize="5" :pageNo="1" :anime="true" :open="true"
|
|
|
:segments="{ '全部': '', '未读': '0', '已读': '1' }" title="消息"></message-list>
|
|
|
@@ -57,6 +57,7 @@ import $modal from '@/plugins/modal.js';
|
|
|
import processList from '@/components/ygoa/processList.vue'
|
|
|
import messageList from '@/components/ygoa/messageList.vue'
|
|
|
import { useUserStore } from '@/store/user.js'
|
|
|
+import { getLoginInfo } from '@/utils/auth';
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
const processListRef = ref(null)
|
|
|
@@ -119,14 +120,14 @@ function setMsgRead() {
|
|
|
}
|
|
|
} else {
|
|
|
// $modal.msgError('jssesionid失效')
|
|
|
- showConfirm('jssesionid失效,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
- if (res.confirm) {
|
|
|
- userStore.LogOut().then(res => {
|
|
|
- uni.reLaunch({ url: '/pages/login' })
|
|
|
- })
|
|
|
- }
|
|
|
+ $modal.confirm('jssesionid失效,您可以继续留在该页面,或者重新登录?').then(res=>{
|
|
|
+ const loginInfo=getLoginInfo();
|
|
|
+ userStore.LogOut().then(res=>{
|
|
|
+ uni.setStorageSync('loginInfo',loginInfo)
|
|
|
+ $tab.reLaunch('/pages/login')
|
|
|
+ })
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
@@ -136,8 +137,6 @@ function setMsgRead() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-// 待办列表
|
|
|
-const processes = ref([])
|
|
|
// 获取待办消息列表数据
|
|
|
function getProcessData({ pSize, pageNo }, callback) {
|
|
|
const params = {
|
|
|
@@ -148,11 +147,6 @@ function getProcessData({ pSize, pageNo }, callback) {
|
|
|
control: 1
|
|
|
}
|
|
|
getUserProcess(params).then(({ returnParams }) => {
|
|
|
- if (returnParams == undefined) {
|
|
|
- processes.value = []
|
|
|
- return
|
|
|
- }
|
|
|
- processes.value = returnParams.list;
|
|
|
callback(returnParams.list, returnParams.total, pageNo)
|
|
|
});
|
|
|
}
|
|
|
@@ -166,7 +160,6 @@ function getProcessPage({ pSize, pageNo }, callback) {
|
|
|
control: 1
|
|
|
}
|
|
|
getUserProcess(params).then(({ returnParams }) => {
|
|
|
- processes.value.push(...returnParams.list)
|
|
|
callback(returnParams.list, returnParams.total, pageNo)
|
|
|
});
|
|
|
}
|
|
|
@@ -175,8 +168,6 @@ function handleToProcessDetail({ insId, tinsId, insName, control }) {
|
|
|
$tab.navigateTo('/pages/process/detail/index?insId=' + insId + '&tinsId=' + tinsId + '&insName=' + insName + '&control=' + control)
|
|
|
}
|
|
|
|
|
|
-// 公告列表
|
|
|
-const notices = ref([])
|
|
|
// 获取公告列表数据
|
|
|
function getNoticeData({ pSize, pageNo }, callback) {
|
|
|
const params = {
|
|
|
@@ -187,7 +178,6 @@ function getNoticeData({ pSize, pageNo }, callback) {
|
|
|
unitId: userStore.user.unitId,
|
|
|
}
|
|
|
getNoticeList(params).then(({ returnParams }) => {
|
|
|
- notices.value = returnParams.noticelist.list
|
|
|
// 通知子组件加载完成
|
|
|
callback(returnParams.noticelist.list, returnParams.total, pageNo)
|
|
|
})
|
|
|
@@ -202,8 +192,6 @@ function getNoticePage({ pSize, pageNo }, callback) {
|
|
|
unitId: userStore.user.unitId,
|
|
|
}
|
|
|
getNoticeList(params).then(({ returnParams }) => {
|
|
|
- // 更新数据
|
|
|
- notices.value.push(...returnParams.noticelist.list)
|
|
|
// 通知子组件加载完成
|
|
|
callback(returnParams.noticelist.list, returnParams.total, pageNo)
|
|
|
})
|
|
|
@@ -214,7 +202,7 @@ function handleToNoticeDetail(notice) {
|
|
|
}
|
|
|
|
|
|
// 消息列表
|
|
|
-const messages = ref([])
|
|
|
+// const messages = ref([])
|
|
|
// 获取消息列表数据
|
|
|
function getMessageData({ pSize, pageNo, type, segmentValue }, callback) {
|
|
|
const params = {
|
|
|
@@ -231,7 +219,7 @@ function getMessageData({ pSize, pageNo, type, segmentValue }, callback) {
|
|
|
}
|
|
|
// return item
|
|
|
})
|
|
|
- messages.value = returnParams.list;
|
|
|
+
|
|
|
// 通知子组件加载完成
|
|
|
callback(returnParams.list, returnParams.total, pageNo)
|
|
|
})
|
|
|
@@ -252,22 +240,23 @@ function getMessagePage({ pSize, pageNo, type, segmentValue }, callback) {
|
|
|
}
|
|
|
// return item
|
|
|
})
|
|
|
- // 更新数据
|
|
|
- messages.value.push(...returnParams.list)
|
|
|
// 通知子组件加载完成
|
|
|
callback(returnParams.list, returnParams.total, pageNo)
|
|
|
})
|
|
|
}
|
|
|
// 点击消息列表项
|
|
|
function handleToMessageDetail({ messageid, universalid }) {
|
|
|
+ console.log();
|
|
|
setMsgIsRead(universalid + ',').then((res) => {
|
|
|
if (Number.isInteger(res)) {
|
|
|
msgListRef.value.reload();// 调用子组件刷新数据
|
|
|
$tab.navigateTo('/pages/message/detail/index?messageId=' + messageid + '&universalId=' + universalid)
|
|
|
} else {
|
|
|
$modal.confirm('登录状态失效,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
- userStore.LogOut().then(res => {
|
|
|
- uni.reLaunch({ url: '/pages/login' })
|
|
|
+ const loginInfo=getLoginInfo();
|
|
|
+ userStore.LogOut().then(res=>{
|
|
|
+ uni.setStorageSync('loginInfo',loginInfo)
|
|
|
+ $tab.reLaunch('/pages/login')
|
|
|
})
|
|
|
})
|
|
|
}
|