接龙调整
This commit is contained in:
parent
a2c8b4dd11
commit
995401b149
@ -21,6 +21,9 @@ export const kmFindAllApi = async () => {
|
|||||||
export const findAllXxXqNjTree = async () => {
|
export const findAllXxXqNjTree = async () => {
|
||||||
return await get("/api/nj/findAllXxXqNjTree");
|
return await get("/api/nj/findAllXxXqNjTree");
|
||||||
};
|
};
|
||||||
|
export const findAllNjBjTree = async () => {
|
||||||
|
return await get("/api/nj/findAllNjBjTree");
|
||||||
|
};
|
||||||
export const jsConfirmJsDataApi = async (params: any) => {
|
export const jsConfirmJsDataApi = async (params: any) => {
|
||||||
return await post("/api/js/confirmJsData", params);
|
return await post("/api/js/confirmJsData", params);
|
||||||
};
|
};
|
||||||
@ -71,14 +74,21 @@ export const jsdXkkcSaveApi = async (params: any) => {
|
|||||||
export const jsdXkXsListApi = async (params: any) => {
|
export const jsdXkXsListApi = async (params: any) => {
|
||||||
return await get("/mobile/js/xkxs/list", params);
|
return await get("/mobile/js/xkxs/list", params);
|
||||||
};
|
};
|
||||||
|
//根据年级ID和班级ID查询学生及家长信息
|
||||||
export const mobilejlstudentListApi = async (params: any) => {
|
export const mobilejlstudentListApi = async (params: any) => {
|
||||||
return await get("/mobile/jl/studentList", params);
|
return await get("/mobile/jl/studentList", params);
|
||||||
};
|
};
|
||||||
|
//根据年级ID、关联年级名称ID和学生ID查询家长接龙信息
|
||||||
export const mobilejllistApi = async (params: any) => {
|
export const mobilejllistApi = async (params: any) => {
|
||||||
const res = await get("/mobile/jl/list", params);
|
const res = await get("/mobile/jl/list", params);
|
||||||
return res.result;
|
return res.result;
|
||||||
};
|
};
|
||||||
|
//根据jlId查询接龙列表数据
|
||||||
|
export const getByJlIdApi = async (params: any) => {
|
||||||
|
const res = await get("/mobile/jl/getByJlId", params);
|
||||||
|
return res.result;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// 提交点名信息
|
// 提交点名信息
|
||||||
export const jsdXkdmListApi = async (params: any) => {
|
export const jsdXkdmListApi = async (params: any) => {
|
||||||
@ -105,6 +115,11 @@ export const xsQjSpApi = async (params: any) => {
|
|||||||
return await post("/api/xsQj/sp", params);
|
return await post("/api/xsQj/sp", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取所有班级
|
||||||
|
export const bjFindAllApi = async (params: any) => {
|
||||||
|
return await get("/api/bj/findAll", params);
|
||||||
|
};
|
||||||
|
|
||||||
// 获取学生列表
|
// 获取学生列表
|
||||||
export const xsFindList = async (params: any) => {
|
export const xsFindList = async (params: any) => {
|
||||||
return await get("/api/xs/findPage", params);
|
return await get("/api/xs/findPage", params);
|
||||||
@ -131,4 +146,27 @@ export const resourcesAddNumByTypeApi = async (params: any) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 接龙相关API
|
||||||
|
// 根据ID获取接龙详情
|
||||||
|
export const jlFindByIdApi = async (params: { id: string }) => {
|
||||||
|
return await get("/api/jl/findById", params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 保存接龙(新增/编辑)
|
||||||
|
export const jlSaveApi = async (params: any) => {
|
||||||
|
return await post("/api/jl/save", params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 根据接龙ID查询接龙执行情况(学生列表)
|
||||||
|
export const jlzxFindByJlParamsApi = async (params: { jlId: string }) => {
|
||||||
|
return await get("/api/jlzx/findByJlParams", params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 保存接龙消息推送
|
||||||
|
export const xxtsSaveByJlzxParamsApi = async (params: { jlId: string }) => {
|
||||||
|
return await post("/api/xxts/saveByJlzxParams", params);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,8 @@
|
|||||||
:src="item.lastRank ? lastIcon : item.showChild ? currentIcon : defaultIcon"></image>
|
:src="item.lastRank ? lastIcon : item.showChild ? currentIcon : defaultIcon"></image>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="tki-tree-check" @tap.stop="_treeItemSelect(item, index)"
|
<!-- 多选时所有节点都显示多选框 -->
|
||||||
v-if="selectParent?true:item.lastRank">
|
<view class="tki-tree-check" v-if="multiple" @tap.stop="_treeItemSelect(item, index)">
|
||||||
<view class="tki-tree-check-yes" v-if="item.checked" :class="{'radio':!multiple}"
|
<view class="tki-tree-check-yes" v-if="item.checked" :class="{'radio':!multiple}"
|
||||||
:style="{'border-color':confirmColor}">
|
:style="{'border-color':confirmColor}">
|
||||||
<view class="tki-tree-check-yes-b" :style="{'background-color':confirmColor}"></view>
|
<view class="tki-tree-check-yes-b" :style="{'background-color':confirmColor}"></view>
|
||||||
@ -96,7 +96,7 @@ export default {
|
|||||||
},
|
},
|
||||||
currentIcon: { // 展开时候的ic
|
currentIcon: { // 展开时候的ic
|
||||||
type: String,
|
type: String,
|
||||||
default: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFEAAABRCAYAAACqj0o2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZ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L3oxUPuobI3Y9WPOgDIlc/WvOgL4iL/vqFCcD7LH0xB4hj7cfQ/fWH9qCT+FhG0tN+DBk1PzjOM0SVllixcsBT1AvYc/kAPhc0hRg/3uvxoCgKRN9+dOrBUBB9+9GpB0NC9OVH5x4MDdG1H714kANEV3705kEOEBf9dcPi/lQnsuvLg1wgSu3Ha0v7Uh4MMgUXeuG71H407a+VBy9CPQkOdw+MtB+nGbd/D+FBbhBNxo9SjwcngJjNj0E9yBFiFj8G9SBXiGn8GNyDnCEm8SMLD3KHGOdHNh7kDjHOj2w8mAeIi/5arX+c6b/fxHz9oADEdGdjR/fXCw/OOB5oVfCOgnepz8IB14PMw03jCmTE+QBx5z0gAmKSqK9OUF+hcAeIhu/QYr4Qie8rjW83hhMBERARQAREQAREBBABERCLnH8BBgA+TQI7U4t53AAAAABJRU5ErkJggg=='
|
||||||
},
|
},
|
||||||
defaultIcon: { // 折叠时候的ic
|
defaultIcon: { // 折叠时候的ic
|
||||||
type: String,
|
type: String,
|
||||||
@ -197,11 +197,35 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 判断某节点下所有子节点是否全选
|
||||||
|
_isAllChildrenChecked(item) {
|
||||||
|
const children = this.treeList.filter(v => v.parentId[v.parentId.length - 1] === item.id && v.lastRank);
|
||||||
|
return children.length > 0 && children.every(child => child.checked);
|
||||||
|
},
|
||||||
|
// 设置某节点下所有子节点的选中状态
|
||||||
|
_setAllChildrenChecked(item, checked) {
|
||||||
|
this.treeList.forEach(v => {
|
||||||
|
if (v.parentId[v.parentId.length - 1] === item.id && v.lastRank) {
|
||||||
|
v.checked = checked;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 同步父节点选中状态
|
||||||
|
_updateParentChecked(item) {
|
||||||
|
if (!item.parentId.length) return;
|
||||||
|
const parentId = item.parentId[item.parentId.length - 1];
|
||||||
|
const parent = this.treeList.find(v => v.id === parentId);
|
||||||
|
if (parent) {
|
||||||
|
parent.checked = this._isAllChildrenChecked(parent);
|
||||||
|
this._updateParentChecked(parent); // 递归向上
|
||||||
|
}
|
||||||
|
},
|
||||||
// 点击
|
// 点击
|
||||||
_treeItemTap(item, index) {
|
_treeItemTap(item, index) {
|
||||||
if (item.lastRank === true) {
|
if (item.lastRank === true) {
|
||||||
//点击最后一级时触发事件
|
//点击最后一级时触发事件
|
||||||
this.treeList[index].checked = !this.treeList[index].checked
|
this.treeList[index].checked = !this.treeList[index].checked
|
||||||
|
this._updateParentChecked(item);
|
||||||
this._fixMultiple(index)
|
this._fixMultiple(index)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -253,8 +277,23 @@ export default {
|
|||||||
// console.log(this.treeList)
|
// console.log(this.treeList)
|
||||||
},
|
},
|
||||||
_treeItemSelect(item, index) {
|
_treeItemSelect(item, index) {
|
||||||
this.treeList[index].checked = !this.treeList[index].checked
|
if (this.multiple) {
|
||||||
this._fixMultiple(index)
|
if (!item.lastRank) {
|
||||||
|
// 父节点多选框:全选/全不选所有子节点
|
||||||
|
const allChecked = this._isAllChildrenChecked(item);
|
||||||
|
this._setAllChildrenChecked(item, !allChecked);
|
||||||
|
item.checked = !allChecked;
|
||||||
|
} else {
|
||||||
|
// 子节点单独切换
|
||||||
|
this.treeList[index].checked = !this.treeList[index].checked;
|
||||||
|
this._updateParentChecked(item);
|
||||||
|
}
|
||||||
|
this._fixMultiple(index);
|
||||||
|
} else {
|
||||||
|
// 单选逻辑
|
||||||
|
this.treeList[index].checked = !this.treeList[index].checked;
|
||||||
|
this._fixMultiple(index);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 处理单选多选
|
// 处理单选多选
|
||||||
_fixMultiple(index) {
|
_fixMultiple(index) {
|
||||||
|
|||||||
@ -132,7 +132,6 @@ const handleGetCode = async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("获取验证码,手机号:", formData.phone);
|
|
||||||
const result = await sendCodeApi({
|
const result = await sendCodeApi({
|
||||||
phone: formData.phone,
|
phone: formData.phone,
|
||||||
});
|
});
|
||||||
@ -199,7 +198,7 @@ const handleVerify = async () => {
|
|||||||
if (findJsByPhoneResult.resultCode == 1 && findJsByPhoneResult.result) {
|
if (findJsByPhoneResult.resultCode == 1 && findJsByPhoneResult.result) {
|
||||||
// 将教师信息存储到jsData中
|
// 将教师信息存储到jsData中
|
||||||
setJs(findJsByPhoneResult.result);
|
setJs(findJsByPhoneResult.result);
|
||||||
console.log("教师信息已存储到jsData:", findJsByPhoneResult.result);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取教师信息失败:", error);
|
console.error("获取教师信息失败:", error);
|
||||||
|
|||||||
@ -120,7 +120,6 @@ onLoad(async (options) => {
|
|||||||
try {
|
try {
|
||||||
const stuRes = await jlzxFindByJlParamsApi({ jlId: noticeId.value });
|
const stuRes = await jlzxFindByJlParamsApi({ jlId: noticeId.value });
|
||||||
studentList.value = stuRes?.rows || stuRes?.result || [];
|
studentList.value = stuRes?.rows || stuRes?.result || [];
|
||||||
console.log("学生列表数据:", studentList.value);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
uni.showToast({ title: "加载学生状态失败", icon: "none" });
|
uni.showToast({ title: "加载学生状态失败", icon: "none" });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,25 +27,27 @@
|
|||||||
>范围: {{ data.njmc + data.bjmc }}</text
|
>范围: {{ data.njmc + data.bjmc }}</text
|
||||||
>
|
>
|
||||||
<view class="footer-actions">
|
<view class="footer-actions">
|
||||||
<u-button
|
<u-icon
|
||||||
class="footer-btn"
|
name="list"
|
||||||
type="primary"
|
size="22"
|
||||||
size="mini"
|
color="#409EFF"
|
||||||
@click="goToFeedback(data.id)"
|
@click="goToFeedback(data.id)"
|
||||||
>接龙情况</u-button>
|
class="footer-action-icon"
|
||||||
<u-button
|
/>
|
||||||
|
<u-icon
|
||||||
v-if="data.jlStatus === 'A'"
|
v-if="data.jlStatus === 'A'"
|
||||||
class="footer-btn"
|
name="arrow-right"
|
||||||
type="warning"
|
size="22"
|
||||||
size="mini"
|
color="#FFA726"
|
||||||
@click="goToPush(data.id)"
|
@click="goToPush(data.id)"
|
||||||
>消息推送</u-button>
|
class="footer-action-icon"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
<view class="white-bg-color py-5">
|
|
||||||
<view class="flex-row items-center pb-10 pt-5">
|
<view class="flex-row items-center pb-10 pt-5">
|
||||||
<u-button
|
<u-button
|
||||||
text="新增接龙"
|
text="新增接龙"
|
||||||
@ -54,7 +56,6 @@
|
|||||||
@click="goToPublish"
|
@click="goToPublish"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
</BasicListLayout>
|
</BasicListLayout>
|
||||||
<!-- 用uniqueList渲染 -->
|
<!-- 用uniqueList渲染 -->
|
||||||
@ -166,124 +167,229 @@ onShow(() => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.jl-list-page {
|
.jl-list-page {
|
||||||
position: relative; // 为了 FAB 定位
|
position: relative;
|
||||||
min-height: 100vh; // 确保 FAB 总在视图内
|
min-height: 100vh;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
padding: 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-card {
|
.jl-card {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 12px;
|
||||||
padding: 15px;
|
padding: 16px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||||
border-left: 4px solid #447ade; // 左侧加个强调色条
|
border: 1px solid #f0f0f0;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: translateY(1px);
|
||||||
|
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 4px;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 12px;
|
||||||
|
gap: 12px;
|
||||||
|
|
||||||
.jl-title {
|
.jl-title {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #2c3e50;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-right: 10px;
|
line-height: 1.4;
|
||||||
// 最多显示两行
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-status {
|
.jl-status {
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
padding: 2px 6px;
|
padding: 4px 8px;
|
||||||
border-radius: 4px;
|
border-radius: 12px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
&.status-published {
|
&.status-published {
|
||||||
background-color: #BE193FFF; // 红色-待推送
|
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.status-draft {
|
&.status-draft {
|
||||||
background-color: #ff9f0a; // 橙色-暂存
|
background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.status-ended {
|
&.status-ended {
|
||||||
background-color: #19be4d; // 绿色-已推送
|
background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-body {
|
.card-body {
|
||||||
// 封面图样式 (如果启用)
|
margin-bottom: 12px;
|
||||||
|
|
||||||
.cover-thumbnail {
|
.cover-thumbnail {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
border-radius: 4px;
|
border-radius: 8px;
|
||||||
margin-right: 10px;
|
margin-right: 12px;
|
||||||
float: left; // 文字环绕图片
|
float: left;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-excerpt {
|
.jl-excerpt {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #666;
|
color: #5a6c7d;
|
||||||
line-height: 1.5;
|
line-height: 1.6;
|
||||||
// 最多显示 3 行
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 3;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-footer {
|
.card-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 5px 15px;
|
gap: 8px 16px;
|
||||||
|
align-items: center;
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
|
||||||
.footer-item {
|
.footer-item {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 14px;
|
font-size: 13px;
|
||||||
color: #666;
|
color: #7f8c8d;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 180px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
|
background-color: #bdc3c7;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 6px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.footer-actions {
|
.footer-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 18px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-basis: 100%; /* 独占一行 */
|
flex-basis: 100%;
|
||||||
margin-top: 6px;
|
margin-top: 8px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
.footer-btn {
|
|
||||||
min-width: 60px;
|
.footer-action-icon {
|
||||||
width: auto;
|
cursor: pointer;
|
||||||
font-size: 12px;
|
transition: transform 0.1s;
|
||||||
padding: 0 12px;
|
background: none !important;
|
||||||
flex: none;
|
border: none !important;
|
||||||
margin: 0;
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
.footer-action-icon:active {
|
||||||
|
transform: scale(0.92);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FAB 按钮样式 - 由 DragButton 组件处理定位
|
// 底部按钮区域优化
|
||||||
.fab-button {
|
.white-bg-color {
|
||||||
width: 50px;
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
height: 50px;
|
border-radius: 16px;
|
||||||
background-color: #4477ee;
|
margin: 16px 12px;
|
||||||
border-radius: 50%;
|
padding: 16px;
|
||||||
display: flex;
|
box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
|
||||||
|
|
||||||
|
.flex-row {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 空列表样式已由 BasicListLayout 组件处理,移除此样式 */
|
.u-button {
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
color: #667eea;
|
||||||
|
border: none;
|
||||||
|
font-weight: 600;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background: rgba(255, 255, 255, 1);
|
||||||
|
transform: translateY(1px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 响应式优化
|
||||||
|
@media (max-width: 375px) {
|
||||||
|
.jl-list-page {
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jl-card {
|
||||||
|
padding: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header .jl-title {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-footer .footer-item {
|
||||||
|
max-width: 150px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载动画
|
||||||
|
.jl-card {
|
||||||
|
animation: fadeInUp 0.3s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInUp {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(20px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -204,12 +204,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y class="student-modal-content">
|
<scroll-view scroll-y class="student-modal-content">
|
||||||
<view class="all-student-tags">
|
<view class="all-student-tags">
|
||||||
<text
|
<view
|
||||||
v-for="(name, index) in formData.targetNames"
|
v-for="(name, index) in formData.targetNames"
|
||||||
:key="name + index"
|
:key="name + index"
|
||||||
class="student-tag"
|
class="student-tag-container"
|
||||||
>{{ name }}</text
|
|
||||||
>
|
>
|
||||||
|
<text class="student-tag">{{ name }}</text>
|
||||||
|
<view class="delete-btn" @click="removeStudent(index)">
|
||||||
|
<uni-icons type="closeempty" size="12" color="#999"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
@ -224,8 +228,7 @@ import CustomUpload from "/src/components/BasicUpload/CustomUpload.vue";
|
|||||||
import BasicTree from "@/components/BasicTree/Tree.vue";
|
import BasicTree from "@/components/BasicTree/Tree.vue";
|
||||||
import { attachmentUpload } from "@/api/system/upload";
|
import { attachmentUpload } from "@/api/system/upload";
|
||||||
import { imagUrl } from "@/utils";
|
import { imagUrl } from "@/utils";
|
||||||
import { findAllNjBjTree, mobilejlstudentListApi } from "@/api/base/server";
|
import { findAllNjBjTree, mobilejlstudentListApi, jlFindByIdApi, jlSaveApi } from "@/api/base/server";
|
||||||
import { post, get } from "@/utils/request";
|
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
|
|
||||||
interface Attachment {
|
interface Attachment {
|
||||||
@ -244,6 +247,7 @@ interface FormData {
|
|||||||
targetClass: string;
|
targetClass: string;
|
||||||
targetNames: string[];
|
targetNames: string[];
|
||||||
targetStudentIds: string[];
|
targetStudentIds: string[];
|
||||||
|
xsIdList: string[]; // 学生ID列表,用逗号分隔
|
||||||
targetNjIds: string[]; // 年级ID数组
|
targetNjIds: string[]; // 年级ID数组
|
||||||
targetNjmcIds: string[]; // 年级名称ID数组
|
targetNjmcIds: string[]; // 年级名称ID数组
|
||||||
targetBjIds: string[]; // 班级ID数组
|
targetBjIds: string[]; // 班级ID数组
|
||||||
@ -262,6 +266,7 @@ const formData = reactive<FormData>({
|
|||||||
targetClass: "",
|
targetClass: "",
|
||||||
targetNames: [],
|
targetNames: [],
|
||||||
targetStudentIds: [],
|
targetStudentIds: [],
|
||||||
|
xsIdList: [],
|
||||||
targetNjIds: [],
|
targetNjIds: [],
|
||||||
targetNjmcIds: [],
|
targetNjmcIds: [],
|
||||||
targetBjIds: [],
|
targetBjIds: [],
|
||||||
@ -307,11 +312,8 @@ const loadTreeData = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
treeData.value = convertTreeData(res.result);
|
treeData.value = convertTreeData(res.result);
|
||||||
console.log("树形数据加载成功:", treeData.value);
|
|
||||||
console.log("原始树形数据结构:", JSON.stringify(res.result, null, 2));
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("加载树形数据失败:", error);
|
|
||||||
uni.showToast({ title: "加载班级数据失败", icon: "error" });
|
uni.showToast({ title: "加载班级数据失败", icon: "error" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -319,32 +321,8 @@ const loadTreeData = async () => {
|
|||||||
// 在组件挂载时加载数据
|
// 在组件挂载时加载数据
|
||||||
loadTreeData();
|
loadTreeData();
|
||||||
|
|
||||||
const fetchStudentsByClass = async (className: string): Promise<string[]> => {
|
|
||||||
console.log(`模拟获取班级 [${className}] 的学生列表...`);
|
|
||||||
isLoadingStudents.value = true;
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 400));
|
|
||||||
|
|
||||||
const mockStudents = [
|
|
||||||
"施延兴",
|
|
||||||
"安苒溪",
|
|
||||||
"罗浩晨",
|
|
||||||
"康萌",
|
|
||||||
"范文昊",
|
|
||||||
"丁贺祥",
|
|
||||||
"韦运昊",
|
|
||||||
"萧润丽",
|
|
||||||
"谢林",
|
|
||||||
"鲍泽远",
|
|
||||||
"杨俊",
|
|
||||||
];
|
|
||||||
|
|
||||||
isLoadingStudents.value = false;
|
|
||||||
return mockStudents;
|
|
||||||
};
|
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
console.log("页面加载参数:", options);
|
|
||||||
|
|
||||||
// 如果有接龙ID,说明是编辑模式
|
// 如果有接龙ID,说明是编辑模式
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
noticeId.value = options.id;
|
noticeId.value = options.id;
|
||||||
@ -354,16 +332,9 @@ onLoad((options) => {
|
|||||||
|
|
||||||
// 添加页面显示事件处理
|
// 添加页面显示事件处理
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
console.log("页面显示,当前状态:", {
|
|
||||||
publishedJlId: publishedJlId.value,
|
|
||||||
formDataId: formData.id,
|
|
||||||
isPublishing: isPublishing.value
|
|
||||||
});
|
|
||||||
|
|
||||||
// 如果已经发布过且没有编辑ID,说明是从推送清单页面返回
|
// 如果已经发布过且没有编辑ID,说明是从推送清单页面返回
|
||||||
// 此时应该重置表单,防止重复发布
|
// 此时应该重置表单,防止重复发布
|
||||||
if (publishedJlId.value && !noticeId.value) {
|
if (publishedJlId.value && !noticeId.value) {
|
||||||
console.log("检测到从推送清单页面返回,重置表单状态");
|
|
||||||
resetForm();
|
resetForm();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -380,6 +351,7 @@ const resetForm = () => {
|
|||||||
targetClass: "",
|
targetClass: "",
|
||||||
targetNames: [],
|
targetNames: [],
|
||||||
targetStudentIds: [],
|
targetStudentIds: [],
|
||||||
|
xsIdList: [],
|
||||||
targetNjIds: [],
|
targetNjIds: [],
|
||||||
targetNjmcIds: [],
|
targetNjmcIds: [],
|
||||||
targetBjIds: [],
|
targetBjIds: [],
|
||||||
@ -406,8 +378,6 @@ const resetForm = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("表单已重置,包括封面:", formData.coverImage);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加载接龙数据(编辑模式使用)
|
// 加载接龙数据(编辑模式使用)
|
||||||
@ -416,7 +386,7 @@ const loadJlData = async (jlId: string) => {
|
|||||||
uni.showLoading({ title: "加载数据中..." });
|
uni.showLoading({ title: "加载数据中..." });
|
||||||
|
|
||||||
// 调用获取接龙详情的接口
|
// 调用获取接龙详情的接口
|
||||||
const response = await get(`/api/jl/findById?id=${jlId}`);
|
const response = await jlFindByIdApi({ id: jlId });
|
||||||
|
|
||||||
if (response && response.resultCode === 1 && response.result) {
|
if (response && response.resultCode === 1 && response.result) {
|
||||||
const jlData = response.result;
|
const jlData = response.result;
|
||||||
@ -461,7 +431,6 @@ const loadJlData = async (jlId: string) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
console.error("加载接龙数据失败:", error);
|
|
||||||
uni.showToast({ title: "加载数据失败", icon: "error" });
|
uni.showToast({ title: "加载数据失败", icon: "error" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -602,7 +571,6 @@ const getAttachmentIcon = (type: string): string => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const previewAttachment = (attachment: Attachment) => {
|
const previewAttachment = (attachment: Attachment) => {
|
||||||
console.log("预览附件:", attachment);
|
|
||||||
// 如果是图片类型,可以预览
|
// 如果是图片类型,可以预览
|
||||||
if (attachment.type === "image") {
|
if (attachment.type === "image") {
|
||||||
const fullUrl = imagUrl(attachment.url);
|
const fullUrl = imagUrl(attachment.url);
|
||||||
@ -627,8 +595,6 @@ const showClassTree = () => {
|
|||||||
|
|
||||||
// 树形选择确认
|
// 树形选择确认
|
||||||
const onTreeConfirm = async (selectedItems: any[]) => {
|
const onTreeConfirm = async (selectedItems: any[]) => {
|
||||||
console.log("选择的班级:", selectedItems);
|
|
||||||
console.log("完整的 selectedItems 数据:", JSON.stringify(selectedItems, null, 2));
|
|
||||||
|
|
||||||
if (selectedItems.length > 0) {
|
if (selectedItems.length > 0) {
|
||||||
// 处理多选情况
|
// 处理多选情况
|
||||||
@ -653,7 +619,6 @@ const onTreeConfirm = async (selectedItems: any[]) => {
|
|||||||
// 如果选择的是班级(有parents表示是班级)
|
// 如果选择的是班级(有parents表示是班级)
|
||||||
if (item.parents && item.parents.length > 0) {
|
if (item.parents && item.parents.length > 0) {
|
||||||
const parent = item.parents[0]; // 年级信息
|
const parent = item.parents[0]; // 年级信息
|
||||||
console.log("年级信息:", parent);
|
|
||||||
|
|
||||||
const njId = parent.key; // 年级ID:parents[0].key
|
const njId = parent.key; // 年级ID:parents[0].key
|
||||||
const njmcId = parent.njmcId; // 年级名称ID:从年级信息中获取
|
const njmcId = parent.njmcId; // 年级名称ID:从年级信息中获取
|
||||||
@ -669,9 +634,6 @@ const onTreeConfirm = async (selectedItems: any[]) => {
|
|||||||
bjIds.push(bjId);
|
bjIds.push(bjId);
|
||||||
gradeNames.push(gradeName);
|
gradeNames.push(gradeName);
|
||||||
|
|
||||||
console.log(
|
|
||||||
`选择班级: ${item.title}, 年级ID: ${njId}, 年级名称ID: ${njmcId}, 班级ID: ${bjId}, 年级名称: ${gradeName}`
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
console.warn("年级信息不完整,跳过该班级:", item);
|
console.warn("年级信息不完整,跳过该班级:", item);
|
||||||
}
|
}
|
||||||
@ -691,19 +653,6 @@ const onTreeConfirm = async (selectedItems: any[]) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证是否跨年级选择
|
|
||||||
const uniqueGradeNames = [...new Set(gradeNames)];
|
|
||||||
if (uniqueGradeNames.length > 1) {
|
|
||||||
uni.hideLoading();
|
|
||||||
const gradeList = uniqueGradeNames.join("、");
|
|
||||||
uni.showToast({
|
|
||||||
title: `不能跨年级选择发布班级,已选择:${gradeList}`,
|
|
||||||
icon: "none",
|
|
||||||
duration: 4000
|
|
||||||
});
|
|
||||||
return; // 阻止继续执行
|
|
||||||
}
|
|
||||||
|
|
||||||
if (njIds.length > 0 && bjIds.length > 0) {
|
if (njIds.length > 0 && bjIds.length > 0) {
|
||||||
// 对年级ID去重
|
// 对年级ID去重
|
||||||
const uniqueNjIds = [...new Set(njIds)];
|
const uniqueNjIds = [...new Set(njIds)];
|
||||||
@ -737,6 +686,8 @@ const onTreeConfirm = async (selectedItems: any[]) => {
|
|||||||
(student: any) =>
|
(student: any) =>
|
||||||
student.id || student.xsId || student.studentId || ""
|
student.id || student.xsId || student.studentId || ""
|
||||||
);
|
);
|
||||||
|
// 设置xsIdList,将学生ID用逗号分隔
|
||||||
|
formData.xsIdList = formData.targetStudentIds;
|
||||||
} else {
|
} else {
|
||||||
throw new Error("获取学生列表失败");
|
throw new Error("获取学生列表失败");
|
||||||
}
|
}
|
||||||
@ -751,15 +702,13 @@ const onTreeConfirm = async (selectedItems: any[]) => {
|
|||||||
console.error("获取学生列表失败:", error);
|
console.error("获取学生列表失败:", error);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.showToast({ title: "获取学生列表失败", icon: "error" });
|
uni.showToast({ title: "获取学生列表失败", icon: "error" });
|
||||||
// 如果接口失败,使用模拟数据
|
|
||||||
formData.targetNames = await fetchStudentsByClass(formData.targetClass);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 树形选择取消
|
// 树形选择取消
|
||||||
const onTreeCancel = () => {
|
const onTreeCancel = () => {
|
||||||
console.log("取消选择班级");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 显示全部学生
|
// 显示全部学生
|
||||||
@ -772,6 +721,16 @@ const closeStudentModal = () => {
|
|||||||
showStudentModal.value = false;
|
showStudentModal.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 删除学生
|
||||||
|
const removeStudent = (index: number) => {
|
||||||
|
// 同时删除学生姓名和ID
|
||||||
|
formData.targetNames.splice(index, 1);
|
||||||
|
formData.targetStudentIds.splice(index, 1);
|
||||||
|
// 同步更新xsIdList
|
||||||
|
formData.xsIdList = [...formData.targetStudentIds];
|
||||||
|
uni.showToast({ title: "已移除学生", icon: "success" });
|
||||||
|
};
|
||||||
|
|
||||||
const handleSignatureChange = (e: any) => {
|
const handleSignatureChange = (e: any) => {
|
||||||
const index = e.detail.value;
|
const index = e.detail.value;
|
||||||
formData.signatureRequired = index == 1;
|
formData.signatureRequired = index == 1;
|
||||||
@ -846,16 +805,6 @@ const buildJlDto = (status: string) => {
|
|||||||
const user = userData.value;
|
const user = userData.value;
|
||||||
const js = jsData.value;
|
const js = jsData.value;
|
||||||
|
|
||||||
console.log("=== 用户信息调试 ===");
|
|
||||||
console.log("userData.value:", user);
|
|
||||||
console.log("jsData.value:", js);
|
|
||||||
console.log("user?.id:", user?.id);
|
|
||||||
console.log("user?.loginName:", user?.loginName);
|
|
||||||
console.log("user?.name:", user?.name);
|
|
||||||
console.log("js?.id:", js?.id);
|
|
||||||
console.log("js?.jsxm:", js?.jsxm);
|
|
||||||
console.log("==================");
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: formData.id || "", // 接龙ID,新增时为空
|
id: formData.id || "", // 接龙ID,新增时为空
|
||||||
jlmc: formData.title.trim(), // 接龙名称
|
jlmc: formData.title.trim(), // 接龙名称
|
||||||
@ -865,9 +814,10 @@ const buildJlDto = (status: string) => {
|
|||||||
jlkstime: formatDate(formData.startTime), // 接龙开始时间,格式化为 yyyy-MM-dd HH:mm:ss
|
jlkstime: formatDate(formData.startTime), // 接龙开始时间,格式化为 yyyy-MM-dd HH:mm:ss
|
||||||
jljstime: formatDate(formData.endTime), // 接龙结束时间,格式化为 yyyy-MM-dd HH:mm:ss
|
jljstime: formatDate(formData.endTime), // 接龙结束时间,格式化为 yyyy-MM-dd HH:mm:ss
|
||||||
mdqz: formData.signatureRequired ? "1" : "0", // 按名单签字:1启用,0不启用
|
mdqz: formData.signatureRequired ? "1" : "0", // 按名单签字:1启用,0不启用
|
||||||
njId: formData.targetNjIds.length > 0 ? formData.targetNjIds[0] : "", // 关联年级ID(取第一个)
|
njId: formData.targetNjIds.join(","), // 关联年级ID列表
|
||||||
njmcId: formData.targetNjmcIds.length > 0 ? formData.targetNjmcIds[0] : "", // 关联年级名称ID(取第一个)
|
njmcId: formData.targetNjmcIds.join(","), // 关联年级名称ID列表
|
||||||
bjId: formData.targetBjIds, // 关联班级ID列表
|
bjId: formData.targetBjIds.join(","), // 关联班级ID列表
|
||||||
|
xsIdList: formData.xsIdList.join(","), // 学生ID列表,用逗号分隔
|
||||||
jlFbr: js?.id || "", // 发布人ID:只从jsData获取
|
jlFbr: js?.id || "", // 发布人ID:只从jsData获取
|
||||||
jsxm: js?.jsxm || user?.loginName || user?.name || "", // 教师姓名:优先使用jsData的jsxm,其次使用userData的loginName或name
|
jsxm: js?.jsxm || user?.loginName || user?.name || "", // 教师姓名:优先使用jsData的jsxm,其次使用userData的loginName或name
|
||||||
createdUserId: user?.id ? parseInt(user.id) : null,
|
createdUserId: user?.id ? parseInt(user.id) : null,
|
||||||
@ -887,10 +837,8 @@ const saveDraft = async () => {
|
|||||||
// 准备草稿数据,构建 JlDto 对象
|
// 准备草稿数据,构建 JlDto 对象
|
||||||
const jlDto = buildJlDto("B"); // B表示暂存
|
const jlDto = buildJlDto("B"); // B表示暂存
|
||||||
|
|
||||||
console.log("保存草稿数据:", jlDto);
|
|
||||||
|
|
||||||
// 调用后端接口
|
// 调用后端接口
|
||||||
const response = await post("/api/jl/save", jlDto);
|
const response = await jlSaveApi(jlDto);
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
@ -940,7 +888,6 @@ const saveDraft = async () => {
|
|||||||
|
|
||||||
const previewNotice = () => {
|
const previewNotice = () => {
|
||||||
if (!validateForm()) return;
|
if (!validateForm()) return;
|
||||||
console.log("预览通知", formData);
|
|
||||||
uni.showToast({ title: "预览功能待实现", icon: "none" });
|
uni.showToast({ title: "预览功能待实现", icon: "none" });
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -962,7 +909,7 @@ const publishNotice = async () => {
|
|||||||
// 如果有ID,检查接龙是否已存在且已发布
|
// 如果有ID,检查接龙是否已存在且已发布
|
||||||
if (formData.id) {
|
if (formData.id) {
|
||||||
try {
|
try {
|
||||||
const response = await get(`/api/jl/findById?id=${formData.id}`);
|
const response = await jlFindByIdApi({ id: formData.id });
|
||||||
if (response && response.resultCode === 1 && response.result) {
|
if (response && response.resultCode === 1 && response.result) {
|
||||||
const jlData = response.result;
|
const jlData = response.result;
|
||||||
if (jlData.jlStatus === 'A') {
|
if (jlData.jlStatus === 'A') {
|
||||||
@ -977,15 +924,18 @@ const publishNotice = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
isPublishing.value = true;
|
isPublishing.value = true;
|
||||||
uni.showLoading({ title: "发布中..." });
|
uni.showLoading({ title: "发布中,请稍候..." });
|
||||||
|
|
||||||
// 准备发布数据,构建 JlDto 对象
|
// 准备发布数据,构建 JlDto 对象
|
||||||
const jlDto = buildJlDto("A"); // A表示已发布
|
const jlDto = buildJlDto("A"); // A表示已发布
|
||||||
|
|
||||||
console.log("发布接龙数据:", jlDto);
|
// 调用后端接口,设置超时处理
|
||||||
|
const response = await Promise.race([
|
||||||
// 调用后端接口
|
jlSaveApi(jlDto),
|
||||||
const response = await post("/api/jl/save", jlDto);
|
new Promise((_, reject) =>
|
||||||
|
setTimeout(() => reject(new Error("请求超时")), 300000) // 5分钟超时
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
@ -993,8 +943,6 @@ const publishNotice = async () => {
|
|||||||
// 获取接龙ID,优先使用返回的ID,如果没有则使用请求中的ID
|
// 获取接龙ID,优先使用返回的ID,如果没有则使用请求中的ID
|
||||||
const jlId = response.result || response.data || jlDto.id;
|
const jlId = response.result || response.data || jlDto.id;
|
||||||
|
|
||||||
console.log("发布成功,接龙ID:", jlId, "完整响应:", response);
|
|
||||||
|
|
||||||
if (!jlId) {
|
if (!jlId) {
|
||||||
console.error("发布成功但未获取到接龙ID");
|
console.error("发布成功但未获取到接龙ID");
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -1032,12 +980,34 @@ const publishNotice = async () => {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
console.error("发布接龙失败:", error);
|
console.error("发布接龙失败:", error);
|
||||||
|
|
||||||
// 处理数据验证错误
|
// 处理不同类型的错误
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
|
if (error.message === "请求超时") {
|
||||||
|
uni.showToast({
|
||||||
|
title: "发布超时,请检查网络连接或稍后重试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.message,
|
title: error.message,
|
||||||
icon: "none"
|
icon: "none"
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
} else if (error && typeof error === 'object' && 'errMsg' in error) {
|
||||||
|
// uni-app 错误对象
|
||||||
|
if (error.errMsg && error.errMsg.includes('timeout')) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请求超时,请检查网络连接或稍后重试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: error.errMsg || "发布失败,请重试",
|
||||||
|
icon: "error"
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "发布失败,请重试",
|
title: "发布失败,请重试",
|
||||||
@ -1531,14 +1501,42 @@ const publishNotice = async () => {
|
|||||||
gap: 8px 10px;
|
gap: 8px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.student-tag {
|
.student-tag-container {
|
||||||
font-size: 13px;
|
display: flex;
|
||||||
padding: 6px 12px;
|
align-items: center;
|
||||||
border-radius: 4px;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #f4f4f5;
|
background-color: #f4f4f5;
|
||||||
color: #909399;
|
border-radius: 4px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
gap: 8px;
|
||||||
min-width: 60px;
|
min-width: 60px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.student-tag {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #909399;
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-btn {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 2px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: #ffcdd2;
|
||||||
|
.uni-icons {
|
||||||
|
color: #f44336 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -78,14 +78,11 @@ const studentList = ref<StudentInfo[]>([]);
|
|||||||
const isPushing = ref(false);
|
const isPushing = ref(false);
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
console.log("推送清单页面参数:", options);
|
|
||||||
|
|
||||||
if (options.jlId && options.jlId !== 'null' && options.jlId !== 'undefined') {
|
if (options.jlId && options.jlId !== 'null' && options.jlId !== 'undefined') {
|
||||||
jlId.value = options.jlId;
|
jlId.value = options.jlId;
|
||||||
console.log("获取到接龙ID:", jlId.value);
|
|
||||||
loadStudentList();
|
loadStudentList();
|
||||||
} else {
|
} else {
|
||||||
console.error("缺少接龙ID参数或ID无效:", options.jlId);
|
|
||||||
uni.showToast({ title: "缺少接龙ID参数", icon: "error" });
|
uni.showToast({ title: "缺少接龙ID参数", icon: "error" });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
@ -102,27 +99,16 @@ const loadStudentList = async () => {
|
|||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
console.log("接口返回数据:", response);
|
|
||||||
|
|
||||||
// 检查是否有学生数据
|
// 检查是否有学生数据
|
||||||
if (response && (response.rows || response.result)) {
|
if (response && (response.rows || response.result)) {
|
||||||
// 从 rows 字段获取学生列表数据
|
// 从 rows 字段获取学生列表数据
|
||||||
const students = response.rows || response.result || [];
|
const students = response.rows || response.result || [];
|
||||||
studentList.value = students;
|
studentList.value = students;
|
||||||
console.log("学生列表加载成功,共", students.length, "名学生:", studentList.value);
|
|
||||||
} else {
|
|
||||||
console.warn("接口返回数据格式异常:", response);
|
|
||||||
// 如果数据格式异常,尝试直接使用 response 作为数组
|
|
||||||
if (Array.isArray(response)) {
|
|
||||||
studentList.value = response;
|
|
||||||
console.log("直接使用 response 作为学生列表,共", response.length, "名学生");
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error("获取学生信息失败:数据格式异常");
|
throw new Error("获取学生信息失败:数据格式异常");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
console.error("加载学生列表失败:", error);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error instanceof Error ? error.message : "加载学生信息失败",
|
title: error instanceof Error ? error.message : "加载学生信息失败",
|
||||||
icon: "error"
|
icon: "error"
|
||||||
@ -167,7 +153,6 @@ const handleConfirmPush = async () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
isPushing.value = false;
|
isPushing.value = false;
|
||||||
console.error("推送失败:", error);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error instanceof Error ? error.message : "推送失败,请重试",
|
title: error instanceof Error ? error.message : "推送失败,请重试",
|
||||||
icon: "error"
|
icon: "error"
|
||||||
|
|||||||
@ -84,6 +84,7 @@ export function get<T = any>(
|
|||||||
method: "GET",
|
method: "GET",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
responseType: "text",
|
responseType: "text",
|
||||||
|
timeout: 30000, // 设置30秒超时
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
@ -105,6 +106,14 @@ export function get<T = any>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
// 处理超时错误
|
||||||
|
if (error.errMsg && error.errMsg.includes('timeout')) {
|
||||||
|
showToast("请求超时,请检查网络连接或稍后重试");
|
||||||
|
} else {
|
||||||
|
showToast(error.message || "请求失败");
|
||||||
|
}
|
||||||
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -124,6 +133,7 @@ export function post<T = any>(
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
responseType: "text",
|
responseType: "text",
|
||||||
|
timeout: 300000, // 设置5分钟超时
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
@ -145,6 +155,14 @@ export function post<T = any>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
// 处理超时错误
|
||||||
|
if (error.errMsg && error.errMsg.includes('timeout')) {
|
||||||
|
showToast("请求超时,请检查网络连接或稍后重试");
|
||||||
|
} else {
|
||||||
|
showToast(error.message || "请求失败");
|
||||||
|
}
|
||||||
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user