<template>
  <el-dialog title="提示" width="520px" top="30vh" custom-class="cre-dialog" :modal-append-to-body="false" :visible.sync="dialogVisible" :before-close="close">
    <div v-loading="loading" class="flex">
      <div class="el-message-box__status el-icon-warning"></div>
      <div class="batch-content">
        <p class="batch-txt">{{ tips }}</p>
        <ul class="batch-ul">
          <li v-for="item in list" :key="item.id" class="batch-li" @click="handleClickItem(item)">
            <span class="relationName"> {{ item.busiObjRelationName }}</span> <span class="relationCreater">{{ item.busiObjRelationCreater }}创建</span>
          </li>
        </ul>
      </div>
    </div>
    <span class="footer" slot="footer">
      <el-button type="primary" @click="close">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    tips: {
      type: String,
      default: '当前短信模板已被以下活动引用，删除后引用该模板的活动短信将无法发送，慎重操作！如需删除模板，需要先暂停引用活动，才可删除'
    },
    list: {
      type: Array,
      default: () => []
    },
    loading: false
  },
  methods: {
    close() {
      this.$emit('update:dialogVisible', false);
    },
    handleClickItem(item) {
      console.log(item);
      //   智能营销 marketing/#/ecm/edit/id
      //   AI营销   marketing/#/ai/info/id
      //   短信营销 marketing/#/message/record/detail/id
    }
  }
};
</script>

<style lang="scss" scoped>
.cre-dialog {
  .batch-content {
    margin-left: 38px;
    .batch-txt {
      font-size: 14px;

      color: #303133;
      line-height: 20px;
    }
    .batch-ul {
      margin-top: 16px;
      li {
        display: flex;
        justify-content: space-around;
      }
      .relationName,
      .relationCreater {
        font-size: 14px;
        line-height: 20px;
        color: #303133;
      }
      .relationName {
        color: #2f54eb;
        cursor: pointer;
      }
    }
  }
  .footer {
    display: flex;
    justify-content: center;
  }
}
</style>
