Browse Source

Merge branch 'master' into wangzeyan

master
王泽彦 10 months ago
parent
commit
4b2597e77d
  1. 6
      admin/src/app/api/course.ts
  2. 4
      admin/src/app/api/exam_papers.ts
  3. 11
      admin/src/app/api/lesson_course_teaching.ts
  4. 14
      admin/src/app/api/sys.ts
  5. 6
      admin/src/app/lang/zh-cn/children_like.children_like.json
  6. 6
      admin/src/app/lang/zh-cn/future_ontent.future_ontent.json
  7. 6
      admin/src/app/lang/zh-cn/instructional_material.instructional_material.json
  8. 6
      admin/src/app/lang/zh-cn/lesson_course_teaching.lesson_course_teaching.json
  9. 6
      admin/src/app/lang/zh-cn/physical_testing.physical_testing.json
  10. 6
      admin/src/app/lang/zh-cn/professional_skills.professional_skills.json
  11. 28
      admin/src/app/views/auth/components/edit-role.vue
  12. 7
      admin/src/app/views/auth/role.vue
  13. 26
      admin/src/app/views/binding_personnel/binding_personnel.vue
  14. 333
      admin/src/app/views/binding_test_paper/binding_test_paper.vue
  15. 20
      admin/src/app/views/campus_person_role/campus_person_role.vue
  16. 34
      admin/src/app/views/campus_person_role/components/campus-person-role-edit.vue
  17. 33
      admin/src/app/views/children_like/children_like.vue
  18. 273
      admin/src/app/views/children_like/components/basketball-course-teaching-edit.vue
  19. 271
      admin/src/app/views/children_like/components/ninja-teaching-edit.vue
  20. 271
      admin/src/app/views/children_like/components/physical-teaching-edit.vue
  21. 273
      admin/src/app/views/children_like/components/security-teaching-edit.vue
  22. 273
      admin/src/app/views/children_like/components/strengthen-course-teaching-edit.vue
  23. 1032
      admin/src/app/views/children_like/physical_testing.vue
  24. 28
      admin/src/app/views/communication_records/communication_records.vue
  25. 149
      admin/src/app/views/course/components/change_course.vue
  26. 12
      admin/src/app/views/course/course.vue
  27. 1478
      admin/src/app/views/customer_resources/components/customer-resources-edit.vue
  28. 5
      admin/src/app/views/exam_papers/components/exam-papers-edit.vue
  29. 271
      admin/src/app/views/future_ontent/components/basketball-course-teaching-edit.vue
  30. 267
      admin/src/app/views/future_ontent/components/ninja-teaching-edit.vue
  31. 271
      admin/src/app/views/future_ontent/components/physical-teaching-edit.vue
  32. 271
      admin/src/app/views/future_ontent/components/security-teaching-edit.vue
  33. 269
      admin/src/app/views/future_ontent/components/strengthen-course-teaching-edit.vue
  34. 32
      admin/src/app/views/future_ontent/future_ontent.vue
  35. 1952
      admin/src/app/views/future_ontent/lesson_course_teaching.vue
  36. 267
      admin/src/app/views/instructional_material/components/ninja-teaching-edit.vue
  37. 271
      admin/src/app/views/instructional_material/components/physical-teaching-edit.vue
  38. 271
      admin/src/app/views/instructional_material/components/security-teaching-edit.vue
  39. 269
      admin/src/app/views/instructional_material/components/strengthen-course-teaching-edit.vue
  40. 39
      admin/src/app/views/instructional_material/instructional_material.vue
  41. 1952
      admin/src/app/views/instructional_material/lesson_course_teaching.vue
  42. 228
      admin/src/app/views/jlyj/jlyj.vue
  43. 73
      admin/src/app/views/lesson_course_teaching/lesson_course_teaching.vue
  44. 11
      admin/src/app/views/login/index.vue
  45. 34
      admin/src/app/views/order_table/order_table.vue
  46. 271
      admin/src/app/views/physical_testing/components/ninja-teaching-edit.vue
  47. 271
      admin/src/app/views/physical_testing/components/physical-teaching-edit.vue
  48. 273
      admin/src/app/views/physical_testing/components/security-teaching-edit.vue
  49. 273
      admin/src/app/views/physical_testing/components/strengthen-course-teaching-edit.vue
  50. 40
      admin/src/app/views/physical_testing/physical_testing.vue
  51. 1736
      admin/src/app/views/physical_testing/professional_skills.vue
  52. 271
      admin/src/app/views/professional_skills/components/physical-teaching-edit.vue
  53. 789
      admin/src/app/views/professional_skills/future_ontent.vue
  54. 62
      admin/src/app/views/professional_skills/professional_skills.vue
  55. 12
      admin/src/app/views/service/components/service-edit.vue
  56. 188
      admin/src/app/views/statistics/home.vue
  57. 6642
      admin/yarn.lock
  58. BIN
      niucloud/app.zip
  59. 10
      niucloud/app/adminapi/controller/campus_person_role/CampusPersonRole.php
  60. 4
      niucloud/app/adminapi/controller/communication_records/CommunicationRecords.php
  61. 6
      niucloud/app/adminapi/controller/course/Course.php
  62. 5
      niucloud/app/adminapi/controller/exam_papers/ExamPapers.php
  63. 71
      niucloud/app/adminapi/controller/lesson_course_teaching/LessonCourseTeaching.php
  64. 2
      niucloud/app/adminapi/controller/sys/Role.php
  65. 28
      niucloud/app/adminapi/controller/sys/System.php
  66. 5
      niucloud/app/adminapi/route/course.php
  67. 3
      niucloud/app/adminapi/route/exam_papers.php
  68. 3
      niucloud/app/adminapi/route/lesson_course_teaching.php
  69. 5
      niucloud/app/adminapi/route/sys.php
  70. 161
      niucloud/app/api/controller/apiController/Attendance.php
  71. 7
      niucloud/app/api/route/route.php
  72. 39
      niucloud/app/model/attendance/Attendance.php
  73. 91
      niucloud/app/model/chat_friends/ChatFriends.php
  74. 50
      niucloud/app/model/chat_messages/ChatMessages.php
  75. 38
      niucloud/app/service/admin/campus_person_role/CampusPersonRoleService.php
  76. 31
      niucloud/app/service/admin/communication_records/CommunicationRecordsService.php
  77. 11
      niucloud/app/service/admin/course/CourseService.php
  78. 11
      niucloud/app/service/admin/exam_papers/ExamPapersService.php
  79. 50
      niucloud/app/service/admin/lesson_course_teaching/LessonCourseTeachingService.php
  80. 12
      niucloud/app/service/admin/sys/RoleService.php
  81. 77
      niucloud/app/service/admin/sys/SystemService.php
  82. 156
      niucloud/app/service/api/apiService/AttendanceService.php
  83. 32
      niucloud/app/service/api/apiService/CommonService.php
  84. 4
      niucloud/app/service/api/apiService/TeachingResearchService.php
  85. 23
      niucloud/app/service/api/pay/PayService.php

6
admin/src/app/api/course.ts

