Blame view

antis-ncc-admin/src/views/workFlow/flowLaunch/Flow.vue 2.76 KB
03207d5d   wwk   1
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
  <template>
    <transition name="el-zoom-in-center">
      <div class="NCC-preview-main">
        <div class="NCC-common-page-header">
          <el-page-header @back="goBack" content="新建流程" />
          <div class="options">
            <el-button @click="goBack()">{{$t('common.cancelButton')}}</el-button>
          </div>
        </div>
        <div class="main">
          <div class="flowList">
            <div class="item" v-for="(item,i) in flowEngineList" :key="i">
              <p class="cap">{{item.fullName}}【{{item.num}}】</p>
              <div class="iconList">
                <div class="iconbox" v-for="(child,i) in item.children" :key="i" @click="jump(child)">
                  <div class="box-icon" :style="{backgroundColor:child.iconBackground||'#008cff'}">
                    <i :class="child.icon"></i>
                  </div>
                  <el-tooltip :content="child.fullName">
                    <p class="box-title">{{child.fullName}}</p>
                  </el-tooltip>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </transition>
  </template>
  
  <script>
  export default {
    data() {
      return {
        flowEngineList: []
      }
    },
    methods: {
      goBack() {
        this.$emit('close')
      },
      init(flowEngineList) {
        this.flowEngineList = flowEngineList.filter(o => o.children && Array.isArray(o.children) && o.children.length)
      },
      jump(item) {
        if (!item.enCode) {
          this.$message({
            type: 'error',
            message: '流程不存在'
          });
          return
        }
        this.$emit('chioceFlow', item)
      }
    }
  }
  </script>
  <style lang="scss" scoped>
  .main {
    padding: 10px 0 0;
    color: #606266;
    .flowList {
      margin: 16px;
      .cap {
        font-size: 14px;
        margin-bottom: 6px;
        font-weight: bold;
      }
      .item {
        &::after {
          content: '';
          display: block;
          clear: both;
        }
      }
      .iconbox {
        cursor: pointer;
        width: 90px;
        height: 90px;
        overflow: hidden;
        float: left;
        margin: 10px;
        margin-left: 0px;
        margin-bottom: 20px;
        &:hover {
          opacity: 0.8;
          .iconbox:hover .box-icon {
            box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.1);
          }
        }
        .box-icon {
          width: 50px;
          height: 50px;
          border-radius: 12px;
          text-align: center;
          margin: 0 auto;
          margin-top: 10px;
          margin-bottom: 10px;
          background-color: #ccc;
          i {
            text-align: center;
            font-size: 38px;
            color: #fff;
            line-height: 50px;
          }
        }
        .box-title {
          text-align: center;
          font-size: 12px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
  </style>