Commit 8ec6f70d authored by 田翔's avatar 田翔

feat: 增加文本识别为台账功能

parent 0d649629
{
"name": "panda-xform",
"version": "6.0.39",
"description": "6.0.39 移出老版本富文本编辑器",
"version": "6.0.42",
"description": "6.0.42 增加文本识别为台账功能",
"keywords": [
"panda-xform"
],
......
......@@ -236,6 +236,16 @@ const textWidgets = [
description: '是否提供扫一扫功能(手持端专用)',
disabled: disabled,
},
isSweep: {
title: '是否识别台账',
type: 'boolean',
widget: 'BooleanSwitch',
default: false,
displayType: 'row',
labelWidth: 120,
description: '点击后可以直接查看台账数据(手持端专用)',
disabled: disabled,
},
groupStyle: {
title: '控件样式',
type: 'object',
......
......@@ -15,7 +15,7 @@ import {
} from '@wisdom-map/arcgismap'
import Drag from '../../../components/Drag'
import { isJson, isObject, getNanoid, mercatorToLngLat } from '../../../../utils'
import { FetchAreaList, GetAreaLayerTaskData, GetAccountPageList } from '../../../../apis/process'
import { FetchAreaList, GetAreaLayerTaskData, GetAccountConfigInfo, GetAccountPageList } from '../../../../apis/process'
const AreaTask = (props) => {
......@@ -43,6 +43,8 @@ const AreaTask = (props) => {
const [areaList, setAreaList] = useState([])
const [selectedKeys, setSelectedKeys] = useState([])
const [loading, setLoading] = useState(false)
const [config, setConfig] = useState({ accountFieids: [], formJson: '' })
const { accountFieids, formJson } = config
const [dataSource, setDataSource] = useState([])
const viewRef = useRef(null)
const layers = useRef(null)
......@@ -86,15 +88,19 @@ const AreaTask = (props) => {
const columns = useMemo(() => {
let array = []
areaTaskShine?.forEach(v => {
array.push({
title: v.toField,
dataIndex: v.toField,
key: v.toField,
if (accountFieids.length) {
accountFieids.forEach(v => {
if (v.webDisplay === 1) {
array.push({ title: v.fieldName, dataIndex: v.fieldName, key: v.fieldName })
}
})
} else {
areaTaskShine?.forEach(v => {
array.push({ title: v.toField, dataIndex: v.toField, key: v.toField })
})
})
}
return array
}, [areaTaskShine])
}, [areaTaskShine, accountFieids])
const onSelect = (value, areaList) => {
setSelectedKeys(value)
......@@ -259,18 +265,14 @@ const AreaTask = (props) => {
}
}
const getConfig = async () => {
const { code, data } = await GetAccountConfigInfo(accountName)
if (code === 0) {
setConfig(data)
}
}
const getDataSource = async (presetValue) => {
// let areaPolygon = ''
// if (!isNaN(presetValue)) {
// const { code, data } = await FetchAreaList({ userID: userID, sourceType: '管网巡检,DMA分区' })
// if (code === '0') {
// setAreaList(data)
// setSelectedKeys([Number(presetValue)])
// areaPolygon = data.find(v => v.id === Number(presetValue))?.areaPolygon
// }
// } else {
// areaPolygon = presetValue
// }
let params = {
user: userID,
condition: '',
......@@ -280,10 +282,9 @@ const AreaTask = (props) => {
timeField: '录入时间',
pageIndex: 0,
pageSize: 0,
// queryWheres: [{ field: '工单编号', type: '等于', value: codes['工单编号'] }],
queryWheres: [{ field: '工单编号', type: '等于', value: codes['工单编号'] }],
}
console.log('params', params)
// if (!codes['工单编号']) return
if (!codes['工单编号']) return
const { code, data, msg } = await GetAccountPageList(params)
if (code === 0) {
let tableData = data?.jsonData ? JSON.parse(data?.jsonData) : []
......@@ -295,6 +296,7 @@ const AreaTask = (props) => {
if (addons) {
addons.setValueByPath(addons.dataPath, presetValue)
if (presetValue) {
getConfig()
getDataSource(presetValue)
}
} else {
......@@ -390,11 +392,11 @@ const AreaTask = (props) => {
<Spin spinning={loading} tip="获取GIS数据中...">
<div className={styles.content}>
<div className={styles.left}>
<div className={styles.tabs}>
{/* <div className={styles.tabs}>
{
['一级', '二级', '三级'].map(v => <div className={styles.tab} active={`${v === tab}`} key={v} onClick={() => setTab(v)}>{v}</div>)
}
</div>
</div> */}
<div className={styles.tabContent}>
<Tree
defaultExpandAll
......
......@@ -168,8 +168,8 @@ const AreaTaskShine = (props) => {
}
onCancel={() => setVisible(false)}
>
<Form name="dynamic_form_nest_item" form={form} autoComplete="off">
<Form.Item label='台账名称' name='accountName' rules={[{ required: true, message: '台账名称必填', }]}>
<Form name="dynamic_form_nest_item" form={form} autoComplete="off" labelCol={{ span: 5 }}>
<Form.Item label='gis反馈台账' name='accountName' rules={[{ required: true, message: 'gis反馈台账必填', }]}>
<Select
showSearch
options={accountList.map(v => ({ label: v.name, value: v.name }))}
......
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