Commit 22e3c951 authored by 张俊's avatar 张俊

Merge branch 'dev' of https://cloud.wodcloud.com/git/apaas/apaas-v3-ui into dev

parents 0ae75816 034b2849
......@@ -551,6 +551,26 @@ width: 620px!important;
.apass_button .el-button.is-disabled:hover {
cursor: not-allowed;
}
.apass_button .el-button--warning.is-plain {
background-color: #fcefd6;
border-color: #fac266;
color: #e56600;
}
.apass_button .el-button--warning {
background-color: #e56600;
border-color: #e56600;
color: #fff;
}
.apass_button .el-button.is-disabled,
.apass_button .el-button.is-disabled:focus,
.apass_button .el-button.is-disabled:hover {
color: #C0C4CC;
cursor: not-allowed;
background-image: none;
background-color: #FFF;
border-color: #EBEEF5;
}
.apass_table .el-table th > .cell {
color: #1a2236;
}
......
......@@ -3,7 +3,7 @@
<a class="remove_btn" @click.prevent="deleteAction">
<i class="el-icon-close"></i>
</a>
<div class="app_card-icon">
<div class="app_card-icon" @click="intoDetail">
<el-avatar shape="square" :size="56" fit="cover" :src="data.logo" />
</div>
<div class="app_card-info">
......@@ -27,15 +27,14 @@
<i class="el-icon-time"></i>
<span>上线时间:</span>
</span>
<span
class="text_clip"
v-text="data.created && data.created.substring(0, 10)"
></span>
<span class="text_clip" v-text="getTimeText(data.created || '')"></span>
</p>
</div>
</template>
<script>
import helper from "@/services/helper.js";
export default {
props: {
data: {
......@@ -52,6 +51,9 @@ export default {
},
},
methods: {
getTimeText(time) {
return helper.dateStringTransform(time);
},
deploymentAction() {
this.$emit("deployment-action", this.data);
},
......@@ -62,7 +64,7 @@ export default {
this.$router.push(
`${this.detailsUrl}${
this.cardType == 0
? this.data.app_id+`?source=${this.data.source}`
? this.data.app_id + `?source=${this.data.source}`
: this.data.deploy_id + `?app_id=${this.data.app_id}`
}`
);
......@@ -97,6 +99,7 @@ export default {
}
.app_card > .app_card-icon {
margin-right: 18px;
cursor: pointer;
}
.app_card > .app_card-info {
width: calc(100% - 56px - 20px);
......
......@@ -102,21 +102,35 @@ export default {
itemStyle: {
normal: {
color: new graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "#fff" },
{
offset: 0,
color:
self.dangerousValue == "high"
? self.data.data >= 80
? "#f7f1d5"
: "#d5f7e8"
: self.data.data > 75
? "f7f1d5"
: self.data.data > 50
? "#ffd98f"
: self.data.data > 25
? "#d5f7e8"
: "#d5f7e8"
},
{
offset: 1,
color:
self.dangerousValue == "high"
? self.data.data >= 80
? "#e15260"
: "#515fe7"
? "#da4251" // red
: "#00beb2" //green
: self.data.data > 75
? "#00cfc6"
? "#da4251" //red
: self.data.data > 50
? "#54cefd"
? "#ff7200" //yellow
: self.data.data > 25
? "#54cefd"
: "#25bdb1"
? "#00beb2" //green
: "#00beb2" //green
}
])
}
......
......@@ -191,7 +191,7 @@ export default {
},1000)
},
getNewUrl(val) {
let fileObj = { name: val, url: val };
let fileObj = [{ name: val, url: val }];
this.$emit("getNewList", fileObj);
}
}
......
......@@ -3,7 +3,7 @@
<a class="remove_btn" @click.prevent="deleteAction" v-if="!hideDelete">
<i class="el-icon-close"></i>
</a>
<div class="organization_card-icon">
<div class="organization_card-icon" @click="intoDetail">
<el-avatar
shape="square"
:size="56"
......@@ -100,6 +100,7 @@ export default {
}
.organization_card > .organization_card-icon {
margin-right: 18px;
cursor: pointer;
}
.organization_card > .organization_card-info {
width: calc(100% - 56px - 20px);
......
......@@ -49,7 +49,8 @@
</ul>
<div class="commodity_information">
<span>&emsp;&emsp;格:</span>
<div class="btn_container">
<span v-if="actionDisabled" class="commodity_text">暂无</span>
<div v-else class="btn_container">
<el-button
v-for="(item, index) in specifications"
:key="'spcs_' + index"
......@@ -62,14 +63,17 @@
</div>
<div class="commodity_information">
<span>规格说明:</span>
<span v-if="actionDisabled" class="commodity_text">暂无</span>
<span
v-else
class="commodity_text"
v-text="(specification && specification.descript) || '-'"
></span>
</div>
<div class="commodity_information">
<span>购买方式:</span>
<div class="btn_container">
<span v-if="actionDisabled" class="commodity_text">暂无</span>
<div v-else class="btn_container">
<el-button
v-for="(item, index) in types"
v-text="item.name"
......@@ -83,14 +87,27 @@
<div class="commodity_information">
<span>购买时长:</span>
<div class="btn_container">
<el-input-number v-model="duration" :min="1"></el-input-number>
<el-input-number
v-model="duration"
:min="1"
:disabled="actionDisabled"
></el-input-number>
</div>
</div>
<div class="commodity_action">
<el-button type="warning" plain @click="addToCart">
<div class="apass_button commodity_action">
<el-button
type="warning"
plain
@click="addToCart"
:disabled="actionDisabled"
>
加入购物车
</el-button>
<el-button type="warning" @click="applyImmediately">
<el-button
type="warning"
@click="applyImmediately"
:disabled="actionDisabled"
>
立即申请
</el-button>
</div>
......@@ -123,6 +140,9 @@ export default {
return specifications;
},
actionDisabled() {
return this.specifications.length == 0;
},
},
watch: {
specifications: {
......@@ -363,17 +383,4 @@ export default {
width: 220px;
margin-left: 20px;
}
.service_info .el-button--primary {
background-color: #515fe7;
border-color: #515fe7;
}
.service_info .el-button--warning.is-plain {
background-color: #fcefd6;
border-color: #fac266;
color: #e56600;
}
.service_info .el-button--warning {
background-color: #e56600;
border-color: #e56600;
}
</style>
......@@ -1031,7 +1031,18 @@ export default {
]
};
this.$api.serviceShop.applicationCloud(query).then(response => {
console.log(response);
if (response.data.success == 1) {
this.$message({
message: "申请成功",
type: "success"
});
this.$router.push("/services_shop");
} else {
this.$message({
message: "申请失败",
type: "error"
});
}
});
} else {
let query = {
......@@ -1061,13 +1072,13 @@ export default {
this.$api.serviceShop.updateCloud(query).then(response => {
if (response.data.success == 1) {
this.$message({
message: "申请成功",
message: "申请调整成功",
type: "success"
});
this.$router.push("/services_shop");
} else {
this.$message({
message: "申请失败",
message: "申请调整失败",
type: "error"
});
}
......
......@@ -169,6 +169,7 @@ export default {
immediate: true, // 这句重要
handler(val) {
this.cellItems = val;
this.cellItems.is_subscribe = this.cellItems.is_subscribe == 1 ? true : false;
if (this.cellIsService) {
if (this.cellItems.service.buy_method == 1) {
this.specificationApplicationBtns = [{ id: 1, value: "按月" }];
......@@ -245,6 +246,7 @@ export default {
this.cellItems.duration_method = this.specificationApplicationPop;
this.visible = false;
this.changeCellItem();
this.updateShoppingCart();
},
setSpecificationPop() {
this.specificationPop = this.cellItems.spec_id;
......@@ -252,9 +254,11 @@ export default {
},
changeSubscription(val) {
this.changeCellItem();
this.updateShoppingCart();
},
changeNum(val) {
this.changeCellItem();
this.updateShoppingCart();
},
changeCellItem() {
this.$emit("changeCellMsg", {
......@@ -265,8 +269,8 @@ export default {
delCellItem() {
this.$api.serviceShop
.delShoppingCart([this.cellItems.id])
.then(request => {
if (request.data.success == 1) {
.then(response => {
if (response.data.success == 1) {
this.$message({
message: this.cellIsService ? "删除该服务成功" : "删除该应用成功",
type: "success"
......@@ -279,6 +283,21 @@ export default {
});
}
});
},
updateShoppingCart() {
let query = {
id: this.cellItems.id,
duration: this.cellItems.duration,
spec_id: this.cellItems.spec_id,
duration_method: this.cellItems.duration_method,
is_subscribe: Number(this.cellItems.is_subscribe)
};
this.$api.serviceShop.updateShoppingCart(query).then(response => {
if (response.data.success == 1) {
} else {
console.log(response.data.errMsg);
}
});
}
}
};
......
......@@ -136,7 +136,7 @@ export default {
padding: 14px 19px;
border: 1px solid #e3e5ef;
border-radius: 6px;
margin: 0 0 10px;
margin-top: 10px;
}
.ces_filter_container > li {
display: flex;
......
......@@ -42,44 +42,45 @@ export default {
let self = this;
self.datas.nodes.map(node => {
node.id = node.data.id;
switch (node.data.nodeType) {
case "workload":
switch (node.data.svcType) {
case "数据服务":
node.type = "image";
node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.size = [15, 15];
break;
case "app":
case "时空服务":
node.type = "image";
node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.img = require("@/assets/svg/topology_ic_shikongfw.svg");
node.size = [15, 15];
break;
case "unknow source":
case "视频服务":
node.type = "image";
node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.img = require("@/assets/svg/topology_ic_shipinfw.svg");
node.size = [15, 15];
break;
case "service":
case "感知服务":
node.type = "image";
node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.img = require("@/assets/svg/topology_ic_ganzhifw.svg");
node.size = [15, 15];
break;
case "service entry":
case "综合应用":
node.type = "image";
node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.img = require("@/assets/svg/topology_ic_zonghefw.svg");
node.size = [15, 15];
break;
default:
node.type = "image";
node.img = require("@/assets/svg/topology_ic_ganzhifw.svg");
node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.size = [15, 15];
break;
}
if (node.data.namespace != self.namespace) {
node.label =
node.data[node.data.nodeType] + "\n(" + node.data.namespace + ")";
} else {
node.label = node.data[node.data.nodeType];
}
node.label = node.data.svcAlias;
// if (node.data.namespace != self.namespace) {
// node.label =
// node.data[node.data.nodeType] + "\n(" + node.data.namespace + ")";
// } else {
// node.label = node.data[node.data.nodeType];
// }
node.labelCfg = {
style: {
fill: "#333",
......@@ -416,7 +417,7 @@ export default {
<style scoped>
.canvas {
height: 600px;
width: 1000px;
width: 100%;
margin: 0 auto;
position: relative;
}
......
......@@ -285,7 +285,7 @@ export default {
});
},
getNewList(val) {
this.form.fileList = val.url;
this.form.fileList = val[0].url;
console.log(this.form.fileList);
},
},
......
......@@ -57,12 +57,12 @@
<p>当前用户类型:</p>
<el-input v-model="user_data.userTypeName" :disabled="true"></el-input>
<el-button
v-if="user_data.userType == 3 && user_data.userType == 0"
v-if="user_data.userType == 3 && user_data.is_apply == 0"
class="option_btn"
@click="showUpLevel"
>升级为开发者</el-button>
<el-button
v-else-if="user_data.userType == 3 && user_data.userType == 1"
v-else-if="user_data.userType == 3 && user_data.is_apply == 1"
type="info"
class="option_btn_gray_dis"
disabled
......@@ -314,7 +314,7 @@ export default {
},
changeTab() {},
getNewList(val) {
this.imgList[0] = val.url;
this.imgList[0] = val[0].url;
},
previous() {},
registe() {
......
......@@ -408,7 +408,7 @@ export default {
});
},
getNewList(file) {
this.app_info.logo = file.url;
this.app_info.logo = file[0].url;
},
step1Action() {
this.$refs.app_info_form.validate((valid) => {
......
......@@ -61,7 +61,6 @@ export default {
},
tempFilter: null,
}),
computed: {},
methods: {
init(filter) {
// console.log(filter);
......
......@@ -157,7 +157,7 @@
<div ref="ResourceOverview" slot="ResourceOverview" class="params_resource_overview">
{{ resourceOverview }}
<el-row class="params_charts">
<el-col :span="6" class="params_col">
<el-col :span="8" class="params_col">
<div class="params_chart">
<dashboard ref="chart_1" :data="data1" dangerousValue="high"></dashboard>
</div>
......@@ -172,48 +172,33 @@
</div>
</div>
</el-col>
<el-col :span="6" class="params_col">
<el-col :span="8" class="params_col">
<div class="params_chart">
<dashboard ref="chart_2" :data="data2" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}GB</span>
<span>{{ data2.total }}GB</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}GB</span>
<span>{{ data2.remaining }}GB</span>
</div>
</div>
</el-col>
<el-col :span="6" class="params_col">
<el-col :span="8" class="params_col">
<div class="params_chart">
<dashboard ref="chart_3" :data="data3" dangerousValue="high"></dashboard>
<dashboard ref="chart_4" :data="data3" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}GB</span>
<span>{{ data3.total }}</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}GB</span>
</div>
</div>
</el-col>
<el-col :span="6" class="params_col">
<div class="params_chart">
<dashboard ref="chart_4" :data="data4" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}</span>
<span>{{ data3.remaining }}</span>
</div>
</div>
</el-col>
......@@ -376,25 +361,19 @@ export default {
resourceOverview:
"当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。",
data1: {
data: 80,
data: 0,
text: "CPU已使用",
total: 0,
remaining: 0
},
data2: {
data: 60,
data: 0,
text: "内存已使用",
total: 0,
remaining: 0
},
data3: {
data: 40,
text: "数据盘已使用",
total: 0,
remaining: 0
},
data4: {
data: 10,
data: 0,
text: "容器组已使用",
total: 0,
remaining: 0
......@@ -594,7 +573,6 @@ export default {
clickTab() {},
// 根据列表参数来判断显示什么
setListWithRole() {
console.log(this.now_user + ".." + this.apply_type);
if (this.now_user == 0) {
// 普通用户
if (this.use_uid == "") {
......@@ -676,25 +654,37 @@ export default {
if (count) {
this.data1.total = count.cpu_total;
this.data1.remaining = count.cpu_total - count.cpu_use;
this.data1.data = Math.round(
(count.cpu_total / count.cpu_use) * 100
);
if (count.cpu_total != 0 && count.cpu_use != 0) {
this.data1.data = Math.round(
(count.cpu_use / count.cpu_total) * 100
);
} else {
this.data1.data = 0;
}
this.data2.total = count.memory_total;
this.data2.remaining = count.memory_total - count.memory_use;
this.data2.data = Math.round(
(count.memory_total / count.memory_use) * 100
);
this.data3.total = count.disk_total;
this.data3.remaining = count.disk_total - count.disk_use;
this.data3.data = Math.round(
(count.disk_total / count.disk_use) * 100
);
this.data4.total = count.containers_total;
this.data4.remaining =
if (count.memory_total != 0 && count.memory_use != 0) {
this.data2.data = Math.round(
(count.memory_use / count.memory_total) * 100
);
} else {
this.data2.data = 0;
}
this.data3.total = count.containers_total;
this.data3.remaining =
count.containers_total - count.containers_use;
this.data4.data = Math.round(
(count.containers_total / count.containers_use) * 100
if (count.containers_total != 0 && count.containers_use != 0) {
this.data3.data = Math.round(
(count.containers_use / count.containers_total) * 100
);
} else {
this.data3.data = 0;
}
} else {
let index = this.list_arr.findIndex(
item => item.title == "资源使用概况:"
);
this.list_arr.splice(index, 1);
}
this.cloudDteail.containers = data.containers;
this.cloudDteail.cpu = data.cpu;
......@@ -855,10 +845,10 @@ export default {
padding: 0;
}
.params_chart_msg {
width: 120px;
width: 40%;
position: absolute;
bottom: 0;
left: 40px;
left: 30%;
}
.params_chart_msg_item {
display: flex;
......
......@@ -240,6 +240,7 @@ export default {
let date = item.create_time || "";
return helper.dateStringTransform(date);
},
width: 180,
align: "center",
},
{
......@@ -353,6 +354,7 @@ export default {
"";
return helper.dateStringTransform(date);
},
width: 180,
align: "center",
},
{
......@@ -602,6 +604,7 @@ export default {
let date = item.create_time || "";
return helper.dateStringTransform(date);
},
width: 180,
align: "center",
},
{
......@@ -698,6 +701,7 @@ export default {
? helper.dateStringTransform(date)
: "-";
},
width: 180,
align: "center",
},
{
......@@ -969,6 +973,7 @@ export default {
let date = item.create_time || "";
return helper.dateStringTransform(date);
},
width: 180,
align: "center",
},
{
......@@ -1073,6 +1078,7 @@ export default {
? helper.dateStringTransform(date)
: "-";
},
width: 180,
align: "center",
},
{
......
......@@ -85,7 +85,6 @@ export default {
},
tempFilter: null,
}),
computed: {},
methods: {
init(filter) {
// console.log(filter);
......
......@@ -277,7 +277,7 @@
</div>
</div>
<div class="btn_footer">
<el-button class="reset" v-if="activeBtn == 0" @click="resetSjfw">重置</el-button>
<el-button class="reset" v-if="activeBtn == 0 && resSuccess" @click="resetSjfw">重置</el-button>
<el-button :disabled="!resSuccess" :class="resSuccess ? 'next':''" @click="nextJcxx">下一步</el-button>
</div>
</block-radius>
......@@ -723,7 +723,7 @@ export default {
},
// edit form
getNewList(val) {
this.cover[0] = val.url;
this.cover[0] = val[0].url;
},
previous() {
this.datasQqcs = this.request_fields;
......
......@@ -106,7 +106,7 @@ export default {
this.cardType = 0;
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
......@@ -165,7 +165,7 @@ export default {
prop: "online_state",
data: [
{
name: "应用商店",
name: "平台应用",
value: 0,
},
{
......@@ -320,7 +320,7 @@ export default {
align: "center",
},
{
label: "在线状态",
label: "在线区域",
prop: "online_state_name",
align: "center",
},
......@@ -341,19 +341,45 @@ export default {
actionList: [
{
getLabel(item) {
return item.online_state == 0 ? "上架" : "下架";
if (item.online_state == 0) {
return "上架";
} else {
return "下架";
}
},
callback(item) {
item.online_state == 0
? _self.soldUpItem(item)
: _self.soldOutItem(item);
if (
item.online_state == 0 && // 未上架
item.up_deploy_status == 1 && // 申请上架中
item.up_platform_status == 0 // 未上线
) {
return _self.soldUpItem(item); // 上架的操作
} else if (
item.online_state == 1 && // 开发者应用
item.up_deploy_status == 3 && // 申请下架中
item.up_platform_status == 0 // 未上线
) {
return _self.soldOutItem(item); // 下架的操作
}
return null;
},
disabledRule(item) {
return (
item.online_state == 2 ||
item.up_deploy_status == 0 ||
item.up_deploy_status == 2
);
if (
item.online_state == 0 && // 未上架
item.up_deploy_status == 1 && // 申请上架中
item.up_platform_status == 0 // 未上线
) {
return false; // 可上架
} else if (
item.online_state == 1 && // 开发者应用
item.up_deploy_status == 3 && // 申请下架中
item.up_platform_status == 0 // 未上线
) {
return false; // 可下架
}
return true;
},
},
],
......@@ -361,7 +387,7 @@ export default {
];
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
......@@ -457,7 +483,7 @@ export default {
];
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
......@@ -556,11 +582,11 @@ export default {
];
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
name: "应用商店",
name: "平台应用",
value: 2,
},
{
......@@ -628,7 +654,7 @@ export default {
align: "center",
},
{
label: "在线状态",
label: "在线区域",
prop: "online_state_name",
align: "center",
},
......@@ -649,18 +675,44 @@ export default {
},
{
getLabel(item) {
return item.online_state == 0 ? "上线" : "下线";
if (item.online_state == 2) {
return "下线";
} else {
return "上线";
}
},
callback(item) {
item.online_state == 0
? _self.onLine(item)
: _self.offLine(item);
if (
item.online_state == 1 && // 开发者应用
item.up_deploy_status == 2 && // 已上架
item.up_platform_status == 1 // 申请上线中
) {
return _self.onLine(item); // 上线的操作
} else if (
item.online_state == 2 && // 平台应用
item.up_deploy_status == 2 && // 已上架
item.up_platform_status == 3 // 申请下线中
) {
return _self.offLine(item); // 下线的操作
} else {
return null;
}
},
disabledRule(item) {
if (item.online_state == 0) {
return item.up_platform_status != 0;
if (
item.online_state == 1 &&
item.up_deploy_status == 2 &&
item.up_platform_status == 1
) {
return false; // 可上线
} else if (
item.online_state == 2 &&
item.up_deploy_status == 2 &&
item.up_platform_status == 3
) {
return false; // 可下线
} else {
return item.up_platform_status != 2;
return true;
}
},
},
......@@ -677,7 +729,7 @@ export default {
];
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
......@@ -764,7 +816,7 @@ export default {
];
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
......@@ -863,11 +915,11 @@ export default {
];
this.otherFilter1 = [
{
name: "在线状态",
name: "在线区域",
prop: "online_state",
data: [
{
name: "应用商店",
name: "平台应用",
value: 2,
},
{
......@@ -1011,7 +1063,7 @@ export default {
return item.value;
})
.join(",");
} // 在线状态 / 部署来源 / 在线区域
} // 在线区域 / 部署来源
if (filter.appTypes) {
params.appTypes = filter.appTypes
.map((item) => {
......@@ -1118,7 +1170,7 @@ export default {
} else {
this.dialogInfo.title = "删除提示";
this.dialogInfo.msg =
"您需要先进行应用商店下架申请,应用处于下架状态时才能进行删除操作。";
"您需要先进行平台应用下架申请,应用处于下架状态时才能进行删除操作。";
this.dialogInfo.cancelText = "";
this.dialogInfo.sunbmitText = "";
this.dialogInfo.submit = () => {
......
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