Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
ce3d6f24
Commit
ce3d6f24
authored
Jun 12, 2025
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: POD US order add contextmenu
parent
14ddd000
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
64 deletions
+127
-64
components.d.ts
+2
-0
src/components/TableRightClickMenu.vue
+90
-0
src/components/TableRightMenu.vue
+0
-62
src/components/TableView.vue
+26
-1
src/views/order/podUs/index.vue
+9
-1
No files found.
components.d.ts
View file @
ce3d6f24
...
@@ -58,12 +58,14 @@ declare module 'vue' {
...
@@ -58,12 +58,14 @@ declare module 'vue' {
LogList
:
typeof
import
(
'./src/components/LogList.vue'
)[
'default'
]
LogList
:
typeof
import
(
'./src/components/LogList.vue'
)[
'default'
]
NavMenu
:
typeof
import
(
'./src/components/NavMenu.vue'
)[
'default'
]
NavMenu
:
typeof
import
(
'./src/components/NavMenu.vue'
)[
'default'
]
RenderColumn
:
typeof
import
(
'./src/components/RenderColumn.vue'
)[
'default'
]
RenderColumn
:
typeof
import
(
'./src/components/RenderColumn.vue'
)[
'default'
]
RightClickMenu
:
typeof
import
(
'./src/components/TableRightClickMenu.vue'
)[
'default'
]
RouterLink
:
typeof
import
(
'vue-router'
)[
'RouterLink'
]
RouterLink
:
typeof
import
(
'vue-router'
)[
'RouterLink'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
Select
:
typeof
import
(
'./src/components/Form.vue/Select.vue'
)[
'default'
]
Select
:
typeof
import
(
'./src/components/Form.vue/Select.vue'
)[
'default'
]
ShipmentOrderDetail
:
typeof
import
(
'./src/components/ShipmentOrderDetail.vue'
)[
'default'
]
ShipmentOrderDetail
:
typeof
import
(
'./src/components/ShipmentOrderDetail.vue'
)[
'default'
]
SplitDiv
:
typeof
import
(
'./src/components/splitDiv/splitDiv.vue'
)[
'default'
]
SplitDiv
:
typeof
import
(
'./src/components/splitDiv/splitDiv.vue'
)[
'default'
]
'Switch '
:
typeof
import
(
'./src/components/Form.vue/Switch .vue'
)[
'default'
]
'Switch '
:
typeof
import
(
'./src/components/Form.vue/Switch .vue'
)[
'default'
]
TableRightClickMenu
:
typeof
import
(
'./src/components/TableRightClickMenu.vue'
)[
'default'
]
TableRightMenu
:
typeof
import
(
'./src/components/TableRightMenu.vue'
)[
'default'
]
TableRightMenu
:
typeof
import
(
'./src/components/TableRightMenu.vue'
)[
'default'
]
TableView
:
typeof
import
(
'./src/components/TableView.vue'
)[
'default'
]
TableView
:
typeof
import
(
'./src/components/TableView.vue'
)[
'default'
]
UploadExcel
:
typeof
import
(
'./src/components/UploadExcel.vue'
)[
'default'
]
UploadExcel
:
typeof
import
(
'./src/components/UploadExcel.vue'
)[
'default'
]
...
...
src/components/TableRightClickMenu.vue
0 → 100644
View file @
ce3d6f24
<
template
>
<div
v-show=
"visible"
class=
"right-click-menu"
:style=
"
{ left: position.x + 'px', top: position.y + 'px' }"
>
<div
class=
"menu-item"
@
click=
"handleSelectAll"
>
全选
</div>
<div
class=
"menu-item"
@
click=
"handleUnselectAll"
>
取消全选
</div>
<div
class=
"menu-item"
@
click=
"handleCopyShopNumbers"
>
复制店铺单号
</div>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
defineExpose
,
onMounted
,
onUnmounted
}
from
'vue'
import
type
{
TableInstance
}
from
'element-plus'
const
visible
=
ref
(
false
)
const
position
=
ref
({
x
:
0
,
y
:
0
})
const
tableRef
=
ref
<
TableInstance
>
()
const
emit
=
defineEmits
([
'copyShopNumbers'
])
const
setPosition
=
({
x
,
y
,
el
}:
{
x
:
number
;
y
:
number
;
el
:
TableInstance
})
=>
{
position
.
value
=
{
x
,
y
}
visible
.
value
=
true
tableRef
.
value
=
el
}
const
handleSelectAll
=
()
=>
{
if
(
tableRef
.
value
)
{
tableRef
.
value
.
toggleAllSelection
()
}
visible
.
value
=
false
}
const
handleUnselectAll
=
()
=>
{
if
(
tableRef
.
value
)
{
tableRef
.
value
.
clearSelection
()
}
visible
.
value
=
false
}
const
handleCopyShopNumbers
=
()
=>
{
emit
(
'copyShopNumbers'
)
visible
.
value
=
false
}
// 点击其他地方关闭菜单
const
handleClickOutside
=
()
=>
{
if
(
visible
.
value
)
{
visible
.
value
=
false
}
}
// 监听全局点击事件
onMounted
(()
=>
{
document
.
addEventListener
(
'click'
,
handleClickOutside
)
})
onUnmounted
(()
=>
{
document
.
removeEventListener
(
'click'
,
handleClickOutside
)
})
defineExpose
({
setPosition
})
</
script
>
<
style
scoped
>
.right-click-menu
{
position
:
fixed
;
background
:
white
;
border
:
1px
solid
#e4e7ed
;
border-radius
:
4px
;
box-shadow
:
0
2px
12px
0
rgba
(
0
,
0
,
0
,
0.1
);
z-index
:
3000
;
}
.menu-item
{
padding
:
8px
16px
;
cursor
:
pointer
;
font-size
:
14px
;
color
:
#606266
;
}
.menu-item
:hover
{
background-color
:
#f5f7fa
;
color
:
#409eff
;
}
</
style
>
\ No newline at end of file
src/components/TableRightMenu.vue
deleted
100644 → 0
View file @
14ddd000
<
template
>
<div
v-if=
"tableRightMenuVisible"
class=
"table-right-menu"
:style=
"
{
left: rightMenuOptions.contextMenuX + 'px',
top: rightMenuOptions.contextMenuY + 'px',
}"
>
<div
class=
"table-right-menu-item"
@
click=
"handleChange('copy_shop_number')"
>
<span>
复制店铺单号
</span>
</div>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
defineProps
({
tableRightMenuVisible
:
{
type
:
Boolean
,
default
:
false
,
},
})
const
emit
=
defineEmits
([
'onCopyChange'
])
const
handleChange
=
(
type
:
string
)
=>
{
emit
(
'onCopyChange'
,
type
)
}
const
rightMenuOptions
=
ref
({
contextMenuX
:
0
,
contextMenuY
:
0
,
})
const
setRightMenuOptions
=
(
options
:
{
contextMenuX
:
number
contextMenuY
:
number
})
=>
{
rightMenuOptions
.
value
=
options
}
defineExpose
({
setRightMenuOptions
,
})
</
script
>
<
style
lang=
"scss"
scoped
>
.table-right-menu
{
position
:
fixed
;
z-index
:
1000
;
border
:
1px
solid
#ccc
;
box-shadow
:
0
0
10px
0
rgba
(
0
,
0
,
0
,
0.1
);
padding
:
6px
;
}
.table-right-menu-item
{
padding
:
5px
;
cursor
:
pointer
;
font-size
:
14px
;
&:hover
{
background-color
:
#f0f0f0
;
}
}
</
style
>
src/components/TableView.vue
View file @
ce3d6f24
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
v-bind=
"attrs"
v-bind=
"attrs"
header-align=
"center"
header-align=
"center"
height=
"100%"
height=
"100%"
@
contextmenu
.
prevent=
"handleContextMenu"
>
>
<ElTableColumn
<ElTableColumn
v-if=
"selectionable"
v-if=
"selectionable"
...
@@ -57,14 +58,23 @@
...
@@ -57,14 +58,23 @@
</RenderColumn>
</RenderColumn>
</template>
</template>
</ElTable>
</ElTable>
<RightClickMenu
@
copy-shop-numbers=
"emit('copyShopNumbers')"
ref=
"rightMenuRef"
/>
</div>
</div>
</template>
</template>
<
script
setup
lang=
"tsx"
generic=
"T"
>
<
script
setup
lang=
"tsx"
generic=
"T"
>
import
{
type
Slot
,
useAttrs
,
useSlots
,
type
PropType
,
shallowRef
}
from
'vue'
import
{
type
Slot
,
useAttrs
,
useSlots
,
type
PropType
,
shallowRef
}
from
'vue'
import
type
{
CustomColumn
}
from
'@/types/table'
import
type
{
CustomColumn
}
from
'@/types/table'
import
RenderColumn
from
'./RenderColumn.vue'
import
RenderColumn
from
'./RenderColumn.vue'
import
RightClickMenu
from
'./TableRightClickMenu.vue'
import
{
ElTable
}
from
'element-plus'
import
{
ElTable
}
from
'element-plus'
const
tableRef
=
shallowRef
<
InstanceType
<
typeof
ElTable
>>
()
import
type
{
TableInstance
}
from
'element-plus'
const
tableRef
=
shallowRef
<
TableInstance
>
()
const
rightMenuRef
=
shallowRef
<
InstanceType
<
typeof
RightClickMenu
>>
()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
defineProps
({
defineProps
({
paginatedData
:
{
paginatedData
:
{
...
@@ -88,14 +98,28 @@ defineProps({
...
@@ -88,14 +98,28 @@ defineProps({
default
:
false
,
default
:
false
,
},
},
})
})
const
attrs
=
useAttrs
()
const
attrs
=
useAttrs
()
const
slots
=
useSlots
()
as
Record
<
string
,
Slot
>
const
slots
=
useSlots
()
as
Record
<
string
,
Slot
>
const
emit
=
defineEmits
([
'copyShopNumbers'
])
const
handleContextMenu
=
(
e
:
MouseEvent
)
=>
{
if
(
rightMenuRef
.
value
&&
tableRef
.
value
)
{
rightMenuRef
.
value
.
setPosition
({
x
:
e
.
clientX
,
y
:
e
.
clientY
,
el
:
tableRef
.
value
,
})
}
}
const
setCurrentRow
=
(
row
:
T
)
=>
{
const
setCurrentRow
=
(
row
:
T
)
=>
{
tableRef
.
value
?.
setCurrentRow
(
row
)
tableRef
.
value
?.
setCurrentRow
(
row
)
}
}
const
toggleRowSelection
=
(
row
:
T
,
selected
:
boolean
=
true
)
=>
{
const
toggleRowSelection
=
(
row
:
T
,
selected
:
boolean
=
true
)
=>
{
tableRef
.
value
?.
toggleRowSelection
(
row
,
selected
)
tableRef
.
value
?.
toggleRowSelection
(
row
,
selected
)
}
}
const
clearSelection
=
()
=>
{
const
clearSelection
=
()
=>
{
tableRef
.
value
?.
clearSelection
()
tableRef
.
value
?.
clearSelection
()
}
}
...
@@ -112,5 +136,6 @@ defineExpose({
...
@@ -112,5 +136,6 @@ defineExpose({
.table-view
{
.table-view
{
height
:
100%
;
height
:
100%
;
overflow
:
hidden
;
overflow
:
hidden
;
position
:
relative
;
}
}
</
style
>
</
style
>
src/views/order/podUs/index.vue
View file @
ce3d6f24
...
@@ -364,6 +364,7 @@
...
@@ -364,6 +364,7 @@
:paginated-data=
"tableData"
:paginated-data=
"tableData"
:cell-style=
"onCellStyle"
:cell-style=
"onCellStyle"
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
@
copy-shop-numbers=
"handleCopyShopNumbers"
>
>
<
template
#
goods=
"{ row }"
>
<
template
#
goods=
"{ row }"
>
<div
class=
"goods-info-box"
>
<div
class=
"goods-info-box"
>
...
@@ -2486,7 +2487,14 @@ onMounted(() => {
...
@@ -2486,7 +2487,14 @@ onMounted(() => {
loadProductionClient
()
loadProductionClient
()
loadWarehouseList
()
loadWarehouseList
()
}
)
}
)
const
handleCopyShopNumbers
=
()
=>
{
const
shopNumbers
=
(
tableData
.
value
as
PodUsOrderListData
[])
.
map
((
item
)
=>
item
.
shopNumber
)
.
join
(
','
)
navigator
.
clipboard
.
writeText
(
shopNumbers
).
then
(()
=>
{
ElMessage
.
success
(
'店铺单号已复制到剪贴板'
)
}
)
}
const
handleExceptionCommand
=
(
command
:
number
)
=>
{
const
handleExceptionCommand
=
(
command
:
number
)
=>
{
exceptionStatus
.
value
=
command
exceptionStatus
.
value
=
command
search
()
search
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment