修改 冀北 现场问题

This commit is contained in:
GGJ
2024-08-21 16:05:06 +08:00
parent a6ab528220
commit ed4d982cbe
10 changed files with 193 additions and 101 deletions

View File

@@ -103,4 +103,10 @@ export function getTerminalUpLog(data: any) {
params: data params: data
}) })
} }
//查询新能源场站
export function selectDown() {
return createAxios({
url: '/device-boot/newStation/selectDown',
method: 'get'
})
}

View File

@@ -3,7 +3,7 @@
<TableHeader ref="TableHeaderRef"> <TableHeader ref="TableHeaderRef">
<template #select> <template #select>
<el-form-item label="新能源场站名称"> <el-form-item label="新能源场站名称">
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入关键字筛选" /> <el-input v-model="tableStore.table.params.name" clearable placeholder="输入关键字筛选" />
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>
@@ -25,7 +25,9 @@ import addForm from './components/addForm.vue'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
import { delNewStation } from '@/api/device-boot/newEnergy' import { delNewStation } from '@/api/device-boot/newEnergy'
defineOptions({
name: 'newEnergy/newEnergyLedger'
})
const dictData = useDictData() const dictData = useDictData()
//获取登陆用户姓名和部门 //获取登陆用户姓名和部门
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
@@ -109,7 +111,7 @@ const tableStore = new TableStore({
}, },
loadCallback: () => {} loadCallback: () => {}
}) })
tableStore.table.params.searchValue = '' tableStore.table.params.name = ''
const add = () => { const add = () => {
addFormRef.value.open({ addFormRef.value.open({
title: '新增' title: '新增'

View File

@@ -935,6 +935,22 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="form-item" label="新能源场站:">
<el-select
v-model="lineItem.newStationId"
placeholder="请选择新能源场站"
:disabled="pageStatus == 1"
clearable
>
<el-option
v-for="option in newStationIdArr"
:key="option.name"
:label="option.name"
:value="option.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item class="form-item" label="基准容量(MVA):"> <el-form-item class="form-item" label="基准容量(MVA):">
<el-input <el-input
v-model="lineItem.standardCapacity" v-model="lineItem.standardCapacity"
@@ -1424,7 +1440,14 @@ import { LocationInformation } from '@element-plus/icons-vue'
import Terminal from '@/components/tree/pqs/Terminal.vue' import Terminal from '@/components/tree/pqs/Terminal.vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { areaTree } from '@/api/system-boot/dicData' import { areaTree } from '@/api/system-boot/dicData'
import { queryTerminal, nodeAllList, delTerminal, updateTerminal, addTerminal } from '@/api/device-boot/Business.ts' import {
queryTerminal,
nodeAllList,
delTerminal,
updateTerminal,
addTerminal,
selectDown
} from '@/api/device-boot/Business'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
@@ -1565,6 +1588,7 @@ const monitorPointDetail: any = ref({
devCapacity: '', devCapacity: '',
/**短路容量 */ /**短路容量 */
shortCapacity: '', shortCapacity: '',
newStationId: '',
/**基准容量 */ /**基准容量 */
standardCapacity: '', standardCapacity: '',
/**监测点id */ /**监测点id */
@@ -1702,6 +1726,7 @@ const deviceBODetail: any = ref({
/**供电公司 */ /**供电公司 */
gdName: currentGdName.value gdName: currentGdName.value
}) })
const newStationIdArr: any = ref([])
const treeClickCount = ref(0) const treeClickCount = ref(0)
const project = ref([ const project = ref([
{ name: '在线项目', value: '在线项目' }, { name: '在线项目', value: '在线项目' },
@@ -1726,6 +1751,9 @@ const arrdess: any = ref((rule: any, value: any, callback: any) => {
callback(new Error('请输入正确IP/MAC地址')) callback(new Error('请输入正确IP/MAC地址'))
} }
}) })
selectDown().then(res => {
newStationIdArr.value = res.data
})
/**经度 */ /**经度 */
const lngff: any = ref((rule: any, value: any, callback: any) => { const lngff: any = ref((rule: any, value: any, callback: any) => {
let reg1 = /^(([1-9]\d?)|(1[0-7]\d))(\.\d{1,6})|180|0(\.\d{1,6})?/ let reg1 = /^(([1-9]\d?)|(1[0-7]\d))(\.\d{1,6})|180|0(\.\d{1,6})?/

View File

@@ -219,9 +219,7 @@ const open = async (text: string, id: string, addFlag: boolean) => {
} }
form.value.otherReport = [] form.value.otherReport = []
if (res.data.otherReport != null) { if (res.data.otherReport != null) {
console.log("🚀 ~ awaitgetTestById ~ form.value:", form.value) for (let i = 0; i < res.data.otherReport.split(',').length - 1; i++) {
for (let i = 0; i < res.data.otherReport.split(',').length.length; i++) {
form.value.otherReport.push({ form.value.otherReport.push({
name: res.data.otherReport.split(',')[i] name: res.data.otherReport.split(',')[i]
}) })
@@ -265,7 +263,7 @@ const submitFn = (flag: boolean) => {
if (form.value.otherReport.length > 0) { if (form.value.otherReport.length > 0) {
form.value.otherReport.forEach((item: any) => { form.value.otherReport.forEach((item: any) => {
// + '/supervision/' // + '/supervision/'
subForm.otherReport = subForm.otherReport + item.name + ',' subForm.otherReport = subForm.otherReport + item.name + ','
}) })
} }

View File

@@ -60,10 +60,12 @@
<a :href="detailData.testReport" target="_blank">{{ detailData.testReportName }}</a> <a :href="detailData.testReport" target="_blank">{{ detailData.testReportName }}</a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2" label="其他报告"> <el-descriptions-item :span="2" label="其他报告">
<el-icon class="elView" v-if="detailData?.otherReportName"> <div v-for="item in detailData.otherReports">
<View @click="openFile(detailData?.otherReportName)" /> <el-icon class="elView">
</el-icon> <View @click="openFile(item.fileName)" />
<a :href="detailData.otherReport" target="_blank">{{ detailData.otherReportName }}</a> </el-icon>
<a :href="item.url" target="_blank">{{ item.fileName }}</a>
</div>
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item label="流程状态" > <!-- <el-descriptions-item label="流程状态" >
@@ -110,14 +112,22 @@ const getInfo = async () => {
} }
const getFileData = async () => { const getFileData = async () => {
detailData.value.otherReports = []
await getFileNameAndFilePath({ filePath: detailData.value.testReport }).then(res => { await getFileNameAndFilePath({ filePath: detailData.value.testReport }).then(res => {
detailData.value.testReport = res.data.url detailData.value.testReport = res.data.url
detailData.value.testReportName = res.data.fileName detailData.value.testReportName = res.data.fileName
}) })
await getFileNameAndFilePath({ filePath: detailData.value.otherReport }).then(res => {
detailData.value.otherReport = res.data.url if (detailData.value.otherReport != null) {
detailData.value.otherReportName = res.data.fileName for (let i = 0; i < detailData.value.otherReport.split(',').length - 1; i++) {
}) await getFileNameAndFilePath({
filePath: '/supervision/' + detailData.value.otherReport.split(',')[i]
}).then(res => {
detailData.value.otherReports.push(res.data)
})
}
}
await getFileNameAndFilePath({ filePath: detailData.value.supervisionReport }).then(res => { await getFileNameAndFilePath({ filePath: detailData.value.supervisionReport }).then(res => {
detailData.value.supervisionReport = res.data.url detailData.value.supervisionReport = res.data.url
detailData.value.supervisionReportName = res.data.fileName detailData.value.supervisionReportName = res.data.fileName

View File

@@ -1055,6 +1055,7 @@ const open = async (row: any) => {
title.value = row.title title.value = row.title
dialogFormVisible.value = true dialogFormVisible.value = true
let deptIds = adminInfo.$state.deptId let deptIds = adminInfo.$state.deptId
addUploadRef.value?.reset()
if (row.row) { if (row.row) {
resendId.value = row.row.id resendId.value = row.row.id
status.value = row.row.status status.value = row.row.status
@@ -1544,5 +1545,4 @@ defineExpose({ open, filterUsers })
width: 250px; width: 250px;
text-align: left; text-align: left;
} }
</style> </style>

View File

@@ -1,14 +1,28 @@
<template> <template>
<el-form-item label="信息安全检测报告:">
<el-upload
v-model:file-list="form.informationSecurityTestReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'informationSecurityTestReport')"
:auto-upload="false"
:before-remove="beforeRemove('informationSecurityTestReport', '1')"
>
<template #trigger>
<el-button type="primary">上传文件</el-button>
</template>
</el-upload>
</el-form-item>
<el-form-item label="入网设计方案审查报告:"> <el-form-item label="入网设计方案审查报告:">
<el-upload <el-upload
v-model:file-list="form.NetReport" v-model:file-list="form.NetReport"
ref="NetReportRef" ref="NetReportRef"
action="" action=""
accept=".doc,.docx,.xlsx,.xls,.pdf" accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'NetReport')" @change="choose($event, 'NetReport')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('NetReport', '1')" :before-remove="beforeRemove('NetReport', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -20,31 +34,16 @@
v-model:file-list="form.governReport" v-model:file-list="form.governReport"
action="" action=""
accept=".doc,.docx,.xlsx,.xls,.pdf" accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'governReport')" @change="choose($event, 'governReport')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('governReport', '1')" :before-remove="beforeRemove('governReport', '1')"
>
<template #trigger>
<el-button type="primary">上传文件</el-button>
</template>
</el-upload>
</el-form-item>
<el-form-item label="信息安全检测报告:">
<el-upload
v-model:file-list="form.informationSecurityTestReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'informationSecurityTestReport')"
:auto-upload="false"
:before-remove="beforeRemove('informationSecurityTestReport', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
</template> </template>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="验收检验报告单:"> <el-form-item label="验收检验报告单:">
<el-upload <el-upload
v-model:file-list="form.acceptanceInspectionReportSingle" v-model:file-list="form.acceptanceInspectionReportSingle"
@@ -53,7 +52,7 @@
:limit="1" :limit="1"
@change="choose($event, 'acceptanceInspectionReportSingle')" @change="choose($event, 'acceptanceInspectionReportSingle')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('acceptanceInspectionReportSingle', '1')" :before-remove="beforeRemove('acceptanceInspectionReportSingle', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -68,7 +67,7 @@
:limit="1" :limit="1"
@change="choose($event, 'acceptanceInspectionReport')" @change="choose($event, 'acceptanceInspectionReport')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('acceptanceInspectionReport', '1')" :before-remove="beforeRemove('acceptanceInspectionReport', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -83,7 +82,7 @@
:limit="1" :limit="1"
@change="choose($event, 'typeExperimentReport')" @change="choose($event, 'typeExperimentReport')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('typeExperimentReport', '1')" :before-remove="beforeRemove('typeExperimentReport', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -98,7 +97,7 @@
:limit="1" :limit="1"
@change="choose($event, 'factoryInspectionReport')" @change="choose($event, 'factoryInspectionReport')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('factoryInspectionReport', '1')" :before-remove="beforeRemove('factoryInspectionReport', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -113,7 +112,7 @@
:limit="1" :limit="1"
@change="choose($event, 'performanceTestReport')" @change="choose($event, 'performanceTestReport')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('performanceTestReport', '1')" :before-remove="beforeRemove('performanceTestReport', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -128,7 +127,7 @@
:limit="1" :limit="1"
@change="choose($event, 'mainWiringDiagram')" @change="choose($event, 'mainWiringDiagram')"
:auto-upload="false" :auto-upload="false"
:before-remove="beforeRemove('mainWiringDiagram', '1')" :before-remove="beforeRemove('mainWiringDiagram', '1')"
> >
<template #trigger> <template #trigger>
<el-button type="primary">上传文件</el-button> <el-button type="primary">上传文件</el-button>
@@ -185,10 +184,8 @@ const formName: any = ref({
}) })
const beforeRemove = (name: any, flag?: string) => { const beforeRemove = (name: any, flag?: string) => {
console.log('🚀 ~ beforeRemove ~ flag:', flag) // console.log('🚀 ~ beforeRemove ~ flag:', flag)
if (flag == '1') { if (flag == '1') {
console.log('🚀 ~ beforeRemove ~ name:', name)
formName.value[name] = '' formName.value[name] = ''
} }
} }
@@ -203,14 +200,25 @@ const submitForm = async (id: string) => {
// console.log(form.value) // console.log(form.value)
let data = [] let data = []
for (let i in formName.value) { for (let i in form.value) {
data.push({ // form.value.map(item=>item.name)
supervisionId: id,
name: i, if (form.value[i].map(item => item.name).join(',') != '')
url: formName.value[i], data.push({
state: 1 supervisionId: id,
}) name: i,
url: form.value[i].map(item => item.name).join(','), //formName.value[i],
state: 1
})
} }
// for (let i in formName.value) {
// data.push({
// supervisionId: id,
// name: i,
// url: formName.value[i],
// state: 1
// })
// }
await addOrUpdateFile(data) await addOrUpdateFile(data)
} }
@@ -223,17 +231,18 @@ const queryFiles = (id: string) => {
}) })
} }
const getFileNamePath = async (val: any, pathName: any) => { const getFileNamePath = async (val: any, pathName: any) => {
await getFileNameAndFilePath({ filePath: val }).then(res => { let data = val.split(',')
form.value[pathName] = [ for (let i = 0; i < data.length ; i++) {
{ // console.log('🚀 ~ getFileNamePath ~ data:', data[i])
name: res.data.fileName,
url: res.data.url await getFileNameAndFilePath({ filePath: '/supervision/' + data[i] }).then(res => {
} res.data.name = res.data.fileName
] form.value[pathName].push(res.data)
setTimeout(() => { // setTimeout(() => {
formName.value[pathName] = res.data.fileName // formName.value[pathName] = res.data.fileName
}, 100) // }, 100)
}) })
}
} }
const reset = () => { const reset = () => {
form.value = { form.value = {
@@ -262,7 +271,7 @@ const reset = () => {
runTheReport: '' runTheReport: ''
} }
} }
defineExpose({ submitForm, queryFiles }) defineExpose({ submitForm, queryFiles ,reset})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-form-item__content > div:first-child { .el-form-item__content > div:first-child {

View File

@@ -345,34 +345,37 @@
</a> </a>
</div> </div>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="入网设计方案审查报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
<View @click="openFile(form.NetReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.NetReport[0]?.url">
{{ form.NetReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="治理工程验收报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
<View @click="openFile(form.governReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.governReport[0]?.url">
{{ form.governReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="信息安全检测报告" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="信息安全检测报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.informationSecurityTestReport[0]?.name">
<View @click="openFile(form.informationSecurityTestReport[0]?.name)" /> <View @click="openFile(form.informationSecurityTestReport[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.informationSecurityTestReport[0]?.url"> <a target="_blank" :href="form.informationSecurityTestReport[0]?.url">
{{ form.informationSecurityTestReport[0]?.name }} {{ form.informationSecurityTestReport[0]?.name }}
</a> </a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="入网设计方案审查报告" v-if="props.openType == 'sourcesOfInterference'">
<div v-for="item in form.NetReport">
<el-icon class="elView" v-if="item.name">
<View @click="openFile(item.name)" />
</el-icon>
<a target="_blank" :href="item.url">
{{ item.name }}
</a>
</div>
</el-descriptions-item>
<el-descriptions-item label="治理工程验收报告" v-if="props.openType == 'sourcesOfInterference'">
<div v-for="item in form.governReport">
<el-icon class="elView" v-if="item.name">
<View @click="openFile(item.name)" />
</el-icon>
<a target="_blank" :href="item.url">
{{ item.name }}
</a>
</div>
</el-descriptions-item>
<el-descriptions-item label="验收检验报告单" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="验收检验报告单" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.acceptanceInspectionReportSingle[0]?.name">
<View @click="openFile(form.acceptanceInspectionReportSingle[0]?.name)" /> <View @click="openFile(form.acceptanceInspectionReportSingle[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.acceptanceInspectionReportSingle[0]?.url"> <a target="_blank" :href="form.acceptanceInspectionReportSingle[0]?.url">
@@ -381,7 +384,7 @@
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="验收检验报告" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="验收检验报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.acceptanceInspectionReport[0]?.name">
<View @click="openFile(form.acceptanceInspectionReport[0]?.name)" /> <View @click="openFile(form.acceptanceInspectionReport[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.acceptanceInspectionReport[0]?.url"> <a target="_blank" :href="form.acceptanceInspectionReport[0]?.url">
@@ -389,7 +392,7 @@
</a> </a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="型式实验报告" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="型式实验报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.typeExperimentReport[0]?.name">
<View @click="openFile(form.typeExperimentReport[0]?.name)" /> <View @click="openFile(form.typeExperimentReport[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.typeExperimentReport[0]?.url"> <a target="_blank" :href="form.typeExperimentReport[0]?.url">
@@ -397,9 +400,8 @@
</a> </a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="出厂检验报告" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="出厂检验报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.factoryInspectionReport[0]?.name">
<View @click="openFile(form.factoryInspectionReport[0]?.name)" /> <View @click="openFile(form.factoryInspectionReport[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.factoryInspectionReport[0]?.url"> <a target="_blank" :href="form.factoryInspectionReport[0]?.url">
@@ -407,7 +409,7 @@
</a> </a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="性能检测报告" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="性能检测报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.performanceTestReport[0]?.name">
<View @click="openFile(form.performanceTestReport[0]?.name)" /> <View @click="openFile(form.performanceTestReport[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.performanceTestReport[0]?.url"> <a target="_blank" :href="form.performanceTestReport[0]?.url">
@@ -415,7 +417,7 @@
</a> </a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="主接线图" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="主接线图" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.mainWiringDiagram[0]?.name">
<View @click="openFile(form.mainWiringDiagram[0]?.name)" /> <View @click="openFile(form.mainWiringDiagram[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.mainWiringDiagram[0]?.url"> <a target="_blank" :href="form.mainWiringDiagram[0]?.url">
@@ -423,7 +425,7 @@
</a> </a>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="试运行报告" v-if="props.openType == 'sourcesOfInterference'"> <el-descriptions-item label="试运行报告" v-if="props.openType == 'sourcesOfInterference'">
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'"> <el-icon class="elView" v-if="form.runTheReport[0]?.name">
<View @click="openFile(form.runTheReport[0]?.name)" /> <View @click="openFile(form.runTheReport[0]?.name)" />
</el-icon> </el-icon>
<a target="_blank" :href="form.runTheReport[0]?.url"> <a target="_blank" :href="form.runTheReport[0]?.url">
@@ -631,7 +633,7 @@ const preview = (val: any, url: any) => {
}) })
} }
const queryFiles = (id: string) => { const queryFiles = () => {
getFileById({ id: props.id }).then(res => { getFileById({ id: props.id }).then(res => {
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
if (item.url.length > 0) getFileNamePaths(item.url, item.name) if (item.url.length > 0) getFileNamePaths(item.url, item.name)
@@ -815,14 +817,13 @@ const getFileNamePath = async (val: any, pathName: any) => {
}) })
} }
const getFileNamePaths = async (val: any, pathName: any) => { const getFileNamePaths = async (val: any, pathName: any) => {
await getFileNameAndFilePath({ filePath: val }).then(res => { let data = val.split(',')
form.value[pathName] = [ for (let i = 0; i < data.length; i++) {
{ await getFileNameAndFilePath({ filePath: '/supervision/' + data[i] }).then(res => {
name: res.data.fileName, res.data.name = res.data.fileName
url: res.data.url form.value[pathName].push(res.data)
} })
] }
})
} }
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗 defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗

View File

@@ -7,6 +7,7 @@
v-model="form.deviceId" v-model="form.deviceId"
:data="data" :data="data"
filterable filterable
:filter-node-method="filterNode"
style="width: 100%" style="width: 100%"
@change="changeDevStatus" @change="changeDevStatus"
clearable clearable
@@ -101,6 +102,40 @@ const resetForm = () => {
formRef.value.resetFields() formRef.value.resetFields()
} }
} }
const filterNode = (value: string, data: any, node: any) => {
if (!value) return true
if (data.label) {
return chooseNode(value, data, node)
}
}
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配则返回该节点以及其下的所有子节点如果参数是子节点则返回该节点的父节点。label是中文字符enlabel是英文字符.
const chooseNode = (value: string, data: any, node: any) => {
if (data.label.indexOf(value) !== -1) {
return true
}
const level = node.level
// 如果传入的节点本身就是一级节点就不用校验了
if (level === 1) {
return false
}
// 先取当前节点的父节点
let parentData = node.parent
// 遍历当前节点的父节点
let index = 0
while (index < level - 1) {
// 如果匹配到直接返回此处label值是中文字符enlabel是英文字符。判断匹配中英文过滤
if (parentData.data.label.indexOf(value) !== -1) {
return true
}
// 否则的话再往上一层做匹配
parentData = parentData.parent
index++
}
// 没匹配到返回false
return false
}
const open = async (text: string, tempData?: any) => { const open = async (text: string, tempData?: any) => {
title.value = text title.value = text
@@ -212,4 +247,7 @@ defineExpose({ open })
::v-deep .el-tree-node__children > div { ::v-deep .el-tree-node__children > div {
display: block !important; display: block !important;
} }
:deep(.el-select__input) {
width: 100% !important;
}
</style> </style>

View File

@@ -29,7 +29,7 @@
</TableHeader> </TableHeader>
<Table ref="tableRef" /> <Table ref="tableRef" />
<el-dialog title="详情" width="80%" v-model="dialogShow"> <el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo> <DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog> </el-dialog>
<!-- 批量导入 --> <!-- 批量导入 -->