Commit e308c27c authored by XieZhiXiong's avatar XieZhiXiong

chore: 调整布局

parent 35ac900d
......@@ -12,7 +12,6 @@ const RowStyleLayout = styled(props => <div {...props} />)`
height: 100%;
background: #909399;
border-radius: 0;
border: none;
&[disabled] {
background: #F4F5F7;
}
......
......@@ -39,6 +39,7 @@ import {
} from '@/constants/commodity';
import { addBillSchema, goodsSearchSchema } from './schema';
import { createEffects } from './effects';
import EllipsisText from '../EllipsisText';
const addSchemaAction = createFormActions();
const {
......@@ -1856,7 +1857,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
}}
components={{
RadioGroup: Radio.Group,
ArrayTable,
ArrayTable,
Text: EllipsisText,
}}
editable={isEdit}
effects={($, actions) => {
......
......@@ -426,6 +426,9 @@ export const addBillSchema: ISchema = {
'x-component-props': {
renderAddition: () => null,
renderRemove: '{{renderListTableRemove}}',
scroll: {
x: '900px',
},
},
'x-rules': [
{
......@@ -438,47 +441,89 @@ export const addBillSchema: ISchema = {
properties: {
itemNo: {
type: 'string',
title: '货号',
'x-component': 'Text',
title: '货号',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
itemName: {
type: 'string',
title: '货品名称',
'x-component': 'Text',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
specifications: {
type: 'string',
title: '规格型号',
'x-component': 'Text',
title: '规格型号',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
category: {
type: 'string',
title: '品类',
'x-component': 'Text',
title: '品类',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
brand: {
type: 'string',
title: '品牌',
'x-component': 'Text',
title: '品牌',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
unit: {
type: 'string',
title: '单位',
'x-component': 'Text',
title: '单位',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
costPrice: {
type: 'string',
title: '成本价',
'x-component': 'Text',
title: '成本价',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
product: {
type: 'string',
title: '商品名称',
enum: [],
'x-component-props': {
allowClear: true,
allowClear: true,
style: {
width: 180,
width: 150,
},
},
'x-rules': [
......@@ -491,21 +536,36 @@ export const addBillSchema: ISchema = {
},
productId: {
type: 'string',
title: '商品ID',
'x-component': 'Text',
title: '商品ID',
'x-props': {
width: 80,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
display: true,
},
price: {
type: 'string',
title: '单价',
'x-component': 'Text',
title: '单价',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
display: true,
},
productCount: {
type: 'string',
title: '单据数量',
title: '单据数量',
'x-component-props': {
allowClear: true,
allowClear: true,
style: {
width: 80,
},
},
'x-rules': [
{
......@@ -520,8 +580,14 @@ export const addBillSchema: ISchema = {
},
amount: {
type: 'string',
title: '金额',
'x-component': 'Text',
title: '金额',
'x-props': {
width: 100,
},
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
},
},
// 额外的数据,用于收集不需要展示的数据
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