Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
topsun-baoshen-excel
Commits
870072ef
Commit
870072ef
authored
Jan 12, 2025
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加复制引入
parent
8a72c861
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
216 additions
and
179 deletions
+216
-179
useOrderChangeCopy.js
src/hooks/useOrderChangeCopy.js
+26
-0
OrderChange.vue
src/views/order/orderChange/OrderChange.vue
+36
-10
VarChange.vue
src/views/var/varChange/VarChange.vue
+154
-169
No files found.
src/hooks/useOrderChangeCopy.js
0 → 100644
View file @
870072ef
import
{
computed
,
reactive
,
toRefs
}
from
'vue'
import
{
ElMessage
}
from
'element-plus'
export
function
useOrderChangeCopy
(
api
,
beforePaste
)
{
const
state
=
reactive
({
// 复制信息
copyInfo
:
[]
})
// 是否复制
const
isCopying
=
computed
(()
=>
!!
state
.
copyInfo
.
length
)
// 复制
const
handleCopy
=
(
info
)
=>
{
if
(
!
info
?.
length
)
{
return
ElMessage
.
warning
(
'没有可以复制的配置!'
)
}
state
.
copyInfo
=
JSON
.
parse
(
JSON
.
stringify
(
info
))
ElMessage
.
success
(
'复制成功!'
)
}
return
{
...
toRefs
(
state
),
isCopying
,
handleCopy
,
}
}
src/views/order/orderChange/OrderChange.vue
View file @
870072ef
...
@@ -13,7 +13,12 @@
...
@@ -13,7 +13,12 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建时间"
>
<el-form-item
label=
"创建时间"
>
<el-date-picker
v-model=
"queryParams.createTime"
type=
'daterange'
value-format=
"YYYY-MM-DD"
placeholder=
"选择创建时间"
></el-date-picker>
<el-date-picker
v-model=
"queryParams.createTime"
type=
"daterange"
value-format=
"YYYY-MM-DD"
placeholder=
"选择创建时间"
></el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建人"
>
<el-form-item
label=
"创建人"
>
<el-input
v-model=
"queryParams.createby_dict"
placeholder=
""
>
<el-input
v-model=
"queryParams.createby_dict"
placeholder=
""
>
...
@@ -108,8 +113,8 @@
...
@@ -108,8 +113,8 @@
<
template
#
default=
"{ row }"
>
{{
row
.
sortNum
}}
</
template
>
<
template
#
default=
"{ row }"
>
{{
row
.
sortNum
}}
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
title=
"sheet页"
width=
"120"
>
<vxe-column
title=
"sheet页"
width=
"120"
>
<
template
#
default=
"{ row }"
>
{{
row
[
'sheet页'
]
}}
</
template
>
<
template
#
default=
"{ row }"
>
{{
row
[
'sheet页'
]
}}
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
title=
"数据区"
width=
"120"
>
<vxe-column
title=
"数据区"
width=
"120"
>
<
template
#
default=
"{ row }"
>
{{
row
[
'数据区'
]
}}
</
template
>
<
template
#
default=
"{ row }"
>
{{
row
[
'数据区'
]
}}
</
template
>
</vxe-column>
</vxe-column>
...
@@ -126,7 +131,7 @@
...
@@ -126,7 +131,7 @@
</template> -->
</template> -->
<!-- 转换下使用 -->
<!-- 转换下使用 -->
<
template
>
<
template
>
<vxe-colgroup
v-for=
"item in tableTitle"
:key=
"item"
:title=
"item"
>
<vxe-colgroup
v-for=
"item in tableTitle"
:key=
"item"
:title=
"item"
>
<vxe-column
:title=
"item"
:field=
"item"
width=
"200"
>
<vxe-column
:title=
"item"
:field=
"item"
width=
"200"
>
<template
#
header
>
<template
#
header
>
...
@@ -135,7 +140,7 @@
...
@@ -135,7 +140,7 @@
<span>
{{
cf
.
orderFiled
.
fliedTitle
}}
</span>
<span>
{{
cf
.
orderFiled
.
fliedTitle
}}
</span>
</
template
>
</
template
>
<!-- <span>{{ allMapConfigs[item]?.orderFiled.fliedTitle || '' }}</span> -->
<!-- <span>{{ allMapConfigs[item]?.orderFiled.fliedTitle || '' }}</span> -->
<el-icon
><Setting
/></el-icon>
<el-icon><Setting
/></el-icon>
</div>
</div>
</template>
</template>
</vxe-column>
</vxe-column>
...
@@ -164,10 +169,10 @@
...
@@ -164,10 +169,10 @@
</el-popover>
</el-popover>
<
template
#
footer
>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"onCopy"
>
复制
</el-button>
<el-button
type=
"primary"
v-if=
"isCopying"
@
click=
"onPaste"
>
引入
</el-button>
<!--
<el-button
@
click=
"confirmChange"
v-if=
"currentRow.status == 'un_convert'"
>
确认转换
</el-button>
-->
<!--
<el-button
@
click=
"confirmChange"
v-if=
"currentRow.status == 'un_convert'"
>
确认转换
</el-button>
-->
<el-button
@
click=
"saveOrderField"
type=
"primary"
<el-button
@
click=
"saveOrderField"
type=
"primary"
>
保存
</el-button>
>
保存
</el-button
>
</
template
>
</
template
>
</vxe-modal>
</vxe-modal>
...
@@ -214,7 +219,6 @@
...
@@ -214,7 +219,6 @@
<CustomerModal
v-model:visible=
"visible"
@
confirm=
"confirmCustomer"
/>
<CustomerModal
v-model:visible=
"visible"
@
confirm=
"confirmCustomer"
/>
<UserModal
v-model:visible=
"visibleUserModal"
@
confirm=
"confirmUser"
/>
<UserModal
v-model:visible=
"visibleUserModal"
@
confirm=
"confirmUser"
/>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -250,6 +254,7 @@ import { saveAs } from 'file-saver'
...
@@ -250,6 +254,7 @@ import { saveAs } from 'file-saver'
import
{
uploadFile
}
from
'@/api/excel'
import
{
uploadFile
}
from
'@/api/excel'
import
CustomerModal
from
'@/components/CustomerModal/CustomerModal.vue'
import
CustomerModal
from
'@/components/CustomerModal/CustomerModal.vue'
import
UserModal
from
'@/components/UserModal/UserModal.vue'
import
UserModal
from
'@/components/UserModal/UserModal.vue'
import
{
useOrderChangeCopy
}
from
'@/hooks/useOrderChangeCopy'
const
visible
=
ref
(
false
)
const
visible
=
ref
(
false
)
const
visibleUserModal
=
ref
(
false
)
const
visibleUserModal
=
ref
(
false
)
...
@@ -259,6 +264,7 @@ const loading = ref(false)
...
@@ -259,6 +264,7 @@ const loading = ref(false)
const
importVisible
=
ref
(
false
)
const
importVisible
=
ref
(
false
)
const
excelChangeStore
=
useExcelChangeStore
()
const
excelChangeStore
=
useExcelChangeStore
()
const
{
getAllMapConfigs
}
=
storeToRefs
(
excelChangeStore
)
const
{
getAllMapConfigs
}
=
storeToRefs
(
excelChangeStore
)
const
{
copyInfo
,
isCopying
,
handleCopy
}
=
useOrderChangeCopy
()
/**查询参数 */
/**查询参数 */
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
status
:
''
,
status
:
''
,
...
@@ -445,7 +451,7 @@ const toDetail = async (row: any) => {
...
@@ -445,7 +451,7 @@ const toDetail = async (row: any) => {
configs
[
item
.
title
]
=
item
configs
[
item
.
title
]
=
item
})
})
// 排除通过循环不显示的column
// 排除通过循环不显示的column
const
excludeTitles
=
[
'sortNum'
,
'数据区'
,
'expendData'
,
'sheet页'
]
const
excludeTitles
=
[
'sortNum'
,
'数据区'
,
'expendData'
,
'sheet页'
]
detailTable
.
value
=
res
detailTable
.
value
=
res
tableTitle
.
value
=
titles
.
filter
((
v
)
=>
!
excludeTitles
.
includes
(
v
))
tableTitle
.
value
=
titles
.
filter
((
v
)
=>
!
excludeTitles
.
includes
(
v
))
detailVisible
.
value
=
true
detailVisible
.
value
=
true
...
@@ -532,6 +538,26 @@ const confirmUser = (list: any) => {
...
@@ -532,6 +538,26 @@ const confirmUser = (list: any) => {
}
}
}
}
const
onCopy
=
()
=>
{
const
confs
=
Object
.
values
(
getAllMapConfigs
.
value
).
filter
(
(
v
)
=>
v
.
title
!==
''
&&
!!
v
.
orderFiledConfs
.
length
)
handleCopy
(
confs
)
}
const
onPaste
=
()
=>
{
// 将复制的配置信息,一条一条设置
copyInfo
.
forEach
((
item
:
any
)
=>
{
item
.
templateFileId
=
currentRow
.
templateFileId
item
.
excelOrderFiledConfId
=
''
excelChangeStore
.
setSingleFieldMap
(
item
)
})
// 自动保存
saveOrderField
()
}
const
onReset
=
()
=>
{
const
onReset
=
()
=>
{
queryParams
.
status
=
''
queryParams
.
status
=
''
}
}
...
...
src/views/var/varChange/VarChange.vue
View file @
870072ef
This diff is collapsed.
Click to expand it.
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