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',
......
This diff is collapsed.
...@@ -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