CurdWindow.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div>
  3. <TabGridEdit ref="windowGridEdit" :window-no="windowNo" />
  4. </div>
  5. </template>
  6. <script>
  7. import Common from '../common/Common.js';
  8. import TabGridEdit from './tabGridView/TabGridEdit.vue';
  9. import WindowServerUtil from '../resource/dictionary/WindowServerUtil.js';
  10. import { Notify, Uuid } from 'pc-component-v3';
  11. export default {
  12. components: {
  13. TabGridEdit,
  14. },
  15. /**
  16. * 在离开路由之前,判断数据是否已保存
  17. */
  18. beforeRouteLeave: function (to, from, next) {
  19. var _self = this;
  20. if (_self.$refs.windowGridEdit != undefined && _self.$refs.windowGridEdit.hasDataChanged() == true) {
  21. Notify.notice(_self.$t('lang.window.dataNotSaved'), _self.$t('lang.window.describe1'), false);
  22. next(false);
  23. } else {
  24. next();
  25. }
  26. },
  27. data: function () {
  28. return {
  29. 'windowNo': '',
  30. };
  31. },
  32. watch: {
  33. '$route': function (to, from) {
  34. this.initView();
  35. },
  36. },
  37. mounted: function () {
  38. this.initView();
  39. },
  40. methods: {
  41. initView: function () {
  42. var _self = this;
  43. this.windowNo = this.$route.params.windowNo;
  44. },
  45. },
  46. };
  47. </script>
  48. <style>
  49. </style>