index-6eda1919.js 11 KB

1
  1. import{l as z}from"./index-cd8ad7e5.js";import{A as $,e as B}from"./index-2b8d2fc7.js";import{n as V}from"./index-3904b01d.js";import{_ as M}from"./index-e9665779.js";import{a as s,w as R,U as l,V as m,W as y,j as e,X as a,G as p,u as o,F as U,a2 as N,a3 as F,a7 as q,$ as K,o as j}from"./vue-48eb72c4.js";import{u as L}from"./vue-router-1718324d.js";import"./index.vue_vue_type_style_index_0_scoped_f6f545f0_lang-aebc80c5.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./base-db372447.js";const E={__name:"editPlatform",props:["data"],emits:["onSuccess"],setup(h,{emit:k}){const c=h,b=s(),_=s();let u=s(),d=s(!1),i=s({w_iotcard_paramid:0,telecomoperator:void 0,name:"",cmiot_appid:"",cmiot_password:""}),S=s([{key:"1",name:"电信"},{key:"2",name:"移动"},{key:"3",name:"联通"}]);R(()=>b.value,t=>{t||u.value.resetFields()});const x=()=>{b.value=!0,i.value=Object.assign({},i.value,c.data)},v=async()=>{if(!await u.value.validateFields())return;d.value=!0;let r=await $.requested({id:"20230721113901",content:i.value});B.message(r,"新增成功",()=>{d.value=!1,b.value=!1,k("onSuccess")})};return(t,r)=>{const w=l("a-button"),n=l("a-input"),g=l("a-form-item"),D=l("a-col"),P=l("a-select-option"),A=l("a-select"),T=l("a-row"),O=l("a-form"),C=l("a-space"),f=l("a-drawer");return m(),y("div",null,[e(w,{type:"link",onClick:x},{default:a(()=>[p("编辑")]),_:1}),e(f,{visible:b.value,"onUpdate:visible":r[4]||(r[4]=I=>b.value=I),class:"custom-class",title:"编辑账号",placement:"right",width:"600",closable:!1},{extra:a(()=>[e(C,null,{default:a(()=>[e(w,{type:"primary",onClick:v,loading:o(d)},{default:a(()=>[p("保存")]),_:1},8,["loading"])]),_:1})]),default:a(()=>[e(O,{model:o(i),rules:_.value,ref_key:"formRef",ref:u,size:"small",layout:"vertical"},{default:a(()=>[e(T,{gutter:16},{default:a(()=>[e(D,{span:12},{default:a(()=>[e(g,{label:"名称",name:"name",rules:[{required:!0,message:"请输入名称"}]},{default:a(()=>[e(n,{value:o(i).name,"onUpdate:value":r[0]||(r[0]=I=>o(i).name=I),placeholder:"请输入"},null,8,["value"])]),_:1})]),_:1}),e(D,{span:12},{default:a(()=>[e(g,{label:"运营商",name:"telecomoperator",rules:[{required:!0,message:"请输入运营商"}]},{default:a(()=>[e(A,{value:o(i).telecomoperator,"onUpdate:value":r[1]||(r[1]=I=>o(i).telecomoperator=I),placeholder:"请选择运营商"},{default:a(()=>[(m(!0),y(U,null,N(o(S),I=>(m(),F(P,{key:I.key,value:I.name},{default:a(()=>[p(q(I.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1}),e(D,{span:12},{default:a(()=>[e(g,{label:"AppID",name:"cmiot_appid",rules:[{required:!0,message:"请输入运营商"},{pattern:/^[^\u4e00-\u9fa5]{0,}$/g,message:"AppID不能包含中文"}]},{default:a(()=>[e(n,{value:o(i).cmiot_appid,"onUpdate:value":r[2]||(r[2]=I=>o(i).cmiot_appid=I),placeholder:"请输入"},null,8,["value"])]),_:1})]),_:1}),e(D,{span:12},{default:a(()=>[e(g,{label:"Password API",name:"cmiot_password",rules:[{required:!0,message:"请输入运营商"},{pattern:/^[^\u4e00-\u9fa5]{0,}$/g,message:"Password API不能包含中文"}]},{default:a(()=>[e(n,{value:o(i).cmiot_password,"onUpdate:value":r[3]||(r[3]=I=>o(i).cmiot_password=I),placeholder:"请输入"},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["visible"])])}}},G={__name:"addPlatform",emits:["onSuccess"],setup(h,{emit:k}){const c=s(),b=s();let _=s(),u=s({w_iotcard_paramid:0,telecomoperator:void 0,name:"",cmiot_appid:"",cmiot_password:""}),d=s(!1),i=s([{key:"1",name:"电信"},{key:"2",name:"移动"},{key:"3",name:"联通"}]);R(()=>c.value,v=>{v||_.value.resetFields()});const S=()=>{c.value=!0},x=async()=>{if(!await _.value.validateFields())return;d.value=!0;let t=await $.requested({id:"20230721113901",content:u.value});B.message(t,"新增成功",()=>{d.value=!1,c.value=!1,k("onSuccess")})};return(v,t)=>{const r=l("a-button"),w=l("a-input"),n=l("a-form-item"),g=l("a-col"),D=l("a-select-option"),P=l("a-select"),A=l("a-row"),T=l("a-form"),O=l("a-space"),C=l("a-drawer");return m(),y("div",null,[e(r,{type:"primary",onClick:S},{default:a(()=>[p("新增")]),_:1}),e(C,{visible:c.value,"onUpdate:visible":t[4]||(t[4]=f=>c.value=f),class:"custom-class",title:"新增账号",placement:"right",width:"600",closable:!1,onClose:v.onClose},{extra:a(()=>[e(O,null,{default:a(()=>[e(r,{type:"primary",onClick:x,loading:o(d)},{default:a(()=>[p("保存")]),_:1},8,["loading"])]),_:1})]),default:a(()=>[e(T,{model:o(u),rules:b.value,ref_key:"formRef",ref:_,size:"small",layout:"vertical"},{default:a(()=>[e(A,{gutter:16},{default:a(()=>[e(g,{span:12},{default:a(()=>[e(n,{label:"名称",name:"name",rules:[{required:!0,message:"请输入名称"}]},{default:a(()=>[e(w,{value:o(u).name,"onUpdate:value":t[0]||(t[0]=f=>o(u).name=f),placeholder:"请输入"},null,8,["value"])]),_:1})]),_:1}),e(g,{span:12},{default:a(()=>[e(n,{label:"运营商",name:"telecomoperator",rules:[{required:!0,message:"请输入运营商"}]},{default:a(()=>[e(P,{value:o(u).telecomoperator,"onUpdate:value":t[1]||(t[1]=f=>o(u).telecomoperator=f),placeholder:"请选择运营商"},{default:a(()=>[(m(!0),y(U,null,N(o(i),f=>(m(),F(D,{key:f.key,value:f.name},{default:a(()=>[p(q(f.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),_:1}),e(g,{span:12},{default:a(()=>[e(n,{label:"AppID",name:"cmiot_appid",rules:[{required:!0,message:"请输入AppID"},{pattern:/^[^\u4e00-\u9fa5]{0,}$/g,message:"AppID不能包含中文"}]},{default:a(()=>[e(w,{value:o(u).cmiot_appid,"onUpdate:value":t[2]||(t[2]=f=>o(u).cmiot_appid=f),placeholder:"请输入"},null,8,["value"])]),_:1})]),_:1}),e(g,{span:12},{default:a(()=>[e(n,{label:"Password API",name:"cmiot_password",rules:[{required:!0,message:"请输入AppID"},{pattern:/^[^\u4e00-\u9fa5]{0,}$/g,message:"Password API不能包含中文"}]},{default:a(()=>[e(w,{value:o(u).cmiot_password,"onUpdate:value":t[3]||(t[3]=f=>o(u).cmiot_password=f),placeholder:"请输入"},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["visible","onClose"])])}}},W={key:0},X={__name:"IoTPlatform",setup(h){const k=s(!1),c=s();let b=s({content:{},id:20230721113801});s([{key:"1",name:"电信",data:""},{key:"2",name:"移动",data:""},{key:"3",name:"联通",data:""}]),s({}),s({}),s({});let _=()=>{c.value.listData()};const u=()=>{k.value=!0},d=()=>{k.value=!1};return(i,S)=>{const x=l("a-button"),v=l("a-drawer");return m(),y("div",null,[e(x,{type:"primary",onClick:u},{default:a(()=>[p("物联平台")]),_:1}),e(v,{visible:k.value,"onUpdate:visible":S[0]||(S[0]=t=>k.value=t),class:"custom-class",title:"平台管理",placement:"right",width:"1000",closable:!1,onClose:d},{default:a(()=>[e(V,{rowKey:"w_iotcard_paramid",ref_key:"list",ref:c,size:"small",param:o(b),columns:o(B).TBLayout("accountTable")},{tb_cell:a(({data:t})=>[t.column.dataIndex=="operation"?(m(),y("div",W,[e(E,{class:"inline-16",data:t.record,onOnSuccess:o(_)},null,8,["data","onOnSuccess"]),e(M,{class:"inline-16",btnName:"删 除",idName:"20230721114001",keyName:"w_iotcard_paramid",id:t.record.w_iotcard_paramid,type:"link",message:"确定删除当前账号吗?",onOnSuccess:o(_)},null,8,["id","onOnSuccess"])])):K("",!0)]),operation:a(()=>[e(G,{onOnSuccess:o(_),style:{"margin-bottom":"10px"}},null,8,["onOnSuccess"])]),_:1},8,["param","columns"])]),_:1},8,["visible"])])}}},H={__name:"add",emits:["onSuccess"],setup(h,{emit:k}){let c=s({w_iotcardid:0}),b=s({});const _=s(),u=s([{remarks:"电信",value:"CT"},{remarks:"联通",value:"CU"},{remarks:"移动",value:"CM"}]),d=s(!1),i=async()=>{try{const v=await _.value.validateFields(),t=await $.requested({id:"20230619141903",content:c.value});B.message(t,"新增成功",async()=>{d.value=!1,_.value.resetFields(),k("onSuccess")})}catch(v){console.log("Failed:",v)}},S=()=>{d.value=!0},x=()=>{d.value=!1,_.value.resetFields()};return(v,t)=>{const r=l("a-button"),w=l("a-input"),n=l("a-form-item"),g=l("a-col"),D=l("a-select-option"),P=l("a-select"),A=l("a-form"),T=l("a-space"),O=l("a-drawer");return m(),y("div",null,[e(r,{type:"primary",onClick:S},{default:a(()=>[p("新增")]),_:1}),e(O,{visible:d.value,"onUpdate:visible":t[2]||(t[2]=C=>d.value=C),class:"custom-class",title:"新建订单",placement:"right",width:"600",closable:!1,onClose:x},{extra:a(()=>[e(T,null,{default:a(()=>[e(r,{onClick:x},{default:a(()=>[p("关闭")]),_:1}),e(r,{type:"primary",onClick:i},{default:a(()=>[p("保存")]),_:1})]),_:1})]),default:a(()=>[e(A,{ref_key:"formRef",ref:_,model:o(c),rules:o(b),size:"small",layout:"vertical"},{default:a(()=>[e(g,{span:24},{default:a(()=>[e(n,{label:"ICCID",name:"iccid",rules:[{required:!0,message:"请输入ICCID"}]},{default:a(()=>[e(w,{value:o(c).iccid,"onUpdate:value":t[0]||(t[0]=C=>o(c).iccid=C),placeholder:"请输入ICCID"},null,8,["value"])]),_:1})]),_:1}),e(g,{span:24},{default:a(()=>[e(n,{label:"运营商",name:"telecomoperator",rules:[{required:!0,message:"请选择运营商"}]},{default:a(()=>[e(P,{ref:"select",value:o(c).telecomoperator,"onUpdate:value":t[1]||(t[1]=C=>o(c).telecomoperator=C),placeholder:"请选择运营商"},{default:a(()=>[(m(!0),y(U,null,N(u.value,C=>(m(),F(D,{key:C.value,vlue:C.value},{default:a(()=>[p(q(C.remarks),1)]),_:2},1032,["vlue"]))),128))]),_:1},8,["value"])]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["visible"])])}}},se={__name:"index",setup(h){const k=s(),c=L(),b=s([{remarks:"正常",value:"正常"},{remarks:"离线",value:"离线"}]),_=s();let u=s([{label:"搜索",key:"condition",type:"input"},{label:"状态",key:"status",type:"select",dataSource:b}]),d=s({id:"20230619142103",content:{where:{condition:"",status:"",siteid:""}}}),i=s({id:20230613154903,content:{nocache:!0,pageNumber:1,pageSize:100}});const S=()=>{k.value.tableData()},x=async()=>{var r;const t=await $.requested(i.value);_.value=(r=t.data)==null?void 0:r.map(w=>({remarks:w.sitename,value:w.siteid}))},v=t=>{c.push({name:"iotcardDetail",query:{id:t.w_iotcardid}})};return j(()=>{x()}),(t,r)=>{const w=l("a-button");return m(),y("div",null,[e(z,{ref_key:"list",ref:k,keyRouteName:"msisdn",param:o(d),tableName:"iotcardTable",searchType:o(u),detailPage:{name:"iotcardDetail",idname:"w_iotcardid"}},{operation:a(()=>[e(H,{style:{"margin-right":"10px"},onOnSuccess:S}),e(X)]),tb_cell:a(({data:n})=>[n.column.dataIndex==="telecomoperator"?(m(),y(U,{key:0},[p(q(n.record.telecomoperator=="CM"?"移动":n.record.telecomoperator=="CT"?"电信":n.record.telecomoperator=="CU"?"联通":""),1)],64)):n.column.dataIndex==="data_totalamount"?(m(),y(U,{key:1},[p(q(n.record.data_totalamount?n.record.data_totalamount+"KB":"0.0KB"),1)],64)):n.column.dataIndex==="data_useamount"?(m(),y(U,{key:2},[p(q(n.record.data_useamount?n.record.data_useamount+"KB":"0.0KB"),1)],64)):n.column.dataIndex==="data_remainamount"?(m(),y(U,{key:3},[p(q(n.record.data_remainamount?n.record.data_remainamount+"KB":"0.0KB"),1)],64)):n.column.dataIndex==="status"?(m(),y(U,{key:4},[p(q(n.record.status?"在线":"离线"),1)],64)):n.column.dataIndex==="operation"?(m(),F(w,{key:5,type:"link",onClick:g=>v(n.record)},{default:a(()=>[p("详 情")]),_:2},1032,["onClick"])):K("",!0)]),_:1},8,["param","searchType"])])}}};export{se as default};