zengyicheng пре 2 година
родитељ
комит
72ca857f22

+ 197 - 5
src/components/pages/race/addRace.vue

@@ -15,20 +15,75 @@
       >
     </div>
     <div class="race_body">
-      <RaceDetail v-if="steps == 1"></RaceDetail>
-      <RaceOverview v-if="steps == 2"></RaceOverview>
-      <ProjectProcess v-if="steps == 3"></ProjectProcess>
-      <ProjectEffect v-if="steps == 4"></ProjectEffect>
+      <RaceDetail
+        v-if="steps == 1"
+        :oid="oid"
+        :userid="userid"
+        :raceInfo="raceInfo"
+        @updateTitle="updateRaceInfoTitle"
+      ></RaceDetail>
+      <RaceOverview
+        v-if="steps == 2"
+        :raceOverView="raceOverView"
+        @upRaceOver="updateRaceOver"
+      ></RaceOverview>
+      <ProjectProcess
+        @upRacePro="updateRacePro"
+        :raceProcess="raceProcess"
+        v-if="steps == 3"
+      ></ProjectProcess>
+      <ProjectEffect
+        @upproEff="updateProEff"
+        :raceEffect="raceEffect"
+        v-if="steps == 4"
+      ></ProjectEffect>
     </div>
     <div class="race_btn">
-      <el-button type="primary" @click="goTo('/eventCenter?userid=' + userid + '&oid=' + oid)">赛事信息</el-button>
+      <el-button
+        type="primary"
+        @click="goTo('/eventCenter?userid=' + userid + '&oid=' + oid)"
+        >赛事信息</el-button
+      >
       <el-button type="primary" @click="lastSteps" v-if="steps != 1"
         >上一步</el-button
       >
       <el-button type="primary" @click="nextSteps" v-if="steps != 4"
         >下一步</el-button
       >
