<template>
  <div>
    <div class="panel-fieldset">
      <h4 class="panel-legend">评论配置</h4>
      <el-form-item label="是否允许评论：">
        <el-switch v-model="extend.commentEnable" :disabled="disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="评论是否需要登录：">
        <el-switch v-model="extend.commentLogin" :disabled="extend.commentEnable!=='Y' || disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="评论是否需要审核：">
        <el-switch v-model="extend.commentVerify" :disabled="extend.commentEnable!=='Y' || disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="是否允许输入链接：">
        <el-switch v-model="extend.commentUrlEnable" :disabled="extend.commentEnable!=='Y' || disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="是否替换(链接/敏感词)：">
        <el-switch v-model="extend.commentRLSWord" :disabled="disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
      <el-form-item label="(链接/敏感词)替换为：">
        <el-input v-model="extend.commentLinkSensitiveWord" :disabled="extend.commentRLSWord!=='Y' || disabled" class="form-item"></el-input>
      </el-form-item>
      <el-form-item label="表情评论是否限制IP：">
        <el-switch v-model="extend.commentFaceLimit" :disabled="disabled" active-value="Y" inactive-value="N"></el-switch>
      </el-form-item>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {}
  },
  computed: {
    extend: {
      get() {
        return this.extends
      },
      set(val) {
        this.$emit('update:extends', val)
      }
    }
  },
  methods: {},
  created() {},
  props: {
    extends: {
      type: Object,
      default: function() {
        return {
          commentEnable: 'Y', // 是否允许评论
          commentLogin: 'N', // 评论是否需要登录
          commentVerify: 'Y', // 评论是否需要审核
          commentUrlEnable: 'Y', // 是否允许输入连接
          commentRLSWord: 'Y', // 是否替换(链接/敏感词)
          commentLinkSensitiveWord: '******', // (链接/敏感词)替换为
          commentFaceLimit: 'N' // 表情评论是否限制IP
        }
      }
    },
    disabled: {
      type: Boolean
    }
  }
}
</script>
