Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
3213cdbd
提交
3213cdbd
编写于
12月 31, 2021
作者:
WodahsOrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:表单部件服务
上级
c85b0f53
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
42 行增加
和
33 行删除
+42
-33
edit-form-service.ts
...rc/ibiz-core/service/control-service/edit-form-service.ts
+42
-33
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/service/control-service/edit-form-service.ts
浏览文件 @
3213cdbd
import
{
ControlServiceBase
,
ControlVOBase
,
hasFunction
}
from
'@ibiz-core'
;
import
{
createUUID
}
from
'qx-util'
;
/**
* 表单部件服务
*
* @export
* @class EditFormService
* @template T 部件数据对象类型
*/
export
class
EditFormService
<
T
extends
ControlVOBase
>
extends
ControlServiceBase
<
T
>
{
/**
* 加载草稿数据
*
...
...
@@ -12,14 +17,15 @@ export class EditFormService<T extends ControlVOBase> extends ControlServiceBase
* @return {*}
*/
public
async
loadDraft
(
context
:
any
,
data
:
any
,
opts
:
{
action
:
string
;
isLoading
?:
boolean
}):
Promise
<
any
>
{
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
// todo主键
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'GetDraft'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
// this.setRemoteCopyData(response);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
response
.
data
.
srfuf
=
"0"
;
return
this
.
handleResponse
(
response
,
opts
);
let
_entityService
:
any
=
this
.
entityService
;
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
// todo主键
const
action
=
hasFunction
(
_entityService
,
opts
.
action
)
?
opts
.
action
:
'GetDraft'
;
const
response
=
await
_entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
// this.setRemoteCopyData(response);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
response
.
data
.
srfuf
=
'0'
;
return
this
.
handleResponse
(
response
,
opts
);
}
/**
...
...
@@ -31,12 +37,13 @@ export class EditFormService<T extends ControlVOBase> extends ControlServiceBase
* @return {*}
*/
public
async
get
(
context
:
any
,
data
:
any
,
opts
:
{
action
:
string
;
isLoading
?:
boolean
}):
Promise
<
any
>
{
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'GET'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
// this.setRemoteCopyData(response);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
let
_entityService
:
any
=
this
.
entityService
;
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
_entityService
,
opts
.
action
)
?
opts
.
action
:
'GET'
;
const
response
=
await
_entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
// this.setRemoteCopyData(response);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
/**
...
...
@@ -48,11 +55,12 @@ export class EditFormService<T extends ControlVOBase> extends ControlServiceBase
* @return {*}
*/
public
async
create
(
context
:
any
,
data
:
any
,
opts
:
{
action
:
string
;
isLoading
?:
boolean
}):
Promise
<
any
>
{
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'Create'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
let
_entityService
:
any
=
this
.
entityService
;
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
_entityService
,
opts
.
action
)
?
opts
.
action
:
'Create'
;
const
response
=
await
_entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
/**
...
...
@@ -64,11 +72,12 @@ export class EditFormService<T extends ControlVOBase> extends ControlServiceBase
* @return {*}
*/
public
async
remove
(
context
:
any
,
data
:
any
,
opts
:
{
action
:
string
;
isLoading
?:
boolean
}):
Promise
<
any
>
{
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'Remove'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
let
_entityService
:
any
=
this
.
entityService
;
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
_entityService
,
opts
.
action
)
?
opts
.
action
:
'Remove'
;
const
response
=
await
_entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
/**
...
...
@@ -80,11 +89,11 @@ export class EditFormService<T extends ControlVOBase> extends ControlServiceBase
* @return {*}
*/
public
async
update
(
context
:
any
,
data
:
any
,
opts
:
{
action
:
string
;
isLoading
?:
boolean
}):
Promise
<
any
>
{
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'Update'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
let
_entityService
:
any
=
this
.
entityService
;
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
_entityService
,
opts
.
action
)
?
opts
.
action
:
'Update'
;
const
response
=
await
_entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response
.
data
=
this
.
newControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录