From fc03eaf987dcae89654dd99b4632010ce9d40612 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 17 十月 2024 17:37:20 +0800
Subject: [PATCH] 学生界面优化
---
src/views/class-management/Class.vue | 89 +++++++++++++++++++++++++++++++-------------
1 files changed, 63 insertions(+), 26 deletions(-)
diff --git a/src/views/class-management/Class.vue b/src/views/class-management/Class.vue
index 91a17f6..4248781 100644
--- a/src/views/class-management/Class.vue
+++ b/src/views/class-management/Class.vue
@@ -13,7 +13,7 @@
<div>
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
<el-form-item label="鐝骇鍚嶇О">
- <el-input v-model="searchForm.className" size="small" clearable @clear="page"
+ <el-input v-model="searchForm.className" size="small" clearable @clear="page" @input="page"
placeholder="鐝骇鍚嶇О"></el-input>
</el-form-item>
<el-form-item label="鐝骇鐘舵��">
@@ -23,7 +23,7 @@
</el-select>
</el-form-item>
<el-form-item>
- <el-button type="primary" @click="page">鏌ヨ</el-button>
+ <el-button type="primary" size="small" @click="page">鏌ヨ</el-button>
</el-form-item>
</el-form>
</div>
@@ -52,24 +52,24 @@
<el-tag v-if="scope.row.status === '瑙f暎'" type="danger">{{ scope.row.status }}</el-tag>
</template>
</el-table-column>
- <el-table-column
- width="100px"
- align="center"
- label="鍗曚綅"
- prop="unit"
- ></el-table-column>
+<!-- <el-table-column-->
+<!-- width="100px"-->
+<!-- align="center"-->
+<!-- label="鍗曚綅"-->
+<!-- prop="unit"-->
+<!-- ></el-table-column>-->
<el-table-column
align="center"
width="100px"
label="鏁欏笀"
prop="createUserName"
></el-table-column>
- <el-table-column
- align="center"
- width="120px"
- label="鑱旂郴鐢佃瘽"
- prop="teacherPhone"
- ></el-table-column>
+<!-- <el-table-column-->
+<!-- align="center"-->
+<!-- width="120px"-->
+<!-- label="鑱旂郴鐢佃瘽"-->
+<!-- prop="teacherPhone"-->
+<!-- ></el-table-column>-->
<el-table-column
width="140px"
label="寮�鐝椂闂�"
@@ -88,31 +88,47 @@
fixed="right"
>
<template slot-scope="scope">
- <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerEdit(scope.row)"
+ <el-button v-show="scope.row.status !== '瑙f暎'" size="small" @click="handlerEdit(scope.row)"
type="primary">淇敼
</el-button>
- <el-button v-if="scope.row.status !== '瑙f暎'" size="small" type="warning">鐝骇楠岃瘉</el-button>
- <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerOpenNotify(scope.row)"
+ <el-button v-show="scope.row.status !== '瑙f暎'" size="small" type="warning">鐝骇楠岃瘉</el-button>
+ <el-button v-show="scope.row.status !== '瑙f暎'" size="small" @click="handlerOpenNotify(scope.row)"
type="info">閫氱煡
</el-button>
- <el-button v-if="scope.row.status !== '瑙f暎'" @click="studentManager(scope.row.id)" size="small"
+ <el-button v-show="scope.row.status !== '瑙f暎'" @click="studentManager(scope.row.id)" size="small"
type="success">鎴愬憳绠$悊
</el-button>
- <el-button v-if="scope.row.status !== '瑙f暎'" @click="dissolution(scope.row.id)" type="danger"
- size="small">瑙f暎
- </el-button>
+ <el-popconfirm
+ class="confirm"
+ title="纭畾瑕佽В鏁h鐝骇锛�"
+ @confirm="dissolution(scope.row.id)"
+ >
+ <el-button slot="reference" v-show="scope.row.status !== '瑙f暎'" type="danger"
+ size="small">瑙f暎
+ </el-button>
+ </el-popconfirm>
+ <el-popconfirm
+ class="confirm"
+ title="纭畾瑕佹仮澶嶈鐝骇鍚楋紵"
+ @confirm="recover(scope.row.id)"
+ >
+ <el-button slot="reference" v-show="scope.row.status === '瑙f暎'" type="success"
+ size="small">鎭㈠姝e父
+ </el-button>
+ </el-popconfirm>
</template>
</el-table-column>
</el-table>
- <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageIndex"
+ <pagination v-show="total>0" :total="total" :page.sync="searchForm.currentPage"
:limit.sync="searchForm.pageSize"
@pagination="page"/>
<el-dialog
title="鐝骇閫氱煡"
:visible.sync="notifyOpen"
width="600px"
- :before-close="handleClose">
+ :before-close="handleNotifyClose"
+ :close-on-click-modal="false">
<el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="閫氱煡鐝骇锛�" prop="className">
<span>{{ notifyForm.className }}</span>
@@ -131,7 +147,8 @@
:title="title"
:visible.sync="open"
width="700px"
- :before-close="handleClose">
+ :before-close="handleClose"
+ :close-on-click-modal="false">
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
<el-form-item label="鐝骇鍚嶇О" prop="className">
<el-input v-model="form.className" size="small"></el-input>
@@ -174,7 +191,7 @@
</template>
<script>
-import { addClasses, editClasses, getClassess, dissolution } from '@/api/classes'
+import { addClasses, editClasses, getClassess, dissolution, recover } from '@/api/classes'
import { addClassesNotify } from '@/api/classesNotify'
import Pagination from '@/components/Pagination'
@@ -198,7 +215,7 @@
status: '',
subject: null,
pageSize: 10,
- pageNum: 1
+ currentPage: 1
},
form: {
id: null,
@@ -305,6 +322,12 @@
this.page()
})
},
+ recover (id) {
+ recover(id).then(res => {
+ this.$message.success(res.data.message)
+ this.page()
+ })
+ },
handlerEdit (row) {
this.form = row
this.open = true
@@ -312,6 +335,17 @@
handleClose () {
this.open = false
this.resetForm()
+ },
+ handleNotifyClose () {
+ this.notifyOpen = false
+ this.resetNotifyForm()
+ },
+ resetNotifyForm () {
+ this.notifyForm = {
+ className: '',
+ notifyContent: '',
+ classesId: null
+ }
},
handlerAdd () {
this.open = true
@@ -333,6 +367,9 @@
</script>
<style scoped lang="scss">
+.confirm {
+ margin-left: 5px;
+}
.flex {
display: flex;
}
--
Gitblit v1.8.0