Selaa lähdekoodia

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

zengyicheng 2 vuotta sitten
vanhempi
commit
363974804a

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.8cb9f1808c6fb4a68a3c78503863688f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.107be5c8cc06ac64330b.js></script><script type=text/javascript src=./static/js/app.15aaf5dfaa0507b5f13a.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.93798c445882e86ab1a59e3950c4363a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.107be5c8cc06ac64330b.js></script><script type=text/javascript src=./static/js/app.dc1728a1ad0f64c1223d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.8cb9f1808c6fb4a68a3c78503863688f.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.8cb9f1808c6fb4a68a3c78503863688f.css.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.93798c445882e86ab1a59e3950c4363a.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.93798c445882e86ab1a59e3950c4363a.css.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.15aaf5dfaa0507b5f13a.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.dc1728a1ad0f64c1223d.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.dc1728a1ad0f64c1223d.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 5 - 1
src/components/pages/GM/notice.vue

@@ -366,7 +366,11 @@ export default {
 .cont>>>table th {
   border-bottom: 1px solid #ccc;
   border-right: 1px solid #ccc;
-  padding: 3px 5px;
+  /* padding: 20px 5px; */
+  padding: 5px 10px;
+  max-width: 0px;
+  height: 30px;
+  vertical-align: baseline;
 }
 
 .cont>>>table th {

+ 11 - 4
src/components/pages/addCourse.vue

@@ -208,7 +208,7 @@
                     </div>
                     <div style="flex: 0.5 1 0%; margin: 0;width:180px" v-if="courseUserid != '' ? courseUserid == userid : true">
                       <div class="bInfo_title">协同编辑</div>
-                      <div class="addPeople" @click="dialogVisibleMember = true" style="background: #6b92c9">
+                      <div class="addPeople" @click="openMember" style="background: #6b92c9">
                         添加协同成员
                       </div>
                       <div v-if="checkboxList3.length"
@@ -5344,6 +5344,11 @@ export default {
         this.checkEva(this.checkId);
       }, 0);
     },
+    openMember(){
+            this.searchTN = ''
+            this.getTeacher();
+            this.dialogVisibleMember = true
+        },
     checkEva(id) {
       this.selectEva();
       this.evalua = id;
@@ -6553,15 +6558,17 @@ export default {
 .cont>>>table th {
   border-bottom: 1px solid #ccc;
   border-right: 1px solid #ccc;
-  padding: 20px 5px;
+  /* padding: 20px 5px; */
+  padding: 5px 10px;
   max-width: 0px;
+  height: 30px;
+  vertical-align: baseline;
 }
 
 .cont>>>table th {
   border-bottom: 2px solid #ccc;
   text-align: center;
 }
-
 /* blockquote 样式 */
 .cont>>>blockquote {
   display: block;
@@ -7977,7 +7984,7 @@ ol {
 }
 
 .t_j_box span:nth-child(3) {
-  width: calc(55% - 20px);
+  max-width: calc(55% - 20px);
   overflow: hidden;
   text-overflow: ellipsis;
 }

+ 38 - 3
src/components/pages/components/proMan.vue

@@ -9,7 +9,14 @@
           </div>
           <div class="rwTop" v-if="item2.tcMember && item2.tcMember.length">
             <div class="rwTouImg" style="background:#ff9219"></div>
-            <div><span class="tcMember" v-for="(mam,mIndex) in item2.tcMember" :key="mIndex">{{ getMan(mam) }}</span></div>
+            <!-- <div class="xtBox"><span class="tcMember" v-for="(mam, mIndex) in item2.tcMember" :key="mIndex">{{ getMan(mam) }}</span>
+            </div> -->
+            <el-tooltip :content="getMen(item2.tcMember)" placement="top" effect="dark">
+              <div class="xtBox"><span class="tcMember" v-for="(mam, mIndex) in item2.tcMember" :key="mIndex">{{
+                getMan(mam)
+              }}</span>
+              </div>
+            </el-tooltip>
           </div>
           <div class="rwTop" v-else>
             <div class="rwTouImg" style="background:#ff9219"></div>
@@ -70,6 +77,25 @@ export default {
         return time.getFullYear() ? s2 : '无'
       }
     },
+    getMen() {
+      return function (people) {
+        let _people = people
+        let kp = []
+        if (this.ManAarray.length) {
+          for (var k = 0; k < _people.length; k++) {
+            let person = _people[k]
+            for (var i = 0; i < this.ManAarray.length; i++) {
+              if (this.ManAarray[i].userid == person) {
+                // _people = this.ManAarray[i].name;
+                kp.push(this.ManAarray[i].name)
+                break;
+              }
+            }
+          }
+        }
+        return this.ManAarray.length ? (kp.length ? kp.join('、') : '') : ''
+      }
+    },
     getMan() {
       return function (people) {
         let _people = people
@@ -81,7 +107,7 @@ export default {
             }
           }
         }
-        return _people ? _people : '无' 
+        return _people ? _people : '无'
       }
     },
   },
