Commit 9c0b6752 authored by ddcat1115's avatar ddcat1115

update style & add digitUppercase util

parent 339ea67a
......@@ -222,12 +222,17 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
</Form.Item>
</Col>
<Col xl={{ span: 6, offset: 2 }} lg={{ span: 8 }} md={{ span: 12 }} sm={24}>
<Col id="timepicker-container" xl={{ span: 6, offset: 2 }} lg={{ span: 8 }} md={{ span: 12 }} sm={24}>
<Form.Item label={fieldLabels.dateRange2}>
{getFieldDecorator('dateRange2', {
rules: [{ required: true, message: 'θ―·θΎ“ε…₯' }],
})(
<TimePicker placeholder="提醒既间" style={{ width: '100%' }} />
<TimePicker
popupClassName={styles.popup}
placeholder="提醒既间"
style={{ width: '100%' }}
getPopupContainer={() => document.getElementById('timepicker-container')}
/>
)}
</Form.Item>
</Col>
......
import React from 'react';
import { Form, Input, Button, Alert, Divider } from 'antd';
import { routerRedux } from 'dva/router';
import { digitUppercase } from '../../../utils/utils';
import styles from './style.less';
export default ({ formItemLayout, form, data, dispatch, submitting }) => {
......@@ -56,7 +57,8 @@ export default ({ formItemLayout, form, data, dispatch, submitting }) => {
className={styles.stepFormText}
label="转账金钝"
>
<span className={styles.money}>{data.amount}</span> ε…ƒ
<span className={styles.money}>{data.amount}</span>
<span className={styles.uppercase}>({digitUppercase(data.amount)}οΌ‰</span>
</Form.Item>
<Divider style={{ margin: '24px 0' }} />
<Form.Item
......
......@@ -64,7 +64,12 @@
}
.money {
font-family: Helvetica Neue;
font-weight: 500;
font-size: 20px;
line-height: 14px;
}
.uppercase {
font-size: 12px;
}
......@@ -213,7 +213,7 @@ export default class TableForm extends PureComponent {
}}
/>
<Button
style={{ width: '100%', marginTop: 24 }}
style={{ width: '100%', marginTop: 16, marginBottom: 8 }}
type="dashed"
onClick={this.newMember}
icon="plus"
......
......@@ -88,3 +88,12 @@
color: @text-color-secondary;
font-style: normal;
}
.popup {
width: ~"calc(100% - 16px)";
:global {
.ant-time-picker-panel-select {
width: 33.33%;
}
}
}
......@@ -79,3 +79,29 @@ export function getRouteData(path) {
const nodeList = getPlainNode(dataList.children);
return nodeList;
}
export function digitUppercase(n) {
const fraction = ['θ§’', 'εˆ†'];
const digit = ['ι›Ά', 'ε£Ή', 'θ΄°', '叁', '肆', '伍', '陆', 'ζŸ’', '捌', 'ηŽ–'];
const unit = [
['ε…ƒ', 'δΈ‡', 'δΊΏ'],
['', 'ζ‹Ύ', 'δ½°', '仟'],
];
let num = Math.abs(n);
let s = '';
fraction.forEach((item, index) => {
s += (digit[Math.floor(num * 10 * (10 ** index)) % 10] + item).replace(/ι›Ά./, '');
});
s = s || 'ζ•΄';
num = Math.floor(num);
for (let i = 0; i < unit[0].length && num > 0; i += 1) {
let p = '';
for (let j = 0; j < unit[1].length && num > 0; j += 1) {
p = digit[num % 10] + unit[1][j] + p;
num = Math.floor(num / 10);
}
s = p.replace(/(ι›Ά.)*ι›Ά$/, '').replace(/^$/, 'ι›Ά') + unit[0][i] + s;
}
return s.replace(/(ι›Ά.)*ι›Άε…ƒ/, 'ε…ƒ').replace(/(ι›Ά.)+/g, 'ι›Ά').replace(/^ζ•΄$/, 'ι›Άε…ƒζ•΄');
}
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