瀏覽代碼

api管理

qinzhipeng_v 5 年之前
父節點
當前提交
d1ff858ff3
共有 3 個文件被更改,包括 329 次插入20 次删除
  1. 26 1
      src/views/apiManagement/css/index.css
  2. 40 19
      src/views/apiManagement/index.vue
  3. 263 0
      src/views/apiManagement/vue/index.vue

+ 26 - 1
src/views/apiManagement/css/index.css

@@ -2,5 +2,30 @@
   display: block;
   height: 1px;
   width: 100%;
-  margin: 0;
+  margin: 0%;
+}
+.titDiv {
+  display:flex;
+  align-items: center;
+  margin: 20px 0;
+}
+.titIcon {
+  width:4px;
+  height:17px;
+  background:#409EFF;
+  border-radius:1px;
+}
+.titSonName {
+  width:268px;
+  height:20px;
+  font-size:16px;
+  font-weight:500;
+  color:rgba(51,59,74,1);
+  margin-left: 6px
+}
+.choice:hover {
+  color: #00A0FF;
+}
+.column .el-dialog__header {
+  padding: 0px;
 }

+ 40 - 19
src/views/apiManagement/index.vue

@@ -1,9 +1,10 @@
 <template>
   <el-container class="Management">
-    <el-aside style="padding: 10px 0px 10px 10px;background: #F2F3F6; color: #333B4A;border-radius: 4px;" :width="wids">
-      <div style="height: auto;background: #FFF;">
-        <div style="padding: 0 2%;text-align: right; cursor: pointer;font-size:14px; font-family:MicrosoftYaHei; color:rgba(111,124,147,1); line-height:35px;" @click="changeSwitch(swi_tch)">{{ swi_tch }}</div>
-        <div v-if="MenuOpen" style="text-align: center;font-size:14px; sfont-family:PingFangSC-Regular,PingFang SC; font-weight:400; color:rgba(111,124,147,1); line-height:35px;">A<br>P<br>I<br>分<br>组</div>
+    <el-aside style="padding: 10px 0px 10px 10px;background: #F2F3F6; color: #333B4A;" :width="wids">
+      <div :style="{height: (fullHeight - 100) + 'px'}" style="background: #FFF;border-radius: 4px;">
+        <div style="padding: 2%;text-align: right; cursor: pointer;font-size:14px; font-family:MicrosoftYaHei; color:rgba(111,124,147,1); line-height:35px;" @click="changeSwitch(swi_tch)">{{ swi_tch }}</div>
+        <div align="center" style="margin: 2% 0 10%;"><el-input v-if="ElMenu" v-model="value" style="width: 90%;" size="mini" prefix-icon="el-icon-search" clearable filterable placeholder="请搜索接口" /></div>
+        <div v-if="MenuOpen" style="margin-top: 100%;text-align: center;font-size:14px; sfont-family:PingFangSC-Regular,PingFang SC; font-weight:400; color:rgba(111,124,147,1); line-height:35px;">A<br>P<br>I<br>分<br>组</div>
         <el-menu
           v-if="ElMenu"
           default-active="2"
@@ -17,7 +18,7 @@
               <span>导航一</span>
             </template>
             <el-menu-item-group>
-              <el-menu-item index="1-1">选项1</el-menu-item>
+              <el-menu-item index="1-1" @click="cli_Choice">选项1</el-menu-item>
               <el-menu-item index="1-2">选项2</el-menu-item>
               <el-menu-item index="1-3">选项3</el-menu-item>
             </el-menu-item-group>
@@ -37,8 +38,8 @@
         </el-menu>
       </div>
     </el-aside>
-    <el-main :height="screenWidth" style="padding: 10px;background: #F2F3F6; color: #333B4A;">
-      <div style="background: #FFF; padding: 0.5% 3%; border-radius: 4px;">
+    <el-main style="padding: 10px;background: #F2F3F6; color: #333B4A;">
+      <div v-show="home" :style="{height: (fullHeight - 100) + 'px'}" class="aaaa">
         <div class="Layout">
           <div class="titFont" style="padding: 15px 0; font-size: 22px; font-family:PingFangSC-Medium,PingFang SC;font-weight:500; color:rgba(51,59,74,1); line-height:35px;">API </div>
           <el-input v-model="value" style="width: 25%;" size="small" prefix-icon="el-icon-search" clearable filterable placeholder="请搜索接口" />
@@ -47,35 +48,49 @@
         <div style="font-size:18px; padding: 8% 0 1%; font-family:PingFangSC-Medium,PingFang SC; font-weight:500; color:rgba(51,59,74,1); line-height:35px;">API接口管理平台介绍及接入文档</div>
         <div style="font-size:14px; width: 80%; font-family:PingFangSC-Regular,PingFang SC; font-weight:400; color:rgba(102,102,102,1); line-height:20px;">计划与EMC合作建设公司级反馈平台,覆盖所有内外部反馈,内部大区、客服等渠道反馈,专项工作组case反馈跟踪等场景,项目较大,处于立项阶段,期望收集更多信息和建议。</div>
       </div>
