Browse Source

公众服务统计相关bug

wangqin
lau572 6 months ago
parent
commit
e13509367f
  1. 54
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/nucleusThrough/assets/charts3.js
  2. 19
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/nucleusThrough/index.vue
  3. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/postTrendsDay/assets/charts.js
  4. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/postTrendsMonth/assets/charts.js
  5. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/postTrendsMonth/index.vue
  6. 13
      ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/index.vue

54
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/nucleusThrough/assets/charts3.js

@ -36,7 +36,7 @@ const series = event_channel.map((name, sid) => {
} else { } else {
return Math.round(params.value * 1000) / 10 + '%' return Math.round(params.value * 1000) / 10 + '%'
} }
} }
}, },
data: [] data: []
@ -68,7 +68,11 @@ var options = {
containLabel: true, containLabel: true,
}, },
yAxis: { yAxis: {
type: 'value' type: 'value',
axisLabel: {
fontSize: 10,
color: "#fff",
},
}, },
@ -84,30 +88,30 @@ var options = {
fontSize: 10, fontSize: 10,
color: "#fff", color: "#fff",
}, },
formatter:function(value) formatter:function(value)
{ {
var ret = "";//拼接加\n返回的类目项 var ret = "";//拼接加\n返回的类目项
var maxLength = 2;//每项显示文字个数 var maxLength = 2;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数 var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1)//如果类目项的文字大于3, if (rowN > 1)//如果类目项的文字大于3,
{ {
for (var i = 0; i < rowN; i++) { for (var i = 0; i < rowN; i++) {
var temp = "";//每次截取的字符串 var temp = "";//每次截取的字符串
var start = i * maxLength;//开始截取的位置 var start = i * maxLength;//开始截取的位置
var end = start + maxLength;//结束截取的位置 var end = start + maxLength;//结束截取的位置
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
temp = value.substring(start, end) + "\n"; temp = value.substring(start, end) + "\n";
ret += temp; //凭借最终的字符串 ret += temp; //凭借最终的字符串
} }
return ret; return ret;
} }
else { else {
return value; return value;
} }
} }
}, },
}, },
series series
}; };
export default options; export default options;

19
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/nucleusThrough/index.vue

