Commit 4362cd33 authored by 纪泽龙's avatar 纪泽龙

值班人员移动轨迹时间点选择修改

parent f2372b27
......@@ -5,16 +5,6 @@
:before-close="handleClose"
>
<el-form :model="formData" ref="formData" :rules="rules">
<!-- <el-form-item label="选择时间段:" prop=""> -->
<!-- <el-date-picker
v-model="dateValue"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker> -->
<!-- </el-form-item> -->
<el-row>
<el-col :span="11">
<el-form-item label="选择值班人员:" prop="userId">
......@@ -38,6 +28,18 @@
</el-row>
<el-row>
<el-col>
<el-form-item label="请选择时间段" prop="changeTime">
<el-radio-group v-model="formData.changeTime" @change="radioChange">
<el-radio :label="1">最近2小时</el-radio>
<el-radio :label="2">最近24小时</el-radio>
<el-radio :label="3">自定义时间段</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row v-show="formData.changeTime==3">
<el-col :span="11">
<el-form-item label="选择开始时间:" prop="beginTime">
<el-date-picker
......@@ -97,13 +99,24 @@ export default {
okLoading: false,
formData: {
userId: null,
changeTime: 1,
beginTime: "",
endTime: "",
},
changeTime: null,
workerManArr: [],
rules: {
userId: [
{ required: true, message: "请选择值班人员", trigger: "blur" },
],
changeTime: [
{
required: true,
message: "选择查询时间",
trigger: ["blur", "change"],
},
],
beginTime: [
{ required: true, message: "请输入开始时间", trigger: "blur" },
],
......@@ -120,6 +133,8 @@ export default {
label: item.nickName,
value: item.userId,
}));
this.formData.beginTime = moment().format("YYYY-MM-DD HH:mm:ss");
this.formData.endTime = moment().add(2, "h").format("YYYY-MM-DD HH:mm:ss");
},
methods: {
......@@ -128,6 +143,22 @@ export default {
console.log(e);
this.formData.userId = e;
},
radioChange(e) {
if (e == 1) {
this.formData.beginTime = moment().format("YYYY-MM-DD HH:mm:ss");
this.formData.endTime = moment()
.add(2, "h")
.format("YYYY-MM-DD HH:mm:ss");
} else if (e == 2) {
this.formData.beginTime = moment().format("YYYY-MM-DD HH:mm:ss");
this.formData.endTime = moment()
.add(1, "d")
.format("YYYY-MM-DD HH:mm:ss");
} else {
this.formData.beginTime = "";
this.formData.endTime = "";
}
},
ok() {
this.$refs.formData.validate((valid) => {
if (valid) {
......@@ -135,24 +166,24 @@ export default {
moment(this.formData.beginTime).valueOf() >
moment(this.formData.endTime).valueOf()
) {
this.msgError(
"开始时间不能大于结束时间"
);
this.msgError("开始时间不能大于结束时间");
this.formData.endTime = "";
return;
}
this.okLoading = true;
if (this.formData.changeTime != 3) {
this.radioChange(this.formData.changeTime);
} else {
this.formData.beginTime = moment(this.formData.beginTime).format(
"YYYY-MM-DD HH:mm:ss"
);
this.formData.endTime = moment(this.formData.endTime).format(
"YYYY-MM-DD HH:mm:ss"
);
}
console.log(this.formData);
// console.log(this.formData);
// 找到哪个值班人员
const target = this.gaodeMap.workerManMarkArr.filter((item) => {
// console.log("userId",item.getExtData().userId)
......
......@@ -98,6 +98,7 @@ class gaodeMap {
// 地图开始缩放删除infowindow
this.myMap.on("zoomstart", () => {
this.closeInfoWindow();
this.polyLinesColorClear();
});
this.myMap.on("moveend", () => {
if (this.handleInfoWindowOpenFunc) {
......@@ -130,7 +131,6 @@ class gaodeMap {
changeMap(bool) {
// 卫星图
if (!bool) {
if (this.satellite) return;
this.satellite = new AMap.TileLayer.Satellite();
......
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