暂降治理评估
This commit is contained in:
@@ -13,6 +13,16 @@ export const querySgIncomingLineByUserId = (data: any) => {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有监测信息
|
||||
*/
|
||||
export const lineOptionList = () => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgIncomingLine/lineList',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增进线
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ export const downloadTemplate = () => {
|
||||
export const exportEventData = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgEvent/exportEventData',
|
||||
method: 'GET',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
@@ -28,7 +28,7 @@ export const exportEventData = (data: any) => {
|
||||
|
||||
|
||||
/**
|
||||
* 新增业务用户
|
||||
* 导入暂降数据
|
||||
*/
|
||||
export const importEventData = (data: any) => {
|
||||
return createAxios({
|
||||
@@ -38,13 +38,23 @@ export const importEventData = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业务用户
|
||||
*/
|
||||
export const calcEventLoss = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgEvent/calcLoss?id=' + data,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新业务用户
|
||||
* 查询生产线下所有暂降事件
|
||||
*/
|
||||
export const updateSgEvent = (data: any) => {
|
||||
export const getEventDataByProductLineId = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgEvent/update',
|
||||
url: ADVANCE_BOOT + '/sgEvent/getEventDataByProductLineId',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
|
||||
@@ -2,6 +2,30 @@ import createAxios from '@/utils/request'
|
||||
|
||||
const ADVANCE_BOOT = '/advance-boot'
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
export const listMachine = (productLineId: any) => {
|
||||
const data = {productLineId}
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgMachine/list',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据生产线id查询所有设备
|
||||
*/
|
||||
export const querySgMachineByProductLineId = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgMachine/querySgMachineByProductLineId?productId='+data,
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
|
||||
@@ -6,7 +6,7 @@ const ADVANCE_BOOT = '/advance-boot'
|
||||
/**
|
||||
* 评估各方案
|
||||
*/
|
||||
export const calc = (data:any) => {
|
||||
export const calc = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sagGovernScheme/calc',
|
||||
method: 'POST',
|
||||
@@ -14,3 +14,40 @@ export const calc = (data:any) => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 评估各方案
|
||||
*/
|
||||
export const list = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sagGovernScheme/list',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除治理方案结果
|
||||
*/
|
||||
export const deleteSgScheme = (data: any) => {
|
||||
let ids = [data]
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sagGovernScheme/delete',
|
||||
method: 'POST',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据治理方案索引获取详情
|
||||
*/
|
||||
export const schemeDetail = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sagGovernScheme/detail?id=' + data,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,16 @@ export const addSgSensitiveUnit = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备id查询所有元器件
|
||||
*/
|
||||
export const queryUnitByMachineId = (data: any) => {
|
||||
return createAxios({
|
||||
url: ADVANCE_BOOT + '/sgSensitiveUnit/queryUnitByMachineId?machineId='+data,
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新设备
|
||||
|
||||
BIN
src/assets/font/ali/Nabla_Regular.ttf
Normal file
BIN
src/assets/font/ali/Nabla_Regular.ttf
Normal file
Binary file not shown.
BIN
src/assets/font/ali/Nabla_Regular.woff
Normal file
BIN
src/assets/font/ali/Nabla_Regular.woff
Normal file
Binary file not shown.
BIN
src/assets/font/ali/Nabla_Regular.woff2
Normal file
BIN
src/assets/font/ali/Nabla_Regular.woff2
Normal file
Binary file not shown.
104
src/components/echarts/radar.vue
Normal file
104
src/components/echarts/radar.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div ref='chartRef' class='my-chart' />
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import * as echarts from 'echarts' // 全引入
|
||||
import { color, gradeColor3 } from './color'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { defineExpose, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
|
||||
const config = useConfig()
|
||||
color[0] = config.layout.elementUiPrimary[0]
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
|
||||
const props = defineProps(['options'])
|
||||
let chart: echarts.ECharts | any = null
|
||||
let throttle: ReturnType<typeof setTimeout>
|
||||
|
||||
const resizeHandler = () => {
|
||||
// 不在视野中的时候不进行resize
|
||||
if (!chartRef.value) return
|
||||
if (chartRef.value.offsetHeight == 0) return
|
||||
chart.getZr().painter.getViewportRoot().style.display = 'none'
|
||||
requestAnimationFrame(() => {
|
||||
chart.resize()
|
||||
chart.getZr().painter.getViewportRoot().style.display = ''
|
||||
})
|
||||
}
|
||||
|
||||
const initChart = () => {
|
||||
chart?.dispose()
|
||||
chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||
const options = {
|
||||
title: {
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
color: '#000',
|
||||
fontSize: 18
|
||||
},
|
||||
...(props.options?.title || null)
|
||||
},
|
||||
radar: props.options?.radar,
|
||||
tooltip: props.options?.tooltip,
|
||||
legend: {
|
||||
right: 20,
|
||||
top: 0,
|
||||
itemGap: 10,
|
||||
itemStyle: {},
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
padding: [2, 0, 0, 0] //[上、右、下、左]
|
||||
},
|
||||
itemWidth: 15,
|
||||
itemHeight: 10,
|
||||
...(props.options?.legend || null)
|
||||
},
|
||||
|
||||
color: props.options?.color || color,
|
||||
series: props.options?.series,
|
||||
...props.options?.options
|
||||
}
|
||||
// 处理柱状图
|
||||
chart.setOption(options)
|
||||
setTimeout(() => {
|
||||
chart.resize()
|
||||
}, 0)
|
||||
}
|
||||
|
||||
|
||||
// 动态计算table高度
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
for (const entry of entries) {
|
||||
if (throttle) {
|
||||
clearTimeout(throttle)
|
||||
}
|
||||
throttle = setTimeout(() => {
|
||||
resizeHandler()
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
resizeObserver.observe(chartRef.value!)
|
||||
})
|
||||
defineExpose({ initChart })
|
||||
onBeforeUnmount(() => {
|
||||
resizeObserver.unobserve(chartRef.value!)
|
||||
chart?.dispose()
|
||||
})
|
||||
watch(
|
||||
() => props.options,
|
||||
(newVal, oldVal) => {
|
||||
initChart()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.my-chart {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,27 +1,36 @@
|
||||
<template>
|
||||
<div style='width: 12px;'></div>
|
||||
<el-icon color='black' class='backIcon'>
|
||||
<close @click='go(-1)' />
|
||||
</el-icon>
|
||||
<!-- <div style='width: 12px;'></div>-->
|
||||
<!-- <el-icon color='black' class='backIcon'>-->
|
||||
<!-- <close @click='go(-1)' />-->
|
||||
<!-- </el-icon>-->
|
||||
<el-button @click='go(-1)' :class='{positionStyle:custom,ml10:true}' :icon='Back'>返回</el-button>
|
||||
</template>
|
||||
|
||||
<script setup lang='ts'>
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import { Back } from '@element-plus/icons-vue'
|
||||
|
||||
const { go } = useRouter()
|
||||
defineProps(['custom'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.backIcon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
font-size: 25px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
font-size: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.backIcon:hover {
|
||||
border-radius: 25px;
|
||||
background-color: lightgrey;
|
||||
border-radius: 25px;
|
||||
background-color: lightgrey;
|
||||
}
|
||||
|
||||
.positionStyle {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -78,7 +78,14 @@ export const adminBaseRoute = {
|
||||
title: pageTitle('router.schemeCalc')
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
path: 'schemeHistory',
|
||||
component: () => import('@/views/pqs/voltageSags/sagGovern/scheme/history/index.vue'),
|
||||
name: '治理方案结果详情',
|
||||
meta: {
|
||||
title: pageTitle('router.schemeCalc')
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -377,6 +377,16 @@ body,
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
//阿里变形字体
|
||||
@font-face {
|
||||
font-family: "nablaRegular";
|
||||
src: url('../assets/font/ali/Nabla_Regular.woff') format('woff'),
|
||||
url("../assets/font/ali/Nabla_Regular.woff2") format('woff2');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
@font-face {
|
||||
font-family: 'AlimamaDongFangDaKai';
|
||||
src: url('../assets/font/ali/AlimamaDongFangDaKai-Regular.woff') format('woff'),
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
// 数字,包含小数,不支持负数
|
||||
export const numberRegex = /^[+]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;
|
||||
|
||||
// 0.4kV~500kV
|
||||
export const numberRegexSag = /^(0\.[4-9]|[1-9](\.\d+)?|\d{2,2}(\.\d+)?|500)$/;
|
||||
|
||||
|
||||
//邮箱
|
||||
export const emailRegex: RegExp = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
//手机号
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<!--上传负荷谐波电流数据-->
|
||||
<template>
|
||||
<el-dialog
|
||||
draggable
|
||||
class='cn-operate-dialog'
|
||||
v-model='eventDataUploadVisible'
|
||||
:title='title'
|
||||
style='width: 415px; height: 380px'
|
||||
top='25vh'
|
||||
>
|
||||
<el-scrollbar>
|
||||
<el-form :inline='false' :model='form' label-width='120px' ref='formRef' :rules='rules'>
|
||||
<el-form-item label='数据名称' prop='dataName'>
|
||||
<el-input v-model='form.dataName' />
|
||||
</el-form-item>
|
||||
<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, inject, reactive } 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 { importEventData } from '@/api/advance-boot/sgGroven/sgEvent'
|
||||
|
||||
const fileList = ref<UploadUserFile[]>([])
|
||||
|
||||
const formRef = ref()
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const eventDataUploadVisible = ref(false)
|
||||
const title = ref('')
|
||||
const uploadEventData = ref<UploadInstance>()
|
||||
|
||||
const rules = {
|
||||
dataName: [
|
||||
{ required: true, message: '数据名不能为空', trigger: 'blur' },
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = reactive({
|
||||
dataName: '',
|
||||
file: null
|
||||
})
|
||||
|
||||
//弹出界面,默认选择用户的第一个生产线的第一条进线进行数据导入
|
||||
const open = async (text: string) => {
|
||||
title.value = text
|
||||
resetForm()
|
||||
form.file = null
|
||||
fileList.value = []
|
||||
// 在此处恢复默认表单
|
||||
for (let key in form) {
|
||||
form[key] = ''
|
||||
}
|
||||
eventDataUploadVisible.value = true
|
||||
}
|
||||
|
||||
//重置表单内容
|
||||
const resetForm = () => {
|
||||
if (formRef.value) {
|
||||
formRef.value.resetFields()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择待上传文件
|
||||
*/
|
||||
const choose = (e: any) => {
|
||||
form.dataName = e.name.substring(0,e.name.lastIndexOf('.'))
|
||||
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)
|
||||
data.append('name', form.dataName)
|
||||
await importEventData(data).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage.success('导入成功')
|
||||
tableStore.index()
|
||||
eventDataUploadVisible.value = false
|
||||
} else {
|
||||
ElMessage.error('导入失败,请检查表格文件')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ElMessage.error('请选择数据文件')
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-form-item__content div {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
412
src/views/pqs/harmonicMonitoring/harmonicGovern/index.vue
Normal file
412
src/views/pqs/harmonicMonitoring/harmonicGovern/index.vue
Normal file
@@ -0,0 +1,412 @@
|
||||
<!--谐波治理参数准备页面-->
|
||||
<template>
|
||||
<el-form :inline='false' :model='form' label-width='135px' :rules='rules' ref='formRef'>
|
||||
<!--基础数据-->
|
||||
<div class='singleParamContent'>
|
||||
<el-divider content-position='left' class='divider'>
|
||||
<span class='dividerFontStyle'>负荷工况</span>
|
||||
</el-divider>
|
||||
<el-row>
|
||||
<el-col :span='7'>
|
||||
<el-form-item label='有功' prop='yggl'>
|
||||
<el-input
|
||||
v-model='form.yggl'
|
||||
clearable
|
||||
>
|
||||
<template #append>kW</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='无功' prop='wggl'>
|
||||
<el-input
|
||||
v-model='form.wggl'
|
||||
clearable
|
||||
>
|
||||
<template #append>kvar</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-button style='height: 45px;width:250px;position: absolute;right: 0;' type='primary'
|
||||
@click='calcSag'>开始评估
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span='7'>
|
||||
<el-form-item label='负载电压' prop='fzdy'>
|
||||
<el-input
|
||||
v-model='form.fzdy'
|
||||
:min='0.4'
|
||||
:max='500'
|
||||
clearable
|
||||
>
|
||||
<template #append>kV</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='负载接线方式' prop='ptType'>
|
||||
<el-select v-model='form.ptType' filterable>
|
||||
<el-option
|
||||
v-for='item in ptTypeList'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6' :offset='1'>
|
||||
<el-form-item label='负荷谐波电流' prop='ptType'>
|
||||
<el-select v-model='form.ptType' filterable>
|
||||
<el-option
|
||||
v-for='item in ptTypeList'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span='1'>
|
||||
<el-button @click='importData' style='margin-left: 5px' type='primary' :icon='Plus' />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!--UPS参数-->
|
||||
<div class='singleParamContent'>
|
||||
<el-divider content-position='left' class='divider'>
|
||||
<span class='dividerFontStyle'>变压器参数</span>
|
||||
</el-divider>
|
||||
<el-row>
|
||||
<el-col :span='7'>
|
||||
<el-form-item label='负载损耗' prop='fhsh'>
|
||||
<el-input
|
||||
v-model='form.fhsh'
|
||||
clearable
|
||||
>
|
||||
<template #append>kW</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='短路阻抗百分比' prop='dlzk'>
|
||||
<el-input
|
||||
v-model='form.dlzk'
|
||||
clearable
|
||||
>
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='额定容量' prop='edrl'>
|
||||
<el-input
|
||||
v-model='form.edrl'
|
||||
clearable
|
||||
>
|
||||
<template #append>MVA</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7'>
|
||||
<el-form-item label='一次侧电压' prop='ycdy'>
|
||||
<el-input
|
||||
v-model='form.ycdy'
|
||||
clearable
|
||||
>
|
||||
<template #append>kV</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='二次测电压' prop='ecdy'>
|
||||
<el-input
|
||||
v-model='form.ecdy'
|
||||
clearable
|
||||
>
|
||||
<template #append>kV</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='空载电流百分比' prop='kzdl'>
|
||||
<el-input
|
||||
v-model='form.kzdl'
|
||||
clearable
|
||||
>
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7'>
|
||||
<el-form-item label='空载损耗' prop='kzsh'>
|
||||
<el-input
|
||||
v-model='form.kzsh'
|
||||
clearable
|
||||
>
|
||||
<template #append>kW</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
<!--滤波器参数-->
|
||||
<div class='singleParamContent'>
|
||||
<el-divider content-position='left' class='divider'>
|
||||
<span class='dividerFontStyle'>滤波器参数</span>
|
||||
</el-divider>
|
||||
<el-row>
|
||||
<el-col :span='7'>
|
||||
<el-form-item label='目标功率因数' prop='glys'>
|
||||
<el-input
|
||||
v-model='form.glys'
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='7' :offset='1'>
|
||||
<el-form-item label='分配方式' prop='calcflag'>
|
||||
<el-select v-model='form.calcflag' filterable>
|
||||
<el-option
|
||||
v-for='item in calcList'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7' :offset='1'>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7'>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span='7' :offset='1'>
|
||||
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
|
||||
</el-form>
|
||||
<data-upload-popup ref='dataUploadPopup' />
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import emitter from '@/utils/emitter'
|
||||
import { numberRegex, numberRegexSag } from '@/utils/regexPattern'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { calc } from '@/api/advance-boot/sgGroven/sgScheme'
|
||||
import DataUploadPopup from '@/views/pqs/harmonicMonitoring/harmonicGovern/dataUploadPopup.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'calcParamPrepare'
|
||||
})
|
||||
|
||||
const dataUploadPopup = ref()
|
||||
const formRef = ref()
|
||||
const ptTypeList: any = ref(
|
||||
[
|
||||
{ 'id': 1, 'name': '星型' },
|
||||
{ 'id': 2, 'name': '三角型' }
|
||||
]
|
||||
)
|
||||
|
||||
const calcList: any = ref(
|
||||
[
|
||||
{ 'id': 1, 'name': '按谐波电流大小分配' },
|
||||
{ 'id': 2, 'name': '无功均分' }
|
||||
]
|
||||
)
|
||||
const incomingLineListData: any = ref([])
|
||||
|
||||
|
||||
// 注意不要和表单ref的命名冲突
|
||||
let form = reactive({
|
||||
yggl: '155.83',
|
||||
wggl: '96.57',
|
||||
fzdy: '0.4',
|
||||
ptType: 1,
|
||||
fhsh: '',
|
||||
dlzk: '',
|
||||
edrl: '',
|
||||
ycdy: '',
|
||||
ecdy: '',
|
||||
kzdl: '',
|
||||
kzsh: '',
|
||||
glys: '',
|
||||
pzys: '',
|
||||
jzcs: '',
|
||||
calcflag: ''
|
||||
})
|
||||
|
||||
|
||||
//form表单校验规则
|
||||
const rules = {
|
||||
yggl: [
|
||||
{ required: true, message: '有功功率必填', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
wggl: [
|
||||
{ required: true, message: '无功必填', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
fzdy: [
|
||||
{ required: true, message: '负载电压必填', trigger: 'blur' },
|
||||
{ pattern: numberRegexSag, message: '请确保电压范围0.4kV~500kV', trigger: 'blur' }
|
||||
],
|
||||
productLineId: [{ required: true, message: '生产线必选', trigger: 'change' }],
|
||||
payBackPeriod: [{ required: true, message: '期望回收周期必填', trigger: 'change' }],
|
||||
ups: {
|
||||
price: [
|
||||
{ required: true, message: '购置价格不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
compensation: [
|
||||
{ required: true, message: '补偿能力不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
maintainFee: [
|
||||
{ required: true, message: '年维护费不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
responseTime: [
|
||||
{ required: true, message: '响应时间不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
backupTime: [
|
||||
{ required: true, message: '后备时间不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
|
||||
avc: {
|
||||
price: [
|
||||
{ required: true, message: '购置价格不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
compensation: [
|
||||
{ required: true, message: '补偿能力不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
maintainFee: [
|
||||
{ required: true, message: '年维护费不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
responseTime: [
|
||||
{ required: true, message: '响应时间不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
backupTime: [
|
||||
{ required: true, message: '后备时间不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
|
||||
quick: {
|
||||
governMachinePower: [
|
||||
{ required: true, message: '设备容量不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: '购置价格不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
buildFee: [
|
||||
{ required: true, message: '构建成本不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
quickMaintainFee: [
|
||||
{ required: true, message: '年维护费不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
actionTime: [
|
||||
{ required: true, message: '动作时间不能为空', trigger: 'blur' },
|
||||
{ pattern: numberRegex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
],
|
||||
incomingLineId: [{ required: true, message: '备用进线必选', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
|
||||
//新增负荷谐波电流
|
||||
const importData = () => {
|
||||
// 弹出框,联级选择生产线--进线,上传文件
|
||||
dataUploadPopup.value.open('导入谐波电流数据')
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂载时初始化数据内容
|
||||
*/
|
||||
onMounted(() => {
|
||||
//todo...动态加载数据文件
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* 计算暂降治理
|
||||
*/
|
||||
function calcSag() {
|
||||
formRef.value.validate(async (valid: any, errorMsg: any) => {
|
||||
if (valid) {
|
||||
//将所有参数传递到后端进行数据计算
|
||||
await calc(form).then(res => {
|
||||
//先通知父组件打开历史页面
|
||||
emitter.emit('schemeRadio', '评估计算结果')
|
||||
emitter.emit('calcResult', false)
|
||||
//再将历史数据传递到历史页面
|
||||
emitter.emit('send-scheme-result', res.data)
|
||||
})
|
||||
} else {
|
||||
for (const item in errorMsg) {
|
||||
ElMessage.error(errorMsg[item][0].message)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.divider {
|
||||
font-family: AlimamaDongFangDaKai;
|
||||
}
|
||||
|
||||
@keyframes colorChange {
|
||||
0% {
|
||||
color: #205CE8;
|
||||
}
|
||||
100% {
|
||||
color: #32B9FC;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.dividerFontStyle {
|
||||
font-size: 25px !important;
|
||||
animation: colorChange 3s infinite;
|
||||
}
|
||||
|
||||
.singleParamContent {
|
||||
padding: 5px 30px;
|
||||
}
|
||||
|
||||
.el-col {
|
||||
margin-top: 15px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -210,6 +210,7 @@ const submit = async () => {
|
||||
let data = new FormData()
|
||||
data.append('file', form.file)
|
||||
data.append('incomingLineId', form.incomingLineId)
|
||||
data.append('productLineId', form.productLineId)
|
||||
await importEventData(data).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage.success('导入成功')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class='default-main'>
|
||||
<!-- 表头 -->
|
||||
<TableHeader date-picker>
|
||||
<TableHeader date-picker ref='tableHeader'>
|
||||
<template v-slot:select>
|
||||
<el-form-item label='用户'>
|
||||
<el-select v-model='tableStore.table.params.userId' filterable @change='changeUser'>
|
||||
@@ -15,7 +15,6 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
|
||||
<!--返回按钮-->
|
||||
<back-component />
|
||||
</template>
|
||||
@@ -23,7 +22,7 @@
|
||||
<!--导入暂降数据查询框-->
|
||||
<event-upload-popup ref='eventUploadPopup' />
|
||||
|
||||
<el-radio-group v-model='radio' id='tabTitle'>
|
||||
<el-radio-group v-model='radio' id='tabTitle' @change='switchRadio'>
|
||||
<el-radio-button label='暂降数据' />
|
||||
<el-radio-button label='电压暂降事件统计' />
|
||||
<el-radio-button label='耐受曲线信息' />
|
||||
@@ -51,7 +50,7 @@
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { Upload, Download } from '@element-plus/icons-vue'
|
||||
import { ref, provide, reactive } from 'vue'
|
||||
import { ref, provide, reactive, onMounted } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
@@ -61,9 +60,10 @@ import BackComponent from '@/components/icon/back/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { sgUserList } from '@/api/advance-boot/sgGroven/sgUser'
|
||||
import EventUploadPopup from '@/views/pqs/voltageSags/sagGovern/businessUser/event/eventUploadPopup.vue'
|
||||
import { downloadTemplate, exportEventData } from '@/api/advance-boot/sgGroven/sgEvent'
|
||||
|
||||
import { calcEventLoss, deleteSgEvent, downloadTemplate, exportEventData } from '@/api/advance-boot/sgGroven/sgEvent'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const tableHeader = ref()
|
||||
const { query } = useRoute()
|
||||
const userId = ref()
|
||||
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
||||
@@ -90,8 +90,8 @@ const tableStore = new TableStore({
|
||||
{ title: '预计损失(万元)', field: 'estimatedLoss', minWidth: '130', sortable: true },
|
||||
{
|
||||
title: '数据来源', field: 'dataSource', minWidth: '130',
|
||||
formatter: (row: any) => {
|
||||
return row.dataSource == 0 ? '离线导入' : '监测点同步'
|
||||
formatter: (obj: any) => {
|
||||
return obj.row.dataSource == 0 ? '离线导入' : '监测点同步'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -100,45 +100,84 @@ const tableStore = new TableStore({
|
||||
width: '230',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
// {
|
||||
// name: 'productSetting',
|
||||
// title: '波形查看',
|
||||
// type: 'primary',
|
||||
// icon: 'el-icon-EditPen',
|
||||
// render: 'basicButton',
|
||||
// disabled: row => {
|
||||
// return row.fileFlag !== 0
|
||||
// }
|
||||
// // click: async row => {
|
||||
// // dialogFormVisible.value = true
|
||||
// // dialogTitle.value = '前置机修改'
|
||||
// // formData.value = JSON.parse(JSON.stringify(row))
|
||||
// // }
|
||||
// },
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '波形查看',
|
||||
title: '计算损失',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.fileFlag !== 0
|
||||
click: row => {
|
||||
calcEventLoss(row.id).then(res => {
|
||||
ElMessage.success('计算成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
// click: async row => {
|
||||
// dialogFormVisible.value = true
|
||||
// dialogTitle.value = '前置机修改'
|
||||
// formData.value = JSON.parse(JSON.stringify(row))
|
||||
// }
|
||||
},
|
||||
// {
|
||||
// name: 'productSetting',
|
||||
// title: '暂无波形',
|
||||
// type: 'primary',
|
||||
// icon: 'el-icon-EditPen',
|
||||
// render: 'basicButton',
|
||||
// disabled: row => {
|
||||
// return row.fileFlag !== 1
|
||||
// }
|
||||
// },
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '暂无波形',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.fileFlag !== 1
|
||||
name: 'update',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
deleteSgEvent(row.id).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.searchBeginTime = tableHeader.value.datePickerRef.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = tableHeader.value.datePickerRef.timeValue[1]
|
||||
for (let key in tableStore.table.params) {
|
||||
if (tableStore.table.params[key] === '') {
|
||||
delete tableStore.table.params[key]
|
||||
}
|
||||
}
|
||||
sags3DRef.value?.search(userId, tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime)
|
||||
toleranceCurveRef.value?.search(userId, tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime)
|
||||
}
|
||||
})
|
||||
// 注入到子组件
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableHeader.value.setInterval(1)
|
||||
})
|
||||
//初始化页面
|
||||
const initData = async () => {
|
||||
//先查询所有用户列表
|
||||
@@ -148,12 +187,21 @@ const initData = async () => {
|
||||
userId.value = query.id
|
||||
tableStore.table.params.userId = userId
|
||||
tableStore.index()
|
||||
sags3DRef.value?.search(userId)
|
||||
toleranceCurveRef.value?.search(userId)
|
||||
|
||||
sags3DRef.value?.search(userId, tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime)
|
||||
toleranceCurveRef.value?.search(userId, tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime)
|
||||
}
|
||||
|
||||
initData()
|
||||
|
||||
const switchRadio = () => {
|
||||
if (radio.value == '电压暂降事件统计') {
|
||||
sags3DRef.value?.search(userId.value, tableHeader.value.datePickerRef.timeValue[0], tableHeader.value.datePickerRef.timeValue[1])
|
||||
}else if(radio.value == '耐受曲线信息'){
|
||||
toleranceCurveRef.value?.search(userId.value, tableHeader.value.datePickerRef.timeValue[0], tableHeader.value.datePickerRef.timeValue[1])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//用户信息更换
|
||||
const changeUser = () => {
|
||||
userId.value = tableStore.table.params.userId
|
||||
@@ -167,7 +215,11 @@ const importEventData = () => {
|
||||
|
||||
// 导出表格
|
||||
const exportExcel = () => {
|
||||
const param = {}
|
||||
const param = {
|
||||
userId: userId.value,
|
||||
searchBeginTime: tableHeader.value.datePickerRef.timeValue[0],
|
||||
searchEndTime: tableHeader.value.datePickerRef.timeValue[1]
|
||||
}
|
||||
exportEventData(param).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
@@ -203,7 +255,7 @@ const exportExcelTemplate = () => {
|
||||
|
||||
.tableExtraButton {
|
||||
position: absolute;
|
||||
right: 27px;
|
||||
right: 17px;
|
||||
top: 55px;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { ref, provide } from 'vue'
|
||||
import SecondSheet from '@/components/secondSheet/index.vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
@@ -28,13 +28,13 @@ const apiData = ref()
|
||||
const tableStore = new TableStore({
|
||||
showPage: false,
|
||||
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
||||
url: '/user-boot/user/list',
|
||||
url: '/advance-boot/sgEvent/3DList',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '电压暂降频次统计表',
|
||||
children: [
|
||||
{ title: '暂降幅度(p.u.)', field: 'amplitude', width: '130' },
|
||||
{ title: '暂降幅值(p.u.)', field: 'amplitude', width: '130' },
|
||||
{
|
||||
title: '持续时间(s)',
|
||||
field: 'loginName',
|
||||
@@ -44,137 +44,92 @@ const tableStore = new TableStore({
|
||||
}
|
||||
],
|
||||
loadCallback: () => {
|
||||
const eventCount = tableStore.table.data.values
|
||||
tableStore.table.data = {
|
||||
lineIds: [1, 5],
|
||||
type: 1,
|
||||
beginDate: '2019-01-01',
|
||||
endDate: '2024-12-31',
|
||||
amplitudes: ['0.8~0.9', '0.7~0.8', '0.6~0.7', '0.5~0.6', '0.4~0.5', '0.1~0.4'],
|
||||
durations: ['0.01~0.02', '0.02~0.05', '0.05~0.07', '0.07~0.10', '0.10~1.00'],
|
||||
values: [
|
||||
['0.8~0.9', '0.01~0.02', '0'],
|
||||
['0.8~0.9', '0.02~0.05', '0'],
|
||||
['0.8~0.9', '0.05~0.07', '0'],
|
||||
['0.8~0.9', '0.07~0.10', '0'],
|
||||
['0.8~0.9', '0.10~1.00', '6'],
|
||||
['0.7~0.8', '0.01~0.02', '0'],
|
||||
['0.7~0.8', '0.02~0.05', '0'],
|
||||
['0.7~0.8', '0.05~0.07', '0'],
|
||||
['0.7~0.8', '0.07~0.10', '0'],
|
||||
['0.7~0.8', '0.10~1.00', '1'],
|
||||
['0.6~0.7', '0.01~0.02', '0'],
|
||||
['0.6~0.7', '0.02~0.05', '0'],
|
||||
['0.6~0.7', '0.05~0.07', '0'],
|
||||
['0.6~0.7', '0.07~0.10', '0'],
|
||||
['0.6~0.7', '0.10~1.00', '2'],
|
||||
['0.5~0.6', '0.01~0.02', '0'],
|
||||
['0.5~0.6', '0.02~0.05', '0'],
|
||||
['0.5~0.6', '0.05~0.07', '0'],
|
||||
['0.5~0.6', '0.07~0.10', '0'],
|
||||
['0.5~0.6', '0.10~1.00', '5'],
|
||||
['0.4~0.5', '0.01~0.02', '0'],
|
||||
['0.4~0.5', '0.02~0.05', '0'],
|
||||
['0.4~0.5', '0.05~0.07', '0'],
|
||||
['0.4~0.5', '0.07~0.10', '0'],
|
||||
['0.4~0.5', '0.10~1.00', '1'],
|
||||
['0.1~0.4', '0.01~0.02', '0'],
|
||||
['0.1~0.4', '0.02~0.05', '0'],
|
||||
['0.1~0.4', '0.05~0.07', '0'],
|
||||
['0.1~0.4', '0.07~0.10', '0'],
|
||||
['0.1~0.4', '0.10~1.00', '3']
|
||||
['0.8~0.9', '0.01~0.02', eventCount[0][2]],
|
||||
['0.8~0.9', '0.02~0.05', eventCount[1][2]],
|
||||
['0.8~0.9', '0.05~0.07', eventCount[2][2]],
|
||||
['0.8~0.9', '0.07~0.10', eventCount[3][2]],
|
||||
['0.8~0.9', '0.10~1.00', eventCount[4][2]],
|
||||
['0.7~0.8', '0.01~0.02', eventCount[5][2]],
|
||||
['0.7~0.8', '0.02~0.05', eventCount[6][2]],
|
||||
['0.7~0.8', '0.05~0.07', eventCount[7][2]],
|
||||
['0.7~0.8', '0.07~0.10', eventCount[8][2]],
|
||||
['0.7~0.8', '0.10~1.00', eventCount[9][2]],
|
||||
['0.6~0.7', '0.01~0.02', eventCount[10][2]],
|
||||
['0.6~0.7', '0.02~0.05', eventCount[11][2]],
|
||||
['0.6~0.7', '0.05~0.07', eventCount[12][2]],
|
||||
['0.6~0.7', '0.07~0.10', eventCount[13][2]],
|
||||
['0.6~0.7', '0.10~1.00', eventCount[14][2]],
|
||||
['0.5~0.6', '0.01~0.02', eventCount[15][2]],
|
||||
['0.5~0.6', '0.02~0.05', eventCount[16][2]],
|
||||
['0.5~0.6', '0.05~0.07', eventCount[17][2]],
|
||||
['0.5~0.6', '0.07~0.10', eventCount[18][2]],
|
||||
['0.5~0.6', '0.10~1.00', eventCount[19][2]],
|
||||
['0.4~0.5', '0.01~0.02', eventCount[20][2]],
|
||||
['0.4~0.5', '0.02~0.05', eventCount[21][2]],
|
||||
['0.4~0.5', '0.05~0.07', eventCount[22][2]],
|
||||
['0.4~0.5', '0.07~0.10', eventCount[23][2]],
|
||||
['0.4~0.5', '0.10~1.00', eventCount[24][2]],
|
||||
['0.1~0.4', '0.01~0.02', eventCount[25][2]],
|
||||
['0.1~0.4', '0.02~0.05', eventCount[26][2]],
|
||||
['0.1~0.4', '0.05~0.07', eventCount[27][2]],
|
||||
['0.1~0.4', '0.07~0.10', eventCount[28][2]],
|
||||
['0.1~0.4', '0.10~1.00', eventCount[29][2]]
|
||||
],
|
||||
table: {
|
||||
total: 6,
|
||||
rows: [
|
||||
{
|
||||
searchValue: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
params: {},
|
||||
amplitude: '0.8~0.9',
|
||||
d005_007s: '0',
|
||||
d001_002s: '0',
|
||||
d002_005s: '0',
|
||||
d010_100s: '6',
|
||||
d007_010s: '0'
|
||||
d001_002s: eventCount[0][2],
|
||||
d002_005s: eventCount[1][2],
|
||||
d005_007s: eventCount[2][2],
|
||||
d007_010s: eventCount[3][2],
|
||||
d010_100s: eventCount[4][2]
|
||||
},
|
||||
{
|
||||
searchValue: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
params: {},
|
||||
amplitude: '0.7~0.8',
|
||||
d005_007s: '0',
|
||||
d001_002s: '0',
|
||||
d002_005s: '0',
|
||||
d010_100s: '1',
|
||||
d007_010s: '0'
|
||||
d001_002s: eventCount[5][2],
|
||||
d002_005s: eventCount[6][2],
|
||||
d005_007s: eventCount[7][2],
|
||||
d007_010s: eventCount[8][2],
|
||||
d010_100s: eventCount[9][2]
|
||||
},
|
||||
{
|
||||
searchValue: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
params: {},
|
||||
amplitude: '0.6~0.7',
|
||||
d005_007s: '0',
|
||||
d001_002s: '0',
|
||||
d002_005s: '0',
|
||||
d010_100s: '2',
|
||||
d007_010s: '0'
|
||||
d001_002s: eventCount[10][2],
|
||||
d002_005s: eventCount[11][2],
|
||||
d005_007s: eventCount[12][2],
|
||||
d007_010s: eventCount[13][2],
|
||||
d010_100s: eventCount[14][2]
|
||||
},
|
||||
{
|
||||
searchValue: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
params: {},
|
||||
amplitude: '0.5~0.6',
|
||||
d005_007s: '0',
|
||||
d001_002s: '0',
|
||||
d002_005s: '0',
|
||||
d010_100s: '5',
|
||||
d007_010s: '0'
|
||||
d001_002s: eventCount[15][2],
|
||||
d002_005s: eventCount[16][2],
|
||||
d005_007s: eventCount[17][2],
|
||||
d007_010s: eventCount[18][2],
|
||||
d010_100s: eventCount[19][2]
|
||||
},
|
||||
{
|
||||
searchValue: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
params: {},
|
||||
amplitude: '0.4~0.5',
|
||||
d005_007s: '0',
|
||||
d001_002s: '0',
|
||||
d002_005s: '0',
|
||||
d010_100s: '1',
|
||||
d007_010s: '0'
|
||||
d001_002s: eventCount[20][2],
|
||||
d002_005s: eventCount[21][2],
|
||||
d005_007s: eventCount[22][2],
|
||||
d007_010s: eventCount[23][2],
|
||||
d010_100s: eventCount[24][2]
|
||||
},
|
||||
{
|
||||
searchValue: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
params: {},
|
||||
amplitude: '0.1~0.4',
|
||||
d005_007s: '0',
|
||||
d001_002s: '0',
|
||||
d002_005s: '0',
|
||||
d010_100s: '3',
|
||||
d007_010s: '0'
|
||||
d001_002s: eventCount[25][2],
|
||||
d002_005s: eventCount[26][2],
|
||||
d005_007s: eventCount[27][2],
|
||||
d007_010s: eventCount[28][2],
|
||||
d010_100s: eventCount[29][2]
|
||||
}
|
||||
],
|
||||
code: 200,
|
||||
@@ -182,6 +137,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
}
|
||||
apiData.value = tableStore.table.data
|
||||
tableStore.table.column![0].children![1].children = []
|
||||
tableStore.table.column![0].children![1].children!.push(
|
||||
...(apiData.value.durations.map((item: string) => {
|
||||
return {
|
||||
@@ -197,9 +153,6 @@ const tableStore = new TableStore({
|
||||
// 注入到子组件
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
search()
|
||||
})
|
||||
const initEchart = () => {
|
||||
options.value = {
|
||||
options: {
|
||||
@@ -225,7 +178,7 @@ const initEchart = () => {
|
||||
borderWidth: 0,
|
||||
formatter: function (params: any) {
|
||||
let tips = ''
|
||||
tips += '<font>暂降幅度(p.u.):' + apiData.value.amplitudes[params.value[0]] + '</font><br/>'
|
||||
tips += '<font>暂降幅值(p.u.):' + apiData.value.amplitudes[params.value[0]] + '</font><br/>'
|
||||
tips += '<font>持续时间(s):' + apiData.value.durations[params.value[1]] + '</font><br/>'
|
||||
tips += '<font>事件次数::' + params.value[2] + '</font>'
|
||||
return tips
|
||||
@@ -236,7 +189,7 @@ const initEchart = () => {
|
||||
x: 'center'
|
||||
},
|
||||
xAxis3D: {
|
||||
name: '暂降福度(p.u.)',
|
||||
name: '暂降幅值(p.u.)',
|
||||
type: 'category',
|
||||
data: apiData.value.amplitudes
|
||||
},
|
||||
@@ -295,13 +248,11 @@ const initEchart = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
const search = () => {
|
||||
const search = (id:string,beginTime:string,endTime:string) => {
|
||||
// 从父组件tableStore获取参数
|
||||
tableStore.table.params.pageSize = 9999
|
||||
tableStore.table.params.searchState = 1
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.casualUser = -1
|
||||
tableStore.table.params.orderBy = ''
|
||||
tableStore.table.params.searchBeginTime = beginTime
|
||||
tableStore.table.params.searchEndTime = endTime
|
||||
tableStore.table.params.userId = id
|
||||
tableStore.index()
|
||||
}
|
||||
defineExpose({ search })
|
||||
|
||||
@@ -1,514 +1,319 @@
|
||||
<template>
|
||||
<SecondSheet>
|
||||
<div class="tolerance-curve">
|
||||
<el-form label-width="auto" :inline="true">
|
||||
<el-form-item>
|
||||
<el-select v-model="form.name" placeholder="Select">
|
||||
<div class='tolerance-curve'>
|
||||
<el-form label-width='auto' :inline='true'>
|
||||
<el-form-item label='生产线'>
|
||||
<el-select v-model='form.productLineId'>
|
||||
<el-option
|
||||
v-for="item in selectOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for='item in productLineOptions'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="form.name" placeholder="Select">
|
||||
<el-form-item label='设备'>
|
||||
<el-select v-model='form.machineId' placeholder='暂无设备'>
|
||||
<el-option
|
||||
v-for="item in selectOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for='item in machineOptions'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="form.name" placeholder="Select">
|
||||
<el-form-item label='敏感元器件'>
|
||||
<el-select v-model='form.unitId' placeholder='暂无元器件'>
|
||||
<el-option
|
||||
v-for="item in selectOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for='item in unitOptions'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="display: flex; flex: 1">
|
||||
<el-form label-width="auto" label-position="top">
|
||||
<el-form-item label="耐受曲线">
|
||||
<el-select v-model="form.name" placeholder="Select">
|
||||
<el-option
|
||||
v-for="item in selectOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="耐受能力(膝点坐标)">
|
||||
<el-select v-model="form.name" placeholder="Select">
|
||||
<el-option
|
||||
v-for="item in selectOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上限曲线膝点">
|
||||
<div style='display: flex; flex: 1'>
|
||||
<el-form label-width='auto' label-position='top'>
|
||||
<!-- <el-form-item label='耐受曲线'>-->
|
||||
<!-- <el-select v-model='form.name' placeholder='Select'>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for='item in selectOptions'-->
|
||||
<!-- :key='item.value'-->
|
||||
<!-- :label='item.label'-->
|
||||
<!-- :value='item.value'-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label='耐受能力(膝点坐标)'>-->
|
||||
<!-- <el-select v-model='form.name' placeholder='Select'>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for='item in selectOptions'-->
|
||||
<!-- :key='item.value'-->
|
||||
<!-- :label='item.label'-->
|
||||
<!-- :value='item.value'-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label='上限曲线膝点'>
|
||||
<div>
|
||||
<div>
|
||||
<el-input-number v-model="form.num" controls-position="right" />
|
||||
<span class="ml10" style="color: #333">p.u.</span>
|
||||
<el-input-number v-model='unit.vtcAmpUpper' controls-position='right' />
|
||||
<span class='ml10' style='color: #333'>p.u.</span>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<el-input-number v-model="form.num" controls-position="right" />
|
||||
<span class="ml10" style="color: #333">ms</span>
|
||||
<div class='mt10'>
|
||||
<el-input-number v-model='unit.vtcTimeUpper' controls-position='right' />
|
||||
<span class='ml10' style='color: #333'>ms</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="下限曲线膝点">
|
||||
<el-form-item label='下限曲线膝点'>
|
||||
<div>
|
||||
<div>
|
||||
<el-input-number v-model="form.num" controls-position="right" />
|
||||
<span class="ml10" style="color: #333">p.u.</span>
|
||||
<el-input-number v-model='unit.vtcAmpLower' controls-position='right' />
|
||||
<span class='ml10' style='color: #333'>p.u.</span>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<el-input-number v-model="form.num" controls-position="right" />
|
||||
<span class="ml10" style="color: #333">ms</span>
|
||||
<div class='mt10'>
|
||||
<el-input-number v-model='unit.vtcTimeLower' controls-position='right' />
|
||||
<span class='ml10' style='color: #333'>ms</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="flex: 1" class="ml10">
|
||||
<MyEchart :options="options" v-if="options"></MyEchart>
|
||||
<div style='flex: 1' class='ml10'>
|
||||
<MyEchart :options='options' v-if='options'></MyEchart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SecondSheet>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
<script lang='ts' setup>
|
||||
import SecondSheet from '@/components/secondSheet/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { reactive, ref } from 'vue'
|
||||
const options = ref({
|
||||
legend: {
|
||||
data: ['越限事件', '未越限事件', '不确定事件'],
|
||||
left: '10px'
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function (a: any) {
|
||||
if (a[0].value[4] == undefined) {
|
||||
return
|
||||
}
|
||||
import { querySgProductLineByUserId } from '@/api/advance-boot/sgGroven/sgProductLine'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { querySgMachineByProductLineId } from '@/api/advance-boot/sgGroven/sgMachine'
|
||||
import { queryUnitByMachineId } from '@/api/advance-boot/sgGroven/sgSensitiveUnit'
|
||||
import { getEventDataByProductLineId } from '@/api/advance-boot/sgGroven/sgEvent'
|
||||
|
||||
|
||||
const searchBeginTime = ref()
|
||||
const searchEndTime = ref()
|
||||
const userId = ref()
|
||||
|
||||
let relVal = ''
|
||||
relVal = "<font style='color:" + "'>供电公司:" + ' ' + ' ' + a[0].value[3] + '</font><br/>'
|
||||
relVal += "<font style='color:" + "'>变电站:" + ' ' + ' ' + a[0].value[4] + '</font><br/>'
|
||||
relVal += "<font style='color:" + "'>发生时刻:" + ' ' + ' ' + a[0].value[2] + '</font><br/>'
|
||||
relVal +=
|
||||
"<font style='color:" + "'>持续时间:" + ' ' + ' ' + a[0].value[0].toFixed(3) + 's</font><br/>'
|
||||
relVal += "<font style='color:" + "'>特征幅值:" + ' ' + ' ' + a[0].value[1].toFixed(3) + '%</font>'
|
||||
return relVal
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
name: '持续时间\n ms',
|
||||
type: 'log',
|
||||
min: '0.001',
|
||||
max: '1000',
|
||||
splitLine: { show: false }
|
||||
},
|
||||
yAxis: {
|
||||
name: '幅值/p.u.',
|
||||
splitNumber: 10,
|
||||
minInterval: 3
|
||||
},
|
||||
grid: {
|
||||
right: '70px'
|
||||
},
|
||||
color: ['#ff0000', '#ff0000', '#2f4554', '#61a0a8', '#d48265'],
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
data: [
|
||||
// [0.001, 200],
|
||||
[0.003, 0],
|
||||
[0.003, 110],
|
||||
// [0.5, 120],
|
||||
// [0.5, 110],
|
||||
// [10, 110],
|
||||
[1000, 110]
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
data: [
|
||||
[0.02, 0],
|
||||
[0.02, 90],
|
||||
// [0.5, 70],
|
||||
// [0.5, 80],
|
||||
// [10, 80],
|
||||
// [10, 90],
|
||||
[1000, 90]
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '越限事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
value: [
|
||||
7.795,
|
||||
94,
|
||||
'2024-03-27 20:46:53.319',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'00ea8d9bab92f5edcec72fec87bda760'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#2f4554'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
7.846,
|
||||
92,
|
||||
'2024-03-17 12:51:54.520',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'01497b699e36624f14f0db879d52cb8a'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#2f4554'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
0.047,
|
||||
89,
|
||||
'2024-03-26 07:39:44.114',
|
||||
'长兴市',
|
||||
'古茶山',
|
||||
'c63a677b0f6fdd667d1305938f04a052',
|
||||
'017fae8ed5310bb39ce09442951fe868'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#2f4554'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
0.064,
|
||||
89,
|
||||
'2024-03-23 20:42:02.339',
|
||||
'淮安市',
|
||||
'淮安荣芯半导体公司',
|
||||
'c8b1c708164f4e69837835d623464f71',
|
||||
'01909672630cec80b36d9de81d6de8a6'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#2f4554'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
0.059,
|
||||
86,
|
||||
'2024-03-01 07:28:37.000',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'b4c1f4657462669ed4205b3c9ec27715',
|
||||
'01ddfd3d-d863-4b32-ba9c-270bca5464ac'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#2f4554'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
8.026,
|
||||
94,
|
||||
'2024-03-19 08:02:40.363',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'028cb780851f0dbf42d77deb2288e6ae'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#2f4554'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '未越限事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
value: [
|
||||
7.795,
|
||||
134,
|
||||
'2024-03-27 20:46:53.319',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'00ea8d9bab92f5edcec72fec87bda760'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#61a0a8'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
7.846,
|
||||
134,
|
||||
'2024-03-17 12:51:54.520',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'01497b699e36624f14f0db879d52cb8a'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#61a0a8'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
0.047,
|
||||
134,
|
||||
'2024-03-26 07:39:44.114',
|
||||
'长兴市',
|
||||
'古茶山',
|
||||
'c63a677b0f6fdd667d1305938f04a052',
|
||||
'017fae8ed5310bb39ce09442951fe868'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#61a0a8'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
0.064,
|
||||
134,
|
||||
'2024-03-23 20:42:02.339',
|
||||
'淮安市',
|
||||
'淮安荣芯半导体公司',
|
||||
'c8b1c708164f4e69837835d623464f71',
|
||||
'01909672630cec80b36d9de81d6de8a6'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#61a0a8'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
0.059,
|
||||
134,
|
||||
'2024-03-01 07:28:37.000',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'b4c1f4657462669ed4205b3c9ec27715',
|
||||
'01ddfd3d-d863-4b32-ba9c-270bca5464ac'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#61a0a8'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
8.026,
|
||||
134,
|
||||
'2024-03-19 08:02:40.363',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'028cb780851f0dbf42d77deb2288e6ae'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#61a0a8'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '不确定事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
value: [
|
||||
17.795,
|
||||
134,
|
||||
'2024-03-27 20:46:53.319',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'00ea8d9bab92f5edcec72fec87bda760'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d48265'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
17.846,
|
||||
134,
|
||||
'2024-03-17 12:51:54.520',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'01497b699e36624f14f0db879d52cb8a'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d48265'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
1.047,
|
||||
134,
|
||||
'2024-03-26 07:39:44.114',
|
||||
'长兴市',
|
||||
'古茶山',
|
||||
'c63a677b0f6fdd667d1305938f04a052',
|
||||
'017fae8ed5310bb39ce09442951fe868'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d48265'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
1.064,
|
||||
134,
|
||||
'2024-03-23 20:42:02.339',
|
||||
'淮安市',
|
||||
'淮安荣芯半导体公司',
|
||||
'c8b1c708164f4e69837835d623464f71',
|
||||
'01909672630cec80b36d9de81d6de8a6'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d48265'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
1.059,
|
||||
134,
|
||||
'2024-03-01 07:28:37.000',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'b4c1f4657462669ed4205b3c9ec27715',
|
||||
'01ddfd3d-d863-4b32-ba9c-270bca5464ac'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d48265'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
18.026,
|
||||
134,
|
||||
'2024-03-19 08:02:40.363',
|
||||
'南通市',
|
||||
'南通象屿海洋装备有限责任公司',
|
||||
'cc297ca8575101e3e6c5dfc609eb1c1c',
|
||||
'028cb780851f0dbf42d77deb2288e6ae'
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d48265'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
options: {
|
||||
dataZoom: null
|
||||
}
|
||||
})
|
||||
const form = reactive({
|
||||
name: '',
|
||||
num: 1
|
||||
num: 1,
|
||||
productLineId: '',
|
||||
machineId: '',
|
||||
unitId: ''
|
||||
})
|
||||
const selectOptions = [
|
||||
{
|
||||
value: 'Option1',
|
||||
label: 'Option1'
|
||||
},
|
||||
{
|
||||
value: 'Option2',
|
||||
label: 'Option2'
|
||||
},
|
||||
{
|
||||
value: 'Option3',
|
||||
label: 'Option3'
|
||||
},
|
||||
{
|
||||
value: 'Option4',
|
||||
label: 'Option4'
|
||||
},
|
||||
{
|
||||
value: 'Option5',
|
||||
label: 'Option5'
|
||||
}
|
||||
]
|
||||
const search = () => {
|
||||
const productLineOptions = ref()
|
||||
const machineOptions = ref()
|
||||
const unitOptions = ref()
|
||||
const unit = ref({
|
||||
'vtcTimeUpper': 0,
|
||||
'vtcAmpUpper': 0,
|
||||
'vtcTimeLower': 0,
|
||||
'vtcAmpLower': 0
|
||||
})
|
||||
const overEvent = ref([])
|
||||
const unOverEvent = ref([])
|
||||
const unKnownEvent = ref([])
|
||||
const overEventColor = ref('#A52a2a')
|
||||
const unOverEventColor = ref('#61a0a8')
|
||||
const unKnownEventColor = ref('#d48265')
|
||||
const search = async (id: string, beginTime: string, endTime: string) => {
|
||||
// 从父组件tableStore获取参数
|
||||
searchBeginTime.value = beginTime
|
||||
searchEndTime.value = endTime
|
||||
userId.value = id
|
||||
//根据用户id获取到生产线下拉框、再根据生产线下拉框获取生产线下的设备下拉,再根据设备获取下拉的敏感元器件的下拉
|
||||
await querySgProductLineByUserId(id).then((res: any) => {
|
||||
productLineOptions.value = res.data
|
||||
form.productLineId = productLineOptions.value[0].id
|
||||
})
|
||||
|
||||
//根据生产线获取设备数据
|
||||
await querySgMachineByProductLineId(form.productLineId).then((res: any) => {
|
||||
machineOptions.value = res.data
|
||||
if (machineOptions.value.length > 0) {
|
||||
form.machineId = machineOptions.value[0].id
|
||||
}
|
||||
})
|
||||
|
||||
//根据设备获取元器件数据
|
||||
await queryUnitByMachineId(form.machineId).then((res: any) => {
|
||||
unitOptions.value = res.data
|
||||
if (unitOptions.value.length > 0) {
|
||||
form.unitId = unitOptions.value[0].id
|
||||
unit.value = unitOptions.value[0]
|
||||
}
|
||||
})
|
||||
|
||||
const data = {
|
||||
searchBeginTime: beginTime,
|
||||
searchEndTime: endTime,
|
||||
productId: form.productLineId
|
||||
}
|
||||
|
||||
await getEventDataByProductLineId(data).then((res: any) => {
|
||||
//清洗要显示的数据
|
||||
if (res.data.length > 0) {
|
||||
for (let event of res.data) {
|
||||
//判断落在哪个区域内
|
||||
let eventTime = Number(event.duration) / 1000
|
||||
let eventAmplitude = Number(event.featureAmplitude)
|
||||
if (eventTime < Number(unit.value.vtcTimeUpper/1000) || eventAmplitude > Number(unit.value.vtcAmpUpper)) {
|
||||
//未越限
|
||||
const dataTemp = {
|
||||
value: [
|
||||
eventTime,
|
||||
eventAmplitude,
|
||||
event.startTime,
|
||||
event.incomingLineName
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: unOverEventColor.value
|
||||
}
|
||||
}
|
||||
}
|
||||
unOverEvent.value.push(dataTemp)
|
||||
} else if (eventTime > Number(unit.value.vtcTimeLower/1000) && eventAmplitude < Number(unit.value.vtcAmpLower)) {
|
||||
//故障阶段
|
||||
const dataTemp = {
|
||||
value: [
|
||||
eventTime,
|
||||
eventAmplitude,
|
||||
event.startTime,
|
||||
event.incomingLineName
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: overEventColor.value
|
||||
}
|
||||
}
|
||||
}
|
||||
overEvent.value.push(dataTemp)
|
||||
} else {
|
||||
//不确定事件
|
||||
const dataTemp = {
|
||||
value: [
|
||||
eventTime,
|
||||
eventAmplitude,
|
||||
event.startTime,
|
||||
event.incomingLineName
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: unKnownEventColor.value
|
||||
}
|
||||
}
|
||||
}
|
||||
unKnownEvent.value.push(dataTemp)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
//初始化图表
|
||||
initOptions()
|
||||
}
|
||||
|
||||
const options = ref()
|
||||
const initOptions = () => {
|
||||
options.value = {
|
||||
legend: {
|
||||
data: ['越限事件', '未越限事件', '不确定事件'],
|
||||
left: '10px'
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function(a: any) {
|
||||
if (a[0].value[3] == undefined) {
|
||||
return
|
||||
}
|
||||
let relVal = ''
|
||||
relVal += '<font style=\'color:' + '\'>进线:' + ' ' + ' ' + a[0].value[3] + '</font><br/>'
|
||||
relVal += '<font style=\'color:' + '\'>发生时刻:' + ' ' + ' ' + a[0].value[2] + '</font><br/>'
|
||||
relVal += '<font style=\'color:' + '\'>持续时间:' + ' ' + ' ' + a[0].value[0].toFixed(2) + 's</font><br/>'
|
||||
relVal += '<font style=\'color:' + '\'>特征幅值:' + ' ' + ' ' + a[0].value[1] + 'p.u.</font>'
|
||||
return relVal
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
name: '持续时间/s',
|
||||
type: 'log',
|
||||
min: '0.001',
|
||||
max: '1000',
|
||||
splitLine: { show: false }
|
||||
},
|
||||
yAxis: {
|
||||
name: '幅值/p.u.',
|
||||
max: 1,
|
||||
min: 0
|
||||
},
|
||||
grid: {
|
||||
right: '70px'
|
||||
},
|
||||
color: ['#ff0000', '#ff0000', '#A52a2a', '#61a0a8', '#d48265'],
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
data: [
|
||||
[unit.value.vtcTimeUpper / 1000, 0],
|
||||
[unit.value.vtcTimeUpper / 1000, unit.value.vtcAmpUpper],
|
||||
[1000, unit.value.vtcAmpUpper]
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
data: [
|
||||
[unit.value.vtcTimeLower / 1000, 0],
|
||||
[unit.value.vtcTimeLower / 1000, unit.value.vtcAmpLower],
|
||||
[1000, unit.value.vtcAmpLower]
|
||||
],
|
||||
showSymbol: false,
|
||||
tooltips: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '越限事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
data: overEvent.value
|
||||
},
|
||||
{
|
||||
name: '未越限事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
data: unOverEvent.value
|
||||
},
|
||||
{
|
||||
name: '不确定事件',
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
data: unKnownEvent.value
|
||||
}
|
||||
],
|
||||
options: {
|
||||
dataZoom: null
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ search })
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang='scss' scoped>
|
||||
.tolerance-curve {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -518,4 +323,12 @@ defineExpose({ search })
|
||||
padding: 10px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
.el-form-item__label-wrap {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
width: 185px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
v-model="incomingDialogVisible"
|
||||
:title="title"
|
||||
style="width: 415px; height: 300px"
|
||||
top="30vh"
|
||||
>
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
@@ -31,13 +30,15 @@
|
||||
import { ref, inject, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { addSgIncomingLine, updateSgIncomingLine } from '@/api/advance-boot/sgGroven/incomingLine' // 若不是列表页面弹框可删除
|
||||
import { addSgIncomingLine, lineOptionList, updateSgIncomingLine } from '@/api/advance-boot/sgGroven/incomingLine'
|
||||
import { sgUserList } from '@/api/advance-boot/sgGroven/sgUser' // 若不是列表页面弹框可删除
|
||||
const incomingDialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const formRef = ref()
|
||||
|
||||
const lineList = reactive([
|
||||
|
||||
const lineList = ref([
|
||||
{
|
||||
id: '123456',
|
||||
name: '测试1号线'
|
||||
@@ -71,7 +72,7 @@ const resetForm = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const open = (text: string, data: any) => {
|
||||
const open =async (text: string, data: any) => {
|
||||
title.value = text
|
||||
//默认选中第一个tab
|
||||
incomingDialogVisible.value = true
|
||||
@@ -88,6 +89,9 @@ const open = (text: string, data: any) => {
|
||||
}
|
||||
}
|
||||
form.userId = data.userId
|
||||
await lineOptionList().then(res => {
|
||||
lineList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
const submit = () => {
|
||||
|
||||
@@ -2,67 +2,67 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
draggable
|
||||
class="cn-operate-dialog"
|
||||
v-model="unitVisible"
|
||||
:title="title"
|
||||
style="width: 415px; height: 500px"
|
||||
top="10vh"
|
||||
class='cn-operate-dialog'
|
||||
v-model='unitVisible'
|
||||
:title='title'
|
||||
style='width: 415px; height: 500px'
|
||||
top='20vh'
|
||||
>
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="135px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="元器件名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入元器件名" clearable />
|
||||
<el-form :inline='false' :model='form' label-width='135px' :rules='rules' ref='formRef'>
|
||||
<el-form-item label='元器件名' prop='name'>
|
||||
<el-input v-model='form.name' placeholder='请输入元器件名' clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="灵敏度" prop="sensitivity">
|
||||
<el-select v-model="form.sensitivity">
|
||||
<el-form-item label='灵敏度' prop='sensitivity'>
|
||||
<el-select v-model='form.sensitivity'>
|
||||
<el-option
|
||||
v-for="item in sensitivityList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
v-for='item in sensitivityList'
|
||||
:key='item.value'
|
||||
:label='item.name'
|
||||
:value='item.value'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="耐受能力是否标准" prop="standardFlag">
|
||||
<el-radio-group v-model="form.standardFlag">
|
||||
<el-radio border label="1">是</el-radio>
|
||||
<el-radio border label="0">否</el-radio>
|
||||
<el-form-item label='耐受能力是否标准' prop='standardFlag'>
|
||||
<el-radio-group v-model='form.standardFlag'>
|
||||
<el-radio border label='1'>是</el-radio>
|
||||
<el-radio border label='0'>否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="上限-持续时间" prop="vtcTimeUpper">
|
||||
<el-input v-model="form.vtcTimeUpper" placeholder="请输入持续时间" clearable>
|
||||
<el-form-item label='上限-持续时间' prop='vtcTimeUpper'>
|
||||
<el-input v-model='form.vtcTimeUpper' placeholder='请输入持续时间' clearable>
|
||||
<template #append>ms</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="上限-暂降幅值" prop="vtcAmpUpper">
|
||||
<el-input v-model="form.vtcAmpUpper" placeholder="请输入暂降幅值" clearable>
|
||||
<el-form-item label='上限-暂降幅值' prop='vtcAmpUpper'>
|
||||
<el-input v-model='form.vtcAmpUpper' placeholder='请输入暂降幅值' clearable>
|
||||
<template #append>p.u.</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下限-持续时间" prop="vtcTimeLower">
|
||||
<el-input v-model="form.vtcTimeLower" placeholder="请输入持续时间" clearable>
|
||||
<el-form-item label='下限-持续时间' prop='vtcTimeLower'>
|
||||
<el-input v-model='form.vtcTimeLower' placeholder='请输入持续时间' clearable>
|
||||
<template #append>ms</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下限-暂降幅值" prop="vtcAmpLower">
|
||||
<el-input v-model="form.vtcAmpLower" placeholder="请输入暂降幅值" clearable>
|
||||
<el-form-item label='下限-暂降幅值' prop='vtcAmpLower'>
|
||||
<el-input v-model='form.vtcAmpLower' placeholder='请输入暂降幅值' clearable>
|
||||
<template #append>p.u.</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="unitVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
<span class='dialog-footer'>
|
||||
<el-button @click='unitVisible = false'>取消</el-button>
|
||||
<el-button type='primary' @click='submit'>确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
<script lang='ts' setup>
|
||||
import { ref, reactive, inject } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
@@ -105,6 +105,38 @@ const form = reactive({
|
||||
vtcAmpLower: 0
|
||||
})
|
||||
|
||||
//校验持续时间
|
||||
const checkTime = (rule: any, value: any, callback: any) => {
|
||||
if (!value) {
|
||||
return callback(new Error('持续时间不能为空'))
|
||||
}
|
||||
if (isNaN(value)) {
|
||||
callback(new Error('请输入有效的数值'))
|
||||
} else {
|
||||
if (value < 0) {
|
||||
callback(new Error('持续时间不能小于0'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//校验幅值
|
||||
const checkAmp = (rule: any, value: any, callback: any) => {
|
||||
if (!value) {
|
||||
return callback(new Error('暂降幅值不能为空'))
|
||||
}
|
||||
if (isNaN(value)) {
|
||||
callback(new Error('请输入有效的数值'))
|
||||
} else {
|
||||
if (value < 0 || value > 1.5) {
|
||||
callback(new Error('请确保暂降幅值范围0p.u.~1.5p.u.'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//form表单校验规则
|
||||
const rules = {
|
||||
name: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
|
||||
@@ -112,19 +144,19 @@ const rules = {
|
||||
standardFlag: [{ required: true, message: '耐受能力不能为空', trigger: 'change' }],
|
||||
vtcTimeUpper: [
|
||||
{ required: true, message: '持续时间不能为空', trigger: 'blur' },
|
||||
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
{ validator: checkTime, trigger: 'blur' }
|
||||
],
|
||||
vtcAmpUpper: [
|
||||
{ required: true, message: '暂降幅值不能为空', trigger: 'blur' },
|
||||
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
{ validator: checkAmp, trigger: 'blur' }
|
||||
],
|
||||
vtcTimeLower: [
|
||||
{ required: true, message: '持续时间不能为空', trigger: 'blur' },
|
||||
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
{ validator: checkTime, trigger: 'blur' }
|
||||
],
|
||||
vtcAmpLower: [
|
||||
{ required: true, message: '暂降幅值不能为空', trigger: 'blur' },
|
||||
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
|
||||
{ validator: checkAmp, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -175,6 +207,7 @@ const submit = () => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import UnitPopup from '@/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitPopup.vue'
|
||||
import { deleteSgSensitiveUnit } from '@/api/advance-boot/sgGroven/sgSensitiveUnit'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const unitPopup = ref()
|
||||
|
||||
@@ -99,10 +101,10 @@ const tableStore = new TableStore({
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
// deleteSgMachine(row.id).then(res => {
|
||||
// ElMessage.success('删除成功')
|
||||
// tableStore.index()
|
||||
// })
|
||||
deleteSgSensitiveUnit(row.id).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -125,6 +125,7 @@ const resetForm = () => {
|
||||
}
|
||||
|
||||
const open = (text: string, data?: anyObj) => {
|
||||
console.log(data)
|
||||
tab.value = 'user'
|
||||
title.value = text
|
||||
//默认选中第一个tab
|
||||
@@ -150,6 +151,7 @@ const open = (text: string, data?: anyObj) => {
|
||||
for (let key in form) {
|
||||
form[key] = ''
|
||||
}
|
||||
userLogo.url = ''
|
||||
form.keyUser = '1'
|
||||
}
|
||||
}
|
||||
@@ -159,7 +161,6 @@ const open = (text: string, data?: anyObj) => {
|
||||
*/
|
||||
const reValueAddr = () => {
|
||||
form.addrStrOption = form.addr.join('/')
|
||||
console.log(form.addrStrOption)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,18 +201,25 @@ const submit = () => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
if (form.id) {
|
||||
form.addrStrOption = form.addr.join('/')
|
||||
await updateSgUser(form)
|
||||
ElMessage.success('更新成功')
|
||||
tableStore.index()
|
||||
//切到进线处
|
||||
dialogVisible.value = false
|
||||
} else {
|
||||
await addSgUser(form).then(res => {
|
||||
form.id = res.data
|
||||
//查询进线数据,避免一直处于loading状态
|
||||
incomingTable.value.getTableData(form.id)
|
||||
ElMessage.success('保存成功')
|
||||
tableStore.index()
|
||||
//切到进线处
|
||||
tab.value='incomingLine'
|
||||
dialogVisible.value = true
|
||||
})
|
||||
}
|
||||
ElMessage.success('保存成功')
|
||||
console.log(form)
|
||||
tableStore.index()
|
||||
dialogVisible.value = true
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
79
src/views/pqs/voltageSags/sagGovern/scheme/history/index.vue
Normal file
79
src/views/pqs/voltageSags/sagGovern/scheme/history/index.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<!--治理方案计算结果详情页展示-->
|
||||
<template>
|
||||
<div ref='governTotalContent' class='governTotalContentDiv'>
|
||||
<!--返回按钮-->
|
||||
<back-component :custom='true'/>
|
||||
<div class='schemeNav'>
|
||||
<el-radio-group v-model='radio' >
|
||||
<el-radio-button label='评估计算结果' />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class='schemeContent' ref='schemeContent'>
|
||||
<scheme-result v-show='radio=="评估计算结果"' />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import SchemeResult from '@/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/schemeResult.vue'
|
||||
import BackComponent from '@/components/icon/back/index.vue'
|
||||
import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { schemeDetail } from '@/api/advance-boot/sgGroven/sgScheme'
|
||||
import emitter from '@/utils/emitter'
|
||||
|
||||
const governTotalContent = ref()
|
||||
const schemeContent = ref()
|
||||
const radio = ref('待计算结果')
|
||||
|
||||
const { query } = useRoute()
|
||||
|
||||
onMounted(() => {
|
||||
governTotalContent.value.style.height = mainHeight().height
|
||||
schemeContent.value.style.height = mainHeight(45).height
|
||||
schemeContent.value.style.maxheight = mainHeight(45).height
|
||||
schemeContent.value.style.overflowY = 'scroll'
|
||||
schemeContent.value.style.overflowX = 'hidden'
|
||||
})
|
||||
|
||||
//根据治理历史的id查询出此次方案的参数、结果便于数据回显
|
||||
const getHistoryData = async () => {
|
||||
await schemeDetail(query.id).then(res => {
|
||||
//先通知父组件打开历史页面
|
||||
radio.value = '评估计算结果'
|
||||
//再将历史数据传递到历史页面
|
||||
emitter.emit('send-scheme-result', res.data)
|
||||
})
|
||||
}
|
||||
|
||||
getHistoryData()
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.governTotalContentDiv {
|
||||
background-clip: content-box;
|
||||
display: -webkit-flex; /* Safari */
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.schemeNav {
|
||||
height: 55px;
|
||||
background: #FFFFFF;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.schemeContent {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -20,7 +20,8 @@
|
||||
</TableHeader>
|
||||
<!--表格-->
|
||||
<Table ref='tableRef' isGroup></Table>
|
||||
|
||||
<!--弹出表格-->
|
||||
<machine-detail-popup ref='machineDetailTable' />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -32,35 +33,54 @@ import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { onMounted, provide, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { deleteSgUser, sgUserList } from '@/api/advance-boot/sgGroven/sgUser'
|
||||
import { sgUserList } from '@/api/advance-boot/sgGroven/sgUser'
|
||||
import { deleteSgScheme } from '@/api/advance-boot/sgGroven/sgScheme'
|
||||
|
||||
import machineDetailPopup from '@/views/pqs/voltageSags/sagGovern/scheme/machineDetailPopup.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'governSchemeHistory'
|
||||
})
|
||||
|
||||
const machineDetailTable = ref()
|
||||
const machineDetailData = ref()
|
||||
const { push } = useRouter()
|
||||
const userListData: any = ref([])
|
||||
// const showPower = (id: string) => {
|
||||
// alert(id)
|
||||
// }
|
||||
|
||||
window.showPower = function(id: string) {
|
||||
//根据生产线查询该生产线下的所有设备数据
|
||||
machineDetailTable.value.open('设备容量信息', id)
|
||||
}
|
||||
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/advance-boot/sgUser/list',
|
||||
url: '/advance-boot/sagGovernScheme/list',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '序号', type: 'seq', width: 80 },
|
||||
{ title: '用户', field: 'userName' },
|
||||
{ title: '生产线名称', field: 'productLineName' },
|
||||
{ title: '期望回报周期', field: 'payBackPeriod' },
|
||||
{ title: '数据时间范围', field: 'timeScope' },
|
||||
{ title: '治理容量', field: 'governPower' },
|
||||
{ title: '用户', field: 'userName', width: 160 },
|
||||
{ title: '生产线名称', field: 'productLineName', width: 160 },
|
||||
{ title: '期望回报(年)', field: 'payBackPeriod', width: 150 },
|
||||
{ title: '数据时间范围', field: 'timeScope', width: 170 },
|
||||
{
|
||||
title: '治理容量(kW)', field: 'governPower', width: 150, type: 'html',
|
||||
formatter: (obj: any) => {
|
||||
const val = obj.row.governPower
|
||||
const id = obj.row.productLineId
|
||||
return `<a href='javascript:void(0);' style='color: #409EFF;text-decoration: none' onclick='window.showPower("${id}")'>${val}</a>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '最佳方案',
|
||||
children: [
|
||||
{
|
||||
title: '方案名称', width: '110', field: 'schemeType',
|
||||
formatter: (row: any) => {
|
||||
formatter: (obj: any) => {
|
||||
let temp
|
||||
switch (row.schemeType) {
|
||||
switch (obj.row.schemeType) {
|
||||
case 1:
|
||||
temp = 'AVC'
|
||||
break
|
||||
@@ -76,16 +96,22 @@ const tableStore = new TableStore({
|
||||
return temp
|
||||
}
|
||||
},
|
||||
{ title: '初期投资(万元)', width: '110', field: 'initialInvest' },
|
||||
{ title: '投资回收期', width: '110', field: 'payBackYear' },
|
||||
{ title: '治理效果(万元/年)', width: '110', field: 'governEffectMoney' }
|
||||
{
|
||||
title: '初期投资(万元)', width: '150', field: 'initialInvest',
|
||||
formatter: (obj: any) => {
|
||||
return Number(obj.row.schemeEquipment) + Number(obj.row.schemeMaintain)
|
||||
}
|
||||
},
|
||||
{ title: '投资回收期(年)', width: '150', field: 'payBackYear' },
|
||||
{ title: '治理效果(万元/年)', width: '150', field: 'governEffect' }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '150',
|
||||
minWidth: '150',
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
@@ -94,7 +120,7 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
push(`/admin/businessUserRouter/productLine?id=${row.id}`)
|
||||
push(`/admin/sagGovernScheme/schemeHistory?id=${row.id}`)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -110,7 +136,7 @@ const tableStore = new TableStore({
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
deleteSgUser(row.id).then(res => {
|
||||
deleteSgScheme(row.id).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
@@ -132,6 +158,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<!--设备的新增编辑弹出框-->
|
||||
<template>
|
||||
<el-dialog class='cn-operate-dialog' v-model='machineVisible' :title='title' style='width: 415px;height: 400px'
|
||||
top='30vh'>
|
||||
<el-scrollbar>
|
||||
<el-table :data='tableData' border style='width: 100%'
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
:height='250'
|
||||
:header-cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop='name' label='设备名称' width='180' />
|
||||
<el-table-column prop='machinePower' label='设备容量(kW)' width='180' />
|
||||
</el-table>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<span class='dialog-footer'>
|
||||
<el-button type='primary' @click='machineVisible = false'>确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang='ts' setup>
|
||||
import { ref } from 'vue'
|
||||
import { listMachine } from '@/api/advance-boot/sgGroven/sgMachine'
|
||||
|
||||
const machineVisible = ref(false)
|
||||
const title = ref('')
|
||||
const tableData = ref()
|
||||
|
||||
//弹出界面,默认选择用户的第一个生产线的第一条进线进行数据导入
|
||||
const open = async (text: string, id: string) => {
|
||||
title.value = text
|
||||
machineVisible.value = true
|
||||
await listMachine(id).then(res => {
|
||||
tableData.value = res.data.records
|
||||
})
|
||||
}
|
||||
|
||||
/************针对tab切换*************/
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cn-operate-dialog .cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@
|
||||
<!--基础数据-->
|
||||
<div class='singleParamContent'>
|
||||
<el-divider content-position='left' class='divider'>
|
||||
<span class='dividerFontStyle'>基本信息</span>
|
||||
<span class='dividerFontStyle'>基础信息</span>
|
||||
</el-divider>
|
||||
<el-row>
|
||||
<el-col :span='7'>
|
||||
@@ -32,7 +32,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span='9'>
|
||||
<el-col :span='8'>
|
||||
<el-button style='height: 72px;position: absolute;right: 0;' type='primary' @click='calcSag'>开始评估
|
||||
</el-button>
|
||||
</el-col>
|
||||
@@ -49,7 +49,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12' :offset='1'>
|
||||
<el-col :span='13' :offset='1'>
|
||||
<el-form-item label='参考数据范围' style='grid-column: span 2; max-width: unset'>
|
||||
<date-picker ref='datePickerRef'></date-picker>
|
||||
</el-form-item>
|
||||
@@ -226,7 +226,7 @@
|
||||
v-model='form.quick.buildFee'
|
||||
clearable
|
||||
>
|
||||
<template #append>kVA</template>
|
||||
<template #append>万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -283,6 +283,7 @@ const userListData: any = ref([])
|
||||
const productLineData: any = ref([])
|
||||
const incomingLineListData: any = ref([])
|
||||
|
||||
|
||||
// 注意不要和表单ref的命名冲突
|
||||
let form = reactive({
|
||||
userId: '',
|
||||
@@ -448,7 +449,7 @@ const initUserData = async () => {
|
||||
await querySgIncomingLineByUserId(form.userId).then(res => {
|
||||
if (res.data && res.data.length > 0) {
|
||||
//将当前生产线的进线过滤掉,剩余的交给备用进行选择
|
||||
let allIncomingLineData = res.data.filter((obj: any) => obj.incomingLineId !== productLineOwnIncomingLineId.value)
|
||||
let allIncomingLineData = res.data.filter((obj: any) => obj.id !== productLineOwnIncomingLineId.value)
|
||||
if (allIncomingLineData.length > 0) {
|
||||
form.quick.incomingLineId = allIncomingLineData[0].id
|
||||
incomingLineListData.value = allIncomingLineData
|
||||
@@ -472,6 +473,7 @@ const initUserData = async () => {
|
||||
*/
|
||||
onMounted(() => {
|
||||
initUserData()
|
||||
datePickerRef.value.setInterval(1)
|
||||
form.startTime = datePickerRef.value.timeValue[0]
|
||||
form.endTime = datePickerRef.value.timeValue[1]
|
||||
})
|
||||
@@ -489,6 +491,7 @@ function calcSag() {
|
||||
await calc(form).then(res => {
|
||||
//先通知父组件打开历史页面
|
||||
emitter.emit('schemeRadio', '评估计算结果')
|
||||
emitter.emit('calcResult', false)
|
||||
//再将历史数据传递到历史页面
|
||||
emitter.emit('send-scheme-result', res.data)
|
||||
})
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
<template>
|
||||
<div ref='governTotalContent' class='governTotalContentDiv'>
|
||||
<!--返回按钮-->
|
||||
<back-component />
|
||||
<back-component :custom='true'/>
|
||||
<!--切换radio的导航-->
|
||||
<div class='schemeNav'>
|
||||
<el-radio-group v-model='radio'>
|
||||
<el-radio-button label='治理评估准备' />
|
||||
<el-radio-button label='评估计算结果' />
|
||||
<el-radio-group v-model='radio' >
|
||||
<el-radio-button label='治理评估准备' />
|
||||
<el-radio-button label='评估计算结果' :disabled='calcResult' />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class='schemeContent' ref='schemeContent'>
|
||||
|
||||
<calc-param v-show='radio=="治理评估准备"' :user-id='query.userId' />
|
||||
<scheme-result v-show='radio=="评估计算结果"' />
|
||||
</div>
|
||||
@@ -31,24 +30,29 @@ const { query } = useRoute()
|
||||
const governTotalContent = ref()
|
||||
const schemeContent = ref()
|
||||
const radio = ref('治理评估准备')
|
||||
const calcResult = ref(true)
|
||||
|
||||
emitter.on('schemeRadio', (value: strig) => {
|
||||
emitter.on('schemeRadio', (value: string) => {
|
||||
radio.value = value
|
||||
})
|
||||
|
||||
emitter.on('calcResult', (value: boolean) => {
|
||||
calcResult.value = value
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
governTotalContent.value.style.height = mainHeight().height
|
||||
schemeContent.value.style.height = mainHeight(75).height
|
||||
schemeContent.value.style.maxheight = mainHeight(75).height
|
||||
schemeContent.value.style.overflowY = 'scroll'
|
||||
// form.startTime = datePickerRef.value.timeValue[0]
|
||||
// form.endTime = datePickerRef.value.timeValue[1]
|
||||
schemeContent.value.style.overflowX = 'hidden'
|
||||
})
|
||||
|
||||
//解绑数据监听
|
||||
onUnmounted(() => {
|
||||
// 解绑事件
|
||||
emitter.off('schemeRadio')
|
||||
emitter.off('calcResult')
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -62,7 +66,7 @@ onUnmounted(() => {
|
||||
flex-wrap: wrap;
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.schemeNav {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user