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_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台'
# 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://127.0.0.1:8080'
# VITE_APP_BASE_API = 'http://39.106.16.162:8080'
http://localhost:5173/#/courseResourcesManagement/courseResources

@ -1,7 +1,7 @@
import request from '@/utils/request'
//分页查询
export const stuPageService = (params) => {
// console.log(params, 'params11')
console.log(params, 'paramsshaibei')
return request.get(
`/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[]>([
{
id,
@ -134,18 +134,36 @@ const dataSource = ref<Tree[]>([
<h1>课程章节</h1>
<!-- <button @click="getChaptersList">获取</button> -->
<div class="custom-tree-container">
<el-tree style="max-width: 600px" :data="dataSource" node-key="id" default-expand-all
:expand-on-click-node="false" empty-text="暂无章节">
<el-tree
style="max-width: 600px"
:data="dataSource"
node-key="id"
default-expand-all
:expand-on-click-node="false"
empty-text="暂无章节"
>
<template #default="{ node, data }">
<span class="custom-tree-node">
<span @click="getDetails(data.id)">{{ data.name }}</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">
<Plus />
</el-icon>
</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">
<Delete />
</el-icon>

@ -87,9 +87,6 @@ const rules = {
],
}
function formatDate(yearAge) {
return new Date(yearAge).toISOString()
}
//
const onSubmit = async () => {
await formRef.value.validate()
@ -103,16 +100,11 @@ const onSubmit = async () => {
sex: formModel.value.sex,
nickName: formModel.value.nickName,
major: formModel.value.major,
// yearAge: formModel.value.yearAge,
}).then(() => {
ElMessage.success('修改成功')
drawer.value = false
// console.log('aa')
emit('success', 'edit')
// console.log(form.value, 'aaaa')
// res.value = userStore.getUserInfo()
// emit('getInfo', res.value)
// dialog.value = false
})
}
const onCancel = () => {
@ -168,24 +160,6 @@ defineExpose({
<el-form-item label="专业" prop="major">
<el-input v-model="formModel.major" placeholder="请输入专业" />
</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-input v-model="formModel.createTime" readonly />
</el-form-item>

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

Loading…
Cancel
Save