index.uvue 25 KB

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