Ver código fonte

修改赛事问题

zengyicheng 2 anos atrás
pai
commit
5afce55026

+ 6 - 1
src/App.vue

@@ -28,8 +28,13 @@
         <span class="user_name">{{
           this.$store.state.userInfo ? this.$store.state.userInfo.name : "用户"
         }}</span>
-        <div class="settingImg" @click="goTo('/data')"></div>
+        <div
+          class="settingImg"
+          @click="goTo('/data')"
+          v-if="this.$store.state.userInfo.type == 1"
+        ></div>
         <span
+          v-if="this.$store.state.userInfo.type == 1"
           style="
             color: rgb(255, 255, 255);
             margin-right: 20px;

+ 5 - 2
src/components/pages/disAdmin/anliList.vue

@@ -761,12 +761,15 @@ export default {
 .touLeft > div:nth-child(1) {
   display: flex;
   flex-direction: row;
-  flex-wrap: nowrap;
+  flex-wrap: wrap;
   align-items: center;
 }
 
 .touLeft > div > div {
-  margin-right: 10px;
+  margin: 0 10px 10px 0;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
 }
 
 .touRight > div:nth-child(2) > .el-button {

+ 4 - 4
src/components/pages/disAdmin/score.vue

@@ -698,17 +698,17 @@ export default {
   width: 95%;
 }
 
-.touLeft {
+.touLeft > div:nth-child(1) {
   display: flex;
   flex-direction: row;
-  flex-wrap: nowrap;
+  flex-wrap: wrap;
   align-items: center;
 }
 
-.touLeft > div:nth-child(1) {
+.touLeft > div > div {
+  margin: 0 10px 10px 0;
   display: flex;
   flex-direction: row;
-  flex-wrap: nowrap;
   align-items: center;
 }
 

+ 5 - 2
src/components/pages/munAdmin/anliList.vue

@@ -761,12 +761,15 @@ export default {
 .touLeft > div:nth-child(1) {
   display: flex;
   flex-direction: row;
-  flex-wrap: nowrap;
+  flex-wrap: wrap;
   align-items: center;
 }
 
 .touLeft > div > div {
-  margin-right: 10px;
+  margin: 0 10px 10px 0;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
 }
 
 .touRight > div:nth-child(2) > .el-button {

+ 47 - 12
src/components/pages/munAdmin/data.vue

@@ -20,7 +20,11 @@
     </div>
     <div class="pb_content_body" style="position: relative; width: 100%">
       <div style="width: 100%; margin: 0px auto">
-        <div class="data_nav">
+        <div
+          :class="
+            this.$store.state.userInfo.type == 1 ? 'isDataNav' : 'data_nav'
+          "
+        >
           <span @click="type = 1" :class="{ active: type == 1 }">我的资料</span>
           <span @click="type = 2" :class="{ active: type == 2 }">修改密码</span>
         </div>
@@ -30,7 +34,11 @@
           :rules="rules"
           ref="ruleForm"
           label-width="100px"
-          class="demo-ruleForm"
+          :class="
+            this.$store.state.userInfo.type == 1
+              ? 'isDemoRuleForm'
+              : 'demo-ruleForm'
+          "
         >
           <!-- <el-form-item label="姓名" prop="teacherName">
             <el-input
@@ -96,7 +104,12 @@
             >
           </el-form-item>
         </el-form>
-        <div class="password" v-if="type == 2">
+        <div
+          :class="
+            this.$store.state.userInfo.type == 1 ? 'isPassword' : 'password'
+          "
+          v-if="type == 2"
+        >
           <div class="input_box">
             <span>原密码</span>
             <el-input
@@ -215,7 +228,7 @@ export default {
       this.$router.push(path);
     },
     submitForm(formName) {
-      debugger
+      debugger;
       this.$refs[formName];
       this.$refs[formName].validate((valid) => {
         if (valid) {
@@ -367,15 +380,19 @@ export default {
   align-items: center;
 }
 
-.demo-ruleForm {
+.demo-ruleForm,
+.isDemoRuleForm {
   width: 100%;
   display: flex;
   flex-direction: column;
   justify-content: center;
-  align-items: center;
+  align-items: flex-start;
   background: #fff;
   margin-top: 30px;
 }
+.isDemoRuleForm {
+  align-items: center;
+}
 
 /* .demo-ruleForm >>> .el-form-item__label:before {
   content: "*";
@@ -389,15 +406,22 @@ export default {
   width: 300px;
 }
 
-.data_nav {
+.data_nav,
+.isDataNav {
   display: flex;
   align-items: center;
+  justify-content: flex-start;
+  margin: 0 0 10px 150px;
+}
+
+.isDataNav {
   justify-content: center;
   width: 100%;
   margin: 60px 0 10px 0;
 }
 
-.data_nav span {
+.data_nav span,
+.isDataNav span {
   box-sizing: border-box;
   padding: 8px 5px;
   cursor: pointer;
@@ -405,25 +429,36 @@ export default {
   height: 35px;
 }
 
-.data_nav span + span {
+.data_nav span + span,
+.isDataNav span + span {
   margin-left: 20px;
 }
 
-.data_nav .active {
+.data_nav .active,
+.isDataNav .active {
   color: #4aa3ff;
   border-bottom: 2px solid #409eff;
 }
 
-.password {
+.password,
+.isPassword {
   height: 511px;
-  padding: 50px 0 0 0;
+  padding: 10px 0 0 10px;
   box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-start;
   /* display: flex;
   justify-content: center;
   align-items: center;
   flex-direction: column; */
 }
 
+.isPassword {
+  padding: 50px 0 0 0;
+  align-items: center;
+}
+
 .input_box {
   display: flex;
   align-items: center;

+ 5 - 2
src/components/pages/munAdmin/score.vue

@@ -708,12 +708,15 @@ export default {
 .touLeft > div:nth-child(1) {
   display: flex;
   flex-direction: row;
-  flex-wrap: nowrap;
+  flex-wrap: wrap;
   align-items: center;
 }
 
 .touLeft > div > div {
-  margin-right: 10px;
+  margin: 0 10px 10px 0;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
 }
 
 .touRight > div:nth-child(2) > .el-button {

+ 5 - 2
src/components/pages/proAdmin/anliList.vue

@@ -761,12 +761,15 @@ export default {
 .touLeft > div:nth-child(1) {
   display: flex;
   flex-direction: row;
-  flex-wrap: nowrap;
+  flex-wrap: wrap;
   align-items: center;
 }
 
 .touLeft > div > div {
-  margin-right: 10px;
+  margin: 0 10px 10px 0;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
 }
 
 .touRight > div:nth-child(2) > .el-button {

+ 14 - 20
src/components/pages/race/addRace.vue

@@ -507,16 +507,13 @@ export default {
       let params = [
         {
           uid: this.userid,
-          info: JSON.stringify(this.raceInfo).replaceAll(/%/g, "%25"),
-          over: JSON.stringify(this.raceOverView).replaceAll(/%/g, "%25"),
-          pro: JSON.stringify(this.raceProcess).replaceAll(/%/g, "%25"),
-          act: JSON.stringify(this.raceProcess).replaceAll(/%/g, "%25"),
-          exc: JSON.stringify(this.raceExceva).replaceAll(/%/g, "%25"),
-          courseType: JSON.stringify(this.raceInfo.type).replaceAll(
-            /%/g,
-            "%25"
-          ),
-          res: JSON.stringify(this.raceEffect).replaceAll(/%/g, "%25"),
+          info: JSON.stringify(this.raceInfo).replace(/%/g, "%25"),
+          over: JSON.stringify(this.raceOverView).replace(/%/g, "%25"),
+          pro: JSON.stringify(this.raceProcess).replace(/%/g, "%25"),
+          act: JSON.stringify(this.raceProcess).replace(/%/g, "%25"),
+          exc: JSON.stringify(this.raceExceva).replace(/%/g, "%25"),
+          courseType: JSON.stringify(this.raceInfo.type).replace(/%/g, "%25"),
+          res: JSON.stringify(this.raceEffect).replace(/%/g, "%25"),
         },
       ];
       this.ajax
@@ -565,16 +562,13 @@ export default {
       let params = [
         {
           id: this.aid,
-          info: JSON.stringify(this.raceInfo).replaceAll(/%/g, "%25"),
-          over: JSON.stringify(this.raceOverView).replaceAll(/%/g, "%25"),
-          pro: JSON.stringify(this.raceProcess).replaceAll(/%/g, "%25"),
-          act: JSON.stringify(this.raceProcess).replaceAll(/%/g, "%25"),
-          exc: JSON.stringify(this.raceExceva).replaceAll(/%/g, "%25"),
-          res: JSON.stringify(this.raceEffect).replaceAll(/%/g, "%25"),
-          courseType: JSON.stringify(this.raceInfo.type).replaceAll(
-            /%/g,
-            "%25"
-          ),
+          info: JSON.stringify(this.raceInfo).replace(/%/g, "%25"),
+          over: JSON.stringify(this.raceOverView).replace(/%/g, "%25"),
+          pro: JSON.stringify(this.raceProcess).replace(/%/g, "%25"),
+          act: JSON.stringify(this.raceProcess).replace(/%/g, "%25"),
+          exc: JSON.stringify(this.raceExceva).replace(/%/g, "%25"),
+          res: JSON.stringify(this.raceEffect).replace(/%/g, "%25"),
+          courseType: JSON.stringify(this.raceInfo.type).replace(/%/g, "%25"),
           uid: this.userid,
         },
       ];

+ 16 - 9
src/components/pages/race/addRace/projectProcess.vue

@@ -47,7 +47,7 @@
                   @input="upRacePro"
                   disabled
                   placeholder="自动计算"
-                  @change="isNumber($event, saIndex, '', 0)"
+                  @change="isNumber('', saIndex, '', 0)"
                   style="width: 30%"
                 ></el-input>
                 <div class="plaTime">提示:此处将自动计算总课时。</div>
@@ -722,16 +722,14 @@ export default {
     isNumber(e, i, j, t) {
       var numReg = /^[0-9]*$/;
       var numRe = new RegExp(numReg);
-      if (!numRe.test(e)) {
-        this.$message.error("请输入数字!");
-        if (t == 0) {
-          this.racePro.stageBox[i].allTime = "";
-        } else {
+      if (t == 1) {
+        if (!numRe.test(e)) {
+          this.$message.error("请输入数字!");
+          // this.racePro.stageBox[i].allTime = "";
           this.racePro.stageBox[i].actBox[j].actTime = "";
+          return;
         }
-        return;
-      }
-      if (t == 1) {
+
         var a = 0;
         for (var k = 0; k < this.racePro.stageBox[i].actBox.length; k++) {
           if (this.racePro.stageBox[i].actBox[k].actTime != "") {
@@ -743,6 +741,14 @@ export default {
         //   this.$message.error("阶段总课时需等于于阶段下所有任务的课时总数之和!");
         //   this.racePro.stageBox[i].allTime = "";
         // }
+      } else {
+        var a = 0;
+        for (var k = 0; k < this.racePro.stageBox[i].actBox.length; k++) {
+          if (this.racePro.stageBox[i].actBox[k].actTime != "") {
+            a += parseInt(this.racePro.stageBox[i].actBox[k].actTime);
+          }
+        }
+        this.racePro.stageBox[i].allTime = a;
       }
     },
     upRacePro() {
@@ -1068,6 +1074,7 @@ export default {
             _this.racePro.stageBox[si].actBox.splice(i, 1);
             _this.$message.success("删除成功");
             this.upRacePro();
+            this.isNumber("", si, "", 0);
           })
           .catch(() => {
             return;

+ 11 - 5
src/components/pages/race/addRace/raceDetail.vue

@@ -174,7 +174,10 @@
                                   v-model="raceDetail.typeOtherName"
                                   @change="updateTitle"
                                 ></el-input>
-                                <div class="otherIcon" v-if="raceDetail.typeOtherName != ''">
+                                <div
+                                  class="otherIcon"
+                                  v-if="raceDetail.typeOtherName != ''"
+                                >
                                   <img
                                     src="../../../../assets/icon/otherIcon.png"
                                     alt=""
@@ -563,7 +566,7 @@
                           上传附件
                           <input
                             type="file"
-                            accept="application/pdf"
+                            accept="application/pdf,application/zip"
                             style="display: none"
                             @change="beforeUpload($event, null, 0)"
                           />
@@ -1101,9 +1104,12 @@ export default {
       if (
         file.name
           .split(".")
-          [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
+          [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF" &&
+        file.name
+          .split(".")
+          [file.name.split(".").length - 1].toLocaleUpperCase() != "ZIP"
       ) {
-        this.$message.error("请上传PDF文件!");
+        this.$message.error("请上传PDF或者ZIP文件!");
         return;
       }
 
@@ -1251,7 +1257,7 @@ export default {
         } else if (this.sPhone == "") {
           this.$message.error("手机号不能为空");
           return;
-        } else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.sPhone)) {
+        } else if (!/^1[3456789]\d{9}$/.test(this.sPhone)) {
           this.$message.error("手机号格式不正确");
           return;
         } else if (this.sEmail == "") {

+ 137 - 85
src/components/pages/race/eventCenter/anliDetail.vue

@@ -140,17 +140,17 @@
           class="leftNav"
           :class="{ isleftNav: isNavTop >= 300 }"
           v-if="
-          isShow == 1 &&
-          anliBox[0].overview.driQuestion.brief != '' &&
-          anliBox[0].overview.tarDesign.brief != '' &&
-          anliBox[0].overview.actiDesign.brief != '' &&
-          anliBox[0].process.stageBox[0].staTitle != '' &&
-          anliBox[0].process.stageBox[0].actBox[0].actName != '' &&
-          anliBox[0].process.stageBox[0].brief != '' &&
-          anliBox[0].process.stageBox[0].data.length > 0 &&
-          anliBox[0].proexc.brief != '' &&
-          anliBox[0].results.brief != ''
-        "
+            isShow == 1 &&
+            anliBox[0].overview.driQuestion.brief != '' &&
+            anliBox[0].overview.tarDesign.brief != '' &&
+            anliBox[0].overview.actiDesign.brief != '' &&
+            anliBox[0].process.stageBox[0].staTitle != '' &&
+            anliBox[0].process.stageBox[0].actBox[0].actName != '' &&
+            anliBox[0].process.stageBox[0].brief != '' &&
+            anliBox[0].process.stageBox[0].data.length > 0 &&
+            anliBox[0].proexc.brief != '' &&
+            anliBox[0].results.brief != ''
+          "
         >
           <div class="topNav">导航栏</div>
           <div class="navLeftBox">
@@ -259,7 +259,7 @@
                   anliBox[0].info.imgBox.length > 0
                 "
                 class="imgAndNav"
-                style="padding: 0 0 20px 0;"
+                style="padding: 0 0 20px 0"
               >
                 <!-- <div
                 class="leftBox"
@@ -298,7 +298,10 @@
                 />
               </div>
             </div>
-            <div class="whiteBg whiteLeft" style="min-height: 200px;margin-top: 5px;">
+            <div
+              class="whiteBg whiteLeft"
+              style="min-height: 200px; margin-top: 5px"
+            >
               <div
                 class="jdLeftNav"
                 style="margin: 0 0px 0px 15px; color: rgb(112, 112, 120)"
@@ -360,12 +363,12 @@
                             {{ f.name }}
                           </div>
                         </el-tooltip>
-                        <!-- <div class="downFile" @click="downloadFile(f.url)">
-                        <img
-                          src="../../../../assets/icon/anliDetail/down.png"
-                          alt=""
-                        />
-                      </div> -->
+                        <div class="downFile" @click="downloadFile(f.url)">
+                          <img
+                            src="../../../../assets/icon/anliDetail/down.png"
+                            alt=""
+                          />
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -414,6 +417,7 @@
                         style="width: 100%; height: 800px; overflow: auto"
                         :class="{ fullStyle: full }"
                       ></pdf>
+                      <div v-if="pptImgUrl2.infoData.showType == 5"></div>
                       <!-- <vword
                           v-else-if="pptImgUrl2.infoData.showType == 2"
                           :pdfUrl="pptImgUrl2.infoData.url"
@@ -643,12 +647,15 @@
                                     {{ f.name }}
                                   </div>
                                 </el-tooltip>
-                                <!-- <div class="downFile" @click="downloadFile(f.url)">
-                          <img
-                            src="../../../../assets/icon/anliDetail/down.png"
-                            alt=""
-                          />
-                        </div> -->
+                                <div
+                                  class="downFile"
+                                  @click="downloadFile(f.url)"
+                                >
+                                  <img
+                                    src="../../../../assets/icon/anliDetail/down.png"
+                                    alt=""
+                                  />
+                                </div>
                               </div>
                             </div>
                           </div>
@@ -847,12 +854,15 @@
                                     {{ f.name }}
                                   </div>
                                 </el-tooltip>
-                                <!-- <div class="downFile" @click="downloadFile(f.url)">
-                          <img
-                            src="../../../../assets/icon/anliDetail/down.png"
-                            alt=""
-                          />
-                        </div> -->
+                                <div
+                                  class="downFile"
+                                  @click="downloadFile(f.url)"
+                                >
+                                  <img
+                                    src="../../../../assets/icon/anliDetail/down.png"
+                                    alt=""
+                                  />
+                                </div>
                               </div>
                             </div>
                           </div>
@@ -1643,12 +1653,15 @@
                                       {{ f.name }}
                                     </div>
                                   </el-tooltip>
-                                  <!-- <div class="downFile" @click="downloadFile(f.url)">
-                            <img
-                              src="../../../../assets/icon/anliDetail/down.png"
-                              alt=""
-                            />
-                          </div> -->
+                                  <div
+                                    class="downFile"
+                                    @click="downloadFile(f.url)"
+                                  >
+                                    <img
+                                      src="../../../../assets/icon/anliDetail/down.png"
+                                      alt=""
+                                    />
+                                  </div>
                                 </div>
                               </div>
                             </div>
@@ -1853,12 +1866,15 @@
                                     {{ f.name }}
                                   </div>
                                 </el-tooltip>
-                                <!-- <div class="downFile" @click="downloadFile(f.url)">
-                          <img
-                            src="../../../../assets/icon/anliDetail/down.png"
-                            alt=""
-                          />
-                        </div> -->
+                                <div
+                                  class="downFile"
+                                  @click="downloadFile(f.url)"
+                                >
+                                  <img
+                                    src="../../../../assets/icon/anliDetail/down.png"
+                                    alt=""
+                                  />
+                                </div>
                               </div>
                             </div>
                           </div>
@@ -2060,12 +2076,15 @@
                                     {{ f.name }}
                                   </div>
                                 </el-tooltip>
-                                <!-- <div class="downFile" @click="downloadFile(f.url)">
-                          <img
-                            src="../../../../assets/icon/anliDetail/down.png"
-                            alt=""
-                          />
-                        </div> -->
+                                <div
+                                  class="downFile"
+                                  @click="downloadFile(f.url)"
+                                >
+                                  <img
+                                    src="../../../../assets/icon/anliDetail/down.png"
+                                    alt=""
+                                  />
+                                </div>
                               </div>
                             </div>
                           </div>
@@ -2579,6 +2598,11 @@ export default {
         ) {
           this.pptImgUrl2.infoData.showType = 1;
           this.pptImgUrl2.infoData.url = u;
+        } else if (
+          u.split(".")[u.split(".").length - 1].toLocaleUpperCase() == "ZIP"
+        ) {
+          this.pptImgUrl2.infoData.showType = 5;
+          this.pptImgUrl2.infoData.url = u;
         } else if (
           c.indexOf(
             u.split(".")[u.split(".").length - 1].toLocaleUpperCase()
@@ -2819,6 +2843,11 @@ export default {
             ].toLocaleUpperCase() == "PDF"
         ) {
           this.pptImgUrl2.infoData.showType = 1;
+        } else if (
+          u.split(".")[u.split(".").length - 1].toLocaleUpperCase() == "ZIP"
+        ) {
+          this.pptImgUrl2.infoData.showType = 5;
+          this.pptImgUrl2.infoData.url = u;
         } else if (
           c.indexOf(
             this.pptImgUrl2.infoData.url
@@ -3098,42 +3127,65 @@ export default {
         this.pptImgUrl1.fileType.effType = 1;
       }
     },
-    // downloadFile(url) {
-    //   let _url = "";
-    //   if (
-    //     url.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
-    //   ) {
-    //     _url = url.split(
-    //       "https://view.officeapps.live.com/op/view.aspx?src="
-    //     )[1];
-    //   } else {
-    //     _url = url;
-    //   }
-    //   const x = new XMLHttpRequest();
-    //   x.open("GET", _url, true);
-    //   x.responseType = "blob";
-    //   x.onload = function (e) {
-    //     // const url = window.URL.createObjectURL(x.response);
-    //     // const a = document.createElement("a");
-    //     // a.href = url;
-    //     // a.target = "_blank";
-    //     // a.download = url;
-    //     // a.click();
-    //     // a.remove();
-    //     let content = x.response;
-    //     let elink = document.createElement("a");
-    //     elink.download = decodeURI(
-    //       _url.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
-    //     );
-    //     elink.style.display = "none";
-    //     let blob = new Blob([content]);
-    //     elink.href = URL.createObjectURL(blob);
-    //     document.body.appendChild(elink);
-    //     elink.click();
-    //     document.body.removeChild(elink);
-    //   };
-    //   x.send();
-    // },
+    downloadFile(url) {
+      // var imgBox = [
+      //   "BMP",
+      //   "PJP",
+      //   "APNG",
+      //   "PNG",
+      //   "JPG",
+      //   "GIF",
+      //   "SVG",
+      //   "JPEG",
+      //   "JPG",
+      //   "ICO",
+      //   "PGPEG",
+      //   "AVIF",
+      // ];
+      // if (
+      //   imgBox.indexOf(
+      //     url
+      //       .split(".")
+      //       [url.split(".").length - 1].toLocaleUpperCase()
+      //   ) != -1
+      // ) {
+      //   download = url;
+      // }
+      let _url = "";
+      if (
+        url.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+      ) {
+        _url = url.split(
+          "https://view.officeapps.live.com/op/view.aspx?src="
+        )[1];
+      } else {
+        _url = url;
+      }
+      const x = new XMLHttpRequest();
+      x.open("GET", _url, true);
+      x.responseType = "blob";
+      x.onload = function (e) {
+        // const url = window.URL.createObjectURL(x.response);
+        // const a = document.createElement("a");
+        // a.href = url;
+        // a.target = "_blank";
+        // a.download = url;
+        // a.click();
+        // a.remove();
+        let content = x.response;
+        let elink = document.createElement("a");
+        elink.download = decodeURI(
+          _url.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
+        );
+        elink.style.display = "none";
+        let blob = new Blob([content]);
+        elink.href = URL.createObjectURL(blob);
+        document.body.appendChild(elink);
+        elink.click();
+        document.body.removeChild(elink);
+      };
+      x.send();
+    },
     jump(t) {
       var a = document.getElementById(t);
       var b = this.$refs["cenBox"];

+ 2 - 2
src/components/pages/race/eventCenter/myAnli.vue

@@ -35,14 +35,14 @@
         <div class="anliMiddle">
           <div class="anliBox">
             <div class="anliImg">
-              <img
+              <!-- <img
                 :src="
                   JSON.parse(an.info).cover && JSON.parse(an.info).cover.length
                     ? JSON.parse(an.info).cover[0].url
                     : noBanner
                 "
                 alt=""
-              />
+              /> -->
             </div>
             <div class="anliNav">
               <div>项目名称:{{ JSON.parse(an.info).title }}</div>