暂降治理评估

This commit is contained in:
2024-03-28 13:25:41 +08:00
parent 45ba496361
commit 965b18b540
44 changed files with 2748 additions and 1108 deletions

View File

@@ -27,3 +27,19 @@ npm run dev
* todo...:待后续补充。
#### 开发助手
##### 1、表格系列
* 页面表格以及表格页面按钮的弹出等功能参考:/views/pqs/voltageSags/sagGovern/index.vue
* 表格中需要替换数据:
```js
// 通过formatter函数返回实际需要返回的值
{
title: '数据来源', field: 'dataSource', minWidth: '130',
formatter: (row: any) => {
return row.dataSource == 0 ? '离线导入' : '监测点同步'
}
}
```
##### 2、样式系列
* 获取当前主体的高度import { mainHeight } from '@/utils/layout'

View File

@@ -3,7 +3,18 @@ import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 新增业务用户
* 查询进线数据
*/
export const querySgIncomingLineByUserId = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgIncomingLine/list?userId=' + data,
method: 'GET'
})
}
/**
* 新增进线
*/
export const addSgIncomingLine = (data: any) => {
return createAxios({
@@ -15,7 +26,7 @@ export const addSgIncomingLine = (data: any) => {
/**
* 更新业务用户
* 更新进线
*/
export const updateSgIncomingLine = (data: any) => {
return createAxios({
@@ -27,7 +38,7 @@ export const updateSgIncomingLine = (data: any) => {
/**
* 删除业务用户
* 删除进线
*/
export const deleteSgIncomingLine = (data: any) => {
let ids = [data]

View File

@@ -0,0 +1,65 @@
import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 导出暂降模板
*/
export const downloadTemplate = () => {
return createAxios({
url: ADVANCE_BOOT + '/sgEvent/downloadTemplate',
method: 'GET',
responseType: 'blob'
})
}
/**
* 导出暂降数据
*/
export const exportEventData = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgEvent/exportEventData',
method: 'GET',
data: data,
responseType: 'blob'
})
}
/**
* 新增业务用户
*/
export const importEventData = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgEvent/importEventData',
method: 'POST',
data: data
})
}
/**
* 更新业务用户
*/
export const updateSgEvent = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgEvent/update',
method: 'POST',
data: data
})
}
/**
* 删除业务用户
*/
export const deleteSgEvent = (data: any) => {
let ids = [data]
return createAxios({
url: ADVANCE_BOOT + '/sgEvent/delete',
method: 'POST',
data: ids
})
}

View File

@@ -0,0 +1,40 @@
import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 新增设备
*/
export const addSgMachine = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgMachine/add',
method: 'POST',
data: data
})
}
/**
* 更新设备
*/
export const updateSgMachine = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgMachine/update',
method: 'POST',
data: data
})
}
/**
* 删除设备
*/
export const deleteSgMachine = (data: any) => {
let ids = [data]
return createAxios({
url: ADVANCE_BOOT + '/sgMachine/delete',
method: 'POST',
data: ids
})
}

View File

@@ -0,0 +1,52 @@
import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 根据用户id查询所有生产线
*/
export const querySgProductLineByUserId = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgProductLine/querySgProductLineByUserId?userId='+data,
method: 'GET',
})
}
/**
* 新增生产线
*/
export const addSgProductLine = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgProductLine/add',
method: 'POST',
data: data
})
}
/**
* 更新生产线
*/
export const updateSgProductLine = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgProductLine/update',
method: 'POST',
data: data
})
}
/**
* 删除生产线
*/
export const deleteSgProductLine = (data: any) => {
let ids = [data]
return createAxios({
url: ADVANCE_BOOT + '/sgProductLine/delete',
method: 'POST',
data: ids
})
}

View File

@@ -0,0 +1,16 @@
import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 评估各方案
*/
export const calc = (data:any) => {
return createAxios({
url: ADVANCE_BOOT + '/sagGovernScheme/calc',
method: 'POST',
data
})
}

View File

@@ -0,0 +1,40 @@
import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 新增设备
*/
export const addSgSensitiveUnit = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgSensitiveUnit/add',
method: 'POST',
data: data
})
}
/**
* 更新设备
*/
export const updateSgSensitiveUnit = (data: any) => {
return createAxios({
url: ADVANCE_BOOT + '/sgSensitiveUnit/update',
method: 'POST',
data: data
})
}
/**
* 删除设备
*/
export const deleteSgSensitiveUnit = (data: any) => {
let ids = [data]
return createAxios({
url: ADVANCE_BOOT + '/sgSensitiveUnit/delete',
method: 'POST',
data: ids
})
}

View File

@@ -2,6 +2,18 @@ import createAxios from '@/utils/request'
const ADVANCE_BOOT = '/advance-boot'
/**
* 查询业务用户
*/
export const sgUserList = () => {
return createAxios({
url: ADVANCE_BOOT + '/sgUser/sgUserList',
method: 'GET'
})
}
/**
* 新增业务用户
*/

View File

@@ -0,0 +1 @@
export const ADVANCE_BOOT = '/advance-boot'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,7 @@
@font-face {
font-family: "AlimamaFangYuanTiVF";
src: url('./AlimamaFangYuanTiVF-Thin.woff') format('woff'),
url("./AlimamaFangYuanTiVF-Thin.woff2") format('woff2');
font-weight: normal;
font-style: normal;
}

View File

@@ -0,0 +1,27 @@
<template>
<div style='width: 12px;'></div>
<el-icon color='black' class='backIcon'>
<close @click='go(-1)' />
</el-icon>
</template>
<script setup lang='ts'>
import { useRouter } from 'vue-router'
import { Close } from '@element-plus/icons-vue'
const { go } = useRouter()
</script>
<style scoped>
.backIcon {
position: absolute;
top: 0;
right: 0;
font-size: 25px;
cursor: pointer;
}
.backIcon:hover {
border-radius: 25px;
background-color: lightgrey;
}
</style>

View File

@@ -99,6 +99,6 @@ watch(
.layout-main-scrollbar {
width: 100%;
position: relative;
overflow: hidden;
//overflow: hidden;
}
</style>

View File

@@ -25,22 +25,6 @@ export const adminBaseRoute = {
title: `pagesTitle.loading`
}
},
// {
// path: 'businessUser/eventView',
// name: 'eventView',
// component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/eventView.vue'),
// meta: {
// title: `router.eventView`
// }
// },
// {
// path: 'businessUser/eventView',
// name: 'eventView',
// component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/index.vue'),
// meta: {
// title: `router.eventView`
// }
// },
{
path: 'businessUserRouter',
name: '业务管理员页面',
@@ -50,16 +34,51 @@ export const adminBaseRoute = {
alwaysShow: true
},
children: [
{
path: 'eventView',
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/eventView.vue'),
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue'),
name: '暂降事件查看页面',
meta: {
title: pageTitle('router.eventView')
}
},
{
path: 'productLine',
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/productLine/index.vue'),
name: '生产线查看页面',
meta: {
title: pageTitle('router.eventView')
}
},
{
path: 'machine',
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/machine/index.vue'),
name: '设备查看页面',
meta: {
title: pageTitle('router.eventView')
}
}
]
},
{
path: 'sagGovernScheme',
name: '暂降治理评估方案',
meta: {
title: pageTitle('sagGovernScheme'),
icon: 'ep:management',
alwaysShow: true
},
children: [
{
path: 'schemeCalc',
component: () => import('@/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue'),
name: '治理评估页面',
meta: {
title: pageTitle('router.schemeCalc')
}
},
]
}
]

View File

@@ -351,3 +351,21 @@ body,
background: #fff;
z-index: 2;
}
@font-face {
font-family: "AlimamaFangYuanTiVF";
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
url("../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff2") format('woff2');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "AlimamaDongFangDaKai";
src: url('../assets/font/ali/AlimamaDongFangDaKai-Regular.woff') format('woff'),
url("../assets/font/ali/AlimamaDongFangDaKai-Regular.woff2") format('woff2');
font-weight: normal;
font-style: normal;
}

3
src/utils/emitter.ts Normal file
View File

@@ -0,0 +1,3 @@
import mitt from 'mitt'
const emitter = new mitt()
export default emitter

View File

@@ -0,0 +1,6 @@
// 数字,包含小数,不支持负数
export const numberRegex = /^[+]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;
//邮箱
export const emailRegex: RegExp = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
//手机号
export const phoneRegex: RegExp = /^\d{10}$/;

View File

