Commit d0a36583 authored by 田翔's avatar 田翔

fix: 控件优化

parent 922f8a6f
{
"name": "panda-xform",
"version": "6.9.25",
"description": "6.9.25 描述控件重新编辑报错问题",
"version": "6.10.0",
"description": "6.10.0 控件优化",
"keywords": [
"panda-xform"
],
......
import React, { useMemo, useState, forwardRef, useImperativeHandle, useRef } from 'react'
import { Table, Button, Popconfirm, Input, Space, Tag, Popover, Checkbox, Form } from 'antd'
import { TweenOneGroup } from 'rc-tween-one'
import styles from './index.less'
import { SearchOutlined, FormOutlined } from '@ant-design/icons'
import * as icons from '@ant-design/icons'
import ResizeableTitle from '../../../ResizeableTitle'
import FileView from '../../../FileView'
import CoordView from '../../../CoordView'
import SelectView from '../../../SelectView'
import IDCard from '../../../IDCard'
import DateView from '../../../DateView'
import NumberView from '../../../NumberView'
import Text from '../../../Text'
import { isObject, isArray, getFieldInfo } from '../../../../../../../../utils'
const IconBtn = (props) => {
return <div className={styles.iconBtn} type={props.type}></div>
}
const iconList = Object.keys(icons).filter((item) => typeof icons[item] === 'object')
const TablePack = (props, ref) => {
useImperativeHandle(ref, () => ({
setFilteredInfo,
setSortedInfo,
fileColumns,
}))
const { notUse, locale, config, fieldList, loading, dataSource, sourceChange, rowSelection, onRow, tableChange, btnsClick, isEdit } = props
const { accountFieids, webShowFieldGroup, formJson, parent } = config
const [fieldResize, setFieldResize] = useState({})
const [filteredInfo, setFilteredInfo] = useState({})
const [sortedInfo, setSortedInfo] = useState({})
const [open, setOpen] = useState(false)
const [checks, setChecks] = useState([])
const searchInput = useRef(null)
const [form] = Form.useForm()
const filtered = useMemo(() => {
let array = []
if (isObject(filteredInfo)) {
Object.keys(filteredInfo).forEach(v => {
if (Array.isArray(filteredInfo[v])) {
array.push({ filterName: v, filterValue: filteredInfo[v].join(',') })
}
})
}
return array
}, [filteredInfo])
//台账列表、台账选择器表头
const getColumnProps = (json, v) => {
const { fieldName, columnWidth, isSort, accurateSearch, alignment } = v
const { widget, sourceType, options, addonAfter } = json?.[fieldName] || {}
let searchProps = {}
if (accurateSearch) {
if (['CheckBox', 'ComboBox', 'RadioButton'].includes(widget)) {
if (sourceType === '手动输入') {
searchProps = {
filters: options.map(v => { return { text: v.value, value: v.value, } }),
}
}
} else {
searchProps = {
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => {
return (
<div
style={{ padding: 8 }}
onKeyDown={(e) => e.stopPropagation()}
>
<Input
placeholder={`搜索 ${fieldName}`}
value={selectedKeys[0]}
onChange={e => {
setSelectedKeys(e.target.value ? [e.target.value] : [])
}}
onPressEnter={() => {
confirm({ closeDropdown: true })
}}
style={{
marginBottom: 8,
display: 'block',
width: '280px',
}}
/>
<Space>
<Button
type="primary"
onClick={() => {
confirm({ closeDropdown: true })
}}
icon={<SearchOutlined />}
size="small"
style={{ width: 90 }}
>
搜索
</Button>
<Button
onClick={() => {
clearFilters()
confirm({ closeDropdown: true })
}}
size="small"
style={{ width: 90 }}
>
重置
</Button>
</Space>
</div>
)
},
filterIcon: (filtered) => (
<SearchOutlined
style={{
color: filtered ? '#1890ff' : undefined,
}}
/>
),
}
}
}
return {
title: (
<div className={styles.headerTitle}>
{json[fieldName]?.title || fieldName}
{addonAfter && !iconList.includes(addonAfter) ? `(${addonAfter})` : null}
</div>
),
dataIndex: fieldName,
width: fieldResize[fieldName] || columnWidth || 120,
ellipsis: true,
sorter: Boolean(isSort),
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) => {
setFieldResize({ ...fieldResize, [fieldName]: props?.size?.width })
},
}),
render: (value, record) => {
let props = { ...json[fieldName], value }
if (widget === 'FileUpload') {
return <FileView {...props} />
}
if (['Coordinate', 'Device', 'DrawPath', 'DrawArea'].includes(widget)) {
return <CoordView {...props} />
}
if (['RadioButton', 'CheckBox', 'ComboBox'].includes(widget)) {
return <SelectView {...props} />
}
if (['DateTime'].includes(widget)) {
return <DateView {...props} />
}
if (['NumberInput'].includes(widget)) {
return <NumberView {...props} />
}
if (widget === 'IDCard') {
return <IDCard {...props} />
}
return <Text align={alignment} text={value} />
},
}
}
//关联表单表头
const getRelevanceColumnProps = ({ json, field, isEdit, autoArray, accountFieids }) => {
const { fieldName, columnWidth, isSort, accurateSearch, alignment } = field
const { widget } = json?.[fieldName] || {}
let searchProps = {}
if (accurateSearch) {
searchProps = {
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => (
<div
style={{ padding: 8 }}
onKeyDown={(e) => e.stopPropagation()}
>
<Input
ref={searchInput}
placeholder={`Search ${fieldName}`}
value={selectedKeys[0]}
onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => {
confirm();
}}
style={{
marginBottom: 8,
display: 'block',
}}
/>
<Space>
<Button
type="primary"
onClick={() => {
confirm();
}}
icon={<SearchOutlined />}
size="small"
style={{
width: 90,
}}
>
搜索
</Button>
<Button
onClick={() => {
clearFilters();
confirm();
}}
size="small"
style={{
width: 90,
}}
>
重置
</Button>
</Space>
</div>
),
filterIcon: (filtered) => (
<SearchOutlined
style={{
color: filtered ? '#1890ff' : undefined,
}}
/>
),
onFilter: (value, record) =>
record[fieldName].toString().toLowerCase().includes(value.toLowerCase()),
onFilterDropdownOpenChange: (visible) => {
if (visible) {
setTimeout(() => searchInput.current?.select(), 100);
}
},
}
}
return {
title: json[fieldName]?.title || fieldName,
dataIndex: fieldName,
width: fieldResize[fieldName] || columnWidth || 120,
ellipsis: true,
sorter: Boolean(isSort) ? (a, b) => a[fieldName] - b[fieldName] : false,
filteredValue: filteredInfo[fieldName] || null,
...searchProps,
align: alignment === '中' ? 'center' : (alignment === '右' ? 'right' : 'left'),
onHeaderCell: (column) => ({
width: column.width,
onResize: (e, props) => {
setFieldResize({ ...fieldResize, [fieldName]: props?.size?.width })
},
}),
render: (value, record) => {
let props = {
...json[fieldName],
fieldName,
value,
autoArray,
disabled: !accountFieids?.some(v => v.fieldName === fieldName && v.isEdit),
record: { ...record },
}
if (['FileUpload'].includes(widget)) {
return <FileView {...props} />
}
if (['Coordinate', 'Device', 'DrawPath', 'DrawArea'].includes(widget)) {
return <CoordView {...props} />
}
if (['RadioButton', 'CheckBox', 'ComboBox'].includes(widget)) {
return <SelectView {...props} />
}
if (['DateTime'].includes(widget)) {
return <DateView {...props} />
}
if (['NumberInput'].includes(widget)) {
return <NumberView {...props} />
}
return <Text text={value} />
},
}
}
const btns = useMemo(() => {
let array = []
//表格可编辑
if (isEdit) {
if (!notUse?.includes('del')) {
array.push({ title: '删除', icon: <IconBtn type='删除' /> })
}
} else {
if (!notUse?.includes('read')) {
array.push({ title: '详情', icon: <IconBtn type='详情' /> })
}
if (!notUse?.includes('edit')) {
array.push({ title: '编辑', icon: <IconBtn type='编辑' /> })
}
if (!notUse?.includes('del')) {
array.push({ title: '删除', icon: <IconBtn type='删除' /> })
}
}
return array
}, [notUse, isEdit])
const checkChange = (values) => {
setChecks(values)
}
const showField = useMemo(() => {
let showField = []
accountFieids.forEach(v => {
if (isArray(fieldList)) {
if (fieldList.includes(v.fieldName)) {
showField.push(v)
}
} else {
if (v.webDisplay) {
showField.push(v)
}
}
})
setChecks(showField.map(v => v.fieldName))
return showField
}, [accountFieids, fieldList])
const fileColumns = useMemo(() => {
let json = getFieldInfo(formJson)
let autoArray = []
Object.keys(json).forEach(key => {
let item = json[key]
if (item.widget === 'NumberInput') {
if (item.calculateRule) {
let parmas = {
fields: item?.rules[0]?.fields,
tableName: item.tableNameParent,
filedFormulas: [
{
fieldName: key,
formula: item.calculateRule
}
]
}
autoArray.push(parmas)
}
}
})
let array = []
showField.forEach((v, i) => {
if (parent === '关联表单') {
// array.push(getRelevanceColumnProps(json, v, isEdit))
array.push(getRelevanceColumnProps({ json, field: v, isEdit, autoArray, accountFieids }))
} else {
array.push(getColumnProps(json, v))
}
})
return array
}, [parent, formJson, showField, fieldResize, filteredInfo, sortedInfo, isEdit, dataSource, accountFieids])
const showColumns = useMemo(() => {
return fileColumns.filter(v => checks.includes(v.dataIndex))
}, [checks, fileColumns])
const content = (
<div>
<Checkbox.Group
value={checks}
style={{ width: '100%' }}
onChange={checkChange}
>
{
fileColumns.map(v => {
return (
<div key={v.dataIndex}>
<Checkbox value={v.dataIndex}>{v.title}</Checkbox>
</div>
)
})
}
</Checkbox.Group>
</div>
)
const columns = useMemo(() => {
let columns = [
{
title: '序号',
width: 50,
align: 'center',
filteredValue: null,
render: (_, r, i) => i + 1
},
...showColumns,
]
if (btns.length) {
columns.push(
{
title: (
<div className={styles.operation}>
<span>操作</span>
<span className={styles.operationSpan}>
<Popover
placement='bottomRight'
title={
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>列配置</div>
<Button size='small' type="link" onClick={() => setOpen(false)}>确定</Button>
</div>
}
trigger='click'
open={open}
content={content}
onOpenChange={(value) => {
setOpen(value)
}}
arrowPointAtCenter
>
{
fileColumns.length ? <FormOutlined /> : null
}
</Popover>
</span>
</div>
),
width: btns.length * 35 + 30,
align: 'center',
filteredValue: null,
fixed: 'right',
render: (r) => {
return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
{
btns.map(v => {
if (v.title === '删除') {
return (
<Popconfirm
key={v.title}
title='确定要删除数据吗?'
onConfirm={() => btnsClick({ type: v.title, row: r })}
okText='确定'
cancelText='取消'
>
<Button
type='link'
title='删除'
style={{ padding: '0 7px' }}
icon={v.icon}
/>
</Popconfirm>
)
}
return (
<Button
key={v.title}
type='link'
title={v.title}
icon={v.icon}
style={{ padding: '0 7px' }}
onClick={() => btnsClick({ type: v.title, row: r })}
>
</Button>
)
})
}
</div>
)
}
}
)
}
if (parent === '台账选择器') {
return fileColumns
}
return columns
}, [parent, btns, dataSource, fileColumns, checks, open])
const onChange = (page, filters, sorter) => {
setFilteredInfo(filters)
setSortedInfo(sorter)
tableChange?.(page, filters, sorter)
}
const closeTag = (e, { filterName, filterValue }) => {
e.preventDefault()
let filtered = {}
for (let key in filteredInfo) {
if (key === filterName) {
filtered[key] = null
} else {
filtered[key] = filteredInfo[key]
}
}
setFilteredInfo(filtered)
tableChange?.({}, filtered, sortedInfo)
}
return (
<div className={styles.tablePack} style={{ paddingTop: filtered.length ? '30px' : '10px' }}>
{
filtered.length ? (
<div className={styles.condition}>
<TweenOneGroup
enter={{
scale: 0.8,
opacity: 0,
type: 'from',
duration: 200,
}}
onEnd={(e) => {
if (e.type === 'appear' || e.type === 'enter') {
e.target.style = 'display: inline-block';
}
}}
leave={{
opacity: 0,
width: 0,
scale: 0,
duration: 200,
}}
appear={false}
>
{
filtered.map(v => {
return (
<span
key={v.filterName}
style={{ display: 'inline-block' }}
>
<Tag
color='blue'
closable
onClose={(e) => closeTag(e, v)}
>
<span>{v.filterName}</span>
<span style={{ padding: '0 3px' }}>:</span>
<span>{v.filterValue}</span>
</Tag>
</span>
)
})
}
</TweenOneGroup>
</div>
) : null
}
<Form form={form} component={false}>
<Table
size='small'
rowKey='ID'
bordered
loading={loading}
columns={columns}
dataSource={dataSource}
rowSelection={rowSelection}
onRow={onRow}
pagination={parent === '关联表单' ? { total: dataSource.length, showTotal: (value) => `总计 ${value} 条` } : false}
scroll={{ x: '100%', y: 'calc(100% - 61px)' }}
onChange={onChange}
locale={locale}
components={{
header: {
cell: ResizeableTitle
},
}}
/>
</Form>
</div>
)
}
export default forwardRef(TablePack)
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
@imgSrc: '../../../../../../../../assets/images/accout';
.tablePack {
width: 100%;
height: 100%;
position: relative;
transition: all 0.5s ease;
.condition {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 30px;
display: flex;
align-items: center;
}
.operation {
.operationSpan {
margin-left: 10px;
display: inline-block;
&:hover {
cursor: pointer;
color: #1890ff;
}
}
}
.headerTitle {
width: 100%;
overflow: hidden;
word-spacing: normal;
text-overflow: ellipsis;
}
.@{ant-prefix}-table-wrapper {
height: 100%;
.@{ant-prefix}-spin-nested-loading {
height: 100%;
}
.@{ant-prefix}-spin-container {
height: 100%;
}
.@{ant-prefix}-table {
height: 100%;
.@{ant-prefix}-table-container {
height: 100%;
}
}
}
.@{ant-prefix}-table.@{ant-prefix}-table-bordered>.@{ant-prefix}-table-container {
border-left: 1px solid #dbe7fb;
.ant-table-header>table {
border-top: 1px solid #dbe7fb;
}
}
.@{ant-prefix}-table-thead>tr {
height: 40px;
th {
font-weight: bold;
overflow: inherit;
user-select: none;
/* Chrome and Opera */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
border-right: 1px solid #dbe7fb !important;
border-bottom: 1px solid #dbe7fb;
background: white;
}
th:last-child {
border-left: 1px solid #dbe7fb;
}
}
.@{ant-prefix}-table-tbody>tr {
&:nth-child(2n-1) {
td {
background: #f6f9fe;
}
}
td {
border-bottom: 1px solid #dbe7fb;
border-right: 1px solid #dbe7fb !important;
&:last-child {
border-left: 1px solid #dbe7fb;
}
}
&:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) {
td {
background: rgb(237, 242, 255) !important;
}
}
}
.@{ant-prefix}-table-body {
overflow-x: scroll;
&::-webkit-scrollbar {
width: 0;
height: 12px;
}
&::-webkit-scrollbar {
width: 0;
height: 6px;
}
&::-webkit-scrollbar-thumb {
background: rgb(41, 166, 255);
}
&::-webkit-scrollbar-track {
background: #f7f4f5;
padding: 0 3px;
}
}
}
.iconBtn {
width: 16px;
height: 16px;
&[type='详情'] {
background: url('@{imgSrc}/详情.svg');
background-size: 100% 100%;
}
&[type='编辑'] {
background: url('@{imgSrc}/编辑.svg');
background-size: 100% 100%;
}
&[type='删除'] {
background: url('@{imgSrc}/删除.svg');
background-size: 100% 100%;
}
}
\ No newline at end of file
import React, { useState, useEffect, useRef, useMemo } from 'react'
import { Input, message, Pagination } from 'antd'
import { SnippetsOutlined } from '@ant-design/icons'
import { GetAccountConfigInfo, GetAccountPageList, getStationListByUserID, GetTableDataInfo } from '../../../../../../../apis/process'
import styles from './index.less';
import { isJson, isObject } from '../../../../../../../utils'
import MinTablePack from './MinTablePack'
import SearchGroup from '../../../../SearchGroup'
import Drag from '../../../../../../components/Drag'
const initConfig = {
accountFieids: [],
formJson: {},
enableBatchOperation: 0, //批量操作
enableImportExport: 0, //导入导出
enablePrint: 0, //打印
enableQuickSearch: 0, //快捷搜索
enableSiteFilter: 0, //站点过滤
enableTimeFilter: 0, //时间筛选
}
let defaultParams = {
sortFields: '录入时间',
direction: 'desc',
}
const AccountSelectorCell = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1
const codes = window?.pandaXform?.codes || { 工单编号: '', 事件编号: '', }
// const { value, onChange, schema, addons } = props
const {
value,
onChange,
disabled,
accountName,
fieldshine,
siteFilter,
sql,
isMultiple,
presetValue,
placeholder,
fieldList,
isStoreID,
} = props
const initParams = {
user: userID,
accountName,
extendQuery: {
caseNo: codes['工单编号']
},
total: 0,
pageIndex: 1,
pageSize: 100,
siteFilter,
...defaultParams,
}
const [showValue, setShowValue] = useState('')
const [params, setParams] = useState(initParams)
const [loading, setLoading] = useState(false)
const [dataSource, setDataSource] = useState([])
const [config, setConfig] = useState(initConfig)
const [visible, setVisible] = useState(false)
const [keys, setKeys] = useState([])
const tablePackRef = useRef(null)
const iconClick = () => {
if (!accountName) {
return message.info('请配置台账名称!')
}
if (!fieldshine.length) {
return message.info('请配置映射字段!')
}
setVisible(true)
getConfig()
}
const getConfig = async () => {
const { code, data } = await GetAccountConfigInfo(accountName);
if (code == 0) {
setConfig({ ...data, formJson: isJson(data.formJson) ? JSON.parse(data.formJson) : {} })
defaultParams = {
sortFields: data?.defaultSortFields || '录入时间',
direction: data?.sortOrder || 'desc',
}
let param = {
condition: data?.sqlFilter ? window.btoa(encodeURIComponent(data?.sqlFilter)) : '',
pageSize: data.pageSize || 20,
...defaultParams,
}
getDataSource(param)
}
}
const getDataSource = async (outParams = {}) => {
setLoading(true);
let param = {
...params,
user: userID,
accountName: accountName,
...outParams,
condition: sql ? window.btoa(encodeURIComponent(sql)) : (outParams.condition || params.condition || ''),
};
const { data, code, msg } = await GetAccountPageList(param);
if (code === 0) {
if (data.jsonData) {
let Data = JSON.parse(data.jsonData);
let dataKeys = dataSource.filter(v => keys.includes(v.ID))
let otherData = Data.filter(v => !keys.includes(v.ID))
setDataSource([...otherData, ...dataKeys]);
if (!keys.length) {
let valueArr = value ? value.split(',') : [];
let rows = Data.filter(v => valueArr.includes(v[fieldshine[0].fromField]));
setKeys(rows.map(v => v.ID));
}
setParams({ ...params, ...outParams, total: data.totalCount });
} else {
setDataSource([])
}
} else {
message.error(msg);
}
setLoading(false);
}
const tableChange = (page, filters, sorter) => {
let queryWheres = []
Object.keys(filters).forEach(k => {
if (filters[k]?.[0]) {
queryWheres.push({ field: k, type: '模糊查询', value: filters[k][0] })
}
})
let param = {
sortFields: sorter.order ? sorter.field : '录入时间',
direction: sorter.order !== 'ascend' ? 'desc' : 'asc',
queryWheres
}
setParams({ ...params, ...param })
getDataSource(param)
}
const rowClick = (row) => {
if (isMultiple) {
if (keys.includes(row.ID)) {
let values = keys.filter(v => v !== row.ID)
setKeys(values)
} else {
let values = [...keys, row.ID]
setKeys(values)
}
} else {
setKeys([row.ID]);
}
}
const formatterFn = ({ value, formatter, decimalDigits }) => {
if (value) {
if (formatter === '${百分比}') {
return `${value}%`
} else if (formatter === '${货币}') {
return formatMoney(Number(value), Number(decimalDigits))
} else if (formatter === '${整数}') {
return `${parseInt(value)}`
} else if (formatter === '${小数}') {
return Number(value).toFixed(Number(decimalDigits))
} else if (formatter === '${科学计数法}') {
return Number(value).toExponential()
} else if (formatter) {
return `${value}${formatter}`
}
}
return value
}
const getShowValue = (keys) => {
let array = []
if (keys.length) {
keys.forEach(v => {
array.push(GetTableDataInfo({ accountName: accountName, id: v, timeLimit: null }))
})
Promise.all(array).then(res => {
let showArray = []
res?.forEach(v => {
if (v.code === 0) {
v.data?.forEach(v => {
if (v.fieldName === fieldshine[0].fromField) {
showArray.push(v.fieldValue)
}
})
}
})
setShowValue(showArray.join(','))
})
}
}
const onOk = () => {
if (fieldshine.length > 1) {
let row = dataSource.find(v => v.ID === keys[0]) || {};
let array = []
fieldshine.forEach((v, index) => {
// if (isStoreID && index === 0) {
// array.push({ fieldName: v.toField, fieldValue: row[v.fromField] })
// getShowValue(keys)
// }
array.push({ fieldName: v.toField, fieldValue: (isStoreID && index === 0) ? (keys.join(',')) : row[v.fromField] })
})
onChange({ fields: array })
} else {
let array = dataSource.filter(v => keys.includes(v.ID))
let rowValues = array.map(v => v[fieldshine[0].fromField]).filter(v => v).join(',')
onChange({ fieldName: v[fieldshine[0].toField], fieldValue: isStoreID ? keys.join(',') : rowValues })
}
getShowValue(keys)
setVisible(false);
}
const search = (values) => {
setParams({ ...params, ...values })
getDataSource({ ...values })
}
const btnsClick = ({ type }) => {
if (type === '重置') {
tablePackRef.current.setFilteredInfo({})
setParams({ ...params, queryWheres: [] })
getDataSource({ queryWheres: [] })
}
}
useEffect(() => {
if (value && isStoreID) {
getShowValue(presetValue?.split(','))
}
}, [])
const pageChange = (pageIndex, pageSize) => {
getDataSource({ pageIndex, pageSize })
}
return (
<div className={styles.AccountSelector}>
<Input
placeholder={disabled ? (placeholder || '') : (placeholder || '点击选择台账')}
value={isStoreID ? showValue : value}
onClick={() => iconClick()}
disabled={disabled}
// allowClear
// onChange={e => {
// onChange('')
// setShowValue('')
// }}
/>
<Drag
onCancel={() => setVisible(false)}
onOk={onOk}
width='60%'
title={accountName}
visible={visible}
getContainer={false}
bodyStyle={{ height: 570, paddingBottom: 0 }}
>
<div className={styles.content}>
<div className={styles.top}>
<SearchGroup
onChange={search}
notUse={'edit,add,del'}
btnsClick={btnsClick}
config={{ ...config, parent: '台账选择器' }}
/>
</div>
<div className={styles.bottom}>
<MinTablePack
ref={tablePackRef}
loading={loading}
notUse={'edit,add,del'}
config={{ ...config, parent: '台账选择器' }}
dataSource={dataSource}
btnsClick={btnsClick}
fieldList={fieldList}
tableChange={tableChange}
rowSelection={{
type: isMultiple && fieldshine.length === 1 ? 'checkbox' : 'radio',
selectedRowKeys: keys,
fixed: 'left',
onChange: (keys) => setKeys(keys)
}}
onRow={record => ({
onClick: event => {
event.stopPropagation();
rowClick(record);
},
})}
/>
</div>
<div className={styles.footer}>
<div className={styles.total}>共计{params.total}条数据</div>
<div className={styles.pagination}>
<Pagination
size='small'
showQuickJumper
pageSize={params.pageSize}
current={params.pageIndex}
total={params.total}
onChange={pageChange}
/>
</div>
</div>
</div>
</Drag>
</div>
)
}
export default AccountSelectorCell
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
.AccountSelectorCell {
.content {
width: 100%;
height: 100%;
position: relative;
padding-bottom: 40px;
.top {
width: 100%;
height: 50px;
}
.bottom {
width: 100%;
height: calc(100% - 50px);
.@{ant-prefix}-table-wrapper {
height: 100%;
.@{ant-prefix}-spin-nested-loading {
height: 100%;
}
.@{ant-prefix}-spin-container {
height: 100%;
}
.@{ant-prefix}-table {
height: 100%;
.@{ant-prefix}-table-container {
height: 100%;
}
}
}
}
.footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.@{ant-prefix}-input-affix-wrapper-disabled {
background: #f8fafc;
border: none;
}
}
\ No newline at end of file
import React, { useEffect, useCallback } from 'react'
import { Input, InputNumber, DatePicker } from 'antd'
import { Input, InputNumber, DatePicker, Select } from 'antd'
import locale from 'antd/lib/date-picker/locale/zh_CN'
import moment from 'moment'
import { debounce } from '../../../../../../utils'
import { formAutomaticComputation } from '../../../../../../apis/process'
import AccountSelectorCell from './AccountSelectorCell'
const initUserInfo = {
fullName: '【本人姓名】',
......@@ -40,6 +41,9 @@ const ValueEdit = (props) => {
disabled,
placeholder,
widget,
isMultiple,
sourceType,
options,
format,
min,
max,
......@@ -69,6 +73,24 @@ const ValueEdit = (props) => {
}
}, [])
if (widget === 'AccountSelector') {
return <AccountSelectorCell {...props} />
}
if (['CheckBox', 'ComboBox', 'RadioButton'].includes(widget) && sourceType === '手动输入') {
return (
<Select
value={value}
style={{ width: '100%' }}
mode={isMultiple ? 'multiple' : ''}
onChange={(value) => onChange({ fieldName, fieldValue: value })}
placeholder={`请输入${fieldName}`}
options={options?.map(v => ({ label: v.value, value: v.value }))}
allowClear
/>
)
}
if (widget === 'DateTime') {
const isValid = value ? moment(value)._isValid : false
const timeOtions = format === 'dateTime' ?
......
......@@ -266,9 +266,20 @@ const TablePack = (props, ref) => {
return (
<ValueEdit
{...props}
onChange={({ fieldName, fieldValue }) => {
btnsClick({ type: '变化', row: { ...record, [fieldName]: fieldValue } })
onChange={({ fieldName, fieldValue, fields }) => {
if (fields?.length) {
let otherRow = {}
fields.forEach(v => {
otherRow[v.fieldName] = v.fieldValue
})
console.log('otherRow', record, otherRow)
btnsClick({ type: '变化', row: { ...record, ...otherRow } })
} else {
btnsClick({ type: '变化', row: { ...record, [fieldName]: fieldValue } })
}
}}
// batchChange=
otherChange={(otherRow) => {
btnsClick({ type: '变化', row: { ...record, ...otherRow } })
}}
......@@ -364,7 +375,6 @@ const TablePack = (props, ref) => {
let array = []
showField.forEach((v, i) => {
if (parent === '关联表单') {
// array.push(getRelevanceColumnProps(json, v, isEdit))
array.push(getRelevanceColumnProps({ json, field: v, isEdit, autoArray, accountFieids }))
} else {
array.push(getColumnProps(json, v))
......
@import '~antd/es/style/themes/default.less';
@imgSrc: '../../assets/images/accout';
.account {
width: 100%;
height: 100%;
padding: 10px;
background: white;
.tableRender {
width: 100%;
height: 100%;
.content {
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
.left {
width: 236px;
height: 100%;
margin-right: 14px;
position: relative;
transition: all 0.3s ease-out;
.t-header {
overflow: hidden;
font-size: 15px;
......@@ -25,6 +32,7 @@
padding: 5px 10px;
color: #1890ff;
}
.shrink {
position: absolute;
right: -14px;
......@@ -32,33 +40,40 @@
transform: translateY(-50%);
height: 100px;
width: 14px;
&:hover {
cursor: pointer;
}
&[type='true'] {
background: url('@{imgSrc}/show_true.png');
background-size: 100% 100%;
}
&[type='false'] {
background: url('@{imgSrc}/show_false.png');
background-size: 100% 100%;
}
}
}
.right {
transition: all 0.3s ease-out;
width: calc(100% - 250px);
height: 100%;
padding-bottom: 50px;
position: relative;
.top {
width: 100%;
height: 40px;
}
.bottom {
width: 100%;
height: calc(100% - 50px);
}
.footer {
position: absolute;
bottom: 0;
......@@ -72,15 +87,18 @@
}
}
}
.tableDetail {
width: 100%;
height: 100%;
padding-bottom: 50px;
.formBox {
width: 100%;
height: 100%;
overflow: auto;
}
.formBtns {
display: flex;
align-items: center;
......
......@@ -118,15 +118,6 @@ const textWidgets = [
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}",
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -136,6 +127,15 @@ const textWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}",
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
},
presetValue: {
title: '默认值',
type: 'string',
......@@ -324,14 +324,6 @@ const textWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -340,6 +332,14 @@ const textWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
presetValue: {
title: '默认值',
type: 'string',
......@@ -442,14 +442,6 @@ const textWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -458,6 +450,14 @@ const textWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
rules: {
title: '正则校验',
type: 'array',
......@@ -594,14 +594,6 @@ const textWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -610,6 +602,14 @@ const textWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
presetValue: {
title: '默认值',
type: 'string',
......@@ -685,14 +685,6 @@ const textWidgets = [
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -701,6 +693,14 @@ const textWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
prefixion: {
title: '前缀',
type: 'string',
......@@ -769,14 +769,6 @@ const textWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -785,6 +777,14 @@ const textWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
coordSync: {
title: '坐标同步',
type: 'string',
......@@ -858,14 +858,6 @@ const selectWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -874,6 +866,14 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
presetValue: {
title: '默认值',
type: 'string',
......@@ -1027,14 +1027,6 @@ const selectWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1043,6 +1035,14 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
type: 'string',
......@@ -1151,14 +1151,6 @@ const selectWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1168,6 +1160,14 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
type: 'string',
......@@ -1278,14 +1278,6 @@ const selectWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1295,6 +1287,14 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
disabled: {
title: '只读',
type: 'boolean',
......@@ -1370,14 +1370,6 @@ const selectWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1386,6 +1378,14 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fieldParent: {
title: '父字段名',
type: 'string',
......@@ -1465,14 +1465,6 @@ const selectWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1481,6 +1473,14 @@ const selectWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
sourceType: {
title: '来源方式',
name: '来源方式',
......@@ -1565,14 +1565,6 @@ const businessWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1581,6 +1573,14 @@ const businessWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
role: {
title: '机构角色',
type: 'string',
......@@ -1685,14 +1685,6 @@ const businessWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1701,6 +1693,14 @@ const businessWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
required: {
title: '必填',
type: 'boolean',
......@@ -1780,14 +1780,6 @@ const businessWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1796,6 +1788,14 @@ const businessWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
accountName: {
title: '台账名称',
name: '台账名称',
......@@ -1924,14 +1924,6 @@ const dateWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -1940,6 +1932,14 @@ const dateWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
calculateRule: {
title: '计算规则',
type: 'string',
......@@ -2029,14 +2029,6 @@ const dateWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2045,6 +2037,14 @@ const dateWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
calculateRule: {
title: '计算规则',
type: 'string',
......@@ -2137,14 +2137,6 @@ const fileWidgets = [
title: '默认值',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2153,6 +2145,14 @@ const fileWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fileType: {
title: '文件类型',
type: 'string',
......@@ -2279,14 +2279,6 @@ const mapWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2295,6 +2287,14 @@ const mapWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
currentAddress: {
title: '自动获取',
type: 'boolean',
......@@ -2383,14 +2383,6 @@ const mapWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2399,6 +2391,14 @@ const mapWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
fieldshine: {
title: '映射字段',
name: '映射字段',
......@@ -2476,15 +2476,6 @@ const mapWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}",
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2494,6 +2485,15 @@ const mapWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
disabled: disabled,
hidden: "{{formData.isHidden}}",
dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
......@@ -2564,14 +2564,6 @@ const mapWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2580,6 +2572,14 @@ const mapWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
screenShot: {
title: '是否显示缩略图',
type: 'boolean',
......@@ -2657,14 +2657,6 @@ const mapWidgets = [
title: '字段说明',
type: 'string',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2673,6 +2665,14 @@ const mapWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
areaTaskShine: {
title: '巡检对象',
name: '巡检对象',
......@@ -2783,14 +2783,6 @@ const advancedWidgets = [
dependencies: ['accountName', '$id'],
description: '默认获取前端台账字段',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2799,6 +2791,14 @@ const advancedWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isEdit: {
title: '表格可编辑',
description: '表格字段变为可编辑与添加字段集',
......@@ -2867,14 +2867,6 @@ const advancedWidgets = [
widget: 'htmlInput',
default: '关联表单',
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
isHidden: {
title: '是否隐藏',
type: 'boolean',
......@@ -2883,6 +2875,14 @@ const advancedWidgets = [
displayType: 'row',
labelWidth: 80,
},
hiddenCondition: {
title: '隐藏条件',
type: 'string',
description: '所有形态默认显示',
widget: 'HiddenCondition',
hidden: "{{formData.isHidden}}",
dependencies: ['isHidden'],
},
description: {
title: '字段说明',
type: 'string',
......
......@@ -157,7 +157,6 @@ const DeviceFieldshine = (props) => {
marginBottom: '5px',
justifyContent: 'center',
position: 'relative',
left: index === 0 ? '-11px' : '',
}}
align="baseline"
>
......@@ -227,7 +226,7 @@ const DeviceFieldshine = (props) => {
>
<Input />
</Form.Item>
{index !== 0 ? <MinusCircleOutlined onClick={() => remove(name)} /> : null}
<MinusCircleOutlined onClick={() => remove(name)} />
</Space>
))}
<Form.Item style={{ padding: '0 10px' }}>
......
......@@ -84,7 +84,7 @@ const OtherSource = (props) => {
</Select>
</Form.Item>
<Form.Item
label={'台账名称'}
label={'按钮名称'}
name={'btnName'}
>
<Input placeholder='请输入按钮名称' />
......
......@@ -152,8 +152,11 @@ const TextInput = (props) => {
}
}, [otherValue])
if (disabled && urlRegExp.test(showValue)) {
return <div className={styles.textUrl} onClick={() => window.open(showValue)}>{showValue}</div>
if (disabled) {
if (urlRegExp.test(showValue)) {
return <div className={styles.textUrl} onClick={() => window.open(showValue)}>{showValue}</div>
}
return <div className={styles.textInputD} style={{ color: loaclPaths.includes(presetValue) ? 'blue' : '' }}>{showValue}</div>
}
return (
......
@import '~antd/es/style/themes/default.less';
.textInput {
&[isdisabled='true'] {
.@{ant-prefix}-input-group-addon {
......@@ -7,10 +8,17 @@
}
}
.textInputD {
background: #f8fafc;
padding: 5px 10px;
border-radius: 2px;
}
.textUrl {
color: #1890ff;
padding: 4px 11px;
background: #f8fafc;
&:hover {
color: #0a7fec;
cursor: pointer;
......
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