Commit 5d3a4cb4 by @xu-tengbo

a

parent 4af483bd
# root = true
# [*]
# charset = utf-8
# indent_style = space
# indent_size = 2
# end_of_line = lf
# insert_final_newline = false
# trim_trailing_whitespace = false
# NODE_ENV='development'
# VUE_APP_MODE='development'
# VUE_APP_API_URL='/school'
\ No newline at end of file
# NODE_ENV='production'
# VUE_APP_MODE='production'
# VUE_APP_API_URL='/school' //上线nginx所在地址(处理跨域问题)
\ No newline at end of file
# 忽略build目录下类型为js的文件的语法检查
build/*.js
# 忽略src/assets目录下文件的语法检查
src/assets
# 忽略public目录下文件的语法检查
public
# 忽略当前目录下为js的文件的语法检查
*.js
# 忽略当前目录下为vue的文件的语法检查
*.vue
\ No newline at end of file
.DS_Store
node_modules
/dist
/wx_dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
package-lock.json
yarn.lock
https://gitee.com/changjiang_university_hubei/zhxy.git
\ No newline at end of file
File added
111
\ No newline at end of file
# vue_xygl
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"import",
{
libraryName: "vant",
libraryDirectory: "es",
style: true,
},
],
],
};
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
export {}
declare module '@vue/runtime-core' {
export interface GlobalComponents {
My_switch: typeof import('./src/components/my_switch.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Tabbar: typeof import('./src/components/tabbar.vue')['default']
VanActionSheet: typeof import('vant/es')['ActionSheet']
VanButton: typeof import('vant/es')['Button']
VanCalendar: typeof import('vant/es')['Calendar']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCheckbox: typeof import('vant/es')['Checkbox']
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
VanCollapse: typeof import('vant/es')['Collapse']
VanCollapseItem: typeof import('vant/es')['CollapseItem']
VanConfigProvider: typeof import('vant/es')['ConfigProvider']
VanDatetimePicker: typeof import('vant/es')['DatetimePicker']
VanDropdownItem: typeof import('vant/es')['DropdownItem']
VanDropdownMenu: typeof import('vant/es')['DropdownMenu']
VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanGrid: typeof import('vant/es')['Grid']
VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon']
VanImage: typeof import('vant/es')['Image']
VanList: typeof import('vant/es')['List']
VanNavBar: typeof import('vant/es')['NavBar']
VanPicker: typeof import('vant/es')['Picker']
VanPopover: typeof import('vant/es')['Popover']
VanPopup: typeof import('vant/es')['Popup']
VanPullRefresh: typeof import('vant/es')['PullRefresh']
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanSearch: typeof import('vant/es')['Search']
VanSidebar: typeof import('vant/es')['Sidebar']
VanSidebarItem: typeof import('vant/es')['SidebarItem']
VanStep: typeof import('vant/es')['Step']
VanSteps: typeof import('vant/es')['Steps']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTabs: typeof import('vant/es')['Tabs']
VanTag: typeof import('vant/es')['Tag']
VanUploader: typeof import('vant/es')['Uploader']
}
}
{
"name": "vue_kindergartem",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.21.1",
"compression-webpack-plugin": "^6.1.1",
"core-js": "^3.6.5",
"fs": "^0.0.1-security",
"js-cookie": "^3.0.1",
"path": "^0.12.7",
"useless-files-webpack-plugin": "^1.0.1",
"vant": "^3.0.16",
"vue": "^3.0.0",
"vue-baidu-calendar": "^1.0.8",
"vue-router": "^4.0.0-0",
"vue-touch": "^2.0.0-beta.4",
"vue3-hash-calendar": "^1.0.11",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.0.0",
"less": "^3.13.1",
"less-loader": "^5.0.0",
"postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1",
"prettier": "^2.2.1",
"unplugin-vue-components": "^0.22.8",
"webpack-bundle-analyzer": "^4.8.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/prettier"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
// postcss.config.js
// 用 vite 创建项目,配置 postcss 需要使用 post.config.js,之前使用的 .postcssrc.js 已经被抛弃
// 具体配置可以去 postcss-pxtorem 仓库看看文档
module.exports = {
plugins: {
"postcss-pxtorem": {
rootValue: 37.5, // Vant 官方根字体大小是 37.5
propList: ["*"],
selectorBlackList: [".norem"], // 过滤掉.norem-开头的class,不进行rem转换
},
autoprefixer: { overrideBrowserslist: ["> 0.15% in CN"] },
},
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover"
name="viewport" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>智慧校园</title>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_1623819_3g3arzgtlmk.css">
<script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>
\ No newline at end of file
(function () {
const baseSize = 16; // 32
function setRem() {
const scale = document.documentElement.clientWidth / 375; // 750
document.documentElement.style.fontSize =
"font-size:" + baseSize * Math.min(scale, 2) + "px";
// document.documentElement.body.style.fontSize = "24px";
let htmlDom = document.getElementsByTagName("body")[0];
htmlDom.style.fontSize = "24px";
}
setRem();
window.onresize = function () {
setRem();
};
})();
<template>
<router-view> </router-view>
</template>
<script setup>
// var vConsole = new VConsole();
</script>
<style lang="less">
html {
background: rgb(242, 242, 242);
}
#app {
width: 100%;
height: 100vh;
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
// text-align: center;
color: #2c3e50;
background: GhostWhite;
// background: white;
overflow: auto;
}
#nav {
// padding: 10px;
// background-color: #5f91f0;
margin-bottom: -1px;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
}
}
.flex_center {
display: flex;
align-items: center;
justify-content: center;
}
.van-nav-bar {
background: #39befe;
}
.van-nav-bar__text {
color: #ffffff;
}
.van-nav-bar .van-icon {
color: #ffffff;
}
.van-nav-bar__title {
font-family: PingFang SC;
font-weight: 700;
color: #ffffff;
font-size: 18px;
text-align: center;
}
.flex_col {
display: flex;
flex-direction: column;
}
.c_main_list {
background: #fff;
padding: 5vw;
margin: 5vw;
border-radius: 10px;
}
.flex_be {
display: flex;
align-items: center;
justify-content: space-between;
}
.Medium2 {
/** 标准标题Medium 20pt 28H 500 */
font-size: 20px;
font-weight: 700;
letter-spacing: 0px;
line-height: 24px;
color: rgba(50, 50, 51, 1);
text-align: left;
}
.Regular1 {
/** 正文5 大部分正文文字+导航栏的文字 Regular 17pt 23H 400 */
font-size: 16px;
font-weight: 400;
letter-spacing: 0px;
line-height: 20px;
color: rgba(50, 50, 51, 1);
text-align: left;
}
img {
max-width: 100%; /*图片自适应宽度*/
}
.margin_top_m {
margin-top: 10px;
}
.Regular3 {
/** 正文4 信息较多且需要多呈现时的正文使用Regular 15pt 21H 400 */
font-size: 15px;
font-weight: 400;
letter-spacing: 0px;
line-height: 19px;
color: rgba(50, 50, 51, 1);
text-align: left;
}
.main_one_btn {
width: 80vw;
height: auto;
position: relative;
top: 3vh;
line-height: 20px;
// border-radius: 0px 0px 26px 26px;
text-align: center;
padding: 0 10vw;
padding-bottom: 10vw;
}
page {
background-color: #fff;
}
</style>
File added
@font-face {
font-family: 'Slideqiuhong';
src: url('Slideqiuhong.ttf');
font-weight: normal;
font-style: normal;
}
\ No newline at end of file
<template>
<div class="d-switch" :class="{ 'is-checked': checked }">
<input
class="d-switch__input"
ref="input"
type="checkbox"
:checked="checked"
@change="handleInput"
:true-value="trueValue"
:false-value="falseValue"
/>
<span class="d-switch_action"></span>
</div>
</template>
<script>
import { computed, ref, nextTick,defineProps,defineEmits } from "vue";
const props = defineProps({
modelValue: {
//绑定值,必须等于active-value或inactive-value,默认为Boolean类型 如果是vue2 这里绑定是 `value`
type: [Number, String, Boolean],
},
trueValue: {
//switch 打开时的值 可以自定义组件打开的时的值
type: [Number, String, Boolean],
default: true,
},
falseValue: {
// switch 关闭时的值 可以自定义组件关闭的时的值
type: [Number, String, Boolean],
default: true,
},
activeColor: {
//switch 打开时的背景色
type: [String],
default: "#409EFF",
},
});
const emits = defineEmits(["update:modelValue", "change"]);
//获取input元素
const input = ref(null);
//判断当前组件是否是打开状态
const checked = computed(() => {
//因为可以自定义打开和关闭的值 所以这里必须判断 v-model绑定的值 === 组件自定义打开的值
return props.modelValue === props.trueValue;
});
//input事件 获取当前input事件
const handleInput = () => {
nextTick(() => {
console.log(1,modelValue);
const val = input.value.checked;
emits("update:modelValue", val); // 开关点击后的状态传给v-model
emits("change", val); //给组件增加change 事件
});
};
</script>
<style lang="less" scoped>
.d-switch {
position: relative;
height: 18px;
transition: background 0.2s;
width: v-bind(width);
background: rgb(117, 117, 117);
border-radius: 10px;
display: inline-flex;
align-items: center;
vertical-align: middle;
.d-switch__input {
position: relative;
z-index: 1;
margin: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.d-switch_action {
position: absolute;
transition: 0.2s;
left: 2px;
top: 2px;
z-index: 0;
height: 14px;
width: 14px;
background: #fff;
border-radius: 50%;
}
&.is-checked {
background: v-bind(activeColor);
.d-switch_action {
left: 100%;
background: #fff;
margin-left: -18px;
}
}
}
</style>
<!--
* 严肃声明:
* 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
* 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
* 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
* Copyright (c) 2020 陈尼克 all rights reserved.
* 版权所有,侵权必究!
*
-->
<template>
<van-tabbar v-model="active">
<van-tabbar-item replace to="/Main" icon="apps-o">首页</van-tabbar-item>
<van-tabbar-item replace to="/gardenIntr" icon="shop-collect-o"
>园区介绍</van-tabbar-item
>
<van-tabbar-item replace to="/Calendar" icon="todo-list-o"
>校历</van-tabbar-item
>
<!-- <van-tabbar-item replace to="/gradeSchedule" icon="description"
>课表</van-tabbar-item
> -->
<!-- <van-tabbar-item replace to="/Main" badge="3">
<span>首页</span>
<template #icon="props">
<img :src="props.active ? icon.active : icon.inactive" />
</template>
</van-tabbar-item> -->
<!-- <van-tabbar-item replace to="/interestClassEnroll" icon="flag-o"
>兴趣班</van-tabbar-item
> -->
<van-tabbar-item v-show="userType" replace to="/personInfo" icon="setting-o"
>我的</van-tabbar-item
>
<van-tabbar-item
v-show="!userType"
replace
to="/teacherInfo"
icon="setting-o"
>我的</van-tabbar-item
>
</van-tabbar>
</template>
<script setup>
import { ref, toRefs, onMounted } from "vue";
import { defineProps } from "vue";
import { getTotyp } from "@/utils/auth";
const props = defineProps({
selected: Number,
});
const userType = ref(true);
const calendarId = ref();
const { selected } = toRefs(props);
const active = ref(props.selected);
const icon = {
active: "https://fastly.jsdelivr.net/npm/@vant/assets/user-active.png",
inactive: "https://fastly.jsdelivr.net/npm/@vant/assets/user-inactive.png",
};
onMounted(async () => {
if (getTotyp() != 1) {
userType.value = false;
}
});
const goCalendar = async () => {
let result = await getCalendar({ date: formatDate(new Date()) });
if (result.code == 200) {
router.push({
path: "/Calendar",
query: {
id: result.data.id,
},
});
} else if (result.code == 500) {
Toast("获取信息失败!");
return;
}
};
</script>
<style lang="less" scoped></style>
/**
* @description 封装路由方法
* */
import { useRouter } from 'vue-router';
export default function () {
const router = useRouter();
// 路由回退
function routeBack() {
router.back();
}
return routeBack
}
\ No newline at end of file
/**
* @description 进入指定的路由
* */
import { useRouter } from 'vue-router';
// 进入指定的路由
export default function () {
const router = useRouter();
function routeInto(path, query = {}) {
if (path) {
router.push({
path,
query
})
}
}
return routeInto
}
\ No newline at end of file
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
// import { Button } from "vant";
// // import { DatePicker } from 'vant';
// import { NavBar } from "vant";
// import { Rate } from "vant";
// import { Search } from "vant";
// import { Skeleton } from "vant";
// import { Col, Row } from "vant";
// import { Tab, Tabs } from "vant";
// import { Sticky } from "vant";
// import { Image as VanImage } from "vant";
// import { Cell, CellGroup } from "vant";
import { Form, Field, Uploader } from "vant";
// import { Picker } from "vant";
// import { Popup } from "vant";
// import { Toast } from "vant";
// import { Empty } from "vant";
// import { Dialog } from "vant";
// import { Switch } from "vant";
// import { Tabbar, TabbarItem } from "vant";
// import { DropdownMenu, DropdownItem } from "vant";
// import { RadioGroup, Radio } from "vant";
// import { Grid, GridItem } from "vant";
// import { Divider } from "vant";
// import { ContactCard } from "vant";
// import { Calendar } from "vant";
// import { VueTouch } from "vue-touch";
// import ElementPlus from "element-plus";
import VueHashCalendar from "vue3-hash-calendar";
import "vue3-hash-calendar/es/index.css";
// import "element-plus/dist/index.css";
import "amfe-flexible/index.min.js";
import "../rem.js";
const app = createApp(App);
app.config.globalProperties.$imgUrl = "http://43.143.63.140:8095/";
// process.env.NODE_ENV == "development"
// ? "//192.168.101.72:8848"
// : "//43.143.63.140:8095";
app
// .use(ElementPlus)
// .use(Button)
// .use(NavBar)
// .use(Rate)
// .use(Search)
// .use(Skeleton)
// .use(Col)
// .use(Row)
// .use(Tab)
// .use(Tabs)
// .use(Sticky)
// .use(VanImage)
// .use(Cell)
// .use(CellGroup)
// .use(Form)
// .use(Picker)
// .use(Popup)
// .use(Field)
// .use(Uploader)
// .use(Toast)
// .use(Empty)
// .use(Tabbar)
// .use(TabbarItem)
// .use(DropdownMenu)
// .use(Dialog)
// .use(VueTouch, { name: "v-touch" })
// .use(DropdownItem)
// .use(Radio)
// .use(RadioGroup)
// .use(Switch)
// .use(Grid)
// .use(GridItem)
// .use(ContactCard)
// .use(Calendar)
// .use(Divider)
.use(VueHashCalendar)
.use(Uploader);
// .use(DatePicker)
app.use(store).use(router).mount("#app");
import { ref } from "vue";
import axios from "../utils/axios";
import store from "../store";
//学生关系字典
export function getrelationshiptype() {
let url = "/system/dict/data/type/relationship";
let result = axios.get(url);
return result;
}
export function getpoliticstatus() {
let url = "/system/dict/data/type/politics_tatus";
let result = axios.get(url);
return result;
}
export function getstudentnature() {
let url = "/system/dict/data/type/student_nature";
let result = axios.get(url);
return result;
}
export function getregisttype() {
let url = "/system/dict/data/type/regist_type";
let result = axios.get(url);
return result;
}
/* 存储孩子关系类型字典 */
export const storetyprelationshiptyp = async () => {
let typlist = await getrelationshiptype();
const typlistdir = ref();
if (typlist.code == 200) {
typlistdir.value = [];
typlist.data.forEach((element) => {
typlistdir.value.push({
text: element.dictLabel,
value: element.dictValue,
});
});
store.commit("edittyprelationshiptyp", typlistdir.value);
}
};
export const storetyppoliticstatus = async () => {
let typlist = await getpoliticstatus();
const typlistdir = ref();
if (typlist.code == 200) {
typlistdir.value = [];
typlist.data.forEach((element) => {
typlistdir.value.push({
text: element.dictLabel,
value: element.dictValue,
});
});
store.commit("edittyppoliticstatus", typlistdir.value);
}
};
export const storetypstudentnature = async () => {
let typlist = await getstudentnature();
const typlistdir = ref();
if (typlist.code == 200) {
typlistdir.value = [];
typlist.data.forEach((element) => {
typlistdir.value.push({
text: element.dictLabel,
value: element.dictValue,
});
});
store.commit("edittypstudentnaturetype", typlistdir.value);
}
};
export const storetypregisttype = async () => {
let typlist = await getregisttype();
const typlistdir = ref();
if (typlist.code == 200) {
typlistdir.value = [];
typlist.data.forEach((element) => {
typlistdir.value.push({
text: element.dictLabel,
value: element.dictValue,
});
});
store.commit("edittypregisttype", typlistdir.value);
}
};
import axios from "../utils/axios";
/**
* 园区介绍
* */
// 获取园区数据
export function getGardenIntr() {
return axios.get('wx/introduce/list');
}
\ No newline at end of file
/**
* @description 教师工资
* */
import axios from "../utils/axios";
// 教师工资列表
export function getWageList(teacherId, queryForm) {
return axios.get('/wx/teacherWages/list/' + teacherId, {
params: {
...queryForm
}
});
}
// 教师工资详情
export function getWageDetail(id) {
return axios.get('/wx/teacherWages/queryOne/' + id);
}
\ No newline at end of file
import axios from "../utils/axios";
export function getUrlKey(name) {
console.log(location.href);
return (
decodeURIComponent(
(new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
location.href
// eslint-disable-next-line no-sparse-arrays
) || [, ""])[1].replace(/\+/g, "%20")
) || null
);
}
export function getCodeApi() {
//获取code
console.log(window)
let urlNow = encodeURIComponent(window.location.href);
// let urlNow = encodeURIComponent("https://muyecunios.top");
// let scope='snsapi_userinfo'; //snsapi_userinfo snsapi_base //静默授权 用户无感知
let url =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
"wx977825b5a132b74d" +
"&redirect_uri=" +
urlNow +
"&response_type=code&scope=snsapi_base#wechat_redirect";
window.location.href = url;
}
export function getopid(code) {
return axios({
url: "wx/callback?code=" + code,
method: "get",
});
}
const moduleA = {
state: () => ({
count: 0
}),
mutations: {
increment (state) {
// 这里的 `state` 对象是模块的局部状态
state.count++
}
},
getters: {
doubleCount (state) {
return state.count * 2
}
}
}
\ No newline at end of file
function MyColor() {
this.TextColor = 'FFFFFF';
this.Color = 'FF0000';
}
var ColorMaker = {
// 最大支持颜色种类数
TotalColors: 300,
// 获取颜色 seed:颜色种子(任意int)
GetColor: (seed = 0) => {
var ret = new MyColor();
// 计算对应下标
var idx = seed % ColorMaker.TotalColors;
// 计算颜色
var colorVal = ColorMaker._CalColor(idx);
// 转成RGB 16进制字符串
ret.Color = colorVal.toString(16).padStart(6, '0');
// 计算互补色
ret.TextColor = ColorMaker._CalTextColor(ret.Color);
return ret;
},
_CalColor: (idx = 0) => {
// 默认返回红色
var ret = 0xFF0000;
// RGB的最大值
var full = 0xFFFFFF;
// 总共需要支持多少种颜色,若传0则取255
var total = ColorMaker.TotalColors > 0 ? ColorMaker.TotalColors : 0xFF;
// 将所有颜色平均分成x份
var perVal = full / total;
if (idx >= 0 && idx <= total) {
ret = perVal * idx;
}
ret = Math.round(ret);
return ret;
},
// 计算传入颜色的互补色
_CalTextColor: (input = '') => {
var R = input.substr(0, 2);
var G = input.substr(2, 2);
var B = input.substr(4, 2);
var rVal = parseInt(R, 16);
var gVal = parseInt(G, 16);
var bVal = parseInt(B, 16);
var hsl = rgbToHsl(rVal, gVal, bVal);
hsl.L = (hsl.L + 0.5) % 1.0;
var rgb = hslToRgb(hsl.H, hsl.S, hsl.L);
var ret = (rgb.R << 16) + (rgb.G << 8) + rgb.B;
return ret.toString(16).padStart(6, '0');
}
};
/**
* RGB 颜色值转换为 HSL.
* 转换公式参考自 http://en.wikipedia.org/wiki/HSL_color_space.
* r, g, 和 b 需要在 [0, 255] 范围内
* 返回的 h, s, 和 l 在 [0, 1] 之间
*
* @param Number r 红色色值
* @param Number g 绿色色值
* @param Number b 蓝色色值
* @return Array HSL各值数组
*/
function rgbToHsl1(r, g, b) {
r /= 255, g /= 255, b /= 255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2;
if (max == min) {
h = s = 0; // achromatic
} else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
return { H: h, S: s, L: l };
}
/**
* HSL颜色值转换为RGB.
* 换算公式改编自 http://en.wikipedia.org/wiki/HSL_color_space.
* h, s, 和 l 设定在 [0, 1] 之间
* 返回的 r, g, 和 b 在 [0, 255]之间
*
* @param Number h 色相
* @param Number s 饱和度
* @param Number l 亮度
* @return Array RGB色值数值
*/
function hslToRgb1(h, s, l) {
var r, g, b;
if (s == 0) {
r = g = b = l; // achromatic
} else {
var hue2rgb = function hue2rgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h + 1 / 3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1 / 3);
}
return { R: Math.round(r * 255), G: Math.round(g * 255), B: Math.round(b * 255) };
}
/**************************颜色处理***********************************/
//hex颜色转rgb颜色
function HexToRgb(str) {
var r = /^\#?[0-9A-F]{6}$/;
//test方法检查在字符串中是否存在一个模式,如果存在则返回true,否则返回false
if (!r.test(str)) return -1
//replace替换查找的到的字符串
str = str.replace("#", "");
//match得到查询数组
var hxs = str.match(/../g);
//alert('bf:'+hxs)
for (var i = 0; i < 3; i++) hxs[i] = parseInt(hxs[i], 16);
//alert(parseInt(80, 16))
//console.log(hxs);
return hxs;
}
//GRB颜色转Hex颜色
export function RgbToHex(a, b, c) {
var r = /^\d{1,3}$/;
if (!r.test(a) || !r.test(b) || !r.test(c)) return -1
var hexs = [a.toString(16), b.toString(16), c.toString(16)];
for (var i = 0; i < 3; i++) if (hexs[i].length == 1) hexs[i] = "0" + hexs[i];
return "#" + hexs.join("");
}
//得到hex颜色值为color的加深颜色值,level为加深的程度,限0-1之间
export function getDarkColor1(color, level) {
console.log("我在加深", color);
var r = /^\#?[0-9A-F]{6}$/;
if (!r.test(color)) return -1
var rgbc = HexToRgb(color);
//floor 向下取整
for (var i = 0; i < 3; i++) rgbc[i] = Math.floor(rgbc[i] * (1 - level));
return RgbToHex(rgbc[0], rgbc[1], rgbc[2]);
}
//得到hex颜色值为color的减淡颜色值,level为加深的程度,限0-1之间
export function getLightColor1(color, level) {
var r = /^\#?[0-9A-F]{6}$/;
if (!r.test(color)) return -1
var rgbc = HexToRgb(color);
for (var i = 0; i < 3; i++) rgbc[i] = Math.floor((255 - rgbc[i]) * level + rgbc[i]);
return RgbToHex(rgbc[0], rgbc[1], rgbc[2]);
}
/****************************颜色处理结束**************************************/
//深色
export function getColorDark() {
return '#' +
(function ColorDark(color) {
// console.log(color);
return (color += '0123401234abcabc'[Math.floor(Math.random() * 16)]) &&
(color.length == 6) ? color : ColorDark(color);
})('');
}
//浅色
export function getColorUndertint() {
return '#' +
(function ColorUndertint(color) {
return (color += '5678956789defdef'[Math.floor(Math.random() * 16)]) &&
(color.length == 6) ? color : ColorUndertint(color);
})('');
}
export function rgbToRgba(color, alp) {
var r, g, b;
var rgbaAttr = color.match(/[\d.]+/g);
if (rgbaAttr.length >= 3) {
var r, g, b;
r = rgbaAttr[0];
g = rgbaAttr[1];
b = rgbaAttr[2];
return 'rgba(' + r + ',' + g + ',' + b + ',' + alp + ')';
}
}
//exist_color为已存在的颜色数组
export function getRandomColor(exist_color) {
// 如果有指定的背景的颜色,那也要先加入也不能重复,只要假如一次就够了
//exist_color.push("#4169E1");
//以下的*192都是为了是获取到的颜色为深色的
let color = getColorDark()
// 获取到未重复的颜色,返回该颜色
if (exist_color.indexOf(color) === -1) {
return color;
}
// 获取到的颜色重复,重新生成
else {
getRandomColor(exist_color);
}
}
//16进制转RGB
export const colorToRGB = (color, opt) => {
let color1, color2, color3;
color = '' + color;
if (typeof color !== 'string') return;
if (color.charAt(0) == '#') {
color = color.substring(1);
}
if (color.length == 3) {
color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
}
if (/^[0-9a-fA-F]{6}$/.test(color)) {
color1 = parseInt(color.substr(0, 2), 16);
color2 = parseInt(color.substr(2, 2), 16);
color3 = parseInt(color.substr(4, 2), 16);
return 'rgb(' + color1 + ',' + color2 + ',' + color3 + ',' + opt + ')';
}
};
class MyTools {
/**
* 唯一的随机字符串,用来区分每条数据
* @returns {string}
*/
getUid(){
return Number(Math.random().toString().substr(2, 16) + Date.now()).toString(32);
}
/**
* 计算时间差
* @param beginTime:2022-01-13
* @param endTime:2022-01-13
* @returns {{hours: number, seconds: number, minutes: number, day: number}}
*/
dealTime(beginTime,endTime) {
var dateBegin = new Date(beginTime);
var dateEnd = new Date(endTime);
var dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
var day = Math.floor(dateDiff / (24 * 3600 * 1000)); //计算出相差天数
var leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
var hours = Math.floor(leave1 / (3600 * 1000)); //计算出小时数
//计算相差分钟数
var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
var minutes = Math.floor(leave2 / (60 * 1000)); //计算相差分钟数
//计算相差秒数
var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
var seconds = Math.round(leave3 / 1000);
return {
day,
hours,
minutes,
seconds
}
}
/**
* 获取当天日期
*/
getCurDay(){
var datetime = new Date();
var year = datetime.getFullYear();
var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
return `${year}-${month}-${date}`
}
/**
* 数组中,某个属性相同的数据放在一块,如把某个日期相同的相连一起
* @param list 传入的数组
* @param prop 那个属性相同的数据
* @returns {*[]}
*/
margePropData(list = [], prop) {
let arr = [], tempArr = {};
list.forEach(item => {
if (!tempArr[item[prop]]) {
tempArr[item[prop]] = [item]
} else {
tempArr[item[prop]].push(item)
}
})
for (const tempArrKey in tempArr) {
arr = [...arr, ...tempArr[tempArrKey]]
}
return arr
}
/**
* 合并行
* @param list
* @param prop
*/
mergeRows(list = [], prop) {
list.forEach(ele => {
ele.rowspan = 1
})
const len = list.length
for (let i = 0; i < len; i++) {
for (let j = i + 1; j < len; j++) {
if (list[i][prop] === list[j][prop]) {
list[i].rowspan++
list[j].rowspan--
}
}
// 这里跳过已经重复的数据
i = i + list[i].rowspan - 1
}
return list
}
/**
* 根据当前数据的位置,在数组中插入数据
* 如数组【1,2,4,5】想要在2后面插入3,
*1:首先获取到2的下标,
*2:然后获取要插入之前的数据,获取要插入之后的数据,中间就是插入的位置
*3:最后把这三个按顺序合并就得到在想要的位置插入数据
* @param list 想要插入的数组
* @param index 插入那个值的后面的下标
* @param target 插入的目标
*/
insertArrPositionOfIndex(list = [], index = 0, target = {}) {
//根据index 找出小于index的数据放在左边
const leftList = list.filter((t, i) => i <= index);
//根据index 找出大于index的数据放在右边
const rightList = list.filter((t, i) => i > index);
// 最终合并数据
return [...leftList, target, ...rightList]
}
/**
* 校验规则
*/
verifyRules(list=[],require=[]){
let message=null
for (const key of require) {
const isEmpty= list.every(it=>!it[key.prop])
if(isEmpty){
message=key.message
break ;
}
}
return message
}
/**
* 获取元素下标
* @param dir 为 1:得到正序遍历方法;为 -1: 得到逆序遍历方法。
* @returns {(function(*, *, *=): (number|number|number))|*}
*/
findArrIndex(dir=1) {
return function (array, cb, context) {
let length = array.length;
// 控制初始 index,0 或者 length-1
let index = dir >= 0 ? 0 : length - 1;
// 条件: 在数组范围内;
// 递增或递减:递加 1 或者 -1; 妙啊~
for( ; index >= 0 && index <= length - 1; index += dir ) {
if( cb.call(context, array[index], index) ) return index
}
return -1
}
}
}
export default new MyTools()
\ No newline at end of file
import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
const parentTelephone = 'parent-Telephone'
export function getParentTelephone() {
return Cookies.get(parentTelephone)
}
export function setParentTelephone(Telephone) {
return Cookies.set(parentTelephone, Telephone)
}
export function removeParentTelephone() {
return Cookies.remove(parentTelephone)
}
const ToTYP = 'Admin-Typ'
export function getTotyp() {
return Cookies.get(ToTYP)
}
export function setTotyp(typ) {
return Cookies.set(ToTYP, typ)
}
export function removeTotyp() {
return Cookies.remove(ToTYP)
}
/**
* 严肃声明:
* 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
* 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
* 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
* Copyright (c) 2020 陈尼克 all rights reserved.
* 版权所有,侵权必究!
*/
import axios from "axios";
import { Toast } from "vant";
import router from "../router";
import { getToken } from "@/utils/auth";
import { tansParams } from "@/utils/common";
axios.defaults.baseURL = "/school";
// axios.defaults.baseURL = "/schoolnw";
// process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095";
// process.env.NODE_ENV == "development"
// ? "//192.168.101.72:8848"
// : "//43.143.63.140:8095";
// process.env.NODE_ENV == "development" ? "https://y32025c600.goho.co" : "//43.143.63.140:8095";
// process.env.NODE_ENV == "development"
// ? "//192.168.101.72:8848"
// : "//43.143.63.140:8095";
// process.env.NODE_ENV == "development"
// ? "http://localhost:8848"
// : "http://43.143.63.140:8095";
// process.env.NODE_ENV == "development"
// ? "http://localhost:8848"
// : "//43.143.63.140:8095";
// process.env.NODE_ENV == "development"
// ? "//192.168.101.78"
// : "//43.143.63.140:8095";
// : "//www.dyzmxx.com/kindergartenPc";
// console.log(process.env.NODE_ENV);
// console.log(process.env);
// process.env.NODE_ENV == "development" ? "/api" : "https://47.96.17.13/api";
axios.defaults.withCredentials = false;
axios.defaults.headers["X-Requested-With"] = "XMLHttpRequest";
//axios.defaults.headers['token'] = localStorage.getItem('token') || ''
axios.defaults.headers.post["Content-Type"] = "application/json";
axios.interceptors.request.use(
(config) => {
let cacheKey = config.url;
// log
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false;
if (getToken() && !isToken) {
config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
}
CacheUtils.cache[cacheKey] && CacheUtils.clearCache(cacheKey);
config.cancelToken = new axios.CancelToken(function executor(c) {
CacheUtils.cache[cacheKey] = c;
});
config.cacheKey = cacheKey;
// get请求映射params参数
if (config.method === "get" && config.params) {
let url = config.url + "?" + tansParams(config.params);
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
return config;
},
(error) => {
Promise.reject(error);
}
);
export const CacheUtils = {
// 存储请求接口地址以及请求体和取消函数之间的映射关系
cache: {},
// 根据提供的键名 key 取消对应的请求,若未提供则取消全部请求
clearCache: function (key) {
if (key) {
const cancel = this.cache[key];
if (cancel && typeof cancel === "function") {
cancel();
delete this.cache[key];
}
return;
}
console.log("assd");
console.log(this.cache);
Object.keys(this.cache).forEach((cacheKey) => {
const cancel = this.cache[cacheKey];
cancel();
delete this.cache[cacheKey];
});
},
};
// 响应拦截
axios.interceptors.response.use(
(res) => {
const cacheKey = res.config.cacheKey ? res.config.cacheKey : '';
delete CacheUtils.cache[cacheKey];
// console.log("我发送了请求,这是结果", res);
if (typeof res.data !== "object") {
Toast.fail("服务端异常!");
return Promise.reject(res);
}
if (res.data.code != 200) {
console.log(res.data);
// if (res.data.message) Toast.fail(res.data.message);
if (res.data.code == 401) {
router.push({ path: "/" });
}
if (res.data.code == 500) {
// router.push({ path: "/login" });
Toast.fail("获取信息异常");
// return Promise.reject(res.data);
// Toast.fail(res.data.msg);
}
return Promise.reject(res.data);
// return Promise.resolve(res.data);
}
return Promise.resolve(res.data);
},
(error) => {
// 响应异常清除缓存
if (error.config) {
const cacheKey = error.config.cacheKey;
delete CacheUtils.cache[cacheKey];
}
return Promise.reject(error);
}
);
export function trueUrl(data) {
let arr = [];
for (const key in data) {
arr.push(`${key}=${data[key]}`);
}
return "?" + arr.join("&");
}
export default axios;
/**
* 参数处理
* @param {*} params 参数
*/
export function tansParams(params) {
let result = "";
for (const propName of Object.keys(params)) {
const value = params[propName];
var part = encodeURIComponent(propName) + "=";
if (value !== null && value !== "" && typeof value !== "undefined") {
if (typeof value === "object") {
for (const key of Object.keys(value)) {
if (
value[key] !== null &&
value[key] !== "" &&
typeof value[key] !== "undefined"
) {
let params = propName + "[" + key + "]";
var subPart = encodeURIComponent(params) + "=";
result += subPart + encodeURIComponent(value[key]) + "&";
}
}
} else {
result += part + encodeURIComponent(value) + "&";
}
}
}
return result;
}
export function toChineseBig(num) {
// 将接收到的num转换为字符串
var strNum = String(num);
// 定义单位
// var unit = ['拾', '佰', '仟', '万', '拾', '佰', '仟', '亿', '拾', '佰', '仟']
var unit = ["十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千"];
// 结果中放一个符号,用来解决最后的零去不掉的问题
var result = ["@"];
// 单位下标
var unitNo = 0;
// 从后往前遍历接收到的数据,省略结束条件
for (let i = strNum.length - 1; ; i--) {
// 调用转大写函数,将每一个数字转换成中文大写,一次放入一个到结果数组中
result.unshift(numToChinese(strNum[i]));
// 如果不大于0
if (i <= 0) {
// 结束循环
break;
}
// 放入一个数字,放入一个单位
result.unshift(unit[unitNo]);
// 单位下标加1
unitNo++;
}
// 将结果数组转换成字符串,并使用正则替换一些关键位置,让结果符合语法
// return result.join('').replace(/(零[仟佰拾]){1,3}/g, '零').replace(/零{2,}/g, '零').replace(/零([万亿])/g, '$1').replace(/亿万/g, '亿').replace(/零*@/g, '')
return result
.join("")
.replace(/([千百十]){1,3}/g, "零")
.replace(/零{2,}/g, "零")
.replace(/零([万亿])/g, "$1")
.replace(/亿万/g, "亿")
.replace(/零*@/g, "");
}
function numToChinese(n) {
// var chineseBigNum = '零壹贰叁肆伍陆柒捌玖'
var chineseBigNum = "零一二三四五六七八九";
return chineseBigNum[n];
}
export function dataTransform(obj, id, value) {
id = id ? id : "id";
value = value ? value : "value";
console.log(id, value);
let key = Object.keys(obj);
let val = Object.values(obj);
let data = key.map((item, index) => {
return {
[value]: val[index],
[id]: item,
};
});
return data;
}
export function percentNum(num,num2) {
return (Math.round(num / num2 * 10000) / 100.00 + "%"); //小数点后两位百分比
}
export function fomatFloat(src, pos) {
return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
}
\ No newline at end of file
/**
* 获取字典数据
*/
export function getdictLabel(arr, value) {
let text = "";
arr.forEach((element) => {
if (element.value == value) {
text = element.text;
}
});
return text;
}
const Appendzero = (obj) => {
/* 月日 一位数补零 1 到01 */
if (obj < 10) return "0" + obj;
else return obj;
};
export function formatDate(date) {
/* 格式化日期 */
// `${date.getYear()}-${date.getMonth() + 1}-${date.getDate()}`;
let y = date.getFullYear();
let m = Appendzero(date.getMonth() + 1);
let d = Appendzero(date.getDate());
return y + "-" + m + "-" + d;
}
export function formatDatetime(date) {
/* 格式化日期 */
// `${date.getYear()}-${date.getMonth() + 1}-${date.getDate()}`;
let y = date.getFullYear();
let m = Appendzero(date.getMonth() + 1);
let d = Appendzero(date.getDate());
let h = Appendzero(date.getHours());
let min = Appendzero(date.getMinutes());
return y + "-" + m + "-" + d + " " + h + ":" + min + ":" + "00";
}
export function isEmpty(val) {
// null or undefined
if (val == null) return true;
if (typeof val === "boolean") return false;
if (typeof val === "number") return !val;
if (val instanceof Error) return val.message === "";
switch (Object.prototype.toString.call(val)) {
// String or Array
case "[object String]":
case "[object Array]":
return !val.length;
// Map or Set or File
case "[object File]":
case "[object Map]":
case "[object Set]": {
return !val.size;
}
// Plain Object
case "[object Object]": {
return !Object.keys(val).length;
}
}
return false;
}
<template>
<van-nav-bar title="考勤" left-text="返回" left-arrow @click-left="goback" />
<div>
<div class="main">
<div class="main_1">
<div class="main_1_row_1">
<div class="main_1_row_1_title">
<span class="row_1_title_left">{{ state.dayNumTheMon }}</span>
<span class="row_1_title_right"></span>
</div>
<div class="main_1_row_1_text">
<span class="row_1_text">本月出勤天数</span>
</div>
</div>
<!-- <div class="main_1_row_2">
<van-grid class="theIconGrid" :column-num="2" direction="horizontal" >
<van-grid-item text="考勤卡绑定" url="/#/attendance"> </van-grid-item>
<van-grid-item text="推送人设置" url="/#/attendance"> </van-grid-item>
<van-grid-item text="打卡排行" url="/#/attendance"></van-grid-item>
<van-grid-item text="请假记录" url="/#/attendance"></van-grid-item>
</van-grid>
</div> -->
</div>
<div class="main_2">
<div class="main_2_1">
<van-cell :title="date" @click="show = true" />
<van-calendar
v-model:show="show"
:show-confirm="false"
@confirm="onConfirm"
:min-date="mindate"
:max-date="maxdate"
color="#1989fa"
/>
</div>
<div class="main_2_2">
<div class="main_2_2_left">当日考勤</div>
<div class="main_2_2_right"><!-- 打卡明细 > --></div>
</div>
<div class="main_2_3">
<div class="main_2_3_left">
<div class="main_2_3_left_up">上午打卡</div>
<div class="main_2_3_left_down">{{ state.attendance_am_in }}</div>
</div>
<div class="main_2_3_right"></div>
</div>
<div class="main_2_4">
<div class="main_2_4_left">
<div class="main_2_4_left_up">下午打卡</div>
<div class="main_2_4_left_down">{{ state.attendance_pm_out }}</div>
</div>
<div class="main_2_4_right"></div>
</div>
</div>
</div>
</div>
</template>
<script>
// import HelloWorld from "@/components/HelloWorld.vue";
import { reactive, onMounted, toRefs } from "vue";
import { ref } from "vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
import { attendlist, attendDayslist } from "@/service/home";
// import { Toast } from "vant";
export default {
name: "PersonInfo",
setup() {
const state = reactive({
studentName: "", //学生姓名
idcard: "", // 身份证号
parentName: "1", //家长姓名
parentId: "", //家长Id
telephone: "", //手机号
gradeId: "", // 班级ID
gradeList: [], //班级列表
mindate: new Date(2021, 0, 1),
maxdate: new Date(2031, 0, 1),
kqList: [], //考勤数据列表
kaData: {}, //考勤数据
attendance_am_in: "", // 入校
attendance_pm_out: "", // 入校
dayNumTheMon: "", // 本月出勤天数
msg: "",
list: [],
});
const router = useRouter();
const store = useStore();
const show = ref(false); //展示日期
const date = ref(""); //选择日期
const gradeListOption = [];
const loadData = async () => {
console.log("加载数据");
initDate();
initAttendlist();
initAttendDayslist();
};
onMounted(async () => {
loadData();
});
const initDate = () => {
/* 初始化日期 */
let mydate = new Date();
date.value = formatDate(mydate);
};
const Appendzero = (obj) => {
/* 月日 一位数补零 1 到01 */
if (obj < 10) return "0" + obj;
else return obj;
};
const formatDate = (date) => {
/* 格式化日期 */
// `${date.getYear()}-${date.getMonth() + 1}-${date.getDate()}`;
let y = date.getFullYear();
let m = Appendzero(date.getMonth() + 1);
let d = Appendzero(date.getDate());
return y + "-" + m + "-" + d;
};
const onConfirm = (value) => {
show.value = false;
date.value = formatDate(value);
initAttendlist();
// getEveryDayFood();
// console.log(date.value);
};
const initAttendlist = async () => {
/* 初始化考勤数据 */
let childrenid = store.state.studentId;
let gradeValue = "";
let classValue = "";
let name = "";
let rq = date.value;
let result = await attendlist(
rq,
gradeValue,
classValue,
name,
childrenid
);
state.kqList = result.data;
if (result.data.length > 0) {
state.kqData = result.data[0];
state.attendance_am_in = result.data[0].attendance_am_in;
state.attendance_pm_out = result.data[0].attendance_pm_out;
console.log(result.data[0]);
}
};
const initAttendDayslist = async () => {
/* 初始化考勤数据 */
let childrenid = store.state.studentId;
let result = await attendDayslist(childrenid);
if (result.data.length > 0) {
state.dayNumTheMon = result.data[0].cqts;
}
};
const changeGradeId = async () => {
//班级选择事件
if (state.gradeId == 0) return;
};
const goback = () => {
router.push({
path: "/main",
query: {},
});
};
return {
...toRefs(state),
state,
router,
store,
gradeListOption,
show,
date,
onConfirm,
goback,
changeGradeId,
initAttendlist,
};
},
};
</script>
<style scoped lang="less">
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background-color: #fff;
}
.m_top {
height: 40vw;
position: relative;
}
.main {
// padding-top: 5vw;
width: 100vw;
height: 140vw;
line-height: 20px;
border-radius: 50px 50px 70px 70px;
// background-color: rgba(255, 199, 0, 100);
font-size: 14px;
text-align: center;
padding-bottom: 15vw;
.main_1 {
margin-top: 2vw;
width: 100vw;
// height: 55vw;
height: 35vw;
background-color: #fff;
.main_1_row_1 {
width: 100vw;
height: 30vw;
.main_1_row_1_title {
padding-top: 10vw;
width: 100vw;
height: 5vw;
.row_1_title_left {
color: green;
font-size: 25px;
}
}
.main_1_row_1_text {
padding-top: 2vw;
width: 100vw;
height: 5vw;
font-size: 12px;
}
}
.main_1_row_2 {
background-color: rgb(223, 209, 209);
width: 100vw;
height: 25vw;
}
}
.main_2 {
margin-top: 5vw;
width: 100vw;
height: 50vw;
background-color: #fff;
.main_2_1 {
width: 100vw;
height: 13vw;
}
.main_2_2 {
width: 98vw;
height: 10vw;
padding-left: 1vw;
padding-right: 1vw;
.main_2_2_left {
display: inline-block;
width: 70vw;
text-align: left;
font-weight: 600;
font-size: 16px;
}
.main_2_2_right {
display: inline-block;
width: 20vw;
text-align: right;
font-weight: 600;
font-size: 13px;
}
}
.main_2_3 {
width: 100vw;
height: 15vw;
.main_2_3_left {
display: inline-block;
vertical-align: top;
width: 70vw;
text-align: left;
font-size: 14px;
.main_2_3_left_down {
font-size: 13px;
}
}
.main_2_3_right {
display: inline-block;
vertical-align: top;
height: 15vw;
width: 20vw;
text-align: right;
}
}
.main_2_4 {
width: 100vw;
height: 15vw;
.main_2_4_left {
display: inline-block;
vertical-align: top;
width: 70vw;
text-align: left;
font-size: 14px;
.main_2_4_left_down {
font-size: 13px;
}
}
.main_2_4_right {
display: inline-block;
vertical-align: top;
height: 15vw;
width: 20vw;
text-align: right;
}
}
}
}
</style>
<template>
<van-nav-bar
title="每日食谱"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div class="bg_color">
<van-sidebar v-model="active">
<van-sidebar-item title="星期一" />
<van-sidebar-item title="星期二" />
<van-sidebar-item title="星期三" />
<van-sidebar-item title="星期四" />
<van-sidebar-item title="星期五" />
<van-sidebar-item title="星期六" />
<van-sidebar-item title="星期天" />
</van-sidebar>
<div class="main" :class="!food ? 'food' : ''">
<div v-show="food" class="main_food">
<div class="main_food_one">
<div class="main_food_one_r2">
<p class="r2_text1">早餐</p>
<p class="r2_text2">{{ breakfast }}</p>
</div>
</div>
<div class="main_food_one">
<div class="main_food_one_r2">
<p class="r2_text1">上午加餐</p>
<p class="r2_text2">{{ dessertAfterBreakfast }}</p>
</div>
</div>
<div class="main_food_one">
<div class="main_food_one_r2">
<p class="r2_text1">午餐</p>
<p class="r2_text2">{{ lunch }}</p>
</div>
</div>
<div class="main_food_one">
<div class="main_food_one_r2">
<p class="r2_text1">下午加餐</p>
<p class="r2_text2">{{ dessertAfterLunch }}</p>
</div>
</div>
<div class="main_food_one">
<div class="main_food_one_r2">
<p class="r2_text1">晚饭</p>
<p class="r2_text2">{{ dinner }}</p>
</div>
</div>
</div>
<van-empty v-if="!food" description="暂无食谱" />
</div>
<!-- 中央内容部分 -->
</div>
<div class="fotter">
<van-button
style="height: var(--van-tabbar-height); width: var(--van-sidebar-width)"
class="main_one_btn_item"
size="large"
type="primary"
@click="lastWeek"
>上周</van-button
>
<van-cell :title="date" @click="show = true" />
<van-calendar
v-model:show="show"
@confirm="onConfirm"
:min-date="mindate"
:max-date="maxdate"
color="#1989fa"
/>
<van-button
style="height: var(--van-tabbar-height); width: var(--van-sidebar-width)"
class="main_one_btn_item"
size="large"
type="primary"
@click="nextWeek"
>下周</van-button
>
</div>
</template>
<script>
// import HelloWorld from "@/components/HelloWorld.vue";
import { reactive, onMounted, toRefs } from "vue";
import { formatDate } from "@/utils/time";
import { ref, computed, watch } from "vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
import { getrecipeslist } from "@/service/home";
import { Toast } from "vant";
export default {
name: "PersonInfo",
setup() {
const state = reactive({
studentName: "", //学生姓名
idcard: "", // 身份证号
parentName: "1", //家长姓名
parentId: "", //家长Id
telephone: "", //手机号
breakfast: "包子", //早餐
dessertAfterBreakfast: "回头草", //早点
lunch: "馒头", //午餐
dessertAfterLunch: "蛋糕", //午点
dinner: "饿了吗", //晚餐
mindate: new Date(2021, 0, 1),
maxdate: new Date(2031, 0, 1),
msg: "",
list: [],
foodList: [],
});
const startdata = ref("");
const enddata = ref("");
const food = ref(true);
const router = useRouter();
const store = useStore();
const show = ref(false); //展示日期
const date = ref(""); //选择日期
const active = ref(new Date().getDay() - 1);
watch(active, async (newactive, oldactive) => {
let data = new Date(date.value);
date.value = formatDate(
new Date(data.setDate(data.getDate() + newactive - oldactive))
);
let nowdate = date.value;
let nowfood = state.foodList.find(({ date }) => {
return date == nowdate;
});
if (nowfood) {
food.value = true;
state.breakfast = nowfood.breakfast;
state.dessertAfterBreakfast = nowfood.dessertAfterBreakfast;
state.lunch = nowfood.lunch;
state.dessertAfterLunch = nowfood.dessertAfterLunch;
state.dinner = nowfood.dinner;
} else {
food.value = false;
}
});
const onChange = (index) => {
let dateweek = new Date(date.value).getDay();
let deweek = active.value - dateweek;
date.value = formatDate(new Date(data.setDate(data.getDate() + deweek)));
};
const loadData = async () => {
console.log("加载数据");
};
onMounted(async () => {
loadData();
initDate();
getEveryDayFood();
});
const initDate = () => {
/* 初始化日期 */
let mydate = new Date();
date.value = formatDate(mydate);
};
const Appendzero = (obj) => {
/* 月日 一位数补零 1 到01 */
if (obj < 10) return "0" + obj;
else return obj;
};
const formatDate = (date) => {
/* 格式化日期 */
// `${date.getYear()}-${date.getMonth() + 1}-${date.getDate()}`;
let y = date.getFullYear();
let m = Appendzero(date.getMonth() + 1);
let d = Appendzero(date.getDate());
return y + "-" + m + "-" + d;
};
const onConfirm = (value) => {
show.value = false;
let week = value.getDay();
// if (week == 0 || week == 6) {
// Toast(`没有食谱`);
// return;
// } else {
date.value = formatDate(value);
active.value = week;
// }
getEveryDayFood();
};
const getEveryDayFood = async () => {
getweek();
/* 初始化数据 */
let day = date.value;
//访问后台接口
let result = await getrecipeslist(startdata.value, enddata.value);
if (result.code == 200) {
state.foodList = result.data;
} else if (result.code == 500) {
Toast("获取信息失败!");
return;
}
};
const goback = () => {
router.push({
path: "/main",
query: {},
});
};
const getweek = () => {
let data = new Date(date.value);
let weeknumbr;
enddata.value = formatDate(
new Date(
new Date(date.value).setDate(data.getDate() - active.value + 6)
)
);
startdata.value = formatDate(
new Date(
new Date(date.value).setDate(data.getDate() - active.value + 0)
)
);
};
/* 上周 */
const lastWeek = () => {
let data = new Date(date.value);
date.value = formatDate(new Date(data.setDate(data.getDate() - 7)));
getEveryDayFood();
};
/* 下周 */
const nextWeek = () => {
let data = new Date(date.value);
date.value = formatDate(new Date(data.setDate(data.getDate() + 7)));
getEveryDayFood();
};
const setactive = () => {
let week = new Date(date.value).getDay();
active.value = week;
};
return {
...toRefs(state),
state,
router,
store,
show,
date,
onConfirm,
goback,
active,
onChange,
lastWeek,
nextWeek,
food,
};
},
};
</script>
<style scoped lang="less">
.food {
// position: absolute;
// left: 50%;
// transform: translateX(-50%);
}
.van-sidebar-item--select:before {
background-color: var(--van-primary-color);
}
.van-sidebar-item--select {
color: var(--van-primary-color);
// font-weight: var(--van-sidebar-selected-font-weight);
}
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background: var(--van-sidebar-background-color);
display: flex;
height: -webkit-fill-available;
}
.m_top {
height: 40vw;
position: relative;
}
.fotter {
position: fixed;
bottom: 0;
left: 0;
z-index: var(--van-tabbar-z-index);
display: flex;
box-sizing: content-box;
width: 100%;
height: var(--van-tabbar-height);
background: var(--van-tabbar-background-color);
}
.main {
width: 0;
flex: 1;
height: auto;
line-height: 20px;
// border-radius: 50px 50px 70px 70px;
background-color: rgba(255, 199, 0, 100);
font-size: 14px;
padding-right: var(--van-sidebar-width);
text-align: center;
background: #fff;
.main_food {
width: 100%;
height: auto;
.main_food_one {
height: 20vw;
position: relative;
margin-bottom: 2vw;
.main_food_one_r1 {
display: inline-block;
width: 20vw;
height: 20vw;
}
.main_food_one_r2 {
display: inline-block;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: 20vw;
.r2_text1 {
height: 18px;
color: rgba(16, 16, 16, 100);
font-size: 16px;
text-align: left;
font-family: PingFangSC-regular;
}
.r2_text2 {
height: 20px;
color: rgba(153, 153, 153, 100);
font-size: 14px;
text-align: left;
font-family: PingFangSC-regular;
margin-block-start: 0em;
margin-block-end: 0em;
}
}
}
}
}
</style>
<style>
.van-button__content {
width: var(--van-sidebar-width);
}
.van-sidebar-item {
height: 22vw;
line-height: 12vw;
}
</style>
<template>
<van-nav-bar
title="消息通知"
left-text="返回"
left-arrow
@click-left="goback"
/>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list v-model:loading="loading" :finished="finished" @load="onLoad">
<div
@click="goMessageDetail(item)"
class="c_main_list"
v-for="item in list"
:key="item"
>
<div
style="
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 15px;
"
>
{{ item.title }}
</div>
<div class="van-multi-ellipsis--l2" style="line-height: unset">
<div
class="m_msg_list_one_row_2 van-multi-ellipsis--l2"
style="
line-height: unset;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
"
v-html="item.content"
></div>
</div>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
"
class="Regular3"
>
<!-- <span style="margin-right: 10px">{{ item.createBy }}</span> -->
<span>{{ item.createTime }}</span>
<span>{{ item.status == "0" ? "未读" : "已读" }}</span>
</div>
</div>
</van-list>
</van-pull-refresh>
</template>
<script>
export default {
name: "Home",
};
</script>
<script setup>
import { reactive, onMounted, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import { getparentPushList, getteacherPushList } from "@/service/home";
import { useStore } from "vuex";
import { Toast } from "vant";
const state = reactive({
msgList: [], // 消息列表
msg: "",
list: [],
});
const router = useRouter();
const store = useStore();
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
const refreshing = ref(false);
const pageNum = ref(0);
const type = store.state.userLoginType;
const onLoad = async () => {
if (refreshing.value) {
list.value = [];
pageNum.value = 0;
refreshing.value = false;
}
pageNum.value += 1;
let result;
console.log(store.state.userLoginType);
// loading.value = true;
if (store.state.userLoginType == 1) {
result = await getparentPushList({
pageNum: pageNum.value,
pageSize: 10,
});
if (result.code == 200) {
list.value.push(...result.rows);
console.log(list.value);
loading.value = false;
list.value.length === result.total && (finished.value = true);
} else {
Toast("获取信息失败!");
loading.value = false;
return;
}
} else if (store.state.userLoginType == 0) {
result = await getteacherPushList({
pageNum: pageNum.value,
pageSize: 10,
});
if (result.code == 200) {
list.value.push(...result.rows);
console.log(list.value);
loading.value = false;
list.value.length === result.total && (finished.value = true);
} else {
Toast("获取信息失败!");
loading.value = false;
return;
}
}
};
const onRefresh = () => {
// 清空列表数据
finished.value = false;
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
loading.value = true;
onLoad();
};
const loadData = async () => {
console.log("加载数据");
};
onMounted(async () => {
loadData();
// onInitData();
});
/* 自定义方法 */
const onInitData = async () => {
/* 初始化数据 */
let type = store.state.userLoginType;
state.typ = type;
let studentId = store.state.studentId;
//访问后台接口
// //访问后台接口
// let result = await messagepushList(id, type, studentId);
// if (result.code == 200) {
// let getData = result.data;
// //获取返回信息
// state.msgList = getData;
// } else if (result.code == 500) {
// Toast("获取信息失败!");
// return;
// }
};
const goMessageDetail = (msgone) => {
console.log(msgone);
/* 跳转详情页 */
router.push({
path: "/messageNoticeDetail",
query: {
msgid: msgone.id,
msgstatus: msgone.status,
},
});
};
const goback = () => {
router.push({
path: "/main",
query: {},
});
};
</script>
<style scoped lang="less">
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background-color: #fff;
}
.m_top {
height: 40vw;
position: relative;
padding-top: 4vw;
padding-bottom: 8vw;
padding-left: 3vw;
padding-right: 3vw;
}
.main {
.theIconGrid .van-image {
width: 15vw;
}
.theIconGrid span {
font-size: 13px;
}
}
.m_msg_list {
width: 100vw;
height: auto;
padding-top: 5vw;
padding-bottom: 5vw;
.m_msg_list_one {
padding: 3vw 3vw 3vw 3vw;
margin-left: 5vw;
margin-right: 5vw;
margin-top: 5vw;
width: 85vw;
// height: 21vw;
line-height: 0.56rem;
border-radius: 0.16rem;
text-align: center;
border-radius: 0.26667rem;
background-color: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
.m_msg_list_one_row_1 {
// position: relative;
// left: 10vw;
// top: 10px;
// width: 80%;
// height: 30px;
// text-align: left !important;
line-height: 30px;
// border-radius: 8px 8px 0px 0px;
background-color: rgba(255, 255, 255, 100);
width: 100%;
text-align: center;
font-weight: bolder;
display: flex;
align-items: center;
.vanta_image {
width: 6%;
}
span {
margin-left: 6px;
}
}
.m_msg_list_one_row_2 {
color: rgba(153, 153, 153, 100);
font-size: 14px;
line-height: 14px;
text-align: left;
}
.m_msg_list_one_row_3 {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
position: relative;
margin-top: 14px;
.span_left {
position: relative;
color: rgba(61, 70, 85, 100);
font-size: 14px;
text-align: right;
font-family: FangSong;
}
.span_right {
position: relative;
float: right;
color: rgba(153, 153, 153, 100);
font-size: 13px;
text-align: left;
font-family: FangSong;
}
}
}
}
.m_msg_list_one_row_2 {
position: relative;
// top: 14px;
font-size: 14px;
line-height: 14px;
text-align: left;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
display: -webkit-box; //将对象作为弹性伸缩盒子模型显示。
-webkit-box-orient: vertical; //从上到下垂直排列子元素(设置伸缩盒子的子元素排列方式)
-webkit-line-clamp: 2; //这个属性需要同上面两个属性一起使用,表示显示的行数。
display: flex;
align-items: center;
font-family: PingFang SC;
color: #6f787d;
font-size: 12px;
}
</style>
<template>
<van-nav-bar
title="消息通知"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div class="m_msg_list">
<div class="m_msg_list_one">
<div class="m_msg_list_one_row_1">
<span> {{ msg.title }} </span>
</div>
<div class="">
<p style="line-height: unset" class="Regular1" v-html="msg.content"></p>
</div>
<div
class="Regular1"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<span class="">{{ msg.createBy }} </span>
<span class=""> {{ msg.createTime }} </span>
</div>
</div>
</div>
<!-- </div> -->
</template>
<script>
// import HelloWorld from "@/components/HelloWorld.vue";
import { reactive, onMounted, toRefs } from "vue";
import { useRouter, useRoute } from "vue-router";
import { messageinfo, messageinfoteac, changeStatus } from "@/service/home";
import { useStore } from "vuex";
import { Toast } from "vant";
export default {
name: "Home",
setup() {
const state = reactive({
msg: "",
msgList: [
{
id: 1,
title: "库萨法的撒娇哭了返回拉萨",
content:
"<p>slkfj;as;lf<p>首先得先来介绍一下Proxy这个强大的API:在Vue3中使用Proxy对象来代替 Vue 2 中基于 Object.defineProperty,消除了 Vue 2 中基于 Object.defineProperty 所存在的一些局限,比如无法监听数组索引,length属性等等在Proxy中默",
create_time: "2022-12-10",
create_by: "as;阿警方",
},
], // 消息列表
msgid: "", //消息id
msg: "",
msgstatus: "",
list: [],
});
const router = useRouter();
const route = useRoute();
const store = useStore();
const { msgid, msgstatus } = route.query; // 接收参数
state.msgid = msgid;
state.msgstatus = msgstatus;
// state.msgList = msgList;
const loadData = async () => {
console.log("加载数据");
state.msgid = msgid;
};
onMounted(async () => {
loadData();
onInitData();
});
/* 自定义方法 */
const onInitData = async () => {
/* 初始化数据 */
let type = store.state.userLoginType;
let studentId = store.state.studentId;
//访问后台接口
if (store.state.userLoginType == 1) {
let result = await messageinfo(state.msgid);
if (result.code == 200) {
let getData = result.data;
getData.content = getData.content
.replace(getData.content ? /&(?!#?\w+;)/g : /&/g, "&amp;")
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&#39;/g, "'")
.replace(/&amp;nbsp;/g, "\u3000");
//获取返回信息
state.msg = getData;
if (msgstatus == "0") {
changeStatus(state.msgid);
}
} else if (result.code == 500) {
Toast("获取信息失败!");
return;
}
}
if (store.state.userLoginType == 0) {
let result = await messageinfoteac(state.msgid);
if (result.code == 200) {
let getData = result.data;
getData.content = getData.content
.replace(getData.content ? /&(?!#?\w+;)/g : /&/g, "&amp;")
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&#39;/g, "'")
.replace(/&amp;nbsp;/g, "\u3000");
//获取返回信息
if (msgstatus == "0") {
changeStatus(state.msgid);
}
state.msg = getData;
} else if (result.code == 500) {
Toast("获取信息失败!");
return;
}
}
};
const goback = () => {
router.go(-1);
};
const gobackMessageList = () => {
router.push({
path: "/messageNotice",
query: {},
});
};
return {
...toRefs(state),
router,
route,
goback,
gobackMessageList,
};
},
};
</script>
<style scoped lang="less">
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background-color: #fff;
}
.m_top {
height: 40vw;
position: relative;
padding-top: 4vw;
padding-bottom: 8vw;
padding-left: 3vw;
padding-right: 3vw;
}
.main {
.theIconGrid .van-image {
width: 15vw;
}
.theIconGrid span {
font-size: 13px;
}
}
.m_msg_list {
margin: 5vw;
background: #fff;
.m_msg_list_one {
padding: 5vw;
// display: flex;
// align-items: center;
// flex-direction: column;
// font-size: 14px;
// font-family: Arial;
// text-align: center;
// line-height: 20px;
// background-color: #fff;
// margin-bottom: 4vw;
// padding-bottom: 15vw;
// min-height: 80vh;
.m_msg_list_one_row_1 {
position: relative;
text-align: center !important;
line-height: 30px;
border-radius: 8px 8px 0px 0px;
background-color: rgba(255, 255, 255, 100);
text-align: center;
font-weight: bolder;
.van-image {
margin-bottom: -4px;
}
span {
margin-left: 6px;
}
}
.m_msg_list_one_row_2 {
position: relative;
top: 14px;
height: auto;
color: rgba(153, 153, 153, 100);
font-size: 13px;
text-align: left;
// overflow: hidden; //超出的文本隐藏
// text-overflow: ellipsis; //溢出用省略号显示
// display: -webkit-box; //将对象作为弹性伸缩盒子模型显示。
// -webkit-box-orient: vertical; //从上到下垂直排列子元素(设置伸缩盒子的子元素排列方式)
// -webkit-line-clamp: 2; //这个属性需要同上面两个属性一起使用,表示显示的行数。
}
.m_msg_list_one_row_3 {
position: relative;
top: 10vw;
left: 10vw;
width: 80%;
height: 20px;
text-align: left !important;
.span_left {
position: relative;
color: rgba(61, 70, 85, 100);
font-size: 14px;
text-align: right;
font-family: FangSong;
}
.span_right {
position: relative;
float: right;
color: rgba(153, 153, 153, 100);
font-size: 13px;
text-align: left;
font-family: FangSong;
}
}
}
}
</style>
<template>
<van-nav-bar
title="场地申请"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div class="">
<div class="main">
<van-form @submit="onSubmit">
<van-cell-group>
<van-field
name="startTime"
label="开始时间"
v-model="state.startTime"
@click="state.startTimeShow = true"
placeholder="请选择时间"
:rules="[{ required: true, message: '请选择时间' }]"
/>
<van-calendar
v-model:show="state.startTimeShow"
@confirm="onConfirm1"
:show-confirm="false"
color="#1989fa"
/>
<van-field
label="结束时间"
name="endTime"
v-model="state.endTime"
@click="state.endTimeShow = true"
placeholder="请选择时间"
:rules="[{ required: true, message: '请选择时间' }]"
/>
<van-calendar
v-model:show="state.endTimeShow"
@confirm="onConfirm2"
:show-confirm="false"
color="#1989fa"
/>
<van-field
name="type"
v-model="state.area"
is-link
label="场所"
placeholder="点击选择场所"
@click="showPickerArea = true"
:rules="[{ required: true, message: '请选择场所' }]"
/>
<van-field
name="type"
v-model="state.areaNo"
is-link
label="房间号"
placeholder="点击选择房间号"
@click="showPickerAreaNo = true"
:rules="[{ required: true, message: '请选择房间号' }]"
/>
<van-field
name="handUserId"
is-link
placeholder="点击选择审核人"
label="审核人"
v-model="state.handUsername"
@click="goseachName"
:rules="[{ required: true, message: '请选择审核人' }]"
/>
<van-popup v-model:show="showPickerArea" position="bottom">
<van-picker
:columns="columns"
@confirm="onConfirmty"
@cancel="showPickerArea = false"
/>
</van-popup>
<van-popup v-model:show="showPickerAreaNo" position="bottom">
<van-picker
:columns="columnsNo"
@confirm="onConfirmtyNo"
@cancel="showPickerAreaNo = false"
/>
</van-popup>
<van-field
name="reason"
label="原因"
v-model="state.leaveReason"
rows="2"
autosize
type="textarea"
placeholder="请输入原因"
:rules="[{ required: true, message: '请输入原因' }]"
/>
</van-cell-group>
<div class="main_one_btn">
<van-button
round
type="primary"
size="large"
native-type="submit"
>提交</van-button
>&nbsp;&nbsp;
</div>
</van-form>
</div>
</div>
</template>
<script setup>
import { onMounted, ref } from "vue";
import { Dialog } from "vant";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
// import { getleavtyp } from "@/service/home";
import { getTotyp } from "@/utils/auth";
const state = ref({
leaveReason: "", //请假原因
startTime: "", //开始时间
endTime: "", //结束时间
startTimeShow: false, //开始时间选择显示
endTimeShow: false, //开始时间选择显示
msg: "",
list: [],
area: "",
areaNo:"",
typeid: "",
});
const router = useRouter();
const store = useStore();
const columns = ref([]);
const columnsNo = ref([]);
const loadData = async () => {
// let result = await getleavtyp();
// if (result.code == 200) {
// result.data.forEach((element) => {
// columns.value.push({ text: element.dictLabel, value: element.dictValue });
// });
// console.log(result.data)
// }
columns.value = [{ text: '操场', value: 0 },{ text: '四教', value: 1 },{ text: '主教', value: 2 }];
columnsNo.value = [{ text: '520', value: 0 },{ text: '116', value: 1 }];
console.log("加载数据");
if (getTotyp() == 1) state.value.teacherShow = false;
else state.value.teacherShow = true;
if (store.state.Apply) {
state.value = store.state.Apply;
}
};
onMounted(async () => {
console.log("3- 组件挂在完毕执行 --- onMounted");
loadData();
});
const showPicker = ref(false);
const showPickerArea = ref(false);
const showPickerAreaNo = ref(false);
const onConfirmty = (value) => {
state.value.area = value.text;
state.value.typeid = value.value;
showPickerArea.value = false;
};
const onConfirmtyNo = (value) => {
state.value.areaNo = value.text;
state.value.typeid = value.value;
showPickerAreaNo.value = false;
};
const formatDate = (date) => {
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
// var currentDate = date.getFullYear() + '-' + month + '-' + strDate + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
var currentDate = date.getFullYear() + "-" + month + "-" + strDate;
return currentDate;
};
const onConfirm1 = (value) => {
state.value.startTimeShow = false;
state.value.startTime = formatDate(value);
if (state.value.endTime != "" && state.value.endTime != undefined) {
let r = onCalculationInterval(state.value.startTime, state.value.endTime);
state.value.totalTime = r;
}
};
const onConfirm2 = (value) => {
state.value.endTimeShow = false;
state.value.endTime = formatDate(value);
if (state.value.startTime != "" && state.value.startTime != undefined) {
let r = onCalculationInterval(state.value.startTime, state.value.endTime);
state.value.totalTime = r;
}
};
const onCalculationInterval = (date1, date2) => {
/* 计算两个时间的时间间隔 */
let startTime = new Date(date1); // 开始时间
let endTime = new Date(date2); // 结束时间
let r = (endTime - startTime) / 1000;
state.value.totalTimeText =
Math.floor((endTime - startTime) / 1000 / 60 / 60 / 24 + 1) + "天";
return r;
};
const onSubmit = async () => {
console.log("s");
Dialog.confirm({
title: "场地",
message: "申请成功",
}).then(() => {
goback();
}).catch(() => {});
};
const goback = () => {
router.back();
};
const goseachName = () => {
store.commit("editApply", state.value);
router.push({
path: "/seachName",
query: {},
});
};
const goLeave = (g) => {
router.back();
};
</script>
<style scoped lang="less">
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background-color: rgb(230, 230, 230);
}
.m_top {
height: 40vw;
position: relative;
}
.main {
padding-top: 5vw;
width: 100vw;
height: auto !important;
min-height: 80vh;
line-height: 20px;
border-radius: 50px 50px 70px 70px;
// background-color: rgba(255, 199, 0, 100);
font-size: 14px;
text-align: center;
padding-bottom: 15vw;
.main_search {
width: 98vw;
height: 15vw;
.main_search_1 {
width: 45vw;
height: 14vw;
display: inline-block;
vertical-align: top;
border: yellow 2px;
}
.main_search_2 {
width: 45vw;
height: 14vw;
display: inline-block;
vertical-align: top;
}
}
.main_list_one {
// margin-left: 5vw;
margin-top: 5vw;
width: 100vw;
height: 20vw;
line-height: 20px;
// border-radius: 6px;
background-color: rgb(255, 255, 255);
text-align: center;
// border: 1px solid rgba(9, 208, 178, 100);
.main_list_one_left_1 {
display: inline-block;
margin-top: 2vw;
width: 15vw;
height: 15vw;
border-radius: 50px;
// border: 1px solid rgba(187, 187, 187, 100);
vertical-align: top;
}
.main_list_one_left_2 {
display: inline-block;
padding-left: 5vw;
width: 70vw;
position: relative;
top: 2vw;
vertical-align: top;
.left_2_1 {
width: 75vw;
height: 22px;
color: rgba(28, 28, 28, 100);
font-size: 15px;
text-align: left;
font-family: Microsoft YaHei;
.left_2_1_1 {
display: inline-block;
width: 60%;
}
.left_2_1_2 {
display: inline-block;
width: 40%;
color: rgb(145, 141, 141);
text-align: left;
font-size: 10px;
font-family: Microsoft YaHei;
float: right;
}
}
.left_2_2 {
width: 60vw;
height: 22px;
color: rgb(145, 141, 141);
text-align: left;
font-size: 12px;
font-family: Microsoft YaHei;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.main_one_btn {
width: 80vw;
height: auto;
position: relative;
top: 3vh;
line-height: 20px;
// border-radius: 0px 0px 26px 26px;
text-align: center;
padding-left: 10vw;
padding-bottom: 10vw;
}
}
</style>
<template>
<van-nav-bar
title="场地申请详情"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div style="margin-top: 10px">
<van-cell-group>
<van-cell title="申请时间" :value="detail.applyTime" />
<van-cell title="场所" :value="detail.area" />
<van-cell title="房间号" :value="detail.areaDetail" />
<van-cell title="开始时间" :value="detail.startTime" />
<van-cell title="结束时间" :value="detail.endTime" />
<van-cell title="审核人" :value="detail.handuserName" />
<van-cell title="状态" :value="detail.state" />
</van-cell-group>
</div>
</template>
<script setup>
import {onMounted, reactive} from "vue";
import {useRoute,useRouter} from "vue-router/dist/vue-router";
const route = useRoute();
const router = useRouter();
// const detail = reactive({
// applyTime:'2022-11-10',
// area:'校内食堂'
// })
const detail = reactive(JSON.parse(route.query.applyDetail))
onMounted(async () => {
// this.detail = route.query.applyDetail
console.log("3- 组件挂在完毕执行 --- onMounted",detail);
});
const goback = () => {
router.back();
};
</script>
<style scoped lang="less">
.main_one_btn {
width: 80vw;
height: auto;
position: relative;
top: 3vh;
line-height: 20px;
// border-radius: 0px 0px 26px 26px;
text-align: center;
padding-left: 10vw;
padding-bottom: 10vw;
}
</style>
<template>
<van-nav-bar
title="场地申请"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div class="main_search">
<div class="main_search_2">
<van-config-provider :theme-vars="themeVars">
<van-dropdown-menu
class="main_search_2_cd"
active-color="#1989fa"
overlay="false"
>
<van-dropdown-item
v-model="state.optionId"
:options="option"
@change="changeGradeId()"
/>
</van-dropdown-menu>
</van-config-provider>
</div>
<div class="main_search_1">
<van-search
v-model="areaNum"
@search="onGetGradeList"
shape="round"
background="#ffffff"
placeholder="搜索"
/>
</div>
</div>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div
@click="goDetails(item)"
class="c_main_list"
v-for="item in list"
:key="item"
>
<div>
<div style="font-size: medium; text-align: start; margin-top: 10px">
申请时间:{{ item.applyTime }}
</div>
<div class="Regular1" style="margin-top: 10px">
场所:{{ item.area }}
</div>
<div class="Regular1" style="margin-top: 10px">
房间号:{{ item.areaDetail }}
</div>
<div class="Regular1" style="margin-top: 10px">
开始时间:{{ item.startTime }}
</div>
<div class="Regular1" style="margin-top: 10px">
结束时间:{{ item.endTime }}
</div>
<div class="flex_be Regular1" style="margin-top: 10px">
<div>审核人:{{ item.handuserName }}</div>
<div>{{ item.state }}</div>
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
<van-icon
style="position: fixed; bottom: 40px; right: 0px"
@click="goApply"
class="icon"
color="#1989fa"
name="add"
size="20vw"
/>
</template>
<script setup>
// import {useStore} from "vuex";
import {useRouter} from "vue-router/dist/vue-router";
import { reactive, ref} from "vue";
import { useStore } from "vuex";
const store = useStore();
const router = useRouter();
const state = reactive({
searchText: "",
typeId: "",
optionId: 0,
});
// const getStateValue = computed((state) => {
// return state == 0 ? "通过" : "驳回";
// });
const refreshing = ref(true);
const areaNum = ref('')
const option = [{ text: "开始时间", value: 0 },{text:"结束时间",value:1}];
const loading = ref();
const list = ref([
{
area:'校内一食堂',
areaDetail:'505',
applyTime: "2020-12-10",
startTime:'2021-11-10 8:00',
endTime:'2021-11-10 11:00',
handuserName:'我',
state: "驳回", //状态(0通过,1驳回)
},{
area:'四教',
areaDetail:'303',
applyTime: "2020-12-10",
startTime:'2021-11-10 8:00',
endTime:'2021-11-10 11:00',
handuserName:'我',
state: "通过", //状态(0通过,1驳回)
}
]);
const goDetails = (item) => {
router.push({
path: "/areaDetail",
query: {
applyDetail: JSON.stringify(item),
},
});
};
const finished = ref(true);
const goback = () => {
router.back();
};
const goApply = () => {
store.commit("editApply", "");
router.push({
path: "/areaApply",
query: {},
});
};
</script>
<style lang="less" scoped>
::v-deep .van-dropdown-menu__bar {
box-shadow: none !important;
}
.main_search {
width: 100vw;
height: 15vw;
display: flex;
align-items: center;
background: white;
.main_search_1 {
flex: 1;
height: 15vw;
display: inline-block;
vertical-align: top;
}
.van-dropdown-menu:root {
--van-dropdown-menu-box-shadow: none;
}
.main_search_2 {
height: 15vw;
display: flex;
align-items: center;
}
}
</style>
<template>
<!-- <van-nav-bar
title="信息采集"
left-text="返回"
left-arrow
@click-left="goback"
/> -->
<div style="padding: 15px">
<van-form @submit="onSubmit">
<van-cell-group inset style="background: GhostWhite">
<van-field
style="margin-bottom: 15px; border-radius: 996px"
:left-icon="require('@/assets/sfz.png')"
label-align="left"
v-model="schoolInfoDetail.idCard"
name="身份证号"
placeholder="请输入身份证号"
:rules="[{ required: true, message: '请输入身份证号' }]"
/>
<van-field
style="margin-bottom: 15px; border-radius: 996px"
:left-icon="require('@/assets/bh.png')"
v-model="schoolInfoDetail.schoolNo"
name="注册序号"
placeholder="请输入注册序号"
:rules="[{ required: true, message: '请输入注册序号' }]"
/>
<van-field
style="margin-bottom: 15px; border-radius: 996px"
:left-icon="require('@/assets/xm.png')"
v-model="schoolInfoDetail.studentName"
name="姓名"
placeholder="请输入姓名"
:rules="[{ required: true, message: '请输入姓名' }]"
/>
</van-cell-group>
<div style="margin: 16px">
<van-button round block type="primary" native-type="submit">
确认修改
</van-button>
</div>
</van-form>
</div>
</template>
<script setup>
import { ref, toRefs, computed, reactive, onMounted } from "vue";
import { useRouter } from "vue-router";
import { getmatch, getAcquisitionList } from "@/service/home";
import { Toast } from "vant";
import axios from "axios";
import {
storetyprelationshiptyp,
storetyppoliticstatus,
storetypregisttype,
storetypstudentnature
} from "@/service/dir";
import { useStore } from "vuex";
import { formatDatetime, formatDate } from "@/utils/time.js";
const store = useStore();
const router = useRouter();
onMounted(async () => {
storetyprelationshiptyp();
storetyppoliticstatus();
storetypregisttype();
storetypstudentnature();
});
const schoolInfoDetail = ref({
idCard: "",
schoolNo: "",
studentName: "",
});
const onSubmit = async () => {
let result = await getmatch(schoolInfoDetail.value);
console.log(result);
if (result.code == 200) {
var ids = [];
store.commit("editschoolInfoDetail", result.data);
for (let index = 0; index < result.data.length; index++) {
const element = result.data[index];
ids.push(element.infoId);
}
console.log(ids);
let result2 = await getAcquisitionList(ids);
let list = result2.rows;
router.push({
path: "/InforColl",
query: {
list: encodeURIComponent(JSON.stringify(list)),
},
});
} else {
Toast.fail("无匹配到的信息,无法维护");
}
};
const goback = () => {
router.back();
};
</script>
<style lang="less" scoped>
::v-deep .van-icon__image {
width: 20px;
height: 20px;
}
</style>
<template>
<van-nav-bar
title="信息采集"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div style="padding: 15px">
<div v-for="item in list">
<div v-if="item.infoType == '1'" style="position: relative">
<img
@click="goapply(item.id)"
style="border-radius: 20px"
:src="require('@/assets/cjxx.jpg')"
/>
<img />
<div
style="
position: absolute;
top: 50%;
transform: translateY(-50%) translateX(37%);
color: white;
"
>
{{ item.infoName }}
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, toRefs, computed, reactive, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { getschoolXxfb } from "@/service/home";
import { storetyprelationshiptyp } from "@/service/dir";
import { Toast } from "vant";
import axios from "axios";
import { useStore } from "vuex";
import { formatDatetime, formatDate } from "@/utils/time.js";
const store = useStore();
const route = useRoute();
const router = useRouter();
const list = JSON.parse(decodeURIComponent(route.query.list));
// onMounted(async () => {
// storetyprelationshiptyp();
// });
const goapply = (id) => {
console.log(id);
let schoolInfoDetail = store.getters.getAcquisitionListbyid(id);
router.push({
path: "/InforCollapply",
query: {
detail: encodeURIComponent(JSON.stringify(schoolInfoDetail)),
},
});
};
const goback = () => {
router.back();
};
</script>
<template>
<div>
<van-nav-bar
title="请假详情"
left-text="返回"
left-arrow
@click-left="routeBack"
/>
<van-image
width="100%"
fit="contain"
src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
/>
<van-field
label="标题"
v-model="leaveForm.title"
rows="1"
autosize
type="textarea"
placeholder="请输入标题"
:rules="[{ required: true, message: '请输入标题' }]"
/>
<van-field
label="开始时间"
v-model="leaveForm.startTime"
placeholder="请选择时间"
:rules="[{ required: true, message: '请选择时间' }]"
/>
<van-field
label="结束时间"
v-model="leaveForm.endTime"
placeholder="请选择时间"
:rules="[{ required: true, message: '请选择时间' }]"
/>
<van-field
v-model="leaveForm.type"
is-link
readonly
name="picker"
label="请假类型"
placeholder="点击选择类型"
:rules="[{ required: true, message: '请选择类型' }]"
/>
<van-field
is-link
placeholder="点击选择审核人"
label="审核人"
v-model="leaveForm.handUsername"
readonly
:rules="[{ required: true, message: '请选择审核人' }]"
/>
<van-field
label="请假原因"
v-model="leaveForm.leaveReason"
rows="1"
autosize
type="textarea"
placeholder="请输入请假原因"
:rules="[{ required: true, message: '请输入请假原因' }]"
/>
</div>
</template>
<script setup name="LeaveProcess">
import useRouteBack from "@/hooks/useRouteBack";
import { reactive } from 'vue';
// 路由回退
const routeBack = useRouteBack();
// 详情表单
const leaveForm = reactive({});
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div class="main">
<van-nav-bar
title="教师信息"
left-text="返回"
left-arrow
@click-left="goback"
/>
<!-- <div class="m_top">
<van-dropdown-menu>
<van-dropdown-item v-model="state.gradeId" :options="state.gradeList" @change="changeGradeId"/>
</van-dropdown-menu>
<van-search v-model="state.curriculum" @search="onGetTeacher" shape="round" background="#4ab9a8" placeholder="请输入姓名" />
</div> -->
<!-- <van-list
v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell v-for="item in list" :key="item" :title="item" />
</van-list> -->
<div class="main_list">
<div v-for="item in teacherList" :key="item.id">
<div class="main_list_one">
<div class="left">
{{ item.teacherName + "(" + item.courseName + ")" }}
</div>
<a :href="'tel:' + item.teacherTel" class="right">{{
item.teacherTel
}}</a>
</div>
</div>
<van-empty v-show="!teacherList.length" description="暂无信息" />
</div>
</div>
</template>
<script>
// import HelloWorld from "@/components/HelloWorld.vue";
import { reactive, onMounted, toRefs } from "vue";
import { useRouter } from "vue-router";
import { getTeacherlistp, getTeachers } from "@/service/home";
import { Toast } from "vant";
import { useStore } from "vuex";
export default {
name: "Home",
setup() {
const store = useStore();
const state = reactive({
msgList: [], // 消息列表
teacherList: [
{
teather_name: "礼拜",
teacher_tel: 12346,
},
{
teather_name: "礼拜",
teacher_tel: 12346,
},
{
teather_name: "礼拜",
teacher_tel: 12346,
},
], // 教师列表
teacher: {}, // 教师
gradeList: [], // 班级列表
gradeId: 0, //选中班级
curriculum: "", //搜索框输入 教师姓名检索条件
msg: "",
list: [],
});
const router = useRouter();
const loadData = async () => {
console.log("加载数据");
onGetTeacher();
};
onMounted(async () => {
loadData();
});
/* 自定义方法 */
// eslint-disable-next-line no-unused-vars
const onInitGradeData = async () => {
/* 初始化数据 */
let shoolYear = "";
let gradeValue = "";
let classValue = "";
let teatherName = "";
let childrenName = "";
//访问后台接口
let result = await classeslist(
shoolYear,
gradeValue,
classValue,
teatherName,
childrenName
);
if (result.code == 200) {
let getData = result.data;
let rtnData = [];
//班级数据转为需要的 下拉框格式
let gone = { text: "请选择班级", value: 0 };
rtnData.push(gone);
//获取返回信息
for (let tmp in getData) {
let text1 = getData[tmp].grade_name + " " + getData[tmp].class_name;
let value1 = getData[tmp].id;
let gone = { text: text1, value: value1 };
rtnData.push(gone);
}
state.gradeList = rtnData;
} else if (result.code == 500) {
Toast("获取信息失败!");
return;
}
};
const goMessageDetail = (msgone) => {
/* 跳转详情页 */
router.push({
path: "/messageNoticeDetail",
query: {
msgid: msgone.id,
},
});
};
const onGetTeacher = async () => {
//访问后台接口
let result = await getTeachers();
if (result.code == 200) {
console.log("aa");
let getData = result.data;
for (let index = 0; index < getData.length; index++) {
const element = getData[index];
getData[index].picUrl = store.state.imgUrl + getData[index].picUrl;
}
state.teacherList = getData;
// 循环 补全图片路径
} else {
Toast("获取教师信息失败!");
return;
}
};
const goback = () => {
router.push({
path: "/main",
query: {},
});
};
return {
...toRefs(state),
state,
router,
goback,
};
},
};
</script>
<style scoped lang="less">
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background-color: #fff;
}
.m_top {
background-color: #fff;
height: auto;
position: relative;
padding-top: 4vw;
padding-bottom: 2vw;
padding-left: 3vw;
padding-right: 3vw;
}
.main_list {
// background-color: #fff;
padding: 5vw;
.main_list_one {
height: auto;
line-height: 20px;
border-radius: 26px;
text-align: center;
margin-top: 5vw;
padding-bottom: 5vw;
position: relative;
border-radius: 10px;
background-color: rgba(255, 255, 255, 100);
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 5vw;
padding-left: 15px;
padding-right: 15px;
.main_list_one_left_1 {
display: inline-block;
width: 20vw;
height: 20vw;
border-radius: 50px;
// border: 1px solid rgba(187, 187, 187, 100);
vertical-align: top;
&_img {
margin-left: 5vw;
width: 20vw;
height: 20vw;
}
}
.main_list_one_left_2 {
display: inline-block;
padding-left: 10vw;
width: 60vw;
height: 20vw;
position: relative;
vertical-align: top;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
}
.left {
height: 21px;
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 15px;
}
.right {
height: 21px;
font-family: PingFang SC;
color: #6f787d;
font-size: 15px;
}
.m_msg_list {
width: 100vw;
height: auto;
padding-top: 5vw;
padding-bottom: 5vw;
.m_msg_list_one {
width: 100vw;
height: 120px;
font-size: 14px;
font-family: Arial;
text-align: center;
line-height: 20px;
background-color: #fff;
border-radius: 26px;
margin-bottom: 4vw;
.m_msg_list_one_row_1 {
position: relative;
left: 10vw;
top: 10px;
width: 80%;
height: 30px;
text-align: left !important;
line-height: 30px;
border-radius: 8px 8px 0px 0px;
background-color: rgba(255, 255, 255, 100);
text-align: center;
font-weight: bolder;
.van-image {
margin-bottom: -4px;
width: 20vw;
height: 20vw;
}
span {
margin-left: 6px;
}
}
.m_msg_list_one_row_2 {
position: relative;
left: 10vw;
top: 14px;
width: 80%;
height: 38px;
color: rgba(153, 153, 153, 100);
font-size: 13px;
text-align: left;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
display: -webkit-box; //将对象作为弹性伸缩盒子模型显示。
-webkit-box-orient: vertical; //从上到下垂直排列子元素(设置伸缩盒子的子元素排列方式)
-webkit-line-clamp: 2; //这个属性需要同上面两个属性一起使用,表示显示的行数。
}
.m_msg_list_one_row_3 {
position: relative;
top: 20px;
left: 10vw;
width: 80%;
height: 20px;
text-align: left !important;
.span_left {
position: relative;
color: rgba(61, 70, 85, 100);
font-size: 14px;
text-align: right;
font-family: FangSong;
}
.span_right {
position: relative;
float: right;
color: rgba(153, 153, 153, 100);
font-size: 13px;
text-align: left;
font-family: FangSong;
}
}
}
}
</style>
<template>
<van-nav-bar
title="成绩管理"
left-text="返回"
left-arrow
@click-left="goback"
/>
<el-table
align="center"
:data="tableData"
style="width: 100%; text-align: center"
>
<el-table-column
align="center"
style="text-align: center"
prop="subject"
label="科目"
/>
<el-table-column align="center" prop="score" label="分数" />
</el-table>
</template>
<script>
export default {
name: "Home",
};
</script>
<script setup>
import { onMounted, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import { getStudentScore } from "@/service/home";
import { Toast } from "vant";
const tableData = ref([]);
const router = useRouter();
const route = useRoute();
const exid = route.query.exid;
const loadData = async () => {
console.log("加载数据");
onInitData();
};
const inittabdata = (getData) => {
if (getData.chinese != null) {
tableData.value.push({
subject: "语文",
score: getData.chinese,
});
}
if (getData.math != null) {
tableData.value.push({
subject: "数学",
score: getData.math,
});
}
if (getData.english != null) {
tableData.value.push({
subject: "英语",
score: getData.english,
});
}
if (getData.history != null) {
tableData.value.push({
subject: "历史",
score: getData.history,
});
}
if (getData.politicalthought != null) {
tableData.value.push({
subject: "政治",
score: getData.politicalthought,
});
}
if (getData.geography != null) {
tableData.value.push({
subject: "地理",
score: getData.geography,
});
}
if (getData.chemistry != null) {
tableData.value.push({
subject: "化学",
score: getData.chemistry,
});
}
if (getData.physics != null) {
tableData.value.push({
subject: "物理",
score: getData.physics,
});
}
if (getData.biology != null) {
tableData.value.push({
subject: "生物",
score: getData.biology,
});
}
if (getData.sports != null) {
tableData.value.push({
subject: "体育",
score: getData.sports,
});
}
if (getData.painting != null) {
tableData.value.push({
subject: "美术",
score: getData.painting,
});
}
if (getData.music != null) {
tableData.value.push({
subject: "音乐",
score: getData.music,
});
}
if (getData.totalScore != null) {
tableData.value.push({
subject: "总分",
score: getData.totalScore,
});
}
};
onMounted(async () => {
loadData();
});
/* 自定义方法 */
const onInitData = async () => {
/* 初始化数据 */
//访问后台接口
let result = await getStudentScore(exid);
if (result.code == 200) {
let getData = result.data[0];
inittabdata(getData);
} else if (result.code == 500) {
Toast("获取信息失败!");
return;
}
};
const goback = () => {
router.push({
path: "/main",
query: {},
});
};
</script>
<style scoped lang="less"></style>
<template>
<div>
<van-nav-bar
title="请假详情"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div style="background: #f5f7f7; padding: 15px">
<div
style="
background: #ffffff;
border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
padding: 15px;
"
>
<div
style="
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 18px;
margin-bottom: 15px;
"
>
{{ detail.title }}
</div>
<div
style="
height: 20px;
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 14px;
margin-top: 10px;
"
>
联系方式:{{ detailinfo.parentTel }}
</div>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
"
>
<div class="detail_text">请假开始时间</div>
<div class="detail_text">
{{ getcourseNums(detailinfo.startTime, detailinfo.startSort) }}
</div>
</div>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
"
>
<div class="detail_text">请假结束时间</div>
<div class="detail_text">
{{ getcourseNums(detailinfo.endTime, detailinfo.endSort) }}
</div>
</div>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
"
>
<div class="detail_text">请假时长</div>
<div class="detail_text">{{ detailinfo.totalTime }}</div>
</div>
<div
style="
height: 20px;
font-family: PingFang SC;
color: #000000;
font-size: 14px;
margin-top: 15px;
"
>
请假事由:
</div>
<div
style="
margin-top: 15px;
font-family: PingFang SC;
font-weight: 700;
color: #6f787d;
font-size: 14px;
background: #f5f7f7;
min-height: 50px;
padding: 10px 15px;
text-align: left;
"
>
{{ detailinfo.leaveReason }}
</div>
</div>
<div
style="
margin: 15px 0 15px 0;
height: 20px;
border-left: 4px #39befe solid;
font-family: PingFang SC;
font-weight: 700;
color: #39befe;
font-size: 15px;
"
>
<span style="margin-left: 10px; height: 20px">审批流程</span>
</div>
<div>
<van-steps direction="vertical" :active="-1">
<van-step v-for="item in list">
<template #inactive-icon>
<div
v-if="item.state == '同意'"
style="
width: 10px;
height: 10px;
background: #33ddc6;
border-radius: 100%;
"
></div>
<div
v-if="item.state == '拒绝'"
style="
width: 10px;
height: 10px;
background: #ff7868;
border-radius: 100%;
"
></div>
<div
v-if="item.state == '待审批'"
style="
width: 10px;
height: 10px;
background: #39befe;
border-radius: 100%;
"
></div>
<div
v-if="item.state == ''"
style="
width: 10px;
height: 10px;
background: #aebdc5;
border-radius: 100%;
"
></div>
</template>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div
style="
height: 20px;
font-family: PingFang SC;
color: #323233;
font-size: 14px;
"
>
{{ item.name }}
</div>
<div
class="flex_center"
style="
font-family: PingFang SC;
font-weight: 700;
color: #ffffff;
font-size: 12px;
width: 52px;
height: 20px;
border-radius: 3px;
"
:style="getback(item.state)"
>
{{ item.state }}
</div>
</div>
</van-step>
</van-steps>
</div>
</div>
</div>
</template>
<script setup>
import { reactive, onMounted, toRefs, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import {
getstudentLeaveDetail,
getcourseNum,
getstduntLeavFlows,
} from "@/service/home";
import { toChineseBig } from "@/utils/common.js";
import { useStore } from "vuex";
import { formatDatetime, formatDate } from "@/utils/time.js";
const state = reactive({});
const router = useRouter();
const route = useRoute();
const detailinfo = ref({});
const eaList = ref();
const otList = ref();
const detail = JSON.parse(decodeURIComponent(route.query.detail)); // 接收参数
const store = useStore();
const loadData = async () => {
let result = await getstudentLeaveDetail(detail.id);
detailinfo.value = result.data;
};
const activeName = ref([]);
const activeName2 = ref([]);
const getcollapsevalue = (index) => {
console.log(index);
if (index === activeName.value) {
return "收起";
} else {
return "展开";
}
};
const getcollapsevalue2 = (index) => {
console.log(index);
if (index === activeName2.value) {
return "收起";
} else {
return "展开";
}
};
const getclicosty = (index) => {
if (index == activeName) {
return "transform: rotate(-180deg)";
}
};
const courseNums = ref([]);
const getcourseNums = (tiem, Sort) => {
if (store.state.userInfo.employeeType == 0) {
for (let index = 0; index < courseNums.value.length; index++) {
const element = courseNums.value[index];
if (courseNums.value[index].dictSort == Sort) {
console.log(courseNums.value[index].dictLabel);
return (
formatDate(new Date(tiem)) + " " + courseNums.value[index].dictLabel
);
}
}
} else return tiem;
};
const active = ref(99);
const getback = (state) => {
if (state == "同意") {
return "background : #33ddc6";
} else if (state == "拒绝") {
return "background : #ff7868";
} else if (state == "待审批") {
return "background : #39befe";
}
};
const list = ref([]);
onMounted(async () => {
loadData();
getdeFlows();
// let result = await getcourseNum();
// courseNums.value = result.data;
});
/* 自定义方法 */
const getdeFlows = async () => {
let flag = false;
let result2 = await getstduntLeavFlows(detail.id);
let handUserName = [];
let comment = [];
for (let index1 = 0; index1 < result2.data.handUserName.length; index1++) {
const element1 = result2.data.handUserName[index1];
if (result2.data.comment.length == 0) {
if (flag) {
list.value.push({ name: element1, state: "" });
} else {
list.value.push({ name: element1, state: "待审批" });
flag = true;
}
}
for (let index2 = 0; index2 < result2.data.comment.length; index2++) {
if (index1 >= result2.data.comment.length)
if (flag) {
list.value.push({ name: element1, state: "" });
} else {
list.value.push({ name: element1, state: "待审批" });
flag = true;
}
const element2 = result2.data.comment[index2];
console.log("index2", index2, element2);
console.log("index1", index1, element1);
if (index1 == index2) {
list.value.push({ name: element1, state: element2 });
if (element2 == "拒绝") flag = true;
}
}
}
};
const goback = () => {
router.back();
};
</script>
<style lang="less" scoped>
.detail_text {
height: 20px;
font-family: PingFang SC;
color: #000000;
font-size: 14px;
}
.collapse_value {
height: 17px;
font-family: PingFang SC;
color: #39befe;
font-size: 12px;
}
.collapse_item {
background: #ffffff;
border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
margin: 15px;
}
::v-deep .van-cell__right-icon {
color: #39befe;
}
::v-deep .van-cell {
position: unset;
}
.collapse_title {
height: 21px;
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 15px;
}
.cent_name {
height: 20px;
font-family: PingFang SC;
color: #000000;
font-size: 14px;
}
.collapse_value {
height: 17px;
font-family: PingFang SC;
color: #39befe;
font-size: 12px;
}
.collapse_ico {
width: 10.27px;
height: 5.99px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
top: 9px;
margin-left: 6px;
transition: transform 0.5s;
}
</style>
<template>
<van-nav-bar
title="学生选课"
left-text="返回"
left-arrow
@click-left="goback"
/>
<van-cell-group inset center style="padding: 10px">
<div style="display: flex; align-items: center; justify-content: center">
{{ ischeck ? "我的选课" : "基本课程" }}
</div>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px 0;
"
>
<div class="Regular1">语文</div>
<div class="Regular1">数学</div>
<div class="Regular1">英语</div>
<div v-show="ischeck" v-for="item in coursedetail" class="Regular1">
{{ item }}
</div>
</div>
<div v-if="!ischeck">
<div style="display: flex; align-items: center; justify-content: center">
20选一
</div>
<van-radio-group v-model="checked">
<div v-for="(item, index) in course">
<van-cell
:title="getcourse(item.text)"
clickable
@click="checked = item.value"
>
<template #right-icon>
<van-radio :name="item.value" />
</template>
</van-cell>
</div>
</van-radio-group>
<div @click="Onsubmit" style="margin-top: 10px">
<van-button round type="primary" size="large" native-type="submit"
>提交</van-button
>&nbsp;&nbsp;
</div>
</div>
</van-cell-group>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { Dialog, Toast } from "vant";
import { useRouter, useRoute } from "vue-router";
import { getstudentselect ,studentselect} from "@/service/home";
import { useStore } from "vuex";
const store = useStore();
const course = ref(store.state.sectiontyp);
const coursedetail = ref("");
const ischeck = ref(false);
onMounted(async () => {
let result = await getstudentselect();
if (result.data.sectionType != undefined) {
coursedetail.value = store.getters.getsectiontypByvalue(
result.data.sectionType
);
checked.value = result.data.sectionType;
ischeck.value = true;
}
});
const router = useRouter();
const checked = ref(null);
const getcourse = (item) => {
console.log(item);
return item[0] + " " + item[1] + " " + item[2];
};
const Onsubmit = async () => {
if (checked.value != null) {
Dialog.confirm({
title: "请再次确认",
message:
"语文" +
" " +
"数学" +
" " +
"英语" +
" " +
getcourse(course.value[checked.value-1].text),
})
.then(() => {
studentselect({
sectionType: checked.value,
studentId: store.state.studentId,
})
.then(() => {
Toast("选课成功");
router.go(0)
})
.catch(() => {
Toast.fail("选课失败");
});
})
.catch(() => {
// Toast.fail("你已经选过了");
});
} else {
Toast("你还未选课");
}
};
const goback = () => {
router.back();
};
</script>
<style lang="less" scoped></style>
<template>
<div class="main">
<van-nav-bar
title="考试列表"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div class="m_top">
<van-search
v-model="state.examName"
@search="onGetTeacher"
shape="round"
placeholder="请输入考试名称"
/>
</div>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div
@click="goachievement(item.id)"
v-for="item in list"
class="main_list"
>
<div>考试名称:{{ item.examName }}</div>
<div>考试时间: {{ item.examTime }}</div>
</div>
</van-list>
</van-pull-refresh>
</div>
</template>
<script>
export default {
name: "Home",
};
</script>
<script setup>
import { reactive, onMounted, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import { getChildExam } from "@/service/home";
import { Toast } from "vant";
const state = reactive({});
const exlist = ref([]);
const router = useRouter();
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
const refreshing = ref(false);
const pageNum = ref(0);
const onLoad = async () => {
if (refreshing.value) {
list.value = [];
pageNum.value = 0;
refreshing.value = false;
}
pageNum.value += 1;
// loading.value = true;
let result = await getChildExam({
examName: state.examName,
pageNum: pageNum.value,
pageSize: 10,
});
if (result.code == 200) {
list.value.push(...result.rows);
loading.value = false;
list.value.length === result.total && (finished.value = true);
} else {
Toast("获取信息失败!");
finished.value = true;
loading.value = false;
return;
}
};
const onRefresh = () => {
finished.value = false;
loading.value = true;
refreshing.value = true;
onLoad();
};
const loadData = async () => {};
onMounted(async () => {
loadData();
});
/* 自定义方法 */
const goachievement = (id) => {
/* 跳转详情页 */
router.push({
path: "/achievement",
query: {
exid: id,
},
});
};
const onGetTeacher = async () => {
onRefresh();
};
const goback = () => {
router.push({
path: "/main",
query: {},
});
};
</script>
<style scoped lang="less">
/** 最上层banner条 */
.home {
height: 15rem;
}
.bg_color {
background-color: #fff;
}
.m_top {
background-color: #fff;
height: auto;
position: relative;
padding-top: 4vw;
padding-bottom: 2vw;
padding-left: 3vw;
padding-right: 3vw;
}
.main_list {
padding: 5vw;
display: flex;
flex-direction: column;
margin: 5vw;
background: white;
border-radius: 0.26667rem;
font-size: medium;
text-align: start;
font-size: medium;
line-height: 30px;
.main_list_one {
width: 100%;
height: auto;
line-height: 20px;
border-radius: 26px;
text-align: center;
margin-top: 5vw;
padding-bottom: 5vw;
position: relative;
border-radius: 10px;
background-color: rgba(255, 255, 255, 100);
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 5vw;
}
}
</style>
<template>
<div>
<van-nav-bar
title="信息查询"
left-text="返回"
left-arrow
@click-left="goback"
/>
<div style="background: #f5f7f7; padding: 15px">
<div
style="
background: #ffffff;
border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
padding: 15px;
"
>
<div
style="
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 18px;
margin-bottom: 15px;
"
>
{{ detail.xxfbName }}
</div>
<div
style="
height: 20px;
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 14px;
margin-top: 10px;
"
>
联系方式:{{ detailinfo.parentTel }}
</div>
<div v-for="(key, value) in detailinfo">
<div
v-if="getlenth(key) < 20"
style="
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
"
>
<div class="detail_text">{{ value }}</div>
<div class="detail_text">{{ key }}</div>
</div>
<div v-else>
<div
style="
height: 20px;
font-family: PingFang SC;
color: #000000;
font-size: 14px;
margin-top: 15px;
"
>
{{ value }}
</div>
<div
style="
margin-top: 15px;
font-family: PingFang SC;
font-weight: 700;
color: #6f787d;
font-size: 14px;
background: #f5f7f7;
min-height: 50px;
padding: 10px 15px;
text-align: left;
"
>
{{ key }}
</div>
</div>
</div>
</div>
<div
style="
background: #ffffff;
border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
padding: 15px;
margin-top: 15px;
"
>
<van-field
v-model="ryFk"
rows="1"
autosize
type="textarea"
style="
padding: 10px 15px;
min-height: 120px;
background: #f5f7f7;
font-family: PingFang SC;
font-weight: 700;
color: #6f787d;
font-size: 14px;
"
placeholder="请输入意见/问题"
/>
</div>
<van-button
block
size="large"
type="primary"
native-type="submit"
@click="onSubmit"
>提交
</van-button>
</div>
</div>
</template>
<script setup>
import { reactive, onMounted, toRefs, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import { Toast } from "vant";
import {
getstudentLeaveDetail,
getcourseNum,
getstduntLeavFlows,
getschoolXxfbdetail,
postfz,
} from "@/service/home";
import { toChineseBig } from "@/utils/common.js";
import { useStore } from "vuex";
import { formatDatetime, formatDate } from "@/utils/time.js";
const state = reactive({});
const router = useRouter();
const route = useRoute();
const detailinfo = ref({});
const eaList = ref();
const otList = ref();
const detail = JSON.parse(decodeURIComponent(route.query.detail)); // 接收参数
const store = useStore();
const loadData = async () => {
let result = await getschoolXxfbdetail(detail.id);
// for (let index = 0; index < result.data.length; index++) {
// const element = result.data[index];
//
// }
delete result.data.ryFk;
detailinfo.value = result.data;
};
const activeName = ref([]);
const activeName2 = ref([]);
const getcollapsevalue = (index) => {
console.log(index);
if (index === activeName.value) {
return "收起";
} else {
return "展开";
}
};
const getcollapsevalue2 = (index) => {
console.log(index);
if (index === activeName2.value) {
return "收起";
} else {
return "展开";
}
};
const getclicosty = (index) => {
if (index == activeName) {
return "transform: rotate(-180deg)";
}
};
const courseNums = ref([]);
const getcourseNums = (tiem, Sort) => {
if (store.state.userInfo.employeeType == 0) {
for (let index = 0; index < courseNums.value.length; index++) {
const element = courseNums.value[index];
if (courseNums.value[index].dictSort == Sort) {
console.log(courseNums.value[index].dictLabel);
return (
formatDate(new Date(tiem)) + " " + courseNums.value[index].dictLabel
);
}
}
} else return tiem;
};
const active = ref(99);
const getback = (state) => {
if (state == "同意") {
return "background : #33ddc6";
} else if (state == "拒绝") {
return "background : #ff7868";
} else if (state == "待审批") {
return "background : #39befe";
}
};
const list = ref([]);
onMounted(async () => {
loadData();
ryFk.value = detail.fk;
// getdeFlows();
// let result = await getcourseNum();
// courseNums.value = result.data;
});
/* 自定义方法 */
const getdeFlows = async () => {
let flag = false;
let result2 = await getschoolXxfbdetail(detail.id);
let handUserName = [];
let comment = [];
for (let index1 = 0; index1 < result2.data.handUserName.length; index1++) {
const element1 = result2.data.handUserName[index1];
if (result2.data.comment.length == 0) {
if (flag) {
list.value.push({ name: element1, state: "" });
} else {
list.value.push({ name: element1, state: "待审批" });
flag = true;
}
}
for (let index2 = 0; index2 < result2.data.comment.length; index2++) {
if (index1 >= result2.data.comment.length)
if (flag) {
list.value.push({ name: element1, state: "" });
} else {
list.value.push({ name: element1, state: "待审批" });
flag = true;
}
const element2 = result2.data.comment[index2];
console.log("index2", index2, element2);
console.log("index1", index1, element1);
if (index1 == index2) {
list.value.push({ name: element1, state: element2 });
if (element2 == "拒绝") flag = true;
}
}
}
};
const getlenth = (key) => {
// console.log(key);
// key = key + "";
if (key) {
return key.length;
}
return 0;
};
const ryFk = ref("");
const onSubmit = async () => {
console.log(ryFk.value);
let result = await postfz(detail.id, { ryFk: ryFk.value });
Toast("反馈成功");
router.back();
};
const goback = () => {
router.back();
};
</script>
<style lang="less" scoped>
.detail_text {
height: 20px;
font-family: PingFang SC;
color: #000000;
font-size: 14px;
}
.collapse_value {
height: 17px;
font-family: PingFang SC;
color: #39befe;
font-size: 12px;
}
.collapse_item {
background: #ffffff;
border-radius: 6px;
box-shadow: 0px 0px 10px rgba(2, 21, 99, 0.1);
margin: 15px;
}
::v-deep .van-cell__right-icon {
color: #39befe;
}
::v-deep .van-cell {
position: unset;
}
.collapse_title {
height: 21px;
font-family: PingFang SC;
font-weight: 700;
color: #000000;
font-size: 15px;
}
.cent_name {
height: 20px;
font-family: PingFang SC;
color: #000000;
font-size: 14px;
}
.collapse_value {
height: 17px;
font-family: PingFang SC;
color: #39befe;
font-size: 12px;
}
.collapse_ico {
width: 10.27px;
height: 5.99px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
top: 9px;
margin-left: 6px;
transition: transform 0.5s;
}
.field-textarea {
min-height: 80px;
margin-top: 15px;
border-radius: 12px;
box-shadow: 0px 0px 20px rgba(2, 21, 99, 0.1);
font-family: PingFang SC;
font-weight: 700;
color: #6f787d;
font-size: 14px;
}
</style>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment