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

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

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