From 2532bd0851c1c9d1196acf92387f212e6ab1011b Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Thu, 21 Mar 2024 20:13:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=89=BF=E8=BD=BD=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E8=AF=84=E4=BC=B0=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/advance-boot/bearingCapacity.ts | 40 +++ .../{loadBearingTree.vue => bearingTree.vue} | 7 +- src/components/tree/pqs/generalTestTree.vue | 58 ++-- src/utils/request.ts | 1 + .../evaluationList/components/charge.vue | 290 +++++++++--------- .../components/photovoltaic.vue | 92 +++--- .../bearingCapacity/evaluationList/index.vue | 125 +++----- .../userManagement/equipment.vue | 150 +++++++++ .../bearingCapacity/userManagement/index.vue | 43 ++- .../harmonicSurvey/components/planAdd.vue | 13 +- .../harmonicSurvey/components/planManage.vue | 2 +- .../terminal/components/cycleTab.vue | 3 + .../terminal/components/networkTab.vue | 3 + 13 files changed, 500 insertions(+), 327 deletions(-) rename src/components/tree/pqs/{loadBearingTree.vue => bearingTree.vue} (89%) create mode 100644 src/views/pqs/bearingCapacity/userManagement/equipment.vue diff --git a/src/api/advance-boot/bearingCapacity.ts b/src/api/advance-boot/bearingCapacity.ts index 27fe67a0..3edcf6cc 100644 --- a/src/api/advance-boot/bearingCapacity.ts +++ b/src/api/advance-boot/bearingCapacity.ts @@ -147,3 +147,43 @@ export function carryCapacityEvaluate(data) { data }) } +// 承载能力评估用户批量删除 +export function remove(data) { + return createAxios({ + url: '/advance-boot/result/remove', + method: 'POST', + params: data + }) +} +// 承载能力评估用户设备查询 +export function queyDeviceList(data) { + return createAxios({ + url: '/advance-boot/carrycapacitydev/queyDeviceList', + method: 'POST', + data + }) +} +// 新增设备 +export function addDev(data) { + return createAxios({ + url: '/advance-boot/carrycapacitydev/add', + method: 'POST', + data + }) +} +// 修改设备 +export function updateDev(data) { + return createAxios({ + url: '/advance-boot/carrycapacitydev/update', + method: 'POST', + data + }) +} +// 删除设备 +export function removeDev(data) { + return createAxios({ + url: '/advance-boot/carrycapacitydev/remove', + method: 'POST', + params: data + }) +} diff --git a/src/components/tree/pqs/loadBearingTree.vue b/src/components/tree/pqs/bearingTree.vue similarity index 89% rename from src/components/tree/pqs/loadBearingTree.vue rename to src/components/tree/pqs/bearingTree.vue index 0c67a8a5..714328b0 100644 --- a/src/components/tree/pqs/loadBearingTree.vue +++ b/src/components/tree/pqs/bearingTree.vue @@ -28,10 +28,9 @@ const treeRef = ref() const loadData = () => { let nodeKey = '' carryCapacityTree().then(res => { - console.log(res) nodeKey = res.data[0].children[0].children[0].children[0].children[0].children[0].id emit('init', res.data[0].children[0].children[0].children[0].children[0].children[0]) - tree.value = res.data[0].children[0].children + tree.value = res.data[0].children[0].children if (nodeKey) { nextTick(() => { treeRef.value.treeRef.setCurrentKey(nodeKey) @@ -41,6 +40,10 @@ const loadData = () => { }) } loadData() +const setKey = (key: string) => { + treeRef.value.treeRef.setCurrentKey(key) +} +defineExpose({ setKey }) diff --git a/src/utils/request.ts b/src/utils/request.ts index 45061a44..3ca32f04 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -96,6 +96,7 @@ function createAxios>( 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 diff --git a/src/views/pqs/bearingCapacity/evaluationList/components/charge.vue b/src/views/pqs/bearingCapacity/evaluationList/components/charge.vue index c47e73a8..0f7738b2 100644 --- a/src/views/pqs/bearingCapacity/evaluationList/components/charge.vue +++ b/src/views/pqs/bearingCapacity/evaluationList/components/charge.vue @@ -14,9 +14,10 @@ :model="form" label-width="150px" :rules="rules" + :disabled="props.rowList.id != undefined" style="max-width: 500px; margin: auto" > - +
- - - - - - - - + + + +
@@ -137,11 +151,11 @@ @@ -152,26 +166,12 @@ - 承载能力评估 + + 承载能力评估 + - - - - - - - - - - - - - - 查询 - - @@ -194,9 +194,10 @@ import { defaultAttribute } from '@/components/table/defaultAttribute' import MyEChart from '@/components/echarts/MyEchart.vue' import { useDictData } from '@/stores/dictData' import { mainHeight } from '@/utils/layout' -import { Select ,InfoFilled} from '@element-plus/icons-vue' +import { Select, InfoFilled } from '@element-plus/icons-vue' import { ElMessage } from 'element-plus' -import { queyDetailUser, carryCapacityEvaluate } from '@/api/advance-boot/bearingCapacity' +import { queyDetailUser, carryCapacityEvaluate, queyDeviceList } from '@/api/advance-boot/bearingCapacity' +const props = defineProps(['rowList']) const dictData = useDictData() const height = mainHeight(80).height const levelList = dictData.getBasicData('Dev_Voltage_Stand') @@ -206,8 +207,9 @@ const ModeList = dictData.getBasicData('carry_capcity_user_mode') const uesrList = dictData.getBasicData('CARRY_CAPCITY_USER_TYPE', ['Power_Station_Users']) const xTable = ref() const formRef = ref() +const vxeRef = ref() +const loading = ref(false) const outcome: any = ref([]) - const factor = [ { name: 0.95, @@ -234,10 +236,11 @@ const factor = [ id: 1.0 } ] - const dialogVisible = ref(false) const showFlag = ref(false) const tableData = ref([]) +const equipmentList: any = ref([]) +const userId = ref('') const level2Data = ref([ { name: '谐波电流幅值(A)' @@ -251,13 +254,7 @@ const level2Data = ref([ ]) const column: any = ref([]) -const userData = ref([]) -const formInline = ref({ - userType: uesrList[0].id, - voltage: levelList[0].id, - pageNum: 1, - pageSize: 10000 -}) +const userData: any = ref([]) const form: any = ref({ ptType: '0', connectionMode: '', @@ -278,15 +275,10 @@ const rules = { deviceCapacity: [{ required: true, message: '请填入最小短路容量', trigger: 'blur' }] } const pieCharts = ref({}) -// 新增 -const add = () => { - dialogVisible.value = true - xTable.value?.clearCheckboxRow() - xTable.value?.setCheckboxRow(tableData.value, true) -} + // 查询用户 const getUser = () => { - queyDetailUser(formInline.value).then(res => { + queyDetailUser({ pageNum: 1, pageSize: 10000, userTypeList: uesrList.map(item => item.id) }).then(res => { userData.value = res.data.records }) } @@ -298,116 +290,140 @@ const addUse = () => { // tableData.value = tableData.value.filter((arr: any) => !res.has(arr.userId) && res.set(arr.userId, 1)) dialogVisible.value = false } -// 删除 -const deleteData = (row: any) => { - tableData.value = tableData.value.filter((item: any) => { - return !row.userId.includes(item.userId) - }) -} +// 查看设备 +const equipment = (row: any) => {} // 承载能力评估 const assess = () => { - if (tableData.value.length == 0) { + // vxeRef.value.getRadioRecord() + + if (equipmentList.value.length == null) { return ElMessage.warning('请选择用户') } formRef.value.validate((valid: any) => { if (valid) { - column.value = [] - let ChartsList = [ - { - name: '安全', - value: 0 - }, - { - name: 'III级', - value: 0 - }, - { - name: 'II级', - value: 0 - }, - { - name: 'I级', - value: 0 - }, - { - name: '禁止接入', - value: 0 - } - ] - form.value.userList = tableData.value + form.value.devList = equipmentList.value carryCapacityEvaluate(form.value).then(res => { - outcome.value = res.data - res.data.iresultList.forEach((item: any) => { - column.value.push({ - title: item.time + '次', - field: 'num' + item.time - }) - - level2Data.value[0]['num' + item.time] = item.i.toFixed(3) - level2Data.value[1]['num' + item.time] = item.i_limit.toFixed(3) - level2Data.value[2]['num' + item.time] = item.i < item.i_limit ? true : false - }) - showFlag.value = true - res.data.reslutLevel == null ? '' : (ChartsList[res.data.reslutLevel - 1].value = 1) + rendering(res.data) }) - - pieCharts.value = { - title: { - text: '承载能力评估结果', - x: 'center', - top: `30px`, - textStyle: { - fontWeight: 'normal' - } - }, - legend: { - type: 'scroll', - orient: 'vertical', - left: 10, - top: '10%' - }, - - xAxis: { - show: false - }, - yAxis: { - show: false - }, - color: ['#77DA63', '#00BFF5', '#FFBF00', '#Ff6600', '#ff0000'], - dataZoom: { show: false }, - series: [ - { - type: 'pie', - center: ['50%', '50%'], - radius: ['35%', '48%'], - label: { - normal: { - show: false - } - }, - data: ChartsList - } - ] - } } }) } +// 设置图 +const rendering = (row: any) => { + column.value = [] + let ChartsList = [ + { + name: '安全', + value: 0 + }, + { + name: 'III级', + value: 0 + }, + { + name: 'II级', + value: 0 + }, + { + name: 'I级', + value: 0 + }, + { + name: '禁止接入', + value: 0 + } + ] + outcome.value = row + row.iresultList.forEach((item: any) => { + column.value.push({ + title: item.time + '次', + field: 'num' + item.time + }) + + level2Data.value[0]['num' + item.time] = item.i.toFixed(3) + level2Data.value[1]['num' + item.time] = item.i_limit.toFixed(3) + level2Data.value[2]['num' + item.time] = item.i < item.i_limit ? true : false + }) + showFlag.value = true + row.reslutLevel == null ? '' : (ChartsList[row.reslutLevel - 1].value = 1) + pieCharts.value = { + title: { + text: '承载能力评估结果', + x: 'center', + top: `30px`, + textStyle: { + fontWeight: 'normal' + } + }, + legend: { + type: 'scroll', + orient: 'vertical', + left: 10, + top: '10%' + }, + + xAxis: { + show: false + }, + yAxis: { + show: false + }, + color: ['#77DA63', '#00BFF5', '#FFBF00', '#Ff6600', '#ff0000'], + dataZoom: { show: false }, + series: [ + { + type: 'pie', + center: ['50%', '50%'], + radius: ['35%', '48%'], + label: { + normal: { + show: false + } + }, + data: ChartsList + } + ] + } +} + // 过滤数据 const formatter = (row: any) => { if (row.column.field == 'userType') { return uesrList.filter(item => item.id == row.cellValue)[0].name + } else if (row.column.field == 'devScale') { + return levelList.filter(item => item.id == row.cellValue)[0].name } else if (row.column.field == 'voltage') { return levelList.filter(item => item.id == row.cellValue)[0].name } else { return row.cellValue } } -const log = row => { - console.log('🚀 ~ log ~ row:', row) +// 查询设备 +const selChange = (e: any) => { + loading.value = true + queyDeviceList({ + userId: e + }).then(res => { + loading.value = false + equipmentList.value = res.data + }) } onMounted(() => { getUser() + formRef.value?.resetFields() + // 查看 + console.log('🚀 ~ onMounted ~ props.rowList:', props.rowList) + + if (props.rowList.userId != undefined) { + form.value = props.rowList + userId.value = props.rowList.userId + selChange(props.rowList.userId) + rendering({ + firstResult: props.rowList.firstResult, + iresultList: props.rowList.iresultList + }) + } }) diff --git a/src/views/pqs/bearingCapacity/userManagement/index.vue b/src/views/pqs/bearingCapacity/userManagement/index.vue index 7f60b03d..6a5b07a1 100644 --- a/src/views/pqs/bearingCapacity/userManagement/index.vue +++ b/src/views/pqs/bearingCapacity/userManagement/index.vue @@ -4,11 +4,7 @@ + +