Kaynağa Gözat

小程序分包

ouyj 2 hafta önce
ebeveyn
işleme
8e6e3453f6

+ 184 - 161
pages.json

@@ -16,21 +16,21 @@
 			}
 		},
 		{
-			"path": "pages/message/index",
+			"path": "pages/tabbar-message/index",
 			"style": {
 				"navigationBarTitleText": "消息",
 				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path": "pages/process/index",
+			"path": "pages/tabbar-process/index",
 			"style": {
 				"navigationBarTitleText": "流程",
 				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path": "pages/work/index",
+			"path": "pages/tabbar-work/index",
 			"style": {
 				"navigationBarTitleText": "工作台",
 				"enablePullDownRefresh": false
@@ -44,171 +44,194 @@
 			}
 		},
 		{
-			"path": "pages/mine/index",
+			"path": "pages/tabbar-mine/index",
 			"style": {
 				"navigationBarTitleText": "我的",
 				"enablePullDownRefresh": false
 			}
-		},
-		{
-			"path": "pages/message/detail/index",
-			"style": {
-				"navigationBarTitleText": "消息详情",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/message/detail/URLView",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/process/detail/index",
-			"style": {
-				"navigationBarTitleText": "流程信息",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path" : "pages/work/edit/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "发起流程",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/diary/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "周报",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/diary/edit",
-			"style" : 
-			{
-				"navigationBarTitleText" : "日报编辑",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/homesys/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "房屋管家",
-				"navigationStyle": "custom", // 隐藏默认导航栏(需自行实现自定义导航栏)
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/homesysSetting/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "房屋管理",
-				// "navigationStyle": "custom", // 隐藏默认导航栏(需自行实现自定义导航栏)
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/homesysSetting/user",
-			"style" : 
-			{
-				"navigationBarTitleText" : "用户管理",
-				// "navigationStyle": "custom", // 隐藏默认导航栏(需自行实现自定义导航栏)
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/homesysSetting/userList",
-			"style" : 
-			{
-				"navigationBarTitleText" : "用户列表",
-				// "navigationStyle": "custom", // 隐藏默认导航栏(需自行实现自定义导航栏)
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path": "pages/mine/edit/edit",
-			"style": {
-				"navigationBarTitleText": "编辑资料",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/mine/personal_message/personal_message",
-			"style": {
-				"navigationBarTitleText": "个人信息",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/mine/setting/setting",
-			"style": {
-				"navigationBarTitleText": "应用设置",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/mine/setting/pwdEdit/pwdEdit",
-			"style": {
-				"navigationBarTitleText": "密码修改",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path" : "pages/mine/checkIn/checkIn",
-			"style" : 
-			{
-				"navigationBarTitleText" : "我的考勤"
-			}
-		},
+		}
+	],
+	"subPackages": [
 		{
-			"path" : "pages/mine/clockIn/clockIn",
-			"style" : 
-			{
-				"navigationBarTitleText" : "打卡签到"
-			}
+			"root": "pages/message",
+			"name": "message",
+			"pages": [
+				{
+					"path": "detail/index",
+					"style": {
+						"navigationBarTitleText": "消息详情",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "detail/URLView",
+					"style": {
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "chat/index",
+					"style" : 
+					{
+						"navigationBarTitleText" : "AI助手"
+					}
+				}
+			]
 		},
 		{
-			"path" : "pages/message/chat/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "AI助手"
-			}
+			"root": "pages/process",
+			"name": "process",
+			"pages": [
+				{
+					"path": "detail/index",
+					"style": {
+						"navigationBarTitleText": "流程信息",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "common/detail",
+					"style": {
+						"navigationBarTitleText": "流程审批",
+						"enablePullDownRefresh": false
+					}
+				}
+			]
 		},
 		{
-			"path" : "pages/mine/avatar/avatar",
-			"style" : 
-			{
-				"navigationBarTitleText" : "头像修改"
-			}
+			"root": "pages/work",
+			"name": "work",
+			"pages": [
+				{
+					"path" : "edit/index",
+					"style" : 
+					{
+						"navigationBarTitleText" : "发起流程",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "diary/index",
+					"style" : 
+					{
+						"navigationBarTitleText" : "周报",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "diary/edit",
+					"style" : 
+					{
+						"navigationBarTitleText" : "日报编辑",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "homesys/index",
+					"style" : 
+					{
+						"navigationBarTitleText" : "房屋管家",
+						"navigationStyle": "custom",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "homesysSetting/index",
+					"style" : 
+					{
+						"navigationBarTitleText" : "房屋管理",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "homesysSetting/user",
+					"style" : 
+					{
+						"navigationBarTitleText" : "用户管理",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "homesysSetting/userList",
+					"style" : 
+					{
+						"navigationBarTitleText" : "用户列表",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "purchase/start",
+					"style" : 
+					{
+						"navigationBarTitleText" : "采购申请",
+						"enablePullDownRefresh" : false
+					}
+				},
+				{
+					"path" : "contract/start",
+					"style" :
+					{
+						"navigationBarTitleText" : "合同申请",
+						"enablePullDownRefresh" : false
+					}
+				}
+			]
 		},
 		{
-			"path" : "pages/work/purchase/start",
-			"style" : 
-			{
-				"navigationBarTitleText" : "采购申请",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path" : "pages/work/contract/start",
-			"style" :
-			{
-				"navigationBarTitleText" : "合同申请",
-				"enablePullDownRefresh" : false
-			}
-		},
-		{
-			"path": "pages/process/common/detail",
-			"style": {
-				"navigationBarTitleText": "流程审批",
-				"enablePullDownRefresh": false
-			}
+			"root": "pages/mine",
+			"name": "mine",
+			"pages": [
+				{
+					"path": "edit/edit",
+					"style": {
+						"navigationBarTitleText": "编辑资料",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "personal_message/personal_message",
+					"style": {
+						"navigationBarTitleText": "个人信息",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "setting/setting",
+					"style": {
+						"navigationBarTitleText": "应用设置",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "setting/pwdEdit/pwdEdit",
+					"style": {
+						"navigationBarTitleText": "密码修改",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path" : "checkIn/checkIn",
+					"style" : 
+					{
+						"navigationBarTitleText" : "我的考勤"
+					}
+				},
+				{
+					"path" : "clockIn/clockIn",
+					"style" : 
+					{
+						"navigationBarTitleText" : "打卡签到"
+					}
+				},
+				{
+					"path" : "avatar/avatar",
+					"style" : 
+					{
+						"navigationBarTitleText" : "头像修改"
+					}
+				}
+			]
 		}
 	],
 	"tabBar": {
@@ -218,19 +241,19 @@
 		"backgroundColor": "#F8F8F8",
 		"list": [
 			{
-				"pagePath": "pages/message/index",
+				"pagePath": "pages/tabbar-message/index",
 				"iconPath": "static/images/tabbar/message.png",
 				"selectedIconPath": "static/images/tabbar/message_.png",
 				"text": "消息"
 			},
 			{
-				"pagePath": "pages/process/index",
+				"pagePath": "pages/tabbar-process/index",
 				"iconPath": "static/images/tabbar/process.png",
 				"selectedIconPath": "static/images/tabbar/process_.png",
 				"text": "流程"
 			},
 			{
-				"pagePath": "pages/work/index",
+				"pagePath": "pages/tabbar-work/index",
 				"iconPath": "static/images/tabbar/work.png",
 				"selectedIconPath": "static/images/tabbar/work_.png",
 				"text": "工作台"
@@ -242,7 +265,7 @@
 				"text": "通讯录"
 			},
 			{
-				"pagePath": "pages/mine/index",
+				"pagePath": "pages/tabbar-mine/index",
 				"iconPath": "static/images/tabbar/mine.png",
 				"selectedIconPath": "static/images/tabbar/mine_.png",
 				"text": "我的"

+ 4 - 4
pages/login.vue

@@ -116,19 +116,19 @@ function loginSuccess() {
 				checkAttendance(params).then(({ returnParams }) => {
 					if (returnParams.list.length) {
 						// 已签到 跳转消息页
-						$tab.reLaunch('/pages/message/index')
+						$tab.reLaunch('/pages/tabbar-message/index')
 					} else {
 						// 未签到 跳转考勤页面
-						$tab.reLaunch('/pages/message/index?to=clockIn')
+						$tab.reLaunch('/pages/tabbar-message/index?to=clockIn')
 					}
 				})
 			} else {
-				$tab.reLaunch('/pages/message/index')
+				$tab.reLaunch('/pages/tabbar-message/index')
 			}
 		}).catch((error) => {
 			// console.log('GetAttRule error:', error);
 			if (['getAttendanceSegmentErr', 'getAttendanceRuleErr'].includes(error)) {
-				$tab.reLaunch('/pages/message/index')
+				$tab.reLaunch('/pages/tabbar-message/index')
 			}
 		});
 	})

+ 1 - 1
pages/message/detail/index.vue

@@ -84,7 +84,7 @@ onShareAppMessage((res) => {
 		if (noticeId.value) {
 		        return {
 		            title: msgInfo.value.title,
-		            path: '/pages/message/index?noticeId='+noticeId.value,
+		            path: '/pages/tabbar-message/index?noticeId='+noticeId.value,
 		        };
 		    } else {
 		        return { title: '', path: '' };  // 不允许分享时,返回空的标题和路径

+ 1 - 1
pages/mine/checkIn/checkIn.vue

@@ -424,7 +424,7 @@
 			const { modelName, modelId, control } = res.returnParams.fList.find(item => item.modelName === "补卡申请")
 			$tab.navigateTo('/pages/work/edit/index?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control+'&bukaDate='+todayData.day+'&bukaType='+bukaType)
 		})
-		// $tab.switchTab('/pages/work/index?bukaDate='+todayData.day+'&bukaType='+bukaType)
+		// $tab.switchTab('/pages/tabbar-work/index?bukaDate='+todayData.day+'&bukaType='+bukaType)
 	}
 
 	//传入年份月份,返回此月天数

+ 2 - 2
pages/mine/clockIn/clockIn.vue

@@ -625,7 +625,7 @@ function isToFillClock(attType, time) {
         } 
 		if(config.companyCode && config.companyCode == 'yg'){
 			$modal.confirm(' 当前状态为' + status + '!\n是否跳转补卡页面').then(() => {
-				 $tab.reLaunch('/pages/work/index');  
+				 $tab.reLaunch('/pages/tabbar-work/index');
 			 }) 
 			 .catch(() => { 
 				 $tab.navigateTo('/pages/mine/checkIn/checkIn');  
@@ -648,7 +648,7 @@ function isToFillClock(attType, time) {
             return; 
         } 
         $modal.confirm(' 当前状态为' + status + '!\n是否跳转请假页面').then(() => { 
-            $tab.reLaunch('/pages/work/index');  
+            $tab.reLaunch('/pages/tabbar-work/index');
         }) 
         .catch(() => { 
             $tab.navigateTo('/pages/mine/checkIn/checkIn');  

+ 1 - 1
pages/process/detail/index.vue

@@ -413,7 +413,7 @@
 		if (res.from === 'menu') {
 			// console.log('res', res)
 		}
-		let url = '/pages/process/index?insId=' + processInfo.insId + '&insName=' + processInfo.insName + '&control=' + processInfo.control
+		let url = '/pages/tabbar-process/index?insId=' + processInfo.insId + '&insName=' + processInfo.insName + '&control=' + processInfo.control
 		// console.log('url',url);
 		return {
 			title: processInfo.insName,

+ 558 - 0
pages/tabbar-message/index.vue

@@ -0,0 +1,558 @@
+<template>
+	<page-meta root-font-size="system" />
+	<view class="index_container">
+		<uni-nav-bar dark :border="false" :fixed="true" :title="config.companyName">
+		</uni-nav-bar>
+		<!-- 待办消息列表 -->
+		<uni-collapse :accordion="true">
+			<uni-collapse-item title-border="show" :border="true" :show-animation="true"
+				:open="unProcessNum > 0 || false">
+				<template v-slot:title>
+					<uni-section title="待办" type="line" titleFontSize="1.3rem">
+						<template v-slot:right>
+							<uni-badge :text="unProcessNum" class="unReadBadge" v-if="unProcessNum > 0"></uni-badge>
+						</template>
+					</uni-section>
+				</template>
+				<view class="process_container">
+					<view class="process_list">
+						<process-list ref="processListRef" @clickSegment="getProcessData"
+							@clickItem="handleToProcessDetail" @scrollToBottom="getProcessPage" :current="0" :pSize="5"
+							:pageNo="1" contentHeight="63.5vh"></process-list>
+					</view>
+				</view>
+			</uni-collapse-item>
+			<!-- 公告列表  -->
+			<uni-collapse-item title-border="show" :border="true" :show-animation="true"
+				:open="unReadMsgNum > 0 || false">
+				<template v-slot:title>
+					<uni-section title="公告" type="line" titleFontSize="1.3rem">
+					</uni-section>
+				</template>
+				<view class="notice_list">
+					<message-list @clickSegment="getNoticeData" @clickItem="handleToNoticeDetail"
+						@scrollToBottom="getNoticePage" :pSize="5" :pageNo="1" :anime="true"
+						:open="false"></message-list>
+				</view>
+			</uni-collapse-item>
+			<!-- 消息列表 -->
+			<uni-collapse-item title-border="show" :border="true" :show-animation="true"
+				:open="unReadMsgNum > 0 || false">
+				<template v-slot:title>
+					<uni-section title="消息" type="line" titleFontSize="1.3rem">
+						<template v-slot:right>
+							<uni-badge :text="unReadMsgNum"
+								v-if="unReadMsgNum !== undefined && unReadMsgNum > 0"></uni-badge>
+							<button @click.stop="setAllMsgRead" class="read_button" v-if="unReadMsgNum !== undefined" :disabled="unReadMsgNum === 0">一键阅读</button>
+						</template>
+					</uni-section>
+				</template>
+				<view class="message_list">
+					<message-list ref="msgListRef" @clickSegment="getMessageData" @clickItem="handleToMessageDetail"
+						@scrollToBottom="getMessagePage" :defaultCurrent="1" :pSize="5" :pageNo="1"
+						:segments="{ '全部': '', '未读': '0', '已读': '1' }"></message-list>
+				</view>
+			</uni-collapse-item>
+		</uni-collapse>
+		<!-- 跳转打卡页按钮 -->
+		<view class="fab_button">
+			<view class="toClockInBtn">
+				<uni-fab :pattern="{ icon: 'map-pin-ellipse' }" :popMenu="false" horizontal="right"
+					@fabClick="toClockInBtn"></uni-fab>
+			</view>
+			<!-- AI咨询按钮 -->
+			<view class="toAiBtn">
+				<uni-fab :pattern="{ buttonText: 'headphones' }" :popMenu="false" horizontal="right" @fabClick="clickFabButton"></uni-fab>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup lang="ts">
+import { onBeforeMount, onMounted, onUpdated, ref } from 'vue';
+import { onLoad, onShow } from '@dcloudio/uni-app'
+import { getMessageList, getNoticeList, getUnReadMessageNum, setMsgIsRead } from '@/api/message.js';
+import { getUserProcess, getUnProcessNum, getTacheInfo } from '@/api/process';
+import $tab from '@/plugins/tab.js';
+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';
+import config from '@/config';
+
+const userStore = useUserStore()
+
+const processListRef = ref(null)
+onMounted(() => {
+	uni.$on('showTabBarBadge', showTabBarBadge)
+	uni.$on('ReloadProcessData', () => {
+		new Promise((resolve, reject) => {
+			processListRef.value.onClickItem()
+		})
+	})
+})
+onLoad((options) => {
+	// 是否跳转打卡页
+	if (options.to == 'clockIn'){
+		toClockIn()
+	}else if(options.noticeId){
+		$tab.navigateTo('/pages/message/detail/index?noticeId=' + options.noticeId)
+	}
+})
+onShow(() => {
+	showTabBarBadge();
+})
+onBeforeMount(() => {
+	uni.removeTabBarBadge({
+		index: 0
+	})
+})
+
+// 跳转打卡页
+function toClockIn() {
+	// 确认是否跳转打卡页
+	$modal.confirm('当前未打卡,是否前往打卡').then(() => {
+		$tab.navigateTo('/pages/mine/clockIn/clockIn')
+	}).catch(() => { })
+}
+
+//子组件
+const msgListRef = ref(null)
+
+// 获取待办消息列表数据
+function getProcessData({ pSize, pageNo }, callback) {
+	const params = {
+		staffId: userStore.user.useId,
+		page: pageNo,
+		pageNum: pSize,
+		modelId: "",
+		control: 1
+	}
+	getUserProcess(params).then(({ returnParams }) => {
+		callback(returnParams.list, returnParams.total, pageNo)
+	});
+}
+// 分页获取待办消息列表数据
+function getProcessPage({ pSize, pageNo }, callback) {
+	const params = {
+		staffId: userStore.user.useId,
+		page: pageNo,
+		pageNum: pSize,
+		modelId: "",
+		control: 1
+	}
+	getUserProcess(params).then(({ returnParams }) => {
+		callback(returnParams.list, returnParams.total, pageNo)
+	});
+}
+// 点击待办消息列表项
+function handleToProcessDetail({ insId, tinsId, insName, control, modelId }) {
+  if (control == '0' && modelId) {
+    if(modelId == '200001' || modelId == '200002'){
+      // 跳转到通用审批页面
+      let url = '/pages/process/common/detail?insId=' + insId + '&insName=' + insName + '&control=' + control + '&modelId=' + modelId
+      if (tinsId) { // 排除抄送流程的 tinsId
+        url = url + '&tinsId=' + tinsId
+      }
+      $tab.navigateTo(url)
+      return
+    }else{
+      $tab.navigateTo('/pages/process/detail/index?insId=' + insId + '&tinsId=' + tinsId + '&insName=' + insName + '&control=' + control)
+    }
+  }else{
+    $tab.navigateTo('/pages/process/detail/index?insId=' + insId + '&tinsId=' + tinsId + '&insName=' + insName + '&control=' + control)
+  }
+}
+
+// 获取公告列表数据
+function getNoticeData({ pSize, pageNo }, callback) {
+	const params = {
+		notice_title: "",
+		p: pageNo,
+		pSize,
+		userId: userStore.user.useId,
+		unitId: userStore.user.unitId,
+	}
+	getNoticeList(params).then(({ returnParams }) => {
+		// 通知子组件加载完成
+		callback(returnParams.noticelist.list, returnParams.total, pageNo)
+	})
+}
+// 分页获取公告数据
+function getNoticePage({ pSize, pageNo }, callback) {
+	const params = {
+		notice_title: "",
+		p: pageNo,
+		pSize,
+		userId: userStore.user.useId,
+		unitId: userStore.user.unitId,
+	}
+	getNoticeList(params).then(({ returnParams }) => {
+		// 通知子组件加载完成
+		callback(returnParams.noticelist.list, returnParams.total, pageNo)
+	})
+}
+// 点击公告列表项
+function handleToNoticeDetail(notice) {
+	$tab.navigateTo('/pages/message/detail/index?noticeId=' + notice.id)
+}
+
+// 消息列表
+// const messages = ref([])
+// 获取消息列表数据
+const msgPoint = ref(0)
+function getMessageData({ pSize, pageNo, type, segmentValue }, callback) {
+	const flag = msgPoint.value = new Date().getTime()
+	const params = {
+		currentUser: userStore.user.useId,
+		isRead: segmentValue,
+		pSize: pSize,
+		type: type,
+		p: pageNo,
+	}
+	getMessageList(params).then(({ returnParams }) => {
+		returnParams.list.forEach(item => {
+			if ('(流程提醒)您有一个流程' == item.title.substring(0, 12)) {
+				item.title = '(流程提醒)' + item.title.slice(12)
+			}
+		})
+
+		// 通知子组件加载完成
+		if (flag == msgPoint.value) {
+			callback(returnParams.list, returnParams.total, pageNo)
+		}
+	})
+}
+// 分页获取消息数据
+function getMessagePage({ pSize, pageNo, type, segmentValue }, callback) {
+	const params = {
+		currentUser: userStore.user.useId,
+		isRead: segmentValue,
+		pSize: pSize,
+		type: type,
+		p: pageNo,
+	}
+	getMessageList(params).then(({ returnParams }) => {
+		returnParams.list.forEach(item => {
+			if ('(流程提醒)您有一个流程' == item.title.substring(0, 12)) {
+				item.title = '(流程提醒)' + item.title.slice(12)
+			}
+			// return item
+		})
+		// 通知子组件加载完成
+		callback(returnParams.list, returnParams.total, pageNo)
+	})
+}
+//点击消息列表项
+function handleToMessageDetail({ messageid, universalid, jump_id, title }) {
+	// 设置消息已读
+	setMsgIsRead(universalid + ',').then((res) => {
+		if (Number.isInteger(res)) {
+			msgListRef.value.reload();//调用子组件刷新数据
+		} else {
+			$modal.confirm('登录状态失效,您可以继续留在该页面,或者重新登录?').then(res => {
+				const loginInfo = getLoginInfo();
+				userStore.LogOut().then(res => {
+					uni.setStorageSync('loginInfo', loginInfo)
+					$tab.reLaunch('/pages/login?type=autoLogin')
+				})
+			}).catch(() => { })
+		}
+	})
+	//debugger
+	if(jump_id) {
+		try {
+			// 解析jump_id JSON字符串
+			// const jumpInfo = JSON.parse(jump_id);
+			const { modelId, insId, tinsId, opType, insName } = jump_id;
+			
+			if (opType === 'process') {
+				getTacheInfo(tinsId).then(({returnParams}) => {
+					if(returnParams.oldTacheStatus == 1) {
+						//跳到流程办理页面
+            if(modelId == '200001' || modelId == '200002'){
+              let url = '/pages/process/common/detail?insId=' + insId + '&insName=' + insName + '&control=0&modelId=' + modelId
+              if (tinsId) {
+                url = url + '&tinsId=' + tinsId
+              }
+              $tab.navigateTo(url)
+            }else{
+              $tab.navigateTo('/pages/process/detail/index?insId=' + insId + '&tinsId=' + tinsId + '&insName=' + insName + '&control=1')
+            }
+					} else {
+						//跳到流程到流程查看页面
+            if(modelId == '200001' || modelId == '200002'){
+              let url = '/pages/process/common/detail?insId=' + insId + '&insName=' + insName + '&control=0&modelId=' + modelId
+              $tab.navigateTo(url)
+            }else{
+              $tab.navigateTo('/pages/process/detail/index?insId=' + insId + '&insName=' + insName + '&control=0')
+            }
+					}
+				})
+				
+			} else if (opType === 'view') {
+				//跳到流程到流程查看页面
+        if(modelId == '200001' || modelId == '200002'){
+          let url = '/pages/process/common/detail?insId=' + insId + '&insName=' + insName + '&control=0&modelId=' + modelId
+          $tab.navigateTo(url)
+        }else{
+          $tab.navigateTo('/pages/process/detail/index?insId=' + insId + '&insName=' + insName + '&control=0')
+        }
+			} else {
+				// 未知操作类型,跳转到消息详情页
+				$tab.navigateTo('/pages/message/detail/index?messageId=' + messageid + '&universalId=' + universalid)
+			}
+		} catch (error) {
+			console.error('jump_id解析失败:', error);
+			// 解析失败,跳转到消息详情页
+			$tab.navigateTo('/pages/message/detail/index?messageId=' + messageid + '&universalId=' + universalid)
+		}
+	} else {
+		// jump_id为空,跳转到消息详情页
+		$tab.navigateTo('/pages/message/detail/index?messageId=' + messageid + '&universalId=' + universalid)
+	}
+}
+
+// AI咨询按钮
+function clickFabButton() {
+	// console.log('clickFabButton');
+	$tab.navigateTo('/pages/message/chat/index')
+}
+//跳转打卡页
+function toClockInBtn() {
+	$tab.navigateTo('/pages/mine/clockIn/clockIn')
+}
+//待办流程数
+const unProcessNum = ref(0)
+//未读消息数
+const unReadMsgNum = ref(0)
+//待阅消息数+待办流程数(用于tarbar导航栏)
+const unReadNum = ref(0)
+function showTabBarBadge() {
+	getUnProcessNum(userStore.user.useId, "").then(res => {
+		if ("failed" == res.returnMsg) {
+			$modal.showToast('待办流程数获取失败')
+			return
+		} else {
+			unProcessNum.value = parseInt(res.returnParams?.total || 0, 10);
+		}
+		getUnReadMessageNum(userStore.user.useId).then(res => {
+			unReadMsgNum.value = parseInt(res.returnParams ?? 0, 10);
+			unReadNum.value = unReadMsgNum.value + unProcessNum.value;
+			setThisTabBarBadge(0,unReadNum.value)
+			setThisTabBarBadge(1,unProcessNum.value)
+		})
+	})
+}
+// 提取通用 badge 设置逻辑
+function setThisTabBarBadge(index, count) {
+	if (count <= 0) {
+		uni.removeTabBarBadge({ index });
+	} else {
+		uni.setTabBarBadge({
+			index,
+			text: count > 99 ? "99+" : String(count)
+		});
+	}
+}
+// 设置所有消息已读
+function setAllMsgRead() {
+	$modal.confirm('是否全部已读').then(res => {
+		if (res) {
+			const params = {
+				currentUser: userStore.user.useId,
+				isRead: "0",
+				pSize: unReadMsgNum.value,
+				type: "",
+				p: 1,
+			}
+			getMessageList(params).then(({ returnParams }) => {
+				const unReadMsgIds = returnParams.ids === "" ? "" : returnParams.ids + ",";
+				setMsgIsRead(unReadMsgIds).then((res) => {
+					if (Number.isInteger(res)) {
+						switch (res) {
+							case -1:
+								$modal.msgError('操作失败')
+								break
+							case -2:
+							case 0:
+								$modal.msg('不存在未读消息')
+								msgListRef.value.reload();// 调用子组件刷新数据
+								showTabBarBadge()
+								break
+							default:
+								$modal.msgSuccess('操作成功')
+								//刷新页面
+								msgListRef.value.reload();// 调用子组件刷新数据
+								showTabBarBadge()
+						}
+					} else {
+						$modal.confirm('登录状态失效,您可以继续留在该页面,或者重新登录?').then(res => {
+							userStore.LogOut().then(res => {
+								uni.reLaunch({ url: '/pages/login?type=autoLogin' })
+							})
+						}).catch(() => { })
+					}
+				})
+			})
+		}
+	}).catch(() => { })
+}
+</script>
+
+<style lang="scss" scoped>
+// @import "@/static/font/ygoa/iconfont.css";
+
+::v-deep .uni-badge {
+	height: calc(1.5rem + 0px) !important;
+	min-width: calc(1.5rem + 0px) !important;
+	line-height: calc(1.375rem + 0px) !important;
+	font-size: calc(1.125rem + 0px) !important;
+}
+
+::v-deep .process_container {
+	.process_list {
+		.process_contant {
+			font-size: calc(14px + .5*(1rem - 16px));
+		}
+
+		.flow_step_section {
+			.uni-section .uni-section-header {
+				padding: 5px 10px;
+			}
+		}
+
+		.flow_step_container {
+			min-height: 60px;
+			margin: 10px 15px;
+
+			.u-steps {
+				.u-steps-item {
+					padding-bottom: 11px;
+
+					.u-text__value--content {
+						font-size: calc(13px + .5*(1rem - 16px)) !important;
+					}
+
+					.u-text__value--main {
+						font-size: calc(13px + .5*(1rem - 16px)) !important;
+						font-weight: 500 !important;
+					}
+
+					.u-text__value--tips {
+						font-size: calc(12px + .5*(1rem - 16px)) !important;
+					}
+
+					.redcontent {
+						.u-text__value--content {
+							color: #ff4500;
+						}
+					}
+
+					.active_step_circle {
+						width: 20px;
+						height: 20px;
+						box-sizing: border-box;
+						flex-shrink: 0;
+						border-radius: 100px;
+						border-width: 1px;
+						border-color: #A78BFA;
+						background-color: #A78BFA;
+						border-style: solid;
+						display: flex;
+						flex-direction: row;
+						align-items: center;
+						justify-content: center;
+						transition: background-color .3s;
+
+						.active_step_text {
+							color: #fff;
+							font-size: 11px;
+							display: flex;
+							flex-direction: row;
+							align-items: center;
+							justify-content: center;
+							text-align: center;
+							line-height: 11px;
+						}
+					}
+				}
+
+				.u-steps-item view:last-of-type {
+					margin-top: 0 !important;
+				}
+			}
+		}
+	}
+}
+
+::v-deep .notice_list {
+	.msg_list_container {
+		.zp-l-text-rpx {
+			font-size: calc(30rpx + .5*(1rem - 16px));
+		}
+	}
+}
+
+.read_button {
+	position: absolute;
+	top: calc(12px + .5 * (1rem - 16px));
+	right: 3.125rem;
+	height: calc(1.75rem + 0px);
+	line-height: 1.75rem;
+	font-size: calc(0.875rem + 0px);
+	background-color: #007aff;
+	color: #fff;
+}
+
+.read_button[disabled] {
+	background-color: #f5f5f5;
+	color: #666;
+	opacity: 0.5;
+}
+
+::v-deep .message_list {
+	.msg_list_container {
+		.segmented_control_container {
+			.segmented-control__text {
+				font-size: calc(14px + .5*(1rem - 16px));
+			}
+		}
+
+		.zp-paging-container-content {
+			.zp-l-text-rpx {
+				font-size: calc(30rpx + .5*(1rem - 16px));
+			}
+		}
+	}
+}
+
+::v-deep .fab_button {
+	.toClockInBtn {
+		.uni-fab__circle--rightBottom {
+			bottom: 100px;
+		}
+	}
+	
+	.toAiBtn {
+		uni-icons {
+			text {
+				font-family: 'ygoa_work_icon' !important;
+			}
+			text:before {
+				content: "\e660" !important;
+			}
+		}
+	}
+
+	.uni-fab__circle {
+		width: calc(55px + .5*(1rem - 16px)) !important;
+		height: calc(55px + .5*(1rem - 16px)) !important;
+
+		.uni-icons {
+			font-size: calc(32px + .5*(1rem - 16px)) !important;
+		}
+	}
+}
+</style>

+ 271 - 0
pages/tabbar-mine/index.vue

@@ -0,0 +1,271 @@
+<template>
+	<page-meta root-font-size="system" />
+	<view class="content">
+		<!-- 用户信息部分 -->
+		<uni-card margin="0" spacing="0">
+			<view class="headImg">
+				<image :src="config.baseUrlPre + ((userStore.user.photo ?? '') || config.defaultAvatarPath)" class="avatar" @click="toEditAvatar"></image>
+			</view>
+			<view class="user-info" @click="lookMsg()">
+				<view class="info-detail">
+					<view class="name">
+						<text>姓名: {{ userStore.user.name}}</text>
+					</view>
+					<!-- <view class="desc">
+						<text>ID: {{ userStore.user.useId }}</text>
+					</view> -->
+					<!-- 部门切换框 -->
+					<view class="uni-list-cell">
+						<view class="uni-list-cell-left">
+							部门:
+						</view>
+						<view class="uni-list-cell-db" @click.stop="">
+							<picker @change.stop="bindPickerChange" :value="index" :range="deptNameArray">
+								<view class="uni-input">
+								{{ deptNameArray[index] }}
+								</view>
+							</picker>
+						</view>
+					</view>
+					<view class="desc">
+						<text> 职务: {{ userStore.user.groupXUsers[index].posName ||'暂无'}}</text>
+					</view>
+
+				</view>
+				<uni-icons type="forward" size="16" margin-left="10px"></uni-icons>
+			</view>
+		</uni-card>
+
+		<uni-card margin="0" spacing="0" is-shadow="false">
+			<!-- 功能按钮区 -->
+			<view class="function-list">
+				<view class="function-item" @click="editData">
+					<text class="ygoa_icon icon-edit"></text>
+					<text class="title">编辑资料</text>
+					<text class="desc"></text>
+				</view>
+
+				<view class="function-item" @click="checkIn">
+					<text class="ygoa_icon icon-checkIn"></text>
+					<text class="title">我的考勤</text>
+					<text class="desc"></text>
+				</view>
+
+				<view class="function-item" @click="clockIn">
+					<text class="ygoa_icon icon-clockIn"></text>
+					<text class="title">我的打卡</text>
+					<text class="desc"></text>
+				</view>
+				<view class="function-item" @click="setting">
+					<text class="ygoa_icon icon-setting"></text>
+					<text class="title">应用设置</text>
+					<text class="desc"></text>
+				</view>
+			</view>
+		</uni-card>
+
+
+	</view>
+</template>
+
+<script setup lang="ts">
+	import { onMounted, ref } from 'vue';
+	import $tab from "@/plugins/tab.js"
+	import { useUserStore } from '@/store/user.js'
+	import config from '@/config';
+	import { onShow } from '@dcloudio/uni-app'
+	const userStore = useUserStore()
+
+	onShow(() => {
+		uni.$emit('showTabBarBadge')
+	})
+
+	// 部门数组
+	const deptNameArray = ref(['研发部', '业务部', '法务部']);
+	const index = ref(0);
+	onMounted(() => {
+		initDeptArray();
+	})
+
+	//部门初始化
+	function initDeptArray() {
+		const groupXUsers = userStore.user.groupXUsers;
+		// 使用map方法提取groupName
+		deptNameArray.value = groupXUsers.map(groupXUser => groupXUser.groupName) || ['无数据'];
+	}
+
+	// 部门切换事件
+	function bindPickerChange(e) {
+		index.value = e.detail.value; // 更新选择的部门索引
+	};
+
+	// 查看个人信息的函数
+	function lookMsg() {
+		$tab.navigateTo('/pages/mine/personal_message/personal_message?id=' + userStore.user.useId + '&name=' + userStore.user.name);
+	};
+
+	// 编辑资料的函数
+	function editData() {
+		$tab.navigateTo('/pages/mine/edit/edit')
+	};
+
+	// 我的考勤的函数
+	function checkIn() {
+		$tab.navigateTo('/pages/mine/checkIn/checkIn')
+	}
+
+	// 应用设置的函数
+	function setting() {
+		$tab.navigateTo('/pages/mine/setting/setting')
+	};
+
+	// 打卡的函数
+	function clockIn() {
+		$tab.navigateTo('/pages/mine/clockIn/clockIn')
+	};
+	//头像修改页
+	function toEditAvatar() {
+		// $tab.navigateTo('/pages/mine/avatar/avatarTest/avatarTest')
+		$tab.navigateTo('/pages/mine/avatar/avatar')
+	}
+</script>
+
+<style lang="scss" scoped>
+	// @import "@/static/font/ygoa/iconfont.css";
+
+	.ygoa_icon {
+		margin-right: calc(10px + .5*(1rem - 16px)) !important;
+		font-size: calc(1.6rem + 0px) !important;
+	}
+
+	.content {
+		display: flex;
+		flex-direction: column;
+	}
+
+
+	.user-info {
+		display: flex;
+		align-items: center;
+		padding: 16px 48px;
+		border-bottom: 1rpx solid #666;
+		color: #777;
+		::v-deep .uni-icons {
+			font-size: calc(1rem + 0px) !important;
+		}
+	}
+
+
+	.avatar {
+		width: calc(6.25rem + 0px) !important;
+		height: calc(6.25rem + 0px) !important;
+		border-radius: 50%;
+	}
+
+	.info-detail {
+		flex-grow: 1;
+		// text-align: center;
+		.name {
+			padding: 0.5rem 0;
+			color: #333;
+			font-size: calc(1.1rem + 0px) !important;
+		}
+		.desc {
+			font-size: calc(0.875rem + 0px) !important;
+		}
+	}
+
+
+
+
+	.function-list {
+		margin-bottom: calc(16px + .5*(1rem - 16px)) !important;
+	}
+
+	.function-item {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: calc(12px + .5*(1rem - 16px)) !important;
+		background-color: #ffffff;
+		border-radius: 10rpx;
+		margin-bottom: 0.75rem;
+		border-bottom: 1px solid gainsboro;
+	}
+
+
+	.title {
+		flex-grow: 1;
+		font-size: calc(1rem + 0px) !important;
+	}
+
+	.desc {
+		color: #777;
+		margin-right: 0.5rem;
+	}
+
+	.desc::after {
+		content: ">";
+	}
+
+	.select1 {
+		display: inline-block;
+		width: 50%;
+		margin-top: 0.3rem;
+	}
+
+	.headImg {
+		text-align: center;
+	}
+
+
+	//样式穿透
+	::v-deep .uni-list-cell {
+		justify-content: left;
+	}
+
+	::v-deep .uni-list-cell-left {
+		padding: 0 0;
+		font-size: calc(1.1rem + 0px) !important;
+		color: #333;
+		flex: none;
+	}
+
+	::v-deep .uni-list-cell::after {
+		background-color: #f5f5f5;
+	}
+
+	::v-deep .uni-input {
+		padding: 0.5rem 0.25rem;
+		text-decoration: underline;
+		/* 给文字添加下划线 */
+		color: blue;
+		font-size: calc(1.1rem + 0px) !important;
+		background-color: #f5f5f5;
+		overflow: hidden;
+		/* 隐藏超出部分 */
+		white-space: nowrap;
+		/* 不换行 */
+		text-overflow: ellipsis;
+		/* 省略号 */
+		max-width: 30vh;
+	}
+
+
+	::v-deep .uni-list-cell-db,
+	.uni-list-cell-right {
+		flex: none;
+	}
+
+	::v-deep .uni-card {
+		background-color: #f5f5f5 !important;
+	}
+
+	::v-deep .uni-card--shadow {
+		box-shadow: none !important;
+	}
+
+	::v-deep .uni-card--border {
+		border: none !important;
+	}
+</style>

+ 859 - 0
pages/tabbar-process/index.vue

@@ -0,0 +1,859 @@
+<template>
+	<page-meta root-font-size="system" />
+	<view class="index_container">
+		<view class="search_container">
+			<uni-row>
+				<uni-col :xs="3" :sm="2">
+					<view @click="openPopup" class="popup_button_container">
+						<text class="ygoa_icon icon-filter"></text>
+						<!-- <text class="button_text">筛选</text> -->
+					</view>
+				</uni-col>
+				<view class="search_bar">
+					<!-- 输入框搜索 -->
+					<uni-col v-if="0 == searchItem" :xs="17" :sm="19">
+						<uni-search-bar @confirm="searchBarConfirm" @cancel="cancelSearch" @blur="searchBarOnBlur"
+							clearButton="none" placeholder="搜索栏">
+							<template v-slot:searchIcon>
+								<uni-icons type="search" size="calc(30px + .5*(1rem - 16px))"></uni-icons>
+							</template>
+						</uni-search-bar>
+					</uni-col>
+					<!-- 类型 下拉框搜索 -->
+					<uni-col v-else-if="1 == searchItem" :xs="16" :sm="18">
+						<picker class="picker_container" @change="bindPickerChange" :value="pickerItem"
+							:range="pickerItems" range-key="modelName">
+							<view class="uni-input input_text">
+								{{ pickerItems[pickerItem].modelName }}
+							</view>
+						</picker>
+						<view @click="search(pickerItems[pickerItem].modelId)" class="picker_button_container">
+							<uni-icons type="search" size="calc(30px + .5*(1rem - 16px))"></uni-icons>
+							<text class="button_text">搜索</text>
+						</view>
+					</uni-col>
+					<!-- 时间范围搜索 -->
+					<uni-col v-else-if="2 == searchItem" :xs="16" :sm="18">
+						<view class="datetime_picker_container">
+							<uni-datetime-picker type="daterange" @change="datetimePickerChange" @clear="cancelSearch"
+								:border="false" />
+						</view>
+					</uni-col>
+					<!-- 清空筛选按钮 -->
+					<uni-col :xs="2" :sm="2">
+						<view @click="cancelSearch" class="clear_button_container">
+							<uni-icons type="clear" size="calc(24px + .5*(1rem - 16px))" color="#999"></uni-icons>
+						</view>
+					</uni-col>
+				</view>
+			</uni-row>
+		</view>
+		<view class="segmented_control_container">
+			<uni-segmented-control :current="current" :values="items" @clickItem="clickSegmentItem" styleType="text"
+				activeColor="#409eff"></uni-segmented-control>
+		</view>
+		<view class="process_list">
+			<process-list ref="processListRef" @clickCancel="handleToCancelProcess" @clickSegment="getProcessData"
+				@clickItem="handleToProcessDetail" @scrollToBottom="getProcessPage" :current="current" :pSize="5"
+				:pageNo="1"></process-list>
+		</view>
+		<view class="popup_container">
+			<uni-popup ref="searchItemPopup" type="bottom">
+				<!-- 弹窗标题 -->
+				<!-- <view class="popup-title">流程类型分类</view> -->
+				<!-- 流程分类列表 -->
+				<uni-section title="流程类型" type="line" class="uni-section">
+					<uni-collapse :accordion="true">
+						<uni-list class="flow-category-list">
+							<!-- 一级分类:流程类型(遍历ftypeList) -->
+							<uni-collapse-item 
+								class="flow-type-group" 
+								:open="false" 
+								:show-animation="true"
+								v-for="(type, typeIdx) in flowList.ftypeList" 
+								:key="typeIdx"
+								:title="type.typeName"
+							>
+								<template v-slot:title>
+									<view class="group-header">
+										<!-- 流程类型图标(可自定义) -->
+										<uni-icons type="list" size="24rpx" class="group-icon" />
+										<!-- 流程类型名称 -->
+										<text class="group-name">{{ type.typeName }}</text>
+										<!-- 流程类型下的总数量角标 -->
+										<!-- <view class="badge" v-if="getTypeItemCount(type.typeId) > 0">
+											{{ getTypeItemCount(type.typeId) }}
+										</view> -->
+										<uni-badge :text="getTypeItemCount(type.typeId)" v-if="getTypeItemCount(type.typeId) > 0"></uni-badge>
+									</view>
+								</template>
+								<view v-for="(item, index) in flowList.fList" :index="index" :key="item.modelId">
+									<!-- <uni-list-item @click="searchByModelId(item)"  v-if="type.typeId === item.typeId.typeId"
+										clickable  class=""> -->
+										<view 
+										    @click="searchByModelId(item)"  
+										    v-if="type.typeId === item.typeId.typeId"
+										    style="padding: 16rpx 60rpx; background: #fff; border-bottom: 1px solid #f5f5f7;"
+										    class="flow-item-sub"
+										  >
+											<view style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+												<text class="sub-item-title">{{ item.modelName }}</text>
+												<uni-badge :text="getModelItemCount(item.modelId)" v-if="getModelItemCount(item.modelId) > 0"></uni-badge>
+											</view>
+											<!-- <view class="sub-item-title"> -->
+												<!-- <text>{{ item.modelName }}</text> -->
+												<!-- 单个流程项角标(根据modelId统计待办数量) -->
+												<!-- <view class="badge small-badge" v-if="getModelItemCount(item.modelId) > 0">
+													{{ getModelItemCount(item.modelId) }}
+												</view> -->
+											<!-- </view> -->
+										</view>
+									<!-- </uni-list-item> -->
+							</view>
+							</uni-collapse-item>
+						</uni-list>
+					</uni-collapse>
+				</uni-section>
+				<!-- <uni-section title="发起人" type="line" @click="clickSearchItem('createUser')"></uni-section>
+				<uni-section title="时间" type="line" @click="clickSearchItem('createTime')"></uni-section> -->
+			</uni-popup>
+		</view>
+	</view>
+</template>
+
+<script setup lang="ts">
+	import processList from '@/components/ygoa/processList.vue'
+	import { onShow, onLoad } from '@dcloudio/uni-app'
+	import { reactive, ref, onMounted } from 'vue';
+	import $tab from '@/plugins/tab.js'
+	import $modal from '@/plugins/modal.js'
+	import { getUserProcess, getUserProcessed, getUserProcessing, getUserAllProcess, getUserCopyProcess, cancelProcessFlow, getProcessList, getProcessFormInfo } from '@/api/process';
+	import { useUserStore } from '@/store/user';
+
+	onMounted(() => {
+		uni.$on('ReloadProcessData', () => {
+			new Promise((resolve, reject) => {
+				processListRef.value.onClickItem()
+			})
+		})
+	})
+	onShow(() => {
+		uni.$emit('showTabBarBadge')
+	})
+	const userStore = useUserStore()
+	onLoad(({ insId, tinsId, insName, control, modelId }) => {
+		if (insId) {
+			const username = userStore.user.name
+			getProcessFormInfo( userStore.user.useId, insId ).then(({ returnParams }) => {
+				//流程流转的最后一步
+				const lastChecker = returnParams.processCheckers[returnParams.processCheckers.length - 1]
+				if (username == lastChecker.v_user && 0 !== lastChecker.n_state) {
+					//流程流转到当前用户且流程未撤销
+					tinsId = lastChecker.l_tins_id
+				}
+				handleToProcessDetail({ username, insId, tinsId, insName, control, modelId})
+			})
+		}
+		const staffId = userStore.user.useId
+		const unitId = userStore.user.unitId
+		getProcessList(staffId, unitId).then(res => {
+			flowList.value = res.returnParams // 设置flowList
+			// 先加载完流程列表数据,再获取待办流程数量
+			// 使用 setTimeout 确保流程列表先显示
+			setTimeout(() => {
+				getProcessCountsByType()
+			}, 500) // 延迟500毫秒调用,确保流程列表数据先加载
+		})
+	})
+
+
+	// 搜索项
+	const candidates = ref(['发起者', '类型', '时间'])
+	// 搜索栏选中项
+	const searchItem = ref(0)
+	// 搜索项弹出层
+	const searchItemPopup = ref(null)
+	// 待办流程数量按类型分组
+	const processCountsByType = ref({})
+	// 待办流程数量按模型分组
+	const processCountsByModel = ref({})
+	
+	// 打开搜索项弹出层
+	function openPopup() {
+		searchItemPopup.value.open()
+	}
+	// 关闭搜索项弹出层
+	function closePopup() {
+		searchItemPopup.value.close()
+	}
+	// 选中搜索项
+	function clickSearchItem(item) {
+		//debugger
+		// searchItem.value = item
+		// if (item == 1 && pickerItems.value.length == 1) initPickerItems()
+		if(item == "createUser") {
+			
+		} else if(item == "createTime") {
+			
+		} else {
+			search(item.modelId)
+		}
+		closePopup()
+	}
+	// 搜索参数
+	const queryParams = ref({})
+	// 输入框搜索栏
+	function searchBarConfirm(e) {
+		// console.log('searchBarConfirm: ', e);
+	}
+	// 输入框搜索栏失去焦点
+	function searchBarOnBlur(queryParam) {
+		search(queryParam.value)
+	}
+	// 取消输入框搜索
+	// function searchBarCancel() {
+	// 	cancelSearch()
+	// }
+	// 下拉框搜索
+	const pickerItems = ref([{ modelId: '', modelName: '无' }])
+	const pickerItem = ref(0)
+	// 流程列表
+	const flowList = ref({
+		fList: [],
+		ftypeList: [
+			{
+				typeName: ''
+			}
+		],
+	})
+	// 获取流程宫格数据
+	function initPickerItems() {
+		const staffId = userStore.user.useId
+		const unitId = userStore.user.unitId
+		getProcessList(staffId, unitId).then(res => {
+			// flowList.value = res.returnParams // 设置flowList
+			pickerItems.value = res.returnParams.fList.map(({ modelId, modelName }) => {
+				return { modelId, modelName }
+			})
+			pickerItems.value.unshift({ modelId: '', modelName: '无' })
+		})
+	}
+	// 搜索栏 下拉框选择项
+	function bindPickerChange(e) {
+		pickerItem.value = e.detail.value
+		// console.log('bindPickerChange: ', e);
+	}
+	// 时间选择器搜索
+	// const datetimePickerRange = ref([])
+	function datetimePickerChange(event) {
+		search(event)
+	}
+	
+	// 搜索
+	function searchByModelId(item) {
+		queryParams.value = { 'modelId': item.modelId };
+		processListRef.value.onClickItem() // 调用子组件刷新数据
+		closePopup()
+	}
+	// 搜索
+	function search(queryParam) {
+		switch (searchItem.value) {
+			case 0: queryParams.value = { 'name': queryParam }; break;
+			case 1: queryParams.value = { 'modelId': queryParam }; break;
+			case 2:
+				queryParams.value = {
+					'starttime': queryParam[0],
+					'endtime': queryParam[1]
+				};
+				break;
+		}
+		// debugger
+		// if(queryParam.value == "createUser") {
+		// 	queryParams.value = { 'name': queryParam };
+		// } else if(queryParam.value == "createTime") {
+		// 	queryParams.value = {
+		// 		'starttime': queryParam[0],
+		// 		'endtime': queryParam[1]
+		// 	};
+		// } else {
+		// 	queryParams.value = { 'modelId': queryParam };
+		// }
+		processListRef.value.onClickItem() // 调用子组件刷新数据
+	}
+	// 取消搜索
+	function cancelSearch() {
+		queryParams.value = {}
+		processListRef.value.onClickItem() // 调用子组件刷新数据
+	}
+	
+	// 获取待办流程数量并按类型分组
+	function getProcessCountsByType() {
+		const params = {
+			staffId: userStore.user.useId,
+			page: 1,
+			pageNum: 9999, // 获取所有待办流程
+			modelId: "",
+			//control: 1,
+			queryParams: {}
+		}
+		
+		getUserProcess(params).then(({ returnParams }) => {
+			const processList2 = returnParams.list || []
+			// 初始化计数器
+			const countsByType = {}
+			const countsByModel = {}
+			// 遍历流程列表,按typeId和modelId统计数量
+			processList2.forEach(process => {
+				// 根据process.modelId与flowList.value.fList中的item.modelId进行匹配
+				const matchingFlow = flowList.value.fList.find(f => f.modelId === process.modelId)
+				if (matchingFlow && matchingFlow.typeId) {
+					const typeId = matchingFlow.typeId.typeId
+					// 按typeId统计
+					countsByType[typeId] = (countsByType[typeId] || 0) + 1
+					// 按modelId统计
+					countsByModel[process.modelId] = (countsByModel[process.modelId] || 0) + 1
+				}
+			})
+			// 更新响应式数据
+			processCountsByType.value = countsByType
+			processCountsByModel.value = countsByModel
+		}).catch(error => {
+			console.error('获取待办流程数量失败:', error)
+		})
+	}
+	
+	// 根据typeId获取待办数量
+	function getTypeItemCount(typeId) {
+		return processCountsByType.value[typeId] || 0
+	}
+	
+	// 根据modelId获取待办数量
+	function getModelItemCount(modelId) {
+		return processCountsByModel.value[modelId] || 0
+	}
+	
+	// 分段器选项
+	const items = reactive(['我的', '抄送', '待办', '在办', '办结'])
+	// 分段器选项
+	const current = ref(items.findIndex(item => item == '待办'))
+	// 子组件
+	const processListRef = ref(null)
+
+	// 待办列表
+	// const processes = ref([])
+	// 分段器点击事件 调用子组件刷新数据
+	function clickSegmentItem({ currentIndex }) {
+		// processes.value = [] // 清空列表数据
+		current.value = currentIndex // 更新分段器状态
+		processListRef.value.onClickItem() // 调用子组件刷新数据
+	}
+
+
+	// 获取待办列表数据
+	const point = ref(0)
+	const requestMap = [
+		getUserAllProcess, // 我的
+		getUserCopyProcess, // 抄送
+		getUserProcess, // 待办
+		getUserProcessing, // 在办
+		getUserProcessed // 办结
+	]
+	function getProcessData({ pageNo, pSize }, callback) {
+		const flag = point.value = new Date().getTime()
+		const params = {
+			staffId: userStore.user.useId,
+			page: pageNo,
+			pageNum: pSize,
+			modelId: "",
+			//control: 1,
+			queryParams: queryParams.value
+		}
+		requestMap[current.value](params).then(( { returnParams, Rows, Total } ) => {
+			// 只加载最新数据 防止快速连续点击分段器造成数据错乱
+			if (flag == point.value) {
+				callback(
+					current.value == 1 ? Rows : returnParams.list, 
+					current.value == 1 ? Total : returnParams.total, 
+					pageNo
+				)
+			}
+		})
+	}
+	// 分页获取待办列表数据
+	function getProcessPage({ pageNo, pSize }, callback) {
+		const params = {
+			staffId: userStore.user.useId,
+			page: pageNo,
+			pageNum: pSize,
+			modelId: "",
+			//control: 1,
+			queryParams: queryParams.value
+		}
+		requestMap[current.value](params).then(( { returnParams, Rows, Total } ) => {
+			callback(
+				current.value == 1 ? Rows : returnParams.list, 
+				current.value == 1 ? Total : returnParams.total, 
+				pageNo
+			)
+		})
+	}
+	// 跳转到流程详情页
+	function handleToProcessDetail({ username, insId, tinsId, insName, control, modelId }) {
+		//debugger
+		// 判断是否为特殊流程的审批
+		if (control == '0' && modelId) {
+      if(modelId == '200001' || modelId == '200002'){
+        // 跳转到通用审批页面
+        let url = '/pages/process/common/detail?insId=' + insId + '&insName=' + insName + '&control=' + control + '&modelId=' + modelId
+        if (tinsId && current.value != 1) { // 排除抄送流程的 tinsId
+          url = url + '&tinsId=' + tinsId
+        }
+        $tab.navigateTo(url)
+        return
+      }else{
+        let url = '/pages/process/detail/index?insId=' + insId + '&insName=' + insName + '&control=' + control
+        if (tinsId && current.value != 1) { // 抄送流程的 tinsId
+          url = url + '&tinsId=' + tinsId
+        }
+        $tab.navigateTo(url)
+      }
+		}
+		// 原有通用流程审批逻辑
+		let url = '/pages/process/detail/index?insId=' + insId + '&insName=' + insName + '&control=' + control
+		if (tinsId && current.value != 1) { // 抄送流程的 tinsId
+			url = url + '&tinsId=' + tinsId
+		}
+		$tab.navigateTo(url)
+	}
+	function handleToCancelProcess(process) {
+		uni.showModal({
+			title: '确认撤回' + process.insName,
+			editable: true,
+			placeholderText: '请输入撤回备注',
+			success: ({ confirm, content }) => {
+				if (content == '') {
+					$modal.msgError('撤回备注不能为空!')
+					return
+				}
+				if (confirm) {
+					cancelProcessFlow(userStore.user.useId, content, process)
+						.then(({ returnMsg }) => {
+							if (returnMsg.includes('success')) {
+								$modal.msgSuccess('撤销成功')
+								// 通知列表刷新数据
+								processListRef.value.onClickItem() // 调用子组件刷新数据
+							} else {
+								$modal.msgError(returnMsg)
+							}
+						})
+				}
+			}
+		})
+	}
+</script>
+
+<style lang="scss" scoped>
+	::v-deep .uni-badge {
+		height: calc(1.5rem + 0px) !important;
+		min-width: calc(1.5rem + 0px) !important;
+		line-height: calc(1.375rem + 0px) !important;
+		font-size: calc(1.125rem + 0px) !important;
+	}
+	// @import url("@/static/font/ygoa/iconfont.css");
+	.search_container {
+		padding: 10px 0;
+
+		.popup_button_container {
+			display: flex;
+			justify-content: center;
+			margin-left: 5px;
+			height: 36px;
+			line-height: 36px;
+			width: 100%;
+			background-color: #f5f5f5;
+			text-align: center;
+			font-size: calc(16px + .5*(1rem - 16px));
+			color: #333;
+
+			.ygoa_icon {
+				font-size: calc(16px + .5*(1rem - 16px));
+			}
+
+			.button_text {
+				font-size: calc(16px + .5*(1rem - 16px));
+				width: 64px;
+				margin-left: 4px;
+			}
+		}
+
+		.clear_button_container {
+			display: flex;
+			justify-content: center;
+			margin-left: 5px;
+			height: 36px;
+			line-height: 36px;
+			width: 100%;
+			background-color: #f5f5f5;
+			text-align: center;
+			color: #999;
+
+			&:active {
+				background-color: #e0e0e0;
+			}
+		}
+
+		::v-deep .search_bar {
+			.uni-searchbar {
+				padding: 0;
+
+				.uni-searchbar__box-search-input {
+					font-size: calc(14px + .5*(1rem - 16px)) !important;
+				}
+
+				.uni-searchbar__cancel {
+					font-size: calc(14px + .5*(1rem - 16px)) !important;
+				}
+			}
+
+			.picker_container {
+				display: inline-block;
+				float: left;
+				background-color: #f8f8f8;
+				width: 70%;
+				height: 36px;
+
+				.input_text {
+					display: flex;
+					justify-content: center;
+					text-align: center;
+					background-color: #f8f8f8;
+					border: 1px solid #e5e5e5;
+					border-radius: 5px;
+					width: 100%;
+					height: 26px;
+					color: #000;
+					font-size: calc(14px + .5*(1rem - 16px)) !important;
+					line-height: 26px;
+					padding: 4px 8px 4px 0;
+				}
+			}
+
+			.picker_button_container {
+				display: inline-flex;
+				justify-content: center;
+				margin-left: 5px;
+				height: 36px;
+				line-height: 36px;
+				background-color: #f5f5f5;
+				text-align: center;
+				font-size: calc(16px + .5*(1rem - 16px));
+				width: 25%;
+
+				.button_text {
+					overflow: hidden;
+					font-size: calc(16px + .5*(1rem - 16px));
+					margin-left: 4px;
+				}
+			}
+
+			.datetime_picker_container {
+				.uni-date {
+					.uni-date-editor {
+						margin-right: 5px;
+
+						.uni-date-x {
+							background-color: #f8f8f8;
+							color: #000;
+							font-size: calc(14px + .5*(1rem - 16px));
+
+							.uni-icons {
+								font-size: calc(22px + .5*(1rem - 16px));
+							}
+
+							.uni-date__x-input {
+								font-size: calc(14px + .5*(1rem - 16px));
+							}
+						}
+
+						.uni-date__icon-clear {
+							.uni-icons {
+								font-size: calc(22px + .5*(1rem - 16px));
+								// color: #c0c4cc;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	::v-deep .segmented_control_container {
+		.segmented-control__text {
+			font-size: calc(14px + .5*(1rem - 16px));
+		}
+	}
+
+	::v-deep .process_list {
+		.process_contant {
+			font-size: calc(14px + .5*(1rem - 16px));
+
+			.button_container {
+				button {
+					font-size: calc(13px + .4*(1rem - 16px))
+				}
+			}
+		}
+
+		.zp-l-text-rpx {
+			font-size: calc(30rpx + .5*(1rem - 16px));
+		}
+
+		.flow_step_section {
+			.uni-section .uni-section-header {
+				padding: 5px 10px;
+			}
+		}
+
+		.flow_step_container {
+			min-height: 60px;
+			margin: 10px 15px;
+
+			.u-steps {
+				.u-steps-item {
+					padding-bottom: 11px;
+
+					.u-text__value--content {
+						font-size: calc(13px + .5*(1rem - 16px)) !important;
+					}
+
+					.u-text__value--main {
+						font-size: calc(13px + .5*(1rem - 16px)) !important;
+						font-weight: 500 !important;
+					}
+
+					.u-text__value--tips {
+						font-size: calc(12px + .5*(1rem - 16px)) !important;
+					}
+
+					.redcontent {
+						.u-text__value--content {
+							color: #ff4500;
+						}
+					}
+
+					.active_step_circle {
+						width: 20px;
+						height: 20px;
+						box-sizing: border-box;
+						flex-shrink: 0;
+						border-radius: 100px;
+						border-width: 1px;
+						border-color: #A78BFA;
+						background-color: #A78BFA;
+						border-style: solid;
+						display: flex;
+						flex-direction: row;
+						align-items: center;
+						justify-content: center;
+						transition: background-color .3s;
+
+						.active_step_text {
+							color: #fff;
+							font-size: 11px;
+							display: flex;
+							flex-direction: row;
+							align-items: center;
+							justify-content: center;
+							text-align: center;
+							line-height: 11px;
+						}
+					}
+				}
+
+				.u-steps-item view:last-of-type {
+					margin-top: 0 !important;
+				}
+			}
+		}
+	}
+
+	::v-deep .uni-calendar__content {
+		margin: -20px;
+		margin-top: 20px;
+
+		.uni-calendar__header {
+			.uni-calendar__header-text {
+				font-size: calc(14px + .5*(1rem - 16px)) !important;
+			}
+
+			.uni-calendar__backtoday {
+				padding: 2px 8px 2px 10px !important;
+				font-size: calc(0.75rem + 0px) !important;
+			}
+		}
+
+		.uni-calendar__box {
+			.uni-calendar__weeks {
+				.uni-calendar__weeks-day {
+					.uni-calendar__weeks-day-text {
+						font-size: calc(14px + .5*(1rem - 16px)) !important;
+					}
+				}
+
+				.uni-calendar__weeks-item {
+					.uni-calendar-item__weeks-box-item {
+						.uni-calendar-item__weeks-box-circle {
+							width: calc(8px + .5*(1rem - 16px)) !important;
+							height: calc(8px + .5*(1rem - 16px)) !important;
+							top: calc(5px - .25*(1rem - 16px)) !important;
+							right: calc(5px - .25*(1rem - 16px)) !important;
+						}
+
+						.uni-calendar-item__weeks-box-text {
+							font-size: calc(14px + .5*(1rem - 16px)) !important;
+						}
+
+						.uni-calendar-item__weeks-lunar-text {
+							font-size: calc(12px + .5*(1rem - 16px)) !important;
+						}
+					}
+				}
+			}
+		}
+
+		.uni-date-changed {
+			.uni-date-changed--time-date {
+				font-size: calc(14px + 1*(1rem - 16px)) !important;
+			}
+
+			.uni-datetime-picker-text {
+				font-size: calc(14px + 1*(1rem - 16px)) !important;
+			}
+		}
+	}
+	
+	
+	/* 弹窗整体样式 */
+		.popup_container {
+			// min-height: 1000rpx;
+			::v-deep .uni-popup__content {
+				border-radius: 16rpx 16rpx 0 0;
+				background-color: #fff;
+			}
+		}
+	
+		/* 弹窗标题 */
+		.popup-title {
+			font-size: 32rpx;
+			font-weight: bold;
+			padding: 20rpx 30rpx;
+			border-bottom: 1px solid #f5f5f7;
+			color: #333;
+		}
+	/* 流程分类列表容器 */
+		.flow-category-list {
+			::v-deep .uni-list {
+				background: #fff;
+				border: none;
+			}
+		}
+	
+		/* 一级分类:流程类型组样式 */
+		.flow-type-group {
+			::v-deep .uni-collapse-item__content {
+				padding: 0;
+				border: none;
+			}
+	
+			.group-header {
+				display: flex;
+				align-items: center;
+				padding: 20rpx 30rpx;
+				width: 100%;
+				box-sizing: border-box;
+	
+				.group-icon {
+					margin-right: 16rpx;
+					color: #666;
+				}
+	
+				.group-name {
+					font-size: 28rpx;
+					flex: 1;
+					color: #333;
+				}
+	
+				.group-arrow {
+					color: #999;
+					margin-left: 10rpx;
+				}
+			}
+		}
+	
+		/* 二级分类:流程项样式 */
+		.flow-item-sub {
+			::v-deep .uni-list-item__container {
+				padding: 16rpx 60rpx; /* 缩进显示,区分一级分类 */
+				border: none;
+				// 点击时的高亮效果(可选)
+				&:active {
+					background-color: #F0F0F0; // 点击时加深一点,提升交互体验
+				}
+			}
+	
+			.sub-item-title {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				font-size: 26rpx;
+				color: #666;
+				width: 100%;
+				box-sizing: border-box;
+			}
+		}
+	
+		/* 通用角标样式 */
+		.badge {
+			min-width: 36rpx;
+			height: 36rpx;
+			line-height: 36rpx;
+			text-align: center;
+			background-color: #ff4d4f;
+			color: #fff;
+			font-size: 22rpx;
+			border-radius: 18rpx;
+			padding: 0 8rpx;
+			margin-right: 10rpx;
+			display: inline-block !important;
+		}
+	
+		/* 小角标(单个流程项使用,可选) */
+		.small-badge {
+			min-width: 30rpx;
+			height: 30rpx;
+			line-height: 30rpx;
+			font-size: 20rpx;
+			display: inline-block !important;
+		}
+	::v-deep .uni-section {
+		overflow-y: scroll;
+		max-height: 1000rpx;
+		min-height: 1000rpx;
+		background-color: #fff;
+	}
+
+// 给 uni-list-item 加相对定位,约束 right 插槽
+  ::v-deep .uni-list-item {
+    position: relative !important; // 关键:约束绝对定位的 right 插槽
+    width: 100% !important; // 确保列表项占满父容器
+    box-sizing: border-box !important;
+  }
+
+  // 调整 uni-badge 样式,避免溢出
+  ::v-deep .uni-badge {
+    position: static !important; // 取消绝对定位,改为静态流布局
+    margin-left: 10rpx !important; // 与文字保持间距
+    display: inline-block !important;
+	background-color: #ff4d4f !important;
+  }
+</style>

+ 379 - 0
pages/tabbar-work/index.vue

@@ -0,0 +1,379 @@
+<template>
+	<page-meta root-font-size="system" />
+	<view class="work-container">
+		<!-- 宫格组件 -->
+		<view v-if="processList.fList.length != 0">
+			<view v-for="(type, typeIndex) in processList.ftypeList" :key="typeIndex">
+				<uni-section :title="type.typeName" titleFontSize="1.3rem" type="line"></uni-section>
+				<view class="grid-body">
+					<uni-grid :column="uni_grid_column" :showBorder="false"  >
+						<view v-for="(item, index) in processList.fList" :index="index" :key="index" >
+							<view v-if="type.typeId === item.typeId.typeId" @click="changeProcessGrid(item)">
+								<uni-grid-item >
+									<view class="grid-item-box">
+										<text class="ygoa_work_icon"
+											:class="item.modelPicture == 'default.png' ? 'icon-outsourcing' : item.modelPicture"></text>
+										<view class="modelName">
+										<text class="text">{{ item.modelName }}</text>
+										</view>
+									</view>
+								</uni-grid-item>
+							</view>
+						</view>
+					</uni-grid>
+				</view>
+			</view>
+		</view>
+		<uni-section title="考勤管理" titleFontSize="1.3rem" type="line"></uni-section>
+		<view class="grid-body">
+			<uni-grid :column="uni_grid_column" :showBorder="false" @change="changeAttendanceGrid">
+				<uni-grid-item :index="1">
+					<view class="grid-item-box">
+						<text class="ygoa_icon icon-checkIn"></text>
+						<text class="text">考勤</text>
+					</view>
+				</uni-grid-item>
+				<uni-grid-item :index="2">
+					<view class="grid-item-box">
+						<text class="ygoa_icon icon-location"></text>
+						<text class="text">打卡</text>
+					</view>
+				</uni-grid-item>
+			</uni-grid>
+		</view>
+		<view v-if="diaryShow">
+			<uni-section title="日报周报" titleFontSize="1.3rem" type="line"></uni-section>
+			<view class="grid-body">
+				<uni-grid :column="uni_grid_column" :showBorder="false" @change="changeDiaryGrid">
+					<uni-grid-item :index="1">
+						<view class="grid-item-box">
+							<text class="ygoa-icon icon-diary"></text>
+							<text class="text">日报</text>
+						</view>
+					</uni-grid-item>
+					<!-- <uni-grid-item :index="2">
+						<view class="grid-item-box">
+							<text class="ygoa-icon icon-diary"></text>
+							<text class="text">日报</text>
+						</view>
+					</uni-grid-item> -->
+				</uni-grid>
+			</view>
+		</view>
+		<uni-section title="系统工具" titleFontSize="1.3rem" type="line"></uni-section>
+		<view class="grid-body">
+			<uni-grid :column="uni_grid_column" :showBorder="false" @change="changeToolsGrid">
+				<uni-grid-item :index="1">
+					<view class="grid-item-box">
+						<text class="ygoa_icon icon-calculator"></text>
+						<text class="text">计算器</text>
+					</view>
+				</uni-grid-item>
+				<uni-grid-item :index="2">
+					<view class="grid-item-box">
+						<text class="ygoa_icon icon-clear-cache"></text>
+						<text class="text">清除缓存</text>
+					</view>
+				</uni-grid-item>
+			</uni-grid>
+		</view>
+		<uni-section title="房屋管家" titleFontSize="1.3rem" v-if="homesysShow" type="line"></uni-section>
+		<view class="grid-body" v-if="homesysShow">
+			<uni-grid :column="uni_grid_column" :showBorder="false" @change="changeHomesys">
+				<uni-grid-item v-for="(home, index) in homesysList" :index="index" v-if="homesysShow" :key="index">
+					<view class="grid-item-box">
+						<text class="ygoa_work_icon icon-zhinengjiaju"></text>
+						<text class="text">
+							{{ home.room_name || home.room_url.split('/').pop() }}
+						</text>
+					</view>
+				</uni-grid-item>
+				<uni-grid-item :index="homesysList.length + 1" v-if="userStore.user.userName == 'yzadmin'">
+					<view class="grid-item-box">
+						<text class="ygoa_work_icon icon-zhinengjiaju"></text>
+						<text class="text">房屋管理</text>
+					</view>
+				</uni-grid-item>
+				<!-- <uni-grid-item :index="homesysList.length + 2" v-if="userStore.user.userName == 'yzadmin'">
+					<view class="grid-item-box">
+						<text class="ygoa_work_icon icon-zhinengjiaju"></text>
+						<text class="text">用户管理</text>
+					</view>
+				</uni-grid-item> -->
+				<uni-grid-item :index="homesysList.length + 3" v-if="userStore.user.userName == 'yzadmin'">
+					<view class="grid-item-box">
+						<text class="ygoa_work_icon icon-zhinengjiaju"></text>
+						<text class="text">用户管理</text>
+					</view>
+				</uni-grid-item>
+			</uni-grid>
+		</view>
+		<!-- 计算器弹出层 -->
+		<view class="popup_container">
+			<cui-calculator ref="calculatorPopup" size="normal"></cui-calculator>
+		</view>
+		<!-- 清除缓存弹出层 -->
+		<!-- <view class="clear_cache_popup_container">
+			<uni-popup ref="clearCacheDialog" type="dialog">
+				<uni-popup-dialog title="确认清除缓存" @confirm="clearCache"></uni-popup-dialog>
+			</uni-popup>
+		</view> -->
+	</view>
+</template>
+
+<script setup lang="ts">
+import cuiCalculator from "@/components/cui-calculator/cui-calculator.vue"
+import { onMounted, ref } from "vue"
+import $tab from "@/plugins/tab.js"
+import { useUserStore } from '@/store/user.js'
+import { getProcessList, roomUserLogin, getUserRoomByUser } from '@/api/work.js'
+import { clearCache } from '@/utils/ygoa.js'
+import { onShow } from '@dcloudio/uni-app'
+import config from '@/config.js';
+const userStore = useUserStore()
+
+let sysFontSize = 0
+const uni_grid_column = ref(4)
+
+const diaryShow = ref(false)
+if(config.companyCode && config.companyCode == 'yg'){
+	diaryShow.value = true;
+}else{
+	diaryShow.value = false;
+}
+const homesysShow = ref(false)
+const homesysList = ref([])
+function getUserRoom() {
+	getUserRoomByUser(userStore.user.userName).then((res) => {
+		console.log('getUserRoomByUser', res)
+		const hasRoom = res.length != 0
+		if (hasRoom) {
+			homesysList.value = res
+			homesysShow.value = true
+			console.log('getUserRoomByUser', homesysList.value)
+		}
+	})
+}
+// 点击房屋管家
+function changeHomesys(e) { 
+	const roomIndex = e.detail.index
+	const roomListLength = homesysList.value.length
+	// if (roomIndex > roomListLength) {
+		switch (roomIndex) {
+			case roomListLength + 1: 
+				$tab.navigateTo('/pages/work/homesysSetting/index')
+				break
+			case roomListLength + 2: 
+				$tab.navigateTo('/pages/work/homesysSetting/user')
+				break
+			case roomListLength + 3: 
+				$tab.navigateTo('/pages/work/homesysSetting/userList')
+				break
+			default:
+				$tab.navigateTo('/pages/work/homesys/index?homeCode=' + homesysList.value[roomIndex].room_url)
+		}
+	// } else {
+	// 	$tab.navigateTo('/pages/work/homesys/index?homeCode=' + homesysList.value[roomIndex].room_url)
+	// }
+}
+onMounted(() => {
+	getUserRoom()
+})
+onMounted(() => {
+	sysFontSize = uni.getAppBaseInfo().fontSizeSetting
+	if (sysFontSize > 20) uni_grid_column.value = 3
+	initProcessList()
+})
+
+onShow(()=>{
+		uni.$emit('showTabBarBadge')
+})
+// 流程列表
+const processList = ref({
+	fList: [],
+	ftypeList: [
+		{
+			typeName: ''
+		}
+	],
+})
+// 获取流程宫格数据
+function initProcessList() {
+	const staffId = userStore.user.useId
+	const unitId = userStore.user.unitId
+	getProcessList(staffId, unitId).then(res => {
+		processList.value = res.returnParams // 设置processList
+	})
+}
+// 点击流程宫格
+function changeProcessGrid(item) { 
+	// console.log('changeProcessGrid', e);
+	// const { modelName, modelId, control } = processList.value.fList[e.detail.index]
+	const { modelName, modelId, control } = item
+	// const modelName = item.value.modelName
+	// const modelId = item.value.modelId
+	// const control = item.value.control
+	// 判断是否为特殊流程
+	if (control == '0') {
+		// control 为 0 时,根据 modelId 判断
+		if (modelId == '200001') {
+			// 采购发起流程
+			$tab.navigateTo('/pages/work/purchase/start?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control)
+			return
+		}else if (modelId == '200002') {
+      // 合同发起流程
+      $tab.navigateTo('/pages/work/contract/start?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control)
+      return
+    }else{
+      $tab.navigateTo('/pages/work/edit/index?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control)
+    }
+		// 其他特殊流程可以跳转到通用发起页面(后续扩展)
+		// $tab.navigateTo('/pages/process/common/start?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control)
+		// return
+	}
+	// 跳转流程申请页面(原有逻辑)
+	$tab.navigateTo('/pages/work/edit/index?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control)
+}
+// 点击考勤宫格
+function changeAttendanceGrid(e) {
+	if (1 == e.detail.index) { // 考勤
+		$tab.navigateTo('/pages/mine/checkIn/checkIn')
+	}
+	if (2 == e.detail.index) { // 打卡
+		$tab.navigateTo('/pages/mine/clockIn/clockIn')
+	}
+}
+// 点击日报宫格
+function changeDiaryGrid(e) { 
+	if (1 == e.detail.index) {
+		wx.navigateToMiniProgram({
+			appId: 'wxd45c635d754dbf59',
+			// path: `pages/detail/detail?url=https://docs.qq.com/sheet/DUmJRc2NYTmx1d3Nr`,
+		})
+		// wx.navigateToMiniProgram({
+		// 	appId: 'wxde4bf149a4c88707',
+		// 	path: `pages/login`
+		// })
+		return
+	}
+	if (2 == e.detail.index) {
+		$tab.navigateTo('/pages/work/diary/index')
+		return
+	}
+}
+// 点击工具宫格
+function changeToolsGrid(e) { 
+	switch (e.detail.index) {
+		case 1:
+			openCalculatorPopup() // 打开计算器弹出层
+			break
+		case 2:
+			clearCache()
+			// openClearCachePopup() // 打开清除缓存弹出层
+			break
+		default:
+	}
+}
+// 计算器
+const calculatorPopup = ref(null)
+function openCalculatorPopup() { // 打开计算器弹出层
+	calculatorPopup.value.open()
+}
+// 清除缓存
+// const clearCacheDialog = ref(null)
+// function openClearCachePopup() { // 打开清除缓存弹出层
+// 	clearCacheDialog.value.open()
+// }
+// const userStore = useUserStore()
+
+</script>
+
+<style lang="scss">
+// @import "@/static/font/ygoa/iconfont.css";
+
+.ygoa_icon, .ygoa_work_icon {
+	font-size: calc(80rpx + 1.5*(1rem - 16px));
+}
+.icon_size {
+	font-size: calc(80rpx + 1.5*(1rem - 16px));
+}
+
+/* #ifndef APP-NVUE */
+page {
+	display: flex;
+	flex-direction: column;
+	box-sizing: border-box;
+	background-color: #fff;
+	min-height: 100%;
+	height: auto;
+}
+
+view {
+	font-size: calc(14px + 1.5*(1rem - 16px));
+	line-height: inherit;
+}
+
+/* #endif */
+
+.text {
+	text-align: center;
+	font-size: calc(26rpx + 1.5*(1rem - 16px));
+	margin-top: 10rpx;
+}
+.modelName {
+	max-width: 120rpx;
+	text-align: center;
+}
+.work-container {
+	.grid-item-box {
+		flex: 1;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		padding: 15px 0;
+	}
+	
+	// .uni-margin-wrap {
+	// 	width: 690rpx;
+	// 	width: 100%;
+	// }
+	
+	.swiper {
+		height: 300rpx;
+	}
+	
+	.swiper-box {
+		height: 150px;
+	}
+	
+	.swiper-item {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		color: #fff;
+		height: 300rpx;
+		line-height: 300rpx;
+	}
+	
+	@media screen and (min-width: 500px) {
+		.uni-swiper-dot-box {
+			width: 400px;
+			/* #ifndef APP-NVUE */
+			margin: 0 auto;
+			/* #endif */
+			margin-top: 8px;
+		}
+	
+		.image {
+			width: 100%;
+		}
+	}
+}
+
+</style>