Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
ac3b4c52
提交
ac3b4c52
编写于
6月 03, 2020
作者:
WodahsOrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lxm--数据选择,自动填充编辑器参数处理
上级
580e73b5
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
108 行增加
和
37 行删除
+108
-37
app-autocomplete.vue
src/components/app-autocomplete/app-autocomplete.vue
+39
-18
app-mpicker.vue
src/components/app-mpicker/app-mpicker.vue
+56
-5
app-picker-select-view.vue
...ponents/app-picker-select-view/app-picker-select-view.vue
+2
-6
app-picker.vue
src/components/app-picker/app-picker.vue
+2
-6
util.ts
src/utils/util/util.ts
+9
-2
未找到文件。
src/components/app-autocomplete/app-autocomplete.vue
浏览文件 @
ac3b4c52
...
...
@@ -173,29 +173,22 @@ export default class AppAutocomplete extends Vue {
* @param callback
*/
public
onSearch
(
query
:
any
,
callback
:
any
):
void
{
// 公共参数处理
let
data
:
any
=
{};
const
bcancel
:
boolean
=
this
.
handlePublicParams
(
data
);
if
(
!
bcancel
)
{
return
;
}
// 参数处理
let
_context
=
data
.
context
;
let
_param
=
data
.
param
;
// 处理搜索参数
query
=
!
query
?
''
:
query
;
if
(
!
this
.
inputState
&&
Object
.
is
(
query
,
this
.
value
))
{
query
=
''
;
}
this
.
inputState
=
false
;
// 合并视图上下文参数和视图参数
let
param
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
));
let
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
Object
.
assign
(
param
,
{
query
:
query
});
// 附加参数处理
if
(
this
.
itemParam
.
context
)
{
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
context
);
Object
.
assign
(
context
,
_context
);
}
if
(
this
.
itemParam
.
param
)
{
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
param
);
Object
.
assign
(
param
,
_param
);
}
if
(
this
.
itemParam
.
parentdata
)
{
let
_parentdata
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
parentdata
);
Object
.
assign
(
param
,
_parentdata
);
}
Object
.
assign
(
_param
,
{
query
:
query
});
// 错误信息国际化
let
error
:
string
=
(
this
.
$t
(
'components.appAutocomplete.error'
)
as
any
);
let
miss
:
string
=
(
this
.
$t
(
'components.appAutocomplete.miss'
)
as
any
);
...
...
@@ -208,7 +201,7 @@ export default class AppAutocomplete extends Vue {
}
else
if
(
!
this
.
acParams
.
interfaceName
)
{
this
.
$Notice
.
error
({
title
:
error
,
desc
:
miss
+
'interfaceName'
});
}
else
{
this
.
service
.
getItems
(
this
.
acParams
.
serviceName
,
this
.
acParams
.
interfaceName
,
context
,
param
).
then
((
response
:
any
)
=>
{
this
.
service
.
getItems
(
this
.
acParams
.
serviceName
,
this
.
acParams
.
interfaceName
,
_context
,
_
param
).
then
((
response
:
any
)
=>
{
if
(
!
response
)
{
this
.
$Notice
.
error
({
title
:
error
,
desc
:
requestException
});
}
else
{
...
...
@@ -274,6 +267,34 @@ export default class AppAutocomplete extends Vue {
this
.
$forceUpdate
();
}
/**
* 公共参数处理
*
* @param {*} arg
* @returns
* @memberof AppAutocomplete
*/
public
handlePublicParams
(
arg
:
any
):
boolean
{
if
(
!
this
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'components.appPicker.error'
)
as
any
),
desc
:
(
this
.
$t
(
'components.appPicker.formdataException'
)
as
any
)
});
return
false
;
}
// 合并表单参数
arg
.
param
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
));
arg
.
context
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
// 附加参数处理
if
(
this
.
itemParam
.
context
)
{
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
context
,
this
.
itemParam
.
context
);
Object
.
assign
(
arg
.
context
,
_context
);
}
if
(
this
.
itemParam
.
param
)
{
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
param
,
this
.
itemParam
.
param
);
Object
.
assign
(
arg
.
param
,
_param
);
}
return
true
;
}
}
</
script
>
...
...
src/components/app-mpicker/app-mpicker.vue
浏览文件 @
ac3b4c52
...
...
@@ -44,6 +44,14 @@ export default class AppMpicker extends Vue {
*/
@
Prop
()
curvalue
?:
any
;
/**
* 表单项参数
*
* @type {any}
* @memberof AppPicker
*/
@
Prop
()
public
itemParam
:
any
;
/**
* 表单项名称
*/
...
...
@@ -147,9 +155,18 @@ export default class AppMpicker extends Vue {
* @memberof AppMpicker
*/
public
onSearch
(
query
:
any
)
{
let
param
:
any
=
{
query
:
query
};
// 公共参数处理
let
data
:
any
=
{};
const
bcancel
:
boolean
=
this
.
handlePublicParams
(
data
);
if
(
!
bcancel
)
{
return
;
}
// 参数处理
let
_context
=
data
.
context
;
let
_param
=
data
.
param
;
Object
.
assign
(
_param
,{
query
:
query
});
if
(
this
.
activeData
)
{
Object
.
assign
(
param
,
{
srfreferdata
:
this
.
activeData
});
Object
.
assign
(
_
param
,
{
srfreferdata
:
this
.
activeData
});
}
// 错误信息国际化
let
error
:
string
=
(
this
.
$t
(
'components.appMpicker.error'
)
as
any
);
...
...
@@ -162,7 +179,7 @@ export default class AppMpicker extends Vue {
}
else
if
(
!
this
.
acParams
.
interfaceName
)
{
this
.
$Notice
.
error
({
title
:
error
,
desc
:
miss
+
'interfaceName'
});
}
else
{
this
.
service
.
getItems
(
this
.
acParams
.
serviceName
,
this
.
acParams
.
interfaceName
,
param
).
then
((
response
:
any
)
=>
{
this
.
service
.
getItems
(
this
.
acParams
.
serviceName
,
this
.
acParams
.
interfaceName
,
_context
,
_
param
).
then
((
response
:
any
)
=>
{
if
(
!
response
)
{
this
.
$Notice
.
error
({
title
:
error
,
desc
:
requestException
});
}
else
{
...
...
@@ -216,6 +233,33 @@ export default class AppMpicker extends Vue {
}
}
/**
* 公共参数处理
*
* @param {*} arg
* @returns
* @memberof AppMpicker
*/
public
handlePublicParams
(
arg
:
any
):
boolean
{
if
(
!
this
.
activeData
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'components.appPicker.error'
)
as
any
),
desc
:
(
this
.
$t
(
'components.appPicker.formdataException'
)
as
any
)
});
return
false
;
}
// 合并表单参数
arg
.
param
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
));
arg
.
context
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
// 附加参数处理
if
(
this
.
itemParam
.
context
)
{
let
_context
=
this
.
$util
.
formatData
(
this
.
activeData
,
arg
.
context
,
this
.
itemParam
.
context
);
Object
.
assign
(
arg
.
context
,
_context
);
}
if
(
this
.
itemParam
.
param
)
{
let
_param
=
this
.
$util
.
formatData
(
this
.
activeData
,
arg
.
param
,
this
.
itemParam
.
param
);
Object
.
assign
(
arg
.
param
,
_param
);
}
return
true
;
}
/**
* 打开视图
*
...
...
@@ -229,8 +273,15 @@ export default class AppMpicker extends Vue {
if
(
this
.
pickupView
&&
Object
.
keys
(
this
.
pickupView
).
length
>
0
)
{
// 参数处理
const
view
=
{
...
this
.
pickupView
};
let
_viewparams
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
));
let
_context
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
// 公共参数处理
let
data
:
any
=
{};
const
bcancel
:
boolean
=
this
.
handlePublicParams
(
data
);
if
(
!
bcancel
)
{
return
;
}
// 参数处理
let
_context
=
data
.
context
;
let
_viewparams
=
data
.
param
;
let
_selectItems
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
selectItems
));
if
(
!
Object
.
is
(
this
.
deKeyField
,
"srfkey"
)){
_selectItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
...
src/components/app-picker-select-view/app-picker-select-view.vue
浏览文件 @
ac3b4c52
...
...
@@ -259,17 +259,13 @@ export default class AppPickerSelectView extends Vue {
arg
.
context
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
// 附加参数处理
if
(
this
.
itemParam
.
context
)
{
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
context
);
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
context
,
this
.
itemParam
.
context
);
Object
.
assign
(
arg
.
context
,
_context
);
}
if
(
this
.
itemParam
.
param
)
{
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
param
);
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
param
,
this
.
itemParam
.
param
);
Object
.
assign
(
arg
.
param
,
_param
);
}
if
(
this
.
itemParam
.
parentdata
)
{
let
_parentdata
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
parentdata
);
Object
.
assign
(
arg
.
param
,
_parentdata
);
}
return
true
;
}
...
...
src/components/app-picker/app-picker.vue
浏览文件 @
ac3b4c52
...
...
@@ -651,17 +651,13 @@ export default class AppPicker extends Vue {
arg
.
context
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
// 附加参数处理
if
(
this
.
itemParam
.
context
)
{
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
context
);
let
_context
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
context
,
this
.
itemParam
.
context
);
Object
.
assign
(
arg
.
context
,
_context
);
}
if
(
this
.
itemParam
.
param
)
{
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
param
);
let
_param
=
this
.
$util
.
formatData
(
this
.
data
,
arg
.
param
,
this
.
itemParam
.
param
);
Object
.
assign
(
arg
.
param
,
_param
);
}
if
(
this
.
itemParam
.
parentdata
)
{
let
_parentdata
=
this
.
$util
.
formatData
(
this
.
data
,
this
.
itemParam
.
parentdata
);
Object
.
assign
(
arg
.
param
,
_parentdata
);
}
return
true
;
}
...
...
src/utils/util/util.ts
浏览文件 @
ac3b4c52
...
...
@@ -293,11 +293,12 @@ export class Util {
*
* @static
* @param {any} arg 表单数据
* @param {any} parent 外层context或viewparams
* @param {any} params 附加参数
* @returns {any}
* @memberof Util
*/
public
static
formatData
(
arg
:
any
,
params
:
any
):
any
{
public
static
formatData
(
arg
:
any
,
parent
:
any
,
params
:
any
):
any
{
let
_data
:
any
=
{};
Object
.
keys
(
params
).
forEach
((
name
:
string
)
=>
{
if
(
!
name
)
{
...
...
@@ -307,7 +308,13 @@ export class Util {
if
(
value
&&
value
.
startsWith
(
'%'
)
&&
value
.
endsWith
(
'%'
))
{
const
key
=
value
.
substring
(
1
,
value
.
length
-
1
);
if
(
arg
&&
arg
.
hasOwnProperty
(
key
))
{
value
=
(
arg
[
key
]
!==
null
&&
arg
[
key
]
!==
undefined
)
?
arg
[
key
]
:
null
;
if
(
arg
[
key
]
!==
null
&&
arg
[
key
]
!==
undefined
){
value
=
arg
[
key
];
}
else
if
(
parent
[
key
]
!==
null
&&
parent
[
key
]
!==
undefined
){
value
=
parent
[
key
];
}
else
{
value
=
null
;
}
}
else
{
value
=
null
;
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录