Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
6ccbdf3e
提交
6ccbdf3e
编写于
2月 14, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
8da6003a
7b06f35b
变更
33
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
1015 行增加
和
54 行删除
+1015
-54
CtrlModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
+34
-0
derules.hbs
...in/resources/templ/r7/@macro/front-end/common/derules.hbs
+40
-0
auto-complete.hbs
...urces/templ/r7/@macro/front-end/editors/auto-complete.hbs
+5
-1
checkbox-list.hbs
...urces/templ/r7/@macro/front-end/editors/checkbox-list.hbs
+5
-1
checkbox.hbs
.../resources/templ/r7/@macro/front-end/editors/checkbox.hbs
+5
-1
code.hbs
...main/resources/templ/r7/@macro/front-end/editors/code.hbs
+5
-1
data-picker-view.hbs
...es/templ/r7/@macro/front-end/editors/data-picker-view.hbs
+5
-1
data-picker.hbs
...sources/templ/r7/@macro/front-end/editors/data-picker.hbs
+5
-1
date-picker.hbs
...sources/templ/r7/@macro/front-end/editors/date-picker.hbs
+5
-1
dropdown-list.hbs
...urces/templ/r7/@macro/front-end/editors/dropdown-list.hbs
+5
-1
input-ip.hbs
.../resources/templ/r7/@macro/front-end/editors/input-ip.hbs
+5
-1
input.hbs
...ain/resources/templ/r7/@macro/front-end/editors/input.hbs
+5
-1
list-box.hbs
.../resources/templ/r7/@macro/front-end/editors/list-box.hbs
+5
-1
radio-group.hbs
...sources/templ/r7/@macro/front-end/editors/radio-group.hbs
+5
-1
rating.hbs
...in/resources/templ/r7/@macro/front-end/editors/rating.hbs
+5
-1
raw.hbs
.../main/resources/templ/r7/@macro/front-end/editors/raw.hbs
+5
-1
rich-text.hbs
...resources/templ/r7/@macro/front-end/editors/rich-text.hbs
+5
-1
slider.hbs
...in/resources/templ/r7/@macro/front-end/editors/slider.hbs
+5
-1
span.hbs
...main/resources/templ/r7/@macro/front-end/editors/span.hbs
+5
-1
stepper.hbs
...n/resources/templ/r7/@macro/front-end/editors/stepper.hbs
+5
-1
switch.hbs
...in/resources/templ/r7/@macro/front-end/editors/switch.hbs
+5
-1
upload.hbs
...in/resources/templ/r7/@macro/front-end/editors/upload.hbs
+5
-1
grid-column-model.hbs
...macro/front-end/widgets/grid-detail/grid-column-model.hbs
+4
-4
grid-column.hbs
...l/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
+8
-7
grid-control-state.ts
...c/core/modules/widgets/grid-control/grid-control-state.ts
+14
-0
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+26
-8
md-control.ts
...{apps}}/src/core/modules/widgets/md-control/md-control.ts
+6
-2
index.ts
...esources/templ/r7/app_{{apps}}/src/core/utils/ui/index.ts
+2
-1
verify.ts
...sources/templ/r7/app_{{apps}}/src/core/utils/ui/verify.ts
+713
-0
index.scss
...resources/templ/r7/app_{{apps}}/src/style/base/index.scss
+2
-2
app-grid.scss
...ces/templ/r7/app_{{apps}}/src/style/widgets/app-grid.scss
+10
-0
{{ctrls@GRID}}-grid-state.ts.hbs
...es}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
+53
-9
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+3
-1
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
浏览文件 @
6ccbdf3e
...
...
@@ -12,6 +12,8 @@ import net.ibizsys.model.control.IPSControl;
import
net.ibizsys.model.control.IPSControlContainer
;
import
net.ibizsys.model.control.dashboard.IPSDBContainerPortletPart
;
import
net.ibizsys.model.control.dashboard.IPSDBPortletPart
;
import
net.ibizsys.model.control.grid.IPSDEGrid
;
import
net.ibizsys.model.control.grid.IPSDEGridColumn
;
import
net.ibizsys.model.control.toolbar.IPSDETBUIActionItem
;
import
net.ibizsys.model.control.toolbar.IPSDEToolbar
;
import
net.ibizsys.model.view.IPSUIAction
;
...
...
@@ -217,6 +219,38 @@ public class CtrlModel extends BaseModel{
}
}
// 表格是否需要空白列
public
Boolean
isNeedEmptyColumn
()
{
if
(
getControl
().
getControlType
()
!=
null
&&
"GRID"
.
equals
(
getControl
().
getControlType
()))
{
Boolean
flag
=
true
;
for
(
IPSDEGridColumn
column
:
((
IPSDEGrid
)
getControl
()).
getPSDEGridColumns
())
{
// 自适应列
if
(
column
.
getWidthUnit
()
!=
null
&&
"STAR"
.
equals
(
column
.
getWidthUnit
())
&&
column
.
getColumnType
()
!=
null
&&
!
"GROUPGRIDCOLUMN"
.
equals
(
column
.
getColumnType
())
)
{
flag
=
false
;
break
;
}
}
return
flag
;
}
return
false
;
}
// 获取表格列总宽度
public
Integer
getTotalColumnWidth
()
{
Integer
width
=
10
;
if
(
getControl
().
getControlType
()
!=
null
&&
"GRID"
.
equals
(
getControl
().
getControlType
()))
{
for
(
IPSDEGridColumn
column
:
((
IPSDEGrid
)
getControl
()).
getPSDEGridColumns
())
{
width
+=
column
.
getWidth
();
}
}
return
width
;
}
// 忽略发布
public
Boolean
ignore
()
{
IPSControl
control
=
getControl
();
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/common/derules.hbs
0 → 100644
浏览文件 @
6ccbdf3e
{
{{#if
item
.
condOp
}}
"condOp": "
{{
item
.
condOp
}}
",
{{/if}}
"notMode":
{{
item
.
notMode
}}
,
"condType": "
{{
item
.
condType
}}
",
"ruleInfo": "
{{
item
.
ruleInfo
}}
",
"keyCond":
{{
item
.
keyCond
}}
,
{{#
eq
item
.
condType
'SIMPLE'
}}
"paramType": "
{{
item
.
paramType
}}
",
"paramValue": "
{{
item
.
paramValue
}}
",
{{/
eq
}}
{{#if
(
or
(
eq
item
.
condType
'VALUERANGE2'
)
(
eq
item
.
condType
'STRINGLENGTH'
))
}}
"includeMinValue":
{{
item
.
includeMinValue
}}
,
"minValue": "
{{
item
.
minValue
}}
",
"includeMaxValue":
{{
item
.
includeMaxValue
}}
,
"maxValue": "
{{
item
.
maxValue
}}
",
{{/if}}
{{#
eq
item
.
condType
'REGEX'
}}
"regExCode":
{{
item
.
regExCode
}}
,
{{/
eq
}}
{{#if
(
and
(
eq
item
.
condType
'SYSVALUERULE'
)
item
.
psSysValueRule
)
}}
{{#
with
item
.
psSysValueRule
as
|
sysRule
|
}}
"sysValueRule": {
"ruleType": "
{{
sysRule
.
ruleType
}}
",
"regExCode": "
{{
sysRule
.
regExCode
}}
",
"ruleInfo": "
{{
sysRule
.
ruleInfo
}}
",
"scriptCode": `
{{
sysRule
.
scriptCode
}}
`
}
{{/
with
}}
{{/if}}
{{#if
item
.
psDEFVRConditions
}}
"conditions": [
{{#
each
item
.
psDEFVRConditions
as
|
condition
|
}}
{{>
@macro
/
front-end
/
common
/
derules
.
hbs
item
=
condition
}}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
{{/if}}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/auto-complete.hbs
浏览文件 @
6ccbdf3e
<AppAutoComplete
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:data=
"state.data"
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
...
...
@@ -51,7 +55,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/checkbox-list.hbs
浏览文件 @
6ccbdf3e
<AppCheckboxList
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:data=
"state.data"
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
...
...
@@ -25,7 +29,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/checkbox.hbs
浏览文件 @
6ccbdf3e
<AppCheckbox
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -11,7 +15,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/code.hbs
浏览文件 @
6ccbdf3e
<AppCode
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -11,7 +15,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
:context=
"state.context"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/data-picker-view.hbs
浏览文件 @
6ccbdf3e
<AppDataPickerView
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:data=
"state.data"
{{#if
item
.
valueItemName
}}
valueItem=
"
{{
item
.
valueItemName
}}
"
...
...
@@ -29,7 +33,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/data-picker.hbs
浏览文件 @
6ccbdf3e
<AppDataPicker
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:data=
"state.data"
{{#if
item
.
valueItemName
}}
valueItem=
"
{{
item
.
valueItemName
}}
"
...
...
@@ -52,7 +56,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/date-picker.hbs
浏览文件 @
6ccbdf3e
<AppDatePicker
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#if
item
.
psEditor
.
placeHolder
}}
placeholder=
"
{{
item
.
psEditor
.
placeHolder
}}
"
{{/if}}
...
...
@@ -50,7 +54,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/dropdown-list.hbs
浏览文件 @
6ccbdf3e
<AppDropdownList
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psAppCodeList
}}
codeListTag=
"
{{
item
.
psEditor
.
psAppCodeList
.
codeListTag
}}
"
codeListType=
"
{{
item
.
psEditor
.
psAppCodeList
.
codeListType
}}
"
...
...
@@ -33,7 +37,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
:data=
"record"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/input-ip.hbs
浏览文件 @
6ccbdf3e
<AppInputIp
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -11,7 +15,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/input.hbs
浏览文件 @
6ccbdf3e
<AppInput
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -44,7 +48,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/list-box.hbs
浏览文件 @
6ccbdf3e
<AppListBox
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:data=
"state.data"
:server=
"state.controlService"
:deMajorField=
"state.appDeMajorFieldName"
...
...
@@ -41,7 +45,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/radio-group.hbs
浏览文件 @
6ccbdf3e
<AppRadioGroup
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:data=
"state.data"
{{#if
item
.
psEditor
.
psAppCodeList
}}
codeListTag=
"
{{
item
.
psEditor
.
psAppCodeList
.
codeListTag
}}
"
...
...
@@ -25,7 +29,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/rating.hbs
浏览文件 @
6ccbdf3e
<AppRating
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -17,7 +21,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/raw.hbs
浏览文件 @
6ccbdf3e
<AppRaw
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:date=
"state.data"
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
...
...
@@ -20,7 +24,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/rich-text.hbs
浏览文件 @
6ccbdf3e
<AppRichText
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -23,7 +27,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
:data=
"record"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/slider.hbs
浏览文件 @
6ccbdf3e
<AppSlider
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
:date=
"state.data"
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
...
...
@@ -21,7 +25,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/span.hbs
浏览文件 @
6ccbdf3e
<AppSpan
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -33,7 +37,7 @@
:value=
"state.data.
{{
item
.
psEditor
.
name
}}
"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
{{/
eq
}}
:context=
"state.context"
:viewParams=
"state.viewParams"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/stepper.hbs
浏览文件 @
6ccbdf3e
<AppStepper
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -23,7 +27,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/switch.hbs
浏览文件 @
6ccbdf3e
<AppSwitch
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#
eq
ctrlType
'form'
}}
:disabled=
"state.detailsModel.
{{
item
.
codeName
}}
.disabled"
{{/
eq
}}
...
...
@@ -14,7 +18,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/editors/upload.hbs
浏览文件 @
6ccbdf3e
<AppUpload
{{#if
(
and
(
eq
ctrlType
'grid'
)
dataItemName
)
}}
name=
"
{{
dataItemName
}}
"
{{else}}
name=
"
{{
item
.
codeName
}}
"
{{/if}}
{{#if
item
.
psEditor
.
editorParams
.
method
}}
method=
"
{{
item
.
psEditor
.
editorParams
.
method
}}
"
{{/if}}
...
...
@@ -34,7 +38,7 @@
@
editorEvent=
"onEditorEvent"
{{/if}}
{{#
eq
ctrlType
'grid'
}}
:value=
"record.
{{
item
.
psEditor
.
name
}}
"
:value=
"record.
{{
#if
dataItemName
}}{{
dataItemName
}}{{else}}{{
item
.
psEditor
.
name
}}{{/if
}}
"
@
editorEvent=
"onEditorEvent($event,index)"
{{/
eq
}}
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column-model.hbs
浏览文件 @
6ccbdf3e
...
...
@@ -5,11 +5,11 @@
{{#if
item
.
align
}}
align: "
{{
lowerCase
item
.
align
}}
",
{{/if}}
{{#if
(
eq
item
.
widthUnit
'PX'
)
}}
{{#if
(
eq
item
.
widthUnit
'PX'
)
}}
width:
{{
item
.
width
}}
,
{{else
}}
{{else
if
(
gt
item
.
width
1
)
}}
minWidth:
{{
item
.
width
}}
,
{{/if}}
{{/if}}
resizable: true,
{{#if
(
and
item
.
enableLinkView
item
.
linkPSAppView
)
}}
linkView: "
{{
item
.
linkPSAppView
.
codeName
}}
",
...
...
@@ -18,7 +18,7 @@
{{#
eq
item
.
columnType
'GROUPGRIDCOLUMN'
}}
children: [
{{#
each
item
.
psDEGridColumns
as
|
column
|
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"COLUMNMODEL"
item
=
column
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"COLUMNMODEL"
item
=
column
}}
{{/
each
}}
],
{{else}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
浏览文件 @
6ccbdf3e
{{#
*
inline
"COLUMNTEXT"
}}
{{#if
(
and
item
.
psAppCodeList
(
eq
item
.
cLConvertMode
'FRONT'
))
}}
<AppCodelist
name=
"
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if}}
"
codeListTag=
"
{{
item
.
psAppCodeList
.
codeListTag
}}
"
:context=
"state.context"
:data=
"record"
...
...
@@ -20,7 +21,7 @@
{{else}}
{{#if
item
.
valueFormat
}}
<AppSpan
name=
"
{{
lowerCase
item
.
codeName
}}
"
name=
"
{{
#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if
}}
"
:value=
"text"
{{#if
item
.
psAppDEField
}}
:dataType=
"
{{
item
.
psAppDEField
.
stdDataType
}}
"
...
...
@@ -40,19 +41,19 @@
{{/
each
}}
{{else}}
{{#
unless
(
or
item
.
hideDefault
item
.
hiddenDataItem
)
}}
<div
v-if=
"Object.is(column.dataIndex, '
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if}}
')"
class=
"table-cell
{{#if
item
.
cellPSSysCss
}}
{{
item
.
cellPSSysCss
.
cssName
}}{{/if}}
"
>
<div
v-if=
"Object.is(column.dataIndex, '
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if}}
')"
class=
"table-cell
{{#if
item
.
cellPSSysCss
}}
{{
item
.
cellPSSysCss
.
cssName
}}{{/if}}
"
>
{{#if
(
eq
item
.
columnType
'DEFGRIDCOLUMN'
)
}}
{{#if
item
.
enableRowEdit
}}
<div
v-if=
"state.rowEditState"
class=
"editor-cell"
>
<AppFormItem
name=
"
{{
item
.
codeName
}}
"
:error=
"state.gridEditState.
{{
item
.
codeName
}}
?.[index]?.message"
name=
"
{{
#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if
}}
"
:error=
"state.gridEditState.
{{
#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if
}}
?.[index]?.message"
:rules=
"state.rules.
{{
item
.
codeName
}}
"
:showLabel=
"false"
>
{{#
each
ctrl
.
psDEGridEditItems
as
|
editColumn
|
}}
{{#if
(
eq
editColumn
.
codeName
item
.
codeName
)
}}
{{>
@macro
/
front-end
/
editors
/
include-editor
.
hbs
type
=
editColumn
.
psEditor
.
editorType
item
=
editColumn
ctrlType
=
"grid"
}}
{{>
@macro
/
front-end
/
editors
/
include-editor
.
hbs
type
=
editColumn
.
psEditor
.
editorType
item
=
editColumn
dataItemName
=
item
.
dataItemName
ctrlType
=
"grid"
}}
{{/if}}
{{/
each
}}
</AppFormItem>
...
...
@@ -80,8 +81,8 @@
{{else
if
(
eq
item
.
columnType
'UAGRIDCOLUMN'
)
}}
<AppToolbar
mode=
"link"
name=
"
{{
lowerCase
item
.
codeName
}}
"
:actionModel=
"record.
{{
lowerCase
item
.
codeName
}}
"
name=
"
{{
#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if
}}
"
:actionModel=
"record.
{{
#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if
}}
"
@
onToolbarEvent=
"onActionColEvent($event, record)"
/>
{{/if}}
</div>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control-state.ts
浏览文件 @
6ccbdf3e
...
...
@@ -58,4 +58,18 @@ export interface GridControlState extends MDControlState {
*/
updateDefaultItems
:
IParam
[];
/**
* @description 表格列总宽度
* @type {number}
* @memberof GridControlState
*/
totalColumnWidth
:
number
;
/**
* @description 选择列宽度(默认50,存在聚合列时为100)
* @type {number}
* @memberof GridControlState
*/
selectColumnWidth
:
number
;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
6ccbdf3e
import
{
DataTypes
,
dateFormat
,
deepCopy
,
GridControlState
,
IActionParam
,
IParam
,
isExistAndNotEmpty
,
MDControl
}
from
"@core"
;
import
{
createUUID
}
from
"qx-util"
;
import
schema
,
{
ErrorList
,
FieldErrorList
}
from
'async-validator'
;
import
{
Ref
}
from
"vue"
;
/**
* @description 表格部件
* @export
...
...
@@ -30,12 +31,12 @@ export class GridControl extends MDControl {
* @memberof GridControl
*/
public
useCustom
()
{
const
{
controlName
,
selectFirstDefault
,
rowEditState
,
rowActiveMode
,
isSingleSelect
}
=
this
.
state
;
const
{
selectFirstDefault
,
rowEditState
,
selectColumnWidth
,
isSingleSelect
,
totalColumnWidth
}
=
this
.
state
;
// 滚动条配置
const
useScrollOption
=
computed
(()
=>
{
return
{
scrollToFirstRowOnChange
:
true
,
x
:
'10
0%'
,
x
:
totalColumnWidth
||
'15
0%'
,
y
:
'100%'
,
}
});
...
...
@@ -100,6 +101,11 @@ export class GridControl extends MDControl {
}
};
}
// 展开行
const
useExpandedRowKeys
:
Ref
<
Array
<
string
>>
=
ref
([]);
const
onExpandedRowsChange
=
(
expandedRows
:
string
[])
=>
{
useExpandedRowKeys
.
value
=
expandedRows
;
}
// 表格选择功能配置
const
useRowSelectionOption
=
computed
(()
=>
{
if
(
selectFirstDefault
)
{
...
...
@@ -107,10 +113,20 @@ export class GridControl extends MDControl {
}
return
{
type
:
isSingleSelect
?
'radio'
:
'checkbox'
,
columnWidth
:
32
,
columnWidth
:
selectColumnWidth
,
selectedRowKeys
:
this
.
state
.
selectedRowKeys
,
checkStrictly
:
this
.
props
.
multiple
?
false
:
true
,
onChange
:
(
_selectedRowKeys
:
string
[],
selectedRows
:
IParam
[])
=>
{
checkStrictly
:
false
,
onSelect
:
(
record
:
IParam
,
selected
:
boolean
,
selectedRows
:
IParam
[],
$event
:
any
)
=>
{
if
(
selected
)
{
const
{
appDeKeyFieldName
}
=
this
.
state
;
const
selectedRowKey
:
string
=
record
[
appDeKeyFieldName
]
||
record
.
srfkey
;
const
index
:
number
=
useExpandedRowKeys
.
value
.
findIndex
((
key
:
string
)
=>
Object
.
is
(
key
,
selectedRowKey
))
if
(
Object
.
is
(
index
,
-
1
)
&&
record
.
children
&&
record
.
children
.
length
>
0
)
{
useExpandedRowKeys
.
value
.
push
(
selectedRowKey
);
}
}
},
onChange
:
(
_selectedRowKeys
:
string
[],
selectedRows
:
any
[])
=>
{
this
.
state
.
selectedRowKeys
=
_selectedRowKeys
;
const
selection
:
IParam
[]
=
[];
selectedRows
.
forEach
((
select
:
IParam
)
=>
{
...
...
@@ -142,9 +158,11 @@ export class GridControl extends MDControl {
useRowKey
,
useRowClassName
,
useCustomRow
,
useExpandedRowKeys
,
useRowSelectionOption
,
onResizeColumn
,
onGridChange
onGridChange
,
onExpandedRowsChange
}
}
...
...
@@ -171,7 +189,7 @@ export class GridControl extends MDControl {
* @param {string} tag
* @memberof GridControl
*/
p
ublic
handleGridItemValueChange
(
rowIndex
:
number
,
tag
:
string
,
data
:
any
)
{
p
rivate
handleGridItemValueChange
(
rowIndex
:
number
,
tag
:
string
,
data
:
any
)
{
const
{
items
}
=
toRefs
(
this
.
state
);
if
(
items
.
value
[
rowIndex
][
tag
]
!==
data
)
{
items
.
value
[
rowIndex
][
tag
]
=
data
;
...
...
@@ -518,7 +536,7 @@ export class GridControl extends MDControl {
* @protected
* @memberof MDControl
*/
protected
async
codeListGroupData
()
{
protected
async
codeListGroupData
()
{
const
{
groupField
,
groupCodeList
}
=
this
.
state
.
mdCtrlGroup
;
const
{
items
,
context
,
viewParams
,
columnsModel
}
=
toRefs
(
this
.
state
);
if
(
!
groupCodeList
||
!
isExistAndNotEmpty
(
groupCodeList
.
codeListTag
))
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/md-control/md-control.ts
浏览文件 @
6ccbdf3e
...
...
@@ -65,8 +65,12 @@ export class MDControl extends MainControl {
let
tempViewParams
=
deepCopy
(
viewParams
?
viewParams
:
{});
const
{
noSort
,
minorSortDir
,
minorSortPSDEF
}
=
mdCtrlSort
;
let
{
enablePagingBar
,
current
,
pageSize
}
=
mdCtrlPaging
;
if
(
!
noSort
&&
minorSortDir
&&
minorSortPSDEF
)
{
Object
.
assign
(
tempViewParams
,
{
sort
:
`
${
minorSortPSDEF
}
,
${
minorSortDir
}
`
});
if
(
!
noSort
)
{
if
(
arg
&&
arg
.
sort
)
{
Object
.
assign
(
tempViewParams
,
{
sort
:
arg
.
sort
});
}
else
if
(
minorSortDir
&&
minorSortPSDEF
)
{
Object
.
assign
(
tempViewParams
,
{
sort
:
`
${
minorSortPSDEF
}
,
${
minorSortDir
}
`
});
}
}
if
(
enablePagingBar
)
{
Object
.
assign
(
tempViewParams
,
{
page
:
current
-
1
,
size
:
pageSize
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/index.ts
浏览文件 @
6ccbdf3e
...
...
@@ -2,4 +2,5 @@ export { RouteUtil } from './route-util';
export
{
UIUtil
}
from
'./ui-util'
;
export
{
UIActionUtil
}
from
'./uiaction-util'
;
export
{
ViewUtil
}
from
'./view-util'
;
export
{
DataTypes
}
from
'./data-types'
;
\ No newline at end of file
export
{
DataTypes
}
from
'./data-types'
;
export
{
Verify
}
from
'./verify'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/verify.ts
0 → 100644
浏览文件 @
6ccbdf3e
import
{
isEmpty
,
isExistAndNotEmpty
}
from
"@core"
;
/**
* 校验对象
*
* @export
* @class Verify
*/
export
class
Verify
{
/**
* 错误提示信息
*
* @static
* @type {string}
* @memberof Verify
*/
public
static
errorInfo
:
string
=
''
;
/**
* 值比较
*
* @static
* @param {*} value
* @param {*} value2
* @returns {number}
* @memberof Verify
*/
public
static
compare
(
value
:
any
,
value2
:
any
):
number
{
let
result
:
any
;
if
(
!
Object
.
is
(
value
,
''
)
&&
!
Object
.
is
(
value2
,
''
)
&&
!
isNaN
(
value
)
&&
!
isNaN
(
value2
))
{
result
=
this
.
compareNumber
(
parseFloat
(
value
),
parseFloat
(
value2
));
}
else
if
(
this
.
isParseDate
(
value
)
&&
this
.
isParseDate
(
value2
))
{
result
=
this
.
compareDate
(
new
Date
(
value
).
getTime
(),
new
Date
(
value2
).
getTime
());
}
else
if
(
value
&&
(
typeof
value
===
'boolean'
||
value
instanceof
Boolean
))
{
result
=
this
.
compareBoolean
(
value
,
value2
);
}
else
if
(
value
&&
(
typeof
value
===
'string'
||
value
instanceof
String
))
{
result
=
this
.
compareString
(
value
,
value2
);
}
return
result
;
}
/**
* 字符串比较
*
* @static
* @param {*} value
* @param {*} value2
* @returns {number}
* @memberof Verify
*/
public
static
compareString
(
value
:
any
,
value2
:
any
):
number
{
return
value
.
localeCompare
(
value2
);
}
/**
* boolean 值比较
*
* @static
* @param {*} value
* @param {*} value2
* @returns {number}
* @memberof Verify
*/
public
static
compareBoolean
(
value
:
any
,
value2
:
any
):
number
{
if
(
value
===
value2
)
{
return
0
;
}
else
{
return
-
1
;
}
}
/**
* 时间值比较(毫秒数)
*
* @static
* @param {number} value
* @param {number} value2
* @returns {number}
* @memberof Verify
*/
public
static
compareDate
(
value
:
number
,
value2
:
number
):
number
{
if
(
value
>
value2
)
{
return
1
;
}
else
if
(
value
<
value2
)
{
return
-
1
;
}
else
{
return
0
;
}
}
/**
* 是否是时间
*
* @static
* @param {string} value
* @returns {boolean}
* @memberof Verify
*/
public
static
isParseDate
(
value
:
string
):
boolean
{
const
time
=
new
Date
(
value
);
if
(
isNaN
(
time
.
getTime
()))
{
return
false
;
}
return
true
;
}
/**
* 数值比较
*
* @static
* @param {number} value
* @param {number} value2
* @returns {number}
* @memberof Verify
*/
public
static
compareNumber
(
value
:
number
,
value2
:
number
):
number
{
if
(
isNaN
(
value
))
{
value
=
0
;
}
if
(
isNaN
(
value2
))
{
value2
=
0
;
}
if
(
value
>
value2
)
{
return
1
;
}
else
if
(
value
<
value2
)
{
return
-
1
;
}
else
{
return
0
;
}
}
/**
* 文本包含
*
* @static
* @param {*} value
* @param {*} value2
* @returns {boolean}
* @memberof Verify
*/
public
static
contains
(
value
:
any
,
value2
:
any
):
boolean
{
if
(
value
&&
value2
)
{
// 定义一数组
let
arr
=
new
Array
();
arr
=
value2
.
split
(
','
);
// 定义正则表达式的连接符
const
S
=
String
.
fromCharCode
(
2
);
const
reg
=
new
RegExp
(
S
+
value
+
S
);
return
reg
.
test
(
S
+
arr
.
join
(
S
)
+
S
);
}
return
false
;
}
/**
* 比较值
*
* @static
* @param {*} value
* @param {*} op
* @param {*} value2
* @returns {boolean}
* @memberof Verify
*/
public
static
testCond
(
value
:
any
,
op
:
any
,
value2
:
any
):
boolean
{
// 等于操作
if
(
Object
.
is
(
op
,
'EQ'
))
{
const
_value
=
`
${
value
}
`
;
return
_value
===
value2
;
}
// 大于操作
if
(
Object
.
is
(
op
,
'GT'
))
{
const
result
:
number
=
this
.
compare
(
value
,
value2
);
if
(
result
!==
undefined
&&
result
>
0
)
{
return
true
;
}
else
{
return
false
;
}
}
// 大于等于操作
if
(
Object
.
is
(
op
,
'GTANDEQ'
))
{
const
result
:
number
=
this
.
compare
(
value
,
value2
);
if
(
result
!==
undefined
&&
result
>=
0
)
{
return
true
;
}
else
{
return
false
;
}
}
// 值包含在给定的范围中
if
(
Object
.
is
(
op
,
'IN'
))
{
return
this
.
contains
(
value
,
value2
);
}
// 不为空判断操作
if
(
Object
.
is
(
op
,
'ISNOTNULL'
))
{
return
value
!=
null
&&
value
!==
''
;
}
// 为空判断操作
if
(
Object
.
is
(
op
,
'ISNULL'
))
{
return
value
==
null
||
value
===
''
;
}
// 文本左包含
if
(
Object
.
is
(
op
,
'LEFTLIKE'
))
{
return
value
&&
value2
&&
value
.
toUpperCase
().
indexOf
(
value2
.
toUpperCase
())
===
0
;
}
// 文本包含
if
(
Object
.
is
(
op
,
'LIKE'
))
{
return
value
&&
value2
&&
value
.
toUpperCase
().
indexOf
(
value2
.
toUpperCase
())
!==
-
1
;
}
// 小于操作
if
(
Object
.
is
(
op
,
'LT'
))
{
const
result
:
number
=
this
.
compare
(
value
,
value2
);
if
(
result
!==
undefined
&&
result
<
0
)
{
return
true
;
}
else
{
return
false
;
}
}
// 小于等于操作
if
(
Object
.
is
(
op
,
'LTANDEQ'
))
{
const
result
:
number
=
this
.
compare
(
value
,
value2
);
if
(
result
!==
undefined
&&
result
<=
0
)
{
return
true
;
}
else
{
return
false
;
}
}
// 不等于操作
if
(
Object
.
is
(
op
,
'NOTEQ'
))
{
const
_value
=
`
${
value
}
`
;
return
_value
!==
value2
;
}
// 值不包含在给定的范围中
if
(
Object
.
is
(
op
,
'NOTIN'
))
{
return
!
this
.
contains
(
value
,
value2
);
}
// 文本右包含
if
(
Object
.
is
(
op
,
'RIGHTLIKE'
))
{
if
(
!
(
value
&&
value2
))
{
return
false
;
}
const
nPos
=
value
.
toUpperCase
().
indexOf
(
value2
.
toUpperCase
());
if
(
nPos
===
-
1
)
{
return
false
;
}
return
nPos
+
value2
.
length
===
value
.
length
;
}
// 空判断
if
(
Object
.
is
(
op
,
'TESTNULL'
))
{
}
// 自定义包含
if
(
Object
.
is
(
op
,
'USERLIKE'
))
{
}
return
false
;
}
/**
* 检查属性常规条件
*
* @static
* @param {*} value 属性值
* @param {string} op 检测条件
* @param {*} value2 预定义值
* @param {string} errorInfo 错误信息
* @param {string} paramType 参数类型
* @param {*} form 表单对象
* @param {boolean} primaryModel 是否必须条件
* @returns {boolean}
* @memberof Verify
*/
public
static
checkFieldSimpleRule
(
value
:
any
,
op
:
string
,
value2
:
any
,
errorInfo
:
string
,
paramType
:
string
,
form
:
any
,
primaryModel
:
boolean
):
boolean
{
if
(
Object
.
is
(
paramType
,
'CURTIME'
))
{
value2
=
`
${
new
Date
()}
`
;
}
if
(
Object
.
is
(
paramType
,
'ENTITYFIELD'
))
{
value2
=
value2
?
value2
.
toLowerCase
()
:
''
;
const
_value2Field
=
form
[
value2
]
?
form
[
value2
]
:
value2
;
value2
=
_value2Field
;
}
if
(
isEmpty
(
errorInfo
))
{
errorInfo
=
'内容必须符合值规则'
;
}
this
.
errorInfo
=
errorInfo
;
const
result
=
this
.
testCond
(
value
,
op
,
value2
);
if
(
!
result
)
{
if
(
primaryModel
)
{
// throw new Error(this.errorInfo);
}
}
return
!
result
;
}
/**
* 检查属性字符长度规则
*
* @static
* @param {*} viewValue
* @param {number} minLength
* @param {boolean} indexOfMin
* @param {number} maxLength
* @param {boolean} indexOfMax
* @param {string} errorInfo
* @param {boolean} primaryModel
* @returns {boolean}
* @memberof Verify
*/
public
static
checkFieldStringLengthRule
(
viewValue
:
string
,
minLength
:
number
,
indexOfMin
:
boolean
,
maxLength
:
number
,
indexOfMax
:
boolean
,
errorInfo
:
string
,
primaryModel
:
boolean
):
boolean
{
if
(
isEmpty
(
errorInfo
))
{
this
.
errorInfo
=
'内容长度必须符合范围规则'
;
}
else
{
this
.
errorInfo
=
errorInfo
;
}
const
_isEmpty
=
isEmpty
(
viewValue
);
if
(
_isEmpty
)
{
if
(
primaryModel
)
{
throw
new
Error
(
'值为空'
);
}
this
.
errorInfo
=
'值为空'
;
return
true
;
}
const
viewValueLength
:
number
=
viewValue
.
length
;
// 小于等于
if
(
minLength
!==
null
)
{
if
(
indexOfMin
)
{
if
(
viewValueLength
<
minLength
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
else
{
if
(
viewValueLength
<=
minLength
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
}
// 大于等于
if
(
maxLength
!==
null
)
{
if
(
indexOfMax
)
{
if
(
viewValueLength
>
maxLength
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
else
{
if
(
viewValueLength
>=
maxLength
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
}
this
.
errorInfo
=
''
;
return
false
;
}
/**
* 检查属性值正则式规则
*
* @static
* @param {string} viewValue 属性值
* @param {*} strReg 验证正则
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Verify
*/
public
static
checkFieldRegExRule
(
viewValue
:
string
,
strReg
:
any
,
errorInfo
:
string
,
primaryModel
:
boolean
):
boolean
{
if
(
isEmpty
(
errorInfo
))
{
this
.
errorInfo
=
'值必须符合正则规则'
;
}
else
{
this
.
errorInfo
=
errorInfo
;
}
const
_isEmpty
=
isEmpty
(
viewValue
);
if
(
_isEmpty
)
{
if
(
primaryModel
)
{
throw
new
Error
(
'值为空'
);
}
this
.
errorInfo
=
'值为空'
;
return
true
;
}
const
regExp
=
new
RegExp
(
strReg
);
if
(
!
regExp
.
test
(
viewValue
))
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
this
.
errorInfo
=
''
;
return
false
;
}
/**
* 检查脚本值规则
*
* @static
* @param {string} value 属性值
* @param {*} data 数据对象
* @param {*} scriptCode 脚本内容
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Verify
*/
public
static
checkFieldScriptRule
(
value
:
string
,
data
:
any
,
scriptCode
:
any
,
errorInfo
:
string
,
primaryModel
:
boolean
):
{
isPast
:
boolean
,
infoMessage
:
string
}
{
if
(
isEmpty
(
errorInfo
))
{
this
.
errorInfo
=
'值必须符合脚本规则'
;
}
else
{
this
.
errorInfo
=
errorInfo
;
}
// 脚本准备参数
let
source
=
data
;
let
selfError
=
''
;
let
resultBoolean
:
boolean
=
true
;
// 脚本回调
let
callback
=
(
error
:
any
)
=>
{
resultBoolean
=
false
;
// 脚本回调多个错误信息
if
(
error
?.
length
>
0
)
{
error
.
forEach
((
item
:
any
)
=>
{
if
(
item
?.
message
)
{
selfError
+=
item
.
message
;
}
})
// 脚本回调单个错误信息
}
else
if
(
error
?.
message
)
{
selfError
=
error
.
message
;
}
}
try
{
// 避免脚本内变量冲突
let
runScript
=
()
=>
eval
(
scriptCode
)
runScript
();
}
catch
(
error
)
{
console
.
error
(
error
);
}
this
.
errorInfo
=
''
;
if
(
!
resultBoolean
&&
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
{
isPast
:
resultBoolean
,
infoMessage
:
selfError
||
errorInfo
};
}
/**
* 检查属性值范围规则
*
* @static
* @param {string} viewValue 属性值
* @param {*} minNumber 最小数值
* @param {boolean} indexOfMin 是否包含最小数值
* @param {*} maxNumber 最大数值
* @param {boolean} indexOfMax 是否包含最大数值
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Verify
*/
public
static
checkFieldValueRangeRule
(
viewValue
:
string
,
minNumber
:
any
,
indexOfMin
:
boolean
,
maxNumber
:
any
,
indexOfMax
:
boolean
,
errorInfo
:
string
,
primaryModel
:
boolean
):
boolean
{
if
(
isEmpty
(
errorInfo
))
{
this
.
errorInfo
=
'值必须符合值范围规则'
;
}
else
{
this
.
errorInfo
=
errorInfo
;
}
const
_isEmpty
=
isEmpty
(
viewValue
);
if
(
_isEmpty
)
{
if
(
primaryModel
)
{
throw
new
Error
(
'值为空'
);
}
this
.
errorInfo
=
'值为空'
;
return
true
;
}
const
valueFormat
=
this
.
checkFieldRegExRule
(
viewValue
,
/^-
?\d
*
\.?\d
+$/
,
''
,
primaryModel
);
if
(
valueFormat
)
{
return
true
;
}
else
{
this
.
errorInfo
=
errorInfo
;
}
const
data
=
Number
.
parseFloat
(
viewValue
);
// 小于等于
if
(
minNumber
!==
null
)
{
if
(
indexOfMin
)
{
if
(
data
<
minNumber
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
else
{
if
(
data
<=
minNumber
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
}
// //大于等于
if
(
maxNumber
!=
null
)
{
if
(
indexOfMax
)
{
if
(
data
>
maxNumber
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
else
{
if
(
data
>=
maxNumber
)
{
if
(
primaryModel
)
{
throw
new
Error
(
this
.
errorInfo
);
}
return
true
;
}
}
}
this
.
errorInfo
=
''
;
return
false
;
}
/**
* 检查属性值系统值范围规则 暂时支持正则表达式
*
* @static
* @param {string} viewValue 属性值
* @param {*} strReg 正则
* @param {string} errorInfo 错误信息
* @param {boolean} primaryModel 是否关键条件
* @returns {boolean}
* @memberof Verify
*/
public
static
checkFieldSysValueRule
(
viewValue
:
string
,
strReg
:
any
,
errorInfo
:
string
,
primaryModel
:
boolean
):
boolean
{
return
this
.
checkFieldRegExRule
(
viewValue
,
strReg
,
errorInfo
,
primaryModel
);
}
/**
* 遍历数据并进行逻辑判断,支持&&和||,支持短路
*
* @param {any[]} array 数组
* @param {Function} callback 回调函数
* @param {string} [operateTag='AND'] 与或操作标识,支持AND、OR
* @param {boolean} [isReverse=false] 是否取反
* @returns {boolean}
* @memberof Verify
*/
public
static
logicForEach
(
array
:
any
[],
callback
:
(
item
:
any
,
index
:
number
)
=>
boolean
,
operateTag
:
string
=
'AND'
,
isReverse
:
boolean
=
false
):
boolean
{
if
(
!
(
array
?.
length
>
0
))
{
return
false
;
}
let
result
:
boolean
=
operateTag
==
'AND'
;
for
(
let
i
=
0
,
len
=
array
.
length
;
i
<
len
;
i
++
)
{
let
temp
=
callback
(
array
[
i
],
i
);
if
(
operateTag
==
'AND'
)
{
if
(
!
temp
)
{
result
=
false
;
break
;
}
}
else
if
(
operateTag
==
'OR'
)
{
if
(
temp
)
{
result
=
true
;
break
;
}
}
}
return
isReverse
?
!
result
:
result
;
}
/**
* 校验属性值规则
*
* @param {string} name 校验属性值所在字段的名称
* @param {*} data 数据对象
* @param {*} condition 规则条件
* @returns {{ isPast: boolean, infoMessage: string }}
* @memberof Verify
*/
public
static
verifyDeRules
(
name
:
string
,
data
:
any
,
condition
:
any
):
{
isPast
:
boolean
;
infoMessage
:
string
}
{
let
flag
=
{
isPast
:
true
,
infoMessage
:
condition
.
ruleInfo
};
if
(
condition
.
condType
==
'GROUP'
)
{
let
childRules
=
condition
.
conditions
;
if
(
childRules
?.
length
>
0
)
{
flag
.
isPast
=
this
.
logicForEach
(
childRules
,
(
item
:
any
)
=>
{
const
{
isPast
,
infoMessage
}
=
this
.
verifyDeRules
(
name
,
data
,
item
);
// 每次都把分组的结果信息改为该条件的信息,短路后是最后一个条件的信息
flag
.
infoMessage
=
infoMessage
;
return
isPast
;
},
condition
.
condOp
,
!!
condition
.
notMode
,
);
// 分组结果为false时,如果是AND分组且取反,或是OR分组未取反,提示分组信息
if
(
!
flag
.
isPast
&&
((
condition
.
condOp
==
'AND'
&&
condition
.
notMode
)
||
(
condition
.
condOp
==
'OR'
&&
!
condition
.
notMode
)))
{
flag
.
infoMessage
=
condition
.
ruleInfo
;
}
}
}
else
{
try
{
// 常规规则
if
(
condition
.
condType
==
'SIMPLE'
)
{
flag
.
isPast
=
!
Verify
.
checkFieldSimpleRule
(
data
[
name
],
condition
.
condOp
,
condition
.
paramValue
,
condition
.
ruleInfo
,
condition
.
paramType
,
data
,
condition
.
keyCond
);
// 数值范围
}
else
if
(
condition
.
condType
==
'VALUERANGE2'
)
{
flag
.
isPast
=
!
Verify
.
checkFieldValueRangeRule
(
data
[
name
],
condition
.
minValue
,
condition
.
includeMinValue
,
condition
.
maxValue
,
condition
.
includeMaxValue
,
condition
.
ruleInfo
,
condition
.
keyCond
);
// 正则式
}
else
if
(
condition
.
condType
==
'REGEX'
)
{
flag
.
isPast
=
!
Verify
.
checkFieldRegExRule
(
data
[
name
],
condition
.
regExCode
,
condition
.
ruleInfo
,
condition
.
keyCond
);
// 长度
}
else
if
(
condition
.
condType
==
'STRINGLENGTH'
)
{
flag
.
isPast
=
!
Verify
.
checkFieldStringLengthRule
(
data
[
name
],
condition
.
minValue
,
condition
.
includeMinValue
,
condition
.
maxValue
,
condition
.
includeMaxValue
,
condition
.
ruleInfo
,
condition
.
keyCond
);
// 系统值规则
}
else
if
(
condition
.
condType
==
'SYSVALUERULE'
&&
condition
.
sysValueRule
)
{
const
{
ruleType
,
regExCode
,
scriptCode
,
ruleInfo
}
=
condition
.
sysValueRule
;
flag
.
infoMessage
=
condition
.
ruleInfo
||
ruleInfo
;
if
(
ruleType
==
'REG'
)
{
flag
.
isPast
=
!
Verify
.
checkFieldRegExRule
(
data
[
name
],
regExCode
,
flag
.
infoMessage
,
condition
.
keyCond
);
}
else
if
(
ruleType
==
'SCRIPT'
)
{
const
{
isPast
,
infoMessage
}
=
Verify
.
checkFieldScriptRule
(
data
[
name
],
data
,
scriptCode
,
flag
.
infoMessage
,
condition
.
keyCond
);
flag
.
isPast
=
isPast
;
flag
.
infoMessage
=
infoMessage
||
flag
.
infoMessage
;
}
}
}
catch
(
error
)
{
flag
.
isPast
=
false
;
}
// 取反
flag
.
isPast
=
condition
.
notMode
?
!
flag
.
isPast
:
flag
.
isPast
;
}
return
flag
;
}
/**
* 构建校验条件
*
* @param {*} model 模型数据
*
* @memberof Verify
*/
public
static
buildVerConditions
(
model
:
any
)
{
if
(
!
model
){
return
[];
}
let
isNumber
:
boolean
=
(
model
?.
editorType
===
"NUMBER"
)
?
true
:
false
;
let
rules
:
Array
<
any
>
=
[];
// 构建值的type,最大值,最小值,最大长度,最小长度
if
(
isNumber
)
{
if
(
model
.
maxValue
)
{
rules
.
push
({
type
:
'number'
,
max
:
model
.
maxValue
,
message
:
`内容最大值必须为
${
model
.
maxValue
}
`
});
}
if
(
model
.
minValue
)
{
rules
.
push
({
type
:
'number'
,
min
:
model
.
minValue
,
message
:
`内容最小值必须为
${
model
.
minValue
}
`
});
}
}
else
{
if
(
model
.
M
.
showMaxLength
)
{
if
(
model
.
maxLength
)
{
rules
.
push
({
validator
:
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
const
length
=
isExistAndNotEmpty
(
value
)
?
value
.
length
:
0
;
if
(
length
>
model
.
maxLength
)
{
callback
(
new
Error
(
`内容最大长度必须为
${
model
.
maxLength
}
,当前长度为
${
value
.
length
}
`
));
}
else
{
callback
();
}
}});
}
}
if
(
model
.
minLength
)
{
rules
.
push
({
type
:
'string'
,
min
:
model
.
minLength
,
message
:
`内容最小长度必须为
${
model
.
minLength
}
`
});
}
}
// 构建正则
if
(
model
.
getPSSysValueRule
&&
model
.
getPSSysValueRule
.
ruleType
&&
Object
.
is
(
model
.
getPSSysValueRule
.
ruleType
,
"REG"
))
{
rules
.
push
({
type
:
isNumber
?
'number'
:
'string'
,
pattern
:
model
.
getPSSysValueRule
.
regExCode
,
message
:
`
${
model
.
getPSSysValueRule
.
ruleInfo
}
`
});
}
// 精度
// if (model.precision) {
// const validateData = (rule: any, value: any, callback: Function) => {
// let errorMessage;
// if (value && value.toString()) {
// let tempValue: string = value.toString();
// if (tempValue.indexOf(".") !== -1) {
// let len: number = tempValue.substring(tempValue.indexOf(".") + 1).length;
// if (len !== model.precision) {
// errorMessage = `内容精度必须为${model.precision}`;
// }
// } else {
// if (model.precision !== 0) {
// errorMessage = `内容精度必须为${model.precision}`;
// }
// }
// }
// callback(errorMessage);
// }
// rules.push(validateData);
// }
return
rules
;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/base/index.scss
浏览文件 @
6ccbdf3e
...
...
@@ -10,8 +10,8 @@ body{
// 滚动条样式
::-webkit-scrollbar
{
background
:
transparent
;
width
:
4
px
;
height
:
4
px
;
width
:
6
px
;
height
:
6
px
;
}
::-webkit-scrollbar-thumb
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/widgets/app-grid.scss
浏览文件 @
6ccbdf3e
...
...
@@ -15,4 +15,14 @@
&
:first-child
{
padding-left
:
0
;
}
}
.app-grid
{
.header-cell
{
display
:
flex
;
}
.not-data
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
浏览文件 @
6ccbdf3e
import { ControlVOBase, IParam, GridService } from '@core';
import { ControlVOBase, IParam, GridService
, isEmpty, Verify
} from '@core';
import {
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service } from '@api/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
-service';
export class ControlVO extends ControlVOBase {
...
...
@@ -22,6 +22,8 @@ export class ControlVO extends ControlVOBase {
export const ctrlState = {
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
totalColumnWidth:
{{
ctrl
.
totalColumnWidth
}}
,
selectColumnWidth:
{{#if
(
neq
ctrl
.
aggMode
'NONE'
)
}}
100
{{else}}
50
{{/if}}
,
appEntityCodeName: '
{{
ctrl
.
appEntity
.
codeName
}}
',
appDeCodeName:'
{{
ctrl
.
appEntity
.
codeName
}}
',
appDeKeyFieldName: '
{{#if
ctrl
.
appEntity
.
keyPSAppDEField
}}{{
ctrl
.
appEntity
.
keyPSAppDEField
.
codeName
}}{{/if}}
',
...
...
@@ -114,8 +116,27 @@ export const ctrlState = {
},
{{/if}}
{{/if}}
{{!-- 适配表格操作列浮动 --}}
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{#
unless
(
eq
column
.
columnType
'UAGRIDCOLUMN'
)
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"COLUMNMODEL"
item
=
column
}}
{{/
unless
}}
{{/
each
}}
{{#if
ctrl
.
needEmptyColumn
}}
{
title: "",
columnType: "EMPTYCOLUMN",
dataIndex: "autowidthcolumn",
align: "center",
resizable: true,
ellipsis: true,
aggMode: "NONE",
},
{{/if}}
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{#if
(
eq
column
.
columnType
'UAGRIDCOLUMN'
)
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"COLUMNMODEL"
item
=
column
}}
{{/if}}
{{/
each
}}
],
// 是否单选
...
...
@@ -160,16 +181,39 @@ export const ctrlState = {
{{/if}}
rules:{
{{#
each
ctrl
.
psDEGridEditItemVRs
as
|
ruleItem
|
}}
{{
ruleItem
.
psDEGridEditItemName
}}
: [
{{#if
(
eq
ruleItem
.
valueRuleType
'SYSVALUERULE'
)
}}
{{
ruleItem
.
psDEGridEditItemName
}}
: [
{
trigger: ['change', 'blur'],
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
{{/
eq
}}
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
}],
{
trigger: ['change', 'blur'],
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
{{/
eq
}}
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
},
{{else
if
(
eq
ruleItem
.
valueRuleType
'DEFVALUERULE'
)
}}
{{#
each
ctrl
.
psDEGridEditItems
as
|
editItem
|
}}
{{#
eq
editItem
.
codeName
ruleItem
.
psDEGridEditItemName
}}
{
validator: (rule: any, value: any, callback: any, source: any) => {
if (!source || isEmpty(source['
{{#if
editItem
.
valueItemName
}}{{
editItem
.
valueItemName
}}{{else}}{{
ruleItem
.
psDEGridEditItemName
}}{{/if}}
'])) {
return true;
}
const { isPast, infoMessage } = Verify.verifyDeRules(
'
{{#if
editItem
.
valueItemName
}}{{
editItem
.
valueItemName
}}{{else}}{{
ruleItem
.
psDEGridEditItemName
}}{{/if}}
',
source,
{{>
@macro
/
front-end
/
common
/
derules
.
hbs
item
=
ruleItem
.
psDEFValueRule
.
getPSDEFVRGroupCondition
}}
);
if (!isPast) {
callback(new Error(infoMessage || '
{{
ruleItem
.
psDEFValueRule
.
ruleInfo
}}
'));
}
return true;
},
trigger: ['change', 'blur']
}
{{/
eq
}}
{{/
each
}}
{{/if}}
],
{{/
each
}}
}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
浏览文件 @
6ccbdf3e
...
...
@@ -40,7 +40,7 @@ const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const
{
name
,
state
,
useCustom
,
onEditorEvent
,
onToolbarEvent
,
onActionColEvent
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
}
=
new
GridControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
useScrollOption
,
useRowKey
,
useRowClassName
,
useCustomRow
,
useRowSelectionOption
,
onResizeColumn
,
onGridChange
}
=
useCustom
;
const
{
useScrollOption
,
useRowKey
,
useRowClassName
,
useCustomRow
,
useRowSelectionOption
,
onResizeColumn
,
onGridChange
,
useExpandedRowKeys
,
onExpandedRowsChange
}
=
useCustom
;
{{#if
ctrl
.
batchToolBarItems
}}
const
renderBatchToolbar
=
(
total
:
number
,
range
:
IParam
[])
=>
{
return
(
...
...
@@ -73,6 +73,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
:sortDirections=
"['ascend', 'descend']"
:data-source=
"state.items"
:row-selection=
"useRowSelectionOption"
:expandedRowKeys=
"useExpandedRowKeys"
:columns=
"state.columnsModel"
{{#if
ctrl
.
batchToolBarItems
}}
:pagination=
"Object.assign(state.mdCtrlPaging.pagination, {
...
...
@@ -86,6 +87,7 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
:customRow=
"useCustomRow"
:rowClassName=
"useRowClassName"
@
change=
"onGridChange"
@
expandedRowsChange=
"onExpandedRowsChange"
@
resizeColumn=
"onResizeColumn"
>
<template
#
emptyText
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录