Commit d3559ae3 authored by 王纵's avatar 王纵

低代码组件自定义表单渲染增加样式参数

parent 83114aeb
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 16:05:36 * @LastEditTime: 2024-09-19 16:02:58
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-超链接组件 * @Description: 动态渲染-超链接组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
--> -->
<template> <template>
<div :class="`${fieldConfig.dataClass}_form d-form-item`"> <div :class="`${fieldConfig.dataClass} d-form-item`">
<van-cell center class="d-url" :required="required"> <van-cell center class="d-url" :required="required">
<template #title> <template #title>
<d-label :label="label" :help="help" /> <d-label :label="label" :help="help" />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 21:21:37 * @Date: 2024-07-30 21:21:37
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 15:42:05 * @LastEditTime: 2024-09-19 16:05:29
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -97,7 +97,8 @@ export class ColumnBuilder extends BaseBuilder { ...@@ -97,7 +97,8 @@ export class ColumnBuilder extends BaseBuilder {
const currentRenderers = this.getCurrentRenderers(columnName, this.componentRenderers); const currentRenderers = this.getCurrentRenderers(columnName, this.componentRenderers);
let renderer = currentRenderers.length > 0 ? currentRenderers[0].renderer : undefined; let renderer = currentRenderers.length > 0 ? currentRenderers[0].renderer : undefined;
let formRenderer = currentRenderers.length > 0 ? currentRenderers[0].formRenderer : undefined; let formRenderer = currentRenderers.length > 0 ? currentRenderers[0].formRenderer : undefined;
return { renderer, formRenderer }; let className = currentRenderers.length > 0 ? currentRenderers[0].className : undefined;
return { renderer, formRenderer, className };
} }
getCurrentRenderers(columnName, renderers) { getCurrentRenderers(columnName, renderers) {
...@@ -112,12 +113,14 @@ export class ColumnBuilder extends BaseBuilder { ...@@ -112,12 +113,14 @@ export class ColumnBuilder extends BaseBuilder {
*/ */
initFields(fields, cascadeKey = '') { initFields(fields, cascadeKey = '') {
const newFields = fields.map(field => { const newFields = fields.map(field => {
const customerRender = this.getCustomizedRenderer(field.columnName);
return { return {
...field, ...field,
readOnly: field.inputModeDisplay === "READONLY", readOnly: field.inputModeDisplay === "READONLY",
required: field.inputModeDisplay === "REQUIRED", required: field.inputModeDisplay === "REQUIRED",
clearFlag: field.clearButton === 'Y', clearFlag: field.clearButton === 'Y',
renderer: this.getCustomizedRenderer(field.columnName, field).renderer, renderer: customerRender.renderer,
dataClass: customerRender.className
} }
// if (field.validationTypeDisplay === 'UrlField') { // if (field.validationTypeDisplay === 'UrlField') {
// const {renderer} = this.getCustomizedRenderer(field.columnName, field); // const {renderer} = this.getCustomizedRenderer(field.columnName, field);
...@@ -187,7 +190,7 @@ export class ColumnBuilder extends BaseBuilder { ...@@ -187,7 +190,7 @@ export class ColumnBuilder extends BaseBuilder {
clearFlag: field.clearButton === 'Y', clearFlag: field.clearButton === 'Y',
renderer: customizedRenderer.renderer, renderer: customizedRenderer.renderer,
formRenderer: customizedRenderer.formRenderer, formRenderer: customizedRenderer.formRenderer,
dataClass: `${this.layoutCode}-${this.tabCode}-${field.columnName}`.toLowerCase(), dataClass: customizedRenderer.className
} }
}); });
// return newFields; // return newFields;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment