Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
cb147e2c
Unverified
Commit
cb147e2c
authored
Sep 16, 2020
by
lanyulei
Committed by
GitHub
Sep 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25 from lanyulei/dev
完善表单设计器上传图片功能。
parents
78b1812b
4ddb58be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
GenerateFormItem.vue
src/components/VueFormMaking/components/GenerateFormItem.vue
+1
-10
index.vue
src/components/VueFormMaking/components/Upload/index.vue
+13
-3
No files found.
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
cb147e2c
...
...
@@ -20,19 +20,10 @@
<
template
v-else-if=
"widget.type=='imgupload'"
>
<fm-upload
v-model=
"dataModel"
:disabled=
"true"
:style=
"
{'width': widget.options.width}"
:width="widget.options.size.width"
:height="widget.options.size.height"
:token="widget.options.token"
:domain="widget.options.domain"
:multiple="widget.options.multiple"
:length="widget.options.length"
:is-qiniu="widget.options.isQiniu"
:is-delete="widget.options.isDelete"
:min="widget.options.min"
:is-edit="widget.options.isEdit"
:action="widget.options.action"
:preview="preview"
/>
</
template
>
<
template
v-else-if=
"widget.type =='rate'"
>
...
...
src/components/VueFormMaking/components/Upload/index.vue
View file @
cb147e2c
...
...
@@ -34,6 +34,7 @@
</draggable>
<div
v-if=
"!preview"
v-show=
"(!isQiniu || (isQiniu && token)) && fileList.length
<
length
"
class=
"el-upload el-upload--picture-card"
:class=
"
{'is-disabled': disabled}"
...
...
@@ -126,6 +127,10 @@ export default {
disabled
:
{
type
:
Boolean
,
default
:
false
},
preview
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
...
...
@@ -219,11 +224,16 @@ export default {
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
)
{
const
resData
=
JSON
.
parse
(
xhr
.
response
)
resData
.
url
=
resData
.
data
if
(
resData
&&
resData
.
url
)
{
var
uploadUrl
=
''
if
(
resData
.
url
!==
undefined
&&
resData
.
url
!==
null
&&
resData
.
url
!==
''
)
{
uploadUrl
=
resData
.
url
}
else
if
(
resData
.
data
!==
undefined
&&
resData
.
data
!==
null
&&
resData
.
data
!==
''
)
{
uploadUrl
=
resData
.
data
}
if
(
resData
&&
uploadUrl
)
{
this
.
$set
(
this
.
fileList
,
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
),
{
...
this
.
fileList
[
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
url
:
resData
.
u
rl
,
url
:
uploadU
rl
,
percent
:
100
})
setTimeout
(()
=>
{
...
...
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