index-a7d56789.js 60 KB

1
  1. import{e as O,M as we,A as ee,h as pe}from"./index-2b8d2fc7.js";import{u as W}from"./vue-router-1718324d.js";import{u as X}from"./base-db372447.js";import{n as se}from"./index-3904b01d.js";import{d as ke}from"./index-8d9eabc9.js";import{_ as ie}from"./index-78e6fbc8.js";import{_ as ue}from"./index-e9665779.js";import{M as xe}from"./map-ec189509.js";import{_ as ae}from"./index-e6f16565.js";import{a as m,o as te,U as r,V as o,W as w,j as l,X as a,G as _,u as e,H as J,a7 as D,F as K,a2 as Y,a3 as C,$ as A,a4 as H,a1 as oe,aa as re,n as me,i as Z,p as le,R as Ce,c as ve}from"./vue-48eb72c4.js";import{P as _e}from"./PlusCircleOutlined-162ed344.js";import"./index.vue_vue_type_style_index_0_scoped_f6f545f0_lang-aebc80c5.js";import"./_plugin-vue_export-helper-c27b6911.js";const $e={key:0},he={key:1},Se={__name:"Edit",props:["disabled","data"],emits:["onSuccess"],setup(B,{emit:E}){const z=B;let f=X();m([{label:"搜索",key:"condition",type:"input"}]);let n=m(!1),t=m({w_deviceid:0,w_productid:1,prodname:"",serialnumber:"",devicename:"",w_areaid:1,areaname:"",longitude:"",latitude:"",province:"",city:"",county:"",address:"",isused:1,remarks:"",sys_msgprotocolid:1,w_iotcardid:"",iccid:""}),U=m({id:20230612103202,content:{pageNumber:1,pageSize:20,where:{condition:"",prodtype:"",enterprisename:"",isused:""}}}),v=m({id:20230608152602,content:{}}),c=m({id:20230616142702,content:{pageNumber:1,pageSize:40,where:{condition:""}}}),k=m([]),q=m(),S=m([]),T=m(),g=()=>{n.value=!0,t.value=Object.assign({},t.value,z.data),t.value.province&&(t.value.province=[t.value.province,t.value.city,t.value.county]),console.log(z.data)},h=x=>{x.target.value=="地图选点"?T.value.modeVisible=!0:x.target.value=="物联卡定位"&&we.confirm({title:"确认获取物联卡所在定位吗?",async onOk(){let b=await ee.requested({id:20230711091402,content:{iccid:t.value.iccid}});O.message(b,"操作成功",async()=>{t.value.latitude=b.data.lat,t.value.longitude=b.data.lon})},onCancel(){t.value.position="手动输入"}})},u=x=>{t.value.latitude=x.lat,t.value.longitude=x.lng},d=x=>{t.value.address=x.address},s=async()=>{if(console.log(t.value),!await q.value.validateFields())return;t.value.province&&(t.value.city=t.value.province[1],t.value.county=t.value.province[2],t.value.province=t.value.province[0]),t.value.isused=t.value.isused?1:0;let b=await ee.requested({id:20230615091502,content:t.value});O.message(b,"操作成功",()=>{n.value=!1,E("onSuccess"),q.value.resetFields(),console.log(b)})},i=x=>{console.log(x),t.value.w_productid=x[x.length-1].w_productid,t.value.prodname=x[x.length-1].prodname},$=x=>{t.value.w_areaid=x[x.length-1].w_areaid,t.value.areaname=x[x.length-1].areaname},N=x=>{t.value.w_iotcardid=x[x.length-1].w_iotcardid,t.value.iccid=x[x.length-1].iccid},P=x=>{x.data=j(x.data)},j=x=>{let b=[];function Q(I){console.log(I,"触发");let y={areaname:I.areaname,areanum:I.areanum,isused:I.isused,parentid:I.parentid,parentname:I.parentname,remarks:I.remarks,sequence:I.sequence,w_areaid:I.w_areaid,children:[]};if(I.sub&&I.sub.length>0)for(var V=0;V<I.sub.length;V++)y.children.push(Q(I.sub[V]));return y.children.length||delete y.children,y}return x.forEach(I=>{console.log(I),b.push(Q(I))}),b};return te(async()=>{let x=await f.optiontypeselect("msgprotocol");S.value=x.data,console.log(S.value,"消息协议"),k.value=await f.ProvincesData()}),(x,b)=>{const Q=r("a-button"),I=r("a-input"),y=r("a-form-item"),V=r("a-col"),p=r("a-input-search"),L=r("a-select-option"),G=r("a-select"),M=r("a-cascader"),F=r("a-textarea"),ne=r("a-radio"),de=r("a-radio-group"),ce=r("a-checkbox"),fe=r("a-row"),ye=r("a-form"),be=r("a-space"),ge=r("a-drawer");return o(),w(K,null,[l(Q,{type:"primary",disabled:B.disabled,onClick:e(g)},{default:a(()=>[_("编辑")]),_:1},8,["disabled","onClick"]),l(ge,{visible:e(n),"onUpdate:visible":b[17]||(b[17]=R=>J(n)?n.value=R:n=R),class:"custom-class",title:"编辑设备",placement:"right",width:"500px",closable:!1,onClose:b[18]||(b[18]=R=>J(n)?n.value=!1:n=!1)},{extra:a(()=>[l(be,null,{default:a(()=>[l(Q,{onClick:b[16]||(b[16]=R=>J(n)?n.value=!1:n=!1)},{default:a(()=>[_("关闭")]),_:1}),l(Q,{type:"primary",onClick:e(s)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[l(ye,{ref_key:"formRef",ref:q,model:e(t),size:"small",layout:"vertical",mode:"multiple",validateTrigger:["onChange"]},{default:a(()=>[l(fe,{gutter:16},{default:a(()=>[l(V,{span:24},{default:a(()=>[l(y,{label:"设备编码",name:"serialnumber",rules:[{required:!0,message:"请输入设备编码"}]},{default:a(()=>[l(I,{disabled:!0,value:e(t).serialnumber,"onUpdate:value":b[0]||(b[0]=R=>e(t).serialnumber=R),placeholder:"请输入设备编码"},null,8,["value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"设备名称",name:"devicename",rules:[{required:!0,message:"请输入设备名称"}]},{default:a(()=>[l(I,{value:e(t).devicename,"onUpdate:value":b[1]||(b[1]=R=>e(t).devicename=R),placeholder:"请输入设备名称"},null,8,["value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"所属产品",name:"prodname",rules:[{required:!0,message:"请选择所属产品",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{ref:"product",onSelectRowData:e(i),rowKey:"w_productid",param:e(U),filterMultiple:!0,columns:e(O).TBLayout("productListTable").splice(0,e(O).TBLayout("productListTable").length-1),title:"选择所属产品",custom:!0},{custom:a(({data:R})=>[R.column.dataIndex=="isused"?(o(),w("div",$e,D(R.record.isused?"启用":"停用"),1)):(o(),w("div",he,D(R.record[R.column.dataIndex]),1))]),slot1:a(()=>[l(p,{value:e(t).prodname,"onUpdate:value":b[2]||(b[2]=R=>e(t).prodname=R),"enter-button":"选择",readonly:"",onSearch:b[3]||(b[3]=R=>x.$refs.product.modeVisible=!0)},null,8,["value"])]),_:1},8,["onSelectRowData","param","columns"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"所属区域",name:"areaname",rules:[{required:!0,message:"请选择所属区域",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{ref:"area",onSelectRowData:e($),rowKey:"w_areaid",param:e(v),filterMultiple:!0,columns:e(O).TBLayout("areaTable"),title:"选择所属区域",onHandleList:e(P)},{slot1:a(()=>[l(p,{value:e(t).areaname,"onUpdate:value":b[4]||(b[4]=R=>e(t).areaname=R),"enter-button":"选择",readonly:"",onSearch:b[5]||(b[5]=R=>x.$refs.area.modeVisible=!0)},null,8,["value"])]),_:1},8,["onSelectRowData","param","columns","onHandleList"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"物联卡",name:"iccid",rules:[{required:!0,message:"请选择物联卡",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{ref:"card",onSelectRowData:e(N),rowKey:"w_iotcardid",param:e(c),filterMultiple:!0,columns:e(O).TBLayout("cardTable"),title:"选择物联卡"},{slot1:a(()=>[l(p,{value:e(t).iccid,"onUpdate:value":b[6]||(b[6]=R=>e(t).iccid=R),"enter-button":"选择",readonly:"",onSearch:b[7]||(b[7]=R=>x.$refs.card.modeVisible=!0)},null,8,["value"])]),_:1},8,["onSelectRowData","param","columns"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"消息协议",name:"sys_msgprotocolid",rules:[{required:!0,message:"请选择消息协议"}]},{default:a(()=>[l(G,{value:e(t).sys_msgprotocolid,"onUpdate:value":b[8]||(b[8]=R=>e(t).sys_msgprotocolid=R),placeholder:"请选择消息协议"},{default:a(()=>[(o(!0),w(K,null,Y(e(S),R=>(o(),C(L,{key:R.sys_msgprotocolid,value:R.sys_msgprotocolid},{default:a(()=>[_(D(R.protocolname),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"省市县",name:"province"},{default:a(()=>[l(M,{value:e(t).province,"onUpdate:value":b[9]||(b[9]=R=>e(t).province=R),options:e(k),placeholder:"请选择","change-on-select":""},null,8,["value","options"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"描述",name:"remarks"},{default:a(()=>[l(F,{value:e(t).remarks,"onUpdate:value":b[10]||(b[10]=R=>e(t).remarks=R),placeholder:"请输入描述"},null,8,["value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"设备位置",name:"position"},{default:a(()=>[l(de,{value:e(t).position,"onUpdate:value":b[11]||(b[11]=R=>e(t).position=R),name:"position",onChange:e(h)},{default:a(()=>[l(ne,{value:"地图选点"},{default:a(()=>[_("地图选点")]),_:1}),l(ne,{value:"物联卡定位"},{default:a(()=>[_("物联卡定位")]),_:1}),l(ne,{value:"手动输入"},{default:a(()=>[_("手动输入")]),_:1})]),_:1},8,["value","onChange"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"经度",name:"longitude"},{default:a(()=>[l(I,{disabled:e(t).position=="地图选点"||e(t).position=="物联卡定位",value:e(t).longitude,"onUpdate:value":b[12]||(b[12]=R=>e(t).longitude=R),placeholder:"请输入经度"},null,8,["disabled","value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"纬度",name:"latitude"},{default:a(()=>[l(I,{disabled:e(t).position=="地图选点"||e(t).position=="物联卡定位",value:e(t).latitude,"onUpdate:value":b[13]||(b[13]=R=>e(t).latitude=R),placeholder:"请输入纬度"},null,8,["disabled","value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"地址",name:"address",rules:[{required:!0,message:"请输入地址"}]},{default:a(()=>[l(I,{value:e(t).address,"onUpdate:value":b[14]||(b[14]=R=>e(t).address=R),placeholder:"请输入地址"},null,8,["value"])]),_:1})]),_:1}),l(V,{span:24},{default:a(()=>[l(y,{label:"是否启用",name:"isused"},{default:a(()=>[l(ce,{checked:e(t).isused,"onUpdate:checked":b[15]||(b[15]=R=>e(t).isused=R)},null,8,["checked"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"]),l(xe,{ref_key:"map1",ref:T,data:e(t),onOnAddress:e(d),onSubmitLatLng:e(u)},null,8,["data","onOnAddress","onSubmitLatLng"])],64)}}},Ue={style:{display:"flex"}},qe={__name:"Add",props:["data","disabled"],emits:["onSuccess"],setup(B,{emit:E}){let z=W(),f=X();m([{label:"搜索",key:"condition",type:"input"}]);let n=m(!1),t=m({w_dataparamid:0,ownertable:"w_device",ownerid:"",param:"",paramname:"",datatype:void 0,unit:void 0,length:"",remarks:"",rwtype:void 0,num_scale:"",num_step:"",num_maxvalue:"",num_minvalue:"",optiontypeid:void 0,prodname:"",options:[{label:"",value:""}]}),U=m(),v=m([]),c=m([]),k=m([]),q=(d,s)=>(console.log(s),isNaN(+s)?Promise.reject("请输入数字类型"):Promise.resolve()),S=async(d,s)=>Promise.resolve(),T=async(d,s)=>{s.forEach(i=>{if(t.value.datatype=="boolean"){if(typeof i.value=="number"&&i.value.toString(),!i.label||!i.value)throw"请输入值或者描述";return Promise.resolve()}else{if(typeof i.value=="number"&&(i.value=i.value.toString()),!i.label&&!i.value)return Promise.resolve();if(i.label&&!i.value||!i.label&&i.value)throw"请输入值或者描述"}})},g=async(d,s)=>isNaN(+s)?Promise.reject("请输入数字类型"):Promise.resolve(),h=()=>{n.value=!0,t.value.ownerid=z.currentRoute.value.query.id},u=async()=>{if(!await U.value.validateFields())return;t.value.options.forEach(i=>{i.value!=""&&!isNaN(+i.value)&&(i.value=+i.value)});let s=await ee.requested({id:20230612161402,content:t.value});O.message(s,"新建成功",()=>{n.value=!1,E("onSuccess"),U.value.resetFields(),console.log(s)})};return te(async()=>{let d=await f.optiontypeselect("datatype");v.value=d.data;let s=await f.optiontypeselect("optiontype");c.value=s.data;let i=await f.optiontypeselect("dataunit");k.value=i.data,console.log(c.value,"系统选项分类")}),(d,s)=>{const i=r("a-button"),$=r("a-input"),N=r("a-form-item"),P=r("a-col"),j=r("a-select-option"),x=r("a-select"),b=r("a-textarea"),Q=r("a-row"),I=r("a-form"),y=r("a-space"),V=r("a-drawer");return o(),w(K,null,[l(i,{type:"primary",onClick:e(h),style:{"margin-right":"16px"},disabled:B.disabled},{default:a(()=>[_("新建")]),_:1},8,["onClick","disabled"]),l(V,{visible:e(n),"onUpdate:visible":s[13]||(s[13]=p=>J(n)?n.value=p:n=p),class:"custom-class",title:"新建产品属性",placement:"right",width:"800px",closable:!1,onClose:s[14]||(s[14]=p=>J(n)?n.value=!1:n=!1)},{extra:a(()=>[l(y,null,{default:a(()=>[l(i,{onClick:s[12]||(s[12]=p=>J(n)?n.value=!1:n=!1)},{default:a(()=>[_("关闭")]),_:1}),l(i,{type:"primary",onClick:e(u)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[e(n)?(o(),C(I,{key:0,ref_key:"formRef",ref:U,model:e(t),size:"small",layout:"vertical",mode:"multiple"},{default:a(()=>[l(Q,{gutter:16},{default:a(()=>[l(P,{span:12},{default:a(()=>[l(N,{label:"标识",name:"param",rules:[{required:!0,message:"请输入标识"}]},{default:a(()=>[l($,{value:e(t).param,"onUpdate:value":s[0]||(s[0]=p=>e(t).param=p),placeholder:"请输入标识"},null,8,["value"])]),_:1})]),_:1}),l(P,{span:12},{default:a(()=>[l(N,{label:"参数名称",name:"paramname",rules:[{required:!0,message:"请输入参数名称"}]},{default:a(()=>[l($,{value:e(t).paramname,"onUpdate:value":s[1]||(s[1]=p=>e(t).paramname=p),placeholder:"请输入参数名称"},null,8,["value"])]),_:1})]),_:1}),l(P,{span:12},{default:a(()=>[l(N,{label:"数据类型",name:"datatype",rules:[{required:!0,message:"请输入数据类型"}]},{default:a(()=>[l(x,{value:e(t).datatype,"onUpdate:value":s[2]||(s[2]=p=>e(t).datatype=p),placeholder:"选择数据类型"},{default:a(()=>[(o(!0),w(K,null,Y(e(v),(p,L)=>(o(),C(j,{value:p.value,key:L},{default:a(()=>[_(D(p.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1}),l(P,{span:12},{default:a(()=>[l(N,{label:"读写类型",name:"rwtype",rules:[{required:!0,message:"请选择读写类型"}]},{default:a(()=>[l(x,{value:e(t).rwtype,"onUpdate:value":s[3]||(s[3]=p=>e(t).rwtype=p),placeholder:"请选择读写类型"},{default:a(()=>[l(j,{value:0},{default:a(()=>[_("读")]),_:1}),l(j,{value:1},{default:a(()=>[_("写")]),_:1}),l(j,{value:2},{default:a(()=>[_("上报")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C(P,{key:0,span:12},{default:a(()=>[l(N,{label:"单位",name:"unit",rules:[{required:!0,message:"请选择单位"}]},{default:a(()=>[l(x,{value:e(t).unit,"onUpdate:value":s[4]||(s[4]=p=>e(t).unit=p),placeholder:"请选择单位"},{default:a(()=>[(o(!0),w(K,null,Y(e(k),(p,L)=>(o(),C(j,{value:p.value,key:L},{default:a(()=>[_(D(p.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1})):A("",!0),e(t).datatype=="boolean"||e(t).datatype=="string"?(o(!0),w(K,{key:1},Y(e(t).options,(p,L)=>(o(),C(P,{span:24},{default:a(()=>[l(N,{label:"选项值",name:"options",rules:[{validator:e(T)},e(t).datatype=="boolean"?{required:!0,message:"请输入值"}:{validator:e(S)}]},{default:a(()=>[H("div",Ue,[l($,{value:p.value,"onUpdate:value":G=>p.value=G,placeholder:"请输入值",style:{"margin-right":"10px"}},null,8,["value","onUpdate:value"]),l($,{value:p.label,"onUpdate:value":G=>p.label=G,placeholder:"请输入描述",style:{"margin-right":"10px"}},null,8,["value","onUpdate:value"]),L==e(t).options.length-1?(o(),C(e(_e),{key:0,style:oe([{fontSize:"25px",marginRight:"10px"},{cursor:"pointer"}]),onClick:s[5]||(s[5]=G=>e(t).options.push({label:"",value:""}))})):A("",!0),e(t).options.length>1?(o(),C(e(pe),{key:1,style:oe([{fontSize:"25px"},{cursor:"pointer"}]),onClick:G=>e(t).options.splice(e(t).options.indexOf(p),1)},null,8,["onClick"])):A("",!0)])]),_:2},1032,["rules"])]),_:2},1024))),256)):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C(P,{key:2,span:12},{default:a(()=>[l(N,{label:"长度",name:"length"},{default:a(()=>[l($,{value:e(t).length,"onUpdate:value":s[6]||(s[6]=p=>e(t).length=p),valueModifiers:{number:!0},placeholder:"请输入长度"},null,8,["value"])]),_:1})]),_:1})):A("",!0),e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C(P,{key:3,span:12},{default:a(()=>[l(N,{label:"小数位数",name:"num_scale"},{default:a(()=>[l($,{value:e(t).num_scale,"onUpdate:value":s[7]||(s[7]=p=>e(t).num_scale=p),valueModifiers:{number:!0},placeholder:"请输入小数位数"},null,8,["value"])]),_:1})]),_:1})):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C(P,{key:4,span:12},{default:a(()=>[l(N,{label:"步长",name:"num_step",rules:[{validator:e(g),trigger:"blur"}]},{default:a(()=>[l($,{value:e(t).num_step,"onUpdate:value":s[8]||(s[8]=p=>e(t).num_step=p),placeholder:"请输入步长"},null,8,["value"])]),_:1},8,["rules"])]),_:1})):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C(P,{key:5,span:12},{default:a(()=>[l(N,{label:"最大值",name:"num_maxvalue",rules:[{validator:e(q),validatorTrigger:"blur"}]},{default:a(()=>[l($,{value:e(t).num_maxvalue,"onUpdate:value":s[9]||(s[9]=p=>e(t).num_maxvalue=p),placeholder:"请输入最大值"},null,8,["value"])]),_:1},8,["rules"])]),_:1})):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C(P,{key:6,span:12},{default:a(()=>[l(N,{label:"最小值",name:"num_minvalue",rules:[{validator:e(q),validatorTrigger:"blur"}]},{default:a(()=>[l($,{value:e(t).num_minvalue,"onUpdate:value":s[10]||(s[10]=p=>e(t).num_minvalue=p),placeholder:"请输入最小值"},null,8,["value"])]),_:1},8,["rules"])]),_:1})):A("",!0),l(P,{span:12},{default:a(()=>[l(N,{label:"描述",name:"remarks"},{default:a(()=>[l(b,{value:e(t).remarks,"onUpdate:value":s[11]||(s[11]=p=>e(t).remarks=p),placeholder:"请输入描述"},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):A("",!0)]),_:1},8,["visible"])],64)}}},Le={key:0},Te={key:1},Re={__name:"Add",props:["data","disabled"],emits:["onSuccess"],setup(B,{emit:E}){let z=W();X(),m([{label:"搜索",key:"condition",type:"input"}]);let f=m(!1),n=m({w_functionid:0,ownertable:"w_device",ownerid:"",func:"",funcname:"",isasyn:0,w_dataparamids:[],remarks:"",issystem:0}),t=m({id:20230613091602,content:{ownertable:"w_device",ownerid:z.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",datatype:"",rwtype:""}}}),U=m({tags:[],inputVisible:!1,inputValue:""}),v=m(),c=m(),k=m(),q=()=>{f.value=!0,n.value.ownerid=z.currentRoute.value.query.id},S=async()=>{if(n.value.w_dataparamids.length&&(n.value.w_dataparamids=JSON.stringify(n.value.w_dataparamids.map(i=>i.w_dataparamid))),!await v.value.validateFields())return;n.value.w_dataparamids=JSON.parse(n.value.w_dataparamids);let s=await ee.requested({id:20230613152502,content:n.value});O.message(s,"新建成功",()=>{f.value=!1,E("onSuccess"),v.value.resetFields(),U.value={tags:[],inputVisible:!1,inputValue:""}})},T=()=>{U.value.inputVisible=!0,k.value.modeVisible=!0,me(()=>{c.value.focus()})},g=d=>{const s=U.value.tags.filter(i=>i!==d);U.value.tags=s,n.value.w_dataparamids.splice(n.value.w_dataparamids.indexOf(n.value.w_dataparamids.filter(i=>i.paramname==d)[0]),1)},h=()=>{const d=U.value.inputValue;let s=U.value.tags;d&&s.indexOf(d)===-1&&(s=[...s,d]),Object.assign(U.value,{tags:s,inputVisible:!1,inputValue:""})},u=d=>{n.value.w_dataparamids=d,U.value.tags=d.map(s=>s.paramname),k.value.modeVisible=!1,console.log(U.value.tags)};return(d,s)=>{const i=r("a-button"),$=r("a-input"),N=r("a-form-item"),P=r("a-col"),j=r("a-radio"),x=r("a-radio-group"),b=r("a-tag"),Q=r("a-tooltip"),I=r("plus-outlined"),y=r("a-textarea"),V=r("a-row"),p=r("a-form"),L=r("a-space"),G=r("a-drawer");return o(),w(K,null,[l(i,{type:"primary",onClick:e(q),style:{"margin-right":"16px"},disabled:B.disabled},{default:a(()=>[_("新建")]),_:1},8,["onClick","disabled"]),l(G,{visible:e(f),"onUpdate:visible":s[7]||(s[7]=M=>J(f)?f.value=M:f=M),class:"custom-class",title:"新建产品功能",placement:"right",width:"600px",closable:!1,onClose:s[8]||(s[8]=M=>J(f)?f.value=!1:f=!1)},{extra:a(()=>[l(L,null,{default:a(()=>[l(i,{onClick:s[6]||(s[6]=M=>J(f)?f.value=!1:f=!1)},{default:a(()=>[_("关闭")]),_:1}),l(i,{type:"primary",onClick:e(S)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[l(p,{ref_key:"formRef",ref:v,model:e(n),size:"small",layout:"vertical",mode:"multiple",validateTrigger:["onChange"]},{default:a(()=>[l(V,{gutter:16},{default:a(()=>[l(P,{span:24},{default:a(()=>[l(N,{label:"标识",name:"func",rules:[{required:!0,message:"请输入标识"}]},{default:a(()=>[l($,{value:e(n).func,"onUpdate:value":s[0]||(s[0]=M=>e(n).func=M),placeholder:"请输入标识"},null,8,["value"])]),_:1})]),_:1}),l(P,{span:24},{default:a(()=>[l(N,{label:"功能名称",name:"funcname",rules:[{required:!0,message:"请输入功能名称"}]},{default:a(()=>[l($,{value:e(n).funcname,"onUpdate:value":s[1]||(s[1]=M=>e(n).funcname=M),placeholder:"请输入功能名称"},null,8,["value"])]),_:1})]),_:1}),l(P,{span:24},{default:a(()=>[l(N,{label:"调用方式",name:"isasyn",rules:[{required:!0,message:"请选择调用方式"}]},{default:a(()=>[l(x,{value:e(n).isasyn,"onUpdate:value":s[2]||(s[2]=M=>e(n).isasyn=M)},{default:a(()=>[l(j,{value:0},{default:a(()=>[_("同步")]),_:1}),l(j,{value:1},{default:a(()=>[_("异步")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),l(P,{span:24},{default:a(()=>[l(N,{label:"是否系统功能",name:"issystem"},{default:a(()=>[l(x,{value:e(n).issystem,"onUpdate:value":s[3]||(s[3]=M=>e(n).issystem=M)},{default:a(()=>[l(j,{value:1},{default:a(()=>[_("是")]),_:1}),l(j,{value:0},{default:a(()=>[_("不是")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),l(P,{span:24},{default:a(()=>[l(N,{label:"选择属性",name:"w_dataparamids",rules:[{required:!0,message:"请选择属性",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{ref_key:"Param",ref:k,onSelectRowData:e(u),rowKey:"w_dataparamid",param:e(t),columns:e(O).TBLayout("dataparamTable").splice(0,e(O).TBLayout("dataparamTable").length-1),title:"选择产品属性",custom:!0},{custom:a(({data:M})=>[M.column.dataIndex=="rwtype"?(o(),w("div",Le,D(M.record.rwtype==0?"读":M.record.rwtype==1?"写":"上报"),1)):(o(),w("div",Te,D(M.record[M.column.dataIndex]),1))]),slot1:a(()=>[(o(!0),w(K,null,Y(e(U).tags,(M,F)=>(o(),C(Q,{key:M,title:M},{default:a(()=>[l(b,{closable:!0,onClose:ne=>e(g)(M)},{default:a(()=>[_(D(M),1)]),_:2},1032,["onClose"])]),_:2},1032,["title"]))),128)),e(U).inputVisible?(o(),C($,{key:0,ref_key:"inputRef",ref:c,value:e(n).w_dataparamids,"onUpdate:value":s[4]||(s[4]=M=>e(n).w_dataparamids=M),type:"text",size:"small",style:{width:"78px"},onBlur:e(h),onKeyup:re(e(h),["enter"])},null,8,["value","onBlur","onKeyup"])):(o(),C(b,{key:1,style:{background:"#fff","border-style":"dashed"},onClick:e(T)},{default:a(()=>[l(I),_(" 添 加 + ")]),_:1},8,["onClick"]))]),_:1},8,["onSelectRowData","param","columns"])]),_:1})]),_:1}),l(P,{span:24},{default:a(()=>[l(N,{label:"描述",name:"remarks"},{default:a(()=>[l(y,{value:e(n).remarks,"onUpdate:value":s[5]||(s[5]=M=>e(n).remarks=M),placeholder:"请输入描述"},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])],64)}}},De={style:{display:"flex"}},Ne={__name:"Edit",props:["data","disabled"],emits:["onSuccess"],setup(B,{emit:E}){const z=B;let f=W();X(),m([{label:"搜索",key:"condition",type:"input"}]);let n=m(!1),t=m({w_dataparamid:0,ownertable:"w_device",ownerid:"",param:"",paramname:"",datatype:"",unit:"",length:"",remarks:"",rwtype:0,num_scale:"",num_step:"",num_maxvalue:"",num_minvalue:"",optiontypeid:"",prodname:"",options:[{label:"",value:""}]}),U=m(),v=Z("typeList");Z("optionList");let c=Z("unitList"),k=(h,u)=>(console.log(u),isNaN(+u)?Promise.reject("请输入数字类型"):Promise.resolve()),q=async(h,u)=>Promise.resolve(),S=async(h,u)=>{console.log(u),u.forEach(d=>{if(t.value.datatype=="boolean"){if(typeof d.value=="number"&&(d.value=d.value.toString()),!d.label||!d.value)throw"请输入值或者描述";return Promise.resolve()}else{if(typeof d.value=="number"&&(d.value=d.value.toString()),!d.label&&!d.value)return Promise.resolve();if(d.label&&!d.value||!d.label&&d.value)throw"请输入值或者描述"}})},T=()=>{n.value=!0,t.value=Object.assign({},t.value,z.data),t.value.ownerid=f.currentRoute.value.query.id,console.log(z.data)},g=async()=>{if(!await U.value.validateFields())return;t.value.options.forEach(d=>{d.value!=""&&!isNaN(+d.value)&&(d.value=+d.value)});let u=await ee.requested({id:20230612161402,content:t.value});O.message(u,"编辑成功",()=>{n.value=!1,E("onSuccess"),U.value.resetFields(),console.log(u)})};return(h,u)=>{const d=r("a-button"),s=r("a-input"),i=r("a-form-item"),$=r("a-col"),N=r("a-select-option"),P=r("a-select"),j=r("a-textarea"),x=r("a-row"),b=r("a-form"),Q=r("a-space"),I=r("a-drawer");return o(),w(K,null,[l(d,{type:"link",onClick:e(T),disabled:B.disabled},{default:a(()=>[_("编辑")]),_:1},8,["onClick","disabled"]),l(I,{visible:e(n),"onUpdate:visible":u[13]||(u[13]=y=>J(n)?n.value=y:n=y),class:"custom-class",title:"编辑产品属性",placement:"right",width:"800px",closable:!1,onClose:u[14]||(u[14]=y=>J(n)?n.value=!1:n=!1)},{extra:a(()=>[l(Q,null,{default:a(()=>[l(d,{onClick:u[12]||(u[12]=y=>J(n)?n.value=!1:n=!1)},{default:a(()=>[_("关闭")]),_:1}),l(d,{type:"primary",onClick:e(g)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[l(b,{ref_key:"formRef",ref:U,model:e(t),size:"small",layout:"vertical",mode:"multiple"},{default:a(()=>[l(x,{gutter:16},{default:a(()=>[l($,{span:12},{default:a(()=>[l(i,{label:"标识",name:"param",rules:[{required:!0,message:"请输入标识"}]},{default:a(()=>[l(s,{disabled:"",value:e(t).param,"onUpdate:value":u[0]||(u[0]=y=>e(t).param=y),placeholder:"请输入标识"},null,8,["value"])]),_:1})]),_:1}),l($,{span:12},{default:a(()=>[l(i,{label:"参数名称",name:"paramname",rules:[{required:!0,message:"请输入参数名称"}]},{default:a(()=>[l(s,{value:e(t).paramname,"onUpdate:value":u[1]||(u[1]=y=>e(t).paramname=y),placeholder:"请输入参数名称"},null,8,["value"])]),_:1})]),_:1}),l($,{span:12},{default:a(()=>[l(i,{label:"数据类型",name:"datatype",rules:[{required:!0,message:"请输入数据类型"}]},{default:a(()=>[l(P,{value:e(t).datatype,"onUpdate:value":u[2]||(u[2]=y=>e(t).datatype=y),placeholder:"选择数据类型"},{default:a(()=>[(o(!0),w(K,null,Y(e(v),(y,V)=>(o(),C(N,{value:y.value,key:V},{default:a(()=>[_(D(y.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1}),l($,{span:12},{default:a(()=>[l(i,{label:"读写类型",name:"rwtype",rules:[{required:!0,message:"请选择读写类型"}]},{default:a(()=>[l(P,{value:e(t).rwtype,"onUpdate:value":u[3]||(u[3]=y=>e(t).rwtype=y),placeholder:"请选择读写类型"},{default:a(()=>[l(N,{value:0},{default:a(()=>[_("读")]),_:1}),l(N,{value:1},{default:a(()=>[_("写")]),_:1}),l(N,{value:2},{default:a(()=>[_("上报")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C($,{key:0,span:12},{default:a(()=>[l(i,{label:"单位",name:"unit",rules:[{required:!0,message:"请选择单位"}]},{default:a(()=>[l(P,{value:e(t).unit,"onUpdate:value":u[4]||(u[4]=y=>e(t).unit=y),placeholder:"请选择单位"},{default:a(()=>[(o(!0),w(K,null,Y(e(c),(y,V)=>(o(),C(N,{value:y.value,key:V},{default:a(()=>[_(D(y.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1})):A("",!0),e(t).datatype=="boolean"||e(t).datatype=="string"?(o(!0),w(K,{key:1},Y(e(t).options,(y,V)=>(o(),C($,{span:24},{default:a(()=>[l(i,{label:"选项值",name:"options",rules:[{validator:e(S)},e(t).datatype=="boolean"?{required:!0,message:"请输入值"}:{validator:e(q)}]},{default:a(()=>[H("div",De,[l(s,{value:y.value,"onUpdate:value":p=>y.value=p,placeholder:"请输入值",style:{"margin-right":"10px"}},null,8,["value","onUpdate:value"]),l(s,{value:y.label,"onUpdate:value":p=>y.label=p,placeholder:"请输入描述",style:{"margin-right":"10px"}},null,8,["value","onUpdate:value"]),V==e(t).options.length-1?(o(),C(e(_e),{key:0,style:oe([{fontSize:"25px",marginRight:"10px"},{cursor:"pointer"}]),onClick:u[5]||(u[5]=p=>e(t).options.push({label:"",value:""}))})):A("",!0),e(t).options.length>1?(o(),C(e(pe),{key:1,style:oe([{fontSize:"25px"},{cursor:"pointer"}]),onClick:p=>e(t).options.splice(e(t).options.indexOf(y),1)},null,8,["onClick"])):A("",!0)])]),_:2},1032,["rules"])]),_:2},1024))),256)):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"||e(t).datatype=="string"?(o(),C($,{key:2,span:12},{default:a(()=>[l(i,{label:"长度",name:"length"},{default:a(()=>[l(s,{value:e(t).length,"onUpdate:value":u[6]||(u[6]=y=>e(t).length=y),valueModifiers:{number:!0},placeholder:"请输入长度"},null,8,["value"])]),_:1})]),_:1})):A("",!0),e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C($,{key:3,span:12},{default:a(()=>[l(i,{label:"小数位数",name:"num_scale"},{default:a(()=>[l(s,{value:e(t).num_scale,"onUpdate:value":u[7]||(u[7]=y=>e(t).num_scale=y),valueModifiers:{number:!0},placeholder:"请输入小数位数"},null,8,["value"])]),_:1})]),_:1})):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C($,{key:4,span:12},{default:a(()=>[l(i,{label:"步长",name:"num_step",rules:[{validator:h.checkNumber,trigger:"blur"}]},{default:a(()=>[l(s,{value:e(t).num_step,"onUpdate:value":u[8]||(u[8]=y=>e(t).num_step=y),placeholder:"请输入步长"},null,8,["value"])]),_:1},8,["rules"])]),_:1})):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C($,{key:5,span:12},{default:a(()=>[l(i,{label:"最大值",name:"num_maxvalue",rules:[{validator:e(k),validatorTrigger:"blur"}]},{default:a(()=>[l(s,{value:e(t).num_maxvalue,"onUpdate:value":u[9]||(u[9]=y=>e(t).num_maxvalue=y),placeholder:"请输入最大值"},null,8,["value"])]),_:1},8,["rules"])]),_:1})):A("",!0),e(t).datatype=="int"||e(t).datatype=="float"||e(t).datatype=="long"||e(t).datatype=="double"?(o(),C($,{key:6,span:12},{default:a(()=>[l(i,{label:"最小值",name:"num_minvalue",rules:[{validator:e(k),validatorTrigger:"blur"}]},{default:a(()=>[l(s,{value:e(t).num_minvalue,"onUpdate:value":u[10]||(u[10]=y=>e(t).num_minvalue=y),placeholder:"请输入最小值"},null,8,["value"])]),_:1},8,["rules"])]),_:1})):A("",!0),l($,{span:12},{default:a(()=>[l(i,{label:"描述",name:"remarks"},{default:a(()=>[l(j,{value:e(t).remarks,"onUpdate:value":u[11]||(u[11]=y=>e(t).remarks=y),placeholder:"请输入描述"},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])],64)}}},Pe={key:0},Ie={key:1},Ve={key:2},Oe={style:{display:"flex","margin-bottom":"16px"}},Be={style:{"margin-right":"16px"}},ze=H("span",null,"数据类型:",-1),Me={style:{"margin-right":"16px"}},Fe=H("span",null,"读写类型:",-1),Ke={__name:"index",props:["data","disabled"],emits:[],setup(B,{emit:E}){let z=X(),f=W(),n=m({id:20230613091602,content:{ownertable:"w_device",ownerid:f.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",datatype:void 0,rwtype:void 0}}});m([{label:"搜索",key:"condition",type:"input"}]);let t=m([]),U=m([]),v=m([]);return le("optionList",U),le("typeList",t),le("unitList",v),te(async()=>{let c=await z.optiontypeselect("datatype");t.value=c.data;let k=await z.optiontypeselect("optiontype");U.value=k.data;let q=await z.optiontypeselect("dataunit");v.value=q.data,console.log(t.value)}),(c,k)=>{const q=r("a-select-option"),S=r("a-select"),T=r("a-input");return o(),C(se,{sequence:!0,rowKey:"w_dataparamid",ref:"list",size:"small",param:e(n),columns:e(O).TBLayout("dataparamTable")},{tb_cell:a(({data:g})=>[g.column.dataIndex=="operation"?(o(),w("div",Pe,[l(Ne,{data:g.record,onOnSuccess:k[0]||(k[0]=h=>c.$refs.list.listData()),disabled:B.disabled},null,8,["data","disabled"]),l(ue,{type:"link",btnName:"删 除",idName:"20230613091502",keyName:"w_dataparamid",id:g.record.w_dataparamid,message:"确定删除当前产品属性吗?",onOnSuccess:k[1]||(k[1]=h=>c.$refs.list.listData()),disabled:B.disabled},null,8,["id","disabled"])])):g.column.dataIndex=="rwtype"?(o(),w("div",Ie,D(g.record.rwtype==0?"读":g.record.rwtype==1?"写":"上报"),1)):(o(),w("div",Ve,D(g.record[g.column.dataIndex]),1))]),operation:a(()=>[H("div",Oe,[e(t).length>0?(o(),C(qe,{key:0,disabled:B.disabled,onOnSuccess:k[2]||(k[2]=g=>c.$refs.list.listData())},null,8,["disabled"])):A("",!0),l(ue,{btnName:"同步产品物模型",idName:"20230703163802",keyName:"w_deviceid",size:"middle",id:e(f).currentRoute.value.query.id,type:"primary",message:"确定同步产品物模型吗?",onOnSuccess:k[3]||(k[3]=g=>c.$refs.list.listData()),style:{"margin-right":"10px"},disabled:B.disabled||!e(O).hasPermission("awaitSet")},null,8,["id","disabled"]),H("div",Be,[ze,l(S,{ref:"select",value:e(n).content.where.datatype,"onUpdate:value":k[4]||(k[4]=g=>e(n).content.where.datatype=g),placeholder:"选择数据类型",style:{width:"200px"},onChange:k[5]||(k[5]=g=>c.$refs.list.listData()),allowClear:""},{default:a(()=>[(o(!0),w(K,null,Y(e(t),(g,h)=>(o(),C(q,{value:g.value,key:h},{default:a(()=>[_(D(g.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),H("div",Me,[Fe,l(S,{ref:"select",value:e(n).content.where.rwtype,"onUpdate:value":k[6]||(k[6]=g=>e(n).content.where.rwtype=g),placeholder:"选择读写类型",style:{width:"200px"},onChange:k[7]||(k[7]=g=>c.$refs.list.listData()),allowClear:""},{default:a(()=>[l(q,{value:"0"},{default:a(()=>[_("读")]),_:1}),l(q,{value:"1"},{default:a(()=>[_("写")]),_:1}),l(q,{value:"2"},{default:a(()=>[_("上报")]),_:1})]),_:1},8,["value"])]),H("div",null,[l(T,{value:e(n).content.where.condition,"onUpdate:value":k[8]||(k[8]=g=>e(n).content.where.condition=g),onKeyup:k[9]||(k[9]=re(g=>c.$refs.list.listData(),["enter"])),placeholder:"名称/标识",autocomplete:"off"},null,8,["value"])])])]),_:1},8,["param","columns"])}}},Ae={key:0},je={key:1},Ee={__name:"Edit",props:["data","disabled"],emits:["onSuccess"],setup(B,{emit:E}){const z=B;let f=W();X(),m([{label:"搜索",key:"condition",type:"input"}]);let n=m(!1),t=m({w_functionid:0,ownertable:"w_device",ownerid:"",func:"",funcname:"",isasyn:0,w_dataparamids:[],remarks:"",issystem:0}),U=m({id:20230613091602,content:{ownertable:"w_device",ownerid:f.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",datatype:"",rwtype:""}}}),v=m({tags:[],inputVisible:!1,inputValue:""}),c=m(),k=m(),q=m(),S=()=>{n.value=!0,t.value=Object.assign({},t.value,z.data),t.value.ownerid=f.currentRoute.value.query.id,v.value.tags=z.data.dataparam.map(s=>s.paramname),t.value.w_dataparamids=z.data.dataparam},T=async()=>{if(t.value.w_dataparamids.length&&(t.value.w_dataparamids=t.value.w_dataparamids.map($=>$.w_dataparamid),t.value.w_dataparamids=JSON.stringify(t.value.w_dataparamids)),!await c.value.validateFields())return;t.value.w_dataparamids=JSON.parse(t.value.w_dataparamids);let i=await ee.requested({id:20230613152502,content:t.value});O.message(i,"编辑成功",()=>{n.value=!1,E("onSuccess"),c.value.resetFields(),v.value={tags:[],inputVisible:!1,inputValue:""}})},g=()=>{v.value.inputVisible=!0,q.value.modeVisible=!0,me(()=>{k.value.focus()})},h=s=>{const i=v.value.tags.filter($=>$!==s);v.value.tags=i,t.value.w_dataparamids.splice(t.value.w_dataparamids.indexOf(t.value.w_dataparamids.filter($=>$.paramname==s)[0]),1)},u=()=>{const s=v.value.inputValue;let i=v.value.tags;s&&i.indexOf(s)===-1&&(i=[...i,s]),Object.assign(v.value,{tags:i,inputVisible:!1,inputValue:""})},d=s=>{t.value.w_dataparamids.push(...s),v.value.tags=s.map(i=>i.paramname),q.value.modeVisible=!1,console.log(v.value.tags)};return(s,i)=>{const $=r("a-button"),N=r("a-input"),P=r("a-form-item"),j=r("a-col"),x=r("a-radio"),b=r("a-radio-group"),Q=r("a-tag"),I=r("a-tooltip"),y=r("plus-outlined"),V=r("a-textarea"),p=r("a-row"),L=r("a-form"),G=r("a-space"),M=r("a-drawer");return o(),w(K,null,[l($,{type:"link",onClick:e(S),style:{"margin-right":"16px"},disabled:B.disabled},{default:a(()=>[_("编辑")]),_:1},8,["onClick","disabled"]),l(M,{visible:e(n),"onUpdate:visible":i[7]||(i[7]=F=>J(n)?n.value=F:n=F),class:"custom-class",title:"编辑产品功能",placement:"right",width:"600px",closable:!1,onClose:i[8]||(i[8]=F=>J(n)?n.value=!1:n=!1)},{extra:a(()=>[l(G,null,{default:a(()=>[l($,{onClick:i[6]||(i[6]=F=>J(n)?n.value=!1:n=!1)},{default:a(()=>[_("关闭")]),_:1}),l($,{type:"primary",onClick:e(T)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[l(L,{ref_key:"formRef",ref:c,model:e(t),size:"small",layout:"vertical",mode:"multiple",validateTrigger:["onChange"]},{default:a(()=>[l(p,{gutter:16},{default:a(()=>[l(j,{span:24},{default:a(()=>[l(P,{label:"标识",name:"func",rules:[{required:!0,message:"请输入标识"}]},{default:a(()=>[l(N,{disabled:!0,value:e(t).func,"onUpdate:value":i[0]||(i[0]=F=>e(t).func=F),placeholder:"请输入标识"},null,8,["value"])]),_:1})]),_:1}),l(j,{span:24},{default:a(()=>[l(P,{label:"功能名称",name:"funcname",rules:[{required:!0,message:"请输入功能名称"}]},{default:a(()=>[l(N,{value:e(t).funcname,"onUpdate:value":i[1]||(i[1]=F=>e(t).funcname=F),placeholder:"请输入功能名称"},null,8,["value"])]),_:1})]),_:1}),l(j,{span:24},{default:a(()=>[l(P,{label:"调用方式",name:"isasyn",rules:[{required:!0,message:"请选择调用方式"}]},{default:a(()=>[l(b,{value:e(t).isasyn,"onUpdate:value":i[2]||(i[2]=F=>e(t).isasyn=F)},{default:a(()=>[l(x,{value:0},{default:a(()=>[_("同步")]),_:1}),l(x,{value:1},{default:a(()=>[_("异步")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),l(j,{span:24},{default:a(()=>[l(P,{label:"是否系统功能",name:"issystem"},{default:a(()=>[l(b,{value:e(t).issystem,"onUpdate:value":i[3]||(i[3]=F=>e(t).issystem=F)},{default:a(()=>[l(x,{value:1},{default:a(()=>[_("是")]),_:1}),l(x,{value:0},{default:a(()=>[_("不是")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),l(j,{span:24},{default:a(()=>[l(P,{label:"选择属性",name:"w_dataparamids",rules:[{required:!0,message:"请选择属性",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{ref_key:"Param",ref:q,onSelectRowData:e(d),rowKey:"w_dataparamid",param:e(U),columns:e(O).TBLayout("dataparamTable").splice(0,e(O).TBLayout("dataparamTable").length-1),title:"选择产品属性",custom:!0},{custom:a(({data:F})=>[F.column.dataIndex=="rwtype"?(o(),w("div",Ae,D(F.record.rwtype==0?"读":F.record.rwtype==1?"写":"上报"),1)):(o(),w("div",je,D(F.record[F.column.dataIndex]),1))]),slot1:a(()=>[(o(!0),w(K,null,Y(e(v).tags,(F,ne)=>(o(),C(I,{key:F,title:F},{default:a(()=>[l(Q,{closable:!0,onClose:de=>e(h)(F)},{default:a(()=>[_(D(F),1)]),_:2},1032,["onClose"])]),_:2},1032,["title"]))),128)),e(v).inputVisible?(o(),C(N,{key:0,ref_key:"inputRef",ref:k,value:e(t).w_dataparamids,"onUpdate:value":i[4]||(i[4]=F=>e(t).w_dataparamids=F),type:"text",size:"small",style:{width:"78px"},onBlur:e(u),onKeyup:re(e(u),["enter"])},null,8,["value","onBlur","onKeyup"])):(o(),C(Q,{key:1,style:{background:"#fff","border-style":"dashed"},onClick:e(g)},{default:a(()=>[l(y),_(" 添 加 + ")]),_:1},8,["onClick"]))]),_:1},8,["onSelectRowData","param","columns"])]),_:1})]),_:1}),l(j,{span:24},{default:a(()=>[l(P,{label:"描述",name:"remarks"},{default:a(()=>[l(V,{value:e(t).remarks,"onUpdate:value":i[5]||(i[5]=F=>e(t).remarks=F),placeholder:"请输入描述"},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])],64)}}},He={key:0},Je={key:1},Ye={key:2,style:{display:"flex","align-items":"center"}},Qe={key:3},Ge={key:4},We={style:{display:"flex","margin-bottom":"16px"}},Xe={style:{"margin-right":"16px"}},Ze=H("span",null,"调用方式:",-1),ea={__name:"index",props:["data","disabled"],emits:[],setup(B,{expose:E,emit:z}){let f=X(),n=W(),t=m({id:20230613162702,content:{ownertable:"w_device",ownerid:n.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",isasyn:void 0}}});m([{label:"搜索",key:"condition",type:"input"},{label:"调用方式",key:"isasyn",type:"select",dataSource:[{remarks:"同步",value:"同步"},{remarks:"异步",value:"异步"}]}]);let U=m([]);return te(async()=>{let v=await f.optiontypeselect("datatype");U.value=v.data,console.log(U.value)}),E({param:t}),(v,c)=>{const k=r("a-tag"),q=r("a-select-option"),S=r("a-select");return o(),C(se,{sequence:!0,rowKey:"w_functionid",ref:"list",size:"small",param:e(t),columns:e(O).TBLayout("serveTable")},{tb_cell:a(({data:T})=>[T.column.dataIndex=="operation"?(o(),w("div",He,[l(Ee,{data:T.record,onOnSuccess:c[0]||(c[0]=g=>v.$refs.list.listData()),disabled:B.disabled||T.record.issystem},null,8,["data","disabled"]),l(ue,{btnName:"删 除",idName:"20230613162902",keyName:"w_functionid",id:T.record.w_functionid,type:"link",message:"确定删除当前设备功能吗?",onOnSuccess:c[1]||(c[1]=g=>v.$refs.list.listData()),disabled:B.disabled||T.record.issystem},null,8,["id","disabled"])])):T.column.dataIndex=="isasyn"?(o(),w("div",Je,D(T.record.isasyn?"异步":"同步"),1)):T.column.dataIndex=="func"?(o(),w("div",Ye,[H("span",null,D(T.record.func),1),T.record.issystem?(o(),C(k,{key:0,color:"blue",size:"small",style:{"margin-left":"10px"}},{default:a(()=>[_("系统")]),_:1})):A("",!0)])):T.column.dataIndex=="w_dataparamids"?(o(),w("div",Qe,[(o(!0),w(K,null,Y(T.record.dataparam,g=>(o(),C(k,{color:"blue",key:g.w_functionid},{default:a(()=>[_(D(g.paramname),1)]),_:2},1024))),128))])):(o(),w("div",Ge,D(T.record[T.column.dataIndex]),1))]),operation:a(()=>[H("div",We,[Ce(v.$slots,"add"),H("div",Xe,[Ze,l(S,{ref:"select",value:e(t).content.where.isasyn,"onUpdate:value":c[2]||(c[2]=T=>e(t).content.where.isasyn=T),placeholder:"选择调用方式",style:{width:"200px"},onChange:c[3]||(c[3]=T=>v.$refs.list.listData()),allowClear:""},{default:a(()=>[l(q,{value:"0"},{default:a(()=>[_("同步")]),_:1}),l(q,{value:"1"},{default:a(()=>[_("异步")]),_:1})]),_:1},8,["value"])])])]),_:3},8,["param","columns"])}}},aa={key:0},la={key:1},ta={__name:"Edit",props:["data","disabled"],emits:["onSuccess"],setup(B,{emit:E}){const z=B;let f=W();X(),m([{label:"搜索",key:"condition",type:"input"}]);let n=m(!1),t=Z("levelList"),U=Z("typeList"),v=Z("symbolList"),c=m({w_eventid:0,ownertable:"w_device",ownerid:"",event:"",eventname:"",level:void 0,w_dataparamid:void 0,buildtype:"0",symbol:void 0,eventvalue:"",paramname:""}),k=m({id:20230613091602,content:{ownertable:"w_device",ownerid:f.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",datatype:"",rwtype:""}}}),q=m();m();let S=m(),T=()=>{n.value=!0,c.value=Object.assign({},c.value,z.data),c.value.ownerid=f.currentRoute.value.query.id,console.log(z.data)},g=async()=>{if(!await q.value.validateFields())return;c.value.buildtype==1&&(c.value.symbol="",c.value.eventvalue="");let d=await ee.requested({id:20230614143502,content:c.value});O.message(d,"编辑成功",()=>{n.value=!1,E("onSuccess"),q.value.resetFields()})},h=u=>{console.log(u),c.value.w_dataparamid=u[u.length-1].w_dataparamid,c.value.paramname=u[u.length-1].paramname,S.value.modeVisible=!1};return(u,d)=>{const s=r("a-button"),i=r("a-input"),$=r("a-form-item"),N=r("a-col"),P=r("a-radio"),j=r("a-radio-group"),x=r("a-select-option"),b=r("a-select"),Q=r("a-input-search"),I=r("a-row"),y=r("a-form"),V=r("a-space"),p=r("a-drawer");return o(),w(K,null,[l(s,{type:"link",onClick:e(T),style:{"margin-right":"16px"},disabled:B.disabled},{default:a(()=>[_("编辑")]),_:1},8,["onClick","disabled"]),l(p,{visible:e(n),"onUpdate:visible":d[9]||(d[9]=L=>J(n)?n.value=L:n=L),class:"custom-class",title:"编辑产品事件",placement:"right",width:"600px",closable:!1,onClose:d[10]||(d[10]=L=>J(n)?n.value=!1:n=!1)},{extra:a(()=>[l(V,null,{default:a(()=>[l(s,{onClick:d[8]||(d[8]=L=>J(n)?n.value=!1:n=!1)},{default:a(()=>[_("关闭")]),_:1}),l(s,{type:"primary",onClick:e(g)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[l(y,{ref_key:"formRef",ref:q,model:e(c),size:"small",layout:"vertical",mode:"multiple",validateTrigger:["onChange"]},{default:a(()=>[l(I,{gutter:16},{default:a(()=>[l(N,{span:24},{default:a(()=>[l($,{label:"标识",name:"event",rules:[{required:!0,message:"请输入标识"}]},{default:a(()=>[l(i,{value:e(c).event,"onUpdate:value":d[0]||(d[0]=L=>e(c).event=L),placeholder:"请输入标识"},null,8,["value"])]),_:1})]),_:1}),l(N,{span:24},{default:a(()=>[l($,{label:"事件名称",name:"eventname",rules:[{required:!0,message:"请输入事件名称"}]},{default:a(()=>[l(i,{value:e(c).eventname,"onUpdate:value":d[1]||(d[1]=L=>e(c).eventname=L),placeholder:"请输入事件名称"},null,8,["value"])]),_:1})]),_:1}),l(N,{span:24},{default:a(()=>[l($,{label:"发生类型",name:"buildtype",rules:[{required:!0,message:"请选择发生类型"}]},{default:a(()=>[l(j,{value:e(c).buildtype,"onUpdate:value":d[2]||(d[2]=L=>e(c).buildtype=L)},{default:a(()=>[(o(!0),w(K,null,Y(e(U),L=>(o(),C(P,{value:+L.value},{default:a(()=>[_(D(L.remarks),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1}),l(N,{span:24},{default:a(()=>[l($,{label:"级别",name:"level",rules:[{required:!0,message:"请选择级别"}]},{default:a(()=>[l(b,{value:e(c).level,"onUpdate:value":d[3]||(d[3]=L=>e(c).level=L)},{default:a(()=>[(o(!0),w(K,null,Y(e(t),L=>(o(),C(x,{value:+L.value},{default:a(()=>[_(D(L.remarks),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1}),l(N,{span:24},{default:a(()=>[l($,{label:"选择属性",name:"paramname",rules:[{required:!0,message:"请选择属性",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{filterMultiple:!0,ref_key:"Param",ref:S,onSelectRowData:e(h),rowKey:"w_dataparamid",param:e(k),columns:e(O).TBLayout("dataparamTable").splice(0,e(O).TBLayout("dataparamTable").length-1),title:"选择产品属性",custom:!0},{custom:a(({data:L})=>[L.column.dataIndex=="rwtype"?(o(),w("div",aa,D(L.record.rwtype==0?"读":L.record.rwtype==1?"写":"上报"),1)):(o(),w("div",la,D(L.record[L.column.dataIndex]),1))]),slot1:a(()=>[l(Q,{value:e(c).paramname,"onUpdate:value":d[4]||(d[4]=L=>e(c).paramname=L),"enter-button":"添加",readonly:"",onSearch:d[5]||(d[5]=L=>u.$refs.Param.modeVisible=!0)},null,8,["value"])]),_:1},8,["onSelectRowData","param","columns"])]),_:1})]),_:1}),e(c).buildtype=="0"?(o(),C(N,{key:0,span:12},{default:a(()=>[l($,{label:"事件判断符",name:"symbol",rules:[{required:!0,message:"请选择事件判断符"}]},{default:a(()=>[l(b,{value:e(c).symbol,"onUpdate:value":d[6]||(d[6]=L=>e(c).symbol=L),placeholder:"请选择判断符"},{default:a(()=>[(o(!0),w(K,null,Y(e(v),L=>(o(),C(x,{value:L.value},{default:a(()=>[_(D(L.value),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1})):A("",!0),e(c).buildtype=="0"?(o(),C(N,{key:1,span:12},{default:a(()=>[l($,{label:"值",name:"symbol",rules:[{required:!0,message:"请选择事件值"}]},{default:a(()=>[l(i,{value:e(c).eventvalue,"onUpdate:value":d[7]||(d[7]=L=>e(c).eventvalue=L),valueModifiers:{number:!0},placeholder:"请输入值"},null,8,["value"])]),_:1})]),_:1})):A("",!0)]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])],64)}}},na={key:0},ua={key:1},oa={__name:"Add",props:["data","disabled"],emits:["onSuccess"],setup(B,{emit:E}){let z=W();X(),m([{label:"搜索",key:"condition",type:"input"}]);let f=m(!1),n=Z("levelList"),t=Z("typeList"),U=Z("symbolList"),v=m({w_eventid:0,ownertable:"w_device",ownerid:"",event:"",eventname:"",level:void 0,w_dataparamid:void 0,buildtype:"0",symbol:void 0,eventvalue:"",paramname:""}),c=m({id:20230613091602,content:{ownertable:"w_device",ownerid:z.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",datatype:"",rwtype:""}}}),k=m();m();let q=m(),S=()=>{f.value=!0,v.value.ownerid=z.currentRoute.value.query.id},T=async()=>{if(!await k.value.validateFields())return;v.value.buildtype==1&&(v.value.symbol="",v.value.eventvalue="");let u=await ee.requested({id:20230614143502,content:v.value});O.message(u,"新建成功",()=>{f.value=!1,E("onSuccess"),k.value.resetFields()})},g=h=>{console.log(h),v.value.w_dataparamid=h[h.length-1].w_dataparamid,v.value.paramname=h[h.length-1].paramname,q.value.modeVisible=!1};return(h,u)=>{const d=r("a-button"),s=r("a-input"),i=r("a-form-item"),$=r("a-col"),N=r("a-radio"),P=r("a-radio-group"),j=r("a-select-option"),x=r("a-select"),b=r("a-input-search"),Q=r("a-row"),I=r("a-form"),y=r("a-space"),V=r("a-drawer");return o(),w(K,null,[l(d,{type:"primary",onClick:e(S),style:{"margin-right":"16px"},disabled:B.disabled},{default:a(()=>[_("新建")]),_:1},8,["onClick","disabled"]),l(V,{visible:e(f),"onUpdate:visible":u[9]||(u[9]=p=>J(f)?f.value=p:f=p),class:"custom-class",title:"新建产品事件",placement:"right",width:"600px",closable:!1,onClose:u[10]||(u[10]=p=>J(f)?f.value=!1:f=!1)},{extra:a(()=>[l(y,null,{default:a(()=>[l(d,{onClick:u[8]||(u[8]=p=>J(f)?f.value=!1:f=!1)},{default:a(()=>[_("关闭")]),_:1}),l(d,{type:"primary",onClick:e(T)},{default:a(()=>[_("保存")]),_:1},8,["onClick"])]),_:1})]),default:a(()=>[l(I,{ref_key:"formRef",ref:k,model:e(v),size:"small",layout:"vertical",mode:"multiple",validateTrigger:["onChange"]},{default:a(()=>[l(Q,{gutter:16},{default:a(()=>[l($,{span:24},{default:a(()=>[l(i,{label:"标识",name:"event",rules:[{required:!0,message:"请输入标识"}]},{default:a(()=>[l(s,{value:e(v).event,"onUpdate:value":u[0]||(u[0]=p=>e(v).event=p),placeholder:"请输入标识"},null,8,["value"])]),_:1})]),_:1}),l($,{span:24},{default:a(()=>[l(i,{label:"事件名称",name:"eventname",rules:[{required:!0,message:"请输入事件名称"}]},{default:a(()=>[l(s,{value:e(v).eventname,"onUpdate:value":u[1]||(u[1]=p=>e(v).eventname=p),placeholder:"请输入事件名称"},null,8,["value"])]),_:1})]),_:1}),l($,{span:24},{default:a(()=>[l(i,{label:"发生类型",name:"buildtype",rules:[{required:!0,message:"请选择发生类型"}]},{default:a(()=>[l(P,{value:e(v).buildtype,"onUpdate:value":u[2]||(u[2]=p=>e(v).buildtype=p)},{default:a(()=>[(o(!0),w(K,null,Y(e(t),p=>(o(),C(N,{value:p.value},{default:a(()=>[_(D(p.remarks),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1}),l($,{span:24},{default:a(()=>[l(i,{label:"级别",name:"level",rules:[{required:!0,message:"请选择级别"}]},{default:a(()=>[l(x,{value:e(v).level,"onUpdate:value":u[3]||(u[3]=p=>e(v).level=p)},{default:a(()=>[(o(!0),w(K,null,Y(e(n),p=>(o(),C(j,{value:+p.value},{default:a(()=>[_(D(p.remarks),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1}),l($,{span:24},{default:a(()=>[l(i,{label:"选择属性",name:"paramname",rules:[{required:!0,message:"请选择属性",validateTrigger:"onChange"}]},{default:a(()=>[l(ae,{filterMultiple:!0,ref_key:"Param",ref:q,onSelectRowData:e(g),rowKey:"w_dataparamid",param:e(c),columns:e(O).TBLayout("dataparamTable").splice(0,e(O).TBLayout("dataparamTable").length-1),title:"选择产品属性",custom:!0},{custom:a(({data:p})=>[p.column.dataIndex=="rwtype"?(o(),w("div",na,D(p.record.rwtype==0?"读":p.record.rwtype==1?"写":"上报"),1)):(o(),w("div",ua,D(p.record[p.column.dataIndex]),1))]),slot1:a(()=>[l(b,{value:e(v).paramname,"onUpdate:value":u[4]||(u[4]=p=>e(v).paramname=p),"enter-button":"添加",readonly:"",onSearch:u[5]||(u[5]=p=>h.$refs.Param.modeVisible=!0)},null,8,["value"])]),_:1},8,["onSelectRowData","param","columns"])]),_:1})]),_:1}),e(v).buildtype=="0"?(o(),C($,{key:0,span:12},{default:a(()=>[l(i,{label:"事件判断符",name:"symbol",rules:[{required:!0,message:"请选择事件判断符"}]},{default:a(()=>[l(x,{value:e(v).symbol,"onUpdate:value":u[6]||(u[6]=p=>e(v).symbol=p),placeholder:"请选择判断符"},{default:a(()=>[(o(!0),w(K,null,Y(e(U),p=>(o(),C(j,{value:p.value},{default:a(()=>[_(D(p.value),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1})):A("",!0),e(v).buildtype=="0"?(o(),C($,{key:1,span:12},{default:a(()=>[l(i,{label:"值",name:"symbol",rules:[{required:!0,message:"请选择事件值"}]},{default:a(()=>[l(s,{value:e(v).eventvalue,"onUpdate:value":u[7]||(u[7]=p=>e(v).eventvalue=p),valueModifiers:{number:!0},placeholder:"请输入值"},null,8,["value"])]),_:1})]),_:1})):A("",!0)]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])],64)}}},sa={key:0},ra={key:1},da={key:2},ia={key:3},pa={key:4},ma={style:{display:"flex","margin-bottom":"16px"}},va={style:{"margin-right":"16px"}},_a=H("span",null,"级别:",-1),ca={style:{"margin-right":"16px"}},fa=H("span",null,"发生类型:",-1),ya={__name:"index",props:["data","disabled"],emits:[],setup(B,{expose:E,emit:z}){let f=X(),n=W(),t=m({id:20230614143602,content:{ownertable:"w_device",ownerid:n.currentRoute.value.query.id,pageNumber:1,pageSize:20,where:{condition:"",level:void 0,buildtype:void 0}}});m([{label:"搜索",key:"condition",type:"input"},{label:"调用方式",key:"isasyn",type:"select",dataSource:[{remarks:"同步",value:"同步"},{remarks:"异步",value:"异步"}]}]);let U=m([]),v=m([]),c=m([]);le("levelList",U),le("typeList",v),le("symbolList",c);let k=ve(()=>(q,S,T)=>q.filter(g=>g.value==S[T])[0]?q.filter(g=>g.value==S[T])[0].remarks:"");return te(async()=>{let q=await f.optiontypeselect("eventlevel");U.value=q.data;let S=await f.optiontypeselect("eventbuildtype");v.value=S.data;let T=await f.optiontypeselect("eventsymbol");c.value=T.data,console.log(U.value)}),E({param:t}),(q,S)=>{const T=r("a-tag"),g=r("a-select-option"),h=r("a-select");return o(),C(se,{sequence:!0,rowKey:"w_eventid",ref:"list",size:"small",param:e(t),columns:e(O).TBLayout("eventTable")},{tb_cell:a(({data:u})=>[u.column.dataIndex=="operation"?(o(),w("div",sa,[l(ta,{data:u.record,onOnSuccess:S[0]||(S[0]=d=>q.$refs.list.listData()),disabled:B.disabled},null,8,["data","disabled"]),l(ue,{btnName:"删 除",idName:"20230614143702",keyName:"w_eventid",id:u.record.w_eventid,type:"link",message:"确定删除当前产品事件吗?",onOnSuccess:S[1]||(S[1]=d=>q.$refs.list.listData()),disabled:B.disabled},null,8,["id","disabled"])])):u.column.dataIndex=="level"?(o(),w("div",ra,D(e(k)(e(U),u.record,"level")),1)):u.column.dataIndex=="buildtype"?(o(),w("div",da,D(e(k)(e(v),u.record,"buildtype")),1)):u.column.dataIndex=="w_dataparamids"?(o(),w("div",ia,[(o(!0),w(K,null,Y(u.record.dataparam,d=>(o(),C(T,{color:"blue",key:d.w_functionid},{default:a(()=>[_(D(d.paramname),1)]),_:2},1024))),128))])):(o(),w("div",pa,D(u.record[u.column.dataIndex]),1))]),operation:a(()=>[H("div",ma,[l(oa,{data:B.data,disabled:B.disabled,onOnSuccess:S[2]||(S[2]=u=>q.$refs.list.listData())},null,8,["data","disabled"]),H("div",va,[_a,l(h,{ref:"select",value:e(t).content.where.level,"onUpdate:value":S[3]||(S[3]=u=>e(t).content.where.level=u),placeholder:"选择级别",style:{width:"200px"},onChange:S[4]||(S[4]=u=>q.$refs.list.listData()),allowClear:""},{default:a(()=>[(o(!0),w(K,null,Y(e(U),u=>(o(),C(g,{value:u.value},{default:a(()=>[_(D(u.remarks),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),H("div",ca,[fa,l(h,{ref:"select",value:e(t).content.where.buildtype,"onUpdate:value":S[5]||(S[5]=u=>e(t).content.where.buildtype=u),placeholder:"选择发生类别",style:{width:"200px"},onChange:S[6]||(S[6]=u=>q.$refs.list.listData()),allowClear:""},{default:a(()=>[(o(!0),w(K,null,Y(e(v),u=>(o(),C(g,{value:u.value},{default:a(()=>[_(D(u.remarks),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])])])]),_:1},8,["param","columns"])}}},ba={key:0},ga={key:1},wa={key:0,style:{"white-space":"normal",width:"800px"}},ka={key:1,style:{width:"200px",display:"flex","flex-wrap":"wrap"}},xa={key:2},Ca={key:3},$a={style:{display:"flex","margin-bottom":"16px"}},ha={style:{"margin-right":"16px"}},Sa=H("span",null,"时间:",-1),Ua={style:{"margin-right":"16px"}},qa=H("span",null,"类型:",-1),La={__name:"index",props:["data"],emits:[],setup(B,{emit:E}){X();let z=W(),f=m({id:20230701132202,content:{w_deviceid:z.currentRoute.value.query.id,type:"0",pageNumber:1,pageSize:10}}),n=m([]),t=m(),U=m("handleQueue"),v=m(!0),c=q=>{console.log(n.value),n.value?(f.value.content.where.enddate=n.value[1],f.value.content.where.begindate=n.value[0]):(f.value.content.where.enddate="",f.value.content.where.begindate=""),t.value.listData()},k=()=>{f.value.content.type=="2"?U.value="handleQueue":f.value.content.type=="0"?U.value="detailHistoryTable":f.value.content.type=="1"&&(U.value="uploadHistory"),v.value=!1,setTimeout(()=>{v.value=!0})};return(q,S)=>{const T=r("a-tag"),g=r("a-range-picker"),h=r("a-select-option"),u=r("a-select");return e(v)?(o(),C(se,{key:0,rowKey:"w_deviceid",ref_key:"list",ref:t,size:"small",param:e(f),columns:e(O).TBLayout(e(U))},{tb_cell:a(({data:d})=>[d.column.dataIndex=="issend"?(o(),w("div",ba,D(d.record.issend==0?"未发送":"已发送"),1)):d.column.dataIndex=="content"?(o(),w("div",ga,[e(f).content.type=="1"?(o(),w("div",wa,D(d.record.content),1)):(o(),w("div",ka,[(o(!0),w(K,null,Y(d.record.content,s=>(o(),C(T,null,{default:a(()=>[_(D(s.title)+" : "+D(s.value),1)]),_:2},1024))),256))]))])):d.column.dataIndex=="isreceive"?(o(),w("div",xa,D(d.record.isreceive?"已接收":"未接收"),1)):d.column.dataIndex=="invalid"?(o(),w("div",Ca,D(d.record.isreceive?"已失效":"未失效"),1)):A("",!0)]),operation:a(()=>[H("div",$a,[H("div",ha,[Sa,l(g,{style:{width:"400px"},value:e(n),"onUpdate:value":S[0]||(S[0]=d=>J(n)?n.value=d:n=d),"value-format":"YYYY-MM-DD",onChange:e(c),allowClear:""},null,8,["value","onChange"])]),H("div",Ua,[qa,l(u,{ref:"select",value:e(f).content.type,"onUpdate:value":S[1]||(S[1]=d=>e(f).content.type=d),style:{width:"120px"},onChange:e(k)},{default:a(()=>[l(h,{value:"2"},{default:a(()=>[_("操作队列")]),_:1}),l(h,{value:"0"},{default:a(()=>[_("操作记录")]),_:1}),l(h,{value:"1"},{default:a(()=>[_("上传记录")]),_:1})]),_:1},8,["value","onChange"])])])]),_:1},8,["param","columns"])):A("",!0)}}},Ta=H("p",{class:"normal-title"},"基本信息",-1),Ra=H("p",{class:"normal-title"},"系统信息",-1),Ea={__name:"index",setup(B){const E=W(),z=m([]);let f=m("attribute");const n=m({});let t=m([]),U=m([]),v=m();const c=async()=>{const g=await ee.requested({id:20230615103902,content:{w_deviceid:E.currentRoute.value.query.id}});n.value=g.data,console.log(n.value),q(g.data)};let k=ve(()=>n.value.isOffical==1);const q=g=>{z.value=[{label:"设备编码",value:g.serialnumber},{label:"设备名称",value:g.devicename},{label:"区域",value:g.areaname},{label:"启用状态",value:g.isused?"启用":"停用",style:()=>{let h={};return h.color=O.statusAndColor(n.value.isused?"启用":"停用"),h}},{label:"运行状态",value:g.status,style:()=>{let h={};return h.color=O.statusAndColor(g.status),h}},{label:"描述",value:g.remarks}],t.value=[{label:"产品编码",value:n.value.prodnum},{label:"产品名称",value:n.value.prodname},{label:"设备类型",value:n.value.prodtype},{label:"厂商",value:n.value.enterprisename},{label:"状态",value:n.value.isused?"启用":"停用",style:()=>{let h={};return h.color=O.statusAndColor(n.value.isused?"启用":"停用"),h}},{label:"地址",value:n.value.address},{label:"消息协议",value:n.value.protocolname},{label:"描述",value:n.value.remarks}],U.value=[{label:"创建时间",value:n.value.createdate},{label:"创建人",value:n.value.createby},{label:"最近编辑时间",value:n.value.changedate},{label:"最近编辑人",value:n.value.changeby},{label:"描述",value:n.value.remarks}]};let S=()=>{E.push({path:n.value.dashboardpath,query:{id:n.value.w_deviceid}})},T=()=>{v.value.param.content.ownerid=E.currentRoute.value.query.id,v.value.$refs.list.listData()};return te(()=>{c()}),(g,h)=>{const u=r("a-button"),d=r("a-radio-button"),s=r("a-radio-group");return o(),w("div",null,[l(ke,{headData:z.value,title:`${n.value.devicename}(${n.value.serialnumber})`,tabs:["详情信息","物模型","检查项","日志"],ownertable:"user"},{operation:a(()=>[l(Se,{disabled:n.value.isOffical==1||!e(O).hasPermission("update"),data:n.value,onOnSuccess:c},null,8,["disabled","data"]),l(ue,{btnName:n.value.isused?"禁用":"启用",idName:"20230615110102",keyName:"w_deviceid",id:n.value.w_deviceid,type:"primary",size:"middle",paramData:[{key:"isused",value:n.value.isused?0:1}],message:n.value.isused?"确定禁用当前设备吗?":"确定启用当起设备吗?",onOnSuccess:c},null,8,["btnName","id","paramData","message"]),l(u,{type:"primary",onClick:h[0]||(h[0]=i=>e(E).push("/shidianxing"))},{default:a(()=>[_("测试跳转")]),_:1}),l(u,{onClick:e(S),type:"primary"},{default:a(()=>[_("设备控制")]),_:1},8,["onClick"])]),tab0:a(()=>[Ta,l(ie,{data:e(t),style:{"margin-bottom":"16px"}},null,8,["data"]),Ra,l(ie,{data:e(U)},null,8,["data"])]),tab1:a(()=>[l(s,{value:e(f),"onUpdate:value":h[1]||(h[1]=i=>J(f)?f.value=i:f=i),style:oe([{marginBottom:"8px"},{"margin-bottom":"10px"}])},{default:a(()=>[l(d,{value:"attribute"},{default:a(()=>[_("属性定义")]),_:1}),l(d,{value:"server"},{default:a(()=>[_("功能定义")]),_:1}),l(d,{value:"event"},{default:a(()=>[_("事件定义")]),_:1})]),_:1},8,["value"]),e(f)=="attribute"?(o(),C(Ke,{key:0,data:n.value,disabled:!e(O).hasPermission("modelTab")||e(k),ref:"attributeTab"},null,8,["data","disabled"])):e(f)=="server"?(o(),C(ea,{key:1,disabled:!e(O).hasPermission("modelTab")||e(k),data:n.value,ref_key:"serveTab",ref:v},{add:a(()=>[l(Re,{disabled:!e(O).hasPermission("modelTab")||e(k),data:n.value,onOnSuccess:e(T)},null,8,["disabled","data","onOnSuccess"])]),_:1},8,["disabled","data"])):(o(),C(ya,{key:2,disabled:!e(O).hasPermission("modelTab")||e(k),data:n.value},null,8,["disabled","data"]))]),tab3:a(()=>[l(La)]),_:1},8,["headData","title"])])}}};export{Ea as default};