Commit caa773cb authored by 田翔's avatar 田翔

fix: 提供字段对应的形态方法

parent 11d92c10
{
"name": "panda-xform",
"version": "4.4.0",
"description": "4.4.0 台账列表站点过滤调整",
"version": "4.4.1",
"description": "4.4.1 提供字段对应的形态方法",
"keywords": [
"panda-xform"
],
......
......@@ -8,23 +8,7 @@ import FileView from './components/FileView'
import CoordView from './components/CoordView'
import SelectView from './components/SelectView'
import IconPack from '../../../components/IconPack'
import { isObject } from '../../../../utils'
const getFileInfo = (formJson) => {
let obj = {}
let parent = formJson?.properties
if (isObject(parent)) {
for (let v in parent) {
let child = parent[v]?.properties
if (isObject(child)) {
for (let s in child) {
obj[s] = child[s]
}
}
}
}
return obj
}
import { isObject, getFieldInfo } from '../../../../utils'
const TablePack = (props, ref) => {
......@@ -303,7 +287,7 @@ const TablePack = (props, ref) => {
}, [webShowFieldGroup, fieldList])
const fileColumns = useMemo(() => {
let json = getFileInfo(formJson)
let json = getFieldInfo(formJson)
let array = []
showField.forEach((v, i) => {
if (parent === '关联表单') {
......
import FormRender from './core/FormRender'
import FormDesigner from './core/FormDesigner'
import Account from './core/Account'
import { getFieldInfo } from './utils'
export {
FormRender,
FormDesigner,
Account,
getFieldInfo,
}
\ No newline at end of file
import React, { useState } from 'react';
import { message } from 'antd';
import { widgetData } from '../constant'
export function downloadFunc(url, name, target = '_self') {
const a = document.createElement('a');
......@@ -267,4 +268,21 @@ export const setFieldJson = (json, fieldName) => {
...json,
properties: parent,
}
}
//字段名对应的形态
export const getFieldInfo = (formJson) => {
let obj = {}
let parent = formJson?.properties
if (isObject(parent)) {
for (let v in parent) {
let child = parent[v]?.properties
if (isObject(child)) {
for (let s in child) {
obj[s] = { ...child[s], ...widgetData[child?.[s]?.widget] }
}
}
}
}
return obj
}
\ 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