yxk_pc_mdh/gyhl/static/js/433.79746cf6ea43e9a8bb22.js

1 line
14 KiB
JavaScript
Raw Normal View History

2025-08-28 15:26:35 +08:00
webpackJsonp([433],{YU1m:function(e,t){},Z2sh:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("d7EF"),n=a.n(i),s=a("//Fk"),o=a.n(s),l=a("mvHQ"),r=a.n(l),c=a("BO1k"),d=a.n(c),p=a("Dod7"),u=(a("NYxO"),a("MJLE")),h=a.n(u),m={name:"equipment_index",data:function(){return{depOptions:[],selectDeptId:[],total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10,name:""},adv_search_data:{},tableData:[],dialogVisible:!1,btnDelDisabled:!0,btnOtherDisabled:!0,deptList:[],usingList:[],typeList:[],rowIds:[],codeData:{},printHtml:"",pictLoading:!1,uploadAttachment:[],fileDocList:[],uploadUrl:p.a.uploadUrl,ftpPrefix:p.a.ftpPrefix,fullscreenLoading:!1,auto_upload:!1}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.initDta(),this.search(),console.log(this.$route.query.using_status),this.$route.query.using_status&&this.$set(this.search_data,"using_status",parseInt(this.$route.query.using_status))},methods:{treeFindPath:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var i=!0,n=!1,s=void 0;try{for(var o,l=d()(e);!(i=(o=l.next()).done);i=!0){var r=o.value;if(a.push(r.id),t(r))return a;if(r.children){var c=this.treeFindPath(r.children,t,a);if(c.length)return c}a.pop()}}catch(e){n=!0,s=e}finally{try{!i&&l.return&&l.return()}finally{if(n)throw s}}return[]},setDeptList:function(e){var t=!0,a=!1,i=void 0;try{for(var n,s=d()(e);!(t=(n=s.next()).done);t=!0){var o=n.value;o.hasChildren?this.setDeptList(o.children):o.children=void 0}}catch(e){a=!0,i=e}finally{try{!t&&s.return&&s.return()}finally{if(a)throw i}}},setDefaultDept:function(){if(this.depOptions.length>0&&this.search_data.deptId){var e=r()(this.search_data.deptId),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(r()(t))}},handleChange:function(e){this.search_data.deptId=e[e.length-1],this.selectDeptId=e},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},initDta:function(){var e=this;o.a.all([this.$api.dictAPI.getDictsByType("device_type"),this.$api.commonAPI.getDeptsTree(),this.$api.dictAPI.getDictsByType("device_status")]).then(function(t){var a=n()(t,3),i=a[0],s=a[1],o=a[2];0===i.code&&(e.typeList=i.datas),0===s.code&&(e.depOptions=s.data.children,e.setDefaultDept(),e.setDeptList(e.depOptions)),0===o.code&&(e.usingList=o.datas)}).catch(function(e){console.log(e)})},openDetails:function(e){this.$router.push({path:"/equipment/info",query:{id:e.id,t:Date.now()}})},add:function(){this.$router.push({path:"/equipment/info",query:{t:Date.now()}})},remove:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)}),this.$confirm("确认删除选中的设备台账吗?","提示",{type:"warning"}).then(function(){e.$api.deviceAPI.allDelete({deviceId:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.search()):e.$message({message:t.msg?t.msg:"删除失败,请重试",type:"error"})}).catch(function(t){e.$message({message:"删除失败,请重试",type:"error"})})})},generateQR:function(){var e=this,t=this,a=this.rowIds[0].id;this.$api.deviceAPI.getDeviceQRCode(a).then(function(a){0===a.code&&(console.log(a.data),e.codeData={id:a.data.id,serialNo:a.data.serialNo},e.dialogVisible=!0,e.$nextTick(function(){document.getElementById("qrcode").innerHTML="",console.log(e.codeData);new h.a("qrcode",{width:200,height:200,text:r()(t.codeData)})},100))})},saveQRPic:function(){var e=document.getElementById("qrcode").getElementsByTagName("canvas"),t=document.getElementById("qrcode").getElementsByTagName("img"),a=document.createElement("a"),i=e[0].toDataURL("image/jpg"),n=navigator.userAgent;if(-1!=n.indexOf("Trident")&&-1!=n.indexOf("Windows")){for(var s=atob(i.split(",")[1]),o=s.length,l=new Uint8Array(o);o--;)l[o]=s.charCodeAt(o);var r=new Blob([l]);window.navigator.msSaveOrOpenBlob(r,this.codeData.name+".png")}else if(n.indexOf("Firefox")>-1){var c=this.base64ToBlob(i);document.createEvent("HTMLEvents").initEvent("click",!0,!0),a.download=" ",a.href=URL.createObj