Commit caa773cb authored by 田翔's avatar 田翔

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

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