班级表去除备注字段

master
liuyunhu 2024-04-23 19:22:59 +08:00
parent bd1430dd86
commit ef8d1671c4
1 changed files with 26 additions and 23 deletions

View File

@ -34,7 +34,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['custom:class:add']" v-hasPermi="['custom:class:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -45,7 +46,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['custom:class:edit']" v-hasPermi="['custom:class:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -56,7 +58,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['custom:class:remove']" v-hasPermi="['custom:class:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -66,21 +69,21 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['custom:class:export']" v-hasPermi="['custom:class:export']"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="classList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="classList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="班级ID" align="center" prop="classId" /> <el-table-column label="班级ID" align="center" prop="classId"/>
<el-table-column label="班级名称" align="center" prop="className" /> <el-table-column label="班级名称" align="center" prop="className"/>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -89,14 +92,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['custom:class:edit']" v-hasPermi="['custom:class:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['custom:class:remove']" v-hasPermi="['custom:class:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -113,7 +118,7 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="班级名称" prop="className"> <el-form-item label="班级名称" prop="className">
<el-input v-model="form.className" placeholder="请输入班级名称" /> <el-input v-model="form.className" placeholder="请输入班级名称"/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
@ -121,12 +126,10 @@
v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{dict.label}}</el-radio> >{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -137,7 +140,7 @@
</template> </template>
<script> <script>
import { listClass, getClass, delClass, addClass, updateClass } from "@/api/custom/class"; import {addClass, delClass, getClass, listClass, updateClass} from "@/api/custom/class";
export default { export default {
name: "Class", name: "Class",
@ -174,10 +177,10 @@ export default {
// //
rules: { rules: {
className: [ className: [
{ required: true, message: "班级名称不能为空", trigger: "blur" } {required: true, message: "班级名称不能为空", trigger: "blur"}
], ],
status: [ status: [
{ required: true, message: "状态不能为空", trigger: "change" } {required: true, message: "状态不能为空", trigger: "change"}
], ],
} }
}; };
@ -209,8 +212,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null
remark: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -227,7 +229,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.classId) this.ids = selection.map(item => item.classId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -269,12 +271,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const classIds = row.classId || this.ids; const classIds = row.classId || this.ids;
this.$modal.confirm('是否确认删除班级管理编号为"' + classIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除班级管理编号为"' + classIds + '"的数据项?').then(function () {
return delClass(classIds); return delClass(classIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {