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

update:更新

上级 834903ef
......@@ -62,12 +62,11 @@ export class PortletControl extends MainControl {
}
/**
* 触发界面行为
* 操作栏触发界面行为
*
* @memberof PortletControl
*/
public handleItemClick(actionParam: any): void {
console.log('视图逻辑', actionParam);
const { data: uIAction} = actionParam;
if (!uIAction) {
console.warn("执行参数不足");
......@@ -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 安装部件所有功能模块的方法
* @return {*}
......@@ -99,6 +121,7 @@ export class PortletControl extends MainControl {
onViewEvent: this.onViewEvent.bind(this),
onCtrlEvent: this.onCtrlEvent.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
......@@ -4,3 +4,4 @@
@use './app-tree-exp-bar.scss';
@use './app-tab-exp-panel.scss';
@use './app-tab-view-panel.scss';
@use './app-portlet.scss';
\ No newline at end of file
......@@ -12,6 +12,14 @@ export const ctrlState = {
imagePath: '{{ctrl.psSysImage.imagePath}}',
{{/if}}
{{/if}}
{{#if ctrl.psLayoutPos.height}}
// 部件高度
height: {{ctrl.psLayoutPos.height}},
{{/if}}
{{#if ctrl.psLayoutPos.width}}
// 部件宽度
width: {{ctrl.psLayoutPos.width}},
{{/if}}
{{#if ctrl.psAppDataEntity}}
// 实体名称
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
......@@ -22,8 +30,10 @@ export const ctrlState = {
{{#each ctrl.psUIActionGroup.psUIActionGroupDetails as | groupDetail |}}
{{groupDetail.psUIAction.uIActionTag}} : {
viewlogicname: '{{groupDetail.name}}',
showCaption:{{groupDetail.showCaption}},
actionName: '{{groupDetail.psUIAction.caption}}',
icon: '{{groupDetail.psUIAction.psSysImage.cssClass}}',
imagePath: '{{groupDetail.psUIAction.psSysImage.imagePath}}',
disabled: false, visabled: true,
dataAccessAction: {{#if groupDetail.psUIAction.dataAccessAction}}false{{else}}true{{/if}},
getNoPrivDisplayMode: {{#if groupDetail.psUIAction.noPrivDisplayMode}}groupDetail.psUIAction.noPrivDisplayMode{{else}}6{{/if}},
......@@ -36,4 +46,16 @@ export const ctrlState = {
{{/each}}
},
{{/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 {
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 });
......@@ -53,6 +53,20 @@ defineExpose({ name, state });
<img v-if="state.imagePath" :src="state.imagePath" />
\{{state.title}}
</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>
</template>
<div :class="{'portlet-with-title': state.showTitleBar, 'portlet-without-title': !state.showTitleBar}">
......@@ -86,8 +100,18 @@ defineExpose({ name, state });
@itemClick="handleItemClick"
></app-action-bar>
{{else if (eq ctrl.portletType 'TOOLBAR')}}
<div>暂未支持工具栏绘制</div>
{{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')}}
<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}}
{{/if}}
</div>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册