物联设备BUG处理

This commit is contained in:
曹磊 2026-04-22 17:44:53 +08:00
parent efe9156015
commit 35c4c0db2a
3 changed files with 237 additions and 41 deletions

View File

@ -1,10 +1,43 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="deviceType">
<template #label><span title="设备类型">设备类型</span></template>
<j-dict-select-tag v-model:value="queryParam.deviceType" :showLabel="false" dictCode="tplink_device_type" placeholder="请选择设备类型" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="dimension">
<template #label><span title="设备维度">设备维度</span></template>
<a-select v-model:value="queryParam.dimension" placeholder="请选择设备维度" allow-clear>
<a-select-option value="机构维度">机构维度</a-select-option>
<a-select-option value="区域维度">区域维度</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</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:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增设备</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"> 新增</a-button>
</template>
<template #bodyCell="{ column, record, index, text }">
</template>
@ -28,7 +61,9 @@
import {useModal} from "@/components/Modal";
import DeviceConfigModal from "./components/DeviceConfigModal.vue";
import { defHttp } from '/@/utils/http/axios';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const formRef = ref();
const queryParam = reactive<any>({});
const registerDrawer = ref();
const tipVisible = ref(false);
@ -67,7 +102,34 @@
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
searchQuery();
}
/**
* 编辑
@ -120,3 +182,30 @@
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -6,28 +6,28 @@
<a-row >
<a-col :span="24">
<a-form-item label="设备名称" v-bind="validateInfos.deviceName" id="DeviceConfigForm-deviceModel" name="deviceName">
<a-input v-model:value="formData.deviceName" placeholder="请填写设备名称"></a-input>
<a-input v-model:value="formData.deviceName" placeholder="请填写设备名称" disabled="true"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row >
<a-col :span="24">
<a-form-item label="设备类型" v-bind="validateInfos.deviceType" id="DeviceConfigForm-deviceType" name="deviceType">
<j-dict-select-tag v-model:value="formData.deviceType" :showLabel="false" dictCode="tplink_device_type" placeholder="请选择设备类型"/>
</a-form-item>
</a-col>
</a-row>
<a-row >
<a-col :span="24">
<a-form-item label="规格型号" v-bind="validateInfos.deviceModel" id="DeviceConfigForm-deviceModel" name="deviceModel">
<a-input v-model:value="formData.deviceModel" placeholder="请填写规格型号"></a-input>
<j-dict-select-tag v-model:value="formData.deviceType" :showLabel="false" dictCode="tplink_device_type" placeholder="请选择设备类型" @change="changeType" @upDictCode="upDictCode"/>
</a-form-item>
</a-col>
</a-row>
<a-row >
<a-col :span="24">
<a-form-item label="生产厂家" v-bind="validateInfos.factory" id="DeviceConfigForm-factory" name="factory">
<a-input v-model:value="formData.factory" placeholder="请填写生产厂家"></a-input>
<a-input v-model:value="formData.factory" placeholder="请填写生产厂家" @change="getDeviceName"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row >
<a-col :span="24">
<a-form-item label="规格型号" v-bind="validateInfos.deviceModel" id="DeviceConfigForm-deviceModel" name="deviceModel">
<a-input v-model:value="formData.deviceModel" placeholder="请填写规格型号" @change="getDeviceName"></a-input>
</a-form-item>
</a-col>
</a-row>
@ -69,6 +69,7 @@ const formData = reactive<Record<string, any>>({
id: '',
deviceName: '',
deviceType: '',
deviceTypeLabel: '',
deviceModel: '',
factory: '',
dimension: '机构维度'
@ -100,6 +101,21 @@ const disabled = computed(()=>{
return props.formDisabled;
});
const dictCode = ref([])
function upDictCode(v_) {
dictCode.value = v_
}
function changeType(value){
formData.deviceTypeLabel = dictCode.value.find(d => d.value == value)?.label || '';
getDeviceName();
}
function getDeviceName(){
formData.deviceName = formData.deviceTypeLabel+"-"+formData.factory+"["+formData.deviceModel+"]"
}
/**
* 新增
@ -112,7 +128,6 @@ function add() {
* 编辑
*/
function edit(record) {
console.log(record);
nextTick(() => {
resetFields();
//

View File

@ -63,11 +63,18 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="WorkOrderForm">
<a-row class="card-class">
<a-col :span="24">
<a-col :span="20">
<div style="margin: 20px;">
<SectionDivider :title="'反馈信息'" />
</div>
</a-col>
<a-col :span="4" style="display:flex;align-items: center;">
<span @click="handleCopyPlatInfo" class="noDisabled aclk">
<!-- <a-button class="noDisabled" type="primary" :disabled="false"> -->
<!-- </a-button> -->
</span>
</a-col>
<a-col :span="24">
<a-form-item label="访问地址" v-bind="validateInfos.netUrl" id="WorkOrderForm-netUrl" name="netUrl">
<a-input v-model:value="formData.netUrl" placeholder="请输入域名及前台路径" :maxlength="100" disabled />
@ -182,29 +189,29 @@
const formData = reactive<Record<string, any>>({
id: '',
pkId:'',
orgName: '',
netUrl: '',
accountNo: '',
passwordText: '',
orgTel: '',
orgId: '',
url: '',
mediaUrl: '',
frontPath: '',
contextPath: '',
izEnabled: '',
code: '',
name: '',
remark: '',
dbType: '',
dbDriver: '',
dbUrl: '',
dbName: '',
dbUsername: '',
dbPassword: '',
orgCode: '',
platType: '',
content: '',
orgName: '',
netUrl: '',
accountNo: '',
passwordText: '',
orgTel: '',
orgId: '',
url: '',
mediaUrl: '',
frontPath: '',
contextPath: '',
izEnabled: '',
code: '',
name: '',
remark: '',
dbType: '',
dbDriver: '',
dbUrl: '',
dbName: '',
dbUsername: '',
dbPassword: '',
orgCode: '',
platType: '',
content: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@ -230,7 +237,7 @@
function handleFkxx(e){
formData.netUrl = formData.url + formData.frontPath;
}
const dbDriverMap = {
// MySQL
'1': { dbDriver: 'com.mysql.jdbc.Driver' },
@ -302,7 +309,22 @@ function onChangeDbType(value) {
formData.dbUrl = dbUrlMap[value].dbUrl
formData.dbDriver = dbDriverMap[value].dbDriver
}
function handleCopyPlatInfo() {
const { netUrl, accountNo, passwordText } = formData;
let copyText = '';
if (netUrl) copyText += `访问地址:${netUrl}\n`;
if (accountNo) copyText += `账号:${accountNo}\n`;
if (passwordText) copyText += `密码:${passwordText}\n`;
navigator.clipboard
.writeText(copyText.trim())
.then(() => {
createMessage.success('已复制平台信息');
})
}
/**
* 新增
@ -322,7 +344,7 @@ function onChangeDbType(value) {
edit(res);
});
}
/**
@ -347,7 +369,7 @@ function onChangeDbType(value) {
/**
* 提交数据
*/
async function submitForm() {
async function submitForm() {
}
@ -372,4 +394,74 @@ function onChangeDbType(value) {
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
margin-bottom: 14px;
}
/* 1. 基础样式:包含定位和裁剪,防止布局错乱 */
.aclk {
background: linear-gradient(to right, #1ea0fa, #017de9);
padding: 4px 15px;
border-radius: 8px;
font-size: 14px;
height: 32px;
color: #fff !important;
/* 【关键修复】建立定位上下文,防止伪元素错位导致上方空白 */
position: relative;
/* 【关键修复】隐藏溢出部分,防止动画撑大组件宽度 */
overflow: hidden;
/* 确保显示模式正确,避免行高问题 */
display: inline-block;
line-height: 24px;
/* 根据高度微调,让文字垂直居中 */
text-decoration: none;
border: none;
cursor: pointer;
/* 可选:防止点击时的默认高亮背景干扰 */
-webkit-tap-highlight-color: transparent;
}
/* 2. 伪元素:定义那道白光 */
.aclk::before {
content: '';
position: absolute;
top: 0;
left: -100%;
/* 初始状态:藏在按钮左侧外面 */
/* 光带宽度:设为 50%~100% 均可,这里用 100% 配合动画终点 */
width: 100%;
height: 100%;
/* 渐变效果:中间亮,两头透明 */
background: linear-gradient(90deg,
transparent 0%,
rgba(255, 255, 255, 0.4) 50%,
transparent 100%);
/* 倾斜角度:-25deg 会让光看起来更有速度感,如果不想要倾斜改为 0deg */
transform: skewX(0deg);
/* 确保光在文字下面,虽然背景是透明的,但这是个好习惯 */
z-index: 1;
/* 初始不执行动画,等待 hover */
}
/* 3. 悬停触发:执行动画 */
.aclk:hover::before {
animation: light-sweep 1.15s ease-in-out forwards;
}
.noDisabled {
pointer-events: auto !important;
cursor: pointer !important;
*:not(.ant-select-selection-placeholder) {
color: #fff !important;
}
}
</style>