list.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="container normal-panel" >
  3. <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght" @rowClick="rowShow">
  4. <template v-slot:customcol="scope" >
  5. <p>{{scope.column.data[scope.column.columnname]}}</p>
  6. </template>
  7. </tableLayout>
  8. <div style="margin-top:16px;text-align:right">
  9. <el-pagination
  10. background
  11. small
  12. @size-change="handleSizeChange"
  13. @current-change="handleCurrentChange"
  14. :current-page="currentPage"
  15. :page-size="param.content.pageSize"
  16. layout="total, prev, pager, next, jumper"
  17. :total="total">
  18. </el-pagination>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import add from './add'
  24. export default {
  25. data () {
  26. return {
  27. param:{
  28. "id": 20220901092401,
  29. "content": {
  30. "pageNumber": 1,
  31. "pageSize": 20,
  32. "where":{
  33. "condition":""
  34. }
  35. }
  36. },
  37. tableHieght:560,
  38. tablecols:[],
  39. // optionmxlist:[],
  40. // expands: [],
  41. list:[],
  42. total:0,
  43. currentPage:0,
  44. row:[]
  45. // optiontypeid:0,
  46. }
  47. },
  48. components:{
  49. add
  50. },
  51. methods:{
  52. async queryOptions () {
  53. const res = await this.$api.requested(this.param)
  54. this.list = res.data
  55. this.total = res.total
  56. this.currentPage = res.pageNumber
  57. this.$emit('rowShow',this.list[0])
  58. console.log(res)
  59. },
  60. rowShow(row){
  61. this.$emit('rowShow',row)
  62. },
  63. handleSizeChange(val) {
  64. // console.log(`每页 ${val} 条`);
  65. this.param.content.pageSize = val
  66. this.queryOptions()
  67. },
  68. handleCurrentChange(val) {
  69. // console.log(`当前页: ${val}`);
  70. this.param.content.pageNumber = val
  71. this.queryOptions()
  72. },
  73. // async queryoptionmx (id) {
  74. // const res = await this.$api.requested({
  75. // "id": 20220901092501,
  76. // "content": {
  77. // "optiontypeid":id
  78. // }
  79. // })
  80. // this.optionmxlist = res.data
  81. // },
  82. // getRowKeys: function (row) {
  83. // return row.optiontypeid
  84. // },
  85. // handleExpandChange (row, expandedRows) {
  86. // var that = this
  87. // this.queryoptionmx(row.optiontypeid)
  88. // this.optiontypeid = row.optiontypeid
  89. // if (expandedRows.length) {
  90. // that.expands = []
  91. // if (row) {
  92. // that.expands.push(row.optiontypeid)
  93. // }
  94. // } else {
  95. // that.expands = []
  96. // }
  97. // },
  98. // async deleteRow (item) {
  99. // const res = await this.$api.requested({
  100. // "id":20220901092701,
  101. // "content": {
  102. // "optiontypemxid": item.optiontypemxid
  103. // }
  104. // })
  105. // this.tool.showMessage(res,()=>{
  106. // this.queryoptionmx (this.optiontypeid)
  107. // })
  108. // }
  109. },
  110. mounted () {
  111. this.queryOptions()
  112. },
  113. created() {
  114. this.tablecols = this.tool.tabelCol(this.$route.name).optiontTable.tablecols
  115. }
  116. }
  117. </script>
  118. <style>
  119. </style>