newsInfos.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div id="newsInfo">
  3. <el-row>
  4. <el-col :span="24">
  5. <template>
  6. <el-tabs v-model="activeName" @tab-click="handleClicks">
  7. <el-tab-pane label="未发布" name="first">
  8. <el-col :span="24" class="info">
  9. <el-col :span="10" class="input">
  10. <el-input placeholder="请输入产品名称" v-model="input"> </el-input>
  11. </el-col>
  12. <el-col :span="2" class="btn">
  13. <el-button type="primary" icon="el-icon-search" circle></el-button>
  14. </el-col>
  15. </el-col>
  16. <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
  17. <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
  18. <el-table-column property="name" label="产品名称" align="center"> </el-table-column>
  19. <el-table-column label="图片" align="center">
  20. <template slot-scope="scope">
  21. <span style="margin-left: 10px"> <el-image :src="scope.row.pic"></el-image></span>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="状态" align="center">
  25. <template slot-scope="scope">
  26. <span style="margin-left: 10px">{{ scope.row.status === '0' ? '未发布' : scope.row.status === '1' ? '发布' : '下架' }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column fixed="right" label="操作" align="center">
  30. <template slot-scope="scope">
  31. <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
  32. <el-button @click="clickRest(scope.row)" type="text"><i class="el-icon-refresh"></i></el-button>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <el-col class="page" :span="24">
  37. <el-pagination
  38. @size-change="handleSizeChange"
  39. @current-change="handleCurrentChange"
  40. :current-page="currentPage"
  41. layout="total, prev, pager, next, jumper"
  42. :total="total"
  43. >
  44. </el-pagination>
  45. </el-col>
  46. </el-tab-pane>
  47. <el-tab-pane label="发布" name="second">
  48. <el-col :span="24" class="info">
  49. <el-col :span="10" class="input">
  50. <el-input placeholder="请输入产品名称" v-model="input"> </el-input>
  51. </el-col>
  52. <el-col :span="2" class="btn">
  53. <el-button type="primary" icon="el-icon-search" circle></el-button>
  54. </el-col>
  55. </el-col>
  56. <el-table ref="shenheTable" :data="shenheTable" style="width: 100%" border>
  57. <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
  58. <el-table-column property="name" label="产品名称" align="center"> </el-table-column>
  59. <el-table-column label="图片" align="center">
  60. <template slot-scope="scope">
  61. <span style="margin-left: 10px"> <el-image :src="scope.row.pic"></el-image></span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="状态" align="center">
  65. <template slot-scope="scope">
  66. <span style="margin-left: 10px">{{ scope.row.status === '0' ? '未发布' : scope.row.status === '1' ? '发布' : '下架' }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column fixed="right" label="操作" align="center">
  70. <template slot-scope="scope">
  71. <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
  72. <el-button @click="clickRest(scope.row)" type="text"><i class="el-icon-refresh"></i></el-button>
  73. </template>
  74. </el-table-column>
  75. </el-table>
  76. <el-col class="page" :span="24">
  77. <el-pagination
  78. @size-change="handleSizeChange"
  79. @current-change="handleCurrentChange"
  80. :current-page="currentPage"
  81. layout="total, prev, pager, next, jumper"
  82. :total="total"
  83. >
  84. </el-pagination>
  85. </el-col>
  86. </el-tab-pane>
  87. <el-tab-pane label="下架" name="third">
  88. <el-col :span="24" class="info">
  89. <el-col :span="10" class="input">
  90. <el-input placeholder="请输入产品名称" v-model="input"> </el-input>
  91. </el-col>
  92. <el-col :span="2" class="btn">
  93. <el-button type="primary" icon="el-icon-search" circle></el-button>
  94. </el-col>
  95. </el-col>
  96. <el-table ref="noshenhetable" :data="noshenhetable" style="width: 100%" border>
  97. <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
  98. <el-table-column property="name" label="产品名称" align="center"> </el-table-column>
  99. <el-table-column label="图片" align="center">
  100. <template slot-scope="scope">
  101. <span style="margin-left: 10px"> <el-image :src="scope.row.pic"></el-image></span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="状态" align="center">
  105. <template slot-scope="scope">
  106. <span style="margin-left: 10px">{{ scope.row.status === '0' ? '未发布' : scope.row.status === '1' ? '发布' : '下架' }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column fixed="right" label="操作" align="center">
  110. <template slot-scope="scope">
  111. <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <el-col class="page" :span="24">
  116. <el-pagination
  117. @size-change="handleSizeChange"
  118. @current-change="handleCurrentChange"
  119. :current-page="currentPage"
  120. layout="total, prev, pager, next, jumper"
  121. :total="total"
  122. >
  123. </el-pagination>
  124. </el-col>
  125. </el-tab-pane>
  126. </el-tabs>
  127. </template>
  128. </el-col>
  129. </el-row>
  130. </div>
  131. </template>
  132. <script>
  133. export default {
  134. name: 'newsInfo',
  135. props: {
  136. debtTable: null,
  137. shenheTable: null,
  138. noshenhetable: null,
  139. total: null,
  140. },
  141. components: {},
  142. data: () => ({
  143. currentPage: 1,
  144. activeName: 'first',
  145. input: '',
  146. }),
  147. created() {},
  148. computed: {
  149. status() {
  150. return this.$route.params.status;
  151. },
  152. },
  153. methods: {
  154. handleSizeChange(val) {
  155. console.log(`每页 ${val} 条`);
  156. },
  157. handleCurrentChange(val) {
  158. console.log(`当前页: ${val}`);
  159. },
  160. handleClicks(tab, event) {
  161. console.log(tab, event);
  162. },
  163. handleClick(id) {
  164. let newid = id.id;
  165. this.$emit('handleClick', newid);
  166. },
  167. },
  168. };
  169. </script>
  170. <style lang="less" scoped>
  171. .info {
  172. padding: 15px 0;
  173. }
  174. .info .input {
  175. padding: 6px 0;
  176. }
  177. .info .btn {
  178. text-align: center;
  179. }
  180. /deep/.el-input__inner {
  181. height: 30px;
  182. line-height: 30px;
  183. }
  184. </style>