1 line
7.0 KiB
JavaScript
1 line
7.0 KiB
JavaScript
|
webpackJsonp([405],{ejhF:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("d7EF"),s=a.n(n),i=a("//Fk"),o=a.n(i),l=(a("GKmE"),a("Dod7")),r={name:"inspection_standard",data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},typeList:[],btnDelDisabled:!0,btnOtherDisabled:!0,rowIds:[],tableData:[],dialogVisible:!1,pictLoading:!1,uploadUrl:l.a.uploadUrl,uploadAttachment:[],fullscreenLoading:!1,auto_upload:!1}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.getList()},methods:{clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},initData:function(){var e=this;o.a.all([this.$api.dictAPI.getDictsByType("device_type")]).then(function(t){var a=s()(t,1)[0];0===a.code&&(e.typeList=a.datas)}).catch(function(e){console.log(e)})},getList:function(){var e=this;this.pictLoading=!0,this.$api.patroPlanAPI.list(this.search_data).then(function(t){e.pictLoading=!1,t.data?(e.total=t.data.totalRows,e.tableData=t.data.datas?t.data.datas:[]):(e.total=0,e.tableData=[])}).catch(function(e){console.log(e)})},search:function(){this.search_data.pageno=1,this.getList()},handleCurrentChange:function(e){this.search_data.pageno=e,this.getList()},handleSizeChange:function(e){this.search_data.pagesize=e,this.getList()},viewDetail:function(e){this.$router.push({path:"/inspection/standard_add",query:{id:e.id,t:Date.now()}})},add:function(){this.$router.push({path:"/inspection/standard_add",query:{t:Date.now()}})},remove:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)});var a={projectIds:t};this.$confirm("确认删除选中的巡检标准吗?","提示",{type:"warning"}).then(function(){e.$api.patroPlanAPI.batchRemoveProject(a).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getList()):e.$message({message:t.msg?t.msg:"删除失败,请重试",type:"error"})}).catch(function(t){e.$message({message:"删除失败,请重试",type:"error"})})})},handleSelectionChange:function(e){this.rowIds=e,this.setBtn(e)},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnDelDisabled=a,this.btnOtherDisabled=t},upLoadExcel:function(){this.$api.netWorkingAPI.downExcel({filePath:"/gyhl-file/template/patrol-standard-template.xlsx",fileName:"patrol-standard-template.xlsx"}).then(function(e){})},httpRequest:function(e,t,a){var n=this,s=this,i=new FormData;i.append("file",e,t),this.$api.patroPlanAPI.importExcel(i).then(function(e){s.fullscreenLoading=!1,0==e.code?(s.$message({message:"上传成功",type:"success",duration:2e3}),n.getList()):(s.fullscreenLoading=!1,s.$message.error(e.msg),s.$refs.upload.uploadFiles.splice(s.$refs.upload.uploadFiles.length-1,1))})},uploadSuccess:function(e,t){"操作成功"===e.msg&&this.uploadAttachment.push({filePath:e.filePath,fileName:e.fileName})},onChange:function(e,t){if(e.size>1e8)return this.$message.error("上传文件不能超过100M!"),this.$refs.upload.fileList=this.$refs.upload.fileList,this.$refs.upload.uploadFiles.splice(this.$refs.upload.uploadFiles.length-1,1),!1;if(e=e.raw,/image\/\w+/.test(e.type)){this.fullscreenLoading=!0;var a=this;imageConversion.compressAccurately(e,400).then(function(t){t.size?a.httpRequest(t,e.name,e):(a.$message.error("压缩图片失败"),a.fullscreenLoading=!1,a.$refs.upload.uploadFiles.splice(a.$refs.upload.uploadFiles.length-1,1))})}else this.fullscreenLoading=!0,this.httpRequest(e,e.name)}}},c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box knowledge-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"inspection:standard:add",expression:"'inspection:standard:add'"}],attrs:{type:"primary"},on:{click:function(t){return e.add()}}},[e._v("新增")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"inspection:standard:remove",expression:"'inspection:standard:remove'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.remo
|