8eeeea8bde41418ee7473fc699ea0138b953e315.svn-base 5.0 KB

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