Commit 6b5e33d8 authored by 张亚松's avatar 张亚松

Merge branch 'dev' into 'master'

Dev

See merge request apaas-v3/apaas-ui!4
parents 656f98cb ce67c131
......@@ -51,7 +51,7 @@ pipeline:
base: hub.wodcloud.com/wod/ui-base:2.0-apaasv3
dockerfile: .beagle/dockerfile
repo: wod/apaas-ui
version: v3.0.4
version: v3.0.5
channel: alpha
args: "TARGETOS=linux,TARGETARCH=amd64" ## 不同架构的构建参数
registry: registry.cn-qingdao.aliyuncs.com
......@@ -70,8 +70,8 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-alpha
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-alpha
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
......@@ -88,7 +88,7 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0
registry: registry.cn-qingdao.aliyuncs.com
secrets:
......@@ -108,7 +108,7 @@ pipeline:
base: hub.wodcloud.com/wod/ui-base:2.0-apaasv3-arm64
dockerfile: .beagle/dockerfile
repo: wod/apaas-ui
version: v3.0.4
version: v3.0.5
channel: alpha-arm64
args: "TARGETOS=linux,TARGETARCH=arm64"
registry: registry.cn-qingdao.aliyuncs.com
......@@ -127,8 +127,8 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-alpha-arm64
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-arm64
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-alpha-arm64
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-arm64
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
......@@ -145,7 +145,7 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-arm64
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-arm64
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0-arm64
registry: registry.cn-qingdao.aliyuncs.com
secrets:
......@@ -164,7 +164,7 @@ pipeline:
base: hub.wodcloud.com/wod/ui-base:2.0-apaasv3-ppc64le
dockerfile: .beagle/dockerfile
repo: wod/apaas-ui
version: v3.0.4
version: v3.0.5
channel: alpha-ppc64le
args: "TARGETOS=linux,TARGETARCH=ppc64le"
registry: registry.cn-qingdao.aliyuncs.com
......@@ -182,8 +182,8 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-alpha-ppc64le
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-ppc64le
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-alpha-ppc64le
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-ppc64le
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
......@@ -199,7 +199,7 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-ppc64le
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-ppc64le
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0-ppc64le
registry: registry.cn-qingdao.aliyuncs.com
secrets:
......@@ -218,7 +218,7 @@ pipeline:
base: hub.wodcloud.com/wod/ui-base:2.0-apaasv3-mips64le
dockerfile: .beagle/dockerfile
repo: wod/apaas-ui
version: v3.0.4
version: v3.0.5
channel: alpha-mips64le
args: "TARGETOS=linux,TARGETARCH=mips64le"
registry: registry.cn-qingdao.aliyuncs.com
......@@ -236,8 +236,8 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-alpha-mips64le
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-mips64le
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-alpha-mips64le
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-mips64le
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
......@@ -253,7 +253,7 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-mips64le
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-mips64le
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0-mips64le
registry: registry.cn-qingdao.aliyuncs.com
secrets:
......@@ -270,7 +270,7 @@ pipeline:
namespace: apaas-v3
deployment: apaas-ui
container: apaas-ui
registry: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.4-alpha
registry: registry.cn-qingdao.aliyuncs.com/wod/apaas-ui:v3.0.5-alpha
when:
branch:
- dev
......@@ -5,16 +5,30 @@
<span>{{ title || "-" }}</span>
<span>更新时间:{{ time || "-" }}</span>
</h3>
<div
class="part_content doc_content w-e-text w-e-text-container apaas_scroll"
v-html="content"
ref="docContent"
></div>
<div class="part_content doc_content w-e-text w-e-text-container apaas_scroll">
<div
v-html="content"
ref="docContent"
>
</div>
<div v-if="doc_type">
<h3 class="doc_title">附件(点击下载):
<span v-if="fileList && fileList.length !== 0">
<span v-for="(e,idx) in fileList" :key="idx" class="file" :class="'file'+idx">
<span @click="download(e)">{{helper.downloadFileFormatNew(e)}}</span>
<br>
</span>
</span>
<span class="noFile" v-else>暂无</span>
</h3>
</div>
</div>
</div>
<div class="part nav_part">
<h3 class="part_title">
<h5 class="part_title">
<span>导航</span>
</h3>
</h5>
<ul class="part_content nav_content apaas_scroll">
<li
v-for="(item, index) in navTree"
......@@ -33,6 +47,8 @@
</template>
<script>
import helper from "@/services/helper"
export default {
props: {
richText: {
......@@ -47,21 +63,35 @@ export default {
type: String,
defalut: "",
},
doc_type: {
type: Boolean,
default: false
},
doc_file: {
type: String,
defalut: "",
}
},
data() {
return {
helper: helper,
content: "",
navTree: [],
curNav: "",
fileList: [],
};
},
watch: {
richText() {
this.translate();
},
doc_file() {
this.getFile()
}
},
mounted() {
this.translate();
this.getFile()
},
methods: {
translate() {
......@@ -120,6 +150,17 @@ export default {
this.curNav = (newTitles[0] && newTitles[0].id) || "";
}
},
getFile() {
if (this.doc_file != "") {
this.fileList = this.doc_file.split(",")
}
},
download(e) {
const a = document.createElement("a"); // 创建a标签
a.setAttribute("download", ""); // download属性
a.setAttribute("href", e); // href链接
a.click(); // 自执行点击事件
}, // 下载附件
clickNav(item) {
let target = document.querySelector(`#${item.id}`);
......@@ -164,6 +205,25 @@ export default {
.doc_part {
flex-grow: 1;
}
.doc_title {
font-weight: 700;
padding-left: 32px;
margin-top: 60px;
}
.file {
font-weight: normal;
font-size: 14px;
margin-left: 152px;
cursor: pointer;
color: #515fe7;
}
.file0 {
margin-left: 0;
}
.noFile {
font-weight: normal;
font-size: 14px;
}
.nav_part {
width: 270px;
flex-shrink: 0;
......
......@@ -119,6 +119,7 @@ export default {
methods: {
handleSizeChange(val) {
this.pagination.rowsPerPage = val;
this.pagination.page = 1
this.refreshData();
},
handleCurrentChange(val) {
......
......@@ -182,6 +182,7 @@
>
{{ item.name }}
</div>
<div class="list_total">{{total}}条数据</div>
<!-- <div v-if="urlFilter == 'app'" class="btn_right_check">
<el-checkbox v-model="couldTwice" @change="changeTwice">
支持二次开发
......@@ -197,15 +198,27 @@
"
></div> -->
<!-- the list -->
<commodity-list
:datas="lists && lists.length != 0 ? lists : []"
:total="total"
:url="url"
:urlFilter="urlFilter"
:paginationShow="false"
:pageSizeShow="true"
@refresh="getNewList"
></commodity-list>
<div class="shop_list">
<commodity-list
ref="commodity_list"
:datas="lists && lists.length != 0 ? lists : []"
:total="total"
:url="url"
:urlFilter="urlFilter"
@refresh="getNewList"
></commodity-list>
</div>
<div class="pagination_box">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page"
:page-sizes="[10, 20, 50]"
:page-size="limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</div>
</template>
......@@ -242,6 +255,20 @@ export default {
],
activeOptions: [[], [], [], []],
activeChildOptions: [[], [], [], []],
pageOptions: [
{
value: "10",
label: "10",
},
{
value: "20",
label: "20",
},
{
value: "50",
label: "50",
},
],
buttonFilter: [
{
name: "综合排序",
......@@ -286,7 +313,7 @@ export default {
},
],
page: 1,
limit: 20,
limit: 10,
couldTwice: false,
refresh_app_1: false,
refresh_app_2: false,
......@@ -297,11 +324,11 @@ export default {
}),
mounted() {
window.addEventListener("resize", this.judgeHeight);
window.addEventListener("scroll", this.menu, true);
// window.addEventListener("scroll", this.menu, true);
},
destroyed() {
window.removeEventListener("resize", this.judgeHeight);
window.removeEventListener("scroll", this.menu, true);
// window.removeEventListener("scroll", this.menu, true);
},
watch: {
urlFilter: {
......@@ -357,22 +384,31 @@ export default {
},
},
methods: {
menu() {
if (this.isKaiGuan) {
let scroll =
this.getScrollTop() + this.getWindowHeight() - this.getScrollHeight();
if (scroll > -10) {
if (
(this.total != 0 && this.page * this.limit < this.total) ||
this.total == 0
) {
this.page++;
this.getShopList();
}
}
}
},
// menu() {
// if (this.isKaiGuan) {
// let scroll =
// this.getScrollTop() + this.getWindowHeight() - this.getScrollHeight();
// if (scroll > -10) {
// if (
// (this.total != 0 && this.page * this.limit < this.total) ||
// this.total == 0
// ) {
// this.page++;
// this.getShopList();
// }
// }
// }
// },
//滚动条在Y轴上的滚动距离
handleSizeChange(val) {
this.limit = val;
this.page = 1
this.getShopList()
},
handleCurrentChange(val) {
this.page = val;
this.getShopList()
},
getScrollTop() {
var documentScrollTop = 0;
documentScrollTop = document.documentElement.scrollTop;
......@@ -406,10 +442,11 @@ export default {
};
this.$api.serviceShop.getAppList(query).then((response) => {
if (response.data.success == "1") {
this.lists =
this.page == 1
? response.data.data
: this.lists.concat(response.data.data);
// this.lists =
// this.page == 1
// ? response.data.data
// : this.lists.concat(response.data.data);
this.lists = response.data.data
this.total = response.data.total;
this.isKaiGuan = true;
} else {
......@@ -430,10 +467,11 @@ export default {
};
this.$api.serviceShop.getServiceShopList(query).then((response) => {
if (response.data.success == "1") {
this.lists =
this.page == 1
? response.data.data
: this.lists.concat(response.data.data);
// this.lists =
// this.page == 1
// ? response.data.data
// : this.lists.concat(response.data.data);
this.lists = response.data.data
this.total = response.data.total;
this.isKaiGuan = true;
} else {
......@@ -582,7 +620,7 @@ export default {
getNewList(val) {
console.log(val);
this.page = 1;
this.limit = 20;
this.limit = 10;
this.getShopList();
},
clickAll(item) {
......@@ -771,6 +809,11 @@ export default {
margin-left: 15px;
position: relative;
}
.list_total {
position: absolute;
right: 16px;
top: 0;
}
.btn_right_check {
position: absolute;
right: 20px;
......@@ -785,8 +828,7 @@ export default {
.head_flex .input_right .el-input--prefix .el-input__inner {
padding-left: 40px;
}
.head_flex .input_right .el-input__prefix,
.el-input__suffix {
.head_flex .input_right .el-input__prefix{
left: 10px;
}
.head_flex .input_right .el-input--prefix .el-input__inner {
......@@ -810,3 +852,22 @@ export default {
border-color: #626de9;
}
</style>
<style scoped>
.shop_list {
margin-bottom: 40px;
}
.pagination_box {
width: 1008px;
height: 50px;
position: fixed;
bottom: 0;
background-color: #f6f7fb;
text-align: center;
line-height: 50px;
}
.pagination_box /deep/.el-pagination>.btn-prev,
.pagination_box /deep/.el-pagination>.btn-next,
.pagination_box /deep/.el-pagination>.el-pager>li {
background-color: transparent!important;
}
</style>
......@@ -23,6 +23,7 @@
<el-form-item prop="date">
<p class="formname">申请使用期限</p>
<el-date-picker
:disabled="disabledDate"
v-model="formInline.date"
type="daterange"
range-separator="至"
......@@ -48,6 +49,10 @@ export default {
return {};
},
},
disabledDate: {
type: Boolean,
default: false
}
},
components: {},
data() {
......
......@@ -135,7 +135,7 @@
<em
class="cur_pointer"
v-else
:class="btn.type"
:class="btn.disabledRule ? btn.type : 'disabled_btn ' + btn.type"
:style="{
color: btn.label == '删除' ? '#830f53' : '#0f2683',
}"
......@@ -835,6 +835,10 @@ em {
.cur_pointer {
cursor: pointer;
}
.disabled_btn {
cursor: not-allowed;
color: #999!important;
}
.ces-table .el-table--mini td,
.ces-table .el-table--mini th {
padding: 11px 0 !important;
......
<template>
<section class="wangeditor_class">
<div ref="toolbar" class="toolbar"></div>
<div>
<el-upload
class="upload-file"
action="/apaas/static/image/upload"
:on-success="uploadSuccess"
:on-remove="handleRemove"
:data="{directory: 'file' }"
:limit="5"
:file-list="fileArray">
<el-button ref="upload_file" id="upload_file" size="small" type="primary" v-show="false">点击上传</el-button>
</el-upload>
</div>
</section>
</template>
<script>
import E from "wangeditor";
const { BtnMenu } = E
//编辑器自定义按钮
class uploadMenu extends BtnMenu {
constructor(editor) {
const $elem = E.$(
`<div class="w-e-menu" data-title="文档上传">
<i class="el-icon-upload2"></i>
</div>`
)
super($elem, editor)
}
clickHandler() {
wangEuploadFile();
}
tryChangeActive() {
this.active()
}
}
export default {
name: "editoritem",
data() {
return {
// uploadPath,
uploadMenu,
editor: null,
info_: null
info_: null,
};
},
model: {
......@@ -31,6 +64,10 @@ export default {
type: Boolean,
default: false
},
fileArray: {
type: Array,
default: () => []
}
},
watch: {
isClear(val) {
......@@ -59,6 +96,7 @@ export default {
mounted() {
this.seteditor();
this.editor.txt.html(this.value);
window.wangEuploadFile = this.wangEuploadFile
},
methods: {
seteditor() {
......@@ -109,9 +147,45 @@ export default {
this.info_ = html; // 绑定当前逐渐地值
this.$emit("change", this.info_); // 将内容同步到父组件中
};
this.editor.menus.extend('uploadMenusKey',uploadMenu)
this.editor.config.menus.push('uploadMenusKey')
// 创建富文本编辑器
this.editor.create();
}
},
wangEuploadFile() {
// this.$refs.upload_file.handleClick();
document.getElementById('upload_file').click();
},
uploadSuccess(response, file, fileList) {
if (response.success == 1) {
this.fileArray.push({
url: response.data,
name: file.name,
});
this.$emit("getNewList", this.fileArray);
}
},
handleRemove(file, fileList) {
let url = file.url;
let detection = true;
if (url) detection = url.indexOf("blob") != -1;
if (detection) {
this.fileArray.forEach((item, i, arr) => {
if (item.url === file.url) {
this.fileArray.splice(i, 1);
}
});
} else {
this.fileArray.forEach((item, i, arr) => {
if (item.url === file.url) {
this.fileArray.splice(i, 1);
}
});
}
this.$emit("getNewList", this.fileArray);
},
}
};
</script>
......@@ -142,4 +216,7 @@ export default {
border: none!important;
height: calc(100% - 80px)!important;
}
.upload-file {
width: 50%;
}
</style>
......@@ -3,6 +3,7 @@
<info-list :list_arr="module_arr">
<apply-form
:formInline="formInline"
:disabledDate="disabledDate"
ref="apply_info"
slot="apply_info"
></apply-form>
......@@ -125,7 +126,8 @@ export default {
val: "mg"
}
],
temp_sub_arr: []
temp_sub_arr: [],
disabledDate: false,
};
},
watch: {},
......@@ -197,6 +199,15 @@ export default {
let data = response.data.data;
if (response.data.success && data) {
//服务
if (data.interface_typ == 2 || data.interface_typ == 3) {
this.disabledDate = true
let yyyy = new Date().getFullYear()
let mm = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
let dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
let date_now = yyyy + '-' + mm + '-' + dd
this.formInline.date = ["","2099-12-31"]
this.formInline.date[0] = date_now
}
this.post_arr = [data];
this.post_arr[0].service_id = parseInt(service_data.service_id);
this.post_arr[0].spec_id = parseInt(service_data.spec_id);
......
......@@ -14,8 +14,8 @@
</div>
<div class="editpage">
<wang-e v-model="content"></wang-e>
<div class="apaas_button">
<wang-e v-model="content" @getNewList="getNewList" :fileArray="fileArray"></wang-e>
<div class="apaas_button pt_max">
<el-button type="defalut" size="mini" @click="cancelAction">
取消
</el-button>
......@@ -29,6 +29,7 @@
<script>
import wangE from "@/components/wangE";
import helper from "@/services/helper.js";
export default {
components: {
wangE,
......@@ -37,6 +38,8 @@ export default {
return {
title: "",
content: "",
fileList: [],
fileArray: []
};
},
computed: {
......@@ -56,6 +59,16 @@ export default {
if (data.success === 1) {
this.title = data.data.title;
this.content = data.data.content;
let arr = [];
if (data.data.doc_file && data.data.doc_file != "") {
arr = data.data.doc_file.split(",")
arr.forEach(e => {
this.fileArray.push({
name: helper.downloadFileFormatNew(e),
url: e
})
})
}
}
});
}
......@@ -65,10 +78,18 @@ export default {
this.$router.push("/technical_support/doc_manage");
},
submitAction() {
let arr = [];
if (this.fileList && this.fileList.length > 0 ) {
this.fileList.forEach(e => {
arr.push(e.url)
})
}
let doc_file = arr.join(",") || ""
this.$http
.put("/apaas/support/document/put", {
id: this.id,
content: this.content,
doc_file: doc_file,
})
.then(({ data }) => {
if (data.success === 1) {
......@@ -83,6 +104,9 @@ export default {
this.$message.error("保存失败");
});
},
getNewList(fileList) {
this.fileList = fileList;
},
},
};
</script>
......@@ -119,4 +143,10 @@ export default {
.apaas_button .el-button + .el-button {
margin-right: 30px;
}
.editpage /deep/ .wangeditor_class {
height: calc(100% - 200px);
}
.pt_max {
padding-top: 130px;
}
</style>
......@@ -19,6 +19,8 @@
:title="title"
:time="update_time"
:rich-text="content"
:doc_type="true"
:doc_file="doc_file"
></doc-width-nav>
</div>
</template>
......@@ -42,6 +44,7 @@ export default {
title: "",
update_time: "",
content: "",
doc_file: ""
};
},
computed: {
......@@ -85,6 +88,7 @@ export default {
if (data.data.content) {
this.content = data.data.content;
}
this.doc_file = data.data.doc_file || ""
}
});
},
......
......@@ -101,6 +101,12 @@
:readOnly="true"
></v-apaas-code>
</info-list>
<!-- <info-list v-else-if="now_service == 2">
<process-card
:data="use_approval_arr"
slot="approval"
></process-card>
</info-list> -->
<info-list
v-else
:list_arr="
......@@ -110,9 +116,18 @@
: list_arr
: now_service == 1
? servicead_arr
: now_service == 2
? jkwd_arr
: apply_arr
"
>
<table-um
:stripe="true"
:headers="jkwd_headers"
:datas="jkwd_datas"
@download="download"
slot="wd_table"
></table-um>
<table-um
v-if="res_table_arr.length"
:headers="res_header_arr"
......@@ -156,6 +171,7 @@ import infoList from "@/components/infoList";
import tableUm from "@/components/table/table-um";
import processCard from "@/components/process-card";
import codes from "@/components/general/codes";
import helper from "@/services/helper";
export default {
props: {},
components: {
......@@ -524,7 +540,7 @@ export default {
],
},
],
service_arr: ["服务基本信息", "接口详细信息", "申请审批信息"],
service_arr: ["服务基本信息", "接口详细信息","接口文档", "申请审批信息"],
data_service_type1: "",
service_header_arr: {
id: "",
......@@ -659,6 +675,17 @@ export default {
solt_name: "res_code",
},
],
jkwd_arr: [
{
title: "",
info: "",
type: "solt",
solt_name: "wd_table",
},
],
jkwd_headers: [],
jkwd_datas: [],
clickFlag: false,
apply_arr: [
{
title: "申请信息",
......@@ -754,6 +781,14 @@ export default {
},
mounted() {},
methods: {
download(row) {
if (this.clickFlag) {
const a = document.createElement("a"); // 创建a标签
a.setAttribute("download", ""); // download属性
a.setAttribute("href", row.url); // href链接
a.click(); // 自执行点击事件
}
}, // 下载接口文档
change_port(val) {
this.port_options.forEach((e) => {
if (e.value == val) {
......@@ -778,6 +813,37 @@ export default {
return;
}
let data = response.data.data;
// 审批通过才可以下载接口文档,待审批、审批中、审批不通过不可以下载
if (data.service_apply_info.approval_status == 3) {
this.clickFlag = true
}else {
this.clickFlag = false
}
if (data.doc_file != '') {
this.jkwd_datas.push({
wd_name: helper.downloadFileFormat(data.doc_file),
url: data.doc_file
})
}
this.jkwd_headers = [
{
prop: "wd_name",
label: "文档名称",
align: "left",
},
{
label: "操作",
type: "Button",
align: "center",
btnList: [
{
type: "download",
label: "下载",
disabledRule: this.clickFlag == true
},
],
},
],
this.$set(this.service_header_arr, "portal_id", data.portal_id); // 时空服务id
this.$set(this.service_header_arr, "workflows_id", data.workflows_id); // 时空服务id
this.$set(
......
......@@ -24,7 +24,7 @@
:style="
now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {}
"
v-if="index < 3 || in_origin_ser"
v-if="index < 4 || in_origin_ser"
>
{{ item }}
</div>
......@@ -288,13 +288,19 @@
></list-pagination>
</div>
<div v-show="now_service == 3">
<p style="color: #8890a7">服务规格:</p>
<table-um
:stripe="true"
:headers="jkwd_headers"
:datas="jkwd_datas"
@download="download"
></table-um>
<!-- <p style="color: #8890a7">服务规格:</p>
<table-um
:stripe="true"
:headers="service_size_arr"
:datas="service_size_data"
></table-um>
<!-- <p style="color: #8890a7;">购买方式:</p>
<p style="color: #8890a7;">购买方式:</p>
<p style="color: #242c43;margin:10px 0px;">
{{
buy_type == 1
......@@ -303,7 +309,7 @@
? "按年购买"
: "按月购买&按年购买"
}}
</p> -->
</p>
<div
class="editbtn"
v-if="now_user == 1"
......@@ -330,7 +336,7 @@
:datas="service_size_data"
@changeTable="now_size_data"
></table-um>
<!-- <p
<p
v-if="now_user == 1 && sizeset_flag"
style="color: #8890a7;margin:10px 0;"
>
......@@ -347,11 +353,11 @@
:type="buy_style.indexOf(2) !== -1 ? 'primary' : ''"
@click="change_buy(2)"
>按年购买</el-button
> -->
>
<div class="savebtn" v-if="now_user == 1 && sizeset_flag">
<el-button @click="change_service_size">保存</el-button>
<el-button @click="sizeset_flag = false">取消</el-button>
</div>
</div> -->
</div>
<div v-show="now_service == 4">
<info-list :list_arr="trans_log_arr">
......@@ -468,6 +474,26 @@ export default {
times: 0,
month: 0,
},
jkwd_headers: [
{
prop: "wd_name",
label: "文档名称",
align: "left",
},
{
label: "操作",
type: "Button",
align: "center",
btnList: [
{
type: "download",
label: "下载",
disabledRule: true
},
],
},
],
jkwd_datas: [],
trans_log_arr: [
{
title: "服务交易概览",
......@@ -739,18 +765,19 @@ export default {
workflows_id: "", //判断是否是流程服务
sizeset_flag: false, //规格设置是否显示
service_arr: [
["服务基本信息", "接口详细信息", "服务运行状态"],
["服务基本信息", "接口详细信息", "服务运行状态","接口文档"],
[
"服务基本信息",
"接口详细信息",
"服务运行状态",
// "服务计费规则",
// "服务交易记录",
"接口文档"
],
[
"服务基本信息",
"接口详细信息",
"服务运行状态",
"服务运行状态","接口文档"
// "服务规格",
// "服务交易记录",
],
......@@ -1272,6 +1299,14 @@ export default {
},
mounted() {},
methods: {
download(row) {
console.log(row.url)
const a = document.createElement("a"); // 创建a标签
a.setAttribute("download", ""); // download属性
a.setAttribute("href", row.url); // href链接
a.click(); // 自执行点击事件
}, // 下载接口文档
change_port(val) {
this.port_options.forEach((e) => {
if (e.value == val) {
......@@ -1665,6 +1700,12 @@ export default {
});
this.service_size_data = temp;
this.size_arr_down = temp;
if (data.doc_file != '') {
this.jkwd_datas.push({
wd_name: helper.downloadFileFormat(data.doc_file),
url: data.doc_file
})
}
} else {
this.$message({
message: response.data.errMsg,
......
......@@ -62,6 +62,17 @@
</el-button>
</el-row>
<div class="gray_line"></div>
<div class="fwcs_fwdz" v-if="process_id == '' && is_map == 0">
接口协议:
</div>
<el-radio-group
v-model="jkxy"
class="jkxy"
@change="test"
v-if="process_id == '' && is_map == 0"
>
<el-radio v-for="(e,i) in jkxyList" :key="'xy' + i" :label="e.value">{{e.label}}</el-radio>
</el-radio-group>
<div v-if="activeBtn == 4">
<div class="sqxx_title">服务类型:</div>
<el-select
......@@ -95,7 +106,7 @@
<div v-show="
(activeBtn == 4 && zhyyVal == 24) ||
activeBtn == 3 ||
activeBtn == 2
activeBtn == 2 || jkxy !== 1
">
<div class="fwcs_fwdz">
上传接口文档
......@@ -126,13 +137,13 @@
</el-radio-group>
</div>
<div
v-if="!(activeBtn == 4 && zhyyVal == 24)"
v-if="!(activeBtn == 4 && zhyyVal == 24) && jkxy == 1"
class="fwcs_fwdz"
>
服务地址:
</div>
<div
v-if="!(activeBtn == 4 && zhyyVal == 24)"
v-if="!(activeBtn == 4 && zhyyVal == 24) && jkxy == 1"
class="fwcs_fwdz_inner"
>
<el-input
......@@ -188,7 +199,58 @@
服务测试
</el-button>
</div>
<div v-if="activeBtn == 0 || activeBtn == 2 || activeBtn == 3">
<div
v-if="jkxy == 2"
class="fwcs_fwdz"
>
IP+端口号:
</div>
<div
v-if="jkxy == 2"
class="fwcs_fwdz_inner"
>
<el-input
placeholder="请输入内容"
@input="getUrl"
v-model="serviceUrl"
class="input-with-select"
>
</el-input>
<el-button
@click="clickFwcs()"
class="fwcs_btn_fwcs"
>
服务测试
</el-button>
</div>
<div
v-if="jkxy == 3"
class="fwcs_fwdz"
>
服务地址:
</div>
<div
v-if="jkxy == 3"
class="fwcs_fwdz_inner"
>
<el-input
placeholder="请输入内容"
@input="getUrl"
v-model="serviceUrl"
class="input-with-select"
>
</el-input>
<el-button
@click="clickFwcs()"
class="fwcs_btn_fwcs"
>
服务测试
</el-button>
</div>
<div v-if="(activeBtn == 0 || activeBtn == 2 || activeBtn == 3) && jkxy == 1">
<el-tabs
v-model="activeName"
class="fwcs_tabs"
......@@ -327,7 +389,7 @@
>{{ item.name }}</el-radio>
</div>
</div>
<div v-if="activeBtn == 4 && zhyyVal != 34 && zhyyVal != 24">
<div v-if="activeBtn == 4 && zhyyVal != 34 && zhyyVal != 24 && jkxy == 1">
<el-tabs
v-model="activeZh"
class="fwcs_tabs"
......@@ -554,7 +616,7 @@
</el-button>
</div>
</block-radius>
<div v-if="activeBtn == 4 && zhyyVal == 24">
<div v-if="activeBtn == 4 && zhyyVal == 24 && jkxy == 1">
<!-- 24 -->
<block-radius
v-for="(itemOne, indexOne) in liucheng_list"
......@@ -884,7 +946,7 @@
@getNewList="getNewList"
></upload-file>
</el-form-item>
<el-form-item>
<el-form-item v-if="jkxy == 1">
<p class="formname">接口编码:</p>
<el-input
v-model="form.code"
......@@ -1154,6 +1216,21 @@ export default {
skfwRadios: [],
optionsZhyy: [],
zhyyVal: 22,
jkxy: 1,
jkxyList: [
{
label: "http(s)",
value: 1,
},
{
label: "grpc",
value: 2,
},
{
label: "websocket",
value: 3,
},
],
jcxxtx: false,
form: {
name: "",
......@@ -1252,6 +1329,9 @@ export default {
computed: {},
watch: {},
methods: {
test() {
console.log(this.jkxy)
},
getCurrentUser() {
this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
......@@ -1262,6 +1342,7 @@ export default {
});
},
clickBtn(val) {
this.jkxy = 1
this.resultShow = false;
this.activeBtn = val;
this.select = "GET";
......@@ -1332,121 +1413,128 @@ export default {
let headers = {};
let requestData = {};
let requestHeaderDataObj = {};
if (this.activeBtn == 0 || this.activeBtn == 3) {
if (this.sqfsVal == 1 || this.sqfsVal == 3) {
if (this.tokenName == "") {
this.$message.error("请输入token名称");
return;
}
if (this.tokenVal == "") {
this.$message.error("请输入token值");
return;
let request = []
let bodys = "";
let contentType = "";
if (this.jkxy != 1) {
}else {
if (this.activeBtn == 0 || this.activeBtn == 3) {
if (this.sqfsVal == 1 || this.sqfsVal == 3) {
if (this.tokenName == "") {
this.$message.error("请输入token名称");
return;
}
if (this.tokenVal == "") {
this.$message.error("请输入token值");
return;
}
}
}
let request = this.$refs.fwcs_sjfw_qq.getTableData();
for (let i = 0; i < request.length; i++) {
if (
request[i] &&
request[i].requestEncoding &&
request[i].requestValue &&
request[i].requestEncoding != "" &&
request[i].requestValue != ""
) {
let request = this.$refs.fwcs_sjfw_qq.getTableData();
for (let i = 0; i < request.length; i++) {
if (
Object.keys(requestData).indexOf(request[i].requestEncoding) == -1
request[i] &&
request[i].requestEncoding &&
request[i].requestValue &&
request[i].requestEncoding != "" &&
request[i].requestValue != ""
) {
requestData[request[i].requestEncoding] = [];
requestData[request[i].requestEncoding][0] =
request[i].requestValue;
} else {
requestData[request[i].requestEncoding].push(
request[i].requestValue
);
if (
Object.keys(requestData).indexOf(request[i].requestEncoding) == -1
) {
requestData[request[i].requestEncoding] = [];
requestData[request[i].requestEncoding][0] =
request[i].requestValue;
} else {
requestData[request[i].requestEncoding].push(
request[i].requestValue
);
}
}
}
}
} else if (this.activeBtn == 1) {
} else if (this.activeBtn == 4 && this.zhyyVal != 34) {
let request = this.$refs.fwcs_zhfw_qq.getTableData();
for (let i = 0; i < request.length; i++) {
if (
request[i] &&
request[i].requestEncoding &&
request[i].requestValue &&
request[i].requestEncoding != "" &&
request[i].requestValue != ""
) {
} else if (this.activeBtn == 1) {
} else if (this.activeBtn == 4 && this.zhyyVal != 34) {
let request = this.$refs.fwcs_zhfw_qq.getTableData();
for (let i = 0; i < request.length; i++) {
if (
Object.keys(requestData).indexOf(request[i].requestEncoding) == -1
request[i] &&
request[i].requestEncoding &&
request[i].requestValue &&
request[i].requestEncoding != "" &&
request[i].requestValue != ""
) {
requestData[request[i].requestEncoding] = [];
requestData[request[i].requestEncoding][0] =
request[i].requestValue;
} else {
requestData[request[i].requestEncoding].push(
request[i].requestValue
);
if (
Object.keys(requestData).indexOf(request[i].requestEncoding) == -1
) {
requestData[request[i].requestEncoding] = [];
requestData[request[i].requestEncoding][0] =
request[i].requestValue;
} else {
requestData[request[i].requestEncoding].push(
request[i].requestValue
);
}
}
}
}
}
if(this.activeBtn == 0 || this.activeBtn == 2 || this.activeBtn == 3 || this.activeBtn == 4){
let requestHeader = this.$refs.fwcs_zhfw_qqtcs.getTableData();
for (let i = 0; i < requestHeader.length; i++) {
if (
requestHeader[i] &&
requestHeader[i].requestEncoding &&
requestHeader[i].requestValue &&
requestHeader[i].requestEncoding != "" &&
requestHeader[i].requestValue != ""
) {
console.log(Object.keys(requestHeaderDataObj).indexOf(requestHeader[i].requestEncoding) == -1)
if(this.activeBtn == 0 || this.activeBtn == 2 || this.activeBtn == 3 || this.activeBtn == 4){
let requestHeader = this.$refs.fwcs_zhfw_qqtcs.getTableData();
for (let i = 0; i < requestHeader.length; i++) {
if (
Object.keys(requestHeaderDataObj).indexOf(requestHeader[i].requestEncoding) == -1
requestHeader[i] &&
requestHeader[i].requestEncoding &&
requestHeader[i].requestValue &&
requestHeader[i].requestEncoding != "" &&
requestHeader[i].requestValue != ""
) {
requestHeaderDataObj[requestHeader[i].requestEncoding] = [];
requestHeaderDataObj[requestHeader[i].requestEncoding][0] = requestHeader[i].requestValue;
} else {
requestHeaderDataObj[requestHeader[i].requestEncoding].push(
requestHeader[i].requestValue
);
console.log(Object.keys(requestHeaderDataObj).indexOf(requestHeader[i].requestEncoding) == -1)
if (
Object.keys(requestHeaderDataObj).indexOf(requestHeader[i].requestEncoding) == -1
) {
requestHeaderDataObj[requestHeader[i].requestEncoding] = [];
requestHeaderDataObj[requestHeader[i].requestEncoding][0] = requestHeader[i].requestValue;
} else {
requestHeaderDataObj[requestHeader[i].requestEncoding].push(
requestHeader[i].requestValue
);
}
}
}
headers = Object.assign(headers, requestHeaderDataObj)
}
headers = Object.assign(headers, requestHeaderDataObj)
}
let bodys = "";
let contentType = "";
if (this.activeBtn == 0 || this.activeBtn == 3) {
bodys = this.$refs.jsonCodes ? this.$refs.jsonCodes.getCodesVal() : "";
contentType = this.sjfwQqt;
} else if (this.activeBtn == 4) {
if (this.activeZh == "1") {
contentType = this.zhfwQqt;
if (this.zhfwQqt == "JSON") {
bodys = this.$refs.zhfwJsonCodes
? this.$refs.zhfwJsonCodes.getCodesVal()
: "";
} else if (this.zhfwQqt == "form-data") {
let request = this.$refs.fwcs_zhfw_qq_form.getTableData().concat();
request.pop();
bodys = JSON.stringify(request);
} else if (this.zhfwQqt == "x-www-form-urlencoded") {
let request = this.$refs.fwcs_zhfw_www.getTableData().concat();
let arr = [];
request.pop();
request.forEach(item => {
arr.push({
key: item.requestEncoding,
val: item.requestValue,
field_type: "text"
let bodys = "";
let contentType = "";
if (this.activeBtn == 0 || this.activeBtn == 3) {
bodys = this.$refs.jsonCodes ? this.$refs.jsonCodes.getCodesVal() : "";
contentType = this.sjfwQqt;
} else if (this.activeBtn == 4) {
if (this.activeZh == "1") {
contentType = this.zhfwQqt;
if (this.zhfwQqt == "JSON") {
bodys = this.$refs.zhfwJsonCodes
? this.$refs.zhfwJsonCodes.getCodesVal()
: "";
} else if (this.zhfwQqt == "form-data") {
let request = this.$refs.fwcs_zhfw_qq_form.getTableData().concat();
request.pop();
bodys = JSON.stringify(request);
} else if (this.zhfwQqt == "x-www-form-urlencoded") {
let request = this.$refs.fwcs_zhfw_www.getTableData().concat();
let arr = [];
request.pop();
request.forEach(item => {
arr.push({
key: item.requestEncoding,
val: item.requestValue,
field_type: "text"
});
});
});
bodys = JSON.stringify(arr);
bodys = JSON.stringify(arr);
}
}
}
}
let query = {
interface_typ: this.jkxy,
method: this.select,
url: this.serviceUrl,
req_auth_mthod: this.sqfsVal,
......@@ -1792,6 +1880,8 @@ export default {
}
}
let query = {
interface_typ: this.jkxy,
proxy_address: this.serviceUrl,
name: this.form.name,
sectors: this.form.area,
organization: this.form.origin,
......@@ -1808,7 +1898,6 @@ export default {
? this.zhyyVal
: 0,
portal_id: this.portal_id,
encode_method: this.form.code,
doc_file: this.jkwds.length != 0 ? this.jkwds[0] : "",
urls: [
{
......@@ -1819,7 +1908,7 @@ export default {
req_auth_token: this.sqfsVal == 1 ? this.tokenVal : "",
req_auth_token_name:
this.sqfsVal == 1 ? this.tokenName : "",
method: this.select,
method: this.jkxy == 1 ? this.select : '',
url: this.serviceUrl,
request_fields:
this.dataType == "body"
......@@ -1834,6 +1923,9 @@ export default {
}
]
};
if (this.jkxy == 1) {
query.encode_method = this.form.code
}
this.$api.workbench.serviceAdd(query).then(response => {
this.fwR = false;
if (response.data.success == 1) {
......@@ -1858,7 +1950,7 @@ export default {
this.$refs.form.validate(valid => {
if (valid) {
if (this.cover.length != 0) {
if (this.jkwds.length == 0) {
if (this.jkwds.length == 0 && this.jkxy == 1) {
this.$message.error("请上传接口文档");
} else {
this.fwR = true;
......@@ -1870,7 +1962,7 @@ export default {
req_auth_mthod: item.sqfsVal,
req_auth_token: item.sqfsVal == 1 ? item.tokenVal : "",
req_auth_token_name: item.sqfsVal == 1 ? item.tokenName : "",
method: item.select,
method: this.jkxy == 1 ? item.select : '',
url: item.serviceUrl,
request_fields:
item.dataType == "body"
......@@ -1884,7 +1976,10 @@ export default {
content_type: "JSON"
});
});
let query = {
interface_typ: this.jkxy,
proxy_address: this.jkxy == 1? '' : this.serviceUrl,
name: this.form.name,
sectors: this.form.area,
organization: this.form.origin,
......@@ -1894,10 +1989,12 @@ export default {
data_service_type1: this.btnList[this.activeBtn].id,
data_service_type2: 24,
portal_id: this.portal_id,
encode_method: this.form.code,
urls: urls,
doc_file: this.jkwds.length != 0 ? this.jkwds[0] : ""
};
if (this.jkxy == 1) {
query.encode_method = this.form.code
}
this.$api.workbench.serviceAdd(query).then(response => {
this.fwR = false;
if (response.data.success == 1) {
......@@ -2646,6 +2743,9 @@ export default {
.gz_fhsjgs_rad {
margin-left: 10px;
}
.jkxy {
margin-left: 20px;
}
.ip_block {
border-radius: 8px;
border: solid 1px #e3e5ef;
......
......@@ -35,6 +35,25 @@ module.exports.dateFormat = function (fmt, timestamp) {
return fmt;
}
module.exports.downloadFileFormatNew = function (fileUrl) {
/*
input: /apaas/static/docs/image/images/1234_qq234ewr123.png
output: 1234.png
*/
if (fileUrl != "") {
var temp = fileUrl.split('/')[fileUrl.split('/').length - 1]
var name = temp.split('_')[0]
var type = temp.split('_')[temp.split('_').length - 1].split('.')[1]
if (temp.indexOf('_') == -1) {
return name
} else {
return name + '.' + type
}
} else {
return "";
}
}
module.exports.dateStringTransform = function (date) {
/*
input: 2020-06-12T16:38:11+08:00
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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