Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
功
功能演示系统
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
示例
功能演示系统
提交
83661177
提交
83661177
编写于
11月 10, 2022
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Mosher 发布系统代码 [后台服务,演示应用]
上级
331fba47
变更
41
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
41 个修改的文件
包含
2779 行增加
和
1531 行删除
+2779
-1531
ctrl-amount-list-base.vue
...ts/ibizappctrl/ctrl-amount-list/ctrl-amount-list-base.vue
+81
-44
ctrl-list-list-base.vue
...idgets/ibizappctrl/ctrl-list-list/ctrl-list-list-base.vue
+81
-44
editor-amount-list-base.vue
...zappeditor/editor-amount-list/editor-amount-list-base.vue
+81
-44
editor-list-list-base.vue
.../ibizappeditor/editor-list-list/editor-list-list-base.vue
+81
-44
extend-editor-amount-list-base.vue
...end-editor-amount-list/extend-editor-amount-list-base.vue
+81
-44
extend-editor-list-list-base.vue
.../extend-editor-list-list/extend-editor-list-list-base.vue
+81
-44
view-amount-list-base.vue
...ts/ibizappview/view-amount-list/view-amount-list-base.vue
+81
-44
view-list-list-base.vue
...idgets/ibizappview/view-list-list/view-list-list-base.vue
+81
-44
auto-group-list-list-base.vue
...izbook/auto-group-list-list/auto-group-list-list-base.vue
+82
-45
booklist-list-base.vue
...src/widgets/ibizbook/booklist-list/booklist-list-base.vue
+81
-44
group-by-codelist-list-list-base.vue
...y-codelist-list-list/group-by-codelist-list-list-base.vue
+82
-45
has-panel-list-list-base.vue
...ibizbook/has-panel-list-list/has-panel-list-list-base.vue
+81
-44
listpanel-list-base.vue
...c/widgets/ibizbook/listpanel-list/listpanel-list-base.vue
+81
-44
listpanel-list-model.ts
...c/widgets/ibizbook/listpanel-list/listpanel-list-model.ts
+20
-20
listpanel-panel-base.vue
...widgets/ibizbook/listpanel-panel/listpanel-panel-base.vue
+4
-4
lnternal-func-list-list-base.vue
.../lnternal-func-list-list/lnternal-func-list-list-base.vue
+81
-44
major-state-list-list-base.vue
...book/major-state-list-list/major-state-list-list-base.vue
+81
-44
tree-major-state-treeview-base.vue
...e-major-state-treeview/tree-major-state-treeview-base.vue
+100
-49
tree-view-treeview-base.vue
...s/ibizbook/tree-view-treeview/tree-view-treeview-base.vue
+100
-49
usr-list-base.vue
app_Web/src/widgets/ibizbook/usr-list/usr-list-base.vue
+81
-44
usr-treeview-base.vue
...c/widgets/ibizcustomer/usr-treeview/usr-treeview-base.vue
+100
-49
order-details-list-list-base.vue
.../order-details-list-list/order-details-list-list-base.vue
+81
-44
order-details-money-list-base.vue
...rder-details-money-list/order-details-money-list-base.vue
+81
-44
order-details-total-list-base.vue
...rder-details-total-list/order-details-total-list-base.vue
+81
-44
order-details-type-list-base.vue
.../order-details-type-list/order-details-type-list-base.vue
+81
-44
card-navigation-dataview-base.vue
...ard-navigation-dataview/card-navigation-dataview-base.vue
+4
-4
list-exp-list-base.vue
...rc/widgets/ibizorder/list-exp-list/list-exp-list-base.vue
+81
-44
main-grid-base.vue
app_Web/src/widgets/ibizorder/main-grid/main-grid-base.vue
+21
-7
main-grid-model.ts
app_Web/src/widgets/ibizorder/main-grid/main-grid-model.ts
+15
-0
tree-exp-treeview-base.vue
...ts/ibizorder/tree-exp-treeview/tree-exp-treeview-base.vue
+100
-49
usr-list-base.vue
app_Web/src/widgets/ibizorder/usr-list/usr-list-base.vue
+81
-44
tree01-treeview-base.vue
...s/ibizsample0003/tree01-treeview/tree01-treeview-base.vue
+100
-49
tree02-treeview-base.vue
...s/ibizsample0003/tree02-treeview/tree02-treeview-base.vue
+100
-49
tree03-treeview-base.vue
...s/ibizsample0003/tree03-treeview/tree03-treeview-base.vue
+100
-49
tree04-treeview-base.vue
...s/ibizsample0003/tree04-treeview/tree04-treeview-base.vue
+100
-49
Usr.json
...SSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK/PSGANTTS/Usr.json
+20
-20
Listpanel.json
...PPS/Web/PSAPPDATAENTITIES/IBIZBOOK/PSLISTS/Listpanel.json
+39
-40
Listpanel.json
...PS/Web/PSAPPDATAENTITIES/IBIZBOOK/PSPANELS/Listpanel.json
+12
-13
IBIZBOOKGanttView.json
...temodel/PSSYSAPPS/Web/PSAPPDEVIEWS/IBIZBOOKGanttView.json
+20
-20
IBIZBOOKUsr5ListView.json
...odel/PSSYSAPPS/Web/PSAPPDEVIEWS/IBIZBOOKUsr5ListView.json
+39
-40
h2_table.xml
demo-core/src/main/resources/liquibase/h2_table.xml
+1
-1
未找到文件。
app_Web/src/widgets/ibizappctrl/ctrl-amount-list/ctrl-amount-list-base.vue
浏览文件 @
83661177
...
...
@@ -514,7 +514,7 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof CtrlAmountBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'AppPortalView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -533,17 +533,27 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -577,12 +587,16 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -657,46 +671,55 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappctrl
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappctrl
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappctrl
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappctrl
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -723,6 +746,9 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -753,8 +779,14 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -809,13 +841,18 @@ export default class CtrlAmountBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappctrl/ctrl-list-list/ctrl-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -576,7 +576,7 @@ export default class CtrlListBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof CtrlListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZAPPCTRLListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -595,17 +595,27 @@ export default class CtrlListBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -639,12 +649,16 @@ export default class CtrlListBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -719,46 +733,55 @@ export default class CtrlListBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappctrl
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappctrl
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappctrl
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappctrl
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -785,6 +808,9 @@ export default class CtrlListBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -815,8 +841,14 @@ export default class CtrlListBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -871,13 +903,18 @@ export default class CtrlListBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappeditor/editor-amount-list/editor-amount-list-base.vue
浏览文件 @
83661177
...
...
@@ -514,7 +514,7 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof EditorAmountBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'AppPortalView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -533,17 +533,27 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -577,12 +587,16 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -657,46 +671,55 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -723,6 +746,9 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -753,8 +779,14 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -809,13 +841,18 @@ export default class EditorAmountBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappeditor/editor-list-list/editor-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -576,7 +576,7 @@ export default class EditorListBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof EditorListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZAPPEDITORListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -595,17 +595,27 @@ export default class EditorListBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -639,12 +649,16 @@ export default class EditorListBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -719,46 +733,55 @@ export default class EditorListBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -785,6 +808,9 @@ export default class EditorListBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -815,8 +841,14 @@ export default class EditorListBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -871,13 +903,18 @@ export default class EditorListBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappextendeditor/extend-editor-amount-list/extend-editor-amount-list-base.vue
浏览文件 @
83661177
...
...
@@ -514,7 +514,7 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
* @param {*} [arg={}]
* @memberof ExtendEditorAmountBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'AppPortalView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -533,17 +533,27 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -577,12 +587,16 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -657,46 +671,55 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappextendeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappextendeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappextendeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappextendeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -723,6 +746,9 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -753,8 +779,14 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -809,13 +841,18 @@ export default class ExtendEditorAmountBase extends Vue implements ControlInterf
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappextendeditor/extend-editor-list-list/extend-editor-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -576,7 +576,7 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
* @param {*} [arg={}]
* @memberof ExtendEditorListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZAPPEXTENDEDITORListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -595,17 +595,27 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -639,12 +649,16 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -719,46 +733,55 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappextendeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappextendeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappextendeditor
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappextendeditor
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -785,6 +808,9 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -815,8 +841,14 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -871,13 +903,18 @@ export default class ExtendEditorListBase extends Vue implements ControlInterfac
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappview/view-amount-list/view-amount-list-base.vue
浏览文件 @
83661177
...
...
@@ -514,7 +514,7 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof ViewAmountBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'AppPortalView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -533,17 +533,27 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -577,12 +587,16 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -657,46 +671,55 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappview
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappview
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappview
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappview
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -723,6 +746,9 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -753,8 +779,14 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -809,13 +841,18 @@ export default class ViewAmountBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizappview/view-list-list/view-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -604,7 +604,7 @@ export default class ViewListBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof ViewListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZAPPVIEWListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -623,17 +623,27 @@ export default class ViewListBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -667,12 +677,16 @@ export default class ViewListBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -747,46 +761,55 @@ export default class ViewListBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappview
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappview
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizappview
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizappview
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -813,6 +836,9 @@ export default class ViewListBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -843,8 +869,14 @@ export default class ViewListBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -899,13 +931,18 @@ export default class ViewListBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/auto-group-list-list/auto-group-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -739,7 +739,7 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof AutoGroupListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKAutoGroupListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -758,17 +758,27 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -803,12 +813,16 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
}
}
this
.
group
();
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -883,47 +897,56 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
group
();
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
group
();
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -950,6 +973,9 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -980,8 +1006,14 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -1036,13 +1068,18 @@ export default class AutoGroupListBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/booklist-list/booklist-list-base.vue
浏览文件 @
83661177
...
...
@@ -534,7 +534,7 @@ export default class BooklistBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof BooklistBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKDashboardView_layout'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -553,17 +553,27 @@ export default class BooklistBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -597,12 +607,16 @@ export default class BooklistBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -677,46 +691,55 @@ export default class BooklistBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -743,6 +766,9 @@ export default class BooklistBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -773,8 +799,14 @@ export default class BooklistBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -829,13 +861,18 @@ export default class BooklistBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/group-by-codelist-list-list/group-by-codelist-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -670,7 +670,7 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
* @param {*} [arg={}]
* @memberof GroupByCodelistListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKGroupByCodelistListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -689,17 +689,27 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -734,12 +744,16 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
}
}
this
.
group
();
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -814,47 +828,56 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
group
();
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
group
();
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -881,6 +904,9 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -911,8 +937,14 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -967,13 +999,18 @@ export default class GroupByCodelistListBase extends Vue implements ControlInter
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/has-panel-list-list/has-panel-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -528,7 +528,7 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof HasPanelListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKHasPanelListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -547,17 +547,27 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -591,12 +601,16 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -671,46 +685,55 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -737,6 +760,9 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -767,8 +793,14 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -823,13 +855,18 @@ export default class HasPanelListBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/listpanel-list/listpanel-list-base.vue
浏览文件 @
83661177
...
...
@@ -528,7 +528,7 @@ export default class ListpanelBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof ListpanelBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKUsr5ListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -547,17 +547,27 @@ export default class ListpanelBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -591,12 +601,16 @@ export default class ListpanelBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -671,46 +685,55 @@ export default class ListpanelBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -737,6 +760,9 @@ export default class ListpanelBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -767,8 +793,14 @@ export default class ListpanelBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -823,13 +855,18 @@ export default class ListpanelBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/listpanel-list/listpanel-list-model.ts
浏览文件 @
83661177
...
...
@@ -15,18 +15,18 @@ export default class ListpanelModel {
public
getDataItems
():
any
[]
{
return
[
{
name
:
'
author
'
,
prop
:
'
author
'
,
name
:
'
subtext
'
,
prop
:
'
subtext
'
,
dataType
:
'TEXT'
,
},
{
name
:
'
ibizbookid
'
,
prop
:
'
ibizbookid
'
,
dataType
:
'
GUID
'
,
name
:
'
price
'
,
prop
:
'
price
'
,
dataType
:
'
FLOAT
'
,
},
{
name
:
'
subtext
'
,
prop
:
'
subtext
'
,
name
:
'
press
'
,
prop
:
'
press
'
,
dataType
:
'TEXT'
,
},
{
...
...
@@ -35,19 +35,14 @@ export default class ListpanelModel {
dataType
:
'INT'
,
},
{
name
:
'
ibizbookname
'
,
prop
:
'
ibizbookname
'
,
name
:
'
author
'
,
prop
:
'
author
'
,
dataType
:
'TEXT'
,
},
{
name
:
'icon'
,
prop
:
'icon'
,
dataType
:
'LONGTEXT'
,
},
{
name
:
'press'
,
prop
:
'press'
,
dataType
:
'TEXT'
,
name
:
'ibizbookid'
,
prop
:
'ibizbookid'
,
dataType
:
'GUID'
,
},
{
name
:
'type'
,
...
...
@@ -56,9 +51,14 @@ export default class ListpanelModel {
codelist
:{
tag
:
'BookType'
,
codelistType
:
'STATIC'
},
},
{
name
:
'price'
,
prop
:
'price'
,
dataType
:
'FLOAT'
,
name
:
'icon'
,
prop
:
'icon'
,
dataType
:
'LONGTEXT'
,
},
{
name
:
'ibizbookname'
,
prop
:
'ibizbookname'
,
dataType
:
'TEXT'
,
},
{
name
:
'srfkey'
,
...
...
app_Web/src/widgets/ibizbook/listpanel-panel/listpanel-panel-base.vue
浏览文件 @
83661177
...
...
@@ -341,11 +341,11 @@ export default class ListpanelBase extends Vue implements ControlInterface {
static_label4
:{
name
:
'static_label4'
,
type
:
'ITEMLAYOUT'
,
caption
:
'标签'
,
isShowCaption
:
true
,
sysCss
:
''
,
itemType
:
'RAWITEM'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
80
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container8'
,
panel
:
this
,
viewType
:
'DELISTVIEW'
,
predefinedType
:
'STATIC_LABEL'
,
contentType
:
'RAW'
,
contentStyle
:
''
,
rawContent
:
'书籍描述:'
,
htmlContent
:
''
,
renderMode
:
'PARAGRAPH'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
field_text_dynamic4
:{
name
:
'field_text_dynamic4'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
0
,
widthMode
:
''
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container8'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'subtext'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
container8
:{
name
:
'container8'
,
type
:
'ITEMLAYOUT'
,
caption
:
'容器'
,
titleBarCloseMode
:
0
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'CONTAINER'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
'FLEX'
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
0
,
widthMode
:
''
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
'row'
,
vAlign
:
''
},
parentName
:
'container1'
,
panel
:
this
,
details
:[
'static_label4'
,
'field_text_dynamic4'
]
,
dataRegionType
:
'INHERIT'
},
field_text_dynamic5
:{
name
:
'field_text_dynamic5'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
10
0
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'type'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
field_text_dynamic3
:{
name
:
'field_text_dynamic3'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
1
0
0
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'press'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
field_text_dynamic6
:{
name
:
'field_text_dynamic6'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
10
0
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'price'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
field_text_dynamic5
:{
name
:
'field_text_dynamic5'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
4
0
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'type'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
field_text_dynamic3
:{
name
:
'field_text_dynamic3'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
1
5
0
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'press'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
field_text_dynamic6
:{
name
:
'field_text_dynamic6'
,
type
:
'ITEMLAYOUT'
,
caption
:
'文本(动态)'
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'FIELD'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
5
0
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
required
:
false
,
fieldState
:
'0'
,
predefinedType
:
'FIELD_TEXT_DYNAMIC'
,
renderMode
:
'TEXT_DYNAMIC'
,
dataItemName
:
'price'
,
wrapMode
:
''
,
vAlign
:
''
,
hAlign
:
''
,
},
button_calluilogic1
:{
name
:
'button_calluilogic1'
,
type
:
'ITEMLAYOUT'
,
caption
:
'无处理按钮'
,
isShowCaption
:
true
,
sysCss
:
''
,
itemType
:
'BUTTON'
,
itemStyle
:
'INFO'
,
visible
:
true
,
disabled
:
false
,
layout
:
''
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
100
,
widthMode
:
'PX'
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
''
,
vAlign
:
''
},
parentName
:
'container6'
,
panel
:
this
,
xDataControlName
:
'list'
,
buttonStyle
:
'INFO'
,
borderStyle
:
''
,
iconAlign
:
''
,
renderMode
:
''
,
},
container6
:{
name
:
'container6'
,
type
:
'ITEMLAYOUT'
,
caption
:
'容器'
,
titleBarCloseMode
:
0
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'CONTAINER'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
'FLEX'
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
0
,
widthMode
:
''
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
'
center
'
,
dir
:
'row'
,
vAlign
:
''
},
parentName
:
'container1'
,
panel
:
this
,
details
:[
'field_text_dynamic5'
,
'field_text_dynamic3'
,
'field_text_dynamic6'
,
'button_calluilogic1'
]
,
dataRegionType
:
'INHERIT'
},
container6
:{
name
:
'container6'
,
type
:
'ITEMLAYOUT'
,
caption
:
'容器'
,
titleBarCloseMode
:
0
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'CONTAINER'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
'FLEX'
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
0
,
widthMode
:
''
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
-
1
,
flexParams
:{
align
:
''
,
dir
:
'row'
,
vAlign
:
''
},
parentName
:
'container1'
,
panel
:
this
,
details
:[
'field_text_dynamic5'
,
'field_text_dynamic3'
,
'field_text_dynamic6'
,
'button_calluilogic1'
]
,
dataRegionType
:
'INHERIT'
},
container1
:{
name
:
'container1'
,
type
:
'ITEMLAYOUT'
,
caption
:
'容器'
,
titleBarCloseMode
:
0
,
isShowCaption
:
false
,
sysCss
:
''
,
itemType
:
'CONTAINER'
,
itemStyle
:
'DEFAULT'
,
visible
:
true
,
disabled
:
false
,
layout
:
'FLEX'
,
layoutPos
:
''
,
layoutHeight
:
0
,
heightMode
:
''
,
layoutWidth
:
0
,
widthMode
:
''
,
spacingBottom
:
''
,
spacingLeft
:
''
,
spacingRight
:
''
,
spacingTop
:
''
,
hAlignSelf
:
''
,
vAlignSelf
:
''
,
flexGrow
:
0
,
flexParams
:{
align
:
''
,
dir
:
'column'
,
vAlign
:
''
},
panel
:
this
,
details
:[
'container4'
,
'container2'
,
'container7'
,
'container8'
,
'container6'
]
,
dataRegionType
:
'INHERIT'
}
}
...
...
app_Web/src/widgets/ibizbook/lnternal-func-list-list/lnternal-func-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -838,7 +838,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
* @param {*} [arg={}]
* @memberof LnternalFuncListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKUsr4ListView_layout'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -857,17 +857,27 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -901,12 +911,16 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -981,46 +995,55 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -1047,6 +1070,9 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -1077,8 +1103,14 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -1133,13 +1165,18 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/major-state-list-list/major-state-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -604,7 +604,7 @@ export default class MajorStateListBase extends Vue implements ControlInterface
* @param {*} [arg={}]
* @memberof MajorStateListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKUsr3ListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -623,17 +623,27 @@ export default class MajorStateListBase extends Vue implements ControlInterface
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -667,12 +677,16 @@ export default class MajorStateListBase extends Vue implements ControlInterface
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -747,46 +761,55 @@ export default class MajorStateListBase extends Vue implements ControlInterface
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -813,6 +836,9 @@ export default class MajorStateListBase extends Vue implements ControlInterface
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -843,8 +869,14 @@ export default class MajorStateListBase extends Vue implements ControlInterface
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -899,13 +931,18 @@ export default class MajorStateListBase extends Vue implements ControlInterface
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizbook/tree-major-state-treeview/tree-major-state-treeview-base.vue
浏览文件 @
83661177
...
...
@@ -549,8 +549,13 @@ export default class TreeMajorStateBase extends Vue implements ControlInterface
// 处理多选数据
if
(
!
this
.
isSingleSelect
){
let
leafNodes
=
checkedState
.
checkedNodes
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
const
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
selectedNodes
}).
then
((
res
:
boolean
)
=>
{
if
(
res
)
{
this
.
selectedNodes
=
selectedNodes
;
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
})
}
}
...
...
@@ -569,14 +574,19 @@ export default class TreeMajorStateBase extends Vue implements ControlInterface
return
;
}
// 只处理最底层子节点
if
(
this
.
isBranchAvailable
||
data
.
leaf
){
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
if
(
this
.
isBranchAvailable
||
data
.
leaf
)
{
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
data
}).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
});
}
}
...
...
@@ -757,27 +767,48 @@ export default class TreeMajorStateBase extends Vue implements ControlInterface
Object
.
assign
(
tempContext
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
Object
.
assign
(
tempViewParams
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
}
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
node
.
data
}).
then
((
beforeLoadResult
:
boolean
)
=>
{
if
(
!
beforeLoadResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
})
}
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadSuccessResult
:
boolean
)
=>
{
if
(
!
loadSuccessResult
)
{
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
});
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
});
})
}
/**
...
...
@@ -817,28 +848,48 @@ export default class TreeMajorStateBase extends Vue implements ControlInterface
*/
public
refresh_node
(
curContext
:
any
,
arg
:
any
=
{},
parentnode
:
boolean
):
void
{
const
{
srfnodeid
:
id
}
=
arg
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
Object
.
assign
(
arg
,
{
viewparams
:
this
.
viewparams
});
this
.
handleCtrlEvents
(
'onbeforerefreshnode'
,
{
data
:
arg
}).
then
((
beforeRefreshRes
:
boolean
)
=>
{
if
(
!
beforeRefreshRes
)
{
return
;
}
const
_items
=
[...
response
.
data
];
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
return
;
})
}
const
_items
=
[...
response
.
data
];
this
.
handleCtrlEvents
(
'onrefreshnodesuccess'
,
{
data
:
_items
}).
then
((
successRes
:
boolean
)
=>
{
if
(
!
successRes
)
{
return
;
}
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
})
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
})
});
})
}
/**
...
...
app_Web/src/widgets/ibizbook/tree-view-treeview/tree-view-treeview-base.vue
浏览文件 @
83661177
...
...
@@ -440,8 +440,13 @@ export default class TreeBase extends Vue implements ControlInterface {
// 处理多选数据
if
(
!
this
.
isSingleSelect
){
let
leafNodes
=
checkedState
.
checkedNodes
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
const
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
selectedNodes
}).
then
((
res
:
boolean
)
=>
{
if
(
res
)
{
this
.
selectedNodes
=
selectedNodes
;
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
})
}
}
...
...
@@ -460,14 +465,19 @@ export default class TreeBase extends Vue implements ControlInterface {
return
;
}
// 只处理最底层子节点
if
(
this
.
isBranchAvailable
||
data
.
leaf
){
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
if
(
this
.
isBranchAvailable
||
data
.
leaf
)
{
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
data
}).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
});
}
}
...
...
@@ -648,27 +658,48 @@ export default class TreeBase extends Vue implements ControlInterface {
Object
.
assign
(
tempContext
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
Object
.
assign
(
tempViewParams
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
}
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
node
.
data
}).
then
((
beforeLoadResult
:
boolean
)
=>
{
if
(
!
beforeLoadResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
})
}
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadSuccessResult
:
boolean
)
=>
{
if
(
!
loadSuccessResult
)
{
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
});
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
});
})
}
/**
...
...
@@ -708,28 +739,48 @@ export default class TreeBase extends Vue implements ControlInterface {
*/
public
refresh_node
(
curContext
:
any
,
arg
:
any
=
{},
parentnode
:
boolean
):
void
{
const
{
srfnodeid
:
id
}
=
arg
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
Object
.
assign
(
arg
,
{
viewparams
:
this
.
viewparams
});
this
.
handleCtrlEvents
(
'onbeforerefreshnode'
,
{
data
:
arg
}).
then
((
beforeRefreshRes
:
boolean
)
=>
{
if
(
!
beforeRefreshRes
)
{
return
;
}
const
_items
=
[...
response
.
data
];
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
return
;
})
}
const
_items
=
[...
response
.
data
];
this
.
handleCtrlEvents
(
'onrefreshnodesuccess'
,
{
data
:
_items
}).
then
((
successRes
:
boolean
)
=>
{
if
(
!
successRes
)
{
return
;
}
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
})
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
})
});
})
}
/**
...
...
app_Web/src/widgets/ibizbook/usr-list/usr-list-base.vue
浏览文件 @
83661177
...
...
@@ -627,7 +627,7 @@ export default class UsrBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof UsrBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZBOOKUsr2ListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -646,17 +646,27 @@ export default class UsrBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -690,12 +700,16 @@ export default class UsrBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -770,46 +784,55 @@ export default class UsrBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizbook
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizbook
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -836,6 +859,9 @@ export default class UsrBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -866,8 +892,14 @@ export default class UsrBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -922,13 +954,18 @@ export default class UsrBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizcustomer/usr-treeview/usr-treeview-base.vue
浏览文件 @
83661177
...
...
@@ -440,8 +440,13 @@ export default class UsrBase extends Vue implements ControlInterface {
// 处理多选数据
if
(
!
this
.
isSingleSelect
){
let
leafNodes
=
checkedState
.
checkedNodes
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
const
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
selectedNodes
}).
then
((
res
:
boolean
)
=>
{
if
(
res
)
{
this
.
selectedNodes
=
selectedNodes
;
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
})
}
}
...
...
@@ -460,14 +465,19 @@ export default class UsrBase extends Vue implements ControlInterface {
return
;
}
// 只处理最底层子节点
if
(
this
.
isBranchAvailable
||
data
.
leaf
){
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
if
(
this
.
isBranchAvailable
||
data
.
leaf
)
{
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
data
}).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
});
}
}
...
...
@@ -648,27 +658,48 @@ export default class UsrBase extends Vue implements ControlInterface {
Object
.
assign
(
tempContext
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
Object
.
assign
(
tempViewParams
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
}
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
node
.
data
}).
then
((
beforeLoadResult
:
boolean
)
=>
{
if
(
!
beforeLoadResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
})
}
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadSuccessResult
:
boolean
)
=>
{
if
(
!
loadSuccessResult
)
{
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
});
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
});
})
}
/**
...
...
@@ -708,28 +739,48 @@ export default class UsrBase extends Vue implements ControlInterface {
*/
public
refresh_node
(
curContext
:
any
,
arg
:
any
=
{},
parentnode
:
boolean
):
void
{
const
{
srfnodeid
:
id
}
=
arg
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
Object
.
assign
(
arg
,
{
viewparams
:
this
.
viewparams
});
this
.
handleCtrlEvents
(
'onbeforerefreshnode'
,
{
data
:
arg
}).
then
((
beforeRefreshRes
:
boolean
)
=>
{
if
(
!
beforeRefreshRes
)
{
return
;
}
const
_items
=
[...
response
.
data
];
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
return
;
})
}
const
_items
=
[...
response
.
data
];
this
.
handleCtrlEvents
(
'onrefreshnodesuccess'
,
{
data
:
_items
}).
then
((
successRes
:
boolean
)
=>
{
if
(
!
successRes
)
{
return
;
}
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
})
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
})
});
})
}
/**
...
...
app_Web/src/widgets/ibizorder-detail/order-details-list-list/order-details-list-list-base.vue
浏览文件 @
83661177
...
...
@@ -548,7 +548,7 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
* @param {*} [arg={}]
* @memberof OrderDetailsListBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDetailListView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -567,17 +567,27 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -611,12 +621,16 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -691,46 +705,55 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -757,6 +780,9 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -787,8 +813,14 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -843,13 +875,18 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizorder-detail/order-details-money-list/order-details-money-list-base.vue
浏览文件 @
83661177
...
...
@@ -507,7 +507,7 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
* @param {*} [arg={}]
* @memberof OrderDetailsMoneyBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDashboardView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -526,17 +526,27 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -570,12 +580,16 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -650,46 +664,55 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -716,6 +739,9 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -746,8 +772,14 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -802,13 +834,18 @@ export default class OrderDetailsMoneyBase extends Vue implements ControlInterfa
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizorder-detail/order-details-total-list/order-details-total-list-base.vue
浏览文件 @
83661177
...
...
@@ -507,7 +507,7 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
* @param {*} [arg={}]
* @memberof OrderDetailsTotalBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDashboardView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -526,17 +526,27 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -570,12 +580,16 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -650,46 +664,55 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -716,6 +739,9 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -746,8 +772,14 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -802,13 +834,18 @@ export default class OrderDetailsTotalBase extends Vue implements ControlInterfa
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizorder-detail/order-details-type-list/order-details-type-list-base.vue
浏览文件 @
83661177
...
...
@@ -508,7 +508,7 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
* @param {*} [arg={}]
* @memberof OrderDetailsTypeBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDashboardView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -527,17 +527,27 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -571,12 +581,16 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -651,46 +665,55 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorderdetail
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorderdetail
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -717,6 +740,9 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -747,8 +773,14 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -803,13 +835,18 @@ export default class OrderDetailsTypeBase extends Vue implements ControlInterfac
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizorder/card-navigation-dataview/card-navigation-dataview-base.vue
浏览文件 @
83661177
...
...
@@ -715,7 +715,7 @@ export default class CardNavigationBase extends Vue implements ControlInterface
*/
public
load
(
opt
:
any
=
{},
isReset
:
boolean
=
false
):
void
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView
_layout
'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{...
opt
};
...
...
@@ -794,7 +794,7 @@ export default class CardNavigationBase extends Vue implements ControlInterface
*/
public
async
remove
(
datas
:
any
[]):
Promise
<
any
>
{
if
(
!
this
.
removeAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView'
+
(
this
.
$t
(
'app.gridpage.notConfig.removeAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView
_layout
'
+
(
this
.
$t
(
'app.gridpage.notConfig.removeAction'
)
as
string
)
});
return
;
}
let
_datas
:
any
[]
=
[];
...
...
@@ -903,7 +903,7 @@ export default class CardNavigationBase extends Vue implements ControlInterface
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
if
(
!
this
.
createAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView'
+
(
this
.
$t
(
'app.list.notConfig.createAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView
_layout
'
+
(
this
.
$t
(
'app.list.notConfig.createAction'
)
as
string
)
});
}
else
{
Object
.
assign
(
item
,{
viewparams
:
this
.
viewparams
});
let
response
=
await
this
.
service
.
add
(
this
.
createAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
...
...
@@ -911,7 +911,7 @@ export default class CardNavigationBase extends Vue implements ControlInterface
}
}
else
if
(
Object
.
is
(
item
.
rowDataState
,
'update'
)){
if
(
!
this
.
updateAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView'
+
(
this
.
$t
(
'app.list.notConfig.updateAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderDataViewExpView
_layout
'
+
(
this
.
$t
(
'app.list.notConfig.updateAction'
)
as
string
)
});
}
else
{
Object
.
assign
(
item
,{
viewparams
:
this
.
viewparams
});
if
(
item
.
ibizorder
){
...
...
app_Web/src/widgets/ibizorder/list-exp-list/list-exp-list-base.vue
浏览文件 @
83661177
...
...
@@ -578,7 +578,7 @@ export default class ListExpBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof ListExpBase
*/
public
load
(
opt
:
any
=
{}):
void
{
public
async
load
(
opt
:
any
=
{}):
Promise
<
any
>
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrderListExpView'
+
(
this
.
$t
(
'app.list.notConfig.fetchAction'
)
as
string
)
});
return
;
...
...
@@ -597,17 +597,27 @@ export default class ListExpBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:
{};
if
(
this
.
viewparams
){
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
}
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
this
.
context
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)):{},
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
Object
.
assign
(
arg
,
{
viewparams
:
tempViewParams
});
const
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
arg
})))
{
return
false
;
}
try
{
const
response
:
any
=
await
this
.
service
.
search
(
this
.
fetchAction
,
tempContext
,
arg
,
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
.
data
&&
response
.
data
.
message
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
}
return
response
;
}
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloadsuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
const
data
:
any
=
response
.
data
;
...
...
@@ -641,12 +651,16 @@ export default class ListExpBase extends Vue implements ControlInterface {
this
.
handleClick
(
this
.
items
[
0
]);
}
}
},
(
response
:
any
)
=>
{
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
}
);
}
}
/**
...
...
@@ -721,46 +735,55 @@ export default class ListExpBase extends Vue implements ControlInterface {
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
const
removeData
=
async
()
=>
{
let
keys
:
any
[]
=
[];
datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorder
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorder
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforeremove'
,
{
data
:
this
.
items
})))
{
return
;
}
try
{
const
response
:
any
=
await
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
ibizorder
:
keys
.
join
(
';'
)
}),
Object
.
assign
({
ibizorder
:
keys
.
join
(
';'
)
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$Notice
.
error
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.delDataFail'
)
as
string
)
+
','
+
response
.
info
});
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.deleteSuccess'
)
as
string
)
});
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremovesuccess'
,
{
data
:
response
.
data
})))
{
return
;
}
//删除items中已删除的项
datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
return
true
;
}
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
return
response
;
}
catch
(
response
:
any
)
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onremoveerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
arg
})))
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
reject
(
response
);
return
;
}
reject
(
response
);
}
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
).
replace
(
/
[
]
/g
,
''
);
...
...
@@ -787,6 +810,9 @@ export default class ListExpBase extends Vue implements ControlInterface {
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
if
(
!
(
await
this
.
handleCtrlEvents
(
'onbeforesave'
)))
{
return
;
}
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
...
...
@@ -817,8 +843,14 @@ export default class ListExpBase extends Vue implements ControlInterface {
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
();
if
(
errorItems
.
length
===
0
){
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsavesuccess'
,
{
data
:
successItems
})))
{
return
;
}
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
this
.
$t
(
'app.commonWords.saveSuccess'
)
as
string
)
});
}
else
{
}
else
{
if
(
!
(
await
this
.
handleCtrlEvents
(
'onsaveerror'
,
{
data
:
successItems
})))
{
return
;
}
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
),
desc
:
item
.
majorentityname
+
(
this
.
$t
(
'app.commonWords.saveFailed'
)
as
string
)
+
'!'
});
console
.
error
(
errorMessage
[
index
]);
...
...
@@ -873,13 +905,18 @@ export default class ListExpBase extends Vue implements ControlInterface {
*
*/
public
selectchange
()
{
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
this
.
handleCtrlEvents
(
'onselectionchange'
).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
this
.
selections
=
[];
this
.
items
.
map
((
item
:
any
)
=>
{
if
(
item
.
isselected
)
{
this
.
selections
.
push
(
item
);
}
});
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
})
}
/**
...
...
app_Web/src/widgets/ibizorder/main-grid/main-grid-base.vue
浏览文件 @
83661177
...
...
@@ -299,7 +299,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZOrder
Pickup
GridViewBase
* @memberof IBIZOrder
SF1
GridViewBase
*/
public
Edit
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
if
(
args
.
length
===
0
)
{
...
...
@@ -441,6 +441,20 @@ export default class MainBase extends Vue implements ControlInterface {
return
this
.
selections
[
0
];
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof MainBase
*/
@
Prop
()
public
newdata
:
any
;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof MainBase
*/
@
Prop
()
public
opendata
:
any
;
/**
* 是否嵌入关系界面
...
...
@@ -975,7 +989,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
!
this
.
fetchAction
)
{
this
.
$Notice
.
error
({
title
:
this
.
$t
(
"app.commonWords.wrong"
)
as
string
,
desc
:
"IBIZOrder
Pickup
GridView"
+
(
this
.
$t
(
"app.gridpage.notConfig.fetchAction"
)
as
string
),
desc
:
"IBIZOrder
SF1
GridView"
+
(
this
.
$t
(
"app.gridpage.notConfig.fetchAction"
)
as
string
),
});
return
;
}
...
...
@@ -1104,7 +1118,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
!
this
.
removeAction
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
Pickup
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.removeAction'
)
as
string
)
desc
:
'IBIZOrder
SF1
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.removeAction'
)
as
string
)
});
return
;
}
...
...
@@ -1218,7 +1232,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
addBatch
(
arg
:
any
=
{}):
void
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
Pickup
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.fetchAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
SF1
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.fetchAction'
)
as
string
)
});
return
;
}
if
(
!
arg
){
...
...
@@ -2149,7 +2163,7 @@ export default class MainBase extends Vue implements ControlInterface {
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
))
{
if
(
!
this
.
createAction
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
Pickup
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.createAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
SF1
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.createAction'
)
as
string
)
});
}
else
{
Object
.
assign
(
item
,
{
viewparams
:
this
.
viewparams
});
const
tempContext
=
Util
.
deepCopy
(
this
.
context
);
...
...
@@ -2158,7 +2172,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
}
else
if
(
Object
.
is
(
item
.
rowDataState
,
'update'
)){
if
(
!
this
.
updateAction
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
Pickup
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.updateAction'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
SF1
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.updateAction'
)
as
string
)
});
}
else
{
Object
.
assign
(
item
,
{
viewparams
:
this
.
viewparams
});
const
tempContext
=
Util
.
deepCopy
(
this
.
context
);
...
...
@@ -2234,7 +2248,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'IBIZOrder
Pickup
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.loaddraftAction'
)
as
string
)
desc
:
'IBIZOrder
SF1
GridView'
+
(
this
.
$t
(
'app.gridpage.notConfig.loaddraftAction'
)
as
string
)
});
return
;
}
...
...
app_Web/src/widgets/ibizorder/main-grid/main-grid-model.ts
浏览文件 @
83661177
...
...
@@ -104,6 +104,21 @@ export default class MainModel {
prop
:
'n_ibizordername_like'
,
dataType
:
'QUERYPARAM'
},
{
name
:
'n_orderstate_eq'
,
prop
:
'n_orderstate_eq'
,
dataType
:
'QUERYPARAM'
},
{
name
:
'n_ordertime_gt'
,
prop
:
'n_ordertime_gt'
,
dataType
:
'QUERYPARAM'
},
{
name
:
'n_ordertime_lt'
,
prop
:
'n_ordertime_lt'
,
dataType
:
'QUERYPARAM'
},
{
name
:
'size'
,
...
...
app_Web/src/widgets/ibizorder/tree-exp-treeview/tree-exp-treeview-base.vue
浏览文件 @
83661177
...
...
@@ -470,8 +470,13 @@ export default class TreeExpBase extends Vue implements ControlInterface {
// 处理多选数据
if
(
!
this
.
isSingleSelect
){
let
leafNodes
=
checkedState
.
checkedNodes
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
const
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
selectedNodes
}).
then
((
res
:
boolean
)
=>
{
if
(
res
)
{
this
.
selectedNodes
=
selectedNodes
;
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
})
}
}
...
...
@@ -490,14 +495,19 @@ export default class TreeExpBase extends Vue implements ControlInterface {
return
;
}
// 只处理最底层子节点
if
(
this
.
isBranchAvailable
||
data
.
leaf
){
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
if
(
this
.
isBranchAvailable
||
data
.
leaf
)
{
this
.
handleCtrlEvents
(
'onselectionchange'
,
{
action
:
'SelectionChange'
,
data
:
data
}).
then
((
res
:
boolean
)
=>
{
if
(
!
res
)
{
return
;
}
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
});
}
}
...
...
@@ -678,27 +688,48 @@ export default class TreeExpBase extends Vue implements ControlInterface {
Object
.
assign
(
tempContext
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
Object
.
assign
(
tempViewParams
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
}
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
handleCtrlEvents
(
'onbeforeload'
,
{
data
:
node
.
data
}).
then
((
beforeLoadResult
:
boolean
)
=>
{
if
(
!
beforeLoadResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
})
}
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadSuccessResult
:
boolean
)
=>
{
if
(
!
loadSuccessResult
)
{
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
});
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onloaderror'
,
{
data
:
node
.
data
}).
then
((
loadErrorResult
:
boolean
)
=>
{
if
(
!
loadErrorResult
)
{
return
;
}
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
});
})
}
/**
...
...
@@ -738,28 +769,48 @@ export default class TreeExpBase extends Vue implements ControlInterface {
*/
public
refresh_node
(
curContext
:
any
,
arg
:
any
=
{},
parentnode
:
boolean
):
void
{
const
{
srfnodeid
:
id
}
=
arg
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
Object
.
assign
(
arg
,
{
viewparams
:
this
.
viewparams
});
this
.
handleCtrlEvents
(
'onbeforerefreshnode'
,
{
data
:
arg
}).
then
((
beforeRefreshRes
:
boolean
)
=>
{
if
(
!
beforeRefreshRes
)
{
return
;
}
const
_items
=
[...
response
.
data
];
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
treeexpbar_tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
curContext
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
return
;
})
}
const
_items
=
[...
response
.
data
];
this
.
handleCtrlEvents
(
'onrefreshnodesuccess'
,
{
data
:
_items
}).
then
((
successRes
:
boolean
)
=>
{
if
(
!
successRes
)
{
return
;
}
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
treeexpbar_tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
})
}).
catch
((
response
:
any
)
=>
{
this
.
handleCtrlEvents
(
'onrefreshnodeerror'
,
{
data
:
response
&&
response
.
data
?
response
.
data
:
{}
}).
then
((
errorRes
:
boolean
)
=>
{
if
(
!
errorRes
)
{
return
;
}
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
})
});
})
}
/**
...
...
app_Web/src/widgets/ibizorder/usr-list/usr-list-base.vue
浏览文件 @
83661177
此差异已折叠。
点击以展开。
app_Web/src/widgets/ibizsample0003/tree01-treeview/tree01-treeview-base.vue
浏览文件 @
83661177
此差异已折叠。
点击以展开。
app_Web/src/widgets/ibizsample0003/tree02-treeview/tree02-treeview-base.vue
浏览文件 @
83661177
此差异已折叠。
点击以展开。
app_Web/src/widgets/ibizsample0003/tree03-treeview/tree03-treeview-base.vue
浏览文件 @
83661177
此差异已折叠。
点击以展开。
app_Web/src/widgets/ibizsample0003/tree04-treeview/tree04-treeview-base.vue
浏览文件 @
83661177
此差异已折叠。
点击以展开。
demo-boot/src/main/resources/static/remotemodel/PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK/PSGANTTS/Usr.json
浏览文件 @
83661177
...
...
@@ -11,51 +11,51 @@
"path"
:
"PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK.json"
},
"getPSDETreeColumns"
:
[
{
"caption"
:
"
归还日期
"
,
"codeName"
:
"
returntime
"
,
"caption"
:
"
作者
"
,
"codeName"
:
"
author
"
,
"columnType"
:
"DEFGRIDCOLUMN"
,
"dataItemName"
:
"
returntime
"
,
"name"
:
"
returntime
"
,
"dataItemName"
:
"
author
"
,
"name"
:
"
author
"
,
"width"
:
200
,
"widthUnit"
:
"px"
,
"enableExpand"
:
false
,
"enableSort"
:
false
},
{
"caption"
:
"
出版社
"
,
"codeName"
:
"
press
"
,
"caption"
:
"
图书名称
"
,
"codeName"
:
"
ibizbookname
"
,
"columnType"
:
"DEFGRIDCOLUMN"
,
"dataItemName"
:
"
press
"
,
"name"
:
"
press
"
,
"dataItemName"
:
"
ibizbookname
"
,
"name"
:
"
ibizbookname
"
,
"width"
:
200
,
"widthUnit"
:
"px"
,
"enableExpand"
:
false
,
"enableSort"
:
false
},
{
"caption"
:
"
借出
日期"
,
"codeName"
:
"
lendout
time"
,
"caption"
:
"
归还
日期"
,
"codeName"
:
"
return
time"
,
"columnType"
:
"DEFGRIDCOLUMN"
,
"dataItemName"
:
"
lendout
time"
,
"name"
:
"
lendout
time"
,
"dataItemName"
:
"
return
time"
,
"name"
:
"
return
time"
,
"width"
:
200
,
"widthUnit"
:
"px"
,
"enableExpand"
:
false
,
"enableSort"
:
false
},
{
"caption"
:
"
作者
"
,
"codeName"
:
"
author
"
,
"caption"
:
"
出版社
"
,
"codeName"
:
"
press
"
,
"columnType"
:
"DEFGRIDCOLUMN"
,
"dataItemName"
:
"
author
"
,
"name"
:
"
author
"
,
"dataItemName"
:
"
press
"
,
"name"
:
"
press
"
,
"width"
:
200
,
"widthUnit"
:
"px"
,
"enableExpand"
:
false
,
"enableSort"
:
false
},
{
"caption"
:
"
图书名称
"
,
"codeName"
:
"
ibizbookna
me"
,
"caption"
:
"
借出日期
"
,
"codeName"
:
"
lendoutti
me"
,
"columnType"
:
"DEFGRIDCOLUMN"
,
"dataItemName"
:
"
ibizbookna
me"
,
"name"
:
"
ibizbookna
me"
,
"dataItemName"
:
"
lendoutti
me"
,
"name"
:
"
lendoutti
me"
,
"width"
:
200
,
"widthUnit"
:
"px"
,
"enableExpand"
:
false
,
...
...
demo-boot/src/main/resources/static/remotemodel/PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK/PSLISTS/Listpanel.json
浏览文件 @
83661177
此差异已折叠。
点击以展开。
demo-boot/src/main/resources/static/remotemodel/PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK/PSPANELS/Listpanel.json
浏览文件 @
83661177
此差异已折叠。
点击以展开。
demo-boot/src/main/resources/static/remotemodel/PSSYSAPPS/Web/PSAPPDEVIEWS/IBIZBOOKGanttView.json
浏览文件 @
83661177
此差异已折叠。
点击以展开。
demo-boot/src/main/resources/static/remotemodel/PSSYSAPPS/Web/PSAPPDEVIEWS/IBIZBOOKUsr5ListView.json
浏览文件 @
83661177
此差异已折叠。
点击以展开。
demo-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
83661177
...
...
@@ -172,7 +172,7 @@
<!--输出实体[IBIZBOOK]数据结构 -->
<changeSet
author=
"a_LAB01_df847bdfd"
id=
"tab-ibizbook-7
38
-7"
>
<changeSet
author=
"a_LAB01_df847bdfd"
id=
"tab-ibizbook-7
41
-7"
>
<createTable
tableName=
"T_IBIZBOOK"
>
<column
name=
"CREATEMAN"
remarks=
""
type=
"VARCHAR(60)"
>
</column>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录