//组件 var toolscomponent_en = { template:`
Search
Risk warning:
Details
The instruments in this well are working normally
`, 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), input: '', currentPage: 1, pagesize: 50, recordTotal: 0, pdf_visible: false, tool_warning_data: [], checked: false, currentWellName: '' // 新增:存储当前查看的井名 }; }, mounted() { var _this = this; var objs; axios.post('/deescloud/get_well_tool', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize }) .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_pdf(row){ var _this = this; axios.post('/deescloud/get_tool_warning_pdf_en',{ opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), wellname: row.wellNameSource }, ).then(function (response) { console.log(response.data); var fileid = response.data.fileId; var downUrl = 'file/'+fileid; downloadUrl(row.wellNameSource+"_Instrument status report.pdf",downUrl); }) .catch(function (error) { console.log(error); }); }, export_mess_pdf(row) { var _this = this; axios.post('deescloud/get_tool_warning_pdf_en', { opuser: localStorage.getItem("online_user"), opuser_uuid: localStorage.getItem("uuid"), wellname: row.wellNameSource }) .then(function (response) { console.log(response.data); var fileid = response.data.fileId; var downUrl = 'file/' + fileid; console.log("downUrl-----------",downUrl); console.log("wellNameSource-----------",row.wellNameSource); downloadUrl(row.wellNameSource + "_Instrument status report.pdf", downUrl); }) .catch(function (error) { console.log(error); }); }, show_pdf(row){ let _this= this; this.currentWellName = row.wellNameSource; axios.post('/deescloud/get_tool_warning_en', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), wellname: row.wellNameSource, }) .then(function (response) { console.log(response.data); _this.$data.tool_warning_data = response.data.data; _this.$data.pdf_visible = true; }) .catch(function (error) { console.log(error); }); }, getWell(_search_name){ document.getElementById("bt_serach").blur(); this.$data.currentPage=1; var _this = this; var objs; axios.post('/deescloud/get_well_tool', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), Wellname: _search_name, if_warn:this.$data.checked, index: this.$data.currentPage, count: this.$data.pagesize }) .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; this.$data.currentPage = 1; var _this = this; var objs; axios.post('/deescloud/get_well_tool', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), Wellname: this.$data.input, if_warn:this.$data.checked, index: this.$data.currentPage, count: this.$data.pagesize }) .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_well_tool', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), Wellname: this.$data.input, if_warn:this.$data.checked, index: this.$data.currentPage, count: this.$data.pagesize }) .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); }); }, // 新增:打开详情页方法 openDetail(item) { // 使用当前井名和预警项ID构建详情页URL const wellName = this.currentWellName; // 不要预先编码 // 使用预警ID或时间戳作为唯一标识 // 构建基础URL,参数留待URLSearchParams处理 const detailUrl = 'tool_detail-en.html'; // 使用URLSearchParams自动处理编码 const params = new URLSearchParams({ well: wellName, id: item.opuser_uuid, name : item.name, series: item.series_num, instrument: item.instrument_id, flag:item.flag, content: item.context || '' }); // 完整URL const fullUrl = `${detailUrl}?${params.toString()}`; // 在新标签页打开详情页 window.open(fullUrl, '_blank'); } } }