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

lab_gzf 发布系统代码

上级 53fddda3
import { Subject } from 'rxjs';
import { PickupGridViewBase } from '@/studio-core';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import PickupGridViewEngine from '@engine/view/pickup-grid-view-engine';
/**
* 计价单位组选择表格视图视图基类
*
* @export
* @class UomSchedulePickupGridViewBase
* @extends {PickupGridViewBase}
*/
export class UomSchedulePickupGridViewBase extends PickupGridViewBase {
/**
* 实体服务对象
*
* @type {UomScheduleService}
* @memberof UomSchedulePickupGridViewBase
*/
protected appEntityService: UomScheduleService = new UomScheduleService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof UomSchedulePickupGridViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof UomSchedulePickupGridViewBase
*/
protected model: any = {
srfCaption: 'entities.uomschedule.views.pickupgridview.caption',
srfTitle: 'entities.uomschedule.views.pickupgridview.title',
srfSubTitle: 'entities.uomschedule.views.pickupgridview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof UomSchedulePickupGridViewBase
*/
protected containerModel: any = {
view_grid: { name: 'grid', type: 'GRID' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '7decb196037249b909762c9142adfe91';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof UomSchedulePickupGridViewBase
*/
public engine: PickupGridViewEngine = new PickupGridViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof UomSchedulePickupGridViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'uomschedule',
majorPSDEField: 'uomschedulename',
isLoadDefault: true,
});
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public grid_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public grid_beforeload($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public grid_rowdblclick($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public grid_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public searchform_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public searchform_search($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupGridViewBase
*/
public searchform_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 是否展开搜索表单
*
* @protected
* @type {boolean}
* @memberof UomSchedulePickupGridViewBase
*/
protected isExpandSearchForm: boolean = true;
}
\ No newline at end of file
<studio-view-style2 viewName="uomschedulepickupgridview" viewTitle="计价单位组选择表格视图" class='depickupgridview uom-schedule-pickup-grid-view'>
<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="isSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-view-style2>
\ No newline at end of file
<template src="./uom-schedule-pickup-grid-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { UomSchedulePickupGridViewBase } from './uom-schedule-pickup-grid-view-base';
import view_grid from '@widgets/uom-schedule/main-grid/main-grid.vue';
import view_searchform from '@widgets/uom-schedule/default-searchform/default-searchform.vue';
/**
* 计价单位组选择表格视图视图
*
* @export
* @class UomSchedulePickupGridView
* @extends {UomSchedulePickupGridViewBase}
*/
@Component({
components: {
view_grid,
view_searchform,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class UomSchedulePickupGridView extends UomSchedulePickupGridViewBase { }
</script>
import { Subject } from 'rxjs';
import { PickupViewBase } from '@/studio-core';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
/**
* 计价单位组数据选择视图视图基类
*
* @export
* @class UomSchedulePickupViewBase
* @extends {PickupViewBase}
*/
export class UomSchedulePickupViewBase extends PickupViewBase {
/**
* 实体服务对象
*
* @type {UomScheduleService}
* @memberof UomSchedulePickupViewBase
*/
protected appEntityService: UomScheduleService = new UomScheduleService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof UomSchedulePickupViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof UomSchedulePickupViewBase
*/
protected model: any = {
srfCaption: 'entities.uomschedule.views.pickupview.caption',
srfTitle: 'entities.uomschedule.views.pickupview.title',
srfSubTitle: 'entities.uomschedule.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof UomSchedulePickupViewBase
*/
protected containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '241c1fe99d6b6b99ad2888762140837a';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof UomSchedulePickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof UomSchedulePickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'uomschedule',
majorPSDEField: 'uomschedulename',
isLoadDefault: true,
});
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomSchedulePickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
}
\ No newline at end of file
<studio-view-style2 viewName="uomschedulepickupview" viewTitle="计价单位组数据选择视图" class='depickupview uom-schedule-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
</div>
<template slot="footer">
<div v-if="isShowButton" :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk.apply(_self, arguments)">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel.apply(_self, arguments)">{{this.containerModel.view_cancelbtn.text}}</i-button>
</div>
</template>
</studio-view-style2>
\ No newline at end of file
<template src="./uom-schedule-pickup-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { UomSchedulePickupViewBase } from './uom-schedule-pickup-view-base';
import view_pickupviewpanel from '@widgets/uom-schedule/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.vue';
/**
* 计价单位组数据选择视图视图
*
* @export
* @class UomSchedulePickupView
* @extends {UomSchedulePickupViewBase}
*/
@Component({
components: {
view_pickupviewpanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class UomSchedulePickupView extends UomSchedulePickupViewBase { }
</script>
import { Subject } from 'rxjs';
import { EditViewBase } from '@/studio-core';
import ProductService from '@/service/product/product-service';
import EditViewEngine from '@engine/view/edit-view-engine';
/**
* 产品编辑视图视图基类
*
* @export
* @class ProductInfo_ProInfoBase
* @extends {EditViewBase}
*/
export class ProductInfo_ProInfoBase extends EditViewBase {
/**
* 实体服务对象
*
* @type {ProductService}
* @memberof ProductInfo_ProInfoBase
*/
protected appEntityService: ProductService = new ProductService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof ProductInfo_ProInfoBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof ProductInfo_ProInfoBase
*/
protected model: any = {
srfCaption: 'entities.product.views.info_proinfo.caption',
srfTitle: 'entities.product.views.info_proinfo.title',
srfSubTitle: 'entities.product.views.info_proinfo.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof ProductInfo_ProInfoBase
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 工具栏模型
*
* @type {*}
* @memberof ProductInfo_ProInfo
*/
public toolBarModels: any = {
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '41e012bf9b91b39e4a30072986b7c11e';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof ProductInfo_ProInfoBase
*/
public engine: EditViewEngine = new EditViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof ProductInfo_ProInfoBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'product',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductInfo_ProInfoBase
*/
public form_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductInfo_ProInfoBase
*/
public form_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductInfo_ProInfoBase
*/
public form_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'load', $event);
}
}
\ No newline at end of file
<studio-view-style2 viewName="productinfo_proinfo" viewTitle="产品编辑视图" class='deeditview product-info-pro-info'>
<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="./product-info-pro-info.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { ProductInfo_ProInfoBase } from './product-info-pro-info-base';
import view_form from '@widgets/product/pro-info-form/pro-info-form.vue';
/**
* 产品编辑视图视图
*
* @export
* @class ProductInfo_ProInfo
* @extends {ProductInfo_ProInfoBase}
*/
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class ProductInfo_ProInfo extends ProductInfo_ProInfoBase { }
</script>
......@@ -5,6 +5,7 @@ export const PageComponents = {
Vue.component('invoice-info-invoice-view', () => import('@pages/finance/invoice-info-invoice-view/invoice-info-invoice-view.vue'));
Vue.component('product-price-level-pro-prilv-grid-view', () => import('@pages/product/product-price-level-pro-prilv-grid-view/product-price-level-pro-prilv-grid-view.vue'));
Vue.component('list-account-by-list', () => import('@pages/marketing/list-account-by-list/list-account-by-list.vue'));
Vue.component('product-info-pro-info', () => import('@pages/product/product-info-pro-info/product-info-pro-info.vue'));
Vue.component('competitor-option-view', () => import('@pages/sales/competitor-option-view/competitor-option-view.vue'));
Vue.component('campaign-response-by-parent-key', () => import('@pages/marketing/campaign-response-by-parent-key/campaign-response-by-parent-key.vue'));
Vue.component('account-edit-view', () => import('@pages/base/account-edit-view/account-edit-view.vue'));
......@@ -78,6 +79,7 @@ export const PageComponents = {
Vue.component('competitor-grid-view', () => import('@pages/sales/competitor-grid-view/competitor-grid-view.vue'));
Vue.component('account-summary', () => import('@pages/base/account-summary/account-summary.vue'));
Vue.component('sales-literature-info-view', () => import('@pages/sales/sales-literature-info-view/sales-literature-info-view.vue'));
Vue.component('uom-schedule-pickup-grid-view', () => import('@pages/base/uom-schedule-pickup-grid-view/uom-schedule-pickup-grid-view.vue'));
Vue.component('opportunity-product-opp-opp-pro-grid-view', () => import('@pages/sales/opportunity-product-opp-opp-pro-grid-view/opportunity-product-opp-opp-pro-grid-view.vue'));
Vue.component('ibiz-list-quick-create', () => import('@pages/marketing/ibiz-list-quick-create/ibiz-list-quick-create.vue'));
Vue.component('product-association-grid-view', () => import('@pages/product/product-association-grid-view/product-association-grid-view.vue'));
......@@ -93,6 +95,7 @@ export const PageComponents = {
Vue.component('activity-pointer-edit-view', () => import('@pages/base/activity-pointer-edit-view/activity-pointer-edit-view.vue'));
Vue.component('subject-pickup-view', () => import('@pages/base/subject-pickup-view/subject-pickup-view.vue'));
Vue.component('sales-literature-grid-view', () => import('@pages/sales/sales-literature-grid-view/sales-literature-grid-view.vue'));
Vue.component('uom-schedule-pickup-view', () => import('@pages/base/uom-schedule-pickup-view/uom-schedule-pickup-view.vue'));
Vue.component('product-summary-view', () => import('@pages/product/product-summary-view/product-summary-view.vue'));
Vue.component('quote-grid-view', () => import('@pages/sales/quote-grid-view/quote-grid-view.vue'));
Vue.component('sales-literature-info-sal-lit-view', () => import('@pages/sales/sales-literature-info-sal-lit-view/sales-literature-info-sal-lit-view.vue'));
......
......@@ -150,6 +150,20 @@ const router = new Router({
},
component: () => import('@pages/marketing/list-account-by-list/list-account-by-list.vue'),
},
{
path: 'products/:product?/info_proinfo/:info_proinfo?',
meta: {
caption: 'entities.product.views.info_proinfo.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'products', parameterName: 'product' },
{ pathName: 'info_proinfo', parameterName: 'info_proinfo' },
],
requireAuth: true,
},
component: () => import('@pages/product/product-info-pro-info/product-info-pro-info.vue'),
},
{
path: 'competitors/:competitor?/optionview/:optionview?',
meta: {
......@@ -2205,6 +2219,20 @@ const router = new Router({
},
component: () => import('@pages/sales/sales-literature-info-view/sales-literature-info-view.vue'),
},
{
path: 'uomschedules/:uomschedule?/pickupgridview/:pickupgridview?',
meta: {
caption: 'entities.uomschedule.views.pickupgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'uomschedules', parameterName: 'uomschedule' },
{ pathName: 'pickupgridview', parameterName: 'pickupgridview' },
],
requireAuth: true,
},
component: () => import('@pages/base/uom-schedule-pickup-grid-view/uom-schedule-pickup-grid-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/opportunityproducts/:opportunityproduct?/opp_oppprogridview/:opp_oppprogridview?',
meta: {
......@@ -2666,6 +2694,20 @@ const router = new Router({
},
component: () => import('@pages/sales/sales-literature-grid-view/sales-literature-grid-view.vue'),
},
{
path: 'uomschedules/:uomschedule?/pickupview/:pickupview?',
meta: {
caption: 'entities.uomschedule.views.pickupview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'uomschedules', parameterName: 'uomschedule' },
{ pathName: 'pickupview', parameterName: 'pickupview' },
],
requireAuth: true,
},
component: () => import('@pages/base/uom-schedule-pickup-view/uom-schedule-pickup-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/editperson/:editperson?',
meta: {
......
......@@ -288,6 +288,16 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '241c1fe99d6b6b99ad2888762140837a',
viewmodule: 'Base',
viewname: 'UomSchedulePickupView',
viewaction: '',
viewdatachange: false,
refviews: [
'7decb196037249b909762c9142adfe91',
],
},
{
viewtag: '24a93674ec4c976c08902a3e95421ca6',
viewmodule: 'Marketing',
......@@ -558,6 +568,19 @@ export const viewstate: any = {
'da3f8c1f20f440f3df54d6c13a8de586',
],
},
{
viewtag: '41e012bf9b91b39e4a30072986b7c11e',
viewmodule: 'Product',
viewname: 'ProductInfo_ProInfo',
viewaction: '',
viewdatachange: false,
refviews: [
'8b806fb12589b2fc17d1bb90f4b5422e',
'e52af970c14fd89546ac8ccaecab460c',
'241c1fe99d6b6b99ad2888762140837a',
'd3692664b9e2e150526e1ce4b969f15b',
],
},
{
viewtag: '44a690a1d62a390708480cb43f67d98b',
viewmodule: 'Marketing',
......@@ -982,6 +1005,16 @@ export const viewstate: any = {
viewname: 'ProductSummaryView',
viewaction: '',
viewdatachange: false,
refviews: [
'41e012bf9b91b39e4a30072986b7c11e',
],
},
{
viewtag: '7decb196037249b909762c9142adfe91',
viewmodule: 'Base',
viewname: 'UomSchedulePickupGridView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
......
......@@ -3,7 +3,7 @@
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { ProInfoDashboardBase } from './pro-info-dashboard-base';
import view_dashboard_sysportlet1 from '@widgets/product/summary-viewdashboard-sysportlet1-portlet/summary-viewdashboard-sysportlet1-portlet.vue';
import view_dashboard_sysportlet1 from '@widgets/product/view-pro-info-portlet/view-pro-info-portlet.vue';
/**
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import ProductService from '@/service/product/product-service';
import ProInfoService from './pro-info-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
/**
* form部件基类
*
* @export
* @class EditFormControlBase
* @extends {ProInfoEditFormBase}
*/
export class ProInfoEditFormBase extends EditFormControlBase {
/**
* 建构部件服务对象
*
* @type {ProInfoService}
* @memberof ProInfoEditFormBase
*/
public service: ProInfoService = new ProInfoService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {ProductService}
* @memberof ProInfoEditFormBase
*/
public appEntityService: ProductService = new ProductService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof ProInfoEditFormBase
*/
protected appDeName: string = 'product';
/**
* 表单数据对象
*
* @type {*}
* @memberof ProInfoEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
productname: null,
productnumber: null,
validfromdate: null,
validtodate: null,
defaultuomschedulename: null,
defaultuomname: null,
pricelevelname: null,
quantitydecimal: null,
subjectname: null,
description: null,
defaultuomid: null,
productid: null,
defaultuomscheduleid: null,
subjectid: null,
pricelevelid: null,
product:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof ProInfoEditFormBase
*/
public rules: any = {
productname: [
{ required: true, type: 'string', message: '产品名称 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '产品名称 值不能为空', trigger: 'blur' },
],
productnumber: [
{ required: true, type: 'string', message: '产品 ID 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '产品 ID 值不能为空', trigger: 'blur' },
],
quantitydecimal: [
{ required: true, type: 'number', message: '支持小数 值不能为空', trigger: 'change' },
{ required: true, type: 'number', message: '支持小数 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof ProInfoEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '产品基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.product.proinfo_form', extractMode: 'ITEM', details: [] } }),
grouppanel1: new FormGroupPanelModel({ caption: '详细信息', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.product.proinfo_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }),
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 0 }),
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srfkey: new FormItemModel({ caption: '产品', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 }),
srfmajortext: new FormItemModel({ caption: '产品名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
productname: new FormItemModel({ caption: '产品名称', detailType: 'FORMITEM', name: 'productname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
productnumber: new FormItemModel({ caption: '产品 ID', detailType: 'FORMITEM', name: 'productnumber', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
validfromdate: new FormItemModel({ caption: '有效期的开始日期', detailType: 'FORMITEM', name: 'validfromdate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
validtodate: new FormItemModel({ caption: '有效期的结束日期', detailType: 'FORMITEM', name: 'validtodate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
defaultuomschedulename: new FormItemModel({ caption: '计价单位组', detailType: 'FORMITEM', name: 'defaultuomschedulename', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
defaultuomname: new FormItemModel({ caption: '默认计价单位', detailType: 'FORMITEM', name: 'defaultuomname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
pricelevelname: new FormItemModel({ caption: '默认价目表', detailType: 'FORMITEM', name: 'pricelevelname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
quantitydecimal: new FormItemModel({ caption: '支持小数', detailType: 'FORMITEM', name: 'quantitydecimal', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
subjectname: new FormItemModel({ caption: '主题', detailType: 'FORMITEM', name: 'subjectname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
description: new FormItemModel({ caption: '说明', detailType: 'FORMITEM', name: 'description', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
defaultuomid: new FormItemModel({ caption: '默认计价单位', detailType: 'FORMITEM', name: 'defaultuomid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
productid: new FormItemModel({ caption: '产品', detailType: 'FORMITEM', name: 'productid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 }),
defaultuomscheduleid: new FormItemModel({ caption: '计价单位组', detailType: 'FORMITEM', name: 'defaultuomscheduleid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
subjectid: new FormItemModel({ caption: '主题', detailType: 'FORMITEM', name: 'subjectid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
pricelevelid: new FormItemModel({ caption: '默认价目表', detailType: 'FORMITEM', name: 'pricelevelid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 2 }),
};
}
\ No newline at end of file
/**
* ProInfo 部件模型
*
* @export
* @class ProInfoModel
*/
export default class ProInfoModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ProInfoModel
*/
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: 'productid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'productname',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'productname',
prop: 'productname',
dataType: 'TEXT',
},
{
name: 'productnumber',
prop: 'productnumber',
dataType: 'TEXT',
},
{
name: 'validfromdate',
prop: 'validfromdate',
dataType: 'DATETIME',
},
{
name: 'validtodate',
prop: 'validtodate',
dataType: 'DATETIME',
},
{
name: 'defaultuomschedulename',
prop: 'defaultuomschedulename',
dataType: 'PICKUPTEXT',
},
{
name: 'defaultuomname',
prop: 'defaultuomname',
dataType: 'PICKUPTEXT',
},
{
name: 'pricelevelname',
prop: 'pricelevelname',
dataType: 'PICKUPTEXT',
},
{
name: 'quantitydecimal',
prop: 'quantitydecimal',
dataType: 'INT',
},
{
name: 'subjectname',
prop: 'subjectname',
dataType: 'PICKUPTEXT',
},
{
name: 'description',
prop: 'description',
dataType: 'LONGTEXT_1000',
},
{
name: 'defaultuomid',
prop: 'defaultuomid',
dataType: 'PICKUP',
},
{
name: 'productid',
prop: 'productid',
dataType: 'GUID',
},
{
name: 'defaultuomscheduleid',
prop: 'defaultuomscheduleid',
dataType: 'PICKUP',
},
{
name: 'subjectid',
prop: 'subjectid',
dataType: 'PICKUP',
},
{
name: 'pricelevelid',
prop: 'pricelevelid',
dataType: 'PICKUP',
},
{
name: 'product',
prop: 'productid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import ProductService from '@/service/product/product-service';
import ProInfoModel from './pro-info-form-model';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import UomService from '@/service/uom/uom-service';
import PriceLevelService from '@/service/price-level/price-level-service';
import SubjectService from '@/service/subject/subject-service';
/**
* ProInfo 部件服务对象
*
* @export
* @class ProInfoService
*/
export default class ProInfoService extends ControlService {
/**
* 产品服务对象
*
* @type {ProductService}
* @memberof ProInfoService
*/
public appEntityService: ProductService = new ProductService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof ProInfoService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of ProInfoService.
*
* @param {*} [opts={}]
* @memberof ProInfoService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new ProInfoModel();
}
/**
* 计价单位组服务对象
*
* @type {UomScheduleService}
* @memberof ProInfoService
*/
public uomscheduleService: UomScheduleService = new UomScheduleService();
/**
* 计价单位服务对象
*
* @type {UomService}
* @memberof ProInfoService
*/
public uomService: UomService = new UomService();
/**
* 价目表服务对象
*
* @type {PriceLevelService}
* @memberof ProInfoService
*/
public pricelevelService: PriceLevelService = new PriceLevelService();
/**
* 主题服务对象
*
* @type {SubjectService}
* @memberof ProInfoService
*/
public subjectService: SubjectService = new SubjectService();
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof ProInfoService
*/
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 ProInfoService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'UomScheduleService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.uomscheduleService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'uomscheduleid', 'uomschedule');
}
if (Object.is(serviceName, 'UomService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.uomService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'uomid', 'uom');
}
if (Object.is(serviceName, 'PriceLevelService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.pricelevelService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'pricelevelid', 'pricelevel');
}
if (Object.is(serviceName, 'SubjectService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.subjectService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'subjectid', 'subject');
}
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof ProInfoService
*/
@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 ProInfoService
*/
@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 ProInfoService
*/
@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 ProInfoService
*/
@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 ProInfoService
*/
@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 ProInfoService
*/
@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 ProInfoService
*/
@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.productid = PrimaryKey;
Data.product = 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.productid = 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 ProInfoService
*/
@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 ProInfoService
*/
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};
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-form' ref='form' id='product_proinfo' style="">
<input style="display:none;" />
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.product.proinfo_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.productname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='productname' :itemRules="this.rules.productname" class='' :caption="$t('entities.product.proinfo_form.details.productname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.productname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.productname" @enter="onEnter($event)" unit="" :disabled="detailsModel.productname.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.productnumber.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='productnumber' :itemRules="this.rules.productnumber" class='' :caption="$t('entities.product.proinfo_form.details.productnumber')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.productnumber.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.productnumber" @enter="onEnter($event)" unit="" :disabled="detailsModel.productnumber.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.validfromdate.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='validfromdate' :itemRules="this.rules.validfromdate" class='' :caption="$t('entities.product.proinfo_form.details.validfromdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.validfromdate.error" :isEmptyCaption="false" labelPos="LEFT">
<date-picker type="datetime" :transfer="true" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间..." :value="data.validfromdate" :disabled="detailsModel.validfromdate.disabled" style="min-width: 150px; width:160px;" @on-change="(val1, val2) => { this.data.validfromdate = val1 }"></date-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.validtodate.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='validtodate' :itemRules="this.rules.validtodate" class='' :caption="$t('entities.product.proinfo_form.details.validtodate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.validtodate.error" :isEmptyCaption="false" labelPos="LEFT">
<date-picker type="datetime" :transfer="true" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间..." :value="data.validtodate" :disabled="detailsModel.validtodate.disabled" style="min-width: 150px; width:160px;" @on-change="(val1, val2) => { this.data.validtodate = val1 }"></date-picker>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
<i-col v-show="detailsModel.grouppanel1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.product.proinfo_form.details.grouppanel1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.defaultuomschedulename.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='defaultuomschedulename' :itemRules="this.rules.defaultuomschedulename" class='' :caption="$t('entities.product.proinfo_form.details.defaultuomschedulename')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.defaultuomschedulename.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.defaultuomschedulename.disabled"
name='defaultuomschedulename'
deMajorField='uomschedulename'
deKeyField='uomschedule'
:service="service"
:acParams="{ serviceName: 'UomScheduleService', interfaceName: 'FetchDefault'}"
valueitem='defaultuomscheduleid'
:value="data.defaultuomschedulename"
editortype=""
:pickupView="{ viewname: 'uom-schedule-pickup-view', title: $t('entities.uomschedule.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'uomschedules', parameterName: 'uomschedule' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.defaultuomname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='defaultuomname' :itemRules="this.rules.defaultuomname" class='' :caption="$t('entities.product.proinfo_form.details.defaultuomname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.defaultuomname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.defaultuomname.disabled"
name='defaultuomname'
deMajorField='uomname'
deKeyField='uom'
:service="service"
:acParams="{ serviceName: 'UomService', interfaceName: 'FetchDefault'}"
valueitem='defaultuomid'
:value="data.defaultuomname"
editortype=""
:pickupView="{ viewname: 'uom-pickup-view', title: $t('entities.uom.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'uoms', parameterName: 'uom' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.pricelevelname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='pricelevelname' :itemRules="this.rules.pricelevelname" class='' :caption="$t('entities.product.proinfo_form.details.pricelevelname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.pricelevelname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.pricelevelname.disabled"
name='pricelevelname'
deMajorField='pricelevelname'
deKeyField='pricelevel'
:service="service"
:acParams="{ serviceName: 'PriceLevelService', interfaceName: 'FetchDefault'}"
valueitem='pricelevelid'
:value="data.pricelevelname"
editortype=""
:pickupView="{ viewname: 'price-level-pickup-view', title: $t('entities.pricelevel.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'pricelevels', parameterName: 'pricelevel' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.quantitydecimal.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='quantitydecimal' :itemRules="this.rules.quantitydecimal" class='' :caption="$t('entities.product.proinfo_form.details.quantitydecimal')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.quantitydecimal.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.quantitydecimal" @enter="onEnter($event)" unit="" :disabled="detailsModel.quantitydecimal.disabled" type='number' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.subjectname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='subjectname' :itemRules="this.rules.subjectname" class='' :caption="$t('entities.product.proinfo_form.details.subjectname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.subjectname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.subjectname.disabled"
name='subjectname'
deMajorField='title'
deKeyField='subject'
:service="service"
:acParams="{ serviceName: 'SubjectService', interfaceName: 'FetchDefault'}"
valueitem='subjectid'
:value="data.subjectname"
editortype=""
:pickupView="{ viewname: 'subject-pickup-view', title: $t('entities.subject.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'subjects', parameterName: 'subject' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.description.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-item name='description' :itemRules="this.rules.description" class='' :caption="$t('entities.product.proinfo_form.details.description')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.description.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.description" :autoSize="{minRows: 10}" :disabled="detailsModel.description.disabled" type='textarea' style="height:200px;" ></input-box>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</row>
</i-form>
\ No newline at end of file
<template src="./pro-info-form.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { ProInfoEditFormBase } from './pro-info-form-base';
/**
* form部件
*
* @export
* @class ProInfoEditForm
* @extends {ProInfoEditFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class ProInfoEditForm extends ProInfoEditFormBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import ProductService from '@/service/product/product-service';
import View_ProInfoService from './view-pro-info-portlet-service';
import { Environment } from '@/environments/environment';
/**
* dashboard_sysportlet1部件基类
*
* @export
* @class MainControlBase
* @extends {View_ProInfoPortletBase}
*/
export class View_ProInfoPortletBase extends MainControlBase {
/**
* 建构部件服务对象
*
* @type {View_ProInfoService}
* @memberof View_ProInfoPortletBase
*/
public service: View_ProInfoService = new View_ProInfoService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {ProductService}
* @memberof View_ProInfoPortletBase
*/
public appEntityService: ProductService = new ProductService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof View_ProInfoPortletBase
*/
protected appDeName: string = 'product';
/**
* 长度
*
* @type {number}
* @memberof View_ProInfo
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof View_ProInfo
*/
@Prop() public width?: number;
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof View_ProInfoBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof View_ProInfoBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof View_ProInfoBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof View_ProInfoBase
*/
get getHeight(): any{
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
} else {
return this.height+'px';
}
} else {
return 'auto';
}
}
/**
* vue 生命周期
*
* @memberof View_ProInfoBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof View_ProInfoBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof View_ProInfoBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof View_ProInfoBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
/**
* View_ProInfo 部件模型
*
* @export
* @class View_ProInfoModel
*/
export default class View_ProInfoModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof View_ProInfoModel
*/
public getDataItems(): any[] {
return [
{
name: 'vendorid',
},
{
name: 'productstructure',
},
{
name: 'versionnumber',
},
{
name: 'stageid',
},
{
name: 'statuscode',
},
{
name: 'entityimage',
},
{
name: 'overriddencreatedon',
},
{
name: 'stockitem',
},
{
name: 'importsequencenumber',
},
{
name: 'validfromdate',
},
{
name: 'suppliername',
},
{
name: 'producttypecode',
},
{
name: 'entityimageid',
},
{
name: 'entityimage_timestamp',
},
{
name: 'producturl',
},
{
name: 'standardcost',
},
{
name: 'quantityonhand',
},
{
name: 'currentcost',
},
{
name: 'exchangerate',
},
{
name: 'product',
prop: 'productid',
},
{
name: 'description',
},
{
name: 'vendorname',
},
{
name: 'dmtimportstate',
},
{
name: 'entityimage_url',
},
{
name: 'stockvolume',
},
{
name: 'quantitydecimal',
},
{
name: 'vendorpartnumber',
},
{
name: 'validtodate',
},
{
name: 'reparented',
},
{
name: 'createman',
},
{
name: 'processid',
},
{
name: 'createdate',
},
{
name: 'productnumber',
},
{
name: 'kit',
},
{
name: 'updatedate',
},
{
name: 'currentcost_base',
},
{
name: 'updateman',
},
{
name: 'stockweight',
},
{
name: 'size',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'productname',
},
{
name: 'price_base',
},
{
name: 'price',
},
{
name: 'traversedpath',
},
{
name: 'hierarchypath',
},
{
name: 'standardcost_base',
},
{
name: 'statecode',
},
{
name: 'parentproductid',
},
{
name: 'transactioncurrencyid',
},
{
name: 'pricelevelid',
},
{
name: 'defaultuomid',
},
{
name: 'defaultuomscheduleid',
},
{
name: 'subjectid',
},
{
name: 'parentproductname',
},
{
name: 'transactioncurrencyname',
},
{
name: 'pricelevelname',
},
{
name: 'defaultuomname',
},
{
name: 'defaultuomschedulename',
},
{
name: 'subjectname',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* View_ProInfo 部件服务对象
*
* @export
* @class View_ProInfoService
*/
export default class View_ProInfoService extends ControlService {
}
<div class='portlet view-pro-info ' :style="{}">
<p class='portlet-title'>
<span>
产品信息
</span>
</p>
<div class="portlet-with-title">
<product-info-pro-info :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></product-info-pro-info>
</div>
</div>
<template src="./view-pro-info-portlet.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { View_ProInfoPortletBase } from './view-pro-info-portlet-base';
/**
* dashboard_sysportlet1部件
*
* @export
* @class View_ProInfoPortlet
* @extends {View_ProInfoPortletBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class View_ProInfoPortlet extends View_ProInfoPortletBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, SearchFormControlBase } from '@/studio-core';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import DefaultService from './default-searchform-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
/**
* searchform部件基类
*
* @export
* @class SearchFormControlBase
* @extends {DefaultSearchFormBase}
*/
export class DefaultSearchFormBase extends SearchFormControlBase {
/**
* 建构部件服务对象
*
* @type {DefaultService}
* @memberof DefaultSearchFormBase
*/
public service: DefaultService = new DefaultService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {UomScheduleService}
* @memberof DefaultSearchFormBase
*/
public appEntityService: UomScheduleService = new UomScheduleService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof DefaultSearchFormBase
*/
protected appDeName: string = 'uomschedule';
/**
* 表单数据对象
*
* @type {*}
* @memberof DefaultSearchFormBase
*/
public data: any = {
};
/**
* 详情模型集合
*
* @type {*}
* @memberof DefaultSearchFormBase
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
};
}
\ No newline at end of file
/**
* Default 部件模型
*
* @export
* @class DefaultModel
*/
export default class DefaultModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof DefaultModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import DefaultModel from './default-searchform-model';
/**
* Default 部件服务对象
*
* @export
* @class DefaultService
*/
export default class DefaultService extends ControlService {
/**
* 计价单位组服务对象
*
* @type {UomScheduleService}
* @memberof DefaultService
*/
public appEntityService: UomScheduleService = new UomScheduleService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof DefaultService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of DefaultService.
*
* @param {*} [opts={}]
* @memberof DefaultService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new DefaultModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof DefaultService
*/
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 DefaultService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@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 DefaultService
*/
@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 DefaultService
*/
@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 DefaultService
*/
@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 DefaultService
*/
@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 DefaultService
*/
@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 DefaultService
*/
@Errorlog
public loadDraft(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.GetDraft(Context,Data, isloading);
}
result.then((response) => {
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 DefaultService
*/
@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 DefaultService
*/
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};
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-search-form' ref='searchform' style="">
<input style="display:none;"/>
<div class="search-button">
<i-button size="small" type="primary" ghost @click="onSearch.apply(_self, arguments)">{{$t('app.searchButton.search')}}</i-button>
<i-button size="small" type="default" ghost @click="onReset.apply(_self, arguments)">{{this.$t('app.searchButton.reset')}}</i-button>
</div>
<div class="form-content">
</div>
</i-form>
\ No newline at end of file
<template src="./default-searchform.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { DefaultSearchFormBase } from './default-searchform-base';
/**
* searchform部件
*
* @export
* @class DefaultSearchForm
* @extends {DefaultSearchFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class DefaultSearchForm extends DefaultSearchFormBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, GridControllerBase } from '@/studio-core';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import MainService from './main-grid-service';
import { FormItemModel } from '@/model/form-detail';
/**
* grid部件基类
*
* @export
* @class GridControllerBase
* @extends {MainGridBase}
*/
export class MainGridBase extends GridControllerBase {
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof MainGridBase
*/
public service: MainService = new MainService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {UomScheduleService}
* @memberof MainGridBase
*/
public appEntityService: UomScheduleService = new UomScheduleService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof MainGridBase
*/
protected appDeName: string = 'uomschedule';
/**
* 本地缓存标识
*
* @protected
* @type {string}
* @memberof GridControllerBase
*/
protected localStorageTag: string = 'uomschedule_main_grid';
/**
* 所有列成员
*
* @type {any[]}
* @memberof MainGridBase
*/
public allColumns: any[] = [
{
name: 'uomschedulename',
label: '单位进度表名称',
langtag: 'entities.uomschedule.main_grid.columns.uomschedulename',
show: true,
util: 'PX'
},
{
name: 'updateman',
label: '更新人',
langtag: 'entities.uomschedule.main_grid.columns.updateman',
show: true,
util: 'PX'
},
{
name: 'updatedate',
label: '更新时间',
langtag: 'entities.uomschedule.main_grid.columns.updatedate',
show: true,
util: 'PX'
},
]
/**
* 获取表格行模型
*
* @type {*}
* @memberof MainGridBase
*/
public getGridRowModel(){
return {
srfkey: new FormItemModel(),
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof MainGridBase
*/
public rules: any = {
srfkey: [
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '计价单位组 值不能为空', trigger: 'change' },
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '计价单位组 值不能为空', trigger: 'blur' },
],
}
/**
* 获取对应列class
*
* @type {*}
* @memberof MainBase
*/
public hasRowEdit: any = {
'uomschedulename':false,
'updateman':false,
'updatedate':false,
};
/**
* 获取对应列class
*
* @param {*} $args row 行数据,column 列数据,rowIndex 行索引,列索引
* @returns {void}
* @memberof MainBase
*/
public getCellClassName(args: {row: any, column: any, rowIndex: number, columnIndex: number}): any {
return ( this.hasRowEdit[args.column.property] && this.actualIsOpenEdit ) ? "edit-cell" : "info-cell";
}
/**
* 导出数据格式化
*
* @param {*} filterVal
* @param {*} jsonData
* @param {any[]} [codelistColumns=[]]
* @returns {Promise<any>}
* @memberof MainGridBase
*/
public async formatExcelData(filterVal: any, jsonData: any, codelistColumns?: any[]): Promise<any> {
return super.formatExcelData(filterVal, jsonData, [
{
name: 'updateman',
srfkey: 'SysOperator',
codelistType : 'DYNAMIC',
renderMode: 'other',
textSeparator: '、',
valueSeparator: ',',
},
]);
}
}
\ No newline at end of file
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export default class MainModel {
/**
* 是否是实体数据导出
*
* @returns {any[]}
* @memberof MainGridMode
*/
public isDEExport: boolean = false;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainGridMode
*/
public getDataItems(): any[] {
if(this.isDEExport){
return [
]
}else{
return [
{
name: 'uomschedulename',
prop: 'uomschedulename',
dataType: 'TEXT',
},
{
name: 'updateman',
prop: 'updateman',
dataType: 'TEXT',
},
{
name: 'updatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srfmajortext',
prop: 'uomschedulename',
dataType: 'TEXT',
},
{
name: 'srfdataaccaction',
prop: 'uomscheduleid',
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'uomscheduleid',
dataType: 'GUID',
},
{
name: 'uomschedule',
prop: 'uomscheduleid',
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
},
{
name:'srfparentdata',
prop:'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import MainModel from './main-grid-model';
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export default class MainService extends ControlService {
/**
* 计价单位组服务对象
*
* @type {UomScheduleService}
* @memberof MainService
*/
public appEntityService: UomScheduleService = new UomScheduleService({ $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();
}
/**
* 处理数据
*
* @public
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof MainService
*/
public 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[]> {
return Promise.reject([])
}
/**
* 添加数据
*
* @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,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_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,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_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,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading);
}else{
result =_appEntityService.Update(Data,Context,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,true);
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) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:0});
}
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public search(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(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,true);
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) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.uomscheduleid = Util.createUUID();
}
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,true);
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);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
}
\ No newline at end of file
<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
<i-form>
<el-table v-if="isDisplay === true"
:default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName.bind(_self)"
:cell-class-name="getCellClassName.bind(_self)"
size="mini"
stripe
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty">
无数据
<span class="quick-toolbar">
</span>
</template>
<template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('uomschedulename')">
<el-table-column show-overflow-tooltip :prop="'uomschedulename'" :label="$t('entities.uomschedule.main_grid.columns.uomschedulename')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.uomschedule.main_grid.columns.uomschedulename')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.uomschedulename}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updateman')">
<el-table-column show-overflow-tooltip :prop="'updateman'" :label="$t('entities.uomschedule.main_grid.columns.updateman')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.uomschedule.main_grid.columns.updateman')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<template >
<codelist :value="row.updateman" tag='SysOperator' codelistType='DYNAMIC' ></codelist>
</template>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.uomschedule.main_grid.columns.updatedate')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.uomschedule.main_grid.columns.updatedate')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data>
</template>
</el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
<row class='grid-pagination' v-show="items.length > 0">
<page class='pull-right' @on-change="pageOnChange($event)"
@on-page-size-change="onPageSizeChange($event)"
:transfer="true" :total="totalRecord"
show-sizer :current="curPage" :page-size="limit"
:page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
<span>
<span class="page-column">
<poptip transfer placement="top-start">
<i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
<div slot="content">
<template v-for="col in allColumns">
<div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
</template>
</div>
</poptip>
</span>
<span v-if="selections.length > 0" class="batch-toolbar">
</span>
<span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
<span>
{{$t('app.gridpage.show')}}&nbsp;
<span>
<template v-if="items.length === 1">
1
</template>
<template v-else>
<span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
</template>
</span>&nbsp;
{{$t('app.gridpage.records')}},{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
</span>
</span>
</page>
</row>
</i-form>
</div>
\ No newline at end of file
<template src="./main-grid.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { MainGridBase } from './main-grid-base';
/**
* grid部件
*
* @export
* @class MainGrid
* @extends {MainGridBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class MainGrid extends MainGridBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import UomScheduleService from '@/service/uom-schedule/uom-schedule-service';
import PickupViewpickupviewpanelService from './pickup-viewpickupviewpanel-pickupviewpanel-service';
import PickupViewpickupviewpanelModel from './pickup-viewpickupviewpanel-pickupviewpanel-model';
/**
* pickupviewpanel部件基类
*
* @export
* @class MainControlBase
* @extends {PickupViewpickupviewpanelPickupviewpanelBase}
*/
export class PickupViewpickupviewpanelPickupviewpanelBase extends MainControlBase {
/**
* 建构部件服务对象
*
* @type {PickupViewpickupviewpanelService}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
public service: PickupViewpickupviewpanelService = new PickupViewpickupviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {UomScheduleService}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
public appEntityService: UomScheduleService = new UomScheduleService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
protected appDeName: string = 'uomschedule';
/**
* 选中数据字符串
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
@Prop() public selectedData?: string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanel
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PickupViewpickupviewpanel
*/
public getData(): any {
return {};
}
/**
* 视图名称
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public view: any = {
viewname: 'uom-schedule-pickup-grid-view',
data: {},
}
/**
* 局部上下文
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = null;
/**
* 视图数据
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
@Prop() public isSingleSelect?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
public inited: boolean = false;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public onViewDatasChange($event: any): void {
if($event.length>0){
$event.forEach((item:any,index:any) => {
let srfmajortext = item['uomschedulename'];
if(srfmajortext){
Object.assign($event[index],{srfmajortext: srfmajortext});
}
});
}
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanel
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PickupViewpickupviewpanel
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(Object.assign(data, this.viewparams));
this.inited = true;
}
});
}
}
/**
* 初始化导航参数
*
* @memberof PickupViewpickupviewpanel
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanel
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PickupViewpickupviewpanel
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
\ No newline at end of file
/**
* PickupViewpickupviewpanel 部件模型
*
* @export
* @class PickupViewpickupviewpanelModel
*/
export default class PickupViewpickupviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'importsequencenumber',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'createman',
},
{
name: 'description',
},
{
name: 'baseuomname',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'versionnumber',
},
{
name: 'createdate',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'statecode',
},
{
name: 'statuscode',
},
{
name: 'overriddencreatedon',
},
{
name: 'uomschedulename',
},
{
name: 'uomschedule',
prop: 'uomscheduleid',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PickupViewpickupviewpanel 部件服务对象
*
* @export
* @class PickupViewpickupviewpanelService
*/
export default class PickupViewpickupviewpanelService extends ControlService {
}
\ No newline at end of file
<div class='pickupviewpanel'>
<component
v-if="inited && view.viewname && !Object.is(view.viewname, '')"
:is="view.viewname"
class="viewcontainer3"
:viewdata="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
@viewdataschange="onViewDatasChange.apply(_self, arguments)"
@viewdatasactivated="viewDatasActivated.apply(_self, arguments)"
@viewload="onViewLoad.apply(_self, arguments)">
</component>
</div>
\ No newline at end of file
<template src="./pickup-viewpickupviewpanel-pickupviewpanel.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { PickupViewpickupviewpanelPickupviewpanelBase } from './pickup-viewpickupviewpanel-pickupviewpanel-base';
/**
* pickupviewpanel部件
*
* @export
* @class PickupViewpickupviewpanelPickupviewpanel
* @extends {PickupViewpickupviewpanelPickupviewpanelBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class PickupViewpickupviewpanelPickupviewpanel extends PickupViewpickupviewpanelPickupviewpanelBase { }
</script>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册