Commit 8a44edfe by 无尘

fix: 修改状态

parent c6c27d4b
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.5a4cd84152312ce5489a6fb91ca97a85.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.3780ed7e042056c2d443.js></script><script type=text/javascript src=./static/js/vendor.bb8c036d7dd62f4cb37a.js></script><script type=text/javascript src=./static/js/app.f1acc3ac0ff23ced6285.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.44f787ae8267768efac75395f49048c4.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.a97a671a0bd49ff1e018.js></script><script type=text/javascript src=./static/js/vendor.bb8c036d7dd62f4cb37a.js></script><script type=text/javascript src=./static/js/app.f1acc3ac0ff23ced6285.js></script></body></html>
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,c){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,c);b.length;)b.shift()();if(c)for(u=0;u<c.length;u++)i=a(a.s=c[u]);return i};var r={},t={21:0};function a(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,a){n=t[e]=[r,a]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+e+"."+{0:"d2aeaa955782b02febee",1:"0ebe3ead93207dc78a78",2:"f09e7d5f6b37c942b313",3:"714b444533170c97afe0",4:"09723260590e778dfe62",5:"8dade12caa32853912f4",6:"7e47fc9750107d0d7600",7:"6c3d409359dc37c88d9a",8:"6f4aba6d804414b554f1",9:"1a44376fa612d3e18d19",10:"638039a7b39908980436",11:"65b3d46525bbb966f996",12:"cb37adc4b9f63c81ace0",13:"3f70345d9260ae04ca59",14:"9825bb69e60b8030c230",15:"2d238e050fe99b74287d",16:"71781076180fa67766a9",17:"3d53e5aa355f2b62e040",18:"da9b2eee0a0620668dc6"}[e]+".js";var f=setTimeout(d,12e4);function d(){c.onerror=c.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=d,o.appendChild(c),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="./",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,c){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,c);b.length;)b.shift()();if(c)for(u=0;u<c.length;u++)i=a(a.s=c[u]);return i};var r={},t={21:0};function a(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,a){n=t[e]=[r,a]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+e+"."+{0:"d2aeaa955782b02febee",1:"0ebe3ead93207dc78a78",2:"3fb6634d557a9813d379",3:"8e100d29247c28c8b5c4",4:"e147fece7b5af9883b95",5:"8dade12caa32853912f4",6:"7e47fc9750107d0d7600",7:"6c3d409359dc37c88d9a",8:"6f4aba6d804414b554f1",9:"1a44376fa612d3e18d19",10:"638039a7b39908980436",11:"65b3d46525bbb966f996",12:"cb37adc4b9f63c81ace0",13:"3f70345d9260ae04ca59",14:"9825bb69e60b8030c230",15:"2d238e050fe99b74287d",16:"71781076180fa67766a9",17:"3d53e5aa355f2b62e040",18:"da9b2eee0a0620668dc6"}[e]+".js";var f=setTimeout(d,12e4);function d(){c.onerror=c.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=d,o.appendChild(c),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="./",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -7,10 +7,10 @@ import apiVersionShow from '@/components/api/api-version-show.vue';
<div class="api-version-content border-box">
<div class="api-version-body">
<div class="operate-btns" v-if="$route.query.editFlag == 1">
<el-button :disabled="(apiData.status == 2 && scope.row.updateAfterPublish != 1) || apiData.status == 3" type="primary" plain @click="handlePublish">发布</el-button>
<el-button :disabled="apiData.status == 2 || apiData.status == 3" type="primary" plain @click="handleDel">删除</el-button>
<el-button :disabled="(apiData.status == 2 && apiData.updateAfterPublish != 1) || apiData.status == 4" type="primary" plain @click="handlePublish">发布</el-button>
<el-button :disabled="apiData.status != 4" type="primary" plain @click="handleDel">删除</el-button>
<el-button :disabled="apiData.status == 4" type="primary" plain @click="handleGoHistory">回退</el-button>
<el-button :disabled="apiData.status == 2 || apiData.status == 3" type="primary" plain @click="handleGoBack">回滚</el-button>
<el-button :disabled="(apiData.status == 2 && apiData.updateAfterPublish != 1) || apiData.status == 4" type="primary" plain @click="handleGoBack">回滚</el-button>
</div>
<div class="anchor-wrap">
<div class="el-tabs el-tabs--right">
......
......@@ -49,10 +49,11 @@
<el-table-column label="操作" width="340">
<template slot-scope="scope">
<el-button @click="handleEdit(scope.$index, scope.row)" type="text">编辑</el-button>
<el-button :disabled="(scope.row.status == 2 && scope.row.updateAfterPublish != 1) || scope.row.status == 3" @click="handlePublish(scope.$index, scope.row)" type="text">发布</el-button>
<el-button :disabled="(scope.row.status == 2 && scope.row.updateAfterPublish != 1) || scope.row.status == 4" @click="handlePublish(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 :disabled="scope.row.status != 2 && scope.row.status != 3" @click="handleDown(scope.$index, scope.row)" type="text">下线</el-button>
<el-button v-if="scope.row.status == 5 || scope.row.status < 4" :disabled="(scope.row.status != 2 && scope.row.updateAfterPublish != 1) || (scope.row.status == 2 && scope.row.updateAfterPublish == 1)" @click="handleDown(scope.$index, scope.row)" type="text">下线</el-button>
<el-button v-if="scope.row.status == 4" @click="handleUp(scope.$index, scope.row)" type="text">上线</el-button>
<el-button @click="handleRecord(scope.$index, scope.row)" type="text">发布记录</el-button>
</template>
</el-table-column>
......@@ -279,6 +280,41 @@ export default {
});
});
},
handleUp(index, row) {
const that = this;
that
.$confirm(`确认将【${row.version}】版本的【${that.$route.query.interfaceName}】API上线吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.postUpData(index, row);
})
.catch(() => {});
},
postUpData(index, row) {
const that = this;
let para = {
interfaceVersionId: row.interfaceVersionId
};
getRequest('/gateway-manage/online-api', para)
.then(res => {
let resData = res.data;
if (resData.code == '0000') {
showMsg.showmsg('上线成功', 'success');
that.getData();
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 获取环境列表
*/
......
......@@ -13,7 +13,7 @@ import backTableRight from '@/components/createApi/back-table-right.vue';
<div v-if="itemValue.type == 'object' || itemValue.type == 'array'" class="cell"><i class="el-icon-minus"></i></div>
</td>
<td rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell"><el-checkbox v-model="itemValue.isRootKey" :dataisroo="itemData.isRootKey" :disabled="itemData.isRootKey" @change="changeCheck(itemValue, itemName)"></el-checkbox></div>
<div class="cell"><el-checkbox v-model="itemValue.isRootKey" :disabled="itemData.isRootKey" @change="changeCheck(itemValue, itemName)"></el-checkbox></div>
</td>
<td v-if="interfaceType == '0'" rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell">
......@@ -95,7 +95,7 @@ export default {
const that = this;
if (obj.type == 'object' && Object.keys(obj.properties).length) {
for (let k in obj.properties) {
obj.properties[k].isRootKey = false;
obj.properties[k].isRootKey = true;
if (obj.properties[k].type == 'object' && Object.keys(obj[k].properties).length) {
await that.checkArrObjData(obj[k].properties);
}
......@@ -103,7 +103,7 @@ export default {
}
if (obj.type == 'array' && Object.keys(obj.items.properties).length) {
for (let k in obj.items.properties) {
obj.items.properties[k].isRootKey = false;
obj.items.properties[k].isRootKey = true;
if (obj.properties[k].type == 'array' && Object.keys(obj[k].items.properties).length) {
await that.checkArrObjData(obj[k].items.properties);
}
......@@ -115,11 +115,11 @@ export default {
for (let k in item) {
item[k].isRootKey = true;
if (item[k].type == 'object' && Object.keys(item[k].properties).length) {
item[k].isRootKey = false;
item[k].isRootKey = true;
await that.checkArrObjData(item[k].properties);
}
if (item[k].type == 'array' && Object.keys(item[k].items.properties).length) {
item[k].isRootKey = false;
item[k].isRootKey = true;
await that.checkArrObjData(item[k].items.properties);
}
}
......
......@@ -220,26 +220,8 @@ export default {
constData: {
type: 'object',
level: 1,
properties: {
const: {
level: 2,
currentKey: 'const',
constFlag: true,
frontOriginType: 'header',
backendOriginType: 'header', //来源类型 query,body,header
type: 'string',
isBackendField: 0, //是否后端字段
defaultVal: '', //默认值
isRootKey: 0, //是否是后端参数字段
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
example: '示例',
check: true,
properties: {}
}
}
}
};
},
methods: {
......@@ -452,13 +434,15 @@ export default {
async handleArrObjData(item) {
const that = this;
for (let childKey in item) {
// item[childKey]['isRootKey'] = true; // 是否是后端参数字段
item[childKey]['isRootKey'] = false; // 是否是后端参数字段
item[childKey]['rootKey'] = item[childKey]['rootKey'] ? item[childKey]['rootKey'] : childKey;
item[childKey]['isBackendField'] = 1; // 是否后端字段
if(item[childKey].type == 'array' && Object.keys(item[childKey].items.properties).length){
item[childKey]['isRootKey'] = true;
await that.handleArrObjData(item[childKey].items.properties);
}
if(item[childKey].type == 'object' && Object.keys(item[childKey].properties).length) {
item[childKey]['isRootKey'] = true;
await that.handleArrObjData(item[childKey].properties);
}
}
......
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