修改 在线监测告警 页面

This commit is contained in:
GGJ
2024-04-07 16:40:16 +08:00
parent 266da2405f
commit 81a1e38344
8 changed files with 273 additions and 68 deletions

View File

@@ -1,6 +1,6 @@
<template>
<el-form :model="effectivenessAnalysisData" :rules="rules" ref="form2Ref" label-width="auto">
<el-form-item label="成效分析概述:" style="margin-top: 10px" prop="descriptionZlxg">
<el-form-item label="成效分析概述:" style="margin-top: 10px" prop="descriptionZlxg" :disabled="prop.disabled">
<el-input
type="textarea"
style="width: 400px"
@@ -11,12 +11,14 @@
</el-form-item>
<el-divider></el-divider>
<el-form-item class="item" label="实际采取措施报告:" style="margin-top: 10px" prop="fileList">
<el-upload
v-model:file-list="effectivenessAnalysisData.fileList"
ref="upload"
action=""
:limit="1"
v-if="!prop.disabled"
:on-exceed="handleExceed"
:auto-upload="false"
>
@@ -24,6 +26,9 @@
<el-button type="primary">上传文件</el-button>
</template>
</el-upload>
<el-button type="primary" link @click="download" v-else>
{{ prop.List.fileNameZlxg }}
</el-button>
</el-form-item>
</el-form>
</template>
@@ -32,11 +37,18 @@ import { useDictData } from '@/stores/dictData'
import { uploadFile, effectAnalysis } from '@/api/process-boot/electricitymanagement'
import { UploadInstance, UploadProps, UploadRawFile, ElMessage, ElMessageBox } from 'element-plus'
import { genFileId } from 'element-plus'
import { ref, reactive } from 'vue'
import { ref, onMounted } from 'vue'
const prop = defineProps({
addData: {
type: Object,
default: () => {}
},
List: {
type: Object,
default: () => {}
},
disabled: {
type: Boolean
}
})
const emit = defineEmits(['handleClose'])
@@ -61,6 +73,22 @@ const handleExceed: UploadProps['onExceed'] = files => {
file.uid = genFileId()
upload.value!.handleStart(file)
}
// 下载
const download = async () => {
// window.open(addForm.value.ifile)
let response = await fetch(prop.List.filePathZlxg)
let blob = await response.blob()
let a = document.createElement('a')
a.href = window.URL.createObjectURL(blob)
a.download = prop.List.fileNameZlxg
a.click()
a.remove()
}
onMounted(() => {
if (prop.List.filePathZlxg != null) {
effectivenessAnalysisData.value = prop.List
}
})
const submit = () => {
form2Ref.value.validate(async (valid: any) => {