<style>
  .tradeActiviTy .el-form-item__label{
    line-height: 23px;
  }
</style>
<template>
  <div :class="{'active':tradeActivityData.isCked}">
 
    <div class="diy-component-options" v-if="tradeActivityData.isCked">
      <el-button type="primary" icon="el-icon-delete" style="left: -25px; top: 0px;" @click="delPlugin()"></el-button>
      <el-button type="primary" icon="el-icon-document-copy" style="left: -25px; top: 30px;"></el-button>
      <el-button type="primary" icon="el-icon-arrow-up" v-if="index>0" @click="resetSord(0)"
        style="right: -25px; top: 0;"></el-button>
      <el-button type="primary" icon="el-icon-arrow-down" v-if="index!=dataLeng-1" @click="resetSord(1)"
        style="right: -25px; top: 30px;"></el-button>
    </div>
    <div class="diy-component-preview">
      <div class="diy-link" flex="cross:center;" style="background:#fff;">
        <div flex="dir:left cross:center" style="margin:20px;">
          <div class="title" style="text-align: left">
            活动编号：{{data.ActivityIds}}
          </div>
          <div class="title" style="text-align: left;margin-left:20px;">
            默认活动编号： {{data.DefaultActivityId}}
          </div>
        </div>
      </div>
    </div>
    <div class="diy-component-edit tradeActiviTy" v-if="tradeActivityData.isCked">
      <el-form label-width="100px" @submit.native.prevent>
        <el-form-item label="活动编号(多个逗号分隔)">
          <el-input size="small" style="width:200px;" v-model="data.ActivityIds"></el-input>
        </el-form-item>
        <el-form-item label="默认活动编号">
          <el-input size="small" style="width:200px;" v-model="data.DefaultActivityId"></el-input>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
 
  export default {
    props: ["tradeActivityData", "index", "dataLeng"],
    components: {
 
    },
    data() {
      return {
        choicImg: false,
        isShowLink: false,
        data: this.tradeActivityData.data,
      };
    },
    watch: {
      tradeActivityData(newVal, oldVal) {
        this.data = this.tradeActivityData.data;
      },
    },
    created() {

    },
    methods: {
      //向父组件传值 并调用排序
      resetSord(IsUp) {
        this.$emit('getSord', this.index, IsUp);
      },
      //点击触发父组件删除
      delPlugin() {
        this.$emit('comDelPlugin', this.index);
      },
    },
    computed: {

    },
    mounted() {

    }
  };

</script>
