Commit 84780015 by zhangxw

Merge branch 'v1.6.0' of http://192.168.3.233:8090/micro-customization-system/mi…

…cro-trialrun into v1.6.0
2 parents 5645c6f7 95fe0a4b
......@@ -97,4 +97,71 @@ export const shutDownShortcuts = [
picker.$emit("pick", [start, end]);
},
},
]
// 里程统计详情
export const mileageDetailShortcuts = [
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
picker.$emit("pick", [start, end]);
},
},
{
text: "昨日",
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
const end = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上周",
onClick(picker) {
let weekOfDay = parseInt(moment().format("E"));
const end = moment()
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf("month")
.format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
]
\ No newline at end of file
......@@ -24,6 +24,7 @@
v-show="hasOk"
type="primary"
:size="btn_size"
:loading="loading"
@click="handleConfirm"
>{{btnOkLabel}}</el-button>
<slot name="btn-behind"></slot>
......@@ -54,6 +55,10 @@ export default {
hasOk: {
type: Boolean,
default: true
},
loading:{
type:Boolean,
default:false
}
},
methods: {
......
......@@ -93,9 +93,13 @@ export default {
},
// 重置
rest() {
this.currentPage = 1;
this.pageSizeNum = 10;
rest(id, e) {
if (id) {
this[id] = e;
} else {
this.currentPage = 1;
this.pageSizeNum = 10;
}
},
},
};
......
......@@ -32,7 +32,7 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList()">搜索</el-button>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
......@@ -96,7 +96,7 @@ export default {
},
data() {
return {
searchForm: {},
searchForm: {alarmType:''},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
......@@ -114,22 +114,22 @@ export default {
dloading: false,
tloading: false,
FENCE_MONITOR_LIST,
fenceId:''
fenceId: "",
};
},
created() {
console.log(history.state)
this.fenceId = history.state.fenceId
console.log(history.state);
this.fenceId = history.state.fenceId;
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = {};
this.searchForm = {alarmType:''};
this.currentPage = 1;
this.pageSize = 10;
this.fenceId = ''
this.fenceId = "";
this.getList();
},
......@@ -142,8 +142,8 @@ export default {
oParams.alarmEndTime = m[1];
}
if(this.fenceId){
oParams.fenceId = this.fenceId
if (this.fenceId) {
oParams.fenceId = this.fenceId;
}
delete oParams.orgName;
......@@ -157,6 +157,9 @@ export default {
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if (current) {
this.currentPage = current;
}
GET_FENCEALARM_LIST(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
......@@ -205,18 +208,16 @@ export default {
? moment(row.alarmTime).format("x") - 120000
: "";
let sTime = moment(startTime).format("yyyy-MM-DD HH:mm:ss");
let endTime = row.endTime?moment(row.endTime).format("x") - 120000
: "";
let eTime = moment(endTime).format("yyyy-MM-DD HH:mm:ss");;
let endTime = row.endTime || "";
let eTime = moment(endTime).format("yyyy-MM-DD HH:mm:ss");
if (!row.endTime) {
eTime = moment(startTime + 3600000).format("yyyy-MM-DD HH:mm:ss");
}
console.log(sTime +'---'+eTime);
console.log(sTime + "---" + eTime);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&name=${row.ownerName}&standno=${row.vin}&startTime=${sTime}&endTime=${eTime}&fenceId=${row.fenceId}&isInitFence=1`;
//this.$root.parentCommon.setBreadCrumbs(path);
window.open(path);
},
},
};
</script>
......
......@@ -31,7 +31,7 @@
</el-popover>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList()">搜索</el-button>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
......@@ -157,6 +157,9 @@ export default {
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if(current){
this.currentPage = current
}
GET_ALARM_SHUTDOWN(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
......
......@@ -34,7 +34,7 @@
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList()">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" @click="rest()">重置</el-button>
......@@ -55,7 +55,7 @@
<!-- 列表 开始 -->
<div class="table_box">
<el-table class="el_table" border size="small" :data="tableData">
<el-table class="el_table" border size="small" :data="tableData" v-loading="loading">
<el-table-column label="围栏名称" prop="fenceName" show-overflow-tooltip></el-table-column>
<el-table-column label="监控类型" prop="triggerType" show-overflow-tooltip></el-table-column>
<el-table-column label="监控时间" prop="timeType" show-overflow-tooltip width="160">
......@@ -66,11 +66,11 @@
<el-table-column label="状态" prop="enableStatusDesc" show-overflow-tooltip></el-table-column>
<el-table-column label="报警次数" prop="alarmCnt" show-overflow-tooltip></el-table-column>
<el-table-column label="最新报警时间" prop="lastAlarmDate" show-overflow-tooltip>
<template slot-scope="{row}">{{row.lastAlarmDate||'--'}}</template>
<template slot-scope="{row}">{{row.lastAlarmDate||'--'}}</template>
</el-table-column>
<el-table-column label="创建时间" prop="createdDate" show-overflow-tooltip></el-table-column>
<el-table-column label="创建人" prop="creator" show-overflow-tooltip>
<template slot-scope="{row}">{{row.creator||'--'}}</template>
<template slot-scope="{row}">{{row.creator||'--'}}</template>
</el-table-column>
<el-table-column label="操作" prop="creator" width="200" fixed="right">
<template slot-scope="{row}">
......@@ -108,7 +108,7 @@ import {
DELETE_FENCE_INFO,
GET_FENCE_LIST,
} from "@/services/fence";
import { deepClone, showToast, showModal,downFileByPath } from "@/utils/util";
import { deepClone, showToast, showModal, downFileByPath } from "@/utils/util";
import moment from "moment";
import { FENCE_MONITOR_LIST, FENCE_TYPE_LIST } from "@/common/constants";
export default {
......@@ -117,7 +117,7 @@ export default {
},
data() {
return {
searchForm: { timeType: "1" },
searchForm: { timeType: "1", enableStatus: "", triggerType: "" },
tableData: [],
pageTotal: 0,
pageSize: 10,
......@@ -153,6 +153,9 @@ export default {
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || 1;
this.loading = true;
if (current) {
this.pageNumber = current;
}
GET_FENCE_LIST(oParams)
.then((res) => {
this.loading = false;
......@@ -186,14 +189,14 @@ export default {
if (res.code != 200) {
return false;
}
downFileByPath(res.data)
downFileByPath(res.data);
//window.open(res.data);
});
},
// 重置
rest() {
this.searchForm = { timeType: "1" };
this.searchForm = { timeType: "1", enableStatus: "", triggerType: "" };
this.pageSize = 10;
this.pageNumber = 1;
this.getList();
......
......@@ -8,7 +8,7 @@
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:">
<el-input placeholder="设备号|车架号|姓名|工单号" class="a_input" v-model="searchForm.keywords">
<el-input placeholder="设备号|车架号|姓名|工单号" class="a_input" v-model.trim="searchForm.keywords">
</el-input>
</el-form-item>
<el-form-item label="车辆归属:">
......@@ -21,7 +21,7 @@
</el-popover>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchEvent()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
......@@ -190,6 +190,12 @@ export default {
return oParams;
},
// 搜索
searchEvent(){
this.$refs.glsxTable.rest('currentPage',1);
this.getList()
},
// 获取列表
getList(options) {
let oParams = this.getParams();
......
......@@ -16,7 +16,7 @@
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList()">搜索</el-button>
<el-button type="primary" icon="el-icon-search" @click="searchEvent()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="default" icon="el-icon-refresh" @click="rest()">重置</el-button>
......@@ -64,11 +64,11 @@ import {
GET_JOURNEYS_EXPORTDETAIL,
} from "services/report";
import { deepClone, showToast } from "@/utils/util";
import moment from "moment";
import { mileageDetailShortcuts } from "@/common/index";
export default {
data() {
return {
searchForm: {sn:this.$route.query.sn},
searchForm: { sn: this.$route.query.sn },
snList: [],
dateTime: [],
tableData: [],
......@@ -95,71 +95,10 @@ export default {
],
pageTotal: 0,
pickerOptions: {
shortcuts: [
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
picker.$emit("pick", [start, end]);
},
},
{
text: "昨日",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
},
},
{
text: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上周",
onClick(picker) {
let weekOfDay = parseInt(moment().format("E"));
const end = moment()
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf("month")
.format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
],
shortcuts: mileageDetailShortcuts,
},
dloading: false,
aloding:false
aloding: false,
};
},
components: {
......@@ -169,7 +108,7 @@ export default {
//this.getSn();
},
mounted() {
this.getList()
this.getList();
//this.getTableList();
},
methods: {
......@@ -189,7 +128,7 @@ export default {
// 获取列表
getList(options) {
let oParams = this.getParams();
oParams.pageSize = this.$refs.glsxTable.pageSize;
oParams.pageSize = this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.aloding = true;
GET_JOURNEYS_SEARCHDETAIL(oParams).then((res) => {
......@@ -215,11 +154,11 @@ export default {
// 查看轨迹
lookTrack(row) {
console.log(row);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&isInitFence=1&name=${
row.ownerName
}&standno=${row.vin}&startTime=${row.journeyStartTime || ""}&endTime=${
let path = `/oEshield#/monitor/replay?sn=${row.sn||""}&isInitFence=1&name=${
row.ownerName || ""
}&standno=${row.vin||""}&startTime=${row.journeyStartTime || ""}&endTime=${
row.journeyEndTime || 0
}&fenceId=${row.fenceId}`;
}&fenceId=${row.fenceId||""}`;
//let query = {sn:row.sn,isInitFence:1,name:row.name,standno:row.vin};
let query = {};
//this.$router.push({path:path})
......@@ -231,21 +170,27 @@ export default {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_JOURNEYS_EXPORTDETAIL(oParams).then(res => {
GET_JOURNEYS_EXPORTDETAIL(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
})
});
},
// 重置
rest() {
//this.searchForm = {};
this.dateTime = [];
this.getList();
this.$refs.glsxTable.rest();
this.getList();
},
// 搜索事件
searchEvent() {
this.$refs.glsxTable.rest("currentPage", 1);
this.getList();
},
},
};
......
......@@ -138,7 +138,7 @@
<!-- 列表数据 end -->
<!-- 新增、编辑、查看弹框 开始 -->
<basic-dialog width="800px" :title="vehicleTitle" :isVisible="vehicleVisible" :hasOk="vehicleHasOk" @confirmDialog="handleConfirm('create')" @closeDialog="handleClose('create')">
<basic-dialog width="800px" :title="vehicleTitle" :isVisible="vehicleVisible" :hasOk="vehicleHasOk" :loading="ajaxLoading" @confirmDialog="handleConfirm('create')" @closeDialog="handleClose('create')">
<slot>
<div class="dialog_content" v-loading="formLoading">
<el-form class="el_form" ref="snForm" :model="snForm" :rules="vehicleRules" :inline="false" :disabled="isReadonly" size="mini" label-width="100px">
......@@ -343,7 +343,7 @@ import { VEHICLE_API } from "@/config/config";
import store from "@/store";
import freqModal from "./freqModal";
import { Validator } from "@/utils/validator";
import { deepClone } from "@/utils/util";
import { deepClone, showToast } from "@/utils/util";
import { VEHICLE_ONLINE_STATUS } from "@/common/constants";
import {
getVehicleList,
......@@ -809,6 +809,7 @@ export default {
},
],
VEHICLE_ONLINE_STATUS,
ajaxLoading: false,
};
},
......@@ -1083,6 +1084,7 @@ export default {
// 新增车辆、编辑车辆
handleConfirm(type) {
let _this = this;
switch (type) {
case "create":
//console.log(this.vehicleForm, this.vehicleData);
......@@ -1094,28 +1096,33 @@ export default {
if (params.id) {
api = updateNewVehicle;
}
api(params).then((res) => {
const { code, message } = res;
if (code != 200) {
this.$message({
_this.ajaxLoading = true;
api(params)
.then((res) => {
_this.ajaxLoading = false;
const { code, message } = res;
if (code != 200) {
showToast({
message: message,
});
return false;
}
showToast({
message: "操作成功",
type: "danger",
type: "success",
});
return false;
}
this.$message({
message: "操作成功",
type: "success",
this.vehicleVisible = !this.vehicleVisible;
this.snForm = {};
this.dialogType = "";
this.$refs.snForm.clearValidate();
//this.$refs.serchButton.$el.click();
this.getList();
//this.$refs.vehicleForm.refreshTable();
//this.$refs.snForm.refreshTable();
})
.catch(() => {
_this.ajaxLoading = false;
});
this.vehicleVisible = !this.vehicleVisible;
this.snForm = {};
this.dialogType = "";
this.$refs.snForm.clearValidate();
//this.$refs.serchButton.$el.click();
this.getList();
//this.$refs.vehicleForm.refreshTable();
//this.$refs.snForm.refreshTable();
});
});
break;
case "import":
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!