Jelajahi Sumber

Merge branch 'feature_调研宝0319' of zhangs/surveyMaker into develop

wangs 5 tahun lalu
induk
melakukan
9e8b4ce70a

+ 42 - 0
src/components/ShareSetting.vue

@@ -34,6 +34,14 @@
         </div>
         <input type="text" id="releaseUrl" v-model="releaseUrl" style="height:0px;border: 0;">
       </div>
+      <div class="mark">
+        <div class="mark-title">添加备注</div>
+        <div class="content">
+          <el-input class="input" type="textarea" :rows="6" placeholder="请输入内容" v-model="shareModel.remark"
+            maxlength="500" show-word-limit>
+          </el-input>
+        </div>
+      </div>
       <div class="qrcode-title">渠道二维码
         <div class="qrcode-copy" @click="copy">
           <img class="qrcode-copy-img" src="../assets/images/qrcode-copy.png" alt="">
@@ -119,6 +127,19 @@ export default {
         }
       });
       console.log("XXXX", this.currItem);
+      this.saveRemarks();
+    },
+    saveRemarks() {
+      let param = {
+        id: this.shareModel.id,
+        remark: this.shareModel.remark,
+        updator: "admin"
+      };
+      editorApi.saveTheme(param).then(res => {
+        if (res.success) {
+          this.$emit("child-event", this.shareModel.remark);
+        }
+      });
     }
   },
   mounted() {
@@ -371,5 +392,26 @@ export default {
       cursor: pointer;
     }
   }
+  .mark {
+    overflow: auto;
+    width: 446px;
+    background: #fff;
+    .mark-title {
+      margin: 20px 0px 10px 18px;
+      font-size: 16px;
+      font-family: PingFangSC-Regular;
+      font-weight: 400;
+      color: rgba(0, 0, 0, 1);
+      line-height: 22px;
+    }
+    .content {
+      display: flex;
+      position: relative;
+      .input {
+        width: 415px;
+        margin-left: 15px;
+      }
+    }
+  }
 }
 </style>

+ 1 - 1
src/util/appConst.js