@ -19,6 +19,12 @@ export function getCourseInfo(id: number) {
return request.get(`course/course/${id}`)
}
export function contractAll(params: Record<string, any>) {
return request.get(`course/contract_all`, { params })
}
/**
*
* @param params

4
admin/src/app/api/exam_papers.ts

@ -50,5 +50,9 @@ export function deleteExamPapers(id: number) {
}
export function getAll() {
return request.get(`exam_papers/all`)
}
// USER_CODE_END -- exam_papers

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

14
admin/src/app/api/sys.ts

@ -772,3 +772,17 @@ export function xsyjConfig(params: Record<string, any>) {
export function getXsyjConfig() {
return request.get('sys/get_xsyj_config')
}
export function jlyjConfig(params: Record<string, any>) {
return request.post(`sys/jlyj_config`, params)
}
export function getJlyjConfig() {
return request.get('sys/get_jlyj_config')
}
export function getHome(params: Record<string, any>) {
return request.post('sys/home', params)
}

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": "合格分数"
}

28
admin/src/app/views/auth/components/edit-role.vue

@ -41,6 +41,25 @@
<el-radio :label="0">{{ t('statusDeactivate') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="部门" >
<el-select
class="input-width"
v-model="formData.dept_id"
clearable
placeholder="请选择部门"
>
<el-option label="请选择" value=""></el-option>
<el-option
v-for="(item, index) in parentDepartmentIdList"
:key="index"
:label="item['department_name']"
:value="item['id']"
/>
</el-select>
</el-form-item>
<el-form-item :label="t('permission')" prop="rules">
<div class="flex items-center justify-between w-11/12">
@ -86,6 +105,8 @@
<script lang="ts" setup async>
import {ref, reactive, computed, watch, toRaw} from 'vue'
import {t} from '@/lang'
import {
getWithDepartmentsList} from '@/app/api/departments'
import type {FormInstance} from 'element-plus'
import {addRole, editRole, getRoleInfo} from '@/app/api/sys'
import {getAuthMenus} from '@/app/api/auth'
@ -116,6 +137,12 @@ watch(selectAll, () => {
}
})
const parentDepartmentIdList = ref([] as any[])
const setParentDepartmentIdList = async () => {
parentDepartmentIdList.value = await (await getWithDepartmentsList({})).data
}
setParentDepartmentIdList()
const roleKeyList = ref([])
const getRolekeyDictList = async () => {
roleKeyList.value = await (
@ -162,6 +189,7 @@ const initialFormData = {
role_name: '',
status: 1,
role_key: '',
dept_id:'',
rules: [],
}
const formData: Record<string, any> = reactive({...initialFormData})

7
admin/src/app/views/auth/role.vue

@ -70,6 +70,13 @@
</template>
</el-table-column>
<el-table-column
prop="department_name"
label="部门"
></el-table-column>
<el-table-column
prop="create_time"

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>

20
admin/src/app/views/campus_person_role/campus_person_role.vue

@ -34,7 +34,13 @@
</el-form-item>
<el-form-item :label="t('personId')" prop="person_id">
<el-select
<el-input
v-model="campusPersonRoleTable.searchParam.person_name"
:placeholder="t('personIdPlaceholder')"
/>
<!-- <el-select
class="w-[280px]"
v-model="campusPersonRoleTable.searchParam.person_id"
clearable
@ -46,7 +52,7 @@
:label="item['name']"
:value="item['id']"
/>
</el-select>
</el-select> -->
</el-form-item>
<!-- <el-form-item :label="t('roleId')" prop="role_id">
@ -117,6 +123,14 @@
:show-overflow-tooltip="true"
/>
<el-table-column
prop="phone"
label="电话"
min-width="120"
:show-overflow-tooltip="true"
/>
<el-table-column
prop="role_id_name"
:label="t('roleId')"
@ -194,7 +208,7 @@ let campusPersonRoleTable = reactive({
data: [],
searchParam: {
campus_id: '',
person_id: '',
person_name: '',
role_id: '',
dept_id: '',
},

34
admin/src/app/views/campus_person_role/components/campus-person-role-edit.vue

@ -49,6 +49,18 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item :label="电话">
<el-input
v-model="formData.age_group"
type="number"
clearable
:placeholder="t('ageGroupPlaceholder')"
class="input-width"
/>
</el-form-item> -->
<el-form-item :label="t('roleId')" prop="role_id">
<el-select
@ -67,7 +79,7 @@
</el-select>
</el-form-item>
<el-form-item :label="t('deptId')" v-if="!formData.dept_id">
<!-- <el-form-item :label="t('deptId')" v-if="!formData.dept_id">
<el-select
class="input-width"
v-model="formData.dept_id"
@ -81,8 +93,8 @@
:label="item['department_name']"
:value="item['id']"
/>
</el-select>
</el-form-item>
</el-select> -->
<!-- </el-form-item> -->
</el-form>
<template #footer>
@ -104,6 +116,8 @@ import { ref, reactive, computed, watch } from 'vue'
import { useDictionary } from '@/app/api/dict'
import { t } from '@/lang'
import type { FormInstance } from 'element-plus'
import { useRoute } from 'vue-router'
const route = useRoute()
import {
addCampusPersonRole,
editCampusPersonRole,
@ -116,6 +130,8 @@ import {
let showDialog = ref(false)
const loading = ref(false)
const pageName = route.meta.title
/**
* 表单数据
@ -125,8 +141,16 @@ const initialFormData = {
campus_id: '',
person_id: '',
role_id: '',
dept_id: '',
dept_id: ''
}
if(pageName == '市场人员列表'){
initialFormData.dept_id = 1;
}else if(pageName == '销售人员列表'){
initialFormData.dept_id = 2;
// campusPersonRoleTable.searchParam.role_id = 2;
}
const formData: Record<string, any> = reactive({ ...initialFormData })
const formRef = ref<FormInstance>()
@ -192,7 +216,7 @@ const setPersonIdList = async () => {
setPersonIdList()
const roleIdList = ref([] as any[])
const setRoleIdList = async () => {
roleIdList.value = await (await getWithSysRoleList({})).data
roleIdList.value = await (await getWithSysRoleList({dept_id:formData.dept_id})).data
}
setRoleIdList()
const deptIdList = ref([] as any[])

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

28
admin/src/app/views/communication_records/communication_records.vue

@ -3,9 +3,9 @@
<el-card class="box-card !border-none" shadow="never">
<div class="flex justify-between items-center">
<span class="text-lg">{{ pageName }}</span>
<el-button type="primary" @click="addEvent">
<!-- <el-button type="primary" @click="addEvent">
{{ t('addCommunicationRecords') }}
</el-button>
</el-button> -->
</div>
<el-card
@ -17,7 +17,19 @@
:model="communicationRecordsTable.searchParam"
ref="searchFormRef"
>
<el-form-item :label="t('resourceId')" prop="resource_id">
<el-form-item label="名称" prop="name">
<el-input v-model="communicationRecordsTable.searchParam.name" />
</el-form-item>
<el-form-item label="电话" prop="phone_number">
<el-input v-model="communicationRecordsTable.searchParam.phone_number" />
</el-form-item>
<el-form-item label="校区" prop="campus">
<el-input v-model="communicationRecordsTable.searchParam.campus" />
</el-form-item>
<!-- <el-form-item :label="t('resourceId')" prop="resource_id">
<el-select
class="w-[280px]"
v-model="communicationRecordsTable.searchParam.resource_id"
@ -31,7 +43,7 @@
:value="item['id']"
/>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item
:label="t('communicationType')"
@ -155,9 +167,9 @@
<el-button type="primary" link @click="editEvent(row)">{{
t('edit')
}}</el-button>
<el-button type="primary" link @click="deleteEvent(row.id)">{{
<!-- <el-button type="primary" link @click="deleteEvent(row.id)">{{
t('delete')
}}</el-button>
}}</el-button> -->
</template>
</el-table-column>
</el-table>
@ -204,7 +216,9 @@ let communicationRecordsTable = reactive({
loading: true,
data: [],
searchParam: {
resource_id: '',
name: '',
phone_number: '',
campus: '',
communication_type: '',
},
})

149
admin/src/app/views/course/components/change_course.vue

@ -0,0 +1,149 @@
<template>
<el-dialog
v-model="showDialog"
:title="formData.id ? t('updateCourse') : t('addCourse')"
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="合同" prop="contract_id">
<el-select
class="input-width"
v-model="formData.contract_id"
placeholder="请选择合同"
>
<el-option
v-for="(item, index) in contractList"
:key="index"
:label="item.contract_name"
:value="item.id"
/>
</el-select>
</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 { addCourse, editCourse, getCourseInfo,contractAll } from '@/app/api/course'
let showDialog = ref(false)
const loading = ref(false)
const contractList : any = ref(null)
//
const getContractAll = async () => {
contractList.value = await (await contractAll()).data
}
getContractAll()
/**
* 表单数据
*/
const initialFormData = {
id: '',
course_name: '',
course_type: '',
duration: '',
session_count: '',
single_session_count: '',
price: '',
internal_reminder: '',
customer_reminder: '',
remarks: '',
contract_id: '',
}
const formData: Record<string, any> = reactive({ ...initialFormData })
const formRef = ref<FormInstance>()
//
const formRules = computed(() => {
return {
}
})
const emit = defineEmits(['complete'])
/**
* 确认
* @param formEl
*/
const confirm = async (formEl: FormInstance | undefined) => {
if (loading.value || !formEl) return
let save = formData.id ? editCourse : addCourse
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
})
}
})
}
//
const setFormData = async (row: any = null) => {
Object.assign(formData, initialFormData)
loading.value = true
if (row) {
const data = await (await getCourseInfo(row.id)).data
if (data)
Object.keys(formData).forEach((key: string) => {
if (data[key] != undefined) formData[key] = data[key]
})
}
loading.value = false
}
defineExpose({
showDialog,
setFormData,
})
</script>
<style lang="scss" scoped></style>
<style lang="scss">
.diy-dialog-wrap .el-form-item__label {
height: auto !important;
}
</style>

