yuantianjiao 6 anos atrás
pai
commit
ece1b77b69

+ 8
- 0
package-lock.json Ver arquivo

@@ -15248,6 +15248,14 @@
15248 15248
         "uppercamelcase": "1.1.0"
15249 15249
       }
15250 15250
     },
15251
+    "vue-clipboard2": {
15252
+      "version": "0.2.1",
15253
+      "resolved": "https://registry.npmjs.org/vue-clipboard2/-/vue-clipboard2-0.2.1.tgz",
15254
+      "integrity": "sha512-n6ie/0g0bKohmLlC/5ja1esq2Q0jQ5hWmhNSZcvCsWfDeDnVARjl6cBB9p72XV1nlVfuqsZcfV8HTjjZAIlLBA==",
15255
+      "requires": {
15256
+        "clipboard": "2.0.1"
15257
+      }
15258
+    },
15251 15259
     "vue-cookie": {
15252 15260
       "version": "1.1.4",
15253 15261
       "resolved": "https://registry.npmjs.org/vue-cookie/-/vue-cookie-1.1.4.tgz",

+ 1
- 0
package.json Ver arquivo

@@ -24,6 +24,7 @@
24 24
     "js-md5": "^0.7.3",
25 25
     "vue": "^2.5.2",
26 26
     "vue-amap": "^0.5.8",
27
+    "vue-clipboard2": "^0.2.1",
27 28
     "vue-cookie": "^1.1.4",
28 29
     "vue-fullcalendar": "^1.0.9",
29 30
     "vue-morris": "0.0.13",

+ 22
- 18
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue Ver arquivo

@@ -82,7 +82,13 @@
82 82
               size="mini"
83 83
               type="danger"
84 84
               @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
85
-            <a v-if="scope.row.SendType === 'channel'" class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
85
+            <el-button
86
+              size="mini"
87
+              type="success"
88
+              v-clipboard:copy="this.clientUrl + '/receiveChannelShared/' + scope.row.GymCardId + '/' + scope.row.GymTypeId + '/receive'"
89
+              v-clipboard:success="onCopy"
90
+              v-clipboard:error="onError"
91
+              >点击复制链接</el-button>
86 92
           </template>
87 93
         </el-table-column>
88 94
       </el-table>
@@ -201,7 +207,6 @@
201 207
           v-model="currentCopyUrl"
202 208
           clearable>
203 209
         </el-input>
204
-        <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
205 210
       </div>
206 211
       <span slot="footer" class="dialog-footer">
207 212
         <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
@@ -211,7 +216,6 @@
211 216
 </template>
212 217
 
213 218
 <script>
214
-import Clipboard from 'clipboard'
215 219
 import { mapState, createNamespacedHelpers } from 'vuex'
216 220
 const { mapState: mapGymCardState, mapActions: mapGymCardActions } = createNamespacedHelpers('gymcard')
217 221
 const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
@@ -220,6 +224,7 @@ export default {
220 224
   name: '',
221 225
   data () {
222 226
     return {
227
+      clipboardArr: [],
223 228
       currentCopyUrl: '',
224 229
       copyDialogVisible: false,
225 230
       selectCustomer: [],
@@ -253,6 +258,7 @@ export default {
253 258
       gymCardList: x => x.gymCardList,
254 259
     }),
255 260
     ...mapState({
261
+      clientUrl: x => x.app.clientUrl,
256 262
       cases: x => x.app.cases.list,
257 263
       defaultCaseId: x => x.app.cases.default
258 264
     }),
@@ -293,7 +299,6 @@ export default {
293 299
     },
294 300
     toSendCard () { // 赠送卡
295 301
       if (this.selectCustomer.length) {
296
-        console.log(this.selectCustomer)
297 302
         this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
298 303
         this.giveCard({
299 304
           id: this.currentCardId,
@@ -338,7 +343,6 @@ export default {
338 343
         caseid: this.CaseId || this.defaultCaseId
339 344
       }).then((res) => {
340 345
         this.total = res.pagenum
341
-        // console.log(JSON.stringify(res))
342 346
       })
343 347
     },
344 348
     handleCurrentChange (val) { // 跳转到分页
@@ -347,21 +351,21 @@ export default {
347 351
     handleEdit (index, row) { // 编辑
348 352
       this.$router.push({ name: 'editBodyBuildingCard', query: { id: row.GymCardId } })
349 353
     },
350
-    toCopy (index, row) { // 复制
351
-      console.log(1)
352
-      var clipboard = new Clipboard(this.$refs['copy' + index])
353
-      clipboard.on('success', e => {
354
-        console.log('复制成功')
355
-        clipboard.destroy()
354
+    addCard () {
355
+      this.$router.push({ name: 'editBodyBuildingCard', query: {} })
356
+    },
357
+    onCopy () {
358
+      this.$message({
359
+        type: 'success',
360
+        message: '复制成功!'
356 361
       })
357
-      clipboard.on('error', e => {
358
-        console.log('该浏览器不支持自动复制')
359
-        clipboard.destroy()
362
+    },
363
+    onError () {
364
+      this.$message({
365
+        type: 'error',
366
+        message: '复制失败!'
360 367
       })
361 368
     },
362
-    addCard () {
363
-      this.$router.push({ name: 'editBodyBuildingCard', query: {} })
364
-    }
365 369
   }
366 370
 }
367 371
 </script>
@@ -382,7 +386,7 @@ export default {
382 386
     }
383 387
   }
384 388
 }
385
-.copyBtn{
389
+.copyBtn {
386 390
   line-height: 29px;
387 391
   border-radius: 3px;
388 392
   color: #fff;

+ 22
- 2
src/pages/system/cardAndCouponManager/cardManager/index.vue Ver arquivo

@@ -87,7 +87,14 @@
87 87
               size="mini"
88 88
               type="danger"
89 89
               @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
90
-            <a v-if="scope.row.SendType === 'channel'" class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
90
+            <el-button
91
+              size="mini"
92
+              type="success"
93
+              v-if="scope.row.SendType === 'channel'"
94
+              v-clipboard:copy="clientUrl + '/receiveChannelShared/' + scope.row.CardId + '/card/receive'"
95
+              v-clipboard:success="onCopy"
96
+              v-clipboard:error="onError"
97
+              >点击复制链接</el-button>
91 98
           </template>
92 99
         </el-table-column>
93 100
       </el-table>
@@ -258,6 +265,7 @@ export default {
258 265
       cardList: x => x.cardList,
259 266
     }),
260 267
     ...mapState({
268
+      clientUrl: x => x.app.clientUrl,
261 269
       cases: x => x.app.cases.list,
262 270
       defaultCaseId: x => x.app.cases.default
263 271
     }),
@@ -380,7 +388,19 @@ export default {
380 388
     },
381 389
     addCard () {
382 390
       this.$router.push({ name: 'editCard', query: {} })
383
-    }
391
+    },
392
+    onCopy () {
393
+      this.$message({
394
+        type: 'success',
395
+        message: '复制成功!'
396
+      })
397
+    },
398
+    onError () {
399
+      this.$message({
400
+        type: 'error',
401
+        message: '复制失败!'
402
+      })
403
+    },
384 404
   }
385 405
 }
386 406
 </script>

+ 19
- 3
src/pages/system/cardAndCouponManager/couponManager/index.vue Ver arquivo

@@ -89,10 +89,13 @@
89 89
               type="danger"
90 90
               @click="sendCoupon(scope.$index, scope.row)">赠送客户</el-button>
91 91
             <el-button
92
-              v-if="scope.row.SendType === 'channel'"
93 92
               size="mini"
94 93
               type="success"
95
-              @click="handleDelete(scope.$index, scope.row)">点击复制链接</el-button>
94
+              v-if="scope.row.SendType === 'channel'"
95
+              v-clipboard:copy="clientUrl + '/receiveChannelShared/' + scope.row.CouponId + '/coupon/receive'"
96
+              v-clipboard:success="onCopy"
97
+              v-clipboard:error="onError"
98
+              >点击复制链接</el-button>
96 99
           </template>
97 100
         </el-table-column>
98 101
       </el-table>
@@ -246,6 +249,7 @@ export default {
246 249
       customers: x => x.customers,
247 250
     }),
248 251
     ...mapState({
252
+      clientUrl: x => x.app.clientUrl,
249 253
       cases: x => x.app.cases.list,
250 254
       defaultCaseId: x => x.app.cases.default
251 255
     }),
@@ -360,7 +364,19 @@ export default {
360 364
         this.centerDialogVisible = false
361 365
         this.getList()
362 366
       })
363
-    }
367
+    },
368
+    onCopy () {
369
+      this.$message({
370
+        type: 'success',
371
+        message: '复制成功!'
372
+      })
373
+    },
374
+    onError () {
375
+      this.$message({
376
+        type: 'error',
377
+        message: '复制失败!'
378
+      })
379
+    },
364 380
   }
365 381
 }
366 382
 </script>

+ 11
- 6
src/pages/system/dashboard/index.vue Ver arquivo

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="subPage">
3 3
     <div class="selectCase">
4
-      <el-select v-model="CaseId" placeholder="请选择">
4
+      <el-select v-model="postData.caseid" placeholder="请选择">
5 5
         <el-option
6 6
           v-for="item in cases"
7 7
           :key="item.CaseId"
@@ -39,7 +39,7 @@
39 39
 </template>
40 40
 
41 41
 <script>
42
-import { mapState } from 'vuex'
42
+import { mapState, createNamespacedHelpers } from 'vuex'
43 43
 import dashboardList from '../../../components/dashboardList/index'
44 44
 import histogram from '../../../components/histogram/index'
45 45
 import pieDiagram from '../../../components/pieDiagram/index'
@@ -47,6 +47,7 @@ import brokenLineGraph from '../../../components/brokenLineGraph/index'
47 47
 import ringChart from '../../../components/ringChart/index'
48 48
 import dashboard from '../../../components/dashboard/index'
49 49
 import brokenLineGraphGroup from '../../../components/brokenLineGraphGroup/index'
50
+const { mapActions: mapStaActions } = createNamespacedHelpers('sta')
50 51
 
51 52
 export default {
52 53
   name: '',
@@ -102,13 +103,17 @@ export default {
102 103
   },
103 104
   mounted () {
104 105
     this.$nextTick(function () {
105
-      this.drawHistogram()
106
+      this.getDashboardData({
107
+        caseid: this.postData.caseid
108
+      }).then((res) => {
109
+        console.log(JSON.stringify(res))
110
+      })
106 111
     })
107 112
   },
108 113
   methods: {
109
-    drawHistogram () { // 绘制柱状图
110
-      // this.histogramInit.source(this.histogramParams)
111
-    },
114
+    ...mapStaActions([
115
+      'getDashboardData',
116
+    ]),
112 117
   }
113 118
 }
