Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
dbdcceba
提交
dbdcceba
编写于
2月 11, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
2e1570c5
d126eec2
变更
13
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
294 行增加
和
72 行删除
+294
-72
service-delogic-method.hbs
...mpl/r7/@macro/front-end/entity/service-delogic-method.hbs
+26
-0
service-remote-method.hbs
...empl/r7/@macro/front-end/entity/service-remote-method.hbs
+44
-44
service-script-method.hbs
...empl/r7/@macro/front-end/entity/service-script-method.hbs
+19
-0
grid-column-model.hbs
...macro/front-end/widgets/grid-detail/grid-column-model.hbs
+28
-0
{{appEntities}}-service-base.ts.hbs
...c/api/{{appEntities}}/{{appEntities}}-service-base.ts.hbs
+18
-6
app-dropdown-list.vue
...app_{{apps}}/src/components/editors/app-dropdown-list.vue
+2
-5
app-sys-action.ts
...p_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
+9
-9
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+80
-6
grid-service.ts
...{{apps}}/src/core/service/control-service/grid-service.ts
+20
-0
app-grid.scss
...ces/templ/r7/app_{{apps}}/src/style/widgets/app-grid.scss
+18
-0
app-menu.scss
...ces/templ/r7/app_{{apps}}/src/style/widgets/app-menu.scss
+1
-0
index.scss
...ources/templ/r7/app_{{apps}}/src/style/widgets/index.scss
+2
-1
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+27
-1
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/entity/service-delogic-method.hbs
0 → 100644
浏览文件 @
dbdcceba
/**
*
{{
singleAppMethod
.
codeName
}}
*
* @param {IContext} [context={}]
* @param {IParam} [data = {}]
* @returns {Promise
<any>
}
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
*/
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
try {
// data = await this.executeAppDELogic('
{{
singleAppMethod
.
psDEAction
.
psDELogic
.
codeName
}}
', context, data);
const res = {
ok: true,
status: 200,
data: data
};
return res;
} catch (error: any) {
const res = {
ok: false,
status: 500,
message: error?.message
}
return res;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/entity/service-remote-method.hbs
浏览文件 @
dbdcceba
/**
/**
*
{{
singleAppMethod
.
codeName
}}
*
{{
singleAppMethod
.
codeName
}}
*
*
* @param {IContext} [context={}]
* @param {IContext} [context={}]
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* @returns {Promise
<any>
}
* @returns {Promise
<any>
}
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
*/
*/
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
{{! 方法路径是否带资源主键 }}
{{! 方法路径是否带资源主键 }}
const deResPath = this.buildDeResPath(context,
{{
singleAppMethod
.
psDEServiceAPIMethod
.
needResourceKey
}}
);
const deResPath = this.buildDeResPath(context,
{{
singleAppMethod
.
psDEServiceAPIMethod
.
needResourceKey
}}
);
{{#if
(
eq
singleAppMethod
.
methodType
"SELECT"
)
}}
{{#if
(
eq
singleAppMethod
.
methodType
"SELECT"
)
}}
...
@@ -45,4 +45,4 @@
...
@@ -45,4 +45,4 @@
this.afterExecuteAction(context,data,'
{{
singleAppMethod
.
codeName
}}
');
this.afterExecuteAction(context,data,'
{{
singleAppMethod
.
codeName
}}
');
{{/if}}
{{/if}}
return res;
return res;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/entity/service-script-method.hbs
0 → 100644
浏览文件 @
dbdcceba
/**
*
{{
singleAppMethod
.
codeName
}}
*
* @param {IContext} [context={}]
* @param {IParam} [data = {}]
* @returns {Promise
<any>
}
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
*/
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
{{#if
singleAppMethod
.
psDEAction
.
scriptCode
}}
eval(`
{{
singleAppMethod
.
psDEAction
.
scriptCode
}}
`);
{{/if}}
const res = {
ok: true,
status: 200,
data: data
}
return res;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column-model.hbs
浏览文件 @
dbdcceba
...
@@ -32,5 +32,33 @@
...
@@ -32,5 +32,33 @@
aggMode: "
{{
item
.
aggMode
}}
",
aggMode: "
{{
item
.
aggMode
}}
",
{{/if}}
{{/if}}
{{/
eq
}}
{{/
eq
}}
{{#if
item
.
enableRowEdit
}}
{{#
each
ctrl
.
psDEGridEditItems
as
|
editColumn
|
}}
{{#if
(
eq
editColumn
.
codeName
item
.
codeName
)
}}
{{#if
editColumn
.
resetItemName
}}
resetItemName: "
{{
editColumn
.
resetItemName
}}
",
{{/if}}
{{#if
editColumn
.
valueItemName
}}
valueItemName: "
{{
editColumn
.
valueItemName
}}
",
{{/if}}
{{#
each
ctrl
.
psDEGridEditItemUpdates
as
|
updateItem
|
}}
{{#if
(
eq
updateItem
.
codeName
editColumn
.
codeName
)
}}
updateItem: {
name: "
{{
updateItem
.
name
}}
",
codeName: "
{{
updateItem
.
codeName
}}
",
{{#if
updateItem
.
customCode
}}
customCode:
{{
updateItem
.
customCode
}}
,
scriptCode: `
{{
updateItem
.
scriptCode
}}
`,
{{else}}
showBusyIndicator:
{{
updateItem
.
showBusyIndicator
}}
,
appDEMethod: "
{{
updateItem
.
psAppDEMethod
.
id
}}
",
updateDetails: [
{{#
each
updateItem
.
psDEGEIUpdateDetails
as
|
updateDetails
|
}}
"
{{
updateDetails
.
name
}}
",
{{/
each
}}
],
{{/if}}
},
{{/if}}
{{/
each
}}
{{/if}}
{{/
each
}}
{{/if}}
},
},
{{/
unless
}}
{{/
unless
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/api/{{appEntities}}/{{appEntities}}-service-base.ts.hbs
浏览文件 @
dbdcceba
...
@@ -43,13 +43,25 @@ export class {{pascalCase appEntity.codeName}}ServiceBase extends EntityService
...
@@ -43,13 +43,25 @@ export class {{pascalCase appEntity.codeName}}ServiceBase extends EntityService
}
}
{{#
each
appEntity
.
allPSAppDEMethods
as
|
singleAppMethod
|
}}
{{#
each
appEntity
.
allPSAppDEMethods
as
|
singleAppMethod
|
}}
{{! 非内置行为才输出 }}
{{! 非内置行为和非临时数据方法才输出 }}
{{#if
(
eq
isBuiltinMethod
false
)
}}
{{#if
(
and
(
eq
builtinMethod
false
)
(
eq
tempDataMode
0
))
}}
{{! 存在接口方法才输出 }}
{{#if
(
eq
appEntity
.
psDEServiceAPI
.
nested
true
)
}}
{{#if
singleAppMethod
.
psDEServiceAPIMethod
}}
{{!-- todo嵌套行为补充 --}}
{{! 远端接口 }}
{{else}}
{{!-- todo 插件 --}}
{{#if
(
and
(
eq
methodType
'DEACTION'
)
psDEAction
(
eq
psDEAction
.
actionType
'DELOGIC'
))
}}
{{!-- 实体处理逻辑 --}}
{{>
@macro
/
front-end
/
entity
/
service-delogic-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{else
if
(
and
(
eq
methodType
'DEACTION'
)
psDEAction
(
eq
psDEAction
.
actionType
'SCRIPT'
))
}}
{{!-- 脚本代码 --}}
{{>
@macro
/
front-end
/
entity
/
service-script-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{else
if
(
and
singleAppMethod
.
psDEServiceAPIMethod
appEntity
.
major
)
}}
{{!-- 远程接口 --}}
{{>
@macro
/
front-end
/
entity
/
service-remote-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{>
@macro
/
front-end
/
entity
/
service-remote-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{/
each
}}
{{/
each
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/app-dropdown-list.vue
浏览文件 @
dbdcceba
...
@@ -56,7 +56,7 @@ interface DropdownListProps {
...
@@ -56,7 +56,7 @@ interface DropdownListProps {
/**
/**
* @description 代码表标识
* @description 代码表标识
*/
*/
codeListTag
?
:
string
;
codeListTag
:
string
;
/**
/**
* @description 代码表类型
* @description 代码表类型
...
@@ -81,10 +81,7 @@ const props = withDefaults(defineProps<DropdownListProps>(), {
...
@@ -81,10 +81,7 @@ const props = withDefaults(defineProps<DropdownListProps>(), {
const
emit
=
defineEmits
<
EditorEmit
>
()
const
emit
=
defineEmits
<
EditorEmit
>
()
const
{
handleEditorNavParams
,
loadCodeListData
}
=
new
EditorBase
();
const
{
handleEditorNavParams
,
loadCodeListData
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
curValue
:
Ref
<
any
>
=
ref
(
let
curValue
:
Ref
<
any
>
=
computed
(()
=>
props
.
multiple
?
props
.
value
?.
split
(
props
.
valueSeparator
)
:
props
.
value
);
props
.
multiple
?
props
.
value
?.
split
(
props
.
valueSeparator
)
:
props
.
value
);
let
items
:
Ref
<
IParam
[]
>
=
ref
([]);
let
items
:
Ref
<
IParam
[]
>
=
ref
([]);
const
onChange
=
(
select
:
any
,
option
:
any
)
=>
{
const
onChange
=
(
select
:
any
,
option
:
any
)
=>
{
const
value
=
typeOf
(
select
)
==
'array'
?
select
.
join
(
props
.
valueSeparator
)
:
select
;
const
value
=
typeOf
(
select
)
==
'array'
?
select
.
join
(
props
.
valueSeparator
)
:
select
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
浏览文件 @
dbdcceba
...
@@ -204,7 +204,7 @@ export class AppSysAction {
...
@@ -204,7 +204,7 @@ export class AppSysAction {
public
static
newRow
(
params
:
IUIActionParams
)
{
public
static
newRow
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"newRow"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"newRow"
))
{
actionEnvironment
.
xDataControl
.
newRow
();
actionEnvironment
.
xDataControl
.
newRow
();
}
else
if
(
isExist
(
actionEnvironment
.
newRow
))
{
}
else
if
(
isExist
(
actionEnvironment
.
newRow
))
{
actionEnvironment
.
newRow
();
actionEnvironment
.
newRow
();
...
@@ -220,7 +220,7 @@ export class AppSysAction {
...
@@ -220,7 +220,7 @@ export class AppSysAction {
public
static
save
(
params
:
IUIActionParams
)
{
public
static
save
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
actionEnvironment
.
xDataControl
.
save
();
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
actionEnvironment
.
save
();
actionEnvironment
.
save
();
...
@@ -236,7 +236,7 @@ export class AppSysAction {
...
@@ -236,7 +236,7 @@ export class AppSysAction {
public
static
saveRow
(
params
:
IUIActionParams
)
{
public
static
saveRow
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
actionEnvironment
.
xDataControl
.
save
();
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
actionEnvironment
.
save
();
actionEnvironment
.
save
();
...
@@ -252,10 +252,10 @@ export class AppSysAction {
...
@@ -252,10 +252,10 @@ export class AppSysAction {
public
static
remove
(
params
:
IUIActionParams
)
{
public
static
remove
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
,
data
}
=
params
;
const
{
actionEnvironment
,
data
}
=
params
;
// 视图里获取多数据部件
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
actionEnvironment
.
xDataControl
.
remove
(
data
);
actionEnvironment
.
xDataControl
.
remove
(
data
);
}
else
if
(
isExist
(
actionEnvironment
.
remove
))
{
}
else
if
(
isExist
(
actionEnvironment
.
remove
))
{
actionEnvironment
.
remove
();
actionEnvironment
.
remove
(
data
);
}
}
}
}
...
@@ -268,7 +268,7 @@ export class AppSysAction {
...
@@ -268,7 +268,7 @@ export class AppSysAction {
public
static
refresh
(
params
:
IUIActionParams
)
{
public
static
refresh
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"refresh"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"refresh"
))
{
actionEnvironment
.
xDataControl
.
refresh
();
actionEnvironment
.
xDataControl
.
refresh
();
}
else
if
(
isExist
(
actionEnvironment
.
refresh
))
{
}
else
if
(
isExist
(
actionEnvironment
.
refresh
))
{
actionEnvironment
.
refresh
();
actionEnvironment
.
refresh
();
...
@@ -296,7 +296,7 @@ export class AppSysAction {
...
@@ -296,7 +296,7 @@ export class AppSysAction {
*/
*/
public
static
async
saveAndExit
(
params
:
IUIActionParams
)
{
public
static
async
saveAndExit
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
await
actionEnvironment
.
xDataControl
.
save
();
await
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
await
actionEnvironment
.
save
();
await
actionEnvironment
.
save
();
...
@@ -314,7 +314,7 @@ export class AppSysAction {
...
@@ -314,7 +314,7 @@ export class AppSysAction {
*/
*/
public
static
async
saveAndNew
(
params
:
IUIActionParams
)
{
public
static
async
saveAndNew
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
await
actionEnvironment
.
xDataControl
.
save
();
await
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
await
actionEnvironment
.
save
();
await
actionEnvironment
.
save
();
...
@@ -338,7 +338,7 @@ export class AppSysAction {
...
@@ -338,7 +338,7 @@ export class AppSysAction {
public
static
async
removeAndExit
(
params
:
IUIActionParams
)
{
public
static
async
removeAndExit
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
await
actionEnvironment
.
xDataControl
.
remove
();
await
actionEnvironment
.
xDataControl
.
remove
();
}
else
if
(
isExist
(
actionEnvironment
.
remove
))
{
}
else
if
(
isExist
(
actionEnvironment
.
remove
))
{
await
actionEnvironment
.
remove
();
await
actionEnvironment
.
remove
();
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
dbdcceba
...
@@ -133,6 +133,9 @@ export class GridControl extends MDControl {
...
@@ -133,6 +133,9 @@ export class GridControl extends MDControl {
if
(
pagination
)
{
if
(
pagination
)
{
this
.
load
();
this
.
load
();
}
}
if
(
sorter
)
{
this
.
load
({
sort
:
`
${
sorter
.
field
}
,
${
sorter
.
order
==
'descend'
?
'desc'
:
'asc'
}
`
});
}
}
}
return
{
return
{
useScrollOption
,
useScrollOption
,
...
@@ -154,18 +157,51 @@ export class GridControl extends MDControl {
...
@@ -154,18 +157,51 @@ export class GridControl extends MDControl {
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
tag
,
action
,
data
}
=
actionParam
;
switch
(
action
)
{
switch
(
action
)
{
case
"valueChange"
:
case
"valueChange"
:
this
.
handleGridItemValueChange
(
rowIndex
,
tag
,
data
);
break
;
default
:
break
;
}
}
/**
* @description 表格项值改变
* @param {*} data
* @param {number} rowIndex
* @param {string} tag
* @memberof GridControl
*/
public
handleGridItemValueChange
(
rowIndex
:
number
,
tag
:
string
,
data
:
any
)
{
const
{
items
}
=
toRefs
(
this
.
state
);
const
{
items
}
=
toRefs
(
this
.
state
);
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
.
resetGridData
(
tag
,
data
,
rowIndex
);
this
.
validateField
(
tag
,
data
,
rowIndex
);
this
.
validateField
(
tag
,
data
,
rowIndex
);
}
this
.
updateGridEditItem
(
tag
,
data
,
rowIndex
);
break
;
default
:
break
;
}
}
}
}
/**
* @description 重置表格数据
* @param {string} name
* @param {*} data
* @param {number} rowIndex
* @memberof GridControl
*/
public
resetGridData
(
name
:
string
,
data
:
any
,
rowIndex
:
number
)
{
const
{
columnsModel
}
=
this
.
state
;
if
(
columnsModel
&&
columnsModel
.
length
>
0
)
{
columnsModel
.
forEach
((
column
:
any
)
=>
{
if
(
column
.
resetItemName
&&
Object
.
is
(
name
,
column
.
resetItemName
))
{
this
.
handleGridItemValueChange
(
rowIndex
,
column
.
dataIndex
,
null
);
if
(
column
.
valueItemName
)
{
this
.
handleGridItemValueChange
(
rowIndex
,
column
.
valueItemName
,
null
);
}
}
})
}
}
/**
/**
*
*
...
@@ -192,6 +228,44 @@ export class GridControl extends MDControl {
...
@@ -192,6 +228,44 @@ export class GridControl extends MDControl {
})
})
}
}
/**
* @description 更新表格编辑项
* @param {string} name
* @param {*} data
* @param {number} rowIndex
* @memberof GridControl
*/
public
async
updateGridEditItem
(
name
:
string
,
data
:
any
,
rowIndex
:
number
)
{
const
{
items
,
columnsModel
,
context
,
viewParams
,
controlService
,
appDeCodeName
,
appDeKeyFieldName
}
=
this
.
state
;
if
(
columnsModel
&&
columnsModel
.
length
>
0
)
{
columnsModel
.
forEach
(
async
(
column
:
any
)
=>
{
if
(
column
.
updateItem
)
{
const
updateItem
:
any
=
column
.
updateItem
;
if
(
updateItem
.
customCode
)
{
if
(
updateItem
.
scriptCode
)
{
eval
(
updateItem
.
scriptCode
);
}
}
else
{
const
arg
=
Object
.
assign
(
deepCopy
(
viewParams
),
items
[
rowIndex
]);
const
tempContext
=
Object
.
assign
(
deepCopy
(
context
),
{
[
appDeCodeName
?.
toLowerCase
()]:
items
[
rowIndex
][
appDeKeyFieldName
]
||
items
[
rowIndex
].
srfkey
});
const
response
=
await
controlService
.
frontLogic
(
tempContext
,
{
viewParams
:
arg
},
{
action
:
updateItem
.
appDEMethod
,
isLoading
:
updateItem
.
showBusyIndicator
},
);
if
(
response
.
status
&&
response
.
status
==
200
)
{
updateItem
.
updateDetails
?.
forEach
((
detailName
:
string
)
=>
{
if
(
detailName
&&
items
[
rowIndex
].
hasOwnProperty
(
detailName
))
{
items
[
rowIndex
][
detailName
]
=
response
.
data
[
detailName
];
}
});
}
}
}
})
}
}
/**
/**
* @description 操作列事件触发
* @description 操作列事件触发
* @param {IActionParam} actionParam
* @param {IActionParam} actionParam
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/control-service/grid-service.ts
浏览文件 @
dbdcceba
...
@@ -98,4 +98,24 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
...
@@ -98,4 +98,24 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
response
.
data
=
this
.
newControlVO
(
response
.
data
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
return
this
.
handleResponse
(
response
,
opts
);
}
}
/**
* 前台逻辑
*
* @param [context={}] 上下文参数
* @param [data={}] 视图参数
* @param opts
* @return {*}
*/
public
async
frontLogic
(
context
:
any
,
data
:
any
,
opts
:
{
action
:
string
;
isLoading
?:
boolean
}):
Promise
<
any
>
{
let
_entityService
:
any
=
this
.
entityService
;
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
if
(
hasFunction
(
_entityService
,
opts
.
action
))
{
const
response
=
await
_entityService
[
opts
.
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
else
{
return
null
;
}
}
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/widgets/app-grid.scss
0 → 100644
浏览文件 @
dbdcceba
.app-grid-batchtoolbar-container
{
display
:
flex
;
height
:
100%
;
}
.app-grid-batchtoolbar
{
position
:
absolute
;
left
:
0
;
.toolbar-buttons
{
height
:
100%
;
}
}
.app-grid-batchtoolbar.toolbar
.toolbar-buttons
.ant-space-item
{
padding
:
0
6px
;
height
:
100%
;
&
:first-child
{
padding-left
:
0
;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/widgets/app-menu.scss
浏览文件 @
dbdcceba
...
@@ -8,5 +8,6 @@
...
@@ -8,5 +8,6 @@
}
}
.ant-card-body
{
.ant-card-body
{
text-align
:
left
;
text-align
:
left
;
padding
:
16px
;
}
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/style/widgets/index.scss
浏览文件 @
dbdcceba
...
@@ -5,3 +5,4 @@
...
@@ -5,3 +5,4 @@
@use
'./app-tab-exp-panel.scss'
;
@use
'./app-tab-exp-panel.scss'
;
@use
'./app-tab-view-panel.scss'
;
@use
'./app-tab-view-panel.scss'
;
@use
'./app-portlet.scss'
;
@use
'./app-portlet.scss'
;
@use
'./app-grid.scss'
;
\ 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
浏览文件 @
dbdcceba
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
}}
<script
setup
lang=
"ts"
>
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
Subject
}
from
'rxjs'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-grid-state'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-grid-state'
;
import
{
GridControl
,
IActionParam
,
IParam
,
IContext
,
ControlAction
,
deepCopy
}
from
'@core'
;
import
{
GridControl
,
IActionParam
,
IParam
,
IContext
,
ControlAction
,
deepCopy
}
from
'@core'
;
{{#if
ctrl
.
batchToolBarItems
}}
import
AppToolbar
from
'@components/common/app-toolbar.vue'
;
{{/if}}
interface
Props
{
interface
Props
{
name
:
string
,
name
:
string
,
...
@@ -39,6 +41,22 @@ const emit = defineEmits<CtrlEmit>();
...
@@ -39,6 +41,22 @@ const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
// 安装功能模块,提供状态和能力
const
{
name
,
state
,
useCustom
,
onEditorEvent
,
onToolbarEvent
,
onActionColEvent
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
}
=
new
GridControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
name
,
state
,
useCustom
,
onEditorEvent
,
onToolbarEvent
,
onActionColEvent
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
}
=
new
GridControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
useScrollOption
,
useRowKey
,
useRowClassName
,
useCustomRow
,
useRowSelectionOption
,
onResizeColumn
,
onGridChange
}
=
useCustom
;
const
{
useScrollOption
,
useRowKey
,
useRowClassName
,
useCustomRow
,
useRowSelectionOption
,
onResizeColumn
,
onGridChange
}
=
useCustom
;
{{#if
ctrl
.
batchToolBarItems
}}
const
renderBatchToolbar
=
(
total
:
number
,
range
:
IParam
[])
=>
{
return
(
h
(
'div'
,
{
class
:
'app-grid-batchtoolbar-container'
},
[
h
(
AppToolbar
,
{
mode
:
'button'
,
class
:
'app-grid-batchtoolbar'
,
name
:
'
{{
ctrl
.
batchToolBarName
}}
'
,
actionModel
:
state
.
batchToolbar
,
onOnToolbarEvent
:
(
event
:
any
)
=>
onToolbarEvent
(
event
)
}),
`显示
${
range
[
0
]}
-
${
range
[
1
]}
条数据,共
${
total
}
条数据`
])
)
}
{{/if}}
// 暴露内部状态及能力
// 暴露内部状态及能力
defineExpose
({
name
,
state
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
});
defineExpose
({
name
,
state
,
newRow
,
remove
,
save
,
load
,
refresh
,
getData
});
...
@@ -56,7 +74,15 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
...
@@ -56,7 +74,15 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
:data-source=
"state.items"
:data-source=
"state.items"
:row-selection=
"useRowSelectionOption"
:row-selection=
"useRowSelectionOption"
:columns=
"state.columnsModel"
:columns=
"state.columnsModel"
{{#if
ctrl
.
batchToolBarItems
}}
:pagination=
"Object.assign(state.mdCtrlPaging.pagination, {
showTotal: (total, range) => {
return renderBatchToolbar(total, range);
}
})"
{{else}}
:pagination=
"state.mdCtrlPaging.pagination"
:pagination=
"state.mdCtrlPaging.pagination"
{{/if}}
:customRow=
"useCustomRow"
:customRow=
"useCustomRow"
:rowClassName=
"useRowClassName"
:rowClassName=
"useRowClassName"
@
change=
"onGridChange"
@
change=
"onGridChange"
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录