From aef8eb1a38ce158a9244d02f5b1597c8a1582e88 Mon Sep 17 00:00:00 2001 From: jianglinjun Date: Thu, 15 Aug 2024 11:38:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=A7=E5=B1=8F=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E9=83=A8=E4=BB=B6=E6=94=AF=E6=8C=81=E8=83=8C?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/screen-dashboard/screen-dashboard.tsx | 22 ++++------------------ src/screen-portlet/screen-portlet.scss | 12 ++++++++++++ src/screen-portlet/screen-portlet.tsx | 19 +++++++++++++++++-- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/screen-dashboard/screen-dashboard.tsx b/src/screen-dashboard/screen-dashboard.tsx index 12c8aa3..cb8949b 100644 --- a/src/screen-dashboard/screen-dashboard.tsx +++ b/src/screen-dashboard/screen-dashboard.tsx @@ -1,5 +1,5 @@ import { useControlController, useNamespace } from '@ibiz-template/vue3-util'; -import { h, resolveComponent, defineComponent, PropType, computed } from 'vue'; +import { h, resolveComponent, defineComponent, PropType } from 'vue'; import { IDashboard } from '@ibiz/model-core'; import { DashboardController, IControlProvider } from '@ibiz-template/runtime'; import './screen-dashboard.scss'; @@ -15,23 +15,14 @@ export const ScreenDashboard = defineComponent({ params: { type: Object as PropType, default: () => ({}) }, provider: { type: Object as PropType }, }, - setup() { + setup(props) { const c = useControlController( (...args) => new DashboardController(...args), ); const ns = useNamespace(`screen-dashboard`); - - const bgurl = computed(() => { - let url = ''; - if (c.controlParams) { - url = c.controlParams.bgurl || ''; - } - return url; - }); - + console.log(888, props.modelData); return { ns, - bgurl, }; }, @@ -43,11 +34,6 @@ export const ScreenDashboard = defineComponent({ params: this.params, provider: this.provider, }); - return ( -
- {content} - {this.bgurl && } -
- ); + return
{content}
; }, }); diff --git a/src/screen-portlet/screen-portlet.scss b/src/screen-portlet/screen-portlet.scss index ba8d63c..45b83cd 100644 --- a/src/screen-portlet/screen-portlet.scss +++ b/src/screen-portlet/screen-portlet.scss @@ -1,3 +1,4 @@ +/* stylelint-disable selector-class-pattern */ @include b(screen-portlet) { width: 100%; height: 100%; @@ -25,6 +26,17 @@ height: 100%; } } + @include when('hide-caption-icon'){ + .ibiz-portlet-layout-header{ + background:transparent; + } + + .ibiz-portlet-layout__caption{ + img{ + display: none; + } + } + } } @include b('custom-border') { diff --git a/src/screen-portlet/screen-portlet.tsx b/src/screen-portlet/screen-portlet.tsx index 5028f5b..8e9da01 100644 --- a/src/screen-portlet/screen-portlet.tsx +++ b/src/screen-portlet/screen-portlet.tsx @@ -1,5 +1,5 @@ import { useNamespace } from '@ibiz-template/vue3-util'; -import { defineComponent, h, PropType, resolveComponent } from 'vue'; +import { defineComponent, h, PropType, ref, Ref, resolveComponent } from 'vue'; import { IDBPortletPart } from '@ibiz/model-core'; import { PortletPartController } from '@ibiz-template/runtime'; import { ScreenPortletController } from './screen-portlet.controller'; @@ -38,7 +38,17 @@ export const ScreenPortlet = defineComponent({ props.controller.parent, ); - return { c, ns }; + const style: Ref = ref({}); + + if (props.modelData.sysImage && props.modelData.sysImage.rawContent) { + Object.assign(style.value, { + 'background-image': `url(${props.modelData.sysImage.rawContent})`, + 'background-repeat': 'no-repeat', + 'background-size': '100% 100%', + }); + } + + return { c, ns, style }; }, render() { @@ -73,8 +83,13 @@ export const ScreenPortlet = defineComponent({ is={this.c.borderStyle} class={[ this.ns.b(), + this.ns.is( + 'hide-caption-icon', + this.controller.model.portletType === 'CONTAINER', + ), this.ns.is('full-icon', this.c.iconType === 'full'), ]} + style={this.style} > {content} -- Gitee