123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <div class="subPage">
- <div class="system-table-search">
- <div class="flex-h">
- <div class="flex-item flex-h">
- <el-button size="mini" type="success" @click="redirection('addCase')">新增案场</el-button>
- </div>
- <tableSearch value="请输入案场名称" @exportSearchKey="searchList"></tableSearch>
- </div>
- <div class="moreFilter"></div>
- </div>
- <div class="system-table-box">
- <el-table
- :data="currentList"
- stripe
- style="width: 100%">
- <el-table-column
- prop="CaseId"
- label="ID">
- </el-table-column>
- <el-table-column
- prop="CaseName"
- label="案场名称">
- </el-table-column>
- <el-table-column
- prop="CaseAddress"
- label="地址">
- </el-table-column>
- <el-table-column label="操作" width="200">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="warning"
- @click="editItem(scope.$index, scope.row)">编辑</el-button>
- <!-- <el-button
- size="mini"
- type="success"
- @click="keyManager(scope.$index, scope.row)">钥匙管理</el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page.sync="postData.page"
- :page-size="postData.pagesize"
- layout="prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </template>
-
- <script>
- import tableSearch from '@/components/tableSearch/index'
-
- export default {
- name: '',
- data () {
- return {
- total: 0,
- postData: { // 表格搜索条件
- name: '', // 案场名称
- page: 0, // 当前页码
- pagesize: 10, // 请求数据量
- },
- currentList: []
- }
- },
- components: {
- tableSearch,
- },
- mounted () {
- this.$nextTick(function () { })
- },
- created () {
- this.getList()
- },
- methods: {
- getList () { // 获取列表
- this.$ajax(this.$api.caseManager.getCaseList.url, {
- method: this.$api.caseManager.getCaseList.method,
- queryData: this.postData
- }).then(res => {
- this.currentList = res.list
- this.postData.page = res.page
- this.total = res.pagenum
- })
- },
- redirection (pathName) { // 重定向
- this.$router.push({ name: pathName })
- },
- handleCurrentChange (val) { // 跳转到分页
- this.getList()
- },
- editItem (index, row) { // 修改
- // console.log(index, row)
- this.$router.push({ name: 'editCase', query: { id: row.CaseId } })
- },
- keyManager (index, row) { // 钥匙管理
- console.log(index, row)
- },
- searchList (key) { // 搜索列表
- this.postData.name = key
- this.currentList = []
- this.postData.page = 0
- this.getList()
- }
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- @import "page.scss";
- </style>
|