yuantianjiao 6 年之前
父節點
當前提交
ece1b77b69

+ 8
- 0
package-lock.json 查看文件

15248
         "uppercamelcase": "1.1.0"
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
     "vue-cookie": {
15259
     "vue-cookie": {
15252
       "version": "1.1.4",
15260
       "version": "1.1.4",
15253
       "resolved": "https://registry.npmjs.org/vue-cookie/-/vue-cookie-1.1.4.tgz",
15261
       "resolved": "https://registry.npmjs.org/vue-cookie/-/vue-cookie-1.1.4.tgz",

+ 1
- 0
package.json 查看文件

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

+ 22
- 18
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue 查看文件

82
               size="mini"
82
               size="mini"
83
               type="danger"
83
               type="danger"
84
               @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
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
           </template>
92
           </template>
87
         </el-table-column>
93
         </el-table-column>
88
       </el-table>
94
       </el-table>
201
           v-model="currentCopyUrl"
207
           v-model="currentCopyUrl"
202
           clearable>
208
           clearable>
203
         </el-input>
209
         </el-input>
204
-        <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
205
       </div>
210
       </div>
206
       <span slot="footer" class="dialog-footer">
211
       <span slot="footer" class="dialog-footer">
207
         <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
212
         <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
211
 </template>
216
 </template>
212
 
217
 
213
 <script>
218
 <script>
214
-import Clipboard from 'clipboard'
215
 import { mapState, createNamespacedHelpers } from 'vuex'
219
 import { mapState, createNamespacedHelpers } from 'vuex'
216
 const { mapState: mapGymCardState, mapActions: mapGymCardActions } = createNamespacedHelpers('gymcard')
220
 const { mapState: mapGymCardState, mapActions: mapGymCardActions } = createNamespacedHelpers('gymcard')
217
 const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
221
 const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
220
   name: '',
224
   name: '',
221
   data () {
225
   data () {
222
     return {
226
     return {
227
+      clipboardArr: [],
223
       currentCopyUrl: '',
228
       currentCopyUrl: '',
224
       copyDialogVisible: false,
229
       copyDialogVisible: false,
225
       selectCustomer: [],
230
       selectCustomer: [],
253
       gymCardList: x => x.gymCardList,
258
       gymCardList: x => x.gymCardList,
254
     }),
259
     }),
255
     ...mapState({
260
     ...mapState({
261
+      clientUrl: x => x.app.clientUrl,
256
       cases: x => x.app.cases.list,
262
       cases: x => x.app.cases.list,
257
       defaultCaseId: x => x.app.cases.default
263
       defaultCaseId: x => x.app.cases.default
258
     }),
264
     }),
293
     },
299
     },
294
     toSendCard () { // 赠送卡
300
     toSendCard () { // 赠送卡
295
       if (this.selectCustomer.length) {
301
       if (this.selectCustomer.length) {
296
-        console.log(this.selectCustomer)
297
         this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
302
         this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
298
         this.giveCard({
303
         this.giveCard({
299
           id: this.currentCardId,
304
           id: this.currentCardId,
338
         caseid: this.CaseId || this.defaultCaseId
343
         caseid: this.CaseId || this.defaultCaseId
339
       }).then((res) => {
344
       }).then((res) => {
340
         this.total = res.pagenum
345
         this.total = res.pagenum
341
-        // console.log(JSON.stringify(res))
342
       })
346
       })
343
     },
347
     },
344
     handleCurrentChange (val) { // 跳转到分页
348
     handleCurrentChange (val) { // 跳转到分页
347
     handleEdit (index, row) { // 编辑
351
     handleEdit (index, row) { // 编辑
348
       this.$router.push({ name: 'editBodyBuildingCard', query: { id: row.GymCardId } })
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
 </script>
371
 </script>
382
     }
386
     }
383
   }
387
   }
384
 }
388
 }
385
-.copyBtn{
389
+.copyBtn {
386
   line-height: 29px;
390
   line-height: 29px;
387
   border-radius: 3px;
391
   border-radius: 3px;
388
   color: #fff;
392
   color: #fff;

+ 22
- 2
src/pages/system/cardAndCouponManager/cardManager/index.vue 查看文件

87
               size="mini"
87
               size="mini"
88
               type="danger"
88
               type="danger"
89
               @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
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
           </template>
98
           </template>
92
         </el-table-column>
99
         </el-table-column>
93
       </el-table>
100
       </el-table>
258
       cardList: x => x.cardList,
265
       cardList: x => x.cardList,
259
     }),
266
     }),
260
     ...mapState({
267
     ...mapState({
268
+      clientUrl: x => x.app.clientUrl,
261
       cases: x => x.app.cases.list,
269
       cases: x => x.app.cases.list,
262
       defaultCaseId: x => x.app.cases.default
270
       defaultCaseId: x => x.app.cases.default
263
     }),
271
     }),
380
     },
388
     },
381
     addCard () {
389
     addCard () {
382
       this.$router.push({ name: 'editCard', query: {} })
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
 </script>
406
 </script>

+ 19
- 3
src/pages/system/cardAndCouponManager/couponManager/index.vue 查看文件

89
               type="danger"
89
               type="danger"
90
               @click="sendCoupon(scope.$index, scope.row)">赠送客户</el-button>
90
               @click="sendCoupon(scope.$index, scope.row)">赠送客户</el-button>
91
             <el-button
91
             <el-button
92
-              v-if="scope.row.SendType === 'channel'"
93
               size="mini"
92
               size="mini"
94
               type="success"
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
           </template>
99
           </template>
97
         </el-table-column>
100
         </el-table-column>
98
       </el-table>
101
       </el-table>
246
       customers: x => x.customers,
249
       customers: x => x.customers,
247
     }),
250
     }),
248
     ...mapState({
251
     ...mapState({
252
+      clientUrl: x => x.app.clientUrl,
249
       cases: x => x.app.cases.list,
253
       cases: x => x.app.cases.list,
250
       defaultCaseId: x => x.app.cases.default
254
       defaultCaseId: x => x.app.cases.default
251
     }),
255
     }),
360
         this.centerDialogVisible = false
364
         this.centerDialogVisible = false
361
         this.getList()
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
 </script>
382
 </script>

+ 11
- 6
src/pages/system/dashboard/index.vue 查看文件

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

+ 1
- 1
src/pages/system/dataStatistics/cardCouponList/index.vue 查看文件

171
       })
171
       })
172
     },
172
     },
173
     exportExcel () {
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 查看文件

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

+ 12
- 0
src/store/sta/sta.js 查看文件

156
         }).catch(reject)
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 查看文件

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