diff --git a/new_company_2024_7_3.zip b/new_company_2024_7_3.zip new file mode 100644 index 0000000..193db98 Binary files /dev/null and b/new_company_2024_7_3.zip differ diff --git a/src/view/developmentDocking/index.vue b/src/view/developmentDocking/index.vue index 8593f5b..b2f8c9b 100644 --- a/src/view/developmentDocking/index.vue +++ b/src/view/developmentDocking/index.vue @@ -19,7 +19,7 @@ class="el-menu-vertical-demo" style="padding: 0;" :unique-opened="true" - @select="handleSelect" + @select="(key, keyPath) =>handleSelect(key, keyPath,selectedVersion)" @open="handleOpen" @close="handleClose"> @@ -55,7 +55,7 @@ export default { // { value: '3.8', label: '3.8', tag: '' }, // { value: '3.7', label: '3.7', tag: '' }, // { value: '3.6', label: '3.6', tag: '' }, - // { value: '3.5', label: '3.5', tag: '' }, + { value: '新智慧1.0', label: '新智慧1.0', tag: '' }, { value: '1.0', label: '1.0', tag: '' } ], code: `{ @@ -73,13 +73,49 @@ export default { "1.0": [ { "订单模块": [ - { title: '下单接口', index: '1' }, + { title: '创建订单', index: '1' }, + { title: '取消订单', index: '2' }, + { title: '根据订单id获取订单详情', index: '3' }, + { title: '获取渠道信息', index: '4' }, + { title: '获取FBA仓库编码', index: '5' }, + { title: '获取订单轨迹', index: '6' }, // { title: '系统状态', index: '2' }, // { title: '配置选项', index: '3' }, // { title: '用户管理', index: '4' }, // { title: '日志', index: '5' } ] }, + + // { + // "hhh": [ + // { title: '来玩呀', index: '1' }, + // { title: '系统状态', index: '2' }, + // { title: '配置选项', index: '3' }, + // { title: '用户管理', index: '4' }, + // { title: '日志', index: '5' } + // ] + // }, + // { + // "小妹妹": [ + // { title: '嘿嘿嘿', index: '1' }, + // { title: '系统状态', index: '2' }, + // { title: '配置选项', index: '3' }, + // { title: '用户管理', index: '4' }, + // { title: '日志', index: '5' } + // ] + // } + ], + "新智慧1.0": [ + { + "运单模块": [ + { title: '创建运单', index: '1' }, + // { title: '系统状态', index: '2' }, + // { title: '配置选项', index: '3' }, + // { title: '用户管理', index: '4' }, + // { title: '日志', index: '5' } + ] + }, + // { // "hhh": [ // { title: '来玩呀', index: '1' }, @@ -132,7 +168,8 @@ export default { }; }, mounted() { - this.$router.push({ name: 'mainComponents', query: { api: '1-0' } }); + console.log(this.selectedVersion,'this.selectedVersion') + this.$router.push({ name: 'mainComponents', query: { api: '1-0',selectedVersion:this.selectedVersion } }); }, computed: { codeLines() { @@ -150,10 +187,10 @@ export default { handleClose(key, keyPath) { // console.log(key, keyPath); }, - handleSelect(key, keyPath) { - console.log(key, keyPath, 'select'); + handleSelect(key, keyPath,selectType) { + console.log(key, keyPath,selectType, 'select'); this.totalIndex = keyPath[0]; - this.$router.push({ name: 'mainComponents', query: { api: key } }); + this.$router.push({ name: 'mainComponents', query: { api: key,selectedVersion:selectType } }); }, filteredMenuItems(val) { this.propList = []; diff --git a/src/view/developmentDocking/mainComponents.vue b/src/view/developmentDocking/mainComponents.vue index 17ca05a..f5901a6 100644 --- a/src/view/developmentDocking/mainComponents.vue +++ b/src/view/developmentDocking/mainComponents.vue @@ -94,11 +94,14 @@ export default { }, }, methods: { - fetchData(api) { + fetchData(api,selected) { + console.log(api,selected,'selectedVe666rsionselectedVersion') + // 模拟 API 数据,根据实际情况修改 const allData = [ { api:'1-0', + selectedVersion:'1.0', mainTitle: '账号验证', h2Title1: '1-1 HTTP请求头格式', description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', @@ -749,68 +752,1000 @@ export default { }, ], }, - // 其他数据对象 - ]; - - // 根据 api 参数筛选数据 - this.apiData = allData.filter(item => item.api.includes(api)); - }, - copyToClipboard (text) { - const code = text.join('\n'); - const textArea = document.createElement('textarea'); - textArea.value = code; - document.body.appendChild(textArea); - textArea.select(); - document.execCommand('copy'); - document.body.removeChild(textArea); - this.$message({ - message: '代码已复制到剪贴板', - type: 'success', - center: true - }); - }, - handleOpen(key, keyPath) { - // handle open - }, - handleClose(key, keyPath) { - // handle close - }, - handleSelect(key, keyPath) { - console.log(key, keyPath, 'select'); - this.totalIndex = keyPath[0]; - this.$router.push({ name: 'developmentDocking', query: { api: key } }); - }, - filteredMenuItems(val) { - this.propList = []; - if (val === "") { - return this.menuItems; // 如果没有搜索查询,返回全部 - } - const searchLower = `${val}`; - const append = this.menuItems.map((item, index) => { - const key = Object.keys(this.menuItems[index])[0]; - const eleIndex = item[key].findIndex(element => searchLower === element.title.toLowerCase()); - if (eleIndex !== -1) { - return { groupIndex: index, itemIndex: eleIndex, item: item[key][eleIndex] }; - } - }); - const appendData = append.filter(x => x !== undefined); - const index = `${appendData[0].groupIndex + 1}`; - this.propList.push(index); - } - }, - created() { - const api = this.$route.query.api; - if (api) { - this.fetchData(api); - } - }, - watch: { - '$route.query.api'(newApi) { - if (newApi) { - this.fetchData(newApi); - } - } + { + api:'1-1', + selectedVersion:'1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '取消订单', + requestUrl: '[POST] /v1/order/aafOrder/cancelOrderById', + type:"application/json", + description:"id:下单时返回的订单id", + codeLines: ` + { + "id" : "e9569b7d755c4eeea069740f997b4c05" + }`.split('\n'), + codeLines1: ` + { + "success": true, + "reTry": false, + "message": "操作成功", + "code": 200, + "data": "订单取消成功", + "timestamp": 1719836871024 + }`.split('\n'), + codeLines2: '', + tableData:[ + { + id: 'id', field: 'id', fieldName: '参数', required: '是', dataType: 'string', example: '', description: '' }, + + ] + }, + ], + }, + { + api:'1-2', + selectedVersion:'1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '根据订单id获取订单详情', + requestUrl: '[GET] /v1/order/aafOrder/querySupplementOrderById', + type:"", + description:"orderId:下单时返回的订单id", + codeLines: ` + /v1/order/aafOrder/querySupplementOrderById?orderId=e9569b7d755c4eeea069740f997b4c05`.split('\n'), + codeLines1: ` + { + "success": true, + "reTry": false, + "message": "操作成功", + "code": 200, + "data": { + "transportMode": "AIR", + "cabinetType": "1", + "countryCode": "GB", + "orderType": null, + "countryName": "英国", + "channelId": "06f73b6cfc914fb1adb80292ca280416", + "channelName": "英国空派Send-UK-F-不递延", + "cabinetSize": null, + "custOrderNo": "2406290003", + "isUseCustOrderNo": null, + "shipmentId": "FBAABCD1234", + "goodsAttrList": [ + { + "id": "7ff7e778112148d38fa8f236a8fd4dd0", + "materialType": "2", + "materialTypeStr": "带电", + "batteryType": "1", + "batteryTypeStr": "干电池", + "power": "123", + "watts": "123", + "documents": "https://public-aaf-shenzhen-file.oss-cn-beijing.aliyuncs.com/aaf1.0/file/鉴定文件.zip", + "documentsStr": "鉴定文件.zip" + }, + { + "id": "d8394d0c13ff4ff891534694bbe1a572", + "materialType": "1", + "materialTypeStr": "普货", + "batteryType": null, + "batteryTypeStr": null, + "power": null, + "watts": null, + "documents": null, + "documentsStr": null + } + ], + "goodsAttrTypeList": [ + "2", + "1" + ], + "forecastNumber": 1, + "declareType": "3", + "receiveType": "1", + "orderReceive": { + "id": "4b3eea4d93a645e3adba35eabf28d82b", + "orderId": "c20c09dafc6d400791e0b91bc1b49d1e", + "orderNo": "aaGM2407010042", + "warehouseCode": "ORF2", + "shipmentType": "1", + "fbaWarehouseCode": "ORF2", + "fbaWarehouseName": null, + "tpWarehouseCode": null, + "tpWarehouseName": null, + "receiveCountryName": null, + "receivePostcode": null, + "state": "VA", + "city": "CHESAPEAKE", + "address": "5045 PORTSMOUTH BLVD", + "receiveAddress": "VA-CHESAPEAKE-5045 PORTSMOUTH BLVD", + "receiveName": null, + "receivePhone": null, + "receiveLandline": null, + "email": null, + "inBoundCode": null, + "companyName": null, + "isDel": "0", + "createTime": "2024-07-01 20:27:13", + "createBy": "admin null", + "updateTime": null, + "updateBy": null + }, + "takeType": "1", + "orderTake": { + "id": "b6727d5bf3e740cfb4879e48e695cd16", + "orderId": "c20c09dafc6d400791e0b91bc1b49d1e", + "orderNo": "aaGM2407010042", + "type": "1", + "contact": null, + "phone": null, + "takeTime": null, + "province": null, + "city": null, + "district": null, + "address": null, + "takeAddress": null, + "warehouseId": "00c8070b70a1475d90a4724331b85w44", + "warehouseName": "深圳市美通一号仓", + "remark": null, + "createTime": "2024-07-01 20:27:12", + "createBy": "admin null", + "updateTime": null, + "updateBy": null + }, + "orderRemark": null, + "docRemark": null, + "orderId": "c20c09dafc6d400791e0b91bc1b49d1e", + "orderDetailId": "903007bf123d492abcfca1adfc09ca89", + "orderNo": "aaGM2407010042", + "importType": "页面录入", + "isPurchaseInsurance": "0", + "insuranceType": null, + "insuranceCurrency": null, + "insuranceAmount": null, + "isSpecifyDelivery": null, + "deliveryCompanyId": null, + "deliveryCompanyStr": null, + "forecastWeight": 100.000, + "forecastVolume": 1.000, + "isArrangeInspection": null, + "goodsAttrObj": { + "batteryType": "1", + "batteryTypeStr": "干电池", + "power": "123", + "watts": "123", + "documents": "https://public-aaf-shenzhen-file.oss-cn-beijing.aliyuncs.com/aaf1.0/file/鉴定文件.zip", + "documentsStr": "鉴定文件.zip", + "batteryFileList": null + }, + "orderGoodsList": [ + { + "id": "7eb1b9b4cf5b4fa8b989eff6b28c8d77", + "orderId": "c20c09dafc6d400791e0b91bc1b49d1e", + "orderNo": "aaGM2407010042", + "boxNo": "FBAABCD1234U000002", + "shipmentId": "FBAABCD1234", + "referenceId": null, + "boxWeight": 100.000, + "length": 100.000, + "width": 100.000, + "height": 100.000, + "skuEnglishName": "Bluetooth Earphones", + "skuName": "蓝牙耳机", + "declarePrice": 2.700, + "number": 100, + "exportHscode": "123", + "clearanceHscode": "123", + "brand": "无", + "brandType": "1", + "brandTypeStr": "无品牌", + "model": "ABC", + "material": "塑料", + "purpose": "手机配件", + "saleUrl": "https://www.amazon.co.gb/dp/ABCD1234", + "salesPrice": 0.000, + "picUrl": null, + "productWeight": 0.000, + "purchasePrice": 2.700, + "asin": null, + "sku": null, + "isElectric": "0", + "isElectricStr": "否", + "isMagnetic": "0", + "isMagneticStr": "否", + "isLiquid": null, + "isLiquidStr": null, + "isPowder": null, + "isPowderStr": null, + "isHazardous": null, + "isHazardousStr": null, + "isWooden": null, + "isWoodenStr": null, + "declareType": "1", + "declareTypeStr": "买单报关", + "description": null, + "productId": null, + "country": null, + "addtionalCode": null, + "specialCode": null, + "specialRate": null, + "preTariff": null, + "taxRate": null, + "unit": null, + "costPrice": null, + "totalPrice": null, + "grossWeight": null, + "netWeight": null, + "volume": null, + "materialRate": null, + "maker": null, + "makerAddress": null, + "remark": null, + "mixed": null, + "sort": null, + "size": null, + "isVat": null, + "invoiceCode": null, + "declareTotalPrice": null, + "declareNetWeight": null, + "isDel": "0", + "createTime": "2024-07-01T12:27:13.000+00:00", + "createBy": "admin null", + "updateTime": null, + "updateBy": null + } + ], + "taxRefundInfo": null, + "taxRefundInfoStr": null, + "taxRefundFileList": null, + "taxRefundRemark": "1", + "taxType": "1", + "taxTypeStr": "不包税", + "vatNo": null, + "eoriNo": null, + "einNo": null, + "taxNo": null, + "taxId": null + }, + "timestamp": 1719885098599 + }`.split('\n'), + codeLines2: '', + tableData:[{ + id: 'orderId', field: 'orderId', fieldName: '参数', required: '是', dataType: 'string', example: '', description: '' }, ] + }, + ], + }, + { + api:'1-3', + selectedVersion:'1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '获取渠道信息', + requestUrl: '[GET] /v1/sys/bdChannel/queryAllChannelList', + type:"", + description:"无需传参", + codeLines: ` + /v1/sys/bdChannel/queryAllChannelList`.split('\n'), + codeLines1: ` + { + "success": true, + "reTry": false, + "message": "操作成功", + "code": 200, + "data": [ + { + "id": "0255c7d5c717461db6deebee27d00bac", + "channelName": "加拿大海运快线-普船卡派", + "transportMode": "OCEAN" + }, + { + "id": "05c91b525c9443039d40821251feb147", + "channelName": "德国空派Send-DE-B-Slow-不递延", + "transportMode": "AIR" + }, + { + "id": "06f73b6cfc914fb1adb80292ca280416", + "channelName": "英国空派Send-UK-F-不递延", + "transportMode": "AIR" + }, + { + "id": "07d664c49d124f41a4dabc31259ff03f", + "channelName": "加拿大海运快线-美森快递派", + "transportMode": "OCEAN" + } + ] + } + `.split('\n'), + codeLines2: ` + success:请求成功标志,true仅代表请求成功,不代表通过 + message:请求描述 + code:200则代表请求通过,完成下单,500则代表校验未通过 + data:返回数据 + id:渠道id + channelName:渠道名称 + transportMode:运输方式:OCEAN-海运, AIR-空运, RAIL-铁路, ROAD-卡航 + `.split('\n'), + tableData:[ ] + }, + ], + }, + { + api:'1-4', + selectedVersion:'1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '获取FBA仓库编码', + requestUrl: '[GET] /v1/sys/bdFbaCode/queryAllFbaCode', + type:"", + description:"无需传参", + codeLines: ` + /v1/sys/bdFbaCode/queryAllFbaCode`.split('\n'), + codeLines1: ` + { + "success": true, + "reTry": false, + "message": "操作成功", + "code": 200, + "data": [ + "XFR2", + "SCK4", + "ITX2", + "BWI4", + "ACY2", + "DFW8", + "EWR9", + "VESK", + "TPFD", + "SAMB", + "MAA5", + "CAE1" + ] + } + `.split('\n'), + codeLines2: ` + success:请求成功标志,true仅代表请求成功,不代表通过 + message:请求描述 + code:200则代表请求通过,完成下单,500则代表校验未通过 + data:FBA仓库编码列表 + `.split('\n'), + tableData:[ ] + }, + ], + }, + { + api:'1-5', + selectedVersion:'1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '获取订单轨迹', + requestUrl: '[GET] /v1/track/aafOrderTrack/queryByOrderIdForAnonymous', + type:"", + description:"orderNo:下单时返回的订单号", + codeLines: ` + /v1/track/aafOrderTrack/queryByOrderIdForAnonymous?orderNo=2405090002`.split('\n'), + codeLines1: ` + { + "success":true, + "reTry":false, + "message":"操作成功", + "code":200, + "data":[ + { + "trackNode":"1400", + "trackNodeStr":"到港", + "location":"PRINCERUPERT,BC", + "expand":false, + "timeLessInfoVO":{ + "transportTime":"3天9小时45分钟", + "transportTimeCompare":null, + "transportTimeCompareType":null + }, + "childTrackNodeList":[ + { + "trackNode":"1401", + "trackNodeStr":"已到港", + "eventTime":"2024-05-1300:00:00", + "eventTimeType":"2", + "location":"PRINCERUPERT,BC" + } + ] + }, + { + "trackNode":"0300", + "trackNodeStr":"到仓", + "location":"国内地点", + "expand":false, + "timeLessInfoVO":{ + "transportTime":"0天0小时1分钟", + "transportTimeCompare":null, + "transportTimeCompareType":null + }, + "childTrackNodeList":[ + { + "trackNode":"0301", + "trackNodeStr":"已到仓", + "eventTime":"2024-05-0914:14:46", + "eventTimeType":"1", + "location":"国内地点" + } + ] + }, + { + "trackNode":"0100", + "trackNodeStr":"下单", + "location":"国内地点", + "expand":false, + "timeLessInfoVO":null, + "childTrackNodeList":[ + { + "trackNode":"0101", + "trackNodeStr":"已下单", + "eventTime":"2024-05-0914:13:35", + "eventTimeType":"1", + "location":"国内地点" + } + ] + } + ], + "timestamp":1719974617607 + } + `.split('\n'), + codeLines2: ` + success:请求成功标志,true仅代表请求成功,不代表通过 + message:请求描述 + code:200则代表请求通过,完成下单,500则代表校验未通过 + data:订单轨迹数据列表 + `.split('\n'), + tableData:[ + { id: 'trackNode', field: 'trackNode', fieldName: '节点类型', required: '是', dataType: 'String', example: '1400', description: '节点类型' }, + { id: 'trackNodeStr', field: 'trackNodeStr', fieldName: '节点类型', required: '是', dataType: 'String', example: '到港', description: '节点类型' }, + { id: 'location', field: 'location', fieldName: '地点', required: '是', dataType: 'String', example: 'PRINCE RUPERT, BC', description: '地点' }, + { id: 'expand', field: 'expand', fieldName: '前端是否能展开子节点', required: '是', dataType: 'Boolean', example: 'false', description: '前端是否能展开子节点' }, + { id: 'timeLessInfoVO', field: 'timeLessInfoVO', fieldName: '运输时长信息', required: '否', dataType: 'Object', example: '见下方示例', description: '运输时长信息',children:[ + { id: 'transportTime', field: 'transportTime', fieldName: '运输时长', required: '是', dataType: 'String', example: '3天9小时45分钟', description: '运输时长' }, + { id: 'transportTimeCompare', field: 'transportTimeCompare', fieldName: '预计时长对比', required: '否', dataType: 'String', example: '提前3天9小时45分钟', description: '预计时长对比' }, + { id: 'transportTimeCompareType', field: 'transportTimeCompareType', fieldName: '预计时长对比类型', required: '否', dataType: 'String', example: '1', description: '预计时长对比类型 1、提前 2、延迟' }, + ] }, + { id: 'childTrackNodeList', field: 'childTrackNodeList', fieldName: '订单轨迹子节点', required: '是', dataType: 'array', example: '见下方示例', description: '订单轨迹子节点',children:[ + { id: 'trackNode', field: 'trackNode', fieldName: '节点类型', required: '是', dataType: 'String', example: '1401', description: '节点类型' }, + { id: 'trackNodeStr', field: 'trackNodeStr', fieldName: '节点类型', required: '是', dataType: 'String', example: '已到港', description: '节点类型' }, + { id: 'eventTime', field: 'eventTime', fieldName: '事件发生时间', required: '是', dataType: 'Date', example: '2024-05-13 00:00:00', description: '事件发生时间' }, + { id: 'eventTimeType', field: 'eventTimeType', fieldName: '时间发生时间类型', required: '是', dataType: 'String', example: '2', description: '时间发生时间类型 1、实际发生 2、预计发生' }, + { id: 'location', field: 'location', fieldName: '地点', required: '是', dataType: 'String', example: 'PRINCE RUPERT, BC', description: '地点' }, + ] }, + + ] + }, + ], + }, + { + api:'1-6', + selectedVersion:'1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '获取订单轨迹', + requestUrl: '[GET] /v1/track/aafOrderTrack/queryByOrderIdForAnonymous', + type:"", + description:"orderNo:下单时返回的订单号", + codeLines: ` + /v1/track/aafOrderTrack/queryByOrderIdForAnonymous?orderNo=2405090002`.split('\n'), + codeLines1: ` + { + "success":true, + "reTry":false, + "message":"操作成功", + "code":200, + "data":[ + { + "trackNode":"1400", + "trackNodeStr":"到港", + "location":"PRINCERUPERT,BC", + "expand":false, + "timeLessInfoVO":{ + "transportTime":"3天9小时45分钟", + "transportTimeCompare":null, + "transportTimeCompareType":null + }, + "childTrackNodeList":[ + { + "trackNode":"1401", + "trackNodeStr":"已到港", + "eventTime":"2024-05-1300:00:00", + "eventTimeType":"2", + "location":"PRINCERUPERT,BC" + } + ] + }, + { + "trackNode":"0300", + "trackNodeStr":"到仓", + "location":"国内地点", + "expand":false, + "timeLessInfoVO":{ + "transportTime":"0天0小时1分钟", + "transportTimeCompare":null, + "transportTimeCompareType":null + }, + "childTrackNodeList":[ + { + "trackNode":"0301", + "trackNodeStr":"已到仓", + "eventTime":"2024-05-0914:14:46", + "eventTimeType":"1", + "location":"国内地点" + } + ] + }, + { + "trackNode":"0100", + "trackNodeStr":"下单", + "location":"国内地点", + "expand":false, + "timeLessInfoVO":null, + "childTrackNodeList":[ + { + "trackNode":"0101", + "trackNodeStr":"已下单", + "eventTime":"2024-05-0914:13:35", + "eventTimeType":"1", + "location":"国内地点" + } + ] + } + ], + "timestamp":1719974617607 + } + `.split('\n'), + codeLines2: ` + success:请求成功标志,true仅代表请求成功,不代表通过 + message:请求描述 + code:200则代表请求通过,完成下单,500则代表校验未通过 + data:订单轨迹数据列表 + `.split('\n'), + tableData:[ + { id: 'trackNode', field: 'trackNode', fieldName: '节点类型', required: '是', dataType: 'String', example: '1400', description: '节点类型' }, + { id: 'trackNodeStr', field: 'trackNodeStr', fieldName: '节点类型', required: '是', dataType: 'String', example: '到港', description: '节点类型' }, + { id: 'location', field: 'location', fieldName: '地点', required: '是', dataType: 'String', example: 'PRINCE RUPERT, BC', description: '地点' }, + { id: 'expand', field: 'expand', fieldName: '前端是否能展开子节点', required: '是', dataType: 'Boolean', example: 'false', description: '前端是否能展开子节点' }, + { id: 'timeLessInfoVO', field: 'timeLessInfoVO', fieldName: '运输时长信息', required: '否', dataType: 'Object', example: '见下方示例', description: '运输时长信息',children:[ + { id: 'transportTime', field: 'transportTime', fieldName: '运输时长', required: '是', dataType: 'String', example: '3天9小时45分钟', description: '运输时长' }, + { id: 'transportTimeCompare', field: 'transportTimeCompare', fieldName: '预计时长对比', required: '否', dataType: 'String', example: '提前3天9小时45分钟', description: '预计时长对比' }, + { id: 'transportTimeCompareType', field: 'transportTimeCompareType', fieldName: '预计时长对比类型', required: '否', dataType: 'String', example: '1', description: '预计时长对比类型 1、提前 2、延迟' }, + ] }, + { id: 'childTrackNodeList', field: 'childTrackNodeList', fieldName: '订单轨迹子节点', required: '是', dataType: 'array', example: '见下方示例', description: '订单轨迹子节点',children:[ + { id: 'trackNode', field: 'trackNode', fieldName: '节点类型', required: '是', dataType: 'String', example: '1401', description: '节点类型' }, + { id: 'trackNodeStr', field: 'trackNodeStr', fieldName: '节点类型', required: '是', dataType: 'String', example: '已到港', description: '节点类型' }, + { id: 'eventTime', field: 'eventTime', fieldName: '事件发生时间', required: '是', dataType: 'Date', example: '2024-05-13 00:00:00', description: '事件发生时间' }, + { id: 'eventTimeType', field: 'eventTimeType', fieldName: '时间发生时间类型', required: '是', dataType: 'String', example: '2', description: '时间发生时间类型 1、实际发生 2、预计发生' }, + { id: 'location', field: 'location', fieldName: '地点', required: '是', dataType: 'String', example: 'PRINCE RUPERT, BC', description: '地点' }, + ] }, + + ] + }, + ], + }, + { + api:'1-0', + selectedVersion:'新智慧1.0', + mainTitle: '账号验证', + h2Title1: '1-1 HTTP请求头格式', + description: 'ACCESS_TOKEN 可以联系客服创建,在对应用户的 API 密钥中创建。每一个 api 请求都要在 HTTP 请求头中包含 密钥,具体格式查看上面的 HTTP 请求头格式。', + codeLines: ` Authorization: Bearer ACCESS_TOKEN + Content-Type: application/json + Accept: application/json + Accept-Language: zh-CN`.split('\n'), + apiDesc:[ + { + h2Title: '创建运单', + requestUrl: '[POST] http://aafexp.nextsls.com/api/v5/shipment/create', + type:"", + description:"", + codeLines: ` + { + "shipment": { + "service": "B2B", + "shipmentType": "", + "transportMode": "AIR", + "store_id": "", + "client_reference": "", + "parcel_count": 2, + "export_scc": 0, + "import_scc": 0, + "attrs": [ + ], + "vat_number": "", + "ioss": "", + "from_address": { + "name": "API TEST", + "company": "ParcelC", + "tel": "1818181811", + "mobile": "", + "address_1": "Amazonstrasse 1", + "address_2": "", + "address_3": "", + "city": "Rheinberg", + "state": "", + "country": "DE", + "postcode": "47495", + "email": "" + }, + "to_address": { + "name": "API TEST", + "company": "ParcelC", + "tel": "1818181811", + "mobile": "", + "address_1": "Amazonstrasse 1", + "address_2": "", + "address_3": "", + "city": "Rheinberg", + "state": "", + "country": "DE", + "postcode": "47495", + "email": "" + }, + "parcels": [ + { + "number": 1, + "client_weight": 2, + "client_length": 3, + "client_width": 4, + "client_height": 5, + "declarations": [ + { + "sku": "testsku", + "name_zh": "zhongwenming", + "name_en": "yingwenming", + "unit_value": 11, + "qty": 1, + "material": "glass", + "usage": "play", + "brand": "", + "sale_price": 0, + "sale_url": "", + "asin": "", + "fnsku": "fnsku", + "weight": 0, + "size": "", + "photo_url": "", + "hscode": 1234567890, + "duty_rate": 0, + "origin": "", + "photos": "", + "title": "", + "description": "" + }, + { + "sku": "testsku2", + "name_zh": "zhongwenming2", + "name_en": "yingwenming2", + "unit_value": 22, + "qty": 2, + "material": "glass", + "usage": "play", + "brand": "", + "sale_price": 0, + "sale_url": "", + "asin": "", + "fnsku": "fnsku", + "weight": 0, + "size": "", + "photo_url": "", + "hscode": 1234567890, + "duty_rate": 0, + "origin": "", + "photos": "", + "title": "", + "description": "" + } + ] + }, + { + "number": 2, + "client_weight": 2, + "client_length": 3, + "client_width": 4, + "client_height": 5, + "declarations": [ + { + "sku": "testsku", + "name_zh": "zhongwenming", + "name_en": "yingwenming", + "unit_value": 11, + "qty": 1, + "material": "glass", + "usage": "play", + "brand": "", + "sale_price": 0, + "sale_url": "", + "asin": "", + "fnsku": "fnsku", + "weight": 0, + "size": "", + "photo_url": "", + "hscode": 1234567890, + "duty_rate": 0, + "origin": "", + "photos": "", + "title": "", + "description": "" + }, + { + "sku": "testsku2", + "name_zh": "zhongwenming2", + "name_en": "yingwenming2", + "unit_value": 22, + "qty": 2, + "material": "glass", + "usage": "play", + "brand": "", + "sale_price": 0, + "sale_url": "", + "asin": "", + "fnsku": "fnsku", + "weight": 0, + "size": "", + "photo_url": "", + "hscode": 1234567890, + "duty_rate": 0, + "origin": "", + "photos": "", + "title": "", + "description": "" + } + ] + } + ], + "remark": "" + } + }`.split('\n'), + codeLines1: ` + { + "status": 1, + "info": "请求成功的完成", + "time": 1529458913, + "data": { + "shipment": { + "shipment_id": "10000060" + } + } + } + 如果是二次换标的渠道,relabel为1,这里会直接返回系统标签,无需二次请求标签: + { + "status": 1, + "info": "请求成功的完成", + "time": 1529458913, + "data": { + "shipment": { + "shipment_id": "10000060", + "relabel": 1, + "parcels": [ + { + "item_number": "10000060", + "label_url": "" + } + ] + } + } + } + `.split('\n'), + codeLines2: ` + status 状态 是 Int 1请求成功,0请求失败 + info 原因 是 String + time 请求返回时间戳 否 Int + data.shipment.shipment_id 运单号 否 String + data.shipment.relabel 是否换标 否 String 0 代表不用换标,get_labels获取的是末端标签;1 代表要换标,获取的是系统标签,可以直接取下面parcels字段里面的标签 + data.shipment.parcels.item_number 箱号 否 String + data.shipment.parcels.label_url 标签文档的url地址 否 String 访问这个地址就能下载标签,标签格式是pdf `.split('\n'), + tableData:[ + { id: 'shipment', field: 'shipment', fieldName: '订单信息', required: '是', dataType: 'Shipment Object', example: '', description: '订单详细信息',children:[ + { id: 'service', field: 'service', fieldName: '服务类型代码', required: '是', dataType: 'String', example: '', description: '通过get_service接口可以查看' }, + { id: 'transportMode', field: 'transportMode', fieldName: '运输方式', required: '是', dataType: 'string', example: 'AIR', description: '海运-OCEAN, 空运-AIR, 铁路-RAIL, 卡航-ROAD' }, + { id: 'shipmentType', field: 'shipmentType', fieldName: '收件地址类型', required: '是', dataType: 'string', example: '1', description: '1:FBA地址 2:第三方海外仓 3:商业地址 4:住宅地址' }, + { id: 'store_id', field: 'store_id', fieldName: '店铺名称', required: '否', dataType: 'String', example: '', description: '默认为空' }, + { id: 'client_reference', field: 'client_reference', fieldName: '客户订单号', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'reference_1', field: 'reference_1', fieldName: '参考号一', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'reference_2', field: 'reference_2', fieldName: '参考号二', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'parcel_count', field: 'parcel_count', fieldName: '箱子总数', required: '是', dataType: 'String', example: '', description: '' }, + { id: 'taxwith', field: 'taxwith', fieldName: '交税方式', required: '否', dataType: 'Int', example: '0', description: '默认值为0 什么都不选择;1 不包税;2 包税;3 自主税号;4 自税递延' }, + { id: 'deliverywith', field: 'deliverywith', fieldName: '交货条款', required: '否', dataType: 'String', example: '', description: '默认为空。ddu代表DDU; ddp代表DDP' }, + { id: 'exportwith', field: 'exportwith', fieldName: '报关', required: '否', dataType: 'Int', example: '0', description: '默认值为0 什么都不选择;1 买单报关;2 报关退税' }, + { id: 'importwith', field: 'importwith', fieldName: '清关', required: '否', dataType: 'Int', example: '0', description: '默认值为0 什么都不选择;1 一般贸易清关;2 快件清关' }, + { id: 'attrs', field: 'attrs', fieldName: '物品属性', required: '否', dataType: 'array', example: '["elec", "magnetic"]', description: '带电:elec 带磁:magnetic 危险品:danger 液体:liquid 粉末:powder 膏体:paste 敏感货:sensitive_goods 木制品:wood 纺织品:textile' }, + { id: 'vat_number', field: 'vat_number', fieldName: 'vat号', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'ioss', field: 'ioss', fieldName: 'IOSS号', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'eori', field: 'eori', fieldName: 'eori号', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'cod_amount', field: 'cod_amount', fieldName: '代收金额', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'cod_currency', field: 'cod_currency', fieldName: '代收币种', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'declaration_currency', field: 'declaration_currency', fieldName: '申报币种', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'amazon_ref_id', field: 'amazon_ref_id', fieldName: 'Amazon Reference ID', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'to_warehouse_code', field: 'to_warehouse_code', fieldName: '仓库代码', required: '否', dataType: 'String', example: '', description: '' }, + { id: 'to_address', field: 'to_address', fieldName: '收件人地址', required: '是', dataType: 'Address Object', example: '', description: '' }, + { id: 'from_address', field: 'from_address', fieldName: '发件人地址', required: '条件', dataType: 'Address Object', example: '', description: '选填,如果填了,Address Object必填项要填上' }, + { id: 'parcels', field: 'parcels', fieldName: '箱子', required: '是', dataType: 'Parcels Object Array', example: '', description: '' }, + { id: 'remark', field: 'remark', fieldName: '备注', required: '否', dataType: 'String', example: '', description: '' } + ] + }, + { id: 'Address', field: 'Address', fieldName: '地址相关', required: '是', dataType: 'Address Object', example: '', description: '',children:[ + { id: 'name', field: 'name', fieldName: '名称', required: '是', dataType: 'String', example: '张三', description: '' }, + { id: 'company', field: 'company', fieldName: '公司名', required: '否', dataType: 'String', example: '某科技公司', description: '' }, + { id: 'tel', field: 'tel', fieldName: '电话', required: '否', dataType: 'String', example: '021-123456', description: '' }, + { id: 'mobile', field: 'mobile', fieldName: '手机', required: '否', dataType: 'String', example: '13812345678', description: '' }, + { id: 'city', field: 'city', fieldName: '城市', required: '是', dataType: 'String', example: '上海', description: '' }, + { id: 'state', field: 'state', fieldName: '省/州', required: '否', dataType: 'String', example: '浙江省', description: '' }, + { id: 'state_code', field: 'state_code', fieldName: '省/州代码', required: '否', dataType: 'String', example: 'ZJ', description: '' }, + { id: 'country', field: 'country', fieldName: '国家', required: '是', dataType: 'String', example: '中国', description: '' }, + { id: 'postcode', field: 'postcode', fieldName: '邮编', required: '是', dataType: 'String', example: '200000', description: '' }, + { id: 'email', field: 'email', fieldName: '邮箱', required: '否', dataType: 'String', example: 'example@email.com', description: '' }, + { id: 'ext', field: 'ext', fieldName: '附加信息', required: '否', dataType: 'Ext Object', example: '{}', description: '包含扩展信息的对象' }, + { id: 'address_1', field: 'address_1', fieldName: '地址一', required: '是', dataType: 'String', example: '某街道某号', description: '' }, + { id: 'address_2', field: 'address_2', fieldName: '地址二', required: '否', dataType: 'String', example: '某大楼某层', description: '' }, + { id: 'address_3', field: 'address_3', fieldName: '地址三', required: '否', dataType: 'String', example: '某单元某室', description: '' } + ]}, + { id: 'Ext Object', field: 'Ext Object', fieldName: 'EXT相关', required: '否', dataType: 'Ext Object', example: '', description: '',children:[ + { id: 'identity_card_no', field: 'identity_card_no', fieldName: '身份证号码', required: '否', dataType: 'String', example: '', description: '' } + ]}, + { id: 'Parcels Object Array', field: 'Parcels Object Array', fieldName: 'Parcels Object Array', required: '', dataType: 'Parcels Object Array', example: '', description: '',children:[ + { id: 'number', field: 'number', fieldName: '箱号', required: '是', dataType: 'String', example: 'FBAABCD1234U000001', description: '按1,2,3…顺序递增。有FBA箱号可以填写FBA箱号' }, + { id: 'client_weight', field: 'client_weight', fieldName: '重量', required: '条件', dataType: 'Number', example: '5', description: '单位kg。如果调用修改客户重量尺寸接口则必填' }, + { id: 'client_length', field: 'client_length', fieldName: '长', required: '否', dataType: 'Number', example: '120', description: '单位cm' }, + { id: 'client_width', field: 'client_width', fieldName: '宽', required: '否', dataType: 'Number', example: '80', description: '单位cm' }, + { id: 'client_height', field: 'client_height', fieldName: '高', required: '否', dataType: 'Number', example: '60', description: '单位cm' }, + { id: 'declarations', field: 'declarations', fieldName: '申报信息', required: '是', dataType: 'Declarations Object Array', example: '', description: '中文品名和英文品名为必填,其他哪些必填需要跟客服联系' } + ]}, + { id: 'Declarations Object Array', field: 'Declarations Object Array', fieldName: 'Declarations Object Array', required: '', dataType: 'Declarations Object Array', example: '', description: '',children:[ + { id: 'sku', field: 'sku', fieldName: 'SKU', required: '否', dataType: 'String', example: 'SKU12345', description: '' }, + { id: 'name_zh', field: 'name_zh', fieldName: '中文品名', required: '是', dataType: 'String', example: '蓝牙耳机', description: '' }, + { id: 'name_en', field: 'name_en', fieldName: '英文品名', required: '是', dataType: 'String', example: 'Bluetooth Headphones', description: '' }, + { id: 'unit_value', field: 'unit_value', fieldName: '申报单价', required: '否', dataType: 'Number', example: '50.00', description: '' }, + { id: 'qty', field: 'qty', fieldName: '申报数量', required: '否', dataType: 'Int', example: '100', description: '' }, + { id: 'material', field: 'material', fieldName: '材质', required: '否', dataType: 'String', example: '塑料', description: '' }, + { id: 'usage', field: 'usage', fieldName: '用途', required: '否', dataType: 'String', example: '个人使用', description: '' }, + { id: 'brand', field: 'brand', fieldName: '品牌名称', required: '否', dataType: 'String', example: 'Generic', description: '' }, + { id: 'brand_type', field: 'brand_type', fieldName: '品牌类型', required: '否', dataType: 'String', example: '国际品牌', description: '' }, + { id: 'model', field: 'model', fieldName: '型号', required: '否', dataType: 'String', example: 'Model X', description: '' }, + { id: 'sale_price', field: 'sale_price', fieldName: '销售价格', required: '否', dataType: 'Number', example: '99.99', description: '' }, + { id: 'sale_url', field: 'sale_url', fieldName: '销售链接', required: '否', dataType: 'String', example: 'http://example.com/product', description: '' }, + { id: 'asin', field: 'asin', fieldName: 'ASIN', required: '否', dataType: 'String', example: 'B00XXXXXX', description: '' }, + { id: 'fnsku', field: 'fnsku', fieldName: 'FNSKU', required: '否', dataType: 'String', example: 'X000XXXXXX', description: '' }, + { id: 'weight', field: 'weight', fieldName: '单个产品重量', required: '否', dataType: 'Number', example: '0.2', description: '单位kg' }, + { id: 'size', field: 'size', fieldName: '尺寸', required: '否', dataType: 'String', example: '10*10*10', description: '格式:长*宽*高' }, + { id: 'photo_url', field: 'photo_url', fieldName: '图片链接', required: '否', dataType: 'String', example: 'http://example.com/image.jpg', description: '' }, + { id: 'hscode', field: 'hscode', fieldName: '海关编码', required: '否', dataType: 'String', example: '8517.12', description: '' }, + { id: 'duty_rate', field: 'duty_rate', fieldName: '税率', required: '否', dataType: 'Number', example: '10%', description: '' }, + { id: 'origin', field: 'origin', fieldName: '产地', required: '否', dataType: 'String', example: '中国', description: '' }, + { id: 'photos', field: 'photos', fieldName: '图片', required: '否', dataType: 'String', example: 'http://example.com/photo1.jpg; http://example.com/photo2.jpg', description: '' }, + { id: 'is_battery', field: 'is_battery', fieldName: '产品是否带电', required: '否', dataType: 'Int', example: '1', description: '默认为0。1为是,0为否' }, + { id: 'is_magnetic', field: 'is_magnetic', fieldName: '产品是否带磁', required: '否', dataType: 'Int', example: '0', description: '默认为0。1为是,0为否' }, + { id: 'battery_label', field: 'battery_label', fieldName: '电池标号', required: '否', dataType: 'String', example: 'BL-5C', description: '' }, + { id: 'battery_description', field: 'battery_description', fieldName: '电池描述', required: '否', dataType: 'String', example: '锂离子电池', description: '' }, + { id: 'title', field: 'title', fieldName: '产品标题', required: '否', dataType: 'String', example: '高性能蓝牙耳机', description: '' }, + { id: 'description', field: 'description', fieldName: '产品描述', required: '否', dataType: 'String', example: '耐用且轻便,适合所有类型的户外活动。', description: '' }, + { id: 'platform', field: 'platform', fieldName: '平台', required: '否', dataType: 'String', example: 'Amazon', description: '' }, + { id: 'amazon_ref_id', field: 'amazon_ref_id', fieldName: '亚马逊的Amazon Reference Id', required: '否', dataType: 'String', example: 'REF1234567', description: '如果是同一个运单的话就填相同的,不同的话就填对应的' }, + { id: 'unit', field: 'unit', fieldName: '单位', required: '否', dataType: 'String', example: '件', description: '' } + ]}, + ] + }, + ], + }, + // 其他数据对象 + ]; + + // 根据 api 参数筛选数据 + this.apiData = allData.filter(item => item.api.includes(api)&&item.selectedVersion.includes(selected)); + }, + copyToClipboard (text) { + const code = text.join('\n'); + const textArea = document.createElement('textarea'); + textArea.value = code; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand('copy'); + document.body.removeChild(textArea); + this.$message({ + message: '代码已复制到剪贴板', + type: 'success', + center: true + }); + }, + handleOpen(key, keyPath) { + // handle open + }, + handleClose(key, keyPath) { + // handle close + }, + handleSelect(key, keyPath,selectType) { + console.log(key, keyPath,selectType, 'select'); + this.totalIndex = keyPath[0]; + this.$router.push({ name: 'mainComponents', query: { api: key,selectedVersion:selectType } }); + }, + filteredMenuItems(val) { + this.propList = []; + if (val === "") { + return this.menuItems; // 如果没有搜索查询,返回全部 + } + const searchLower = `${val}`; + const append = this.menuItems.map((item, index) => { + const key = Object.keys(this.menuItems[index])[0]; + const eleIndex = item[key].findIndex(element => searchLower === element.title.toLowerCase()); + if (eleIndex !== -1) { + return { groupIndex: index, itemIndex: eleIndex, item: item[key][eleIndex] }; + } + }); + const appendData = append.filter(x => x !== undefined); + const index = `${appendData[0].groupIndex + 1}`; + this.propList.push(index); + } + }, + created() { + const api = this.$route.query.api; + const selectedVersion = this.$route.query.selectedVersion; + if (api&&selectedVersion) { + this.fetchData(api,selectedVersion); + } + }, + watch: { + // 监听 api 变化 + '$route.query.api': { + handler(newApi) { + if (newApi) { + this.fetchData(newApi, this.$route.query.selectedVersion); + } + }, + immediate: true + }, + // 监听 selectedVersion 变化 + '$route.query.selectedVersion': { + handler(newVersion) { + if (newVersion) { + this.fetchData(this.$route.query.api, newVersion); + } + }, + immediate: true } +} };