lepu-test-platform-web/dist/static/js/21.c6abdc20026b7dd23dca.js

2 lines
26 KiB
JavaScript
Raw Normal View History

webpackJsonp([21],{"1qua":function(e,t){},WYal:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=i("mvHQ"),a=i.n(l),o=(i("D/fc"),{data:function(){return{fileIsChange:!1,loading:!1,length:"",value:"",multipleSelection:[],fileList:[],deviceOptions:[],platformOptions:[],brandOptions:[],isUsedOptions:[{id:1,label:"未借出",value:0},{id:2,label:"已借出",value:1}],classificationOptions:[],belongOptions:[],devicelist:[],queryInfo:{name:"",pageNum:1,pageSize:10},currpage:1,total:0,addDialogVisible:!1,borrowDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,addForm:{name:"",model:"",code:"",platform:"",brand:"",belong:"",classification:"",systemVersion:"",uuid:"",comments:"",picture:""},detailForm:{},editForm:{},borrowForm:{borrower:"",borrowInstructions:""},addFormRules:{belong:[{required:!0,message:"请选择设备所属",trigger:"blur"}],classification:[{required:!0,message:"请选择设备分类",trigger:"blur"}],brand:[{required:!0,message:"请选择设备品牌",trigger:"blur"}],name:[{required:!0,message:"请输入设备名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],model:[{required:!0,message:"请输入设备型号",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],code:[{required:!0,message:"请输入设备编号",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],platform:[{required:!0,message:"请选择操作系统",trigger:"blur"}],systemVersion:[{required:!0,message:"请输入系统版本",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],picture:[{required:!1,message:"请上传设备图片",trigger:"blur"}]},borrowFormRules:{borrower:[{required:!0,message:"请输入借用人",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],borrowInstructions:[{required:!1,message:"请输入借用说明",trigger:"blur"},{min:0,max:256,message:"长度在 0 到 256 个字符",trigger:"blur"}]}}},mounted:function(){this.getPlatformOptions(),this.getBrandOptions(),this.getClassificationOptions(),this.getBelongOptions()},created:function(){this.getDeviceList()},methods:{getPlatformOptions:function(){var e=this;this.$api.device.getPlatformOptions().then(function(t){e.platformOptions=t.data.data})},getBrandOptions:function(){var e=this;this.$api.device.getBrandOptions().then(function(t){e.brandOptions=t.data.data})},getClassificationOptions:function(){var e=this;this.$api.device.getClassificationOptions().then(function(t){e.classificationOptions=t.data.data})},getBelongOptions:function(){var e=this;this.$api.device.getBelongOptions().then(function(t){e.belongOptions=t.data.data})},handleSelectionChange:function(e){this.multipleSelection=e},statusFormat:function(e,t){return 0==e.isUsed?"未借出":"已借出"},query:function(){this.queryInfo.pageNum=1,this.total=0,this.getDeviceList()},getDeviceList:function(){var e=this;this.$api.device.queryAllDevice(a()(this.queryInfo)).then(function(t){e.devicelist=t.data.data,e.total=t.data.count,e.clearOptions()}).catch(function(){e.loading=!1})},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getDeviceList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getDeviceList()},addDevice:function(){var e=this;this.$refs.addFormRef.validate(function(t){if(t){var i=new FormData,l=e.fileList[0];if(null!=l){l.name;i.append("file",l.raw),i.append("filename",l.name),e.$api.comm.uploadImg(i).then(function(t){200==t.data.code?(t.data.data.title,e.addForm.picture=t.data.data.src):e.$notify({type:"error",message:"上传失败"})}).catch(function(){})}setTimeout(function(){e.$api.device.addDevice(a()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.addDialogVisible=!1,e.getDeviceList(),e.$refs.addFormRef.resetFields(),e.fileList=[]}).catch(function(){})},1e3)}})},borrowDevice:function(){var e=this;this.$refs.borrowFormRef.validate(function(t){if(t){var i=[];e.multipleSelection.forEach(function(t){var l={};l.id=t.id,l.borrower
//# sourceMappingURL=21.c6abdc20026b7dd23dca.js.map