update:ai运动站
This commit is contained in:
parent
3cb2d992f8
commit
d257673173
6
src/api/sportsStation.js
Normal file
6
src/api/sportsStation.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import http from './http.js'
|
||||||
|
|
||||||
|
// 获取AI运动站列表
|
||||||
|
export function GetAiSportsStationList(a, b, c, d, e, f, g, h) {
|
||||||
|
return http.get(`/api/AiSportsStation/GetAiSportsStationList?StudentName=${a ?? ''}&Sex=${b ?? ''}&ClassId=${c ?? 0}&ProjectName=${d ?? ''}&StartTime=${e ?? ''}&EndTime=${f ?? ''}&PageIndex=${g}&PageSize=${h}`)
|
||||||
|
}
|
||||||
@ -283,6 +283,14 @@ const routes = [{
|
|||||||
keepAlive: false
|
keepAlive: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/AiSportsStation', //AI运动站
|
||||||
|
name: 'AiSportsStation',
|
||||||
|
component: () => import('@/views/AiSportsStation/index.vue'),
|
||||||
|
meta: {
|
||||||
|
keepAlive: false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/schoolManage', //学校管理
|
path: '/schoolManage', //学校管理
|
||||||
name: 'schoolManage',
|
name: 'schoolManage',
|
||||||
|
|||||||
293
src/views/AiSportsStation/index.vue
Normal file
293
src/views/AiSportsStation/index.vue
Normal file
@ -0,0 +1,293 @@
|
|||||||
|
<template>
|
||||||
|
<commonManage>
|
||||||
|
<div class="head">
|
||||||
|
<div class="left">
|
||||||
|
<p class="desctipt">姓名:</p>
|
||||||
|
<el-input v-model="data.tableNeed.StudentName" class="m-2" placeholder="请输入姓名" clearable />
|
||||||
|
</div>
|
||||||
|
<div class="left">
|
||||||
|
<p class="desctipt">性别:</p>
|
||||||
|
<el-select v-model="data.tableNeed.Sex" placeholder="请选择性别" class="m-2" clearable>
|
||||||
|
<el-option label="男" value="男" />
|
||||||
|
<el-option label="女" value="女" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="left">
|
||||||
|
<p class="desctipt">班级:</p>
|
||||||
|
<el-select v-model="data.tableNeed.ClassId" placeholder="请选择班级" class="m-2" clearable>
|
||||||
|
<el-option v-for="item in data.classList" :key="item.id" :label="item.className" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="left">
|
||||||
|
<p class="desctipt">项目:</p>
|
||||||
|
<el-input v-model="data.tableNeed.ProjectName" class="m-2" placeholder="请输入项目名称" clearable />
|
||||||
|
</div>
|
||||||
|
<div class="left">
|
||||||
|
<p class="desctipt">运动时间:</p>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="data.tableNeed.timeRange"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
class="m-2"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<p v-for="(item, index) in handelData" :key="index" :class="item.className" @click="btnClick(item.engName)">
|
||||||
|
{{ item.chinName }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cont">
|
||||||
|
<el-table
|
||||||
|
:data="data.tableNeed.tableData"
|
||||||
|
style="width: calc(100% - 40px); height: calc(100vh - 270px); margin: 0 20px"
|
||||||
|
fit="true"
|
||||||
|
:header-cell-style="{ 'text-align': 'center', 'font-size': '12px', color: '#3F404A', padding: '3px', background: '#F8F8FA', height: '50px' }"
|
||||||
|
:cell-style="{ 'text-align': 'center', 'font-size': '12px', color: '#3F404A' , padding: '3px' }"
|
||||||
|
:row-style="{ height: '0px' }"
|
||||||
|
>
|
||||||
|
<el-table-column fixed prop="ind" label="序号" width="60" />
|
||||||
|
<el-table-column prop="studentName" label="姓名" />
|
||||||
|
<el-table-column prop="sex" label="性别" />
|
||||||
|
<el-table-column prop="className" label="班级" />
|
||||||
|
<el-table-column prop="projectName" label="项目" />
|
||||||
|
<el-table-column prop="startTime" label="运动开始时间" />
|
||||||
|
<el-table-column prop="endTime" label="运动结束时间" />
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
:current-page="data.tableNeed.pageIndex"
|
||||||
|
:page-size="data.tableNeed.pageSize"
|
||||||
|
:page-sizes="[10, 50, 100, 200]"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="data.tableNeed.total"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="changePage"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</commonManage>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
|
import commonManage from "@/components/commonManage/index.vue";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
import * as _api from "@/api/sportsStation";
|
||||||
|
import * as _gradeApi from "@/api/grade";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const currentRoute = route.path;
|
||||||
|
const store = useStore();
|
||||||
|
let buttons = store.getters.getPermission(currentRoute).permission;
|
||||||
|
|
||||||
|
let contrast = {
|
||||||
|
查询: "Search",
|
||||||
|
重置: "Audit",
|
||||||
|
};
|
||||||
|
|
||||||
|
let handelData = ref<any>([]);
|
||||||
|
buttons.map((i) => {
|
||||||
|
handelData.value.push({
|
||||||
|
engName: i,
|
||||||
|
chinName: "",
|
||||||
|
className: i,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let i in contrast) {
|
||||||
|
handelData.value.map((v) => {
|
||||||
|
if (v.engName == contrast[i]) {
|
||||||
|
v.chinName = i;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const customOrder = {
|
||||||
|
Search: 1,
|
||||||
|
Audit: 2,
|
||||||
|
};
|
||||||
|
handelData.value.sort((a, b) => {
|
||||||
|
const orderA = customOrder[a.engName];
|
||||||
|
const orderB = customOrder[b.engName];
|
||||||
|
if (orderA < orderB) return -1;
|
||||||
|
if (orderA > orderB) return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = ref({
|
||||||
|
classList: [] as any[],
|
||||||
|
tableNeed: {
|
||||||
|
StudentName: "",
|
||||||
|
Sex: "",
|
||||||
|
ClassId: null as any,
|
||||||
|
ProjectName: "",
|
||||||
|
timeRange: null as any,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
tableData: [] as any[],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取班级列表
|
||||||
|
async function getClassList() {
|
||||||
|
const res = await _gradeApi.GetClassNames(0);
|
||||||
|
if (res.code == 200) {
|
||||||
|
data.value.classList = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
async function initApi() {
|
||||||
|
const val = data.value.tableNeed;
|
||||||
|
let startTime = "";
|
||||||
|
let endTime = "";
|
||||||
|
if (val.timeRange && val.timeRange.length === 2) {
|
||||||
|
startTime = val.timeRange[0];
|
||||||
|
endTime = val.timeRange[1];
|
||||||
|
}
|
||||||
|
const res = await _api.GetAiSportsStationList(
|
||||||
|
val.StudentName,
|
||||||
|
val.Sex,
|
||||||
|
val.ClassId,
|
||||||
|
val.ProjectName,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
val.pageIndex,
|
||||||
|
val.pageSize
|
||||||
|
);
|
||||||
|
if (res.code == 200) {
|
||||||
|
data.value.tableNeed.tableData = res.data.datas;
|
||||||
|
data.value.tableNeed.total = res.data.total;
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按钮点击
|
||||||
|
function btnClick(val) {
|
||||||
|
switch (val) {
|
||||||
|
case "Search":
|
||||||
|
data.value.tableNeed.pageIndex = 1;
|
||||||
|
initApi();
|
||||||
|
break;
|
||||||
|
case "Audit":
|
||||||
|
data.value.tableNeed.StudentName = "";
|
||||||
|
data.value.tableNeed.Sex = "";
|
||||||
|
data.value.tableNeed.ClassId = null;
|
||||||
|
data.value.tableNeed.ProjectName = "";
|
||||||
|
data.value.tableNeed.timeRange = null;
|
||||||
|
data.value.tableNeed.pageIndex = 1;
|
||||||
|
data.value.tableNeed.pageSize = 10;
|
||||||
|
initApi();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSizeChange(val) {
|
||||||
|
data.value.tableNeed.pageSize = val;
|
||||||
|
data.value.tableNeed.pageIndex = 1;
|
||||||
|
initApi();
|
||||||
|
}
|
||||||
|
|
||||||
|
function changePage(val) {
|
||||||
|
data.value.tableNeed.pageIndex = val;
|
||||||
|
initApi();
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getClassList();
|
||||||
|
initApi();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.head {
|
||||||
|
width: 100%;
|
||||||
|
height: 72px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: auto;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.desctipt {
|
||||||
|
width: auto;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: PingFangSC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #3f404a;
|
||||||
|
margin-left: 20px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-2 {
|
||||||
|
width: 200px;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: auto;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: right;
|
||||||
|
margin-left: auto;
|
||||||
|
|
||||||
|
.Search {
|
||||||
|
width: 80px;
|
||||||
|
height: 33px;
|
||||||
|
background: #4188fe;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
font-family: PingFangSC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 33px;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Audit {
|
||||||
|
width: 80px;
|
||||||
|
height: 33px;
|
||||||
|
background: #fafafa;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
font-family: PingFangSC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
text-align: center;
|
||||||
|
line-height: 33px;
|
||||||
|
margin-right: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cont {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100vh - 200px);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.pagination {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -844,6 +844,7 @@ export default defineComponent({
|
|||||||
'/formDraggable': 'el-icon-s-operation',
|
'/formDraggable': 'el-icon-s-operation',
|
||||||
'/formSubmit': 'el-icon-s-release',
|
'/formSubmit': 'el-icon-s-release',
|
||||||
'/formCollectionResultTree': 'el-icon-s-data',
|
'/formCollectionResultTree': 'el-icon-s-data',
|
||||||
|
'/AiSportsStation': 'el-icon-s-platform',
|
||||||
};
|
};
|
||||||
data.forEach((d) => {
|
data.forEach((d) => {
|
||||||
d.path = (d.url || "").replace("/Manager", "");
|
d.path = (d.url || "").replace("/Manager", "");
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export default ({ mode }: ConfigEnv) => {
|
|||||||
console.log(`ENV:`, ENV)
|
console.log(`ENV:`, ENV)
|
||||||
|
|
||||||
return defineConfig({
|
return defineConfig({
|
||||||
base: 'https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/web/samart-static/202606181400/',
|
base: 'https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/web/samart-static/202607021745/',
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
// https: false,
|
// https: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user