摄像头、智能水表、智能电表、温湿度计各弹窗宽度

This commit is contained in:
1378012178@qq.com 2026-02-04 15:58:41 +08:00
parent e57dbf7c97
commit 243914add5
4 changed files with 209 additions and 203 deletions

View File

@ -1,87 +1,94 @@
<template>
<div style="padding: 4px;">
<!--查询区域-->
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<!-- <a-col :lg="6">
<a-form-item name="address">
<template #label><span title="SN">SN</span></template>
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></j-input>
</a-form-item>
</a-col> -->
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear></j-input>
</a-form-item>
</a-col> -->
<a-col :lg="6">
<a-form-item name="nuId">
<template #label><span title="区域">区域</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
placeholder="请选区域" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-row style="margin-top: -20px;">
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6"
style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
<template #title>
<a-row style="font-weight: normal;">
<a-col :span="18" >
<div style="font-size: 14px;">SN<span style="font-weight: bold;">{{item.sn?item.sn:'未配置'}}</span></div>
<div style="font-size: 12px;">设备名称{{item.deviceName}}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.deviceStatus=='1'?'zxClass':'lxClass'">{{item.deviceStatus =='1'?'在线':'离线'}}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
<a-row style="font-weight: normal;">
<a-col :span="18">
<div style="font-size: 14px;">SN<span style="font-weight: bold;">{{ item.sn ? item.sn : '未配置' }}</span></div>
<div style="font-size: 12px;">设备名称{{ item.deviceName }}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.deviceStatus == '1' ? 'zxClass' : 'lxClass'">{{ item.deviceStatus == '1' ? '在线' : '离线' }}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
</template>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;font-size:12px">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;font-size:12px">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="24" style="text-align: center;font-size: 44px;font-weight: bold;margin-top:18px;">
<img src="../../../../../assets/iot/sxt.png" style="width:80px;" />
</a-col>
</a-row>
<a-divider />
<a-row style="margin-top:-10px;">
<a-col :span="12"
style="margin-top: -10px;font-size:12px">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;font-size:12px">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
{{ item.nuId ? item.nuId : '未配置' }}</span>
</a-col>
<a-col :span="24" style="text-align: center;font-size: 44px;font-weight: bold;margin-top:18px;">
<img src="../../../../../assets/iot/sxt.png" style="width:80px;" />
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handlePreview(item)">
<span class="tbClass"><img src="../../../../../assets/iot/a14.png" style="width:20px;" /></span><br/>
<span class="antTitle">预览</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleEdit(item)">
<span class="tbClass"><img src="../../../../../assets/iot/a13.png" style="width:20px;" /></span><br/>
<span class="antTitle">编辑</span>
</span>
<!-- <span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handlePicConfig(item)">
<span style="display:inline-block;cursor: pointer;" @click="handlePreview(item)">
<span class="tbClass"><img src="../../../../../assets/iot/a14.png" style="width:20px;" /></span><br />
<span class="antTitle">预览</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleEdit(item)">
<span class="tbClass"><img src="../../../../../assets/iot/a13.png" style="width:20px;" /></span><br />
<span class="antTitle">编辑</span>
</span>
<!-- <span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handlePicConfig(item)">
<span class="tbClass"><img src="../../../../../assets/iot/a12.png" style="width:20px;" /></span><br/>
<span class="antTitle">画面配置</span>
</span> -->
</p>
</p>
</a-card>
</a-col>
<a-col v-if="tableData.total==0" >
<a-col v-if="tableData.total == 0">
<div style="margin: 30px auto;">
<a-empty />
</div>
</a-col>
</a-row>
<div v-if="tableData.total > 0"
<div v-if="tableData.total > 0"
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
<span style="margin-right: 10px;"> {{ tableData.total }} 条数据</span>
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
show-quick-jumper :total="tableData.total" @change="reload" />
</div>
<!--引用表格-->
<!-- <BasicTable @register="registerTable">
<!--引用表格-->
<!-- <BasicTable @register="registerTable">
<template #tableTitle>
</template>
<template #action="{ record }">
@ -90,197 +97,196 @@
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable> -->
<!-- 表单区域 -->
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
<CameraPictureConfigModal ref="cameraPictureConfigModal"></CameraPictureConfigModal>
<CameraInfoDrawer @register="registerDrawer" @success="handleSuccess" />
</div>
<!-- 表单区域 -->
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
<CameraPictureConfigModal ref="cameraPictureConfigModal"></CameraPictureConfigModal>
<CameraInfoDrawer @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import {ref, reactive, createVNode, h, onMounted, watch, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from '../camera.data';
import {getImageCommon, list} from '../camera.api';
import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router';
import CameraPreviewModal from './CameraPreviewModal.vue'
import CameraInfoDrawer from './CameraInfoDrawer.vue'
import { defHttp } from '/@/utils/http/axios';
import { ref, reactive, createVNode, h, onMounted, watch, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from '../camera.data';
import { getImageCommon, list } from '../camera.api';
import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router';
import CameraPreviewModal from './CameraPreviewModal.vue'
import CameraInfoDrawer from './CameraInfoDrawer.vue'
import { defHttp } from '/@/utils/http/axios';
import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import CameraPictureConfigModal from '/@/views/iot/tplink/camera/components/CameraPictureConfigModal.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import CameraPictureConfigModal from '/@/views/iot/tplink/camera/components/CameraPictureConfigModal.vue';
const props = defineProps({
data: { type: Object, default: () => ({}) },
});
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
let router = useRouter();
const formRef = ref();
const queryParam = reactive<any>({});
const registerModal = ref();
const previewModal = ref();
const deviceModal = ref();
const cameraPictureConfigModal = ref();
const userStore = useUserStore();
const tableData = ref<any>([]);
const props = defineProps({
data: { type: Object, default: () => ({}) },
});
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
let router = useRouter();
const formRef = ref();
const queryParam = reactive<any>({});
const registerModal = ref();
const previewModal = ref();
const deviceModal = ref();
const cameraPictureConfigModal = ref();
const userStore = useUserStore();
const tableData = ref<any>([]);
const pageParams = ref({ pageNo: 1, pageSize: 8 })
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 编辑
*/
function handleEdit(record: Recordable) {
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
}
/**
* 编辑
*/
function handleEdit(record: Recordable) {
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
/**
* 预览
*/
function handlePreview(record: Recordable) {
if (record.deviceIndex == null) {
return
}
/**
* 预览
*/
function handlePreview(record: Recordable) {
if (record.deviceIndex == null) {
return
}
getImageCommon({
"deviceIndex": record.deviceIndex,
"type": "switch"
}).then(res => {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}).catch(res=>{
reload();
});
}
/**
* 成功回调
*/
function handleSuccess() {
getImageCommon({
"deviceIndex": record.deviceIndex,
"type": "switch"
}).then(res => {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}).catch(res => {
reload();
}
});
/**
* 画面配置
*/
function handlePicConfig(record) {
var params = {
deviceIndex: record.deviceIndex,
parentId: record.parentId,
multitrans: record.multitrans,
projectId: record.projectId,
regionId: record.regionId,
ip: record.ip
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 画面配置
*/
function handlePicConfig(record) {
var params = {
deviceIndex: record.deviceIndex,
parentId: record.parentId,
multitrans: record.multitrans,
projectId: record.projectId,
regionId: record.regionId,
ip: record.ip
}
cameraPictureConfigModal.value.disableSubmit = true;
cameraPictureConfigModal.value.edit(params);
}
/**
* 左侧树选择后触发
*/
function onTreeSelect(data) {
// departData.value = data;
}
/**
* 左侧树rootTreeData触发
*/
function onRootTreeData(data) {
// rootTreeData.value = data;
}
function reload() {
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({ url: '/iot/tplink/cameraInfo/list', params: queryParam }).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
onMounted(() => {
watch(
() => props.data,
async () => {
// queryParam.projectId = props.data.projectId;
// queryParam.regionId = props.data.regionId;
let record = unref(props.data);
if (typeof record !== 'object') {
record = {};
}
cameraPictureConfigModal.value.disableSubmit = true;
cameraPictureConfigModal.value.edit(params);
}
/**
* 左侧树选择后触发
*/
function onTreeSelect(data) {
// departData.value = data;
}
/**
* 左侧树rootTreeData触发
*/
function onRootTreeData(data) {
// rootTreeData.value = data;
}
function reload(){
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({url: '/iot/tplink/cameraInfo/list',params:queryParam}).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
onMounted(() => {
watch(
() => props.data,
async () => {
// queryParam.projectId = props.data.projectId;
// queryParam.regionId = props.data.regionId;
let record = unref(props.data);
if (typeof record !== 'object') {
record = {};
}
reload();
},
{ deep: true, immediate: true }
);
});
reload();
},
{ deep: true, immediate: true }
);
});
</script>
<style lang="less" scoped>
.zxClass{
font-size:14px;
.zxClass {
font-size: 14px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.lxClass{
font-size:14px;
.lxClass {
font-size: 14px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.tbClass{
.tbClass {
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
.antTitle {
margin-top: 10px;
display: block;
font-size: 12px;
}
</style>

View File

@ -19,7 +19,7 @@ import DepartUtilsList from './ApiLogList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('70%');
const width = ref<string>('1300px');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();

View File

@ -17,7 +17,7 @@
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('70%');
const width = ref<string>('1300px');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();

View File

@ -19,7 +19,7 @@ import ApiLogAlarmList from './ApiLogAlarmList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('70%');
const width = ref<string>('1300px');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();