<!--
  使用案例
  <LineCenterDialog
    :visible="testVisible"
    @close="testVisible = false"
  />
-->

<template>
  <div class="line_center_dialog">
    <RCSDialog
      :title="title"
      :visible="dialogVisible"
      :before-close="rcsDialogbeforeClose['lineCenter']"
      :destroy-on-close="true"
      :paddingempty="true"
      :hiddentitle="true"
      :append-to-body="true"
    >
      <template #header />
      <template #default>
        <lineCenter
          :value="{'chsMenuName': 'menu.forexSpot'}"
        />
      </template>
      <template #footer />
    </RCSDialog>
  </div>
</template>
<script>
import RCSDialog from '@/components/RCSDialog';
import lineCenter from '../../lineCenter';
export default {
  name: 'LineCenterDialog',
  components: {
    RCSDialog,
    lineCenter,
  },
  props: {
    title: {
      type: String,
      default: '',
    },
    visible: {
      type: Boolean,
      default: false,
    },
    onClose: {
      type: Function,
      default: null,
    },
  },
  data() {
    return {
      dialogVisible: false,
      rcsDialogbeforeClose: {
        'lineCenter': (done) => {
          console.log('before-close');
          this.close();
        },
      },
      rcsDialogBtnEvent: {
        'lineCenterClose': () => {
          this.close();
        },
      },
    };
  },
  watch: {
    visible(newVal) {
      this.dialogVisible = newVal;
    },
  },
  methods: {
    close() {
      this.dialogVisible = false;
      this.$emit('close');
      if (this.onClose) {
        this.onClose();
      }
    },
    show() {
      this.dialogVisible = true;
    },
  },
};
</script>
<style lang="scss" scoped>
.dcs_details_dialog {

}
</style>
