feat: 1.星寓考勤模块--考勤设备设置

This commit is contained in:
米子豪 2025-01-10 10:48:59 +08:00
parent 02c4636a42
commit da0ec92b78
6 changed files with 159 additions and 40 deletions

View File

@ -36,4 +36,13 @@
height: 100%;
vertical-align: middle;
}
.uni-scroll-view-refresher {
background-color: transparent !important;
}
.wd-tabs__nav {
background-color: transparent !important;
}
.wd-tabs {
background-color: transparent !important;
}
</style>

View File

@ -56,6 +56,18 @@
import CommonItem from '@/components/CommonItemItem/CommonItem.vue'
const times = ref([
{
times: ['07:00', '09:00'],
switch: [true, false]
},
{
times: ['07:00', '09:00'],
switch: [true, false]
},
{
times: ['07:00', '09:00'],
switch: [true, false]
},
{
times: ['07:00', '09:00'],
switch: [true, false]

View File

@ -135,6 +135,7 @@
:value="wayList[wayIndex].title"
></CommonItem>
<CommonItem
@click="goDevice"
text="打卡设备"
:isMust="wayIndex == 0"
:noLine="wayIndex == 0"
@ -218,6 +219,11 @@
url: '/pages/attendance/attendance-add-group/attendance-time'
})
}
const goDevice = () => {
uni.navigateTo({
url: '/pages/attendance/attendance-add-group/attendance-device'
})
}
</script>
<style lang="scss" scoped>

View File

@ -0,0 +1,95 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom'
}
}
</route>
<template>
<view class="h-100vh flex flex-col">
<TopNavigation title="选择考勤机/门禁点"></TopNavigation>
<view class="bg-white flex flex flex-row flex-justify-center items-center rounded-1 m-3 p-1.5">
<wd-icon name="search" class="color-gray text-3.3 ml-2"></wd-icon>
<view class="color-gray ml-2">搜索</view>
</view>
<view class="m-3 mt-2 color-gray">全部</view>
<scroll-view scroll-y>
<view
v-for="(device, index) in deviceList"
:key="index"
class="bg-white px-3 py-2 flex flex-row items-center border-solid border-0 border-t-1 border-gray-100"
>
<view
@click="
() => {
if (selectIndex == index) {
selectIndex = -1
} else {
selectIndex = index
}
}
"
class="text-5"
:class="
selectIndex == index
? 'i-carbon-checkmark-filled color-[#3372FA]'
: 'i-carbon-circle-outline color-gray'
"
></view>
<image src="/static/images/icon_one_key_door.png" mode="aspectFit" class="h-9 w-11" />
<view>{{ device.name }}</view>
<view class="ml-a color-gray">{{ device.type }}</view>
</view>
</scroll-view>
<view class="p-3 box-border border-solid border-0 border-t-1 border-gray-200 text-end">
<wd-button :round="false">确定</wd-button>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const selectIndex = ref(0)
const deviceList = ref([
{
name: 'DK-K(L40231232)',
type: '公共门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
},
{
name: 'DK-K(L40231233)',
type: '私人门'
}
// Add more devices as needed
])
</script>
<style lang="scss" scoped>
//
</style>

View File

@ -15,46 +15,44 @@
<wd-tab :title="item.title"></wd-tab>
</block>
</wd-tabs>
<view class="flex-1 flex flex-col p-3">
<scroll-view scroll-y class="flex-1 box-border">
<view class="bg-white rounded-2">
<CommonItem
text="添加"
@click="
tabsIndex == 0 ? mustDate.push(cloneBestDate()) : unMustDate.push(cloneBestDate())
"
>
<template v-slot:child>
<wd-icon name="add-circle" class="ml-a" size="18"></wd-icon>
</template>
</CommonItem>
</view>
<view
class="mt-5"
v-for="(item, index) in tabsIndex == 0 ? mustDate : unMustDate"
:key="index"
<scroll-view scroll-y class="flex-1 box-border p-3">
<view class="bg-white rounded-2">
<CommonItem
text="添加"
@click="
tabsIndex == 0 ? mustDate.push(cloneBestDate()) : unMustDate.push(cloneBestDate())
"
>
<view class="flex flex-justify-between px-3 mb-2">
<view class="color-gray text-3">{{ tabs[tabsIndex].title }}({{ index + 1 }})</view>
<view
@click="tabsIndex == 0 ? mustDate.splice(index, 1) : unMustDate.splice(index, 1)"
class="color-red text-3"
>
删除
</view>
</view>
<view class="bg-white rounded-2">
<CommonItem text="日期" :value="item.data" :noLine="tabsIndex != 0"></CommonItem>
<CommonItem
v-show="tabsIndex == 0"
text="上下班时间"
:value="item.time"
noLine
></CommonItem>
<template v-slot:child>
<wd-icon name="add-circle" class="ml-a" size="18"></wd-icon>
</template>
</CommonItem>
</view>
<view
class="mt-5"
v-for="(item, index) in tabsIndex == 0 ? mustDate : unMustDate"
:key="index"
>
<view class="flex flex-justify-between px-3 mb-2">
<view class="color-gray text-3">{{ tabs[tabsIndex].title }} ({{ index + 1 }})</view>
<view
@click="tabsIndex == 0 ? mustDate.splice(index, 1) : unMustDate.splice(index, 1)"
class="color-red text-3"
>
删除
</view>
</view>
</scroll-view>
</view>
<view class="bg-white rounded-2">
<CommonItem text="日期" :value="item.data" :noLine="tabsIndex != 0"></CommonItem>
<CommonItem
v-show="tabsIndex == 0"
text="上下班时间"
:value="item.time"
noLine
></CommonItem>
</view>
</view>
</scroll-view>
<view class="mt-a w-full p-3 box-border border-solid border-0 border-t-1 border-gray-200">
<wd-button :round="false" block>确定</wd-button>
</view>

View File

@ -33,7 +33,6 @@
scroll-y
class="mt-2 flex-1 px-3 box-border"
refresher-enabled
:refresher-threshold="45"
@refresherrefresh="onRefresh()"
:refresher-triggered="scrollViewStatus"
>
@ -88,10 +87,10 @@
const key = ref('')
const onRefresh = () => {
console.log('refresh')
scrollViewStatus.value = true
setTimeout(() => {
scrollViewStatus.value = true
scrollViewStatus.value = false
}, 2000)
}, 500)
}
onLoad(options => {
isSelect.value = options.isSelect ?? false