+      <div v-show="Details" :style="{height: (fullHeight - 100) + 'px'}" class="aaaa">
+        <div :style="{height: (fullHeight - 105) + 'px'}" style=" overflow:scroll; overflow-x: hidden">
+          <apiDetails ref="Q_details" />
+        </div>
+      </div>
     </el-main>
   </el-container>
 
 </template>
 
 <script>
-import '@/views/projectManage/bugList/css/index.css'
+import '@/views/projectManage/publicCss/index.css'
 import '@/views/apiManagement/css/index.css'
+import apiDetails from '@/views/apiManagement/vue/index'
 
 export default {
+  components: {
+    apiDetails
+  },
   data() {
     return {
+      fullHeight: document.documentElement.clientHeight,
       value: '',
       swi_tch: '展开>>',
       ElMenu: false,
       MenuOpen: true,
       wids: '60px',
-      screenWidth: ''
-    }
-  },
-  mounted() {
-    const that = this
-    window.onresize = () => {
-      return (() => {
-        window.screenWidth = document.body.clientWidth
-        that.screenWidth = window.screenWidth
-      })()
+      screenWidth: '',
+      Details: false,
+      home: true
     }
   },
+  // mounted() {
+  //   const that = this
+  //   window.onresize = () => {
+  //     return (() => {
+  //       window.fullHeight = document.documentElement.clientHeight
+  //       that.fullHeight = window.fullHeight
+  //       console.log(that.fullHeight, 'DSCDSSASC')
+  //     })()
+  //   }
+  //   console.log(this.fullHeight, 'DSCDSC')
+  // },
   methods: {
     handleOpen(key, keyPath) {
       console.log(key, keyPath)
@@ -96,11 +111,17 @@ export default {
         this.ElMenu = false
         this.MenuOpen = true
       }
+    },
+    cli_Choice() {
+      this.Details = true
+      this.home = false
     }
   }
 }
 </script>
 
 <style>
-
+.aaaa {
+  background: #FFF; padding: 0.5% 3%; border-radius: 4px;
+}
 </style>

+ 263 - 0
src/views/apiManagement/vue/index.vue

