<template>
  <div>
    <TabGridEdit ref="windowGridEdit" :window-no="windowNo" />
  </div>
</template>

<script>
import Common from '../common/Common.js';


import TabGridEdit from './tabGridView/TabGridEdit.vue';
import WindowServerUtil from '../resource/dictionary/WindowServerUtil.js';
import { Notify, Uuid } from 'pc-component-v3';

export default {

  components: {
    TabGridEdit,
  },

  /**
     * 在离开路由之前，判断数据是否已保存
     */
  beforeRouteLeave: function (to, from, next) {
    var _self = this;
    if (_self.$refs.windowGridEdit != undefined && _self.$refs.windowGridEdit.hasDataChanged() == true) {
      Notify.notice(_self.$t('lang.window.dataNotSaved'), _self.$t('lang.window.describe1'), false);
      next(false);
    } else {
      next();
    }
  },
  data: function () {
    return {
      'windowNo': '',
    };
  },

  watch: {
    '$route': function (to, from) {
      this.initView();
    },
  },

  mounted: function () {
    this.initView();
  },

  methods: {
    initView: function () {
      var _self = this;
      this.windowNo = this.$route.params.windowNo;
    },
  },
};
</script>


<style>
</style>