@ -25,13 +25,15 @@
size="mini" size="mini"
class="btnSearch" class="btnSearch"
icon="el-icon-search" icon="el-icon-search"
@click="bindEventTypePublishManageMonth"
>查询</el-button >查询</el-button
> >
<el-button class="btnReset" size="mini" icon="el-icon-refresh-left" <el-button class="btnReset" size="mini" icon="el-icon-refresh-left"
>重置</el-button @click="init"
>重置</el-button
> >
</div> </div>
<div class="charts keep-ratio" id="nucleusThrough"></div> <div class="charts" id="nucleusThrough"></div>
</div> </div>
</div> </div>
</template> </template>
@ -59,6 +61,9 @@ export default {
this.bindEventTypePublishManageMonth(); this.bindEventTypePublishManageMonth();
}, },
bindEventTypePublishManageMonth(){ bindEventTypePublishManageMonth(){
if (!this.dateTime){
return this.$modal.msgWarning("请选择日期");
}
request({ request({
url: `/business/manage/eventTypePublishManageMonth`, url: `/business/manage/eventTypePublishManageMonth`,
method: "post", method: "post",
@ -88,11 +93,11 @@ export default {
// }); // });
// var myChart = echarts.init(document.getElementById("postTrendsMonth")); // var myChart = echarts.init(document.getElementById("postTrendsMonth"));
// myChart.setOption(chartsStatistics); // myChart.setOption(chartsStatistics);
}) })
}, },
}, },
mounted() { mounted() {
this.init(); this.init();
// setTimeout(() => { // setTimeout(() => {
// this.$nextTick(() => { // this.$nextTick(() => {
@ -131,11 +136,11 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
height: 40px; height: 40px;
width: 50%; width: 35%;
font-size: 14px; font-size: 14px;
margin-bottom: 10px; margin-bottom: 10px;
left: 20px; left: 10px;
top: 2px; top: 5px;
z-index: 9; z-index: 9;
div { div {

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/postTrendsDay/assets/charts.js

@ -92,7 +92,7 @@ var options = {
grid: { grid: {
top: "75px", //上边距 top: "75px", //上边距
right: "0", //右边距 right: "0", //右边距
left: "0", //左边距 left: "3px", //左边距
bottom: "20px", //下边距 bottom: "20px", //下边距
containLabel: true, containLabel: true,
}, },

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/postTrendsMonth/assets/charts.js

@ -91,7 +91,7 @@ var options = {
grid: { grid: {
top: "80px", //上边距 top: "80px", //上边距
right: "0", //右边距 right: "0", //右边距
left: "0", //左边距 left: "3px", //左边距
bottom: "20px", //下边距 bottom: "20px", //下边距
containLabel: true, containLabel: true,
}, },

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/postTrendsMonth/index.vue

@ -65,7 +65,7 @@ export default {
}); });
var myChart = echarts.init(document.getElementById("postTrendsMonth")); var myChart = echarts.init(document.getElementById("postTrendsMonth"));
myChart.setOption(chartsStatistics); myChart.setOption(chartsStatistics);
}) })
}, },
init(){ init(){
this.dateTime = new Date(); this.dateTime = new Date();

13
ruoyi-ui/src/views/JiHeExpressway/pages/service/publicService/components/record/index.vue

@ -20,10 +20,10 @@
:formConfigOptions="{ dFormData: { eventState: '0' } }" @handleSearch="handleSearch" /> :formConfigOptions="{ dFormData: { eventState: '0' } }" @handleSearch="handleSearch" />
</div> </div>
<!-- 内容 --> <!-- 内容 -->
<Table :data="tableData" height="100%" style="width:500"> <Table :data="tableData" height="100%" style="width:1880px">
<el-table-column label="序号" type="index" :index="indexMethod" width="100" align="center" <el-table-column label="序号" type="index" :index="indexMethod" width="100" align="center"
header-align="center" /> header-align="center" />
<ElTableColumn label="发布渠道" prop="publishChannels" width="120" align="center" header-align="center"> <ElTableColumn label="发布渠道" prop="publishChannels" width="120" align="center" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ enum_channels[scope.row.publishChannels-1] }} {{ enum_channels[scope.row.publishChannels-1] }}
@ -114,7 +114,7 @@ export default {
}, },
onDelete(id){ onDelete(id){
const self = this; const self = this;
this.$confirm("是否删除?"+id, "警告", { this.$confirm("是否删除?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
@ -152,7 +152,7 @@ export default {
responseType: 'blob', responseType: 'blob',
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
const url = window.URL.createObjectURL(new Blob([res])); const url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
@ -173,7 +173,7 @@ export default {
}, },
handleSearch(data) { handleSearch(data) {
let daterange = data.daterange; let daterange = data.daterange;
let _searchData = { let _searchData = {
pageSize: 20, pageSize: 20,
pageNum: 1 pageNum: 1
@ -201,6 +201,7 @@ export default {
request({ request({
url: `/business/manage/statisticsList`, url: `/business/manage/statisticsList`,
method: "post", method: "post",
params: { pageNum: this.searchData.pageNum, pageSize: this.searchData.pageSize },
data: this.searchData, data: this.searchData,
}).then((result) => { }).then((result) => {
if (result.code != 200) return Message.error(result?.msg); if (result.code != 200) return Message.error(result?.msg);
@ -208,7 +209,7 @@ export default {
this.total = result.total; this.total = result.total;
}); });
}, },
onSizeChange(pageSize) { onSizeChange(pageSize) {
this.tableData = []; this.tableData = [];
this.searchData.pageSize = pageSize; this.searchData.pageSize = pageSize;

Loading…
Cancel
Save