Commit 4fdea49e authored by 田翔's avatar 田翔

fix: 描述控件支持分组内

parent 3ebbdc7f
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.10.21", "version": "6.10.22",
"description": "6.10.21 台账选择器支持自动回填", "description": "6.10.22 描述控件支持分组内",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -1982,7 +1982,7 @@ const baseWidgets = [ ...@@ -1982,7 +1982,7 @@ const baseWidgets = [
displayType: 'row', displayType: 'row',
labelWidth: 110, labelWidth: 110,
widget: 'BooleanSwitch', widget: 'BooleanSwitch',
description: '开启后会将台账中的值自动映射在表单中(移动端)', description: '开启后会将台账中的值自动映射在表单中',
}, },
isMultiple: { isMultiple: {
title: '多选', title: '多选',
......
...@@ -286,10 +286,10 @@ const FormDesigner = (props, ref) => { ...@@ -286,10 +286,10 @@ const FormDesigner = (props, ref) => {
if (isObject(child)) { if (isObject(child)) {
let childObj = {} let childObj = {}
for (let s in child) { for (let s in child) {
if (child[s].type === 'html') { // if (child[s].type === 'html') {
outError = true // outError = true
} // }
if (child[s].type !== 'object' && child[s].type !== 'html') { if (child[s].type !== 'object') {
array.push({ ...child[s], fieldName: s }) array.push({ ...child[s], fieldName: s })
childObj[s] = child[s] childObj[s] = child[s]
} else { } else {
......
...@@ -130,7 +130,10 @@ const XRender = (props, ref) => { ...@@ -130,7 +130,10 @@ const XRender = (props, ref) => {
value = Number(value).toFixed(Number(decimalDigits)) value = Number(value).toFixed(Number(decimalDigits))
} }
} }
formValue.push({ fieldName: key, fieldValue: value }) //兼容描述控件有值问题
if (!key?.includes('描述说明_')) {
formValue.push({ fieldName: key, fieldValue: value })
}
}) })
} }
}) })
......
...@@ -7,23 +7,49 @@ const StyleHTML = (props) => { ...@@ -7,23 +7,49 @@ const StyleHTML = (props) => {
const { value, onChange } = props const { value, onChange } = props
const colorChange = (e) => { const backColorChange = (e) => {
onChange({ ...value, background: e.hex }) onChange({ ...value, background: e.hex })
} }
const colorChange = (e) => {
onChange({ ...value, color: e.hex })
}
return ( return (
<div style={{ paddingLeft: '10px' }}> <div style={{ paddingLeft: '10px' }}>
<Form <Form
name="dynamic_rule" name="dynamic_rule"
layout={'vertical'} layout={'vertical'}
> >
<Form.Item label="字体颜色">
<Popconfirm
overlayClassName={styles.Popconfirmtitle}
placement="topLeft"
icon={false}
title={
<SketchPicker width="217px" color={value?.color} onChange={e => colorChange(e)} />
}
>
<div className={styles.borderColor}>
<div
style={{
background: value?.color,
width: '18px',
height: '10px',
marginLeft: '1px',
marginTop: '4px',
}}
/>
</div>
</Popconfirm>
</Form.Item>
<Form.Item label="背景色"> <Form.Item label="背景色">
<Popconfirm <Popconfirm
overlayClassName={styles.Popconfirmtitle} overlayClassName={styles.Popconfirmtitle}
placement="topLeft" placement="topLeft"
icon={false} icon={false}
title={ title={
<SketchPicker width="217px" color={value?.background} onChange={e => colorChange(e)} /> <SketchPicker width="217px" color={value?.background} onChange={e => backColorChange(e)} />
} }
> >
<div className={styles.borderColor}> <div className={styles.borderColor}>
...@@ -39,9 +65,11 @@ const StyleHTML = (props) => { ...@@ -39,9 +65,11 @@ const StyleHTML = (props) => {
</div> </div>
</Popconfirm> </Popconfirm>
</Form.Item> </Form.Item>
<Form.Item label="内边距(px)"> <Form.Item label="内边距(%)">
<Slider <Slider
defaultValue={0} defaultValue={0}
min={0}
max={100}
value={value?.padding} value={value?.padding}
onChange={padding => onChange({ ...value, padding: padding })} onChange={padding => onChange({ ...value, padding: padding })}
/> />
......
...@@ -7,7 +7,7 @@ const TextHTML = (props) => { ...@@ -7,7 +7,7 @@ const TextHTML = (props) => {
if (isText) { if (isText) {
return ( return (
<div>{contentText}</div> <div style={{ color: styleHTML?.color, padding: styleHTML?.padding ? `0 ${styleHTML.padding}%` : '' }}>{contentText}</div>
) )
} }
......
...@@ -242,7 +242,7 @@ body #app { ...@@ -242,7 +242,7 @@ body #app {
} }
.@{ant-prefix}-checkbox-wrapper { .@{ant-prefix}-checkbox-wrapper {
margin-top: 10px; // margin-top: 10px;
margin-left: 5px; margin-left: 5px;
} }
......
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