Commit bb8c9529 by 无尘

feat: 增加接口

parent 20b65443
<!--
<api-version-show></api-version-show>
import apiVersionShow from '@/components/api/api-version-show.vue';
-->
<template>
<div class="api-version-content border-box">
<div class="api-version-body">
<div class="operate-btns">
<el-button type="primary" plain>发布</el-button>
<el-button type="primary" plain>删除</el-button>
<el-button type="primary" plain>回退</el-button>
<el-button type="primary" plain>回滚</el-button>
</div>
<div class="anchor-wrap">
<div class="el-tabs el-tabs--right">
<div class="el-tabs__header is-right">
<div class="el-tabs__nav-wrap is-right">
<div class="el-tabs__nav-scroll">
<div role="tablist" class="el-tabs__nav is-right" style="transform: translateY(0px);">
<div class="el-tabs__active-bar is-right" :style="{ transform: `translateY(${activeInfo * 24}px)`, height: '24px' }"></div>
<div id="tab-0" :class="['el-tabs__item h-24 is-right', activeInfo == 0 ? 'is-active' : '']" @click="goAuthor('#base', 0)">基础配置</div>
<div id="tab-1" :class="['el-tabs__item h-24 is-right', activeInfo == 1 ? 'is-active' : '']" @click="goAuthor('#frontend', 1)">前端配置</div>
<div id="tab-2" :class="['el-tabs__item h-24 is-right', activeInfo == 2 ? 'is-active' : '']" @click="goAuthor('#backend', 2)">后端配置</div>
<div id="tab-3" :class="['el-tabs__item h-24 is-right', activeInfo == 3 ? 'is-active' : '']" @click="goAuthor('#result', 3)">返回结果</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="base-info-wrap info-wrap" id="base">
<div class="commont-info-title">基础信息</div>
</div>
<div class="frontend-set-wrap info-wrap" id="frontend">
<div class="commont-info-title">前端配置</div>
</div>
<div class="backend-set-wrap info-wrap" id="backend">
<div class="commont-info-title">后端配置</div>
</div>
<div class="back-result-wrap info-wrap" id="result">
<div class="commont-info-title">返回结果</div>
</div>
</div>
</div>
</template>
<script>
import { getRequest } from '@/api/api';
// import { _debounce } from '@/assets/js/public';
// import showMsg from '@/assets/js/showmsg';
import errMsg from '@/assets/js/error';
export default {
name: 'api-version-show',
components: {},
data() {
return {
apiData: {
interfaceId: 'nisi exercitation ipsum et dolore',
interfaceName: 'deserunt Duis commodo velit et',
interfaceGroupId: 'ut ea',
interfaceUrl: 'ex laborum Excepteur aliquip labore',
interfaceDescribe: 'incididu',
projectId: 'irure ',
optType: 'exercitation',
sucReturn: 'ex Excepteur',
errReturn: 'culpa nisi magna consequat velit',
errCode: 'nostrud proident ',
frontParams: 'id labore',
endParams: 'deserunt Ut',
target: 78473123.86374778,
requestType: 'nos',
protocol: 'Duis',
version: 'elit',
interfaceType: -46539935,
dubboMethod: 'in ess',
dubboInterface: 'ad',
httpPath: 'commodo minim ex sunt',
proxyCode: 'amet proident fugiat anim commodo',
resultParams: 'veniam dolore Ut',
backendRequestType: 'est laborum cillum commodo mini',
timeout: 43087112
},
activeInfo: 0
};
},
methods: {
/**
* 跳转到 author
*/
goAuthor(selector, index) {
const that = this;
that.activeInfo = index;
that.$el.querySelector(selector).scrollIntoView();
},
/**
* 获取数据
*/
getData() {
const that = this;
let para = {
search: that.searchValue,
pageNum: that.currentPage,
pageSize: that.pageSize,
sceneCode: that.sceneCode,
interfaceId: that.$route.query.interfaceId
};
getRequest('/gateway-manage/page-proxy', para)
.then(res => {
let resData = res.data;
if (resData.code == 1) {
that.tableData = resData.result.result || [];
that.totalCount = resData.result.totalCount;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
init() {
const that = this;
console.log(1);
document.getElementsByClassName('api-body-content')[0].addEventListener('scroll', that.scroll); //启动监听页面滚动事件
},
scroll() {
const that = this;
let scrollTop = document.querySelectorAll('.api-body-content')[0].scrollTop;
// console.log(scrollTop);
let itemIds = document.querySelectorAll('.info-wrap');
itemIds.forEach((item, index) => {
if (scrollTop >= item.offsetTop) {
that.activeInfo = index;
}
});
}
},
mounted() {
const that = this;
that.$nextTick(() => {
that.init();
});
},
destroyed() {
document.getElementsByClassName('api-body-content')[0].removeEventListener('scroll', this.scroll); //注销监听页面滚动事件
}
};
</script>
<style lang="less" scoped>
.w-320 {
width: 320px;
}
.m-t-14 {
margin-top: 14px;
}
.api-version-content {
position: relative;
// padding: 26px 28px;
.api-version-body {
position: relative;
width: 100%;
.operate-btns {
position: absolute;
top: 0;
right: 0;
}
.anchor-wrap {
position: fixed;
top: 330px;
right: 30px;
z-index: 2;
.el-tabs__item {
&.h-24 {
width: 150px;
height: 24px;
line-height: 24px;
font-size: 12px;
// color: #606266;
}
}
}
.base-info-wrap {
height: 250px;
}
.frontend-set-wrap {
height: 440px;
}
.backend-set-wrap {
height: 510px;
}
.back-result-wrap {
}
}
}
</style>
<!--
<publish-set
:editRow="editRow"
:publishShow="publishShow"
@hidePublishDialog="hidePublishDialog">
</publish-set>
import publishSet from '@/components/api/publish-set.vue'
-->
<template>
<div v-show="customDialog">
<el-dialog class="edit-dialog" title="发布" :visible.sync="customDialog" width="600px" :before-close="handleClose">
<div class="edit-dialog-body">
<el-form :model="formData" label-width="160px" :rules="rules" ref="publishForm">
<el-form-item label="API名称:">
{{ $route.query.interfaceName }}
</el-form-item>
<el-form-item label="发布环境:">
{{ formData.sceneName }}
</el-form-item>
<el-form-item label="设置为默认版本:">
<el-switch v-model="formData.defaultFlag" active-text="" inactive-text=""> </el-switch>
</el-form-item>
<el-form-item label="备注:">
<limit-textarea :inputWidth="370" :inputValue.sync="formData.remark" :holder="'请输入备注内容'" :getByType="'word'" :maxLength="100"> </limit-textarea>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer" style="padding-bottom: 10px;">
<el-button @click="customCancel">取 消</el-button>
<el-button type="primary" @click="customConfirm('publishForm')">发 布</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import limitTextarea from '@/components/limit-textarea.vue';
import { getRequest } from '@/api/api';
import showMsg from '@/assets/js/showmsg';
import errMsg from '@/assets/js/error';
export default {
name: 'publish-set',
components: {
limitTextarea
},
props: {
publishShow: {
type: Boolean,
default: false
},
editRow: {
type: Object,
default() {
return {
interfaceVersionId: '',
version: '',
status: '', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '',
proxyType: '',
defaultFlag: false,
sceneCode: '',
sceneName: '',
remark: ''
};
}
}
},
data() {
return {
customDialog: false, // 弹框显示
formData: {
interfaceVersionId: '',
version: '',
status: '', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '',
proxyType: '',
defaultFlag: false,
sceneCode: '',
sceneName: '',
remark: ''
},
rules: {}
};
},
methods: {
/**
* 关闭
*/
handleClose(done) {
const that = this;
done();
that.hideDialog();
},
/**
* 取消
*/
customCancel() {
const that = this;
that.hideDialog();
},
hideDialog() {
const that = this;
that.customDialog = false;
that.$emit('hidePublishDialog');
/* that.$nextTick(() => {
that.formData.classifyName = '';
}); */
},
/**
* 确定同步
*/
customConfirm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
that.postEditData();
} else {
return false;
}
});
},
postEditData() {
const that = this;
let para = {
interfaceVersionId: that.formData.interfaceVersionId,
defaultFlag: that.formData.defaultFlag ? '1' : '0',
remark: that.formData.remark
};
getRequest('/gateway-manage/publish-api', para)
.then(res => {
let resData = res.data;
if (resData.code == 1) {
showMsg.showmsg('发布成功', 'success');
that.setData();
return;
}
errMsg.errorInfo(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 提交数据
*/
setData(list) {
const that = this;
that.$emit('hidePublishDialog');
/* that.$nextTick(() => {
that.formData.classifyName = '';
}); */
}
},
watch: {
publishShow: function(newData, oldData) {
const that = this;
that.customDialog = newData;
},
editRow: function(newData, oldData) {
const that = this;
that.formData = JSON.parse(JSON.stringify(newData));
that.formData.defaultFlag = newData.defaultFlag == 1 ? true : false;
}
},
/* 接收数据 */
mounted() {
const that = this;
that.customDialog = that.publishShow;
that.formData = JSON.parse(JSON.stringify(that.editRow));
that.formData.defaultFlag = that.editRow.defaultFlag == 1 ? true : false;
}
};
</script>
<style lang="less" scoped>
.edit-dialog {
/deep/ .el-dialog__body {
padding: 2px 55px 0 34px;
}
/deep/ .el-dialog__footer {
border: none;
padding-top: 3px;
}
&__title {
width: 100%;
height: 38px;
padding: 12px 15px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(235, 238, 245, 1);
}
.el-alert--info {
width: 400px;
font-size: 14px;
color: #606266;
background: #e6f7ff;
border: 1px solid rgba(145, 213, 255, 1);
}
.el-icon-info {
width: 12px;
font-size: 12px;
color: #1890ff;
}
.el-form {
margin-top: 40px;
}
}
</style>
<!--
<record-list
:editRow="editRow"
:recordShow="recordShow"
@hideRecordDialog="hideRecordDialog">
</record-list>
import recordList from '@/components/api/record-list.vue'
-->
<template>
<div v-show="customDialog">
<el-dialog class="edit-dialog" title="发布记录" :visible.sync="customDialog" width="600px" :before-close="handleClose">
<div class="edit-dialog-body">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="publishName" label="发布版本" show-overflow-tooltip> </el-table-column>
<el-table-column label="发布备注" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.describe }}
</template>
</el-table-column>
<el-table-column label="发布时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="color-606266 line-18">{{ scope.row.createTime | timeStampToYmd }}</div>
<div class="color-606266 line-18">{{ scope.row.createTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column label="操作" show-overflow-tooltip>
<template slot-scope="scope">
<el-button @click="handleShow(scope.$index, scope.row)" type="text">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination text-right m-t-14" v-if="!!totalCount">
<el-pagination small :page-size="pageSize" :current-page="currentPage" layout="prev, pager, next" :total="totalCount" @size-change="handleSizeChange" @current-change="handleCurrentChange"> </el-pagination>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { getRequest } from '@/api/api';
import errMsg from '@/assets/js/error';
export default {
name: 'record-list',
props: {
recordShow: {
type: Boolean,
default: false
},
editRow: {
type: Object,
default() {
return {
interfaceVersionId: '',
version: '',
status: '', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '',
proxyType: '',
defaultFlag: false,
sceneCode: '',
sceneName: '',
remark: ''
};
}
}
},
data() {
return {
customDialog: false, // 弹框显示
formData: {
interfaceVersionId: '',
version: '',
status: '', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '',
proxyType: '',
defaultFlag: false,
sceneCode: '',
sceneName: '',
remark: ''
},
rules: {},
tableData: [
{
publishId: '1',
publishName: '测试',
publishVersion: 'V1.0.1',
env: '测试',
describe: '描述内容',
createTime: 1564455643252
}
],
pageSize: 5,
currentPage: 1,
totalCount: 0
};
},
methods: {
/**
* 关闭
*/
handleClose(done) {
const that = this;
done();
that.hideDialog();
},
/**
* 取消
*/
customCancel() {
const that = this;
that.hideDialog();
},
hideDialog() {
const that = this;
that.customDialog = false;
that.$emit('hideRecordDialog');
/* that.$nextTick(() => {
that.formData.classifyName = '';
}); */
},
/**
* 分页
*/
handleSizeChange(val) {
this.pageSize = val;
this.getData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData();
},
/**
* 查看定义详情页
*/
handleShow(index, row) {
const that = this;
that.$router.push('/');
},
/**
* 获取数据
*/
getData() {
const that = this;
let para = {
pageNum: that.currentPage,
pageSize: that.pageSize,
version: that.formData.version,
sceneCode: that.formData.sceneCode,
interfaceId: that.formData.interfaceId
};
getRequest('/gateway-manage/page-api-publish-record', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = resData.result.result || [];
that.totalCount = resData.result.totalCount;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
recordShow: function(newData, oldData) {
const that = this;
that.customDialog = newData;
},
editRow: function(newData, oldData) {
const that = this;
that.formData = JSON.parse(JSON.stringify(newData));
}
},
/* 接收数据 */
mounted() {
const that = this;
that.customDialog = that.publishShow;
that.formData = JSON.parse(JSON.stringify(that.editRow));
}
};
</script>
<style lang="less" scoped>
.edit-dialog {
/deep/ .el-dialog__body {
padding: 25px 20px 17px 20px;
min-height: 352px;
}
/deep/ .el-dialog__footer {
border: none;
padding-top: 3px;
}
&__title {
width: 100%;
height: 38px;
padding: 12px 15px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(235, 238, 245, 1);
}
.el-alert--info {
width: 400px;
font-size: 14px;
color: #606266;
background: #e6f7ff;
border: 1px solid rgba(145, 213, 255, 1);
}
.el-icon-info {
width: 12px;
font-size: 12px;
color: #1890ff;
}
.el-form {
margin-top: 40px;
}
}
</style>
<!--
<sync-set
:editRow="editRow"
:syncShow="syncShow"
@hideSyncDialog="hideSyncDialog">
</sync-set>
import syncSet from '@/components/api/sync-set.vue'
-->
<template>
<div v-show="customDialog">
<el-dialog class="edit-dialog" title="同步" :visible.sync="customDialog" width="424px" :before-close="handleClose">
<div class="edit-dialog-body">
<el-form :model="formData" label-width="110px" :rules="rules" ref="syncForm">
<el-form-item label="API名称:">
{{ $route.query.interfaceName }}
</el-form-item>
<el-form-item label="API版本:">
{{ formData.version }}
</el-form-item>
<el-form-item label="同步至环境:" prop="sceneCode">
<el-select class="w-190" v-model="formData.sceneCode" placeholder="请选择">
<el-option v-for="item in envOptions" :key="item.sceneCode" :label="item.sceneName" :value="item.sceneCode"> </el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer" style="padding-bottom: 10px;">
<el-button @click="customCancel">取 消</el-button>
<el-button type="primary" @click="customConfirm('syncForm')">同 步</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getRequest } from '@/api/api';
import showMsg from '@/assets/js/showmsg';
import errMsg from '@/assets/js/error';
export default {
name: 'sync-set',
props: {
syncShow: {
type: Boolean,
default: false
},
editRow: {
type: Object,
default() {
return {
interfaceVersionId: '',
version: '',
status: '', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '',
proxyType: '',
defaultFlag: false
};
}
}
},
data() {
return {
customDialog: false, // 弹框显示
formData: {
interfaceVersionId: '',
version: '',
status: '', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '',
proxyType: '',
sceneCode: ''
},
rules: {
sceneCode: [{ required: true, message: '请选择环境', trigger: 'change' }]
},
envOptions: [
{
sceneCode: '1',
sceneName: '测试'
},
{
sceneCode: '2',
sceneName: '正式'
}
]
};
},
methods: {
/**
* 关闭
*/
handleClose(done) {
const that = this;
done();
that.hideDialog();
},
/**
* 取消
*/
customCancel() {
const that = this;
that.hideDialog();
},
hideDialog() {
const that = this;
that.customDialog = false;
that.$emit('hideSyncDialog');
/* that.$nextTick(() => {
that.formData.classifyName = '';
}); */
},
/**
* 确定同步
*/
customConfirm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
that.postEditData();
} else {
return false;
}
});
},
postEditData() {
const that = this;
let para = {
interfaceVersionId: that.formData.interfaceVersionId,
sceneCode: that.formData.sceneCode
};
getRequest('/gateway-manage/async-api', para)
.then(res => {
let resData = res.data;
if (resData.code == 1) {
showMsg.showmsg('同步成功', 'success');
that.setData();
return;
}
errMsg.errorInfo(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 提交数据
*/
setData(list) {
const that = this;
that.$emit('hideSyncDialog');
/* that.$nextTick(() => {
that.formData.classifyName = '';
}); */
},
/**
* 获取环境列表
*/
getEnvData() {
const that = this;
getRequest('/gateway-manage/list-all-scene', {})
.then(res => {
let resData = res.data;
if (resData.code == 1) {
that.envOptions = resData.result || [];
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
syncShow: function(newData, oldData) {
const that = this;
that.customDialog = newData;
},
editRow: function(newData, oldData) {
const that = this;
that.formData = JSON.parse(JSON.stringify(newData));
}
},
/* 接收数据 */
mounted() {
const that = this;
that.customDialog = that.syncShow;
that.formData = JSON.parse(JSON.stringify(that.editRow));
}
};
</script>
<style lang="less" scoped>
.w-190 {
width: 190px;
}
.edit-dialog {
/deep/ .el-dialog__body {
padding: 2px 55px 0 34px;
}
/deep/ .el-dialog__footer {
border: none;
padding-top: 3px;
}
&__title {
width: 100%;
height: 38px;
padding: 12px 15px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(235, 238, 245, 1);
}
.el-alert--info {
width: 400px;
font-size: 14px;
color: #606266;
background: #e6f7ff;
border: 1px solid rgba(145, 213, 255, 1);
}
.el-icon-info {
width: 12px;
font-size: 12px;
color: #1890ff;
}
.el-form {
margin-top: 40px;
}
}
</style>
<template> <template>
<div> <div>
<div class="search-wrap m-b-20 flex flex-space-between"> <div class="search-wrap m-b-20 flex flex-space-between">
<el-input clearable class="w-320" placeholder="请输入注册中心地址搜索" v-model="searchValue" @keyup.native="value => searchData(value)" @clear="clearInput"> <el-input clearable class="w-320" placeholder="请输入版本号" v-model="searchValue" @keyup.native="value => searchData(value)" @clear="clearInput">
<i slot="prefix" class="el-input__icon el-icon-search"></i> <i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input> </el-input>
<div class="search-wrap-right"> <div class="search-wrap-right">
<el-radio-group v-model="sceneCode" @change="changeType"> <el-radio-group v-model="sceneCode" @change="changeType">
<el-radio-button :label="item.sceneCode" v-for="(item,index) in envOptions" :key="index">{{item.sceneName}}</el-radio-button> <el-radio-button :label="item.sceneCode" v-for="(item, index) in envOptions" :key="index">{{ item.sceneName }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
...@@ -38,14 +38,14 @@ ...@@ -38,14 +38,14 @@
</el-table-column> </el-table-column>
<el-table-column label="默认版本" show-overflow-tooltip> <el-table-column label="默认版本" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.defaultFlag" active-text="" inactive-text="" @change="changeEnv(scope.row, scope.row.defaultFlag)"> </el-switch> <el-switch v-model="scope.row.defaultFlag" active-text="" inactive-text="" @change="changeVersion(scope.row, scope.row.defaultFlag)"> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" show-overflow-tooltip> <el-table-column label="操作" width="340">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleEdit(scope.$index, scope.row)" type="text">编辑</el-button> <el-button @click="handleEdit(scope.$index, scope.row)" type="text">编辑</el-button>
<el-button @click="handleEdit(scope.$index, scope.row)" type="text">发布</el-button> <el-button @click="handlePublish(scope.$index, scope.row)" type="text">发布</el-button>
<el-button @click="handleEdit(scope.$index, scope.row)" type="text">同步</el-button> <el-button @click="handleSync(scope.$index, scope.row)" type="text">同步</el-button>
<el-button @click="handleShow(scope.$index, scope.row)" type="text">查看</el-button> <el-button @click="handleShow(scope.$index, scope.row)" type="text">查看</el-button>
<el-button @click="handleDown(scope.$index, scope.row)" type="text">下线</el-button> <el-button @click="handleDown(scope.$index, scope.row)" type="text">下线</el-button>
<el-button @click="handleRecord(scope.$index, scope.row)" type="text">发布记录</el-button> <el-button @click="handleRecord(scope.$index, scope.row)" type="text">发布记录</el-button>
...@@ -56,20 +56,31 @@ ...@@ -56,20 +56,31 @@
<el-pagination small :page-size="pageSize" :current-page="currentPage" layout="prev, pager, next" :total="totalCount" @size-change="handleSizeChange" @current-change="handleCurrentChange"> </el-pagination> <el-pagination small :page-size="pageSize" :current-page="currentPage" layout="prev, pager, next" :total="totalCount" @size-change="handleSizeChange" @current-change="handleCurrentChange"> </el-pagination>
</div> </div>
</div> </div>
<sync-set :editRow="editRow" :syncShow="syncShow" @hideSyncDialog="hideSyncDialog"> </sync-set>
<publish-set :editRow="editRow" :publishShow="publishShow" @hidePublishDialog="hidePublishDialog"> </publish-set>
<record-list :editRow="editRow" :recordShow="recordShow" @hideRecordDialog="hideRecordDialog"> </record-list>
</div> </div>
</template> </template>
<script> <script>
import publishSet from '@/components/api/publish-set.vue';
import syncSet from '@/components/api/sync-set.vue';
import recordList from '@/components/api/record-list.vue';
import { getRequest } from '@/api/api'; import { getRequest } from '@/api/api';
import { _debounce } from '@/assets/js/public'; import { _debounce } from '@/assets/js/public';
import showMsg from '@/assets/js/showmsg'; import showMsg from '@/assets/js/showmsg';
import errMsg from '@/assets/js/error'; import errMsg from '@/assets/js/error';
export default { export default {
name: 'env-set-list', name: 'env-set-list',
components: {
publishSet,
syncSet,
recordList
},
data() { data() {
return { return {
searchValue: '', searchValue: '',
sceneCode: '', sceneCode: '',
envOptions:[ envOptions: [
{ {
sceneCode: '1', sceneCode: '1',
sceneName: '测试' sceneName: '测试'
...@@ -83,7 +94,7 @@ export default { ...@@ -83,7 +94,7 @@ export default {
{ {
interfaceVersionId: '1', interfaceVersionId: '1',
version: '测试', version: '测试',
status: '1',// 0 删除 1更新修改 2发布 3 历史发布版本 status: '1', // 0 删除 1更新修改 2发布 3 历史发布版本
description: '234', description: '234',
proxyType: '0', proxyType: '0',
defaultFlag: false, defaultFlag: false,
...@@ -94,11 +105,17 @@ export default { ...@@ -94,11 +105,17 @@ export default {
], ],
pageSize: 20, pageSize: 20,
currentPage: 1, currentPage: 1,
totalCount: 0 totalCount: 0,
// 同步
syncShow: false,
editRow: {},
// 发布
publishShow: false,
// 发布记录
recordShow: false
}; };
}, },
methods: { methods: {
/** /**
* 搜索 * 搜索
*/ */
...@@ -136,13 +153,13 @@ export default { ...@@ -136,13 +153,13 @@ export default {
this.getData(); this.getData();
}, },
/** /**
* 改变默认环境 * 改变默认版本
*/ */
changeEnv(row, val) { changeVersion(row, val) {
const that = this; const that = this;
that.postChangeEnv(row, val); that.postChangeVersion(row, val);
}, },
postChangeEnv(row, val) { postChangeVersion(row, val) {
const that = this; const that = this;
let para = { let para = {
defaultFlag: val ? '1' : '0', defaultFlag: val ? '1' : '0',
...@@ -165,11 +182,50 @@ export default { ...@@ -165,11 +182,50 @@ export default {
}); });
}, },
/** /**
* 发布
*/
handlePublish(index, row) {
const that = this;
that.publishShow = true;
that.editRow = row;
},
hidePublishDialog() {
const that = this;
that.publishShow = false;
that.editRow = {};
},
/**
* 同步
*/
handleSync(index, row) {
const that = this;
that.syncShow = true;
that.editRow = row;
},
hideSyncDialog() {
const that = this;
that.syncShow = false;
that.editRow = {};
},
/**
* 发布记录
*/
handleRecord(index, row) {
const that = this;
that.recordShow = true;
that.editRow = row;
},
hideRecordDialog() {
const that = this;
that.recordShow = false;
that.editRow = {};
},
/**
* 查看 * 查看
*/ */
handleShow(index, row) { handleShow(index, row) {
const that = this; const that = this;
that.$router.push(`/createApi?interfaceId=${that.$route.query.interfaceId}&interfaceVersionId=${row.interfaceVersionId}`); that.$router.push(`/apiListManageShow?interfaceId=${that.$route.query.interfaceId}&interfaceVersionId=${row.interfaceVersionId}`);
}, },
/** /**
* 编辑 * 编辑
...@@ -245,7 +301,7 @@ export default { ...@@ -245,7 +301,7 @@ export default {
search: that.searchValue, search: that.searchValue,
pageNum: that.currentPage, pageNum: that.currentPage,
pageSize: that.pageSize, pageSize: that.pageSize,
sceneCode: taht.sceneCode, sceneCode: that.sceneCode,
interfaceId: that.$route.query.interfaceId interfaceId: that.$route.query.interfaceId
}; };
getRequest('/gateway-manage/page-proxy', para) getRequest('/gateway-manage/page-proxy', para)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="api-tab-wrap"> <div class="api-tab-wrap">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="版本" name="first"> <el-tab-pane label="版本" name="first">
<env-list></env-list> <version-list></version-list>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="发布记录" name="second"> <el-tab-pane label="发布记录" name="second">
<publish-list></publish-list> <publish-list></publish-list>
...@@ -21,12 +21,14 @@ ...@@ -21,12 +21,14 @@
</template> </template>
<script> <script>
import navBread from '@/components/nav/nav-bread.vue'; import navBread from '@/components/nav/nav-bread.vue';
import versionList from '@/components/api/version-list.vue';
import publishList from '@/components/api/publish-list.vue'; import publishList from '@/components/api/publish-list.vue';
import { getRequest } from '@/api/api'; import { getRequest } from '@/api/api';
export default { export default {
name: 'apiListManage', name: 'apiListManage',
components: { components: {
navBread, navBread,
versionList,
publishList publishList
}, },
data() { data() {
......
...@@ -3,18 +3,22 @@ ...@@ -3,18 +3,22 @@
<div class="common-nav"> <div class="common-nav">
<nav-bread :navPath="navPath"></nav-bread> <nav-bread :navPath="navPath"></nav-bread>
</div> </div>
<div class="api-body-main common-body-main border-box"> <div class="api-body-main common-body-main border-box" style="height: auto;">
<div class="api-main-content border-box"></div> <div class="api-main-content border-box">
<api-version-show></api-version-show>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import navBread from '@/components/nav/nav-bread.vue'; import navBread from '@/components/nav/nav-bread.vue';
import apiVersionShow from '@/components/api/api-version-show.vue';
import { getRequest } from '@/api/api'; import { getRequest } from '@/api/api';
export default { export default {
name: 'apiListManageShow', name: 'apiListManageShow',
components: { components: {
navBread navBread,
apiVersionShow
}, },
data() { data() {
return { return {
......
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