Merge branch 'master' into dev_qiaofei

# Conflicts:
#	src/pages/system/launchPage/launchPage.vue
This commit is contained in:
ywyonui 2025-06-20 09:53:14 +08:00
commit ca8b6e0880
21 changed files with 17625 additions and 663 deletions

14797
src/api/base/ChinaCitys.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -66,3 +66,6 @@ export const updateUserApi = async (param: any) => {
export const findJsByPhoneApi = async (param: any) => {
return await get("/api/js/findJsByPhone", param);
};
export const findJsAllByPhoneApi = async (param: any) => {
return await get("/api/js/findJsAllByPhone", param);
};

View File

@ -91,7 +91,7 @@ function confirm(e: any) {
newValue.value = dayjs(value).format("YYYY-MM");
}
if (attrs.componentProps.ok && typeof attrs.componentProps.ok == "function") {
attrs.componentProps.ok(e);
attrs.componentProps.ok(e, attrs);
}
}
</script>

View File

@ -139,6 +139,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/view/routine/JiaoXueZiYuan/indexList",
"style": {
"navigationBarTitleText": "资源类型",
"enablePullDownRefresh": false
}
},
{
"path": "pages/view/routine/HuoDongZiYuan/index",
"style": {
@ -168,12 +175,19 @@
}
},
{
"path": "pages/view/routine/JiFenPingJia",
"path": "pages/view/routine/JiFenPingJia/JiFenPingJia",
"style": {
"navigationBarTitleText": "积分评价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/view/routine/JiFenPingJia/detail",
"style": {
"navigationBarTitleText": "评价详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/view/routine/kefuxuncha/KeFuXunCha",
"style": {
@ -383,6 +397,20 @@
"navigationBarTitleText": "zhujiaoDetails"
}
},
{
"path": "pages/view/routine/RengJiaoRengZhi/index",
"style": {
"navigationBarTitleText": "任教任职",
"enablePullDownRefresh": false
}
},
{
"path": "pages/view/routine/GongZuoLiang/index",
"style": {
"navigationBarTitleText": "工作量",
"enablePullDownRefresh": false
}
},
{
"path": "pages/base/groupTeaching/studentRollCall",
"style": {
@ -420,13 +448,13 @@
"pagePath": "pages/base/service/index",
"iconPath": "static/tabBar/x2.png",
"selectedIconPath": "static/tabBar/2.png"
},
{
"text": "我的",
"pagePath": "pages/base/mine/index",
"iconPath": "static/tabBar/x3.png",
"selectedIconPath": "static/tabBar/3.png"
}
// {
// "text": "我的",
// "pagePath": "pages/base/mine/index",
// "iconPath": "static/tabBar/x3.png",
// "selectedIconPath": "static/tabBar/3.png"
// }
]
}
}

View File

