Переглянути джерело

添加任务需求状态流转样式

qinzhipeng_v 5 роки тому
батько
коміт
8a0e2e2d2d

+ 157 - 0
src/views/projectManage/components/timeLine.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="swiper-container">
+    <swiper ref="mySwiper" class="swiper-wrapper timeline" :options="options">
+      <swiper-slide v-for="(item,index) in steps" :key="index" class="swiper-slide">
+        <div class="line" />
+        <div class="center circle2"><div class="circle-in center" /></div>
+        <div :class="[index%2==0?'point1':'point2']" />
+        <div class="content3">
+          {{ '3天' }}
+        </div>
+        <div class="content1">
+          {{ item.dateLabel }}
+        </div>
+        <div class="content2">
+          {{ item.title }}
+        </div>
+      </swiper-slide>
+    </swiper>
+  </div>
+</template>
+
+<script>
+import { Swiper, SwiperSlide, directive } from 'vue-awesome-swiper'
+import 'swiper/css/swiper.css'
+
+export default {
+  components: {
+    Swiper,
+    SwiperSlide
+  },
+  directives: {
+    swiper: directive
+  },
+  props: {
+    steps: {
+      type: Array,
+      default() {
+        return [
+          { dateLabel: '2020.01.20', title: '技术准入' },
+          { dateLabel: '2020.01.24', title: '技术评审' },
+          { dateLabel: '2020.01.30', title: '已排期' },
+          { dateLabel: '2020.02.2', title: '开发中' },
+          { dateLabel: '2020.02.20', title: 'Hold' },
+          { dateLabel: '2020.02.25', title: '解除Hold' },
+          { dateLabel: '2020.02.31', title: '已提测' }
+        ]
+      }
+    }
+  },
+  data() {
+    return {
+      options: {
+        pagination: {
+          el: '.swiper-pagination'
+        },
+        slidesPerView: 5,
+        grabCursor: true
+      }
+    }
+  },
+  computed: {
+    swiper() {
+      return this.$refs.mySwiper.$swiper
+    }
+  },
+  created() {
+    this.steps.forEach(item => {
+      const list = item.dateLabel.split(' ')
+      item.dateLabel = list[0]
+    })
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.swiper-container {
+  padding-bottom: 50px;
+  position: relative;
+}
+.timeline {
+  width: 90%;
+  list-style-type: none;
+  display: flex;
+  padding: 0;
+  text-align: center;
+}
+.swiper-slide {
+  height: 150px;
+  width: 200px;
+  display: flex;
+  align-items: center;
+  font-size: 18px;
+  position: relative;
+  .line{
+    width: 100%;
+    height:0px;
+    border: 1px solid rgba(217,217,217,1);
+  }
+  .center {
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%,-50%);
+  }
+  .circle2 {
+    position: absolute;
+  }
+  .circle2::after{
+    content: '';
+    position: absolute;
+    height: 50px;
+    border: 1px solid rgba(1,86,165,1);
+    left: 50%;
+    bottom: -16px;
+    transform: translate(-50%,33px);
+  }
+  .circle-in {
+    position: absolute;
+    border-radius: 50%;
+    width: 12px;
+    height: 12px;
+    background: rgba(24,144,255,1);
+    border: 1px solid rgba(1,86,165,1);
+    z-index: 99;
+  }
+   .content1,.content2 {
+    width: 100%;
+    font-size: 12px;
+    color: rgba(51,51,51,1);
+    position: absolute;
+    left: 50%;
+    transform: translateX(-50%);
+  }
+  .content3 {
+    width: 100%;
+    font-size: 10px;
+    color: rgba(97,175,255,1);
+    position: absolute;
+    left: 100%;
+    top: 58px;
+    transform: translateX(-50%);
+  }
+  .content2 {
+    bottom:5px;
+    font-weight:500;
+  }
+  .content1 {
+    top: 45px;
+  }
+}
+.swiper-slide:nth-child(2n) {
+  width: 40%;
+}
+.swiper-slide:nth-child(3n) {
+  width: 20%;
+}
+</style>
+

+ 45 - 1
src/views/projectManage/requirement/requirementDetail.vue

@@ -53,6 +53,36 @@
           <i class="el-icon-delete icon-delete" @click="deleteVisible = true" />
         </div>
       </el-header>
+      <el-container>
+        <section class="main-section">
+          <div class="Layout_space_between">
+            <div class="el-main-title">
+              <div class="title-left-icon" />
+              <div class="title-left-name">工作流</div>
+            </div>
+            <el-popover
+              v-model="visible"
+              placement="bottom-start"
+              width="300px"
+              :visible-arrow="false"
+              trigger="manual"
+            >
+              <el-input
+                v-model="textarea2"
+                type="textarea"
+                rows="5"
+                placeholder="请输入Hold原因(选填)"
+              />
+              <div style="text-align: right; margin-top: 10px;">
+                <el-button size="mini" type="text" @click="visible = false">取消</el-button>
+                <el-button type="primary" size="mini" @click="visible = false">确定</el-button>
+              </div>
+              <el-button slot="reference" class="el-btn-size" size="mini" @click="visible = !visible">Hold 任务</el-button>
+            </el-popover>
+          </div>
+          <timeLine />
+        </section>
+      </el-container>
       <!-- 概览 -->
       <el-container v-show="activeName === '1'" class="is-vertical">
         <section class="main-section">
@@ -293,6 +323,7 @@ import urgent from '@/assets/urgent.png'
 import download from '@/views/projectManage/components/export.vue'
 import '@/styles/PublicStyle/index.scss'
 import record from '@/views/projectManage/components/record.vue'
+import timeLine from '@/views/projectManage/components/timeLine.vue'
 export default {
   components: {
     searchPeople,
@@ -307,7 +338,8 @@ export default {
     bugTableDialog,
     schedule,
     download,
-    record
+    record,
+    timeLine
   },
   filters: {
     ellipsis(value, num) {
@@ -322,7 +354,9 @@ export default {
     return {
       urgent: urgent,
       showunlock: true,
+      textarea2: '',
       optionName: 'first',
+      visible: false, // Hold任务
       ScheduId: '', // 排期ID
       BackToTheLatest: false, // 回到最新
       LockState: {}, // 锁定状态
@@ -663,4 +697,14 @@ export default {
 .sign-tabs {
   padding: 0 30px;
 }
+.el-btn-size {
+   margin: 10px 30px;
+}
+</style>
+
+<style>
+.el-popper[x-placement^=bottom] {
+    margin: 12px 10px 0 0;
+    width: 300px;
+}
 </style>

+ 45 - 2
src/views/projectManage/taskList/taskViewDetail.vue

@@ -68,6 +68,36 @@
           <i class="el-icon-delete icon-delete" @click="deleteVisible = true" />
         </div>
       </el-header>
+      <el-container>
+        <section class="main-section">
+          <div class="Layout_space_between">
+            <div class="el-main-title">
+              <div class="title-left-icon" />
+              <div class="title-left-name">工作流</div>
+            </div>
+            <el-popover
+              v-model="visible"
+              placement="bottom-start"
+              width="300px"
+              :visible-arrow="false"
+              trigger="manual"
+            >
+              <el-input
+                v-model="textarea2"
+                type="textarea"
+                rows="5"
+                placeholder="请输入Hold原因(选填)"
+              />
+              <div style="text-align: right; margin-top: 10px;">
+                <el-button size="mini" type="text" @click="visible = false">取消</el-button>
+                <el-button type="primary" size="mini" @click="visible = false">确定</el-button>
+              </div>
+              <el-button slot="reference" class="el-btn-size" size="mini" @click="visible = !visible">Hold 任务</el-button>
+            </el-popover>
+          </div>
+          <timeLine />
+        </section>
+      </el-container>
       <!-- 概览 -->
       <el-container v-show="activeName === '1'" class="is-vertical">
         <section class="main-section">
@@ -325,10 +355,10 @@ import '@/styles/PublicStyle/index.scss'
 import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
 import download from '@/views/projectManage/components/export.vue'
 import record from '@/views/projectManage/components/record.vue'
+import timeLine from '@/views/projectManage/components/timeLine.vue'
 export default {
   components: {
     searchPeople,
-    // normalDialog,
     textArea,
     drawer,
     createdBug,
@@ -345,7 +375,8 @@ export default {
     bugTableDialog,
     schedule,
     download,
-    record
+    record,
+    timeLine
   },
   filters: {
     ellipsis(value, num) {
@@ -359,6 +390,8 @@ export default {
   data() {
     return {
       tabPosition: 'first',
+      textarea2: '',
+      visible: false, // Hold任务
       showunlock: true,
       ScheduId: '', // 排期ID
       LockState: {}, // 锁定状态
@@ -790,4 +823,14 @@ export default {
 .sign-tabs {
   padding: 0 30px;
 }
+.el-btn-size {
+   margin: 10px 30px;
+}
+</style>
+
+<style>
+.el-popper[x-placement^=bottom] {
+    margin: 12px 10px 0 0;
+    width: 300px;
+}
 </style>