12
admin/src/app/views/course/course.vue

@ -133,6 +133,8 @@
<el-button type="primary" link @click="deleteEvent(row.id)">{{
t('delete')
}}</el-button>
<el-button type="primary" link @click="contractEvent(row)">关联合同</el-button>
</template>
</el-table-column>
</el-table>
@ -149,6 +151,7 @@
</div>
<edit ref="editCourseDialog" @complete="loadCourseList" />
<contract ref="contractDialog" @complete="loadCourseList" />
</el-card>
</div>
</template>
@ -161,6 +164,7 @@ import { getCourseList, deleteCourse } from '@/app/api/course'
import { img } from '@/utils/common'
import { ElMessageBox, FormInstance } from 'element-plus'
import Edit from '@/app/views/course/components/course-edit.vue'
import Contract from '@/app/views/course/components/change_course.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const pageName = route.meta.title
@ -243,6 +247,14 @@ const editEvent = (data: any) => {
editCourseDialog.value.showDialog = true
}
const contractDialog: Record<string, any> | null = ref(null)
const contractEvent = (data: any) => {
contractDialog.value.setFormData(data)
contractDialog.value.showDialog = true
}
/**
* 删除课程
*/

1478
admin/src/app/views/customer_resources/components/customer-resources-edit.vue

File diff suppressed because it is too large

5
admin/src/app/views/exam_papers/components/exam-papers-edit.vue

@ -80,6 +80,7 @@
<template #default="{ row }">
<el-avatar v-if="row.question_content_type == 'image'"
:src="img(row.question_content)" />
<div v-if="row.question_content_type == 'text'">{{ row.question_content }}</div>
</template>
</el-table-column>
@ -137,7 +138,7 @@
import type { FormInstance } from 'element-plus'
import { addExamPapers, editExamPapers, getExamPapersInfo } from '@/app/api/exam_papers'
import { getExamQuestionsList,randomQuestionsList } from '@/app/api/exam_questions'
import { img } from '@/utils/common'
let showDialog = ref(false)
const loading = ref(false)
@ -218,7 +219,7 @@
const handleSelectionChange = (val) => {
selectedQuestions.value = val
const ids = selectedQuestions.value.map(item => item.id).join(',')
formData.questions_ids = ids
}

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

228
admin/src/app/views/jlyj/jlyj.vue

@ -0,0 +1,228 @@
<template>
<div class="main-container">
<el-card class="box-card !border-none" shadow="never" v-loading="loading">
<div class="flex justify-between items-center">
<span class="text-lg">{{ pageName }}</span>
<el-button type="primary" @click="addStage"> 新增阶段 </el-button>
</div>
</el-card>
<el-card class="box-card !border-none" shadow="never">
<div
class="flex items-center justify-between p-[10px] table-item-border bg"
>
<span class="text-base w-[230px]">阶段名称</span>
<span class="text-base w-[110px] text-center">底薪</span>
</div>
<el-collapse v-model="activeNames" accordion>
<el-collapse-item
v-for="(stage, index) in stages"
:key="stage.id"
:name="stage.id"
>
<template #title>
<div class="collapse-title">
<span class="title-name">{{ stage.name }}</span>
<span class="arrow">{{ stage.price }} </span>
<!-- <span class="arrow">&gt;</span> -->
</div>
</template>
<el-form label-width="100px" style="margin-bottom: 10px">
<el-form-item label="阶段名称">
<el-input v-model="stage.name" placeholder="请输入阶段名称" />
</el-form-item>
</el-form>
<el-form label-width="100px" style="margin-bottom: 10px">
<el-form-item label="阶段底薪">
<el-input v-model="stage.price" placeholder="请输入阶段底薪" />
</el-form-item>
</el-form>
<el-button type="success" size="small" @click="addRule(stage)"
>新增规则</el-button
>
<el-table :data="stage.rules" border style="margin-top: 10px">
<el-table-column prop="renewal_standard_min" label="续费上限">
<template #default="{ row }">
<el-input
v-model="row.renewal_standard_min"
placeholder="请输入续费上限"
/>
</template>
</el-table-column>
<el-table-column prop="renewal_standard_max" label="续费下限">
<template #default="{ row }">
<el-input
v-model="row.renewal_standard_max"
placeholder="请输入续费下限"
/>
</template>
</el-table-column>
<el-table-column prop="renewal_commission" label="续费提成">
<template #default="{ row }">
<el-input v-model="row.renewal_commission" placeholder="%" />
</template>
</el-table-column>
<el-table-column prop="new_count_min" label="新单成交数上限">
<template #default="{ row }">
<el-input v-model="row.new_count_min" />
</template>
</el-table-column>
<el-table-column prop="new_count_max" label="新单成交数下限">
<template #default="{ row }">
<el-input v-model="row.new_count_max" />
</template>
</el-table-column>
<el-table-column prop="new_move_5" label="新招(5+1)x3">
<template #default="{ row }">
<el-input v-model="row.new_move_5" />
</template>
</el-table-column>
<el-table-column prop="new_move_7" label="新招(7+1)x3">
<template #default="{ row }">
<el-input v-model="row.new_move_7" />
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="{ $index }">
<el-button
type="danger"
size="small"
@click="removeRule(stage, $index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<el-button
type="danger"
size="small"
style="margin-top: 10px"
@click="removeStage(index)"
>删除该阶段</el-button
>
</el-collapse-item>
</el-collapse>
<div style="text-align: right; margin-top: 20px">
<el-button type="primary" @click="onSave">提交保存</el-button>
</div>
</el-card>
</div>
</template>
<script lang="ts" setup>
import { jlyjConfig, getJlyjConfig } from '@/app/api/sys'
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { useRoute } from 'vue-router'
const route = useRoute()
const pageName = route.meta.title
const loading = ref(true)
const stages = ref([])
const activeNames = ref(null)
function addStage() {
const newStage = {
name: '默认阶段',
price: 0,
rules: [
{
renewal_standard_min: '',
renewal_standard_max: '',
renewal_commission: '',
new_count_min: '',
new_count_max: '',
new_move_5: '',
new_move_7: '',
},
],
}
stages.value.push(newStage)
activeNames.value = newStage.name
}
function removeStage(index) {
stages.value.splice(index, 1)
}
function addRule(stage) {
stage.rules.push({
renewal_standard_min: '',
renewal_standard_max: '',
renewal_commission: '',
new_count_min: '',
new_count_max: '',
new_move_5: '',
new_move_7: '',
})
}
function removeRule(stage, ruleIndex) {
if (stage.rules.length === 1) {
ElMessage.warning('至少保留一条规则')
return
}
stage.rules.splice(ruleIndex, 1)
}
const setFormData = async () => {
const data = await (await getJlyjConfig()).data
stages.value = data
loading.value = false
}
setFormData()
const onSave = async () => {
jlyjConfig(stages.value)
.then(() => {
loading.value = true
setFormData()
})
.catch(() => {
loading.value = false
})
}
</script>
<style lang="scss" scoped>
.collapse-title {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
font-size: 14px;
font-weight: 500;
padding-right: 10px;
color: #333;
padding: 10px;
}
.title-name {
width: 230px;
}
.title-salary {
width: 110px;
text-align: center;
color: #7438d5;
}
.arrow {
margin-left: auto;
color: #999;
font-size: 14px;
}
</style>

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
}
/**
* 获取课程教学大纲列表
*/

