Commit 7c30b0cb 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 119e2427 1ec529f8
import moment from 'moment';
import moment from '@/common/moment';
// 警情中心-围栏报警
export const fenceShortcuts = [
......@@ -119,7 +119,7 @@ export const mileageDetailShortcuts = [
text: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
const start = moment().weekday(0).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
......
import moment from 'moment';
// 设置moment的语言环境配置
moment.locale('zh-cn', {
week: {
dow: 1,
doy: 4
}
})
export default moment
\ No newline at end of file
......@@ -305,6 +305,24 @@ const routes = [
title: '围栏列表',
keepAlive: true
}
},
{
path: '/alarmCenter/speed',
name: 'speedAlarm',
component: () => import('../views/alarmCenter/speed.vue'),
meta: {
title: '超速报警',
keepAlive: true
}
},
{
path: '/reportManage/statistics',
name: 'statisticsAlarm',
component: () => import('../views/reportManage/statistics.vue'),
meta: {
title: '运营统计报表',
keepAlive: true
}
}
]
......
<template>
<div class="">
<div class="page_title">
<h2 class="h2">超速报警</h2>
<h3 class="h3">用于统计和展示有线设备的超速报警</h3>
</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="关键字">
<el-input v-model.trim="searchForm.keywords" class="long_input" placeholder="设备号 | 车架号 | 姓名 | 工单号" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
</el-input>
</el-popover>
</el-form-item>
<el-form-item label="报警时间:">
<el-date-picker v-model="searchForm.timeDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="offPickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<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>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 操作区域 开始 -->
<div class="links_group">
<span class="name">超速报警信息</span>
<el-button type="primary" size="small" icon="el-icon-download" :loading="dloading" @click="downloadExcel()">导出excel</el-button>
</div>
<!-- 操作区域 end -->
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table class="el_table" :data="tableData" border size="small" v-loading="tloading">
<el-table-column label="工单号" prop="bizOrderNo" show-overflow-tooltip>
<template slot-scope="{row}">{{row.bizOrderNo||'--'}}</template>
</el-table-column>
<el-table-column label="姓名" prop="ownerName" show-overflow-tooltip>
<template slot-scope="{row}">{{row.ownerName||'--'}}</template>
</el-table-column>
<el-table-column label="设备号" prop="sn" show-overflow-tooltip></el-table-column>
<el-table-column label="车架号" prop="vin" show-overflow-tooltip>
<template slot-scope="{row}">{{row.vin||'--'}}</template>
</el-table-column>
<el-table-column label="超速开始时间" prop="alarmTime" show-overflow-tooltip></el-table-column>
<el-table-column label="超速结束时间" prop="alarmTime" show-overflow-tooltip></el-table-column>
<el-table-column label="超速时长" prop="duration" show-overflow-tooltip></el-table-column>
<el-table-column label="平均车速" prop="fenceName" show-overflow-tooltip></el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :current-page.sync="currentPage" :page-size="pageSize" :page-sizes="pageSizes" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
import moment from "moment";
import { fenceShortcuts } from "@/common";
import GlsxOrganization from "@/components/glsx-organization";
import {
GET_FENCEALARM_LIST,
ALARM_FENCEALARM_EXPORT,
} from "@/services/alarmCenter";
import { deepClone, showToast, downFileByPath } from "@/utils/util";
import { FENCE_MONITOR_LIST } from "@/common/constants";
export default {
components: {
GlsxOrganization,
},
data() {
return {
searchForm: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
pageTotal: 0,
tableData: [],
showDialog: false,
uploadFile: {},
showResult: false,
loading: false,
offPickerOptions: {
shortcuts: fenceShortcuts,
},
filterVisible: false,
orgInfo: {},
dloading: false,
tloading: false,
FENCE_MONITOR_LIST,
fenceId: "",
};
},
created() {
console.log(history.state);
this.fenceId = history.state.fenceId;
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = {};
this.currentPage = 1;
this.pageSize = 10;
this.fenceId = "";
this.getList();
},
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
let m = oParams.timeDate;
if (m && m.length > 0) {
oParams.alarmStartTime = m[0];
oParams.alarmEndTime = m[1];
}
if (this.fenceId) {
oParams.fenceId = this.fenceId;
}
delete oParams.orgName;
delete oParams.timeDate;
return oParams;
},
// 获取数据列表
getList(current) {
let oParams = this.getParams();
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 || {};
this.tableData = obj.list || [];
this.pageTotal = obj.totalElements;
});
},
//每页展示
changePageSize(e) {
this.pageSize = e;
this.getList();
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
ALARM_FENCEALARM_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
//window.open(res.data);
downFileByPath(res.data);
});
},
// 查看轨迹回放
lookDetail(row) {
let startTime = row.alarmTime
? moment(row.alarmTime).format("x") - 120000
: "";
let sTime = moment(startTime).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);
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>
<style lang="scss" scoped>
@import "@/styles/hadoop.scss";
</style>
\ No newline at end of file
......@@ -73,10 +73,34 @@ export default {
dateTime: [],
tableData: [],
columnList: [
{ label: "工单号", prop: "workOrderNo" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sn" },
{ label: "车架号", prop: "vin" },
{
label: "工单号",
prop: "workOrderNo",
formatter: (row) => {
return `${row.workOrderNo || "--"}`;
},
},
{
label: "姓名",
prop: "ownerName",
formatter: (row) => {
return `${row.ownerName || "--"}`;
},
},
{
label: "设备号",
prop: "sn",
formatter: (row) => {
return `${row.sn || "--"}`;
},
},
{
label: "车架号",
prop: "vin",
formatter: (row) => {
return `${row.vin || "--"}`;
},
},
{
label: "行程开始/结束时间",
prop: "journeyStartTime",
......@@ -84,12 +108,18 @@ export default {
return `${row.journeyStartTime}~${row.journeyEndTime}`;
},
},
{ label: "行驶时长", prop: "durationStr" },
{
label: "行驶时长",
prop: "durationStr",
formatter: (row) => {
return `${row.durationStr || "--"}`;
},
},
{
label: "行驶里程km",
prop: "distance",
formatter: (row) => {
return `${row.distance || 0}km`;
return `${row.distance ? row.distance.toFixed(2) : 0}`;
},
},
],
......@@ -154,11 +184,13 @@ 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})
......
<template>
<div class="system-container">
<div class="container">
<h1>假性离线报表</h1>
<div class="m-b-md title_tips">用于统计和展示设备假性离线情况,包含常驻地离线研判、车辆多设备组合单离线、离线白名单</div>
<!-- 搜索区域 开始 -->
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:">
<el-input placeholder="设备号|姓名|车架号|业务工单号" class="a_input" maxlength="20" v-model.trim="searchForm.keywords">
</el-input>
</el-form-item>
<el-form-item label="车辆归属:">
<el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly>
</el-input>
</el-popover>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 搜索区域 end -->
<!-- 按钮区域 开始 -->
<div class="links_group">
<span>假性离线信息</span>
<div>
<el-button type="default" icon="el-icon-download" size="mini" @click="openDialog()">导入白名单</el-button>
<el-button class="pull-right" type="primary" icon="el-icon-download" size="mini" :loading="dloading" @click="downloadExcel">导出Excel</el-button>
</div>
</div>
<!-- 按钮区域 end -->
<!-- 列表 开始 -->
<glsx-table ref="glsxTable" v-loading="loading" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}">
<el-link type="primary" :underline="false" @click="lookDetail(scope)" v-if="scope.locationFlag == 1">查看位置</el-link>
</div>
</glsx-table>
<!-- 列表 end -->
</div>
<!-- 弹框 开始 -->
<glsx-dialog :show="showDialog" :title="!showResult?'批量操作':'操作结果'" width="560px" @close="closeDialog()">
<div>
<div class="upload_box" v-show="!showResult">
<div class="input_box">
<el-input v-model="uploadFile.name" placeholder="未选择任何文件..." class="a_input" size="small" readonly></el-input>
<el-upload ref="elUpload" :action="IMPORT_FAKEOFFLINE_FILES" :headers="uploadHeaders" :accept="acceptFile" :show-file-list="false" :auto-upload="false" :file-list="fileList" :on-change="onFileChange" :on-success="onSuccess">
<el-button size="small" type="primary">浏览</el-button>
</el-upload>
</div>
<div class="tips">*请选择需要导入的设备表格*</div>
<div class="tips">*允许表格数据为空,为空则删除白名单数据*</div>
</div>
<div class="upload_result" v-show="showResult">
<div class="cell">
<span class="num">{{uploadResult.succNum}}</span>
<span>成功记录</span>
</div>
<div class="cell">
<span class="num cred">{{uploadResult.failNum}}</span>
<span>失败记录</span>
</div>
</div>
</div>
<div slot="footer">
<div class="dialog_links">
<div>
<el-button type="primary" size="small" v-if="!showResult" @click="downloadTemplate()">下载模板</el-button>
<el-button type="primary" size="small" v-if="showResult && uploadResult.failFile" @click="downloadFail()">导出失败记录</el-button>
</div>
<div class="">
<el-button type="primary" size="small" :loading="aloading" :disabled="!uploadFile.name" v-if="!showResult" @click="saveFile()">确认</el-button>
<el-button type="default" size="small" @click="closeDialog()">{{!showResult?'取消':'关闭'}}</el-button>
</div>
</div>
</div>
</glsx-dialog>
<!-- 弹框 end -->
</div>
</template>
<script>
import GlsxTable from "@/components/glsx-table";
import {
GET_JOURNEYS_SEARCH,
GET_JOURNEYS_EXPORT,
GET_JOURNEYS_DAILYEXPORT,
GET_FAKEOFFLINE_LIST,
GET_FAKEOFFLINE_EXPORT,
GET_FAKEOFFLINE_TEMPLATEFILES,
IMPORT_FAKEOFFLINE_FILES,
} from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
import { deepClone, showToast } from "@/utils/util";
import store from "@/store";
import moment, { max } from "moment";
import GlsxDialog from "@/components/dialog";
export default {
components: {
GlsxTable,
GlsxOrganization,
GlsxDialog,
},
data() {
return {
searchForm: {},
tableData: [],
columnList: [
{ label: "工单号", prop: "bizOrderNo" },
{ label: "姓名", prop: "ownerName" },
{ label: "设备号", prop: "sns" },
{ label: "车架号", prop: "vin" },
{ label: "假性离线原因", prop: "reason" },
],
pageTotal: 0,
pageSize: 10,
filterVisible: false,
dloading: false,
showPopover: false,
cloading: false,
loading: false,
aloading: false,
isTimeOut: false,
sTime: "",
eTime: "",
pickerOptions: {
onPick: ({ maxDate, minDate }) => {
this.sTime = minDate || "";
this.eTime = maxDate || "";
if (maxDate && minDate) {
let m = moment(maxDate).diff(moment(minDate), "days");
if (m > 60) {
this.isTimeOut = true;
} else {
this.isTimeOut = false;
}
this.eTime = "";
this.sTime = "";
}
},
},
showDialog: false,
uploadFile: {},
showResult: false,
uploadHeaders: {},
uploadResult: {},
IMPORT_FAKEOFFLINE_FILES,
fileList: [],
acceptFile: ".xlsx,.xls",
};
},
mounted() {
let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token };
this.getList();
},
methods: {
// 获取查询参数
getParams() {
let oParams = deepClone(this.searchForm);
delete oParams.orgName;
return oParams;
},
// 获取列表
getList(options) {
let oParams = this.getParams();
console.log(options);
console.log(this.$refs.glsxTable.pageSizeNum);
oParams.pageSize = options
? options.pageSize
: this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
GET_FAKEOFFLINE_LIST(oParams)
.then((res) => {
this.loading = false;
let { data } = res;
let { list, totalElements } = data;
this.pageTotal = totalElements || 0;
this.tableData = list || [];
})
.catch((error) => {
this.loading = false;
});
},
// 查看详情
lookDetail(row) {
console.log(row);
let o = window.location.origin;
let query = { vin: row.vin };
//let path = "/trialRun#/reportManage/map";
let path = `/oEshield/#/monitor/activeLocation`;
//history.pushState(query, path, path);
this.$root.parentCommon.setBreadCrumbs(path);
window.open(path + "?sns=" + row.sns);
//this.$router.push({ name: "mileageDetail", query: { vin: row.vin } });
},
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
// 导出excel
downloadExcel() {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_FAKEOFFLINE_EXPORT(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
});
// _this.$Common.exportExcel({
// url: `${store.state.baseURL}${MILEAGESTATISTICSEXPORT}`,
// method: "GET",
// data: oParams,
// fileName: "里程统计报表",
// success: () => {
// _this.dloading = false;
// },
// fail: () => {
// _this.dloading = false;
// },
// });
},
// 重置
rest() {
this.searchForm = {};
this.$refs.glsxTable.rest();
this.getList();
},
// 监听文件导入
onFileChange(file, fileList) {
console.log(file);
if (!file.response) {
this.uploadFile = file;
this.fileList = [file];
}
},
// 打开批量导入弹框
openDialog() {
this.showDialog = true;
},
// 关闭弹框
closeDialog() {
this.showDialog = false;
this.uploadFile = {};
this.uploadResult = {};
this.showResult = false;
},
// 上传文件
saveFile() {
let o = this.uploadFile;
console.log(o);
if (!this.uploadFile.name) {
showToast({
message: "请选择上传文件",
});
return false;
}
let list = o.name.split(".");
let acceptFile = this.acceptFile;
let _type = list[list.length - 1];
console.log(_type);
let idx = acceptFile.includes(_type);
if (!idx) {
showToast({
message: `导入文件只支持${acceptFile}`,
});
return false;
}
this.aloading = true;
this.$refs.elUpload.submit();
},
// 监听文件上传成功
onSuccess(response, file, fileList) {
this.aloading = false;
if (response.code != 200) {
showToast({
message: response.message,
});
this.uploadFile = {};
this.$refs.elUpload.clearFiles();
return false;
}
this.uploadResult = response.data;
this.showResult = true;
this.getList();
},
// 下载模板
downloadTemplate() {
GET_FAKEOFFLINE_TEMPLATEFILES().then((res) => {
window.open(res.data);
});
},
// 下载失败模板
downloadFail() {
let o = this.uploadResult;
window.open(o.failFile);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
</style>>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!