最新代码

This commit is contained in:
lupeng_zz 2026-01-29 15:13:21 +08:00
parent 1d2bf2042c
commit 4aff2af250
11 changed files with 625 additions and 1180 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -57,6 +57,9 @@
<script src="scripts/ps.js"></script>
<script src="scripts/nbs.js"></script>
<script src="scripts/month.js"></script>
<script src="scripts/updatePwd.js"></script>
<script src="scripts/battery.js"></script>
</head>
<body style="margin: 0px;">
@ -79,7 +82,7 @@
<el-dropdown-menu slot="dropdown" style="font-size: 12px;">
<el-dropdown-item command='setting'>显示设置</el-dropdown-item>
<el-dropdown-item command='help'>帮助</el-dropdown-item>
<el-dropdown-item command='updatepwd'>修改密码</el-dropdown-item>
<el-dropdown-item command='updatePwd'>修改密码</el-dropdown-item>
<el-dropdown-item command='exit'>退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>

View File

@ -48,7 +48,7 @@
style="margin-left: 10px"
v-model="scope.row.pumpExport"
@change="(value) => handlePumpExportChange(value, scope.row)">
<span style="color: green">导出</span>
<span style="color: green">信息</span>
</el-checkbox>
</template>
</el-table-column>

View File

@ -11,14 +11,14 @@
// 设置序列号
document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
}
const instrumentNum = getUrlParameter('instrument');
});
// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', async function() {
setInterval(checkUser,5000);
const seriesNum = getUrlParameter('series');
const instrumentNum = getUrlParameter('instrument');
const wellName = getUrlParameter('well');
@ -26,7 +26,6 @@
const content = getUrlParameter('content');
console.log('wellName:', wellName);
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
// 调用查询接口
const toolData = await fetchToolData(wellName ,seriesNum , instrumentNum ,flag ,content);
if (toolData) {
@ -38,9 +37,6 @@
// 查询仪器详细信息
async function fetchToolData(wellName, seriesNum, instrumentNum ,flag ,content) {
console.log("wellName----------", wellName);
console.log("seriesNum----------", seriesNum);
console.log("instrumentNum----------", instrumentNum);
try {
// 添加 await 关键字
@ -93,9 +89,14 @@ function renderInstrumentData(data) {
return;
}
const seriesNum = getUrlParameter('series');
const instrument = getUrlParameter('instrument');;
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum + ' ' + instrument;
}
// 1. 更新仪器名称Series + Instrument
const instrumentName = `${data.series || ""} - ${data.instrument || ""}`;
document.getElementById("seriesNum").textContent = instrumentName;
// 2. 格式化出厂日期(去掉 "T00:00:00Z"
const formattedTime = data.time ? data.time.split('T')[0] : "";
@ -109,11 +110,11 @@ function renderInstrumentData(data) {
// 4. 更新累计工作时间workTime
document.querySelector(".basic-info-table tbody tr:nth-child(2) td:nth-child(2)").textContent =
`${data.workTime || "0"} 小时`;
`${data.workTime || "0"} h`;
// 5. 更新当次工作时间workTimes
document.querySelector(".basic-info-table tbody tr:nth-child(2) td:nth-child(4)").textContent =
`${data.workTimes || "0"} 小时`;
`${data.workTimes || "0"} h`;
// 6. 更新固件版本号
document.querySelector(".basic-info-table tbody tr:nth-child(3) td:nth-child(2)").textContent =
@ -203,7 +204,7 @@ function populateBasicInfo(data){
fileListContainer.style.marginTop = '10px';
const fileListTitle = document.createElement('div');
fileListTitle.textContent = 'Uploaded file:';
fileListTitle.textContent = 'File:';
fileListTitle.style.fontSize = '12px';
fileListTitle.style.color = '#666';
fileListTitle.style.marginBottom = '5px';
@ -294,7 +295,7 @@ function populateBasicInfo(data){
linkDisplay.style.padding = '6px 12px';
linkDisplay.style.minHeight = '20px';
linkDisplay.style.marginRight = '10px';
linkDisplay.textContent = item.link || 'No data';
linkDisplay.textContent = item.link || '';
// 编辑按钮
const editLinkButton = document.createElement('button');
@ -322,13 +323,14 @@ function populateBasicInfo(data){
linkInput.style.minWidth = '150px';
linkInput.style.display = 'none';
linkInput.value = item.link || '';
linkInput.placeholder = 'Please enter the link information';
linkInput.placeholder = 'please enter the link';
// 确认按钮(初始隐藏)
const confirmLinkButton = document.createElement('button');
confirmLinkButton.className = 'confirm-link-btn';
confirmLinkButton.textContent = 'Confirm';
confirmLinkButton.style.padding = '6px 12px';
confirmLinkButton.style.marginTop = '3px';
confirmLinkButton.style.backgroundColor = '#67c23a';
confirmLinkButton.style.border = '1px solid #67c23a';
confirmLinkButton.style.borderRadius = '4px';
@ -369,7 +371,7 @@ function populateBasicInfo(data){
if (response.status === 200) {
// 更新显示
linkDisplay.textContent = linkInput.value || 'No data';
linkDisplay.textContent = linkInput.value || '';
// 切换回显示模式
linkDisplay.style.display = 'block';
@ -550,7 +552,9 @@ function handleMaintenanceFileUpload(event, item) {
if (typeof upload_file_success === 'function') {
upload_file_success(data, file, [data]);
}
setTimeout(() => {
location.reload();
}, 500);
// 局部刷新文件列表
refreshFileList(item.id, file,data.realFileName);
})
@ -593,7 +597,7 @@ function refreshMaintenanceFileList(itemId,id, uploadedFile , realFileName) {
fileListContainer.style.marginTop = '10px';
const fileListTitle = document.createElement('div');
fileListTitle.textContent = 'Uploaded file:';
fileListTitle.textContent = 'File:';
fileListTitle.style.fontSize = '12px';
fileListTitle.style.color = '#666';
fileListTitle.style.marginBottom = '5px';
@ -710,6 +714,9 @@ function handleFileUpload(event, item) {
.then(response => response.json())
.then(data => {
console.log('文件上传成功:', data);
setTimeout(() => {
location.reload();
}, 500);
refreshFileList(item.id, file, data.data.realFileName.replace('./upload/', ''));
})
.catch(error => {
@ -746,7 +753,7 @@ function refreshFileList(itemId, uploadedFile , realFileName) {
fileListContainer.style.marginTop = '10px';
const fileListTitle = document.createElement('div');
fileListTitle.textContent = 'Uploaded file:';
fileListTitle.textContent = 'File:';
fileListTitle.style.fontSize = '12px';
fileListTitle.style.color = '#666';
fileListTitle.style.marginBottom = '5px';
@ -903,7 +910,7 @@ function populateMaintenanceInfo(data) {
const emptyRow = document.createElement('tr');
const emptyCell = document.createElement('td');
emptyCell.colSpan = 6; // 更新为6列
emptyCell.textContent = 'No data';
emptyCell.textContent = '';
emptyCell.style.textAlign = 'center';
emptyRow.appendChild(emptyCell);
tbody.appendChild(emptyRow);
@ -969,7 +976,7 @@ function populateMaintenanceInfo(data) {
fileListContainer.style.marginTop = '10px';
const fileListTitle = document.createElement('div');
fileListTitle.textContent = 'Uploaded file:';
fileListTitle.textContent = 'File:';
fileListTitle.style.fontSize = '12px';
fileListTitle.style.color = '#666';
fileListTitle.style.marginBottom = '5px';
@ -1058,12 +1065,12 @@ function populateMaintenanceInfo(data) {
linkDisplay.style.padding = '6px 12px';
linkDisplay.style.minHeight = '20px';
linkDisplay.style.marginRight = '10px';
linkDisplay.textContent = item.link || 'No data';
linkDisplay.textContent = item.link || '';
// 编辑按钮
const editLinkButton = document.createElement('button');
editLinkButton.className = 'edit-link-btn';
editLinkButton.textContent = 'redact';
editLinkButton.textContent = 'Redact';
editLinkButton.style.padding = '6px 12px';
editLinkButton.style.backgroundColor = '#409eff';
editLinkButton.style.border = '1px solid #409eff';
@ -1086,7 +1093,7 @@ function populateMaintenanceInfo(data) {
linkInput.style.minWidth = '150px';
linkInput.style.display = 'none';
linkInput.value = item.link || '';
linkInput.placeholder = 'Please enter the link information';
linkInput.placeholder = 'please enter the link';
// 确认按钮(初始隐藏)
const confirmLinkButton = document.createElement('button');
@ -1133,7 +1140,7 @@ function populateMaintenanceInfo(data) {
if (response.status === 200) {
// 更新显示
linkDisplay.textContent = linkInput.value || 'No data';
linkDisplay.textContent = linkInput.value || '';
// 切换回显示模式
linkDisplay.style.display = 'block';
@ -1277,7 +1284,9 @@ function handleMaintenanceFileUpload(event, item) {
if (typeof upload_file_success === 'function') {
upload_file_success(data, file, [data]);
}
setTimeout(() => {
location.reload();
}, 500);
// 局部刷新文件列表
refreshMaintenanceFileList(item.id,data.data.id, file,data.data.realFileName);
})
@ -1333,18 +1342,18 @@ function upload_file_error(error, file, fileList) {
modal.innerHTML = `
<div style="background-color: white; margin: 5% auto; padding: 0; border-radius: 4px; width: 60%; max-width: 800px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);">
<div style="display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #eee; background-color: #f5f7fa;">
<h3 style="margin: 0; color: #333; font-size: 18px;">Maintenance information</h3>
<h3 style="margin: 0; color: #333; font-size: 18px;">Maintenance Information</h3>
<button id="closeModal" style="background: none; border: none; font-size: 24px; cursor: pointer; color: #999; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;">×</button>
</div>
<form id="maintenanceForm" style="padding: 20px;">
<div style="display: flex; flex-wrap: wrap; margin: 0 -10px;">
<div style="width: 50%; padding: 0 10px; box-sizing: border-box; margin-bottom: 15px;">
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Series num</label>
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Series Num</label>
<input type="text" id="seriesInput" value="${seriesNum || ''}" style="width: 100%; padding: 10px; border: 1px solid #dcdfe6; border-radius: 4px; box-sizing: border-box;background-color: #e9e9eaff;" disabled>
</div>
<div style="width: 50%; padding: 0 10px; box-sizing: border-box; margin-bottom: 15px;">
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Instrument num</label>
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Instrument Num</label>
<input type="text" id="instrumentIdInput" value="${instrumentNum || ''}" style="width: 100%; padding: 10px; border: 1px solid #dcdfe6; border-radius: 4px; box-sizing: border-box; background-color: #e9e9eaff;" disabled>
</div>
</div>
@ -1352,18 +1361,18 @@ function upload_file_error(error, file, fileList) {
<div style="display: flex; flex-wrap: wrap; margin: 0 -10px;">
<div style="width: 50%; padding: 0 10px; box-sizing: border-box; margin-bottom: 15px;">
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Maintenance level</label>
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Maintenance Level</label>
<input type="text" id="repairLevelInput" style="width: 100%; padding: 10px; border: 1px solid #dcdfe6; border-radius: 4px; box-sizing: border-box;">
</div>
<div style="width: 50%; padding: 0 10px; box-sizing: border-box; margin-bottom: 15px;">
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Maintenance info</label>
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Maintenance Info</label>
<input type="text" id="noteInput" style="width: 100%; padding: 10px; border: 1px solid #dcdfe6; border-radius: 4px; box-sizing: border-box;">
</div>
</div>
<div style="display: flex; flex-wrap: wrap; margin: 0 -10px;">
<div style="width: 50%; padding: 0 10px; box-sizing: border-box; margin-bottom: 15px;">
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Maintenance person</label>
<label style="display: block; margin-bottom: 5px; font-weight: bold; color: #555;">Maintenance Person</label>
<input type="text" id="applicanterInput" value="${localStorage.getItem('online_user') || ''}" style="width: 100%; padding: 10px; border: 1px solid #dcdfe6; border-radius: 4px; box-sizing: border-box;background-color: #e9e9eaff;" disabled>
</div>
@ -1371,8 +1380,8 @@ function upload_file_error(error, file, fileList) {
</form>
<div style="display: flex; justify-content: flex-end; padding: 15px 20px; border-top: 1px solid #eee; background-color: #f5f7fa;">
<button id="cancelBtn" style="margin-right: 10px; padding: 8px 16px; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 4px; cursor: pointer; color: #606266;"></button>
<button id="confirmBtn" style="padding: 8px 16px; background-color: #409eff; border: 1px solid #409eff; border-radius: 4px; color: white; cursor: pointer;"></button>
<button id="cancelBtn" style="margin-right: 10px; padding: 8px 16px; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 4px; cursor: pointer; color: #606266;">Cancel</button>
<button id="confirmBtn" style="padding: 8px 16px; background-color: #409eff; border: 1px solid #409eff; border-radius: 4px; color: white; cursor: pointer;">Confirm</button>
</div>
</div>
`;
@ -1433,7 +1442,7 @@ function upload_file_error(error, file, fileList) {
// 检查返回结果
if (response.data.r === -1) {
alert('You are offline. Please login in again');
alert('You are offline. Please login in again.');
} else {
closeModal();
@ -1453,8 +1462,9 @@ function upload_file_error(error, file, fileList) {
// 添加渲染部门信息的函数
function renderDeptInfo(data) {
if (!data || !data.dept) {
if (!data?.dept?.trim()) {
console.warn("无部门信息");
deptContainer.textContent = "No data";
return;
}
const deptContainer = document.getElementById("deptContainer");
@ -1475,15 +1485,15 @@ document.addEventListener('DOMContentLoaded', async function() {
// 初始化编辑按钮事件
document.getElementById('editProcessRecord').addEventListener('click', function() {
toggleEditInput(this, '生产过程记录', 'process_record', inputStates);
toggleEditInput(this, 'Edit Process Record', 'process_record', inputStates);
});
document.getElementById('editProcessInspection').addEventListener('click', function() {
toggleEditInput(this, '生产过程检验', 'process_inspection', inputStates);
toggleEditInput(this, 'Edit Process Inspection', 'process_inspection', inputStates);
});
document.getElementById('editFinalInspection').addEventListener('click', function() {
toggleEditInput(this, '成品检验记录', 'final_inspection', inputStates);
toggleEditInput(this, 'Edit Final Inspection', 'final_inspection', inputStates);
});
// 页面加载后立即获取并渲染质检数据
@ -1553,19 +1563,19 @@ async function confirmAndSave(buttonElement, fieldKey, inputElement, inputStates
state.input.remove();
// 恢复按钮为编辑状态
buttonElement.textContent = '编辑';
buttonElement.textContent = 'Redact';
buttonElement.classList.remove('confirm-btn');
// 更新状态
state.visible = false;
} catch (error) {
console.error('保存失败:', error);
console.error('error:', error);
}
}
// 渲染质检数据到对应的输入框
function renderQualityData(responseData) {
console.log('正在渲染数据到以下元素:', {
console.log('loading data:', {
processRecordDisplay: document.getElementById('processRecordDisplay'),
processInspectionDisplay: document.getElementById('processInspectionDisplay'),
finalInspectionDisplay: document.getElementById('finalInspectionDisplay')
@ -1625,7 +1635,7 @@ function showEditInput(buttonElement, fieldName, fieldKey, inputStates) {
input.type = 'text';
input.className = 'edit-input';
input.value = currentValue;
input.placeholder = `Please enter ${fieldName}`;
// input.placeholder = `please enter ${fieldName}`;
// 保存输入框引用
state.input = input;
@ -1678,13 +1688,13 @@ async function saveQualityData(fieldKey, value) {
});
if (response.status === 200) {
console.log('质检记录保存成功:', response.data);
console.log('success:', response.data);
return response.data;
} else {
throw new Error(`HTTP error! status: ${response.status}`);
}
} catch (error) {
console.error('质检记录保存失败:', error);
console.error('error:', error);
throw error;
}
}
@ -1889,8 +1899,8 @@ function showConfirmDialog(message, onConfirm) {
// 设置序列号
document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series');
const instrument = getUrlParameter('instrument');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
}
// 获取URL中的well参数并更新h1标题

View File

@ -11,14 +11,17 @@
// 设置序列号
document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series');
const instrument = getUrlParameter('instrument');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
document.getElementById('seriesNum').textContent = seriesNum + ' ' + instrument;
}
});
// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', async function() {
setInterval(checkUser,5000);
const seriesNum = getUrlParameter('series');
const instrumentNum = getUrlParameter('instrument');
const wellName = getUrlParameter('well');
@ -26,7 +29,7 @@
const content = getUrlParameter('content');
console.log('wellName:', wellName);
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
document.getElementById('seriesNum').textContent = seriesNum + ' ' + instrumentNum;
// 调用查询接口
const toolData = await fetchToolData(wellName ,seriesNum , instrumentNum ,flag ,content);
if (toolData) {
@ -95,7 +98,7 @@ function renderInstrumentData(data) {
}
// 1. 更新仪器名称Series + Instrument
const instrumentName = `${data.series || ""} - ${data.instrument || ""}`;
const instrumentName = `${data.series || ""} ${data.instrument || ""}`;
document.getElementById("seriesNum").textContent = instrumentName;
// 2. 格式化出厂日期(去掉 "T00:00:00Z"
@ -119,6 +122,11 @@ function renderInstrumentData(data) {
// 6. 更新固件版本号
document.querySelector(".basic-info-table tbody tr:nth-child(3) td:nth-child(2)").textContent =
data.version || "";
const seriesNum = getUrlParameter('series') ;
const instrument =getUrlParameter('instrument');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum+" "+instrument;
}
}
//仪器施工汇总
function populateBasicInfo(data){
@ -553,7 +561,9 @@ function handleMaintenanceFileUpload(event, item) {
if (typeof upload_file_success === 'function') {
upload_file_success(data, file, [data]);
}
setTimeout(() => {
location.reload();
}, 500);
// 局部刷新文件列表
refreshFileList(item.id, file,data.realFileName);
})
@ -714,6 +724,9 @@ function handleFileUpload(event, item) {
.then(response => response.json())
.then(data => {
console.log('文件上传成功:', data);
setTimeout(() => {
location.reload();
}, 500);
refreshFileList(item.id, file, data.data.realFileName.replace('./upload/', ''));
})
.catch(error => {
@ -1288,7 +1301,9 @@ function handleMaintenanceFileUpload(event, item) {
upload_file_success(data, file, [data]);
}
console.log('上传成功file:', file);
setTimeout(() => {
location.reload();
}, 500);
// 局部刷新文件列表
refreshMaintenanceFileList(item.id,data.data.id, file,data.data.realFileName);
})
@ -1443,12 +1458,10 @@ function upload_file_error(error, file, fileList) {
.then(function (response) {
console.log('/deescloud/postLcm:', response.data);
// 检查返回结果
if (response.data.r === -1) {
alert('您处于离线状态,请重新登录');
} else {
closeModal();
// 重新加载维保数据
location.reload();
}
})
.catch(function (error) {
console.error('提交失败:', error);
@ -1463,8 +1476,9 @@ function upload_file_error(error, file, fileList) {
// 添加渲染部门信息的函数
function renderDeptInfo(data) {
if (!data || !data.dept) {
if (!data?.dept?.trim()) {
console.warn("无部门信息");
deptContainer.textContent = "暂无部门信息";
return;
}
const deptContainer = document.getElementById("deptContainer");
@ -1900,8 +1914,9 @@ function showConfirmDialog(message, onConfirm) {
// 设置序列号
document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series');
const instrument = getUrlParameter('instrument');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
document.getElementById('seriesNum').textContent = seriesNum + ' ' + instrument;
}
// 获取URL中的well参数并更新h1标题

View File

@ -95,17 +95,15 @@
>
<span style="font-weight: 500;">
<template v-if="item.flag === 0">
{{ item.series_num }} {{ item.instrument_id }} | Instrument Normal
&nbsp;&nbsp;{{ item.series_num }} {{ item.instrument_id }} | Normal
</template>
<template v-else>
{{ item.time }} | {{ item.series_num }} |
</template>
</span>
<template v-if="item.flag === 1">
<span style="margin-left: 6px;">
{{ item.err_level }} | {{ item.context }}
{{ item.time }} | {{ item.context }}
</span>
</template>
@ -132,36 +130,6 @@
</div>
</el-dialog>
// <el-dialog
// title="Instrument Status Information"
// :visible.sync="pdf_visible"
// :lock-scroll ="false"
// :append-to-body="true"
// width="60%">
// <div style="height: 450px;overflow: auto;">
// <div v-if="tool_warning_data.length>0">
// <div>Risk warning: </div>
// <div v-for="item in tool_warning_data">
// <div style="display: flex;padding-top: 10px;">
// <div style="width: 100%;">
// {{item.time}}
// &nbsp;{{item.err_level}}:
// &nbsp;{{item.context}}
// </div>
// </div>
// </div>
// </div>
// <div v-if="tool_warning_data.length==0">
// <div>No instrument information has been uploaded to this well.</div>
// </div>
// <el-divider></el-divider>
// </div>
// </el-dialog>
</div>
`,
data(){

View File

@ -31,8 +31,8 @@ var toolscomponent = {
</svg>
</div>
<el-button @click="show_pdf(scope.row)" type="text" size="medium">报告明细</el-button>
<el-button @click="export_pdf(scope.row)" type="text" size="medium">导出</el-button>
<el-button @click="export_mess_pdf(scope.row)" type="text" size="medium">导出(测试中)</el-button>
<!-- <el-button @click="export_pdf(scope.row)" type="text" size="medium">导出</el-button> -->
<el-button @click="export_mess_pdf(scope.row)" type="text" size="medium">导出</el-button>
</div>
</template>
</el-table-column>
@ -77,17 +77,13 @@ var toolscomponent = {
>
<span style="font-weight: 500;">
<template v-if="item.flag === 0">
{{ item.series_num }} - {{ item.instrument_id }} | 仪器正常
</template>
<template v-else>
{{ item.time }} | {{ item.series_num }} |
&nbsp;&nbsp;{{ item.series_num }} {{ item.instrument_id }} | 仪器正常
</template>
</span>
<template v-if="item.flag === 1">
<span style="margin-left: 6px;">
{{ item.err_level }} | {{ item.context }}
{{ item.time }} | {{ item.context }}
</span>
</template>

File diff suppressed because one or more lines are too long

View File

@ -375,6 +375,33 @@
.fixed-width-180 {
width: 180px;
}
.link-container {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.link-display, .link-input {
flex: 1;
min-width: 0; /* 允许输入框收缩 */
white-space: normal; /* 允许换行 */
word-wrap: break-word; /* 长单词换行 */
}
.edit-link-btn, .confirm-link-btn {
flex-shrink: 0; /* 防止按钮被压缩 */
margin-left: 5px;
}
/* 当输入框显示时,使用不同的布局 */
.link-input {
margin-right: 5px;
}
.confirm-link-btn {
margin-left: 0;
}
@media (max-width: 768px) {
.container {
padding: 20px;
@ -405,6 +432,7 @@
}
</style>
</head>
<script src="scripts/checkuser.js"></script>
<script src="./scripts/tool_detail-en.js"></script>
<script src="scripts/axiosmin.js"></script>
<script src="./scripts/polyfill.js"></script>
@ -423,24 +451,24 @@
Instrument Name: <span id="seriesNum"></span>
</div>
<div class="info-section">
<h2 class="info-label">Basic information</h2>
<h2 class="info-label">Basic Information</h2>
<div style="padding: 0 20px;">
<table class="basic-info-table">
<tbody>
<tr>
<th>Date of manufacture:</th>
<th>Date Of Manufacture:</th>
<td></td>
<th>Date of warehousing:</th>
<th>Date Of Warehousing:</th>
<td></td>
</tr>
<tr>
<td>Working hours:</td>
<td>Total Working Time:</td>
<td></td>
<td>This working hours:</td>
<td>Current Working Time:</td>
<td></td>
</tr>
<tr>
<td>Firmware version:</td>
<td>Firmware Version:</td>
<td colspan="3"></td>
</tr>
</tbody>
@ -479,19 +507,19 @@
</div>
</div>
<div class="info-section">
<h2 class="info-label">Summary of Instrument Construction</h2>
<h2 class="info-label">Summary Of Instrument Construction</h2>
<table class="info-table">
<thead>
<tr>
<th class="table-cell-wrap" style="width: 10;">Well name</th>
<th class="table-cell-wrap">Well work situation</th>
<th class="fixed-width-130 table-cell-wrap">well section</th>
<th class="table-cell-wrap">Max temp</th>
<th class="fixed-width-130 table-cell-wrap">Max pressure</th>
<th class="table-cell-wrap">Well Name</th>
<th class="table-cell-wrap">Well Work Situation</th>
<th class="fixed-width-130 table-cell-wrap">Well Section</th>
<th class="table-cell-wrap">Max Temp</th>
<th class="fixed-width-130 table-cell-wrap">Max Pressure</th>
<th class="fixed-width-80 table-cell-wrap">Status</th>
<th class="table-cell-wrap">Persion</th>
<th class="table-cell-wrap">Person</th>
<th class="table-cell-wrap">File</th>
<th class="fixed-width-260 table-cell-wrap">Url</th>
<th class="fixed-width-180 table-cell-wrap">Link</th>
</tr>
</thead>
<tbody id="wellDataBody">
@ -503,7 +531,7 @@
<div class="info-section">
<div style="display: flex; justify-content: space-between; align-items: center;">
<div style="flex: 1;"></div>
<h2 class="info-label" style="flex: 1; text-align: center;">Maintenance and repair situation</h2>
<h2 class="info-label" style="flex: 1; text-align: center;">Maintenance And Repair Situation</h2>
<div style="flex: 1; display: flex; justify-content: flex-end;">
<button id="bt_add" style="margin-left: 5px; padding: 8px 16px; background-color: #67c23a; border: 1px solid #67c23a; border-radius: 4px; color: white; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center;" onclick="addMaintenanceRecord()">
<i style="margin-right: 5px;">
@ -511,7 +539,7 @@
<path d="M512 128C304.3 128 128 304.3 128 512s176.3 384 384 384 384-176.3 384-384S719.7 128 512 128z m0 64c176.7 0 320 143.3 320 320s-143.3 320-320 320S192 688.7 192 512 335.3 192 512 192z m48 304h-96v96h-96v-96H320v-96h96v-96h96v96h96v96z"></path>
</svg>
</i>
add
Add
</button>
</div>
</div>
@ -521,29 +549,29 @@
<tr>
<th class="fixed-width-100 table-cell-wrap">Time</th>
<th class="fixed-width-40 table-cell-wrap">Level</th>
<th class="fixed-width-140 table-cell-wrap">Maintenance info</th>
<th class="fixed-width-90 table-cell-wrap">Maintenance person</th>
<th class="fixed-width-160 table-cell-wrap">Maintenance Info</th>
<th class="fixed-width-90 table-cell-wrap">Maintenance Person</th>
<th class="fixed-width-160 table-cell-wrap">File</th>
<th class="fixed-width-260 table-cell-wrap">Url</th>
<th class="fixed-width-260 table-cell-wrap">Link</th>
</tr>
</thead>
<tbody id="maintenanceDataBody">
<tr>
<td colspan="6" style="text-align: center;">No data</td>
<td colspan="6" style="text-align: center;">No Data</td>
</tr>
</tbody>
</table>
</div>
<div class="info-section">
<h2 class="info-label">Internal components</h2>
<h2 class="info-label">Internal Components</h2>
<div class="no-data">No Data</div>
</div>
<div class="info-section">
<h2 class="info-label">The department to which the instrument belongs</h2>
<h2 class="info-label">The Department To Which The Instrument Belongs</h2>
<div class="component-item">
<div class="component-name" id="deptContainer" style="width: auto; white-space: nowrap;">No Data</div>
@ -571,8 +599,9 @@
// 设置序列号
document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series');
const instrument = getUrlParameter('instrument');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
document.getElementById('seriesNum').textContent = seriesNum + '1'+ instrument;
}
});
</script>

View File

@ -4,418 +4,254 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>仪器信息汇总</title>
<script src="./scripts/polyfill.js"></script>
<script src="./scripts/vue.min.js"></script>
<script src="./scripts/vue-router.js"></script>
<script src="./scripts/elementindex.js"></script>
<link rel="stylesheet" href="./scripts/elementindex.css">
<script src="scripts/axiosmin.js"></script>
<script src="scripts/checkuser.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background: white;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: rgb(18,25,34);
margin: 0;
font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif, "宋体";
color: rgb(255,255,0);
}
.homeWrap {
padding: 20px;
}
.container {
width: 100%;
max-width: 1200px;
background: white;
padding: 40px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
header {
.page-header {
text-align: center;
margin-bottom: 40px;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
h1 {
font-size: 2.5rem;
font-weight: 600;
color: #222;
margin-bottom: 10px;
}
.subtitle {
font-size: 1.1rem;
color: #666;
}
.info-section {
margin-bottom: 30px;
padding: 20px;
border: 1px solid #e0e0e0;
border-radius: 5px;
}
.file-item a {
font-size: 14px;
text-decoration: none;
}
/* 基本信息无边框表格样式 */
.basic-info-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
margin-left: auto;
margin-right: auto;
}
.basic-info-table th,
.basic-info-table td {
padding: 15px 20px;
text-align: left;
font-size: 1.1rem;
font-weight: 500;
color: #333;
}
.basic-info-table th {
background-color: transparent;
}
/* 其他表格样式保持不变 */
.info-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
table-layout: fixed;
}
.info-table th,
.info-table td {
padding: 15px;
text-align: center;
border: 1px solid #e0e0e0;
}
.info-table th {
background-color: #f5f7fa;
font-weight: 400;
color: #333;
}
.info-table td {
font-size: 1.1rem;
font-weight: 500;
color: #222;
}
/* 固定宽度列样式 */
.fixed-width-260 {
width: 260px;
}
.fixed-width-160 {
width: 160px;
}
.fixed-width-180 {
width: 180px;
}
.fixed-width-100 {
width: 100px;
}
.fixed-width-80 {
width: 80px;
}
.fixed-width-40 {
width: 40px;
}
/* 表格内容换行样式 */
.table-cell-wrap {
word-wrap: break-word;
word-break: break-all;
white-space: normal;
}
.info-row {
display: flex;
margin-bottom: 25px;
flex-wrap: wrap;
}
.info-item {
width: 100%;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #3C8DBC;
}
.info-label {
font-size: 1.1rem;
font-weight: 500;
color: #333;
margin-bottom: 8px;
text-align: center;
}
.info-value {
font-size: 1.1rem;
color: #333;
padding: 8px 0;
text-align: center;
}
.stat-card {
border: 1px solid #e0e0e0;
border-radius: 4px;
padding: 15px;
margin-top: 10px;
text-align: center;
}
.stat-title {
font-size: 1rem;
color: #555;
.page-title {
font-size: 24px;
font-weight: bolder;
color: rgb(255,255,0);
margin-bottom: 10px;
}
.stat-value {
font-size: 1.8rem;
font-weight: 700;
.page-subtitle {
font-size: 16px;
color: rgb(255,255,200);
}
footer {
.instrument-info {
background-color: #fdf6ec;
color: #e6a23c;
padding: 12px 20px;
border-radius: 4px;
margin-bottom: 20px;
text-align: center;
padding: 20px 0;
color: #777;
font-size: 0.9rem;
border-top: 1px solid #eee;
margin-top: 40px;
font-size: 16px;
font-weight: 500;
}
/* 内部组件样式 */
.component-item {
.section-card {
margin-bottom: 20px;
border: 1px solid #3C8DBC;
border-radius: 4px;
background: rgba(30, 40, 50, 0.8);
}
.section-header {
background-color: #00a2e8;
padding: 12px 20px;
color: rgb(255,255,0);
font-size: 16px;
font-weight: 600;
border-bottom: 1px solid #3C8DBC;
}
.section-content {
padding: 15px;
}
/* 表格样式 - 与lcm.html完全一致 */
.el-table {
font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif, "宋体";
background-color: rgb(18,25,34);
}
.el-table th {
background-color: #00a2e8;
padding: 8px 0;
}
.el-table th>.cell {
color: rgb(255,255,0);
text-align: center;
font-weight: 600;
padding: 0;
}
.el-table td {
background-color: rgb(18,25,34);
border-right: 1px solid #EBEEF5;
padding: 4px 0;
}
.el-table td>.cell {
color: rgb(255,255,0);
text-align: center;
font-size: 13px;
padding: 3px 0;
}
.el-table .warning-row {
color: #ff0000;
}
/* 分页样式 */
.pagination-container {
margin-top: 15px;
background-color: #ECF5FF;
padding: 10px;
border-radius: 4px;
}
/* 按钮样式 */
.action-buttons {
display: flex;
gap: 10px;
margin-bottom: 15px;
padding: 12px 0;
border-bottom: 1px solid #f0f0f0;
}
.component-item:last-child {
border-bottom: none;
}
.component-name {
width: 150px;
font-weight: 400;
color: #444;
padding-right: 10px;
}
.component-detail {
flex: 1;
color: #666;
flex-wrap: wrap;
}
.quality-item {
margin-bottom: 15px;
padding: 10px 0;
border-bottom: 1px solid #f0f0f0;
padding: 12px;
border: 1px solid #3C8DBC;
border-radius: 4px;
background: rgba(40, 50, 60, 0.6);
}
.quality-header {
display: flex;
align-items: center;
width: 100%;
gap: 15px;
}
.quality-title {
font-size: 1.1rem;
color: #333;
color: rgb(255,255,200);
font-weight: 500;
width: auto;
padding-right: 10px;
margin-left: 40px;
flex-shrink: 0;
min-width: 150px;
}
.quality-display {
flex: 1;
color: rgb(255,255,0);
padding: 6px 12px;
min-height: 20px;
margin-right: 10px;
}
.edit-btn {
padding: 6px 12px;
background-color: #409eff;
border: 1px solid #409eff;
border-radius: 4px;
color: white;
font-size: 14px;
cursor: pointer;
flex-shrink: 0;
}
.edit-input {
flex: 1;
padding: 6px 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
margin-right: 10px;
min-width: 200px;
}
.confirm-btn {
background-color: #67c23a;
border-color: #67c23a;
}
/* 文件列表样式 */
.file-list {
margin-top: 10px;
text-align: left;
}
.file-item {
background: rgba(30, 40, 50, 0.8);
border-radius: 3px;
min-height: 32px;
display: flex;
align-items: center;
padding: 5px 0;
}
.file-item a {
color: #409eff;
text-decoration: none;
margin-left: 5px;
.no-data {
text-align: center;
color: rgb(255,255,200);
padding: 30px;
font-style: italic;
}
.file-item a:hover {
text-decoration: underline;
}
.file-icon {
color: #409eff;
margin-right: 5px;
}
/* 文件列表样式 */
.file-list {
margin-top: 10px;
text-align: left;
}
.file-item {
display: flex;
align-items: center;
padding: 5px 0;
}
.file-item a {
color: #409eff;
text-decoration: none;
margin-left: 5px;
}
.file-item a:hover {
text-decoration: underline;
}
.file-icon {
color: #409eff;
margin-right: 5px;
}
/* 文件列样式 */
.file-column {
text-align: left;
}
.upload-button {
background-color: #409eff;
border: 1px solid #409eff;
border-radius: 4px;
color: white;
padding: 6px 12px;
font-size: 14px;
cursor: pointer;
transition: all 0.3s;
}
.upload-button:hover {
background-color: #66b1ff;
border-color: #66b1ff;
}
.upload-button:disabled {
background-color: #a0cfff;
border-color: #a0cfff;
cursor: not-allowed;
}
.fixed-width-40 {
width: 50px;
}
.fixed-width-80 {
width: 80px;
}
.fixed-width-180 {
width: 180px;
}
@media (max-width: 768px) {
.container {
padding: 20px;
}
h1 {
font-size: 2rem;
}
.info-table th,
.info-table td {
padding: 10px 5px;
font-size: 0.9rem;
}
.info-table td {
font-size: 1rem;
.component-list {
display: grid;
gap: 10px;
}
.component-item {
flex-direction: column;
display: flex;
padding: 10px 15px;
border: 1px solid #3C8DBC;
border-radius: 4px;
background: rgba(40, 50, 60, 0.6);
}
.component-name {
width: 100%;
color: rgb(255,255,200);
font-weight: 500;
min-width: 120px;
}
.component-detail {
color: rgb(255,255,0);
flex: 1;
}
.file-item {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.file-item a {
color: #66b1ff;
text-decoration: none;
margin-left: 5px;
}
.file-item a:hover {
text-decoration: underline;
}
@media (max-width: 768px) {
.homeWrap {
padding: 10px;
}
.quality-header {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
.quality-title {
min-width: auto;
}
.action-buttons {
flex-direction: column;
}
}
</style>
</head>
<script src="./scripts/tool_detail.js"></script>
<script src="scripts/axiosmin.js"></script>
<script src="./scripts/polyfill.js"></script>
<script src="./scripts/vue.min.js"></script>
<script src="./scripts/vue-router.js"></script>
<body>
<div class="container">
<header>
<h1></h1>
</header>
<div id="app" class="homeWrap">
<!-- 页面头部 -->
<div class="page-header">
<div class="page-title">DEES 测井作业管理云系统 V1.0.1</div>
<div class="page-subtitle">仪器信息汇总</div>
</div>
<div class="content">
<div style="text-align: left; margin-bottom: 20px; font-size: 1.2rem; font-weight: 400;">
<!-- 仪器基本信息 -->
<div class="instrument-info">
仪器名称: <span id="seriesNum"></span>
</div>
<div class="info-section">
<h2 class="info-label">基本信息</h2>
<div style="padding: 0 20px;">
<el-container style="gap: 20px;">
<!-- 左侧区域 -->
<el-aside style="width: 45%;">
<!-- 基本信息 -->
<div class="section-card">
<div class="section-header">基本信息</div>
<div class="section-content">
<div style="padding: 0 15px;">
<table class="basic-info-table">
<tbody>
<tr>
@ -438,8 +274,12 @@
</table>
</div>
</div>
<div class="info-section">
<h2 class="info-label">产品质检记录</h2>
</div>
<!-- 产品质检记录 -->
<div class="section-card">
<div class="section-header">产品质检记录</div>
<div class="section-content">
<div style="padding: 15px 0;">
<!-- 生产过程记录 -->
<div class="quality-item">
@ -469,104 +309,246 @@
</div>
</div>
</div>
<div class="info-section">
<h2 class="info-label">仪器施工汇总</h2>
<table class="info-table">
<thead>
<tr>
<th class="fixed-width-80 table-cell-wrap">井名</th>
<th class="fixed-width-100 table-cell-wrap">入井工作情况</th>
<th class="fixed-width-100 table-cell-wrap">施工井段</th>
<th class="fixed-width-80 table-cell-wrap">最高工作温度</th>
<th class="fixed-width-80 table-cell-wrap">最高承压</th>
<th class="fixed-width-80 table-cell-wrap">仪器工作情况</th>
<th class="fixed-width-100 table-cell-wrap">上井人</th>
<th class="fixed-width-160 table-cell-wrap">文件</th>
<th class="fixed-width-260 table-cell-wrap">链接</th>
</tr>
</thead>
<tbody id="wellDataBody">
</tbody>
</table>
</div>
<div class="info-section">
<div style="display: flex; justify-content: space-between; align-items: center;">
<div style="flex: 1;"></div>
<h2 class="info-label" style="flex: 1; text-align: center;">维保情况</h2>
<div style="flex: 1; display: flex; justify-content: flex-end;">
<button id="bt_add" style="margin-left: 5px; padding: 8px 16px; background-color: #67c23a; border: 1px solid #67c23a; border-radius: 4px; color: white; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center;" onclick="addMaintenanceRecord()">
<i style="margin-right: 5px;">
<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor">
<path d="M512 128C304.3 128 128 304.3 128 512s176.3 384 384 384 384-176.3 384-384S719.7 128 512 128z m0 64c176.7 0 320 143.3 320 320s-143.3 320-320 320S192 688.7 192 512 335.3 192 512 192z m48 304h-96v96h-96v-96H320v-96h96v-96h96v96h96v96z"></path>
</svg>
</i>
新增维保记录
</button>
</div>
</div>
<table class="info-table">
<thead>
<tr>
<th class="fixed-width-100 table-cell-wrap">时间</th>
<th class="fixed-width-40 table-cell-wrap">等级</th>
<th class="fixed-width-180 table-cell-wrap">维保信息</th>
<th class="fixed-width-80 table-cell-wrap">维保人</th>
<th class="fixed-width-160 table-cell-wrap">文件</th>
<th class="fixed-width-260 table-cell-wrap">链接</th>
</tr>
</thead>
<tbody id="maintenanceDataBody">
<tr>
<td colspan="6" style="text-align: center;">暂无数据</td>
</tr>
</tbody>
</table>
</div>
<div class="info-section">
<h2 class="info-label">内部组件</h2>
<!-- 内部组件 -->
<div class="section-card">
<div class="section-header">内部组件</div>
<div class="section-content">
<div class="no-data">暂无数据</div>
</div>
</div>
<div class="info-section">
<h2 class="info-label">仪器所属部门</h2>
<!-- 仪器所属部门 -->
<div class="section-card">
<div class="section-header">仪器所属部门</div>
<div class="section-content">
<div class="component-item">
<div class="component-name" id="deptContainer" style="width: auto; white-space: nowrap;">暂无部门信息</div>
</div>
</div>
</div>
</el-aside>
<footer>
<p>版权所有 © 北京六合伟业科技股份有限公司</p>
</footer>
<!-- 右侧区域 -->
<el-main style="width: 55%; padding: 0; margin: 0;">
<!-- 仪器施工汇总 -->
<div class="section-card">
<div class="section-header" style="display: flex; justify-content: space-between; align-items: center;">
<span>仪器施工汇总</span>
</div>
<div class="section-content">
<el-table
style="background-color: #121922;"
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#121922'}"
border>
<el-table-column
prop="wellname"
label="井名"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="workStatus"
label="入井工作情况"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="workSection"
label="施工井段"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="maxTemp"
label="最高工作温度"
width="80">
</el-table-column>
<el-table-column
prop="maxPressure"
label="最高承压"
width="80">
</el-table-column>
<el-table-column
prop="instrumentStatus"
label="仪器工作情况"
width="80">
</el-table-column>
<el-table-column
prop="worker"
label="上井人"
width="100">
</el-table-column>
<el-table-column
prop="files"
label="文件"
width="160"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="links"
label="链接"
width="260"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal"
style="background-color: #ECF5FF;">
</el-pagination>
</div>
</div>
</div>
<!-- 维保情况 -->
<div class="section-card">
<div class="section-header" style="display: flex; justify-content: space-between; align-items: center;">
<span>维保情况</span>
<el-button id="bt_add" style="margin-left: 5px;" plain type="primary" icon="el-icon-circle-plus-outline" @click="addMaintenanceRecord()">新增维保记录</el-button>
</div>
<div class="section-content">
<el-table
style="background-color: #121922;"
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#121922'}"
border>
<el-table-column
prop="time"
label="时间"
width="100">
</el-table-column>
<el-table-column
prop="level"
label="等级"
width="40">
</el-table-column>
<el-table-column
prop="info"
label="维保信息"
width="180"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="maintainer"
label="维保人"
width="80">
</el-table-column>
<el-table-column
prop="files"
label="文件"
width="160"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="links"
label="链接"
width="260"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal"
style="background-color: #ECF5FF;">
</el-pagination>
</div>
</div>
</div>
</el-main>
</el-container>
<!-- 底部版权 -->
<div style="text-align: center; padding: 20px 0; color: rgb(255,255,200); font-size: 12px; border-top: 1px solid #3C8DBC; margin-top: 20px;">
<span>版权所有 © 北京六合伟业科技股份有限公司</span>
</div>
</div>
<script>
new Vue({
el: '#app',
data() {
return {
// 仅保留必要的空数据结构
tableData: [],
currentPage: 1,
pagesize: 50,
recordTotal: 0,
tHeight: 400
}
},
mounted() {
// 仅保留原有的设置仪器名称的逻辑
const seriesNum = this.getUrlParameter('series');
const instrument = this.getUrlParameter('instrument');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum + '-' + instrument;
}
// 设置表格高度
this.calculateTableHeight();
window.addEventListener('resize', this.calculateTableHeight);
},
beforeDestroy() {
window.removeEventListener('resize', this.calculateTableHeight);
},
methods: {
// 获取URL参数
function getUrlParameter(name) {
getUrlParameter(name) {
name = name.replace(/[\[\]]/g, '\\$&');
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
const results = regex.exec(window.location.href);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
},
// 设置序列号
document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series');
if (seriesNum) {
document.getElementById('seriesNum').textContent = seriesNum;
// 计算表格高度
calculateTableHeight() {
const windowHeight = window.innerHeight;
this.tHeight = windowHeight - 400;
},
// 分页处理 - 空方法由外部JS文件实现
handleSizeChange(val) {
// 由外部JS文件实现
},
handleCurrentChange(val) {
// 由外部JS文件实现
},
// 新增维保记录 - 空方法由外部JS文件实现
addMaintenanceRecord() {
// 由外部JS文件实现
}
}
});
</script>
<!-- 原有的脚本引入 -->
<script src="./scripts/tool_detail.js"></script>
</body>
</html>