checkIn.vue 20 KB

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