diff --git a/src/api/advance-boot/sgGroven/incomingLine.ts b/src/api/advance-boot/sgGroven/incomingLine.ts index 47c8fb4e..97b2b39d 100644 --- a/src/api/advance-boot/sgGroven/incomingLine.ts +++ b/src/api/advance-boot/sgGroven/incomingLine.ts @@ -13,6 +13,16 @@ export const querySgIncomingLineByUserId = (data: any) => { } +/** + * 查询所有监测信息 + */ +export const lineOptionList = () => { + return createAxios({ + url: ADVANCE_BOOT + '/sgIncomingLine/lineList', + method: 'GET' + }) +} + /** * 新增进线 */ diff --git a/src/api/advance-boot/sgGroven/sgEvent.ts b/src/api/advance-boot/sgGroven/sgEvent.ts index b0d3a161..0365f61e 100644 --- a/src/api/advance-boot/sgGroven/sgEvent.ts +++ b/src/api/advance-boot/sgGroven/sgEvent.ts @@ -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 }) diff --git a/src/api/advance-boot/sgGroven/sgMachine.ts b/src/api/advance-boot/sgGroven/sgMachine.ts index 748d1f5d..e54d537b 100644 --- a/src/api/advance-boot/sgGroven/sgMachine.ts +++ b/src/api/advance-boot/sgGroven/sgMachine.ts @@ -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', + }) +} + + /** * 新增设备 diff --git a/src/api/advance-boot/sgGroven/sgScheme.ts b/src/api/advance-boot/sgGroven/sgScheme.ts index 3636d772..ca54843b 100644 --- a/src/api/advance-boot/sgGroven/sgScheme.ts +++ b/src/api/advance-boot/sgGroven/sgScheme.ts @@ -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' + }) +} + + + + diff --git a/src/api/advance-boot/sgGroven/sgSensitiveUnit.ts b/src/api/advance-boot/sgGroven/sgSensitiveUnit.ts index 54f1e8c6..4d7328b1 100644 --- a/src/api/advance-boot/sgGroven/sgSensitiveUnit.ts +++ b/src/api/advance-boot/sgGroven/sgSensitiveUnit.ts @@ -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', + }) +} + /** * 更新设备 diff --git a/src/assets/font/ali/Nabla_Regular.ttf b/src/assets/font/ali/Nabla_Regular.ttf new file mode 100644 index 00000000..862e9f3f Binary files /dev/null and b/src/assets/font/ali/Nabla_Regular.ttf differ diff --git a/src/assets/font/ali/Nabla_Regular.woff b/src/assets/font/ali/Nabla_Regular.woff new file mode 100644 index 00000000..1c4f0814 Binary files /dev/null and b/src/assets/font/ali/Nabla_Regular.woff differ diff --git a/src/assets/font/ali/Nabla_Regular.woff2 b/src/assets/font/ali/Nabla_Regular.woff2 new file mode 100644 index 00000000..46379e79 Binary files /dev/null and b/src/assets/font/ali/Nabla_Regular.woff2 differ diff --git a/src/components/echarts/radar.vue b/src/components/echarts/radar.vue new file mode 100644 index 00000000..e906ef17 --- /dev/null +++ b/src/components/echarts/radar.vue @@ -0,0 +1,104 @@ + + + + diff --git a/src/components/icon/back/index.vue b/src/components/icon/back/index.vue index a31ecdd5..91abc3fc 100644 --- a/src/components/icon/back/index.vue +++ b/src/components/icon/back/index.vue @@ -1,27 +1,36 @@ diff --git a/src/router/static.ts b/src/router/static.ts index 04ccdb9a..67ab29dd 100644 --- a/src/router/static.ts +++ b/src/router/static.ts @@ -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') + } + }, ] } ] diff --git a/src/styles/app.scss b/src/styles/app.scss index f472d362..6d9a35b8 100644 --- a/src/styles/app.scss +++ b/src/styles/app.scss @@ -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'), diff --git a/src/utils/regexPattern.ts b/src/utils/regexPattern.ts index 144e6721..e5fe444f 100644 --- a/src/utils/regexPattern.ts +++ b/src/utils/regexPattern.ts @@ -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@]+$/; //手机号 diff --git a/src/views/pqs/harmonicMonitoring/harmonicGovern/dataUploadPopup.vue b/src/views/pqs/harmonicMonitoring/harmonicGovern/dataUploadPopup.vue new file mode 100644 index 00000000..60166595 --- /dev/null +++ b/src/views/pqs/harmonicMonitoring/harmonicGovern/dataUploadPopup.vue @@ -0,0 +1,142 @@ + + + + + + diff --git a/src/views/pqs/harmonicMonitoring/harmonicGovern/index.vue b/src/views/pqs/harmonicMonitoring/harmonicGovern/index.vue new file mode 100644 index 00000000..b5212d59 --- /dev/null +++ b/src/views/pqs/harmonicMonitoring/harmonicGovern/index.vue @@ -0,0 +1,412 @@ + + + + + \ No newline at end of file diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventUploadPopup.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventUploadPopup.vue index 14edcd07..26ee5ff4 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventUploadPopup.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventUploadPopup.vue @@ -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('导入成功') diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue index c71fa927..b75b66b1 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue @@ -1,7 +1,7 @@ - diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/incomingLinePopup.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/incomingLinePopup.vue index c0fe2d99..632741a2 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/incomingLinePopup.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/incomingLinePopup.vue @@ -5,7 +5,6 @@ v-model="incomingDialogVisible" :title="title" style="width: 415px; height: 300px" - top="30vh" > @@ -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 = () => { diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitPopup.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitPopup.vue index 75f3c66e..ee3cea82 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitPopup.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitPopup.vue @@ -2,67 +2,67 @@ - diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitTable.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitTable.vue index 618c40d5..d19b802b 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitTable.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/sensitiveUnit/unitTable.vue @@ -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() + }) } } ] diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/userPopup.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/userPopup.vue index ea7327ce..a1fff330 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/userPopup.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/userPopup.vue @@ -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 + } }) } diff --git a/src/views/pqs/voltageSags/sagGovern/scheme/history/index.vue b/src/views/pqs/voltageSags/sagGovern/scheme/history/index.vue new file mode 100644 index 00000000..f4b9b8c7 --- /dev/null +++ b/src/views/pqs/voltageSags/sagGovern/scheme/history/index.vue @@ -0,0 +1,79 @@ + + + + \ No newline at end of file diff --git a/src/views/pqs/voltageSags/sagGovern/scheme/index.vue b/src/views/pqs/voltageSags/sagGovern/scheme/index.vue index d02ccc13..8dec113b 100644 --- a/src/views/pqs/voltageSags/sagGovern/scheme/index.vue +++ b/src/views/pqs/voltageSags/sagGovern/scheme/index.vue @@ -20,7 +20,8 @@
- + + @@ -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 `${val}` + } + }, { 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() diff --git a/src/views/pqs/voltageSags/sagGovern/scheme/machineDetailPopup.vue b/src/views/pqs/voltageSags/sagGovern/scheme/machineDetailPopup.vue new file mode 100644 index 00000000..91b2808a --- /dev/null +++ b/src/views/pqs/voltageSags/sagGovern/scheme/machineDetailPopup.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/calcParam.vue b/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/calcParam.vue index efec4b58..602a2fac 100644 --- a/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/calcParam.vue +++ b/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/calcParam.vue @@ -4,7 +4,7 @@
- 基本信息 + 基础信息 @@ -32,7 +32,7 @@ - + 开始评估 @@ -49,7 +49,7 @@ - + @@ -226,7 +226,7 @@ v-model='form.quick.buildFee' clearable > - + @@ -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) }) diff --git a/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue b/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue index 1289fc9a..5b1c123e 100644 --- a/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue +++ b/src/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue @@ -2,16 +2,15 @@