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

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

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