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
f7bf98d3
Commit
f7bf98d3
authored
Nov 01, 2022
by
lanyulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 剔除无效代码。
parent
26e37d74
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2 additions
and
3577 deletions
+2
-3577
index.vue
src/components/BackToTop/index.vue
+0
-111
index.vue
src/components/DndList/index.vue
+0
-166
index.vue
src/components/DragSelect/index.vue
+0
-61
index.vue
src/components/ErrorLog/index.vue
+0
-78
index.vue
src/components/GithubCorner/index.vue
+0
-54
index.vue
src/components/ImageCropper/index.vue
+0
-1778
data2blob.js
src/components/ImageCropper/utils/data2blob.js
+0
-19
effectRipple.js
src/components/ImageCropper/utils/effectRipple.js
+0
-39
language.js
src/components/ImageCropper/utils/language.js
+0
-232
mimes.js
src/components/ImageCropper/utils/mimes.js
+0
-7
index.vue
src/components/Kanban/index.vue
+0
-99
index.vue
src/components/MDinput/index.vue
+0
-360
index.vue
src/components/PanThumb/index.vue
+0
-142
index.vue
src/components/SizeSelect/index.vue
+0
-57
Mallki.vue
src/components/TextHoverEffect/Mallki.vue
+0
-113
Navbar.vue
src/layout/components/Navbar.vue
+1
-5
main.js
src/main.js
+0
-1
components.js
src/router/modules/components.js
+1
-86
error-log.js
src/utils/error-log.js
+0
-35
UserCard.vue
src/views/profile/components/UserCard.vue
+0
-134
No files found.
src/components/BackToTop/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<transition
:name=
"transitionName"
>
<div
v-show=
"visible"
:style=
"customStyle"
class=
"back-to-ceiling"
@
click=
"backToTop"
>
<svg
width=
"16"
height=
"16"
viewBox=
"0 0 17 17"
xmlns=
"http://www.w3.org/2000/svg"
class=
"Icon Icon--backToTopArrow"
aria-hidden=
"true"
style=
"height:16px;width:16px"
><path
d=
"M12.036 15.59a1 1 0 0 1-.997.995H5.032a.996.996 0 0 1-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z"
/></svg>
</div>
</transition>
</
template
>
<
script
>
export
default
{
name
:
'BackToTop'
,
props
:
{
visibilityHeight
:
{
type
:
Number
,
default
:
400
},
backPosition
:
{
type
:
Number
,
default
:
0
},
customStyle
:
{
type
:
Object
,
default
:
function
()
{
return
{
right
:
'50px'
,
bottom
:
'50px'
,
width
:
'40px'
,
height
:
'40px'
,
'border-radius'
:
'4px'
,
'line-height'
:
'45px'
,
background
:
'#e7eaf1'
}
}
},
transitionName
:
{
type
:
String
,
default
:
'fade'
}
},
data
()
{
return
{
visible
:
false
,
interval
:
null
,
isMoving
:
false
}
},
mounted
()
{
window
.
addEventListener
(
'scroll'
,
this
.
handleScroll
)
},
beforeDestroy
()
{
window
.
removeEventListener
(
'scroll'
,
this
.
handleScroll
)
if
(
this
.
interval
)
{
clearInterval
(
this
.
interval
)
}
},
methods
:
{
handleScroll
()
{
this
.
visible
=
window
.
pageYOffset
>
this
.
visibilityHeight
},
backToTop
()
{
if
(
this
.
isMoving
)
return
const
start
=
window
.
pageYOffset
let
i
=
0
this
.
isMoving
=
true
this
.
interval
=
setInterval
(()
=>
{
const
next
=
Math
.
floor
(
this
.
easeInOutQuad
(
10
*
i
,
start
,
-
start
,
500
))
if
(
next
<=
this
.
backPosition
)
{
window
.
scrollTo
(
0
,
this
.
backPosition
)
clearInterval
(
this
.
interval
)
this
.
isMoving
=
false
}
else
{
window
.
scrollTo
(
0
,
next
)
}
i
++
},
16.7
)
},
easeInOutQuad
(
t
,
b
,
c
,
d
)
{
if
((
t
/=
d
/
2
)
<
1
)
return
c
/
2
*
t
*
t
+
b
return
-
c
/
2
*
(
--
t
*
(
t
-
2
)
-
1
)
+
b
}
}
}
</
script
>
<
style
scoped
>
.back-to-ceiling
{
position
:
fixed
;
display
:
inline-block
;
text-align
:
center
;
cursor
:
pointer
;
}
.back-to-ceiling
:hover
{
background
:
#d5dbe7
;
}
.fade-enter-active
,
.fade-leave-active
{
transition
:
opacity
.5s
;
}
.fade-enter
,
.fade-leave-to
{
opacity
:
0
}
.back-to-ceiling
.Icon
{
fill
:
#9aaabf
;
background
:
none
;
}
</
style
>
src/components/DndList/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<div
class=
"dndList"
>
<div
:style=
"
{width:width1}" class="dndList-list">
<h3>
{{
list1Title
}}
</h3>
<draggable
:set-data=
"setData"
:list=
"list1"
group=
"article"
class=
"dragArea"
>
<div
v-for=
"element in list1"
:key=
"element.id"
class=
"list-complete-item"
>
<div
class=
"list-complete-item-handle"
>
{{
element
.
id
}}
[
{{
element
.
author
}}
]
{{
element
.
title
}}
</div>
<div
style=
"position:absolute;right:0px;"
>
<span
style=
"float: right ;margin-top: -20px;margin-right:5px;"
@
click=
"deleteEle(element)"
>
<i
style=
"color:#ff4949"
class=
"el-icon-delete"
/>
</span>
</div>
</div>
</draggable>
</div>
<div
:style=
"
{width:width2}" class="dndList-list">
<h3>
{{
list2Title
}}
</h3>
<draggable
:list=
"list2"
group=
"article"
class=
"dragArea"
>
<div
v-for=
"element in list2"
:key=
"element.id"
class=
"list-complete-item"
>
<div
class=
"list-complete-item-handle2"
@
click=
"pushEle(element)"
>
{{
element
.
id
}}
[
{{
element
.
author
}}
]
{{
element
.
title
}}
</div>
</div>
</draggable>
</div>
</div>
</
template
>
<
script
>
import
draggable
from
'vuedraggable'
export
default
{
name
:
'DndList'
,
components
:
{
draggable
},
props
:
{
list1
:
{
type
:
Array
,
default
()
{
return
[]
}
},
list2
:
{
type
:
Array
,
default
()
{
return
[]
}
},
list1Title
:
{
type
:
String
,
default
:
'list1'
},
list2Title
:
{
type
:
String
,
default
:
'list2'
},
width1
:
{
type
:
String
,
default
:
'48%'
},
width2
:
{
type
:
String
,
default
:
'48%'
}
},
methods
:
{
isNotInList1
(
v
)
{
return
this
.
list1
.
every
(
k
=>
v
.
id
!==
k
.
id
)
},
isNotInList2
(
v
)
{
return
this
.
list2
.
every
(
k
=>
v
.
id
!==
k
.
id
)
},
deleteEle
(
ele
)
{
for
(
const
item
of
this
.
list1
)
{
if
(
item
.
id
===
ele
.
id
)
{
const
index
=
this
.
list1
.
indexOf
(
item
)
this
.
list1
.
splice
(
index
,
1
)
break
}
}
if
(
this
.
isNotInList2
(
ele
))
{
this
.
list2
.
unshift
(
ele
)
}
},
pushEle
(
ele
)
{
for
(
const
item
of
this
.
list2
)
{
if
(
item
.
id
===
ele
.
id
)
{
const
index
=
this
.
list2
.
indexOf
(
item
)
this
.
list2
.
splice
(
index
,
1
)
break
}
}
if
(
this
.
isNotInList1
(
ele
))
{
this
.
list1
.
push
(
ele
)
}
},
setData
(
dataTransfer
)
{
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer
.
setData
(
'Text'
,
''
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.dndList
{
background
:
#fff
;
padding-bottom
:
40px
;
&
:after
{
content
:
""
;
display
:
table
;
clear
:
both
;
}
.dndList-list
{
float
:
left
;
padding-bottom
:
30px
;
&
:first-of-type
{
margin-right
:
2%
;
}
.dragArea
{
margin-top
:
15px
;
min-height
:
50px
;
padding-bottom
:
30px
;
}
}
}
.list-complete-item
{
cursor
:
pointer
;
position
:
relative
;
font-size
:
14px
;
padding
:
5px
12px
;
margin-top
:
4px
;
border
:
1px
solid
#bfcbd9
;
transition
:
all
1s
;
}
.list-complete-item-handle
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
margin-right
:
50px
;
}
.list-complete-item-handle2
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
margin-right
:
20px
;
}
.list-complete-item.sortable-chosen
{
background
:
#4AB7BD
;
}
.list-complete-item.sortable-ghost
{
background
:
#30B08F
;
}
.list-complete-enter
,
.list-complete-leave-active
{
opacity
:
0
;
}
</
style
>
src/components/DragSelect/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<el-select
ref=
"dragSelect"
v-model=
"selectVal"
v-bind=
"$attrs"
class=
"drag-select"
multiple
v-on=
"$listeners"
>
<slot
/>
</el-select>
</
template
>
<
script
>
import
Sortable
from
'sortablejs'
export
default
{
name
:
'DragSelect'
,
props
:
{
value
:
{
type
:
Array
,
required
:
true
}
},
computed
:
{
selectVal
:
{
get
()
{
return
[...
this
.
value
]
},
set
(
val
)
{
this
.
$emit
(
'input'
,
[...
val
])
}
}
},
mounted
()
{
this
.
setSort
()
},
methods
:
{
setSort
()
{
const
el
=
this
.
$refs
.
dragSelect
.
$el
.
querySelectorAll
(
'.el-select__tags > span'
)[
0
]
this
.
sortable
=
Sortable
.
create
(
el
,
{
ghostClass
:
'sortable-ghost'
,
// Class name for the drop placeholder,
setData
:
function
(
dataTransfer
)
{
dataTransfer
.
setData
(
'Text'
,
''
)
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
},
onEnd
:
evt
=>
{
const
targetRow
=
this
.
value
.
splice
(
evt
.
oldIndex
,
1
)[
0
]
this
.
value
.
splice
(
evt
.
newIndex
,
0
,
targetRow
)
}
})
}
}
}
</
script
>
<
style
scoped
>
.drag-select
>>>
.sortable-ghost
{
opacity
:
.8
;
color
:
#fff
!important
;
background
:
#42b983
!important
;
}
.drag-select
>>>
.el-tag
{
cursor
:
pointer
;
}
</
style
>
src/components/ErrorLog/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<div
v-if=
"errorLogs.length>0"
>
<el-badge
:is-dot=
"true"
style=
"line-height: 25px;margin-top: -5px;"
@
click
.
native=
"dialogTableVisible=true"
>
<el-button
style=
"padding: 8px 10px;"
size=
"small"
type=
"danger"
>
<svg-icon
icon-class=
"bug"
/>
</el-button>
</el-badge>
<el-dialog
:visible
.
sync=
"dialogTableVisible"
width=
"80%"
append-to-body
>
<div
slot=
"title"
>
<span
style=
"padding-right: 10px;"
>
Error Log
</span>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-delete"
@
click=
"clearAll"
>
Clear All
</el-button>
</div>
<el-table
:data=
"errorLogs"
border
>
<el-table-column
label=
"Message"
>
<template
slot-scope=
"
{row}">
<div>
<span
class=
"message-title"
>
Msg:
</span>
<el-tag
type=
"danger"
>
{{
row
.
err
.
message
}}
</el-tag>
</div>
<br>
<div>
<span
class=
"message-title"
style=
"padding-right: 10px;"
>
Info:
</span>
<el-tag
type=
"warning"
>
{{
row
.
vm
.
$vnode
.
tag
}}
error in
{{
row
.
info
}}
</el-tag>
</div>
<br>
<div>
<span
class=
"message-title"
style=
"padding-right: 16px;"
>
Url:
</span>
<el-tag
type=
"success"
>
{{
row
.
url
}}
</el-tag>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"Stack"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
err
.
stack
}}
</
template
>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<
script
>
export
default
{
name
:
'ErrorLog'
,
data
()
{
return
{
dialogTableVisible
:
false
}
},
computed
:
{
errorLogs
()
{
return
this
.
$store
.
getters
.
errorLogs
}
},
methods
:
{
clearAll
()
{
this
.
dialogTableVisible
=
false
this
.
$store
.
dispatch
(
'errorLog/clearErrorLog'
)
}
}
}
</
script
>
<
style
scoped
>
.message-title
{
font-size
:
16px
;
color
:
#333
;
font-weight
:
bold
;
padding-right
:
8px
;
}
</
style
>
src/components/GithubCorner/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<a
href=
"https://github.com/PanJiaChen/vue-element-admin"
target=
"_blank"
class=
"github-corner"
aria-label=
"View source on Github"
>
<svg
width=
"80"
height=
"80"
viewBox=
"0 0 250 250"
style=
"fill:#40c9c6; color:#fff;"
aria-hidden=
"true"
>
<path
d=
"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"
/>
<path
d=
"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill=
"currentColor"
style=
"transform-origin: 130px 106px;"
class=
"octo-arm"
/>
<path
d=
"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill=
"currentColor"
class=
"octo-body"
/>
</svg>
</a>
</
template
>
<
style
scoped
>
.github-corner
:hover
.octo-arm
{
animation
:
octocat-wave
560ms
ease-in-out
}
@keyframes
octocat-wave
{
0
%,
100
%
{
transform
:
rotate
(
0
)
}
20
%,
60
%
{
transform
:
rotate
(
-25deg
)
}
40
%,
80
%
{
transform
:
rotate
(
10deg
)
}
}
@media
(
max-width
:
500px
)
{
.github-corner
:hover
.octo-arm
{
animation
:
none
}
.github-corner
.octo-arm
{
animation
:
octocat-wave
560ms
ease-in-out
}
}
</
style
>
src/components/ImageCropper/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<div
v-show=
"value"
class=
"vue-image-crop-upload"
>
<div
class=
"vicp-wrap"
>
<div
class=
"vicp-close"
@
click=
"off"
>
<i
class=
"vicp-icon4"
/>
</div>
<div
v-show=
"step == 1"
class=
"vicp-step1"
>
<div
class=
"vicp-drop-area"
@
dragleave=
"preventDefault"
@
dragover=
"preventDefault"
@
dragenter=
"preventDefault"
@
click=
"handleClick"
@
drop=
"handleChange"
>
<i
v-show=
"loading != 1"
class=
"vicp-icon1"
>
<i
class=
"vicp-icon1-arrow"
/>
<i
class=
"vicp-icon1-body"
/>
<i
class=
"vicp-icon1-bottom"
/>
</i>
<span
v-show=
"loading !== 1"
class=
"vicp-hint"
>
{{
lang
.
hint
}}
</span>
<span
v-show=
"!isSupported"
class=
"vicp-no-supported-hint"
>
{{
lang
.
noSupported
}}
</span>
<input
v-show=
"false"
v-if=
"step == 1"
ref=
"fileinput"
type=
"file"
@
change=
"handleChange"
>
</div>
<div
v-show=
"hasError"
class=
"vicp-error"
>
<i
class=
"vicp-icon2"
/>
{{
errorMsg
}}
</div>
<div
class=
"vicp-operate"
>
<a
@
click=
"off"
@
mousedown=
"ripple"
>
{{
lang
.
btn
.
off
}}
</a>
</div>
</div>
<div
v-if=
"step == 2"
class=
"vicp-step2"
>
<div
class=
"vicp-crop"
>
<div
v-show=
"true"
class=
"vicp-crop-left"
>
<div
class=
"vicp-img-container"
>
<img
ref=
"img"
:src=
"sourceImgUrl"
:style=
"sourceImgStyle"
class=
"vicp-img"
draggable=
"false"
@
drag=
"preventDefault"
@
dragstart=
"preventDefault"
@
dragend=
"preventDefault"
@
dragleave=
"preventDefault"
@
dragover=
"preventDefault"
@
dragenter=
"preventDefault"
@
drop=
"preventDefault"
@
touchstart=
"imgStartMove"
@
touchmove=
"imgMove"
@
touchend=
"createImg"
@
touchcancel=
"createImg"
@
mousedown=
"imgStartMove"
@
mousemove=
"imgMove"
@
mouseup=
"createImg"
@
mouseout=
"createImg"
>
<div
:style=
"sourceImgShadeStyle"
class=
"vicp-img-shade vicp-img-shade-1"
/>
<div
:style=
"sourceImgShadeStyle"
class=
"vicp-img-shade vicp-img-shade-2"
/>
</div>
<div
class=
"vicp-range"
>
<input
:value=
"scale.range"
type=
"range"
step=
"1"
min=
"0"
max=
"100"
@
input=
"zoomChange"
>
<i
class=
"vicp-icon5"
@
mousedown=
"startZoomSub"
@
mouseout=
"endZoomSub"
@
mouseup=
"endZoomSub"
/>
<i
class=
"vicp-icon6"
@
mousedown=
"startZoomAdd"
@
mouseout=
"endZoomAdd"
@
mouseup=
"endZoomAdd"
/>
</div>
<div
v-if=
"!noRotate"
class=
"vicp-rotate"
>
<i
@
mousedown=
"startRotateLeft"
@
mouseout=
"endRotate"
@
mouseup=
"endRotate"
>
↺
</i>
<i
@
mousedown=
"startRotateRight"
@
mouseout=
"endRotate"
@
mouseup=
"endRotate"
>
↻
</i>
</div>
</div>
<div
v-show=
"true"
class=
"vicp-crop-right"
>
<div
class=
"vicp-preview"
>
<div
v-if=
"!noSquare"
class=
"vicp-preview-item"
>
<img
:src=
"createImgUrl"
:style=
"previewStyle"
>
<span>
{{
lang
.
preview
}}
</span>
</div>
<div
v-if=
"!noCircle"
class=
"vicp-preview-item vicp-preview-item-circle"
>
<img
:src=
"createImgUrl"
:style=
"previewStyle"
>
<span>
{{
lang
.
preview
}}
</span>
</div>
</div>
</div>
</div>
<div
class=
"vicp-operate"
>
<a
@
click=
"setStep(1)"
@
mousedown=
"ripple"
>
{{
lang
.
btn
.
back
}}
</a>
<a
class=
"vicp-operate-btn"
@
click=
"prepareUpload"
@
mousedown=
"ripple"
>
{{
lang
.
btn
.
save
}}
</a>
</div>
</div>
<div
v-if=
"step == 3"
class=
"vicp-step3"
>
<div
class=
"vicp-upload"
>
<span
v-show=
"loading === 1"
class=
"vicp-loading"
>
{{
lang
.
loading
}}
</span>
<div
class=
"vicp-progress-wrap"
>
<span
v-show=
"loading === 1"
:style=
"progressStyle"
class=
"vicp-progress"
/>
</div>
<div
v-show=
"hasError"
class=
"vicp-error"
>
<i
class=
"vicp-icon2"
/>
{{
errorMsg
}}
</div>
<div
v-show=
"loading === 2"
class=
"vicp-success"
>
<i
class=
"vicp-icon3"
/>
{{
lang
.
success
}}
</div>
</div>
<div
class=
"vicp-operate"
>
<a
@
click=
"setStep(2)"
@
mousedown=
"ripple"
>
{{
lang
.
btn
.
back
}}
</a>
<a
@
click=
"off"
@
mousedown=
"ripple"
>
{{
lang
.
btn
.
close
}}
</a>
</div>
</div>
<canvas
v-show=
"false"
ref=
"canvas"
:width=
"width"
:height=
"height"
/>
</div>
</div>
</
template
>
<
script
>
'use strict'
import
request
from
'@/utils/request'
import
language
from
'./utils/language.js'
import
mimes
from
'./utils/mimes.js'
import
data2blob
from
'./utils/data2blob.js'
import
effectRipple
from
'./utils/effectRipple.js'
export
default
{
props
:
{
// 域,上传文件name,触发事件会带上(如果一个页面多个图片上传控件,可以做区分
field
:
{
type
:
String
,
default
:
'avatar'
},
// 原名key,类似于id,触发事件会带上(如果一个页面多个图片上传控件,可以做区分
ki
:
{
type
:
Number
,
default
:
0
},
// 显示该控件与否
value
:
{
type
:
Boolean
,
default
:
true
},
// 上传地址
url
:
{
type
:
String
,
default
:
''
},
// 其他要上传文件附带的数据,对象格式
params
:
{
type
:
Object
,
default
:
null
},
// Add custom headers
headers
:
{
type
:
Object
,
default
:
null
},
// 剪裁图片的宽
width
:
{
type
:
Number
,
default
:
200
},
// 剪裁图片的高
height
:
{
type
:
Number
,
default
:
200
},
// 不显示旋转功能
noRotate
:
{
type
:
Boolean
,
default
:
true
},
// 不预览圆形图片
noCircle
:
{
type
:
Boolean
,
default
:
false
},
// 不预览方形图片
noSquare
:
{
type
:
Boolean
,
default
:
false
},
// 单文件大小限制
maxSize
:
{
type
:
Number
,
default
:
10240
},
// 语言类型
langType
:
{
type
:
String
,
default
:
'zh'
},
// 语言包
langExt
:
{
type
:
Object
,
default
:
null
},
// 图片上传格式
imgFormat
:
{
type
:
String
,
default
:
'png'
},
// 是否支持跨域
withCredentials
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
const
{
imgFormat
,
langType
,
langExt
,
width
,
height
}
=
this
let
isSupported
=
true
const
allowImgFormat
=
[
'jpg'
,
'png'
]
const
tempImgFormat
=
allowImgFormat
.
indexOf
(
imgFormat
)
===
-
1
?
'jpg'
:
imgFormat
const
lang
=
language
[
langType
]
?
language
[
langType
]
:
language
[
'en'
]
const
mime
=
mimes
[
tempImgFormat
]
// 规范图片格式
this
.
imgFormat
=
tempImgFormat
if
(
langExt
)
{
Object
.
assign
(
lang
,
langExt
)
}
if
(
typeof
FormData
!==
'function'
)
{
isSupported
=
false
}
return
{
// 图片的mime
mime
,
// 语言包
lang
,
// 浏览器是否支持该控件
isSupported
,
// 浏览器是否支持触屏事件
isSupportTouch
:
document
.
hasOwnProperty
(
'ontouchstart'
),
// 步骤
step
:
1
,
// 1选择文件 2剪裁 3上传
// 上传状态及进度
loading
:
0
,
// 0未开始 1正在 2成功 3错误
progress
:
0
,
// 是否有错误及错误信息
hasError
:
false
,
errorMsg
:
''
,
// 需求图宽高比
ratio
:
width
/
height
,
// 原图地址、生成图片地址
sourceImg
:
null
,
sourceImgUrl
:
''
,
createImgUrl
:
''
,
// 原图片拖动事件初始值
sourceImgMouseDown
:
{
on
:
false
,
mX
:
0
,
// 鼠标按下的坐标
mY
:
0
,
x
:
0
,
// scale原图坐标
y
:
0
},
// 生成图片预览的容器大小
previewContainer
:
{
width
:
100
,
height
:
100
},
// 原图容器宽高
sourceImgContainer
:
{
// sic
width
:
240
,
height
:
184
// 如果生成图比例与此一致会出现bug,先改成特殊的格式吧,哈哈哈
},
// 原图展示属性
scale
:
{
zoomAddOn
:
false
,
// 按钮缩放事件开启
zoomSubOn
:
false
,
// 按钮缩放事件开启
range
:
1
,
// 最大100
rotateLeft
:
false
,
// 按钮向左旋转事件开启
rotateRight
:
false
,
// 按钮向右旋转事件开启
degree
:
0
,
// 旋转度数
x
:
0
,
y
:
0
,
width
:
0
,
height
:
0
,
maxWidth
:
0
,
maxHeight
:
0
,
minWidth
:
0
,
// 最宽
minHeight
:
0
,
naturalWidth
:
0
,
// 原宽
naturalHeight
:
0
}
}
},
computed
:
{
// 进度条样式
progressStyle
()
{
const
{
progress
}
=
this
return
{
width
:
progress
+
'%'
}
},
// 原图样式
sourceImgStyle
()
{
const
{
scale
,
sourceImgMasking
}
=
this
const
top
=
scale
.
y
+
sourceImgMasking
.
y
+
'px'
const
left
=
scale
.
x
+
sourceImgMasking
.
x
+
'px'
return
{
top
,
left
,
width
:
scale
.
width
+
'px'
,
height
:
scale
.
height
+
'px'
,
transform
:
'rotate('
+
scale
.
degree
+
'deg)'
,
// 旋转时 左侧原始图旋转样式
'-ms-transform'
:
'rotate('
+
scale
.
degree
+
'deg)'
,
// 兼容IE9
'-moz-transform'
:
'rotate('
+
scale
.
degree
+
'deg)'
,
// 兼容FireFox
'-webkit-transform'
:
'rotate('
+
scale
.
degree
+
'deg)'
,
// 兼容Safari 和 chrome
'-o-transform'
:
'rotate('
+
scale
.
degree
+
'deg)'
// 兼容 Opera
}
},
// 原图蒙版属性
sourceImgMasking
()
{
const
{
width
,
height
,
ratio
,
sourceImgContainer
}
=
this
const
sic
=
sourceImgContainer
const
sicRatio
=
sic
.
width
/
sic
.
height
// 原图容器宽高比
let
x
=
0
let
y
=
0
let
w
=
sic
.
width
let
h
=
sic
.
height
let
scale
=
1
if
(
ratio
<
sicRatio
)
{
scale
=
sic
.
height
/
height
w
=
sic
.
height
*
ratio
x
=
(
sic
.
width
-
w
)
/
2
}
if
(
ratio
>
sicRatio
)
{
scale
=
sic
.
width
/
width
h
=
sic
.
width
/
ratio
y
=
(
sic
.
height
-
h
)
/
2
}
return
{
scale
,
// 蒙版相对需求宽高的缩放
x
,
y
,
width
:
w
,
height
:
h
}
},
// 原图遮罩样式
sourceImgShadeStyle
()
{
const
{
sourceImgMasking
,
sourceImgContainer
}
=
this
const
sic
=
sourceImgContainer
const
sim
=
sourceImgMasking
const
w
=
sim
.
width
===
sic
.
width
?
sim
.
width
:
(
sic
.
width
-
sim
.
width
)
/
2
const
h
=
sim
.
height
===
sic
.
height
?
sim
.
height
:
(
sic
.
height
-
sim
.
height
)
/
2
return
{
width
:
w
+
'px'
,
height
:
h
+
'px'
}
},
previewStyle
()
{
const
{
ratio
,
previewContainer
}
=
this
const
pc
=
previewContainer
let
w
=
pc
.
width
let
h
=
pc
.
height
const
pcRatio
=
w
/
h
if
(
ratio
<
pcRatio
)
{
w
=
pc
.
height
*
ratio
}
if
(
ratio
>
pcRatio
)
{
h
=
pc
.
width
/
ratio
}
return
{
width
:
w
+
'px'
,
height
:
h
+
'px'
}
}
},
watch
:
{
value
(
newValue
)
{
if
(
newValue
&&
this
.
loading
!==
1
)
{
this
.
reset
()
}
}
},
created
()
{
// 绑定按键esc隐藏此插件事件
document
.
addEventListener
(
'keyup'
,
this
.
closeHandler
)
},
destroyed
()
{
document
.
removeEventListener
(
'keyup'
,
this
.
closeHandler
)
},
methods
:
{
// 点击波纹效果
ripple
(
e
)
{
effectRipple
(
e
)
},
// 关闭控件
off
()
{
setTimeout
(()
=>
{
this
.
$emit
(
'input'
,
false
)
this
.
$emit
(
'close'
)
if
(
this
.
step
===
3
&&
this
.
loading
===
2
)
{
this
.
setStep
(
1
)
}
},
200
)
},
// 设置步骤
setStep
(
no
)
{
// 延时是为了显示动画效果呢,哈哈哈
setTimeout
(()
=>
{
this
.
step
=
no
},
200
)
},
/* 图片选择区域函数绑定
---------------------------------------------------------------*/
preventDefault
(
e
)
{
e
.
preventDefault
()
return
false
},
handleClick
(
e
)
{
if
(
this
.
loading
!==
1
)
{
if
(
e
.
target
!==
this
.
$refs
.
fileinput
)
{
e
.
preventDefault
()
if
(
document
.
activeElement
!==
this
.
$refs
)
{
this
.
$refs
.
fileinput
.
click
()
}
}
}
},
handleChange
(
e
)
{
e
.
preventDefault
()
if
(
this
.
loading
!==
1
)
{
const
files
=
e
.
target
.
files
||
e
.
dataTransfer
.
files
this
.
reset
()
if
(
this
.
checkFile
(
files
[
0
]))
{
this
.
setSourceImg
(
files
[
0
])
}
}
},
/* ---------------------------------------------------------------*/
// 检测选择的文件是否合适
checkFile
(
file
)
{
const
{
lang
,
maxSize
}
=
this
// 仅限图片
if
(
file
.
type
.
indexOf
(
'image'
)
===
-
1
)
{
this
.
hasError
=
true
this
.
errorMsg
=
lang
.
error
.
onlyImg
return
false
}
// 超出大小
if
(
file
.
size
/
1024
>
maxSize
)
{
this
.
hasError
=
true
this
.
errorMsg
=
lang
.
error
.
outOfSize
+
maxSize
+
'kb'
return
false
}
return
true
},
// 重置控件
reset
()
{
this
.
loading
=
0
this
.
hasError
=
false
this
.
errorMsg
=
''
this
.
progress
=
0
},
// 设置图片源
setSourceImg
(
file
)
{
const
fr
=
new
FileReader
()
fr
.
onload
=
e
=>
{
this
.
sourceImgUrl
=
fr
.
result
this
.
startCrop
()
}
fr
.
readAsDataURL
(
file
)
},
// 剪裁前准备工作
startCrop
()
{
const
{
width
,
height
,
ratio
,
scale
,
sourceImgUrl
,
sourceImgMasking
,
lang
}
=
this
const
sim
=
sourceImgMasking
const
img
=
new
Image
()
img
.
src
=
sourceImgUrl
img
.
onload
=
()
=>
{
const
nWidth
=
img
.
naturalWidth
const
nHeight
=
img
.
naturalHeight
const
nRatio
=
nWidth
/
nHeight
let
w
=
sim
.
width
let
h
=
sim
.
height
let
x
=
0
let
y
=
0
// 图片像素不达标
if
(
nWidth
<
width
||
nHeight
<
height
)
{
this
.
hasError
=
true
this
.
errorMsg
=
lang
.
error
.
lowestPx
+
width
+
'*'
+
height
return
false
}
if
(
ratio
>
nRatio
)
{
h
=
w
/
nRatio
y
=
(
sim
.
height
-
h
)
/
2
}
if
(
ratio
<
nRatio
)
{
w
=
h
*
nRatio
x
=
(
sim
.
width
-
w
)
/
2
}
scale
.
range
=
0
scale
.
x
=
x
scale
.
y
=
y
scale
.
width
=
w
scale
.
height
=
h
scale
.
degree
=
0
scale
.
minWidth
=
w
scale
.
minHeight
=
h
scale
.
maxWidth
=
nWidth
*
sim
.
scale
scale
.
maxHeight
=
nHeight
*
sim
.
scale
scale
.
naturalWidth
=
nWidth
scale
.
naturalHeight
=
nHeight
this
.
sourceImg
=
img
this
.
createImg
()
this
.
setStep
(
2
)
}
},
// 鼠标按下图片准备移动
imgStartMove
(
e
)
{
e
.
preventDefault
()
// 支持触摸事件,则鼠标事件无效
if
(
this
.
isSupportTouch
&&
!
e
.
targetTouches
)
{
return
false
}
const
et
=
e
.
targetTouches
?
e
.
targetTouches
[
0
]
:
e
const
{
sourceImgMouseDown
,
scale
}
=
this
const
simd
=
sourceImgMouseDown
simd
.
mX
=
et
.
screenX
simd
.
mY
=
et
.
screenY
simd
.
x
=
scale
.
x
simd
.
y
=
scale
.
y
simd
.
on
=
true
},
// 鼠标按下状态下移动,图片移动
imgMove
(
e
)
{
e
.
preventDefault
()
// 支持触摸事件,则鼠标事件无效
if
(
this
.
isSupportTouch
&&
!
e
.
targetTouches
)
{
return
false
}
const
et
=
e
.
targetTouches
?
e
.
targetTouches
[
0
]
:
e
const
{
sourceImgMouseDown
:
{
on
,
mX
,
mY
,
x
,
y
},
scale
,
sourceImgMasking
}
=
this
const
sim
=
sourceImgMasking
const
nX
=
et
.
screenX
const
nY
=
et
.
screenY
const
dX
=
nX
-
mX
const
dY
=
nY
-
mY
let
rX
=
x
+
dX
let
rY
=
y
+
dY
if
(
!
on
)
return
if
(
rX
>
0
)
{
rX
=
0
}
if
(
rY
>
0
)
{
rY
=
0
}
if
(
rX
<
sim
.
width
-
scale
.
width
)
{
rX
=
sim
.
width
-
scale
.
width
}
if
(
rY
<
sim
.
height
-
scale
.
height
)
{
rY
=
sim
.
height
-
scale
.
height
}
scale
.
x
=
rX
scale
.
y
=
rY
},
// 按钮按下开始向右旋转
startRotateRight
(
e
)
{
const
{
scale
}
=
this
scale
.
rotateRight
=
true
const
rotate
=
()
=>
{
if
(
scale
.
rotateRight
)
{
const
degree
=
++
scale
.
degree
this
.
createImg
(
degree
)
setTimeout
(
function
()
{
rotate
()
},
60
)
}
}
rotate
()
},
// 按钮按下开始向左旋转
startRotateLeft
(
e
)
{
const
{
scale
}
=
this
scale
.
rotateLeft
=
true
const
rotate
=
()
=>
{
if
(
scale
.
rotateLeft
)
{
const
degree
=
--
scale
.
degree
this
.
createImg
(
degree
)
setTimeout
(
function
()
{
rotate
()
},
60
)
}
}
rotate
()
},
// 停止旋转
endRotate
()
{
const
{
scale
}
=
this
scale
.
rotateLeft
=
false
scale
.
rotateRight
=
false
},
// 按钮按下开始放大
startZoomAdd
(
e
)
{
const
{
scale
}
=
this
scale
.
zoomAddOn
=
true
const
zoom
=
()
=>
{
if
(
scale
.
zoomAddOn
)
{
const
range
=
scale
.
range
>=
100
?
100
:
++
scale
.
range
this
.
zoomImg
(
range
)
setTimeout
(
function
()
{
zoom
()
},
60
)
}
}
zoom
()
},
// 按钮松开或移开取消放大
endZoomAdd
(
e
)
{
this
.
scale
.
zoomAddOn
=
false
},
// 按钮按下开始缩小
startZoomSub
(
e
)
{
const
{
scale
}
=
this
scale
.
zoomSubOn
=
true
const
zoom
=
()
=>
{
if
(
scale
.
zoomSubOn
)
{
const
range
=
scale
.
range
<=
0
?
0
:
--
scale
.
range
this
.
zoomImg
(
range
)
setTimeout
(
function
()
{
zoom
()
},
60
)
}
}
zoom
()
},
// 按钮松开或移开取消缩小
endZoomSub
(
e
)
{
const
{
scale
}
=
this
scale
.
zoomSubOn
=
false
},
zoomChange
(
e
)
{
this
.
zoomImg
(
e
.
target
.
value
)
},
// 缩放原图
zoomImg
(
newRange
)
{
const
{
sourceImgMasking
,
scale
}
=
this
const
{
maxWidth
,
maxHeight
,
minWidth
,
minHeight
,
width
,
height
,
x
,
y
}
=
scale
const
sim
=
sourceImgMasking
// 蒙版宽高
const
sWidth
=
sim
.
width
const
sHeight
=
sim
.
height
// 新宽高
const
nWidth
=
minWidth
+
((
maxWidth
-
minWidth
)
*
newRange
)
/
100
const
nHeight
=
minHeight
+
((
maxHeight
-
minHeight
)
*
newRange
)
/
100
// 新坐标(根据蒙版中心点缩放)
let
nX
=
sWidth
/
2
-
(
nWidth
/
width
)
*
(
sWidth
/
2
-
x
)
let
nY
=
sHeight
/
2
-
(
nHeight
/
height
)
*
(
sHeight
/
2
-
y
)
// 判断新坐标是否超过蒙版限制
if
(
nX
>
0
)
{
nX
=
0
}
if
(
nY
>
0
)
{
nY
=
0
}
if
(
nX
<
sWidth
-
nWidth
)
{
nX
=
sWidth
-
nWidth
}
if
(
nY
<
sHeight
-
nHeight
)
{
nY
=
sHeight
-
nHeight
}
// 赋值处理
scale
.
x
=
nX
scale
.
y
=
nY
scale
.
width
=
nWidth
scale
.
height
=
nHeight
scale
.
range
=
newRange
setTimeout
(()
=>
{
if
(
scale
.
range
===
newRange
)
{
this
.
createImg
()
}
},
300
)
},
// 生成需求图片
createImg
(
e
)
{
const
{
mime
,
sourceImg
,
scale
:
{
x
,
y
,
width
,
height
,
degree
},
sourceImgMasking
:
{
scale
}
}
=
this
const
canvas
=
this
.
$refs
.
canvas
const
ctx
=
canvas
.
getContext
(
'2d'
)
if
(
e
)
{
// 取消鼠标按下移动状态
this
.
sourceImgMouseDown
.
on
=
false
}
canvas
.
width
=
this
.
width
canvas
.
height
=
this
.
height
ctx
.
clearRect
(
0
,
0
,
this
.
width
,
this
.
height
)
// 将透明区域设置为白色底边
ctx
.
fillStyle
=
'#fff'
ctx
.
fillRect
(
0
,
0
,
this
.
width
,
this
.
height
)
ctx
.
translate
(
this
.
width
*
0.5
,
this
.
height
*
0.5
)
ctx
.
rotate
((
Math
.
PI
*
degree
)
/
180
)
ctx
.
translate
(
-
this
.
width
*
0.5
,
-
this
.
height
*
0.5
)
ctx
.
drawImage
(
sourceImg
,
x
/
scale
,
y
/
scale
,
width
/
scale
,
height
/
scale
)
this
.
createImgUrl
=
canvas
.
toDataURL
(
mime
)
},
prepareUpload
()
{
const
{
url
,
createImgUrl
,
field
,
ki
}
=
this
this
.
$emit
(
'crop-success'
,
createImgUrl
,
field
,
ki
)
if
(
typeof
url
===
'string'
&&
url
)
{
this
.
upload
()
}
else
{
this
.
off
()
}
},
// 上传图片
upload
()
{
const
{
lang
,
imgFormat
,
mime
,
url
,
params
,
field
,
ki
,
createImgUrl
}
=
this
const
fmData
=
new
FormData
()
fmData
.
append
(
field
,
data2blob
(
createImgUrl
,
mime
),
field
+
'.'
+
imgFormat
)
// 添加其他参数
if
(
typeof
params
===
'object'
&&
params
)
{
Object
.
keys
(
params
).
forEach
(
k
=>
{
fmData
.
append
(
k
,
params
[
k
])
})
}
// 监听进度回调
// const uploadProgress = (event) => {
// if (event.lengthComputable) {
// this.progress = 100 * Math.round(event.loaded) / event.total
// }
// }
// 上传文件
this
.
reset
()
this
.
loading
=
1
this
.
setStep
(
3
)
request
({
url
,
method
:
'post'
,
data
:
fmData
})
.
then
(
resData
=>
{
this
.
loading
=
2
this
.
$emit
(
'crop-upload-success'
,
resData
.
data
)
})
.
catch
(
err
=>
{
if
(
this
.
value
)
{
this
.
loading
=
3
this
.
hasError
=
true
this
.
errorMsg
=
lang
.
fail
this
.
$emit
(
'crop-upload-fail'
,
err
,
field
,
ki
)
}
})
},
closeHandler
(
e
)
{
if
(
this
.
value
&&
(
e
.
key
===
'Escape'
||
e
.
keyCode
===
27
))
{
this
.
off
()
}
}
}
}
</
script
>
<
style
lang=
"scss"
>
@charset
"UTF-8"
;
@-webkit-keyframes
vicp_progress
{
0
%
{
background-position-y
:
0
;
}
100
%
{
background-position-y
:
40px
;
}
}
@keyframes
vicp_progress
{
0
%
{
background-position-y
:
0
;
}
100
%
{
background-position-y
:
40px
;
}
}
@-webkit-keyframes
vicp
{
0
%
{
opacity
:
0
;
-webkit-transform
:
scale
(
0
)
translatey
(
-60px
);
transform
:
scale
(
0
)
translatey
(
-60px
);
}
100
%
{
opacity
:
1
;
-webkit-transform
:
scale
(
1
)
translatey
(
0
);
transform
:
scale
(
1
)
translatey
(
0
);
}
}
@keyframes
vicp
{
0
%
{
opacity
:
0
;
-webkit-transform
:
scale
(
0
)
translatey
(
-60px
);
transform
:
scale
(
0
)
translatey
(
-60px
);
}
100
%
{
opacity
:
1
;
-webkit-transform
:
scale
(
1
)
translatey
(
0
);
transform
:
scale
(
1
)
translatey
(
0
);
}
}
.vue-image-crop-upload
{
position
:
fixed
;
display
:
block
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
z-index
:
10000
;
top
:
0
;
bottom
:
0
;
left
:
0
;
right
:
0
;
width
:
100%
;
height
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.65
);
-webkit-tap-highlight-color
:
transparent
;
-moz-tap-highlight-color
:
transparent
;
}
.vue-image-crop-upload
.vicp-wrap
{
-webkit-box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
position
:
fixed
;
display
:
block
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
z-index
:
10000
;
top
:
0
;
bottom
:
0
;
left
:
0
;
right
:
0
;
margin
:
auto
;
width
:
600px
;
height
:
330px
;
padding
:
25px
;
background-color
:
#fff
;
border-radius
:
2px
;
-webkit-animation
:
vicp
0
.12s
ease-in
;
animation
:
vicp
0
.12s
ease-in
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-close
{
position
:
absolute
;
right
:
-30px
;
top
:
-30px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-close
.vicp-icon4
{
position
:
relative
;
display
:
block
;
width
:
30px
;
height
:
30px
;
cursor
:
pointer
;
-webkit-transition
:
-
webkit-transform
0
.18s
;
transition
:
-
webkit-transform
0
.18s
;
transition
:
transform
0
.18s
;
transition
:
transform
0
.18s
,
-
webkit-transform
0
.18s
;
-webkit-transform
:
rotate
(
0
);
-ms-transform
:
rotate
(
0
);
transform
:
rotate
(
0
);
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-close
.
vicp-icon4
:
:
after
,
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-close
.
vicp-icon4
::
before
{
-webkit-box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
content
:
""
;
position
:
absolute
;
top
:
12px
;
left
:
4px
;
width
:
20px
;
height
:
3px
;
-webkit-transform
:
rotate
(
45deg
);
-ms-transform
:
rotate
(
45deg
);
transform
:
rotate
(
45deg
);
background-color
:
#fff
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-close
.
vicp-icon4
:
:
after
{
-webkit-transform
:
rotate
(
-45deg
);
-ms-transform
:
rotate
(
-45deg
);
transform
:
rotate
(
-45deg
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-close
.vicp-icon4
:hover
{
-webkit-transform
:
rotate
(
90deg
);
-ms-transform
:
rotate
(
90deg
);
transform
:
rotate
(
90deg
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
{
position
:
relative
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
35px
;
height
:
170px
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.03
);
text-align
:
center
;
border
:
1px
dashed
rgba
(
0
,
0
,
0
,
0
.08
);
overflow
:
hidden
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
.vicp-icon1
{
display
:
block
;
margin
:
0
auto
6px
;
width
:
42px
;
height
:
42px
;
overflow
:
hidden
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
.vicp-icon1
.vicp-icon1-arrow
{
display
:
block
;
margin
:
0
auto
;
width
:
0
;
height
:
0
;
border-bottom
:
14
.7px
solid
rgba
(
0
,
0
,
0
,
0
.3
);
border-left
:
14
.7px
solid
transparent
;
border-right
:
14
.7px
solid
transparent
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
.vicp-icon1
.vicp-icon1-body
{
display
:
block
;
width
:
12
.6px
;
height
:
14
.7px
;
margin
:
0
auto
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.3
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
.vicp-icon1
.vicp-icon1-bottom
{
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
display
:
block
;
height
:
12
.6px
;
border
:
6px
solid
rgba
(
0
,
0
,
0
,
0
.3
);
border-top
:
none
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
.vicp-hint
{
display
:
block
;
padding
:
15px
;
font-size
:
14px
;
color
:
#666
;
line-height
:
30px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
.vicp-no-supported-hint
{
display
:
block
;
position
:
absolute
;
top
:
0
;
left
:
0
;
padding
:
30px
;
width
:
100%
;
height
:
60px
;
line-height
:
30px
;
background-color
:
#eee
;
text-align
:
center
;
color
:
#666
;
font-size
:
14px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step1
.vicp-drop-area
:hover
{
cursor
:
pointer
;
border-color
:
rgba
(
0
,
0
,
0
,
0
.1
);
background-color
:
rgba
(
0
,
0
,
0
,
0
.05
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
{
overflow
:
hidden
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
{
float
:
left
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-img-container
{
position
:
relative
;
display
:
block
;
width
:
240px
;
height
:
180px
;
background-color
:
#e5e5e0
;
overflow
:
hidden
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-img-container
.vicp-img
{
position
:
absolute
;
display
:
block
;
cursor
:
move
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-img-container
.vicp-img-shade
{
-webkit-box-shadow
:
0
2px
6px
0
rgba
(
0
,
0
,
0
,
0
.18
);
box-shadow
:
0
2px
6px
0
rgba
(
0
,
0
,
0
,
0
.18
);
position
:
absolute
;
background-color
:
rgba
(
241
,
242
,
243
,
0
.8
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-img-container
.vicp-img-shade.vicp-img-shade-1
{
top
:
0
;
left
:
0
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-img-container
.vicp-img-shade.vicp-img-shade-2
{
bottom
:
0
;
right
:
0
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-rotate
{
position
:
relative
;
width
:
240px
;
height
:
18px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-rotate
i
{
display
:
block
;
width
:
18px
;
height
:
18px
;
border-radius
:
100%
;
line-height
:
18px
;
text-align
:
center
;
font-size
:
12px
;
font-weight
:
bold
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.08
);
color
:
#fff
;
overflow
:
hidden
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-rotate
i
:hover
{
-webkit-box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
cursor
:
pointer
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.14
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-rotate
i
:first-child
{
float
:
left
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-rotate
i
:last-child
{
float
:
right
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
{
position
:
relative
;
margin
:
30px
0
10px
0
;
width
:
240px
;
height
:
18px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
.vicp-icon5
,
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
.vicp-icon6
{
position
:
absolute
;
top
:
0
;
width
:
18px
;
height
:
18px
;
border-radius
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.08
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
.vicp-icon5
:hover
,
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
.vicp-icon6
:hover
{
-webkit-box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
cursor
:
pointer
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.14
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
.vicp-icon5
{
left
:
0
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-step2
.
vicp-crop
.
vicp-crop-left
.
vicp-range
.
vicp-icon5
:
:
before
{
position
:
absolute
;
content
:
""
;
display
:
block
;
left
:
3px
;
top
:
8px
;
width
:
12px
;
height
:
2px
;
background-color
:
#fff
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
.vicp-icon6
{
right
:
0
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-step2
.
vicp-crop
.
vicp-crop-left
.
vicp-range
.
vicp-icon6
:
:
before
{
position
:
absolute
;
content
:
""
;
display
:
block
;
left
:
3px
;
top
:
8px
;
width
:
12px
;
height
:
2px
;
background-color
:
#fff
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-step2
.
vicp-crop
.
vicp-crop-left
.
vicp-range
.
vicp-icon6
:
:
after
{
position
:
absolute
;
content
:
""
;
display
:
block
;
top
:
3px
;
left
:
8px
;
width
:
2px
;
height
:
12px
;
background-color
:
#fff
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
{
display
:
block
;
padding-top
:
5px
;
margin
:
0
auto
;
width
:
180px
;
height
:
8px
;
vertical-align
:
top
;
background
:
transparent
;
-webkit-appearance
:
none
;
-moz-appearance
:
none
;
appearance
:
none
;
cursor
:
pointer
;
/* 滑块
---------------------------------------------------------------*/
/* 轨道
---------------------------------------------------------------*/
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:focus
{
outline
:
none
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-webkit-slider-thumb
{
-webkit-box-shadow
:
0
2px
6px
0
rgba
(
0
,
0
,
0
,
0
.18
);
box-shadow
:
0
2px
6px
0
rgba
(
0
,
0
,
0
,
0
.18
);
-webkit-appearance
:
none
;
appearance
:
none
;
margin-top
:
-3px
;
width
:
12px
;
height
:
12px
;
background-color
:
#61c091
;
border-radius
:
100%
;
border
:
none
;
-webkit-transition
:
0
.2s
;
transition
:
0
.2s
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-moz-range-thumb
{
box-shadow
:
0
2px
6px
0
rgba
(
0
,
0
,
0
,
0
.18
);
-moz-appearance
:
none
;
appearance
:
none
;
width
:
12px
;
height
:
12px
;
background-color
:
#61c091
;
border-radius
:
100%
;
border
:
none
;
-webkit-transition
:
0
.2s
;
transition
:
0
.2s
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-ms-thumb
{
box-shadow
:
0
2px
6px
0
rgba
(
0
,
0
,
0
,
0
.18
);
appearance
:
none
;
width
:
12px
;
height
:
12px
;
background-color
:
#61c091
;
border
:
none
;
border-radius
:
100%
;
-webkit-transition
:
0
.2s
;
transition
:
0
.2s
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:active::-moz-range-thumb
{
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
width
:
14px
;
height
:
14px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:active::-ms-thumb
{
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
width
:
14px
;
height
:
14px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:active::-webkit-slider-thumb
{
-webkit-box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.23
);
margin-top
:
-4px
;
width
:
14px
;
height
:
14px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-webkit-slider-runnable-track
{
-webkit-box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
width
:
100%
;
height
:
6px
;
cursor
:
pointer
;
border-radius
:
2px
;
border
:
none
;
background-color
:
rgba
(
68
,
170
,
119
,
0
.3
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-moz-range-track
{
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
width
:
100%
;
height
:
6px
;
cursor
:
pointer
;
border-radius
:
2px
;
border
:
none
;
background-color
:
rgba
(
68
,
170
,
119
,
0
.3
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-ms-track
{
box-shadow
:
0
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.12
);
width
:
100%
;
cursor
:
pointer
;
background
:
transparent
;
border-color
:
transparent
;
color
:
transparent
;
height
:
6px
;
border-radius
:
2px
;
border
:
none
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-ms-fill-lower
{
background-color
:
rgba
(
68
,
170
,
119
,
0
.3
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
::-ms-fill-upper
{
background-color
:
rgba
(
68
,
170
,
119
,
0
.15
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:focus::-webkit-slider-runnable-track
{
background-color
:
rgba
(
68
,
170
,
119
,
0
.5
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:focus::-moz-range-track
{
background-color
:
rgba
(
68
,
170
,
119
,
0
.5
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:focus::-ms-fill-lower
{
background-color
:
rgba
(
68
,
170
,
119
,
0
.45
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-left
.vicp-range
input
[
type
=
"range"
]
:focus::-ms-fill-upper
{
background-color
:
rgba
(
68
,
170
,
119
,
0
.25
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
{
float
:
right
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
.vicp-preview
{
height
:
150px
;
overflow
:
hidden
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
.vicp-preview
.vicp-preview-item
{
position
:
relative
;
padding
:
5px
;
width
:
100px
;
height
:
100px
;
float
:
left
;
margin-right
:
16px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
.vicp-preview
.vicp-preview-item
span
{
position
:
absolute
;
bottom
:
-30px
;
width
:
100%
;
font-size
:
14px
;
color
:
#bbb
;
display
:
block
;
text-align
:
center
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
.vicp-preview
.vicp-preview-item
img
{
position
:
absolute
;
display
:
block
;
top
:
0
;
bottom
:
0
;
left
:
0
;
right
:
0
;
margin
:
auto
;
padding
:
3px
;
background-color
:
#fff
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.15
);
overflow
:
hidden
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
.vicp-preview
.vicp-preview-item.vicp-preview-item-circle
{
margin-right
:
0
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step2
.vicp-crop
.vicp-crop-right
.vicp-preview
.vicp-preview-item.vicp-preview-item-circle
img
{
border-radius
:
100%
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step3
.vicp-upload
{
position
:
relative
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
35px
;
height
:
170px
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.03
);
text-align
:
center
;
border
:
1px
dashed
#ddd
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step3
.vicp-upload
.vicp-loading
{
display
:
block
;
padding
:
15px
;
font-size
:
16px
;
color
:
#999
;
line-height
:
30px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step3
.vicp-upload
.vicp-progress-wrap
{
margin-top
:
12px
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.08
);
border-radius
:
3px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step3
.vicp-upload
.vicp-progress-wrap
.vicp-progress
{
position
:
relative
;
display
:
block
;
height
:
5px
;
border-radius
:
3px
;
background-color
:
#4a7
;
-webkit-box-shadow
:
0
2px
6px
0
rgba
(
68
,
170
,
119
,
0
.3
);
box-shadow
:
0
2px
6px
0
rgba
(
68
,
170
,
119
,
0
.3
);
-webkit-transition
:
width
0
.15s
linear
;
transition
:
width
0
.15s
linear
;
background-image
:
-webkit-linear-gradient
(
135deg
,
rgba
(
255
,
255
,
255
,
0
.2
)
25%
,
transparent
25%
,
transparent
50%
,
rgba
(
255
,
255
,
255
,
0
.2
)
50%
,
rgba
(
255
,
255
,
255
,
0
.2
)
75%
,
transparent
75%
,
transparent
);
background-image
:
linear-gradient
(
-45deg
,
rgba
(
255
,
255
,
255
,
0
.2
)
25%
,
transparent
25%
,
transparent
50%
,
rgba
(
255
,
255
,
255
,
0
.2
)
50%
,
rgba
(
255
,
255
,
255
,
0
.2
)
75%
,
transparent
75%
,
transparent
);
background-size
:
40px
40px
;
-webkit-animation
:
vicp_progress
0
.5s
linear
infinite
;
animation
:
vicp_progress
0
.5s
linear
infinite
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-step3
.
vicp-upload
.
vicp-progress-wrap
.
vicp-progress
:
:
after
{
content
:
""
;
position
:
absolute
;
display
:
block
;
top
:
-3px
;
right
:
-3px
;
width
:
9px
;
height
:
9px
;
border
:
1px
solid
rgba
(
245
,
246
,
247
,
0
.7
);
-webkit-box-shadow
:
0
1px
4px
0
rgba
(
68
,
170
,
119
,
0
.7
);
box-shadow
:
0
1px
4px
0
rgba
(
68
,
170
,
119
,
0
.7
);
border-radius
:
100%
;
background-color
:
#4a7
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-step3
.vicp-upload
.vicp-error
,
.vue-image-crop-upload
.vicp-wrap
.vicp-step3
.vicp-upload
.vicp-success
{
height
:
100px
;
line-height
:
100px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-operate
{
position
:
absolute
;
right
:
20px
;
bottom
:
20px
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-operate
a
{
position
:
relative
;
float
:
left
;
display
:
block
;
margin-left
:
10px
;
width
:
100px
;
height
:
36px
;
line-height
:
36px
;
text-align
:
center
;
cursor
:
pointer
;
font-size
:
14px
;
color
:
#4a7
;
border-radius
:
2px
;
overflow
:
hidden
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-operate
a
:hover
{
background-color
:
rgba
(
0
,
0
,
0
,
0
.03
);
}
.vue-image-crop-upload
.vicp-wrap
.vicp-error
,
.vue-image-crop-upload
.vicp-wrap
.vicp-success
{
display
:
block
;
font-size
:
14px
;
line-height
:
24px
;
height
:
24px
;
color
:
#d10
;
text-align
:
center
;
vertical-align
:
top
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-success
{
color
:
#4a7
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-icon3
{
position
:
relative
;
display
:
inline-block
;
width
:
20px
;
height
:
20px
;
top
:
4px
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-icon3
:
:
after
{
position
:
absolute
;
top
:
3px
;
left
:
6px
;
width
:
6px
;
height
:
10px
;
border-width
:
0
2px
2px
0
;
border-color
:
#4a7
;
border-style
:
solid
;
-webkit-transform
:
rotate
(
45deg
);
-ms-transform
:
rotate
(
45deg
);
transform
:
rotate
(
45deg
);
content
:
""
;
}
.vue-image-crop-upload
.vicp-wrap
.vicp-icon2
{
position
:
relative
;
display
:
inline-block
;
width
:
20px
;
height
:
20px
;
top
:
4px
;
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-icon2
:
:
after
,
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-icon2
::
before
{
content
:
""
;
position
:
absolute
;
top
:
9px
;
left
:
4px
;
width
:
13px
;
height
:
2px
;
background-color
:
#d10
;
-webkit-transform
:
rotate
(
45deg
);
-ms-transform
:
rotate
(
45deg
);
transform
:
rotate
(
45deg
);
}
.
vue-image-crop-upload
.
vicp-wrap
.
vicp-icon2
:
:
after
{
-webkit-transform
:
rotate
(
-45deg
);
-ms-transform
:
rotate
(
-45deg
);
transform
:
rotate
(
-45deg
);
}
.e-ripple
{
position
:
absolute
;
border-radius
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.15
);
background-clip
:
padding-box
;
pointer-events
:
none
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
-webkit-transform
:
scale
(
0
);
-ms-transform
:
scale
(
0
);
transform
:
scale
(
0
);
opacity
:
1
;
}
.e-ripple.z-active
{
opacity
:
0
;
-webkit-transform
:
scale
(
2
);
-ms-transform
:
scale
(
2
);
transform
:
scale
(
2
);
-webkit-transition
:
opacity
1
.2s
ease-out
,
-
webkit-transform
0
.6s
ease-out
;
transition
:
opacity
1
.2s
ease-out
,
-
webkit-transform
0
.6s
ease-out
;
transition
:
opacity
1
.2s
ease-out
,
transform
0
.6s
ease-out
;
transition
:
opacity
1
.2s
ease-out
,
transform
0
.6s
ease-out
,
-
webkit-transform
0
.6s
ease-out
;
}
</
style
>
src/components/ImageCropper/utils/data2blob.js
deleted
100755 → 0
View file @
26e37d74
/**
* database64文件格式转换为2进制
*
* @param {[String]} data dataURL 的格式为 “data:image/png;base64,****”,逗号之前都是一些说明性的文字,我们只需要逗号之后的就行了
* @param {[String]} mime [description]
* @return {[blob]} [description]
*/
export
default
function
(
data
,
mime
)
{
data
=
data
.
split
(
','
)[
1
]
data
=
window
.
atob
(
data
)
var
ia
=
new
Uint8Array
(
data
.
length
)
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
ia
[
i
]
=
data
.
charCodeAt
(
i
)
}
// canvas.toDataURL 返回的默认格式就是 image/png
return
new
Blob
([
ia
],
{
type
:
mime
})
}
src/components/ImageCropper/utils/effectRipple.js
deleted
100755 → 0
View file @
26e37d74
/**
* 点击波纹效果
*
* @param {[event]} e [description]
* @param {[Object]} arg_opts [description]
* @return {[bollean]} [description]
*/
export
default
function
(
e
,
arg_opts
)
{
var
opts
=
Object
.
assign
({
ele
:
e
.
target
,
// 波纹作用元素
type
:
'hit'
,
// hit点击位置扩散center中心点扩展
bgc
:
'rgba(0, 0, 0, 0.15)'
// 波纹颜色
},
arg_opts
)
var
target
=
opts
.
ele
if
(
target
)
{
var
rect
=
target
.
getBoundingClientRect
()
var
ripple
=
target
.
querySelector
(
'.e-ripple'
)
if
(
!
ripple
)
{
ripple
=
document
.
createElement
(
'span'
)
ripple
.
className
=
'e-ripple'
ripple
.
style
.
height
=
ripple
.
style
.
width
=
Math
.
max
(
rect
.
width
,
rect
.
height
)
+
'px'
target
.
appendChild
(
ripple
)
}
else
{
ripple
.
className
=
'e-ripple'
}
switch
(
opts
.
type
)
{
case
'center'
:
ripple
.
style
.
top
=
(
rect
.
height
/
2
-
ripple
.
offsetHeight
/
2
)
+
'px'
ripple
.
style
.
left
=
(
rect
.
width
/
2
-
ripple
.
offsetWidth
/
2
)
+
'px'
break
default
:
ripple
.
style
.
top
=
(
e
.
pageY
-
rect
.
top
-
ripple
.
offsetHeight
/
2
-
document
.
body
.
scrollTop
)
+
'px'
ripple
.
style
.
left
=
(
e
.
pageX
-
rect
.
left
-
ripple
.
offsetWidth
/
2
-
document
.
body
.
scrollLeft
)
+
'px'
}
ripple
.
style
.
backgroundColor
=
opts
.
bgc
ripple
.
className
=
'e-ripple z-active'
return
false
}
}
src/components/ImageCropper/utils/language.js
deleted
100755 → 0
View file @
26e37d74
export
default
{
zh
:
{
hint
:
'点击,或拖动图片至此处'
,
loading
:
'正在上传……'
,
noSupported
:
'浏览器不支持该功能,请使用IE10以上或其他现在浏览器!'
,
success
:
'上传成功'
,
fail
:
'图片上传失败'
,
preview
:
'头像预览'
,
btn
:
{
off
:
'取消'
,
close
:
'关闭'
,
back
:
'上一步'
,
save
:
'保存'
},
error
:
{
onlyImg
:
'仅限图片格式'
,
outOfSize
:
'单文件大小不能超过 '
,
lowestPx
:
'图片最低像素为(宽*高):'
}
},
'zh-tw'
:
{
hint
:
'點擊,或拖動圖片至此處'
,
loading
:
'正在上傳……'
,
noSupported
:
'瀏覽器不支持該功能,請使用IE10以上或其他現代瀏覽器!'
,
success
:
'上傳成功'
,
fail
:
'圖片上傳失敗'
,
preview
:
'頭像預覽'
,
btn
:
{
off
:
'取消'
,
close
:
'關閉'
,
back
:
'上一步'
,
save
:
'保存'
},
error
:
{
onlyImg
:
'僅限圖片格式'
,
outOfSize
:
'單文件大小不能超過 '
,
lowestPx
:
'圖片最低像素為(寬*高):'
}
},
en
:
{
hint
:
'Click or drag the file here to upload'
,
loading
:
'Uploading…'
,
noSupported
:
'Browser is not supported, please use IE10+ or other browsers'
,
success
:
'Upload success'
,
fail
:
'Upload failed'
,
preview
:
'Preview'
,
btn
:
{
off
:
'Cancel'
,
close
:
'Close'
,
back
:
'Back'
,
save
:
'Save'
},
error
:
{
onlyImg
:
'Image only'
,
outOfSize
:
'Image exceeds size limit: '
,
lowestPx
:
'Image
\'
s size is too low. Expected at least: '
}
},
ro
:
{
hint
:
'Atinge sau trage fișierul aici'
,
loading
:
'Se încarcă'
,
noSupported
:
'Browser-ul tău nu suportă acest feature. Te rugăm încearcă cu alt browser.'
,
success
:
'S-a încărcat cu succes'
,
fail
:
'A apărut o problemă la încărcare'
,
preview
:
'Previzualizează'
,
btn
:
{
off
:
'Anulează'
,
close
:
'Închide'
,
back
:
'Înapoi'
,
save
:
'Salvează'
},
error
:
{
onlyImg
:
'Doar imagini'
,
outOfSize
:
'Imaginea depășește limita de: '
,
loewstPx
:
'Imaginea este prea mică; Minim: '
}
},
ru
:
{
hint
:
'Нажмите, или перетащите файл в это окно'
,
loading
:
'Загружаю……'
,
noSupported
:
'Ваш браузер не поддерживается, пожалуйста, используйте IE10 + или другие браузеры'
,
success
:
'Загрузка выполнена успешно'
,
fail
:
'Ошибка загрузки'
,
preview
:
'Предпросмотр'
,
btn
:
{
off
:
'Отменить'
,
close
:
'Закрыть'
,
back
:
'Назад'
,
save
:
'Сохранить'
},
error
:
{
onlyImg
:
'Только изображения'
,
outOfSize
:
'Изображение превышает предельный размер: '
,
lowestPx
:
'Минимальный размер изображения: '
}
},
'pt-br'
:
{
hint
:
'Clique ou arraste o arquivo aqui para carregar'
,
loading
:
'Carregando…'
,
noSupported
:
'Browser não suportado, use o IE10+ ou outro browser'
,
success
:
'Sucesso ao carregar imagem'
,
fail
:
'Falha ao carregar imagem'
,
preview
:
'Pré-visualizar'
,
btn
:
{
off
:
'Cancelar'
,
close
:
'Fechar'
,
back
:
'Voltar'
,
save
:
'Salvar'
},
error
:
{
onlyImg
:
'Apenas imagens'
,
outOfSize
:
'A imagem excede o limite de tamanho: '
,
lowestPx
:
'O tamanho da imagem é muito pequeno. Tamanho mínimo: '
}
},
fr
:
{
hint
:
'Cliquez ou glissez le fichier ici.'
,
loading
:
'Téléchargement…'
,
noSupported
:
'Votre navigateur n
\'
est pas supporté. Utilisez IE10 + ou un autre navigateur s
\'
il vous plaît.'
,
success
:
'Téléchargement réussit'
,
fail
:
'Téléchargement echoué'
,
preview
:
'Aperçu'
,
btn
:
{
off
:
'Annuler'
,
close
:
'Fermer'
,
back
:
'Retour'
,
save
:
'Enregistrer'
},
error
:
{
onlyImg
:
'Image uniquement'
,
outOfSize
:
'L
\'
image sélectionnée dépasse la taille maximum: '
,
lowestPx
:
'L
\'
image sélectionnée est trop petite. Dimensions attendues: '
}
},
nl
:
{
hint
:
'Klik hier of sleep een afbeelding in dit vlak'
,
loading
:
'Uploaden…'
,
noSupported
:
'Je browser wordt helaas niet ondersteund. Gebruik IE10+ of een andere browser.'
,
success
:
'Upload succesvol'
,
fail
:
'Upload mislukt'
,
preview
:
'Voorbeeld'
,
btn
:
{
off
:
'Annuleren'
,
close
:
'Sluiten'
,
back
:
'Terug'
,
save
:
'Opslaan'
},
error
:
{
onlyImg
:
'Alleen afbeeldingen'
,
outOfSize
:
'De afbeelding is groter dan: '
,
lowestPx
:
'De afbeelding is te klein! Minimale afmetingen: '
}
},
tr
:
{
hint
:
'Tıkla veya yüklemek istediğini buraya sürükle'
,
loading
:
'Yükleniyor…'
,
noSupported
:
'Tarayıcı desteklenmiyor, lütfen IE10+ veya farklı tarayıcı kullanın'
,
success
:
'Yükleme başarılı'
,
fail
:
'Yüklemede hata oluştu'
,
preview
:
'Önizle'
,
btn
:
{
off
:
'İptal'
,
close
:
'Kapat'
,
back
:
'Geri'
,
save
:
'Kaydet'
},
error
:
{
onlyImg
:
'Sadece resim'
,
outOfSize
:
'Resim yükleme limitini aşıyor: '
,
lowestPx
:
'Resmin boyutu çok küçük. En az olması gereken: '
}
},
'es-MX'
:
{
hint
:
'Selecciona o arrastra una imagen'
,
loading
:
'Subiendo...'
,
noSupported
:
'Tu navegador no es soportado, porfavor usa IE10+ u otros navegadores mas recientes'
,
success
:
'Subido exitosamente'
,
fail
:
'Sucedió un error'
,
preview
:
'Vista previa'
,
btn
:
{
off
:
'Cancelar'
,
close
:
'Cerrar'
,
back
:
'Atras'
,
save
:
'Guardar'
},
error
:
{
onlyImg
:
'Unicamente imagenes'
,
outOfSize
:
'La imagen excede el tamaño maximo:'
,
lowestPx
:
'La imagen es demasiado pequeño. Se espera por lo menos:'
}
},
de
:
{
hint
:
'Klick hier oder zieh eine Datei hier rein zum Hochladen'
,
loading
:
'Hochladen…'
,
noSupported
:
'Browser wird nicht unterstützt, bitte verwende IE10+ oder andere Browser'
,
success
:
'Upload erfolgreich'
,
fail
:
'Upload fehlgeschlagen'
,
preview
:
'Vorschau'
,
btn
:
{
off
:
'Abbrechen'
,
close
:
'Schließen'
,
back
:
'Zurück'
,
save
:
'Speichern'
},
error
:
{
onlyImg
:
'Nur Bilder'
,
outOfSize
:
'Das Bild ist zu groß: '
,
lowestPx
:
'Das Bild ist zu klein. Mindestens: '
}
},
ja
:
{
hint
:
'クリック・ドラッグしてファイルをアップロード'
,
loading
:
'アップロード中...'
,
noSupported
:
'このブラウザは対応されていません。IE10+かその他の主要ブラウザをお使いください。'
,
success
:
'アップロード成功'
,
fail
:
'アップロード失敗'
,
preview
:
'プレビュー'
,
btn
:
{
off
:
'キャンセル'
,
close
:
'閉じる'
,
back
:
'戻る'
,
save
:
'保存'
},
error
:
{
onlyImg
:
'画像のみ'
,
outOfSize
:
'画像サイズが上限を超えています。上限: '
,
lowestPx
:
'画像が小さすぎます。最小サイズ: '
}
}
}
src/components/ImageCropper/utils/mimes.js
deleted
100755 → 0
View file @
26e37d74
export
default
{
'jpg'
:
'image/jpeg'
,
'png'
:
'image/png'
,
'gif'
:
'image/gif'
,
'svg'
:
'image/svg+xml'
,
'psd'
:
'image/photoshop'
}
src/components/Kanban/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<div
class=
"board-column"
>
<div
class=
"board-column-header"
>
{{
headerText
}}
</div>
<draggable
:list=
"list"
v-bind=
"$attrs"
class=
"board-column-content"
:set-data=
"setData"
>
<div
v-for=
"element in list"
:key=
"element.id"
class=
"board-item"
>
{{
element
.
name
}}
{{
element
.
id
}}
</div>
</draggable>
</div>
</
template
>
<
script
>
import
draggable
from
'vuedraggable'
export
default
{
name
:
'DragKanbanDemo'
,
components
:
{
draggable
},
props
:
{
headerText
:
{
type
:
String
,
default
:
'Header'
},
options
:
{
type
:
Object
,
default
()
{
return
{}
}
},
list
:
{
type
:
Array
,
default
()
{
return
[]
}
}
},
methods
:
{
setData
(
dataTransfer
)
{
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer
.
setData
(
'Text'
,
''
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.board-column
{
min-width
:
300px
;
min-height
:
100px
;
height
:
auto
;
overflow
:
hidden
;
background
:
#f0f0f0
;
border-radius
:
3px
;
.board-column-header
{
height
:
50px
;
line-height
:
50px
;
overflow
:
hidden
;
padding
:
0
20px
;
text-align
:
center
;
background
:
#333
;
color
:
#fff
;
border-radius
:
3px
3px
0
0
;
}
.board-column-content
{
height
:
auto
;
overflow
:
hidden
;
border
:
10px
solid
transparent
;
min-height
:
60px
;
display
:
flex
;
justify-content
:
flex-start
;
flex-direction
:
column
;
align-items
:
center
;
.board-item
{
cursor
:
pointer
;
width
:
100%
;
height
:
64px
;
margin
:
5px
0
;
background-color
:
#fff
;
text-align
:
left
;
line-height
:
54px
;
padding
:
5px
10px
;
box-sizing
:
border-box
;
box-shadow
:
0px
1px
3px
0
rgba
(
0
,
0
,
0
,
0
.2
);
}
}
}
</
style
>
src/components/MDinput/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<div
:class=
"computedClasses"
class=
"material-input__component"
>
<div
:class=
"
{iconClass:icon}">
<i
v-if=
"icon"
:class=
"['el-icon-' + icon]"
class=
"el-input__icon material-input__icon"
/>
<input
v-if=
"type === 'email'"
v-model=
"currentValue"
:name=
"name"
:placeholder=
"fillPlaceHolder"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autoComplete"
:required=
"required"
type=
"email"
class=
"material-input"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'url'"
v-model=
"currentValue"
:name=
"name"
:placeholder=
"fillPlaceHolder"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autoComplete"
:required=
"required"
type=
"url"
class=
"material-input"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'number'"
v-model=
"currentValue"
:name=
"name"
:placeholder=
"fillPlaceHolder"
:step=
"step"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autoComplete"
:max=
"max"
:min=
"min"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
type=
"number"
class=
"material-input"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'password'"
v-model=
"currentValue"
:name=
"name"
:placeholder=
"fillPlaceHolder"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autoComplete"
:max=
"max"
:min=
"min"
:required=
"required"
type=
"password"
class=
"material-input"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'tel'"
v-model=
"currentValue"
:name=
"name"
:placeholder=
"fillPlaceHolder"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autoComplete"
:required=
"required"
type=
"tel"
class=
"material-input"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'text'"
v-model=
"currentValue"
:name=
"name"
:placeholder=
"fillPlaceHolder"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autoComplete"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
type=
"text"
class=
"material-input"
@
focus=
"handleMdFocus"
@
blur=
"handleMdBlur"
@
input=
"handleModelInput"
>
<span
class=
"material-input-bar"
/>
<label
class=
"material-label"
>
<slot
/>
</label>
</div>
</div>
</
template
>
<
script
>
// source:https://github.com/wemake-services/vue-material-input/blob/master/src/components/MaterialInput.vue
export
default
{
name
:
'MdInput'
,
props
:
{
/* eslint-disable */
icon
:
String
,
name
:
String
,
type
:
{
type
:
String
,
default
:
'text'
},
value
:
[
String
,
Number
],
placeholder
:
String
,
readonly
:
Boolean
,
disabled
:
Boolean
,
min
:
String
,
max
:
String
,
step
:
String
,
minlength
:
Number
,
maxlength
:
Number
,
required
:
{
type
:
Boolean
,
default
:
true
},
autoComplete
:
{
type
:
String
,
default
:
'off'
},
validateEvent
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
return
{
currentValue
:
this
.
value
,
focus
:
false
,
fillPlaceHolder
:
null
}
},
computed
:
{
computedClasses
()
{
return
{
'material--active'
:
this
.
focus
,
'material--disabled'
:
this
.
disabled
,
'material--raised'
:
Boolean
(
this
.
focus
||
this
.
currentValue
)
// has value
}
}
},
watch
:
{
value
(
newValue
)
{
this
.
currentValue
=
newValue
}
},
methods
:
{
handleModelInput
(
event
)
{
const
value
=
event
.
target
.
value
this
.
$emit
(
'input'
,
value
)
if
(
this
.
$parent
.
$options
.
componentName
===
'ElFormItem'
)
{
if
(
this
.
validateEvent
)
{
this
.
$parent
.
$emit
(
'el.form.change'
,
[
value
])
}
}
this
.
$emit
(
'change'
,
value
)
},
handleMdFocus
(
event
)
{
this
.
focus
=
true
this
.
$emit
(
'focus'
,
event
)
if
(
this
.
placeholder
&&
this
.
placeholder
!==
''
)
{
this
.
fillPlaceHolder
=
this
.
placeholder
}
},
handleMdBlur
(
event
)
{
this
.
focus
=
false
this
.
$emit
(
'blur'
,
event
)
this
.
fillPlaceHolder
=
null
if
(
this
.
$parent
.
$options
.
componentName
===
'ElFormItem'
)
{
if
(
this
.
validateEvent
)
{
this
.
$parent
.
$emit
(
'el.form.blur'
,
[
this
.
currentValue
])
}
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
// Fonts:
$font-size-base
:
16px
;
$font-size-small
:
18px
;
$font-size-smallest
:
12px
;
$font-weight-normal
:
normal
;
$font-weight-bold
:
bold
;
$apixel
:
1px
;
// Utils
$spacer
:
12px
;
$transition
:
0
.2s
ease
all
;
$index
:
0px
;
$index-has-icon
:
30px
;
// Theme:
$color-white
:
white
;
$color-grey
:
#9E9E9E
;
$color-grey-light
:
#E0E0E0
;
$color-blue
:
#2196F3
;
$color-red
:
#F44336
;
$color-black
:
black
;
// Base clases:
%base-bar-pseudo
{
content
:
''
;
height
:
1px
;
width
:
0
;
bottom
:
0
;
position
:
absolute
;
transition
:
$transition
;
}
// Mixins:
@mixin
slided-top
()
{
top
:
-
(
$font-size-base
+
$spacer
);
left
:
0
;
font-size
:
$font-size-base
;
font-weight
:
$font-weight-bold
;
}
// Component:
.material-input__component
{
margin-top
:
36px
;
position
:
relative
;
*
{
box-sizing
:
border-box
;
}
.iconClass
{
.material-input__icon
{
position
:
absolute
;
left
:
0
;
line-height
:
$font-size-base
;
color
:
$color-blue
;
top
:
$spacer
;
width
:
$index-has-icon
;
height
:
$font-size-base
;
font-size
:
$font-size-base
;
font-weight
:
$font-weight-normal
;
pointer-events
:
none
;
}
.material-label
{
left
:
$index-has-icon
;
}
.material-input
{
text-indent
:
$index-has-icon
;
}
}
.material-input
{
font-size
:
$font-size-base
;
padding
:
$spacer
$spacer
$spacer
-
$apixel
*
10
$spacer
/
2
;
display
:
block
;
width
:
100%
;
border
:
none
;
line-height
:
1
;
border-radius
:
0
;
&
:focus
{
outline
:
none
;
border
:
none
;
border-bottom
:
1px
solid
transparent
;
// fixes the height issue
}
}
.material-label
{
font-weight
:
$font-weight-normal
;
position
:
absolute
;
pointer-events
:
none
;
left
:
$index
;
top
:
0
;
transition
:
$transition
;
font-size
:
$font-size-small
;
}
.material-input-bar
{
position
:
relative
;
display
:
block
;
width
:
100%
;
&
:before
{
@extend
%base-bar-pseudo
;
left
:
50%
;
}
&
:after
{
@extend
%base-bar-pseudo
;
right
:
50%
;
}
}
// Disabled state:
&
.material--disabled
{
.material-input
{
border-bottom-style
:
dashed
;
}
}
// Raised state:
&
.material--raised
{
.material-label
{
@include
slided-top
();
}
}
// Active state:
&
.material--active
{
.material-input-bar
{
&
:before
,
&
:after
{
width
:
50%
;
}
}
}
}
.material-input__component
{
background
:
$color-white
;
.material-input
{
background
:
none
;
color
:
$color-black
;
text-indent
:
$index
;
border-bottom
:
1px
solid
$color-grey-light
;
}
.material-label
{
color
:
$color-grey
;
}
.material-input-bar
{
&
:before
,
&
:after
{
background
:
$color-blue
;
}
}
// Active state:
&
.material--active
{
.material-label
{
color
:
$color-blue
;
}
}
// Errors:
&
.material--has-errors
{
&
.material--active
.material-label
{
color
:
$color-red
;
}
.material-input-bar
{
&
:before
,
&
:after
{
background
:
transparent
;
}
}
}
}
</
style
>
src/components/PanThumb/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<div
:style=
"
{zIndex:zIndex,height:height,width:width}" class="pan-item">
<div
class=
"pan-info"
>
<div
class=
"pan-info-roles-container"
>
<slot
/>
</div>
</div>
<!-- eslint-disable-next-line -->
<div
:style=
"
{backgroundImage: `url(${image})`}" class="pan-thumb">
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'PanThumb'
,
props
:
{
image
:
{
type
:
String
,
required
:
true
},
zIndex
:
{
type
:
Number
,
default
:
1
},
width
:
{
type
:
String
,
default
:
'150px'
},
height
:
{
type
:
String
,
default
:
'150px'
}
}
}
</
script
>
<
style
scoped
>
.pan-item
{
width
:
200px
;
height
:
200px
;
border-radius
:
50%
;
display
:
inline-block
;
position
:
relative
;
cursor
:
default
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.2
);
}
.pan-info-roles-container
{
padding
:
20px
;
text-align
:
center
;
}
.pan-thumb
{
width
:
100%
;
height
:
100%
;
background-position
:
center
center
;
background-size
:
cover
;
border-radius
:
50%
;
overflow
:
hidden
;
position
:
absolute
;
transform-origin
:
95%
40%
;
transition
:
all
0.3s
ease-in-out
;
}
/* .pan-thumb:after {
content: '';
width: 8px;
height: 8px;
position: absolute;
border-radius: 50%;
top: 40%;
left: 95%;
margin: -4px 0 0 -4px;
background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
} */
.pan-info
{
position
:
absolute
;
width
:
inherit
;
height
:
inherit
;
border-radius
:
50%
;
overflow
:
hidden
;
box-shadow
:
inset
0
0
0
5px
rgba
(
0
,
0
,
0
,
0.05
);
}
.pan-info
h3
{
color
:
#fff
;
text-transform
:
uppercase
;
position
:
relative
;
letter-spacing
:
2px
;
font-size
:
18px
;
margin
:
0
60px
;
padding
:
22px
0
0
0
;
height
:
85px
;
font-family
:
'Open Sans'
,
Arial
,
sans-serif
;
text-shadow
:
0
0
1px
#fff
,
0
1px
2px
rgba
(
0
,
0
,
0
,
0.3
);
}
.pan-info
p
{
color
:
#fff
;
padding
:
10px
5px
;
font-style
:
italic
;
margin
:
0
30px
;
font-size
:
12px
;
border-top
:
1px
solid
rgba
(
255
,
255
,
255
,
0.5
);
}
.pan-info
p
a
{
display
:
block
;
color
:
#333
;
width
:
80px
;
height
:
80px
;
background
:
rgba
(
255
,
255
,
255
,
0.3
);
border-radius
:
50%
;
color
:
#fff
;
font-style
:
normal
;
font-weight
:
700
;
text-transform
:
uppercase
;
font-size
:
9px
;
letter-spacing
:
1px
;
padding-top
:
24px
;
margin
:
7px
auto
0
;
font-family
:
'Open Sans'
,
Arial
,
sans-serif
;
opacity
:
0
;
transition
:
transform
0.3s
ease-in-out
0.2s
,
opacity
0.3s
ease-in-out
0.2s
,
background
0.2s
linear
0s
;
transform
:
translateX
(
60px
)
rotate
(
90deg
);
}
.pan-info
p
a
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.5
);
}
.pan-item
:hover
.pan-thumb
{
transform
:
rotate
(
-110deg
);
}
.pan-item
:hover
.pan-info
p
a
{
opacity
:
1
;
transform
:
translateX
(
0px
)
rotate
(
0deg
);
}
</
style
>
src/components/SizeSelect/index.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<el-dropdown
trigger=
"click"
@
command=
"handleSetSize"
>
<div>
<svg-icon
class-name=
"size-icon"
icon-class=
"size"
/>
</div>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
v-for=
"item of sizeOptions"
:key=
"item.value"
:disabled=
"size===item.value"
:command=
"item.value"
>
{{
item
.
label
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
sizeOptions
:
[
{
label
:
'Default'
,
value
:
'default'
},
{
label
:
'Medium'
,
value
:
'medium'
},
{
label
:
'Small'
,
value
:
'small'
},
{
label
:
'Mini'
,
value
:
'mini'
}
]
}
},
computed
:
{
size
()
{
return
this
.
$store
.
getters
.
size
}
},
methods
:
{
handleSetSize
(
size
)
{
this
.
$ELEMENT
.
size
=
size
this
.
$store
.
dispatch
(
'app/setSize'
,
size
)
this
.
refreshView
()
this
.
$message
({
message
:
'Switch Size Success'
,
type
:
'success'
})
},
refreshView
()
{
// In order to make the cached page re-rendered
this
.
$store
.
dispatch
(
'tagsView/delAllCachedViews'
,
this
.
$route
)
const
{
fullPath
}
=
this
.
$route
this
.
$nextTick
(()
=>
{
this
.
$router
.
replace
({
path
:
'/redirect'
+
fullPath
})
})
}
}
}
</
script
>
src/components/TextHoverEffect/Mallki.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<a
:class=
"className"
class=
"link--mallki"
href=
"#"
>
{{
text
}}
<span
:data-letters=
"text"
/>
<span
:data-letters=
"text"
/>
</a>
</
template
>
<
script
>
export
default
{
props
:
{
className
:
{
type
:
String
,
default
:
''
},
text
:
{
type
:
String
,
default
:
'vue-element-admin'
}
}
}
</
script
>
<
style
>
/* Mallki */
.link--mallki
{
font-weight
:
800
;
color
:
#4dd9d5
;
font-family
:
'Dosis'
,
sans-serif
;
-webkit-transition
:
color
0.5s
0.25s
;
transition
:
color
0.5s
0.25s
;
overflow
:
hidden
;
position
:
relative
;
display
:
inline-block
;
line-height
:
1
;
outline
:
none
;
text-decoration
:
none
;
}
.link--mallki
:hover
{
-webkit-transition
:
none
;
transition
:
none
;
color
:
transparent
;
}
.link--mallki
::before
{
content
:
''
;
width
:
100%
;
height
:
6px
;
margin
:
-3px
0
0
0
;
background
:
#3888fa
;
position
:
absolute
;
left
:
0
;
top
:
50%
;
-webkit-transform
:
translate3d
(
-100%
,
0
,
0
);
transform
:
translate3d
(
-100%
,
0
,
0
);
-webkit-transition
:
-webkit-transform
0.4s
;
transition
:
transform
0.4s
;
-webkit-transition-timing-function
:
cubic-bezier
(
0.7
,
0
,
0.3
,
1
);
transition-timing-function
:
cubic-bezier
(
0.7
,
0
,
0.3
,
1
);
}
.link--mallki
:hover::before
{
-webkit-transform
:
translate3d
(
100%
,
0
,
0
);
transform
:
translate3d
(
100%
,
0
,
0
);
}
.link--mallki
span
{
position
:
absolute
;
height
:
50%
;
width
:
100%
;
left
:
0
;
top
:
0
;
overflow
:
hidden
;
}
.link--mallki
span
::before
{
content
:
attr
(
data-letters
);
color
:
red
;
position
:
absolute
;
left
:
0
;
width
:
100%
;
color
:
#3888fa
;
-webkit-transition
:
-webkit-transform
0.5s
;
transition
:
transform
0.5s
;
}
.link--mallki
span
:nth-child
(
2
)
{
top
:
50%
;
}
.link--mallki
span
:first-child::before
{
top
:
0
;
-webkit-transform
:
translate3d
(
0
,
100%
,
0
);
transform
:
translate3d
(
0
,
100%
,
0
);
}
.link--mallki
span
:nth-child
(
2
)
::before
{
bottom
:
0
;
-webkit-transform
:
translate3d
(
0
,
-100%
,
0
);
transform
:
translate3d
(
0
,
-100%
,
0
);
}
.link--mallki
:hover
span
::before
{
-webkit-transition-delay
:
0.3s
;
transition-delay
:
0.3s
;
-webkit-transform
:
translate3d
(
0
,
0
,
0
);
transform
:
translate3d
(
0
,
0
,
0
);
-webkit-transition-timing-function
:
cubic-bezier
(
0.2
,
1
,
0.3
,
1
);
transition-timing-function
:
cubic-bezier
(
0.2
,
1
,
0.3
,
1
);
}
</
style
>
src/layout/components/Navbar.vue
View file @
f7bf98d3
...
@@ -8,15 +8,13 @@
...
@@ -8,15 +8,13 @@
<template
v-if=
"device!=='mobile'"
>
<template
v-if=
"device!=='mobile'"
>
<search
id=
"header-search"
class=
"right-menu-item"
/>
<search
id=
"header-search"
class=
"right-menu-item"
/>
<error-log
class=
"errLog-container right-menu-item hover-effect"
/>
<screenfull
id=
"screenfull"
class=
"right-menu-item hover-effect"
/>
<screenfull
id=
"screenfull"
class=
"right-menu-item hover-effect"
/>
</
template
>
</
template
>
<el-dropdown
class=
"avatar-container right-menu-item hover-effect"
trigger=
"click"
>
<el-dropdown
class=
"avatar-container right-menu-item hover-effect"
trigger=
"click"
>
<div
class=
"avatar-wrapper"
>
<div
class=
"avatar-wrapper"
>
<img
:src=
"avatar+'?imageView2/1/w/80/h/80'"
class=
"user-avatar"
>
<img
:src=
"avatar+'?imageView2/1/w/80/h/80'"
class=
"user-avatar"
alt=
""
>
<span
style=
"font-size: 14px; position: relative; bottom: 15px"
>
{{ name }}
</span>
<span
style=
"font-size: 14px; position: relative; bottom: 15px"
>
{{ name }}
</span>
<i
class=
"el-icon-caret-bottom"
style=
"position: absolute; top: 13px"
/>
<i
class=
"el-icon-caret-bottom"
style=
"position: absolute; top: 13px"
/>
</div>
</div>
...
@@ -37,7 +35,6 @@
...
@@ -37,7 +35,6 @@
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
Breadcrumb
from
'@/components/Breadcrumb'
import
Breadcrumb
from
'@/components/Breadcrumb'
import
Hamburger
from
'@/components/Hamburger'
import
Hamburger
from
'@/components/Hamburger'
import
ErrorLog
from
'@/components/ErrorLog'
import
Screenfull
from
'@/components/Screenfull'
import
Screenfull
from
'@/components/Screenfull'
import
Search
from
'@/components/HeaderSearch'
import
Search
from
'@/components/HeaderSearch'
...
@@ -45,7 +42,6 @@ export default {
...
@@ -45,7 +42,6 @@ export default {
components
:
{
components
:
{
Breadcrumb
,
Breadcrumb
,
Hamburger
,
Hamburger
,
ErrorLog
,
Screenfull
,
Screenfull
,
Search
Search
},
},
...
...
src/main.js
View file @
f7bf98d3
...
@@ -20,7 +20,6 @@ import { parseTime, resetForm, addDateRange, selectDictLabel } from '@/utils/cos
...
@@ -20,7 +20,6 @@ import { parseTime, resetForm, addDateRange, selectDictLabel } from '@/utils/cos
import
'./icons'
// icon
import
'./icons'
// icon
import
'./permission'
// permission control
import
'./permission'
// permission control
import
'./utils/error-log'
// error log
import
*
as
filters
from
'./filters'
// global filters
import
*
as
filters
from
'./filters'
// global filters
...
...
src/router/modules/components.js
View file @
f7bf98d3
...
@@ -11,92 +11,7 @@ const componentsRouter = {
...
@@ -11,92 +11,7 @@ const componentsRouter = {
title
:
'Components'
,
title
:
'Components'
,
icon
:
'component'
icon
:
'component'
},
},
children
:
[
children
:
[]
{
path
:
'tinymce'
,
component
:
()
=>
import
(
'@/views/components-demo/tinymce'
),
name
:
'TinymceDemo'
,
meta
:
{
title
:
'Tinymce'
}
},
{
path
:
'markdown'
,
component
:
()
=>
import
(
'@/views/components-demo/markdown'
),
name
:
'MarkdownDemo'
,
meta
:
{
title
:
'Markdown'
}
},
{
path
:
'json-editor'
,
component
:
()
=>
import
(
'@/views/components-demo/json-editor'
),
name
:
'JsonEditorDemo'
,
meta
:
{
title
:
'JSON Editor'
}
},
{
path
:
'split-pane'
,
component
:
()
=>
import
(
'@/views/components-demo/split-pane'
),
name
:
'SplitpaneDemo'
,
meta
:
{
title
:
'SplitPane'
}
},
{
path
:
'avatar-upload'
,
component
:
()
=>
import
(
'@/views/components-demo/avatar-upload'
),
name
:
'AvatarUploadDemo'
,
meta
:
{
title
:
'Upload'
}
},
{
path
:
'dropzone'
,
component
:
()
=>
import
(
'@/views/components-demo/dropzone'
),
name
:
'DropzoneDemo'
,
meta
:
{
title
:
'Dropzone'
}
},
{
path
:
'sticky'
,
component
:
()
=>
import
(
'@/views/components-demo/sticky'
),
name
:
'StickyDemo'
,
meta
:
{
title
:
'Sticky'
}
},
{
path
:
'count-to'
,
component
:
()
=>
import
(
'@/views/components-demo/count-to'
),
name
:
'CountToDemo'
,
meta
:
{
title
:
'Count To'
}
},
{
path
:
'mixin'
,
component
:
()
=>
import
(
'@/views/components-demo/mixin'
),
name
:
'ComponentMixinDemo'
,
meta
:
{
title
:
'Component Mixin'
}
},
{
path
:
'back-to-top'
,
component
:
()
=>
import
(
'@/views/components-demo/back-to-top'
),
name
:
'BackToTopDemo'
,
meta
:
{
title
:
'Back To Top'
}
},
{
path
:
'drag-dialog'
,
component
:
()
=>
import
(
'@/views/components-demo/drag-dialog'
),
name
:
'DragDialogDemo'
,
meta
:
{
title
:
'Drag Dialog'
}
},
{
path
:
'drag-select'
,
component
:
()
=>
import
(
'@/views/components-demo/drag-select'
),
name
:
'DragSelectDemo'
,
meta
:
{
title
:
'Drag Select'
}
},
{
path
:
'dnd-list'
,
component
:
()
=>
import
(
'@/views/components-demo/dnd-list'
),
name
:
'DndListDemo'
,
meta
:
{
title
:
'Dnd List'
}
},
{
path
:
'drag-kanban'
,
component
:
()
=>
import
(
'@/views/components-demo/drag-kanban'
),
name
:
'DragKanbanDemo'
,
meta
:
{
title
:
'Drag Kanban'
}
}
]
}
}
export
default
componentsRouter
export
default
componentsRouter
src/utils/error-log.js
deleted
100644 → 0
View file @
26e37d74
import
Vue
from
'vue'
import
store
from
'@/store'
import
{
isString
,
isArray
}
from
'@/utils/validate'
import
settings
from
'@/settings'
// you can set in settings.js
// errorLog:'production' | ['production', 'development']
const
{
errorLog
:
needErrorLog
}
=
settings
function
checkNeed
()
{
const
env
=
process
.
env
.
NODE_ENV
if
(
isString
(
needErrorLog
))
{
return
env
===
needErrorLog
}
if
(
isArray
(
needErrorLog
))
{
return
needErrorLog
.
includes
(
env
)
}
return
false
}
if
(
checkNeed
())
{
Vue
.
config
.
errorHandler
=
function
(
err
,
vm
,
info
,
a
)
{
// Don't ask me why I use Vue.nextTick, it just a hack.
// detail see https://forum.vuejs.org/t/dispatch-in-vue-config-errorhandler-has-some-problem/23500
Vue
.
nextTick
(()
=>
{
store
.
dispatch
(
'errorLog/addErrorLog'
,
{
err
,
vm
,
info
,
url
:
window
.
location
.
href
})
console
.
error
(
err
,
info
)
})
}
}
src/views/profile/components/UserCard.vue
deleted
100644 → 0
View file @
26e37d74
<
template
>
<el-card
style=
"margin-bottom:20px;"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
About me
</span>
</div>
<div
class=
"user-profile"
>
<div
class=
"box-center"
>
<pan-thumb
:image=
"user.avatar"
:height=
"'100px'"
:width=
"'100px'"
:hoverable=
"false"
>
<div>
Hello
</div>
{{
user
.
role
}}
</pan-thumb>
</div>
<div
class=
"box-center"
>
<div
class=
"user-name text-center"
>
{{
user
.
name
}}
</div>
<div
class=
"user-role text-center text-muted"
>
{{
user
.
role
|
uppercaseFirst
}}
</div>
</div>
</div>
<div
class=
"user-bio"
>
<div
class=
"user-education user-bio-section"
>
<div
class=
"user-bio-section-header"
><svg-icon
icon-class=
"education"
/><span>
Education
</span></div>
<div
class=
"user-bio-section-body"
>
<div
class=
"text-muted"
>
JS in Computer Science from the University of Technology
</div>
</div>
</div>
<div
class=
"user-skills user-bio-section"
>
<div
class=
"user-bio-section-header"
><svg-icon
icon-class=
"skill"
/><span>
Skills
</span></div>
<div
class=
"user-bio-section-body"
>
<div
class=
"progress-item"
>
<span>
Vue
</span>
<el-progress
:percentage=
"70"
/>
</div>
<div
class=
"progress-item"
>
<span>
JavaScript
</span>
<el-progress
:percentage=
"18"
/>
</div>
<div
class=
"progress-item"
>
<span>
Css
</span>
<el-progress
:percentage=
"12"
/>
</div>
<div
class=
"progress-item"
>
<span>
ESLint
</span>
<el-progress
:percentage=
"100"
status=
"success"
/>
</div>
</div>
</div>
</div>
</el-card>
</
template
>
<
script
>
import
PanThumb
from
'@/components/PanThumb'
export
default
{
components
:
{
PanThumb
},
props
:
{
user
:
{
type
:
Object
,
default
:
()
=>
{
return
{
name
:
''
,
email
:
''
,
avatar
:
''
,
roles
:
''
}
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.box-center
{
margin
:
0
auto
;
display
:
table
;
}
.text-muted
{
color
:
#777
;
}
.user-profile
{
.user-name
{
font-weight
:
bold
;
}
.box-center
{
padding-top
:
10px
;
}
.user-role
{
padding-top
:
10px
;
font-weight
:
400
;
font-size
:
14px
;
}
.box-social
{
padding-top
:
30px
;
.el-table
{
border-top
:
1px
solid
#dfe6ec
;
}
}
.user-follow
{
padding-top
:
20px
;
}
}
.user-bio
{
margin-top
:
20px
;
color
:
#606266
;
span
{
padding-left
:
4px
;
}
.user-bio-section
{
font-size
:
14px
;
padding
:
15px
0
;
.user-bio-section-header
{
border-bottom
:
1px
solid
#dfe6ec
;
padding-bottom
:
10px
;
margin-bottom
:
10px
;
font-weight
:
bold
;
}
}
}
</
style
>
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