Browse Source

Merge branch 'http_test' of git.xiaojukeji.com:pu_qa_tool/thoth-frontend into http_test

qinzhipeng_v@didiglobal.com 4 năm trước cách đây
mục cha
commit
50d5be03e7

+ 13 - 5
src/views/projectManage/publishTask/components/checkboxList.vue

@@ -1,7 +1,9 @@
 <template>
-  <el-checkbox-group v-model="List" @change="$emit('change', List)">
-    <el-checkbox v-for="item in data" :key="item.id" class="checkbox" :label="item.id">{{ item.name }}</el-checkbox>
-  </el-checkbox-group>
+  <div class="checkboxList">
+    <el-checkbox-group v-model="List" @change="$emit('change', List)">
+      <el-checkbox v-for="item in data" :key="item.id" class="checkbox" :label="item.id">{{ item.name }}</el-checkbox>
+    </el-checkbox-group>
+  </div>
 </template>
 <script>
 // const cityOptions = ['上海', '北京', '广州', '深圳', 'ss', 'qq', 'www', 'eeee', 'ssss', 'vvvv', 'ggg', 'jjj']
@@ -41,7 +43,13 @@ export default {
 }
 </script>
 <style scoped lang='scss'>
-.checkbox {
-  width: 18%
+.checkboxList {
+  width: 800px;
+  .checkbox {
+    width: 130px;
+    // margin-right: 50px;
+    margin: 10px 0px;
+  }
 }
+
 </style>

+ 14 - 1
src/views/projectManage/publishTask/components/multipleSelect.vue

@@ -32,7 +32,7 @@
       <p v-for="item in data" :key="item.id" class="content">
         <span>
           <span class="taskId">TASK-{{ item.id }}</span>
-          <span class="ml20">{{ item.name }}</span>
+          <span class="ml20 title" @click="goto(item.id)">{{ item.name }}</span>
         </span>
         <i v-if="isedit" class="el-icon-circle-close didi-hover" @click="$emit('change', item, 'del')" />
       </p>
@@ -41,6 +41,7 @@
 </template>
 <script>
 import { taskList } from '@/api/taskIndex'
+import { EncryptId } from '@/utils/crypto-js.js'
 export default {
   name: 'MultipleSelect',
   props: {
@@ -106,6 +107,12 @@ export default {
       this.$emit('change', item, 'add')
       this.query = ''
       this.value = null
+    },
+    goto(id) {
+      const { bizId = null } = this.$store.state.global || {}
+      const bizId_id = EncryptId(`${bizId}_${id}`)
+      const newTab = this.$router.resolve({ name: '任务详情', query: { bizId_id: bizId_id }})
+      window.open(newTab.href, '_blank')
     }
   }
 }
@@ -127,5 +134,11 @@ export default {
     display: inline-block;
     width: 120px;
   }
+  .title {
+    cursor: pointer;
+    &:hover {
+      color: #007aff;
+    }
+  }
 }
 </style>

+ 49 - 35
src/views/projectManage/publishTask/components/onlineCheckList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="onlineCheckList">
+  <div class="onlineCheckList" :style="styles">
     <table class="table">
       <tr>
         <th class="">模块</th>
@@ -64,35 +64,37 @@
           <i class="el-icon-info" />
         </el-tooltip>
       </div>
-      <draggable
-        v-if="isedit"
-        v-model="data.onlineOrder"
-        chosen-class="chosen"
-        force-fallback="true"
-        group="people"
-        animation="1000"
-        @start="onStart"
-        @end="onEnd"
-      >
-        <transition-group>
+      <div class="itemList">
+        <draggable
+          v-if="isedit"
+          v-model="data.onlineOrder"
+          chosen-class="chosen"
+          force-fallback="true"
+          group="people"
+          animation="1000"
+          @start="onStart"
+          @end="onEnd"
+        >
+          <transition-group>
+            <div
+              v-for="(element, index) in data.onlineOrder"
+              :key="element"
+              class="onlineItem"
+            >
+              <span class="dragNo">{{ index+ 1 }}</span>
+              <span class="dragword">{{ element }}</span>
+            </div>
+          </transition-group>
+        </draggable>
+        <div v-else>
           <div
             v-for="(element, index) in data.onlineOrder"
             :key="element"
-            class="onlineItem"
+            class="onlineItem textItem"
           >
             <span class="dragNo">{{ index+ 1 }}</span>
             <span class="dragword">{{ element }}</span>
           </div>
-        </transition-group>
-      </draggable>
-      <div v-else>
-        <div
-          v-for="(element, index) in data.onlineOrder"
-          :key="element"
-          class="onlineItem textItem"
-        >
-          <span class="dragNo">{{ index+ 1 }}</span>
-          <span class="dragword">{{ element }}</span>
         </div>
       </div>
     </div>
