Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
a1be223b
Commit
a1be223b
authored
Sep 27, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除模板一级字段弹出确认弹框
parent
48418ef9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
Add.vue
src/views/template/Add.vue
+21
-7
WordsManager.vue
src/views/template/components/WordsManager.vue
+10
-2
No files found.
src/views/template/Add.vue
View file @
a1be223b
...
...
@@ -56,15 +56,29 @@ export default class Add extends Vue {
s_image_url
:
this
.
baseInfo
.
imgUrl
,
});
}
private
confirm
()
{
this
.
employ
();
}
private
employ
()
{
this
.
commitTemplate
().
then
((
res
:
any
)
=>
{
private
async
confirm
()
{
try
{
const
res
=
await
this
.
commitTemplate
();
this
.
$dialog
.
confirm
({
title
:
'提示'
,
message
:
'近保存还是去存证'
,
confirmButtonText
:
'立即存证'
,
cancelButtonText
:
'仅保存'
,
}).
then
(()
=>
{
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
:
{
templateId
:
res
.
id
}});
}).
catch
(
(
err
:
any
)
=>
{
this
.
$toast
(
err
);
}).
catch
((
)
=>
{
this
.
$router
.
push
({
path
:
'/'
}
);
});
}
catch
(
err
)
{
this
.
$toast
(
err
);
}
}
private
async
employ
()
{
try
{
const
res
=
await
this
.
commitTemplate
();
}
catch
(
err
)
{
this
.
$toast
(
err
);
}
}
}
</
script
>
src/views/template/components/WordsManager.vue
View file @
a1be223b
...
...
@@ -186,10 +186,18 @@ export default class Add extends Vue {
const
word
=
parentIndex
!==
-
1
?
this
.
words
[
parentIndex
]
:
null
;
this
.
preAddWord
({
wordType
,
word
},
'after'
);
}
private
delWord
()
{
private
async
delWord
()
{
const
{
index
,
parentIndex
}
=
this
.
currentAction
;
const
tempWords
=
parentIndex
===
-
1
?
this
.
words
:
this
.
words
[
parentIndex
].
data
;
tempWords
.
splice
(
index
,
1
);
if
(
parentIndex
===
-
1
&&
this
.
words
[
index
].
data
.
length
>
0
)
{
await
this
.
$dialog
.
confirm
({
title
:
'提示'
,
message
:
'该内容下包含多条字段,确定要删除吗'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
});
}
return
tempWords
.
splice
(
index
,
1
);
}
private
confirmWordType
({
type
=
DataType
.
Input
,
options
}:
any
)
{
this
.
wordType
=
type
;
...
...
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