checkIn.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. <template>
  2. <page-meta root-font-size="system" />
  3. <view class="attendance-page">
  4. <view class="header">
  5. <text class="title">我的考勤记录</text>
  6. <picker mode="selector" :range="timeRanges" @change="onTimeRangeChange">
  7. <view class="picker">
  8. {{ selectedTimeRange }}/切换
  9. </view>
  10. </picker>
  11. </view>
  12. <!-- 今日签到信息区域 -->
  13. <view class="todayCheckIn" v-if="todayInfoShow">
  14. <view class="check-in-container">
  15. <text class="todayAttTitle">今日签到信息</text>
  16. <view class="info-row">
  17. <view>
  18. <text class="ygoa-icon icon-date"></text>
  19. <text class="value">日期:</text>
  20. </view>
  21. <text class="label">{{ todayData.day }}</text>
  22. </view>
  23. <view class="info-row">
  24. <view>
  25. <text class="ygoa-icon icon-day"></text>
  26. <text class="value">晨签时间:</text>
  27. </view>
  28. <text class="label">{{ todayData.startTime || '未打卡' }} </text>
  29. </view>
  30. <view class="info-row">
  31. <view>
  32. <text class="ygoa-icon icon-night"></text>
  33. <text class="value">晚签时间:</text>
  34. </view>
  35. <text class="label">{{ todayData.endTime || '未打卡' }} </text>
  36. </view>
  37. </view>
  38. <!-- 分界线 -->
  39. <view class="divider"></view>
  40. <!-- 打卡记录 -->
  41. <!-- <view class="container">
  42. <view class="header">
  43. <text class="clockRecordTitle">打卡记录</text>
  44. </view>
  45. <view class="content" style="height: 41vh;">
  46. <z-paging :fixed="false" :default-page-size="pSize" default-page-no="1" @query="queryData" ref="paging">
  47. <view class="clockRecord" v-for="clockRecord in clockRecords" :key="clockRecord.date">
  48. <text class="date">{{ clockRecord.date }}</text>
  49. <view class="shifts">
  50. <view class="shift">
  51. <text class="shift-label">晨签:</text>
  52. <text class="shift-time">{{ clockRecord.morning||'没有该记录'}}</text>
  53. </view>
  54. <view class="shift">
  55. <text class="shift-label">晚签:</text>
  56. <text class="shift-time">{{ clockRecord.evening ||'没有该记录'}}</text>
  57. </view>
  58. </view>
  59. </view>
  60. </z-paging>
  61. </view>
  62. </view> -->
  63. <!-- 日历板块 -->
  64. <template>
  65. <view class="calendar-content">
  66. <view>
  67. <uni-calendar class="uni-calendar--hook" :selected="calenderData" :showMonth="true" @change="changeDate"
  68. @monthSwitch="monthSwitch" />
  69. </view>
  70. </view>
  71. </template>
  72. </view>
  73. <!-- 周,月数据统计区域 -->
  74. <view class="statistics" v-if="chartShow">
  75. <view class="statistic-card">
  76. <view class="statistic-title">{{ selectedTimeRange }}考勤统计</view>
  77. <view class="statistic-item">
  78. <view>
  79. <text class="ygoa-icon icon-attendance"></text>
  80. <text class="label">出勤:</text>
  81. </view>
  82. <text class="value">{{ attendanceCount }}</text>
  83. </view>
  84. <view class="statistic-item">
  85. <view>
  86. <text class="ygoa-icon icon-goOut"></text>
  87. <text class="label">外出:</text>
  88. </view>
  89. <text class="value">{{ goOutCount }}</text>
  90. </view>
  91. <view class="statistic-item">
  92. <view>
  93. <text class="ygoa-icon icon-late"></text>
  94. <text class="label">迟到:</text>
  95. </view>
  96. <text class="value">{{ lateCount }}</text>
  97. </view>
  98. <view class="statistic-item">
  99. <view>
  100. <text class="ygoa-icon icon-leaveEarly"></text>
  101. <text class="label">早退:</text>
  102. </view>
  103. <text class="value">{{ leaveEarlyCount }}</text>
  104. </view>
  105. <view class="statistic-item">
  106. <view>
  107. <text class="ygoa-icon icon-absenteeism"></text>
  108. <text class="label">缺勤:</text>
  109. </view>
  110. <text class="value">{{ absenteeismCount }}</text>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 图表区域 -->
  115. <view class="chart-container" v-if="chartShow">
  116. <view class="">
  117. <text class="chart-title">考勤趋势图</text>
  118. <view class="charts-box">
  119. <qiun-data-charts :type="chartsType" :opts="opts" :chartData="chartData" />
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </template>
  125. <script setup lang="ts">
  126. import {ref,onMounted,reactive} from 'vue';
  127. import {checkAttendance,getMyTotalCount,getMyQDQtAttendance} from '@/api/mine.js'
  128. import {useUserStore} from '@/store/user.js';
  129. const userStore = useUserStore();
  130. // 创建一个响应式对象记录今天的考勤数据
  131. const todayData = reactive({
  132. day: '', // 当前日期
  133. startTime: '', // 晨签到时间
  134. endTime: '', // 晚签到时间
  135. })
  136. // 控制今日签到信息和图表显示的状态
  137. const todayInfoShow = ref(true) // 今日签到信息是否显示
  138. const chartShow = ref(false) // 图表是否显示
  139. // 图表类型的响应式引用
  140. const chartsType = ref('')
  141. // 图表要填充的数据
  142. const chartData = ref({})
  143. // 图表配置选项
  144. const opts = ref({
  145. color: ["#EE6666", "#FAC858", "#FC8452", "#73C0DE", "#3CA272", "#1890FF", "#91CB74", "#9A60B4",
  146. "#ea7ccc"
  147. ], // 设定图表颜色
  148. padding: [15, 15, 0, 5],
  149. enableScroll: false, // 禁用滚动
  150. legend: {}, // 图例设置
  151. xAxis: {
  152. disableGrid: true // 禁用网格线
  153. },
  154. yAxis: {
  155. data: [{
  156. min: 0 // y轴最小值
  157. }]
  158. },
  159. extra: {
  160. column: {
  161. type: "group",
  162. width: 30,
  163. activeBgColor: "#000000",
  164. activeBgOpacity: 0.08
  165. }
  166. }
  167. });
  168. // 时间范围选择数组
  169. const timeRanges = ref(['日', '周', '月']);
  170. const selectedTimeRange = ref('日'); // 初始化选择的时间范围为“日”
  171. // 考勤相关统计数据
  172. const attendanceCount = ref(0); // 出勤次数
  173. const goOutCount = ref(0); // 外出次数
  174. const lateCount = ref(0); // 迟到次数
  175. const leaveEarlyCount = ref(0); // 早退次数
  176. const absenteeismCount = ref(0); // 缺勤次数
  177. //用户id
  178. const userId = userStore.user.useId; //拿到用户id
  179. //当前周的周一日期
  180. const thisMondayDate = ref('');
  181. onMounted(() => {
  182. initAttData(); //初始化日考勤数据
  183. });
  184. //初始化考勤数据
  185. function initAttData() {
  186. const nowDate = new Date();
  187. todayData.day = formatDate(nowDate);
  188. getthisMondayDate(nowDate);
  189. getDayAttData();
  190. initCalenderData();
  191. }
  192. //格式化日期
  193. function formatDate(date) {
  194. const year = date.getFullYear(); // 获取年份
  195. const month = date.getMonth() + 1; // 获取月份
  196. const day = date.getDate(); // 获取日期
  197. // 格式化月份和日期为两位数
  198. const formattedMonth = month < 10 ? '0' + month : month;
  199. const formattedDay = day < 10 ? '0' + day : day;
  200. return `${year}-${formattedMonth}-${formattedDay}`;
  201. }
  202. //获取日考勤数据
  203. function getDayAttData() {
  204. const params = {
  205. universalid: userId,
  206. rizi: todayData.day
  207. }
  208. checkAttendance(params).then(res => {
  209. if ("success" == res.returnMsg) {
  210. if (res.returnParams.list.length == 0) {
  211. todayData.startTime = '';
  212. todayData.endTime = ''
  213. return;
  214. }
  215. const attList = res.returnParams.list;
  216. const time1 = attList.find(item => item.att_type_id === '1');
  217. const time2 = attList.filter(item => item.att_type_id === '2').pop();
  218. if (time1 !== undefined) {
  219. todayData.startTime = time1.att_time.split(' ')[1];
  220. todayData.endTime ='';
  221. }
  222. if (time2 !== undefined) {
  223. todayData.endTime = time2.att_time.split(' ')[1];
  224. }
  225. }
  226. })
  227. }
  228. //打卡历史记录(日历版)
  229. //日历表数据
  230. const calenderData = ref([])
  231. // 初始化此月日历数据
  232. function initCalenderData() {
  233. const params = {
  234. type: 2, //设置时间区间
  235. universalid: userId,
  236. ks_att_time: todayData.day.slice(0, 8) + '01',
  237. js_att_time: todayData.day,
  238. pSize: parseInt(todayData.day.slice(8, 10), 10),//当前天数
  239. p: 1
  240. }
  241. getCalenderData(params)
  242. }
  243. //日历数据的刷新
  244. function getCalenderData(params){
  245. getMyQDQtAttendance(params).then(({ returnParams }) => {
  246. //定义一个数组用于接收日历data
  247. const thisCalenderData=[]
  248. returnParams.list.forEach(item => {
  249. if (!item.type.includes('1') || !item.type.includes('2')) {
  250. const calenderDataInfo = {
  251. date: item.att_date.slice(0, 10),
  252. info: '缺卡'
  253. }
  254. thisCalenderData.push(calenderDataInfo)
  255. }
  256. });
  257. calenderData.value=thisCalenderData
  258. })
  259. }
  260. //日历点击日期切换事件
  261. function changeDate(e) {
  262. // console.log('changeDate: ',e);
  263. console.log("3:calenderData.value " + JSON.stringify(calenderData.value));
  264. todayData.day = e.fulldate
  265. getDayAttData()
  266. }
  267. //传入年份月份,返回此月天数
  268. function getDaysInMonth(year, month) {
  269. const date = new Date(year, month - 1, 1);
  270. // 将日期设置为下一个月的第0天,即当前月的最后一天
  271. date.setMonth(date.getMonth() + 1);
  272. date.setDate(0);
  273. // 返回当前月的最后一天的日期,即该月的天数
  274. return date.getDate();
  275. }
  276. //月份切换事件
  277. function monthSwitch(e) {
  278. // console.log('monthSwitch: ', e);
  279. const days=getDaysInMonth(e.year,e.month);
  280. const params = {
  281. type: 2, //设置时间区间
  282. universalid: userId,
  283. ks_att_time: e.year+'-'+e.month+'-' + '01',
  284. js_att_time: e.year+'-'+e.month+'-' +days,
  285. pSize: days,
  286. p: 1
  287. }
  288. getCalenderData(params);
  289. }
  290. // //打卡历史记录(下拉刷新版)
  291. // const paging = ref(null)
  292. // const pSize = ref(5)
  293. // function complete(list, total, pageNo) {
  294. // if (pageNo == 1) {
  295. // paging.value.complete(list);
  296. // return
  297. // }
  298. // // 防止重复获取最后一次信息
  299. // if (pSize.value * pageNo < total) {
  300. // paging.value.complete(list)
  301. // } else {
  302. // paging.value.complete([])
  303. // }
  304. // }
  305. // //日考勤历史记录
  306. // const clockRecords = ref([])
  307. // const totalPage = ref(0)
  308. // //获取日考勤历史(下拉刷新)
  309. // function getDayAttHistory() {
  310. // const params = {
  311. // type: 1, //不设时间区间
  312. // universalid: userId,
  313. // ks_att_time: '',
  314. // js_att_time: '',
  315. // pSize: pSize.value,
  316. // p: 1
  317. // }
  318. // getMyQDQtAttendance(params).then(({ returnParams }) => {
  319. // totalPage.value = Math.ceil(returnParams.total / pSize.value)
  320. // const list = returnParams.list.map(item => {
  321. // return {
  322. // date: item.att_date.substring(0, 10),
  323. // morning: item.time.split(',')[item.type.split(',').indexOf("1")],
  324. // evening: item.time.split(',')[item.type.split(',').indexOf("2")],
  325. // }
  326. // });
  327. // clockRecords.value = list;
  328. // complete(clockRecords.value, returnParams.total, returnParams.current)
  329. // })
  330. // }
  331. // // 刷新
  332. // function queryData(pageNo, pSize, queryType) {
  333. // switch (queryType) {
  334. // case 0: // 下拉刷新
  335. // case 1: // 初始加载
  336. // getDayAttHistory()
  337. // break
  338. // case 3: // 上拉加载
  339. // scrollQuery(pageNo, pSize)
  340. // break
  341. // default: // 默认刷新
  342. // getDayAttHistory()
  343. // break
  344. // }
  345. // }
  346. // //上拉加载事件
  347. // function scrollQuery(pageNo, pSize) {
  348. // const params = {
  349. // type: 1, //不设时间区间
  350. // universalid: userId,
  351. // ks_att_time: '',
  352. // js_att_time: '',
  353. // pSize: pSize,
  354. // p: pageNo
  355. // }
  356. // getMyQDQtAttendance(params).then(({ returnParams }) => {
  357. // const list = returnParams.list.map(item => {
  358. // return {
  359. // date: item.att_date.substring(0, 10),
  360. // morning: item.time.split(',')[item.type.split(',').indexOf("1")],
  361. // evening: item.time.split(',')[item.type.split(',').indexOf("2")],
  362. // }
  363. // });
  364. // if (pageNo <= totalPage.value) {
  365. // clockRecords.value.push(...list);
  366. // }
  367. // complete(list, returnParams.total, pageNo)
  368. // })
  369. // }
  370. // 日周月时间范围切换事件
  371. function onTimeRangeChange(event) {
  372. const selectedIndex = event.detail.value;
  373. selectedTimeRange.value = timeRanges.value[selectedIndex]; // 设置选择的时间范围(日周月)
  374. // 根据选择的时间范围更新展示内容
  375. switch (selectedTimeRange.value) {
  376. case '日':
  377. getDayAttData();
  378. showDay(); // 显示今日考勤
  379. break;
  380. case '周':
  381. chartsType.value = 'pie'; // 设置图表类型为饼图
  382. fetchWeekAttData().then(message => {
  383. console.log(message);
  384. showWeekAndMonth();
  385. updateChart(message);
  386. })
  387. .catch(error => {
  388. console.error(error);
  389. });
  390. break;
  391. case '月':
  392. chartsType.value = 'column'; // 设置图表类型为柱状图
  393. fetchMonthAttData().then(message => {
  394. console.log('message', message);
  395. showWeekAndMonth();
  396. updateChart(message);
  397. })
  398. .catch(error => {
  399. console.error(error);
  400. });
  401. break;
  402. }
  403. };
  404. // 显示今日考勤数据
  405. function showDay() {
  406. todayInfoShow.value = true; // 显示今日签到信息
  407. chartShow.value = false; // 隐藏图表
  408. }
  409. // 显示周或者月考勤
  410. function showWeekAndMonth() {
  411. todayInfoShow.value = false; // 隐藏今日签到信息
  412. chartShow.value = true; // 显示图表
  413. }
  414. //计算本周周一日期
  415. function getthisMondayDate(today) {
  416. const dayOfWeek = today.getDay(); // 0 (周日) 到 6 (周六)
  417. const dayOfMonth = today.getDate();
  418. // 计算本周周一的日期
  419. const offset = dayOfWeek === 0 ? -6 : 1; // 如果今天是周日,则偏移量为-6,否则为1
  420. const thisMonday = new Date(today);
  421. thisMonday.setDate(dayOfMonth - dayOfWeek + offset);
  422. thisMondayDate.value = formatDate(thisMonday);
  423. }
  424. //获取周考勤记录
  425. function fetchWeekAttData() {
  426. return new Promise((resolve, reject) => {
  427. const params = {
  428. staffId: userId,
  429. start_date: thisMondayDate.value,
  430. end_date: todayData.day
  431. }
  432. getMyTotalCount(params).then(res => {
  433. const myWeekAttData = res.returnParams;
  434. const mockData = {
  435. series: [{
  436. data: [
  437. {
  438. "name": "缺勤",
  439. "value": myWeekAttData.type6
  440. },
  441. {
  442. "name": "迟到",
  443. "value": myWeekAttData.type4
  444. },
  445. {
  446. "name": "早退",
  447. "value": myWeekAttData.type5
  448. },
  449. {
  450. "name": "出勤",
  451. "value": myWeekAttData.type0,
  452. "labelText": "出勤:" + myWeekAttData.type0 + "次"
  453. },
  454. {
  455. "name": "外出",
  456. "value": myWeekAttData.type1
  457. },
  458. {
  459. "name": "公休",
  460. "value": myWeekAttData.type2
  461. },
  462. {
  463. "name": "未排班",
  464. "value": myWeekAttData.type3,
  465. }
  466. ]
  467. }],
  468. };
  469. // const weekData = mockData.series[0].data;
  470. attendanceCount.value = myWeekAttData.type1;
  471. goOutCount.value = myWeekAttData.type1;
  472. lateCount.value = myWeekAttData.type4;
  473. leaveEarlyCount.value = myWeekAttData.type5;
  474. absenteeismCount.value = myWeekAttData.type6;
  475. resolve(mockData)
  476. }).catch(error => {
  477. reject(error)
  478. })
  479. })
  480. }
  481. // 获取月考勤记录
  482. function fetchMonthAttData() {
  483. return new Promise((resolve, reject) => {
  484. const weekNodeList = [];// 存储近月每周的周一,周天日期
  485. weekNodeList.unshift(thisMondayDate.value, todayData.day);
  486. while (weekNodeList.length !== 8) {
  487. const weekNode = getOneDaysAgo(weekNodeList[0]);
  488. weekNodeList.unshift(weekNode);
  489. weekNodeList.unshift(getSixDaysAgo(weekNode));
  490. }
  491. const data1 = [];
  492. const data2 = [];
  493. const data3 = [];
  494. const dataFetchPromises = []; // 存储所有数据请求的promise
  495. for (let i = 0; i < weekNodeList.length - 1; i += 2) {
  496. const params = {
  497. staffId: userId,
  498. start_date: weekNodeList[i],
  499. end_date: weekNodeList[i + 1]
  500. };
  501. const fetchPromise = getMyTotalCount(params).then(res => {
  502. // for (const type in res.returnParams) {
  503. // console.log('type', type);
  504. // }
  505. console.log('res.returnParams', res.returnParams);
  506. data1.push(res.returnParams.type6);
  507. data2.push(res.returnParams.type4);
  508. data3.push(res.returnParams.type5);
  509. });
  510. dataFetchPromises.push(fetchPromise);
  511. }
  512. // 等待所有数据请求完成
  513. Promise.all(dataFetchPromises).then(() => {
  514. const params = {
  515. staffId: userId,
  516. start_date: weekNodeList[0],
  517. end_date: weekNodeList[weekNodeList.length - 1]
  518. };
  519. return getMyTotalCount(params);
  520. }).then(res => {
  521. const myMonthAttData = res.returnParams;
  522. attendanceCount.value = myMonthAttData.type0;
  523. goOutCount.value = myMonthAttData.type2;
  524. lateCount.value = myMonthAttData.type4;
  525. leaveEarlyCount.value = myMonthAttData.type5;
  526. absenteeismCount.value = myMonthAttData.type6;
  527. const mockData = {
  528. categories: ["第1周", "第2周", "第3周", "第4周"],
  529. series: [{
  530. name: "缺勤",
  531. data: data1
  532. }, {
  533. name: "迟到",
  534. data: data2
  535. }, {
  536. name: "早退",
  537. data: data3
  538. }]
  539. };
  540. // console.log(data1); // 打印data1检查内容
  541. resolve(mockData);
  542. }).catch(error => {
  543. reject(error);
  544. });
  545. });
  546. }
  547. //获取六天前的日期
  548. function getSixDaysAgo(dateStr) {
  549. const date = new Date(dateStr);
  550. date.setDate(date.getDate() - 6);
  551. return date.toISOString().split('T')[0]; // 返回格式为'YYYY-MM-DD'的字符串
  552. }
  553. //获取一天前的日期
  554. function getOneDaysAgo(dateStr) {
  555. const date = new Date(dateStr);
  556. date.setDate(date.getDate() - 1);
  557. return date.toISOString().split('T')[0]; // 返回格式为'YYYY-MM-DD'的字符串
  558. }
  559. // 更新图表数据
  560. function updateChart(res) {
  561. chartData.value = JSON.parse(JSON.stringify(res)); // 更新图表数据
  562. }
  563. </script>
  564. <style lang="scss" scoped>
  565. // @import "@/static/font/ygoa/iconfont.css";
  566. .ygoa-icon {
  567. margin-right: 0.5rem;
  568. font-size: calc(2rem + 0px) !important;
  569. vertical-align: middle;
  570. /* 确保图标与文本竖直居中 */
  571. }
  572. .attendance-page {
  573. padding: 20px;
  574. background-color: #f9f9f9;
  575. ::v-deep .calendar-content {
  576. margin: -20px;
  577. margin-top: 20px;
  578. .uni-calendar__header {
  579. .uni-calendar__header-text {
  580. font-size: calc(14px + .5*(1rem - 16px)) !important;
  581. }
  582. .uni-calendar__backtoday {
  583. padding: 2px 8px 2px 10px !important;
  584. font-size: calc(0.75rem + 0px) !important;
  585. }
  586. }
  587. .uni-calendar__box {
  588. .uni-calendar__weeks {
  589. .uni-calendar__weeks-day {
  590. .uni-calendar__weeks-day-text {
  591. font-size: calc(14px + .5*(1rem - 16px)) !important;
  592. }
  593. }
  594. .uni-calendar__weeks-item {
  595. .uni-calendar-item__weeks-box-item {
  596. .uni-calendar-item__weeks-box-circle {
  597. width: calc(8px + .5*(1rem - 16px)) !important;
  598. height: calc(8px + .5*(1rem - 16px)) !important;
  599. top: calc(5px - .25*(1rem - 16px)) !important;
  600. right: calc(5px - .25*(1rem - 16px)) !important;
  601. }
  602. .uni-calendar-item__weeks-box-text {
  603. font-size: calc(14px + .5*(1rem - 16px)) !important;
  604. }
  605. .uni-calendar-item__weeks-lunar-text {
  606. font-size: calc(12px + .5*(1rem - 16px)) !important;
  607. }
  608. }
  609. }
  610. }
  611. }
  612. }
  613. }
  614. .header {
  615. display: flex;
  616. justify-content: space-between;
  617. align-items: center;
  618. margin-bottom: 20px;
  619. .clockRecordTitle {
  620. font-size: calc(1.25rem + 0px) !important;
  621. margin: auto;
  622. }
  623. }
  624. .title {
  625. font-size: calc(1.5rem + 0px) !important;
  626. font-weight: bold;
  627. color: #333;
  628. }
  629. .picker {
  630. border: 1px solid #3498db;
  631. border-radius: 5px;
  632. padding: 10px;
  633. background-color: #ecf6fc;
  634. color: #3498db;
  635. }
  636. .statistics {
  637. // display: flex;
  638. justify-content: center;
  639. }
  640. .statistic-card {
  641. background: white;
  642. border-radius: 10px;
  643. padding: 20px;
  644. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  645. /* width: 100%; */
  646. max-width: 600px;
  647. }
  648. .statistic-title {
  649. text-align: center;
  650. font-size: calc(1.25rem + 0px) !important;
  651. font-weight: bold;
  652. color: #333;
  653. }
  654. .statistic-item {
  655. display: flex;
  656. justify-content: space-between;
  657. border-bottom: 1px solid #eee;
  658. padding: 10px 0;
  659. }
  660. .label {
  661. color: #666;
  662. }
  663. .value {
  664. font-size: calc(1.125rem + 0px) !important;
  665. font-weight: bold;
  666. line-height: calc(2rem + 0px) !important;
  667. color: #333;
  668. }
  669. .label {
  670. font-size: calc(1rem + 0px) !important;
  671. line-height: calc(2rem + 0px) !important;
  672. }
  673. .chart-container {
  674. margin-top: 20px;
  675. }
  676. .chart-title {
  677. font-size: calc(1.25rem + 0px) !important;
  678. font-weight: bold;
  679. text-align: center;
  680. margin-bottom: 10px;
  681. color: #333;
  682. }
  683. .charts-box {
  684. width: 100%;
  685. height: 300px;
  686. }
  687. .todayCheckIn {
  688. background-color: #ffffff;
  689. padding: 20px;
  690. margin: auto -20px; //抵消父级padding
  691. box-sizing: border-box;
  692. border-radius: 10px;
  693. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  694. }
  695. .check-in-container {
  696. width: 100%;
  697. height: 100%;
  698. display: flex;
  699. flex-direction: column;
  700. align-items: center;
  701. justify-content: center;
  702. }
  703. .todayAttTitle {
  704. font-size: calc(1.375rem + 0px) !important;
  705. font-weight: bold;
  706. margin-bottom: 20px;
  707. }
  708. .info-row {
  709. width: 100%;
  710. display: flex;
  711. align-items: center;
  712. justify-content: space-between;
  713. margin-bottom: 10px;
  714. }
  715. .icon {
  716. width: 50rpx;
  717. height: 50rpx;
  718. margin-right: 20rpx;
  719. vertical-align: middle;
  720. /* 确保图标与文本竖直居中 */
  721. }
  722. .clockRecord {
  723. margin-bottom: 20px;
  724. padding: 10px;
  725. border: 1px solid #ccc;
  726. border-radius: 8px;
  727. }
  728. .date {
  729. font-size: 16px;
  730. font-weight: bold;
  731. margin-bottom: 5px;
  732. }
  733. .name {
  734. font-size: 14px;
  735. color: #666;
  736. margin-bottom: 10px;
  737. }
  738. .divider {
  739. border-bottom: 5px dashed #ccc; //虚线
  740. margin: 10px 0;
  741. }
  742. .shift-label {
  743. font-size: 14px;
  744. color: #333;
  745. }
  746. .shift-time {
  747. font-size: 14px;
  748. color: #333;
  749. }
  750. </style>