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

lab_gzf 部署微服务应用

上级 fcf36ded
import { Subject } from 'rxjs';
import { EditViewBase } from '@/studio-core';
import EAMWOTypeService from '@/service/eamwotype/eamwotype-service';
import EAMWOTypeAuthService from '@/authservice/eamwotype/eamwotype-auth-service';
import EditViewEngine from '@engine/view/edit-view-engine';
import EAMWOTypeUIService from '@/uiservice/eamwotype/eamwotype-ui-service';
/**
* 工单类型编辑视图视图基类
*
* @export
* @class EAMWOTypeEditViewBase
* @extends {EditViewBase}
*/
export class EAMWOTypeEditViewBase extends EditViewBase {
/**
* 视图对应应用实体名称
*
* @protected
* @type {string}
* @memberof EAMWOTypeEditViewBase
*/
protected appDeName: string = 'eamwotype';
/**
* 应用实体主键
*
* @protected
* @type {string}
* @memberof EAMWOTypeEditViewBase
*/
protected appDeKey: string = 'eamwotypeid';
/**
* 应用实体主信息
*
* @protected
* @type {string}
* @memberof EAMWOTypeEditViewBase
*/
protected appDeMajor: string = 'eamwotypename';
/**
* 实体服务对象
*
* @type {EAMWOTypeService}
* @memberof EAMWOTypeEditViewBase
*/
protected appEntityService: EAMWOTypeService = new EAMWOTypeService;
/**
* 实体权限服务对象
*
* @type EAMWOTypeUIService
* @memberof EAMWOTypeEditViewBase
*/
public appUIService: EAMWOTypeUIService = new EAMWOTypeUIService(this.$store);
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof EAMWOTypeEditViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof EAMWOTypeEditViewBase
*/
protected model: any = {
srfCaption: 'entities.eamwotype.views.editview.caption',
srfTitle: 'entities.eamwotype.views.editview.title',
srfSubTitle: 'entities.eamwotype.views.editview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof EAMWOTypeEditViewBase
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 工具栏模型
*
* @type {*}
* @memberof EAMWOTypeEditView
*/
public toolBarModels: any = {
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: '' } },
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: '' } },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = 'fc86dc7e981c8fcc8533f992bd51ce5c';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof EAMWOTypeEditViewBase
*/
public engine: EditViewEngine = new EditViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof EAMWOTypeEditViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'eamwotype',
majorPSDEField: 'eamwotypename',
isLoadDefault: true,
});
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWOTypeEditViewBase
*/
public toolbar_click($event: any, $event2?: any): void {
if (Object.is($event.tag, 'tbitem2')) {
this.toolbar_tbitem2_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem1')) {
this.toolbar_tbitem1_click(null, '', $event2);
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWOTypeEditViewBase
*/
public form_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWOTypeEditViewBase
*/
public form_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof EAMWOTypeEditViewBase
*/
public form_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 逻辑事件
*
* @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.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"EAMWOType");
}
/**
* 逻辑事件
*
* @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.Exit(datas, contextJO,paramJO, $event, xData,this,"EAMWOType");
}
/**
* 保存并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof EAMWOTypeEditViewBase
*/
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 EAMWOTypeEditViewBase
*/
public Exit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.closeView(args);
if(window.parent){
window.parent.postMessage([{ ...args }],'*');
}
}
}
\ No newline at end of file
<studio-view-style2 viewName="eamwotypeeditview" viewTitle="工单类型编辑视图" class='deeditview eamwotype-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="./eamwotype-edit-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { EAMWOTypeEditViewBase } from './eamwotype-edit-view-base';
import view_form from '@widgets/eamwotype/main-form/main-form.vue';
/**
* 工单类型编辑视图视图
*
* @export
* @class EAMWOTypeEditView
* @extends {EAMWOTypeEditViewBase}
*/
@Component({
components: {
view_form,
}
})
@VueLifeCycleProcessing()
export default class EAMWOTypeEditView extends EAMWOTypeEditViewBase { }
</script>
<studio-view-style2 viewName="eamwotypegridview" viewTitle="工单类型表格视图" class='degridview eamwotype-grid-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" placeholder="工单类型名称" search @on-search="onSearch($event)"/>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
<template slot="searchForm">
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
</template>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
@save="onSave.apply(_self, arguments)"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
:newdata="newdata.bind(_self)"
:opendata="opendata.bind(_self)"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@remove="grid_remove($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-view-style2>
\ No newline at end of file
<template src="./eamwotype-grid-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { EAMWOTypeGridViewBase } from './eamwotype-grid-view-base';
import view_grid from '@widgets/eamwotype/main-grid/main-grid.vue';
import view_searchform from '@widgets/eamwotype/default-searchform/default-searchform.vue';
/**
* 工单类型表格视图视图
*
* @export
* @class EAMWOTypeGridView
* @extends {EAMWOTypeGridViewBase}
*/
@Component({
components: {
view_grid,
view_searchform,
}
})
@VueLifeCycleProcessing()
export default class EAMWOTypeGridView extends EAMWOTypeGridViewBase { }
</script>
......@@ -212,6 +212,16 @@ export const viewstate: any = {
'bb8b4b03a77ed63b8eb4ef3d62b669a6',
],
},
{
viewtag: '47c5acae861f30987e0ef5e7c4cc0b21',
viewmodule: 'WorkOrder',
viewname: 'EAMWOTypeGridView',
viewaction: '',
viewdatachange: false,
refviews: [
'fc86dc7e981c8fcc8533f992bd51ce5c',
],
},
{
viewtag: '4a5dd0204cc256862db03b36fc570e71',
viewmodule: 'Location',
......@@ -877,6 +887,15 @@ export const viewstate: any = {
'2b28313d0f3925fa44b8683eb5ea54d6',
],
},
{
viewtag: 'fc86dc7e981c8fcc8533f992bd51ce5c',
viewmodule: 'WorkOrder',
viewname: 'EAMWOTypeEditView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
],
createdviews: [],
}
\ No newline at end of file
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import EAMWOTypeService from '@/service/eamwotype/eamwotype-service';
import MainService from './main-form-service';
import EAMWOTypeUIService from '@/uiservice/eamwotype/eamwotype-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 {EAMWOTypeService}
* @memberof MainEditFormBase
*/
public appEntityService: EAMWOTypeService = new EAMWOTypeService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof MainEditFormBase
*/
protected appDeName: string = 'eamwotype';
/**
* 界面UI服务对象
*
* @type {EAMWOTypeUIService}
* @memberof MainEditFormBase
*/
public appUIService:EAMWOTypeUIService = new EAMWOTypeUIService(this.$store);
/**
* 表单数据对象
*
* @type {*}
* @memberof MainEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
eamwotypeid: null,
eamwotypename: null,
eamwotype:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof MainEditFormBase
*/
public rules: any = {
eamwotypename: [
{ required: true, type: 'string', message: '工单类型名称 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '工单类型名称 值不能为空', trigger: 'blur' },
],
}
/**
* 属性值规则
*
* @type {*}
* @memberof MainBase
*/
public deRules:any = {
};
/**
* 详情模型集合
*
* @type {*}
* @memberof MainEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '工单类型基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, showMoreMode: 0, uiActionGroup: { caption: '', langbase: 'entities.eamwotype.main_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', 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 }),
eamwotypeid: new FormItemModel({ caption: '工单类型标识', detailType: 'FORMITEM', name: 'eamwotypeid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
eamwotypename: new FormItemModel({ caption: '工单类型名称', detailType: 'FORMITEM', name: 'eamwotypename', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
}
\ 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: 'eamwotypeid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'eamwotypename',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'eamwotypeid',
prop: 'eamwotypeid',
dataType: 'GUID',
},
{
name: 'eamwotypename',
prop: 'eamwotypename',
dataType: 'TEXT',
},
{
name: 'eamwotype',
prop: 'eamwotypeid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-form' ref='form' id='eamwotype_main' style="">
<input style="display:none;" />
<row >
<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.eamwotype.main_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group-data-panel slot="dataInfoPanel" :model="detailsModel.group1" :data="data" :context="context" :viewparams="viewparams"/>
<row>
<i-col class="form-layout-container" v-show="detailsModel.eamwotypeid.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='eamwotypeid' :itemRules="this.rules.eamwotypeid" class='' :caption="$t('entities.eamwotype.main_form.details.eamwotypeid')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.eamwotypeid.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box
v-model="data.eamwotypeid"
@enter="onEnter($event)"
unit=""
:disabled="detailsModel.eamwotypeid.disabled"
type='text'
style="">
</input-box>
</app-form-item>
</i-col>
<i-col class="form-layout-container" v-show="detailsModel.eamwotypename.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='eamwotypename' :itemRules="this.rules.eamwotypename" class='' :caption="$t('entities.eamwotype.main_form.details.eamwotypename')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.eamwotypename.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box
v-model="data.eamwotypename"
@enter="onEnter($event)"
unit=""
:disabled="detailsModel.eamwotypename.disabled"
type='text'
style="">
</input-box>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</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>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册