Commit a5651147 authored by 刘殿昕's avatar 刘殿昕

add some

parent 22d93547
......@@ -11,21 +11,21 @@ module.exports = {
assetsPublicPath: "/apaas/ui/",
proxyTable: {
"/apaas": {
target: "http://apaas.gzdata.ydeci.gz.cegn.cn:81//apaas/",
target: "https://apaas3.wodcloud.com/apaas/",
changeOrigin: true,
pathRewrite: {
"^/apaas": ""
}
},
"/awecloud": {
target: "http://apaas.gzdata.ydeci.gz.cegn.cn:81//awecloud/",
target: "https://apaas3.wodcloud.com/awecloud/",
changeOrigin: true,
pathRewrite: {
"^/awecloud": ""
}
},
"/vmap": {
target: "http://apaas.gzdata.ydeci.gz.cegn.cn:81//vmap/",
target: "https://apaas3.wodcloud.com/vmap/",
changeOrigin: true,
pathRewrite: {
"^/vmap": ""
......
......@@ -31,8 +31,8 @@
<i class="el-icon-upload"></i>
<div class="el-upload__text">
<span class="up_fz">将文件拖到此处,或</span>
<em>点击上传</em><br />
<span class="up_fz">{{ up_fz }}</span>
<em>点击上传</em>
<div class="up_fz_1">{{ up_fz }}</div>
</div>
</div>
<el-button size="small" type="primary" v-if="!drag && type == 'default'"
......@@ -130,10 +130,17 @@ export default {
var getListImg = [];
if (value && value.length != 0) {
for (var i = 0; i < value.length; i++) {
getListImg.push({
name: value[i],
url: value[i],
});
if (typeof value[i] == "string") {
getListImg.push({
name: value[i],
url: value[i],
});
} else {
getListImg.push({
name: value[i].name,
url: value[i].url,
});
}
}
}
this.fileArray = [...getListImg];
......@@ -160,7 +167,13 @@ export default {
this.$message.error("上传图片大小不能超过 10MB!");
}
return isJPG && isLt10M;
} else {
} else if (this.type == "md") {
console.log(file);
const isMd = file.name.substring(file.name.length - 3) == ".md";
if (!isMd) {
this.$message.error("上传文件只能是md格式文件!");
}
return isMd;
}
},
handleAvatarSuccess(response, file, fileList) {
......@@ -240,4 +253,10 @@ export default {
.up_fz {
color: #a9aec0;
}
.up_fz_1 {
line-height: 24px;
color: #a9aec0;
position: relative;
bottom: 6px;
}
</style>
\ No newline at end of file
......@@ -464,4 +464,43 @@ export default {
.service_info .el-input-number {
width: 128px;
}
.service_info .el-input-number .el-input-number__decrease {
top: 1px;
left: 1px;
line-height: 34px;
border-radius: 5px 0 0 5px;
border-right-width: 1px;
}
.service_info .el-input-number .el-input-number__increase {
top: 1px;
right: 1px;
line-height: 34px;
border-radius: 0 5px 5px 0;
border-left-width: 1px;
}
.service_info .el-input-number .el-input__inner {
border-width: 1px;
height: 36px;
line-height: 36px;
}
.service_info .el-input-number {
width: 128px;
line-height: 36px;
}
.service_info
.el-input-number__decrease:hover:not(.is-disabled)
~ .el-input
.el-input__inner:not(.is-disabled),
.el-input-number__increase:hover:not(.is-disabled)
~ .el-input
.el-input__inner:not(.is-disabled) {
border-color: #515fe7;
}
.service_info .el-input__inner:focus {
border-color: #515fe7;
}
.service_info .el-input-number__decrease:hover,
.el-input-number__increase:hover {
color: #515fe7;
}
</style>
......@@ -25,7 +25,12 @@
</div>
<div class="main_container-right">
<div class="service_title">
<span class="service_name" v-text="data.name"></span>
<span class="service_name">
{{ data.name }}
<span v-if="data.version && data.version != ''">
( {{ data.version }} )
</span>
</span>
<span class="service_type" v-if="data.type" v-text="data.type"></span>
<span v-if="data.openness == 1" class="tags shared">共享</span>
<span v-else-if="data.openness == 2" class="tags restricted">
......
......@@ -9,6 +9,9 @@
<div class="up_tit_name_in">
<span class="up_tit_name" :title="cellData.name">
{{ cellData.name }}
<span v-if="cellData.version && cellData.version != ''">
( {{ cellData.version }} )</span
>
</span>
</div>
<span
......@@ -51,21 +54,49 @@
{{ cellData.descript }}
</p>
<el-row :gutter="16">
<el-col :span="14" class="com_other1">
<el-col
:span="14"
class="com_other1"
:title="`服务类型:${cellData.data_service_type1_name} ${cellData.data_service_type2_name} ${cellData.data_service_type3_name}`"
>
<span class="name_title">服务类型:</span>
{{ cellData.data_service_type1_name }}
&nbsp;&nbsp;{{ cellData.data_service_type2_name }} &nbsp;&nbsp;{{
cellData.data_service_type3_name
}}
</el-col>
<el-col :span="10" class="com_other1">
<el-col
:span="10"
class="com_other1"
:title="`服务领域:${cellData.sectors_name}`"
>
<span class="name_title">服务领域:</span>
{{ cellData.sectors_name }}
</el-col>
<el-col :span="14" class="com_other">
<el-col
:span="14"
class="com_other"
:title="`更新时间:${helper.dateStringTransform(
cellData.update_date
)}`"
>
<span class="name_title">更新时间:</span>
{{ helper.dateStringTransform(cellData.update_date) }}
</el-col>
<el-col
:span="24"
v-if="urlFilter == '36'"
class="com_other1"
:title="`产品标签:${getTags}`"
>
<span class="name_title">产品标签:</span>
<span
class="card_tag"
v-for="(item, tag_index) in cellData.tags"
:key="`tg_${tag_index}`"
>{{ item }}</span
>
</el-col>
</el-row>
</div>
</div>
......@@ -79,9 +110,18 @@ export default {
props: {
url: { type: String, default: "" },
cellData: { type: Object, default: {} },
urlFilter: { type: String, default: "" },
},
data: () => ({ helper: helper }),
computed: {},
computed: {
getTags() {
let str = "";
this.cellData.tags.forEach((item) => {
str += item + " ";
});
return str;
},
},
watch: {},
methods: {
goUrl(parame) {
......@@ -97,7 +137,7 @@ export default {
<style scoped>
.com_cell {
width: 496px;
height: 208px;
/* height: 208px; */
background-color: #ffffff;
box-shadow: 0px 3px 6px 0px rgba(15, 19, 65, 0.04);
border-radius: 8px 8px 8px 8px;
......@@ -200,7 +240,7 @@ export default {
color: #e15260;
}
.com_cell_down {
padding: 12px 16px 0 16px;
padding: 12px 16px 6px 16px;
}
.com_detail {
color: #8890a7;
......@@ -231,6 +271,16 @@ export default {
.name_title {
color: #8890a7;
}
.card_tags {
display: inline-block;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.card_tag {
color: #515fe7;
margin-right: 8px;
}
</style>
<style>
.com_cell .el-rate__text {
......
......@@ -14,6 +14,7 @@
:cellData="item"
:url="url"
:key="item.id"
:urlFilter="urlFilter"
></commodity-cell>
</div>
<!-- 分页 -->
......
......@@ -92,6 +92,10 @@ export default {
item.active = "shop_ic_yysd_sel";
item.default = "shop_ic_yysd";
break;
case "products_list":
item.active = "shop_nav_iv_chanpinzy_pre";
item.default = "shop_nav_iv_chanpinzy";
break;
default:
item.active = "1";
item.default = "1";
......
......@@ -33,11 +33,19 @@
<table class="xq_table">
<tr>
<td>数据领域:{{ item.value.sectors_name }}</td>
<td>服务类型:{{ item.value.data_service_type1_name }}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.value.data_service_type2_name }}</td>
<td>
服务类型:{{
item.value.data_service_type1_name
}}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.value.data_service_type2_name }}
</td>
</tr>
<tr>
<td>发布时间:{{ helper.dateStringTransform(item.value.create_time) }}</td>
<td>更新时间:{{ helper.dateStringTransform(item.value.update_date) }}</td>
<td>
发布时间:{{ helper.dateStringTransform(item.value.create_time) }}
</td>
<td>
更新时间:{{ helper.dateStringTransform(item.value.update_date) }}
</td>
</tr>
<tr>
<td>请求方式:{{ item.value.req_type }}</td>
......@@ -57,6 +65,27 @@
</tr>
</table>
</div>
<div v-else-if="item.type == 'cp-list'">
<table class="xq_table">
<tr>
<td>产品领域:{{ item.value.cp_area }}</td>
<td>
发布时间:{{ helper.dateStringTransform(item.value.fb_time) }}
</td>
</tr>
<tr>
<td>所属业务系统:<a :href="item.value.org_url" target="blank">{{ item.value.org }}</a></td>
<td class="tags" :title="`产品标签:${getTags(item.value.tags)}`">
产品标签:<span
class="tag_sp"
v-for="(item, tag_index) in item.value.tags"
:key="`tag_${tag_index}`"
>{{ item }}</span
>
</td>
</tr>
</table>
</div>
<workflows-view
v-else-if="item.type == 'workflows'"
:id="item.value"
......@@ -119,9 +148,19 @@ export default {
},
data() {
return {
helper
}
}
helper,
};
},
computed: {},
methods: {
getTags(arr) {
let str = "";
arr.forEach((item) => {
str += item + " ";
});
return str;
},
},
};
</script>
......@@ -201,4 +240,12 @@ export default {
.xq_table tbody > tr:last-child > td {
border-bottom-width: 0;
}
.tags {
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.tag_sp {
margin-right: 8px;
}
</style>
<template>
<div class="sevice_detail">
<div class="apass_breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item to="/shop">服务超市</el-breadcrumb-item>
<el-breadcrumb-item to="/shop/data_service_list/5">
数据服务
</el-breadcrumb-item>
<el-breadcrumb-item>服务详情信息</el-breadcrumb-item>
</el-breadcrumb>
</div>
<service-info :data="baseInfo" v-if="baseInfo"></service-info>
<service-tabs
:detail-data="detailData"
:provider-data="providerData"
:comments-data="commentsData"
:comments-url="commentsUrl"
></service-tabs>
</div>
</template>
<script>
import serviceInfo from "@/components/service-info/service-info";
import serviceTabs from "@/components/service-tabs/service-tabs";
export default {
components: {
serviceInfo,
serviceTabs,
},
data: () => ({
baseInfo: null,
detailData: null,
providerData: null,
commentsData: null,
}),
computed: {
id() {
return this.$route.params.id;
},
commentsUrl() {
return `/apaas/serviceapp/v3/servicemarket/estimates?serviceId=${this.id}`;
},
},
methods: {
init() {
this.$http
.get("/apaas/serviceapp/v3/servicemarket/detail", {
params: {
serviceId: this.id,
},
})
.then(({ data }) => {
let datas = data.data;
this.baseInfo = {
service_id: this.id,
app_id: 0,
name: datas.name,
// type: "",
openness: datas.openness,
view_count: datas.view_count,
apply_count: datas.apply_count,
cover: datas.cover,
organization_name: datas.organization_name,
create_time: datas.create_time,
update_date: datas.update_date,
sectors_name: datas.sectors_name,
data_service_type: [
datas.data_service_type1_name,
datas.data_service_type2_name,
datas.data_service_type3_name,
],
descript: datas.descript,
serviceRequestSpcs: datas.serviceRequestSpcs || {
spcs_type_1: [],
spcs_type_2: [],
},
scoreDetail: datas.scoreDetail,
month_sale: datas.month_sale,
version: datas.version,
};
this.detailData = [
{
name: "获取流程",
type: "step",
value: ["产品申请", "信息填写", "审核确认", "获取资源"],
},
{
name: "产品信息",
type: "cp-list",
value: {
cp_area: datas.sectors_name,
fb_time: datas.create_time,
org: datas.system_name,
org_url: datas.domain_name,
tags: datas.tags,
},
},
{
name: "产品详情",
type: "rich-text",
value: "",
},
];
if (datas.doc_file != "") {
this.getMd(datas.doc_file);
}
let arr1 = datas.serviceRequestSpcs.spcs_type_1 || [];
let arr2 = datas.serviceRequestSpcs.spcs_type_2 || [];
let arr = arr1.concat(arr2);
arr.map((item) => {
item.type = item.spcs_type == 1 ? "计次收费规格" : "时长收费规格";
item.spce =
item.spcs_type == 1
? `${item.money}金币/${item.spcs_count}次(${(
item.money / item.spcs_count
).toFixed(2)}金币/1次)`
: `${item.money}金币/月(次数不限)`;
item.times = item.spcs_type == 1 ? "不限时长" : "按月";
});
this.providerData = {
organization_name: datas.organization_name,
picture_path: datas.organization_picture,
user_name: datas.register_user_info.user_name,
phone: datas.register_user_info.phone,
serviceRequestSpcsTable: arr,
};
this.commentsData = datas.scoreDetail;
})
.catch(function (error) {
console.log(error);
});
},
getTableData(tableStr) {
let tabledata = (tableStr && JSON.parse(tableStr)) || [];
let addRowId = (data, baseId = "") => {
data.forEach((item, index) => {
let rowId = baseId + (index + 1) + "";
item.rowId = rowId;
if (item.children && item.children.length) {
addRowId(item.children, rowId);
}
});
};
addRowId(tabledata);
return tabledata;
},
getMd(url) {
this.$http
.get(url, {
params: {
serviceId: this.id,
},
})
.then(response => {
this.detailData[2].value = response.data;
})
.catch(function (error) {
console.log(error);
});
}
},
mounted() {
this.init();
},
};
</script>
......@@ -180,7 +180,7 @@ export default {
app_data.duration * parseFloat(data.price) + "金币";
this.service_arr[0]["isMg"] = false;
this.service_arr[0]["isapp"] = true;
console.log(data, this.service_arr)
console.log(data, this.service_arr);
this.all_cost = app_data.duration * parseFloat(data.price);
}
});
......@@ -216,7 +216,7 @@ export default {
objs.auth = data.organization_name;
objs.size = "";
objs.count = "";
let request_spcs_info = data.request_spcs_info||[]
let request_spcs_info = data.request_spcs_info || [];
request_spcs_info.forEach((el) => {
if (service_data.spec_id == el.id) {
let size = "";
......@@ -242,10 +242,12 @@ export default {
objs.applytype =
"申请方式:" + (service_data.duration_unit == 1 ? "" : "");
objs.isMg = data.openness == 3;
objs.data = JSON.parse(data.res_fields);
if (data.data_service_type1 != 36) {
objs.data = JSON.parse(data.res_fields);
}
objs.isapp = false;
this.service_arr = [objs];
console.log(this.service_arr);
console.log(objs, this.service_arr);
} else {
this.$message.error(response.data.errMsg);
}
......@@ -456,7 +458,7 @@ export default {
this.service_arr[l]["isMg"] = e.service.openness == 3;
this.service_arr[l]["data"] = e.service.res_fields
? JSON.parse(e.service.res_fields)
: "[]";
: [];
console.log(this.service_arr[l]["data"]);
this.service_arr[l]["isapp"] = false;
}
......
......@@ -76,6 +76,12 @@ export default {
this.url = "/shop/yysdDetail";
this.filterNames = ["应用类型", "应用领域", "应用来源机构"];
break;
case "products_list":
this.name = "产品资源";
this.urlFilter = "36";
this.url = "/shop/cpDetail";
this.filterNames = ["产品类型", "产品领域", "产品来源组织"];
break;
default:
this.name = "";
this.urlFilter = "";
......
......@@ -11,7 +11,7 @@
<div
v-for="(item, index) in service_arr"
:key="index + 1000"
class="type_select"
:class="item == '' ? '' : 'type_select'"
@click="now_service = index"
:style="
now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {}
......@@ -105,7 +105,9 @@
v-else
:list_arr="
now_service == 0
? list_arr
? data_service_type1 == 36
? cp_arr
: list_arr
: now_service == 1
? servicead_arr
: apply_arr
......@@ -514,6 +516,7 @@ export default {
},
],
service_arr: ["服务基本信息", "接口详细信息", "申请审批信息"],
data_service_type1: "",
service_header_arr: {
id: "",
isMap: false,
......@@ -581,6 +584,37 @@ export default {
info: "",
},
],
cp_arr: [
{
title: "产品简介:",
info: "",
},
{
title: "产品领域:",
info: "",
},
{
title: "产品标签:",
info: "",
},
{
title: "所属组织:",
info: "",
},
{
title: "开放程度:",
info: "",
},
{
title: "注册发布时间:",
info: "",
},
{
title: "产品详情:",
type: "solt",
solt_name: "cp_md",
},
],
servicead_arr: [
{
title: "请求方式:",
......@@ -618,19 +652,19 @@ export default {
},
{
title: "场景描述:",
info: "申请mapvideos服务用于贵州省疫情监控决策指挥系统。",
info: "",
},
{
title: "调用业务系统:",
info: "决策指挥系统",
info: "",
},
{
title: "业务系统域名:",
info: "https://apaas.wodcloud.com/",
info: "",
},
{
title: "申请文件:",
info: "mapvideos申请书.docx",
info: "",
type: "down",
},
{
......@@ -897,6 +931,34 @@ export default {
.replace("Z", "")
.split("+")[0]
);
this.$set(this.cp_arr[0], "info", data.descript);
this.$set(this.cp_arr[1], "info", data.sectors_name);
let strtags = "";
if (data.tags && data.tags.length != 0) {
data.tags.forEach((item) => {
strtags += item + " ";
});
}
this.$set(this.cp_arr[2], "info", strtags);
this.$set(this.cp_arr[3], "info", data.organization_name);
this.$set(this.cp_arr[4], "info", data.openness_name);
this.$set(
this.cp_arr[5],
"info",
data.create_time == "0001-01-01T00:00:00Z"
? "-"
: data.create_time
.replace("T", " ")
.replace("Z", "")
.split("+")[0]
);
this.data_service_type1 = data.data_service_type1;
if (this.data_service_type1 == "36") {
this.service_arr[0] = "产品基本信息";
this.service_arr[1] = "";
this.service_arr[2] = "申请审批信息";
this.getMd(data.doc_file);
}
this.$set(
this.servicead_arr[0],
"info",
......
......@@ -19,20 +19,32 @@
<div
v-for="(item, index) in service_arr[now_user]"
:key="index + 1000"
class="type_select"
:class="item == '' ? '' : 'type_select'"
@click="now_service = index"
:style="
now_service == index ? { borderBottom: '4px solid #f5ab4c' } : {}
"
v-if="index<3||in_origin_ser"
v-if="index < 3 || in_origin_ser"
>
{{ item }}
</div>
</div>
<div class="type_box_select">
<info-list
:list_arr="now_service == 0 ? list_arr : servicead_arr"
v-if="now_service == 0 || (now_service == 1&&!workflows_id&&!perception_in&&!process_in_up)"
:list_arr="
now_service != 0
? servicead_arr
: data_service_type1 == '36'
? cp_arr
: list_arr
"
v-if="
now_service == 0 ||
(now_service == 1 &&
!workflows_id &&
!perception_in &&
!process_in_up)
"
>
<table-um
:headers="req_header_arr"
......@@ -40,29 +52,61 @@
:stripe="true"
slot="req_table"
></table-um>
<v-apaas-code :datas="req_code_arr" slot="req_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="req_code_arr"
slot="req_code"
:readOnly="true"
></v-apaas-code>
<table-um
:headers="res_header_arr"
:datas="res_data"
:stripe="true"
slot="res_table"
></table-um>
<v-apaas-code :datas="res_code_arr" slot="res_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="res_code_arr"
slot="res_code"
:readOnly="true"
></v-apaas-code>
<mavon-editor
slot="cp_md"
v-model="cp_arr[6].item"
:boxShadow="false"
:toolbarsFlag="false"
:subfield="false"
defaultOpen="preview"
:editable="false"
/>
</info-list>
<p v-if="now_service == 1&&(workflows_id&&!process_in_up)">
<p v-if="now_service == 1 && workflows_id && !process_in_up">
流程服务接口说明见文档中心流程服务接口文档
</p>
<info-list :list_arr="process_in_up_arr" v-if="now_service == 1&&!workflows_id&&process_in_up">
<info-list
:list_arr="process_in_up_arr"
v-if="now_service == 1 && !workflows_id && process_in_up"
>
<div slot="service_port" class="service_port">
<el-select v-model="port_select" placeholder="" @change="change_port">
<el-select
v-model="port_select"
placeholder=""
@change="change_port"
>
<el-option
v-for="item in port_options"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
<div class="port_bg_box" style="padding:20px;background-color:#f8f9fd;margin-top:10px;">
<div
class="port_bg_box"
style="
padding: 20px;
background-color: #f8f9fd;
margin-top: 10px;
"
>
<info-list :list_arr="port_solt_arr">
<table-um
:headers="req_solt_header_arr"
......@@ -70,46 +114,99 @@
:stripe="true"
slot="request_table"
></table-um>
<v-apaas-code :datas="req_solt_code_arr" slot="request_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="req_solt_code_arr"
slot="request_code"
:readOnly="true"
></v-apaas-code>
<table-um
:headers="res_solt_header_arr"
:datas="res_solt_data"
:stripe="true"
slot="response_table"
></table-um>
<v-apaas-code :datas="res_solt_code_arr" slot="response_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="res_solt_code_arr"
slot="response_code"
:readOnly="true"
></v-apaas-code>
</info-list>
</div>
</div>
</info-list>
<info-list :list_arr="gz_solt_arr" v-if="now_service == 1&&perception_in">
<info-list
:list_arr="gz_solt_arr"
v-if="now_service == 1 && perception_in"
>
<table-um
:headers="req_gz_header_arr"
:datas="req_gz_solt_data"
:stripe="true"
slot="request_table"
></table-um>
<v-apaas-code :datas="req_solt_code_arr" slot="request_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="req_solt_code_arr"
slot="request_code"
:readOnly="true"
></v-apaas-code>
<table-um
:headers="res_gz_header_arr"
:datas="res_gz_solt_data"
:stripe="true"
slot="response_table"
></table-um>
<v-apaas-code :datas="res_solt_code_arr" slot="response_code" :readOnly="true"></v-apaas-code>
<v-apaas-code
:datas="res_solt_code_arr"
slot="response_code"
:readOnly="true"
></v-apaas-code>
</info-list>
<div v-show="now_service == 2">
<p class="service_title"><span></span>服务运行概况</p>
<div class="service_port" style="margin-bottom:20px;" v-if="process_in_up">
<el-select v-model="port_select_server" placeholder="" ref="select_icon" @change="iconChange">
<div
class="service_port"
style="margin-bottom: 20px"
v-if="process_in_up"
>
<el-select
v-model="port_select_server"
placeholder=""
ref="select_icon"
@change="iconChange"
>
<el-option
v-for="item in port_options"
:key="item.value"
:label="item.label"
:value="item.value+','+item.able">
<span v-if="!item.able" :style="{display:'inline-block',marginRight:'8px',width:'36px',height:'18px',marginLeft:'-10px',borderRadius:'4px',backgroundColor:'#e15260',lineHeight:'18px',textAlign:'center'}">故障</span>
<span v-else :style="{display:'inline-block',marginRight:'8px',width:'36px',height:'18px',borderRadius:'4px',marginLeft:'-10px',}"></span>
{{item.label}}
:value="item.value + ',' + item.able"
>
<span
v-if="!item.able"
:style="{
display: 'inline-block',
marginRight: '8px',
width: '36px',
height: '18px',
marginLeft: '-10px',
borderRadius: '4px',
backgroundColor: '#e15260',
lineHeight: '18px',
textAlign: 'center',
}"
>故障</span
>
<span
v-else
:style="{
display: 'inline-block',
marginRight: '8px',
width: '36px',
height: '18px',
borderRadius: '4px',
marginLeft: '-10px',
}"
></span>
{{ item.label }}
</el-option>
</el-select>
</div>
......@@ -117,13 +214,17 @@
<div class="service_title_card">
<nor-card title="服务状态" class="service_card">
<template>
<div style="height:115px;padding-top:10px;">
<div style="height: 115px; padding-top: 10px">
<waveIcon
:state="yx_state.state"
style="margin:10px auto;"
style="margin: 10px auto"
></waveIcon>
<p
style="color: #58617a;font-size: 16px;text-align:center;"
style="
color: #58617a;
font-size: 16px;
text-align: center;
"
>
{{ yx_state.state }}
</p>
......@@ -132,7 +233,7 @@
</nor-card>
<nor-card title="平均响应时间" class="service_card">
<template>
<div style="height:115px;" class="service_num">
<div style="height: 115px" class="service_num">
<p>{{ yx_state.averageTime }}</p>
<p>最大响应时间:{{ yx_state.maxTime }}</p>
</div>
......@@ -140,7 +241,7 @@
</nor-card>
<nor-card title="吞吐率" class="service_card">
<template>
<div style="height:115px;" class="service_num">
<div style="height: 115px" class="service_num">
<p>{{ yx_state.averageTraffic }}</p>
<p>最大吞吐率:{{ yx_state.maxTraffic }}</p>
</div>
......@@ -149,7 +250,7 @@
<nor-card title="资源使用" class="service_card">
<template>
<div
style="height:115px;padding-top:30px;"
style="height: 115px; padding-top: 30px"
class="service_num"
>
<p>{{ yx_state.memory }}</p>
......@@ -163,7 +264,7 @@
</div>
<p class="service_title"><span></span>服务调用列表</p>
<table-um
v-if="!process_in_up&&!perception_in"
v-if="!process_in_up && !perception_in"
:headers="header_use_arr"
:datas="service_use_arr"
></table-um>
......@@ -187,7 +288,7 @@
></list-pagination>
</div>
<div v-show="now_service == 3">
<p style="color: #8890a7;">服务规格:</p>
<p style="color: #8890a7">服务规格:</p>
<table-um
:stripe="true"
:headers="service_size_arr"
......@@ -212,7 +313,7 @@
</div>
<p
v-if="now_user == 1 && sizeset_flag"
style="color: #8890a7;margin-bottom:10px;"
style="color: #8890a7; margin-bottom: 10px"
>
规格设置:
</p>
......@@ -257,25 +358,25 @@
<div slot="trans_all" class="trans_all">
<div class="trans_box">
<div class="trans_middle">
<img src="../../../assets/imgs/ic_shouyizonge.png" alt="">
<img src="../../../assets/imgs/ic_shouyizonge.png" alt="" />
<p>服务收益总额</p>
<p>{{trans_all_obj.all}} </p>
<p>{{ trans_all_obj.all }}</p>
<span>金币</span>
</div>
</div>
<div class="trans_box">
<div class="trans_middle">
<img src="../../../assets/imgs/ic_jiaoyizs.png" alt="">
<img src="../../../assets/imgs/ic_jiaoyizs.png" alt="" />
<p>交易总数</p>
<p>{{trans_all_obj.times}} </p>
<p>{{ trans_all_obj.times }}</p>
<span></span>
</div>
</div>
<div class="trans_box">
<div class="trans_middle">
<img src="../../../assets/imgs/ic_yuejiaoyi.png" alt="">
<img src="../../../assets/imgs/ic_yuejiaoyi.png" alt="" />
<p>本月交易总数</p>
<p>{{trans_all_obj.month}} </p>
<p>{{ trans_all_obj.month }}</p>
<span></span>
</div>
</div>
......@@ -299,7 +400,7 @@
</div>
</div>
</div>
<dialog-action ref="myConfirm"></dialog-action>
</div>
</template>
......@@ -332,9 +433,9 @@ export default {
data() {
return {
now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员
process_in_up:false,//是否是服务注册产生的流程服务
perception_in:false,//是否是感知服务
in_origin_ser:false,//是否是组织内部的服务
process_in_up: false, //是否是服务注册产生的流程服务
perception_in: false, //是否是感知服务
in_origin_ser: false, //是否是组织内部的服务
buy_style: [1],
// editstr:'<h1>1221312</h1>wuqwyequ827812731731',
listTotal: 0,
......@@ -346,7 +447,7 @@ export default {
pageSizes: [10, 20, 50],
responseParamUrl: "",
codeExampleUrl: "",
port_select_server:'',
port_select_server: "",
yx_state: {
state: "",
averageTime: "",
......@@ -355,35 +456,35 @@ export default {
maxTraffic: "",
memory: "",
},
port_select:'',
port_select: "",
service_use_arr: [],
req_solt_data:[],
res_solt_data:[],
req_gz_solt_data:[],
res_gz_solt_data:[],
service_gz_process_arr:[],
trans_all_obj:{
all:0,
times:0,
month:0,
req_solt_data: [],
res_solt_data: [],
req_gz_solt_data: [],
res_gz_solt_data: [],
service_gz_process_arr: [],
trans_all_obj: {
all: 0,
times: 0,
month: 0,
},
trans_log_arr:[
trans_log_arr: [
{
title: "服务交易概览",
info: "",
prop:'title',
prop: "title",
type: "solt",
solt_name: "trans_all",
},
{
title: "服务交易记录",
info: "",
prop:'title',
prop: "title",
type: "solt",
solt_name: "trans_log",
},
],
trans_log_header:[
trans_log_header: [
{
prop: "department_name",
label: "申请单位",
......@@ -427,7 +528,7 @@ export default {
align: "center",
},
],
trans_log_data:[],
trans_log_data: [],
res_solt_header_arr: [
{
prop: "name",
......@@ -632,15 +733,27 @@ export default {
], // 响应参数-header
res_data: [], // 响应参数
res_code_arr: "", // 响应示例
req_solt_code_arr:'11',
res_solt_code_arr:'11',
req_solt_code_arr: "11",
res_solt_code_arr: "11",
buy_type: "",
workflows_id:'',//判断是否是流程服务
workflows_id: "", //判断是否是流程服务
sizeset_flag: false, //规格设置是否显示
service_arr: [
["服务基本信息", "接口详细信息", "服务运行状态"],
["服务基本信息", "接口详细信息", "服务运行状态", "服务计费规则","服务交易记录"],
["服务基本信息", "接口详细信息", "服务运行状态", "服务规格","服务交易记录"],
[
"服务基本信息",
"接口详细信息",
"服务运行状态",
"服务计费规则",
"服务交易记录",
],
[
"服务基本信息",
"接口详细信息",
"服务运行状态",
"服务规格",
"服务交易记录",
],
],
service_size_data: [], //服务规格数组
service_header_arr: {
......@@ -814,9 +927,9 @@ export default {
label: "调用时间",
minWidth: "20%",
align: "center",
}
},
],
service_process_arr:[],
service_process_arr: [],
service_size_arr: [
{
prop: "index",
......@@ -852,20 +965,23 @@ export default {
edit_size_arr: [
{
prop: "spcs_type",
label: '规格类型<span title="计次收费规格:仅依据服务调用次数进行收费,不限时长。&#10;时长收费规格:按月为时间单位进行收费,每月使用次数不限。"><img style="margin-left:5px;vertical-align:-3px;" src="'+require('../../../assets/imgs/money_table_ico.png')+'" alt=""></span>',
label:
'规格类型<span title="计次收费规格:仅依据服务调用次数进行收费,不限时长。&#10;时长收费规格:按月为时间单位进行收费,每月使用次数不限。"><img style="margin-left:5px;vertical-align:-3px;" src="' +
require("../../../assets/imgs/money_table_ico.png") +
'" alt=""></span>',
width: "180px",
align: "center",
type: "select",
selectArr:[
selectArr: [
{
label:'计次收费规格',
value:1
label: "计次收费规格",
value: 1,
},
{
label:'时长收费规格',
value:2
}
]
label: "时长收费规格",
value: 2,
},
],
},
{
prop: "money",
......@@ -876,7 +992,10 @@ export default {
},
{
prop: "pv",
label: '调用次数<span title="该规格提供的服务调用次数。"><img style="margin-left:5px;vertical-align:-3px;" src="'+require('../../../assets/imgs/money_table_ico.png')+'" alt=""></span>',
label:
'调用次数<span title="该规格提供的服务调用次数。"><img style="margin-left:5px;vertical-align:-3px;" src="' +
require("../../../assets/imgs/money_table_ico.png") +
'" alt=""></span>',
width: "150px",
align: "center",
type: "input",
......@@ -891,14 +1010,14 @@ export default {
prop: "time",
label: "时长",
width: "150px",
align: "left"
align: "left",
},
{
prop: "descript",
label: "规格说明",
minWidth: "33.33%",
align: "left",
type:'input'
type: "input",
},
{
label: "操作",
......@@ -949,7 +1068,7 @@ export default {
solt_name: "res_code",
},
],
process_in_up_arr:[
process_in_up_arr: [
{
title: "接口文档:",
info: "",
......@@ -961,9 +1080,9 @@ export default {
info: "",
type: "solt",
solt_name: "service_port",
}
},
],
port_solt_arr:[
port_solt_arr: [
{
title: "服务地址:",
info: "",
......@@ -1001,7 +1120,7 @@ export default {
solt_name: "response_code",
},
],
gz_solt_arr:[
gz_solt_arr: [
{
title: "请求方式:",
info: "12123",
......@@ -1035,7 +1154,7 @@ export default {
solt_name: "response_code",
},
],
port_options:[],
port_options: [],
service_type_arr: [
"数据服务",
"时空服务",
......@@ -1084,6 +1203,38 @@ export default {
info: "",
},
],
cp_arr: [
{
title: "产品简介:",
info: "",
},
{
title: "产品领域:",
info: "",
},
{
title: "产品标签:",
info: "",
},
{
title: "所属组织:",
info: "",
},
{
title: "开放程度:",
info: "",
},
{
title: "注册发布时间:",
info: "",
},
{
title: "产品详情:",
type: "solt",
solt_name: "cp_md",
},
],
data_service_type1: ""
};
},
computed: {
......@@ -1095,15 +1246,15 @@ export default {
if (n == 2) {
this.getData();
}
}
},
},
created() {
if (this.userInfo) {
this.now_user = this.level;
if(this.now_user==1||this.now_user==2){
this.in_origin_ser = true
}else{
this.in_origin_ser = false
if (this.now_user == 1 || this.now_user == 2) {
this.in_origin_ser = true;
} else {
this.in_origin_ser = false;
}
} else {
this.getCurrentUser();
......@@ -1114,16 +1265,16 @@ export default {
},
mounted() {},
methods: {
change_port(val){
this.port_options.forEach(e => {
if(e.value == val){
this.$set(this.port_solt_arr[0],'info',e.value)
this.$set(this.port_solt_arr[1],'info',e.req_type)
this.$set(this.port_solt_arr[2],'info',e.encode_method)
this.req_solt_data = e.req_fields
this.res_solt_data = e.res_fields
this.req_solt_code_arr = e.req_fields_example
this.res_solt_code_arr = e.res_fields_example
change_port(val) {
this.port_options.forEach((e) => {
if (e.value == val) {
this.$set(this.port_solt_arr[0], "info", e.value);
this.$set(this.port_solt_arr[1], "info", e.req_type);
this.$set(this.port_solt_arr[2], "info", e.encode_method);
this.req_solt_data = e.req_fields;
this.res_solt_data = e.res_fields;
this.req_solt_code_arr = e.req_fields_example;
this.res_solt_code_arr = e.res_fields_example;
}
});
},
......@@ -1135,7 +1286,7 @@ export default {
transchangePageSize(value) {
this.transpageSize = value;
this.transcurrentPage = 1;
this.get_trans_data()
this.get_trans_data();
},
changeCurrentPage(value) {
this.currentPage = value;
......@@ -1143,33 +1294,35 @@ export default {
},
transchangeCurrentPage(value) {
this.transcurrentPage = value;
this.get_trans_data()
this.get_trans_data();
},
iconChange (val) {
iconChange(val) {
// el-select实际上是两层div包裹的input
this.port_select_server = val;
// 获取当前el-select标签第一层div
const dom = this.$refs['select_icon'].$el;
if(dom.children[0].children[0].tagName == 'SPAN'){
dom.children[0].children[0].remove()
const dom = this.$refs["select_icon"].$el;
if (dom.children[0].children[0].tagName == "SPAN") {
dom.children[0].children[0].remove();
}
// 创建需要添加到其中的标签 并填充内容
const svgDom = document.createElement('span'); // ('<svg-icon ref="iconRef" icon-class="' + val + '" style="float: left;width: 3%;height: 30px;border: 1px solid #dcdfe6;border-right:none;" />');
svgDom.setAttribute('class', 'el-input__prefix');
if(val.split(',')[1]=='true'){
svgDom.innerHTML = '<span class="el-input__prefix-inner" style="margin-top:15px;margin-left:10px;display:inline-block;width:0px;height:18px;border-radius:4px;"></span>';
}else{
svgDom.innerHTML = '<span class="el-input__prefix-inner" style="margin-top:10px;margin-left:10px;display:inline-block;width:36px;color:#fff;height:18px;border-radius:4px;background-color:#e15260;">故障</span>';
const svgDom = document.createElement("span"); // ('<svg-icon ref="iconRef" icon-class="' + val + '" style="float: left;width: 3%;height: 30px;border: 1px solid #dcdfe6;border-right:none;" />');
svgDom.setAttribute("class", "el-input__prefix");
if (val.split(",")[1] == "true") {
svgDom.innerHTML =
'<span class="el-input__prefix-inner" style="margin-top:15px;margin-left:10px;display:inline-block;width:0px;height:18px;border-radius:4px;"></span>';
} else {
svgDom.innerHTML =
'<span class="el-input__prefix-inner" style="margin-top:10px;margin-left:10px;display:inline-block;width:36px;color:#fff;height:18px;border-radius:4px;background-color:#e15260;">故障</span>';
}
// 将创建的标签添加到父节点(第二层div)
dom.children[0].appendChild(svgDom);
// 得到el-select中的input标签
const inputDom = dom.children[0].children[0];
inputDom.setAttribute('style', 'padding-left: 60px;');
inputDom.setAttribute("style", "padding-left: 60px;");
// 将添加的标签放到input前面
dom.children[0].insertBefore(svgDom, inputDom);
this.getData()
this.getData();
},
get_use_list() {
this.service_use_arr = [];
......@@ -1195,16 +1348,23 @@ export default {
? `访问次数:${e.request_spcs.count}/日 访问量:${e.request_spcs.pv}/日`
: "",
sqsc: e.duration + ["", "个月", ""][e.duration_unit || 0],
jkmc:e.req_name||'',
jkdz:e.req_url||'',
state:(e.req_status||e.req_status==0)?e.req_status==-1?'失败':'成功':'',
time:e.last_request_time?e.last_request_time.split("+")[0].replace("T", " "):'-',
count:e.req_num||'-'
jkmc: e.req_name || "",
jkdz: e.req_url || "",
state:
e.req_status || e.req_status == 0
? e.req_status == -1
? "失败"
: "成功"
: "",
time: e.last_request_time
? e.last_request_time.split("+")[0].replace("T", " ")
: "-",
count: e.req_num || "-",
});
});
}
})
.catch(function(response) {});
.catch(function (response) {});
},
change_buy(val) {
if (this.buy_style.indexOf(val) !== -1) {
......@@ -1218,10 +1378,10 @@ export default {
if (data.success == 1) {
this.$store.commit("userInfofun", data.data);
this.now_user = this.level;
if(this.now_user==1||this.now_user==2){
this.in_origin_ser = true
}else{
this.in_origin_ser = false
if (this.now_user == 1 || this.now_user == 2) {
this.in_origin_ser = true;
} else {
this.in_origin_ser = false;
}
console.log(this.level);
} else {
......@@ -1230,35 +1390,38 @@ export default {
});
},
getData() {
console.log(this.namespace)
this.$api.workbench.getServiceRunningTopology({ namespace: this.namespace }).then((response) => {
this.datas = response.data.elements;
});
console.log(this.namespace);
this.$api.workbench
.getServiceRunningTopology({ namespace: this.namespace })
.then((response) => {
this.datas = response.data.elements;
});
},
get_trans_data(){
get_trans_data() {
this.$http
.get(
`/apaas/service/v3/service/manager/service/trade/list?page=${this.currentPage}&size=${this.pageSize}&service_id=${this.$route.params.id}`
).then(res=>{
)
.then((res) => {
console.log(res);
// listTotal: 0,
if(res.data.success){
this.translistTotal = res.data.data.total
var temp = res.data.data.list||[]
temp.forEach(e => {
if(e.spcs_type==1){
e.duration_name = '不限时长'
e.gg = `${e.spcs_count}次/ ${e.single_money} 元`
}else if(e.spcs_type==2){
e.duration_name = e.duration+''
e.gg = `${e.single_money} 元/月`
if (res.data.success) {
this.translistTotal = res.data.data.total;
var temp = res.data.data.list || [];
temp.forEach((e) => {
if (e.spcs_type == 1) {
e.duration_name = "不限时长";
e.gg = `${e.spcs_count}次/ ${e.single_money} 元`;
} else if (e.spcs_type == 2) {
e.duration_name = e.duration + "";
e.gg = `${e.single_money} 元/月`;
}
e.trade_times = helper.dateStringTransform(e.trade_time);
e.total_moneys = e.total_money + "金币";
});
this.trans_log_data = temp
this.trans_log_data = temp;
}
})
});
},
getServiceInfo() {
this.$http
......@@ -1270,13 +1433,17 @@ export default {
if (response.data.success === 1) {
let data = response.data.data;
this.namespace = data.urls[0].namespace;
if(data.workflows_id){
this.workflows_id = data.workflows_id
}else{
this.workflows_id = false
if (data.workflows_id) {
this.workflows_id = data.workflows_id;
} else {
this.workflows_id = false;
}
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(
this.service_header_arr,
"workflows_id",
data.workflows_id
); // 时空服务id
this.$set(
this.service_header_arr,
"isMap",
......@@ -1322,69 +1489,116 @@ export default {
"fixedurl",
this.$route.path.replace("servicedetail", "serviceedit")
);
this.trans_all_obj={
all:data.sale_total_money,
times:data.sale_total,
month:data.sale_month_total,
}
this.trans_all_obj = {
all: data.sale_total_money,
times: data.sale_total,
month: data.sale_month_total,
};
//判断是否是服务注册出来的流程服务
if(data.data_service_type2 == 24&&data.workflows_id==0){
this.process_in_up = true
this.$set(this.process_in_up_arr[0],'info',data.doc_file.split('/')[data.doc_file.split('/').length-1])
this.$set(this.process_in_up_arr[0],'url',data.doc_file)
var temp_port_arr = []
data.urls.forEach(e => {
if (data.data_service_type2 == 24 && data.workflows_id == 0) {
this.process_in_up = true;
this.$set(
this.process_in_up_arr[0],
"info",
data.doc_file.split("/")[data.doc_file.split("/").length - 1]
);
this.$set(this.process_in_up_arr[0], "url", data.doc_file);
var temp_port_arr = [];
data.urls.forEach((e) => {
temp_port_arr.push({
label:e.req_name,
value:e.req_url,
able:e.state==-1?false:true,
...e
})
label: e.req_name,
value: e.req_url,
able: e.state == -1 ? false : true,
...e,
});
});
this.port_options = temp_port_arr
if(this.port_options[0]){
this.port_select = this.port_options[0].value
this.$set(this.port_solt_arr[0],'info',this.port_options[0].value)
this.$set(this.port_solt_arr[1],'info',this.port_options[0].req_type)
this.$set(this.port_solt_arr[2],'info',this.port_options[0].encode_method)
this.req_solt_data = this.port_options[0].req_fields
this.res_solt_data = this.port_options[0].res_fields
this.req_solt_code_arr = this.port_options[0].req_fields_example
this.res_solt_code_arr = this.port_options[0].res_fields_example
this.port_options = temp_port_arr;
if (this.port_options[0]) {
this.port_select = this.port_options[0].value;
this.$set(
this.port_solt_arr[0],
"info",
this.port_options[0].value
);
this.$set(
this.port_solt_arr[1],
"info",
this.port_options[0].req_type
);
this.$set(
this.port_solt_arr[2],
"info",
this.port_options[0].encode_method
);
this.req_solt_data = this.port_options[0].req_fields;
this.res_solt_data = this.port_options[0].res_fields;
this.req_solt_code_arr = this.port_options[0].req_fields_example;
this.res_solt_code_arr = this.port_options[0].res_fields_example;
}
}else{
this.process_in_up = false
} else {
this.process_in_up = false;
}
if(data.service_data_type_1 == 10){
this.perception_in = true
this.$set(this.gz_solt_arr[0],'info',data.urls[0].req_url)
this.$set(this.gz_solt_arr[1],'info',data.urls[0].encode_method)
this.req_gz_solt_data = data.urls[0].req_fields
this.res_gz_solt_data = data.urls[0].res_fields
this.req_solt_code_arr = data.urls[0].req_fields_example
this.res_solt_code_arr = data.urls[0].res_fields_example
}else{
this.perception_in = false
if (data.service_data_type_1 == 10) {
this.perception_in = true;
this.$set(this.gz_solt_arr[0], "info", data.urls[0].req_url);
this.$set(
this.gz_solt_arr[1],
"info",
data.urls[0].encode_method
);
this.req_gz_solt_data = data.urls[0].req_fields;
this.res_gz_solt_data = data.urls[0].res_fields;
this.req_solt_code_arr = data.urls[0].req_fields_example;
this.res_solt_code_arr = data.urls[0].res_fields_example;
} else {
this.perception_in = false;
}
console.log(this.process_in_up,this.perception_in);
this.get_trans_data()
if(this.process_in_up){
var temp_sj = this.service_header_arr.first.pop()
this.service_header_arr.second = []
this.service_header_arr.second.push(temp_sj)
console.log(this.process_in_up, this.perception_in);
this.get_trans_data();
if (this.process_in_up) {
var temp_sj = this.service_header_arr.first.pop();
this.service_header_arr.second = [];
this.service_header_arr.second.push(temp_sj);
}
this.$set(this.list_arr[0], "info", data.descript);
this.$set(this.list_arr[1], "info", data.sectors_name);
this.$set(this.list_arr[2], "info", data.organization_name);
this.$set(this.list_arr[3], "info", data.openness_name);
this.$set(this.list_arr[4], "info", "自动生成");
this.$set(
this.list_arr[5],
"info",
data.create_time.replace("T", " ").split("+")[0]
);
let str = data.create_time.replace("T", " ").split("+")[0];
str = str.replace("Z", " ").split("+")[0];
this.$set(this.list_arr[5], "info", str);
this.$set(this.cp_arr[0], "info", data.descript);
this.$set(this.cp_arr[1], "info", data.sectors_name);
let strtags = "";
if (data.tags && data.tags.length != 0) {
data.tags.forEach((item) => {
strtags += item + " ";
});
}
this.$set(this.cp_arr[2], "info", strtags);
this.$set(this.cp_arr[3], "info", data.organization_name);
this.$set(this.cp_arr[4], "info", data.openness_name);
this.$set(this.cp_arr[5], "info", str);
this.data_service_type1 = data.data_service_type1;
if (this.data_service_type1 == "36") {
this.service_arr[0][0] = "产品基本信息";
this.service_arr[0][1] = "";
this.service_arr[0][2] = "";
this.service_arr[1][0] = "产品基本信息";
this.service_arr[1][1] = "";
this.service_arr[1][2] = "";
this.service_arr[1][3] = "产品计费规则";
this.service_arr[1][4] = "产品交易记录";
this.service_arr[2][0] = "产品基本信息";
this.service_arr[2][1] = "";
this.service_arr[2][2] = "";
this.service_arr[2][3] = "产品规格";
this.service_arr[2][4] = "产品交易记录";
this.getMd(data.doc_file)
}
// console.log(this.service_arr)
// 接口详情信息
this.$set(
this.servicead_arr[0],
......@@ -1399,44 +1613,50 @@ export default {
this.$set(this.servicead_arr[1], "info", "无请求参数");
}
this.req_code_arr =
data.urls[0].req_fields_example || data.urls[0].req_query_example || ""; // 请求示例
data.urls[0].req_fields_example ||
data.urls[0].req_query_example ||
""; // 请求示例
if (!this.req_code_arr) {
this.$set(this.servicead_arr[2], "type", "");
this.$set(this.servicead_arr[2], "info", "无请求示例");
}
this.$set(this.servicead_arr[3], "info", data.urls[0].encode_method); // 编码格式
this.$set(
this.servicead_arr[3],
"info",
data.urls[0].encode_method
); // 编码格式
this.res_data = JSON.parse(data.urls[0].res_fields || "[]"); // 响应参数
if (this.res_data && this.res_data.length === 0) {
this.$set(this.servicead_arr[4], "type", "");
this.$set(this.servicead_arr[4], "info", "无响应参数");
}
console.log(data.urls[0].res_fields_example)
console.log(data.urls[0].res_fields_example);
this.res_code_arr = data.urls[0].res_fields_example || ""; // 响应示例
console.log(this.res_code_arr)
console.log(this.res_code_arr);
if (!this.res_code_arr) {
this.$set(this.servicead_arr[5], "type", "");
this.$set(this.servicead_arr[5], "info", "无响应示例");
}
// 接口详情信息 end
var temp = data.request_spcs_info||[]
temp.forEach((e,idx) => {
e.index = idx+1
if(e.spcs_type==1){
e.gg = e.money+'金币/'+e.spcs_count+''
e.time = '不限时长'
e.pv = e.spcs_count
e.d_price = e.money/e.spcs_count+'金币/次'
e.spcs_type_name = '计次收费'
}else if(e.spcs_type==2){
e.gg = e.money+'金币/月'
e.time = '1个月'
e.pv = '不限次数'
e.d_price = '-'
e.spcs_type_name = '计时收费'
var temp = data.request_spcs_info || [];
temp.forEach((e, idx) => {
e.index = idx + 1;
if (e.spcs_type == 1) {
e.gg = e.money + "金币/" + e.spcs_count + "";
e.time = "不限时长";
e.pv = e.spcs_count;
e.d_price = e.money / e.spcs_count + "金币/次";
e.spcs_type_name = "计次收费";
} else if (e.spcs_type == 2) {
e.gg = e.money + "金币/月";
e.time = "1个月";
e.pv = "不限次数";
e.d_price = "-";
e.spcs_type_name = "计时收费";
}
});
this.service_size_data =temp;
this.size_arr_down =temp;
this.service_size_data = temp;
this.size_arr_down = temp;
} else {
this.$message({
message: response.data.errMsg,
......@@ -1444,32 +1664,44 @@ export default {
});
}
})
.catch(function(response) {});
.catch(function (response) {});
},
getMd(url) {
this.$http
.get(url, {
params: {
serviceId: this.id,
},
})
.then(response => {
this.cp_arr[6].item = response.data;
})
.catch(function (error) {
console.log(error);
});
},
now_size_data(val) {
console.log(val);
val.forEach(e => {
if(e.spcs_type==1){
if(e.pv=='不限次数'){
e.pv = ''
e.time = ''
e.descript = ''
e.money = ''
e.d_price = ''
val.forEach((e) => {
if (e.spcs_type == 1) {
if (e.pv == "不限次数") {
e.pv = "";
e.time = "";
e.descript = "";
e.money = "";
e.d_price = "";
}
e.time = '不限时长'
e.descript = '提供'+e.pv+'次服务,时长不限'
if(e.money&&e.pv){
e.d_price = parseInt(e.money/e.pv)+'金币/次'
}
}else if(e.spcs_type==2){
e.pv = '不限次数'
e.d_price = '-'
e.time = '按月'
e.descript = '每月不限调用次数'
e.time = "不限时长";
e.descript = "提供" + e.pv + "次服务,时长不限";
if (e.money && e.pv) {
e.d_price = parseInt(e.money / e.pv) + "金币/次";
}
} else if (e.spcs_type == 2) {
e.pv = "不限次数";
e.d_price = "-";
e.time = "按月";
e.descript = "每月不限调用次数";
}
});
this.size_arr_down = val;
},
......@@ -1482,51 +1714,51 @@ export default {
.then((response) => {
let data = response.data.data;
console.log(data);
var temp = data.data||[]
temp.forEach((e,idx) => {
e.index = idx+1
// if(e.spcs_type==1){
// e.gg = e.money+'/'+e.spcs_count
// e.time = '不限时长'
// e.pv = e.spcs_count
// e.d_price = ''
// }else if(e.spcs_type==1){
// e.gg = e.money+'/月'
// e.time = '1个月'
// e.pv = '不限次数'
// e.d_price = '-'
// }
var temp = data.data || [];
temp.forEach((e, idx) => {
e.index = idx + 1;
// if(e.spcs_type==1){
// e.gg = e.money+'/'+e.spcs_count
// e.time = '不限时长'
// e.pv = e.spcs_count
// e.d_price = ''
// }else if(e.spcs_type==1){
// e.gg = e.money+'/月'
// e.time = '1个月'
// e.pv = '不限次数'
// e.d_price = '-'
// }
if(e.spcs_type==1){
e.gg = e.money+'金币/'+e.spcs_count+''
e.time = '不限时长'
e.pv = e.spcs_count
e.d_price = e.money/e.spcs_count+'金币/次'
e.spcs_type_name = '计次收费'
}else if(e.spcs_type==2){
e.gg = e.money+'金币/月'
e.time = '1个月'
e.pv = '不限次数'
e.d_price = '-'
e.spcs_type_name = '计时收费'
}
});
if (e.spcs_type == 1) {
e.gg = e.money + "金币/" + e.spcs_count + "";
e.time = "不限时长";
e.pv = e.spcs_count;
e.d_price = e.money / e.spcs_count + "金币/次";
e.spcs_type_name = "计次收费";
} else if (e.spcs_type == 2) {
e.gg = e.money + "金币/月";
e.time = "1个月";
e.pv = "不限次数";
e.d_price = "-";
e.spcs_type_name = "计时收费";
}
});
this.service_size_data = temp;
})
.catch(function(response) {});
.catch(function (response) {});
},
change_service_size() {
let temp = [];
this.size_arr_down.forEach((e) => {
if (e.pv && e.money&&e.spcs_type) {
e.id = 0
if (e.pv && e.money && e.spcs_type) {
e.id = 0;
delete e.undefined;
delete e.flag;
e.spcs_count = e.spcs_type==1?parseInt(e.pv):0;
e.spcs_count = e.spcs_type == 1 ? parseInt(e.pv) : 0;
e.money = parseFloat(e.money);
e.duration=1
e.duration_unit=1
e.duration = 1;
e.duration_unit = 1;
temp.push(e);
}
});
......@@ -1595,7 +1827,7 @@ export default {
background-color: #c3caf8;
color: #0f2683;
}
.service_port .el-input__inner{
.service_port .el-input__inner {
width: 785px;
background-color: #f7f8f9;
}
......@@ -1712,7 +1944,7 @@ export default {
margin-top: 50px;
overflow: hidden;
}
.port_bg_box{
.port_bg_box {
width: 100%;
min-height: 100px;
background-color: #f8f9fd;
......@@ -1720,13 +1952,13 @@ export default {
margin-top: 10px;
padding: 20px 30px;
}
.trans_all{
.trans_all {
width: 100%;
height: 128px;
background-color: #fbfcfe;
border-radius: 12px;
background-color: #fbfcfe;
border-radius: 12px;
}
.trans_all .trans_box{
.trans_all .trans_box {
width: 33.3%;
float: left;
height: 65px;
......@@ -1734,10 +1966,10 @@ export default {
margin-top: 30px;
border-right: 2px solid #e6ebfe;
}
.trans_all .trans_box:nth-last-of-type(1){
.trans_all .trans_box:nth-last-of-type(1) {
border: 0;
}
.trans_middle{
.trans_middle {
width: 200px;
height: 65px;
line-height: 65px;
......@@ -1745,33 +1977,32 @@ export default {
position: relative;
text-align: right;
}
.trans_middle img{
.trans_middle img {
position: absolute;
left: 0;
top: 15px;
}
.trans_middle span{
.trans_middle span {
position: absolute;
right: -20px;
top: 18px;
font-size: 16px;
color: #242c43;
color: #242c43;
}
.trans_middle p{
.trans_middle p {
font-size: 16px;
line-height: 32px;
color: #58617a;
color: #58617a;
}
.trans_middle p:nth-of-type(2){
.trans_middle p:nth-of-type(2) {
font-size: 24px;
font-weight: bold;
color: #242c43;
font-weight: bold;
color: #242c43;
}
.trans_all .trans_box:nth-of-type(1) .trans_middle span{
.trans_all .trans_box:nth-of-type(1) .trans_middle span {
right: -40px;
}
.trans_log{
.trans_log {
width: 100%;
}
</style>
......@@ -41,12 +41,12 @@
>
<img
v-if="activeBtn == index"
:src="require('../../assets/imgs/' + item.active + '.png')"
:src="require('@/assets/imgs/' + item.active + '.png')"
class="fwcs_btn_img"
/>
<img
v-else
:src="require('../../assets/imgs/' + item.default + '.png')"
:src="require('@/assets/imgs/' + item.default + '.png')"
class="fwcs_btn_img"
/>
{{ item.name }}
......@@ -112,10 +112,16 @@
<el-radio label="xml">XML</el-radio>
</el-radio-group>
</div>
<div v-if="!(activeBtn == 4 && zhyyVal == 24)" class="fwcs_fwdz">
<div
v-if="!(activeBtn == 4 && zhyyVal == 24) && activeBtn != 5"
class="fwcs_fwdz"
>
服务地址:
</div>
<div v-if="!(activeBtn == 4 && zhyyVal == 24)" class="fwcs_fwdz_inner">
<div
v-if="!(activeBtn == 4 && zhyyVal == 24) && activeBtn != 5"
class="fwcs_fwdz_inner"
>
<el-input
placeholder="请输入内容"
@input="getUrl"
......@@ -334,6 +340,123 @@
</el-tab-pane>
</el-tabs>
</div>
<div v-if="activeBtn == 5">
<div class="fwcs_add">
<el-form ref="form_cp" :model="form_cp" :rules="rules_cp">
<el-form-item prop="name">
<p class="formname">产品名称:</p>
<el-input
v-model="form_cp.name"
placeholder="请输入产品名称"
class="form_in"
></el-input>
</el-form-item>
<el-form-item prop="desc">
<p class="formname">产品简介:</p>
<el-input
type="textarea"
v-model="form_cp.desc"
placeholder="请输入产品简介"
class="form_in"
></el-input>
</el-form-item>
<el-form-item prop="area">
<p class="formname">产品领域:</p>
<el-select
v-model="form_cp.area"
placeholder="请选择"
class="form_in"
>
<el-option
v-for="item in optionsArea"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="bb">
<p class="formname">产品版本:</p>
<el-input
v-model="form_cp.bb"
class="form_in"
placeholder="请输入产品版本,如V1.0"
></el-input>
</el-form-item>
<el-form-item>
<p class="formname">产品封面:</p>
<upload-file
:multiple="false"
:max="1"
type="cropper"
:readOnly="false"
:list="cover_cp"
@getNewList="getNewList_cp"
></upload-file>
</el-form-item>
<el-form-item prop="bq">
<p class="formname">产品标签:</p>
<div class="ip_block form_in">
<div
v-for="(item, index) in form_cp.bq"
:key="item"
class="ip_item"
>
{{ item }}
<i
class="el-icon-close ip_del"
@click="delIp(index, 'white')"
></i>
</div>
<el-input
v-if="whiteAddShow"
class="ip_input"
v-model="newIpWhite"
@keyup.enter.native="watchKeyboardWhite"
></el-input>
<el-button
class="add_ip"
@click="addIp('white')"
icon="el-icon-plus"
>增加</el-button
>
</div>
</el-form-item>
<el-form-item>
<p class="formname">产品介绍文档:</p>
<div class="cp_mb">
产品介绍文档模版.md<span class="filebtn">下载文件</span>
</div>
<upload-file
:multiple="false"
:unique="false"
:max="1"
type="md"
:readOnly="false"
:drag="true"
@getNewList="getNewListwd"
class="up_f form_in"
:accepts="'.md'"
up_fz="仅支持.md格式"
:list="wd_cp"
></upload-file>
</el-form-item>
<el-form-item prop="resource">
<p class="formname">开放程度:</p>
<el-radio-group v-model="form_cp.resource">
<el-radio :label="1">共享</el-radio>
<el-radio :label="2">受限</el-radio>
<el-radio :label="3">敏感</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item class="btn_footer">
<el-button class="registe" @click="registeCp"
>产品注册</el-button
>
</el-form-item>
</el-form>
</div>
</div>
</block-radius>
<block-radius v-show="resultShow">
<div
......@@ -1022,6 +1145,52 @@ export default {
code_1_index: 0,
code_2_index: 0,
user_id: "",
form_cp: {
name: "",
desc: "",
area: "",
origin: "",
bb: "",
bq: [],
resource: 1,
},
rules_cp: {
name: [
{ required: true, message: "请输入产品名称", trigger: "blur" },
{ min: 0, max: 15, message: "产品名称不超过15个字", trigger: "blur" },
],
desc: [
{ required: true, message: "请输入产品描述", trigger: "blur" },
{
min: 0,
max: 200,
message: "产品简介不超过200个字",
trigger: "blur",
},
],
area: [
{ required: true, message: "请选择产品领域", trigger: "change" },
],
bq: [
{ required: true, message: "请添加产品标签", trigger: "blur" },
],
bb: [
{ required: true, message: "请输入版本号", trigger: "change" },
{
pattern: /^(\w{1})(\w|\.|-|\s*)+$/,
message: "请输入正确版本号",
trigger: "blur",
},
],
resource: [
{ required: true, message: "请选择开放程度", trigger: "blur" },
],
},
cover_cp: [],
ip_arr: [],
whiteAddShow: false,
newIpWhite: "",
wd_cp: [],
};
},
computed: {},
......@@ -1337,6 +1506,12 @@ export default {
getNewList(val) {
this.cover[0] = val[0].url;
},
getNewList_cp(val) {
this.cover_cp[0] = val[0].url;
},
getNewListwd(val) {
this.wd_cp[0] = val[0];
},
previous() {
this.datasQqcs = this.request_fields;
this.datasFhcs = this.response_fields;
......@@ -1353,6 +1528,7 @@ export default {
this.$api.user.getUserDetail(query).then((request) => {
if (request.data.success == 1) {
this.form.origin = request.data.data.department;
this.form_cp.origin = request.data.data.department;
this.oid = request.data.data.department_id;
} else {
console.log(response.data.errMsg);
......@@ -1496,6 +1672,40 @@ export default {
this.registePt();
}
},
registeCp() {
this.$refs.form_cp.validate((valid) => {
if (valid) {
if (this.form_cp.bq.length < 1 && this.form_cp.bq.length > 3) {
this.$message.error("产品标签至少1个,至多3个");
}
let query = {
name: this.form_cp.name,
sectors: this.form_cp.area,
organization: this.form_cp.origin,
cover: this.cover_cp[0],
openness: this.form_cp.resource,
descript: this.form_cp.desc,
data_service_type1: this.btnList[this.activeBtn].id,
data_service_type2: 0,
portal_id: "",
encode_method: "自动生成",
doc_file: this.wd_cp[0].url,
version: this.form_cp.bb,
tags: this.form_cp.bq,
urls: [],
};
this.$api.workbench.serviceAdd(query).then((response) => {
if (response.data.success == 1) {
this.$message.success("产品注册成功");
this.$router.push("/fwgl/" + this.$store.getters.level);
} else {
console.log(response.data.errMsg);
this.$message.error(response.data.errMsg);
}
});
}
});
},
registePt() {
this.$refs.form.validate((valid) => {
if (valid) {
......@@ -1692,8 +1902,8 @@ export default {
getServiceType1() {
this.$api.workbench.getServiceTypeList().then((response) => {
if (response.data.success == 1) {
this.btnList = response.data.data;
this.btnList.forEach((item) => {
let arr = response.data.data;
arr.forEach((item) => {
switch (item.id) {
case 5:
item.default = "nav_ic_shujufw";
......@@ -1715,10 +1925,22 @@ export default {
item.default = "nav_ic_zonghefw";
item.active = "nav_ic_zonghefw_sel";
break;
case 36:
item.default = "nav_ic_chanpinzy";
item.active = "nav_ic_chanpinzy_sel";
break;
default:
break;
}
});
let cp_index = arr.findIndex((item) => {
return item.id == 36;
});
let cp = arr[cp_index];
arr.splice(cp_index, 1);
arr.push(cp);
console.log(arr);
this.btnList = arr;
let skfwRadios = this.btnList[1].childDomains;
skfwRadios.splice(2, 1);
this.skfwRadios = skfwRadios;
......@@ -2092,12 +2314,38 @@ export default {
}
}
},
delIp(index, type) {
if (type == "white") {
this.form_cp.bq.splice(index, 1);
} else if (type == "black") {
this.form_cp.bq.splice(index, 1);
}
},
addIp(type) {
if (type == "white") {
this.whiteAddShow
? this.$message({
message: "请按回车完善本次ip填写",
type: "error",
})
: (this.whiteAddShow = true);
}
},
watchKeyboardWhite() {
let self = this;
if (self.newIpWhite != "") {
self.form_cp.bq.push(self.newIpWhite);
self.whiteAddShow = false;
self.newIpWhite = "";
}
},
},
mounted() {
let self = this;
window.addEventListener("message", self.listeners, false);
self.judgeMap();
self.getArea();
self.getOrganization();
},
created() {
let _self = this;
......@@ -2325,6 +2573,66 @@ export default {
.gz_fhsjgs_rad {
margin-left: 10px;
}
.ip_block {
border-radius: 8px;
border: solid 1px #e3e5ef;
padding: 10px 0 0 10px;
line-height: 24px;
}
.ip_item {
display: inline-block;
position: relative;
background-color: #e6ebfe;
border-radius: 4px;
color: #0f2683;
font-size: 12px;
line-height: 24px;
padding: 0 26px 0 8px;
margin-right: 10px;
margin-bottom: 10px;
}
.ip_del {
position: absolute;
right: 8px;
top: 6px;
font-size: 14px;
color: #6573ae;
cursor: pointer;
}
.ip_del:hover {
color: #e56600;
}
.add_ip {
background-color: #495feb;
border-radius: 4px;
color: #f8f9fd;
font-size: 12px;
line-height: 24px;
padding: 0 8px;
margin-right: 10px;
margin-bottom: 10px;
}
.ip_input {
width: 110px;
margin-right: 10px;
margin-bottom: 10px;
}
.filebtn {
width: 76px;
height: 32px;
line-height: 32px;
text-align: center;
color: #e6ebfe;
background-color: #515fe7;
border-radius: 6px;
display: inline-block;
font-size: 14px;
margin-left: 8px;
cursor: pointer;
}
.cp_mb {
padding: 0 0 16px 8px;
}
</style>
<style>
.fwcs_fwdz_inner .el-select .el-input {
......@@ -2352,4 +2660,11 @@ export default {
.lc_upf .el-upload-dragger {
width: 100%;
}
.ip_input .el-input__inner {
border-radius: 4px;
padding: 0 8px;
font-size: 12px;
line-height: 24px;
height: 24px;
}
</style>
......@@ -73,18 +73,18 @@ export default new Router({
}, // 审批的服务 - 详情
{
path: "/fwgl/:level/:type/cloud_detail/:id",
name: "servicedetail",
name: "cloud_detail",
component: () => import("@/pages/workbench/fwgl/cloud-detail"),
}, // 云资源 - 详情
{
path: "/fwgl/:level/:type/approveWorkspace",
name: "servicedetail",
name: "approveWorkspace",
component: () =>
import("@/pages/workbench/fwgl/approveWorkspace"),
}, // 云资源 - 工作区域审批
{
path: "/fwgl/:level/:type/organizationCloudResource/:id",
name: "servicedetail",
name: "organizationCloudResource",
component: () =>
import("@/pages/workbench/fwgl/organizationCloudResource"),
}, // 云资源 - 组织云资源详情
......@@ -322,6 +322,11 @@ export default new Router({
name: "shopAppStoreList",
component: () => import("@/pages/service_shop/shop_list-new"),
},
{
path: "/shop/products_list/", // 应用商店列表页
name: "shopAppStoreList",
component: () => import("@/pages/service_shop/shop_list-new"),
},
{
path: "/shop/shopping_cart", // 购物车页
name: "shoppingCart",
......@@ -364,6 +369,11 @@ export default new Router({
name: "yysdDetail",
component: () => import("@/pages/service_shop/yysdDetail"),
}, // 服务超市 - 应用详情
{
path: "/shop/cpDetail/:id",
name: "cpDetail",
component: () => import("@/pages/service_shop/cpDetail"),
}, // 服务超市 - 产品资源详情
{
path: "/workplace",
name: "workPlace",
......
......@@ -4801,6 +4801,19 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
markdown-loader@^6.0.0:
version "6.0.0"
resolved "https://registry.npm.taobao.org/markdown-loader/download/markdown-loader-6.0.0.tgz#7f8d40ee98b32d3bb8c5387d58e679600d3edeaa"
integrity sha1-f41A7pizLTu4xTh9WOZ5YA0+3qo=
dependencies:
loader-utils "^1.2.3"
marked "^0.7.0"
marked@^0.7.0:
version "0.7.0"
resolved "https://registry.npm.taobao.org/marked/download/marked-0.7.0.tgz?cache=0&sync_timestamp=1608062041411&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmarked%2Fdownload%2Fmarked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e"
integrity sha1-tkIB8FHScbHtwQoE0a6bdLuOXA4=
material-design-icons-iconfont@^4.0.5:
version "4.0.5"
resolved "https://registry.npm.taobao.org/material-design-icons-iconfont/download/material-design-icons-iconfont-4.0.5.tgz#4107ba3b8a9d688a3d9325fc7363af51b17d3aee"
......
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