Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
9657a0f0
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1433
Star
162
Fork
130
代码
文件
提交
分支
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看板
提交
9657a0f0
编写于
2月 18, 2023
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表单组件新增适用范围属性
上级
dad93486
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
89 addition
and
10 deletion
+89
-10
common/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js
...sources/template/js/dsFormComponent/dsFormComponentAdd.js
+18
-1
common/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js
...ources/template/js/dsFormComponent/dsFormComponentEdit.js
+21
-0
common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html
...rces/template/tpl/dsFormComponent/dsFormComponentAdd.html
+11
-0
common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html
...ces/template/tpl/dsFormComponent/dsFormComponentEdit.html
+11
-0
web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js
...late/assets/lib/layui/customer/common/systemCommonUtil.js
+27
-9
web/src/main/resources/template/json/skyeyeClassEnum.json
web/src/main/resources/template/json/skyeyeClassEnum.json
+1
-0
未找到文件。
common/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js
浏览文件 @
9657a0f0
...
...
@@ -4,7 +4,7 @@ layui.config({
version
:
skyeyeVersion
}).
extend
({
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
table
'
,
'
jquery
'
,
'
winui
'
].
concat
(
dsFormUtil
.
mastHaveImport
),
function
(
exports
)
{
}).
define
([
'
window
'
,
'
table
'
,
'
jquery
'
,
'
winui
'
,
'
eleTree
'
].
concat
(
dsFormUtil
.
mastHaveImport
),
function
(
exports
)
{
winui
.
renderColor
();
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
,
...
...
@@ -21,6 +21,8 @@ layui.config({
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
dsFormShowType
"
,
'
select
'
,
"
showType
"
,
''
,
form
);
// 组件关联属性
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
componentAttr
"
,
'
verificationSelect
'
,
"
attrKeys
"
,
''
,
form
);
// 组件适用范围
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
componentApplyRange
"
,
'
radio
'
,
"
applyRange
"
,
''
,
form
);
// 根据类型获取部分功能的使用说明
systemCommonUtil
.
queryExplainMationByType
(
2
,
function
(
json
)
{
...
...
@@ -34,6 +36,19 @@ layui.config({
$
(
data
.
elem
).
val
(
data
.
elem
.
checked
);
});
$
(
"
#applyObjectBox
"
).
hide
();
form
.
on
(
'
radio(applyRangeFilter)
'
,
function
(
data
)
{
if
(
data
.
value
==
1
)
{
$
(
"
#applyObjectBox
"
).
hide
();
}
else
{
$
(
"
#applyObjectBox
"
).
show
();
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
queryServiceClassForTree
"
,
params
:
{},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
json
.
treeRows
=
json
.
rows
;
dataShowType
.
showData
(
json
,
'
checkboxTree
'
,
'
applyObject
'
,
''
,
form
);
}});
}
});
var
htmlEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"
htmlContent
"
),
codeUtil
.
getConfig
(
'
xml
'
));
var
htmlDataFromEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"
htmlDataFrom
"
),
codeUtil
.
getConfig
(
'
xml
'
));
var
jsEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"
jsContent
"
),
codeUtil
.
getConfig
(
'
text/javascript
'
));
...
...
@@ -61,6 +76,8 @@ layui.config({
typeId
:
$
(
"
#dsFormContentType
"
).
val
(),
showType
:
$
(
"
#showType
"
).
val
(),
attrKeys
:
$
(
'
#attrKeys
'
).
attr
(
'
value
'
),
applyRange
:
$
(
"
#applyRange input:radio:checked
"
).
val
(),
applyObject
:
$
(
"
#applyObject
"
).
attr
(
"
chooseId
"
),
linkedData
:
'
2
'
};
if
(
$
(
"
#linkedData
"
).
val
()
==
'
true
'
)
{
...
...
common/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js
浏览文件 @
9657a0f0
...
...
@@ -49,6 +49,8 @@ layui.config({
// 组件关联属性
var
attrKeys
=
isNull
(
json
.
bean
.
attrKeys
)
?
''
:
json
.
bean
.
attrKeys
.
toString
();
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
componentAttr
"
,
'
verificationSelect
'
,
"
attrKeys
"
,
attrKeys
,
form
);
// 组件适用范围
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
componentApplyRange
"
,
'
radio
'
,
"
applyRange
"
,
json
.
bean
.
applyRange
,
form
);
// 根据类型获取部分功能的使用说明
systemCommonUtil
.
queryExplainMationByType
(
2
,
function
(
json
)
{
...
...
@@ -69,6 +71,11 @@ layui.config({
$
(
data
.
elem
).
val
(
data
.
elem
.
checked
);
});
loadRange
(
json
.
bean
.
applyRange
,
json
.
bean
.
applyObject
);
form
.
on
(
'
radio(applyRangeFilter)
'
,
function
(
data
)
{
loadRange
(
data
.
value
,
null
);
});
matchingLanguage
();
form
.
render
();
form
.
on
(
'
submit(formEditBean)
'
,
function
(
data
)
{
...
...
@@ -89,6 +96,8 @@ layui.config({
showType
:
$
(
"
#showType
"
).
val
(),
linkedData
:
'
2
'
,
attrKeys
:
$
(
'
#attrKeys
'
).
attr
(
'
value
'
),
applyRange
:
$
(
"
#applyRange input:radio:checked
"
).
val
(),
applyObject
:
$
(
"
#applyObject
"
).
attr
(
"
chooseId
"
),
id
:
parent
.
rowId
};
if
(
$
(
"
#linkedData
"
).
val
()
==
'
true
'
)
{
...
...
@@ -113,6 +122,18 @@ layui.config({
}
});
function
loadRange
(
type
,
defaultValue
)
{
if
(
type
==
1
)
{
$
(
"
#applyObjectBox
"
).
hide
();
}
else
{
$
(
"
#applyObjectBox
"
).
show
();
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
queryServiceClassForTree
"
,
params
:
{},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
json
.
treeRows
=
json
.
rows
;
dataShowType
.
showData
(
json
,
'
checkboxTree
'
,
'
applyObject
'
,
JSON
.
stringify
(
defaultValue
),
form
);
}});
}
}
// 取消
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
()
{
parent
.
layer
.
close
(
index
);
...
...
common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html
浏览文件 @
9657a0f0
...
...
@@ -55,6 +55,17 @@
</select>
</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"
id=
"applyRange"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
id=
"applyObjectBox"
>
<label
class=
"layui-form-label"
>
适用对象
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
id=
"applyObject"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
HTML脚本
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
...
...
common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html
浏览文件 @
9657a0f0
...
...
@@ -61,6 +61,17 @@
<
/select
>
<
/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
"
id
=
"
applyRange
"
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
id
=
"
applyObjectBox
"
>
<
label
class
=
"
layui-form-label
"
>
适用对象
<
i
class
=
"
red
"
>*<
/i></
label
>
<
div
class
=
"
layui-input-block
"
id
=
"
applyObject
"
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
HTML脚本
<
i
class
=
"
red
"
>*<
/i></
label
>
<
div
class
=
"
layui-input-block
"
>
...
...
web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js
浏览文件 @
9657a0f0
...
...
@@ -1026,8 +1026,8 @@ var dataShowType = {
form
.
render
(
'
checkbox
'
);
}
else
if
(
showType
==
'
radio
'
)
{
// 单选框
$
(
"
#
"
+
showBoxId
).
html
(
getDataUseHandlebars
(
'
{{#each rows}}<input type="radio" name="
'
+
showBoxId
+
'
Name" value="{{id}}" title="{{name}}" />{{/each}}
'
,
json
));
if
(
!
isNull
(
defaultId
)
||
defaultId
==
0
)
{
$
(
"
#
"
+
showBoxId
).
html
(
getDataUseHandlebars
(
`{{#each rows}}<input type="radio" name="
${
showBoxId
}
Name" lay-filter="
${
showBoxId
}
Filter" value="{{id}}" title="{{name}}" />{{/each}}`
,
json
));
if
(
!
isNull
(
defaultId
)
||
defaultId
+
''
==
'
0
'
)
{
$
(
"
#
"
+
showBoxId
+
"
input:radio[name=
"
+
showBoxId
+
"
Name][value=
"
+
defaultId
+
"
]
"
).
attr
(
"
checked
"
,
true
);
}
else
{
$
.
each
(
json
.
rows
,
function
(
i
,
item
)
{
...
...
@@ -1106,8 +1106,8 @@ var dataShowType = {
}
});
});
}
else
if
(
showType
==
'
radioTree
'
)
{
// 单选框树
}
else
if
(
showType
==
'
radioTree
'
||
showType
==
'
checkboxTree
'
)
{
// 单选框树
/多选框树
var
_html
=
sysDictDataUtil
.
getShowTteeHtml
(
showBoxId
,
'
0
'
);
var
_js
=
`<script>
layui.define(["jquery", 'fsTree'], function(exports) {
...
...
@@ -1120,12 +1120,21 @@ var dataShowType = {
simpleData: '`
+
JSON
.
stringify
(
json
.
treeRows
)
+
`',
checkEnable: true,
loadEnable: false,
chkStyle:
"radio
",
chkStyle:
'
${
showType
}
' == 'radioTree' ? "radio" : "checkbox
",
showLine: false,
showIcon: true,
expandSpeed: 'fast',
onCheck: function (event, treeId, treeNode) {
$('#
${
showBoxId
}
').attr('chooseId', treeNode.id);
if ('
${
showType
}
' == 'checkboxTree') {
var zTree =
${
showBoxId
}
Object.getCheckedNodes(true);
var ids = [];
$.each(zTree, function(i, item) {
ids.push(item.id);
});
$('#
${
showBoxId
}
').attr('chooseId', JSON.stringify(ids));
} else {
$('#
${
showBoxId
}
').attr('chooseId', treeNode.id);
}
}
}, function(id) {
${
showBoxId
}
Object = $.fn.zTree.getZTreeObj(id);
...
...
@@ -1134,11 +1143,20 @@ var dataShowType = {
if (`
+
!
isNull
(
defaultId
)
+
`) {
var zTree =
${
showBoxId
}
Object.getCheckedNodes(false);
for (var i = 0; i < zTree.length; i++) {
if(zTree[i].id == '`
+
defaultId
+
`'){
${
showBoxId
}
Object.checkNode(zTree[i], true, true);
$('#
${
showBoxId
}
').attr('chooseId', zTree[i].id);
if ('
${
showType
}
' == 'checkboxTree') {
if($.inArray(zTree[i].id,
${
defaultId
}
) >= 0){
${
showBoxId
}
Object.checkNode(zTree[i], true, true);
}
} else {
if(zTree[i].id == '`
+
defaultId
+
`'){
${
showBoxId
}
Object.checkNode(zTree[i], true, true);
$('#
${
showBoxId
}
').attr('chooseId', zTree[i].id);
}
}
}
if ('
${
showType
}
' == 'checkboxTree') {
$('#
${
showBoxId
}
').attr('chooseId', JSON.stringify(`
+
defaultId
+
`));
}
}
})(jQuery);});
</script>`
;
...
...
web/src/main/resources/template/json/skyeyeClassEnum.json
浏览文件 @
9657a0f0
...
...
@@ -40,6 +40,7 @@
"dsFormPageType"
:
{
"name"
:
"表单布局类型"
,
"className"
:
"skyeye-pro#com.skyeye.dsform.classenum.DsFormPageType"
},
"attrKeyDataType"
:
{
"name"
:
"表单布局里面的组件关联的数据类型"
,
"className"
:
"skyeye-pro#com.skyeye.attr.classenum.AttrKeyDataType"
},
"componentAttr"
:
{
"name"
:
"组件关联的属性"
,
"className"
:
"skyeye-pro#com.skyeye.dsform.classenum.ComponentAttr"
},
"componentApplyRange"
:
{
"name"
:
"组件适用范围类型"
,
"className"
:
"skyeye-pro#com.skyeye.dsform.classenum.ComponentApplyRange"
},
"buttonColorType"
:
{
"name"
:
"操作按钮颜色"
,
"className"
:
"skyeye-pro#com.skyeye.attr.classenum.ButtonColorType"
},
"eventType"
:
{
"name"
:
"操作按钮事件类型"
,
"className"
:
"skyeye-pro#com.skyeye.operate.classenum.EventType"
},
"operatePosition"
:
{
"name"
:
"操作按钮展示位置"
,
"className"
:
"skyeye-pro#com.skyeye.operate.classenum.OperatePosition"
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录