index.uvue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. <template>
  2. <uni-navbar-lite :showLeft=false title="首页"></uni-navbar-lite>
  3. <view class="page-container">
  4. <!-- 背景图 -->
  5. <!-- <image class="bg-image" src="/static/images/index/1.png" mode="widthFix"></image> -->
  6. <!-- <view class="bg-color"></view> -->
  7. <scroll-view class="page-content">
  8. <view class="db-view">
  9. <view class="db-box" @click="navigateToOverdueOrders" v-if="checkPermi(['gxt:app:overdue'])" >
  10. <view v-if="overdueCount > 0" class="badge"><text class="count">{{ overdueCount }}</text></view>
  11. <view class="db-block">
  12. <view class="db-center-3">
  13. <image class="db-image" src="/static/images/map/2.png"></image>
  14. </view>
  15. </view>
  16. <text class="db-text">超时工单</text>
  17. </view>
  18. <view class="db-box" @click="navigateToAssignedOrders">
  19. <view v-if="assignedCount > 0" class="badge"><text class="count">{{ assignedCount }}</text></view>
  20. <view class="db-block">
  21. <view class="db-center-1">
  22. <image class="db-image" src="/static/images/map/1.png"></image>
  23. </view>
  24. </view>
  25. <text class="db-text">待处理工单</text>
  26. </view>
  27. <view class="db-box" @click="navigateToScoreOrders" v-if="checkPermi(['gxt:app:toScore'])">
  28. <view v-if="selfScoreCount > 0" class="badge"><text class="count">{{ selfScoreCount }}</text></view>
  29. <view class="db-block">
  30. <view class="db-center-2">
  31. <image class="db-image" src="/static/images/map/2.png"></image>
  32. </view>
  33. </view>
  34. <text class="db-text">待评分工单</text>
  35. </view>
  36. </view>
  37. <!-- <view>
  38. <button @click="handlePush">通知</button>
  39. </view> -->
  40. <!-- 即将超时工单列表 -->
  41. <!-- <view class="section-title-container" v-if="almostOverdueListData.length > 0">
  42. <view class="section-header">
  43. <text class="section-title">即将超时工单</text>
  44. <text class="view-all" @click="navigateToAlmostOverdueOrders">查看全部</text>
  45. </view>
  46. </view>
  47. <common-list
  48. v-if="almostOverdueListData.length > 0"
  49. :dataList="almostOverdueListData.slice(0, 2)"
  50. :loading="almostOverdueLoading"
  51. :hasMore="false"
  52. :refresherEnabled="false"
  53. :itemKey="'id'"
  54. @itemClick="handleAlmostOverdueItemClick"
  55. >
  56. <template #default="{ item }">
  57. <view class="list-item">
  58. <view class="item-container">
  59. <view class="item-header">
  60. <text class="item-title">{{ getPcsDeviceName(item) }}-{{ getStationName(item) }}</text>
  61. </view>
  62. <view class="info-row">
  63. <text class="text-gray">工单编码:{{ getWorkOrderProjectNo(item) }}</text>
  64. <text class="text-gray" :class="getRemarkClass(item)">{{ getRemark(item) }}</text>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <template #loadMore>
  70. <view></view>
  71. </template>
  72. </common-list> -->
  73. <!-- 超时工单列表 -->
  74. <view class="section-title-container">
  75. <view class="section-header">
  76. <text class="section-title">超时工单</text>
  77. <text class="view-all" @click="navigateToOverdueOrders" v-if="overdueListData.length > 0">查看全部</text>
  78. </view>
  79. </view>
  80. <template v-if="overdueListData.length > 0">
  81. <common-list
  82. :dataList="overdueListData.slice(0, 4)"
  83. :loading="overdueLoading"
  84. :hasMore="false"
  85. :refresherEnabled="false"
  86. :itemKey="'id'"
  87. @itemClick="handleOverdueItemClick"
  88. >
  89. <template #default="{ item }">
  90. <view class="list-item">
  91. <view class="item-container">
  92. <view class="item-header">
  93. <text class="item-title">{{ getPcsDeviceName(item) }}-{{ getStationName(item) }}</text>
  94. <!-- <text class="status-tag status-suspended">{{ getWorkOrderStatus(item) }}</text> -->
  95. </view>
  96. <view class="info-row">
  97. <text class="text-gray">工单编码:{{ getWorkOrderProjectNo(item) }}</text>
  98. <!-- <text class="text-gray overdue-title">{{ getRemark(item) }}</text> -->
  99. </view>
  100. <view class="info-row">
  101. <text class="overdue-title">{{ getRemark(item) }}</text>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. <template #loadMore>
  107. <view></view>
  108. </template>
  109. </common-list>
  110. </template>
  111. <template v-else>
  112. <view class="empty-tips">
  113. <text class="empty-text">暂无超时工单</text>
  114. </view>
  115. </template>
  116. </scroll-view>
  117. <!-- 底部 TabBar -->
  118. <custom-tabbar :current="0" :hide0="tabbar[0]" :hide1="tabbar[1]" :hide2="tabbar[2]" :hide3="tabbar[3]"/>
  119. </view>
  120. </template>
  121. <script setup lang="uts">
  122. import { ref, onMounted } from 'vue'
  123. import { getUserInfo } from '../../utils/storage'
  124. import FlowChart from '../../components/index/flow-chart/flow-chart.uvue'
  125. import { getOrderList, almostOverdueList, overdueList, pendingList } from '../../api/order/list'
  126. import { listMyRate } from '../../api/score/index'
  127. import type { SysDictData } from '../../types/dict'
  128. import { getDictDataByType } from '../../api/dict/index'
  129. // import {startKeepAlive,stopKeepAlive} from '@/uni_modules/ygtx-keepService'
  130. // import { RequestOption } from '@/uni_modules/ygtx-keepService/utssdk/interface.uts';
  131. import { getBaseUrl } from '../../utils/request'
  132. import { KeepLive } from '@/uni_modules/android-keeplive'
  133. import { getMyNotify, registerServer} from '../../api/index/index'
  134. import {checkPermi} from '../../utils/storage'
  135. // const handleStartKeepAlive = (userId: string) => {
  136. // let notifyUrl = getBaseUrl() + "/mobile/notify";
  137. // console.log("通知地址:" + notifyUrl)
  138. // const requestOption:RequestOption = {
  139. // requestUrl: notifyUrl, // 你的接口地址(必填)
  140. // requestData: JSON.stringify({ method: "get", data: userId }), // 请求数据(字符串格式,必填)
  141. // task_interval: 10000 // 任务间隔(毫秒,必填)
  142. // };
  143. // startKeepAlive(requestOption,
  144. // (res:any)=>{
  145. // console.log(res)
  146. // });
  147. // };
  148. const tabbar = [1,1,1,1]
  149. // 用户名
  150. const userName = ref<string>('用户')
  151. // 待接单数量
  152. const assignedCount = ref<number>(0)
  153. // 待自评工单数量
  154. const selfScoreCount = ref<number>(0)
  155. // 超时工单数量
  156. const overdueCount = ref<number>(0)
  157. // 即将超时工单列表
  158. const almostOverdueListData = ref<any[]>([])
  159. const almostOverdueLoading = ref<boolean>(false)
  160. // 超时工单列表
  161. const overdueListData = ref<any[]>([])
  162. const overdueLoading = ref<boolean>(false)
  163. // 维保类型字典列表
  164. const inspectionTypeList = ref<SysDictData[]>([])
  165. // 添加字典加载状态
  166. const dictLoaded = ref<boolean>(false)
  167. // 获取工单状态字典列表
  168. const loadStatusDictList = async (): Promise<void> => {
  169. try {
  170. const result = await getDictDataByType('gxt_inspection_type')
  171. const resultObj = result as UTSJSONObject
  172. if (resultObj['code'] == 200) {
  173. const data = resultObj['data'] as any[]
  174. const dictData: SysDictData[] = []
  175. if (data.length > 0) {
  176. for (let i = 0; i < data.length; i++) {
  177. const item = data[i] as UTSJSONObject
  178. // 只提取需要的字段
  179. const dictItem: SysDictData = {
  180. dictValue: item['dictValue'] as string | null,
  181. dictLabel: item['dictLabel'] as string | null,
  182. dictCode: null,
  183. dictSort: null,
  184. dictType: null,
  185. cssClass: null,
  186. listClass: null,
  187. isDefault: null,
  188. status: null,
  189. default: null,
  190. createTime: null,
  191. remark: null
  192. }
  193. dictData.push(dictItem)
  194. }
  195. }
  196. inspectionTypeList.value = dictData
  197. dictLoaded.value = true
  198. }
  199. } catch (e: any) {
  200. console.error('获取工单状态字典失败:', e.message)
  201. dictLoaded.value = true
  202. }
  203. }
  204. // 获取待接单数量
  205. const loadAssignedCount = async (): Promise<void> => {
  206. try {
  207. const result = await pendingList(1, 1, null)
  208. const resultObj = result as UTSJSONObject
  209. if (resultObj['code'] == 200) {
  210. const total = resultObj['total'] as number
  211. assignedCount.value = total
  212. }
  213. } catch (e: any) {
  214. console.error('获取待处理工单数量失败:', e.message)
  215. }
  216. }
  217. // 获取待自评工单数量
  218. const loadSelfScoreCount = async (): Promise<void> => {
  219. try {
  220. const params: UTSJSONObject = {
  221. pageNum: 1,
  222. pageSize: 1,
  223. scoringStatus: 'to_self,to_re,to_confirm,to_final'
  224. }
  225. const result = await listMyRate(params)
  226. const resultObj = result as UTSJSONObject
  227. if (resultObj['code'] == 200) {
  228. const total = resultObj['total'] as number
  229. selfScoreCount.value = total
  230. }
  231. } catch (e: any) {
  232. console.error('获取待自评工单数量失败:', e.message)
  233. }
  234. }
  235. // 获取超时工单数量
  236. const loadOverdueCount = async (): Promise<void> => {
  237. try {
  238. const result = await overdueList(1, 1, '') // 只需要获取总数,不需要具体数据
  239. const resultObj = result as UTSJSONObject
  240. if (resultObj['code'] == 200) {
  241. const total = resultObj['total'] as number
  242. overdueCount.value = total
  243. }
  244. } catch (e: any) {
  245. console.error('获取超时工单数量失败:', e.message)
  246. }
  247. }
  248. // 获取即将超时工单列表
  249. const loadAlmostOverdueList = async (): Promise<void> => {
  250. try {
  251. almostOverdueLoading.value = true
  252. const result = await almostOverdueList(1, 2, '') // 获取前2条
  253. const resultObj = result as UTSJSONObject
  254. if (resultObj['code'] == 200) {
  255. const rows = resultObj['rows'] as any[]
  256. almostOverdueListData.value = rows
  257. }
  258. } catch (e: any) {
  259. console.error('获取即将超时工单列表失败:', e.message)
  260. } finally {
  261. almostOverdueLoading.value = false
  262. }
  263. }
  264. // 获取超时工单列表
  265. const loadOverdueList = async (): Promise<void> => {
  266. try {
  267. overdueLoading.value = true
  268. const result = await overdueList(1, 4, '') // 获取前2条
  269. const resultObj = result as UTSJSONObject
  270. if (resultObj['code'] == 200) {
  271. const data = resultObj['rows'] as any[]
  272. overdueListData.value = data
  273. }
  274. } catch (e: any) {
  275. console.error('获取超时工单列表失败:', e.message)
  276. } finally {
  277. overdueLoading.value = false
  278. }
  279. }
  280. // 跳转到待接单列表
  281. const navigateToAssignedOrders = (): void => {
  282. // 使用 redirectTo 而不是 switchTab,因为工单页面不是 tabBar 页面
  283. // uni.redirectTo({
  284. // url: '/pages/order/index?isDeal=1'
  285. // })
  286. // 跳转到待处理工单页面
  287. uni.navigateTo({
  288. url: '/pages/order/pendingOrder'
  289. })
  290. // // 延迟设置状态,确保页面已加载
  291. // setTimeout(() => {
  292. // uni.$emit('switchOrderStatus', 'deal')
  293. // }, 500)
  294. }
  295. // 跳转到评分工单列表
  296. const navigateToScoreOrders = (): void => {
  297. // 跳转到待评分工单页面
  298. uni.navigateTo({
  299. url: '/pages/score/pending'
  300. })
  301. // uni.redirectTo({
  302. // url: '/pages/score/index'
  303. // })
  304. // 延迟设置状态,确保页面已加载
  305. // setTimeout(() => {
  306. // uni.$emit('switchScoreStatus', 'to_self')
  307. // }, 500)
  308. }
  309. // 跳转到超时工单列表
  310. const navigateToOverdueOrders = (): void => {
  311. // 跳转到超时工单页面
  312. uni.navigateTo({
  313. url: '/pages/order/overdue'
  314. })
  315. }
  316. // 跳转到即将超时工单列表
  317. const navigateToAlmostOverdueOrders = (): void => {
  318. // 跳转到即将超时工单页面
  319. uni.navigateTo({
  320. url: '/pages/order/almostOverdue'
  321. })
  322. }
  323. const getNofiyMes = (): void=>{
  324. const userInfo = getUserInfo()
  325. if (userInfo != null) {
  326. const userId = userInfo['userId']?.toString()
  327. if(userId!=null){
  328. getMyNotify(userId).then((result:any) => {
  329. const jsonData = JSON.stringify(result)
  330. const respData = JSON.parse(jsonData) as UTSJSONObject
  331. if (respData['code'] == 200 &&
  332. respData.hasOwnProperty('data') && respData['data'] != null) {
  333. const data = respData['data'] as UTSJSONObject
  334. const badge = data["num"] as number
  335. setTimeout(() => {
  336. console.log("============:" + badge)
  337. if(badge > -1){
  338. uni.setAppBadgeNumber(badge);
  339. }
  340. if(data.hasOwnProperty("title") && data["title"] != null
  341. && data.hasOwnProperty("desc") && data["desc"] != null){
  342. const title = data["title"] as string
  343. const desc = data["desc"] as string
  344. uni.createPushMessage({
  345. title: title,
  346. content: desc,
  347. when: Date.now() + 10000,
  348. icon: "/static/login/2.png",
  349. sound: "system",
  350. success: (res) => {
  351. console.log('创建推送消息成功', res);
  352. },
  353. fail: (err) => {
  354. console.error('创建推送消息失败', err);
  355. }
  356. });
  357. }
  358. }, 0);
  359. }
  360. }).catch((error) => {
  361. console.error('Promise 执行失败:', error)
  362. });
  363. }
  364. }
  365. }
  366. const handleKeepAlive = ()=>{
  367. var keep=new KeepLive()
  368. keep.setTitle("工效通")
  369. keep.setContent("工效通正在运行")
  370. // keep.setLargeIcon("icon");
  371. keep.setSmallIcon("icon"); //图标名字 图标放在 插件下面的 uni_modules\android-keeplive\utssdk\app-android\res 文件夹下
  372. keep.onAddBackgroundCallback(function(res:boolean){
  373. console.log("后台运行 "+res)
  374. })
  375. keep.onAddScrrenListenerCallback(function(res:boolean){
  376. console.log("屏幕开启状态 "+res)
  377. })
  378. keep.setWakeLock(1,"keeptag");// 设置唤醒类型
  379. keep.setAutoStartEnable(true)
  380. keep.doStartApplicationWithPackageName("uni.app.UNI1050C07");
  381. if(!keep.checkAppNotification()){
  382. keep.onOpenNotificationSetting(function(res:boolean){
  383. keep.register();
  384. var ignoring= keep.isIgnoringBatteryOptimizations();
  385. if(!ignoring){
  386. keep.requestIgnoreBatteryOptimizations();
  387. }
  388. })
  389. }else{
  390. keep.register();
  391. var ignoring= keep.isIgnoringBatteryOptimizations();
  392. if(!ignoring){
  393. keep.requestIgnoreBatteryOptimizations();
  394. }
  395. }
  396. // keep.wifilock();
  397. // 稳定定时器 需要的用户使用(默认定时器1 )
  398. const is_time = uni.getStorageSync("notify_key")
  399. console.log("检查定时器" + is_time)
  400. if(is_time == "0"){
  401. console.log("启动定时器")
  402. keep.onStartCSystemTimer(10,function(){
  403. console.log("onStartCSystemTimer ");
  404. getNofiyMes();
  405. keep.acquire(1000);// 唤醒一秒钟
  406. });
  407. uni.setStorageSync("notify_key", "1")
  408. }
  409. }
  410. // 辅助函数:从 any 类型提取属性
  411. const getWorkOrderProjectNo = (item: any | null): string | null => {
  412. if (item == null) return ''
  413. const orderInfoItem = item as UTSJSONObject
  414. return orderInfoItem['workOrderProjectNo'] as string != null ? orderInfoItem['workOrderProjectNo'] as string : ''
  415. }
  416. const getPcsDeviceName = (item: any | null): string | null=> {
  417. if (item == null) return ''
  418. const orderInfoItem = item as UTSJSONObject
  419. return orderInfoItem['pcsDeviceName'] as string != null ? orderInfoItem['pcsDeviceName'] as string : ''
  420. }
  421. const getStationName = (item: any | null): string | null=> {
  422. if (item == null) return ''
  423. const orderInfoItem = item as UTSJSONObject
  424. return orderInfoItem['pcsStationName'] as string != null ? orderInfoItem['pcsStationName'] as string : ''
  425. }
  426. const getCreateTime = (item: any | null): string|null => {
  427. if (item == null) return null
  428. const orderInfoItem = item as UTSJSONObject
  429. return orderInfoItem['createTime'] as string != null ? orderInfoItem['createTime'] as string : ''
  430. }
  431. const getRemark = (item: any | null): string|null => {
  432. if (item == null) return null
  433. const orderInfoItem = item as UTSJSONObject
  434. return orderInfoItem['remark'] as string != null ? orderInfoItem['remark'] as string : ''
  435. }
  436. // 根据剩余时间获取颜色类名
  437. const getRemarkClass = (item: any | null): string => {
  438. if (item == null) return ''
  439. const orderInfoItem = item as UTSJSONObject
  440. const remark = orderInfoItem['remark'] as string
  441. if (remark == null || remark.length === 0) return ''
  442. // 解析备注中的剩余时间(假设格式为包含数字和小时的字符串)
  443. // 例如:"剩余时间:5小时" 或 "还剩10小时"
  444. const timeMatch = remark.match(/(\d+(\.\d+)?)\s*(小时|时)/)
  445. if (timeMatch != null && timeMatch.length > 1 && timeMatch[1] != null) {
  446. const hours = parseFloat(timeMatch[1] as string)
  447. if (hours < 6) {
  448. return 'time-critical' // 红色
  449. } else if (hours < 12) {
  450. return 'time-warning' // 橙色
  451. } else if (hours < 24) {
  452. return 'time-notice' // 黄色
  453. }
  454. }
  455. return ''
  456. }
  457. // 辅助函数:从 any 类型提取属性
  458. const getOrderType = (item: any | null): string => {
  459. if (item == null) return ''
  460. const orderInfoItem = item as UTSJSONObject
  461. return orderInfoItem['orderType'] == 1?"维修工单":"维保工单";
  462. }
  463. const getInspectionType = (item: any | null): string | null => {
  464. if (item == null) return ''
  465. const orderInfoItem = item as UTSJSONObject
  466. const rawStatus = orderInfoItem['inspectionType']
  467. if (rawStatus==null) return ''
  468. // 如果字典尚未加载,返回原始值
  469. if (!dictLoaded.value) {
  470. return rawStatus
  471. }
  472. // 查找字典中对应的标签
  473. const dictItem = inspectionTypeList.value.find(dict => dict.dictValue == rawStatus)
  474. return dictItem!=null ? dictItem.dictLabel : rawStatus
  475. }
  476. // 即将超时工单点击事件
  477. const handleAlmostOverdueItemClick = (item: any, index: number): void => {
  478. if (item == null) return
  479. const orderItem = item as UTSJSONObject
  480. try {
  481. // 跳转到工单详情页
  482. uni.navigateTo({
  483. url: `/pages/order/detail/index?id=${orderItem['id']}&orderType=${orderItem['orderType']}`
  484. })
  485. } catch (e) {
  486. console.error('处理即将超时工单点击事件失败:', e)
  487. }
  488. }
  489. // 超时工单点击事件
  490. const handleOverdueItemClick = (item: any, index: number): void => {
  491. if (item == null) return
  492. const orderItem = item as UTSJSONObject
  493. try {
  494. // 跳转到工单详情页
  495. uni.navigateTo({
  496. url: `/pages/order/detail/acceptIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
  497. })
  498. } catch (e) {
  499. console.error('处理超时工单点击事件失败:', e)
  500. }
  501. }
  502. const registerPush =() =>{
  503. console.log("获取CID")
  504. uni.getPushClientId({
  505. success: (res) => {
  506. console.log(res.cid);
  507. registerServer(res.cid).then((result:any) => {
  508. console.log("注册成功");
  509. });
  510. },
  511. fail(err) {
  512. console.log(err)
  513. }
  514. })
  515. }
  516. // 初始化
  517. onMounted(() => {
  518. const userInfo = getUserInfo()
  519. if (userInfo != null) {
  520. const realName = userInfo['nickName'] as string | null
  521. userName.value = realName ?? '用户'
  522. const userId = userInfo['userId']?.toString()
  523. if(userId!=null){
  524. console.log("监听:"+userId)
  525. handleKeepAlive()
  526. registerPush();
  527. }
  528. }
  529. // 加载待接单数量
  530. loadAssignedCount()
  531. // 加载待自评工单数量
  532. loadSelfScoreCount()
  533. // 加载超时工单数量
  534. loadOverdueCount()
  535. // 加载即将超时工单列表
  536. // loadAlmostOverdueList()
  537. // 加载超时工单列表
  538. loadOverdueList()
  539. // 监听工单状态更新事件
  540. uni.$on('refreshAssignedCount', () => {
  541. loadAssignedCount()
  542. })
  543. // 监听评分工单状态更新事件
  544. uni.$on('refreshSelfScoreCount', () => {
  545. loadSelfScoreCount()
  546. })
  547. // 监听超时工单状态更新事件
  548. uni.$on('refreshOverdueCount', () => {
  549. loadOverdueCount()
  550. })
  551. // 监听接单成功的事件,刷新列表
  552. uni.$on('refreshOrderList', () => {
  553. loadOverdueList()
  554. })
  555. })
  556. </script>
  557. <style lang="scss">
  558. .page-container {
  559. position: relative;
  560. flex: 1;
  561. // padding-top: env(safe-area-inset-top);
  562. background-color: #e8f0f9;
  563. }
  564. .bg-image {
  565. position: absolute;
  566. top: 0;
  567. left: 0;
  568. width: 100%;
  569. height: 100%;
  570. z-index: 0;
  571. }
  572. .bg-color {
  573. position: absolute;
  574. top: 0;
  575. left: 0;
  576. width: 100%;
  577. height: 100%;
  578. z-index: -1;
  579. background: #71a6e4;
  580. }
  581. .page-content {
  582. position: relative;
  583. flex: 1;
  584. margin-top: 30rpx;
  585. margin-bottom: 150rpx;
  586. // padding: 20rpx;
  587. z-index: 10;
  588. }
  589. .header {
  590. flex-direction: row;
  591. height: 40px;
  592. &-title {
  593. font-size: 40rpx;
  594. color: #ffffff;
  595. font-weight: bold;
  596. margin-bottom: 15rpx;
  597. }
  598. &-greeting {
  599. font-size: 28rpx;
  600. color: rgba(255, 255, 255, 0.9);
  601. }
  602. }
  603. .section-title {
  604. font-size: 32rpx;
  605. color: #333333;
  606. font-weight: bold;
  607. // margin-bottom: 20rpx;
  608. }
  609. .section-title-container {
  610. margin-top: 20rpx;
  611. padding: 20rpx 30rpx;
  612. }
  613. .section-header {
  614. flex-direction: row;
  615. justify-content: space-between;
  616. align-items: center;
  617. }
  618. .view-all {
  619. font-size: 28rpx;
  620. color: #165dff;
  621. }
  622. /* 图表区域 */
  623. .chart-section {
  624. padding: 30rpx;
  625. margin-bottom: 20rpx;
  626. background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 100%);
  627. box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, 0.1);
  628. border-radius: 16rpx;
  629. }
  630. .db-view{
  631. display: flex;
  632. flex-direction: row;
  633. justify-content: flex-start; // 或 space-around
  634. // justify-content: space-around; /* 自动分配间距,避免挤压 */
  635. align-items: center;
  636. padding: 0 20rpx; // 可选:避免贴边
  637. .db-box {
  638. background-color: #fff;
  639. width: 216rpx;
  640. // 删除固定宽高 ↓
  641. // max-width: 300rpx;
  642. // height: 200rpx;
  643. // flex: 1; // ✅ 关键:平均分空间
  644. display: flex;
  645. flex-direction: column; // 垂直排列:图标在上,文字在下
  646. justify-content: center;
  647. align-items: center;
  648. margin: 0 10rpx; // 左右间距(替代原来的 margin-left)
  649. border-radius: 5px;
  650. padding: 30rpx 10rpx; // 可选:增加内边距使内容不拥挤
  651. .db-text {
  652. margin-top: 16rpx; // 图标与文字间距
  653. font-size: 24rpx; // 建议用 rpx,10px 太小了
  654. color: #333;
  655. }
  656. .db-center-1,
  657. .db-center-2,
  658. .db-center-3 {
  659. display: flex;
  660. justify-content: center;
  661. align-items: center;
  662. width: 100rpx;
  663. height: 100rpx;
  664. border-radius: 50rpx;
  665. position: relative;
  666. }
  667. .db-center-1 { background-color: #DBEAFE; }
  668. .db-center-2 { background-color: #DCFCE7; }
  669. .db-center-3 { background-color: #F3E8FF; }
  670. }
  671. .db-image{
  672. width:50rpx;
  673. height:50rpx;
  674. }
  675. }
  676. .badge {
  677. z-index: 999;
  678. position: absolute;
  679. top: 35rpx;
  680. right: 35rpx;
  681. background-color: #ff4d4f;
  682. border-radius: 40rpx;
  683. min-width: 40rpx;
  684. height: 40rpx;
  685. display: flex; // 启用 Flexbox 布局
  686. justify-content: center; // 水平居中
  687. align-items: center; // 垂直居中
  688. box-sizing: border-box; // 确保 padding 不影响整体尺寸
  689. padding: 0 12rpx;
  690. .count {
  691. // line-height: 40rpx;
  692. font-size: 26rpx;
  693. // text-align: center;
  694. color: #ffffff;
  695. }
  696. }
  697. .list-item {
  698. margin: 0 30rpx 24rpx 30rpx;
  699. background-color: #ffffff;
  700. border-radius: 16rpx;
  701. }
  702. .item-container {
  703. padding: 30rpx;
  704. }
  705. .item-header {
  706. flex-direction: row;
  707. align-items: center;
  708. margin-bottom: 16rpx;
  709. .item-title {
  710. flex: 1;
  711. font-size: 32rpx;
  712. color: #333333;
  713. font-weight: bold;
  714. }
  715. .detail-link {
  716. font-size: 28rpx;
  717. color: #999999;
  718. }
  719. }
  720. .btn-primary {
  721. font-size: 14px;
  722. background-color: #165DFF;
  723. color: #ffffff;
  724. }
  725. .info-row {
  726. flex-direction: row;
  727. justify-content: space-between;
  728. align-items: center;
  729. .info-label {
  730. font-size: 26rpx;
  731. color: #666;
  732. }
  733. .info-value {
  734. font-size: 26rpx;
  735. }
  736. }
  737. .text-gray{
  738. font-size: 26rpx;
  739. color: #666;
  740. }
  741. /* 剩余时间颜色样式 */
  742. .time-critical {
  743. color: #ff4d4f; /* 红色 */
  744. }
  745. .time-warning {
  746. color: #fa8c16; /* 橙色 */
  747. }
  748. .time-notice {
  749. color: #faad14; /* 黄色 */
  750. }
  751. .status-tag {
  752. padding: 8rpx 20rpx;
  753. border-radius: 20rpx;
  754. font-size: 24rpx;
  755. white-space: nowrap;
  756. margin-left: 20rpx;
  757. border: 1rpx solid;
  758. }
  759. /* 已超时工单标题红色样式 */
  760. .overdue-title {
  761. margin-top: 16rpx;
  762. font-size: 26rpx;
  763. color: #ff4d4f;
  764. }
  765. /* 待接单 */
  766. .status-assigned {
  767. background-color: #ebf5ff;
  768. color: #409eff;
  769. border-color: #d8ebff;
  770. }
  771. /* 已挂起 */
  772. .status-suspended {
  773. background-color: #fff2f0;
  774. color: #ff4d4f;
  775. border-color: #ffccc7;
  776. }
  777. .empty-tips {
  778. padding: 30rpx;
  779. justify-content: center;
  780. align-items: center;
  781. .empty-text {
  782. font-size: 26rpx;
  783. color: #999999;
  784. }
  785. }
  786. </style>