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

拓扑图数据,裁剪功能返回值改为对象数组,增加购物车修改接口,服务测试重置按钮状态

parent c658742e
......@@ -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);
}
}
......
......@@ -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);
}
});
}
}
};
......
......@@ -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) => {
......
......@@ -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;
......
......@@ -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;
......
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