|
|
|
@ -2,12 +2,19 @@
|
|
|
|
|
<div class="transformer">
|
|
|
|
|
<div class="choose chooseInputColor">
|
|
|
|
|
<div class="button" style="margin-bottom: 10px">
|
|
|
|
|
<el-button icon="el-icon-upload2" @click="onImportClick">导入</el-button>
|
|
|
|
|
<el-button icon="el-icon-upload2" @click="onImportClick"
|
|
|
|
|
>导入</el-button
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-button
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
@click="onDownloadClick"
|
|
|
|
|
>下载模板</el-button>-->
|
|
|
|
|
<el-button v-show="buttonShow" icon="el-icon-delete" @click="deleteReport">删除</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-show="buttonShow"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="deleteReport"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
<!-- 删除弹出框 -->
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="删除"
|
|
|
|
@ -16,7 +23,9 @@
|
|
|
|
|
width="36.5%"
|
|
|
|
|
center
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" size="small" @click="handleDelete">删除</el-button>
|
|
|
|
|
<el-button type="primary" size="small" @click="handleDelete"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="reportData.data"
|
|
|
|
|
border
|
|
|
|
@ -24,20 +33,44 @@
|
|
|
|
|
@selection-change="reportSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" align="center" />
|
|
|
|
|
<el-table-column label="序号" type="index" align="center" width="50" />
|
|
|
|
|
<el-table-column prop="fileName" label="报告名称" align="center" width="350" />
|
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center" width="200" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="序号"
|
|
|
|
|
type="index"
|
|
|
|
|
align="center"
|
|
|
|
|
width="50"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="fileName"
|
|
|
|
|
label="报告名称"
|
|
|
|
|
align="center"
|
|
|
|
|
width="350"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="createTime"
|
|
|
|
|
label="创建时间"
|
|
|
|
|
align="center"
|
|
|
|
|
width="200"
|
|
|
|
|
/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!--导入弹出框 -->
|
|
|
|
|
<el-dialog title="导入" :visible.sync="isShow" style="width: 100%" @close="downWindows">
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="导入"
|
|
|
|
|
:visible.sync="isShow"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
@close="downWindows"
|
|
|
|
|
>
|
|
|
|
|
<div class="uploadBox">
|
|
|
|
|
<el-form label-width="80px!important" :inline="true">
|
|
|
|
|
<el-row :gutter="20" type="flex" style="flex-wrap: wrap">
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<div>
|
|
|
|
|
<el-form-item label="设备名称">
|
|
|
|
|
<el-select v-model="equId2" placeholder="请选择设备名称">
|
|
|
|
|
<el-form-item label="设备间隔">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="equId2"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择设备间隔"
|
|
|
|
|
@change="equIdChange"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in equNameList"
|
|
|
|
|
:key="item.equId"
|
|
|
|
@ -46,6 +79,19 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<div>
|
|
|
|
|
<el-form-item label="设备名称">
|
|
|
|
|
<el-select v-model="stId2" placeholder="请选择设备名称">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in equThirdNameList"
|
|
|
|
|
:key="item.stId"
|
|
|
|
|
:label="item.stName"
|
|
|
|
|
:value="item.stId"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -74,7 +120,8 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
plain
|
|
|
|
|
>报告选择</el-button>
|
|
|
|
|
>报告选择</el-button
|
|
|
|
|
>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传xlsx/xls文件</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
@ -102,7 +149,8 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
plain
|
|
|
|
|
>附件选择,已选择{{ fileList.length }}个</el-button>
|
|
|
|
|
>附件选择,已选择{{ fileList.length }}个</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
@ -118,9 +166,12 @@
|
|
|
|
|
icon="el-icon-upload"
|
|
|
|
|
plain
|
|
|
|
|
@click="submitUpload()"
|
|
|
|
|
>将选择文件上传服务器</el-button>
|
|
|
|
|
>将选择文件上传服务器</el-button
|
|
|
|
|
>
|
|
|
|
|
</span>
|
|
|
|
|
<el-button v-show="ShowPreview" style="width: 60px" @click="close">关闭</el-button>
|
|
|
|
|
<el-button v-show="ShowPreview" style="width: 60px" @click="close"
|
|
|
|
|
>关闭</el-button
|
|
|
|
|
>
|
|
|
|
|
<!-- <file-preview v-show="Showexcel" :file-type="fileType" :excel-pv-props="excelPvProps" />
|
|
|
|
|
<img v-show="Showimg" :src="srcOthers" alt width="300px" height="300px">
|
|
|
|
|
<pdf v-for="i in numPages" v-show="Showpdf" :key="i" :src="src" :page="i" /> -->
|
|
|
|
@ -134,10 +185,15 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
<el-form label-width="80px!important" :inline="true">
|
|
|
|
|
<el-row :gutter="20" type="flex" style="flex-wrap: wrap;">
|
|
|
|
|
<el-row :gutter="20" type="flex" style="flex-wrap: wrap">
|
|
|
|
|
<el-col v-show="excelShow" :span="6">
|
|
|
|
|
<el-form-item label="设备间隔">
|
|
|
|
|
<el-select v-model="equId" clearable placeholder="请选择设备间隔" @change="equIdChange">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="equId"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择设备间隔"
|
|
|
|
|
@change="equIdChange"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in equNameList"
|
|
|
|
|
:key="item.equId"
|
|
|
|
@ -227,8 +283,12 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="searchLeft">
|
|
|
|
|
<div class="searchButton">
|
|
|
|
|
<el-button icon="el-icon-search" @click="onSeacherClick">查询</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh-right" @click="onResetBtnClick">重置</el-button>
|
|
|
|
|
<el-button icon="el-icon-search" @click="onSeacherClick"
|
|
|
|
|
>查询</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button icon="el-icon-refresh-right" @click="onResetBtnClick"
|
|
|
|
|
>重置</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -238,8 +298,8 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
// import FilePreview from '@mrhanson/vue-file-preview'
|
|
|
|
|
import pdf from 'vue-pdf'
|
|
|
|
|
import Storage from '@/commons/storage'
|
|
|
|
|
import pdf from "vue-pdf";
|
|
|
|
|
import Storage from "@/commons/storage";
|
|
|
|
|
import {
|
|
|
|
|
importReport,
|
|
|
|
|
downloadExcel,
|
|
|
|
@ -248,68 +308,69 @@ import {
|
|
|
|
|
getFirstExcelList,
|
|
|
|
|
deviceSubclassList,
|
|
|
|
|
testItemList,
|
|
|
|
|
} from '@/api/user'
|
|
|
|
|
var mytoken = Storage.get(Storage.KEYS.TOKEN)
|
|
|
|
|
} from "@/api/user";
|
|
|
|
|
var mytoken = Storage.get(Storage.KEYS.TOKEN);
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
// 'file-preview': FilePreview,
|
|
|
|
|
pdf: pdf
|
|
|
|
|
pdf: pdf,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
deleteShow: Boolean,
|
|
|
|
|
excelShow: Boolean,
|
|
|
|
|
buttonShow: Boolean,
|
|
|
|
|
reportData: Object
|
|
|
|
|
reportData: Object,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
sheetName: '',
|
|
|
|
|
stId: '',
|
|
|
|
|
equId: '',
|
|
|
|
|
equId2: '',
|
|
|
|
|
timeData: '',
|
|
|
|
|
testItem: '',
|
|
|
|
|
offlineParam: '',
|
|
|
|
|
deleted: '',
|
|
|
|
|
sheetName: "",
|
|
|
|
|
stId: "",
|
|
|
|
|
stId2: "",
|
|
|
|
|
equId: "",
|
|
|
|
|
equId2: "",
|
|
|
|
|
timeData: "",
|
|
|
|
|
testItem: "",
|
|
|
|
|
offlineParam: "",
|
|
|
|
|
deleted: "",
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
shortcuts: [
|
|
|
|
|
{
|
|
|
|
|
text: '最近一个月',
|
|
|
|
|
text: "最近一个月",
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date()
|
|
|
|
|
const start = new Date()
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
|
|
|
picker.$emit('pick', [start, end])
|
|
|
|
|
}
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
|
picker.$emit("pick", [start, end]);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '最近三个月',
|
|
|
|
|
text: "最近三个月",
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date()
|
|
|
|
|
const start = new Date()
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 91)
|
|
|
|
|
picker.$emit('pick', [start, end])
|
|
|
|
|
}
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
|
|
|
|
|
picker.$emit("pick", [start, end]);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '最近半年',
|
|
|
|
|
text: "最近半年",
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date()
|
|
|
|
|
const start = new Date()
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 183)
|
|
|
|
|
picker.$emit('pick', [start, end])
|
|
|
|
|
}
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 183);
|
|
|
|
|
picker.$emit("pick", [start, end]);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '最近一年',
|
|
|
|
|
text: "最近一年",
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date()
|
|
|
|
|
const start = new Date()
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
|
|
|
|
|
picker.$emit('pick', [start, end])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
|
|
|
|
|
picker.$emit("pick", [start, end]);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
equNameList: [],
|
|
|
|
|
deviceSubclassList: [],
|
|
|
|
@ -326,28 +387,28 @@ export default {
|
|
|
|
|
Showword: false,
|
|
|
|
|
ShowVideo: false,
|
|
|
|
|
preview: false,
|
|
|
|
|
fileType: 'excel',
|
|
|
|
|
fileType: "excel",
|
|
|
|
|
excelPvProps: {
|
|
|
|
|
file: null,
|
|
|
|
|
isClientStream: true,
|
|
|
|
|
tableHeight: 500
|
|
|
|
|
tableHeight: 500,
|
|
|
|
|
},
|
|
|
|
|
srcOthers: '',
|
|
|
|
|
src: '',
|
|
|
|
|
srcOthers: "",
|
|
|
|
|
src: "",
|
|
|
|
|
numPages: undefined,
|
|
|
|
|
upload: '', // 这里写上传文件的地址
|
|
|
|
|
upload: "", // 这里写上传文件的地址
|
|
|
|
|
uploadData: null,
|
|
|
|
|
headers: { token: mytoken },
|
|
|
|
|
paramsArrester: {
|
|
|
|
|
equType: '',
|
|
|
|
|
equType: "",
|
|
|
|
|
limit: 10,
|
|
|
|
|
page: 1,
|
|
|
|
|
equLittleId: '',
|
|
|
|
|
testItem: '',
|
|
|
|
|
offlineParam: ''
|
|
|
|
|
equLittleId: "",
|
|
|
|
|
testItem: "",
|
|
|
|
|
offlineParam: "",
|
|
|
|
|
},
|
|
|
|
|
equThirdNameList: [],
|
|
|
|
|
experimentData: []
|
|
|
|
|
experimentData: [],
|
|
|
|
|
// vHtml: '',
|
|
|
|
|
// playerOptions: {
|
|
|
|
|
// playbackRates: [0.5, 1.0, 1.5, 2.0],//倍速控制
|
|
|
|
@ -372,14 +433,14 @@ export default {
|
|
|
|
|
// fullscreenToggle: true,//全屏按钮
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
searchLeft() {
|
|
|
|
|
let valSpan = 6
|
|
|
|
|
this.excelShow ? valSpan = 6 : valSpan = 24
|
|
|
|
|
return valSpan
|
|
|
|
|
}
|
|
|
|
|
let valSpan = 6;
|
|
|
|
|
this.excelShow ? (valSpan = 6) : (valSpan = 24);
|
|
|
|
|
return valSpan;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getEquNameList();
|
|
|
|
@ -404,45 +465,47 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
arresterExperimentListData() {
|
|
|
|
|
this.paramsArrester.equType = 4
|
|
|
|
|
this.paramsArrester.equType = 4;
|
|
|
|
|
getFirstExcelList(this.paramsArrester).then((res) => {
|
|
|
|
|
if (res.code == 0 && res.data) {
|
|
|
|
|
this.experimentData = res.data
|
|
|
|
|
this.experimentData = res.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 设备名称列表
|
|
|
|
|
getEquNameList() {
|
|
|
|
|
const equType = 4
|
|
|
|
|
const equType = 4;
|
|
|
|
|
getEquNameList(equType).then((res) => {
|
|
|
|
|
if (res.code == 0 && res.data) {
|
|
|
|
|
this.equNameList = res.data
|
|
|
|
|
this.equNameList = res.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
equIdChange() {
|
|
|
|
|
const equType = 4
|
|
|
|
|
getThirdEquNameList(equType, this.equId).then((res) => {
|
|
|
|
|
const equType = 4;
|
|
|
|
|
const paramId = this.equId2 || this.equId;
|
|
|
|
|
console.log(this.equId);
|
|
|
|
|
getThirdEquNameList(equType, paramId).then((res) => {
|
|
|
|
|
if (res.code == 0 && res.data) {
|
|
|
|
|
this.equThirdNameList = res.data
|
|
|
|
|
this.equThirdNameList = res.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleDelete() {
|
|
|
|
|
this.$emit('handleDelete')
|
|
|
|
|
this.$emit("handleDelete");
|
|
|
|
|
},
|
|
|
|
|
onResetBtnClick() {
|
|
|
|
|
this.equId = ''
|
|
|
|
|
this.timeData = ''
|
|
|
|
|
this.sheetName = ''
|
|
|
|
|
this.stId = ''
|
|
|
|
|
this.testItem = ''
|
|
|
|
|
this.offlineParam = ''
|
|
|
|
|
this.deleted = ''
|
|
|
|
|
this.equId = "";
|
|
|
|
|
this.timeData = "";
|
|
|
|
|
this.sheetName = "";
|
|
|
|
|
this.stId = "";
|
|
|
|
|
this.testItem = "";
|
|
|
|
|
this.offlineParam = "";
|
|
|
|
|
this.deleted = "";
|
|
|
|
|
},
|
|
|
|
|
onSeacherClick() {
|
|
|
|
|
this.$emit(
|
|
|
|
|
'onSeacherClick',
|
|
|
|
|
"onSeacherClick",
|
|
|
|
|
this.equId,
|
|
|
|
|
this.stId,
|
|
|
|
|
this.sheetName,
|
|
|
|
@ -450,13 +513,13 @@ export default {
|
|
|
|
|
this.testItem,
|
|
|
|
|
this.offlineParam,
|
|
|
|
|
this.deleted
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
deleteReport() {
|
|
|
|
|
this.$emit('deleteReport', true)
|
|
|
|
|
this.$emit("deleteReport", true);
|
|
|
|
|
},
|
|
|
|
|
handleClose() {
|
|
|
|
|
this.$emit('deleteReport', false)
|
|
|
|
|
this.$emit("deleteReport", false);
|
|
|
|
|
},
|
|
|
|
|
// // 选择文件改变
|
|
|
|
|
// handleReportChange(files, reportList) {
|
|
|
|
@ -469,56 +532,56 @@ export default {
|
|
|
|
|
// },
|
|
|
|
|
// 移除文件
|
|
|
|
|
handleReportRemove(file, reportList) {
|
|
|
|
|
this.reportList = reportList
|
|
|
|
|
this.reportList = reportList;
|
|
|
|
|
// this.fileList = undefined 删除报告会删除附件
|
|
|
|
|
// this.fileList = new Array()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 选择文件改变
|
|
|
|
|
handleChange(files, fileList) {
|
|
|
|
|
this.fileList = fileList
|
|
|
|
|
this.fileList = fileList;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 选择文件改变
|
|
|
|
|
handleChangeReport(files, reportList) {
|
|
|
|
|
// this.reportList = reportList
|
|
|
|
|
this.reportList = reportList
|
|
|
|
|
this.reportList = reportList;
|
|
|
|
|
if (reportList.length > 1) {
|
|
|
|
|
reportList.splice(0, 1)
|
|
|
|
|
reportList.splice(0, 1);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 移除文件
|
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
|
this.fileList = fileList
|
|
|
|
|
this.fileList = fileList;
|
|
|
|
|
},
|
|
|
|
|
// 预览
|
|
|
|
|
handlePreview(file, fileList) {
|
|
|
|
|
// console.log(file)
|
|
|
|
|
const types = file.name.split('.')[1]
|
|
|
|
|
const fileType1 = ['xlsx', 'xlc', 'xlm', 'xls', 'xlt', 'xlw', 'csv'].some(
|
|
|
|
|
const types = file.name.split(".")[1];
|
|
|
|
|
const fileType1 = ["xlsx", "xlc", "xlm", "xls", "xlt", "xlw", "csv"].some(
|
|
|
|
|
(item) => item === types
|
|
|
|
|
)
|
|
|
|
|
const fileType2 = ['svg', 'png', 'jpg', 'jpeg'].some(
|
|
|
|
|
);
|
|
|
|
|
const fileType2 = ["svg", "png", "jpg", "jpeg"].some(
|
|
|
|
|
(item) => item === types
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
// let fileType3 = ['doc','docx','docm','dotm','dotx','dot'].some(item => item === types)
|
|
|
|
|
const fileType4 = ['pdf'].some((item) => item === types)
|
|
|
|
|
const fileType4 = ["pdf"].some((item) => item === types);
|
|
|
|
|
// let fileType5 = ['mp4'].some(item => item === types)
|
|
|
|
|
if (fileType1) {
|
|
|
|
|
console.log(file.raw)
|
|
|
|
|
this.excelPvProps.file = file.raw
|
|
|
|
|
console.log(this.excelPvProps.file)
|
|
|
|
|
this.ShowPreview = true
|
|
|
|
|
this.Showexcel = true
|
|
|
|
|
console.log(file.raw);
|
|
|
|
|
this.excelPvProps.file = file.raw;
|
|
|
|
|
console.log(this.excelPvProps.file);
|
|
|
|
|
this.ShowPreview = true;
|
|
|
|
|
this.Showexcel = true;
|
|
|
|
|
} else if (fileType2) {
|
|
|
|
|
const reader = new FileReader()
|
|
|
|
|
const _this = this
|
|
|
|
|
reader.readAsDataURL(file.raw)
|
|
|
|
|
reader.onloadend = function() {
|
|
|
|
|
_this.srcOthers = this.result
|
|
|
|
|
_this.ShowPreview = true
|
|
|
|
|
_this.Showimg = true
|
|
|
|
|
}
|
|
|
|
|
const reader = new FileReader();
|
|
|
|
|
const _this = this;
|
|
|
|
|
reader.readAsDataURL(file.raw);
|
|
|
|
|
reader.onloadend = function () {
|
|
|
|
|
_this.srcOthers = this.result;
|
|
|
|
|
_this.ShowPreview = true;
|
|
|
|
|
_this.Showimg = true;
|
|
|
|
|
};
|
|
|
|
|
// }else if(fileType3){
|
|
|
|
|
// let _this = this
|
|
|
|
|
// let reader = new FileReader()
|
|
|
|
@ -532,14 +595,14 @@ export default {
|
|
|
|
|
// }).done()
|
|
|
|
|
// }
|
|
|
|
|
} else if (fileType4) {
|
|
|
|
|
const pdfurl = URL.createObjectURL(file.raw)
|
|
|
|
|
const loadingTask = pdf.createLoadingTask(pdfurl)
|
|
|
|
|
this.src = loadingTask
|
|
|
|
|
const pdfurl = URL.createObjectURL(file.raw);
|
|
|
|
|
const loadingTask = pdf.createLoadingTask(pdfurl);
|
|
|
|
|
this.src = loadingTask;
|
|
|
|
|
this.src.promise.then((pdf) => {
|
|
|
|
|
this.numPages = pdf.numPages
|
|
|
|
|
})
|
|
|
|
|
this.ShowPreview = true
|
|
|
|
|
this.Showpdf = true
|
|
|
|
|
this.numPages = pdf.numPages;
|
|
|
|
|
});
|
|
|
|
|
this.ShowPreview = true;
|
|
|
|
|
this.Showpdf = true;
|
|
|
|
|
// }else if(fileType5){
|
|
|
|
|
// let url = null ;
|
|
|
|
|
// if (window.createObjectURL!=undefined) { // basic
|
|
|
|
@ -556,113 +619,116 @@ export default {
|
|
|
|
|
// console.log(url)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '暂不支持该类型文件预览',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
message: "暂不支持该类型文件预览",
|
|
|
|
|
type: "warning",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
close() {
|
|
|
|
|
this.ShowPreview = false
|
|
|
|
|
this.Showexcel = false
|
|
|
|
|
this.Showimg = false
|
|
|
|
|
this.Showpdf = false
|
|
|
|
|
this.Showword = false
|
|
|
|
|
this.ShowVideo = false
|
|
|
|
|
this.ShowPreview = false;
|
|
|
|
|
this.Showexcel = false;
|
|
|
|
|
this.Showimg = false;
|
|
|
|
|
this.Showpdf = false;
|
|
|
|
|
this.Showword = false;
|
|
|
|
|
this.ShowVideo = false;
|
|
|
|
|
},
|
|
|
|
|
importFile() {
|
|
|
|
|
if (
|
|
|
|
|
this.$refs.upload.$el.children[0].children[1].value == '' ||
|
|
|
|
|
this.$refs.upload2.$el.children[0].children[1].value == ''
|
|
|
|
|
this.$refs.upload.$el.children[0].children[1].value == "" ||
|
|
|
|
|
this.$refs.upload2.$el.children[0].children[1].value == ""
|
|
|
|
|
) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '报告和附件不能为空',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
message: "报告和附件不能为空",
|
|
|
|
|
type: "warning",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.$refs.upload.submit()
|
|
|
|
|
this.$refs.upload2.submit()
|
|
|
|
|
const formData = new FormData()
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
this.$refs.upload2.submit();
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
this.fileList.forEach((item) => {
|
|
|
|
|
formData.append('files', item.raw)
|
|
|
|
|
})
|
|
|
|
|
formData.append("files", item.raw);
|
|
|
|
|
});
|
|
|
|
|
this.reportList.forEach((item) => {
|
|
|
|
|
formData.append('file', item.raw)
|
|
|
|
|
})
|
|
|
|
|
formData.append('eqType', 4)
|
|
|
|
|
formData.append('equipmentId', this.equId2)
|
|
|
|
|
formData.append('jgId', '')
|
|
|
|
|
formData.append("file", item.raw);
|
|
|
|
|
});
|
|
|
|
|
formData.append("eqType", 4);
|
|
|
|
|
// formData.append("equipmentId", this.equId2);
|
|
|
|
|
formData.append("equipmentId", this.stId2);
|
|
|
|
|
formData.append("jgId", this.equId2);
|
|
|
|
|
// formData.append("jgId", "");
|
|
|
|
|
importReport(formData).then((res) => {
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
this.$message.success('文件上传成功!')
|
|
|
|
|
this.$refs.upload.clearFiles() // 清除上传文件
|
|
|
|
|
this.$refs.upload2.clearFiles()
|
|
|
|
|
this.$message.success("文件上传成功!");
|
|
|
|
|
this.$refs.upload.clearFiles(); // 清除上传文件
|
|
|
|
|
this.$refs.upload2.clearFiles();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning('文件上传失败!')
|
|
|
|
|
this.$message.warning("文件上传失败!");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 上传文件
|
|
|
|
|
submitUpload() {
|
|
|
|
|
const name = this.reportList[0].name
|
|
|
|
|
let status = 0
|
|
|
|
|
const name = this.reportList[0].name;
|
|
|
|
|
let status = 0;
|
|
|
|
|
if (this.experimentData.length != 0) {
|
|
|
|
|
for (let index = 0; index < this.experimentData.length; index++) {
|
|
|
|
|
const element = this.experimentData[index].fileName
|
|
|
|
|
const element = this.experimentData[index].fileName;
|
|
|
|
|
if (element === name) {
|
|
|
|
|
this.$confirm('此报告已存在是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
this.$confirm("此报告已存在是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.importFile()
|
|
|
|
|
return
|
|
|
|
|
this.importFile();
|
|
|
|
|
return;
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消导入'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
})
|
|
|
|
|
type: "info",
|
|
|
|
|
message: "已取消导入",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
status = status + 1
|
|
|
|
|
status = status + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (status === this.experimentData.length) {
|
|
|
|
|
this.importFile()
|
|
|
|
|
this.importFile();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.importFile()
|
|
|
|
|
this.importFile();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
downWindows() {
|
|
|
|
|
this.$refs.upload.clearFiles() // 清除上传文件
|
|
|
|
|
this.$refs.upload2.clearFiles()
|
|
|
|
|
this.fileList = []
|
|
|
|
|
this.reportList = []
|
|
|
|
|
this.$router.replace({ path: '/refresh' })
|
|
|
|
|
this.$refs.upload.clearFiles(); // 清除上传文件
|
|
|
|
|
this.$refs.upload2.clearFiles();
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
this.reportList = [];
|
|
|
|
|
this.$router.replace({ path: "/refresh" });
|
|
|
|
|
},
|
|
|
|
|
onImportClick() {
|
|
|
|
|
this.equId2 = ''
|
|
|
|
|
this.isShow = true
|
|
|
|
|
this.arresterExperimentListData()
|
|
|
|
|
this.equId2 = "";
|
|
|
|
|
this.stId2 = "";
|
|
|
|
|
this.isShow = true;
|
|
|
|
|
this.arresterExperimentListData();
|
|
|
|
|
},
|
|
|
|
|
// 下载模板
|
|
|
|
|
onDownloadClick() {
|
|
|
|
|
const token = Storage.get(Storage.KEYS.TOKEN)
|
|
|
|
|
const equType = 4
|
|
|
|
|
const params = '?token=' + token + '&equType=' + equType
|
|
|
|
|
downloadExcel(params)
|
|
|
|
|
const token = Storage.get(Storage.KEYS.TOKEN);
|
|
|
|
|
const equType = 4;
|
|
|
|
|
const params = "?token=" + token + "&equType=" + equType;
|
|
|
|
|
downloadExcel(params);
|
|
|
|
|
},
|
|
|
|
|
reportSelectionChange(val) {
|
|
|
|
|
this.$emit('reportSelectionChange', val)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$emit("reportSelectionChange", val);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped >
|
|
|
|
|
@import '~@/assets/stylesheet/index';
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import "~@/assets/stylesheet/index";
|
|
|
|
|
/deep/ .el-dialog__headerbtn {
|
|
|
|
|
background: none !important;
|
|
|
|
|
color: #909399 !important;
|
|
|
|
@ -693,4 +759,3 @@ export default {
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|