@@ -0,0 +1,263 @@
+<template>
+  <div class="column">
+    <div class="Layout">
+      <div class="titFont" style="padding: 15px 0; font-size: 22px; font-family:PingFangSC-Medium,PingFang SC;font-weight:500; color:rgba(51,59,74,1); line-height:35px;">接口目录 </div>
+      <el-input v-model="value" style="width: 25%;" size="small" prefix-icon="el-icon-search" clearable filterable placeholder="请搜索接口" />
+    </div>
+    <el-divider style="color: #EEF0F5;" />
+    <div v-for="item of arr" :key="item">
+      <p class="choice" style="font-size:14px; font-family:MicrosoftYaHei; line-height:19px; cursor: pointer;">{{ item }}</p>
+    </div>
+    <div class="titDiv">
+      <div class="titIcon" />
+      <div class="titSonName">{{ arr[0] }}</div>
+    </div>
+    <p style="font-size:14px; font-family:MicrosoftYaHei; color:rgba(51,51,51,1); line-height:19px;">com.kuaidadi.liangjian.order.api.PassRemoteService</p>
+    <el-table
+      :data="tableData1"
+      style="width: 100%"
+      row-key="id"
+      border
+      lazy
+      :load="load"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column
+        prop="date"
+        label="方法名"
+        width="180"
+      />
+      <el-table-column
+        prop="name"
+        label="方法描述"
+        width="180"
+      />
+      <el-table-column
+        prop="address"
+        label="入参列表"
+      />
+      <el-table-column
+        prop="address"
+        label="返回值列表"
+      />
+    </el-table>
+    <div class="titFont" style="padding: 15px 0; font-size: 22px; font-family:PingFangSC-Medium,PingFang SC;font-weight:500; color:rgba(51,59,74,1); line-height:35px;">Estim 预估接口 </div>
+    <el-divider style="color: #EEF0F5; margin: 0 !important" />
+    <div class="titDiv">
+      <div class="titIcon" />
+      <div class="titSonName">请求</div>
+    </div>
+    <p style="text-align: right;font-size:14px; font-family:MicrosoftYaHei; color:rgba(64,158,255,1); cursor: pointer; line-height:19px;" @click="centerDialogVisible = true">样例数据</p>
+    <el-table
+      :data="tableData1"
+      style="width: 100%"
+      row-key="id"
+      border
+      lazy
+      :load="load"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column
+        prop="date"
+        label="层级"
+        width="180"
+      />
+      <el-table-column
+        prop="name"
+        label="参数名"
+        width="180"
+      />
+      <el-table-column
+        prop="address"
+        label="参数类型"
+      />
+      <el-table-column
+        prop="address"
+        label="参数说明"
+      />
+      <el-table-column
+        prop="address"
+        label="是否必填"
+      />
+      <el-table-column
+        prop="address"
+        label="默认值"
+      />
+    </el-table>
+    <div class="titDiv">
+      <div class="titIcon" />
+      <div class="titSonName">返回值</div>
+    </div>
+    <p style="text-align: right;font-size:14px; font-family:MicrosoftYaHei; cursor: pointer; color:rgba(64,158,255,1); line-height:19px;" @click="centerDialogVisible = true">样例数据</p>
+    <el-table
+      :data="tableData1"
+      style="width: 100%"
+      row-key="id"
+      border
+      lazy
+      :load="load"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column
+        prop="date"
+        label="层级"
+        width="180"
+      />
+      <el-table-column
+        prop="name"
+        label="参数名"
+        width="180"
+      />
+      <el-table-column
+        prop="address"
+        label="参数类型"
+      />
+      <el-table-column
+        prop="address"
+        label="参数说明"
+      />
+      <el-table-column
+        prop="address"
+        label="是否必填"
+      />
+      <el-table-column
+        prop="address"
+        label="默认值"
+      />
+    </el-table>
+    <el-dialog
+      :visible.sync="centerDialogVisible"
+      width="60%"
+      center
+    >
+      <div style="display: flex; margin-bottom: 20px;">
+        <div class="titIcon" />
+        <div class="titSonName">样例数据</div>
+      </div>
+      <div class="Layout">
+        <span style="width: 80px;font-size:16px; font-family:PingFangSC-Regular,PingFang SC; font-weight:400; color:rgba(51,59,74,1);margin-bottom: auto;">样例数据</span>
+        <el-input
+          v-model="textarea2"
+          type="textarea"
+          :autosize="{ minRows: 15, maxRows: 15}"
+          :placeholder="didi"
+        />
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import '@/views/apiManagement/css/index.css'
+
+export default {
+  data() {
+    return {
+      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" }',
+      value: '',
+      centerDialogVisible: false,
+      tableData: [{
+        id: 1,
+        date: '2016-05-02',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路'
+      }, {
+        id: 2,
+        date: '2016-05-04',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路'
+      }, {
+        id: 3,
+        date: '2016-05-01',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路',
+        children: [{
+          id: 31,
+          date: '2016-05-01',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路'
+        }, {
+          id: 32,
+          date: '2016-05-01',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路'
+        }]
+      }, {
+        id: 4,
+        date: '2016-05-03',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路'
+      }],
+      tableData1: [{
+        id: 1,
+        date: '2016-05-02',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路'
+      }, {
+        id: 2,
+        date: '2016-05-04',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路'
+      }, {
+        id: 3,
+        date: '2016-05-01',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路',
+        hasChildren: true
+      }, {
+        id: 4,
+        date: '2016-05-03',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路'
+      }],
+      arr: ['PassRemoteService 乘客远程服务', 'OrderVoucherRemoteService 代金券远程服务', 'PedestrianVehicleSepRemoteService 人车分离远程服务', 'SmoothMoveRemoteService 平滑移动远程服务', 'Vehicle2BOrderRemoteService B端商户远程服务', 'DriverOrderQueryRemoteService 司机订单查询远程服务']
+    }
+  },
+  created() {
+    this.getLsit(this.didi)
+  },
+  methods: {
+    init(e, ele) {
+      console.log(e)
+    },
+    getLsit: function(jsonStr) {
+      var res = ''
+      for (var i = 0, j = 0, k = 0, ii, ele; i < jsonStr.length; i++) { // k:缩进,j:""个数
+        ele = jsonStr.charAt(i)
+        if (j % 2 === 0 && ele === '}') {
+          k--
+          for (ii = 0; ii < k; ii++) ele = '    ' + ele
+          ele = '\n' + ele
+        } else if (j % 2 === 0 && ele === '{') {
+          ele += '\n'
+          k++
+          for (ii = 0; ii < k; ii++) ele += '    '
+        } else if (j % 2 === 0 && ele === ',') {
+          ele += '\n'
+          for (ii = 0; ii < k; ii++) ele += '    '
+        } else if (ele === '"') j++
+        res += ele
+      }
+      // eslint-disable-next-line no-return-assign
+      return this.didi = res
+    },
+    load(tree, treeNode, resolve) {
+      setTimeout(() => {
+        resolve([
+          {
+            id: 31,
+            date: '2016-05-01',
+            name: '王小虎',
+            address: '上海市普陀区金沙江路 1519 弄'
+          }, {
+            id: 32,
+            date: '2016-05-01',
+            name: '王小虎',
+            address: '上海市普陀区金沙江路 1519 弄'
+          }
+        ])
+      }, 1000)
+    }
+  }
+}
+</script>