2 lines
4.4 KiB
JavaScript
2 lines
4.4 KiB
JavaScript
var i=(e,o,l)=>new Promise((d,r)=>{var c=a=>{try{t(l.next(a))}catch(n){r(n)}},s=a=>{try{t(l.throw(a))}catch(n){r(n)}},t=a=>a.done?d(a.value):Promise.resolve(a.value).then(c,s);t((l=l.apply(e,o)).next())});import{a as m}from"./index-C3H1eIkn.js";import{ap as u,as as f}from"./bootstrap-DmcuvVZS.js";import{d9 as T}from"../jse/index-index-B6J4axeY.js";const p=[{label:"园区",value:"PARK"},{label:"楼栋",value:"BUILDING"},{label:"楼层",value:"FLOOR"},{label:"功能区域",value:"FUNCTION"}],b=[{label:"男厕",value:"MALE_TOILET"},{label:"女厕",value:"FEMALE_TOILET"},{label:"公共区域",value:"PUBLIC"},{label:"电梯",value:"ELEVATOR"}],N=[{label:"高",value:"HIGH"},{label:"中",value:"MEDIUM"},{label:"低",value:"LOW"}],L=[{label:"客流计数",value:"TRAFFIC_COUNTER"},{label:"信标",value:"BEACON"},{label:"工牌",value:"BADGE"}],h={TRAFFIC_COUNTER:{bg:"#e6f4ff",text:"#1677ff"},BEACON:{bg:"#f6ffed",text:"#52c41a"},BADGE:{bg:"#fff7e6",text:"#fa8c16"}},C={TRAFFIC_COUNTER:"blue",BEACON:"green",BADGE:"orange"};function P(){return[{fieldName:"name",label:"区域名称/编码",component:"Input",componentProps:{placeholder:"请输入区域名称或编码",allowClear:!0}},{fieldName:"areaType",label:"区域类型",component:"Select",componentProps:{placeholder:"请选择区域类型",allowClear:!0,options:p}},{fieldName:"isActive",label:"启用状态",component:"Select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"启用",value:!0},{label:"停用",value:!1}]}}]}function _(){return[{fieldName:"id",component:"Input",dependencies:{triggerFields:[""],show:()=>!1}},{fieldName:"parentId",label:"上级区域",component:"ApiTreeSelect",componentProps:{allowClear:!0,api:()=>i(null,null,function*(){var l;const e=yield m(),o=Array.isArray(e)?e:(l=e==null?void 0:e.list)!=null?l:[];return o.unshift({id:0,areaName:"根节点",parentId:void 0}),T(o,"id","parentId")}),labelField:"areaName",valueField:"id",childrenField:"children",placeholder:"请选择上级区域",treeDefaultExpandAll:!0},dependencies:{triggerFields:["id","parentId"],disabled:e=>(e==null?void 0:e.parentId)!==null&&(e==null?void 0:e.parentId)!==0&&!(e!=null&&e.id)},rules:"selectRequired"},{fieldName:"areaName",label:"区域名称",component:"Input",componentProps:{placeholder:"请输入区域名称"},rules:"required"},{fieldName:"areaCode",label:"区域编码",component:"Input",componentProps:{placeholder:"请输入区域编码"}},{fieldName:"areaType",label:"区域类型",component:"Select",componentProps:{placeholder:"请选择区域类型",options:p},rules:"selectRequired"},{fieldName:"functionType",label:"功能类型",component:"Select",componentProps:{placeholder:"请选择功能类型",allowClear:!0,options:b}},{fieldName:"floorNo",label:"楼层号",component:"InputNumber",componentProps:{min:-10,placeholder:"请输入楼层号",class:"w-full"}},{fieldName:"cleaningFrequency",label:"保洁频率",component:"Input",componentProps:{placeholder:"如:每日 2 次"}},{fieldName:"standardDuration",label:"标准时长(分钟)",component:"InputNumber",componentProps:{min:0,placeholder:"请输入标准时长",class:"w-full"}},{fieldName:"areaLevel",label:"区域等级",component:"Select",componentProps:{placeholder:"请选择区域等级",allowClear:!0,options:N}},{fieldName:"isActive",label:"启用状态",component:"RadioGroup",componentProps:{options:[{label:"启用",value:!0},{label:"停用",value:!1}],optionType:"button",buttonStyle:"solid"},rules:u().default(!0)},{fieldName:"sort",label:"排序",component:"InputNumber",componentProps:{min:0,placeholder:"请输入排序",class:"w-full"},rules:f().min(0).default(0)}]}const R={PARK:"orange",BUILDING:"gold",FLOOR:"cyan",FUNCTION:"purple"},F={MALE_TOILET:"blue",FEMALE_TOILET:"magenta",PUBLIC:"green",ELEVATOR:"geekblue"},g={HIGH:"volcano",MEDIUM:"gold",LOW:"green"};function S(){return[{field:"areaName",title:"区域名称",minWidth:200,align:"left",fixed:"left",treeNode:!0},{field:"areaCode",title:"区域编码",minWidth:120},{field:"areaType",title:"区域类型",minWidth:110,slots:{default:"areaType"}},{field:"functionType",title:"功能类型",minWidth:110,slots:{default:"functionType"}},{field:"areaLevel",title:"区域等级",minWidth:96,slots:{default:"areaLevel"}},{field:"isActive",title:"状态",minWidth:88,slots:{default:"isActive"}},{title:"操作",width:260,fixed:"right",slots:{default:"actions"}}]}export{g as A,F,L as R,h as a,C as b,N as c,b as d,R as e,p as f,P as g,_ as h,S as u};
|