apiList.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div>
  3. <div v-if="isDetail == false" class="column">
  4. <div class="titDiv">
  5. <div class="titIcon" />
  6. <div class="titSonName">{{ arr[0] }}</div>
  7. </div>
  8. <el-input v-model="describe" clearable size="small" placeholder="点击添加描述" />
  9. <!-- <p style="font-size:14px; font-family:MicrosoftYaHei; color:rgba(51,51,51,1); line-height:19px;">com.kuaidadi.liangjian.order.api.PassRemoteService</p> -->
  10. <!-- <el-input v-model="describe" clearable size="small" placeholder="点击添加描述" /> -->
  11. <div align="center" style="margin: 1%;">
  12. <el-table :data="tableData" :header-cell-style="{ background: '#F0F2F4', color: '#333B4A' }" size="mini" width="80%" border show-overflow-tooltip="true">
  13. <el-table-column label="接口名称" prop="date" align="center" min-width="120">
  14. <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="apiDetails(scope.row)">{{ scope.row.date }}</a></template>
  15. </el-table-column>
  16. <!-- <el-table-column label="接口名称" min-width="120" align="center"><template slot-scope="scope">{{ scope.row.date }}</template></el-table-column> -->
  17. <el-table-column label="接口路径" min-width="120" align="center"><template slot-scope="scope">{{ scope.row.name }}</template></el-table-column>
  18. <el-table-column label="接口分类" min-width="120" align="center"><template slot-scope="scope">{{ scope.row.address }}</template></el-table-column>
  19. </el-table>
  20. <el-pagination :current-page.sync="currentPage1" :page-sizes="[15]" background layout="total, prev, pager, next" :total="total1" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
  21. </div>
  22. </div>
  23. <apiDetails v-if="isDetail"/>
  24. </div>
  25. </template>
  26. <script>
  27. import '@/views/apiManagement/css/index.css'
  28. import apiDetails from '@/views/apiManagement/vue/index'
  29. export default {
  30. components: {
  31. apiDetails
  32. },
  33. data() {
  34. return {
  35. didi: '{ "code":200, "data":{ "orderDetailResult":{ "startPosAddr":"", "endPosName":"河滨之城", "endLng":120.164301, "passengerId":299069687413522, "publishPosAddr":"", "startCityId":0, "originalTotalMoney":0.01, "sendType":1, "publishLng":120.15798569, "fromChannel":1, "voucherAmount":0, "recipient":"小桔", "driverPayType":0, "passengerContactMob":"18605666666", "publishLat":30.28892124, "extraInfo":"馥芮白", "endLat":30.272421, "startCountryId":0, "orderId":5786944445359890, "publishContactMob":"00016013745", "publishTime":1583681227510, "endCityId":330100, "status":2000, "startLng":0, "extraData":"{"productDetail":"星巴克","extraInfo":"馥芮白"}", "endPosAddr":"6单元1602", "startPosName":"", "endCountryId":330103, "productDetail":"星巴克", "totalFee":0.01, "payStatus":0, "startLat":0, "feeItems":[ { "money":0.01, "label":"跑腿费", "type":10 } ], "payType":0, "bizType":0, "serviceCategory":613, "publishPosName":"" } }, "msg":"SUCCESS" }',
  36. value: '',
  37. centerDialogVisible: false,
  38. describe: '',
  39. textarea2: '',
  40. isDetail: false,
  41. tableData: [{
  42. id: 1,
  43. date: '2016-05-02',
  44. name: '王小虎',
  45. address: '上海市普陀区金沙江路'
  46. }, {
  47. id: 2,
  48. date: '2016-05-04',
  49. name: '王小虎',
  50. address: '上海市普陀区金沙江路'
  51. }, {
  52. id: 3,
  53. date: '2016-05-01',
  54. name: '王小虎',
  55. address: '上海市普陀区金沙江路',
  56. children: [{
  57. id: 31,
  58. date: '2016-05-01',
  59. name: '王小虎',
  60. address: '上海市普陀区金沙江路'
  61. }, {
  62. id: 32,
  63. date: '2016-05-01',
  64. name: '王小虎',
  65. address: '上海市普陀区金沙江路'
  66. }]
  67. }, {
  68. id: 4,
  69. date: '2016-05-03',
  70. name: '王小虎',
  71. address: '上海市普陀区金沙江路'
  72. }],
  73. tableData1: [{
  74. id: 1,
  75. date: '2016-05-02',
  76. name: '王小虎',
  77. address: '上海市普陀区金沙江路'
  78. }, {
  79. id: 2,
  80. date: '2016-05-04',
  81. name: '王小虎',
  82. address: '上海市普陀区金沙江路'
  83. }, {
  84. id: 3,
  85. date: '2016-05-01',
  86. name: '王小虎',
  87. address: '上海市普陀区金沙江路',
  88. hasChildren: true
  89. }, {
  90. id: 4,
  91. date: '2016-05-03',
  92. name: '王小虎',
  93. address: '上海市普陀区金沙江路'
  94. }],
  95. arr: ['乘客远程服务接口共 10 个', 'OrderVoucherRemoteService 代金券远程服务', 'PedestrianVehicleSepRemoteService 人车分离远程服务', 'SmoothMoveRemoteService 平滑移动远程服务', 'Vehicle2BOrderRemoteService B端商户远程服务', 'DriverOrderQueryRemoteService 司机订单查询远程服务']
  96. }
  97. },
  98. created() {
  99. this.getLsit(this.didi)
  100. },
  101. methods: {
  102. apiDetails() {
  103. this.isDetail = true
  104. },
  105. init(e, ele) {
  106. console.log(e)
  107. },
  108. getLsit: function(jsonStr) {
  109. var res = ''
  110. for (var i = 0, j = 0, k = 0, ii, ele; i < jsonStr.length; i++) { // k:缩进,j:""个数
  111. ele = jsonStr.charAt(i)
  112. if (j % 2 === 0 && ele === '}') {
  113. k--
  114. for (ii = 0; ii < k; ii++) ele = ' ' + ele
  115. ele = '\n' + ele
  116. } else if (j % 2 === 0 && ele === '{') {
  117. ele += '\n'
  118. k++
  119. for (ii = 0; ii < k; ii++) ele += ' '
  120. } else if (j % 2 === 0 && ele === ',') {
  121. ele += '\n'
  122. for (ii = 0; ii < k; ii++) ele += ' '
  123. } else if (ele === '"') j++
  124. res += ele
  125. }
  126. // eslint-disable-next-line no-return-assign
  127. return this.didi = res
  128. },
  129. load(tree, treeNode, resolve) {
  130. setTimeout(() => {
  131. resolve([
  132. {
  133. id: 31,
  134. date: '2016-05-01',
  135. name: '王小虎',
  136. address: '上海市普陀区金沙江路 1519 弄'
  137. }, {
  138. id: 32,
  139. date: '2016-05-01',
  140. name: '王小虎',
  141. address: '上海市普陀区金沙江路 1519 弄'
  142. }
  143. ])
  144. }, 1000)
  145. }
  146. }
  147. }
  148. </script>