@@ -125,6 +127,13 @@ export default {
       type: Number,
       required: false,
       default: null
+    },
+    styles: {
+      type: Object,
+      default: () => {
+        return {}
+      },
+      required: false
     }
   },
   data() {
@@ -213,6 +222,21 @@ export default {
     }
   }
   .inlineList {
+    .itemList {
+      width: 800px;
+      // margin-top: 10px;
+      .onlineItem {
+        display: inline-block;
+        margin: 10px 20px 0px 0px;
+        width: 130px;
+        font-size: 14px;
+        border: solid 2px transparent;
+        cursor: move;
+        &.textItem{
+          cursor: text;
+        }
+      }
+    }
     .dragNo {
       display: inline-block;
       width: 16px;
@@ -234,7 +258,7 @@ export default {
     }
   }
   .tag {
-    margin-right: 24px;
+    margin-right: 12px;
     margin-bottom: 5px;
     &.word {
       margin-right: 0px;
@@ -256,17 +280,7 @@ export default {
     }
   }
 }
-.onlineItem {
-  display: inline-block;
-  margin: 10px 40px 10px 0px;
-  font-size: 14px;
-  border: solid 2px transparent;
-  // margin-bottom: 10px;
-  cursor: move;
-  &.textItem{
-    cursor: text;
-  }
-}
+
 .chosen {
   border: solid 2px #3089dc !important;
 }

+ 42 - 29
src/views/projectManage/publishTask/index.vue

@@ -23,15 +23,16 @@
         </div>
         <div class="moduleList wrap">
           <redTipword v-if="!edit" title="检查项" :isedit="edit" />
-          <div v-for="(item, index) in data.templates" :key="item.parentTemplateId" class="item">
-            <div v-if="item.type === 1" style="width: 690px">
+          <div v-for="(item, index) in data.templates" :key="item.parentTemplateId">
+            <div v-if="item.type === 1" class="item">
               <p :id="`s${item.parentTemplateId}`" class="title">
                 <el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
-                <span v-else>{{ item.name }}</span>
+                <span v-else class="fontName">{{ item.name }}</span>
               </p>
               <onlineCheckList
                 :module-id="item.parentTemplateId"
                 :isedit="edit"
+                :styles="{ marginLeft: '24px' }"
                 :data="item.onlineModule"
                 :task-id="taskId"
                 @changeSelectedHandle="changeOnlineSelectedHandle"
@@ -39,10 +40,10 @@
                 @onChangeModuleName="(val, subIdx) => onChangeModuleName(val, subIdx, index)"
               />
             </div>
-            <div v-else style="width: 690px">
+            <div v-else class="item">
               <p :id="`s${item.parentTemplateId}`" class="title">
                 <el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
-                <span v-else>{{ item.name }}</span>
+                <span v-else class="fontName">{{ item.name }}</span>
               </p>
               <normal-area
                 v-if="edit"
@@ -50,9 +51,9 @@
                 :value.sync="item.content"
                 :empty-text="'点击'"
                 :input-button="'修改模板'"
-                :styles="{ padding: '0 0px 20px 0px', width: '690px' }"
+                :styles="{ padding: '0 0px 20px 0px', width: '690px', marginLeft: '24px' }"
               />
-              <div v-else v-html="item.content" />
+              <div v-else style="margin-left: 24px" v-html="item.content" />
             </div>
           </div>
         </div>
@@ -260,7 +261,7 @@ export default {
             t.onlineModule.tableContent.splice(index, 1)
           } else {
             t.onlineModule.tableContent.splice(index + 1, 0, {
-              module: `模块${index + 1}`,
+              module: '',
               moduleNames: []
             })
           }
@@ -327,7 +328,7 @@ export default {
           name: this.taskName
         }]
       }
-      this.checkAllTem()
+      // this.checkAllTem()
     },
 
     // 编辑
@@ -342,28 +343,28 @@ export default {
       this.edit = true
       // 编辑按钮隐藏
       this.openEdit = false
-      this.checkAllTem()
+      // this.checkAllTem()
     },
 
     // 添加和编辑checklist时 如果没有选择模版默认全选。
-    checkAllTem() {
-      const { selectedBizTemplateIds } = this.data
-      if (!selectedBizTemplateIds || selectedBizTemplateIds.length < 1) {
-        this.temList.map(t => {
-          this.data.selectedBizTemplateIds.push(t.id)
-          const { content, isCheck, name, onlineModule, type, id: parentTemplateId } = t
-          this.data.templates.push({
-            content,
-            isCheck,
-            name,
-            onlineModule,
-            type,
-            parentTemplateId,
-            belongType: 2 // checklist的模板
-          })
-        })
-      }
-    },
+    // checkAllTem() {
+    //   const { selectedBizTemplateIds } = this.data
+    //   if (!selectedBizTemplateIds || selectedBizTemplateIds.length < 1) {
+    //     this.temList.map(t => {
+    //       this.data.selectedBizTemplateIds.push(t.id)
+    //       const { content, isCheck, name, onlineModule, type, id: parentTemplateId } = t
+    //       this.data.templates.push({
+    //         content,
+    //         isCheck,
+    //         name,
+    //         onlineModule,
+    //         type,
+    //         parentTemplateId,
+    //         belongType: 2 // checklist的模板
+    //       })
+    //     })
+    //   }
+    // },
 
     // 校验是否该业务线有绑定checklist模板
     RegHasCheckListTem() {
@@ -382,9 +383,15 @@ export default {
     updateSelectedTemHandle(checkedIds) {
       const selectedBizTemplateIds = []
       const tems = []
+      const newcheckedIds = []
       const { templates } = this.data
       // 循环都有哪些tem被选择了
-      checkedIds.map(checkedId => {
+      this.temList.forEach(t => {
+        if (checkedIds.includes(t.id)) {
+          newcheckedIds.push(t.id)
+        }
+      })
+      newcheckedIds.map(checkedId => {
         // 先循环是否有存过模板数据
         this.temList.map(g => {
           if (g.id === checkedId) {
@@ -492,6 +499,12 @@ export default {
       margin-bottom: 16px;
       margin-top: 40px;
     }
+    .item {
+      width: 690px;
+      .fontName {
+        font-weight: 500;
+      }
+    }
   }
 }
 .empty {