Commit dcb3c812 authored by 田翔's avatar 田翔

fix: bug修复

parent 1c3fa31e
{
"name": "panda-xform",
"version": "4.7.5",
"description": "4.7.5 台账列表优化",
"version": "4.7.6",
"description": "4.7.6 关联表单,批量删除,关联选择BUG修复,新增表单内嵌地图",
"keywords": [
"panda-xform"
],
......
......@@ -17,7 +17,7 @@ const SearchGroup = forwardRef((props, ref) => {
getQueryInfo,
}))
const { accountName, config, notUse, checkName, btnsClick } = props
const { accountName, config, notUse, checkName, btnsClick, keys } = props
const { enableBatchOperation, enableImportExport, enablePrint, enableQuickSearch, enableTimeFilter, parent } = config
const [form] = Form.useForm()
const [dateArray, setDateArray] = useState([])
......@@ -156,7 +156,7 @@ const SearchGroup = forwardRef((props, ref) => {
})
}
return array
}, [enableBatchOperation, notUse])
}, [enableBatchOperation, notUse, keys])
const uploadProps = {
action: `${window.location.origin}${'/PandaWorkFlow/WorkFlow/AccountManage/ImportAccountData'}`,
......
......@@ -320,6 +320,7 @@ const Account = (props, ref) => {
<SearchGroup
onChange={search}
btnsClick={btnsClick}
keys={keys}
accountName={accountName}
config={config}
notUse={notUse}
......
......@@ -2191,7 +2191,14 @@ const mapWidgets = [
title: '地址同步',
type: 'string',
widget: 'AddressSync',
description: '位置信息将会同步到下方字段中'
description: '位置信息将会同步到下方字段中',
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
required: {
title: '必填',
......@@ -2273,6 +2280,20 @@ const mapWidgets = [
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
// fieldshine: {
// title: '映射字段',
// name: '映射字段',
// type: 'array',
// widget: 'DeviceFieldshine',
// default: [],
// },
required: {
title: '必填',
type: 'boolean',
......@@ -2353,6 +2374,13 @@ const mapWidgets = [
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
required: {
title: '必填',
type: 'boolean',
......@@ -2433,6 +2461,13 @@ const mapWidgets = [
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
description: '只读情况下会显示缩略图'
},
required: {
title: '必填',
type: 'boolean',
......
......@@ -22,10 +22,6 @@ const FormDesigner = (props, ref) => {
))
const { tableName, extra } = props
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext)
const prefixCls = getPrefixCls('pandaXform')
const prefixClsPandaXform = getPrefixCls()
const [visible, setVisible] = useState(false)
const [schema, setSchema] = useState({})
const [fieldName, setFieldName] = useState([])
......
......@@ -140,7 +140,7 @@ const RelationForm = (props) => {
}
const deleteTableInfo = (r) => {
let listItem = { type: 'delete', accountTable: accountName, id: r.ID, values: getItem('delete', r) }
let listItem = { type: 'delete', accountTable: accountName, ID: r.ID, values: getItem('delete', r) }
let relationForm = addons.getValue('relationForm') || { configs: [], data: [] }
if (r.ID.includes('前端ID')) {
let list = relationForm.data.filter(v => v.ID !== r.ID)
......@@ -238,7 +238,7 @@ const RelationForm = (props) => {
return message.error('请按照提示完善表单内容')
}
let type = row.ID.includes('前端ID') ? 'add' : 'edit'
let itemData = { type, accountTable: accountName, id: row.ID, values: formValue }
let itemData = { type, accountTable: accountName, ID: row.ID, values: formValue }
if (formStateStr !== '添加') {
let array = []
if (Array.isArray(dataSource)) {
......@@ -262,7 +262,7 @@ const RelationForm = (props) => {
}, 0)
}
let relationForm = addons.getValue('relationForm') || { configs: [], data: [] }
let listArray = relationForm.data.filter(v => v.id !== itemData.id)
let listArray = relationForm.data.filter(v => v.ID !== itemData.ID)
listArray.push({ ...itemData })
addons.setValue('relationForm', { ...relationForm, data: listArray })
setVisible(false)
......
......@@ -19,18 +19,15 @@ const Coordinate = (props) => {
const { token, client } = window.globalConfig
const { value, onChange, schema, addons } = props
const { disabled, placeholder, presetValue, addressSync } = schema
const { disabled, placeholder, presetValue, addressSync, screenShot } = schema
const [layersConifg, setLayersConifg] = useState(() => {
const mapConfig = window.globalConfig.mapsettings?.layers || null
return { layers: mapConfig };
});
const [loading, setLoading] = useState(false)
const [visible, setVisible] = useState(false)
const [currentPointer, setCurrentPointer] = useState([])
const [initCoordinate, setInitCoordinate] = useState([])
const [currentPointerCoordinate, setCurrentPointerCoordinate] = useState([])
const [view, setView] = useState(null)
const [coordGetLayers, setCoordGetLayers] = useState(null)
const getView = (viewObject) => {
if (viewObject) {
......@@ -62,8 +59,9 @@ const Coordinate = (props) => {
})
}, 2000)
}
setCoordGetLayers(coordGetLayer);
getPoints(viewObject, coordGetLayer);
if (!disabled) {
getPoints(viewObject, coordGetLayer);
}
}
}
......@@ -145,7 +143,7 @@ const Coordinate = (props) => {
useEffect(() => {
if (addons) {
addons.setValueByPath(addons.dataPath, presetValue)
addons.setValueByPath(addons.dataPath, '12734143.782374073,3560622.6587929404')
} else {
onChange(presetValue)
}
......@@ -178,43 +176,58 @@ const Coordinate = (props) => {
onClick={showMap}
/>
:
<Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
onClick={() => {
if (value) {
showMap()
}
}}
!screenShot ? (
<Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
onClick={() => {
if (value) {
showMap()
}
}}
>
{value ? '查看位置' : '无位置信息'}
</Button>
) : null
}
{
screenShot && disabled ? (
<div style={{ width: '100%', height: '150px' }}>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
) : (
<Drag
width={'80%'}
title="选取坐标"
visible={visible}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true}
{...disabled ? { footer: null } : {}}
>
{value ? '查看位置' : '无位置信息'}
</Button>
<div style={{ height: '90%' }}>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
{
view ? <div style={{ width: '400px', position: 'absolute', right: '0', top: '25px' }}>
<AutoCompleteSearch areaName={getCityName()} view={view} />
</div> : ''
}
</div>
</Drag>
)
}
<Drag
width={'80%'}
title="选取坐标"
visible={visible}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true}
{...disabled ? { footer: null } : {}}
>
<div style={{ height: '90%' }}>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
{
view ? <div style={{ width: '400px', position: 'absolute', right: '0', top: '25px' }}>
<AutoCompleteSearch areaName={getCityName()} view={view} />
</div> : ''
}
</div>
</Drag>
</div>
)
......
......@@ -20,7 +20,7 @@ const Device = (props) => {
const { token, client } = window.globalConfig
const { addons, value, onChange, schema } = props
const { placeholder, disabled, parent, presetValue } = schema
const { placeholder, disabled, parent, presetValue, screenShot, fieldshine } = schema
const [visible, setVisible] = useState(false)
let clickref = useRef(null)
let view = useRef(null)
......@@ -116,7 +116,7 @@ const Device = (props) => {
if (presetValue) {
geometrystr = presetValue
}
addons.setValueByPath(addons.dataPath, presetValue)
addons.setValueByPath(addons.dataPath, '12734114.051643973,3560550.07264259')
} else {
onChange(presetValue)
}
......@@ -134,7 +134,7 @@ const Device = (props) => {
addonAfter={disabled ? null : <CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} onClick={iconClick} />}
style={{ width: '100%' }}
/> :
<Button
!screenShot ? <Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
onClick={() => {
if (value) {
......@@ -143,28 +143,41 @@ const Device = (props) => {
}}
>
{value ? '查看设备' : '无设备信息'}
</Button>
</Button> : null
}
<Drag
visible={visible}
title='设备选择'
width={'80%'}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
getContainer={true}
{...disabled ? { footer: null } : {}}
>
<ArcGISSceneMap
getMapInfo={getMapInfo}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</Drag>
</div>
{
screenShot && disabled ? (
<div style={{ width: '100%', height: '120px' }}>
<ArcGISSceneMap
getMapInfo={getMapInfo}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
) : (
<Drag
visible={visible}
title='设备选择'
width={'80%'}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
getContainer={true}
{...disabled ? { footer: null } : {}}
>
<ArcGISSceneMap
getMapInfo={getMapInfo}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</Drag>
)
}
</div >
)
}
......
......@@ -21,7 +21,7 @@ const DrawArea = (props) => {
const { token, client } = window.globalConfig
const { value, onChange, schema, addons } = props
const { disabled, placeholder, presetValue, addressSync } = schema
const { disabled, placeholder, presetValue, addressSync, screenShot } = schema
const [visible, setVisible] = useState(false)
const [rings, setRings] = useState({})
const viewRef = useRef(null)
......@@ -31,7 +31,7 @@ const DrawArea = (props) => {
setTimeout(() => {
if (isJson(value)) {
let layer = new Graphic({
geometry: geomUtils.toGeometry(rings),
geometry: geomUtils.toGeometry(JSON.parse(value)),
symbol: new SimpleFillSymbol({
}),
......@@ -44,6 +44,7 @@ const DrawArea = (props) => {
}
const getView = (viewObject) => {
setRings(isJson(value) ? JSON.parse(value) : '')
viewRef.current = viewObject
createPaths(viewObject)
}
......@@ -78,7 +79,6 @@ const DrawArea = (props) => {
}
const showMap = () => {
setRings(isJson(value) ? JSON.parse(value) : '')
setVisible(true)
}
......@@ -93,7 +93,7 @@ const DrawArea = (props) => {
useEffect(() => {
if (addons) {
addons.setValueByPath(addons.dataPath, presetValue)
addons.setValueByPath(addons.dataPath, "{\"rings\":[[[12734029.232350387,3560655.9516569674],[12734035.439494528,3560554.380207394],[12734178.203809762,3560611.373076321],[12734168.046664804,3560614.758791307]]]}")
} else {
onChange(presetValue)
}
......@@ -112,7 +112,7 @@ const DrawArea = (props) => {
onClick={showMap}
/>
:
<Button
!screenShot ? <Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
onClick={() => {
if (value) {
......@@ -121,36 +121,49 @@ const DrawArea = (props) => {
}}
>
{value ? '查看位置' : '无位置信息'}
</Button>
</Button> : null
}
<Drag
width={'80%'}
title="选取坐标"
visible={visible}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true}
{...disabled ? { footer: null } : {}}
>
<div style={{ height: '90%' }}>
<Button
style={{ position: 'absolute', zIndex: '99', right: '10px', top: '10px' }}
type='primary'
onClick={start}
{
screenShot && disabled ? (
<div style={{ width: '100%', height: '150px' }}>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
) : (
<Drag
width={'80%'}
title="选取坐标"
visible={visible}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true}
{...disabled ? { footer: null } : {}}
>
开始绘制
</Button>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
</Drag >
<div style={{ height: '90%' }}>
<Button
style={{ position: 'absolute', zIndex: '99', right: '10px', top: '10px' }}
type='primary'
onClick={start}
>
开始绘制
</Button>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
</Drag >
)
}
</div >
)
......
......@@ -20,7 +20,7 @@ const DrawPath = (props) => {
const { token, client } = window.globalConfig
const { value, onChange, schema, addons } = props
const { disabled, placeholder, presetValue, addressSync } = schema
const { disabled, placeholder, presetValue, addressSync, screenShot } = schema
const [visible, setVisible] = useState(false)
const [paths, setPaths] = useState({})
const viewRef = useRef(null)
......@@ -30,7 +30,7 @@ const DrawPath = (props) => {
setTimeout(() => {
if (isJson(value)) {
let layer = new Graphic({
geometry: geomUtils.toGeometry(paths),
geometry: geomUtils.toGeometry(JSON.parse(value)),
symbol: new SimpleLineSymbol({
}),
......@@ -43,6 +43,7 @@ const DrawPath = (props) => {
}
const getView = (viewObject) => {
setPaths(isJson(value) ? JSON.parse(value) : '')
viewRef.current = viewObject
createPaths(viewObject)
}
......@@ -77,7 +78,6 @@ const DrawPath = (props) => {
}
const showMap = () => {
setPaths(isJson(value) ? JSON.parse(value) : '')
setVisible(true)
}
......@@ -111,7 +111,7 @@ const DrawPath = (props) => {
onClick={showMap}
/>
:
<Button
!screenShot ? <Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
onClick={() => {
if (value) {
......@@ -120,36 +120,49 @@ const DrawPath = (props) => {
}}
>
{value ? '查看位置' : '无位置信息'}
</Button>
</Button> : null
}
<Drag
width={'80%'}
title="选取坐标"
visible={visible}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true}
{...disabled ? { footer: null } : {}}
>
<div style={{ height: '90%' }}>
<Button
style={{ position: 'absolute', zIndex: '99', right: '10px', top: '10px' }}
type='primary'
onClick={start}
{
screenShot && disabled ? (
<div style={{ width: '100%', height: '150px' }}>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
) : (
<Drag
width={'80%'}
title="选取坐标"
visible={visible}
onOk={onOk}
onCancel={onCancel}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: "auto", position: 'relative' }}
destroyOnClose={true}
{...disabled ? { footer: null } : {}}
>
开始绘制
</Button>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
</Drag >
<div style={{ height: '90%' }}>
<Button
style={{ position: 'absolute', zIndex: '99', right: '10px', top: '10px' }}
type='primary'
onClick={start}
>
开始绘制
</Button>
<ArcGISSceneMap
getMapInfo={getView}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
</Drag >
)
}
</div >
)
......
......@@ -179,8 +179,6 @@ const FileUpload = (props) => {
}
}, [presetValue])
console.log(imgVisible, showFile)
return (
<div className={styles.uploadBox}>
<Upload
......
......@@ -84,7 +84,7 @@ const ComboBox = (props) => {
if (Array.isArray(data)) {
let values = data.map(v => ({ stationID: v.stationID + '', stationName: v.stationName }))
setSite(values)
if (!value && !presetValue) {
if (!value && !presetValue && !disabled) {
onChange(values[0][isStoreID ? 'stationID' : 'stationName'])
}
} else {
......
......@@ -12,7 +12,7 @@ const RelevanceSelect = (props) => {
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
addons.setValue(addons.dataPath, presetValue || '')
} else {
onChange(presetValue)
}
......@@ -20,7 +20,7 @@ const RelevanceSelect = (props) => {
const selectChange = (value) => {
if (addons) {
onChange(value)
onChange(value || '')
}
}
......
import React, { useEffect, useState } from 'react'
import { Form, Space, TreeSelect, Button, Input, Modal, message } from 'antd'
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'
import styles from './index.less'
import { ReloadTableFields, QueryFields } from '../../../../../apis/process'
import Drag from '../../../../components/Drag'
const { TreeNode } = TreeSelect
const DeviceFieldshine = (props) => {
const { addons, onChange, value } = props
const { $id, accountName, tableNameParent } = addons.formData
const [form] = Form.useForm()
const [visible, setVisible] = useState(false)
const [fromField, setFromField] = useState([])
const [toField, setToField] = useState([])
const onOk = () => {
form
.validateFields()
.then((values) => {
const { field } = form.getFieldsValue()
if (field.length !== 1) {
addons.setValue('isMultiple', false)
}
onChange(field)
setVisible(false)
})
.catch((info) => {
console.log('Validate Failed:', info)
})
}
const inputClick = async () => {
const { code, data } = await ReloadTableFields({ tableName: tableNameParent })
if (code === 0) {
setToField(data.root)
}
let field = value.length ? value : [{ fromField: 'GIS编码', toField: 'GIS编码' }, { fromField: 'GIS图层', toField: 'GIS图层' }]
form.setFieldsValue({ field })
setVisible(true)
}
return (
<div className={styles.fieldshine}>
<Input
value={value && value.length ? JSON.stringify(value) : null}
onClick={inputClick}
/>
<Drag
getContainer={false}
width='450px'
title='字段映射'
visible={visible}
onCancel={() => setVisible(false)}
onOk={onOk}
>
<Form name="dynamic_form_nest_item" form={form} autoComplete="off">
<Form.List name="field">
{(value, { add, remove }) => (
<>
{value.map(({ key, name, ...restField }, index) => (
<Space
key={key}
// style={{
// display: 'flex',
// marginBottom: '5px ',
// justifyContent: 'center',
// position: 'relative',
// left: index === 0 ? '-11px' : '',
// }}
align="baseline"
>
<Form.Item
{...restField}
name={[name, 'fromField']}
rules={[
{
required: true,
message: '来源字段必填',
}
]}
>
<TreeSelect
showSearch
style={{ width: '180px' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择字段名 "
allowClear
treeDefaultExpandAll
showCheckedStrategy
>
<TreeNode value={accountName} title={accountName} disabled>
{fromField.map(s => <TreeNode value={s} title={s} key={s} />)}
</TreeNode>
</TreeSelect>
</Form.Item>
<div className={styles.centerImg}></div>
<Form.Item
{...restField}
name={[name, 'toField']}
rules={[
{
required: true,
message: '目标字段必填',
},
{
validator: (rules, value, callback) => {
const { field } = form.getFieldsValue()
let toFields = Array.from(new Set([...field.map(v => v.toField)]))
if (toFields.length !== field.length) {
return Promise.reject('目标字段不能重复!')
}
return Promise.resolve()
}
}
]}
>
<TreeSelect
showSearch
style={{ width: '180px' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择字段名 "
allowClear
treeDefaultExpandAll
showCheckedStrategy
>
<TreeNode value={tableNameParent} title={tableNameParent} disabled>
{toField.map(s => <TreeNode value={s.name} title={s.name} key={s.name} />)}
</TreeNode>
</TreeSelect>
</Form.Item>
{/* {index !== 0 ? <MinusCircleOutlined onClick={() => remove(name)} /> : null} */}
</Space>
))}
{/* <Form.Item style={{ padding: '0 10px' }}>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
添加映射
</Button>
</Form.Item> */}
</>
)}
</Form.List>
</Form>
</Drag>
</div>
)
}
export default DeviceFieldshine
\ No newline at end of file
@imgSrc: '../../../../../assets/images/settting';
.fieldshine {
.centerImg {
width: 24px;
height: 24px;
background: url('@{imgSrc}/值映射.png');
background-size: 100% 100%;
position: relative;
top: 7px;
}
}
\ No newline at end of file
import Dictionary from './Dictionary'
import AccountName from './AccountName'
import Fieldshine from './Fieldshine'
import DeviceFieldshine from './DeviceFieldshine'
import GroupAndRole from './GroupAndRole'
import MappedField from './MappedField'
import ControlRules from './ControlRules'
......@@ -18,6 +19,7 @@ const groupSource = {
Dictionary,
AccountName,
Fieldshine,
DeviceFieldshine,
GroupAndRole,
MappedField,
ControlRules,
......
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