feat:【IoT 物联网】优化产品详情页

This commit is contained in:
YunaiV
2025-06-15 21:19:21 +08:00
parent 259f437ea4
commit 223bfec5e5
4 changed files with 32 additions and 28 deletions

View File

@ -13,7 +13,7 @@
<el-button
@click="openForm('update', product.id)"
v-hasPermi="['iot:product:update']"
v-if="product.status === 0"
:disabled="product.status === 1"
>
编辑
</el-button>
@ -37,15 +37,13 @@
</div>
</div>
<ContentWrap class="mt-10px">
<el-descriptions :column="5" direction="horizontal">
<el-descriptions :column="1" direction="horizontal">
<el-descriptions-item label="ProductKey">
{{ product.productKey }}
<el-button @click="copyToClipboard(product.productKey)">复制</el-button>
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="5" direction="horizontal">
<el-descriptions-item label="设备数">
{{ product.deviceCount ?? '加载中...' }}
<el-descriptions-item label="设备总数">
<span class="ml-20px mr-10px">{{ product.deviceCount ?? '加载中...' }}</span>
<el-button @click="goToDeviceList(product.id)">前往管理</el-button>
</el-descriptions-item>
</el-descriptions>

View File

@ -5,7 +5,7 @@
<el-tab-pane label="产品信息" name="info">
<ProductDetailsInfo v-if="activeTab === 'info'" :product="product" />
</el-tab-pane>
<el-tab-pane label="功能定义" lazy name="thingModel">
<el-tab-pane label="物模型(功能定义" lazy name="thingModel">
<IoTProductThingModel ref="thingModelRef" />
</el-tab-pane>
</el-tabs>

View File

@ -15,6 +15,7 @@
class="!w-240px"
clearable
placeholder="请选择功能类型"
@change="handleQuery"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.IOT_THING_MODEL_TYPE)"
@ -25,14 +26,6 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery">
<Icon class="mr-5px" icon="ep:search" />
搜索
</el-button>
<el-button @click="resetQuery">
<Icon class="mr-5px" icon="ep:refresh" />
重置
</el-button>
<el-button
v-hasPermi="[`iot:thing-model:create`]"
plain
@ -42,7 +35,7 @@
<Icon class="mr-5px" icon="ep:plus" />
添加功能
</el-button>
<el-button v-hasPermi="[`iot:thing-model:query`]" plain type="primary" @click="openTSL">
<el-button v-hasPermi="[`iot:thing-model:query`]" plain type="success" @click="openTSL">
TSL
</el-button>
</el-form-item>
@ -100,6 +93,7 @@
/>
</el-tabs>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ThingModelForm ref="formRef" @success="getList" />
<ThingModelTSL ref="thingModelTSLRef" />
@ -152,13 +146,6 @@ const handleQuery = () => {
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
queryParams.type = undefined
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {