2 lines
4.0 KiB
JavaScript
2 lines
4.0 KiB
JavaScript
import{g as d}from"./index-CIc-2hgy.js";import{g as p}from"./index-XDntrWcb.js";import{g as r}from"./index-y8WBv__M.js";import{D as o,L as t}from"./biz-iot-enum-B2pEk3Wu.js";import{a7 as l,at as a,cX as n,ap as m}from"./bootstrap-CRjSNGHY.js";import{D as i}from"./dict-enum-CaHgMaDZ.js";function T(){return[{component:"Input",fieldName:"id",dependencies:{triggerFields:[""],show:()=>!1}},{fieldName:"productId",label:"产品",component:"ApiSelect",componentProps:{api:r,labelField:"name",valueField:"id",placeholder:"请选择产品"},dependencies:{triggerFields:["id"],disabled:e=>!!(e!=null&&e.id)},rules:"required"},{fieldName:"deviceName",label:"设备标识",component:"Input",componentProps:{placeholder:"请输入设备标识"},dependencies:{triggerFields:["id"],disabled:e=>!!(e!=null&&e.id)},rules:l().min(2,"设备标识长度不能少于 2 个字符").max(12,"设备标识长度不能超过 12 个字符").regex(/^[\w.\-:@]{2,12}$/,"支持英文字母、数字、下划线(_)、中划线(-)、点号(.)、半角冒号(:)和特殊字符@")},{fieldName:"gatewayId",label:"网关设备",component:"ApiSelect",componentProps:{api:()=>d(o.GATEWAY),labelField:"nickname",valueField:"id",placeholder:"子设备可选择父设备"},dependencies:{triggerFields:["deviceType"],show:e=>e.deviceType===o.GATEWAY_SUB}},{fieldName:"nickname",label:"设备名称",component:"Input",componentProps:{placeholder:"请输入设备名称"},rules:l().min(4,"设备名称长度限制为 4~64 个字符").max(64,"设备名称长度限制为 4~64 个字符").regex(/^[\u4E00-\u9FA5\u3040-\u30FF\w()()]+$/,"设备名称只能包含中文、英文字母、日文、数字、下划线(_)和括号(())").optional().or(n(""))},{fieldName:"groupIds",label:"设备分组",component:"ApiSelect",componentProps:{api:p,labelField:"name",valueField:"id",mode:"multiple",placeholder:"请选择设备分组"}},{fieldName:"serialNumber",label:"设备序列号",component:"Input",componentProps:{placeholder:"请输入设备序列号"},rules:l().regex(/^[\w-]+$/,"序列号只能包含字母、数字、中划线和下划线").optional().or(n(""))},{fieldName:"locationType",label:"定位类型",component:"RadioGroup",componentProps:{options:a(i.IOT_LOCATION_TYPE,"number"),buttonStyle:"solid",optionType:"button"}},{fieldName:"longitude",label:"设备经度",component:"InputNumber",componentProps:{placeholder:"请输入设备经度",class:"w-full"},dependencies:{triggerFields:["locationType"],show:e=>e.locationType===t.MANUAL}},{fieldName:"latitude",label:"设备纬度",component:"InputNumber",componentProps:{placeholder:"请输入设备纬度",class:"w-full"},dependencies:{triggerFields:["locationType"],show:e=>e.locationType===t.MANUAL}}]}function b(){return[{fieldName:"groupIds",label:"设备分组",component:"ApiSelect",componentProps:{api:p,labelField:"name",valueField:"id",mode:"multiple",placeholder:"请选择设备分组"},rules:"required"}]}function N(){return[{fieldName:"file",label:"设备数据",component:"Upload",rules:"required",help:"仅允许导入 xls、xlsx 格式文件"},{fieldName:"updateSupport",label:"是否覆盖",component:"Switch",componentProps:{checkedChildren:"是",unCheckedChildren:"否"},rules:m().default(!1),help:"是否更新已经存在的设备数据"}]}function F(){return[{type:"checkbox",width:40},{field:"deviceName",title:"设备名称",minWidth:150},{field:"nickname",title:"设备名称",minWidth:120},{field:"productId",title:"所属产品",minWidth:120,slots:{default:"product"}},{field:"deviceType",title:"设备类型",minWidth:100,cellRender:{name:"CellDict",props:{type:i.IOT_PRODUCT_DEVICE_TYPE}}},{field:"groupIds",title:"所属分组",minWidth:150,slots:{default:"groups"}},{field:"state",title:"设备状态",minWidth:100,cellRender:{name:"CellDict",props:{type:i.IOT_DEVICE_STATE}}},{field:"onlineTime",title:"最后上线时间",minWidth:180,formatter:"formatDateTime"},{title:"操作",width:200,fixed:"right",slots:{default:"actions"}}]}export{F as a,b,N as c,T as u};
|