Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
03de3d9e
提交
03de3d9e
编写于
1月 23, 2022
作者:
zhangkang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:表格值规则
上级
64779705
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
125 行增加
和
58 行删除
+125
-58
grid-column.hbs
...l/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
+6
-0
package.json
...ore/src/main/resources/templ/r7/app_{{apps}}/package.json
+1
-0
grid-control-state.ts
...c/core/modules/widgets/grid-control/grid-control-state.ts
+8
-0
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+35
-6
{{ctrls@GRID}}-grid-state.ts.hbs
...es}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
+21
-0
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+54
-52
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
浏览文件 @
03de3d9e
...
...
@@ -9,11 +9,17 @@
{{#if
(
eq
item
.
columnType
'DEFGRIDCOLUMN'
)
}}
{{#if
item
.
enableRowEdit
}}
<div
v-if=
"state.rowEditState"
class=
"editor-cell"
>
<AppFormItem
name=
"state"
:error=
"state.gridEditState.state?.[index]?.message"
:rules=
"state.rules.state"
>
{{#
each
ctrl
.
psDEGridEditItems
as
|
editColumn
|
}}
{{#if
(
eq
editColumn
.
codeName
item
.
codeName
)
}}
{{>
(
lookup
.
'editColumn.psEditor.editorType'
)
item
=
editColumn
ctrlType
=
"grid"
}}
{{/if}}
{{/
each
}}
</AppFormItem>
</div>
<div
v-else
class=
"text-cell"
>
<span
class=
"text"
>
\{{text}}
</span>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/package.json
浏览文件 @
03de3d9e
...
...
@@ -25,6 +25,7 @@
"vue"
:
"^3.2.23"
,
"vue-global-api"
:
"^0.4.1"
,
"vue-router"
:
"^4.0.12"
,
"async-validator"
:
"^3.3.0"
,
"moment"
:
"2.24.0"
},
"devDependencies"
:
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control-state.ts
浏览文件 @
03de3d9e
...
...
@@ -29,6 +29,14 @@ export interface GridControlState extends MDControlState {
*/
rules
:
IParam
;
/**
* 表格编辑状态
*
* @type {IParam[]}
* @memberof GridControlState
*/
gridEditState
:
any
;
/**
* @description 表格聚合
* @type {IParam}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
03de3d9e
import
{
deepCopy
,
GridControlState
,
IActionParam
,
IParam
,
MDControl
}
from
"@core"
;
import
{
createUUID
}
from
"qx-util"
;
import
schema
,
{
ErrorList
,
FieldErrorList
}
from
'async-validator'
;
/**
* @description 表格部件
* @export
...
...
@@ -73,7 +73,7 @@ export class GridControl extends MDControl {
return
false
;
}
return
{
type
:
isSingleSelect
?
'radio'
:
'checkbox'
,
type
:
isSingleSelect
?
'radio'
:
'checkbox'
,
columnWidth
:
90
,
selectedRowKeys
:
selectedRowKeys
.
value
,
checkStrictly
:
this
.
props
.
multiple
?
false
:
true
,
...
...
@@ -125,6 +125,7 @@ export class GridControl extends MDControl {
if
(
items
.
value
[
rowIndex
][
tag
]
!==
data
)
{
items
.
value
[
rowIndex
][
tag
]
=
data
;
items
.
value
[
rowIndex
][
"rowDataState"
]
=
"update"
;
this
.
validateField
(
tag
,
data
,
rowIndex
);
}
break
;
default
:
...
...
@@ -132,6 +133,32 @@ export class GridControl extends MDControl {
}
}
/**
*
*
* @param {string} name
* @param {*} value
* @memberof GridControl
*/
public
validateField
(
name
:
string
,
value
:
any
,
rowIndex
:
number
):
Promise
<
boolean
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
{
rules
,
gridEditState
}
=
toRefs
(
this
.
state
);
const
fileRule
=
rules
.
value
[
name
];
if
(
!
fileRule
)
{
resolve
(
true
);
return
;
}
const
validator
=
new
schema
({
[
name
]:
fileRule
});
validator
.
validate
({
[
name
]:
value
},
undefined
,
(
errors
:
ErrorList
,
fields
:
FieldErrorList
)
=>
{
const
error
=
errors
?.
find
((
item
:
any
)
=>
{
return
item
.
field
===
name
;
})
gridEditState
.
value
[
name
][
rowIndex
]
=
error
;
})
})
}
/**
* @description 操作列事件触发
* @param {IActionParam} action
...
...
@@ -139,7 +166,7 @@ export class GridControl extends MDControl {
* @memberof GridControl
*/
public
onToolbarEvent
(
action
:
IActionParam
,
record
:
IParam
)
{
//todo 界面行为
//todo 界面行为
}
/**
...
...
@@ -201,7 +228,7 @@ export class GridControl extends MDControl {
/**
* @description 处理数据聚合
*
*
* @memberof GridControl
*/
public
async
handleDataAgg
()
{
...
...
@@ -246,7 +273,7 @@ export class GridControl extends MDControl {
/**
* @description 远程聚合
*
*
* @memberof GridControl
*/
public
async
remoteAgg
():
Promise
<
IParam
[]
>
{
...
...
@@ -258,7 +285,7 @@ export class GridControl extends MDControl {
/**
* @description 获取聚合值
*
*
* @param {IParam[]} aggData 聚合数据
* @param {string} column 列模型
* @memberof GridControl
...
...
@@ -440,6 +467,8 @@ export class GridControl extends MDControl {
*/
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
console
.
log
(
this
.
state
);
return
{
...
superParams
,
useCustom
:
this
.
useCustom
(),
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
浏览文件 @
03de3d9e
...
...
@@ -70,6 +70,13 @@ export const ctrlState = {
{{>
(
lookup
'UACOLUMNMODEL'
)
item
=
column
}}
{{/
each
}}
],
gridEditState:{
{{#
each
ctrl
.
psDEGridEditItems
as
|
column
|
}}
{{#if
column
.
codeName
}}
{{
column
.
codeName
}}
:{},
{{/if}}
{{/
each
}}
},
columnsModel: [
{{#if
ctrl
.
enableGroup
}}
{{#if
ctrl
.
groupPSAppDEField
}}
...
...
@@ -90,4 +97,18 @@ export const ctrlState = {
],
// 是否单选
isSingleSelect:
{{#if
ctrl
.
singleSelect
}}{{
ctrl
.
singleSelect
}}{{else}}
false
{{/if}}
,
rules:{
{{#
each
ctrl
.
psDEGridEditItemVRs
as
|
ruleItem
|
}}
{{#if
ruleItem
.
valueRuleType
'SYSVALUERULE'
}}
{{
ruleItem
.
psDEGridEditItemName
}}
: [
{
trigger: ['change', 'blur'],
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
{{/
eq
}}
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
}],
{{/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
浏览文件 @
03de3d9e
...
...
@@ -43,58 +43,60 @@ const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelecti
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
});
</script>
<template>
<a-table
bordered
sticky
class=
"app-grid
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
:rowKey=
"useRowKey"
:showHeader=
"true"
:scroll=
"useScrollOption"
:sortDirections=
"['ascend', 'descend']"
:data-source=
"state.items"
:row-selection=
"useRowSelectionOption"
:columns=
"state.columnsModel"
:pagination=
"state.mdCtrlPaging.pagination"
:customRow=
"useCustomRow"
:rowClassName=
"useRowClassName"
@
change=
"onGridChange"
@
resizeColumn=
"onResizeColumn"
>
<template
#
emptyText
>
<div
class=
"not-data"
>
<span
class=
"empty-text"
>
{{#if
ctrl
.
emptyText
}}
{{
ctrl
.
emptyText
}}
{{else}}
无数据
{{/if}}
</span>
{{!-- 快速工具栏 --}}
</div>
</template>
<template
#
headerCell=
"{title, column}"
>
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{>
(
lookup
'COLUMNHEADER'
)
item
=
column
ctrl
=
ctrl
}}
{{/
each
}}
</template>
<template
#
bodyCell=
"{ column, text, record, index }"
>
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{>
(
lookup
'COLUMN'
)
item
=
column
ctrl
=
ctrl
}}
{{/
each
}}
</template>
{{#
neq
ctrl
.
aggMode
'NONE'
}}
<template
#
summary
>
<a-table-summary>
<a-table-summary-row>
<a-table-summary-cell
align=
"center"
>
数据聚合
</a-table-summary-cell>
<a-table-summary-cell
v-for=
"(item, index) in state.gridAgg.aggData"
:key=
"index"
>
<span>
\{{item}}
</span>
</a-table-summary-cell>
</a-table-summary-row>
</a-table-summary>
</template>
{{/
neq
}}
</a-table>
<a-form
name=
"
{{
ctrl
.
name
}}
"
class=
"app-grid-form"
>
<a-table
bordered
sticky
class=
"app-grid
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
:rowKey=
"useRowKey"
:showHeader=
"true"
:scroll=
"useScrollOption"
:sortDirections=
"['ascend', 'descend']"
:data-source=
"state.items"
:row-selection=
"useRowSelectionOption"
:columns=
"state.columnsModel"
:pagination=
"state.mdCtrlPaging.pagination"
:customRow=
"useCustomRow"
:rowClassName=
"useRowClassName"
@
change=
"onGridChange"
@
resizeColumn=
"onResizeColumn"
>
<template
#
emptyText
>
<div
class=
"not-data"
>
<span
class=
"empty-text"
>
{{#if
ctrl
.
emptyText
}}
{{
ctrl
.
emptyText
}}
{{else}}
无数据
{{/if}}
</span>
{{!-- 快速工具栏 --}}
</div>
</template>
<template
#
headerCell=
"{title, column}"
>
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{>
(
lookup
'COLUMNHEADER'
)
item
=
column
ctrl
=
ctrl
}}
{{/
each
}}
</template>
<template
#
bodyCell=
"{ column, text, record, index }"
>
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{>
(
lookup
'COLUMN'
)
item
=
column
ctrl
=
ctrl
}}
{{/
each
}}
</template>
{{#
neq
ctrl
.
aggMode
'NONE'
}}
<template
#
summary
>
<a-table-summary>
<a-table-summary-row>
<a-table-summary-cell
align=
"center"
>
数据聚合
</a-table-summary-cell>
<a-table-summary-cell
v-for=
"(item, index) in state.gridAgg.aggData"
:key=
"index"
>
<span>
\{{item}}
</span>
</a-table-summary-cell>
</a-table-summary-row>
</a-table-summary>
</template>
{{/
neq
}}
</a-table>
</a-form>
</template>
<style
lang=
"scss"
>
.app-grid
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录