index.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <com-list-page :crumbs="crumbs" id="application">
  2. <com-list-table
  3. ref="table"
  4. :api="'qi-juhe/notice/index'"
  5. :search-list="searchList"
  6. >
  7. <el-table-column prop="id" width="80px" label="ID" align="center">
  8. </el-table-column>
  9. <el-table-column prop="type_text" width="120px" label="通知类型" align="center">
  10. </el-table-column>
  11. <el-table-column prop="data" min-width="500px" label="推送数据" align="center">
  12. </el-table-column>
  13. <el-table-column prop="response" label="响应数据" align="center">
  14. </el-table-column>
  15. <el-table-column prop="created_at" min-width="120px" label="通知时间" align="center">
  16. <template slot-scope="scope">
  17. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  18. </template>
  19. </el-table-column>
  20. </com-list-table>
  21. </com-list-page>
  22. <script>
  23. const application = new Vue({
  24. el: '#application',
  25. data: {
  26. type_list: [],
  27. supply_list: [],
  28. crumbs: [
  29. {
  30. title: '首页',
  31. router: 'mall/overview/index',
  32. },
  33. {
  34. title: '通知日志',
  35. }
  36. ],
  37. searchList: [
  38. {
  39. key: 'supply_id',
  40. title: '供应链',
  41. type: 'select',
  42. options: [],
  43. valueKey: {
  44. label: 'app_name',
  45. value: 'id',
  46. },
  47. },
  48. {
  49. key: 'type',
  50. title: '通知类型',
  51. type: 'select',
  52. options: [],
  53. valueKey: {
  54. label: 'label',
  55. value: 'value',
  56. },
  57. },
  58. {
  59. key: 'data',
  60. title: '内容',
  61. type: 'text',
  62. },
  63. ],
  64. },
  65. methods: {
  66. getType() {
  67. let self = this;
  68. request({
  69. params: {
  70. r: 'qi-juhe/notice/type',
  71. },
  72. method: 'get',
  73. }).then(e => {
  74. let data = []
  75. Object.keys(e.data.data).forEach(element => {
  76. data.push({
  77. label: e.data.data[element],
  78. value: element,
  79. })
  80. });
  81. this.searchList[1].options = data
  82. }).catch(e => {
  83. console.log(e);
  84. })
  85. },
  86. getSupply() {
  87. let self = this;
  88. request({
  89. params: {
  90. r: 'qi-juhe/supplys/index',
  91. },
  92. method: 'get',
  93. }).then(e => {
  94. this.searchList[0].options = e.data.data.list
  95. }).catch(e => {
  96. console.log(e);
  97. })
  98. }
  99. },
  100. mounted: function() {
  101. this.getType()
  102. this.getSupply()
  103. },
  104. });
  105. </script>