1
0
forked from dyf/dyf-vue-ui

修复设备日志

This commit is contained in:
fengerli
2025-09-19 17:24:12 +08:00
parent bf1eb3ecbb
commit 517998a0db
5 changed files with 13 additions and 40 deletions

View File

@ -5,8 +5,8 @@ VITE_APP_TITLE = 云平台管理系统
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
#VITE_APP_BASE_API = 'https://fuyuanshen.com/backend' VITE_APP_BASE_API = 'https://fuyuanshen.com/backend'
VITE_APP_BASE_API = 'http://192.168.2.34:8000' #VITE_APP_BASE_API = 'http://192.168.2.23:8000'
#代永飞接口 #代永飞接口
#VITE_APP_BASE_API = 'http://457102h2d6.qicp.vip:24689' #VITE_APP_BASE_API = 'http://457102h2d6.qicp.vip:24689'

BIN
src/assets/index/IMG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -17,7 +17,9 @@ export interface SubscribeOptions {
// 根据当前页面协议自动选择MQTT配置 // 根据当前页面协议自动选择MQTT配置
const getMqttConfig = () => { const getMqttConfig = () => {
// 检测当前页面协议http: 或 https: // 检测当前页面协议http: 或 https:
const isHttps = window.location.protocol === 'https:'; //const isHttps = window.location.protocol === 'https:';
const isHttps = import.meta.env.VITE_APP_ENV === 'production' || window.location.protocol === 'https:';
console.log(isHttps,'检测环境'); console.log(isHttps,'检测环境');
return { return {

View File

@ -87,9 +87,10 @@
<template #default="scope"> <template #default="scope">
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="click">
<template #reference> <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" style="width: 40px; height: 40px; cursor: pointer; object-fit: contain"
class="hover:opacity-80 transition-opacity" /> class="hover:opacity-80 transition-opacity" />
<img v-else src="@/assets/index/IMG.png" alt="" style="width: 40px; height: 40px;">
</template> </template>
<img :src="scope.row.devicePic" style="max-width: 600px; max-height: 600px; object-fit: contain" /> <img :src="scope.row.devicePic" style="max-width: 600px; max-height: 600px; object-fit: contain" />
</el-popover> </el-popover>
@ -787,11 +788,11 @@ const submitForm = async () => {
}; };
// URL转Blob的方法函数 // URL转Blob的方法函数
const urlToBlob = async (url: string): Promise<Blob> => { // const urlToBlob = async (url: string): Promise<Blob> => {
const response = await fetch(url); // const response = await fetch(url);
if (!response.ok) throw new Error('图片加载失败'); // if (!response.ok) throw new Error('图片加载失败');
return await response.blob(); // return await response.blob();
}; // };
/** /**
* 关闭用户弹窗 * 关闭用户弹窗

View File

@ -23,44 +23,14 @@
</transition> </transition>
<el-card shadow="never"> <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 v-loading="loading" border :data="logList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <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="deviceAction" />
<el-table-column label="设备名称" align="center" prop="deviceName" /> <el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="数据来源" align="center" prop="dataSource" /> <el-table-column label="数据来源" align="center" prop="dataSource" />
<el-table-column label="操作时间" align="center" prop="createTime" /> <el-table-column label="操作时间" align="center" prop="createTime" />
<el-table-column label="内容" align="center" prop="content" /> <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> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card> </el-card>
<!-- 添加或修改设备日志对话框 --> <!-- 添加或修改设备日志对话框 -->