Commit 53c772be authored by moonby's avatar moonby

240728

parent 83b4399a
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
<el-form-item label="开始时间:" style="margin-right: 20px;"> <el-form-item label="开始时间:" style="margin-right: 20px;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker v-model="startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" <el-date-picker v-model="startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择开始时间" style="min-width: 180px;" /> placeholder="选择开始时间" @change="changeStartTime" style="min-width: 180px;" />
<!-- 日期时间格式 2024-1-1 00:00:00--> <!-- 日期时间格式 2024-1-1 00:00:00-->
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
<el-form-item label="结束时间:"> <el-form-item label="结束时间:">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker v-model="endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" <el-date-picker v-model="endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择结束时间" style="min-width: 180px;" /> placeholder="选择结束时间" @change="changeEndTime" style="min-width: 180px;" />
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
</div> </div>
...@@ -260,11 +260,11 @@ var year = date.getFullYear(); ...@@ -260,11 +260,11 @@ var year = date.getFullYear();
var day = 0; var day = 0;
var dateArr = [ var dateArr = [
date.getMonth() + 1, //月份从0~11,所以加一 date.getMonth() + 1, //月份从0~11,所以加一
date.getDate(), date.getDate() -1,
date.getHours(), date.getHours(),
date.getMinutes(), date.getMinutes(),
date.getSeconds(), date.getSeconds(),
date.getMonth() - 1 date.getDate()
]; ];
for (var i = 0; i < dateArr.length; i++) { for (var i = 0; i < dateArr.length; i++) {
if (dateArr[i] >= 1 && dateArr[i] <= 9) { if (dateArr[i] >= 1 && dateArr[i] <= 9) {
...@@ -281,12 +281,12 @@ if (day >= 1 && day <= 9) { ...@@ -281,12 +281,12 @@ if (day >= 1 && day <= 9) {
// var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; // var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
var startTimeValue = sessionStorage.getItem("DeviceQueryStart"); var startTimeValue = sessionStorage.getItem("DeviceQueryStart");
if(!startTimeValue){ if(!startTimeValue){
startTimeValue = (year-1) + "-" + dateArr[0] + "-"+ dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; startTimeValue = (year) + "-" + dateArr[0] + "-"+ dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryStart", startTimeValue); sessionStorage.setItem("DeviceQueryStart", startTimeValue);
} }
var endTimeValue = sessionStorage.getItem("DeviceQueryEnd"); var endTimeValue = sessionStorage.getItem("DeviceQueryEnd");
if(!endTimeValue){ if(!endTimeValue){
endTimeValue = (year) + "-" + dateArr[5] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; endTimeValue = (year) + "-" + dateArr[0] + "-" + dateArr[5] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryEnd", endTimeValue); sessionStorage.setItem("DeviceQueryEnd", endTimeValue);
} }
...@@ -294,6 +294,14 @@ startTime.value = startTimeValue; ...@@ -294,6 +294,14 @@ startTime.value = startTimeValue;
endTime.value = endTimeValue; endTime.value = endTimeValue;
console.log(endTime) console.log(endTime)
function changeStartTime(){
sessionStorage.setItem("DeviceQueryStart", startTime.value);
}
function changeEndTime(){
sessionStorage.setItem("DeviceQueryEnd", endTime.value);
}
const props = { multiple: true,emitPath: false } const props = { multiple: true,emitPath: false }
const DataInfo = reactive({ const DataInfo = reactive({
"enterpriseId": enterpriseId.value, "enterpriseId": enterpriseId.value,
...@@ -484,12 +492,16 @@ function setShowThisData(data) { ...@@ -484,12 +492,16 @@ function setShowThisData(data) {
//设置搜索栏可选择项 //设置搜索栏可选择项
function setSelect(list) { function setSelect(list) {
DataInfo.tree.length = 0; DataInfo.tree.length = 0;
DataInfo.name.length=0;
list.forEach(area => { list.forEach(area => {
DataInfo.tree.push({ DataInfo.tree.push({
value: area, value: area,
label: area label: area
}) })
}) })
if(DataInfo.tree.length>0){
DataInfo.name.push(DataInfo.tree[0].value);
}
} }
//搜索 //搜索
......
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
<el-form-item label="开始时间:" style="margin-right: 20px;"> <el-form-item label="开始时间:" style="margin-right: 20px;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker v-model="startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" <el-date-picker v-model="startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择开始时间" style="min-width: 180px;" /> placeholder="选择开始时间" @change="changeStartTime" style="min-width: 180px;" />
<!-- 日期时间格式 2024-1-1 00:00:00--> <!-- 日期时间格式 2024-1-1 00:00:00-->
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
<el-form-item label="结束时间:"> <el-form-item label="结束时间:">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker v-model="endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" <el-date-picker v-model="endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择结束时间" style="min-width: 180px;" /> placeholder="选择结束时间" @change="changeEndTime" style="min-width: 180px;" />
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
</div> </div>
...@@ -260,10 +260,11 @@ var year = date.getFullYear(); ...@@ -260,10 +260,11 @@ var year = date.getFullYear();
var day = 0; var day = 0;
var dateArr = [ var dateArr = [
date.getMonth() + 1, //月份从0~11,所以加一 date.getMonth() + 1, //月份从0~11,所以加一
date.getDate(), date.getDate() -1,
date.getHours(), date.getHours(),
date.getMinutes(), date.getMinutes(),
date.getSeconds(), date.getSeconds(),
date.getDate()
]; ];
for (var i = 0; i < dateArr.length; i++) { for (var i = 0; i < dateArr.length; i++) {
if (dateArr[i] >= 1 && dateArr[i] <= 9) { if (dateArr[i] >= 1 && dateArr[i] <= 9) {
...@@ -280,12 +281,12 @@ if (day >= 1 && day <= 9) { ...@@ -280,12 +281,12 @@ if (day >= 1 && day <= 9) {
// var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; // var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
var startTimeValue = sessionStorage.getItem("DeviceQueryStart"); var startTimeValue = sessionStorage.getItem("DeviceQueryStart");
if(!startTimeValue){ if(!startTimeValue){
startTimeValue = (year-1) + "-" + dateArr[0] + "-"+ dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; startTimeValue = (year) + "-" + dateArr[0] + "-"+ dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryStart", startTimeValue); sessionStorage.setItem("DeviceQueryStart", startTimeValue);
} }
var endTimeValue = sessionStorage.getItem("DeviceQueryEnd"); var endTimeValue = sessionStorage.getItem("DeviceQueryEnd");
if(!endTimeValue){ if(!endTimeValue){
endTimeValue = (year-1) + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; endTimeValue = (year) + "-" + dateArr[0] + "-" + dateArr[5] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryEnd", endTimeValue); sessionStorage.setItem("DeviceQueryEnd", endTimeValue);
} }
...@@ -293,6 +294,13 @@ startTime.value = startTimeValue; ...@@ -293,6 +294,13 @@ startTime.value = startTimeValue;
endTime.value = endTimeValue; endTime.value = endTimeValue;
console.log(endTime) console.log(endTime)
function changeStartTime(){
sessionStorage.setItem("DeviceQueryStart", startTime.value);
}
function changeEndTime(){
sessionStorage.setItem("DeviceQueryEnd", endTime.value);
}
const props = { multiple: true,emitPath: false } const props = { multiple: true,emitPath: false }
const DataInfo = reactive({ const DataInfo = reactive({
"enterpriseId": enterpriseId.value, "enterpriseId": enterpriseId.value,
...@@ -490,12 +498,16 @@ function setShowThisData(data) { ...@@ -490,12 +498,16 @@ function setShowThisData(data) {
//设置搜索栏可选择项 //设置搜索栏可选择项
function setSelect(list) { function setSelect(list) {
DataInfo.tree.length = 0; DataInfo.tree.length = 0;
DataInfo.name.length=0;
list.forEach(area => { list.forEach(area => {
DataInfo.tree.push({ DataInfo.tree.push({
value: area, value: area,
label: area label: area
}) })
}) })
if(DataInfo.tree.length>0){
DataInfo.name.push(DataInfo.tree[0].value);
}
} }
//搜索 //搜索
......
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