提交 7a8758e0 编写于 作者: tony001's avatar tony001

界面行为导航参数调整

上级 da61f905
...@@ -13,18 +13,22 @@ export declare interface UIActionTool { ...@@ -13,18 +13,22 @@ export declare interface UIActionTool {
* *
* @param actionTarget 数据目标 * @param actionTarget 数据目标
* @param args 传入数据对象 * @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入应用上下数据参数 * @param param 传入应用上下数据参数
*/ */
handleContextParam(actionTarget:any,args:any,context:any):any; handleContextParam(actionTarget: any, args: any,parentContext:any,parentParams:any, context: any):any;
/** /**
* 处理界面行为参数 * 处理界面行为参数
* *
* @param actionTarget 数据目标 * @param actionTarget 数据目标
* @param args 传入数据对象 * @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入界面行为附加参数 * @param param 传入界面行为附加参数
*/ */
handleActionParam(actionTarget:any,args:any,params:any):any; handleActionParam(actionTarget: any, args: any,parentContext:any,parentParams:any, params: any):any;
} }
declare module "vue/types/vue" { declare module "vue/types/vue" {
......
...@@ -8,10 +8,12 @@ export class UIActionTool { ...@@ -8,10 +8,12 @@ export class UIActionTool {
* *
* @param actionTarget 数据目标 * @param actionTarget 数据目标
* @param args 传入数据对象 * @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入应用上下数据参数 * @param param 传入应用上下数据参数
*/ */
public static handleContextParam(actionTarget: any, args: any, context: any) { public static handleContextParam(actionTarget: any, args: any,parentContext:any,parentParams:any, context: any) {
return this.formatData(actionTarget, args, context); return this.formatData(actionTarget, args,parentContext,parentParams,context);
} }
/** /**
...@@ -19,10 +21,12 @@ export class UIActionTool { ...@@ -19,10 +21,12 @@ export class UIActionTool {
* *
* @param actionTarget 数据目标 * @param actionTarget 数据目标
* @param args 传入数据对象 * @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入界面行为附加参数 * @param param 传入界面行为附加参数
*/ */
public static handleActionParam(actionTarget: any, args: any, params: any) { public static handleActionParam(actionTarget: any, args: any,parentContext:any,parentParams:any, params: any) {
return this.formatData(actionTarget, args, params); return this.formatData(actionTarget, args,parentContext,parentParams,params);
} }
/** /**
...@@ -32,11 +36,13 @@ export class UIActionTool { ...@@ -32,11 +36,13 @@ export class UIActionTool {
* @static * @static
* @param {*} actionTarget * @param {*} actionTarget
* @param {*} args * @param {*} args
* @param parentContext
* @param parentParams
* @param {*} _params * @param {*} _params
* @returns {*} * @returns {*}
* @memberof UIActionTool * @memberof UIActionTool
*/ */
private static formatData(actionTarget: any, args: any, _params: any): any { private static formatData(actionTarget: any, args: any,parentContext:any,parentParams:any, _params: any): any {
let _data: any = {}; let _data: any = {};
if (Object.is(actionTarget, 'SINGLEKEY')) { if (Object.is(actionTarget, 'SINGLEKEY')) {
let [arg] = args; let [arg] = args;
...@@ -50,12 +56,16 @@ export class UIActionTool { ...@@ -50,12 +56,16 @@ export class UIActionTool {
const key = value.substring(1, value.length - 1); const key = value.substring(1, value.length - 1);
if (arg && arg.hasOwnProperty(key)) { if (arg && arg.hasOwnProperty(key)) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null; value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else { } else if(parentContext && parentContext.hasOwnProperty(key)){
value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null;
}else if(parentParams && parentParams.hasOwnProperty(key)){
value = (parentParams[key] !== null && parentParams[key] !== undefined) ? parentParams[key] : null;
}else {
hasProperty = false; hasProperty = false;
} }
} }
if(hasProperty){ if(hasProperty){
Object.assign(_data, { [name]: value }); Object.assign(_data, { [name.toLowerCase()]: value });
} }
}); });
} else if (Object.is(actionTarget, 'MULTIKEY')) { } else if (Object.is(actionTarget, 'MULTIKEY')) {
...@@ -71,7 +81,11 @@ export class UIActionTool { ...@@ -71,7 +81,11 @@ export class UIActionTool {
args.forEach((arg: any) => { args.forEach((arg: any) => {
if (arg && arg.hasOwnProperty(key)) { if (arg && arg.hasOwnProperty(key)) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null; value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else { }else if(parentContext && parentContext.hasOwnProperty(key)){
value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null;
}else if(parentParams && parentParams.hasOwnProperty(key)){
value = (parentParams[key] !== null && parentParams[key] !== undefined) ? parentParams[key] : null;
}else {
value = null; value = null;
noPropertyNum++; noPropertyNum++;
} }
...@@ -79,7 +93,7 @@ export class UIActionTool { ...@@ -79,7 +93,7 @@ export class UIActionTool {
}); });
} }
if(values.length !== noPropertyNum){ if(values.length !== noPropertyNum){
Object.assign(_data, { [name]: values.length > 0 ? values.join(',') : value }); Object.assign(_data, { [name.toLowerCase()]: values.length > 0 ? values.join(',') : value });
} }
}); });
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册