<template>
  <div>
    <div class="detail-panel">
      <div class="panel-header">
        <div class="title">
          图文消息
        </div>
      </div>
      <el-row>
        <el-col :span="10" :offset="1">
          <el-form-item prop="imgText.titleMinLength" label="标题最小长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.titleMinLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.titleMaxLength" label="标题最大长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.titleMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.contentMaxLength" label="内容长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.contentMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgMaxCount" label="图片数量" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.imgMaxCount"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgMaxSize" label="图片大小" :verify="['Regex=^[1-9]([0-9]{0,8})[kmgtpezybndKMGTPEZYBND]?[bB]?(?<!\d)$|必须以数字开头，单位为B,KB,M,MB,G,GB...']">
            <el-input v-model="tmpCondition.imgText.imgMaxSize"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgPixelMaxWidth" label="图片分辨率宽" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.imgPixelMaxWidth"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgPixelMaxHeight" label="图片分辨率高" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.imgPixelMaxHeight"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImageMaxSize" label="封面图大小" :verify="['Regex=^[1-9]([0-9]{0,8})[kmgtpezybndKMGTPEZYBND]?[bB]?(?<!\d)$|必须以数字开头，单位为B,KB,M,MB,G,GB...']">
            <el-input v-model="tmpCondition.imgText.coverImageMaxSize"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMinWidth" label="封面图最小像素宽" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMinWidth"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMaxWidth" label="封面图最大像素宽" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMaxWidth"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMinHeight" label="封面图最小像素高" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMinHeight"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMaxHeight" label="封面图最大像素高" :verify="['Number']">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMaxHeight"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImageFormat" label="封面图格式">
            <el-checkbox-group v-model="tmpCondition.imgText.coverImageFormat">
              <el-checkbox v-for="item in imgFormatOptions" :key="item.ID" :label="item.ID">{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
          <el-form-item prop="imgText.imgFormat" label="图片格式">
            <el-checkbox-group v-model="tmpCondition.imgText.imgFormat">
              <el-checkbox v-for="item in imgFormatOptions" :key="item.ID" :label="item.ID">{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="imgText.titleMinLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.titleMinLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.titleMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.titleMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.contentMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.contentMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgMaxCountMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.imgMaxCountMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgMaxSizeMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.imgMaxSizeMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgPixelMaxWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.imgPixelMaxWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgPixelMaxHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.imgPixelMaxHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImageMaxSizeMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.coverImageMaxSizeMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMinWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMinWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMaxWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMaxWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMinHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMinHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImagePixelMaxHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.coverImagePixelMaxHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.coverImageFormatMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.coverImageFormatMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgText.imgFormatMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgText.imgFormatMsg"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </div>
    <div class="detail-panel">
      <div class="panel-header">
        <div class="title">
          图集
        </div>
      </div>
      <el-row>
        <el-col :span="10" :offset="1">
          <el-form-item prop="imgGroup.titleMinLength" label="标题最小长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.titleMinLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.titleMaxLength" label="标题最大长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.titleMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgMaxSize" label="图片大小" :verify="['Regex=^[1-9]([0-9]{0,8})[kmgtpezybndKMGTPEZYBND]?[bB]?(?<!\d)$|必须以数字开头，单位为B,KB,M,MB,G,GB...']">
            <el-input v-model="tmpCondition.imgGroup.imgMaxSize"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgMinCount" label="图片最小数量" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.imgMinCount"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgMaxCount" label="图片最大数量" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.imgMaxCount"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.descriptionMinLength" label="图片说明最小长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.descriptionMinLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.descriptionMaxLength" label="图片说明最大长度" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.descriptionMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMinWidth" label="封面图最小像素宽" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMinWidth"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMaxWidth" label="封面图最大像素宽" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMaxWidth"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMinHeight" label="封面图最小像素高" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMinHeight"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMaxHeight" label="封面图最大像素高" :verify="['Number']">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMaxHeight"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImageFormat" label="封面图格式">
            <el-checkbox-group v-model="tmpCondition.imgGroup.coverImageFormat">
              <el-checkbox v-for="item in imgFormatOptions" :key="item.ID" :label="item.ID">{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
          <el-form-item prop="imgGroup.imgFormat" label="图片格式">
            <el-checkbox-group v-model="tmpCondition.imgGroup.imgFormat">
              <el-checkbox v-for="item in imgFormatOptions" :key="item.ID" :label="item.ID">{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="imgGroup.titleMinLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.titleMinLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.titleMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.titleMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgMaxSizeMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.imgMaxSizeMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgMinCountMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.imgMinCountMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgMaxCountMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.imgMaxCountMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.descriptionMinLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.descriptionMinLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.descriptionMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.descriptionMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMinWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMinWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMaxWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMaxWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMinHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMinHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImagePixelMaxHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.coverImagePixelMaxHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.coverImageFormatMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.coverImageFormatMsg"></el-input>
          </el-form-item>
          <el-form-item prop="imgGroup.imgFormatMsg" label="提示信息">
            <el-input v-model="tmpCondition.imgGroup.imgFormatMsg"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </div>
    <div class="detail-panel">
      <div class="panel-header">
        <div class="title">
          视频消息
        </div>
      </div>
      <el-row>
        <el-col :span="10" :offset="1">
          <el-form-item prop="video.titleMinLength" label="标题最小长度" :verify="['Number']">
            <el-input v-model="tmpCondition.video.titleMinLength"></el-input>
          </el-form-item>
          <el-form-item prop="video.titleMaxLength" label="标题最大长度" :verify="['Number']">
            <el-input v-model="tmpCondition.video.titleMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMinLength" label="视频最小长度" :verify="['Regex=\d{1,5}[sSmMhH]+$|必须以数字开头单位为s/S m/M h/M']">
            <el-input v-model="tmpCondition.video.videoMinLength"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMaxLength" label="视频最大长度" :verify="['Regex=\d{1,5}[sSmMhH]+$|必须以数字开头单位为s/S m/M h/M']">
            <el-input v-model="tmpCondition.video.videoMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMaxSize" label="视频大小" :verify="['Regex=^[1-9]([0-9]{0,8})[mgtpezybndMGTPEZYBND]?[bB]?(?<!\d)$|必须以数字开头，单位为B,KB,M,MB,G,GB...']">
            <el-input v-model="tmpCondition.video.videoMaxSize"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMaxRate" label="视频码率">
            <el-input v-model="tmpCondition.video.videoMaxRate"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoTagsMaxLength" label="标签长度" :verify="['Number']">
            <el-input v-model="tmpCondition.video.videoTagsMaxLength"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoTagsMinCount" label="视频标签最小数量" :verify="['Number']">
            <el-input v-model="tmpCondition.video.videoTagsMinCount"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoTagsMaxCount" label="视频标签最大数量" :verify="['Number']">
            <el-input v-model="tmpCondition.video.videoTagsMaxCount"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImageMaxSize" label="封面图大小" :verify="['Regex=^[1-9]([0-9]{0,8})[mgtpezybndMGTPEZYBND]?[bB]?(?<!\d)$|必须以数字开头，单位为B,KB,M,MB,G,GB...']">
            <el-input v-model="tmpCondition.video.coverImageMaxSize"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMinWidth" label="封面图最小像素宽" :verify="['Number']">
            <el-input v-model="tmpCondition.video.coverImagePixelMinWidth"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMaxWidth" label="封面图最大像素宽" :verify="['Number']">
            <el-input v-model="tmpCondition.video.coverImagePixelMaxWidth"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMinHeight" label="封面图最小像素高" :verify="['Number']">
            <el-input v-model="tmpCondition.video.coverImagePixelMinHeight"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMaxHeight" label="封面图最大像素高" :verify="['Number']">
            <el-input v-model="tmpCondition.video.coverImagePixelMaxHeight"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImageFormat" label="封面图格式">
            <el-checkbox-group v-model="tmpCondition.video.coverImageFormat">
              <el-checkbox v-for="item in imgFormatOptions" :key="item.ID" :label="item.ID">{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
          <el-form-item prop="video.videoFormat" label="视频格式">
            <el-checkbox-group v-model="tmpCondition.video.videoFormat">
              <el-checkbox v-for="item in videoFormatOptions" :key="item.ID" :label="item.ID">{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="video.titleMinLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.titleMinLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.titleMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.titleMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMinLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoMinLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMaxSizeMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoMaxSizeMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoMaxRateMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoMaxRateMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoTagsMaxLengthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoTagsMaxLengthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoTagsMinCountMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoTagsMinCountMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoTagsMaxCountMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoTagsMaxCountMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImageMaxSizeMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.coverImageMaxSizeMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMinWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.coverImagePixelMinWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMaxWidthMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.coverImagePixelMaxWidthMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMinHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.coverImagePixelMinHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImagePixelMaxHeightMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.coverImagePixelMaxHeightMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.coverImageFormatMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.coverImageFormatMsg"></el-input>
          </el-form-item>
          <el-form-item prop="video.videoFormatMsg" label="提示信息">
            <el-input v-model="tmpCondition.video.videoFormatMsg"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    conditionForm: Object
  },
  computed: {
    tmpCondition: {
      get() {
        return this.conditionForm
      },
      set(val) {
        this.$emit('update:conditionForm', val)
      }
    }
  },
  data() {
    return {
      imgFormatOptions: [],
      videoFormatOptions: []
    }
  },
  async created() {
    let res = await Promise.all([
      axios.get('/ui/resourceformt/omqqimg'),
      axios.get('/ui/resourceformt/omqqvideo')
    ])
    this.imgFormatOptions = res[0].data.data
    this.videoFormatOptions = res[1].data.data
  }
}
</script>
