联调 辽宁台账维护 页面 修改 冀北 bug

This commit is contained in:
GGJ
2024-08-15 20:31:02 +08:00
parent fd5458105e
commit 9e1bbe8dc3
23 changed files with 794 additions and 39 deletions

View File

@@ -235,6 +235,7 @@ const exportEvent = () => {
if (!line) {
ElMessage({
type: 'warning',
message: '请选择要导出的数据'
})
return
@@ -246,7 +247,10 @@ const exportEvent = () => {
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
form.append('type', 0)
form.append('name', line.name)
ElMessage({
message: '下载报告中,请稍等.....',
duration: 1000
})
exportModelJB(form).then(async res => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

View File

@@ -1,25 +0,0 @@
<template>
<el-dialog v-model="dialogVisible" title="越限详情" width="50%" draggable>
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="500px" :data="tableData">
<vxe-column field="num2" title="指标" />
<vxe-column field="num2" title="时间" />
<vxe-column field="num3" title="最小值" />
<vxe-column field="num3" title="最大值" />
<vxe-column field="num3" title="平均值" />
<vxe-column field="num3" title="cp95值" />
<vxe-column field="num3" title="国际限值" />
</vxe-table>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
const dialogVisible = ref(false)
const tableData = ref([])
const open = () => {
dialogVisible.value = true
}
defineExpose({ open })
</script>
<style lang="scss" scoped></style>

View File

@@ -1,320 +0,0 @@
<template>
<div class="default-main">
<TableHeader datePicker area ref="header">
<!-- <template v-slot:select>
</template> -->
</TableHeader>
<div v-loading="tableStore.table.loading">
<el-row :gutter="10" class="pd10">
<el-col :span="11" style="position: relative">
<el-card>
<el-radio-group v-model="tableStore.table.params.radio" class="group">
<el-radio-button label="风电场" value="1" />
<el-radio-button label="光伏电站" value="2" />
</el-radio-group>
<MyEchartMap
ref="EchartMap"
:options="echartMapList"
class="map"
@eliminate="eliminate"
@getRegionByRegion="getRegionByRegion"
@clickMap="clickMap"
/>
</el-card>
</el-col>
<el-col :span="13">
<el-card>
<div class="tall">
<h3 class="mb10">暂降列表</h3>
<vxe-table height="auto" auto-resize :data="distributionData" v-bind="defaultAttribute">
<vxe-column field="qy" title="风电场 " show-overflow-tooltip></vxe-column>
<vxe-column field="jcd" title="暂降发生时刻"></vxe-column>
<vxe-column field="zc" title="暂降(骤升)幅值(%)" sortable></vxe-column>
<vxe-column field="zc" title="暂降原因" sortable></vxe-column>
<vxe-column field="zc" title="严重度" sortable></vxe-column>
<vxe-column title="操作" >
<template #default="{ row }">
<el-button type="text" size="small" link>查看波形</el-button>
</template>
</vxe-column>
</vxe-table>
</div>
</el-card>
<el-card class="mt10">
<div class="tall">
<h3 class="mb10">暂降波形</h3>
</div>
</el-card>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup lang="ts">
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import MyEchartMap from '@/components/echarts/MyEchartMap.vue'
import TableStore from '@/utils/tableStore'
import { ref, onMounted, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
defineOptions({
name: 'highAndLowPressure'
})
const EchartMap = ref()
const dictData = useDictData()
const options = dictData.getBasicData('Statistical_Type', ['Report_Type'])
const echartMapList: any = ref({})
const titleA = ref('')
const header = ref()
const distributionData: any = ref([])
const tableStore = new TableStore({
url: '/event-boot/area/getAreaLineDetail',
method: 'POST',
column: [],
loadCallback: () => {
titleA.value = tableStore.table.params.statisticalType.name
header.value.areaRef.change()
// 处理地图数据
map(tableStore.table.data)
tabulation(tableStore.table.data)
EchartMap.value.GetEchar(header.value.areaRef.areaName)
}
})
provide('tableStore', tableStore)
tableStore.table.params.radio = '1'
// tableStore.table.params.deptIndex = dictData.state.area[0].id
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Report_Type'])[0]
tableStore.table.params.monitorFlag = 2
tableStore.table.params.powerFlag = 2
tableStore.table.params.serverName = 'event-boot'
// 地图点击事件
const getRegionByRegion = (list: any) => {
tableStore.table.params.deptIndex = list.id
tableStore.onTableAction('search', {})
}
// 消除点
const eliminate = (name: string) => {
echartMapList.value.options.series = []
EchartMap.value.GetEchar(name)
}
// 地图数处理
const map = (res: any) => {
echartMapList.value = {
title: {
text: '高/低电压穿越'
},
tooltip: {
trigger: 'item',
formatter: function (params) {
if (params.seriesType == 'bar3D') {
return [params.seriesName, params.name + '' + params.value[2] + (params.value[3] || '')].join(
'<br />'
)
}
}
},
legend: {
selectedMode: false
},
geo3D: {
show: true,
name: '浙江',
itemStyle: {
color: getComputedStyle(document.documentElement).getPropertyValue('--el-color-primary-light-3'),
borderWidth: 1,
borderColor: '#fff'
},
emphasis: {
label: { show: true, fontSize: 16 },
itemStyle: {
color: getComputedStyle(document.documentElement).getPropertyValue('--el-color-primary-light-7')
}
},
viewControl: {
alpha: 60,
distance: 120
},
label: {
show: true,
color: '#fff',
fontSize: 16,
textStyle: {
color: '#fff',
backgroundColor: '#fff'
}
},
data: [
{ name: '目标数', field: 'mbs', unit: '万人' },
{ name: '完成数', field: 'wcs', unit: '万人' }
]
},
options: {
series: [
{
name: '低压',
type: 'bar3D',
coordinateSystem: 'geo3D',
shading: 'lambert',
label: {
show: true,
position: 'top',
formatter: params => {
return params.value[2] || ''
}
},
data: [
{
adcode: 330100,
name: '沈阳',
wcs: 10,
mbs: 50,
wcl: 100,
value: [123.364125, 41.722823, 50, '']
},
{
adcode: 330200,
name: '葫芦岛',
wcs: 10,
mbs: 20,
wcl: 80,
value: [120.80488, 40.816372, 20, '']
},
{
adcode: 330300,
name: '本溪',
wcs: 10,
mbs: 30,
wcl: 100,
value: [124.024811, 41.428257, 30, '']
},
{
adcode: 330400,
name: '大连',
lng: '120.750865',
lat: '30.662653',
wcs: 10,
mbs: 40,
wcl: 100,
value: [121.57391, 38.947468, 40, '']
}
],
barSize: 1,
minHeight: 1,
itemStyle: {
color: '#77DA63'
},
emphasis: {
label: { show: true }
},
zlevel: 1
},
{
name: '高压',
type: 'bar3D',
coordinateSystem: 'geo3D',
shading: 'lambert',
label: {
show: true,
position: 'top',
formatter: params => {
return params.value[2] || ''
}
},
data: [
{
adcode: 330100,
name: '沈阳',
wcs: 10,
mbs: 50,
wcl: 100,
value: [123.464125, 41.722823, 50, '']
},
{
adcode: 330200,
name: '葫芦岛',
wcs: 10,
mbs: 20,
wcl: 80,
value: [120.90488, 40.816372, 20, '']
},
{
adcode: 330300,
name: '本溪',
wcs: 10,
mbs: 30,
wcl: 100,
value: [124.124811, 41.428257, 30, '']
},
{
adcode: 330400,
name: '大连',
wcs: 10,
mbs: 40,
wcl: 100,
value: [121.67391, 38.947468, 40, '']
}
],
barSize: 1,
minHeight: 1,
itemStyle: {
color: '#FFBF00'
},
emphasis: {
label: { show: true }
}
}
]
}
}
}
// 表格数据处理
const tabulation = (res: any) => {
distributionData.value = []
for (var i = 0; i < res.areaValue.length; i++) {
distributionData.value.push({
qy: res.areaValue[i][0],
jcd: res.areaValue[i][1],
zc: res.areaValue[i][2],
zd: res.areaValue[i][3]
})
}
}
// 点击地图
const clickMap = (e: any) => {
console.log('🚀 ~ clickMap ~ e:', e)
}
onMounted(() => {
tableStore.index()
})
const layout = mainHeight(83) as any
const layout1 = mainHeight(93) as any
</script>
<style lang="scss" scoped>
.map {
height: calc(v-bind('layout1.height') - 30px);
}
.tall {
height: calc((v-bind('layout1.height') - 60px) / 2);
}
.group {
position: absolute;
top: 15px;
right: 20px;
z-index: 10;
}
:deep(.el-card__body) {
padding: 10px;
}
</style>

View File

@@ -286,7 +286,7 @@ resetForm()
const detailLoading = ref(false) // 表单的加载中
const getInfo = async (row?: any) => {
console.log('🚀 ~ getInfo ~ row:', row)
detailLoading.value = true
try {
await getUserReportById(props.id).then(res => {

View File

@@ -178,10 +178,10 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
return !(row.status == 0 || row.status == 3)
},
disabled: row => {
return !(row.status == 0)
return !(row.status == 0 || row.status == 3)
},
click: row => {
dialogVisible.value = true

View File

@@ -158,6 +158,27 @@
<el-radio :value="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="关联终端" prop="devId" v-if="props.openType != 'create'">
<el-select v-model="form.devId" placeholder="请选择关联终端" @change="changeDevId">
<el-option
v-for="(item, index) in devIdList"
:label="item.devName"
:value="item.devId"
:key="index"
/>
</el-select>
</el-form-item>
<el-form-item label="关联监测点" prop="lineId" v-if="props.openType != 'create'">
<el-select v-model="form.lineId" placeholder="请选择关联监测点">
<el-option
v-for="(item, index) in lineIdList"
:label="item.lineName"
:value="item.lineId"
:key="index"
/>
</el-select>
</el-form-item>
<el-form-item
for="-"
v-if="form.userType != '0' && form.userType != '1'"
@@ -361,7 +382,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -379,7 +399,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -397,7 +416,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -420,7 +438,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -438,7 +455,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -462,7 +478,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -486,7 +501,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -510,7 +524,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -534,7 +547,6 @@
action=""
:accept="acceptType"
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
@@ -545,6 +557,7 @@
</template>
</el-upload>
</el-form-item>
<addUpload ref="addUploadRef" v-if="props.openType == 'create'" />
</el-form>
<template #footer>
<div class="dialog-footer">
@@ -565,8 +578,16 @@ import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { uploadFile } from '@/api/system-boot/file'
import { submitFormData, getById, updateFormData, addEditor, resend } from '@/api/supervision-boot/interfere/index'
import {
submitFormData,
getById,
updateFormData,
addEditor,
resend,
getByDeptDevLine
} from '@/api/supervision-boot/interfere/index'
import { getUserReportUpdateById } from '@/api/supervision-boot/userReport/form'
import addUpload from './addUpload.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const isInterferencemanagement: any = ref(false)
@@ -596,6 +617,7 @@ const dialogFormVisible = ref(false)
// .doc,.docx,.xlsx,.xls,.pdf
const acceptType = ''
const form: any = ref({})
const addUploadRef: any = ref()
const control: any = ref(true)
const ruleFormRef: any = ref(null)
//字典获取所在地市
@@ -606,7 +628,8 @@ const areaOptionList = dictData
//字典获取敏感电能质量指标
// const energyQualityIndexList = dictData.getBasicData('Indicator_Type')
const energyQualityIndexList = dictData.getBasicData('Problem_Indicators')
const devIdList: any = ref([])
const lineIdList: any = ref([])
//字典获取行业类型
const industryList = dictData.getBasicData('industry_type_jb')
//字典电压等级
@@ -700,6 +723,8 @@ const resetForm = () => {
evaluationDept: evaluationDeptList[0].name, //预测评估单位 1
evaluationConclusion: '', //预测评估结论 1
backgroundTestPerformed: 0, //是否开展背景测试 1
devId: '', //关联终端 1
lineId: '', //关联监测点 1
feasibilityReport: [], // 可研报告告地址 1
preliminaryDesignDescription: [], //项目初步设计说明书告地址 1
predictionEvaluationReport: [], //预测评估报告地址 1
@@ -789,6 +814,8 @@ const subForm: any = ref({
expectedProductionDate: '', //工程预期投产日期
orgId: '', //填报部门
projectName: '',
devId: 0, //关联终端 1
lineId: 0, //关联监测点 1
reporter: '', //填报人
reportDate: new Date(), //填报日期
responsibleDepartment: '', //归口管理部门
@@ -872,6 +899,8 @@ const rules = ref({
voltageLevel: [{ required: true, message: '请选择电压等级', trigger: 'change' }],
evaluationDept: [{ required: true, message: '请选择预测评估单位', trigger: 'change' }],
evaluationConclusion: [{ required: true, message: '请输入预测评估结论', trigger: 'blur' }],
devId: [{ required: true, message: '请选择关联终端', trigger: 'change' }],
lineId: [{ required: true, message: '请选择关联监测点', trigger: 'change' }],
agreementCapacity: [{ required: true, message: '请选择用户协议容量', trigger: 'blur' }],
nonlinearDeviceType: [{ required: true, message: '请选择非线性终端类型', trigger: 'change' }],
needGovernance: [{ required: true, message: '请选择是否需要治理', trigger: 'change' }],
@@ -1025,10 +1054,11 @@ const status = ref('')
const open = async (row: any) => {
title.value = row.title
dialogFormVisible.value = true
let deptIds = adminInfo.$state.deptId
if (row.row) {
resendId.value = row.row.id
status.value = row.row.status
deptIds = row.row.orgId
if (props.update) {
await getUserReportUpdateById(row.row.id).then(res => {
handleResponse(res.data.userReportMessageJson)
@@ -1042,6 +1072,12 @@ const open = async (row: any) => {
resendId.value = ''
form.value.userType = userTypeList.value[0].value
}
setTimeout(() => {
getByDeptDevLine({ id: deptIds }).then(res => {
devIdList.value = res.data
changeDevId(form.value.devId, false)
})
}, 10)
}
async function handleResponse(data: any) {
// userType logic is commented out; if needed, implement accordingly
@@ -1186,7 +1222,14 @@ const choose = (e: any) => {
}
})
}
// 关联终端
const changeDevId = (e: any, flag?: boolean = true) => {
if (flag) {
form.value.lineId = ''
}
lineIdList.value = devIdList.value.filter(item => item.devId == e)[0]?.lineList
}
//设置工程预期投产日期时间选择范围不能<今天
const disabledDate = (time: any) => {
// return time.getTime() < Date.now() - 8.64e7 // 8.64e7 毫秒数代表一天
@@ -1194,6 +1237,7 @@ const disabledDate = (time: any) => {
}
//提交
const confirmForm = (flag: boolean) => {
addUploadRef.value?.submitForm()
if (flag) {
//整理上传文件的数据
// userType==0,1

View File

@@ -0,0 +1,204 @@
<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"
>
<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"
>
<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"
>
<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"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'acceptanceInspectionReportSingle')"
:auto-upload="false"
>
<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.acceptanceInspectionReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'acceptanceInspectionReport')"
:auto-upload="false"
>
<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.typeExperimentReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'typeExperimentReport')"
:auto-upload="false"
>
<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.factoryInspectionReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'factoryInspectionReport')"
:auto-upload="false"
>
<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.performanceTestReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'performanceTestReport')"
:auto-upload="false"
>
<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.mainWiringDiagram"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'mainWiringDiagram')"
:auto-upload="false"
>
<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.runTheReport"
action=""
accept=".doc,.docx,.xlsx,.xls,.pdf"
:limit="1"
@change="choose($event, 'runTheReport')"
:auto-upload="false"
>
<template #trigger>
<el-button type="primary">上传文件</el-button>
</template>
</el-upload>
</el-form-item>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { uploadFile } from '@/api/system-boot/file'
import { genFileId, ElMessage } from 'element-plus'
import type { UploadProps, UploadRawFile } from 'element-plus'
const form = ref({
NetReport: [], //入网设计方案审查报告:
governReport: [], //治理工程验收报告
informationSecurityTestReport: [], //信息安全检测报告
acceptanceInspectionReportSingle: [], //信息安全检测报告
acceptanceInspectionReport: [], //验收检验报告:
typeExperimentReport: [], //型式实验报告
factoryInspectionReport: [], //出厂检验报告:
performanceTestReport: [], //性能检测报告
mainWiringDiagram: [], //主接线图:
runTheReport: [], //试运行报告
})
const formName = ref({
NetReport: '',
governReport: '',
informationSecurityTestReport: '',
acceptanceInspectionReportSingle: '',
acceptanceInspectionReport: '',
typeExperimentReport: '',
factoryInspectionReport: '',
performanceTestReport: '',
mainWiringDiagram: '',
runTheReport: '',
})
const choose = (e: any, name: string) => {
console.log('🚀 ~ choose ~ name:', name)
uploadFile(e.raw, '/supervision/').then(res => {
formName.value[name] = res.data.name
})
}
const submitForm = () => {
console.log(formName.value)
}
defineExpose({ submitForm })
</script>
<style lang="scss" scoped>
.el-form-item__content > div:first-child {
display: flex;
}
:deep(.el-upload-list) {
margin: 0;
.el-upload-list__item {
height: 25px;
}
.el-upload-list__item-file-name {
width: 150px !important;
height: 25px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
</style>

View File

@@ -102,6 +102,19 @@
{{ 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 ? '否' : '是' }}
@@ -346,6 +359,7 @@ 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'
defineOptions({ name: 'BpmUserReportDetail' })
const { query } = useRoute() // 查询参数
@@ -355,10 +369,15 @@ const props = defineProps({
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)
@@ -595,6 +614,11 @@ const getProviteData = async () => {
}
})
}
// 调用关联终端接口
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) => {

View File

@@ -78,7 +78,14 @@ const tableStore = new TableStore({
column: [
{ title: '序号', type: 'seq', width: 80 },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{ field: 'city', title: '所在地市', minWidth: 80 },
{
field: 'city',
title: '所在地市',
minWidth: 80,
formatter: (obj: any) => {
return areaOptionList.filter(item => item.id == obj.row.city)[0]?.name
}
},
{
field: 'substation',
title: '变电站',

View File

@@ -1,26 +0,0 @@
<template>
<el-dialog v-model="dialogVisible" title="越限详情" width="50%" draggable>
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="500px" :data="tableData">
<vxe-column field="num2" title="指标" />
<vxe-column field="num2" title="时间" />
<vxe-column field="num3" title="最小值" />
<vxe-column field="num3" title="最大值" />
<vxe-column field="num3" title="平均值" />
<vxe-column field="num3" title="cp95值" />
<vxe-column field="num3" title="国际限值" />
</vxe-table>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
const dialogVisible = ref(false)
const tableData = ref([])
const open = () => {
dialogVisible.value = true
}
defineExpose({ open })
</script>
<style lang="scss" scoped></style>

View File

@@ -1,106 +0,0 @@
<template>
<div class="dictiontary-list-detail child-router">
<TableHeader :showSearch="false">
<template #select>
<el-form-item label="">
<span class="text-large font-600 mr-3">{{ props.timePopUpBox.num }}</span>
</el-form-item>
<el-form-item>
<el-radio-group v-model="radio2">
<el-radio-button label="基础数据" value="1" />
<el-radio-button label="谐波电压" value="2" />
<el-radio-button label="谐波电流" value="3" />
<el-radio-button label="间谐波电压含有率" value="4" />
</el-radio-group>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Back" @click="$emit('close')">返回</el-button>
</template>
</TableHeader>
<Table ref="tableRef" isGroup />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage } from 'element-plus'
import { dictDataDelete } from '@/api/system-boot/dicData'
defineOptions({
name: 'setting/dictionary/list/detail'
})
const radio2 = ref('1')
interface Props {
timePopUpBox: anyObj
}
const props = withDefaults(defineProps<Props>(), {
timePopUpBox: () => {
return {}
}
})
const popupEditRef = ref()
const tableStore = new TableStore({
url: '/user-boot/function/getRouteMenu',
method: 'GET',
column: [
{ title: '指标', field: 'name' },
{
title: '最小值',
field: 'code',
children: [
{ title: 'A', field: 'num' },
{ title: 'B', field: 'num' },
{ title: 'C', field: 'num' }
]
},
{
title: '最大值',
field: 'sort',
children: [
{ title: 'A', field: 'num' },
{ title: 'B', field: 'num' },
{ title: 'C', field: 'num' }
]
},
{
title: '平均值',
field: 'value',
children: [
{ title: 'A', field: 'num' },
{ title: 'B', field: 'num' },
{ title: 'C', field: 'num' }
]
},
{
title: 'cp95值',
field: 'levelName',
children: [
{ title: 'A', field: 'num' },
{ title: 'B', field: 'num' },
{ title: 'C', field: 'num' }
]
}
],
loadCallback: () => {
tableStore.table.data = [
{ name: '电压偏差(%)', num: 0.0 },
{ name: '谐波电压(%)', num: 0.0 },
{ name: '谐波电流(%)', num: 0.0 },
{ name: '三相电压不平衡度(%)', num: 0.0 },
{ name: '电压波动(%)', num: 0.0 },
{ name: '闪变(%)', num: 0.0 },
{ name: '间谐波电压含有率(%)', num: 0.0 },
{ name: '电流不平衡度', num: 0.0 }
]
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,420 +0,0 @@
<template>
<div class="default-main" :style="height">
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
<pane :size="size">
<PointTree
:default-expand-all="false"
@node-click="handleNodeClick"
@init="handleNodeClick"
></PointTree>
</pane>
<pane :style="height" style="background: #fff">
<TableHeader ref="TableHeaderRef" datePicker>
<template v-slot:select>
<!-- <el-form-item label="有功功率区间">
<el-select
v-model="power"
multiple
collapse-tags
collapse-tags-tooltip
filterable
placeholder="请选择有功功率区间"
>
<el-option
v-for="item in powerList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="各指标越限">
<el-select
v-model="index"
multiple
collapse-tags
collapse-tags-tooltip
filterable
placeholder="请选择各指标越限"
>
<el-option
v-for="item in indexList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> -->
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary">生成报表</el-button>
</template>
</TableHeader>
<div class="container pd10">
<div>
<el-card class="cardBox">
<div class="mb5" style="display: flex; justify-content: space-between">
<h3>有功功率趋势分析</h3>
<div>
<span>图例: </span>
<span style="color: red">稳态越限 </span>
<span style="color: green">合格</span>
</div>
</div>
<el-card class="card-top">
<div
v-for="item in powerList1"
class="pd10"
style="cursor: pointer"
:class="flag == item.label ? 'hoverBox' : ''"
@click="handleClick(item.label)"
>
<div style="font-size: 24px; font-weight: 700">
<span :style="{ color: item.crossTheLine === '越限' ? 'red' : 'green' }">
{{ item.quantity }}
</span>
<span style="font-size: 14px; font-weight: 500"></span>
</div>
<div>
{{ item.label }}
</div>
</div>
</el-card>
<el-card class="card-top mt15">
<div
v-for="item in powerList2"
class="pd10"
style="cursor: pointer"
:class="flag == item.label ? 'hoverBox' : ''"
@click="handleClick(item.label)"
>
<div style="font-size: 24px; font-weight: 700">
<span :style="{ color: item.crossTheLine === '越限' ? 'red' : 'green' }">
{{ item.quantity }}
</span>
<span style="font-size: 14px; font-weight: 500"></span>
</div>
<div>
{{ item.label }}
</div>
</div>
</el-card>
</el-card>
</div>
<el-card class="echart">
<my-echart :options="options" style="height: 198px" />
</el-card>
</div>
<div class="container mt10 ml10">
<el-card class="box">
<div :style="heightB" style="overflow-y: auto">
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="auto" :data="tableData">
<vxe-column field="num" title="时间" min-width="100px">
<template #default="{ row }">
<el-link type="primary" @click="timeClick(row)">{{ row.num }}</el-link>
</template>
</vxe-column>
<vxe-column field="num1" title="电压偏差(%)" />
<vxe-column field="num2" title="谐波电压(%)" />
<vxe-column field="num3" title="谐波电流(%)" />
<vxe-column field="num4" title="三相电压不平衡度(%)" />
<vxe-column field="num5" title="电压波动(%)" />
<vxe-column field="num6" title="闪变(%)" />
<vxe-column field="num7" title="间谐波电压含有率(%)" />
<vxe-column field="num8" title="流不平衡度" />
<vxe-column field="crossTheLine" title="越限情况">
<template #default="{ row }">
<el-link :type="row.crossTheLine === '越限' ? 'danger' : 'success'">
<span @click="detailClick(row)">{{ row.crossTheLine }}</span>
</el-link>
</template>
</vxe-column>
<vxe-column field="num3" title="操作">
<el-button type="primary" link>添加</el-button>
</vxe-column>
</vxe-table>
</div>
</el-card>
<el-card class="box mr10">
<div :style="heightB" style="overflow-y: auto">
<div style="display: flex; justify-content: space-between">
<span style="font-size: 16px; font-weight: 700">报告参数</span>
<el-radio-group v-model="radio2" size="small">
<el-radio-button label="统计结果" value="1" />
<el-radio-button label="原始数据" value="2" />
</el-radio-group>
</div>
</div>
</el-card>
</div>
</pane>
</splitpanes>
<!-- 时间弹框 -->
<timePopUpBox
ref="timePopUpBoxRef"
:timePopUpBox="timePopUpBox"
@close="timePopUpBox = null"
v-if="timePopUpBox"
/>
<!-- 越限详情 -->
<detail ref="detailRef" />
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, provide } from 'vue'
import 'splitpanes/dist/splitpanes.css'
import { Splitpanes, Pane } from 'splitpanes'
import TableStore from '@/utils/tableStore'
import PointTree from '@/components/tree/pqs/pointTree.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import MyEchart from '@/components/echarts/MyEchart.vue'
import TimePopUpBox from './components/timePopUpBox.vue'
import detail from './components/detail.vue'
defineOptions({
name: 'newEnergyAnalysis'
})
const timePopUpBox = ref<anyObj | null>(null)
const flag = ref('0%~10%')
const radio2 = ref('1')
const height = mainHeight(20)
const heightB = mainHeight(395)
const size = ref(0)
const TableHeaderRef = ref()
const detailRef = ref()
const dotList: any = ref({})
const power = ref([])
const timePopUpBoxRef = ref()
const index = ref([])
const powerList1: any = ref([
{
label: '0%~10%',
quantity: '20',
percentage: '10%',
crossTheLine: '越限',
value: '0%~10%'
},
{
label: '10%~20%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '10%~10%'
},
{
label: '20%~30%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '10%~30%'
},
{
label: '30%~40%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '30%~40%'
},
{
label: '40%~50%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '40%~50%'
}
])
const powerList2: any = ref([
{
label: '50%~60%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '50%~60%'
},
{
label: '60%~70%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '60%~70%'
},
{
label: '70%~80%',
quantity: '20',
percentage: '10%',
crossTheLine: '合格',
value: '70%~80%'
},
{
label: '80%~90%',
quantity: '20',
percentage: '10%',
crossTheLine: '越限',
value: '80%~90%'
},
{
label: '90%~100%',
quantity: '20',
percentage: '10%',
crossTheLine: '越限',
value: '90%~100%'
}
])
const tableData: any = ref([
{
num: '2023-08-08 09:00:00',
num1: '0',
num2: '1',
num3: '3',
num4: '2',
num5: '1',
num6: '1',
num7: '1',
num8: '0',
crossTheLine: '越限'
}
])
const options = ref({})
const tableStore = new TableStore({
url: '',
method: 'POST',
column: [],
beforeSearchFun: () => {},
loadCallback: () => {}
})
// 卡片点击变色
const handleClick = (e: string) => {
flag.value = e
}
// 点击时间
const timeClick = (row: any) => {
timePopUpBox.value = row
}
// 点击越限
const detailClick = () => {
detailRef.value.open()
}
provide('tableStore', tableStore)
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
size.value = Math.round((180 / dom.offsetHeight) * 100)
}
options.value = {
title: {
text: '占比',
left: '10px'
},
legend: {
show: false
},
tooltip: {},
xAxis: {
show: false
},
yAxis: {
show: false
},
dataZoom: { show: false },
options: {
series: [
{
type: 'pie',
center: ['50%', '50%'],
selectedOffset: 30,
label: {
show: true,
color: '#96A2B5',
lineHeight: 8,
minMargin: 10,
formatter: function (e) {
return '{name|' + e.name + '}{percent|' + e.data.percentage + '}'
},
rich: {
name: {
fontSize: 12
},
percent: {
fontSize: 14,
color: '#000',
padding: [0, 0, 0, 5]
}
}
},
data: [
...powerList1.value.map(item => {
return { value: item.quantity, name: item.label, percentage: item.percentage }
}),
...powerList2.value.map(item => {
return { value: item.quantity, name: item.label, percentage: item.percentage }
})
]
}
]
}
}
})
const handleNodeClick = (data: any, node: any) => {
dotList.value = data
}
</script>
<style lang="scss">
.splitpanes.default-theme .splitpanes__pane {
background: #eaeef1;
}
.cardBox {
.el-card__body {
padding: 5px 10px 10px;
}
}
.box {
.el-card__body {
padding: 10px;
}
}
.container {
display: grid;
grid-template-columns: 5fr 2.5fr;
gap: 20px;
.card-top {
background-color: var(--el-color-primary-light-9);
// color: #fff;
.el-card__body {
display: grid; /* 使用 Grid 布局 */
grid-template-columns: repeat(5, 1fr); /* 每行5列每列占1份空间 */
text-align: center;
gap: 20px;
padding: 10px;
.img {
vertical-align: middle;
height: 16px;
}
}
}
.echart {
.el-card__body {
padding: 5px;
}
}
}
.el-card {
border-radius: 10px;
}
.hoverBox {
background-color: var(--el-color-primary-light-5);
border-radius: 10px;
}
</style>

View File

@@ -29,12 +29,14 @@
</TableHeader>
<Table ref="tableRef" />
<el-dialog title="详情" width="80%" v-model="dialogShow"><DetailInfo :id="userId"></DetailInfo></el-dialog>
<el-dialog title="详情" width="80%" v-model="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" openType="create"></addForm>
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
@@ -125,7 +127,7 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !( row.dataType == 1)
return row.city != adminInfo.$state.deptName || !(row.dataType == 1)
},
click: row => {
@@ -145,6 +147,7 @@ const tableStore = new TableStore({
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''

View File

@@ -144,7 +144,7 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.dataType == 0 || row.dataType == 1)
return row.city != adminInfo.$state.deptName || !(row.dataType == 0 || row.dataType == 1)
},
// disabled: row => {
// return !(row.status == 0)
@@ -169,6 +169,7 @@ tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const addForms = ref()

View File

@@ -21,13 +21,16 @@
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate">模板下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 上传模版 -->
<uploadATemplate ref="uploadATemplateRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
@@ -36,10 +39,11 @@ import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { downloadDevTemplate } from '@/api/supervision-boot/userReport/form'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelTerminalFormData } from '@/api/supervision-boot/terminal/index'
import uploadATemplate from './uploadATemplate.vue'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
@@ -51,6 +55,7 @@ const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const uploadATemplateRef = ref()
const show: any = ref(false)
const fileList = ref([])
const flag = ref(false)
@@ -260,23 +265,26 @@ const cancelLeave = async (row: any) => {
// 加载数据
tableStore.index()
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
//导出模板
const exportExcelTemplate = () => {
downloadDevTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端入网检测模板'
document.body.appendChild(link)
link.click()
link.remove()
})
}
//批量导入用户数据
const importUserData = () => {
uploadATemplateRef.value.open('导入终端入网检测')
}
onMounted(() => {
tableStore.index()
})

View File

@@ -0,0 +1,147 @@
<template>
<el-dialog
draggable
class="cn-operate-dialog"
v-model="eventDataUploadVisible"
:title="title"
style="width: 415px"
top="25vh"
>
<el-scrollbar>
<el-form :inline="false" :model="form" label-width="120px" ref="formRef">
<el-form-item label="用户数据文件">
<el-upload
v-model:file-list="fileList"
ref="uploadEventData"
action=""
:limit="1"
:on-exceed="handleExceed"
:auto-upload="false"
:on-change="choose"
>
<template #trigger>
<el-button type="primary">选择数据文件</el-button>
</template>
</el-upload>
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<span class="dialog-footer">
<el-button @click="eventDataUploadVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, reactive, inject } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus'
import type { UploadInstance, UploadProps, UploadRawFile, UploadUserFile } from 'element-plus'
import { genFileId } from 'element-plus'
import { deVReportImportSensitive } from '@/api/supervision-boot/userReport/form'
const fileList = ref<UploadUserFile[]>([])
const formRef = ref()
const tableStore = inject('tableStore') as TableStore
const eventDataUploadVisible = ref(false)
const title = ref('')
const uploadEventData = ref<UploadInstance>()
// 注意不要和表单ref的命名冲突
const form = reactive({
file: null
})
//弹出界面,默认选择用户的第一个生产线的第一条进线进行数据导入
const open = async (text: string) => {
title.value = text
resetForm()
form.file = null
fileList.value = []
eventDataUploadVisible.value = true
}
//重置表单内容
const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
/**
* 选择待上传文件
*/
const choose = (e: any) => {
form.file = e.raw
}
const handleExceed: UploadProps['onExceed'] = files => {
uploadEventData.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadEventData.value!.handleStart(file)
fileList.value = [{ name: file.name, url: '' }]
}
/**
* 提交用户表单数据
*/
const submit = async () => {
if (form.file) {
formRef.value.validate(async (valid: any) => {
if (valid) {
let data = new FormData()
data.append('file', form.file)
await deVReportImportSensitive(data)
.then(res => handleImportResponse(title.value, res))
.finally(() => {
tableStore.index()
eventDataUploadVisible.value = false
})
}
})
} else {
ElMessage.error('请选择数据文件')
}
}
async function handleImportResponse(title: any, res: any) {
if (res.type === 'application/json') {
const fileReader = new FileReader()
fileReader.onloadend = () => {
try {
const jsonData = JSON.parse(fileReader.result)
if (jsonData.code === 'A0000') {
ElMessage.success('导入成功')
} else {
ElMessage.error('导入失败,请查看下载附件!')
}
} catch (err) {
console.log(err)
}
}
fileReader.readAsText(res)
} else {
ElMessage.error('导入失败,请查看下载附件!')
let blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端入网检测失败列表'
document.body.appendChild(link)
link.click()
link.remove()
}
}
defineExpose({ open })
</script>
<style scoped>
.el-form-item__content div {
width: 100% !important;
}
</style>

View File

@@ -369,6 +369,8 @@ const runTestSubmit = (type: number) => {
}
})
}
</script>
<style scoped lang="scss"></style>