35 changed files with 3129 additions and 2658 deletions
@ -0,0 +1,37 @@ |
|||
{ |
|||
"resourceId":"客户姓名", |
|||
"resourceIdPlaceholder":"全部", |
|||
"studentId":"学员姓名", |
|||
"studentIdPlaceholder":"全部", |
|||
"height":"身高", |
|||
"heightPlaceholder":"请输入身高", |
|||
"weight":"体重", |
|||
"weightPlaceholder":"请输入体重", |
|||
"coachId":"教练", |
|||
"coachIdPlaceholder":"请输入教练", |
|||
"seatedForwardBend":"坐位体前屈", |
|||
"seatedForwardBendPlaceholder":"请输入坐位体前屈", |
|||
"sitUps":"仰卧卷腹", |
|||
"sitUpsPlaceholder":"请输入仰卧卷腹", |
|||
"pushUps":"九十度仰卧撑", |
|||
"pushUpsPlaceholder":"请输入九十度仰卧撑", |
|||
"flamingoBalance":"火烈鸟平衡测试", |
|||
"flamingoBalancePlaceholder":"请输入火烈鸟平衡测试", |
|||
"thirtySecJump":"三十秒双脚连续跳", |
|||
"thirtySecJumpPlaceholder":"请输入三十秒双脚连续跳", |
|||
"standingLongJump":"立定跳远", |
|||
"standingLongJumpPlaceholder":"请输入立定跳远", |
|||
"agilityRun":"4乘10m灵敏折返跑", |
|||
"agilityRunPlaceholder":"请输入4乘10m灵敏折返跑", |
|||
"balanceBeam":"走平衡木", |
|||
"balanceBeamPlaceholder":"请输入走平衡木", |
|||
"tennisThrow":"网球掷远", |
|||
"tennisThrowPlaceholder":"请输入网球掷远", |
|||
"tenMeterShuttleRun":"十米往返跑", |
|||
"tenMeterShuttleRunPlaceholder":"请输入十米往返跑", |
|||
"addPhysicalTest":"添加体测", |
|||
"updatePhysicalTest":"编辑体测", |
|||
"physicalTestDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间" |
|||
} |
|||
@ -0,0 +1,239 @@ |
|||
<template> |
|||
<el-dialog |
|||
v-model="showDialog" |
|||
title="体测列表" |
|||
width="80%" |
|||
class="diy-dialog-wrap" |
|||
:destroy-on-close="true" |
|||
> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
|
|||
<div class="flex justify-between items-center"> |
|||
<span class="text-lg">体测列表</span> |
|||
<el-button type="primary" @click="addEvent"> |
|||
{{ t('addPhysicalTest') }} |
|||
</el-button> |
|||
</div> |
|||
|
|||
<!-- <el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="physicalTestTable.searchParam" ref="searchFormRef"> |
|||
|
|||
<el-form-item :label="t('resourceId')" prop="resource_id"> |
|||
<el-select class="w-[280px]" v-model="physicalTestTable.searchParam.resource_id" clearable :placeholder="t('resourceIdPlaceholder')"> |
|||
<el-option |
|||
v-for="(item, index) in resourceIdList" |
|||
:key="index" |
|||
:label="item['name']" |
|||
:value="item['id']" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
|
|||
<el-form-item :label="t('studentId')" prop="student_id"> |
|||
<el-select class="w-[280px]" v-model="physicalTestTable.searchParam.student_id" clearable :placeholder="t('studentIdPlaceholder')"> |
|||
<el-option |
|||
v-for="(item, index) in studentIdList" |
|||
:key="index" |
|||
:label="item['name']" |
|||
:value="item['id']" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('height')" prop="height"> |
|||
<el-input v-model="physicalTestTable.searchParam.height" :placeholder="t('heightPlaceholder')" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadPhysicalTestList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> --> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="physicalTestTable.data" size="large" v-loading="physicalTestTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !physicalTestTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="resource_id_name" :label="t('resourceId')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column prop="student_id_name" :label="t('studentId')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column prop="height" :label="t('height')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column prop="created_at" :label="t('createdAt')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column prop="updated_at" :label="t('updatedAt')" min-width="120" :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)">{{ t('delete') }}</el-button> --> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="physicalTestTable.page" v-model:page-size="physicalTestTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="physicalTestTable.total" |
|||
@size-change="loadPhysicalTestList()" @current-change="loadPhysicalTestList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editPhysicalTestDialog" @complete="loadPhysicalTestList" /> |
|||
</el-card> |
|||
</div> |
|||
|
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getPhysicalTestList, deletePhysicalTest, getWithCustomerResourcesList, getWithStudentList, getWithPersonnelList } from '@/app/api/physical_test' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/physical_test/components/physical-test-edit.vue' |
|||
import { useRouter } from 'vue-router' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
let showDialog = ref(false) |
|||
|
|||
|
|||
|
|||
let physicalTestTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"resource_id":"", |
|||
"student_id":"", |
|||
"height":"" |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
|
|||
|
|||
/** |
|||
* 获取体测列表 |
|||
*/ |
|||
const loadPhysicalTestList = (page: number = 1) => { |
|||
physicalTestTable.loading = true |
|||
physicalTestTable.page = page |
|||
|
|||
getPhysicalTestList({ |
|||
page: physicalTestTable.page, |
|||
limit: physicalTestTable.limit, |
|||
...physicalTestTable.searchParam |
|||
}).then(res => { |
|||
physicalTestTable.loading = false |
|||
physicalTestTable.data = res.data.data |
|||
physicalTestTable.total = res.data.total |
|||
}).catch(() => { |
|||
physicalTestTable.loading = false |
|||
}) |
|||
} |
|||
|
|||
|
|||
const router = useRouter() |
|||
|
|||
const editPhysicalTestDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 添加体测 |
|||
*/ |
|||
const addEvent = () => { |
|||
editPhysicalTestDialog.value.setFormData({'resource_id':physicalTestTable.searchParam.resource_id}) |
|||
editPhysicalTestDialog.value.showDialog = true |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 编辑体测 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
// router.push('/physical_test/physical_test_edit?id='+data.id) |
|||
editPhysicalTestDialog.value.setFormData(data) |
|||
editPhysicalTestDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 删除体测 |
|||
*/ |
|||
const deleteEvent = (id: number) => { |
|||
ElMessageBox.confirm(t('physicalTestDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deletePhysicalTest(id).then(() => { |
|||
loadPhysicalTestList() |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const resourceIdList = ref([]) |
|||
const setResourceIdList = async () => { |
|||
resourceIdList.value = await (await getWithCustomerResourcesList({})).data |
|||
} |
|||
setResourceIdList() |
|||
const studentIdList = ref([]) |
|||
const setStudentIdList = async () => { |
|||
studentIdList.value = await (await getWithStudentList({})).data |
|||
} |
|||
setStudentIdList() |
|||
const coachIdList = ref([]) |
|||
const setCoachIdList = async () => { |
|||
coachIdList.value = await (await getWithPersonnelList({})).data |
|||
} |
|||
setCoachIdList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
loadPhysicalTestList() |
|||
} |
|||
|
|||
|
|||
const setFormData = async (row: any = null) => { |
|||
// Object.assign(formData, initialFormData) |
|||
physicalTestTable.searchParam.resource_id = row.resource_id |
|||
|
|||
console.log(physicalTestTable.searchParam.resource_id); |
|||
|
|||
loadPhysicalTestList() |
|||
} |
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,226 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\model\class_grade; |
|||
|
|||
use core\base\BaseModel; |
|||
use think\model\concern\SoftDelete; |
|||
use think\model\relation\HasMany; |
|||
use think\model\relation\HasOne; |
|||
|
|||
/** |
|||
* 班级模型 |
|||
* Class Class |
|||
* @package app\model\class |
|||
*/ |
|||
class ClassGrade extends BaseModel |
|||
{ |
|||
|
|||
use SoftDelete; |
|||
|
|||
/** |
|||
* 数据表主键 |
|||
* @var string |
|||
*/ |
|||
protected $pk = 'id'; |
|||
|
|||
/** |
|||
* 模型名称 |
|||
* @var string |
|||
*/ |
|||
protected $name = 'class'; |
|||
|
|||
/** |
|||
* 定义软删除标记字段. |
|||
* @var string |
|||
*/ |
|||
protected $deleteTime = 'deleted_at'; |
|||
|
|||
/** |
|||
* 定义软删除字段的默认值. |
|||
* @var int |
|||
*/ |
|||
protected $defaultSoftDelete = 0; |
|||
|
|||
/** |
|||
* 搜索器:班级班级编号 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchIdAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("id", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级校区ID |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchCampusIdAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("campus_id", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级校区名称 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchCampusNameAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("campus_name", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级名称 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchClassNameAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("class_name", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级主教练 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchHeadCoachAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("head_coach", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级授课年龄段 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchAgeGroupAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("age_group", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级类型 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchClassTypeAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("class_type", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级助教 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchAssistantCoachAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("assistant_coach", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级创建时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchCreatedAtAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("created_at", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级修改时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchUpdatedAtAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("updated_at", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级逻辑删除时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchDeletedAtAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("deleted_at", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级状态 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchStatusAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("status", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级排序 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchSortOrderAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("sort_order", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:班级班级备注 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchRemarksAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("remarks", $value); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
Loading…
Reference in new issue