修改测试bug

This commit is contained in:
guanj
2026-01-06 11:35:11 +08:00
parent d25f16bcc7
commit 5d3d16f8ec
12 changed files with 497 additions and 442 deletions

View File

@@ -14,7 +14,7 @@
<el-option
v-for="item in options"
:key="item.lineId"
:label="item.name"
:label="item.lineName"
:value="item.lineId"
/>
</el-select>
@@ -34,7 +34,7 @@ import TableHeader from '@/components/table/header/index.vue'
import TableStore from '@/utils/tableStore'
import { mainHeight } from '@/utils/layout'
import HarmonicRatio from '@/components/cockpit/gridSideStatistics/components/harmonicRatio.vue'
import { cslineList } from '@/api/harmonic-boot/cockpit/cockpit'
import { cslineList ,governLineList} from '@/api/harmonic-boot/cockpit/cockpit'
const dialogVisible: any = ref(false)
const harmonicRatioRef: any = ref(null)
@@ -139,8 +139,10 @@ const tableStore: any = new TableStore({
provide('tableStore', tableStore)
tableStore.table.params.sortBy = ''
tableStore.table.params.orderBy = ''
const time:any=ref([])
const open = async (row: any,searchBeginTime:any,searchEndTime:any) => {
dialogVisible.value = true
time.value=[searchBeginTime,searchEndTime]
initCSlineList()
tableStore.table.params.lineId = row.lineId
@@ -175,8 +177,19 @@ const onHarmonicRatioClose = () => {
}
const initCSlineList = async () => {
const res = await cslineList({})
options.value = res.data
// const res = await cslineList({})
const res = await governLineList({
endTime:time.value[1],
keywords:"",
pageNum:1,
pageSize:10000,
searchBeginTime:time.value[0],
searchEndTime:time.value[1],
startTime:time.value[0],
timeFlag:1
})
options.value = res.data.records
}

View File

@@ -6,7 +6,8 @@
:showReset="false"
@selectChange="selectChange"
datePicker
v-if="fullscreen" :timeKeyList="prop.timeKey"
v-if="fullscreen"
:timeKeyList="prop.timeKey"
></TableHeader>
<Table
ref="tableRef"
@@ -17,27 +18,29 @@
<OverLimitDetails ref="OverLimitDetailsRef" />
<!-- 上传对话框 -->
<el-dialog v-model="uploadDialogVisible" title="上传报告" width="500px" @closed="handleDialogClosed">
<el-dialog v-model="uploadDialogVisible" title="上传报告" append-to-body width="500px" @closed="handleDialogClosed">
<el-upload
ref="uploadRef"
class="upload-demo"
:auto-upload="true"
action=""
accept=".doc,.docx,.PDF"
:on-change="handleChange"
:before-upload="beforeUpload"
:http-request="handleUpload"
:limit="1"
:auto-upload="false"
:on-exceed="handleExceed"
:on-remove="handleRemove"
:file-list="fileList"
>
<el-button type="primary">点击上传</el-button>
<template #tip>
<div class="el-upload__tip">只能上传Word或PDF文件且不超过10MB</div>
<div class="el-upload__tip">上传Word或PDF文件</div>
</template>
</el-upload>
<template #footer>
<span class="dialog-footer">
<el-button @click="uploadDialogVisible = false">取消</el-button>
<el-button type="primary" @click="uploadDialogVisible = false">确定</el-button>
<el-button type="primary" @click="handleUpload">确定</el-button>
</span>
</template>
</el-dialog>
@@ -59,7 +62,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -279,14 +282,18 @@ const handleDialogClosed = () => {
}
// 处理文件超出限制
const handleExceed = (files: any, fileList: any) => {
const handleExceed = (files: any) => {
ElMessage.warning('只能上传一个文件,请先删除已选择的文件')
}
const handleRemove = (files: any) => {
fileList.value = []
}
// 文件变更处理函数
const handleChange = (file: any, fileList: any) => {
const handleChange = (file: any) => {
// 在这里直接处理文件上传逻辑
beforeUpload(file.raw) // 注意使用 file.raw 获取原始文件对象
// beforeUpload(file.raw) // 注意使用 file.raw 获取原始文件对象
fileList.value = [file] // 只保留最新选择的文件
}
// 处理上传前检查
@@ -303,11 +310,7 @@ const beforeUpload = (file: any) => {
const isLt10M = file.size / 1024 / 1024 < 10
if (!isValidType) {
ElMessage.error('上传文件只能是 Word 文档(.doc/.docx) 或 PDF 文件(.pdf)!')
return false
}
if (!isLt10M) {
ElMessage.error('上传文件大小不能超过 10MB!')
ElMessage.error('上传(.doc/.docx/.pdf)格式文件!')
return false
}
@@ -315,10 +318,12 @@ const beforeUpload = (file: any) => {
return true
}
const handleUpload = async (options: any) => {
const { file } = options
const handleUpload = async () => {
console.log(123, fileList.value)
// return
const formData = new FormData()
formData.append('file', file)
formData.append('file', fileList.value[0]?.raw)
formData.append('lineId', currentUploadRow.value?.lineId || currentUploadRow.value?.id || '')
try {

View File

@@ -21,8 +21,8 @@
<el-image
:hide-on-click-modal="true"
:preview-teleported="true"
:preview-src-list="[fieldValue]"
:src="fieldValue.length > 100 ? fieldValue : getUrl(fieldValue)"
:preview-src-list="[imgList[fieldValue]]"
:src="fieldValue.length > 100 ? fieldValue : getUrl(fieldValue) ? imgList[fieldValue] : ''"
></el-image>
</div>
@@ -226,10 +226,12 @@ const handlerCommand = (item: OptButton) => {
break
}
}
const imgList: any = ref({})
const getUrl = (url: string) => {
getFileUrl({ filePath: url }).then(res => {
return res.data
imgList.value[url] = res.data
})
return true
}
</script>

View File

@@ -35,7 +35,6 @@ const config = useConfig()
const tree = ref()
const treRef = ref()
const changeDeviceType = (val: any, obj: any) => {
console.log('🚀 ~ changeDeviceType ~ val:', val, obj)
emit('deviceTypeChange', val, obj)
}
getDeviceTree().then(res => {
@@ -105,7 +104,6 @@ getDeviceTree().then(res => {
})
}
})
console.log('🚀 ~ file: deviceTree.vue ~ line 18 ~ getDeviceTree ~ tree:', arr, arr2, arr3)
tree.value = res.data
nextTick(() => {