reedliuqing_i 5 years ago
parent
commit
be9bcb0882

+ 4 - 3
package.json

@@ -40,9 +40,9 @@
     "path-to-regexp": "2.4.0",
     "qrcodejs2": "0.0.2",
     "simditor": "^2.3.26",
-    "swiper": "^4.5.0",
     "v-jsoneditor": "^1.2.2",
     "vue": "2.6.10",
+    "vue-awesome-swiper": "^4.0.4",
     "vue-fullcalendar": "^1.0.9",
     "vue-json-viewer": "^2.2.8",
     "vue-qr": "^2.2.1",
@@ -71,15 +71,16 @@
     "html-webpack-plugin": "3.2.0",
     "mockjs": "1.0.1-beta3",
     "node-sass": "^4.9.0",
-    "stylus": "^0.54.7",
-    "stylus-loader": "^3.0.2",
     "runjs": "^4.3.2",
     "sass-loader": "^7.1.0",
     "script-ext-html-webpack-plugin": "2.1.3",
     "script-loader": "^0.7.2",
     "serve-static": "^1.13.2",
+    "stylus": "^0.54.7",
+    "stylus-loader": "^3.0.2",
     "svg-sprite-loader": "4.1.3",
     "svgo": "1.2.2",
+    "swiper": "^4.5.1",
     "vue-template-compiler": "2.6.10"
   },
   "engines": {

BIN
src/icons/png/next.png


BIN
src/icons/png/previous.png


+ 22 - 2
src/views/projectManage/version/list/index.vue

@@ -46,9 +46,12 @@
             </el-select>
           </el-col>
           <el-col :span="4">
-            <div style="font-size: 14px;color: #00A0FF;cursor: pointer;line-height: 32px;text-align: right">版本详情</div>
+            <div style="font-size: 14px;color: #00A0FF;cursor: pointer;line-height: 32px;text-align: right" @click="timeLineShow = !timeLineShow">{{ timeLineShow?'收起详情':'版本详情' }}</div>
           </el-col>
         </el-row>
+        <div v-if="timeLineShow" class="time-line-container">
+          <time-line :steps="timeLineSteps" />
+        </div>
       </el-main>
       <div class="layout_main version_list_layout_main">
         <div style="display:flex;align-items: center;padding:20px">
@@ -126,15 +129,26 @@
 </template>
 
 <script>
+import TimeLine from './timeLine'
 import { getVersionHomePageList, showAppClientEnum, showVersionEnum } from '@/api/version.js'
 import VersionChart from '@/components/chart/index.vue'
 
 export default {
   components: {
-    VersionChart
+    VersionChart,
+    TimeLine
   },
   data() {
     return {
+      timeLineSteps: [
+        { dateLabel: 'January 2017', title: 'Gathering Information' },
+        { dateLabel: 'February 2017', title: 'Planning' },
+        { dateLabel: 'March 2017', title: 'Design' },
+        { dateLabel: 'April 2017', title: 'Content Writing and Assembly' },
+        { dateLabel: 'May 2017', title: 'Coding' },
+        { dateLabel: 'June 2017', title: 'Testing, Review & Launch' },
+        { dateLabel: 'July 2017', title: 'Maintenance' }],
+      timeLineShow: false,
       priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD'],
       tableData: [],
       loading: false,
@@ -442,6 +456,12 @@ export default {
 </script>
 
 <style scoped>
+.time-line-container {
+  margin-top: 20px;
+  border: 1px solid rgba(238,238,238,1);
+  background: #FCFCFC;
+  border-radius: 4px;
+}
 .queryName {
   display: inline-block;
   width: 80px;

+ 144 - 0
src/views/projectManage/version/list/timeLine.vue

@@ -0,0 +1,144 @@
+<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="timestamp">
+          <span class="date">{{ item.dateLabel }}</span>
+        </div>
+        <div class="status">
+          <span>{{ item.title }}</span>
+        </div>
+      </swiper-slide>
+      <!-- 分页器 -->
+      <div slot="pagination" class="swiper-pagination" />
+      <!-- 左右箭头 -->
+    </swiper>
+    <div class="swiper-button">
+      <div class="swiper-button-prev" />
+      <div class="swiper-button-next" />
+    </div>
+  </div>
+</template>
+
+<script>
+import 'swiper/dist/css/swiper.css'
+// import Swiper from 'swiper'
+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: 'January 2017', title: 'Gathering Information' },
+          { dateLabel: 'February 2017', title: 'Planning' },
+          { dateLabel: 'March 2017', title: 'Design' },
+          { dateLabel: 'April 2017', title: 'Content Writing and Assembly' },
+          { dateLabel: 'May 2017', title: 'Coding' },
+          { dateLabel: 'June 2017', title: 'Testing, Review & Launch' },
+          { dateLabel: 'July 2017', title: 'Maintenance' }
+        ]
+      }
+    }
+  },
+  data() {
+    return {
+      options: {
+        // 设置点击箭头
+        navigation: {
+          nextEl: '.swiper-button-next',
+          prevEl: '.swiper-button-prev'
+        },
+        pagination: {
+          el: '.swiper-pagination'
+        },
+        // pagination: '.swiper-pagination',
+        slidesPerView: 5,
+        grabCursor: true
+      }
+    }
+  },
+  computed: {
+    swiper() {
+      return this.$refs.mySwiper.$swiper
+    }
+  },
+  mounted() {
+  }
+}
+</script>
+
+<style scoped>
+.swiper-container {
+  padding: 50px 0;
+}
+.timeline {
+  width: 90%;
+  list-style-type: none;
+  display: flex;
+  padding: 0;
+  text-align: center;
+}
+.timeline li {
+  transition: all 200ms ease-in;
+}
+.timestamp {
+  width: 200px;
+  margin-bottom: 20px;
+  padding: 0px 40px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  font-weight: 100;
+}
+.status {
+  padding: 0px 10px;
+  display: flex;
+  justify-content: center;
+  border-top: 4px solid #409eff;
+  position: relative;
+  transition: all 200ms ease-in ;
+}
+
+.status span {
+  font-weight: 600;
+  padding-top: 20px;
+}
+.status span:before {
+  content: '';
+  width: 25px;
+  height: 25px;
+  background-color: #e8eeff;
+  border-radius: 25px;
+  border: 4px solid #409eff;
+  position: absolute;
+  top: -18px;
+  left: 42%;
+  transition: all 200ms ease-in;
+}
+.swiper-slide {
+  height: 150px;
+  width: 200px;
+  text-align: center;
+  font-size: 18px;
+}
+.swiper-slide:nth-child(2n) {
+  width: 40%;
+}
+.swiper-slide:nth-child(3n) {
+  width: 20%;
+}
+.swiper-button {
+  position: relative;
+  top: -108px;
+}
+</style>