lsc 1 year ago
parent
commit
aab1fb061f

+ 38 - 5
src/components/pages/addCourse.vue

@@ -993,7 +993,7 @@
                         display: flex;
                         flex-direction: row;
                         align-items: center;
-                        margin: 20px 0;
+                        margin: 5px 0 20px;
                       ">
                           <div class="lineTitle">
                             {{
@@ -1014,7 +1014,7 @@
                           width: 100%;
                         " v-for="(itemTool, toolIndex) in itemTask.toolChoose" :key="toolIndex">
                             <div>
-                              <textarea rows="2" type="text" placeholder="添加工具描述" class="binfo_input"
+                              <textarea rows="2" v-autoHeight="70" type="text" placeholder="添加工具描述" class="binfo_input"
                                 style="margin: 0 0 20px 0; width: 100% !important"
                                 v-model="itemTool.toolDetail"></textarea>
                             </div>
@@ -1063,11 +1063,13 @@
                               其他
                             </div> -->
                               </div>
+                              <div v-if="!itemTool.isFold3" class="show_toolD show" @click="fold3(itemTaskIndex, toolIndex)" :style="{right:itemTask.toolChoose.length > 1? '45px':'0px'}"><img src="../../assets/icon/new/icon-slide.png" />收起工具栏</div>
+                              <div v-else class="show_toolD" @click="fold3(itemTaskIndex, toolIndex)" :style="{right:itemTask.toolChoose.length > 1? '45px':'0px'}"><img src="../../assets/icon/new/icon-slide.png" />展开工具栏</div>
                               <div class="remove" @click="deleteTool(itemTaskIndex, toolIndex)"
                                 v-if="itemTask.toolChoose.length > 1" style="position: absolute; right: 0"></div>
                             </div>
 
-                            <div style="min-height: 163px">
+                            <div style="min-height: 163px" v-show="!itemTool.isFold3">
                               <div class="toolSort" v-if="itemTool.toolType == 0">
                                 <!-- <div class="tool">
                               <div
@@ -3300,7 +3302,7 @@ export default {
         }
       },
       componentUpdated(el) {
-        el.style.height = `${el.scrollHeight}px`
+        el.style.height = `${el.scrollHeight+5}px`
       },
     },
   },
@@ -4825,6 +4827,14 @@ export default {
       }
       this.$forceUpdate();
     },
+    fold3(i,ti) {
+      if (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3) {
+        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3 = false;
+      } else {
+        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3 = true;
+      }
+      this.$forceUpdate();
+    },
     deleteHomeworkBox(unitIndex, index, i) {
       this.unitJson[unitIndex].chapterInfo[index].taskJson[
         this.taskCount
@@ -8272,6 +8282,29 @@ export default {
   transform: rotate(180deg);
 }
 
+.show_toolD{
+  min-width:fit-content;
+  margin-left: 10px;
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  cursor: pointer;
+  color: #717C8D;
+  position: absolute;
+  right: 45px;
+  top: 5px;
+}
+
+.show_toolD > img{
+  width:15px;
+  margin-right:5px;
+}
+
+.show_toolD.show > img{
+  transform: rotate(180deg);
+}
+
+
 .remove {
   background-image: url("../../assets/icon/new/delete_u.png");
   cursor: pointer;
@@ -8396,7 +8429,7 @@ export default {
 }
 
 .add_info_box button {
-  /* margin: 0 10px 10px 0; */
+  margin: 0 20px 10px 0;
 }
 
 .add_info_box2 {

+ 38 - 6
src/components/pages/easy/addCourse.vue

@@ -165,7 +165,7 @@
                       <div class="basic_box" style="
                           margin: 0;
                           min-height: 0;
-                          padding: 10px 0 !important;
+                          padding: 10px 0 0 !important;
                         ">
                         <div style="
                             display: flex;
@@ -395,7 +395,7 @@
                           itemTaskIndex
                         ].taskDetail
                           " @change="change"></editor-bar> -->
-                        <textarea rows="2" class="binfo_input" placeholder="请输入任务描述" cols v-model="unitJson[unitIndex].chapterInfo[0].taskJson[
+                        <textarea rows="2" v-autoHeight="70" class="binfo_input" placeholder="请输入任务描述" cols v-model="unitJson[unitIndex].chapterInfo[0].taskJson[
                             itemTaskIndex
                           ].taskDetail
                           "></textarea>
@@ -406,7 +406,7 @@
                               width: 100%;
                             " v-for="(itemTool, toolIndex) in itemTask.toolChoose" :key="toolIndex">
                             <div>
-                              <textarea rows="3" type="text" placeholder="添加工具描述" class="binfo_input" style="
+                              <textarea rows="3" type="text" v-autoHeight="87" placeholder="添加工具描述" class="binfo_input" style="
                                   margin: 0 0 20px 0;
                                 " v-model="itemTool.toolDetail"></textarea>
                             </div>
@@ -475,11 +475,13 @@
                                   其他
                                 </div> -->
                               </div>
+                              <div v-if="!itemTool.isFold3" class="show_toolD show" @click="fold3(itemTaskIndex, toolIndex)" :style="{right:itemTask.toolChoose.length > 1? '45px':'0px'}"><img src="../../../assets/icon/new/icon-slide.png" />收起工具栏</div>
+                              <div v-else class="show_toolD" @click="fold3(itemTaskIndex, toolIndex)" :style="{right:itemTask.toolChoose.length > 1? '45px':'0px'}"><img src="../../../assets/icon/new/icon-slide.png" />展开工具栏</div>
                               <div class="remove" @click="deleteTool(itemTaskIndex, toolIndex)"
                                 v-if="itemTask.toolChoose.length > 1" style="position: absolute; right: 0"></div>
                             </div>
 
-                            <div style="min-height: 163px">
+                            <div style="min-height: 163px" v-show="!itemTool.isFold3">
                               <div class="toolSort" v-if="itemTool.toolType == 0">
                                 <!-- <div class="tool">
                               <div
@@ -4314,7 +4316,7 @@ export default {
         }
       },
       componentUpdated(el) {
-        el.style.height = `${el.scrollHeight}px`
+        el.style.height = `${el.scrollHeight+5}px`
       },
     },
   },
