提交 23eaaec8 编写于 作者: LUCIFER-ZHU's avatar LUCIFER-ZHU

update: 应用看板视图

上级 594230ba
{{#eq ctrl.psLayout.layout "FLEX"}}
<div class="app-dashboard-layout-flex" style="{{#if ctrl.psLayout.dir}}flex-direction: {{ctrl.psLayout.dir}};{{/if}}{{#if ctrl.psLayout.align}}justify-content: {{ctrl.psLayout.align}};{{/if}}{{#if ctrl.psLayout.vAlign}}align-items: {{ctrl.psLayout.vAlign}};{{/if}}">
{{#each ctrl.psControls as | portlet | }}
<div style="flex-grow: {{#if portlet.psLayoutPos.grow}}{{portlet.psLayoutPos.grow}}{{else}}0{{/if}};">
{{>(lookup 'CONTAINER') portlet=portlet}}
</div>
{{/each}}
</div>
{{else}}
<a-row class="app-dashboard-layout-table">
{{#each ctrl.PSControls as | portlet | }}
{{#each ctrl.psControls as | portlet | }}
<a-col
{{> @macro/front-end/widgets/common/layout-pos.hbs item=portlet.psLayoutPos}} >
{{#eq portlet.portletType 'CONTAINER'}}
{{#if portlet.PSControls}}
<div class="portlet-card" :bordered="false" dis-hover :padding="0">
{{else}}
<div class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
{{/if}}
{{#if (and portlet.showTitleBar portlet.title)}}
<div class="portlet-card-title">\{{portlet.title}}</div>
{{/if}}
</div>
{{/if}}
</div>
{{/eq}}
{{>(lookup 'CONTAINER') portlet=portlet}}
</a-col>
{{/each}}
</a-row>
......
{{#*inline "PORTLET"}}{{>@macro/front-end/widgets/dashboard-detail/portlet.hbs}}{{/inline}}
\ No newline at end of file
{{#*inline "DASHBOARD"}}{{>@macro/front-end/widgets/dashboard-detail/dashboard.hbs}}{{/inline}}
{{#*inline "CONTAINER"}}{{>@macro/front-end/widgets/dashboard-detail/portlet-container.hbs}}{{/inline}}
\ No newline at end of file
{{#eq portlet.portletType 'CONTAINER'}}
{{#if portlet.psControls}}
<div class="portlet-card" :bordered="false" dis-hover :padding="0">
{{else}}
<div class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
{{/if}}
{{#if (and portlet.showTitleBar portlet.title)}}
<div class="portlet-card-title">{{portlet.title}}</div>
{{/if}}
<div class="portlet-container">
{{>(lookup 'DASHBOARD') ctrl=portlet}}
</div>
</div>
{{else}}
<{{codeName}}Portlet
ref="portlet"
name="{{portlet.name}}"
:context="state.context"
:viewParams="state.viewParams"
:viewSubject="state.viewSubject"
@ctrlEvent="onCtrlEvent"
></{{codeName}}Portlet>
{{/eq}}
\ No newline at end of file
......@@ -13,7 +13,6 @@ onMounted(()=>{
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
height: 100%;
width: 100%;
......
......@@ -38,8 +38,8 @@ const routes = [
{{/if}}
{{/each}}
{{#each app.allPSAppViews as | appView |}}
{{!-- 临时只支持首页视图 --}}
{{#if (eq appView.getViewType 'APPINDEXVIEW')}}
{{!-- 临时只支持首页视图、应用看板视图 --}}
{{#if (or(eq appView.getViewType 'APPINDEXVIEW') (eq appView.viewType 'APPPORTALVIEW'))}}
{{#unless (or appView.psAppDataEntity appView.defaultPage)}}
{
path: "views/{{lowerCase appView.codeName}}",
......
......@@ -51,7 +51,6 @@ const { state } = new PortalView(viewState, props, emit).moduleInstall();
name="{{name}}"
:context="state.context"
:viewParams="state.viewParams"
:controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject"
@ctrlEvent="onCtrlEvent"
></{{codeName}}Dashboard>
......
{{>@macro/front-end/widgets/dashboard-detail/include-dashboard.hbs}}
<script setup lang="ts">
import { Subject } from 'rxjs';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-dashboard-state';
import { DashboardControl, IActionParam, IParam, IContext } from '@core';
{{#each ctrl.psControls as | control |}}
{{#neq portletType "CONTAINER"}}
{{#eq control.portletType "CONTAINER"}}
{{#each control.psControls as | control2 |}}
{{#if control2.psAppDataEntity}}
import { {{codeName}}Portlet } from '@widgets/{{spinalCase control2.psAppDataEntity.codeName}}/{{spinalCase codeName}}-portlet';
{{else}}
import { {{codeName}}Portlet } from '@widgets/app/{{spinalCase codeName}}-portlet';
{{/if}}
{{/each}}
{{/eq}}
{{#neq control.portletType "CONTAINER"}}
{{#if control.psAppDataEntity}}
import { {{codeName}}Portlet } from '@widgets/{{spinalCase control.psAppDataEntity.codeName}}/{{spinalCase codeName}}-portlet';
{{else}}
......@@ -38,62 +49,9 @@ defineExpose({ state, name: '{{ctrl.name}}' });
</script>
<template>
<div class="app-dashboard{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
{{#if (eq ctrl.enableCustomized false)}}
{{#eq ctrl.psLayout.layout "FLEX"}}
<div class="app-dashboard-layout-flex" style="{{#if ctrl.psLayout.dir}}flex-direction: {{ctrl.psLayout.dir}};{{/if}}{{#if ctrl.psLayout.align}}justify-content: {{ctrl.psLayout.align}};{{/if}}{{#if ctrl.psLayout.vAlign}}align-items: {{ctrl.psLayout.vAlign}};{{/if}}">
</div>
{{else}}
<a-row class="app-dashboard-layout-table">
{{#each ctrl.psPortlets as | portlet | }}
<a-col
{{> @macro/front-end/widgets/common/layout-pos.hbs item=portlet.psLayoutPos}} >
{{#eq portlet.portletType 'CONTAINER'}}
{{#if portlet.psPortlets}}
<div class="portlet-card" :bordered="false" dis-hover :padding="0">
{{else}}
<div class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
{{/if}}
{{#if (and portlet.showTitleBar portlet.title)}}
<div class="portlet-card-title">{{portlet.title}}</div>
{{/if}}
{{#each portlet.psPortlets as | item | }}
{{#eq item.psLayout.layout "FLEX"}}
<div class="app-dashboard-layout-flex" style="{{#if item.psLayout.dir}}flex-direction: {{item.psLayout.dir}};{{/if}}{{#if item.psLayout.align}}justify-content: {{item.psLayout.align}};{{/if}}{{#if item.psLayout.vAlign}}align-items: {{item.psLayout.vAlign}};{{/if}}">
</div>
{{else}}
<a-row class="app-dashboard-layout-table">
<a-col
{{> @macro/front-end/widgets/common/layout-pos.hbs item=item.psLayoutPos}} >
<{{codeName}}Portlet
ref="portlet"
name="{{item.name}}"
:context="state.context"
:viewParams="state.viewParams"
:viewSubject="state.viewSubject"
@ctrlEvent="onCtrlEvent"
></{{codeName}}Portlet>
</a-col>
</a-row>
{{/eq}}
{{/each}}
</div>
{{else}}
<{{codeName}}Portlet
ref="portlet"
name="{{name}}"
:context="state.context"
:viewParams="state.viewParams"
:viewSubject="state.viewSubject"
@ctrlEvent="onCtrlEvent"
></{{codeName}}Portlet>
{{/eq}}
</a-col>
{{/each}}
</a-row>
{{/eq}}
{{/if}}
<template v-if="!state.isEnableCustomized">
{{>(lookup 'DASHBOARD') ctrl=ctrl}}
</template>
</div>
</template>
<style lang="scss">
......
......@@ -2,4 +2,15 @@
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
title: '{{ctrl.title}}',
portletType: '{{ctrl.portletType}}',
{{#if ctrl.psSysImage}}
{{#if ctrl.psSysImage.cssClass}}
iconcls: '{{ctrl.psSysImage.cssClass}}',
{{else if (ctrl.psSysImage.imagePath)}}
imagePath: '{{ctrl.psSysImage.imagePath}}',
{{/if}}
{{/if}}
};
\ No newline at end of file
......@@ -3,6 +3,10 @@ import { Subject } from 'rxjs';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-portlet-state';
import { PortletControl, IActionParam, IParam, IContext } from '@core';
{{#if ctrl.portletPSAppView}}
import {{ctrl.portletPSAppView.codeName}} from '@views/{{spinalCase ctrl.portletPSAppView.psAppModule.codeName}}/{{spinalCase ctrl.portletPSAppView.codeName}}';
{{/if}}
interface Props {
name:string,
context: IContext;
......@@ -22,13 +26,40 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state } = new PortletControl(ctrlState, props, emit).moduleInstall();
const { state, onViewEvent } = new PortletControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
</script>
<template>
<div>portlet</div>
<div class="app-portlet{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}" >
<template v-if="state.showTitleBar && state.title">
<p class='portlet-title'>
<span>
<i v-if="state.iconcls" :class="state.iconcls" />
<img v-if="state.imagePath" :src="state.imagePath" />
\{{state.title}}
</span>
</p>
</template>
<div :class="{'portlet-with-title': state.showTitleBar, 'portlet-without-title': !state.showTitleBar}">
{{#if (eq ctrl.portletType 'VIEW') }}
<{{ctrl.portletPSAppView.codeName}}
:context="state.context"
:viewParams="state.viewParams"
:viewSubject="state.viewSubject"
@viewEvent="onViewEvent"
/>
{{else if (eq ctrl.portletType 'APPMENU')}}
{{else if (eq ctrl.portletType 'CUSTOM')}}
{{else if (eq ctrl.portletType 'ACTIONBAR')}}
{{else if (eq ctrl.portletType 'TOOLBAR')}}
{{else if (eq ctrl.portletType 'HTML')}}
{{else if (eq ctrl.portletType 'RAWITEM')}}
{{else}}
{{/if}}
</div>
</div>
</template>
<style lang="scss">
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册