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

chitanda 发布系统代码

上级 dcf71877
......@@ -3159,6 +3159,43 @@
}
]
},
{
"srfkey": "Opportunity__StateCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "2",
"label": "丢单",
"text": "丢单",
"data":"",
"codename":"Item_2",
"value": "2",
"disabled": false
}
, {
"id": "0",
"label": "已开始",
"text": "已开始",
"data":"",
"codename":"Item_0",
"value": "0",
"disabled": false
}
, {
"id": "1",
"label": "赢单",
"text": "赢单",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "Opportunity__PurchaseProcess",
"emptytext": "未定义",
......
......@@ -2249,6 +2249,16 @@
"viewtag": "d43728f22dd85502c1f3c27e93878162",
"memo": "系统自动添加"
},
"opportunitylostgridview": {
"title": "商机信息",
"caption": "商机信息",
"viewtype": "DEGRIDVIEW",
"viewmodule": "Sales",
"viewname": "OpportunityLostGridView",
"viewfilename": "opportunity-lost-grid-view",
"viewtag": "d43a25ac94ca7cb20db961aae174ca53",
"memo": "系统自动添加"
},
"leadcompetitorgridview": {
"title": "潜在客户对手表格视图",
"caption": "潜在客户对手",
......
......@@ -90,8 +90,7 @@ export default class DataPanelEngine extends ViewEngine {
}
} else if (Object.is(this.dataPanel.controlType, ctrl.type.Panel)) {
if (data && data.data) {
this.dataPanel.data = data.data;
this.dataPanel.$forceUpdate();
this.dataPanel.onInputDataChange(data.data);
}
}
......
......@@ -400,6 +400,12 @@ export default {
"2": "免收费用",
"empty": ""
},
Opportunity__StateCode: {
"2": "丢单",
"0": "已开始",
"1": "赢单",
"empty": ""
},
Opportunity__PurchaseProcess: {
"0": "个人",
"1": "委员会",
......
......@@ -400,6 +400,12 @@ export default {
"2": "免收费用",
"empty": "",
},
Opportunity__StateCode: {
"2": "丢单",
"0": "已开始",
"1": "赢单",
"empty": "",
},
Opportunity__PurchaseProcess: {
"0": "个人",
"1": "委员会",
......
......@@ -170,6 +170,10 @@ export default {
caption: "商机信息",
title: "商机信息",
},
lostgridview: {
caption: "商机信息",
title: "商机信息",
},
},
quickcreate_form: {
details: {
......@@ -263,6 +267,30 @@ export default {
uiactions: {
},
},
datapanel_form: {
details: {
button1: "刷新",
grouppanel1: "分组面板",
group1: "商机基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "商机",
srfmajortext: "商机名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
estimatedclosedate: "预计结束日期",
estimatedvalue: "预计收入",
statecode: "状态",
owneridyominame: "负责人",
opportunityid: "商机",
},
uiactions: {
refresh: "刷新",
},
},
productinfo_form: {
details: {
group1: "价目表信息",
......
......@@ -169,6 +169,10 @@ export default {
caption: "商机信息",
title: "商机信息",
},
lostgridview: {
caption: "商机信息",
title: "商机信息",
},
},
quickcreate_form: {
details: {
......@@ -262,6 +266,30 @@ export default {
uiactions: {
},
},
datapanel_form: {
details: {
button1: "刷新",
grouppanel1: "分组面板",
group1: "商机基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "商机",
srfmajortext: "商机名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
estimatedclosedate: "预计结束日期",
estimatedvalue: "预计收入",
statecode: "状态",
owneridyominame: "负责人",
opportunityid: "商机",
},
uiactions: {
refresh: "刷新",
},
},
productinfo_form: {
details: {
group1: "价目表信息",
......
......@@ -3167,6 +3167,43 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: "Opportunity__StateCode",
emptytext: "未定义",
"codelisttype":"static",
items: [
{
id: "2",
label: "丢单",
text: "丢单",
"data":"",
"codename":"Item_2",
value: "2",
disabled: false,
},
{
id: "0",
label: "已开始",
text: "已开始",
"data":"",
"codename":"Item_0",
value: "0",
disabled: false,
},
{
id: "1",
label: "赢单",
text: "赢单",
"data":"",
"codename":"Item_1",
value: "1",
disabled: false,
},
]
},
{
srfkey: "Opportunity__PurchaseProcess",
emptytext: "未定义",
......
......@@ -1807,6 +1807,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "LeadCompetitorEditView",
"viewtag": "d43728f22dd85502c1f3c27e93878162"
},
"opportunitylostgridview": {
"title": "商机信息",
"caption": "商机信息",
"viewtype": "DEGRIDVIEW",
"viewmodule": "Sales",
"viewname": "OpportunityLostGridView",
"viewtag": "d43a25ac94ca7cb20db961aae174ca53"
},
"leadcompetitorgridview": {
"title": "潜在客户对手表格视图",
"caption": "潜在客户对手",
......
import { Subject } from 'rxjs';
import { TabExpViewBase } from '@/studio-core';
import OpportunityService from '@/service/opportunity/opportunity-service';
import DataPanelEngine from '@engine/ctrl/data-panel-engine';
import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
import OpportunityUIService from '@/uiservice/opportunity/opportunity-ui-service';
......@@ -79,6 +80,7 @@ export class OpportunityInfoBase extends TabExpViewBase {
* @memberof OpportunityInfoBase
*/
protected containerModel: any = {
view_datapanel: { name: 'datapanel', type: 'FORM' },
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_tabexppanel: { name: 'tabexppanel', type: 'TABEXPPANEL' },
};
......@@ -127,6 +129,15 @@ export class OpportunityInfoBase extends TabExpViewBase {
protected viewtag: string = '8bfcd7acdd1f36afc1714f1071671f2c';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof OpportunityInfoBase
*/
public datapanel: DataPanelEngine = new DataPanelEngine();
/**
* 视图引擎
*
......@@ -143,6 +154,13 @@ export class OpportunityInfoBase extends TabExpViewBase {
* @memberof OpportunityInfoBase
*/
public engineInit(): void {
this.datapanel.init({
view: this,
datapanel: this.$refs.datapanel,
keyPSDEField: 'opportunity',
majorPSDEField: 'opportunityname',
isLoadDefault: true,
});
this.engine.init({
view: this,
keyPSDEField: 'opportunity',
......
<studio-view-style2 viewName="opportunityinfo" viewTitle="商机信息" class='detabexpview opportunity-info'>
<template slot="dataPanel">
<view_datapanel
: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="datapanel"
ref='datapanel'
@closeview="closeView($event)">
</view_datapanel>
</template>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
<view_tabexppanel
......
......@@ -3,6 +3,7 @@
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { OpportunityInfoBase } from './opportunity-info-base';
import view_datapanel from '@widgets/opportunity/data-panel-form/data-panel-form.vue';
import view_tabexppanel from '@widgets/opportunity/infotabexppanel-tabexppanel/infotabexppanel-tabexppanel.vue';
/**
......@@ -14,6 +15,7 @@ import view_tabexppanel from '@widgets/opportunity/infotabexppanel-tabexppanel/i
*/
@Component({
components: {
view_datapanel,
view_tabexppanel,
}
})
......
......@@ -93,6 +93,7 @@ export default class OpportunityUIServiceBase extends UIService {
this.allViewMap.set(':',{viewname:'quickcreate',srfappde:'opportunities'});
this.allViewMap.set(':',{viewname:'info_product',srfappde:'opportunities'});
this.allViewMap.set(':',{viewname:'wingridview',srfappde:'opportunities'});
this.allViewMap.set(':',{viewname:'lostgridview',srfappde:'opportunities'});
}
/**
......
......@@ -177,7 +177,8 @@ export class AppPopover {
props: {
viewdata: JSON.stringify(viewdata),
viewDefaultUsage: false,
viewparam:JSON.stringify(data)
viewUsage: 4,
viewparam: JSON.stringify(data)
},
on: {
viewdataschange: ($event: any) => this.dataChange($event),
......@@ -236,7 +237,6 @@ export class AppPopover {
*/
public openPopover(event: any, content?: (h: CreateElement) => any, title?: string, position: PopperJs.Placement = 'left', isAutoClose: boolean = true, width?: number, height?: number): void {
// 阻止事件冒泡
event.stopPropagation();
const element: Element = event.toElement || event.srcElement;
if (element.hasAttribute('app-popover-tag')) {
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import OpportunityService from '@/service/opportunity/opportunity-service';
import DataPanelService from './data-panel-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
/**
* datapanel部件基类
*
* @export
* @class EditFormControlBase
* @extends {DataPanelEditFormBase}
*/
export class DataPanelEditFormBase extends EditFormControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof DataPanelEditFormBase
*/
protected controlType: string = 'FORM';
/**
* 建构部件服务对象
*
* @type {DataPanelService}
* @memberof DataPanelEditFormBase
*/
public service: DataPanelService = new DataPanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {OpportunityService}
* @memberof DataPanelEditFormBase
*/
public appEntityService: OpportunityService = new OpportunityService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof DataPanelEditFormBase
*/
protected appDeName: string = 'opportunity';
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public datapanel_button1_click(params: any = {}, tag?: any, $event?: any) {
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this;
if (_this.getDatas && _this.getDatas instanceof Function) {
datas = [..._this.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Refresh(datas, contextJO,paramJO, $event, xData,this,"Opportunity");
}
/**
* 刷新
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof OpportunityInfoBase
*/
public Refresh(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.refresh && xData.refresh instanceof Function) {
xData.refresh(args);
} else if (_this.refresh && _this.refresh instanceof Function) {
_this.refresh(args);
}
}
/**
* 表单数据对象
*
* @type {*}
* @memberof DataPanelEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
estimatedclosedate: null,
estimatedvalue: null,
statecode: null,
owneridyominame: null,
opportunityid: null,
opportunity:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof DataPanelEditFormBase
*/
public rules: any = {
}
/**
* 详情模型集合
*
* @type {*}
* @memberof DataPanelEditFormBase
*/
public detailsModel: any = {
button1: new FormButtonModel({ caption: '刷新', detailType: 'BUTTON', name: 'button1', visible: true, isShowCaption: true, form: this, uiaction: { type: 'DEUIACTION', tag: 'Refresh', actiontarget: 'SINGLEKEY' } }),
grouppanel1: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.opportunity.datapanel_form', extractMode: 'ITEM', details: [] } }),
group1: new FormGroupPanelModel({ caption: '商机基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.opportunity.datapanel_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: 3 }),
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 }),
estimatedclosedate: new FormItemModel({ caption: '预计结束日期', detailType: 'FORMITEM', name: 'estimatedclosedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
estimatedvalue: new FormItemModel({ caption: '预计收入', detailType: 'FORMITEM', name: 'estimatedvalue', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
statecode: new FormItemModel({ caption: '状态', detailType: 'FORMITEM', name: 'statecode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
owneridyominame: new FormItemModel({ caption: '负责人', detailType: 'FORMITEM', name: 'owneridyominame', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
opportunityid: new FormItemModel({ caption: '商机', detailType: 'FORMITEM', name: 'opportunityid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
};
/**
* 表单 刷新 事件
*
* @memberof @memberof DataPanelEditFormBase
*/
public button1_click($event: any): void {
this.datapanel_button1_click(null, null, $event);
}
}
\ No newline at end of file
/**
* DataPanel 部件模型
*
* @export
* @class DataPanelModel
*/
export default class DataPanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof DataPanelModel
*/
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: 'opportunityid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'opportunityname',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'estimatedclosedate',
prop: 'estimatedclosedate',
dataType: 'DATETIME',
},
{
name: 'estimatedvalue',
prop: 'estimatedvalue',
dataType: 'BIGDECIMAL',
},
{
name: 'statecode',
prop: 'statecode',
dataType: 'NSCODELIST',
},
{
name: 'owneridyominame',
prop: 'owneridyominame',
dataType: 'TEXT',
},
{
name: 'opportunityid',
prop: 'opportunityid',
dataType: 'GUID',
},
{
name: 'opportunity',
prop: 'opportunityid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import OpportunityService from '@/service/opportunity/opportunity-service';
import DataPanelModel from './data-panel-form-model';
/**
* DataPanel 部件服务对象
*
* @export
* @class DataPanelService
*/
export default class DataPanelService extends ControlService {
/**
* 商机服务对象
*
* @type {OpportunityService}
* @memberof DataPanelService
*/
public appEntityService: OpportunityService = new OpportunityService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof DataPanelService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of DataPanelService.
*
* @param {*} [opts={}]
* @memberof DataPanelService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new DataPanelModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof DataPanelService
*/
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 DataPanelService
*/
@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 DataPanelService
*/
@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 DataPanelService
*/
@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 DataPanelService
*/
@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 DataPanelService
*/
@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 DataPanelService
*/
@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 DataPanelService
*/
@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 DataPanelService
*/
@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.opportunityid = PrimaryKey;
Data.opportunity = 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.opportunityid = 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 DataPanelService
*/
@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 DataPanelService
*/
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 info-form-mode' ref='datapanel' id='opportunity_datapanel' style="">
<input style="display:none;" />
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="FLEX" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.opportunity.datapanel_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" >
<div style="height: 100%;display: flex;justify-content: space-between;">
<div v-show="detailsModel.estimatedclosedate.visible" :style="{}">
<app-form-item name='estimatedclosedate' :itemRules="this.rules.estimatedclosedate" class='datapanel-style' labelStyle="datapanel-label-style" :caption="$t('entities.opportunity.datapanel_form.details.estimatedclosedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.estimatedclosedate.error" :isEmptyCaption="false" labelPos="BOTTOM">
<app-span name='estimatedclosedate' :value="data.estimatedclosedate" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</div>
<div v-show="detailsModel.estimatedvalue.visible" :style="{}">
<app-form-item name='estimatedvalue' :itemRules="this.rules.estimatedvalue" class='datapanel-style' labelStyle="datapanel-label-style" :caption="$t('entities.opportunity.datapanel_form.details.estimatedvalue')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.estimatedvalue.error" :isEmptyCaption="false" labelPos="BOTTOM">
<app-span name='estimatedvalue' :value="data.estimatedvalue" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</div>
<div v-show="detailsModel.statecode.visible" :style="{}">
<app-form-item name='statecode' :itemRules="this.rules.statecode" class='datapanel-style' labelStyle="datapanel-label-style" :caption="$t('entities.opportunity.datapanel_form.details.statecode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.statecode.error" :isEmptyCaption="false" labelPos="BOTTOM">
<app-span name='statecode' :value="data.statecode" tag='Opportunity__StateCode' codelistType='STATIC' :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</div>
<div v-show="detailsModel.owneridyominame.visible" :style="{}">
<app-form-item name='owneridyominame' :itemRules="this.rules.owneridyominame" class='datapanel-style' labelStyle="datapanel-label-style" :caption="$t('entities.opportunity.datapanel_form.details.owneridyominame')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.owneridyominame.error" :isEmptyCaption="false" labelPos="BOTTOM">
<app-span name='owneridyominame' :value="data.owneridyominame" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</div>
<div v-show="detailsModel.grouppanel1.visible" :style="{}">
<app-form-group layoutType="FLEX" titleStyle="" class=' vertical-align' :uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.opportunity.datapanel_form.details.grouppanel1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" >
<div style="height: 100%;display: flex;">
<div v-show="detailsModel.button1.visible" :style="{}">
<i-button type="primary" @click="button1_click($event)" class="form-btn-noborder-transparent"
style="">
<i class="fa fa-angle-down" style="margin-right: 2px;"></i>
<span >{{$t('entities.opportunity.datapanel_form.details.button1')}}</span>
</i-button>
</div>
</div>
</app-form-group>
</div>
</div>
</app-form-group>
</i-col>
</row>
</i-form>
\ No newline at end of file
.vertical-align {
vertical-align:middle
}
.datapanel-style {
color:rgba(209, 196, 233, 1);font-size:20px;font-weight:bold;margin:0px 10px 0px 0px;text-align:left
}
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.datapanel-label-style {
color:rgba(245, 244, 244, 1);font-size:12px;margin:0px 0px 0px 0px
}
<template src="./data-panel-form.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { DataPanelEditFormBase } from './data-panel-form-base';
/**
* datapanel部件
*
* @export
* @class DataPanelEditForm
* @extends {DataPanelEditFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class DataPanelEditForm extends DataPanelEditFormBase { }
</script>
<style lang='less'>
@import './data-panel-form.less';
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册