Commit a8065391 authored by 田翔's avatar 田翔

fix: 关联表单增加前端显示字段余SQL过滤配置

parent 3ac025d0
{
"name": "panda-xform",
"version": "5.9.10",
"description": "5.9.10 隐藏的数据不提交",
"version": "5.9.11",
"description": "5.9.11 关联表单增加前端显示字段余SQL过滤配置",
"keywords": [
"panda-xform"
],
......
......@@ -2399,25 +2399,29 @@ const advancedWidgets = [
default: [],
dependencies: ['台账名称'],
},
fieldList: {
title: '前端显示字段',
type: 'array',
default: [],
widget: 'FieldList',
dependencies: ['accountName', '$id'],
description: '默认获取前端台账字段',
},
sql: {
title: 'SQL过滤',
name: 'SQL过滤',
type: 'string',
widget: 'SqlFilter',
props: {
placeholder: '示例:部门="XX部门"'
}
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition'
},
// '控制规则': {
// title: '控制规则',
// type: 'string',
// widget: 'ControlRules',
// },
// '默认显示': {
// title: '默认显示',
// type: 'boolean',
// widget: 'BooleanSwitch',
// default: true,
// displayType: 'row',
// labelWidth: 80,
// },
isEdit: {
title: '表格可编辑',
description: '表格字段变为可编辑与添加字段集',
......
......@@ -29,7 +29,18 @@ const RelationForm = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1
const codes = window?.pandaXform?.codes || { 工单编号: '', 事件编号: '', }
const { value, onChange, schema, addons } = props
const { disabled, '台账名称': accountName, '默认显示': defaultShow, '控制规则': controlShow, titleShow, '映射字段': mappedField, isEdit, otherSource } = schema
const {
disabled,
'台账名称': accountName,
'默认显示': defaultShow,
'控制规则': controlShow,
titleShow,
'映射字段': mappedField,
isEdit,
otherSource,
sql,
fieldList,
} = schema
const initParams = { user: userID, accountName: otherSource?.accountName, sortFields: '录入时间', direction: 'desc', total: 0, pageIndex: 1, pageSize: 100 }
const [config, setConfig] = useState({ accountFieids: [], webShowFieldGroup: '', fieldGroup: '', formJson: {} })
const [dataSource, setDataSource] = useState([])
......@@ -157,6 +168,7 @@ const RelationForm = (props) => {
if (!addons) return
let params = {
user: userID,
condition: sql ? window.btoa(encodeURIComponent(sql)) : '',
accountName: accountName,
direction: 'desc',
timeField: '录入时间',
......@@ -438,6 +450,7 @@ const RelationForm = (props) => {
dataSource={dataSource}
btnsClick={btnsClick}
isEdit={isEdit}
fieldList={fieldList}
otherSource={otherSource}
/>
</div>
......
......@@ -14,7 +14,7 @@ import {
const FieldList = (props) => {
const { value, addons, onChange } = props
const { accountName } = addons.formData
const accountName = addons.formData?.accountName || addons.formData?.['台账名称']
const [visible, setVisible] = useState(false)
const [conifg, setConfig] = useState({})
......
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