e0eb5ccf6a1e760fed28ed36cbb787ab8cb1dcd6.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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-xry
  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-xry>
  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. >
  26. <!-- <component v-if="currentViewId == option.label" :is="option.value"></component> -->
  27. <el-col :span="20">
  28. <component v-if="showTable" :is="option.value" :ids="ids" type="001"
  29. :newYear="newYear"></component>
  30. </el-col>
  31. </el-tab-pane>
  32. </el-tabs>
  33. </el-main>
  34. </el-container>
  35. </el-container>
  36. <!-- 添加/编辑人员弹窗 -->
  37. </div>
  38. </template>
  39. <script>
  40. import report_xxsk_fj from "./report_xxsk_fj.vue";
  41. import report_xxskhtk_fj from "./report_xxskhtk_fj.vue";
  42. import exportTreeListWithCheckBoxXry from "./exportTreeListWithCheckBox_xry";
  43. export default {
  44. components: {
  45. report_xxsk_fj,
  46. report_xxskhtk_fj,
  47. exportTreeListWithCheckBoxXry: exportTreeListWithCheckBoxXry,
  48. },
  49. props: [],
  50. data() {
  51. return {
  52. options: [
  53. {
  54. value: "report_xxsk_fj",
  55. label: "小型水库统计报表"
  56. },
  57. {
  58. value: "report_xxskhtk_fj",
  59. label: "小型水库回头看统计报表"
  60. }
  61. ],
  62. value: "",
  63. currentViewId: "小型水库统计报表",
  64. showTable: true,
  65. currentNodeType: "",
  66. ids: [],
  67. pid: "000",
  68. pidNodes: [],
  69. type: "001",
  70. dxdcMainHeight: window.innerHeight - 180,
  71. dxdcAsideHeight: window.innerHeight - 180,
  72. windowHeight: window.innerHeight - 200,
  73. windowWidth: window.innerWidth - 350,
  74. treeWidth: 250,
  75. newYear: ""
  76. };
  77. },
  78. computed: {
  79. persId() {
  80. return localStorage.getItem("userid")
  81. ? localStorage.getItem("userid")
  82. : "1098101939614724096";
  83. }
  84. },
  85. mounted() {
  86. this.treeWidth = this.$refs.elw.$el.clientWidth;
  87. },
  88. watch: {},
  89. methods: {
  90. //树节点选中或取消事件
  91. treeCheckedDataChange(params) {
  92. // 如果是选中状态,把元素id加入到ids里
  93. if (params.newStatus) {
  94. params.newCheckedArray.forEach((element, index) => {
  95. let id = element.id;
  96. if (id != null && id !== undefined && id !== "") {
  97. this.ids.push(id);
  98. }
  99. });
  100. } else {
  101. // 删除取消的元素id
  102. params.changedItem.forEach((element, index) => {
  103. let id = element.id;
  104. let inx = this.ids.indexOf(id);
  105. if (inx > -1) {
  106. delete this.ids[inx];
  107. }
  108. });
  109. }
  110. // 去重
  111. this.ids = Array.from(new Set(this.ids));
  112. console.log("ids:" + this.ids);
  113. },
  114. changeYear(val) {
  115. this.newYear = val;
  116. this.ids = [];
  117. },
  118. }
  119. };
  120. </script>
  121. <style>
  122. </style>