<template>
  <div class="container">
    <el-dialog :modal-append-to-body="false" v-dialogDrag center top="5vh" :visible.sync="dialogVisible" customClass="customParticulars" :before-close="clickBtn">
      <div slot="title" style="display: flex; align-items: center">
        <img :src="$icons.particulars" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
        <span style="font-size: 16px">活动详情</span>
      </div>
      <div class="dialog-box">
        <div v-if="detailData.ActivityName" class="dialog-title">{{ detailData.ActivityName }}</div>
        <div class="test" v-if="detailData.ActivityTypeName">
          <p>活动类型：</p>
          <div class="paragraph" v-html="detailData.ActivityTypeName"></div>
        </div>
        <div class="test" v-if="detailData.ChartPermissionName">
          <p>所属行业：</p>
          <div class="paragraph" v-html="detailData.ChartPermissionName"></div>
        </div>
        <div class="test" v-if="detailData.ActivityTimeText">
          <p>活动时间：</p>
          <div class="paragraph" v-html="detailData.ActivityTimeText"></div>
        </div>
        <div class="test" v-if="detailData.DistinguishedGuest">
          <p>嘉&nbsp;&nbsp; &nbsp; &nbsp;宾：</p>
          <div class="paragraph" v-html="detailData.DistinguishedGuest"></div>
        </div>
        <div class="test" v-if="detailData.Host">
          <p>主&nbsp; 持&nbsp; 人：</p>
          <div class="paragraph" v-html="detailData.Host"></div>
        </div>
        <div class="test" v-if="detailData.Speaker">
          <p>主&nbsp; 讲&nbsp; 人：</p>
          <div class="paragraph" v-html="detailData.Speaker"></div>
        </div>
        <div class="test" v-if="detailData.Expert">
          <p>专&nbsp;&nbsp; &nbsp; &nbsp;家：</p>
          <div class="paragraph" v-html="detailData.Expert"></div>
        </div>
        <div class="test" v-if="detailData.City">
          <p>城&nbsp;&nbsp; &nbsp; &nbsp;市：</p>
          <div class="paragraph" v-html="detailData.City"></div>
        </div>
        <div class="test" v-if="detailData.MainlandTell">
          <p>大陆拨入：</p>
          <div class="paragraph" v-html="detailData.MainlandTell"></div>
        </div>
        <div class="test" v-if="detailData.HongKongTell">
          <p>香港拨入：</p>
          <div class="paragraph" v-html="detailData.HongKongTell"></div>
        </div>
        <div class="test" v-if="detailData.TaiwanTell">
          <p>台湾拨入：</p>
          <div class="paragraph" v-html="detailData.TaiwanTell"></div>
        </div>
        <div class="test" v-if="detailData.AmericaTell">
          <p>美国拨入：</p>
          <div class="paragraph" v-html="detailData.AmericaTell"></div>
        </div>
        <div class="test" v-if="detailData.ParticipationCode">
          <p>参会密码：</p>
          <div class="paragraph" v-html="detailData.ParticipationCode"></div>
        </div>
        <div class="test" v-if="detailData.OnlineParticipation">
          <p>网络参会：</p>
          <div class="paragraph" v-html="detailData.OnlineParticipation"></div>
        </div>
        <div class="test" v-if="detailData.Address">
          <p>活动地址：</p>
          <div class="paragraph" v-html="detailData.Address"></div>
        </div>
        <div class="test" v-if="detailData.Highlights">
          <p>活动亮点：</p>
          <div class="paragraph" v-html="detailData.Highlights"></div>
        </div>
        <div class="test" v-if="detailData.ReportLink">
          <p>报告链接：</p>
          <div class="paragraph" v-html="detailData.ReportLink"></div>
        </div>
        <div class="test" v-if="detailData.Theme">
          <p>主&nbsp;&nbsp; &nbsp; &nbsp;题：</p>
          <div class="paragraph" v-html="detailData.Theme"></div>
        </div>
        <div class="test" v-if="detailData.TencentConferenceNumber">
          <p>腾讯会议号：</p>
          <div class="paragraph" v-html="detailData.TencentConferenceNumber"></div>
        </div>
        
        <div class="test" v-if="detailData.Remarks">
          <p>备&nbsp;&nbsp; &nbsp; &nbsp;注：</p>
          <div class="paragraph" v-html="detailData.Remarks"></div>
        </div>
      </div>
      <div class="type-scale" v-if="detailData.IsLimitPeople == 1">
        <div style="flex-shrink: 0; margin-right: 10px">活动可见：</div>
        <div>
          <div class="item" v-if="checkedCities.length">
            <span style="width: 70px; flex-shrink: 0" class="text-right"> 套餐类型：</span>
            <el-checkbox-group v-model="checkedCities">
              <span v-for="item in cities" :key="item.CustomerTypeId">
                <el-checkbox style="margin-right: 10px" :label="item.CustomerTypeId" disabled v-if="checkedCities.includes(item.CustomerTypeId)">
                  {{ item.CustomerName }}
                  <el-tooltip :content="item.Explain" placement="top-start" v-if="item.Explain">
                    <i class="el-icon-info" />
                  </el-tooltip>
                </el-checkbox>
              </span>
            </el-checkbox-group>
          </div>
          <div class="item" v-if="checkScaleList.length">
            <span class="text-right"> 管理规模： </span>
            <el-checkbox-group v-model="checkScaleList">
              <el-checkbox v-if="checkScaleList.includes('3')" disabled label="3">100亿以上</el-checkbox>
              <el-checkbox v-if="checkScaleList.includes('2')" disabled label="2">50～100亿</el-checkbox>
            </el-checkbox-group>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { raiInterface } from "@/api/api.js";
export default {
  name: "",
  components: {},
  props: {
    detailData: {
      type: Object,
    },
    dialogVisible: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      cities: [], //
      checkedCities: [],
      checkScaleList: [],
    };
  },
  computed: {},
  watch: {
    detailData: {
      handler(newValue) {
        if (Object.values(newValue).length > 0) {
          this.checkedCities = newValue.CustomerTypeIds ? newValue.CustomerTypeIds.split(",").map((item) => Number(item)) : [];
          this.checkScaleList = newValue.Scale ? newValue.Scale.split(",") : [];
        }
      },
      deep: true,
    },
  },
  created() {},
  mounted() {
    this.customerTypelist();
  },
  methods: {
    clickBtn() {
      this.$emit("update:detailData", {});
      this.$emit("update:dialogVisible", false);
    },
    //获取多选的客户列表
    customerTypelist() {
      raiInterface.customerTypelist().then((res) => {
        if (res.Ret === 200) {
          this.cities = res.Data.List;
        }
      });
    },
  },
};
</script>
<style lang="scss">
.customParticulars {
  width: 550px !important;
  padding-bottom: 20px;
  .type-scale {
    margin-top: 20px;
    display: flex;
    .item {
      display: flex;
      margin-bottom: 20px;
    }
  }
}
.dialog-box {
  box-sizing: border-box;
  width: 501px;
  border: 1px solid #dcdfe6;
  font-size: 14px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #666666;
  .test {
    display: flex;
    padding: 13px 30px;
    border-top: 1px solid #dcdfe6;
    p {
      width: 104px !important;
      text-align: justify;
    }
    .paragraph {
      padding: 0;
      margin: 0;
      width: 100%;
      p {
        width: 100% !important;
        text-align: left;
      }
    }
  }
  .dialog-title {
    padding: 13px 30px;
    border-top: none;
    text-align: center;
    background: #f0f2f5;
  }
}
</style>
