statisticalList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :data="dataList"
  5. ref="crud"
  6. v-model="form"
  7. :page.sync="page"
  8. @row-del="rowDel"
  9. @row-update="rowUpdate"
  10. @row-save="rowSave"
  11. @search-change="searchChange"
  12. @search-reset="searchReset"
  13. @selection-change="selectionChange"
  14. @current-change="currentChange"
  15. @size-change="sizeChange"
  16. @refresh-change="refreshChange"
  17. @cell-dblclick="cellDblclick"
  18. @on-load="onLoad">
  19. </avue-crud>
  20. </basic-container>
  21. </template>
  22. <script>
  23. import option from "./configuration/statisticalList.json";
  24. export default {
  25. name: "statisticalList",
  26. data() {
  27. return {
  28. form: {},
  29. option: option,
  30. parentId:0,
  31. dataList: [],
  32. page: {
  33. pageSize: 10,
  34. pagerCount: 5,
  35. total: 0,
  36. },
  37. query:{}
  38. }
  39. },
  40. created() {
  41. console.log(parseInt(this.option.column.length / 4),111111111)
  42. if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
  43. console.log(123)
  44. this.option.searchMenuSpan = 6;
  45. this.option.searchMenuPosition = "center";
  46. }else {
  47. this.option.searchMenuPosition = "right";
  48. }
  49. },
  50. mounted() {
  51. option.height = window.innerHeight - 340 ;
  52. },
  53. methods: {
  54. //删除列表后面的删除按钮触发触发(row, index, done)
  55. rowDel(row, index, done) {
  56. this.$confirm("确定将选择数据删除?", {
  57. confirmButtonText: "确定",
  58. cancelButtonText: "取消",
  59. type: "warning"
  60. }).then(() => {
  61. this.$message({
  62. type: "success",
  63. message: "操作成功!"
  64. });
  65. // 数据回调进行刷新
  66. done();
  67. });
  68. },
  69. //修改时的修改按钮点击触发
  70. rowUpdate(row, index, done, loading) {
  71. setTimeout(() => {
  72. this.$message.success("修改成功");
  73. loading();
  74. done();
  75. }, 1000);
  76. // typeSave(row).then(() => {
  77. // this.$message({
  78. // type: "success",
  79. // message: "操作成功!"
  80. // });
  81. // // 数据回调进行刷新
  82. // done(row);
  83. // }, error => {
  84. // window.console.log(error);
  85. // loading();
  86. // });
  87. },
  88. //新增修改时保存触发
  89. rowSave(row, done, loading) {
  90. setTimeout(() => {
  91. this.$message.success("保存成功");
  92. loading();
  93. done();
  94. }, 1000);
  95. },
  96. //点击搜索按钮触发
  97. searchChange(params, done) {
  98. this.query = params;
  99. this.page.currentPage = 1;
  100. params.parentId = 0
  101. this.onLoad(this.page, params);
  102. done()
  103. },
  104. searchReset() {
  105. console.log('1')
  106. },
  107. selectionChange() {
  108. console.log('1')
  109. },
  110. currentChange() {
  111. console.log('1')
  112. },
  113. sizeChange() {
  114. console.log('1')
  115. },
  116. refreshChange() {
  117. console.log('1')
  118. },
  119. onLoad(page, params = {}) {
  120. const {createTimeA} = this.query;
  121. let values = {
  122. ...params,
  123. size:this.page.pageSize,
  124. current:this.page.currentPage
  125. };
  126. if (createTimeA) {
  127. values = {
  128. ...params,
  129. createTime: createTimeA[0] + ' 00:00:00',
  130. endTime: createTimeA[1] + ' 23:59:59',
  131. ...this.query,
  132. size:this.page.pageSize,
  133. current:this.page.currentPage
  134. };
  135. values.createTimeA = null;
  136. }
  137. values.parentId = 0;
  138. this.dataList = [
  139. {
  140. custmerName:"途宝",
  141. Ymoney:"2100",
  142. Smoney:"1500",
  143. qianfei:"600",
  144. kehuzt:"暂存",
  145. beizhu:"你好",
  146. zuixinxgr:"LOL",
  147. zuixinxgsj:"3030-10-10",
  148. },
  149. {
  150. custmerName:"途宝",
  151. Ymoney:"2100",
  152. Smoney:"1500",
  153. qianfei:"600",
  154. kehuzt:"暂存",
  155. beizhu:"你好",
  156. zuixinxgr:"LOL",
  157. zuixinxgsj:"3030-10-10",
  158. }
  159. ]
  160. this.page.total = 1
  161. // customerList(values).then(res => {
  162. //
  163. // })
  164. },
  165. cellDblclick(row, column, cell, event) {
  166. this.$refs.crud.rowEdit(row);
  167. }
  168. }
  169. }
  170. </script>
  171. <style scoped>
  172. </style>