Procházet zdrojové kódy

彩票站管理查看列表完成

傅行帆 před 4 roky
rodič
revize
c356bc9428

+ 20
- 0
src/api/lottery/shop-api.js Zobrazit soubor

@@ -0,0 +1,20 @@
1
+import request from '@/utils/request'
2
+
3
+const shopApi = {
4
+
5
+}
6
+
7
+/**
8
+ * 获取系统用户分页列表
9
+ * @param data
10
+ * @returns {AxiosPromise}
11
+ */
12
+shopApi.getPageList = data => {
13
+  return request({
14
+    url: '/taShop/getPageList',
15
+    method: 'post',
16
+    data
17
+  })
18
+}
19
+
20
+export default shopApi

+ 30
- 42
src/router/index.js Zobrazit soubor

@@ -79,48 +79,6 @@ export const constantRoutes = [
79 79
       }
80 80
     ]
81 81
   },
82
-  {
83
-    path: '/documentation',
84
-    component: Layout,
85
-    children: [
86
-      {
87
-        path: 'index',
88
-        component: () => import('@/views/documentation/index'),
89
-        name: 'Documentation',
90
-        meta: { title: '文档', icon: 'documentation', affix: true }
91
-      }
92
-    ]
93
-  },
94
-  {
95
-    path: 'swagger',
96
-    component: Layout,
97
-    children: [
98
-      {
99
-        path: 'http://47.105.159.10:8888/api/swagger-ui.html',
100
-        meta: { title: 'SwaggerUI', icon: 'link' }
101
-      }
102
-    ]
103
-  },
104
-  {
105
-    path: 'knife4j',
106
-    component: Layout,
107
-    children: [
108
-      {
109
-        path: 'http://47.105.159.10:8888/api/doc.html',
110
-        meta: { title: 'SwaggerUI', icon: 'link' }
111
-      }
112
-    ]
113
-  },
114
-  {
115
-    path: 'spring-boot-admin',
116
-    component: Layout,
117
-    children: [
118
-      {
119
-        path: 'http://47.105.159.10:8000/instances/58c15acdd00c/details',
120
-        meta: { title: 'SpringBootAdmin', icon: 'link' }
121
-      }
122
-    ]
123
-  },
124 82
   {
125 83
     path: '/profile',
126 84
     component: Layout,
@@ -187,6 +145,36 @@ export const asyncRoutes = [
187 145
 
188 146
     ]
189 147
   },
148
+  {
149
+    path: '/lottery',
150
+    component: Layout,
151
+    redirect: '/lottery/list',
152
+    name: 'lottery',
153
+    meta: {
154
+      title: '彩票站管理',
155
+      icon: 'user'
156
+    },
157
+    children: [
158
+      {
159
+        path: 'manage-lottery-list',
160
+        component: () => import('@/views/lottery/shop/shop-lottery-list'),
161
+        name: 'shopLotteryList',
162
+        meta: { title: '彩票站管理', icon: 'edit' }
163
+      }
164
+      // {
165
+      //   path: 'manage-lottery-list',
166
+      //   component: () => import('@/views/lottery/manage/manage-lottery-list'),
167
+      //   name: 'manageLotteryList',
168
+      //   meta: { title: '彩种管理', icon: 'edit' }
169
+      // },
170
+      // {
171
+      //   path: 'manage-lottery-list2',
172
+      //   component: () => import('@/views/lottery/manage/manage-lottery-list'),
173
+      //   name: 'manageLotteryList2',
174
+      //   meta: { title: '彩票站彩种管理', icon: 'edit' }
175
+      // },
176
+    ]
177
+  },
190 178
   // 404 page must be placed at the end !!!
191 179
   { path: '*', redirect: '/404', hidden: true }
192 180
 ]

+ 206
- 0
src/views/lottery/shop/shop-lottery-list.vue Zobrazit soubor

