Commit 218079eb authored by 田翔's avatar 田翔

fix: 区域任务控件增加操作列

parent 401771cf
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.9.5", "version": "6.9.8",
"description": "6.9.5 列表查看设备传参只读", "description": "6.9.8 区域任务控件增加操作列",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -101,7 +101,6 @@ const XRender = (props, ref) => { ...@@ -101,7 +101,6 @@ const XRender = (props, ref) => {
displayType: schemaForm.displayType === 'column' ? 'column' : 'row',//未知原因出现存储'左右'/'上下' displayType: schemaForm.displayType === 'column' ? 'column' : 'row',//未知原因出现存储'左右'/'上下'
properties: parentObj properties: parentObj
} }
console.log('json', json)
setInitField(array) setInitField(array)
return json return json
}, [formJson, values, disabledFields, disabled]) }, [formJson, values, disabledFields, disabled])
......
...@@ -134,8 +134,24 @@ const AreaTask = (props) => { ...@@ -134,8 +134,24 @@ const AreaTask = (props) => {
}) })
} }
}) })
if (disabled) {
array.push({
title: '操作',
dataIndex: '',
key: '',
width: 80,
render: (_, row, index) => {
if (row['台账-反馈状态'] === '已完成') {
return <Button type='link' onClick={() => rowChange('被驳回', row)}>驳回</Button>
}
if (row['台账-反馈状态'] === '被驳回') {
return <Button type='link' onClick={() => rowChange('已完成', row)}>取消</Button>
}
}
})
}
return array return array
}, [isGIS, fieldList, formJson]) }, [isGIS, fieldList, formJson, disabled, dataSource])
const onSelect = (value, areaList) => { const onSelect = (value, areaList) => {
setSelectedKeys(value) setSelectedKeys(value)
...@@ -187,6 +203,37 @@ const AreaTask = (props) => { ...@@ -187,6 +203,37 @@ const AreaTask = (props) => {
}, 2000) }, 2000)
} }
const rowChange = (type, row) => {
let array = []
let values = []
dataSource.forEach(v => {
array.push({ ...v, ['台账-反馈状态']: (v['台账-ID'] === row['台账-ID']) ? type : v['台账-反馈状态'] })
if (v['台账-ID'] === row['台账-ID']) {
values = [{ fieldName: '反馈状态', fieldValue: type }]
}
})
let item = {
type: 'edit',
accountTable: accountName,
ID: `${row['台账-ID']}`,
values: values
}
let newData = []
let oldData = window?.relationForm?.data || []
if (!oldData.some(v => v.ID === row['台账-ID'])) {
newData.push(item)
}
oldData.forEach(v => {
if (v.ID === row['台账-ID']) {
newData.push(item)
} else {
newData.push({ ...v })
}
})
window.relationForm = { configs: [{ ...schema, '台账名称': schema.accountName, '映射字段': [{ fromField: '工单编号', toField: '工单编号' }] }], data: newData }
setDataSource(array)
}
const getView = (viewObject) => { const getView = (viewObject) => {
setRings(isJson(value) ? JSON.parse(value) : '') setRings(isJson(value) ? JSON.parse(value) : '')
viewRef.current = viewObject viewRef.current = viewObject
...@@ -463,7 +510,7 @@ const AreaTask = (props) => { ...@@ -463,7 +510,7 @@ const AreaTask = (props) => {
<div className={styles.areaTable}> <div className={styles.areaTable}>
<Table <Table
size='small' size='small'
rowKey='ID' rowKey={disabled ? 'gis-设备编号' : 'ID'}
bordered bordered
columns={columns} columns={columns}
dataSource={dataSource} dataSource={dataSource}
......
...@@ -36,9 +36,10 @@ const Device = (props) => { ...@@ -36,9 +36,10 @@ const Device = (props) => {
const [put, setPut] = useState(true) const [put, setPut] = useState(true)
let clickref = useRef(null) let clickref = useRef(null)
let view = useRef(null) let view = useRef(null)
const isSendQueryRef = useRef(false)
const getView = (mapObj, Map, extentInfos, layersInfo) => { const getView = (mapObj, Map, extentInfos, layersInfo) => {
setTimeout(() => { if (mapObj && layersInfo && !isSendQueryRef.current) {
let gisCode = '' let gisCode = ''
let gisLayerName = '' let gisLayerName = ''
let values = addons?.getValues() let values = addons?.getValues()
...@@ -117,7 +118,8 @@ const Device = (props) => { ...@@ -117,7 +118,8 @@ const Device = (props) => {
} }
}) })
} }
}, 500) isSendQueryRef.current = true
}
} }
const getMapInfo = (mapObj, Map) => { const getMapInfo = (mapObj, Map) => {
......
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