forked from dyf/dyf-vue-ui
修复设备日志
This commit is contained in:
BIN
src/assets/index/IMG.png
Normal file
BIN
src/assets/index/IMG.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@ -17,8 +17,10 @@ export interface SubscribeOptions {
|
||||
// 根据当前页面协议自动选择MQTT配置
|
||||
const getMqttConfig = () => {
|
||||
// 检测当前页面协议(http: 或 https:)
|
||||
const isHttps = window.location.protocol === 'https:';
|
||||
console.log(isHttps,'检测环境');
|
||||
//const isHttps = window.location.protocol === 'https:';
|
||||
|
||||
const isHttps = import.meta.env.VITE_APP_ENV === 'production' || window.location.protocol === 'https:';
|
||||
console.log(isHttps,'检测环境');
|
||||
|
||||
return {
|
||||
// 自动切换协议:https页面用wss,http页面用ws
|
||||
|
||||
@ -87,9 +87,10 @@
|
||||
<template #default="scope">
|
||||
<el-popover placement="right" trigger="click">
|
||||
<template #reference>
|
||||
<img :src="scope.row.devicePic"
|
||||
<img v-if="scope.row.devicePic" :src="scope.row.devicePic"
|
||||
style="width: 40px; height: 40px; cursor: pointer; object-fit: contain"
|
||||
class="hover:opacity-80 transition-opacity" />
|
||||
<img v-else src="@/assets/index/IMG.png" alt="" style="width: 40px; height: 40px;">
|
||||
</template>
|
||||
<img :src="scope.row.devicePic" style="max-width: 600px; max-height: 600px; object-fit: contain" />
|
||||
</el-popover>
|
||||
@ -787,11 +788,11 @@ const submitForm = async () => {
|
||||
};
|
||||
|
||||
// URL转Blob的方法函数
|
||||
const urlToBlob = async (url: string): Promise<Blob> => {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) throw new Error('图片加载失败');
|
||||
return await response.blob();
|
||||
};
|
||||
// const urlToBlob = async (url: string): Promise<Blob> => {
|
||||
// const response = await fetch(url);
|
||||
// if (!response.ok) throw new Error('图片加载失败');
|
||||
// return await response.blob();
|
||||
// };
|
||||
|
||||
/**
|
||||
* 关闭用户弹窗
|
||||
|
||||
@ -23,44 +23,14 @@
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['equipment:log:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['equipment:log:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['equipment:log:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['equipment:log:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="logList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="设备行为" align="center" prop="deviceAction" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="数据来源" align="center" prop="dataSource" />
|
||||
<el-table-column label="操作时间" align="center" prop="createTime" />
|
||||
<el-table-column label="内容" align="center" prop="content" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['equipment:log:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['equipment:log:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改设备日志对话框 -->
|
||||
|
||||
Reference in New Issue
Block a user