|
|
@@ -22,11 +22,11 @@
|
|
|
>
|
|
|
<div class="flex items-center justify-between w-full py-4px">
|
|
|
<div class="flex-1">
|
|
|
- <div class="text-14px font-500 text-[var(--el-text-color-primary)] mb-2px"
|
|
|
- >{{ product.name }}
|
|
|
+ <div class="text-14px font-500 text-[var(--el-text-color-primary)] mb-2px">
|
|
|
+ {{ product.name }}
|
|
|
</div>
|
|
|
- <div class="text-12px text-[var(--el-text-color-secondary)]"
|
|
|
- >{{ product.productKey }}
|
|
|
+ <div class="text-12px text-[var(--el-text-color-secondary)]">
|
|
|
+ {{ product.productKey }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="product.status" />
|
|
|
@@ -71,11 +71,11 @@
|
|
|
>
|
|
|
<div class="flex items-center justify-between w-full py-4px">
|
|
|
<div class="flex-1">
|
|
|
- <div class="text-14px font-500 text-[var(--el-text-color-primary)] mb-2px"
|
|
|
- >{{ device.deviceName }}
|
|
|
+ <div class="text-14px font-500 text-[var(--el-text-color-primary)] mb-2px">
|
|
|
+ {{ device.deviceName }}
|
|
|
</div>
|
|
|
- <div class="text-12px text-[var(--el-text-color-secondary)]"
|
|
|
- >{{ device.nickname || '无备注' }}
|
|
|
+ <div class="text-12px text-[var(--el-text-color-secondary)]">
|
|
|
+ {{ device.nickname || '无备注' }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-tag size="small" :type="getDeviceStatusTag(device.state)">
|
|
|
@@ -100,9 +100,9 @@
|
|
|
<div class="flex flex-col gap-6px ml-22px">
|
|
|
<div class="flex items-center gap-8px">
|
|
|
<span class="text-12px text-[var(--el-text-color-secondary)] min-w-40px">产品:</span>
|
|
|
- <span class="text-12px text-[var(--el-text-color-primary)] font-500">{{
|
|
|
- selectedProduct?.name
|
|
|
- }}</span>
|
|
|
+ <span class="text-12px text-[var(--el-text-color-primary)] font-500">
|
|
|
+ {{ selectedProduct?.name }}
|
|
|
+ </span>
|
|
|
<el-tag size="small" type="primary">{{ selectedProduct?.productKey }}</el-tag>
|
|
|
</div>
|
|
|
<div class="flex items-center gap-8px">
|
|
|
@@ -112,9 +112,9 @@
|
|
|
class="text-12px text-[var(--el-text-color-primary)] font-500"
|
|
|
>全部设备</span
|
|
|
>
|
|
|
- <span v-else class="text-12px text-[var(--el-text-color-primary)] font-500">{{
|
|
|
- selectedDevice?.deviceName
|
|
|
- }}</span>
|
|
|
+ <span v-else class="text-12px text-[var(--el-text-color-primary)] font-500">
|
|
|
+ {{ selectedDevice?.deviceName }}
|
|
|
+ </span>
|
|
|
<el-tag v-if="deviceSelectionMode === 'all'" size="small" type="warning"> 全部</el-tag>
|
|
|
<el-tag v-else size="small" :type="getDeviceStatusTag(selectedDevice?.state)">
|
|
|
{{ getDeviceStatusText(selectedDevice?.state) }}
|
|
|
@@ -141,9 +141,7 @@ interface Props {
|
|
|
|
|
|
interface Emits {
|
|
|
(e: 'update:productId', value?: number): void
|
|
|
-
|
|
|
(e: 'update:deviceId', value?: number): void
|
|
|
-
|
|
|
(e: 'change', value: { productId?: number; deviceId?: number }): void
|
|
|
}
|
|
|
|
|
|
@@ -200,16 +198,15 @@ const getDeviceStatusTag = (state?: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// TODO @puhui999:注释风格哈
|
|
|
// 事件处理
|
|
|
const handleProductChange = async (productId?: number) => {
|
|
|
localProductId.value = productId
|
|
|
localDeviceId.value = undefined
|
|
|
deviceList.value = []
|
|
|
-
|
|
|
if (productId) {
|
|
|
await getDeviceList(productId)
|
|
|
}
|
|
|
-
|
|
|
emitChange()
|
|
|
}
|
|
|
|
|
|
@@ -220,7 +217,6 @@ const handleDeviceChange = (deviceId?: number) => {
|
|
|
|
|
|
const handleDeviceSelectionModeChange = (mode: 'specific' | 'all') => {
|
|
|
deviceSelectionMode.value = mode
|
|
|
-
|
|
|
if (mode === 'all') {
|
|
|
// 全部设备时,设备 ID 设为 0
|
|
|
localDeviceId.value = 0
|
|
|
@@ -228,7 +224,6 @@ const handleDeviceSelectionModeChange = (mode: 'specific' | 'all') => {
|
|
|
// 选择设备时,清空设备 ID
|
|
|
localDeviceId.value = undefined
|
|
|
}
|
|
|
-
|
|
|
emitChange()
|
|
|
}
|
|
|
|