提交 e6a44e4c 编写于 作者: llz's avatar llz

Merge remote-tracking branch 'origin/dev' into dev

...@@ -65,7 +65,7 @@ export default class AppPicker extends Vue { ...@@ -65,7 +65,7 @@ export default class AppPicker extends Vue {
* 视图上下文 * 视图上下文
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop() public context!: any; @Prop() public context!: any;
...@@ -73,7 +73,7 @@ export default class AppPicker extends Vue { ...@@ -73,7 +73,7 @@ export default class AppPicker extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -81,15 +81,23 @@ export default class AppPicker extends Vue { ...@@ -81,15 +81,23 @@ export default class AppPicker extends Vue {
* AC参数 * AC参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop({default: () => {}}) public acParams?: any; @Prop({default: () => {}}) public acParams?: any;
/**
* 外键值附加数据
*
* @type {*}
* @memberof AppPicker
*/
@Prop() public pickUpData?: string;
/** /**
* 表单服务 * 表单服务
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop() public service?: any; @Prop() public service?: any;
...@@ -97,7 +105,7 @@ export default class AppPicker extends Vue { ...@@ -97,7 +105,7 @@ export default class AppPicker extends Vue {
* 应用实体主信息属性名称 * 应用实体主信息属性名称
* *
* @type {string} * @type {string}
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
@Prop({default: 'srfmajortext'}) public deMajorField!: string; @Prop({default: 'srfmajortext'}) public deMajorField!: string;
...@@ -105,7 +113,7 @@ export default class AppPicker extends Vue { ...@@ -105,7 +113,7 @@ export default class AppPicker extends Vue {
* 应用实体主键属性名称 * 应用实体主键属性名称
* *
* @type {string} * @type {string}
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
@Prop({default: 'srfkey'}) public deKeyField!: string; @Prop({default: 'srfkey'}) public deKeyField!: string;
...@@ -240,7 +248,7 @@ export default class AppPicker extends Vue { ...@@ -240,7 +248,7 @@ export default class AppPicker extends Vue {
* 输入状态 * 输入状态
* *
* @type {boolean} * @type {boolean}
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
public inputState: boolean = false; public inputState: boolean = false;
...@@ -397,6 +405,7 @@ export default class AppPicker extends Vue { ...@@ -397,6 +405,7 @@ export default class AppPicker extends Vue {
if (this.name) { if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField] }); this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField] });
} }
this.fillPickUpData(item);
} }
/** /**
...@@ -430,6 +439,7 @@ export default class AppPicker extends Vue { ...@@ -430,6 +439,7 @@ export default class AppPicker extends Vue {
if (this.name) { if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: '' }); this.$emit('formitemvaluechange', { name: this.name, value: '' });
} }
this.fillPickUpData();
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -672,6 +682,7 @@ export default class AppPicker extends Vue { ...@@ -672,6 +682,7 @@ export default class AppPicker extends Vue {
if (this.name) { if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField]?item[this.deMajorField]:item["srfmajortext"] }); this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField]?item[this.deMajorField]:item["srfmajortext"] });
} }
this.fillPickUpData(item);
} }
} }
...@@ -752,7 +763,7 @@ export default class AppPicker extends Vue { ...@@ -752,7 +763,7 @@ export default class AppPicker extends Vue {
/** /**
* 输入过程中 * 输入过程中
* *
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
public onInput($event: any) { public onInput($event: any) {
if (Object.is($event, this.value)) { if (Object.is($event, this.value)) {
...@@ -783,6 +794,34 @@ export default class AppPicker extends Vue { ...@@ -783,6 +794,34 @@ export default class AppPicker extends Vue {
appPicker.blur(); appPicker.blur();
} }
} }
/**
* 填充外键值附加数据
*
* @param {item} 数据集
* @memberof AppPicker
*/
public fillPickUpData(item?:any){
if(this.pickUpData){
let pickUpDataArray:Array<any> = this.pickUpData.split(";")
if(pickUpDataArray && pickUpDataArray.length >0){
for(let i=0;i<pickUpDataArray.length;i++){
if(item){
this.$emit("formitemvaluechange", {
name: pickUpDataArray[i],
value: item[pickUpDataArray[i]],
});
}else{
this.$emit("formitemvaluechange", {
name: pickUpDataArray[i],
value: "",
});
}
}
}
}
}
} }
......
...@@ -401,10 +401,10 @@ export default class MDViewEngine extends ViewEngine { ...@@ -401,10 +401,10 @@ export default class MDViewEngine extends ViewEngine {
if (this.view.viewparams && Object.keys(this.view.viewparams).length > 0) { if (this.view.viewparams && Object.keys(this.view.viewparams).length > 0) {
Object.assign(arg, this.view.viewparams); Object.assign(arg, this.view.viewparams);
} }
if (this.getSearchForm() && this.view.isExpandSearchForm) { if (this.getSearchForm()) {
Object.assign(arg, this.getSearchForm().getData()); Object.assign(arg, this.getSearchForm().getData());
} }
if (this.view && this.view.$refs.searchbar && this.view.isExpandSearchForm) { if (this.view && this.view.$refs.searchbar) {
Object.assign(arg, this.view.$refs.searchbar.getData()); Object.assign(arg, this.view.$refs.searchbar.getData());
} }
if (this.view && !this.view.isExpandSearchForm) { if (this.view && !this.view.isExpandSearchForm) {
......
...@@ -47,12 +47,21 @@ export const getLocalData = (state: any) => () => { ...@@ -47,12 +47,21 @@ export const getLocalData = (state: any) => () => {
* @param state * @param state
*/ */
export const getAppData = (state: any) => () => { export const getAppData = (state: any) => () => {
if(!state.appdata){
state.appdata = {};
}
let result:any = JSON.parse(JSON.stringify(state.appdata)); let result:any = JSON.parse(JSON.stringify(state.appdata));
let copyContext:any = result.context?result.context:{};
if(state.localdata && Object.keys(state.localdata).length >0){ if(state.localdata && Object.keys(state.localdata).length >0){
let copyContext:any = result.context?result.context:{};
Object.assign(copyContext,state.localdata); Object.assign(copyContext,state.localdata);
result.context = copyContext; }else if(localStorage.getItem('localdata')){
try{
Object.assign(copyContext,JSON.parse(localStorage.getItem('localdata') as string));
}catch(error){
console.warn(error);
}
} }
result.context = copyContext;
return result; return result;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册