xuqiang 4 лет назад
Родитель
Сommit
14de2b310a

+ 127 - 0
src/main/h5/src/components/VideoUpload.vue

@@ -0,0 +1,127 @@
+<template>
+  <div v-if="value && value.src" class="video-wrapper">
+    <video :src="value.src" :poster="value.poster" controls></video>
+    <div class="icon-close" @click="remove" v-if="!readonly">
+      <i class="el-icon-close"></i>
+    </div>
+  </div>
+  <el-upload
+    v-else
+    class="video-upload"
+    :action="videoUploadUrl"
+    :before-upload="beforeUpload"
+    :on-progress="onProgress"
+    :on-success="onSuccess"
+    :on-error="onError"
+    :headers="headers"
+    :show-file-list="false"
+    accept="video/*"
+    :disabled="uploading"
+  >
+    <div class="progress-wrapper" v-if="uploading">
+      <i class="el-icon-loading"></i>
+      <el-progress :stroke-width="4" :percentage="progress"></el-progress>
+    </div>
+    <el-button v-else type="primary" size="mini" plain>上传视频</el-button>
+  </el-upload>
+</template>
+<script>
+import resolveUrl from "resolve-url";
+export default {
+  props: ["value", "readonly"],
+  data() {
+    return {
+      videoUploadUrl: "",
+      uploading: false,
+      progress: 0
+    };
+  },
+  created() {
+    this.videoUploadUrl = resolveUrl(this.$baseUrl, "upload/video");
+  },
+  computed: {
+    headers() {
+      return {
+        Authorization: "Bearer " + sessionStorage.getItem("token")
+      };
+    }
+  },
+  methods: {
+    beforeUpload(file) {
+      console.log(file);
+      const isVideo = /video\/.*/.test(file.type);
+      const isLt100M = file.size / 1024 / 1024 < 200;
+
+      if (!isVideo) {
+        this.$message.error("请上传视频文件!");
+      }
+      if (!isLt100M) {
+        this.$message.error("上传视频大小不能超过 200MB!");
+      }
+      const allow = isVideo && isLt100M;
+      if (allow) {
+        this.progress = 0;
+        this.uploading = true;
+      }
+      return allow;
+    },
+    onSuccess(res, file, fileList) {
+      console.log(res, file, fileList);
+      this.$emit("input", res);
+      this.uploading = false;
+    },
+    onError(err) {
+      console.log(err);
+      this.uploading = false;
+    },
+    onProgress(e) {
+      console.log(e);
+    },
+    remove() {
+      this.$emit("input", null);
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+.video-wrapper {
+  width: 320px;
+  height: 140px;
+  position: relative;
+  margin: 0 auto;
+  .icon-close {
+    width: 25px;
+    height: 25px;
+    border-radius: 50%;
+    color: white;
+    background: #f56c6c;
+    position: absolute;
+    right: -7px;
+    top: -7px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    cursor: pointer;
+    box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.08);
+  }
+  video {
+    width: 100%;
+    height: 100%;
+    outline: none;
+    border-radius: 6px;
+    object-fit: cover;
+    overflow: hidden;
+    background: black;
+  }
+}
+.video-upload {
+  .progress-wrapper {
+    display: flex;
+    height: 28px;
+    align-items: center;
+    .el-progress {
+      width: 350px;
+    }
+  }
+}
+</style>

+ 2 - 1
src/main/h5/src/main.js

@@ -4,6 +4,7 @@ import router from "./router";
 import store from "./store";
 import http from "./plugins/http";
 import ElementUI from "element-ui";
+import VideoUpload from "@/components/VideoUpload";
 import "element-ui/lib/theme-chalk/index.css";
 import Vant from "vant";
 import "vant/lib/index.css";
@@ -14,7 +15,7 @@ Vue.prototype.$colors = {
 };
 
 Vue.use(Vant);
-
+Vue.component("video-upload", VideoUpload);
 Vue.use(ElementUI);
 Vue.use(http);
 Vue.config.productionTip = false;

+ 2 - 2
src/main/h5/src/plugins/http.js

@@ -5,8 +5,8 @@ let baseUrl = "http://localhost:8080";
 switch (process.env.NODE_ENV) {
   case "development":
     // baseUrl = "http://wljtest.izouma.com";
-    baseUrl = "http://localhost:8080";
-    // baseUrl = 'http://192.168.50.190:8080';
+    // baseUrl = "http://localhost:8080";
+    baseUrl = 'http://192.168.50.190:8080';
     break;
   case "test":
     baseUrl = "http://localhost:8080";

+ 92 - 37
src/main/h5/src/views/Home.vue

@@ -16,30 +16,39 @@
       </div>
       <div class="btn" @click="logout">切换账号</div>
     </div>
-
+    <div style="margin-top:20px">
+      <video-upload v-model="info2" class="width"></video-upload>
+    </div>
     <div class="base">
       <div class="base-info">
         <div class="base-info-item">
           <div class="text1">节目名称</div>
-          <div class="text2">{{ info.composition }}</div>
+          <div class="text2">{{ info.name }}</div>
         </div>
         <div class="base-info-item">
           <div class="text1">专业</div>
-          <div class="text2">{{ info.artType }}</div>
+          <div class="text2">{{ info.specialty }}</div>
         </div>
-        <div class="base-info-item">
-          <div class="text1">参演时间</div>
-          <div class="text2" v-if="info.showStartTime">
-            {{ info.showStartTime }} {{ info.showEndTime }}
+        <div v-for="(time, index) in info.participants" :key="index">
+          <div class="base-info-item">
+            <div class="text1">参演时间</div>
+            <div class="text2">
+              {{ time.birthday }}
+            </div>
+          </div>
+          <div class="base-info-item">
+            <div class="text1">证件照</div>
+            <img
+              style="width:60px;height:60px;margin-left:17px"
+              :src="time.img"
+              alt=""
+            />
           </div>
-          <div class="text2" v-else>
-            暂无
+          <div class="base-info-item">
+            <div class="text1">参演人员</div>
+            <div class="text2">{{ time.name }} {{ time.sex }}</div>
           </div>
         </div>
-        <div class="base-info-item">
-          <div class="text1">参演人员</div>
-          <div class="text2">{{ personInfo }}</div>
-        </div>
 
         <div class="base-info-item" v-if="isAdmin">
           <div class="text1">操作状态</div>
@@ -48,7 +57,7 @@
           </div>
         </div>
       </div>
-      <div class="base-info" v-if="info.signInAt && isScore">
+      <!-- <div class="base-info" v-if="info.signInAt && isScore">
         <img class="left-icon icon" src="../assets/icon_lianjie.png" alt="" />
         <img class="right-icon icon" src="../assets/icon_lianjie.png" alt="" />
         <div class="score">
@@ -79,6 +88,39 @@
             </div>
           </div>
         </div>
+      </div> -->
+      <div class="base-info">
+        <img class="left-icon icon" src="../assets/icon_lianjie.png" alt="" />
+        <img class="right-icon icon" src="../assets/icon_lianjie.png" alt="" />
+        <div class="score">
+          <div class="score-main">
+            <div class="name">总得分</div>
+            <div class="val">{{ info.score }}</div>
+          </div>
+
+          <div class="score-main" v-if="!myScore && isAdmin">
+            <div class="name">评分(0-100)</div>
+            <van-field
+              type="digit"
+              input-align="center"
+              v-model="score"
+              :maxlength="3"
+              @change="scoreChange"
+            />
+          </div>
+
+          <div class="score-list">
+            <div
+              class="score-item"
+              v-for="(item, index) in scores"
+              :key="index"
+            >
+              <div class="name">得分明细{{ index + 1 }}</div>
+              <div class="val">{{ item.score }}</div>
+              <div style="margin-left:10px">{{ item.remark }}</div>
+            </div>
+          </div>
+        </div>
       </div>
     </div>
 
@@ -141,6 +183,7 @@ export default {
     return {
       tab: 0,
       info: {},
+      info2: {},
       persons: [],
       isAdmin: false,
       scores: [],
@@ -162,6 +205,9 @@ export default {
             .join(" ")
         : "暂无";
     },
+    programmeId() {
+      return this.$route.query.programmeId;
+    },
     url() {
       return (
         "http://wljtest.izouma.com/home?performanceId=" +
@@ -194,16 +240,21 @@ export default {
     } else {
       this.isAdmin = false;
     }
-    this.getInfo(this.$route.query.programmeId, true);
+    this.getInfo(this.programmeId, true);
+    // this.getInfo();
   },
   methods: {
     getInfo(programmeId, isFirst = false) {
       this.$http
-        .get("/programme/getShow/" + programmeId, {
+        .get("/programme/getScore/" + programmeId, {
           phone: window.localStorage.getItem("loginPhone")
         })
         .then(res => {
           this.info = res;
+          this.info2 = {
+            src: this.info.video
+          };
+          console.log(this.info2);
           if (
             `${programmeId}` === this.$route.query.programmeId &&
             this.isAdmin
@@ -216,27 +267,28 @@ export default {
         })
         .then(res => {
           this.persons = res;
-          if (this.info.signInAt) {
-            if (isFirst) {
-              this.isScore = true;
-            }
-            this.$http
-              .post("/programmeSocre/breakdown?programmeId=" + programmeId)
-              .then(res => {
-                this.scores = res;
-              });
-            if (this.isAdmin) {
-              this.$http
-                .post("/programmeSocre/myScore?programmeId=" + programmeId)
-                .then(res => {
-                  if (res) {
-                    this.myScore = res;
-                  } else {
-                    this.myScore = null;
-                  }
-                });
-            }
+          // if (this.info.signInAt) {
+          if (isFirst) {
+            this.isScore = true;
           }
+          this.$http
+            .post("/programmeScore/breakdown?programmeId=" + programmeId)
+            .then(res => {
+              console.log(res, "111");
+              this.scores = res;
+            });
+          // if (this.isAdmin) {
+          // this.$http
+          //   .post("/programmeSocre/myScore?programmeId=" + programmeId)
+          //   .then(res => {
+          //     if (res) {
+          //       this.myScore = res;
+          //     } else {
+          //       this.myScore = null;
+          //     }
+          //   });
+          // }
+          // }
         })
         .catch(e => {
           if (e) {
@@ -408,11 +460,13 @@ export default {
       .text1 {
         font-weight: bold;
         min-width: 60px;
+        // margin-top: 5px;
       }
 
       .text2 {
         font-size: 16px;
         margin-left: 20px;
+        // margin-top: 5px;
       }
 
       &:not(:first-child) {
@@ -448,7 +502,8 @@ export default {
     display: flex;
     flex-direction: column;
     align-items: center;
-    padding: 47px 0 20px;
+    // padding: 47px 0 20px;
+    padding-bottom: 20px;
 
     .name {
       font-size: 16px;

+ 3 - 1
src/main/vue/src/components/OrganLog.vue

@@ -61,8 +61,10 @@
     </el-dialog>
 </template>
 <script>
+import pageableTable from '@/mixins/pageableTable';
 export default {
     props: ['dialogVisible'],
+    mixins: [pageableTable],
     data() {
         return {
             saving: false,
@@ -101,7 +103,7 @@ export default {
                         this.$message.success('添加成功');
                         this.dialogVisible = false;
                         setTimeout(() => {
-                            this.$router.go(0);
+                            this.getData();
                         }, 1000);
                         // console.log(res);
                     });

+ 1 - 1
src/main/vue/src/views/performance/ArrangeJudgeList.vue

@@ -465,7 +465,7 @@ export default {
                 this.$http.post('/arrangeJudge/cancelAssign', { arranges: arrid.join(',') }).then(res => {
                     this.$message.success('取消成功');
                     setTimeout(() => {
-                        this.$router.go(0);
+                        this.getData();
                     }, 1000);
                 });
             });

+ 3 - 1
src/main/vue/src/views/record/RecordList.vue

@@ -309,7 +309,9 @@ export default {
         },
         onSuccess() {
             this.$message.success('上传成功');
-            this.getData();
+            setTimeout(() => {
+                this.getData();
+            }, 1000);
         },
         beforeUpload() {
             return this.$confirm('确认要上传文件吗?', '提示', {