浏览代码

Merge branch 'feature_优化' of zhangs/surveyMaker into develop

wangs 5 年之前
父节点
当前提交
9d78602224

+ 2 - 0
src/views/h5editor/overview.vue

@@ -875,6 +875,8 @@ export default {
       display: flex;
       display: flex;
       flex-direction: column;
       flex-direction: column;
       margin-left: 24px;
       margin-left: 24px;
+      overflow-y: scroll;
+      max-height: 300px;
       .el-checkbox {
       .el-checkbox {
         padding-top: 10px;
         padding-top: 10px;
         padding-bottom: 10px;
         padding-bottom: 10px;

+ 34 - 1
src/views/myHistoryTest/myHistoryTest.html

@@ -54,12 +54,31 @@
         <div class="item-img copy" src="" alt="" @click="copyTest(item)"></div>
         <div class="item-img copy" src="" alt="" @click="copyTest(item)"></div>
         <div class="item-img edit" @click="editTest(item)" style="float:right;margin-right:10px;"></div>
         <div class="item-img edit" @click="editTest(item)" style="float:right;margin-right:10px;"></div>
       </div>
       </div>
-      <div class="title">{{item.title}}</div>
+      <div class="title" style="display: -webkit-box;
+      -webkit-box-orient: vertical;
+      -webkit-line-clamp: 2;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      word-break: break-all;
+      word-wrap: break-word;">{{item.title}}</div>
       <div class="desc">{{item.ownHouseName}}</div>
       <div class="desc">{{item.ownHouseName}}</div>
       <div class="bottom">
       <div class="bottom">
         <span>共{{item.questionCount}}题</span>
         <span>共{{item.questionCount}}题</span>
         <span>{{dataformat(item.created)}}</span>
         <span>{{dataformat(item.created)}}</span>
       </div>
       </div>
+      <div class="remarkBg">
+        <span class="remark" style="display: -webkit-box;
+        -webkit-box-orient: vertical;
+        -webkit-line-clamp: 2;
+        overflow: hidden;
+        font-size: 12px;
+        font-family: MicrosoftYaHei;
+        color: #75797D;
+        text-overflow: ellipsis;
+        word-break: break-all;
+        word-wrap: break-word;">备注:{{item.remark || '无'}}</span>
+        <span class="editBtn" @click='clickEditBtn(item,index)'>编辑备注</span>
+      </div>
     </div>
     </div>
     <div class="item add" @click="createTest">
     <div class="item add" @click="createTest">
       <i class="el-icon-circle-plus add-icon"></i>
       <i class="el-icon-circle-plus add-icon"></i>
@@ -70,4 +89,18 @@
   <div v-if="noMore" class="loading">没有更多了</div>
   <div v-if="noMore" class="loading">没有更多了</div>
   <!-- 分享设置 -->
   <!-- 分享设置 -->
   <ShareSetting v-if="isShareSetting" :close="closeShare" :shareModel="shareModel"></ShareSetting>
   <ShareSetting v-if="isShareSetting" :close="closeShare" :shareModel="shareModel"></ShareSetting>
+  <el-dialog class="popView" :visible.sync="showDialog" top='0' :show-close='false' :close-on-click-modal='false'
+    :close-on-press-escape='false'>
+    <div class="content">
+      <div class="main">
+        <div class="title">编辑&查看备注</div>
+        <el-input class="textarea" type="textarea" placeholder="请输入备注" v-model="remark" maxlength="500"
+          show-word-limit />
+      </div>
+      <div class="btns">
+        <div class="okBtn Btn" @click='saveRemark'>确认</div>
+        <div class="cancleBtn Btn" @click='showDialog=false'>取消</div>
+      </div>
+    </div>
+  </el-dialog>
 </div>
 </div>

+ 33 - 1
src/views/myHistoryTest/myHistoryTest.js

@@ -42,7 +42,11 @@ export default {
       dataList: [],
       dataList: [],
       total: 0,
       total: 0,
       itemCopyClass: "itemCopy",
       itemCopyClass: "itemCopy",
-      morehoverClass: "morehover"
+      morehoverClass: "morehover",
+      showDialog: false,
+      remark: '',
+      clickIndex: -1,
+      clickItem: null,
     }
     }
   },
   },
   computed: {
   computed: {
@@ -275,6 +279,34 @@ export default {
     closeShare() {
     closeShare() {
       this.currItem = "";
       this.currItem = "";
       this.isShareSetting = false;
       this.isShareSetting = false;
+    },
+    clickEditBtn(item, index) {
+      this.showDialog = true;
+      this.remark = item.remark || '';
+      this.clickIndex = index;
+      this.clickItem = item;
+    },
+    saveRemark() {
+      let param = {
+        id: this.clickItem._id,
+        remark: this.remark,
+        updator: "admin"
+      };
+      editorApi.saveTheme(param).then(res => {
+        if (res.success) {
+          this.$message.success("保存成功");
+          this.dataList[this.clickIndex].remark = this.remark;
+          this.clickCancleBtn();
+        } else {
+          this.$message.error("数据加载失败,请重试");
+          this.clickCancleBtn();
+        }
+      });
+    },
+    clickCancleBtn() {
+      this.remark = '';
+      this.clickIndex = -1;
+      this.showDialog = false;
     }
     }
   },
   },
 }
 }