@@ -130,9 +156,11 @@ export default {
   flex-wrap: nowrap;
   align-items: top;
 }
-.rwTop + .rwTop{
+
+.rwTop+.rwTop {
   margin-top: 5px;
 }
+
 .rwTouImg {
   min-width: 13px;
   height: 13px;
@@ -189,4 +217,11 @@ export default {
 .tcMember+.tcMember::before {
   content: '、';
 }
+
+.xtBox {
+  max-width: 100%;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
 </style>

+ 348 - 0
src/components/pages/components/voteStatic.vue

@@ -0,0 +1,348 @@
+<template>
+  <div class="sjBox" v-if="askJSONC && askJSONC.askJson">
+    <div class="a_add_title">
+      <div style="font-size: 25px"><spna style="color:rgb(113, 113, 113);">投票标题:</spna>{{ askJSONC.askTitle }}</div>
+    </div>
+    <div class="a_addBox">
+      <div
+        class="a_add_box"
+        v-for="(item, index) in askJSONC.askJson"
+        :key="index"
+      >
+        <div class="a_add_head">
+          <div>
+            <span>{{ index + 1 + "、" + item.askstitle }}</span>
+          </div>
+          <!-- <el-button
+            type="primary"
+            @click="getA(checkJson[index].checkPerson, item.checkList)"
+            >查看</el-button
+          > -->
+        </div>
+        <div class="a_add_body">
+          <div class="a_add_input width100">
+            <div class="a_add_persent a_add_persent_div a_add_persent_title">
+              <span>投票选项</span><span>投票小计</span><span>投票比例</span>
+            </div>
+            <div class="a_add_persent">
+              <div
+                class="a_add_persent_div"
+                v-for="(item1, checkIndex) in item.askItem"
+                :key="checkIndex"
+              >
+                <span
+                  ><span
+                    style="max-width: calc(100% - 40px); width: auto"
+                    v-html="item.checkList[checkIndex]"
+                  ></span
+                ></span>
+                <span>{{
+                  checkJson[index].checkCount[checkIndex]
+                    ? checkJson[index].checkCount[checkIndex]
+                    : 0
+                }}</span>
+                <span>
+                  <el-progress
+                    :percentage="
+                      checkJson[index].checkPerent[checkIndex]
+                        ? checkJson[index].checkPerent[checkIndex]
+                        : 0
+                    "
+                    :show-text="false"
+                  ></el-progress>
+                </span>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <el-dialog
+      title="查看"
+      :visible.sync="dialogVisible"
+      :append-to-body="true"
+      width="900px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div>
+        <div v-for="(item, index) in timu" :key="index" class="borderB">
+          <div v-html="item" class="s_title"></div>
+          <div class="stuBox" style="margin-top: 20px; align-items: flex-start">
+            <div style="margin: 0 0 10px 0; min-width: 70px; color: #adadad">
+              选择:
+            </div>
+            <div class="stuBox" style="flex-wrap: wrap">
+              <span
+                class="studentClass"
+                v-for="(pe, pi) in person[index]"
+                :key="index + '-' + pi"
+                >{{ pe }}</span
+              >
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogVisible = false"
+          >关 闭</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["askJSON", "checkJson"],
+  data() {
+    return {
+      askJSONC: {},
+      dialogVisible: false,
+      person: [],
+      timu: [],
+      checkJson2: [],
+    };
+  },
+  watch: {
+    askJSON(val) {
+      this.askJSONC = this.askJSON ? JSON.parse(this.askJSON)[0] : {};
+    },
+  },
+  methods: {
+    handleClose(done) {
+      done();
+    },
+    getA(person, timu) {
+      this.person = person;
+      this.timu = timu;
+      this.dialogVisible = true;
+    },
+  },
+  watch: {
+    checkJson: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.askJSONC = this.askJSON ? this.askJSON : {};
+        for (var i = 0; i < this.checkJson.length; i++) {
+          // debuggerA
+          let el = this.checkJson[i];
+          console.log(el);
+        }
+        this.checkJson2 = this.checkJson;
+      },
+    },
+  },
+  mounted() {
+    // this.askJSONC = this.askJSON ? JSON.parse(this.askJSON)[0] : {};
+    this.askJSONC = this.askJSON ? this.askJSON : {};
+    for (var i = 0; i < this.checkJson.length; i++) {
+      let el = this.checkJson[i];
+      console.log(el);
+    }
+    this.checkJson2 = this.checkJson;
+  },
+};
+</script>
+
+<style scoped>
+.sjBox {
+  margin-top: 25px;
+  /* max-height: 420px; */
+  overflow: auto;
+}
+
+.a_addBox {
+  margin: 20px 0;
+  background: #fff;
+  padding: 10px 20px;
+  border-radius: 4px;
+}
+
+.a_add_box {
+  border-bottom: 2px solid #eee;
+  padding-bottom: 10px;
+}
+
+.a_add_head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin: 10px 0;
+  font-size: 18px;
+}
+
+.a_add_head .a_add_head_input {
+  width: 300px;
+}
+
+.a_add_head .a_add_head_div {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.a_add_head_div img {
+  cursor: pointer;
+  width: 23px;
+}
+
+.a_add_head_div img + img {
+  margin-left: 10px;
+}
+
+.a_add_body {
+  display: flex;
+  align-items: center;
+}
+
+.a_add_input {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  /* flex-direction: column; */
+  /* width: 100%; */
+}
+
+.width100 {
+  width: 100%;
+}
+
+.a_add_input .a_add_persent {
+  /* display: flex; */
+  /* flex-direction: column; */
+  width: 100%;
+}
+
+.a_add_persent_div {
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+
+.a_add_persent_div span {
+  margin: 5px 0;
+}
+
+.a_add_persent_div span:nth-child(1) {
+  width: 30%;
+}
+
+.a_add_persent_div span:nth-child(2) {
+  width: 7%;
+}
+
+.a_add_persent_div span:nth-child(3) {
+  width: 40%;
+}
+
+.sjBox::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 6px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  height: 6px;
+}
+
+/*定义滚动条轨道 内阴影+圆角*/
+.sjBox::-webkit-scrollbar {
+  border-radius: 10px;
+  background-color: #eee;
+}
+
+/*定义滑块 内阴影+圆角*/
+.sjBox::-webkit-scrollbar-thumb {
+  border-radius: 10px;
+  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+  background-color: rgba(0, 0, 0, 0.1);
+}
+
+.right {
+  color: rgb(0 123 255);
+  position: relative;
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+
+/* .right::after {
+  content: "";
+  background-image: url(../../assets/right.png);
+  min-width: 15px;
+  min-height: 15px;
+  background-size: 100% 100%;
+  margin: 0 10px;
+} */
+
+.dialog_diy >>> .el-dialog__header,
+.dialog_diy1 >>> .el-dialog__header {
+  background: #002e81 !important;
+  padding: 15px 20px;
+}
+
+.dialog_diy >>> .el-dialog__title,
+.dialog_diy1 >>> .el-dialog__title {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn,
+.dialog_diy1 >>> .el-dialog__headerbtn {
+  top: 19px;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close,
+.dialog_diy1 >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover,
+.dialog_diy1 >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+
+.dialog_diy1 >>> .el-dialog__body {
+  padding: 0;
+}
+
+.dialog_diy >>> .el-dialog__body,
+.dialog_diy >>> .el-dialog__footer,
+.dialog_diy1 >>> .el-dialog__footer {
+  background: #fafafa;
+}
+
+.s_title {
+  /* margin-top: 10px; */
+  font-size: 18px;
+  margin-bottom: 10px;
+  word-break: break-word;
+  /* min-width: calc(100% / 2 - 200px); */
+}
+
+.stuBox {
+  display: flex;
+  /* flex-wrap: wrap; */
+  align-items: center;
+}
+
+.studentClass {
+  background: #46a1eb;
+  color: #fff;
+  width: 90px;
+  height: 25px;
+  text-align: center;
+  line-height: 25px;
+  border-radius: 5px;
+  margin: 0 15px 0 0;
+  white-space: nowrap;
+  overflow: hidden;
+  padding: 5px;
+  text-overflow: ellipsis;
+  font-size: 16px;
+  margin-bottom: 10px;
+}
+
+.borderB {
+  margin-bottom: 10px;
+  border-bottom: 1px solid #d8d8d8;
+}
+</style>

+ 1 - 1
src/components/pages/student.vue

@@ -955,7 +955,7 @@ export default {
       } else if (!this.userinfo.classid) {
         this.$message.error("请为学生选择班级");
         return;
-      } else if (this.userinfo.phonenumber != "" && !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.userinfo.phonenumber)) {
+      } else if (this.userinfo.phonenumber && !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.userinfo.phonenumber)) {
         this.$message.error("手机号格式不正确");
         return;
       } else if (

+ 360 - 55
src/components/pages/student/addCourse.vue

@@ -223,7 +223,7 @@
                                         <div style="flex: 0.5 1 0%; margin: 0;width:180px"
                                             v-if="courseUserid != '' ? courseUserid == userid : true">
                                             <div class="bInfo_title">协同编辑</div>
-                                            <div class="addPeople" @click="dialogVisibleMember = true"
+                                            <div class="addPeople" @click="openMember"
                                                 style="background: #6b92c9">
                                                 添加协同成员
                                             </div>
@@ -232,7 +232,8 @@
                                                 <span :class="{ tcMember: getMan2(tc) }"
                                                     v-for="(tc, tcIndex) in checkboxList3" :key="tcIndex">{{
                                                         getMan2(tc)
-                                                    }}</span></div>
+                                                    }}</span>
+                                            </div>
                                         </div>
                                     </div>
                                 </div>
@@ -881,6 +882,9 @@
                                                         <span v-if="itemTool.tool == 55">
                                                             压缩文件
                                                         </span>
+                                                        <span v-if="itemTool.tool == 56">
+                                                            投票
+                                                        </span>
                                                     </div>
                                                     <div class="remove" @click="deleteTool(itemTaskIndex, toolIndex)"
                                                         v-if="itemTask.toolArray.length > 0"
@@ -995,6 +999,13 @@
                                                             </div>
                                                         </div>
                                                     </div>
+                                                    <div class="tool" v-if="itemTool.tool == 56">
+                                                        <div class="whiteBIcon"
+                                                            @click="openToolFun(56, itemTaskIndex, toolIndex)">
+                                                            <img src="../../../assets/icon/thirdToolList/ask.png" alt />
+                                                            <div style="margin: 5px 0">投票</div>
+                                                        </div>
+                                                    </div>
                                                     <div v-if="itemTool.tool == 51">
                                                         <div class="vedioTaskBox">
                                                             <div class="box_course"
@@ -1134,6 +1145,9 @@
                                                         <img v-if="photo.type == 12"
                                                             src="../../../assets/icon/word2.png" alt=""
                                                             @click="openText(photo.content)">
+                                                        <img v-if="photo.type == 14"
+                                                            src="../../../assets/icon/word2.png" alt=""
+                                                            @click="openAsk(photo.content, itemTaskIndex, toolIndex)">
                                                         <img v-if="photo.type == 13" src="../../../assets/icon/zip.png"
                                                             alt="" @click="downloadFile(photo.content)">
                                                         <img v-if="photo.type == 5"
@@ -1141,7 +1155,7 @@
                                                             @click="openVideo(photo.content)">
                                                         <img class="deleteImg" src="../../../assets/deleteworks.png"
                                                             v-if="
-                                                                photo.userid == userid
+                                                                photo.userid == userid && (itemTool.tool != 52 && itemTool.tool != 48)
                                                             " @click.stop="deleteWorks(photo.id)" alt />
                                                         <div class="comment">
                                                             <div class="worksName">
@@ -1150,6 +1164,13 @@
                                                         </div>
                                                     </div>
                                                 </div>
+
+                                                <div v-if="
+                                                    itemTool.toolPhoto.length &&
+                                                    itemTool.tool == 56
+                                                ">
+                                                    <voteStatic :askJSON="itemTool.askJson" :checkJson="checkJson[toolIndex]"></voteStatic>
+                                                </div>
                                             </div>
                                             <div class="addToolFunBox">
                                                 <div class="addToolFun" @click="addToolFunD(itemTaskIndex)">
@@ -1963,6 +1984,12 @@
                                         <div style="margin: 5px 0">压缩文件</div>
                                     </div>
                                 </div>
+                                <div class="tool">
+                                    <div class="whiteBIcon" @click="addToolFun(56)">
+                                        <img src="../../../assets/icon/thirdToolList/ask.png" alt />
+                                        <div style="margin: 5px 0">投票</div>
+                                    </div>
+                                </div>
                             </div>
                         </div>
                     </div>
@@ -2253,6 +2280,137 @@
                     关 闭</el-button>
             </div>
         </el-dialog>
+        <el-dialog title="创建投票" :visible.sync="dialogVisibleVote" :append-to-body="true" width="800px"
+            :before-close="handleClose" class="dialog_diy">
+            <div>
+                <div class="a_add_title" style="
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+            justify-content: center;
+          ">
+                    <div style="margin-right: 20px; font-size: 20px">投票标题:</div>
+                    <el-input v-model="askJson.askTitle" placeholder="请输入标题" style="width: 400px"></el-input>
+                </div>
+                <div class="a_addBox">
+                    <div style="font-size: 16px; color: #c7c7c7">请输入投票内容</div>
+                    <div class="a_add_box" v-for="(item1, index1) in askJson.askCount" :key="index1">
+                        <div class="a_add_head">
+                            <div>
+                                {{ index1 + 1 + "、" }}
+                                <el-input class="a_add_head_input" v-model="askJson.askJson[index1].askstitle"
+                                    placeholder="请输入内容...">
+                                </el-input>
+                            </div>
+                            <div class="a_add_head_div">
+                                <el-button type="primary" size="small" @click="addAskList()">添加</el-button>
+                                <el-button type="primary" size="small" @click="deleteAskList(index1)"
+                                    v-if="askJson.askCount != 1">删除
+                                </el-button>
+                            </div>
+                        </div>
+                        <div class="a_add_body">
+                            <div class="a_add_input">
+                                <el-input v-for="(item2, checkIndex) in askJson.askJson[index1].askItem"
+                                    :key="checkIndex" v-model="askJson.askJson[index1].checkList[checkIndex]"
+                                    placeholder="请输入投票选项..." style="width: 150px; margin: 10px 10px 0 0"></el-input>
+                            </div>
+                            <div class="a_add_body_div">
+                                <el-button style="margin: 10px 0px 0 0" type="primary" size="small"
+                                    @click="addcheckList(askJson.askJson[index1])">添加</el-button>
+                                <el-button type="primary" size="small" style="margin: 10px 0 0 10px"
+                                    @click="deletecheckList(askJson.askJson[index1])"
+                                    v-if="askJson.askJson[index1].askItem != 1">删除
+                                </el-button>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisibleVote = false">取 消</el-button>
+                <el-button type="primary" @click="addAsk">确 定</el-button>
+            </span>
+        </el-dialog>
+        <el-dialog title='查看投票' :visible.sync="dialogVisibleVote2" :append-to-body="true" width="1000px"
+            :before-close="handleClose" class="dialog_diy dialog_diy3">
+            <div>
+                <div class="a_add_title" style="
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+            justify-content: center;
+          ">
+                    <div style="margin-right: 20px; font-size: 20px">投票标题:</div>
+                    <div style="font-size: 20px">{{ askJson.askTitle }}</div>
+                </div>
+                <div class="a_addBox">
+                    <div style="font-size: 16px; color: #c7c7c7">投票内容</div>
+                    <div class="a_add_box" v-for="(item1, index1) in askJson.askCount" :key="index1">
+                        <div class="a_add_head">
+                            <div style="display: flex">
+                                {{ index1 + 1 + "、" }}
+                                <div>{{ askJson.askJson[index1].askstitle }}</div>
+                            </div>
+                            <img v-if="askJson.askJson[index1].img" :src="askJson.askJson[index1].img"
+                                style="height: 300px; margin-top: 10px; max-width: 100%" />
+                        </div>
+                        <div class="a_add_body">
+                            <div class="a_add_input">
+                                <el-radio-group v-model="radio[index1]">
+                                    <el-radio v-for="(item2, checkIndex) in askJson.askJson[index1]
+                                    .checkList" :key="checkIndex" :label="checkIndex" class="redioStyle"><span
+                                            v-html="item2"></span></el-radio>
+                                </el-radio-group>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisibleVote2 = false">取 消</el-button>
+                <el-button type="primary" @click="addStudentAsk">确 定</el-button>
+            </span>
+        </el-dialog>
+        <el-dialog title='查看投票' :visible.sync="dialogVisibleVote3" :append-to-body="true" width="1000px"
+            :before-close="handleClose" class="dialog_diy dialog_diy3">
+            <div>
+                <div class="a_add_title" style="
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+            justify-content: center;
+          ">
+                    <div style="margin-right: 20px; font-size: 20px">投票标题:</div>
+                    <div style="font-size: 20px">{{ askJson.askTitle }}</div>
+                </div>
+                <div class="a_addBox">
+                    <div style="font-size: 16px; color: #c7c7c7">投票内容</div>
+                    <div class="a_add_box" v-for="(item1, index1) in askJson.askCount" :key="index1">
+                        <div class="a_add_head">
+                            <div style="display: flex">
+                                {{ index1 + 1 + "、" }}
+                                <div>{{ askJson.askJson[index1].askstitle }}</div>
+                            </div>
+                            <img v-if="askJson.askJson[index1].img" :src="askJson.askJson[index1].img"
+                                style="height: 300px; margin-top: 10px; max-width: 100%" />
+                        </div>
+                        <div class="a_add_body">
+                            <div class="a_add_input">
+                                <el-radio-group v-model="radio[index1]">
+                                    <el-radio v-for="(item2, checkIndex) in askJson.askJson[index1]
+                                    .checkList" :key="checkIndex" :label="checkIndex" disabled class="redioStyle"><span
+                                            v-html="item2"></span></el-radio>
+                                </el-radio-group>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisibleVote3 = false">关 闭</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 <script>
@@ -2261,6 +2419,7 @@ import $ from "jquery";
 import EditorBar from "../../../components/tools/wangEnduit";
 import EditorBar2 from "../../../components/tools/wangEnduit";
 import Table from "../../../components/tools/table";
+import voteStatic from "../components/voteStatic.vue";
 import TextT from "../../../components/tools/text";
 import Mind from "../../tools/jsmind2";
 import Sunburst from "../../tools/sunburst";
@@ -2280,7 +2439,8 @@ export default {
         proMan,
         ganChart,
         pdf,
-        TextT
+        TextT,
+        voteStatic
     },
     data() {
         return {
@@ -2345,6 +2505,9 @@ export default {
             dialogVisibleText: false,
             dialogVisibleText2: false,
             dialogVisibleText3: false,
+            dialogVisibleVote: false,
+            dialogVisibleVote2: false,
+            dialogVisibleVote3: false,
             videoVisible: false,
             videoDetail: {},
             showPDF: "",
@@ -2525,6 +2688,8 @@ export default {
             fulltype: "",
             fullUrl: "",
             editSourceType: 1,
+            radio: [],
+            checkJson:[]
         };
     },
     computed: {
@@ -2578,15 +2743,15 @@ export default {
                 let _people = people
                 let _people2 = ''
                 if (this.ManAarray.length) {
-                for (var i = 0; i < this.ManAarray.length; i++) {
-                    if (this.ManAarray[i].userid == people) {
-                    _people2 = this.ManAarray[i].name;
-                    break;
+                    for (var i = 0; i < this.ManAarray.length; i++) {
+                        if (this.ManAarray[i].userid == people) {
+                            _people2 = this.ManAarray[i].name;
+                            break;
+                        }
                     }
                 }
-                }
                 if (people == this.courseUserid) {
-                return ''
+                    return ''
                 }
                 return this.ManAarray.length ? _people2 : ''
             }
@@ -4153,6 +4318,17 @@ export default {
                 this.dialogVisibleText = true;
             } else if (tool == 51) {
                 this.addSourceFunD(this.taskCount)
+            } else if (tool == 56) {
+                this.askJson = {
+                    askCount: 1,
+                    askTitle: "",
+                    askJson: [{
+                        askstitle: "",
+                        askItem: 1,
+                        checkList: []
+                    }],
+                }
+                this.dialogVisibleVote = true
             } else {
                 this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
                     this.taskCount
@@ -4241,31 +4417,45 @@ export default {
             this.setVHeight();
         },
         openToolFun(tool, taskCount, i) {
+            this.taskCount = taskCount
+            this.toolIndex = i
             if (tool == 48) {
-                this.taskCount = taskCount
-                this.toolIndex = i
                 const array = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].toolPhoto
                 let txt = ""
-                for (var l = 0; l < array.length; l++) {
-                    let _uid = array[l].userid
-                    if (_uid == this.userid) {
-                        txt = JSON.parse(JSON.stringify(array[l].content))
-                        break;
-                    }
+                if(array.length){
+                    txt = JSON.parse(JSON.stringify(array[0].content))
                 }
+                // for (var l = 0; l < array.length; l++) {
+                //     let _uid = array[l].userid
+                //     if (_uid == this.userid) {
+                //         txt = JSON.parse(JSON.stringify(array[l].content))
+                //         break;
+                //     }
+                // }
                 this.tableJson.text = txt ? JSON.parse(txt) : (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table ? JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table)) : '')
                 // this.tableJson.text = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table ? JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].table)) : ''
                 this.dialogVisibleTable = true;
             } else if (tool == 15) {
-                this.taskCount = taskCount
-                this.toolIndex = i
                 this.answerQ = JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].answerQ))
                 this.answerDialogVisible = true;
             } else if (tool == 52) {
-                this.taskCount = taskCount
-                this.toolIndex = i
                 const array = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].toolPhoto
                 let txt = ""
+                if(array.length){
+                    txt = JSON.parse(JSON.stringify(array[0].content))
+                }
+                // for (var l = 0; l < array.length; l++) {
+                //     let _uid = array[l].userid
+                //     if (_uid == this.userid) {
+                //         txt = JSON.parse(JSON.stringify(array[l].content))
+                //         break;
+                //     }
+                // }
+                this.tableJson.text = txt ? JSON.parse(txt) : (JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].text)))
+                this.dialogVisibleText3 = true;
+            } else if (tool == 56) {
+                const array = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].toolPhoto
+                let txt = JSON.stringify([])
                 for (var l = 0; l < array.length; l++) {
                     let _uid = array[l].userid
                     if (_uid == this.userid) {
@@ -4273,8 +4463,9 @@ export default {
                         break;
                     }
                 }
-                this.tableJson.text = txt ? JSON.parse(txt) : (JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].text)))
-                this.dialogVisibleText3 = true;
+                this.radio = JSON.parse(txt)
+                this.askJson = JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].askJson))
+                this.dialogVisibleVote2 = true;
             } else {
                 window.parent.postMessage({
                     tools: tool + 's',
@@ -4391,13 +4582,13 @@ export default {
                 .then((res) => {
                     let teacherJuri = res.data[0];
                     this.teacherJuri2 = JSON.parse(JSON.stringify(res.data[0]))
-                    for (var i = 0; i < teacherJuri.length; i++) {
-                        if (teacherJuri[i].userid == this.userid) {
-                            // this.ManAarray.push(teacherJuri[i])
-                            teacherJuri.splice(i, 1);
-                            break;
-                        }
-                    }
+                    // for (var i = 0; i < teacherJuri.length; i++) {
+                    //     if (teacherJuri[i].userid == this.userid) {
+                    //         // this.ManAarray.push(teacherJuri[i])
+                    //         teacherJuri.splice(i, 1);
+                    //         break;
+                    //     }
+                    // }
                     this.teacherJuri = teacherJuri;
                 })
                 .catch((err) => {
@@ -5650,18 +5841,18 @@ export default {
                 });
                 return el.askstitle != "" && elc.length != 0;
             });
-            if (!this.dialogVisible4) {
-                this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
-                    this.taskCount
-                ].toolChoose[this.toolIndex] = this.askJson;
-            }
-            this.dialogVisible5 = false;
-            if (
-                this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount]
-                    .toolChoose[this.toolIndex].tool != 4
-            ) {
-                this.addTools(4, this.taskCount, this.toolIndex);
-            }
+            this.dialogVisibleTool = false;
+            this.dialogVisibleVote = false;
+            this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
+                this.taskCount
+            ].toolArray.push({
+                tool: 56,
+                toolDetail: "",
+                toolPhoto: "",
+                toolEdit: false,
+                toolId: this.guid(),
+                askJson: JSON.parse(JSON.stringify(this.askJson))
+            });
         },
         addTest() {
             // if (this.testJson.testTitle === "") {
@@ -6021,10 +6212,67 @@ export default {
                             for (var z = 0; z < tool.length; z++) {
                                 let _tool = tool[z]
                                 _tool.toolPhoto = []
+                                this.checkJson[z] = []
+                                let checkPeople = 0
                                 for (var k = 0; k < works.length; k++) {
                                     let _work = works[k]
                                     if (_work.stage == i && _work.task == j && _work.tool == z && _work.atool == _tool.tool) {
-                                        _tool.toolPhoto.push(_work);
+                                        if(_tool.tool == 48 || _tool.tool == 52){
+                                            _tool.toolPhoto[0] = _work
+                                        }else{
+                                            _tool.toolPhoto.push(_work);
+                                        }
+                                        if (_tool.tool == 56) {
+                                            checkPeople++
+                                            var checkL = JSON.parse(_work.content);
+                                            for (var kz = 0; kz < checkL.length; kz++) {
+                                            if (!this.checkJson[z][kz]) {
+                                                this.checkJson[z].push({
+                                                checkCount: [],
+                                                checkPerson: [],
+                                                rightPerson: [],
+                                                });
+                                            }
+                                            if (!this.checkJson[z][kz].checkCount.length) {
+                                                this.checkJson[z][kz].checkCount = [];
+                                                let _askItemCount = _tool.askJson
+                                                .askJson[kz].askItem;
+                                                for (var aic = 0; aic < _askItemCount; aic++) {
+                                                this.checkJson[z][kz].checkCount.push(0);
+                                                }
+                                            }
+                                            this.checkJson[z][kz].checkPerson[parseInt(checkL[kz])]
+                                                ? this.checkJson[z][kz].checkPerson[
+                                                parseInt(checkL[kz])
+                                                ].push(_work.username)
+                                                : (this.checkJson[z][kz].checkPerson[parseInt(checkL[kz])] =
+                                                [_work.username]);
+                                            this.checkJson[z][kz].checkCount[parseInt(checkL[kz])]
+                                                ? this.checkJson[z][kz].checkCount[parseInt(checkL[kz])]++
+                                                : (this.checkJson[z][kz].checkCount[
+                                                parseInt(checkL[kz])
+                                                ] = 1);
+                                            }
+                                        }
+                                    }
+                                }
+
+                                for (var kz = 0; kz < this.checkJson[z].length; kz++) {
+                                    this.checkJson[z][kz].checkPerent = [];
+                                    let aaaa = this.checkJson[z][kz];
+                                    console.log(aaaa);
+                                    for (
+                                    var kc = 0;
+                                    kc < this.checkJson[z][kz].checkCount.length;
+                                    kc++
+                                    ) {
+                                    this.checkJson[z][kz].checkPerent.push(
+                                        Math.round(
+                                        (this.checkJson[z][kz].checkCount[kc] /
+                                            checkPeople) *
+                                        100
+                                        )
+                                    );
                                     }
                                 }
                             }
@@ -6405,6 +6653,43 @@ export default {
                     console.error(err);
                 });
         },
