Commit 09ffa439 authored by 田翔's avatar 田翔

fix: 更新图片

parent 1e5565d9
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
"react-file-viewer": "^1.2.1", "react-file-viewer": "^1.2.1",
"react-sign2": "^0.0.3", "react-sign2": "^0.0.3",
"react-svg": "15.1.9", "react-svg": "15.1.9",
"viewerjs": "^1.11.3",
"viewerjs-react": "^1.0.2", "viewerjs-react": "^1.0.2",
"yarn": "^1.22.17" "yarn": "^1.22.17"
}, },
......
...@@ -78,6 +78,10 @@ const widgetData = { ...@@ -78,6 +78,10 @@ const widgetData = {
name: '编码', name: '编码',
type: '文本控件', type: '文本控件',
}, },
'SearchLocation': {
name: '地址位置',
type: '文本控件',
},
'ComboBox': { 'ComboBox': {
name: '下拉框', name: '下拉框',
type: '选择器控件', type: '选择器控件',
...@@ -142,10 +146,6 @@ const widgetData = { ...@@ -142,10 +146,6 @@ const widgetData = {
name: '设备选择', name: '设备选择',
type: 'GIS控件', type: 'GIS控件',
}, },
'SearchLocation': {
name: '地址位置',
type: 'GIS控件',
},
'RelationForm': { 'RelationForm': {
name: '关联表单', name: '关联表单',
type: '高级控件', type: '高级控件',
......
import React from 'react' import React, { useState, useRef } from 'react'
import styles from './index.less' import styles from './index.less'
import {
ArcGISSceneMap,
ClickQuery,
geomUtils,
GraphicsLayer,
Graphic,
Point,
} from '@wisdom-map/arcgismap/lib'
import Drag from '../../../../../components/Drag'
import point from '../../../../../../assets/images/cood/point.png'
let geometrystr = ''
let gisInfo = {}
let layer = 0
const CoordView = (props) => { const CoordView = (props) => {
const { value } = props const { token, client } = window.globalConfig
const { title, value, widget } = props
const [visible, setVisible] = useState(false)
let clickref = useRef(null)
let view = useRef(null)
const getMapInfo = (mapObj, Map) => {
setTimeout(() => {
if (widget === 'Device') {
view.current = mapObj
let arr = (value && value.split(',')) || []
let obj = (arr.length === 2) ? { point: { x: Number(arr[0]), y: Number(arr[1]) } } : {}
if (arr.length === 2) {
view.current.goTo({
center: geomUtils.toGeometry({ x: Number(arr[0]), y: Number(arr[1]) }),
zoom: 15
})
}
clickref.current = new ClickQuery({
view: view.current,
offsetX: -150,
offsetY: -310,
continuous: false,
...obj,
callback: ({ clickPoint, matchPoint, data }) => {
gisInfo = {}
if (layer) {
view.current.map.remove(layer)
}
if (matchPoint) {
geometrystr = `${matchPoint.x},${matchPoint.y}`
gisInfo = { layerName: data.layerName, gisCode: data.attributes.code }
} else if (clickPoint) {
geometrystr = `${clickPoint.x},${clickPoint.y}`
layer = new GraphicsLayer({
id: 'ok-layers',
})
if (geometrystr) {
const polypointGraphic = new Graphic({
geometry: geomUtils.toGeometry({
x: Number(geometrystr.split(',')[0]),
y: Number(geometrystr.split(',')[1])
}),
symbol: {
type: "picture-marker",
url: point,
width: "20px",
height: "20px"
},
})
layer.add(polypointGraphic)
view.current.map.add(layer)
}
}
}
})
} else if (widget === 'Coordinate') {
let coordGetLayer = mapObj.map.layers.find(layer => layer.id == 'coordGet');
if (coordGetLayer) {
mapObj.map.remove(coordGetLayer);
} else {
coordGetLayer = new GraphicsLayer({
id: 'coordGet',
});
}
mapObj.map.add(coordGetLayer);
if (value) {
coordGetLayer.removeAll();
const newVal = value.split(',');
const defalutGraphic = createGraphic(new Point({
x: newVal[0],
y: newVal[1],
spatialReference: {
wkid: 3857
}
}));
coordGetLayer.add(defalutGraphic);
setTimeout(() => {
mapObj.goTo({
center: geomUtils.toGeometry({ x: Number(newVal[0]), y: Number(newVal[1]) }),
scale: mapObj.scale - 1,
})
}, 2000)
}
} else if (widget === 'DrawPath') {
} else if (widget === 'DrawArea') {
}
}, 500)
}
const createGraphic = (geometry) => {
return new Graphic({
geometry: geometry,
symbol: {
type: "picture-marker", // autocasts as new PictureMarkerSymbol()
url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAhCAYAAAA2/OAtAAAACXBIWXMAAArrAAAK6wGCiw1aAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJl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P5Nedc5aPJqatbxhSbgVvGFD+cnFpwzqWbrNc5V3LOLebz+cqulROG4T9Hxx/rGVsvyeHKRs4hCPD7gw998N3g8B9N6d4Fbs3MzJTCMFSAjuUYhuFq7ang7+nlO6dQekRk7f3jU+9WxXiqWlbVn2dnZ5fCMGzp8Xtu65Hn/7jc3fv5kXL5zFJv38K65xtUi/Pz8zf3mttRFx8dmf4+4+kbk8dey+VyI/8J1lA2m03NDfR8m81mH/lfgA29N/pwbr9j77ctd/pn419SR9UArKBoRwAAAABJRU5ErkJggg==",
width: "20px",
height: "30px"
},
})
}
return ( return (
<div className={styles.coordView}>{value}</div> <div className={styles.coordView}>
<span onClick={() => setVisible(true)}>{value}</span>
<Drag
visible={visible}
title={title}
width={'80%'}
onOk={() => setVisible(false)}
onCancel={() => setVisible(false)}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
getContainer={true}
destroyOnClose
>
<ArcGISSceneMap
getMapInfo={getMapInfo}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</Drag>
</div>
) )
} }
......
.coordView {
&:hover {
cursor: pointer;
color: #1890ff;
}
}
\ No newline at end of file
import React from 'react' import React from 'react'
import styles from './index.less' import styles from './index.less'
import Viewer from 'viewerjs-react'
const FileView = (props) => { const FileView = (props) => {
...@@ -10,6 +11,7 @@ const FileView = (props) => { ...@@ -10,6 +11,7 @@ const FileView = (props) => {
if (!fileList) return null if (!fileList) return null
return ( return (
<div className={styles.fileView}> <div className={styles.fileView}>
<Viewer>
{ {
fileList.map(v => { fileList.map(v => {
return ( return (
...@@ -17,6 +19,7 @@ const FileView = (props) => { ...@@ -17,6 +19,7 @@ const FileView = (props) => {
) )
}) })
} }
</Viewer>
</div> </div>
) )
} }
......
...@@ -11,7 +11,7 @@ const TablePack = (props) => { ...@@ -11,7 +11,7 @@ const TablePack = (props) => {
return <FileView {...props} /> return <FileView {...props} />
} }
if (['Coordinate', 'Device', 'SearchLocation'].includes(widget)) { if (['Coordinate', 'Device', 'DrawPath', 'DrawArea'].includes(widget)) {
return <CoordView {...props} /> return <CoordView {...props} />
} }
......
...@@ -20,8 +20,7 @@ import FormRender from '../FormRender' ...@@ -20,8 +20,7 @@ import FormRender from '../FormRender'
const getFileInfo = (formJson) => { const getFileInfo = (formJson) => {
let obj = {} let obj = {}
let json = isJson(formJson) ? JSON.parse(formJson) : {} let parent = formJson?.properties
let parent = json?.properties
if (isObject(parent)) { if (isObject(parent)) {
for (let v in parent) { for (let v in parent) {
let child = parent[v]?.properties let child = parent[v]?.properties
...@@ -58,12 +57,6 @@ const Account = (props) => { ...@@ -58,12 +57,6 @@ const Account = (props) => {
const formRenderRef = useRef() const formRenderRef = useRef()
const searchInput = useRef(null) const searchInput = useRef(null)
// const handleSearch = (selectedKeys, confirm, dataIndex) => {
// confirm(selectedKeys[0], dataIndex);
// // setSearchText(selectedKeys[0]);
// // setSearchedColumn(dataIndex);
// }
const handleReset = (clearFilters, confirm) => { const handleReset = (clearFilters, confirm) => {
clearFilters() clearFilters()
confirm({ closeDropdown: true }) confirm({ closeDropdown: true })
......
...@@ -713,7 +713,87 @@ const textWidgets = [ ...@@ -713,7 +713,87 @@ const textWidgets = [
dependencies: ['tableTypeParent', 'IsSystemField'], dependencies: ['tableTypeParent', 'IsSystemField'],
}, },
}, },
} },
{
text: '地址',
name: '地址',
icon: <IconPack.SearchLocation />,
schema: {
title: '地址',
type: 'string',
widget: 'SearchLocation',
placeholder: '请输入地址',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
type: 'string',
required: true,
},
placeholder: {
title: '提示语',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
},
labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
type: 'number',
widget: 'slider',
max: 400,
props: {
hideNumber: true,
},
},
},
},
] ]
const selectWidgets = [ const selectWidgets = [
...@@ -2149,14 +2229,14 @@ const mapWidgets = [ ...@@ -2149,14 +2229,14 @@ const mapWidgets = [
}, },
}, },
{ {
text: '路径控件', text: '设备选择',
name: '路径控件', name: '设备选择',
icon: <IconPack.DrawPath />, icon: <IconPack.Device />,
schema: { schema: {
title: '路径控件', title: '设备选择',
type: 'string', type: 'string',
widget: 'DrawPath', widget: 'Device',
placeholder: '绘制地图路径', placeholder: '请选择设备',
}, },
setting: { setting: {
widget: { widget: {
...@@ -2229,14 +2309,14 @@ const mapWidgets = [ ...@@ -2229,14 +2309,14 @@ const mapWidgets = [
}, },
}, },
{ {
text: '区域控件', text: '路径控件',
name: '区域控件', name: '路径控件',
icon: <IconPack.DrawArea />, icon: <IconPack.DrawPath />,
schema: { schema: {
title: '区域控件', title: '路径控件',
type: 'string', type: 'string',
widget: 'DrawArea', widget: 'DrawPath',
placeholder: '绘制地图区域', placeholder: '绘制地图路径',
}, },
setting: { setting: {
widget: { widget: {
...@@ -2309,14 +2389,14 @@ const mapWidgets = [ ...@@ -2309,14 +2389,14 @@ const mapWidgets = [
}, },
}, },
{ {
text: '设备选择', text: '区域控件',
name: '设备选择', name: '区域控件',
icon: <IconPack.Device />, icon: <IconPack.DrawArea />,
schema: { schema: {
title: '设备选择', title: '区域控件',
type: 'string', type: 'string',
widget: 'Device', widget: 'DrawArea',
placeholder: '请选择设备', placeholder: '绘制地图区域',
}, },
setting: { setting: {
widget: { widget: {
...@@ -2388,86 +2468,6 @@ const mapWidgets = [ ...@@ -2388,86 +2468,6 @@ const mapWidgets = [
}, },
}, },
}, },
{
text: '地址位置',
name: '地址位置',
icon: <IconPack.SearchLocation />,
schema: {
title: '地址位置',
type: 'string',
widget: 'SearchLocation',
placeholder: '请输入位置',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
type: 'string',
required: true,
},
placeholder: {
title: '提示语',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '元素宽度',
type: 'string',
widget: 'percentSlider',
},
labelWidth: {
title: '标签宽度',
description: '默认值110',
default: 110,
type: 'number',
widget: 'slider',
max: 400,
props: {
hideNumber: true,
},
},
},
},
] ]
const advancedWidgets = [ const advancedWidgets = [
......
...@@ -2,14 +2,12 @@ import Coordinate from './Coordinate' ...@@ -2,14 +2,12 @@ import Coordinate from './Coordinate'
import Device from './Device' import Device from './Device'
import DrawPath from './DrawPath' import DrawPath from './DrawPath'
import DrawArea from './DrawArea' import DrawArea from './DrawArea'
import SearchLocation from './SearchLocation'
const coord = { const coord = {
Coordinate, Coordinate,
Device,
DrawPath, DrawPath,
DrawArea, DrawArea,
Device,
SearchLocation,
} }
export default coord export default coord
\ No newline at end of file
...@@ -3,6 +3,7 @@ import TextArea from './TextArea' ...@@ -3,6 +3,7 @@ import TextArea from './TextArea'
import NumberInput from './NumberInput' import NumberInput from './NumberInput'
import RichText from './RichText' import RichText from './RichText'
import Coding from './Coding' import Coding from './Coding'
import SearchLocation from './SearchLocation'
const text = { const text = {
TextInput, TextInput,
...@@ -10,6 +11,7 @@ const text = { ...@@ -10,6 +11,7 @@ const text = {
NumberInput, NumberInput,
RichText, RichText,
Coding, Coding,
SearchLocation,
} }
export default text export default text
\ No newline at end of file
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