@@ -55,10 +55,10 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
// 请求拦截
Axios.interceptors.request.use(
config => {
if (config.url?.substring(0, 13) == '/advance-boot') {
config.url = config.url?.slice(13)
config.baseURL = '/hzj'
}
// if(config.url?.substring(0, 13)=='/advance-boot'){
// config.url=config.url?.slice(13)
// config.baseURL='/hzj'
// }
// 取消重复请求
removePending(config)
options.CancelDuplicateRequest && addPending(config)
@@ -93,11 +93,9 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
options.loading && closeLoading(options) // 关闭loading
if (
Array.isArray(response.data) ||
response.data.code === 'A0000' ||
response.data.type === 'application/json' ||
response.data.type === 'application/octet-stream' ||
response.data.type === 'text/xml' ||
response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
) {
return options.reductDataFormat ? response.data : response

View File

@@ -76,8 +76,13 @@ export default class TableStore {
requestPayload(this.method, this.table.params)
)
).then((res: any) => {
this.table.data = res.data.records || res.data
this.table.total = res.data.total || res.data.length || 0
if (res.data) {
this.table.data = res.data.records || res.data
this.table.total = res.data.total || res.data.length || 0
} else {
this.table.data = []
this.table.total = 0
}
if (this.isWebPaging) {
this.table.webPagingData = window.XEUtils.chunk(this.table.data, this.table.params.pageSize)
this.table.data = this.table.webPagingData[this.table.params.pageNum - 1]

View File

@@ -1,734 +0,0 @@
<template>
<div class="default-main">
<!-- 表头 -->
<!-- 表头 -->
<TableHeader date-picker area>
<template v-slot:select>
<el-form-item>
<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>
<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>
</template>
<template v-slot:operation>
<el-button :icon="Monitor" type="primary" @click="calculator">生产力免疫计算器</el-button>
<el-button :icon="Plus" type="primary" @click="exportExcel">导出</el-button>
<el-radio-group v-model="radio" class="ml10">
<el-radio-button label="暂降数据" />
<el-radio-button label="电压暂降事件统计" />
<el-radio-button label="耐受曲线信息" />
</el-radio-group>
</template>
</TableHeader>
<div style="position: relative">
<!-- 表格 -->
<Table ref="tableRef" />
<Transition name="el-fade-in-linear" mode="out-in">
<Sags3D ref="sags3DRef" v-if="radio == '电压暂降事件统计'" />
</Transition>
<Transition name="el-fade-in-linear" mode="out-in">
<ToleranceCurve ref="toleranceCurveRef" v-if="radio == '耐受曲线信息'" />
</Transition>
</div>
<PopupCalculator ref="popupCalculator" />
</div>
</template>
<script setup lang="ts">
import { Plus, Monitor } from '@element-plus/icons-vue'
import { ref, onMounted, provide, defineOptions, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import PopupCalculator from './popupCalculator.vue'
import Sags3D from './sags3D.vue'
import ToleranceCurve from './toleranceCurve.vue'
// 注意名字不要重复若要保持页面存活名字需要和路由admin后面的字符保持一致
defineOptions({
name: 'hsw/zjsj'
})
const radio = ref('暂降数据')
const popupCalculator = ref()
const sags3DRef = ref()
const toleranceCurveRef = ref()
const form = reactive({
name: ''
})
const tableStore = new TableStore({
// 若页面表格高度需要调整请修改publicHeight(内容区域除表格外其他内容的高度)
url: '/user-boot/user/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: '80' },
{ title: '事件编号', field: 'eventNo', width: '80' },
{ title: '供电线路', field: 'linename', minWidth: '130' },
{ title: '事件类型', field: 'eventType', minWidth: '200' },
{ title: '发生时间', field: 'occurrenceTime', minWidth: '220', sortable: true },
{ title: '暂降幅值(p.u.)', field: 'amplitude', minWidth: '130', sortable: true },
{ title: '持续时间(ms)', field: 'durationTime', minWidth: '130', sortable: true },
{ title: '预计损失(万元)', field: 'forecastLoss', minWidth: '80', sortable: true }
],
beforeSearchFun: () => {
sags3DRef.value?.search()
toleranceCurveRef.value?.search()
},
loadCallback: () => {
// 加载数据
tableStore.table.data = [
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: 'e3856759ddfb44a49ed5b01a5654ac17',
eventNo: '21',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-12-09T16:48:31.000+0800',
offsetVoltage: '35.78',
amplitude: 0.3578,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 150,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '07417b830bc943e38c4bd474ab9571f6',
eventNo: '20',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-11-28T07:33:31.000+0800',
offsetVoltage: '81.75',
amplitude: 0.8175,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: 'c322ca1e8f494cf7b06dc968d695dd54',
eventNo: '19',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-11-28T00:57:46.000+0800',
offsetVoltage: '22.71',
amplitude: 0.2271,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 150,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '1930fb4d761f4ae9bea9b75edfa4c313',
eventNo: '18',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-23T11:07:07.000+0800',
offsetVoltage: '56.97',
amplitude: 0.5697,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 146.9287,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '94ececef8ee9418da701277aa6d55836',
eventNo: '17',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-23T11:07:05.000+0800',
offsetVoltage: '54.65',
amplitude: 0.5465,
durationTime: 980,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 148.8127,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '547f00db243c467b828e634b2faaddde',
eventNo: '16',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-23T11:07:04.000+0800',
offsetVoltage: '53.10',
amplitude: 0.531,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 149.4611,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '8ef074d4f689499280a7a44f2cfa15bf',
eventNo: '15',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-23T10:51:23.000+0800',
offsetVoltage: '50.39',
amplitude: 0.5039,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 149.9212,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '3290e8deda454a77836224997562f55e',
eventNo: '14',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-23T09:06:55.000+0800',
offsetVoltage: '39.18',
amplitude: 0.3918,
durationTime: 2580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 150,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: 'c2926f9634f74afe9509b32b13737582',
eventNo: '13',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-15T16:48:37.000+0800',
offsetVoltage: '23.85',
amplitude: 0.2385,
durationTime: 1580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 150,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '24290530057c42c98180a2a57f477c6b',
eventNo: '12',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-10-13T02:14:23.000+0800',
offsetVoltage: '67.93',
amplitude: 0.6793,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 100.9483,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '9588e55bb4ce4c94b2f2c0d9de22780c',
eventNo: '11',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-09-20T19:23:53.000+0800',
offsetVoltage: '33.95',
amplitude: 0.3395,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 150,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '914ee55c2b89474bab68c69f147a0344',
eventNo: '10',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-09-14T20:50:12.000+0800',
offsetVoltage: '81.08',
amplitude: 0.8108,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '1ab529fc85104a1d849b2b009c39e3fa',
eventNo: '9',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-09-14T19:41:29.000+0800',
offsetVoltage: '81.39',
amplitude: 0.8139,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '5798f1d06457456cabb8d7e0e606e1e9',
eventNo: '8',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-08-14T10:09:20.000+0800',
offsetVoltage: '85.41',
amplitude: 0.8541,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '5feba1a0f45949f88d155f30c485edf7',
eventNo: '7',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-08-14T10:09:18.000+0800',
offsetVoltage: '87.66',
amplitude: 0.8766,
durationTime: 780,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: 'abb64e44e2074d159b7fa9133d7c794d',
eventNo: '6',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-08-13T03:57:13.000+0800',
offsetVoltage: '68.78',
amplitude: 0.6878,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 92.8897,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '5dcd5a69b76a460e8dae6703715eb902',
eventNo: '5',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-08-12T15:52:43.000+0800',
offsetVoltage: '76.68',
amplitude: 0.7668,
durationTime: 780,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '3716d02a70c3463aaeb0ddb2dae296d4',
eventNo: '4',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-08-10T07:46:58.000+0800',
offsetVoltage: '55.06',
amplitude: 0.5506,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 148.5711,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '2ed5708f941b43039a43a80e8bde8012',
eventNo: '3',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-08-10T06:55:05.000+0800',
offsetVoltage: '46.89',
amplitude: 0.4689,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 149.9999,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: '2b5837a5b9c14f5ebc49c1e7462e6b42',
eventNo: '2',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-07-19T12:52:21.000+0800',
offsetVoltage: '81.37',
amplitude: 0.8137,
durationTime: 1380,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
},
{
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: 'f33a7b60ec5840f392aa8e49f931a751',
eventNo: '1',
monitorId: null,
monitorNodeId: null,
monitorNodeName: null,
lineId: null,
linename: '进线-26',
eventType: '电压暂降',
occurrenceTime: '2019-07-19T12:49:03.000+0800',
offsetVoltage: '83.85',
amplitude: 0.8385,
durationTime: 580,
phase: '未知相别',
analyse: null,
fileId: null,
enable: 0,
forecastLoss: 0,
loadLossRate: null,
fresh: 0
}
]
}
})
// 注入到子组件
provide('tableStore', tableStore)
// 默认参数 参数多的话可以使用Object.assign方法
tableStore.table.params.searchState = 1
tableStore.table.params.searchValue = ''
tableStore.table.params.casualUser = -1
tableStore.table.params.orderBy = ''
onMounted(() => {
// 加载数据
tableStore.index()
})
// 弹框
const exportExcel = () => {
tableStore.table.ref!.exportData({
filename: '文件名字', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: tableStore.table.data // 数据源 // 过滤那个字段导出
})
}
// 计算器
const calculator = () => {
popupCalculator.value.open()
}
const selectOptions = [
{
value: 'Option1',
label: 'Option1'
},
{
value: 'Option2',
label: 'Option2'
},
{
value: 'Option3',
label: 'Option3'
},
{
value: 'Option4',
label: 'Option4'
},
{
value: 'Option5',
label: 'Option5'
}
]
</script>
<style></style>

View File

@@ -1,285 +0,0 @@
<template>
<el-dialog class="popup-calculator" v-model="dialogVisible" :title="title" width="540px">
<div style="width: 480px; margin: 20px auto">
<div style="display: flex">
<el-select v-model="form.name" placeholder="Select" style="flex: 1">
<el-option
v-for="item in selectOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="form.name" placeholder="Select" style="flex: 1" class="ml10">
<el-option
v-for="item in selectOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<div class="result-first">
<div class="result-first-left">
<img class="result-first-left-icon" src="/src/assets/money.png" />
<div class="result-first-left-value mt10">
<span style="font-size: 16px; color: var(--el-color-primary)">10</span>
万元
</div>
<div class="result-first-left-label mt10">此次暂降经济损失</div>
</div>
<div class="result-first-chart">
<MyEchart :options="chartsOptions1"></MyEchart>
</div>
<div class="result-first-chart">
<MyEchart :options="chartsOptions2"></MyEchart>
</div>
</div>
<div class="result-second">
<div class="result-second-item">
<div class="result-second-item-label">生产线故障率</div>
<div class="result-second-item">0%</div>
</div>
<div class="result-second-item mt10">
<div class="result-second-item-label">电气设备故障率</div>
<div class="result-second-item">0%</div>
</div>
</div>
<div class="result-start mt10">
<div class="result-start-title">暂降事件</div>
<div class="result-start-content">
<el-form label-width="100px" label-position="left">
<el-form-item label="暂降幅值p.u.">
<el-input-number v-model="form.num" controls-position="right" />
</el-form-item>
<el-form-item label="持续时间ms">
<el-input-number v-model="form.num" controls-position="right" />
</el-form-item>
</el-form>
<el-button type="primary" class="ml10 result-start-content-btn">立即评估</el-button>
</div>
</div>
</div>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref, inject } from 'vue'
import { reactive } from 'vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
const dialogVisible = ref(false)
const title = ref('生产线免疫力计算器')
const chartsOptions1 = ref({
xAxis: null,
yAxis: null,
dataZoom: null,
series: [
{
type: 'gauge',
startAngle: 90,
endAngle: -270,
pointer: {
show: false
},
progress: {
show: true,
overlap: false,
roundCap: true,
clip: false,
itemStyle: {
borderWidth: 1,
color: '#00d17d'
}
},
axisLine: {
lineStyle: {
width: 10
}
},
splitLine: {
show: false,
distance: 0,
length: 10
},
axisTick: {
show: false
},
axisLabel: {
show: false,
distance: 50
},
data: [
{
value: 100,
title: {
offsetCenter: ['0%', '-30%']
},
detail: {
valueAnimation: true,
offsetCenter: ['0%', '-10%']
}
}
],
detail: {
overflow: 'break',
color: '#00d17d',
fontSize: 12,
width: 100,
formatter: '生产线免疫力({value}%)'
}
}
]
})
const chartsOptions2 = ref({
xAxis: null,
yAxis: null,
dataZoom: null,
series: [
{
type: 'gauge',
startAngle: 90,
endAngle: -270,
pointer: {
show: false
},
progress: {
show: true,
overlap: false,
roundCap: true,
clip: false,
itemStyle: {
borderWidth: 1,
color: '#0099fa'
}
},
axisLine: {
lineStyle: {
width: 10
}
},
splitLine: {
show: false,
distance: 0,
length: 10
},
axisTick: {
show: false
},
axisLabel: {
show: false,
distance: 50
},
data: [
{
value: 20,
title: {
offsetCenter: ['0%', '-30%']
},
detail: {
valueAnimation: true,
offsetCenter: ['0%', '10%']
}
}
],
title: {
fontSize: 14
},
detail: {
overflow: 'break',
color: '#0099fa',
fontSize: 12,
width: 100,
formatter: '电气设备免疫力({value}%)'
}
}
]
})
const formRef = ref()
// 注意不要和表单ref的命名冲突
const form = reactive<anyObj>({
name: '',
num: 1
})
const open = () => {
dialogVisible.value = true
}
const selectOptions = [
{
value: 'Option1',
label: 'Option1'
},
{
value: 'Option2',
label: 'Option2'
},
{
value: 'Option3',
label: 'Option3'
},
{
value: 'Option4',
label: 'Option4'
},
{
value: 'Option5',
label: 'Option5'
}
]
defineExpose({ open })
</script>
<style lang="scss">
.result-first {
height: 160px;
display: flex;
justify-content: space-between;
.result-first-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
width: 160px;
}
.result-first-chart {
width: 160px;
height: 100%;
}
}
.result-second {
.result-second-item {
padding: 0 10px;
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
background: var(--el-color-primary-light-9);
color: var(--el-color-primary);
}
}
.result-start {
padding: 10px;
background: var(--el-color-primary-light-5);
color: #fff;
.result-start-content {
padding-top: 10px;
display: flex;
.el-form-item {
margin-bottom: 10px;
}
.el-form-item__label {
color: #fff;
}
.result-start-content-btn {
height: 74px;
flex: 1;
background: var(--el-color-primary);
color: #fff;
}
}
}
</style>

View File

@@ -0,0 +1,243 @@
<!--上传暂降数据-->
<template>
<el-dialog 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'>
<el-form-item label='业务用户'>
<el-select v-model='form.userId' filterable @change='changeUser'>
<el-option
v-for='item in userListData'
:key='item.id'
:label='item.userName'
:value='item.id'
/>
</el-select>
</el-form-item>
<el-form-item label='生产线'>
<el-select v-model='form.productLineId' filterable @change='changeProductLine'>
<el-option
v-for='item in productLineData'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select>
</el-form-item>
<el-form-item label='进线'>
<el-input v-model='form.incomingLineName' readonly />
</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, reactive, inject } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus'
import { sgUserList } from '@/api/advance-boot/sgGroven/sgUser'
import { querySgProductLineByUserId } from '@/api/advance-boot/sgGroven/sgProductLine'
import type { UploadInstance, UploadProps, UploadRawFile, UploadUserFile } from 'element-plus'
import { genFileId } from 'element-plus'
import { importEventData } from '@/api/advance-boot/sgGroven/sgEvent'
import { upload } from '@/api/process-boot/terminal'
const fileList = ref<UploadUserFile[]>([])
const formRef = ref()
const tableStore = inject('tableStore') as TableStore
const eventDataUploadVisible = ref(false)
const title = ref('')
const userListData: any = ref([])
const productLineData: any = ref([])
const uploadEventData = ref<UploadInstance>()
// 注意不要和表单ref的命名冲突
const form = reactive({
userId: '',
productLineId: '',
incomingLineName: '',
incomingLineId: '',
file: null
})
//弹出界面,默认选择用户的第一个生产线的第一条进线进行数据导入
const open = async (text: string, userId: string) => {
title.value = text
resetForm()
form.file = null
fileList.value = []
// 在此处恢复默认表单
for (let key in form) {
form[key] = ''
}
//获取用户数据
await sgUserList().then(res => {
if (res.data && res.data.length > 0) {
userListData.value = res.data
} else {
ElMessage.error('请先创建用户')
}
})
if (userId) {
form.userId = userId
} else {
form.userId = userListData.value[0].id
}
//根据用户id获取所有生产线并默认选中第一个
await querySgProductLineByUserId(form.userId).then(res => {
if (res.data && res.data.length > 0) {
productLineData.value = res.data
//并且默认选中第一个生产线
const productLineObj = productLineData.value[0]
form.productLineId = productLineObj.id
//判断赋值进线信息
if (productLineObj.incomingLineId && productLineObj.incomingLineName) {
form.incomingLineId = productLineObj.incomingLineId
form.incomingLineName = productLineObj.incomingLineName
} else {
ElMessage.error('请先关联进线')
}
} else {
form.productLineId = ''
form.incomingLineId = ''
form.incomingLineName = ''
productLineData.value = []
ElMessage.error('请先创建生产线')
}
})
eventDataUploadVisible.value = true
}
//重置表单内容
const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
/**
* 用户下拉框发生更新
*/
const changeUser = async () => {
await querySgProductLineByUserId(form.userId).then(res => {
if (res.data && res.data.length > 0) {
productLineData.value = res.data
//并且默认选中第一个生产线
const productLineObj = productLineData.value[0]
form.productLineId = productLineObj.id
//判断赋值进线信息
if (productLineObj.incomingLineId && productLineObj.incomingLineName) {
form.incomingLineId = productLineObj.incomingLineId
form.incomingLineName = productLineObj.incomingLineName
} else {
form.incomingLineId = ''
form.incomingLineName = ''
ElMessage.error('请先关联进线')
}
} else {
form.productLineId = ''
form.incomingLineId = ''
form.incomingLineName = ''
productLineData.value = []
ElMessage.error('请先创建生产线')
}
})
}
/**
* 生产线下拉框发生更新
*/
const changeProductLine = () => {
//根据产线id获取到产线实体
const tempProductData = productLineData.value.filter((obj: any) => obj.id === form.productLineId)
//判断赋值进线信息
if (tempProductData[0].incomingLineId && tempProductData[0].incomingLineName) {
form.incomingLineId = tempProductData[0].incomingLineId
form.incomingLineName = tempProductData[0].incomingLineName
} else {
ElMessage.error('请先关联进线')
}
}
/**
* 选择待上传文件
*/
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) {
if (!form.incomingLineId) {
ElMessage.error('请先关联进线')
} else {
let data = new FormData()
data.append('file', form.file)
data.append('incomingLineId', form.incomingLineId)
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>

View File

@@ -0,0 +1,221 @@
<template>
<div class='default-main'>
<!-- 表头 -->
<TableHeader date-picker>
<template v-slot:select>
<el-form-item label='用户'>
<el-select v-model='tableStore.table.params.userId' filterable @change='changeUser'>
<el-option
v-for='item in userListData'
:key='item.id'
:label='item.userName'
:value='item.id'
/>
</el-select>
</el-form-item>
</template>
<template v-slot:operation>
<!--返回按钮-->
<back-component />
</template>
</TableHeader>
<!--导入暂降数据查询框-->
<event-upload-popup ref='eventUploadPopup' />
<el-radio-group v-model='radio' id='tabTitle'>
<el-radio-button label='暂降数据' />
<el-radio-button label='电压暂降事件统计' />
<el-radio-button label='耐受曲线信息' />
</el-radio-group>
<div class='tableExtraButton'>
<el-button :icon='Upload' type='primary' @click='importEventData'>导入</el-button>
<el-button :icon='Download' type='primary' @click='exportExcel'>数据导出</el-button>
<el-button :icon='Download' type='primary' @click='exportExcelTemplate'>下载模板</el-button>
</div>
<div style='position: relative;'>
<!-- 表格 -->
<Table ref='tableRef' />
<Transition name='el-fade-in-linear' mode='out-in'>
<Sags3D ref='sags3DRef' v-if="radio == '电压暂降事件统计'" />
</Transition>
<Transition name='el-fade-in-linear' mode='out-in'>
<ToleranceCurve ref='toleranceCurveRef' v-if="radio == '耐受曲线信息'" />
</Transition>
</div>
</div>
</template>
<script setup lang='ts'>
import { Upload, Download } from '@element-plus/icons-vue'
import { ref, provide, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import Sags3D from './sags3D.vue'
import ToleranceCurve from './toleranceCurve.vue'
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'
const { query } = useRoute()
const userId = ref()
// 注意名字不要重复若要保持页面存活名字需要和路由admin后面的字符保持一致
defineOptions({
name: 'sagVoltageData'
})
const radio = ref('暂降数据')
const eventUploadPopup = ref()
const sags3DRef = ref()
const toleranceCurveRef = ref()
const userListData: any = reactive([])
const tableStore = new TableStore({
// 若页面表格高度需要调整请修改publicHeight(内容区域除表格外其他内容的高度)
url: '/advance-boot/sgEvent/list',
method: 'POST',
publicHeight: 40,
column: [
{ title: '序号', type: 'seq', width: '80' },
{ title: '进线', field: 'incomingLineName', minWidth: '130' },
{ title: '发生时间', field: 'startTime', minWidth: '220', sortable: true },
{ title: '暂降幅值(p.u.)', field: 'featureAmplitude', minWidth: '130', sortable: true },
{ title: '持续时间(ms)', field: 'duration', minWidth: '130', sortable: true },
{ title: '预计损失(万元)', field: 'estimatedLoss', minWidth: '130', sortable: true },
{
title: '数据来源', field: 'dataSource', minWidth: '130',
formatter: (row: any) => {
return row.dataSource == 0 ? '离线导入' : '监测点同步'
}
},
{
title: '操作',
align: 'center',
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: '暂无波形',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.fileFlag !== 1
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
// 注入到子组件
provide('tableStore', tableStore)
//初始化页面
const initData = async () => {
//先查询所有用户列表
await sgUserList().then(res => {
Object.assign(userListData, res.data)
})
userId.value = query.id
tableStore.table.params.userId = userId
tableStore.index()
sags3DRef.value?.search(userId)
toleranceCurveRef.value?.search(userId)
}
initData()
//用户信息更换
const changeUser = () => {
userId.value = tableStore.table.params.userId
}
//批量导入暂降数据
const importEventData = () => {
// 弹出框,联级选择生产线--进线,上传文件
eventUploadPopup.value.open('导入暂降数据', userId.value)
}
// 导出表格
const exportExcel = () => {
const param = {}
exportEventData(param).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 exportExcelTemplate = () => {
downloadTemplate().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()
})
}
</script>
<style scoped>
.tableExtraButton {
position: absolute;
right: 27px;
top: 55px;
}
#tabTitle {
border-left: 1px solid var(--el-border-color);
border-right: 1px solid var(--el-border-color);
width: 100%;
padding: 0 0 5px 5px;
margin-top: -5px;
}
.cn-table-header {
border-bottom: 0 !important;
}
</style>

View File

@@ -16,12 +16,11 @@
</template>
<script lang="ts" setup>
import { ref, onMounted, provide, defineOptions } from 'vue'
import { ref, onMounted, provide } from 'vue'
import SecondSheet from '@/components/secondSheet/index.vue'
import Table from '@/components/table/index.vue'
import TableStore from '@/utils/tableStore'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { log } from 'console'
const radio = ref('三维图')
const options = ref()

View File

@@ -1,22 +0,0 @@
<template>
<div>
<h1>暂降事件查询</h1>
<h1>{{ id }}</h1>
<el-button type='primary' @click='go(-1)' class='ml10'>返回</el-button>
</div>
</template>
<script setup lang='ts'>
import { useRouter, useRoute } from 'vue-router'
import { ref } from 'vue'
import { Plus } from '@element-plus/icons-vue'
const { push, go } = useRouter()
const { query } = useRoute()
const id = ref()
const getTableDet = async () => {
id.value = query.id
}
getTableDet()
</script>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog class='cn-operate-dialog' v-model='incomingDialogVisible' :title='title'
style='max-width: 750px;width: 400px;height: 300px' top='30vh'>
style='width: 415px;height: 300px' top='30vh'>
<el-scrollbar>
<el-form :inline='false' :model='form' label-width='120px' :rules='rules' ref='formRef'>
<el-form-item label='进线名称' prop='name'>

View File

@@ -26,6 +26,7 @@
<Table ref='tableRef'></Table>
<!--弹框-->
<user-popup ref='userPopup' />
<event-upload-popup ref='eventUploadPopup' />
</div>
</template>
@@ -39,7 +40,7 @@ import AreaCascard from '@/components/form/areaCascard/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import { deleteSgUser } from '@/api/advance-boot/sgGroven/sgUser'
import EventUploadPopup from '@/views/pqs/voltageSags/sagGovern/businessUser/event/eventUploadPopup.vue'
import UserPopup from './userPopup.vue'
@@ -52,12 +53,13 @@ const { push } = useRouter()
const areaRef = ref()
//用户信息弹出框
const userPopup = ref()
const eventUploadPopup = ref()
const tableStore = new TableStore({
url: '/advance-boot/sgUser/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq' },
{ title: '序号', type: 'seq', width: 80 },
{ title: '用户名', field: 'userName' },
{ title: '所属行业', field: 'industry' },
{ title: '所属地区', field: 'addr' },
@@ -75,7 +77,7 @@ const tableStore = new TableStore({
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
click: row => {
push(`/admin/businessUserRouter/eventView?id=${row.id}`)
}
},
@@ -85,13 +87,10 @@ const tableStore = new TableStore({
title: '导入',
type: 'primary',
icon: 'el-icon-Delete',
render: 'basicButton'
// click: row => {
// delNode(row.id).then(res => {
// ElMessage.success('删除成功')
// tableStore.index()
// })
// }
render: 'basicButton',
click: row => {
eventUploadPopup.value.open('导入暂降数据', row.id)
}
}
]
},
@@ -104,15 +103,23 @@ const tableStore = new TableStore({
buttons: [
{
name: 'productSetting',
title: '生产线设置',
title: '生产线管理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton'
// click: async row => {
// dialogFormVisible.value = true
// dialogTitle.value = '前置机修改'
// formData.value = JSON.parse(JSON.stringify(row))
// }
render: 'basicButton',
click: row => {
push(`/admin/businessUserRouter/productLine?id=${row.id}`)
}
},
{
name: 'productSetting',
title: '设备管理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
push(`/admin/businessUserRouter/machine?id=${row.id}`)
}
},
{
name: 'update',

View File

@@ -0,0 +1,168 @@
<!--设备管理界面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='生产线'>
<el-select v-model='tableStore.table.params.productLineId'>
<el-option
v-for='item in productLineList'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select>
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增</el-button>
<!--返回按钮-->
<back-component />
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--设备弹出框-->
<machine-popup ref='machinePopup' />
<!--设备详细弹出框管理元器件-->
<machine-detail ref='machineDetail' />
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { provide, ref, reactive } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { querySgProductLineByUserId } from '@/api/advance-boot/sgGroven/sgProductLine'
import { deleteSgMachine } from '@/api/advance-boot/sgGroven/sgMachine'
import MachinePopup from './machinePopup.vue'
import MachineDetail from '@/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/machineDetail.vue'
import BackComponent from '@/components/icon/back/index.vue'
let productLineList: any = ref([])
const machinePopup = ref()
const machineDetail = ref()
defineOptions({
name: 'machine'
})
const { go } = useRouter()
const { query } = useRoute()
const tableStore = new TableStore({
url: '/advance-boot/sgMachine/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{ title: '设备名称', minWidth: '160', field: 'name' },
{ title: '设备型号', minWidth: '140', field: 'type' },
{ title: '设备损失(万元)', width: '140', field: 'machineLoss' },
{ title: '原料损失(万元)', width: '140', field: 'materialLoss' },
{ title: '产线功率(kW)', width: '140', field: 'machinePower' },
{
title: '操作',
align: 'center',
render: 'buttons',
minWidth: '230',
fixed: 'right',
buttons: [
{
name: 'productSetting',
title: '元器件管理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
machineDetail.value.open('元器件管理', row)
}
},
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
machinePopup.value.open('修改设备', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteSgMachine(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
const getTableData = async () => {
//根据用户查询下面所有的生产线,默认根据第一个生产线获取下面所有设备
await querySgProductLineByUserId(query.id).then(res => {
productLineList.value = res.data
// //如果没有传就用第一个
if (productLineList.value && productLineList.value.length > 0) {
if (query.productLineId) {
tableStore.table.params.productLineId = query.productLineId
} else {
tableStore.table.params.productLineId = productLineList.value[0].id
}
}
})
if (tableStore.table.params.productLineId) {
tableStore.index()
} else {
ElMessage.error('请新增一条生产线')
tableStore.table.loading = false
}
}
getTableData()
provide('tableStore', tableStore)
const add = () => {
if (tableStore.table.params.productLineId) {
let data = {
productLineId: tableStore.table.params.productLineId
}
machinePopup.value.open('新增设备', data)
} else {
ElMessage.error('请新增一条生产线')
}
}
</script>

View File

@@ -0,0 +1,149 @@
<!--设备的新增编辑弹出框-->
<template>
<el-dialog class='cn-operate-dialog' v-model='machineVisible' :title='title' style='width: 415px;height: 400px'
top='30vh'>
<el-scrollbar>
<el-form :inline='false' :model='form' label-width='120px' :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='型号'>
<el-input v-model='form.type' placeholder='请输入型号' clearable />
</el-form-item>
<el-form-item label='设备损失' prop='machineLoss'>
<el-input
v-model='form.machineLoss'
placeholder='请输入设备损失'
clearable
>
<template #append>万元</template>
</el-input>
</el-form-item>
<el-form-item label='原料损失' prop='materialLoss'>
<el-input
v-model='form.materialLoss'
placeholder='请输入原料损失'
clearable
>
<template #append>万元</template>
</el-input>
</el-form-item>
<el-form-item label='功率' prop='machinePower'>
<el-input
v-model='form.machinePower'
placeholder='请输入功率'
clearable
>
<template #append>kW</template>
</el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<span class='dialog-footer'>
<el-button @click='machineVisible = false'>取消</el-button>
<el-button type='primary' @click='submit'>确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script lang='ts' setup>
import { ref, reactive, inject } from 'vue'
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import { addSgMachine,updateSgMachine } from '@/api/advance-boot/sgGroven/sgMachine'
const tableStore = inject('tableStore') as TableStore
const machineVisible = ref(false)
const title = ref('')
const formRef = ref()
const regex = /^[+]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/
// 注意不要和表单ref的命名冲突
const form = reactive({
id: '',
productLineId: '',
name: '',
type: '',
machineLoss: 0,
materialLoss: 0,
machinePower: 0
})
//form表单校验规则
const rules = {
name: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
machineLoss: [
{ required: true, message: '设备损失不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
],
materialLoss: [
{ required: true, message: '原料损失不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
],
machinePower: [
{ required: true, message: '功率不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
],
}
const open = (text: string, data?: any) => {
title.value = text
if (data.name) {
// 表单赋值
for (let key in form) {
form[key] = data[key]
}
} else {
resetForm()
// 在此处恢复默认表单
for (let key in form) {
form[key] = ''
}
}
form.productLineId = data.productLineId
machineVisible.value = true
}
//重置表单内容
const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
/**
* 提交用户表单数据
*/
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.id) {
await updateSgMachine(form)
} else {
await addSgMachine(form)
}
ElMessage.success('保存成功')
tableStore.index()
machineVisible.value = false
}
})
}
/************针对tab切换*************/
defineExpose({ open })
</script>
<style scoped>
.el-upload-list__item {
transition: none !important;
}
.el-select {
min-width: 180px;
}
</style>

View File

@@ -0,0 +1,146 @@
<!--业务用户管理界面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:operation>
<el-button type='primary' @click='refresh' class='ml10' :icon='Refresh'>刷新</el-button>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增</el-button>
<!--返回按钮-->
<back-component />
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--弹框-->
<product-popup ref='productLine' />
</div>
</template>
<script setup lang='ts'>
import { Plus, Refresh } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { provide, ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { deleteSgProductLine } from '@/api/advance-boot/sgGroven/sgProductLine'
import ProductPopup from './productPopup.vue'
import BackComponent from '@/components/icon/back/index.vue'
const productLine = ref()
defineOptions({
name: 'productLine'
})
const { push } = useRouter()
const { query } = useRoute()
const tableStore = new TableStore({
url: '/advance-boot/sgProductLine/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{ title: '用户名', minWidth: '130', field: 'userName' },
{ title: '进线名称', minWidth: '130', field: 'incomingLineName' },
{ title: '产线名称', minWidth: '130', field: 'name' },
{ title: '产能损失(万元)', width: '120', field: 'capacityLoss' },
{ title: '设备损失(万元)', width: '120', field: 'machineLoss' },
{ title: '原料损失(万元)', width: '120', field: 'materialLoss' },
{ title: '产线功率(kW)', width: '120', field: 'machinePower' },
{
title: '计算模式',
titlePrefix: { message: '模式一:单次中断不计算设备、原料损失 \n 模式二:单次中断计算设备、原料损失', icon: 'vxe-icon-question-circle-fill' },
render: 'tag',
width: '120',
field: 'calcMode',
replaceValue: {
'0': '模式一',
'1': '模式二'
}
},
{
title: '操作',
align: 'center',
render: 'buttons',
minWidth: '230',
fixed: 'right',
buttons: [
{
name: 'productSetting',
title: '设备管理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
push(`/admin/businessUserRouter/machine?id=${query.id}&productLineId=${row.id}`)
}
},
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
productLine.value.open('修改生产线', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteSgProductLine(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
if (tableStore.table.params.addr) {
tableStore.table.params.addrStrOption = tableStore.table.params.addr.map(tempArray => tempArray.join('/'))
}
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
const getTableData = () => {
tableStore.table.params.userId = query.id
tableStore.index()
}
getTableData()
provide('tableStore', tableStore)
//新增
const add = () => {
let data = {
userId: query.id
}
productLine.value.open('新增生产线', data)
}
//刷新
const refresh = () => {
tableStore.index()
}
</script>

View File

@@ -0,0 +1,167 @@
<!--生产线的新增编辑弹出框-->
<template>
<el-dialog class='cn-operate-dialog' v-model='productLineVisible' :title='title' style='width: 415px;height: 380px'
top='30vh'>
<el-scrollbar>
<el-form :inline='false' :model='form' label-width='120px' :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='incomingLineId'>
<el-select v-model='form.incomingLineId'>
<el-option
v-for='item in incomingLineList'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select>
</el-form-item>
<el-form-item label='计算模式' prop='calcMode'>
<el-radio-group v-model='form.calcMode'>
<el-tooltip
class='box-item'
effect='light'
content='单次中断不计算设备、原料损失'
placement='bottom-start'
>
<el-radio border label='0'>模式一</el-radio>
</el-tooltip>
<el-tooltip
class='box-item'
effect='light'
content='单次中断计算设备、原料损失'
placement='bottom-start'
>
<el-radio border label='1'>模式二</el-radio>
</el-tooltip>
</el-radio-group>
</el-form-item>
<el-form-item label='产能损失' prop='capacityLoss'>
<el-input
v-model='form.capacityLoss'
placeholder='请输入产能损失'
clearable
>
<template #append>万元</template>
</el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<span class='dialog-footer'>
<el-button @click='productLineVisible = false'>取消</el-button>
<el-button type='primary' @click='submit'>确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script lang='ts' setup>
import { ref, reactive, inject } from 'vue'
import { ElMessage } from 'element-plus'
import { querySgIncomingLineByUserId } from '@/api/advance-boot/sgGroven/incomingLine'
import { addSgProductLine, updateSgProductLine } from '@/api/advance-boot/sgGroven/sgProductLine'
import TableStore from '@/utils/tableStore'
const tableStore = inject('tableStore') as TableStore
const productLineVisible = ref(false)
const title = ref('')
const formRef = ref()
const regex = /^[+]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/
let incomingLineList: any = reactive([])
// 注意不要和表单ref的命名冲突
const form = reactive({
id: '',
userId: '',
incomingLineId: '',
name: '',
calcMode: '',
capacityLoss: 0
})
//form表单校验规则
const rules = {
name: [{ required: true, message: '生产线名不能为空', trigger: 'blur' }],
incomingLineId: [{ required: true, message: '请关联进线', trigger: 'change' }],
calcMode: [
{ required: true, message: '请选择计算模式', trigger: 'change' }
],
capacityLoss: [
{ required: true, message: '产能损失不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
]
}
const open = async (text: string, data?: any) => {
title.value = text
if (data.name) {
// 表单赋值
for (let key in form) {
form[key] = data[key]
}
form.calcMode = String(data.calcMode)
} else {
resetForm()
// 在此处恢复默认表单
for (let key in form) {
form[key] = ''
}
form.calcMode = '0'
}
form.userId = data.userId
await initIncomingLine()
productLineVisible.value = true
}
//重置表单内容
const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
//初始化进线下拉框
const initIncomingLine = async () => {
//根据业务用户id去查找
await querySgIncomingLineByUserId(form.userId).then(res => {
//将进线数据赋值到下来框中
incomingLineList = res.data
})
}
/**
* 提交用户表单数据
*/
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.id) {
await updateSgProductLine(form)
} else {
await addSgProductLine(form)
}
ElMessage.success('保存成功')
tableStore.index()
productLineVisible.value = false
}
})
}
/************针对tab切换*************/
defineExpose({ open })
</script>
<style scoped>
.el-upload-list__item {
transition: none !important;
}
.el-select {
min-width: 180px;
}
</style>

View File

@@ -0,0 +1,93 @@
<!--设备详情页面包含设备基础信息元器件列表信息-->
<template>
<el-dialog class='cn-operate-dialog' v-model='machineDetailVisible' :title='title' style='width: 900px;'>
<el-scrollbar>
<el-form :inline='false' :model='form' label-width='120px' ref='formRef'>
<el-form-item label='设备名称'>
<el-input v-model='form.name' readonly />
</el-form-item>
<el-row>
<el-col :span='12'>
<el-form-item label='设备型号'>
<el-input v-model='form.type' readonly />
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label='设备损失'>
<el-input v-model='form.machineLoss' readonly>
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label='原料损失'>
<el-input v-model='form.materialLoss' readonly>
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label='功率'>
<el-input v-model='form.machinePower' readonly>
<template #append>kW</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!--元器件表格-->
<unit-table ref='unitTable' />
</el-scrollbar>
<template #footer>
<span class='dialog-footer'>
<el-button @click='machineDetailVisible = false'>关闭</el-button>
</span>
</template>
</el-dialog>
</template>
<script lang='ts' setup>
import { ref, reactive, nextTick } from 'vue'
import UnitTable from '@/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitTable.vue'
// 注意不要和表单ref的命名冲突
const form = reactive<any>({
id: '',
name: '',
type: '',
machineLoss: '',
materialLoss: '',
machinePower: ''
})
const unitTable = ref()
const machineDetailVisible = ref(false)
const title = ref('')
//回显设备基础信息
const open = (text: string, data?: any) => {
title.value = text
machineDetailVisible.value = true
if (data) {
// 表单赋值
for (let key in form) {
form[key] = data[key]
}
}
//查询元器件数据 todo...
//待子组件渲染完毕
nextTick(() => {
unitTable.value.getTableData(form.id)
})
}
defineExpose({ open })
</script>
<style scoped>
.el-form-item {
margin-bottom: 10px !important;
}
</style>

View File

@@ -0,0 +1,202 @@
<!--元器件的新增编辑弹出框-->
<template>
<el-dialog class='cn-operate-dialog' v-model='unitVisible' :title='title' style='width: 415px;height: 500px'
top='10vh'>
<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-item>
<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'
/>
</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-radio-group>
</el-form-item>
<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
>
<template #append>p.u.</template>
</el-input>
</el-form-item>
<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
>
<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>
</template>
</el-dialog>
</template>
<script lang='ts' setup>
import { ref, reactive, inject } from 'vue'
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import { addSgSensitiveUnit,updateSgSensitiveUnit } from '@/api/advance-boot/sgGroven/sgSensitiveUnit'
const tableStore = inject('tableStore') as TableStore
const unitVisible = ref(false)
const title = ref('')
const formRef = ref()
const sensitivityList = ref(
[
{
name: '平均',
value: '0'
},
{
name: '高',
value: '1'
},
{
name: '中',
value: '2'
},
{
name: '低',
value: '3'
}
]
)
const regex = /^[+]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/
// 注意不要和表单ref的命名冲突
const form = reactive({
id: '',
machineId: '',
name: '',
sensitivity: '',
standardFlag: '',
vtcTimeUpper: 0,
vtcAmpUpper: 0,
vtcTimeLower: 0,
vtcAmpLower: 0
})
//form表单校验规则
const rules = {
name: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
sensitivity: [{ required: true, message: '灵敏度不能为空', trigger: 'change' }],
standardFlag: [{ required: true, message: '耐受能力不能为空', trigger: 'change' }],
vtcTimeUpper: [
{ required: true, message: '持续时间不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
],
vtcAmpUpper: [
{ required: true, message: '暂降幅值不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
],
vtcTimeLower: [
{ required: true, message: '持续时间不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
],
vtcAmpLower: [
{ required: true, message: '暂降幅值不能为空', trigger: 'blur' },
{ pattern: regex, message: '请输入有效的数值', trigger: 'blur' }
]
}
const open = (text: string, data?: any) => {
title.value = text
if (data.name) {
// 表单赋值
for (let key in form) {
form[key] = data[key]
}
form.sensitivity = String(data.sensitivity)
form.standardFlag = String(data.standardFlag)
} else {
resetForm()
// 在此处恢复默认表单
for (let key in form) {
form[key] = ''
}
form.sensitivity = '0'
form.standardFlag = '1'
}
form.machineId = data.machineId
unitVisible.value = true
}
//重置表单内容
const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
/**
* 提交用户表单数据
*/
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.id) {
await updateSgSensitiveUnit(form)
} else {
await addSgSensitiveUnit(form)
}
ElMessage.success('保存成功')
tableStore.index()
unitVisible.value = false
}
})
}
defineExpose({ open })
</script>
<style scoped>
.cn-operate-dialog .el-form {
width: calc(100% - 10px)
}
</style>

View File

@@ -0,0 +1,145 @@
<!--进线管理界面-->
<template>
<div class='default-main unitButton'>
<TableHeader style='padding: 0 0 !important;'>
<template v-slot:operation>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef' isGroup></Table>
<!--弹框-->
<unit-popup ref='unitPopup' />
</div>
</template>
<script setup lang='ts'>
import { provide, ref } from 'vue'
import { Plus } from '@element-plus/icons-vue'
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'
const unitPopup = ref()
const tableStore = new TableStore({
url: '/advance-boot/sgSensitiveUnit/list',
method: 'POST',
publicHeight: 300,
showPage: false,
column: [
{ title: '元器件名称', width: 110, field: 'name' },
{
title: '灵敏度', width: 80, field: 'sensitivity',
formatter: (row: any) => {
let temp
switch (row.sensitivity) {
case 1:
temp = '高'
break
case 2:
temp = '中'
break
case 3:
temp = '低'
break
default:
temp = '标准'
}
return temp
}
},
{
title: '耐受能力', width: 90, field: 'standardFlag',
formatter: (row: any) => {
return row.standardFlag == 0 ? '否' : '是'
}
},
{
title: '上限曲线',
children: [
{ title: '持续时间(ms)', width: '110', field: 'vtcTimeUpper' },
{ title: '暂降幅值(p.u.)', width: '110', field: 'vtcAmpUpper' }
]
},
{
title: '下限曲线',
children: [
{ title: '持续时间(ms)', width: '110', field: 'vtcTimeLower' },
{ title: '暂降幅值(p.u.)', width: '110', field: 'vtcAmpLower' }
]
},
{
title: '操作',
align: 'center',
render: 'buttons',
width: '140',
fixed: 'right',
buttons: [
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
unitPopup.value.open('修改元器件', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
// deleteSgMachine(row.id).then(res => {
// ElMessage.success('删除成功')
// tableStore.index()
// })
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
const getTableData = (tempId: string) => {
tableStore.table.params.machineId = tempId
tableStore.index()
}
/**********新增、编辑元器件************/
//新增进线信息
const add = () => {
const data = {
machineId: tableStore.table.params.machineId
}
unitPopup.value.open('新增元器件', data)
}
provide('tableStore', tableStore)
defineExpose({ getTableData })
</script>
<style >
.unitButton .table-header {
padding: 5px 15px !important;
}
</style>

View File

@@ -40,16 +40,17 @@
</el-form-item>
<el-form-item label='企业照片'>
<div>
<el-image style="width: 200px;height: 200px;" :src='userLogo.url' :preview-src-list="[userLogo.url]" v-if="userLogo.url"></el-image>
<el-upload
action=''
:show-file-list="false"
:auto-upload='false'
accept='.png,.jpg'
:on-change='chooseImage'
>
<el-button type="primary">上传图片</el-button>
</el-upload>
<el-image style='width: 200px;height: 200px;' :src='userLogo.url'
:preview-src-list='[userLogo.url]' v-if='userLogo.url'></el-image>
<el-upload
action=''
:show-file-list='false'
:auto-upload='false'
accept='.png,.jpg'
:on-change='chooseImage'
>
<el-button type='primary'>上传图片</el-button>
</el-upload>
</div>
</el-form-item>
</el-tab-pane>
@@ -57,10 +58,6 @@
<el-tab-pane label='进线' name='incomingLine'>
<IncomingTable ref='incomingTable'></IncomingTable>
</el-tab-pane>
<el-tab-pane label='生产线' name='productLine'>
生产线
</el-tab-pane>
</el-tabs>
</el-form>
</el-scrollbar>
@@ -75,7 +72,7 @@
</el-dialog>
</template>
<script lang='ts' setup>
import { ref, inject, onMounted, reactive, provide, nextTick } from 'vue'
import { ref, inject, reactive, nextTick } from 'vue'
import { ElMessage } from 'element-plus'
import type { UploadProps, UploadUserFile } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
@@ -106,7 +103,7 @@ const dialogVisibleLogo = ref(false)
const form = reactive<anyObj>({
id: '',
userName: '',
keyUser: '',
keyUser: '1',
industry: '',
addr: [],
addrStrOption: '',
@@ -126,6 +123,7 @@ const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
const open = (text: string, data?: anyObj) => {
@@ -140,7 +138,7 @@ const open = (text: string, data?: anyObj) => {
}
form.addr = data.addr.split('/')
form.keyUser = String(data.keyUser)
if(form.userLogo){
if (form.userLogo) {
userLogo.url = fullUrl(form.userLogo)
// 图片的name我不知道
}

View File

@@ -0,0 +1,163 @@
<!--业务用户管理界面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='用户'>
<el-select v-model='tableStore.table.params.userId' filterable clearable>
<el-option
v-for='item in userListData'
:key='item.id'
:label='item.userName'
:value='item.id'
/>
</el-select>
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增治理方案</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef' isGroup></Table>
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
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'
defineOptions({
name: 'governSchemeHistory'
})
const { push } = useRouter()
const userListData: any = ref([])
const tableStore = new TableStore({
url: '/advance-boot/sgUser/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: '最佳方案',
children: [
{
title: '方案名称', width: '110', field: 'schemeType',
formatter: (row: any) => {
let temp
switch (row.schemeType) {
case 1:
temp = 'AVC'
break
case 2:
temp = 'AVC-RTS'
break
case 3:
temp = '快切'
break
default:
temp = 'UPS'
}
return temp
}
},
{ title: '初期投资(万元)', width: '110', field: 'initialInvest' },
{ title: '投资回收期', width: '110', field: 'payBackYear' },
{ title: '治理效果(万元/年)', width: '110', field: 'governEffectMoney' }
]
},
{
title: '操作',
align: 'center',
width: '150',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
push(`/admin/businessUserRouter/productLine?id=${row.id}`)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteSgUser(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
if (tableStore.table.params.addr) {
tableStore.table.params.addrStrOption = tableStore.table.params.addr.map(tempArray => tempArray.join('/'))
}
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.userId = ''
provide('tableStore', tableStore)
//初始化用户下拉选择框
const initUserSelect = async () => {
await sgUserList().then(res => {
if (res.data && res.data.length > 0) {
userListData.value = res.data
}
})
}
initUserSelect()
//新增用户信息
const add = () => {
let userId = undefined
if (tableStore.table.params.userId) {
userId = tableStore.table.params.userId
}
push(`/admin/sagGovernScheme/schemeCalc?userId=${userId}`)
}
</script>

View File

@@ -0,0 +1,529 @@
<!--暂降治理参数准备页面-->
<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='userId'>
<el-select v-model='form.userId' @change='changeUser'>
<el-option
v-for='item in userListData'
:key='item.id'
:label='item.userName'
:value='item.id'
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='生产线' prop='productLineId'>
<el-select v-model='form.productLineId' filterable>
<el-option
v-for='item in productLineData'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span='9'>
<el-button style='height: 72px;position: absolute;right: 0;' type='primary' @click='calcSag'>开始评估
</el-button>
</el-col>
<el-col :span='7'>
<el-form-item label='期望回收周期' prop='payBackPeriod'>
<el-select v-model='form.payBackPeriod'>
<el-option
v-for='item in 5'
:key='item'
:label='item+"年"'
:value='item'
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12' :offset='1'>
<el-form-item label='参考数据范围' style='grid-column: span 2; max-width: unset'>
<date-picker ref='datePickerRef'></date-picker>
</el-form-item>
</el-col>
</el-row>
</div>
<!--UPS参数-->
<div class='singleParamContent'>
<el-divider content-position='left' class='divider'>
<span class='dividerFontStyle'>UPS补偿</span>
</el-divider>
<el-row>
<el-col :span='7'>
<el-form-item label='购置价格' prop='ups.price'>
<el-input
v-model='form.ups.price'
clearable
>
<template #append>万元/kVA</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='补偿能力' prop='ups.compensation'>
<el-input
v-model='form.ups.compensation'
clearable
>
<template #append>p.u.</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='年维护费' prop='ups.maintainFee'>
<el-input
v-model='form.ups.maintainFee'
clearable
>
<template #append>万元/kVA</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7'>
<el-form-item label='响应时间' prop='ups.responseTime'>
<el-input
v-model='form.ups.responseTime'
clearable
>
<template #append>ms</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='后备时间' prop='ups.backupTime'>
<el-input
v-model='form.ups.backupTime'
clearable
>
<template #append>s</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</div>
<!--AVC参数-->
<div class='singleParamContent'>
<el-divider content-position='left' class='divider'>
<span class='dividerFontStyle'>AVC补偿</span>
</el-divider>
<el-row>
<el-col :span='7'>
<el-form-item label='购置价格' prop='avc.price'>
<el-input
v-model='form.avc.price'
clearable
>
<template #append>万元/kVA</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='补偿能力' prop='avc.compensation'>
<el-input
v-model='form.avc.compensation'
clearable
>
<template #append>p.u.</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='年维护费' prop='avc.maintainFee'>
<el-input
v-model='form.avc.maintainFee'
clearable
>
<template #append>万元/kVA</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7'>
<el-form-item label='响应时间' prop='avc.responseTime'>
<el-input
v-model='form.avc.responseTime'
clearable
>
<template #append>ms</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='后备时间' prop='avc.backupTime'>
<el-input
v-model='form.avc.backupTime'
clearable
>
<template #append>s</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='quick.incomingLineId'>
<el-select v-model='form.quick.incomingLineId'>
<el-option
v-for='item in incomingLineListData'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='设备容量' prop='quick.governMachinePower'>
<el-input
v-model='form.quick.governMachinePower'
clearable
>
<template #append>kVA</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='购置价格' prop='quick.price'>
<el-input
v-model='form.quick.price'
clearable
>
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7'>
<el-form-item label='建设成本' prop='quick.buildFee'>
<el-input
v-model='form.quick.buildFee'
clearable
>
<template #append>kVA</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='年维护费用' prop='quick.quickMaintainFee'>
<el-input
v-model='form.quick.quickMaintainFee'
clearable
>
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='7' :offset='1'>
<el-form-item label='动作时间' prop='quick.actionTime'>
<el-input
v-model='form.quick.actionTime'
clearable
>
<template #append>ms</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
</template>
<script setup lang='ts'>
import DatePicker from '@/components/form/datePicker/index.vue'
import { ref, reactive, onMounted } from 'vue'
import emitter from '@/utils/emitter'
import { numberRegex } from '@/utils/regexPattern'
import { querySgProductLineByUserId } from '@/api/advance-boot/sgGroven/sgProductLine'
import { ElMessage } from 'element-plus'
import { sgUserList } from '@/api/advance-boot/sgGroven/sgUser'
import { querySgIncomingLineByUserId } from '@/api/advance-boot/sgGroven/incomingLine'
import { calc } from '@/api/advance-boot/sgGroven/sgScheme'
defineOptions({
name: 'calcParamPrepare'
})
const props = defineProps(['userId'])
const productLineOwnIncomingLineId = ref('')
const formRef = ref()
const datePickerRef = ref()
const userListData: any = ref([])
const productLineData: any = ref([])
const incomingLineListData: any = ref([])
// 注意不要和表单ref的命名冲突
let form = reactive({
userId: '',
productLineId: '',
startTime: '',
endTime: '',
payBackPeriod: 5,
ups: {
price: 0.145,
compensation: 1,
maintainFee: 0.001,
responseTime: 1,
backupTime: 900
},
avc: {
price: 0.25,
compensation: 0.3,
maintainFee: 0.001,
responseTime: 1,
backupTime: 3
},
quick: {
governMachinePower: 252,
price: 50,
buildFee: 10,
quickMaintainFee: 0.5,
actionTime: 20,
incomingLineId: ''
}
})
//form表单校验规则
const rules = {
userId: [{ required: true, message: '用户必选', trigger: 'change' }],
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 changeUser = async () => {
await querySgProductLineByUserId(form.userId).then(res => {
if (res.data && res.data.length > 0) {
productLineData.value = res.data
//并且默认选中第一个生产线
const productLineObj = productLineData.value[0]
form.productLineId = productLineObj.id
} else {
form.productLineId = ''
productLineData.value = []
ElMessage.error('请先创建生产线')
}
})
}
//初始化用户下拉框
const initUserData = async () => {
//获取用户数据
await sgUserList().then(res => {
if (res.data && res.data.length > 0) {
userListData.value = res.data
} else {
ElMessage.error('请先创建用户')
}
})
//如果传了用户id,则用,否则默认第一个用户
if (props.userId !== 'undefined') {
form.userId = String(props.userId)
} else {
form.userId = userListData.value[0].id
}
//查询生产线数据赋值
await querySgProductLineByUserId(form.userId).then(res => {
if (res.data && res.data.length > 0) {
productLineData.value = res.data
//并且默认选中第一个生产线
const productLineObj = productLineData.value[0]
form.productLineId = productLineObj.id
if (!productLineObj.incomingLineId) {
ElMessage.error('该生产线没有关联实际进线')
} else {
productLineOwnIncomingLineId.value = productLineObj.incomingLineId
}
} else {
form.productLineId = ''
productLineData.value = []
ElMessage.error('请先创建生产线')
}
})
//查询进线数据赋值
await querySgIncomingLineByUserId(form.userId).then(res => {
if (res.data && res.data.length > 0) {
//将当前生产线的进线过滤掉,剩余的交给备用进行选择
let allIncomingLineData = res.data.filter((obj: any) => obj.incomingLineId !== productLineOwnIncomingLineId.value)
if (allIncomingLineData.length > 0) {
form.quick.incomingLineId = allIncomingLineData[0].id
incomingLineListData.value = allIncomingLineData
} else {
form.quick.incomingLineId = ''
incomingLineListData.value = []
ElMessage.error('请先创建备用进线')
}
} else {
form.quick.incomingLineId = ''
incomingLineListData.value = []
ElMessage.error('请先创建备用进线')
}
})
}
/**
* 挂载时初始化数据内容
*/
onMounted(() => {
initUserData()
form.startTime = datePickerRef.value.timeValue[0]
form.endTime = datePickerRef.value.timeValue[1]
})
/**
* 计算暂降治理
*/
function calcSag() {
formRef.value.validate(async (valid: any, errorMsg: any) => {
if (valid) {
//将所有参数传递到后端进行数据计算
form.startTime = datePickerRef.value.timeValue[0]
form.endTime = datePickerRef.value.timeValue[1]
await calc(form).then(res => {
//先通知父组件打开历史页面
emitter.emit('schemeRadio', '评估计算结果')
//再将历史数据传递到历史页面
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;
}
</style>

View File

@@ -0,0 +1,81 @@
<!--最佳治理方案计算页面-->
<template>
<div ref='governTotalContent' class='governTotalContentDiv'>
<!--返回按钮-->
<back-component />
<!--切换radio的导航-->
<div class='schemeNav'>
<el-radio-group v-model='radio'>
<el-radio-button label='治理评估准备' />
<el-radio-button label='评估计算结果' />
</el-radio-group>
</div>
<div class='schemeContent' ref='schemeContent'>
<calc-param v-show='radio=="治理评估准备"' :user-id='query.userId' />
<scheme-result v-show='radio=="评估计算结果"' />
</div>
</div>
</template>
<script setup lang='ts'>
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import emitter from '@/utils/emitter'
import { mainHeight } from '@/utils/layout'
import { useRoute } from 'vue-router'
import BackComponent from '@/components/icon/back/index.vue'
import CalcParam from '@/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/calcParam.vue'
import SchemeResult from '@/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/schemeResult.vue'
const { query } = useRoute()
const governTotalContent = ref()
const schemeContent = ref()
const radio = ref('治理评估准备')
emitter.on('schemeRadio', (value: strig) => {
radio.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]
})
//解绑数据监听
onUnmounted(() => {
// 解绑事件
emitter.off('schemeRadio')
})
</script>
<style scoped>
.governTotalContentDiv {
background-clip: content-box;
display: -webkit-flex; /* Safari */
display: flex;
flex-wrap: wrap;
background-color: #FFFFFF;
padding: 10px;
}
.schemeNav {
height: 55px;
background: #FFFFFF;
width: 100%;
display: flex;
justify-content: center;
}
.schemeContent {
width: 100%;
}
</style>

View File

@@ -0,0 +1,34 @@
<!--各方案治理后的数据回显-->
<template>
<div>
<h1>待回显</h1>
</div>
</template>
<script setup lang='ts'>
import emitter from '@/utils/emitter'
import DatePicker from '@/components/form/datePicker/index.vue'
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import { numberRegex } from '@/utils/regexPattern'
import { querySgProductLineByUserId } from '@/api/advance-boot/sgGroven/sgProductLine'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'schemeResult'
})
//监听治理后返回的数据
// 绑定事件
emitter.on('send-scheme-result', (value:any) => {
console.log('send-scheme-result事件被触发', value)
})
//解绑数据监听
onUnmounted(() => {
// 解绑事件
emitter.off('send-scheme-result')
})
</script>
<style>
</style>