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
4204cc04
Commit
4204cc04
authored
Aug 06, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
dcc07782
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
12 deletions
+22
-12
Detail.vue
src/views/proof/Detail.vue
+18
-6
Index.vue
src/views/proof/Index.vue
+2
-2
AddBanner.vue
src/views/proof/components/AddBanner.vue
+2
-4
No files found.
src/views/proof/Detail.vue
View file @
4204cc04
...
@@ -82,9 +82,10 @@ export default class Detail extends Vue {
...
@@ -82,9 +82,10 @@ export default class Detail extends Vue {
private
proofName
!
:
string
;
private
proofName
!
:
string
;
get
addOrTemplate
()
{
get
addOrTemplate
()
{
const
{
templateId
,
proofName
}
=
this
;
return
{
return
{
templateId
:
this
.
templateId
,
templateId
,
proofName
:
this
.
proofName
,
proofName
,
};
};
}
}
...
@@ -94,7 +95,7 @@ export default class Detail extends Vue {
...
@@ -94,7 +95,7 @@ export default class Detail extends Vue {
if
(
templateId
)
{
if
(
templateId
)
{
const
{
detail
,
name
}
=
await
this
.
$api
.
template
.
get
(
templateId
);
const
{
detail
,
name
}
=
await
this
.
$api
.
template
.
get
(
templateId
);
this
.
detail
=
JSON
.
parse
(
detail
);
this
.
detail
=
JSON
.
parse
(
detail
);
this
.
detail2
=
Object
.
freeze
(
detail
);
;
this
.
detail2
=
Object
.
freeze
(
detail
);
this
.
proofType
=
name
;
this
.
proofType
=
name
;
this
.
name
=
proofName
?
proofName
:
name
;
this
.
name
=
proofName
?
proofName
:
name
;
this
.
name2
=
this
.
name
;
this
.
name2
=
this
.
name
;
...
@@ -104,14 +105,19 @@ export default class Detail extends Vue {
...
@@ -104,14 +105,19 @@ export default class Detail extends Vue {
@
Watch
(
'proofId'
,
{
immediate
:
true
,
deep
:
true
})
@
Watch
(
'proofId'
,
{
immediate
:
true
,
deep
:
true
})
private
async
onProofIdChange
(
newProofId
:
number
,
oldProofId
:
number
)
{
private
async
onProofIdChange
(
newProofId
:
number
,
oldProofId
:
number
)
{
if
(
newProofId
)
{
if
(
newProofId
)
{
let
{
detail
,
id
,
name
,
note
}:
any
=
this
.
baseProof
?
await
this
.
$api
.
proof
.
incrementGet
(
newProofId
)
:
await
this
.
$api
.
proof
.
get
(
newProofId
);
const
{
detail
,
id
,
name
,
note
}:
any
=
this
.
baseProof
?
await
this
.
$api
.
proof
.
incrementGet
(
newProofId
)
:
await
this
.
$api
.
proof
.
get
(
newProofId
);
const
proof
:
any
=
JSON
.
parse
(
detail
);
const
proof
:
any
=
JSON
.
parse
(
detail
);
const
ext
:
any
=
proof
[
proof
.
length
-
1
];
this
.
detail
=
proof
.
slice
(
0
,
-
1
);
this
.
detail
=
proof
.
slice
(
0
,
-
1
);
this
.
detail2
=
Object
.
freeze
(
detail
);
this
.
detail2
=
Object
.
freeze
(
detail
);
this
.
id
=
id
;
this
.
id
=
id
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
name2
=
this
.
name
;
this
.
name2
=
this
.
name
;
const
ext
:
any
=
proof
[
proof
.
length
-
1
];
this
.
proofType
=
ext
.
data
.
find
((
item
:
any
)
=>
item
.
key
===
'存证类型'
).
data
.
value
;
this
.
proofType
=
ext
.
data
.
find
((
item
:
any
)
=>
item
.
key
===
'存证类型'
).
data
.
value
;
this
.
banners
=
JSON
.
parse
(
note
).
banners
;
this
.
banners
=
JSON
.
parse
(
note
).
banners
;
this
.
showBtn
=
true
;
this
.
showBtn
=
true
;
...
@@ -230,7 +236,13 @@ export default class Detail extends Vue {
...
@@ -230,7 +236,13 @@ export default class Detail extends Vue {
}
}
private
async
addIncrementProof
()
{
private
async
addIncrementProof
()
{
const
{
baseProofId
,
baseProofHash
,
preProofHash
,
name
,
note
,
proofAndExt
}
=
this
;
const
{
baseProofId
,
baseProofHash
,
preProofHash
,
name
,
note
,
proofAndExt
}
=
this
;
const
result
=
await
this
.
$api
.
proof
.
incrementAdd
(
baseProofId
,
baseProofHash
,
preProofHash
,
name
,
proofAndExt
,
note
);
const
result
=
await
this
.
$api
.
proof
.
incrementAdd
(
baseProofId
,
baseProofHash
,
preProofHash
,
name
,
proofAndExt
,
note
);
return
result
.
id
;
return
result
.
id
;
}
}
private
async
editProof
()
{
private
async
editProof
()
{
...
...
src/views/proof/Index.vue
View file @
4204cc04
...
@@ -127,7 +127,7 @@ export default class Index extends Vue {
...
@@ -127,7 +127,7 @@ export default class Index extends Vue {
let
query
:
any
=
{
let
query
:
any
=
{
templateId
:
this
.
templateInfo
.
id
,
templateId
:
this
.
templateInfo
.
id
,
proofName
:
this
.
proofName
,
proofName
:
this
.
proofName
,
}
}
;
if
(
this
.
isZengliang
)
{
if
(
this
.
isZengliang
)
{
let
preProof
=
null
;
let
preProof
=
null
;
if
(
this
.
currentProof
.
increment_num
>
0
)
{
if
(
this
.
currentProof
.
increment_num
>
0
)
{
...
@@ -136,7 +136,7 @@ export default class Index extends Vue {
...
@@ -136,7 +136,7 @@ export default class Index extends Vue {
}
else
{
}
else
{
preProof
=
this
.
currentProof
;
preProof
=
this
.
currentProof
;
}
}
query
=
{...
query
,
baseProof
:
JSON
.
stringify
(
this
.
currentProof
),
preProof
:
JSON
.
stringify
(
preProof
)
,}
query
=
{...
query
,
baseProof
:
JSON
.
stringify
(
this
.
currentProof
),
preProof
:
JSON
.
stringify
(
preProof
)
};
}
}
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
});
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
});
}
}
...
...
src/views/proof/components/AddBanner.vue
View file @
4204cc04
...
@@ -104,13 +104,11 @@ export default class AddBanner extends Vue {
...
@@ -104,13 +104,11 @@ export default class AddBanner extends Vue {
}
}
@
Emit
(
'save'
)
@
Emit
(
'save'
)
private
save
()
{
private
save
()
{
this
.
$emit
(
'update:banners'
,
this
.
hashs
);
this
.
$emit
(
'update:banners'
,
this
.
hashs
);
return
this
.
hashs
;
}
}
@
Emit
(
'save-and-chain'
)
@
Emit
(
'save-and-chain'
)
private
saveAndChain
()
{
private
saveAndChain
()
{
this
.
$emit
(
'update:banners'
,
this
.
hashs
);
this
.
$emit
(
'update:banners'
,
this
.
hashs
);
return
this
.
hashs
;
}
}
}
}
</
script
>
</
script
>
...
...
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