lsc 2 years ago
parent
commit
8eba6b10c6

BIN
src/assets/icon/isWord.png


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

@@ -6601,7 +6601,7 @@ ol {
 }
 
 .choose>div:nth-child(3)>span {
-  letter-spacing: 0 !important;
+  /* letter-spacing: 0 !important; */
 }
 
 .choose {

+ 6 - 6
src/components/pages/components/ganChart.vue

@@ -255,9 +255,9 @@ export default {
             this.tasks.push({
               id: i + '-' + j,
               label2: '第' + (i + 1) + '阶段-' + '任务' + (j + 1) + '-' + task[j].task,
-              label: this.datedifference(task[j].time[0], task[j].time[1]),
-              start: this.getTody(task[j].time[0]),
-              end: this.getTody(task[j].time[1]),
+              label: this.datedifference(task[j].time ? task[j].time[0] : '', task[j].time ? task[j].time[1] : ''),
+              start: this.getTody(task[j].time ? task[j].time[0] : ''),
+              end: this.getTody(task[j].time ? task[j].time[1] : ''),
               percent: 85,
               type: "task",
               style: {
@@ -323,9 +323,9 @@ export default {
           this.tasks.push({
             id: i + '-' + j,
             label2: '第' + (i + 1) + '阶段-' + '任务' + (j + 1) + '-' + task[j].task,
-            label: this.datedifference(task[j].time[0], task[j].time[1]),
-            start: this.getTody(task[j].time[0]),
-            end: this.getTody(task[j].time[1]),
+            label: this.datedifference(task[j].time ? task[j].time[0] : '', task[j].time ? task[j].time[1] : ''),
+            start: this.getTody(task[j].time ? task[j].time[0] : ''),
+            end: this.getTody(task[j].time ? task[j].time[1] : ''),
             percent: 85,
             type: "task",
             style: {

+ 9 - 9
src/components/pages/components/proMan.vue

@@ -14,19 +14,19 @@
                 <div class="rwIcon">
                   <img src="../../../assets/icon/startTime.png" alt="" />
                 </div>
-                <div>开始时间:{{ timeB(item2.time[0]) }} </div>
+                <div>开始时间:{{ timeB(item2.time ? item2.time[0] : '') }} </div>
               </div>
               <div class="rwBoxMessage">
                 <div class="rwIcon">
                   <img src="../../../assets/icon/endTime.png" alt="" />
                 </div>
-                <div>完成时间:{{ timeB(item2.time[1]) }} </div>
+                <div>完成时间:{{ timeB(item2.time ? item2.time[1] : '') }} </div>
               </div>
               <div class="rwBoxMessage">
                 <div class="rwIcon">
                   <img src="../../../assets/icon/allTime.png" alt="" />
                 </div>
-                <div>所需时长:{{ timeA(item2.time[0], item2.time[1]) }}天</div>
+                <div>所需时长:{{ timeA(item2.time ? item2.time[0] : '', item2.time ? item2.time[1] : '') }}天</div>
               </div>
             </div>
           </div>
@@ -38,10 +38,10 @@
 
 <script>
 export default {
-  props: ['Json','ManAarray'],
+  props: ['Json', 'ManAarray'],
   data() {
     return {
-      ManAarray2:[]
+      ManAarray2: []
     };
   },
   computed: {
@@ -62,12 +62,12 @@ export default {
         return time.getFullYear() ? s2 : '无'
       }
     },
-    getMan(){
+    getMan() {
       return function (people) {
         let _people = people
-        if(this.ManAarray2.length){
-          for(var i = 0;i<this.ManAarray2.length;i++){
-            if(this.ManAarray2[i].userid == people){
+        if (this.ManAarray2.length) {
+          for (var i = 0; i < this.ManAarray2.length; i++) {
+            if (this.ManAarray2[i].userid == people) {
               _people = this.ManAarray2[i].name;
               break;
             }

+ 83 - 192
src/components/pages/student/addCourse.vue

@@ -558,7 +558,7 @@
                           </div>
                           <div class="addPeople" @click="addTcMember(itemTaskIndex)"
                             style="background: rgb(107, 146, 201);margin: 0 0 10px 15px;margin-bottom: 10px;width: 100px;">
-                            {{unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember ? '已添加' : '添加协同者'}}
+                            {{ unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember ? '已添加' : '添加协同者' }}
                           </div>
                         </div>
                         <div class="remove" v-if="item.taskJson.length > 1" @click="deleteTask(itemTaskIndex)"
@@ -606,7 +606,7 @@
                     </div>
 
                   </div>
-                  <div class="basic_box" style="
+                  <div class="basic_box" v-if="false" style="
                       margin: 0;
                       min-height: 0;
                       width: 90% !important;
@@ -802,6 +802,9 @@
                             <span v-if="itemTool.tool == 3">
                               思维导图
                             </span>
+                            <span v-if="itemTool.tool == 48">
+                              表格
+                            </span>
                           </div>
                           <div class="remove" @click="deleteTool(itemTaskIndex, toolIndex)"
                             v-if="itemTask.toolArray.length > 0" style="position: absolute; right: 55px"></div>
@@ -830,10 +833,17 @@
                               <div style="margin: 5px 0">思维导图</div>
                             </div>
                           </div>
+                          <div class="tool" v-if="itemTool.tool == 48">
+                            <div class="whiteBIcon" @click="openToolFun(48, itemTaskIndex, toolIndex)">
+                              <img src="../../../assets/icon/fourthToolList/table.png" alt />
+                              <div style="margin: 5px 0">表格</div>
+                            </div>
+                          </div>
                         </div>
                         <div v-if="itemTool.toolPhoto.length" style="margin-top:10px" class="toolimg_box">
                           <div class="toolimg" v-for="(photo, pIndex) in itemTool.toolPhoto" :key="pIndex">
-                            <img :src="photo.content" alt="" @click="previewImg(photo.content)">
+                            <img v-if="photo.type == 1" :src="photo.content" alt="" @click="previewImg(photo.content)">
+                            <img v-if="photo.type == 10" src="../../../assets/icon/isWord.png" alt="" @click="openTable(photo.content)">
                             <img class="deleteImg" src="../../../assets/deleteworks.png" v-if="
                               photo.userid == userid
                             " @click.stop="deleteWorks(photo.id)" alt />
@@ -1232,168 +1242,6 @@
         <el-button type="primary" @click="addTest">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="添加工具" :visible.sync="dialogVisible4" :append-to-body="true" width="600px"
-      :before-close="handleClose" class="dialog_diy addToolsDia">
-      <div class="toolChoose" style="padding: 0 0 30px 30px">
-        <div class="tools">
-          <div class="leftTools" style="
-              width: 95%;
-              padding: 0 0 15px 0;
-              border-bottom: 1px solid #efefef;
-              margin-bottom: 15px;
-            " v-for="(itemTools, itemToolsIndex) in chapTools" :key="itemToolsIndex">
-            <div style="
-                display: flex;
-                flex-direction: row;
-                align-items: baseline;
-                flex-wrap: nowrap;
-                justify-content: flex-start;
-                position: relative;
-              ">
-              <div class="chooseWho">
-                <div :class="chapToolsType == 0 ? 'isChooseActive' : ''" @click="chapToolsType = 0">
-                  互动类
-                </div>
-                <div :class="chapToolsType == 1 ? 'isChooseActive' : ''" @click="chapToolsType = 1">
-                  思维类
-                </div>
-                <div :class="chapToolsType == 2 ? 'isChooseActive' : ''" @click="chapToolsType = 2">
-                  评价类
-                </div>
-                <div :class="chapToolsType == 2 ? 'isChooseActive' : ''" @click="chapToolsType = 2">
-                  其他
-                </div>
-              </div>
-            </div>
-
-            <div style="min-height: 163px">
-              <div class="toolSort" v-if="chapToolsType == 0">
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(8)">
-                    <img src="../../../assets/icon/secondToolList/library.png" alt />
-                    <div style="margin: 5px 0">素材库</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(8)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(8) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="toolSort" v-if="chapToolsType == 1">
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(7)">
-                    <img src="../../../assets/icon/secondToolList/mindNetwork.png" alt />
-                    <div style="margin: 5px 0">思维网格</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(7)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(7) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(1)">
-                    <img src="../../../assets/icon/secondToolList/whiteBoard.png" alt />
-                    <div style="margin: 5px 0">电子白板</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(1)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(1) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(2)">
-                    <img src="../../../assets/icon/secondToolList/note.png" alt />
-                    <div style="margin: 5px 0">便签</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(2)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(2) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(6)">
-                    <img src="../../../assets/icon/secondToolList/doc.png" alt />
-                    <div style="margin: 5px 0">协同文档</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(6)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(6) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(3)">
-                    <img src="../../../assets/icon/secondToolList/mindMapping.png" alt />
-                    <div style="margin: 5px 0">思维导图</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(3)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(3) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(31)">
-                    <img src="../../../assets/icon/secondToolList/networkPanel.png" alt />
-                    <div style="margin: 5px 0">数学画板</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(31)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(31) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="toolSort" v-if="chapToolsType == 2">
-                <div class="tool">
-                  <div class="whiteBIcon" @click="chapAddTools(5)">
-                    <img src="../../../assets/icon/thirdToolList/score.png" alt />
-                    <div style="margin: 5px 0">量规评分</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(5)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(5) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="tool">
-                  <div class="whiteBIcon" @click="openTools(chapCount, 4, null)">
-                    <img src="../../../assets/icon/thirdToolList/ask.png" alt />
-                    <div style="margin: 5px 0">问卷调查</div>
-                  </div>
-                  <div class="check" @click="chapAddTools(4)">
-                    <img src="../../../assets/icon/checkNo.png" alt v-if="itemTools.tools.indexOf(4) == -1" />
-                    <div class="checkDiv" v-else>
-                      <img src="../../../assets/icon/checkedIs.png" alt /><span>已选择</span>
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div>
-            <div>
-              <input type="text" placeholder="添加工具描述" class="binfo_input"
-                style="margin: 20px 0; width: 71.5% !important" v-model="itemTools.toolDetail" />
-            </div>
-          </div>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible4 = false">取 消</el-button>
-        <el-button type="primary" @click="addChaptersDataTools">确定</el-button>
-      </span>
-    </el-dialog>
     <el-dialog title="添加问答" :visible.sync="dialogVisible8" :append-to-body="true" width="500px"
       :before-close="handleClose" class="dialog_diy">
       <div>
@@ -1657,6 +1505,15 @@
         <el-button type="primary" @click="addTableJson">确定</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="查看表格" :visible.sync="dialogVisibleTable2" :append-to-body="true" width="95%"
+      :before-close="handleClose" class="dialog_diy">
+      <el-form>
+         <div class="cont" v-html="tableJson.text"></div>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleTable2 = false">关 闭</el-button>
+      </span>
+    </el-dialog>
     <el-dialog title="分组设置" :visible.sync="dialogVisibleGroup" :append-to-body="true" width="650px"
       :before-close="handleClose" class="dialog_diy">
       <div class="groupBox">
@@ -1717,6 +1574,12 @@
                     <div style="margin: 5px 0">思维导图</div>
                   </div>
                 </div>
+                <div class="tool">
+                  <div class="whiteBIcon" @click="addToolFun(48)">
+                    <img src="../../../assets/icon/fourthToolList/table.png" alt />
+                    <div style="margin: 5px 0">表格</div>
+                  </div>
+                </div>
               </div>
             </div>
           </div>
@@ -1810,6 +1673,7 @@ export default {
       orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
       oidArray: [],
       dialogVisibleTable: false,
+      dialogVisibleTable2: false,
       tableJson: { text: "" },
       cover: [], //项目封面
       myWord: [],
@@ -3106,20 +2970,30 @@ export default {
       this.dialogVisibleTool = true;
     },
     openToolFun(tool, taskCount, i) {
-      window.parent.postMessage(
-        {
-          tools: tool + 's',
-          cid: this.cid,
-          stage: this.unitIndex,
-          task: taskCount,
-          tool: i,
-        },
-        "*"
-      );
+      if (tool == 48) {
+        this.taskCount = taskCount
+        this.toolIndex = i
+        this.dialogVisibleTable = true;
+      } else {
+        window.parent.postMessage(
+          {
+            tools: tool + 's',
+            cid: this.cid,
+            stage: this.unitIndex,
+            task: taskCount,
+            tool: i,
+          },
+          "*"
+        );
+      }
     },
     previewImg(url) {
       this.$hevueImgPreview(url);
     },
+    openTable(content){
+      this.tableJson.text = JSON.parse(content)
+      this.dialogVisibleTable2 = true
+    },
     addTaskBorder() {
       this.unitJson[this.unitIndex].chapterInfo[0].taskJson.push({
         task: "",
@@ -3226,7 +3100,7 @@ export default {
       let teacherJuri = this.teacherJuri2;
       this.ManAarray = []
       for (var i = 0; i < teacherJuri.length; i++) {
-        if (teacherJuri[i].userid == this.userid == this.courseUserid) {
+        if (teacherJuri[i].userid == this.userid && this.userid == this.courseUserid) {
           this.ManAarray.push(teacherJuri[i])
         } else if (this.checkboxList3.indexOf(teacherJuri[i].userid) != -1) {
           this.ManAarray.push(teacherJuri[i])
@@ -3636,11 +3510,11 @@ export default {
     isAddPPTeacher() {
       this.dialogVisibleMember = false;
     },
-    isAddPPTcTeacher(){
+    isAddPPTcTeacher() {
       this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].tcMember = this.tcMember
       this.dialogVisibleTcMember = false;
     },
-    addTcMember(index){
+    addTcMember(index) {
       this.taskCount = index
       // this.searchTN = ""
       this.tcMember = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].tcMember ? this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].tcMember : []
@@ -4995,21 +4869,36 @@ export default {
     },
     addTableJson() {
       if (this.tableJson.text == "" || this.tableJson.text == "<p></p>") {
-        this.$message.error("请将信息填写完整!");
+        this.$message.error("请填写信息!");
         return;
       }
-      this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
-        this.taskCount
-      ].toolChoose[this.toolIndex].tableJson = this.tableJson;
-      this.tableJson = [{ text: "" }];
-      this.dialogVisibleTable = false;
-
-      if (
-        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount]
-          .toolChoose[this.toolIndex].tool != 48
-      ) {
-        this.addTools(48, this.taskCount, this.toolIndex);
-      }
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.courseId,
+          stage: this.unitIndex,
+          task: this.taskCount,
+          tool: this.toolIndex,
+          content: JSON.stringify(this.tableJson.text).replaceAll(/%/g, "%25"),
+          type: 10,
+          atool: 48,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorksS", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.seleteCourseUpdate();
+          this.dialogVisibleTable = false;
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+      
     },
     goToTask(i) {
       document.getElementsByClassName("rightBox")[0].scrollTop =
@@ -5960,8 +5849,10 @@ export default {
 .cont>>>table th {
   border-bottom: 1px solid #ccc;
   border-right: 1px solid #ccc;
-  padding: 20px 5px;
+  /* padding: 20px 5px; */
+  padding: 10px 10px;
   max-width: 0px;
+  vertical-align: baseline;
 }
 
 .cont>>>table th {