(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e734655e","chunk-30d65b08","chunk-c3be1c5a"],{"0ac5":function(e,t,l){},"0d63":function(e,t,l){"use strict";l.r(t);var i=l("c1b7");const o={class:"vol-dialog"},a={key:0,class:"dia-footer"};function d(e,t,l,d,r,c){const n=Object(i["resolveComponent"])("el-scrollbar"),s=Object(i["resolveComponent"])("el-button"),u=Object(i["resolveComponent"])("el-dialog");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",o,[Object(i["createVNode"])(u,{modelValue:e.vmodel,"onUpdate:modelValue":t[2]||(t[2]=t=>e.vmodel=t),"close-on-click-modal":!1,"close-on-press-escape":!1,width:e.width,fullscreen:e.fullscreen,draggable:e.draggable,modal:e.modal,"before-close":e.handleClose},{header:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("i",{class:Object(i["normalizeClass"])(e.icon)},null,2),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.title)+" ",1),Object(i["createElementVNode"])("button",{class:"el-dialog__headerbtn",type:"button",style:{right:"35px",color:"var(--el-color-info)"},onClick:t[0]||(t[0]=(...t)=>e.handleFullScreen&&e.handleFullScreen(...t))},t[3]||(t[3]=[Object(i["createElementVNode"])("i",{class:"el-icon el-icon-full-screen"},null,-1)]))]),footer:Object(i["withCtx"])(()=>[e.footer?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",a,[Object(i["renderSlot"])(e.$slots,"footer",{},void 0,!0),e.footer?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createBlock"])(s,{key:0,type:"primary",size:"mini",onClick:t[1]||(t[1]=t=>e.handleClose())},{default:Object(i["withCtx"])(()=>t[4]||(t[4]=[Object(i["createElementVNode"])("i",{class:"el-icon-close"},null,-1),Object(i["createTextVNode"])("关闭")])),_:1}))])):Object(i["createCommentVNode"])("",!0)]),default:Object(i["withCtx"])(()=>[Object(i["createVNode"])(n,{"max-height":e.contentHeight},{default:Object(i["withCtx"])(()=>[e.inited?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,style:Object(i["normalizeStyle"])([{"min-height":"50px"},{padding:e.padding+"px"}]),class:"srcoll-content"},[Object(i["renderSlot"])(e.$slots,"content",{},void 0,!0),Object(i["renderSlot"])(e.$slots,"default",{},void 0,!0)],4)):Object(i["createCommentVNode"])("",!0)]),_:3},8,["max-height"])]),_:3},8,["modelValue","width","fullscreen","draggable","modal","before-close"])])}var r=Object(i["defineComponent"])({props:{modelValue:!1,lazy:{type:Boolean,default:!1},icon:{type:String,default:"el-icon-warning-outline"},title:{type:String,default:"基本信息"},height:{type:Number,default:200},width:{type:Number,default:650},padding:{type:Number,default:16},modal:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},onModelClose:{type:Function,default:e=>!0},footer:{type:Boolean,default:!0}},setup(e,t){const l=.95*document.body.clientHeight-60,o=Object(i["ref"])(!0),a=Object(i["ref"])(!1),d=Object(i["ref"])(!1),r=Object(i["ref"])(100);a.value=e.modelValue,d.value=!!t.slots.footer;const c=Object(i["ref"])(200);c.value=e.height;const n=(l,i)=>{let o=e.onModelClose(!!i);!1!==o&&(a.value=!1,t.emit("update:modelValue",!1),l&&l())},s=e=>(c.value=l-30,l/-2+"px");r.value=s(),Object(i["watch"])(()=>e.modelValue,(e,t)=>{a.value=e}),Object(i["watch"])(()=>e.height,(e,t)=>{r.value=s()});const u=Object(i["ref"])(!1),p=()=>{u.value=!u.value,t.emit("fullscreen",u.value)};return{handleClose:n,inited:o,vmodel:a,footer:d,top:r,calcHeight:s,contentHeight:c,fullscreen:u,handleFullScreen:p}}}),c=(l("19bb"),l("a80f"),l("9c21")),n=l.n(c);const s=n()(r,[["render",d],["__scopeId","data-v-0463adc6"]]);t["default"]=s},"19bb":function(e,t,l){"use strict";l("aef5")},"1c2c":function(e,t,l){},3631:function(e,t,l){"use strict";l("ca67")},"8a49":function(e,t,l){"use strict";l("0ac5")},"935f":function(e,t,l){"use strict";l.r(t);var i=l("c1b7");function o(e,t,l,o,a,d){const r=Object(i["resolveComponent"])("view-grid");return Object(i["openBlock"])(),Object(i["createBlock"])(r,{ref:"grid",columns:e.columns,detail:e.detail,editFormFields:e.editFormFields,editFormOptions:e.editFormOptions,searchFormFields:e.searchFormFields,searchFormOptions:e.searchFormOptions,table:e.table,extend:e.extend},null,8,["columns","detail","editFormFields","editFormOptions","searchFormFields","searchFormOptions","table","extend"])}function a(e,t,l,o,a,d){const r=Object(i["resolveComponent"])("upload-excel"),c=Object(i["resolveComponent"])("vol-box");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createVNode"])(c,{modelValue:a.showDetialBox,"onUpdate:modelValue":t[0]||(t[0]=e=>a.showDetialBox=e),lazy:!0,height:350,width:600,padding:15,title:"设备协议信息-导入"},{default:Object(i["withCtx"])(()=>[Object(i["createVNode"])(r,{ref:"upload_excel",url:a.url,template:a.template},null,8,["url","template"])]),_:1},8,["modelValue"])])}l("5948");var d=l("0d63"),r=l("eec6"),c={components:{VolBox:d["default"],UploadExcel:r["default"]},data(){return{showDetialBox:!1,url:"",template:{url:"",fileName:"设备协议信息导入模板"}}},methods:{open(){this.template.url=this.http.ipAddress+"api/DeviceProtocol/DownLoadTemplate",this.url=this.http.ipAddress+"api/DeviceProtocol/GetImportData",this.showDetialBox=!0,this.$nextTick(()=>{this.$refs.upload_excel.upload=this.upload,console.log(this.$refs.upload_excel)})},upload(){console.log("upload");let e=this.url;if(!e)return this.$Message.error("没有配置好Url");if(!this.$refs.upload_excel.file)return this.$Message.error("请选择文件");var t=new FormData;t.append("fileInput",this.$refs.upload_excel.file),this.$refs.upload_excel.importExcelBefore(t)&&(this.$refs.upload_excel.loadingStatus=!0,this.http.post(e,t).then(e=>{this.$refs.upload_excel.loadingStatus=!1,this.$refs.upload_excel.file=null,e.status&&this.$emit("parentCall",t=>{t.$refs.detail.rowData.push(...e.data)}),this.message=e.message,this.resultClass=e.status?"v-r-success":"v-r-error"},e=>{this.$refs.upload_excel.loadingStatus=!1}))}},created(){}},n=(l("8a49"),l("3631"),l("9c21")),s=l.n(n);const u=s()(c,[["render",a],["__scopeId","data-v-55230e24"]]);var p=u;let f={components:{gridHeader:"",gridBody:p,gridFooter:"",modelHeader:"",modelBody:"",modelFooter:""},tableAction:"",buttons:{view:[],box:[],detail:[]},methods:{onInit(){var e=this.detailOptions.buttons.find(e=>"import"==e.value);e&&(e.onClick=function(){this.$refs.gridBody.open()})},onInited(){},searchBefore(e){return!0},searchAfter(e){return!0},addBefore(e){return!0},updateBefore(e){return!0},rowClick({row:e,column:t,event:l}){},modelOpenAfter(e){},updated(){this.$nextTick(()=>{this.$refs.upload_excel&&(alert("点击了上传按钮"),this.$refs.upload_excel.upload=function(){console.log("点击了上传按钮")})})}}};var m=f,h=Object(i["defineComponent"])({setup(){const e=Object(i["ref"])({key:"id",footer:"Foots",cnName:"设备信息",name:"deviceInfo",url:"/DeviceInfo/",sortName:"createDate"}),t=Object(i["ref"])({deviceCode:"",deviceName:"",deviceType:"",deviceStatus:"",deviceIp:"",devicePort:"",devicePlcType:"",deviceRemark:""}),l=Object(i["ref"])([[{title:"设备编号",required:!0,field:"deviceCode",type:"string"},{title:"设备名称",required:!0,field:"deviceName",type:"string"},{title:"设备类型",required:!0,field:"deviceType",type:"select",dataKey:"deviceType",data:[]},{title:"设备状态",required:!0,field:"deviceStatus",type:"select",dataKey:"deviceStatus",data:[]}],[{title:"设备IP",required:!0,field:"deviceIp",type:"string"},{title:"设备端口",required:!0,field:"devicePort",type:"string"},{title:"PLC类型",required:!0,field:"devicePlcType",type:"select",dataKey:"devicePlcType",data:[]},{title:"备注",field:"deviceRemark",type:"string"}]]),o=Object(i["ref"])({deviceCode:"",deviceType:"",deviceStatus:""}),a=Object(i["ref"])([[{title:"设备编号",field:"deviceCode"},{title:"设备类型",field:"deviceType",type:"select",dataKey:"deviceType",data:[]},{title:"设备状态",field:"deviceStatus",type:"select",dataKey:"deviceStatus",data:[]}]]),d=Object(i["ref"])([{field:"id",title:"Id",type:"int",width:90,hidden:!0,readonly:!0,require:!0,align:"left"},{field:"deviceCode",title:"设备编号",type:"string",width:90,align:"left"},{field:"deviceName",title:"设备名称",type:"string",link:!0,width:150,align:"left"},{field:"deviceType",title:"设备类型",type:"string",width:150,align:"left",bind:{key:"deviceType",data:[]}},{field:"deviceStatus",title:"设备状态",type:"string",width:90,align:"left",bind:{key:"deviceStatus",data:[]}},{field:"deviceIp",title:"设备IP",type:"string",width:90,align:"left"},{field:"devicePort",title:"设备端口",type:"int",width:120,align:"left"},{field:"devicePlcType",title:"PLC类型",type:"string",width:120,align:"left",bind:{key:"devicePlcType",data:[]}},{field:"creater",title:"创建人",type:"string",width:90,align:"left"},{field:"createDate",title:"创建时间",type:"datetime",width:160,align:"left"},{field:"modifier",title:"修改人",type:"string",width:100,align:"left"},{field:"modifyDate",title:"修改时间",type:"datetime",width:160,align:"left"},{field:"deviceRemark",title:"备注",type:"string",width:100,align:"left"}]),r=Object(i["ref"])({cnName:"设备协议信息",table:"DeviceProtocol",columns:[{field:"id",title:"Id",type:"int",width:90,hidden:!0,require:!0,align:"left"},{field:"deviceId",title:"设备主键",type:"string",width:90,hidden:!0,readonly:!0,require:!0,align:"left"},{field:"deviceChildCode",title:"设备子编号",type:"string",edit:{type:""},width:150,require:!0,align:"left",sortable:!0},{field:"deviceProDataBlock",title:"协议数据块",type:"string",width:100,require:!0,align:"left",edit:{type:""}},{field:"deviceProOffset",title:"偏移量",type:"decimal",width:90,edit:{type:"number"},require:!0,align:"left"},{field:"deviceProDataType",title:"数据类型",type:"string",width:90,require:!0,align:"left",edit:{type:""}},{field:"deviceProDataLength",title:"数据长度",type:"int",width:90,require:!0,align:"left",edit:{type:""}},{field:"deviceProParamName",title:"参数名称",type:"string",width:150,require:!0,align:"left",edit:{type:""}},{field:"deviceProParamType",title:"参数类型",type:"string",width:150,require:!0,align:"left",edit:{type:""}},{field:"deviceProParamDes",title:"参数说明",type:"string",width:130,require:!0,align:"left",edit:{type:""}},{field:"creater",title:"创建人",type:"string",width:90,align:"left",sortable:!0},{field:"creater",title:"创建人",type:"string",width:90,align:"left"},{field:"createDate",title:"创建时间",type:"datetime",width:160,align:"left"},{field:"modifier",title:"修改人",type:"string",width:100,align:"left"},{field:"modifyDate",title:"修改时间",type:"datetime",width:160,align:"left"}],sortName:"CreateDate",key:"id"});return{table:e,extend:m,editFormFields:t,editFormOptions:l,searchFormFields:o,searchFormOptions:a,columns:d,detail:r}}});const b=s()(h,[["render",o]]);t["default"]=b},a6a7:function(e,t,l){},a80f:function(e,t,l){"use strict";l("1c2c")},aef5:function(e,t,l){},ca67:function(e,t,l){},e1df:function(e,t,l){"use strict";l("a6a7")},eec6:function(e,t,l){"use strict";l.r(t);var i=l("c1b7");const o={class:"upload-container"},a=["href"],d={class:"button-group"},r={class:"alert"},c={key:0},n={class:"file-info"},s={class:"v-r-message"},u=["innerHTML"];function p(e,t,l,p,f,m){const h=Object(i["resolveComponent"])("el-button"),b=Object(i["resolveComponent"])("el-upload"),g=Object(i["resolveComponent"])("el-alert");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",o,[Object(i["createElementVNode"])("a",{href:l.template.url,ref:"template"},null,8,a),Object(i["createElementVNode"])("div",d,[Object(i["createVNode"])(b,{style:{float:"left"},ref:"uploadFile","max-size":f.maxSize,"on-change":m.clearMsg,"before-upload":m.beforeUpload,action:l.url},{default:Object(i["withCtx"])(()=>[Object(i["createVNode"])(h,{size:"small"},{default:Object(i["withCtx"])(()=>t[0]||(t[0]=[Object(i["createElementVNode"])("i",{class:"el-icon-folder-opened"},null,-1),Object(i["createTextVNode"])("选择文件")])),_:1})]),_:1},8,["max-size","on-change","before-upload","action"]),l.template.url?(Object(i["openBlock"])(),Object(i["createBlock"])(h,{key:0,style:{"margin-left":"10px"},type:"primary",size:"small",onClick:m.dowloadTemplate,loading:f.loadingStatus},{default:Object(i["withCtx"])(()=>t[1]||(t[1]=[Object(i["createElementVNode"])("i",{class:"el-icon-bottom"},null,-1),Object(i["createTextVNode"])(" 下载模板")])),_:1},8,["onClick","loading"])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(h,{type:"success",size:"small",onClick:m.upload,loading:f.loadingStatus},{default:Object(i["withCtx"])(()=>t[2]||(t[2]=[Object(i["createElementVNode"])("i",{class:"el-icon-top"},null,-1),Object(i["createTextVNode"])(" 上传文件")])),_:1},8,["onClick","loading"])]),Object(i["createElementVNode"])("div",r,[Object(i["createVNode"])(g,{title:"上传说明",type:"warning",closable:!1,"show-icon":""},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])("只能上传excel文件,文件大小不超过"+Object(i["toDisplayString"])(f.maxSize)+"M",1)]),_:1})]),f.file?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[t[3]||(t[3]=Object(i["createElementVNode"])("h3",null,"文件列表",-1)),Object(i["createElementVNode"])("div",n,[Object(i["createElementVNode"])("span",null,"文件名:"+Object(i["toDisplayString"])(f.file.name),1),Object(i["createElementVNode"])("span",null,"大小"+Object(i["toDisplayString"])((f.file.size/1024).toFixed(2))+"KB",1)])])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",s,[t[4]||(t[4]=Object(i["createElementVNode"])("h3",{class:"title"},"上传结果",-1)),Object(i["createElementVNode"])("div",{class:Object(i["normalizeClass"])(["text",f.resultClass]),innerHTML:f.message},null,10,u)],512),[[i["vShow"],f.message]]),Object(i["renderSlot"])(e.$slots,"default",{},void 0,!0)])}l("c9d7"),l("b6b0"),l("e2d1");var f={components:{},props:{url:{type:String,default:""},template:{type:Object,default:()=>({url:"",fileName:"未定义文件名"})},importExcelBefore:{type:Function,default:e=>!0}},data(){return{maxSize:100,model:!0,file:null,loadingStatus:!1,message:"",resultClass:""}},methods:{clearMsg(){this.message=""},reset(){this.file=null,this.message="",this.resultClass=""},getFileType(){let e=this.file.name.split(".").pop().toLocaleLowerCase()||"";return-1!=["numbers","csv","xls","xlsx"].indexOf(e)||(this.$Message.error("只能选择excel文件"),!1)},beforeUpload(e){return this.file=e,this.getFileType(),!1},upload(){let e=this.url;if(!e)return this.$Message.error("没有配置好Url");if(!this.file)return this.$Message.error("请选择文件");var t=new FormData;t.append("fileInput",this.file),this.importExcelBefore(t)&&(this.loadingStatus=!0,this.http.post(e,t).then(e=>{this.loadingStatus=!1,this.file=null,e.status&&this.$emit("importExcelAfter",e),this.message=e.message,this.resultClass=e.status?"v-r-success":"v-r-error"},e=>{this.loadingStatus=!1}))},dowloadTemplate(){let e=this.template.url,t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Content-type","application/json"),t.setRequestHeader("Authorization",this.$store.getters.getToken());let l=this.template.fileName+".xlsx",i=this.$refs.template;t.responseType="blob";let o=this;this.loadingStatus=!0,t.onload=function(e){if(o.loadingStatus=!1,"application/json"==t.response.type)return o.message.error("未找到下载文件");let a=t.response;i.download=l;let d=new Blob([a]);i.href=URL.createObjectURL(d),i.click()},t.send()}}},m=(l("e1df"),l("9c21")),h=l.n(m);const b=h()(f,[["render",p],["__scopeId","data-v-46f5eaaa"]]);t["default"]=b}}]);