diff --git a/src/api/base/server.ts b/src/api/base/server.ts index d158eb5..04b3e26 100644 --- a/src/api/base/server.ts +++ b/src/api/base/server.ts @@ -204,6 +204,48 @@ export const zymlFindTreeByZylxApi = async (params: any) => { return await get("/api/zyml/qryTreeByZylx", params); }; +// ==================== 资源包(Zy)相关API ==================== +// 获取资源包分页列表 +export const zyFindPageApi = async (params: any) => { + return await get("/api/zy/findPage", params); +}; + +// 保存资源包(新增/编辑) +export const zySaveApi = async (params: any) => { + return await post("/api/zy/save", params); +}; + +// 收藏/取消收藏资源包 +export const zyCollectApi = async (params: { zyId: string }) => { + return await post(`/api/zy/collect?zyId=${params.zyId}`); +}; + +// 点赞/取消点赞资源包 +export const zyLikeApi = async (params: { zyId: string }) => { + return await post(`/api/zy/like?zyId=${params.zyId}`); +}; + +// 评分资源包 +export const zyScoreApi = async (params: { zyId: string; score: number; comment?: string }) => { + const queryParams = new URLSearchParams({ + zyId: params.zyId, + score: params.score.toString(), + ...(params.comment ? { comment: params.comment } : {}) + }); + return await post(`/api/zy/score?${queryParams.toString()}`); +}; + +// 根据ID查询资源包详情(包含资源明细和用户状态) +export const zyGetDetailApi = async (params: { id: string }) => { + return await get("/api/zy/getDetail", params); +}; + +// 删除资源包 +export const zyLogicDeleteApi = async (params: { ids: string }) => { + return await post("/api/zy/logicDelete", params); +}; + +// ==================== 资源明细(Zymx)相关API ==================== // 获取资源明细分页 export const zymxFindPageApi = async (params: any) => { return await get("/api/zymx/findPage", params); diff --git a/src/pages.json b/src/pages.json index b9586f5..6537876 100644 --- a/src/pages.json +++ b/src/pages.json @@ -381,6 +381,27 @@ "enablePullDownRefresh": false } }, + { + "path": "pages/view/routine/JiaoXueZiYuan/zy-detail", + "style": { + "navigationBarTitleText": "资源包详情", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/view/routine/JiaoXueZiYuan/zy-list", + "style": { + "navigationBarTitleText": "教学资源包", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/view/routine/JiaoXueZiYuan/zy-add", + "style": { + "navigationBarTitleText": "新增资源包", + "enablePullDownRefresh": false + } + }, { "path": "pages/view/routine/HuoDongZiYuan/index", "style": { diff --git a/src/pages/base/service/index.vue b/src/pages/base/service/index.vue index 4be6616..23b5660 100644 --- a/src/pages/base/service/index.vue +++ b/src/pages/base/service/index.vue @@ -442,7 +442,7 @@ const sections = reactive([ { id: "r5", icon: "stxc", - text: "食堂巡查", + text: "食堂日志", show: true, permissionKey: "routine-stxc", // 食堂巡查权限编码 path: "/pages/view/routine/ShiTangXunCha/index", diff --git a/src/pages/view/routine/JiaoXueZiYuan/index.vue b/src/pages/view/routine/JiaoXueZiYuan/index.vue index fbb6546..cd84c20 100644 --- a/src/pages/view/routine/JiaoXueZiYuan/index.vue +++ b/src/pages/view/routine/JiaoXueZiYuan/index.vue @@ -133,8 +133,10 @@ const goTo = function () { } const params = { - resourType: leafNode.key, // ✅ 动态获取叶子节点的key - category: curCategory.value.key, + zymlId: leafNode.key, // 资源目录ID(用于资源包查询) + zyCategory: curCategory.value.key, // 资源类别 + resourType: leafNode.key, // 资源类型(用于资源明细查询,兼容旧版) + category: curCategory.value.key, // 类别(兼容旧版) }; console.log('选择的参数:', { @@ -148,8 +150,10 @@ const goTo = function () { }); setData(params); + + // 直接跳转到资源包列表 uni.navigateTo({ - url: `/pages/view/routine/JiaoXueZiYuan/indexList` + url: `/pages/view/routine/JiaoXueZiYuan/zy-list` }); } diff --git a/src/pages/view/routine/JiaoXueZiYuan/zy-add.vue b/src/pages/view/routine/JiaoXueZiYuan/zy-add.vue new file mode 100644 index 0000000..61d2d02 --- /dev/null +++ b/src/pages/view/routine/JiaoXueZiYuan/zy-add.vue @@ -0,0 +1,703 @@ + + + + + + diff --git a/src/pages/view/routine/JiaoXueZiYuan/zy-detail.vue b/src/pages/view/routine/JiaoXueZiYuan/zy-detail.vue new file mode 100644 index 0000000..a417f2d --- /dev/null +++ b/src/pages/view/routine/JiaoXueZiYuan/zy-detail.vue @@ -0,0 +1,808 @@ + + + + + + diff --git a/src/pages/view/routine/JiaoXueZiYuan/zy-list.vue b/src/pages/view/routine/JiaoXueZiYuan/zy-list.vue new file mode 100644 index 0000000..eddb526 --- /dev/null +++ b/src/pages/view/routine/JiaoXueZiYuan/zy-list.vue @@ -0,0 +1,663 @@ + + + + + + diff --git a/src/pages/view/routine/kefuxuncha/kyRecord.vue b/src/pages/view/routine/kefuxuncha/kyRecord.vue index ba9acbe..eb5522e 100644 --- a/src/pages/view/routine/kefuxuncha/kyRecord.vue +++ b/src/pages/view/routine/kefuxuncha/kyRecord.vue @@ -57,18 +57,18 @@ {{ idx + 1 }}、{{ xm.xcMc }} - - 扣分:-{{ xm.xmFz }}分 + + 优点 - - 不扣分 + + 缺点 diff --git a/src/pages/view/routine/kefuxuncha/xcRecord.vue b/src/pages/view/routine/kefuxuncha/xcRecord.vue index b3e0666..1e9448b 100644 --- a/src/pages/view/routine/kefuxuncha/xcRecord.vue +++ b/src/pages/view/routine/kefuxuncha/xcRecord.vue @@ -55,18 +55,18 @@ {{ idx + 1 }}、{{ xm.xcMc }} - - 扣分:-{{ xm.xmFz }}分 + + 优点 - - 不扣分 + + 缺点 diff --git a/src/pages/view/routine/zbxc/xcPbList.vue b/src/pages/view/routine/zbxc/xcPbList.vue index 78063bf..a78a8cb 100644 --- a/src/pages/view/routine/zbxc/xcPbList.vue +++ b/src/pages/view/routine/zbxc/xcPbList.vue @@ -85,7 +85,7 @@ import { useDataStore } from "@/store/modules/data"; import { getPbPageApi } from "@/api/base/pbApi"; import dayjs from "dayjs"; -const { getJs } = useUserStore(); +const { getJs, getUser } = useUserStore(); const { getData, setData } = useDataStore(); // 排班列表数据 @@ -118,7 +118,7 @@ const loadPbList = async (isRefresh = false) => { } try { - const params = { + const params: any = { page: pagination.page, rows: pagination.pageSize, xclx: 'C', // 巡查类型:C-值周巡查 @@ -128,6 +128,30 @@ const loadPbList = async (isRefresh = false) => { // xqId: '', // 学期ID }; + // 权限判断:如果不是 admin 用户,则传递当前教师ID进行过滤 + const user = getUser; + const js = getJs; + const empCode = user?.empCode || ''; + + // 调试日志 + console.log('=== 值周巡查权限判断 ==='); + console.log('getUser:', user); + console.log('getUser.empCode:', user?.empCode); + console.log('empCode:', empCode); + console.log('getJs:', js); + console.log('getJs.id:', js?.id); + + if (empCode === 'admin') { + // admin 用户:不传任何过滤参数,可以查看所有排班 + console.log('权限:admin 用户,查看所有排班'); + } else { + // 非 admin 用户:传递 dqjsId(使用 FIND_IN_SET 精确匹配),只能查看自己参与的排班 + params.dqjsId = js?.id; // 当前教师ID + console.log('权限:普通用户,过滤条件 dqjsId =', params.dqjsId); + } + console.log('最终请求参数:', params); + console.log('========================='); + const res: any = await getPbPageApi(params); // 根据实际API响应结构判断成功条件 diff --git a/src/pages/view/routine/zbxc/zbDetail.vue b/src/pages/view/routine/zbxc/zbDetail.vue index 5eeb2e0..7abc258 100644 --- a/src/pages/view/routine/zbxc/zbDetail.vue +++ b/src/pages/view/routine/zbxc/zbDetail.vue @@ -53,6 +53,20 @@ + + + + + 巡查年级班级 + + + + {{ selectedClassText || "请选择年级班级" }} + + + + + @@ -160,7 +174,7 @@ :disabled="isSubmitting" @click="submit" > - {{ isSubmitting ? (xcRecordId ? '更新中...' : '提交中...') : (xcRecordId ? '更新巡查' : '提交巡查') }} + {{ isSubmitting ? '提交中...' : '提交巡查' }} @@ -198,6 +212,19 @@ + + + @@ -819,6 +832,35 @@ onMounted(async () => { } } +.class-select-card { + background-color: white; +} + +.class-selector { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 15px; + background-color: #f9f9f9; + border-radius: 6px; + border: 1px solid #eee; + cursor: pointer; + transition: all 0.3s ease; + + text { + font-size: 14px; + color: #333; + + &.placeholder { + color: #999; + } + } + + &:active { + background-color: #f0f0f0; + } +} + .upload-card { background-color: white; } diff --git a/src/pages/view/routine/zbxc/zbList.vue b/src/pages/view/routine/zbxc/zbList.vue index f580e36..0b30c9c 100644 --- a/src/pages/view/routine/zbxc/zbList.vue +++ b/src/pages/view/routine/zbxc/zbList.vue @@ -79,13 +79,12 @@