Commit 45c42e52 authored by 田翔's avatar 田翔

附件,富文本,多行文本,关联表单宽度配置放出

parent 72da5a8f
{
"name": "panda-xform",
"version": "1.6.9",
"description": "1.6.9: 人员选择器树形完善,三种形态支持ID存储,部门选择器支持ID存储",
"version": "1.10.0",
"description": "1.10.0: 附件,富文本,多行文本,关联表单宽度配置放出",
"keywords": [
"panda-xform"
],
......
......@@ -638,6 +638,11 @@ const textWidgets = [
type: 'object',
properties: {}
},
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
},
labelWidth: {
title: '标签宽度',
description: '默认值110',
......@@ -745,6 +750,11 @@ const textWidgets = [
type: 'object',
properties: {}
},
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
},
labelWidth: {
title: '标签宽度',
description: '默认值110',
......@@ -2439,12 +2449,11 @@ const fileWidgets = [
// enum: ['picture', 'text', 'picture-card'],
// enumNames: ['列表_详细', '列表_省略', '卡片'],
// },
// width: {
// title: '元素宽度',
// type: 'string',
// widget: 'percentSlider',
// default: '100%',
// },
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
},
labelWidth: {
title: '标签宽度',
description: '默认值110',
......@@ -2947,11 +2956,11 @@ const advancedWidgets = [
displayType: 'row',
labelWidth: 55,
},
// groupStyle: {
// title: '控件样式',
// type: 'object',
// properties: {}
// },
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
// prefix: {
// title: '前缀',
// type: 'string',
......
import React, { useMemo, useState } from 'react'
import { Col, InputNumber, Row, Slider } from 'antd'
// const marks = {
// 25: {
// style: {
// fontSize: '12px',
// transform: 'translateX(-50%) scale(0.8)',
// },
// label: '25%',
// },
// 50: {
// style: {
// fontSize: '12px'
// },
// label: '50%',
// },
// 75: {
// style: {
// fontSize: '12px',
// transform: 'translateX(-50%) scale(0.8)',
// },
// label: '75%',
// },
// 100: {
// style: {
// fontSize: '12px',
// transform: 'translateX(-50%) scale(0.8)',
// },
// label: '100%',
// },
// }
const getMarks = (array) => {
let object = {}
array.forEach(v => {
object[v] = {
style: {
fontSize: '12px',
},
label: v + '%',
}
})
return object
}
const PercentSlider = (props) => {
let column = window.sessionStorage.getItem('designerRefSchema') || '3'
const { value, onChange, addons } = props
const [inputValue, setInputValue] = useState(0)
let array = [0, 33.33, 66.66, 100]
if (column === '4') {
array = [0, 25, 50, 75, 100]
} else if (column === '5') {
array = [0, 20, 40, 60, 80, 100]
}
const marks = getMarks(array)
const sliderChange = (value) => {
onChange(value + '%')
setInputValue(value)
}
console.log('marks', marks)
return (
<Slider
min={0}
max={100}
marks={marks}
onChange={sliderChange}
value={typeof inputValue === 'number' ? inputValue : 0}
step={null}
/>
)
}
export default PercentSlider
\ No newline at end of file
import PercentSlider from "./PercentSlider"
const groupStyle = {
PercentSlider,
}
export default groupStyle
\ No newline at end of file
......@@ -2,6 +2,7 @@ import form from './form'
import groupBase from './groupBase'
import groupSource from './groupSource'
import groupVerify from './groupVerify'
import groupStyle from './groupStyle'
import BooleanSwitch from './BooleanSwitch'
import InputAddon from './InputAddon'
......@@ -10,6 +11,7 @@ const settings = {
...groupBase,
...groupSource,
...groupVerify,
...groupStyle,
BooleanSwitch,
InputAddon,
}
......
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