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
935dd10c
Commit
935dd10c
authored
Apr 25, 2025
by
tanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
57a1d15f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
203 additions
and
7 deletions
+203
-7
excel.ts
src/utils/excel.ts
+2
-0
ExcelOperate.vue
...ws/comment-excel/components/ExcelOperate/ExcelOperate.vue
+108
-4
CommentForm.vue
src/views/excel/components/CommentForm/CommentForm.vue
+1
-0
ExcelOperate.vue
...ews/var/varExcel/components/ExcelOperate/ExcelOperate.vue
+92
-3
No files found.
src/utils/excel.ts
View file @
935dd10c
...
...
@@ -358,6 +358,7 @@ export function filterVarData(data: any) {
titles
.
add
(
'底图名称'
)
.
add
(
'销售单号+行项次'
)
.
add
(
'工单号'
)
.
add
(
'参考数'
)
.
add
(
'品牌名称'
)
.
add
(
'客户名称'
)
...
...
@@ -368,6 +369,7 @@ export function filterVarData(data: any) {
const
rw
:
Recordable
=
{}
Reflect
.
set
(
rw
,
'底图名称'
,
row
[
'imageName'
])
Reflect
.
set
(
rw
,
'销售单号+行项次'
,
row
[
'orderCodeNo'
])
Reflect
.
set
(
rw
,
'工单号'
,
row
[
'workorderCode'
])
Reflect
.
set
(
rw
,
'参考数'
,
row
[
'orderNum'
])
Reflect
.
set
(
rw
,
'品牌名称'
,
row
[
'brandName'
])
Reflect
.
set
(
rw
,
'客户名称'
,
row
[
'customerName'
])
...
...
src/views/comment-excel/components/ExcelOperate/ExcelOperate.vue
View file @
935dd10c
...
...
@@ -146,7 +146,7 @@
</
template
>
</vxe-modal>
<vxe-modal
v-model=
"connectVisible"
width=
"
7
00"
title=
"关联信息配置"
show-footer
>
<vxe-modal
v-model=
"connectVisible"
width=
"
10
00"
title=
"关联信息配置"
show-footer
>
<p>
关联区域信息:{{ currentConnectInfo.excelAreaNicname }}
</p>
<p>
被关联信息:{{ cachCurrentBeConnectInfo.excelAreaNicname }}
</p>
...
...
@@ -160,7 +160,32 @@
>
<vxe-column
type=
"checkbox"
width=
"40"
></vxe-column>
<vxe-column
title=
"关联title"
field=
"title"
></vxe-column>
<vxe-column
title=
"被关联title"
field=
"betitle"
>
<vxe-column
title=
"关联脚本"
width =
"300px"
>
<
template
#
default=
"{ row }"
>
<el-select
size=
"small"
style=
"width: 100%;"
v-model=
"row.scriptName"
@
change=
"(e) => scriptChange(row, e)"
clearable
>
<el-option
v-for=
"item in scriptList"
:key=
"item.srciptName"
:value=
"item.srciptName"
:label=
"item.srciptName"
></el-option>
</el-select>
<el-input
type=
"textarea"
style=
"width: 100%;margin-top: 2px;"
rows=
"5"
v-model=
"row.script"
></el-input>
</
template
>
</vxe-column>
<vxe-column
title=
"被关联title"
field=
"script"
>
<
template
#
default=
"{ row }"
>
<el-select
v-model=
"row.betitle"
size=
"small"
@
change=
"(v) => changeBeConnect(v, row)"
>
<template
v-for=
"item in beConnectSelectOptions"
:key=
"item.title"
>
...
...
@@ -169,6 +194,32 @@
</el-select>
</template>
</vxe-column>
<vxe-column
title=
"被关联脚本"
width =
"300px"
>
<
template
#
default=
"{ row }"
>
<el-select
size=
"small"
style=
"width: 100%;"
v-model=
"row.bescriptName"
@
change=
"(e) => scriptBeChange(row, e)"
clearable
>
<el-option
v-for=
"item in scriptList"
:key=
"item.srciptName"
:value=
"item.srciptName"
:label=
"item.srciptName"
></el-option>
</el-select>
<el-input
type=
"textarea"
style=
"width: 100%;margin-top: 2px;"
rows=
"5"
v-model=
"row.bescript"
></el-input>
</
template
>
</vxe-column>
</vxe-table>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"confirmConnect"
>
确认
</el-button>
...
...
@@ -246,6 +297,13 @@ import {
showsheetbarConfig
,
showstatisticBarConfig
}
from
'@/constants/excelConfig'
import
{
apiGetScript
}
from
'@/api/excel'
import
{
flatten
,
cloneDeep
}
from
'lodash-es'
import
{
useCommentExcel
}
from
'@/stores/commentExcel'
import
{
useExcelChangeStore
}
from
'@/stores/excel'
...
...
@@ -288,6 +346,9 @@ const { getFileInfo, isSameFile } = storeToRefs(commentExcelStore)
const
connectList
=
ref
<
any
[]
>
([])
const
chooseVisible
=
ref
(
false
)
const
editVisible
=
ref
(
false
)
const
scriptList
=
ref
<
any
[]
>
([])
const
currentConnectInfo
=
reactive
<
Recordable
>
({
excelAreaConnectId
:
''
,
excelAreaId
:
''
,
...
...
@@ -321,6 +382,36 @@ const initIsSetSheetMark = (length: number) => {
isSetSheetMark
.
value
=
Array
.
from
({
length
}).
fill
(
false
)
}
const
getScriptList
=
async
()
=>
{
const
{
data
}
=
await
apiGetScript
()
scriptList
.
value
=
data
.
result
}
const
scriptChange
=
(
item
,
e
)
=>
{
if
(
e
)
{
console
.
log
(
e
)
item
.
script
=
scriptList
.
value
.
find
((
item1
)
=>
item1
.
srciptName
==
e
)?.
scriptContent
}
else
{
item
.
script
=
''
}
item
.
show
=
true
}
const
scriptBeChange
=
(
item
,
e
)
=>
{
if
(
e
)
{
item
.
bescript
=
scriptList
.
value
.
find
((
item1
)
=>
item1
.
srciptName
==
e
)?.
scriptContent
}
else
{
item
.
bescript
=
''
}
item
.
beshow
=
true
}
/**
* 存储在本地的区域标记
* locaExcelAreaMarks = {
...
...
@@ -350,6 +441,11 @@ const initExcelAreaMarksKey = (len: number) => {
Reflect
.
set
(
locaExcelAreaMarks
,
index
,
[])
})
}
const
onSaveSuccess
=
(
data
:
any
)
=>
{
locaExcelAreaMarks
[
data
.
result
[
'sheetNum'
]].
push
(
data
.
result
)
}
...
...
@@ -513,7 +609,9 @@ const addConnect = async (list: any) => {
colum
:
item
.
colum
,
numFlag
:
item
.
numFlag
,
numTitle
:
item
.
numTitle
,
only
:
item
.
only
only
:
item
.
only
,
scriptName
:
item
.
scriptName
,
script
:
item
.
script
})
currentConnectInfo
.
beConnectFiled
.
push
({
...
...
@@ -523,7 +621,9 @@ const addConnect = async (list: any) => {
colum
:
item
.
becolum
,
numFlag
:
item
.
benumFlag
,
numTitle
:
item
.
benumTitle
,
only
:
item
.
beonly
only
:
item
.
beonly
,
scriptName
:
item
.
bescriptName
,
script
:
item
.
bescript
})
})
currentConnectInfo
.
fileId
=
getFileInfo
.
value
.
orderFileId
...
...
@@ -845,10 +945,14 @@ onMounted(() => {
loadExcel
()
getCompareList
()
queryConnectList
()
getScriptList
()
})
onUnmounted
(()
=>
{
isFunction
((
window
as
any
)?.
luckysheet
?.
destroy
)
&&
luckysheet
.
destroy
()
})
</
script
>
<
style
lang=
"scss"
scoped
>
.comment-form
{
...
...
src/views/excel/components/CommentForm/CommentForm.vue
View file @
935dd10c
...
...
@@ -28,6 +28,7 @@
</
template
>
</el-select>
</el-form-item>
<el-form-item
label=
"脚本"
>
<el-select
v-model=
"formState.scriptName"
@
change=
"scriptsChange"
>
<
template
v-for=
"item in scripts"
>
...
...
src/views/var/varExcel/components/ExcelOperate/ExcelOperate.vue
View file @
935dd10c
...
...
@@ -146,7 +146,7 @@
</
template
>
</vxe-modal>
<vxe-modal
v-model=
"connectVisible"
width=
"
7
00"
title=
"关联信息配置"
show-footer
>
<vxe-modal
v-model=
"connectVisible"
width=
"
10
00"
title=
"关联信息配置"
show-footer
>
<p>
关联区域信息:{{ currentConnectInfo.excelAreaNicname }}
</p>
<p>
被关联信息:{{ cachCurrentBeConnectInfo.excelAreaNicname }}
</p>
...
...
@@ -160,6 +160,32 @@
>
<vxe-column
type=
"checkbox"
width=
"40"
></vxe-column>
<vxe-column
title=
"关联title"
field=
"title"
></vxe-column>
<vxe-column
title=
"关联脚本"
width =
"300px"
>
<
template
#
default=
"{ row }"
>
<el-select
size=
"small"
style=
"width: 100%;"
v-model=
"row.scriptName"
@
change=
"(e) => scriptChange(row, e)"
clearable
>
<el-option
v-for=
"item in scriptList"
:key=
"item.srciptName"
:value=
"item.srciptName"
:label=
"item.srciptName"
></el-option>
</el-select>
<el-input
type=
"textarea"
style=
"width: 100%;margin-top: 2px;"
rows=
"5"
v-model=
"row.script"
></el-input>
</
template
>
</vxe-column>
<vxe-column
title=
"被关联title"
field=
"betitle"
>
<
template
#
default=
"{ row }"
>
<el-select
v-model=
"row.betitle"
size=
"small"
@
change=
"(v) => changeBeConnect(v, row)"
>
...
...
@@ -169,7 +195,33 @@
</el-select>
</template>
</vxe-column>
<vxe-column
title=
"被关联脚本"
width =
"300px"
>
<
template
#
default=
"{ row }"
>
<el-select
size=
"small"
style=
"width: 100%;"
v-model=
"row.bescriptName"
@
change=
"(e) => scriptBeChange(row, e)"
clearable
>
<el-option
v-for=
"item in scriptList"
:key=
"item.srciptName"
:value=
"item.srciptName"
:label=
"item.srciptName"
></el-option>
</el-select>
<el-input
type=
"textarea"
style=
"width: 100%;margin-top: 2px;"
rows=
"5"
v-model=
"row.bescript"
></el-input>
</
template
>
</vxe-column>
</vxe-table>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"confirmConnect"
>
确认
</el-button>
</
template
>
...
...
@@ -261,6 +313,11 @@ import {
addExcelArea
,
batchAddVarExcelArea
}
from
'@/api/varExcel'
import
{
apiGetScript
}
from
'@/api/excel'
import
type
{
Recordable
}
from
'@/types/global'
import
{
filterRunData2
,
getRangetxt
,
setRangeBackground
}
from
'@/utils/excel'
import
type
{
VxeTableInstance
}
from
'vxe-table'
...
...
@@ -273,6 +330,7 @@ const showProdCompare = ref(false)
const
xTableConnect
=
ref
<
VxeTableInstance
>
()
const
beConnectTable
=
ref
<
VxeTableInstance
>
()
const
compareData
=
ref
([])
const
scriptList
=
ref
<
any
[]
>
([])
const
compareParams
=
reactive
({
pageSize
:
10
,
currentPage
:
1
,
...
...
@@ -339,6 +397,27 @@ const areaTypeLen = computed(() => {
}
)
})
const
scriptChange
=
(
item
,
e
)
=>
{
if
(
e
)
{
console
.
log
(
e
)
item
.
script
=
scriptList
.
value
.
find
((
item1
)
=>
item1
.
srciptName
==
e
)?.
scriptContent
}
else
{
item
.
script
=
''
}
item
.
show
=
true
}
const
scriptBeChange
=
(
item
,
e
)
=>
{
if
(
e
)
{
item
.
bescript
=
scriptList
.
value
.
find
((
item1
)
=>
item1
.
srciptName
==
e
)?.
scriptContent
}
else
{
item
.
bescript
=
''
}
item
.
beshow
=
true
}
const
deletePic
=
()
=>
{
luckysheet
.
deleteImage
()
}
...
...
@@ -515,7 +594,9 @@ const addConnect = async (list: any) => {
colum
:
item
.
colum
,
numFlag
:
item
.
numFlag
,
numTitle
:
item
.
numTitle
,
only
:
item
.
only
only
:
item
.
only
,
scriptName
:
item
.
scriptName
,
script
:
item
.
script
})
currentConnectInfo
.
beConnectFiled
.
push
({
...
...
@@ -525,7 +606,9 @@ const addConnect = async (list: any) => {
colum
:
item
.
becolum
,
numFlag
:
item
.
benumFlag
,
numTitle
:
item
.
benumTitle
,
only
:
item
.
beonly
only
:
item
.
beonly
,
scriptName
:
item
.
bescriptName
,
script
:
item
.
bescript
})
})
currentConnectInfo
.
fileId
=
getFileInfo
.
value
.
varFileId
...
...
@@ -768,6 +851,11 @@ const toRun = async () => {
}
}
const
getScriptList
=
async
()
=>
{
const
{
data
}
=
await
apiGetScript
()
scriptList
.
value
=
data
.
result
}
const
getCompareList
=
async
()
=>
{
compareParams
.
customerId
=
getFileInfo
.
value
.
customerId
||
''
const
{
data
}
=
await
getExcelProdFileConfPage
(
compareParams
)
...
...
@@ -840,6 +928,7 @@ onMounted(() => {
loadExcel
()
getCompareList
()
queryConnectList
()
getScriptList
()
})
onUnmounted
(()
=>
{
isFunction
((
window
as
any
)?.
luckysheet
?.
destroy
)
&&
luckysheet
.
destroy
()
...
...
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