yangfeng
2023-09-15 36fb84a1ec003eb97502d8cc6f56bca67e1502a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<template>
  <div class="common-status">
    <div v-if="showButton" style="margin-left: 30px">
      <el-button plain size="mini" @click="delClick" :disabled="isDelClick">删除</el-button>
      <el-button plain size="mini" disabled>打印</el-button>
    </div>
    <div class="arrowsBox">
      <div
        class="arrowsItem"
        v-for="(item, index) in list"
        :key="index"
        :style="item.status === 'active' && index === 0 ? { background: '#495057' } : ''"
      >
        <div
          class="arrows_up arrows"
          :class="{
            arrows_active: item.status === 'active',
            arrows_done: item.status === 'done',
            arrows_todo: item.status === 'todo'
          }"
        ></div>
        <div
          class="arrows_down arrows"
          :class="{
            arrows_active: item.status === 'active',
            arrows_done: item.status === 'done',
            arrows_todo: item.status === 'todo'
          }"
        ></div>
        <div
          class="arrows_label arrows"
          :class="{
            arrows_label_active: item.status === 'active',
            arrows_label_done: item.status === 'done',
            arrows_label_todo: item.status === 'todo'
          }"
        >
          {{ item.label }}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "StatusCommonView",
  props: {
    list: {
      type: Array,
      //list:[{label: "完成", status: "active" }]
      default: () => []
    },
    showButton: {
      type: Boolean,
      default: false
    },
    isDelClick: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      delClick() {
        this.$emit("delClick")
      }
    }
  },
  methods: {}
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.common-status {
  overflow: hidden;
  border: 1px solid #e9e9e9;
  display: flex;
  align-items: center;
  .arrowsBox {
    margin-left: auto;
    display: flex;
    height: 35px;
    font-size: 14px;
    border-top: #cccbcb;
    border-bottom: #cccbcb;
    .arrowsItem {
      position: relative;
      height: 100%;
      width: 80px;
      .arrows_up {
        transform-origin: right top;
        transform: skewX(30deg);
        border-right: 1px solid #e9e9e9;
      }
      .arrows_down {
        transform-origin: right bottom;
        transform: skewX(-30deg);
        border-right: 1px solid #e9e9e9;
      }
      &:first-child {
        border-left: 1px solid #e9e9e9;
        width: 60px;
      }
      .arrows {
        height: 50%;
      }
      .arrows_label {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left: 10px;
        right: 0;
        bottom: 0;
        text-align: center;
      }
      // .arrows_done {
      //   background: #edf9ff;
      // }
      .arrows_active {
        background: #495057;
      }
      // .arrows_todo {
      //   background: #2c2c2c;
      // }
      // .arrows_label_done {
      //   color: #009fe9;
      // }
      .arrows_label_active {
        color: #fff;
      }
      // .arrows_label_todo {
      //   color: #fff;
      // }
    }
  }
}
</style>