From 2239e47134956ec46a937300b09663c88558c9d6 Mon Sep 17 00:00:00 2001 From: linfso Date: Mon, 5 Aug 2024 09:14:17 +0800 Subject: [PATCH] md --- src/components/XdPageContainer/index.vue | 1 + src/components/XdTable/index.vue | 111 ++++++++++++++---- .../traceWaybillDetailView.vue | 50 ++++++-- .../emis/customerService/waybillTracking.vue | 19 ++- src/views/emis/emisTmsPack/PackList.vue | 76 ++---------- .../emis/emisWaybill/waybillIsPrinted.vue | 4 +- .../emisWaybillAjustApply/adjustPanel.vue | 16 +++ 7 files changed, 163 insertions(+), 114 deletions(-) diff --git a/src/components/XdPageContainer/index.vue b/src/components/XdPageContainer/index.vue index 78b06166..fcdb2e35 100644 --- a/src/components/XdPageContainer/index.vue +++ b/src/components/XdPageContainer/index.vue @@ -43,6 +43,7 @@ export default { let h2 = this.$refs.pageHeader.offsetHeight; let contentHeight = h1 - h2-190; this.contentHeight = contentHeight; + console.log("====this.contentHeight==>",this.contentHeight); }, 500), }, }; diff --git a/src/components/XdTable/index.vue b/src/components/XdTable/index.vue index 52a03b63..793684da 100644 --- a/src/components/XdTable/index.vue +++ b/src/components/XdTable/index.vue @@ -2,7 +2,6 @@
-
@@ -117,11 +116,10 @@
- _l && st > _t && selRowList[i].offsetLeft < _l + _w && selRowList[i].offsetTop < _t + _h) { + if (selRowList[i].className.indexOf("rowSeled") == -1) { + selRowList[i].className = selRowList[i].className + " rowSeled"; + refTableObj.toggleRowSelection(vnode.context.tableData[i],true) + //把选中的都存入到table标签中的已选中 + // if(vnode.context.tableData[i]){ + // vnode.context.multipleRowSelection.push(vnode.context.tableData[i]); + // } + } + } else { + if (selRowList[i].className.indexOf("rowSeled") != -1 ) { + selRowList[i].className = "el-table__row"; + refTableObj.toggleRowSelection(vnode.context.tableData[i],false); + // vnode.context.multipleSelection.forEach((ele,i)=>{ + // //这里没用对象是否相等用的是传入table中的唯一的myKey字段 + // if(ele[vnode.context.myKey]==vnode.context.tableData[i][vnode.context.myKey] ){ + // vnode.context.multipleSelection.splice(i,1); + // } + // }) + } + } + } } // vnode.context.clearEventBubble(evt); }; @@ -395,8 +436,8 @@ export default { vnode.context.clearEventBubble(event) var menu = xdTableObj.querySelector("#contextMenu"); - console.log("====>xdTableObj====>",xdTableObj); - console.log("====>menu====>",menu); + // console.log("====>xdTableObj====>",xdTableObj); + // console.log("====>menu====>",menu); let tbPosRect=getTablePosition(xdTableObj); menu.style.left = (event.clientX-tbPosRect.left+5) + "px"; @@ -436,7 +477,7 @@ export default { while(cell.tagName !== 'TD'){ cell = cell.parentElement; } - // console.log("xdtable==>",cell); + // // console.log("xdtable==>",cell); const cellRect = cell.getBoundingClientRect(); return { x:cellRect.x,y:cellRect.y,width:cellRect.width,height:cellRect.height}; }catch(e){ @@ -444,7 +485,7 @@ export default { } } - function setMouseCellSelect(cell) { + function setMouseCellSelect(cell,selRowList) { try{ while(cell.tagName !== 'TD'){ cell = cell.parentElement; @@ -454,7 +495,6 @@ export default { return; } - // 选中和取消选中 if(cell.className.indexOf("seled") != -1 ){ // cell.classList.remove("seled"); @@ -467,10 +507,18 @@ export default { vnode.context.multipleSelection=[]; vnode.context.multipleSelection.push(cellInfo); + // 行样式设置 + // const refTableObj=vnode.context.getInstance(); + // let rowIndex = cell.rowIndex; + // // selRowList[i].className = selRowList[i].className + " rowSeled"; + // refTableObj.toggleRowSelection(vnode.context.tableData[rowIndex],true) + }catch(e){ } } + + // 获取鼠标位置的单元格 function getCellPosition(cell) { try{ @@ -549,6 +597,8 @@ export default { mouseflag: false, //选中的数组 multipleSelection: [], + multipleRowSelection:[], + //控制右键菜单弹出显示 contextVisible:false, @@ -599,14 +649,14 @@ export default { }, }, mounted() { - console.log("===>xdtabe mounted==111->"); + // // console.log("===>xdtabe mounted==111->"); if(this.saveStorageName&&this.saveStorageName!=undefined&&this.saveStorageName!=''){ this.isNeedDbSaveTpl=true; }else{ this.fullUrl=window.location.origin + window.location.pathname + window.location.search + window.location.hash; this.pageId=this.MD5(this.fullUrl); this.saveStorageName=this.pageId; - // console.log("===> this.fullUrl==>", this.fullUrl,this.saveStorageName) + // // console.log("===> this.fullUrl==>", this.fullUrl,this.saveStorageName) this.isNeedDbSaveTpl=false; } @@ -686,7 +736,7 @@ export default { if(val){ if(this.storeTplList&&this.storeTplList.length>0){ const tplItem = this.storeTplList.find(d => d.tplCode === val) - console.log("===>changeTbShowTpl==111->",tplItem); + // // console.log("===>changeTbShowTpl==111->",tplItem); this.form=Object.assign({},tplItem); if(this.form.tplData){ this.storageList=JSON.parse(this.form.tplData); @@ -696,14 +746,14 @@ export default { return n.componentOptions && item.prop === n.componentOptions.propsData.prop })) - console.log("===>changeTbShowTpl==222->",tplItem); + // // console.log("===>changeTbShowTpl==222->",tplItem); this.storageList = list; // 保存模版数据到本地 this.storeTplToLocal(); - console.log("===>changeTbShowTpl==444->",tplItem); + // // console.log("===>changeTbShowTpl==444->",tplItem); this.updateTable() - console.log("===>changeTbShowTpl==555->",tplItem); + // // console.log("===>changeTbShowTpl==555->",tplItem); } } }else{ @@ -728,7 +778,7 @@ export default { tagId:this.saveStorageName }; - // console.log("===>initTbShowlList=1111=>"); + // // console.log("===>initTbShowlList=1111=>"); this.storeTplList=[]; listSysCustomizeTpl(queryParams).then(response => { if(response.rows&&response.rows.length>0){ @@ -740,7 +790,7 @@ export default { this.curentTbShowTpl=selTplItem.tplCode; this.storageList=JSON.parse(this.form.tplData); - // console.log("===>initTbShowlList=111=>",this.storageList); + // // console.log("===>initTbShowlList=111=>",this.storageList); // 必须在节点数组存在的才有意义 let list = this.storageList.filter(item => this.$vnode.componentOptions.children.find(n => { return n.componentOptions && item.prop === n.componentOptions.propsData.prop @@ -859,7 +909,7 @@ export default { }); selStr=this.trimTabChar(selStr,'\t',''); - // console.log("=selStr==>",selStr); + // // console.log("=selStr==>",selStr); this.currentSelectStr=selStr; } @@ -980,7 +1030,7 @@ export default { let that=this; this.$nextTick(function () { const wrapperTr = document.querySelector('#'+that.tableId+' .el-table__header-wrapper > table > thead > tr'); - // console.log("===>wrapperTr==>",wrapperTr); + // // console.log("===>wrapperTr==>",wrapperTr); if(wrapperTr){ Sortable.create(wrapperTr, { animation: 100, @@ -1111,7 +1161,7 @@ export default { // 更多操作触发 handleAdjustTableSize(command) { //size:mini/small/medium; - // console.log(this.config); + // // console.log(this.config); switch (command) { case "small": this.config.attrs.size='small'; @@ -1163,7 +1213,7 @@ export default { // 根据缓存的数组进行渲染表格 updateTable() { - console.log("===>updateTable==>"); + // // console.log("===>updateTable==>"); // 特殊类型 const childrenNodes = this.$vnode.componentOptions.children.filter(node => node.componentOptions && node.componentOptions.propsData.type) this.storageList.forEach(item => { @@ -1291,6 +1341,17 @@ export default { font-weight: 600; } +:deep .rowSeled{ + // background-color: #d9ecff7d !important; + background-color: #ffa5a55e !important; + + color: black; + font-weight: 600; +} + +.xd-tb-wrapper :deep .el-table__body tr:hover > td { + background-color: #ffa5a55e !important; + } .xd-tb-wrapper{ -webkit-user-select: none; /* Safari */ @@ -1299,6 +1360,8 @@ export default { user-select: none; } + + // :deep .el-table__body tr.current-row>td { // background: none !important; // } diff --git a/src/views/emis/customerService/traceWaybillDetailView.vue b/src/views/emis/customerService/traceWaybillDetailView.vue index 09a0f557..2bbe43ac 100644 --- a/src/views/emis/customerService/traceWaybillDetailView.vue +++ b/src/views/emis/customerService/traceWaybillDetailView.vue @@ -1,20 +1,11 @@