@@ -19,7 +19,7 @@ if (process.env.NODE_ENV === 'test') {
   DIAOYANBAO_PATH = 'http://192.168.4.249:8080/#/preview?mgid='
 } else {//PROD
   //生产PROD
-   BACKEND_DOMAIN = 'https://dm-api.elab-plus.cn/elab-diaoyanbao'
+  BACKEND_DOMAIN = 'https://dm-api.elab-plus.cn/elab-diaoyanbao'
   DIAOYANBAO_PATH = 'https://dm-mng3.elab-plus.cn/diaoyanbao/#/preview?mgid='
 }
 export default {

+ 26 - 6
src/views/myHistoryTest/myHistoryTest.html

@@ -21,6 +21,15 @@
           </el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
+      <el-dropdown trigger="click" @command="orderStatus">
+        <el-button type="primary">{{currOrderStatus}} <i class="el-icon-caret-bottom icon-right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item v-for="(item,index) in statusList" :key="item.orderStatus" :command="item">
+            {{item.orderName}}
+          </el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
     </div>
     <div class="right">
       <el-button type="primary" icon="el-icon-circle-plus-outline" @click="createTest">创建测试</el-button>
@@ -29,7 +38,8 @@
   <!-- 列表 -->
   <div class="test-list" v-infinite-scroll="getTestList" infinite-scroll-disabled="disabled">
     <div class="item" v-for="(item,index) in dataList" :key="item.created"
-      :class="[ (isCopy && index == 0) ? itemCopyClass :'', item.isMore ? morehoverClass : '' ]">
+      :class="[ (isCopy && index == 0) ? itemCopyClass :'', item.isMore ? morehoverClass : '' ]"
+      @mouseenter="enterssss(item)" @mouseleave="leave" @mousemove="updateXY">
       <!-- <img  mode="" :src="" alt=""> -->
       <el-image class="item-img1" :src="item.coverImg" fit="cover">
         <div slot="error" class="outline">
@@ -66,7 +76,7 @@
         <span>共{{item.questionCount}}题</span>
         <span>{{dataformat(item.created)}}</span>
       </div>
-      <div class="remarkBg">
+      <!-- <div class="remarkBg">
         <span class="remark" style="display: -webkit-box;
         -webkit-box-orient: vertical;
         -webkit-line-clamp: 2;
@@ -79,8 +89,8 @@
         word-wrap: break-word;">备注:{{item.remark || '无'}}</span>
         <div class="remBottom">
           <span class="editBtn" @click='clickEditBtn(item,index)'>编辑备注</span>
-        </div>  
-      </div>
+        </div>
+      </div> -->
     </div>
     <div class="item add" @click="createTest">
       <i class="el-icon-circle-plus add-icon"></i>
@@ -90,8 +100,9 @@
   <div v-if="loading" class="loading">加载中...</div>
   <div v-if="noMore" class="loading">没有更多了</div>
   <!-- 分享设置 -->
-  <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'
+  <ShareSetting v-if="isShareSetting" :close="closeShare" :shareModel="shareModel" @child-event="refreshItem">
+  </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">
@@ -105,4 +116,13 @@
       </div>
     </div>
   </el-dialog>
+  <div v-show="seen" class="hover_con" :style="positionStyle">
+    <div class="text" style="display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 3;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    word-break: break-all;
+    word-wrap: break-word;">{{currRemark}}</div>
+  </div>
 </div>

+ 40 - 3
src/views/myHistoryTest/myHistoryTest.js

@@ -37,6 +37,9 @@ export default {
       orderList: [{ orderName: "按创建时间排序", orderType: "created" }, { orderName: "按更新时间排序", orderType: "updated" }],
       currOrderName: "更新时间",
       currOrderType: "",
+      currOrderStatus: "项目状态",
+      selOrderType: "",
+      statusList: [{ orderName: "已收到数据", orderStatus: "1" }, { orderName: "未收到数据", orderStatus: "0" }],
       shareModel: "",
       pageNo: 1,
       dataList: [],
@@ -47,6 +50,11 @@ export default {
       remark: '',
       clickIndex: -1,
       clickItem: null,
+      seen: false,
+      x: 0,
+      y: 0,
+      positionStyle: { top: '20px', left: '20px' },
+      currRemark: "",
     }
   },
   computed: {
@@ -89,6 +97,7 @@ export default {
         this.download(item);
       } else if (command == "share") {
         console.log("分享");
+        this.clickIndex = index;
         this.shareTest(item);
       } else if (command == "del") {
         console.log("删除");
@@ -109,7 +118,8 @@ export default {
         "orderType": this.currOrderType,
         "ownHouseName": this.ownHouseName == "所属项目" ? '' : this.ownHouseName,
         "pageNo": this.pageNo++,
-        "pageSize": isFirst ? 39 : 40
+        "pageSize": isFirst ? 39 : 40,
+        "houseAnswerStatus": this.selOrderType
       }
       api.testList(data).then((res) => {
         if (res.success) {
@@ -147,6 +157,12 @@ export default {
       this.currOrderType = command.orderType;
       this.getTestList(true);
     },
+    orderStatus(command) {
+      console.log(command);
+      this.currOrderStatus = command.orderName;
+      this.selOrderType = command.orderStatus;
+      this.getTestList(true);
+    },
     createTest() {
       this.$router.push({ path: '/cncTestLists' });
     },
@@ -245,7 +261,8 @@ export default {
             shareTitle: res.single.shareTitle,
             shareContent: res.single.shareContent,
             shareImg: res.single.shareImg,
-            shareUrl: res.single.shareUrl
+            shareUrl: res.single.shareUrl,
+            remark: item.remark
           };
           this.isShareSetting = true;
         } else {
@@ -279,6 +296,7 @@ export default {
     closeShare() {
       this.currItem = "";
       this.isShareSetting = false;
+      this.clickIndex = -1;
     },
     clickEditBtn(item, index) {
       this.showDialog = true;
@@ -303,10 +321,29 @@ export default {
         }
       });
     },
+    refreshItem(remark) {
+      this.dataList[this.clickIndex].remark = remark;
+      this.clickIndex = -1;
+    },
     clickCancleBtn() {
       this.remark = '';
       this.clickIndex = -1;
       this.showDialog = false;
-    }
+    },
+    enterssss(item) {
+      if (item.remark) {
+        this.seen = true;
+        this.currRemark = item.remark;
+      }
+    },
+    leave: function () {
+      this.seen = false;
+      this.currRemark = "";
+    },
+    updateXY: function (event) {
+      this.x = event.pageX;
+      this.y = event.pageY;
+      this.positionStyle = { top: this.y + 20 + 'px', left: this.x + 20 + 'px' };
+    },
   },
 }

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

@@ -4,6 +4,21 @@
   height: 100%;
   background: rgba(237,239,247,1);
 }
+.hover_con {
+  position: absolute;
+  background: rgba(0,0,0,0.8);
+  box-sizing: border-box;
+  max-width: 160px;
+  font-size: 12px;
+  max-height: 70px;
+  color: #FFFFFF;
+
+}
+.text {
+  padding: 5px;
+  max-height: 62px;
+  line-height: 18px;
+}
 
 .history-tools {
   width: 1180px;
@@ -63,7 +78,7 @@
   .item {
     position: relative;
     width: 220px;
-    height: 330px;
+    height: 260px;
     background: #FFFFFF;
     box-shadow: 0 5px 11px 0 rgba(78,93,255,0.14);
     border-radius: 6px;