Browse Source

接口

master
李双庆 10 months ago
parent
commit
a2c1579e3e
  1. 11
      admin/src/app/api/lesson_course_teaching.ts
  2. 6
      admin/src/app/lang/zh-cn/children_like.children_like.json
  3. 6
      admin/src/app/lang/zh-cn/future_ontent.future_ontent.json
  4. 6
      admin/src/app/lang/zh-cn/instructional_material.instructional_material.json
  5. 6
      admin/src/app/lang/zh-cn/lesson_course_teaching.lesson_course_teaching.json
  6. 6
      admin/src/app/lang/zh-cn/physical_testing.physical_testing.json
  7. 6
      admin/src/app/lang/zh-cn/professional_skills.professional_skills.json
  8. 26
      admin/src/app/views/binding_personnel/binding_personnel.vue
  9. 333
      admin/src/app/views/binding_test_paper/binding_test_paper.vue
  10. 33
      admin/src/app/views/children_like/children_like.vue
  11. 273
      admin/src/app/views/children_like/components/basketball-course-teaching-edit.vue
  12. 271
      admin/src/app/views/children_like/components/ninja-teaching-edit.vue
  13. 271
      admin/src/app/views/children_like/components/physical-teaching-edit.vue
  14. 273
      admin/src/app/views/children_like/components/security-teaching-edit.vue
  15. 273
      admin/src/app/views/children_like/components/strengthen-course-teaching-edit.vue
  16. 1032
      admin/src/app/views/children_like/physical_testing.vue
  17. 271
      admin/src/app/views/future_ontent/components/basketball-course-teaching-edit.vue
  18. 267
      admin/src/app/views/future_ontent/components/ninja-teaching-edit.vue
  19. 271
      admin/src/app/views/future_ontent/components/physical-teaching-edit.vue
  20. 271
      admin/src/app/views/future_ontent/components/security-teaching-edit.vue
  21. 269
      admin/src/app/views/future_ontent/components/strengthen-course-teaching-edit.vue
  22. 32
      admin/src/app/views/future_ontent/future_ontent.vue
  23. 1952
      admin/src/app/views/future_ontent/lesson_course_teaching.vue
  24. 267
      admin/src/app/views/instructional_material/components/ninja-teaching-edit.vue
  25. 271
      admin/src/app/views/instructional_material/components/physical-teaching-edit.vue
  26. 271
      admin/src/app/views/instructional_material/components/security-teaching-edit.vue
  27. 269
      admin/src/app/views/instructional_material/components/strengthen-course-teaching-edit.vue
  28. 39
      admin/src/app/views/instructional_material/instructional_material.vue
  29. 1952
      admin/src/app/views/instructional_material/lesson_course_teaching.vue
  30. 73
      admin/src/app/views/lesson_course_teaching/lesson_course_teaching.vue
  31. 32
      admin/src/app/views/order_table/order_table.vue
  32. 271
      admin/src/app/views/physical_testing/components/ninja-teaching-edit.vue
  33. 271
      admin/src/app/views/physical_testing/components/physical-teaching-edit.vue
  34. 273
      admin/src/app/views/physical_testing/components/security-teaching-edit.vue
  35. 273
      admin/src/app/views/physical_testing/components/strengthen-course-teaching-edit.vue
  36. 40
      admin/src/app/views/physical_testing/physical_testing.vue
  37. 1736
      admin/src/app/views/physical_testing/professional_skills.vue
  38. 271
      admin/src/app/views/professional_skills/components/physical-teaching-edit.vue
  39. 789
      admin/src/app/views/professional_skills/future_ontent.vue
  40. 62
      admin/src/app/views/professional_skills/professional_skills.vue
  41. 6642
      admin/yarn.lock
  42. 19
      niucloud/app/adminapi/controller/lesson_course_teaching/LessonCourseTeaching.php
  43. 3
      niucloud/app/adminapi/route/lesson_course_teaching.php
  44. 22
      niucloud/app/service/admin/lesson_course_teaching/LessonCourseTeachingService.php

