//组件 var upoffwellcomponent = { template:`
搜索
导出
`, data(){ // 获取当前屏幕的分辨率 let screenW = window.screen.width; let screenH = window.innerHeight; console.log("screen width:",screenW); console.log("screen height:",screenH); return { tHeight:screenH-192, tableData: Array(0), wellname:'', user:'', currentPage: 1, pagesize:50, recordTotal:0, checked:false, } }, mounted() { var _this = this; var objs; axios.post('/deescloud/get_up_off_well_info', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize, wellname:this.$data.wellname, user:this.$data.user, if_es:this.$data.checked }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, methods: { export_csv(){ document.getElementById("bt_export").blur(); axios.post('/deescloud/get_up_off_well_csv', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize, wellname:this.$data.wellname, user:this.$data.user, if_es:this.$data.checked }).then(function (response) { console.log(response.data); var fileid = response.data.fileId; var downUrl = 'file/'+fileid; downloadUrl("人员上离井信息.csv",downUrl); }) .catch(function (error) { console.log(error); }); }, get_info(){ document.getElementById("bt_serach").blur(); this.$data.currentPage=1; var _this = this; var objs; axios.post('/deescloud/get_up_off_well_info', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize, wellname:this.$data.wellname, user:this.$data.user, if_es:this.$data.checked }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; var _this = this; var objs; axios.post('/deescloud/get_up_off_well_info', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize, wellname:this.$data.wellname, user:this.$data.user, if_es:this.$data.checked }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, handleCurrentChange(val) { //console.log(`当前页: ${val}`); this.$data.currentPage = val; var _this = this; var objs; axios.post('/deescloud/get_up_off_well_info', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize, wellname:this.$data.wellname, user:this.$data.user, if_es:this.$data.checked }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, } }