1
This commit is contained in:
parent
32459a98ed
commit
bf0eba0f3d
@ -184,7 +184,7 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="columnConfigDialogVisible"
|
v-model="columnConfigDialogVisible"
|
||||||
title="字段设置"
|
title="字段设置"
|
||||||
width="560px"
|
width="1200px"
|
||||||
align-center
|
align-center
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
@ -203,59 +203,99 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="column-config-list" ref="columnConfigListRef">
|
<div class="column-config-list" ref="columnConfigListRef">
|
||||||
<template v-for="section in columnConfigDialogSections" :key="section.key">
|
<template v-for="section in columnConfigDialogSections" :key="section.key">
|
||||||
<div class="column-config-section">
|
<div class="column-config-section" :class="`column-config-section--${section.key}`">
|
||||||
<div class="column-config-section-title">{{ section.title }}</div>
|
<div class="column-config-section-title">{{ section.title }}</div>
|
||||||
<div
|
<div class="column-config-section-body">
|
||||||
v-for="(item, sIdx) in section.items"
|
<div
|
||||||
:key="item.prop"
|
v-for="(item, sIdx) in section.items"
|
||||||
class="column-config-item"
|
:key="item.prop"
|
||||||
:class="{
|
class="column-config-item"
|
||||||
'is-fixed-column': section.key !== 'scroll',
|
:class="{
|
||||||
'is-draggable': section.key === 'scroll',
|
'is-fixed-column': section.key !== 'scroll',
|
||||||
'is-drag-over': section.key === 'scroll' && dragOverProp === item.prop
|
'is-draggable': true,
|
||||||
}"
|
'is-drag-over': dragOverProp === item.prop
|
||||||
:draggable="section.key === 'scroll'"
|
}"
|
||||||
@dragstart="onColumnDragStart($event, item)"
|
:draggable="true"
|
||||||
@dragover.prevent="onColumnDragOver($event, item)"
|
@dragstart="onColumnDragStart($event, item)"
|
||||||
@drop.prevent="onColumnDrop(item)"
|
@dragover.prevent="onColumnDragOver($event, item)"
|
||||||
@dragend="onColumnDragEnd"
|
@drop.prevent="onColumnDrop(item)"
|
||||||
>
|
@dragend="onColumnDragEnd"
|
||||||
<div class="column-config-main">
|
>
|
||||||
<span
|
<div class="column-config-main">
|
||||||
v-if="section.key === 'scroll'"
|
<span class="drag-handle" aria-hidden="true">⋮⋮</span>
|
||||||
class="drag-handle"
|
<el-checkbox
|
||||||
aria-hidden="true"
|
:model-value="item.visible"
|
||||||
>⋮⋮</span>
|
@change="(val: any) => onToggleColumnVisible(item.prop, !!val)"
|
||||||
<span
|
>
|
||||||
v-else
|
{{ item.label || item.prop }}
|
||||||
class="drag-handle drag-handle--locked"
|
</el-checkbox>
|
||||||
title="固定列不可调整顺序"
|
</div>
|
||||||
>⋮⋮</span>
|
<div class="column-config-actions">
|
||||||
<el-checkbox
|
<!-- 不固定列:左箭头固定到左侧,右箭头固定到右侧 -->
|
||||||
:model-value="item.visible"
|
<el-button
|
||||||
@change="(val: any) => onToggleColumnVisible(item.prop, !!val)"
|
v-if="section.key === 'scroll'"
|
||||||
>
|
text
|
||||||
{{ item.label || item.prop }}
|
size="small"
|
||||||
</el-checkbox>
|
class="cfg-fix-btn"
|
||||||
|
@click="setFixed(item.prop, 'left')"
|
||||||
|
title="固定到左侧"
|
||||||
|
>
|
||||||
|
←
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="section.key === 'scroll'"
|
||||||
|
text
|
||||||
|
size="small"
|
||||||
|
class="cfg-fix-btn"
|
||||||
|
@click="setFixed(item.prop, 'right')"
|
||||||
|
title="固定到右侧"
|
||||||
|
>
|
||||||
|
→
|
||||||
|
</el-button>
|
||||||
|
<!-- 左固定列:→ 回到不固定列 -->
|
||||||
|
<el-button
|
||||||
|
v-if="section.key === 'fixed-left'"
|
||||||
|
text
|
||||||
|
size="small"
|
||||||
|
class="cfg-fix-btn"
|
||||||
|
@click="setFixed(item.prop, false)"
|
||||||
|
title="回到不固定列"
|
||||||
|
>
|
||||||
|
→
|
||||||
|
</el-button>
|
||||||
|
<!-- 右固定列:← 回到不固定列 -->
|
||||||
|
<el-button
|
||||||
|
v-if="section.key === 'fixed-right'"
|
||||||
|
text
|
||||||
|
size="small"
|
||||||
|
class="cfg-fix-btn"
|
||||||
|
@click="setFixed(item.prop, false)"
|
||||||
|
title="回到不固定列"
|
||||||
|
>
|
||||||
|
←
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
text
|
||||||
|
size="small"
|
||||||
|
class="cfg-move-btn"
|
||||||
|
:disabled="sIdx === 0"
|
||||||
|
@click="moveColumn(item.prop, 'up')"
|
||||||
|
>
|
||||||
|
↑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
text
|
||||||
|
size="small"
|
||||||
|
class="cfg-move-btn"
|
||||||
|
:disabled="sIdx === section.items.length - 1"
|
||||||
|
@click="moveColumn(item.prop, 'down')"
|
||||||
|
>
|
||||||
|
↓
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="section.key === 'scroll'" class="column-config-actions">
|
<div v-if="!section.items.length" class="column-config-empty">
|
||||||
<el-button
|
<span>将列拖到此处固定</span>
|
||||||
text
|
|
||||||
:disabled="sIdx === 0"
|
|
||||||
@click="moveColumn(item.prop, 'up')"
|
|
||||||
>
|
|
||||||
上移
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
text
|
|
||||||
:disabled="sIdx === section.items.length - 1"
|
|
||||||
@click="moveColumn(item.prop, 'down')"
|
|
||||||
>
|
|
||||||
下移
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<div v-else class="column-config-actions column-config-actions--fixed">
|
|
||||||
<span class="column-config-fixed-hint">固定</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -525,10 +565,9 @@ function effectiveColumnFixed(item: ColumnConfigItem, col: ColumnItem): 'left' |
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
function isColumnOrderLocked(item: ColumnConfigItem): boolean {
|
function isColumnOrderLocked(_item: ColumnConfigItem): boolean {
|
||||||
const col = normalizedColumns.value.find((c) => String(c.prop) === item.prop)
|
// 全部列均支持排序(固定列可在其所在区域内拖动排序)
|
||||||
if (!col) return false
|
return false
|
||||||
return effectiveColumnFixed(item, col) !== undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeFromParts(left: ColumnConfigItem[], mid: ColumnConfigItem[], right: ColumnConfigItem[]) {
|
function normalizeFromParts(left: ColumnConfigItem[], mid: ColumnConfigItem[], right: ColumnConfigItem[]) {
|
||||||
@ -536,7 +575,7 @@ function normalizeFromParts(left: ColumnConfigItem[], mid: ColumnConfigItem[], r
|
|||||||
return [...left, ...mid, ...right].map((c) => ({ ...c, order: o++ }))
|
return [...left, ...mid, ...right].map((c) => ({ ...c, order: o++ }))
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 按列定义顺序拆成左固定 / 可排序 / 右固定;中间块按当前 order 排序 */
|
/** 按列定义顺序拆成左固定 / 可排序 / 右固定;各自按当前 order 排序 */
|
||||||
function partitionColumnConfigsTriplet(configs: ColumnConfigItem[]) {
|
function partitionColumnConfigsTriplet(configs: ColumnConfigItem[]) {
|
||||||
const map = new Map(configs.map((c) => [c.prop, c]))
|
const map = new Map(configs.map((c) => [c.prop, c]))
|
||||||
const left: ColumnConfigItem[] = []
|
const left: ColumnConfigItem[] = []
|
||||||
@ -551,7 +590,9 @@ function partitionColumnConfigsTriplet(configs: ColumnConfigItem[]) {
|
|||||||
else if (z === 'right') right.push(item)
|
else if (z === 'right') right.push(item)
|
||||||
else mid.push(item)
|
else mid.push(item)
|
||||||
}
|
}
|
||||||
|
left.sort((a, b) => a.order - b.order)
|
||||||
mid.sort((a, b) => a.order - b.order)
|
mid.sort((a, b) => a.order - b.order)
|
||||||
|
right.sort((a, b) => a.order - b.order)
|
||||||
return { left, mid, right }
|
return { left, mid, right }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,24 +647,24 @@ const displayColumns = computed(() => {
|
|||||||
const columnConfigDialogSections = computed(() => {
|
const columnConfigDialogSections = computed(() => {
|
||||||
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||||
const sections: { key: string; title: string; items: ColumnConfigItem[] }[] = []
|
const sections: { key: string; title: string; items: ColumnConfigItem[] }[] = []
|
||||||
if (left.length) {
|
if (left.length || true) {
|
||||||
sections.push({
|
sections.push({
|
||||||
key: 'fixed-left',
|
key: 'fixed-left',
|
||||||
title: '左侧固定列(仅显示/隐藏,顺序与列定义一致)',
|
title: '左侧固定',
|
||||||
items: left
|
items: left
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (mid.length) {
|
if (mid.length) {
|
||||||
sections.push({
|
sections.push({
|
||||||
key: 'scroll',
|
key: 'scroll',
|
||||||
title: '可调整顺序(拖动或上移/下移)',
|
title: '不固定列',
|
||||||
items: mid
|
items: mid
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (right.length) {
|
if (right.length || true) {
|
||||||
sections.push({
|
sections.push({
|
||||||
key: 'fixed-right',
|
key: 'fixed-right',
|
||||||
title: '右侧固定列(仅显示/隐藏,顺序与列定义一致)',
|
title: '右侧固定',
|
||||||
items: right
|
items: right
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -961,29 +1002,49 @@ function onToggleColumnVisible(prop: string, visible: boolean) {
|
|||||||
persistEditableConfigs()
|
persistEditableConfigs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setFixed(prop: string, position: 'left' | 'right' | false) {
|
||||||
|
// 先把 fixed 赋上,再将目标列 order 置为最大使其排到对应分区末尾
|
||||||
|
const next = editableColumnConfigs.value.map((item) => {
|
||||||
|
if (item.prop !== prop) return item
|
||||||
|
return { ...item, fixed: position, order: Number.MAX_SAFE_INTEGER - 1 }
|
||||||
|
})
|
||||||
|
const normalized = normalizeColumnConfigOrders(next)
|
||||||
|
applyColumnConfigMap(normalized)
|
||||||
|
saveColumnConfig(normalized)
|
||||||
|
}
|
||||||
|
|
||||||
function moveColumn(prop: string, direction: 'up' | 'down') {
|
function moveColumn(prop: string, direction: 'up' | 'down') {
|
||||||
const cfg = editableColumnConfigs.value.find((c) => c.prop === prop)
|
const cfg = editableColumnConfigs.value.find((c) => c.prop === prop)
|
||||||
if (!cfg || isColumnOrderLocked(cfg)) return
|
if (!cfg) return
|
||||||
|
|
||||||
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||||
const i = mid.findIndex((c) => c.prop === prop)
|
// 查找在哪个分区
|
||||||
|
let arr: ColumnConfigItem[]
|
||||||
|
let section: 'left' | 'mid' | 'right'
|
||||||
|
if (left.some((c) => c.prop === prop)) { arr = left; section = 'left' }
|
||||||
|
else if (mid.some((c) => c.prop === prop)) { arr = mid; section = 'mid' }
|
||||||
|
else if (right.some((c) => c.prop === prop)) { arr = right; section = 'right' }
|
||||||
|
else return
|
||||||
|
|
||||||
|
const i = arr.findIndex((c) => c.prop === prop)
|
||||||
if (i === -1) return
|
if (i === -1) return
|
||||||
const j = direction === 'up' ? i - 1 : i + 1
|
const j = direction === 'up' ? i - 1 : i + 1
|
||||||
if (j < 0 || j >= mid.length) return
|
if (j < 0 || j >= arr.length) return
|
||||||
const tmp = mid[i]!
|
const tmp = arr[i]!
|
||||||
mid[i] = mid[j]!
|
arr[i] = arr[j]!
|
||||||
mid[j] = tmp
|
arr[j] = tmp
|
||||||
|
|
||||||
const next = normalizeFromParts(left, mid, right)
|
// 排序后各部分内部顺序已正确,重新生成全局 order
|
||||||
applyColumnConfigMap(next)
|
const allParts = section === 'left'
|
||||||
saveColumnConfig(next)
|
? normalizeFromParts(arr, mid, right)
|
||||||
|
: section === 'right'
|
||||||
|
? normalizeFromParts(left, mid, arr)
|
||||||
|
: normalizeFromParts(left, arr, right)
|
||||||
|
applyColumnConfigMap(allParts)
|
||||||
|
saveColumnConfig(allParts)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onColumnDragStart(e: DragEvent, item: ColumnConfigItem) {
|
function onColumnDragStart(e: DragEvent, item: ColumnConfigItem) {
|
||||||
if (isColumnOrderLocked(item)) {
|
|
||||||
e.preventDefault()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
draggingProp.value = item.prop
|
draggingProp.value = item.prop
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1020,7 +1081,16 @@ function onColumnDragOver(e: DragEvent, item: ColumnConfigItem) {
|
|||||||
if (!draggingProp.value) return
|
if (!draggingProp.value) return
|
||||||
if (draggingProp.value === item.prop) return
|
if (draggingProp.value === item.prop) return
|
||||||
const sourceCfg = editableColumnConfigs.value.find((c) => c.prop === draggingProp.value)
|
const sourceCfg = editableColumnConfigs.value.find((c) => c.prop === draggingProp.value)
|
||||||
if (!sourceCfg || isColumnOrderLocked(sourceCfg) || isColumnOrderLocked(item)) return
|
if (!sourceCfg) return
|
||||||
|
|
||||||
|
// 只允许在同一分区内拖动
|
||||||
|
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||||
|
const inLeft = left.some((c) => c.prop === draggingProp.value)
|
||||||
|
const inRight = right.some((c) => c.prop === draggingProp.value)
|
||||||
|
const targetInLeft = left.some((c) => c.prop === item.prop)
|
||||||
|
const targetInRight = right.some((c) => c.prop === item.prop)
|
||||||
|
if (inLeft !== targetInLeft || inRight !== targetInRight) return
|
||||||
|
|
||||||
dragOverProp.value = item.prop
|
dragOverProp.value = item.prop
|
||||||
|
|
||||||
const listEl = columnConfigListRef.value
|
const listEl = columnConfigListRef.value
|
||||||
@ -1050,27 +1120,37 @@ function onColumnDrop(target: ColumnConfigItem) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sourceCfg = editableColumnConfigs.value.find((c) => c.prop === sourceProp)
|
const sourceCfg = editableColumnConfigs.value.find((c) => c.prop === sourceProp)
|
||||||
if (!sourceCfg || isColumnOrderLocked(sourceCfg) || isColumnOrderLocked(target)) {
|
if (!sourceCfg) {
|
||||||
onColumnDragEnd()
|
onColumnDragEnd()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||||
const sourceIndex = mid.findIndex((item) => item.prop === sourceProp)
|
// 找到源和目标所在分区
|
||||||
const targetIndex = mid.findIndex((item) => item.prop === target.prop)
|
let arr: ColumnConfigItem[]
|
||||||
|
if (left.some((c) => c.prop === sourceProp)) arr = left
|
||||||
|
else if (mid.some((c) => c.prop === sourceProp)) arr = mid
|
||||||
|
else if (right.some((c) => c.prop === sourceProp)) arr = right
|
||||||
|
else { onColumnDragEnd(); return }
|
||||||
|
|
||||||
|
// 目标必须在同一个分区
|
||||||
|
if (!arr.some((c) => c.prop === target.prop)) { onColumnDragEnd(); return }
|
||||||
|
|
||||||
|
const sourceIndex = arr.findIndex((item) => item.prop === sourceProp)
|
||||||
|
const targetIndex = arr.findIndex((item) => item.prop === target.prop)
|
||||||
if (sourceIndex === -1 || targetIndex === -1) {
|
if (sourceIndex === -1 || targetIndex === -1) {
|
||||||
onColumnDragEnd()
|
onColumnDragEnd()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const sourceItem = mid[sourceIndex]
|
const sourceItem = arr[sourceIndex]
|
||||||
if (!sourceItem) {
|
if (!sourceItem) {
|
||||||
onColumnDragEnd()
|
onColumnDragEnd()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
mid.splice(sourceIndex, 1)
|
arr.splice(sourceIndex, 1)
|
||||||
mid.splice(targetIndex, 0, sourceItem)
|
arr.splice(targetIndex, 0, sourceItem)
|
||||||
|
|
||||||
const next = normalizeFromParts(left, mid, right)
|
const next = normalizeFromParts(left, mid, right)
|
||||||
applyColumnConfigMap(next)
|
applyColumnConfigMap(next)
|
||||||
@ -1647,35 +1727,59 @@ watch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
.column-config-list {
|
.column-config-list {
|
||||||
max-height: 380px;
|
display: flex;
|
||||||
overflow: auto;
|
flex-direction: row;
|
||||||
|
gap: 0;
|
||||||
|
max-height: 440px;
|
||||||
border: 1px solid #ebeef5;
|
border: 1px solid #ebeef5;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-config-section {
|
.column-config-section {
|
||||||
border-bottom: 1px solid #e4e7ed;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 0;
|
||||||
|
border-right: 1px solid #e4e7ed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-config-section:last-child {
|
.column-config-section:last-child {
|
||||||
border-bottom: none;
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-config-section-body {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-config-section-title {
|
.column-config-section-title {
|
||||||
padding: 8px 12px 6px;
|
padding: 5px 8px 4px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #606266;
|
color: #606266;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
white-space: nowrap;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-config-section--fixed-left .column-config-section-title {
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-config-section--fixed-right .column-config-section-title {
|
||||||
|
color: #67c23a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-config-item {
|
.column-config-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 8px 12px;
|
padding: 3px 6px;
|
||||||
border-bottom: 1px solid #f2f3f5;
|
border-bottom: 1px solid #f2f3f5;
|
||||||
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-config-section .column-config-item:last-child {
|
.column-config-section .column-config-item:last-child {
|
||||||
@ -1684,7 +1788,14 @@ watch(
|
|||||||
|
|
||||||
.column-config-item.is-fixed-column {
|
.column-config-item.is-fixed-column {
|
||||||
background: #f5f7fa;
|
background: #f5f7fa;
|
||||||
border-left: 3px solid #909399;
|
}
|
||||||
|
|
||||||
|
.column-config-section--fixed-left .column-config-item.is-fixed-column {
|
||||||
|
border-left: 3px solid #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-config-section--fixed-right .column-config-item.is-fixed-column {
|
||||||
|
border-right: 3px solid #67c23a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-config-item.is-draggable {
|
.column-config-item.is-draggable {
|
||||||
@ -1696,12 +1807,40 @@ watch(
|
|||||||
border-top: 1px dashed #409eff;
|
border-top: 1px dashed #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-config-empty {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex: 1;
|
||||||
|
min-height: 60px;
|
||||||
|
color: #c0c4cc;
|
||||||
|
font-size: 12px;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
.drag-handle--locked {
|
.drag-handle--locked {
|
||||||
color: #dcdfe6;
|
color: #dcdfe6;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-config-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-config-actions .cfg-fix-btn,
|
||||||
|
.column-config-actions .cfg-move-btn {
|
||||||
|
padding: 2px 2px;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 1;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
.column-config-actions--fixed {
|
.column-config-actions--fixed {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
@ -1716,11 +1855,16 @@ watch(
|
|||||||
.column-config-main {
|
.column-config-main {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 4px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-config-main .el-checkbox {
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.drag-handle {
|
.drag-handle {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|||||||
@ -269,9 +269,17 @@ async function loadData() {
|
|||||||
function buildWhere() {
|
function buildWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1055,6 +1055,7 @@ export const ORDER_BULK_SEARCH_OPERATORS = ['eq', 'ne', 'like', 'notlike', 'cont
|
|||||||
|
|
||||||
/** 可复用 ScanBox 字段片段(基础信息) */
|
/** 可复用 ScanBox 字段片段(基础信息) */
|
||||||
export const storeScanField = scanBasicField({ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] })
|
export const storeScanField = scanBasicField({ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] })
|
||||||
|
export const orderIdScanField = scanBasicField({ label: '订单ID', value: 'id', type: 'text', operators: ORDER_BULK_SEARCH_OPERATORS, defaultOperator: 'eq' })
|
||||||
export const orderFlagScanField = scanBasicField({ label: '订单标记', value: 'order_flag', type: 'text', operators: ['like', 'notlike'], defaultOperator: 'like' })
|
export const orderFlagScanField = scanBasicField({ label: '订单标记', value: 'order_flag', type: 'text', operators: ['like', 'notlike'], defaultOperator: 'like' })
|
||||||
export const waveNoScanField = scanBasicField({ label: '波次号', value: 'wave_no', type: 'text', operators: ORDER_BULK_SEARCH_OPERATORS, defaultOperator: 'eq' })
|
export const waveNoScanField = scanBasicField({ label: '波次号', value: 'wave_no', type: 'text', operators: ORDER_BULK_SEARCH_OPERATORS, defaultOperator: 'eq' })
|
||||||
export const deliveryOrderCodeScanField = scanBasicField({ label: '发货单号', value: 'delivery_order_code', type: 'text', operators: ORDER_BULK_SEARCH_OPERATORS, defaultOperator: 'eq' })
|
export const deliveryOrderCodeScanField = scanBasicField({ label: '发货单号', value: 'delivery_order_code', type: 'text', operators: ORDER_BULK_SEARCH_OPERATORS, defaultOperator: 'eq' })
|
||||||
@ -1183,6 +1184,7 @@ export function fillStoreScanFieldOptions(availableFields: any[], rawStores: any
|
|||||||
export const deliveryAvailableFields = [
|
export const deliveryAvailableFields = [
|
||||||
// 订单基础信息
|
// 订单基础信息
|
||||||
storeScanField,
|
storeScanField,
|
||||||
|
orderIdScanField,
|
||||||
deliveryOrderCodeScanField,
|
deliveryOrderCodeScanField,
|
||||||
orderFlagScanField,
|
orderFlagScanField,
|
||||||
waveAssignmentScanField,
|
waveAssignmentScanField,
|
||||||
@ -1207,6 +1209,7 @@ export const deliveryAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const deliveryColumns = [
|
export const deliveryColumns = [
|
||||||
|
{ prop: 'id', label: '订单ID', width: '80' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170', fixed: 'left' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170', fixed: 'left' },
|
||||||
{ prop: 'pre_delivery_order_code', label: '前置单号', width: '150' },
|
{ prop: 'pre_delivery_order_code', label: '前置单号', width: '150' },
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
@ -1361,6 +1364,7 @@ export const deliveryOrderToolbarButtons = pickToolbarButtons(deliveryOrderToolb
|
|||||||
export const reviewAvailableFields = [
|
export const reviewAvailableFields = [
|
||||||
// 订单基础信息
|
// 订单基础信息
|
||||||
storeScanField,
|
storeScanField,
|
||||||
|
orderIdScanField,
|
||||||
deliveryOrderCodeScanField,
|
deliveryOrderCodeScanField,
|
||||||
waveAssignmentScanField,
|
waveAssignmentScanField,
|
||||||
waveNoScanField,
|
waveNoScanField,
|
||||||
@ -1380,6 +1384,7 @@ export const reviewAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const reviewColums = [
|
export const reviewColums = [
|
||||||
|
{ prop: 'id', label: '订单ID', width: '80' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
{ prop: 'wave_no', label: '波次号', width: '170' },
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
||||||
@ -1504,6 +1509,7 @@ export const outboundToolbarButtons = pickToolbarButtons(outboundToolbarButtonKe
|
|||||||
export const pendingAvailableFields = [
|
export const pendingAvailableFields = [
|
||||||
// 订单基础信息
|
// 订单基础信息
|
||||||
storeScanField,
|
storeScanField,
|
||||||
|
orderIdScanField,
|
||||||
pendingOrderCodeScanField,
|
pendingOrderCodeScanField,
|
||||||
orderFlagScanField,
|
orderFlagScanField,
|
||||||
waveAssignmentScanField,
|
waveAssignmentScanField,
|
||||||
@ -1535,6 +1541,7 @@ export const pendingAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const pendingCloums = [
|
export const pendingCloums = [
|
||||||
|
{ prop: 'id', label: '订单ID', width: '80' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' ,fixed: 'left'},
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170' ,fixed: 'left'},
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
{ prop: 'wave_no', label: '波次号', width: '170' },
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
||||||
@ -1764,6 +1771,7 @@ export const workbenchStatusOptions = [
|
|||||||
|
|
||||||
export const workbenchAvailableFields = [
|
export const workbenchAvailableFields = [
|
||||||
// 订单基础信息
|
// 订单基础信息
|
||||||
|
orderIdScanField,
|
||||||
deliveryOrderCodeScanField,
|
deliveryOrderCodeScanField,
|
||||||
waveAssignmentScanField,
|
waveAssignmentScanField,
|
||||||
waveNoScanField,
|
waveNoScanField,
|
||||||
@ -1776,6 +1784,7 @@ export const workbenchAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const workbenchColumns = [
|
export const workbenchColumns = [
|
||||||
|
{ prop: 'id', label: '订单ID', width: '80' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', minWidth: 160 },
|
{ prop: 'delivery_order_code', label: '发货单号', minWidth: 160 },
|
||||||
{ prop: 'wave_no', label: '波次号', minWidth: 160 },
|
{ prop: 'wave_no', label: '波次号', minWidth: 160 },
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: 260 },
|
{ prop: 'order_flag', label: '订单标记', minWidth: 260 },
|
||||||
@ -1820,6 +1829,7 @@ export const workbenchBadgeItems = [
|
|||||||
export const expectionOrderAvailableFields = [
|
export const expectionOrderAvailableFields = [
|
||||||
// 订单基础信息
|
// 订单基础信息
|
||||||
storeScanField,
|
storeScanField,
|
||||||
|
orderIdScanField,
|
||||||
exceptionOrderCodeScanField,
|
exceptionOrderCodeScanField,
|
||||||
deliveryOrderCodeScanField,
|
deliveryOrderCodeScanField,
|
||||||
orderFlagScanField,
|
orderFlagScanField,
|
||||||
@ -1844,6 +1854,7 @@ export const expectionOrderAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const expectionColumns = [
|
export const expectionColumns = [
|
||||||
|
{ prop: 'id', label: '订单ID', width: '80' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
{ prop: 'wave_no', label: '波次号', width: '170' },
|
||||||
{ prop: 'sys_platform_name', label: '来源', width: '120' },
|
{ prop: 'sys_platform_name', label: '来源', width: '120' },
|
||||||
@ -1926,6 +1937,7 @@ export const expectionOrderbuttonList: any[] = [
|
|||||||
export const archiveAvailableFields = [
|
export const archiveAvailableFields = [
|
||||||
// 订单基础信息
|
// 订单基础信息
|
||||||
storeScanField,
|
storeScanField,
|
||||||
|
orderIdScanField,
|
||||||
exceptionOrderCodeScanField,
|
exceptionOrderCodeScanField,
|
||||||
deliveryOrderCodeScanField,
|
deliveryOrderCodeScanField,
|
||||||
waveAssignmentScanField,
|
waveAssignmentScanField,
|
||||||
@ -1946,7 +1958,7 @@ export const archiveAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const archiveColumns = [
|
export const archiveColumns = [
|
||||||
{ prop: 'id', label: 'ID', width: '80' },
|
{ prop: 'id', label: '订单ID', width: '80' },
|
||||||
{ prop: 'order_code', label: '发货单号', width: '180' },
|
{ prop: 'order_code', label: '发货单号', width: '180' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '160' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '160' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '160' },
|
{ prop: 'wave_no', label: '波次号', width: '160' },
|
||||||
|
|||||||
@ -264,9 +264,17 @@ async function loadData() {
|
|||||||
function buildWhere() {
|
function buildWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -420,9 +420,17 @@ async function loadData() {
|
|||||||
function buildWhere() {
|
function buildWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -264,9 +264,17 @@ async function loadData() {
|
|||||||
function buildWhere() {
|
function buildWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -685,9 +685,18 @@ async function loadData() {
|
|||||||
function buildExportWhere() {
|
function buildExportWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
// 输入纯数字时同时按订单ID和发货单号搜索
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -272,9 +272,17 @@ function sanitizeOutboundListWhere(where: Record<string, any>) {
|
|||||||
function buildWhere() {
|
function buildWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -594,9 +594,17 @@ function buildExportWhere() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -342,9 +342,17 @@ async function loadData() {
|
|||||||
function buildExportWhere() {
|
function buildExportWhere() {
|
||||||
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
|
const q = quickSearch.value.trim()
|
||||||
|
if (/^\d+$/.test(q)) {
|
||||||
|
where.id = {
|
||||||
|
operator: 'eq',
|
||||||
|
value: Number(q),
|
||||||
|
type: 'text'
|
||||||
|
}
|
||||||
|
}
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
value: quickSearch.value,
|
value: q,
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user