|
@@ -8,239 +8,288 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="20" :xs="24">
|
|
<el-col :span="20" :xs="24">
|
|
<ContentWrap v-loading="loading">
|
|
<ContentWrap v-loading="loading">
|
|
- <ContentWrap>
|
|
|
|
- <!-- 搜索工作栏 -->
|
|
|
|
- <el-form
|
|
|
|
- class="-mb-15px"
|
|
|
|
- :model="queryParams"
|
|
|
|
- ref="queryFormRef"
|
|
|
|
- :inline="true"
|
|
|
|
- label-width="68px"
|
|
|
|
- >
|
|
|
|
- <el-form-item :label="t('monitor.deviceName')" prop="deviceName" style="margin-left: 25px">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.deviceName"
|
|
|
|
- :placeholder="t('monitor.nameHolder')"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- class="!w-240px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item :label="t('monitor.deviceCode')" prop="deviceCode">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.deviceCode"
|
|
|
|
- :placeholder="t('monitor.codeHolder')"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- class="!w-240px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item class="float-right !mr-0 !mb-0">
|
|
|
|
- <el-button-group>
|
|
|
|
- <el-button :type="viewMode === 'card' ? 'primary' : 'default'" @click="viewMode = 'card'">
|
|
|
|
- <Icon icon="ep:grid" />
|
|
|
|
- </el-button>
|
|
|
|
- <el-button :type="viewMode === 'list' ? 'primary' : 'default'" @click="viewMode = 'list'">
|
|
|
|
- <Icon icon="ep:list" />
|
|
|
|
- </el-button>
|
|
|
|
- </el-button-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button @click="handleQuery">
|
|
|
|
- <Icon icon="ep:search" class="mr-5px" />
|
|
|
|
- {{t('monitor.search')}}
|
|
|
|
- </el-button>
|
|
|
|
- <el-button @click="resetQuery">
|
|
|
|
- <Icon icon="ep:refresh" class="mr-5px" />
|
|
|
|
- {{t('monitor.reset')}}
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- plain
|
|
|
|
- @click="handleExport"
|
|
|
|
- :loading="exportLoading"
|
|
|
|
- v-hasPermi="['iot:device:export']"
|
|
|
|
|
|
+ <ContentWrap>
|
|
|
|
+ <!-- 搜索工作栏 -->
|
|
|
|
+ <el-form
|
|
|
|
+ class="-mb-15px"
|
|
|
|
+ :model="queryParams"
|
|
|
|
+ ref="queryFormRef"
|
|
|
|
+ :inline="true"
|
|
|
|
+ label-width="68px"
|
|
>
|
|
>
|
|
- <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
- </el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </ContentWrap>
|
|
|
|
-
|
|
|
|
- <!-- 列表 -->
|
|
|
|
- <ContentWrap>
|
|
|
|
- <template v-if="viewMode === 'card'">
|
|
|
|
- <el-row :gutter="16">
|
|
|
|
- <el-col v-for="item in list" :key="item.id" :xs="24" :sm="12" :md="12" :lg="6" class="mb-4">
|
|
|
|
- <el-card
|
|
|
|
- class="h-full transition-colors relative overflow-hidden"
|
|
|
|
- :body-style="{ padding: '0' }"
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
+ :label="t('monitor.deviceName')"
|
|
|
|
+ prop="deviceName"
|
|
|
|
+ style="margin-left: 20px"
|
|
>
|
|
>
|
|
- <!-- 添加渐变背景层 -->
|
|
|
|
- <div
|
|
|
|
- class="absolute top-0 left-0 right-0 h-[50px] pointer-events-none"
|
|
|
|
- :class="[
|
|
|
|
- item.ifInline===3
|
|
|
|
- ? 'bg-gradient-to-b from-[#eefaff] to-transparent'
|
|
|
|
- : 'bg-gradient-to-b from-[#fff1f1] to-transparent'
|
|
|
|
- ]"
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.deviceName"
|
|
|
|
+ :placeholder="t('monitor.nameHolder')"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ class="!w-240px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="t('monitor.deviceCode')" prop="deviceCode">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.deviceCode"
|
|
|
|
+ :placeholder="t('monitor.codeHolder')"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ class="!w-240px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="t('monitor.ifInline')" prop="ifInline">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="queryParams.ifInline"
|
|
|
|
+ :placeholder="t('monitor.ifInlineHolder')"
|
|
|
|
+ clearable
|
|
|
|
+ class="!w-240px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in getStrDictOptions(DICT_TYPE.IOT_DEVICE_STATUS)"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.label"
|
|
|
|
+ :value="dict.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item class="float-right !mr-0 !mb-0">
|
|
|
|
+ <el-button-group>
|
|
|
|
+ <el-button
|
|
|
|
+ :type="viewMode === 'card' ? 'primary' : 'default'"
|
|
|
|
+ @click="viewMode = 'card'"
|
|
|
|
+ >
|
|
|
|
+ <Icon icon="ep:grid" />
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ :type="viewMode === 'list' ? 'primary' : 'default'"
|
|
|
|
+ @click="viewMode = 'list'"
|
|
|
|
+ >
|
|
|
|
+ <Icon icon="ep:list" />
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-button-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button @click="handleQuery">
|
|
|
|
+ <Icon icon="ep:search" class="mr-5px" />
|
|
|
|
+ {{ t('monitor.search') }}
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button @click="resetQuery">
|
|
|
|
+ <Icon icon="ep:refresh" class="mr-5px" />
|
|
|
|
+ {{ t('monitor.reset') }}
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="success"
|
|
|
|
+ plain
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
+ v-hasPermi="['iot:device:export']"
|
|
>
|
|
>
|
|
- </div>
|
|
|
|
- <div class="p-4 relative">
|
|
|
|
- <!-- 标题区域 -->
|
|
|
|
- <div class="flex items-center mb-3">
|
|
|
|
- <div class="mr-2.5 flex items-center">
|
|
|
|
- <img src="@/assets/svgs/iot/card-fill.svg" class="w-[18px] h-[18px]" />
|
|
|
|
|
|
+ <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </ContentWrap>
|
|
|
|
+
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <ContentWrap>
|
|
|
|
+ <template v-if="viewMode === 'card'">
|
|
|
|
+ <el-row :gutter="16">
|
|
|
|
+ <el-col
|
|
|
|
+ v-for="item in list"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :xs="24"
|
|
|
|
+ :sm="12"
|
|
|
|
+ :md="12"
|
|
|
|
+ :lg="6"
|
|
|
|
+ class="mb-4"
|
|
|
|
+ >
|
|
|
|
+ <el-card
|
|
|
|
+ class="h-full transition-colors relative overflow-hidden"
|
|
|
|
+ :body-style="{ padding: '0' }"
|
|
|
|
+ >
|
|
|
|
+ <!-- 添加渐变背景层 -->
|
|
|
|
+ <div
|
|
|
|
+ class="absolute top-0 left-0 right-0 h-[50px] pointer-events-none"
|
|
|
|
+ :class="[
|
|
|
|
+ item.ifInline === 3
|
|
|
|
+ ? 'bg-gradient-to-b from-[#eefaff] to-transparent'
|
|
|
|
+ : 'bg-gradient-to-b from-[#fff1f1] to-transparent'
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
- <div class="text-[16px] font-600 flex-1">{{ item.deviceCode+item.deviceName }}</div>
|
|
|
|
- <!-- 添加设备状态标签 -->
|
|
|
|
- <div class="inline-flex items-center">
|
|
|
|
- <div
|
|
|
|
- class="w-1 h-1 rounded-full mr-1.5"
|
|
|
|
- :class="item.ifInline===3? 'bg-[var(--el-color-success)]': 'bg-[var(--el-color-danger)]'"
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="p-4 relative">
|
|
|
|
+ <!-- 标题区域 -->
|
|
|
|
+ <div class="flex items-center mb-3">
|
|
|
|
+ <div class="mr-2.5 flex items-center">
|
|
|
|
+ <img src="@/assets/svgs/iot/card-fill.svg" class="w-[18px] h-[18px]" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="text-[16px] font-600 flex-1">{{
|
|
|
|
+ item.deviceCode + item.deviceName
|
|
|
|
+ }}</div>
|
|
|
|
+ <!-- 添加设备状态标签 -->
|
|
|
|
+ <div class="inline-flex items-center">
|
|
|
|
+ <div
|
|
|
|
+ class="w-1 h-1 rounded-full mr-1.5"
|
|
|
|
+ :class="
|
|
|
|
+ item.ifInline === 3
|
|
|
|
+ ? 'bg-[var(--el-color-success)]'
|
|
|
|
+ : 'bg-[var(--el-color-danger)]'
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <el-text
|
|
|
|
+ class="!text-xs font-bold"
|
|
|
|
+ :type="item.ifInline === 3 ? 'success' : 'danger'"
|
|
|
|
+ >
|
|
|
|
+ {{ getDictLabel(DICT_TYPE.IOT_DEVICE_STATUS, item.ifInline) }}
|
|
|
|
+ </el-text>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <el-text
|
|
|
|
- class="!text-xs font-bold"
|
|
|
|
- :type="item.ifInline===3 ? 'success' : 'danger'"
|
|
|
|
- >
|
|
|
|
- {{ getDictLabel(DICT_TYPE.IOT_DEVICE_STATUS, item.ifInline) }}
|
|
|
|
- </el-text>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
|
|
- <!-- 信息区域 -->
|
|
|
|
- <div class="flex items-center text-[14px]">
|
|
|
|
- <div class="flex-1">
|
|
|
|
- <div class="mb-2.5 last:mb-0">
|
|
|
|
- <span class="text-[#717c8e] mr-2.5">{{ t('monitor.deviceCode') }}</span>
|
|
|
|
- <span class="text-[#0070ff]">
|
|
|
|
- {{ item.deviceCode }}
|
|
|
|
- </span>
|
|
|
|
|
|
+ <!-- 信息区域 -->
|
|
|
|
+ <div class="flex items-center text-[14px]">
|
|
|
|
+ <div class="flex-1">
|
|
|
|
+ <div class="mb-2.5 last:mb-0">
|
|
|
|
+ <span class="text-[#717c8e] mr-2.5">{{ t('monitor.deviceCode') }}</span>
|
|
|
|
+ <span class="text-[#0070ff]">
|
|
|
|
+ {{ item.deviceCode }}
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mb-2.5 last:mb-0">
|
|
|
|
+ <span class="text-[#717c8e] mr-2.5">{{ t('monitor.category') }}</span>
|
|
|
|
+ <span class="text-[#0070ff]">
|
|
|
|
+ {{ item.assetClassName }}
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mb-2.5 last:mb-0">
|
|
|
|
+ <span class="text-[#717c8e] mr-2.5">{{
|
|
|
|
+ t('monitor.latestDataTime')
|
|
|
|
+ }}</span>
|
|
|
|
+ <span class="text-[#0070ff]">
|
|
|
|
+ {{ item.lastInlineTime }}
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-[100px] h-[100px]">
|
|
|
|
+ <img src="@/assets/imgs/iot/device.png" class="w-full h-full" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <div class="mb-2.5 last:mb-0">
|
|
|
|
- <span class="text-[#717c8e] mr-2.5">{{t('monitor.category')}}</span>
|
|
|
|
- <span class="text-[#0070ff]">
|
|
|
|
- {{ item.assetClassName }}
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- <div class="mb-2.5 last:mb-0">
|
|
|
|
- <span class="text-[#717c8e] mr-2.5">{{ t('monitor.latestDataTime') }}</span>
|
|
|
|
- <span class="text-[#0070ff]">
|
|
|
|
- {{ item.lastInlineTime }}
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="w-[100px] h-[100px]">
|
|
|
|
- <img src="@/assets/imgs/iot/device.png" class="w-full h-full" />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 分隔线 -->
|
|
|
|
- <el-divider class="!my-3" />
|
|
|
|
-
|
|
|
|
- <!-- 按钮 -->
|
|
|
|
- <div class="flex items-center px-0">
|
|
|
|
- <el-button
|
|
|
|
- class="flex-1 !px-2 !h-[32px] text-[13px]"
|
|
|
|
- type="warning"
|
|
|
|
- plain
|
|
|
|
- @click="openDetail(item.id, item.ifInline, item.lastInlineTime,item.deviceName,item.deviceCode,item.deptName)"
|
|
|
|
- >
|
|
|
|
- <Icon icon="ep:view" class="mr-1" />
|
|
|
|
- {{ t('monitor.details') }}
|
|
|
|
- </el-button>
|
|
|
|
-<!-- <div class="mx-[10px] h-[20px] w-[1px] bg-[#dcdfe6]"></div>-->
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-card>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </template>
|
|
|
|
|
|
|
|
- <!-- 列表视图 -->
|
|
|
|
- <el-table
|
|
|
|
- v-else
|
|
|
|
- v-loading="loading"
|
|
|
|
- :data="list"
|
|
|
|
- :stripe="true"
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
|
|
+ <!-- 分隔线 -->
|
|
|
|
+ <el-divider class="!my-3" />
|
|
|
|
|
|
- >
|
|
|
|
- <el-table-column :label="t('monitor.serial')" width="60" align="center">
|
|
|
|
- <template #default="scope">
|
|
|
|
- {{ scope.$index + 1 }}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column :label="t('monitor.deviceName')" align="center" prop="deviceName">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <el-link @click="openDetail(scope.row.id)">{{ scope.row.deviceName }}</el-link>
|
|
|
|
|
|
+ <!-- 按钮 -->
|
|
|
|
+ <div class="flex items-center px-0">
|
|
|
|
+ <el-button
|
|
|
|
+ class="flex-1 !px-2 !h-[32px] text-[13px]"
|
|
|
|
+ type="warning"
|
|
|
|
+ plain
|
|
|
|
+ @click="
|
|
|
|
+ openDetail(
|
|
|
|
+ item.id,
|
|
|
|
+ item.ifInline,
|
|
|
|
+ item.lastInlineTime,
|
|
|
|
+ item.deviceName,
|
|
|
|
+ item.deviceCode,
|
|
|
|
+ item.deptName
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <Icon icon="ep:view" class="mr-1" />
|
|
|
|
+ {{ t('monitor.details') }}
|
|
|
|
+ </el-button>
|
|
|
|
+ <!-- <div class="mx-[10px] h-[20px] w-[1px] bg-[#dcdfe6]"></div>-->
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column :label="t('monitor.deviceCode')" align="center" prop="deviceCode" />
|
|
|
|
|
|
|
|
- <el-table-column :label="t('monitor.category')" align="center" prop="assetClassName" />
|
|
|
|
- <el-table-column :label="t('monitor.status')" align="center" prop="deviceStatus" >
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.PMS_DEVICE_STATUS" :value="scope.row.deviceStatus" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column :label="t('monitor.online')" align="center" prop="ifInline" >
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.IOT_DEVICE_STATUS" :value="scope.row.ifInline" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- :label="t('monitor.latestDataTime')"
|
|
|
|
- align="center"
|
|
|
|
- prop="lastInlineTime"
|
|
|
|
- :formatter="dateFormatter"
|
|
|
|
- width="180px"
|
|
|
|
- />
|
|
|
|
- <el-table-column :label="t('monitor.operation')" align="center" min-width="120px">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <el-button
|
|
|
|
- link
|
|
|
|
- type="primary"
|
|
|
|
- @click="openDetail(scope.row.id, scope.row.ifInline, scope.row.lastInlineTime,scope.row.deviceName,scope.row.deviceCode)"
|
|
|
|
- >
|
|
|
|
- {{t('monitor.check')}}
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ <!-- 列表视图 -->
|
|
|
|
+ <el-table
|
|
|
|
+ v-else
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="list"
|
|
|
|
+ :stripe="true"
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column :label="t('monitor.serial')" width="60" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column :label="t('monitor.deviceName')" align="center" prop="deviceName">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-link @click="openDetail(scope.row.id)">{{ scope.row.deviceName }}</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column :label="t('monitor.deviceCode')" align="center" prop="deviceCode" />
|
|
|
|
+
|
|
|
|
+ <el-table-column :label="t('monitor.category')" align="center" prop="assetClassName" />
|
|
|
|
+ <el-table-column :label="t('monitor.status')" align="center" prop="deviceStatus">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.PMS_DEVICE_STATUS" :value="scope.row.deviceStatus" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column :label="t('monitor.online')" align="center" prop="ifInline">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.IOT_DEVICE_STATUS" :value="scope.row.ifInline" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ :label="t('monitor.latestDataTime')"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="lastInlineTime"
|
|
|
|
+ :formatter="dateFormatter"
|
|
|
|
+ width="180px"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column :label="t('monitor.operation')" align="center" min-width="120px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ link
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="
|
|
|
|
+ openDetail(
|
|
|
|
+ scope.row.id,
|
|
|
|
+ scope.row.ifInline,
|
|
|
|
+ scope.row.lastInlineTime,
|
|
|
|
+ scope.row.deviceName,
|
|
|
|
+ scope.row.deviceCode,
|
|
|
|
+ scope.row.deptName,
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ {{ t('monitor.check') }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
|
|
- <!-- 分页 -->
|
|
|
|
- <Pagination
|
|
|
|
- :total="total"
|
|
|
|
- v-model:page="queryParams.pageNo"
|
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
|
- @pagination="getList"
|
|
|
|
- />
|
|
|
|
- </ContentWrap>
|
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
+ <Pagination
|
|
|
|
+ :total="total"
|
|
|
|
+ v-model:page="queryParams.pageNo"
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
+ @pagination="getList"
|
|
|
|
+ />
|
|
|
|
+ </ContentWrap>
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
-
|
|
|
|
-<!-- <!– 表单弹窗:添加/修改 –>-->
|
|
|
|
-<!-- <DeviceForm ref="formRef" @success="getList" />-->
|
|
|
|
-<!-- <!– 分组表单组件 –>-->
|
|
|
|
-<!-- <DeviceGroupForm ref="groupFormRef" @success="getList" />-->
|
|
|
|
-<!-- <!– 导入表单组件 –>-->
|
|
|
|
-<!-- <DeviceImportForm ref="importFormRef" @success="getList" />-->
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
|
|
|
|
|
+import { DICT_TYPE, getDictLabel, getStrDictOptions } from '@/utils/dict'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
-import { DeviceApi, DeviceVO, DeviceStateEnum } from '@/api/iot/device/device'
|
|
|
|
|
|
+import { DeviceApi, DeviceVO } from '@/api/iot/device/device'
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
-
|
|
|
|
-import DeptTree from "@/views/system/user/DeptTree.vue";
|
|
|
|
-import {IotDeviceApi} from "@/api/pms/device";
|
|
|
|
-
|
|
|
|
|
|
+import DeptTree from '@/views/system/user/DeptTree.vue'
|
|
|
|
+import { IotDeviceApi } from '@/api/pms/device'
|
|
/** IoT 设备列表 */
|
|
/** IoT 设备列表 */
|
|
-defineOptions({ name: 'IoTDevice' })
|
|
|
|
|
|
+defineOptions({ name: 'IoTDeviceMonitor' })
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
@@ -278,16 +327,14 @@ const queryParams = reactive({
|
|
infoRemark: undefined,
|
|
infoRemark: undefined,
|
|
infoUrl: undefined,
|
|
infoUrl: undefined,
|
|
templateJson: undefined,
|
|
templateJson: undefined,
|
|
- creator: undefined
|
|
|
|
|
|
+ creator: undefined,
|
|
|
|
+ ifInline: undefined
|
|
})
|
|
})
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const exportLoading = ref(false) // 导出加载状态
|
|
const exportLoading = ref(false) // 导出加载状态
|
|
const products = ref<ProductVO[]>([]) // 产品列表
|
|
const products = ref<ProductVO[]>([]) // 产品列表
|
|
-const deviceGroups = ref<DeviceGroupVO[]>([]) // 设备分组列表
|
|
|
|
const selectedIds = ref<number[]>([]) // 选中的设备编号数组
|
|
const selectedIds = ref<number[]>([]) // 选中的设备编号数组
|
|
const viewMode = ref<'card' | 'list'>('card') // 视图模式状态
|
|
const viewMode = ref<'card' | 'list'>('card') // 视图模式状态
|
|
-const defaultPicUrl = ref('@/src/assets/imgs/iot/device.png') // 默认设备图片
|
|
|
|
-const defaultIconUrl = ref('/src/assets/svgs/iot/card-fill.svg') // 默认设备图标
|
|
|
|
|
|
|
|
/** 查询列表 */
|
|
/** 查询列表 */
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
@@ -322,15 +369,21 @@ const resetQuery = () => {
|
|
|
|
|
|
/** 打开详情 */
|
|
/** 打开详情 */
|
|
const { push } = useRouter()
|
|
const { push } = useRouter()
|
|
-const openDetail = (id: number,ifInline: string, time:string, name:string,code:string, dept:string) => {
|
|
|
|
- if (time === null||time === undefined) {
|
|
|
|
- message.warning("没有数采数据")
|
|
|
|
|
|
+const openDetail = (
|
|
|
|
+ id: number,
|
|
|
|
+ ifInline: string,
|
|
|
|
+ time: string,
|
|
|
|
+ name: string,
|
|
|
|
+ code: string,
|
|
|
|
+ dept: string
|
|
|
|
+) => {
|
|
|
|
+ if (time === null || time === undefined) {
|
|
|
|
+ message.warning('没有数采数据')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- push({ name: 'TdDeviceDetail', params: { id,ifInline, time,name,code,dept } })
|
|
|
|
|
|
+ push({ name: 'TdDeviceDetail', params: { id, ifInline, time, name, code, dept } })
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/** 导出方法 */
|
|
/** 导出方法 */
|
|
const handleExport = async () => {
|
|
const handleExport = async () => {
|
|
try {
|
|
try {
|