Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/vue-intergration-platform

xiaochan 1 year ago
parent
commit
bf6711b7b2

+ 7 - 0
src/api/single-page/lottery.js

@@ -21,4 +21,11 @@ export function recordLotteryResult(data) {
         method: 'post',
         data
     })
+}
+
+export function selectWonUsers() {
+    return request({
+        url: '/lottery/selectWonUsers',
+        method: 'get',
+    })
 }

+ 32 - 6
src/views/single-page/Lottery.vue

@@ -40,6 +40,11 @@
           <el-button style="width: 200px" size="large" :disabled="duringLottery"
                      type="danger" icon="Star" @click="startLottery">开始抽奖
           </el-button>
+          <div style="margin-top: 12px">
+            <span class="show-history" @click="showHistory">
+              查看中奖记录
+            </span>
+          </div>
         </div>
       </div>
     </template>
@@ -61,13 +66,22 @@
           <canvas id="canvas"></canvas>
         </div>
       </div>
+
+      <el-drawer v-model="historyVisible" title="中奖记录">
+        <el-table :data="historyWonUsers" stripe>
+          <el-table-column prop="codeRs" label="工号"></el-table-column>
+          <el-table-column prop="name" label="姓名"></el-table-column>
+          <el-table-column prop="wonName" label="中奖"></el-table-column>
+        </el-table>
+      </el-drawer>
+
     </template>
   </page-layer>
 </template>
 <script setup>
 import PageLayer from "@/layout/PageLayer.vue";
 import {ElMessage, ElMessageBox} from "element-plus";
-import {selectLotteryUsers, chooseWinner, recordLotteryResult} from "@/api/single-page/lottery";
+import {selectLotteryUsers, chooseWinner, recordLotteryResult, selectWonUsers} from "@/api/single-page/lottery";
 
 const lotteryPool = ref([])
 const lotteryUsers = ref([])
@@ -146,7 +160,6 @@ function winnerExposed() {
       element.style.removeProperty('transition-timing-function');
       element.style.removeProperty('transform-origin');
       element.style.removeProperty('transform');
-
     }, 600);
   })
 
@@ -200,6 +213,15 @@ function editRule(item) {
   })
 }
 
+const historyVisible = ref(false)
+const historyWonUsers = ref([])
+function showHistory () {
+  selectWonUsers().then(res => {
+    historyWonUsers.value = res
+    historyVisible.value = true
+  })
+}
+
 onMounted(() => {
   let storage = localStorage.getItem('lotteryPool')
   if (storage) {
@@ -214,9 +236,6 @@ onMounted(() => {
 })
 
 
-
-
-
 let canvas, canvasContext, w, h, particles = [], probability = 0.04,
     xPoint, yPoint;
 const fireworkRunnable = ref(false)
@@ -343,9 +362,16 @@ Particle.prototype = {
   color: red;
   font-size: 12px
 }
-
 .reset-pool:hover {
   cursor: pointer;
   text-decoration: underline;
 }
+
+.show-history {
+  color: #c2c2c2;
+}
+.show-history:hover {
+  cursor: pointer;
+  text-decoration: underline;
+}
 </style>

+ 1 - 1
src/views/surgical-management/SurgeryArrangement.vue

@@ -651,7 +651,7 @@ const statisticsRequest = reactive({
   statisticsLabel: 'BY_DEPARTMENT'
 })
 const statisticsDateRange = ref([])
-const surgeryStatisticsVisible = ref(true)
+const surgeryStatisticsVisible = ref(false)
 const surgeryStatistics = ref([])
 
 function showSurgeryStatistics() {