11
admin/src/app/views/login/index.vue

@ -187,6 +187,14 @@ const handleLogin = async (formEl: FormInstance | undefined) => {
})
}
// const {
// query: { redirect },
// } = route
// const path = typeof redirect === 'string' ? redirect : '/'
// const url = router.resolve(path)
// console.log(url);
// console.log(route);
// data
const loginFn = (data = {}) => {
loading.value = true
@ -198,7 +206,8 @@ const loginFn = (data = {}) => {
} = route
const path = typeof redirect === 'string' ? redirect : '/'
const url = router.resolve(path)
location.href = url.href
// console.log(url);
location.href = '/'
})
.catch(() => {
loading.value = false

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

@ -83,7 +83,7 @@
<el-table-column :label="t('operation')" fixed="right" min-width="120">
<template #default="{ row }">
<el-button type="primary" link @click="startPayment(row.id)" v-if="row.order_status == 'pending'">支付</el-button>
<el-button type="primary" link @click="startPayment(row.id)" v-if="row.order_status == 'pending' && row.payment_type == 'scan_code'">支付</el-button>
<el-button type="primary" link @click="editEvent(row)">{{
t('edit')
@ -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
}
/**
* 获取课程教学大纲列表
*/

12
admin/src/app/views/service/components/service-edit.vue

@ -28,7 +28,7 @@
v-for="(item, index) in staff_reminderList"
:key="index"
:label="item.name"
:value="item.value"
:value="Number(item.value)"
/>
</el-select>
</el-form-item>
@ -40,7 +40,7 @@
v-for="(item, index) in customer_reminderList"
:key="index"
:label="item.name"
:value="item.value"
:value="Number(item.value)"
/>
</el-select>
</el-form-item>
@ -52,14 +52,14 @@
v-for="(item, index) in customer_confirmationList"
:key="index"
:label="item.name"
:value="item.value"
:value="Number(item.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="t('customerFeedback')" >
<!-- <el-form-item :label="t('customerFeedback')" >
<el-input v-model="formData.customer_feedback" clearable :placeholder="t('customerFeedbackPlaceholder')" class="input-width" />
</el-form-item>
</el-form-item> -->
<el-form-item :label="t('status')" prop="status">
<el-select class="input-width" v-model="formData.status" clearable :placeholder="t('statusPlaceholder')">
@ -109,7 +109,7 @@ const initialFormData = {
staff_reminder: '',
customer_reminder: '',
customer_confirmation: '',
customer_feedback: '',
// customer_feedback: '',
status: '',
}
const formData: Record<string, any> = reactive({ ...initialFormData })

188
admin/src/app/views/statistics/home.vue

@ -0,0 +1,188 @@
<template>
<div class="main-container">
<!-- 实时概况 -->
<el-card shadow="never" class="!border-none">
<template #header>
<span class="text-lg font-extrabold mr-[10px]">统计概括</span>
<span class="text-sm text-[#a19f98]">查看校区员工资源和学员的实时数据</span>
</template>
<el-row :gutter="20">
<el-col :span="6">
<div class="text-sm text-[#a19f98] leading-8 ">
<el-statistic :value="info.campus_count">
<template #title>
<div style="display: inline-flex; align-items: center">
<span class="mr-[5px]">校区数量</span>
</div>
</template>
</el-statistic>
<div class="text-sm text-[#a19f98] leading-8">
</div>
</div>
</el-col>
<el-col :span="6">
<div class="text-sm text-[#a19f98] leading-8 ">
<el-statistic :value="info.personnel_count">
<template #title>
<div style="display: inline-flex; align-items: center">
<span class="mr-[5px]">员工数量</span>
</div>
</template>
</el-statistic>
<div class="text-sm text-[#a19f98] leading-8">
</div>
</div>
</el-col>
<el-col :span="6">
<div class="text-sm text-[#a19f98] leading-8 ">
<el-statistic :value="info.customerResources_count">
<template #title>
<div style="display: inline-flex; align-items: center">
<span class="mr-[5px]">资源数量</span>
</div>
</template>
</el-statistic>
<div class="text-sm text-[#a19f98] leading-8">
<span>昨日新增</span>
<span>{{info.customerResources_day_count}}</span>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="text-sm text-[#a19f98] leading-8 ">
<el-statistic :value="info.student_count">
<template #title>
<div style="display: inline-flex; align-items: center">
<span class="mr-[5px]">学员数量</span>
</div>
</template>
</el-statistic>
<div class="text-sm text-[#a19f98] leading-8">
<span>昨日新增</span>
<span>{{info.student_day_count}}</span>
</div>
</div>
</el-col>
</el-row>
</el-card>
<!-- 实时概况 end -->
<el-row :gutter="15" class="mt-[15px]">
<el-col :span="24">
<el-card shadow="never" class="!border-none">
<template #header>
<span class="text-lg font-extrabold">资源增长趋势</span>
</template>
<div >
<el-button :type="activeRange === 'week' ? 'primary' : 'default'" size="small"
@click="changeRange('week')"></el-button>
<el-button :type="activeRange === 'month' ? 'primary' : 'default'" size="small"
@click="changeRange('month')"></el-button>
<el-button :type="activeRange === 'year' ? 'primary' : 'default'" size="small"
@click="changeRange('year')"></el-button>
</div>
<div ref="visitStat" :style="{ width: '100%', height: '300px' }">
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue'
import { getHome } from '@/app/api/sys'
import * as echarts from 'echarts'
const visitStat = ref<any>(null)
const activeRange = ref<'week' | 'month' | 'year'>('week')
const info = reactive({
campus_count: 0,
personnel_count: 0,
customerResources_count: 0,
customerResources_day_count: 0,
student_count: 0,
student_day_count: 0,
customer: []
})
const changeRange = (range) => {
activeRange.value = range
Init(range) //
}
const Init = (range) => {
getHome({'date':range})
.then((res) => {
info.campus_count = res.data.campus_count
info.personnel_count = res.data.personnel_count
info.customerResources_count = res.data.customerResources_count
info.customerResources_day_count = res.data.customerResources_day_count
info.student_count = res.data.student_count
info.student_day_count = res.data.student_day_count
info.customer = res.data.customer
drawChart('');
})
.catch(() => {
})
}
Init();
const drawChart = (item : any) => {
let value = info.customer.value
if (item) value = item
if (!visitStat.value) return
const visitStatChart = echarts.init(visitStat.value)
const visitStatOption = ref({
// title: {
// text: ''
// },
legend: {},
xAxis: {
data: []
},
yAxis: {},
tooltip: {
trigger: 'axis'
},
series: [
{
type: 'line',
data: []
}
]
})
visitStatOption.value.xAxis.data = info.customer.time
visitStatOption.value.series[0].data = value
visitStatChart.setOption(visitStatOption.value)
}
</script>
<style lang="scss" scoped></style>

6642
admin/yarn.lock

File diff suppressed because it is too large

BIN
niucloud/app.zip

Binary file not shown.

10
niucloud/app/adminapi/controller/campus_person_role/CampusPersonRole.php

@ -29,7 +29,7 @@ class CampusPersonRole extends BaseAdminController
public function lists(){
$data = $this->request->params([
["campus_id",""],
["person_id",""],
["person_name",""],
["role_id",""],
["dept_id",""]
]);
@ -90,7 +90,7 @@ class CampusPersonRole extends BaseAdminController
return success('DELETE_SUCCESS');
}
public function getCampusAll(){
return success(( new CampusPersonRoleService())->getCampusAll());
}
@ -100,7 +100,11 @@ class CampusPersonRole extends BaseAdminController
}
public function getSysRoleAll(){
return success(( new CampusPersonRoleService())->getSysRoleAll());
$data = $this->request->params([
["dept_id",0]
]);
return success(( new CampusPersonRoleService())->getSysRoleAll($data));
}
public function getDepartmentsAll(){

4
niucloud/app/adminapi/controller/communication_records/CommunicationRecords.php

@ -28,7 +28,9 @@ class CommunicationRecords extends BaseAdminController
*/
public function lists(){
$data = $this->request->params([
["resource_id",""],
["name",""],
["phone_number",""],
["campus",""],
["communication_type",""]
]);
return success((new CommunicationRecordsService())->getPage($data));

6
niucloud/app/adminapi/controller/course/Course.php

@ -92,7 +92,7 @@ class Course extends BaseAdminController
["internal_reminder", 0],
["customer_reminder", 0],
["remarks", ""],
["contract_id",""],
]);
$this->validate($data, 'app\validate\course\Course.edit');
(new CourseService())->edit($id, $data);
@ -126,4 +126,8 @@ class Course extends BaseAdminController
return success((new CourseService())->getAllCourseList($data));
}
public function contract_all(){
return success((new CourseService())->contract_all());
}
}

