提交 1e299f4b 编写于 作者: 刘英杰's avatar 刘英杰

整合签到列表代码

上级 63515242
...@@ -17,6 +17,8 @@ dist-ssr ...@@ -17,6 +17,8 @@ dist-ssr
!.vscode/extensions.json !.vscode/extensions.json
.idea .idea
.DS_Store .DS_Store
/node_modules
#/dist
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
......
default:
before_script:
- chcp 65001
stages:
- publish
build:
stage: publish
script:
- remove-item -Force -Recurse D:\ASC_web\A00051\dutyManagement\wx*
- xcopy "dist" "D:\ASC_web\A00051\dutyManagement\wx\" /s/e/y/
only:
- wx
import { createApp } from 'vue' import {createApp} from 'vue'
import './style.css' import './style.css'
import App from './App.vue' import App from './App.vue'
import router from "./router/index.js"; import router from "./router/index.js";
import 'animate.css' //引入 import 'animate.css' //引入
import VueCookies from 'vue-cookies' import VueCookies from 'vue-cookies'
import VConsole from 'vconsole'; import VConsole from 'vconsole';
const app = createApp(App) const app = createApp(App)
// const vConsole = new VConsole(); // const vConsole = new VConsole();
app.config.globalProperties.$cookies = VueCookies app.config.globalProperties.$cookies = VueCookies
app.use(router) app.use(router)
app.mount('#app') app.mount('#app')
...@@ -49,10 +49,10 @@ const getTokenActionWx = async (date) => { ...@@ -49,10 +49,10 @@ const getTokenActionWx = async (date) => {
} }
const getToken = async () => { const getToken = async () => {
if (Number(router.currentRoute.value.query.type) === 2) { if (Number(router.currentRoute.value.query.type) === 2) {
Cookies.set('token', router.currentRoute.value.query.token) // Cookies.set('token', router.currentRoute.value.query.token)
// localStorage.setItem('token', router.currentRoute.value.query.token) // localStorage.setItem('token', router.currentRoute.value.query.token)
let date = { let date = {
token: Cookies.get('token') token: router.currentRoute.value.query.token
} }
await getTokenAction(date) await getTokenAction(date)
} else if (Number(router.currentRoute.value.query.type) === 1) { } else if (Number(router.currentRoute.value.query.type) === 1) {
......
...@@ -39,12 +39,12 @@ const getTokenActionWx = async (date) => { ...@@ -39,12 +39,12 @@ const getTokenActionWx = async (date) => {
Cookies.set('admin-token', res.response.access_token.token_content) Cookies.set('admin-token', res.response.access_token.token_content)
Cookies.set('time', res.response.access_token.expires) Cookies.set('time', res.response.access_token.expires)
let links = router.currentRoute.value.query.links let links = router.currentRoute.value.query.links
let id = router.currentRoute.value.query.id // let id = router.currentRoute.value.query.id
await router.push({ await router.push({
path: `/${links}`, path: `/${links}`,
query: { // query: {
id: id // id: id
} // }
}) })
} }
} }
...@@ -54,8 +54,8 @@ const getToken = async () => { ...@@ -54,8 +54,8 @@ const getToken = async () => {
let date = { let date = {
token: Cookies.get('token') token: Cookies.get('token')
} }
console.log("🚀🚀🚀,ASC的data", date) // console.log("🚀🚀🚀,ASC的data", date)
console.log("🚀🚀🚀,ASC的token", Cookies.get('token')) // console.log("🚀🚀🚀,ASC的token", Cookies.get('token'))
await getTokenAction(date) await getTokenAction(date)
} else if (Number(router.currentRoute.value.query.type) === 1) { } else if (Number(router.currentRoute.value.query.type) === 1) {
let date = { let date = {
......
...@@ -71,7 +71,7 @@ onMounted(() => { ...@@ -71,7 +71,7 @@ onMounted(() => {
getDutyMessage() getDutyMessage()
}) })
const onClickLeft = () => router.push({ const onClickLeft = () => router.push({
name: 'welcome' name: 'signList'
}); });
</script> </script>
<style> <style>
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
<van-dropdown-menu :overlay="false"> <van-dropdown-menu :overlay="false">
<van-dropdown-item @close="closeMenu" :key="myDuty.menuKey" @open="openMenu" title="日期"> <van-dropdown-item @close="closeMenu" :key="myDuty.menuKey" @open="openMenu" title="日期">
<template #default> <template #default>
<van-calendar v-model:show="myDuty.show" type="range" @confirm="dateRange"/> <van-calendar :minDate="myDuty.minDate"
:maxDate="myDuty.maxDate" v-model:show="myDuty.show" type="range" @confirm="dateRange"/>
</template> </template>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item v-model="myDuty[item[2]]" v-for="(item,index) in myDuty.addDutySelectList" :key="index" <van-dropdown-item v-model="myDuty[item[2]]" v-for="(item,index) in myDuty.addDutySelectList" :key="index"
...@@ -96,21 +97,21 @@ ...@@ -96,21 +97,21 @@
<van-popup v-model:show="changeShiftsPickerShow" round position="bottom"> <van-popup v-model:show="changeShiftsPickerShow" round position="bottom">
<!-- 搜索框 --> <!-- 搜索框 -->
<van-search <van-search
v-model="changeSftInput" v-model="changeSftInput"
placeholder="请输入姓名或工号" placeholder="请输入姓名或工号"
@update:model-value="searchChange"/> @update:model-value="searchChange"/>
<!-- 选择器 --> <!-- 选择器 -->
<van-picker <van-picker
:columns="userList" :columns="userList"
:loading="pickerLoading" :loading="pickerLoading"
@cancel="pickerCancel" @cancel="pickerCancel"
@confirm="pickerConfirm" @confirm="pickerConfirm"
/> />
</van-popup> </van-popup>
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.container { .container {
//box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start; //box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start;
.cardContainer { .cardContainer {
...@@ -141,6 +142,8 @@ import Cookies from 'js-cookie' ...@@ -141,6 +142,8 @@ import Cookies from 'js-cookie'
const onClickLeft = () => history.back(); const onClickLeft = () => history.back();
let myDuty = reactive({ let myDuty = reactive({
minDate: new Date(dayjs().year(), dayjs().month() - 1, 1),
maxDate: new Date(dayjs().year(), dayjs().month() + 1, 1),
addDutySelectList: [], addDutySelectList: [],
DatePickerKey: 1, DatePickerKey: 1,
showCenter: false, showCenter: false,
...@@ -243,6 +246,7 @@ const onLoad = async () => { ...@@ -243,6 +246,7 @@ const onLoad = async () => {
"page_size": myDuty.page_size, "page_size": myDuty.page_size,
} }
const res = await api.GetWatchList(data) const res = await api.GetWatchList(data)
// showToast('刷新成功!')
list.value = res.response.data list.value = res.response.data
myDuty.total = res.response.data_count myDuty.total = res.response.data_count
// 异步更新数据 // 异步更新数据
...@@ -254,7 +258,7 @@ const onLoad = async () => { ...@@ -254,7 +258,7 @@ const onLoad = async () => {
// 数据全部加载完成 // 数据全部加载完成
if (list.value.length >= Number(myDuty.total)) { if (list.value.length >= Number(myDuty.total)) {
finished.value = true; finished.value = true;
showToast('加载完成!') // showToast('加载完成!')
} else if (list.value.length < Number(myDuty.total)) { } else if (list.value.length < Number(myDuty.total)) {
myDuty.page_size = myDuty.page_size + 10 myDuty.page_size = myDuty.page_size + 10
...@@ -304,6 +308,7 @@ function pickerChgSftOpen(obj) { ...@@ -304,6 +308,7 @@ function pickerChgSftOpen(obj) {
changeShiftsPickerShow.value = true changeShiftsPickerShow.value = true
attendanceObj.value = obj attendanceObj.value = obj
} }
// 搜索值改变 // 搜索值改变
function searchChange(val) { function searchChange(val) {
pickerLoading.value = true pickerLoading.value = true
...@@ -324,6 +329,7 @@ function searchChange(val) { ...@@ -324,6 +329,7 @@ function searchChange(val) {
pickerLoading.value = false pickerLoading.value = false
}) })
} }
// 换班选择器确认 // 换班选择器确认
function pickerConfirm(val) { function pickerConfirm(val) {
// console.log('选择器确认', val) // console.log('选择器确认', val)
...@@ -352,6 +358,7 @@ function pickerConfirm(val) { ...@@ -352,6 +358,7 @@ function pickerConfirm(val) {
}) })
} }
// 换班选择器取消 // 换班选择器取消
function pickerCancel() { function pickerCancel() {
changeShiftsPickerShow.value = false changeShiftsPickerShow.value = false
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -15,7 +15,16 @@ ...@@ -15,7 +15,16 @@
<!-- <router-link to="/messageDetails">--> <!-- <router-link to="/messageDetails">-->
<!-- <van-button>123123</van-button>--> <!-- <van-button>123123</van-button>-->
<!-- </router-link>--> <!-- </router-link>-->
<van-cell-group style="width: 100%;margin-top: 10px"> <van-cell-group style="width: 100%;margin-top: 10px">
<!-- <van-swipe @change="swiperNext" class="my-swipe" indicator-color="white">-->
<!-- <van-swipe-item>1</van-swipe-item>-->
<!-- <van-swipe-item>2</van-swipe-item>-->
<!-- <van-swipe-item>3</van-swipe-item>-->
<!-- <van-swipe-item style="color: red;">-->
<!-- </van-swipe-item>-->
<!-- </van-swipe>-->
<div class="dateContainer"> <div class="dateContainer">
<div class="left" @click="reductionDate"> <div class="left" @click="reductionDate">
<span class="SlideButton"><van-icon name="arrow-left"/></span> <span class="SlideButton"><van-icon name="arrow-left"/></span>
...@@ -38,7 +47,7 @@ ...@@ -38,7 +47,7 @@
<van-cell icon="manager-o" @click="myDuty" is-link class="cardTitle" title="我的值班" value="个人值班记录"/> <van-cell icon="manager-o" @click="myDuty" is-link class="cardTitle" title="我的值班" value="个人值班记录"/>
<van-cell icon="label-o" @click="signList" is-link class="cardTitle" title="签到列表" value="教师签到"/> <van-cell icon="label-o" @click="signList" is-link class="cardTitle" title="签到列表" value="教师签到"/>
</van-cell-group> </van-cell-group>
<van-cell-group v-for="(item,index) in GetWatchListObject.GetWatchListInitArray" :key="index" inset <van-cell-group v-for="(item,index) in GetWatchListObject.GetWatchListInitArray" :key="index" inset
style="width: 100%" class="cardContainer"> style="width: 100%" class="cardContainer">
<van-cell class="cardContent" :title="item.username"> <van-cell class="cardContent" :title="item.username">
...@@ -58,7 +67,6 @@ ...@@ -58,7 +67,6 @@
<template #extra> <template #extra>
<van-tag type="primary" plain> <van-tag type="primary" plain>
<span>{{ item.watchtypename + '-' + item.dept_name + '-' + item.campusname }}</span></van-tag> <span>{{ item.watchtypename + '-' + item.dept_name + '-' + item.campusname }}</span></van-tag>
</template> </template>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
...@@ -105,6 +113,12 @@ let GetWatchListObject = reactive({ ...@@ -105,6 +113,12 @@ let GetWatchListObject = reactive({
GetWatchListInitArray: [], GetWatchListInitArray: [],
}) })
const swiperPrev = () => {
console.log("🚀swiperPrev🚀🚀,",)
}
const swiperNext = (e) => {
console.log("🚀🚀swiperNext🚀,", e)
}
const onRefresh = async () => { const onRefresh = async () => {
dateArray.loading = true dateArray.loading = true
GetWatchListObject.startTime = dayjs().format('YYYY-MM-DD') GetWatchListObject.startTime = dayjs().format('YYYY-MM-DD')
...@@ -263,6 +277,14 @@ onMounted(() => { ...@@ -263,6 +277,14 @@ onMounted(() => {
}) })
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.my-swipe .van-swipe-item {
width: 100px;
color: #fff;
font-size: 20px;
line-height: 150px;
text-align: center;
background-color: #39ed81;
}
.container { .container {
.dateContainer { .dateContainer {
...@@ -294,7 +316,7 @@ onMounted(() => { ...@@ -294,7 +316,7 @@ onMounted(() => {
.content { .content {
width: 11.42%; width: 11.42%;
height: 50px; height: 50px;
//border-radius:150%; //background-color: red; //border-radius:150%; //background-color: red;
} }
...@@ -316,7 +338,7 @@ onMounted(() => { ...@@ -316,7 +338,7 @@ onMounted(() => {
height: 20%; height: 20%;
.cardContent { .cardContent {
//height: 150px; //height: 150px;
} }
} }
......
...@@ -15,9 +15,8 @@ export default defineConfig({ ...@@ -15,9 +15,8 @@ export default defineConfig({
], ],
base: './', base: './',
server: { server: {
// host: "127.0.0.1", // host: "0.0.0.0",
// cors: true, // cors: true,
// port: 8991, // port: 8991,
// open: true, //自动打开 // open: true, //自动打开
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或