<template>
  <view class="approvalViewSteps">
    <view
      class="step-item"
      v-for="(step, index) in value"
      :class="index == value.length - 1 ? 'step-item-last' : ''"
    >
      <image
        class="icon-size step-item-icon"
        src="../../static/crm/detail/green.svg"
        mode=""
        v-if="step.state.value == 2"
      ></image>
      <image
        class="icon-size step-item-icon"
        v-if="step.state.value == 1"
        src="../../static/crm/detail/waiting.svg"
        mode=""
      ></image>
      <image
        class="icon-size step-item-icon"
        v-if="step.state.value == 3"
        src="../../static/crm/detail/X.svg"
        mode=""
      ></image>
      <view class="aic jcb" style="line-height: 0.6rem;">
        <view
          class=""
          v-if="
            $itemValue(step.nodeType) == 1 ||
            $itemValue(step.nodeType) == 2 ||
            $itemValue(step.nodeType) == 5
          "
        >
          {{ step.name }}
        </view>
        <view class="" v-if="$itemValue(step.nodeType) == 0">
          {{ step.assigneeName }} {{ step.name }}
        </view>
        <view class="" style="    color: #878fa4;">
          {{ step.checkTime ? step.checkTime : "" }}
        </view>
      </view>
      <view class="aic">
        <view
          class="aic userTaskList"
          v-for="(user, index) in step.userTaskList"
          :key="index"
        >
          <view class="">
            {{ user.name }}
          </view>
          <image
            class="icon-size"
            src="../../static/crm/detail/green.svg"
            mode=""
            v-if="user.state == 2"
          ></image>
          <image
            class="icon-size"
            src="../../static/crm/detail/X.svg"
            mode=""
            v-if="user.state == 3"
          ></image>
          {{
            step.userTaskList.length >= 2 &&
            step.userTaskList.length - 1 != index
              ? $itemValue(step.relation) == 1
                ? "&"
                : "/"
              : ""
          }}
        </view>
      </view>
    </view>

    <view v-if="value.length == 0" class="text-center text-gray9 notData">
      <noData title="暂无数据"></noData>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    value: {
      type: Array,
      default: () => [],
    },
  },
  model: {
    prop: "value",
    event: "change",
  },
  watch: {},
  data() {
    return {};
  },
  created() {},
};
</script>

<style lang="scss">
.approvalViewSteps {
  font-size: 28rpx;
  margin-top: 40rpx;
  color: #333333;

  .icon-size {
    width: 28rpx;
    height: 28rpx;
    margin: 0 10rpx;
  }
  .userTaskList {
    margin-top: 20rpx;
  }
  .step-item {
    min-height: 111rpx;
    border-left: 2px solid #dedede;
    padding-left: 40rpx;
    position: relative;
  }
  .step-item-icon {
    position: absolute;
    left: 0;
    top: 0;
    transform: translateX(-80%);
  }
  .step-item-last {
    border-left: 2px solid transparent;
  }
}
</style>
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