5
niucloud/app/adminapi/controller/exam_papers/ExamPapers.php

@ -34,6 +34,11 @@ class ExamPapers extends BaseAdminController
return success((new ExamPapersService())->getPage($data));
}
public function all(){
return success((new ExamPapersService())->all());
}
/**
* 试卷详情
* @param int $id

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

@ -50,7 +50,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",1],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->add($data);
@ -69,7 +69,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->edit($id, $data);
@ -104,7 +104,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",2],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->jumpAdd($data);
@ -123,7 +123,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->jumpEdit($id, $data);
@ -159,7 +159,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",3],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->enAdd($data);
@ -178,7 +178,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->enEdit($id, $data);
@ -214,7 +214,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",4],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->basketballAdd($data);
@ -233,7 +233,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->basketballEdit($id, $data);
@ -269,7 +269,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",5],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->strengAdd($data);
@ -288,7 +288,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->strengEdit($id, $data);
@ -323,7 +323,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",6],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->ninjaAdd($data);
@ -342,7 +342,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->ninjaEdit($id, $data);
@ -377,7 +377,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",7],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->securityAdd($data);
@ -396,7 +396,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->securityEdit($id, $data);
@ -432,7 +432,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",8],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->physicalAdd($data);
@ -451,7 +451,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->physicalEdit($id, $data);
@ -486,7 +486,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",9],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->actionAdd($data);
@ -505,7 +505,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->actionEdit($id, $data);
@ -540,7 +540,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",10],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->fitnessAdd($data);
@ -559,7 +559,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->fitnessEdit($id, $data);
@ -594,7 +594,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",11],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->gamesAdd($data);
@ -613,7 +613,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->gamesEdit($id, $data);
@ -648,7 +648,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",12],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->relaxationAdd($data);
@ -667,7 +667,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->relaxationEdit($id, $data);
@ -694,7 +694,7 @@ class LessonCourseTeaching extends BaseAdminController
["content",""],
["status",0],
["table_type",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add');
$id = (new LessonCourseTeachingService())->publicAdd($data);
@ -707,7 +707,7 @@ class LessonCourseTeaching extends BaseAdminController
["type",0],
["content",""],
["status",0],
["url",'']
["url",''],["exam_papers_id",""]
]);
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit');
(new LessonCourseTeachingService())->publicEdit($id, $data);
@ -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]);
}
}

2
niucloud/app/adminapi/controller/sys/Role.php

@ -58,6 +58,7 @@ class Role extends BaseAdminController
['role_name', ''],
['rules', []],
['role_key',''],
['dept_id',''],
['status', RoleStatusDict::ON],
]);
$this->validate($data, 'app\validate\sys\Role.add');
@ -75,6 +76,7 @@ class Role extends BaseAdminController
['role_name', ''],
['rules', []],
['role_key',''],
['dept_id',''],
['status', RoleStatusDict::ON],
]);
$this->validate($data, 'app\validate\sys\Role.edit');

28
niucloud/app/adminapi/controller/sys/System.php

@ -138,4 +138,32 @@ class System extends BaseAdminController
}
public function jlyj_config(){
$data = $this->request->post();
return success(data: (new SystemService())->jlyj_config($data));
}
public function get_jlyj_config(){
return success(data: (new SystemService())->get_jlyj_config());
}
public function home(){
// $data = $this->request->params([
// ['start_date', date('Y-m-d', strtotime('-6 day')) ],
// ['end_date', date('Y-m-d', strtotime('+1 day'))],
// ''
// ]);
$data = $this->request->params([
['date', 'week'],
]);
return success(data: (new SystemService())->home($data));
}
}

5
niucloud/app/adminapi/route/course.php

@ -28,9 +28,12 @@ Route::group('course', function () {
Route::put('course/:id', 'course.Course/edit');
//删除课程
Route::delete('course/:id', 'course.Course/del');
Route::get('contract_all', 'course.Course/contract_all');
//获取课程列表
Route::get('getAllCourseList', 'course.Course/getAllCourseList');
})->middleware([
AdminCheckToken::class,
AdminCheckRole::class,

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

@ -29,7 +29,8 @@ Route::group('exam_papers', function () {
Route::put('exam_papers/:id', 'exam_papers.ExamPapers/edit');
//删除试卷
Route::delete('exam_papers/:id', 'exam_papers.ExamPapers/del');
Route::get('all', 'exam_papers.ExamPapers/all');
})->middleware([
AdminCheckToken::class,
AdminCheckRole::class,

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,

5
niucloud/app/adminapi/route/sys.php

@ -334,6 +334,11 @@ Route::group('sys', function() {
Route::post('xsyj_config', 'sys.System/xsyj_config');
Route::get('get_xsyj_config', 'sys.System/get_xsyj_config');
//教练业绩
Route::post('jlyj_config', 'sys.System/jlyj_config');
Route::get('get_jlyj_config', 'sys.System/get_jlyj_config');
Route::post('home', 'sys.System/home');
})->middleware([
AdminCheckToken::class,

161
niucloud/app/api/controller/apiController/Attendance.php

@ -0,0 +1,161 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\api\controller\apiController;
use app\Request;
use app\service\admin\campus\CampusService;
use app\service\api\apiService\AttendanceService;
use app\service\api\apiService\CommonService;
use core\base\BaseApiService;
/**
* 员工考勤控制器相关接口
* Class Personnel
* @package app\api\controller\apiController
*/
class Attendance extends BaseApiService
{
//列表
public function index(Request $request){
$where = [
'campus_id' => $request->param('campus_id', ''),//
'staff_id' => $request->param('staff_id', ''),//
'attendance_date' => $request->param('attendance_date', ''),//
'status' => $request->param('status', ''),//
'status_arr' => $request->param('status_arr', []),//
];
$res = (new AttendanceService())->getList($where);
return success($res);
}
//员工考勤-编辑(员工打卡/请假/签退)
public function edit(Request $request){
$campus_id =$request->param('campus_id','');//校区ID
$staff_id =$this->member_id;//人员ID
$attendance_date =$request->param('attendance_date','');//考勤日期
$remarks =$request->param('remarks','');//备注
$status =$request->param('status','');//考勤状态: present-出勤, absent-缺勤, late-迟到, leave_early-早退,leave-请假,sign_out-签退
$longitude = $request->param('longitude','');//经度
$latitude = $request->param('latitude','');//纬度
$coordinate = '';//坐标
if(!empty($longitude) && !empty($latitude)){
$coordinate = "{$longitude},{$latitude}";
}else{
return fail('缺少定位坐标');
}
if(empty($campus_id) || empty($attendance_date) || empty($status)){
return fail('缺少参数');
}
if(!in_array($status,['present','absent','late','leave_early','leave','sign_out'])){
return fail('状态类型不正确');
}
//获取校区的经纬度坐标
$campus_data = (new CampusService)->getInfo($campus_id);//查校区详情
$campus_lng = $campus_data['campus_coordinates']['lng'];//校区经度坐标
$campus_lat = $campus_data['campus_coordinates']['lat'];//校区纬度坐标
$radius = 1500.0;//打卡半径(米)
//判断签到+签退时是否超出打卡范围
if(in_array($status,['present','sign_out'])){
$isInCheckRange = (new CommonService())->isInCheckRange((float)$campus_lng, (float)$campus_lat, (float)$longitude, (float)$latitude, (float)$radius);
if(!$isInCheckRange){
return fail("超出打卡范围,规定打卡范围({$radius}米)");
}
}
//查询数据是否存在,一天一个校区同一个人只能产生一条数据
$date_h = date('H:i:s');
$obj = (new AttendanceService());
$info = $obj->info([
'campus_id'=>$campus_id,
'staff_id'=>$staff_id,
'attendance_date'=>$attendance_date,
])['data'];
//如果是签退的时候就是修改
if($status == 'sign_out'){
if (($info['status'] ?? '') != 'present') {
return fail('未查询到今日签到信息,无法签退');
}
//签退的情况
$where = [
'id'=>$info['id']
];
$data = [
'check_out_time'=>$date_h,//签退时间
'coordinate'=>$coordinate,//坐标|经度,纬度
];
//执行修改操作
$res = $obj->editData($where,$data);
}else{
//如果是签到/请假
$data = [
'campus_id'=>$campus_id,//校区ID
'staff_id'=>$staff_id,//人员ID
'attendance_date'=>$attendance_date,//考勤日期
'coordinate'=>$coordinate,//坐标|经度,纬度
'status'=>$status,//考勤状态
];
//如果是签到的情况
if($info){
if($status == 'present' && $info['status'] == 'present'){
//更新签到数据
//执行修改操作
$edit_data = [
'check_in_time'=>$date_h,//签到时间
'coordinate'=>$coordinate,//坐标|经度,纬度
'status'=>$status//考勤状态
];
$res = $obj->editData(['id'=>$info['id']],$edit_data);
if(!$res['code']){
return fail($res['msg']);
}
return success($res['data']);
}
$status_arr = (new \app\model\attendance\Attendance())::STATUS;
$status_name = $status_arr[$info['status']] ?? '';
if(!$status_name){
$status_name = '考勤';
}
return fail("今日已{$status_name}重复操作");
}else{
$data['check_in_time'] = $date_h;//签到时间
if($remarks){
$data['remarks'] = $remarks;
}
//执行创建操作
$res = $obj->addData($data);
if(!$res['code']){
return fail($res['msg']);
}
return success($res['data']);
}
}
}
}

