<center>计算星期几</center>

本文介绍了一个简单的HTML表单设计,用于用户输入日期并验证其有效性。通过限制输入范围,确保了日、月、年的数值在合理的范围内。此外,还提供了一个计算按钮,虽然未详细说明其具体功能,但可以推测其作用是计算所输入日期对应的星期。
		<FORM NAME = "calDay">
		<PRE><B>日:</B>   
		<INPUT TYPE="num" name="day" onChange="if (!checkNum(this.value, 1, 31)){this.focus();this.select();} else {}" size=10 value="">        
		<B>月:</B> 
		<INPUT TYPE="num" name="month" onChange="if (!checkNum(this.value, 1, 12)){this.focus();this.select();} else {}" size=10 value="">
		<B>年:</B>  
		<INPUT TYPE="num" name="year" onChange="if (!checkNum(this.value, 0, 2500)){this.focus();this.select();} else {}" size=10 value="">        
		<INPUT TYPE="button" name="Find_Out" value="计算星期几" onclick="pushbutton(this.form)"></PRE>
		</FORM>


</body>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Vue数据插值</title> </head> <body> <div id="app"> <h2>{{name}} 非常酷!</h2> </div> <script src="jslib/vue.global.js"></script> <script> const { createApp, ref, reactive, computed } = Vue const vm=createApp({ setup() { const name = ref('Vue 3 多种选项属性转换') const mark1 =ref(98) const messageArray = ref(['a','b','c']) const items = ref([{ message: '数组值1' }, { message: '数组值2' }]) const datacomplex = reactive({keyname:'复合数据'}) const datacomputedb = ref(name.value + '计算选项转换') const author = reactive({ name: 'John Doe', books: [ 'Vue 2 - Advanced Guide', 'Vue 3 - Basic Guide', 'Vue 4 - The Mystery' ] }) const usereactive = computed(() => { return author.books.length > 0 ? 'Yes' : 'No' }) } }); vm.mount(‘#app’) </script> </body> </html> 修改以下网页,输出最后表格一行的问答成绩(data属性)、实验成绩(data属性)和平均成绩(属性计算的结果)。 <html> <HEAD><TITLE>表格标记应用</TITLE></HEAD> <BODY> <TABLE border ID="Table1"> <CAPTION> 课表及课内成绩</CAPTION> <TR> <TH> 节次</TH><TH>星期一</TH><TH>星期二</TH> <TH> 星期三</TH><TH>星期四</TH><TH>星期五</TH> </TR> <TR> <TD>1、2</TD> <TD>专业英语</TD> <TD>操作系统</TD> <TD>网络基础</TD> <TD>专业英语</TD> <TD>数据库</TD> </TR> <TR> <TD>3、4</TD> <TD>Java</TD> <TD>数据库</TD> <TD>实验</TD> <TD>Java</TD> <TD>操作系统</TD> </TR> <TR> <TD>5、6</TD> <TD>网络基础</TD> <TD>实验</TD> <TD>实验</TD> <TD>实验</TD> <TD>操作系统</TD> </TR> <TR> <TD>成绩</TD> <TD>XX</TD> <TD>XX</TD> <TD>XX</TD> <TD>XX</TD> <TD>平均成绩YY</TD> </TR> <TR> <TD>权值</TD> <TD>XX</TD> <TD>XX</TD> <TD>XX</TD> <TD>XX</TD> <TD>加权平均成绩YY</TD> </TR> </TABLE> </BODY> </html>
05-26
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>生产计划排程表</title> <style> /* ======= 天空浅蓝主题 ======= */ :root{ --bg:#f5faff; --panel:#fff; --border:#cce7ff; --primary:#3ca9ff; --primary-dark:#0077e6; --primary-light:#e6f4ff; --text:#003366; --text-light:#0077e6; --shadow:rgba(60,169,255,.12); } body{margin:0;background:var(--bg);font-family:"Segoe UI",Arial,"PingFang SC","Microsoft YaHei",sans-serif} .status-container{max-width:98%;margin:22px auto;background:var(--panel);border:1px solid var(--border);padding:22px 18px 30px 18px;border-radius:12px;box-shadow:0 6px 30px var(--shadow);position:relative} .status-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;background:var(--bg)} .status-header h3{color:var(--text-light);letter-spacing:2px} .status-header .btns{display:flex;gap:12px} .btn{padding:7px 18px;border:none;border-radius:4px;font-size:15px;cursor:pointer;background:var(--primary);color:#fff;transition:background .2s} .btn:hover{background:var(--primary-dark)} .btn.modify{background:var(--primary-light);color:var(--text)} .btn.modify:hover{background:var(--primary-dark);color:#fff} .search-box{display:flex;align-items:center;gap:8px} .search-box input{height:32px;border:1px solid var(--primary);border-radius:4px;padding:0 10px;font-size:14px;background:#fff;color:var(--text)} table{width:100%;border-collapse:collapse;font-size:14px;color:var(--text)} thead{background-color:var(--primary-light);color:var(--text)} th,td{border:1px solid var(--border);padding:9px 7px;text-align:center} th{background:var(--primary-light);color:var(--text)} .tag{border-radius:10px;padding:2px 10px;font-size:13px;display:inline-block} .tag-success{color:#21b97a}.tag-danger{color:#f56c6c} /* 弹窗共用 */ .modal-mask{position:fixed;inset:0;background:rgba(0,119,230,.2);z-index:999;display:none} .modal{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:#fff;color:var(--text);border-radius:8px;padding:22px;min-width:360px;z-index:1000;display:none} .modal-title{font-weight:bold;font-size:1.18rem;color:var(--primary-dark);margin-bottom:19px} .modal-form-row{display:flex;align-items:center;margin-bottom:13px} .modal-form-row label{width:86px;color:var(--text-light);font-size:14px} .modal-form-row input,.modal-form-row select{flex:1;height:28px;padding:0 7px;border:1px solid var(--primary);border-radius:4px;background:var(--bg);color:var(--text)} .modal-btns{text-align:right;margin-top:18px} .modal-btns .btn{margin-left:12px;background:var(--primary);color:#fff} /* 详情弹窗专属 */ .detail-modal{min-width:800px;max-width:95vw;max-height:90vh;overflow:auto} .detail-modal table th,.detail-modal table td{color:var(--text);border:1px solid var(--border);padding:6px 4px;min-width:90px;background:#fff} .detail-modal input[type=number]{width:100%;border:1px solid var(--border);border-radius:3px;padding:4px;background:#fff;color:var(--text)} .detail-btns{margin-top:15px;text-align:right} /* 分页 */ .pager-box{display:flex;align-items:center;gap:8px;position:absolute;right:22px;bottom:-80px;background:var(--primary-light);padding:6px 10px;border-radius:6px;box-shadow:0 2px 8px var(--shadow);font-size:14px;color:var(--text-light)} .pager-label input{width:46px;height:24px;text-align:center;border:1px solid var(--primary);border-radius:4px;margin:0 4px;background:#fff;color:var(--text-light)} </style> </head> <body> <div class="status-container"> <div class="status-header"> <h3>生产计划排程表</h3> <div class="btns"> <div class="search-box"> <input type="text" id="searchInput" placeholder="工序、负责人、产品名称...关键词查询"> <button class="btn" onclick="searchPlans()">查询</button> </div> <button class="btn" onclick="openAddModal()">增加</button> </div> </div> <table> <thead> <tr> <th>序号</th><th>工序</th><th>接单日期</th><th>负责人</th><th>订单跟踪号</th><th>产品代码</th> <th>产品名称</th><th>订单量</th><th>GTM出货日期</th><th>工厂入库日期</th><th>是否延误</th> <th>累计交付</th><th>待交付</th><th>结单情况</th><th>排程日期</th><th>备注</th><th>操作</th> </tr> </thead> <tbody id="planTableBody"><tr><td colspan="17">加载中...</td></tbody> </table> <div id="pagerBox" class="pager-box"> <button class="btn" id="btnPrev" onclick="prevPage()">上一页</button> <label class="pager-label"> 第<input type="number" id="pageInput" min="1" max="1" value="1" onkeydown="if(event.key==='Enter') jumpToPage()">页 / 共<span id="totalPages">1</span>页 </label> <button class="btn" id="btnNext" onclick="nextPage()">下一页</button> <button class="btn modify" onclick="jumpToPage()">跳转</button> </div> </div> <!-- 原有增删改弹窗 --> <div class="modal-mask" id="modalMask"></div> <div class="modal" id="modalBox"> <div class="modal-title" id="modalTitle">新增排程</div> <form id="modalForm"> <div class="modal-form-row"><label>工序</label><input type="text" name="processName" required></div> <div class="modal-form-row"><label>接单日期</label><input type="date" name="startDate"></div> <div class="modal-form-row"><label>负责人</label><input type="text" name="leader" required></div> <div class="modal-form-row"><label>订单跟踪号</label><input type="text" name="orderTrackingNo" required></div> <div class="modal-form-row"><label>产品代码</label><input type="text" name="productCode" required></div> <div class="modal-form-row"><label>产品名称</label><input type="text" name="productName" required></div> <div class="modal-form-row"><label>订单量</label><input type="number" name="orderQuantity" required></div> <div class="modal-form-row"><label>GTM出货日期</label><input type="date" name="shipmentDate"></div> <div class="modal-form-row"><label>工厂入库日期</label><input type="date" name="finishDate"></div> <div class="modal-form-row"><label>是否延误</label> <select name="isDelayed"><option value="1">是</option><option value="0">否</option></select></div> <div class="modal-form-row"><label>累计交付</label><input type="number" name="deliveredQty"></div> <div class="modal-form-row"><label>待交付</label><input type="number" name="pendingQty"></div> <div class="modal-form-row"><label>结单情况</label><input type="text" name="receiveStatus"></div> <div class="modal-form-row"><label>排程日期</label><input type="date" name="scheduleDate"></div> <div class="modal-form-row"><label>备注</label><input type="text" name="remark"></div> <div class="modal-btns"> <button type="button" class="btn" onclick="closeModal()">取消</button> <button type="submit" class="btn modify" id="modalSubmitBtn">保存</button> </div> </form> </div> <!-- ===== 新增:详情弹窗 ===== --> <div class="modal-mask" id="detailMask" style="display:none"></div> <div class="modal detail-modal" id="detailWrap" style="display:none"> <div class="modal-title">排程详情</div> <p>订单跟踪号:<span id="detailOrderNo"></span>    产品名称:<span id="detailProductName"></span></p> <div style="overflow-x:auto"> <table id="detailTable"> <thead><tr id="detailHeadRow"></tr></thead> <tbody> <tr id="plannedRow"><td><b>计划交付</b></td></tr> <tr id="actualRow"><td><b>实际交付</b></td></tr> </tbody> </table> </div> <div class="modal-btns"> <button class="btn modify" onclick="saveDetail()">保存</button> <button class="btn" onclick="closeDetail()">关闭</button> </div> </div> <script> let editingId=null,allPlans=[],currentPage=1,totalPages=1; async function loadPlans(k,p){const t=document.getElementById('planTableBody');t.innerHTML='<tr><td colspan="17">加载中...</td></tr>';try{let u=`http://localhost:8080/api/production_plans?page=${p}&size=10`;if(k)u+=`&keyword=${encodeURIComponent(k)}`;const r=await fetch(u),d=await r.json();allPlans=d.records;renderPlans(d.records);toggleOperationColumn();currentPage=d.current;totalPages=d.pages;updatePager();}catch{t.innerHTML='<tr><td colspan="17">加载失败</td></tr>'}} function renderPlans(d){const t=document.getElementById('planTableBody');if(!Array.isArray(d)||d.length===0){t.innerHTML='<tr><td colspan="17">暂无数据</td></tr>';return;}t.innerHTML=d.map(r=>`<tr> <td>${r.id}</td><td>${r.processName||'-'}</td><td>${r.startDate||'-'}</td><td>${r.leader||'-'}</td><td>${r.orderTrackingNo||'-'}</td> <td>${r.productCode||'-'}</td><td>${r.productName||'-'}</td><td>${r.orderQuantity??'-'}</td><td>${r.shipmentDate||'-'}</td> <td>${r.finishDate||'-'}</td><td><span class="tag ${r.isDelayed>0?'tag-danger':'tag-success'}">${r.isDelayed>0?'是':'否'}</span></td> <td>${r.deliveredQty??'-'}</td><td>${r.pendingQty??'-'}</td><td>${r.receiveStatus||'-'}</td> <td><button class="btn modify" onclick="openDetail(${r.id})">查看详情</button></td> <td>${r.remark||'-'}</td> <td><button class="btn modify" onclick="openEditModal(${r.id})">修改</button><button class="btn" style="margin-left:6px;background:#f56c6c" onclick="deletePlan(${r.id})">删除</button></td> </tr>`).join('')} function toggleOperationColumn(){const role=localStorage.getItem('role');const head=document.querySelector('th:last-child'),cells=document.querySelectorAll('td:last-child');if(role==='ADMIN'){head.style.display='';cells.forEach(c=>c.style.display='')}else{head.style.display='none';cells.forEach(c=>c.style.display='none')}} function searchPlans(){loadPlans(document.getElementById('searchInput').value.trim(),1)} function updatePager(){const i=document.getElementById('pageInput');i.max=totalPages;i.value=currentPage;document.getElementById('totalPages').textContent=totalPages;document.getElementById('btnPrev').disabled=currentPage<=1;document.getElementById('btnNext').disabled=currentPage>=totalPages} function prevPage(){if(currentPage>1)loadPlans(document.getElementById('searchInput').value.trim(),currentPage-1)} function nextPage(){if(currentPage<totalPages)loadPlans(document.getElementById('searchInput').value.trim(),currentPage+1)} function jumpToPage(){const v=parseInt(document.getElementById('pageInput').value,10);if(isNaN(v)||v<1||v>totalPages)return;loadPlans(document.getElementById('searchInput').value.trim(),v)} function openAddModal(){editingId=null;resetModal('新增排程')} function openEditModal(id){editingId=id;const r=allPlans.find(p=>p.id===id);if(!r)return;resetModal('修改排程',r)} function resetModal(title,data={}){document.getElementById('modalTitle').textContent=title;const f=document.getElementById('modalForm');f.reset();for(const k in data)if(f[k])f[k].value=data[k];document.getElementById('modalMask').style.display='block';document.getElementById('modalBox').style.display='block'} function closeModal(){document.getElementById('modalMask').style.display='none';document.getElementById('modalBox').style.display='none'} document.getElementById('modalMask').onclick=closeModal; document.getElementById('modalForm').onsubmit=async e=>{e.preventDefault();const fd=new FormData(e.target),data=Object.fromEntries(fd);data.isDelayed=data.isDelayed==='1';['orderQuantity','deliveredQty','pendingQty'].forEach(k=>{if(data[k])data[k]=Number(data[k])});try{const url=editingId?`/api/production_plans/${editingId}`:'/api/production_plans',meth=editingId?'PUT':'POST';const res=await fetch(url,{method:meth,headers:{'Content-Type':'application/json'},body:JSON.stringify(data)});if(res.ok){closeModal();loadPlans('',currentPage)}else alert('保存失败')}catch{alert('网络异常')}} async function deletePlan(id){if(!confirm(`确定删除排程 ${id} 吗?`))return;try{const res=await fetch(`/api/production_plans/${id}`,{method:'DELETE'});if(res.ok){loadPlans(document.getElementById('searchInput').value.trim(),currentPage)}else alert('删除失败')}catch{alert('网络异常')}} /* ================= 新增详情弹窗逻辑 ================= */ let curDetailPlanId = null; /* ================= 新增详情弹窗逻辑(含星期行) ================= */ async function openDetail(planId) { curDetailPlanId = planId; const plan = allPlans.find(p => p.id === planId); if (!plan) return; document.getElementById('detailOrderNo').textContent = plan.orderTrackingNo; document.getElementById('detailProductName').textContent = plan.productName; /* 1. 生成最近 30 天日期 */ const dates = []; const today = new Date(); for (let i = 0; i < 30; i++) { const d = new Date(today); d.setDate(today.getDate() + i); dates.push(d.toISOString().slice(0, 10)); } /* 2. 读取已保存数据 */ let saved = {}; try { const res = await fetch(`/api/production_plans/${planId}/details`); if (res.ok) (await res.json()).forEach(it => (saved[it.date] = it)); } catch (e) { /* ignore */ } /* 3. 计算星期(0=周日 … 6=周六) */ const weekMap = ['日', '一', '二', '三', '四', '五', '六']; const weekRowHTML = dates .map(d => `<td>周${weekMap[new Date(d + 'T00:00:00').getDay()]}</td>`) .join(''); /* 4. 渲染表头 */ const headRow = document.getElementById('detailHeadRow'); headRow.innerHTML = '<th></th>' + dates.map(d => `<th>${d}</th>`).join(''); /* 5. 渲染星期、计划、实际三行 */ const tbody = document.querySelector('#detailTable tbody'); tbody.innerHTML = `<tr id="weekRow"><td><b>星期</b></td>${weekRowHTML}</tr>` + `<tr id="plannedRow"><td><b>计划交付</b></td>${dates .map( d => `<td><input type="number" min="0" value="${saved[d]?.plannedQty || 0}" data-date="${d}" data-type="planned"></td>` ) .join('')}</tr>` + `<tr id="actualRow"><td><b>实际交付</b></td>${dates .map( d => `<td><input type="number" min="0" value="${saved[d]?.actualQty || 0}" data-date="${d}" data-type="actual"></td>` ) .join('')}</tr>`; /* 6. 显示弹窗 */ document.getElementById('detailMask').style.display = 'block'; document.getElementById('detailWrap').style.display = 'block'; } function closeDetail(){ document.getElementById('detailMask').style.display='none'; document.getElementById('detailWrap').style.display='none'; } async function saveDetail(){ const inputs = document.querySelectorAll('#detailTable input'); const payload = {}; inputs.forEach(inp=>{ const date = inp.dataset.date; const type = inp.dataset.type; if(!payload[date]) payload[date] = {date, plannedQty:0, actualQty:0}; payload[date][type] = parseInt(inp.value) || 0; }); await fetch(`/api/production_plans/${curDetailPlanId}/details`,{ method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(Object.values(payload)) }); alert('已保存'); closeDetail(); } /* ================= 初始化 ================= */ loadPlans('',1); </script> </body> </html>这是我的前端界面,请帮我实现点击查看详情按钮后的后端接口,要求当录入数据并保存后上面的日期就不会随着时间变更
07-20
<template> <div class="production-dashboard"> <!-- 顶部导航(含日期、页面切换) --> <div class="top-bar"> <div class="weather-info"> <span>{{ currentTime }}</span> <span>{{ currentDate }}</span> </div> <!-- 标题区域 --> <div class="title-section"> <h2 class="title">生产能力评估</h2> </div> <div class="page-switch"> <el-button type="text" icon="el-icon-s-home"></el-button> <el-button type="text" icon="el-icon-s-home"></el-button> <el-button type="text" icon="el-icon-s-home">放大</el-button> <el-button type="text" icon="el-icon-switch-button">关闭</el-button> </div> </div> <div class="button-container"> <!-- 左侧三个朝右的平行四边形按钮 --> <div class="left-buttons"> <button class="skew-button-left" :class="{ active: activeButton === '设备总览' }" @click="handleButtonClick('设备总览')" > 设备总览 </button> <button class="skew-button-left" :class="{ active: activeButton === '菜单二' }" @click="handleButtonClick('菜单二')" > 菜单二 </button> <button class="skew-button-left" :class="{ active: activeButton === '菜单三' }" @click="handleButtonClick('菜单三')" > 菜单三 </button> </div> <!-- 右侧三个朝左的平行四边形按钮 --> <div class="right-buttons"> <button class="skew-button-right" :class="{ active: activeButton === '菜单四' }" @click="handleButtonClick('菜单四')" > 菜单四 </button> <button class="skew-button-right" :class="{ active: activeButton === '菜单五' }" @click="handleButtonClick('菜单五')" > 菜单五 </button> <button class="skew-button-right" :class="{ active: activeButton === '菜单六' }" @click="handleButtonClick('菜单六')" > 菜单六 </button> </div> </div> <div class="workshop-buttons"> <button v-for="(workshop, index) in workshops" :key="index" :class="['workshop-btn', activeWorkshop === index ? 'active' : '']" @click="selectWorkshop(index)" > {{ workshop }} </button> </div> <div class="container"> <div class="row"> <!-- 卡片 1 --> <div class="card"> <div class="card-left"> <img src="@/views/product/img/shebeikaidonglv.png"> </div> <div class="card-right"> <p>良好台数 <span class="yellow-number">1</span></p> <p>正常台数 <span class="green-number">13</span></p> <p>告警台数 <span class="red-number">1</span></p> </div> </div> <!-- 卡片 2 --> <div class="card"> <div class="card-left"> <img src="@/views/product/img/xingneng.png"> </div> <div class="card-right"> <p>良好台数 <span class="red-number">0</span></p> <p>正常台数 <span class="green-number">15</span></p> <p>告警台数 <span class="yellow-number">0</span></p> </div> </div> <!-- 卡片 3 --> <div class="card"> <div class="card-left"> <img src="@/views/product/img/oeede.png"> </div> <div class="card-right"> <p>良好台数 <span class="red-number">1</span></p> <p>正常台数 <span class="green-number">13</span></p> <p>告警台数 <span class="yellow-number">1</span></p> </div> </div> </div> </div> <div class="app-container"> <!-- 循环生成 3 行 --> <div v-for="row in 3" :key="row" class="card-row"> <!-- 每行循环生成 5 个加工中心卡片 --> <div v-for="col in 5" :key="`${row}-${col}`" class="processing-card" @click="navigateToDetail((row - 1) * 5 + col)" @mouseenter="hoverCard = (row - 1) * 5 + col" @mouseleave="hoverCard = null" :class="{ 'card-hover': hoverCard === (row - 1) * 5 + col }" > <!-- 加工中心标题,根据行和列计算编号 --> <h3 class="card-title">加工中心{{ formatNumber((row-1)*5 + col) }}</h3> <div class="metrics"> <!-- 设备开动率指标 --> <div class="metric flex justify-between items-center" > <span class="label">设备开动率</span> <div class="progress-bar w-3/4" id="progress-outer"> <div class="progress" :style="{ width: equipmentPowerRateList[(row - 1) * 5 + col - 1], backgroundColor: getColor(equipmentPowerRateList[(row - 1) * 5 + col - 1]) }" > <!-- arrow --> <span class="arrow"></span> </div> <!-- 显示百分比文本 --> <span class="progress-text">{{ equipmentPowerRateList[(row - 1) * 5 + col - 1] }}</span> </div> </div> <!-- 性能指数指标 --> <div class="metric flex justify-between items-center"> <span class="label">性能指数</span> <div class="progress-bar w-3/4" id="progress-outer"> <div class="progress" :style="{ width: performanceIndexList[(row - 1) * 5 + col - 1], backgroundColor: getColor(performanceIndexList[(row - 1) * 5 + col - 1]) }" > <!-- arrow --> <span class="arrowt"></span> </div> <!-- 显示百分比文本 --> <span class="progress-text">{{ performanceIndexList[(row - 1) * 5 + col - 1] }}</span> </div> </div> <!-- OEE 指标 --> <div class="metric flex justify-between items-center"> <span class="label">OEE</span> <div class="progress-bar w-3/4" id="progress-outer"> <div class="progress" :style="{ width: oeeList[(row - 1) * 5 + col - 1], backgroundColor: getColor(oeeList[(row - 1) * 5 + col - 1]) }" > <!-- arrow --> <span class="arrow"></span> </div> <!-- 显示百分比文本 --> <span class="progress-text">{{ oeeList[(row - 1) * 5 + col - 1] }}</span> </div> </div> </div> </div> </div> </div> </div> </template> <script> export default { name: 'ProductionDashboard', name: 'App', data() { return { // 顶部信息 temperature: '23.5', currentTime: '18:53:39', currentDate: '2025年7月14日', // 菜单状态 activeMenu: '设备总览', activeWorkshop: '国合车间', workshops: ['国合车间', '大件车间', '小件车间'], // 默认选中第一个 activeWorkshop: 0 , activeButton: '设备总览' , // 设备开动率固定数值列表,按加工中心顺序排列 equipmentPowerRateList: [ '55%', '30%', '80%', '80%', '80%', '80%', '80%', '80%', '80%', '80%', '80%', '80%', '80%', '80%', '80%' ], // 性能指数固定数值列表,按加工中心顺序排列 performanceIndexList: [ '83%', '83%', '90%', '90%', '90%', '90%', '90%', '90%', '90%', '90%', '90%', '90%', '90%', '90%', '90%' ], // OEE 固定数值列表,按加工中心顺序排列 oeeList: [ '30%', '55%', '71%', '71%', '71%', '71%', '71%', '71%', '71%', '71%', '71%', '71%', '71%', '71%', '71%' ], hoverCard: null, // 记录当前悬停的卡片ID }; }, created() { // 初始化时间 this.updateDateTime(); setInterval(this.updateDateTime, 1000); }, methods: { // 更新时间 updateDateTime() { const now = new Date(); this.currentTime = now.toTimeString().split(' ')[0]; this.currentDate = `${now.getFullYear()}年${now.getMonth() + 1}月${now.getDate()}日 ${['日', '一', '二', '三', '四', '五', '六'][now.getDay()]} 星期`; }, selectWorkshop(index) { this.activeWorkshop = index; }, handleButtonClick(buttonName) { this.activeButton = buttonName; console.log(`点击了: ${buttonName}`); }, getColor(rate) { const percent = parseInt(rate); if (percent < 50) return '#C84D53'; // 红色 if (percent < 70) return '#C4A543'; // 橙色 return '#5CC352'; // 绿色 }, // 格式化数字为两位数(不足两位时前面补零) formatNumber(num) { return num.toString().padStart(2, '0'); }, navigateToDetail(machineId) { console.log(`跳转到加工中心${machineId}详情页`); // 实际项目中使用路由跳转: // this.$router.push({ name: 'MachineDetail', params: { id: machineId } }); }, } }; </script> <style scoped> /* 整体样式 */ .production-dashboard { background-color: #113231; color: white; min-height: 100vh; padding: 0px; min-width: 1200px; /* 设置页面最小宽度,超出屏幕时触发全局滚动 */ box-sizing: border-box; } /* 顶部导航(日期和页面切换) */ .top-bar { display: flex; justify-content: space-between; align-items: center; background: #003333; background: #003333 url('@/views/product/img/top-background.png') center/cover no-repeat; padding: 20px 10px; height: 40px; background-position: center; border-radius: 6px; } .weather-info { display: flex; gap: 15px; font-size: 10px; align-items: center; } .page-switch { gap: 50px; /* 调整页面切换按钮间距 */ font-size: 10px; } /* 标题区域 */ .title-section { margin-left: -100px; } .title { font-size: 17px; font-weight:700; margin-top: 15px; letter-spacing: 5px; background: linear-gradient(to right, #3eb2dc, #ffffff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-family: "Microsoft YaHei", sans-serif; /* 微软雅黑 */ } .button-container { display: flex; justify-content: space-between; margin: 15px 0; } .left-buttons, .right-buttons { display: flex; gap: 2px; margin-top: -18px; } .right-buttons{ margin-right: 150px; } .left-buttons{ margin-left: 150px; } /* 朝右的平行四边形按钮 */ .skew-button-right { position: relative; background-color: #3f7870; color: white; border: none; padding: 2px 2px; font-size: 8px; cursor: pointer; transform: skew(-15deg); /* 整体倾斜 */ transition: all 0.2s; margin-left: 0px; margin-right: 10px; width: 40px; height: 20px; box-shadow: 0 0 5px rgba(60, 175, 172, 0.5); } .skew-button-right:hover { background-color: #3cafac; } .skew-button-right span { display: inline-block; transform: skew(15deg); /* 文字反方向倾斜,恢复正常 */ } /* 朝左的平行四边形按钮 */ .skew-button-left { position: relative; background-color: #3f7870; color: white; border: none; padding: 2px 2px; font-size: 8px; cursor: pointer; transform: skew(15deg); /* 整体朝相反方向倾斜 */ transition: all 0.2s; margin-left: 10px; width: 40px; height: 20px; box-shadow: 0 0 5px rgba(60, 175, 172, 0.5); } .skew-button-left:hover { background-color: #3cafac; } .skew-button-left span { display: inline-block; transform: skew(-15deg); /* 文字反方向倾斜,恢复正常 */ } /* 选中状态样式 */ .skew-button-right.active, .skew-button-left.active { background-color: #3cafac; box-shadow: 0 0 5px rgba(60, 175, 172, 0.5); } .workshop-buttons { display: flex; justify-content: center; gap: 15px; /* 按钮间距 */ margin: -12px 0; } .workshop-btn { background: transparent; border: none; border-bottom: 2px solid transparent; /* 初始下边框透明 */ color: white; font-size: 10px; padding: 5px 10px; cursor: pointer; transition: all 0.3s; } .workshop-btn.active { border-bottom-color: #FF9900; /* 选中时下边框为橙色 */ color: #FF9900; /* 选中时文字为橙色 */ font-weight: 500; } .workshop-btn:hover:not(.active) { border-bottom-color: rgba(255, 153, 0, 0.5); /* 悬停时半透明橙色下边框 */ transition: border-color 0.3s; } .container { width: 600px; margin: 0 auto; padding: 20px; height: 100px; } .row { display: flex; flex-wrap: wrap; gap: 20px; } .card { flex: 1; min-width: 150px; display: flex; border: 1px solid #104D4E; border-radius: 8px; overflow: auto; box-shadow: 0 0 5px rgba(23, 103, 104, 0.845); } .card-left { width: 50%; /* 左侧占比 */ background-color: #003331; background-image: url(); height: 80px; } .card-right { width: 50%; /* 右侧占比 */ background-color: #003331; color: white; /* 文字默认白色 */ border-radius: 4px; padding: 5px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; } /* 行间距控制 */ .card-right p { margin: 7px 8px; /* 上下各5px距,确保三行分明 */ font-size: 10px; } /* 数字颜色样式 */ .red-number { color: #FF4949; /* 红色数字 */ margin-left: 5px; /* 与文字保持一点距离 */ } .green-number { color: #00CC00; /* 绿色数字 */ margin-left: 5px; } .yellow-number { color: #FF9900; /* 黄色数字 */ margin-left: 5px; } .app-container { display: flex; flex-direction: column; gap: 15px; padding: 20px; min-width: 1200px; max-height: 600px; margin: 0 auto; overflow-y: auto; } .card-row { display: flex; gap: 30px; overflow-x: auto; padding-bottom: 10px; margin: 0 auto; } .card-title { margin: 0 0 6px 0; font-size: 14px; font-weight: normal; } .metrics { display: flex; flex-direction: column; gap: 6px; } .metric { display: flex; align-items: center; justify-content: space-between; } .label { font-size: 10px; margin-bottom: 4px; width: 110px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; } .progress-bar { width: 100%; height: 12px; background-color: rgba(255, 255, 255, 0.1); border-radius: 6px; } .progress { height: 12px; transition: width 0.5s ease; display: flex; align-items: center; justify-content: flex-end; /* 让箭头在进度条内部靠右 */ padding-right: 4px; /* 给箭头和进度条边缘留间距 */ border-radius: 6px; } .progress-text { font-size: 9px; color: white; margin-left: 2px; /* 与进度条保持间距 */ } #progress-outer { display: flex; align-items: center; } .arrow { font-size: 10px; color: white; } .processing-card { flex: 0 0 180px; background-color: #0b3b3a; color: white; border-radius: 8px; padding: 12px; font-family: "宋体", SimSun, serif; transition: all 0.3s ease; /* 添加过渡效果 */ cursor: pointer; /* 鼠标指针样式 */ } /* 卡片悬浮效果 */ .card-hover { transform: translateY(-2px); /* 向上浮动 */ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* 阴影效果 */ background-color: #0e4c4b; /* 背景色变化 */ } </style> vue中左右滚动条不出现怎么办
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值