Commit d56a80c0 authored by 王万里's avatar 王万里

fix: 新增区域任务组件

parent f38a1746
{
"name": "panda-xform",
"version": "6.0.34",
"description": "6.0.34 自动计算逻辑修复",
"version": "6.0.35",
"description": "6.0.35 新增区域任务组件",
"keywords": [
"panda-xform"
],
......
......@@ -620,6 +620,36 @@ export function GetLayerList(serviceName) {
})
}
//获取多图层公共字段
export function GetLayersShareField({ mapServer, layerNames }) {
return request({
url: `PandaGIS/MapServer/MetaData/GetLayersShareField?mapServer=${mapServer}&layerNames=${layerNames}`,
method: 'get'
})
}
//获取分区
export function FetchAreaList({ userID, sourceType }) {
return request({
url: `PandaGIS/MapServer/PatrolInspection/FetchAreaList?userID=${userID}&sourceType=${sourceType}`,
method: 'get'
})
}
//获取图层区域数据(多图层查询)
export function GetAreaLayerTaskData(data) {
return request({
headers: {
'Content-Type': 'application/json',
accept: 'text/plain',
'Server-Name': data?.mapServerName || localStorage.getItem('PipenetLayer') || '',
},
url: `PandaGIS/MapServer/GIS/Query/GetAreaLayerTaskData`,
method: 'post',
data,
})
}
//通过图层获取字段
export function GetLayerFields({ mapServer, layerName }) {
return request({
......
......@@ -177,6 +177,10 @@ const widgetData = {
name: '设备选择',
type: 'GIS控件',
},
'AreaTask': {
name: '区域任务',
type: 'GIS控件',
},
'RelationForm': {
name: '关联表单',
type: '高级控件',
......
.content{
.content {
width: auto;
height: auto;
}
table {
border-collapse: collapse; /* 合并单元格边框 */
width: 100%;
}
th, td {
border-bottom: 1px solid #ddd; /* 添加底部边框 */
padding: 8px;
text-align: center;
font-size: 13px;
}
.headerLeft{
text-align: left !important;
font-weight: bold;
}
table {
border-collapse: collapse;
/* 合并单元格边框 */
width: 100%;
}
th,
td {
border-bottom: 1px solid #ddd;
/* 添加底部边框 */
padding: 8px;
text-align: center;
font-size: 13px;
}
.headerLeft {
text-align: left !important;
font-weight: bold;
}
.headerRight{
text-align: right !important;
font-weight: bold;
}
.headerTxt{
padding: 5px;
text-align: center;
font-size: 13px;
border: none !important;
span{
border-bottom: 1px solid gray;
.headerRight {
text-align: right !important;
font-weight: bold;
width: auto;
}
.headerTxt {
padding: 5px;
text-align: center;
font-size: 13px;
border: none !important;
span {
border-bottom: 1px solid gray;
font-weight: bold;
width: auto;
}
}
}
\ No newline at end of file
......@@ -2359,6 +2359,94 @@ const mapWidgets = [
},
},
},
{
text: '区域任务',
name: '区域任务',
icon: <IconPack.DrawArea />,
schema: {
title: '区域任务',
type: 'string',
widget: 'AreaTask',
placeholder: '',
width: '100%',
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
$id: {
title: '数据源',
type: 'string',
widget: 'FieldNames',
required: true,
},
title: {
title: '展示名称',
required: true,
type: 'string',
},
placeholder: {
title: '提示语',
type: 'string',
},
presetValue: {
title: '默认值',
type: 'string',
},
description: {
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
// screenShot: {
// title: '是否显示缩略图',
// type: 'boolean',
// widget: 'BooleanSwitch',
// default: false,
// description: '只读情况下会显示缩略图'
// },
areaTaskShine: {
title: '映射字段',
name: '映射字段',
type: 'array',
widget: 'AreaTaskShine',
default: [],
},
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '25%',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
width: {
title: '控件占比',
type: 'string',
widget: 'RadioGroupW',
},
},
},
]
const advancedWidgets = [
......
......@@ -319,7 +319,6 @@ const FormDesigner = (props, ref) => {
const testSubmit = async () => {
const { formValue, relationForm, errors } = await formRenderRef?.current?.getValues()
// console.log(formValue, relationForm)
if (errors.length) {
setTextShow(false)
return message.error('表单校验未通过!')
......
......@@ -125,10 +125,18 @@ const XRender = (props, ref) => {
})
}
})
let relForm = {
configs: data?.relationForm?.configs || [],
data: data?.relationForm?.data || []
}
return {
formValue,
errors,
relationForm: data.relationForm
relationForm: {
...data.relationForm,
configs: [...relForm.configs, ...window?.relationForm.configs],
data: [...relForm?.data, ...window?.relationForm.data],
},
}
}
......
This diff is collapsed.
.AreaTask {
width: 100%;
.areaBox {
width: 100%;
.areaInput {
width: 100%;
}
.areaTable {}
}
}
.AreaTaskMap {
width: 100%;
height: 100%;
.content {
width: 100%;
height: 100%;
position: relative;
display: flex;
}
.left {
width: 250px;
height: 100%;
padding: 10px;
.tabs {
display: flex;
border-bottom: 1px solid #f0f3f7;
.tab {
flex: 1;
text-align: center;
padding: 0 5px 5px 5px;
&[active='true'] {
color: #1685ff;
border-bottom: 2px solid #1685ff;
}
&:hover {
cursor: pointer;
}
}
}
.tabContent {
height: calc(100% - 30px);
padding: 10px 0;
overflow: auto;
}
}
.right {
position: relative;
width: calc(100% - 250px);
height: 100%;
}
}
\ No newline at end of file
......@@ -2,12 +2,14 @@ import Coordinate from './Coordinate'
import Device from './Device'
import DrawPath from './DrawPath'
import DrawArea from './DrawArea'
import AreaTask from './AreaTask'
const coord = {
Coordinate,
Device,
DrawPath,
DrawArea,
AreaTask,
}
export default coord
\ No newline at end of file
This diff is collapsed.
@imgSrc: '../../../../../assets/images/settting';
.fieldshine {
.centerImg {
width: 24px;
height: 24px;
background: url('@{imgSrc}/值映射.png');
background-size: 100% 100%;
position: relative;
top: 7px;
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import SqlFilter from './SqlFilter'
import OtherSource from './OtherSource'
import TemplateFile from './TemplateFile'
import AreaSync from './AreaSync'
import AreaTaskShine from './AreaTaskShine'
const groupSource = {
Dictionary,
......@@ -38,6 +39,7 @@ const groupSource = {
SqlFilter,
OtherSource,
TemplateFile,
AreaTaskShine,
}
export default groupSource
\ No newline at end of file
......@@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useState } from 'react'
import { Radio } from 'antd'
import styles from './index.less'
const TableNames = (props) => {
const RadioGroupW = (props) => {
let num = sessionStorage.getItem('RadioButtonValue') || 3
const { value, schema, onChange } = props
......@@ -53,7 +53,7 @@ const TableNames = (props) => {
{
options.map((v, i) => {
return (
<div style={{ flex: 1, marginLeft: i === 0 ? '0' : '-1px' }}>
<div key={i} style={{ flex: 1, marginLeft: i === 0 ? '0' : '-1px' }}>
<Radio.Button style={{ textAlign: 'center' }} value={v.value} key={i}>{v.label}</Radio.Button>
</div>
)
......@@ -67,4 +67,4 @@ const TableNames = (props) => {
}
export default TableNames
\ No newline at end of file
export default RadioGroupW
\ No newline at end of file
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