<template>
  <div>
    <!--编辑imageplayer标签弹窗  -->
    <el-dialog title="编辑标签<cms:imageplayer>" class="dialog" :visible="isShowModal" @update:visible="closeHandler">
      <el-form :model="form" class="edit-tag-dialog" inline>
        <el-form-item label="将当前图片播放器替换为：">
          <el-select v-model="form.imageplayerType">
            <el-option label="首页图片播放器" value="sytpbfq"></el-option>
            <el-option label="诺奖专题" value="njzt"></el-option>
            <el-option label="国内栏目首页" value="gnlmsy"></el-option>
            <el-option label="军事新闻播放器" value="jsxwbfq"></el-option>
            <el-option label="李克强" value="likeqiang"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmClickHandler">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dataLoading: true, // 数据加载
      form: {
        // <cms:imageplayer>
        imageplayerType: 'jsxwbfq' // 当前图片播放器
      }
    }
  },
  props: {
    'isShowModal': {
      type: Boolean,
      required: true
    }
  },
  methods: {
    // 关闭弹窗
    closeHandler(val) {
      this.$emit('close', val)
    },

    // 编辑imageplayer标签确认按钮
    confirmClickHandler() {
      this.isShowModal = false // 隐藏弹窗
      this.update()
    },

    // 初始化批量添加include标签弹出框数据
    includeTableData() {
      //  let res = await axios.get('/ui/templates' {params: {condition}})
      // this.templatesData = data.data
      // this.dataLoading = false
    },

    // 数据更新
    update() {
      // let ids = [];
      // this.selectedRows.forEach(function (row) {
      //   ids.push(row.id);
      // });
      // let res = await axios.put(`/ui/templates/${ids.join()}`)
      // console.log(res)
      this.$notify({
        title: '成功',
        message: `操作成功`,
        type: 'success',
        duration: 2000
      })
    }
  },
  created() {
    this.includeTableData()
  }
}
</script>

<style>

</style>
