提交 792791c5 编写于 作者: Mosher's avatar Mosher

update:更新表单布局

上级 9aef90da
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
{{/if}} {{/if}}
{{#if (and (eq item.detailType "BUTTON") item.psUIAction)}} {{#if (and (eq item.detailType "BUTTON") item.psUIAction)}}
{{!-- TODO 补充显示图标和文字模式 --}} {{!-- TODO 补充显示图标和文字模式 --}}
uIAction: { caption: '{{item.psUIAction.caption}}', uIActionMode: "{{item.psUIAction.uIActionMode}}", disabled: false, visible: true, uIActionTag: '{{detail.psUIAction.uIActionTag}}', showCaption: {{item.showCaption}}, {{#if item.psUIAction.psSysImage}}{{#if item.psUIAction.psSysImage.imagePath}} imgPath: "{{item.psUIAction.psSysImage.imagePath}}",{{/if}}{{#if item.psUIAction.psSysImage.cssClass}} iconClass: "{{item.psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} }, uIAction: { caption: '{{item.psUIAction.caption}}', uIActionMode: "{{item.psUIAction.uIActionMode}}", disabled: false, visible: true, uIActionTag: '{{item.psUIAction.uIActionTag}}', showCaption: {{item.showCaption}}, {{#if item.psUIAction.psSysImage}}{{#if item.psUIAction.psSysImage.imagePath}} imgPath: "{{item.psUIAction.psSysImage.imagePath}}",{{/if}}{{#if item.psUIAction.psSysImage.cssClass}} iconClass: "{{item.psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/if}} {{/if}}
{{#if (and (eq item.detailType "GROUPPANEL") item.psUIActionGroup)}} {{#if (and (eq item.detailType "GROUPPANEL") item.psUIActionGroup)}}
uIActionGroup: { uIActionGroup: {
......
...@@ -24,4 +24,4 @@ ...@@ -24,4 +24,4 @@
> >
</{{item.psAppView.codeName}}> </{{item.psAppView.codeName}}>
</template> </template>
</AppFormDruipart> </AppFormDruipart>
\ No newline at end of file
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
style="{{#if item.contentHeight}}height: {{item.contentHeight}}px;{{/if}}{{#if item.contentWidth}}width: {{item.contentWidth}}px;{{/if}}" style="{{#if item.contentHeight}}height: {{item.contentHeight}}px;{{/if}}{{#if item.contentWidth}}width: {{item.contentWidth}}px;{{/if}}"
{{/if}} {{/if}}
iFrameUrl="{{item.iFrameUrl}}" iFrameUrl="{{item.iFrameUrl}}"
/> />
\ No newline at end of file
...@@ -31,4 +31,4 @@ ...@@ -31,4 +31,4 @@
</div> </div>
{{/if}} {{/if}}
</AppFormItem> </AppFormItem>
{{/neq}} {{/neq}}
\ No newline at end of file
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
{{#each item.psDEFormDetails as | formDetail |}} {{#each item.psDEFormDetails as | formDetail |}}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type=formDetail.detailType item=formDetail}} {{> @macro/front-end/widgets/form-detail/include-form.hbs type=formDetail.detailType item=formDetail}}
{{/each}} {{/each}}
</AppFormPage> </AppFormPage>
\ No newline at end of file
<AppRaw <AppFormRaw
name="{{item.codeName}}" name="{{item.codeName}}"
:visible="state.detailsModel.{{item.codeName}}.visible" :visible="state.detailsModel.{{item.codeName}}.visible"
{{#if item.psSysCss}} {{#if item.psSysCss}}
class="{{item.psSysCss.cssName}}" class="{{item.psSysCss.cssName}}"
{{/if}} {{/if}}
{{#if item.psSysImage}} {{#if item.psSysImage}}
{{#if item.psSysImage.cssClass}}iconClass="{{item.psSysImage.cssClass}}"{{/if}}{{#if item.psSysImage.imagePath}}imgPath="{{item.psSysImage.imagePath}}"{{/if}} {{#if item.psSysImage.cssClass}}
iconClass="{{item.psSysImage.cssClass}}"
{{/if}}
{{#if item.psSysImage.imagePath}}
imgPath="{{item.psSysImage.imagePath}}"
{{/if}}
{{/if}} {{/if}}
contentType="{{item.contentType}}" {{#if (and item.psLayoutPos (or item.psLayoutPos.width item.psLayoutPos.height))}}
{{#if (or item.rawItemHeight item.rawItemWidth)}} style="{{#if item.psLayoutPos.width}}width: {{item.psLayoutPos.width}}px; {{/if}}{{#if item.psLayoutPos.height}}height: {{item.psLayoutPos.height}}px; {{/if}}"
style="{{#if item.rawItemHeight}}height: {{item.rawItemHeight}}px;{{/if}}{{#if item.rawItemWidth}}width: {{item.rawItemWidth}}px;{{/if}}" {{/if}}
{{#if (or (gt item.rawItemWidth 0) (gt item.rawItemHeight 0))}}
rawStyle="{{#gt item.rawItemWidth 0}}width: {{item.rawItemWidth}}px; {{/gt}}{{#gt item.rawItemHeight 0}}height: {{item.rawItemHeight}}px;{{/gt}}"
{{/if}} {{/if}}
{{#if (eq item.contentType 'RAW')}}value="{{item.rawContent}}"{{else if (eq item.contentType 'HTML')}}:value="`{{item.htmlContent}}`"{{/if}}/> contentType="{{item.contentType}}"
:layoutOpts="{{> @macro/front-end/common/layoutPos.hbs layout=item.psLayout layoutPos=item.psLayoutPos}}"
{{#if (eq item.contentType 'RAW')}}
value="{{item.rawContent}}"
{{else if (eq item.contentType 'HTML')}}
:value="`{{item.htmlContent}}`"
{{/if}}
/>
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
{{#eq type "BUTTON"}}{{> @macro/front-end/widgets/form-detail/form-button.hbs}}{{/eq}} {{#eq type "BUTTON"}}{{> @macro/front-end/widgets/form-detail/form-button.hbs}}{{/eq}}
{{#eq type "IFRAME"}}{{> @macro/front-end/widgets/form-detail/form-iframe.hbs}}{{/eq}} {{#eq type "IFRAME"}}{{> @macro/front-end/widgets/form-detail/form-iframe.hbs}}{{/eq}}
{{#eq type "FORMPART"}}{{> @macro/front-end/widgets/form-detail/form-formpart.hbs}}{{/eq}} {{#eq type "FORMPART"}}{{> @macro/front-end/widgets/form-detail/form-formpart.hbs}}{{/eq}}
{{#eq type "TABPAGE"}}{{> @macro/front-end/widgets/form-detail/form-druipart.hbs}}{{/eq}} {{#eq type "TABPAGE"}}{{> @macro/front-end/widgets/form-detail/form-tabpage.hbs}}{{/eq}}
{{#eq type "DRUIPART"}}{{> @macro/front-end/widgets/form-detail/form-druipart.hbs}}{{/eq}} {{#eq type "DRUIPART"}}{{> @macro/front-end/widgets/form-detail/form-druipart.hbs}}{{/eq}}
{{#eq type "RAWITEM"}}{{> @macro/front-end/widgets/form-detail/form-rawitem.hbs}}{{/eq}}
{{#eq type "FORMDETAILSMODEL"}}{{> @macro/front-end/widgets/form-detail/form-details-model.hbs}}{{/eq}} {{#eq type "FORMDETAILSMODEL"}}{{> @macro/front-end/widgets/form-detail/form-details-model.hbs}}{{/eq}}
{{#eq type "FORMACTIONMODEL"}}{{> @macro/front-end/widgets/form-detail/form-action-model.hbs}}{{/eq}} {{#eq type "FORMACTIONMODEL"}}{{> @macro/front-end/widgets/form-detail/form-action-model.hbs}}{{/eq}}
\ No newline at end of file
...@@ -28,7 +28,9 @@ let slotStyle = computed(() => { ...@@ -28,7 +28,9 @@ let slotStyle = computed(() => {
return '' return ''
} }
let result = ''; let result = '';
result += isObject(attrs.style) ? styleObj2Str(attrs.style) : attrs.style; if (attrs.style) {
result += isObject(attrs.style) ? styleObj2Str(attrs.style) : attrs.style;
}
if (layout?.value?.colStyle) { if (layout?.value?.colStyle) {
result += layout.value.colStyle; result += layout.value.colStyle;
} }
......
...@@ -26,7 +26,7 @@ const emit = defineEmits<FormButtonEmits>(); ...@@ -26,7 +26,7 @@ const emit = defineEmits<FormButtonEmits>();
const click = (event: MouseEvent) => { const click = (event: MouseEvent) => {
const data = deepCopy(props.uIAction); const data = deepCopy(props.uIAction);
Object.assign(data, { event: event }); Object.assign(data, { event: event });
emit('action', { tag: name, action: 'formButtonAction', data: data }); emit('action', { tag: props.name, action: 'formButtonAction', data: data });
} }
</script> </script>
......
...@@ -105,9 +105,13 @@ const handleMenuGroupAction = ($event: IParam) => { ...@@ -105,9 +105,13 @@ const handleMenuGroupAction = ($event: IParam) => {
.app-form-group { .app-form-group {
.ant-card-head { .ant-card-head {
text-align: left; text-align: left;
max-height: 60px;
.app-form-group-title { .app-form-group-title {
margin: 0px; margin: 0px;
} }
} }
.ant-card-body {
height: calc(100% - 60px);
}
} }
</style> </style>
\ No newline at end of file
...@@ -14,8 +14,8 @@ const props = withDefaults(defineProps<FormIframeProps>(), { ...@@ -14,8 +14,8 @@ const props = withDefaults(defineProps<FormIframeProps>(), {
</script> </script>
<template> <template>
<AppCol class="app-formDruipart" :visible="visible" :layoutOpts="layoutOpts" v-show="visible"> <AppCol class="app-form-iframe" :visible="visible" :layoutOpts="layoutOpts" v-show="visible">
<iframe class="app-formDruipart__iframe" :src="iFrameUrl" style="height: 100%;width: 100%;border: 0"></iframe> <iframe class="app-form-iframe__content" :src="iFrameUrl" style="height: 100%;width: 100%;border: 0"></iframe>
</AppCol> </AppCol>
</template> </template>
......
...@@ -12,7 +12,7 @@ const props = withDefaults(defineProps<FormPageProps>(), { ...@@ -12,7 +12,7 @@ const props = withDefaults(defineProps<FormPageProps>(), {
</script> </script>
<template> <template>
<a-tab-pane class="app-formPage" :key="$attrs.key" :tab="tab"> <a-tab-pane class="app-form-page" :key="$attrs.key" :tab="tab">
<AppRow :layoutOpts="layoutOpts"> <AppRow :layoutOpts="layoutOpts">
<slot></slot> <slot></slot>
</AppRow> </AppRow>
......
...@@ -9,6 +9,7 @@ interface FormRawProps{ ...@@ -9,6 +9,7 @@ interface FormRawProps{
imgPath?: string; imgPath?: string;
value?:any; value?:any;
contentType?: string; contentType?: string;
rawStyle?: IParam
} }
const props = withDefaults(defineProps<FormRawProps>(), { const props = withDefaults(defineProps<FormRawProps>(), {
visible: true, visible: true,
...@@ -17,13 +18,15 @@ const props = withDefaults(defineProps<FormRawProps>(), { ...@@ -17,13 +18,15 @@ const props = withDefaults(defineProps<FormRawProps>(), {
</script> </script>
<template> <template>
<AppCol :visible="visible" noRoot :layoutOpts="layoutOpts" class="app-formRaw"> <AppCol :visible="visible" noRoot :layoutOpts="layoutOpts" class="app-form-raw">
<template #default="{slotStyle, slotClass}"> <template #default="{slotStyle, slotClass}">
<AppRaw <AppRaw
:name="name"
:class="slotClass" :class="slotClass"
:style="slotStyle" :style="slotStyle"
:iconClass="iconClass" :iconClass="iconClass"
:value="value" :value="value"
:rawStyle="rawStyle"
:contentType="contentType"> :contentType="contentType">
</AppRaw> </AppRaw>
</template> </template>
......
...@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<FormTabPageProps>(), { ...@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<FormTabPageProps>(), {
</script> </script>
<template> <template>
<a-tab-pane class="app-formTabPage" v-show="visible" :tab="caption"> <a-tab-pane class="app-form-tabpage" v-show="visible" :tab="caption">
<AppRow :layoutOpts="layoutOpts"> <AppRow :layoutOpts="layoutOpts">
<slot></slot> <slot></slot>
</AppRow> </AppRow>
......
...@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<FormTabPanelProps>(), { ...@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<FormTabPanelProps>(), {
</script> </script>
<template> <template>
<AppCol :visible="visible" noRoot :layoutOpts="layoutOpts" class="app-formTabPanel"> <AppCol :visible="visible" noRoot :layoutOpts="layoutOpts" class="app-form-tabpanel">
<template v-slot:default="{ slotStyle, slotClass }"> <template v-slot:default="{ slotStyle, slotClass }">
<a-tabs :class="slotClass" :style="slotStyle"> <a-tabs :class="slotClass" :style="slotStyle">
<slot></slot> <slot></slot>
......
<script setup lang="ts"> <script setup lang="ts">
import { IActionParam } from "@core"; import { IActionParam, IParam } from "@core";
interface RawProps { interface RawProps {
/** /**
* @description 编辑器名称 * @description 编辑器名称
...@@ -30,6 +30,11 @@ interface RawProps { ...@@ -30,6 +30,11 @@ interface RawProps {
* @description 标题 * @description 标题
*/ */
caption?: string; caption?: string;
/**
* @description 直接内容样式
*/
rawStyle?: IParam;
} }
interface EditorEmit { interface EditorEmit {
...@@ -45,12 +50,12 @@ const emit = defineEmits<EditorEmit>(); ...@@ -45,12 +50,12 @@ const emit = defineEmits<EditorEmit>();
<template> <template>
<div :class="['app-raw-item', 'app-raw', `app-raw-${name}`]"> <div :class="['app-raw-item', 'app-raw', `app-raw-${name}`]">
<div class="raw-caption" v-if="caption">{{ caption }}</div> <div class="raw-caption" v-if="caption" :style="rawStyle">{{ caption }}</div>
<div v-if="Object.is(contentType, 'RAW')"> <div v-if="Object.is(contentType, 'RAW')">
{{ value }} {{ value }}
</div> </div>
<div v-else-if="Object.is(contentType, 'HTML')" v-html="value" /> <div v-else-if="Object.is(contentType, 'HTML')" v-html="value" :style="rawStyle" />
<div v-else-if="Object.is(contentType, 'IMAGE')"> <div v-else-if="Object.is(contentType, 'IMAGE')" :style="rawStyle">
<AppIconText :iconClass="iconClass" :imgPath="imgPath"/> <AppIconText :iconClass="iconClass" :imgPath="imgPath"/>
</div> </div>
</div> </div>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册