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

fix: 区域任务优化

parent b512b8d8
{
"name": "panda-xform",
"version": "6.9.10",
"description": "6.9.10 反馈状态标签优化",
"version": "6.9.13",
"description": "6.9.13 区域任务优化",
"keywords": [
"panda-xform"
],
......
......@@ -26,6 +26,7 @@ const CoordView = (props) => {
const { title, value, widget } = props
const [visible, setVisible] = useState(false)
let clickref = useRef(null)
const isSendQueryRef = useRef(false)
let view = useRef(null)
const btnText = useMemo(() => {
......@@ -38,9 +39,10 @@ const CoordView = (props) => {
}
}, [widget])
const getMapInfo = (mapObj, Map) => {
const getMapInfo = (mapObj, Map, extentInfos, layersInfo) => {
setTimeout(() => {
if (widget === 'Device') {
if (mapObj && layersInfo && !isSendQueryRef.current) {
view.current = mapObj
let arr = (value && value.split(',')) || []
let obj = (arr.length === 2) ? { point: { x: Number(arr[0]), y: Number(arr[1]) } } : {}
......@@ -50,12 +52,17 @@ const CoordView = (props) => {
zoom: 15
})
}
if (clickref.current) {
clickref.current?.closetip()
clickref.current = null
}
clickref.current = new WorkFlowEquipmentQuery({
view: view.current,
offsetX: -150,
offsetY: -310,
continuous: false,
onlyWhatch: true,
parentName: '设备选择',
...obj,
callback: ({ clickPoint, matchPoint, data }) => {
gisInfo = {}
......@@ -89,6 +96,8 @@ const CoordView = (props) => {
}
}
})
isSendQueryRef.current = false
}
} else if (widget === 'Coordinate') {
let coordGetLayer = mapObj.map.layers.find(layer => layer.id == 'coordGet');
if (coordGetLayer) {
......@@ -173,7 +182,10 @@ const CoordView = (props) => {
title={title}
width={'80%'}
onOk={() => setVisible(false)}
onCancel={() => setVisible(false)}
onCancel={() => {
setVisible(false)
isSendQueryRef.current = false
}}
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
......
......@@ -111,6 +111,25 @@ const AreaTask = (props) => {
}, [areaList, tab])
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 widgetInfo = {}
if (formJson) {
......@@ -128,22 +147,7 @@ const AreaTask = (props) => {
}
})
} 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 {
array.push({
title: v.fieldAliasName,
......@@ -152,7 +156,8 @@ const AreaTask = (props) => {
})
}
})
if (disabled) {
addOther({ fieldAliasName: '反馈状态', fieldType: '台账', fieldName: '反馈状态' })
if (presetValue) {
array.push({
title: '操作',
dataIndex: '',
......@@ -169,7 +174,7 @@ const AreaTask = (props) => {
})
}
return array
}, [isGIS, fieldList, formJson, disabled, dataSource])
}, [isGIS, fieldList, formJson, presetValue, dataSource])
const onSelect = (value, areaList) => {
setSelectedKeys(value)
......@@ -466,34 +471,6 @@ const AreaTask = (props) => {
}
}, [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 (
<div className={styles.AreaTask}>
<div className={styles.areaBox}>
......@@ -503,7 +480,7 @@ const AreaTask = (props) => {
绘制选择:
</div>
{
!disabled ?
!disabled && !presetValue ? (
<Input
disabled={disabled}
placeholder={disabled ? (placeholder || '') : (placeholder || '点击绘制区域')}
......@@ -512,6 +489,7 @@ const AreaTask = (props) => {
style={{ flex: 1 }}
onClick={() => showMap()}
/>
)
:
<Button
icon={<CompassOutlined style={{ color: value ? '#0092fe' : 'rgba(0, 0, 0, 0.25)' }} />}
......
......@@ -213,7 +213,6 @@ const Device = (props) => {
const onOk = () => {
onChange(geometrystr)
console.log('fieldshine', fieldshine, gisInfo)
let { paths } = addons.getSchemaByPath('#')
if (Array.isArray(paths)) {
paths.forEach(v => {
......@@ -254,10 +253,12 @@ const Device = (props) => {
}
})
}
isSendQueryRef.current = false
setVisible(false)
}
const onCancel = () => {
isSendQueryRef.current = false
setVisible(false)
}
......@@ -337,6 +338,7 @@ const Device = (props) => {
cancelText={'取消'}
okText={'确定'}
bodyStyle={{ height: 600, overflowY: 'auto', position: 'relative' }}
destroyOnClose
{...disabled ? { footer: null } : {}}
>
<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