Browse Source

Merge branch 'master' of http://192.168.4.246:3000/zhangs/surveyMaker

曹冬冬 5 năm trước cách đây
mục cha
commit
a08634fb22

+ 80 - 68
src/views/cnctestlists/cncTestLists.html

@@ -1,81 +1,93 @@
 <div class="page">
-    <HeaderMain></HeaderMain>
-    <main class="main-content" v-loading.fullscreen.lock="fullscreenLoading">
-        <div class="title-content">
-            <div class="create-test-box">
-                <div class="create-test">创建测试</div>
-                <img style="width:16px; height:20px; margin-left: 7px; margin-right: 7px;"
-                    src="../../assets/images/right-arrow.png" alt="">
-                <div class="select-test">选择测题</div>
-            </div>
-            <el-dropdown class="selection" trigger="click" @command="handleCommand">
-                <el-button type="primary" style="overflow: hidden;">{{currentProject}} <i
-                        class="el-icon-caret-bottom icon-right"></i>
-                </el-button>
-                <el-dropdown-menu slot="dropdown" style="max-height: 200px;overflow-y: auto">
-                    <el-dropdown-item v-for="(item, index) in houseList" :key="item.houseId" :command="item.houseId">
-                        {{item.houseName}}</el-dropdown-item>
-                </el-dropdown-menu>
-            </el-dropdown>
-        </div>
+  <HeaderMain></HeaderMain>
+  <main class="main-content" v-loading.fullscreen.lock="fullscreenLoading">
+    <div class="title-content">
+      <div class="create-test-box">
+        <div class="create-test">创建测试</div>
+        <img style="width:16px; height:20px; margin-left: 7px; margin-right: 7px;"
+             src="../../assets/images/right-arrow.png" alt="">
+        <div class="select-test">选择测题</div>
+      </div>
+      <el-dropdown class="selection" trigger="click" @command="handleCommand">
+        <el-button type="primary" style="overflow: hidden;">{{currentProject}} <i
+          class="el-icon-caret-bottom icon-right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown" style="max-height: 200px;overflow-y: auto">
+          <el-dropdown-item v-for="(item, index) in houseList" :key="item.houseId" :command="item.houseId">
+            {{item.houseName}}
+          </el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
 
-        <div class="content" v-if="cncTestCaseList.length>0">
-          <div v-infinite-scroll="getCncTestcaseList"
-               infinite-scroll-disabled="disabled">
-            <div class="item-test" v-for="(item, index) in cncTestCaseList" :key="index">
-              <div class="item-left">
-                <img style="width:22px; height:22px;" src="../../assets/images/test-icon@2x.png" alt="">
-                <span>{{item.title}}</span>
+    <div class="content" v-if="cncTestCaseList.length>0">
+      <div v-infinite-scroll="getCncTestcaseList"
+           infinite-scroll-disabled="disabled">
+        <div class="item-test" v-for="(item, index) in cncTestCaseList" :key="index">
+          <div class="item-left">
+            <img style="width:22px; height:22px;" src="../../assets/images/test-icon@2x.png" alt="">
+            <div style="display: -webkit-box;
+                -webkit-box-orient: vertical;
+                -webkit-line-clamp: 2;
+                overflow: hidden;
+                font-size: 18px;
+                font-family: MicrosoftYaHei;
+                color: rgba(53, 62, 96, 1);
+                margin-left: 20px;
+                text-overflow: ellipsis;
+                word-break: break-all;
+                word-wrap: break-word;">{{item.title}}
+            </div>
+          </div>
+          <div class="item-right">
+            <div class="project-name">{{item.houseName}}</div>
+            <div class="qr-num">共{{item.questionCount}}题</div>
+            <div class="watch-test" @click="showQRDialog(item.testcaseId)">
+              <div class="watch-icon">
               </div>
-              <div class="item-right">
-                <span class="project-name">{{item.houseName}}</span>
-                <span class="qr-num">共{{item.questionCount}}题</span>
-                <div class="watch-test" @click="showQRDialog(item.testcaseId)">
-                  <div class="watch-icon">
-                  </div>
-                  <span>查看测试</span>
-                </div>
-                <div class="use-test" @click="useCurrentTest(item)">
-                  <div class="use-icon">
-                  </div>
-                  <span>使用此测试</span>
-                </div>
+              <span>查看测试</span>
+            </div>
+            <div class="use-test" @click="useCurrentTest(item)">
+              <div class="use-icon">
               </div>
+              <span>使用此测试</span>
             </div>
           </div>
-          <p class="loading-style" v-if="loadingMore">加载中...</p>
-          <p class="loading-style" v-if="noMore">没有更多了</p>
         </div>
