diff --git a/src/views/register/register.vue b/src/views/register/register.vue index 0b3fb7c87d17891dca978f78dab8f642cf314388..645a26e22fbf4619c11cdf556718c1933658e267 100644 --- a/src/views/register/register.vue +++ b/src/views/register/register.vue @@ -3,30 +3,28 @@

注册页面

- - + + - - - + + - - - + + - - + + - - + + - + + v-model="addAndEditFormData.classId" :clearable="true" style="width:95%"> - - + + 注 册 @@ -52,6 +50,7 @@ } }; return { + labelWidth: '90px', defaultParams: { label: 'name', value: 'id', @@ -152,11 +151,11 @@ border-bottom: 1px solid rgba(255, 255, 255, 0.1); z-index: 1; - } .registerBtu { - margin-right: 25%; + width: 70%; + margin-left: 18%; } .registerTitle { diff --git a/src/views/system/stuClass/index.vue b/src/views/system/stuClass/index.vue index 0714ecdbdc9a35b7a9d8f77f16e1d15a79ebacab..8327902d11213bfab44017ed9aaebab93ac4da7e 100644 --- a/src/views/system/stuClass/index.vue +++ b/src/views/system/stuClass/index.vue @@ -1,6 +1,113 @@ @@ -8,11 +115,195 @@ export default { name: "stuClass", data() { - return {} + return { + departmentData: [], // 系数据 + collegeData: [], // 学院数据 + sign: '', // pid选择的标志 + total: 1, // 总数 + page: 1, // 当前页 + limit: 10, // 分页大小 + stuName: '', + tableData: [], + userData: [], // 管理者 + + // 新增 + title: '', + closeOnClickModal: false, + addAndEditDialogFormVisible: false, + isEditable: true, // 标志是否是编辑 + showAddAndEditForm: false, + showForm: false, + formLabelWidth: '150px', + addAndEditFormData: { + id: '', + name: '', + pid: '', + sign: '', + grade: '', + userId: '' + }, + addAndEditRules: { + name: { + required: true, message: '名称不能为空', trigger: 'blur' + }, + sign: { + required: true, message: '类型不能为空', trigger: 'blur' + }, + userId: { + required: true, message: '管理者不能为空', trigger: 'blur' + }, + }, + } + }, + created() { + this.getList(); + }, + methods: { + // 新增 + addStu() { + this.queryCollege(); + this.wholeUser(); + this.title = "新增"; + this.isEditable = false; + this.showAddAndEditForm = true; + this.addAndEditDialogFormVisible = true; + this.sign = ''; + }, + + // 查询 + getList() { + this.api.getApi("/stu/class/get?page=" + this.page + "&limit=" + this.limit + "&name=" + this.stuName).then(res => { + this.tableData = res.data.list; + this.total = res.data.total; + this.page = res.data.pageNum; + this.limit = res.data.pageSize; + }) + }, + + // 查询系和学院 + async queryCollege() { + this.departmentData = []; + this.collegeData = []; + await this.api.getApi("/stu/class/non/class").then(res => { + this.collegeData = res.data.college; + this.departmentData = res.data.department; + }) + }, + + // 筛选 + filterTag(value, row) { + return row.sign === value; + }, + + // 清除 + cleanUp() { + this.stuName = ''; + this.getList(); + }, + + // 编辑 + editData(index, row) { + this.queryCollege(); + this.wholeUser(); + this.title = "编辑"; + this.isEditable = true; + this.$set(this.addAndEditFormData, 'id', row.id); + this.$set(this.addAndEditFormData, 'name', row.name); + this.$set(this.addAndEditFormData, 'pid', row.pid); + this.$set(this.addAndEditFormData, 'sign', row.sign + ''); + this.$set(this.addAndEditFormData, 'grade', row.grade); + this.$set(this.addAndEditFormData, 'userId', row.userId); + this.showAddAndEditForm = true; + this.addAndEditDialogFormVisible = true; + // 系和学院显示 + this.sign = row.sign + ''; + }, + + // 删除 + deleteData(id) { + this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.api.deleteApi("/stu/class/delete?id=" + id).then(res => { + if (res.data.code === 200) { + this.getList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); + }, + + // 关闭模态框 + handleDialogClose() { + this.showAddAndEditForm = false; + this.addAndEditFormData = {}; + this.addAndEditDialogFormVisible = false; + }, + + // 保存/修改 + handleConfirmEvent(formName) { + this.$refs[formName].validate(async valid => { + if (valid) { + let formData = this.addAndEditFormData; + if (this.isEditable) { + this.api.putApi("/stu/class/update", formData).then(res => { + if (res.data.code === 200) { + this.getList(); + this.handleDialogClose(); + } + }) + } else { + this.api.postApi("/stu/class/add", formData).then(res => { + if (res.data.code === 200) { + this.getList(); + this.handleDialogClose(); + } + }) + } + } + }) + }, + + // 分页大小 + handleSizeChange(val) { + this.limit = val; + this.getList(); + }, + + // 第几页 + handleCurrentChange(val) { + this.page = val; + this.getList(); + }, + + // 加载全部用户 + async wholeUser() { + this.userData = []; + await this.api.getApi("/manager/stu/whole/user").then(res => { + this.userData = res.data + }) + }, + + // 监听类型的变化 + monitorSign(value) { + this.sign = value; + }, } } diff --git a/src/views/system/stuMenu/index.vue b/src/views/system/stuMenu/index.vue index 5407a0b2d6e33a81156a009ecf6a2f50b219cbb5..ef3e1eaabc6257b03b481bcebc83da9cc7b17ec4 100644 --- a/src/views/system/stuMenu/index.vue +++ b/src/views/system/stuMenu/index.vue @@ -21,7 +21,9 @@ :filters="[{ text: '目录', value: 'M' }, { text: '菜单', value: 'C' }, { text: '按钮', value: 'B' }]" :filter-method="filterTag" filter-placement="bottom-end"> @@ -32,7 +34,11 @@ - + + + @@ -47,7 +53,7 @@ @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page" - :page-sizes="[12, 20, 30, 50]" + :page-sizes="[10, 20, 30, 50]" :page-size="limit" layout="total, sizes, prev, pager, next, jumper" :total="total"> @@ -131,7 +137,7 @@ export default { return { total: 1, // 总数 page: 1, // 当前页 - limit: 12, // 分页大小 + limit: 10, // 分页大小 menuName: '', tableData: [], /* 模态框相关 */ @@ -363,7 +369,7 @@ export default { } .bottom-page{ - margin-top: 15px; + margin-top: 25px; } .title-add button {