Commit 533753e7 by 前端

Merge branch 'v1.13.0' into 'develop'

V1.13.0

See merge request !55
2 parents 87f09cf8 f466da55
<template>
<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>
<el-button type="primary" size="small" v-if="!showResult" @click="downloadTemplate()">SN号导入模板</el-button>
<el-button type="primary" size="small" v-if="!showResult" @click="downloadTemplate()">工单号导入模板</el-button>
<el-button type="primary" size="small" v-if="!showResult" @click="downloadTemplate()">车架号导入模板</el-button>
</div>
</div>
<div class="upload_result" v-show="showResult && !exportDialog">
<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 class="upload_result" v-show="exportDialog">
<el-alert
type="warning"
description="请等待解析结果,解析完成后将自动为您下载,请勿关闭当前浏览器!"
:closable="false"
show-icon>
</el-alert>
</div>
</div>
<div slot="footer">
<div class="dialog_links">
<div>
<el-button type="primary" size="small" v-if="showResult && uploadResult.failFile" @click="downloadFail()">导出失败记录</el-button>
</div>
<div>
<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()" v-if="!exportDialog">{{!showResult?'取消':'关闭'}}</el-button>
<el-button type="default" size="small" @click="closeDialog()" v-if="exportDialog"><i class="el-icon-loading" v-show="exportDialog"></i>完成</el-button>
</div>
</div>
</div>
</glsx-dialog>
</div>
</template>
<script>
import { IMPORT_FAKEOFFLINE_FILES } from "services/report";
import GlsxDialog from "@/components/dialog";
export default {
name:"informationDialog",
components: {
GlsxDialog
},
data() {
return {
showDialog: false,
showResult: false,
uploadFile: {},
IMPORT_FAKEOFFLINE_FILES,
acceptFile: ".xlsx,.xls",
fileList: [],
uploadResult: {},
aloading: false,
}
},
props: {
uploadHeaders: Object,
// 导出按钮互动参数
exportDialog: {
type: Boolean,
default: false
}
},
methods: {
openDialog() {
this.showDialog = true
},
// 监听文件导入
onFileChange(file, fileList) {
console.log(file);
if (!file.response) {
this.uploadFile = file;
this.fileList = [file];
}
},
// 监听文件上传成功
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(); 刷新表格
this.$emit("successData", true)
},
// 确认上传文件
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();
},
// 下载失败模板
downloadFail() {
let o = this.uploadResult;
window.open(o.failFile);
},
// 关闭弹框
closeDialog() {
this.showDialog = false;
this.uploadFile = {};
this.uploadResult = {};
this.showResult = false;
},
}
}
</script>
<style lang="scss" scoped>
@import "@/styles/offline.scss";
.upload_result ::v-deep.el-alert .el-alert__description {
margin: 0;
}
</style>
\ No newline at end of file
......@@ -4,6 +4,7 @@
<div class="page_head_title">
<h2 class="h2">运营统计报表</h2>
<h3 class="h3">通过车辆或设备纬度,统计系统内设备数据,并支持宽表输出</h3>
<!-- <el-button class="informationBtn" type="primary" size="mini" @click="informationClick">信息解析</el-button> -->
</div>
<el-tabs v-model="tabActive">
......@@ -14,7 +15,7 @@
<statistics-device></statistics-device>
</el-tab-pane>
</el-tabs>
<informationDialog ref="informationDialog" :uploadHeaders="uploadHeaders" @successData="successData" />
</div>
</template>
......@@ -22,22 +23,41 @@
import {} from "services/report";
import StatisticsCar from './statistics_car'
import StatisticsDevice from './statistics_device'
import informationDialog from './informationDialog'
export default {
components: {
StatisticsCar,
StatisticsDevice
StatisticsDevice,
informationDialog
},
data() {
return {
tabActive: "car",
uploadHeaders: {}
};
},
mounted() {},
methods: {},
mounted() {
let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token };
},
methods: {
informationClick() {
this.$refs.informationDialog.openDialog()
// this.$refs.informationDialog.showResult = true
},
successData(val) {
console.log('val', val);
}
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/common.scss";
.informationBtn {
position: absolute;
right: 24px;
z-index: 2;
}
</style>>
\ No newline at end of file
......@@ -77,6 +77,7 @@
</div>
</el-form-item>
</el-form>
<span v-if="tenantFlag">* 提示:每周五晚,系统自动恢复无线设备调频状态</span>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :loading="loading" size="small">确认</el-button>
<el-button @click="$emit('onFreqModalChange', false)" size="small">取消</el-button>
......@@ -89,7 +90,7 @@ import { adjFreq, GET_FREQ_DETAILS, REST_FREQ_INFO } from "services/vehicle";
import { deepClone, showToast } from "@/utils/util";
export default {
props: ["freqVisible", "sn", "enableFreq"],
props: ["freqVisible", "sn", "enableFreq", "tenantFlag"],
data() {
let checkCatchingTimer = (rule, vaule, cb) => {
if (this.freqForm.fqType == "0") {
......
......@@ -128,14 +128,25 @@
<el-button v-if="row.sns" type="text" size="mini" @click="btnClick('unbind', row)">解绑</el-button>
<!-- <el-button v-if="scope.scope.adjFreq === 1" type="text" size="mini" @click="btnClick('freq', scope.scope)">一键调频</el-button> -->
<el-button type="text" size="mini" @click="gotoMonitor(row)">监控</el-button>
<el-dropdown v-if="row.adjFreq" @command="handleCommand" style="margin-left:5px">
<template v-if="hasPermission('vehicle_vin_frequency')">
<el-dropdown v-if="row.adjFreq" @command="handleCommand" class="frequencyClass">
<el-button size="mini">
<i class="el-icon-arrow-down"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="row.adjFreq===1" :command="getCommand('freq', row.sn, row.enableFre)">一键调频</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</template>
<!-- <el-dropdown v-if="row.adjFreq" @command="handleCommand" style="margin-left:5px">
<el-button size="mini">
<i class="el-icon-arrow-down"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="row.adjFreq===1" :command="getCommand('freq', row.sn, row.enableFre)">一键调频</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
</template>
</template>
</el-table-column>
......@@ -350,7 +361,7 @@
<!-- 车辆归属弹框 end -->
<!-- 一键调频 弹框 开始 -->
<freq-modal :freqVisible="freqVisible" v-if="freqVisible" :frequencyForm="frequencyForm" @onFreqModalChange="FreqModalChange" :sn="freqSn" :enableFreq="enableFreq"></freq-modal>
<freq-modal :tenantFlag="tenantFlag" :freqVisible="freqVisible" v-if="freqVisible" :frequencyForm="frequencyForm" @onFreqModalChange="FreqModalChange" :sn="freqSn" :enableFreq="enableFreq"></freq-modal>
<!-- 一键调频 弹框 end -->
</div>
......@@ -842,7 +853,8 @@ export default {
responseStatusList:{
1:'发送中',
2:'是'
}
},
tenantFlag: false
};
},
......@@ -874,6 +886,10 @@ export default {
});
}
this.getList();
let a = JSON.parse(localStorage.getItem('userInfo'));
if (a.tenant == "ZLGJ") {
this.tenantFlag = true;
}
},
methods: {
......@@ -1892,4 +1908,7 @@ export default {
margin-left: 10px;
}
}
.frequencyClass {
margin-left:5px
}
</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!