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
03739da2
Commit
03739da2
authored
Jun 01, 2025
by
tanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加清除特殊字符的处理
parent
d4b3bc1a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
2 deletions
+82
-2
scripts.ts
src/api/scripts.ts
+12
-0
excel.ts
src/utils/excel.ts
+4
-0
index.vue
src/views/order/scripts/index.vue
+65
-2
SetAttch.vue
src/views/var/varExcel/components/SetAttch/SetAttch.vue
+1
-0
No files found.
src/api/scripts.ts
View file @
03739da2
...
...
@@ -53,3 +53,15 @@ export const deleteExcelScripts = (ids: any) => {
export
const
testExcelScripts
=
(
data
:
any
)
=>
{
return
axios
.
post
(
'/api/exlScript/testScript'
,
data
)
}
/**
* 清除特殊字符
* @param ids
* @returns
*/
export
const
clearSpecialCharacter
=
(
title
:
any
)
=>
{
return
axios
.
get
(
'/api/exlScript/clearSpecialCharacters'
,
{
params
:
{
title
},
headers
:
formHeader
})
}
\ No newline at end of file
src/utils/excel.ts
View file @
03739da2
...
...
@@ -79,6 +79,10 @@ export function handleRangeTitle(range: any) {
* 横向 -> row 不变 纵向 -> column 不变
*
*/
console
.
log
(
"isVertical = "
,
isVertical
)
console
.
log
(
"rowLen = "
,
rowLen
)
console
.
log
(
"columnLen = "
,
columnLen
)
for
(
let
c
=
0
;
c
<
(
isVertical
?
rowLen
:
columnLen
);
c
++
)
{
const
title
=
{
title
:
''
,
...
...
src/views/order/scripts/index.vue
View file @
03739da2
...
...
@@ -22,6 +22,7 @@
<vxe-toolbar>
<template
#
buttons
>
<!--
<vxe-button
@
click=
"allAlign = 'left'"
>
居左
</vxe-button>
-->
<el-button
type=
"primary"
@
click=
"showClear = true"
>
特殊符号处理
</el-button>
<el-button
type=
"primary"
@
click=
"showEdit = true"
>
新增
</el-button>
<el-button
type=
"danger"
@
click=
"removeRows"
>
删除
</el-button>
<el-button
type=
"info"
@
click=
"showHelp"
>
帮助
</el-button>
...
...
@@ -59,6 +60,41 @@
</vxe-pager>
</div>
<vxe-modal
resize
show-footer
show-confirm-button
show-cancel-button
show-maximize
v-model=
"showClear"
title=
"清除特殊符号"
height=
"400"
width=
"800"
>
<el-form-item
label=
"待清除字符串"
>
<el-input
type=
"textarea"
rows=
"2"
v-model=
"specialCharacter"
placeholder=
"待清除字符串"
></el-input>
</el-form-item>
<el-form-item
label=
"清除后的字符串"
prop=
"title"
>
{{newspecialCharacter }}
</el-form-item>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"clearSpecial"
:loading=
"saveLoading"
>
执行
</el-button>
<el-button
@
click=
"showClear = false"
>
取消
</el-button>
</
template
>
</vxe-modal>
<vxe-modal
width=
"70%"
height=
"90%"
...
...
@@ -99,7 +135,6 @@
<el-form-item
label=
"订单/变量"
v-if=
"visibleTest"
prop=
"cellValue"
>
<JsonEditorValue
v-model=
"jsonStr"
:options=
"editorOptions"
language=
"zh-CN"
/>
<el-button
class=
"mt-1"
type=
"primary"
size=
"small"
@
click=
"sendTest"
>
执行
</el-button>
</el-form-item>
</el-col>
...
...
@@ -131,7 +166,9 @@ import {
addExcelScripts
,
editExcelScripts
,
deleteExcelScripts
,
testExcelScripts
testExcelScripts
,
clearSpecialCharacter
}
from
'@/api/scripts'
import
{
ElMessage
,
type
FormInstance
}
from
'element-plus'
import
type
{
VxeTableInstance
}
from
'vxe-table'
...
...
@@ -143,6 +180,13 @@ const visibleTest = ref(false)
const
loading
=
ref
(
false
)
const
saveLoading
=
ref
(
false
)
const
showEdit
=
ref
(
false
)
const
showClear
=
ref
(
false
)
const
specialCharacter
=
ref
(
''
)
const
newspecialCharacter
=
ref
(
''
)
const
formState
=
reactive
({
title
:
''
,
content
:
''
,
...
...
@@ -268,6 +312,25 @@ const onSubmit = async () => {
saveLoading
.
value
=
false
}
// 清除特殊字符
const
clearSpecial
=
async
()
=>
{
saveLoading
.
value
=
true
try
{
const
{
data
}
=
await
clearSpecialCharacter
(
specialCharacter
.
value
)
newspecialCharacter
.
value
=
data
.
result
console
.
log
(
newspecialCharacter
)
}
catch
{}
saveLoading
.
value
=
false
}
const
onQuery
=
async
()
=>
{
loading
.
value
=
true
try
{
...
...
src/views/var/varExcel/components/SetAttch/SetAttch.vue
View file @
03739da2
...
...
@@ -203,6 +203,7 @@ const setNickName = () => {
}
const
position
=
getRangePosition
()
if
(
!
position
)
return
console
.
log
(
groupTitles
)
// 清除颜色
if
(
groupTitles
.
value
.
length
)
{
groupTitles
.
value
.
forEach
((
item
)
=>
{
...
...
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