11
admin/src/app/api/lesson_course_teaching.ts

@ -328,4 +328,15 @@ export function getWithPersonnelDataList(params: Record<string, any>) {
return request.get('lesson_course_teaching/personnel_data_all', { params })
}
export function getWithTestPaperList(params: Record<string, any>) {
return request.get('lesson_course_teaching/test_paper', { params })
}
export function setBindingTestPaperModule(params: Record<string, any>) {
return request.put(
`lesson_course_teaching/binding_test_module/${params.id}`,
params
)
}
// USER_CODE_END -- lesson_course_teaching

6
admin/src/app/lang/zh-cn/children_like.children_like.json

@ -33,5 +33,9 @@
"bindingModule": "绑定模块",
"url1": "图片上传",
"url2": "文件上传",
"url3": "视频上传"
"url3": "视频上传",
"addBindingTestPaper": "绑定试卷",
"totalScore": "总分",
"selectionMode": "题目选择模式",
"passingScore": "合格分数"
}

6
admin/src/app/lang/zh-cn/future_ontent.future_ontent.json

@ -33,5 +33,9 @@
"bindingModule": "绑定模块",
"url1": "图片上传",
"url2": "文件上传",
"url3": "视频上传"
"url3": "视频上传",
"addBindingTestPaper": "绑定试卷",
"totalScore": "总分",
"selectionMode": "题目选择模式",
"passingScore": "合格分数"
}

6
admin/src/app/lang/zh-cn/instructional_material.instructional_material.json

@ -35,5 +35,9 @@
"bindingModule": "绑定模块",
"url1": "图片上传",
"url2": "文件上传",
"url3": "视频上传"
"url3": "视频上传",
"addBindingTestPaper": "绑定试卷",
"totalScore": "总分",
"selectionMode": "题目选择模式",
"passingScore": "合格分数"
}

6
admin/src/app/lang/zh-cn/lesson_course_teaching.lesson_course_teaching.json

@ -43,5 +43,9 @@
"bindingModule": "绑定模块",
"url1": "图片上传",
"url2": "文件上传",
"url3": "视频上传"
"url3": "视频上传",
"addBindingTestPaper": "绑定试卷",
"totalScore": "总分",
"selectionMode": "题目选择模式",
"passingScore": "合格分数"
}

6
admin/src/app/lang/zh-cn/physical_testing.physical_testing.json

@ -35,5 +35,9 @@
"bindingModule": "绑定模块",
"url1": "图片上传",
"url2": "文件上传",
"url3": "视频上传"
"url3": "视频上传",
"addBindingTestPaper": "绑定试卷",
"totalScore": "总分",
"selectionMode": "题目选择模式",
"passingScore": "合格分数"
}

6
admin/src/app/lang/zh-cn/professional_skills.professional_skills.json

@ -41,5 +41,9 @@
"bindingModule": "绑定模块",
"url1": "图片上传",
"url2": "文件上传",
"url3": "视频上传"
"url3": "视频上传",
"addBindingTestPaper": "绑定试卷",
"totalScore": "总分",
"selectionMode": "题目选择模式",
"passingScore": "合格分数"
}

26
admin/src/app/views/binding_personnel/binding_personnel.vue

@ -83,16 +83,16 @@
:show-overflow-tooltip="true"
/>
<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, 1)">{{
t('delete')
}}</el-button>
</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, 1)">{{-->
<!-- t('delete')-->
<!-- }}</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<div class="mt-[16px] flex justify-end">
<el-pagination
@ -167,7 +167,7 @@ import {
getWithPersonnelDataList,
setBindingModule,
} from '@/app/api/lesson_course_teaching'
import { ElMessage, ElMessageBox } from 'element-plus';
let showDialog = ref(false)
const loading = ref(false)
@ -257,6 +257,10 @@ const emit = defineEmits(['complete'])
* @param formEl
*/
const confirm = async (formEl: FormInstance | undefined) => {
if(multipleSelection.value.length == 0) {
ElMessage.error('请选择数据');
return;
}
let data = {
id: BindingId.value,
user_permission: multipleSelection.value

333
admin/src/app/views/binding_test_paper/binding_test_paper.vue

@ -0,0 +1,333 @@
<template>
<el-dialog
v-model="showDialog"
:title="t('addBindingTestPaper')"
width="50%"
class="diy-dialog-wrap"
:destroy-on-close="true"
>
<el-form
:inline="true"
:model="lessonCourseTeachingTable.searchParam"
ref="searchFormRef"
>
<el-form-item :label="t('totalScore')" prop="title">
<el-input
v-model="lessonCourseTeachingTable.searchParam.total_score"
:placeholder="t('totalScore')"
/>
</el-form-item>
<el-form-item :label="t('selectionMode')" prop="status">
<el-select class="input-width" v-model="lessonCourseTeachingTable.searchParam.selection_mode" clearable :placeholder="t('selectionMode')">
<el-option label="请选择" value=""></el-option>
<el-option label="随机组题" value="random" />
<el-option label="自选题目" value="manual" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="loadLessonCourseTeachingList()">{{
t('search')
}}</el-button>
<el-button @click="resetForm(searchFormRef)">{{
t('reset')
}}</el-button>
</el-form-item>
</el-form>
<div class="mt-[10px]">
<el-table
:data="lessonCourseTeachingTable.data"
size="large"
v-loading="lessonCourseTeachingTable.loading"
@selection-change="handleSelectionChange"
>
<template #empty>
<span>{{
!lessonCourseTeachingTable.loading ? t('emptyData') : ''
}}</span>
</template>
<el-table-column type="selection" width="55" />
<el-table-column
prop="total_score"
min-width="80"
:label="t('totalScore')"
:show-overflow-tooltip="true"
/>
<el-table-column
prop="passing_score"
min-width="80"
:label="t('passingScore')"
:show-overflow-tooltip="true"
/>
<el-table-column
:label="t('selectionMode')"
min-width="120"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{ row }">
<div v-if="row.selection_mode == 'random'">随机组题</div>
<div v-if="row.selection_mode == 'manual'">自选题目</div>
</template>
</el-table-column>
<el-table-column
prop="created_at"
:label="t('userCreateTime')"
min-width="150"
:show-overflow-tooltip="true"
/>
<!-- <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, 1)">{{-->
<!-- 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>
<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,
getLessonCourseTeachingList,
getWithPersonnelDataList, getWithTestPaperList,
setBindingTestPaperModule,
} from '@/app/api/lesson_course_teaching'
import { ElMessage } from 'element-plus'
let showDialog = ref(false)
const loading = ref(false)
let lessonCourseTeachingTable = reactive({
page: 1,
limit: 10,
total: 0,
loading: true,
data: [],
searchParam: {
total_score: '',
selection_mode: ''
},
})
const multipleSelection = ref<[]>([])
const binding_module = ref('')
const handleSelectionChange = (val: []) => {
multipleSelection.value = val
}
const loadLessonCourseTeachingList = (page: number = 1) => {
lessonCourseTeachingTable.loading = true
lessonCourseTeachingTable.page = page
getWithTestPaperList({
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 resetForm = (page: number = 1) => {
lessonCourseTeachingTable.searchParam.total_score = ''
lessonCourseTeachingTable.searchParam.selection_mode = ''
loadLessonCourseTeachingList()
}
/**
* 表单数据
*/
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(multipleSelection.value.length == 0) {
ElMessage.error('请选择数据');
return;
} else if (multipleSelection.value.length > 1) {
ElMessage.error('只能选择一条数据');
return;
}
let data = {
id: BindingId.value,
exam_papers_id: multipleSelection.value
.map((item) => item.id)
.join(',')
}
setBindingTestPaperModule(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 BindingId = ref(undefined)
const setUserPermissionList = async () => {
userPermissionList.value = await (await getWithPersonnelDataList({})).data
}
setUserPermissionList()
const setFormData = async (row: any = null) => {
BindingId.value = row.id
binding_module.value = row.table_type
}
//
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>

33
admin/src/app/views/children_like/children_like.vue

@ -127,7 +127,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button type="primary" link @click="editEvent(row)">{{
@ -145,6 +145,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -290,7 +295,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -311,6 +316,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -456,7 +466,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -477,6 +487,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -503,6 +518,10 @@
ref="BindingPersonnelDialog"
@complete="loadLessonCourseTeachingList"
/>
<binding-test-paper
ref="BindingTestPaperDialog"
@complete="loadLessonCourseTeachingList"
/>
</div>
</template>
@ -529,6 +548,7 @@ import EditJump from '@/app/views/children_like/components/Jump-lesson-library-e
import EditEn from '@/app/views/children_like/components/en-course-teaching-edit.vue'
import { useRoute } from 'vue-router'
import bindingPersonnel from '@/app/views/binding_personnel/binding_personnel.vue'
import bindingTestPaper from '@/app/views/binding_test_paper/binding_test_paper.vue'
const route = useRoute()
const pageName = route.meta.title
const active = 'CourseSyllabus'
@ -601,11 +621,16 @@ const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null)
const editBasketballTeachingLibraryDialog: Record<string, any> | null =
ref(null)
const BindingPersonnelDialog: Record<string, any> | null = ref(null)
const BindingTestPaperDialog: Record<string, any> | null = ref(null)
const addBindingPersonnel = (row) => {
BindingPersonnelDialog.value.setFormData(row)
BindingPersonnelDialog.value.showDialog = true
}
const addBindingTestPaper = (row) => {
BindingTestPaperDialog.value.setFormData(row)
BindingTestPaperDialog.value.showDialog = true
}
/**
* 获取课程教学大纲列表
*/

273
admin/src/app/views/children_like/components/basketball-course-teaching-edit.vue

@ -1,273 +0,0 @@
<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>

271
admin/src/app/views/children_like/components/ninja-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

271
admin/src/app/views/children_like/components/physical-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

273
admin/src/app/views/children_like/components/security-teaching-edit.vue

@ -1,273 +0,0 @@
<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>

273
admin/src/app/views/children_like/components/strengthen-course-teaching-edit.vue

@ -1,273 +0,0 @@
<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>

1032
admin/src/app/views/children_like/physical_testing.vue

File diff suppressed because it is too large

271
admin/src/app/views/future_ontent/components/basketball-course-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

267
admin/src/app/views/future_ontent/components/ninja-teaching-edit.vue

@ -1,267 +0,0 @@
<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>

271
admin/src/app/views/future_ontent/components/physical-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

271
admin/src/app/views/future_ontent/components/security-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

269
admin/src/app/views/future_ontent/components/strengthen-course-teaching-edit.vue

@ -1,269 +0,0 @@
<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>

32
admin/src/app/views/future_ontent/future_ontent.vue

@ -127,7 +127,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button type="primary" link @click="editEvent(row)">{{
@ -145,6 +145,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -290,7 +295,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -311,6 +316,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -456,7 +466,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -477,6 +487,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -503,6 +518,10 @@
ref="BindingPersonnelDialog"
@complete="loadLessonCourseTeachingList"
/>
<binding-test-paper
ref="BindingTestPaperDialog"
@complete="loadLessonCourseTeachingList"
/>
</div>
</template>
<script lang="ts" setup>
@ -521,6 +540,7 @@ import Edit from '@/app/views/future_ontent/components/lesson-course-teaching-ed
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 bindingPersonnel from '@/app/views/binding_personnel/binding_personnel.vue'
import bindingTestPaper from '@/app/views/binding_test_paper/binding_test_paper.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const pageName = route.meta.title
@ -592,11 +612,17 @@ 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 BindingPersonnelDialog: Record<string, any> | null = ref(null)
const BindingTestPaperDialog: Record<string, any> | null = ref(null)
const addBindingPersonnel = (row) => {
BindingPersonnelDialog.value.setFormData(row)
BindingPersonnelDialog.value.showDialog = true
}
const addBindingTestPaper = (row) => {
BindingTestPaperDialog.value.setFormData(row)
BindingTestPaperDialog.value.showDialog = true
}
/**
* 获取课程教学大纲列表
*/

1952
admin/src/app/views/future_ontent/lesson_course_teaching.vue

File diff suppressed because it is too large

267
admin/src/app/views/instructional_material/components/ninja-teaching-edit.vue

@ -1,267 +0,0 @@
<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>

271
admin/src/app/views/instructional_material/components/physical-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

271
admin/src/app/views/instructional_material/components/security-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

269
admin/src/app/views/instructional_material/components/strengthen-course-teaching-edit.vue

@ -1,269 +0,0 @@
<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>

39
admin/src/app/views/instructional_material/instructional_material.vue

@ -125,7 +125,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -146,6 +146,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -276,7 +281,7 @@
<el-table-column
:label="t('status')"
min-width="180"
min-width="250"
align="center"
:show-overflow-tooltip="true"
>
@ -311,6 +316,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -456,7 +466,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -477,6 +487,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -626,7 +641,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -647,6 +662,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -673,6 +693,10 @@
ref="BindingPersonnelDialog"
@complete="loadLessonCourseTeachingList"
/>
<binding-test-paper
ref="BindingTestPaperDialog"
@complete="loadLessonCourseTeachingList"
/>
</div>
</template>
@ -697,6 +721,7 @@ import EditJump from '@/app/views/instructional_material/components/Jump-lesson-
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 bindingPersonnel from '@/app/views/binding_personnel/binding_personnel.vue'
import bindingTestPaper from '@/app/views/binding_test_paper/binding_test_paper.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const pageName = route.meta.title
@ -782,11 +807,17 @@ const editBasketballTeachingLibraryDialog: Record<string, any> | null =
const editStrengthenTeachingLibraryDialog: Record<string, any> | null =
ref(null)
const BindingPersonnelDialog: Record<string, any> | null = ref(null)
const BindingTestPaperDialog: Record<string, any> | null = ref(null)
const addBindingPersonnel = (row) => {
BindingPersonnelDialog.value.setFormData(row)
BindingPersonnelDialog.value.showDialog = true
}
const addBindingTestPaper = (row) => {
BindingTestPaperDialog.value.setFormData(row)
BindingTestPaperDialog.value.showDialog = true
}
/**
* 获取热身动作库列表
*/

1952
admin/src/app/views/instructional_material/lesson_course_teaching.vue

File diff suppressed because it is too large

73
admin/src/app/views/lesson_course_teaching/lesson_course_teaching.vue

@ -127,7 +127,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button type="primary" link @click="editEvent(row)">{{
@ -137,14 +137,17 @@
type="primary"
link
@click="deleteEvent(row.id, 1)"
>{{ t('delete') }}</el-button
>
>{{ t('delete') }}</el-button>
<el-button
type="primary"
link
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
>{{ t('addBindingPersonnel') }}</el-button>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -263,7 +266,7 @@
</el-table-column>
<el-table-column
:label="t('type')"
min-width="180"
min-width="250"
align="center"
:show-overflow-tooltip="true"
>
@ -311,6 +314,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -442,7 +450,7 @@
<el-table-column
:label="t('status')"
min-width="180"
min-width="250"
align="center"
:show-overflow-tooltip="true"
>
@ -477,6 +485,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -599,7 +612,7 @@
</el-table-column>
<el-table-column
:label="t('type')"
min-width="180"
min-width="250"
align="center"
:show-overflow-tooltip="true"
>
@ -647,6 +660,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -792,7 +810,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -813,6 +831,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -944,7 +967,7 @@
<el-table-column
:label="t('status')"
min-width="180"
min-width="250"
align="center"
:show-overflow-tooltip="true"
>
@ -979,6 +1002,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -1124,7 +1152,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -1145,6 +1173,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -1276,7 +1309,7 @@
<el-table-column
:label="t('status')"
min-width="180"
min-width="250"
align="center"
:show-overflow-tooltip="true"
>
@ -1311,6 +1344,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -1337,6 +1375,10 @@
ref="BindingPersonnelDialog"
@complete="loadLessonCourseTeachingList"
/>
<binding-test-paper
ref="BindingTestPaperDialog"
@complete="loadLessonCourseTeachingList"
/>
</div>
</template>
@ -1367,6 +1409,7 @@ import EditNinja from '@/app/views/lesson_course_teaching/components/ninja-teach
import EditSecurity from '@/app/views/lesson_course_teaching/components/security-teaching-edit.vue'
import EditPhysical from '@/app/views/lesson_course_teaching/components/physical-teaching-edit.vue'
import bindingPersonnel from '@/app/views/binding_personnel/binding_personnel.vue'
import bindingTestPaper from '@/app/views/binding_test_paper/binding_test_paper.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const pageName = route.meta.title
@ -1506,12 +1549,18 @@ const editNinjaTeachingLibraryDialog: Record<string, any> | null = ref(null)
const editSecurityTeachingLibraryDialog: Record<string, any> | null = ref(null)
const editPhysicalTeachingLibraryDialog: Record<string, any> | null = ref(null)
const BindingPersonnelDialog: Record<string, any> | null = ref(null)
const BindingTestPaperDialog: Record<string, any> | null = ref(null)
const addBindingPersonnel = (row) => {
BindingPersonnelDialog.value.setFormData(row)
BindingPersonnelDialog.value.showDialog = true
}
const addBindingTestPaper = (row) => {
BindingTestPaperDialog.value.setFormData(row)
BindingTestPaperDialog.value.showDialog = true
}
/**
* 获取课程教学大纲列表
*/

32
admin/src/app/views/order_table/order_table.vue

@ -116,7 +116,7 @@
</template>
<script lang="ts" setup>
import QrcodeVue from '@/app/views/order_table/components/qrcode.vue'
// import QrcodeVue from '@/app/views/order_table/components/qrcode.vue'
import { reactive, ref, watch, onBeforeUnmount } from 'vue'
import { t } from '@/lang'
import { useDictionary } from '@/app/api/dict'
@ -141,7 +141,7 @@
const route = useRoute()
const pageName = route.meta.title
let orderTableTable = reactive({
page: 1,
limit: 10,
@ -155,12 +155,12 @@
},
})
const showDialog = ref(false)
const qrCodeUrl = ref('')
const payId = ref('')
let checkTimer: ReturnType<typeof setInterval> | null = null
const startPayment = async (order_id : number) => {
orderPay({
@ -178,7 +178,7 @@
})
}
const startCheckingStatus = () => {
if (checkTimer) clearInterval(checkTimer)
checkTimer = setInterval(async () => {
@ -193,17 +193,17 @@
}
})
.catch(() => {
})
})
}, 3000)
}
const handleClose = () => {
if (checkTimer) clearInterval(checkTimer)
}
const handlePaymentSuccess = () => {
//
loadOrderTableList();
@ -332,8 +332,8 @@
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.qr-box {
display: flex;
flex-direction: column;
@ -345,7 +345,7 @@
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease-in-out;
}
.qr-img {
width: 200px;
height: 200px;
@ -353,11 +353,11 @@
object-fit: contain;
border: 1px solid #e5e5e5;
}
.pay-id {
margin-top: 14px;
font-size: 13px;
color: #666;
word-break: break-all;
}
</style>
</style>

271
admin/src/app/views/physical_testing/components/ninja-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

271
admin/src/app/views/physical_testing/components/physical-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

273
admin/src/app/views/physical_testing/components/security-teaching-edit.vue

@ -1,273 +0,0 @@
<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>

273
admin/src/app/views/physical_testing/components/strengthen-course-teaching-edit.vue

@ -1,273 +0,0 @@
<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>

40
admin/src/app/views/physical_testing/physical_testing.vue

@ -127,7 +127,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button type="primary" link @click="editEvent(row)">{{
@ -145,6 +145,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -290,7 +295,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -311,6 +316,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -456,7 +466,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -477,6 +487,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -626,7 +641,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -647,6 +662,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -673,6 +693,10 @@
ref="BindingPersonnelDialog"
@complete="loadLessonCourseTeachingList"
/>
<binding-test-paper
ref="BindingTestPaperDialog"
@complete="loadLessonCourseTeachingList"
/>
</div>
</template>
@ -698,6 +722,7 @@ import Edit from '@/app/views/physical_testing/components/lesson-course-teaching
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 bindingTestPaper from '@/app/views/binding_test_paper/binding_test_paper.vue'
import { useRoute } from 'vue-router'
import bindingPersonnel from '@/app/views/binding_personnel/binding_personnel.vue'
const route = useRoute()
@ -786,11 +811,16 @@ const editEnTeachingLibraryDialog: Record<string, any> | null = ref(null)
const editBasketballTeachingLibraryDialog: Record<string, any> | null =
ref(null)
const BindingPersonnelDialog: Record<string, any> | null = ref(null)
const BindingTestPaperDialog: Record<string, any> | null = ref(null)
const addBindingPersonnel = (row) => {
BindingPersonnelDialog.value.setFormData(row)
BindingPersonnelDialog.value.showDialog = true
}
const addBindingTestPaper = (row) => {
BindingTestPaperDialog.value.setFormData(row)
BindingTestPaperDialog.value.showDialog = true
}
/**
* 获取课程教学大纲列表
*/

1736
admin/src/app/views/physical_testing/professional_skills.vue

File diff suppressed because it is too large

271
admin/src/app/views/professional_skills/components/physical-teaching-edit.vue

@ -1,271 +0,0 @@
<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>

789
admin/src/app/views/professional_skills/future_ontent.vue

@ -1,789 +0,0 @@
<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>

62
admin/src/app/views/professional_skills/professional_skills.vue

@ -127,7 +127,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button type="primary" link @click="editEvent(row)">{{
@ -145,6 +145,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -290,7 +295,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -311,6 +316,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -456,7 +466,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -477,6 +487,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -626,7 +641,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -647,6 +662,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -792,7 +812,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -813,6 +833,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -958,7 +983,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -979,6 +1004,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -1124,7 +1154,7 @@
<el-table-column
:label="t('operation')"
fixed="right"
min-width="180"
min-width="250"
>
<template #default="{ row }">
<el-button
@ -1145,6 +1175,11 @@
@click="addBindingPersonnel(row)"
>{{ t('addBindingPersonnel') }}</el-button
>
<el-button
type="primary"
link
@click="addBindingTestPaper(row)"
>{{ t('addBindingTestPaper') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -1171,6 +1206,10 @@
ref="BindingPersonnelDialog"
@complete="loadLessonCourseTeachingList"
/>
<binding-test-paper
ref="BindingTestPaperDialog"
@complete="loadLessonCourseTeachingList"
/>
</div>
</template>
@ -1199,7 +1238,7 @@ import EditBasketball from '@/app/views/professional_skills/components/basketbal
import EditStrengthen from '@/app/views/professional_skills/components/strengthen-course-teaching-edit.vue'
import EditNinja from '@/app/views/professional_skills/components/ninja-teaching-edit.vue'
import EditSecurity from '@/app/views/professional_skills/components/security-teaching-edit.vue'
import EditPhysical from '@/app/views/professional_skills/components/physical-teaching-edit.vue'
import bindingTestPaper from '@/app/views/binding_test_paper/binding_test_paper.vue'
import { useRoute } from 'vue-router'
import bindingPersonnel from '@/app/views/binding_personnel/binding_personnel.vue'
const route = useRoute()
@ -1334,11 +1373,16 @@ const editStrengthenTeachingLibraryDialog: Record<string, any> | null =
const editNinjaTeachingLibraryDialog: Record<string, any> | null = ref(null)
const editSecurityTeachingLibraryDialog: Record<string, any> | null = ref(null)
const BindingPersonnelDialog: Record<string, any> | null = ref(null)
const BindingTestPaperDialog: Record<string, any> | null = ref(null)
const addBindingPersonnel = (row) => {
BindingPersonnelDialog.value.setFormData(row)
BindingPersonnelDialog.value.showDialog = true
}
const addBindingTestPaper = (row) => {
BindingTestPaperDialog.value.setFormData(row)
BindingTestPaperDialog.value.showDialog = true
}
/**
* 获取课程教学大纲列表
*/

6642
admin/yarn.lock

File diff suppressed because it is too large

19
niucloud/app/adminapi/controller/lesson_course_teaching/LessonCourseTeaching.php

@ -759,4 +759,23 @@ class LessonCourseTeaching extends BaseAdminController
return success((new LessonCourseTeachingService())->getPersonnelDataAll($data));
}
public function getTestPaperList(){
$data = $this->request->params([
["total_score",""],
["selection_mode",""]
]);
return success((new LessonCourseTeachingService())->getTestPaperList($data));
}
public function bindingTestModule(int $id){
$data = $this->request->params([
["exam_papers_id",""],
["id",0],
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->bindingTestModule($id, $data);
return success('ADD_SUCCESS', ['id' => $id]);
}
}

3
niucloud/app/adminapi/route/lesson_course_teaching.php

@ -116,6 +116,9 @@ Route::group('lesson_course_teaching', function () {
Route::get('personnel_data_all','lesson_course_teaching.LessonCourseTeaching/getPersonnelDataAll');
Route::get('test_paper','lesson_course_teaching.LessonCourseTeaching/getTestPaperList');
Route::put('binding_test_module/:id', 'lesson_course_teaching.LessonCourseTeaching/bindingTestModule');
})->middleware([
AdminCheckToken::class,
AdminCheckRole::class,

22
niucloud/app/service/admin/lesson_course_teaching/LessonCourseTeachingService.php

@ -13,6 +13,7 @@ namespace app\service\admin\lesson_course_teaching;
use app\model\lesson_course_teaching\LessonCourseTeaching;
use app\model\personnel_data\PersonnelData;
use app\model\exam_papers\ExamPapers;
use core\base\BaseAdminService;
@ -644,9 +645,28 @@ class LessonCourseTeachingService extends BaseAdminService
$search_model = $personnelDataModel->where('is_sys_user', 1)->where($whereArr)->field($field)->order($order);
$list = $this->pageQuery($search_model);
return $list;
}
public function getTestPaperList(array $where = []){
$ExamPapersModel = new ExamPapers();
$field = 'id,selection_mode,total_score,passing_score,created_at';
$order = 'id desc';
$whereArr = [];
if (!empty($where['total_score'])) {
$whereArr[] = ['total_score','=',$where['total_score']];
}
if (!empty($where['selection_mode'])) {
$whereArr[] = ['selection_mode','=',$where['selection_mode']];
}
$search_model = $ExamPapersModel->where($whereArr)->field($field)->order($order);
$list = $this->pageQuery($search_model);
return $list;
}
public function bindingTestModule(int $id, array $data)
{
$this->model->where([['id', '=', $id]])->update($data);
return true;
}
}

Loading…
Cancel
Save