Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
note-library
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
43e16b40
authored
May 14, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://119.23.72.7/sunlong_v5/note-library
parents
d3f87f53
9ff4d049
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
16 deletions
public/css/style.css
public/js/web/design.js
resources/views/web/design.blade.php
resources/views/web/prints.blade.php
public/css/style.css
View file @
43e16b40
...
...
@@ -8715,7 +8715,7 @@ body.md-skin {
}
.tag-content
.tag-edit
.edit-value
{
margin-top
:
-25
0px
;
margin-top
:
2
0px
;
position
:
fixed
;
width
:
410px
;
min-height
:
300px
;
...
...
@@ -8755,11 +8755,10 @@ body.md-skin {
.lineit.huabuitem
::after
{
content
:
" "
;
float
:
right
;
width
:
calc
(
100%
+
30px
)
;
height
:
calc
(
100%
+
30
px
);
width
:
100%
;
height
:
calc
(
100%
+
16
px
);
border
:
1px
dashed
rgba
(
0
,
0
,
0
,
0
);
margin-top
:
-15px
;
margin-right
:
-15px
;
margin-top
:
-8px
;
}
/* .huabuitem.act::after{
content:" ";
...
...
public/js/web/design.js
View file @
43e16b40
...
...
@@ -2,6 +2,7 @@
var
tag
=
{
hbisAct
:
0
,
//是否画布区域
isClick
:
0
,
step_
:
2
,
//按键移动速度
init
:
function
(){
if
(
$
(
"#templateid"
).
val
()){
...
...
@@ -279,7 +280,65 @@ var tag={
$
(
"body"
).
on
(
"mousemove"
,
"textarea"
,
function
(){
$
(
this
).
focus
()
})
//按住键盘上下左右键移动当前画布工具
$
(
document
).
keydown
(
function
(
event
){
if
(
!
tag
.
hbisAct
){
return
;}
var
step_
=
tag
.
step_
;
var
keyNum
=
event
.
which
;
//获取键值
var
Item
=
$
(
'.huabuitem.act'
);
//要移动的元素
var
width_
=
$
(
".edit-con"
).
width
(),
height_
=
$
(
".edit-con"
).
height
();
switch
(
keyNum
){
//判断按键
case
37
:
event
.
preventDefault
();
Item
.
css
({
left
:
'-='
+
step_
+
'px'
});
var
left_
=
Item
.
position
().
left
;
if
(
left_
<=
0
){
left_
=
0
;
Item
.
css
({
left
:
0
});
}
Item
.
attr
(
"x"
,
left_
);
$
(
".tools.act .zbx"
).
val
(
left_
)
break
;
case
38
:
event
.
preventDefault
();
Item
.
css
({
top
:
'-='
+
step_
+
'px'
});
var
left_
=
Item
.
position
().
top
;
if
(
left_
<=
0
){
left_
=
0
;
Item
.
css
({
top
:
0
});
}
Item
.
attr
(
"y"
,
left_
);
$
(
".tools.act .zby"
).
val
(
left_
)
break
;
case
39
:
event
.
preventDefault
();
Item
.
css
({
left
:
'+='
+
step_
+
'px'
});
var
left_
=
Item
.
position
().
left
;
if
(
left_
>=
width_
-
Item
.
width
()){
left_
=
width_
-
Item
.
width
();
Item
.
css
({
left
:
left_
});
}
Item
.
attr
(
"x"
,
left_
);
$
(
".tools.act .zbx"
).
val
(
left_
)
break
;
case
40
:
event
.
preventDefault
();
Item
.
css
({
top
:
'+='
+
step_
+
'px'
});
var
left_
=
Item
.
position
().
top
;
if
(
left_
>=
height_
-
Item
.
height
()){
left_
=
height_
-
Item
.
height
();
Item
.
css
({
top
:
left_
});
}
Item
.
attr
(
"y"
,
left_
);
$
(
".tools.act .zby"
).
val
(
left_
)
break
;
default
:
break
;
}
});
//监听属性赋值
$
(
document
).
on
(
"input propertychange"
,
".tools.act select,.tools.act input"
,
function
(){
var
ele
=
$
(
".huabuitem.act"
);
...
...
@@ -288,10 +347,28 @@ var tag={
var
val_
=
self
.
val
();
switch
(
name_
)
{
case
"zbx"
:
if
(
val_
<
0
){
val_
=
0
;
self
.
val
(
0
)
}
var
max_
=
$
(
".edit-con"
).
width
()
-
ele
.
width
();
if
(
val_
>
max_
){
val_
=
max_
;
self
.
val
(
max_
)
}
ele
.
attr
(
"x"
,
val_
);
ele
.
css
({
left
:
Number
(
val_
)});
break
;
case
"zby"
:
if
(
val_
<
0
){
val_
=
0
;
self
.
val
(
0
)
}
var
max_
=
$
(
".edit-con"
).
height
()
-
ele
.
height
();
if
(
val_
>
max_
){
val_
=
max_
;
self
.
val
(
max_
)
}
ele
.
attr
(
"y"
,
val_
);
ele
.
css
({
top
:
Number
(
val_
)})
break
;
...
...
@@ -438,6 +515,9 @@ var tag={
$
(
".edit-con .gezi"
).
remove
();
$
(
".edit-con .huabuitem"
).
removeClass
(
"act"
);
$
(
".edit-con"
).
removeClass
(
"init-border"
);
if
(
!
$
(
".tag-border"
).
val
()){
$
(
".edit-con"
).
css
({
"border"
:
"0px"
})
}
obj
.
htmlp
=
String
(
$
(
".edit-box"
).
html
());
obj
.
designName
=
$
(
".designName"
).
val
();
if
(
$
(
"#templateid"
).
val
()){
...
...
resources/views/web/design.blade.php
View file @
43e16b40
...
...
@@ -6,7 +6,7 @@
<div
class=
"tips"
>
请拖动此处标签制作工具到下方编辑区域编辑!
</div>
<div
class=
"items yuan"
name=
"round"
><div
class=
"round zctem"
type=
"1"
w=
"45"
h=
"45"
name=
"round"
xtys=
"#333"
></div><span>
圆形
</span></div>
<div
class=
"items fang"
name=
"rectangle"
><div
class=
"rectangle zctem"
type=
"2"
w=
"70"
h=
"45"
name=
"rectangle"
xtys=
"#333"
></div><span>
矩形
</span></div>
<div
class=
"items text"
name=
"textarea"
><textarea
class=
"textarea zctem"
zhg=
"26"
zh=
"14"
wenben=
"测试文本"
zt=
"Microsoft YaHei"
type=
"3"
w=
"2
5
0"
h=
"26"
ztys=
"#000000"
name=
"textarea"
placeholder=
"请输入文案"
>
测试文本
</textarea>
A
<span>
文本
</span></div>
<div
class=
"items text"
name=
"textarea"
><textarea
class=
"textarea zctem"
zhg=
"26"
zh=
"14"
wenben=
"测试文本"
zt=
"Microsoft YaHei"
type=
"3"
w=
"2
0
0"
h=
"26"
ztys=
"#000000"
name=
"textarea"
placeholder=
"请输入文案"
>
测试文本
</textarea>
A
<span>
文本
</span></div>
<div
class=
"items line"
name=
"lineit"
><div
class=
"lineit zctem"
type=
"4"
w=
"70"
h=
"1"
name=
"lineit"
xtys=
"#333"
></div><span>
线
</span></div>
<div
class=
"items erweima"
name=
"erweimait"
style=
"background: url(http://img.ichunt.com/images/cms/201905/05/0998e54c5120aec61e6868943a67916e.png) no-repeat;background-size: 100% 100%;"
><div
class=
"zctem erweimait"
type=
"5"
w=
"45"
h=
"45"
name=
"erweimait"
style=
"background: url(http://img.ichunt.com/images/cms/201905/05/0998e54c5120aec61e6868943a67916e.png) no-repeat;background-size: 100% 100%;"
></div><span>
二维码
</span></div>
<div
class=
"items yiweima"
name=
"yiweimait"
style=
"background: url(http://sz.ichunt.com/v3/dist/res/home/images/about/yiweima.png) no-repeat;background-size: 100% 100%;"
><div
class=
"zctem yiweimait"
type=
"5"
w=
"87"
h=
"35"
name=
"yiweimait"
style=
"background: url(http://sz.ichunt.com/v3/dist/res/home/images/about/yiweima.png) no-repeat;background-size: 100% 100%;"
></div><span>
一维码
</span></div>
...
...
@@ -22,7 +22,7 @@
<div
class=
"seclect-group fl"
>
<span>
标签大小:
</span>
<select
class=
"tag-size"
>
<option
value=
"440*
30
0"
>
90*60
</option>
<option
value=
"440*
28
0"
>
90*60
</option>
</select>
</div>
<div
class=
"seclect-group fl"
>
...
...
@@ -51,8 +51,8 @@
</div>
</div>
<div
class=
"fztip"
>
格子区域为画图区域,每个辅助格子20px*20px,从左上角开始,横向为X轴,纵向为Y轴,标尺每个刻度10px
,标尺实际像素需要刻度值*10
</div>
<div
class=
"fztip"
style=
"color:red;"
>
双击删除编辑区域内标签工具!!!!!!
</div>
<div
class=
"fztip"
>
格子区域为画图区域,每个辅助格子20px*20px,从左上角开始,横向为X轴,纵向为Y轴,标尺每个刻度10px
</div>
<div
class=
"fztip"
><b
style=
"color:red;"
>
双击删除
</b>
编辑区域内标签工具,鼠标停留在画图区域,可按住
<b
style=
"color:red;"
>
键盘上下左右键移动当前标签工具
</b>
</div>
<div
class=
"fztip"
><span
style=
"color:red;"
>
颜色选择器,复制此处颜色可用
</span><input
type=
"text"
id=
"colorpicker"
/></div>
<div
class=
"edit-box fl"
>
...
...
resources/views/web/prints.blade.php
View file @
43e16b40
...
...
@@ -3,7 +3,7 @@
<style>
body
{
background
:
#fff
;
margin
:
0px
;}
.
edit-con
{
margin
:
10
px
;}
.
print
{
padding-top
:
20px
;
padding-left
:
15
px
;}
.layui-btn
{
display
:
inline-block
;
height
:
38px
;
...
...
@@ -19,23 +19,84 @@
cursor
:
pointer
;
}
</style>
<div
class=
"dybox"
>
@foreach($html as $item)
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
@endforeach
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
<div
class=
"print"
>
{!! $item !!}
</div>
@endforeach
<script
src=
"../../../../js/jquery-2.2.1.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
(){
$
(
".print"
).
width
(
$
(
".edit-con"
).
width
());
if
(
$
(
".edit-con"
).
height
()
==
280
){
$
(
".edit-con"
).
css
({
"height"
:
"301px"
})
}
$
(
".huabuitem[type='6'],.huabuitem[type='7']"
).
each
(
function
(){
var
urlo_
=
$
(
this
).
css
(
"backgroundImage"
).
replace
(
'url('
,
''
).
replace
(
')'
,
''
);
$
(
this
).
css
({
"background"
:
""
})
$
(
this
).
html
(
"
<
img
src
=
'"+urlo_.substring(1,urlo_.length-1)+"'
/>
");
$(this).find("
img
").css({width:"
100
%
",height:"
100
%
"
})
})
//
setTimeout(function(){
//
window.print();
//
}, 100);
setTimeout
(
function
(){
window
.
print
();
},
100
);
})
...
...
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