114 119
 </script>

+ 1
- 1
src/pages/system/dataStatistics/cardCouponList/index.vue Ver arquivo

@@ -171,7 +171,7 @@ export default {
171 171
       })
172 172
     },
173 173
     exportExcel () {
174
-      window.location.href = `${this.toolClass.ReplaceOrg(this.$api.statistics.cardCouponListExcel.url)}?token=${localStorage.getItem('JWT')}`
174
+      window.open(`${this.toolClass.ReplaceOrg(this.$api.statistics.cardCouponListExcel.url)}?token=${localStorage.getItem('JWT')}`, '_blank')
175 175
     },
176 176
   }
177 177
 }

+ 3
- 0
src/store/index.js Ver arquivo

@@ -2,7 +2,10 @@ import Vue from 'vue'
2 2
 import Vuex from 'vuex'
3 3
 import Ajax from '../util/ajax'
4 4
 import api from '../util/api'
5
+import VueClipboard from 'vue-clipboard2'
6
+
5 7
 Vue.use(Vuex)
8
+Vue.use(VueClipboard)
6 9
 
7 10
 const store = new Vuex.Store({
8 11
   state: {

+ 12
- 0
src/store/sta/sta.js Ver arquivo

@@ -156,5 +156,17 @@ export default {
156 156
         }).catch(reject)
157 157
       })
158 158
     },
159
+    getDashboardData ({ commit }, payload) {
160
+      return new Promise((resolve, reject) => {
161
+        ajax(api.statistics.dashboardData.url, {
162
+          method: api.statistics.dashboardData.method,
163
+          queryData: {
164
+            ...payload,
165
+          }
166
+        }).then(res => {
167
+          resolve(res)
168
+        }).catch(reject)
169
+      })
170
+    },
159 171
   }
160 172
 }

+ 4
- 0
src/util/api.js Ver arquivo

@@ -748,6 +748,10 @@ const $api = {
748 748
       url: `${baseUrl}${common}/statistics/cardcouponverify/excel`
749 749
     },
750 750
   },
751
+  dashboardData: {
752
+    method: 'get',
753
+    url: `${baseUrl}${common}/dashboard`
754
+  },
751 755
   health: {
752 756
     healthList: {
753 757
       method: 'get',