Commit e8e54763 authored by 彭俊龙's avatar 彭俊龙

feat:地图路径绘制加地图,数值框加校验

parent 0b114fb4
{
"name": "panda-xform",
"version": "6.10.84",
"description": "6.10.84 部门选择支持选择父级自动带入子级",
"version": "6.10.89",
"description": "6.10.89 数值输入新增最大值最小值校验",
"keywords": [
"panda-xform"
],
......
......@@ -24,7 +24,6 @@ const SearchGroup = forwardRef((props, ref) => {
const [dateArray, setDateArray] = useState([])
const [formatterStr, setFormatterStr] = useState('YYYY-MM-DD HH:mm:ss')
const [queryInfo, setQueryInfo] = useState({ info: '', timeFrom: '', timeTo: '' })
const searchShow = useMemo(() => {
return accountFieids.some(v => v.likeSearch)
}, [accountFieids])
......@@ -360,50 +359,38 @@ const SearchGroup = forwardRef((props, ref) => {
return (
<Row className={styles.controlRow}>
<Form layout={'inline'} form={form} onValuesChange={onValuesChange}>
{
enableTimeFilter ? (
<Form.Item label={`录入时间`} name="time" style={{ marginBottom: 0 }}>
<RangePicker
size="middle"
value={[...dateArray]}
locale={locale}
showTime={formatterStr === 'YYYY-MM-DD HH:mm:ss'}
ranges={{ ...rangerOptions }}
format={formatterStr}
style={{ width: 300 }}
/>
</Form.Item>
) : null
}
{
searchShow ? (
<Form.Item
label={getSearchLabel()}
name="info"
style={{ marginBottom: 0 }}
>
<Search
size="middle"
style={{
width: 320,
verticalAlign: 'middle',
marginLeft: '10px',
}}
placeholder="请输入值"
onSearch={onSearch}
/>
</Form.Item>
) : null
}
{
(enableTimeFilter || searchShow) ? (
<Form.Item style={{ marginBottom: 0 }}>
<Button type="primary" onClick={() => reset()}>
重置
</Button>
</Form.Item>
) : null
}
<Form.Item label={`录入时间`} name="time" style={{ marginBottom: 0 }}>
<RangePicker
size="middle"
value={[...dateArray]}
locale={locale}
showTime={formatterStr === 'YYYY-MM-DD HH:mm:ss'}
ranges={{ ...rangerOptions }}
format={formatterStr}
style={{ width: 300 }}
/>
</Form.Item>
<Form.Item
label={getSearchLabel()}
name="info"
style={{ marginBottom: 0 }}
>
<Search
size="middle"
style={{
width: 320,
verticalAlign: 'middle',
marginLeft: '10px',
}}
placeholder="请输入值"
onSearch={onSearch}
/>
</Form.Item>
<Form.Item style={{ marginBottom: 0 }}>
<Button type="primary" onClick={() => reset()}>
重置
</Button>
</Form.Item>
</Form>
{/* 按钮区域 */}
<div className={styles.controlRowRight}>
......
......@@ -93,6 +93,7 @@ const AccountSelectorCell = (props) => {
}
const getDataSource = async (outParams = {}) => {
debugger;
setLoading(true);
let param = {
...params,
......
......@@ -205,7 +205,7 @@ const ValueEdit = (props) => {
</div>
),
userName: v.userName,
value: v[property],
value: v[property] * 1,
groupName: v.groupName
}
}))
......@@ -280,7 +280,6 @@ const ValueEdit = (props) => {
disabled={disabled}
value={value === '' ? null : Number(value)}
onChange={(value) => {
onChange({ fieldName, fieldValue: value !== null ? `${value}` : '' })
if (autoArray.length) {
autoArray.forEach(v => {
if (v.fields.includes(fieldName)) {
......@@ -293,6 +292,8 @@ const ValueEdit = (props) => {
formAuto({ ...v, values }, otherChange)
}
})
}else{
onChange({ fieldName, fieldValue: value !== null ? `${value}` : '' })
}
}}
style={{ width: '100%' }}
......
......@@ -277,7 +277,6 @@ const TablePack = (props, ref) => {
fields.forEach(v => {
otherRow[v.fieldName] = v.fieldValue
})
console.log('otherRow', record, otherRow)
btnsClick({ type: '变化', row: { ...record, ...otherRow } })
} else {
......
......@@ -89,7 +89,13 @@ const RelationForm = (props) => {
if (Array.isArray(mappedField)) {
mappedField.forEach(s => {
if (s.toField === v) {
array.push({ fieldName: s.toField, fieldValue: getFieldValue(s, formDataObj, codes) })
let value = getFieldValue(s, formDataObj, codes)
if(s.fromField === '当前用户ID'){
value = userID
}else if(s.fromField === '当前用户名称'){
value = fullName
}
array.push({ fieldName: s.toField, fieldValue: value })
}
})
}
......@@ -166,9 +172,9 @@ const RelationForm = (props) => {
let formDataObj = getFormDataObj(addons?.formData)
mappedField.forEach(v => {
let value = codes[v.fromField] || formDataObj[v.fromField]
if(v.fromField === '用户ID'){
if(v.fromField === '当前用户ID'){
value = userID
}else if(v.fromField === '用户名称'){
}else if(v.fromField === '当前用户名称'){
value = fullName
}
queryWheres.push({ field: v.toField, type: '等于', value })
......@@ -324,6 +330,11 @@ const RelationForm = (props) => {
mappedField.forEach(s => {
if (s.toField === v) {
let value = getFieldValue(s, formDataObj, codes) || ''
if(v.fromField === '当前用户ID'){
value = userID
}else if(v.fromField === '当前用户名称'){
value = fullName
}
array.push({ fieldName: s.toField, fieldValue: value })
obj[s.toField] = value
}
......@@ -370,7 +381,7 @@ const RelationForm = (props) => {
}, })
if (code === 0) {
setDataSourceOther(data?.jsonData ? JSON.parse(data?.jsonData) : [])
setParamsOther({ ...paramsOther, total: data.totalCount })
setParamsOther({ ...paramsOther, total: data.totalCount, pageIndex: data.pageIndex, pageSize: data.pageSize })
}
setLoadingOther(false)
}
......@@ -396,6 +407,7 @@ const RelationForm = (props) => {
let items = []
let field = accountFieids.filter(v => v.webDisplay).map(v => v.fieldName)
dataSourceOther.forEach(v => {
if (keys.includes(v.ID)) {
let ID = `${getNanoid(10, '前端ID')}`
let values = []
......@@ -406,6 +418,11 @@ const RelationForm = (props) => {
mappedField.forEach(j => {
if (j.toField === s) {
let value = getFieldValue(j, formDataObj, codes) || ''
if(j.fromField === '当前用户ID'){
value = userID
}else if(j.fromField === '当前用户名称'){
value = fullName
}
values.push({ fieldName: s, fieldValue: value })
obj[s] = value
}
......
......@@ -61,17 +61,27 @@ const DrawPath = (props) => {
view.map.remove(layers.current)
drawTool.activate({
view,
action: 'polyline',
action: 'arrowsLine',
target: 'erroSendUpWidget',// 随便写
toolTip: '左键选择位置',
drawEnd: geometry => {
console.log(geometry, "1111111")
setPaths({ paths: geometry.paths })
let layer = new Graphic({
geometry: geometry,
symbol: new SimpleLineSymbol({
const graphic = drawTool.getDrawGraphic()
let symbol = new SimpleLineSymbol({
// color: "#ff0000",
width: 2
}),
});
if(graphic && graphic?.symbol){
symbol = graphic.symbol.clone()
}
let layer = new Graphic({
geometry: geometry,
symbol
// symbol: new SimpleLineSymbol({
// // color: "#ff0000",
// width: 2
// }),
// symbol: {
// type: "CIMLineSymbol",
// symbolLayers: [{
......
......@@ -96,7 +96,7 @@ const MappedField = (props) => {
showCheckedStrategy
>
<TreeNode value='内置字段' title='内置字段' disabled>
{['工单编号', '事件编号', '事件名称', '用户ID', '用户名称'].map(s => <TreeNode value={s} title={s} key={s} />)}
{['工单编号', '事件编号', '事件名称', '当前用户ID', '当前用户名称'].map(s => <TreeNode value={s} title={s} key={s} />)}
</TreeNode>
<TreeNode value='附加字段' title='附加字段' disabled>
{
......
......@@ -21,10 +21,54 @@ function formatMoney(number, places, symbol, thousand, decimal) {
j = (j = i.length) > 3 ? j % 3 : 0;
return symbol + negative + (j ? i.substr(0, j) + thousand : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousand) + (places ? decimal + Math.abs(number - i).toFixed(places).slice(2) : "");
}
const debounce = (fn) => {
let t = null
return function (e) {
const context = this
const args = arguments
if (t) {
clearTimeout(t)
}
t = setTimeout(function () {
fn.call(context, args)
}, 200)
}
}
const NumberInput = (props) => {
const { value, onChange, schema, addons } = props
const { disabled, presetValue, placeholder, prefix, formatter, decimalDigits, isStoreFormatter, addonBefore, addonAfter, min, max } = schema
//新增最大最小值校验
useEffect(()=>{
if (addons && (min || max) && value) {
let getValue = async (params) => {
const [rule, value, callback] = params
if(min){
if(Number(value) < Number(min)){
callback(new Error(`最小值不能小于${min}`))
}else{
callback()
}
}
if(max){
if(Number(value) > Number(max)){
callback(new Error(`最大值不能大于${max}`))
}else{
callback()
}
}
}
let uniqueRules = [
{
validator: debounce(getValue)
}
]
addons.setSchemaByPath(addons.dataPath, { ...schema, rules: uniqueRules })
}
}, [value])
useEffect(() => {
if (addons) {
......@@ -32,6 +76,7 @@ const NumberInput = (props) => {
} else {
onChange(presetValue)
}
}, [presetValue])
const numberChange = (value) => {
......@@ -41,6 +86,8 @@ const NumberInput = (props) => {
} else {
onChange('')
}
}
}
......
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