Commit e308c27c authored by XieZhiXiong's avatar XieZhiXiong

chore: 调整布局

parent 35ac900d
...@@ -12,7 +12,6 @@ const RowStyleLayout = styled(props => <div {...props} />)` ...@@ -12,7 +12,6 @@ const RowStyleLayout = styled(props => <div {...props} />)`
height: 100%; height: 100%;
background: #909399; background: #909399;
border-radius: 0; border-radius: 0;
border: none;
&[disabled] { &[disabled] {
background: #F4F5F7; background: #F4F5F7;
} }
......
...@@ -39,6 +39,7 @@ import { ...@@ -39,6 +39,7 @@ import {
} from '@/constants/commodity'; } from '@/constants/commodity';
import { addBillSchema, goodsSearchSchema } from './schema'; import { addBillSchema, goodsSearchSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EllipsisText from '../EllipsisText';
const addSchemaAction = createFormActions(); const addSchemaAction = createFormActions();
const { const {
...@@ -1856,7 +1857,8 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1856,7 +1857,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
}} }}
components={{ components={{
RadioGroup: Radio.Group, RadioGroup: Radio.Group,
ArrayTable, ArrayTable,
Text: EllipsisText,
}} }}
editable={isEdit} editable={isEdit}
effects={($, actions) => { effects={($, actions) => {
......
...@@ -426,6 +426,9 @@ export const addBillSchema: ISchema = { ...@@ -426,6 +426,9 @@ export const addBillSchema: ISchema = {
'x-component-props': { 'x-component-props': {
renderAddition: () => null, renderAddition: () => null,
renderRemove: '{{renderListTableRemove}}', renderRemove: '{{renderListTableRemove}}',
scroll: {
x: '900px',
},
}, },
'x-rules': [ 'x-rules': [
{ {
...@@ -438,47 +441,89 @@ export const addBillSchema: ISchema = { ...@@ -438,47 +441,89 @@ export const addBillSchema: ISchema = {
properties: { properties: {
itemNo: { itemNo: {
type: 'string', type: 'string',
title: '货号', title: '货号',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
itemName: { itemName: {
type: 'string', type: 'string',
title: '货品名称', title: '货品名称',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
specifications: { specifications: {
type: 'string', type: 'string',
title: '规格型号', title: '规格型号',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
category: { category: {
type: 'string', type: 'string',
title: '品类', title: '品类',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
brand: { brand: {
type: 'string', type: 'string',
title: '品牌', title: '品牌',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
unit: { unit: {
type: 'string', type: 'string',
title: '单位', title: '单位',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
costPrice: { costPrice: {
type: 'string', type: 'string',
title: '成本价', title: '成本价',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
product: { product: {
type: 'string', type: 'string',
title: '商品名称', title: '商品名称',
enum: [], enum: [],
'x-component-props': { 'x-component-props': {
allowClear: true, allowClear: true,
style: { style: {
width: 180, width: 150,
}, },
}, },
'x-rules': [ 'x-rules': [
...@@ -491,21 +536,36 @@ export const addBillSchema: ISchema = { ...@@ -491,21 +536,36 @@ export const addBillSchema: ISchema = {
}, },
productId: { productId: {
type: 'string', type: 'string',
title: '商品ID', title: '商品ID',
'x-component': 'Text', 'x-props': {
width: 80,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
display: true, display: true,
}, },
price: { price: {
type: 'string', type: 'string',
title: '单价', title: '单价',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
display: true, display: true,
}, },
productCount: { productCount: {
type: 'string', type: 'string',
title: '单据数量', title: '单据数量',
'x-component-props': { 'x-component-props': {
allowClear: true, allowClear: true,
style: {
width: 80,
},
}, },
'x-rules': [ 'x-rules': [
{ {
...@@ -520,8 +580,14 @@ export const addBillSchema: ISchema = { ...@@ -520,8 +580,14 @@ export const addBillSchema: ISchema = {
}, },
amount: { amount: {
type: 'string', type: 'string',
title: '金额', title: '金额',
'x-component': 'Text', 'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
}, },
// 额外的数据,用于收集不需要展示的数据 // 额外的数据,用于收集不需要展示的数据
extraData: { extraData: {
......
@import '../../../../../../global/styles/utils.less';
.ellipsis {
.textOverflow();
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-07-26 10:25:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-26 10:47:05
* @Description: 待省略的文本展示组件
*/
import React from 'react';
import { Tooltip } from 'antd';
import classNames from 'classnames';
import styles from './index.less';
const EllipsisText = (props) => {
const { value } = props;
const { ellipsis } = (props.props['x-component-props'] || {});
return (
<Tooltip title={ellipsis ? value : null}>
<div className={classNames({ [styles.ellipsis]: ellipsis })}>{value}</div>
</Tooltip>
)
}
EllipsisText.defaultProps = {};
EllipsisText.isFieldComponent = true;
export default EllipsisText;
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