checkIn.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  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. //数据初始化
  211. todayData.startTime = '';
  212. todayData.endTime = '';
  213. if (res.returnParams.list.length == 0) {
  214. return
  215. }
  216. const attList = res.returnParams.list;
  217. const time1 = attList.find(item => item.att_type_id === '1');
  218. const time2 = attList.filter(item => item.att_type_id === '2').pop();
  219. if (time1 !== undefined) {
  220. todayData.startTime = time1.att_time.split(' ')[1];
  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'))&&item.att_date.slice(0, 10)!==todayData.day) {
  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. "labelText": "缺勤:" + myWeekAttData.type6 + "次"
  441. },
  442. {
  443. "name": "迟到",
  444. "value": myWeekAttData.type4,
  445. "labelText": "迟到:" + myWeekAttData.type4 + "次"
  446. },
  447. {
  448. "name": "早退",
  449. "value": myWeekAttData.type5,
  450. "labelText": "迟到:" + myWeekAttData.type5 + "次"
  451. },
  452. {
  453. "name": "出勤",
  454. "value": myWeekAttData.type0,
  455. "labelText": "出勤:" + myWeekAttData.type0 + "次"
  456. },
  457. {
  458. "name": "外出",
  459. "value": myWeekAttData.type1,
  460. "labelText": "外出:" + myWeekAttData.type1 + "次"
  461. },
  462. {
  463. "name": "公休",
  464. "value": myWeekAttData.type2,
  465. "labelText": "公休:" + myWeekAttData.type2 + "次"
  466. },
  467. {
  468. "name": "未排班",
  469. "value": myWeekAttData.type3,
  470. "labelText": "未排班:" + myWeekAttData.type3 + "次"
  471. }
  472. ]
  473. }],
  474. };
  475. // const weekData = mockData.series[0].data;
  476. attendanceCount.value = myWeekAttData.type1;
  477. goOutCount.value = myWeekAttData.type1;
  478. lateCount.value = myWeekAttData.type4;
  479. leaveEarlyCount.value = myWeekAttData.type5;
  480. absenteeismCount.value = myWeekAttData.type6;
  481. resolve(mockData)
  482. }).catch(error => {
  483. reject(error)
  484. })
  485. })
  486. }
  487. // 获取月考勤记录
  488. function fetchMonthAttData() {
  489. return new Promise((resolve, reject) => {
  490. const weekNodeList = [];// 存储近月每周的周一,周天日期
  491. weekNodeList.unshift(thisMondayDate.value, todayData.day);
  492. while (weekNodeList.length !== 8) {
  493. const weekNode = getOneDaysAgo(weekNodeList[0]);
  494. weekNodeList.unshift(weekNode);
  495. weekNodeList.unshift(getSixDaysAgo(weekNode));
  496. }
  497. const data1 = [];
  498. const data2 = [];
  499. const data3 = [];
  500. const dataFetchPromises = []; // 存储所有数据请求的promise
  501. for (let i = 0; i < weekNodeList.length - 1; i += 2) {
  502. const params = {
  503. staffId: userId,
  504. start_date: weekNodeList[i],
  505. end_date: weekNodeList[i + 1]
  506. };
  507. const fetchPromise = getMyTotalCount(params).then(res => {
  508. // for (const type in res.returnParams) {
  509. // console.log('type', type);
  510. // }
  511. console.log('res.returnParams', res.returnParams);
  512. data1.push(res.returnParams.type6);
  513. data2.push(res.returnParams.type4);
  514. data3.push(res.returnParams.type5);
  515. });
  516. dataFetchPromises.push(fetchPromise);
  517. }
  518. // 等待所有数据请求完成
  519. Promise.all(dataFetchPromises).then(() => {
  520. const params = {
  521. staffId: userId,
  522. start_date: weekNodeList[0],
  523. end_date: weekNodeList[weekNodeList.length - 1]
  524. };
  525. return getMyTotalCount(params);
  526. }).then(res => {
  527. const myMonthAttData = res.returnParams;
  528. attendanceCount.value = myMonthAttData.type0;
  529. goOutCount.value = myMonthAttData.type2;
  530. lateCount.value = myMonthAttData.type4;
  531. leaveEarlyCount.value = myMonthAttData.type5;
  532. absenteeismCount.value = myMonthAttData.type6;
  533. const mockData = {
  534. categories: ["第1周", "第2周", "第3周", "第4周"],
  535. series: [{
  536. name: "缺勤",
  537. data: data1
  538. }, {
  539. name: "迟到",
  540. data: data2
  541. }, {
  542. name: "早退",
  543. data: data3
  544. }]
  545. };
  546. // console.log(data1); // 打印data1检查内容
  547. resolve(mockData);
  548. }).catch(error => {
  549. reject(error);
  550. });
  551. });
  552. }
  553. //获取六天前的日期
  554. function getSixDaysAgo(dateStr) {
  555. const date = new Date(dateStr);
  556. date.setDate(date.getDate() - 6);
  557. return date.toISOString().split('T')[0]; // 返回格式为'YYYY-MM-DD'的字符串
  558. }
  559. //获取一天前的日期
  560. function getOneDaysAgo(dateStr) {
  561. const date = new Date(dateStr);
  562. date.setDate(date.getDate() - 1);
  563. return date.toISOString().split('T')[0]; // 返回格式为'YYYY-MM-DD'的字符串
  564. }
  565. // 更新图表数据
  566. function updateChart(res) {
  567. chartData.value = JSON.parse(JSON.stringify(res)); // 更新图表数据
  568. }
  569. </script>
  570. <style lang="scss" scoped>
  571. // @import "@/static/font/ygoa/iconfont.css";
  572. .ygoa-icon {
  573. margin-right: 0.5rem;
  574. font-size: calc(2rem + 0px) !important;
  575. vertical-align: middle;
  576. /* 确保图标与文本竖直居中 */
  577. }
  578. .attendance-page {
  579. padding: 20px;
  580. background-color: #f9f9f9;
  581. ::v-deep .calendar-content {
  582. margin: -20px;
  583. margin-top: 20px;
  584. .uni-calendar__header {
  585. .uni-calendar__header-text {
  586. font-size: calc(14px + .5*(1rem - 16px)) !important;
  587. }
  588. .uni-calendar__backtoday {
  589. padding: 2px 8px 2px 10px !important;
  590. font-size: calc(0.75rem + 0px) !important;
  591. }
  592. }
  593. .uni-calendar__box {
  594. .uni-calendar__weeks {
  595. .uni-calendar__weeks-day {
  596. .uni-calendar__weeks-day-text {
  597. font-size: calc(14px + .5*(1rem - 16px)) !important;
  598. }
  599. }
  600. .uni-calendar__weeks-item {
  601. .uni-calendar-item__weeks-box-item {
  602. .uni-calendar-item__weeks-box-circle {
  603. width: calc(8px + .5*(1rem - 16px)) !important;
  604. height: calc(8px + .5*(1rem - 16px)) !important;
  605. top: calc(5px - .25*(1rem - 16px)) !important;
  606. right: calc(5px - .25*(1rem - 16px)) !important;
  607. }
  608. .uni-calendar-item__weeks-box-text {
  609. font-size: calc(14px + .5*(1rem - 16px)) !important;
  610. }
  611. .uni-calendar-item__weeks-lunar-text {
  612. font-size: calc(12px + .5*(1rem - 16px)) !important;
  613. }
  614. }
  615. }
  616. }
  617. }
  618. }
  619. }
  620. .header {
  621. display: flex;
  622. justify-content: space-between;
  623. align-items: center;
  624. margin-bottom: 20px;
  625. .clockRecordTitle {
  626. font-size: calc(1.25rem + 0px) !important;
  627. margin: auto;
  628. }
  629. }
  630. .title {
  631. font-size: calc(1.5rem + 0px) !important;
  632. font-weight: bold;
  633. color: #333;
  634. }
  635. .picker {
  636. border: 1px solid #3498db;
  637. border-radius: 5px;
  638. padding: 10px;
  639. background-color: #ecf6fc;
  640. color: #3498db;
  641. }
  642. .statistics {
  643. // display: flex;
  644. justify-content: center;
  645. }
  646. .statistic-card {
  647. background: white;
  648. border-radius: 10px;
  649. padding: 20px;
  650. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  651. /* width: 100%; */
  652. max-width: 600px;
  653. }
  654. .statistic-title {
  655. text-align: center;
  656. font-size: calc(1.25rem + 0px) !important;
  657. font-weight: bold;
  658. color: #333;
  659. }
  660. .statistic-item {
  661. display: flex;
  662. justify-content: space-between;
  663. border-bottom: 1px solid #eee;
  664. padding: 10px 0;
  665. }
  666. .label {
  667. color: #666;
  668. }
  669. .value {
  670. font-size: calc(1.125rem + 0px) !important;
  671. font-weight: bold;
  672. line-height: calc(2rem + 0px) !important;
  673. color: #333;
  674. }
  675. .label {
  676. font-size: calc(1rem + 0px) !important;
  677. line-height: calc(2rem + 0px) !important;
  678. }
  679. .chart-container {
  680. margin-top: 20px;
  681. }
  682. .chart-title {
  683. font-size: calc(1.25rem + 0px) !important;
  684. font-weight: bold;
  685. text-align: center;
  686. margin-bottom: 10px;
  687. color: #333;
  688. }
  689. .charts-box {
  690. width: 100%;
  691. height: 300px;
  692. }
  693. .todayCheckIn {
  694. background-color: #ffffff;
  695. padding: 20px;
  696. margin: auto -20px; //抵消父级padding
  697. box-sizing: border-box;
  698. border-radius: 10px;
  699. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  700. }
  701. .check-in-container {
  702. width: 100%;
  703. height: 100%;
  704. display: flex;
  705. flex-direction: column;
  706. align-items: center;
  707. justify-content: center;
  708. }
  709. .todayAttTitle {
  710. font-size: calc(1.375rem + 0px) !important;
  711. font-weight: bold;
  712. margin-bottom: 20px;
  713. }
  714. .info-row {
  715. width: 100%;
  716. display: flex;
  717. align-items: center;
  718. justify-content: space-between;
  719. margin-bottom: 10px;
  720. }
  721. .icon {
  722. width: 50rpx;
  723. height: 50rpx;
  724. margin-right: 20rpx;
  725. vertical-align: middle;
  726. /* 确保图标与文本竖直居中 */
  727. }
  728. .clockRecord {
  729. margin-bottom: 20px;
  730. padding: 10px;
  731. border: 1px solid #ccc;
  732. border-radius: 8px;
  733. }
  734. .date {
  735. font-size: 16px;
  736. font-weight: bold;
  737. margin-bottom: 5px;
  738. }
  739. .name {
  740. font-size: 14px;
  741. color: #666;
  742. margin-bottom: 10px;
  743. }
  744. .divider {
  745. border-bottom: 5px dashed #ccc; //虚线
  746. margin: 10px 0;
  747. }
  748. .shift-label {
  749. font-size: 14px;
  750. color: #333;
  751. }
  752. .shift-time {
  753. font-size: 14px;
  754. color: #333;
  755. }
  756. </style>