最新代码

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

View File

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

View File

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

View File

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

View File

@ -95,17 +95,15 @@
> >
<span style="font-weight: 500;"> <span style="font-weight: 500;">
<template v-if="item.flag === 0"> <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>
<template v-else>
{{ item.time }} | {{ item.series_num }} |
</template>
</span> </span>
<template v-if="item.flag === 1"> <template v-if="item.flag === 1">
<span style="margin-left: 6px;"> <span style="margin-left: 6px;">
{{ item.err_level }} | {{ item.context }} {{ item.time }} | {{ item.context }}
</span> </span>
</template> </template>
@ -132,36 +130,6 @@
</div> </div>
</el-dialog> </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> </div>
`, `,
data(){ data(){

View File

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

File diff suppressed because one or more lines are too long

View File

@ -375,6 +375,33 @@
.fixed-width-180 { .fixed-width-180 {
width: 180px; 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) { @media (max-width: 768px) {
.container { .container {
padding: 20px; padding: 20px;
@ -405,6 +432,7 @@
} }
</style> </style>
</head> </head>
<script src="scripts/checkuser.js"></script>
<script src="./scripts/tool_detail-en.js"></script> <script src="./scripts/tool_detail-en.js"></script>
<script src="scripts/axiosmin.js"></script> <script src="scripts/axiosmin.js"></script>
<script src="./scripts/polyfill.js"></script> <script src="./scripts/polyfill.js"></script>
@ -423,24 +451,24 @@
Instrument Name: <span id="seriesNum"></span> Instrument Name: <span id="seriesNum"></span>
</div> </div>
<div class="info-section"> <div class="info-section">
<h2 class="info-label">Basic information</h2> <h2 class="info-label">Basic Information</h2>
<div style="padding: 0 20px;"> <div style="padding: 0 20px;">
<table class="basic-info-table"> <table class="basic-info-table">
<tbody> <tbody>
<tr> <tr>
<th>Date of manufacture:</th> <th>Date Of Manufacture:</th>
<td></td> <td></td>
<th>Date of warehousing:</th> <th>Date Of Warehousing:</th>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Working hours:</td> <td>Total Working Time:</td>
<td></td> <td></td>
<td>This working hours:</td> <td>Current Working Time:</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Firmware version:</td> <td>Firmware Version:</td>
<td colspan="3"></td> <td colspan="3"></td>
</tr> </tr>
</tbody> </tbody>
@ -479,19 +507,19 @@
</div> </div>
</div> </div>
<div class="info-section"> <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"> <table class="info-table">
<thead> <thead>
<tr> <tr>
<th class="table-cell-wrap" style="width: 10;">Well name</th> <th class="table-cell-wrap">Well Name</th>
<th class="table-cell-wrap">Well work situation</th> <th class="table-cell-wrap">Well Work Situation</th>
<th class="fixed-width-130 table-cell-wrap">well section</th> <th class="fixed-width-130 table-cell-wrap">Well Section</th>
<th class="table-cell-wrap">Max temp</th> <th class="table-cell-wrap">Max Temp</th>
<th class="fixed-width-130 table-cell-wrap">Max pressure</th> <th class="fixed-width-130 table-cell-wrap">Max Pressure</th>
<th class="fixed-width-80 table-cell-wrap">Status</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="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> </tr>
</thead> </thead>
<tbody id="wellDataBody"> <tbody id="wellDataBody">
@ -503,7 +531,7 @@
<div class="info-section"> <div class="info-section">
<div style="display: flex; justify-content: space-between; align-items: center;"> <div style="display: flex; justify-content: space-between; align-items: center;">
<div style="flex: 1;"></div> <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;"> <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()"> <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;"> <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> <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> </svg>
</i> </i>
add Add
</button> </button>
</div> </div>
</div> </div>
@ -521,29 +549,29 @@
<tr> <tr>
<th class="fixed-width-100 table-cell-wrap">Time</th> <th class="fixed-width-100 table-cell-wrap">Time</th>
<th class="fixed-width-40 table-cell-wrap">Level</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-160 table-cell-wrap">Maintenance Info</th>
<th class="fixed-width-90 table-cell-wrap">Maintenance person</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-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> </tr>
</thead> </thead>
<tbody id="maintenanceDataBody"> <tbody id="maintenanceDataBody">
<tr> <tr>
<td colspan="6" style="text-align: center;">No data</td> <td colspan="6" style="text-align: center;">No Data</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="info-section"> <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 class="no-data">No Data</div>
</div> </div>
<div class="info-section"> <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-item">
<div class="component-name" id="deptContainer" style="width: auto; white-space: nowrap;">No Data</div> <div class="component-name" id="deptContainer" style="width: auto; white-space: nowrap;">No Data</div>
@ -571,9 +599,10 @@
// 设置序列号 // 设置序列号
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const seriesNum = getUrlParameter('series'); const seriesNum = getUrlParameter('series');
if (seriesNum) { const instrument = getUrlParameter('instrument');
document.getElementById('seriesNum').textContent = seriesNum; if (seriesNum) {
} document.getElementById('seriesNum').textContent = seriesNum + '1'+ instrument;
}
}); });
</script> </script>

File diff suppressed because it is too large Load Diff