api-opt.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div v-loading="loading">
  3. <div class="panel" v-if="permission.hasPermission(`config/api`)">
  4. <div class="panel-heading">
  5. 百度OCR
  6. </div>
  7. <div class="panel-wrapper">
  8. <div class="panel-body">
  9. <el-table :data="ocrTableData" stripe style="width: 100%;">
  10. <el-table-column prop="DESCRIPTION" label="接口">
  11. <template slot-scope="scope">
  12. <el-tag type="warning" size="small" class="no-border">{{scope.row.DESCRIPTION}}</el-tag>
  13. </template>
  14. </el-table-column>
  15. <el-table-column label="是否启用">
  16. <template slot-scope="scope">
  17. <span v-if="scope.row.STATUS==='1'">已启用</span>
  18. <span v-if="scope.row.STATUS==='0'">已停用</span>
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="修改人">
  22. <template slot-scope="scope">
  23. {{scope.row.UPDATE_ADMIN_NAME}}
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="修改时间">
  27. <template slot-scope="scope">
  28. {{tool.formatDate(scope.row.UPDATED_AT)}}
  29. </template>
  30. </el-table-column>
  31. <el-table-column fixed="right" label="操作" width="180">
  32. <template slot-scope="scope">
  33. <el-dropdown size="small" trigger="click" @click.stop="" v-if="permission.hasPermission(`config/ocr-api-edit`)">
  34. <el-button type="primary" size="small">
  35. Action<i class="el-icon-arrow-down el-icon--right"></i>
  36. </el-button>
  37. <el-dropdown-menu slot="dropdown">
  38. <el-dropdown-item command="edit" @click.native="handleEdit('ocr', scope.row)">Edit</el-dropdown-item>
  39. </el-dropdown-menu>
  40. </el-dropdown>
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="panel" v-if="permission.hasPermission(`config/api`)">
  48. <div class="panel-heading">
  49. 短信接口
  50. </div>
  51. <div class="panel-wrapper">
  52. <div class="panel-body">
  53. <el-table :data="smsTableData" stripe style="width: 100%;">
  54. <el-table-column prop="DESCRIPTION" label="接口">
  55. <template slot-scope="scope">
  56. <el-tag type="warning" size="small" class="no-border">{{scope.row.DESCRIPTION}}</el-tag>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="是否启用">
  60. <template slot-scope="scope">
  61. <span v-if="scope.row.STATUS==='1'">已启用</span>
  62. <span v-if="scope.row.STATUS==='0'">已停用</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="修改人">
  66. <template slot-scope="scope">
  67. {{scope.row.UPDATE_ADMIN_NAME}}
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="修改时间">
  71. <template slot-scope="scope">
  72. {{tool.formatDate(scope.row.UPDATED_AT)}}
  73. </template>
  74. </el-table-column>
  75. <el-table-column fixed="right" label="操作" width="180">
  76. <template slot-scope="scope">
  77. <el-dropdown size="small" trigger="click" @click.stop="" v-if="permission.hasPermission(`config/sms-api-edit`)">
  78. <el-button type="primary" size="small">
  79. Action<i class="el-icon-arrow-down el-icon--right"></i>
  80. </el-button>
  81. <el-dropdown-menu slot="dropdown">
  82. <el-dropdown-item command="edit" @click.native="handleEdit('sms', scope.row)">Edit</el-dropdown-item>
  83. </el-dropdown-menu>
  84. </el-dropdown>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import Vue from 'vue'
  95. import network from '@/utils/network'
  96. import tool from '@/utils/tool'
  97. import permission from '@/utils/permission'
  98. export default {
  99. name: 'config_api-opt',
  100. mounted () {
  101. this.getData()
  102. },
  103. data () {
  104. return {
  105. ocrTableData: null,
  106. smsTableData: null,
  107. loading: true,
  108. tool: tool,
  109. permission: permission,
  110. }
  111. },
  112. methods: {
  113. handleEdit (type, row) {
  114. this.$router.push({path: `/config/api-edit/${type}/${row.ID}`})
  115. },
  116. getData () {
  117. network.getData('config/ocr-api').then(response => {
  118. this.ocrTableData = response.list
  119. return network.getData('config/sms-api')
  120. }).then(response => {
  121. this.smsTableData = response.list
  122. this.loading = false
  123. })
  124. },
  125. }
  126. }
  127. </script>
  128. <style scoped>
  129. </style>