Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
173b6c8f
提交
173b6c8f
编写于
1月 05, 2022
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
33a208df
变更
4
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
90 行增加
和
145 行删除
+90
-145
form-details-model.hbs
...ources/templ/r7/@macro/form-detail/form-details-model.hbs
+22
-8
grid-control-state.ts
...c/core/modules/widgets/grid-control/grid-control-state.ts
+12
-75
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+54
-60
{{ctrls@FORM}}-form-config.ts.hbs
...s}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
+2
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/form-details-model.hbs
浏览文件 @
173b6c8f
{{#
each
items
as
|
formDetail
|
}}
{{#
each
items
as
|
formDetail
|
}}
{
{
{
formDetail
.
codeName
}}
: {
caption: '
{{
formDetail
.
caption
}}
',
caption: '
{{
formDetail
.
caption
}}
',
codeName: '
{{
formDetail
.
codeName
}}
',
name: '
{{
formDetail
.
name
}}
',
name: '
{{
formDetail
.
name
}}
',
disabled: false,
visible: true,
detailStyle: '
{{
formDetail
.
detailStyle
}}
',
detailType: '
{{
formDetail
.
detailType
}}
',
showCaption:
{{#if
formDetail
.
showCaption
}}
true
{{else}}
false
{{/if}}
,
{{#if
(
eq
formDetail
.
detailType
"FORMITEM"
)
}}
{{#if
(
eq
formDetail
.
detailType
"FORMITEM"
)
}}
dataType: '
{{
formDetail
.
dataType
}}
',
dataType: '
{{
formDetail
.
dataType
}}
',
detailStyle: '
{{
formDetail
.
detailStyle
}}
',
{{#if
formDetail
.
resetItemName
}}
{{#
formDetail
.
resetItemName
}}
resetItemName: '
{{
formDetail
.
resetItemName
}}
',
resetItemName: '
{{
formDetail
.
resetItemName
}}
',
{{/
formDetail
.
resetItemName
}}
{{/
if
}}
{{#
formDetail
.
valueItemName
}}
{{#
if
formDetail
.
valueItemName
}}
valueItemName: '
{{
formDetail
.
valueItemName
}}
',
valueItemName: '
{{
formDetail
.
valueItemName
}}
',
{{/
formDetail
.
valueItemName
}}
{{/if}}
{{/if}}
{{#if
(
and
(
eq
formDetail
.
detailType
"BUTTON"
)
formDetail
.
psUIAction
)
}}
{{#
formDetail
.
psUIAction
}}
uIAction: {
uIActionType: '
{{
uIActionType
}}
',
uIActionTag: '
{{
uIActionTag
}}
',
}
{{/
formDetail
.
psUIAction
}}
{{/if}}
{{#if
(
eq
formDetail
.
detailType
"GROUPPANEL"
)
}}
{{/if}}
{{#
each
formDetail
.
psDEFDGroupLogics
as
|
groupLogic
|
}}
{{#
each
formDetail
.
psDEFDGroupLogics
as
|
groupLogic
|
}}
groupLogics: {
groupLogics: {
name: '
{{
groupLogic
.
name
}}
',
name: '
{{
groupLogic
.
name
}}
',
...
@@ -27,7 +42,6 @@
...
@@ -27,7 +42,6 @@
],
],
}
}
{{/
each
}}
{{/
each
}}
{{/if}}
},
},
{{#if
formDetail
.
psDEFormDetails
}}
{{#if
formDetail
.
psDEFormDetails
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
formDetail
.
psDEFormDetails
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
formDetail
.
psDEFormDetails
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control-state.ts
浏览文件 @
173b6c8f
...
@@ -13,7 +13,7 @@ export interface GridControlState extends MainControlState {
...
@@ -13,7 +13,7 @@ export interface GridControlState extends MainControlState {
* @type {IParam[]}
* @type {IParam[]}
* @memberof GridControlState
* @memberof GridControlState
*/
*/
items
:
IParam
[];
data
:
IParam
[];
/**
/**
* @description 表格列模型
* @description 表格列模型
...
@@ -79,93 +79,30 @@ export interface GridControlState extends MainControlState {
...
@@ -79,93 +79,30 @@ export interface GridControlState extends MainControlState {
selectFirstDefault
:
boolean
;
selectFirstDefault
:
boolean
;
/**
/**
* @description 当前页
* @description 表格聚合
* @type {number}
* @memberof GridControlState
*/
current
:
number
;
/**
* @description 分页大小
* @type {number}
* @memberof GridControlState
*/
pageSize
:
number
;
/**
* @description 是否启用分页
* @type {boolean}
* @memberof GridControlState
*/
enablePagingBar
:
boolean
;
/**
* @description 数据聚合
* @type {IParam}
* @type {IParam}
* @memberof GridControlState
* @memberof GridControlState
*/
*/
dataAgg
:
string
[];
gridAgg
:
IParam
;
/**
* @description 聚合模式
* @type {string}
* @memberof GridControlState
*/
aggMode
:
string
;
/**
* @description 聚合实体
* @type {string}
* @memberof GridControlState
*/
aggEntity
:
string
,
/**
/**
* @description 聚合数据集
* @description 表格分组
* @type {string}
* @type {IParam}
* @memberof GridControlState
*/
aggDataSet
:
string
,
/**
* @description 分组模式
* @type {string}
* @memberof GridControlState
*/
groupMode
:
string
;
/**
* @description 分组属性
* @type {string}
* @memberof GridControlState
*/
groupField
:
string
;
/**
* @description 分组代码表
* @type {*}
* @memberof GridControlState
*/
groupCodeList
:
any
;
/**
* @description 禁用排序
* @type {boolean}
* @memberof GridControlState
* @memberof GridControlState
*/
*/
noSort
:
boolean
;
gridGroup
:
IParam
;
/**
/**
* @description
排序方向
* @description
表格排序
* @type {
string
}
* @type {
IParam
}
* @memberof GridControlState
* @memberof GridControlState
*/
*/
minorSortDir
:
string
;
gridSort
:
IParam
;
/**
/**
* @description
排序属性
* @description
表格分页
* @type {
string
}
* @type {
IParam
}
* @memberof GridControlState
* @memberof GridControlState
*/
*/
minorSortPSDEF
:
string
;
gridPaging
:
IParam
;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
173b6c8f
...
@@ -83,22 +83,21 @@ export class GridControl extends MainControl {
...
@@ -83,22 +83,21 @@ export class GridControl extends MainControl {
*/
*/
public
autoGroup
()
{
public
autoGroup
()
{
const
{
gridGroup
}
=
this
.
controlState
;
const
{
gridGroup
}
=
this
.
controlState
;
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
controlState
);
const
{
groupField
}
=
gridGroup
;
const
{
groupField
}
=
gridGroup
;
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
let
autoGroup
:
string
[]
=
[];
let
autoGroup
:
string
[]
=
[];
data
Ref
.
value
.
forEach
((
item
:
IParam
)
=>
{
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
if
(
item
.
hasOwnProperty
(
groupField
))
{
if
(
item
.
hasOwnProperty
(
groupField
))
{
autoGroup
.
push
(
item
[
groupField
]);
autoGroup
.
push
(
item
[
groupField
]);
}
}
})
})
autoGroup
=
[...
new
Set
(
autoGroup
)];
autoGroup
=
[...
new
Set
(
autoGroup
)];
if
(
autoGroup
.
length
>
0
)
{
if
(
autoGroup
.
length
>
0
)
{
const
columnsModelRef
=
toRef
(
this
.
controlState
,
"columnsModel"
);
const
groupColumn
=
this
.
getGridColumn
(
columnsModel
.
value
,
"GROUP"
);
const
groupColumn
=
this
.
getGridColumn
(
columnsModelRef
.
value
,
"GROUP"
);
const
gridData
:
IParam
[]
=
[];
const
gridData
:
IParam
[]
=
[];
autoGroup
.
forEach
((
group
:
string
,
index
:
number
)
=>
{
autoGroup
.
forEach
((
group
:
string
,
index
:
number
)
=>
{
const
children
:
IParam
[]
=
[];
const
children
:
IParam
[]
=
[];
data
Ref
.
value
.
forEach
((
item
:
IParam
)
=>
{
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
if
(
Object
.
is
(
group
,
item
[
groupField
]))
{
if
(
Object
.
is
(
group
,
item
[
groupField
]))
{
children
.
push
(
item
);
children
.
push
(
item
);
}
}
...
@@ -109,7 +108,7 @@ export class GridControl extends MainControl {
...
@@ -109,7 +108,7 @@ export class GridControl extends MainControl {
children
:
deepCopy
(
children
),
children
:
deepCopy
(
children
),
})
})
});
});
data
Ref
.
value
=
gridData
;
data
.
value
=
gridData
;
}
}
}
}
...
@@ -119,18 +118,17 @@ export class GridControl extends MainControl {
...
@@ -119,18 +118,17 @@ export class GridControl extends MainControl {
*/
*/
public
async
codeListGroup
()
{
public
async
codeListGroup
()
{
const
{
gridGroup
}
=
this
.
controlState
;
const
{
gridGroup
}
=
this
.
controlState
;
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
controlState
);
const
{
groupField
}
=
gridGroup
;
const
{
groupField
}
=
gridGroup
;
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
// TODO 代码表数据
// TODO 代码表数据
let
codeListGroup
:
IParam
[]
=
[];
let
codeListGroup
:
IParam
[]
=
[];
if
(
codeListGroup
.
length
>
0
)
{
if
(
codeListGroup
.
length
>
0
)
{
const
columnsModelRef
=
toRef
(
this
.
controlState
,
"columnsModel"
);
const
groupColumn
=
this
.
getGridColumn
(
columnsModel
.
value
,
"GROUP"
);
const
groupColumn
=
this
.
getGridColumn
(
columnsModelRef
.
value
,
"GROUP"
);
const
gridData
:
IParam
[]
=
[];
const
gridData
:
IParam
[]
=
[];
const
otherGroup
:
IParam
[]
=
[];
const
otherGroup
:
IParam
[]
=
[];
codeListGroup
.
forEach
((
group
:
IParam
)
=>
{
codeListGroup
.
forEach
((
group
:
IParam
)
=>
{
const
children
:
IParam
[]
=
[];
const
children
:
IParam
[]
=
[];
data
Ref
.
value
.
forEach
((
item
:
IParam
)
=>
{
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
if
(
Object
.
is
(
group
.
value
,
item
[
groupField
]))
{
if
(
Object
.
is
(
group
.
value
,
item
[
groupField
]))
{
children
.
push
(
item
);
children
.
push
(
item
);
}
}
...
@@ -141,7 +139,7 @@ export class GridControl extends MainControl {
...
@@ -141,7 +139,7 @@ export class GridControl extends MainControl {
children
:
deepCopy
(
children
),
children
:
deepCopy
(
children
),
})
})
});
});
data
Ref
.
value
.
forEach
((
item
:
IParam
)
=>
{
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
const
index
:
number
=
codeListGroup
.
findIndex
((
_item
:
IParam
)
=>
Object
.
is
(
item
[
groupField
],
_item
.
value
));
const
index
:
number
=
codeListGroup
.
findIndex
((
_item
:
IParam
)
=>
Object
.
is
(
item
[
groupField
],
_item
.
value
));
if
(
index
<
0
)
{
if
(
index
<
0
)
{
otherGroup
.
push
(
item
);
otherGroup
.
push
(
item
);
...
@@ -154,7 +152,7 @@ export class GridControl extends MainControl {
...
@@ -154,7 +152,7 @@ export class GridControl extends MainControl {
children
:
deepCopy
(
otherGroup
),
children
:
deepCopy
(
otherGroup
),
})
})
}
}
data
Ref
.
value
=
gridData
;
data
.
value
=
gridData
;
}
}
}
}
...
@@ -163,11 +161,10 @@ export class GridControl extends MainControl {
...
@@ -163,11 +161,10 @@ export class GridControl extends MainControl {
* @memberof GridControl
* @memberof GridControl
*/
*/
public
calcGridAuthState
()
{
public
calcGridAuthState
()
{
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
controlState
);
const
columnsModelRef
=
toRef
(
this
.
controlState
,
"columnsModel"
);
let
columnModel
=
this
.
getGridColumn
(
columnsModel
.
value
,
"UAGRIDCOLUMN"
);
let
columnModel
=
this
.
getGridColumn
(
columnsModelRef
.
value
,
"UAGRIDCOLUMN"
);
if
(
columnModel
)
{
if
(
columnModel
)
{
data
Ref
.
value
.
forEach
((
item
:
IParam
)
=>
{
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
Object
.
assign
(
item
,
{
Object
.
assign
(
item
,
{
[
columnModel
.
dataIndex
]:
this
.
getActionAuthState
(
item
),
[
columnModel
.
dataIndex
]:
this
.
getActionAuthState
(
item
),
})
})
...
@@ -180,8 +177,8 @@ export class GridControl extends MainControl {
...
@@ -180,8 +177,8 @@ export class GridControl extends MainControl {
* @memberof GridControl
* @memberof GridControl
*/
*/
public
setGridColSpan
()
{
public
setGridColSpan
()
{
const
columnsModelRef
=
toRef
(
this
.
controlState
,
"columnsModel"
);
const
{
columnsModel
}
=
toRefs
(
this
.
controlState
);
columnsModel
Ref
.
value
.
forEach
((
columnModel
:
IParam
)
=>
{
columnsModel
.
value
.
forEach
((
columnModel
:
IParam
)
=>
{
const
customRender
=
({
text
,
record
,
index
,
column
}:
IParam
)
=>
{
const
customRender
=
({
text
,
record
,
index
,
column
}:
IParam
)
=>
{
const
option
=
{
const
option
=
{
props
:
{}
as
IParam
,
props
:
{}
as
IParam
,
...
@@ -189,7 +186,7 @@ export class GridControl extends MainControl {
...
@@ -189,7 +186,7 @@ export class GridControl extends MainControl {
if
(
record
.
children
)
{
if
(
record
.
children
)
{
if
(
Object
.
is
(
column
.
columnType
,
"GROUP"
))
{
if
(
Object
.
is
(
column
.
columnType
,
"GROUP"
))
{
Object
.
assign
(
option
.
props
,{
Object
.
assign
(
option
.
props
,{
colSpan
:
columnsModel
Ref
.
value
.
length
,
colSpan
:
columnsModel
.
value
.
length
,
});
});
}
else
{
}
else
{
Object
.
assign
(
option
.
props
,{
Object
.
assign
(
option
.
props
,{
...
@@ -283,12 +280,12 @@ export class GridControl extends MainControl {
...
@@ -283,12 +280,12 @@ export class GridControl extends MainControl {
* @memberof GridControl
* @memberof GridControl
*/
*/
public
async
handleDataAgg
()
{
public
async
handleDataAgg
()
{
const
{
gridPaging
,
gridGroup
}
=
this
.
controlState
;
const
{
gridPaging
,
gridGroup
,
columnsModel
}
=
this
.
controlState
;
const
gridAggRef
=
toRef
(
this
.
controlState
,
"gridAgg"
);
const
{
gridAgg
}
=
toRefs
(
this
.
controlState
);
let
{
aggMode
,
aggData
}
=
gridAgg
Ref
.
value
;
let
{
aggMode
,
aggData
}
=
gridAgg
.
value
;
const
{
enableGroup
}
=
gridGroup
;
const
{
enableGroup
}
=
gridGroup
;
if
(
!
Object
.
is
(
aggMode
,
"NONE"
))
{
if
(
!
Object
.
is
(
aggMode
,
"NONE"
))
{
const
{
enablePagingBar
,
current
,
pageSize
}
=
gridPaging
;
const
{
enablePagingBar
,
current
,
pageSize
}
=
gridPaging
;
let
dataAgg
:
IParam
[]
=
[];
let
dataAgg
:
IParam
[]
=
[];
if
(
Object
.
is
(
aggMode
,
"PAGE"
))
{
if
(
Object
.
is
(
aggMode
,
"PAGE"
))
{
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
...
@@ -310,16 +307,16 @@ export class GridControl extends MainControl {
...
@@ -310,16 +307,16 @@ export class GridControl extends MainControl {
})
})
dataAgg
=
_dataAgg
;
dataAgg
=
_dataAgg
;
}
}
const
columnsModelRef
=
toRef
(
this
.
controlState
,
"columnsModel"
);
const
_columnsModel
:
IParam
[]
=
[];
const
columnsModel
:
IParam
[]
=
[];
columnsModel
.
forEach
((
column
:
IParam
)
=>
{
columnsModelRef
.
value
.
forEach
((
column
:
IParam
)
=>
{
if
(
!
Object
.
is
(
column
.
columnType
,
"GROUPGRIDCOLUMN"
))
{
if
(
!
Object
.
is
(
column
.
columnType
,
"GROUPGRIDCOLUMN"
))
{
columnsModel
.
push
(
column
);
_
columnsModel
.
push
(
column
);
}
}
});
});
columnsModel
.
forEach
((
column
:
IParam
)
=>
{
_columnsModel
.
forEach
((
column
:
IParam
)
=>
{
console
.
log
(
this
.
getAggValue
(
dataAgg
,
column
));
aggData
.
push
(
this
.
getAggValue
(
dataAgg
,
column
))
aggData
.
push
(
this
.
getAggValue
(
dataAgg
,
column
))
})
})
;
}
}
}
}
...
@@ -328,23 +325,22 @@ export class GridControl extends MainControl {
...
@@ -328,23 +325,22 @@ export class GridControl extends MainControl {
* @memberof GridControl
* @memberof GridControl
*/
*/
public
handleDefaultSelect
()
{
public
handleDefaultSelect
()
{
const
{
selectedData
,
selectFirstDefault
,
controlName
}
=
this
.
controlState
;
const
{
selectedData
,
selectFirstDefault
,
controlName
,
data
}
=
this
.
controlState
;
const
{
selectedRowKeys
}
=
toRefs
(
this
.
controlState
);
if
(
selectedData
?.
length
>
0
)
{
if
(
selectedData
?.
length
>
0
)
{
const
selectedRowKeys
:
string
[]
=
[];
const
_selectedRowKeys
:
string
[]
=
[];
const
selectedRowKeysRef
=
toRef
(
this
.
controlState
,
"selectedRowKeys"
);
selectedData
.
forEach
((
selected
:
IParam
)
=>
{
selectedData
.
forEach
((
selected
:
IParam
)
=>
{
if
(
selected
.
srfkey
)
{
if
(
selected
.
srfkey
)
{
selectedRowKeys
.
push
(
selected
.
srfkey
);
_
selectedRowKeys
.
push
(
selected
.
srfkey
);
}
}
});
});
selectedRowKeys
Ref
.
value
=
selectedRowKeys
;
selectedRowKeys
.
value
=
_
selectedRowKeys
;
}
else
if
(
selectFirstDefault
)
{
}
else
if
(
selectFirstDefault
)
{
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
if
(
data
[
0
])
{
if
(
dataRef
.
value
[
0
])
{
this
.
emit
(
"ctrlEvent"
,
{
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
tag
:
controlName
,
action
:
"selectionChange"
,
action
:
"selectionChange"
,
data
:
[
deepCopy
(
data
Ref
.
value
[
0
])],
data
:
[
deepCopy
(
data
[
0
])],
});
});
}
}
}
}
...
@@ -363,16 +359,15 @@ export class GridControl extends MainControl {
...
@@ -363,16 +359,15 @@ export class GridControl extends MainControl {
const
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
gridSort
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
gridSort
}
=
this
.
controlState
;
}
=
this
.
controlState
;
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
const
{
gridPaging
,
data
}
=
toRefs
(
this
.
controlState
);
const
gridPagingRef
=
toRef
(
this
.
controlState
,
"gridPaging"
);
if
(
!
controlAction
.
loadAction
)
{
if
(
!
controlAction
.
loadAction
){
return
;
return
;
}
}
const
{
noSort
,
minorSortDir
,
minorSortPSDEF
}
=
gridSort
;
const
{
noSort
,
minorSortDir
,
minorSortPSDEF
}
=
gridSort
;
let
{
enablePagingBar
,
pagination
,
current
,
pageSize
}
=
gridPagingRef
.
value
;
let
{
enablePagingBar
,
pagination
,
current
,
pageSize
}
=
gridPaging
.
value
;
const
arg
:
any
=
{
...
opt
};
const
arg
:
any
=
{
...
opt
};
let
_context
=
deepCopy
(
context
?
context
:
{});
let
_context
=
deepCopy
(
context
?
context
:
{});
let
_viewParams
=
deepCopy
(
viewParams
?
context
:
{});
let
_viewParams
=
deepCopy
(
viewParams
?
viewParams
:
{});
if
(
noSort
&&
minorSortDir
&&
minorSortPSDEF
)
{
if
(
noSort
&&
minorSortDir
&&
minorSortPSDEF
)
{
Object
.
assign
(
_viewParams
,
{
sort
:
`
${
minorSortPSDEF
}
,
${
minorSortDir
}
`
});
Object
.
assign
(
_viewParams
,
{
sort
:
`
${
minorSortPSDEF
}
,
${
minorSortDir
}
`
});
}
}
...
@@ -386,7 +381,7 @@ export class GridControl extends MainControl {
...
@@ -386,7 +381,7 @@ export class GridControl extends MainControl {
{
action
:
controlAction
.
loadAction
,
isLoading
:
showBusyIndicator
}
{
action
:
controlAction
.
loadAction
,
isLoading
:
showBusyIndicator
}
);
);
if
(
response
.
status
||
response
.
status
==
200
)
{
if
(
response
.
status
||
response
.
status
==
200
)
{
data
Ref
.
value
=
response
.
data
;
data
.
value
=
response
.
data
;
if
(
enablePagingBar
)
{
if
(
enablePagingBar
)
{
pagination
[
'total'
]
=
response
.
total
;
pagination
[
'total'
]
=
response
.
total
;
}
}
...
@@ -487,26 +482,26 @@ export class GridControl extends MainControl {
...
@@ -487,26 +482,26 @@ export class GridControl extends MainControl {
const
remove
=
async
(
opt
:
IParam
[]
=
[])
=>
{
const
remove
=
async
(
opt
:
IParam
[]
=
[])
=>
{
try
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
appDeCodeName
}
=
this
.
controlState
;
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
appDeCodeName
}
=
this
.
controlState
;
const
{
data
}
=
toRefs
(
this
.
controlState
);
if
(
!
controlAction
.
removeAction
)
{
if
(
!
controlAction
.
removeAction
)
{
return
;
return
;
}
}
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
const
_data
:
IParam
[]
=
[];
const
data
:
IParam
[]
=
[];
opt
.
forEach
((
item
:
IParam
,
index
:
number
)
=>
{
opt
.
forEach
((
item
:
IParam
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfuf
,
"0"
))
{
if
(
Object
.
is
(
item
.
srfuf
,
"0"
))
{
data
Ref
.
value
.
some
((
val
:
any
,
num
:
number
)
=>
{
data
.
value
.
some
((
val
:
any
,
num
:
number
)
=>
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
item
))
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
item
))
{
data
Ref
.
value
.
splice
(
num
,
1
);
data
.
value
.
splice
(
num
,
1
);
return
true
;
return
true
;
}
}
});
});
}
else
{
}
else
{
data
.
push
(
opt
[
index
]);
_
data
.
push
(
opt
[
index
]);
}
}
});
});
if
(
data
.
length
>
0
)
{
if
(
_
data
.
length
>
0
)
{
const
keys
:
string
[]
=
[];
const
keys
:
string
[]
=
[];
data
.
forEach
((
item
:
IParam
)
=>
{
_
data
.
forEach
((
item
:
IParam
)
=>
{
keys
.
push
(
item
.
srfkey
);
keys
.
push
(
item
.
srfkey
);
});
});
const
_removeAction
=
keys
.
length
>
1
?
"removeBatch"
:
controlAction
.
removeAction
;
const
_removeAction
=
keys
.
length
>
1
?
"removeBatch"
:
controlAction
.
removeAction
;
...
@@ -561,10 +556,10 @@ export class GridControl extends MainControl {
...
@@ -561,10 +556,10 @@ export class GridControl extends MainControl {
const
newRow
=
async
(
opt
:
any
=
{})
=>
{
const
newRow
=
async
(
opt
:
any
=
{})
=>
{
try
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
controlState
;
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
controlState
;
const
{
data
}
=
toRefs
(
this
.
controlState
);
if
(
!
controlAction
.
loadDraftAction
)
{
if
(
!
controlAction
.
loadDraftAction
)
{
return
;
return
;
}
}
const
dataRef
=
toRef
(
this
.
controlState
,
"data"
);
let
_context
=
deepCopy
(
context
);
let
_context
=
deepCopy
(
context
);
let
_viewParams
=
deepCopy
(
viewParams
);
let
_viewParams
=
deepCopy
(
viewParams
);
const
arg
:
any
=
{...
opt
};
const
arg
:
any
=
{...
opt
};
...
@@ -575,7 +570,7 @@ export class GridControl extends MainControl {
...
@@ -575,7 +570,7 @@ export class GridControl extends MainControl {
{
action
:
controlAction
.
loadDraftAction
,
isLoading
:
showBusyIndicator
},
{
action
:
controlAction
.
loadDraftAction
,
isLoading
:
showBusyIndicator
},
);
);
if
(
response
.
status
||
response
.
status
==
200
)
{
if
(
response
.
status
||
response
.
status
==
200
)
{
dataRef
.
value
=
[...
dataRef
.
value
,[
response
.
data
]];
data
.
value
=
[...
data
.
value
,[
response
.
data
]];
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
// TODO 错误异常处理
// TODO 错误异常处理
...
@@ -608,9 +603,8 @@ export class GridControl extends MainControl {
...
@@ -608,9 +603,8 @@ export class GridControl extends MainControl {
*/
*/
public
useCustom
(
props
:
GridControlProps
)
{
public
useCustom
(
props
:
GridControlProps
)
{
const
{
controlName
,
selectFirstDefault
,
rowEditState
,
rowActiveMode
}
=
this
.
controlState
;
const
{
controlName
,
selectFirstDefault
,
rowEditState
,
rowActiveMode
}
=
this
.
controlState
;
const
selectedRowKeysRef
=
toRef
(
this
.
controlState
,
"selectedRowKeys"
);
const
{
selectedRowKeys
,
gridPaging
}
=
toRefs
(
this
.
controlState
);
const
gridPagingRef
=
toRef
(
this
.
controlState
,
"gridPaging"
);
let
{
current
,
pageSize
}
=
gridPaging
.
value
;
let
{
current
,
pageSize
}
=
gridPagingRef
.
value
;
// 滚动条配置
// 滚动条配置
const
scrollOption
=
computed
(()
=>
{
const
scrollOption
=
computed
(()
=>
{
return
{
return
{
...
@@ -632,7 +626,7 @@ export class GridControl extends MainControl {
...
@@ -632,7 +626,7 @@ export class GridControl extends MainControl {
return
{
return
{
onClick
:
()
=>
{
onClick
:
()
=>
{
if
(
!
rowEditState
)
{
if
(
!
rowEditState
)
{
selectedRowKeys
Ref
.
value
=
[
record
.
srfkey
];
selectedRowKeys
.
value
=
[
record
.
srfkey
];
if
(
!
record
.
children
)
{
if
(
!
record
.
children
)
{
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
[
deepCopy
(
record
)]
})
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
[
deepCopy
(
record
)]
})
if
(
Object
.
is
(
rowActiveMode
,
1
))
{
if
(
Object
.
is
(
rowActiveMode
,
1
))
{
...
@@ -655,10 +649,10 @@ export class GridControl extends MainControl {
...
@@ -655,10 +649,10 @@ export class GridControl extends MainControl {
}
}
return
{
return
{
columnWidth
:
90
,
columnWidth
:
90
,
selectedRowKeys
:
selectedRowKeys
Ref
.
value
,
selectedRowKeys
:
selectedRowKeys
.
value
,
checkStrictly
:
props
.
multiple
?
false
:
true
,
checkStrictly
:
props
.
multiple
?
false
:
true
,
onChange
:
(
selectedRowKeys
:
string
[],
selectedRows
:
IParam
[])
=>
{
onChange
:
(
_
selectedRowKeys
:
string
[],
selectedRows
:
IParam
[])
=>
{
selectedRowKeys
Ref
.
value
=
selectedRowKeys
;
selectedRowKeys
.
value
=
_
selectedRowKeys
;
const
selection
:
IParam
[]
=
[];
const
selection
:
IParam
[]
=
[];
selectedRows
.
forEach
((
select
:
IParam
)
=>
{
selectedRows
.
forEach
((
select
:
IParam
)
=>
{
if
(
!
select
.
children
)
{
if
(
!
select
.
children
)
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
浏览文件 @
173b6c8f
...
@@ -52,11 +52,11 @@ export const CtrlConfig = {
...
@@ -52,11 +52,11 @@ export const CtrlConfig = {
controlName: '
{{
ctrl
.
name
}}
',
controlName: '
{{
ctrl
.
name
}}
',
controlService: new EditFormService
<ControlVO>
(ControlVO, new
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service() ),
controlService: new EditFormService
<ControlVO>
(ControlVO, new
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service() ),
data: new ControlVO({}),
data: new ControlVO({}),
formDetails:
[
formDetails:
{
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
FormPage
.
psDEFormDetails
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
FormPage
.
psDEFormDetails
}}
{{/
each
}}
{{/
each
}}
]
,
}
,
rules: {
rules: {
{{#
each
ctrl
.
psDEFormEditItemVRs
as
|
ruleItem
|
}}
{{#
each
ctrl
.
psDEFormEditItemVRs
as
|
ruleItem
|
}}
{{#
neq
ruleItem
2
}}
{{#
neq
ruleItem
2
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录