configurationLedger.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <basic-container>
  3. <avue-crud
  4. :data="data"
  5. :option="option"
  6. :page.sync="page"
  7. @on-load="onLoad"
  8. @row-del="rowDel"
  9. @row-save="rowSave"
  10. @row-update="rowUpdate"
  11. @search-change="searchChange"
  12. @refresh-change="refreshChange"
  13. ></avue-crud>
  14. </basic-container>
  15. </template>
  16. <script>
  17. import {customerList,jdmoduleDelete, jdmoduleSave, jdmoduleUpdate} from "@/api/system/configurationLedger";
  18. export default {
  19. name: "configurationLedger",
  20. data() {
  21. return {
  22. data:[],
  23. page: {
  24. size: 10,
  25. current:1
  26. },
  27. option: {
  28. index: true,
  29. searchMenuPosition: "right",
  30. searchMenuSpan: 12,
  31. align: 'center',
  32. menuAlign: 'center',
  33. column: [
  34. {
  35. label: "所属租户",
  36. prop: "tenantId",
  37. type: "tree",
  38. dicUrl: "/api/blade-system/tenant/select",
  39. props: {
  40. label: "tenantName",
  41. value: "tenantId"
  42. },
  43. search:true,
  44. rules: [{
  45. required: true,
  46. message: " ",
  47. trigger: "click"
  48. }]
  49. },{
  50. label: '账户名称',
  51. prop: 'accountName',
  52. search:true
  53. },{
  54. label: '客户ID',
  55. prop: 'clientId'
  56. },{
  57. label: '客户密钥',
  58. prop: 'clientSecret'
  59. },{
  60. label: '客户帐号',
  61. prop: 'username'
  62. },{
  63. label: '帐号密码',
  64. prop: 'password'
  65. }
  66. ]
  67. }
  68. }
  69. },
  70. methods:{
  71. //列表查询
  72. onLoad(page,params) {
  73. customerList({...params,size: page.size,current: page.current}).then(res=>{
  74. this.data = res.data.data.records
  75. this.page.total = res.data.data.total
  76. })
  77. },
  78. //刷新按钮触发
  79. refreshChange(){
  80. this.onLoad(this.page);
  81. },
  82. //表单搜索按钮触发
  83. searchChange(params, done) {
  84. this.page.currentPage = 1;
  85. this.onLoad(this.page, params);
  86. done()
  87. },
  88. //新增
  89. rowSave(row, done, loading) {
  90. jdmoduleSave(row).then(()=>{
  91. this.$message.success('新增成功');
  92. this.onLoad(this.page);
  93. loading()
  94. done()
  95. })
  96. },
  97. //编辑
  98. rowUpdate(row, index, done, loading) {
  99. jdmoduleUpdate(row).then(()=>{
  100. this.$message.success('修改成功');
  101. this.onLoad(this.page);
  102. loading()
  103. done()
  104. })
  105. },
  106. //删除
  107. rowDel(row, index, done){
  108. jdmoduleDelete(row.id).then(()=>{
  109. this.$message.success('删除成功');
  110. done()
  111. })
  112. }
  113. }
  114. }
  115. </script>
  116. <style scoped>
  117. </style>