+        addStudentAsk() {
+            if (!this.radio.length) {
+                this.$message.error("请选择选项");
+                return;
+            }
+            for (var i = 0; i < this.askJson.askCount; i++) {
+                if (this.radio[i] !== 0 && !this.radio[i]) {
+                    this.$message.error("请选择选项");
+                    return;
+                }
+            }
+            let params = [{
+                uid: this.userid,
+                cid: this.courseId,
+                stage: this.unitIndex,
+                task: this.taskCount,
+                tool: this.toolIndex,
+                content: JSON.stringify(this.radio),
+                type: 14,
+                atool: 56,
+            },];
+            this.ajax
+                .post(this.$store.state.api + "addCourseWorksS", params)
+                .then((res) => {
+                    this.$message({
+                        message: "提交成功",
+                        type: "success",
+                    });
+                    this.radio = []
+                    this.seleteCourseUpdate();
+                    this.dialogVisibleVote2 = false;
+                })
+                .catch((err) => {
+                    this.$message.error("提交失败");
+                    console.error(err);
+                });
+        },
         addTextJson() {
             if (this.tableJson.text == "" || this.tableJson.text == "<p></p>") {
                 this.$message.error("请填写信息!");
@@ -6626,6 +6911,16 @@ export default {
             this.tableJson.text = JSON.parse(f)
             this.dialogVisibleText2 = true
         },
+        openAsk(f, taskCount, i) {
+            this.askJson = JSON.parse(JSON.stringify(this.unitJson[this.unitIndex].chapterInfo[0].taskJson[taskCount].toolArray[i].askJson))
+            this.radio = JSON.parse(f)
+            this.dialogVisibleVote3 = true
+        },
+        openMember(){
+            this.searchTN = ''
+            this.getTeacher();
+            this.dialogVisibleMember = true
+        },
         updateType(sid) {
             var a = this.courseTypeId;
             var a1 = JSON.parse(JSON.stringify(this.courseTypeId))
@@ -7528,23 +7823,24 @@ export default {
 
 /* table 样式 */
 .cont>>>table {
-    border-top: 1px solid #ccc;
-    border-left: 1px solid #ccc;
+  border-top: 1px solid #ccc;
+  border-left: 1px solid #ccc;
 }
 
 .cont>>>table td,
 .cont>>>table th {
-    border-bottom: 1px solid #ccc;
-    border-right: 1px solid #ccc;
-    /* padding: 20px 5px; */
-    padding: 10px 10px;
-    max-width: 0px;
-    vertical-align: baseline;
+  border-bottom: 1px solid #ccc;
+  border-right: 1px solid #ccc;
+  /* padding: 20px 5px; */
+  padding: 5px 10px;
+  max-width: 0px;
+  height: 30px;
+  vertical-align: baseline;
 }
 
 .cont>>>table th {
-    border-bottom: 2px solid #ccc;
-    text-align: center;
+  border-bottom: 2px solid #ccc;
+  text-align: center;
 }
 
 /* blockquote 样式 */
@@ -9030,7 +9326,7 @@ ol {
 }
 
 .t_j_box span:nth-child(4) {
-    width: calc(45% - 60px);
+    max-width: calc(45% - 60px);
     overflow: hidden;
     text-overflow: ellipsis;
 }
@@ -9583,4 +9879,13 @@ ol {
 .upCss>>>.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name {
     display: none;
 }
+
+
+.redioStyle>>>.el-radio__input.is-checked+.el-radio__label {
+    color: rgb(0 123 255) !important;
+}
+
+.redioStyle>>>.el-checkbox__input.is-checked+.el-checkbox__label {
+    color: rgb(0 123 255) !important;
+}
 </style>

+ 17 - 14
src/components/tools/wangEnduit.vue

@@ -208,22 +208,25 @@ export default {
 
  /* table 样式 */
  .cont>>>table {
-   border-top: 1px solid #ccc;
-   border-left: 1px solid #ccc;
- }
+  border-top: 1px solid #ccc;
+  border-left: 1px solid #ccc;
+}
 
- .cont>>>table td,
- .cont>>>table th {
-   border-bottom: 1px solid #ccc;
-   border-right: 1px solid #ccc;
-   padding: 20px 5px;
-   max-width: 0px;
- }
+.cont>>>table td,
+.cont>>>table th {
+  border-bottom: 1px solid #ccc;
+  border-right: 1px solid #ccc;
+  /* padding: 20px 5px; */
+  padding: 5px 10px;
+  max-width: 0px;
+  height: 30px;
+  vertical-align: baseline;
+}
 
- .cont>>>table th {
-   border-bottom: 2px solid #ccc;
-   text-align: center;
- }
+.cont>>>table th {
+  border-bottom: 2px solid #ccc;
+  text-align: center;
+}
 
  /* blockquote 样式 */
  .cont>>>blockquote {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä