小说后台管理系统
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

149 satır
3.7 KiB

  1. <template>
  2. <el-container>
  3. <el-main>
  4. <el-form
  5. v-if="isSearchVisible"
  6. size="mini"
  7. label-position="right"
  8. label-width="100px"
  9. :inline="true"
  10. :model="formData"
  11. style="margin-bottom: 30px"
  12. >
  13. <div class="head-box">
  14. <el-form-item label="会员ID">
  15. <el-input v-model="formData.uid"></el-input>
  16. </el-form-item>
  17. <el-form-item label="会员昵称">
  18. <el-input v-model="formData.name"></el-input>
  19. </el-form-item>
  20. <el-form-item label="备注">
  21. <el-input v-model="formData.comment"></el-input>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button type="primary">搜索</el-button>
  25. <el-button type="info">重置</el-button>
  26. </el-form-item>
  27. </div>
  28. </el-form>
  29. <ActionButton
  30. @handle-refresh="refreshData"
  31. @handle-search="isSearchVisible = !isSearchVisible"
  32. />
  33. <div>
  34. <el-table :data="[{}]">
  35. <el-table-column type="index" label="序号" align="center"></el-table-column>
  36. <el-table-column label="分类" align="center"></el-table-column>
  37. <el-table-column label="书源" align="center"></el-table-column>
  38. <el-table-column label="采集书籍数量" align="center"></el-table-column>
  39. <el-table-column prop="address" label="操作" align="center">
  40. <template slot-scope="scope">
  41. <CustomButton
  42. tip-text="查看明细"
  43. type="warning"
  44. icon="el-icon-tickets"
  45. ></CustomButton>
  46. <CustomButton
  47. tip-text="编辑"
  48. type="primary"
  49. icon="edit"
  50. is-svg
  51. ></CustomButton>
  52. <CustomButton
  53. tip-text="删除"
  54. type="danger"
  55. icon="delete"
  56. is-svg
  57. @onClick="handleDelete(scope.$index)"
  58. ></CustomButton>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <el-footer>
  63. <el-pagination
  64. :current-page="currentPage"
  65. :page-sizes="[5, 10, 15, 20, 30]"
  66. :page-size="limit"
  67. layout="total, prev, pager, next, sizes, jumper"
  68. :total="totalCount"
  69. @size-change="handleSizeChange"
  70. @current-change="handleCurrentChange"
  71. >
  72. </el-pagination>
  73. </el-footer>
  74. </div>
  75. </el-main>
  76. </el-container>
  77. </template>
  78. <script>
  79. import ActionButton from "@/components/ActionButton/index";
  80. import CustomButton from "@/components/CustomButton/index";
  81. export default {
  82. components: {
  83. ActionButton,
  84. CustomButton,
  85. },
  86. data() {
  87. return {
  88. formData: {},
  89. isSearchVisible: false,
  90. // 分页数据
  91. totalCount: 0,
  92. currentPage: 1,
  93. limit: 20,
  94. // 返回的数据
  95. tableData: [],
  96. };
  97. },
  98. methods: {
  99. refreshData() {
  100. console.log("刷新");
  101. },
  102. handleDelete(index) {
  103. console.log(index, "删除");
  104. },
  105. // limit 改变
  106. handleSizeChange(val) {
  107. console.log(`每页 ${val} 条`);
  108. this.limit = val;
  109. this._fetchData();
  110. },
  111. // 当前页面改变
  112. handleCurrentChange(val) {
  113. console.log(`当前页: ${val}`);
  114. this.currentPage = val;
  115. this._fetchData();
  116. },
  117. },
  118. };
  119. </script>
  120. <style lang="scss" scoped>
  121. .head-box {
  122. border-bottom: #f2f2f2 1px solid;
  123. display: flex;
  124. justify-content: space-between;
  125. padding: 0 50px 0 0px;
  126. box-sizing: border-box;
  127. .el-input__inner {
  128. width: 250px;
  129. }
  130. }
  131. .el-footer {
  132. width: 100%;
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. }
  137. </style>