Merge remote-tracking branch 'origin/master'
| | |
| | | // 获取班级分页 |
| | | export const getClassess = (params) => { |
| | | return axios({ |
| | | url: "/api/classes/page", |
| | | url: "/api/admin/classes/page", |
| | | method: "GET", |
| | | params: params |
| | | }) |
| | |
| | | // 获取班级列表 |
| | | export const getClassesList = () => { |
| | | return axios({ |
| | | url: "/api/classes/list", |
| | | url: "/api/admin/classes/list", |
| | | method: "GET" |
| | | }) |
| | | } |
| | |
| | | // 通过id获取班级 |
| | | export const getClassesById = (params) => { |
| | | return axios({ |
| | | url: "/api/classes/" + params, |
| | | url: "/api/admin/classes/" + params, |
| | | method: "GET" |
| | | }) |
| | | } |
| | |
| | | // 通过id删除班级 |
| | | export const deleteClassesById = (params) => { |
| | | return axios({ |
| | | url: "/api/classes/" + params, |
| | | url: "/api/admin/classes/" + params, |
| | | method: "DELETE" |
| | | }) |
| | | } |
| | | |
| | | // 解散班级 |
| | | export const dissolution = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes/dissolution/" + params, |
| | | method: "PUT" |
| | | }) |
| | | } |
| | | |
| | | // 批量删除班级 |
| | | export const deleteClassesByIds = (params) => { |
| | | return axios({ |
| | | url: "/api/classes/batch", |
| | | url: "/api/admin/classes/batch", |
| | | method: "DELETE", |
| | | data: params |
| | | }) |
| | |
| | | // 修改班级 |
| | | export const editClasses = (params) => { |
| | | return axios({ |
| | | url: "/api/classes/", |
| | | url: "/api/admin/classes/", |
| | | method: "PUT", |
| | | data: params |
| | | }) |
| | |
| | | // 添加班级 |
| | | export const addClasses = (params) => { |
| | | return axios({ |
| | | url: "/api/classes/", |
| | | url: "/api/admin/classes/", |
| | | method: "POST", |
| | | data: params |
| | | }) |
New file |
| | |
| | | import axios from "./request"; |
| | | |
| | | // 获取班级通知分页 |
| | | export const getClassesNotifys = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/page", |
| | | method: "GET", |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | // 获取班级通知列表 |
| | | export const getClassesNotifyList = () => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/list", |
| | | method: "GET" |
| | | }) |
| | | } |
| | | |
| | | // 通过id获取班级通知 |
| | | export const getClassesNotifyById = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/" + params, |
| | | method: "GET" |
| | | }) |
| | | } |
| | | |
| | | // 通过id删除班级通知 |
| | | export const deleteClassesNotifyById = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/" + params, |
| | | method: "DELETE" |
| | | }) |
| | | } |
| | | |
| | | // 批量删除班级通知 |
| | | export const deleteClassesNotifyByIds = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/batch", |
| | | method: "DELETE", |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | // 修改班级通知 |
| | | export const editClassesNotify = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/", |
| | | method: "PUT", |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | // 添加班级通知 |
| | | export const addClassesNotify = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classes-notify/", |
| | | method: "POST", |
| | | data: params |
| | | }) |
| | | } |
New file |
| | |
| | | import axios from "./request"; |
| | | |
| | | // 获取班级与用户关联表分页 |
| | | export const getClassesUsers = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classesUser/page", |
| | | method: "GET", |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | // 保存班级学员数据(删除/新增) |
| | | export const updateClassesUser = (data) => { |
| | | return axios({ |
| | | url: "/api/admin/classesUser/edit", |
| | | method: "POST", |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 编辑学员信息 |
| | | export const editClassesUser = (data) => { |
| | | return axios({ |
| | | url: "/api/admin/classesUser", |
| | | method: "PUT", |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 通过id删除 |
| | | export const deleteClassesUserById = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classesUser/" + params, |
| | | method: "DELETE" |
| | | }) |
| | | } |
| | | |
| | | // 批量删除 |
| | | export const deleteClassesUserByIds = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classesUser/batch", |
| | | method: "DELETE", |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | // 添加班级与用户关联表 |
| | | export const addClassesUser = (params) => { |
| | | return axios({ |
| | | url: "/api/admin/classesUser/", |
| | | method: "POST", |
| | | data: params |
| | | }) |
| | | } |
| | |
| | | export default { |
| | | pageList: query => post('/api/admin/question/page', query), |
| | | edit: query => post('/api/admin/question/edit', query), |
| | | updateStatus: query => post('/api/admin/question/status', query), |
| | | select: id => post('/api/admin/question/select/' + id), |
| | | deleteQuestion: id => post('/api/admin/question/delete/' + id) |
| | | } |
| | |
| | | import axios from "axios"; |
| | | import router from "../router"; |
| | | import { Message } from 'element-ui'; |
| | | import {Message} from 'element-ui'; |
| | | import vue from "vue"; |
| | | |
| | | const instance = axios.create({ |
| | | baseURL: process.env.VUE_APP_URL, |
| | | timeout: 50000, |
| | | // 不携带cookie |
| | | withCredentials: true, |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | } |
| | | }); |
| | | baseURL: process.env.VUE_APP_URL, |
| | | timeout: 50000, |
| | | // 不携带cookie |
| | | withCredentials: true, |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | } |
| | | }); |
| | | |
| | | // 添加请求拦截器 |
| | | instance.interceptors.request.use(function (config) { |
| | | return config; |
| | | }, function (error) { |
| | | Message.error("请求存在问题,请检查") |
| | | return Promise.reject(error); |
| | | }); |
| | | return config; |
| | | }, function (error) { |
| | | Message.error("请求存在问题,请检查") |
| | | return Promise.reject(error); |
| | | }); |
| | | |
| | | // 添加响应拦截器 |
| | | instance.interceptors.response.use(function (response) { |
| | | // 处理自定义状态码 |
| | | if(response.data.code === 1) { |
| | | return response; |
| | | // 验证码错误放行,以便刷新验证码 |
| | | } else if (response.data.code === 1998) { |
| | | return response; |
| | | } else { |
| | | Message.error(response.data.msg); |
| | | return Promise.reject(response.data.msg); |
| | | } |
| | | if (response.data.code === 1) { |
| | | return response; |
| | | // 验证码错误放行,以便刷新验证码 |
| | | } |
| | | // 处理自定义状态码 |
| | | else if (response.data.code === 1998) { |
| | | return response; |
| | | } else { |
| | | Message.error(response.data.msg); |
| | | return Promise.reject(response.data.msg); |
| | | } |
| | | |
| | | }, function (error) { |
| | | // 处理http状态码 |
| | | if(error.response.data) { |
| | | error.message = error.response.data.msg; |
| | | } |
| | | if(error.response.status === 401) { |
| | | error.message = "登录已过期,请重新登录"; |
| | | // 删掉sessionStorage中过期token |
| | | sessionStorage.clear(); |
| | | router.push("/login"); |
| | | } |
| | | if(error.response.status === 403) { |
| | | error.message = "权限不足"; |
| | | } |
| | | Message.error(error.message); |
| | | return Promise.reject(error); |
| | | }); |
| | | }, function (error) { |
| | | // 处理http状态码 |
| | | if (error.response.data) { |
| | | error.message = error.response.data.msg; |
| | | } |
| | | if (error.response.code === 401) { |
| | | error.message = "登录已过期,请重新登录"; |
| | | vue.prototype.$$router.push({path: '/login'}) |
| | | } |
| | | if (error.response.code === 403) { |
| | | error.message = "权限不足"; |
| | | } |
| | | Message.error(error.message); |
| | | return Promise.reject(error); |
| | | }); |
| | | |
| | | export default instance; |
| | |
| | | import { post } from '@/utils/request' |
| | | import { get, post } from '@/utils/request' |
| | | |
| | | export default { |
| | | list: query => post('/api/admin/subject/list'), |
| | | pageList: query => post('/api/admin/subject/page', query), |
| | | edit: query => post('/api/admin/subject/edit', query), |
| | | updateStatus: query => post('/api/admin/subject/status', query), |
| | | select: id => post('/api/admin/subject/select/' + id), |
| | | deleteSubject: id => post('/api/admin/subject/delete/' + id) |
| | | deleteSubject: id => post('/api/admin/subject/delete/' + id), |
| | | getItemOrder: id => get('/api/admin/subject/getItemOrder') |
| | | } |
| | |
| | | import { post } from '@/utils/request' |
| | | import { post,get } from '@/utils/request' |
| | | |
| | | export default { |
| | | getUserPageList: query => post('/api/admin/user/page/list', query), |
| | |
| | | updateUser: query => post('/api/admin/user/update', query), |
| | | changeStatus: id => post('/api/admin/user/changeStatus/' + id), |
| | | deleteUser: id => post('/api/admin/user/delete/' + id), |
| | | selectByUserName: query => post('/api/admin/user/selectByUserName', query) |
| | | selectByUserName: query => post('/api/admin/user/selectByUserName', query), |
| | | studentList: () => get('/api/admin/user/student/list'), |
| | | getClassesCurrentUserList: (param) => get('/api/admin/user/classes/students', param), |
| | | } |
| | |
| | | <el-form-item label="填空答案:" required> |
| | | <el-form-item :label="item.prefix" :key="item.prefix" v-for="item in form.items" label-width="50px" |
| | | class="question-item-label"> |
| | | <el-input v-model="item.content" @focus="inputClick(item, 'content')" class="question-item-content-input" |
| | | style="width: 50%" /> |
| | | <span class="question-item-span">分数:</span><el-input-number v-model="item.score" :precision="1" :step="1" |
| | | :max="100"></el-input-number> |
| | | <el-input v-model="item.content" @focus="inputClick(item, 'content')" class="question-item-content-input" /> |
| | | <!-- <span v-if="false" class="question-item-span">分数:</span><el-input-number v-model="item.score" :precision="1" :step="1" |
| | | :max="100"></el-input-number> --> |
| | | </el-form-item> |
| | | </el-form-item> |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form, 'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="分数:" prop="score" required> |
| | | <!-- <el-form-item label="分数:" prop="score" required> |
| | | <el-input-number v-model="form.score" :precision="1" :step="1" :max="100"></el-input-number> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | |
| | | }, |
| | | } |
| | | }, |
| | | props: { |
| | | id: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | created() { |
| | | let id = this.$route.query.id |
| | | this.getSubjects(); |
| | | let id = this.id |
| | | let _this = this |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | | this.getSubjects(); |
| | | }, |
| | | methods: { |
| | | // 获取科目 |
| | |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | this.$emit('callback') |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="分数:" prop="score" required> |
| | | <!-- <el-form-item label="分数:" prop="score" required> |
| | | <el-input-number v-model="form.score" :precision="1" :step="1" :max="100"></el-input-number> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | |
| | | <script> |
| | | import QuestionShow from '@/components/PopUp/question/Show' |
| | | import Ueditor from '@/components/Ueditor' |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import { mapActions } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | import subjectApi from '@/api/subject' |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | let id = this.$route.query.id |
| | | props: { |
| | | id: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSubjects(); |
| | | let id = this.id |
| | | let _this = this |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | this.$emit('callback') |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | |
| | | methods: {} |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | /deep/ td { |
| | | background-color: #f0f0f0; |
| | | } |
| | | </style> |
| | |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="分数:" prop="score" required> |
| | | <!-- <el-form-item label="分数:" prop="score" required> |
| | | <el-input-number v-model="form.score" :precision="1" :step="1" :max="100"></el-input-number> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | |
| | | <script> |
| | | import QuestionShow from '@/components/PopUp/question/Show' |
| | | import Ueditor from '@/components/Ueditor' |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | import subjectApi from '@/api/subject' |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | let id = this.$route.query.id |
| | | props: { |
| | | id: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSubjects(); |
| | | let id = this.id |
| | | let _this = this |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | this.$emit('callback') |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="分数:" prop="score" required> |
| | | <!-- <el-form-item label="分数:" prop="score" required> |
| | | <el-input-number v-model="form.score" :precision="1" :step="1" :max="100"></el-input-number> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | |
| | | <script> |
| | | import QuestionShow from '@/components/PopUp/question/Show' |
| | | import Ueditor from '@/components/Ueditor' |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | import subjectApi from '@/api/subject' |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | let id = this.$route.query.id |
| | | props: { |
| | | id: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSubjects(); |
| | | let id = this.id |
| | | let _this = this |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | this.$emit('callback') |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | |
| | | <el-form-item label="解析:" prop="analyze" required> |
| | | <el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" /> |
| | | </el-form-item> |
| | | <el-form-item label="分数:" prop="score" required> |
| | | <!-- <el-form-item label="分数:" prop="score" required> |
| | | <el-input-number v-model="form.score" :precision="1" :step="1" :max="100"></el-input-number> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="难度:" required> |
| | | <el-rate v-model="form.difficult" class="question-item-rate"></el-rate> |
| | | </el-form-item> |
| | |
| | | <script> |
| | | import QuestionShow from '@/components/PopUp/question/Show' |
| | | import Ueditor from '@/components/Ueditor' |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | import subjectApi from '@/api/subject' |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | let id = this.$route.query.id |
| | | props: { |
| | | id: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSubjects(); |
| | | let id = this.id |
| | | let _this = this |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionApi.select(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form = re.data |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | |
| | | questionApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.delCurrentView(_this).then(() => { |
| | | _this.$router.push('/exam/question/list') |
| | | }) |
| | | this.$emit('callback') |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | this.formLoading = false |
| | |
| | | component: () => import('@/views/Manage/TestPaper/QuestionBank.vue'), |
| | | meta: { title: '题库管理' } |
| | | }, |
| | | // 科目管理 |
| | | { |
| | | path: 'subject', |
| | | name: 'subject', |
| | | component: () => import('@/views/Manage/TestPaper/subject.vue'), |
| | | meta: { title: '科目管理' } |
| | | }, |
| | | // 试卷生成 |
| | | { |
| | | path: 'test-paper-generation', |
| | |
| | | @click="handlerAdd" |
| | | >新增班级</el-button> |
| | | </div> |
| | | <div |
| | | class="flex" |
| | | style="align-items:center" |
| | | > |
| | | <p style="margin-left:20px;margin-right: 10px;">所在单位</p> |
| | | <!-- <el-select v-model="searchData.deptId">--> |
| | | <!-- <el-option></el-option>--> |
| | | <!-- </el-select>--> |
| | | </div> |
| | | <el-form :inline="true" :model="searchForm" class="demo-form-inline"> |
| | | <el-form-item label="班级名称"> |
| | | <el-input v-model="searchForm.className" clearable @clear="page" placeholder="班级名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="班级状态"> |
| | | <el-select v-model="searchForm.status" clearable @change="page" placeholder="班级状态"> |
| | | <el-option label="正常" value="normal"></el-option> |
| | | <el-option label="解散" value="dissolution"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="page">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <div> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="tableData" |
| | | border |
| | | :row-style="{height:'42px'}" |
| | |
| | | width="180px" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | label="年级" |
| | | label="状态" |
| | | align="center" |
| | | width="80px" |
| | | prop="grade" |
| | | ></el-table-column> |
| | | prop="status" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.status === '正常'" type="success">{{scope.row.status}}</el-tag> |
| | | <el-tag v-if="scope.row.status === '解散'" type="danger">{{scope.row.status}}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | width="100px" |
| | | align="center" |
| | |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" @click="handlerEdit(scope.row)" type="primary">修改</el-button> |
| | | <el-button size="small" type="warning">班级验证</el-button> |
| | | <el-button size="small" type="info">通知</el-button> |
| | | <el-button @click="routersTo()" size="small" type="success">成员管理</el-button> |
| | | <el-button @click="remove(scope.row.id)" type="danger" size="small">删除</el-button> |
| | | <el-button size="small" @click="handlerOpenNotify(scope.row)" type="info">通知</el-button> |
| | | <el-button @click="studentManager(scope.row.id)" size="small" type="success">成员管理</el-button> |
| | | <el-button v-if="scope.row.status !== '解散'" @click="dissolution(scope.row.id)" type="danger" size="small">解散</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | |
| | | </div> |
| | | |
| | | <el-dialog |
| | | title="班级通知" |
| | | :visible.sync="notifyOpen" |
| | | width="600px" |
| | | :before-close="handleClose"> |
| | | <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="通知班级:" prop="className"> |
| | | <span>{{notifyForm.className}}</span> |
| | | </el-form-item> |
| | | <el-form-item label="通知内容:" prop="notifyContent"> |
| | | <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleNotifyClose">取 消</el-button> |
| | | <el-button type="primary" @click="submitNotifyForm">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | :title="title" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addClasses, editClasses, getClassess, deleteClassesById } from "@/api/classes"; |
| | | import { addClasses, editClasses, getClassess, dissolution } from "@/api/classes"; |
| | | import { addClassesNotify } from "@/api/classesNotify"; |
| | | import Pagination from "@/components/Pagination" |
| | | export default { |
| | | components: {Pagination}, |
| | | data() { |
| | | return { |
| | | notifyOpen: false, |
| | | notifyForm: { |
| | | className: '', |
| | | notifyContent: '', |
| | | classesId: null |
| | | }, |
| | | loading: true, |
| | | total: 0, |
| | | open: false, |
| | | title: "", |
| | | value: "", |
| | | searchForm: { |
| | | className:'', |
| | | status: '', |
| | | subject: null, |
| | | pageSize: 10, |
| | | pageNum: 1 |
| | |
| | | startTime: null, |
| | | endTime: null, |
| | | remark: "" |
| | | }, |
| | | notifyRules: { |
| | | notifyContent: [ |
| | | { required: true, message: '请输入通知内容', trigger: 'blur' }, |
| | | { min: 1, max: 500, message: '长度在 1 到 500 个字符', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | rules: { |
| | | className: [ |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | handlerOpenNotify(row) { |
| | | this.notifyOpen = true |
| | | this.notifyForm.className = row.className |
| | | this.notifyForm.classesId = row.id |
| | | }, |
| | | submitNotifyForm() { |
| | | this.$refs['notifyForm'].validate((valid) => { |
| | | if (valid) { |
| | | let _this = this |
| | | addClassesNotify(_this.notifyForm).then(res => { |
| | | this.$message.success(res.data.message) |
| | | this.notifyOpen = false |
| | | this.clearNotifyForm() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | clearNotifyForm() { |
| | | this.notifyForm = { |
| | | className: '', |
| | | notifyContent: '' |
| | | } |
| | | }, |
| | | handleNotifyClose() { |
| | | this.notifyOpen = false |
| | | this.clearNotifyForm() |
| | | }, |
| | | page() { |
| | | getClassess(this.searchForm).then(res => { |
| | | this.tableData = res.data.data |
| | | this.total = res.data.total |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | resetForm() { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | remove(id) { |
| | | deleteClassesById(id).then(res => { |
| | | this.$message.success("删除成功") |
| | | dissolution(id) { |
| | | dissolution(id).then(res => { |
| | | this.$message.success(res.data.message) |
| | | this.page() |
| | | }) |
| | | }, |
| | |
| | | this.title = "新增班级" |
| | | }, |
| | | // 跳转(查看班级人员情况) |
| | | routersTo() { |
| | | this.$router.push({ |
| | | name: "ClassStaff", |
| | | }); |
| | | studentManager(classesId) { |
| | | this.$router.push({ path: "class-management/Class-staff", query: { classesId: classesId } }); |
| | | }, |
| | | // 返回上一个页面 |
| | | goBack() { |
| | |
| | | <div class="c"> |
| | | <div class="bg"> |
| | | <div class="main"> |
| | | <TitleIndex title="班级人员管理" /> |
| | | <div class="content"> |
| | | <!-- 班级名称 --> |
| | | <div style="padding-bottom:20px; border-bottom: 3px solid #409EFF;margin-bottom: 20px;"> |
| | | <span>{{title}}</span> |
| | | <el-button @click="handlerAddStudent" type="primary" size="small">新增学员</el-button> |
| | | <el-button @click="open = true" type="primary" size="small">学员调整</el-button> |
| | | </div> |
| | | <!-- 表格 --> |
| | | <el-table |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="name" |
| | | prop="realName" |
| | | label="姓名" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="sex" |
| | | :formatter="sexFormatter" |
| | | label="性别" |
| | | > |
| | | </el-table-column> |
| | |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="condition" |
| | | label="上线情况" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="300px" |
| | | > |
| | | <el-button type="warning">编辑</el-button> |
| | | <el-button type="danger">删除</el-button> |
| | | <el-button type="primary">分配角色</el-button> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="handlerEditStudent(scope.row)" type="warning">编辑</el-button> |
| | | <el-button @click="remove(scope.row.id)" type="danger">删除</el-button> |
| | | <el-button type="primary">分配角色</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div |
| | | class="block" |
| | | style="display: flex; margin-top: 40px;" |
| | | > |
| | | <el-pagination |
| | | style="margin:auto" |
| | | background |
| | | :page-size="10" |
| | | layout="prev, pager, next, jumper" |
| | | :total="100" |
| | | > |
| | | </el-pagination> |
| | | <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" |
| | | @pagination="page"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | ref="popUp" |
| | | @children="parentGoods" |
| | | /> |
| | | |
| | | <el-dialog |
| | | :title="studentTitle" |
| | | :visible.sync="addOpen" |
| | | width="700px" |
| | | :before-close="handleAddClose"> |
| | | <el-form :model="studentForm" :rules="studentRules" ref="studentForm" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="姓名" prop="realName"> |
| | | <el-input v-model="studentForm.realName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-select v-model="studentForm.sex"> |
| | | <el-option label="男" value="N"></el-option> |
| | | <el-option label="女" value="V"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="电话" prop="phone"> |
| | | <el-input v-model="studentForm.phone"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="登录账号" prop="account"> |
| | | <el-input v-model="studentForm.account"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="登录密码" prop="password"> |
| | | <el-input v-model="studentForm.password" show-password placeholder="不填写会使用默认202406"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleAddClose">取 消</el-button> |
| | | <el-button type="primary" @click="submitStudentForm">添 加</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="学员调整" |
| | | :visible.sync="open" |
| | | width="900px" |
| | | :before-close="handleClose"> |
| | | <el-transfer |
| | | filterable |
| | | :filter-method="filterMethod" |
| | | filter-placeholder="学员姓名" |
| | | :titles="['学生列表', '当前学生']" |
| | | :button-texts="['退出班级', '加入班级']" |
| | | :props="{ |
| | | key: 'id', |
| | | label: 'realName' |
| | | }" |
| | | v-model="classes.studentList" |
| | | :data="studentList"> |
| | | </el-transfer> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleClose">取 消</el-button> |
| | | <el-button type="primary" @click="submitForm">保 存</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | // 引入彈出窗口組件 |
| | | import PopUp from "../../../components/PopUp/Question.vue"; |
| | | import UserApi from "@/api/user"; |
| | | import { updateClassesUser, getClassesUsers, deleteClassesUserById, addClassesUser, edit } from "@/api/classesUser"; |
| | | export default { |
| | | // 注册 |
| | | components: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | studentForm: { |
| | | realName: "", |
| | | sex: "", |
| | | phone: "", |
| | | age: null, |
| | | account: "", |
| | | password: "" |
| | | }, |
| | | studentRules: { |
| | | realName: [ |
| | | { required: true, message: '请填写学员姓名', trigger: 'blur' }, |
| | | ], |
| | | sex: [ |
| | | { required: true, message: '请选择学员性别', trigger: 'change' }, |
| | | ], |
| | | phone: [ |
| | | { required: true, message: '请填写学员电话', trigger: 'blur' }, |
| | | ], |
| | | account: [ |
| | | { required: true, message: '请填写学员登录账号', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | studentTitle: "新增学员", |
| | | addOpen: false, |
| | | total: 0, |
| | | studentList: [], |
| | | searchForm: { |
| | | realName: "", |
| | | pageSize: 10, |
| | | pageNum: 1, |
| | | classesId: null |
| | | }, |
| | | classes: { |
| | | id: null, |
| | | studentList: [] |
| | | }, |
| | | open: false, |
| | | // 班级名称 |
| | | title: "19级软件四班", |
| | | formLabelAlign: { |
| | |
| | | region: "", |
| | | }, |
| | | tableData: [ |
| | | { |
| | | id: 1, |
| | | name: "张三", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "已上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "李四", |
| | | sex: "女", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "已上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "王五", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "未上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "张三", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "已上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "李四", |
| | | sex: "女", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "已上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "王五", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "未上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "张三", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "已上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "李四", |
| | | sex: "女", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "已上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "王五", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "未上线", |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: "王五", |
| | | sex: "男", |
| | | phone: "12345678977", |
| | | // 是否上线 |
| | | condition: "未上线", |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.classes.id = this.$route.query.classesId; |
| | | this.page() |
| | | this.getClassesCurrentUserList(this.classes.id) |
| | | this.getStudentList() |
| | | }, |
| | | methods: { |
| | | handlerEditStudent(row) { |
| | | this.studentForm = row |
| | | this.studentTitle = "编辑学员" |
| | | this.addOpen = true |
| | | }, |
| | | handlerAddStudent() { |
| | | this.studentTitle = "添加学员" |
| | | this.addOpen = true |
| | | }, |
| | | submitStudentForm() { |
| | | this.$refs['studentForm'].validate((valid) => { |
| | | if (valid) { |
| | | this.studentForm.classes = this.classes.id |
| | | if (this.studentForm.id) { |
| | | edit(this.studentForm).then(res => { |
| | | this.addOpen = false |
| | | this.$message.success(res.data.message) |
| | | this.page() |
| | | }) |
| | | } |
| | | addClassesUser(this.studentForm).then(res => { |
| | | this.addOpen = false |
| | | this.$message.success(res.data.message) |
| | | this.page() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | resetStudentForm() { |
| | | this.studentForm = { |
| | | realName: "", |
| | | sex: "", |
| | | phone: "", |
| | | age: null |
| | | } |
| | | }, |
| | | handleAddClose() { |
| | | this.addOpen = false |
| | | this.resetStudentForm() |
| | | }, |
| | | remove(id) { |
| | | deleteClassesUserById(id).then(res => { |
| | | this.$message.success(res.data.message) |
| | | this.page() |
| | | }) |
| | | }, |
| | | sexFormatter(row) { |
| | | if (row.sex === 1) { |
| | | return "男" |
| | | } |
| | | if (row.sex === 2) { |
| | | return "女" |
| | | } |
| | | }, |
| | | getClassesCurrentUserList(classesId) { |
| | | let param = { |
| | | classesId: classesId |
| | | } |
| | | UserApi.getClassesCurrentUserList(param).then(res => { |
| | | this.classes.studentList = res.data |
| | | }) |
| | | }, |
| | | getStudentList() { |
| | | UserApi.studentList().then(res => { |
| | | this.studentList = res.data; |
| | | }) |
| | | }, |
| | | // 获取当前班级学员分页 |
| | | page() { |
| | | this.searchForm.classesId = this.classes.id |
| | | getClassesUsers(this.searchForm).then(res => { |
| | | this.tableData = res.data.data |
| | | }) |
| | | }, |
| | | submitForm() { |
| | | updateClassesUser(this.classes).then(res => { |
| | | this.$message.success(res.data.message) |
| | | this.page(); |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.open = false |
| | | }, |
| | | filterMethod(query, item) { |
| | | return item.realName.indexOf(query) > -1; |
| | | }, |
| | | // 返回上一个页面 |
| | | goBack() { |
| | | this.$router.back(); |
| | |
| | | </div> |
| | | <p>教师管理</p> |
| | | </div> |
| | | <!-- 科目管理 --> |
| | | <div |
| | | class="main-1-con" |
| | | @click="routersTo('/manage/subject')" |
| | | > |
| | | <div class="icon-bg1"> |
| | | <svg |
| | | t="1651737345718" |
| | | class="icon" |
| | | viewBox="0 0 1024 1024" |
| | | version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" |
| | | p-id="4056" |
| | | width="32" |
| | | height="32" |
| | | > |
| | | <path |
| | | d="M897.28 85.333333h-750.933333c-28.16 0-51.2 23.04-51.2 51.2v750.933334c0 28.16 23.04 51.2 51.2 51.2h276.906666c18.773333 0 34.133333-15.36 34.133334-34.133334s-15.36-34.133333-34.133334-34.133333H163.413333V153.6h716.8v275.626667c0 18.773333 15.36 34.133333 34.133334 34.133333s34.133333-15.36 34.133333-34.133333V136.533333c0-28.16-22.613333-51.2-51.2-51.2z" |
| | | fill="#515151" |
| | | p-id="4057" |
| | | ></path> |
| | | <path |
| | | d="M649.813333 315.733333h-324.266666c-18.773333 0-34.133333-15.36-34.133334-34.133333s15.36-34.133333 34.133334-34.133333h324.266666c18.773333 0 34.133333 15.36 34.133334 34.133333s-14.933333 34.133333-34.133334 34.133333zM564.48 452.266667h-238.933333c-18.773333 0-34.133333-15.36-34.133334-34.133334s15.36-34.133333 34.133334-34.133333h238.933333c18.773333 0 34.133333 15.36 34.133333 34.133333s-14.933333 34.133333-34.133333 34.133334zM479.146667 588.8h-153.6c-18.773333 0-34.133333-15.36-34.133334-34.133333s15.36-34.133333 34.133334-34.133334h153.6c18.773333 0 34.133333 15.36 34.133333 34.133334s-14.933333 34.133333-34.133333 34.133333zM743.68 529.066667c-113.066667 0-204.8 91.733333-204.8 204.8s91.733333 204.8 204.8 204.8 204.8-91.733333 204.8-204.8c0-112.64-91.306667-204.8-204.8-204.8z m0 341.333333c-75.093333 0-136.533333-61.44-136.533333-136.533333s61.013333-136.533333 136.533333-136.533334 136.533333 61.44 136.533333 136.533334c0 75.52-61.013333 136.533333-136.533333 136.533333z" |
| | | fill="#515151" |
| | | p-id="4058" |
| | | ></path> |
| | | <path |
| | | d="M709.546667 810.666667c-18.773333 0-34.133333-15.36-34.133334-34.133334v-85.333333c0-18.773333 15.36-34.133333 34.133334-34.133333s34.133333 15.36 34.133333 34.133333v85.333333c0 18.773333-14.933333 34.133333-34.133333 34.133334z" |
| | | fill="#515151" |
| | | p-id="4059" |
| | | ></path> |
| | | <path |
| | | d="M675.413333 776.533333c0-18.773333 15.36-34.133333 34.133334-34.133333h85.333333c18.773333 0 34.133333 15.36 34.133333 34.133333s-15.36 34.133333-34.133333 34.133334h-85.333333c-18.773333 0-34.133333-15.36-34.133334-34.133334z" |
| | | fill="#515151" |
| | | p-id="4060" |
| | | ></path> |
| | | </svg> |
| | | </div> |
| | | <p>科目管理</p> |
| | | </div> |
| | | <!-- 题库管理 --> |
| | | <div |
| | | class="main-1-con" |
| | |
| | | <el-button type="warning" size="mini" v-for="item in editUrlEnum" :key="item.key" |
| | | @click="getDialogFormVisible(item.name)">{{ item.name }} |
| | | </el-button> |
| | | <el-button slot="reference" type="primary" class="link-left">录入题目</el-button> |
| | | <el-button slot="reference" type="primary" class="link-left">新增</el-button> |
| | | </el-popover> |
| | | </div> |
| | | <!-- 搜索 --> |
| | | <div> |
| | | <el-form :inline="true" :model="formLabelAlign" class="demo-form-inline" label-width="80px"> |
| | | <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px"> |
| | | <el-form-item> |
| | | <el-input v-model="formLabelAlign.type" placeholder="题目名"></el-input> |
| | | <el-input v-model="queryParam.content" placeholder="请输入题目" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select v-model="formLabelAlign.region" placeholder="全部科目"> |
| | | <el-option label="全部科目" value="shanghai"></el-option> |
| | | <el-option label="语文" value="beijing"></el-option> |
| | | <el-option label="数学" value="beijing"></el-option> |
| | | <el-option label="英语" value="beijing"></el-option> |
| | | <el-select v-model="queryParam.subjectId" placeholder="请选择科目" clearable multiple @change="search"> |
| | | <el-option v-for="item in subjects" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select v-model="formLabelAlign.region" placeholder="选择题"> |
| | | <el-option label="选择题" value="shanghai"></el-option> |
| | | <el-option label="问答题" value="beijing"></el-option> |
| | | <el-option label="判断题" value="beijing"></el-option> |
| | | <el-select v-model="queryParam.questionType" placeholder="请选择题型" clearable multiple @change="search"> |
| | | <el-option v-for="item in questionTypeEnum" :key="item.key" :value="item.key" |
| | | :label="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select v-model="queryParam.status" placeholder="请选择状态" clearable @change="search"> |
| | | <el-option value="1" label="启用"></el-option> |
| | | <el-option value="2" label="禁用"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label=""> |
| | | <el-form-item> |
| | | <el-button style="width:100px;" type="primary" size="small" @click="search()">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格 --> |
| | | <el-table v-loading="listLoading" :header-cell-style="getRowClass" :data="tableData" border style="width: 100%;"> |
| | | <el-table-column align="center" prop="title" label="题目名"> |
| | | <el-table v-loading="listLoading" :header-cell-style="getRowClass" :data="tableData" border |
| | | style="width: 100%;"> |
| | | <el-table-column align="center" prop="shortTitle" label="题目" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="subject" label="科目"> |
| | | <el-table-column align="center" prop="subjectName" label="科目" width="150px"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="type" label="题目类型"> |
| | | <el-table-column align="center" prop="questionTypeName" label="题型" width="100px"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="score" label="参考答案"> |
| | | <el-table-column align="center" prop="difficult" label="难度" width="60px" /> |
| | | <el-table-column align="center" prop="createTime" label="创建时间" width="160px" /> |
| | | <el-table-column label="状态" prop="status" width="70px"> |
| | | <template slot-scope="{row}"> |
| | | <el-tag :type="row.status === '禁用' ? 'danger' : 'success'"> |
| | | {{ row.status ? row.status : '启用' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center"> |
| | | <el-button type="text">编辑</el-button> |
| | | <el-button type="text">删除</el-button> |
| | | <el-table-column label="操作" align="center" width="300px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="showQuestion(row)">预览</el-button> |
| | | <el-button size="mini" @click="editQuestion(row)">编辑</el-button> |
| | | <el-button size="mini" type="primary" @click="statusQuestion(row)">{{ row.status === "禁用" ? "启用" : "禁用" |
| | | }}</el-button> |
| | | <el-popconfirm title="确认删除吗" @confirm="deleteQuestion(row)"> |
| | | <el-button slot="reference" size="mini" type="danger" class="link-left">删除</el-button> |
| | | </el-popconfirm> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="block" style="display: flex; margin-top: 40px;"> |
| | | <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex" |
| | | :limit.sync="queryParam.pageSize" @pagination="search" /> |
| | | </div> |
| | | <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex" |
| | | :limit.sync="queryParam.pageSize" @pagination="search" /> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!-- 填空 --> |
| | | <el-dialog :visible.sync="gapVisible" :close-on-click-modal="false"> |
| | | <gap ref="gap" @children="parentGoods" /> |
| | | <el-dialog :visible.sync="gapVisible" :close-on-click-modal="false" v-if="gapVisible"> |
| | | <gap ref="gap" @children="parentGoods" @callback="callback" :id="updateId" /> |
| | | </el-dialog> |
| | | <!-- 多选 --> |
| | | <el-dialog :visible.sync="multipleVisible" :close-on-click-modal="false"> |
| | | <multiple ref="multiple" @children="parentGoods" /> |
| | | <el-dialog :visible.sync="multipleVisible" :close-on-click-modal="false" v-if="multipleVisible"> |
| | | <multiple ref="multiple" @children="parentGoods" @callback="callback" :id="updateId" /> |
| | | </el-dialog> |
| | | <!-- 简答 --> |
| | | <el-dialog :visible.sync="shortVisible" :close-on-click-modal="false"> |
| | | <short ref="short" @children="parentGoods" /> |
| | | <el-dialog :visible.sync="shortVisible" :close-on-click-modal="false" v-if="shortVisible"> |
| | | <short ref="short" @children="parentGoods" @callback="callback" :id="updateId" /> |
| | | </el-dialog> |
| | | <!-- 单选 --> |
| | | <el-dialog :visible.sync="singleVisible" :close-on-click-modal="false"> |
| | | <single ref="single" @children="parentGoods" /> |
| | | <el-dialog :visible.sync="singleVisible" :close-on-click-modal="false" v-if="singleVisible"> |
| | | <single ref="single" @children="parentGoods" @callback="callback" :id="updateId" /> |
| | | </el-dialog> |
| | | <!-- 判断 --> |
| | | <el-dialog :visible.sync="truesVisible" :close-on-click-modal="false"> |
| | | <trues ref="trues" @children="parentGoods" /> |
| | | <el-dialog :visible.sync="truesVisible" :close-on-click-modal="false" v-if="truesVisible"> |
| | | <trues ref="trues" @children="parentGoods" @callback="callback" :id="updateId" /> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="questionShow.dialog" style="width: 100%;height: 100%"> |
| | | <QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import trues from "@/components/PopUp/true-false.vue"; |
| | | import { mapGetters, mapState } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | import QuestionShow from '@/components/PopUp/question/Show' |
| | | import subjectApi from '@/api/subject' |
| | | import Pagination from '@/components/Pagination' |
| | | |
| | | export default { |
| | | // 注册 |
| | |
| | | short, |
| | | single, |
| | | trues, |
| | | QuestionShow, |
| | | Pagination |
| | | }, |
| | | data() { |
| | | return { |
| | | updateId: '', |
| | | questionShow: { |
| | | qType: 0, |
| | | dialog: false, |
| | | question: null, |
| | | loading: false |
| | | }, |
| | | listLoading: true, |
| | | queryParam: { |
| | | questionType: null, |
| | | subjectId: null, |
| | | questionType: [], |
| | | subjectId: [], |
| | | content: '', |
| | | status: '', |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | |
| | | shortVisible: false, |
| | | singleVisible: false, |
| | | truesVisible: false, |
| | | formLabelAlign: { |
| | | type: "", |
| | | user: "", |
| | | region: "", |
| | | }, |
| | | tableData: [], |
| | | subjects: [] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.search() |
| | | this.getSubjects(); |
| | | }, |
| | | methods: { |
| | | // 获取科目 |
| | | getSubjects() { |
| | | subjectApi.list().then(re => { |
| | | this.subjects = re.data |
| | | }) |
| | | }, |
| | | callback() { |
| | | this.gapVisible = false; |
| | | this.multipleVisible = false; |
| | | this.shortVisible = false; |
| | | this.singleVisible = false; |
| | | this.truesVisible = false; |
| | | this.search() |
| | | }, |
| | | // 获取列表 |
| | | search() { |
| | | this.listLoading = true |
| | | questionApi.pageList(this.queryParam).then(re => { |
| | | this.tableData = re.data |
| | | this.total = re.total |
| | | this.queryParam.pageIndex = re.pageNum |
| | | this.tableData = re.data.list |
| | | this.total = re.data.total |
| | | this.queryParam.pageSize = re.data.pageSize |
| | | this.queryParam.pageIndex = re.data.pageNum |
| | | this.listLoading = false |
| | | }) |
| | | }, |
| | | // 返回上一个页面 |
| | | goBack() { |
| | | this.$router.back(); |
| | | }, |
| | | // 修改表单头部的颜色 |
| | | getRowClass() { |
| | | return "background:#d2d3d6"; |
| | | }, |
| | | // 生成试卷 |
| | | getCreate() { |
| | | // 跳转到生成页面 |
| | | //跳转到对应的管理页面 |
| | | this.$router.push({ |
| | | path: "/manage/test-paper-generation", |
| | | }); |
| | | }, |
| | | // 点击后调用弹窗组件的方法,开启弹窗 |
| | | getDialogFormVisible(value) { |
| | |
| | | this.truesVisible = true; |
| | | break; |
| | | } |
| | | this.updateId = ''; |
| | | }, |
| | | // 弹窗 |
| | | // 接收弹窗组件返回的表单值 |
| | | parentGoods(obj) { |
| | | console.log(obj, "弹窗组件的表单值"); |
| | | }, |
| | | showQuestion(row) { |
| | | let _this = this |
| | | this.questionShow.dialog = true |
| | | this.questionShow.loading = true |
| | | questionApi.select(row.id).then(re => { |
| | | _this.questionShow.qType = re.data.questionType |
| | | _this.questionShow.question = re.data |
| | | _this.questionShow.loading = false |
| | | }) |
| | | }, |
| | | editQuestion(row) { |
| | | this.getDialogFormVisible(row.questionTypeName); |
| | | this.updateId = row.id; |
| | | }, |
| | | statusQuestion(row) { |
| | | let question = { |
| | | id: row.id, |
| | | status: row.status === '禁用' ? '启用' : '禁用' |
| | | } |
| | | questionApi.updateStatus(question).then(re => { |
| | | if (re.code === 1) { |
| | | this.$message.success(re.message) |
| | | this.search() |
| | | } else { |
| | | this.$message.error(re.message) |
| | | } |
| | | }) |
| | | }, |
| | | deleteQuestion(row) { |
| | | let _this = this |
| | | questionApi.deleteQuestion(row.id).then(re => { |
| | | if (re.code === 1) { |
| | | _this.search() |
| | | _this.$message.success(re.message) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | |
| | | questionTypeEnum: state => state.exam.question.typeEnum, |
| | | editUrlEnum: state => state.exam.question.editUrlEnum |
| | | }), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | ...mapGetters('exam', ['subjectEnumFormat']), |
| | | } |
| | | }; |
| | | </script> |
New file |
| | |
| | | <!-- 科目管理 --> |
| | | <template> |
| | | <div class="c"> |
| | | <div class="bg"> |
| | | <div class="main"> |
| | | <!-- 待返回的标题 --> |
| | | <TitleIndex title="科目管理" /> |
| | | <div class="content"> |
| | | <!-- 新增按钮 --> |
| | | <div style="padding-bottom:20px; border-bottom: 3px solid #409EFF;margin-bottom: 20px;"> |
| | | <el-button type="primary" class="link-left" @click="edit()">新增</el-button> |
| | | </div> |
| | | <!-- 搜索 --> |
| | | <div> |
| | | <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px"> |
| | | <el-form-item> |
| | | <el-input v-model="queryParam.name" placeholder="请输入名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select v-model="queryParam.status" placeholder="请选择状态" clearable @change="search"> |
| | | <el-option value="1" label="启用"></el-option> |
| | | <el-option value="2" label="禁用"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button style="width:100px;" type="primary" size="small" @click="search()">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格 --> |
| | | <el-table v-loading="listLoading" :header-cell-style="getRowClass" :data="tableData" border |
| | | style="width: 100%;"> |
| | | <el-table-column align="center" prop="name" label="名称" show-overflow-tooltip /> |
| | | <el-table-column align="center" prop="itemOrder" label="排序" width="150px" /> |
| | | <el-table-column align="center" prop="createTime" label="创建时间" width="160px" /> |
| | | <el-table-column label="状态" prop="status" width="70px"> |
| | | <template slot-scope="{row}"> |
| | | <el-tag :type="row.status === '禁用' ? 'danger' : 'success'"> |
| | | {{ row.status ? row.status : '启用' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="300px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="edit(row)">编辑</el-button> |
| | | <el-button size="mini" type="primary" @click="status(row)">{{ row.status === "禁用" ? "启用" : "禁用" |
| | | }}</el-button> |
| | | <el-popconfirm title="确认删除吗" @confirm="deleteSubject(row)"> |
| | | <el-button slot="reference" size="mini" type="danger" class="link-left">删除</el-button> |
| | | </el-popconfirm> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex" |
| | | :limit.sync="queryParam.pageSize" @pagination="search" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-dialog :visible.sync="visible" width="400px"> |
| | | <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="名称:" prop="name" required> |
| | | <el-input v-model="form.name" maxlength="10" show-word-limit /> |
| | | </el-form-item> |
| | | <el-form-item label="排序:" prop="itemOrder" required> |
| | | <el-input-number v-model="form.itemOrder" type="number" :min="1" :max="100" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">提交</el-button> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | // 引入彈出窗口組件 |
| | | import subjectApi from '@/api/subject' |
| | | import Pagination from '@/components/Pagination' |
| | | |
| | | export default { |
| | | // 注册 |
| | | components: { |
| | | Pagination |
| | | }, |
| | | data() { |
| | | return { |
| | | listLoading: true, |
| | | queryParam: { |
| | | name: '', |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | formLoading: false, |
| | | total: 0, |
| | | tableData: [], |
| | | form: { |
| | | id: '', |
| | | name: '', |
| | | itemOrder: '' |
| | | }, |
| | | visible: false, |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '请输入名称', trigger: 'blur' } |
| | | ], |
| | | itemOrder: [ |
| | | { required: true, message: '请输入排序', trigger: 'blur', type: 'number' } |
| | | ] |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | // 获取排序 |
| | | getItemOrder() { |
| | | subjectApi.getItemOrder().then(re => { |
| | | this.form.itemOrder = re.data |
| | | }) |
| | | }, |
| | | // 获取列表 |
| | | search() { |
| | | this.listLoading = true |
| | | subjectApi.pageList(this.queryParam).then(re => { |
| | | this.tableData = re.data.list |
| | | this.total = re.data.total |
| | | this.queryParam.pageSize = re.data.pageSize |
| | | this.queryParam.pageIndex = re.data.pageNum |
| | | this.listLoading = false |
| | | }) |
| | | }, |
| | | // 修改表单头部的颜色 |
| | | getRowClass() { |
| | | return "background:#d2d3d6"; |
| | | }, |
| | | edit(row) { |
| | | if (row) { |
| | | subjectApi.select(row.id).then(re => { |
| | | if (re.code === 1) { |
| | | this.form = re.data; |
| | | this.visible = true; |
| | | } else { |
| | | this.$message.error(re.message) |
| | | } |
| | | }) |
| | | } else { |
| | | this.getItemOrder(); |
| | | this.visible = true; |
| | | } |
| | | }, |
| | | status(row) { |
| | | let question = { |
| | | id: row.id, |
| | | status: row.status === '禁用' ? '启用' : '禁用' |
| | | } |
| | | subjectApi.updateStatus(question).then(re => { |
| | | if (re.code === 1) { |
| | | this.$message.success(re.message) |
| | | this.search() |
| | | } else { |
| | | this.$message.error(re.message) |
| | | } |
| | | }) |
| | | }, |
| | | deleteSubject(row) { |
| | | let _this = this |
| | | subjectApi.deleteSubject(row.id).then(re => { |
| | | if (re.code === 1) { |
| | | _this.search() |
| | | _this.$message.success(re.message) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | } |
| | | }) |
| | | }, |
| | | submitForm() { |
| | | let _this = this |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.formLoading = true |
| | | subjectApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | | _this.search() |
| | | _this.formLoading = false |
| | | _this.visible = false |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | _this.formLoading = false |
| | | _this.visible = false |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | let lastId = this.form.id |
| | | this.$refs['form'].resetFields() |
| | | this.form.id = lastId |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .flex { |
| | | display: flex; |
| | | } |
| | | |
| | | // 内容 |
| | | .content { |
| | | width: 1262px; |
| | | margin-bottom: 80px; |
| | | background-color: #fff; |
| | | padding: 20px 40px; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |