Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
c7118aa892
@ -1,6 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="measurement">
|
<div class="measurement">
|
||||||
<el-table :columns="tableColumn" :data="tableData" @sort-change="sortChange" max-height="420">
|
<div class="transferHeader">
|
||||||
|
<span class="transferTitle">可添加的测点</span>
|
||||||
|
<el-radio-group v-model="radioActiveName" @change="typeChange">
|
||||||
|
<el-radio :value="138">模拟量</el-radio>
|
||||||
|
<el-radio :value="199">计算量</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<div class="main">
|
||||||
|
<el-table :columns="tableColumn" :data="tableData" max-height="420">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in tableColumn"
|
v-for="item in tableColumn"
|
||||||
:key="item.prop"
|
:key="item.prop"
|
||||||
@ -21,26 +29,26 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div>
|
<div style="display: flex; justify-content: right; margin-top: 5px">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
v-model:current-page="pageSetting.current"
|
v-model:current-page="pageSetting.current"
|
||||||
v-model:page-size="pageSetting.pageSize"
|
v-model:page-size="pageSetting.pageSize"
|
||||||
:total="pageSetting.total"
|
:total="pageSetting.total"
|
||||||
:page-sizes="pageSetting.pageSizes"
|
:page-sizes="pageSetting.pageSizes"
|
||||||
background
|
background
|
||||||
:pager-count="7"
|
:pager-count="5"
|
||||||
layout="prev, pager, next, jumper,sizes,total"
|
layout="prev, pager, next, jumper,sizes,total"
|
||||||
@change="getcurrentPage"
|
@change="getcurrentPage"
|
||||||
></el-pagination>
|
></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, watch, defineEmits } from 'vue'
|
import { reactive, ref, watch, defineEmits } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import type { ModelAttributeFieldsEnums } from '/@/views/backend/auth/model/type'
|
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
|
||||||
import { getModelAttributeListReq, getRealValueListReq } from '/@/api/backend/deviceModel/request'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
iotModelId: {
|
iotModelId: {
|
||||||
@ -61,6 +69,10 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const radioActiveName = ref(138)
|
||||||
|
const typeChange = () => {
|
||||||
|
pageSetting.current == 1 ? getCompleteData() : (pageSetting.current = 1)
|
||||||
|
}
|
||||||
const selectedIndex: any = ref(null)
|
const selectedIndex: any = ref(null)
|
||||||
const tableColumn = [
|
const tableColumn = [
|
||||||
{
|
{
|
||||||
@ -107,31 +119,15 @@ const getAttributeList = () => {
|
|||||||
iotModelId: props.iotModelId,
|
iotModelId: props.iotModelId,
|
||||||
pageNum: pageSetting.current,
|
pageNum: pageSetting.current,
|
||||||
pageSize: pageSetting.pageSize,
|
pageSize: pageSetting.pageSize,
|
||||||
attributeType: '138',
|
attributeType: radioActiveName.value,
|
||||||
orderColumn: sortData.orderColumn,
|
|
||||||
orderType: sortData.orderType,
|
|
||||||
}
|
}
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
getModelAttributeListReq(requestData)
|
getModelAttributeListReq(requestData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.rows && res.rows.length > 0) {
|
if (res.rows && res.rows.length > 0) {
|
||||||
const codeList: any = []
|
const data = res.rows
|
||||||
const data = res.rows!.map((item) => {
|
|
||||||
codeList.push(item.attributeCode)
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
attributeTypeName:
|
|
||||||
item.attributeType === 138
|
|
||||||
? '模拟量'
|
|
||||||
: item.attributeType === 139
|
|
||||||
? '累积量'
|
|
||||||
: item.attributeType === 140
|
|
||||||
? '离散量'
|
|
||||||
: item.attributeType!,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
pageSetting.total = res.total
|
pageSetting.total = res.total
|
||||||
resolve({ data, codeList })
|
resolve({ data })
|
||||||
} else {
|
} else {
|
||||||
if (res.rows && res.rows.length === 0) {
|
if (res.rows && res.rows.length === 0) {
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
@ -146,56 +142,12 @@ const getAttributeList = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRealValueList = (data: { deviceId: string; attributes: string[] }, list?: any) => {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
getRealValueListReq([data]).then((res) => {
|
|
||||||
if (res.success && res.data) {
|
|
||||||
resolve({ realVal: res.data, list })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const getCompleteData = () => {
|
const getCompleteData = () => {
|
||||||
getAttributeList()
|
getAttributeList().then(({ data }: any) => {
|
||||||
.then(({ data, codeList }: any) => {
|
|
||||||
return getRealValueList({ deviceId: props.deviceId, attributes: codeList }, data)
|
|
||||||
})
|
|
||||||
.then((realData: any) => {
|
|
||||||
const data = realData.list.map((item: any) => {
|
|
||||||
const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode?.toLowerCase()]
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
realTimeValue: realValItem ? (realValItem % 1 === 0 ? realValItem : realValItem.toFixed(3)) : '-',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
tableData.value = data
|
tableData.value = data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortData = reactive<{ orderColumn?: keyof typeof ModelAttributeFieldsEnums; orderType?: 'asc' | 'desc' }>({
|
|
||||||
orderColumn: 'porder',
|
|
||||||
orderType: 'asc',
|
|
||||||
})
|
|
||||||
|
|
||||||
const sortChange = ({ prop, order }: { prop: keyof typeof ModelAttributeFieldsEnums; order: 'ascending' | 'descending' | null }) => {
|
|
||||||
const propEnums = {
|
|
||||||
attributeCode: 'attribute_code',
|
|
||||||
attributeName: 'attribute_name',
|
|
||||||
attributeTypeName: 'attribute_type',
|
|
||||||
porder: 'porder',
|
|
||||||
serviceCode: 'service_code',
|
|
||||||
serviceName: 'service_name',
|
|
||||||
serviceTypeName: 'service_type',
|
|
||||||
}
|
|
||||||
const orderType = order === 'ascending' ? 'asc' : order === 'descending' ? 'desc' : undefined
|
|
||||||
const filed = propEnums[prop as keyof typeof propEnums] as keyof typeof ModelAttributeFieldsEnums
|
|
||||||
sortData.orderColumn = orderType ? filed : undefined
|
|
||||||
sortData.orderType = orderType
|
|
||||||
getCompleteData()
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageSetting = reactive({
|
const pageSetting = reactive({
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
@ -211,7 +163,7 @@ watch(
|
|||||||
() => props.show,
|
() => props.show,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
getCompleteData()
|
pageSetting.current == 1 ? getCompleteData() : (pageSetting.current = 1)
|
||||||
selectedIndex.value = props.irn
|
selectedIndex.value = props.irn
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -221,4 +173,23 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.measurement {
|
||||||
|
border: 1px solid #e1edf6;
|
||||||
|
border-radius: 6px;
|
||||||
|
.transferHeader {
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #333333;
|
||||||
|
background: #f7f9fc;
|
||||||
|
border-bottom: 1px solid #e1edf6;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
}
|
||||||
|
.main {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -71,12 +71,15 @@ const { t } = useI18n()
|
|||||||
|
|
||||||
const statAnalysisFatory = ref('')
|
const statAnalysisFatory = ref('')
|
||||||
const statAnalysisFatoryList: any = ref([])
|
const statAnalysisFatoryList: any = ref([])
|
||||||
const statAnalysisTime = ref('')
|
const statAnalysisInterval = ref('1h')
|
||||||
const statAnalysisInterval = ref('')
|
|
||||||
const statAnalysisDeviceId = ref('')
|
const statAnalysisDeviceId = ref('')
|
||||||
const statAnalysisSelectOptions: any = reactive({
|
const statAnalysisSelectOptions: any = reactive({
|
||||||
interval: [
|
interval: [
|
||||||
|
{ label: '一分钟', value: '1m' },
|
||||||
|
{ label: '一分钟', value: '1m' },
|
||||||
{ label: '五分钟', value: '5m' },
|
{ label: '五分钟', value: '5m' },
|
||||||
|
{ label: '十分钟', value: '10m' },
|
||||||
|
{ label: '十分钟', value: '10m' },
|
||||||
{ label: '十五分钟', value: '15m' },
|
{ label: '十五分钟', value: '15m' },
|
||||||
{ label: '一小时', value: '1h' },
|
{ label: '一小时', value: '1h' },
|
||||||
{ label: '一天', value: '1d' },
|
{ label: '一天', value: '1d' },
|
||||||
@ -85,6 +88,16 @@ const statAnalysisSelectOptions: any = reactive({
|
|||||||
deviceId: [],
|
deviceId: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getFormattedDate = (offset: number) => {
|
||||||
|
const date = new Date()
|
||||||
|
date.setDate(date.getDate() + offset)
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const statAnalysisTime = ref([getFormattedDate(0) + ' 00:00:00', getFormattedDate(0) + ' 23:59:59'])
|
||||||
const chartContainer = ref<HTMLElement | null>(null)
|
const chartContainer = ref<HTMLElement | null>(null)
|
||||||
|
|
||||||
const option: any = {
|
const option: any = {
|
||||||
@ -134,22 +147,6 @@ const chart: any = ref(null)
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (chartContainer.value) {
|
if (chartContainer.value) {
|
||||||
chart.value = echarts.init(chartContainer.value)
|
chart.value = echarts.init(chartContainer.value)
|
||||||
chart.value.setOption({
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
name: 'm/s',
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'category',
|
|
||||||
name: 'KW',
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
type: 'line',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
grid: {},
|
|
||||||
})
|
|
||||||
chart.value.on('legendselectchanged', function (event: any) {
|
chart.value.on('legendselectchanged', function (event: any) {
|
||||||
var isSelected = event.selected[event.name]
|
var isSelected = event.selected[event.name]
|
||||||
var series = chart.value.getOption().series
|
var series = chart.value.getOption().series
|
||||||
@ -161,7 +158,10 @@ onMounted(() => {
|
|||||||
chart.value.setOption({ series: series })
|
chart.value.setOption({ series: series })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
queryWindTurbines()
|
queryWindTurbines().then((res: any) => {
|
||||||
|
statAnalysisDeviceId.value = res.value
|
||||||
|
statAnalysisOperate()
|
||||||
|
})
|
||||||
queryfactoery()
|
queryfactoery()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -174,7 +174,9 @@ const queryfactoery = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const queryWindTurbines = () => {
|
const queryWindTurbines = () => {
|
||||||
queryWindTurbinesPages().then((res) => {
|
return new Promise((resolve) => {
|
||||||
|
queryWindTurbinesPages()
|
||||||
|
.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
statAnalysisSelectOptions.deviceId = res.data.map((item: any) => {
|
statAnalysisSelectOptions.deviceId = res.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
@ -183,8 +185,15 @@ const queryWindTurbines = () => {
|
|||||||
iotModelId: item.modelId,
|
iotModelId: item.modelId,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
resolve(statAnalysisSelectOptions.deviceId[0])
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
ElMessage.error(err ?? '查询失败')
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
@ -229,15 +238,7 @@ const shortcuts = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const getFormattedDate = (offset: number) => {
|
|
||||||
const date = new Date()
|
|
||||||
date.setDate(date.getDate() + offset)
|
|
||||||
|
|
||||||
const year = date.getFullYear()
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
||||||
const day = String(date.getDate()).padStart(2, '0')
|
|
||||||
return `${year}-${month}-${day}`
|
|
||||||
}
|
|
||||||
const getDateRange = (type: 'week' | 'month') => {
|
const getDateRange = (type: 'week' | 'month') => {
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
if (type === 'week') {
|
if (type === 'week') {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="contain">
|
<div class="contain">
|
||||||
<div class="headerPart">
|
<el-header class="headerPart">
|
||||||
<div class="topLeft">
|
<div class="topLeft">
|
||||||
<div class="selectPart">
|
<div class="selectPart">
|
||||||
<span>{{ t('statAnalysis.deviceId') }}</span>
|
<span>{{ t('statAnalysis.deviceId') }}</span>
|
||||||
@ -28,63 +28,20 @@
|
|||||||
<el-option v-for="v in statAnalysisSelectOptions.interval" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
<el-option v-for="v in statAnalysisSelectOptions.interval" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<el-button class="addline" type="primary" :icon="Plus" @click="addTime()"> 增加</el-button>
|
<el-button class="addline" type="primary" :icon="Plus" @click="addTime()"> 增加时间</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="topRight">
|
<div class="topRight">
|
||||||
<el-button type="primary" :loading="isLoading" @click="statAnalysisOperate()">{{ t('statAnalysis.search') }}</el-button>
|
<el-button type="primary" :loading="isLoading" @click="statAnalysisOperate()">{{ t('statAnalysis.search') }}</el-button>
|
||||||
<el-button style="color: #0064aa" @click="statAnalysisExport()">{{ t('statAnalysis.export') }}</el-button>
|
<el-button style="color: #0064aa" @click="statAnalysisExport()">{{ t('statAnalysis.export') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</el-header>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="left">
|
|
||||||
<div class="timeColumns">
|
|
||||||
<div class="moduleRow" v-for="(time, index) in times" :key="index">
|
|
||||||
<div class="item">
|
|
||||||
<el-icon v-show="index !== 0" class="removeModule" @click="switchTime(index)">
|
|
||||||
<Close />
|
|
||||||
</el-icon>
|
|
||||||
<div class="selectPart">
|
|
||||||
<span>曲线名称</span>
|
|
||||||
<el-input v-model="customName[index]" class="customName"></el-input>
|
|
||||||
</div>
|
|
||||||
<div class="selectPart">
|
|
||||||
<span>{{ t('statAnalysis.time') }}</span>
|
|
||||||
<el-date-picker
|
|
||||||
class="datetime-picker"
|
|
||||||
v-model="times[index]"
|
|
||||||
:type="statAnalysisSelect.interval == '1d' ? 'daterange' : 'datetimerange'"
|
|
||||||
:value-format="statAnalysisSelect.interval == '1d' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
|
||||||
:teleported="false"
|
|
||||||
:shortcuts="shortcuts"
|
|
||||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]"
|
|
||||||
@change="timechange(index)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
|
||||||
<div
|
<div
|
||||||
ref="chartContainer"
|
ref="chartContainer"
|
||||||
style="
|
style="height: calc(100% - 140px); width: calc(100% - 60px); border: 1px solid rgb(217, 217, 217); margin: 40px"
|
||||||
position: absolute;
|
|
||||||
top: 127px;
|
|
||||||
width: calc(100% - 430px);
|
|
||||||
height: calc(100% - 187px);
|
|
||||||
border: 1px solid rgb(217, 217, 217);
|
|
||||||
margin: 30px 0;
|
|
||||||
"
|
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<el-dialog v-model="showMeasure" title="选择测点" :width="800">
|
||||||
</div>
|
|
||||||
<el-dialog v-model="showMeasure" title="测点名称" :width="800">
|
|
||||||
<template #header>
|
|
||||||
<div class="measureSlotHeader">
|
|
||||||
<span style="font-size: 20px">测点名称</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="measureSlot">
|
<div class="measureSlot">
|
||||||
<MeasurementPage :show="showMeasure" :iotModelId="iotModelId" :irn="irn" @handleRadioChange="handleRadioChange"></MeasurementPage>
|
<MeasurementPage :show="showMeasure" :iotModelId="iotModelId" :irn="irn" @handleRadioChange="handleRadioChange"></MeasurementPage>
|
||||||
</div>
|
</div>
|
||||||
@ -95,6 +52,49 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="showTime" title="选择时间" :width="800">
|
||||||
|
<div>
|
||||||
|
<div class="selectPart">
|
||||||
|
<span>{{ t('statAnalysis.time') }}</span>
|
||||||
|
<el-date-picker
|
||||||
|
class="datetime-picker"
|
||||||
|
v-model="time"
|
||||||
|
:type="statAnalysisSelect.interval == '1d' ? 'daterange' : 'datetimerange'"
|
||||||
|
:value-format="statAnalysisSelect.interval == '1d' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
||||||
|
:teleported="false"
|
||||||
|
:shortcuts="shortcuts"
|
||||||
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]"
|
||||||
|
@change="timechange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="transferRight">
|
||||||
|
<div class="transferHeader">
|
||||||
|
<span class="transferTitle"
|
||||||
|
>已选择<span>{{ times.length }}</span
|
||||||
|
>项</span
|
||||||
|
>
|
||||||
|
<div @click="clearList" style="color: rgb(0, 100, 170); cursor: pointer">清空</div>
|
||||||
|
</div>
|
||||||
|
<el-main class="transferMain">
|
||||||
|
<el-scrollbar>
|
||||||
|
<div class="selectItem" v-for="(item, index) in times" :key="index">
|
||||||
|
{{ statAnalysisSelect.attributes + (index + 1) }} : {{ item[0] }} 至 {{ item[1] }}
|
||||||
|
<div>
|
||||||
|
<el-icon :size="20" @click="switchTime(index)"><Close /></el-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="showTime = false"> 确认 </el-button>
|
||||||
|
<el-button @click="showTime = false">取消</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted, markRaw } from 'vue'
|
import { reactive, ref, onMounted, markRaw } from 'vue'
|
||||||
@ -103,13 +103,15 @@ import { queryWindTurbinesPages, historyReq, trendAnalyseExport } from '/@/api/b
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { DArrowRight, Plus, Delete, Close } from '@element-plus/icons-vue'
|
import { DArrowRight, Plus, Delete, Close } from '@element-plus/icons-vue'
|
||||||
import MeasurementPage from './analysisAttributes.vue'
|
import MeasurementPage from './analysisAttributes.vue'
|
||||||
|
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
|
||||||
|
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const statAnalysisSelect = reactive({
|
const statAnalysisSelect = reactive({
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
attributes: '',
|
attributes: '',
|
||||||
attributeCode: '',
|
attributeCode: '',
|
||||||
interval: '',
|
interval: '1h',
|
||||||
time: '',
|
time: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
})
|
})
|
||||||
@ -121,27 +123,43 @@ const getFormattedDate = (offset: number) => {
|
|||||||
const day = String(date.getDate()).padStart(2, '0')
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
return `${year}-${month}-${day}`
|
return `${year}-${month}-${day}`
|
||||||
}
|
}
|
||||||
|
const time: any = ref([getFormattedDate(0) + ' 00:00:00', getFormattedDate(0) + ' 23:59:59'])
|
||||||
const times: any = reactive([[getFormattedDate(0) + ' 00:00:00', getFormattedDate(0) + ' 23:59:59']])
|
const times: any = reactive([[getFormattedDate(0) + ' 00:00:00', getFormattedDate(0) + ' 23:59:59']])
|
||||||
const addTime = () => {
|
const addTime = () => {
|
||||||
if (times.length < 4) {
|
time.value = [getFormattedDate(0) + ' 00:00:00', getFormattedDate(0) + ' 23:59:59']
|
||||||
times.push([getFormattedDate(-times.length) + ' 00:00:00', getFormattedDate(-times.length) + ' 23:59:59'])
|
showTime.value = true
|
||||||
customName.push(statAnalysisSelect.attributes + String(times.length))
|
|
||||||
} else {
|
|
||||||
ElMessage.info('最多可添加四条查询曲线!')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const switchTime = (index: number) => {
|
const switchTime = (index: number) => {
|
||||||
|
if (index == 0) {
|
||||||
|
time.value = []
|
||||||
|
}
|
||||||
times.splice(index, 1)
|
times.splice(index, 1)
|
||||||
customName.splice(index, 1)
|
customName.splice(index, 1)
|
||||||
calculate.value.splice(index, 1)
|
|
||||||
}
|
}
|
||||||
const timechange = (value: any) => {
|
const timechange = (value: any) => {
|
||||||
|
if (times.length) {
|
||||||
const count = getTimeIntervals(times[0][0], times[0][1])
|
const count = getTimeIntervals(times[0][0], times[0][1])
|
||||||
const count1 = getTimeIntervals(times[value][0], times[value][1])
|
const count1 = getTimeIntervals(value[0], value[1])
|
||||||
if (count !== count1) {
|
if (count !== count1) {
|
||||||
times[value] = { time: '' }
|
|
||||||
ElMessage.warning('查询时间点错误,请重新输入')
|
ElMessage.warning('查询时间点错误,请重新输入')
|
||||||
|
return
|
||||||
|
} else if (hasDuplicateArrays(value)) {
|
||||||
|
ElMessage.info('存在相同的查询时间!')
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
times.push(value)
|
||||||
|
customName.push(statAnalysisSelect.attributes + times.length)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
times.push(value)
|
||||||
|
customName.push(statAnalysisSelect.attributes + times.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const showTime = ref(false)
|
||||||
|
const clearList = () => {
|
||||||
|
times.length = 0
|
||||||
|
time.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const iotModelId = ref('')
|
const iotModelId = ref('')
|
||||||
@ -172,7 +190,6 @@ const selectedAttrRow: any = ref({
|
|||||||
unit: '',
|
unit: '',
|
||||||
})
|
})
|
||||||
const handleRadioChange = (value: any) => {
|
const handleRadioChange = (value: any) => {
|
||||||
console.log('🚀 ~ handleRadioChange ~ value:', value)
|
|
||||||
const { attributeCode, attributeName, unit } = { ...value }
|
const { attributeCode, attributeName, unit } = { ...value }
|
||||||
selectedAttrRow.attributeCode = attributeCode
|
selectedAttrRow.attributeCode = attributeCode
|
||||||
selectedAttrRow.attributeName = attributeName
|
selectedAttrRow.attributeName = attributeName
|
||||||
@ -180,7 +197,6 @@ const handleRadioChange = (value: any) => {
|
|||||||
}
|
}
|
||||||
const selectstatAnalysisAttributes = () => {
|
const selectstatAnalysisAttributes = () => {
|
||||||
statAnalysisSelect.attributes = selectedAttrRow.attributeName
|
statAnalysisSelect.attributes = selectedAttrRow.attributeName
|
||||||
console.log('🚀 ~ selectstatAnalysisAttributes ~ selectedAttrRow:', selectedAttrRow)
|
|
||||||
statAnalysisSelect.attributeCode = selectedAttrRow.attributeCode
|
statAnalysisSelect.attributeCode = selectedAttrRow.attributeCode
|
||||||
statAnalysisSelect.unit = selectedAttrRow.unit
|
statAnalysisSelect.unit = selectedAttrRow.unit
|
||||||
showMeasure.value = false
|
showMeasure.value = false
|
||||||
@ -212,7 +228,9 @@ const option: any = {
|
|||||||
|
|
||||||
const statAnalysisSelectOptions: any = reactive({
|
const statAnalysisSelectOptions: any = reactive({
|
||||||
interval: [
|
interval: [
|
||||||
|
{ label: '一分钟', value: '1m' },
|
||||||
{ label: '五分钟', value: '5m' },
|
{ label: '五分钟', value: '5m' },
|
||||||
|
{ label: '十分钟', value: '10m' },
|
||||||
{ label: '十五分钟', value: '15m' },
|
{ label: '十五分钟', value: '15m' },
|
||||||
{ label: '一小时', value: '1h' },
|
{ label: '一小时', value: '1h' },
|
||||||
{ label: '一天', value: '1d' },
|
{ label: '一天', value: '1d' },
|
||||||
@ -226,25 +244,48 @@ const chart: any = ref(null)
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (chartContainer.value) {
|
if (chartContainer.value) {
|
||||||
chart.value = markRaw(echarts.init(chartContainer.value))
|
chart.value = markRaw(echarts.init(chartContainer.value))
|
||||||
chart.value.setOption({
|
}
|
||||||
xAxis: {
|
queryWindTurbines().then((res: any) => {
|
||||||
type: 'category',
|
statAnalysisSelect.deviceId = res.value
|
||||||
},
|
getAttributeList({
|
||||||
yAxis: {
|
iotModelId: res.iotModelId,
|
||||||
type: 'category',
|
pageNum: 1,
|
||||||
},
|
pageSize: 10,
|
||||||
series: [
|
attributeType: '138',
|
||||||
{
|
}).then((attrRes: any) => {
|
||||||
type: 'line',
|
statAnalysisSelect.attributes = attrRes.attributeName
|
||||||
},
|
statAnalysisSelect.attributeCode = attrRes.attributeCode
|
||||||
],
|
statAnalysisSelect.unit = attrRes.unit
|
||||||
grid: {},
|
selectedAttrRow.attributeCode = attrRes.attributeCode
|
||||||
|
selectedAttrRow.attributeName = attrRes.attributeName
|
||||||
|
selectedAttrRow.unit = attrRes.unit
|
||||||
|
customName.forEach((item: any, index: number, arr: any) => {
|
||||||
|
arr[index] = statAnalysisSelect.attributes + String(index + 1)
|
||||||
|
})
|
||||||
|
statAnalysisOperate()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const getAttributeList = (requestData: any) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
getModelAttributeListReq(requestData)
|
||||||
|
.then((res: any) => {
|
||||||
|
if (res.rows && res.rows.length > 0) {
|
||||||
|
resolve(res.rows[0])
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err: any) => {
|
||||||
|
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
queryWindTurbines()
|
|
||||||
})
|
|
||||||
const queryWindTurbines = () => {
|
const queryWindTurbines = () => {
|
||||||
queryWindTurbinesPages().then((res) => {
|
return new Promise((resolve) => {
|
||||||
|
queryWindTurbinesPages()
|
||||||
|
.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
statAnalysisSelectOptions.deviceId = res.data.map((item: any) => {
|
statAnalysisSelectOptions.deviceId = res.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
@ -253,10 +294,19 @@ const queryWindTurbines = () => {
|
|||||||
iotModelId: item.modelId,
|
iotModelId: item.modelId,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
resolve(statAnalysisSelectOptions.deviceId[0])
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
ElMessage.error(err ?? '查询失败')
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const radioActiveName = ref(138)
|
||||||
|
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
chart.value.resize()
|
chart.value.resize()
|
||||||
}
|
}
|
||||||
@ -328,12 +378,18 @@ const getTimeIntervals = (startTimestamp: number, endTimestamp: number) => {
|
|||||||
case 'NONE':
|
case 'NONE':
|
||||||
count = Math.floor((endDate - startDate) / 1000)
|
count = Math.floor((endDate - startDate) / 1000)
|
||||||
break
|
break
|
||||||
|
case '1m':
|
||||||
|
count = Math.floor((endDate - startDate) / (60 * 1000))
|
||||||
|
break
|
||||||
case '5m':
|
case '5m':
|
||||||
count = Math.floor((endDate - startDate) / (5 * 60 * 1000))
|
count = Math.floor((endDate - startDate) / (5 * 60 * 1000))
|
||||||
break
|
break
|
||||||
case '15m':
|
case '15m':
|
||||||
count = Math.floor((endDate - startDate) / (15 * 60 * 1000))
|
count = Math.floor((endDate - startDate) / (15 * 60 * 1000))
|
||||||
break
|
break
|
||||||
|
case '15m':
|
||||||
|
count = Math.floor((endDate - startDate) / (15 * 60 * 1000))
|
||||||
|
break
|
||||||
case '1h':
|
case '1h':
|
||||||
count = Math.floor((endDate - startDate) / (1 * 60 * 60 * 1000))
|
count = Math.floor((endDate - startDate) / (1 * 60 * 60 * 1000))
|
||||||
break
|
break
|
||||||
@ -350,8 +406,6 @@ const calculate: any = ref([{ max: '', min: '', average: '' }])
|
|||||||
var xDatas: any = []
|
var xDatas: any = []
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const statAnalysisOperate = () => {
|
const statAnalysisOperate = () => {
|
||||||
console.log('🚀 ~ findTime ~ times:', times)
|
|
||||||
|
|
||||||
const findTime = times.filter((item: any) => {
|
const findTime = times.filter((item: any) => {
|
||||||
return Array.isArray(item)
|
return Array.isArray(item)
|
||||||
})
|
})
|
||||||
@ -364,9 +418,6 @@ const statAnalysisOperate = () => {
|
|||||||
} else if (!findTime.length) {
|
} else if (!findTime.length) {
|
||||||
ElMessage.info('请选择查询时间!')
|
ElMessage.info('请选择查询时间!')
|
||||||
return
|
return
|
||||||
} else if (hasDuplicateArrays(times)) {
|
|
||||||
ElMessage.info('存在相同的查询时间!')
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
option.series = []
|
option.series = []
|
||||||
@ -377,7 +428,6 @@ const statAnalysisOperate = () => {
|
|||||||
const promises: any = []
|
const promises: any = []
|
||||||
|
|
||||||
times.forEach((time: any, index: number) => {
|
times.forEach((time: any, index: number) => {
|
||||||
console.log('🚀 ~ times.forEach ~ time:', time)
|
|
||||||
if (time && time[0] && time[1]) {
|
if (time && time[0] && time[1]) {
|
||||||
const requestData = {
|
const requestData = {
|
||||||
devices: [
|
devices: [
|
||||||
@ -485,6 +535,8 @@ const statAnalysisExport = () => {
|
|||||||
requestData.push(devices)
|
requestData.push(devices)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log('🚀 ~ times.forEach ~ requestData:', requestData)
|
||||||
|
|
||||||
trendAnalyseExport(requestData).then((res: any) => {
|
trendAnalyseExport(requestData).then((res: any) => {
|
||||||
const downloadUrl = window.URL.createObjectURL(res)
|
const downloadUrl = window.URL.createObjectURL(res)
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
@ -498,6 +550,7 @@ const statAnalysisExport = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const hasDuplicateArrays = (arr: any) => {
|
const hasDuplicateArrays = (arr: any) => {
|
||||||
|
arr = [...times, arr]
|
||||||
const seen = new Set()
|
const seen = new Set()
|
||||||
for (let subArray of arr) {
|
for (let subArray of arr) {
|
||||||
const subArrayStr = JSON.stringify(subArray)
|
const subArrayStr = JSON.stringify(subArray)
|
||||||
@ -516,9 +569,15 @@ const getTimestamps = (start: any, end: any, interval: any) => {
|
|||||||
while (current < end) {
|
while (current < end) {
|
||||||
timestamps.push(current)
|
timestamps.push(current)
|
||||||
switch (interval) {
|
switch (interval) {
|
||||||
|
case '1m':
|
||||||
|
current += 60 * 1000
|
||||||
|
break
|
||||||
case '5m':
|
case '5m':
|
||||||
current += 5 * 60 * 1000
|
current += 5 * 60 * 1000
|
||||||
break
|
break
|
||||||
|
case '15m':
|
||||||
|
current += 15 * 60 * 1000
|
||||||
|
break
|
||||||
case '1d':
|
case '1d':
|
||||||
current += 24 * 60 * 60 * 1000
|
current += 24 * 60 * 60 * 1000
|
||||||
break
|
break
|
||||||
@ -678,5 +737,48 @@ const timestampToTime = (timestamp: any) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
}
|
}
|
||||||
|
.transferRight {
|
||||||
|
height: 400px;
|
||||||
|
border: 1px solid #e1edf6;
|
||||||
|
border-radius: 6px;
|
||||||
|
margin-top: 20px;
|
||||||
|
.transferHeader {
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #333333;
|
||||||
|
background: #f7f9fc;
|
||||||
|
border-bottom: 1px solid #e1edf6;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
}
|
||||||
|
.transferMain {
|
||||||
|
padding: 0;
|
||||||
|
:deep(.el-table__row) {
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 20px;
|
||||||
|
background: #eff0f1;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.selectItem {
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 20px;
|
||||||
|
background: #eff0f1;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 10px;
|
||||||
|
list-style: none;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.el-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mainFooter {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -44,10 +44,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mainPart">
|
<div class="mainPart">
|
||||||
<el-table
|
<el-table
|
||||||
|
ref="tableDataLeftRef"
|
||||||
:data="tableDataLeft"
|
:data="tableDataLeft"
|
||||||
v-model:selection="selectedLeft"
|
v-model:selection="selectedLeft"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
row-key="id"
|
row-key="irn"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="name" label="风机名称" width="120" />
|
<el-table-column prop="name" label="风机名称" width="120" />
|
||||||
@ -56,7 +57,7 @@
|
|||||||
:data="tableDataRight"
|
:data="tableDataRight"
|
||||||
v-model:selection="selectedRight"
|
v-model:selection="selectedRight"
|
||||||
@selection-change="handleSelectionChange1"
|
@selection-change="handleSelectionChange1"
|
||||||
row-key="id"
|
row-key="irn"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="name" label="风机名称" width="120" />
|
<el-table-column prop="name" label="风机名称" width="120" />
|
||||||
@ -71,7 +72,6 @@
|
|||||||
<el-radio-group v-model="radioActiveName" @change="typeChange">
|
<el-radio-group v-model="radioActiveName" @change="typeChange">
|
||||||
<el-radio :value="138">模拟量</el-radio>
|
<el-radio :value="138">模拟量</el-radio>
|
||||||
<el-radio :value="199">计算量</el-radio>
|
<el-radio :value="199">计算量</el-radio>
|
||||||
<el-radio :value="140">状态量</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div class="mainPart">
|
<div class="mainPart">
|
||||||
@ -125,10 +125,12 @@ import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
|
|||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const statAnalysisInterval = ref('')
|
const statAnalysisInterval = ref('1h')
|
||||||
const statAnalysisSelectOptions: any = reactive({
|
const statAnalysisSelectOptions: any = reactive({
|
||||||
interval: [
|
interval: [
|
||||||
|
{ label: '一分钟', value: '1m' },
|
||||||
{ label: '五分钟', value: '5m' },
|
{ label: '五分钟', value: '5m' },
|
||||||
|
{ label: '十分钟', value: '10m' },
|
||||||
{ label: '十五分钟', value: '15m' },
|
{ label: '十五分钟', value: '15m' },
|
||||||
{ label: '一小时', value: '1h' },
|
{ label: '一小时', value: '1h' },
|
||||||
{ label: '一天', value: '1d' },
|
{ label: '一天', value: '1d' },
|
||||||
@ -180,23 +182,22 @@ const chart: any = ref(null)
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (chartContainer.value) {
|
if (chartContainer.value) {
|
||||||
chart.value = markRaw(echarts.init(chartContainer.value))
|
chart.value = markRaw(echarts.init(chartContainer.value))
|
||||||
chart.value.setOption({
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'category',
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
type: 'line',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
grid: {},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
queryWindTurbines()
|
|
||||||
getCompleteData()
|
queryWindTurbines().then((res) => {
|
||||||
|
selectedLeft.value = [tableDataLeft.value[0]]
|
||||||
|
getCompleteData().then((attrRes: any) => {
|
||||||
|
console.log('🚀 ~ getCompleteData ~ attrRes:', attrRes)
|
||||||
|
multipleSelection.value = [
|
||||||
|
{
|
||||||
|
attributeName: attrRes.attributeName,
|
||||||
|
attributeCode: attrRes.attributeCode,
|
||||||
|
unit: attrRes.unit,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
statAnalysisOperate()
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
const tableDataLeft = ref([])
|
const tableDataLeft = ref([])
|
||||||
const tableDataRight = ref([])
|
const tableDataRight = ref([])
|
||||||
@ -207,10 +208,13 @@ const selectedRight = ref([])
|
|||||||
const radioActiveName = ref(138)
|
const radioActiveName = ref(138)
|
||||||
const attributeTableRef = ref()
|
const attributeTableRef = ref()
|
||||||
const typeChange = () => {
|
const typeChange = () => {
|
||||||
getCompleteData()
|
pageSetting.current == 1 ? getCompleteData() : (pageSetting.current = 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryWindTurbines = () => {
|
const queryWindTurbines = () => {
|
||||||
queryWindTurbinesPages().then((res) => {
|
return new Promise((resolve) => {
|
||||||
|
queryWindTurbinesPages()
|
||||||
|
.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
const resData = res.data
|
const resData = res.data
|
||||||
if (resData.length) {
|
if (resData.length) {
|
||||||
@ -219,8 +223,15 @@ const queryWindTurbines = () => {
|
|||||||
tableDataLeft.value = resData.slice(0, middleIndex)
|
tableDataLeft.value = resData.slice(0, middleIndex)
|
||||||
tableDataRight.value = resData.slice(middleIndex)
|
tableDataRight.value = resData.slice(middleIndex)
|
||||||
}
|
}
|
||||||
|
resolve(resData[0])
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
ElMessage.error(err ?? '查询失败')
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageSetting = reactive({
|
const pageSetting = reactive({
|
||||||
@ -241,6 +252,7 @@ const getCompleteData = () => {
|
|||||||
pageSize: pageSetting.pageSize,
|
pageSize: pageSetting.pageSize,
|
||||||
attributeType: radioActiveName.value,
|
attributeType: radioActiveName.value,
|
||||||
}
|
}
|
||||||
|
return new Promise((resolve) => {
|
||||||
getModelAttributeListReq(requestData)
|
getModelAttributeListReq(requestData)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
if (res.rows && res.rows.length > 0) {
|
if (res.rows && res.rows.length > 0) {
|
||||||
@ -249,6 +261,7 @@ const getCompleteData = () => {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
initSelect()
|
initSelect()
|
||||||
})
|
})
|
||||||
|
resolve(attrTableData.value[0])
|
||||||
} else {
|
} else {
|
||||||
if (res.rows && res.rows.length === 0) {
|
if (res.rows && res.rows.length === 0) {
|
||||||
attrTableData.value = []
|
attrTableData.value = []
|
||||||
@ -260,6 +273,7 @@ const getCompleteData = () => {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const initSelect = () => {
|
const initSelect = () => {
|
||||||
@ -353,9 +367,16 @@ const getDateRange = (type: 'week' | 'month') => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tableDataLeftRef = ref()
|
||||||
const openMeasure = () => {
|
const openMeasure = () => {
|
||||||
showMeasure.value = true
|
showMeasure.value = true
|
||||||
pageSetting.current = 1
|
pageSetting.current = 1
|
||||||
|
nextTick(() => {
|
||||||
|
selectedLeft.value.forEach((item) => {
|
||||||
|
tableDataLeftRef.value?.toggleRowSelection(item, true)
|
||||||
|
})
|
||||||
|
initSelect()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSelectionChange1 = (val: any) => {
|
const handleSelectionChange1 = (val: any) => {
|
||||||
@ -378,6 +399,7 @@ function generateDeviceAttributes(devices: any, attributes: any) {
|
|||||||
|
|
||||||
const statAnalysisOperate = () => {
|
const statAnalysisOperate = () => {
|
||||||
const allDevices = [...selectedLeft.value, ...selectedRight.value]
|
const allDevices = [...selectedLeft.value, ...selectedRight.value]
|
||||||
|
console.log('🚀 ~ statAnalysisOperate ~ selectedRight.value:', selectedRight.value)
|
||||||
if (!statAnalysisTime.value) {
|
if (!statAnalysisTime.value) {
|
||||||
ElMessage.info('请选择查询时间!')
|
ElMessage.info('请选择查询时间!')
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user