| | |
| | | <template> |
| | | <div class="dataStatistics"> |
| | | <div class="box_div dataStatistics"> |
| | | <My-bread :list="[ |
| | | `${$t('dataManage.dataManage')}`, |
| | | `${$t('dataManage.dataStatistics')}`, |
| | |
| | | style="border: 1px solid #dcdfe6;" |
| | | > |
| | | <div |
| | | class="iquery subpage_Div" |
| | | class=" subpage_Div iquery" |
| | | style="padding-bottom: 14px" |
| | | > |
| | | <div> |
| | | <el-button |
| | | icon="el-icon-c-scale-to-original" |
| | | size="small" |
| | | type="warning" |
| | | @click="setCountFlagChange(1)" |
| | | >{{ $t("shuJuGuanLi.butten.Report") }}</el-button> |
| | | <el-button |
| | | icon="el-icon-pie-chart" |
| | | size="small" |
| | | type="primary" |
| | | @click="setCountFlagChange(2)" |
| | | >{{ $t("shuJuGuanLi.butten.Histogram") }}</el-button> |
| | | <el-button |
| | | icon="el-icon-download" |
| | | size="small" |
| | | type="success" |
| | | @click="setCountFlagChange(3)" |
| | | >{{ $t("shuJuGuanLi.butten.Download") }}</el-button> |
| | | |
| | | <el-form |
| | | :inline="true" |
| | | :model="tjlxData" |
| | | class="demo-form-inline" |
| | | > |
| | | <el-form-item |
| | | label="统计类型" |
| | | v-show="!setCountFlag && tjlxData.flag" |
| | | > |
| | | <el-select |
| | | v-model="tjlxData.region" |
| | | size="small" |
| | | @change="setTjlxDataChange" |
| | | > |
| | | |
| | | <el-option |
| | | label="数据存储量" |
| | | value="sjccl" |
| | | > |
| | | </el-option> |
| | | <el-option |
| | | label="数据条数" |
| | | value="sjts" |
| | | > |
| | | |
| | | </el-option> |
| | | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | icon="el-icon-c-scale-to-original" |
| | | size="small" |
| | | type="warning" |
| | | @click="setCountFlagChange(1)" |
| | | >{{ $t("shuJuGuanLi.butten.Report") }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | icon="el-icon-pie-chart" |
| | | size="small" |
| | | type="primary" |
| | | @click="setCountFlagChange(2)" |
| | | >{{ $t("shuJuGuanLi.butten.Histogram") }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | icon="el-icon-download" |
| | | size="small" |
| | | type="success" |
| | | @click="setCountFlagChange(3)" |
| | | >{{ $t("shuJuGuanLi.butten.Download") }}</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="dividing-line"></div> |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizes'" |
| | | prop="count" |
| | | prop="sizes" |
| | | key="4" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type4')" |
| | | :formatter="formatterColumn" |
| | | > |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizes'" |
| | | prop="count" |
| | | key="4" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type8')" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="queryData.value == 'countOperates'" |
| | | prop="m1" |
| | |
| | | :label="$t('dataManage.dataStaticObj.type7')" |
| | | > |
| | | </el-table-column> |
| | | |
| | | <!-- <el-table-column |
| | | v-if="queryData.value == 'countOperates'" |
| | | prop="m2" |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizesByType'" |
| | | prop="m1" |
| | | key="3" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type6')" |
| | | :label="$t('common.fileType')" |
| | | > |
| | | </el-table-column> --> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizesByType'" |
| | | prop="sizes" |
| | | key="4" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type4')" |
| | | :formatter="formatterColumn" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizesByType'" |
| | | prop="count" |
| | | key="4" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type8')" |
| | | > |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizesByPrj'" |
| | | prop="m1" |
| | | key="3" |
| | | align="center" |
| | | :label="$t('dataManage.projectObj.projname')" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizesByPrj'" |
| | | prop="sizes" |
| | | key="4" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type4')" |
| | | :formatter="formatterColumn" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="queryData.value == 'countSizesByPrj'" |
| | | prop="count" |
| | | key="4" |
| | | align="center" |
| | | :label="$t('dataManage.dataStaticObj.type8')" |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- <div class="pagination_box"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="listData.pageIndex" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | :page-size="listData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="listData.count" |
| | | > |
| | | </el-pagination> |
| | | </div> --> |
| | | |
| | | </div> |
| | | <div |
| | | id="contentEchart subpage_Div" |
| | |
| | | dataCount_selectCountServices, |
| | | dataCount_selectCountSizes, |
| | | dataCount_downloadReport, |
| | | dataCount_countSizesByType, |
| | | dataCount_countSizesByPrj |
| | | } from "../../api/api.js"; |
| | | export default { |
| | | name: "DataStatistics", |
| | |
| | | return { |
| | | treeData: [ |
| | | { |
| | | id: 1, |
| | | label: "服务调用量统计", |
| | | value: "countServices", |
| | | id: 5, |
| | | label: "项目统计数据", |
| | | value: "countSizesByPrj", |
| | | children: [], |
| | | }, |
| | | { |
| | | }, { |
| | | id: 2, |
| | | label: "数据量统计", |
| | | label: "单位数据统计", |
| | | value: "countSizes", |
| | | children: [], |
| | | }, { |
| | | id: 4, |
| | | label: "数据格式统计", |
| | | value: "countSizesByType", |
| | | children: [], |
| | | }, |
| | | { |
| | |
| | | label: "用户流量统计", |
| | | value: "countOperates", |
| | | children: [], |
| | | }, { |
| | | id: 1, |
| | | label: "服务调用量统计", |
| | | value: "countServices", |
| | | children: [], |
| | | }, |
| | | ], |
| | | |
| | | ], |
| | | tjlxData: { |
| | | region: 'sjccl', |
| | | flag: false, |
| | | }, |
| | | defaultProps: { |
| | | children: "children", |
| | | label: "label", |
| | |
| | | tableData: [], |
| | | modelData: [], |
| | | queryData: null, |
| | | setCountFlag: true, |
| | | setCountFlag: false, |
| | | option: null, |
| | | showDownLoadFlag: false, |
| | | |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.setStartDataCount(); |
| | | }, |
| | | methods: { |
| | | setTjlxDataChange() { |
| | | this.showCountEchart() |
| | | }, |
| | | formatterColumn(row, column, cellValue, index) { |
| | | return row.count + "MB"; |
| | | |
| | | return (row.sizes / 1024).toFixed(6) + "GB" |
| | | }, |
| | | setDownLoadRow(rows) { |
| | | var url = |
| | |
| | | dom.removeAttribute("_echarts_instance_"); // 移除容器上的 _echarts_instance |
| | | } |
| | | var resizeMainContainer = function () { |
| | | dom.style.width = window.innerWidth * 0.65 + "px"; |
| | | dom.style.height = window.innerHeight * 0.6 + "px"; |
| | | dom.style.width = window.innerWidth * 0.75 + "px"; |
| | | dom.style.height = window.innerHeight * 0.75 + "px"; |
| | | }; |
| | | //设置div容器高宽 |
| | | resizeMainContainer(); |
| | |
| | | |
| | | var app = {}; |
| | | let dataAxis = []; |
| | | let yMax = 0; |
| | | this.option = {} |
| | | |
| | | let data = []; |
| | | let yMax = 0; |
| | | for (var i in this.tableData) { |
| | | if (this.tableData[i].count > yMax) { |
| | | yMax = this.tableData[i].count; |
| | | window.sjName = this.queryData.value |
| | | window.sjType = this.tjlxData.region |
| | | if (sjName == 'countServices' || sjName == 'countOperates') { |
| | | for (var i in this.tableData) { |
| | | if (this.tableData[i].count > yMax) { |
| | | yMax = this.tableData[i].count; |
| | | } |
| | | data.push(this.tableData[i].count); |
| | | var m1 = this.tableData[i].m1; |
| | | dataAxis.push(m1); |
| | | } |
| | | debugger |
| | | } else { |
| | | for (var i in this.tableData) { |
| | | if (this.tableData[i].count > yMax) { |
| | | yMax = this.tableData[i].count; |
| | | } |
| | | if (sjType == 'sjts') { |
| | | data.push(this.tableData[i].count); |
| | | } else if (sjType == 'sjccl') { |
| | | data.push((this.tableData[i].sizes / 1024).toFixed(6)); |
| | | |
| | | data.push(this.tableData[i].count); |
| | | var m1 = this.tableData[i].m1; |
| | | if (this.tableData[i].m2 != null) { |
| | | m1 += "_" + this.tableData[i].m2; |
| | | } |
| | | var m1 = this.tableData[i].m1; |
| | | dataAxis.push(m1); |
| | | } |
| | | dataAxis.push(m1); |
| | | } |
| | | |
| | | yMax = yMax + 10; |
| | | let dataShadow = []; |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | dataShadow.push(yMax); |
| | | } |
| | |
| | | type: "line", // 默认为直线,可选为:'line' | 'shadow' |
| | | }, |
| | | |
| | | formatter: " {b} : <br/>统计量 : {c}", |
| | | formatter: function (params) { |
| | | var p_name = params[0].axisValue; |
| | | var p_val; |
| | | if (sjName == 'countServices' || sjName == 'countOperates') { |
| | | p_val = p_name + '<br/>访问次数 :' + params[0].data + '次' |
| | | |
| | | } else { |
| | | if (sjType == 'sjts') { |
| | | p_val = p_name + '<br/>数据条数:' + params[0].data + '条' |
| | | } else { |
| | | p_val = p_name + '<br/>数据存储量:' + params[0].data + 'GB' |
| | | } |
| | | } |
| | | return p_val; |
| | | }, |
| | | }, |
| | | xAxis: { |
| | | data: dataAxis, |
| | |
| | | z: 10, |
| | | }, |
| | | yAxis: { |
| | | name: name, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | |
| | | |
| | | // Enable data zoom when user click bar. |
| | | const zoomSize = 6; |
| | | myChart.on("click", function (params) { |
| | |
| | | }); |
| | | this.listData.code = this.queryData.value; |
| | | this.setQueryCountData(); |
| | | |
| | | }, |
| | | //树点击事件 |
| | | handleNodeClick(data, node, prop) { |
| | | this.setCountFlag = true; |
| | | this.setCountFlag = false; |
| | | this.queryData = data; |
| | | this.listData.code = data.value; |
| | | this.listData.pageIndex = 1; |
| | | this.listData.pageSize = 10; |
| | | this.setQueryCountData(); |
| | | }, |
| | | handleIsopenSelect() { |
| | | this.$forceUpdate() |
| | | }, |
| | | //查询统计信息 |
| | | async setQueryCountData() { |
| | | this.tjlxData.region = 'sjccl'; |
| | | var data, val; |
| | | if (this.queryData.value == "countServices") { |
| | | data = await dataCount_selectCountServices(); |
| | |
| | | data = await dataCount_selectCountSizes(); |
| | | } else if (this.queryData.value == "countOperates") { |
| | | data = await dataCount_selectCountOperates(); |
| | | } else if (this.queryData.value == "countSizesByType") { |
| | | data = await dataCount_countSizesByType(); |
| | | } else if (this.queryData.value == "countSizesByPrj") { |
| | | data = await dataCount_countSizesByPrj(); |
| | | } |
| | | |
| | | if (this.queryData.value == 'countServices' || this.queryData.value == 'countOperates') { |
| | | this.tjlxData.flag = false; |
| | | debugger |
| | | } else { |
| | | this.tjlxData.flag = true; |
| | | } |
| | | |
| | | |
| | | if (data.code != 200) { |
| | | return; |
| | | } |
| | | |
| | | if (this.queryData.value == "countSizes") { |
| | | for (var i in data.result) { |
| | | data.result[i].count = data.result[i].sizes; |
| | | } |
| | | } |
| | | // if (this.queryData.value == "countSizes") { |
| | | // // for (var i in data.result) { |
| | | // // data.result[i].count = data.result[i].sizes; |
| | | // // } |
| | | // } |
| | | |
| | | if (this.queryData.value == "countOperates") { |
| | | for (var i in data.result) { |
| | |
| | | } |
| | | |
| | | this.tableData = data.result; |
| | | this.showCountEchart(); |
| | | this.$nextTick(() => { |
| | | this.$refs.table.doLayout(); |
| | | }); |
| | |
| | | |
| | | <style lang="less" scoped> |
| | | .dataStatistics { |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 1%; |
| | | width: calc(100% - 20px); |
| | | height: calc(100% - 20px); |
| | | padding: 10px; |
| | | position: relative; |
| | | overflow: hidden; |
| | | .contentBox { |
| | | padding-top: 10px; |
| | | height: calc(98% - 63px); |
| | | |
| | | height: calc(100% - 50px); |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | .content_Left { |
| | | width: 18%; |
| | | width: 15%; |
| | | height: calc(95% - 2px); |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | } |
| | | .content_Right { |
| | | width: 77%; |
| | | width: 80%; |
| | | height: calc(95% - 2px); |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | |
| | | border-radius: 5px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding: 0px !important; |
| | | } |
| | | .contentTable { |
| | | width: 98%; |