Commit 21e196d5 authored by 张俊's avatar 张俊

工作台首页图表

parent 14f1e993
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<div class="data_charts_left" style="width:420px;margin-left:40px;"> <div class="data_charts_left" style="width:420px;margin-left:40px;">
<p> <p>
<span></span> 服务应用总况 <span></span> 服务应用总况
<el-select v-model="fw_value" placeholder="请选择"> <el-select v-model="fw_value" @change="change_service_app" placeholder="请选择">
<el-option <el-option
v-for="item in fw_options" v-for="item in fw_options"
:key="item.value" :key="item.value"
...@@ -818,7 +818,7 @@ export default { ...@@ -818,7 +818,7 @@ export default {
pic: require("@/assets/imgs/ic_fuwuzs_navy.png"), pic: require("@/assets/imgs/ic_fuwuzs_navy.png"),
bg: "#e6ebfe", bg: "#e6ebfe",
color: "#515fe7", color: "#515fe7",
type: "service", type: "service_count",
num: "", num: "",
}, },
{ {
...@@ -826,7 +826,7 @@ export default { ...@@ -826,7 +826,7 @@ export default {
pic: require("@/assets/imgs/ic_yingyongzs.png"), pic: require("@/assets/imgs/ic_yingyongzs.png"),
bg: "#e5f4fe", bg: "#e5f4fe",
color: "#38aef9", color: "#38aef9",
type: "app", type: "app_count",
num: "", num: "",
}, },
{ {
...@@ -834,7 +834,7 @@ export default { ...@@ -834,7 +834,7 @@ export default {
pic: require("@/assets/imgs/ic_shouyize.png"), pic: require("@/assets/imgs/ic_shouyize.png"),
bg: "#fcefd6", bg: "#fcefd6",
color: "#ea7d19", color: "#ea7d19",
type: "getMoney", type: "earnings_money",
num: "", num: "",
}, },
], ],
...@@ -844,7 +844,7 @@ export default { ...@@ -844,7 +844,7 @@ export default {
pic: require("@/assets/imgs/ic_yonghuzs.png"), pic: require("@/assets/imgs/ic_yonghuzs.png"),
bg: "#e6ebfe", bg: "#e6ebfe",
color: "#515fe7", color: "#515fe7",
type: "areaUser", type: "org_user",
num: "", num: "",
}, },
{ {
...@@ -852,7 +852,7 @@ export default { ...@@ -852,7 +852,7 @@ export default {
pic: require("@/assets/imgs/ic_fuwuzs.png"), pic: require("@/assets/imgs/ic_fuwuzs.png"),
bg: "#e5f4fe", bg: "#e5f4fe",
color: "#38aef9", color: "#38aef9",
type: "service", type: "service_count",
num: "", num: "",
}, },
{ {
...@@ -860,15 +860,15 @@ export default { ...@@ -860,15 +860,15 @@ export default {
pic: require("@/assets/imgs/ic_yingyongzs.png"), pic: require("@/assets/imgs/ic_yingyongzs.png"),
bg: "#e7fdfc", bg: "#e7fdfc",
color: "#25bdb1", color: "#25bdb1",
type: "app", type: "app_count",
num: "", num: "",
}, },
{ {
text: "收益总额", text: "交易总额",
pic: require("@/assets/imgs/ic_shouyize.png"), pic: require("@/assets/imgs/ic_shouyize.png"),
bg: "#fcefd6", bg: "#fcefd6",
color: "#ea7d19", color: "#ea7d19",
type: "getMoney", type: "trade_money",
num: "", num: "",
}, },
], ],
...@@ -878,7 +878,7 @@ export default { ...@@ -878,7 +878,7 @@ export default {
pic: require("@/assets/imgs/ic_yonghuzs.png"), pic: require("@/assets/imgs/ic_yonghuzs.png"),
bg: "#e6ebfe", bg: "#e6ebfe",
color: "#515fe7", color: "#515fe7",
type: "allUser", type: "total_user",
num: "", num: "",
}, },
{ {
...@@ -886,7 +886,7 @@ export default { ...@@ -886,7 +886,7 @@ export default {
pic: require("@/assets/imgs/ic_fuwuzs.png"), pic: require("@/assets/imgs/ic_fuwuzs.png"),
bg: "#e5f4fe", bg: "#e5f4fe",
color: "#38aef9", color: "#38aef9",
type: "service", type: "service_count",
num: "", num: "",
}, },
{ {
...@@ -894,15 +894,15 @@ export default { ...@@ -894,15 +894,15 @@ export default {
pic: require("@/assets/imgs/ic_yingyongzs.png"), pic: require("@/assets/imgs/ic_yingyongzs.png"),
bg: "#e7fdfc", bg: "#e7fdfc",
color: "#25bdb1", color: "#25bdb1",
type: "app", type: "app_count",
num: "", num: "",
}, },
{ {
text: "收益总额", text: "交易总额",
pic: require("@/assets/imgs/ic_shouyize.png"), pic: require("@/assets/imgs/ic_shouyize.png"),
bg: "#fcefd6", bg: "#fcefd6",
color: "#ea7d19", color: "#ea7d19",
type: "getMoney", type: "trade_money",
num: "", num: "",
}, },
], ],
...@@ -962,6 +962,7 @@ export default { ...@@ -962,6 +962,7 @@ export default {
["应用仓库", "应用审批"], ["应用仓库", "应用审批"],
], ],
app_arr: [], app_arr: [],
service_app_count:{},
manage_arr: [ manage_arr: [
{ {
pic: require("@/assets/imgs/home_tool_ic_organize.png"), pic: require("@/assets/imgs/home_tool_ic_organize.png"),
...@@ -1168,23 +1169,32 @@ export default { ...@@ -1168,23 +1169,32 @@ export default {
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
change_service_app(val){
console.log(val);
if(val == 0){
this.init_fwyy(this.service_app_count.serviceData.xAxisData, this.service_app_count.serviceData.seriesData,val);
}else{
this.init_fwyy(this.service_app_count.appData.xAxisData, this.service_app_count.appData.seriesData,val);
}
},
getappusedata() { getappusedata() {
this.$http this.$http
.get("./static/workpalce.json") .get("/apaas/service/v3/workplace/statistics/serviceapp/count/trend")
.then((response) => { .then((response) => {
console.log(response); console.log(response);
let data = response.data.data; let data = response.data.data;
this.init_fwyy(data.appusedata.xarr, data.appusedata.yarr); this.service_app_count = data
this.init_fwyy(this.service_app_count.serviceData.xAxisData, this.service_app_count.serviceData.seriesData,this.fw_value);
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
getfwlxdata() { getfwlxdata() {
this.$http this.$http
.get("./static/workpalce.json") .get("/apaas/service/v3/workplace/statistics/service/type")
.then((response) => { .then((response) => {
console.log(response); console.log(response);
let data = response.data.data; let data = response.data.data;
this.init_fwlx_asy(data.fwlxdata); this.init_fwlx_asy(data.seriesData);
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
...@@ -1202,11 +1212,13 @@ export default { ...@@ -1202,11 +1212,13 @@ export default {
}, },
getHealth() { getHealth() {
this.$http this.$http
.get("./static/workpalce.json") .get("/apaas/service/v3/workplace/statistics/health/status")
.then((response) => { .then((response) => {
console.log(response); console.log(response);
let data = response.data.data; let data = response.data.data;
this.init_health(data.health); var temp = Math.round(data.seriesData[0].value/(data.seriesData[0].value+data.seriesData[1].value)*100)
console.log(temp);
this.init_health(temp);
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
...@@ -1222,16 +1234,16 @@ export default { ...@@ -1222,16 +1234,16 @@ export default {
}, },
getInfoData() { getInfoData() {
this.$http this.$http
.get("./static/workpalce.json") .get("/apaas/service/v3/workplace/statistics/basic")
.then((response) => { .then((response) => {
console.log(response); console.log(response);
let data = response.data.data; let data = response.data.data;
this.menu_arr[this.now_user].forEach((e, idx) => { this.menu_arr[this.now_user].forEach((e, idx) => {
if (data.infodata[e.type]) { if (data[e.type]||data[e.type]==0) {
this.$set( this.$set(
this.menu_arr[this.now_user][idx], this.menu_arr[this.now_user][idx],
"num", "num",
data.infodata[e.type] data[e.type]
); );
} }
}); });
...@@ -1566,7 +1578,7 @@ export default { ...@@ -1566,7 +1578,7 @@ export default {
window[this.yy_asy] = echarts.init(document.getElementById(this.yy_asy)); window[this.yy_asy] = echarts.init(document.getElementById(this.yy_asy));
window[this.yy_asy].setOption(options, true); window[this.yy_asy].setOption(options, true);
}, },
init_fwyy(xarr, yarr) { init_fwyy(xarr, yarr,n) {
var dataname = ["服务总数", "应用总数"]; var dataname = ["服务总数", "应用总数"];
var options = { var options = {
tooltip: { tooltip: {
...@@ -1578,7 +1590,7 @@ export default { ...@@ -1578,7 +1590,7 @@ export default {
}, },
}, },
legend: { legend: {
data: [dataname[0]], data: [dataname[n]],
itemWidth: 14, itemWidth: 14,
itemHeight: 10, itemHeight: 10,
bottom: 0, bottom: 0,
...@@ -1615,7 +1627,7 @@ export default { ...@@ -1615,7 +1627,7 @@ export default {
{ {
data: yarr, data: yarr,
type: "line", type: "line",
name: dataname[0], name: dataname[n],
smooth: true, smooth: true,
sampling: "average", sampling: "average",
symbol: "circle", symbol: "circle",
......
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