Commit 49e0265b authored by 田翔's avatar 田翔

feat: 区域任务优化

parent 991d2820
{
"name": "panda-xform",
"version": "6.7.1",
"description": "6.7.1 区域任务增加前端显示字段配置",
"version": "6.7.2",
"description": "6.7.2 区域任务优化",
"keywords": [
"panda-xform"
],
......
......@@ -650,6 +650,20 @@ export function GetAreaLayerTaskData(data) {
})
}
//
export function GetCaseGISAreaData(data) {
return request({
headers: {
'Content-Type': 'application/json',
accept: 'text/plain',
'Server-Name': data?.mapServerName || localStorage.getItem('PipenetLayer') || '',
},
url: `PandaGIS/MapServer/GIS/Query/GetCaseGISAreaData`,
method: 'get',
params: data,
})
}
//通过图层获取字段
export function GetLayerFields({ mapServer, layerName }) {
return request({
......
......@@ -15,7 +15,13 @@ import {
} from '@wisdom-map/arcgismap'
import Drag from '../../../components/Drag'
import { isJson, isObject, getNanoid, mercatorToLngLat } from '../../../../utils'
import { FetchAreaList, GetAreaLayerTaskData, GetAccountConfigInfo, GetAccountPageList } from '../../../../apis/process'
import {
FetchAreaList,
GetAreaLayerTaskData,
GetAccountConfigInfo,
GetAccountPageList,
GetCaseGISAreaData,
} from '../../../../apis/process'
const getRings = (rings) => {
rings = rings.map(ring => {
......@@ -31,6 +37,7 @@ const getRings = (rings) => {
const AreaTask = (props) => {
console.log('props', props)
const codes = window?.pandaXform?.codes || { 工单编号: '', 事件编号: '', }
const userID = window?.globalConfig?.userInfo?.OID || 1;
const { token, client } = window.globalConfig
......@@ -40,12 +47,15 @@ const AreaTask = (props) => {
disabled,
placeholder,
presetValue,
tableName,
tableNameParent,
addressSync,
screenShot,
service,
layerName,
areaTaskShine,
accountName,
fieldList,
} = schema
const [visible, setVisible] = useState(false)
const [rings, setRings] = useState({})
......@@ -57,6 +67,7 @@ const AreaTask = (props) => {
const [loading, setLoading] = useState(false)
const [config, setConfig] = useState({ accountFieids: [], formJson: '' })
const { accountFieids, formJson } = config
const [isGIS, setIsGIS] = useState(false)
const [dataSource, setDataSource] = useState([])
const [layerCount, setLayerCount] = useState([])
const viewRef = useRef(null)
......@@ -100,19 +111,15 @@ const AreaTask = (props) => {
const columns = useMemo(() => {
let array = []
if (accountFieids.length) {
accountFieids.forEach(v => {
if (v.webDisplay === 1) {
array.push({ title: v.fieldName, dataIndex: v.fieldName, key: v.fieldName })
}
fieldList?.forEach(v => {
array.push({
title: v.fieldAliasName,
dataIndex: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
key: isGIS ? v.fieldName : `${v.fieldType}-${v.fieldName}`,
})
} else {
areaTaskShine?.forEach(v => {
array.push({ title: v.toField, dataIndex: v.toField, key: v.toField })
})
}
return array
}, [areaTaskShine, accountFieids])
}, [isGIS, fieldList])
const onSelect = (value, areaList) => {
setSelectedKeys(value)
......@@ -282,7 +289,7 @@ const AreaTask = (props) => {
}
values.push({ fieldName: s.toField, fieldValue: obj[s.toField] })
})
array.push(obj)
array.push({ ...v, ...obj })
items.push({
type: 'add',
accountTable: accountName,
......@@ -292,6 +299,7 @@ const AreaTask = (props) => {
})
window.relationForm = { configs: [{ ...schema, '台账名称': schema.accountName, '映射字段': [{ fromField: '工单编号', toField: '工单编号' }] }], data: items }
setDataSource(array)
setIsGIS(true)
} else {
message.error(msg)
}
......@@ -334,20 +342,22 @@ const AreaTask = (props) => {
const getDataSource = async (presetValue) => {
let params = {
user: userID,
condition: '',
accountName: accountName,
sortFields: '录入时间',
direction: 'desc',
timeField: '录入时间',
pageIndex: 0,
pageSize: 0,
queryWheres: [{ field: '工单编号', type: '等于', value: codes['工单编号'] }],
mapServerName: service,
caseNo: codes['工单编号'],
feedbackTableName: tableName,
caseTableName: tableNameParent,
// sortFields: '录入时间',
// direction: 'desc',
// timeField: '录入时间',
// pageIndex: 0,
// pageSize: 0,
// queryWheres: [{ field: '工单编号', type: '等于', value: codes['工单编号'] }],
}
if (!codes['工单编号']) return
const { code, data, msg } = await GetAccountPageList(params)
const { code, data, msg } = await GetCaseGISAreaData(params)
if (code === 0) {
let tableData = data?.jsonData ? JSON.parse(data?.jsonData) : []
setDataSource(tableData)
setDataSource(data)
setIsGIS(false)
}
}
......@@ -399,8 +409,9 @@ const AreaTask = (props) => {
return (
<div className={styles.AreaTask}>
<div className={styles.areaTitle}>{titleShow}</div>
<div className={styles.areaBox}>
<div className={styles.areaHeader}>
<div className={styles.areaTitle}>{titleShow}:</div>
<div className={styles.areaInput}>
{
!disabled ?
......@@ -425,6 +436,7 @@ const AreaTask = (props) => {
</Button>
}
</div>
</div>
<div className={styles.areaTable}>
<Table
size='small'
......
@import '~antd/es/style/themes/default.less';
.AreaTask {
width: 100%;
.areaTitle {
text-align: center;
padding-bottom: 5px;
}
.areaBox {
width: 100%;
.areaHeader {
display: flex;
align-items: center;
.areaTitle {
padding-right: 10px;
}
.areaInput {
width: 100%;
flex: 1;
}
}
.areaTable {
.@{ant-prefix}-table-thead>tr {
height: 40px;
th {
font-weight: bold;
overflow: inherit;
user-select: none;
/* Chrome and Opera */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
border-right: 1px solid #dbe7fb !important;
border-bottom: 1px solid #dbe7fb;
background: white;
}
// .areaTable {}
th:last-child {
border-left: 1px solid #dbe7fb;
}
}
.@{ant-prefix}-table-tbody>tr {
&:nth-child(2n-1) {
td {
background: #f6f9fe;
}
}
td {
border-bottom: 1px solid #dbe7fb;
border-right: 1px solid #dbe7fb !important;
&:last-child {
border-left: 1px solid #dbe7fb;
}
}
&:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) {
td {
background: rgb(237, 242, 255) !important;
}
}
}
.@{ant-prefix}-table-body {
overflow-x: scroll;
&::-webkit-scrollbar {
width: 0;
height: 12px;
}
&::-webkit-scrollbar {
width: 0;
height: 6px;
}
&::-webkit-scrollbar-thumb {
background: rgb(41, 166, 255);
}
&::-webkit-scrollbar-track {
background: #f7f4f5;
padding: 0 3px;
}
}
}
}
}
......
......@@ -40,7 +40,7 @@ const TaskFieldList = (props) => {
if (!service || !layerName || !tableName) {
return message.error('请配置字段映射中的配置')
}
setGISCheck(value?.filter(v => v.fieldType === 'GIS').map(v => v.fieldName) || [])
setGISCheck(value?.filter(v => v.fieldType === 'gis').map(v => v.fieldName) || [])
setAccCheck(value?.filter(v => v.fieldType === '台账').map(v => v.fieldName) || [])
getGISField()
getAccountField()
......@@ -59,7 +59,7 @@ const TaskFieldList = (props) => {
let array = []
GISCheck?.forEach(v => {
let fieldAliasName = GISField.find(s => s.fieldName === v)?.fieldAliasName || v
array.push({ fieldName: v, fieldAliasName: fieldAliasName, fieldType: 'GIS', })
array.push({ fieldName: v, fieldAliasName: fieldAliasName, fieldType: 'gis', })
})
AccCheck?.forEach(v => {
let fieldAliasName = AccountField.find(s => s.name === v)?.alias || v
......@@ -71,7 +71,7 @@ const TaskFieldList = (props) => {
return (
<div>
<Input value={value ? JSON.stringify(value) : ''} onClick={inputClick} />
<Input value={value?.map(v => v.fieldName)?.join(',')} onClick={inputClick} />
<Drag
title='前端显示字段'
onOk={onOk}
......
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