2024-03-26 11:18:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="wrap">
|
|
|
|
|
<div class="nextbtn">
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:disabled="active == 0"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="backActiveHandle"
|
|
|
|
|
icon="el-icon-back"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>上一步
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:disabled="active == 2"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="nextActiveHanlde"
|
|
|
|
|
icon="el-icon-right"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>下一步
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="" icon="el-icon-close" @click="backPageHandle">取消</el-button>
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
icon="el-icon-first-aid-kit"
|
|
|
|
|
:loading="commitLoading"
|
|
|
|
|
:disabled="active !== 2"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="commit"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>保存
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="step">
|
|
|
|
|
<el-steps :active="active" finish-status="success" simple>
|
|
|
|
|
<el-step title="设置API基本信息"></el-step>
|
|
|
|
|
<el-step title="添加服务信息"></el-step>
|
|
|
|
|
<el-step title="添加参数映射关系"></el-step>
|
|
|
|
|
</el-steps>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="formdata" v-if="active === 0 || active === 1">
|
|
|
|
|
<div class="title">
|
|
|
|
|
<h1>API基本信息</h1>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<!-- <router-view></router-view> -->
|
|
|
|
|
<template v-if="active === 0">
|
|
|
|
|
<div>
|
|
|
|
|
<baseNewForm
|
2024-05-14 10:08:39 +08:00
|
|
|
|
refName="stepZeroform"
|
|
|
|
|
ref="stepZeroform"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:formRow="stepZeroformRow"
|
|
|
|
|
:ruleForm="stepZeroForm"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
@onSubmit="onSubmitHandle"
|
|
|
|
|
@onChangeRadio="onChangeRadio"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</baseNewForm>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="active === 1">
|
|
|
|
|
<div>
|
|
|
|
|
<baseNewForm
|
2024-05-14 10:08:39 +08:00
|
|
|
|
refName="stepOneform"
|
|
|
|
|
ref="stepOneform"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:formRow="stepOneformRow"
|
|
|
|
|
:ruleForm="stepOneForm"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
@onSubmit="onSubmitHandle"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
></baseNewForm>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="step3" v-if="active === 2">
|
|
|
|
|
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
|
|
|
|
<el-menu-item index="1">Headers入参</el-menu-item>
|
|
|
|
|
<el-menu-item index="2">Query入参</el-menu-item>
|
|
|
|
|
<el-menu-item index="3">Body入参</el-menu-item>
|
|
|
|
|
<el-menu-item index="4">Body出参</el-menu-item>
|
|
|
|
|
<el-menu-item index="5">调试</el-menu-item>
|
2024-05-14 10:08:39 +08:00
|
|
|
|
<el-menu-item index="6">返回值</el-menu-item>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-menu>
|
|
|
|
|
<template v-if="activeIndex === '1'">
|
|
|
|
|
<div class="tableBox">
|
|
|
|
|
<div class="title">
|
|
|
|
|
<div class="left"></div>
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="jsonImportSwitch('headersTableInfo', false)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>导入JSON
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<baseTableForm
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:showIndex="false"
|
|
|
|
|
:indexOperate="false"
|
|
|
|
|
:funWidth="150"
|
|
|
|
|
:funData="[{text:'删除',type:'dele',color:'#e47470'}]"
|
|
|
|
|
:tableInfo="headersTableInfo"
|
|
|
|
|
@onFunc="tableButtonHandle"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<template #parameterType="{ row }">
|
|
|
|
|
<div>
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="fatherSelectChangeHandle(row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in headerparameterTypeOptions"
|
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #concreteType="{ row }">
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="(val) => sonSelectChangeHandle(val, row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in concreteTypeOptions[
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row[0]['parameterType']
|
|
|
|
|
]"
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
<template #example="{ row }">
|
|
|
|
|
<template v-if="row[0]['parameterType'] === 'authport'">
|
|
|
|
|
<!-- <baseCascader
|
|
|
|
|
v-model="row[0]['example']"
|
|
|
|
|
:itemObj="bodyExitTableInfo"
|
|
|
|
|
>
|
|
|
|
|
</baseCascader> -->
|
|
|
|
|
<el-cascader
|
2024-05-14 10:08:39 +08:00
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
ref="elCascader"
|
|
|
|
|
:clearable="true"
|
|
|
|
|
:show-all-levels="false"
|
|
|
|
|
:options="authQueryOut"
|
|
|
|
|
:props="selectprops"
|
|
|
|
|
:disabled="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
></el-cascader>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-input v-model="row[0][row[1].id]"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</baseTableForm>
|
|
|
|
|
<div class="add">
|
|
|
|
|
<el-link
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="addTableData(headersTableInfo.tableData)"
|
|
|
|
|
:underline="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>+ 添加属性
|
|
|
|
|
</el-link
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="activeIndex === '2'">
|
|
|
|
|
<div class="tableBox">
|
|
|
|
|
<div class="title">
|
|
|
|
|
<div class="left"></div>
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="jsonImportSwitch('queryTableInfo', true)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>导入JSON
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<baseTableForm
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:showIndex="false"
|
|
|
|
|
:indexOperate="false"
|
|
|
|
|
:funWidth="150"
|
|
|
|
|
:funData="[{text:'删除',type:'dele',color:'#e47470'}]"
|
|
|
|
|
:tableInfo="queryTableInfo"
|
|
|
|
|
@newRow="queryTableAddHandle"
|
|
|
|
|
@onFunc="tableButtonHandle"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<template #parameterType="{ row }">
|
|
|
|
|
<div>
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="fatherSelectChangeHandle(row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in headerparameterTypeOptions"
|
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #concreteType="{ row }">
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="(val) => sonSelectChangeHandle(val, row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in concreteTypeOptions[
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row[0]['parameterType']
|
|
|
|
|
]"
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
<template #example="{ row }">
|
|
|
|
|
<template v-if="row[0]['parameterType'] === 'authport'">
|
|
|
|
|
<!-- <baseCascader
|
|
|
|
|
v-model="row[0]['example']"
|
|
|
|
|
:itemObj="bodyExitTableInfo"
|
|
|
|
|
>
|
|
|
|
|
</baseCascader> -->
|
|
|
|
|
<el-cascader
|
2024-05-14 10:08:39 +08:00
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
ref="elCascader"
|
|
|
|
|
:clearable="true"
|
|
|
|
|
:show-all-levels="false"
|
|
|
|
|
:options="authQueryOut"
|
|
|
|
|
:props="selectprops"
|
|
|
|
|
:disabled="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
></el-cascader>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-input v-model="row[0][row[1].id]"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</baseTableForm>
|
|
|
|
|
<div class="add">
|
|
|
|
|
<el-link
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="addTableData(queryTableInfo.tableData)"
|
|
|
|
|
:underline="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>+ 添加属性
|
|
|
|
|
</el-link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="activeIndex === '3'">
|
|
|
|
|
<div class="tableBox">
|
|
|
|
|
<div class="title">
|
|
|
|
|
<div class="left"></div>
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="jsonImportSwitch('bodyEntTableInfo', true,true)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>导入JSON
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<baseTableForm
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:showIndex="false"
|
|
|
|
|
:indexOperate="false"
|
|
|
|
|
:funWidth="funWidth"
|
|
|
|
|
:funData="funData"
|
|
|
|
|
:tableInfo="bodyEntTableInfo"
|
|
|
|
|
@onFunc="tableButtonHandle"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<template #parameterName="{row}">
|
|
|
|
|
<div v-if="row[0]['first']" style="text-align: center;width: 100%">{{ row[0].parameterName }}</div>
|
|
|
|
|
<el-input v-else style="width: 100%" v-model="row[0].parameterName"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
<template #parameterType="{ row }">
|
|
|
|
|
<div v-if="row[0]['first']">
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="fatherSelectChangeHandle(row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in bodyOptions"
|
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="fatherSelectChangeHandle(row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in parameterTypeOptions"
|
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #concreteType="{ row }">
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="(val) => sonSelectChangeHandle(val, row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in concreteTypeOptions[
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row[0]['parameterType']
|
|
|
|
|
]"
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
<template #example="{ row }">
|
|
|
|
|
<template v-if="row[0]['parameterType'] === 'authport'">
|
|
|
|
|
<!-- <baseCascader
|
|
|
|
|
v-model="row[0]['example']"
|
|
|
|
|
:itemObj="bodyExitTableInfo"
|
|
|
|
|
>
|
|
|
|
|
</baseCascader> -->
|
|
|
|
|
<el-cascader
|
2024-05-14 10:08:39 +08:00
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
ref="elCascader"
|
|
|
|
|
:clearable="true"
|
|
|
|
|
:show-all-levels="false"
|
|
|
|
|
:options="authQueryOut"
|
|
|
|
|
:props="selectprops"
|
|
|
|
|
:disabled="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
></el-cascader>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-input v-model="row[0][row[1].id]"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</baseTableForm>
|
|
|
|
|
<div class="add">
|
|
|
|
|
<el-link
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="addTableData(bodyEntTableInfo.tableData,true)"
|
|
|
|
|
:underline="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>+ 添加属性
|
|
|
|
|
</el-link
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="activeIndex === '4'">
|
|
|
|
|
<div class="tableBox">
|
|
|
|
|
<div class="title">
|
|
|
|
|
<div class="left"></div>
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<el-button
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="jsonImportSwitch('bodyExitTableInfo', true)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>导入JSON
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<baseTableForm
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:showIndex="false"
|
|
|
|
|
:indexOperate="false"
|
|
|
|
|
:funWidth="funWidth"
|
|
|
|
|
:funData="funData"
|
|
|
|
|
:tableInfo="bodyExitTableInfo"
|
|
|
|
|
@onFunc="tableButtonHandle"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<template #parameterType="{ row }">
|
|
|
|
|
<div>
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="fatherSelectChangeHandle(row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in bodyOutOptions"
|
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #concreteType="{ row }">
|
|
|
|
|
<el-select
|
2024-05-14 10:08:39 +08:00
|
|
|
|
class="w-100"
|
|
|
|
|
v-model="row[0][row[1].id]"
|
|
|
|
|
filterable
|
|
|
|
|
:clearable="true"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="(val) => sonSelectChangeHandle(val, row)"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-for="(el, index) in concreteTypeOptions[
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row[0]['parameterType']
|
|
|
|
|
]"
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:key="el.id"
|
|
|
|
|
:label="el.label"
|
|
|
|
|
:value="el.id"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</baseTableForm>
|
|
|
|
|
<div class="add">
|
|
|
|
|
<el-link
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
@click="addTableData(bodyExitTableInfo.tableData)"
|
|
|
|
|
:underline="false"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>+ 添加属性
|
|
|
|
|
</el-link
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="activeIndex === '5'">
|
|
|
|
|
<apiDebugging :queryTableInfo="queryTableInfo.tableData" :bodyEntTableInfo="bodyEntTableInfo.tableData"
|
|
|
|
|
:bodyExitTableInfo="bodyExitTableInfo.tableData" :stepZeroForm="stepZeroForm"
|
2024-05-07 08:52:54 +08:00
|
|
|
|
:stepOneForm="stepOneForm" :headersTableInfo="headersTableInfo.tableData"
|
|
|
|
|
></apiDebugging>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</template>
|
2024-05-14 10:08:39 +08:00
|
|
|
|
<template v-if="activeIndex === '6'">
|
|
|
|
|
<div style="margin-top: 30px">
|
|
|
|
|
<baseNewForm
|
|
|
|
|
refName="returnedFormName"
|
|
|
|
|
ref="returnedFormName"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:formRow="returnedFormRow"
|
|
|
|
|
:ruleForm="returnedForm"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
>
|
|
|
|
|
</baseNewForm>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<baseRightDialog
|
2024-05-14 10:08:39 +08:00
|
|
|
|
:dialogVisible="rightDialog"
|
|
|
|
|
title="JSON导入"
|
|
|
|
|
@handleClose="dialoghandleClose"
|
|
|
|
|
@handleConfirmClick="JSONCommit"
|
|
|
|
|
:commitLoading="importLoading"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
<div class="top" style="width: 90%; margin: 20px auto">
|
|
|
|
|
<vue-json-editor
|
2024-05-14 10:08:39 +08:00
|
|
|
|
v-model="resultInfo"
|
|
|
|
|
:showBtns="false"
|
|
|
|
|
:mode="'code'"
|
|
|
|
|
@json-change="onJsonChange"
|
|
|
|
|
@json-save="onJsonSave"
|
|
|
|
|
@has-error="onError"
|
2024-03-26 11:18:19 +08:00
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</baseRightDialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-05-07 08:52:54 +08:00
|
|
|
|
import baseCascader from './compoments/baseCascader/index.vue'
|
|
|
|
|
import vueJsonEditor from 'vue-json-editor'
|
|
|
|
|
import baseRightDialog from './compoments/baseRightDialog'
|
|
|
|
|
import { getApiModuleApi } from '@/api/apiChunks/index.js'
|
|
|
|
|
import baseNewForm from './compoments/baseNewForm.vue'
|
|
|
|
|
import baseTableForm from './compoments/baseTableForm_v2.vue'
|
|
|
|
|
import { v4 as uuidv4 } from 'uuid'
|
|
|
|
|
import apiDebugging from '@/views/applicationList/apiList/apiDebugging.vue'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
importLoading: false,
|
2024-03-26 11:18:19 +08:00
|
|
|
|
commitLoading: false,
|
|
|
|
|
authQueryOut: [],
|
|
|
|
|
selectprops: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'parameterName',
|
|
|
|
|
value: 'parameterName',
|
|
|
|
|
expandTrigger: 'hover'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //select label value配置
|
|
|
|
|
resultInfo: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
a: 'b'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
rightDialog: false,
|
|
|
|
|
active: 0,//步骤控制
|
|
|
|
|
stepZeroformRow: [
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: 'API名称',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
maxlength: 50,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'apiName',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
disabled: !this.$route.query.add
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'textrea',
|
|
|
|
|
title: 'API功能描述',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
maxlength: 200,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'apiRemark',
|
|
|
|
|
row: 24
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: 'API应用',
|
|
|
|
|
id: 'appName',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: false,
|
|
|
|
|
editDisable: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
disabled: true
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '模块',
|
|
|
|
|
id: 'catalogueName',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: false,
|
|
|
|
|
editDisable: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
disabled: true
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'radio',
|
|
|
|
|
title: 'API是否需要认证',
|
|
|
|
|
id: 'needLogin',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: true,
|
|
|
|
|
options: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '是',
|
|
|
|
|
id: '1'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '否',
|
|
|
|
|
id: '2'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'newSelect',
|
|
|
|
|
title: '认证接口',
|
|
|
|
|
id: 'authenticationPort',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
show: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
required: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
], //步骤1表
|
|
|
|
|
stepZeroForm: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
needLogin: '1',
|
|
|
|
|
enableAccessEntry: ['2']
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //步骤1表(数据)
|
|
|
|
|
stepOneformRow: [
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '目标地址',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
maxlength: 200,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'destinationAddress',
|
|
|
|
|
pattern: '',
|
|
|
|
|
message: 'URL或协议不合法',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
required: true
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '请求编码',
|
|
|
|
|
id: 'requestCoding',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
options: []
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '请求方法',
|
|
|
|
|
id: 'requestMethod',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
options: []
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'num',
|
|
|
|
|
title: '超出时间',
|
|
|
|
|
id: 'timeoutPeriod',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
min: 1,
|
|
|
|
|
max: 600000,
|
|
|
|
|
maxlength: 50,
|
|
|
|
|
required: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
message: 'ms'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'num',
|
|
|
|
|
title: '限流',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
maxlength: 50,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'currentLimiting',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
min: 1,
|
|
|
|
|
row: 24,
|
|
|
|
|
max: 1000,
|
|
|
|
|
required: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
message: 'TPS'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],//步骤2表
|
|
|
|
|
stepOneForm: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
requestCoding: '1',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
timeoutPeriod: 10000,
|
|
|
|
|
currentLimiting: 100,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
requestMethod: '1'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //步骤2表(数据)
|
|
|
|
|
stepThreeRadio: 1, //没用了(穿透配置)
|
|
|
|
|
stepThreeRadioOptions: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'query透传',
|
|
|
|
|
id: 1
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '包装data透传',
|
|
|
|
|
id: 2
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],//没用了(穿透配置)
|
|
|
|
|
funData: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'addattr',
|
|
|
|
|
text: '添加属性',
|
|
|
|
|
color: '#5a9cf8'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'dele',
|
|
|
|
|
text: '删除',
|
|
|
|
|
color: '#e47470'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],//表单操作属性
|
|
|
|
|
queryTableInfo: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'queryIn',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
tableData: [],
|
|
|
|
|
detailFields: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '参数名称',
|
|
|
|
|
id: 'parameterName',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
width: 250,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
maxlength: 50
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '参数类型',
|
|
|
|
|
id: 'parameterType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '具体类型',
|
|
|
|
|
id: 'concreteType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'switch',
|
|
|
|
|
title: '必选',
|
|
|
|
|
id: 'required',
|
|
|
|
|
width: 80
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '长度',
|
|
|
|
|
id: 'length',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
width: 100,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
maxlength: 50
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '示例',
|
|
|
|
|
id: 'example',
|
|
|
|
|
maxlength: 50
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '描述',
|
|
|
|
|
id: 'description',
|
2024-05-14 10:08:39 +08:00
|
|
|
|
maxlength: 50
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '文档顺序',
|
|
|
|
|
id: 'sorts',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
width: 100,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
maxlength: 50
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //query表单信息
|
|
|
|
|
bodyEntTableInfo: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'bodyIn',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
tableData: [
|
|
|
|
|
{
|
|
|
|
|
id: uuidv4(),
|
2024-05-07 08:52:54 +08:00
|
|
|
|
parameterName: 'body',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
first: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
detailFields: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '参数名称',
|
|
|
|
|
id: 'parameterName',
|
|
|
|
|
width: 250
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '参数类型',
|
|
|
|
|
id: 'parameterType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '具体类型',
|
|
|
|
|
id: 'concreteType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'switch',
|
|
|
|
|
title: '必选',
|
|
|
|
|
id: 'required',
|
|
|
|
|
width: 80
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '长度',
|
|
|
|
|
id: 'length',
|
|
|
|
|
width: 100
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '示例',
|
|
|
|
|
id: 'example'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '描述',
|
2024-05-14 10:08:39 +08:00
|
|
|
|
id: 'description'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '文档顺序',
|
|
|
|
|
id: 'sorts',
|
|
|
|
|
width: 100
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //body入参
|
|
|
|
|
bodyExitTableInfo: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'bodyOut',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
tableData: [],
|
|
|
|
|
detailFields: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '参数名称',
|
|
|
|
|
id: 'parameterName',
|
|
|
|
|
width: 250
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '参数类型',
|
|
|
|
|
id: 'parameterType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '具体类型',
|
|
|
|
|
id: 'concreteType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'switch',
|
|
|
|
|
title: '必选',
|
|
|
|
|
id: 'required',
|
|
|
|
|
width: 80
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '长度',
|
|
|
|
|
id: 'length',
|
|
|
|
|
width: 100
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '示例',
|
|
|
|
|
id: 'example'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '描述',
|
2024-05-14 10:08:39 +08:00
|
|
|
|
id: 'description'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '文档顺序',
|
|
|
|
|
id: 'sorts',
|
|
|
|
|
width: 100
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //body出参
|
|
|
|
|
headersTableInfo: {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
id: 'headerIn',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
tableData: [],
|
|
|
|
|
detailFields: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '参数名称',
|
|
|
|
|
id: 'parameterName',
|
|
|
|
|
width: 250
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '参数类型',
|
|
|
|
|
id: 'parameterType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
title: '具体类型',
|
|
|
|
|
id: 'concreteType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'switch',
|
|
|
|
|
title: '必选',
|
|
|
|
|
id: 'required',
|
|
|
|
|
width: 80
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '长度',
|
|
|
|
|
id: 'length',
|
|
|
|
|
width: 100
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '示例',
|
|
|
|
|
id: 'example'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '描述',
|
2024-05-14 10:08:39 +08:00
|
|
|
|
id: 'description'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
title: '文档顺序',
|
|
|
|
|
id: 'sorts',
|
|
|
|
|
width: 100
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, //头部
|
|
|
|
|
parameterTypeOptions: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本列表',
|
|
|
|
|
id: 'fundamentallist'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
headerparameterTypeOptions: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
], //头部options配置
|
|
|
|
|
concreteTypeOptions: {
|
|
|
|
|
fundamental: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'String',
|
|
|
|
|
id: 'String'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Int',
|
|
|
|
|
id: 'Number'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Long',
|
|
|
|
|
id: 'Long'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Float',
|
|
|
|
|
id: 'Float'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Double',
|
|
|
|
|
id: 'Double'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Boolean',
|
|
|
|
|
id: 'Boolean'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
complex: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Object',
|
|
|
|
|
id: 'Object'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Map',
|
|
|
|
|
id: 'Map'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
fundamentallist: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'String',
|
|
|
|
|
id: 'String'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Int',
|
|
|
|
|
id: 'Number'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Long',
|
|
|
|
|
id: 'Long'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Float',
|
|
|
|
|
id: 'Float'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Double',
|
|
|
|
|
id: 'Double'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Boolean',
|
|
|
|
|
id: 'Boolean'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
complexlist: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Object',
|
|
|
|
|
id: 'ObjectCom'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
authport: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'String',
|
|
|
|
|
id: 'String'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Int',
|
|
|
|
|
id: 'Int'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Long',
|
|
|
|
|
id: 'Long'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Float',
|
|
|
|
|
id: 'Float'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Double',
|
|
|
|
|
id: 'Double'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: 'Boolean',
|
|
|
|
|
id: 'Boolean'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
bodyOutOptions: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本列表',
|
|
|
|
|
id: 'fundamentallist'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
], //出参options配置
|
|
|
|
|
importData: [],
|
|
|
|
|
importFlag: true,
|
|
|
|
|
activeIndex: '1',//选项卡序号
|
|
|
|
|
bodyOptions: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
2024-05-14 10:08:39 +08:00
|
|
|
|
bodyImport: false,//导入JSON是否为body
|
|
|
|
|
returnedForm: {},//返回值
|
|
|
|
|
returnedFormRow: [
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
2024-05-10 15:33:45 +08:00
|
|
|
|
{
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '返回成功字段',
|
|
|
|
|
maxlength: 200,
|
|
|
|
|
id: 'returnSuccessField',
|
|
|
|
|
row: 24,
|
|
|
|
|
required: true
|
2024-05-10 15:33:45 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
2024-05-14 10:08:39 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
2024-05-10 15:33:45 +08:00
|
|
|
|
{
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '返回成功值',
|
|
|
|
|
maxlength: 200,
|
|
|
|
|
id: 'returnSuccessValue',
|
|
|
|
|
row: 24,
|
|
|
|
|
required: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
elCol: [
|
2024-05-10 15:33:45 +08:00
|
|
|
|
{
|
2024-05-14 10:08:39 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '返回描述字段',
|
|
|
|
|
maxlength: 200,
|
|
|
|
|
id: 'returnMsg',
|
|
|
|
|
row: 24,
|
|
|
|
|
required: true
|
|
|
|
|
}
|
2024-05-10 15:33:45 +08:00
|
|
|
|
]
|
|
|
|
|
}
|
2024-05-14 10:08:39 +08:00
|
|
|
|
]//
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 选项卡点击事件
|
|
|
|
|
handleSelect(key, keyPath) {
|
|
|
|
|
this.activeIndex = key
|
|
|
|
|
},
|
|
|
|
|
onChangeRadio(val, index, indexRow, row) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
if (row.id === 'needLogin') {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (val == 1) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.stepZeroformRow[5]['elCol'][0]['show'] = true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.stepZeroformRow[5]['elCol'][0]['show'] = false
|
|
|
|
|
this.stepZeroForm['authenticationPort'] = ''
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
jsonImportSwitch(data, flag, body = false) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.importFlag = flag
|
|
|
|
|
this.importData = data
|
|
|
|
|
this.rightDialog = true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.bodyImport = body
|
|
|
|
|
},
|
|
|
|
|
JSONCommit() {
|
|
|
|
|
this.importLoading = true
|
|
|
|
|
if (this.checkJson()) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
let resultArr = []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// this.importData.push(this.JSONDataHandle(resultObj, this.resultInfo));
|
|
|
|
|
if (!this.JSONDataHandle(resultArr, this.resultInfo, this.importFlag, this.bodyImport)) {
|
|
|
|
|
this[this.importData].tableData = []
|
2024-05-07 08:52:54 +08:00
|
|
|
|
resultArr.forEach((item) => this[this.importData].tableData.push(item))
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.$message({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'success',
|
|
|
|
|
message: '导入成功'
|
|
|
|
|
})
|
|
|
|
|
this.dialoghandleClose()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.importLoading = false
|
|
|
|
|
},
|
|
|
|
|
JSONDataHandle(resultArr, obj, flag = true, bodyImport = false) {
|
|
|
|
|
if (bodyImport) {
|
|
|
|
|
if (obj instanceof Array) {
|
|
|
|
|
let resultObj = {
|
|
|
|
|
id: uuidv4(),
|
|
|
|
|
first: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
parameterName: 'body',
|
|
|
|
|
parameterType: 'complexlist',
|
|
|
|
|
concreteType: 'ObjectCom',
|
|
|
|
|
children: []
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
resultArr.push(resultObj)
|
|
|
|
|
this.JSONDataHandle(resultArr[0].children, obj[0])
|
|
|
|
|
} else {
|
|
|
|
|
let resultObj = {
|
|
|
|
|
id: uuidv4(),
|
|
|
|
|
first: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
parameterName: 'body',
|
|
|
|
|
parameterType: 'complex',
|
|
|
|
|
concreteType: 'Object',
|
|
|
|
|
children: []
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
resultArr.push(resultObj)
|
|
|
|
|
this.JSONDataHandle(resultArr[0].children, obj)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return Object.keys(obj).some((item) => {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
let resultObj = {}
|
|
|
|
|
if (typeof obj[item] == 'object' && obj[item] != null) {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (!flag) {
|
|
|
|
|
this.$message({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'error',
|
|
|
|
|
message: 'Heardes不支持导入object类型'
|
|
|
|
|
})
|
|
|
|
|
return true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (obj[item] instanceof Array) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
if (typeof obj[item][0] === 'object' && obj[item][0] != null) {
|
|
|
|
|
resultObj['parameterType'] = 'complexlist'
|
|
|
|
|
resultObj['concreteType'] = 'ObjectCom'
|
|
|
|
|
resultObj['parameterName'] = item
|
|
|
|
|
resultObj['id'] = uuidv4()
|
|
|
|
|
resultObj['children'] = []
|
|
|
|
|
let tempArr = resultObj['children']
|
|
|
|
|
resultArr.push(resultObj)
|
|
|
|
|
this.JSONDataHandle(tempArr, obj[item][0])
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
resultObj['parameterType'] = 'fundamentallist'
|
|
|
|
|
resultObj['concreteType'] = 'String'
|
|
|
|
|
resultObj['example'] = obj[item][0]
|
|
|
|
|
resultObj['parameterName'] = item
|
|
|
|
|
resultObj['id'] = uuidv4()
|
|
|
|
|
let tempArr = resultObj['children']
|
|
|
|
|
resultArr.push(resultObj)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
resultObj['concreteType'] = 'Object'
|
|
|
|
|
resultObj['parameterName'] = item
|
|
|
|
|
resultObj['parameterType'] = 'complex'
|
|
|
|
|
resultObj['id'] = uuidv4()
|
|
|
|
|
resultObj['children'] = []
|
|
|
|
|
let tempArr = resultObj['children']
|
|
|
|
|
resultArr.push(resultObj)
|
|
|
|
|
this.JSONDataHandle(tempArr, obj[item])
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
let type = Object.prototype.toString.call(obj[item]).slice(8, -1)
|
|
|
|
|
let concreteType
|
|
|
|
|
if (type != 'Null') {
|
|
|
|
|
concreteType = type
|
|
|
|
|
resultObj['example'] = obj[item] !== '' ? obj[item].toString() : ''
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
concreteType = 'String'
|
|
|
|
|
resultObj['example'] = null
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
resultObj['concreteType'] = concreteType
|
|
|
|
|
resultObj['parameterName'] = item
|
|
|
|
|
resultObj['parameterType'] = 'fundamental'
|
|
|
|
|
resultObj['id'] = uuidv4()
|
|
|
|
|
resultArr.push(resultObj)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
dialoghandleClose() {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.rightDialog = false
|
|
|
|
|
this.resultInfo = {}
|
|
|
|
|
this.importFlag = false
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 父下拉框改变处理
|
|
|
|
|
fatherSelectChangeHandle(row) {
|
|
|
|
|
if (row[0].concreteType) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
row[0].concreteType = ''
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (row[0] && row[0].children) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$delete(row[0], 'children')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (row[0].example) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
row[0].example = ''
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 子下拉框改变处理
|
|
|
|
|
sonSelectChangeHandle(val, row) {
|
|
|
|
|
if (
|
2024-05-14 10:08:39 +08:00
|
|
|
|
val != 'Object' &&
|
|
|
|
|
val != 'ObjectCom' &&
|
|
|
|
|
val != 'Map' &&
|
|
|
|
|
row[0].children
|
2024-03-26 11:18:19 +08:00
|
|
|
|
) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$delete(row[0], 'children')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (row[0].example) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
row[0].example = ''
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async APITestHandle() {
|
|
|
|
|
},
|
|
|
|
|
// 当为编辑模式时拿数据
|
|
|
|
|
async getEditInfo() {
|
|
|
|
|
console.log(this.$route.query.apiId, 'id')
|
|
|
|
|
const res = await getApiModuleApi(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
{
|
|
|
|
|
tl: 'sysApplicationService',
|
|
|
|
|
as: 'application',
|
|
|
|
|
dj: 'getAppApi'
|
|
|
|
|
},
|
|
|
|
|
{ id: this.$route.query.apiId }
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (res.status == 200) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
let obj0 = {}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.stepZeroformRow.push({
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
title: '接口编码',
|
|
|
|
|
id: 'apiCode',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
required: false,
|
|
|
|
|
editDisable: true,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
disabled: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
obj0['apiName'] = res.attribute.apiName
|
|
|
|
|
obj0['catalogueId'] = res.attribute.catalogueId
|
|
|
|
|
obj0['catalogueName'] = res.attribute.catalogueName
|
|
|
|
|
obj0['appName'] = res.attribute.appName
|
|
|
|
|
obj0['apiRemark'] = res.attribute.apiRemark
|
|
|
|
|
obj0['appId'] = res.attribute.appId
|
|
|
|
|
obj0['needLogin'] = res.attribute.needLogin
|
|
|
|
|
obj0['apiCode'] = res.attribute.apiCode
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (res.attribute.needLogin == 2) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.stepZeroformRow[5]['elCol'][0]['show'] = false
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.stepZeroformRow[5]['elCol'][0]['show'] = true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
// this.stepZeroformRow[6]["elCol"][0]["show"] = false;
|
2024-05-07 08:52:54 +08:00
|
|
|
|
obj0['authenticationPort'] = res.attribute.authenticationPort
|
|
|
|
|
let obj1 = {}
|
|
|
|
|
obj1['destinationAddress'] = res.attribute.destinationAddress
|
|
|
|
|
obj1['requestCoding'] = res.attribute.requestCoding
|
|
|
|
|
obj1['requestMethod'] = res.attribute.requestMethod
|
|
|
|
|
obj1['timeoutPeriod'] = res.attribute.timeoutPeriod
|
|
|
|
|
obj1['currentLimiting'] = res.attribute.currentLimiting
|
|
|
|
|
this.stepZeroForm = obj0
|
|
|
|
|
this.stepOneForm = obj1
|
2024-05-14 10:08:39 +08:00
|
|
|
|
this.$set(this.returnedForm, 'returnSuccessField', res.attribute.returnSuccessField)
|
|
|
|
|
this.$set(this.returnedForm, 'returnSuccessValue', res.attribute.returnSuccessValue)
|
|
|
|
|
this.$set(this.returnedForm, 'returnMsg', res.attribute.returnMsg)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (JSON.parse(res.attribute.queryIn) instanceof Array) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.queryTableInfo.tableData = JSON.parse(res.attribute.queryIn)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (JSON.parse(res.attribute.bodyIn) instanceof Array) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.bodyEntTableInfo.tableData = JSON.parse(res.attribute.bodyIn)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (JSON.parse(res.attribute.bodyOut) instanceof Array) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.bodyExitTableInfo.tableData = JSON.parse(res.attribute.bodyOut)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (JSON.parse(res.attribute.headerIn) instanceof Array) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.headersTableInfo.tableData = JSON.parse(res.attribute.headerIn)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async initRequestCoding() {
|
|
|
|
|
const res = await getApiModuleApi(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
{
|
|
|
|
|
tl: 'generalServiceImpl',
|
|
|
|
|
as: 'dictionaryshop',
|
|
|
|
|
dj: 'selectDictionaryshop'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
tab_name: 'sys_app_api',
|
|
|
|
|
column_name: 'request_coding'
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (res.status == 200) {
|
|
|
|
|
res.attribute.forEach((item) => {
|
|
|
|
|
this.stepOneformRow[1].elCol[0].options.push({
|
|
|
|
|
id: item.column_value,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: item.column_content
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async initRequestMethod() {
|
|
|
|
|
const res = await getApiModuleApi(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
{
|
|
|
|
|
tl: 'generalServiceImpl',
|
|
|
|
|
as: 'dictionaryshop',
|
|
|
|
|
dj: 'selectDictionaryshop'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
tab_name: 'sys_app_api',
|
|
|
|
|
column_name: 'request_method'
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (res.status == 200) {
|
|
|
|
|
res.attribute.forEach((item) => {
|
|
|
|
|
this.stepOneformRow[2].elCol[0].options.push({
|
|
|
|
|
id: item.column_value,
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: item.column_content
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 点击提交数据处理
|
|
|
|
|
async commit() {
|
|
|
|
|
// this.commitLoading = true;
|
2024-05-14 10:08:39 +08:00
|
|
|
|
if (!this.returnedForm.returnSuccessField) {
|
|
|
|
|
this.$vmNews('请输入返回成功字段')
|
|
|
|
|
this.activeIndex = '6'
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!this.returnedForm.returnSuccessValue) {
|
|
|
|
|
this.$vmNews('请输入返回成功值')
|
|
|
|
|
this.activeIndex = 6
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!this.returnedForm.returnMsg) {
|
|
|
|
|
this.$vmNews('请输入返回成功值')
|
|
|
|
|
this.activeIndex = 6
|
|
|
|
|
return
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
let obj = {
|
|
|
|
|
apiStatus: 1,
|
|
|
|
|
appId: this.$route.query.id,
|
|
|
|
|
catalogueId: this.$route.query.catalogueId,
|
|
|
|
|
...this.stepZeroForm,
|
2024-05-14 10:08:39 +08:00
|
|
|
|
...this.stepOneForm,
|
|
|
|
|
...this.returnedForm
|
2024-05-07 08:52:54 +08:00
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
console.log(this.$route.query, 'query')
|
2024-05-07 08:52:54 +08:00
|
|
|
|
obj[this.queryTableInfo.id] = this.queryTableInfo.tableData
|
|
|
|
|
obj[this.bodyEntTableInfo.id] = this.bodyEntTableInfo.tableData
|
|
|
|
|
obj[this.bodyExitTableInfo.id] = this.bodyExitTableInfo.tableData
|
|
|
|
|
obj[this.headersTableInfo.id] = this.headersTableInfo.tableData
|
|
|
|
|
obj['bodyInType'] = 1
|
|
|
|
|
obj['parameterPassingMode'] = 1
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (this.$route.query.add) {
|
|
|
|
|
console.log(obj)
|
|
|
|
|
const res = await getApiModuleApi(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
{
|
|
|
|
|
tl: 'sysApplicationService',
|
|
|
|
|
as: 'application',
|
|
|
|
|
dj: 'saveApi'
|
|
|
|
|
},
|
|
|
|
|
obj
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (res.status == 200) {
|
|
|
|
|
this.$message({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
message: '保存接口成功!',
|
|
|
|
|
type: 'success'
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.$router.back()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
obj['id'] = this.$route.query.apiId
|
2024-03-26 11:18:19 +08:00
|
|
|
|
const res = await getApiModuleApi(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
{
|
|
|
|
|
tl: 'sysApplicationService',
|
|
|
|
|
as: 'application',
|
|
|
|
|
dj: 'updateApi'
|
|
|
|
|
},
|
|
|
|
|
obj
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (res.status == 200) {
|
|
|
|
|
this.$message({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
message: '编辑接口成功!',
|
|
|
|
|
type: 'success'
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.$router.back()
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.commitLoading = false
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 添加行
|
|
|
|
|
addTableData(tabledata, flag = false) {
|
|
|
|
|
if (flag && tabledata.length) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$vmNews('body入参只允许添加一行属性', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
if (flag) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
tabledata.push({ id: uuidv4(), first: true, parameterName: 'body' })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
tabledata.push({ id: uuidv4() })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 删除行辅助函数(递归)
|
|
|
|
|
idWatch(arr, id) {
|
|
|
|
|
arr.some((item, index) => {
|
|
|
|
|
if (item.id === id) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
arr.splice(index, 1)
|
|
|
|
|
return true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else if (item.children && item.children.length) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.idWatch(item.children, id)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
return false
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 表格操作按钮
|
|
|
|
|
tableButtonHandle(row, item, data) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
if (item.type === 'dele') {
|
|
|
|
|
this.$confirm('确认删除?')
|
2024-05-14 10:08:39 +08:00
|
|
|
|
.then(() => {
|
|
|
|
|
this.idWatch(data, row.id)
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
})
|
2024-05-07 08:52:54 +08:00
|
|
|
|
} else if (item.type === 'addattr') {
|
|
|
|
|
console.log(row)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (
|
2024-05-14 10:08:39 +08:00
|
|
|
|
row.concreteType != 'Object' &&
|
|
|
|
|
row.concreteType != 'Map' &&
|
|
|
|
|
row.concreteType != 'ObjectCom'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
) {
|
|
|
|
|
this.$notify({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
title: '添加失败',
|
|
|
|
|
message: '具体类型为Object或Map时才能生成子集!',
|
|
|
|
|
type: 'error'
|
|
|
|
|
})
|
|
|
|
|
return
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else if (!row.children) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$set(row, 'children', [])
|
|
|
|
|
row.children.push({ id: uuidv4() })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
row.children.push({ id: uuidv4() })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
this.$notify({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
title: '添加成功',
|
|
|
|
|
message: '添加成功!',
|
|
|
|
|
type: 'success'
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 添加行
|
|
|
|
|
queryTableAddHandle(tableInfo) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
tableInfo.tableData.push({})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
queryTableDeleHandle() {
|
|
|
|
|
},
|
|
|
|
|
// 点击取消
|
|
|
|
|
backActiveHandle() {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.active--
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 点击下一步
|
|
|
|
|
nextActiveHanlde() {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
if (this.active + 1 > 2) return
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (this.active == 0) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$refs.stepZeroform.submitForm()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else if (this.active == 1) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$refs.stepOneform.submitForm()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 点击取消
|
|
|
|
|
backPageHandle() {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.$router.back()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// 点击下一步
|
|
|
|
|
onSubmitHandle(form) {
|
|
|
|
|
if (this.active == 0) {
|
|
|
|
|
if (this.stepZeroForm.needLogin == 1) {
|
|
|
|
|
// 如果需要认证点击下一步
|
|
|
|
|
// 请求认证接口拿到bodyOut
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.getAuthInfo(this.stepZeroForm.authenticationPort)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 更改select选项
|
|
|
|
|
this.headerparameterTypeOptions = [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '认证类型',
|
|
|
|
|
id: 'authport'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.parameterTypeOptions = [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本列表',
|
|
|
|
|
id: 'fundamentallist'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '认证类型',
|
|
|
|
|
id: 'authport'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.bodyOptions = [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
// 如果不是认证点击下一步
|
|
|
|
|
this.headerparameterTypeOptions = [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.parameterTypeOptions = [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本类型',
|
|
|
|
|
id: 'fundamental'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '基本列表',
|
|
|
|
|
id: 'fundamentallist'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.bodyOptions = [
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂类型',
|
|
|
|
|
id: 'complex'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-07 08:52:54 +08:00
|
|
|
|
label: '复杂列表',
|
|
|
|
|
id: 'complexlist'
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 清空表格内带有认证的select
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.clearTableData()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$notify({
|
2024-05-07 08:52:54 +08:00
|
|
|
|
title: '成功',
|
|
|
|
|
message: '暂存成功!',
|
|
|
|
|
type: 'success'
|
|
|
|
|
})
|
|
|
|
|
this.active++
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
clearTableData() {
|
|
|
|
|
this.queryTableInfo.tableData = this.queryTableInfo.tableData.filter(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
(item) => {
|
|
|
|
|
return item.parameterType != 'authport'
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.bodyEntTableInfo.tableData = this.bodyEntTableInfo.tableData.filter(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
(item) => {
|
|
|
|
|
return item.parameterType != 'authport'
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.bodyExitTableInfo.tableData =
|
2024-05-14 10:08:39 +08:00
|
|
|
|
this.bodyExitTableInfo.tableData.filter((item) => {
|
|
|
|
|
return item.parameterType != 'authport'
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.headersTableInfo.tableData = this.headersTableInfo.tableData.filter(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
(item) => {
|
|
|
|
|
return item.parameterType != 'authport'
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
//点击下一步如果有认证接口则请求
|
|
|
|
|
async getAuthInfo(id) {
|
|
|
|
|
const res = await getApiModuleApi(
|
2024-05-14 10:08:39 +08:00
|
|
|
|
{
|
|
|
|
|
tl: 'sysApplicationService',
|
|
|
|
|
as: 'application',
|
|
|
|
|
dj: 'getAppApi'
|
|
|
|
|
},
|
|
|
|
|
{ id }
|
2024-05-07 08:52:54 +08:00
|
|
|
|
)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
console.log(res)
|
|
|
|
|
if (res.status == 200) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.authQueryOut = JSON.parse(res.attribute.bodyOut)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 实时保存
|
|
|
|
|
onJsonChange(value) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.onJsonSave(value)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// json相关
|
|
|
|
|
onJsonSave(value) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.resultInfo = value
|
|
|
|
|
this.hasJsonFlag = true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// json相关(不用管)
|
|
|
|
|
onError(value) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.hasJsonFlag = false
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
// json相关(不用管)
|
|
|
|
|
checkJson() {
|
|
|
|
|
if (this.hasJsonFlag === false) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
alert('json验证失败')
|
|
|
|
|
return false
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
return true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
baseNewForm,
|
|
|
|
|
baseTableForm,
|
|
|
|
|
baseRightDialog,
|
|
|
|
|
vueJsonEditor,
|
|
|
|
|
baseCascader,
|
|
|
|
|
apiDebugging
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
funWidth() {
|
2024-05-14 10:08:39 +08:00
|
|
|
|
return this.funData.length * 90
|
2024-05-07 08:52:54 +08:00
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
mounted() {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.initRequestCoding()
|
|
|
|
|
this.initRequestMethod()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (!this.$route.query.add) {
|
2024-05-07 08:52:54 +08:00
|
|
|
|
this.getEditInfo()
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.$set(this.stepZeroForm, 'appId', this.$route.query.id)
|
|
|
|
|
this.$set(this.stepZeroForm, 'appName', this.$route.query.name)
|
|
|
|
|
this.$set(this.stepZeroForm, 'catalogueId', this.$route.query.catalogueId)
|
|
|
|
|
this.$set(this.stepZeroForm, 'catalogueName', this.$route.query.catalogueName)
|
|
|
|
|
}
|
2024-05-07 08:52:54 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
2024-05-07 08:52:54 +08:00
|
|
|
|
<style scoped lang="scss">
|
2024-03-26 11:18:19 +08:00
|
|
|
|
::v-deep .el-button {
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.wrap {
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: scroll;
|
|
|
|
|
|
|
|
|
|
.step {
|
|
|
|
|
margin: 10px;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.step3 {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.formdata {
|
|
|
|
|
padding: 30px 10px;
|
|
|
|
|
margin: 10px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
width: 50vw;
|
|
|
|
|
margin: 10px auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.nextbtn {
|
|
|
|
|
padding: 30 10px;
|
|
|
|
|
margin: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.method {
|
|
|
|
|
margin: 10px;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
padding: 30px 10px;
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tableBox {
|
|
|
|
|
margin: 10px;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
padding: 30px 10px;
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.add {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
border: 1px dotted #ccc;
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|