54e0c57e0c5b4e7b365033573a0e82ea1b4f7262.svn-base 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <div>
  3. <el-table v-loading="tableLoading" :data="tableData" stripe border style="width: 100%">
  4. <el-table-column align="center" show-overflow-tooltip fixed prop="deptName" label="机构名称"></el-table-column>
  5. <el-table-column align="center" show-overflow-tooltip fixed prop="deptId" label="机构编码"></el-table-column>
  6. <el-table-column closable fixed="right" label="操作" align="center" width="155">
  7. <template slot-scope="scope">
  8. <el-button type="text" size="small" @click="pushPrRiver(scope.$index, scope.row)">确定</el-button>
  9. </template>
  10. </el-table-column>
  11. </el-table>
  12. <el-pagination
  13. style="margin-top:10px;text-align:center;"
  14. small
  15. :current-page.sync="pageNum"
  16. :page-size="pageSize"
  17. layout="total,prev, pager, next"
  18. :total="showResultCount"
  19. @current-change="pageIndexChange"
  20. ></el-pagination>
  21. </div>
  22. </template>
  23. <script>
  24. import { getAffData } from "../api/administrativeRegion.js";
  25. export default {
  26. props: [],
  27. data() {
  28. return {
  29. tableLoading: false,
  30. adId: "350000000000",
  31. pageNum: 1,
  32. pageSize: 10,
  33. showResultCount: 10,
  34. tableData: []
  35. };
  36. },
  37. mounted: function() {
  38. this.getTableData();
  39. },
  40. methods: {
  41. pushPrRiver: function(index, row) {
  42. var _self = this;
  43. this.$emit("dialogEvent", { deptId: row.deptId });
  44. },
  45. pageIndexChange: function() {
  46. this.getTableData(this.pageNum);
  47. },
  48. getTableData: function() {
  49. var _self = this;
  50. _self.tableLoading = true;
  51. try {
  52. getAffData(_self.adId).then(
  53. response => {
  54. _self.tableData = response.data;
  55. _self.tableLoading = false;
  56. },
  57. response => {}
  58. );
  59. } catch (e) {
  60. alert("暂无河流数据");
  61. }
  62. }
  63. },
  64. watch: {}
  65. };
  66. </script>
  67. <style>
  68. .tree_menu {
  69. position: absolute;
  70. top: 30px;
  71. z-index: 20;
  72. width: 100%;
  73. border: solid 1px #eee;
  74. background-color: #fff;
  75. }
  76. .tree_menu p {
  77. font-weight: normal;
  78. color: #999;
  79. text-align: center;
  80. position: absolute;
  81. right: 10px;
  82. top: -28px;
  83. z-index: 20;
  84. font-size: 16px;
  85. }
  86. .menu_tree {
  87. position: absolute;
  88. top: 30px;
  89. z-index: 20;
  90. width: 100%;
  91. border: solid 1px #eee;
  92. background-color: #fff;
  93. }
  94. .menu_tree p {
  95. font-weight: normal;
  96. color: #999;
  97. text-align: center;
  98. position: absolute;
  99. right: 10px;
  100. top: -28px;
  101. z-index: 20;
  102. font-size: 16px;
  103. }
  104. </style>