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

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

parent 401771cf
{
"name": "panda-xform",
"version": "6.9.5",
"description": "6.9.5 列表查看设备传参只读",
"version": "6.9.8",
"description": "6.9.8 区域任务控件增加操作列",
"keywords": [
"panda-xform"
],
......
......@@ -101,7 +101,6 @@ const XRender = (props, ref) => {
displayType: schemaForm.displayType === 'column' ? 'column' : 'row',//未知原因出现存储'左右'/'上下'
properties: parentObj
}
console.log('json', json)
setInitField(array)
return json
}, [formJson, values, disabledFields, disabled])
......
......@@ -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
}, [isGIS, fieldList, formJson])
}, [isGIS, fieldList, formJson, disabled, dataSource])
const onSelect = (value, areaList) => {
setSelectedKeys(value)
......@@ -187,6 +203,37 @@ const AreaTask = (props) => {
}, 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) => {
setRings(isJson(value) ? JSON.parse(value) : '')
viewRef.current = viewObject
......@@ -463,7 +510,7 @@ const AreaTask = (props) => {
<div className={styles.areaTable}>
<Table
size='small'
rowKey='ID'
rowKey={disabled ? 'gis-设备编号' : 'ID'}
bordered
columns={columns}
dataSource={dataSource}
......
......@@ -36,9 +36,10 @@ const Device = (props) => {
const [put, setPut] = useState(true)
let clickref = useRef(null)
let view = useRef(null)
const isSendQueryRef = useRef(false)
const getView = (mapObj, Map, extentInfos, layersInfo) => {
setTimeout(() => {
if (mapObj && layersInfo && !isSendQueryRef.current) {
let gisCode = ''
let gisLayerName = ''
let values = addons?.getValues()
......@@ -117,7 +118,8 @@ const Device = (props) => {
}
})
}
}, 500)
isSendQueryRef.current = true
}
}
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