@@ -5756,6 +5758,14 @@ export default {
       }
       this.$forceUpdate();
     },
+    fold3(i,ti) {
+      if (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3) {
+        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3 = false;
+      } else {
+        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3 = true;
+      }
+      this.$forceUpdate();
+    },
     deleteHomeworkBox(unitIndex, index, i) {
       this.unitJson[unitIndex].chapterInfo[index].taskJson[
         this.taskCount
@@ -9165,6 +9175,28 @@ export default {
   transform: rotate(180deg);
 }
 
+.show_toolD{
+  min-width:fit-content;
+  margin-left: 10px;
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  cursor: pointer;
+  color: #717C8D;
+  position: absolute;
+  right: 45px;
+  top: 5px;
+}
+
+.show_toolD > img{
+  width:15px;
+  margin-right:5px;
+}
+
+.show_toolD.show > img{
+  transform: rotate(180deg);
+}
+
 .remove {
   background-image: url("../../../assets/icon/new/delete_u.png");
   cursor: pointer;
@@ -9291,7 +9323,7 @@ export default {
 }
 
 .add_info_box button {
-  /* margin: 0 10px 10px 0; */
+  margin: 0 20px 10px 0;
 }
 
 .add_info_box2 {

+ 39 - 4
src/components/pages/task/addCourse.vue

@@ -265,6 +265,7 @@
                         ].taskDetail
                           " @change="change"></editor-bar> -->
                         <textarea
+                          v-autoHeight="70"
                           rows="2"
                           class="binfo_input"
                           placeholder="请输入任务描述"
@@ -536,7 +537,7 @@
                           </div>
                         </div>
                       </div>
-                      <div class="toolChoose" style="margin: 20px 0">
+                      <div class="toolChoose" style="margin: 5px 0 20px">
                         <div class="tools">
                           <div
                             class="leftTools"
@@ -548,6 +549,7 @@
                           >
                             <div>
                               <textarea
+                                v-autoHeight="87"
                                 rows="3"
                                 type="text"
                                 placeholder="添加工具描述"
@@ -647,6 +649,8 @@
                                   其他
                                 </div> -->
                               </div>
+                              <div v-if="!itemTool.isFold3" class="show_toolD show" @click="fold3(itemTaskIndex, toolIndex)" :style="{right:itemTask.toolChoose.length > 1? '45px':'0px'}"><img src="../../../assets/icon/new/icon-slide.png" />收起工具栏</div>
+                              <div v-else class="show_toolD" @click="fold3(itemTaskIndex, toolIndex)" :style="{right:itemTask.toolChoose.length > 1? '45px':'0px'}"><img src="../../../assets/icon/new/icon-slide.png" />展开工具栏</div>
                               <div
                                 class="remove"
                                 @click="deleteTool(itemTaskIndex, toolIndex)"
@@ -655,7 +659,7 @@
                               ></div>
                             </div>
 
-                            <div style="min-height: 163px">
+                            <div style="min-height: 163px"  v-show="!itemTool.isFold3">
                               <div
                                 class="toolSort"
                                 v-if="itemTool.toolType == 0"
@@ -6888,7 +6892,7 @@ export default {
         }
       },
       componentUpdated(el) {
-        el.style.height = `${el.scrollHeight}px`
+        el.style.height = `${el.scrollHeight+5}px`
       },
     },
   },
@@ -8317,6 +8321,14 @@ export default {
       }
       this.$forceUpdate();
     },
+    fold3(i,ti) {
+      if (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3) {
+        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3 = false;
+      } else {
+        this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolChoose[ti].isFold3 = true;
+      }
+      this.$forceUpdate();
+    },
     deleteHomeworkBox(unitIndex, index, i) {
       this.unitJson[unitIndex].chapterInfo[index].taskJson[
         this.taskCount
@@ -11697,6 +11709,29 @@ export default {
   transform: rotate(180deg);
 }
 
+.show_toolD{
+  min-width:fit-content;
+  margin-left: 10px;
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  cursor: pointer;
+  color: #717C8D;
+  position: absolute;
+  right: 45px;
+  top: 5px;
+}
+
+.show_toolD > img{
+  width:15px;
+  margin-right:5px;
+}
+
+.show_toolD.show > img{
+  transform: rotate(180deg);
+}
+
+
 .remove {
   background-image: url("../../../assets/icon/new/delete_u.png");
   cursor: pointer;
@@ -11823,7 +11858,7 @@ export default {
 }
 
 .add_info_box button {
-  /* margin: 0 10px 10px 0; */
+  margin: 0 20px 10px 0;
 }
 
 .add_info_box2 {