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
9d715034
Commit
9d715034
authored
May 13, 2025
by
tanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化变量数据获取
parent
a6d7874e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
15 deletions
+81
-15
OrderChange.vue
src/views/order/orderChange/OrderChange.vue
+32
-0
index.vue
src/views/order/scripts/index.vue
+17
-15
VarChange.vue
src/views/var/varChange/VarChange.vue
+32
-0
No files found.
src/views/order/orderChange/OrderChange.vue
View file @
9d715034
...
...
@@ -175,6 +175,12 @@
<
template
#
default=
"{ row }"
>
{{
row
[
'数据区'
]
}}
</
template
>
</vxe-column>
<vxe-column
title=
"操作"
width=
"120"
>
<
template
#
default=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"copyOrders(row)"
>
复制订单
</el-button>
</
template
>
</vxe-column>
<!-- 转换下使用 -->
<
template
>
<vxe-colgroup
v-for=
"item in tableTitle"
:key=
"item"
:title=
"item"
>
...
...
@@ -506,6 +512,32 @@ const showScriptNumber = (array) => {
}
const
copyOrders
=
(
item
)
=>
{
let
arr
=
[]
for
(
let
key
in
item
)
{
arr
.
push
({
title
:
key
,
value
:
item
[
key
]
})
}
const
text
=
JSON
.
stringify
(
arr
);
const
textarea
=
document
.
createElement
(
"textarea"
);
textarea
.
value
=
text
;
textarea
.
style
.
position
=
"absolute"
;
textarea
.
style
.
opacity
=
"0"
;
document
.
body
.
appendChild
(
textarea
);
textarea
.
select
();
document
.
execCommand
(
"copy"
);
document
.
body
.
removeChild
(
textarea
);
ElMessage
({
type
:
'success'
,
message
:
'复制订单数据到粘贴板'
})
}
/** 确认订单转换 */
const
confirmChange
=
async
(
row
)
=>
{
await
ElMessageBox
.
confirm
(
'是否确认订单转换?'
,
'提示'
,
{
...
...
src/views/order/scripts/index.vue
View file @
9d715034
...
...
@@ -86,25 +86,27 @@
>
测试
</el-button
>
</el-form-item>
<el-form-item
label=
"测试内容"
v-if=
"visibleTest"
prop=
"cellValue"
>
<el-row
class=
"mt-1 w-full"
:gutter=
"12"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"单元格值"
v-if=
"visibleTest"
prop=
"cellValue"
>
<el-input
type=
"textarea"
rows=
"
4
"
rows=
"
2
"
v-model=
"formEdit.cellValue"
placeholder=
"
请输入测试内容
"
placeholder=
"
单元格值
"
></el-input>
</el-form-item>
<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>
<el-col
:span=
"8"
>
<JsonEditorValue
v-model=
"jsonStr"
:options=
"editorOptions"
/>
</el-col>
<el-col
:span=
"8"
v-if=
"!!testResult.title"
>
<el-col
:span=
"16"
v-if=
"!!testResult.title"
>
<el-alert
v-bind=
"testResult"
show-icon
:closable=
"false"
/>
</el-col>
</el-row>
<el-button
class=
"mt-1"
type=
"primary"
size=
"small"
@
click=
"sendTest"
>
执行
</el-button>
</el-form-item>
<el-form-item
label=
"脚本说明"
prop=
"mark"
>
<el-input
type=
"textarea"
rows=
"3"
v-model=
"formEdit.mark"
></el-input>
</el-form-item>
...
...
@@ -168,7 +170,7 @@ const editorOptions = reactive({
mode
:
'code'
,
history
:
false
,
search
:
false
,
mainMenuBar
:
fals
e
,
mainMenuBar
:
tru
e
,
navigationBar
:
false
})
const
jsonStr
=
ref
([{}])
...
...
src/views/var/varChange/VarChange.vue
View file @
9d715034
...
...
@@ -123,6 +123,12 @@
<
template
#
default=
"{ row }"
>
{{
row
[
'数据区'
]
}}
</
template
>
</vxe-column>
<vxe-column
title=
"操作"
width=
"120"
>
<
template
#
default=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"copyOrders(row)"
>
复制变量
</el-button>
</
template
>
</vxe-column>
<!-- 查看状态下直接显示 -->
<!-- <template v-if="currentRow.status == 'un_confirm'">
<vxe-column
...
...
@@ -418,6 +424,32 @@ const saveOrderField = async () => {
})
}
const
copyOrders
=
(
item
)
=>
{
let
arr
=
[]
for
(
let
key
in
item
)
{
arr
.
push
({
title
:
key
,
value
:
item
[
key
]
})
}
const
text
=
JSON
.
stringify
(
arr
);
const
textarea
=
document
.
createElement
(
"textarea"
);
textarea
.
value
=
text
;
textarea
.
style
.
position
=
"absolute"
;
textarea
.
style
.
opacity
=
"0"
;
document
.
body
.
appendChild
(
textarea
);
textarea
.
select
();
document
.
execCommand
(
"copy"
);
document
.
body
.
removeChild
(
textarea
);
ElMessage
({
type
:
'success'
,
message
:
'复制变量数据到粘贴板'
})
}
/** 确认订单转换 */
const
confirmChange
=
async
(
row
)
=>
{
await
ElMessageBox
.
confirm
(
'是否确认变量转换?'
,
'提示'
,
{
...
...
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