提交 41e90bc5 编写于 作者: LUCIFER-ZHU's avatar LUCIFER-ZHU

update:更新

上级 834903ef
...@@ -62,12 +62,11 @@ export class PortletControl extends MainControl { ...@@ -62,12 +62,11 @@ export class PortletControl extends MainControl {
} }
/** /**
* 触发界面行为 * 操作栏触发界面行为
* *
* @memberof PortletControl * @memberof PortletControl
*/ */
public handleItemClick(actionParam: any): void { public handleItemClick(actionParam: any): void {
console.log('视图逻辑', actionParam);
const { data: uIAction} = actionParam; const { data: uIAction} = actionParam;
if (!uIAction) { if (!uIAction) {
console.warn("执行参数不足"); console.warn("执行参数不足");
...@@ -86,6 +85,29 @@ export class PortletControl extends MainControl { ...@@ -86,6 +85,29 @@ export class PortletControl extends MainControl {
} }
/**
* 界面行为组触发界面行为
*
* @memberof PortletControl
*/
public handleActionClick(item:any,event:any):void {
const uIAction = item ;
if (!uIAction) {
console.warn("执行参数不足");
return;
}
// 准备参数
const inputParam = {
context: this.state.context,
viewParams: this.state.viewParams,
data: [],
event: event,
actionEnvironment: this
};
// 执行行为
App.getAppActionService().execute(uIAction, inputParam);
}
/** /**
* @description 安装部件所有功能模块的方法 * @description 安装部件所有功能模块的方法
* @return {*} * @return {*}
...@@ -99,6 +121,7 @@ export class PortletControl extends MainControl { ...@@ -99,6 +121,7 @@ export class PortletControl extends MainControl {
onViewEvent: this.onViewEvent.bind(this), onViewEvent: this.onViewEvent.bind(this),
onCtrlEvent: this.onCtrlEvent.bind(this), onCtrlEvent: this.onCtrlEvent.bind(this),
handleItemClick: this.handleItemClick.bind(this), handleItemClick: this.handleItemClick.bind(this),
handleActionClick: this.handleActionClick.bind(this),
}; };
} }
} }
\ No newline at end of file
.app-portlet{
.portlet-title{
display: flex;
justify-content: space-between;
a{
margin-right: 10px;
}
}
}
\ No newline at end of file
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
@use './app-menu.scss'; @use './app-menu.scss';
@use './app-tree-exp-bar.scss'; @use './app-tree-exp-bar.scss';
@use './app-tab-exp-panel.scss'; @use './app-tab-exp-panel.scss';
@use './app-tab-view-panel.scss'; @use './app-tab-view-panel.scss';
\ No newline at end of file @use './app-portlet.scss';
\ No newline at end of file
...@@ -12,6 +12,14 @@ export const ctrlState = { ...@@ -12,6 +12,14 @@ export const ctrlState = {
imagePath: '{{ctrl.psSysImage.imagePath}}', imagePath: '{{ctrl.psSysImage.imagePath}}',
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if ctrl.psLayoutPos.height}}
// 部件高度
height: {{ctrl.psLayoutPos.height}},
{{/if}}
{{#if ctrl.psLayoutPos.width}}
// 部件宽度
width: {{ctrl.psLayoutPos.width}},
{{/if}}
{{#if ctrl.psAppDataEntity}} {{#if ctrl.psAppDataEntity}}
// 实体名称 // 实体名称
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}', appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
...@@ -21,9 +29,11 @@ export const ctrlState = { ...@@ -21,9 +29,11 @@ export const ctrlState = {
actionBarModelData: { actionBarModelData: {
{{#each ctrl.psUIActionGroup.psUIActionGroupDetails as | groupDetail |}} {{#each ctrl.psUIActionGroup.psUIActionGroupDetails as | groupDetail |}}
{{groupDetail.psUIAction.uIActionTag}} : { {{groupDetail.psUIAction.uIActionTag}} : {
viewlogicname: '{{groupDetail.name}}', viewlogicname: '{{groupDetail.name}}',
showCaption:{{groupDetail.showCaption}},
actionName: '{{groupDetail.psUIAction.caption}}', actionName: '{{groupDetail.psUIAction.caption}}',
icon: '{{groupDetail.psUIAction.psSysImage.cssClass}}', icon: '{{groupDetail.psUIAction.psSysImage.cssClass}}',
imagePath: '{{groupDetail.psUIAction.psSysImage.imagePath}}',
disabled: false, visabled: true, disabled: false, visabled: true,
dataAccessAction: {{#if groupDetail.psUIAction.dataAccessAction}}false{{else}}true{{/if}}, dataAccessAction: {{#if groupDetail.psUIAction.dataAccessAction}}false{{else}}true{{/if}},
getNoPrivDisplayMode: {{#if groupDetail.psUIAction.noPrivDisplayMode}}groupDetail.psUIAction.noPrivDisplayMode{{else}}6{{/if}}, getNoPrivDisplayMode: {{#if groupDetail.psUIAction.noPrivDisplayMode}}groupDetail.psUIAction.noPrivDisplayMode{{else}}6{{/if}},
...@@ -36,4 +46,16 @@ export const ctrlState = { ...@@ -36,4 +46,16 @@ export const ctrlState = {
{{/each}} {{/each}}
}, },
{{/if}} {{/if}}
{{#if ctrl.pageUrl}}
// 网页地址
pageUrl: '{{ctrl.pageUrl}}',
{{/if}}
{{#if ctrl.contentType}}
// 内容类型
contentType:'{{ctrl.contentType}}',
{{/if}}
{{#if ctrl.rawContent}}
// 直接内容
rawContent:'{{ctrl.rawContent}}',
{{/if}}
}; };
\ No newline at end of file
...@@ -39,7 +39,7 @@ interface CtrlEmit { ...@@ -39,7 +39,7 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> (); const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法 // 安装功能模块,提供状态和能力方法
const { name, state, onViewEvent, onCtrlEvent, handleItemClick } = new PortletControl(ctrlState, props, emit).moduleInstall(); const { name, state, onViewEvent, onCtrlEvent, handleItemClick, handleActionClick } = new PortletControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力 // 暴露内部状态及能力
defineExpose({ name, state }); defineExpose({ name, state });
...@@ -53,6 +53,20 @@ defineExpose({ name, state }); ...@@ -53,6 +53,20 @@ defineExpose({ name, state });
<img v-if="state.imagePath" :src="state.imagePath" /> <img v-if="state.imagePath" :src="state.imagePath" />
\{{state.title}} \{{state.title}}
</span> </span>
<span class="portlet-action" v-if="state.actionBarModelData && state.portletType !== 'ACTIONBAR'">
<template v-for="(item,index) in Object.values(state.actionBarModelData)" :key="index">
<a-tooltip>
<template #title>
\{{item.actionName}}
</template>
<a @click="handleActionClick(item,$event)">
<i v-if="item.icon" :class="item.icon" />
<img v-if="item.imagePath" :src="item.imagePath"/>
\{{item.actionName}}
</a>
</a-tooltip>
</template>
</span>
</div> </div>
</template> </template>
<div :class="{'portlet-with-title': state.showTitleBar, 'portlet-without-title': !state.showTitleBar}"> <div :class="{'portlet-with-title': state.showTitleBar, 'portlet-without-title': !state.showTitleBar}">
...@@ -80,14 +94,24 @@ defineExpose({ name, state }); ...@@ -80,14 +94,24 @@ defineExpose({ name, state });
<div>暂未支持自定义绘制</div> <div>暂未支持自定义绘制</div>
{{else if (eq ctrl.portletType 'ACTIONBAR')}} {{else if (eq ctrl.portletType 'ACTIONBAR')}}
<app-action-bar <app-action-bar
:viewSubject="state.viewSubject" :viewSubject="state.viewSubject"
:uiService="state.UIService" :uiService="state.UIService"
:items="state.actionBarModelData" :items="state.actionBarModelData"
@itemClick="handleItemClick" @itemClick="handleItemClick"
></app-action-bar> ></app-action-bar>
{{else if (eq ctrl.portletType 'TOOLBAR')}} {{else if (eq ctrl.portletType 'TOOLBAR')}}
<div>暂未支持工具栏绘制</div>
{{else if (eq ctrl.portletType 'HTML')}} {{else if (eq ctrl.portletType 'HTML')}}
<iframe :src="state.pageUrl" :style="{height: state.height && state.height > 0 ? state.height + 'px' : '400px', width: '100%', borderWidth: '0px'}"></iframe>
{{else if (eq ctrl.portletType 'RAWITEM')}} {{else if (eq ctrl.portletType 'RAWITEM')}}
<app-raw
:name="state.controlName"
:contentType="state.contentType"
:iconClass="state.iconcls"
:imgPath="state.imagePath"
style="{{#if ctrl.rawItemHeight}}height: {{ctrl.rawItemHeight}}px;{{/if}}{{#if ctrl.rawItemWidth}}width: {{ctrl.rawItemWidth}}px{{/if}}"
{{#if (eq ctrl.contentType 'RAW')}}value="{{ctrl.rawContent}}"{{else if (eq ctrl.contentType 'HTML')}}:value="`{{ctrl.htmlContent}}`"{{/if}}
></app-raw>>
{{else}} {{else}}
{{/if}} {{/if}}
</div> </div>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册