-    </main>
-    <div class="dialog" v-show="isShowDialog">
-        <div class="dialog-content" v-if="cncTestDetailSingle!=null">
-            <img class="close" src="../../assets/images/close-white.png" alt="" @click="close">
-            <div class="content-box">
-                <div class="dialog-title">标题:{{cncTestDetailSingle.title}}</div>
-                <div class="dialog-qr" ref="dialogQR" v-loading="loading">
-                    <div style="border-bottom: #D4D4D4 solid 1px;"
-                        v-for="(questionItem, index) in cncTestDetailSingle.questionList" :key="index">
-                        <div class="qr-item"
-                            v-if="questionItem.optionList[0]!=null && (questionItem.optionList[0].imageUrl==null||questionItem.optionList[0].imageUrl=='')">
-                            <span class="title">{{index+1|currentOptionNum}}:{{questionItem.content}}</span>
-                            <div class="qr-as-text">
+      </div>
+      <p class="loading-style" v-if="loadingMore">加载中...</p>
+      <p class="loading-style" v-if="noMore">没有更多了</p>
+    </div>
+  </main>
+  <div class="dialog" v-show="isShowDialog">
+    <div class="dialog-content" v-if="cncTestDetailSingle!=null">
+      <img class="close" src="../../assets/images/close-white.png" alt="" @click="close">
+      <div class="content-box">
+        <div class="dialog-title">标题:{{cncTestDetailSingle.title}}</div>
+        <div class="dialog-qr" ref="dialogQR" v-loading="loading">
+          <div style="border-bottom: #D4D4D4 solid 1px;"
+               v-for="(questionItem, index) in cncTestDetailSingle.questionList" :key="index">
+            <div class="qr-item"
+                 v-if="questionItem.optionList[0]!=null && (questionItem.optionList[0].imageUrl==null||questionItem.optionList[0].imageUrl=='')">
+              <span class="title">{{index+1|currentOptionNum}}:{{questionItem.content}}</span>
+              <div class="qr-as-text">
                                 <span v-for="(qrItem, index) in questionItem.optionList"
-                                    :key="qrItem.optionId">{{index+1|transtion}}. {{qrItem.content}}</span>
-                            </div>
-                        </div>
-                        <div class="qr-item" v-else>
-                            <span class="title">{{index+1|currentOptionNum}}:{{questionItem.content}}</span>
-                            <div class="qr-as-img">
-                                <div class="qr-img" v-for="(qrItem, index) in questionItem.optionList"
-                                    :key="qrItem.optionId">
-                                    <img class="qr-image" :src="qrItem.imageUrl" alt="">
-                                    <span class="qr-desc">{{index+1|transtion}}. {{qrItem.content}}</span>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
+                                      :key="qrItem.optionId">{{index+1|transtion}}. {{qrItem.content}}</span>
+              </div>
+            </div>
+            <div class="qr-item" v-else>
+              <span class="title">{{index+1|currentOptionNum}}:{{questionItem.content}}</span>
+              <div class="qr-as-img">
+                <div class="qr-img" v-for="(qrItem, index) in questionItem.optionList"
+                     :key="qrItem.optionId">
+                  <img class="qr-image" :src="qrItem.imageUrl" alt="">
+                  <span class="qr-desc">{{index+1|transtion}}. {{qrItem.content}}</span>
                 </div>
+              </div>
             </div>
+          </div>
         </div>
+      </div>
     </div>
+  </div>
 </div>

+ 5 - 11
src/views/cnctestlists/cncTestLists.scss

@@ -75,21 +75,13 @@
       margin-bottom: 10px;
 
       .item-left {
-        line-height: 50px;
         display: flex;
         flex-direction: row;
         align-items: center;
-
-        span {
-          font-size: 18px;
-          font-family: MicrosoftYaHei;
-          color: rgba(53, 62, 96, 1);
-          margin-left: 20px;
-        }
+        width: 30%;
       }
 
       .item-right {
-        line-height: 50px;
         display: flex;
         flex-direction: row;
         align-items: center;
@@ -100,11 +92,12 @@
           font-family: STYuanti-SC-Regular;
           font-weight: 400;
           color: rgba(153, 160, 182, 1);
+          width: 100px;
         }
 
         .qr-num {
-          margin-left: 130px;
-          margin-right: 80px;
+          margin-left: 11%;
+          margin-right: 7%;
         }
 
         .use-test,
@@ -182,6 +175,7 @@
       width: 100%;
       display: flex;
       justify-content: center;
+      color: rgba(78, 93, 255, 1);
       align-items: center;
     }
   }

+ 6 - 3
src/views/cnctestlists/cncTestLists.vue

@@ -19,7 +19,7 @@
                 cncTestCaseList:[],
                 loading: true,
                 currentProject: "所属项目",
-                currentProjectHouseId: "",
+                currentProjectHouseId: null,
                 fullscreenLoading: false,
                 loadingMore:false,
                 count: 0,
@@ -32,6 +32,8 @@
             api.houseList().then(res => {
                 if (res.success) {
                     this.houseList = res.list;
+                    this.houseList.unshift({houseId: null,houseName:"全部"});
+                    console.log("户型列表",this.houseList);
                 }
             });
             this.cncTestCaseList = [];
@@ -83,7 +85,7 @@
         },
         computed: {
             noMore() {
-                return this.count <= this.cncTestCaseList.length
+                return this.count === this.cncTestCaseList.length
             },
             disabled() {
                 return this.loadingMore || this.noMore
@@ -131,7 +133,7 @@
                 this.cncTestDetailSingle = null;
             },
             handleCommand(command) {
-                this.currentProjectHouseId = "";
+                this.currentProjectHouseId = null;
                 for (let i = 0; i < this.houseList.length; i++) {
                      let element = this.houseList[i];
                     if (element.houseId === command) {
@@ -139,6 +141,7 @@
                         this.currentProjectHouseId = element.houseId;
                         this.fullscreenLoading = true;
                         this.cncTestCaseList = [];
+                        this.pageNo = 1;
                         this.getCncTestcaseList();
                         break;
                     }