| <template> |
| <div class="app-container"> |
| <div class="filter-container"> |
| <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="范围名称" v-model="listQuery.fwkzmc"> |
| </el-input> |
| <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查询</el-button> |
| <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate(null, 'create')" type="primary" icon="el-icon-edit">添加</el-button> |
| <el-button class="filter-item" style="margin-left: 10px;" @click="handleReset" type="primary" icon="el-icon-edit">重置</el-button> |
| </div> |
| <el-table :height="height" :data="items" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row> |
| <el-table-column align="center" label='范围控制代码' width="195"> |
| <template slot-scope="scope"> |
| {{scope.row.id}} |
| </template> |
| </el-table-column> |
| <el-table-column label="范围控制名称" align="center"> |
| <template slot-scope="scope"> |
| {{scope.row.fwkzmc}} |
| </template> |
| </el-table-column> |
| <el-table-column label="范围控制实现类" align="center"> |
| <template slot-scope="scope"> |
| <span>{{scope.row.fwkzsxl}}</span> |
| </template> |
| </el-table-column> |
| <el-table-column |
| fixed="right" |
| header-align="center" |
| align="center" |
| width="150" |
| label="操作"> |
| <template slot-scope="scope"> |
| <el-button type="text" size="small" @click="handleCreate(scope.row.id, 'update')">修改</el-button> |
| <el-button type="text" size="small" @click="handleDelete(scope.row.id)">删除</el-button> |
| </template> |
| </el-table-column> |
| </el-table> |
| <div class="pagination-container"> |
| <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.pageIndex" :page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="recordCount"> |
| </el-pagination> |
| </div> |
| |
| <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"> |
| <el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="150px" style='width: 400px; margin-left:50px;'> |
| <el-form-item label="范围控制名称" prop="fwkzmc"> |
| <el-input v-model="temp.fwkzmc"></el-input> |
| <input type="hidden" v-model="temp.id" /> |
| </el-form-item> |
| <el-form-item label="范围控制实现类" prop="fwkzsxl"> |
| <el-input v-model="temp.fwkzsxl"></el-input> |
| </el-form-item> |
| </el-form> |
| <div slot="footer" class="dialog-footer"> |
| <el-button @click="dialogFormVisible = false">返回</el-button> |
| <el-button type="primary" @click="createData">提交</el-button> |
| </div> |
| </el-dialog> |
| </div> |
| </template> |
| |
| <script> |
| import { getList, getItem, createAuditScope, deleteAuditScope } from '@/api/auditscope-api' |
| import waves from '@/directive/waves' // 水波纹指令 |
| import { resetForm } from '@/utils' |
| import { crudPageList, crudGetItem, crudCreate, crudDelete } from '@/utils/crud' |
| import mixindata from '@/utils/crud' |
| |
| const initData = { sfky: '1' } |
| export default { |
| name: 'auditscope', |
| directives: { |
| waves |
| }, |
| mixins: [mixindata], |
| data() { |
| return { |
| ssyxList: [], |
| sszygbList: [], |
| rules: { |
| fwkzmc: [{ required: true, message: '范围控制名称必填', trigger: 'blur' }], |
| fwkzsxl: [{ required: true, message: '范围控制实现类必填', trigger: 'blur' }] |
| } |
| } |
| }, |
| filters: { |
| statusFilter(status) { |
| const statusMap = { |
| '1': 'success', |
| '0': 'danger' |
| } |
| return statusMap[status] |
| } |
| }, |
| created() { |
| this.handlePageList() |
| this.height = window.innerHeight - 216 |
| }, |
| methods: { |
| handlePageList() { |
| crudPageList(this, getList) |
| }, |
| handleCreate(rowid, dialogStatus) { |
| this.dialogStatus = dialogStatus |
| crudGetItem(this, getItem, rowid, initData) |
| }, |
| handleReset() { |
| resetForm(this.listQuery) |
| }, |
| handleFilter() { |
| this.listQuery.pageIndex = 1 |
| this.handlePageList() |
| }, |
| handleSizeChange(val) { |
| this.listQuery.pageSize = val |
| this.handlePageList() |
| }, |
| handleCurrentChange(val) { |
| this.listQuery.pageIndex = val |
| this.handlePageList() |
| }, |
| createData() { |
| crudCreate(this, createAuditScope, this.handlePageList) |
| }, |
| handleDelete(rowid) { |
| crudDelete(this, deleteAuditScope, rowid, this.handlePageList) |
| } |
| } |
| } |
| </script> |