+ 97 - 1
src/views/myHistoryTest/myHistoryTest.scss

@@ -156,6 +156,8 @@
       color:rgba(51,51,51,1);
       color:rgba(51,51,51,1);
       line-height:21px;
       line-height:21px;
       font-size: 16px;
       font-size: 16px;
+      max-height: 42px;
+      min-height: 42px;
     }
     }
     .desc {
     .desc {
       margin: 10px;
       margin: 10px;
@@ -168,6 +170,29 @@
       flex-direction: row;
       flex-direction: row;
       justify-content: space-between;
       justify-content: space-between;
     }
     }
+    .remarkBg{
+      margin: 0 10px 10px; 
+      border: 1px solid #EDEFF7;
+      border-radius: 3px;
+      padding: 10px 5px 5px;  
+      .remark{
+        height: 34px;
+        line-height: 17px;
+        margin-bottom: 5px;
+      }
+      .editBtn{
+        border: 1px solid #4F5DFF;
+        border-radius: 10px;
+        font-size: 10px;
+        color: #000000;
+        padding: 0 5px;
+        height: 20px;
+        line-height: 20px;
+        text-align: center;
+        margin-left: 120px;
+        cursor: pointer;
+      }
+    }
   }
   }
   .morehover {
   .morehover {
     box-shadow:0px 5px 11px 0px rgba(78,93,255,0.42);
     box-shadow:0px 5px 11px 0px rgba(78,93,255,0.42);
@@ -231,4 +256,75 @@
   height: 40px;
   height: 40px;
   line-height: 40px;
   line-height: 40px;
   color: #4E5DFF;
   color: #4E5DFF;
-}
+}
+.popView{
+  display: flex;
+    justify-content: center;
+    align-items: center;
+    .el-dialog {
+      max-width: 600px;
+      max-height: 400px;
+      padding: 30px 40px 40px;
+      box-sizing: border-box;
+      border-radius: 15px;
+      // background-color:red;
+      .el-dialog__header,
+      .el-dialog__footer {
+        display: none;
+      }
+      .el-dialog__body {
+        padding: 0;
+        .content {
+          width: 100%;
+          .main {
+            width: 100%;
+            .title {
+              width: 100%;
+              font-size: 20px;
+              line-height: 28px;
+              color: #000;
+            }
+            .textarea{
+              margin-top: 15px;
+              .el-textarea__inner{
+                padding: 10px 20px 30px;
+                color: #75797D;
+                font-size: 14px;
+                line-height: 26px;
+                box-sizing: border-box;
+                height: 212px;
+                width: 100%;
+                resize: none;
+              }
+            }
+            
+          }
+          .btns{
+            display: flex;
+            margin-top: 30px;
+            justify-content: center;
+            align-items: center;
+            .Btn {
+              width: 102px;
+              height: 44px;
+              font-size: 20px;
+              line-height: 44px;
+              border-radius: 22px;
+              text-align: center;
+              cursor: pointer;
+            }
+            .okBtn {
+              background-color: #4F5DFF ;
+              color: #fff;
+            }
+            .cancleBtn {
+              background-color: #EAECF5;
+              color: #56616D;
+              margin-left: 20px;
+              
+            }
+          }
+        }
+      }
+    }
+  }

+ 1 - 1
src/views/myHistoryTest/myHistoryTest.vue

@@ -2,6 +2,6 @@
 </template>
 </template>
 <script src="./myHistoryTest.js">
 <script src="./myHistoryTest.js">
 </script>
 </script>
-<style scoped lang="scss">
+<style lang="scss">
 @import "./myHistoryTest.scss";
 @import "./myHistoryTest.scss";
 </style>
 </style>