7
niucloud/app/api/route/route.php

@ -233,7 +233,12 @@ Route::group(function () {
Route::post('communicationRecords/add', 'apiController.CommunicationRecords/add');
//校区-获取员工下的全部校区
Route::get('campus/getPersonnelCampus', 'apiController.campus/getPersonnelCampus');
Route::get('campus/getPersonnelCampus', 'apiController.Campus/getPersonnelCampus');
//员工考勤-列表(员工打卡/请假/签退)
Route::post('attendance/index', 'apiController.Attendance/index');
//员工考勤-编辑(员工打卡/请假/签退)
Route::post('attendance/edit', 'apiController.Attendance/edit');

39
niucloud/app/model/attendance/Attendance.php

@ -11,6 +11,7 @@
namespace app\model\attendance;
use app\model\dict\Dict;
use core\base\BaseModel;
use think\model\concern\SoftDelete;
use think\model\relation\HasMany;
@ -42,7 +43,14 @@ class Attendance extends BaseModel
*/
protected $name = 'attendance';
//状态类型
const STATUS = [
'present'=>'出勤',
'absent'=>'缺勤',
'late'=>'迟到',
'leave_early'=>'早退',
'leave'=>'请假'
];
@ -93,6 +101,35 @@ class Attendance extends BaseModel
$query->where("status", $value);
}
}
/**
* 获取考勤状态状态类型名称
* @param $value
* @param $data
* @return array|mixed|string
*/
public function getStatusNameAttr($value, $data)
{
$key = 'kq_status';
$val = (String)$data['status'];
if ((!empty($val) || isset($val)) && $val !== '') {
$dict = Dict::where('key',$key)->find();
$dictionary = $dict['dictionary'] ?? [];
// 查找匹配的 name
$res = '';
foreach ($dictionary as $item) {
if ($item['value'] == $val) {
$res = $item['name'];
break;
}
}
return $res;
} else {
return '';
}
}

91
niucloud/app/model/chat_friends/ChatFriends.php

@ -0,0 +1,91 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\model\chat_friends;
use app\model\customer_resources\CustomerResources;
use core\base\BaseModel;
use think\model\concern\SoftDelete;
use app\model\personnel\Personnel;
/**
* 员工与会员聊天好友关系模型
* Class Attendance
* @package app\model\attendance
*/
class ChatFriends extends BaseModel
{
use SoftDelete;
/**
* 数据表主键
* @var string
*/
protected $pk = 'id';
/**
* 模型名称
* @var string
*/
protected $name = 'chat_friends';
/**
* 定义软删除标记字段.
* @var string
*/
protected $deleteTime = 'deleted_at';
/**
* 定义软删除字段的默认值.
* @var int
*/
protected $defaultSoftDelete = 0;
/**
* 搜索器:员工人力资源表id
* @param $value
* @param $data
*/
public function searchPersonnelIdAttr($query, $value, $data)
{
if ($value) {
$query->where("personnel_id", $value);
}
}
/**
* 搜索器:学生资源表id
* @param $value
* @param $data
*/
public function searchCustomerResourcesIdAttr($query, $value, $data)
{
if ($value) {
$query->where("customer_resources_id", $value);
}
}
public function campus(){
return $this->hasOne(CustomerResources::class, 'id', 'customer_resources_id')->joinType('left')->withField('name,id')->bind(['customer_resources_id'=>'name']);
}
public function personnel(){
return $this->hasOne(Personnel::class, 'id', 'personnel_id')->joinType('left')->withField('name,id')->bind(['personnel_id_name'=>'name']);
}
}

50
niucloud/app/model/chat_messages/ChatMessages.php

@ -0,0 +1,50 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\model\chat_messages;
use core\base\BaseModel;
use think\model\concern\SoftDelete;
/**
* 员工与会员聊天记录表模型
* Class Attendance
* @package app\model\attendance
*/
class ChatMessages extends BaseModel
{
use SoftDelete;
/**
* 数据表主键
* @var string
*/
protected $pk = 'id';
/**
* 模型名称
* @var string
*/
protected $name = 'chat_messages';
/**
* 定义软删除标记字段.
* @var string
*/
protected $deleteTime = 'deleted_at';
/**
* 定义软删除字段的默认值.
* @var int
*/
protected $defaultSoftDelete = 0;
}

38
niucloud/app/service/admin/campus_person_role/CampusPersonRoleService.php