+      <el-button type="primary" @click="addRace" v-if="steps == 4"
+        >确认上传</el-button
+      >
     </div>
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      :append-to-body="true"
+      width="650px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div class="createBox">
+        <div class="success">
+          <img src="../../../assets/icon/success.png" alt="" />
+        </div>
+        <div class="cresteMessage">
+          案例征集必填内容已完成,请在
+          <span>"赛事管理 > 我的案例"中查看。</span> 你可以点击
+          <span>"平台实施填报入口"</span> ,提交选填内容。<span
+            style="color: #9a9a9a"
+            >(填报后可以运用平台进行教学,调用平台工具,收集过程性数据并生成数据报告。)</span
+          >
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="goTo('/eventCenter?userid=' + userid + '&oid=' + oid)"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -49,9 +104,47 @@ export default {
       steps: 1,
       userid: this.$route.query.userid,
       oid: this.$route.query.oid,
+      dialogVisible: false,
+      raceInfo: {
+        title: "",
+        type: [],
+        cover: [],
+        tableData: [],
+        courseText: "",
+      },
+      raceOverView: {
+        driQuestion: { brief: "", data: [] },
+        tarDesign: { brief: "", data: [] },
+        actiDesign: { brief: "", data: [] },
+        evaDesign: { brief: "", data: [] },
+        other: { brief: "", data: [] },
+      },
+      raceProcess: {
+        actBox: [
+          {
+            actName: "",
+            driQuestion: { title: "", brief: "", data: [] },
+            tarDesign: { title: "", brief: "", data: [] },
+            actiDesign: { title: "", brief: "", data: [] },
+            evaDesign: { title: "", brief: "", data: [] },
+          },
+        ],
+      },
+      raceEffect: [
+        {
+          proEffText: "",
+          proRefText: "",
+        },
+      ],
     };
   },
   methods: {
+    handleClose(done) {
+      done();
+    },
+    goTo(path) {
+      this.$router.push(path);
+    },
     checkSteps(steps) {
       this.steps = steps;
     },
@@ -64,11 +157,55 @@ export default {
     goTo(path) {
       this.$router.push(path);
     },
+    updateRaceInfoTitle(raceInfo) {
+      this.raceInfo = raceInfo;
+    },
+    updateRaceOver(raceOver) {
+      this.raceOverView = raceOver;
+    },
+    updateRacePro(racePro) {
+      this.raceProcess = racePro;
+    },
+    updateProEff(raceEff) {
+      this.raceEffect = raceEff;
+    },
+    addRace() {
+      let params = [
+        {
+          uid: this.userid,
+          info: JSON.stringify(this.raceInfo),
+          over: JSON.stringify(this.raceOverView),
+          pro: JSON.stringify(this.raceProcess),
+          res: JSON.stringify(this.raceEffect),
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addRace", params)
+        .then((res) => {
+          this.$message({
+            message: "新增成功",
+            type: "success",
+          });
+          this.dialogVisible = true;
+        })
+        .catch((err) => {
+          this.$message.error("网络不佳");
+          console.error(err);
+        });
+    },
   },
 };
 </script>
 
 <style scoped>
+.dialog_diy >>> .el-dialog__header {
+  background: #3c3c3c !important;
+  padding: 15px 20px;
+}
+
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+}
 .race_nav {
   display: flex;
   align-items: center;
@@ -107,4 +244,59 @@ export default {
   display: flex;
   justify-content: flex-end;
 }
+.createSuccessCss {
+  position: fixed;
+  right: 30%;
+  top: 50%;
+  width: 717px;
+  height: 346px;
+  z-index: 999;
+  background: #fff;
+  border-radius: 30px;
+  overflow: hidden;
+  transform: translateY(-50%);
+  box-shadow: 0px 0 8px 0px #c5c5c5;
+}
+
+.createBox {
+  padding: 0 10px 0 10px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+}
+
+.success {
+  width: 68px;
+  height: 68px;
+}
+
+.success > img {
+  width: 100%;
+  height: 100%;
+}
+
+.cresteMessage {
+  width: 500px;
+  margin-left: 22px;
+  line-height: 50px;
+}
+
+.cresteMessage > span {
+  color: #0f40f5;
+}
+
+.createButton {
+  width: 163px;
+  height: 35px;
+  text-align: center;
+  line-height: 35px;
+  background: #0f40f5 100%;
+  color: #fff;
+  font-size: 14px;
+  border-radius: 4px;
+  position: absolute;
+  right: 74px;
+  bottom: 19px;
+}
 </style>

+ 48 - 255
src/components/pages/race/addRace/projectEffect.vue

@@ -20,210 +20,31 @@
           </div>
         </div>
         <div class="right">
-          <div class="raceTop allBox">
-            <div class="titleTop">
-              <div>项目成效</div>
-              <div>
-                <el-input></el-input>
-              </div>
-            </div>
-            <div class="editorCss">
-              <editor-bar v-model="driQuestion" @change="change"></editor-bar>
-            </div>
-            <div>
-              <div class="basic_box">
-                <div>
-                  <div class="add_chapters_box" v-if="chapterData && chapterData.length == 0" style="height: 185px">
-                  </div>
-                  <div v-else class="add_chapters_box" style="display: flex; flex-direction: column">
-                    <div class="chapter_upload" v-for="(item1, index1) in chapterData" :key="item1.id" @click="
-                      getChapterData(
-                        $event,
-                        unitIndex,
-                        index,
-                        index1,
-                        item1.type
-                      )
-                    ">
-                      <div class="chapter_upload_t"></div>
-                      <div class="chapter_upload_o">
-                        <div class="chapter_upload_l">
-                          <div v-if="item1.type == 2" class="chapter_upload_l_i1"></div>
-                          <div v-if="
-                            item1.type == 3 ||
-                            item1.type == 6 ||
-                            item1.type == 7
-                          " class="chapter_upload_l_i5"></div>
-                          <div v-if="item1.type == 8" class="chapter_upload_l_i8"></div>
-                        </div>
-                        <div class="chapter_upload_ic">
-                          <div class="chapter_upload_ic_l"></div>
-                          <div class="chapter_upload_ic_r">
-                            <!-- @click.stop="
-                              deleteChapterData(
-                                $event,
-                                unitIndex,
-                                index,
-                                index1,
-                                itemTaskIndex
-                              )
-                            " -->
-                            <div></div>
-                          </div>
-                        </div>
-                        <div class="chapter_upload_n">
-                          <input class="first" v-if="
-                            item1.type == 2 ||
-                            item1.type == 3 ||
-                            item1.type == 7
-                          " :placeholder="item1.name" />
-                          <!-- @change="
-                              updataVideoT(
-                                $event,
-                                unitIndex,
-                                chapterIndex,
-                                index1
-                              )
-                            " -->
-                          <input class="first" :placeholder="item1.name" v-if="item1.type == 6" readonly="true" />
-                          <!-- @click="selectAttText(itemTaskIndex, index1)" -->
-                          <input class="first" :placeholder="item1.name" v-if="item1.type == 8" readonly="true" />
-                          <!-- @click="selectLine(itemTaskIndex, index1)" -->
-                          <div class="chapter_upload_ud">
-                            <div class="chapter_upload_up"></div>
-                            <!-- @click="upCd($event, unitIndex, index, index1)" -->
-                            <div class="chapter_upload_down"></div>
-                            <!-- @click="downCd($event, unitIndex, index, index1)" -->
-                          </div>
-                        </div>
-                      </div>
-                    </div>
-                  </div>
-                </div>
-                <div class="add_info_box">
-                  <button class="info_btn" @click="addImg($event)">
-                    添加教学附件
-                    <input type="file"
-                      accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
-                      style="display: none" />
-                    <!-- @change="
-                            beforeUpload2($event, unitIndex, 3, itemTaskIndex)
-                          " -->
-                  </button>
-                </div>
+          <div class="whiteBg">
+            <div class="right_title">项目成效</div>
+            <div class="basic_box1">
+              <div class="editorCss">
+                <editor-bar
+                  v-model="raceEff.proEffText"
+                  @change="upproEff"
+                ></editor-bar>
               </div>
             </div>
           </div>
-          <div class="raceTop allBox">
-            <div class="titleTop">
-              <div>项目反思</div>
-              <div>
-                <el-input></el-input>
-              </div>
-            </div>
-            <div class="editorCss">
-              <editor-bar v-model="driQuestion" @change="change"></editor-bar>
-            </div>
-            <div>
-              <div class="basic_box">
-                <div>
-                  <div class="add_chapters_box" v-if="chapterData && chapterData.length == 0" style="height: 185px">
-                  </div>
-                  <div v-else class="add_chapters_box" style="display: flex; flex-direction: column">
-                    <div class="chapter_upload" v-for="(item1, index1) in chapterData" :key="item1.id" @click="
-                      getChapterData(
-                        $event,
-                        unitIndex,
-                        index,
-                        index1,
-                        item1.type
-                      )
-                    ">
-                      <div class="chapter_upload_t"></div>
-                      <div class="chapter_upload_o">
-                        <div class="chapter_upload_l">
-                          <div v-if="item1.type == 2" class="chapter_upload_l_i1"></div>
-                          <div v-if="
-                            item1.type == 3 ||
-                            item1.type == 6 ||
-                            item1.type == 7
-                          " class="chapter_upload_l_i5"></div>
-                          <div v-if="item1.type == 8" class="chapter_upload_l_i8"></div>
-                        </div>
-                        <div class="chapter_upload_ic">
-                          <div class="chapter_upload_ic_l"></div>
-                          <div class="chapter_upload_ic_r">
-                            <!-- @click.stop="
-                              deleteChapterData(
-                                $event,
-                                unitIndex,
-                                index,
-                                index1,
-                                itemTaskIndex
-                              )
-                            " -->
-                            <div></div>
-                          </div>
-                        </div>
-                        <div class="chapter_upload_n">
-                          <input class="first" v-if="
-                            item1.type == 2 ||
-                            item1.type == 3 ||
-                            item1.type == 7
-                          " :placeholder="item1.name" />
-                          <!-- @change="
-                              updataVideoT(
-                                $event,
-                                unitIndex,
-                                chapterIndex,
-                                index1
-                              )
-                            " -->
-                          <input class="first" :placeholder="item1.name" v-if="item1.type == 6" readonly="true" />
-                          <!-- @click="selectAttText(itemTaskIndex, index1)" -->
-                          <input class="first" :placeholder="item1.name" v-if="item1.type == 8" readonly="true" />
-                          <!-- @click="selectLine(itemTaskIndex, index1)" -->
-                          <div class="chapter_upload_ud">
-                            <div class="chapter_upload_up"></div>
-                            <!-- @click="upCd($event, unitIndex, index, index1)" -->
-                            <div class="chapter_upload_down"></div>
-                            <!-- @click="downCd($event, unitIndex, index, index1)" -->
-                          </div>
-                        </div>
-                      </div>
-                    </div>
-                  </div>
-                </div>
-                <div class="add_info_box">
-                  <button class="info_btn" @click="addImg($event)">
-                    添加教学附件
-                    <input type="file"
-                      accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
-                      style="display: none" />
-                    <!-- @change="
-                            beforeUpload2($event, unitIndex, 3, itemTaskIndex)
-                          " -->
-                  </button>
-                </div>
+          <div class="whiteBg">
+            <div class="right_title">项目反思</div>
+            <div class="basic_box1">
+              <div class="editorCss">
+                <editor-bar
+                  v-model="raceEff.proRefText"
+                  @change="upproEff"
+                ></editor-bar>
               </div>
             </div>
           </div>
         </div>
       </div>
     </div>
-    <div v-if="dialogVisible == true" class="createSuccessCss">
-      <div class="createBox">
-        <div class="success">
-          <img src="../../../../assets/icon/success.png" alt="" />
-        </div>
-        <div class="cresteMessage">
-          案例征集必填内容已完成,请在
-          <span>"赛事管理 > 我的案例"中查看。</span> 你可以点击
-          <span>"平台实施填报入口"</span> ,提交选填内容。<span style="color: #9a9a9a">(填报后可以运用平台进行教学,调用平台工具,收集过程性数据并生成数据报告。)</span>
-        </div>
-      </div>
-      <div class="createButton">平台实施填报入口</div>
-    </div>
   </div>
 </template>
 
@@ -231,12 +52,14 @@
 import EditorBar from "../../../tools/wangEnduit";
 export default {
   components: { EditorBar },
+  props: ["raceEffect"],
   data() {
     return {
       steps: 0,
-      driQuestion: "",
-      chapterData: [],
-      dialogVisible: false,
+      raceEff: {
+        proEffText: "",
+        proRefText: "",
+      },
     };
   },
   methods: {
@@ -256,13 +79,19 @@ export default {
         console.log("还不能下载图片喔");
       }
     },
+    upproEff() {
+      this.$emit("upproEff", this.raceEff);
+    },
+  },
+  created() {
+    this.raceEff.proEffText = this.raceEffect.proEffText;
+    this.raceEff.proRefText = this.raceEffect.proRefText;
   },
-  created() { },
 };
 </script>
 
 <style scoped>
-.pb_content{
+.pb_content {
   width: 100%;
   height: 100%;
 }
@@ -364,13 +193,13 @@ export default {
   padding: 25px;
 }
 
-.allBox>div:nth-child(1) {
+.allBox > div:nth-child(1) {
   color: #0f40f5;
   font-size: 18px;
   font-weight: bold;
 }
 
-.raceTop>div:nth-child(2) {
+.raceTop > div:nth-child(2) {
   width: 80%;
   margin-top: 10px;
 }
@@ -383,7 +212,7 @@ export default {
   width: 100%;
 }
 
-.titleTop>div:nth-child(2) {
+.titleTop > div:nth-child(2) {
   width: 82%;
   margin-left: 20px;
 }
@@ -588,59 +417,23 @@ export default {
   background-color: #4f7cd5 !important;
 }
 
-.createSuccessCss {
-  position: fixed;
-  right: 30%;
-  top: 50%;
-  width: 717px;
-  height: 346px;
-  z-index: 999;
-  background: #fff;
-  border-radius: 30px;
-  overflow: hidden;
-  transform: translateY(-50%);
-  box-shadow: 0px 0 8px 0px #c5c5c5;
-}
-
-.createBox {
-  padding: 53px 53px 0 50px;
-  display: flex;
-  flex-direction: row;
-  flex-wrap: nowrap;
-  align-items: flex-start;
-}
-
-.success {
-  width: 68px;
-  height: 68px;
-}
-
-.success>img {
-  width: 100%;
-  height: 100%;
-}
-
-.cresteMessage {
-  width: 500px;
-  margin-left: 22px;
-  line-height: 50px;
+.right_title {
+  height: 30px;
+  padding: 15px 0 15px 0;
+  border-bottom: 1px solid #f2f2f2;
+  font-size: 1.5em;
+  font-weight: bold;
+  color: #0f7eff;
+  margin: 0 auto;
+  width: 95%;
 }
-
-.cresteMessage>span {
-  color: #0f40f5;
+.whiteBg {
+  background: #fff;
+  border-radius: 10px;
 }
-
-.createButton {
-  width: 163px;
-  height: 35px;
-  text-align: center;
-  line-height: 35px;
-  background: #0f40f5 100%;
-  color: #fff;
-  font-size: 14px;
-  border-radius: 4px;
-  position: absolute;
-  right: 74px;
-  bottom: 19px;
+.basic_box1 {
+  margin: 10px auto;
+  position: relative;
+  padding: 0 20px 0 20px;
 }
 </style>

Разлика између датотеке није приказан због своје велике величине
+ 689 - 338
src/components/pages/race/addRace/projectProcess.vue


+ 479 - 141
src/components/pages/race/addRace/raceDetail.vue

@@ -1,5 +1,5 @@
 <template>
-<!-- 项目基础信息 -->
+  <!-- 项目基础信息 -->
   <div class="pb_content">
     <div class="race_content_body">
       <div class="raceBox">
@@ -38,89 +38,177 @@
           </div>
         </div>
         <div class="right">
-          <div class="raceTop allBox">
-            <div>案例名称</div>
-            <div><el-input></el-input></div>
-          </div>
-          <div class="both">
-            <div class="choose">
-              <div class="all_choose">
-                <!-- v-for="(item, index) in CourseType[0]"
-                :key="index" -->
-                <!-- <span>{{ item.name }}</span> -->
-                <span>组别</span>
-                <el-checkbox-group v-model="courseTypeId">
-                  <el-checkbox>人工智能</el-checkbox>
-                </el-checkbox-group>
-              </div>
-              <div class="all_choose">
-                <!-- v-for="(item, index) in CourseType[0]"
-                :key="index" -->
-                <!-- <span>{{ item.name }}</span> -->
-                <span>年级</span>
-                <el-checkbox-group v-model="courseTypeId">
-                  <el-checkbox>一年级</el-checkbox>
-                  <!-- <el-checkbox
-                    v-for="item1 in CourseTypeJson[item.id]"
-                    :key="item1.id"
-                    :label="item1.id"
-                    >{{ item1.name }}</el-checkbox
-                  > -->
-                </el-checkbox-group>
-              </div>
-              <div class="all_choose">
-                <!-- v-for="(item, index) in CourseType[0]"
-                :key="index" -->
-                <!-- <span>{{ item.name }}</span> -->
-                <span>学科</span>
-                <el-checkbox-group v-model="courseTypeId">
-                  <!-- <el-checkbox
-                    v-for="item1 in CourseTypeJson[item.id]"
-                    :key="item1.id"
-                    :label="item1.id"
-                    >{{ item1.name }}</el-checkbox
-                  > -->
-                  <el-checkbox>语文</el-checkbox>
-                </el-checkbox-group>
+          <div class="whiteBg">
+            <div class="right_title">项目基本信息</div>
+            <div class="basic_box">
+              <div class="big_box">
+                <div class="left_first">
+                  <div>
+                    <div>
+                      <div class="bInfo_title" style="margin-bottom: 15px">
+                        案例名称
+                      </div>
+                      <div style="display: flex; margin-right: 20px">
+                        <img
+                          src="../../../../assets/icon/projectName.png"
+                          alt
+                          style="margin-right: 8px"
+                        />
+                        <input
+                          type="text"
+                          placeholder="请输入项目名称"
+                          class="binfo_input"
+                          v-model="raceDetail.title"
+                          @input="updateTitle"
+                        />
+                      </div>
+                    </div>
+                    <div class="both">
+                      <div class="choose">
+                        <div
+                          class="all_choose"
+                          v-for="(item, index) in CourseType[0]"
+                          :key="index"
+                        >
+                          <span>{{ item.name }}</span>
+                          <el-checkbox-group v-model="raceDetail.type" @change="updateTitle">
+                            <el-checkbox
+                              v-for="item1 in CourseTypeJson[item.id]"
+                              :key="item1.id"
+                              :label="item1.id"
+                              >{{ item1.name }}</el-checkbox
+                            >
+                          </el-checkbox-group>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
               </div>
             </div>
           </div>
-          <div class="picSys allBox">
-            <div>案例封面设置</div>
-            <div class="picBox">
-              <div>
-                <div class="uploadFm" v-if="cover.length == 0">
-                  <img src="../../../../assets/icon/addPoster.png" alt="" />
+          <div class="whiteBg" style="border-radius: 0">
+            <div class="right_first">
+              <div class="right_title">案例封面设置</div>
+              <div class="fmBox">
+                <div>
+                  <div class="bInfo_title" style="margin-top: 0 !important">
+                    案例封面
+                  </div>
+                  <div class="picBox">
+                    <div>
+                      <div
+                        class="uploadFm"
+                        v-if="raceDetail.cover.length === 0"
+                        @click="addImg($event)"
+                      >
+                        <img
+                          src="../../../../assets/icon/addPoster.png"
+                          alt=""
+                        />
+                        <input
+                          type="file"
+                          accept="image/*"
+                          style="display: none"
+                          @change="beforeUpload1"
+                        />
+                      </div>
+                      <el-upload
+                        :class="{ disUoloadSty: noneBtnImg }"
+                        class="upCss"
+                        action="#"
+                        list-type="picture"
+                        v-loading="uploadLoading1"
+                        :http-request="beforeUpload1"
+                        ref="upload1"
+                        :on-preview="handlePictureCardPreview"
+                        :on-remove="handle_remove1"
+                        :show-file-list="true"
+                        :file-list="raceDetail.cover"
+                        accept="image/*"
+                        :limit="1"
+                        :on-exceed="onExceed"
+                        v-else
+                      >
+                        <i class="el-icon-plus"></i>
+                      </el-upload>
+                    </div>
+                  </div>
                 </div>
-                <el-upload
-                  :class="{ disUoloadSty: noneBtnImg }"
-                  class="upCss"
-                  action="#"
-                  list-type="picture"
-                  v-loading="uploadLoading1"
-                  :http-request="beforeUpload1"
-                  ref="upload1"
-                  :on-preview="handlePictureCardPreview"
-                  :on-remove="handle_remove1"
-                  :show-file-list="true"
-                  :file-list="cover"
-                  accept="image/*"
-                  :limit="1"
-                  :on-exceed="onExceed"
-                  v-else
-                >
-                  <i class="el-icon-plus"></i>
-                </el-upload>
-              </div>
-              <div class="picNav">
-                <div>图片要求说明:</div>
-                <div>jpg*,png*,jpeg,且大小不能大于10M</div>
               </div>
             </div>
           </div>
-          <div class="allBox">
-            <div>项目成员</div>
-            <div class="addPeople">添加项目成员</div>
+          <div class="whiteBg" style="border-radius: 0">
+            <div class="right_first">
+              <div class="right_title">项目成员</div>
+              <div class="addPeople" @click="dialogVisibleMember = true">
+                添加学生
+              </div>
+              <div style="width: 97%; margin: 0 auto">
+                <el-table
+                  ref="table"
+                  :data="raceDetail.tableData"
+                  :height="tableHeight"
+                  :fit="true"
+                  style="width: 100%"
+                  :header-cell-style="{
+                    background: '#f1f1f1',
+                    fontSize: '17px',
+                  }"
+                  :row-class-name="tableRowClassName"
+                >
+                  <el-table-column label="姓名" min-width="10" align="center">
+                    <template slot-scope="scope">
+                      <div class="userImg">
+                        <div class="tx">
+                          <img :src="tx" alt />
+                        </div>
+                        <div
+                          style="
+                            width: 50px;
+                            text-align: left;
+                            white-space: nowrap;
+                            overflow: hidden;
+                            text-overflow: ellipsis;
+                          "
+                        >
+                          {{ scope.row.sn }}
+                        </div>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="学科" min-width="15" align="center">
+                    <template slot-scope="scope">
+                      <div>{{ scope.row.su ? scope.row.su : "" }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="学校" min-width="15" align="center">
+                    <template slot-scope="scope">
+                      <div>{{ scope.row.sc ? scope.row.sc : "" }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="邮箱" min-width="15" align="center">
+                    <template slot-scope="scope">
+                      <div>{{ scope.row.em ? scope.row.em : "" }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="电话" min-width="15" align="center">
+                    <template slot-scope="scope">
+                      <div>
+                        {{ scope.row.ph ? scope.row.ph : "" }}
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作" min-width="20">
+                    <template slot-scope="scope">
+                      <div class="delete" @click="deleteStudent(scope.$index)">
+                        <img src="../../../../assets/remove.png" alt />
+                      </div>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
           </div>
           <div class="allBox">
             <div>项目简介</div>
@@ -129,7 +217,8 @@
                 rows="8"
                 class="binfo_input tAreaCss"
                 cols
-                v-model="courseText"
+                v-model="raceDetail.courseText"
+                @input="updateTitle"
               ></textarea>
             </div>
           </div>
@@ -141,62 +230,163 @@
         </div> -->
       </div>
     </div>
+    <el-dialog
+      title="添加项目成员"
+      :visible.sync="dialogVisibleMember"
+      :append-to-body="true"
+      width="700px"
+      height="80%"
+      :before-close="handleClose"
+      class="add_student"
+    >
+      <div slot="title" class="header-title">
+        <div class="logoImg">
+          <img src="../../../../assets/logo.png" alt />
+        </div>
+        <div class="title_add_student">添加学生</div>
+      </div>
+      <el-form>
+        <el-form-item label="学生姓名" :label-width="formLabelWidth">
+          <span>
+            <el-input
+              placeholder="请输入学生姓名"
+              clearable
+              v-model="sName"
+              class="add_input"
+            ></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="学生学科" :label-width="formLabelWidth">
+          <span>
+            <el-input
+              placeholder="请输入学生学科"
+              clearable
+              v-model="sSubject"
+              class="add_input"
+            ></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="学生学校" :label-width="formLabelWidth">
+          <span>
+            <el-input
+              placeholder="请输入学生学校"
+              clearable
+              v-model="sSchool"
+              class="add_input"
+            ></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="学生邮箱" :label-width="formLabelWidth">
+          <span>
+            <el-input
+              placeholder="请输入学生邮箱"
+              clearable
+              v-model="sEmail"
+              class="add_input"
+            ></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="学生电话" :label-width="formLabelWidth">
+          <span>
+            <el-input
+              placeholder="请输入学生电话"
+              clearable
+              v-model="sPhone"
+              class="add_input"
+            ></el-input>
+          </span>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleMember = false">取 消</el-button>
+        <el-button type="primary" @click="isAddPPTeacher">确定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 export default {
+  props: ["userid", "oid" , "raceInfo"],
   data() {
     return {
+      tableHeight: "500px",
+      formLabelWidth: "100px",
       steps: 0,
-      courseTypeId: [],
       CourseType: [],
       CourseTypeJson: [],
-      cover: [],
-      courseText: "",
       noneBtnImg: false,
       uploadLoading1: false,
+      dialogVisibleMember: false,
+      sName: "",
+      sSubject: "",
+      sSchool: "",
+      sEmail: "",
+      sPhone: "",
+      raceDetail: {
+        title: "",
+        type: [],
+        cover: [],
+        tableData: [],
+        courseText: "",
+      },
+      tx: require("../../../../assets/avatar.png"),
     };
   },
+  mounted() {
+    this.$nextTick(function () {
+      this.tableHeight =
+        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+      if (this.tableHeight <= 530) {
+        this.tableHeight = 530;
+      }
+      // 监听窗口大小变化
+      let self = this;
+      window.onresize = function () {
+        self.tableHeight =
+          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+        if (self.tableHeight <= 530) {
+          self.tableHeight = 530;
+        }
+      };
+    });
+  },
   methods: {
+    tableRowClassName({ row, rowIndex }) {
+      if ((rowIndex + 1) % 2 === 0) {
+        return "even_row";
+      } else {
+        return "";
+      }
+    },
     handlePictureCardPreview(file) {
       this.dialogImageUrl = file.url;
     },
     onExceed() {
       this.$message.error("项目封面仅支持上传一张,请删除后再进行上传");
     },
+    handleClose(done) {
+      done();
+    },
     handle_remove1(file, fileList, type) {
-      var _tmp = this.cover;
+      var _tmp = this.raceDetail.cover;
       for (var i = 0, len = _tmp.length; i < len; i++) {
         if (_tmp[i].uid == file.uid) {
           _tmp.splice(i, 1);
           break;
         }
-        this.cover = _tmp;
+        this.raceDetail.cover = _tmp;
       }
       this.noneBtnImg = _tmp.length >= 1;
     },
+    addImg(e) {
+      var el = e.currentTarget;
+      el.getElementsByTagName("input")[0].click();
+    },
     imgChange1(file, fileList, type, itemTaskIndex) {
       if (type == 1) {
-        var _tmp = this.cover;
+        var _tmp = this.raceDetail.cover;
       }
-      //    else if (
-      //     type == 2 ||
-      //     type == 3 ||
-      //     type == 6 ||
-      //     type == 7 ||
-      //     type == 8
-      //   ) {
-      //     var _tmp =
-      //       this.unitJson[this.unitIndex].chapterInfo[0].taskJson[itemTaskIndex]
-      //         .chapterData;
-      //   } else if (type == 4) {
-      //     var _tmp = this.unitJson[this.unitIndex].chapterInfo[0].fileList1;
-      //   } else {
-      //     var _tmp =
-      //       this.unitJson[this.unitIndex].chapterInfo[0].taskJson[itemTaskIndex]
-      //         .homeworkList;
-      //   }
       this.noneBtnImg = _tmp.length >= 1;
     },
     beforeUpload1(event, type) {
@@ -242,7 +432,7 @@ export default {
               a.splice(a.length - 1, a.length);
               _this.$message.error("上传失败");
             } else {
-              _this.cover.push({
+              _this.raceDetail.cover.push({
                 name: file.name,
                 url: data.Location,
                 uid: file.uid,
@@ -253,13 +443,96 @@ export default {
           });
       }
     },
+    updateTitle() {
+      this.$emit("updateTitle", this.raceDetail);
+    },
+    isAddPPTeacher() {
+      if (this.sName === "") {
+        this.$message.error("学生姓名不能为空");
+        return;
+      } else if (this.sSubject === "") {
+        this.$message.error("学生学科不能为空");
+        return;
+      } else if (this.sSchool === "") {
+        this.$message.error("学生学校不能为空");
+      } else if (this.sPhone != "") {
+        if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.sPhone)) {
+          this.$message.error("手机号格式不正确");
+          return;
+        }
+      } else if (this.sEmail != "") {
+        if (
+          !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
+            this.sEmail
+          )
+        ) {
+          this.$message.error("邮箱格式不正确");
+          return;
+        }
+      }
+      this.raceDetail.tableData.push({
+        sn: this.sName,
+        su: this.sSubject,
+        sc: this.sSchool,
+        em: this.sEmail,
+        ph: this.sPhone,
+      });
+      this.sName = "";
+      this.sSubject = "";
+      this.sSchool = "";
+      this.sEmail = "";
+      this.sPhone = "";
+      this.dialogVisibleMember = false;
+      this.$emit("updateTitle", this.raceDetail);
+    },
+    deleteStudent(i) {
+      this.raceDetail.tableData.splice(i, 1);
+      this.$emit("updateTitle", this.raceDetail);
+    },
+    selectType() {
+      this.ajax
+        .get(this.$store.state.api + "selectType")
+        .then((res) => {
+          this.CourseType = res.data;
+          for (var i = 0; i < res.data[0].length; i++) {
+            if (!this.cid) {
+              this.raceDetail.type[res.data[0][i].id] = "";
+            }
+            if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
+              if (res.data[0][i].name == "栏目") {
+                this.CourseType[0][i].name = "主题";
+              }
+            }
+            for (var j = 0; j < res.data[1].length; j++) {
+              if (res.data[0][i].id == res.data[1][j].pid) {
+                if (!this.CourseTypeJson[res.data[0][i].id]) {
+                  this.CourseTypeJson[res.data[0][i].id] = [];
+                }
+                this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
+              }
+            }
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {
+    this.raceDetail.title = this.raceInfo.title;
+    this.raceDetail.type = this.raceInfo.type;
+    this.raceDetail.cover = this.raceInfo.cover;
+    this.raceDetail.tableData = this.raceInfo.tableData;
+    this.raceDetail.courseText = this.raceInfo.courseText;
+    this.imgChange1(null, null, 1, null);
+    this.$forceUpdate();
+    this.selectType();
   },
-  created() {},
 };
 </script>
 
 <style scoped>
-.pb_content{
+.pb_content {
   width: 100%;
   height: 100%;
 }
@@ -372,17 +645,16 @@ export default {
   display: flex;
   flex-direction: row;
   flex-wrap: wrap;
-  width: 90%;
+  width: 100%;
   align-items: center;
   justify-content: flex-start;
-  padding: 0 0 0 25px;
+  margin: 30px 0;
 }
 .all_choose {
   display: flex;
   flex-direction: row;
   align-items: flex-start;
   width: 100%;
-  padding-bottom: 10px;
 }
 
 .all_choose > span {
@@ -480,16 +752,10 @@ export default {
   color: #aaabaa;
 }
 .addPeople {
-  background: #6b92c9;
-  width: 150px;
-  height: 40px;
-  color: #fff;
-  border-radius: 5px;
-  text-align: center;
-  line-height: 40px;
-  font-size: 14px;
+  color: #75a1f4;
+  padding: 10px 20px 10px 0;
+  float: right;
   cursor: pointer;
-  margin-top: 10px;
 }
 .binfo_input {
   font: inherit;
@@ -519,36 +785,108 @@ export default {
 .tAreaCss {
   resize: none;
 }
-/* .buttonCss {
+.addNewPP >>> .el-dialog__body {
+  padding: 5px 20px;
+}
+.customWidth >>> .el-dialog {
+  min-width: 500px !important;
+}
+
+.whiteBg {
+  background: #fff;
+  border-radius: 10px;
+}
+.right_title {
+  height: 30px;
+  padding: 15px 0 15px 20px;
+  border-bottom: 1px solid #f2f2f2;
+  font-size: 1.5em;
+  font-weight: bold;
+  color: #0f7eff;
+  margin: 0 auto;
+}
+.basic_box {
+  margin: 0 auto;
+  position: relative;
+  padding: 0 20px 0 20px;
+}
+.left_first {
   display: flex;
-  flex-direction: row;
+  flex-direction: column;
   flex-wrap: nowrap;
-  align-items: center;
-  justify-content: flex-end;
-  position: absolute;
-    right: 0;
-    bottom: -70px;
 }
-.info_btn {
+.bInfo_title {
+  text-align: left;
+  margin: 10px 0;
+}
+.fmBox {
+  padding: 10px 0 0 20px;
+  display: flex;
+  align-items: baseline;
+  justify-content: flex-start;
+  margin: 0 auto;
+}
+.logoImg {
+  width: 30px;
+}
+.logoImg > img {
+  width: 100%;
+  height: 100%;
+}
+.title_add_student {
+  margin: 0 auto;
   color: #fff;
-  background-color: #0f40f5;
-  padding: 8px 24px;
-  font-size: 0.9375rem;
-  min-width: 64px;
-  font-weight: 500;
-  border-radius: 4px;
-  box-sizing: border-box;
-  border: none;
-  border-radius: 10px;
+}
+.add_input {
+  width: 365px;
+}
+.userImg {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+}
+
+.tx {
+  width: 40px;
+  margin-right: 10px;
+}
+
+.delete {
+  width: 25px;
   cursor: pointer;
-  margin: 0 15px 15px 0;
 }
-.info_btn:hover {
-  background-color: #4f7cd5 !important;
+
+.tx > img,
+.delete > img {
+  width: 100%;
+  height: 100%;
+}
+.add_student >>> .el-dialog__header {
+  padding: 20px 20px 10px;
+  text-align: center;
+  background: #32455b;
+}
+.add_student >>> .el-dialog__title {
+  font-size: 14px !important;
+  color: #fff !important;
+}
+.add_student >>> .el-dialog__headerbtn {
+  font-size: 20px !important;
+}
+.add_student >>> .el-form-item__label {
+  margin-left: 65px;
+}
+.add_student >>> .el-form-item {
+  display: flex;
+}
+.add_student >>> .el-form-item__content {
+  margin: 0 !important;
+}
+.add_student >>> .el-dialog__footer {
+  text-align: center !important;
+}
+.header-title {
+  display: flex;
 }
-.noBg {
-  background: #fff !important;
-  border: 1px solid #c7c7c7 !important;
-  color: #000 !important;
-} */
 </style>

Разлика између датотеке није приказан због своје велике величине
+ 561 - 410
src/components/pages/race/addRace/raceOverview.vue


Неке датотеке нису приказане због велике количине промена