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

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

上级 c5af1bfc
......@@ -712,7 +712,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: '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;
}
const arg: any = { ...opt };
......@@ -748,7 +748,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public async loadDraft(opt: any = {},mode?:string): Promise<any> {
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;
}
const arg: any = { ...opt } ;
......
......@@ -1846,7 +1846,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public async load(opt: any = {}): Promise<any> {
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;
}
const arg: any = { ...opt };
......@@ -1898,7 +1898,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public async loadDraft(opt: any = {}): Promise<any> {
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;
}
const arg: any = { ...opt } ;
......@@ -1969,7 +1969,7 @@ export default class MainBase extends Vue implements ControlInterface {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
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;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -2077,7 +2077,7 @@ export default class MainBase extends Vue implements ControlInterface {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
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;
}
Object.assign(arg, { viewparams: this.viewparams });
......@@ -2275,7 +2275,7 @@ export default class MainBase extends Vue implements ControlInterface {
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
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;
}
const arg: any = opt[0];
......
......@@ -610,6 +610,21 @@ export default class Main4Base extends Vue implements ControlInterface {
*/
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 {
* @type {boolean}
* @memberof Main4Base
*/
public isDisplay:boolean = true;
public isDisplay:boolean = false;
/**
* 表格行编辑项校验错误提示信息
......@@ -982,6 +997,7 @@ export default class Main4Base extends Vue implements ControlInterface {
}
}
}, 300);
this.getAggData();
this.$nextTick(() => {
this.resetGridLayout();
})
......@@ -1943,33 +1959,52 @@ export default class Main4Base extends Vue implements ControlInterface {
* @memberof Main4Base
*/
public getSummaries(param:any){
const { columns, data } = param;
const { columns } = param;
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
if (index === 0) {
sums[index] = (this.$t('app.gridpage.sum') as string);
return;
}
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 {
}else if(index === (columns.length - 1)){
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 {
});
}
/**
* 表格聚合加载数据
*
* @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
*/
public load(opt: any = {}): void {
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;
}
const arg: any = { ...opt };
......@@ -706,7 +706,7 @@ export default class QUICKSEARCHFORMBase extends Vue implements ControlInterface
*/
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) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKCalendarView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
......
......@@ -11,7 +11,7 @@ export default class Usr2Model {
* 获取数据项集合
*
* @returns {any[]}
* @memberof Usr2Dataviewexpbar_dataviewMode
* @memberof Usr2DataViewMode
*/
public getDataItems(): any[] {
return [
......@@ -40,6 +40,17 @@ export default class Usr2Model {
dataType: 'FONTKEY',
},
{
name: 'n_ibizbookname_like',
prop: 'n_ibizbookname_like',
dataType: 'QUERYPARAM'
},
{
name: 'n_price_gtandeq',
prop: 'n_price_gtandeq',
dataType: 'QUERYPARAM'
},
{
name:'size',
......
......@@ -933,7 +933,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (!this.fetchAction) {
this.$Notice.error({
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;
}
......@@ -1073,7 +1073,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (!this.removeAction) {
this.$Notice.error({
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;
}
......@@ -1187,7 +1187,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: '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;
}
if(!arg){
......@@ -2082,7 +2082,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: '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 {
Object.assign(item, { viewparams: this.viewparams });
const tempContext = Util.deepCopy(this.context);
......@@ -2091,7 +2091,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: '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 {
Object.assign(item, { viewparams: this.viewparams });
const tempContext = Util.deepCopy(this.context);
......@@ -2167,7 +2167,7 @@ export default class MainBase extends Vue implements ControlInterface {
if(!this.loaddraftAction){
this.$Notice.error({
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;
}
......
{
"aggMode" : "PAGE",
"aggMode" : "ALL",
"getAggPSAppDEDataSet" : {
"modelref" : true,
"id" : "FetchDefault"
},
"getAggPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK.json"
},
"codeName" : "Main4",
"columnEnableLink" : 2,
"controlType" : "GRID",
......@@ -31,6 +39,7 @@
"id" : "DataImport"
},
"getPSDEGridColumns" : [ {
"aggField" : "type",
"align" : "LEFT",
"cLConvertMode" : "FRONT",
"getCapPSLanguageRes" : {
......@@ -59,6 +68,7 @@
"widthUnit" : "PX",
"enableSort" : true
}, {
"aggField" : "author",
"align" : "LEFT",
"cLConvertMode" : "NONE",
"getCapPSLanguageRes" : {
......@@ -83,6 +93,7 @@
"widthUnit" : "PX",
"enableSort" : true
}, {
"aggField" : "ibizbookname",
"align" : "LEFT",
"cLConvertMode" : "NONE",
"getCapPSLanguageRes" : {
......@@ -107,6 +118,7 @@
"widthUnit" : "STAR",
"enableSort" : true
}, {
"aggField" : "booknumber",
"aggMode" : "SUM",
"align" : "LEFT",
"cLConvertMode" : "NONE",
......@@ -132,6 +144,7 @@
"widthUnit" : "PX",
"enableSort" : true
}, {
"aggField" : "press",
"align" : "LEFT",
"cLConvertMode" : "NONE",
"getCapPSLanguageRes" : {
......
......@@ -134,7 +134,15 @@
}
} ],
"getPSControls" : [ {
"aggMode" : "PAGE",
"aggMode" : "ALL",
"getAggPSAppDEDataSet" : {
"modelref" : true,
"id" : "FetchDefault"
},
"getAggPSAppDataEntity" : {
"modelref" : true,
"path" : "PSSYSAPPS/Web/PSAPPDATAENTITIES/IBIZBOOK.json"
},
"codeName" : "Main4",
"columnEnableLink" : 2,
"controlType" : "GRID",
......@@ -253,6 +261,7 @@
"id" : "DataImport"
},
"getPSDEGridColumns" : [ {
"aggField" : "type",
"align" : "LEFT",
"cLConvertMode" : "FRONT",
"getCapPSLanguageRes" : {
......@@ -281,6 +290,7 @@
"widthUnit" : "PX",
"enableSort" : true
}, {
"aggField" : "author",
"align" : "LEFT",
"cLConvertMode" : "NONE",
"getCapPSLanguageRes" : {
......@@ -305,6 +315,7 @@
"widthUnit" : "PX",
"enableSort" : true
}, {
"aggField" : "ibizbookname",
"align" : "LEFT",
"cLConvertMode" : "NONE",
"getCapPSLanguageRes" : {
......@@ -329,6 +340,7 @@
"widthUnit" : "STAR",
"enableSort" : true
}, {
"aggField" : "booknumber",
"aggMode" : "SUM",
"align" : "LEFT",
"cLConvertMode" : "NONE",
......@@ -354,6 +366,7 @@
"widthUnit" : "PX",
"enableSort" : true
}, {
"aggField" : "press",
"align" : "LEFT",
"cLConvertMode" : "NONE",
"getCapPSLanguageRes" : {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册