<template>
  <el-dialog
    center
    class="page_pc_diy_dialog"
    custom-class="center-dialog"
    :fullscreen="true"
    :title="title"
    top="0vh"
    :visible.sync="dialogFormVisible"
    width="80%"
    @close="close"
  >
    <iframe
      class="placeholder"
      frameborder="0"
      scrolling="auto"
      :src="
        'diy-pc/index.html?page_id=' +
        page_id +
        '&api_url=' +
        encodeURIComponent(URL.api_url) +
        '&admin_url=' +
        encodeURIComponent(URL.admin_url)
      "
      style="width: 100%; height: 770px"
    ></iframe>
    <div slot="footer" v-if="false" class="dialog-footer">
      <el-button @click="close">{{ __('确定') }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import { URL } from '@/config'
  import { getToken } from '@/utils/token'
  import { mapGetters } from 'vuex'

  import { translateTitle as __ } from '@/utils/i18n'
  //参见pc装修列表页

  //点击装修 - 弹出窗口，全屏，  内置iframe  = diy-pc/index.html?page_id=1002

  export default {
    name: 'PageBaseDiy',
    components: {},
    data() {
      return {
        URL: URL,
        page_id: '',
        title: '',

        dialogFormVisible: false,
      }
    },
    created() {
      // 获取页面传递的参数
      let queryParams = this.$route.query
    },
    methods: {
      __,
      showDiy(row) {
        this.dialogFormVisible = true
        this.page_id = row.page_id
      },
      close() {
        this.dialogFormVisible = false
      },
    },
  }
</script>
