Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
fc44e441
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看板
提交
fc44e441
编写于
11月 06, 2018
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
模板加入完成
上级
3fbe28d2
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
95 addition
and
6 deletion
+95
-6
skyeye-web/src/main/webapp/assets/lib/layui/custom.js
skyeye-web/src/main/webapp/assets/lib/layui/custom.js
+9
-0
skyeye-web/src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js
...src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js
+70
-4
skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js
...ye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js
+3
-1
skyeye-web/src/main/webapp/tpl/codemodelgroup/addcontenttohtmlorjs.html
.../main/webapp/tpl/codemodelgroup/addcontenttohtmlorjs.html
+13
-1
未找到文件。
skyeye-web/src/main/webapp/assets/lib/layui/custom.js
浏览文件 @
fc44e441
...
...
@@ -1115,6 +1115,15 @@ function showDataUseHandlebars(id, source, data){
layui
.
$
(
"
#
"
+
id
).
html
(
html
);
}
function
getDataUseHandlebars
(
source
,
data
){
//预编译模板
var
template
=
Handlebars
.
compile
(
source
);
//匹配json内容
var
html
=
template
(
data
);
//输入模板
return
html
;
}
...
...
skyeye-web/src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js
浏览文件 @
fc44e441
var
params
=
''
;
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
...
...
@@ -16,7 +18,7 @@ layui.config({
form
.
render
(
'
select
'
);
form
.
on
(
'
select(tableColumn)
'
,
function
(
data
){
console
.
log
(
1
);
returnResult
(
);
});
form
.
on
(
'
select(showModel)
'
,
function
(
data
){
...
...
@@ -35,7 +37,7 @@ layui.config({
jsSuccessEditor
.
setOption
(
'
mode
'
,
mode
);
}
jsModelEditor
.
setValue
(
json
.
bean
.
jsContent
);
returnResult
();
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
...
...
@@ -43,7 +45,7 @@ layui.config({
});
form
.
on
(
'
checkbox(checkboxLimit)
'
,
function
(
data
){
console
.
log
(
2
);
returnResult
(
);
});
//展现形式
...
...
@@ -127,16 +129,80 @@ layui.config({
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
result
=
{
formermation
:
params
.
require
,
aftermation
:
params
.
aftermation
,
htmlContent
:
htmlSuccessEditor
.
getValue
(),
jsContent
:
jsSuccessEditor
.
getValue
(),
};
parent
.
result
=
result
;
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}
return
false
;
});
$
(
"
body
"
).
on
(
"
keyup
"
,
"
#placeholderName
"
,
function
(
e
){
returnResult
();
});
$
(
"
body
"
).
on
(
"
keyup
"
,
"
#valueName
"
,
function
(
e
){
returnResult
();
})
function
returnResult
(){
var
tableColumn
=
$
(
"
#tableColumn
"
).
val
();
var
labelName
=
""
,
id
=
""
,
name
=
""
,
formermation
=
""
,
aftermation
=
""
;
if
(
!
isNull
(
tableColumn
)){
labelName
=
tableColumn
.
split
(
'
--
'
)[
0
];
id
=
replaceUnderLineAndUpperCase
(
tableColumn
.
split
(
'
--
'
)[
1
]);
name
=
replaceUnderLineAndUpperCase
(
tableColumn
.
split
(
'
--
'
)[
1
]);
}
if
(
!
isNull
(
htmlModelEditor
.
getValue
())){
$
.
each
(
$
(
'
input:checkbox:checked
'
),
function
(){
formermation
=
formermation
+
$
(
this
).
attr
(
"
formermation
"
)
+
"
|
"
;
aftermation
=
aftermation
+
$
(
this
).
attr
(
"
aftermation
"
)
+
"
,
"
;
});
params
=
{
labelContent
:
labelName
,
id
:
id
,
name
:
name
,
require
:
formermation
,
aftermation
:
aftermation
,
value
:
$
(
"
#valueName
"
).
val
(),
placeholder
:
$
(
"
#placeholderName
"
).
val
(),
};
htmlSuccessEditor
.
setValue
(
getDataUseHandlebars
(
htmlModelEditor
.
getValue
(),
params
));
if
(
!
isNull
(
jsModelEditor
.
getValue
())){
jsSuccessEditor
.
setValue
(
getDataUseHandlebars
(
jsModelEditor
.
getValue
(),
params
));
}
}
}
//取消
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
(){
parent
.
layer
.
close
(
index
);
});
/**
* 将字段转为Java经常使用的名字,如code_model转codeModel
*/
function
replaceUnderLineAndUpperCase
(
str
){
str
=
str
.
split
(
""
);
var
count
=
str
.
indexOf
(
"
_
"
);
while
(
count
!=
0
)
{
var
num
=
str
.
indexOf
(
"
_
"
,
count
);
count
=
num
+
1
;
if
(
num
!=
-
1
)
{
var
ss
=
str
[
count
];
var
ia
=
ss
.
toUpperCase
();
str
.
splice
(
count
,
1
,
ia
);
}
}
return
str
.
join
(
""
).
replace
(
/
[
_
]
/g
,
""
);
}
});
});
\ No newline at end of file
skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js
浏览文件 @
fc44e441
var
tableColumn
=
''
;
//数据库表中的列
var
result
=
''
;
//html/xml/js添加的内容项
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
...
...
@@ -195,7 +197,7 @@ layui.config({
pageId
:
"
addcontenttohtmlorjs
"
,
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
console
.
log
(
result
);
}
else
if
(
refreshCode
==
'
-9999
'
)
{
top
.
winui
.
window
.
msg
(
"
操作失败
"
,
{
icon
:
2
,
time
:
2000
});
}
...
...
skyeye-web/src/main/webapp/tpl/codemodelgroup/addcontenttohtmlorjs.html
浏览文件 @
fc44e441
...
...
@@ -32,6 +32,18 @@
<div
class=
"layui-input-block"
id=
"limitRequire"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
文本提示
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"placeholderName"
name=
"placeholderName"
placeholder=
"请输入文本提示"
class=
"layui-input"
maxlength=
"20"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
默认值
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"valueName"
name=
"valueName"
placeholder=
"请输入默认值"
class=
"layui-input"
maxlength=
"20"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
HTML模板展示
</label>
<div
class=
"layui-input-block"
>
...
...
@@ -59,7 +71,7 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
id=
"cancle"
>
取消
</button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formAddBean"
>
保存
</button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formAddBean"
>
加入模板
</button>
</div>
</div>
</form>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录