@ -1,14 +1,977 @@
<template>
<view class="mine-page">
<!-- 1. 顶部 Header - 复制自service页面 -->
<view class="header-section">
<view class="header-gradient"></view>
<!-- 退出按钮 -->
<view class="logout-btn" @click="handleLogout">
<text class="logout-text">退出</text>
</view>
<!-- 老师信息 -->
<view class="teacher-info">
<view class="teacher-avatar">
<image
class="avatar-image"
:src="teacherData.avatar || '/static/base/default-avatar.png'"
mode="aspectFill"
></image>
</view>
<view class="teacher-details">
<view class="teacher-name">{{ teacherData.name }}</view>
<view class="teacher-position">{{ teacherData.position }}</view>
<view class="teacher-class">{{ teacherData.className }}</view>
</view>
</view>
<!-- 统计信息 -->
<view class="stats-info">
<view class="stat-item">
<text class="stat-label">积分</text>
<text class="stat-value">{{ teacherData.score }}</text>
</view>
<view class="stat-divider">|</view>
<view class="stat-item">
<text class="stat-label">工作量</text>
<text class="stat-value">{{ teacherData.workload }}课时</text>
</view>
</view>
<!-- 介绍文字 -->
<view class="teacher-intro">
{{ teacherData.introduction }}
</view>
</view>
<!-- 2. 日程管理区域 -->
<view class="main-content">
<!-- 近期日程标题 -->
<view class="schedule-header">
<text class="schedule-title">近期日程</text>
<view class="schedule-link" @click="goToSchedule">
<text class="link-text">查看日程</text>
<text class="link-arrow">></text>
</view>
</view>
<!-- 日期选择器 -->
<view class="date-selector">
<view class="date-container">
<view
class="date-item"
v-for="(date, index) in weekDates"
:key="index"
:class="{ active: selectedDateIndex === index }"
@click="selectDate(index)"
>
<text class="date-day">{{ date.day }}</text>
<text class="date-number">{{ date.number }}</text>
<view v-if="date.hasEvent" class="date-dot"></view>
</view>
</view>
</view>
<!-- 日程列表 -->
<scroll-view class="schedule-list" scroll-y="true" show-scrollbar="false" enhanced="true">
<view class="schedule-content">
<view
class="schedule-item"
v-for="(item, index) in getCurrentSchedule"
:key="index"
>
<view class="time-column">
<text class="start-time">{{ item.startTime }}</text>
<text class="end-time" v-if="item.endTime">{{ item.endTime }}</text>
</view>
<view class="content-column">
<view class="event-header">
<view
class="event-tag"
:class="item.type"
v-if="item.tag"
>
<text class="tag-text">{{ item.tag }}</text>
</view>
<text class="event-title">{{ item.title }}</text>
</view>
<view class="event-details" v-if="item.details">
<view class="event-location" v-if="item.location">
<text class="location-icon">📍</text>
<text class="location-text">{{ item.location }}</text>
</view>
<view class="event-description" v-if="item.description">
<text class="description-icon">📝</text>
<text class="description-text">{{ item.description }}</text>
</view>
</view>
</view>
</view>
<!-- 无日程时的提示 -->
<view class="no-schedule" v-if="getCurrentSchedule.length === 0">
<text class="no-schedule-text">暂无日程安排</text>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script lang="ts" setup>
import { useUserStore } from "@/store/modules/user";
import { imagUrl } from "@/utils";
import { reactive, ref, computed, onMounted } from "vue";
//
interface TeacherData {
name: string;
position: string;
className: string;
score: number;
workload: number;
introduction: string;
avatar?: string;
}
//
interface ScheduleItem {
startTime: string;
endTime?: string;
title: string;
type: string;
tag?: string;
location?: string;
description?: string;
details?: boolean;
}
//
interface DateItem {
day: string;
number: string;
hasEvent: boolean;
date: string;
}
const { logout, getUser } = useUserStore();
//
const teacherData = reactive<TeacherData>({
name: getUser.loginName,
position: "教研组长",
className: "2014级1班班主任",
score: 48,
workload: 20,
introduction: "北冥有鱼,其名为鲲。鲲之大,不知其几千里也。",
avatar: imagUrl(getUser.profilePhoto),
});
// 退
const handleLogout = () => {
uni.showModal({
title: "确认退出",
content: "确定要退出登录吗?",
success: (res) => {
if (res.confirm) {
logout();
uni.reLaunch({
url: "/pages/system/login/login",
});
}
},
});
};
//
const selectedDateIndex = ref(0); //
//
const weekDates = ref<DateItem[]>([]);
//
const generateScheduleData = () => {
const today = new Date();
const currentDay = today.getDay();
const mondayOffset = currentDay === 0 ? -6 : 1 - currentDay;
const startOfWeek = new Date(today);
startOfWeek.setDate(today.getDate() + mondayOffset);
const data: Record<string, ScheduleItem[]> = {};
for (let i = 0; i < 7; i++) {
const date = new Date(startOfWeek);
date.setDate(startOfWeek.getDate() + i);
const dateStr = date.getDate().toString();
//
switch (i) {
case 0: //
data[dateStr] = [
{
startTime: '08:30',
endTime: '10:00',
title: '语文课',
type: 'class',
tag: '课程',
location: '教学楼A201',
description: '高一(3)班语文课',
details: true
},
{
startTime: '14:00',
endTime: '15:30',
title: '班主任会议',
type: 'meeting',
tag: '会议',
location: '会议室B302',
description: '讨论期中考试安排',
details: true
}
];
break;
case 1: //
data[dateStr] = [
{
startTime: '09:00',
endTime: '10:30',
title: '教研活动',
type: 'meeting',
tag: '教研',
location: '教研室',
description: '语文组教研活动',
details: true
},
{
startTime: '15:00',
endTime: '16:30',
title: '家长会准备',
type: 'preparation',
tag: '准备',
location: '办公室',
description: '准备家长会材料',
details: true
}
];
break;
case 2: //
data[dateStr] = [
{
startTime: '08:00',
endTime: '09:30',
title: '早读辅导',
type: 'tutoring',
tag: '辅导',
location: '教学楼A201',
description: '高一(3)班早读辅导',
details: true
},
{
startTime: '10:00',
endTime: '12:00',
title: '教研英语无痕计划OMO',
type: 'meeting',
tag: '会议',
location: 'POHCSOO007',
description: '智慧校园211楼会议室',
details: true
},
{
startTime: '14:00',
endTime: '16:00',
title: '德法内科学习课',
type: 'class',
tag: '课程',
location: 'POHCSOO007',
description: '智慧校园211楼会议室',
details: true
} , {
startTime: '08:00',
endTime: '09:30',
title: '早读辅导',
type: 'tutoring',
tag: '辅导',
location: '教学楼A201',
description: '高一(3)班早读辅导',
details: true
},
{
startTime: '10:00',
endTime: '12:00',
title: '教研英语无痕计划OMO',
type: 'meeting',
tag: '会议',
location: 'POHCSOO007',
description: '智慧校园211楼会议室',
details: true
},
{
startTime: '14:00',
endTime: '16:00',
title: '德法内科学习课',
type: 'class',
tag: '课程',
location: 'POHCSOO007',
description: '智慧校园211楼会议室',
details: true
}, {
startTime: '08:00',
endTime: '09:30',
title: '早读辅导',
type: 'tutoring',
tag: '辅导',
location: '教学楼A201',
description: '高一(3)班早读辅导',
details: true
},
{
startTime: '10:00',
endTime: '12:00',
title: '教研英语无痕计划OMO',
type: 'meeting',
tag: '会议',
location: 'POHCSOO007',
description: '智慧校园211楼会议室',
details: true
},
{
startTime: '14:00',
endTime: '16:00',
title: '德法内科学习课',
type: 'class',
tag: '课程',
location: 'POHCSOO007',
description: '智慧校园211楼会议室',
details: true
}
];
break;
case 3: //
data[dateStr] = [
{
startTime: '08:30',
endTime: '10:00',
title: '语文课',
type: 'class',
tag: '课程',
location: '教学楼A201',
description: '高一(3)班语文课',
details: true
},
{
startTime: '10:30',
endTime: '12:00',
title: '作文批改',
type: 'preparation',
tag: '批改',
location: '办公室',
description: '批改学生作文',
details: true
},
{
startTime: '14:00',
endTime: '15:30',
title: '课程设计',
type: 'preparation',
tag: '备课',
location: '办公室',
description: '准备下周课程内容',
details: true
},
{
startTime: '16:00',
endTime: '17:00',
title: '学生谈话',
type: 'counseling',
tag: '谈话',
location: '办公室',
description: '与学生张三谈话',
details: true
}
];
break;
case 4: //
data[dateStr] = [
{
startTime: '08:00',
endTime: '09:30',
title: '晨会',
type: 'meeting',
tag: '晨会',
location: '办公室',
description: '教师晨会',
details: true
},
{
startTime: '09:00',
endTime: '10:30',
title: '公开课',
type: 'class',
tag: '公开课',
location: '教学楼A201',
description: '语文公开课展示',
details: true
},
{
startTime: '11:00',
endTime: '12:00',
title: '课后辅导',
type: 'tutoring',
tag: '辅导',
location: '教学楼A201',
description: '学困生辅导',
details: true
},
{
startTime: '14:30',
endTime: '16:00',
title: '周总结会议',
type: 'meeting',
tag: '会议',
location: '会议室B302',
description: '本周工作总结',
details: true
},
{
startTime: '16:30',
endTime: '17:30',
title: '家长沟通',
type: 'counseling',
tag: '沟通',
location: '办公室',
description: '与家长电话沟通',
details: true
}
];
break;
case 5: //
data[dateStr] = [
{
startTime: '09:00',
endTime: '11:00',
title: '补课',
type: 'class',
tag: '补课',
location: '教学楼A201',
description: '高一(3)班语文补课',
details: true
}
];
break;
case 6: //
data[dateStr] = []; //
break;
}
}
return data;
};
//
const scheduleData = reactive<Record<string, ScheduleItem[]>>(generateScheduleData());
//
const getCurrentSchedule = computed(() => {
const currentDate = weekDates.value[selectedDateIndex.value];
if (!currentDate) return [];
return scheduleData[currentDate.number] || [];
});
//
const initDates = () => {
const days = ['一', '二', '三', '四', '五', '六', '日'];
const today = new Date();
const currentDay = today.getDay(); // 0-60
//
const startOfWeek = new Date(today);
const mondayOffset = currentDay === 0 ? -6 : 1 - currentDay; // 6
startOfWeek.setDate(today.getDate() + mondayOffset);
weekDates.value = [];
for (let i = 0; i < 7; i++) {
const date = new Date(startOfWeek);
date.setDate(startOfWeek.getDate() + i);
const dateStr = date.getDate().toString();
const hasEvent = scheduleData[dateStr] && scheduleData[dateStr].length > 0;
weekDates.value.push({
day: days[i],
number: dateStr,
hasEvent,
date: date.toISOString().split('T')[0]
});
}
};
//
const selectDate = (index: number) => {
selectedDateIndex.value = index;
};
//
const goToSchedule = () => {
uni.navigateTo({
url: '/pages/view/schedule/index'
});
};
onMounted(() => {
initDates();
//
const today = new Date();
const currentDay = today.getDay();
const todayIndex = currentDay === 0 ? 6 : currentDay - 1; // 6day-1
selectedDateIndex.value = todayIndex;
});
</script>
<style scoped lang="scss">
.mine-page {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
position: relative;
}
// Header - service
.header-section {
position: relative;
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
color: #ffffff;
overflow: hidden;
padding: 40rpx 30rpx 30rpx;
height: auto;
min-height: 320rpx;
.header-gradient {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.1) 0%,
rgba(255, 255, 255, 0.05) 100%
);
z-index: 1;
}
.logout-btn {
position: absolute;
top: 40rpx;
right: 30rpx;
z-index: 3;
background: rgba(255, 255, 255, 0.2);
border-radius: 20rpx;
padding: 10rpx 20rpx;
border: 1px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(10px);
.logout-text {
color: #ffffff;
font-size: 14px;
font-weight: 500;
}
}
.teacher-info {
display: flex;
align-items: center;
margin-top: 20rpx;
z-index: 2;
position: relative;
.teacher-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
border: 3px solid rgba(255, 255, 255, 0.3);
margin-right: 20rpx;
.avatar-image {
width: 100%;
height: 100%;
}
}
.teacher-details {
flex: 1;
.teacher-name {
font-size: 20px;
font-weight: bold;
color: #ffffff;
margin-bottom: 5rpx;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.teacher-position {
font-size: 14px;
color: rgba(255, 255, 255, 0.9);
margin-bottom: 5rpx;
}
.teacher-class {
font-size: 12px;
color: rgba(255, 255, 255, 0.8);
}
}
}
.stats-info {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20rpx;
z-index: 2;
position: relative;
.stat-item {
display: flex;
align-items: center;
.stat-label {
font-size: 14px;
color: rgba(255, 255, 255, 0.9);
}
.stat-value {
font-size: 14px;
color: #ffffff;
font-weight: 600;
}
}
.stat-divider {
margin: 0 30rpx;
color: rgba(255, 255, 255, 0.6);
font-size: 14px;
}
}
.teacher-intro {
text-align: center;
font-size: 12px;
color: rgba(255, 255, 255, 0.8);
margin-top: 20rpx;
line-height: 1.4;
z-index: 2;
position: relative;
}
}
//
.main-content {
box-sizing: border-box;
padding: 20px 12px 0px 12px; // padding
position: relative;
background: linear-gradient(
to bottom,
rgba(255, 255, 255, 0.95) 0%,
rgba(248, 250, 252, 0.98) 100%
);
border-radius: 20px 20px 0 0;
margin-top: -20px;
z-index: 3;
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
height: calc(100vh - 340rpx); //
display: flex;
flex-direction: column;
overflow: hidden; //
}
//
.schedule-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
flex-shrink: 0; //
.schedule-title {
font-size: 17px;
font-weight: 600;
color: #1f2937;
}
.schedule-link {
display: flex;
align-items: center;
cursor: pointer;
.link-text {
font-size: 13px;
color: #6b7280;
margin-right: 4px;
}
.link-arrow {
font-size: 13px;
color: #6b7280;
}
}
}
//
.date-selector {
margin-bottom: 15px;
background: #ffffff;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
flex-shrink: 0; //
margin-left: 0;
margin-right: 0;
.date-container {
display: flex;
padding: 8px 4px;
justify-content: space-around; // 使space-around
width: 100%; //
box-sizing: border-box;
}
.date-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 6px 2px;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
flex: 1; //
max-width: calc((100% - 32px) / 7); // padding
min-width: 0; //
.date-day {
font-size: 10px;
color: #6b7280;
margin-bottom: 2px;
white-space: nowrap; //
text-align: center;
}
.date-number {
font-size: 14px;
font-weight: 600;
color: #374151;
white-space: nowrap; //
text-align: center;
}
.date-dot {
position: absolute;
bottom: 1px;
width: 3px;
height: 3px;
background: #10b981;
border-radius: 50%;
}
&.active {
background: #10b981;
color: #ffffff;
transform: scale(1.02); //
z-index: 1; //
margin: 0 -1px; //
.date-day,
.date-number {
color: #ffffff;
}
.date-dot {
background: #ffffff;
}
}
}
}
//
.schedule-list {
flex: 1; //
height: 0; // flex使
padding-bottom: 20px;
.schedule-content {
padding-bottom: 35px; //
}
.schedule-item {
display: flex;
padding: 14px 0;
border-bottom: 1px solid #f3f4f6;
&:last-child {
border-bottom: none;
}
.time-column {
width: 60px;
flex-shrink: 0;
margin-right: 15px;
.start-time {
display: block;
font-size: 15px;
font-weight: 600;
color: #374151;
line-height: 1.2;
}
.end-time {
display: block;
font-size: 13px;
color: #6b7280;
margin-top: 2px;
line-height: 1.2;
}
}
.content-column {
flex: 1;
min-width: 0; //
.event-header {
display: flex;
align-items: center;
margin-bottom: 8px;
.event-tag {
display: inline-flex;
align-items: center;
padding: 3px 8px;
border-radius: 12px;
margin-right: 8px;
flex-shrink: 0; //
&.meeting {
background: #10b981;
}
&.class {
background: #3b82f6;
}
&.tutoring {
background: #f59e0b;
}
&.preparation {
background: #8b5cf6;
}
&.counseling {
background: #ef4444;
}
.tag-text {
font-size: 11px;
color: #ffffff;
font-weight: 500;
white-space: nowrap;
}
}
.event-title {
font-size: 15px;
font-weight: 500;
color: #1f2937;
flex: 1;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; //
}
}
.event-details {
.event-location,
.event-description {
display: flex;
align-items: center;
margin-bottom: 4px;
.location-icon,
.description-icon {
font-size: 13px;
margin-right: 4px;
flex-shrink: 0;
}
.location-text,
.description-text {
font-size: 13px;
color: #6b7280;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; //
}
}
}
}
}
.no-schedule {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
min-height: 200px;
.no-schedule-text {
font-size: 15px;
color: #9ca3af;
}
}
}
//
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
//
@media (max-width: 375px) {
.main-content {
padding: 20px 8px 0px 8px; // padding
}
.date-selector {
.date-container {
padding: 8px 2px; //
}
.date-item {
padding: 5px 1px; //
.date-day {
font-size: 9px; //
}
.date-number {
font-size: 13px; //
}
&.active {
transform: scale(1.01); //
margin: 0; //
}
}
}
}
</style>

