<template>
  <div>
    <div class="panel-fieldset">
      <h4 class="panel-legend">统计配置</h4>
      <el-form-item label="开启自动统计：">
        <el-switch v-model="extend.autoStatFlag" :disabled="disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="使用第三方统计：">
        <el-switch v-model="extend.useThirdPartyStat" :disabled="disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="第三方统计代码：">
        <el-input type="textarea" v-model="extend.thirdPartyStatCode" :rows="2" placeholder="" :disabled="extend.useThirdPartyStat !== 'Y' || disabled" class="form-item"></el-input>
      </el-form-item>
    </div>
  </div>
</template>
<script>

export default {
  data() {
    return {
    }
  },
  methods: {
  },
  computed: {
    extend: {
      get() {
        return this.extends
      },
      set(val) {
        this.$emit('update:extends', val)
      }
    }
  },
  props: {
    extends: {
      type: Object,
      default: function () {
        return {
          autoStatFlag: 'Y', // 开启自动统计
          useThirdPartyStat: 'N', // 使用第三方统计
          thirdPartyStatCode: '' // 第三方统计代码
        }
      }
    },
    disabled: {
      type: Boolean
    }
  }
}
</script>
