文档格式更新:优化按钮的条件渲染及错误码展示

- 使用严格等于比较增强按钮的条件渲染逻辑。
- 重构错误码参照表的样式,提升可读性和美观性。
- 扩展系统级和数据模块错误码的文档,包括服务级错误码的详细说明。
- 修复邮编查询功能,确保在展示错误信息时使用精确的条件判断。
-样式调整,使表格边框更加紧凑,表格单元格内文本对齐左。
master
wxy 2024-09-08 14:31:23 +08:00
parent 14d1e7b36a
commit cab71819eb
1 changed files with 74 additions and 10 deletions

View File

@ -9,13 +9,13 @@
<p><strong></strong> <span class="price">{{ price }}/</span></p> <p><strong></strong> <span class="price">{{ price }}/</span></p>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testPhone()" v-if="this.name =='手机号查询归属地'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testPhone()" v-if="this.name ==='手机号查询归属地'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testIP()" v-if="this.name=='IP查询归属地'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testIP()" v-if="this.name==='IP查询归属地'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testNews()" v-if="this.name=='新闻头条'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testNews()" v-if="this.name==='新闻头条'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="this.name=='气象预警'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="this.name==='气象预警'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testBirthdate()" v-if="this.name=='生辰助手'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testBirthdate()" v-if="this.name==='生辰助手'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="this.name=='邮编查询'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="this.name==='邮编查询'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeatherForecast()" v-if="this.name=='天气预报'">API</el-button> <el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeatherForecast()" v-if="this.name==='天气预报'">API</el-button>
<!-- 手机号查询归属地--> <!-- 手机号查询归属地-->
@ -116,7 +116,7 @@
<el-form-item label="时" > <el-form-item label="时" >
<el-input v-model="formBirthday.hour" autocomplete="off" placeholder="请输入几点"></el-input> <el-input v-model="formBirthday.hour" autocomplete="off" placeholder="请输入几点"></el-input>
</el-form-item> </el-form-item>
<span style="font-weight: bold;font-size: 20px" v-if="formBirthday.reason==true"> <span style="font-weight: bold;font-size: 20px" v-if="formBirthday.reason===true">
years {{this.formBirthday.years}}<br> years {{this.formBirthday.years}}<br>
months {{this.formBirthday.months}}<br> months {{this.formBirthday.months}}<br>
days {{this.formBirthday.days}}<br> days {{this.formBirthday.days}}<br>
@ -149,7 +149,7 @@
<el-form-item label="邮编" > <el-form-item label="邮编" >
<el-input v-model="formPostCode.code" autocomplete="off" placeholder="请输入邮编"></el-input> <el-input v-model="formPostCode.code" autocomplete="off" placeholder="请输入邮编"></el-input>
</el-form-item> </el-form-item>
<el-table :data="gridData2" v-if="formPostCode.reason==true"> <el-table :data="gridData2" v-if="formPostCode.reason===true">
<el-table-column property="postNumber" label="邮编" width="150"></el-table-column> <el-table-column property="postNumber" label="邮编" width="150"></el-table-column>
<el-table-column property="province" label="省" width="200"></el-table-column> <el-table-column property="province" label="省" width="200"></el-table-column>
<el-table-column property="city" label="市"></el-table-column> <el-table-column property="city" label="市"></el-table-column>
@ -195,8 +195,45 @@
</el-main> </el-main>
</div> </div>
<div v-if="activeTab === 'error-codes'"> <div v-if="activeTab === 'error-codes'">
<h1>服务级错误码参照(error_code)</h1> <el-card style="width: 80%; margin: 20px auto; box-shadow: 0 2px 12px rgba(0,0,0,0.1);">
<h3 style="text-align: center; margin-bottom: 20px;">服务级错误码参照(error_code)</h3>
<table border="1" style="width: 100%; margin-bottom: 20px;">
<tr>
<td>错误码</td>
<td>说明</td>
</tr>
<tr v-for="errorCode in errorCodes" :key="errorCode.code">
<td>{{ errorCode.code }}</td>
<td>{{ errorCode.description }}</td>
</tr>
</table>
<h3 style="text-align: center; margin-bottom: 20px;">系统级错误码参照</h3>
<table border="1" style="width: 100%;">
<tr>
<td>错误码</td>
<td>说明</td>
</tr>
<tr v-for="errorCode in Codes" :key="errorCode.code">
<td>{{ errorCode.code }}</td>
<td>{{ errorCode.description }}</td>
</tr>
</table>
<h3 style="text-align: center; margin-bottom: 20px;">错误格式说明示例200201</h3>
<table border="1" style="width: 100%;">
<tr>
<td>2</td>
<td>002</td>
</tr>
<tr v-for="errorCode in Cods" :key="errorCode.code">
<td>{{ errorCode.code }}</td>
<td>{{ errorCode.description }}</td>
</tr>
</table>
</el-card>
</div> </div>
<div v-if="activeTab === 'data-stats'"> <div v-if="activeTab === 'data-stats'">
@ -214,6 +251,18 @@ import {phonePlace ,getIpPlace,getWeatherForecast,getHeadlines,getWeather,getBir
export default { export default {
data() { data() {
return { return {
Cods: [
{ code: '服务级错误1为系统级错误', description: '服务模块代码(即数据ID)' },
],
Codes: [
{ code: '10001', description: '错误的请求KEY' },
{ code: '10002', description: '该KEY无请求权限' },
{ code: '10003', description: 'KEY过期' },
{ code: '10004', description: '系统内部异常' },
],
errorCodes: [
{ code: '203201', description: '错误的经纬度' },
],
// //
formPostCode:{ formPostCode:{
code:"", code:"",
@ -473,4 +522,19 @@ export default {
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
table {
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style> </style>