提交 fc11a999 编写于 作者: WodahsOrez's avatar WodahsOrez

数据选择,动态代码表,自动完成类编辑器上下文参数处理

上级 e561d524
...@@ -100,12 +100,20 @@ export default class AppAutocomplete extends Vue { ...@@ -100,12 +100,20 @@ export default class AppAutocomplete extends Vue {
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 编辑器参数 * 局部上下文导航参数
* *
* @type {string} * @type {any}
* @memberof AppAutocomplete * @memberof AppAutocomplete
*/ */
@Prop() public itemParam?: any; @Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppAutocomplete
*/
@Prop() public localParam!:any;
/** /**
* 值项名称 * 值项名称
...@@ -119,7 +127,7 @@ export default class AppAutocomplete extends Vue { ...@@ -119,7 +127,7 @@ export default class AppAutocomplete extends Vue {
* 值 * 值
* *
* @type {*} * @type {*}
* @memberof AppPicker * @memberof AppAutocomplete
*/ */
@Model('change') public value?: any; @Model('change') public value?: any;
...@@ -127,7 +135,7 @@ export default class AppAutocomplete extends Vue { ...@@ -127,7 +135,7 @@ export default class AppAutocomplete extends Vue {
* 当前值 * 当前值
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppAutocomplete
*/ */
public curvalue: string = ''; public curvalue: string = '';
...@@ -160,7 +168,7 @@ export default class AppAutocomplete extends Vue { ...@@ -160,7 +168,7 @@ export default class AppAutocomplete extends Vue {
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPicker * @memberof AppAutocomplete
*/ */
@Watch('value') @Watch('value')
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
...@@ -277,19 +285,19 @@ export default class AppAutocomplete extends Vue { ...@@ -277,19 +285,19 @@ export default class AppAutocomplete extends Vue {
*/ */
public handlePublicParams(arg: any): boolean { public handlePublicParams(arg: any): boolean {
if (!this.data) { if (!this.data) {
this.$Notice.error({ title: (this.$t('components.appPicker.error') as any), desc: (this.$t('components.appPicker.formdataException') as any) }); this.$Notice.error({ title: (this.$t('components.AppAutocomplete.error') as any), desc: (this.$t('components.AppAutocomplete.formdataException') as any) });
return false; return false;
} }
// 合并表单参数 // 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.itemParam && this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(this.data,arg.context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam && this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(this.data,arg.param,this.itemParam.param); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
return true; return true;
......
...@@ -57,23 +57,31 @@ export default class AppCheckBox extends Vue { ...@@ -57,23 +57,31 @@ export default class AppCheckBox extends Vue {
* 传入表单数据 * 传入表单数据
* *
* @type {*} * @type {*}
* @memberof DropDownList * @memberof AppCheckBox
*/ */
@Prop() public data?: any; @Prop() public data?: any;
/** /**
* 传入额外参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof DropDownList * @memberof AppCheckBox
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppCheckBox
*/ */
@Prop() public itemParam?: any; @Prop() public localParam!:any;
/** /**
* 视图上下文 * 视图上下文
* *
* @type {*} * @type {*}
* @memberof AppAutocomplete * @memberof AppCheckBox
*/ */
@Prop() public context!: any; @Prop() public context!: any;
...@@ -81,7 +89,7 @@ export default class AppCheckBox extends Vue { ...@@ -81,7 +89,7 @@ export default class AppCheckBox extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppCheckBox
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -203,19 +211,19 @@ export default class AppCheckBox extends Vue { ...@@ -203,19 +211,19 @@ export default class AppCheckBox extends Vue {
* *
* @param {*} arg * @param {*} arg
* @returns * @returns
* @memberof DropDownList * @memberof AppCheckBox
*/ */
public handlePublicParams(arg: any) { public handlePublicParams(arg: any) {
// 合并表单参数 // 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.itemParam && this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(this.data,arg.context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam && this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(this.data,arg.param,this.itemParam.param); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
} }
...@@ -253,7 +261,7 @@ export default class AppCheckBox extends Vue { ...@@ -253,7 +261,7 @@ export default class AppCheckBox extends Vue {
/** /**
* 监听表单数据变化 * 监听表单数据变化
* *
* @memberof AppOrgSelect * @memberof AppCheckBox
*/ */
@Watch('data',{immediate:true,deep:true}) @Watch('data',{immediate:true,deep:true})
onDataChange(newVal: any, oldVal: any) { onDataChange(newVal: any, oldVal: any) {
......
...@@ -62,7 +62,7 @@ export default class AppEmbedPicker extends Vue { ...@@ -62,7 +62,7 @@ export default class AppEmbedPicker extends Vue {
* 表单数据 * 表单数据
* *
* @type {*} * @type {*}
* @memberof AppPicker * @memberof AppEmbedPicker
*/ */
@Prop() public data!: any; @Prop() public data!: any;
...@@ -95,7 +95,7 @@ export default class AppEmbedPicker extends Vue { ...@@ -95,7 +95,7 @@ export default class AppEmbedPicker extends Vue {
* 值项名称 * 值项名称
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppEmbedPicker
*/ */
@Prop() public valueItem?: string; @Prop() public valueItem?: string;
...@@ -103,7 +103,7 @@ export default class AppEmbedPicker extends Vue { ...@@ -103,7 +103,7 @@ export default class AppEmbedPicker extends Vue {
* 关联视图名称 * 关联视图名称
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppEmbedPicker
*/ */
@Prop() public refviewname?: string; @Prop() public refviewname?: string;
...@@ -127,17 +127,25 @@ export default class AppEmbedPicker extends Vue { ...@@ -127,17 +127,25 @@ export default class AppEmbedPicker extends Vue {
* 属性项名称 * 属性项名称
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppEmbedPicker
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 关联视图参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof AppEmbedPicker * @memberof AppEmbedPicker
*/ */
@Prop() public itemParam: any; @Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppEmbedPicker
*/
@Prop() public localParam!:any;
/** /**
* 是否忽略之变化 * 是否忽略之变化
...@@ -160,8 +168,8 @@ export default class AppEmbedPicker extends Vue { ...@@ -160,8 +168,8 @@ export default class AppEmbedPicker extends Vue {
* *
* @memberof AppEmbedPicker * @memberof AppEmbedPicker
*/ */
public setViewParam(activeData: any) { public setViewParam() {
if (!this.itemParam || !activeData) { if (!this.data) {
return; return;
} }
let arg: any = {}; let arg: any = {};
...@@ -169,17 +177,13 @@ export default class AppEmbedPicker extends Vue { ...@@ -169,17 +177,13 @@ export default class AppEmbedPicker extends Vue {
let param: any = JSON.parse(JSON.stringify(this.viewparams)); let param: any = JSON.parse(JSON.stringify(this.viewparams));
let context: any = JSON.parse(JSON.stringify(this.context)); let context: any = JSON.parse(JSON.stringify(this.context));
// 附加参数处理 // 附加参数处理
if (this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(activeData,context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(context,_context); Object.assign(arg.context,_context);
}
if (this.itemParam.param) {
let _param = this.$util.formatData(activeData,param,this.itemParam.param);
Object.assign(param,_param);
} }
if (this.itemParam.parentdata) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _parentdata = this.$util.formatData(activeData,param,this.itemParam.parentdata); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(param,_parentdata); Object.assign(arg.param,_param);
} }
this.viewdata = JSON.stringify(context); this.viewdata = JSON.stringify(context);
this.viewparam = JSON.stringify(param); this.viewparam = JSON.stringify(param);
...@@ -196,7 +200,7 @@ export default class AppEmbedPicker extends Vue { ...@@ -196,7 +200,7 @@ export default class AppEmbedPicker extends Vue {
onActivedataChange(newVal: any, oldVal: any) { onActivedataChange(newVal: any, oldVal: any) {
const newFormData: any = JSON.parse(newVal); const newFormData: any = JSON.parse(newVal);
const oldDormData: any = JSON.parse(oldVal); const oldDormData: any = JSON.parse(oldVal);
this.setViewParam(newFormData); this.setViewParam();
if (!this.refreshitems || this.ignorefieldvaluechange) { if (!this.refreshitems || this.ignorefieldvaluechange) {
return; return;
} }
...@@ -215,7 +219,7 @@ export default class AppEmbedPicker extends Vue { ...@@ -215,7 +219,7 @@ export default class AppEmbedPicker extends Vue {
if(this.formState) { if(this.formState) {
this.formStateEvent = this.formState.subscribe(({ tag, action, data }) => { this.formStateEvent = this.formState.subscribe(({ tag, action, data }) => {
if (Object.is('load', action)) { if (Object.is('load', action)) {
this.setViewParam(JSON.parse(this.data)); this.setViewParam();
} }
}); });
} }
......
...@@ -45,12 +45,20 @@ export default class AppMpicker extends Vue { ...@@ -45,12 +45,20 @@ export default class AppMpicker extends Vue {
@Prop() curvalue?: any; @Prop() curvalue?: any;
/** /**
* 表单项参数 * 局部上下文导航参数
* *
* @type {any} * @type {any}
* @memberof AppPicker * @memberof AppMpicker
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppMpicker
*/ */
@Prop() public itemParam: any; @Prop() public localParam!:any;
/** /**
* 表单项名称 * 表单项名称
...@@ -61,7 +69,7 @@ export default class AppMpicker extends Vue { ...@@ -61,7 +69,7 @@ export default class AppMpicker extends Vue {
* 视图上下文 * 视图上下文
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppMpicker
*/ */
@Prop() public context!: any; @Prop() public context!: any;
...@@ -69,7 +77,7 @@ export default class AppMpicker extends Vue { ...@@ -69,7 +77,7 @@ export default class AppMpicker extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppMpicker
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -77,7 +85,7 @@ export default class AppMpicker extends Vue { ...@@ -77,7 +85,7 @@ export default class AppMpicker extends Vue {
* AC参数 * AC参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppMpicker
*/ */
@Prop({default: () => {}}) public acParams?: any; @Prop({default: () => {}}) public acParams?: any;
...@@ -85,7 +93,7 @@ export default class AppMpicker extends Vue { ...@@ -85,7 +93,7 @@ export default class AppMpicker extends Vue {
* 应用实体主信息属性名称 * 应用实体主信息属性名称
* *
* @type {string} * @type {string}
* @memberof AppAutocomplete * @memberof AppMpicker
*/ */
@Prop({default: 'srfmajortext'}) public deMajorField!: string; @Prop({default: 'srfmajortext'}) public deMajorField!: string;
...@@ -93,7 +101,7 @@ export default class AppMpicker extends Vue { ...@@ -93,7 +101,7 @@ export default class AppMpicker extends Vue {
* 应用实体主键属性名称 * 应用实体主键属性名称
* *
* @type {string} * @type {string}
* @memberof AppAutocomplete * @memberof AppMpicker
*/ */
@Prop({default: 'srfkey'}) public deKeyField!: string; @Prop({default: 'srfkey'}) public deKeyField!: string;
...@@ -101,7 +109,7 @@ export default class AppMpicker extends Vue { ...@@ -101,7 +109,7 @@ export default class AppMpicker extends Vue {
* 表单服务 * 表单服务
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppMpicker
*/ */
@Prop() public service?: any; @Prop() public service?: any;
...@@ -242,19 +250,19 @@ export default class AppMpicker extends Vue { ...@@ -242,19 +250,19 @@ export default class AppMpicker extends Vue {
*/ */
public handlePublicParams(arg: any): boolean { public handlePublicParams(arg: any): boolean {
if (!this.activeData) { if (!this.activeData) {
this.$Notice.error({ title: (this.$t('components.appPicker.error') as any), desc: (this.$t('components.appPicker.formdataException') as any) }); this.$Notice.error({ title: (this.$t('components.AppMpicker.error') as any), desc: (this.$t('components.AppMpicker.formdataException') as any) });
return false; return false;
} }
// 合并表单参数 // 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.itemParam && this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(this.activeData,arg.context,this.itemParam.context); let _context = this.$util.computedNavData(this.activeData,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam && this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(this.activeData,arg.param,this.itemParam.param); let _param = this.$util.computedNavData(this.activeData,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
return true; return true;
......
...@@ -65,14 +65,14 @@ export default class AppRadioGroup extends Vue { ...@@ -65,14 +65,14 @@ export default class AppRadioGroup extends Vue {
* 传入表单数据 * 传入表单数据
* *
* @type {*} * @type {*}
* @memberof DropDownList * @memberof AppRadioGroup
*/ */
@Prop() public data?: any; @Prop() public data?: any;
/** /**
* 监听表单数据变化 * 监听表单数据变化
* *
* @memberof AppOrgSelect * @memberof AppRadioGroup
*/ */
@Watch('data',{immediate:true,deep:true}) @Watch('data',{immediate:true,deep:true})
onDataChange(newVal: any, oldVal: any) { onDataChange(newVal: any, oldVal: any) {
...@@ -103,18 +103,26 @@ export default class AppRadioGroup extends Vue { ...@@ -103,18 +103,26 @@ export default class AppRadioGroup extends Vue {
@Prop() public disabled?: boolean; @Prop() public disabled?: boolean;
/** /**
* 传入额外参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof DropDownList * @memberof AppRadioGroup
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppRadioGroup
*/ */
@Prop() public itemParam?: any; @Prop() public localParam!:any;
/** /**
* 视图上下文 * 视图上下文
* *
* @type {*} * @type {*}
* @memberof AppAutocomplete * @memberof AppRadioGroup
*/ */
@Prop() public context!: any; @Prop() public context!: any;
...@@ -122,7 +130,7 @@ export default class AppRadioGroup extends Vue { ...@@ -122,7 +130,7 @@ export default class AppRadioGroup extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppRadioGroup
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -161,19 +169,19 @@ export default class AppRadioGroup extends Vue { ...@@ -161,19 +169,19 @@ export default class AppRadioGroup extends Vue {
* *
* @param {*} arg * @param {*} arg
* @returns * @returns
* @memberof DropDownList * @memberof AppRadioGroup
*/ */
public handlePublicParams(arg: any) { public handlePublicParams(arg: any) {
// 合并表单参数 // 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.itemParam && this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(this.data,arg.context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam && this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(this.data,arg.param,this.itemParam.param); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
} }
......
...@@ -72,12 +72,20 @@ export default class AppSpan extends Vue { ...@@ -72,12 +72,20 @@ export default class AppSpan extends Vue {
@Prop() public data?: any; @Prop() public data?: any;
/** /**
* 传入额外参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof AppSpan
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppSpan * @memberof AppSpan
*/ */
@Prop() public itemParam?: any; @Prop() public localParam!:any;
/** /**
* 视图上下文 * 视图上下文
......
...@@ -36,7 +36,7 @@ export default class AppTreePicker extends Vue { ...@@ -36,7 +36,7 @@ export default class AppTreePicker extends Vue {
* 视图上下文 * 视图上下文
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppTreePicker
*/ */
@Prop() public context!: any; @Prop() public context!: any;
...@@ -44,7 +44,7 @@ export default class AppTreePicker extends Vue { ...@@ -44,7 +44,7 @@ export default class AppTreePicker extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppTreePicker
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -52,7 +52,7 @@ export default class AppTreePicker extends Vue { ...@@ -52,7 +52,7 @@ export default class AppTreePicker extends Vue {
* 表单数据 * 表单数据
* *
* @type {*} * @type {*}
* @memberof AppPicker * @memberof AppTreePicker
*/ */
@Prop() public data!: any; @Prop() public data!: any;
...@@ -68,7 +68,7 @@ export default class AppTreePicker extends Vue { ...@@ -68,7 +68,7 @@ export default class AppTreePicker extends Vue {
* 是否启用 * 是否启用
* *
* @type {boolean} * @type {boolean}
* @memberof AppPicker * @memberof AppTreePicker
*/ */
@Prop({default: false}) public disabled!: boolean; @Prop({default: false}) public disabled!: boolean;
...@@ -101,7 +101,7 @@ export default class AppTreePicker extends Vue { ...@@ -101,7 +101,7 @@ export default class AppTreePicker extends Vue {
* 值项名称 * 值项名称
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppTreePicker
*/ */
@Prop() public valueItem?: string; @Prop() public valueItem?: string;
...@@ -109,7 +109,7 @@ export default class AppTreePicker extends Vue { ...@@ -109,7 +109,7 @@ export default class AppTreePicker extends Vue {
* 关联视图名称 * 关联视图名称
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppTreePicker
*/ */
@Prop() public refviewname?: string; @Prop() public refviewname?: string;
...@@ -125,17 +125,25 @@ export default class AppTreePicker extends Vue { ...@@ -125,17 +125,25 @@ export default class AppTreePicker extends Vue {
* 属性项名称 * 属性项名称
* *
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppTreePicker
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 关联视图参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof AppTreePicker * @memberof AppTreePicker
*/ */
@Prop() public itemParam: any; @Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppTreePicker
*/
@Prop() public localParam!:any;
/** /**
* 是否忽略之变化 * 是否忽略之变化
...@@ -210,8 +218,8 @@ export default class AppTreePicker extends Vue { ...@@ -210,8 +218,8 @@ export default class AppTreePicker extends Vue {
* *
* @memberof AppTreePicker * @memberof AppTreePicker
*/ */
public setViewParam(activeData: any) { public setViewParam() {
if (!this.itemParam || !activeData) { if (!this.data) {
return; return;
} }
let arg: any = {}; let arg: any = {};
...@@ -219,17 +227,13 @@ export default class AppTreePicker extends Vue { ...@@ -219,17 +227,13 @@ export default class AppTreePicker extends Vue {
let param: any = JSON.parse(JSON.stringify(this.viewparams)); let param: any = JSON.parse(JSON.stringify(this.viewparams));
let context: any = JSON.parse(JSON.stringify(this.context)); let context: any = JSON.parse(JSON.stringify(this.context));
// 附加参数处理 // 附加参数处理
if (this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(activeData,context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(activeData,param,this.itemParam.param); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(param,_param); Object.assign(arg.param,_param);
}
if (this.itemParam.parentdata) {
let _parentdata = this.$util.formatData(activeData,param,this.itemParam.parentdata);
Object.assign(param,_parentdata);
} }
this.viewdata = JSON.stringify(context); this.viewdata = JSON.stringify(context);
this.viewparam = JSON.stringify(param); this.viewparam = JSON.stringify(param);
...@@ -240,13 +244,13 @@ export default class AppTreePicker extends Vue { ...@@ -240,13 +244,13 @@ export default class AppTreePicker extends Vue {
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppFormDRUIPart * @memberof AppTreePicker
*/ */
@Watch('data') @Watch('data')
onActivedataChange(newVal: any, oldVal: any) { onActivedataChange(newVal: any, oldVal: any) {
const newFormData: any = JSON.parse(newVal); const newFormData: any = JSON.parse(newVal);
const oldDormData: any = JSON.parse(oldVal); const oldDormData: any = JSON.parse(oldVal);
this.setViewParam(newFormData); this.setViewParam();
if (!this.refreshitems || this.ignorefieldvaluechange) { if (!this.refreshitems || this.ignorefieldvaluechange) {
return; return;
} }
...@@ -261,7 +265,7 @@ export default class AppTreePicker extends Vue { ...@@ -261,7 +265,7 @@ export default class AppTreePicker extends Vue {
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPicker * @memberof AppTreePicker
*/ */
@Watch('value') @Watch('value')
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
...@@ -277,7 +281,7 @@ export default class AppTreePicker extends Vue { ...@@ -277,7 +281,7 @@ export default class AppTreePicker extends Vue {
if(this.formState) { if(this.formState) {
this.formStateEvent = this.formState.subscribe(({ tag, action, data }) => { this.formStateEvent = this.formState.subscribe(({ tag, action, data }) => {
if (Object.is('load', action)) { if (Object.is('load', action)) {
this.setViewParam(JSON.parse(this.data)); this.setViewParam();
} }
}); });
} }
...@@ -286,7 +290,7 @@ export default class AppTreePicker extends Vue { ...@@ -286,7 +290,7 @@ export default class AppTreePicker extends Vue {
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof SelectType * @memberof AppTreePicker
*/ */
public destroyed() { public destroyed() {
if (this.formStateEvent) { if (this.formStateEvent) {
......
...@@ -79,12 +79,20 @@ export default class CodeList extends Vue { ...@@ -79,12 +79,20 @@ export default class CodeList extends Vue {
@Prop() public data?: any; @Prop() public data?: any;
/** /**
* 传入额外参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof CodeList
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof CodeList * @memberof CodeList
*/ */
@Prop() public itemParam?: any; @Prop() public localParam!:any;
/** /**
* 视图上下文 * 视图上下文
...@@ -270,12 +278,12 @@ export default class CodeList extends Vue { ...@@ -270,12 +278,12 @@ export default class CodeList extends Vue {
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.itemParam && this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(this.data,arg.context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam && this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(this.data,arg.param,this.itemParam.param); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
} }
......
...@@ -85,12 +85,20 @@ export default class DropDownListMpicker extends Vue { ...@@ -85,12 +85,20 @@ export default class DropDownListMpicker extends Vue {
@Prop() public placeholder?: string; @Prop() public placeholder?: string;
/** /**
* 传入额外参数 * 局部上下文导航参数
* *
* @type {*} * @type {any}
* @memberof DropDownListMpicker
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof DropDownListMpicker * @memberof DropDownListMpicker
*/ */
@Prop() public itemParam?: any; @Prop() public localParam!:any;
/** /**
* 视图上下文 * 视图上下文
...@@ -157,12 +165,12 @@ export default class DropDownListMpicker extends Vue { ...@@ -157,12 +165,12 @@ export default class DropDownListMpicker extends Vue {
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.itemParam.context) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.formatData(this.data,arg.context,this.itemParam.context); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context); Object.assign(arg.context,_context);
} }
if (this.itemParam.param) { if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.formatData(this.data,arg.param,this.itemParam.param); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册