This commit is contained in:
@jyuhsin
2025-10-17 11:13:19 +08:00
parent a54d550796
commit 225ed25736
4 changed files with 26 additions and 7 deletions
@@ -25,10 +25,15 @@ public class LiteracyCourse extends LiteracySourceCourse implements Serializable
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("活动ID")
private String activityId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("子活动ID")
private String courseId;
@Many(field = "courseId")
private List<LiteracyActivityCourse> courseTimeList;
@@ -16,8 +16,8 @@
<div class="page-content">
<slot name="edit"></slot>
</div>
<div class="page-footer" v-if="$slots.edit_func">
<slot name="edit_func"></slot>
<div class="page-footer" v-if="$slots.edit_footer">
<slot name="edit_footer"></slot>
</div>
</div>
@@ -524,10 +524,10 @@ layout("/layouts/v4/baseLayout.html"){
// 如果是"推荐应用"分类
if (this.activeCategory === "recommended") {
$.get("/platform/v4/apps/recommended")
$.get("/platform/home/listRecommendApp", { platform: "PC" })
.then((result) => {
if (result.code === 0) {
this.applications = result.data.list || []
this.applications = result.data || []
} else {
console.error("获取推荐应用失败:", result.msg)
}
@@ -157,8 +157,8 @@ const basicForm = {
</el-table-column>
<el-table-column :label="trainType + '名称'" prop="courseName">
<template v-slot="{row}">
<el-select size="small" v-model="row.courseId" allow-create filterable>
<template v-slot="{row, $index}">
<el-select size="small" v-model="row.courseId" filterable @change="(val) => {courseChange(val, row, $index)}">
<el-option :label="item.courseName" :value="item.id" :key="item.id" v-for="item in sourceCourseList"></el-option>
</el-select>
</template>
@@ -342,6 +342,20 @@ const basicForm = {
"custom-form": customForm,
},
methods: {
courseChange(val, row, index) {
const course = clone(this.sourceCourseList.find(o => o.id === val))
if(course.timeList) {
course.timeList = JSON.parse(course.timeList)
course.courseTimeList = course.timeList
}
const courseId = course.id
delete course.id
this.formData.courseList[index] = {...this.formData.courseList[index], ...course}
this.$set(this.formData.courseList[index], 'courseId', courseId)
this.formData.courseList[index].setUpCourseData = course.courseTimeList.map(o => o.courseDate)
this.$forceUpdate()
},
async validNumber(row, old) {
if (GetQueryString("id") === "") {
if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) {