Commit 0f60bdcc authored by 彭松's avatar 彭松

1

parent 1748f3e6
......@@ -626,6 +626,15 @@ const routes = [
),
meta: { title: "接口信息" },
},
{
path: "dictionary",
name: "dictionary",
component: () =>
import(
/* webpackChunkName: "portDocument" */ "@/views/thePlatformIsSet/components/dictionary/dictionary.vue"
),
meta: { title: "字典管理" },
},
{
path: "permissionsModel",
name: "permissionsModel",
......
......@@ -3,11 +3,7 @@
<div class="search_box" ref="search_box">
<h3>API服务</h3>
<h4>
<a-input
placeholder="请输入API名称搜索"
v-model="searchVal"
@pressEnter="getServiceApiList"
/>
<a-input placeholder="请输入API名称搜索" v-model="searchVal" @pressEnter="getServiceApiList" />
<button class="search_btn btn" @click="handleSearch">
<span>{{ isSearch ? "重置" : "搜索" }}</span>
</button>
......@@ -16,13 +12,9 @@
<div class="stepbox" :style="{ height: contentHigh + 'px' }">
<div class="_left">
<a-steps progress-dot direction="vertical">
<a-step
v-for="(item, index) in stepsList"
:status="active === index ? 'process' : 'wait'"
:key="index"
>
<a-step v-for="(item, index) in stepsList" :status="active === index ? 'process' : 'wait'" :key="index">
<span slot="title" @click="handleChange(item, index)">{{
item.serviceName
item.productName
}}</span>
</a-step>
</a-steps>
......@@ -30,17 +22,13 @@
<div class="_right">
<div class="list_box step_sign">
<div class="title-box">
<span class="list_title">{{ curApiInfo.serviceName }}</span>
<span class="count primary">{{ curApiInfo.count }}</span>
<span class="list_title">{{ curApiInfo.name }}</span>
<span class="count primary">{{ curApiInfo.total }}</span>
</div>
<div
class="list flex aic jcb"
v-for="v in curApiInfo.serviceList"
:key="v.id"
>
<div class="api-name">{{ v.apiName }}</div>
<span class="service-name">{{ v.systemServiceName }}</span>
<a-button icon="read" type="primary" class="addclass" @click="pushroeuter(v)">
<div class="list flex aic jcb" v-for="v in curApiInfo.list" :key="v.id">
<div class="api-name">{{ v.interfaceName }}</div>
<span class="service-name">{{ v.description }}</span>
<a-button icon="read" type="primary" class="addclass" @click="pushroeuter(v)">
查看文档
</a-button>
</div>
......@@ -51,7 +39,8 @@
</template>
<script>
import { serviceApiList } from "@/api/APIServe.js";
// import { serviceApiList } from "@/api/APIServe.js";
import { getProduct, getInterfaceList } from "@/api/thePlatformIsSet.js";
import common from "@/mixins/common";
export default {
name: "PortalAdminVueAPIServe",
......@@ -62,6 +51,7 @@ export default {
stepsList: [],
isSearch: false,
active: 0,
curApiInfo: {}, // 当前api信息
};
},
......@@ -74,22 +64,35 @@ export default {
methods: {
getServiceApiList() {
serviceApiList({
getProduct({
page: 1,
size: -1, //每页条数
apiName: `%${this.searchVal}%`,
productName: `%${this.searchVal}%`,
}).then((res) => {
let { code, data } = res;
if (code == 1) {
if (data.data.length) {
this.stepsList = data.data;
this.curApiInfo = data.data[0];
this.getApiDetail(data.data[0])
} else {
this.curApiInfo = {};
}
}
});
},
getApiDetail(item) {
getInterfaceList({ page: 1, size: -1, productId: item.id }).then((res) => {
let { code, data } = res;
if (code == 1) {
this.curApiInfo = {
name: item.productName,
list: data.data,
total: data.total
}
}
});
},
handleSearch() {
this.isSearch = !this.isSearch;
if (this.isSearch) {
......@@ -104,15 +107,14 @@ export default {
// 切换设备
handleChange(row, index) {
this.active = index;
this.curApiInfo = row;
this.searchVal = "";
this.getApiDetail(row)
},
pushroeuter() {
this.$message.warning("暂未开通文档查看");
// this.$router.push({
// path: "/home/thePlatformIsSet/portDocument",
// // query: { testoption: "test001" },
// });
pushroeuter(v) {
this.$router.push({
path: "/home/thePlatformIsSet/portDocument",
query: { id: v.id },
});
},
},
};
......@@ -120,12 +122,14 @@ export default {
<style lang="less" scoped>
@headerH: 4.5rem;
.Container {
width: 100%;
height: 100vh;
background: #f5f5f5;
display: flex;
flex-direction: column;
.search_box {
height: 300px;
background: url("~@/assets/images/u210.png") top no-repeat;
......@@ -134,16 +138,19 @@ export default {
align-items: center;
display: flex;
flex-flow: column;
h3 {
font-size: 2.4rem;
color: #fff;
font-weight: bold;
padding: 4rem 0 2rem;
}
h4 {
display: flex;
align-items: center;
}
/deep/.ant-input {
width: 30rem !important;
margin-right: 2rem;
......@@ -169,7 +176,8 @@ export default {
line-height: 42px;
padding: 0;
border: none;
& > span {
&>span {
position: relative;
display: block;
width: 100%;
......@@ -213,8 +221,8 @@ export default {
width: 100%;
}
& > span:before,
& > span:after {
&>span:before,
&>span:after {
position: absolute;
content: "";
left: 0;
......@@ -227,39 +235,43 @@ export default {
transition: all 0.3s ease;
}
& > span:before {
&>span:before {
width: 2px;
height: 0%;
}
& > span:after {
&>span:after {
height: 2px;
width: 0%;
}
& > span:hover:before {
&>span:hover:before {
height: 100%;
}
& > span:hover:after {
&>span:hover:after {
width: 100%;
}
}
}
.stepbox {
width: 90%;
margin-left: 5%;
flex: 1;
display: flex;
/deep/.ant-steps-item-content {
cursor: pointer;
}
._left {
width: 300px;
height: 100%;
padding: 20px;
margin-right: 20px;
overflow: auto;
&::-webkit-scrollbar {
width: 3px;
height: 3px;
......@@ -282,6 +294,7 @@ export default {
height: 100%;
padding: 20px;
overflow-y: auto;
&::-webkit-scrollbar {
width: 3px;
height: 3px;
......@@ -297,16 +310,20 @@ export default {
border-radius: 3px;
background: #fff;
}
.title-box {
font-size: 24px;
.list_title {
margin-right: 10px;
font-weight: 600;
}
.count {
font-weight: 600;
}
}
.list {
width: 100%;
height: 80px;
......@@ -314,38 +331,35 @@ export default {
padding: 0px 20px;
background-color: #fff;
border-radius: 4px;
.api-name {
font-size: 16px;
font-weight: 600;
}
.service-name {
font-size: 14px;
}
}
}
}
&::before {
content: "";
display: block;
width: 100%;
height: @headerH;
background: rgb(59, 135, 255);
background: -moz-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
background: -webkit-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
background: linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff",endColorstr="#6c35f7",GradientType=1);
background: -moz-linear-gradient(174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
background: -webkit-linear-gradient(174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
background: linear-gradient(174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff", endColorstr="#6c35f7", GradientType=1);
}
}
</style>
\ No newline at end of file
......@@ -2,89 +2,74 @@
<div class="Container">
<div class="content">
<div class="top">
<h1 class="title_text">RecognizeAccountPage - 户口页识别</h1>
<h1 class="title_text">{{ detailsForm.interfaceName }}</h1>
<button class="go_back" @click="$router.go(-1)">返回上一级</button>
</div>
<a-card title="接口信息" :bordered="false" class="card_box">
<p class="text1">
户口页识别能力可以对户口本常住人口登记卡进行结构化识别,输出姓名、籍贯、民族、性别、身份证号、出生地、出生日期、户主或户主关系、承办人签章、注册章位置、其他印章位置,共11个关键字段信息。
</p>
<div class="matter_box">
<p>输入限制:</p>
<p v-for="item of 4">
{{ item }}.图像格式:JPEG、JPG、PNG、BMP、GIF。
</p>
</div>
<a-descriptions>
<a-descriptions-item label="接口名称">{{ detailsForm.interfaceName }}</a-descriptions-item>
<a-descriptions-item label="版本号">{{ detailsForm.versionNumber }}</a-descriptions-item>
<a-descriptions-item label="请求类型">{{ detailsForm.requestType == 1 ? 'GET' : 'POST' }}</a-descriptions-item>
<a-descriptions-item label="请求协议">{{ detailsForm.requestProtocol == 1 ? 'HTTP' : 'HTTPS'
}}</a-descriptions-item>
<a-descriptions-item label="content-type">{{ detailsForm.contentType }}</a-descriptions-item>
<a-descriptions-item label="超时时长">{{ detailsForm.timeoutValue }}</a-descriptions-item>
<a-descriptions-item label="限流策略">{{ detailsForm.limitStrategy == 1 ? '分钟' : '小时' }}</a-descriptions-item>
<a-descriptions-item label="访问网络" v-if="detailsForm && detailsForm.network">
<span v-for="item, idx of dict.network" v-show="detailsForm.network.indexOf(idx) != -1" :key="idx"> {{ item }}
</span>
</a-descriptions-item>
<a-descriptions-item label="接口标签" v-if="dict.interfaceTag">{{ dict.interfaceTag[detailsForm.interfaceTag]
}}</a-descriptions-item>
<a-descriptions-item label="接口来源" v-if="dict.interfaceSource">{{
dict.interfaceSource[detailsForm.interfaceSource] }}</a-descriptions-item>
<a-descriptions-item label="请求路径">{{ detailsForm.requestUrl }}</a-descriptions-item>
<br>
<a-descriptions-item label="描述" span="{3}">{{ detailsForm.description }}</a-descriptions-item>
</a-descriptions>
</a-card>
<a-card title="请求参数" :bordered="false" class="card_box">
<a-table
bordered
:row-key="(record) => record.key"
:pagination="false"
:columns="tableHeaders"
:dataSource="sourceData"
>
<div class="flex aic jcb mb10">
<a-radio-group v-model="requestPam.type" button-style="solid" disabled>
<a-radio-button value="path"> 路径参数 </a-radio-button>
<a-radio-button value="headers"> headers </a-radio-button>
<a-radio-button value="query"> query </a-radio-button>
<a-radio-button value="body"> body </a-radio-button>
</a-radio-group>
<div class="flex aic">
<div class="mr10">入参是否加密</div>
<div>{{ detailsForm.inEncrypt == 1 ? '加密' : '不加密' }}</div>
</div>
</div>
<a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }" :pagination="false"
:columns="table_columns" :dataSource="requestPam.table">
</a-table>
</a-card>
<a-card title="响应数据" :bordered="false" class="card_box">
<div class="flex aic mb10" style="justify-content: flex-end;">
<div class="flex aic">
<div class="mr10">出参是否加密</div>
<div>{{ detailsForm.outEncrypt == 1 ? '加密' : '不加密' }}</div>
</div>
</div>
<a-table size="middle" bordered :row-key="(record) => record.id" :locale="{ emptyText: '无' }" :pagination="false"
:columns="table_columns" :dataSource="responsePam.table">
</a-table>
</a-card>
<a-card title="返回示例" :bordered="false" class="card_box">
<p>正常返回示例</p>
<div v-highlight>
<pre>
<code class="json">
{
RequestId: "8D588F22-3E14-4674-9EAE-49AE1BA10EA2",
Data: {
Gender: '"Gender": "女",
TitleArea: {
Top: 17,
Width: 30,
Height: 30,
Left: 205,
},
Angle: 0,
RegisterStampAreas: [
{
Top: 2215,
Width: 152,
Height: 138,
Left: 330,
},
],
Nationality: "彝族",
BirthPlace: "四川省雷波县",
OtherStampAreas: [
{
Top: 10,
Width: 10,
Height: 10,
Left: 10,
},
],
UndertakeStampAreas: [
{
Top: 10,
Width: 10,
Height: 10,
Left: 10,
},
],
BirthDate: "2002年12月27日",
Relation: "孙女",
NativePlace: "四川省雷波县",
Name: "杨冬",
IDNumber: "513437200212271325",
InvalidStampAreas: [
{
Top: 10,
Width: 10,
Height: 10,
Left: 10,
},
],
},
}
</code>
</pre>
<code class="json" v-html="allResData"></code>
</pre>
</div>
<p>错误返回示例</p>
<div v-highlight>
<pre>
<code class="json" v-html="errJson"></code>
</pre>
</div>
</a-card>
</div>
......@@ -95,6 +80,9 @@
import Vue from "vue";
import hljs from "highlight.js";
import "highlight.js/styles/monokai-sublime.css";
import {
getInterfaceInfo
} from '@/api/thePlatformIsSet.js'
Vue.directive("highlight", function (el) {
let blocks = el.querySelectorAll("pre code");
blocks.forEach((block) => {
......@@ -105,59 +93,63 @@ export default {
name: "PortalAdminVuePortDocument",
data() {
return {
tableHeaders: [
{
title: "名称",
dataIndex: "name",
align: "center",
},
{
title: "类型",
dataIndex: "type",
align: "center",
},
{
title: "必填",
dataIndex: "mustFillIn",
align: "center",
},
{
title: "描述",
dataIndex: "describe",
align: "center",
},
{
title: "示例值及参考API",
dataIndex: "reference",
align: "center",
},
],
sourceData: [
{
key: "01",
name: "ImageURL",
type: "String",
mustFillIn: "",
describe: "图片URL地址。当前仅支持广安地域的OSS链接。",
reference:
"示例值:http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/ocr/RecognizeAccountPage/hky1.jpg",
},
{
key: "02",
name: "ImageURL",
type: "String",
mustFillIn: "",
describe: "图片URL地址。当前仅支持广安地域的OSS链接。",
reference:
"示例值:http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/ocr/RecognizeAccountPage/hky1.jpg",
},
detailsForm: {},
requestPam: {},
responsePam: {},
dict: {},
table_columns: [{
title: "参数名",
align: "center",
dataIndex: "name"
},
{
title: "参数值类型",
align: "center",
dataIndex: "type",
},
{
title: "jsonPath",
align: "center",
dataIndex: "jsonPath",
},
{
title: "默认值",
align: "center",
dataIndex: "default",
},
{
title: "是否必填",
align: "center",
dataIndex: "isMust",
customRender: (text, record, index) => `${text == 1 ? '' : ''}`,
},
{
title: "描述",
align: "center",
dataIndex: "describe",
width: 200
}
],
allResData: null,
errJson: { "msg": "请选择待查看产品接口信息", "code": -1 }
};
},
mounted() {},
mounted() {
this.getInfo()
},
methods: {
getInfo() {
getInterfaceInfo({ id: this.$route.query.id }).then(res => {
this.allResData = res
res.data.network = res.data.network.split(',')
this.detailsForm = res.data
this.requestPam = JSON.parse(res.data.requestParameters)
this.responsePam = JSON.parse(res.data.responseParameters)
this.dict = res.dict
})
},
toJson(res) {
return JSON.stringify(res);
},
......@@ -167,16 +159,24 @@ export default {
<style lang="less" scoped>
@headerH: 4.5rem;
::v-deep .ant-table {
width: 100%;
}
.Container {
background: #f5f5f5;
.content {
width: 75rem;
margin: 0 auto;
padding: 2.5rem 0;
.top {
display: flex;
justify-content: space-between;
align-items: center;
.title_text {
font-size: 1.2rem;
margin-bottom: 1rem;
......@@ -230,41 +230,39 @@ export default {
}
}
}
.TheSample {
background: #f5f5f5;
padding: 1rem;
}
.card_box {
.text1 {
margin-bottom: 1rem;
}
& + .card_box {
&+.card_box {
margin-top: 1rem;
}
}
}
&::before {
content: "";
display: block;
width: 100%;
height: @headerH;
background: rgb(59, 135, 255);
background: -moz-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
background: -webkit-linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
background: linear-gradient(
174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%
);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff",endColorstr="#6c35f7",GradientType=1);
background: -moz-linear-gradient(174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
background: -webkit-linear-gradient(174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
background: linear-gradient(174deg,
rgba(59, 135, 255, 1) 24%,
rgba(108, 53, 247, 1) 85%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff", endColorstr="#6c35f7", GradientType=1);
}
}
</style>
\ No newline at end of file
<template>
<div class="Container">
<div class="my-card">
<div class="head-menu">
<div>属性字典</div>
</div>
<div class="pd20">
<div class="from-item">
<div class="name">排队机分辨率:</div>
<div>
<a-tag color="blue" closable v-for="item, index in fblList" :key="index">
{{ item.name }}
</a-tag>
</div>
<a-button icon="plus" size="small" @click="addZdShow('fblList', '排队机分辨率')">添加字典值</a-button>
</div>
<div class="from-item">
<div class="name">接口标签:</div>
<div>
<a-tag color="blue" closable v-for="item, index in bqList" :key="index">
{{ item.name }}
</a-tag>
</div>
<a-button icon="plus" size="small" @click="addZdShow('bqList', '接口标签')">添加字典值</a-button>
</div>
</div>
</div>
<a-modal :title="VisibleTitle" :centered="true" :destroyOnClose="true" :visible="Visible" @cancel="Visible = false"
width="30%">
<a-form-model :label-col="{ span: 5 }" :wrapper-col="{ span: 19 }" layout="horizontal" ref="appInfoFome"
:model="appInfoFome" :rules="appInfoRules">
<a-form-model-item label="字典值" prop="productName">
<a-input placeholder="请输入字典值" allowClear v-model="appInfoFome.productName" />
</a-form-model-item>
</a-form-model>
<template slot="footer">
<a-button type="primary" class="addclass" @click="Modal_Ok">确定</a-button>
<a-button @click="resetForm">重置</a-button>
</template>
</a-modal>
</div>
</template>
<script>
import common from "@/mixins/common";
export default {
name: "dictionary",
mixins: [common],
data() {
return {
fblList: [{
name: "1920*1080"
}, {
name: "1080*1920"
}, {
name: "1280*1280"
}],
bqList: [
{ name: "政务外网" },
{ name: "便民服务" },
{ name: "三化建设" },
],
VisibleTitle: "",
Visible: false,
appInfoFome: {
productName: undefined,
siteId: JSON.parse(localStorage.getItem("siteId"))
}, //页面表单信息
appInfoRules: {
productName: [
{
required: true, //是否必选
whitespace: true, //必选时,空格是否会被视为错误
message: "请输入字典值",
trigger: "blur",
}
],
},
keyName: ""
};
},
created() {
},
mounted() {
},
methods: {
addZdShow(key, title) {
this.Visible = true
this.resetForm()
this.keyName = key
this.VisibleTitle = title
},
Modal_Ok() {
this.$refs.appInfoFome.validate((valid) => {
if (valid) {
this[this.keyName].push({
name: this.appInfoFome.productName
})
this.Visible = false
this.resetForm()
} else {
this.$message.error(`请完善表单信息!`);
return false;
}
});
},
resetForm() {
this.$nextTick(() => {
this.appInfoFome.productName = ''
});
},
},
};
</script>
<style lang="less" scoped>
.from-item {
display: flex;
align-items: center;
margin-bottom: 20px;
.name {
width: 150px;
text-align: right;
padding-right: 20px;
}
}
.Container {
width: 100%;
min-height: 100vh;
background: #f5f5f5;
padding-top: 72px;
.my-card {
margin: 40px 80px;
background: #fff;
border-radius: 6px;
overflow: hidden;
min-height: 500px;
}
.head-menu {
display: flex;
align-items: center;
border-bottom: 1px solid #efefef;
div {
height: 52px;
line-height: 52px;
font-size: 16px;
font-weight: bold;
color: #0595FD;
border-bottom: 2px solid #0595FD;
padding: 0 30px;
margin-left: 20px;
}
}
}
</style>
\ No newline at end of file
......@@ -124,7 +124,8 @@ export default {
query: {
interfaceName: undefined,
interfaceSource: "",
interfaceTag: ""
interfaceTag: "",
productId: this.$route.query.id,
},
tablePagination: {
current: 1,
......
......@@ -104,7 +104,8 @@ export default {
pageSize: 10
},
searchForm: {
deveLanguage: ""
deveLanguage: "",
productId: this.$route.query.id,
},
dict: {
deveLanguage: {},
......
......@@ -101,6 +101,7 @@ export default {
page: this.tablePagination.current,
size: this.tablePagination.pageSize,
docName: this.searchName,
productId: this.$route.query.id,
...search,
}).then((res) => {
if (res.code == 1) {
......
......@@ -91,12 +91,6 @@ export default {
this.listData = res.data.data
})
},
pushroeuter() {
this.$router.push({
path: "/home/thePlatformIsSet/portDocument",
// query: { testoption: "test001" },
});
},
showModal(item) {
if (item) {
this.$refs.AddEditAppName.VisibleTitle = "编辑";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment