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

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

parent c658742e
...@@ -102,21 +102,35 @@ export default { ...@@ -102,21 +102,35 @@ export default {
itemStyle: { itemStyle: {
normal: { normal: {
color: new graphic.LinearGradient(0, 0, 1, 0, [ 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, offset: 1,
color: color:
self.dangerousValue == "high" self.dangerousValue == "high"
? self.data.data >= 80 ? self.data.data >= 80
? "#e15260" ? "#da4251" // red
: "#515fe7" : "#00beb2" //green
: self.data.data > 75 : self.data.data > 75
? "#00cfc6" ? "#da4251" //red
: self.data.data > 50 : self.data.data > 50
? "#54cefd" ? "#ff7200" //yellow
: self.data.data > 25 : self.data.data > 25
? "#54cefd" ? "#00beb2" //green
: "#25bdb1" : "#00beb2" //green
} }
]) ])
} }
......
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
},1000) },1000)
}, },
getNewUrl(val) { getNewUrl(val) {
let fileObj = { name: val, url: val }; let fileObj = [{ name: val, url: val }];
this.$emit("getNewList", fileObj); this.$emit("getNewList", fileObj);
} }
} }
......
...@@ -1031,7 +1031,18 @@ export default { ...@@ -1031,7 +1031,18 @@ export default {
] ]
}; };
this.$api.serviceShop.applicationCloud(query).then(response => { 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 { } else {
let query = { let query = {
...@@ -1061,13 +1072,13 @@ export default { ...@@ -1061,13 +1072,13 @@ export default {
this.$api.serviceShop.updateCloud(query).then(response => { this.$api.serviceShop.updateCloud(query).then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: "申请成功", message: "申请调整成功",
type: "success" type: "success"
}); });
this.$router.push("/services_shop"); this.$router.push("/services_shop");
} else { } else {
this.$message({ this.$message({
message: "申请失败", message: "申请调整失败",
type: "error" type: "error"
}); });
} }
......
...@@ -169,6 +169,7 @@ export default { ...@@ -169,6 +169,7 @@ export default {
immediate: true, // 这句重要 immediate: true, // 这句重要
handler(val) { handler(val) {
this.cellItems = val; this.cellItems = val;
this.cellItems.is_subscribe = this.cellItems.is_subscribe == 1 ? true : false;
if (this.cellIsService) { if (this.cellIsService) {
if (this.cellItems.service.buy_method == 1) { if (this.cellItems.service.buy_method == 1) {
this.specificationApplicationBtns = [{ id: 1, value: "按月" }]; this.specificationApplicationBtns = [{ id: 1, value: "按月" }];
...@@ -245,6 +246,7 @@ export default { ...@@ -245,6 +246,7 @@ export default {
this.cellItems.duration_method = this.specificationApplicationPop; this.cellItems.duration_method = this.specificationApplicationPop;
this.visible = false; this.visible = false;
this.changeCellItem(); this.changeCellItem();
this.updateShoppingCart();
}, },
setSpecificationPop() { setSpecificationPop() {
this.specificationPop = this.cellItems.spec_id; this.specificationPop = this.cellItems.spec_id;
...@@ -252,9 +254,11 @@ export default { ...@@ -252,9 +254,11 @@ export default {
}, },
changeSubscription(val) { changeSubscription(val) {
this.changeCellItem(); this.changeCellItem();
this.updateShoppingCart();
}, },
changeNum(val) { changeNum(val) {
this.changeCellItem(); this.changeCellItem();
this.updateShoppingCart();
}, },
changeCellItem() { changeCellItem() {
this.$emit("changeCellMsg", { this.$emit("changeCellMsg", {
...@@ -265,8 +269,8 @@ export default { ...@@ -265,8 +269,8 @@ export default {
delCellItem() { delCellItem() {
this.$api.serviceShop this.$api.serviceShop
.delShoppingCart([this.cellItems.id]) .delShoppingCart([this.cellItems.id])
.then(request => { .then(response => {
if (request.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: this.cellIsService ? "删除该服务成功" : "删除该应用成功", message: this.cellIsService ? "删除该服务成功" : "删除该应用成功",
type: "success" type: "success"
...@@ -279,6 +283,21 @@ export default { ...@@ -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 { ...@@ -42,44 +42,45 @@ export default {
let self = this; let self = this;
self.datas.nodes.map(node => { self.datas.nodes.map(node => {
node.id = node.data.id; node.id = node.data.id;
switch (node.data.nodeType) { switch (node.data.svcType) {
case "workload": case "数据服务":
node.type = "image"; node.type = "image";
node.img = require("@/assets/svg/topology_ic_shujufw.svg"); node.img = require("@/assets/svg/topology_ic_shujufw.svg");
node.size = [15, 15]; node.size = [15, 15];
break; break;
case "app": case "时空服务":
node.type = "image"; 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]; node.size = [15, 15];
break; break;
case "unknow source": case "视频服务":
node.type = "image"; 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]; node.size = [15, 15];
break; break;
case "service": case "感知服务":
node.type = "image"; 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]; node.size = [15, 15];
break; break;
case "service entry": case "综合应用":
node.type = "image"; 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]; node.size = [15, 15];
break; break;
default: default:
node.type = "image"; 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]; node.size = [15, 15];
break; break;
} }
if (node.data.namespace != self.namespace) { node.label = node.data.svcAlias;
node.label = // if (node.data.namespace != self.namespace) {
node.data[node.data.nodeType] + "\n(" + node.data.namespace + ")"; // node.label =
} else { // node.data[node.data.nodeType] + "\n(" + node.data.namespace + ")";
node.label = node.data[node.data.nodeType]; // } else {
} // node.label = node.data[node.data.nodeType];
// }
node.labelCfg = { node.labelCfg = {
style: { style: {
fill: "#333", fill: "#333",
...@@ -416,7 +417,7 @@ export default { ...@@ -416,7 +417,7 @@ export default {
<style scoped> <style scoped>
.canvas { .canvas {
height: 600px; height: 600px;
width: 1000px; width: 100%;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
} }
......
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
}); });
}, },
getNewList(val) { getNewList(val) {
this.form.fileList = val.url; this.form.fileList = val[0].url;
console.log(this.form.fileList); console.log(this.form.fileList);
}, },
}, },
......
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
<p>当前用户类型:</p> <p>当前用户类型:</p>
<el-input v-model="user_data.userTypeName" :disabled="true"></el-input> <el-input v-model="user_data.userTypeName" :disabled="true"></el-input>
<el-button <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" class="option_btn"
@click="showUpLevel" @click="showUpLevel"
>升级为开发者</el-button> >升级为开发者</el-button>
<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" type="info"
class="option_btn_gray_dis" class="option_btn_gray_dis"
disabled disabled
...@@ -314,7 +314,7 @@ export default { ...@@ -314,7 +314,7 @@ export default {
}, },
changeTab() {}, changeTab() {},
getNewList(val) { getNewList(val) {
this.imgList[0] = val.url; this.imgList[0] = val[0].url;
}, },
previous() {}, previous() {},
registe() { registe() {
......
...@@ -408,7 +408,7 @@ export default { ...@@ -408,7 +408,7 @@ export default {
}); });
}, },
getNewList(file) { getNewList(file) {
this.app_info.logo = file.url; this.app_info.logo = file[0].url;
}, },
step1Action() { step1Action() {
this.$refs.app_info_form.validate((valid) => { this.$refs.app_info_form.validate((valid) => {
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<div ref="ResourceOverview" slot="ResourceOverview" class="params_resource_overview"> <div ref="ResourceOverview" slot="ResourceOverview" class="params_resource_overview">
{{ resourceOverview }} {{ resourceOverview }}
<el-row class="params_charts"> <el-row class="params_charts">
<el-col :span="6" class="params_col"> <el-col :span="8" class="params_col">
<div class="params_chart"> <div class="params_chart">
<dashboard ref="chart_1" :data="data1" dangerousValue="high"></dashboard> <dashboard ref="chart_1" :data="data1" dangerousValue="high"></dashboard>
</div> </div>
...@@ -172,48 +172,33 @@ ...@@ -172,48 +172,33 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="params_col"> <el-col :span="8" class="params_col">
<div class="params_chart"> <div class="params_chart">
<dashboard ref="chart_2" :data="data2" dangerousValue="high"></dashboard> <dashboard ref="chart_2" :data="data2" dangerousValue="high"></dashboard>
</div> </div>
<div class="params_chart_msg"> <div class="params_chart_msg">
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
物理总量 物理总量
<span>{{ data1.total }}GB</span> <span>{{ data2.total }}GB</span>
</div> </div>
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
剩余量 剩余量
<span>{{ data1.remaining }}GB</span> <span>{{ data2.remaining }}GB</span>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="params_col"> <el-col :span="8" class="params_col">
<div class="params_chart"> <div class="params_chart">
<dashboard ref="chart_3" :data="data3" dangerousValue="high"></dashboard> <dashboard ref="chart_4" :data="data3" dangerousValue="high"></dashboard>
</div> </div>
<div class="params_chart_msg"> <div class="params_chart_msg">
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
物理总量 物理总量
<span>{{ data1.total }}GB</span> <span>{{ data3.total }}</span>
</div> </div>
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
剩余量 剩余量
<span>{{ data1.remaining }}GB</span> <span>{{ data3.remaining }}</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>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -376,25 +361,19 @@ export default { ...@@ -376,25 +361,19 @@ export default {
resourceOverview: resourceOverview:
"当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。", "当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。",
data1: { data1: {
data: 80, data: 0,
text: "CPU已使用", text: "CPU已使用",
total: 0, total: 0,
remaining: 0 remaining: 0
}, },
data2: { data2: {
data: 60, data: 0,
text: "内存已使用", text: "内存已使用",
total: 0, total: 0,
remaining: 0 remaining: 0
}, },
data3: { data3: {
data: 40, data: 0,
text: "数据盘已使用",
total: 0,
remaining: 0
},
data4: {
data: 10,
text: "容器组已使用", text: "容器组已使用",
total: 0, total: 0,
remaining: 0 remaining: 0
...@@ -594,7 +573,6 @@ export default { ...@@ -594,7 +573,6 @@ export default {
clickTab() {}, clickTab() {},
// 根据列表参数来判断显示什么 // 根据列表参数来判断显示什么
setListWithRole() { setListWithRole() {
console.log(this.now_user + ".." + this.apply_type);
if (this.now_user == 0) { if (this.now_user == 0) {
// 普通用户 // 普通用户
if (this.use_uid == "") { if (this.use_uid == "") {
...@@ -676,25 +654,37 @@ export default { ...@@ -676,25 +654,37 @@ export default {
if (count) { if (count) {
this.data1.total = count.cpu_total; this.data1.total = count.cpu_total;
this.data1.remaining = count.cpu_total - count.cpu_use; this.data1.remaining = count.cpu_total - count.cpu_use;
this.data1.data = Math.round( if (count.cpu_total != 0 && count.cpu_use != 0) {
(count.cpu_total / count.cpu_use) * 100 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.total = count.memory_total;
this.data2.remaining = count.memory_total - count.memory_use; this.data2.remaining = count.memory_total - count.memory_use;
this.data2.data = Math.round( if (count.memory_total != 0 && count.memory_use != 0) {
(count.memory_total / count.memory_use) * 100 this.data2.data = Math.round(
); (count.memory_use / count.memory_total) * 100
this.data3.total = count.disk_total; );
this.data3.remaining = count.disk_total - count.disk_use; } else {
this.data3.data = Math.round( this.data2.data = 0;
(count.disk_total / count.disk_use) * 100 }
); this.data3.total = count.containers_total;
this.data4.total = count.containers_total; this.data3.remaining =
this.data4.remaining =
count.containers_total - count.containers_use; count.containers_total - count.containers_use;
this.data4.data = Math.round( if (count.containers_total != 0 && count.containers_use != 0) {
(count.containers_total / count.containers_use) * 100 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.containers = data.containers;
this.cloudDteail.cpu = data.cpu; this.cloudDteail.cpu = data.cpu;
...@@ -855,10 +845,10 @@ export default { ...@@ -855,10 +845,10 @@ export default {
padding: 0; padding: 0;
} }
.params_chart_msg { .params_chart_msg {
width: 120px; width: 40%;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 40px; left: 30%;
} }
.params_chart_msg_item { .params_chart_msg_item {
display: flex; display: flex;
......
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
</div> </div>
</div> </div>
<div class="btn_footer"> <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> <el-button :disabled="!resSuccess" :class="resSuccess ? 'next':''" @click="nextJcxx">下一步</el-button>
</div> </div>
</block-radius> </block-radius>
...@@ -723,7 +723,7 @@ export default { ...@@ -723,7 +723,7 @@ export default {
}, },
// edit form // edit form
getNewList(val) { getNewList(val) {
this.cover[0] = val.url; this.cover[0] = val[0].url;
}, },
previous() { previous() {
this.datasQqcs = this.request_fields; 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