Commit 9de6310e authored by 田翔's avatar 田翔

fix: 可编辑表格自动计算修复

parent 8d69570e
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "5.1.4", "version": "5.1.5",
"description": "5.1.4 预览pdf样式修改", "description": "5.1.5 可编辑表格自动计算修复",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
import React from 'react' import React, { useMemo } from 'react'
import { Tooltip } from 'antd' import { Tooltip } from 'antd'
const style = { const style = {
...@@ -11,12 +11,12 @@ const style = { ...@@ -11,12 +11,12 @@ const style = {
const Text = (props) => { const Text = (props) => {
const { text } = props const { text, align } = props
if (text && text.length > 10) { if (text && text.length > 10) {
return ( return (
<Tooltip title={text}> <Tooltip title={text}>
<div style={style}>{text}</div> <div style={{ ...style }}>{text}</div>
</Tooltip> </Tooltip>
) )
} }
......
...@@ -137,6 +137,7 @@ const ValueEdit = (props) => { ...@@ -137,6 +137,7 @@ const ValueEdit = (props) => {
return ( return (
<Input <Input
disabled={disabled} disabled={disabled}
style={{ color: loaclPaths.includes(presetValue) ? 'green' : '' }}
onChange={(e) => onChange({ fieldName, fieldValue: e.target.value })} onChange={(e) => onChange({ fieldName, fieldValue: e.target.value })}
value={value} value={value}
/> />
......
...@@ -44,7 +44,8 @@ const TablePack = (props, ref) => { ...@@ -44,7 +44,8 @@ const TablePack = (props, ref) => {
//台账列表、台账选择器表头 //台账列表、台账选择器表头
const getColumnProps = (json, v) => { const getColumnProps = (json, v) => {
const { fieldName, columnWidth, isSort, accurateSearch } = v console.log('v', v)
const { fieldName, columnWidth, isSort, accurateSearch, alignment } = v
const { widget, sourceType, options } = json?.[fieldName] || {} const { widget, sourceType, options } = json?.[fieldName] || {}
let searchProps = {} let searchProps = {}
if (accurateSearch) { if (accurateSearch) {
...@@ -122,6 +123,7 @@ const TablePack = (props, ref) => { ...@@ -122,6 +123,7 @@ const TablePack = (props, ref) => {
sortOrder: sortedInfo.field === fieldName ? sortedInfo.order : null, sortOrder: sortedInfo.field === fieldName ? sortedInfo.order : null,
filteredValue: filteredInfo[fieldName] || null, filteredValue: filteredInfo[fieldName] || null,
...searchProps, ...searchProps,
align: alignment === '中' ? 'center' : (alignment === '右' ? 'right' : 'left'),
onHeaderCell: (column) => ({ onHeaderCell: (column) => ({
width: column.width, width: column.width,
onResize: (e, props) => { onResize: (e, props) => {
...@@ -139,7 +141,7 @@ const TablePack = (props, ref) => { ...@@ -139,7 +141,7 @@ const TablePack = (props, ref) => {
if (['RadioButton', 'CheckBox'].includes(widget)) { if (['RadioButton', 'CheckBox'].includes(widget)) {
return <SelectView {...props} /> return <SelectView {...props} />
} }
return <Text text={value} /> return <Text align={alignment} text={value} />
}, },
} }
} }
......
...@@ -2,7 +2,7 @@ import { message } from 'antd' ...@@ -2,7 +2,7 @@ import { message } from 'antd'
import { isObject } from '../../utils' import { isObject } from '../../utils'
import { formAutomaticComputation, GetSelectItemList, formFieldHideComputation } from '../../apis/process' import { formAutomaticComputation, GetSelectItemList, formFieldHideComputation } from '../../apis/process'
export const debounce = (fn) => { export const debounce = (fn, wait = 300) => {
let t = null let t = null
return function (e) { return function (e) {
const context = this const context = this
...@@ -14,7 +14,7 @@ export const debounce = (fn) => { ...@@ -14,7 +14,7 @@ export const debounce = (fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
fn.call(context, ...args) fn.call(context, ...args)
} }
}, 300) }, wait)
} }
} }
......
...@@ -288,9 +288,8 @@ const RelationForm = (props) => { ...@@ -288,9 +288,8 @@ const RelationForm = (props) => {
let listArray = relationForm.data.filter(v => v.ID !== itemData.ID) let listArray = relationForm.data.filter(v => v.ID !== itemData.ID)
listArray.push(itemData) listArray.push(itemData)
addons?.setValue('relationForm', { ...relationForm, data: listArray }) addons?.setValue('relationForm', { ...relationForm, data: listArray })
setTimeout(() => { onChange(`${new Date().getTime()}`)
onChange(value && value.includes(' ') ? `${array.length}` : `${array.length} `) addons?.setValue(addons?.dataPath, `${array.length}`)
}, 0)
} else { } else {
rowClick(type, row) rowClick(type, row)
} }
......
...@@ -81,6 +81,8 @@ const OtherSource = (props) => { ...@@ -81,6 +81,8 @@ const OtherSource = (props) => {
} }
</Select> </Select>
</Form.Item> </Form.Item>
<Space align="baseline">
<div style={{ width: '60px' }}>字段映射:</div>
<Form.List name="field" label='字段映射'> <Form.List name="field" label='字段映射'>
{(value, { add, remove }) => ( {(value, { add, remove }) => (
<> <>
...@@ -92,7 +94,6 @@ const OtherSource = (props) => { ...@@ -92,7 +94,6 @@ const OtherSource = (props) => {
marginBottom: '5px', marginBottom: '5px',
justifyContent: 'center', justifyContent: 'center',
position: 'relative', position: 'relative',
left: index === 0 ? '-11px' : '',
}} }}
align='baseline' align='baseline'
> >
...@@ -171,6 +172,7 @@ const OtherSource = (props) => { ...@@ -171,6 +172,7 @@ const OtherSource = (props) => {
</> </>
)} )}
</Form.List> </Form.List>
</Space>
</Form> </Form>
</Drag> </Drag>
</div> </div>
......
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