+
+
+
-
+
-
+
-
-
+
+
+
+ ~
+
-
+
-
+
@@ -45,20 +47,21 @@
导出
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
@@ -66,6 +69,7 @@
// import { parseTime } from '../../core/mixins/code-filter';
// import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
// import inputTable from './inputTable.vue';
+import { report } from 'process';
import lineChart from './lineChart';
import moment from 'moment'
// import FileSaver from 'file-saver'
@@ -83,6 +87,10 @@ export default {
// reportType: 2,
reportTime: []
},
+ // startDatePicker: this.beginDate(),
+ // endDatePicker: this.processDate(),
+ yeartsStart: '',
+ yeartsEnd: '',
urlOptions: {
// getDataListURL: getGlassPage,
// exportURL: exportGlasscExcel
@@ -117,6 +125,12 @@ export default {
id: 2,
},
],
+ formConfig: [
+ {
+ type: 'title',
+ label: '报表管理',
+ },
+ ],
tableProps: [
// {
// prop: 'createTime',
@@ -184,31 +198,32 @@ export default {
// this.getDataList()
},
methods: {
- // handleTime() {
- // this.$forceUpdate()
- // // this.$nextTick(() => [
-
- // // ])
- // },
- // getCurrentYearFirst() {
- // let date = new Date();
- // date.setDate(1);
- // date.setMonth(0);
- // this.reportTime = date;
- // this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()); //开始时间
- // this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //结束时间
- // this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
- // this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
- // },
- changeTime(val) {
- if (val) {
- // let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
- // this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()); //开始时间
- // this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //结束时间
- // this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
- // this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
+ getYear(e) {
+ if (this.listQuery.reportTime[0] && e - this.listQuery.reportTime[0] > 10) {
+ this.$message({
+ message: '年份起止时间不能超过十年',
+ type: 'warning'
+ });
+ // console.log();
+ }
+ // console.log(e);
+ },
+ changeTime() {
+ if (this.listQuery.reportTime) {
+ this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
+ this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
+ const numDays = (new Date(this.listQuery.reportTime[1]).getTime() - new Date(this.listQuery.reportTime[0]).getTime()) / (24 * 3600 * 1000); if (numDays > 730) {
+ this.$message({
+ message: '时间范围不能超过24个月',
+ type: 'warning'
+ });
+ this.listQuery.reportTime = [];
+ this.createStartDate = '';
+ this.createEndDate = '';
+ }
} else {
- this.listQuery.reportTime = []
+ this.createStartDate = '';
+ this.createEndDate = '';
}
},
async getDict() {
@@ -257,22 +272,22 @@ export default {
// var s = time.getSeconds();
return time
},
- changeTime(val) {
- if (val) {
- // console.log(val)
- // console.log(val.setHours(7, 0, 0))
- // console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
- // let time = this.format(val.setHours(7, 0, 0))
- this.endTimeStamp = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
- this.startTimeStamp = this.format(val.setHours(7, 0, 1) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
- // console.log(this.listQuery.reportTime);
- this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
- this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
- console.log(this.listQuery.reportTime);
- } else {
- this.listQuery.reportTime = []
- }
- },
+ // changeTime(val) {
+ // if (val) {
+ // // console.log(val)
+ // // console.log(val.setHours(7, 0, 0))
+ // // console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
+ // // let time = this.format(val.setHours(7, 0, 0))
+ // this.endTimeStamp = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
+ // this.startTimeStamp = this.format(val.setHours(7, 0, 1) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
+ // // console.log(this.listQuery.reportTime);
+ // this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
+ // this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
+ // console.log(this.listQuery.reportTime);
+ // } else {
+ // this.listQuery.reportTime = []
+ // }
+ // },
//时间戳转为yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
@@ -336,9 +351,6 @@ export default {
diff --git a/src/views/report/yearData/lineChart.vue b/src/views/report/yearData/lineChart.vue
index c44a3dc..3105914 100644
--- a/src/views/report/yearData/lineChart.vue
+++ b/src/views/report/yearData/lineChart.vue
@@ -2,32 +2,31 @@
* @Author: zwq
* @Date: 2022-01-21 14:43:06
* @LastEditors: zhp
- * @LastEditTime: 2024-04-12 16:50:42
+ * @LastEditTime: 2024-04-16 09:58:08
* @Description:
-->