提交 24931140 编写于 作者: KK's avatar KK

update 编辑器 导航上下文、导航参数

上级 2f519bf9
...@@ -79,6 +79,39 @@ ...@@ -79,6 +79,39 @@
*/ */
@Prop() public type!: string; @Prop() public type!: string;
/**
* 导航参数
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateParam?: any;
/**
* 导航上下文
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateContext?: any;
/**
* 应用上下文
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected context?: any;
/**
* 是否缓存
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: true }) protected isCache?: boolean;
public created() { public created() {
if (this.tag && this.type) { if (this.tag && this.type) {
if (Object.is(this.type, "dynamic")) { if (Object.is(this.type, "dynamic")) {
...@@ -91,7 +124,12 @@ ...@@ -91,7 +124,12 @@
this.options = []; this.options = [];
}); });
} else { } else {
this.options = this.$store.getters.getCodeListItems(this.tag); // 处理导航参数、上下文参数
let _context: any = {};
let _queryParam: any = {};
Object.assign(_context,this.context,this.navigateContext);
Object.assign(_queryParam,this.navigateParam);
this.options = this.$store.getters.getCodeListItems(this.tag ,this.isCache, { ..._context }, _queryParam);
} }
} }
} }
......
...@@ -168,6 +168,22 @@ export default class AppPicker extends Vue { ...@@ -168,6 +168,22 @@ export default class AppPicker extends Vue {
*/ */
@Model('change') public value?: any; @Model('change') public value?: any;
/**
* 导航参数
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateParam?: any;
/**
* 导航上下文
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateContext?: any;
/** /**
* 当前值 * 当前值
* *
...@@ -686,8 +702,12 @@ export default class AppPicker extends Vue { ...@@ -686,8 +702,12 @@ export default class AppPicker extends Vue {
return false; return false;
} }
// 合并表单参数 // 合并表单参数
arg.param = JSON.parse(JSON.stringify(this.viewparams)); let _context: any = {};
arg.context = JSON.parse(JSON.stringify(this.context)); let _params: any = {};
Object.assign(_context,this.context,this.navigateContext);
Object.assign(_params,this.viewparams,this.navigateParam);
arg.param = JSON.parse(JSON.stringify(_params));
arg.context = JSON.parse(JSON.stringify(_context));
// 附加参数处理 // 附加参数处理
if (this.itemParam.context) { if (this.itemParam.context) {
// let _context = this.$util.formatData(this.data,this.itemParam.context); // let _context = this.$util.formatData(this.data,this.itemParam.context);
......
...@@ -144,6 +144,22 @@ export default class AppSelectDropDown extends Vue { ...@@ -144,6 +144,22 @@ export default class AppSelectDropDown extends Vue {
*/ */
@Model('change') public value?: any; @Model('change') public value?: any;
/**
* 导航参数
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateParam?: any;
/**
* 导航上下文
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateContext?: any;
/** /**
* 当前值 * 当前值
* *
...@@ -632,8 +648,12 @@ export default class AppSelectDropDown extends Vue { ...@@ -632,8 +648,12 @@ export default class AppSelectDropDown extends Vue {
return false; return false;
} }
// 合并表单参数 // 合并表单参数
arg.param = JSON.parse(JSON.stringify(this.viewparams)); let _context: any = {};
arg.context = JSON.parse(JSON.stringify(this.context)); let _params: any = {};
Object.assign(_context,this.context,this.navigateContext);
Object.assign(_params,this.viewparams,this.navigateParam);
arg.param = JSON.parse(JSON.stringify(_params));
arg.context = JSON.parse(JSON.stringify(_context));
// 附加参数处理 // 附加参数处理
if (this.itemParam.context) { if (this.itemParam.context) {
......
...@@ -118,6 +118,22 @@ export default class AppSelect extends Vue { ...@@ -118,6 +118,22 @@ export default class AppSelect extends Vue {
*/ */
@Prop({ default: {} }) protected context?: any; @Prop({ default: {} }) protected context?: any;
/**
* 导航参数
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateParam?: any;
/**
* 导航上下文
*
* @type {*}
* @memberof AppSelect
*/
@Prop({ default: {} }) protected navigateContext?: any;
/** /**
* 是否缓存 * 是否缓存
* *
...@@ -174,7 +190,12 @@ export default class AppSelect extends Vue { ...@@ -174,7 +190,12 @@ export default class AppSelect extends Vue {
if (!this.isCached) { if (!this.isCached) {
Loading.show(this.$t('app.loadding')); Loading.show(this.$t('app.loadding'));
} }
let response: any = await this.codeListService.getItems(this.tag, this.isCache, { ...this.context }, this.queryParam); // 处理导航参数、上下文参数
let _context: any = {};
let _queryParam: any = {};
Object.assign(_context,this.context,this.navigateContext);
Object.assign(_queryParam,this.queryParam,this.navigateParam);
let response: any = await this.codeListService.getItems(this.tag, this.isCache, { ..._context }, _queryParam);
if (!this.isCached) { if (!this.isCached) {
Loading.hidden(); Loading.hidden();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册