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
b6faadf5
Commit
b6faadf5
authored
Mar 14, 2025
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 表格右键复制全部
parent
3db67f9c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
16 deletions
+103
-16
components.d.ts
+1
-0
src/components/TableRightMenu.vue
+62
-0
src/components/TableView.vue
+4
-11
src/views/order/pod/index.vue
+36
-5
No files found.
components.d.ts
View file @
b6faadf5
...
...
@@ -52,6 +52,7 @@ declare module 'vue' {
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
ShipmentOrderDetail
:
typeof
import
(
'./src/components/ShipmentOrderDetail.vue'
)[
'default'
]
SplitDiv
:
typeof
import
(
'./src/components/splitDiv/splitDiv.vue'
)[
'default'
]
TableRightMenu
:
typeof
import
(
'./src/components/TableRightMenu.vue'
)[
'default'
]
TableView
:
typeof
import
(
'./src/components/TableView.vue'
)[
'default'
]
UploadImage
:
typeof
import
(
'./src/components/UploadImage.vue'
)[
'default'
]
WangEditor
:
typeof
import
(
'./src/components/WangEditor.vue'
)[
'default'
]
...
...
src/components/TableRightMenu.vue
0 → 100644
View file @
b6faadf5
<
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 @
b6faadf5
...
...
@@ -26,16 +26,13 @@
></ElTableColumn>
<template
v-for=
"column in columns"
:key=
"column.key"
>
<ElTableColumn
v-if=
"
column.type === 'expand'
"
v-if=
"column.type === 'expand'"
v-bind=
"column"
header-align=
"center"
>
<!-- 当type等于expand时, 配置通过h函数渲染、txs语法或者插槽自定义内容 -->
<template
#
default=
"scope"
>
<div
@
contextmenu
.
prevent=
"(e) => $emit('rightClick', e)"
>
<div>
<component
:is=
"column.render"
v-if=
"column.render"
...
...
@@ -53,11 +50,7 @@
</ElTableColumn>
<RenderColumn
v-else
:col=
"column"
>
<
template
v-for=
"(_, name) of slots"
#[
name
]="
scope
"
>
<slot
@
contextmenu
.
prevent=
"(e:MouseEvent)=>$emit('rightClick',e)"
:name=
"name"
v-bind=
"scope"
/>
<slot
:name=
"name"
v-bind=
"scope"
/>
</
template
>
</RenderColumn>
</template>
...
...
@@ -91,7 +84,7 @@ defineProps({
selectionable
:
{
type
:
Boolean
,
default
:
false
,
}
}
,
})
const
attrs
=
useAttrs
()
const
slots
=
useSlots
()
as
Record
<
string
,
Slot
>
...
...
src/views/order/pod/index.vue
View file @
b6faadf5
...
...
@@ -395,7 +395,9 @@
:
content
=
"'货号'"
placement
=
"bottom"
>
<
span
>
货号:
{{
cardItem
?.
supplierItemNo
||
'--'
}}
<
/span
>
<
span
>
货号:
{{
cardItem
?.
supplierItemNo
||
'--'
}}
<
/spa
n
>
<
/el-tooltip
>
<
/el-col
>
<
/el-row
>
...
...
@@ -425,7 +427,7 @@
<
el
-
col
:
span
=
"12"
:
offset
=
"0"
style
=
"white-space: nowrap;
text-align: right;
"
style
=
"white-space: nowrap;
text-align: right
"
>
<
span
:
title
=
"`店铺单号:${cardItem?.shopNumber
}
`"
...
...
@@ -489,7 +491,7 @@
default
-
expand
-
all
:
span
-
method
=
"arraySpanMethod"
@
selection
-
change
=
"handleSelectionChange"
@
right
-
click
=
"rightClick
"
@
contextmenu
.
prevent
=
"handleContextMenu
"
>
<
template
#
expand
=
"{ row
}
"
>
<
div
v
-
if
=
"row.productList"
class
=
"table-expand"
>
...
...
@@ -863,9 +865,14 @@
:
type
=
"fastType"
:
detail
-
data
=
"detailData"
:
current
-
status
=
"status"
@
on
S
uccess
=
"handleSuccess"
@
on
-
s
uccess
=
"handleSuccess"
@
close
=
"fastClose"
><
/fastProduction
>
<
table
-
right
-
menu
ref
=
"tableRightMenuRef"
:
table
-
right
-
menu
-
visible
=
"tableRightMenuVisible"
@
on
-
copy
-
change
=
"onCopyChange"
/>
<
/template
>
<
script
setup
lang
=
"tsx"
>
// refreshJMProductInfo,reasonInvalidationApi,
...
...
@@ -1807,14 +1814,38 @@ const invalidOrder = async (row: ProductList) => {
}
}
)
}
const
tableRightMenuVisible
=
ref
(
false
)
const
tableRightMenuRef
=
ref
()
const
onCopyChange
=
(
type
:
string
)
=>
{
if
(
type
===
'copy_shop_number'
)
{
const
shopNumberList
=
[]
for
(
const
item
of
tableData
.
value
)
{
if
(
item
.
productList
)
{
shopNumberList
.
push
(...
item
.
productList
.
map
((
sub
)
=>
sub
.
shopNumber
))
}
}
copy
(
shopNumberList
.
join
(
','
))
}
}
const
handleContextMenu
=
(
e
:
MouseEvent
)
=>
{
tableRightMenuVisible
.
value
=
true
tableRightMenuRef
.
value
?.
setRightMenuOptions
({
contextMenuX
:
e
.
clientX
,
contextMenuY
:
e
.
clientY
,
}
)
}
const
listenerClick
=
()
=>
{
tableRightMenuVisible
.
value
=
false
}
onMounted
(()
=>
{
document
.
addEventListener
(
'keydown'
,
listenerKeydown
)
document
.
addEventListener
(
'click'
,
listenerClick
)
getLogisticsList
()
loadTabData
()
}
)
onBeforeUnmount
(()
=>
{
document
.
removeEventListener
(
'keydown'
,
listenerKeydown
)
document
.
removeEventListener
(
'click'
,
listenerClick
)
}
)
<
/script
>
<
style
lang
=
"scss"
scoped
>
...
...
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