@ -38,12 +38,36 @@ class CampusPersonRoleService extends BaseAdminService
* @param array $where
* @return array
*/
public function getPage(array $where = [])
public function getPage(array $data = [])
{
$field = 'id,campus_id,person_id,role_id,dept_id,created_at,updated_at,deleted_at';
$order = 'id desc';
$field = 'a.*,b.phone';
$order = 'a.id desc';
$where = [];
if($data['campus_id']){
$where[] = ['a.campus_id','=',$data['campus_id']];
}
if($data['role_id']){
$where[] = ['a.role_id','=',$data['role_id']];
}
if($data['dept_id']){
$where[] = ['a.dept_id','=',$data['dept_id']];
}
if($data['person_name']){
$where[] = ['b.name','like','%'.$data['person_name'].'%'];
}
$search_model = $this->model
->alias("a")
->join(['school_personnel' => 'b'],'a.person_id = b.id','left')
->where($where)
->with(['campus','personnel','sysRole','departments'])
->field($field)->order($order);
$search_model = $this->model->withSearch(["id","campus_id","person_id","role_id","dept_id"], $where)->with(['campus','personnel','sysRole','departments'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
return $list;
}
@ -98,7 +122,7 @@ class CampusPersonRoleService extends BaseAdminService
return $res;
}
public function getCampusAll(){
$campusModel = new Campus();
return $campusModel->select()->toArray();
@ -109,9 +133,9 @@ class CampusPersonRoleService extends BaseAdminService
return $personnelModel->select()->toArray();
}
public function getSysRoleAll(){
public function getSysRoleAll($data){
$sysRoleModel = new SysRole();
return $sysRoleModel->select()->toArray();
return $sysRoleModel->where(['dept_id' => $data['dept_id']])->select()->toArray();
}
public function getDepartmentsAll(){

31
niucloud/app/service/admin/communication_records/CommunicationRecordsService.php

@ -36,12 +36,35 @@ class CommunicationRecordsService extends BaseAdminService
* @param array $where
* @return array
*/
public function getPage(array $where = [])
public function getPage(array $data = [])
{
$field = 'id,staff_id,resource_id,resource_type,communication_type,communication_result,communication_time,remarks,tag,business_id,created_at,updated_at';
$order = 'id desc';
$field = 'a.*';
$order = 'a.id desc';
$where = [];
if($data['name']){
$where[] = ['b.name','like','%'.$data['name'].'%'];
}
if($data['phone_number']){
$where[] = ['b.phone_number','like','%'.$data['phone_number'].'%'];
}
if($data['campus']){
$where[] = ['c.name','like','%'.$data['campus'].'%'];
}
if($data['communication_type']){
$where[] = ['a.communication_type','=',$data['communication_type']];
}
$search_model = $this->model->withSearch(["resource_id","communication_type"], $where)->with(['customerResources'])->field($field)->order($order);
$search_model = $this->model
->alias("a")
->join(['school_customer_resources' => 'b'],'a.resource_id = b.id','left')
->join(['school_campus' => 'c'],'b.campus = c.id','left')
->where($where)
->with(['customerResources'])
->field($field)
->order($order);
$list = $this->pageQuery($search_model);
return $list;
}

11
niucloud/app/service/admin/course/CourseService.php

@ -11,6 +11,7 @@
namespace app\service\admin\course;
use app\model\contract\Contract;
use app\model\course\Course;
use core\base\BaseAdminService;
@ -36,7 +37,7 @@ class CourseService extends BaseAdminService
*/
public function getPage(array $where = [])
{
$field = 'id,course_name,course_type,duration,session_count,single_session_count,price,internal_reminder,customer_reminder,remarks,created_at,updated_at,deleted_at';
$field = 'id,course_name,course_type,duration,session_count,contract_id,single_session_count,price,internal_reminder,customer_reminder,remarks,created_at,updated_at,deleted_at';
$order = 'id desc';
$search_model = $this->model->withSearch(["id","course_name","course_type","duration","session_count","single_session_count","price","internal_reminder","customer_reminder","remarks"], $where)->field($field)->order($order);
@ -44,6 +45,12 @@ class CourseService extends BaseAdminService
return $list;
}
public function contract_all(){
$contract = new Contract();
$list = $contract->select()->toArray();
return $list;
}
/**
* 获取课程信息
* @param int $id
@ -51,7 +58,7 @@ class CourseService extends BaseAdminService
*/
public function getInfo(int $id)
{
$field = 'id,course_name,course_type,duration,session_count,single_session_count,price,internal_reminder,customer_reminder,remarks,created_at,updated_at,deleted_at';
$field = 'id,course_name,course_type,duration,session_count,contract_id,single_session_count,price,internal_reminder,customer_reminder,remarks,created_at,updated_at,deleted_at';
$info = $this->model->field($field)->where([['id', "=", $id]])->findOrEmpty()->toArray();
return $info;

11
niucloud/app/service/admin/exam_papers/ExamPapersService.php

@ -44,6 +44,17 @@ class ExamPapersService extends BaseAdminService
return $list;
}
public function all()
{
$field = 'id,title';
$order = 'id desc';
$list = $this->model->field($field)->order($order)->select()->toArray();
return $list;
}
/**
* 获取试卷信息
* @param int $id

50
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;
@ -37,7 +38,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function getPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
@ -84,7 +85,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function jumpPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -128,7 +129,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function enPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -173,7 +174,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function basketballPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -217,7 +218,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function strengPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -261,7 +262,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function ninjaPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -305,7 +306,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function securityPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -349,7 +350,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function physicalPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -397,7 +398,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function actionPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -442,7 +443,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function gamesPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -488,7 +489,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function fitnessPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -533,7 +534,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function relaxationPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -573,7 +574,7 @@ class LessonCourseTeachingService extends BaseAdminService
public function publicPetPage(array $where = [])
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,exam_papers_id';
$order = 'id desc';
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order);
$list = $this->pageQuery($search_model);
@ -610,7 +611,7 @@ class LessonCourseTeachingService extends BaseAdminService
*/
public function getInfo(int $id)
{
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,url';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,url,exam_papers_id';
$info = $this->model->field($field)->where([['id', "=", $id]])->with(['personnelData'])->findOrEmpty()->toArray();
$info['status'] = strval($info['status']);
$info['type'] = strval($info['type']);
@ -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;
}
}

12
niucloud/app/service/admin/sys/RoleService.php

@ -44,10 +44,16 @@ class RoleService extends BaseAdminService
{
$where = [];
if(isset($data['role_name']) && $data['role_name'] !== '') {
$where[] = ['role_name', 'like', "%".$this->model->handelSpecialCharacter($data['role_name'])."%"];
$where[] = ['a.role_name', 'like', "%".$this->model->handelSpecialCharacter($data['role_name'])."%"];
}
$field = 'role_id,role_name,role_key,status,create_time';
$search_model = $this->model->where($where)->field($field)->order('create_time desc')->append(['status_name']);
$field = 'a.role_id,a.role_name,a.role_key,a.status,a.create_time,b.department_name';
$search_model = $this->model
->alias("a")
->join(['school_departments' => 'b'],'a.dept_id = b.id','left')
->where($where)
->field($field)
->order('a.create_time desc')
->append(['status_name']);
return $this->pageQuery($search_model);
}
/**

77
niucloud/app/service/admin/sys/SystemService.php

@ -11,7 +11,12 @@
namespace app\service\admin\sys;
use addon\shop\app\model\ShopStat;
use app\job\sys\CheckJob;
use app\model\campus\Campus;
use app\model\customer_resources\CustomerResources;
use app\model\personnel\Personnel;
use app\model\student\Student;
use app\model\sys\SysConfig;
use app\service\core\sys\CoreSysConfigService;
use core\base\BaseAdminService;
@ -208,4 +213,76 @@ class SystemService extends BaseAdminService
return $data;
}
public function jlyj_config(array $data){
$config = new SysConfig();
$config->where(['config_key' => 'JLYJ'])->update([
'value' => json_encode($data)
]);
return true;
}
public function get_jlyj_config(){
$config = new SysConfig();
$data = $config->where(['config_key' => 'JLYJ'])->value("value");
return $data;
}
public function home(array $arr){
$campus = new Campus();
$personnel = new Personnel();
$customerResources = new CustomerResources();
$student = new Student();
$data = [];
$data['campus_count'] = $campus->count();
$data['personnel_count'] = $personnel->count();
$data['customerResources_count'] = $customerResources->count();
$data['customerResources_day_count'] = $customerResources->whereTime('created_at', 'yesterday')->count();
$data['student_count'] = $student->count();
$data['student_day_count'] = $student->whereTime('created_at', 'yesterday')->count();
if ($arr['date'] == 'week') {
$start_date = date('Y-m-d', strtotime('-6 days'));
$end_date = date('Y-m-d',strtotime('+1 days'));
} elseif ($arr['date'] == 'month') {
$start_date = date('Y-m-01');
$end_date = date('Y-m-d');
} elseif ($arr['date'] == 'year') {
$start_date = date('Y-01-01');
$end_date = date('Y-m-d');
} else {
$start_date = date('Y-m-d', strtotime('-6 days'));
$end_date = date('Y-m-d',strtotime('+1 days'));
}
$stat_data = $customerResources
->where([ ['create_date', '>=', $start_date], ['create_date', '<=', $end_date] ])
->field('create_date, COUNT(*) as count')
->group('create_date')
->select()->toArray();
$stat_data = !empty($stat_data) ? array_column($stat_data, 'count', 'create_date') : [];
$day = ceil((strtotime($end_date) - strtotime($start_date)) / 86400);
$value = [];
$time = [];
for ($i = 0; $i < $day; $i++) {
$date = date('Y-m-d', strtotime($start_date) + $i * 86400);
$time[] = $date;
$value[] = isset($stat_data[ $date ]) ? $stat_data[ $date ] : 0;
}
$data['customer'][ 'value' ] = $value;
$data['customer'][ 'time' ] = $time;
return $data;
}
}

156
niucloud/app/service/api/apiService/AttendanceService.php

@ -0,0 +1,156 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\service\api\apiService;
use app\model\attendance\Attendance;
use core\base\BaseApiService;
/**
* 考勤管理服务层
* Class MemberService
* @package app\service\api\member
*/
class AttendanceService extends BaseApiService
{
public function __construct()
{
parent::__construct();
$this->model = (new Attendance());
}
//列表
public function getList(array $where, string $field = '*')
{
$page_params = $this->getPageParam();//获取请求参数中的页码+分页数
$page = $page_params['page'];
$limit = $page_params['limit'];
$model = $this->model;
if (!empty($where['campus_id'])) {
$model = $model->where('campus_id', $where['campus_id']);
}
if (!empty($where['staff_id'])) {
$model = $model->where('staff_id', $where['staff_id']);
}
if (!empty($where['attendance_date'])) {
$model = $model->where('attendance_date', $where['attendance_date']);
}
if (!empty($where['status'])) {
$model = $model->where('status', $where['status']);
}
if (!empty($where['status_arr'])) {
$model = $model->whereIn('status', $where['status_arr']);
}
$res = $model->with([
'campus',
'personnel',
])->append([
'status_name'
])
->order('created_at','desc')
->paginate([
'list_rows' => $limit,
'page' => $page,
])->toArray();
return $res;
}
//查询详情
public function info(array $where, string $field = '*')
{
$res = [
'code' => 0,
'msg' => '操作失败',
'data' => [],
];
if (empty($where)) {
$res['msg'] = '筛选条件不能唯空';
return $res;
}
$model = $this->model;
if (!empty($where['id'])) {
$model = $model->where('id', $where['id']);
}
if (!empty($where['campus_id'])) {
$model = $model->where('campus_id', $where['campus_id']);
}
if (!empty($where['staff_id'])) {
$model = $model->where('staff_id', $where['staff_id']);
}
if (!empty($where['attendance_date'])) {
$model = $model->where('attendance_date', $where['attendance_date']);
}
$data = $model->field($field)->find();
if ($data) {
$res = [
'code' => 1,
'msg' => '操作成功',
'data' => $data->toArray(),
];
} else {
$res['msg'] = '暂无数据';
}
return $res;
}
//添加数据
public function addData(array $data)
{
$add = $this->model->create($data);
if ($add) {
$res = [
'code' => 1,
'msg' => '操作成功',
'data' => [],
];
} else {
$res = [
'code' => 0,
'msg' => '操作失败',
'data' => [],
];
}
return $res;
}
//编辑数据
public function editData(array $where, array $data)
{
$data['updated_at'] = date('Y-m-d H:i:s');
$model = $this->model;
if (!empty($where['id'])) {
$model = $model->where('id', $where['id']);
}
$edit = $model->update($data);
if ($edit) {
$res = [
'code' => 1,
'msg' => '操作成功',
'data' => [],
];
} else {
$res = [
'code' => 0,
'msg' => '操作失败',
'data' => [],
];
}
return $res;
}
}

32
niucloud/app/service/api/apiService/CommonService.php

@ -80,4 +80,36 @@ class CommonService extends BaseApiService
];
}
/**
* 判断是否在打卡范围内
* @param float $campusLat 地理围栏中心纬度
* @param float $campusLng 地理围栏中心经度
* @param float $checkLat 打卡纬度
* @param float $checkLng 打卡经度
* @param float $radius 地理围栏半径(单位:米)
* @return bool 返回是否在范围内的布尔值
*/
public function isInCheckRange(float $campusLat, float $campusLng, float $checkLat, float $checkLng, float $radius = 3000.0): bool
{
// 使用 Haversine 公式计算两点之间的距离
$earthRadius = 6371000; // 地球半径,单位为米
$latFrom = deg2rad($campusLat);
$lngFrom = deg2rad($campusLng);
$latTo = deg2rad($checkLat);
$lngTo = deg2rad($checkLng);
$latDelta = $latTo - $latFrom;
$lngDelta = $lngTo - $lngFrom;
$angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +
cos($latFrom) * cos($latTo) * pow(sin($lngDelta / 2), 2)));
$distance = $angle * $earthRadius;
// 判断计算出的距离是否小于等于设定的围栏半径
return $distance <= $radius;//false=超出打卡范围
}
}

