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 @@
...
@@ -9,11 +9,17 @@
{{#if
(
eq
item
.
columnType
'DEFGRIDCOLUMN'
)
}}
{{#if
(
eq
item
.
columnType
'DEFGRIDCOLUMN'
)
}}
{{#if
item
.
enableRowEdit
}}
{{#if
item
.
enableRowEdit
}}
<div
v-if=
"state.rowEditState"
class=
"editor-cell"
>
<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
|
}}
{{#
each
ctrl
.
psDEGridEditItems
as
|
editColumn
|
}}
{{#if
(
eq
editColumn
.
codeName
item
.
codeName
)
}}
{{#if
(
eq
editColumn
.
codeName
item
.
codeName
)
}}
{{>
(
lookup
.
'editColumn.psEditor.editorType'
)
item
=
editColumn
ctrlType
=
"grid"
}}
{{>
(
lookup
.
'editColumn.psEditor.editorType'
)
item
=
editColumn
ctrlType
=
"grid"
}}
{{/if}}
{{/if}}
{{/
each
}}
{{/
each
}}
</AppFormItem>
</div>
</div>
<div
v-else
class=
"text-cell"
>
<div
v-else
class=
"text-cell"
>
<span
class=
"text"
>
\{{text}}
</span>
<span
class=
"text"
>
\{{text}}
</span>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/package.json
浏览文件 @
03de3d9e
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
"vue"
:
"^3.2.23"
,
"vue"
:
"^3.2.23"
,
"vue-global-api"
:
"^0.4.1"
,
"vue-global-api"
:
"^0.4.1"
,
"vue-router"
:
"^4.0.12"
,
"vue-router"
:
"^4.0.12"
,
"async-validator"
:
"^3.3.0"
,
"moment"
:
"2.24.0"
"moment"
:
"2.24.0"
},
},
"devDependencies"
:
{
"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 {
...
@@ -29,6 +29,14 @@ export interface GridControlState extends MDControlState {
*/
*/
rules
:
IParam
;
rules
:
IParam
;
/**
* 表格编辑状态
*
* @type {IParam[]}
* @memberof GridControlState
*/
gridEditState
:
any
;
/**
/**
* @description 表格聚合
* @description 表格聚合
* @type {IParam}
* @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
{
deepCopy
,
GridControlState
,
IActionParam
,
IParam
,
MDControl
}
from
"@core"
;
import
{
createUUID
}
from
"qx-util"
;
import
{
createUUID
}
from
"qx-util"
;
import
schema
,
{
ErrorList
,
FieldErrorList
}
from
'async-validator'
;
/**
/**
* @description 表格部件
* @description 表格部件
* @export
* @export
...
@@ -73,7 +73,7 @@ export class GridControl extends MDControl {
...
@@ -73,7 +73,7 @@ export class GridControl extends MDControl {
return
false
;
return
false
;
}
}
return
{
return
{
type
:
isSingleSelect
?
'radio'
:
'checkbox'
,
type
:
isSingleSelect
?
'radio'
:
'checkbox'
,
columnWidth
:
90
,
columnWidth
:
90
,
selectedRowKeys
:
selectedRowKeys
.
value
,
selectedRowKeys
:
selectedRowKeys
.
value
,
checkStrictly
:
this
.
props
.
multiple
?
false
:
true
,
checkStrictly
:
this
.
props
.
multiple
?
false
:
true
,
...
@@ -125,6 +125,7 @@ export class GridControl extends MDControl {
...
@@ -125,6 +125,7 @@ export class GridControl extends MDControl {
if
(
items
.
value
[
rowIndex
][
tag
]
!==
data
)
{
if
(
items
.
value
[
rowIndex
][
tag
]
!==
data
)
{
items
.
value
[
rowIndex
][
tag
]
=
data
;
items
.
value
[
rowIndex
][
tag
]
=
data
;
items
.
value
[
rowIndex
][
"rowDataState"
]
=
"update"
;
items
.
value
[
rowIndex
][
"rowDataState"
]
=
"update"
;
this
.
validateField
(
tag
,
data
,
rowIndex
);
}
}
break
;
break
;
default
:
default
:
...
@@ -132,6 +133,32 @@ export class GridControl extends MDControl {
...
@@ -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 操作列事件触发
* @description 操作列事件触发
* @param {IActionParam} action
* @param {IActionParam} action
...
@@ -440,6 +467,8 @@ export class GridControl extends MDControl {
...
@@ -440,6 +467,8 @@ export class GridControl extends MDControl {
*/
*/
public
moduleInstall
()
{
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
const
superParams
=
super
.
moduleInstall
();
console
.
log
(
this
.
state
);
return
{
return
{
...
superParams
,
...
superParams
,
useCustom
:
this
.
useCustom
(),
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 = {
...
@@ -70,6 +70,13 @@ export const ctrlState = {
{{>
(
lookup
'UACOLUMNMODEL'
)
item
=
column
}}
{{>
(
lookup
'UACOLUMNMODEL'
)
item
=
column
}}
{{/
each
}}
{{/
each
}}
],
],
gridEditState:{
{{#
each
ctrl
.
psDEGridEditItems
as
|
column
|
}}
{{#if
column
.
codeName
}}
{{
column
.
codeName
}}
:{},
{{/if}}
{{/
each
}}
},
columnsModel: [
columnsModel: [
{{#if
ctrl
.
enableGroup
}}
{{#if
ctrl
.
enableGroup
}}
{{#if
ctrl
.
groupPSAppDEField
}}
{{#if
ctrl
.
groupPSAppDEField
}}
...
@@ -90,4 +97,18 @@ export const ctrlState = {
...
@@ -90,4 +97,18 @@ export const ctrlState = {
],
],
// 是否单选
// 是否单选
isSingleSelect:
{{#if
ctrl
.
singleSelect
}}{{
ctrl
.
singleSelect
}}{{else}}
false
{{/if}}
,
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,6 +43,7 @@ const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelecti
...
@@ -43,6 +43,7 @@ const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelecti
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
});
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
});
</script>
</script>
<template>
<template>
<a-form
name=
"
{{
ctrl
.
name
}}
"
class=
"app-grid-form"
>
<a-table
<a-table
bordered
bordered
sticky
sticky
...
@@ -95,6 +96,7 @@ defineExpose({ state, name: '{{ctrl.name}}', newRow, remove, save, load, refresh
...
@@ -95,6 +96,7 @@ defineExpose({ state, name: '{{ctrl.name}}', newRow, remove, save, load, refresh
</template>
</template>
{{/
neq
}}
{{/
neq
}}
</a-table>
</a-table>
</a-form>
</template>
</template>
<style
lang=
"scss"
>
<style
lang=
"scss"
>
.app-grid
{
.app-grid
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录