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

chitanda 发布系统代码

上级 ae3a8aa7
import ViewEngine from '../view/view-engine';
import { events } from '@/studio-core/global/events';
import { events, ctrl } from '@/studio-core/global';
/**
* 快速摘要栏引擎
......@@ -69,6 +69,11 @@ export default class DataPanelEngine extends ViewEngine {
this.setData();
});
}
if (this.form) {
this.form.$on(events.ctrl.LOAD, () => {
this.setData();
});
}
}
/**
......@@ -78,10 +83,18 @@ export default class DataPanelEngine extends ViewEngine {
*/
public setData(): void {
const data = this.view.$appService.contextStore.getContextData(this.context, this.view.appDeName);
if (this.dataPanel && Object.is(this.dataPanel.controlType, 'FORM')) {
if (data && data.data) {
this.dataPanel.fillForm(data.data);
if (this.dataPanel) {
if (Object.is(this.dataPanel.controlType, ctrl.type.Form)) {
if (data && data.data) {
this.dataPanel.fillForm(data.data);
}
} else if (Object.is(this.dataPanel.controlType, ctrl.type.Panel)) {
if (data && data.data) {
this.dataPanel.data = data.data;
this.dataPanel.$forceUpdate();
}
}
}
}
......
......@@ -400,8 +400,30 @@ export default {
uiactions: {
},
},
edit_introduction_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
industrycode: "行业",
sic: "行业编码",
ownershipcode: "所有权",
description: "说明",
accountid: "客户",
},
uiactions: {
},
},
datapanel_form: {
details: {
button1: "编辑",
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
......@@ -421,6 +443,7 @@ export default {
accountid: "客户",
},
uiactions: {
account_edit_introduction: "编辑",
},
},
main_form: {
......@@ -520,27 +543,6 @@ export default {
uiactions: {
},
},
edit_introduction_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
industrycode: "行业",
sic: "行业编码",
ownershipcode: "所有权",
description: "说明",
accountid: "客户",
},
uiactions: {
},
},
info_address_form: {
details: {
group1: "客户基本信息",
......
......@@ -399,8 +399,30 @@ export default {
uiactions: {
},
},
edit_introduction_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
industrycode: "行业",
sic: "行业编码",
ownershipcode: "所有权",
description: "说明",
accountid: "客户",
},
uiactions: {
},
},
datapanel_form: {
details: {
button1: "编辑",
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
......@@ -420,6 +442,7 @@ export default {
accountid: "客户",
},
uiactions: {
account_edit_introduction: "编辑",
},
},
main_form: {
......@@ -519,27 +542,6 @@ export default {
uiactions: {
},
},
edit_introduction_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
industrycode: "行业",
sic: "行业编码",
ownershipcode: "所有权",
description: "说明",
accountid: "客户",
},
uiactions: {
},
},
info_address_form: {
details: {
group1: "客户基本信息",
......
......@@ -5899,6 +5899,20 @@ const router = new Router({
},
component: () => import('@pages/base/uom-pickup-view/uom-pickup-view.vue'),
},
{
path: 'accounts/:account?/edit_introduction/:edit_introduction?',
meta: {
caption: 'entities.account.views.edit_introduction.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'edit_introduction', parameterName: 'edit_introduction' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-edit-introduction/account-edit-introduction.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/summaryview/:summaryview?',
meta: {
......
......@@ -489,6 +489,7 @@ export const viewstate: any = {
'5f8f689d5dccc3db6d2b74a24a8b24ef',
'7b8b062c86b8e62d907ccbd467bb7ac6',
'bae77557d2f7a7852b634dc5d5a93435',
'90cb61421b72cbc76f75360deffde218',
'016e75bb460270519a0ee9dda57b2c90',
],
},
......
/**
* 视图事件
*/
const viewEvent = {
// 模型加载
MODEL_LOADED: 'ModelLoaded'
};
/**
* 部件事件
*/
const ctrlEvent = {
// 部件加载
LOAD: 'load'
};
/**
* 导出事件
*/
export const events = { view: viewEvent, ctrl: ctrlEvent };
/**
* 部件类型
*/
const ctrlType = {
//上下文菜单
ContextMenu: 'CONTEXTMENU',
//分页导航面板
TabExpPanel: 'TABEXPPANEL',
// 列表
List: 'LIST',
// 列表视图导航栏
ListExpBar: 'LISTEXPBAR',
// 单视图面板
ViewPanel: '列表视图导航栏',
// 卡片视图导航栏
DataViewExpBar: 'DATAVIEWEXPBAR',
// 向导面板
WizardPanel: 'WIZARDPANEL',
// 图表视图导航栏
ChartExpBar: 'CHARTEXPBAR',
// 地图视图导航栏
MapExpBar: 'MAPEXPBAR',
// 地图部件
Map: 'MAP',
// 多编辑视图面板
MultiEditViewPanel: 'MULTIEDITVIEWPANEL',
// 导航栏
ExpBar: '导航栏',
// 工具栏
Toolbar: 'TOOLBAR',
// 应用菜单
AppMenu: 'APPMENU',
// 报表面板
RePortPanel: 'REPORTPANEL',
// 搜索栏
SearchBar: 'SEARCHBAR',
// 搜索表单
SearchForm: 'SEARCHFORM',
// 数据关系分页部件
DrTab: 'DRTAB',
// 数据关系栏
DrBar: 'DRBAR',
// 数据图表
Chart: 'CHART',
// 数据看板
Dashboard: 'DASHBOARD',
// 数据表格
Grid: 'GRID',
// 数据视图
DataView: 'DATAVIEW',
// 日历视图导航栏
CalendarExpBar: 'CALENDAREXPBAR',
// 日历部件
Calendar: 'CALENDAR',
// 更新面板
UpdatePanel: 'UPDATEPANEL',
// 标题栏
TitleBar: 'TITLEBAR',
// 树表格
TreeGrid: 'TREEGRID',
// 树表格(增强)
TreeGridEx: 'TREEGRIDEX',
// 树视图
TreeView: 'TREEVIEW',
// 树视图导航栏
TreeExpBar: 'TREEEXPBAR',
// 流程导航栏
WfExpBar: 'WFEXPBAR',
// 状态向导面板
StateWizardPanel: 'STATEWIZARDPANEL',
// 甘特视图导航栏
GanttExpBar: 'GANTTEXPBAR',
// 甘特部件
Gantt: 'GANTT',
// 看板
KanBan: 'KANBAN',
// 自定义部件
Custom: 'CUSTOM',
// 表单
Form: 'FORM',
// 表格视图导航栏
GridExpBar: 'GRIDEXPBAR',
// 视图布局面板
ViewLayoutPanel: 'VIEWLAYOUTPANEL',
// 选择视图面板
PickupViewPanel: 'PICKUPVIEWPANEL',
// 门户部件
Portlet: 'PORTLET',
// 面板
Panel: 'PANEL'
};
/**
* 部件类型
*/
export const ctrl = { type: ctrlType };
\ No newline at end of file
......@@ -54,6 +54,7 @@ export { GridControllerBase } from './widgets/GridControllerBase';
export { ListControllerBase } from './widgets/ListControllerBase';
export { EditFormControlBase } from './widgets/EditFormControlBase';
export { MDControlBase } from './widgets/MDControlBase';
export { PanelControlBase } from './widgets/PanelControlBase';
export { SearchFormControlBase } from './widgets/SearchFormControlBase';
export { TabExpPanelControlBase } from './widgets/TabExpPanelControlBase';
// 组件 Start
......
import { ViewBase } from './ViewBase';
import { events } from '../global/events';
import { events } from '../global';
/**
* 导航视图基类
......
import { Prop } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { Subject } from 'rxjs';
import { FormItemModel } from '@/model/form-detail';
import { MainControlBase } from './MainControlBase';
import { events } from '../global';
/**
* 表单部件基类
......@@ -453,7 +454,7 @@ export class FormControlBase extends MainControlBase {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data, 'load');
this.$emit('load', data);
this.$emit(events.ctrl.LOAD, data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......
此差异已折叠。
......@@ -560,6 +560,72 @@ export default class AccountUIServiceBase extends UIService {
backend();
}
/**
* 编辑
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async Account_Edit_Introduction(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { account: '%account%' });
Object.assign(params, { accountid: '%account%' });
Object.assign(params, { accountname: '%accountname%' });
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
Object.assign(context,parentObj);
let deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'accounts', parameterName: 'account' },
];
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = actionContext.$appdrawer.openDrawer(view, context,data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
const _this: any = actionContext;
if (xData && xData.refresh && xData.refresh instanceof Function) {
xData.refresh(args);
}
if(window.opener){
window.opener.postMessage({status:'OK',identification:'WF'},Environment.uniteAddress);
window.close();
}
return result.datas;
});
}
const view: any = {
viewname: 'account-edit-introduction',
height: 0,
width: 450,
title: actionContext.$t('entities.account.views.edit_introduction.title'),
placement: 'DRAWER_RIGHT',
};
openDrawer(view, data);
}
/**
* 获取指定数据的重定向页面
......
......@@ -3,6 +3,7 @@ import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import AccountService from '@/service/account/account-service';
import DataPanelService from './data-panel-form-service';
import AccountUIService from '@/uiservice/account/account-ui-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
......@@ -49,6 +50,34 @@ export class DataPanelEditFormBase extends EditFormControlBase {
*/
protected appDeName: string = 'account';
/**
* 逻辑事件
*
* @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];
}
// 界面行为
const curUIService:AccountUIService = new AccountUIService();
curUIService.Account_Edit_Introduction(datas,contextJO, paramJO, $event, xData,this,"Account");
}
/**
* 表单数据对象
*
......@@ -90,6 +119,8 @@ export class DataPanelEditFormBase extends EditFormControlBase {
* @memberof DataPanelEditFormBase
*/
public detailsModel: any = {
button1: new FormButtonModel({ caption: '编辑', detailType: 'BUTTON', name: 'button1', visible: true, isShowCaption: false, form: this, uiaction: { type: 'DEUIACTION', tag: 'Edit_Introduction', actiontarget: 'SINGLEKEY' } }),
group1: new FormGroupPanelModel({ caption: '客户基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.account.datapanel_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }),
......@@ -125,4 +156,14 @@ export class DataPanelEditFormBase extends EditFormControlBase {
accountid: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'accountid', 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
......@@ -46,6 +46,14 @@
<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.button1.visible" :style="{}">
<i-button type="primary" @click="button1_click($event)"
style="">
<i class="fa fa-angle-down" style="margin-right: 2px;"></i>
</i-button>
</div>
</div>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册