SeqList.vue 1.32 KB
Newer Older
liuxin committed
1 2
<template>
<div>
潘际乾 committed
3 4
  <c-row class="m-swf-message-content-seq-title" >
    <c-col v-if="pattern.cyccnt == 1" :span="1">
liuxin committed
5
      <i class="el-icon-circle-plus-outline" @click="handleAdd"></i>
潘际乾 committed
6
    </c-col>
潘际乾 committed
7
    <c-col :span="24">
liuxin committed
8
      {{pattern.desp}}
潘际乾 committed
9 10
    </c-col>
  </c-row>
liuxin committed
11 12 13 14 15 16 17
  <div v-for="(item, index) in pattern.seqs" :key="index">
    <message-area :pattern="item" v-bind="$attrs" :seqlist="[...seqlist,{seqlist: pattern.seqlist, status: pattern.status}]">
      <template v-slot:icon>
        <i v-if="index !== 0" class="el-icon-circle-close" @click="handleDelete(index)"></i>
      </template>
    </message-area>
  </div>
潘际乾 committed
18 19
  <c-row class="m-swf-message-content-seq-title" >
    <c-col>
liuxin committed
20
      {{pattern.cyccnt==0?`End Of ${pattern.desp}`:pattern.desp.replace(/^[-]+>/,'------|')}}
潘际乾 committed
21 22
    </c-col>
  </c-row>
liuxin committed
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
</div>
</template>
<script>
export default {
  name: 'seq-list',
  props: {
    pattern: {
      type: Object,
      default: () => {}
    },
    seqlist: {
      type: Array,
      default: () => []
    }
  },
  data: function () {
    return {}
  },
  methods: {
    handleAdd: function () {
      this.pattern.seqs.push(this.pattern.pattern)
    },
    handleDelete: function (index) {
      this.pattern.seqs.splice(index, 1)
    }
  }
}
</script>
<style>
.m-swf-message-content-seq-title {
  line-height: 30px;
  font-weight: 600;
}
</style>