Commit 06ce82c6 authored by 张俊's avatar 张俊

数据分析-应用分析接口调试

parent 275d8f3d
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<ul class="comments_list apaas_scroll"> <ul class="comments_list apaas_scroll">
<li class="comment_card" v-for="(item, index) in data" :key="'comment_' + index"> <li class="comment_card" v-for="(item, index) in data" :key="'comment_' + index">
<div class="comment-left"> <div class="comment-left">
<el-avatar :size="45" fit="cover" :src="item.message" /> <el-avatar :size="45" fit="cover" :src="item.picture_path" />
</div> </div>
<div class="comment-right"> <div class="comment-right">
<p class="comment-base"> <p class="comment-base">
<span class="comment-user_name text_clip" v-text="item.message"></span> <span class="comment-user_name text_clip" v-text="item.user_name"></span>
<span class="comment-time text_clip" v-text="getTimeText(item.add_time || '')"></span> <span class="comment-time text_clip" v-text="getTimeText(item.add_time || '')"></span>
</p> </p>
<div class="commnet-rate"> <div class="commnet-rate">
......
...@@ -25,6 +25,8 @@ export default { ...@@ -25,6 +25,8 @@ export default {
methods: { methods: {
graph() { graph() {
let self = this; let self = this;
console.log(this.data.legend.data);
console.log(this.data.data);
return { return {
color: ["#274fee", "#ef9433"], color: ["#274fee", "#ef9433"],
legend: { legend: {
...@@ -33,7 +35,7 @@ export default { ...@@ -33,7 +35,7 @@ export default {
icon: "roundRect", icon: "roundRect",
itemWidth: 10, itemWidth: 10,
itemHeight: 10, itemHeight: 10,
data: self.data.legend.data, data: self.data.legend.data||[],
orient: "horizontal", orient: "horizontal",
backgroundColor: "#f4f7fc" backgroundColor: "#f4f7fc"
}, },
...@@ -47,7 +49,7 @@ export default { ...@@ -47,7 +49,7 @@ export default {
xAxis: [ xAxis: [
{ {
type: "category", type: "category",
data: self.data.data, data: self.data.data||[],
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: "#f2f2f2" color: "#f2f2f2"
...@@ -91,9 +93,9 @@ export default { ...@@ -91,9 +93,9 @@ export default {
], ],
series: [ series: [
{ {
name: self.data.series[0].name, name: self.data.series[0].name||'',
type: "line", type: "line",
data: self.data.series[0].data, data: self.data.series[0].data||[],
symbolSize: 1, symbolSize: 1,
symbol: "circle", symbol: "circle",
smooth: true, smooth: true,
...@@ -108,9 +110,9 @@ export default { ...@@ -108,9 +110,9 @@ export default {
} }
}, },
{ {
name: self.data.series[1].name, name: self.data.series[1].name||'',
type: "line", type: "line",
data: self.data.series[1].data, data: self.data.series[1].data||[],
symbolSize: 1, symbolSize: 1,
symbol: "circle", symbol: "circle",
smooth: true, smooth: true,
......
...@@ -69,7 +69,6 @@ export default { ...@@ -69,7 +69,6 @@ export default {
}; };
var series = []; var series = [];
yarr.forEach((e, idx) => { yarr.forEach((e, idx) => {
series.push({ series.push({
name: e.name, name: e.name,
......
...@@ -102,6 +102,9 @@ export default { ...@@ -102,6 +102,9 @@ export default {
case 21: case 21:
this.$router.push(`/shop/zhfwDetail/${id}`); this.$router.push(`/shop/zhfwDetail/${id}`);
break; break;
case 124:
this.$router.push(`/yygl/0/0/detail/${id.id}?source=${id.source}`);
break;
default: default:
this.$message({ this.$message({
message: "查看详情失败", message: "查看详情失败",
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
@changeButton="changeServiceCellBtn" @changeButton="changeServiceCellBtn"
class="block" class="block"
> >
<Graph :data="graph_arr" /> <Graph v-if="JSON.stringify(graph_arr)!=='{}'" :data="graph_arr" />
</block-radius> </block-radius>
</el-col> </el-col>
<el-col :span="24" class="in_block"> <el-col :span="24" class="in_block">
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
:buttons_arr="['近14天', '近30天']" :buttons_arr="['近14天', '近30天']"
@changeButton="changeAppTotalChangeBtn" @changeButton="changeAppTotalChangeBtn"
> >
<line-chart class="block-radius-content" :data="line_data"></line-chart> <line-chart v-if="JSON.stringify(line_data)!=='{}'" class="block-radius-content" :data="line_data"></line-chart>
</block-radius> </block-radius>
</el-col> </el-col>
</el-row> </el-row>
...@@ -261,6 +261,7 @@ export default { ...@@ -261,6 +261,7 @@ export default {
now_app_used_area:1, now_app_used_area:1,
now_app_count:14, now_app_count:14,
now_app_deploy:1, now_app_deploy:1,
now_app_evalute:1,
mult_data: [], mult_data: [],
text: "应用总数", text: "应用总数",
spIndicatorStyles1: false, spIndicatorStyles1: false,
...@@ -288,12 +289,12 @@ export default { ...@@ -288,12 +289,12 @@ export default {
up:-19.3 up:-19.3
}, },
single_data: { single_data: {
num: 60, num: 0,
color: "#274fee", color: "#274fee",
text: "平台应用" text: "平台应用"
}, },
single_data1: { single_data1: {
num: 40, num: 0,
color: "#e56600", color: "#e56600",
text: "开发者应用" text: "开发者应用"
}, },
...@@ -304,103 +305,11 @@ export default { ...@@ -304,103 +305,11 @@ export default {
toplistData: [], // 应用部署排名分析 toplistData: [], // 应用部署排名分析
toplistTargetValue: 150, // 应用部署排名分析 目标值 toplistTargetValue: 150, // 应用部署排名分析 目标值
appInfoBtnIndex: 0, appInfoBtnIndex: 0,
commentlistData: [ commentlistData: [], // 应用评价
{ starlistData: [], // 应用评分
add_time: "2020-07-14T16:35:40Z", starlistTotal: 10,
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 5,
service_id: 128,
user_name: "普通用户lxy"
},
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 4,
service_id: 128,
user_name: "普通用户lxy"
},
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 3,
service_id: 128,
user_name: "普通用户lxy"
},
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 2,
service_id: 128,
user_name: "普通用户lxy"
}
], // 应用评价
starlistData: [
{
star: 5,
count: 5,
unit: ""
},
{
star: 4,
count: 4,
unit: ""
},
{
star: 3,
count: 3,
unit: ""
},
{
star: 2,
count: 2,
unit: ""
},
{
star: 1,
count: 1,
unit: ""
}
], // 应用评分
starlistTotal: 15,
hotSearchHeader: [], // 热门搜索 表头 hotSearchHeader: [], // 热门搜索 表头
hotSearchData: [ hotSearchData: [] // 热门搜索 数据
{
hotIndex: 1,
name: "mapvideos",
count: 29,
increases: 0.28
},
{
hotIndex: 2,
name: "语音识别",
count: 27,
increases: 0.24
},
{
hotIndex: 3,
name: "轨迹绘制",
count: 15,
increases: 0.12
},
{
hotIndex: 4,
name: "postgresql",
count: 12,
increases: -0.05
},
] // 热门搜索 数据
}), }),
mounted() { mounted() {
this.getAppOverview() this.getAppOverview()
...@@ -410,6 +319,9 @@ export default { ...@@ -410,6 +319,9 @@ export default {
this.getAppUsedArea() this.getAppUsedArea()
this.getAppCount() this.getAppCount()
this.getAppDeployRank() this.getAppDeployRank()
this.getAppEvaluate()
this.getAppOnlineState()
this.getAppHot()
this.hotSearchHeader = [ this.hotSearchHeader = [
{ {
label: "排名", label: "排名",
...@@ -514,8 +426,10 @@ export default { ...@@ -514,8 +426,10 @@ export default {
service_name: e.name, service_name: e.name,
request_count: e.num, request_count: e.num,
cover:e.logo, cover:e.logo,
service_id:e.id, service_id:{
data_service_type:e.type, id:e.app_id,
source:e.source
},
data_service_type1:124 data_service_type1:124
}) })
}); });
...@@ -523,8 +437,92 @@ export default { ...@@ -523,8 +437,92 @@ export default {
} }
}) })
}, },
getAppEvaluate(){
this.$api.dataAnalysis.getAppEvaluate({type:this.now_app_evalute}).then(response => {
if (response.data.success == 1) {
let data = response.data.data
if(this.now_app_evalute==1){
this.commentlistData = []
if(data&&data.length){
data.forEach(e => {
this.commentlistData.push({
add_time: e.add_time,
message: e.content,
picture_path: e.picture_path,
score: e.score,
user_name: e.picture_path,
})
});
}
}else{
this.starlistTotal = 10
this.starlistData = []
var temp = []
if(data&&data.length){
data.forEach(e => {
temp.push(e.num)
this.starlistData.push({
star: e.name,
count: e.num,
})
});
this.starlistTotal = Math.max(...temp)
}
}
}
})
},
getAppOnlineState(){
this.$api.dataAnalysis.getAppOnlineState().then(response =>{
if (response.data.success == 1) {
let data = response.data.data
this.single_data = {
num: data.platform,
color: "#274fee",
text: "平台应用"
}
this.single_data1= {
num: data.develop,
color: "#e56600",
text: "开发者应用"
}
}
})
},
getAppHot(){
this.$api.dataAnalysis.getAppHot().then(response =>{
if (response.data.success == 1) {
let data = response.data.data
let user = data.user||{}
let ave_search = data.ave_search||{}
let search_app = data.search_app||[]
this.sparkline1={
arr:user.line_chart?user.line_chart.series[0].data:[],
num:user.today_num?user.today_num:0,
up:user.ratio?parseFloat(user.ratio):0
}
this.sparkline2={
arr:ave_search.line_chart?ave_search.line_chart.series[0].data:[],
num:ave_search.today_num?ave_search.today_num:0,
up:ave_search.ratio?parseFloat(ave_search.ratio):0
}
this.hotSearchData = []
search_app.forEach((e,idx) => {
this.hotSearchData.push({
id:e.app_id,
source:e.source,
hotIndex:idx + 1,
name: e.name,
count: e.num,
increases: parseFloat(e.ratio)
})
});
}
})
},
detailHotSearch(item) { detailHotSearch(item) {
console.log("查看热搜详情"); console.log("查看热搜详情");
this.$router.push(`/yygl/0/0/detail/${item.id}?source=${item.source}`)
}, },
hotSearchSortChange(sortInfo) { hotSearchSortChange(sortInfo) {
console.log("应用热门搜索: " + sortInfo); console.log("应用热门搜索: " + sortInfo);
...@@ -563,7 +561,8 @@ export default { ...@@ -563,7 +561,8 @@ export default {
}, },
changeAppInfoBtn(index) { changeAppInfoBtn(index) {
this.appInfoBtnIndex = index; this.appInfoBtnIndex = index;
this.now_app_evalute = index+1
this.getAppEvaluate()
console.log("应用评价及评分: " + index); console.log("应用评价及评分: " + index);
}, },
changeAppTotalChangeBtn(index) { changeAppTotalChangeBtn(index) {
......
...@@ -60,6 +60,15 @@ const dataAnalysis = { ...@@ -60,6 +60,15 @@ const dataAnalysis = {
getAppDeployRank(params){ getAppDeployRank(params){
return axios.get(`/apaas/hubApi/analysis/deployRank?style=${params.type}`); return axios.get(`/apaas/hubApi/analysis/deployRank?style=${params.type}`);
}, },
getAppEvaluate(params){
return axios.get(`/apaas/hubApi/analysis/commentScores?style=${params.type}`);
},
getAppOnlineState(){
return axios.get(`/apaas/hubApi/analysis/onlineAreas`);
},
getAppHot(){
return axios.get(`/apaas/hubApi/analysis/appSearch`);
},
} }
export default dataAnalysis; export default dataAnalysis;
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