Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
ferry_web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jianan
ferry_web
Commits
78b1812b
Unverified
Commit
78b1812b
authored
Sep 16, 2020
by
lanyulei
Committed by
GitHub
Sep 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24 from lanyulei/dev
修复表单设计器图片上传失败bug。
parents
ef91f27d
0b439b72
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
src/components/VueFormMaking/components/GenerateFormItem.vue
+2
-2
src/components/VueFormMaking/components/Upload/index.vue
+24
-8
No files found.
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
78b1812b
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<
template
v-else-if=
"widget.type=='imgupload'"
>
<
template
v-else-if=
"widget.type=='imgupload'"
>
<fm-upload
<fm-upload
v-model=
"dataModel"
v-model=
"dataModel"
:disabled=
"
widget.options.disabled
"
:disabled=
"
true
"
:style=
"
{'width': widget.options.width}"
:style=
"
{'width': widget.options.width}"
:width="widget.options.size.width"
:width="widget.options.size.width"
:height="widget.options.size.height"
:height="widget.options.size.height"
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</span>
</span>
</el-divider>
</el-divider>
</
template
>
</
template
>
<
template
v-if=
"widget.type === 'input' && widget.options.showPassword"
>
<
template
v-
else-
if=
"widget.type === 'input' && widget.options.showPassword"
>
<input
:value=
"dataModel"
type=
"password"
style=
"border: none; background-color: #ffffff; color: #303133"
disabled=
"disabled"
>
<input
:value=
"dataModel"
type=
"password"
style=
"border: none; background-color: #ffffff; color: #303133"
disabled=
"disabled"
>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
...
...
src/components/VueFormMaking/components/Upload/index.vue
View file @
78b1812b
...
@@ -41,19 +41,32 @@
...
@@ -41,19 +41,32 @@
@click.self="handleAdd"
@click.self="handleAdd"
>
>
<i
class=
"el-icon-plus"
:style=
"
{fontSize:miniWidth/4+'px',marginTop: (-miniWidth/8)+'px', marginLeft: (-miniWidth/8)+'px'}" @click.self="handleAdd" />
<i
class=
"el-icon-plus"
:style=
"
{fontSize:miniWidth/4+'px',marginTop: (-miniWidth/8)+'px', marginLeft: (-miniWidth/8)+'px'}" @click.self="handleAdd" />
<input
v-if=
"multiple"
ref=
"uploadInput"
accept=
"image/*"
multiple
type=
"file"
:style=
"
{width: 0, height: 0}" name="file" class="el-upload__input upload-input"
<input
@change="handleChange">
v-if=
"multiple"
ref=
"uploadInput"
accept=
"image/*"
multiple
type=
"file"
:style=
"
{width: 0, height: 0}"
name="file"
class="el-upload__input upload-input"
@change="handleChange"
>
<input
v-else
ref=
"uploadInput"
accept=
"image/*"
type=
"file"
:style=
"
{width:0, height: 0}" name="file" class="el-upload__input upload-input" @change="handleChange">
<input
v-else
ref=
"uploadInput"
accept=
"image/*"
type=
"file"
:style=
"
{width:0, height: 0}" name="file" class="el-upload__input upload-input" @change="handleChange">
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Viewer
from
'viewerjs'
import
Vue
from
'vue'
import
Draggable
from
'vuedraggable'
import
Viewer
from
'viewerjs'
import
*
as
qiniu
from
'qiniu-js'
import
Draggable
from
'vuedraggable'
require
(
'viewerjs/dist/viewer.css'
)
import
*
as
qiniu
from
'qiniu-js'
export
default
{
require
(
'viewerjs/dist/viewer.css'
)
import
VueI18n
from
'vue-i18n'
Vue
.
use
(
VueI18n
)
export
default
{
components
:
{
components
:
{
Draggable
Draggable
},
},
...
@@ -191,6 +204,7 @@
...
@@ -191,6 +204,7 @@
this
.
$refs
.
uploadInput
.
value
=
[]
this
.
$refs
.
uploadInput
.
value
=
[]
},
},
uplaodAction
(
res
,
file
,
key
)
{
uplaodAction
(
res
,
file
,
key
)
{
// eslint-disable-next-line no-unused-vars
const
changeIndex
=
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)
const
changeIndex
=
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)
const
xhr
=
new
XMLHttpRequest
()
const
xhr
=
new
XMLHttpRequest
()
...
@@ -205,6 +219,7 @@
...
@@ -205,6 +219,7 @@
xhr
.
onreadystatechange
=
()
=>
{
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
)
{
if
(
xhr
.
readyState
===
4
)
{
const
resData
=
JSON
.
parse
(
xhr
.
response
)
const
resData
=
JSON
.
parse
(
xhr
.
response
)
resData
.
url
=
resData
.
data
if
(
resData
&&
resData
.
url
)
{
if
(
resData
&&
resData
.
url
)
{
this
.
$set
(
this
.
fileList
,
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
),
{
this
.
$set
(
this
.
fileList
,
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
),
{
...
this
.
fileList
[
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
...
this
.
fileList
[
this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
...
@@ -246,6 +261,7 @@
...
@@ -246,6 +261,7 @@
next
(
res
)
{
next
(
res
)
{
_this
.
$set
(
_this
.
fileList
[
_this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
'percent'
,
parseInt
(
res
.
total
.
percent
))
_this
.
$set
(
_this
.
fileList
[
_this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
'percent'
,
parseInt
(
res
.
total
.
percent
))
},
},
// eslint-disable-next-line handle-callback-err
error
(
err
)
{
error
(
err
)
{
_this
.
$set
(
_this
.
fileList
,
_this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
),
{
_this
.
$set
(
_this
.
fileList
,
_this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
),
{
...
_this
.
fileList
[
_this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
...
_this
.
fileList
[
_this
.
fileList
.
findIndex
(
item
=>
item
.
key
===
key
)],
...
@@ -296,7 +312,7 @@
...
@@ -296,7 +312,7 @@
})
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
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