TabFormEditModalTest.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <TabFormEditModal
  3. v-model:open="openTabEditModal"
  4. :is-restore-data="tabEditViewIsRestoreData"
  5. :window-no="curdWindowNo"
  6. :tab-index="tabIndex"
  7. :type="tabEditViewType"
  8. :model-data-id="tabEditViewRecordId"
  9. width="100%"
  10. @open-tab-form-view="openTabFormViewModal"
  11. />
  12. <TabFormViewModal
  13. v-model:open="openTabViewModal"
  14. :window-no="curdWindowNo"
  15. :tab-index="tabIndex"
  16. :type="tabFormViewType"
  17. :model-data-id="tabFormViewRecordId"
  18. width="100%"
  19. @open-tab-edit-view="openTabEditView"
  20. />
  21. </template>
  22. <script setup>
  23. import { ref } from 'vue';
  24. import TabFormEditModal from '../../src/window1/tabFormEdit/TabFormEditModal.vue';
  25. import TabFormViewModal from '../../src/window1/tabFormView/TabFormViewModal.vue';
  26. const curdWindowNo = ref('20240910_193059');
  27. const tabIndex = ref(0);
  28. const openTabEditModal = ref(false);
  29. const tabEditViewType = ref('');
  30. const tabEditViewRecordId = ref(null);
  31. const tabEditViewCurrentPage = ref(null);
  32. const tabEditViewCurrentIndex = ref(null);
  33. const tabEditViewTotalRecords = ref(null);
  34. const tabEditViewIsRestoreData = ref(false);
  35. const openTabViewModal = ref(true);
  36. const tabFormViewRecordId = ref(476306266914880);
  37. const tabFormViewType = ref('view');
  38. /**
  39. * 打开页签视图模式
  40. * @param param 信息
  41. * 属性1: type: 类型,
  42. * 属性1: windowNo: CURD窗口编号,
  43. * 属性2: tabIndex: CURD页签编号,
  44. * 属性3: modelDataId: 数据记录id,
  45. * 属性4: currentPage: 当前记录所在的页码,
  46. * 属性5: currentIndex: 当前记录的排序,
  47. * 属性6: totalRecords: 记录的总数量,
  48. * 属性7: uuid: 窗口唯一Id,
  49. */
  50. const openTabFormViewModal = function(param){
  51. tabFormViewRecordId.value = param.modelDataId;
  52. openTabEditModal.value = false;
  53. openTabViewModal.value = true;
  54. };
  55. /**
  56. * 打开页签编辑模式
  57. * @param param 信息
  58. * 属性1: type: 类型,
  59. * 属性1: windowNo: CURD窗口编号,
  60. * 属性2: tabIndex: CURD页签编号,
  61. * 属性3: modelDataId: 数据记录id,
  62. * 属性4: currentPage: 当前记录所在的页码,
  63. * 属性5: currentIndex: 当前记录的排序,
  64. * 属性6: totalRecords: 记录的总数量,
  65. * 属性7: uuid: 窗口唯一Id,
  66. */
  67. const openTabEditView = function(param){
  68. tabEditViewType.value = param.type;
  69. curdWindowNo.value = param.windowNo;
  70. tabIndex.value = param.tabIndex;
  71. tabEditViewRecordId.value = param.modelDataId;
  72. tabEditViewCurrentPage.value = param.currentPage;
  73. tabEditViewCurrentIndex.value = param.currentIndex;
  74. tabEditViewTotalRecords.value = param.totalRecords;
  75. tabEditViewIsRestoreData.value = param.isRestoreData;
  76. openTabViewModal.value = false;
  77. openTabEditModal.value = true;
  78. };
  79. </script>