uniapp uni-calendar日历实现考勤统计功能

根据日历组件代码结构 构成相应结构的状态统计数据 list 再遍历到每日的子组件中

javascript 复制代码
<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
	<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar"
		:selected="selected" :state="list[weeks.date]" :lunar="lunar" :checkHover="range" @change="choiceDate"
		@handleMouse="handleMouse">
	</calendar-item>
</view>


根据每日的状态字段完成样式的判断,展示状态

javascript 复制代码
view style="display: flex;" v-if="state.clockInState && !weeks.disable">
	<view :style="[{'width': '6px'},{'height': '6px'},{'background-color': state.clockInState === 1 ? 'rgba(25,190,107,1)' : '#F0B230'},{'border-radius': '5px'}]"></view>
	<view :style="[{'width': '6px'},{'height': '6px'},{'background-color': state.clockOutState === 1 ?'rgba(25,190,107,1)' : '#F0B230'},{'border-radius': '5px'},{'margin-left': '5px'}]"></view>
</view>
相关推荐
y***86691 小时前
TypeScript在Electron应用中的使用
javascript·typescript·electron
zy happy3 小时前
若依 vue3 报错:找不到模块“@/api/xxxx/xxxxx”或其相应的类型声明。。Vue 3 can not find mod
前端·javascript·vue.js
tobebetter95273 小时前
How to manage python versions on windows
开发语言·windows·python
meichaoWen4 小时前
【Vue3】vue3的全面学习(一)
前端·javascript·学习
9***P3344 小时前
PHP代码覆盖率
开发语言·php·代码覆盖率
CoderYanger4 小时前
优选算法-栈:67.基本计算器Ⅱ
java·开发语言·算法·leetcode·职场和发展·1024程序员节
jllllyuz4 小时前
Matlab实现基于Matrix Pencil算法实现声源信号角度和时间估计
开发语言·算法·matlab
多多*5 小时前
Java复习 操作系统原理 计算机网络相关 2025年11月23日
java·开发语言·网络·算法·spring·microsoft·maven
p***43485 小时前
Rust网络编程模型
开发语言·网络·rust
ᐇ9595 小时前
Java集合框架深度实战:构建智能教育管理与娱乐系统
java·开发语言·娱乐