Commit 1aaa36da authored by 田翔's avatar 田翔

fix: 区域任务优化

parent b512b8d8
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.9.10", "version": "6.9.13",
"description": "6.9.10 反馈状态标签优化", "description": "6.9.13 区域任务优化",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -26,6 +26,7 @@ const CoordView = (props) => { ...@@ -26,6 +26,7 @@ const CoordView = (props) => {
const { title, value, widget } = props const { title, value, widget } = props
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
let clickref = useRef(null) let clickref = useRef(null)
const isSendQueryRef = useRef(false)
let view = useRef(null) let view = useRef(null)
const btnText = useMemo(() => { const btnText = useMemo(() => {
...@@ -38,57 +39,65 @@ const CoordView = (props) => { ...@@ -38,57 +39,65 @@ const CoordView = (props) => {
} }
}, [widget]) }, [widget])
const getMapInfo = (mapObj, Map) => { const getMapInfo = (mapObj, Map, extentInfos, layersInfo) => {
setTimeout(() => { setTimeout(() => {
if (widget === 'Device') { if (widget === 'Device') {
view.current = mapObj if (mapObj && layersInfo && !isSendQueryRef.current) {
let arr = (value && value.split(',')) || [] view.current = mapObj
let obj = (arr.length === 2) ? { point: { x: Number(arr[0]), y: Number(arr[1]) } } : {} let arr = (value && value.split(',')) || []
if (arr.length === 2) { let obj = (arr.length === 2) ? { point: { x: Number(arr[0]), y: Number(arr[1]) } } : {}
view.current.goTo({ if (arr.length === 2) {
center: geomUtils.toGeometry({ x: Number(arr[0]), y: Number(arr[1]) }), view.current.goTo({
zoom: 15 center: geomUtils.toGeometry({ x: Number(arr[0]), y: Number(arr[1]) }),
}) zoom: 15
} })
clickref.current = new WorkFlowEquipmentQuery({ }
view: view.current, if (clickref.current) {
offsetX: -150, clickref.current?.closetip()
offsetY: -310, clickref.current = null
continuous: false, }
onlyWhatch: true, clickref.current = new WorkFlowEquipmentQuery({
...obj, view: view.current,
callback: ({ clickPoint, matchPoint, data }) => { offsetX: -150,
gisInfo = {} offsetY: -310,
if (layer) { continuous: false,
view.current.map.remove(layer) onlyWhatch: true,
} parentName: '设备选择',
if (matchPoint) { ...obj,
geometrystr = `${matchPoint.x},${matchPoint.y}` callback: ({ clickPoint, matchPoint, data }) => {
gisInfo = { layerName: data.layerName, gisCode: data.attributes.code } gisInfo = {}
} else if (clickPoint) { if (layer) {
geometrystr = `${clickPoint.x},${clickPoint.y}` view.current.map.remove(layer)
layer = new GraphicsLayer({ }
id: 'ok-layers', if (matchPoint) {
}) geometrystr = `${matchPoint.x},${matchPoint.y}`
if (geometrystr) { gisInfo = { layerName: data.layerName, gisCode: data.attributes.code }
const polypointGraphic = new Graphic({ } else if (clickPoint) {
geometry: geomUtils.toGeometry({ geometrystr = `${clickPoint.x},${clickPoint.y}`
x: Number(geometrystr.split(',')[0]), layer = new GraphicsLayer({
y: Number(geometrystr.split(',')[1]) id: 'ok-layers',
}),
symbol: {
type: "picture-marker",
url: point,
width: "20px",
height: "20px"
},
}) })
layer.add(polypointGraphic) if (geometrystr) {
view.current.map.add(layer) 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)
}
} }
} }
} })
}) isSendQueryRef.current = false
}
} else if (widget === 'Coordinate') { } else if (widget === 'Coordinate') {
let coordGetLayer = mapObj.map.layers.find(layer => layer.id == 'coordGet'); let coordGetLayer = mapObj.map.layers.find(layer => layer.id == 'coordGet');
if (coordGetLayer) { if (coordGetLayer) {
...@@ -173,7 +182,10 @@ const CoordView = (props) => { ...@@ -173,7 +182,10 @@ const CoordView = (props) => {
title={title} title={title}
width={'80%'} width={'80%'}
onOk={() => setVisible(false)} onOk={() => setVisible(false)}
onCancel={() => setVisible(false)} onCancel={() => {
setVisible(false)
isSendQueryRef.current = false
}}
cancelText={'取消'} cancelText={'取消'}
okText={'确定'} okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }} bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
......
...@@ -111,6 +111,25 @@ const AreaTask = (props) => { ...@@ -111,6 +111,25 @@ const AreaTask = (props) => {
}, [areaList, tab]) }, [areaList, tab])
const columns = useMemo(() => { const columns = useMemo(() => {
const addOther = (v) => {
array.push({
title: v.fieldAliasName,
dataIndex: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
key: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
render: (_, row) => {
if (!row['台账-反馈状态']) return null
let color = 'rgb(75, 172, 25)'
if (row['台账-反馈状态'] === '进行中') {
color = 'rgb(255, 169, 64)'
}
if (row['台账-反馈状态'] === '被驳回') {
color = 'rgb(255, 77, 79)'
}
return <TagPack color={color} text={row['台账-反馈状态']} />
}
})
}
let array = [] let array = []
let widgetInfo = {} let widgetInfo = {}
if (formJson) { if (formJson) {
...@@ -128,22 +147,7 @@ const AreaTask = (props) => { ...@@ -128,22 +147,7 @@ const AreaTask = (props) => {
} }
}) })
} else if (v.fieldType === '台账' && v.fieldName === '反馈状态') { } else if (v.fieldType === '台账' && v.fieldName === '反馈状态') {
array.push({ //统一最后一行添加
title: v.fieldAliasName,
dataIndex: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
key: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
render: (_, row) => {
if (!row['台账-反馈状态']) return null
let color = 'rgb(75, 172, 25)'
if (row['台账-反馈状态'] === '进行中') {
color = 'rgb(255, 169, 64)'
}
if (row['台账-反馈状态'] === '被驳回') {
color = 'rgb(255, 77, 79)'
}
return <TagPack color={color} text={row['台账-反馈状态']} />
}
})
} else { } else {
array.push({ array.push({
title: v.fieldAliasName, title: v.fieldAliasName,
...@@ -152,7 +156,8 @@ const AreaTask = (props) => { ...@@ -152,7 +156,8 @@ const AreaTask = (props) => {
}) })
} }
}) })
if (disabled) { addOther({ fieldAliasName: '反馈状态', fieldType: '台账', fieldName: '反馈状态' })
if (presetValue) {
array.push({ array.push({
title: '操作', title: '操作',
dataIndex: '', dataIndex: '',
...@@ -169,7 +174,7 @@ const AreaTask = (props) => { ...@@ -169,7 +174,7 @@ const AreaTask = (props) => {
}) })
} }
return array return array
}, [isGIS, fieldList, formJson, disabled, dataSource]) }, [isGIS, fieldList, formJson, presetValue, dataSource])
const onSelect = (value, areaList) => { const onSelect = (value, areaList) => {
setSelectedKeys(value) setSelectedKeys(value)
...@@ -466,34 +471,6 @@ const AreaTask = (props) => { ...@@ -466,34 +471,6 @@ const AreaTask = (props) => {
} }
}, [disabled, screenShot]) }, [disabled, screenShot])
if (screenShot && disabled && addons) {
return (
<div className={styles.drawAreaShot}>
<div className={styles.content}>
<div className={styles.top}>
<div className={styles.text}>{text}</div>
<div
className={styles.icon}
onClick={() => setPut(!put)}
style={{ transform: `rotate(${put ? 0 : 180}deg)` }}
>
<DownOutlined />
</div>
</div>
<div className={styles.mapBox} style={{ height: put ? '208px' : '0px' }}>
<ArcGISSceneMap
getMapInfo={getMapInfo}
widgets={[]}
token={token}
client={token ? client : 'sandbox'}
/>
</div>
</div>
</div>
)
}
return ( return (
<div className={styles.AreaTask}> <div className={styles.AreaTask}>
<div className={styles.areaBox}> <div className={styles.areaBox}>
...@@ -503,7 +480,7 @@ const AreaTask = (props) => { ...@@ -503,7 +480,7 @@ const AreaTask = (props) => {
绘制选择: 绘制选择:
</div> </div>
{ {
!disabled ? !disabled && !presetValue ? (
<Input <Input
disabled={disabled} disabled={disabled}
placeholder={disabled ? (placeholder || '') : (placeholder || '点击绘制区域')} placeholder={disabled ? (placeholder || '') : (placeholder || '点击绘制区域')}
...@@ -512,6 +489,7 @@ const AreaTask = (props) => { ...@@ -512,6 +489,7 @@ const AreaTask = (props) => {
style={{ flex: 1 }} style={{ flex: 1 }}
onClick={() => showMap()} onClick={() => showMap()}
/> />
)
: :
<Button <Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />} icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
......
...@@ -213,7 +213,6 @@ const Device = (props) => { ...@@ -213,7 +213,6 @@ const Device = (props) => {
const onOk = () => { const onOk = () => {
onChange(geometrystr) onChange(geometrystr)
console.log('fieldshine', fieldshine, gisInfo)
let { paths } = addons.getSchemaByPath('#') let { paths } = addons.getSchemaByPath('#')
if (Array.isArray(paths)) { if (Array.isArray(paths)) {
paths.forEach(v => { paths.forEach(v => {
...@@ -254,10 +253,12 @@ const Device = (props) => { ...@@ -254,10 +253,12 @@ const Device = (props) => {
} }
}) })
} }
isSendQueryRef.current = false
setVisible(false) setVisible(false)
} }
const onCancel = () => { const onCancel = () => {
isSendQueryRef.current = false
setVisible(false) setVisible(false)
} }
...@@ -337,6 +338,7 @@ const Device = (props) => { ...@@ -337,6 +338,7 @@ const Device = (props) => {
cancelText={'取消'} cancelText={'取消'}
okText={'确定'} okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }} bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
destroyOnClose
{...disabled ? { footer: null } : {}} {...disabled ? { footer: null } : {}}
> >
<ArcGISSceneMap <ArcGISSceneMap
......
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