Ver código fonte

赛事直播

bihuisong 5 meses atrás
pai
commit
35465eed8d

BIN
qmjszx-admin/src/main/resources/static/img/2.png


qmjszx-admin/src/main/resources/static/img/1.png → qmjszx-admin/src/main/resources/static/img/competition_place.png


BIN
qmjszx-admin/src/main/resources/static/img/competition_time.png


BIN
qmjszx-admin/src/main/resources/static/img/competition_type.png


+ 19 - 12
qmjszx-admin/src/main/resources/templates/system/hik/hik.html

@@ -98,7 +98,7 @@
             <div class="select-list">
                 <ul>
                     <li>
-                        <input type="hidden" name="cameraIndexCode" id="cameraIndexCode" th:value="${cameraIndexCode}"/>
+                        <input type="hidden" name="cameraIndexCode" id="cameraIndexCode" th:text="${dataSource}"/>
                     </li>
                 </ul>
             </div>
@@ -112,7 +112,7 @@
                         <div id="player"></div>
                     </a-affix>
                 </a-col>
-<!--                <a-col :span="24" :md="12">-->
+<!--                <a-col :span="24" :md="12"> cameraIndexCode -->
 <!--                    <div class="actions">-->
 <!--                        <a-form :label-col="labelCol" :wrapper-col="wrapperCol" v-show="tabActive !== 'log'">-->
 <!--                            <a-form-item>-->
@@ -131,20 +131,27 @@
     </div>
 <!--    <em style="position:fixed;bottom: 0; font-size: 12px; color:#80817f">温馨提示:双击切换全屏</em>-->
     <div class="saishi_xinxi">
-        <h1>跃动篮球公园第一届大学生篮球比赛</h1>
+        <h1 th:text="${dataSource.competitionTitle}"></h1>
          <ul>
              <li>
-                 <img th:src="@{/img/1.png}" alt="">
+                 <img th:src="@{/img/competition_type.png}" alt="">
                  <div>
-                     <h4>比赛地址:</h4>
-                     <span>吉林省长春市朝阳区顺达阳区顺达阳区顺达阳区顺达阳区顺达路1266号</span>
+                     <h4>赛事类型:</h4>
+                     <span th:text="${dataSource.competitionType}"></span>
                  </div>
              </li>
              <li>
-                 <img th:src="@{/img/2.png}" alt="">
+                 <img th:src="@{/img/competition_time.png}" alt="">
                  <div>
-                     <h4>比赛地址:</h4>
-                     <span>吉林省长春市朝阳区顺达路1266号</span>
+                     <h4>赛事时间:</h4>
+                     <span th:text="${dataSource.competitionTime}"></span>
+                 </div>
+             </li>
+             <li>
+                 <img th:src="@{/img/competition_place.png}" alt="">
+                 <div>
+                     <h4>赛事地址:</h4>
+                     <span th:text="${dataSource.competitionPlace}"></span>
                  </div>
              </li>
          </ul>
@@ -173,13 +180,13 @@
     moment.locale('../../../static/hik/static/js/zh-cn.js');
     const IS_MOVE_DEVICE = document.body.clientWidth < 992 // 是否移动设备
     const MSE_IS_SUPPORT = !!window.MediaSource // 是否支持mse
+    let dataSource = [[${dataSource}]];
     getCameraPreviewURL()
     var prefix = ctx;
-
+    console.log("dataSource",dataSource);
     function getCameraPreviewURL() {
-        // alert(prefix+"ctx")
         $.ajax({
-            url: ('' + prefix).split("undefined")[0] + "/system/hik/getCameraPreviewURL/" + cameraIndexCode.defaultValue,
+            url: ('' + prefix).split("undefined")[0] + "/system/hik/getCameraPreviewURL/" + dataSource.cameraIndexCode,
             type: "GET",
             success: function (res) {
                 let initUrl = res.data;

+ 15 - 8
qmjszx-business/src/main/java/beilv/hik/controller/HiKController.java

@@ -1,9 +1,12 @@
 package beilv.hik.controller;
 
 
+import beilv.common.config.RuoYiConfig;
 import beilv.common.core.controller.BaseController;
 import beilv.common.core.domain.AjaxResult;
 import beilv.hik.controller.utils.GetCameraPreviewURL;
+import beilv.hik.controller.vo.CompetitionInfo;
+import beilv.stadium.domain.Stadium;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
@@ -11,11 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
+import org.springframework.web.servlet.ModelAndView;
 
 
 @Controller
@@ -24,9 +23,17 @@ public class HiKController extends BaseController {
 
     private String prefix = "system/hik";
 
-    @GetMapping("/{cameraIndexCode}")
-    public String hik(@PathVariable("cameraIndexCode") String cameraIndexCode) throws IOException {
-        return prefix + "/hik";
+//    @GetMapping("/{cameraIndexCode}")
+//    public String hik(@PathVariable("cameraIndexCode") String cameraIndexCode) {
+//        return prefix + "/hik";
+//    }
+
+    @GetMapping()
+    public Object hik(CompetitionInfo obj, ModelMap mmap) {
+        ModelAndView modelAndView = new ModelAndView("system/hik/hik");
+        modelAndView.addObject("dataSource", obj);
+        mmap.put("version", RuoYiConfig.getVersion());
+        return modelAndView;
     }
 
     @Value("${hik.appKey}")

+ 18 - 0
qmjszx-business/src/main/java/beilv/hik/controller/vo/CompetitionInfo.java

@@ -0,0 +1,18 @@
+package beilv.hik.controller.vo;
+
+
+import lombok.Data;
+
+@Data
+public class CompetitionInfo {
+
+    private String competitionTitle;
+
+    private String competitionType;
+
+    private String competitionPlace;
+
+    private String cameraIndexCode;
+
+    private String competitionTime;
+}