Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
b7a0dd76
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1173
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b7a0dd76
编写于
7月 04, 2024
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 文字模型修改
上级
9db63136
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
49 addition
and
98 deletion
+49
-98
report/src/main/resources/template/js/pageReportDesign/pageReportDesign.js
...esources/template/js/pageReportDesign/pageReportDesign.js
+2
-2
report/src/main/resources/template/js/reportWordModel/reportWordModelWrite.js
...urces/template/js/reportWordModel/reportWordModelWrite.js
+38
-72
report/src/main/resources/template/tpl/reportWordModel/reportWordModelWrite.html
...es/template/tpl/reportWordModel/reportWordModelWrite.html
+9
-24
未找到文件。
report/src/main/resources/template/js/pageReportDesign/pageReportDesign.js
浏览文件 @
b7a0dd76
...
...
@@ -57,12 +57,12 @@ layui.config({
mouseLineColor
:
"
blue
"
,
initData
:
initData
,
headerMenuJson
:
[{
"
icon
"
:
"
fa fa-
area-chart
fa-fw
"
,
"
icon
"
:
"
fa fa-
wordpress
fa-fw
"
,
"
title
"
:
"
文字
"
,
"
id
"
:
"
wordModel
"
,
"
children
"
:
wordModel
},
{
"
icon
"
:
"
fa fa-
area-chart
fa-fw
"
,
"
icon
"
:
"
fa fa-
photo-video
fa-fw
"
,
"
title
"
:
"
小图片
"
,
"
id
"
:
"
imgModel
"
,
"
children
"
:
imgModel
...
...
report/src/main/resources/template/js/reportWordModel/reportWordModelWrite.js
浏览文件 @
b7a0dd76
...
...
@@ -10,23 +10,26 @@ layui.config({
version
:
skyeyeVersion
}).
extend
({
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
],
function
(
exports
)
{
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
,
'
fileUpload
'
],
function
(
exports
)
{
winui
.
renderColor
();
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
,
form
=
layui
.
form
;
var
usetableTemplate
=
$
(
"
#usetableTemplate
"
).
html
();
var
isPic
=
false
;
// 是否生成预览图
let
id
=
GetUrlParam
(
"
id
"
);
if
(
isNull
(
id
))
{
sysDictDataUtil
.
showDictDataListByDictTypeCode
(
sysDictData
[
"
reportModeType
"
][
"
key
"
],
'
radioTree
'
,
"
typeBox
"
,
''
,
form
);
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
commonEnable
"
,
'
radio
'
,
"
enabled
"
,
''
,
form
);
// 初始化上传
$
(
"
#logo
"
).
upload
(
systemCommonUtil
.
uploadCommon003Config
(
'
logo
'
,
19
,
''
,
1
));
}
else
{
AjaxPostUtil
.
request
({
url
:
reportBasePath
+
"
queryWordModelById
"
,
params
:
{
id
:
id
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
data
)
{
$
(
"
#name
"
).
val
(
data
.
bean
.
name
);
$
(
"
#defaultWidth
"
).
val
(
data
.
bean
.
defaultWidth
);
$
(
"
#defaultHeight
"
).
val
(
data
.
bean
.
defaultHeight
);
// 初始化上传
$
(
"
#logo
"
).
upload
(
systemCommonUtil
.
uploadCommon003Config
(
'
logo
'
,
20
,
data
.
bean
.
imgPath
,
1
));
sysDictDataUtil
.
showDictDataListByDictTypeCode
(
sysDictData
[
"
reportModeType
"
][
"
key
"
],
'
radioTree
'
,
"
typeBox
"
,
data
.
bean
.
typeId
,
form
);
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
commonEnable
"
,
'
radio
'
,
"
enabled
"
,
data
.
bean
.
enabled
,
form
);
// 加载属性值
...
...
@@ -49,13 +52,6 @@ layui.config({
form
.
render
();
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
if
(
!
isPic
)
{
winui
.
window
.
msg
(
"
请先生成预览图
"
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
var
oCanvas
=
document
.
getElementById
(
"
thecanvas
"
);
var
imgData
=
oCanvas
.
toDataURL
();
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
common004
"
,
params
:
{
images
:
imgData
,
type
:
19
},
type
:
'
json
'
,
callback
:
function
(
json1
){
var
rowTr
=
$
(
"
#useTable tr
"
);
var
tableData
=
new
Array
();
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
...
...
@@ -79,7 +75,7 @@ layui.config({
defaultHeight
:
$
(
"
#defaultHeight
"
).
val
(),
wordModelAttrList
:
JSON
.
stringify
(
tableData
),
typeId
:
dataShowType
.
getData
(
'
typeBox
'
),
imgPath
:
json1
.
bean
.
picUrl
,
imgPath
:
$
(
"
#logo
"
).
find
(
"
input[type='hidden'][name='upload']
"
).
attr
(
"
oldurl
"
)
,
enabled
:
dataShowType
.
getData
(
'
enabled
'
),
id
:
isNull
(
id
)
?
''
:
id
};
...
...
@@ -87,16 +83,10 @@ layui.config({
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}});
}});
}
return
false
;
});
// 生成图片
$
(
"
body
"
).
on
(
"
click
"
,
"
#createPic
"
,
function
()
{
loadPic
();
});
function
loadPic
()
{
var
styleStr
=
""
;
$
.
each
(
choosePropertyList
,
function
(
key
,
value
){
...
...
@@ -104,38 +94,12 @@ layui.config({
styleStr
+=
value
.
attrCode
+
"
:
"
+
value
.
defaultValue
+
"
;
"
;
}
});
var
showPrit
=
'
<font style="
'
+
styleStr
+
'
">Hello, Skyeye</font>
'
;
$
(
"
#printPic
"
).
html
(
showPrit
);
html2canvas
(
$
(
"
#printPic
"
),
{
onrendered
:
function
(
canvas
)
{
// 添加属性
canvas
.
setAttribute
(
'
id
'
,
'
thecanvas
'
);
// 读取属性值
document
.
getElementById
(
'
images
'
).
innerHTML
=
''
;
document
.
getElementById
(
'
images
'
).
appendChild
(
canvas
);
$
(
"
#download
"
).
show
();
isPic
=
true
;
}
});
var
wordBox
=
document
.
createElement
(
"
font
"
);
wordBox
.
innerHTML
=
"
Hello, Skyeye
"
;
wordBox
.
style
=
styleStr
;
$
(
"
#printPic
"
)[
0
].
appendChild
(
wordBox
);
}
// 下载canvas图片
$
(
"
body
"
).
on
(
"
click
"
,
"
#download
"
,
function
()
{
var
oCanvas
=
document
.
getElementById
(
"
thecanvas
"
);
var
img_data1
=
Canvas2Image
.
saveAsPNG
(
oCanvas
,
true
).
getAttribute
(
'
src
'
);
saveFile
(
img_data1
,
'
richer.png
'
);
});
// 保存文件函数
var
saveFile
=
function
(
data
,
filename
){
var
save_link
=
document
.
createElementNS
(
'
http://www.w3.org/1999/xhtml
'
,
'
a
'
);
save_link
.
href
=
data
;
save_link
.
download
=
filename
;
var
event
=
document
.
createEvent
(
'
MouseEvents
'
);
event
.
initMouseEvent
(
'
click
'
,
true
,
false
,
window
,
0
,
0
,
0
,
0
,
0
,
false
,
false
,
false
,
false
,
0
,
null
);
save_link
.
dispatchEvent
(
event
);
};
// 新增行
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
()
{
addRow
();
...
...
@@ -172,6 +136,7 @@ layui.config({
// 移除界面上的信息
$
(
item
).
parent
().
parent
().
remove
();
});
loadPic
();
}
else
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
}
...
...
@@ -189,6 +154,7 @@ layui.config({
var
thisRowNum
=
trId
.
replace
(
"
tr
"
,
""
);
choosePropertyList
[
trId
]
=
chooseItemMation
;
$
(
"
#propertyId
"
+
thisRowNum
.
toString
()).
val
(
choosePropertyList
[
trId
].
name
);
loadPic
();
}});
});
...
...
report/src/main/resources/template/tpl/reportWordModel/reportWordModelWrite.html
浏览文件 @
b7a0dd76
...
...
@@ -5,7 +5,6 @@
<title></title>
<link
href=
"../../assets/lib/layui/css/layui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/report/css/ruler.css"
rel=
"stylesheet"
/>
</head>
<body>
<div
style=
"margin:0 auto;padding:20px;"
>
...
...
@@ -24,6 +23,12 @@
<div
class=
"layui-input-block winui-radio"
id=
"enabled"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
logo
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<div
class=
"upload"
id=
"logo"
></div>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
默认宽度
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
...
...
@@ -68,24 +73,9 @@
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
style=
"line-height: 45px"
>
效果图
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-col-xs8"
style=
"line-height: 60px"
>
<div
class=
"layui-col-xs10"
id=
"printPic"
style=
"width: 90px; height: 60px; text-align: center; line-height: 60px; background-color: white;"
>
<font>
Hello, Skyeye
</font>
</div>
<div
class=
"layui-col-xs2"
>
<a
href=
"javascript:;"
class=
"layui-btn layui-btn-xs"
id=
"createPic"
style=
"margin-left: 10px;margin-top: 10px;"
>
生成图片
</a>
</div>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
style=
"line-height: 45px"
>
预览图
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-col-xs6"
style=
"line-height: 60px"
>
<div
class=
"layui-col-xs10"
id=
"images"
>
</div>
<div
class=
"layui-col-xs2"
>
<a
href=
"javascript:;"
class=
"layui-btn layui-btn-xs"
id=
"download"
style=
"margin-left: 10px;margin-top: 10px; display: none"
>
下载
</a>
<label
class=
"layui-form-label"
>
效果图
</label>
<div
class=
"layui-input-block ver-center"
>
<div
class=
"layui-col-xs12"
id=
"printPic"
>
</div>
</div>
</div>
...
...
@@ -120,11 +110,6 @@
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<!-- html2canvas将Dom节点在Canvas里边画出来 -->
<script
src=
"../../assets/html2canvas/js/html2canvas.min.js"
></script>
<!-- 将canvas图片保存成图片 -->
<script
src=
"../../assets/html2canvas/js/canvas2image.js"
></script>
<script
src=
"../../assets/html2canvas/js/base64.js"
></script>
<script
type=
"text/javascript"
>
layui
.
config
({
base
:
'
../../js/reportWordModel/
'
}).
use
(
'
reportWordModelWrite
'
);
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录