Browse Source
- 删除了 admin/auto-imports.d.ts 和 admin/components.d.ts 中未使用的 Element Plus 组件导入 -移除了 ElNotification 导入- 删除了大量未使用的 Element Plus 组件类型定义 - 移除了 ComponentCustomProperties 接口wangzeyan
75 changed files with 23330 additions and 21 deletions
@ -0,0 +1,40 @@ |
|||
import request from '@/utils/request' |
|||
// USER_CODE_BEGIN -- lesson_course_teaching
|
|||
|
|||
export function getPublicLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/public_library`, {params}) |
|||
} |
|||
|
|||
|
|||
export function addPublicLibraryList(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/public_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
|
|||
export function editPublicLibraryList(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/public_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取教研管理详情 |
|||
* @param id 教研管理id |
|||
* @returns |
|||
*/ |
|||
export function getLessonCourseTeachingInfo(id: number) { |
|||
return request.get(`lesson_course_teaching/lesson_course_teaching/${id}`); |
|||
} |
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
* @param id |
|||
* @returns |
|||
*/ |
|||
export function deleteLessonCourseTeaching(id: number) { |
|||
return request.delete(`lesson_course_teaching/lesson_course_teaching/${id}`, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
export function getWithPersonnelDataList(params: Record<string,any>){ |
|||
return request.get('lesson_course_teaching/personnel_data_all', {params}) |
|||
} |
|||
|
|||
// USER_CODE_END -- lesson_course_teaching
|
|||
@ -0,0 +1,140 @@ |
|||
import request from '@/utils/request' |
|||
// USER_CODE_BEGIN -- lesson_course_teaching
|
|||
/** |
|||
* 获取热身动作库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getActionLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/action_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加热身动作库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addActionLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/action_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑热身动作库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editActionLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/action_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取体能动作库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getFitnessLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/fitness_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加体能动作库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addFitnessLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/fitness_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑体能动作库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editFitnessLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/fitness_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取趣味游戏库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getGamesLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/games_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addGamesLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/games_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑趣味游戏库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editGamesLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/games_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取趣味游戏库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getRelaxationLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/relaxation_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addRelaxationLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/relaxation_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑趣味游戏库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editRelaxationLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/relaxation_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 获取教研管理详情 |
|||
* @param id 教研管理id |
|||
* @returns |
|||
*/ |
|||
export function getLessonCourseTeachingInfo(id: number) { |
|||
return request.get(`lesson_course_teaching/lesson_course_teaching/${id}`); |
|||
} |
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
* @param id |
|||
* @returns |
|||
*/ |
|||
export function deleteLessonCourseTeaching(id: number) { |
|||
return request.delete(`lesson_course_teaching/lesson_course_teaching/${id}`, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
export function getWithPersonnelDataList(params: Record<string,any>){ |
|||
return request.get('lesson_course_teaching/personnel_data_all', {params}) |
|||
} |
|||
|
|||
// USER_CODE_END -- lesson_course_teaching
|
|||
@ -0,0 +1,249 @@ |
|||
import request from '@/utils/request' |
|||
// USER_CODE_BEGIN -- lesson_course_teaching
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getLessonCourseTeachingList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/lesson_course_teaching`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addLessonCourseTeaching(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/lesson_course_teaching', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑课程教学大纲 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editLessonCourseTeaching(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/lesson_course_teaching/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getJumpLessonLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/jump_lesson_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addJumpLessonLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/jump_lesson_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑跳绳教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editJumpLessonLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/jump_lesson_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getEnTeachingLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/en_teaching_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addEnTeachingLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/en_teaching_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑增高教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editEnTeachingLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/en_teaching_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取篮球教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getBasketballTeachingLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/basketball_teaching_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加篮球教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addBasketballTeachingLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/basketball_teaching_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑篮球教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editBasketballTeachingLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/basketball_teaching_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取强化教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getStrengTeachingLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/streng_teaching_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加强化教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addStrengTeachingLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/streng_teaching_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑强化教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editStrengTeachingLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/streng_teaching_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取空中忍者教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getNinjaTeachingLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/ninja_teaching_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加空中忍者教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addNinjaTeachingLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/ninja_teaching_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑空中忍者教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editNinjaTeachingLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/ninja_teaching_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取少儿安防教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getSecurityTeachingLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/security_teaching_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加少儿安防教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addSecurityTeachingLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/security_teaching_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑少儿安防教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editSecurityTeachingLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/security_teaching_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getPhysicalTeachingLibraryList(params: Record<string, any>) { |
|||
return request.get(`lesson_course_teaching/physical_teaching_library`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 添加体能教案库 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addPhysicalTeachingLibrary(params: Record<string, any>) { |
|||
return request.post('lesson_course_teaching/physical_teaching_library', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑体能教案库 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editPhysicalTeachingLibrary(params: Record<string, any>) { |
|||
return request.put(`lesson_course_teaching/physical_teaching_library/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 获取教研管理详情 |
|||
* @param id 教研管理id |
|||
* @returns |
|||
*/ |
|||
export function getLessonCourseTeachingInfo(id: number) { |
|||
return request.get(`lesson_course_teaching/lesson_course_teaching/${id}`); |
|||
} |
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
* @param id |
|||
* @returns |
|||
*/ |
|||
export function deleteLessonCourseTeaching(id: number) { |
|||
return request.delete(`lesson_course_teaching/lesson_course_teaching/${id}`, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
export function getWithPersonnelDataList(params: Record<string,any>){ |
|||
return request.get('lesson_course_teaching/personnel_data_all', {params}) |
|||
} |
|||
|
|||
// USER_CODE_END -- lesson_course_teaching
|
|||
@ -0,0 +1,27 @@ |
|||
{ |
|||
"title":"课程标题", |
|||
"titlePlaceholder":"请输入课程标题", |
|||
"image":"预览图", |
|||
"imagePlaceholder":"请输入预览图", |
|||
"type":"素材类型", |
|||
"typePlaceholder":"请输入素材类型", |
|||
"content":"课程内容", |
|||
"contentPlaceholder":"请输入课程内容", |
|||
"status":"状态", |
|||
"statusPlaceholder":"请输入状态", |
|||
"createTime":"创建时间", |
|||
"createTimePlaceholder":"请输入创建时间", |
|||
"updateTime":"修改时间", |
|||
"updateTimePlaceholder":"请输入修改时间", |
|||
"userPermission":"用户权限", |
|||
"userPermissionPlaceholder":"请输入用户权限", |
|||
"addLessonCourseTeaching":"添加互动游戏", |
|||
"updateLessonCourseTeaching":"编辑互动游戏", |
|||
"lessonCourseTeachingDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间", |
|||
"addJumpLessonLibrary":"添加套圈游戏", |
|||
"updateJumpLessonLibrary":"编辑套圈游戏", |
|||
"addEnTeachingLibrary":"添加鼓励方式", |
|||
"editEnTeachingLibrary":"编辑鼓励方式" |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
{ |
|||
"title":"课程标题", |
|||
"titlePlaceholder":"请输入课程标题", |
|||
"image":"预览图", |
|||
"imagePlaceholder":"请输入预览图", |
|||
"type":"素材类型", |
|||
"typePlaceholder":"请输入素材类型", |
|||
"content":"课程内容", |
|||
"contentPlaceholder":"请输入课程内容", |
|||
"status":"状态", |
|||
"statusPlaceholder":"请输入状态", |
|||
"createTime":"创建时间", |
|||
"createTimePlaceholder":"请输入创建时间", |
|||
"updateTime":"修改时间", |
|||
"updateTimePlaceholder":"请输入修改时间", |
|||
"userPermission":"用户权限", |
|||
"userPermissionPlaceholder":"请输入用户权限", |
|||
"addLessonCourseTeaching":"添加训练内容", |
|||
"updateLessonCourseTeaching":"编辑训练内容", |
|||
"lessonCourseTeachingDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间", |
|||
"addJumpLessonLibrary":"添加训练视频", |
|||
"updateJumpLessonLibrary":"编辑训练视频", |
|||
"addEnTeachingLibrary":"添加课后作业", |
|||
"editEnTeachingLibrary":"编辑课后作业" |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
{ |
|||
"title":"课程标题", |
|||
"titlePlaceholder":"请输入课程标题", |
|||
"image":"预览图", |
|||
"imagePlaceholder":"请输入预览图", |
|||
"type":"素材类型", |
|||
"typePlaceholder":"请输入素材类型", |
|||
"content":"课程内容", |
|||
"contentPlaceholder":"请输入课程内容", |
|||
"status":"状态", |
|||
"statusPlaceholder":"请输入状态", |
|||
"createTime":"创建时间", |
|||
"createTimePlaceholder":"请输入创建时间", |
|||
"updateTime":"修改时间", |
|||
"updateTimePlaceholder":"请输入修改时间", |
|||
"userPermission":"用户权限", |
|||
"userPermissionPlaceholder":"请输入用户权限", |
|||
"lessonCourseTeachingDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间", |
|||
"addActionLibrary":"添加热身动作库", |
|||
"updateActionLibrary":"编辑热身动作库", |
|||
"addJumpLessonLibrary":"添加体能动作库", |
|||
"updateJumpLessonLibrary":"编辑体能动作库", |
|||
"addEnTeachingLibrary":"添加趣味游戏库", |
|||
"editEnTeachingLibrary":"编辑趣味游戏库", |
|||
"addBasketballTeachingLibrary":"添加放松动作库", |
|||
"editBasketballTeachingLibrary":"编辑放松动作库" |
|||
} |
|||
|
|||
@ -0,0 +1,37 @@ |
|||
{ |
|||
"title":"课程标题", |
|||
"titlePlaceholder":"请输入课程标题", |
|||
"image":"预览图", |
|||
"imagePlaceholder":"请输入预览图", |
|||
"type":"素材类型", |
|||
"typePlaceholder":"请输入素材类型", |
|||
"content":"课程内容", |
|||
"contentPlaceholder":"请输入课程内容", |
|||
"status":"状态", |
|||
"statusPlaceholder":"请输入状态", |
|||
"createTime":"创建时间", |
|||
"createTimePlaceholder":"请输入创建时间", |
|||
"updateTime":"修改时间", |
|||
"updateTimePlaceholder":"请输入修改时间", |
|||
"userPermission":"用户权限", |
|||
"userPermissionPlaceholder":"请输入用户权限", |
|||
"addLessonCourseTeaching":"添加课程教学大纲", |
|||
"updateLessonCourseTeaching":"编辑课程教学大纲", |
|||
"lessonCourseTeachingDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间", |
|||
"addJumpLessonLibrary":"添加跳绳教案库", |
|||
"updateJumpLessonLibrary":"编辑跳绳教案库", |
|||
"addEnTeachingLibrary":"添加增高教案库", |
|||
"editEnTeachingLibrary":"编辑增高教案库", |
|||
"addBasketballTeachingLibrary":"添加篮球教案库", |
|||
"editBasketballTeachingLibrary":"编辑篮球教案库", |
|||
"addStrengthenTeachingLibrary":"添加强化教案库", |
|||
"editStrengthenTeachingLibrary":"编辑强化教案库", |
|||
"addNinjaTeachingLibrary":"添加空中忍者教案库", |
|||
"editNinjaTeachingLibrary":"编辑空中忍者教案库", |
|||
"addSecurityTeachingLibrary":"添加少儿安防教案库", |
|||
"editSecurityTeachingLibrary":"编辑少儿安防教案库", |
|||
"addPhysicalTeachingLibrary":"添加体能教案库", |
|||
"editPhysicalTeachingLibrary":"编辑体能教案库" |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
{ |
|||
"title":"课程标题", |
|||
"titlePlaceholder":"请输入课程标题", |
|||
"image":"预览图", |
|||
"imagePlaceholder":"请输入预览图", |
|||
"type":"素材类型", |
|||
"typePlaceholder":"请输入素材类型", |
|||
"content":"课程内容", |
|||
"contentPlaceholder":"请输入课程内容", |
|||
"status":"状态", |
|||
"statusPlaceholder":"请输入状态", |
|||
"createTime":"创建时间", |
|||
"createTimePlaceholder":"请输入创建时间", |
|||
"updateTime":"修改时间", |
|||
"updateTimePlaceholder":"请输入修改时间", |
|||
"userPermission":"用户权限", |
|||
"userPermissionPlaceholder":"请输入用户权限", |
|||
"addLessonCourseTeaching":"添加3-6岁体测", |
|||
"updateLessonCourseTeaching":"编辑3-6岁体测", |
|||
"lessonCourseTeachingDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间", |
|||
"addJumpLessonLibrary":"添加7+体测", |
|||
"updateJumpLessonLibrary":"编辑7+体测", |
|||
"addEnTeachingLibrary":"添加3-6岁体测讲解—解读", |
|||
"editEnTeachingLibrary":"编辑3-6岁体测讲解—解读", |
|||
"addBasketballTeachingLibrary":"添加7+岁体测讲解—解读", |
|||
"editBasketballTeachingLibrary":"编辑7+岁体测讲解—解读" |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
{ |
|||
"title":"课程标题", |
|||
"titlePlaceholder":"请输入课程标题", |
|||
"image":"预览图", |
|||
"imagePlaceholder":"请输入预览图", |
|||
"type":"素材类型", |
|||
"typePlaceholder":"请输入素材类型", |
|||
"content":"课程内容", |
|||
"contentPlaceholder":"请输入课程内容", |
|||
"status":"状态", |
|||
"statusPlaceholder":"请输入状态", |
|||
"createTime":"创建时间", |
|||
"createTimePlaceholder":"请输入创建时间", |
|||
"updateTime":"修改时间", |
|||
"updateTimePlaceholder":"请输入修改时间", |
|||
"userPermission":"用户权限", |
|||
"userPermissionPlaceholder":"请输入用户权限", |
|||
"addLessonCourseTeaching":"添加优秀一堂课", |
|||
"updateLessonCourseTeaching":"编辑优秀一堂课", |
|||
"lessonCourseTeachingDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间", |
|||
"addJumpLessonLibrary":"添加空中忍者", |
|||
"updateJumpLessonLibrary":"编辑空中忍者", |
|||
"addEnTeachingLibrary":"添加篮球动作", |
|||
"editEnTeachingLibrary":"编辑篮球动作", |
|||
"addBasketballTeachingLibrary":"添加跳绳动作", |
|||
"editBasketballTeachingLibrary":"编辑跳绳动作", |
|||
"addStrengthenTeachingLibrary":"添加跑酷动作", |
|||
"editStrengthenTeachingLibrary":"编辑跑酷动作", |
|||
"addNinjaTeachingLibrary":"添加安防动作", |
|||
"editNinjaTeachingLibrary":"编辑安防动作", |
|||
"addSecurityTeachingLibrary":"添加标准化动作", |
|||
"editSecurityTeachingLibrary":"编辑标准化动作" |
|||
} |
|||
@ -0,0 +1,564 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-tabs v-model="active"> |
|||
<el-tab-pane label="互动游戏" name="CourseSyllabus"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEvent"> |
|||
{{ t('addLessonCourseTeaching') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="lessonCourseTeachingTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="lessonCourseTeachingTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="lessonCourseTeachingTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadLessonCourseTeachingList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 27)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="lessonCourseTeachingTable.data" size="large" v-loading="lessonCourseTeachingTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !lessonCourseTeachingTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 27)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="lessonCourseTeachingTable.page" v-model:page-size="lessonCourseTeachingTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="lessonCourseTeachingTable.total" |
|||
@size-change="loadLessonCourseTeachingList()" @current-change="loadLessonCourseTeachingList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editLessonCourseTeachingDialog" @complete="loadLessonCourseTeachingList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="套圈游戏" name="JumpLessonLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addJumpLessonLibrary"> |
|||
{{ t('addJumpLessonLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="JumpLessonLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="JumpLessonLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="JumpLessonLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadJumpLessonLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 28)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="JumpLessonLibraryTable.data" size="large" v-loading="JumpLessonLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !JumpLessonLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editJumpLessonLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 28)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="JumpLessonLibraryTable.page" v-model:page-size="JumpLessonLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="JumpLessonLibraryTable.total" |
|||
@size-change="loadJumpLessonLibraryList()" @current-change="loadJumpLessonLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-jump ref="editJumpLessonLibraryDialog" @complete="loadJumpLessonLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="鼓励方式" name="EnTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEnTeachingLibrary"> |
|||
{{ t('addEnTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="EnTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="EnTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="EnTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadEnTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 29)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="EnTeachingLibraryTable.data" size="large" v-loading="EnTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !EnTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEnTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 29)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="EnTeachingLibraryTable.page" v-model:page-size="EnTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="EnTeachingLibraryTable.total" |
|||
@size-change="loadEnTeachingLibraryList()" @current-change="loadEnTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-en ref="editEnTeachingLibraryDialog" @complete="loadEnTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getLessonCourseTeachingList, deleteLessonCourseTeaching, getWithPersonnelDataList, getJumpLessonLibraryList, getEnTeachingLibraryList, getBasketballTeachingLibraryList, getStrengTeachingLibraryList, getNinjaTeachingLibraryList, getSecurityTeachingLibraryList, getPhysicalTeachingLibraryList } from '@/app/api/lesson_course_teaching' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/children_like/components/lesson-course-teaching-edit.vue' |
|||
import EditJump from '@/app/views/children_like/components/Jump-lesson-library-edit.vue' |
|||
import EditEn from '@/app/views/children_like/components/en-course-teaching-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
const active = 'CourseSyllabus' |
|||
|
|||
let lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 27 |
|||
} |
|||
}) |
|||
let JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 28 |
|||
} |
|||
}) |
|||
let EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 29 |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
const typeList = ref([] as any[]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
const statusList = ref([] as any[]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
|
|||
const editLessonCourseTeachingDialog: Record<string, any> | null = ref(null) |
|||
const editJumpLessonLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editBasketballTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
*/ |
|||
const loadLessonCourseTeachingList = (page: number = 1) => { |
|||
lessonCourseTeachingTable.loading = true |
|||
lessonCourseTeachingTable.page = page |
|||
|
|||
getLessonCourseTeachingList({ |
|||
page: lessonCourseTeachingTable.page, |
|||
limit: lessonCourseTeachingTable.limit, |
|||
...lessonCourseTeachingTable.searchParam |
|||
}).then(res => { |
|||
lessonCourseTeachingTable.loading = false |
|||
lessonCourseTeachingTable.data = res.data.data |
|||
lessonCourseTeachingTable.total = res.data.total |
|||
}).catch(() => { |
|||
lessonCourseTeachingTable.loading = false |
|||
}) |
|||
} |
|||
loadLessonCourseTeachingList() |
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
*/ |
|||
const addEvent = () => { |
|||
editLessonCourseTeachingDialog.value.setFormData() |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑课程教学大纲 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
editLessonCourseTeachingDialog.value.setFormData(data) |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
*/ |
|||
const loadJumpLessonLibraryList = (page: number = 1) => { |
|||
JumpLessonLibraryTable.loading = true |
|||
JumpLessonLibraryTable.page = page |
|||
|
|||
getJumpLessonLibraryList({ |
|||
page: JumpLessonLibraryTable.page, |
|||
limit: JumpLessonLibraryTable.limit, |
|||
...JumpLessonLibraryTable.searchParam |
|||
}).then(res => { |
|||
JumpLessonLibraryTable.loading = false |
|||
JumpLessonLibraryTable.data = res.data.data |
|||
JumpLessonLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
JumpLessonLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadJumpLessonLibraryList() |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
*/ |
|||
const addJumpLessonLibrary = () => { |
|||
editJumpLessonLibraryDialog.value.setFormData() |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑跳绳教案库 |
|||
* @param data |
|||
*/ |
|||
const editJumpLessonLibrary = (data: any) => { |
|||
editJumpLessonLibraryDialog.value.setFormData(data) |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
*/ |
|||
const loadEnTeachingLibraryList = (page: number = 1) => { |
|||
EnTeachingLibraryTable.loading = true |
|||
EnTeachingLibraryTable.page = page |
|||
|
|||
getEnTeachingLibraryList({ |
|||
page: EnTeachingLibraryTable.page, |
|||
limit: EnTeachingLibraryTable.limit, |
|||
...EnTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
EnTeachingLibraryTable.loading = false |
|||
EnTeachingLibraryTable.data = res.data.data |
|||
EnTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
EnTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadEnTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
*/ |
|||
const addEnTeachingLibrary = () => { |
|||
editEnTeachingLibraryDialog.value.setFormData() |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑增高教案库 |
|||
* @param data |
|||
*/ |
|||
const editEnTeachingLibrary = (data: any) => { |
|||
editEnTeachingLibraryDialog.value.setFormData(data) |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
*/ |
|||
const deleteEvent = (id: number, type: number) => { |
|||
ElMessageBox.confirm(t('lessonCourseTeachingDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteLessonCourseTeaching(id).then(() => { |
|||
if (type === 27) { |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 28) { |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 29) { |
|||
loadEnTeachingLibraryList() |
|||
} |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const userPermissionList = ref([]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined, type: number) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
if (type === 27) { |
|||
lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 27 |
|||
} |
|||
}) |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 28) { |
|||
JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 28 |
|||
} |
|||
}) |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 29) { |
|||
EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 29 |
|||
} |
|||
}) |
|||
loadEnTeachingLibraryList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,229 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateJumpLessonLibrary') : t('addJumpLessonLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addJumpLessonLibrary, editJumpLessonLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 28 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
// , |
|||
// user_permission: [ |
|||
// { required: true, message: t('userPermissionPlaceholder'), trigger: 'blur' }, |
|||
// |
|||
// ] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 28 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editBasketballTeachingLibrary') : t('addBasketballTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addBasketballTeachingLibrary, editBasketballTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 26 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 26 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editEnTeachingLibrary') : t('addEnTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addEnTeachingLibrary, editEnTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 29 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 29 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateLessonCourseTeaching') : t('addLessonCourseTeaching')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
// user_permission: [], |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 27 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editNinjaTeachingLibrary') : t('addNinjaTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addNinjaTeachingLibrary, editNinjaTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 21 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 21 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editPhysicalTeachingLibrary') : t('addPhysicalTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addPhysicalTeachingLibrary, editPhysicalTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPhysicalTeachingLibrary : addPhysicalTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editSecurityTeachingLibrary') : t('addSecurityTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addSecurityTeachingLibrary, editSecurityTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 22 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 22 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editStrengthenTeachingLibrary') : t('addStrengthenTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addStrengTeachingLibrary, editStrengTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 20 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 20 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,724 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-tabs v-model="active"> |
|||
<el-tab-pane label="3-6岁体测" name="CourseSyllabus"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEvent"> |
|||
{{ t('addLessonCourseTeaching') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="lessonCourseTeachingTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="lessonCourseTeachingTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="lessonCourseTeachingTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadLessonCourseTeachingList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 23)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="lessonCourseTeachingTable.data" size="large" v-loading="lessonCourseTeachingTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !lessonCourseTeachingTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 23)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="lessonCourseTeachingTable.page" v-model:page-size="lessonCourseTeachingTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="lessonCourseTeachingTable.total" |
|||
@size-change="loadLessonCourseTeachingList()" @current-change="loadLessonCourseTeachingList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editLessonCourseTeachingDialog" @complete="loadLessonCourseTeachingList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="7+体测" name="JumpLessonLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addJumpLessonLibrary"> |
|||
{{ t('addJumpLessonLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="JumpLessonLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="JumpLessonLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="JumpLessonLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadJumpLessonLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 24)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="JumpLessonLibraryTable.data" size="large" v-loading="JumpLessonLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !JumpLessonLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editJumpLessonLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 24)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="JumpLessonLibraryTable.page" v-model:page-size="JumpLessonLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="JumpLessonLibraryTable.total" |
|||
@size-change="loadJumpLessonLibraryList()" @current-change="loadJumpLessonLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-jump ref="editJumpLessonLibraryDialog" @complete="loadJumpLessonLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="3-6岁体测讲解—解读" name="EnTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEnTeachingLibrary"> |
|||
{{ t('addEnTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="EnTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="EnTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="EnTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadEnTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 25)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="EnTeachingLibraryTable.data" size="large" v-loading="EnTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !EnTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEnTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 25)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="EnTeachingLibraryTable.page" v-model:page-size="EnTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="EnTeachingLibraryTable.total" |
|||
@size-change="loadEnTeachingLibraryList()" @current-change="loadEnTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-en ref="editEnTeachingLibraryDialog" @complete="loadEnTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="7+岁体测讲解—解读" name="BasketballTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addBasketballTeachingLibrary"> |
|||
{{ t('addBasketballTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="BasketballTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="BasketballTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="BasketballTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="BasketballTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="BasketballTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadBasketballTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 26)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="BasketballTeachingLibraryTable.data" size="large" v-loading="BasketballTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !BasketballTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editBasketballTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 26)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="BasketballTeachingLibraryTable.page" v-model:page-size="BasketballTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="BasketballTeachingLibraryTable.total" |
|||
@size-change="loadBasketballTeachingLibraryList()" @current-change="loadBasketballTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-basketball ref="editBasketballTeachingLibraryDialog" @complete="loadBasketballTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getLessonCourseTeachingList, deleteLessonCourseTeaching, getWithPersonnelDataList, getJumpLessonLibraryList, getEnTeachingLibraryList, getBasketballTeachingLibraryList, getStrengTeachingLibraryList, getNinjaTeachingLibraryList, getSecurityTeachingLibraryList, getPhysicalTeachingLibraryList } from '@/app/api/lesson_course_teaching' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/physical_testing/components/lesson-course-teaching-edit.vue' |
|||
import EditJump from '@/app/views/physical_testing/components/Jump-lesson-library-edit.vue' |
|||
import EditEn from '@/app/views/physical_testing/components/en-course-teaching-edit.vue' |
|||
import EditBasketball from '@/app/views/physical_testing/components/basketball-course-teaching-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
const active = 'CourseSyllabus' |
|||
|
|||
let lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 23 |
|||
} |
|||
}) |
|||
let JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 24 |
|||
} |
|||
}) |
|||
let EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 25 |
|||
} |
|||
}) |
|||
let BasketballTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 26 |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
const typeList = ref([] as any[]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
const statusList = ref([] as any[]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
|
|||
const editLessonCourseTeachingDialog: Record<string, any> | null = ref(null) |
|||
const editJumpLessonLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editBasketballTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
*/ |
|||
const loadLessonCourseTeachingList = (page: number = 1) => { |
|||
lessonCourseTeachingTable.loading = true |
|||
lessonCourseTeachingTable.page = page |
|||
|
|||
getLessonCourseTeachingList({ |
|||
page: lessonCourseTeachingTable.page, |
|||
limit: lessonCourseTeachingTable.limit, |
|||
...lessonCourseTeachingTable.searchParam |
|||
}).then(res => { |
|||
lessonCourseTeachingTable.loading = false |
|||
lessonCourseTeachingTable.data = res.data.data |
|||
lessonCourseTeachingTable.total = res.data.total |
|||
}).catch(() => { |
|||
lessonCourseTeachingTable.loading = false |
|||
}) |
|||
} |
|||
loadLessonCourseTeachingList() |
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
*/ |
|||
const addEvent = () => { |
|||
editLessonCourseTeachingDialog.value.setFormData() |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑课程教学大纲 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
editLessonCourseTeachingDialog.value.setFormData(data) |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
*/ |
|||
const loadJumpLessonLibraryList = (page: number = 1) => { |
|||
JumpLessonLibraryTable.loading = true |
|||
JumpLessonLibraryTable.page = page |
|||
|
|||
getJumpLessonLibraryList({ |
|||
page: JumpLessonLibraryTable.page, |
|||
limit: JumpLessonLibraryTable.limit, |
|||
...JumpLessonLibraryTable.searchParam |
|||
}).then(res => { |
|||
JumpLessonLibraryTable.loading = false |
|||
JumpLessonLibraryTable.data = res.data.data |
|||
JumpLessonLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
JumpLessonLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadJumpLessonLibraryList() |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
*/ |
|||
const addJumpLessonLibrary = () => { |
|||
editJumpLessonLibraryDialog.value.setFormData() |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑跳绳教案库 |
|||
* @param data |
|||
*/ |
|||
const editJumpLessonLibrary = (data: any) => { |
|||
editJumpLessonLibraryDialog.value.setFormData(data) |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
*/ |
|||
const loadEnTeachingLibraryList = (page: number = 1) => { |
|||
EnTeachingLibraryTable.loading = true |
|||
EnTeachingLibraryTable.page = page |
|||
|
|||
getEnTeachingLibraryList({ |
|||
page: EnTeachingLibraryTable.page, |
|||
limit: EnTeachingLibraryTable.limit, |
|||
...EnTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
EnTeachingLibraryTable.loading = false |
|||
EnTeachingLibraryTable.data = res.data.data |
|||
EnTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
EnTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadEnTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
*/ |
|||
const addEnTeachingLibrary = () => { |
|||
editEnTeachingLibraryDialog.value.setFormData() |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑增高教案库 |
|||
* @param data |
|||
*/ |
|||
const editEnTeachingLibrary = (data: any) => { |
|||
editEnTeachingLibraryDialog.value.setFormData(data) |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 获取篮球教案库列表 |
|||
*/ |
|||
const loadBasketballTeachingLibraryList = (page: number = 1) => { |
|||
BasketballTeachingLibraryTable.loading = true |
|||
BasketballTeachingLibraryTable.page = page |
|||
|
|||
getBasketballTeachingLibraryList({ |
|||
page: BasketballTeachingLibraryTable.page, |
|||
limit: BasketballTeachingLibraryTable.limit, |
|||
...BasketballTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
BasketballTeachingLibraryTable.loading = false |
|||
BasketballTeachingLibraryTable.data = res.data.data |
|||
BasketballTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
BasketballTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadBasketballTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加篮球教案库 |
|||
*/ |
|||
const addBasketballTeachingLibrary = () => { |
|||
editBasketballTeachingLibraryDialog.value.setFormData() |
|||
editBasketballTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑篮球教案库 |
|||
* @param data |
|||
*/ |
|||
const editBasketballTeachingLibrary = (data: any) => { |
|||
editBasketballTeachingLibraryDialog.value.setFormData(data) |
|||
editBasketballTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
*/ |
|||
const deleteEvent = (id: number, type: number) => { |
|||
ElMessageBox.confirm(t('lessonCourseTeachingDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteLessonCourseTeaching(id).then(() => { |
|||
if (type === 23) { |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 24) { |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 25) { |
|||
loadEnTeachingLibraryList() |
|||
} else if (type === 26) { |
|||
loadBasketballTeachingLibraryList() |
|||
} |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const userPermissionList = ref([]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined, type: number) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
if (type === 23) { |
|||
lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 23 |
|||
} |
|||
}) |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 24) { |
|||
JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 24 |
|||
} |
|||
}) |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 25) { |
|||
EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 25 |
|||
} |
|||
}) |
|||
loadEnTeachingLibraryList() |
|||
} else if (type === 26) { |
|||
BasketballTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 26 |
|||
} |
|||
}) |
|||
loadBasketballTeachingLibraryList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,229 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateJumpLessonLibrary') : t('addJumpLessonLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addJumpLessonLibrary, editJumpLessonLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 14 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
// , |
|||
// user_permission: [ |
|||
// { required: true, message: t('userPermissionPlaceholder'), trigger: 'blur' }, |
|||
// |
|||
// ] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 14 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editBasketballTeachingLibrary') : t('addBasketballTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addBasketballTeachingLibrary, editBasketballTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editBasketballTeachingLibrary : addBasketballTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editEnTeachingLibrary') : t('addEnTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addEnTeachingLibrary, editEnTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 15 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 15 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateLessonCourseTeaching') : t('addLessonCourseTeaching')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
// user_permission: [], |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 13 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editNinjaTeachingLibrary') : t('addNinjaTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addNinjaTeachingLibrary, editNinjaTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editNinjaTeachingLibrary : addNinjaTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editPhysicalTeachingLibrary') : t('addPhysicalTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addPhysicalTeachingLibrary, editPhysicalTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPhysicalTeachingLibrary : addPhysicalTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editSecurityTeachingLibrary') : t('addSecurityTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addSecurityTeachingLibrary, editSecurityTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editSecurityTeachingLibrary : addSecurityTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editStrengthenTeachingLibrary') : t('addStrengthenTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addStrengTeachingLibrary, editStrengTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editStrengTeachingLibrary : addStrengTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,567 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-tabs v-model="active"> |
|||
<el-tab-pane label="训练内容" name="CourseSyllabus"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEvent"> |
|||
{{ t('addLessonCourseTeaching') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="lessonCourseTeachingTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="lessonCourseTeachingTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="lessonCourseTeachingTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadLessonCourseTeachingList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 13)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="lessonCourseTeachingTable.data" size="large" v-loading="lessonCourseTeachingTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !lessonCourseTeachingTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 13)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="lessonCourseTeachingTable.page" v-model:page-size="lessonCourseTeachingTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="lessonCourseTeachingTable.total" |
|||
@size-change="loadLessonCourseTeachingList()" @current-change="loadLessonCourseTeachingList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editLessonCourseTeachingDialog" @complete="loadLessonCourseTeachingList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="训练视频" name="JumpLessonLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addJumpLessonLibrary"> |
|||
{{ t('addJumpLessonLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="JumpLessonLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="JumpLessonLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="JumpLessonLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadJumpLessonLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 14)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="JumpLessonLibraryTable.data" size="large" v-loading="JumpLessonLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !JumpLessonLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editJumpLessonLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 14)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="JumpLessonLibraryTable.page" v-model:page-size="JumpLessonLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="JumpLessonLibraryTable.total" |
|||
@size-change="loadJumpLessonLibraryList()" @current-change="loadJumpLessonLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-jump ref="editJumpLessonLibraryDialog" @complete="loadJumpLessonLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="课后作业" name="EnTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEnTeachingLibrary"> |
|||
{{ t('addEnTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="EnTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="EnTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="EnTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadEnTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 15)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="EnTeachingLibraryTable.data" size="large" v-loading="EnTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !EnTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEnTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 15)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="EnTeachingLibraryTable.page" v-model:page-size="EnTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="EnTeachingLibraryTable.total" |
|||
@size-change="loadEnTeachingLibraryList()" @current-change="loadEnTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-en ref="editEnTeachingLibraryDialog" @complete="loadEnTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
addPublicLibraryList editPublicLibraryList |
|||
|
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getLessonCourseTeachingList, deleteLessonCourseTeaching, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { getPublicLibraryList } from '@/app/api/future_ontent' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/future_ontent/components/lesson-course-teaching-edit.vue' |
|||
import EditJump from '@/app/views/future_ontent/components/Jump-lesson-library-edit.vue' |
|||
import EditEn from '@/app/views/future_ontent/components/en-course-teaching-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
const active = 'CourseSyllabus' |
|||
|
|||
let lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
"table_type":13 |
|||
} |
|||
}) |
|||
let JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
"table_type":14 |
|||
} |
|||
}) |
|||
let EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
"table_type":15 |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
const typeList = ref([] as any[]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
const statusList = ref([] as any[]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
|
|||
const editLessonCourseTeachingDialog: Record<string, any> | null = ref(null) |
|||
const editJumpLessonLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
*/ |
|||
const loadLessonCourseTeachingList = (page: number = 1) => { |
|||
lessonCourseTeachingTable.loading = true |
|||
lessonCourseTeachingTable.page = page |
|||
|
|||
getPublicLibraryList({ |
|||
page: lessonCourseTeachingTable.page, |
|||
limit: lessonCourseTeachingTable.limit, |
|||
...lessonCourseTeachingTable.searchParam |
|||
}).then(res => { |
|||
lessonCourseTeachingTable.loading = false |
|||
lessonCourseTeachingTable.data = res.data.data |
|||
lessonCourseTeachingTable.total = res.data.total |
|||
}).catch(() => { |
|||
lessonCourseTeachingTable.loading = false |
|||
}) |
|||
} |
|||
loadLessonCourseTeachingList() |
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
*/ |
|||
const addEvent = () => { |
|||
editLessonCourseTeachingDialog.value.setFormData() |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑课程教学大纲 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
editLessonCourseTeachingDialog.value.setFormData(data) |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
*/ |
|||
const loadJumpLessonLibraryList = (page: number = 1) => { |
|||
JumpLessonLibraryTable.loading = true |
|||
JumpLessonLibraryTable.page = page |
|||
|
|||
getPublicLibraryList({ |
|||
page: JumpLessonLibraryTable.page, |
|||
limit: JumpLessonLibraryTable.limit, |
|||
...JumpLessonLibraryTable.searchParam |
|||
}).then(res => { |
|||
JumpLessonLibraryTable.loading = false |
|||
JumpLessonLibraryTable.data = res.data.data |
|||
JumpLessonLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
JumpLessonLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadJumpLessonLibraryList() |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
*/ |
|||
const addJumpLessonLibrary = () => { |
|||
editJumpLessonLibraryDialog.value.setFormData() |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑跳绳教案库 |
|||
* @param data |
|||
*/ |
|||
const editJumpLessonLibrary = (data: any) => { |
|||
editJumpLessonLibraryDialog.value.setFormData(data) |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
*/ |
|||
const loadEnTeachingLibraryList = (page: number = 1) => { |
|||
EnTeachingLibraryTable.loading = true |
|||
EnTeachingLibraryTable.page = page |
|||
|
|||
getPublicLibraryList({ |
|||
page: EnTeachingLibraryTable.page, |
|||
limit: EnTeachingLibraryTable.limit, |
|||
...EnTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
EnTeachingLibraryTable.loading = false |
|||
EnTeachingLibraryTable.data = res.data.data |
|||
EnTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
EnTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadEnTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
*/ |
|||
const addEnTeachingLibrary = () => { |
|||
editEnTeachingLibraryDialog.value.setFormData() |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑增高教案库 |
|||
* @param data |
|||
*/ |
|||
const editEnTeachingLibrary = (data: any) => { |
|||
editEnTeachingLibraryDialog.value.setFormData(data) |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
*/ |
|||
const deleteEvent = (id: number, type: number) => { |
|||
ElMessageBox.confirm(t('lessonCourseTeachingDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteLessonCourseTeaching(id).then(() => { |
|||
if (type === 13) { |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 14) { |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 15) { |
|||
loadEnTeachingLibraryList() |
|||
} |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const userPermissionList = ref([]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined, type: number) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
if (type === 13) { |
|||
lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
"table_type":13 |
|||
} |
|||
}) |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 14) { |
|||
JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
"table_type":14 |
|||
} |
|||
}) |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 15) { |
|||
EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
"table_type":15 |
|||
} |
|||
}) |
|||
loadEnTeachingLibraryList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
File diff suppressed because it is too large
@ -0,0 +1,228 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateJumpLessonLibrary') : t('addJumpLessonLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addFitnessLibrary, editFitnessLibrary } from '@/app/api/instructional_material' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
// , |
|||
// user_permission: [ |
|||
// { required: true, message: t('userPermissionPlaceholder'), trigger: 'blur' }, |
|||
// |
|||
// ] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editFitnessLibrary : addFitnessLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editBasketballTeachingLibrary') : t('addBasketballTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addBasketballTeachingLibrary, editBasketballTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addRelaxationLibrary, editRelaxationLibrary } from '@/app/api/instructional_material' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editRelaxationLibrary : addRelaxationLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editEnTeachingLibrary') : t('addEnTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addGamesLibrary, editGamesLibrary } from '@/app/api/instructional_material' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editGamesLibrary : addGamesLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateActionLibrary') : t('addActionLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addActionLibrary, editActionLibrary } from '@/app/api/instructional_material' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
// user_permission: [], |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editActionLibrary : addActionLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editNinjaTeachingLibrary') : t('addNinjaTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addNinjaTeachingLibrary, editNinjaTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editNinjaTeachingLibrary : addNinjaTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editPhysicalTeachingLibrary') : t('addPhysicalTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addPhysicalTeachingLibrary, editPhysicalTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPhysicalTeachingLibrary : addPhysicalTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editSecurityTeachingLibrary') : t('addSecurityTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addSecurityTeachingLibrary, editSecurityTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editSecurityTeachingLibrary : addSecurityTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editStrengthenTeachingLibrary') : t('addStrengthenTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addStrengTeachingLibrary, editStrengTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editStrengTeachingLibrary : addStrengTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,713 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-tabs v-model="active"> |
|||
<el-tab-pane label="热身动作库" name="ActionLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addActionLibrary"> |
|||
{{ t('addActionLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="ActionLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="ActionLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="ActionLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="ActionLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="ActionLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadActionLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 9)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="ActionLibraryTable.data" size="large" v-loading="ActionLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !ActionLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="updateActionLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 9)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="ActionLibraryTable.page" v-model:page-size="ActionLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="ActionLibraryTable.total" |
|||
@size-change="loadActionLibraryList()" @current-change="loadActionLibraryList" /> |
|||
</div> |
|||
</div> |
|||
<edit ref="editActionLibraryDialog" @complete="loadActionLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="体能动作库" name="PhysicalActionLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addJumpLessonLibrary"> |
|||
{{ t('addJumpLessonLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="JumpLessonLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="JumpLessonLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="JumpLessonLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadJumpLessonLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 10)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="JumpLessonLibraryTable.data" size="large" v-loading="JumpLessonLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !JumpLessonLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editJumpLessonLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 10)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="JumpLessonLibraryTable.page" v-model:page-size="JumpLessonLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="JumpLessonLibraryTable.total" |
|||
@size-change="loadJumpLessonLibraryList()" @current-change="loadJumpLessonLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-jump ref="editJumpLessonLibraryDialog" @complete="loadJumpLessonLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="趣味游戏库" name="FunGameLibraryLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEnTeachingLibrary"> |
|||
{{ t('addEnTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="EnTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="EnTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="EnTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadEnTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 11)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="EnTeachingLibraryTable.data" size="large" v-loading="EnTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !EnTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEnTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 11)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="EnTeachingLibraryTable.page" v-model:page-size="EnTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="EnTeachingLibraryTable.total" |
|||
@size-change="loadEnTeachingLibraryList()" @current-change="loadEnTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-en ref="editEnTeachingLibraryDialog" @complete="loadEnTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="放松动作库" name="RelaxationActionLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addBasketballTeachingLibrary"> |
|||
{{ t('addBasketballTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="BasketballTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="BasketballTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="BasketballTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="BasketballTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="BasketballTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadBasketballTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 12)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="BasketballTeachingLibraryTable.data" size="large" v-loading="BasketballTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !BasketballTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editBasketballTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 12)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="BasketballTeachingLibraryTable.page" v-model:page-size="BasketballTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="BasketballTeachingLibraryTable.total" |
|||
@size-change="loadBasketballTeachingLibraryList()" @current-change="loadBasketballTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-basketball ref="editBasketballTeachingLibraryDialog" @complete="loadBasketballTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { deleteLessonCourseTeaching, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { getActionLibraryList, getFitnessLibraryList, getGamesLibraryList, getRelaxationLibraryList } from '@/app/api/instructional_material' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/instructional_material/components/lesson-course-teaching-edit.vue' |
|||
import EditJump from '@/app/views/instructional_material/components/Jump-lesson-library-edit.vue' |
|||
import EditEn from '@/app/views/instructional_material/components/en-course-teaching-edit.vue' |
|||
import EditBasketball from '@/app/views/instructional_material/components/basketball-course-teaching-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
const active = 'ActionLibrary' |
|||
|
|||
let ActionLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[] |
|||
} |
|||
}) |
|||
let JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[] |
|||
} |
|||
}) |
|||
let EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[] |
|||
} |
|||
}) |
|||
let BasketballTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[] |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
const typeList = ref([] as any[]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
const statusList = ref([] as any[]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
|
|||
const editActionLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editJumpLessonLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editBasketballTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editStrengthenTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 获取热身动作库列表 |
|||
*/ |
|||
const loadActionLibraryList = (page: number = 1) => { |
|||
ActionLibraryTable.loading = true |
|||
ActionLibraryTable.page = page |
|||
getActionLibraryList({ |
|||
page: ActionLibraryTable.page, |
|||
limit: ActionLibraryTable.limit, |
|||
...ActionLibraryTable.searchParam |
|||
}).then(res => { |
|||
ActionLibraryTable.loading = false |
|||
ActionLibraryTable.data = res.data.data |
|||
ActionLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
ActionLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadActionLibraryList() |
|||
|
|||
/** |
|||
* 添加热身动作库 |
|||
*/ |
|||
const addActionLibrary = () => { |
|||
editActionLibraryDialog.value.setFormData() |
|||
editActionLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑热身动作库 |
|||
* @param data |
|||
*/ |
|||
const editActionLibrary = (data: any) => { |
|||
editActionLibraryDialog.value.setFormData(data) |
|||
editActionLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取体能动作库列表 |
|||
*/ |
|||
const loadJumpLessonLibraryList = (page: number = 1) => { |
|||
JumpLessonLibraryTable.loading = true |
|||
JumpLessonLibraryTable.page = page |
|||
|
|||
getFitnessLibraryList({ |
|||
page: JumpLessonLibraryTable.page, |
|||
limit: JumpLessonLibraryTable.limit, |
|||
...JumpLessonLibraryTable.searchParam |
|||
}).then(res => { |
|||
JumpLessonLibraryTable.loading = false |
|||
JumpLessonLibraryTable.data = res.data.data |
|||
JumpLessonLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
JumpLessonLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadJumpLessonLibraryList() |
|||
|
|||
/** |
|||
* 添加体能动作库 |
|||
*/ |
|||
const addJumpLessonLibrary = () => { |
|||
editJumpLessonLibraryDialog.value.setFormData() |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑体能动作库 |
|||
* @param data |
|||
*/ |
|||
const editJumpLessonLibrary = (data: any) => { |
|||
editJumpLessonLibraryDialog.value.setFormData(data) |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏库列表 |
|||
*/ |
|||
const loadEnTeachingLibraryList = (page: number = 1) => { |
|||
EnTeachingLibraryTable.loading = true |
|||
EnTeachingLibraryTable.page = page |
|||
|
|||
getGamesLibraryList({ |
|||
page: EnTeachingLibraryTable.page, |
|||
limit: EnTeachingLibraryTable.limit, |
|||
...EnTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
EnTeachingLibraryTable.loading = false |
|||
EnTeachingLibraryTable.data = res.data.data |
|||
EnTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
EnTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadEnTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
*/ |
|||
const addEnTeachingLibrary = () => { |
|||
editEnTeachingLibraryDialog.value.setFormData() |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑趣味游戏 |
|||
* @param data |
|||
*/ |
|||
const editEnTeachingLibrary = (data: any) => { |
|||
editEnTeachingLibraryDialog.value.setFormData(data) |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 获取篮球教案库列表 |
|||
*/ |
|||
const loadBasketballTeachingLibraryList = (page: number = 1) => { |
|||
BasketballTeachingLibraryTable.loading = true |
|||
BasketballTeachingLibraryTable.page = page |
|||
|
|||
getRelaxationLibraryList({ |
|||
page: BasketballTeachingLibraryTable.page, |
|||
limit: BasketballTeachingLibraryTable.limit, |
|||
...BasketballTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
BasketballTeachingLibraryTable.loading = false |
|||
BasketballTeachingLibraryTable.data = res.data.data |
|||
BasketballTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
BasketballTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadBasketballTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加篮球教案库 |
|||
*/ |
|||
const addBasketballTeachingLibrary = () => { |
|||
editBasketballTeachingLibraryDialog.value.setFormData() |
|||
editBasketballTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑篮球教案库 |
|||
* @param data |
|||
*/ |
|||
const editBasketballTeachingLibrary = (data: any) => { |
|||
editBasketballTeachingLibraryDialog.value.setFormData(data) |
|||
editBasketballTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
*/ |
|||
const deleteEvent = (id: number, type: number) => { |
|||
ElMessageBox.confirm(t('lessonCourseTeachingDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteLessonCourseTeaching(id).then(() => { |
|||
if (type === 9) { |
|||
loadActionLibraryList() |
|||
} else if (type === 10) { |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 11) { |
|||
loadEnTeachingLibraryList() |
|||
} else if (type === 12) { |
|||
loadBasketballTeachingLibraryList() |
|||
} |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const userPermissionList = ref([]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined, type: number) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
if (type === 9) { |
|||
ActionLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [] |
|||
} |
|||
}) |
|||
loadActionLibraryList() |
|||
} else if (type === 10) { |
|||
JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [] |
|||
} |
|||
}) |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 11) { |
|||
EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [] |
|||
} |
|||
}) |
|||
loadEnTeachingLibraryList() |
|||
} else if (type === 12) { |
|||
BasketballTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [] |
|||
} |
|||
}) |
|||
loadBasketballTeachingLibraryList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
File diff suppressed because it is too large
@ -0,0 +1,227 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateJumpLessonLibrary') : t('addJumpLessonLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addJumpLessonLibrary, editJumpLessonLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
// , |
|||
// user_permission: [ |
|||
// { required: true, message: t('userPermissionPlaceholder'), trigger: 'blur' }, |
|||
// |
|||
// ] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editJumpLessonLibrary : addJumpLessonLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editBasketballTeachingLibrary') : t('addBasketballTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addBasketballTeachingLibrary, editBasketballTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editBasketballTeachingLibrary : addBasketballTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editEnTeachingLibrary') : t('addEnTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addEnTeachingLibrary, editEnTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editEnTeachingLibrary : addEnTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateLessonCourseTeaching') : t('addLessonCourseTeaching')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addLessonCourseTeaching, editLessonCourseTeaching, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
// user_permission: [], |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editLessonCourseTeaching : addLessonCourseTeaching |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editNinjaTeachingLibrary') : t('addNinjaTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addNinjaTeachingLibrary, editNinjaTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editNinjaTeachingLibrary : addNinjaTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editPhysicalTeachingLibrary') : t('addPhysicalTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addPhysicalTeachingLibrary, editPhysicalTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPhysicalTeachingLibrary : addPhysicalTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editSecurityTeachingLibrary') : t('addSecurityTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addSecurityTeachingLibrary, editSecurityTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editSecurityTeachingLibrary : addSecurityTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editStrengthenTeachingLibrary') : t('addStrengthenTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addStrengTeachingLibrary, editStrengTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editStrengTeachingLibrary : addStrengTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
File diff suppressed because it is too large
@ -0,0 +1,229 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateJumpLessonLibrary') : t('addJumpLessonLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addJumpLessonLibrary, editJumpLessonLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 24 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
// , |
|||
// user_permission: [ |
|||
// { required: true, message: t('userPermissionPlaceholder'), trigger: 'blur' }, |
|||
// |
|||
// ] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 24 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editBasketballTeachingLibrary') : t('addBasketballTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addBasketballTeachingLibrary, editBasketballTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 26 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 26 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editEnTeachingLibrary') : t('addEnTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addEnTeachingLibrary, editEnTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 25 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 25 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateLessonCourseTeaching') : t('addLessonCourseTeaching')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
// user_permission: [], |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 23 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editNinjaTeachingLibrary') : t('addNinjaTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addNinjaTeachingLibrary, editNinjaTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 21 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 21 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editPhysicalTeachingLibrary') : t('addPhysicalTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addPhysicalTeachingLibrary, editPhysicalTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPhysicalTeachingLibrary : addPhysicalTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editSecurityTeachingLibrary') : t('addSecurityTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addSecurityTeachingLibrary, editSecurityTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 22 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 22 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editStrengthenTeachingLibrary') : t('addStrengthenTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addStrengTeachingLibrary, editStrengTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 20 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 20 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,724 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-tabs v-model="active"> |
|||
<el-tab-pane label="3-6岁体测" name="CourseSyllabus"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEvent"> |
|||
{{ t('addLessonCourseTeaching') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="lessonCourseTeachingTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="lessonCourseTeachingTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="lessonCourseTeachingTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadLessonCourseTeachingList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 23)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="lessonCourseTeachingTable.data" size="large" v-loading="lessonCourseTeachingTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !lessonCourseTeachingTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 23)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="lessonCourseTeachingTable.page" v-model:page-size="lessonCourseTeachingTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="lessonCourseTeachingTable.total" |
|||
@size-change="loadLessonCourseTeachingList()" @current-change="loadLessonCourseTeachingList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editLessonCourseTeachingDialog" @complete="loadLessonCourseTeachingList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="7+体测" name="JumpLessonLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addJumpLessonLibrary"> |
|||
{{ t('addJumpLessonLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="JumpLessonLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="JumpLessonLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="JumpLessonLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadJumpLessonLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 24)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="JumpLessonLibraryTable.data" size="large" v-loading="JumpLessonLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !JumpLessonLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editJumpLessonLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 24)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="JumpLessonLibraryTable.page" v-model:page-size="JumpLessonLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="JumpLessonLibraryTable.total" |
|||
@size-change="loadJumpLessonLibraryList()" @current-change="loadJumpLessonLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-jump ref="editJumpLessonLibraryDialog" @complete="loadJumpLessonLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="3-6岁体测讲解—解读" name="EnTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEnTeachingLibrary"> |
|||
{{ t('addEnTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="EnTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="EnTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="EnTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadEnTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 25)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="EnTeachingLibraryTable.data" size="large" v-loading="EnTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !EnTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEnTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 25)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="EnTeachingLibraryTable.page" v-model:page-size="EnTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="EnTeachingLibraryTable.total" |
|||
@size-change="loadEnTeachingLibraryList()" @current-change="loadEnTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-en ref="editEnTeachingLibraryDialog" @complete="loadEnTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="7+岁体测讲解—解读" name="BasketballTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addBasketballTeachingLibrary"> |
|||
{{ t('addBasketballTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="BasketballTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="BasketballTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="BasketballTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="BasketballTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="BasketballTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadBasketballTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 26)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="BasketballTeachingLibraryTable.data" size="large" v-loading="BasketballTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !BasketballTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editBasketballTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 26)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="BasketballTeachingLibraryTable.page" v-model:page-size="BasketballTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="BasketballTeachingLibraryTable.total" |
|||
@size-change="loadBasketballTeachingLibraryList()" @current-change="loadBasketballTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-basketball ref="editBasketballTeachingLibraryDialog" @complete="loadBasketballTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getLessonCourseTeachingList, deleteLessonCourseTeaching, getWithPersonnelDataList, getJumpLessonLibraryList, getEnTeachingLibraryList, getBasketballTeachingLibraryList, getStrengTeachingLibraryList, getNinjaTeachingLibraryList, getSecurityTeachingLibraryList, getPhysicalTeachingLibraryList } from '@/app/api/lesson_course_teaching' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/physical_testing/components/lesson-course-teaching-edit.vue' |
|||
import EditJump from '@/app/views/physical_testing/components/Jump-lesson-library-edit.vue' |
|||
import EditEn from '@/app/views/physical_testing/components/en-course-teaching-edit.vue' |
|||
import EditBasketball from '@/app/views/physical_testing/components/basketball-course-teaching-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
const active = 'CourseSyllabus' |
|||
|
|||
let lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 23 |
|||
} |
|||
}) |
|||
let JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 24 |
|||
} |
|||
}) |
|||
let EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 25 |
|||
} |
|||
}) |
|||
let BasketballTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
table_type: 26 |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
const typeList = ref([] as any[]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
const statusList = ref([] as any[]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
|
|||
const editLessonCourseTeachingDialog: Record<string, any> | null = ref(null) |
|||
const editJumpLessonLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editBasketballTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
*/ |
|||
const loadLessonCourseTeachingList = (page: number = 1) => { |
|||
lessonCourseTeachingTable.loading = true |
|||
lessonCourseTeachingTable.page = page |
|||
|
|||
getLessonCourseTeachingList({ |
|||
page: lessonCourseTeachingTable.page, |
|||
limit: lessonCourseTeachingTable.limit, |
|||
...lessonCourseTeachingTable.searchParam |
|||
}).then(res => { |
|||
lessonCourseTeachingTable.loading = false |
|||
lessonCourseTeachingTable.data = res.data.data |
|||
lessonCourseTeachingTable.total = res.data.total |
|||
}).catch(() => { |
|||
lessonCourseTeachingTable.loading = false |
|||
}) |
|||
} |
|||
loadLessonCourseTeachingList() |
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
*/ |
|||
const addEvent = () => { |
|||
editLessonCourseTeachingDialog.value.setFormData() |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑课程教学大纲 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
editLessonCourseTeachingDialog.value.setFormData(data) |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
*/ |
|||
const loadJumpLessonLibraryList = (page: number = 1) => { |
|||
JumpLessonLibraryTable.loading = true |
|||
JumpLessonLibraryTable.page = page |
|||
|
|||
getJumpLessonLibraryList({ |
|||
page: JumpLessonLibraryTable.page, |
|||
limit: JumpLessonLibraryTable.limit, |
|||
...JumpLessonLibraryTable.searchParam |
|||
}).then(res => { |
|||
JumpLessonLibraryTable.loading = false |
|||
JumpLessonLibraryTable.data = res.data.data |
|||
JumpLessonLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
JumpLessonLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadJumpLessonLibraryList() |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
*/ |
|||
const addJumpLessonLibrary = () => { |
|||
editJumpLessonLibraryDialog.value.setFormData() |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑跳绳教案库 |
|||
* @param data |
|||
*/ |
|||
const editJumpLessonLibrary = (data: any) => { |
|||
editJumpLessonLibraryDialog.value.setFormData(data) |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
*/ |
|||
const loadEnTeachingLibraryList = (page: number = 1) => { |
|||
EnTeachingLibraryTable.loading = true |
|||
EnTeachingLibraryTable.page = page |
|||
|
|||
getEnTeachingLibraryList({ |
|||
page: EnTeachingLibraryTable.page, |
|||
limit: EnTeachingLibraryTable.limit, |
|||
...EnTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
EnTeachingLibraryTable.loading = false |
|||
EnTeachingLibraryTable.data = res.data.data |
|||
EnTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
EnTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadEnTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
*/ |
|||
const addEnTeachingLibrary = () => { |
|||
editEnTeachingLibraryDialog.value.setFormData() |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑增高教案库 |
|||
* @param data |
|||
*/ |
|||
const editEnTeachingLibrary = (data: any) => { |
|||
editEnTeachingLibraryDialog.value.setFormData(data) |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 获取篮球教案库列表 |
|||
*/ |
|||
const loadBasketballTeachingLibraryList = (page: number = 1) => { |
|||
BasketballTeachingLibraryTable.loading = true |
|||
BasketballTeachingLibraryTable.page = page |
|||
|
|||
getBasketballTeachingLibraryList({ |
|||
page: BasketballTeachingLibraryTable.page, |
|||
limit: BasketballTeachingLibraryTable.limit, |
|||
...BasketballTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
BasketballTeachingLibraryTable.loading = false |
|||
BasketballTeachingLibraryTable.data = res.data.data |
|||
BasketballTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
BasketballTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadBasketballTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加篮球教案库 |
|||
*/ |
|||
const addBasketballTeachingLibrary = () => { |
|||
editBasketballTeachingLibraryDialog.value.setFormData() |
|||
editBasketballTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑篮球教案库 |
|||
* @param data |
|||
*/ |
|||
const editBasketballTeachingLibrary = (data: any) => { |
|||
editBasketballTeachingLibraryDialog.value.setFormData(data) |
|||
editBasketballTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
*/ |
|||
const deleteEvent = (id: number, type: number) => { |
|||
ElMessageBox.confirm(t('lessonCourseTeachingDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteLessonCourseTeaching(id).then(() => { |
|||
if (type === 23) { |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 24) { |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 25) { |
|||
loadEnTeachingLibraryList() |
|||
} else if (type === 26) { |
|||
loadBasketballTeachingLibraryList() |
|||
} |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const userPermissionList = ref([]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined, type: number) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
if (type === 23) { |
|||
lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 23 |
|||
} |
|||
}) |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 24) { |
|||
JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 24 |
|||
} |
|||
}) |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 25) { |
|||
EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 25 |
|||
} |
|||
}) |
|||
loadEnTeachingLibraryList() |
|||
} else if (type === 26) { |
|||
BasketballTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
table_type: 26 |
|||
} |
|||
}) |
|||
loadBasketballTeachingLibraryList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
File diff suppressed because it is too large
@ -0,0 +1,229 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateJumpLessonLibrary') : t('addJumpLessonLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addJumpLessonLibrary, editJumpLessonLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 17 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
// , |
|||
// user_permission: [ |
|||
// { required: true, message: t('userPermissionPlaceholder'), trigger: 'blur' }, |
|||
// |
|||
// ] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 17 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editBasketballTeachingLibrary') : t('addBasketballTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addBasketballTeachingLibrary, editBasketballTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 19 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 19 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editEnTeachingLibrary') : t('addEnTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addEnTeachingLibrary, editEnTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 18 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 18 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateLessonCourseTeaching') : t('addLessonCourseTeaching')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
// user_permission: [], |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 16 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editNinjaTeachingLibrary') : t('addNinjaTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addNinjaTeachingLibrary, editNinjaTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 21 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 21 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editPhysicalTeachingLibrary') : t('addPhysicalTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addPhysicalTeachingLibrary, editPhysicalTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '' |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPhysicalTeachingLibrary : addPhysicalTeachingLibrary |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,224 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editSecurityTeachingLibrary') : t('addSecurityTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addSecurityTeachingLibrary, editSecurityTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 22 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
|
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 22 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,223 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('editStrengthenTeachingLibrary') : t('addStrengthenTeachingLibrary')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="formData.title" clearable :placeholder="t('titlePlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('image')" prop="image"> |
|||
<upload-image v-model="formData.image" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('type')" prop="type"> |
|||
<el-select class="input-width" v-model="formData.type" clearable :placeholder="t('typePlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in typeList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('content')" prop="content"> |
|||
<editor v-model="formData.content" /> |
|||
</el-form-item> |
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-radio-group v-model="formData.status" :placeholder="t('statusPlaceholder')"> |
|||
<el-radio |
|||
v-for="(item, index) in statusList" |
|||
:key="index" :label="item.value"> |
|||
{{ item.name }} |
|||
</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<!-- <el-form-item :label="t('userPermission')" prop="user_permission">--> |
|||
<!-- <el-checkbox-group v-model="formData.user_permission" :placeholder="t('userPermissionPlaceholder')">--> |
|||
<!-- <el-checkbox--> |
|||
<!-- v-for="(item, index) in userPermissionList"--> |
|||
<!-- :key="index"--> |
|||
<!-- :label="item['sys_user_id']">--> |
|||
<!-- {{ item['name'] }}--> |
|||
<!-- </el-checkbox>--> |
|||
<!-- </el-checkbox-group>--> |
|||
<!-- </el-form-item>--> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addStrengTeachingLibrary, editStrengTeachingLibrary, getLessonCourseTeachingInfo, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { addPublicLibraryList, editPublicLibraryList } from '@/app/api/future_ontent' |
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
title: '', |
|||
image: '', |
|||
type: '', |
|||
content: '', |
|||
status: '', |
|||
table_type: 20 |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
title: [ |
|||
{ required: true, message: t('titlePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
image: [ |
|||
{ required: true, message: t('imagePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
type: [ |
|||
{ required: true, message: t('typePlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
content: [ |
|||
{ required: true, message: t('contentPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
status: [ |
|||
{ required: true, message: t('statusPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editPublicLibraryList : addPublicLibraryList |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
data.table_type = 20 |
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
let typeList = ref([]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
watch(() => typeList.value, () => { formData.type = typeList.value[0].value }) |
|||
let statusList = ref([]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
watch(() => statusList.value, () => { formData.status = statusList.value[0].value }) |
|||
|
|||
|
|||
const userPermissionList = ref([] as any[]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getLessonCourseTeachingInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,567 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-tabs v-model="active"> |
|||
<el-tab-pane label="训练内容" name="CourseSyllabus"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEvent"> |
|||
{{ t('addLessonCourseTeaching') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="lessonCourseTeachingTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="lessonCourseTeachingTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="lessonCourseTeachingTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="lessonCourseTeachingTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadLessonCourseTeachingList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 13)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="lessonCourseTeachingTable.data" size="large" v-loading="lessonCourseTeachingTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !lessonCourseTeachingTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 13)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="lessonCourseTeachingTable.page" v-model:page-size="lessonCourseTeachingTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="lessonCourseTeachingTable.total" |
|||
@size-change="loadLessonCourseTeachingList()" @current-change="loadLessonCourseTeachingList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editLessonCourseTeachingDialog" @complete="loadLessonCourseTeachingList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="训练视频" name="JumpLessonLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addJumpLessonLibrary"> |
|||
{{ t('addJumpLessonLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="JumpLessonLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="JumpLessonLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="JumpLessonLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="JumpLessonLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadJumpLessonLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 14)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="JumpLessonLibraryTable.data" size="large" v-loading="JumpLessonLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !JumpLessonLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editJumpLessonLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 14)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="JumpLessonLibraryTable.page" v-model:page-size="JumpLessonLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="JumpLessonLibraryTable.total" |
|||
@size-change="loadJumpLessonLibraryList()" @current-change="loadJumpLessonLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-jump ref="editJumpLessonLibraryDialog" @complete="loadJumpLessonLibraryList" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="课后作业" name="EnTeachingLibrary"> |
|||
<div class="flex justify-between items-center"> |
|||
<el-button type="primary" @click="addEnTeachingLibrary"> |
|||
{{ t('addEnTeachingLibrary') }} |
|||
</el-button> |
|||
</div> |
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="EnTeachingLibraryTable.searchParam" ref="searchFormRef"> |
|||
<el-form-item :label="t('title')" prop="title"> |
|||
<el-input v-model="EnTeachingLibraryTable.searchParam.title" :placeholder="t('titlePlaceholder')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('status')" prop="status"> |
|||
<el-select class="w-[280px]" v-model="EnTeachingLibraryTable.searchParam.status" clearable :placeholder="t('statusPlaceholder')"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in statusList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('createTime')" prop="create_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('updateTime')" prop="update_time"> |
|||
<el-date-picker v-model="EnTeachingLibraryTable.searchParam.update_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|||
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadEnTeachingLibraryList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef, 15)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="EnTeachingLibraryTable.data" size="large" v-loading="EnTeachingLibraryTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !EnTeachingLibraryTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="title" :label="t('title')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column :label="t('image')" width="100" align="left"> |
|||
<template #default="{ row }"> |
|||
<el-avatar v-if="row.image" :src="img(row.image)" /> |
|||
<el-avatar v-else icon="UserFilled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('type')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in typeList"> |
|||
<div v-if="item.value == row.type">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('status')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|||
<template #default="{ row }"> |
|||
<div v-for="(item, index) in statusList"> |
|||
<div v-if="item.value == row.status">{{ item.name }}</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEnTeachingLibrary(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id, 15)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="EnTeachingLibraryTable.page" v-model:page-size="EnTeachingLibraryTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="EnTeachingLibraryTable.total" |
|||
@size-change="loadEnTeachingLibraryList()" @current-change="loadEnTeachingLibraryList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit-en ref="editEnTeachingLibraryDialog" @complete="loadEnTeachingLibraryList" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
addPublicLibraryList editPublicLibraryList |
|||
|
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getLessonCourseTeachingList, deleteLessonCourseTeaching, getWithPersonnelDataList } from '@/app/api/lesson_course_teaching' |
|||
import { getPublicLibraryList } from '@/app/api/future_ontent' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/future_ontent/components/lesson-course-teaching-edit.vue' |
|||
import EditJump from '@/app/views/future_ontent/components/Jump-lesson-library-edit.vue' |
|||
import EditEn from '@/app/views/future_ontent/components/en-course-teaching-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
const active = 'CourseSyllabus' |
|||
|
|||
let lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
"table_type":13 |
|||
} |
|||
}) |
|||
let JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
"table_type":14 |
|||
} |
|||
}) |
|||
let EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"title":"", |
|||
"status":"", |
|||
"create_time":[], |
|||
"update_time":[], |
|||
"table_type":15 |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
const typeList = ref([] as any[]) |
|||
const typeDictList = async () => { |
|||
typeList.value = await (await useDictionary('material_type')).data.dictionary |
|||
} |
|||
typeDictList(); |
|||
const statusList = ref([] as any[]) |
|||
const statusDictList = async () => { |
|||
statusList.value = await (await useDictionary('course_status')).data.dictionary |
|||
} |
|||
statusDictList(); |
|||
|
|||
const editLessonCourseTeachingDialog: Record<string, any> | null = ref(null) |
|||
const editJumpLessonLibraryDialog: Record<string, any> | null = ref(null) |
|||
const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
*/ |
|||
const loadLessonCourseTeachingList = (page: number = 1) => { |
|||
lessonCourseTeachingTable.loading = true |
|||
lessonCourseTeachingTable.page = page |
|||
|
|||
getPublicLibraryList({ |
|||
page: lessonCourseTeachingTable.page, |
|||
limit: lessonCourseTeachingTable.limit, |
|||
...lessonCourseTeachingTable.searchParam |
|||
}).then(res => { |
|||
lessonCourseTeachingTable.loading = false |
|||
lessonCourseTeachingTable.data = res.data.data |
|||
lessonCourseTeachingTable.total = res.data.total |
|||
}).catch(() => { |
|||
lessonCourseTeachingTable.loading = false |
|||
}) |
|||
} |
|||
loadLessonCourseTeachingList() |
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
*/ |
|||
const addEvent = () => { |
|||
editLessonCourseTeachingDialog.value.setFormData() |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑课程教学大纲 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
editLessonCourseTeachingDialog.value.setFormData(data) |
|||
editLessonCourseTeachingDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
*/ |
|||
const loadJumpLessonLibraryList = (page: number = 1) => { |
|||
JumpLessonLibraryTable.loading = true |
|||
JumpLessonLibraryTable.page = page |
|||
|
|||
getPublicLibraryList({ |
|||
page: JumpLessonLibraryTable.page, |
|||
limit: JumpLessonLibraryTable.limit, |
|||
...JumpLessonLibraryTable.searchParam |
|||
}).then(res => { |
|||
JumpLessonLibraryTable.loading = false |
|||
JumpLessonLibraryTable.data = res.data.data |
|||
JumpLessonLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
JumpLessonLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadJumpLessonLibraryList() |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
*/ |
|||
const addJumpLessonLibrary = () => { |
|||
editJumpLessonLibraryDialog.value.setFormData() |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑跳绳教案库 |
|||
* @param data |
|||
*/ |
|||
const editJumpLessonLibrary = (data: any) => { |
|||
editJumpLessonLibraryDialog.value.setFormData(data) |
|||
editJumpLessonLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
*/ |
|||
const loadEnTeachingLibraryList = (page: number = 1) => { |
|||
EnTeachingLibraryTable.loading = true |
|||
EnTeachingLibraryTable.page = page |
|||
|
|||
getPublicLibraryList({ |
|||
page: EnTeachingLibraryTable.page, |
|||
limit: EnTeachingLibraryTable.limit, |
|||
...EnTeachingLibraryTable.searchParam |
|||
}).then(res => { |
|||
EnTeachingLibraryTable.loading = false |
|||
EnTeachingLibraryTable.data = res.data.data |
|||
EnTeachingLibraryTable.total = res.data.total |
|||
}).catch(() => { |
|||
EnTeachingLibraryTable.loading = false |
|||
}) |
|||
} |
|||
loadEnTeachingLibraryList() |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
*/ |
|||
const addEnTeachingLibrary = () => { |
|||
editEnTeachingLibraryDialog.value.setFormData() |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑增高教案库 |
|||
* @param data |
|||
*/ |
|||
const editEnTeachingLibrary = (data: any) => { |
|||
editEnTeachingLibraryDialog.value.setFormData(data) |
|||
editEnTeachingLibraryDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
*/ |
|||
const deleteEvent = (id: number, type: number) => { |
|||
ElMessageBox.confirm(t('lessonCourseTeachingDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteLessonCourseTeaching(id).then(() => { |
|||
if (type === 13) { |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 14) { |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 15) { |
|||
loadEnTeachingLibraryList() |
|||
} |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const userPermissionList = ref([]) |
|||
const setUserPermissionList = async () => { |
|||
userPermissionList.value = await (await getWithPersonnelDataList({})).data |
|||
} |
|||
setUserPermissionList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined, type: number) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
if (type === 13) { |
|||
lessonCourseTeachingTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
"table_type":13 |
|||
} |
|||
}) |
|||
loadLessonCourseTeachingList() |
|||
} else if (type === 14) { |
|||
JumpLessonLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
"table_type":14 |
|||
} |
|||
}) |
|||
loadJumpLessonLibraryList() |
|||
} else if (type === 15) { |
|||
EnTeachingLibraryTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam: { |
|||
"title": "", |
|||
"status": "", |
|||
"create_time": [], |
|||
"update_time": [], |
|||
"table_type":15 |
|||
} |
|||
}) |
|||
loadEnTeachingLibraryList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
File diff suppressed because it is too large
@ -0,0 +1,718 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\adminapi\controller\lesson_course_teaching; |
|||
|
|||
use core\base\BaseAdminController; |
|||
use app\service\admin\lesson_course_teaching\LessonCourseTeachingService; |
|||
|
|||
|
|||
/** |
|||
* 教研管理控制器 |
|||
* Class LessonCourseTeaching |
|||
* @package app\adminapi\controller\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeaching extends BaseAdminController |
|||
{ |
|||
/** |
|||
* 获取教研管理列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function lists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",1] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->getPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加教研管理 |
|||
* @return \think\Response |
|||
*/ |
|||
public function add(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",1] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->add($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 教研管理编辑 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function edit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->edit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function jumpLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",2] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->jumpPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function jumpAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",2] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->jumpAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳教案库编辑 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function jumpEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->jumpEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function enLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",3] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->enPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function enAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",3] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->enAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳增高教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function enEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->enEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取篮球教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function basketballLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",4] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->basketballPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加篮球教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function basketballAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",4] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->basketballAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳篮球教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function basketballEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->basketballEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取强化教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function strengLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",5] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->strengPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加强化教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function strengAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",5] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->strengAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳强化教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function strengEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->strengEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取空中忍者教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function ninjaLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",6] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->ninjaPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加空中忍者教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function ninjaAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",6] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->ninjaAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳空中忍者教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function ninjaEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->ninjaEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取空中忍者教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function securityLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",7] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->securityPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加空中忍者教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function securityAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",7] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->securityAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳空中忍者教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function securityEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->securityEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function physicalLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",8] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->physicalPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加体能教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function physicalAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",8] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->physicalAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳体能教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function physicalEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->physicalEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function actionLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",9] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->actionPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function actionAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",9] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->actionAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function actionEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->actionEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function fitnessLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",10] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->fitnessPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function fitnessAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",10] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->fitnessAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function fitnessEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->fitnessEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function gamesLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",11] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->gamesPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function gamesAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",11] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->gamesAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function gamesEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->gamesEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function relaxationLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",12] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->relaxationPetPage($data)); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function relaxationAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",12] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->relaxationAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function relaxationEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->relaxationEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
|
|||
public function publicLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",0], |
|||
]); |
|||
return success((new LessonCourseTeachingService())->publicPetPage($data)); |
|||
} |
|||
public function publicAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",0] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->publicAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
public function publicEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->publicEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 教研管理详情 |
|||
* @param int $id |
|||
* @return \think\Response |
|||
*/ |
|||
public function info(int $id){ |
|||
return success((new LessonCourseTeachingService())->getInfo($id)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 教研管理删除 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function del(int $id){ |
|||
(new LessonCourseTeachingService())->del($id); |
|||
return success('DELETE_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
public function getPersonnelDataAll(){ |
|||
return success(( new LessonCourseTeachingService())->getPersonnelDataAll()); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,122 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
use think\facade\Route; |
|||
|
|||
use app\adminapi\middleware\AdminCheckRole; |
|||
use app\adminapi\middleware\AdminCheckToken; |
|||
use app\adminapi\middleware\AdminLog; |
|||
// USER_CODE_BEGIN -- lesson_course_teaching |
|||
|
|||
Route::group('lesson_course_teaching', function () { |
|||
|
|||
//课程教学大纲列表 |
|||
Route::get('lesson_course_teaching', 'lesson_course_teaching.LessonCourseTeaching/lists'); |
|||
//添加课程教学大纲 |
|||
Route::post('lesson_course_teaching', 'lesson_course_teaching.LessonCourseTeaching/add'); |
|||
//编辑课程教学大纲 |
|||
Route::put('lesson_course_teaching/:id', 'lesson_course_teaching.LessonCourseTeaching/edit'); |
|||
|
|||
//跳绳教案库列表 |
|||
Route::get('jump_lesson_library', 'lesson_course_teaching.LessonCourseTeaching/jumpLists'); |
|||
//添加跳绳教案库 |
|||
Route::post('jump_lesson_library', 'lesson_course_teaching.LessonCourseTeaching/jumpAdd'); |
|||
//编辑跳绳教案库 |
|||
Route::put('jump_lesson_library/:id', 'lesson_course_teaching.LessonCourseTeaching/jumpEdit'); |
|||
|
|||
//高数教案库列表 |
|||
Route::get('en_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/enLists'); |
|||
//添加高数教案库 |
|||
Route::post('en_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/enAdd'); |
|||
//编辑高数教案库 |
|||
Route::put('en_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/enEdit'); |
|||
|
|||
//篮球教案库列表 |
|||
Route::get('basketball_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/basketballLists'); |
|||
//添加篮球教案库 |
|||
Route::post('basketball_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/basketballAdd'); |
|||
//编辑篮球教案库 |
|||
Route::put('basketball_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/basketballEdit'); |
|||
|
|||
//强化教案库列表 |
|||
Route::get('streng_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/strengLists'); |
|||
//添加强化教案库 |
|||
Route::post('streng_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/strengAdd'); |
|||
//编辑强化教案库 |
|||
Route::put('streng_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/strengEdit'); |
|||
|
|||
//空中忍者教案库列表 |
|||
Route::get('ninja_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/ninjaLists'); |
|||
//添加空中忍者教案库 |
|||
Route::post('ninja_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/ninjaAdd'); |
|||
//编辑空中忍者教案库 |
|||
Route::put('ninja_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/ninjaEdit'); |
|||
|
|||
//少儿安防教案库列表 |
|||
Route::get('security_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/securityLists'); |
|||
//添加少儿安防教案库 |
|||
Route::post('security_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/securityAdd'); |
|||
//编辑少儿安防教案库 |
|||
Route::put('security_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/securityEdit'); |
|||
|
|||
//体能教案库列表 |
|||
Route::get('physical_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/physicalLists'); |
|||
//添加体能教案库 |
|||
Route::post('physical_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/physicalAdd'); |
|||
//编辑体能教案库 |
|||
Route::put('physical_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/physicalEdit'); |
|||
|
|||
//热身动作列表 |
|||
Route::get('action_library', 'lesson_course_teaching.LessonCourseTeaching/actionLists'); |
|||
//添加热身动作库 |
|||
Route::post('action_library', 'lesson_course_teaching.LessonCourseTeaching/actionAdd'); |
|||
//编辑热身动作库 |
|||
Route::put('action_library/:id', 'lesson_course_teaching.LessonCourseTeaching/actionEdit'); |
|||
|
|||
//体能动作列表 |
|||
Route::get('fitness_library', 'lesson_course_teaching.LessonCourseTeaching/fitnessLists'); |
|||
//添加体能动作 |
|||
Route::post('fitness_library', 'lesson_course_teaching.LessonCourseTeaching/fitnessAdd'); |
|||
//编辑体能动作 |
|||
Route::put('fitness_library/:id', 'lesson_course_teaching.LessonCourseTeaching/fitnessEdit'); |
|||
|
|||
//趣味游戏列表 |
|||
Route::get('games_library', 'lesson_course_teaching.LessonCourseTeaching/gamesLists'); |
|||
//趣味游戏动作 |
|||
Route::post('games_library', 'lesson_course_teaching.LessonCourseTeaching/gamesAdd'); |
|||
//趣味游戏动作 |
|||
Route::put('games_library/:id', 'lesson_course_teaching.LessonCourseTeaching/gamesEdit'); |
|||
|
|||
//放松游戏列表 |
|||
Route::get('relaxation_library', 'lesson_course_teaching.LessonCourseTeaching/relaxationLists'); |
|||
//放松游戏 |
|||
Route::post('relaxation_library', 'lesson_course_teaching.LessonCourseTeaching/relaxationAdd'); |
|||
//放松游戏 |
|||
Route::put('relaxation_library/:id', 'lesson_course_teaching.LessonCourseTeaching/relaxationEdit'); |
|||
|
|||
|
|||
Route::get('public_library', 'lesson_course_teaching.LessonCourseTeaching/publicLists'); |
|||
Route::post('public_library', 'lesson_course_teaching.LessonCourseTeaching/publicAdd'); |
|||
Route::put('public_library/:id', 'lesson_course_teaching.LessonCourseTeaching/publicEdit'); |
|||
|
|||
//教研管理详情 |
|||
Route::get('lesson_course_teaching/:id', 'lesson_course_teaching.LessonCourseTeaching/info'); |
|||
//删除教研管理 |
|||
Route::delete('lesson_course_teaching/:id', 'lesson_course_teaching.LessonCourseTeaching/del'); |
|||
|
|||
Route::get('personnel_data_all','lesson_course_teaching.LessonCourseTeaching/getPersonnelDataAll'); |
|||
|
|||
})->middleware([ |
|||
AdminCheckToken::class, |
|||
AdminCheckRole::class, |
|||
AdminLog::class |
|||
]); |
|||
// USER_CODE_END -- lesson_course_teaching |
|||
@ -0,0 +1,124 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\model\lesson_course_teaching; |
|||
|
|||
use core\base\BaseModel; |
|||
use think\model\concern\SoftDelete; |
|||
use think\model\relation\HasMany; |
|||
use think\model\relation\HasOne; |
|||
|
|||
use app\model\personnel_data\PersonnelData; |
|||
|
|||
/** |
|||
* 教研管理模型 |
|||
* Class LessonCourseTeaching |
|||
* @package app\model\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeaching extends BaseModel |
|||
{ |
|||
|
|||
use SoftDelete; |
|||
|
|||
/** |
|||
* 数据表主键 |
|||
* @var string |
|||
*/ |
|||
protected $pk = 'id'; |
|||
|
|||
/** |
|||
* 模型名称 |
|||
* @var string |
|||
*/ |
|||
protected $name = 'lesson_course_teaching'; |
|||
|
|||
/** |
|||
* 定义软删除标记字段. |
|||
* @var string |
|||
*/ |
|||
protected $deleteTime = 'delete_time'; |
|||
|
|||
/** |
|||
* 定义软删除字段的默认值. |
|||
* @var int |
|||
*/ |
|||
protected $defaultSoftDelete = 0; |
|||
|
|||
/** |
|||
* 搜索器:教研管理课程标题 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchTitleAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("title", "like", "%".$value."%"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:教研管理状态 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchStatusAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("status", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:教研管理创建时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchCreateTimeAttr($query, $value, $data) |
|||
{ |
|||
$start = empty($value[0]) ? 0 : strtotime($value[0]); |
|||
$end = empty($value[1]) ? 0 : strtotime($value[1]); |
|||
if ($start > 0 && $end > 0) { |
|||
$query->where([["create_time", "between", [$start, $end]]]); |
|||
} else if ($start > 0 && $end == 0) { |
|||
$query->where([["create_time", ">=", $start]]); |
|||
} else if ($start == 0 && $end > 0) { |
|||
$query->where([["create_time", "<=", $end]]); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:教研管理修改时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchUpdateTimeAttr($query, $value, $data) |
|||
{ |
|||
$start = empty($value[0]) ? 0 : strtotime($value[0]); |
|||
$end = empty($value[1]) ? 0 : strtotime($value[1]); |
|||
if ($start > 0 && $end > 0) { |
|||
$query->where([["update_time", "between", [$start, $end]]]); |
|||
} else if ($start > 0 && $end == 0) { |
|||
$query->where([["update_time", ">=", $start]]); |
|||
} else if ($start == 0 && $end > 0) { |
|||
$query->where([["update_time", "<=", $end]]); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public function personnelData(){ |
|||
return $this->hasOne(PersonnelData::class, 'sys_user_id', 'user_permission')->joinType('left')->withField('name,sys_user_id')->bind(['user_permission_name'=>'name']); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\model\personnel_data; |
|||
|
|||
use core\base\BaseModel; |
|||
use think\model\concern\SoftDelete; |
|||
use think\model\relation\HasMany; |
|||
use think\model\relation\HasOne; |
|||
|
|||
/** |
|||
* 课程教学大纲模型 |
|||
* Class LessonCourseTeaching |
|||
* @package app\model\lesson_course_teaching |
|||
*/ |
|||
class PersonnelData extends BaseModel |
|||
{ |
|||
|
|||
use SoftDelete; |
|||
|
|||
/** |
|||
* 数据表主键 |
|||
* @var string |
|||
*/ |
|||
protected $pk = 'id'; |
|||
|
|||
/** |
|||
* 模型名称 |
|||
* @var string |
|||
*/ |
|||
protected $name = 'personnel'; |
|||
|
|||
/** |
|||
* 定义软删除标记字段. |
|||
* @var string |
|||
*/ |
|||
protected $deleteTime = 'delete_time'; |
|||
|
|||
/** |
|||
* 定义软删除字段的默认值. |
|||
* @var int |
|||
*/ |
|||
protected $defaultSoftDelete = 0; |
|||
|
|||
|
|||
} |
|||
|
|||
@ -0,0 +1,634 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\service\admin\lesson_course_teaching; |
|||
|
|||
use app\model\lesson_course_teaching\LessonCourseTeaching; |
|||
use app\model\personnel_data\PersonnelData; |
|||
|
|||
use core\base\BaseAdminService; |
|||
|
|||
|
|||
/** |
|||
* 教研管理服务层 |
|||
* Class LessonCourseTeachingService |
|||
* @package app\service\admin\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeachingService extends BaseAdminService |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
$this->model = new LessonCourseTeaching(); |
|||
} |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function getPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
|
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function add(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 课程教学大纲编辑 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function edit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function jumpPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function jumpAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳教案库编辑 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function jumpEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function enPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function enAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳增高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function enEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function basketballPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function basketballAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function basketballEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function strengPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function strengAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function strengEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function ninjaPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function ninjaAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function ninjaEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function securityPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function securityAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function securityEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function physicalPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加体能教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function physicalAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳体能教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function physicalEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 获取热身动做列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function actionPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加热身动做 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function actionAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 热身动做 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function actionEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function gamesPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function gamesAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 趣味游戏 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function gamesEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function fitnessPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function fitnessAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 趣味游戏 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function fitnessEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function relaxationPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function relaxationAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 趣味游戏 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function relaxationEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
public function publicPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
public function publicAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
public function publicEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取教研管理信息 |
|||
* @param int $id |
|||
* @return array |
|||
*/ |
|||
public function getInfo(int $id) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
|
|||
$info = $this->model->field($field)->where([['id', "=", $id]])->with(['personnelData'])->findOrEmpty()->toArray(); |
|||
$info['status'] = strval($info['status']); |
|||
return $info; |
|||
} |
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
* @param int $id |
|||
* @return bool |
|||
*/ |
|||
public function del(int $id) |
|||
{ |
|||
$model = $this->model->where([['id', '=', $id]])->find(); |
|||
$res = $model->delete(); |
|||
return $res; |
|||
} |
|||
|
|||
|
|||
public function getPersonnelDataAll(){ |
|||
$personnelDataModel = new PersonnelData(); |
|||
return $personnelDataModel->where('is_sys_user',1)->select()->toArray(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\validate\lesson_course_teaching; |
|||
use core\base\BaseValidate; |
|||
/** |
|||
* 教研管理验证器 |
|||
* Class LessonCourseTeaching |
|||
* @package addon\app\validate\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeaching extends BaseValidate |
|||
{ |
|||
|
|||
protected $rule = [ |
|||
|
|||
]; |
|||
|
|||
protected $message = [ |
|||
|
|||
]; |
|||
|
|||
protected $scene = [ |
|||
"add" => ['title', 'image', 'type', 'content', 'status', 'user_permission'], |
|||
"edit" => ['title', 'image', 'type', 'content', 'status', 'user_permission'] |
|||
]; |
|||
|
|||
} |
|||
Loading…
Reference in new issue