Commit 63ab328d authored by 涂伟's avatar 涂伟

fix: '新台账配置字段形态显示逻辑优化'

parent 26c7c7a6
Pipeline #72548 passed with stages
......@@ -26,7 +26,7 @@ import {
Ledger_QueryLedger,
Ledger_SaveLedger,
} from '@/services/standingBook/api';
import { getFieldInfo } from 'panda-xform';
// import { getFieldInfo } from 'panda-xform';
import ChangeAdd from './changeAdd';
import EditTable from './EditTable';
import styles from './BookConfigNew.less';
......@@ -194,6 +194,121 @@ const BookConfigNew = props => {
}
});
};
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;
};
const widgetData = {
TextInput: {
name: '文本',
type: '文本控件',
},
TextArea: {
name: '多行文本',
type: '文本控件',
},
NumberInput: {
name: '数值',
type: '文本控件',
},
RichText: {
name: '富文本',
type: '文本控件',
},
Coding: {
name: '编码',
type: '文本控件',
},
SearchLocation: {
name: '地址位置',
type: '文本控件',
},
ComboBox: {
name: '下拉框',
type: '选择器控件',
},
RadioButton: {
name: '单选框',
type: '选择器控件',
},
CheckBox: {
name: '复选框',
type: '选择器控件',
},
SwitchSelector: {
name: '开关按钮',
type: '选择器控件',
},
RelevanceSelect: {
name: '关联选择',
type: '选择器控件',
},
CascadeSelector: {
name: '联级选择',
type: '选择器控件',
},
PersonSelector: {
name: '人员选择',
type: '业务控件',
},
DeptSelector: {
name: '部门选择',
type: '业务控件',
},
AccountSelector: {
name: '台账选择',
type: '业务控件',
},
DateTime: {
name: '日期选择',
type: '时间控件',
},
Time: {
name: '时间选择',
type: '时间控件',
},
FileUpload: {
name: '附件',
type: '附件控件',
},
Coordinate: {
name: '地图坐标',
type: 'GIS控件',
},
DrawPath: {
name: '路径控件',
type: 'GIS控件',
},
DrawArea: {
name: '区域控件',
type: 'GIS控件',
},
Device: {
name: '设备选择',
type: 'GIS控件',
},
RelationForm: {
name: '关联表单',
type: '高级控件',
},
AutoCalculate: {
name: '自动计算',
type: '高级控件',
},
};
const isObject = obj => typeof obj === 'object';
// 切换表后数据处理为对应格式
const changTable = (value, editArr = []) => {
Ledger_ReloadLedgerFields({ tableName: value }).then(res => {
......@@ -365,8 +480,6 @@ const BookConfigNew = props => {
}
};
const isObject = obj => typeof obj === 'object';
return (
<Modal
title={`${type === 'add' ? '台账配置' : '台账编辑'}`}
......
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