checkIn.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  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,getMyTotalMonthCount} 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. // scrollShow: true,
  154. },
  155. yAxis: {
  156. data: [{
  157. min: 0 // y轴最小值
  158. }]
  159. },
  160. extra: {
  161. column: {
  162. type: "group",
  163. width: 30,
  164. activeBgColor: "#000000",
  165. activeBgOpacity: 0.08
  166. }
  167. }
  168. });
  169. // 时间范围选择数组
  170. const timeRanges = ref(['日', '周', '月']);
  171. const selectedTimeRange = ref('日'); // 初始化选择的时间范围为“日”
  172. // 考勤相关统计数据
  173. const attendanceCount = ref(0); // 出勤次数
  174. const goOutCount = ref(0); // 外出次数
  175. const lateCount = ref(0); // 迟到次数
  176. const leaveEarlyCount = ref(0); // 早退次数
  177. const absenteeismCount = ref(0); // 缺勤次数
  178. //用户id
  179. const userId = userStore.user.useId; //拿到用户id
  180. //当前周的周一日期
  181. const thisMondayDate = ref('');
  182. onMounted(() => {
  183. initAttData(); //初始化日考勤数据
  184. });
  185. //初始化考勤数据
  186. function initAttData() {
  187. const nowDate = new Date();
  188. todayData.day = formatDate(nowDate);
  189. getthisMondayDate(nowDate);
  190. getDayAttData();
  191. initCalenderData();
  192. }
  193. //格式化日期
  194. function formatDate(date) {
  195. const year = date.getFullYear(); // 获取年份
  196. const month = date.getMonth() + 1; // 获取月份
  197. const day = date.getDate(); // 获取日期
  198. // 格式化月份和日期为两位数
  199. const formattedMonth = month < 10 ? '0' + month : month;
  200. const formattedDay = day < 10 ? '0' + day : day;
  201. return `${year}-${formattedMonth}-${formattedDay}`;
  202. }
  203. //获取日考勤数据
  204. function getDayAttData() {
  205. const params = {
  206. universalid: userId,
  207. rizi: todayData.day
  208. }
  209. checkAttendance(params).then(res => {
  210. if ("success" == res.returnMsg) {
  211. //数据初始化
  212. todayData.startTime = '';
  213. todayData.endTime = '';
  214. if (res.returnParams.list.length == 0) {
  215. return
  216. }
  217. const attList = res.returnParams.list;
  218. let time1;
  219. let time2;
  220. const filteredRecord1 = attList.filter(item => item.att_type_id === '1');
  221. if (filteredRecord1.length > 0) {
  222. time1 = filteredRecord1.reduce((latest, current) => {
  223. const latestTime = new Date(latest.att_time);
  224. const currentTime = new Date(current.att_time);
  225. return (currentTime < latestTime) ? current : latest;
  226. });
  227. }
  228. //拿到所有签退数据后,取最大时间的那个
  229. const filteredRecord2 = attList.filter(item => item.att_type_id === '2');
  230. if (filteredRecord2.length > 0) {
  231. time2 = filteredRecord2.reduce((latest, current) => {
  232. const latestTime = new Date(latest.att_time);
  233. const currentTime = new Date(current.att_time);
  234. return (currentTime > latestTime) ? current : latest;
  235. });
  236. }
  237. if (time1 !== undefined) {
  238. todayData.startTime = time1.att_time.split(' ')[1];
  239. }
  240. if (time2 !== undefined) {
  241. todayData.endTime = time2.att_time.split(' ')[1];
  242. }
  243. }
  244. })
  245. }
  246. //打卡历史记录(日历版)
  247. //日历表数据
  248. const calenderData = ref([])
  249. // 初始化此月日历数据
  250. function initCalenderData() {
  251. const params = {
  252. type: 2, //设置时间区间
  253. universalid: userId,
  254. ks_att_time: todayData.day.slice(0, 8) + '01',
  255. js_att_time: todayData.day,
  256. pSize: parseInt(todayData.day.slice(8, 10), 10),//当前天数
  257. p: 1
  258. }
  259. getCalenderData(params)
  260. }
  261. //日历数据的刷新
  262. function getCalenderData(params){
  263. getMyQDQtAttendance(params).then(({ returnParams }) => {
  264. //定义一个数组用于接收日历data
  265. const thisCalenderData=[]
  266. returnParams.list.forEach(item => {
  267. if ((!item.type.includes('1') || !item.type.includes('2'))&&item.att_date.slice(0, 10)!==todayData.day) {
  268. const calenderDataInfo = {
  269. date: item.att_date.slice(0, 10),
  270. info: '缺卡'
  271. }
  272. thisCalenderData.push(calenderDataInfo)
  273. }
  274. });
  275. calenderData.value=thisCalenderData
  276. })
  277. }
  278. //日历点击日期切换事件
  279. function changeDate(e) {
  280. // console.log('changeDate: ',e);
  281. console.log("3:calenderData.value " + JSON.stringify(calenderData.value));
  282. todayData.day = e.fulldate
  283. getDayAttData()
  284. }
  285. //传入年份月份,返回此月天数
  286. function getDaysInMonth(year, month) {
  287. const date = new Date(year, month - 1, 1);
  288. // 将日期设置为下一个月的第0天,即当前月的最后一天
  289. date.setMonth(date.getMonth() + 1);
  290. date.setDate(0);
  291. // 返回当前月的最后一天的日期,即该月的天数
  292. return date.getDate();
  293. }
  294. //月份切换事件
  295. function monthSwitch(e) {
  296. // console.log('monthSwitch: ', e);
  297. const days=getDaysInMonth(e.year,e.month);
  298. const params = {
  299. type: 2, //设置时间区间
  300. universalid: userId,
  301. ks_att_time: e.year+'-'+e.month+'-' + '01',
  302. js_att_time: e.year+'-'+e.month+'-' +days,
  303. pSize: days,
  304. p: 1
  305. }
  306. getCalenderData(params);
  307. }
  308. // //打卡历史记录(下拉刷新版)
  309. // const paging = ref(null)
  310. // const pSize = ref(5)
  311. // function complete(list, total, pageNo) {
  312. // if (pageNo == 1) {
  313. // paging.value.complete(list);
  314. // return
  315. // }
  316. // // 防止重复获取最后一次信息
  317. // if (pSize.value * pageNo < total) {
  318. // paging.value.complete(list)
  319. // } else {
  320. // paging.value.complete([])
  321. // }
  322. // }
  323. // //日考勤历史记录
  324. // const clockRecords = ref([])
  325. // const totalPage = ref(0)
  326. // //获取日考勤历史(下拉刷新)
  327. // function getDayAttHistory() {
  328. // const params = {
  329. // type: 1, //不设时间区间
  330. // universalid: userId,
  331. // ks_att_time: '',
  332. // js_att_time: '',
  333. // pSize: pSize.value,
  334. // p: 1
  335. // }
  336. // getMyQDQtAttendance(params).then(({ returnParams }) => {
  337. // totalPage.value = Math.ceil(returnParams.total / pSize.value)
  338. // const list = returnParams.list.map(item => {
  339. // return {
  340. // date: item.att_date.substring(0, 10),
  341. // morning: item.time.split(',')[item.type.split(',').indexOf("1")],
  342. // evening: item.time.split(',')[item.type.split(',').indexOf("2")],
  343. // }
  344. // });
  345. // clockRecords.value = list;
  346. // complete(clockRecords.value, returnParams.total, returnParams.current)
  347. // })
  348. // }
  349. // // 刷新
  350. // function queryData(pageNo, pSize, queryType) {
  351. // switch (queryType) {
  352. // case 0: // 下拉刷新
  353. // case 1: // 初始加载
  354. // getDayAttHistory()
  355. // break
  356. // case 3: // 上拉加载
  357. // scrollQuery(pageNo, pSize)
  358. // break
  359. // default: // 默认刷新
  360. // getDayAttHistory()
  361. // break
  362. // }
  363. // }
  364. // //上拉加载事件
  365. // function scrollQuery(pageNo, pSize) {
  366. // const params = {
  367. // type: 1, //不设时间区间
  368. // universalid: userId,
  369. // ks_att_time: '',
  370. // js_att_time: '',
  371. // pSize: pSize,
  372. // p: pageNo
  373. // }
  374. // getMyQDQtAttendance(params).then(({ returnParams }) => {
  375. // const list = returnParams.list.map(item => {
  376. // return {
  377. // date: item.att_date.substring(0, 10),
  378. // morning: item.time.split(',')[item.type.split(',').indexOf("1")],
  379. // evening: item.time.split(',')[item.type.split(',').indexOf("2")],
  380. // }
  381. // });
  382. // if (pageNo <= totalPage.value) {
  383. // clockRecords.value.push(...list);
  384. // }
  385. // complete(list, returnParams.total, pageNo)
  386. // })
  387. // }
  388. // 日周月时间范围切换事件
  389. function onTimeRangeChange(event) {
  390. const selectedIndex = event.detail.value;
  391. selectedTimeRange.value = timeRanges.value[selectedIndex]; // 设置选择的时间范围(日周月)
  392. // 根据选择的时间范围更新展示内容
  393. switch (selectedTimeRange.value) {
  394. case '日':
  395. getDayAttData();
  396. showDay(); // 显示今日考勤
  397. break;
  398. case '周':
  399. chartsType.value = 'pie'; // 设置图表类型为饼图
  400. fetchWeekAttData().then(message => {
  401. // console.log(message);
  402. showWeekAndMonth();
  403. updateChart(message);
  404. })
  405. .catch(error => {
  406. console.error(error);
  407. });
  408. break;
  409. case '月':
  410. chartsType.value = 'column'; // 设置图表类型为柱状图
  411. fetchMonthAttData();
  412. showWeekAndMonth();
  413. // fetchMonthAttData().then(message => {
  414. // console.log('message', message);
  415. // showWeekAndMonth();
  416. // updateChart(message);
  417. // })
  418. // .catch(error => {
  419. // console.error(error);
  420. // });
  421. break;
  422. }
  423. };
  424. // 显示今日考勤数据
  425. function showDay() {
  426. todayInfoShow.value = true; // 显示今日签到信息
  427. chartShow.value = false; // 隐藏图表
  428. }
  429. // 显示周或者月考勤
  430. function showWeekAndMonth() {
  431. todayInfoShow.value = false; // 隐藏今日签到信息
  432. chartShow.value = true; // 显示图表
  433. }
  434. //计算本周周一日期
  435. function getthisMondayDate(today) {
  436. const dayOfWeek = today.getDay(); // 0 (周日) 到 6 (周六)
  437. const dayOfMonth = today.getDate();
  438. // 计算本周周一的日期
  439. const offset = dayOfWeek === 0 ? -6 : 1; // 如果今天是周日,则偏移量为-6,否则为1
  440. const thisMonday = new Date(today);
  441. thisMonday.setDate(dayOfMonth - dayOfWeek + offset);
  442. thisMondayDate.value = formatDate(thisMonday);
  443. }
  444. //获取周考勤记录
  445. function fetchWeekAttData() {
  446. return new Promise((resolve, reject) => {
  447. const params = {
  448. staffId: userId,
  449. start_date: thisMondayDate.value,
  450. end_date: todayData.day
  451. }
  452. getMyTotalCount(params).then(res => {
  453. const myWeekAttData = res.returnParams;
  454. const mockData = {
  455. series: [{
  456. data: [
  457. {
  458. "name": "缺勤",
  459. "value": myWeekAttData.type6,
  460. "labelText": "缺勤:" + myWeekAttData.type6 + "次"
  461. },
  462. {
  463. "name": "迟到",
  464. "value": myWeekAttData.type4,
  465. "labelText": "迟到:" + myWeekAttData.type4 + "次"
  466. },
  467. {
  468. "name": "早退",
  469. "value": myWeekAttData.type5,
  470. "labelText": "早退:" + myWeekAttData.type5 + "次"
  471. },
  472. {
  473. "name": "出勤",
  474. "value": myWeekAttData.attDays,
  475. "labelText": "出勤:" + myWeekAttData.attDays + "次"
  476. },
  477. {
  478. "name": "外出",
  479. "value": myWeekAttData.type2,
  480. "labelText": "外出:" + myWeekAttData.type2 + "次"
  481. },
  482. {
  483. "name": "公休",
  484. "value": myWeekAttData.type1,
  485. "labelText": "公休:" + myWeekAttData.type1 + "次"
  486. },
  487. // {
  488. // "name": "未排班",
  489. // "value": myWeekAttData.type3,
  490. // "labelText": "未排班:" + myWeekAttData.type3 + "次"
  491. // }
  492. ]
  493. }],
  494. };
  495. // const weekData = mockData.series[0].data;
  496. attendanceCount.value = myWeekAttData.attDays;
  497. goOutCount.value = myWeekAttData.type2;
  498. lateCount.value = myWeekAttData.type4;
  499. leaveEarlyCount.value = myWeekAttData.type5;
  500. absenteeismCount.value = myWeekAttData.type6;
  501. resolve(mockData)
  502. }).catch(error => {
  503. reject(error)
  504. })
  505. })
  506. }
  507. // 获取月考勤记录
  508. function fetchMonthAttData() {
  509. //数据初始化
  510. attendanceCount.value = 0;
  511. goOutCount.value = 0;
  512. lateCount.value = 0;
  513. leaveEarlyCount.value = 0;
  514. absenteeismCount.value = 0;
  515. const params = {
  516. staffId: userId,
  517. now_date: todayData.day
  518. }
  519. getMyTotalMonthCount(params).then(res=>{
  520. const myMonthAttData = res.returnParams;
  521. let data1 = []; // 收集 type6 的值
  522. let data2 = []; // 收集 type4 的值
  523. let data3 = []; // 收集 type5 的值
  524. // console.log('attendanceCount: ',attendanceCount.value);
  525. // 遍历 myMonthAttData 并收集指定类型的值
  526. myMonthAttData.forEach(item => {
  527. data1.push(item.type6);
  528. data2.push(item.type4);
  529. data3.push(item.type5);
  530. attendanceCount.value += item.attDays;
  531. goOutCount.value += item.type2;
  532. lateCount.value += item.type4;
  533. leaveEarlyCount.value += item.type5;
  534. absenteeismCount.value += item.type6;
  535. });
  536. // 定义一个常量数组生成器
  537. const generateWeekArray = n => Array.from({ length: n }, (_, i) => `第${i + 1}周`);
  538. let categoriesArr=generateWeekArray(myMonthAttData.length)
  539. // console.log(categoriesArr);
  540. const mockData = {
  541. categories:  categoriesArr,
  542. series: [{
  543. name: "缺勤",
  544. data: data1
  545. }, {
  546. name: "迟到",
  547. data: data2
  548. }, {
  549. name: "早退",
  550. data: data3
  551. }]
  552. };
  553. updateChart(mockData)
  554. })
  555. }
  556. // //获取六天前的日期
  557. // function getSixDaysAgo(dateStr) {
  558. // const date = new Date(dateStr);
  559. // date.setDate(date.getDate() - 6);
  560. // return date.toISOString().split('T')[0]; // 返回格式为'YYYY-MM-DD'的字符串
  561. // }
  562. // //获取一天前的日期
  563. // function getOneDaysAgo(dateStr) {
  564. // const date = new Date(dateStr);
  565. // date.setDate(date.getDate() - 1);
  566. // return date.toISOString().split('T')[0]; // 返回格式为'YYYY-MM-DD'的字符串
  567. // }
  568. // 更新图表数据
  569. function updateChart(res) {
  570. chartData.value = JSON.parse(JSON.stringify(res)); // 更新图表数据
  571. }
  572. </script>
  573. <style lang="scss" scoped>
  574. // @import "@/static/font/ygoa/iconfont.css";
  575. .ygoa-icon {
  576. margin-right: 0.5rem;
  577. font-size: calc(2rem + 0px) !important;
  578. vertical-align: middle;
  579. /* 确保图标与文本竖直居中 */
  580. }
  581. .attendance-page {
  582. padding: 20px;
  583. background-color: #f9f9f9;
  584. ::v-deep .calendar-content {
  585. margin: -20px;
  586. margin-top: 20px;
  587. .uni-calendar__header {
  588. .uni-calendar__header-text {
  589. font-size: calc(14px + .5*(1rem - 16px)) !important;
  590. }
  591. .uni-calendar__backtoday {
  592. padding: 2px 8px 2px 10px !important;
  593. font-size: calc(0.75rem + 0px) !important;
  594. }
  595. }
  596. .uni-calendar__box {
  597. .uni-calendar__weeks {
  598. .uni-calendar__weeks-day {
  599. .uni-calendar__weeks-day-text {
  600. font-size: calc(14px + .5*(1rem - 16px)) !important;
  601. }
  602. }
  603. .uni-calendar__weeks-item {
  604. .uni-calendar-item__weeks-box-item {
  605. .uni-calendar-item__weeks-box-circle {
  606. width: calc(8px + .5*(1rem - 16px)) !important;
  607. height: calc(8px + .5*(1rem - 16px)) !important;
  608. top: calc(5px - .25*(1rem - 16px)) !important;
  609. right: calc(5px - .25*(1rem - 16px)) !important;
  610. }
  611. .uni-calendar-item__weeks-box-text {
  612. font-size: calc(14px + .5*(1rem - 16px)) !important;
  613. }
  614. .uni-calendar-item__weeks-lunar-text {
  615. font-size: calc(12px + .5*(1rem - 16px)) !important;
  616. }
  617. }
  618. }
  619. }
  620. }
  621. }
  622. }
  623. .header {
  624. display: flex;
  625. justify-content: space-between;
  626. align-items: center;
  627. margin-bottom: 20px;
  628. .clockRecordTitle {
  629. font-size: calc(1.25rem + 0px) !important;
  630. margin: auto;
  631. }
  632. }
  633. .title {
  634. font-size: calc(1.5rem + 0px) !important;
  635. font-weight: bold;
  636. color: #333;
  637. }
  638. .picker {
  639. border: 1px solid #3498db;
  640. border-radius: 5px;
  641. padding: 10px;
  642. background-color: #ecf6fc;
  643. color: #3498db;
  644. }
  645. .statistics {
  646. // display: flex;
  647. justify-content: center;
  648. }
  649. .statistic-card {
  650. background: white;
  651. border-radius: 10px;
  652. padding: 20px;
  653. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  654. /* width: 100%; */
  655. max-width: 600px;
  656. }
  657. .statistic-title {
  658. text-align: center;
  659. font-size: calc(1.25rem + 0px) !important;
  660. font-weight: bold;
  661. color: #333;
  662. }
  663. .statistic-item {
  664. display: flex;
  665. justify-content: space-between;
  666. border-bottom: 1px solid #eee;
  667. padding: 10px 0;
  668. }
  669. .label {
  670. color: #666;
  671. }
  672. .value {
  673. font-size: calc(1.125rem + 0px) !important;
  674. font-weight: bold;
  675. line-height: calc(2rem + 0px) !important;
  676. color: #333;
  677. }
  678. .label {
  679. font-size: calc(1rem + 0px) !important;
  680. line-height: calc(2rem + 0px) !important;
  681. }
  682. .chart-container {
  683. margin-top: 20px;
  684. }
  685. .chart-title {
  686. font-size: calc(1.25rem + 0px) !important;
  687. font-weight: bold;
  688. text-align: center;
  689. margin-bottom: 10px;
  690. color: #333;
  691. }
  692. .charts-box {
  693. width: 100%;
  694. height: 300px;
  695. }
  696. .todayCheckIn {
  697. background-color: #ffffff;
  698. padding: 20px;
  699. margin: auto -20px; //抵消父级padding
  700. box-sizing: border-box;
  701. border-radius: 10px;
  702. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  703. }
  704. .check-in-container {
  705. width: 100%;
  706. height: 100%;
  707. display: flex;
  708. flex-direction: column;
  709. align-items: center;
  710. justify-content: center;
  711. }
  712. .todayAttTitle {
  713. font-size: calc(1.375rem + 0px) !important;
  714. font-weight: bold;
  715. margin-bottom: 20px;
  716. }
  717. .info-row {
  718. width: 100%;
  719. display: flex;
  720. align-items: center;
  721. justify-content: space-between;
  722. margin-bottom: 10px;
  723. }
  724. .icon {
  725. width: 50rpx;
  726. height: 50rpx;
  727. margin-right: 20rpx;
  728. vertical-align: middle;
  729. /* 确保图标与文本竖直居中 */
  730. }
  731. .clockRecord {
  732. margin-bottom: 20px;
  733. padding: 10px;
  734. border: 1px solid #ccc;
  735. border-radius: 8px;
  736. }
  737. .date {
  738. font-size: 16px;
  739. font-weight: bold;
  740. margin-bottom: 5px;
  741. }
  742. .name {
  743. font-size: 14px;
  744. color: #666;
  745. margin-bottom: 10px;
  746. }
  747. .divider {
  748. border-bottom: 5px dashed #ccc; //虚线
  749. margin: 10px 0;
  750. }
  751. .shift-label {
  752. font-size: 14px;
  753. color: #333;
  754. }
  755. .shift-time {
  756. font-size: 14px;
  757. color: #333;
  758. }
  759. </style>