index.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <style>
  2. .table-body {
  3. padding: 20px;
  4. background-color: #fff;
  5. }
  6. .input-item {
  7. display: inline-block;
  8. width: 250px;
  9. margin: 0 0 20px;
  10. }
  11. .input-item .el-input__inner {
  12. border-right: 0;
  13. }
  14. .input-item .el-input__inner:hover {
  15. border: 1px solid #dcdfe6;
  16. border-right: 0;
  17. outline: 0;
  18. }
  19. .input-item .el-input__inner:focus {
  20. border: 1px solid #dcdfe6;
  21. border-right: 0;
  22. outline: 0;
  23. }
  24. .input-item .el-input-group__append {
  25. background-color: #fff;
  26. border-left: 0;
  27. width: 10%;
  28. padding: 0;
  29. }
  30. .input-item .el-input-group__append .el-button {
  31. padding: 0;
  32. }
  33. .input-item .el-input-group__append .el-button {
  34. margin: 0;
  35. }
  36. .table-body .el-button {
  37. padding: 0 !important;
  38. border: 0;
  39. margin: 0 5px;
  40. }
  41. .el-table th > .cell {
  42. color: #333;
  43. font-weight: bold;
  44. font-size: 14px;
  45. }
  46. .el-table__footer-wrapper, .el-table__header-wrapper {
  47. border-bottom: 1.4px solid #D6D6D6;
  48. }
  49. .el-button--primary2 {
  50. color: #FFF;
  51. background-color: #03C5FF;
  52. border-color: #03C5FF;
  53. }
  54. </style>
  55. <div id="app" v-cloak>
  56. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  57. <div slot="header">
  58. <div>
  59. <span>导入记录</span>
  60. </div>
  61. </template>
  62. </div>
  63. <div class="table-body">
  64. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  65. <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column>
  66. <el-table-column label="导入数量" min-width="150" align="center">
  67. <template slot-scope="scope">
  68. <com-ellipsis :line="1">{{scope.row.export_count}}</com-ellipsis>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="成功数量" min-width="100" align="center">
  72. <template slot-scope="scope">
  73. <com-ellipsis :line="1">{{scope.row.export_success_count}}</com-ellipsis>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="失败数量" min-width="100" align="center">
  77. <template slot-scope="scope">
  78. <com-ellipsis :line="1">{{scope.row.export_fail_count}}</com-ellipsis>
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="scope" width="180" label="创建时间">
  82. <template slot-scope="scope">
  83. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. label="操作"
  88. min-width="180"
  89. align="center">
  90. <template slot-scope="scope">
  91. <el-button v-if="scope.row.export_fail_count>0" circle size="mini" type="text" @click="handle('fail',scope.row)">
  92. 失败记录
  93. </el-button>
  94. <span v-else> -- </span>
  95. </template>
  96. </el-table-column>
  97. </el-table>
  98. <div style="text-align: right;margin: 20px 0;">
  99. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  100. style="display: inline-block;float: right;" background @current-change="pageChange"
  101. layout="prev, pager, next" :total="pagination.total_count">
  102. </el-pagination>
  103. </div>
  104. </div>
  105. </el-card>
  106. </div>
  107. <script>
  108. const app = new Vue({
  109. el: '#app',
  110. data() {
  111. var validatePass = (rule, value, callback) => {
  112. var reg = /^[\u4e00-\u9fa5\w]+$/;
  113. if (reg.test(value)) {
  114. callback();
  115. }else{
  116. callback(new Error('规则名不能含有特殊字符'));
  117. }
  118. };
  119. return {
  120. list: [],
  121. id: null,
  122. sort: 0,
  123. keyword: '',
  124. cate_id:'',
  125. listLoading: false,
  126. btnLoading: false,
  127. pagination:null,
  128. page: 1,
  129. pageCount: 0,
  130. form:{
  131. file:null,
  132. cate_id:'',
  133. },
  134. //弹框配置
  135. addForm: {
  136. id : '',
  137. name : '',
  138. password:'',
  139. status : 1,
  140. sort:99,
  141. },
  142. title:'',
  143. dialogAddgsVisible: false,
  144. dataList: [],
  145. // 对话框显示与否
  146. dialogVisible: false,
  147. dataloading: false,
  148. addGroupVisible: false,
  149. };
  150. },
  151. methods: {
  152. pageChange(currentPage) {
  153. let self = this;
  154. self.page = currentPage; //console.log(currentPage,999999);
  155. self.getList();
  156. },
  157. getList() {
  158. let self = this;
  159. self.listLoading = true;
  160. request({
  161. params: {
  162. r: 'card-secret/import-log/index',
  163. page: self.page,
  164. cate_id:self.cate_id,
  165. },
  166. method: 'get',
  167. }).then(e => {
  168. self.listLoading = false;
  169. self.list = e.data.data.list;
  170. this.pagination = e.data.data.pagination;
  171. this.pagination.pageSize = e.data.data.page_size;
  172. this.pagination.total_count = e.data.data.count;
  173. }).catch(e => {
  174. console.log(e);
  175. });
  176. },
  177. handle(type,data = null){
  178. switch (type) {
  179. case 'fail':
  180. navigateTo({
  181. r: 'card-secret/import-fail-log/index',
  182. import_id: data.id,
  183. });
  184. break;
  185. }
  186. },
  187. },
  188. mounted: function () {
  189. this.cate_id = getQuery('cate_id');
  190. this.getList();
  191. }
  192. });
  193. </script>