Commit 91621f11 authored by 田翔's avatar 田翔

fix: 增加标签样式

parent 878adb02
......@@ -57,6 +57,33 @@ const RegExpObject = {
const dateArray = { timeControl: ['时间', '仅时间', '日期', '日期月份', '日期年份', '时分秒'] }
const doNotDisplayInEditModelShape = ['编码']
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)',
]
const widgetData = {
'TextInput': {
name: '文本',
......@@ -176,6 +203,7 @@ export {
RegExpObject,
dateArray,
doNotDisplayInEditModelShape,
colors,
widgetData,
getStyles,
}
......@@ -7,8 +7,11 @@ import {
GraphicsLayer,
Graphic,
Point,
SimpleLineSymbol,
SimpleFillSymbol,
} from '@wisdom-map/arcgismap/lib'
import Drag from '../../../../../components/Drag'
import { isJson } from '../../../../../../utils/index'
import point from '../../../../../../assets/images/cood/point.png'
......@@ -103,9 +106,27 @@ const CoordView = (props) => {
}, 2000)
}
} else if (widget === 'DrawPath') {
if (isJson(value)) {
let layer = new Graphic({
geometry: geomUtils.toGeometry(JSON.parse(value)),
symbol: new SimpleLineSymbol({
}),
})
let layers = new GraphicsLayer()
layers.add(layer)
mapObj.map.add(layers)
}
} else if (widget === 'DrawArea') {
if (isJson(value)) {
let layer = new Graphic({
geometry: geomUtils.toGeometry(JSON.parse(value)),
symbol: new SimpleFillSymbol({
}),
})
let layers = new GraphicsLayer()
layers.add(layer)
mapObj.map.add(layers)
}
}
}, 500)
}
......
import React from 'react'
import React, { useState } from 'react'
import styles from './index.less'
import { Button } from 'antd'
import {
SnippetsOutlined,
PlusOutlined,
FormOutlined,
DeleteOutlined,
ImportOutlined,
ExportOutlined,
FileZipOutlined,
FileImageOutlined,
CustomerServiceOutlined,
VideoCameraOutlined,
ExclamationCircleOutlined,
QuestionCircleOutlined,
EditOutlined,
DownOutlined
} from '@ant-design/icons'
import Viewer from 'viewerjs-react'
import Drag from '../../../../../components/Drag'
const FileView = (props) => {
const { value, fileType } = props
const { value, fileType, title } = props
let fileList = value ? value.split(',') : []
const [visible, setVisible] = useState(false)
if (!fileList.length) return null
if (fileType === '图片') {
let fileList = value ? value.split(',') : null
if (!fileList) return null
return (
<div className={styles.fileView}>
<Viewer>
......@@ -25,7 +45,23 @@ const FileView = (props) => {
}
return (
<div className={styles.fileView}>{value}</div>
<div className={styles.fileView}>
<Button
size='small'
icon={<FileZipOutlined />}
onClick={() => setVisible(true)}
>
{fileList.length}条记录
</Button>
<Drag
onOk={() => setVisible(false)}
title={title}
visible={visible}
>
</Drag>
</div>
)
}
......
.fileView {
display: flex;
justify-content: center;
align-items: center;
.img {
width: 65px;
margin-right: 5px;
......
import React from 'react'
import TagPack from '../../../../../components/TagPack'
const SelectView = (props) => {
const { value, sourceType, options } = props
let tag = value ? value.split(',') : []
if (sourceType === '手动输入') {
return (
<div>
{
tag.map((v, i) => {
let color = options.find(s => s.value === v)?.color
return (
<span style={{ margin: '0 5px' }}>
{
color ? <TagPack color={color} text={v} /> : v
}
</span>
)
})
}
</div>
)
}
return <div>{value}</div>
}
export default SelectView
\ No newline at end of file
import React from 'react'
const TagPack = (props) => {
const { value } = props
return (
<div>{value}</div>
)
}
export default TagPack
\ No newline at end of file
......@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
import { Table, Tooltip } from 'antd'
import FileView from './components/FileView'
import CoordView from './components/CoordView'
import TagPack from './components/TagPack'
import SelectView from './components/SelectView'
const TablePack = (props) => {
......@@ -17,7 +17,7 @@ const TablePack = (props) => {
}
if (['RadioButton', 'CheckBox'].includes(widget)) {
return <TagPack {...props} />
return <SelectView {...props} />
}
return (
......
......@@ -149,10 +149,6 @@ const FormDesigner = (props, ref) => {
}
const preview = () => {
// const errors = designerRef.current.getErrorFields()
// if (errors.length) {
// return message.error('请按照提示完善表单内容')
// }
let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json)
if (verify === true) {
......@@ -164,10 +160,6 @@ const FormDesigner = (props, ref) => {
}
const submit = async () => {
// const errors = designerRef.current.getErrorFields()
// if (errors.length) {
// return message.error('请按照提示完善表单内容')
// }
let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json)
if (verify === true) {
......@@ -182,10 +174,6 @@ const FormDesigner = (props, ref) => {
}
const initLayout = () => {
// const errors = designerRef.current.getErrorFields()
// if (errors.length) {
// return message.error('请按照提示完善表单内容')
// }
let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json)
if (verify === true) {
......
......@@ -35,7 +35,7 @@ const CheckBox = (props) => {
{
color ? <TagPack color={v.color} text={v.value} /> : v.value
}
</Checkbox >
</Checkbox>
)
} else {
children.push(<Checkbox key={v} value={v}>{v}</Checkbox>)
......
......@@ -4,7 +4,7 @@ import Drag from '../../../../components/Drag'
import { PlusOutlined } from '@ant-design/icons'
import { LoadTableFields, ReloadTableFields } from '../../../../../apis/process'
import styles from './index.less'
import { widgetData, getStyles } from '../../../../../constant/constant'
import { widgetData, getStyles } from '../../../../../constant'
const FieldNames = (props) => {
......
import React, { useMemo } from 'react'
import { Select } from 'antd'
import { widgetData, getStyles } from '../../../../../constant/constant'
import { widgetData, getStyles } from '../../../../../constant'
const WidgetType = (props) => {
......
......@@ -4,33 +4,7 @@ import { Switch, Input, Table, Form, Popconfirm, Popover } from 'antd'
import Drag from './../../../../components/Drag'
import DragTable from '../../../../components/DragTable'
import { CheckOutlined, DeleteOutlined, MenuOutlined } from '@ant-design/icons'
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)',
]
import { colors } from '../../../../../constant'
const SimpleList = (props) => {
......
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