4
niucloud/app/service/api/apiService/TeachingResearchService.php

@ -39,7 +39,7 @@ class TeachingResearchService extends BaseApiService
//获取教研管理文章列表
public function list($id,$table_type){
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,url';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,url,exam_papers_id';
$order = 'id desc';
$LessonCourseTeaching = new LessonCourseTeaching();
$where = [];
@ -56,7 +56,7 @@ class TeachingResearchService extends BaseApiService
//获取教研管理文章详情
public function info($id){
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,url';
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission,url,exam_papers_id';
$LessonCourseTeaching = new LessonCourseTeaching();
$info = $LessonCourseTeaching->field($field)->where([['id', "=", $id]])->findOrEmpty()->toArray();
if (is_array($info) && isset($info['type']) && $info['type'] == 2 && !empty($info['url']) && is_string($info['url'])) {

23
niucloud/app/service/api/pay/PayService.php

@ -27,6 +27,7 @@ use core\exception\ApiException;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Db;
use think\facade\Log;
/**
@ -182,10 +183,8 @@ class PayService extends BaseApiService
$order->where(['payment_id' => $info['out_trade_no']])->update(['order_status' => 'paid','payment_time' => date("Y-m-d H:i:s")]);
$order_count = $order->where(['resource_id' => $order_info['resource_id']])->count();
$cust_info = $cust->where(['id' => $order_info['resource_id']])->find();
if($order_count <= 1){
$cust_info = $cust->where(['id' => $order_info['resource_id']])->find();
$sex_arr = ['male' => 1, 'female' => 2, 'other' => 0];
//首次支付创建学员
$student->insert([
@ -198,6 +197,24 @@ class PayService extends BaseApiService
'user_id' => $order_info['resource_id']
]);
}
$is_rel = Db::name("class_resources_rel")->where(
['resource_id' => $order_info['resource_id'],'class_id' => $order_info['class_id']]
)->find();
if($is_rel){
Db::name("class_resources_rel")->where(['id' => $is_rel['id']])->update(['status' => 2]);
}else{
Db::name("class_resources_rel")->insert([
'class_id' => $order_info['class_id'],
'resource_id' => $order_info['resource_id'],
'campus_id' => $cust_info['campus'],
'source_type' => 'student',
'join_time' => time(),
'status' => 1,
'create_time' => date("Y-m-d H:i:s"),
'update_time' => date("Y-m-d H:i:s")
]);
}
}
}

Loading…
Cancel
Save