|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div v-show="!showPointPage">
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<div class="device-statistics">
|
|
|
|
|
<div
|
|
|
|
|
@ -249,7 +250,7 @@
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="info-row">
|
|
|
|
|
<div class="info-label">
|
|
|
|
|
<i>📡</i>
|
|
|
|
|
<Icon icon="ep:connection" />
|
|
|
|
|
采集协议
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-value">
|
|
|
|
|
@ -258,7 +259,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row">
|
|
|
|
|
<div class="info-label">
|
|
|
|
|
<i>⏱️</i>
|
|
|
|
|
<Icon icon="ep:timer" />
|
|
|
|
|
采集时间
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-value">
|
|
|
|
|
@ -268,7 +269,7 @@
|
|
|
|
|
|
|
|
|
|
<div class="toggle-container" @click.stop>
|
|
|
|
|
<div class="toggle-label">
|
|
|
|
|
<i>🔘️</i>
|
|
|
|
|
<Icon icon="ep:switch" />
|
|
|
|
|
是否启用
|
|
|
|
|
</div>
|
|
|
|
|
<el-switch
|
|
|
|
|
@ -286,11 +287,11 @@
|
|
|
|
|
<div class="footer" @click.stop>
|
|
|
|
|
<div class="action-icons">
|
|
|
|
|
<el-button class="action-btn btn-primary" @click.stop="openDetailForm(item?.id,item?.deviceName)" >
|
|
|
|
|
<i>📍</i>
|
|
|
|
|
<Icon icon="ep:location" />
|
|
|
|
|
{{ t('DataCollection.Device.attributeModuleName') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button class="action-btn btn-success" @click.stop="openForm('setting', item?.id)" v-hasPermi="['iot:device:update']">
|
|
|
|
|
<i>⚙️</i>
|
|
|
|
|
<Icon icon="ep:setting" />
|
|
|
|
|
{{ t('DataCollection.Device.settingDialogTitle') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
@ -306,7 +307,7 @@
|
|
|
|
|
@click="handleCopy(item?.id)"
|
|
|
|
|
v-hasPermi="['iot:device:create']"
|
|
|
|
|
>
|
|
|
|
|
📋
|
|
|
|
|
<Icon icon="ep:document-copy" />
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip
|
|
|
|
|
@ -320,7 +321,7 @@
|
|
|
|
|
@click.stop="handleEdit(item)"
|
|
|
|
|
v-hasPermi="['iot:device:update']"
|
|
|
|
|
>
|
|
|
|
|
✏️
|
|
|
|
|
<Icon icon="ep:edit" />
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip
|
|
|
|
|
@ -328,7 +329,7 @@
|
|
|
|
|
placement="top"
|
|
|
|
|
effect="dark"
|
|
|
|
|
>
|
|
|
|
|
<el-button class="icon-btn" @click.stop="changeTable">🏠</el-button>
|
|
|
|
|
<el-button class="icon-btn" @click.stop="changeTable"><Icon icon="ep:list" /></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -342,13 +343,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
|
|
<DeviceForm ref="formRef" @success="getListOne" />
|
|
|
|
|
<!-- 子表的列表 -->
|
|
|
|
|
<!-- <ContentWrap v-if="ifShow">
|
|
|
|
|
<!-- 子表的列表:点位管理整页 -->
|
|
|
|
|
<ContentWrap v-show="showPointPage">
|
|
|
|
|
<template v-if="attributeDeviceId">
|
|
|
|
|
<div class="mb-10px flex items-center justify-between text-sm text-gray-500">
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" link @click="closePointPage">
|
|
|
|
|
<Icon icon="ep:arrow-left" class="mr-5px" /> 返回设备列表
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
{{ t('DataCollection.Device.currentDeviceLabel') }}<span class="font-medium text-gray-700">{{ attributeDeviceName || '-' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
@ -735,7 +742,7 @@
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</template>
|
|
|
|
|
<el-empty v-else :description="t('DataCollection.Device.emptyDescription')" />
|
|
|
|
|
</ContentWrap>-->
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<Dialog :title="t('DataCollection.Device.alarmHistoryTitle')" v-model="deviceAlarmDialogVisible" width="1200px">
|
|
|
|
|
<el-form
|
|
|
|
|
@ -835,9 +842,6 @@
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:弹出设备属性 -->
|
|
|
|
|
<DetailForm ref="detailFormRef" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
@ -856,10 +860,10 @@ import {
|
|
|
|
|
Location
|
|
|
|
|
} from '@element-plus/icons-vue'
|
|
|
|
|
import {useRouter} from "vue-router";
|
|
|
|
|
import DetailForm from "@/views/iot/device/detailForm.vue";
|
|
|
|
|
import {ProductUnitApi, ProductUnitVO} from "@/api/erp/product/unit";
|
|
|
|
|
const ifShow =ref(true)
|
|
|
|
|
const currentView = ref('table') // 'table' 或 'grid'
|
|
|
|
|
|
|
|
|
|
const ifShow =ref(false)
|
|
|
|
|
const currentView = ref('grid') // 'table' 或 'grid'
|
|
|
|
|
const showPointPage = ref(false) // 是否显示点位管理整页
|
|
|
|
|
// 在 script setup 中
|
|
|
|
|
const noImageUrl =
|
|
|
|
|
'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iODAiIGhlaWdodD0iODAiIGZpbGw9IiNFOUVDRUYiLz48dGV4dCB4PSI0MCIgeT0iNDUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IiM5OTkiIGZvbnQtc2l6ZT0iMTQiPuWbvueJh+WKoOi9veWksei0pTwvdGV4dD48L3N2Zz4='
|
|
|
|
|
@ -1134,13 +1138,18 @@ const formRef = ref()
|
|
|
|
|
const openForm = (type: string, id?: number) => {
|
|
|
|
|
formRef.value.open(type, id)
|
|
|
|
|
}
|
|
|
|
|
/** 设备属性弹出框 */
|
|
|
|
|
const detailFormRef = ref()
|
|
|
|
|
const openDetailForm = (id?: number,deviceName?:string) => {
|
|
|
|
|
/** 设备属性弹出框 - 改为整页内嵌显示 */
|
|
|
|
|
const openDetailForm = (id?: number, deviceName?: string) => {
|
|
|
|
|
if (!id) return
|
|
|
|
|
attributeDeviceId.value = id
|
|
|
|
|
attributeDeviceName.value = deviceName || ''
|
|
|
|
|
deviceTabActive.value = 'deviceAttribute'
|
|
|
|
|
showPointPage.value = true
|
|
|
|
|
}
|
|
|
|
|
const closePointPage = () => {
|
|
|
|
|
showPointPage.value = false
|
|
|
|
|
attributeDeviceId.value = undefined
|
|
|
|
|
attributeDeviceName.value = ''
|
|
|
|
|
detailFormRef.value.open(id,deviceName)
|
|
|
|
|
//formRef.value.open(id,deviceName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const enabledChange = (row: DeviceVO, value: boolean) => {
|
|
|
|
|
@ -1252,16 +1261,7 @@ const deviceRuleTabLabel = computed(() => {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const handleShowAttribute = (row: any) => {
|
|
|
|
|
attributeDeviceId.value = row?.id
|
|
|
|
|
attributeDeviceName.value = row?.deviceName ?? ''
|
|
|
|
|
router.push({
|
|
|
|
|
path: '/iot/pointManagement',
|
|
|
|
|
query: {
|
|
|
|
|
id: row?.id,
|
|
|
|
|
name: row?.deviceName
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
openDetailForm(row?.id, row?.deviceName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ruleLoading = ref(false)
|
|
|
|
|
|