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

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

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