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

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

parent 275d8f3d
......@@ -2,11 +2,11 @@
<ul class="comments_list apaas_scroll">
<li class="comment_card" v-for="(item, index) in data" :key="'comment_' + index">
<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 class="comment-right">
<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>
</p>
<div class="commnet-rate">
......
......@@ -25,6 +25,8 @@ export default {
methods: {
graph() {
let self = this;
console.log(this.data.legend.data);
console.log(this.data.data);
return {
color: ["#274fee", "#ef9433"],
legend: {
......@@ -33,7 +35,7 @@ export default {
icon: "roundRect",
itemWidth: 10,
itemHeight: 10,
data: self.data.legend.data,
data: self.data.legend.data||[],
orient: "horizontal",
backgroundColor: "#f4f7fc"
},
......@@ -47,7 +49,7 @@ export default {
xAxis: [
{
type: "category",
data: self.data.data,
data: self.data.data||[],
axisLine: {
lineStyle: {
color: "#f2f2f2"
......@@ -91,9 +93,9 @@ export default {
],
series: [
{
name: self.data.series[0].name,
name: self.data.series[0].name||'',
type: "line",
data: self.data.series[0].data,
data: self.data.series[0].data||[],
symbolSize: 1,
symbol: "circle",
smooth: true,
......@@ -108,9 +110,9 @@ export default {
}
},
{
name: self.data.series[1].name,
name: self.data.series[1].name||'',
type: "line",
data: self.data.series[1].data,
data: self.data.series[1].data||[],
symbolSize: 1,
symbol: "circle",
smooth: true,
......
......@@ -69,7 +69,6 @@ export default {
};
var series = [];
yarr.forEach((e, idx) => {
series.push({
name: e.name,
......
......@@ -102,6 +102,9 @@ export default {
case 21:
this.$router.push(`/shop/zhfwDetail/${id}`);
break;
case 124:
this.$router.push(`/yygl/0/0/detail/${id.id}?source=${id.source}`);
break;
default:
this.$message({
message: "查看详情失败",
......
......@@ -57,7 +57,7 @@
@changeButton="changeServiceCellBtn"
class="block"
>
<Graph :data="graph_arr" />
<Graph v-if="JSON.stringify(graph_arr)!=='{}'" :data="graph_arr" />
</block-radius>
</el-col>
<el-col :span="24" class="in_block">
......@@ -155,7 +155,7 @@
:buttons_arr="['近14天', '近30天']"
@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>
</el-col>
</el-row>
......@@ -261,6 +261,7 @@ export default {
now_app_used_area:1,
now_app_count:14,
now_app_deploy:1,
now_app_evalute:1,
mult_data: [],
text: "应用总数",
spIndicatorStyles1: false,
......@@ -288,12 +289,12 @@ export default {
up:-19.3
},
single_data: {
num: 60,
num: 0,
color: "#274fee",
text: "平台应用"
},
single_data1: {
num: 40,
num: 0,
color: "#e56600",
text: "开发者应用"
},
......@@ -304,103 +305,11 @@ export default {
toplistData: [], // 应用部署排名分析
toplistTargetValue: 150, // 应用部署排名分析 目标值
appInfoBtnIndex: 0,
commentlistData: [
{
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: 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,
commentlistData: [], // 应用评价
starlistData: [], // 应用评分
starlistTotal: 10,
hotSearchHeader: [], // 热门搜索 表头
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
},
] // 热门搜索 数据
hotSearchData: [] // 热门搜索 数据
}),
mounted() {
this.getAppOverview()
......@@ -410,6 +319,9 @@ export default {
this.getAppUsedArea()
this.getAppCount()
this.getAppDeployRank()
this.getAppEvaluate()
this.getAppOnlineState()
this.getAppHot()
this.hotSearchHeader = [
{
label: "排名",
......@@ -514,8 +426,10 @@ export default {
service_name: e.name,
request_count: e.num,
cover:e.logo,
service_id:e.id,
data_service_type:e.type,
service_id:{
id:e.app_id,
source:e.source
},
data_service_type1:124
})
});
......@@ -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) {
console.log("查看热搜详情");
this.$router.push(`/yygl/0/0/detail/${item.id}?source=${item.source}`)
},
hotSearchSortChange(sortInfo) {
console.log("应用热门搜索: " + sortInfo);
......@@ -563,7 +561,8 @@ export default {
},
changeAppInfoBtn(index) {
this.appInfoBtnIndex = index;
this.now_app_evalute = index+1
this.getAppEvaluate()
console.log("应用评价及评分: " + index);
},
changeAppTotalChangeBtn(index) {
......
......@@ -60,6 +60,15 @@ const dataAnalysis = {
getAppDeployRank(params){
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;
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