联调案例库

This commit is contained in:
GGJ
2024-09-12 20:01:17 +08:00
parent 2b22943a1e
commit fe6bae1bdc
8 changed files with 1057 additions and 55 deletions

View File

@@ -38,3 +38,23 @@ export const updateAlgorithmLibrary = (data: any) => {
data data
}) })
} }
/**
* 案例库新增
*/
export const libcaseAdd = (data: any) => {
return createAxios({
url: '/supervision-boot/libcase/add',
method: 'POST',
data
})
}
/**
* 算法库删除
*/
export const libcaseBeleteyById = (data: any) => {
return createAxios({
url: '/supervision-boot/libcase/deleteyById',
method: 'GET',
params:data
})
}

View File

@@ -28,7 +28,7 @@
<!-- tag --> <!-- tag -->
<div v-if="field.render == 'tag' && fieldValue !== ''"> <div v-if="field.render == 'tag' && fieldValue !== ''">
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" :effect="field.effect || ''" size="small"> <el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" size="small">
{{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }} {{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}
</el-tag> </el-tag>
</div> </div>

View File

@@ -80,7 +80,7 @@ export default class TableStore {
) )
).then((res: any) => { ).then((res: any) => {
if (res.data) { if (res.data) {
this.table.data = res.data?.records || res.data this.table.data = res.data.records || res.data
this.table.total = res.data?.total || res.data.length || 0 this.table.total = res.data?.total || res.data.length || 0
} else { } else {
this.table.data = [] this.table.data = []

View File

@@ -97,8 +97,12 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.voltageOffset == '1' ? 'danger' : 'success'" :type="row.voltageOffset == '1' ? 'danger' : 'success'"
class="percentage" :class="row.voltageOffset == '1' ? 'percentage' : ''"
@click="detailClick(row, '电压偏差(%)', 'voltageOffsetList')" @click="
row.voltageOffset == '1'
? detailClick(row, '电压偏差(%)', 'voltageOffsetList')
: ''
"
> >
{{ row.voltageOffset == '1' ? '越限' : '合格' }} {{ row.voltageOffset == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -108,8 +112,10 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.vtimes == '1' ? 'danger' : 'success'" :type="row.vtimes == '1' ? 'danger' : 'success'"
class="percentage" :class="row.vtimes == '1' ? 'percentage' : ''"
@click="detailClick(row, '谐波电压(%)', 'vtimesList')" @click="
row.vtimes == '1' ? detailClick(row, '谐波电压(%)', 'vtimesList') : ''
"
> >
{{ row.vtimes == '1' ? '越限' : '合格' }} {{ row.vtimes == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -119,8 +125,10 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.itimes == '1' ? 'danger' : 'success'" :type="row.itimes == '1' ? 'danger' : 'success'"
class="percentage" :class="row.itimes == '1' ? 'percentage' : ''"
@click="detailClick(row, '谐波电流(A)', 'itimesList')" @click="
row.itimes == '1' ? detailClick(row, '谐波电流(A)', 'itimestList') : ''
"
> >
{{ row.itimes == '1' ? '越限' : '合格' }} {{ row.itimes == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -130,8 +138,12 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.ubalance == '1' ? 'danger' : 'success'" :type="row.ubalance == '1' ? 'danger' : 'success'"
class="percentage" :class="row.ubalance == '1' ? 'percentage' : ''"
@click="detailClick(row, '三相电压不平衡度(%)', 'ubalanceList')" @click="
row.ubalance == '1'
? detailClick(row, '三相电压不平衡度(%)', 'ubalanceList')
: ''
"
> >
{{ row.ubalance == '1' ? '越限' : '合格' }} {{ row.ubalance == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -141,8 +153,12 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.voltageFluctuation == '1' ? 'danger' : 'success'" :type="row.voltageFluctuation == '1' ? 'danger' : 'success'"
class="percentage" :class="row.voltageFluctuation == '1' ? 'percentage' : ''"
@click="detailClick(row, '电压波动(%)', 'voltageFluctuationList')" @click="
row.voltageFluctuation == '1'
? detailClick(row, '电压波动(%)', 'voltageFluctuationList')
: ''
"
> >
{{ row.voltageFluctuation == '1' ? '越限' : '合格' }} {{ row.voltageFluctuation == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -152,8 +168,10 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.flicker == '1' ? 'danger' : 'success'" :type="row.flicker == '1' ? 'danger' : 'success'"
class="percentage" :class="row.flicker == '1' ? 'percentage' : ''"
@click="detailClick(row, '长时闪变', 'flickerList')" @click="
row.flicker == '1' ? detailClick(row, '长时闪变', 'flickerList') : ''
"
> >
{{ row.flicker == '1' ? '越限' : '合格' }} {{ row.flicker == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -163,8 +181,12 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.interHarmonic == '1' ? 'danger' : 'success'" :type="row.interHarmonic == '1' ? 'danger' : 'success'"
class="percentage" :class="row.interHarmonic == '1' ? 'percentage' : ''"
@click="detailClick(row, '间谐波电压含有率(%)', 'interHarmonicList')" @click="
row.interHarmonic == '1'
? detailClick(row, '间谐波电压含有率(%)', 'interHarmonicList')
: ''
"
> >
{{ row.interHarmonic == '1' ? '越限' : '合格' }} {{ row.interHarmonic == '1' ? '越限' : '合格' }}
</el-link> </el-link>
@@ -174,8 +196,16 @@
<template #default="{ row }"> <template #default="{ row }">
<el-link <el-link
:type="row.sequenceCurrentUnbalance == '1' ? 'danger' : 'success'" :type="row.sequenceCurrentUnbalance == '1' ? 'danger' : 'success'"
class="percentage" :class="row.sequenceCurrentUnbalance == '1' ? 'percentage' : ''"
@click="detailClick(row, '电流不平衡度(%)', 'sequenceCurrentUnbalanceList')" @click="
row.sequenceCurrentUnbalance == '1'
? detailClick(
row,
'电流不平衡度(%)',
'sequenceCurrentUnbalanceList'
)
: ''
"
> >
{{ row.sequenceCurrentUnbalance == '1' ? '越限' : '合格' }} {{ row.sequenceCurrentUnbalance == '1' ? '越限' : '合格' }}
</el-link> </el-link>

View File

@@ -64,7 +64,7 @@
<template #default="{ row }"> <template #default="{ row }">
<el-button type="primary" link @click="edit(row)">修改</el-button> <el-button type="primary" link @click="edit(row)">修改</el-button>
<!-- <el-button type="danger" link @click="del(row)">删除</el-button> --> <!-- <el-button type="danger" link @click="del(row)">删除</el-button> -->
<el-popconfirm title="是否确认删除算法?" @confirm="del(row)"> <el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
<template #reference> <template #reference>
<el-button type="danger" link>删除</el-button> <el-button type="danger" link>删除</el-button>
</template> </template>

View File

@@ -2,25 +2,35 @@
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="1200px"> <el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="1200px">
<el-scrollbar> <el-scrollbar>
<el-form :inline="false" :model="form" class="form-two" label-width="auto" :rules="rules" ref="formRef"> <el-form :inline="false" :model="form" class="form-two" label-width="auto" :rules="rules" ref="formRef">
<el-form-item label="事件名称"> <el-form-item label="事件名称" prop="name">
<el-input v-model="form.name" placeholder="请输入事件名称" /> <el-input v-model="form.name" placeholder="请输入事件名称" />
</el-form-item> </el-form-item>
<el-form-item label="发生事件"> <el-form-item label="发生事件" prop="type">
<el-input v-model="form.type" placeholder="请输入发生事件" />
</el-form-item>
<el-form-item label="发生地点">
<el-input v-model="form.location" placeholder="请输入发生地点" />
</el-form-item>
<el-form-item label="事件经过">
<el-input <el-input
v-model="form.process" v-model="form.type"
placeholder="请输入事件经过" placeholder="请输入治理效果"
:autosize="{ minRows: 2, maxRows: 4 }" :autosize="{ minRows: 2, maxRows: 4 }"
type="textarea" type="textarea"
/> />
</el-form-item> </el-form-item>
<el-form-item label="处理措施"> <el-form-item label="发生地点" prop="location">
<el-input
v-model="form.location"
placeholder="请输入治理效果"
:autosize="{ minRows: 2, maxRows: 4 }"
type="textarea"
/>
</el-form-item>
<el-form-item label="事件经过" prop="process">
<el-input
v-model="form.process"
placeholder="请输入治理效果"
:autosize="{ minRows: 2, maxRows: 4 }"
type="textarea"
/>
</el-form-item>
<el-form-item label="处理措施" prop="measures">
<el-input <el-input
v-model="form.measures" v-model="form.measures"
placeholder="请输入处理措施" placeholder="请输入处理措施"
@@ -28,7 +38,7 @@
type="textarea" type="textarea"
/> />
</el-form-item> </el-form-item>
<el-form-item label="治理效果"> <el-form-item label="治理效果" prop="effect">
<el-input <el-input
v-model="form.effect" v-model="form.effect"
placeholder="请输入治理效果" placeholder="请输入治理效果"
@@ -37,8 +47,8 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">
<el-upload v-model:file-list="fileList" action="" multiple :limit="3" :on-exceed="handleExceed"> <el-upload v-model:file-list="fileList" action="" :auto-upload="false" multiple>
<el-button type="primary">添加附件</el-button> <el-button type="primary">上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -62,11 +72,13 @@ import { reactive } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除 import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
import editor from '@/components/wangEditor/index.vue' import editor from '@/components/wangEditor/index.vue'
import { uploadFile, getFileNameAndFilePath } from '@/api/system-boot/file'
import { libcaseAdd } from '@/api/supervision-boot/database/index'
const emit = defineEmits(['onSubmit'])
const dialogVisible = ref(false) const dialogVisible = ref(false)
const title = ref('') const title = ref('')
const tableStore = inject('tableStore') as TableStore
const formRef = ref() const formRef = ref()
const fileList = ref([]) const fileList: any = ref([])
// 注意不要和表单ref的命名冲突 // 注意不要和表单ref的命名冲突
const form = reactive<anyObj>({ const form = reactive<anyObj>({
type: '', type: '',
@@ -75,24 +87,36 @@ const form = reactive<anyObj>({
process: '', process: '',
measures: '', measures: '',
effect: '', effect: '',
id: '' url: ''
}) })
const rules = { const rules = {
name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }],
code: [{ required: true, message: '角色编码不能为空', trigger: 'blur' }] type: [{ required: true, message: '角色编码不能为空', trigger: 'blur' }],
location: [{ required: true, message: '角色编码不能为空', trigger: 'blur' }],
process: [{ required: true, message: '角色编码不能为空', trigger: 'blur' }],
measures: [{ required: true, message: '角色编码不能为空', trigger: 'blur' }],
effect: [{ required: true, message: '角色编码不能为空', trigger: 'blur' }]
} }
const handleExceed = (files: any, uploadFiles: any) => {}
const open = (text: string, data?: anyObj) => { const open = (text: string, data?: anyObj) => {
title.value = text title.value = text
dialogVisible.value = true dialogVisible.value = true
if (data) { if (data) {
fileList.value = []
// 表单赋值 // 表单赋值
for (let key in form) { for (let key in form) {
form[key] = data[key] form[key] = data[key]
} }
data.url.split(',').forEach((item: string) => {
console.log('🚀 ~ data.url.split ~ item:', item)
getFileNameAndFilePath({ filePath: item }).then(res => {
fileList.value.push({
name: res.data.fileName,
url: res.data.name
})
})
})
} else { } else {
// 在此处恢复默认表单 // 在此处恢复默认表单
for (let key in form) { for (let key in form) {
@@ -101,25 +125,55 @@ const open = (text: string, data?: anyObj) => {
} }
} }
const submit = () => { const submit = () => {
console.log(`1111`, form.summary) console.log(`1111`, fileList.value)
formRef.value.validate(async (valid: boolean) => { formRef.value.validate(async (valid: boolean) => {
if (valid) { if (valid) {
if (form.id) { if (fileList.value.length > 0) {
// await update(form) const promises = fileList.value.map(async item => {
} else { return new Promise((resolve, reject) => {
// await create(form) uploadFile(item.raw, '/supervision/')
.then((res: any) => {
resolve(res.data.name)
})
.catch(reject)
})
})
try {
const fileNames = await Promise.all(promises)
form.url = fileNames.join(',') + ''
} catch (error) {
console.error('上传文件出错', error)
return
}
} }
ElMessage.success('保存成功')
tableStore.index() setTimeout(() => {
dialogVisible.value = false if (title.value === '新增案例') {
console.log('🚀 ~ libcaseAdd ~ form:', form)
libcaseAdd(form).then(res => {
handleClose()
})
} else {
// 其他逻辑
}
}, 100)
} }
}) })
} }
// 事件简介
const quit = () => { const handleClose = () => {
tableStore.index() ElMessage.success(title.value + '成功!')
emit('onSubmit')
dialogVisible.value = false
} }
defineExpose({ open }) defineExpose({ open })
</script> </script>
<style lang="scss" scoped>
:deep(.el-upload-list__item-info) {
width: 300px !important;
}
</style>

View File

@@ -8,7 +8,7 @@
</TableHeader> </TableHeader>
<Table ref="tableRef"></Table> <Table ref="tableRef"></Table>
<!-- 弹框 --> <!-- 弹框 -->
<PopupEdit ref="popupEditRef" /> <PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -17,6 +17,8 @@ import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import PopupEdit from './components/form.vue' import PopupEdit from './components/form.vue'
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
import { ElMessage } from 'element-plus'
defineOptions({ defineOptions({
name: 'database/case' name: 'database/case'
}) })
@@ -53,11 +55,46 @@ const tableStore = new TableStore({
{ {
title: '治理效果', title: '治理效果',
field: 'effect' field: 'effect'
},
{
title: '操作',
width: '140',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '修改',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
popupEditRef.value.open('修改案例', row)
}
},
{
name: 'delete',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
libcaseBeleteyById({ id: row.id }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
} }
], ],
loadCallback: () => { loadCallback: () => {}
}
}) })
// 弹框 // 弹框

View File

@@ -0,0 +1,861 @@
<template>
<div class="default-main">
<el-descriptions :column="2" border>
<el-descriptions-item label="填报人">
{{ detailData.reporter }}
</el-descriptions-item>
<el-descriptions-item label="填报日期">
{{ formatDate(detailData.reportDate, 'YYYY-MM-DD') }}
</el-descriptions-item>
<el-descriptions-item label="填报部门">
{{ detailData.orgName }}
</el-descriptions-item>
<el-descriptions-item label="工程预期投产日期">
{{ formatDate(detailData.expectedProductionDate, 'YYYY-MM-DD') }}
</el-descriptions-item>
<el-descriptions-item label="用户性质">
{{
userTypeList.find(item => {
return item.value == detailData.userType
})?.label
}}
</el-descriptions-item>
<el-descriptions-item label="所在地市">
{{ detailData.city }}
</el-descriptions-item>
<el-descriptions-item label="归口管理部门">
{{ detailData.responsibleDepartment }}
</el-descriptions-item>
<el-descriptions-item label="用户状态">
{{
userStateList.find(item => {
return item.value == detailData.userStatus
})?.label
}}
</el-descriptions-item>
<el-descriptions-item label="厂站名称">
{{ detailData.substation }}
</el-descriptions-item>
<el-descriptions-item label="项目名称">
{{ detailData.projectName }}
</el-descriptions-item>
<el-descriptions-item label="电压等级">
{{
voltageLevelList.find(item => {
return item.id == detailData.voltageLevel
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="非线性终端类型" v-if="detailData.userType == 0 || detailData.userType == 1">
{{ proviteData.nonlinearDeviceType ? proviteData.nonlinearDeviceType : '-' }}
</el-descriptions-item>
<el-descriptions-item label="预测评估单位">
{{ detailData.evaluationDept }}
</el-descriptions-item>
<el-descriptions-item label="预测评估结论" :span="2">
{{ detailData.evaluationConclusion }}
</el-descriptions-item>
<el-descriptions-item
:label="
detailData.userType == '4' || detailData.userType == '5' ? '非线性设备类型: ' : '非线性负荷类型:'
"
v-if="
detailData.userType == '2' ||
detailData.userType == '3' ||
detailData.userType == '4' ||
detailData.userType == '5'
"
>
{{ proviteData.nonlinearLoadType }}
</el-descriptions-item>
<el-descriptions-item label="是否需要治理">
<span v-if="detailData.userType == 0 || detailData.userType == 1">
{{ proviteData.needGovernance == 0 ? '否' : '是' }}
</span>
<span
v-if="
detailData.userType == 2 ||
detailData.userType == 3 ||
detailData.userType == 4 ||
detailData.userType == 5
"
>
{{ proviteData.needGovernance == 0 ? '否' : '是' }}
</span>
<span v-if="detailData.userType == 6">{{ proviteData.needGovernance == 0 ? '否' : '是' }}</span>
</el-descriptions-item>
<el-descriptions-item label="是否开展背景测试">
<span v-if="detailData.userType == 0 || detailData.userType == 1">
{{ proviteData.backgroundTestPerformed == 0 ? '否' : '是' }}
</span>
<span
v-if="
detailData.userType == 2 ||
detailData.userType == 3 ||
detailData.userType == 4 ||
detailData.userType == 5
"
>
{{ proviteData.backgroundTestPerformed == 0 ? '否' : '是' }}
</span>
<span v-if="detailData.userType == 6">
{{ proviteData.backgroundTestPerformed == 0 ? '否' : '是' }}
</span>
</el-descriptions-item>
<el-descriptions-item label="关联终端" v-if="props.openType != 'create'">
<span>
{{ devIdList[0]?.devName }}
</span>
</el-descriptions-item>
<el-descriptions-item label="关联监测点" v-if="props.openType != 'create'">
<span>
<!-- {{ detailData?.lineId }} -->
{{ devIdList[0]?.lineList.filter(item => item.lineId == detailData?.lineId)[0].lineName }}
</span>
</el-descriptions-item>
<el-descriptions-item label="是否开展抗扰度测试" v-if="detailData.userType == 6">
<span>
{{ proviteData.antiInterferenceTest == 0 ? '否' : '是' }}
</span>
</el-descriptions-item>
<el-descriptions-item
label="用户协议容量MVA"
v-if="detailData.userType == 0 || detailData.userType == 1"
>
{{ proviteData.agreementCapacity }}
</el-descriptions-item>
<el-descriptions-item
label="PCC供电终端容量MVA"
v-if="
detailData.userType == '2' ||
detailData.userType == '3' ||
detailData.userType == '4' ||
detailData.userType == '5'
"
>
{{ proviteData.pccEquipmentCapacity }}
</el-descriptions-item>
<el-descriptions-item
label="基准短路容量MVA"
v-if="
detailData.userType == '2' ||
detailData.userType == '3' ||
detailData.userType == '4' ||
detailData.userType == '5'
"
>
{{ proviteData.baseShortCircuitCapacity }}
</el-descriptions-item>
<el-descriptions-item
label="系统最小短路容量MVA"
v-if="
detailData.userType == '2' ||
detailData.userType == '3' ||
detailData.userType == '4' ||
detailData.userType == '5'
"
>
{{ proviteData?.minShortCircuitCapacity }}
</el-descriptions-item>
<el-descriptions-item
label="用户用电协议容量MVA"
v-if="
detailData.userType == '2' ||
detailData.userType == '3' ||
detailData.userType == '4' ||
detailData.userType == '5'
"
>
{{ proviteData?.userAgreementCapacity }}
</el-descriptions-item>
<el-descriptions-item label="PCC点" v-if="detailData.userType != 0 && detailData.userType != 1">
{{ proviteData?.pccPoint }}
</el-descriptions-item>
<el-descriptions-item label="评估类型" v-if="detailData.userType != 0 && detailData.userType != 1">
{{
evaluationTypeList.find(item => {
return item.id == proviteData?.evaluationType
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="预测评估评审单位" v-if="detailData.userType != 0 && detailData.userType != 1">
{{ proviteData?.evaluationChekDept }}
</el-descriptions-item>
<el-descriptions-item label="行业" v-if="detailData.userType == 6">
{{
industryList.find(item => {
return item.id == proviteData.industry
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="敏感终端名称" v-if="detailData.userType == 6">
{{ proviteData.deviceName }}
</el-descriptions-item>
<!-- <el-descriptions-item label="供电电源数量" v-if="detailData.userType == 6">-->
<!-- {{ proviteData.powerSupplyCount }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="供电电源情况" v-if="detailData.userType == 6">
{{
powerSupplyInfoOptionList.find(item => {
return item.id == proviteData.powerSupplyInfo
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="供电电源" :span="2" v-if="detailData.userType == 6">
{{ proviteData.powerSupply }}
</el-descriptions-item>
<el-descriptions-item label="负荷级别" v-if="detailData.userType == 6">
{{
loadLevelOptionList.find(item => {
return item.id == proviteData.loadLevel
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="敏感电能质量指标" v-if="detailData.userType == 6">
{{
energyQualityIndexList.find(item => {
return item.id == proviteData.energyQualityIndex
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="可研报告">
<span v-if="detailData.userType == 0 || detailData.userType == 1">
<el-icon class="elView" v-if="proviteData?.feasibilityReport?.name">
<View @click="openFile(proviteData?.feasibilityReport?.name)" />
</el-icon>
<a target="_blank" :href="proviteData.feasibilityReport?.url" rel="nofollow">
{{ proviteData.feasibilityReport?.name }}
</a>
</span>
<span
v-if="
detailData.userType == 2 ||
detailData.userType == 3 ||
detailData.userType == 4 ||
detailData.userType == 5
"
>
<el-icon class="elView" v-if="proviteData?.feasibilityReport?.name">
<View @click="openFile(proviteData?.feasibilityReport?.name)" />
</el-icon>
<a target="_blank" :href="proviteData.feasibilityReport?.url">
{{ proviteData.feasibilityReport?.name }}
</a>
</span>
<span v-if="detailData.userType == 6">
<el-icon class="elView" v-if="proviteData?.feasibilityReport?.name">
<View @click="openFile(proviteData?.feasibilityReport?.name)" />
</el-icon>
<a target="_blank" :href="proviteData.feasibilityReport?.url">
{{ proviteData.feasibilityReport?.name }}
</a>
</span>
</el-descriptions-item>
<el-descriptions-item label="项目初步设计说明书">
<el-icon class="elView" v-if="proviteData?.preliminaryDesignDescription?.name">
<View @click="openFile(proviteData?.preliminaryDesignDescription?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.preliminaryDesignDescription?.url">
{{ proviteData?.preliminaryDesignDescription?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="预测评估报告">
<el-icon class="elView" v-if="proviteData?.predictionEvaluationReport?.name">
<View @click="openFile(proviteData?.predictionEvaluationReport?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.predictionEvaluationReport?.url">
{{ proviteData?.predictionEvaluationReport?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="预测评估评审意见报告">
<el-icon class="elView" v-if="proviteData?.predictionEvaluationReviewOpinions?.name">
<View @click="openFile(proviteData?.predictionEvaluationReviewOpinions?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.predictionEvaluationReviewOpinions?.url">
{{ proviteData?.predictionEvaluationReviewOpinions?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item
label="用户接入变电站主接线示意图"
v-if="detailData.userType != 0 && detailData.userType != 1"
>
<el-icon class="elView" v-if="proviteData?.substationMainWiringDiagram?.name">
<View @click="openFile(proviteData?.substationMainWiringDiagram?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.substationMainWiringDiagram?.url">
{{ proviteData?.substationMainWiringDiagram?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="主要敏感终端清单" v-if="detailData.userType == 6">
<el-icon class="elView" v-if="proviteData?.sensitiveDevices?.name">
<View @click="openFile(proviteData?.sensitiveDevices?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.sensitiveDevices?.url">
{{ proviteData?.sensitiveDevices?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="抗扰度测试报告" v-if="detailData.userType == 6">
<el-icon class="elView" v-if="proviteData?.antiInterferenceReport?.name">
<View @click="openFile(proviteData?.antiInterferenceReport?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.antiInterferenceReport?.url">
{{ proviteData?.antiInterferenceReport?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="背景电能质量测试报告" v-if="detailData.userType == 6">
<el-icon class="elView" v-if="proviteData?.powerQualityReport?.name">
<View @click="openFile(proviteData?.powerQualityReport?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.powerQualityReport?.url">
{{ proviteData?.powerQualityReport?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item
label="其他附件"
v-if="proviteData?.additionalAttachments && proviteData?.additionalAttachments?.url"
>
<el-icon class="elView" v-if="proviteData?.additionalAttachments?.name">
<View @click="openFile(proviteData?.additionalAttachments?.name)" />
</el-icon>
<a target="_blank" :href="proviteData?.additionalAttachments?.url">
{{ proviteData?.additionalAttachments?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="入网评估报告">
<div v-for="item in netInReportList">
<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="治理评估报告">
<div v-for="item in governReportList">
<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="信息安全检测报告" >
<el-icon class="elView" v-if="form.informationSecurityTestReport[0]?.name">
<View @click="openFile(form.informationSecurityTestReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.informationSecurityTestReport[0]?.url">
{{ form.informationSecurityTestReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="入网设计方案审查报告" >
<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="治理工程验收报告" >
<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="验收检验报告单" >
<el-icon class="elView" v-if="form.acceptanceInspectionReportSingle[0]?.name">
<View @click="openFile(form.acceptanceInspectionReportSingle[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.acceptanceInspectionReportSingle[0]?.url">
{{ form.acceptanceInspectionReportSingle[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="验收检验报告" >
<el-icon class="elView" v-if="form.acceptanceInspectionReport[0]?.name">
<View @click="openFile(form.acceptanceInspectionReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.acceptanceInspectionReport[0]?.url">
{{ form.acceptanceInspectionReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="型式实验报告" >
<el-icon class="elView" v-if="form.typeExperimentReport[0]?.name">
<View @click="openFile(form.typeExperimentReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.typeExperimentReport[0]?.url">
{{ form.typeExperimentReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="出厂检验报告" >
<el-icon class="elView" v-if="form.factoryInspectionReport[0]?.name">
<View @click="openFile(form.factoryInspectionReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.factoryInspectionReport[0]?.url">
{{ form.factoryInspectionReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="性能检测报告" >
<el-icon class="elView" v-if="form.performanceTestReport[0]?.name">
<View @click="openFile(form.performanceTestReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.performanceTestReport[0]?.url">
{{ form.performanceTestReport[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="主接线图" >
<el-icon class="elView" v-if="form.mainWiringDiagram[0]?.name">
<View @click="openFile(form.mainWiringDiagram[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.mainWiringDiagram[0]?.url">
{{ form.mainWiringDiagram[0]?.name }}
</a>
</el-descriptions-item>
<el-descriptions-item label="试运行报告" >
<el-icon class="elView" v-if="form.runTheReport[0]?.name">
<View @click="openFile(form.runTheReport[0]?.name)" />
</el-icon>
<a target="_blank" :href="form.runTheReport[0]?.url">
{{ form.runTheReport[0]?.name }}
</a>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, reactive, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { formatDate } from '@/utils/formatTime'
import { propTypes } from '@/utils/propTypes'
import { getUserReportById, getUserReportUpdateById } from '@/api/supervision-boot/userReport/form'
import { getDictTreeById } from '@/api/system-boot/dictTree'
import { useDictData } from '@/stores/dictData'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
import { Link, View } from '@element-plus/icons-vue'
import PreviewFile from '@/components/PreviewFile/index.vue'
import { getByDeptDevLine } from '@/api/supervision-boot/interfere/index'
import { addOrUpdateFile, getFileById } from '@/api/supervision-boot/interfere/index'
defineOptions({ name: 'BpmUserReportDetail' })
const { query } = useRoute() // 查询参数
const props = defineProps({
id: propTypes.string.def(undefined),
update: {
type: Boolean,
default: false
},
openType: {
type: String,
default: 'create'
}
})
const detailLoading = ref(false) // 表单的加载中
const detailData = ref<any>({}) // 详情数据
const devIdList = ref([])
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号
const openFile = (name: any) => {
window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
}
const netInReportList: any = ref([])
const governReportList: any = ref([])
//用户性质数组
const userTypeList = reactive([
{
label: '新建电网工程',
value: '0'
},
{
label: '扩建电网工程',
value: '1'
},
{
label: '新建非线性负荷用户',
value: '2'
},
{
label: '扩建非线性负荷用户',
value: '3'
},
{
label: '新建新能源发电站',
value: '4'
},
{
label: '扩建新能源发电站',
value: '5'
},
{
label: '敏感及重要用户',
value: '6'
}
])
//用户状态数组
const userStateList = reactive([
{
label: '可研',
value: '0'
},
{
label: '建设',
value: '1'
},
{
label: '运行',
value: '2'
},
{
label: '退运',
value: '3'
}
])
const form: any = ref({
NetReport: [], //入网设计方案审查报告:
governReport: [], //治理工程验收报告
informationSecurityTestReport: [], //信息安全检测报告
acceptanceInspectionReportSingle: [], //信息安全检测报告
acceptanceInspectionReport: [], //验收检验报告:
typeExperimentReport: [], //型式实验报告
factoryInspectionReport: [], //出厂检验报告:
performanceTestReport: [], //性能检测报告
mainWiringDiagram: [], //主接线图:
runTheReport: [] //试运行报告
})
const dictData = useDictData()
//字典获取所在地市
const areaOptionList = dictData.getBasicData('jibei_area')
//字典获取敏感电能质量指标
const energyQualityIndexList = dictData.getBasicData('Indicator_Type')
//字典获取行业类型
const industryList = dictData.getBasicData('industry_type_jb')
//字典电压等级
const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
//字典评估类型
const evaluationTypeList = dictData.getBasicData('Evaluation_Type')
//字典预测评估单位
const evaluationDeptList = dictData.getBasicData('evaluation_dept')
const loadLevelOptionList = dictData.getBasicData('load_level')
const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
/** 获得数据 */
const getInfo = async () => {
detailLoading.value = true
try {
if (props.update) {
await getUserReportUpdateById(props.id || queryId).then(res => {
detailData.value = res.data.userReportMessageJson
getProviteData()
})
} else {
await getUserReportById(props.id || queryId).then(res => {
detailData.value = res.data
getProviteData()
})
}
} finally {
detailLoading.value = false
}
if (props.openType == 'sourcesOfInterference') {
queryFiles()
}
}
const proviteData = ref()
//可研报告
const feasibilityReportRef: any = ref(null)
//项目初步设计说明书
const preliminaryDesignDescriptionRef: any = ref(null)
//预测评估报告
const predictionEvaluationReportRef: any = ref(null)
//预测评估评审意见报告
const predictionEvaluationReviewOpinionsRef: any = ref(null)
//用户接入变电站主接线示意图
const substationMainWiringDiagramRef: any = ref(null)
//主要敏感终端清单
const sensitiveDevicesRef: any = ref(null)
//抗扰度测试报告
const antiInterferenceReportRef: any = ref(null)
//背景电能质量测试报告
const powerQualityReportRef: any = ref(null)
//其他附件
const additionalAttachmentsRef: any = ref(null)
//预览
const preview = (val: any, url: any) => {
nextTick(() => {
//可研报告
if (val == 'feasibilityReport') {
feasibilityReportRef?.value.open(url)
}
//项目初步设计说明书
if (val == 'preliminaryDesignDescription') {
preliminaryDesignDescriptionRef?.value.open(url)
}
//预测评估报告
if (val == 'predictionEvaluationReport') {
console.log(url, '9999999')
predictionEvaluationReportRef?.value.open(url)
}
//预测评估评审意见报告
if (val == 'predictionEvaluationReviewOpinions') {
predictionEvaluationReviewOpinionsRef?.value.open(url)
}
//用户接入变电站主接线示意图
if (val == 'substationMainWiringDiagram') {
substationMainWiringDiagramRef?.value.open(url)
}
//主要敏感终端清单
if (val == 'sensitiveDevices') {
sensitiveDevicesRef?.value.open(url)
}
//抗扰度测试报告
if (val == 'antiInterferenceReport') {
antiInterferenceReportRef?.value.open(url)
}
//背景电能质量测试报告
if (val == 'powerQualityReport') {
powerQualityReportRef?.value.open(url)
}
//其他附件
if (val == 'additionalAttachments') {
additionalAttachmentsRef?.value.open(url)
}
})
}
const queryFiles = () => {
getFileById({ id: props.id }).then(res => {
res.data.forEach((item: any) => {
if (item.url.length > 0) getFileNamePaths(item.url, item.name)
})
})
}
//判断userType选择取用的对象
const getProviteData = async () => {
if (detailData.value.userType == '0' || detailData.value.userType == '1') {
proviteData.value = detailData.value.userReportProjectPO
//查询非线性终端类型
await getDictTreeById(proviteData.value.nonlinearDeviceType).then(res => {
proviteData.value.nonlinearDeviceType = res.data?.name
})
} else if (
detailData.value.userType == '2' ||
detailData.value.userType == '3' ||
detailData.value.userType == '4' ||
detailData.value.userType == '5'
) {
proviteData.value = detailData.value.userReportSubstationPO
//查询非线性负荷类型
await getDictTreeById(proviteData.value.nonlinearLoadType).then(res => {
proviteData.value.nonlinearLoadType = res.data?.name
})
} else {
proviteData.value = detailData.value.userReportSensitivePO
}
//可研报告
if (proviteData.value.feasibilityReport) {
await getFileNamePath(proviteData.value.feasibilityReport, 'feasibilityReport')
}
//项目初步设计说明书
if (proviteData.value.preliminaryDesignDescription) {
await getFileNamePath(proviteData.value.preliminaryDesignDescription, 'preliminaryDesignDescription')
}
//预测评估报告
if (proviteData.value.predictionEvaluationReport) {
await getFileNamePath(proviteData.value.predictionEvaluationReport, 'predictionEvaluationReport')
}
//预测评估评审意见报告
if (proviteData.value.predictionEvaluationReviewOpinions) {
await getFileNamePath(
proviteData.value.predictionEvaluationReviewOpinions,
'predictionEvaluationReviewOpinions'
)
}
//用户接入变电站主接线示意图
if (proviteData.value.substationMainWiringDiagram) {
await getFileNamePath(proviteData.value.substationMainWiringDiagram, 'substationMainWiringDiagram')
}
//主要敏感终端清单
if (proviteData.value.sensitiveDevices) {
await getFileNamePath(proviteData.value.sensitiveDevices, 'sensitiveDevices')
}
//抗扰度测试报告
if (proviteData.value.antiInterferenceReport) {
await getFileNamePath(proviteData.value.antiInterferenceReport, 'antiInterferenceReport')
}
//背景电能质量测试报告
if (proviteData.value.powerQualityReport) {
await getFileNamePath(proviteData.value.powerQualityReport, 'powerQualityReport')
}
//其他附件
if (proviteData.value.additionalAttachments) {
getFileNamePath(proviteData.value.additionalAttachments, 'additionalAttachments')
}
// 入网评估报告
if (detailData.value.netInReport.length > 0) {
netInReportList.value = []
detailData.value.netInReport.forEach((item: any) => {
if (item != null) {
getFileNamePath(item, 'netInReport')
}
})
}
// 治理评估告"
if (detailData.value.governReport.length > 0) {
governReportList.value = []
detailData.value.governReport.forEach((item: any) => {
if (item != null) {
getFileNamePath(item, 'governReport')
}
})
}
// 调用关联终端接口
getByDeptDevLine({ id: detailData.value.orgId }).then(res => {
devIdList.value = res.data.filter((item: any) => item.devId == detailData.value.devId)
})
}
//根据文件名请求
const getFileNamePath = async (val: any, pathName: any) => {
await getFileNameAndFilePath({ filePath: val }).then(res => {
if (res.data && res.data.name && res.data.url) {
//可研报告
if (pathName == 'feasibilityReport' && proviteData.value.feasibilityReport) {
proviteData.value.feasibilityReport = {
name: res.data.fileName,
url: res.data.url
}
}
//项目初步设计说明书
else if (pathName == 'preliminaryDesignDescription' && proviteData.value.preliminaryDesignDescription) {
proviteData.value.preliminaryDesignDescription = {
name: res.data.fileName,
url: res.data.url
}
}
//预测评估报告
else if (pathName == 'predictionEvaluationReport' && proviteData.value.predictionEvaluationReport) {
proviteData.value.predictionEvaluationReport = {
name: res.data.fileName,
url: res.data.url
}
}
//预测评估评审意见报告
else if (
pathName == 'predictionEvaluationReviewOpinions' &&
proviteData.value.predictionEvaluationReviewOpinions
) {
proviteData.value.predictionEvaluationReviewOpinions = {
name: res.data.fileName,
url: res.data.url
}
}
//用户接入变电站主接线示意图
else if (pathName == 'substationMainWiringDiagram' && proviteData.value.substationMainWiringDiagram) {
proviteData.value.substationMainWiringDiagram = {
name: res.data.fileName,
url: res.data.url
}
}
//主要敏感终端清单
else if (pathName == 'sensitiveDevices' && proviteData.value.sensitiveDevices) {
proviteData.value.sensitiveDevices = {
name: res.data.fileName,
url: res.data.url
}
}
//抗扰度测试报告
else if (pathName == 'antiInterferenceReport' && proviteData.value.antiInterferenceReport) {
proviteData.value.antiInterferenceReport = {
name: res.data.fileName,
url: res.data.url
}
}
//背景电能质量测试报告
else if (pathName == 'powerQualityReport' && proviteData.value.powerQualityReport) {
proviteData.value.powerQualityReport = {
name: res.data.fileName,
url: res.data.url
}
}
//其他附件
else if (pathName == 'additionalAttachments' && proviteData.value.additionalAttachments) {
proviteData.value.additionalAttachments = {
name: res.data.fileName,
url: res.data.url
}
}
if (pathName == 'netInReport') {
netInReportList.value.push({
name: res.data.fileName,
url: res.data.url
})
} else if (pathName == 'governReport') {
governReportList.value.push({
name: res.data.fileName,
url: res.data.url
})
}
}
})
}
const getFileNamePaths = async (val: any, pathName: any) => {
let data = val.split(',')
for (let i = 0; i < data.length; i++) {
await getFileNameAndFilePath({ filePath: '/supervision/' + data[i] }).then(res => {
res.data.name = res.data.fileName
form.value[pathName].push(res.data)
})
}
}
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
watch(
() => props.id,
(val, oldVal) => {
val && getInfo()
}
)
/** 初始化 **/
onMounted(() => {
getInfo()
})
</script>
<style lang="scss">
::v-deep.el-icon svg {
// margin: 5px !important;
// position: absolute !important;
// top: 20px !important;
// float: right;
}
// .el-icon {
// float: left;
// }
// a {
// display: block;
// width: 200px;
// float: right;
// }
.elView {
cursor: pointer;
margin-right: 10px;
}
</style>