Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
af992a5670
@ -66,3 +66,73 @@ export function powerCurveQuery(madeinfactory: any, model: any) {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
export const importfdrData = (data: FormData, v: string) => {
|
||||
const token = encrypt_aes(adminInfo.token, v)
|
||||
return createAxios(
|
||||
{
|
||||
url: '/api/fdr/import',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
v,
|
||||
token,
|
||||
},
|
||||
},
|
||||
{ customEncrypt: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportfdrData(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/fdr/export ',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
export const importplcData = (data: FormData, v: string) => {
|
||||
const token = encrypt_aes(adminInfo.token, v)
|
||||
return createAxios(
|
||||
{
|
||||
url: '/api/plc/import',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
v,
|
||||
token,
|
||||
},
|
||||
},
|
||||
{ customEncrypt: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportplcData(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/plc/export ',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
export function queryFdrDesc(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/fdr/queryFdrDesc',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
export function queryplcDesc(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/plc/queryPlcDesc',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
@ -1,27 +1,21 @@
|
||||
<template>
|
||||
<div class="theoreticalpowerCurve">
|
||||
<el-container class="mainContainer">
|
||||
<el-header class="mainHeader">
|
||||
<el-button type="primary" @click="addItem">新增</el-button>
|
||||
</el-header>
|
||||
<el-main class="mainMain">
|
||||
<el-card class="box-card1">
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">风机规格型号列表</el-text>
|
||||
<el-button :icon="CirclePlusFilled" type="primary" @click="addItem">新增</el-button>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="theoreticalTableData" class="tablePart" @current-change="handleCurrentChange">
|
||||
<el-table :data="theoreticalTableData" class="tablePart" @current-change="handleCurrentChange" :row-class-name="rowClassName">
|
||||
<el-table-column prop="index" :label="theoreticalEnums['index']" align="center"> </el-table-column>
|
||||
<el-table-column prop="madeinfactory" :label="theoreticalEnums['madeinfactory']" align="center"> </el-table-column>
|
||||
<el-table-column prop="model" :label="theoreticalEnums['model']" align="center"> </el-table-column>
|
||||
<el-table-column prop="nominalCapacity" :label="theoreticalEnums['nominalCapacity']" align="center"> </el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="400" align="center">
|
||||
<template #default="scope">
|
||||
<div class="tableOperate">
|
||||
<a @click="viewDetails(scope.row)">查看 </a>
|
||||
<el-upload :show-file-list="false" :http-request="update">
|
||||
<template #trigger>
|
||||
<a>更新 </a>
|
||||
</template>
|
||||
</el-upload>
|
||||
<a @click="download(scope.row)">下载</a>
|
||||
<a @click="deleteDetails(scope.row)">删除</a>
|
||||
</div>
|
||||
</template>
|
||||
@ -36,12 +30,95 @@
|
||||
:page-sizes="paginationOptions.pageSizes"
|
||||
background
|
||||
:pager-count="7"
|
||||
layout="prev, pager, next, jumper,sizes,total"
|
||||
layout="prev, pager, next"
|
||||
@change="getcurrentPage"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card2">
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">理论功率曲线</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="chartContainer" class="chartContainer"></div>
|
||||
</el-main>
|
||||
</el-card>
|
||||
<div class="bottom">
|
||||
<el-card class="box-card3 bottom-left">
|
||||
<div>
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">故障录波变量描述</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update1">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download1">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="faultRecordingpageData" class="tablePart">
|
||||
<el-table-column prop="variable" label="列路" align="center"> </el-table-column>
|
||||
<el-table-column prop="description" label="中文" align="center"> </el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="mainFooter">
|
||||
<el-pagination
|
||||
v-model:current-page="paginationOptions1.current"
|
||||
v-model:page-size="paginationOptions1.pageSize"
|
||||
:total="paginationOptions1.total"
|
||||
:page-sizes="paginationOptions1.pageSizes"
|
||||
background
|
||||
:pager-count="7"
|
||||
layout="prev, pager, next"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card3">
|
||||
<div>
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">运行日志变量描述</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update2">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download2">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="runLogpageData" class="tablePart">
|
||||
<el-table-column prop="variable" label="列路" align="center"> </el-table-column>
|
||||
<el-table-column prop="description" label="中文" align="center"> </el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="mainFooter">
|
||||
<el-pagination
|
||||
v-model:current-page="paginationOptions2.current"
|
||||
v-model:page-size="paginationOptions2.pageSize"
|
||||
:total="paginationOptions2.total"
|
||||
:page-sizes="paginationOptions2.pageSizes"
|
||||
background
|
||||
:pager-count="7"
|
||||
layout="prev, pager, next"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-container>
|
||||
<el-dialog v-model="dialogOpen" :title="dialogTitle" width="720">
|
||||
<el-form
|
||||
@ -84,6 +161,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, markRaw } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Refresh, CirclePlusFilled, Download } from '@element-plus/icons-vue'
|
||||
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
||||
import { theoreticalEnums } from './type'
|
||||
import {
|
||||
@ -94,6 +172,12 @@ import {
|
||||
importData,
|
||||
exportData,
|
||||
powerCurveQuery,
|
||||
importfdrData,
|
||||
exportfdrData,
|
||||
importplcData,
|
||||
exportplcData,
|
||||
queryFdrDesc,
|
||||
queryplcDesc,
|
||||
} from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import * as echarts from 'echarts'
|
||||
// 导入
|
||||
@ -108,6 +192,8 @@ const update = (file: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
@ -118,8 +204,9 @@ const update = (file: any) => {
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download = (val: any) => {
|
||||
exportData({ id: val.id }).then((res: any) => {
|
||||
const download = () => {
|
||||
console.log(currentRow)
|
||||
exportData({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
@ -131,6 +218,85 @@ const download = (val: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 导入
|
||||
const update1 = (file: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file.file)
|
||||
const v = generateRandomNumber(16)
|
||||
const id = encrypt_aes(currentRow.value.id, v)
|
||||
formData.append('id', id)
|
||||
return importfdrData(formData, v)
|
||||
.then((res: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getFaultRecording()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error(err?.response?.data?.msg ?? '更新失败')
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download1 = () => {
|
||||
console.log(currentRow)
|
||||
exportfdrData({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
a.download = '故障录波变量' + new Date().getTime()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(downloadUrl)
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
// 导入
|
||||
const update2 = (file: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file.file)
|
||||
const v = generateRandomNumber(16)
|
||||
const id = encrypt_aes(currentRow.value.id, v)
|
||||
formData.append('id', id)
|
||||
return importplcData(formData, v)
|
||||
.then((res: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error(err?.response?.data?.msg ?? '更新失败')
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download2 = () => {
|
||||
console.log(currentRow)
|
||||
exportplcData({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
a.download = '运行日志变量' + new Date().getTime()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(downloadUrl)
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
const rowClassName = ({ row, rowIndex }: any) => {
|
||||
if (currentRow.value === row) {
|
||||
return 'current-row'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
const option: any = reactive({
|
||||
tooltip: {
|
||||
formatter: function (params: any) {
|
||||
@ -285,7 +451,36 @@ const deleteDetails = (val: any) => {
|
||||
}
|
||||
|
||||
const theoreticalTableData: any = ref([])
|
||||
const faultRecordingData: any = ref([])
|
||||
const faultRecordingpageData: any = ref([])
|
||||
const runLogData: any = ref([])
|
||||
const runLogpageData: any = ref([])
|
||||
|
||||
const handleSizeChange1 = (val: any) => {
|
||||
paginationOptions1.pageSize = val
|
||||
paginationOptions1.current = 1
|
||||
faultRecordingpageData.value = faultRecordingData.value.slice(0, paginationOptions1.pageSize)
|
||||
}
|
||||
// 当前页改变时触发
|
||||
const handleCurrentChange1 = (val: any) => {
|
||||
paginationOptions1.current = val
|
||||
const start = (paginationOptions1.current - 1) * paginationOptions1.pageSize
|
||||
const end = start + paginationOptions1.pageSize
|
||||
faultRecordingpageData.value = faultRecordingData.value.slice(start, end)
|
||||
}
|
||||
|
||||
const handleSizeChange2 = (val: any) => {
|
||||
paginationOptions2.pageSize = val
|
||||
paginationOptions2.current = 1
|
||||
runLogpageData.value = runLogData.value.slice(0, paginationOptions1.pageSize)
|
||||
}
|
||||
// 当前页改变时触发
|
||||
const handleCurrentChange2 = (val: any) => {
|
||||
paginationOptions2.current = val
|
||||
const start = (paginationOptions2.current - 1) * paginationOptions2.pageSize
|
||||
const end = start + paginationOptions2.pageSize
|
||||
runLogpageData.value = runLogData.value.slice(start, end)
|
||||
}
|
||||
const getList = () => {
|
||||
const transparams = searchParams()
|
||||
theoreticalpowerCurveList(transparams)
|
||||
@ -299,6 +494,8 @@ const getList = () => {
|
||||
}
|
||||
})
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg ?? '查询失败')
|
||||
}
|
||||
@ -319,7 +516,11 @@ const currentRow = ref()
|
||||
const handleCurrentChange = (val: any) => {
|
||||
currentRow.value = val
|
||||
chart.value.clear()
|
||||
paginationOptions1.current = 1
|
||||
paginationOptions2.current = 1
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
}
|
||||
const getpowerCurve = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
@ -346,11 +547,48 @@ const getpowerCurve = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const getFaultRecording = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
queryFdrDesc({ madeinfactory: currentRow.value.madeinfactory, model: currentRow.value.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
faultRecordingData.value = [...res.data]
|
||||
paginationOptions1.total = faultRecordingData.value.length
|
||||
faultRecordingpageData.value = faultRecordingData.value.slice(0, paginationOptions1.pageSize)
|
||||
} else {
|
||||
ElMessage.warning('查询失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
const getRunLog = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
queryplcDesc({ madeinfactory: currentRow.value.madeinfactory, model: currentRow.value.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
runLogData.value = [...res.data]
|
||||
paginationOptions2.total = runLogData.value.length
|
||||
runLogpageData.value = runLogData.value.slice(0, paginationOptions2.pageSize)
|
||||
} else {
|
||||
ElMessage.warning('查询失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const paginationOptions = reactive({
|
||||
current: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [20, 50, 100],
|
||||
pageSizes: [5],
|
||||
})
|
||||
const paginationOptions1 = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [5, 50, 100],
|
||||
})
|
||||
const paginationOptions2 = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [5, 50, 100],
|
||||
})
|
||||
const getcurrentPage = () => {
|
||||
getList()
|
||||
@ -370,37 +608,58 @@ onMounted(() => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$headerHeight: 60px;
|
||||
$defaultBackgroundColor: #fff;
|
||||
// $defaultBackgroundColor: #fff;
|
||||
$defaultAsideWidth: 260px;
|
||||
$paginationHeight: 32px;
|
||||
.theoreticalpowerCurve {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
.mainContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.mainHeader {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: $headerHeight;
|
||||
padding: 0 20px;
|
||||
border-bottom: 1px solid #eaebed;
|
||||
.title {
|
||||
border-left: 4px solid rgb(77, 147, 196);
|
||||
border-bottom: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-top: 4px solid transparent;
|
||||
padding: 4px;
|
||||
}
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
:deep(div) {
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mainFooter {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
background-color: #fff;
|
||||
}
|
||||
.mainMain {
|
||||
height: calc(100% - $headerHeight);
|
||||
.tabsPart {
|
||||
height: calc(100% - $paginationHeight - 290px);
|
||||
height: 300px;
|
||||
padding-bottom: 5px;
|
||||
:deep(.el-tabs__content) {
|
||||
height: calc(100% - 55px);
|
||||
height: 100%;
|
||||
.el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.box-card1 {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
.tablePart {
|
||||
height: 100%;
|
||||
.alarm {
|
||||
border: 1px solid rgb(228, 161, 18);
|
||||
width: fit-content;
|
||||
@ -431,18 +690,46 @@ $paginationHeight: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.mainFooter {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.chartContainer {
|
||||
width: 100%;
|
||||
height: 280px;
|
||||
height: 240px;
|
||||
border: 1px solid rgb(217, 217, 217);
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.current-row {
|
||||
background-color: #f0f9eb !important;
|
||||
}
|
||||
}
|
||||
.box-card2 {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
.chartContainer {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
border: 1px solid rgb(217, 217, 217);
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 20px;
|
||||
.bottom-left {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.box-card3 {
|
||||
width: 50%;
|
||||
.tabsPart {
|
||||
height: 240px;
|
||||
padding-bottom: 5px;
|
||||
:deep(el-table .cel) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.modelOperate {
|
||||
|
Loading…
Reference in New Issue
Block a user