| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <template>
- <div class="context">
- <div class="panel">
- <h5>区域管理</h5>
- <el-button id="queryBtn" type="success" @click="query()" :disabled="serachBtnStatus">刷新</el-button>
- <div class="pages">
- <div class="shops" v-for="s in 2">
- <h5> 小飞龙蒙正店</h5>
- <div class="change">
- <el-button type="primary" @click="">新增区域</el-button>
- <el-button @click="" >编辑区域</el-button>
- <el-button @click="" type="danger">删除区域</el-button>
- </div>
- <el-table
- :data="tableData"
- style="width: 100%">
- <el-table-column
- type="index"
- label="序号"
- align="center"
- width="50">
- </el-table-column>
- <el-table-column
- prop="name"
- label="序列号"
- >
- </el-table-column>
- <el-table-column
- prop="name"
- label="类型"
- >
- </el-table-column>
- <el-table-column
- prop="date"
- label="创建日期"
- width="180">
- </el-table-column>
- <el-table-column
- prop="name"
- label="状态"
- >
- </el-table-column>
- <el-table-column
- prop="address"
- label="操作">
- <template slot-scope="scope">
- <el-button type="success" @click="run(scope.row.id)" v-if="state != 4">开启</el-button>
- <el-button type="danger" @click="pause(scope.row.id)">暂停</el-button>
- </template>
- </el-table-column>
- </el-table>
- <br>
- <br>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Global from '../Global.js'
- import {
- testTable,
- testSelect
- } from "../api/getApiRes";
- let qs = require('qs');
- export default {
- data() {
- return {
- tableData:[],
- serachBtnStatus:true
- }
- },
- mounted() {
- this.getTableQuery();
- },
- methods: {
- // 查询按钮
- query() {
- let that = this;
- this.getTableQuery();
- that.serachBtnStatus = true;
- let totalTime = 2
- let clock = window.setInterval(() => {
- totalTime--
- if (totalTime < 0) {
- totalTime = 2;
- that.serachBtnStatus = false;
- }
- }, 1000)
- this.$message.success('查询完毕');
- },
- // 页面数据查询
- getTableQuery() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- testTable(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- if (json.Rs) {
- that.tableData = json.Rs;
- } else {
- that.tableData = [];
- }
- } else {
- that.$message.error(json.Memo + '错误码:' + json.Code);
- }
- })
- },
- }
- }
- </script>
- <style scoped>
- @import "../assets/css/panel.css";
- ul {
- margin: 0;
- padding: 0;
- list-style: none;
- }
- .context {
- height: 770px;
- overflow-y: scroll;
- display: block;
- margin: 0 auto;
- background-color: #fff !important;
- padding: 30px;
- }
- .panel-body {
- padding: 20px;
- background: #F0F2F5;
- }
- .pages {
- width: 100%;
- min-height: 600px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-bottom: 80px;
- }
- .change {
- float: right;
- }
- #queryBtn {
- float: right;
- }
- </style>
|