提交 7873fa31 编写于 作者: ibizdev's avatar ibizdev

Mosher 发布系统代码 [后台服务,演示应用]

上级 59e0821f
......@@ -374,7 +374,7 @@ function getAppLocale(){
menuitem125: commonLogic.appcommonhandle("测试表单自定义布局多媒体",null),
menuitem126: commonLogic.appcommonhandle("自定义导航",null),
menuitem130: commonLogic.appcommonhandle("布局面板组件测试",null),
menuitem205: commonLogic.appcommonhandle("项布局面板测试",null),
menuitem205: commonLogic.appcommonhandle("项布局面板",null),
menuitem213: commonLogic.appcommonhandle("按钮测试",null),
menuitem190: commonLogic.appcommonhandle("视图",null),
menuitem191: commonLogic.appcommonhandle("单数据视图",null),
......
......@@ -374,7 +374,7 @@ function getAppLocale(){
menuitem125: commonLogic.appcommonhandle("测试表单自定义布局多媒体",null),
menuitem126: commonLogic.appcommonhandle("自定义导航",null),
menuitem130: commonLogic.appcommonhandle("布局面板组件测试",null),
menuitem205: commonLogic.appcommonhandle("项布局面板测试",null),
menuitem205: commonLogic.appcommonhandle("项布局面板",null),
menuitem213: commonLogic.appcommonhandle("按钮测试",null),
menuitem190: commonLogic.appcommonhandle("视图",null),
menuitem191: commonLogic.appcommonhandle("单数据视图",null),
......
......@@ -374,7 +374,7 @@ function getAppLocale(){
menuitem125: commonLogic.appcommonhandle("测试表单自定义布局多媒体",null),
menuitem126: commonLogic.appcommonhandle("自定义导航",null),
menuitem130: commonLogic.appcommonhandle("布局面板组件测试",null),
menuitem205: commonLogic.appcommonhandle("项布局面板测试",null),
menuitem205: commonLogic.appcommonhandle("项布局面板",null),
menuitem213: commonLogic.appcommonhandle("按钮测试",null),
menuitem190: commonLogic.appcommonhandle("视图",null),
menuitem191: commonLogic.appcommonhandle("单数据视图",null),
......
......@@ -3047,10 +3047,10 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
{
id: '4A688D7A-310A-41F7-9464-175598FB4E16',
name: 'menuitem205',
text: '项布局面板测试',
text: '项布局面板',
type: 'MENUITEM',
counterid: '',
tooltip: '项布局面板测试',
tooltip: '项布局面板',
expanded: false,
separator: false,
hidden: false,
......
......@@ -3216,10 +3216,10 @@ export default class MainMenuModel {
{
id: '4A688D7A-310A-41F7-9464-175598FB4E16',
name: 'menuitem205',
text: '项布局面板测试',
text: '项布局面板',
type: 'MENUITEM',
counterid: '',
tooltip: '项布局面板测试',
tooltip: '项布局面板',
expanded: false,
separator: false,
hidden: false,
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZAPPCTRLGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZAPPEDITORGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZAPPEXTENDEDITORListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZAPPVIEWListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -691,7 +691,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCustomView_layout' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -725,22 +725,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCustomView_layout' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -763,7 +771,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -774,7 +786,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -813,7 +825,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -822,7 +838,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -683,22 +683,30 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
* @param {*} [opt={}]
* @memberof QUICKSEARCHFORMBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -721,7 +729,11 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -732,7 +744,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -771,7 +783,11 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -780,7 +796,11 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
* @memberof QUICKSEARCHFORMBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -688,22 +688,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZCustomCustomGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -726,7 +734,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -737,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -776,7 +788,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -785,7 +801,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZCustomer_INTFPickupGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -688,22 +688,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZCustomerPickupGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -726,7 +734,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -737,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -776,7 +788,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -785,7 +801,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZHardwareSGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -688,22 +688,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderPickupGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -726,7 +734,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -737,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -776,7 +788,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -785,7 +801,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -578,7 +578,7 @@ export default class ListExpBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderListExpView_layout' + (this.$t('app.list.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderListExpView' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
......@@ -694,7 +694,7 @@ export default class ListExpBase extends Vue implements ControlInterface {
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderListExpView_layout' + (this.$t('app.list.notConfig.removeAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderListExpView' + (this.$t('app.list.notConfig.removeAction') as string) });
return;
}
if (datas.length === 0) {
......@@ -789,7 +789,7 @@ export default class ListExpBase extends Vue implements ControlInterface {
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderListExpView_layout' + (this.$t('app.list.notConfig.createAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderListExpView' + (this.$t('app.list.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
......@@ -797,7 +797,7 @@ export default class ListExpBase extends Vue implements ControlInterface {
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: 'IBIZOrderListExpView_layout' + (this.$t('app.list.notConfig.updateAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: 'IBIZOrderListExpView' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.ibizorder){
......
......@@ -299,7 +299,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZOrderSF1GridViewBase
* @memberof IBIZOrderPickupGridViewBase
*/
public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
......@@ -441,20 +441,6 @@ export default class MainBase extends Vue implements ControlInterface {
return this.selections[0];
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof MainBase
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof MainBase
*/
@Prop() public opendata: any;
/**
* 是否嵌入关系界面
......@@ -989,7 +975,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (!this.fetchAction) {
this.$Notice.error({
title: this.$t("app.commonWords.wrong") as string,
desc: "IBIZOrderSF1GridView" + (this.$t("app.gridpage.notConfig.fetchAction") as string),
desc: "IBIZOrderPickupGridView" + (this.$t("app.gridpage.notConfig.fetchAction") as string),
});
return;
}
......@@ -1118,7 +1104,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (!this.removeAction) {
this.$Notice.error({
title: (this.$t('app.commonWords.wrong') as string),
desc: 'IBIZOrderSF1GridView' + (this.$t('app.gridpage.notConfig.removeAction') as string)
desc: 'IBIZOrderPickupGridView' + (this.$t('app.gridpage.notConfig.removeAction') as string)
});
return;
}
......@@ -1232,7 +1218,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderSF1GridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderPickupGridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(!arg){
......@@ -2163,7 +2149,7 @@ export default class MainBase extends Vue implements ControlInterface {
try {
if (Object.is(item.rowDataState, 'create')) {
if (!this.createAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderSF1GridView'+(this.$t('app.gridpage.notConfig.createAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderPickupGridView'+(this.$t('app.gridpage.notConfig.createAction') as string) });
} else {
Object.assign(item, { viewparams: this.viewparams });
const tempContext = Util.deepCopy(this.context);
......@@ -2172,7 +2158,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
}else if (Object.is(item.rowDataState, 'update')){
if (!this.updateAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderSF1GridView'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderPickupGridView'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
} else {
Object.assign(item, { viewparams: this.viewparams });
const tempContext = Util.deepCopy(this.context);
......@@ -2248,7 +2234,7 @@ export default class MainBase extends Vue implements ControlInterface {
if(!this.loaddraftAction){
this.$Notice.error({
title: (this.$t('app.commonWords.wrong') as string),
desc: 'IBIZOrderSF1GridView' + (this.$t('app.gridpage.notConfig.loaddraftAction') as string)
desc: 'IBIZOrderPickupGridView' + (this.$t('app.gridpage.notConfig.loaddraftAction') as string)
});
return;
}
......
......@@ -104,21 +104,6 @@ export default class MainModel {
prop: 'n_ibizordername_like',
dataType: 'QUERYPARAM'
},
{
name: 'n_orderstate_eq',
prop: 'n_orderstate_eq',
dataType: 'QUERYPARAM'
},
{
name: 'n_ordertime_gt',
prop: 'n_ordertime_gt',
dataType: 'QUERYPARAM'
},
{
name: 'n_ordertime_lt',
prop: 'n_ordertime_lt',
dataType: 'QUERYPARAM'
},
{
name:'size',
......
......@@ -798,22 +798,30 @@ export default class UIPART_0013Base extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof UIPART_0013Base
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderSF1GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -836,7 +844,11 @@ export default class UIPART_0013Base extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -847,7 +859,7 @@ export default class UIPART_0013Base extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -886,7 +898,11 @@ export default class UIPART_0013Base extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -895,7 +911,11 @@ export default class UIPART_0013Base extends Vue implements ControlInterface {
* @memberof UIPART_0013Base
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZSample0002PickupGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -688,22 +688,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZSample0003GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -726,7 +734,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -737,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -776,7 +788,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -785,7 +801,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZSample0014GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZSample0018GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZSample0021GridView_layout' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZSoftwareSuitSGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -652,22 +652,30 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public loadDraft(opt: any = {},mode?:string): void {
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZUNIProductPickupGridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
Object.assign(arg,{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
Object.assign(arg, { viewparams:this.viewparams });
if (!(await this.handleCtrlEvents('onbeforeloaddraft', { data: arg }))) {
return;
}
try {
const response = await this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response.status || response.status !== 200) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return response;
}
if (!(await this.handleCtrlEvents('onloaddraftsuccess', { data: response.data }))) {
return;
}
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
......@@ -690,7 +698,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}).catch((response: any) => {
return response;
} catch(response: any) {
if (!(await this.handleCtrlEvents('onloaddrafterror', { data: response && response.data ? response.data : arg }))) {
return;
}
if (response && response.status === 401) {
return;
}
......@@ -701,7 +713,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
}
/**
......@@ -740,7 +752,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('search', this.data);
this.handleCtrlEvents('onsearch', { }).then((result: boolean) => {
if (result) {
this.$emit('search', this.data);
}
})
}
/**
......@@ -749,7 +765,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public onReset() {
this.loadDraft({},'RESET');
this.handleCtrlEvents('onreset', { }).then((result: boolean) => {
if (result) {
this.loadDraft({},'RESET');
}
})
}
}
</script>
......
......@@ -3673,7 +3673,7 @@
"tooltip" : "布局面板组件测试"
}, {
"accUserMode" : 2,
"caption" : "项布局面板测试",
"caption" : "项布局面板",
"itemType" : "MENUITEM",
"name" : "menuitem205",
"getPSAppFunc" : {
......@@ -3688,7 +3688,7 @@
"colMD" : 24,
"layout" : "TABLE_24COL"
},
"tooltip" : "项布局面板测试"
"tooltip" : "项布局面板"
}, {
"accUserMode" : 2,
"caption" : "按钮测试",
......
......@@ -2055,14 +2055,14 @@
"tooltip" : "布局面板组件测试"
}, {
"accUserMode" : 2,
"caption" : "项布局面板测试",
"caption" : "项布局面板",
"itemType" : "MENUITEM",
"name" : "menuitem205",
"getPSAppFunc" : {
"modelref" : true,
"id" : "AppFunc125"
},
"tooltip" : "项布局面板测试"
"tooltip" : "项布局面板"
}, {
"accUserMode" : 2,
"caption" : "按钮测试",
......
......@@ -18759,7 +18759,7 @@
"tooltip" : "布局面板组件测试"
}, {
"accUserMode" : 2,
"caption" : "项布局面板测试",
"caption" : "项布局面板",
"itemType" : "MENUITEM",
"name" : "menuitem205",
"getPSAppFunc" : {
......@@ -18774,7 +18774,7 @@
"colMD" : 24,
"layout" : "TABLE_24COL"
},
"tooltip" : "项布局面板测试"
"tooltip" : "项布局面板"
}, {
"accUserMode" : 2,
"caption" : "按钮测试",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册