提交 2e9252b2 编写于 作者: ibizdev's avatar ibizdev

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

上级 c5af1bfc
...@@ -712,7 +712,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -712,7 +712,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/ */
public load(opt: any = {}): void { public load(opt: any = {}): void {
if(!this.loadAction){ if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGroupByCodelistListView' + (this.$t('app.searchForm.notConfig.loadAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCustomView_layout' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return; return;
} }
const arg: any = { ...opt }; const arg: any = { ...opt };
...@@ -748,7 +748,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -748,7 +748,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/ */
public async loadDraft(opt: any = {},mode?:string): Promise<any> { public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){ if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGroupByCodelistListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCustomView_layout' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return; return;
} }
const arg: any = { ...opt } ; const arg: any = { ...opt } ;
......
...@@ -1846,7 +1846,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1846,7 +1846,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/ */
public async load(opt: any = {}): Promise<any> { public async load(opt: any = {}): Promise<any> {
if(!this.loadAction){ if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr6EditView' + (this.$t('app.formpage.notconfig.loadaction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9EditView' + (this.$t('app.formpage.notconfig.loadaction') as string) });
return; return;
} }
const arg: any = { ...opt }; const arg: any = { ...opt };
...@@ -1898,7 +1898,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1898,7 +1898,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/ */
public async loadDraft(opt: any = {}): Promise<any> { public async loadDraft(opt: any = {}): Promise<any> {
if (!this.loaddraftAction) { if (!this.loaddraftAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr6EditView' + (this.$t('app.formpage.notconfig.loaddraftaction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9EditView' + (this.$t('app.formpage.notconfig.loaddraftaction') as string) });
return; return;
} }
const arg: any = { ...opt } ; const arg: any = { ...opt } ;
...@@ -1969,7 +1969,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1969,7 +1969,7 @@ export default class MainBase extends Vue implements ControlInterface {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction; const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){ if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction"; let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr6EditView' + (this.$t('app.formpage.notconfig.actionname') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9EditView' + (this.$t('app.formpage.notconfig.actionname') as string) });
return; return;
} }
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
...@@ -2077,7 +2077,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2077,7 +2077,7 @@ export default class MainBase extends Vue implements ControlInterface {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction; const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){ if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction"; let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr6EditView' + (this.$t('app.formpage.notconfig.actionname') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9EditView' + (this.$t('app.formpage.notconfig.actionname') as string) });
return; return;
} }
Object.assign(arg, { viewparams: this.viewparams }); Object.assign(arg, { viewparams: this.viewparams });
...@@ -2275,7 +2275,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2275,7 +2275,7 @@ export default class MainBase extends Vue implements ControlInterface {
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> { public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){ if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr6EditView' + (this.$t('app.formpage.notconfig.removeaction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9EditView' + (this.$t('app.formpage.notconfig.removeaction') as string) });
return; return;
} }
const arg: any = opt[0]; const arg: any = opt[0];
......
...@@ -610,6 +610,21 @@ export default class Main4Base extends Vue implements ControlInterface { ...@@ -610,6 +610,21 @@ export default class Main4Base extends Vue implements ControlInterface {
*/ */
public curEditRowData:any; public curEditRowData:any;
/**
* 表格聚合行为
*
* @type {string}
* @memberof Main4Base
*/
public aggAction:string ='';
/**
* 远程数据
*
* @type {any}
* @memberof Main4Base
*/
public remoteData:any = {};
...@@ -619,7 +634,7 @@ export default class Main4Base extends Vue implements ControlInterface { ...@@ -619,7 +634,7 @@ export default class Main4Base extends Vue implements ControlInterface {
* @type {boolean} * @type {boolean}
* @memberof Main4Base * @memberof Main4Base
*/ */
public isDisplay:boolean = true; public isDisplay:boolean = false;
/** /**
* 表格行编辑项校验错误提示信息 * 表格行编辑项校验错误提示信息
...@@ -982,6 +997,7 @@ export default class Main4Base extends Vue implements ControlInterface { ...@@ -982,6 +997,7 @@ export default class Main4Base extends Vue implements ControlInterface {
} }
} }
}, 300); }, 300);
this.getAggData();
this.$nextTick(() => { this.$nextTick(() => {
this.resetGridLayout(); this.resetGridLayout();
}) })
...@@ -1943,33 +1959,52 @@ export default class Main4Base extends Vue implements ControlInterface { ...@@ -1943,33 +1959,52 @@ export default class Main4Base extends Vue implements ControlInterface {
* @memberof Main4Base * @memberof Main4Base
*/ */
public getSummaries(param:any){ public getSummaries(param:any){
const { columns, data } = param; const { columns } = param;
const sums:Array<any> = []; const sums:Array<any> = [];
columns.forEach((column:any, index:number) => { columns.forEach((column:any, index:number) => {
if (index === 0) { if (index === 0) {
sums[index] = (this.$t('app.gridpage.sum') as string); sums[index] = (this.$t('app.gridpage.sum') as string);
return; return;
} }else if(index === (columns.length - 1)){
const values = data.map((item:any) => Number(item[column.property]));
if (!values.every((value:any) => isNaN(value))) {
if(Object.is(column.property,'booknumber')){
let tempData = values.reduce((prev:any, curr:any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = tempData.toFixed(3);
}
} else {
sums[index] = ''; sums[index] = '';
} return;
}else{
sums[index] = '';
if(Object.is(column.property,'booknumber')){
const value = Number(this.remoteData.booknumber);
if (!isNaN(value)) {
sums[index] = value;
}
}
}
}); });
return sums; return sums;
} }
/**
* 远程获取合计行数据
*
* @memberof Main4Base
*/
public getAggData(){
this.service.getAggData(this.aggAction,JSON.parse(JSON.stringify(this.context)),this.showBusyIndicator).then((response:any) =>{
if (!response.status || response.status !== 200) {
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
this.remoteData = response.data;
this.isDisplay = true;
}).catch((response:any) =>{
if (response && response.status === 401) {
return;
}
this.remoteData = {};
this.isDisplay = true;
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
})
}
/** /**
* 界面行为 * 界面行为
......
...@@ -295,6 +295,35 @@ export default class Main4Service extends ControlService { ...@@ -295,6 +295,35 @@ export default class Main4Service extends ControlService {
}); });
} }
/**
* 表格聚合加载数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Main4Service
*/
@Errorlog
public getAggData(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = new IBIZBOOKService();
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result = Promise.reject({});
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -670,7 +670,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface ...@@ -670,7 +670,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
*/ */
public load(opt: any = {}): void { public load(opt: any = {}): void {
if(!this.loadAction){ if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.searchForm.notConfig.loadAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCalendarView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return; return;
} }
const arg: any = { ...opt }; const arg: any = { ...opt };
...@@ -706,7 +706,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface ...@@ -706,7 +706,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
*/ */
public async loadDraft(opt: any = {},mode?:string): Promise<any> { public async loadDraft(opt: any = {},mode?:string): Promise<any> {
if(!this.loaddraftAction){ if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCalendarView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return; return;
} }
const arg: any = { ...opt } ; const arg: any = { ...opt } ;
......
...@@ -11,7 +11,7 @@ export default class Usr2Model { ...@@ -11,7 +11,7 @@ export default class Usr2Model {
* 获取数据项集合 * 获取数据项集合
* *
* @returns {any[]} * @returns {any[]}
* @memberof Usr2Dataviewexpbar_dataviewMode * @memberof Usr2DataViewMode
*/ */
public getDataItems(): any[] { public getDataItems(): any[] {
return [ return [
...@@ -40,6 +40,17 @@ export default class Usr2Model { ...@@ -40,6 +40,17 @@ export default class Usr2Model {
dataType: 'FONTKEY', dataType: 'FONTKEY',
}, },
{
name: 'n_ibizbookname_like',
prop: 'n_ibizbookname_like',
dataType: 'QUERYPARAM'
},
{
name: 'n_price_gtandeq',
prop: 'n_price_gtandeq',
dataType: 'QUERYPARAM'
},
{ {
name:'size', name:'size',
......
...@@ -933,7 +933,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -933,7 +933,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (!this.fetchAction) { if (!this.fetchAction) {
this.$Notice.error({ this.$Notice.error({
title: this.$t("app.commonWords.wrong") as string, title: this.$t("app.commonWords.wrong") as string,
desc: "IBIZOrderDetailSGridView9" + (this.$t("app.gridpage.notConfig.fetchAction") as string), desc: "IBIZOrderDetailSGridView" + (this.$t("app.gridpage.notConfig.fetchAction") as string),
}); });
return; return;
} }
...@@ -1073,7 +1073,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1073,7 +1073,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (!this.removeAction) { if (!this.removeAction) {
this.$Notice.error({ this.$Notice.error({
title: (this.$t('app.commonWords.wrong') as string), title: (this.$t('app.commonWords.wrong') as string),
desc: 'IBIZOrderDetailSGridView9' + (this.$t('app.gridpage.notConfig.removeAction') as string) desc: 'IBIZOrderDetailSGridView' + (this.$t('app.gridpage.notConfig.removeAction') as string)
}); });
return; return;
} }
...@@ -1187,7 +1187,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1187,7 +1187,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/ */
public addBatch(arg: any = {}): void { public addBatch(arg: any = {}): void {
if(!this.fetchAction){ if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView9'+(this.$t('app.gridpage.notConfig.fetchAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return; return;
} }
if(!arg){ if(!arg){
...@@ -2082,7 +2082,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2082,7 +2082,7 @@ export default class MainBase extends Vue implements ControlInterface {
try { try {
if (Object.is(item.rowDataState, 'create')) { if (Object.is(item.rowDataState, 'create')) {
if (!this.createAction) { if (!this.createAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView9'+(this.$t('app.gridpage.notConfig.createAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.createAction') as string) });
} else { } else {
Object.assign(item, { viewparams: this.viewparams }); Object.assign(item, { viewparams: this.viewparams });
const tempContext = Util.deepCopy(this.context); const tempContext = Util.deepCopy(this.context);
...@@ -2091,7 +2091,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2091,7 +2091,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
}else if (Object.is(item.rowDataState, 'update')){ }else if (Object.is(item.rowDataState, 'update')){
if (!this.updateAction) { if (!this.updateAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView9'+(this.$t('app.gridpage.notConfig.updateAction') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
} else { } else {
Object.assign(item, { viewparams: this.viewparams }); Object.assign(item, { viewparams: this.viewparams });
const tempContext = Util.deepCopy(this.context); const tempContext = Util.deepCopy(this.context);
...@@ -2167,7 +2167,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2167,7 +2167,7 @@ export default class MainBase extends Vue implements ControlInterface {
if(!this.loaddraftAction){ if(!this.loaddraftAction){
this.$Notice.error({ this.$Notice.error({
title: (this.$t('app.commonWords.wrong') as string), title: (this.$t('app.commonWords.wrong') as string),
desc: 'IBIZOrderDetailSGridView9' + (this.$t('app.gridpage.notConfig.loaddraftAction') as string) desc: 'IBIZOrderDetailSGridView' + (this.$t('app.gridpage.notConfig.loaddraftAction') as string)
}); });
return; return;
} }
......
{ {
"aggMode" : "PAGE", "aggMode" : "ALL",
"getAggPSAppDEDataSet" : {
"modelref" : true,
"id" : "FetchDefault"
},
"getAggPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK.json"
},
"codeName" : "Main4", "codeName" : "Main4",
"columnEnableLink" : 2, "columnEnableLink" : 2,
"controlType" : "GRID", "controlType" : "GRID",
...@@ -31,6 +39,7 @@ ...@@ -31,6 +39,7 @@
"id" : "DataImport" "id" : "DataImport"
}, },
"getPSDEGridColumns" : [ { "getPSDEGridColumns" : [ {
"aggField" : "type",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "FRONT", "cLConvertMode" : "FRONT",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
...@@ -59,6 +68,7 @@ ...@@ -59,6 +68,7 @@
"widthUnit" : "PX", "widthUnit" : "PX",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "author",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
...@@ -83,6 +93,7 @@ ...@@ -83,6 +93,7 @@
"widthUnit" : "PX", "widthUnit" : "PX",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "ibizbookname",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
...@@ -107,6 +118,7 @@ ...@@ -107,6 +118,7 @@
"widthUnit" : "STAR", "widthUnit" : "STAR",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "booknumber",
"aggMode" : "SUM", "aggMode" : "SUM",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
...@@ -132,6 +144,7 @@ ...@@ -132,6 +144,7 @@
"widthUnit" : "PX", "widthUnit" : "PX",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "press",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
......
...@@ -134,7 +134,15 @@ ...@@ -134,7 +134,15 @@
} }
} ], } ],
"getPSControls" : [ { "getPSControls" : [ {
"aggMode" : "PAGE", "aggMode" : "ALL",
"getAggPSAppDEDataSet" : {
"modelref" : true,
"id" : "FetchDefault"
},
"getAggPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK.json"
},
"codeName" : "Main4", "codeName" : "Main4",
"columnEnableLink" : 2, "columnEnableLink" : 2,
"controlType" : "GRID", "controlType" : "GRID",
...@@ -253,6 +261,7 @@ ...@@ -253,6 +261,7 @@
"id" : "DataImport" "id" : "DataImport"
}, },
"getPSDEGridColumns" : [ { "getPSDEGridColumns" : [ {
"aggField" : "type",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "FRONT", "cLConvertMode" : "FRONT",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
...@@ -281,6 +290,7 @@ ...@@ -281,6 +290,7 @@
"widthUnit" : "PX", "widthUnit" : "PX",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "author",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
...@@ -305,6 +315,7 @@ ...@@ -305,6 +315,7 @@
"widthUnit" : "PX", "widthUnit" : "PX",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "ibizbookname",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
...@@ -329,6 +340,7 @@ ...@@ -329,6 +340,7 @@
"widthUnit" : "STAR", "widthUnit" : "STAR",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "booknumber",
"aggMode" : "SUM", "aggMode" : "SUM",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
...@@ -354,6 +366,7 @@ ...@@ -354,6 +366,7 @@
"widthUnit" : "PX", "widthUnit" : "PX",
"enableSort" : true "enableSort" : true
}, { }, {
"aggField" : "press",
"align" : "LEFT", "align" : "LEFT",
"cLConvertMode" : "NONE", "cLConvertMode" : "NONE",
"getCapPSLanguageRes" : { "getCapPSLanguageRes" : {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册