最新代码

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();
@ -1453,8 +1462,9 @@ 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("无部门信息");
deptContainer.textContent = "No data";
return; return;
} }
const deptContainer = document.getElementById("deptContainer"); const deptContainer = document.getElementById("deptContainer");
@ -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

@ -11,14 +11,17 @@
// 设置序列号 // 设置序列号
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) {
alert('您处于离线状态,请重新登录');
} else {
closeModal(); closeModal();
// 重新加载维保数据
location.reload(); location.reload();
}
}) })
.catch(function (error) { .catch(function (error) {
console.error('提交失败:', error); console.error('提交失败:', error);
@ -1463,8 +1476,9 @@ 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("无部门信息");
deptContainer.textContent = "暂无部门信息";
return; return;
} }
const deptContainer = document.getElementById("deptContainer"); const deptContainer = document.getElementById("deptContainer");
@ -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,8 +599,9 @@
// 设置序列号 // 设置序列号
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 + '1'+ instrument;
} }
}); });
</script> </script>

View File

@ -4,418 +4,254 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>仪器信息汇总</title> <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> <style>
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box; box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
} }
body { body {
background: white; background-color: rgb(18,25,34);
min-height: 100vh; margin: 0;
display: flex; font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif, "宋体";
justify-content: center; color: rgb(255,255,0);
align-items: center; }
.homeWrap {
padding: 20px; padding: 20px;
} }
.container { .page-header {
width: 100%;
max-width: 1200px;
background: white;
padding: 40px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
header {
text-align: center; 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; margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #3C8DBC;
} }
.info-label { .page-title {
font-size: 1.1rem; font-size: 24px;
font-weight: 500; font-weight: bolder;
color: #333; color: rgb(255,255,0);
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;
margin-bottom: 10px; margin-bottom: 10px;
} }
.stat-value { .page-subtitle {
font-size: 1.8rem; font-size: 16px;
font-weight: 700; 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; text-align: center;
padding: 20px 0; font-size: 16px;
color: #777; font-weight: 500;
font-size: 0.9rem;
border-top: 1px solid #eee;
margin-top: 40px;
} }
/* 内部组件样式 */ .section-card {
.component-item { 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; display: flex;
gap: 10px;
margin-bottom: 15px; margin-bottom: 15px;
padding: 12px 0; flex-wrap: wrap;
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;
} }
.quality-item { .quality-item {
margin-bottom: 15px; margin-bottom: 15px;
padding: 10px 0; padding: 12px;
border-bottom: 1px solid #f0f0f0; border: 1px solid #3C8DBC;
border-radius: 4px;
background: rgba(40, 50, 60, 0.6);
} }
.quality-header { .quality-header {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; gap: 15px;
} }
.quality-title { .quality-title {
font-size: 1.1rem; color: rgb(255,255,200);
color: #333;
font-weight: 500; font-weight: 500;
width: auto; min-width: 150px;
padding-right: 10px;
margin-left: 40px;
flex-shrink: 0;
} }
.quality-display { .quality-display {
flex: 1; flex: 1;
color: rgb(255,255,0);
padding: 6px 12px; padding: 6px 12px;
min-height: 20px; background: rgba(30, 40, 50, 0.8);
margin-right: 10px; border-radius: 3px;
} min-height: 32px;
.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 {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 5px 0;
} }
.file-item a { .no-data {
color: #409eff; text-align: center;
text-decoration: none; color: rgb(255,255,200);
margin-left: 5px; padding: 30px;
font-style: italic;
} }
.file-item a:hover { .component-list {
text-decoration: underline; display: grid;
} gap: 10px;
.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-item { .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 { .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; 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> </style>
</head> </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> <body>
<div class="container"> <div id="app" class="homeWrap">
<header> <!-- 页面头部 -->
<h1></h1> <div class="page-header">
</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> 仪器名称: <span id="seriesNum"></span>
</div> </div>
<div class="info-section">
<h2 class="info-label">基本信息</h2> <el-container style="gap: 20px;">
<div style="padding: 0 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"> <table class="basic-info-table">
<tbody> <tbody>
<tr> <tr>
@ -438,8 +274,12 @@
</table> </table>
</div> </div>
</div> </div>
<div class="info-section"> </div>
<h2 class="info-label">产品质检记录</h2>
<!-- 产品质检记录 -->
<div class="section-card">
<div class="section-header">产品质检记录</div>
<div class="section-content">
<div style="padding: 15px 0;"> <div style="padding: 15px 0;">
<!-- 生产过程记录 --> <!-- 生产过程记录 -->
<div class="quality-item"> <div class="quality-item">
@ -469,104 +309,246 @@
</div> </div>
</div> </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>
<div class="info-section"> <!-- 内部组件 -->
<div style="display: flex; justify-content: space-between; align-items: center;"> <div class="section-card">
<div style="flex: 1;"></div> <div class="section-header">内部组件</div>
<h2 class="info-label" style="flex: 1; text-align: center;">维保情况</h2> <div class="section-content">
<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="no-data">暂无数据</div> <div class="no-data">暂无数据</div>
</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-item">
<div class="component-name" id="deptContainer" style="width: auto; white-space: nowrap;">暂无部门信息</div> <div class="component-name" id="deptContainer" style="width: auto; white-space: nowrap;">暂无部门信息</div>
</div> </div>
</div> </div>
</div> </div>
</el-aside>
<footer> <!-- 右侧区域 -->
<p>版权所有 © 北京六合伟业科技股份有限公司</p> <el-main style="width: 55%; padding: 0; margin: 0;">
</footer> <!-- 仪器施工汇总 -->
<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>
<!-- 维保情况 -->
<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> <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参数 // 获取URL参数
function getUrlParameter(name) { getUrlParameter(name) {
name = name.replace(/[\[\]]/g, '\\$&'); name = name.replace(/[\[\]]/g, '\\$&');
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
const results = regex.exec(window.location.href); const results = regex.exec(window.location.href);
if (!results) return null; if (!results) return null;
if (!results[2]) return ''; if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' ')); return decodeURIComponent(results[2].replace(/\+/g, ' '));
} },
// 设置序列号 // 计算表格高度
document.addEventListener('DOMContentLoaded', function() { calculateTableHeight() {
const seriesNum = getUrlParameter('series'); const windowHeight = window.innerHeight;
if (seriesNum) { this.tHeight = windowHeight - 400;
document.getElementById('seriesNum').textContent = seriesNum; },
// 分页处理 - 空方法由外部JS文件实现
handleSizeChange(val) {
// 由外部JS文件实现
},
handleCurrentChange(val) {
// 由外部JS文件实现
},
// 新增维保记录 - 空方法由外部JS文件实现
addMaintenanceRecord() {
// 由外部JS文件实现
}
} }
}); });
</script> </script>
<!-- 原有的脚本引入 -->
<script src="./scripts/tool_detail.js"></script>
</body> </body>
</html> </html>