Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ee71765f
authored
Oct 16, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加视频类型
parent
95f56fdc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
src/api/api.js
+0
-1
src/views/tempaltes/editMenu.vue
+19
-9
No files found.
src/api/api.js
View file @
ee71765f
...
...
@@ -141,7 +141,6 @@ export function upload(file) {
formData
.
append
(
'resource'
,
file
)
console
.
log
(
formData
.
get
(
'resource'
).
size
)
alert
(
formData
.
get
(
'resource'
).
size
)
return
post
(
`/common/upload/resource`
,
formData
,
{
'Content-Type'
:
'multipart/form-data'
}
)
...
...
src/views/tempaltes/editMenu.vue
View file @
ee71765f
...
...
@@ -52,8 +52,11 @@
:src=
"getHostUrl(item2[index3])"
class=
"edit-input"
/>
<video
:src=
"getHostUrl(item2[index3])"
v-if=
"item.modelSchema[isSchemaIndex(item2)][index3].type === 'video'"
></video>
<van-uploader
result-type=
"dataUrl"
v-if=
"item.modelSchema[isSchemaIndex(item2)][index3].type == 'image' || item.modelSchema[isSchemaIndex(item2)][index3].type == 'video'"
:accept=
"item.modelSchema[isSchemaIndex(item2)][index3].type == 'image' ? 'image/*' : 'video/*'"
@
click
.
native=
"uploadListItem(item.dataKey,index2, index3)"
:after-read=
"uploadAfter"
>
...
...
@@ -69,7 +72,8 @@
</div>
<van-uploader
result-type=
"dataUrl"
v-if=
"item.type == 'image'"
v-if=
"item.type == 'image' || item.type == 'video'"
:accept=
"item.type == 'image' ? 'image/*' : 'video/*'"
@
click
.
native=
"uploadItem(item.dataKey)"
:after-read=
"uploadAfter"
>
...
...
@@ -83,7 +87,7 @@
<
script
>
import
{
upload
}
from
"@/api/api"
;
import
{
getHostUrl
}
from
'@/utils/index'
import
{
getHostUrl
}
from
"@/utils/index"
;
export
default
{
name
:
"editMenu"
,
props
:
{
...
...
@@ -93,7 +97,7 @@ export default {
},
frameUrl
:
{
type
:
String
,
default
:
''
default
:
""
},
schemaData
:
{
type
:
Object
,
...
...
@@ -118,8 +122,7 @@ export default {
},
uploadItem
(
key
)
{
// alert(key);
this
.
itemKey
=
''
,
this
.
dataKey
=
key
;
(
this
.
itemKey
=
""
),
(
this
.
dataKey
=
key
);
},
uploadListItem
(
key
,
index
,
itemKey
)
{
this
.
dataKey
=
key
;
...
...
@@ -128,7 +131,7 @@ export default {
console
.
log
(
key
,
index
,
itemKey
,
"dsadadsa"
);
},
isSchemaIndex
(
item
)
{
console
.
log
(
item
)
console
.
log
(
item
)
;
return
item
[
"schemaIndex"
]
?
item
[
"schemaIndex"
]
:
0
;
},
toObj
(
obj
)
{
...
...
@@ -148,10 +151,15 @@ export default {
}
console
.
log
(
item
);
},
getHostUrl
(
dataUrl
)
{
return
getHostUrl
(
this
.
frameUrl
,
dataUrl
)
getHostUrl
(
dataUrl
)
{
return
getHostUrl
(
this
.
frameUrl
,
dataUrl
)
;
},
uploadAfter
(
file
)
{
this
.
$toast
.
loading
({
mask
:
true
,
duration
:
0
,
message
:
"上传中..."
});
upload
(
file
.
file
)
.
then
(
res
=>
{
// this.schemaData[this.dataKey].value = res.data.data;
...
...
@@ -160,9 +168,11 @@ export default {
}
else
{
this
.
setSchemaData
(
res
.
data
.
data
);
}
this
.
$toast
.
clear
();
})
.
catch
(
e
=>
{
console
.
log
(
e
);
this
.
$toast
.
clear
();
this
.
$toast
(
"上传失败"
);
});
},
...
...
@@ -173,7 +183,7 @@ export default {
setSchemaListData
(
value
)
{
this
.
schemaData
[
this
.
dataKey
][
this
.
listIndex
][
this
.
itemKey
]
=
value
;
this
.
valueChange2
();
this
.
itemKey
=
''
this
.
itemKey
=
""
;
},
deleteItem
(
index
,
arr
)
{
arr
.
splice
(
index
,
1
);
...
...
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