collectionList.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div>
  3. <div class="header">
  4. <el-row :style="{ margin: '12px' }">
  5. <el-col :span="22">
  6. <i class="el-icon-search"></i>
  7. <span :style="{ padding: '4px' }">藏品列表</span>
  8. </el-col>
  9. <el-col :span="2">
  10. <el-button @click="addcollist" >添加藏品</el-button>
  11. </el-col>
  12. </el-row>
  13. </div>
  14. <div class="footer">
  15. <el-table border :data="tableData" style="width: 100%">
  16. <el-table-column label="id" width="110" align="center">
  17. <template slot-scope="scope">
  18. <span>{{ scope.row.collectionId }}</span>
  19. </template>
  20. </el-table-column>
  21. <el-table-column
  22. prop="collectionTitle"
  23. label="藏品名称"
  24. width="220"
  25. align="center"
  26. >
  27. <template slot-scope="scope">
  28. <span>{{ scope.row.collectionTitle }}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column
  32. prop="showStart"
  33. label="售卖时间"
  34. width="280"
  35. align="center"
  36. >
  37. <template slot-scope="scope">
  38. <span>{{ scope.row.showStart }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column
  42. prop="colPrice"
  43. label="藏品价格"
  44. width="190"
  45. align="center"
  46. >
  47. <template slot-scope="scope">
  48. <span>{{ scope.row.colPrice }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column
  52. prop="status"
  53. label="藏品状态"
  54. width="220"
  55. align="center"
  56. >
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.status }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column
  62. prop="colCount"
  63. label="数量"
  64. width="180"
  65. align="center"
  66. >
  67. <template slot-scope="scope">
  68. <span>{{ scope.row.colCount }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="edit" label="操作" width="280" align="center">
  72. <el-row>
  73. <el-button type="text" @click="coldetails">藏品详情</el-button>
  74. </el-row>
  75. </el-table-column>
  76. </el-table>
  77. <el-pagination
  78. @current-change="handleCurrentChange"
  79. background
  80. layout="total, prev, pager, next"
  81. :total="total"
  82. id="page"
  83. :page-size="10"
  84. >
  85. </el-pagination>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. import { collecctionList } from "../../api/sets/index";
  91. import { collectionList } from "../../api/collection/collection";
  92. export default {
  93. data() {
  94. return {
  95. pageInfo: {
  96. // 分页信息
  97. pageNum: 1,
  98. pageSize: 10,
  99. },
  100. total: 1,
  101. tableData: [
  102. {
  103. collectionId:'1',
  104. collectionTitle:'这是第一个',
  105. showStart:'2023-02-12 03:42:08',
  106. colPrice:20,
  107. status:'在售卖',
  108. colCount:20,
  109. }
  110. ],
  111. };
  112. },
  113. mounted() {
  114. // this.getcollectionList();
  115. // this.init();
  116. },
  117. methods: {
  118. addcollist(){
  119. this.$router.push("./addcollections");
  120. },
  121. init() {
  122. let colList =this.$route.params.rows;
  123. console.log(colList);
  124. setTimeout(() => {
  125. collecctionList(colList.tetherId).then((res) => {
  126. console.log(res);
  127. this.total = res.total;
  128. this.tableData = res.rows;
  129. });
  130. }, 800);
  131. },
  132. coldetails() {
  133. this.$router.push("./collectionDetails");
  134. },
  135. // getcollectionList() {
  136. // collecctionList().then((res) => {
  137. // this.total = res.total;
  138. // this.tableData = res.rows;
  139. // });
  140. // },
  141. handleCurrentChange(newPage) {
  142. this.pageInfo.pageNum = newPage;
  143. },
  144. },
  145. };
  146. </script>
  147. <style scoped>
  148. .header {
  149. height: 60px;
  150. margin-top: 20px;
  151. margin: 16px;
  152. border: 1px solid #ccc;
  153. border-radius: 4px;
  154. }
  155. .footer {
  156. width: 100%;
  157. display: inline-block;
  158. margin: 16px;
  159. }
  160. </style>