UploadRecord.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <div class="record">
  3. <div>上传记录</div>
  4. <div class="searchBox">
  5. <div class="search_inside">
  6. <span><img src="" alt="" /></span>
  7. <input type="text" name="" id="" placeholder="请输入要搜索的资料名" />
  8. <button>搜索</button>
  9. </div>
  10. </div>
  11. <div class="sortBox">
  12. <div class="sort_inside">
  13. <span>是否下载</span>
  14. <select name="" id="">
  15. <option value="">不限</option>
  16. <option value="">是</option>
  17. <option value="">否</option>
  18. </select>
  19. <span>是否反馈</span>
  20. <select name="" id="">
  21. <option value="">不限</option>
  22. <option value="">是</option>
  23. <option value="">否</option>
  24. </select>
  25. <span>排序</span>
  26. <select name="" id="">
  27. <option value="">时间降序</option>
  28. <option value="">时间升序</option>
  29. </select>
  30. </div>
  31. <button>确定</button>
  32. </div>
  33. <div class="tableD">
  34. <UpLoadTable
  35. :trStyle="trStyle"
  36. :tableHeader="tableHeaderD"
  37. :tableData="tableData"
  38. :tableHeadStyle="tableHeadStyle"
  39. :operation="operation"
  40. :discolor="discolor"
  41. :flag="false"
  42. />
  43. </div>
  44. <div class="pageD">
  45. <Tablepage
  46. :totalPage="totalPage"
  47. :currentPage="currentPage"
  48. @change_page="changePage"
  49. @jump_page="jumpPage"
  50. />
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import Tablepage from "../../components/TablePage";
  56. import UpLoadTable from "../../components/Table";
  57. export default {
  58. props: {
  59. isManufacturer: {
  60. type: String,
  61. default: "distributor",
  62. },
  63. },
  64. components: {
  65. Tablepage,
  66. UpLoadTable,
  67. },
  68. data() {
  69. return {
  70. tableHeaderD: [
  71. "资料名称",
  72. "时间类型",
  73. "传播类型",
  74. "上传时间",
  75. "下载状态",
  76. "反馈状态",
  77. "操作",
  78. ],
  79. operation: [
  80. {
  81. name: "下载",
  82. function: () => {
  83. this.download();
  84. },
  85. },
  86. {
  87. name: "反馈",
  88. function: () => {
  89. this.feedback();
  90. },
  91. },
  92. {
  93. name: "查看详情>",
  94. function: () => {
  95. this.showDetail();
  96. },
  97. },
  98. ],
  99. // 表格配置
  100. sum: 240, // 一共有多少条数据
  101. pageSize: 20, // 每页展示的数据
  102. discolor: false, // 是否隔行变色
  103. currentPage: 1,
  104. flag: 0,
  105. tableData: [
  106. {
  107. name: "北京博瑞",
  108. time: "2021/04",
  109. spread: "传播类型1",
  110. uploadTime: "",
  111. down: "50/20",
  112. feedback: "已反馈",
  113. },
  114. {
  115. name: "雷克萨斯纯电动SUV",
  116. time: "2021/04",
  117. spread: "传播类型1",
  118. uploadTime: "",
  119. down: "50/20",
  120. feedback: "已反馈",
  121. },
  122. {
  123. name: "a,续航可达400公里",
  124. time: "2021/04",
  125. spread: "传播类型1",
  126. uploadTime: "",
  127. down: "50/20",
  128. feedback: "已反馈",
  129. },
  130. ],
  131. tableHeadStyle: {
  132. background: "#848484",
  133. height: "30px",
  134. color: "white",
  135. },
  136. trStyle: {
  137. width: "150px",
  138. height: "30px",
  139. overflow: "hidden",
  140. },
  141. };
  142. },
  143. computed: {
  144. // 表格总页数
  145. totalPage() {
  146. return Math.ceil(this.sum / this.pageSize);
  147. },
  148. },
  149. methods: {
  150. showDetail: () => {
  151. alert("展示详情");
  152. },
  153. feedback: () => {
  154. alert("反馈");
  155. },
  156. download: () => {
  157. alert("下载");
  158. },
  159. // 获取某一页面的数据,展示在表格
  160. changePage: function (page) {
  161. this.currentPage = page;
  162. console.log(page);
  163. },
  164. // 点击上一页,下一页,首页,尾页
  165. jumpPage: function (item) {
  166. switch (item) {
  167. case 1:
  168. this.currentPage = 1;
  169. break;
  170. case 2:
  171. this.currentPage = this.currentPage - 1;
  172. break;
  173. case 3:
  174. this.currentPage = this.currentPage + 1;
  175. break;
  176. case 4:
  177. this.currentPage = this.totalPage;
  178. break;
  179. }
  180. console.log(this.currentPage);
  181. },
  182. submit: function () {
  183. console.log(this.totalPage);
  184. this.sum = this.sum + 1;
  185. console.log(
  186. this.inforName,
  187. this.inforDes,
  188. this.materialTime,
  189. this.range,
  190. this.addByCustomize
  191. );
  192. },
  193. },
  194. };
  195. </script>
  196. <style scoped lang="less">
  197. .searchBox {
  198. width: 100%;
  199. height: 40px;
  200. display: flex;
  201. align-items: center;
  202. margin-left: 40px;
  203. }
  204. .sortBox {
  205. display: flex;
  206. justify-content: flex-end;
  207. height: 40px;
  208. align-items: center;
  209. }
  210. .sort_inside {
  211. display: flex;
  212. width: 400px;
  213. justify-content: space-between;
  214. }
  215. </style>