Commit fe205210 authored by 田翔's avatar 田翔

显示属性修改

parent 10215674
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.4.9", "version": "2.5.0",
"description": "2.4.9: 增加字段名称详细信息显示,设置更换为上下结构", "description": "2.5.0: 显示属性修改",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -2,7 +2,7 @@ const baseSettings = {} ...@@ -2,7 +2,7 @@ const baseSettings = {}
const commonSettings = { const commonSettings = {
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
...@@ -11,7 +11,7 @@ const commonSettings = { ...@@ -11,7 +11,7 @@ const commonSettings = {
// width: '70%', // width: '70%',
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
......
...@@ -51,7 +51,7 @@ const layoutWidgets = [ ...@@ -51,7 +51,7 @@ const layoutWidgets = [
properties: {} properties: {}
}, },
title: { title: {
title: '标题', title: '展示名称',
type: 'string', type: 'string',
required: true, required: true,
displayType: 'row', displayType: 'row',
...@@ -81,13 +81,13 @@ const textWidgets = [ ...@@ -81,13 +81,13 @@ const textWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -238,13 +238,13 @@ const textWidgets = [ ...@@ -238,13 +238,13 @@ const textWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -351,13 +351,13 @@ const textWidgets = [ ...@@ -351,13 +351,13 @@ const textWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -389,6 +389,11 @@ const textWidgets = [ ...@@ -389,6 +389,11 @@ const textWidgets = [
default: false, default: false,
width: '30%', width: '30%',
}, },
calculateRule: {
title: '计算规则',
type: 'string',
widget: 'CalculateRule',
},
description: { description: {
title: '说明', title: '说明',
type: 'string', type: 'string',
...@@ -455,13 +460,13 @@ const textWidgets = [ ...@@ -455,13 +460,13 @@ const textWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -550,13 +555,13 @@ const textWidgets = [ ...@@ -550,13 +555,13 @@ const textWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -656,13 +661,13 @@ const selectWidgets = [ ...@@ -656,13 +661,13 @@ const selectWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -853,13 +858,13 @@ const selectWidgets = [ ...@@ -853,13 +858,13 @@ const selectWidgets = [
labelWidth: 74, labelWidth: 74,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -982,13 +987,13 @@ const selectWidgets = [ ...@@ -982,13 +987,13 @@ const selectWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -1114,13 +1119,13 @@ const selectWidgets = [ ...@@ -1114,13 +1119,13 @@ const selectWidgets = [
labelWidth: 74, labelWidth: 74,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -1203,13 +1208,13 @@ const selectWidgets = [ ...@@ -1203,13 +1208,13 @@ const selectWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -1278,13 +1283,13 @@ const selectWidgets = [ ...@@ -1278,13 +1283,13 @@ const selectWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -1375,13 +1380,13 @@ const businessWidgets = [ ...@@ -1375,13 +1380,13 @@ const businessWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
}, },
...@@ -1500,7 +1505,7 @@ const businessWidgets = [ ...@@ -1500,7 +1505,7 @@ const businessWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
...@@ -1508,7 +1513,7 @@ const businessWidgets = [ ...@@ -1508,7 +1513,7 @@ const businessWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
}, },
...@@ -1592,13 +1597,13 @@ const businessWidgets = [ ...@@ -1592,13 +1597,13 @@ const businessWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
type: 'string', type: 'string',
required: true, required: true,
}, },
...@@ -1713,13 +1718,13 @@ const dateWidgets = [ ...@@ -1713,13 +1718,13 @@ const dateWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
}, },
...@@ -1803,13 +1808,13 @@ const dateWidgets = [ ...@@ -1803,13 +1808,13 @@ const dateWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
...@@ -1908,13 +1913,13 @@ const fileWidgets = [ ...@@ -1908,13 +1913,13 @@ const fileWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
type: 'string', type: 'string',
required: true, required: true,
}, },
...@@ -2018,13 +2023,13 @@ const mapWidgets = [ ...@@ -2018,13 +2023,13 @@ const mapWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
type: 'string', type: 'string',
required: true, required: true,
}, },
...@@ -2098,13 +2103,13 @@ const mapWidgets = [ ...@@ -2098,13 +2103,13 @@ const mapWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
required: true, required: true,
type: 'string', type: 'string',
}, },
...@@ -2172,13 +2177,13 @@ const mapWidgets = [ ...@@ -2172,13 +2177,13 @@ const mapWidgets = [
labelWidth: 75, labelWidth: 75,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
title: { title: {
title: '标题', title: '展示名称',
type: 'string', type: 'string',
required: true, required: true,
}, },
...@@ -2250,13 +2255,13 @@ const advancedWidgets = [ ...@@ -2250,13 +2255,13 @@ const advancedWidgets = [
labelWidth: 80, labelWidth: 80,
}, },
$id: { $id: {
title: '字段名称', title: '数据源',
type: 'string', type: 'string',
widget: 'FieldNames', widget: 'FieldNames',
required: true, required: true,
}, },
titleShow: { titleShow: {
title: '标题', title: '展示名称',
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
default: '关联表单', default: '关联表单',
...@@ -2330,89 +2335,89 @@ const advancedWidgets = [ ...@@ -2330,89 +2335,89 @@ const advancedWidgets = [
}, },
}, },
}, },
{ // {
text: '自动计算', // text: '自动计算',
name: '自动计算', // name: '自动计算',
icon: <IconPack.AutoCalculate />, // icon: <IconPack.AutoCalculate />,
schema: { // schema: {
title: '自动计算', // title: '自动计算',
type: 'string', // type: 'string',
widget: 'AutoCalculate', // widget: 'AutoCalculate',
}, // },
setting: { // setting: {
widget: { // widget: {
title: '控件类型', // title: '控件类型',
type: 'string', // type: 'string',
widget: 'WidgetType', // widget: 'WidgetType',
displayType: 'row', // displayType: 'row',
labelWidth: 80, // labelWidth: 80,
}, // },
$id: { // $id: {
title: '字段名称', // title: '数据源',
type: 'string', // type: 'string',
widget: 'FieldNames', // widget: 'FieldNames',
required: true, // required: true,
}, // },
title: { // title: {
title: '标题', // title: '展示名称',
type: 'string', // type: 'string',
required: true, // required: true,
}, // },
presetValue: { // presetValue: {
title: '默认值', // title: '默认值',
type: 'number', // type: 'number',
widget: 'NumerDefault', // widget: 'NumerDefault',
}, // },
required: { // required: {
title: '必填', // title: '必填',
type: 'boolean', // type: 'boolean',
default: false, // default: false,
width: '40%', // width: '40%',
props: { // props: {
style: { // style: {
marginLeft: '10px' // marginLeft: '10px'
} // }
} // }
}, // },
disabled: { // disabled: {
title: '只读', // title: '只读',
type: 'boolean', // type: 'boolean',
widget: 'checkbox', // widget: 'checkbox',
default: true, // default: true,
width: '30%', // width: '30%',
}, // },
description: { // description: {
title: '说明', // title: '说明',
type: 'string', // type: 'string',
}, // },
calculateRule: { // calculateRule: {
title: '计算规则', // title: '计算规则',
type: 'string', // type: 'string',
widget: 'CalculateRule', // widget: 'CalculateRule',
}, // },
groupStyle: { // groupStyle: {
title: '控件样式', // title: '控件样式',
type: 'object', // type: 'object',
properties: {}, // properties: {},
}, // },
width: { // width: {
title: '元素宽度', // title: '元素宽度',
type: 'string', // type: 'string',
widget: 'percentSlider', // widget: 'percentSlider',
}, // },
labelWidth: { // labelWidth: {
title: '标签宽度', // title: '标签宽度',
description: '默认值110', // description: '默认值110',
default: 110, // default: 110,
type: 'number', // type: 'number',
widget: 'slider', // widget: 'slider',
max: 400, // max: 400,
props: { // props: {
hideNumber: true, // hideNumber: true,
}, // },
}, // },
}, // },
}, // },
] ]
const settings = [ const settings = [
......
...@@ -19,7 +19,7 @@ const FormDesigner = (props, ref) => { ...@@ -19,7 +19,7 @@ const FormDesigner = (props, ref) => {
} }
)) ))
const { tableName } = props const { tableName, extra } = props
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext) const { getPrefixCls } = useContext(ConfigProvider.ConfigContext)
const prefixCls = getPrefixCls('pandaXform') const prefixCls = getPrefixCls('pandaXform')
...@@ -159,25 +159,30 @@ const FormDesigner = (props, ref) => { ...@@ -159,25 +159,30 @@ const FormDesigner = (props, ref) => {
} }
} }
const extraButtons = [ const extraButtons = useMemo(() => {
if (extra) {
return [
false, false,
false, false,
false, true,
false, true,
// { {
// text: '清空', text: '清空',
// onClick: clear onClick: clear
// }, },
// { {
// text: '预览', text: '预览',
// onClick: preview onClick: preview
// }, },
// { {
// text: '提交', text: '提交',
// type: 'primary', type: 'primary',
// onClick: submit onClick: submit
// } }
] ]
}
return [false, false, false, false]
}, [extra])
const getFields = (schema) => { const getFields = (schema) => {
let array = [] let array = []
...@@ -198,7 +203,6 @@ const FormDesigner = (props, ref) => { ...@@ -198,7 +203,6 @@ const FormDesigner = (props, ref) => {
const onSchemaChange = (schema) => { const onSchemaChange = (schema) => {
let fields = getFields(schema) let fields = getFields(schema)
window.designer = fields window.designer = fields
console.log(1)
} }
const testSubmit = async () => { const testSubmit = async () => {
......
...@@ -125,7 +125,7 @@ const getAutoWatch = (schema, form, startTime) => { ...@@ -125,7 +125,7 @@ const getAutoWatch = (schema, form, startTime) => {
let paths = [] let paths = []
let { relationForm } = form?.getValues() let { relationForm } = form?.getValues()
const configs = relationForm?.configs || [] const configs = relationForm?.configs || []
const AutoCalculate = getWidgetInfo(schema, 'AutoCalculate') const AutoCalculate = getWidgetInfo(schema, 'NumberInput')
if (Array.isArray(AutoCalculate)) { if (Array.isArray(AutoCalculate)) {
AutoCalculate.forEach(item => { AutoCalculate.forEach(item => {
const { fieldName, rules, calculateRule } = item const { fieldName, rules, calculateRule } = item
......
import React from 'react' import React, { useMemo } from 'react'
import { Select } from 'antd'
import { widgetData, getStyles } from '../../../../../constant/constant' import { widgetData, getStyles } from '../../../../../constant/constant'
const WidgetType = (props) => { const WidgetType = (props) => {
const { value, onChange } = props const { value, onChange } = props
// const options = useMemo(() => {
// }, [])
return ( return (
<span <span
onClick={e => onChange('TextInput')}
style={{ style={{
borderRadius: '5px', borderRadius: '5px',
padding: '0 7px', padding: '0 7px',
...@@ -17,6 +21,19 @@ const WidgetType = (props) => { ...@@ -17,6 +21,19 @@ const WidgetType = (props) => {
{widgetData[value]?.name} {widgetData[value]?.name}
</span> </span>
) )
// return (
// <Select
// showArrow
// tagRender={tagRender}
// defaultValue={['gold', 'cyan']}
// style={{
// width: '100%',
// }}
// options={options}
// >
// </Select>
// )
} }
......
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