8ec761d63c25dbe86c1cb40ad5b818af5c8c442c.svn-base 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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_skfhxxsw_fj from "./report_skfhxxsw_fj.vue";
  41. import exportTreeListWithCheckBoxXry from "./exportTreeListWithCheckBox_xry";
  42. export default {
  43. components: {
  44. report_skfhxxsw_fj,
  45. exportTreeListWithCheckBoxXry: exportTreeListWithCheckBoxXry,
  46. },
  47. props: [],
  48. data() {
  49. return {
  50. options: [
  51. {
  52. value: "report_skfhxxsw_fj",
  53. label: "水库防洪调度、汛限水位统计报表"
  54. }
  55. ],
  56. value: "",
  57. currentViewId: "水库防洪调度、汛限水位统计报表",
  58. showTable: true,
  59. currentNodeType: "",
  60. ids: [],
  61. pid: "000",
  62. pidNodes: [],
  63. type: "111",
  64. dxdcMainHeight: window.innerHeight - 180,
  65. dxdcAsideHeight: window.innerHeight - 180,
  66. windowHeight: window.innerHeight - 200,
  67. windowWidth: window.innerWidth - 350,
  68. treeWidth: 250,
  69. newYear: ""
  70. };
  71. },
  72. computed: {
  73. persId() {
  74. return localStorage.getItem("userid")
  75. ? localStorage.getItem("userid")
  76. : "1098101939614724096";
  77. }
  78. },
  79. mounted() {
  80. this.treeWidth = this.$refs.elw.$el.clientWidth;
  81. },
  82. watch: {},
  83. methods: {
  84. //树节点选中或取消事件
  85. treeCheckedDataChange(params) {
  86. // 如果是选中状态,把元素id加入到ids里
  87. if (params.newStatus) {
  88. params.newCheckedArray.forEach((element, index) => {
  89. let id = element.id;
  90. if (id != null && id !== undefined && id !== "") {
  91. this.ids.push(id);
  92. }
  93. });
  94. } else {
  95. // 删除取消的元素id
  96. params.changedItem.forEach((element, index) => {
  97. let id = element.id;
  98. let inx = this.ids.indexOf(id);
  99. if (inx > -1) {
  100. delete this.ids[inx];
  101. }
  102. });
  103. }
  104. // 去重
  105. this.ids = Array.from(new Set(this.ids));
  106. console.log("ids:" + this.ids);
  107. },
  108. changeYear(val) {
  109. this.newYear = val;
  110. this.ids = [];
  111. },
  112. }
  113. };
  114. </script>
  115. <style>
  116. </style>