Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KnowageLabs
Knowage-Server
Commits
2ca68a83
Commit
2ca68a83
authored
May 26, 2022
by
BojanSovticEngIT
Browse files
Bugfix KNOWAGE-6958
parent
c6f74a0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
knowage-vue/src/modules/documentExecution/main/DocumentExecution.d.ts
View file @
2ca68a83
...
...
@@ -44,5 +44,5 @@ export interface iMetadata {
generalMetadata
:
{
name
:
string
,
value
:
string
}[],
shortText
:
{
id
:
number
,
name
:
string
,
value
:
string
}[],
longText
:
{
id
:
number
,
name
:
string
,
value
:
string
}[],
file
:
{
id
:
number
,
name
:
string
,
value
:
string
}[]
file
:
{
id
:
number
,
name
:
string
,
value
:
string
,
fileToSave
?:
{
file
:
{},
fileName
:
string
}
}[]
,
}
\ No newline at end of file
knowage-vue/src/modules/documentExecution/main/DocumentExecution.vue
View file @
2ca68a83
...
...
@@ -812,10 +812,10 @@ export default defineComponent({
async
onMetadataSave
(
metadata
:
any
)
{
this
.
loading
=
true
const
jsonMeta
=
[]
as
any
[]
const
properties
=
[
'
shortText
'
,
'
longText
'
]
const
properties
=
[
'
shortText
'
,
'
longText
'
,
'
file
'
]
properties
.
forEach
((
property
:
string
)
=>
metadata
[
property
].
forEach
((
el
:
any
)
=>
{
if
(
el
.
value
)
{
if
(
el
.
value
||
(
property
===
'
file
'
&&
el
.
fileToSave
)
)
{
jsonMeta
.
push
(
el
)
}
})
...
...
knowage-vue/src/modules/documentExecution/main/dialogs/documentExecutionMetadataDialog/DocumentExecutionMetadataDialog.vue
View file @
2ca68a83
...
...
@@ -153,6 +153,7 @@ export default defineComponent({
title
:
this
.
$t
(
'
common.uploadFile
'
),
msg
:
this
.
$t
(
'
common.uploadFileSuccess
'
)
})
this
.
updateMetadataFile
(
meta
.
id
,
this
.
uploadedFiles
[
meta
.
id
].
name
)
})
.
catch
((
error
:
any
)
=>
this
.
$store
.
commit
(
'
setError
'
,
{
...
...
@@ -163,10 +164,17 @@ export default defineComponent({
this
.
loading
=
false
}
},
updateMetadataFile
(
fileId
:
number
,
fileName
:
string
)
{
if
(
!
this
.
metadata
)
return
const
index
=
this
.
metadata
?.
file
.
findIndex
((
tempFile
:
any
)
=>
tempFile
.
id
===
fileId
)
if
(
index
!==
-
1
)
this
.
metadata
.
file
[
index
].
fileToSave
=
{
file
:
{},
fileName
:
fileName
}
},
cleanFile
(
meta
:
any
)
{
const
temp
=
this
.
$refs
[
meta
.
id
]
as
any
if
(
temp
)
{
if
(
temp
&&
this
.
metadata
)
{
temp
.
resetInput
()
const
index
=
this
.
metadata
.
file
.
findIndex
((
tempFile
:
any
)
=>
tempFile
.
id
===
meta
.
id
)
if
(
index
!==
-
1
)
delete
this
.
metadata
.
file
[
index
].
fileToSave
}
},
closeDialog
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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