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

lab_gzf 部署微服务应用

上级 bcd47138
...@@ -46,9 +46,11 @@ export class AuthServiceRegister { ...@@ -46,9 +46,11 @@ export class AuthServiceRegister {
this.allAuthService.set('eamlocationstate', () => import('@/authservice/eamlocation-state/eamlocation-state-auth-service')); this.allAuthService.set('eamlocationstate', () => import('@/authservice/eamlocation-state/eamlocation-state-auth-service'));
this.allAuthService.set('eamassettype', () => import('@/authservice/eamasset-type/eamasset-type-auth-service')); this.allAuthService.set('eamassettype', () => import('@/authservice/eamasset-type/eamasset-type-auth-service'));
this.allAuthService.set('eamassetstatemodelline', () => import('@/authservice/eamasset-state-model-line/eamasset-state-model-line-auth-service')); this.allAuthService.set('eamassetstatemodelline', () => import('@/authservice/eamasset-state-model-line/eamasset-state-model-line-auth-service'));
this.allAuthService.set('eamapplystatemodelline', () => import('@/authservice/eamapply-state-model-line/eamapply-state-model-line-auth-service'));
this.allAuthService.set('eamlocationstatemodelline', () => import('@/authservice/eamlocation-state-model-line/eamlocation-state-model-line-auth-service')); this.allAuthService.set('eamlocationstatemodelline', () => import('@/authservice/eamlocation-state-model-line/eamlocation-state-model-line-auth-service'));
this.allAuthService.set('eamasset', () => import('@/authservice/eamasset/eamasset-auth-service')); this.allAuthService.set('eamasset', () => import('@/authservice/eamasset/eamasset-auth-service'));
this.allAuthService.set('eamapplystate', () => import('@/authservice/eamapply-state/eamapply-state-auth-service')); this.allAuthService.set('eamapplystate', () => import('@/authservice/eamapply-state/eamapply-state-auth-service'));
this.allAuthService.set('eamapply', () => import('@/authservice/eamapply/eamapply-auth-service'));
this.allAuthService.set('eamassetstatemodel', () => import('@/authservice/eamasset-state-model/eamasset-state-model-auth-service')); this.allAuthService.set('eamassetstatemodel', () => import('@/authservice/eamasset-state-model/eamasset-state-model-auth-service'));
} }
......
import AuthService from '../auth-service';
/**
* 维护申请状态模型明细权限服务对象基类
*
* @export
* @class EAMApplyStateModelLineAuthServiceBase
* @extends {AuthService}
*/
export default class EAMApplyStateModelLineAuthServiceBase extends AuthService {
/**
* Creates an instance of EAMApplyStateModelLineAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof EAMApplyStateModelLineAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof EAMApplyStateModelLineAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import EAMApplyStateModelLineAuthServiceBase from './eamapply-state-model-line-auth-service-base';
/**
* 维护申请状态模型明细权限服务对象
*
* @export
* @class EAMApplyStateModelLineAuthService
* @extends {EAMApplyStateModelLineAuthServiceBase}
*/
export default class EAMApplyStateModelLineAuthService extends EAMApplyStateModelLineAuthServiceBase {
/**
* Creates an instance of EAMApplyStateModelLineAuthService.
*
* @param {*} [opts={}]
* @memberof EAMApplyStateModelLineAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import AuthService from '../auth-service';
/**
* 维护申请权限服务对象基类
*
* @export
* @class EAMApplyAuthServiceBase
* @extends {AuthService}
*/
export default class EAMApplyAuthServiceBase extends AuthService {
/**
* Creates an instance of EAMApplyAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof EAMApplyAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof EAMApplyAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import EAMApplyAuthServiceBase from './eamapply-auth-service-base';
/**
* 维护申请权限服务对象
*
* @export
* @class EAMApplyAuthService
* @extends {EAMApplyAuthServiceBase}
*/
export default class EAMApplyAuthService extends EAMApplyAuthServiceBase {
/**
* Creates an instance of EAMApplyAuthService.
*
* @param {*} [opts={}]
* @memberof EAMApplyAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
/**
* 维护申请状态模型明细
*
* @export
* @interface EAMApplyStateModelLine
*/
export interface EAMApplyStateModelLine {
/**
* 维护申请状态模型明细名称
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
eamapplystatemodellinename?: any;
/**
* 维护申请状态模型明细标识
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
eamapplystatemodellineid?: any;
/**
* 更新人
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
updateman?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
updatedate?: any;
/**
* 建立人
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
createman?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
createdate?: any;
/**
* 维护申请状态标识
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
eamapplystateid?: any;
/**
* 维护申请状态模型标识
*
* @returns {*}
* @memberof EAMApplyStateModelLine
*/
eamapplystatemodelid?: any;
}
\ No newline at end of file
/**
* 维护申请
*
* @export
* @interface EAMApply
*/
export interface EAMApply {
/**
* 更新人
*
* @returns {*}
* @memberof EAMApply
*/
updateman?: any;
/**
* 维护申请标识
*
* @returns {*}
* @memberof EAMApply
*/
eamapplyid?: any;
/**
* 建立人
*
* @returns {*}
* @memberof EAMApply
*/
createman?: any;
/**
* 维护申请名称
*
* @returns {*}
* @memberof EAMApply
*/
eamapplyname?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof EAMApply
*/
createdate?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof EAMApply
*/
updatedate?: any;
/**
* 维护申请类型标识
*
* @returns {*}
* @memberof EAMApply
*/
eamapplytypeid?: any;
/**
* 功能位置标识
*
* @returns {*}
* @memberof EAMApply
*/
eamlocationid?: any;
/**
* 资产标识
*
* @returns {*}
* @memberof EAMApply
*/
assetid?: any;
}
\ No newline at end of file
...@@ -5,9 +5,11 @@ import eamassetstate_en_US from '@locale/lanres/entities/eamasset-state/eamasset ...@@ -5,9 +5,11 @@ import eamassetstate_en_US from '@locale/lanres/entities/eamasset-state/eamasset
import eamlocationstate_en_US from '@locale/lanres/entities/eamlocation-state/eamlocation-state_en_US'; import eamlocationstate_en_US from '@locale/lanres/entities/eamlocation-state/eamlocation-state_en_US';
import eamassettype_en_US from '@locale/lanres/entities/eamasset-type/eamasset-type_en_US'; import eamassettype_en_US from '@locale/lanres/entities/eamasset-type/eamasset-type_en_US';
import eamassetstatemodelline_en_US from '@locale/lanres/entities/eamasset-state-model-line/eamasset-state-model-line_en_US'; import eamassetstatemodelline_en_US from '@locale/lanres/entities/eamasset-state-model-line/eamasset-state-model-line_en_US';
import eamapplystatemodelline_en_US from '@locale/lanres/entities/eamapply-state-model-line/eamapply-state-model-line_en_US';
import eamlocationstatemodelline_en_US from '@locale/lanres/entities/eamlocation-state-model-line/eamlocation-state-model-line_en_US'; import eamlocationstatemodelline_en_US from '@locale/lanres/entities/eamlocation-state-model-line/eamlocation-state-model-line_en_US';
import eamasset_en_US from '@locale/lanres/entities/eamasset/eamasset_en_US'; import eamasset_en_US from '@locale/lanres/entities/eamasset/eamasset_en_US';
import eamapplystate_en_US from '@locale/lanres/entities/eamapply-state/eamapply-state_en_US'; import eamapplystate_en_US from '@locale/lanres/entities/eamapply-state/eamapply-state_en_US';
import eamapply_en_US from '@locale/lanres/entities/eamapply/eamapply_en_US';
import eamassetstatemodel_en_US from '@locale/lanres/entities/eamasset-state-model/eamasset-state-model_en_US'; import eamassetstatemodel_en_US from '@locale/lanres/entities/eamasset-state-model/eamasset-state-model_en_US';
import components_en_US from '@locale/lanres/components/components_en_US'; import components_en_US from '@locale/lanres/components/components_en_US';
import codelist_en_US from '@locale/lanres/codelist/codelist_en_US'; import codelist_en_US from '@locale/lanres/codelist/codelist_en_US';
...@@ -247,9 +249,11 @@ export default { ...@@ -247,9 +249,11 @@ export default {
eamlocationstate: eamlocationstate_en_US, eamlocationstate: eamlocationstate_en_US,
eamassettype: eamassettype_en_US, eamassettype: eamassettype_en_US,
eamassetstatemodelline: eamassetstatemodelline_en_US, eamassetstatemodelline: eamassetstatemodelline_en_US,
eamapplystatemodelline: eamapplystatemodelline_en_US,
eamlocationstatemodelline: eamlocationstatemodelline_en_US, eamlocationstatemodelline: eamlocationstatemodelline_en_US,
eamasset: eamasset_en_US, eamasset: eamasset_en_US,
eamapplystate: eamapplystate_en_US, eamapplystate: eamapplystate_en_US,
eamapply: eamapply_en_US,
eamassetstatemodel: eamassetstatemodel_en_US, eamassetstatemodel: eamassetstatemodel_en_US,
}, },
components: components_en_US, components: components_en_US,
......
...@@ -5,9 +5,11 @@ import eamassetstate_zh_CN from '@locale/lanres/entities/eamasset-state/eamasset ...@@ -5,9 +5,11 @@ import eamassetstate_zh_CN from '@locale/lanres/entities/eamasset-state/eamasset
import eamlocationstate_zh_CN from '@locale/lanres/entities/eamlocation-state/eamlocation-state_zh_CN'; import eamlocationstate_zh_CN from '@locale/lanres/entities/eamlocation-state/eamlocation-state_zh_CN';
import eamassettype_zh_CN from '@locale/lanres/entities/eamasset-type/eamasset-type_zh_CN'; import eamassettype_zh_CN from '@locale/lanres/entities/eamasset-type/eamasset-type_zh_CN';
import eamassetstatemodelline_zh_CN from '@locale/lanres/entities/eamasset-state-model-line/eamasset-state-model-line_zh_CN'; import eamassetstatemodelline_zh_CN from '@locale/lanres/entities/eamasset-state-model-line/eamasset-state-model-line_zh_CN';
import eamapplystatemodelline_zh_CN from '@locale/lanres/entities/eamapply-state-model-line/eamapply-state-model-line_zh_CN';
import eamlocationstatemodelline_zh_CN from '@locale/lanres/entities/eamlocation-state-model-line/eamlocation-state-model-line_zh_CN'; import eamlocationstatemodelline_zh_CN from '@locale/lanres/entities/eamlocation-state-model-line/eamlocation-state-model-line_zh_CN';
import eamasset_zh_CN from '@locale/lanres/entities/eamasset/eamasset_zh_CN'; import eamasset_zh_CN from '@locale/lanres/entities/eamasset/eamasset_zh_CN';
import eamapplystate_zh_CN from '@locale/lanres/entities/eamapply-state/eamapply-state_zh_CN'; import eamapplystate_zh_CN from '@locale/lanres/entities/eamapply-state/eamapply-state_zh_CN';
import eamapply_zh_CN from '@locale/lanres/entities/eamapply/eamapply_zh_CN';
import eamassetstatemodel_zh_CN from '@locale/lanres/entities/eamasset-state-model/eamasset-state-model_zh_CN'; import eamassetstatemodel_zh_CN from '@locale/lanres/entities/eamasset-state-model/eamasset-state-model_zh_CN';
import components_zh_CN from '@locale/lanres/components/components_zh_CN'; import components_zh_CN from '@locale/lanres/components/components_zh_CN';
import codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN'; import codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN';
...@@ -246,9 +248,11 @@ export default { ...@@ -246,9 +248,11 @@ export default {
eamlocationstate: eamlocationstate_zh_CN, eamlocationstate: eamlocationstate_zh_CN,
eamassettype: eamassettype_zh_CN, eamassettype: eamassettype_zh_CN,
eamassetstatemodelline: eamassetstatemodelline_zh_CN, eamassetstatemodelline: eamassetstatemodelline_zh_CN,
eamapplystatemodelline: eamapplystatemodelline_zh_CN,
eamlocationstatemodelline: eamlocationstatemodelline_zh_CN, eamlocationstatemodelline: eamlocationstatemodelline_zh_CN,
eamasset: eamasset_zh_CN, eamasset: eamasset_zh_CN,
eamapplystate: eamapplystate_zh_CN, eamapplystate: eamapplystate_zh_CN,
eamapply: eamapply_zh_CN,
eamassetstatemodel: eamassetstatemodel_zh_CN, eamassetstatemodel: eamassetstatemodel_zh_CN,
}, },
components: components_zh_CN, components: components_zh_CN,
......
export default {
fields: {
eamapplystatemodellinename: "维护申请状态模型明细名称",
eamapplystatemodellineid: "维护申请状态模型明细标识",
updateman: "更新人",
updatedate: "更新时间",
createman: "建立人",
createdate: "建立时间",
eamapplystateid: "维护申请状态标识",
eamapplystatemodelid: "维护申请状态模型标识",
},
};
\ No newline at end of file
export default {
fields: {
eamapplystatemodellinename: "维护申请状态模型明细名称",
eamapplystatemodellineid: "维护申请状态模型明细标识",
updateman: "更新人",
updatedate: "更新时间",
createman: "建立人",
createdate: "建立时间",
eamapplystateid: "维护申请状态标识",
eamapplystatemodelid: "维护申请状态模型标识",
},
};
\ No newline at end of file
...@@ -109,69 +109,13 @@ export default { ...@@ -109,69 +109,13 @@ export default {
}, },
}, },
editviewtoolbar_toolbar: { editviewtoolbar_toolbar: {
tbitem10: { tbitem2: {
caption: "Save",
tip: "Save",
},
tbitem12: {
caption: "Save And New",
tip: "Save And New",
},
tbitem11: {
caption: "Save And Close", caption: "Save And Close",
tip: "Save And Close Window", tip: "Save And Close Window",
}, },
tbitem18: {
caption: "-",
tip: "",
},
tbitem9: {
caption: "Remove And Close",
tip: "Remove And Close Window",
},
tbitem19: {
caption: "-",
tip: "",
},
tbitem5: {
caption: "New",
tip: "New",
},
tbitem21: {
caption: "-",
tip: "",
},
tbitem1: { tbitem1: {
caption: "Copy", caption: "关闭",
tip: "Copy {0}", tip: "关闭",
},
tbitem22: {
caption: "-",
tip: "",
},
tbitem2: {
caption: "第一个记录",
tip: "第一个记录",
},
tbitem7: {
caption: "上一个记录",
tip: "上一个记录",
},
tbitem6: {
caption: "下一个记录",
tip: "下一个记录",
},
tbitem4: {
caption: "最后一个记录",
tip: "最后一个记录",
},
tbitem25: {
caption: "-",
tip: "",
},
tbitem3: {
caption: "Help",
tip: "Help",
}, },
}, },
}; };
\ No newline at end of file
...@@ -108,69 +108,13 @@ export default { ...@@ -108,69 +108,13 @@ export default {
}, },
}, },
editviewtoolbar_toolbar: { editviewtoolbar_toolbar: {
tbitem10: { tbitem2: {
caption: "保存",
tip: "保存",
},
tbitem12: {
caption: "保存并新建",
tip: "保存并新建",
},
tbitem11: {
caption: "保存并关闭", caption: "保存并关闭",
tip: "保存并关闭", tip: "保存并关闭",
}, },
tbitem18: {
caption: "-",
tip: "",
},
tbitem9: {
caption: "删除并关闭",
tip: "删除并关闭",
},
tbitem19: {
caption: "-",
tip: "",
},
tbitem5: {
caption: "新建",
tip: "新建",
},
tbitem21: {
caption: "-",
tip: "",
},
tbitem1: { tbitem1: {
caption: "拷贝", caption: "关闭",
tip: "拷贝", tip: "关闭",
},
tbitem22: {
caption: "-",
tip: "",
},
tbitem2: {
caption: "第一个记录",
tip: "第一个记录",
},
tbitem7: {
caption: "上一个记录",
tip: "上一个记录",
},
tbitem6: {
caption: "下一个记录",
tip: "下一个记录",
},
tbitem4: {
caption: "最后一个记录",
tip: "最后一个记录",
},
tbitem25: {
caption: "-",
tip: "",
},
tbitem3: {
caption: "帮助",
tip: "帮助",
}, },
}, },
}; };
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
eamapplyid: "维护申请标识",
createman: "建立人",
eamapplyname: "维护申请名称",
createdate: "建立时间",
updatedate: "更新时间",
eamapplytypeid: "维护申请类型标识",
eamlocationid: "功能位置标识",
assetid: "资产标识",
},
};
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
eamapplyid: "维护申请标识",
createman: "建立人",
eamapplyname: "维护申请名称",
createdate: "建立时间",
updatedate: "更新时间",
eamapplytypeid: "维护申请类型标识",
eamlocationid: "功能位置标识",
assetid: "资产标识",
},
};
\ No newline at end of file
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibizassetmanagement-app-assetmanagement\/eamapplystatemodellines\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibizassetmanagement-app-assetmanagement\/eamapplystatemodellines\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/eamapplystatemodellines\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/eamapplystatemodellines\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/eamapplystatemodellines\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.eamapplystatemodellineid, tempValue.eamapplystatemodellineid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/eamapplystatemodellines\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/eamapplystatemodellines\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.eamapplystatemodellineid, tempValue.eamapplystatemodellineid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['eamapplystatemodellineid'] == tempValue['eamapplystatemodellineid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/eamapplystatemodellines\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/eamapplystatemodellines\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.eamapplystatemodellineid, tempValue.eamapplystatemodellineid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['eamapplystatemodellineid'] == tempValue['eamapplystatemodellineid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/eamapplystatemodellines\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.eamapplystatemodellineid, tempValue.eamapplystatemodellineid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['eamapplystatemodellineid'] == tempValue['eamapplystatemodellineid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/eamapplystatemodellines\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/eamapplystatemodellines\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.eamapplystatemodellineid, tempValue.eamapplystatemodellineid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapplystatemodelline 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplystatemodellineid'];
const matchArray:any = new RegExp(/^\/eamapplystatemodellines\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.eamapplystatemodellineid, tempValue.eamapplystatemodellineid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibizassetmanagement-app-assetmanagement\/eamapplies\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibizassetmanagement-app-assetmanagement\/eamapplies\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/eamapplies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/eamapplies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/eamapplies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.eamapplyid, tempValue.eamapplyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/eamapplies\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/eamapplies\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.eamapplyid, tempValue.eamapplyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['eamapplyid'] == tempValue['eamapplyid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/eamapplies\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/eamapplies\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.eamapplyid, tempValue.eamapplyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['eamapplyid'] == tempValue['eamapplyid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/eamapplies\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.eamapplyid, tempValue.eamapplyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['eamapplyid'] == tempValue['eamapplyid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/eamapplies\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/eamapplies\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.eamapplyid, tempValue.eamapplyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:eamapply 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['eamapplyid'];
const matchArray:any = new RegExp(/^\/eamapplies\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.eamapplyid, tempValue.eamapplyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
...@@ -14,7 +14,9 @@ import './entity/eamasset-states/eamasset-states'; ...@@ -14,7 +14,9 @@ import './entity/eamasset-states/eamasset-states';
import './entity/eamlocation-states/eamlocation-states'; import './entity/eamlocation-states/eamlocation-states';
import './entity/eamasset-types/eamasset-types'; import './entity/eamasset-types/eamasset-types';
import './entity/eamasset-state-model-lines/eamasset-state-model-lines'; import './entity/eamasset-state-model-lines/eamasset-state-model-lines';
import './entity/eamapply-state-model-lines/eamapply-state-model-lines';
import './entity/eamlocation-state-model-lines/eamlocation-state-model-lines'; import './entity/eamlocation-state-model-lines/eamlocation-state-model-lines';
import './entity/eamassets/eamassets'; import './entity/eamassets/eamassets';
import './entity/eamapply-states/eamapply-states'; import './entity/eamapply-states/eamapply-states';
import './entity/eamapplys/eamapplys';
import './entity/eamasset-state-models/eamasset-state-models'; import './entity/eamasset-state-models/eamasset-state-models';
...@@ -99,32 +99,9 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -99,32 +99,9 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
* @memberof EAMApplyStateEditView * @memberof EAMApplyStateEditView
*/ */
public toolBarModels: any = { public toolBarModels: any = {
tbitem10: { name: 'tbitem10', caption: '保存', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存', iconcls: 'fa fa-save', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Save', target: '', class: '' } }, tbitem2: { name: 'tbitem2', caption: '保存并关闭', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存并关闭', iconcls: 'sx-tb-saveandclose', icon: '../sasrfex/images/default/icon_saveandclose.png', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'SaveAndExit', target: '', class: '' } },
tbitem12: { name: 'tbitem12', caption: '保存并新建', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存并新建', iconcls: 'sx-tb-saveandnew', icon: '../sasrfex/images/default/icon_saveandnew.png', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'SaveAndNew', target: '', class: '' } }, tbitem1: { name: 'tbitem1', caption: '关闭', 'isShowCaption': true, 'isShowIcon': true, tooltip: '关闭', iconcls: 'fa fa-sign-out', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Exit', target: '', class: '' } },
tbitem11: { name: 'tbitem11', caption: '保存并关闭', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存并关闭', iconcls: 'sx-tb-saveandclose', icon: '../sasrfex/images/default/icon_saveandclose.png', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'SaveAndExit', target: '', class: '' } },
tbitem18: { name: 'tbitem18', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem9: { name: 'tbitem9', caption: '删除并关闭', 'isShowCaption': true, 'isShowIcon': true, tooltip: '删除并关闭', iconcls: 'fa fa-remove', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'RemoveAndExit', target: 'SINGLEKEY', class: '' } },
tbitem19: { name: 'tbitem19', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem5: { name: 'tbitem5', caption: '新建', 'isShowCaption': true, 'isShowIcon': true, tooltip: '新建', iconcls: 'fa fa-file-text-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '', class: '' } },
tbitem21: { name: 'tbitem21', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem1: { name: 'tbitem1', caption: '拷贝', 'isShowCaption': true, 'isShowIcon': true, tooltip: '拷贝', iconcls: 'fa fa-copy', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY', class: '' } },
tbitem22: { name: 'tbitem22', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem2: { name: 'tbitem2', caption: '第一个记录', 'isShowCaption': false, 'isShowIcon': true, tooltip: '第一个记录', iconcls: 'fa fa-fast-backward', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'FirstRecord', target: 'SINGLEKEY', class: '' } },
tbitem7: { name: 'tbitem7', caption: '上一个记录', 'isShowCaption': false, 'isShowIcon': true, tooltip: '上一个记录', iconcls: 'fa fa-step-backward', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'PrevRecord', target: 'SINGLEKEY', class: '' } },
tbitem6: { name: 'tbitem6', caption: '下一个记录', 'isShowCaption': false, 'isShowIcon': true, tooltip: '下一个记录', iconcls: 'fa fa-step-forward', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'NextRecord', target: 'SINGLEKEY', class: '' } },
tbitem4: { name: 'tbitem4', caption: '最后一个记录', 'isShowCaption': false, 'isShowIcon': true, tooltip: '最后一个记录', iconcls: 'fa fa-fast-forward', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'LastRecord', target: 'SINGLEKEY', class: '' } },
tbitem25: { name: 'tbitem25', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem3: { name: 'tbitem3', caption: '帮助', 'isShowCaption': true, 'isShowIcon': true, tooltip: '帮助', iconcls: 'fa fa-question', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Help', target: '', class: '' } },
}; };
...@@ -174,47 +151,11 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -174,47 +151,11 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
* @memberof EAMApplyStateEditViewBase * @memberof EAMApplyStateEditViewBase
*/ */
public toolbar_click($event: any, $event2?: any): void { public toolbar_click($event: any, $event2?: any): void {
if (Object.is($event.tag, 'tbitem10')) {
this.toolbar_tbitem10_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem12')) {
this.toolbar_tbitem12_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem11')) {
this.toolbar_tbitem11_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem9')) {
this.toolbar_tbitem9_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem13')) {
this.toolbar_tbitem13_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem14')) {
this.toolbar_tbitem14_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem5')) {
this.toolbar_tbitem5_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem1')) {
this.toolbar_tbitem1_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem8')) {
this.toolbar_tbitem8_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem2')) { if (Object.is($event.tag, 'tbitem2')) {
this.toolbar_tbitem2_click(null, '', $event2); this.toolbar_tbitem2_click(null, '', $event2);
} }
if (Object.is($event.tag, 'tbitem7')) { if (Object.is($event.tag, 'tbitem1')) {
this.toolbar_tbitem7_click(null, '', $event2); this.toolbar_tbitem1_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem6')) {
this.toolbar_tbitem6_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
} }
} }
...@@ -259,63 +200,7 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -259,63 +200,7 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
* @param {*} [$event] * @param {*} [$event]
* @memberof * @memberof
*/ */
public toolbar_tbitem10_click(params: any = {}, tag?: any, $event?: any) { public toolbar_tbitem2_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Save(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem12_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndNew(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem11_click(params: any = {}, tag?: any, $event?: any) {
// 参数 // 参数
// 取数 // 取数
let datas: any[] = []; let datas: any[] = [];
...@@ -335,118 +220,6 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -335,118 +220,6 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
this.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState"); this.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
} }
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem9_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.RemoveAndExit(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem13_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndStart(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem14_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ViewWFStep(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem5_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/** /**
* 逻辑事件 * 逻辑事件
* *
...@@ -472,230 +245,9 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -472,230 +245,9 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
datas = [params]; datas = [params];
} }
// 界面行为 // 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState"); this.Exit(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem8_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem2_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.FirstRecord(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem7_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.PrevRecord(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem6_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.NextRecord(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.LastRecord(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
} }
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Help(datas, contextJO,paramJO, $event, xData,this,"EAMApplyState");
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public Save(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
xData.save().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
_this.$emit('viewdataschange', [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
/**
* 保存并新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public SaveAndNew(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.saveAndNew instanceof Function)) {
return;
}
xData.saveAndNew().then((response: any) => {
if (!response || response.status !== 200) {
_this.$emit('viewdataschange', JSON.stringify({status:'error',action:'saveAndNew'}));
return;
}
_this.$emit('viewdataschange', JSON.stringify({status:'success',action:'saveAndNew',data:response.data}));
if (xData.autoLoad instanceof Function) {
xData.autoLoad();
}
});
}
/** /**
* 保存并关闭 * 保存并关闭
* *
...@@ -730,7 +282,7 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -730,7 +282,7 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
} }
} }
/** /**
* 删除并关闭 * 关闭
* *
* @param {any[]} args 当前数据 * @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文 * @param {any} contextJO 行为附加上下文
...@@ -740,177 +292,12 @@ export class EAMApplyStateEditViewBase extends EditViewBase { ...@@ -740,177 +292,12 @@ export class EAMApplyStateEditViewBase extends EditViewBase {
* @param {*} [actionContext] 执行行为上下文 * @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase * @memberof EAMApplyStateEditViewBase
*/ */
public RemoveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public Exit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this; this.closeView(args);
if (xData && xData.removeAndExit instanceof Function) {
xData.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){ if(window.parent){
window.parent.postMessage([{ ...response.data }],'*'); window.parent.postMessage([{ ...args }],'*');
} }
});
} else if (_this.removeAndExit && _this.removeAndExit instanceof Function) {
_this.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 开始流程
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public SaveAndStart(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.wfstart instanceof Function)) {
return;
}
xData.wfstart(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if(window.parent){
window.parent.postMessage({ ..._data },'*');
}
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
}else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
});
}
/**
* 当前流程步骤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public ViewWFStep(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.wfsubmit instanceof Function)) {
return;
}
xData.wfsubmit(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
} }
const { data: _data } = response;
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
} else if (_this.$tabPageExp) {
_this.$tabPageExp.onClose(_this.$route.fullPath);
}
});
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
if (args.length > 0) {
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 帮助
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMApplyStateEditViewBase
*/
public Help(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '帮助未支持' });
}
} }
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 维护申请状态模型明细服务对象基类
*
* @export
* @class EAMApplyStateModelLineServiceBase
* @extends {EntityServie}
*/
export default class EAMApplyStateModelLineServiceBase extends EntityService {
/**
* Creates an instance of EAMApplyStateModelLineServiceBase.
*
* @param {*} [opts={}]
* @memberof EAMApplyStateModelLineServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof EAMApplyStateModelLineServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='eamapplystatemodelline';
this.APPDEKEY = 'eamapplystatemodellineid';
this.APPDENAME = 'eamapplystatemodellines';
this.APPDETEXT = 'eamapplystatemodellinename';
this.APPNAME = 'assetmanagement';
this.SYSTEMNAME = 'ibizassetmanagement';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/eamapplystatemodellines/${context.eamapplystatemodelline}/select`,isloading);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/eamapplystatemodellines`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/eamapplystatemodellines/${context.eamapplystatemodelline}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/eamapplystatemodellines/${context.eamapplystatemodelline}`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/eamapplystatemodellines/${context.eamapplystatemodelline}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/eamapplystatemodellines/getdraft`,isloading);
res.data.eamapplystatemodelline = data.eamapplystatemodelline;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/eamapplystatemodellines/${context.eamapplystatemodelline}/checkkey`,data,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/eamapplystatemodellines/${context.eamapplystatemodelline}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyStateModelLineServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/eamapplystatemodellines/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EAMApplyStateModelLineServiceBase from './eamapply-state-model-line-service-base';
/**
* 维护申请状态模型明细服务对象
*
* @export
* @class EAMApplyStateModelLineService
* @extends {EAMApplyStateModelLineServiceBase}
*/
export default class EAMApplyStateModelLineService extends EAMApplyStateModelLineServiceBase {
/**
* Creates an instance of EAMApplyStateModelLineService.
*
* @param {*} [opts={}]
* @memberof EAMApplyStateModelLineService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 维护申请服务对象基类
*
* @export
* @class EAMApplyServiceBase
* @extends {EntityServie}
*/
export default class EAMApplyServiceBase extends EntityService {
/**
* Creates an instance of EAMApplyServiceBase.
*
* @param {*} [opts={}]
* @memberof EAMApplyServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof EAMApplyServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='eamapply';
this.APPDEKEY = 'eamapplyid';
this.APPDENAME = 'eamapplies';
this.APPDETEXT = 'eamapplyname';
this.APPNAME = 'assetmanagement';
this.SYSTEMNAME = 'ibizassetmanagement';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/eamapplies/${context.eamapply}/select`,isloading);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/eamapplies`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/eamapplies/${context.eamapply}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/eamapplies/${context.eamapply}`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/eamapplies/${context.eamapply}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/eamapplies/getdraft`,isloading);
res.data.eamapply = data.eamapply;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/eamapplies/${context.eamapply}/checkkey`,data,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/eamapplies/${context.eamapply}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMApplyServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/eamapplies/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EAMApplyServiceBase from './eamapply-service-base';
/**
* 维护申请服务对象
*
* @export
* @class EAMApplyService
* @extends {EAMApplyServiceBase}
*/
export default class EAMApplyService extends EAMApplyServiceBase {
/**
* Creates an instance of EAMApplyService.
*
* @param {*} [opts={}]
* @memberof EAMApplyService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
...@@ -46,9 +46,11 @@ export class EntityServiceRegister { ...@@ -46,9 +46,11 @@ export class EntityServiceRegister {
this.allEntityService.set('eamlocationstate', () => import('@/service/eamlocation-state/eamlocation-state-service')); this.allEntityService.set('eamlocationstate', () => import('@/service/eamlocation-state/eamlocation-state-service'));
this.allEntityService.set('eamassettype', () => import('@/service/eamasset-type/eamasset-type-service')); this.allEntityService.set('eamassettype', () => import('@/service/eamasset-type/eamasset-type-service'));
this.allEntityService.set('eamassetstatemodelline', () => import('@/service/eamasset-state-model-line/eamasset-state-model-line-service')); this.allEntityService.set('eamassetstatemodelline', () => import('@/service/eamasset-state-model-line/eamasset-state-model-line-service'));
this.allEntityService.set('eamapplystatemodelline', () => import('@/service/eamapply-state-model-line/eamapply-state-model-line-service'));
this.allEntityService.set('eamlocationstatemodelline', () => import('@/service/eamlocation-state-model-line/eamlocation-state-model-line-service')); this.allEntityService.set('eamlocationstatemodelline', () => import('@/service/eamlocation-state-model-line/eamlocation-state-model-line-service'));
this.allEntityService.set('eamasset', () => import('@/service/eamasset/eamasset-service')); this.allEntityService.set('eamasset', () => import('@/service/eamasset/eamasset-service'));
this.allEntityService.set('eamapplystate', () => import('@/service/eamapply-state/eamapply-state-service')); this.allEntityService.set('eamapplystate', () => import('@/service/eamapply-state/eamapply-state-service'));
this.allEntityService.set('eamapply', () => import('@/service/eamapply/eamapply-service'));
this.allEntityService.set('eamassetstatemodel', () => import('@/service/eamasset-state-model/eamasset-state-model-service')); this.allEntityService.set('eamassetstatemodel', () => import('@/service/eamasset-state-model/eamasset-state-model-service'));
} }
......
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import EAMApplyStateModelLineService from '@/service/eamapply-state-model-line/eamapply-state-model-line-service';
import EAMApplyStateModelLineAuthService from '@/authservice/eamapply-state-model-line/eamapply-state-model-line-auth-service';
/**
* 维护申请状态模型明细UI服务对象基类
*
* @export
* @class EAMApplyStateModelLineUIServiceBase
*/
export default class EAMApplyStateModelLineUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public dataService:EAMApplyStateModelLineService = new EAMApplyStateModelLineService();
/**
* 所有关联视图
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of EAMApplyStateModelLineUIServiceBase.
*
* @param {*} [opts={}]
* @memberof EAMApplyStateModelLineUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new EAMApplyStateModelLineAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({eamapplystatemodelline:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof EAMApplyStateModelLineUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import EAMApplyStateModelLineUIServiceBase from './eamapply-state-model-line-ui-service-base';
/**
* 维护申请状态模型明细UI服务对象
*
* @export
* @class EAMApplyStateModelLineUIService
*/
export default class EAMApplyStateModelLineUIService extends EAMApplyStateModelLineUIServiceBase {
/**
* Creates an instance of EAMApplyStateModelLineUIService.
*
* @param {*} [opts={}]
* @memberof EAMApplyStateModelLineUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import EAMApplyService from '@/service/eamapply/eamapply-service';
import EAMApplyAuthService from '@/authservice/eamapply/eamapply-auth-service';
/**
* 维护申请UI服务对象基类
*
* @export
* @class EAMApplyUIServiceBase
*/
export default class EAMApplyUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof EAMApplyUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof EAMApplyUIServiceBase
*/
public dataService:EAMApplyService = new EAMApplyService();
/**
* 所有关联视图
*
* @memberof EAMApplyUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof EAMApplyUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof EAMApplyUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof EAMApplyUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof EAMApplyUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof EAMApplyUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of EAMApplyUIServiceBase.
*
* @param {*} [opts={}]
* @memberof EAMApplyUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new EAMApplyAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof EAMApplyUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof EAMApplyUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof EAMApplyUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof EAMApplyUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({eamapply:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof EAMApplyUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof EAMApplyUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof EAMApplyUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof EAMApplyUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof EAMApplyUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import EAMApplyUIServiceBase from './eamapply-ui-service-base';
/**
* 维护申请UI服务对象
*
* @export
* @class EAMApplyUIService
*/
export default class EAMApplyUIService extends EAMApplyUIServiceBase {
/**
* Creates an instance of EAMApplyUIService.
*
* @param {*} [opts={}]
* @memberof EAMApplyUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
...@@ -46,9 +46,11 @@ export class UIServiceRegister { ...@@ -46,9 +46,11 @@ export class UIServiceRegister {
this.allUIService.set('eamlocationstate', () => import('@/uiservice/eamlocation-state/eamlocation-state-ui-service')); this.allUIService.set('eamlocationstate', () => import('@/uiservice/eamlocation-state/eamlocation-state-ui-service'));
this.allUIService.set('eamassettype', () => import('@/uiservice/eamasset-type/eamasset-type-ui-service')); this.allUIService.set('eamassettype', () => import('@/uiservice/eamasset-type/eamasset-type-ui-service'));
this.allUIService.set('eamassetstatemodelline', () => import('@/uiservice/eamasset-state-model-line/eamasset-state-model-line-ui-service')); this.allUIService.set('eamassetstatemodelline', () => import('@/uiservice/eamasset-state-model-line/eamasset-state-model-line-ui-service'));
this.allUIService.set('eamapplystatemodelline', () => import('@/uiservice/eamapply-state-model-line/eamapply-state-model-line-ui-service'));
this.allUIService.set('eamlocationstatemodelline', () => import('@/uiservice/eamlocation-state-model-line/eamlocation-state-model-line-ui-service')); this.allUIService.set('eamlocationstatemodelline', () => import('@/uiservice/eamlocation-state-model-line/eamlocation-state-model-line-ui-service'));
this.allUIService.set('eamasset', () => import('@/uiservice/eamasset/eamasset-ui-service')); this.allUIService.set('eamasset', () => import('@/uiservice/eamasset/eamasset-ui-service'));
this.allUIService.set('eamapplystate', () => import('@/uiservice/eamapply-state/eamapply-state-ui-service')); this.allUIService.set('eamapplystate', () => import('@/uiservice/eamapply-state/eamapply-state-ui-service'));
this.allUIService.set('eamapply', () => import('@/uiservice/eamapply/eamapply-ui-service'));
this.allUIService.set('eamassetstatemodel', () => import('@/uiservice/eamasset-state-model/eamasset-state-model-ui-service')); this.allUIService.set('eamassetstatemodel', () => import('@/uiservice/eamasset-state-model/eamasset-state-model-ui-service'));
} }
......
...@@ -35,6 +35,10 @@ zuul: ...@@ -35,6 +35,10 @@ zuul:
path: /eamassetstatemodellines/** path: /eamassetstatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false stripPrefix: false
eamapplystatemodelline:
path: /eamapplystatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamlocationstatemodelline: eamlocationstatemodelline:
path: /eamlocationstatemodellines/** path: /eamlocationstatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
...@@ -47,6 +51,10 @@ zuul: ...@@ -47,6 +51,10 @@ zuul:
path: /eamapplystates/** path: /eamapplystates/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false stripPrefix: false
eamapply:
path: /eamapplies/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamassetstatemodel: eamassetstatemodel:
path: /eamassetstatemodels/** path: /eamassetstatemodels/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
......
...@@ -60,6 +60,14 @@ ...@@ -60,6 +60,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
, { , {
"dename":"EAMApplyStateModelLine",
"delogicname":"维护申请状态模型明细",
"sysmoudle":{"id":"APPLY","name":"维护申请"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMLocationStateModelLine", "dename":"EAMLocationStateModelLine",
"delogicname":"功能位置状态模型明细", "delogicname":"功能位置状态模型明细",
"sysmoudle":{"id":"LOCATION","name":"功能位置"}, "sysmoudle":{"id":"LOCATION","name":"功能位置"},
...@@ -84,6 +92,14 @@ ...@@ -84,6 +92,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
, { , {
"dename":"EAMApply",
"delogicname":"维护申请",
"sysmoudle":{"id":"APPLY","name":"维护申请"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMAssetStateModel", "dename":"EAMAssetStateModel",
"delogicname":"资产状态模型", "delogicname":"资产状态模型",
"sysmoudle":{"id":"ASSET","name":"资产管理"}, "sysmoudle":{"id":"ASSET","name":"资产管理"},
......
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[EAMApplyDTO]
*/
@Data
public class EAMApplyDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [EAMAPPLYID]
*
*/
@JSONField(name = "eamapplyid")
@JsonProperty("eamapplyid")
private String eamapplyid;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [EAMAPPLYNAME]
*
*/
@JSONField(name = "eamapplyname")
@JsonProperty("eamapplyname")
private String eamapplyname;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [EAMAPPLYTYPEID]
*
*/
@JSONField(name = "eamapplytypeid")
@JsonProperty("eamapplytypeid")
private String eamapplytypeid;
/**
* 属性 [EAMLOCATIONID]
*
*/
@JSONField(name = "eamlocationid")
@JsonProperty("eamlocationid")
private String eamlocationid;
/**
* 属性 [ASSETID]
*
*/
@JSONField(name = "assetid")
@JsonProperty("assetid")
private String assetid;
/**
* 设置 [EAMAPPLYNAME]
*/
public void setEamapplyname(String eamapplyname){
this.eamapplyname = eamapplyname ;
this.modify("eamapplyname",eamapplyname);
}
/**
* 设置 [EAMAPPLYTYPEID]
*/
public void setEamapplytypeid(String eamapplytypeid){
this.eamapplytypeid = eamapplytypeid ;
this.modify("eamapplytypeid",eamapplytypeid);
}
/**
* 设置 [EAMLOCATIONID]
*/
public void setEamlocationid(String eamlocationid){
this.eamlocationid = eamlocationid ;
this.modify("eamlocationid",eamlocationid);
}
/**
* 设置 [ASSETID]
*/
public void setAssetid(String assetid){
this.assetid = assetid ;
this.modify("assetid",assetid);
}
}
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[EAMApplyStateModelLineDTO]
*/
@Data
public class EAMApplyStateModelLineDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMAPPLYSTATEMODELLINENAME]
*
*/
@JSONField(name = "eamapplystatemodellinename")
@JsonProperty("eamapplystatemodellinename")
private String eamapplystatemodellinename;
/**
* 属性 [EAMAPPLYSTATEMODELLINEID]
*
*/
@JSONField(name = "eamapplystatemodellineid")
@JsonProperty("eamapplystatemodellineid")
private String eamapplystatemodellineid;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [EAMAPPLYSTATEID]
*
*/
@JSONField(name = "eamapplystateid")
@JsonProperty("eamapplystateid")
private String eamapplystateid;
/**
* 属性 [EAMAPPLYSTATEMODELID]
*
*/
@JSONField(name = "eamapplystatemodelid")
@JsonProperty("eamapplystatemodelid")
private String eamapplystatemodelid;
/**
* 设置 [EAMAPPLYSTATEMODELLINENAME]
*/
public void setEamapplystatemodellinename(String eamapplystatemodellinename){
this.eamapplystatemodellinename = eamapplystatemodellinename ;
this.modify("eamapplystatemodellinename",eamapplystatemodellinename);
}
/**
* 设置 [EAMAPPLYSTATEID]
*/
public void setEamapplystateid(String eamapplystateid){
this.eamapplystateid = eamapplystateid ;
this.modify("eamapplystateid",eamapplystateid);
}
/**
* 设置 [EAMAPPLYSTATEMODELID]
*/
public void setEamapplystatemodelid(String eamapplystatemodelid){
this.eamapplystatemodelid = eamapplystatemodelid ;
this.modify("eamapplystatemodelid",eamapplystatemodelid);
}
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApply;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMApplyDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMApplyMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMApplyMapping extends MappingBase<EAMApplyDTO, EAMApply> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyStateModelLine;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMApplyStateModelLineDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMApplyStateModelLineMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMApplyStateModelLineMapping extends MappingBase<EAMApplyStateModelLineDTO, EAMApplyStateModelLine> {
}
package cn.ibizlab.assetmanagement.assetapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApply;
import cn.ibizlab.assetmanagement.core.apply.service.IEAMApplyService;
import cn.ibizlab.assetmanagement.core.apply.filter.EAMApplySearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"维护申请" })
@RestController("AssetApi-eamapply")
@RequestMapping("")
public class EAMApplyResource {
@Autowired
public IEAMApplyService eamapplyService;
@Autowired
@Lazy
public EAMApplyMapping eamapplyMapping;
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydto),'iBizAssetManagement-EAMApply-Create')")
@ApiOperation(value = "新建维护申请", tags = {"维护申请" }, notes = "新建维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplies")
@Transactional
public ResponseEntity<EAMApplyDTO> create(@RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
eamapplyService.create(domain);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydtos),'iBizAssetManagement-EAMApply-Create')")
@ApiOperation(value = "批量新建维护申请", tags = {"维护申请" }, notes = "批量新建维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplies/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMApplyDTO> eamapplydtos) {
eamapplyService.createBatch(eamapplyMapping.toDomain(eamapplydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamapplyService.get(#eamapply_id),'iBizAssetManagement-EAMApply-Update')")
@ApiOperation(value = "更新维护申请", tags = {"维护申请" }, notes = "更新维护申请")
@RequestMapping(method = RequestMethod.PUT, value = "/eamapplies/{eamapply_id}")
@Transactional
public ResponseEntity<EAMApplyDTO> update(@PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain .setEamapplyid(eamapply_id);
eamapplyService.update(domain );
EAMApplyDTO dto = eamapplyMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplyService.getEamapplyByEntities(this.eamapplyMapping.toDomain(#eamapplydtos)),'iBizAssetManagement-EAMApply-Update')")
@ApiOperation(value = "批量更新维护申请", tags = {"维护申请" }, notes = "批量更新维护申请")
@RequestMapping(method = RequestMethod.PUT, value = "/eamapplies/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMApplyDTO> eamapplydtos) {
eamapplyService.updateBatch(eamapplyMapping.toDomain(eamapplydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamapplyService.get(#eamapply_id),'iBizAssetManagement-EAMApply-Remove')")
@ApiOperation(value = "删除维护申请", tags = {"维护申请" }, notes = "删除维护申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamapplies/{eamapply_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamapply_id") String eamapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.remove(eamapply_id));
}
@PreAuthorize("hasPermission(this.eamapplyService.getEamapplyByIds(#ids),'iBizAssetManagement-EAMApply-Remove')")
@ApiOperation(value = "批量删除维护申请", tags = {"维护申请" }, notes = "批量删除维护申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamapplies/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamapplyMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "获取维护申请", tags = {"维护申请" }, notes = "获取维护申请")
@RequestMapping(method = RequestMethod.GET, value = "/eamapplies/{eamapply_id}")
public ResponseEntity<EAMApplyDTO> get(@PathVariable("eamapply_id") String eamapply_id) {
EAMApply domain = eamapplyService.get(eamapply_id);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取维护申请草稿", tags = {"维护申请" }, notes = "获取维护申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamapplies/getdraft")
public ResponseEntity<EAMApplyDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyMapping.toDto(eamapplyService.getDraft(new EAMApply())));
}
@ApiOperation(value = "检查维护申请", tags = {"维护申请" }, notes = "检查维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplies/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMApplyDTO eamapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.checkKey(eamapplyMapping.toDomain(eamapplydto)));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydto),'iBizAssetManagement-EAMApply-Save')")
@ApiOperation(value = "保存维护申请", tags = {"维护申请" }, notes = "保存维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplies/save")
public ResponseEntity<Boolean> save(@RequestBody EAMApplyDTO eamapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.save(eamapplyMapping.toDomain(eamapplydto)));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydtos),'iBizAssetManagement-EAMApply-Save')")
@ApiOperation(value = "批量保存维护申请", tags = {"维护申请" }, notes = "批量保存维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplies/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMApplyDTO> eamapplydtos) {
eamapplyService.saveBatch(eamapplyMapping.toDomain(eamapplydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApply-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"维护申请" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamapplies/fetchdefault")
public ResponseEntity<List<EAMApplyDTO>> fetchDefault(EAMApplySearchContext context) {
Page<EAMApply> domains = eamapplyService.searchDefault(context) ;
List<EAMApplyDTO> list = eamapplyMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApply-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"维护申请" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamapplies/searchdefault")
public ResponseEntity<Page<EAMApplyDTO>> searchDefault(@RequestBody EAMApplySearchContext context) {
Page<EAMApply> domains = eamapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.assetmanagement.assetapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyStateModelLine;
import cn.ibizlab.assetmanagement.core.apply.service.IEAMApplyStateModelLineService;
import cn.ibizlab.assetmanagement.core.apply.filter.EAMApplyStateModelLineSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"维护申请状态模型明细" })
@RestController("AssetApi-eamapplystatemodelline")
@RequestMapping("")
public class EAMApplyStateModelLineResource {
@Autowired
public IEAMApplyStateModelLineService eamapplystatemodellineService;
@Autowired
@Lazy
public EAMApplyStateModelLineMapping eamapplystatemodellineMapping;
@PreAuthorize("hasPermission(this.eamapplystatemodellineMapping.toDomain(#eamapplystatemodellinedto),'iBizAssetManagement-EAMApplyStateModelLine-Create')")
@ApiOperation(value = "新建维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "新建维护申请状态模型明细")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplystatemodellines")
@Transactional
public ResponseEntity<EAMApplyStateModelLineDTO> create(@RequestBody EAMApplyStateModelLineDTO eamapplystatemodellinedto) {
EAMApplyStateModelLine domain = eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedto);
eamapplystatemodellineService.create(domain);
EAMApplyStateModelLineDTO dto = eamapplystatemodellineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplystatemodellineMapping.toDomain(#eamapplystatemodellinedtos),'iBizAssetManagement-EAMApplyStateModelLine-Create')")
@ApiOperation(value = "批量新建维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "批量新建维护申请状态模型明细")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplystatemodellines/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMApplyStateModelLineDTO> eamapplystatemodellinedtos) {
eamapplystatemodellineService.createBatch(eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamapplystatemodelline" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamapplystatemodellineService.get(#eamapplystatemodelline_id),'iBizAssetManagement-EAMApplyStateModelLine-Update')")
@ApiOperation(value = "更新维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "更新维护申请状态模型明细")
@RequestMapping(method = RequestMethod.PUT, value = "/eamapplystatemodellines/{eamapplystatemodelline_id}")
@Transactional
public ResponseEntity<EAMApplyStateModelLineDTO> update(@PathVariable("eamapplystatemodelline_id") String eamapplystatemodelline_id, @RequestBody EAMApplyStateModelLineDTO eamapplystatemodellinedto) {
EAMApplyStateModelLine domain = eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedto);
domain .setEamapplystatemodellineid(eamapplystatemodelline_id);
eamapplystatemodellineService.update(domain );
EAMApplyStateModelLineDTO dto = eamapplystatemodellineMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplystatemodellineService.getEamapplystatemodellineByEntities(this.eamapplystatemodellineMapping.toDomain(#eamapplystatemodellinedtos)),'iBizAssetManagement-EAMApplyStateModelLine-Update')")
@ApiOperation(value = "批量更新维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "批量更新维护申请状态模型明细")
@RequestMapping(method = RequestMethod.PUT, value = "/eamapplystatemodellines/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMApplyStateModelLineDTO> eamapplystatemodellinedtos) {
eamapplystatemodellineService.updateBatch(eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamapplystatemodellineService.get(#eamapplystatemodelline_id),'iBizAssetManagement-EAMApplyStateModelLine-Remove')")
@ApiOperation(value = "删除维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "删除维护申请状态模型明细")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamapplystatemodellines/{eamapplystatemodelline_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamapplystatemodelline_id") String eamapplystatemodelline_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplystatemodellineService.remove(eamapplystatemodelline_id));
}
@PreAuthorize("hasPermission(this.eamapplystatemodellineService.getEamapplystatemodellineByIds(#ids),'iBizAssetManagement-EAMApplyStateModelLine-Remove')")
@ApiOperation(value = "批量删除维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "批量删除维护申请状态模型明细")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamapplystatemodellines/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamapplystatemodellineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamapplystatemodellineMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMApplyStateModelLine-Get')")
@ApiOperation(value = "获取维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "获取维护申请状态模型明细")
@RequestMapping(method = RequestMethod.GET, value = "/eamapplystatemodellines/{eamapplystatemodelline_id}")
public ResponseEntity<EAMApplyStateModelLineDTO> get(@PathVariable("eamapplystatemodelline_id") String eamapplystatemodelline_id) {
EAMApplyStateModelLine domain = eamapplystatemodellineService.get(eamapplystatemodelline_id);
EAMApplyStateModelLineDTO dto = eamapplystatemodellineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取维护申请状态模型明细草稿", tags = {"维护申请状态模型明细" }, notes = "获取维护申请状态模型明细草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamapplystatemodellines/getdraft")
public ResponseEntity<EAMApplyStateModelLineDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamapplystatemodellineMapping.toDto(eamapplystatemodellineService.getDraft(new EAMApplyStateModelLine())));
}
@ApiOperation(value = "检查维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "检查维护申请状态模型明细")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplystatemodellines/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMApplyStateModelLineDTO eamapplystatemodellinedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplystatemodellineService.checkKey(eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedto)));
}
@PreAuthorize("hasPermission(this.eamapplystatemodellineMapping.toDomain(#eamapplystatemodellinedto),'iBizAssetManagement-EAMApplyStateModelLine-Save')")
@ApiOperation(value = "保存维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "保存维护申请状态模型明细")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplystatemodellines/save")
public ResponseEntity<Boolean> save(@RequestBody EAMApplyStateModelLineDTO eamapplystatemodellinedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplystatemodellineService.save(eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedto)));
}
@PreAuthorize("hasPermission(this.eamapplystatemodellineMapping.toDomain(#eamapplystatemodellinedtos),'iBizAssetManagement-EAMApplyStateModelLine-Save')")
@ApiOperation(value = "批量保存维护申请状态模型明细", tags = {"维护申请状态模型明细" }, notes = "批量保存维护申请状态模型明细")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplystatemodellines/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMApplyStateModelLineDTO> eamapplystatemodellinedtos) {
eamapplystatemodellineService.saveBatch(eamapplystatemodellineMapping.toDomain(eamapplystatemodellinedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApplyStateModelLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApplyStateModelLine-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"维护申请状态模型明细" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamapplystatemodellines/fetchdefault")
public ResponseEntity<List<EAMApplyStateModelLineDTO>> fetchDefault(EAMApplyStateModelLineSearchContext context) {
Page<EAMApplyStateModelLine> domains = eamapplystatemodellineService.searchDefault(context) ;
List<EAMApplyStateModelLineDTO> list = eamapplystatemodellineMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApplyStateModelLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApplyStateModelLine-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"维护申请状态模型明细" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamapplystatemodellines/searchdefault")
public ResponseEntity<Page<EAMApplyStateModelLineDTO>> searchDefault(@RequestBody EAMApplyStateModelLineSearchContext context) {
Page<EAMApplyStateModelLine> domains = eamapplystatemodellineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamapplystatemodellineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册