| | |
| | | <TableLayout :permissions="['business:category:query']"> |
| | | <!-- 搜索表单 --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请输入名称" @keypress.enter.native="search"></el-input> |
| | | <el-form-item label="老师等级" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请输入老师等级" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="searchForm.status" placeholder="请选择状态" @change="search"> |
| | | <el-option label="全部" value=""></el-option> |
| | | <el-option label="启用" value="0"></el-option> |
| | | <el-option label="禁用" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">搜索</el-button> |
| | |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('新建老师等级',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:category:create']">新建</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" :selectable="isChangeSelected" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="名称" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="老师等级" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="图标" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image v-if="row.iconFull" style="width: 50px; height: 50px; margin-right: 10px" :src="row.iconFull" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="描述" min-width="100px"></el-table-column> |
| | | <el-table-column prop="sortnum" label="排序码" min-width="100px"></el-table-column> |
| | | <el-table-column prop="sortnum" label="等级顺序" min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateUserName" label="操作人" min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="最近操作时间" min-width="150px"></el-table-column> |
| | | <el-table-column |
| | |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('编辑老师等级', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:category:update']">编辑</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | // 搜索 |
| | | searchForm: { |
| | | name: '', |
| | | status: '', |
| | | type: 3 |
| | | } |
| | | } |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | deleteById (row, childConfirm = true, call) { |
| | | this.__checkApi() |
| | | let message = `确认删除老师等级数据吗?` |
| | | if (childConfirm && row.children != null && row.children.length > 0) { |
| | | message = `确认删除老师等级数据吗?` |
| | | } |
| | | this.$dialog.deleteConfirm(message) |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | this.api.deleteById(row[this.configData['field.id']]) |
| | | .then(() => { |
| | | this.__afterDelete() |
| | | if (call) { |
| | | call() |
| | | } |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | deleteByIdInBatch (childConfirm = true, call) { |
| | | this.__checkApi() |
| | | if (this.tableData.selectedRows.length === 0) { |
| | | this.$tip.warning('请至少选择一条数据') |
| | | return |
| | | } |
| | | let message = `确认删除老师等级数据吗?` |
| | | if (childConfirm) { |
| | | const containChildrenRows = [] |
| | | for (const row of this.tableData.selectedRows) { |
| | | if (row.children != null && row.children.length > 0) { |
| | | containChildrenRows.push(row[this.configData['field.main']]) |
| | | } |
| | | } |
| | | if (containChildrenRows.length > 0) { |
| | | message = `确认删除老师等级数据吗?` |
| | | } |
| | | } |
| | | this.$dialog.deleteConfirm(message) |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | this.api.deleteByIdInBatch(this.tableData.selectedRows.map(row => row[this.configData['field.id']]).join(',')) |
| | | .then(() => { |
| | | this.__afterDelete(this.tableData.selectedRows.length) |
| | | if (call) { |
| | | call() |
| | | } |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | isChangeSelected(row,index){ |
| | | // if(row.isFixed ==1) { |
| | | // return false |