Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
8092ea74
提交
8092ea74
编写于
2月 09, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新表格部件
支持代码表分组 操作列呈现
上级
0e89d33b
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
111 行增加
和
87 行删除
+111
-87
grid-column-header.hbs
...acro/front-end/widgets/grid-detail/grid-column-header.hbs
+1
-1
grid-column-model.hbs
...macro/front-end/widgets/grid-detail/grid-column-model.hbs
+30
-30
grid-column.hbs
...l/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
+1
-1
grid-uacolumn-model.hbs
...cro/front-end/widgets/grid-detail/grid-uacolumn-model.hbs
+2
-0
grid-control-state.ts
...c/core/modules/widgets/grid-control/grid-control-state.ts
+1
-1
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+58
-35
main-control.ts
...s}}/src/core/modules/widgets/main-control/main-control.ts
+0
-14
md-control.ts
...{apps}}/src/core/modules/widgets/md-control/md-control.ts
+14
-1
{{ctrls@GRID}}-grid-state.ts.hbs
...es}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
+4
-4
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column-header.hbs
浏览文件 @
8092ea74
<div
v-if=
"Object.is(column.dataIndex, '
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if}}
')"
class=
"header-cell"
>
<div
v-if=
"Object.is(column.dataIndex, '
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if}}
')"
class=
"header-cell
{{#if
item
.
headerPSSysCss
}}
{{
item
.
headerPSSysCss
.
cssName
}}{{/if}}
"
>
{{#if
item
.
psSysImage
}}
{{#if
item
.
psSysImage
}}
<AppIconText
{{#if
item
.
psSysImage
.
cssClass
}}
iconClass=
"
{{
item
.
psSysImage
.
cssClass
}}
"
{{/if}}
{{#if
item
.
psSysImage
.
imagePath
}}
imgPath=
"
{{
item
.
psSysImage
.
imagePath
}}
"
{{/if}}
/>
<AppIconText
{{#if
item
.
psSysImage
.
cssClass
}}
iconClass=
"
{{
item
.
psSysImage
.
cssClass
}}
"
{{/if}}
{{#if
item
.
psSysImage
.
imagePath
}}
imgPath=
"
{{
item
.
psSysImage
.
imagePath
}}
"
{{/if}}
/>
<span
class=
"title"
>
\{{title}}
</span>
<span
class=
"title"
>
\{{title}}
</span>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column-model.hbs
浏览文件 @
8092ea74
{{#
unless
(
or
item
.
hideDefault
item
.
hiddenDataItem
)
}}
{{#
unless
(
or
item
.
hideDefault
item
.
hiddenDataItem
)
}}
{
{
title: "
{{
item
.
caption
}}
",
title: "
{{
item
.
caption
}}
",
columnType: "
{{
item
.
columnType
}}
",
columnType: "
{{
item
.
columnType
}}
",
{{#if
item
.
align
}}
{{#if
item
.
align
}}
align: "
{{
lowerCase
item
.
align
}}
",
align: "
{{
lowerCase
item
.
align
}}
",
{{/if}}
{{/if}}
{{#if
(
eq
item
.
widthUnit
'PX'
)
}}
{{#if
(
eq
item
.
widthUnit
'PX'
)
}}
width:
{{
item
.
width
}}
,
width:
{{
item
.
width
}}
,
{{else}}
{{else}}
minWidth:
{{
item
.
width
}}
,
minWidth:
{{
item
.
width
}}
,
{{/if}}
{{/if}}
resizable: true,
resizable: true,
{{#
eq
item
.
columnType
'GROUPGRIDCOLUMN'
}}
{{#
eq
item
.
columnType
'GROUPGRIDCOLUMN'
}}
children: [
children: [
{{#
each
item
.
psDEGridColumns
as
|
column
|
}}
{{#
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
}}
{{/
each
}}
],
],
{{else}}
{{else}}
{{#
eq
item
.
columnType
'UAGRIDCOLUMN'
}}
{{#
eq
item
.
columnType
'UAGRIDCOLUMN'
}}
fixed: "right",
fixed: "right",
{{/
eq
}}
{{/
eq
}}
dataIndex: "
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
lowerCase
item
.
codeName
}}{{/if}}
",
dataIndex: "
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
lowerCase
item
.
codeName
}}{{/if}}
",
ellipsis: true,
ellipsis: true,
enableSort:
{{
item
.
enableSort
}}
,
enableSort:
{{
item
.
enableSort
}}
,
{{#if
item
.
aggMode
}}
{{#if
item
.
aggMode
}}
aggMode: "
{{
item
.
aggMode
}}
",
aggMode: "
{{
item
.
aggMode
}}
",
{{/if}}
{{/if}}
{{/
eq
}}
{{/
eq
}}
},
},
{{/
unless
}}
{{/
unless
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
浏览文件 @
8092ea74
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{{/
each
}}
{{/
each
}}
{{else}}
{{else}}
{{#
unless
(
or
item
.
hideDefault
item
.
hiddenDataItem
)
}}
{{#
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"
>
<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
(
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"
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-uacolumn-model.hbs
浏览文件 @
8092ea74
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"UACOLUMNMODEL"
item
=
column
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"UACOLUMNMODEL"
item
=
column
}}
{{/
each
}}
{{/
each
}}
{{else
if
(
eq
item
.
columnType
'UAGRIDCOLUMN'
)
}}
{{else
if
(
eq
item
.
columnType
'UAGRIDCOLUMN'
)
}}
{{
lowerCase
item
.
codeName
}}
: [
{{#
each
item
.
psDEUIActionGroup
.
psUIActionGroupDetails
as
|
action
|
}}
{{#
each
item
.
psDEUIActionGroup
.
psUIActionGroupDetails
as
|
action
|
}}
{{#
action
}}
{{#
action
}}
{ name: "
{{
name
}}
", caption: "
{{
psUIAction
.
caption
}}
", showIcon:
{{
showIcon
}}
, showCaption:
{{
showCaption
}}
, separator:
{{
addSeparator
}}
, uIActionTag: "
{{
psUIAction
.
uIActionTag
}}
", noPrivDisplayMode: "
{{
psUIAction
.
noPrivDisplayMode
}}
", dataAccessAction: '
{{
psUIAction
.
dataAccessAction
}}
', actionTarget: '
{{
psUIAction
.
actionTarget
}}
', disabled: false, visible: true,
{{#if
psUIAction
.
psSysImage
}}{{#if
psUIAction
.
psSysImage
.
imagePath
}}
imgPath: "
{{
psUIAction
.
psSysImage
.
imagePath
}}
",
{{/if}}{{#if
psUIAction
.
psSysImage
.
cssClass
}}
iconClass: "
{{
psUIAction
.
psSysImage
.
cssClass
}}
",
{{/if}}{{/if}}
},
{ name: "
{{
name
}}
", caption: "
{{
psUIAction
.
caption
}}
", showIcon:
{{
showIcon
}}
, showCaption:
{{
showCaption
}}
, separator:
{{
addSeparator
}}
, uIActionTag: "
{{
psUIAction
.
uIActionTag
}}
", noPrivDisplayMode: "
{{
psUIAction
.
noPrivDisplayMode
}}
", dataAccessAction: '
{{
psUIAction
.
dataAccessAction
}}
', actionTarget: '
{{
psUIAction
.
actionTarget
}}
', disabled: false, visible: true,
{{#if
psUIAction
.
psSysImage
}}{{#if
psUIAction
.
psSysImage
.
imagePath
}}
imgPath: "
{{
psUIAction
.
psSysImage
.
imagePath
}}
",
{{/if}}{{#if
psUIAction
.
psSysImage
.
cssClass
}}
iconClass: "
{{
psUIAction
.
psSysImage
.
cssClass
}}
",
{{/if}}{{/if}}
},
{{/
action
}}
{{/
action
}}
{{/
each
}}
{{/
each
}}
],
{{/if}}
{{/if}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control-state.ts
浏览文件 @
8092ea74
...
@@ -27,7 +27,7 @@ export interface GridControlState extends MDControlState {
...
@@ -27,7 +27,7 @@ export interface GridControlState extends MDControlState {
* @type {IParam}
* @type {IParam}
* @memberof GridControlState
* @memberof GridControlState
*/
*/
uAColumnModel
:
IParam
[]
;
uAColumnModel
:
IParam
;
/**
/**
* @description 值规则
* @description 值规则
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
8092ea74
import
{
DataTypes
,
dateFormat
,
deepCopy
,
GridControlState
,
IActionParam
,
IParam
,
MDControl
}
from
"@core"
;
import
{
DataTypes
,
dateFormat
,
deepCopy
,
GridControlState
,
IActionParam
,
IParam
,
isExistAndNotEmpty
,
MDControl
}
from
"@core"
;
import
{
createUUID
}
from
"qx-util"
;
import
{
createUUID
}
from
"qx-util"
;
import
schema
,
{
ErrorList
,
FieldErrorList
}
from
'async-validator'
;
import
schema
,
{
ErrorList
,
FieldErrorList
}
from
'async-validator'
;
/**
/**
...
@@ -220,8 +220,15 @@ export class GridControl extends MDControl {
...
@@ -220,8 +220,15 @@ export class GridControl extends MDControl {
*/
*/
public
handleStateChange
()
{
public
handleStateChange
()
{
// 计算表格操作列行为权限
// 计算表格操作列行为权限
const
{
items
,
columnsModel
}
=
toRefs
(
this
.
state
);
const
{
items
,
uAColumnModel
}
=
toRefs
(
this
.
state
);
// this.getActionAuthState
if
(
items
.
value
.
length
>
0
&&
uAColumnModel
.
value
&&
Object
.
keys
(
uAColumnModel
.
value
).
length
>
0
)
{
Object
.
keys
(
uAColumnModel
.
value
).
forEach
((
key
:
string
)
=>
{
const
tempActionModel
=
uAColumnModel
.
value
[
key
];
items
.
value
.
forEach
((
item
:
any
)
=>
{
Object
.
assign
(
item
,
{
[
key
]:
this
.
getActionAuthState
(
item
,
tempActionModel
)
});
});
})
}
// 处理分组
// 处理分组
this
.
handleDataGroup
();
this
.
handleDataGroup
();
// 处理数据聚合
// 处理数据聚合
...
@@ -405,44 +412,60 @@ export class GridControl extends MDControl {
...
@@ -405,44 +412,60 @@ export class GridControl extends MDControl {
* @protected
* @protected
* @memberof MDControl
* @memberof MDControl
*/
*/
protected
codeListGroupData
()
{
protected
async
codeListGroupData
()
{
const
{
gridGroup
}
=
this
.
state
;
const
{
groupField
,
groupCodeList
}
=
this
.
state
.
mdCtrlGroup
;
const
{
items
,
columnsModel
}
=
toRefs
(
this
.
state
);
const
{
items
,
context
,
viewParams
,
columnsModel
}
=
toRefs
(
this
.
state
);
const
{
groupField
}
=
gridGroup
;
if
(
!
groupCodeList
||
!
isExistAndNotEmpty
(
groupCodeList
.
codeListTag
))
{
// TODO 代码表数据
App
.
getNotificationService
().
warning
({
let
codeListGroup
:
IParam
[]
=
[];
message
:
'警告'
,
if
(
codeListGroup
.
length
>
0
)
{
description
:
'未配置分组代码表'
const
groupColumn
=
this
.
getGridColumn
(
columnsModel
.
value
,
"GROUP"
);
});
const
gridData
:
IParam
[]
=
[];
return
;
const
otherGroup
:
IParam
[]
=
[];
}
codeListGroup
.
forEach
((
group
:
IParam
)
=>
{
const
codeListService
=
App
.
getCodeListService
();
const
children
:
IParam
[]
=
[];
let
codeListItems
:
IParam
[]
=
[];
items
.
value
.
forEach
((
item
:
IParam
)
=>
{
try
{
if
(
Object
.
is
(
group
.
value
,
item
[
groupField
]))
{
codeListItems
=
await
codeListService
.
getCodeListItems
({
children
.
push
(
item
);
tag
:
groupCodeList
.
codeListTag
,
}
context
,
});
viewParams
gridData
.
push
({
srfkey
:
createUUID
(),
[
groupColumn
.
dataIndex
]:
group
.
text
,
children
:
deepCopy
(
children
),
})
});
});
}
catch
(
error
)
{
console
.
warn
(
`分组代码表
${
groupCodeList
.
codeListTag
}
获取数据项异常`
);
}
// 分组列
const
groupColumn
=
this
.
getGridColumn
(
columnsModel
.
value
,
"GROUP"
);
// 分组数据集合
const
groupItems
:
IParam
[]
=
[];
// 其他分组项
const
otherGroupItems
:
IParam
[]
=
[];
codeListItems
.
forEach
((
group
:
IParam
)
=>
{
const
children
:
IParam
[]
=
[];
items
.
value
.
forEach
((
item
:
IParam
)
=>
{
items
.
value
.
forEach
((
item
:
IParam
)
=>
{
const
index
:
number
=
codeListGroup
.
findIndex
((
_item
:
IParam
)
=>
Object
.
is
(
item
[
groupField
],
_item
.
value
));
if
(
Object
.
is
(
group
.
value
,
item
[
groupField
]))
{
if
(
index
<
0
)
{
children
.
push
(
item
);
otherGroup
.
push
(
item
);
}
}
});
});
if
(
otherGroup
.
length
>
0
)
{
groupItems
.
push
({
gridData
.
push
({
srfkey
:
createUUID
(),
srfkey
:
createUUID
(),
[
groupColumn
.
dataIndex
]:
group
.
text
,
[
groupColumn
.
dataIndex
]:
"其它"
,
children
:
children
children
:
deepCopy
(
otherGroup
),
})
})
});
items
.
value
.
forEach
((
item
:
IParam
)
=>
{
const
index
:
number
=
codeListItems
.
findIndex
((
_item
:
IParam
)
=>
Object
.
is
(
item
[
groupField
],
_item
.
value
));
if
(
index
<
0
)
{
otherGroupItems
.
push
(
item
);
}
}
items
.
value
=
gridData
;
});
if
(
otherGroupItems
.
length
>
0
)
{
groupItems
.
push
({
srfkey
:
createUUID
(),
[
groupColumn
.
dataIndex
]:
"其它"
,
children
:
otherGroupItems
,
})
}
}
this
.
state
.
items
=
[...
groupItems
];
}
}
/**
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/main-control/main-control.ts
浏览文件 @
8092ea74
...
@@ -32,20 +32,6 @@ export class MainControl extends ControlBase {
...
@@ -32,20 +32,6 @@ export class MainControl extends ControlBase {
this
.
state
.
controlAction
=
toRef
(
this
.
props
,
'controlAction'
)
as
any
;
this
.
state
.
controlAction
=
toRef
(
this
.
props
,
'controlAction'
)
as
any
;
}
}
/**
* 获取指定数据的操作权限
*
* @param {IParam} data 指定数据
* @param {IParam} actionModel 界面行为模型
* @memberof MainControl
*/
public
async
getActionAuthState
(
data
:
IParam
,
actionModel
:
IParam
)
{
const
{
context
,
appEntityCodeName
}
=
this
.
state
;
const
tempUIservice
=
await
App
.
getUIService
(
appEntityCodeName
.
toLowerCase
(),
context
);
UIUtil
.
calcActionItemAuthState
(
data
,
actionModel
,
tempUIservice
);
return
actionModel
;
}
/**
/**
*@description 使用UI服务
*@description 使用UI服务
*
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/md-control/md-control.ts
浏览文件 @
8092ea74
import
{
MDControlState
,
MainControl
,
deepCopy
,
IActionParam
,
IParam
,
UIBase
}
from
'@core'
;
import
{
MDControlState
,
MainControl
,
deepCopy
,
IActionParam
,
IParam
,
UIBase
,
isExistAndNotEmpty
,
UIUtil
}
from
'@core'
;
import
{
Modal
}
from
'ant-design-vue'
;
/**
/**
* @description 多数据部件
* @description 多数据部件
...
@@ -444,6 +445,18 @@ export class MDControl extends MainControl {
...
@@ -444,6 +445,18 @@ export class MDControl extends MainControl {
*/
*/
protected
setUpdateDefault
():
void
{
}
protected
setUpdateDefault
():
void
{
}
/**
* 获取指定数据的操作权限
*
* @param {IParam} data 指定数据
* @memberof MDControl
*/
public
getActionAuthState
(
data
:
IParam
,
tempActionModel
:
IParam
)
{
const
{
UIService
}
=
toRefs
(
this
.
state
);
UIUtil
.
calcActionItemAuthState
(
data
,
tempActionModel
,
UIService
);
return
tempActionModel
;
}
/**
/**
* 获取当前激活数据
* 获取当前激活数据
*
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
浏览文件 @
8092ea74
...
@@ -55,7 +55,7 @@ export const ctrlState = {
...
@@ -55,7 +55,7 @@ export const ctrlState = {
groupField: "
{{
lowerCase
ctrl
.
groupPSAppDEField
.
codeName
}}
",
groupField: "
{{
lowerCase
ctrl
.
groupPSAppDEField
.
codeName
}}
",
{{#if
ctrl
.
groupPSCodeList
}}
{{#if
ctrl
.
groupPSCodeList
}}
groupCodeList: {
groupCodeList: {
codeListTag: "
{{
ctrl
.
groupPSCodeList
.
code
Name
}}
",
codeListTag: "
{{
ctrl
.
groupPSCodeList
.
code
ListTag
}}
",
codeListType: "
{{
ctrl
.
groupPSCodeList
.
codeListType
}}
",
codeListType: "
{{
ctrl
.
groupPSCodeList
.
codeListType
}}
",
},
},
{{/if}}
{{/if}}
...
@@ -87,11 +87,11 @@ export const ctrlState = {
...
@@ -87,11 +87,11 @@ export const ctrlState = {
aggDataSet: "
{{
ctrl
.
aggPSAppDEDataSet
.
codeName
}}
",
aggDataSet: "
{{
ctrl
.
aggPSAppDEDataSet
.
codeName
}}
",
{{/if}}
{{/if}}
},
},
uAColumnModel:
[
uAColumnModel:
{
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{#
each
ctrl
.
psDEGridColumns
as
|
column
|
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"UACOLUMNMODEL"
item
=
column
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"UACOLUMNMODEL"
item
=
column
}}
{{/
each
}}
{{/
each
}}
]
,
}
,
gridEditState:{
gridEditState:{
{{#
each
ctrl
.
psDEGridEditItems
as
|
column
|
}}
{{#
each
ctrl
.
psDEGridEditItems
as
|
column
|
}}
{{#if
column
.
codeName
}}
{{#if
column
.
codeName
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录