develoop
ww 3 months ago
parent f98d241c38
commit 72be77b12b
  1. 4
      .env.development
  2. 2
      src/api/user/stud.js
  3. 28
      src/views/course/components/course-chapters.vue
  4. 28
      src/views/student/components/editStu.vue
  5. 294
      src/views/student/index.vue

@ -1,6 +1,6 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取 # 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development' NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台' VITE_APP_TITLE = '无糖运营平台'
# VITE_APP_BASE_API = 'http://127.0.0.1:8080' VITE_APP_BASE_API = 'http://127.0.0.1:8080'
VITE_APP_BASE_API = 'http://39.106.16.162:8080' # VITE_APP_BASE_API = 'http://39.106.16.162:8080'
http://localhost:5173/#/courseResourcesManagement/courseResources http://localhost:5173/#/courseResourcesManagement/courseResources

@ -1,7 +1,7 @@
import request from '@/utils/request' import request from '@/utils/request'
//分页查询 //分页查询
export const stuPageService = (params) => { export const stuPageService = (params) => {
// console.log(params, 'params11') console.log(params, 'paramsshaibei')
return request.get( return request.get(
`/api/studentManage/page?name=${params.name}&number=${params.number}&page=${params.page}&pageSize=${params.pagesize}&userId=${params.id}`, `/api/studentManage/page?name=${params.name}&number=${params.number}&page=${params.page}&pageSize=${params.pagesize}&userId=${params.id}`,
) )

@ -106,7 +106,7 @@ const remove = async (node: Node, data: Tree) => {
}) })
} }
// //
const getDetails = (id: any) => { } const getDetails = (id: any) => {}
const dataSource = ref<Tree[]>([ const dataSource = ref<Tree[]>([
{ {
id, id,
@ -134,18 +134,36 @@ const dataSource = ref<Tree[]>([
<h1>课程章节</h1> <h1>课程章节</h1>
<!-- <button @click="getChaptersList">获取</button> --> <!-- <button @click="getChaptersList">获取</button> -->
<div class="custom-tree-container"> <div class="custom-tree-container">
<el-tree style="max-width: 600px" :data="dataSource" node-key="id" default-expand-all <el-tree
:expand-on-click-node="false" empty-text="暂无章节"> style="max-width: 600px"
:data="dataSource"
node-key="id"
default-expand-all
:expand-on-click-node="false"
empty-text="暂无章节"
>
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node"> <span class="custom-tree-node">
<span @click="getDetails(data.id)">{{ data.name }}</span> <span @click="getDetails(data.id)">{{ data.name }}</span>
<span> <span>
<el-button @click="append(data)" circle size="small" type="primary" plain> <el-button
@click="append(data)"
circle
size="small"
type="primary"
plain
>
<el-icon :size="15"> <el-icon :size="15">
<Plus /> <Plus />
</el-icon> </el-icon>
</el-button> </el-button>
<el-button @click="remove(node, data)" circle size="small" type="danger" plain> <el-button
@click="remove(node, data)"
circle
size="small"
type="danger"
plain
>
<el-icon :size="15"> <el-icon :size="15">
<Delete /> <Delete />
</el-icon> </el-icon>

@ -87,9 +87,6 @@ const rules = {
], ],
} }
function formatDate(yearAge) {
return new Date(yearAge).toISOString()
}
// //
const onSubmit = async () => { const onSubmit = async () => {
await formRef.value.validate() await formRef.value.validate()
@ -103,16 +100,11 @@ const onSubmit = async () => {
sex: formModel.value.sex, sex: formModel.value.sex,
nickName: formModel.value.nickName, nickName: formModel.value.nickName,
major: formModel.value.major, major: formModel.value.major,
// yearAge: formModel.value.yearAge,
}).then(() => { }).then(() => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
drawer.value = false drawer.value = false
// console.log('aa')
emit('success', 'edit') emit('success', 'edit')
// console.log(form.value, 'aaaa')
// res.value = userStore.getUserInfo()
// emit('getInfo', res.value)
// dialog.value = false
}) })
} }
const onCancel = () => { const onCancel = () => {
@ -168,24 +160,6 @@ defineExpose({
<el-form-item label="专业" prop="major"> <el-form-item label="专业" prop="major">
<el-input v-model="formModel.major" placeholder="请输入专业" /> <el-input v-model="formModel.major" placeholder="请输入专业" />
</el-form-item> </el-form-item>
<el-form-item label="入学年分" prop="yearAge">
<el-date-picker
v-model="formModel.yearAge"
type="date"
placeholder="请选择入学年份"
:size="small"
style="width: 100%"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
<!-- <el-date-picker
v-model="formModel.yearAge"
type="datetime"
placeholder="Pick a Date"
format="YYYY/MM/DD hh:mm:ss"
value-format="YYYY-MM-DDThh:mm:ss"
/> -->
</el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="formModel.createTime" readonly /> <el-input v-model="formModel.createTime" readonly />
</el-form-item> </el-form-item>

@ -34,10 +34,11 @@ const params = ref({
// //
const getData = async () => { const getData = async () => {
loading.value = true loading.value = true
console.log(params.value, 'params')
await stuPageService(params.value).then((res) => { await stuPageService(params.value).then((res) => {
tableData.value = res.data.Records tableData.value = res.data.Records
total.value = res.data.totalCount total.value = res.data.totalCount
console.log(tableData.value, 'params')
loading.value = false loading.value = false
// console.log(res.data.totalCount, 'res.data') // console.log(res.data.totalCount, 'res.data')
isFirstLoad.value = false isFirstLoad.value = false
@ -237,160 +238,153 @@ onMounted(() => {
}) })
</script> </script>
<template> <template>
<page-container title="文章分类"> <el-card class="page-container">
<el-card class="page-container"> <template #header>
<template #header> <div class="card-header">
<div class="card-header"> <span>学生信息</span>
<span>学生信息</span> <div>
<div> <el-button type="primary" @click="onResetPass">重置密码</el-button>
<el-button type="primary" @click="onResetPass">重置密码</el-button> <el-button type="danger" @click="onDel">批量删除</el-button>
<el-button type="danger" @click="onDel">批量删除</el-button>
</div>
</div> </div>
</template> </div>
<div class="content"> </template>
<el-form style="display: flex"> <div class="content">
<el-form-item style="width: 250px"> <el-form style="display: flex">
<el-input <el-form-item style="width: 250px">
class="input_search" <el-input
v-model="studentId" class="input_search"
@focus="onFocus" v-model="studentId"
placeholder="输入学号进行搜索" @focus="onFocus"
></el-input> placeholder="输入学号进行搜索"
<el-icon ></el-input>
color="gray" <el-icon
:size="12" color="gray"
style="margin-right: 20px" :size="12"
@click="clearIdinput" style="margin-right: 20px"
v-if="show" @click="clearIdinput"
> v-if="show"
<CircleClose /> >
</el-icon> <CircleClose />
<el-icon><Search /></el-icon> </el-icon>
</el-form-item> <el-icon><Search /></el-icon>
<el-button class="btn_search" @click="searchNumber">搜索</el-button> </el-form-item>
<el-button class="btn_search" @click="searchNumber">搜索</el-button>
<el-form-item style="width: 250px; margin-left: 30px"> <el-form-item style="width: 250px; margin-left: 30px">
<el-input <el-input
class="input_search" class="input_search"
v-model="studentName" v-model="studentName"
@focus="onFocus1" @focus="onFocus1"
placeholder="输入姓名进行搜索" placeholder="输入姓名进行搜索"
></el-input> ></el-input>
<el-icon <el-icon
color="gray" color="gray"
:size="12" :size="12"
style="margin-right: 20px" style="margin-right: 20px"
v-if="show1" v-if="show1"
@click="closeName" @click="closeName"
> >
<CircleClose /> <CircleClose />
</el-icon> </el-icon>
<el-icon><Search /></el-icon> <el-icon><Search /></el-icon>
</el-form-item> </el-form-item>
<el-button class="btn_search" @click="searchInfo">搜索</el-button> <el-button class="btn_search" @click="searchInfo">搜索</el-button>
<el-button type="primary" @click="onReset">重置</el-button> <el-button type="primary" @click="onReset">重置</el-button>
</el-form> </el-form>
<el-table <el-table
class="tableBox" class="tableBox"
:data="tableData" :data="tableData"
v-loading="loading" v-loading="loading"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
:header-cell-style="{ :header-cell-style="{
background: '#FAFAFA', background: '#FAFAFA',
color: '#666', color: '#666',
fontSize: '14px', fontSize: '14px',
fontWeight: 'bold', fontWeight: 'bold',
height: '45px', height: '45px',
lineHeight: '45px', lineHeight: '45px',
borderTop: '1px solid #ebeef5', borderTop: '1px solid #ebeef5',
textAlign: 'center', textAlign: 'center',
}" }"
:cell-style="{ :cell-style="{
color: '#666', color: '#666',
fontSize: '14px', fontSize: '14px',
height: '40px', height: '40px',
lineHeight: '40px', lineHeight: '40px',
textAlign: 'center', textAlign: 'center',
}" }"
:row-style="{ :row-style="{
height: '40px', height: '40px',
}" }"
style="width: 100%" style="width: 100%"
> >
<el-table-column type="selection" width="55" height="100" /> <el-table-column type="selection" width="55" height="100" />
<el-table-column prop="icon" label="头像"> <el-table-column prop="icon" label="头像">
<template v-slot="scope"> <template v-slot="scope">
<img <img
:src="scope.row.icon" :src="scope.row.icon"
alt="头像" alt="头像"
width="40" width="40"
height="40" height="40"
class="rounded-circle" class="rounded-circle"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="number" label="学号" width="120" /> <el-table-column prop="number" label="学号" width="120" />
<el-table-column prop="name" label="姓名" /> <el-table-column prop="name" label="姓名" />
<el-table-column prop="username" label="用户名" /> <el-table-column prop="username" label="用户名" />
<el-table-column prop="nickName" label="昵称" /> <el-table-column prop="nickName" label="昵称" />
<el-table-column prop="sex" label="性别" /> <el-table-column prop="sex" label="性别" />
<el-table-column prop="major" label="专业" /> <el-table-column prop="major" label="专业" />
<el-table-column prop="yearAge" label="年级" /> <el-table-column prop="createTime" label="创建时间" width="200" />
<el-table-column prop="createTime" label="创建时间" width="200" /> <el-table-column prop="status" label="状态">
<el-table-column prop="status" label="状态"> <template v-slot="scope">
<template v-slot="scope"> <el-switch
<el-switch v-model="scope.row.status"
v-model="scope.row.status" active-value="1"
active-value="1" inactive-value="0"
inactive-value="0" @change="handleStatusChange(scope.row)"
@change="handleStatusChange(scope.row)" />
/> </template>
</template> </el-table-column>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="125"> <el-table-column fixed="right" label="操作" min-width="125">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
type="primary" type="primary"
size="small" :icon="Edit"
:icon="Edit" circle
circle plain
plain @click="editTable(row)"
@click="editTable(row)" ></el-button>
></el-button> <el-button
<el-button :icon="Delete"
:icon="Delete" type="danger"
type="danger" circle
size="small" plain
circle @click="delTable(row)"
plain ></el-button>
@click="delTable(row)"
></el-button>
</template>
</el-table-column>
<template #empty>
<el-empty description="没有数据" />
</template> </template>
</el-table> </el-table-column>
<el-pagination <template #empty>
v-model:current-page="params.page" <el-empty description="没有数据" />
v-model:page-size="params.pagesize" </template>
:page-sizes="[3, 5, 7, 10]" </el-table>
:size="small" <el-pagination
:disabled="disabled" v-model:current-page="params.page"
:background="true" v-model:page-size="params.pagesize"
layout="total, sizes, prev, pager, next, jumper" :page-sizes="[3, 5, 7, 10]"
:total="total" :background="true"
@size-change="onSizeChange" layout="total, sizes, prev, pager, next, jumper"
@current-change="onCurrentChange" :total="total"
/> @size-change="onSizeChange"
</div> @current-change="onCurrentChange"
</el-card> />
<!-- <edit-stu ref="stuChange"></edit-stu> --> </div>
</el-card>
<!-- <edit-stu ref="stuChange"></edit-stu> -->
<edit-stu ref="stuChange" @success="onSuccess()"></edit-stu> <edit-stu ref="stuChange" @success="onSuccess()"></edit-stu>
</page-container>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save