This commit is contained in:
liuye
2024-02-05 10:34:56 +08:00
parent 0e94cec311
commit 212413ae5f

View File

@@ -43,7 +43,7 @@
<el-row type="flex" class="mar-t4 gap-20 chart-content"> <el-row type="flex" class="mar-t4 gap-20 chart-content">
<div class="chartBox fill"> <div class="chartBox fill">
<b>AI调用趋势图</b> <b>AI调用趋势图</b>
<div id="trendChart" style="width: 100%;" v-if="trendData.length" class="chart"></div> <div id="trendChart" style="height: 280px; width: 100%;" v-if="trendData.length" class="chart"></div>
<ai-empty v-else style="height: 200px; width: 100%;" id="empty"/> <ai-empty v-else style="height: 200px; width: 100%;" id="empty"/>
</div> </div>
<div class="chartBox fill"> <div class="chartBox fill">
@@ -52,12 +52,27 @@
:tableData="tableData" :tableData="tableData"
:col-configs="colConfigs" :col-configs="colConfigs"
:isShowPagination="false" :isShowPagination="false"
style="margin-top: 6px; width: 100%;"> style="margin-top: 6px; width: 100%; height: 280px;">
</ai-table> </ai-table>
<ai-empty v-else style="height: 200px; width: 100%;" id="empty"/> <ai-empty v-else style="height: 200px; width: 100%;" id="empty"/>
</div> </div>
</el-row> </el-row>
<el-row type="flex" class="mar-t4 gap-20">
<div class="chartBox fill">
<b>问答分类统计</b>
<div>
<div id="barChart" style="height: 260px; width: 100%;" v-if="barData.length"></div>
<ai-empty v-else style="height: 200px; width: 100%;" id="empty"/>
</div>
</div>
<div class="chartBox fill">
<b>问答分类词云</b>
<div>
<div id="wordChart" style="height: 260px; width: 100%;" v-if="wordData.length"/>
<ai-empty v-else style="height: 200px; width: 100%;" id="empty"/>
</div>
</div>
</el-row>
<ai-dialog :visible.sync="dialogDate" title="选择时间" width="500px" customFooter> <ai-dialog :visible.sync="dialogDate" title="选择时间" width="500px" customFooter>
<el-date-picker v-model="timeList" size="small" type="daterange" value-format="yyyy-MM-dd" <el-date-picker v-model="timeList" size="small" type="daterange" value-format="yyyy-MM-dd"
range-separator="" start-placeholder="开始日期" end-placeholder="结束日期"> range-separator="" start-placeholder="开始日期" end-placeholder="结束日期">
@@ -169,20 +184,11 @@ export default {
this.trendChartInit(trendX, this.trendData) this.trendChartInit(trendX, this.trendData)
}) })
} }
// this.info.ranking.map((item, index)=> {
// if(index < 100) {
// item.rank = index+1
// this.tableData.push(item)
// }
// })
} }
}) })
this.instance.post('/app/appmasssendingtaskbaidu/statistics3', null, { this.instance.post('/app/appmasssendingtaskbaidu/statistics3', null, {
params: { params: {
// deptFullId: departmentId,
areaId: this.areaId, areaId: this.areaId,
type: this.type, type: this.type,
startTime: this.startTime, startTime: this.startTime,
@@ -191,19 +197,6 @@ export default {
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.info.ranking = res.data.ranking this.info.ranking = res.data.ranking
// var trendX = []
// this.totalEcount = 0
// this.info.trend.map((item) => {
// trendX.push(item.ymd)
// this.totalEcount = this.totalEcount + item.ecount
// this.trendData.push(item.ecount)
// })
// if(this.trendData.length) {
// this.$nextTick(() => {
// this.trendChartInit(trendX, this.trendData)
// })
// }
this.info.ranking.map((item, index)=> { this.info.ranking.map((item, index)=> {
if(index < 100) { if(index < 100) {
item.rank = index+1 item.rank = index+1
@@ -213,6 +206,37 @@ export default {
} }
}) })
this.instance.post('/app/appmasssendingtaskbaidu/statistics5', null, {
params: {
areaId: this.areaId,
type: this.type,
startTime: this.startTime,
endTime: this.endTime,
}
}).then(res => {
if (res?.data) {
if(res.data.length) {
var barX = []
res.data.map((item) => {
barX.push(item.tag)
this.barData.push(item.c)
var i = { name: item.tag, value: item.c };
this.wordData.push(i);
})
if(this.barData.length) {
this.$nextTick(() => {
this.barChartInit(barX, this.barData)
})
}
if(this.wordData.length) {
this.$nextTick(() => {
this.wordChartInit(this.wordData)
})
}
}
}
})
}, },
trendChartInit(xData, yData) { trendChartInit(xData, yData) {
this.trendChart = echarts.init(document.getElementById('trendChart')) this.trendChart = echarts.init(document.getElementById('trendChart'))
@@ -412,7 +436,7 @@ export default {
height: 100%; height: 100%;
} }
.chart-content { .chart-content {
height: calc(100% - 140px); // height: calc(100% - 140px);
} }
:deep .ai-table { :deep .ai-table {
@@ -427,7 +451,7 @@ export default {
padding: 16px; padding: 16px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 6px; margin-top: 6px;
height: 100%; // height: 300px;
.chart { .chart {
width: 100%; width: 100%;