diff --git a/src/screen-dashboard/screen-dashboard.tsx b/src/screen-dashboard/screen-dashboard.tsx index 12c8aa34e0909045e0ac929cd88311d91c5fb68a..cb8949b8650709af172d71978294731df985c9a9 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 ba8d63c5fc1a9ad4efd158c53e10f99bf84af5a6..45b83cd14fa14901c7b1cb48634bde3124f84a01 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 5028f5bcf5d32ecc3c61b39e9614d6b9ae9519a7..8e9da01e228c65ba6d63b0fbfc068ec4e47a8cfe 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}