diff --git a/src/components/PreviewFile/index.vue b/src/components/PreviewFile/index.vue index e11fb4c5..f6ebe22e 100644 --- a/src/components/PreviewFile/index.vue +++ b/src/components/PreviewFile/index.vue @@ -1,11 +1,13 @@ diff --git a/src/components/table/header/index.vue b/src/components/table/header/index.vue index fe89b578..f0c87443 100644 --- a/src/components/table/header/index.vue +++ b/src/components/table/header/index.vue @@ -231,6 +231,16 @@ const setDatePicker = (list: any) => { const onResetForm = () => { //时间重置成默认值 datePickerRef.value?.setTheDate(3) + + if (props.datePicker && timeAll.value) { + tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0] + tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1] + tableStore.table.params.startTime = datePickerRef.value.timeValue[0] + tableStore.table.params.endTime = datePickerRef.value.timeValue[1] + tableStore.table.params.timeFlag = datePickerRef.value.timeFlag + tableStore.table.params.interval = datePickerRef.value.interval + } + tableStore.onTableAction('reset', {}) } const setTheDate = (val: any) => { @@ -238,7 +248,7 @@ const setTheDate = (val: any) => { } // 导出 const onExport = () => { - console.log('导出') + tableStore.onTableAction('export', { showAllFlag: true }) } diff --git a/src/styles/element.scss b/src/styles/element.scss index 3c48cb43..8fdeee98 100644 --- a/src/styles/element.scss +++ b/src/styles/element.scss @@ -268,3 +268,8 @@ .el-drawer__body { padding: 10px; } + +.aLoad{ + color: var(--el-color-primary); + cursor: pointer; +} \ No newline at end of file diff --git a/src/utils/fileDownLoad.ts b/src/utils/fileDownLoad.ts new file mode 100644 index 00000000..046b1738 --- /dev/null +++ b/src/utils/fileDownLoad.ts @@ -0,0 +1,35 @@ +import { downloadFile } from '@/api/system-boot/file' +// 下载文件 +export const download = (urls: string) => { + downloadFile({ filePath: urls }).then((res: any) => { + let blob = new Blob([res], { + type: urls.includes('.pdf') + ? 'application/pdf' + : urls.includes('.zip') + ? 'application/zip' + : urls.includes('.doc') + ? 'application/msword' + : urls.includes('.docx') + ? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' + : urls.includes('.xls') + ? 'application/vnd.ms-excel' + : urls.includes('.xlsx') + ? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + : urls.includes('.png') + ? 'image/png' + : urls.includes('.jpeg') + ? 'image/jpeg' + : urls.includes('.jpg') + ? 'image/jpg' + : '' + }) + const url = window.URL.createObjectURL(blob) + const link = document.createElement('a') + let name=urls.split('/')[2].split('.')[0] + link.href = url + link.download = name + document.body.appendChild(link) + link.click() + link.remove() + }) +} \ No newline at end of file diff --git a/src/utils/tableStore.ts b/src/utils/tableStore.ts index bd73623a..60c60492 100644 --- a/src/utils/tableStore.ts +++ b/src/utils/tableStore.ts @@ -130,6 +130,7 @@ export default class TableStore { * @param data 携带数据 */ onTableAction = (event: string, data: anyObj) => { + const actionFun = new Map([ [ 'search', @@ -202,6 +203,7 @@ export default class TableStore { 'export', () => { // this.index() + console.log('export') let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total } createAxios( Object.assign( @@ -213,6 +215,7 @@ export default class TableStore { ) ).then(res => { this.table.allData = filtration(res.data.records || res.data) + console.log('11111',this.table.allData) this.table.exportProcessingData && this.table.exportProcessingData() this.table.allFlag = data.showAllFlag || true }) diff --git a/src/views/pqs/supervise/electricalEnergy/components1/online.vue b/src/views/pqs/supervise/electricalEnergy/components1/online.vue index 714587ec..edd0e874 100644 --- a/src/views/pqs/supervise/electricalEnergy/components1/online.vue +++ b/src/views/pqs/supervise/electricalEnergy/components1/online.vue @@ -119,7 +119,7 @@ const tableStore = new TableStore({ filename: '在线监测', // isWebPaging:true, column: [ - { title: '', type: 'checkbox', width: 40 }, + { type: 'checkbox', width: 40 }, { title: '序号', @@ -334,7 +334,7 @@ tableStore.table.params.dataType = '1' tableStore.table.params.deptId = dictData.state.area[0].id provide('tableStore', tableStore) onMounted(() => { - // TableHeaderRef.value.setDatePicker([{label: '月', value: 3}]) + TableHeaderRef.value.setDatePicker([{label: '月', value: 3}]) tableStore.index() setTimeout(() => { diff --git a/src/views/pqs/supervise/harmonicSurvey/detail.vue b/src/views/pqs/supervise/harmonicSurvey/detail.vue index c941fdc7..a6d2f47b 100644 --- a/src/views/pqs/supervise/harmonicSurvey/detail.vue +++ b/src/views/pqs/supervise/harmonicSurvey/detail.vue @@ -24,7 +24,7 @@ - + {{ item.fileName }} @@ -61,6 +61,9 @@ import { getFileNameAndFilePath } from '@/api/system-boot/file' import { defaultAttribute } from '@/components/table/defaultAttribute' import { useDictData } from '@/stores/dictData' import { Link, View } from '@element-plus/icons-vue' +import{ download} from '@/utils/fileDownLoad' +import { util } from 'echarts' +import { it } from 'node:test' const { query } = useRoute() // 查询参数 const openFile = (name: any) => { window.open(window.location.origin + '/#/previewFile?/supervision/' + name) @@ -86,6 +89,7 @@ const getInfo = async () => { arr.slice(0, -1).forEach((item: any) => { getFileNameAndFilePath({ filePath: item }).then((res: any) => { + res.data.keyName = res.data.name aList.value.push(res.data) }) }) diff --git a/src/views/pqs/supervise/harmonicSurvey/test/detail.vue b/src/views/pqs/supervise/harmonicSurvey/test/detail.vue index 967126a4..a3056f67 100644 --- a/src/views/pqs/supervise/harmonicSurvey/test/detail.vue +++ b/src/views/pqs/supervise/harmonicSurvey/test/detail.vue @@ -59,27 +59,27 @@ - {{ detailData.supervisionReportName }} + {{ detailData.supervisionReportName }} - {{ detailData.testReportName }} + {{ detailData.testReportName }}
- {{ item.fileName }} + {{ item.fileName }}
- {{ detailData.reportName }} + {{ detailData.reportName }}