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

lab_gzf 部署微服务应用

上级 f3ef96f9
...@@ -339,6 +339,16 @@ ...@@ -339,6 +339,16 @@
"viewtag": "81139a9fb0fce24a58db188651ba7155", "viewtag": "81139a9fb0fce24a58db188651ba7155",
"memo": "系统自动添加" "memo": "系统自动添加"
}, },
"eamworkordereditview": {
"title": "工单编辑视图",
"caption": "工单",
"viewtype": "DEEDITVIEW",
"viewmodule": "WorkOrder",
"viewname": "EAMWorkOrderEditView",
"viewfilename": "eamwork-order-edit-view",
"viewtag": "8e9374f1a99e9f5e7b70b37ea8c6936c",
"memo": "系统自动添加"
},
"eamassetpickupview": { "eamassetpickupview": {
"title": "资产数据选择视图", "title": "资产数据选择视图",
"caption": "资产", "caption": "资产",
......
...@@ -27,6 +27,10 @@ export default { ...@@ -27,6 +27,10 @@ export default {
pworkordername: "上级工单", pworkordername: "上级工单",
}, },
views: { views: {
editview: {
caption: "工单",
title: "工单编辑视图",
},
applywogridview: { applywogridview: {
caption: "工单", caption: "工单",
title: "申请产生工单", title: "申请产生工单",
......
...@@ -26,6 +26,10 @@ export default { ...@@ -26,6 +26,10 @@ export default {
pworkordername: "上级工单", pworkordername: "上级工单",
}, },
views: { views: {
editview: {
caption: "工单",
title: "工单编辑视图",
},
applywogridview: { applywogridview: {
caption: "工单", caption: "工单",
title: "申请产生工单", title: "申请产生工单",
......
...@@ -279,6 +279,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -279,6 +279,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "EAMSparePartsGroupPickupView", "viewname": "EAMSparePartsGroupPickupView",
"viewtag": "81139a9fb0fce24a58db188651ba7155" "viewtag": "81139a9fb0fce24a58db188651ba7155"
}, },
"eamworkordereditview": {
"title": "工单编辑视图",
"caption": "工单",
"viewtype": "DEEDITVIEW",
"viewmodule": "WorkOrder",
"viewname": "EAMWorkOrderEditView",
"viewtag": "8e9374f1a99e9f5e7b70b37ea8c6936c"
},
"eamassetpickupview": { "eamassetpickupview": {
"title": "资产数据选择视图", "title": "资产数据选择视图",
"caption": "资产", "caption": "资产",
......
import { Subject } from 'rxjs';
import { EditViewBase } from '@/studio-core';
import EAMWorkOrderService from '@/service/eamwork-order/eamwork-order-service';
import EAMWorkOrderAuthService from '@/authservice/eamwork-order/eamwork-order-auth-service';
import EditViewEngine from '@engine/view/edit-view-engine';
import EAMWorkOrderUIService from '@/uiservice/eamwork-order/eamwork-order-ui-service';
/**
* 工单编辑视图视图基类
*
* @export
* @class EAMWorkOrderEditViewBase
* @extends {EditViewBase}
*/
export class EAMWorkOrderEditViewBase extends EditViewBase {
/**
* 视图对应应用实体名称
*
* @protected
* @type {string}
* @memberof EAMWorkOrderEditViewBase
*/
protected appDeName: string = 'eamworkorder';
/**
* 应用实体主键
*
* @protected
* @type {string}
* @memberof EAMWorkOrderEditViewBase
*/
protected appDeKey: string = 'workorderid';
/**
* 应用实体主信息
*
* @protected
* @type {string}
* @memberof EAMWorkOrderEditViewBase
*/
protected appDeMajor: string = 'workordername';
/**
* 实体服务对象
*
* @type {EAMWorkOrderService}
* @memberof EAMWorkOrderEditViewBase
*/
protected appEntityService: EAMWorkOrderService = new EAMWorkOrderService;
/**
* 实体权限服务对象
*
* @type EAMWorkOrderUIService
* @memberof EAMWorkOrderEditViewBase
*/
public appUIService: EAMWorkOrderUIService = new EAMWorkOrderUIService(this.$store);
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof EAMWorkOrderEditViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof EAMWorkOrderEditViewBase
*/
protected model: any = {
srfCaption: 'entities.eamworkorder.views.editview.caption',
srfTitle: 'entities.eamworkorder.views.editview.title',
srfSubTitle: 'entities.eamworkorder.views.editview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof EAMWorkOrderEditViewBase
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 工具栏模型
*
* @type {*}
* @memberof EAMWorkOrderEditView
*/
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: '' } },
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: '' } },
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: '' } },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '8e9374f1a99e9f5e7b70b37ea8c6936c';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof EAMWorkOrderEditViewBase
*/
public engine: EditViewEngine = new EditViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof EAMWorkOrderEditViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'eamworkorder',
majorPSDEField: 'workordername',
isLoadDefault: true,
});
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWorkOrderEditViewBase
*/
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')) {
this.toolbar_tbitem2_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem7')) {
this.toolbar_tbitem7_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);
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWorkOrderEditViewBase
*/
public form_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWorkOrderEditViewBase
*/
public form_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWorkOrderEditViewBase
*/
public form_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem10_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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem11_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.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem1_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.Copy(datas, contextJO,paramJO, $event, xData,this,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 逻辑事件
*
* @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,"EAMWorkOrder");
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMWorkOrderEditViewBase
*/
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 EAMWorkOrderEditViewBase
*/
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();
}
});
}
/**
* 保存并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMWorkOrderEditViewBase
*/
public SaveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.saveAndExit instanceof Function) {
xData.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.saveAndExit && _this.saveAndExit instanceof Function) {
_this.saveAndExit().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 EAMWorkOrderEditViewBase
*/
public RemoveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.removeAndExit instanceof Function) {
xData.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} 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 EAMWorkOrderEditViewBase
*/
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 EAMWorkOrderEditViewBase
*/
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 EAMWorkOrderEditViewBase
*/
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 EAMWorkOrderEditViewBase
*/
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.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { eamworkorder: args[0].eamworkorder });
}
if(!params) params = {};
Object.assign(params,{copymode:true});
_this.opendata([{ ...data }], params, $event, xData);
} else {
Object.assign(this.viewparams,{copymode:true});
}
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMWorkOrderEditViewBase
*/
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 EAMWorkOrderEditViewBase
*/
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
<studio-view-style2 viewName="eamworkordereditview" viewTitle="工单编辑视图" class='deeditview eamwork-order-edit-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction="Update"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@save="form_save($event)"
@remove="form_remove($event)"
@load="form_load($event)"
@closeview="closeView($event)">
</view_form>
</studio-view-style2>
\ No newline at end of file
<template src="./eamwork-order-edit-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { EAMWorkOrderEditViewBase } from './eamwork-order-edit-view-base';
import view_form from '@widgets/eamwork-order/main-form/main-form.vue';
/**
* 工单编辑视图视图
*
* @export
* @class EAMWorkOrderEditView
* @extends {EAMWorkOrderEditViewBase}
*/
@Component({
components: {
view_form,
}
})
@VueLifeCycleProcessing()
export default class EAMWorkOrderEditView extends EAMWorkOrderEditViewBase { }
</script>
...@@ -341,6 +341,15 @@ export const viewstate: any = { ...@@ -341,6 +341,15 @@ export const viewstate: any = {
'ebf6c093d1d6c599cc011b2c54ab6bc2', 'ebf6c093d1d6c599cc011b2c54ab6bc2',
], ],
}, },
{
viewtag: '8e9374f1a99e9f5e7b70b37ea8c6936c',
viewmodule: 'WorkOrder',
viewname: 'EAMWorkOrderEditView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{ {
viewtag: '906130a9861c2b0cff3173c9e171c1d1', viewtag: '906130a9861c2b0cff3173c9e171c1d1',
viewmodule: 'Asset', viewmodule: 'Asset',
......
...@@ -89,6 +89,7 @@ export default class EAMWorkOrderUIServiceBase extends UIService { ...@@ -89,6 +89,7 @@ export default class EAMWorkOrderUIServiceBase extends UIService {
* @memberof EAMWorkOrderUIServiceBase * @memberof EAMWorkOrderUIServiceBase
*/ */
public initViewMap(){ public initViewMap(){
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'eamworkorders'});
this.allViewMap.set(':',{viewname:'applywogridview',srfappde:'eamworkorders'}); this.allViewMap.set(':',{viewname:'applywogridview',srfappde:'eamworkorders'});
} }
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import EAMWorkOrderService from '@/service/eamwork-order/eamwork-order-service';
import MainService from './main-form-service';
import EAMWorkOrderUIService from '@/uiservice/eamwork-order/eamwork-order-ui-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
/**
* form部件基类
*
* @export
* @class EditFormControlBase
* @extends {MainEditFormBase}
*/
export class MainEditFormBase extends EditFormControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof MainEditFormBase
*/
protected controlType: string = 'FORM';
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof MainEditFormBase
*/
public service: MainService = new MainService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {EAMWorkOrderService}
* @memberof MainEditFormBase
*/
public appEntityService: EAMWorkOrderService = new EAMWorkOrderService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof MainEditFormBase
*/
protected appDeName: string = 'eamworkorder';
/**
* 界面UI服务对象
*
* @type {EAMWorkOrderUIService}
* @memberof MainEditFormBase
*/
public appUIService:EAMWorkOrderUIService = new EAMWorkOrderUIService(this.$store);
/**
* 表单数据对象
*
* @type {*}
* @memberof MainEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
workorderid: null,
eamworkorder:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof MainEditFormBase
*/
public rules: any = {
}
/**
* 属性值规则
*
* @type {*}
* @memberof MainBase
*/
public deRules:any = {
};
/**
* 详情模型集合
*
* @type {*}
* @memberof MainEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '工单基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, showMoreMode: 0, uiActionGroup: { caption: '', langbase: 'entities.eamworkorder.main_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this, showMoreMode: 0 }),
group2: new FormGroupPanelModel({ caption: '操作信息', detailType: 'GROUPPANEL', name: 'group2', visible: true, isShowCaption: true, form: this, showMoreMode: 0, uiActionGroup: { caption: '', langbase: 'entities.eamworkorder.main_form', extractMode: 'ITEM', details: [] } }),
formpage2: new FormPageModel({ caption: '其它', detailType: 'FORMPAGE', name: 'formpage2', visible: true, isShowCaption: true, form: this, showMoreMode: 0 }),
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfkey: new FormItemModel({ caption: '工单标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfmajortext: new FormItemModel({ caption: '工单名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
workorderid: new FormItemModel({ caption: '工单标识', detailType: 'FORMITEM', name: 'workorderid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [{ name: 'formpage1', index: 0, visible: true }, { name: 'formpage2', index: 1, visible: true }] }),
};
}
\ No newline at end of file
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export default class MainModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srforikey',
},
{
name: 'srfkey',
prop: 'workorderid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'workordername',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'workorderid',
prop: 'workorderid',
dataType: 'GUID',
},
{
name: 'eamworkorder',
prop: 'workorderid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import EAMWorkOrderService from '@/service/eamwork-order/eamwork-order-service';
import MainModel from './main-form-model';
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export default class MainService extends ControlService {
/**
* 工单服务对象
*
* @type {EAMWorkOrderService}
* @memberof MainService
*/
public appEntityService: EAMWorkOrderService = new EAMWorkOrderService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof MainService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of MainService.
*
* @param {*} [opts={}]
* @memberof MainService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new MainModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof MainService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof MainService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
data.page = data.page ? data.page : 0;
data.size = data.size ? data.size : 1000;
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data,true).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public get(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
const PrimaryKey = Util.createUUID();
Data.workorderid = PrimaryKey;
Data.eamworkorder = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.workorderid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public frontLogic(action:string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestData(action: string,context:any, data: any = {},isMerge:boolean = false){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
/**
* 通过属性名称获取表单项名称
*
* @param name 实体属性名称
* @memberof MainService
*/
public getItemNameByDeName(name:string) :string{
let itemName = name;
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return name;
}
let formItemItems: any[] = mode.getDataItems();
formItemItems.forEach((item:any)=>{
if(item.prop === name){
itemName = item.name;
}
});
return itemName.trim();
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-form' ref='form' id='eamworkorder_main' style="">
<input style="display:none;" />
<row >
<tabs :animated="false" size="small" name='main' :value="detailsModel.form.activiedPage"
@on-click="detailsModel.form.clickPage($event)">
<tab-pane v-show="detailsModel.formpage1.visible" name='formpage1' :index="0" tab='main' class=''
:label="(h) =>{
return h('span',{
class:'caption'
},[
$t('entities.eamworkorder.main_form.details.formpage1')
])
}">
<i-col class="form-layout-container" v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group :model="detailsModel.group1" layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.eamworkorder.main_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group-data-panel slot="dataInfoPanel" :model="detailsModel.group1" :data="data" :context="context" :viewparams="viewparams"/>
<row>
</row>
</app-form-group>
</i-col>
</tab-pane>
<tab-pane v-show="detailsModel.formpage2.visible" name='formpage2' :index="1" tab='main' class=''
:label="(h) =>{
return h('span',{
class:'caption'
},[
$t('entities.eamworkorder.main_form.details.formpage2')
])
}">
<i-col class="form-layout-container" v-show="detailsModel.group2.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group :model="detailsModel.group2" layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group2.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.eamworkorder.main_form.details.group2')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group-data-panel slot="dataInfoPanel" :model="detailsModel.group2" :data="data" :context="context" :viewparams="viewparams"/>
<row>
</row>
</app-form-group>
</i-col>
</tab-pane>
</tabs>
</row>
</i-form>
\ No newline at end of file
<template src="./main-form.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { MainEditFormBase } from './main-form-base';
/**
* form部件
*
* @export
* @class MainEditForm
* @extends {MainEditFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class MainEditForm extends MainEditFormBase { }
</script>
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase; import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data; import lombok.Data;
/** /**
......
package cn.ibizlab.assetmanagement.util.domain;
public class DTOClient extends DTOBase {
@Override
public void modify(String field,Object val) {
if(val==null){
this.getFocusNull().add(field.toLowerCase());
getExtensionparams().put("dirtyflagenable",true);
getExtensionparams().put(field.toLowerCase()+"dirtyflag",true);
}
else{
this.getFocusNull().remove(field.toLowerCase());
getExtensionparams().remove(field.toLowerCase()+"dirtyflag");
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册