View File

@ -88,8 +88,12 @@
</template>
<script lang="ts" setup>
import { findJsAllByPhoneApi } from "@/api/system/login";
import { useDataStore } from "@/store/modules/data";
import { useUserStore } from "@/store/modules/user";
import { imagUrl } from "@/utils";
import { hideLoading, showLoading } from "@/utils/uniapp";
import { set } from "lodash";
import { reactive, ref } from "vue";
interface GridItem {
@ -153,13 +157,13 @@ const sections = reactive<Section[]>([
id: "routine",
title: "常规",
items: [
{
id: 10,
text: "一师一策",
icon: "clipboardfill",
path: "/pages/view/routine/yishiyice/index",
show: true,
},
// {
// id: 10,
// text: "",
// icon: "clipboardfill",
// path: "/pages/view/routine/yishiyice/index",
// show: true,
// },
{
id: "r2",
icon: "stack-fill",
@ -167,27 +171,42 @@ const sections = reactive<Section[]>([
show: true,
path: "/pages/view/routine/JiaoXueZiYuan/index",
},
{
id: "r3",
icon: "file-list-3-fil",
text: "活动资源",
show: true,
path: "/pages/view/routine/HuoDongZiYuan/index",
},
{
id: "r4",
icon: "file-paper-2-fill",
text: "公文流转",
show: true,
path: "/pages/view/routine/GongWenLiuZhuan/index",
},
{
id: "r5",
icon: "file-mark-fill",
text: "积分评价",
show: true,
path: "/pages/view/routine/JiFenPingJia",
path: "/pages/view/routine/JiFenPingJia/JiFenPingJia",
},
// {
// id: "r3",
// icon: "file-list-3-fil",
// text: "",
// show: true,
// path: "/pages/view/routine/HuoDongZiYuan/index",
// },
{
id: "r3",
icon: "file-list-3-fil",
text: "工作量",
show: true,
path: "/pages/view/routine/GongZuoLiang/index",
},
// {
// id: "r4",
// icon: "file-paper-2-fill",
// text: "",
// show: true,
// path: "/pages/view/routine/GongWenLiuZhuan/index",
// },
{
id: "r4",
icon: "file-paper-2-fill",
text: "任教任职",
show: true,
path: "/pages/view/routine/RengJiaoRengZhi/index",
},
{
id: "r6",
icon: "pass-pending-fill",
@ -282,15 +301,25 @@ const getIconBgColor = (index: number) => {
];
return colors[index % colors.length];
};
const { setFile, getFile } = useDataStore();
//
const handleGridItemClick = (item: GridItem) => {
const handleGridItemClick = async (item: GridItem) => {
console.log("Clicked item:", item);
if (item.path) {
uni.navigateTo({ url: item.path });
} else {
uni.showToast({ title: `功能 ${item.text} 暂未开放`, icon: "none" });
if (item.text == "教师档案") {
showLoading("加载中...");
const res = await findJsAllByPhoneApi({
phone: getUser.telephone,
});
hideLoading();
setFile(res.result);
}
setTimeout(() => {
if (item.path) {
uni.navigateTo({ url: item.path });
} else {
uni.showToast({ title: `功能 ${item.text} 暂未开放`, icon: "none" });
}
}, 200);
};
</script>

View File

@ -54,14 +54,14 @@ import {cloneDeep, map} from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "gztime",
field: "gzkstime",
label: "开始时间",
component: "BasicDateTime",
componentProps: {
mode: "year-month",
},
}, {
field: "jssj",
field: "gzjstime",
label: "结束时间",
component: "BasicDateTime",
componentProps: {

View File

@ -32,14 +32,8 @@
<template #bottom>
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="上一步"
class="ml-15 mr-7"
:plain="true"
@click="navigateBack"
/>
<u-button
text="下一步"
class="mr-15 mr-7"
text="提交"
class="mx-15"
type="primary"
@click="submit"
/>
@ -258,36 +252,32 @@ function deleteMemberFamily(index: number, item: any) {
//
function submit() {
setFile({
...getFile,
grRyList: map(education.xl, (item) => {
return { ...item.value, hjlxId: "GRRY" };
}),
});
navigateTo("/pages/view/hr/teacherProfile/PublicClassAwards");
}
//
const { getFile, setFile } = useDataStore();
//
if (getFile.grRyList && getFile.grRyList.length > 0) {
education.xl = map(getFile.grRyList, (item) => {
return { value: item };
const grRyList = map(education.xl, (item) => {
return { ...item.value, hjlxId: "GRRY" };
});
}
// //
// const { getFile, setFile } = useDataStore();
// //
// if (getFile.grRyList && getFile.grRyList.length > 0) {
// education.xl = map(getFile.grRyList, (item) => {
// return { value: item };
// });
// }
//
onMounted(() => {
if (getFile.grRyList && getFile.grRyList.length > 0) {
//
nextTick(() => {
initEchoData();
});
} else {
//
initHonorCategories();
}
// if (getFile.grRyList && getFile.grRyList.length > 0) {
// //
// nextTick(() => {
// initEchoData();
// });
// } else {
// //
// initHonorCategories();
// }
});
</script>

View File

@ -5,12 +5,14 @@
<template v-for="(item, index) in education.xl" :key="index">
<view class="po-re mb-15">
<BasicForm
:index="index"
v-model="item.value"
:schema="schema"
:key="`form-${index}-${forceUpdateKey}`"
:formsProps="{ labelWidth: 100 }"
/>
<view
@click="deleteMemberFamily(index as number, item.value)"
@click="deleteMemberFamily(index, item.value)"
class="delete-icon"
>
<BasicIcon type="clear" size="30" />
@ -47,25 +49,38 @@
</template>
<script lang="ts" setup>
import {dicApi} from "@/api/system/dic";
import {useDataStore} from "@/store/modules/data";
import {navigateBack, navigateTo} from "@/utils/uniapp";
import {cloneDeep, map} from "lodash";
import { dicApi } from "@/api/system/dic";
import { useDataStore } from "@/store/modules/data";
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { cloneDeep, map } from "lodash";
import dayjs from "dayjs";
//
const calculatePositionYears = (startDate: string, endDate?: string) => {
if (!startDate) return "";
const start = dayjs(startDate);
const end = endDate ? dayjs(endDate) : dayjs();
const years = end.diff(start, "year");
console.log("计算任岗年限:", { startDate, endDate, years });
// 0
return years.toString();
};
//
const forceUpdateKey = ref(0);
//
const updatePositionYears = (itemValue: any) => {
const { gwrztime, gwpyjssj } = itemValue;
if (gwrztime) {
const years = calculatePositionYears(gwrztime, gwpyjssj);
itemValue.gwrznx = years;
}
};
const schema = reactive<FormsSchema[]>([
// {
// field: "xj",
// label: "",
// component: "BasicPicker",
// componentProps: {
// api: dicApi,
// param: { pid: 434953981 },
// rangeKey: "dictionaryValue",
// savaKey: "dictionaryCode",
// },
// },
{
field: "gwjbId",
field: "gwlbId",
label: "岗位类别",
component: "BasicPicker",
componentProps: {
@ -76,30 +91,80 @@ const schema = reactive<FormsSchema[]>([
},
},
{
field: "gwrztime",
field: "gwjbId",
label: "岗位级别",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 434953981 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "gwrzkstime",
label: "岗位聘用开始时间",
component: "BasicDateTime",
componentProps: {
mode: "year-month",
ok: (e: any, attrs: any) => {
console.log("岗位聘用开始时间选择:", e, attrs);
const formIndex = attrs.index;
if (formIndex !== undefined && education.xl[formIndex]) {
//
const endTime = education.xl[formIndex].value.gwrzjstime;
console.log("当前表单项数据:", education.xl[formIndex].value);
//
const years = calculatePositionYears(e.value, endTime);
//
education.xl[formIndex].value.gwrznx = years;
console.log(
"更新后的任岗年限:",
education.xl[formIndex].value.gwrznx
);
//
forceUpdateKey.value++;
}
},
},
}, {
field: "gwpyjssj",
},
{
field: "gwrzjstime",
label: "岗位聘用结束时间",
component: "BasicDateTime",
componentProps: {
mode: "year-month",
ok: (e: any, attrs: any) => {
console.log("岗位聘用结束时间选择:", e, attrs);
const formIndex = attrs.index;
if (formIndex !== undefined && education.xl[formIndex]) {
//
const startTime = education.xl[formIndex].value.gwrzkstime;
console.log("当前表单项数据:", education.xl[formIndex].value);
if (startTime) {
//
const years = calculatePositionYears(startTime, e.value);
//
education.xl[formIndex].value.gwrznx = years;
console.log(
"更新后的任岗年限:",
education.xl[formIndex].value.gwrznx
);
//
forceUpdateKey.value++;
}
}
},
},
}, {
field: "gwpyjssj",
label: "当时时间-岗位聘用开始时间",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "gwrznx",
label: "岗位任职年限",
component: "BasicInput",
componentProps: {},
componentProps: {
disabled: true,
placeholder: "请选择岗位聘用时间",
},
},
// {
// field: "zrxk",
@ -123,7 +188,7 @@ const schema = reactive<FormsSchema[]>([
// savaKey: "key",
// },
// },
{
/*{
field: "dzzw",
label: "职务",
component: "BasicPicker",
@ -133,7 +198,7 @@ const schema = reactive<FormsSchema[]>([
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
},*/
]);
const education = reactive<any>({
@ -145,16 +210,57 @@ if (getFile.rgqkList && getFile.rgqkList.length > 0) {
education.xl = map(getFile.rgqkList, (item) => {
return { value: item };
});
// 使gwrznx
nextTick(() => {
education.xl.forEach((item: any, index: number) => {
console.log(`回显数据-表单项${index}数据:`, {
gwrzkstime: item.value.gwrzkstime,
gwrzjstime: item.value.gwrzjstime,
gwrznx: item.value.gwrznx, // 使
来源: "数据库回显",
});
});
//
forceUpdateKey.value++;
});
}
//
const calculateAllPositionYears = () => {
education.xl.forEach((item: any, index: number) => {
if (item.value.gwrzkstime) {
const years = calculatePositionYears(
item.value.gwrzkstime,
item.value.gwrzjstime
);
item.value.gwrznx = years;
console.log(`表单项${index}计算结果:`, {
gwrzkstime: item.value.gwrzkstime,
gwrzjstime: item.value.gwrzjstime,
gwrznx: years,
是否为0: years === "0",
});
} else {
//
item.value.gwrznx = "";
}
});
forceUpdateKey.value++;
};
function addEducation() {
education.xl.push({ value: {} });
//
forceUpdateKey.value++;
}
function deleteMemberFamily(index: number, item: any) {
const list = cloneDeep(education.xl);
list.splice(index, 1);
education.xl = list;
//
forceUpdateKey.value++;
}
function submit() {
@ -165,8 +271,26 @@ function submit() {
}),
});
navigateTo("/pages/view/hr/teacherProfile/ExperienceInfo");
}
//
onMounted(() => {
// 使gwrznx
if (getFile.rgqkList && getFile.rgqkList.length > 0) {
nextTick(() => {
console.log("组件挂载后处理回显数据直接使用数据库返回的gwrznx值");
education.xl.forEach((item: any, index: number) => {
console.log(`挂载后-表单项${index}数据:`, {
gwrzkstime: item.value.gwrzkstime,
gwrzjstime: item.value.gwrzjstime,
gwrznx: item.value.gwrznx, // 使
来源: "数据库回显-挂载后",
});
});
forceUpdateKey.value++;
});
}
});
</script>
<style>
.delete-icon {

View File

@ -31,18 +31,7 @@
</view>
<template #bottom>
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="上一步"
class="ml-15 mr-7"
:plain="true"
@click="navigateBack"
/>
<u-button
text="提交"
class="mr-15 mr-7"
type="primary"
@click="submit"
/>
<u-button text="提交" class="mx-15" type="primary" @click="submit" />
</view>
</template>
</BasicLayout>
@ -260,36 +249,32 @@ function deleteMemberFamily(index: number, item: any) {
//
function submit() {
setFile({
...getFile,
gkkRyList: map(education.xl, (item) => {
return { ...item.value, hjlxId: "GKKHJQK" };
}),
});
navigateTo("/pages/view/hr/teacherProfile/RecordMaterials");
}
//
const { getFile, setFile } = useDataStore();
//
if (getFile.gkkRyList && getFile.gkkRyList.length > 0) {
education.xl = map(getFile.gkkRyList, (item) => {
return { value: item };
const gkkRyList = map(education.xl, (item) => {
return { ...item.value, hjlxId: "GKKHJQK" };
});
}
// //
// const { getFile, setFile } = useDataStore();
// //
// if (getFile.gkkRyList && getFile.gkkRyList.length > 0) {
// education.xl = map(getFile.gkkRyList, (item) => {
// return { value: item };
// });
// }
//
onMounted(() => {
if (getFile.gkkRyList && getFile.gkkRyList.length > 0) {
//
nextTick(() => {
initEchoData();
});
} else {
//
initHonorCategories();
}
// if (getFile.gkkRyList && getFile.gkkRyList.length > 0) {
// //
// nextTick(() => {
// initEchoData();
// });
// } else {
// //
// initHonorCategories();
// }
});
</script>
<style>

View File

@ -121,8 +121,10 @@ const schema = reactive<FormsSchema[]>([
{
field: "qqtime",
label: "起聘时间",
component: "BasicDateTimes",
componentProps: {},
component: "BasicDateTime",
componentProps: {
mode: "year-month",
},
},
{
field: "pywjh",

View File

@ -5,24 +5,19 @@
</view>
<template #bottom>
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="下一步"
class="mx-15 "
type="primary"
@click="submit"
/>
<u-button text="下一步" class="mx-15" type="primary" @click="submit" />
</view>
</template>
</BasicLayout>
</template>
<script setup lang="ts">
import {navigateTo} from "@/utils/uniapp";
import { navigateTo } from "@/utils/uniapp";
import {useForm} from "@/components/BasicForm/hooks/useForm";
import {dicApi, findDicTreeByPidApi} from "@/api/system/dic";
import {useDataStore} from "@/store/modules/data";
import {map} from "lodash";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { dicApi, findDicTreeByPidApi } from "@/api/system/dic";
import { useDataStore } from "@/store/modules/data";
import { map } from "lodash";
import dayjs from "dayjs";
const { getFile, setFile } = useDataStore();
@ -46,9 +41,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
field: "jsdah",
label: "档案号",
component: "BasicInput",
componentProps: {
disabled: true,
},
componentProps: {},
},
{
field: "jsxm",
@ -73,7 +66,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicDataPicker",
componentProps: {
api: findDicTreeByPidApi,
param: { pid: 3701 },
param: { pid: 100 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
onChange: (e: any) => {
@ -164,13 +157,13 @@ const [register, { getValue, setValue, setSchema }] = useForm({
},
},
{
field: "jsTime",
label: "任教开始时间",
field: "jltime",
label: "教龄计算时间",
component: "BasicDateTime",
componentProps: {
mode: "year-month",
ok: (e: any) => {
const yearDiff = calculateYearDiff(e);
const yearDiff = calculateYearDiff(e.value);
setValue({ jl: yearDiff });
},
},
@ -256,7 +249,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
component: "BasicInput",
componentProps: {},
},
{
/* {
field: "gwjbId",
label: "岗位级别",
component: "BasicPicker",
@ -277,7 +270,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
},*/
{
field: "sbkh",
label: "社保卡号",
@ -287,6 +280,14 @@ const [register, { getValue, setValue, setSchema }] = useForm({
],
});
setValue(getFile);
if (getFile.zdqkId == "调出") {
setSchema([
{
field: "dcyy",
ifShow: false,
},
]);
}
async function submit() {
try {

View File

@ -130,11 +130,30 @@ const [register, { getValue, setValue }] = useForm({
],
});
setValue(getFile);
if (getFile.dzzw && typeof getFile.dzzw == "string") {
setValue({
...getFile,
dzzw: getFile.dzzw.split(","),
qtzw: getFile.qtzw && typeof getFile.qtzw == "string" ? getFile.qtzw.split(",") : []
});
} else {
setValue({
...getFile,
dzzw: [],
qtzw: getFile.qtzw && typeof getFile.qtzw == "string" ? getFile.qtzw.split(",") : []
});
}
async function submit() {
try {
const value = await getValue();
// dzzw qtzw
if (Array.isArray(value.dzzw)) {
value.dzzw = value.dzzw.join(',');
}
if (Array.isArray(value.qtzw)) {
value.qtzw = value.qtzw.join(',');
}
setFile({ ...getFile, ...value });
navigateTo("/pages/view/hr/teacherProfile/TitleInfo");
} catch (error) {}

View File

@ -0,0 +1,11 @@
<template>
</template>
<script setup lang="ts">
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,128 +0,0 @@
<template>
<view class="container">
<uni-card :is-shadow="false" is-full>
<view class="header">
<text class="score">我的得分: 84</text>
<view class="status">
<text>我的状态: </text>
<view class="status-indicator"></view>
</view>
</view>
</uni-card>
<uni-card :is-shadow="false" is-full margin="10px 0 0 0">
<view class="list-header">
<text class="category-header">分类</text>
<text class="value-header">分值</text>
</view>
<view class="list-item" v-for="(item, index) in evaluationItems" :key="index">
<text class="category-name">{{ item.category }}</text>
<text class="value">{{ item.value }}</text>
</view>
</uni-card>
</view>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
const evaluationItems = ref([
{ category: '师德师风', value: 8 },
{ category: '考勤管理', value: 4 },
{ category: '资料上交', value: 1 },
{ category: '教学质量', value: 1 },
{ category: '教育科研课题', value: 8 },
{ category: '个人材料发表和获奖', value: 9 },
{ category: '展示交流和比赛', value: 4 },
{ category: '工作室活动', value: 5 },
{ category: '荣誉', value: 6 },
{ category: '辅导学生', value: 7 },
{ category: '安全管理', value: 2 },
{ category: '班级常规管理', value: 7 },
]);
</script>
<style scoped lang="scss">
.container {
background-color: #f8f8f8;
min-height: 100vh;
padding: 15px;
box-sizing: border-box;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0; // Adjusted padding
font-size: 16px;
}
.score {
color: #333;
font-weight: bold;
}
.status {
display: flex;
align-items: center;
color: #666;
}
.status-indicator {
width: 12px;
height: 12px;
background-color: #4caf50; // Green color from the image
margin-left: 8px;
border-radius: 2px; // Slightly rounded corners
}
// Remove default card padding if needed
::v-deep .uni-card .uni-card__content {
padding: 10px 15px !important; // Overwrite default padding
}
.list-header {
display: flex;
justify-content: space-between;
padding: 10px 0; // Adjust padding as needed
border-bottom: 1px solid #eee;
color: #666;
font-size: 14px;
}
.category-header {
flex: 3; // Give more space to category
}
.value-header {
flex: 1;
text-align: right;
}
.list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0; // Vertical padding for spacing
border-bottom: 1px solid #eee;
font-size: 14px;
&:last-child {
border-bottom: none; // Remove border for the last item
}
}
.category-name {
flex: 3; // Corresponds to header
color: #333;
}
.value {
flex: 1; // Corresponds to header
text-align: right;
color: #333;
font-weight: 500;
}
</style>

View File

@ -0,0 +1,225 @@
<template>
<BasicLayout>
<view class="container">
<uni-card :is-shadow="false" is-full>
<view class="header">
<text class="score">我的得分: 84</text>
<view class="status">
<text>我的状态: </text>
<view class="status-indicator"></view>
<view class="review-count" v-if="reviewingCount > 0">
{{ reviewingCount }}项在审核
</view>
</view>
</view>
</uni-card>
<uni-card :is-shadow="false" is-full margin="10px 0 0 0">
<view class="list-header">
<text class="category-header">分类</text>
<text class="value-header">分值</text>
</view>
<view
class="list-item"
v-for="(item, index) in evaluationItems"
:key="index"
>
<view
class="flex-row items-center justify-between w-full"
@click="handleItemClick(item)"
>
<view class="category-name">{{ item.category }}</view>
<view class="flex-row items-center">
<text class="value">{{ item.value }}</text>
<view class="review-badge" v-if="item.isUnderReview"></view>
<u-icon name="arrow-right" size="16" color="#999"></u-icon
></view>
</view>
</view>
</uni-card>
</view>
<template #bottom>
<view class="white-bg-color py-5">
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="上传个人荣誉"
class="ml-15 mr-7"
:plain="true"
@click="scgrry"
/>
<u-button
text="上传公开课获奖"
class="mr-15 mr-7"
type="primary"
@click="scgkkhj"
/>
</view>
</view>
</template>
</BasicLayout>
</template>
<script lang="ts" setup>
import { ref, computed } from "vue";
const evaluationItems = ref([
{ category: "师德师风", value: 8, isUnderReview: false },
{ category: "考勤管理", value: 4, isUnderReview: true },
{ category: "资料上交", value: 1, isUnderReview: false },
{ category: "教学质量", value: 1, isUnderReview: true },
{ category: "教育科研课题", value: 8, isUnderReview: false },
{ category: "个人材料发表和获奖", value: 9, isUnderReview: true },
{ category: "展示交流和比赛", value: 4, isUnderReview: false },
{ category: "工作室活动", value: 5, isUnderReview: false },
{ category: "荣誉", value: 6, isUnderReview: true },
{ category: "辅导学生", value: 7, isUnderReview: false },
{ category: "安全管理", value: 2, isUnderReview: false },
{ category: "班级常规管理", value: 7, isUnderReview: true },
]);
//
const reviewingCount = computed(() => {
return evaluationItems.value.filter(item => item.isUnderReview).length;
});
function handleItemClick(item: any) {
uni.navigateTo({
url: `/pages/view/routine/JiFenPingJia/detail?id=${item.id}`,
});
}
function scgrry() {
uni.navigateTo({
url: `/pages/view/hr/teacherProfile/PersonalHonor`,
});
}
function scgkkhj() {
uni.navigateTo({
url: `/pages/view/hr/teacherProfile/PublicClassAwards`,
});
}
</script>
<style scoped lang="scss">
.container {
background-color: #f8f8f8;
min-height: 100vh;
padding: 15px;
box-sizing: border-box;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0; // Adjusted padding
font-size: 16px;
}
.score {
color: #333;
font-weight: bold;
}
.status {
display: flex;
align-items: center;
color: #666;
}
.status-indicator {
width: 12px;
height: 12px;
background-color: #4caf50; // Green color from the image
margin-left: 8px;
border-radius: 2px; // Slightly rounded corners
}
.review-count {
background-color: #fff2e8;
color: #ff6b35;
font-size: 12px;
padding: 2px 8px;
border-radius: 12px;
margin-left: 12px;
border: 1px solid #ff6b35;
font-weight: bold;
}
// Remove default card padding if needed
::v-deep .uni-card .uni-card__content {
padding: 10px 15px !important; // Overwrite default padding
}
.list-header {
display: flex;
justify-content: space-between;
padding: 10px 0; // Adjust padding as needed
border-bottom: 1px solid #eee;
color: #666;
font-size: 14px;
}
.category-header {
flex: 3; // Give more space to category
}
.value-header {
flex: 1;
text-align: right;
}
.list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0; // Vertical padding for spacing
border-bottom: 1px solid #eee;
font-size: 14px;
&:last-child {
border-bottom: none; // Remove border for the last item
}
}
.category-name {
flex: 3; // Corresponds to header
color: #333;
}
.value {
flex: 1; // Corresponds to header
text-align: right;
color: #333;
font-weight: 500;
}
.review-badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
background-color: #ff6b35;
color: #ffffff;
font-size: 12px;
font-weight: bold;
border-radius: 50%;
margin-left: 8px;
margin-right: 8px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
}
70% {
box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
}
}
</style>

View File

@ -0,0 +1,277 @@
<template>
<view class="detail-container">
<view class="content-wrapper">
<!-- 评分标准 -->
<view class="form-section">
<view class="section-title">评分标准</view>
<view class="standard-text">
1.一二年级考核语文数学两个学科平行班教学质量评价差距均在2分内的按一...
</view>
</view>
<!-- 考核评价 -->
<view class="detail-item">
<text class="detail-label">考核评价</text>
<text class="detail-value">{{ detailData.evaluationType }}</text>
</view>
<!-- 积分类型 -->
<view class="detail-item">
<text class="detail-label">积分类型</text>
<text class="detail-value">{{ detailData.scoreType }}</text>
</view>
<!-- 积分分值 -->
<view class="detail-item">
<text class="detail-label">积分分值</text>
<text class="detail-value">{{ detailData.scoreValue }}</text>
</view>
<!-- 考核处室 -->
<view class="detail-item">
<text class="detail-label">考核处室</text>
<text class="detail-value">{{ detailData.department }}</text>
</view>
<!-- 考核时间 -->
<view class="detail-item">
<text class="detail-label">考核时间</text>
<text class="detail-value">{{ detailData.evaluationDate }}</text>
</view>
<!-- 考核打分 -->
<view class="detail-item">
<text class="detail-label">考核打分</text>
<text class="detail-value">{{ detailData.score }}</text>
</view>
<!-- 证明材料 -->
<view class="detail-item file-section" v-if="detailData.files.length > 0">
<text class="detail-label">证明材料</text>
<view class="file-list">
<view
class="file-item"
v-for="(file, index) in detailData.files"
:key="index"
@click="previewFile(file)"
>
<uni-icons type="paperplane" size="16" color="#409eff" />
<text class="file-name">{{ file.name }}</text>
</view>
</view>
</view>
<!-- 转手机端按钮 -->
<view class="bottom-actions">
<button class="mobile-btn" @click="goBack">返回</button>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref, onMounted } from "vue";
interface DetailData {
evaluationType: string;
scoreType: string;
scoreValue: number | string;
department: string;
evaluationDate: string;
score: number | string;
files: Array<{ name: string; url: string }>;
}
//
const detailData = ref<DetailData>({
evaluationType: "考核评价",
scoreType: "加分",
scoreValue: 1,
department: "教科处",
evaluationDate: "2025-06-08",
score: 90,
files: [
{ name: "教学成果证明.pdf", url: "/files/certificate.pdf" },
{ name: "获奖证书.jpg", url: "/files/award.jpg" },
],
});
//
const goBack = () => {
uni.navigateBack();
};
//
const previewFile = (file: { name: string; url: string }) => {
//
const ext = file.name.split(".").pop()?.toLowerCase();
if (["jpg", "jpeg", "png", "gif"].includes(ext || "")) {
//
uni.previewImage({
urls: [file.url],
current: file.url,
});
} else {
//
uni.showModal({
title: "提示",
content: `是否下载文件: ${file.name}?`,
success: (res) => {
if (res.confirm) {
// TODO:
uni.showToast({
title: "开始下载",
icon: "success",
});
}
},
});
}
};
//
const transferToMobile = () => {
uni.showModal({
title: "提示",
content: "确定要转到手机端处理吗?",
success: (res) => {
if (res.confirm) {
// TODO:
uni.showToast({
title: "已转至手机端",
icon: "success",
});
}
},
});
};
onMounted(() => {
//
console.log("页面加载完成");
});
</script>
<style scoped lang="scss">
.detail-container {
min-height: 100vh;
background-color: #f5f5f5;
}
.content-wrapper {
padding: 30rpx 30rpx 40rpx;
}
.form-section {
background-color: #ffffff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.standard-text {
font-size: 28rpx;
color: #666;
line-height: 1.6;
}
}
.detail-item {
display: flex;
align-items: center;
background-color: #ffffff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.detail-label {
font-size: 28rpx;
color: #333;
width: 160rpx;
flex-shrink: 0;
}
.detail-value {
flex: 1;
font-size: 28rpx;
color: #333;
text-align: right;
}
}
.file-section {
flex-direction: column;
align-items: flex-start;
.detail-label {
margin-bottom: 20rpx;
}
.file-list {
width: 100%;
.file-item {
display: flex;
align-items: center;
padding: 15rpx 20rpx;
background-color: #f5f5f5;
border-radius: 8rpx;
margin-bottom: 10rpx;
cursor: pointer;
&:hover {
background-color: #e6f7ff;
}
uni-icons {
margin-right: 10rpx;
}
.file-name {
font-size: 26rpx;
color: #333;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.bottom-actions {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx 30rpx;
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
background-color: #ffffff;
border-top: 1rpx solid #eee;
.mobile-btn {
width: 100%;
height: 88rpx;
background-color: #ff4757;
color: #ffffff;
font-size: 32rpx;
font-weight: bold;
border-radius: 44rpx;
border: none;
display: flex;
align-items: center;
justify-content: center;
&:active {
background-color: #ff3742;
}
}
}
</style>

View File

@ -1,396 +1,393 @@
<template>
<BasicListLayout
:show-nav-bar="true"
:nav-bar-props="{ title: '教学资源' }"
@register="register"
>
<template #top>
<view class="filter-section">
<!-- Directory Filter -->
<view class="filter-item" @click="openFilterPopup('directory')">
<text>{{ selectedDirectory?.name || '目录' }}</text>
<uni-icons type="bottom" size="14"></uni-icons>
</view>
<!-- Type Filter 1 -->
<view class="filter-item" @click="openFilterPopup('type1')">
<text>{{ selectedType1?.name || '类型' }}</text>
<uni-icons type="bottom" size="14"></uni-icons>
</view>
<!-- Type Filter 2 -->
<view class="filter-item" @click="openFilterPopup('type2')">
<text>{{ selectedType2?.name || '类型' }}</text>
<uni-icons type="bottom" size="14"></uni-icons>
</view>
</view>
</template>
<template #default="{ list }">
<view class="list-container">
<!-- Add @click handler to navigate -->
<view class="resource-item" v-for="item in list" :key="item.id" @click="goToDetail(item.id)">
<view class="item-icon-container">
<view class="item-icon">{{ item.iconLetter }}</view>
<text class="item-pages">-{{ item.pages }}-</text>
<view class="teaching-resource-page">
<!-- 主要内容区域 -->
<view class="main-content">
<!-- 左侧课程列表 -->
<view class="left-panel">
<scroll-view class="subject-list" scroll-y="true" show-scrollbar="false">
<view
class="subject-item"
v-for="(subject, index) in subjectList"
:key="subject.id"
:class="{ active: selectedSubjectIndex === index }"
@click="selectSubject(index)"
>
<text class="subject-name">{{ subject.name }}</text>
</view>
<view class="item-details">
<text class="item-title">{{ item.title }}</text>
<view class="item-meta">
<text class="meta-text">{{ item.publishDate }}</text>
<text class="meta-text">浏览量: {{ item.views }}</text>
<text class="meta-text">下载量: {{ item.downloads }}</text>
</scroll-view>
</view>
<!-- 右侧内容区域 -->
<view class="right-panel">
<!-- 资源类型 -->
<view class="resource-section" v-if="currentSubject.resourceTypes && currentSubject.resourceTypes.length > 0">
<view class="section-title">资源类型</view>
<view class="type-grid">
<view
class="type-item"
v-for="(type, index) in currentSubject.resourceTypes"
:key="index"
@click="goToResourceList('type', type)"
>
<text class="type-text">{{ type }}</text>
</view>
</view>
</view>
<!-- 年级选择 -->
<view class="grade-section" v-if="currentSubject.grades && currentSubject.grades.length > 0">
<view class="section-title">年级</view>
<view class="grade-grid">
<view
class="grade-item"
v-for="(grade, index) in currentSubject.grades"
:key="index"
@click="goToResourceList('grade', grade)"
>
<text class="grade-text">{{ grade }}</text>
</view>
</view>
</view>
<!-- 空状态 -->
<view class="empty-state" v-if="!currentSubject.name">
<text class="empty-text">请从左侧选择学科</text>
</view>
</view>
</template>
</BasicListLayout>
<!-- Filter Popup -->
<uni-popup ref="filterPopupRef" type="bottom" background-color="#fff">
<view class="popup-content">
<view class="popup-header">
<text>{{ currentFilterTitle }}</text>
<uni-icons type="closeempty" size="20" @click="closeFilterPopup"></uni-icons>
</view>
<scroll-view scroll-y class="popup-options">
<view
class="option-item"
v-for="option in currentFilterOptions"
:key="option.id"
:class="{ active: isOptionSelected(option) }"
@click="selectFilterOption(option)"
>
{{ option.name }}
</view>
</scroll-view>
</view>
</uni-popup>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref, computed } from "vue";
import { useLayout } from "@/components/BasicListLayout/hooks/useLayout";
import { reactive, ref, computed, onMounted } from "vue";
interface Resource {
id: number;
iconLetter: string;
title: string;
pages: number;
publishDate: string;
views: number;
downloads: number;
}
interface FilterOption {
id: string | number | null;
//
interface Subject {
id: string;
name: string;
description: string;
resourceTypes?: string[];
grades?: string[];
}
// --- Filter Data (Mock) ---
const directories = ref<FilterOption[]>([
{ id: null, name: '全部目录' },
{ id: 'd1', name: '数学教案' },
{ id: 'd2', name: '语文课件' },
{ id: 'd3', name: '英语练习' },
{ id: 'd4', name: '科学实验' },
]);
//
const selectedSubjectIndex = ref(1); //
const types1 = ref<FilterOption[]>([
{ id: null, name: '全部类型1' },
{ id: 't1-1', name: '课件PPT' },
{ id: 't1-2', name: '教学视频' },
{ id: 't1-3', name: 'Word文档' },
]);
const types2 = ref<FilterOption[]>([
{ id: null, name: '全部类型2' },
{ id: 't2-1', name: '期中' },
{ id: 't2-2', name: '期末' },
{ id: 't2-3', name: '单元测试' },
]);
// --- Filter State ---
const selectedDirectory = ref<FilterOption | null>(directories.value[0]);
const selectedType1 = ref<FilterOption | null>(types1.value[0]);
const selectedType2 = ref<FilterOption | null>(types2.value[0]);
const filterPopupRef = ref<any>(null);
const currentFilterType = ref<'directory' | 'type1' | 'type2' | null>(null);
// --- Computed Properties for Popup ---
const currentFilterOptions = computed(() => {
switch (currentFilterType.value) {
case 'directory': return directories.value;
case 'type1': return types1.value;
case 'type2': return types2.value;
default: return [];
}
});
const currentFilterTitle = computed(() => {
switch (currentFilterType.value) {
case 'directory': return '选择目录';
case 'type1': return '选择类型1';
case 'type2': return '选择类型2';
default: return '选择选项';
}
});
const isOptionSelected = (option: FilterOption) => {
switch (currentFilterType.value) {
case 'directory': return selectedDirectory.value?.id === option.id;
case 'type1': return selectedType1.value?.id === option.id;
case 'type2': return selectedType2.value?.id === option.id;
default: return false;
}
};
// --- Mock API (Changed return type to Promise<any>) ---
const testList = async (params: any): Promise<any> => {
console.log('API called with params:', params);
const page = params.page || 1;
const pageSize = params.pageSize || 10;
const allItems: Resource[] = Array.from({ length: 50 }).map((_, index) => {
const id = index + 1;
const directoryFilter = params.directoryId ? `[目录${params.directoryId}]` : '';
const type1Filter = params.type1Id ? `[类型1-${params.type1Id}]` : '';
const type2Filter = params.type2Id ? `[类型2-${params.type2Id}]` : '';
return {
id: id,
iconLetter: 'W',
title: `专题${String(id).padStart(2, '0')}${directoryFilter}${type1Filter}${type2Filter} (突破)`,
pages: 30 + (id % 15),
publishDate: `0${1 + (id % 9)}${10 + (id % 20)}日发布`,
views: 1500 + (id * 17 % 500),
downloads: 50 + (id * 7 % 40),
};
});
let filteredItems = allItems;
if (params.directoryId) {
filteredItems = filteredItems.filter(item => item.title.includes(`[目录${params.directoryId}]`));
}
if (params.type1Id) {
filteredItems = filteredItems.filter(item => item.title.includes(`[类型1-${params.type1Id}]`));
}
if (params.type2Id) {
filteredItems = filteredItems.filter(item => item.title.includes(`[类型2-${params.type2Id}]`));
}
const totalFilteredItems = filteredItems.length;
const paginatedItems = filteredItems.slice((page - 1) * pageSize, page * pageSize);
return new Promise((resolve) => {
setTimeout(() => {
// Return structure expected by useLayout
resolve({ message: "成功", resultCode: 200, rows: paginatedItems, total: totalFilteredItems });
}, 300);
});
};
// --- Layout Hook (Removed 'immediate' from componentProps) ---
const [register, { reload, setParam }] = useLayout({
api: testList,
componentProps: {
// No problematic props
//
const subjectList = reactive<Subject[]>([
{
id: 'chinese',
name: '语文',
description: '语言文字运用与文学鉴赏',
resourceTypes: ['课件', '教案', '学案', '作业', '试卷'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'math',
name: '数学',
description: '数学思维与逻辑推理',
resourceTypes: ['题集', '素材', '备课综合'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'english',
name: '英语',
description: '英语听说读写综合能力',
resourceTypes: ['课件', '音频', '视频', '练习'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'moral',
name: '道德与法治',
description: '品德修养与法律意识',
resourceTypes: [],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'science',
name: '科学',
description: '科学探究与实验操作',
resourceTypes: ['实验', '课件', '视频'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'it',
name: '信息科技',
description: '信息技术与编程思维',
resourceTypes: ['软件', '教程', '项目'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'music',
name: '音乐',
description: '音乐欣赏与艺术表现',
resourceTypes: ['音频', '乐谱', '视频'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'art',
name: '美术',
description: '美术创作与艺术鉴赏',
resourceTypes: ['图片', '视频', '作品'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'pe',
name: '体育',
description: '体育运动与健康生活',
resourceTypes: ['视频', '规则', '训练'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'labor',
name: '劳动技术',
description: '劳动实践与技能培养',
resourceTypes: ['教程', '工具', '项目'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'expand',
name: '拓展',
description: '综合素质拓展活动',
resourceTypes: ['活动', '方案', '素材'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'psychology',
name: '心理健康',
description: '心理健康与情感教育',
resourceTypes: ['课件', '测试', '案例'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'practice',
name: '综合实践',
description: '综合实践活动课程',
resourceTypes: ['方案', '案例', '工具'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
},
{
id: 'calligraphy',
name: '书法',
description: '书法艺术与汉字文化',
resourceTypes: ['字帖', '视频', '作品'],
grades: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
}
]);
//
const currentSubject = computed(() => {
return subjectList[selectedSubjectIndex.value] || {};
});
// --- Navigation ---
const goToDetail = (id: number) => {
//
const selectSubject = (index: number) => {
selectedSubjectIndex.value = index;
};
//
const goToResourceList = (filterType: string, filterValue: string) => {
const subject = currentSubject.value;
const params = {
subjectId: subject.id,
subjectName: subject.name,
filterType: filterType,
filterValue: filterValue
};
const queryString = Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&');
uni.navigateTo({
url: `./detail?id=${id}` // Navigate to detail page in the same directory
url: `/pages/view/routine/JiaoXueZiYuan/indexList?${queryString}`
});
};
// --- Filter Popup Methods ---
const openFilterPopup = (type: 'directory' | 'type1' | 'type2') => {
currentFilterType.value = type;
filterPopupRef.value?.open();
};
const closeFilterPopup = () => {
filterPopupRef.value?.close();
};
const selectFilterOption = (option: FilterOption) => {
switch (currentFilterType.value) {
case 'directory':
selectedDirectory.value = option;
setParam({ directoryId: option.id });
break;
case 'type1':
selectedType1.value = option;
setParam({ type1Id: option.id });
break;
case 'type2':
selectedType2.value = option;
setParam({ type2Id: option.id });
break;
}
closeFilterPopup();
};
onMounted(() => {
//
console.log('教学资源页面加载完成');
});
</script>
<style scoped lang="scss">
.filter-section {
.teaching-resource-page {
min-height: 100vh;
background: #f5f5f5;
display: flex;
justify-content: space-around;
align-items: center;
padding: 20rpx 30rpx;
background-color: #ffffff;
border-bottom: 1rpx solid #e0e0e0;
position: sticky;
// Adjust top based on your actual NavBar height if needed
// Consider using var(--status-bar-height) + 44px (uni-app standard NavBar)
top: 0;
z-index: 10;
flex-direction: column;
}
.filter-item {
display: flex;
align-items: center;
font-size: 28rpx;
color: #666;
padding: 10rpx; // Add padding for better click area
//
.main-content {
flex: 1;
display: flex;
height: 100vh;
}
//
.left-panel {
width: 280rpx;
background: #ffffff;
border-right: 1px solid #e5e5e5;
.subject-list {
height: 100%;
}
.subject-item {
padding: 30rpx 20rpx;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
text {
margin-right: 8rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 150rpx; // Limit text width
.subject-name {
font-size: 28rpx;
color: #666666;
display: block;
}
uni-icons {
color: #999;
}
}
}
&.active {
background: #fff3e0;
.list-container {
background-color: #f4f5f7;
/* Add padding-top to prevent content from hiding behind sticky filter */
/* Adjust value based on filter-section height */
}
.resource-item {
display: flex;
align-items: center;
background-color: #ffffff;
border-radius: 16rpx;
padding: 25rpx 20rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
cursor: pointer; // Add cursor pointer to indicate clickability
.item-icon-container {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 25rpx;
flex-shrink: 0;
.item-icon {
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
background-color: #409eff;
color: #ffffff;
font-size: 40rpx;
font-weight: bold;
text-align: center;
margin-bottom: 8rpx;
}
.item-pages {
font-size: 22rpx;
color: #999;
}
}
.item-details {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
.item-title {
font-size: 30rpx;
color: #333;
font-weight: bold;
margin-bottom: 15rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item-meta {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #999;
flex-wrap: wrap;
.meta-text {
margin-right: 15rpx;
white-space: nowrap;
&:last-child {
margin-right: 0;
}
.subject-name {
color: #ff9800;
font-weight: 600;
}
}
&:hover:not(.active) {
background: #f8f9fa;
}
}
}
// Popup Styles
.popup-content {
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding: 20rpx;
padding-bottom: 40rpx; // Add space at the bottom
}
.popup-header {
//
.right-panel {
flex: 1;
background: #ffffff;
padding: 40rpx;
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: center;
padding: 15rpx 10rpx;
font-size: 32rpx;
font-weight: bold;
border-bottom: 1rpx solid #eee;
margin-bottom: 10rpx;
flex-direction: column;
}
.popup-options {
max-height: 60vh; // Limit popup height
}
//
.resource-section,
.grade-section {
margin-bottom: 40rpx;
flex-shrink: 0;
.option-item {
padding: 25rpx 20rpx;
font-size: 28rpx;
color: #333;
border-bottom: 1rpx solid #f5f5f5;
cursor: pointer;
&:last-child {
border-bottom: none;
.section-title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
margin-bottom: 30rpx;
}
}
&.active {
color: #409eff; // Highlight selected item
font-weight: bold;
//
.type-grid {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
margin-bottom: 20rpx;
}
.type-item {
padding: 20rpx 30rpx;
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8rpx;
cursor: pointer;
transition: all 0.3s ease;
.type-text {
font-size: 28rpx;
color: #666666;
}
&:hover {
background-color: #f9f9f9; // Subtle hover effect
border-color: #ff9800;
background: #fff3e0;
.type-text {
color: #ff9800;
}
}
}
//
.grade-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
}
.grade-item {
padding: 25rpx 20rpx;
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8rpx;
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
.grade-text {
font-size: 28rpx;
color: #666666;
}
&:hover {
border-color: #ff9800;
background: #fff3e0;
.grade-text {
color: #ff9800;
}
}
}
//
.empty-state {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
.empty-text {
font-size: 28rpx;
color: #999999;
}
}
//
@media (max-width: 768px) {
.left-panel {
width: 150rpx;
}
.subject-item {
padding: 20rpx 10rpx;
.subject-name {
font-size: 12px;
}
}
.right-panel {
padding: 20rpx;
}
.tag-item {
padding: 10rpx 18rpx;
.tag-text {
font-size: 12px;
}
}
}
</style>

View File

@ -0,0 +1,468 @@
<template>
<BasicListLayout
:show-nav-bar="true"
:nav-bar-props="{ title: '教学资源' }"
@register="register"
>
<template #top>
<view class="search-section">
<view class="search-box">
<uni-icons type="search" size="18" color="#999"></uni-icons>
<input
class="search-input"
type="text"
placeholder="搜索教学资源..."
v-model="searchKeyword"
@input="onSearchInput"
@confirm="onSearchConfirm"
/>
<view class="search-clear" v-if="searchKeyword" @click="clearSearch">
<uni-icons type="clear" size="16" color="#999"></uni-icons>
</view>
</view>
</view>
</template>
<template #default="{ list }">
<view class="list-container">
<!-- Add @click handler to navigate -->
<view class="resource-item" v-for="item in list" :key="item.id" @click="goToDetail(item.id)">
<view class="item-icon-container">
<view class="item-icon">{{ item.iconLetter }}</view>
<text class="item-pages">-{{ item.pages }}-</text>
</view>
<view class="item-details">
<text class="item-title">{{ item.title }}</text>
<!-- 标签区域 -->
<view class="tags-container" v-if="item.tags && item.tags.length > 0">
<view class="tag-item" v-for="tag in item.tags" :key="tag">{{ tag }}</view>
</view>
<view class="item-meta">
<text class="meta-text">{{ item.publishDate }}</text>
<text class="meta-text">浏览量: {{ item.views }}</text>
<text class="meta-text">下载量: {{ item.downloads }}</text>
</view>
</view>
</view>
</view>
</template>
</BasicListLayout>
<!-- Filter Popup -->
<uni-popup ref="filterPopupRef" type="bottom" background-color="#fff">
<view class="popup-content">
<view class="popup-header">
<text>{{ currentFilterTitle }}</text>
<uni-icons type="closeempty" size="20" @click="closeFilterPopup"></uni-icons>
</view>
<scroll-view scroll-y class="popup-options">
<view
class="option-item"
v-for="option in currentFilterOptions"
:key="option.id ?? 'null'"
:class="{ active: isOptionSelected(option) }"
@click="selectFilterOption(option)"
>
{{ option.name }}
</view>
</scroll-view>
</view>
</uni-popup>
</template>
<script lang="ts" setup>
import { ref, computed } from "vue";
import { useLayout } from "@/components/BasicListLayout/hooks/useLayout";
interface Resource {
id: number;
iconLetter: string;
title: string;
pages: number;
publishDate: string;
views: number;
downloads: number;
tags: string[];
}
interface FilterOption {
id: string | number | null;
name: string;
}
// --- Filter Data (Mock) ---
const directories = ref<FilterOption[]>([
{ id: null, name: '全部目录' },
{ id: 'd1', name: '数学教案' },
{ id: 'd2', name: '语文课件' },
{ id: 'd3', name: '英语练习' },
{ id: 'd4', name: '科学实验' },
]);
const types1 = ref<FilterOption[]>([
{ id: null, name: '全部类型1' },
{ id: 't1-1', name: '课件PPT' },
{ id: 't1-2', name: '教学视频' },
{ id: 't1-3', name: 'Word文档' },
]);
const types2 = ref<FilterOption[]>([
{ id: null, name: '全部类型2' },
{ id: 't2-1', name: '期中' },
{ id: 't2-2', name: '期末' },
{ id: 't2-3', name: '单元测试' },
]);
// --- Search State ---
const searchKeyword = ref<string>('');
// --- Filter State ---
const selectedDirectory = ref<FilterOption | null>(directories.value[0]);
const selectedType1 = ref<FilterOption | null>(types1.value[0]);
const selectedType2 = ref<FilterOption | null>(types2.value[0]);
const filterPopupRef = ref<any>(null);
const currentFilterType = ref<'directory' | 'type1' | 'type2' | null>(null);
// --- Computed Properties for Popup ---
const currentFilterOptions = computed(() => {
switch (currentFilterType.value) {
case 'directory': return directories.value;
case 'type1': return types1.value;
case 'type2': return types2.value;
default: return [];
}
});
const currentFilterTitle = computed(() => {
switch (currentFilterType.value) {
case 'directory': return '选择目录';
case 'type1': return '选择类型1';
case 'type2': return '选择类型2';
default: return '选择选项';
}
});
const isOptionSelected = (option: FilterOption) => {
switch (currentFilterType.value) {
case 'directory': return selectedDirectory.value?.id === option.id;
case 'type1': return selectedType1.value?.id === option.id;
case 'type2': return selectedType2.value?.id === option.id;
default: return false;
}
};
// --- Mock API (Changed return type to Promise<any>) ---
const testList = async (params: any): Promise<any> => {
console.log('API called with params:', params);
const page = params.page || 1;
const pageSize = params.pageSize || 10;
const allItems: Resource[] = Array.from({ length: 50 }).map((_, index) => {
const id = index + 1;
const directoryFilter = params.directoryId ? `[目录${params.directoryId}]` : '';
const type1Filter = params.type1Id ? `[类型1-${params.type1Id}]` : '';
const type2Filter = params.type2Id ? `[类型2-${params.type2Id}]` : '';
//
const subjectTags = ['语文', '数学', '英语', '科学', '历史'];
const gradeTags = ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级'];
const termTags = ['上册', '下册'];
const typeTags = ['练习题', '课件', '教案', '测试卷'];
const tags = [
subjectTags[id % subjectTags.length],
gradeTags[id % gradeTags.length],
termTags[id % termTags.length],
...(id % 3 === 0 ? [typeTags[id % typeTags.length]] : [])
];
return {
id: id,
iconLetter: 'W',
title: `专题${String(id).padStart(2, '0')}${directoryFilter}${type1Filter}${type2Filter} (突破)`,
pages: 30 + (id % 15),
publishDate: `0${1 + (id % 9)}${10 + (id % 20)}日发布`,
views: 1500 + (id * 17 % 500),
downloads: 50 + (id * 7 % 40),
tags: tags,
};
});
let filteredItems = allItems;
//
if (params.keyword) {
filteredItems = filteredItems.filter(item =>
item.title.toLowerCase().includes(params.keyword.toLowerCase())
);
}
if (params.directoryId) {
filteredItems = filteredItems.filter(item => item.title.includes(`[目录${params.directoryId}]`));
}
if (params.type1Id) {
filteredItems = filteredItems.filter(item => item.title.includes(`[类型1-${params.type1Id}]`));
}
if (params.type2Id) {
filteredItems = filteredItems.filter(item => item.title.includes(`[类型2-${params.type2Id}]`));
}
const totalFilteredItems = filteredItems.length;
const paginatedItems = filteredItems.slice((page - 1) * pageSize, page * pageSize);
return new Promise((resolve) => {
setTimeout(() => {
// Return structure expected by useLayout
resolve({ message: "成功", resultCode: 200, rows: paginatedItems, total: totalFilteredItems });
}, 300);
});
};
// --- Layout Hook (Removed 'immediate' from componentProps) ---
const [register, { reload, setParam }] = useLayout({
api: testList,
componentProps: {
// No problematic props
},
});
// --- Search Methods ---
const onSearchInput = () => {
setParam({ keyword: searchKeyword.value });
};
const onSearchConfirm = () => {
setParam({ keyword: searchKeyword.value });
};
const clearSearch = () => {
searchKeyword.value = '';
setParam({ keyword: '' });
};
// --- Navigation ---
const goToDetail = (id: number) => {
uni.navigateTo({
url: `./detail?id=${id}` // Navigate to detail page in the same directory
});
};
// --- Filter Popup Methods ---
const openFilterPopup = (type: 'directory' | 'type1' | 'type2') => {
currentFilterType.value = type;
filterPopupRef.value?.open();
};
const closeFilterPopup = () => {
filterPopupRef.value?.close();
};
const selectFilterOption = (option: FilterOption) => {
switch (currentFilterType.value) {
case 'directory':
selectedDirectory.value = option;
setParam({ directoryId: option.id });
break;
case 'type1':
selectedType1.value = option;
setParam({ type1Id: option.id });
break;
case 'type2':
selectedType2.value = option;
setParam({ type2Id: option.id });
break;
}
closeFilterPopup();
};
</script>
<style scoped lang="scss">
.search-section {
padding: 20rpx 30rpx;
background-color: #ffffff;
border-bottom: 1rpx solid #e0e0e0;
position: sticky;
top: 0;
z-index: 10;
.search-box {
display: flex;
align-items: center;
background-color: #f5f5f5;
border-radius: 50rpx;
padding: 0 20rpx;
height: 70rpx;
uni-icons {
margin-right: 15rpx;
}
.search-input {
flex: 1;
height: 100%;
border: none;
background: transparent;
font-size: 28rpx;
color: #333;
&::placeholder {
color: #999;
}
}
.search-clear {
margin-left: 15rpx;
cursor: pointer;
}
}
}
.list-container {
background-color: #f4f5f7;
/* Add padding-top to prevent content from hiding behind sticky filter */
/* Adjust value based on filter-section height */
}
.resource-item {
display: flex;
align-items: center;
background-color: #ffffff;
border-radius: 16rpx;
padding: 25rpx 20rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
cursor: pointer; // Add cursor pointer to indicate clickability
.item-icon-container {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 25rpx;
flex-shrink: 0;
.item-icon {
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
background-color: #409eff;
color: #ffffff;
font-size: 40rpx;
font-weight: bold;
text-align: center;
margin-bottom: 8rpx;
}
.item-pages {
font-size: 22rpx;
color: #999;
}
}
.item-details {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
.item-title {
font-size: 30rpx;
color: #333;
font-weight: bold;
margin-bottom: 15rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tags-container {
display: flex;
flex-wrap: wrap;
gap: 10rpx;
margin-bottom: 15rpx;
.tag-item {
background-color: #f0f2f5;
color: #666;
font-size: 22rpx;
padding: 8rpx 16rpx;
border-radius: 20rpx;
white-space: nowrap;
border: 1rpx solid #e0e0e0;
&:first-child {
background-color: #e7f4ff;
color: #1890ff;
border-color: #91d5ff;
}
}
}
.item-meta {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #999;
flex-wrap: wrap;
.meta-text {
margin-right: 15rpx;
white-space: nowrap;
&:last-child {
margin-right: 0;
}
}
}
}
}
// Popup Styles
.popup-content {
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding: 20rpx;
padding-bottom: 40rpx; // Add space at the bottom
}
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15rpx 10rpx;
font-size: 32rpx;
font-weight: bold;
border-bottom: 1rpx solid #eee;
margin-bottom: 10rpx;
}
.popup-options {
max-height: 60vh; // Limit popup height
}
.option-item {
padding: 25rpx 20rpx;
font-size: 28rpx;
color: #333;
border-bottom: 1rpx solid #f5f5f5;
cursor: pointer;
&:last-child {
border-bottom: none;
}
&.active {
color: #409eff; // Highlight selected item
font-weight: bold;
}
&:hover {
background-color: #f9f9f9; // Subtle hover effect
}
}
</style>

View File

@ -0,0 +1,174 @@
<template>
<view class="container">
<view class="content">
<!-- 党政职务 -->
<view class="section">
<view class="section-title">党政职务</view>
<view class="position-display">
<text class="position-text" v-for="item in partyPositions" :key="item.id">
{{ item.name }}
</text>
</view>
</view>
<!-- 其他职务 -->
<view class="section">
<view class="section-title">其他职务</view>
<view class="position-display">
<text class="position-text" v-for="item in otherPositions" :key="item.id">
{{ item.name }}
</text>
</view>
</view>
<!-- 任职信息列表 -->
<view class="info-list">
<view class="info-item" v-for="item in teachingInfo" :key="item.key">
<view class="info-label">{{ item.label }}</view>
<view class="info-value">
<text :class="{ empty: item.isEmpty }">{{ item.value }}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref } from "vue";
//
const partyPositions = ref([
{ id: 1, name: "党委(总支)书记" },
{ id: 2, name: "党委(总支)副书记" },
]);
//
const otherPositions = ref([{ id: 1, name: "党支部支委" }]);
//
const teachingInfo = ref([
{
key: "mainSubject",
label: "主任学科",
value: "音乐",
isEmpty: false,
},
{
key: "mainClass",
label: "主任班级",
value: "未填写",
isEmpty: true,
},
{
key: "partTimeSubject",
label: "兼任学科",
value: "未填写",
isEmpty: true,
},
{
key: "partTimeClass",
label: "兼任班级",
value: "未填写",
isEmpty: true,
},
{
key: "grade",
label: "所属年级",
value: "一年级(2024级)",
isEmpty: false,
},
{
key: "headTeacherClass",
label: "所任班主任班级",
value: "8班",
isEmpty: false,
},
]);
//
const goBack = () => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
.container {
min-height: 100vh;
background-color: #f5f5f5;
}
.content {
padding-bottom: 40rpx;
}
.section {
background-color: #ffffff;
margin-bottom: 20rpx;
padding: 30rpx;
.section-title {
font-size: 32rpx;
color: #333;
font-weight: bold;
margin-bottom: 20rpx;
}
}
//
.position-display {
.position-text {
display: inline-block;
font-size: 28rpx;
color: #333;
margin-right: 20rpx;
margin-bottom: 10rpx;
&:not(:last-child)::after {
content: '、';
margin-left: 0;
margin-right: 0;
}
}
}
//
.info-list {
background-color: #ffffff;
border-radius: 16rpx;
overflow: hidden;
margin: 0 30rpx;
}
.info-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.info-label {
font-size: 28rpx;
color: #333;
flex-shrink: 0;
}
.info-value {
flex: 1;
text-align: right;
text {
font-size: 28rpx;
color: #333;
&.empty {
color: #999;
}
}
}
}
</style>

View File

@ -1,17 +1,16 @@
<template>
<view class="page-container">
<!-- 1. 顶部 Banner -->
<view class="header-banner mx-15 mt-15 r-md" style="box-sizing: border-box">
<!-- <view class="header-banner mx-15 mt-15 r-md" style="box-sizing: border-box">
<view class="banner-text">
<text class="banner-title">上课巡查</text>
<text class="banner-subtitle">泸州市实验小学城西学校</text>
</view>
<!-- 右侧图片区域暂时留空或用占位符 -->
<view class="banner-image-placeholder"></view>
</view>
</view> -->
<!-- 2. 我的应用 -->
<view class="section my-apps mt-15 px-15">
<!-- <view class="section my-apps mt-15 px-15">
<view class="section-title-bar">
<view class="decorator"></view>
<text class="title-text">我的应用</text>
@ -20,19 +19,17 @@
<view class="app-grid">
<view class="app-item" @click="goToRecord">
<view class="app-icon-wrapper record-icon">
<!-- 暂时用背景色代替图标 -->
</view>
<text class="app-text">巡查记录</text>
</view>
<view class="app-item" @click="goToSummary">
<view class="app-icon-wrapper summary-icon">
<!-- 暂时用背景色代替图标 -->
</view>
<text class="app-text">巡查汇总</text>
</view>
</view>
</uni-card>
</view>
</view> -->
<!-- 3. 巡检情况 -->
<view class="section inspection-status flex-1 flex-col mt-15">