118 lines
2.9 KiB
Vue
118 lines
2.9 KiB
Vue
<template>
|
|
<div class="trainingDetail">
|
|
|
|
<div class="table">
|
|
<div class="tableExport">
|
|
<p @click="handleExport" style="display: none;">导出</p>
|
|
</div>
|
|
<commonTable :tableNeed="data.tableNeed" @changeSize="changePage" @toView="toView"
|
|
@handleSizeChange="handleSizeChange"></commonTable>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import { onMounted, ref } from 'vue';
|
|
import * as _api from '@/api/grade';
|
|
import { ElMessage } from 'element-plus';
|
|
import commonTable from '@/views/motionData/trainingData/components/commonTbale/index.vue';
|
|
const emits = defineEmits(['handleExport','handleSizeChange','changePage'])
|
|
const props = defineProps<{
|
|
data: any
|
|
}>()
|
|
const propsData = ref(props.data);
|
|
// const options = ref([
|
|
|
|
// ])
|
|
// 点击重置
|
|
function reset() {
|
|
|
|
}
|
|
// 点击查询
|
|
function search() {
|
|
|
|
}
|
|
function changePage(e) {
|
|
// console.log(e, 'changePage')
|
|
emits('changePage',e)
|
|
}
|
|
function handleSizeChange(e) {
|
|
// console.log(e, 'handleSizeChange')
|
|
emits('handleSizeChange',e)
|
|
}
|
|
onMounted(() => {
|
|
// GetGradeNames()
|
|
})
|
|
function handleExport() {
|
|
emits('handleExport',true)
|
|
|
|
}
|
|
// 格式转换
|
|
// function transformData(data) {
|
|
// return data.map(grade => ({
|
|
// value: grade.id,
|
|
// label: grade.gradeName,
|
|
// children: grade.class.map(cls => ({
|
|
// value: cls.id,
|
|
// label: cls.className
|
|
// }))
|
|
// }));
|
|
// }
|
|
// //年级接口
|
|
// async function GetGradeNames() {
|
|
|
|
// try {
|
|
// const res = await _api.GetGradeName();
|
|
// if (res.code == 200) {
|
|
// if (res.data) {
|
|
// console.log(res.data, 'res.GetGradeNamesGetGradeNames')
|
|
// let k = transformData(res.data)
|
|
// options.value = k
|
|
// }
|
|
// } else {
|
|
// ElMessage.error(res.message)
|
|
// }
|
|
// } catch (error) {
|
|
// console.error('Error occurred while calling API:', error);
|
|
// }
|
|
// }
|
|
</script>
|
|
<style lang="less" scoped>
|
|
.trainingDetail {
|
|
width: 100%;
|
|
height: auto;
|
|
|
|
|
|
|
|
.table {
|
|
width: calc(100% - 32px);
|
|
background-color: #fff;
|
|
border-radius: 8px;
|
|
margin: 0 auto;
|
|
|
|
.tableExport {
|
|
width: 100%;
|
|
height: 60px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: right;
|
|
|
|
p {
|
|
width: 98px;
|
|
height: 40px;
|
|
background: #4188FE;
|
|
border-radius: 8px;
|
|
border: 1px solid #E4E6ED;
|
|
text-align: center;
|
|
line-height: 40px;
|
|
font-family: PingFangSC;
|
|
font-weight: 400;
|
|
font-size: 14px;
|
|
color: #FFFFFF;
|
|
margin-right: 20px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style> |