修改 冀北 现场问题

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
})
}
//查询新能源场站
export function selectDown() {
return createAxios({
url: '/device-boot/newStation/selectDown',
method: 'get'
})
}

View File

@@ -3,7 +3,7 @@
<TableHeader ref="TableHeaderRef">
<template #select>
<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>
</template>
<template #operation>
@@ -25,7 +25,9 @@ import addForm from './components/addForm.vue'
import { useDictData } from '@/stores/dictData'
import { useAdminInfo } from '@/stores/adminInfo'
import { delNewStation } from '@/api/device-boot/newEnergy'
defineOptions({
name: 'newEnergy/newEnergyLedger'
})
const dictData = useDictData()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
@@ -109,7 +111,7 @@ const tableStore = new TableStore({
},
loadCallback: () => {}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.name = ''
const add = () => {
addFormRef.value.open({
title: '新增'

View File

@@ -935,6 +935,22 @@
</el-select>
</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-input
v-model="lineItem.standardCapacity"
@@ -1424,7 +1440,14 @@ import { LocationInformation } from '@element-plus/icons-vue'
import Terminal from '@/components/tree/pqs/Terminal.vue'
import { mainHeight } from '@/utils/layout'
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 { ref, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
@@ -1565,6 +1588,7 @@ const monitorPointDetail: any = ref({
devCapacity: '',
/**短路容量 */
shortCapacity: '',
newStationId: '',
/**基准容量 */
standardCapacity: '',
/**监测点id */
@@ -1702,6 +1726,7 @@ const deviceBODetail: any = ref({
/**供电公司 */
gdName: currentGdName.value
})
const newStationIdArr: any = ref([])
const treeClickCount = ref(0)
const project = ref([
{ name: '在线项目', value: '在线项目' },
@@ -1726,6 +1751,9 @@ const arrdess: any = ref((rule: any, value: any, callback: any) => {
callback(new Error('请输入正确IP/MAC地址'))
}
})
selectDown().then(res => {
newStationIdArr.value = res.data
})
/**经度 */
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})?/

View File

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

View File

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

View File

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

View File

@@ -1,35 +1,4 @@
<template>
<el-form-item label="入网设计方案审查报告:">
<el-upload
v-model:file-list="form.NetReport"
ref="NetReportRef"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'NetReport')"
:auto-upload="false"
:before-remove="beforeRemove('NetReport', '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.governReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'governReport')"
:auto-upload="false"
: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"
@@ -45,6 +14,36 @@
</template>
</el-upload>
</el-form-item>
<el-form-item label="入网设计方案审查报告:">
<el-upload
v-model:file-list="form.NetReport"
ref="NetReportRef"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
@change="choose($event, 'NetReport')"
:auto-upload="false"
:before-remove="beforeRemove('NetReport', '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.governReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
@change="choose($event, 'governReport')"
:auto-upload="false"
: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.acceptanceInspectionReportSingle"
@@ -185,10 +184,8 @@ const formName: any = ref({
})
const beforeRemove = (name: any, flag?: string) => {
console.log('🚀 ~ beforeRemove ~ flag:', flag)
// console.log('🚀 ~ beforeRemove ~ flag:', flag)
if (flag == '1') {
console.log('🚀 ~ beforeRemove ~ name:', name)
formName.value[name] = ''
}
}
@@ -203,14 +200,25 @@ const submitForm = async (id: string) => {
// console.log(form.value)
let data = []
for (let i in formName.value) {
for (let i in form.value) {
// form.value.map(item=>item.name)
if (form.value[i].map(item => item.name).join(',') != '')
data.push({
supervisionId: id,
name: i,
url: formName.value[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)
}
@@ -223,18 +231,19 @@ const queryFiles = (id: string) => {
})
}
const getFileNamePath = async (val: any, pathName: any) => {
await getFileNameAndFilePath({ filePath: val }).then(res => {
form.value[pathName] = [
{
name: res.data.fileName,
url: res.data.url
}
]
setTimeout(() => {
formName.value[pathName] = res.data.fileName
}, 100)
let data = val.split(',')
for (let i = 0; i < data.length ; i++) {
// console.log('🚀 ~ getFileNamePath ~ data:', data[i])
await getFileNameAndFilePath({ filePath: '/supervision/' + data[i] }).then(res => {
res.data.name = res.data.fileName
form.value[pathName].push(res.data)
// setTimeout(() => {
// formName.value[pathName] = res.data.fileName
// }, 100)
})
}
}
const reset = () => {
form.value = {
NetReport: [], //入网设计方案审查报告:
@@ -262,7 +271,7 @@ const reset = () => {
runTheReport: ''
}
}
defineExpose({ submitForm, queryFiles })
defineExpose({ submitForm, queryFiles ,reset})
</script>
<style lang="scss" scoped>
.el-form-item__content > div:first-child {

View File

@@ -345,34 +345,37 @@
</a>
</div>
</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-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)" />
</el-icon>
<a target="_blank" :href="form.informationSecurityTestReport[0]?.url">
{{ form.informationSecurityTestReport[0]?.name }}
</a>
</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-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)" />
</el-icon>
<a target="_blank" :href="form.acceptanceInspectionReportSingle[0]?.url">
@@ -381,7 +384,7 @@
</el-descriptions-item>
<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)" />
</el-icon>
<a target="_blank" :href="form.acceptanceInspectionReport[0]?.url">
@@ -389,7 +392,7 @@
</a>
</el-descriptions-item>
<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)" />
</el-icon>
<a target="_blank" :href="form.typeExperimentReport[0]?.url">
@@ -397,9 +400,8 @@
</a>
</el-descriptions-item>
<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)" />
</el-icon>
<a target="_blank" :href="form.factoryInspectionReport[0]?.url">
@@ -407,7 +409,7 @@
</a>
</el-descriptions-item>
<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)" />
</el-icon>
<a target="_blank" :href="form.performanceTestReport[0]?.url">
@@ -415,7 +417,7 @@
</a>
</el-descriptions-item>
<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)" />
</el-icon>
<a target="_blank" :href="form.mainWiringDiagram[0]?.url">
@@ -423,7 +425,7 @@
</a>
</el-descriptions-item>
<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)" />
</el-icon>
<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 => {
res.data.forEach((item: any) => {
if (item.url.length > 0) getFileNamePaths(item.url, item.name)
@@ -815,15 +817,14 @@ const getFileNamePath = async (val: any, pathName: any) => {
})
}
const getFileNamePaths = async (val: any, pathName: any) => {
await getFileNameAndFilePath({ filePath: val }).then(res => {
form.value[pathName] = [
{
name: res.data.fileName,
url: res.data.url
}
]
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 方法,用于打开弹窗

View File

@@ -7,6 +7,7 @@
v-model="form.deviceId"
:data="data"
filterable
:filter-node-method="filterNode"
style="width: 100%"
@change="changeDevStatus"
clearable
@@ -101,6 +102,40 @@ const resetForm = () => {
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) => {
title.value = text
@@ -212,4 +247,7 @@ defineExpose({ open })
::v-deep .el-tree-node__children > div {
display: block !important;
}
:deep(.el-select__input) {
width: 100% !important;
}
</style>

View File

@@ -29,7 +29,7 @@
</TableHeader>
<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>
</el-dialog>
<!-- 批量导入 -->