|
@@ -43,16 +43,17 @@ table{
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="search-part">
|
|
|
- <!-- <label>年级:</label>
|
|
|
- <el-select v-model="search.grade" placeholder="请选择" @change="searchUser">
|
|
|
+ <label>名称:</label>
|
|
|
+ <el-input v-model="search.name" placeholder="请输入名称"></el-input>
|
|
|
+ <el-select v-model="search.subjectId" placeholder="请选择" @change="searchList">
|
|
|
<el-option
|
|
|
- v-for="item in gradeOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
+ v-for="item in subjectOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
</el-option>
|
|
|
- </el-select> -->
|
|
|
- <!-- <el-button icon="el-icon-search" circle @click="searchUser"></el-button> -->
|
|
|
+ </el-select>
|
|
|
+ <el-button icon="el-icon-search" circle @click="searchList"></el-button>
|
|
|
<el-button type="primary" class="add-user" @click="visibleAdd = true">新增</el-button>
|
|
|
</div>
|
|
|
<table>
|
|
@@ -68,7 +69,7 @@ table{
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- <tr v-for="(item,index) in userList" :key="index">
|
|
|
+ <tr v-for="(item,index) in paperList" :key="index">
|
|
|
<td>{{index + 1}}</td>
|
|
|
<td>{{item.name}}</td>
|
|
|
<td>{{item.username}}</td>
|
|
@@ -76,24 +77,19 @@ table{
|
|
|
<td>{{item.region}}</td>
|
|
|
<td>{{gradeMap[item.grade]}}</td>
|
|
|
<td>
|
|
|
- <a @click="visibleChange = true;changeUser.id = item.id">修改密码</a>
|
|
|
-
|
|
|
<a @click="visibleDelete = true;deleteId = item.id">删除</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
+
|
|
|
<el-dialog
|
|
|
class="dialog-style"
|
|
|
title="编辑"
|
|
|
:visible.sync="visibleAdd"
|
|
|
width="500px">
|
|
|
<div>
|
|
|
- <label>姓名:</label>
|
|
|
- <el-input name="name" v-model="user.name" placeholder="请输入姓名" required="required"></el-input>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <label>年级:</label>
|
|
|
+ <!-- <label>年级:</label>
|
|
|
<el-select v-model="user.grade" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in gradeOptions"
|
|
@@ -101,21 +97,14 @@ table{
|
|
|
:label="item.label"
|
|
|
:value="item.value">
|
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <label>手机:</label>
|
|
|
- <el-input v-model="user.username" placeholder="请输入手机" required="required"></el-input>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <label>密码:</label>
|
|
|
- <el-input placeholder="请输入密码" v-model="user.password" show-password required="required"></el-input>
|
|
|
+ </el-select> -->
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="addUser">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="addPaper">确 定</el-button>
|
|
|
<el-button type="primary" @click="visibleAdd = false">取消</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
<el-dialog
|
|
|
title="提示"
|
|
|
:visible.sync="visibleDelete"
|
|
@@ -123,32 +112,15 @@ table{
|
|
|
<p class="center-text">确认删除?</p>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="visibleDelete = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="deleteUser">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog
|
|
|
- class="dialog-style"
|
|
|
- title="修改密码"
|
|
|
- :visible.sync="visibleChange"
|
|
|
- width="500px">
|
|
|
- <div>
|
|
|
- <label>旧密码:</label>
|
|
|
- <el-input placeholder="请输入旧密码" v-model="changeUser.oldPass" show-password required="required"></el-input>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <label>新密码:</label>
|
|
|
- <el-input placeholder="请输入新密码" v-model="changeUser.newPass" show-password required="required"></el-input>
|
|
|
- </div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="visibleChange = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="updateUser">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="deletePaper">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getUserList,addUser,updateUser,deleteUser } from '@/api/user';
|
|
|
+import { getIssuePaperList } from '@/api/ctrlPaper';
|
|
|
+import { subjectList, issueChapterList} from '@/api/common';
|
|
|
import { GRADE_OPTION, GRADE_MAP } from '@/services/constant';
|
|
|
|
|
|
export default {
|
|
@@ -157,51 +129,70 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- userList:[],
|
|
|
- user:{},
|
|
|
- changeUser:{},
|
|
|
+ subjectOptions: [],
|
|
|
+
|
|
|
search:{
|
|
|
name:'',
|
|
|
- grade:'',
|
|
|
+ subjectId:'',
|
|
|
},
|
|
|
- deleteId: -1,
|
|
|
+ paperList: [],
|
|
|
+
|
|
|
gradeOptions: GRADE_OPTION,
|
|
|
- gradeMap: GRADE_MAP,
|
|
|
+
|
|
|
+ chapterData:{},
|
|
|
+
|
|
|
+ chapterSearch:{
|
|
|
+ grades:"7X,7Y,8X,8Y,9X,9Y",
|
|
|
+ publisher:"人教版",
|
|
|
+ subjectId:2,
|
|
|
+ },
|
|
|
+
|
|
|
+ addPaperSet:{
|
|
|
+ "chapterIds": "",
|
|
|
+ "grade": "",
|
|
|
+ "name": "",
|
|
|
+ "publisher": "人教版",
|
|
|
+ "subjectId": 2
|
|
|
+ },
|
|
|
+ deleteId: -1,
|
|
|
|
|
|
visibleAdd:false,
|
|
|
visibleDelete:false,
|
|
|
- visibleChange:false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.searchUser();
|
|
|
+ this.searchSubject();
|
|
|
+ this.searchList();
|
|
|
},
|
|
|
methods: {
|
|
|
- searchUser(){
|
|
|
- getUserList(this.search.grade,this.search.name).then((result) => {
|
|
|
- this.userList = result;
|
|
|
+ searchSubject(){
|
|
|
+ subjectList().then((result) => {
|
|
|
+ this.subjectOptions = result;
|
|
|
})
|
|
|
},
|
|
|
- addUser(){
|
|
|
- addUser(this.user).then((result) => {
|
|
|
- alert(result.message);
|
|
|
- this.visibleAdd = false
|
|
|
- this.searchUser();
|
|
|
+ issueChapterList(){
|
|
|
+ issueChapterList(this.chapterSearch).then((result) => {
|
|
|
+ this.chapterData = result;
|
|
|
})
|
|
|
},
|
|
|
- updateUser(){
|
|
|
- updateUser(this.changeUser).then((result) => {
|
|
|
- alert(result.message);
|
|
|
- this.visibleChange = false
|
|
|
- this.searchUser();
|
|
|
+ searchList(){
|
|
|
+ getIssuePaperList(this.search.name,this.search.subjectId).then((result) => {
|
|
|
+ this.paperList = result;
|
|
|
})
|
|
|
},
|
|
|
- deleteUser(){
|
|
|
- deleteUser(this.deleteId).then((result) => {
|
|
|
- alert(result?'删除成功':'删除失败');
|
|
|
- this.visibleDelete = false
|
|
|
- this.searchUser();
|
|
|
- })
|
|
|
+ addPaper(){
|
|
|
+ // addUser(this.user).then((result) => {
|
|
|
+ // alert(result.message);
|
|
|
+ // this.visibleAdd = false
|
|
|
+ // this.searchUser();
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ deletePaper(){
|
|
|
+ // deleteUser(this.deleteId).then((result) => {
|
|
|
+ // alert(result?'删除成功':'删除失败');
|
|
|
+ // this.visibleDelete = false
|
|
|
+ // this.searchUser();
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
}
|