feat: 决策59-63--类似清单对比区右栏/价格目录树改版/导入整份拒绝/数据目录拍平 + det类型传参修复

This commit is contained in:
lianjianwei2024
2026-10-14 18:07:54 +08:00
parent ab2ec78045
commit 9464f74e17
6 changed files with 210 additions and 44 deletions

View File

@@ -71,6 +71,13 @@ body.histdrag{user-select:none}
.grpbox.treeclosed .grpsplit{width:14px;margin-left:0}
.grpmain{flex:1;min-width:0;overflow:auto}
body.grptree-dragging{cursor:col-resize !important;user-select:none}
/* 类似清单 ⟳ 重载行钉在滚动容器顶(34px),表头接在其下(2026-10-13 主人定) */
#t2 th{top:34px}
/* 下边对比区右栏(项目特征/定额):左线拖宽、中线拖高(均有记忆);收起态(2026-10-13 主人定) */
#hattrvsplit{flex:none;width:6px;cursor:col-resize}
#hattrvsplit:hover,#hattrhsplit:hover{background:#dbe7f6}
#hattrhsplit{flex:none;height:6px;cursor:row-resize}
#histwrap.attrfold #hattr,#histwrap.attrfold #hattrvsplit{display:none}
/* ---- 底部历史容器 ---- */
#histwrap{flex:0 0 auto;min-height:0;display:flex;flex-direction:column;background:#fff;border-top:1px solid var(--line)}
/* flex-shrink 归零(2026-10-08 主人报拖动不跟手):容器高度只听把手的,空间不够时
@@ -296,9 +303,8 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
<div class="grpsplit" id="grpsplit"><span class="gsplitbtn" title="收起/展开目录树">◀</span></div>
<div class="grpmain">
<!-- ⟳ 重载(2026-10-13 决策 46 主人定):分组结果服务端有缓存,重载=跳过缓存按当前数据与规则重算 -->
<div style="display:flex;align-items:center;gap:10px;padding:5px 10px;border-bottom:1px solid var(--line);background:#fafcff">
<div style="display:flex;align-items:center;gap:10px;padding:5px 10px;border-bottom:1px solid var(--line);background:#fafcff;position:sticky;top:0;z-index:5;height:34px;box-sizing:border-box">
<a class="lk" onclick="reloadSim()" title="不用缓存,按当前工程数据与分组规则重新分组(工程大要稍等)">⟳ 重载</a>
<span style="font-size:11.5px;color:var(--muted)">分组结果已缓存(改分组规则后自动按新规则重算)</span>
<!-- 原数据单位工程级的层级按钮挂点(2026-10-13 决策 58:分组/清单/定额/默认列宽 迁到这里最右) -->
<span id="rawLvMount" style="margin-left:auto;display:inline-flex;gap:4px;align-items:center"></span>
</div>
@@ -384,6 +390,8 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
<!-- 9 查询(仅关键字模式可用)/ 10 重置 / 11 分页(仅检索模式显示,置最右) -->
<button class="hb" id="btnQuery" onclick="doQuery()" disabled>查询</button>
<button class="hb" onclick="resetF()" data-page-node-id="Evol61yGTGBTDRv9YB3eiD">重置</button>
<!-- 收/展右栏(2026-10-13 主人定,仅类似清单标签显示):项目特征 + 定额(编码/名称)面板 -->
<button class="hb" id="fattrBtn" onclick="toggleHattr()" style="display:none">收项目特征</button>
<span class="hpg" id="hpg" style="display:none">
<button class="hb" id="hpgPrev" onclick="histPage(-1)">上一页</button>
<span id="hpgNo">第 1 页</span>
@@ -397,9 +405,11 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
<div id="histtblwrap" data-page-node-id="sB1ovGovBUXmqk4FshQgJU"><table id="ht" data-page-node-id="MJQFDMJgym6ECUMTzOdbf3"><colgroup id="hcg" data-page-node-id="jAFNXguH6nCvHUS1DHTrhI"></colgroup><thead id="hth" data-page-node-id="zPhbbuDHd1SRc0h6JBRQbb"></thead><tbody id="htb" data-page-node-id="uwNDVJZ7TLutkE4sPZuTKc"></tbody></table></div>
<div id="hmfoot" data-page-node-id="pHyW3yoVd6lJ4HizgoXkiG"></div>
</div>
<div id="hattrvsplit" title="拖动调整面板宽度"></div>
<div id="hattr">
<div class="hattr-hd">项目特征</div>
<div id="hattrTxt"></div>
<div id="hattrhsplit" title="拖动调整定额区高度"></div>
<div class="hattr-hd" style="border-top:1px solid var(--line)">定额(编码 / 名称)</div>
<div id="hattrNorms"><div class="empty">—</div></div>
</div>
@@ -462,7 +472,7 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
</div>
</div>
<script src="common.js?v=20261013m"></script>
<script src="common.js?v=20261013p"></script>
<script src="period.js"></script>
<script>
let SID=0, CUR=null, CURTYPE='lme', HROWS=[];
@@ -543,8 +553,10 @@ function syncHist(p){
// 单价类型两标签都显示(2026-10-08 主人定:工料机标签放来源右边)
if($('funitLbl')) $('funitLbl').textContent = isLme ? '单位' : '建设单位';
if($('funit')) $('funit').placeholder = isLme ? '输入单位(建设单位 / 发行单位)' : '输入建设单位';
// 工料机对比不用右栏(项目特征/定额面板)——结果表占满整行(2026-10-08 主人定)
if($('hattr')) $('hattr').style.display = isLme ? 'none' : '';
// 工料机对比不用右栏(项目特征/定额面板)——结果表占满整行(2026-10-08 主人定);
// 类似清单可手动收起右栏(2026-10-13 主人定「收项目特征」按钮)
if($('fattrBtn')) $('fattrBtn').style.display = (p==='p2') ? '' : 'none';
if($('hattr')) $('hattr').style.display = (isLme || HATTR_FOLD) ? 'none' : '';
// 精确度按标签取默认(工料机=全部含模糊;各自记住手动选择)
if($('htier') && FLT.tierByTab[p]) $('htier').value = FLT.tierByTab[p];
// 切标签=换对比上下文:结果表按新标签的列头重置(旧结果属于上一个标签,留着必然错位)
@@ -782,8 +794,7 @@ async function loadGroups(kind, fresh){
/* ⟳ 重载(决策 46):跳过服务端缓存,按当前数据与分组规则强制重新分组 */
function reloadSim(){
ldWrap('', '正在重新分组(不用缓存,工程大要稍等)…', ()=>loadGroups('similar', true))
.then(()=>{ $('msg').textContent='已按当前数据与分组规则重新分组'; });
ldWrap('', '正在重新分组(不用缓存,工程大要稍等)…', ()=>loadGroups('similar', true)); // 完成提示语已取消(2026-10-14 主人定)
}
// 清单首列「+」→ 展开其下定额:由 common.js 提供(读全局 WB_OPTS.normApi)。
@@ -1656,6 +1667,50 @@ async function initFromUrl(){
}
initFromUrl();
/* ---------- 下边对比区右栏(2026-10-13 主人定):收/展按钮 + 左线拖宽 + 中线拖高,均有记忆 ---------- */
let HATTR_FOLD = false;
try { HATTR_FOLD = localStorage.getItem('hattrFold') === '1'; } catch (e) {}
function applyHattrFold() {
document.getElementById('histwrap').classList.toggle('attrfold', HATTR_FOLD);
const b = document.getElementById('fattrBtn');
if (b) b.textContent = HATTR_FOLD ? '展开项目特征' : '收项目特征';
}
function toggleHattr() {
HATTR_FOLD = !HATTR_FOLD;
try { localStorage.setItem('hattrFold', HATTR_FOLD ? '1' : '0'); } catch (e) {}
applyHattrFold();
}
function hattrSplitInit() {
const body = document.getElementById('histbody');
const hattr = document.getElementById('hattr');
const vs = document.getElementById('hattrvsplit');
if (!body || !hattr || !vs || vs.dataset.ready) return;
vs.dataset.ready = '1';
{ const mw = panelMemLoad('hattrw', 160, 100000); if (mw) hattr.style.width = mw + 'px'; }
let dv = null;
vs.addEventListener('mousedown', e => { dv = { x0: e.clientX, w0: hattr.getBoundingClientRect().width }; e.preventDefault(); });
document.addEventListener('mousemove', e => {
if (!dv) return;
hattr.style.width = Math.max(160, Math.round(dv.w0 - (e.clientX - dv.x0))) + 'px';
});
document.addEventListener('mouseup', () => { if (!dv) return; dv = null; panelMemSave('hattrw', parseFloat(hattr.style.width) || 0); });
const hs = document.getElementById('hattrhsplit');
const norms = document.getElementById('hattrNorms');
if (!hs || hs.dataset.ready) return;
hs.dataset.ready = '1';
{ const nh = panelMemLoad('hattrnh', 70, 100000); if (nh) norms.style.height = nh + 'px'; }
let dh = null;
hs.addEventListener('mousedown', e => { dh = { y0: e.clientY, h0: norms.getBoundingClientRect().height }; e.preventDefault(); });
document.addEventListener('mousemove', e => {
if (!dh) return;
const maxH = Math.max(70, Math.round(hattr.clientHeight * 0.75));
norms.style.height = Math.min(Math.max(70, Math.round(dh.h0 - (e.clientY - dh.y0))), maxH) + 'px';
});
document.addEventListener('mouseup', () => { if (!dh) return; dh = null; panelMemSave('hattrnh', parseFloat(norms.style.height) || 0); });
}
applyHattrFold();
hattrSplitInit();
/* ================= 分组/匹配 设置(决策 32,2026-10-10 重做:分组规则表格 + 全局过滤词) ================= */
let RULES = []; // 规则行 [{_uid, seq, name, keywords, exclude, _hits}]
let RULE_EDIT = new Set(); // 处于编辑态的行 _uid