md
This commit is contained in:
parent
238f900011
commit
cc31812ca0
@ -27,12 +27,11 @@ html, body {
|
||||
}
|
||||
|
||||
.el-table th.el-table__cell {
|
||||
user-select: initial;
|
||||
user-select: text;
|
||||
// user-select: initial;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
label {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ export default {
|
||||
values() {
|
||||
if (this.value !== null && typeof this.value !== 'undefined') {
|
||||
// return Array.isArray(this.value) ? this.value : [String(this.value)];
|
||||
return Array.isArray(this.value) ? this.value : this.value.split(',');
|
||||
return Array.isArray(this.value) ? this.value : this.value?this.value.split(','):[];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -70,6 +70,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="">
|
||||
<div style="width:50%">
|
||||
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
||||
</div>
|
||||
<el-scrollbar style="height: calc(100vh - 200px);box-sizing: border-box;" >
|
||||
<draggable v-model="storageList"
|
||||
ghostClass="drag-ghost"
|
||||
@ -78,9 +81,7 @@
|
||||
handle=".el-icon-s-operation"
|
||||
@end="updateTable"
|
||||
>
|
||||
<div style="width:50%">
|
||||
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
||||
</div>
|
||||
|
||||
<div v-for="col in storageList" :key="col.label" class="setting-row">
|
||||
<!-- <i class="el-icon-s-operation" /> -->
|
||||
<i class="el-icon-s-operation icon iconfont icon-ui_drag_horizontally" />
|
||||
@ -270,14 +271,13 @@ export default {
|
||||
var evt = window.event || arguments[0];
|
||||
var flag = true;
|
||||
// 鼠标右键菜单
|
||||
// console.log("evt",evt);
|
||||
if(evt.button == 2){
|
||||
flag=false;
|
||||
showContextMenu(evt);
|
||||
// vnode.context.clearEventBubble(evt);
|
||||
const currentCellInfo=getCellPosition(evt.target);
|
||||
vnode.context.currentCellInfo=currentCellInfo;
|
||||
// console.log("currentCellInfo",currentCellInfo);
|
||||
if(vnode.context.multipleSelection&&vnode.context.multipleSelection.length>0){
|
||||
showContextMenu(evt);
|
||||
const currentCellInfo=getCellPosition(evt.target);
|
||||
vnode.context.currentCellInfo=currentCellInfo;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 只有鼠标左键按下时有效
|
||||
@ -310,6 +310,17 @@ export default {
|
||||
var startX = (evt.x || evt.clientX);
|
||||
var startY = (evt.y || evt.clientY);
|
||||
|
||||
//重置选中css
|
||||
for (var i = 0; i < fileNodes.length; i++) {
|
||||
if (fileNodes[i].className.indexOf("el-table__cell") != -1) {
|
||||
// fileNodes[i].className = "el-table__cell";
|
||||
fileNodes[i].classList.remove("seled");
|
||||
selList.push(fileNodes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
setMouseCellSelect(evt.target);
|
||||
|
||||
|
||||
var _x = null;
|
||||
var _y = null;
|
||||
@ -327,16 +338,7 @@ export default {
|
||||
// }
|
||||
//为了确保只有一次的渲染每次框选都把默认选中为空
|
||||
if(flag){
|
||||
//重置选中css
|
||||
for (var i = 0; i < fileNodes.length; i++) {
|
||||
if (fileNodes[i].className.indexOf("el-table__cell") != -1) {
|
||||
// fileNodes[i].className = "el-table__cell";
|
||||
fileNodes[i].classList.remove("seled");
|
||||
selList.push(fileNodes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
flag = false;
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if (vnode.context.mouseflag) {
|
||||
@ -442,12 +444,18 @@ export default {
|
||||
while(cell.tagName !== 'TD'){
|
||||
cell = cell.parentElement;
|
||||
}
|
||||
cell.className = cell.className + " seled";
|
||||
|
||||
const cellInfo=getCellPosition(cell);
|
||||
vnode.context.multipleSelection=[];
|
||||
vnode.context.multipleSelection.push(cellInfo);
|
||||
|
||||
// 选中和取消选中
|
||||
if(cell.className.indexOf("seled") != -1 ){
|
||||
cell.classList.remove("seled");
|
||||
vnode.context.multipleSelection=[];
|
||||
}
|
||||
else{
|
||||
cell.className = cell.className + " seled";
|
||||
const cellInfo=getCellPosition(cell);
|
||||
vnode.context.multipleSelection=[];
|
||||
vnode.context.multipleSelection.push(cellInfo);
|
||||
}
|
||||
|
||||
}catch(e){
|
||||
}
|
||||
@ -579,12 +587,6 @@ export default {
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
beforeMount() {
|
||||
window.addEventListener('keydown', this.keyDown)
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('keydown', this.keyDown)
|
||||
},
|
||||
mounted() {
|
||||
if(this.saveStorageName&&this.saveStorageName!=undefined&&this.saveStorageName!=''){
|
||||
this.isNeedDbSaveTpl=true;
|
||||
@ -608,49 +610,16 @@ export default {
|
||||
return Math.random().toString(36).substring(3,10);
|
||||
},
|
||||
|
||||
// initKeyDown(){
|
||||
// let that=this;
|
||||
// document.addEventListener('keydown', function(e) {
|
||||
// e = e||window.event;
|
||||
// if(e.ctrlKey&&e.code=="KeyC"){
|
||||
// that.handleCopySelect(e);
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
keyDown(e) {
|
||||
initKeyDown(){
|
||||
let that=this;
|
||||
if (e || window.e) {
|
||||
const { key, target } = e
|
||||
const deleteKeyArr = ['Backspace', 'Delete']
|
||||
// 使用this.$el.querySelector('#efContainer')而不使用document.getElementById,是因为我们获取元素,尽量用this.$el去一级级获取,用document,单页面应用总会出些意外
|
||||
// js的contains方法用来查看dom元素的包含关系-用来限定键盘事件只局限于当前dom范围内
|
||||
const efContainerId = this.$el.querySelector('#'+this.tableId)
|
||||
console.log("====>efContainerId==>",efContainerId);
|
||||
if (e.ctrlKey&&e.code=="KeyC" && target.contains(efContainerId)) {
|
||||
this.handleCopySelect(e)
|
||||
document.addEventListener('keydown', function(e) {
|
||||
e = e||window.event;
|
||||
if(e.ctrlKey&&e.code=="KeyC"){
|
||||
that.handleCopySelect(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
// const efContainerId = this.$el.querySelector('#'+this.tableId)
|
||||
// console.log("====>efContainerId==>",efContainerId);
|
||||
// console.log("====>efContainerId==>",efContainerId);
|
||||
// if(e.ctrlKey&&e.code=="KeyC"){
|
||||
// that.handleCopySelect(e);
|
||||
// return false;
|
||||
// }
|
||||
// if (deleteKeyArr.includes(key) && !this.delBtnDisabled && this.clickedBackSpace && target.contains(efContainerId)) {
|
||||
// this.deleteElement()
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
keyDownOld(e) {
|
||||
if(e.ctrlKey && e.keyCode==13) { //用户点击了ctrl+enter触发
|
||||
|
||||
}
|
||||
// this.textarea += '\n';
|
||||
// }else { //用户点击了enter触发
|
||||
// this.sendMessage();
|
||||
},
|
||||
onTplSelectInputBlur(e) {
|
||||
if (e.target.value.trim()!== '') {
|
||||
//e.target.value就是录入的内容
|
||||
@ -1070,7 +1039,14 @@ export default {
|
||||
}))
|
||||
this.storageList = list
|
||||
},
|
||||
keyDown(e) {
|
||||
if(e.ctrlKey && e.keyCode==13) { //用户点击了ctrl+enter触发
|
||||
|
||||
}
|
||||
// this.textarea += '\n';
|
||||
// }else { //用户点击了enter触发
|
||||
// this.sendMessage();
|
||||
},
|
||||
// 根据缓存的数组进行渲染表格
|
||||
updateTable() {
|
||||
// 特殊类型
|
||||
|
||||
@ -265,6 +265,8 @@
|
||||
slot-scope="slotProps"
|
||||
:height="(slotProps.contentHeight)+'px'"
|
||||
|
||||
highlight-current-row
|
||||
|
||||
ref="refTable"
|
||||
row-key="id"
|
||||
|
||||
@ -279,6 +281,7 @@
|
||||
@queryTable="getList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange"
|
||||
@row-dblclick="handleShowTraceInfo"
|
||||
>
|
||||
|
||||
<div slot="toolbar">
|
||||
@ -321,15 +324,16 @@
|
||||
|
||||
<el-table-column :label="$t('快件跟踪')" align="left" prop="lastTraceInfo" min-width="350" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<div class="link-type" @click="handleShowTraceInfo(scope.row)">{{scope.row.lastTraceInfo}}</div>
|
||||
<div >{{scope.row.lastTraceInfo}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- class="link-type" @click="handleShowTraceInfo(scope.row)" class="link-type" @click="handleShowTraceInfo(scope.row)" class="link-type" @click="handleShowTraceInfo(scope.row)" -->
|
||||
<el-table-column :label="$t('跟踪预警')" align="center" prop="traceWaring" min-width="100" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.blSign=='1'" class="link-type" @click="handleShowTraceInfo(scope.row)">
|
||||
<div v-if="scope.row.blSign=='1'" >
|
||||
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
|
||||
</div>
|
||||
<div v-else class="link-type" @click="handleShowTraceInfo(scope.row)">
|
||||
<div v-else >
|
||||
<span v-if="calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)>2" style="color: red" >
|
||||
轨迹异常:停留超时{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
|
||||
</span>
|
||||
@ -400,7 +404,7 @@
|
||||
|
||||
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="80" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.customerName}}</span>
|
||||
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -283,6 +283,7 @@
|
||||
@queryTable="getList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange"
|
||||
@row-dblclick="handleShowTraceInfo"
|
||||
>
|
||||
|
||||
<div slot="toolbar">
|
||||
@ -322,18 +323,20 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- class="link-type" @click="handleShowTraceInfo(scope.row)" -->
|
||||
<!-- class="link-type" @click="handleShowTraceInfo(scope.row)"
|
||||
class="link-type" @click="handleShowTraceInfo(scope.row)"-->
|
||||
<el-table-column :label="$t('快件跟踪')" align="left" prop="lastTraceInfo" min-width="350" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<div class="link-type" @click="handleShowTraceInfo(scope.row)">{{scope.row.lastTraceInfo}}</div>
|
||||
<div >{{scope.row.lastTraceInfo}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('跟踪预警')" align="center" prop="traceWaring" min-width="100" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.blSign=='1'" class="link-type" @click="handleShowTraceInfo(scope.row)">
|
||||
<div v-if="scope.row.blSign=='1'">
|
||||
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
|
||||
</div>
|
||||
<div v-else class="link-type" @click="handleShowTraceInfo(scope.row)">
|
||||
<div v-else >
|
||||
<span v-if="calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)>2" style="color: red" >
|
||||
轨迹异常:停留超时{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
|
||||
</span>
|
||||
@ -407,7 +410,7 @@
|
||||
|
||||
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="80" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.customerName}}</span>
|
||||
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user