<template>
  <div>
    <functionBar class="F_bar" />
    <b-container fluid>
      <b-row class="no-padding" style="padding-top: 70px">
        <b-col cols="12">
          <reviewProjectName style="margin-left: 0px" ref="reviewprojectName" @isEdit="isEdit" @isSaved="isSaved"/>
        </b-col>
      </b-row>
      <b-row>
        <reviewTable style="margin-left: 0px" ref="reviewTable" @isedit="isedit" @ispatch="ispatch"/>
      </b-row>
    </b-container>
  </div>
</template>

<script>
import functionBar from '@/views/FileManagement/FileEdit/functionBar.vue'
import reviewProjectName from '@/views/FileManagement/FileEdit/reviewProjectName.vue'
import reviewTable from '@/views/FileManagement/FileEdit/reviewTable.vue'

export default {
  data () {
    return {
    }
  },
  beforeRouteLeave (to, from, next) {
    if (this.isFix === true || this.isfix === true) {
      const answer = window.confirm('尚未儲存，確定離開當前畫面?')
      if (answer) {
        next()
      } else {
        next(false)
      }
    } else {
      next()
    }
  },
  methods: {
    isedit () {
      this.isFix = true
    },
    ispatch () {
      this.isFix = false
    },
    isEdit () {
      this.isfix = true
    },
    isSaved () {
      this.isfix = false
    }
  },
  components: {
    functionBar,
    reviewProjectName,
    reviewTable
  }
}
</script>

<style >
</style>
