09d9fe514d8562c5d4a6b47e1a6b183d0ce9a800.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-container>
  5. <el-main id="dxdcListMain" style="padding:5px 20px;">
  6. <el-tabs v-model="currentViewId" type="card">
  7. <el-col :span="4" ref="elw">
  8. <el-card :body-style="{'padding':'0'}">
  9. <export-tree-list-with-check-box-shzh
  10. :pid="pid"
  11. :type="type"
  12. :pidNodes="pidNodes"
  13. :height="dxdcAsideHeight"
  14. :width="treeWidth"
  15. @treeCheckedDataChange="treeCheckedDataChange"
  16. @changeYear="changeYear"
  17. ></export-tree-list-with-check-box-shzh>
  18. </el-card>
  19. </el-col>
  20. <el-tab-pane
  21. :label="option.label"
  22. :name="option.label"
  23. v-for="option in options"
  24. :key="option.value">
  25. <el-col :span="20">
  26. <component v-if="showTable" :is="option.value" :ids="ids" type="001"
  27. :newYear="newYear"></component>
  28. </el-col>
  29. </el-tab-pane>
  30. </el-tabs>
  31. </el-main>
  32. </el-container>
  33. </el-container>
  34. <!-- 添加/编辑人员弹窗 -->
  35. </div>
  36. </template>
  37. <script>
  38. import report_shzh2 from "./report_shzh2.vue";
  39. import report_shzh3 from "./report_shzh3.vue";
  40. import report_shzh4 from "./report_shzh4.vue";
  41. import exportTreeListWithCheckBoxShzh from "./exportTreeListWithCheckBox_xry";
  42. export default {
  43. components: {
  44. report_shzh2: report_shzh2,
  45. report_shzh3: report_shzh3,
  46. report_shzh4: report_shzh4,
  47. exportTreeListWithCheckBoxShzh: exportTreeListWithCheckBoxShzh,
  48. },
  49. props: [],
  50. data() {
  51. return {
  52. options: [
  53. {
  54. value: "report_shzh2",
  55. label: "附件2 山洪灾害防御暗访调研开展情况统计表"
  56. },
  57. {
  58. value: "report_shzh3",
  59. label: "附件3 山洪灾害防御暗访调研发现问题明细表"
  60. },
  61. {
  62. value: "report_shzh4",
  63. label: "附件4 山洪灾害防御暗访调研发现问题汇总表"
  64. }
  65. ],
  66. value: "",
  67. currentViewId: "附件2 山洪灾害防御暗访调研开展情况统计表",
  68. showTable: true,
  69. currentNodeType: "",
  70. ids: [],
  71. pid: "000",
  72. pidNodes: [],
  73. type: "027",
  74. dxdcMainHeight: window.innerHeight - 180,
  75. dxdcAsideHeight: window.innerHeight - 180,
  76. windowHeight: window.innerHeight - 200,
  77. windowWidth: window.innerWidth - 350,
  78. treeWidth: 250,
  79. newYear: ""
  80. };
  81. },
  82. computed: {
  83. persId() {
  84. return localStorage.getItem("userid")
  85. ? localStorage.getItem("userid")
  86. : "1098101939614724096";
  87. }
  88. },
  89. mounted() {
  90. this.treeWidth = this.$refs.elw.$el.clientWidth;
  91. },
  92. watch: {},
  93. methods: {
  94. //树节点选中或取消事件
  95. treeCheckedDataChange(params) {
  96. // 如果是选中状态,把元素id加入到ids里
  97. if (params.newStatus) {
  98. params.newCheckedArray.forEach((element, index) => {
  99. let id = element.id;
  100. if (id != null && id !== undefined && id !== "") {
  101. this.ids.push(id);
  102. }
  103. });
  104. } else {
  105. // 删除取消的元素id
  106. params.changedItem.forEach((element, index) => {
  107. let id = element.id;
  108. let inx = this.ids.indexOf(id);
  109. if (inx > -1) {
  110. delete this.ids[inx];
  111. }
  112. });
  113. }
  114. // 去重
  115. this.ids = Array.from(new Set(this.ids));
  116. console.log("ids:" + this.ids);
  117. },
  118. changeYear(val) {
  119. this.newYear = val;
  120. this.ids = [];
  121. },
  122. }
  123. };
  124. </script>
  125. <style>
  126. </style>