Commit 192384e4 authored by 田翔's avatar 田翔

fix: 选项更新

parent 2d4321e7
{
"name": "panda-xform",
"version": "3.10.4",
"description": "3.10.4: 图片参数取值调整",
"version": "3.10.5",
"description": "3.10.5: 版本升级",
"keywords": [
"panda-xform"
],
......@@ -30,6 +30,7 @@
"@wisdom-components/empty": "^1.4.7",
"antd": "4.20.7",
"antd-img-crop": "^3.14.1",
"array-move": "^4.0.0",
"form-render": "1.14.7",
"fr-generator": "2.8.3",
"http-proxy-middleware": "^1.0.6",
......@@ -38,7 +39,10 @@
"react": "17.0.2",
"react-file-viewer": "^1.2.1",
"react-sign2": "^0.0.3",
"react-sortable-hoc": "^2.0.0",
"react-sortablejs": "^6.1.4",
"react-svg": "15.1.9",
"sortablejs": "^1.15.0",
"yarn": "^1.22.17"
},
"devDependencies": {
......@@ -46,6 +50,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-jsx": "^7.12.13",
"@babel/plugin-transform-modules-amd": "^7.14.5",
"@types/sortablejs": "^1.15.1",
"@umijs/fabric": "^2.0.7",
"@wisdom-map/amap": "1.1.0-beta.45",
"@wisdom-map/arcgismap": "1.4.0-124",
......@@ -125,4 +130,4 @@
"publishConfig": {
"registry": "https://g.civnet.cn:4873"
}
}
\ No newline at end of file
}
......@@ -778,7 +778,8 @@ const selectWidgets = [
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'simpleList',
// widget: 'simpleList',
widget: 'SimpleList',
items: {
type: 'object',
properties: {
......@@ -803,7 +804,7 @@ const selectWidgets = [
},
displayType: 'row',
labelWidth: 80,
dependencies: ['sourceType']
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
......@@ -960,11 +961,8 @@ const selectWidgets = [
sourceType: {
title: '来源方式',
type: 'string',
widget: 'SoruceType',
widget: 'SourceType',
default: '手动输入',
props: {
disabled: true
}
},
options: {
title: '',
......@@ -972,7 +970,7 @@ const selectWidgets = [
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'simpleList',
widget: 'SimpleList',
items: {
type: 'object',
properties: {
......@@ -996,6 +994,7 @@ const selectWidgets = [
// hideMove: true,
hideCopy: true,
},
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
......@@ -1005,6 +1004,22 @@ const selectWidgets = [
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
},
required: {
title: '必填',
type: 'boolean',
......@@ -1095,11 +1110,8 @@ const selectWidgets = [
sourceType: {
title: '来源方式',
type: 'string',
widget: 'SoruceType',
widget: 'SourceType',
default: '手动输入',
props: {
disabled: true
}
},
options: {
title: '',
......@@ -1107,7 +1119,7 @@ const selectWidgets = [
type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }],
widget: 'simpleList',
widget: 'SimpleList',
items: {
type: 'object',
properties: {
......@@ -1130,6 +1142,7 @@ const selectWidgets = [
// hideMove: true,
hideCopy: true,
},
dependencies: ['sourceType', 'color']
},
dictionary: {
title: '{{formData.sourceType}}',
......@@ -1139,6 +1152,22 @@ const selectWidgets = [
widget: 'Dictionary',
value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
},
tableName: {
title: '表名',
name: '表名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'TableName',
dependencies: ['sourceType'],
},
fieldName: {
title: '字段名',
name: '字段名',
hidden: '{{formData.sourceType !== "表数据"}}',
type: 'string',
widget: 'FieldName',
dependencies: ['sourceType', 'tableName'],
},
required: {
title: '必填',
type: 'boolean',
......
import React, { useState, useRef, useEffect, useContext, useMemo, useLayoutEffect } from 'react'
import { MenuOutlined } from '@ant-design/icons'
import { Table, Input, Form, Popover, Popconfirm } from 'antd'
import { arrayMoveImmutable } from 'array-move'
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc'
import { CheckOutlined, DeleteOutlined } from '@ant-design/icons'
import styles from './index.less'
const colors = [
// '#ffccc7', '#ffe7ba', '#fffb8f', '#d9f7be', '#b5f5ec',
// '#bae7ff', '#d6e4ff', '#efdbff', '#ffd6e7', '#e8e8e8',
// '#ff4d4f', '#ffa940', '#fbce00', '#73d13d', '#36cfc9',
// '#40a9ff', '#597ef7', '#9254de', '#f759ab', '#8c8c8c',
'rgb(255, 77, 79)',
'rgb(255, 169, 64)',
'rgb(251, 206, 0)',
'rgba(115, 209, 61)',
'rgba(54, 207, 201)',
'rgba(64, 169, 255)',
'rgba(89, 126, 247)',
'rgba(146, 84, 222)',
'rgba(247, 89, 171)',
'rgba(140, 140, 140)',
// 'rgba(255, 204, 199)',
// 'rgba(255, 231, 186)',
// 'rgba(255, 251, 143)',
// 'rgba(217, 247, 190)',
// 'rgba(181, 245, 236)',
// 'rgba(186, 231, 255)',
// 'rgba(214, 228, 255)',
// 'rgba(239, 219, 255)',
// 'rgba(255, 214, 231)',
// 'rgba(232, 232, 232)',
]
let newData = []
const EditableContext = React.createContext(null)
const DragHandle = SortableHandle(() => (
<MenuOutlined
style={{
cursor: 'grab',
color: '#999',
}}
/>
))
const SortableItem = SortableElement((props) => {
const [form] = Form.useForm()
return (
<Form form={form} component={false}>
<EditableContext.Provider value={form}>
<tr {...props} />
</EditableContext.Provider>
</Form>
)
})
const SortableBody = SortableContainer((props) => <tbody {...props} />)
// const InputItem = (props) => {
// const inputRef = useRef(null)
// useLayoutEffect(() => {
// inputRef.current.focus()
// }, [])
// return (
// <Input ref={inputRef} {...props} />
// )
// }
const DragTable = (props) => {
const { dataSource, setDataSource, color } = props
const onSortEnd = ({ oldIndex, newIndex }) => {
if (oldIndex !== newIndex) {
const data = arrayMoveImmutable(dataSource.slice(), oldIndex, newIndex).filter(
(el) => !!el,
)
setDataSource(data)
}
}
const DraggableContainer = (props) => (
<SortableBody
useDragHandle
disableAutoscroll
helperClass="row-dragging"
onSortEnd={onSortEnd}
{...props}
/>
)
const DraggableBodyRow = ({ className, style, ...restProps }) => {
// const index = dataSource.findIndex((x) => x.index === restProps['data-row-key'])
// return <SortableItem key={index} index={index} {...restProps} />
let key = Number(restProps['data-row-key'])
return <SortableItem key={key} index={key} {...restProps} />
}
const onPressEnter = (i) => {
let length = [...dataSource].length
let array = [...dataSource]
array.splice(i + 1, 0, { key: `${length + 1}`, index: length + 1, value: '' })
setDataSource(array)
}
const inputChange = (value, i) => {
let array = []
dataSource.forEach((v, index) => {
if (index === i) {
v.value = value
}
array.push({ ...v })
})
newData = array
}
const colorClick = (value, i) => {
let array = []
dataSource.forEach((v, index) => {
if (index === i) {
v.color = value
}
array.push({ ...v })
})
setDataSource(array)
}
const onBlur = () => {
if (Array.isArray(newData) && newData.length) {
setDataSource(newData)
}
}
const confirm = (index) => {
let array = []
dataSource.forEach((v, i) => {
if (i !== index) {
array.push({ ...v })
}
})
newData = array
setDataSource(array)
}
const rest = (index) => {
let array = []
dataSource.forEach((v, i) => {
if (index === i) {
v.color = ''
}
array.push({ ...v })
})
setDataSource(array)
}
const columns = useMemo(() => {
let columns = [
{
title: 'value',
dataIndex: 'value',
render: (r, _, i) => {
return (
<Input
onPressEnter={() => onPressEnter(i)}
onChange={(e) => inputChange(e.target.value, i)}
defaultValue={r}
onBlur={() => onBlur()}
/>
)
}
},
{
title: 'color',
dataIndex: 'color',
width: 30,
render: (r, _, index) => {
const content = (
<div>
<div className={styles.colorTop}>
<div className={styles.topLeft}>请选择颜色</div>
<div className={styles.topRight} onClick={() => rest(index)}>重置</div>
</div>
<div className={styles.colorBox}>
{
colors.map((v, i) => {
return (
<div className={styles.colors} style={{ background: v }} onClick={() => colorClick(v, index)}>
<CheckOutlined style={{ fontSize: '11px', marginLeft: '5px', display: r === v ? 'inline-block' : 'none' }} />
</div>
)
})
}
</div>
</div>
)
return (
<Popover
content={content}
trigger='click'
>
<div className={styles.colors} style={{ background: r || '#f2f4f5' }}></div>
</Popover>
)
}
},
{
width: 30,
render: (r, _, i) => {
return (
<Popconfirm
title='确定删除?'
onConfirm={() => confirm(i)}
onCancel={() => { }}
>
<DeleteOutlined style={{ color: 'rgb(153, 153, 153)' }} />
</Popconfirm>
)
},
},
{
title: 'Sort',
dataIndex: 'sort',
width: 30,
className: 'drag-visible',
render: () => <DragHandle />,
},
]
if (!color) {
return columns.filter(v => v.dataIndex !== 'color')
}
return columns
}, [dataSource, color])
return (
<Table
showHeader={false}
pagination={false}
dataSource={dataSource}
columns={columns}
rowKey="key"
size='small'
components={{
body: {
wrapper: DraggableContainer,
row: DraggableBodyRow,
},
}}
/>
)
}
export default DragTable
\ No newline at end of file
.colorTop {
display: flex;
justify-content: space-between;
.topLeft {
font-size: 15px;
font-weight: 700;
color: #707070;
}
.topRight {
font-size: 12px;
color: #41b3ec;
&:hover {
cursor: pointer;
}
}
}
.colorBox {
width: 130px;
display: flex;
flex-wrap: wrap;
}
.colors {
width: 20px;
height: 20px;
border-radius: 50%;
margin-top: 6px;
margin-left: 6px;
&:hover {
cursor: pointer;
}
}
\ No newline at end of file
import React from 'react'
import styles from './index.less'
const hexToRgba = (hex, opacity) => {
if (hex) {
let rgb = hex.split('(')[1].split(')')[0].split(',')
return 'rgba(' + rgb[0].trim() + ',' + rgb[1].trim() + ',' + rgb[2].trim() + ',' + opacity + ')'
}
return null
}
const TagPack = (props) => {
const { color, text } = props
return (
<span
className={styles.tagPack}
style={{ background: hexToRgba(color, 0.4), color: color, border: color ? '1px solid' : 'none' }}
>
{text}
</span>
)
}
export default TagPack
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
.tagPack {
padding: 0 7px;
border-radius: 5px;
}
\ No newline at end of file
import React, { useState, useEffect, useMemo } from 'react'
import { Checkbox } from 'antd'
import { GetSelectItemList } from '../../../../apis/process'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID, getStationIDListByUserID } from '../../../../apis/process'
import TagPack from '../../../components/TagPack'
const CheckBox = (props) => {
const { value, onChange, schema, addons } = props
const { presetValue, disabled, sourceType, options, dictionary } = schema
const { presetValue, disabled, sourceType, options, dictionary, tableName, fieldName, isStoreID, color } = schema
const [dictionaryList, setDictionaryList] = useState([])
const [tableData, setTableData] = useState([])
const enums = useMemo(() => {
switch (sourceType) {
case '手动输入':
return Array.isArray(options) ? options.map(v => v.value) : []
return Array.isArray(options) ? options : []
case '数据字典':
return Array.isArray(dictionaryList) ? Array.from([...new Set(dictionaryList.map(v => v.nodeName))]) : []
return Array.isArray(dictionaryList) ? dictionaryList.map(v => v.nodeValue) : []
case '表数据':
return Array.isArray(tableData) ? tableData : []
default:
return []
}
}, [sourceType, options, dictionaryList])
}, [sourceType, options, dictionaryList, tableData])
const children = useMemo(() => {
let children = []
if (Array.isArray(enums)) {
enums.forEach(v => {
if (sourceType === '站点') {
children.push(<Checkbox key={isStoreID ? v.stationID : v.stationName} value={isStoreID ? v.stationID : v.stationName}>{v.stationName}</Checkbox>)
} else if (sourceType === '手动输入') {
children.push(
<Checkbox key={v.value} value={v.value}>
{
color ? <TagPack color={v.color} text={v.value} /> : v.value
}
</Checkbox >
)
} else {
children.push(<Checkbox key={v} value={v}>{v}</Checkbox>)
}
})
}
return children
}, [sourceType, enums, color])
useEffect(() => {
if (addons) {
......@@ -28,9 +54,34 @@ const CheckBox = (props) => {
}, [presetValue])
const onFocus = async () => {
const { data } = await GetSelectItemList({ nodeName: dictionary })
if (Array.isArray(data)) {
setDictionaryList(data)
if (addons) {
if (sourceType === '数据字典') {
if (!dictionary) {
return message.error('请选择数据字典!')
}
const { data } = await GetSelectItemList({ nodeName: dictionary })
if (Array.isArray(data)) {
setDictionaryList(data)
}
}
if (sourceType === '表数据') {
if (!tableName) {
return message.info('请选择表名!')
}
if (!fieldName) {
return message.info('请选择字段名!')
}
const { code, data, msg } = await GetFieldValueFromTable(tableName, fieldName)
if (code === 0) {
if (Array.isArray(data)) {
setTableData(data.filter(v => v))
} else {
setTableData([])
}
} else {
message.error(msg)
}
}
}
}
......@@ -44,7 +95,10 @@ const CheckBox = (props) => {
if (sourceType === '数据字典' && dictionary) {
onFocus()
}
}, [sourceType, dictionary])
if (sourceType === '表数据' && tableName && fieldName) {
onFocus()
}
}, [sourceType, dictionary, tableName, fieldName])
return (
<Checkbox.Group
......@@ -52,7 +106,7 @@ const CheckBox = (props) => {
onChange={checkChange}
value={value ? value.split(',') : []}
>
{enums.map(v => <Checkbox key={v} value={v}>{v}</Checkbox>)}
{children}
</Checkbox.Group>
)
}
......
import React, { useState, useMemo, useEffect } from 'react'
import { Select, message } from 'antd'
import { Select, message, Tag } from 'antd'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID, getStationIDListByUserID } from '../../../../apis/process'
const { Option } = Select
......@@ -8,7 +8,7 @@ const ComboBox = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1
const { value, onChange, schema, addons } = props
const { placeholder, disabled, sourceType, options, dictionary, tableName, fieldName, presetValue, isMultiple, isEdit, isMySite, isSearch, isStoreID } = schema
const { placeholder, disabled, sourceType, options, dictionary, tableName, fieldName, presetValue, isMultiple, isEdit, isMySite, isSearch, isStoreID, color } = schema
const [dictionaryList, setDictionaryList] = useState([])
const [tableData, setTableData] = useState([])
const [site, setSite] = useState([])
......@@ -32,7 +32,7 @@ const ComboBox = (props) => {
const enums = useMemo(() => {
switch (sourceType) {
case '手动输入':
return Array.isArray(options) ? options.map(v => v.value) : []
return Array.isArray(options) ? options : []
case '数据字典':
return Array.isArray(dictionaryList) ? dictionaryList.map(v => v.nodeValue) : []
case '表数据':
......@@ -49,9 +49,15 @@ const ComboBox = (props) => {
if (Array.isArray(enums)) {
enums.forEach(v => {
if (sourceType === '站点') {
children.push(<Option key={isStoreID ? v.stationID : v.stationName}>{v.stationName}</Option>)
children.push(<Option key={isStoreID ? v.stationID : v.stationName} value={isStoreID ? v.stationID : v.stationName}>{v.stationName}</Option>)
} else if (sourceType === '手动输入') {
children.push(
<Option key={v.value} value={v.value}>
{v.value}
</Option >
)
} else {
children.push(<Option key={v}>{v}</Option>)
children.push(<Option key={v} value={v}>{v}</Option>)
}
})
}
......@@ -110,6 +116,42 @@ const ComboBox = (props) => {
}
}
const tagRender = (props) => {
const { label, value, closable, onClose } = props
const color = useMemo(() => {
let color = '#f2f4f5'
options.forEach(v => {
if (v.value === value) {
color = v.color
}
})
return color
}, [options, value])
const onPreventMouseDown = (event) => {
event.preventDefault()
event.stopPropagation()
}
return (
<Tag
color={color}
onMouseDown={onPreventMouseDown}
closable={closable}
onClose={onClose}
style={{
marginRight: 3,
}}
>
{label}
</Tag>
);
}
const isTagRender = color ? { tagRender } : {}
return (
<Select
onFocus={onFocus}
......@@ -123,6 +165,7 @@ const ComboBox = (props) => {
onChange={handleChange}
allowClear
getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
{...isTagRender}
>
{children}
</Select>
......
import React, { useState, useEffect, useMemo } from 'react'
import { Radio } from 'antd'
import { GetSelectItemList } from '../../../../apis/process'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID, getStationIDListByUserID } from '../../../../apis/process'
import TagPack from '../../../components/TagPack'
const RadioButton = (props) => {
const { value, onChange, schema, addons } = props
const { presetValue, disabled, sourceType, options, dictionary } = schema
const { presetValue, disabled, sourceType, options, dictionary, tableName, fieldName, isStoreID, color } = schema
const [dictionaryList, setDictionaryList] = useState([])
const [tableData, setTableData] = useState([])
const [site, setSite] = useState([])
useEffect(() => {
if (addons) {
......@@ -15,9 +18,46 @@ const RadioButton = (props) => {
}, [presetValue])
const onFocus = async () => {
const { data } = await GetSelectItemList({ nodeName: dictionary })
if (Array.isArray(data)) {
setDictionaryList(data)
if (addons) {
if (sourceType === '数据字典') {
if (!dictionary) {
return message.error('请选择数据字典!')
}
const { data } = await GetSelectItemList({ nodeName: dictionary })
if (Array.isArray(data)) {
setDictionaryList(data)
}
}
if (sourceType === '表数据') {
if (!tableName) {
return message.info('请选择表名!')
}
if (!fieldName) {
return message.info('请选择字段名!')
}
const { code, data, msg } = await GetFieldValueFromTable(tableName, fieldName)
if (code === 0) {
if (Array.isArray(data)) {
setTableData(data.filter(v => v))
} else {
setTableData([])
}
} else {
message.error(msg)
}
}
if (sourceType === '站点') {
const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite)
if (code === 0) {
if (Array.isArray(data)) {
setSite(data)
} else {
setSite([])
}
} else {
message.error(msg)
}
}
}
}
......@@ -31,22 +71,51 @@ const RadioButton = (props) => {
if (sourceType === '数据字典' && dictionary) {
onFocus()
}
}, [sourceType, dictionary])
if (sourceType === '表数据' && tableName && fieldName) {
onFocus()
}
}, [sourceType, dictionary, tableName, fieldName])
const enums = useMemo(() => {
switch (sourceType) {
case '手动输入':
return Array.isArray(options) ? options.map(v => v.value) : []
return Array.isArray(options) ? options : []
case '数据字典':
return Array.isArray(dictionaryList) ? dictionaryList.map(v => v.nodeName) : []
return Array.isArray(dictionaryList) ? dictionaryList.map(v => v.nodeValue) : []
case '表数据':
return Array.isArray(tableData) ? tableData : []
case '站点':
return Array.isArray(site) ? site : []
default:
return []
}
}, [sourceType, options, dictionaryList])
const children = useMemo(() => {
let children = []
if (Array.isArray(enums)) {
enums.forEach(v => {
if (sourceType === '站点') {
children.push(<Radio key={isStoreID ? v.stationID : v.stationName} value={isStoreID ? v.stationID : v.stationName}>{v.stationName}</Radio>)
} else if (sourceType === '手动输入') {
children.push(
<Radio key={v.value} value={v.value}>
{
color ? <TagPack color={v.color} text={v.value} /> : v.value
}
</Radio >
)
} else {
children.push(<Radio key={v} value={v}>{v}</Radio>)
}
})
}
return children
}, [sourceType, enums])
return (
<Radio.Group onChange={radioChange} value={value} disabled={disabled}>
{enums.map(v => <Radio key={v} value={v}>{v}</Radio>)}
{children}
</Radio.Group>
)
......
......@@ -5,25 +5,25 @@ const SwitchSelector = (props) => {
const { value, onChange, schema, addons } = props
const { disabled, presetValue, showText } = schema
const text = (showText && showText.includes('/')) ? showText.split('/') : ['开', '关']
const text = (showText && showText.includes('/')) ? showText.split('/') : ['', '']
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, (presetValue === text[0] || presetValue === true) ? text[0] : text[1])
addons.setValue(addons.dataPath, (presetValue === text[0] || presetValue === true) ? (text[0] || '开') : (text[1] || '关'))
} else {
onChange((presetValue === text[0] || presetValue === true) ? text[0] : text[1])
onChange((presetValue === text[0] || presetValue === true) ? (text[0] || '开') : (text[1] || '关'))
}
}, [presetValue])
const switchChange = (checked) => {
if (addons) {
onChange(checked ? text[0] : text[1])
onChange(checked ? (text[0] || '开') : (text[1] || '关'))
}
}
return (
<Switch
checked={Boolean(value === text[0])}
checked={Boolean(value === text[0] || value === '开')}
disabled={disabled}
checkedChildren={text[0]}
unCheckedChildren={text[1]}
......
......@@ -5,7 +5,7 @@ const SwitchDefault = (props) => {
const { value, onChange, addons } = props
const { showText } = addons?.formData
const text = (showText && showText.includes('/')) ? showText.split('/') : ['开', '关']
const text = (showText && showText.includes('/')) ? showText.split('/') : ['', '']
const switchChange = (checked) => {
if (addons) {
......
import React, { useState, useRef, useContext, useEffect } from 'react'
import styles from './index.less'
import { Switch, Input, Table, Form } from 'antd'
import Drag from './../../../../components/Drag'
import DragTable from '../../../../components/DragTable'
const SimpleList = (props) => {
const { value, onChange, addons } = props
const { color } = addons.formData
const [visible, setVisible] = useState(false)
const [text, setText] = useState('')
const switchChange = (checked) => {
addons.setValue('color', checked)
}
const add = () => {
let length = [...value].length
let array = [...value]
array.push({ key: `${length + 1}`, index: length + 1, value: '' })
onChange(array)
}
const edit = () => {
setText(value.map(v => v.value).join('\n'))
setVisible(true)
}
const onOk = () => {
let array = text.split('\n').map((v, i) => { return { key: `${i}`, index: i, value: v } })
onChange(array)
setVisible(false)
}
return (
<div className={styles.simpleList}>
<div className={styles.title}>
<div style={{ fontSize: '14px' }}>选项</div>
<div style={{ fontSize: '12px' }}>
<span style={{ paddingRight: '5px' }}>彩色</span>
<Switch size='small' checked={color} onChange={switchChange} />
</div>
</div>
<div className={styles.box}>
<DragTable
dataSource={Array.isArray(value) ? value.map((v, i) => { return { key: `${i}`, index: i, ...v } }) : []}
setDataSource={onChange}
color={color}
/>
</div>
<div className={styles.footer}>
<span onClick={add}>添加选项</span>
<span></span>
<span onClick={edit}>批量编辑</span>
</div>
<Drag
title='批量编辑'
onOk={onOk}
onCancel={() => setVisible(false)}
visible={visible}
>
<Input.TextArea
rows={5}
value={text}
onChange={(e) => setText(e.target.value)}
/>
</Drag>
</div>
)
}
export default SimpleList
\ No newline at end of file
.simpleList {
.title {
display: flex;
justify-content: space-between;
}
.box {
padding: 0 5px;
.item {
margin-top: 5px;
}
}
.footer {
margin-top: 4px;
span {
display: inline-block;
color: #1495ff;
&:nth-child(2) {
margin: 0 5px;
width: 2px;
height: 11px;
background: #a5a5a5;
}
&:hover {
cursor: pointer;
}
}
}
}
\ No newline at end of file
......@@ -20,6 +20,7 @@ const SourceType = (props) => {
return [
{ label: '手动输入', value: '手动输入' },
{ label: '数据字典', value: '数据字典' },
{ label: '表数据', value: '表数据' },
]
}, [widget])
......
......@@ -9,6 +9,7 @@ import TableName from './TableName'
import FieldName from './FieldName'
import CalculateRule from './CalculateRule'
import AddressSync from './AddressSync'
import SimpleList from './SimpleList'
const groupSource = {
Dictionary,
......@@ -22,6 +23,7 @@ const groupSource = {
FieldName,
CalculateRule,
AddressSync,
SimpleList,
}
export default groupSource
\ No newline at end of file
......@@ -88,6 +88,10 @@ body #app {
background: rgba(0, 0, 0, 0.5);
}
}
}
.@{ant-prefix}-checkbox-wrapper {
margin-top: 10px;
margin-left: 5px;
} //复选框disabled的样式
.@{ant-prefix}-checkbox-disabled {
&+span {
......
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