@@ -0,0 +1,206 @@
1
+<template>
2
+  <div id="sys-user-list" class="app-container">
3
+    <div class="filter-container">
4
+      <el-input v-model="listQuery.name" placeholder="请输入店铺名称" clearable style="width: 160px" />
5
+      <el-select v-model="listQuery.status" placeholder="状态" clearable style="width: 120px">
6
+        <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
7
+      </el-select>
8
+      <el-button v-waves type="primary" icon="el-icon-search" style="width: 115px;" @click="handleFilter">搜索</el-button>
9
+    </div>
10
+
11
+    <el-table
12
+      :key="tableKey"
13
+      v-loading="listLoading"
14
+      :data="list"
15
+      border
16
+      fit
17
+      highlight-current-row
18
+      style="width: 100%;"
19
+      @sort-change="sortChange"
20
+    >
21
+      <el-table-column label="编号" prop="shop_id" sortable="custom" align="center" width="80px" :class-name="getSortClass('shop_id')">
22
+        <template slot-scope="{row}">
23
+          <span>{{ row.shopId }}</span>
24
+        </template>
25
+      </el-table-column>
26
+      <el-table-column label="图标" width="80px" align="center">
27
+        <template slot-scope="{row}">
28
+          <img :src="row.avatar" alt="" style="width: 34px; max-height: 34px; vertical-align: middle;">
29
+        </template>
30
+      </el-table-column>
31
+      <el-table-column label="店铺名称" min-width="100px" align="center">
32
+        <template slot-scope="{row}">
33
+          <span>{{ row.name }}</span>
34
+        </template>
35
+      </el-table-column>
36
+      <el-table-column label="详细地址" min-width="110px" align="center">
37
+        <template slot-scope="{row}">
38
+          <span>{{ row.address }}</span>
39
+        </template>
40
+      </el-table-column>
41
+      <el-table-column label="创建时间" prop="createTime" sortable="custom" min-width="160px" align="center">
42
+        <template slot-scope="{row}">
43
+          <span>{{ row.createDate }}</span>
44
+        </template>
45
+      </el-table-column>
46
+      <el-table-column label="状态" class-name="status-col" width="100" align="center">
47
+        <template slot-scope="{row}">
48
+          <span>{{ row.status | statusFilter }}</span>
49
+        </template>
50
+      </el-table-column>
51
+      <el-table-column label="操作" align="center" width="240" class-name="operation">
52
+        <template slot-scope="{row}">
53
+          <el-link type="warning" @click="handUpdate(row.id)">审核</el-link>
54
+        </template>
55
+      </el-table-column>
56
+    </el-table>
57
+
58
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageIndex" :limit.sync="listQuery.pageSize" @pagination="getList" />
59
+
60
+  </div>
61
+</template>
62
+
63
+<script>
64
+  import waves from '@/directive/waves'
65
+  import Pagination from '@/components/Pagination'
66
+  import shopApi from '@/api/lottery/shop-api'
67
+
68
+  const stateEnum = { 0: '待审核', 1: '已审核', 2: '审核不通过' }
69
+  const statusOptions = [
70
+    { label: '已审核', value: 1 },
71
+    { label: '待审核', value: 0 },
72
+    { label: '审核不通过', value: 2 }
73
+  ]
74
+
75
+  export default {
76
+    name: 'SysUserList',
77
+    components: { Pagination },
78
+    directives: { waves },
79
+    filters: {
80
+      statusFilter(state) {
81
+        return stateEnum[state];
82
+      }
83
+    },
84
+    data() {
85
+      return {
86
+        tableKey: 0,
87
+        list: null,
88
+        total: 0,
89
+        listLoading: true,
90
+        sortColumn: 'create_date',
91
+        sortAsc: false,
92
+        listQuery: {
93
+          pageIndex: 1,
94
+          pageSize: 10,
95
+          status: null,
96
+          name: null,
97
+          pageSorts: []
98
+        },
99
+        statusOptions,
100
+        tableColumnChecked: null
101
+      }
102
+    },
103
+    created() {
104
+      this.setDefaultSort()
105
+      this.getList()
106
+    },
107
+    methods: {
108
+      getList() {
109
+        this.listLoading = true
110
+        shopApi.getPageList(this.listQuery).then(response => {
111
+          this.list = response.data.records
112
+          this.total = response.data.total
113
+          this.listLoading = false
114
+        });
115
+      },
116
+
117
+      handleFilter() {
118
+        this.listQuery.pageIndex = 1
119
+        this.getList()
120
+      },
121
+      setDefaultSort() {
122
+        // 设置默认排序
123
+        this.listQuery.pageSorts = [{
124
+          column: this.sortColumn,
125
+          asc: this.sortAsc
126
+        }]
127
+      },
128
+      sortChange(data) {
129
+        const { prop, order } = data
130
+        if (prop === 'createTime') {
131
+          this.sortColumn = 'create_time'
132
+        } else {
133
+          this.sortColumn = prop
134
+        }
135
+        this.sortAsc = order === 'ascending'
136
+        this.listQuery.pageSorts = [{
137
+          column: this.sortColumn,
138
+          asc: this.sortAsc
139
+        }]
140
+        this.handleFilter()
141
+      },
142
+      getSortClass: function(key) {
143
+        if (this.sortColumn === key) {
144
+          return this.sortAsc ? 'ascending' : 'descending'
145
+        } else {
146
+          return ''
147
+        }
148
+      },
149
+      handUpdate(id, username) {
150
+        this.$confirm('您确定要删除 ' + username + ' ?', '删除提示', {
151
+          confirmButtonText: '确定',
152
+          cancelButtonText: '取消',
153
+          type: 'warning'
154
+        }).then(() => {
155
+          sysUserApi.delete(id).then(response => {
156
+            this.$message({
157
+              type: 'success',
158
+              message: '删除成功!'
159
+            });
160
+            this.handleFilter();
161
+          })
162
+        });
163
+      }
164
+    }
165
+  }
166
+</script>
167
+
168
+<style lang="scss">
169
+  #sys-user-list .el-table th, .el-table td{
170
+    padding: 6px 0px;
171
+  }
172
+
173
+  #sys-user-list .filter-container {
174
+    padding-bottom: 10px;
175
+  }
176
+
177
+  #sys-user-list .filter-container .tree-select-item{
178
+    width: 120px;
179
+    display: inline-block;
180
+    vertical-align: top;
181
+    margin-right: 4px;
182
+  }
183
+
184
+  #sys-user-list .input-with-select {
185
+    vertical-align: top;
186
+    width: 505px;
187
+    margin-right: 4px;
188
+  }
189
+
190
+  #sys-user-list .input-with-select .el-select .el-input {
191
+    width: 120px;
192
+  }
193
+
194
+  #sys-user-list .input-with-select .el-input-group__prepend {
195
+    background-color: #fff;
196
+  }
197
+
198
+  #sys-user-list .filter-item {
199
+    margin-right: 4px;
200
+  }
201
+
202
+  #sys-user-list .el-table__body .operation .cell {
203
+    text-align: center;
204
+  }
205
+
206
+</style>