Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
d04cdb6e
提交
d04cdb6e
编写于
7月 25, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整服务基类
上级
16103e93
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
46 行删除
+4
-46
counter-service-base.ts
src/ibiz-core/counter/counter-service-base.ts
+1
-22
entity-service-base.ts
src/ibiz-core/service/entity-service-base.ts
+3
-24
未找到文件。
src/ibiz-core/counter/counter-service-base.ts
浏览文件 @
d04cdb6e
import
{
Store
}
from
'vuex'
;
/**
/**
* 计数器服务基类
* 计数器服务基类
*
*
...
@@ -8,15 +6,6 @@ import { Store } from 'vuex';
...
@@ -8,15 +6,6 @@ import { Store } from 'vuex';
*/
*/
export
class
CounterService
{
export
class
CounterService
{
/**
* Vue 状态管理器
*
* @private
* @type {(any | null)}
* @memberof CounterService
*/
private
$store
:
Store
<
any
>
|
null
=
null
;
/**
/**
* Creates an instance of CounterService.
* Creates an instance of CounterService.
*
*
...
@@ -24,17 +13,7 @@ export class CounterService {
...
@@ -24,17 +13,7 @@ export class CounterService {
* @memberof CounterService
* @memberof CounterService
*/
*/
constructor
(
opts
:
any
=
{})
{
constructor
(
opts
:
any
=
{})
{
this
.
$store
=
opts
.
$store
;
}
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof CounterService
*/
public
getStore
():
Store
<
any
>
|
null
{
return
this
.
$store
;
}
}
/**
/**
...
@@ -46,7 +25,7 @@ export class CounterService {
...
@@ -46,7 +25,7 @@ export class CounterService {
* @memberof CounterService
* @memberof CounterService
*/
*/
public
getService
(
name
:
string
):
Promise
<
any
>
{
public
getService
(
name
:
string
):
Promise
<
any
>
{
return
(
window
as
any
)[
'counterServiceRegister'
]
.
getService
(
name
);
return
window
.
counterServiceConstructor
.
getService
(
name
);
}
}
...
...
src/ibiz-core/service/entity-service-base.ts
浏览文件 @
d04cdb6e
import
{
Store
}
from
'vuex'
;
import
{
Http
}
from
'../utils'
;
import
{
Http
}
from
'../utils'
;
import
{
CodeListService
}
from
"@/ibiz-core"
;
import
{
CodeListService
}
from
"@/ibiz-core"
;
...
@@ -10,15 +9,6 @@ import { CodeListService } from "@/ibiz-core";
...
@@ -10,15 +9,6 @@ import { CodeListService } from "@/ibiz-core";
*/
*/
export
class
EntityService
{
export
class
EntityService
{
/**
* Vue 状态管理器
*
* @private
* @type {(any | null)}
* @memberof EntityService
*/
private
$store
:
Store
<
any
>
|
null
=
null
;
/**
/**
* 获取实体数据服务
* 获取实体数据服务
*
*
...
@@ -101,31 +91,20 @@ export class EntityService {
...
@@ -101,31 +91,20 @@ export class EntityService {
* @memberof EntityService
* @memberof EntityService
*/
*/
constructor
(
opts
:
any
=
{})
{
constructor
(
opts
:
any
=
{})
{
this
.
$store
=
opts
.
$store
;
this
.
tempStorage
=
localStorage
;
this
.
tempStorage
=
localStorage
;
this
.
initBasicData
();
this
.
initBasicData
();
}
}
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof EntityService
*/
public
getStore
():
Store
<
any
>
|
null
{
return
this
.
$store
;
}
/**
/**
* 获取代码表
* 获取代码表
*
*
* @memberof EntityService
* @memberof EntityService
*/
*/
public
getCodeList
(
tag
:
string
,
codelistType
:
string
,
context
:
any
=
{},
param
:
any
=
{}){
public
getCodeList
(
tag
:
string
,
codelistType
:
string
,
context
:
any
=
{},
param
:
any
=
{}
,
store
:
any
){
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
if
(
tag
&&
Object
.
is
(
codelistType
,
"STATIC"
)){
if
(
tag
&&
Object
.
is
(
codelistType
,
"STATIC"
)){
let
returnItems
:
Array
<
any
>
=
[];
let
returnItems
:
Array
<
any
>
=
[];
const
codelist
=
(
this
.
getStore
()
as
Store
<
any
>
)
.
getters
.
getCodeList
(
tag
);
const
codelist
=
store
.
getters
.
getCodeList
(
tag
);
if
(
codelist
)
{
if
(
codelist
)
{
returnItems
=
[...
JSON
.
parse
(
JSON
.
stringify
(
codelist
.
items
))];
returnItems
=
[...
JSON
.
parse
(
JSON
.
stringify
(
codelist
.
items
))];
}
else
{
}
else
{
...
@@ -133,7 +112,7 @@ export class EntityService {
...
@@ -133,7 +112,7 @@ export class EntityService {
}
}
resolve
(
returnItems
);
resolve
(
returnItems
);
}
else
if
(
tag
&&
Object
.
is
(
codelistType
,
"DYNAMIC"
)){
}
else
if
(
tag
&&
Object
.
is
(
codelistType
,
"DYNAMIC"
)){
let
codeListService
=
new
CodeListService
({
$store
:
this
.
$
store
});
let
codeListService
=
new
CodeListService
({
$store
:
store
});
codeListService
.
getItems
(
tag
,
context
,
param
).
then
((
res
:
any
)
=>
{
codeListService
.
getItems
(
tag
,
context
,
param
).
then
((
res
:
any
)
=>
{
resolve
(
res
);
resolve
(
res
);
}).
catch
((
error
:
any
)
=>
{
}).
catch
((
error
:
any
)
=>
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录