refactor: simplify startup logs, batch DB read, remove per-read log
This commit is contained in:
1 parent
33d5442941
commit
11b79075a5
5 files changed
+55
-62
No files matched your search
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="page-query" class="page active max-w-3xl mx-auto p-6">
|
||||
<div class="flex gap-2 mb-6">
|
||||
<input id="q-input" type="text" placeholder="输入产品编号,如 PROD-003" class="flex-1 px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:border-transparent" />
|
||||
<input id="q-input" type="text" placeholder="输入产品编号" class="flex-1 px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:border-transparent" />
|
||||
<button id="q-btn" class="px-6 py-2.5 bg-indigo-700 text-white rounded-xl text-sm font-medium hover:bg-indigo-800 transition">查询</button>
|
||||
</div>
|
||||
<div id="q-result"></div>
|
||||
|
||||
@@ -65,15 +65,15 @@ let activeSubTab: 'mp' | 'plc' = 'mp'
|
||||
async function loadConfig() {
|
||||
configLoaded = true
|
||||
plcTabLoaded = false
|
||||
activeSubTab = 'mp'
|
||||
const el = document.getElementById('page-config')!
|
||||
const mpActive = activeSubTab === 'mp'
|
||||
el.innerHTML = `
|
||||
<div class="flex gap-1 mb-4 border-b border-gray-200 pb-0">
|
||||
<button id="sub-tab-mp" class="sub-tab active px-4 py-2 text-sm font-medium border-b-2 border-indigo-600 text-indigo-700">检测点配置</button>
|
||||
<button id="sub-tab-plc" class="sub-tab px-4 py-2 text-sm font-medium text-gray-500 border-b-2 border-transparent hover:text-gray-700">PLC配置</button>
|
||||
<button id="sub-tab-mp" class="sub-tab px-4 py-2 text-sm font-medium border-b-2 ${mpActive ? 'border-indigo-600 text-indigo-700' : 'border-transparent text-gray-500 hover:text-gray-700'}">检测点配置</button>
|
||||
<button id="sub-tab-plc" class="sub-tab px-4 py-2 text-sm font-medium border-b-2 ${mpActive ? 'border-transparent text-gray-500 hover:text-gray-700' : 'border-indigo-600 text-indigo-700'}">PLC配置</button>
|
||||
</div>
|
||||
<div id="mp-panel"></div>
|
||||
<div id="plc-panel" class="hidden"></div>`
|
||||
<div id="mp-panel" class="${mpActive ? '' : 'hidden'}"></div>
|
||||
<div id="plc-panel" class="${mpActive ? 'hidden' : ''}"></div>`
|
||||
|
||||
document.getElementById('sub-tab-mp')!.addEventListener('click', () => switchTab('mp'))
|
||||
document.getElementById('sub-tab-plc')!.addEventListener('click', () => switchTab('plc'))
|
||||
|
||||
Reference in new issue
Block a user