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
}}
<AppIconText
{{#if
item
.
psSysImage
.
cssClass
}}
iconClass=
"
{{
item
.
psSysImage
.
cssClass
}}
"
{{/if}}
{{#if
item
.
psSysImage
.
imagePath
}}
imgPath=
"
{{
item
.
psSysImage
.
imagePath
}}
"
{{/if}}
/>
<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
)
}}
{
title: "
{{
item
.
caption
}}
",
columnType: "
{{
item
.
columnType
}}
",
{{#if
item
.
align
}}
align: "
{{
lowerCase
item
.
align
}}
",
{{/if}}
{{#if
(
eq
item
.
widthUnit
'PX'
)
}}
width:
{{
item
.
width
}}
,
{{else}}
minWidth:
{{
item
.
width
}}
,
{{/if}}
resizable: true,
{{#
eq
item
.
columnType
'GROUPGRIDCOLUMN'
}}
children: [
{{#
each
item
.
psDEGridColumns
as
|
column
|
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"COLUMNMODEL"
item
=
column
}}
{{/
each
}}
],
{{else}}
{{#
eq
item
.
columnType
'UAGRIDCOLUMN'
}}
fixed: "right",
{{/
eq
}}
dataIndex: "
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
lowerCase
item
.
codeName
}}{{/if}}
",
ellipsis: true,
enableSort:
{{
item
.
enableSort
}}
,
{{#if
item
.
aggMode
}}
aggMode: "
{{
item
.
aggMode
}}
",
{{/if}}
{{/
eq
}}
},
{
title: "
{{
item
.
caption
}}
",
columnType: "
{{
item
.
columnType
}}
",
{{#if
item
.
align
}}
align: "
{{
lowerCase
item
.
align
}}
",
{{/if}}
{{#if
(
eq
item
.
widthUnit
'PX'
)
}}
width:
{{
item
.
width
}}
,
{{else}}
minWidth:
{{
item
.
width
}}
,
{{/if}}
resizable: true,
{{#
eq
item
.
columnType
'GROUPGRIDCOLUMN'
}}
children: [
{{#
each
item
.
psDEGridColumns
as
|
column
|
}}
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"COLUMNMODEL"
item
=
column
}}
{{/
each
}}
],
{{else}}
{{#
eq
item
.
columnType
'UAGRIDCOLUMN'
}}
fixed: "right",
{{/
eq
}}
dataIndex: "
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
lowerCase
item
.
codeName
}}{{/if}}
",
ellipsis: true,
enableSort:
{{
item
.
enableSort
}}
,
{{#if
item
.
aggMode
}}
aggMode: "
{{
item
.
aggMode
}}
",
{{/if}}
{{/
eq
}}
},
{{/
unless
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
浏览文件 @
8092ea74
...
...
@@ -4,7 +4,7 @@
{{/
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"
>
<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"
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-uacolumn-model.hbs
浏览文件 @
8092ea74
...
...
@@ -3,9 +3,11 @@
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
type
=
"UACOLUMNMODEL"
item
=
column
}}
{{/
each
}}
{{else
if
(
eq
item
.
columnType
'UAGRIDCOLUMN'
)
}}
{{
lowerCase
item
.
codeName
}}
: [
{{#
each
item
.
psDEUIActionGroup
.
psUIActionGroupDetails
as
|
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}}
},
{{/
action
}}
{{/
each
}}
],
{{/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 {
* @type {IParam}
* @memberof GridControlState
*/
uAColumnModel
:
IParam
[]
;
uAColumnModel
:
IParam
;
/**
* @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
schema
,
{
ErrorList
,
FieldErrorList
}
from
'async-validator'
;
/**
...
...
@@ -220,8 +220,15 @@ export class GridControl extends MDControl {
*/
public
handleStateChange
()
{
// 计算表格操作列行为权限
const
{
items
,
columnsModel
}
=
toRefs
(
this
.
state
);
// this.getActionAuthState
const
{
items
,
uAColumnModel
}
=
toRefs
(
this
.
state
);
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
();
// 处理数据聚合
...
...
@@ -405,44 +412,60 @@ export class GridControl extends MDControl {
* @protected
* @memberof MDControl
*/
protected
codeListGroupData
()
{
const
{
gridGroup
}
=
this
.
state
;
const
{
items
,
columnsModel
}
=
toRefs
(
this
.
state
);
const
{
groupField
}
=
gridGroup
;
// TODO 代码表数据
let
codeListGroup
:
IParam
[]
=
[];
if
(
codeListGroup
.
length
>
0
)
{
const
groupColumn
=
this
.
getGridColumn
(
columnsModel
.
value
,
"GROUP"
);
const
gridData
:
IParam
[]
=
[];
const
otherGroup
:
IParam
[]
=
[];
codeListGroup
.
forEach
((
group
:
IParam
)
=>
{
const
children
:
IParam
[]
=
[];
items
.
value
.
forEach
((
item
:
IParam
)
=>
{
if
(
Object
.
is
(
group
.
value
,
item
[
groupField
]))
{
children
.
push
(
item
);
}
});
gridData
.
push
({
srfkey
:
createUUID
(),
[
groupColumn
.
dataIndex
]:
group
.
text
,
children
:
deepCopy
(
children
),
})
protected
async
codeListGroupData
()
{
const
{
groupField
,
groupCodeList
}
=
this
.
state
.
mdCtrlGroup
;
const
{
items
,
context
,
viewParams
,
columnsModel
}
=
toRefs
(
this
.
state
);
if
(
!
groupCodeList
||
!
isExistAndNotEmpty
(
groupCodeList
.
codeListTag
))
{
App
.
getNotificationService
().
warning
({
message
:
'警告'
,
description
:
'未配置分组代码表'
});
return
;
}
const
codeListService
=
App
.
getCodeListService
();
let
codeListItems
:
IParam
[]
=
[];
try
{
codeListItems
=
await
codeListService
.
getCodeListItems
({
tag
:
groupCodeList
.
codeListTag
,
context
,
viewParams
});
}
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
)
=>
{
const
index
:
number
=
codeListGroup
.
findIndex
((
_item
:
IParam
)
=>
Object
.
is
(
item
[
groupField
],
_item
.
value
));
if
(
index
<
0
)
{
otherGroup
.
push
(
item
);
if
(
Object
.
is
(
group
.
value
,
item
[
groupField
]))
{
children
.
push
(
item
);
}
});
if
(
otherGroup
.
length
>
0
)
{
gridData
.
push
({
srfkey
:
createUUID
(),
[
groupColumn
.
dataIndex
]:
"其它"
,
children
:
deepCopy
(
otherGroup
),
})
groupItems
.
push
({
srfkey
:
createUUID
(),
[
groupColumn
.
dataIndex
]:
group
.
text
,
children
:
children
})
});
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 {
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服务
*
...
...
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 多数据部件
...
...
@@ -444,6 +445,18 @@ export class MDControl extends MainControl {
*/
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 = {
groupField: "
{{
lowerCase
ctrl
.
groupPSAppDEField
.
codeName
}}
",
{{#if
ctrl
.
groupPSCodeList
}}
groupCodeList: {
codeListTag: "
{{
ctrl
.
groupPSCodeList
.
code
Name
}}
",
codeListTag: "
{{
ctrl
.
groupPSCodeList
.
code
ListTag
}}
",
codeListType: "
{{
ctrl
.
groupPSCodeList
.
codeListType
}}
",
},
{{/if}}
...
...
@@ -87,11 +87,11 @@ export const ctrlState = {
aggDataSet: "
{{
ctrl
.
aggPSAppDEDataSet
.
codeName
}}
",
{{/if}}
},
uAColumnModel:
[
uAColumnModel:
{
{{#
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
}}
]
,
}
,
gridEditState:{
{{#
each
ctrl
.
psDEGridEditItems
as
|
column
|
}}
{{#if
column
.
codeName
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录