diff --git a/.prettierignore b/.prettierignore index 2098c78c895e444136787bb101b9e2af2e519cae..d33a869654cab5d4fcbc620cfb97d38bb0dcca36 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,4 @@ -**/*.md **/*.svg -**/*.ejs -**/*.html package.json .umi .umi-production diff --git a/.prettierrc b/.prettierrc index 0cc0de659627e921698ed83b20f086cd65c0efdc..3dc446bfad33a70faba001d33132528b1a594870 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,11 +1,14 @@ { "singleQuote": true, - "trailingComma": "es5", + "trailingComma": "all", "printWidth": 100, + "proseWrap": "never", "overrides": [ { "files": ".prettierrc", - "options": { "parser": "json" } + "options": { + "parser": "json" + } } ] -} +} \ No newline at end of file diff --git a/.stylelintrc.json b/.stylelintrc.json index ad112f11d9726a67890b3aa537df5a858cab4478..215bf08119eadd5005ddbef70291a652520e697b 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,12 +1,13 @@ { "extends": [ "stylelint-config-standard", + "stylelint-config-css-modules", + "stylelint-config-rational-order", "stylelint-config-prettier" ], + "plugins": ["stylelint-order", "stylelint-declaration-block-no-ignored-properties"], "rules": { - "declaration-empty-line-before": null, "no-descending-specificity": null, - "selector-pseudo-class-no-unknown": null, - "selector-pseudo-element-colon-notation": null + "plugin/declaration-block-no-ignored-properties": true } -} \ No newline at end of file +} diff --git a/AccountCenter/package.json b/AccountCenter/package.json index 448486cb85927d39138a3083953d60e5c41cc923..b9e2f48d098ce5e8f1f9887af212ab06eaf910da 100644 --- a/AccountCenter/package.json +++ b/AccountCenter/package.json @@ -25,4 +25,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/AccountCenter/src/Center.less b/AccountCenter/src/Center.less index c6125f1e6f3ba76be4ae149cc0daed39ca62e10f..37738dafda15e009dc90555bd501ff69c3bc81b2 100644 --- a/AccountCenter/src/Center.less +++ b/AccountCenter/src/Center.less @@ -1,8 +1,8 @@ @import '~antd/lib/style/themes/default.less'; .avatarHolder { - text-align: center; margin-bottom: 24px; + text-align: center; & > img { width: 104px; @@ -11,19 +11,19 @@ } .name { + margin-bottom: 4px; + color: @heading-color; + font-weight: 500; font-size: 20px; line-height: 28px; - font-weight: 500; - color: @heading-color; - margin-bottom: 4px; } } .detail { p { + position: relative; margin-bottom: 8px; padding-left: 26px; - position: relative; &:last-child { margin-bottom: 0; @@ -32,10 +32,10 @@ i { position: absolute; - height: 14px; - width: 14px; - left: 0; top: 4px; + left: 0; + width: 14px; + height: 14px; background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg); &.title { @@ -54,9 +54,9 @@ .tagsTitle, .teamTitle { - font-weight: 500; - color: @heading-color; margin-bottom: 12px; + color: @heading-color; + font-weight: 500; } .tags { @@ -77,12 +77,12 @@ a { display: block; margin-bottom: 24px; - color: @text-color; - transition: color 0.3s; overflow: hidden; + color: @text-color; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; + transition: color 0.3s; &:hover { color: @primary-color; diff --git a/AccountCenter/src/data.d.ts b/AccountCenter/src/data.d.ts index f956d756ae6654981966c705e61216256791aa78..792f502e4120c02ce36638564ff13e84493731e1 100644 --- a/AccountCenter/src/data.d.ts +++ b/AccountCenter/src/data.d.ts @@ -1,24 +1,24 @@ -export interface ITag { +export interface itag { key: string; label: string; } -export interface Province { +export interface province { label: string; key: string; } -export interface City { +export interface city { label: string; key: string; } -export interface Geographic { +export interface geographic { province: Province; city: City; } -export interface Notice { +export interface notice { id: string; title: string; logo: string; @@ -29,7 +29,7 @@ export interface Notice { memberLink: string; } -export interface CurrentUser { +export interface currentuser { name: string; avatar: string; userid: string; diff --git a/AccountCenter/src/index.tsx b/AccountCenter/src/index.tsx index 5cd4a3bff6a330a5943fdc73d036d238ea7df895..5ff12f963c3782ec80d8e44cdeaf0fe1dd2099fc 100644 --- a/AccountCenter/src/index.tsx +++ b/AccountCenter/src/index.tsx @@ -36,7 +36,7 @@ const operationTabList = [ ]; interface BLOCK_NAME_CAMEL_CASEProps extends RouteChildrenProps { - dispatch: Dispatch; + dispatch: Dispatch; currentUser: CurrentUser; currentUserLoading: boolean; } @@ -57,7 +57,7 @@ interface BLOCK_NAME_CAMEL_CASEState { }) => ({ currentUser: BLOCK_NAME_CAMEL_CASE.currentUser, currentUserLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchCurrent'], - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent< BLOCK_NAME_CAMEL_CASEProps, @@ -65,7 +65,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent< > { static getDerivedStateFromProps( props: BLOCK_NAME_CAMEL_CASEProps, - state: BLOCK_NAME_CAMEL_CASEState + state: BLOCK_NAME_CAMEL_CASEState, ) { const { match, location } = props; const { tabKey } = state; @@ -88,6 +88,8 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent< tabKey: 'articles', }; + input: Input | null | undefined; + componentDidMount() { const { dispatch } = this.props; dispatch({ @@ -108,8 +110,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent< this.setState({ inputVisible: true }, () => this.input && this.input.focus()); }; - input: Input | null | undefined; - saveInputRef = (input: Input | null) => { this.input = input; }; diff --git a/AccountCenter/src/model.ts b/AccountCenter/src/model.ts index f75f0857d47fac4e015ba66b827d5bc152127bdd..ec27747d45fccfe29ddf247ca95590e80bb3b45f 100644 --- a/AccountCenter/src/model.ts +++ b/AccountCenter/src/model.ts @@ -11,7 +11,7 @@ import { AnyAction } from 'redux'; export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T }, ) => void; export interface ModelType { diff --git a/AccountSettings/package.json b/AccountSettings/package.json index 8cbf073d570e491ffb472edf31ccc34acf7879d2..b6c3571e7b560a071655503748fa7291d810891b 100644 --- a/AccountSettings/package.json +++ b/AccountSettings/package.json @@ -25,4 +25,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/AccountSettings/src/_mock.ts b/AccountSettings/src/_mock.ts index 6612cabf13402d1003961ab5a26b0d65709d9a64..1eaefd6b692108a177dd34e24f5fdeba14eb652b 100644 --- a/AccountSettings/src/_mock.ts +++ b/AccountSettings/src/_mock.ts @@ -7,7 +7,7 @@ function getProvince(req: any, res: { json: (arg0: { name: string; id: string }[ function getCity( req: { params: { province: string | number } }, - res: { json: (arg: any) => void } + res: { json: (arg: any) => void }, ) { return res.json(city[req.params.province]); } diff --git a/AccountSettings/src/components/BaseView.less b/AccountSettings/src/components/BaseView.less index a0a2ffdefe6a1010a27b594a9d6fca82e5f70e94..e1b09e93702c36115bbca120f9c9ffcf26a85543 100644 --- a/AccountSettings/src/components/BaseView.less +++ b/AccountSettings/src/components/BaseView.less @@ -5,18 +5,18 @@ padding-top: 12px; .left { - max-width: 448px; min-width: 224px; + max-width: 448px; } .right { flex: 1; padding-left: 104px; .avatar_title { height: 22px; - font-size: @font-size-base; + margin-bottom: 8px; color: @heading-color; + font-size: @font-size-base; line-height: 22px; - margin-bottom: 8px; } .avatar { width: 144px; @@ -39,11 +39,11 @@ flex-direction: column-reverse; .right { - padding: 20px; display: flex; flex-direction: column; align-items: center; max-width: 448px; + padding: 20px; .avatar_title { display: none; } diff --git a/AccountSettings/src/components/GeographicView.less b/AccountSettings/src/components/GeographicView.less index 22e35a29cea425faa33f82a76a89c6b0be3b8007..fdc97500300f9e10a86c8aa7b3d084c340a8a51a 100644 --- a/AccountSettings/src/components/GeographicView.less +++ b/AccountSettings/src/components/GeographicView.less @@ -2,12 +2,12 @@ .row { .item { - max-width: 220px; width: 50%; + max-width: 220px; } .item:first-child { - margin-right: 8px; width: ~'calc(50% - 8px)'; + margin-right: 8px; } } diff --git a/AccountSettings/src/components/GeographicView.tsx b/AccountSettings/src/components/GeographicView.tsx index a5a5e4a378c0cf6799f0dc75f2635350352c93b9..fac71c4fa1837e3b80721bc81d6fd490a82f1ae2 100644 --- a/AccountSettings/src/components/GeographicView.tsx +++ b/AccountSettings/src/components/GeographicView.tsx @@ -16,7 +16,7 @@ const nullSlectItem: SelectItem = { }; interface GeographicViewProps { - dispatch?: Dispatch; + dispatch?: Dispatch; province?: ProvinceData[]; city?: CityData[]; value?: { @@ -44,26 +44,28 @@ interface GeographicViewProps { city, loading: loading.models.BLOCK_NAME_CAMEL_CASE, }; - } + }, ) class GeographicView extends Component { componentDidMount = () => { const { dispatch } = this.props; - dispatch && + if (dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/fetchProvince', }); + } }; componentDidUpdate(props: GeographicViewProps) { const { dispatch, value } = this.props; if (!props.value && !!value && !!value.province) { - dispatch && + if (dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', payload: value.province.key, }); + } } } @@ -101,17 +103,18 @@ class GeographicView extends Component { selectProvinceItem = (item: SelectItem) => { const { dispatch, onChange } = this.props; - dispatch && + if (dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', payload: item.key, }); - - onChange && + } + if (onChange) { onChange({ province: item, city: nullSlectItem, }); + } }; selectCityItem = (item: SelectItem) => { diff --git a/AccountSettings/src/components/PhoneView.less b/AccountSettings/src/components/PhoneView.less index 5c85970d511eebcbc14bd313e2066fc2f9da4c45..ee4328ebfa3146be8f2a8d412820ac58b07ef7af 100644 --- a/AccountSettings/src/components/PhoneView.less +++ b/AccountSettings/src/components/PhoneView.less @@ -1,11 +1,11 @@ @import '~antd/lib/style/themes/default.less'; .area_code { + width: 30%; max-width: 128px; margin-right: 8px; - width: 30%; } .phone_number { - max-width: 312px; width: ~'calc(70% - 8px)'; + max-width: 312px; } diff --git a/AccountSettings/src/components/PhoneView.tsx b/AccountSettings/src/components/PhoneView.tsx index c48358c2d87bcd8cc5bf13278ff32ec048c295af..98a8bcb722f57bba951fcb8078300f8efdc72209 100644 --- a/AccountSettings/src/components/PhoneView.tsx +++ b/AccountSettings/src/components/PhoneView.tsx @@ -20,12 +20,14 @@ class PhoneView extends PureComponent { className={styles.area_code} value={values[0]} onChange={e => { + // tslint:disable-next-line: no-unused-expression onChange && onChange(`${e.target.value}-${values[1]}`); }} /> { + // tslint:disable-next-line: no-unused-expression onChange && onChange(`${values[0]}-${e.target.value}`); }} value={values[1]} diff --git a/AccountSettings/src/components/base.tsx b/AccountSettings/src/components/base.tsx index e8154c67dc0ab5e5f2e588b0f24e1acacdd63a90..da90984a64d1fc3025bc5318890f34d697d14cd4 100644 --- a/AccountSettings/src/components/base.tsx +++ b/AccountSettings/src/components/base.tsx @@ -39,7 +39,7 @@ const validatorGeographic = ( province: SelectItem; city: SelectItem; }, - callback: (message?: string) => void + callback: (message?: string) => void, ) => { const { province, city } = value; if (!province.key) { @@ -70,6 +70,7 @@ interface BaseViewProps extends FormComponentProps { currentUser: BLOCK_NAME_CAMEL_CASE.currentUser, })) class BaseView extends Component { + view: HTMLDivElement | undefined; componentDidMount() { this.setBaseInfo(); } @@ -96,7 +97,6 @@ class BaseView extends Component { } return ''; } - view: HTMLDivElement | undefined; getViewDom = (ref: HTMLDivElement) => { this.view = ref; @@ -142,7 +142,7 @@ class BaseView extends Component { + />, )} @@ -156,7 +156,7 @@ class BaseView extends Component { })( + , )} diff --git a/AccountSettings/src/components/binding.tsx b/AccountSettings/src/components/binding.tsx index d78a765cbfa3cb1ab2ffdc85ef2752d1a4d64d7e..5f1d3d9b593e4c189e670112d77fef4da5810151 100644 --- a/AccountSettings/src/components/binding.tsx +++ b/AccountSettings/src/components/binding.tsx @@ -8,7 +8,7 @@ class BindingView extends Component { title: formatMessage({ id: 'BLOCK_NAME.binding.taobao' }, {}), description: formatMessage({ id: 'BLOCK_NAME.binding.taobao-description' }, {}), actions: [ - + , ], @@ -18,7 +18,7 @@ class BindingView extends Component { title: formatMessage({ id: 'BLOCK_NAME.binding.alipay' }, {}), description: formatMessage({ id: 'BLOCK_NAME.binding.alipay-description' }, {}), actions: [ - + , ], @@ -28,7 +28,7 @@ class BindingView extends Component { title: formatMessage({ id: 'BLOCK_NAME.binding.dingding' }, {}), description: formatMessage({ id: 'BLOCK_NAME.binding.dingding-description' }, {}), actions: [ - + , ], diff --git a/AccountSettings/src/components/security.tsx b/AccountSettings/src/components/security.tsx index 6a15f41233e1bc18af2768221f0024c09904f977..89642eb4b28854eed6ad2a76478a0931918bf440 100644 --- a/AccountSettings/src/components/security.tsx +++ b/AccountSettings/src/components/security.tsx @@ -34,7 +34,7 @@ class SecurityView extends Component { ), actions: [ - + , ], @@ -43,10 +43,10 @@ class SecurityView extends Component { title: formatMessage({ id: 'BLOCK_NAME.security.phone' }, {}), description: `${formatMessage( { id: 'BLOCK_NAME.security.phone-description' }, - {} + {}, )}:138****8293`, actions: [ - + , ], @@ -55,7 +55,7 @@ class SecurityView extends Component { title: formatMessage({ id: 'BLOCK_NAME.security.question' }, {}), description: formatMessage({ id: 'BLOCK_NAME.security.question-description' }, {}), actions: [ - + , ], @@ -64,10 +64,10 @@ class SecurityView extends Component { title: formatMessage({ id: 'BLOCK_NAME.security.email' }, {}), description: `${formatMessage( { id: 'BLOCK_NAME.security.email-description' }, - {} + {}, )}:ant***sign.com`, actions: [ - + , ], @@ -76,7 +76,7 @@ class SecurityView extends Component { title: formatMessage({ id: 'BLOCK_NAME.security.mfa' }, {}), description: formatMessage({ id: 'BLOCK_NAME.security.mfa-description' }, {}), actions: [ - + , ], diff --git a/AccountSettings/src/data.d.ts b/AccountSettings/src/data.d.ts index afc53e51ebfbd1b421729d5cc9a0e384c3377fe0..04866919d28087d8070460f1107acac9960ce6a5 100644 --- a/AccountSettings/src/data.d.ts +++ b/AccountSettings/src/data.d.ts @@ -1,32 +1,32 @@ -export interface ITag { +export interface itag { key: string; label: string; } -export interface Province { +export interface province { label: string; key: string; } -export interface City { +export interface city { label: string; key: string; } -export interface Geographic { +export interface geographic { province: Province; city: City; } -export interface ProvinceData { +export interface provincedata { name: string; id: string; } -export interface CityData { +export interface citydata { province: string; name: string; id: string; } -export interface Notice { +export interface notice { id: string; title: string; logo: string; @@ -37,7 +37,7 @@ export interface Notice { memberLink: string; } -export interface CurrentUser { +export interface currentuser { name: string; avatar: string; userid: string; diff --git a/AccountSettings/src/index.tsx b/AccountSettings/src/index.tsx index 3763520b6ff48c9f6b084fc248c71f6ddfa374c7..ca382e6b21cf3afe8aec837a0a1022474cc0cfa1 100644 --- a/AccountSettings/src/index.tsx +++ b/AccountSettings/src/index.tsx @@ -13,7 +13,7 @@ import { CurrentUser } from './data'; const { Item } = Menu; interface PAGE_NAME_UPPER_CAMEL_CASEProps { - dispatch: Dispatch; + dispatch: Dispatch; currentUser: CurrentUser; } @@ -32,6 +32,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< PAGE_NAME_UPPER_CAMEL_CASEProps, PAGE_NAME_UPPER_CAMEL_CASEState > { + main: HTMLDivElement | undefined; constructor(props: PAGE_NAME_UPPER_CAMEL_CASEProps) { super(props); const menuMap = { @@ -56,8 +57,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< }; } - main: HTMLDivElement | undefined; - componentDidMount() { const { dispatch } = this.props; dispatch({ diff --git a/AccountSettings/src/model.ts b/AccountSettings/src/model.ts index 4c48f2e7c0ac9025cf9188af1f30392167d17bd6..138a842e5d6dd57f11686086530450ba4690a77d 100644 --- a/AccountSettings/src/model.ts +++ b/AccountSettings/src/model.ts @@ -13,7 +13,7 @@ export interface ModalState { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T }, ) => void; export interface ModelType { diff --git a/AccountSettings/src/style.less b/AccountSettings/src/style.less index ce4266574deb9f3a36a5cdb353d2da098dcd0b06..abda02875a5c9079f3cb9637211aa422c2d9dd59 100644 --- a/AccountSettings/src/style.less +++ b/AccountSettings/src/style.less @@ -1,13 +1,13 @@ @import '~antd/lib/style/themes/default.less'; .main { + display: flex; width: 100%; height: 100%; - background-color: @body-background; - display: flex; padding-top: 16px; padding-bottom: 16px; overflow: auto; + background-color: @body-background; .leftMenu { width: 224px; border-right: @border-width-base @border-style-base @border-color-split; @@ -22,16 +22,16 @@ } .right { flex: 1; - padding-left: 40px; - padding-right: 40px; padding-top: 8px; + padding-right: 40px; padding-bottom: 8px; + padding-left: 40px; .title { - font-size: 20px; + margin-bottom: 12px; color: @heading-color; - line-height: 28px; font-weight: 500; - margin-bottom: 12px; + font-size: 20px; + line-height: 28px; } } :global { @@ -48,19 +48,19 @@ .ant-list-item-meta { // 账号绑定图标 .taobao { - color: #ff4000; display: block; + color: #ff4000; font-size: 48px; line-height: 48px; border-radius: @border-radius-base; } .dingding { - background-color: #2eabff; + margin: 2px; + padding: 6px; color: #fff; font-size: 32px; line-height: 32px; - padding: 6px; - margin: 2px; + background-color: #2eabff; border-radius: @border-radius-base; } .alipay { diff --git a/AdvancedForm/package.json b/AdvancedForm/package.json index 94cb2c8f54bc34f5cd2ed2a0813873bf6b61a694..4c2101e49e89901c803284cee7fa0834e847a17b 100644 --- a/AdvancedForm/package.json +++ b/AdvancedForm/package.json @@ -26,4 +26,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/AdvancedForm/src/components/TableForm.tsx b/AdvancedForm/src/components/TableForm.tsx index 66f941dcfaa7dd029d3cb2b5597c0771214af5c0..9c878d023a619e96a99d7a99a805628696bf1045 100644 --- a/AdvancedForm/src/components/TableForm.tsx +++ b/AdvancedForm/src/components/TableForm.tsx @@ -4,9 +4,117 @@ import { isEqual } from 'lodash'; import styles from '../style.less'; class TableForm extends PureComponent { + static getDerivedStateFromProps(nextProps, preState) { + if (isEqual(nextProps.value, preState.value)) { + return null; + } + return { + data: nextProps.value, + value: nextProps.value, + }; + } index = 0; cacheOriginData = {}; + columns = [ + { + title: '成员姓名', + dataIndex: 'name', + key: 'name', + width: '20%', + render: (text, record) => { + if (record.editable) { + return ( + this.handleFieldChange(e, 'name', record.key)} + onKeyPress={e => this.handleKeyPress(e, record.key)} + placeholder="成员姓名" + /> + ); + } + return text; + }, + }, + { + title: '工号', + dataIndex: 'workId', + key: 'workId', + width: '20%', + render: (text, record) => { + if (record.editable) { + return ( + this.handleFieldChange(e, 'workId', record.key)} + onKeyPress={e => this.handleKeyPress(e, record.key)} + placeholder="工号" + /> + ); + } + return text; + }, + }, + { + title: '所属部门', + dataIndex: 'department', + key: 'department', + width: '40%', + render: (text, record) => { + if (record.editable) { + return ( + this.handleFieldChange(e, 'department', record.key)} + onKeyPress={e => this.handleKeyPress(e, record.key)} + placeholder="所属部门" + /> + ); + } + return text; + }, + }, + { + title: '操作', + key: 'action', + render: (text, record) => { + const { loading } = this.state; + if (!!record.editable && loading) { + return null; + } + if (record.editable) { + if (record.isNew) { + return ( + + this.saveRow(e, record.key)}>添加 + + this.remove(record.key)}> + 删除 + + + ); + } + return ( + + this.saveRow(e, record.key)}>保存 + + this.cancel(e, record.key)}>取消 + + ); + } + return ( + + this.toggleEditable(e, record.key)}>编辑 + + this.remove(record.key)}> + 删除 + + + ); + }, + }, + ]; constructor(props) { super(props); @@ -19,16 +127,6 @@ class TableForm extends PureComponent { }; } - static getDerivedStateFromProps(nextProps, preState) { - if (isEqual(nextProps.value, preState.value)) { - return null; - } - return { - data: nextProps.value, - value: nextProps.value, - }; - } - getRowByKey(key, newData) { const { data } = this.state; return (newData || data).filter(item => item.key === key)[0]; @@ -132,115 +230,14 @@ class TableForm extends PureComponent { this.setState({ data: newData }); this.clickedCancel = false; } - render() { - const columns = [ - { - title: '成员姓名', - dataIndex: 'name', - key: 'name', - width: '20%', - render: (text, record) => { - if (record.editable) { - return ( - this.handleFieldChange(e, 'name', record.key)} - onKeyPress={e => this.handleKeyPress(e, record.key)} - placeholder="成员姓名" - /> - ); - } - return text; - }, - }, - { - title: '工号', - dataIndex: 'workId', - key: 'workId', - width: '20%', - render: (text, record) => { - if (record.editable) { - return ( - this.handleFieldChange(e, 'workId', record.key)} - onKeyPress={e => this.handleKeyPress(e, record.key)} - placeholder="工号" - /> - ); - } - return text; - }, - }, - { - title: '所属部门', - dataIndex: 'department', - key: 'department', - width: '40%', - render: (text, record) => { - if (record.editable) { - return ( - this.handleFieldChange(e, 'department', record.key)} - onKeyPress={e => this.handleKeyPress(e, record.key)} - placeholder="所属部门" - /> - ); - } - return text; - }, - }, - { - title: '操作', - key: 'action', - render: (text, record) => { - const { loading } = this.state; - if (!!record.editable && loading) { - return null; - } - if (record.editable) { - if (record.isNew) { - return ( - - this.saveRow(e, record.key)}>添加 - - this.remove(record.key)}> - 删除 - - - ); - } - return ( - - this.saveRow(e, record.key)}>保存 - - this.cancel(e, record.key)}>取消 - - ); - } - return ( - - this.toggleEditable(e, record.key)}>编辑 - - this.remove(record.key)}> - 删除 - - - ); - }, - }, - ]; - const { loading, data } = this.state; return ( (record.editable ? styles.editable : '')} diff --git a/AdvancedForm/src/index.tsx b/AdvancedForm/src/index.tsx index 6c5385c749e990763b6e6d28cdaf758c8f269cee..20d611ee0a479b2ba547a376e9b42fcbbfded359 100644 --- a/AdvancedForm/src/index.tsx +++ b/AdvancedForm/src/index.tsx @@ -59,7 +59,7 @@ const tableData = [ ]; interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { - dispatch: Dispatch; + dispatch: Dispatch; submitting: boolean; } @@ -184,7 +184,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component + />, )} @@ -196,7 +196,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -210,7 +210,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -219,7 +219,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component + , )} @@ -231,7 +234,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -263,7 +266,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -277,7 +280,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -295,7 +298,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component + />, )} @@ -307,7 +310,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} diff --git a/AdvancedForm/src/locales/en-US.js b/AdvancedForm/src/locales/en-US.ts similarity index 100% rename from AdvancedForm/src/locales/en-US.js rename to AdvancedForm/src/locales/en-US.ts diff --git a/AdvancedForm/src/locales/pt-BR.js b/AdvancedForm/src/locales/pt-BR.ts similarity index 100% rename from AdvancedForm/src/locales/pt-BR.js rename to AdvancedForm/src/locales/pt-BR.ts diff --git a/AdvancedForm/src/locales/zh-CN.js b/AdvancedForm/src/locales/zh-CN.ts similarity index 100% rename from AdvancedForm/src/locales/zh-CN.js rename to AdvancedForm/src/locales/zh-CN.ts diff --git a/AdvancedForm/src/locales/zh-TW.js b/AdvancedForm/src/locales/zh-TW.ts similarity index 100% rename from AdvancedForm/src/locales/zh-TW.js rename to AdvancedForm/src/locales/zh-TW.ts diff --git a/AdvancedForm/src/model.ts b/AdvancedForm/src/model.ts index 2c4d3ef2bc215732147a48bedbbdde3a7d109ecf..44eb2faecb7765ac1e2de93a916cce023db51302 100644 --- a/AdvancedForm/src/model.ts +++ b/AdvancedForm/src/model.ts @@ -7,7 +7,7 @@ export interface ModalState {} export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T }, ) => void; export interface ModelType { diff --git a/AdvancedForm/src/style.less b/AdvancedForm/src/style.less index 6b12d3c3eaf4ad2159d35b7a8550f20ac37d72e5..cb23b0b4c69f60b6c03d029a335e0ca62c0e1a00 100644 --- a/AdvancedForm/src/style.less +++ b/AdvancedForm/src/style.less @@ -5,9 +5,9 @@ } .heading { + margin: 0 0 16px 0; font-size: 14px; line-height: 22px; - margin: 0 0 16px 0; } .steps:global(.ant-steps) { @@ -16,9 +16,9 @@ } .errorIcon { - cursor: pointer; - color: @error-color; margin-right: 24px; + color: @error-color; + cursor: pointer; i { margin-right: 4px; } @@ -27,18 +27,18 @@ .errorPopover { :global { .ant-popover-inner-content { - padding: 0; + min-width: 256px; max-height: 290px; + padding: 0; overflow: auto; - min-width: 256px; } } } .errorListItem { + padding: 8px 16px; list-style: none; border-bottom: 1px solid @border-color-split; - padding: 8px 16px; cursor: pointer; transition: all 0.3s; &:hover { @@ -48,16 +48,16 @@ border: 0; } .errorIcon { - color: @error-color; float: left; margin-top: 4px; margin-right: 12px; padding-bottom: 22px; + color: @error-color; } .errorField { - font-size: 12px; - color: @text-color-secondary; margin-top: 2px; + color: @text-color-secondary; + font-size: 12px; } } diff --git a/AdvancedProfile/package.json b/AdvancedProfile/package.json index aa792fd7b749a409779a44a6e8d757d954d65235..a26f3703f6ae04457db24ab96c0cc06700175cbd 100644 --- a/AdvancedProfile/package.json +++ b/AdvancedProfile/package.json @@ -28,4 +28,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/AdvancedProfile/src/DescriptionList/DescriptionList.tsx b/AdvancedProfile/src/DescriptionList/DescriptionList.tsx index d6806a733c39e3cb32c5f3b1c282b8dc520b5e16..f5e3749faad06f2cdfea4e666b3a203405d02658 100644 --- a/AdvancedProfile/src/DescriptionList/DescriptionList.tsx +++ b/AdvancedProfile/src/DescriptionList/DescriptionList.tsx @@ -37,7 +37,7 @@ const DescriptionList: React.SFC & { {title ?
{title}
: null} {React.Children.map(children, (child: any) => - child ? React.cloneElement(child, { column }) : child + child ? React.cloneElement(child, { column }) : child, )} diff --git a/AdvancedProfile/src/data.d.ts b/AdvancedProfile/src/data.d.ts index 64f7e78edfc35f6782b2e1fc1c82173d8b09960d..b640c8347ab5a514559cc67a65a1f0cf15b1ee77 100644 --- a/AdvancedProfile/src/data.d.ts +++ b/AdvancedProfile/src/data.d.ts @@ -1,4 +1,4 @@ -export interface AdvancedOperation1 { +export interface advancedoperation1 { key: string; type: string; name: string; @@ -7,7 +7,7 @@ export interface AdvancedOperation1 { memo: string; } -export interface AdvancedOperation2 { +export interface advancedoperation2 { key: string; type: string; name: string; @@ -16,7 +16,7 @@ export interface AdvancedOperation2 { memo: string; } -export interface AdvancedOperation3 { +export interface advancedoperation3 { key: string; type: string; name: string; @@ -25,7 +25,7 @@ export interface AdvancedOperation3 { memo: string; } -export interface AdvancedProfileData { +export interface advancedprofiledata { advancedOperation1: AdvancedOperation1[]; advancedOperation2: AdvancedOperation2[]; advancedOperation3: AdvancedOperation3[]; diff --git a/AdvancedProfile/src/index.tsx b/AdvancedProfile/src/index.tsx index f9ba1b1bac06bf05b5ec11391a30a876c9fb46c4..ed3cd6a07c913dd301fcbc1be11608095cb37afc 100644 --- a/AdvancedProfile/src/index.tsx +++ b/AdvancedProfile/src/index.tsx @@ -85,17 +85,6 @@ const description = ( ); -const tabList = [ - { - key: 'detail', - tab: '详情', - }, - { - key: 'rule', - tab: '规则', - }, -]; - /** * render Footer tabList * In order to be compatible with the old version of the PageHeader @@ -173,7 +162,7 @@ const customDot = ( status, }: { status: string; - } + }, ) => status === 'process' ? ( @@ -244,7 +233,7 @@ const columns = [ }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchAdvanced'], - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component< { loading: boolean; BLOCK_NAME_CAMEL_CASE: AdvancedProfileData; dispatch: Dispatch }, @@ -263,7 +252,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< componentDidMount() { const { dispatch, BLOCK_NAME_CAMEL_CASE } = this.props; - console.log(BLOCK_NAME_CAMEL_CASE); dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/fetchAdvanced', }); @@ -344,7 +332,20 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< margin: -24, }} extra={action} - footer={} + footer={ + + } >
(func: (state: AdvancedProfileData) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: AdvancedProfileData) => T) => T }, ) => void; export interface ModelType { diff --git a/AdvancedProfile/src/style.less b/AdvancedProfile/src/style.less index 3897f11c20b20f21d44fb6ec7a5e9ec17db7706b..4ee7621d0fba39ceb54ee7065142a6404fce887c 100644 --- a/AdvancedProfile/src/style.less +++ b/AdvancedProfile/src/style.less @@ -14,14 +14,14 @@ .noData { color: @disabled-color; - text-align: center; - line-height: 64px; font-size: 16px; + line-height: 64px; + text-align: center; i { - font-size: 24px; - margin-right: 16px; position: relative; top: 3px; + margin-right: 16px; + font-size: 24px; } } @@ -31,10 +31,10 @@ } .stepDescription { - font-size: 14px; position: relative; left: 38px; padding-top: 8px; + font-size: 14px; text-align: left; > div { diff --git a/Analysis/package.json b/Analysis/package.json index 27d43abc0958c04e69deda18006000ff406caf86..36aeef59f992ba1841fc64a22d12cad9cc0f3d84 100644 --- a/Analysis/package.json +++ b/Analysis/package.json @@ -32,4 +32,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Analysis/src/components/Charts/Bar/index.tsx b/Analysis/src/components/Charts/Bar/index.tsx index 7cf4b3debb25688c1a03910f986449c543469130..2b5125018b61b1ec7a05a80f25885e777e20c43b 100644 --- a/Analysis/src/components/Charts/Bar/index.tsx +++ b/Analysis/src/components/Charts/Bar/index.tsx @@ -28,6 +28,8 @@ class Bar extends Component< state = { autoHideXLabels: false, }; + root: HTMLDivElement | undefined; + node: HTMLDivElement | undefined; componentDidMount() { window.addEventListener('resize', this.resize, { passive: true }); @@ -36,11 +38,9 @@ class Bar extends Component< componentWillUnmount() { window.removeEventListener('resize', this.resize); } - root: HTMLDivElement | undefined; handleRoot = (n: HTMLDivElement) => { this.root = n; }; - node: HTMLDivElement | undefined; handleRef = (n: HTMLDivElement) => { this.node = n; }; diff --git a/Analysis/src/components/Charts/Pie/index.tsx b/Analysis/src/components/Charts/Pie/index.tsx index 47c836630e8014b2d7fe27c9a89748c99c1621bc..9ed8a9a3956c6ea0b9f4590188c0370881f7c32f 100644 --- a/Analysis/src/components/Charts/Pie/index.tsx +++ b/Analysis/src/components/Charts/Pie/index.tsx @@ -45,6 +45,8 @@ class Pie extends Component { }; requestRef: number | undefined; + root!: HTMLDivElement; + chart: G2.Chart | undefined; componentDidMount() { window.addEventListener( @@ -52,7 +54,7 @@ class Pie extends Component { () => { this.requestRef = requestAnimationFrame(() => this.resize()); }, - { passive: true } + { passive: true }, ); } @@ -123,8 +125,6 @@ class Pie extends Component { legendData, }); }; - root!: HTMLDivElement; - chart: G2.Chart | undefined; // for window resize auto responsive legend @Bind() diff --git a/Analysis/src/components/Charts/TagCloud/index.tsx b/Analysis/src/components/Charts/TagCloud/index.tsx index cc2fc394c13a808db13f742f9f7e15c02acd6835..fc809826df3e4d1f607ec83bb812d63f41fcbdd3 100644 --- a/Analysis/src/components/Charts/TagCloud/index.tsx +++ b/Analysis/src/components/Charts/TagCloud/index.tsx @@ -34,6 +34,11 @@ class TagCloud extends Component { height: 0, width: 0, }; + isUnmount!: boolean; + requestRef!: number; + + root: HTMLDivElement | undefined; + imageMask: HTMLImageElement | undefined; componentDidMount() { requestAnimationFrame(() => { @@ -49,20 +54,16 @@ class TagCloud extends Component { this.renderChart(this.props); } } - isUnmount!: boolean; componentWillUnmount() { this.isUnmount = true; window.cancelAnimationFrame(this.requestRef); window.removeEventListener('resize', this.resize); } - requestRef!: number; resize = () => { this.requestRef = requestAnimationFrame(() => { this.renderChart(this.props); }); }; - - root: HTMLDivElement | undefined; saveRootRef = (node: HTMLDivElement) => { this.root = node; }; @@ -91,7 +92,7 @@ class TagCloud extends Component { (Shape as any).registerShape('point', 'cloud', { drawShape( cfg: { x: any; y: any }, - container: { addShape: (arg0: string, arg1: { attrs: any }) => void } + container: { addShape: (arg0: string, arg1: { attrs: any }) => void }, ) { const attrs = getTextAttrs(cfg); return container.addShape('text', { @@ -103,7 +104,6 @@ class TagCloud extends Component { }, }); }; - imageMask: HTMLImageElement | undefined; @Bind() @Debounce(500) diff --git a/Analysis/src/components/Charts/TimelineChart/index.tsx b/Analysis/src/components/Charts/TimelineChart/index.tsx index 89eb9fc892ee0964586019fd8c43e98145749de6..2ccc37283623e27ff1cd48e7c569a683b1199684 100644 --- a/Analysis/src/components/Charts/TimelineChart/index.tsx +++ b/Analysis/src/components/Charts/TimelineChart/index.tsx @@ -41,7 +41,7 @@ class TimelineChart extends React.Component { if (data[0] && data[0].y1 && data[0].y2) { max = Math.max( [...data].sort((a, b) => b.y1 - a.y1)[0].y1, - [...data].sort((a, b) => b.y2 - a.y2)[0].y2 + [...data].sort((a, b) => b.y2 - a.y2)[0].y2, ); } diff --git a/Analysis/src/components/Charts/WaterWave/index.tsx b/Analysis/src/components/Charts/WaterWave/index.tsx index 64ff67359fd737e2279fdf7b5d32a662a50cd817..9dba82160b99756506399cfac2416c08206bf78e 100644 --- a/Analysis/src/components/Charts/WaterWave/index.tsx +++ b/Analysis/src/components/Charts/WaterWave/index.tsx @@ -18,6 +18,9 @@ class WaterWave extends Component { state = { radio: 1, }; + timer: number = 0; + root: HTMLDivElement | undefined | null; + node: HTMLCanvasElement | undefined | null; componentDidMount() { this.renderChart(); @@ -27,7 +30,7 @@ class WaterWave extends Component { () => { requestAnimationFrame(() => this.resize()); }, - { passive: true } + { passive: true }, ); } @@ -56,7 +59,6 @@ class WaterWave extends Component { }); } }; - timer: number = 0; renderChart(type?: string) { const { percent, color = '#1890FF' } = this.props; const data = percent / 100; @@ -199,8 +201,6 @@ class WaterWave extends Component { } render(); } - root: HTMLDivElement | undefined | null; - node: HTMLCanvasElement | undefined | null; render() { const { radio } = this.state; const { percent, title, height = 1 } = this.props; diff --git a/Analysis/src/components/Charts/autoHeight.tsx b/Analysis/src/components/Charts/autoHeight.tsx index aa25500027388d713c0cc4e9f19a087810646f8a..e7d14e07a6be59b9125bcc910c07ba9b162b5409 100644 --- a/Analysis/src/components/Charts/autoHeight.tsx +++ b/Analysis/src/components/Charts/autoHeight.tsx @@ -19,7 +19,7 @@ function getAutoHeight(n: HTMLDivElement) { return 0; } - let node = n; + const node = n; let height = computeHeight(node); const parentNode = node.parentNode as HTMLDivElement; @@ -36,7 +36,7 @@ interface IAutoHeightProps { function autoHeight() { return function

( - WrappedComponent: React.ComponentClass

| React.SFC

+ WrappedComponent: React.ComponentClass

| React.SFC

, ): React.ComponentClass

{ class AutoHeightComponent extends React.Component

{ state = { @@ -46,11 +46,11 @@ function autoHeight() { componentDidMount() { const { height } = this.props; if (!height) { - const h = getAutoHeight(this.root); + let h = getAutoHeight(this.root); // eslint-disable-next-line this.setState({ computedHeight: h }); if (h < 1) { - const h = getAutoHeight(this.root); + h = getAutoHeight(this.root); this.setState({ computedHeight: h }); } } diff --git a/Analysis/src/components/Trend/index.tsx b/Analysis/src/components/Trend/index.tsx index 69b9c5017b5047e4b959a01d864e9752738829d2..ee8df20ea51db0e14fe78c12ecf622a6f2772b96 100644 --- a/Analysis/src/components/Trend/index.tsx +++ b/Analysis/src/components/Trend/index.tsx @@ -25,7 +25,7 @@ const Trend: React.SFC = ({ [styles.trendItemGrey]: !colorful, [styles.reverseColor]: reverseColor && colorful, }, - className + className, ); return (

diff --git a/Analysis/src/data.d.ts b/Analysis/src/data.d.ts index 20df2e20dc6eeeff67414b3f6f50d8bfaeb7d62e..df36ae209b834a15a756fce08f022f04cb3ebffc 100644 --- a/Analysis/src/data.d.ts +++ b/Analysis/src/data.d.ts @@ -1,19 +1,19 @@ -export interface IVisitData { +export interface ivisitdata { x: string; y: number; } -export interface IVisitData2 { +export interface ivisitdata2 { x: string; y: number; } -export interface ISalesData { +export interface isalesdata { x: string; y: number; } -export interface ISearchData { +export interface isearchdata { index: number; keyword: string; count: number; @@ -21,39 +21,39 @@ export interface ISearchData { status: number; } -export interface IOfflineData { +export interface iofflinedata { name: string; cvr: number; } -export interface IOfflineChartData { +export interface iofflinechartdata { x: any; y1: number; y2: number; } -export interface ISalesTypeData { +export interface isalestypedata { x: string; y: number; } -export interface ISalesTypeDataOnline { +export interface isalestypedataonline { x: string; y: number; } -export interface ISalesTypeDataOffline { +export interface isalestypedataoffline { x: string; y: number; } -export interface IRadarData { +export interface iradardata { name: string; label: string; value: number; } -export interface IAnalysisData { +export interface ianalysisdata { visitData: IVisitData[]; visitData2: IVisitData2[]; salesData: ISalesData[]; diff --git a/Analysis/src/index.tsx b/Analysis/src/index.tsx index 005e8a208ab92b626ac981fbc0e98d3ed0a4a5c7..9f83550031e281f5e3e031f3b837fa50b91b05cf 100644 --- a/Analysis/src/index.tsx +++ b/Analysis/src/index.tsx @@ -18,7 +18,7 @@ const OfflineData = React.lazy(() => import('./components/OfflineData')); interface BLOCK_NAME_CAMEL_CASEProps { BLOCK_NAME_CAMEL_CASE: IAnalysisData; - dispatch: Dispatch; + dispatch: Dispatch; loading: boolean; } @@ -40,7 +40,7 @@ interface BLOCK_NAME_CAMEL_CASEState { }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetch'], - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component< BLOCK_NAME_CAMEL_CASEProps, diff --git a/Analysis/src/model.tsx b/Analysis/src/model.tsx index c88112d04ef45d6977e0e21589a85342b042284f..bfe131a903822a34c89795fb212eedb69ab3ef02 100644 --- a/Analysis/src/model.tsx +++ b/Analysis/src/model.tsx @@ -6,7 +6,7 @@ import { AnyAction } from 'redux'; export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IAnalysisData) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IAnalysisData) => T) => T }, ) => void; export interface ModelType { diff --git a/Analysis/src/style.less b/Analysis/src/style.less index 4df48a03b85e6b8933688e478095e0f84d38ca17..e1e898e594abec60264826e6fee472d71dfa68eb 100644 --- a/Analysis/src/style.less +++ b/Analysis/src/style.less @@ -3,10 +3,10 @@ .iconGroup { i { - transition: color 0.32s; + margin-left: 16px; color: @text-color-secondary; cursor: pointer; - margin-left: 16px; + transition: color 0.32s; &:hover { color: @text-color; } @@ -19,37 +19,38 @@ list-style: none; li { .clearfix(); - margin-top: 16px; + display: flex; align-items: center; + margin-top: 16px; span { color: @text-color; font-size: 14px; line-height: 22px; } .rankingItemNumber { - background-color: @background-color-base; - border-radius: 20px; display: inline-block; - font-size: 12px; - font-weight: 600; - margin-right: 16px; + width: 20px; height: 20px; + margin-top: 1.5px; + margin-right: 16px; + font-weight: 600; + font-size: 12px; line-height: 20px; - width: 20px; text-align: center; - margin-top: 1.5px; + background-color: @background-color-base; + border-radius: 20px; &.active { - background-color: #314659; color: #fff; + background-color: #314659; } } .rankingItemTitle { flex: 1; + margin-right: 8px; + overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - overflow: hidden; - margin-right: 8px; } } } @@ -58,8 +59,8 @@ display: inline-block; margin-right: 24px; a { - color: @text-color; margin-left: 24px; + color: @text-color; &:hover { color: @primary-color; } @@ -117,14 +118,14 @@ border-bottom: none; } .ant-tabs-nav-container-scrolling { - padding-left: 40px; padding-right: 40px; + padding-left: 40px; } - .ant-tabs-tab-prev-icon:before { + .ant-tabs-tab-prev-icon::before { position: relative; left: 6px; } - .ant-tabs-tab-next-icon:before { + .ant-tabs-tab-next-icon::before { position: relative; right: 6px; } diff --git a/Analysis/src/utils/Yuan.tsx b/Analysis/src/utils/Yuan.tsx index fe51f4346dc2cd82ea8f54717c78787c5801b424..eafefd41526f7313d6baea44faebafe2cb27f16b 100644 --- a/Analysis/src/utils/Yuan.tsx +++ b/Analysis/src/utils/Yuan.tsx @@ -6,6 +6,7 @@ import { yuan } from '../components/Charts'; export default class Yuan extends React.Component<{ children: React.ReactText; }> { + main: HTMLSpanElement | undefined | null; componentDidMount() { this.renderToHtml(); } @@ -13,7 +14,6 @@ export default class Yuan extends React.Component<{ componentDidUpdate() { this.renderToHtml(); } - main: HTMLSpanElement | undefined | null; renderToHtml = () => { const { children } = this.props; if (this.main) { diff --git a/Analysis/src/utils/utils.less b/Analysis/src/utils/utils.less index 725792252787f49efba4f4e887301195a9818f3f..de1aa64222b6f14328d3a9e3c262ac5a31cce5af 100644 --- a/Analysis/src/utils/utils.less +++ b/Analysis/src/utils/utils.less @@ -1,34 +1,34 @@ .textOverflow() { overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; } .textOverflowMulti(@line: 3, @bg: #fff) { - overflow: hidden; position: relative; - line-height: 1.5em; max-height: @line * 1.5em; - text-align: justify; margin-right: -1em; padding-right: 1em; - &:before { - background: @bg; - content: '...'; - padding: 0 1px; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { position: absolute; right: 14px; bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; } - &:after { - background: white; - content: ''; - margin-top: 0.2em; + &::after { position: absolute; right: 14px; width: 1em; height: 1em; + margin-top: 0.2em; + background: white; + content: ''; } } @@ -36,15 +36,15 @@ // ------------------------ .clearfix() { zoom: 1; - &:before, - &:after { - content: ' '; + &::before, + &::after { display: table; + content: ' '; } - &:after { + &::after { clear: both; - visibility: hidden; - font-size: 0; height: 0; + font-size: 0; + visibility: hidden; } } diff --git a/Analysis/src/utils/utils.ts b/Analysis/src/utils/utils.ts index 20c070d40aacd8f0251c2594982c94fdad1063e9..ce70448ce9df2fa8b0f6471fbe9440f955df9331 100644 --- a/Analysis/src/utils/utils.ts +++ b/Analysis/src/utils/utils.ts @@ -32,9 +32,9 @@ export function getTimeDistance(type: 'today' | 'week' | 'month' | 'year'): Rang return [moment(beginTime), moment(beginTime + (7 * oneDay - 1000))]; } + const year = now.getFullYear(); if (type === 'month') { - const year = now.getFullYear(); const month = now.getMonth(); const nextDate = moment(now).add(1, 'months'); const nextYear = nextDate.year(); @@ -46,6 +46,5 @@ export function getTimeDistance(type: 'today' | 'week' | 'month' | 'year'): Rang ]; } - const year = now.getFullYear(); return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)]; } diff --git a/BasicForm/package.json b/BasicForm/package.json index 535fc2cde55015b096c00bc7f051f037dcc3c28b..dc792d1f7e468de239b98cfc1e405fa8c1b38f4f 100644 --- a/BasicForm/package.json +++ b/BasicForm/package.json @@ -26,4 +26,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/BasicForm/src/_mock.js b/BasicForm/src/_mock.ts similarity index 100% rename from BasicForm/src/_mock.js rename to BasicForm/src/_mock.ts diff --git a/BasicForm/src/index.tsx b/BasicForm/src/index.tsx index 10b3c632c2d2967a74231b3ce58c20a4de4b449b..647cd06e8581139f536d0e79ae4dac15e0c1efe0 100644 --- a/BasicForm/src/index.tsx +++ b/BasicForm/src/index.tsx @@ -25,7 +25,7 @@ const { TextArea } = Input; interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { submitting: boolean; - dispatch: Dispatch; + dispatch: Dispatch; } @connect(({ loading }: { loading: { effects: { [key: string]: boolean } } }) => ({ @@ -102,7 +102,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component + />, )} }> @@ -118,7 +118,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component + />, )} + />, )} {getFieldDecorator('client')( - + , )} {getFieldDecorator('invites')( - + , )} + />, )} % @@ -212,7 +212,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} {getFieldDecorator('publicUsers')( @@ -233,7 +233,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )}
diff --git a/BasicForm/src/locales/en-US.js b/BasicForm/src/locales/en-US.ts similarity index 100% rename from BasicForm/src/locales/en-US.js rename to BasicForm/src/locales/en-US.ts diff --git a/BasicForm/src/locales/pt-BR.js b/BasicForm/src/locales/pt-BR.ts similarity index 100% rename from BasicForm/src/locales/pt-BR.js rename to BasicForm/src/locales/pt-BR.ts diff --git a/BasicForm/src/locales/zh-CN.js b/BasicForm/src/locales/zh-CN.ts similarity index 100% rename from BasicForm/src/locales/zh-CN.js rename to BasicForm/src/locales/zh-CN.ts diff --git a/BasicForm/src/locales/zh-TW.js b/BasicForm/src/locales/zh-TW.ts similarity index 100% rename from BasicForm/src/locales/zh-TW.js rename to BasicForm/src/locales/zh-TW.ts diff --git a/BasicForm/src/model.ts b/BasicForm/src/model.ts index c511e8ae282a3c6d18e0d3e22671d54b6a572f41..ea3f48cae5061bda792caa883fec13152cf5480a 100644 --- a/BasicForm/src/model.ts +++ b/BasicForm/src/model.ts @@ -7,7 +7,7 @@ export interface ModalState {} export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: ModalState) => T) => T }, ) => void; export interface ModelType { diff --git a/BasicForm/src/style.less b/BasicForm/src/style.less index 6b12d3c3eaf4ad2159d35b7a8550f20ac37d72e5..cb23b0b4c69f60b6c03d029a335e0ca62c0e1a00 100644 --- a/BasicForm/src/style.less +++ b/BasicForm/src/style.less @@ -5,9 +5,9 @@ } .heading { + margin: 0 0 16px 0; font-size: 14px; line-height: 22px; - margin: 0 0 16px 0; } .steps:global(.ant-steps) { @@ -16,9 +16,9 @@ } .errorIcon { - cursor: pointer; - color: @error-color; margin-right: 24px; + color: @error-color; + cursor: pointer; i { margin-right: 4px; } @@ -27,18 +27,18 @@ .errorPopover { :global { .ant-popover-inner-content { - padding: 0; + min-width: 256px; max-height: 290px; + padding: 0; overflow: auto; - min-width: 256px; } } } .errorListItem { + padding: 8px 16px; list-style: none; border-bottom: 1px solid @border-color-split; - padding: 8px 16px; cursor: pointer; transition: all 0.3s; &:hover { @@ -48,16 +48,16 @@ border: 0; } .errorIcon { - color: @error-color; float: left; margin-top: 4px; margin-right: 12px; padding-bottom: 22px; + color: @error-color; } .errorField { - font-size: 12px; - color: @text-color-secondary; margin-top: 2px; + color: @text-color-secondary; + font-size: 12px; } } diff --git a/BasicList/package.json b/BasicList/package.json index 0900ea73dccc9f3293de8b962c910ed3d3229900..c18afc24f4689e220d64731ec78fd01a2022eb27 100644 --- a/BasicList/package.json +++ b/BasicList/package.json @@ -28,4 +28,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/BasicList/src/data.d.ts b/BasicList/src/data.d.ts index 9796369f880bbd79449c0f6b89c5f0d5b2388c3b..b28aefacf0623b950b0b63fcfa1267c008cd76fe 100644 --- a/BasicList/src/data.d.ts +++ b/BasicList/src/data.d.ts @@ -1,10 +1,10 @@ -export interface Member { +export interface member { avatar: string; name: string; id: string; } -export interface BasicListItemDataType { +export interface basiclistitemdatatype { id: string; owner: string; title: string; diff --git a/BasicList/src/index.tsx b/BasicList/src/index.tsx index a805d59ed0416c908f33097595d0d6569d09243d..dcffabb0937101c0af149e8439a8c72622bdc02d 100644 --- a/BasicList/src/index.tsx +++ b/BasicList/src/index.tsx @@ -37,7 +37,7 @@ const { Search, TextArea } = Input; interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { BLOCK_NAME_CAMEL_CASE: IStateType; - dispatch: Dispatch; + dispatch: Dispatch; loading: boolean; } interface PAGE_NAME_UPPER_CAMEL_CASEState { @@ -57,7 +57,7 @@ interface PAGE_NAME_UPPER_CAMEL_CASEState { }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.BLOCK_NAME_CAMEL_CASE, - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component< PAGE_NAME_UPPER_CAMEL_CASEProps, @@ -69,6 +69,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< labelCol: { span: 7 }, wrapperCol: { span: 13 }, }; + addBtn: HTMLButtonElement | undefined | null; componentDidMount() { const { dispatch } = this.props; @@ -135,7 +136,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< payload: { id }, }); }; - addBtn: HTMLButtonElement | undefined | null; render() { const { @@ -216,11 +216,11 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< ); const MoreBtn: React.SFC<{ - current: BasicListItemDataType; - }> = ({ current }) => ( + item: BasicListItemDataType; + }> = ({ item }) => ( editAndDelete(key, current)}> + editAndDelete(key, item)}> 编辑 删除 @@ -266,7 +266,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< placeholder="请选择" format="YYYY-MM-DD HH:mm:ss" style={{ width: '100%' }} - /> + />, )} @@ -277,7 +277,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< + , )} @@ -338,6 +338,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< { e.preventDefault(); this.showEditModal(item); @@ -345,7 +346,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< > 编辑 , - , + , ]} > (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/BasicList/src/style.less b/BasicList/src/style.less index 6d291abea0d128b88d4c5938d763b52c8448397d..24a17e85abfcf0fea60722bcc5a3f4be3003be23 100644 --- a/BasicList/src/style.less +++ b/BasicList/src/style.less @@ -7,15 +7,15 @@ border-bottom: none; } .ant-card-head-title { - line-height: 32px; padding: 24px 0; + line-height: 32px; } .ant-card-extra { padding: 24px 0; } .ant-list-pagination { - text-align: right; margin-top: 24px; + text-align: right; } .ant-avatar-lg { width: 48px; @@ -27,35 +27,35 @@ position: relative; text-align: center; & > span { - color: @text-color-secondary; display: inline-block; + margin-bottom: 4px; + color: @text-color-secondary; font-size: @font-size-base; line-height: 22px; - margin-bottom: 4px; } & > p { + margin: 0; color: @heading-color; font-size: 24px; line-height: 32px; - margin: 0; } & > em { - background-color: @border-color-split; position: absolute; - height: 56px; - width: 1px; top: 0; right: 0; + width: 1px; + height: 56px; + background-color: @border-color-split; } } .listContent { font-size: 0; .listContentItem { - color: @text-color-secondary; display: inline-block; - vertical-align: middle; - font-size: @font-size-base; margin-left: 40px; + color: @text-color-secondary; + font-size: @font-size-base; + vertical-align: middle; > span { line-height: 20px; } @@ -67,8 +67,8 @@ } } .extraContentSearch { - margin-left: 16px; width: 272px; + margin-left: 16px; } } @@ -103,8 +103,8 @@ @media screen and (max-width: @screen-sm) { .standardList { .extraContentSearch { - margin-left: 0; width: 100%; + margin-left: 0; } .headerInfo { margin-bottom: 16px; @@ -180,8 +180,8 @@ .ant-form-item { margin-bottom: 12px; &:last-child { - padding-top: 4px; margin-bottom: 32px; + padding-top: 4px; } } } diff --git a/BasicList/src/utils/utils.less b/BasicList/src/utils/utils.less index 725792252787f49efba4f4e887301195a9818f3f..de1aa64222b6f14328d3a9e3c262ac5a31cce5af 100644 --- a/BasicList/src/utils/utils.less +++ b/BasicList/src/utils/utils.less @@ -1,34 +1,34 @@ .textOverflow() { overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; } .textOverflowMulti(@line: 3, @bg: #fff) { - overflow: hidden; position: relative; - line-height: 1.5em; max-height: @line * 1.5em; - text-align: justify; margin-right: -1em; padding-right: 1em; - &:before { - background: @bg; - content: '...'; - padding: 0 1px; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { position: absolute; right: 14px; bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; } - &:after { - background: white; - content: ''; - margin-top: 0.2em; + &::after { position: absolute; right: 14px; width: 1em; height: 1em; + margin-top: 0.2em; + background: white; + content: ''; } } @@ -36,15 +36,15 @@ // ------------------------ .clearfix() { zoom: 1; - &:before, - &:after { - content: ' '; + &::before, + &::after { display: table; + content: ' '; } - &:after { + &::after { clear: both; - visibility: hidden; - font-size: 0; height: 0; + font-size: 0; + visibility: hidden; } } diff --git a/BasicProfile/package.json b/BasicProfile/package.json index a46b0b246e51729f678f57916c38c60aae92e0df..a01d5bac4b09876873074bc41283dd7a4cbb70e6 100644 --- a/BasicProfile/package.json +++ b/BasicProfile/package.json @@ -25,4 +25,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/BasicProfile/src/components/DescriptionList/DescriptionList.tsx b/BasicProfile/src/components/DescriptionList/DescriptionList.tsx index d6806a733c39e3cb32c5f3b1c282b8dc520b5e16..f5e3749faad06f2cdfea4e666b3a203405d02658 100644 --- a/BasicProfile/src/components/DescriptionList/DescriptionList.tsx +++ b/BasicProfile/src/components/DescriptionList/DescriptionList.tsx @@ -37,7 +37,7 @@ const DescriptionList: React.SFC & { {title ?
{title}
: null} {React.Children.map(children, (child: any) => - child ? React.cloneElement(child, { column }) : child + child ? React.cloneElement(child, { column }) : child, )}
diff --git a/BasicProfile/src/data.d.ts b/BasicProfile/src/data.d.ts index 786f796d43e854b59ad8309996dc65bf03fa5e61..76e67b3ab5d56ecd3874906a7885fd3746144fb6 100644 --- a/BasicProfile/src/data.d.ts +++ b/BasicProfile/src/data.d.ts @@ -1,4 +1,4 @@ -export interface BasicGood { +export interface basicgood { id: string; name: string; barcode: string; @@ -7,7 +7,7 @@ export interface BasicGood { amount: string | number; } -export interface BasicProgress { +export interface basicprogress { key: string; time: string; rate: string; @@ -16,7 +16,7 @@ export interface BasicProgress { cost: string; } -export interface BasicProfileDataType { +export interface basicprofiledatatype { basicGoods: BasicGood[]; basicProgress: BasicProgress[]; } diff --git a/BasicProfile/src/index.tsx b/BasicProfile/src/index.tsx index 19265b5aae8f74227120f4f3f70ca819e09c6fa5..52362e6a685a252a6bcb3c4a21c292f02b9ba7d2 100644 --- a/BasicProfile/src/index.tsx +++ b/BasicProfile/src/index.tsx @@ -44,7 +44,7 @@ const progressColumns = [ interface PAGE_NAME_UPPER_CAMEL_CASEProps { loading: boolean; - dispatch: Dispatch; + dispatch: Dispatch; BLOCK_NAME_CAMEL_CASE: BasicProfileDataType; } interface PAGE_NAME_UPPER_CAMEL_CASEState { @@ -63,7 +63,7 @@ interface PAGE_NAME_UPPER_CAMEL_CASEState { }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchBasic'], - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component< PAGE_NAME_UPPER_CAMEL_CASEProps, diff --git a/BasicProfile/src/model.ts b/BasicProfile/src/model.ts index 10816220a4355f306cc769b3990651b7ba023e8d..fbb195276a13a882231fb7dd4c9044859eb16c15 100644 --- a/BasicProfile/src/model.ts +++ b/BasicProfile/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/BasicProfile/src/style.less b/BasicProfile/src/style.less index c830b0505733b794e813d20b08395f7df6273824..5c3f94f5c8107350d1402fa327552b0ee060f89c 100644 --- a/BasicProfile/src/style.less +++ b/BasicProfile/src/style.less @@ -1,8 +1,8 @@ @import '~antd/lib/style/themes/default.less'; .title { + margin-bottom: 16px; color: @heading-color; - font-size: 16px; font-weight: 500; - margin-bottom: 16px; + font-size: 16px; } diff --git a/CardList/package.json b/CardList/package.json index f4d3d00c6d4bbc104c41c2bf3bcfe4f4ae116344..6319a4ff81bbe65ba4c31433c76917fefec30f0a 100644 --- a/CardList/package.json +++ b/CardList/package.json @@ -25,4 +25,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/CardList/src/data.d.ts b/CardList/src/data.d.ts index 35fbca30db1bd8a5eb119879a8a453d2770b3ccf..7abebe61c3fc17602679c4ac734d8fa6fc667153 100644 --- a/CardList/src/data.d.ts +++ b/CardList/src/data.d.ts @@ -1,10 +1,10 @@ -export interface Member { +export interface member { avatar: string; name: string; id: string; } -export interface CardListItemDataType { +export interface cardlistitemdatatype { id: string; owner: string; title: string; diff --git a/CardList/src/index.tsx b/CardList/src/index.tsx index 73e0f04abf184fb2b5f452bf34ee5c6fc6a73f2b..e199597481abbef676e260ec14d43c2a603dc9d6 100644 --- a/CardList/src/index.tsx +++ b/CardList/src/index.tsx @@ -12,7 +12,7 @@ import styles from './style.less'; interface PAGE_NAME_UPPER_CAMEL_CASEProps { BLOCK_NAME_CAMEL_CASE: IStateType; - dispatch: Dispatch; + dispatch: Dispatch; loading: boolean; } interface PAGE_NAME_UPPER_CAMEL_CASEState { @@ -33,7 +33,7 @@ interface PAGE_NAME_UPPER_CAMEL_CASEState { }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.list, - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component< PAGE_NAME_UPPER_CAMEL_CASEProps, @@ -98,7 +98,11 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< renderItem={item => item ? ( - 操作一, 操作二]}> + 操作一, 操作二]} + > } title={{item.title}} diff --git a/CardList/src/model.ts b/CardList/src/model.ts index 141e36c0525d0750f750b0ab29a6a614b5391025..abfc49d92c86d24a67d808d652ac1815b450f228 100644 --- a/CardList/src/model.ts +++ b/CardList/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/CardList/src/style.less b/CardList/src/style.less index 5b8af3c9cb7599bd30e3b5c5c1162550a6d4f491..f06743640639fca3a614929f541ba56d715a8654 100644 --- a/CardList/src/style.less +++ b/CardList/src/style.less @@ -9,9 +9,9 @@ .ant-card-meta-title { margin-bottom: 12px; & > a { - color: @heading-color; display: inline-block; max-width: 100%; + color: @heading-color; } } .ant-card-actions { @@ -36,21 +36,21 @@ } .extraImg { + width: 155px; margin-top: -20px; text-align: center; - width: 155px; img { width: 100%; } } .newButton { + width: 100%; + height: 188px; + color: @text-color-secondary; background-color: #fff; border-color: @border-color-base; border-radius: @border-radius-sm; - color: @text-color-secondary; - width: 100%; - height: 188px; } .cardAvatar { @@ -76,8 +76,8 @@ } } img { - vertical-align: middle; margin-right: 8px; + vertical-align: middle; } } @@ -100,8 +100,8 @@ } .contentLink { position: absolute; - left: 0; bottom: -4px; + left: 0; width: 1000px; a { margin-right: 16px; diff --git a/CardList/src/utils/utils.less b/CardList/src/utils/utils.less index 725792252787f49efba4f4e887301195a9818f3f..de1aa64222b6f14328d3a9e3c262ac5a31cce5af 100644 --- a/CardList/src/utils/utils.less +++ b/CardList/src/utils/utils.less @@ -1,34 +1,34 @@ .textOverflow() { overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; } .textOverflowMulti(@line: 3, @bg: #fff) { - overflow: hidden; position: relative; - line-height: 1.5em; max-height: @line * 1.5em; - text-align: justify; margin-right: -1em; padding-right: 1em; - &:before { - background: @bg; - content: '...'; - padding: 0 1px; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { position: absolute; right: 14px; bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; } - &:after { - background: white; - content: ''; - margin-top: 0.2em; + &::after { position: absolute; right: 14px; width: 1em; height: 1em; + margin-top: 0.2em; + background: white; + content: ''; } } @@ -36,15 +36,15 @@ // ------------------------ .clearfix() { zoom: 1; - &:before, - &:after { - content: ' '; + &::before, + &::after { display: table; + content: ' '; } - &:after { + &::after { clear: both; - visibility: hidden; - font-size: 0; height: 0; + font-size: 0; + visibility: hidden; } } diff --git a/Exception403/package.json b/Exception403/package.json index d69278524f3e14718877d8e46163680a60382eda..b0c8ec2fd58998b96a20df69cc5331c3759d3e76 100644 --- a/Exception403/package.json +++ b/Exception403/package.json @@ -25,4 +25,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Exception403/src/components/Exception/index.less b/Exception403/src/components/Exception/index.less index 45a2844b86f369c0df693fbfddea32134d1012c1..5393bb718708271d58b7b74b6037856ad0273f8d 100644 --- a/Exception403/src/components/Exception/index.less +++ b/Exception403/src/components/Exception/index.less @@ -13,8 +13,8 @@ zoom: 1; &::before, &::after { - content: ' '; display: table; + content: ' '; } &::after { clear: both; diff --git a/Exception403/src/components/Exception/index.tsx b/Exception403/src/components/Exception/index.tsx index 7a25ebfa1f6d2856390c13d81aad31279857cfe3..c37683fcc6a6936296213d79740322be5a35934e 100644 --- a/Exception403/src/components/Exception/index.tsx +++ b/Exception403/src/components/Exception/index.tsx @@ -71,7 +71,7 @@ class Exception extends React.Component { to: redirect, href: redirect, }, - + , )} diff --git a/Exception404/package.json b/Exception404/package.json index 34f54e3b787738b57766e2adcf4e7ddb8f2cc52a..50f71ef8a2c3d7a451f49d1d4be653086531b385 100644 --- a/Exception404/package.json +++ b/Exception404/package.json @@ -24,4 +24,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Exception404/src/components/Exception/index.less b/Exception404/src/components/Exception/index.less index 45a2844b86f369c0df693fbfddea32134d1012c1..5393bb718708271d58b7b74b6037856ad0273f8d 100644 --- a/Exception404/src/components/Exception/index.less +++ b/Exception404/src/components/Exception/index.less @@ -13,8 +13,8 @@ zoom: 1; &::before, &::after { - content: ' '; display: table; + content: ' '; } &::after { clear: both; diff --git a/Exception404/src/components/Exception/index.tsx b/Exception404/src/components/Exception/index.tsx index 7a25ebfa1f6d2856390c13d81aad31279857cfe3..c37683fcc6a6936296213d79740322be5a35934e 100644 --- a/Exception404/src/components/Exception/index.tsx +++ b/Exception404/src/components/Exception/index.tsx @@ -71,7 +71,7 @@ class Exception extends React.Component { to: redirect, href: redirect, }, - + , )} diff --git a/Exception500/package.json b/Exception500/package.json index 2491789b8b04c16f8f2fc3d99d3cf37335de93be..3b398861a3e980f93c0d68b48cb05a95c19cf17b 100644 --- a/Exception500/package.json +++ b/Exception500/package.json @@ -24,4 +24,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Exception500/src/components/Exception/index.less b/Exception500/src/components/Exception/index.less index 45a2844b86f369c0df693fbfddea32134d1012c1..5393bb718708271d58b7b74b6037856ad0273f8d 100644 --- a/Exception500/src/components/Exception/index.less +++ b/Exception500/src/components/Exception/index.less @@ -13,8 +13,8 @@ zoom: 1; &::before, &::after { - content: ' '; display: table; + content: ' '; } &::after { clear: both; diff --git a/Exception500/src/components/Exception/index.tsx b/Exception500/src/components/Exception/index.tsx index 7a25ebfa1f6d2856390c13d81aad31279857cfe3..c37683fcc6a6936296213d79740322be5a35934e 100644 --- a/Exception500/src/components/Exception/index.tsx +++ b/Exception500/src/components/Exception/index.tsx @@ -71,7 +71,7 @@ class Exception extends React.Component { to: redirect, href: redirect, }, - + , )} diff --git a/Monitor/package.json b/Monitor/package.json index c8ee83f0aac172352bca0f058b5102771ae62fdb..1e4eb97d889521fa5b67b52ec014aadb2f2d906d 100644 --- a/Monitor/package.json +++ b/Monitor/package.json @@ -32,4 +32,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Monitor/src/components/ActiveChart/index.less b/Monitor/src/components/ActiveChart/index.less index 99079a550aa6c3dbb25a82bd2f8b311bbc5d264c..2f5d15f2ba07962b56ca83e2cb1776492d79e7dd 100644 --- a/Monitor/src/components/ActiveChart/index.less +++ b/Monitor/src/components/ActiveChart/index.less @@ -12,15 +12,15 @@ } .activeChartLegend { position: relative; - font-size: 0; - margin-top: 8px; height: 20px; + margin-top: 8px; + font-size: 0; line-height: 20px; span { display: inline-block; + width: 33.33%; font-size: 12px; text-align: center; - width: 33.33%; } span:first-child { text-align: left; @@ -31,9 +31,9 @@ } .dashedLine { position: relative; - height: 1px; top: -70px; left: -3px; + height: 1px; .line { position: absolute; diff --git a/Monitor/src/components/ActiveChart/index.tsx b/Monitor/src/components/ActiveChart/index.tsx index 09fe772befa4a4558287eb10277a0313a1539e2b..6437ad24b00307f92f4a85f66f797d805d69ab16 100644 --- a/Monitor/src/components/ActiveChart/index.tsx +++ b/Monitor/src/components/ActiveChart/index.tsx @@ -24,12 +24,12 @@ export default class ActiveChart extends Component { state = { activeData: getActiveData(), }; + timer: number | undefined; + requestRef: number | undefined; componentDidMount() { this.loopData(); } - timer: number | undefined; - requestRef: number | undefined; componentWillUnmount() { clearTimeout(this.timer); if (this.requestRef) { @@ -46,7 +46,7 @@ export default class ActiveChart extends Component { }, () => { this.loopData(); - } + }, ); }, 1000); }); diff --git a/Monitor/src/components/Charts/Pie/index.tsx b/Monitor/src/components/Charts/Pie/index.tsx index 47c836630e8014b2d7fe27c9a89748c99c1621bc..9ed8a9a3956c6ea0b9f4590188c0370881f7c32f 100644 --- a/Monitor/src/components/Charts/Pie/index.tsx +++ b/Monitor/src/components/Charts/Pie/index.tsx @@ -45,6 +45,8 @@ class Pie extends Component { }; requestRef: number | undefined; + root!: HTMLDivElement; + chart: G2.Chart | undefined; componentDidMount() { window.addEventListener( @@ -52,7 +54,7 @@ class Pie extends Component { () => { this.requestRef = requestAnimationFrame(() => this.resize()); }, - { passive: true } + { passive: true }, ); } @@ -123,8 +125,6 @@ class Pie extends Component { legendData, }); }; - root!: HTMLDivElement; - chart: G2.Chart | undefined; // for window resize auto responsive legend @Bind() diff --git a/Monitor/src/components/Charts/TagCloud/index.tsx b/Monitor/src/components/Charts/TagCloud/index.tsx index d8070c3f07052bb9e3ba51beeb52e258dcca834b..ce2d6ca9762056ba7a098a8a33caa3690bd6199d 100644 --- a/Monitor/src/components/Charts/TagCloud/index.tsx +++ b/Monitor/src/components/Charts/TagCloud/index.tsx @@ -34,6 +34,11 @@ class TagCloud extends Component { height: 0, width: 0, }; + isUnmount!: boolean; + requestRef!: number; + + root: HTMLDivElement | undefined; + imageMask: HTMLImageElement | undefined; componentDidMount() { requestAnimationFrame(() => { @@ -49,20 +54,16 @@ class TagCloud extends Component { this.renderChart(this.props); } } - isUnmount!: boolean; componentWillUnmount() { this.isUnmount = true; window.cancelAnimationFrame(this.requestRef); window.removeEventListener('resize', this.resize); } - requestRef!: number; resize = () => { this.requestRef = requestAnimationFrame(() => { this.renderChart(this.props); }); }; - - root: HTMLDivElement | undefined; saveRootRef = (node: HTMLDivElement) => { this.root = node; }; @@ -91,7 +92,7 @@ class TagCloud extends Component { (Shape as any).registerShape('point', 'cloud', { drawShape( cfg: { x: any; y: any }, - container: { addShape: (arg0: string, arg1: { attrs: any }) => void } + container: { addShape: (arg0: string, arg1: { attrs: any }) => void }, ) { const attrs = getTextAttrs(cfg); return container.addShape('text', { @@ -103,7 +104,6 @@ class TagCloud extends Component { }, }); }; - imageMask: HTMLImageElement | undefined; @Bind() @Debounce(500) diff --git a/Monitor/src/components/Charts/WaterWave/index.tsx b/Monitor/src/components/Charts/WaterWave/index.tsx index 64ff67359fd737e2279fdf7b5d32a662a50cd817..9dba82160b99756506399cfac2416c08206bf78e 100644 --- a/Monitor/src/components/Charts/WaterWave/index.tsx +++ b/Monitor/src/components/Charts/WaterWave/index.tsx @@ -18,6 +18,9 @@ class WaterWave extends Component { state = { radio: 1, }; + timer: number = 0; + root: HTMLDivElement | undefined | null; + node: HTMLCanvasElement | undefined | null; componentDidMount() { this.renderChart(); @@ -27,7 +30,7 @@ class WaterWave extends Component { () => { requestAnimationFrame(() => this.resize()); }, - { passive: true } + { passive: true }, ); } @@ -56,7 +59,6 @@ class WaterWave extends Component { }); } }; - timer: number = 0; renderChart(type?: string) { const { percent, color = '#1890FF' } = this.props; const data = percent / 100; @@ -199,8 +201,6 @@ class WaterWave extends Component { } render(); } - root: HTMLDivElement | undefined | null; - node: HTMLCanvasElement | undefined | null; render() { const { radio } = this.state; const { percent, title, height = 1 } = this.props; diff --git a/Monitor/src/components/Charts/autoHeight.tsx b/Monitor/src/components/Charts/autoHeight.tsx index aa25500027388d713c0cc4e9f19a087810646f8a..78514e4d4adc5b16a119c3bbe643828f66323e8a 100644 --- a/Monitor/src/components/Charts/autoHeight.tsx +++ b/Monitor/src/components/Charts/autoHeight.tsx @@ -19,7 +19,7 @@ function getAutoHeight(n: HTMLDivElement) { return 0; } - let node = n; + const node = n; let height = computeHeight(node); const parentNode = node.parentNode as HTMLDivElement; @@ -36,7 +36,7 @@ interface IAutoHeightProps { function autoHeight() { return function

( - WrappedComponent: React.ComponentClass

| React.SFC

+ WrappedComponent: React.ComponentClass

| React.SFC

, ): React.ComponentClass

{ class AutoHeightComponent extends React.Component

{ state = { @@ -46,11 +46,10 @@ function autoHeight() { componentDidMount() { const { height } = this.props; if (!height) { - const h = getAutoHeight(this.root); - // eslint-disable-next-line + let h = getAutoHeight(this.root); this.setState({ computedHeight: h }); if (h < 1) { - const h = getAutoHeight(this.root); + h = getAutoHeight(this.root); this.setState({ computedHeight: h }); } } diff --git a/Monitor/src/data.d.ts b/Monitor/src/data.d.ts index 939988ddd33b80e24bf4ba49b99f9e582a50c440..5f5aab3cb87cd9e1ed3f97ee4214d1eeffd88d89 100644 --- a/Monitor/src/data.d.ts +++ b/Monitor/src/data.d.ts @@ -1,4 +1,4 @@ -export interface ITag { +export interface itag { name: string; value: string; type: string; diff --git a/Monitor/src/index.tsx b/Monitor/src/index.tsx index 37d22c5417fb4a6acd70ebfe6f9109af6ac4badb..050f4a3c831e7466f8b27d96de75e6c7678edf1d 100644 --- a/Monitor/src/index.tsx +++ b/Monitor/src/index.tsx @@ -18,7 +18,7 @@ const targetTime = new Date().getTime() + 3900000; interface PAGE_NAME_UPPER_CAMEL_CASEProps { BLOCK_NAME_CAMEL_CASE: IStateType; - dispatch: Dispatch; + dispatch: Dispatch; loading: boolean; } @@ -34,7 +34,7 @@ interface PAGE_NAME_UPPER_CAMEL_CASEProps { }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.monitor, - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component { componentDidMount() { diff --git a/Monitor/src/model.ts b/Monitor/src/model.ts index 8b70fe23bd358e298cd554d7381b01a7985c0f60..df140aeedd8b85a7a7a8d57d0645fed317e75410 100644 --- a/Monitor/src/model.ts +++ b/Monitor/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/Monitor/src/style.less b/Monitor/src/style.less index f73a6efd81656afd0bdac3c4d14d7c00d98deda8..bcbd793f9964872fc75483d9b6ed61572894cc0a 100644 --- a/Monitor/src/style.less +++ b/Monitor/src/style.less @@ -1,8 +1,8 @@ @import '~antd/lib/style/themes/default.less'; .mapChart { - padding-top: 24px; height: 452px; + padding-top: 24px; text-align: center; img { display: inline-block; diff --git a/ResultFail/package.json b/ResultFail/package.json index a7dcdb1f9674684dc1cac1b33436b2b3f8f6e2b4..30719758f511778a3ee79e30e55e6a56bc2d9d04 100644 --- a/ResultFail/package.json +++ b/ResultFail/package.json @@ -23,4 +23,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/ResultSuccess/package.json b/ResultSuccess/package.json index b8d1e3a371e37e29399a5a07080ecd787633c9e8..75add82187e91401c18d7541c735c2a3c8b2b4c1 100644 --- a/ResultSuccess/package.json +++ b/ResultSuccess/package.json @@ -23,4 +23,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/SearchListApplications/package.json b/SearchListApplications/package.json index abdf1efc16fca21c1a23d9936d0a789a9a10f107..d08675c93423403bb9c89151772e00461cf777c4 100644 --- a/SearchListApplications/package.json +++ b/SearchListApplications/package.json @@ -30,4 +30,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/SearchListApplications/src/components/StandardFormRow/index.less b/SearchListApplications/src/components/StandardFormRow/index.less index 83ab019f43217c2ee53d037b24a327e92c4a00c2..042723336b4b6b97c976855813a93107b4b71c0b 100644 --- a/SearchListApplications/src/components/StandardFormRow/index.less +++ b/SearchListApplications/src/components/StandardFormRow/index.less @@ -1,17 +1,17 @@ @import '~antd/lib/style/themes/default.less'; .standardFormRow { - border-bottom: 1px dashed @border-color-split; - padding-bottom: 16px; - margin-bottom: 16px; display: flex; + margin-bottom: 16px; + padding-bottom: 16px; + border-bottom: 1px dashed @border-color-split; :global { .ant-form-item { margin-right: 24px; } .ant-form-item-label label { - color: @text-color; margin-right: 0; + color: @text-color; } .ant-form-item-label, .ant-form-item-control { @@ -20,16 +20,16 @@ } } .label { + flex: 0 0 auto; + margin-right: 24px; color: @heading-color; font-size: @font-size-base; - margin-right: 24px; - flex: 0 0 auto; text-align: right; & > span { display: inline-block; height: 32px; line-height: 32px; - &:after { + &::after { content: ':'; } } @@ -45,9 +45,9 @@ } .standardFormRowLast { - border: none; - padding-bottom: 0; margin-bottom: 0; + padding-bottom: 0; + border: none; } .standardFormRowBlock { diff --git a/SearchListApplications/src/components/TagSelect/index.tsx b/SearchListApplications/src/components/TagSelect/index.tsx index d1f8f878930a9dfa7b8dc4414484017be21668e7..2a2c00097bafd11afc041c6e1001160746126bcc 100644 --- a/SearchListApplications/src/components/TagSelect/index.tsx +++ b/SearchListApplications/src/components/TagSelect/index.tsx @@ -59,13 +59,6 @@ class TagSelect extends Component { }, }; static Option: TagSelectOption = TagSelectOption; - constructor(props: TagSelectProps) { - super(props); - this.state = { - expand: false, - value: props.value || props.defaultValue || [], - }; - } static getDerivedStateFromProps(nextProps: TagSelectProps) { if ('value' in nextProps) { @@ -73,6 +66,13 @@ class TagSelect extends Component { } return null; } + constructor(props: TagSelectProps) { + super(props); + this.state = { + expand: false, + value: props.value || props.defaultValue || [], + }; + } onChange = (value: (string | number)[]) => { const { onChange } = this.props; @@ -93,7 +93,7 @@ class TagSelect extends Component { }; getAllTags() { - let { children } = this.props; + const { children } = this.props; const childrenArray = React.Children.toArray(children) as React.ReactElement[]; const checkedTags = childrenArray .filter(child => this.isTagSelectOption(child)) diff --git a/SearchListApplications/src/data.d.ts b/SearchListApplications/src/data.d.ts index 6a4a88ce1a0c1b9d32dd8a5925828858d27cc0b4..4effd165b5ab4f8ba031051ca75a02ef55833924 100644 --- a/SearchListApplications/src/data.d.ts +++ b/SearchListApplications/src/data.d.ts @@ -4,7 +4,7 @@ export interface Member { id: string; } -export interface ListItemDataType { +export interface ListItemDatatype { id: string; owner: string; title: string; diff --git a/SearchListApplications/src/index.tsx b/SearchListApplications/src/index.tsx index af78fcd0302feef09ddd5583c51299596010bef0..30ffa88d75aeb613dd689fb52415db7654cd5132 100644 --- a/SearchListApplications/src/index.tsx +++ b/SearchListApplications/src/index.tsx @@ -4,7 +4,6 @@ import { connect } from 'dva'; import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd'; import TagSelect from './components/TagSelect'; import StandardFormRow from './components/StandardFormRow'; -import { formatWan } from './utils/utils'; import styles from './style.less'; import { IStateType } from './model'; import { Dispatch } from 'redux'; @@ -14,8 +13,34 @@ import { ListItemDataType } from './data'; const { Option } = Select; const FormItem = Form.Item; +export function formatWan(val: number) { + const v = val * 1; + if (!v || Number.isNaN(v)) return ''; + + let result = val; + if (val > 10000) { + result = ( + + {Math.floor(val / 10000)} + + 万 + + + ); + } + return result; +} + interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { - dispatch: Dispatch; + dispatch: Dispatch; BLOCK_NAME_CAMEL_CASE: IStateType; loading: boolean; } @@ -89,7 +114,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {getFieldDecorator('category')( - + 类目一 类目二 类目三 @@ -102,7 +127,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component类目十 类目十一 类目十二 - + , )} @@ -113,7 +138,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -123,7 +148,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -143,16 +168,16 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component + , - + , - + , - + , ]} @@ -196,5 +221,5 @@ export default connect( }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.BLOCK_NAME_CAMEL_CASE, - }) + }), )(WarpForm); diff --git a/SearchListApplications/src/model.ts b/SearchListApplications/src/model.ts index 24c2230c35d4fbff940fed19f6231cb21faee61b..ef64e05a5f4f60d2540bbac409e95efe358ef14f 100644 --- a/SearchListApplications/src/model.ts +++ b/SearchListApplications/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/SearchListApplications/src/style.less b/SearchListApplications/src/style.less index 861876f689d6603707bd4a9f443ba94aebc159c7..fadbdc0b9e776fe28399b10d60e82e67a84a2161 100644 --- a/SearchListApplications/src/style.less +++ b/SearchListApplications/src/style.less @@ -20,23 +20,24 @@ } .cardInfo { .clearfix(); + margin-top: 16px; margin-left: 40px; & > div { position: relative; - text-align: left; float: left; width: 50%; + text-align: left; p { - line-height: 32px; - font-size: 24px; margin: 0; + font-size: 24px; + line-height: 32px; } p:first-child { + margin-bottom: 4px; color: @text-color-secondary; font-size: 12px; line-height: 20px; - margin-bottom: 4px; } } } diff --git a/SearchListApplications/src/utils/utils.js b/SearchListApplications/src/utils/utils.js deleted file mode 100644 index ad46b9c9fa3ba1322d951d8df8dc7b8120a45b71..0000000000000000000000000000000000000000 --- a/SearchListApplications/src/utils/utils.js +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; - -export function formatWan(val) { - const v = val * 1; - if (!v || Number.isNaN(v)) return ''; - - let result = val; - if (val > 10000) { - result = Math.floor(val / 10000); - result = ( - - {result} - - 万 - - - ); - } - return result; -} diff --git a/SearchListApplications/src/utils/utils.less b/SearchListApplications/src/utils/utils.less index 725792252787f49efba4f4e887301195a9818f3f..de1aa64222b6f14328d3a9e3c262ac5a31cce5af 100644 --- a/SearchListApplications/src/utils/utils.less +++ b/SearchListApplications/src/utils/utils.less @@ -1,34 +1,34 @@ .textOverflow() { overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; } .textOverflowMulti(@line: 3, @bg: #fff) { - overflow: hidden; position: relative; - line-height: 1.5em; max-height: @line * 1.5em; - text-align: justify; margin-right: -1em; padding-right: 1em; - &:before { - background: @bg; - content: '...'; - padding: 0 1px; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { position: absolute; right: 14px; bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; } - &:after { - background: white; - content: ''; - margin-top: 0.2em; + &::after { position: absolute; right: 14px; width: 1em; height: 1em; + margin-top: 0.2em; + background: white; + content: ''; } } @@ -36,15 +36,15 @@ // ------------------------ .clearfix() { zoom: 1; - &:before, - &:after { - content: ' '; + &::before, + &::after { display: table; + content: ' '; } - &:after { + &::after { clear: both; - visibility: hidden; - font-size: 0; height: 0; + font-size: 0; + visibility: hidden; } } diff --git a/SearchListArticles/package.json b/SearchListArticles/package.json index 36299fce1a893dbb77c8d6dbf84366777ea5f887..c5d102d5f483ce66ec45a7af0ca0de915613d11e 100644 --- a/SearchListArticles/package.json +++ b/SearchListArticles/package.json @@ -27,4 +27,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/SearchListArticles/src/components/ArticleListContent/index.less b/SearchListArticles/src/components/ArticleListContent/index.less index acf2c919143d4ef858159dcb7470fe7728afb9bc..dd0baa101d5ef10a432d5531732552ba3ffd266b 100644 --- a/SearchListArticles/src/components/ArticleListContent/index.less +++ b/SearchListArticles/src/components/ArticleListContent/index.less @@ -2,25 +2,25 @@ .listContent { .description { - line-height: 22px; max-width: 720px; + line-height: 22px; } .extra { - color: @text-color-secondary; margin-top: 16px; + color: @text-color-secondary; line-height: 22px; & > :global(.ant-avatar) { - vertical-align: top; - margin-right: 8px; - width: 20px; - height: 20px; position: relative; top: 1px; + width: 20px; + height: 20px; + margin-right: 8px; + vertical-align: top; } & > em { + margin-left: 16px; color: @disabled-color; font-style: normal; - margin-left: 16px; } } } @@ -30,8 +30,8 @@ .extra { & > em { display: block; - margin-left: 0; margin-top: 8px; + margin-left: 0; } } } diff --git a/SearchListArticles/src/components/StandardFormRow/index.less b/SearchListArticles/src/components/StandardFormRow/index.less index 83ab019f43217c2ee53d037b24a327e92c4a00c2..042723336b4b6b97c976855813a93107b4b71c0b 100644 --- a/SearchListArticles/src/components/StandardFormRow/index.less +++ b/SearchListArticles/src/components/StandardFormRow/index.less @@ -1,17 +1,17 @@ @import '~antd/lib/style/themes/default.less'; .standardFormRow { - border-bottom: 1px dashed @border-color-split; - padding-bottom: 16px; - margin-bottom: 16px; display: flex; + margin-bottom: 16px; + padding-bottom: 16px; + border-bottom: 1px dashed @border-color-split; :global { .ant-form-item { margin-right: 24px; } .ant-form-item-label label { - color: @text-color; margin-right: 0; + color: @text-color; } .ant-form-item-label, .ant-form-item-control { @@ -20,16 +20,16 @@ } } .label { + flex: 0 0 auto; + margin-right: 24px; color: @heading-color; font-size: @font-size-base; - margin-right: 24px; - flex: 0 0 auto; text-align: right; & > span { display: inline-block; height: 32px; line-height: 32px; - &:after { + &::after { content: ':'; } } @@ -45,9 +45,9 @@ } .standardFormRowLast { - border: none; - padding-bottom: 0; margin-bottom: 0; + padding-bottom: 0; + border: none; } .standardFormRowBlock { diff --git a/SearchListArticles/src/components/TagSelect/index.tsx b/SearchListArticles/src/components/TagSelect/index.tsx index d1f8f878930a9dfa7b8dc4414484017be21668e7..2a2c00097bafd11afc041c6e1001160746126bcc 100644 --- a/SearchListArticles/src/components/TagSelect/index.tsx +++ b/SearchListArticles/src/components/TagSelect/index.tsx @@ -59,13 +59,6 @@ class TagSelect extends Component { }, }; static Option: TagSelectOption = TagSelectOption; - constructor(props: TagSelectProps) { - super(props); - this.state = { - expand: false, - value: props.value || props.defaultValue || [], - }; - } static getDerivedStateFromProps(nextProps: TagSelectProps) { if ('value' in nextProps) { @@ -73,6 +66,13 @@ class TagSelect extends Component { } return null; } + constructor(props: TagSelectProps) { + super(props); + this.state = { + expand: false, + value: props.value || props.defaultValue || [], + }; + } onChange = (value: (string | number)[]) => { const { onChange } = this.props; @@ -93,7 +93,7 @@ class TagSelect extends Component { }; getAllTags() { - let { children } = this.props; + const { children } = this.props; const childrenArray = React.Children.toArray(children) as React.ReactElement[]; const checkedTags = childrenArray .filter(child => this.isTagSelectOption(child)) diff --git a/SearchListArticles/src/data.d.ts b/SearchListArticles/src/data.d.ts index 6a4a88ce1a0c1b9d32dd8a5925828858d27cc0b4..51542b80cde11f46245eb4a38b11de02423765ce 100644 --- a/SearchListArticles/src/data.d.ts +++ b/SearchListArticles/src/data.d.ts @@ -1,10 +1,10 @@ -export interface Member { +export interface member { avatar: string; name: string; id: string; } -export interface ListItemDataType { +export interface listitemdatatype { id: string; owner: string; title: string; diff --git a/SearchListArticles/src/index.tsx b/SearchListArticles/src/index.tsx index 094a3b35a76b5fc86e27b893c73598bc32e85892..3efaaa4ca91fb727934bc23d342a9b56a9a449bc 100644 --- a/SearchListArticles/src/index.tsx +++ b/SearchListArticles/src/index.tsx @@ -17,7 +17,7 @@ const FormItem = Form.Item; const pageSize = 5; interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { - dispatch: Dispatch; + dispatch: Dispatch; BLOCK_NAME_CAMEL_CASE: IStateType; loading: boolean; } @@ -134,7 +134,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component类目十 类目十一 类目十二 - + , )} @@ -155,7 +155,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component ))} - + , )} 只看自己的 @@ -171,7 +171,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -180,7 +180,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -204,9 +204,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component, - , - , + , + , + , ]} extra={

} > @@ -257,5 +257,5 @@ export default connect( }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.BLOCK_NAME_CAMEL_CASE, - }) + }), )(WarpForm); diff --git a/SearchListArticles/src/model.ts b/SearchListArticles/src/model.ts index 73fea52bb8f35153d77b7624263be7833832d739..8a05b1bd04d0517cda6e6e47c2e9397e12e3d413 100644 --- a/SearchListArticles/src/model.ts +++ b/SearchListArticles/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/SearchListProjects/package.json b/SearchListProjects/package.json index e61f9e39614c663c81031292de06c921cc3a7695..2a77d0351a4d637f2a8880263a8d590682735981 100644 --- a/SearchListProjects/package.json +++ b/SearchListProjects/package.json @@ -27,4 +27,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/SearchListProjects/src/components/AvatarList/index.tsx b/SearchListProjects/src/components/AvatarList/index.tsx index c37efcf58a12048dc02cc2e6f7971bd8fd4e1c06..0e63359647515cc9245a5a02d15a8bebe28b5537 100644 --- a/SearchListProjects/src/components/AvatarList/index.tsx +++ b/SearchListProjects/src/components/AvatarList/index.tsx @@ -60,7 +60,7 @@ const AvatarList: React.SFC & { Item: typeof Item } = ({ const childrenWithProps = childrenArray.slice(0, numToShow).map(child => React.cloneElement(child, { size, - }) + }), ); if (numToShow < numOfChildren) { @@ -69,7 +69,7 @@ const AvatarList: React.SFC & { Item: typeof Item } = ({ childrenWithProps.push(
  • {`+${numOfChildren - maxLength}`} -
  • + , ); } diff --git a/SearchListProjects/src/components/StandardFormRow/index.less b/SearchListProjects/src/components/StandardFormRow/index.less index 83ab019f43217c2ee53d037b24a327e92c4a00c2..042723336b4b6b97c976855813a93107b4b71c0b 100644 --- a/SearchListProjects/src/components/StandardFormRow/index.less +++ b/SearchListProjects/src/components/StandardFormRow/index.less @@ -1,17 +1,17 @@ @import '~antd/lib/style/themes/default.less'; .standardFormRow { - border-bottom: 1px dashed @border-color-split; - padding-bottom: 16px; - margin-bottom: 16px; display: flex; + margin-bottom: 16px; + padding-bottom: 16px; + border-bottom: 1px dashed @border-color-split; :global { .ant-form-item { margin-right: 24px; } .ant-form-item-label label { - color: @text-color; margin-right: 0; + color: @text-color; } .ant-form-item-label, .ant-form-item-control { @@ -20,16 +20,16 @@ } } .label { + flex: 0 0 auto; + margin-right: 24px; color: @heading-color; font-size: @font-size-base; - margin-right: 24px; - flex: 0 0 auto; text-align: right; & > span { display: inline-block; height: 32px; line-height: 32px; - &:after { + &::after { content: ':'; } } @@ -45,9 +45,9 @@ } .standardFormRowLast { - border: none; - padding-bottom: 0; margin-bottom: 0; + padding-bottom: 0; + border: none; } .standardFormRowBlock { diff --git a/SearchListProjects/src/components/TagSelect/index.tsx b/SearchListProjects/src/components/TagSelect/index.tsx index d1f8f878930a9dfa7b8dc4414484017be21668e7..2a2c00097bafd11afc041c6e1001160746126bcc 100644 --- a/SearchListProjects/src/components/TagSelect/index.tsx +++ b/SearchListProjects/src/components/TagSelect/index.tsx @@ -59,13 +59,6 @@ class TagSelect extends Component { }, }; static Option: TagSelectOption = TagSelectOption; - constructor(props: TagSelectProps) { - super(props); - this.state = { - expand: false, - value: props.value || props.defaultValue || [], - }; - } static getDerivedStateFromProps(nextProps: TagSelectProps) { if ('value' in nextProps) { @@ -73,6 +66,13 @@ class TagSelect extends Component { } return null; } + constructor(props: TagSelectProps) { + super(props); + this.state = { + expand: false, + value: props.value || props.defaultValue || [], + }; + } onChange = (value: (string | number)[]) => { const { onChange } = this.props; @@ -93,7 +93,7 @@ class TagSelect extends Component { }; getAllTags() { - let { children } = this.props; + const { children } = this.props; const childrenArray = React.Children.toArray(children) as React.ReactElement[]; const checkedTags = childrenArray .filter(child => this.isTagSelectOption(child)) diff --git a/SearchListProjects/src/data.d.ts b/SearchListProjects/src/data.d.ts index 6a4a88ce1a0c1b9d32dd8a5925828858d27cc0b4..51542b80cde11f46245eb4a38b11de02423765ce 100644 --- a/SearchListProjects/src/data.d.ts +++ b/SearchListProjects/src/data.d.ts @@ -1,10 +1,10 @@ -export interface Member { +export interface member { avatar: string; name: string; id: string; } -export interface ListItemDataType { +export interface listitemdatatype { id: string; owner: string; title: string; diff --git a/SearchListProjects/src/index.tsx b/SearchListProjects/src/index.tsx index becd1949dfa310101a872008aea77c449c014850..1b67b7fbc65cfefaf864f0a0c10b91e3f22099df 100644 --- a/SearchListProjects/src/index.tsx +++ b/SearchListProjects/src/index.tsx @@ -15,7 +15,7 @@ const FormItem = Form.Item; const { Paragraph } = Typography; interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { - dispatch: Dispatch; + dispatch: Dispatch; BLOCK_NAME_CAMEL_CASE: IStateType; loading: boolean; } @@ -107,7 +107,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component类目十 类目十一 类目十二 - + , )} @@ -118,7 +118,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -128,7 +128,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component - + , )} @@ -165,5 +165,5 @@ export default connect( }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.BLOCK_NAME_CAMEL_CASE, - }) + }), )(WarpForm); diff --git a/SearchListProjects/src/model.ts b/SearchListProjects/src/model.ts index 24c2230c35d4fbff940fed19f6231cb21faee61b..ef64e05a5f4f60d2540bbac409e95efe358ef14f 100644 --- a/SearchListProjects/src/model.ts +++ b/SearchListProjects/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/SearchListProjects/src/style.less b/SearchListProjects/src/style.less index adad803742df291977197246b7a7e9e0b9bfa729..682dba3ab7feaaf6adb88d3421d0066b22bb0cfa 100644 --- a/SearchListProjects/src/style.less +++ b/SearchListProjects/src/style.less @@ -9,15 +9,15 @@ .ant-card-meta-title { margin-bottom: 4px; & > a { - color: @heading-color; display: inline-block; max-width: 100%; + color: @heading-color; } } .ant-card-meta-description { height: 44px; - line-height: 22px; overflow: hidden; + line-height: 22px; } } @@ -32,13 +32,13 @@ .cardItemContent { display: flex; + height: 20px; margin-top: 16px; margin-bottom: -4px; line-height: 20px; - height: 20px; & > span { - color: @text-color-secondary; flex: 1; + color: @text-color-secondary; font-size: 12px; } .avatarList { diff --git a/SearchListProjects/src/utils/utils.less b/SearchListProjects/src/utils/utils.less index 725792252787f49efba4f4e887301195a9818f3f..de1aa64222b6f14328d3a9e3c262ac5a31cce5af 100644 --- a/SearchListProjects/src/utils/utils.less +++ b/SearchListProjects/src/utils/utils.less @@ -1,34 +1,34 @@ .textOverflow() { overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; } .textOverflowMulti(@line: 3, @bg: #fff) { - overflow: hidden; position: relative; - line-height: 1.5em; max-height: @line * 1.5em; - text-align: justify; margin-right: -1em; padding-right: 1em; - &:before { - background: @bg; - content: '...'; - padding: 0 1px; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { position: absolute; right: 14px; bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; } - &:after { - background: white; - content: ''; - margin-top: 0.2em; + &::after { position: absolute; right: 14px; width: 1em; height: 1em; + margin-top: 0.2em; + background: white; + content: ''; } } @@ -36,15 +36,15 @@ // ------------------------ .clearfix() { zoom: 1; - &:before, - &:after { - content: ' '; + &::before, + &::after { display: table; + content: ' '; } - &:after { + &::after { clear: both; - visibility: hidden; - font-size: 0; height: 0; + font-size: 0; + visibility: hidden; } } diff --git a/StepForm/package.json b/StepForm/package.json index 96150fee66224b4ec4293109e88d6b2558a371b6..0924b83f0593608ec33ed68f255b4bd5e74a0254 100644 --- a/StepForm/package.json +++ b/StepForm/package.json @@ -26,4 +26,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/StepForm/src/components/Step1/index.less b/StepForm/src/components/Step1/index.less index 713dd54c5ba3fbc58f50f77cffbedd2b30a361c9..452e1b3fee6d329c2a36d799375bfe5a9e502f57 100644 --- a/StepForm/src/components/Step1/index.less +++ b/StepForm/src/components/Step1/index.less @@ -1,8 +1,8 @@ @import '~antd/lib/style/themes/default.less'; .stepForm { - margin: 40px auto 0; max-width: 500px; + margin: 40px auto 0; } .stepFormText { @@ -16,8 +16,8 @@ } .result { - margin: 0 auto; max-width: 560px; + margin: 0 auto; padding: 24px 0 8px; } @@ -25,9 +25,9 @@ padding: 0 56px; color: @text-color-secondary; h3 { - font-size: 16px; margin: 0 0 12px 0; color: @text-color-secondary; + font-size: 16px; line-height: 32px; } h4 { @@ -57,9 +57,9 @@ } } .label { + padding-right: 8px; color: @heading-color; text-align: right; - padding-right: 8px; @media screen and (max-width: @screen-sm) { text-align: left; } @@ -67,9 +67,9 @@ } .money { - font-family: 'Helvetica Neue', sans-serif; font-weight: 500; font-size: 20px; + font-family: 'Helvetica Neue', sans-serif; line-height: 14px; } diff --git a/StepForm/src/components/Step1/index.tsx b/StepForm/src/components/Step1/index.tsx index fe3acd665bf151691b5df7f6975a9da852d933a3..066a51bbbd99c2a4565fe2e4bac75480dbac2242 100644 --- a/StepForm/src/components/Step1/index.tsx +++ b/StepForm/src/components/Step1/index.tsx @@ -18,7 +18,7 @@ const formItemLayout = { }; interface Step1Props extends FormComponentProps { data?: IStateType['step']; - dispatch?: Dispatch; + dispatch?: Dispatch; } class Step1 extends React.PureComponent { @@ -52,7 +52,7 @@ class Step1 extends React.PureComponent { })( + , )} diff --git a/StepForm/src/components/Step2/index.less b/StepForm/src/components/Step2/index.less index 713dd54c5ba3fbc58f50f77cffbedd2b30a361c9..452e1b3fee6d329c2a36d799375bfe5a9e502f57 100644 --- a/StepForm/src/components/Step2/index.less +++ b/StepForm/src/components/Step2/index.less @@ -1,8 +1,8 @@ @import '~antd/lib/style/themes/default.less'; .stepForm { - margin: 40px auto 0; max-width: 500px; + margin: 40px auto 0; } .stepFormText { @@ -16,8 +16,8 @@ } .result { - margin: 0 auto; max-width: 560px; + margin: 0 auto; padding: 24px 0 8px; } @@ -25,9 +25,9 @@ padding: 0 56px; color: @text-color-secondary; h3 { - font-size: 16px; margin: 0 0 12px 0; color: @text-color-secondary; + font-size: 16px; line-height: 32px; } h4 { @@ -57,9 +57,9 @@ } } .label { + padding-right: 8px; color: @heading-color; text-align: right; - padding-right: 8px; @media screen and (max-width: @screen-sm) { text-align: left; } @@ -67,9 +67,9 @@ } .money { - font-family: 'Helvetica Neue', sans-serif; font-weight: 500; font-size: 20px; + font-family: 'Helvetica Neue', sans-serif; line-height: 14px; } diff --git a/StepForm/src/components/Step2/index.tsx b/StepForm/src/components/Step2/index.tsx index 48ea521076eae4741a2f9ef6497c84071a17ad85..78ab2a4bd839931bebdcaaef6db130b8653e79e2 100644 --- a/StepForm/src/components/Step2/index.tsx +++ b/StepForm/src/components/Step2/index.tsx @@ -16,7 +16,7 @@ const formItemLayout = { }; interface Step2Props extends FormComponentProps { data?: IStateType['step']; - dispatch?: Dispatch; + dispatch?: Dispatch; submitting?: boolean; } @@ -28,17 +28,18 @@ class Step2 extends React.Component { } const { getFieldDecorator, validateFields } = form; const onPrev = () => { - dispatch && + if (dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/saveCurrentStep', payload: 'info', }); + } }; const onValidateForm = (e: React.FormEvent) => { e.preventDefault(); validateFields((err, values) => { if (!err) { - dispatch && + if (dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/submitStepForm', payload: { @@ -46,6 +47,7 @@ class Step2 extends React.Component { ...values, }, }); + } } }); }; @@ -115,5 +117,5 @@ export default connect( }) => ({ submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submitStepForm'], data: BLOCK_NAME_CAMEL_CASE.step, - }) + }), )(Form.create()(Step2)); diff --git a/StepForm/src/components/Step3/index.less b/StepForm/src/components/Step3/index.less index 713dd54c5ba3fbc58f50f77cffbedd2b30a361c9..452e1b3fee6d329c2a36d799375bfe5a9e502f57 100644 --- a/StepForm/src/components/Step3/index.less +++ b/StepForm/src/components/Step3/index.less @@ -1,8 +1,8 @@ @import '~antd/lib/style/themes/default.less'; .stepForm { - margin: 40px auto 0; max-width: 500px; + margin: 40px auto 0; } .stepFormText { @@ -16,8 +16,8 @@ } .result { - margin: 0 auto; max-width: 560px; + margin: 0 auto; padding: 24px 0 8px; } @@ -25,9 +25,9 @@ padding: 0 56px; color: @text-color-secondary; h3 { - font-size: 16px; margin: 0 0 12px 0; color: @text-color-secondary; + font-size: 16px; line-height: 32px; } h4 { @@ -57,9 +57,9 @@ } } .label { + padding-right: 8px; color: @heading-color; text-align: right; - padding-right: 8px; @media screen and (max-width: @screen-sm) { text-align: left; } @@ -67,9 +67,9 @@ } .money { - font-family: 'Helvetica Neue', sans-serif; font-weight: 500; font-size: 20px; + font-family: 'Helvetica Neue', sans-serif; line-height: 14px; } diff --git a/StepForm/src/components/Step3/index.tsx b/StepForm/src/components/Step3/index.tsx index dec1402c4ed653fb4cc1810096b9d0d0725e3330..a1f1207880a92cdf1af17d7a950a621bc1666788 100644 --- a/StepForm/src/components/Step3/index.tsx +++ b/StepForm/src/components/Step3/index.tsx @@ -8,7 +8,7 @@ import { Dispatch } from 'redux'; interface Step3Props { data?: IStateType['step']; - dispatch?: Dispatch; + dispatch?: Dispatch; } @connect( @@ -21,7 +21,7 @@ interface Step3Props { }; }) => ({ data: BLOCK_NAME_CAMEL_CASE.step, - }) + }), ) class Step3 extends React.Component { render() { @@ -30,11 +30,12 @@ class Step3 extends React.Component { return; } const onFinish = () => { - dispatch && + if (dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/saveCurrentStep', payload: 'info', }); + } }; const information = (
    diff --git a/StepForm/src/locales/en-US.js b/StepForm/src/locales/en-US.ts similarity index 100% rename from StepForm/src/locales/en-US.js rename to StepForm/src/locales/en-US.ts diff --git a/StepForm/src/locales/pt-BR.js b/StepForm/src/locales/pt-BR.ts similarity index 100% rename from StepForm/src/locales/pt-BR.js rename to StepForm/src/locales/pt-BR.ts diff --git a/StepForm/src/locales/zh-CN.js b/StepForm/src/locales/zh-CN.ts similarity index 100% rename from StepForm/src/locales/zh-CN.js rename to StepForm/src/locales/zh-CN.ts diff --git a/StepForm/src/locales/zh-TW.js b/StepForm/src/locales/zh-TW.ts similarity index 100% rename from StepForm/src/locales/zh-TW.js rename to StepForm/src/locales/zh-TW.ts diff --git a/StepForm/src/model.ts b/StepForm/src/model.ts index 2cf19b0e4bd3e624ef623d2b5d54030710992b0e..cac2ea50c2f97af81764b333a06c8497067bea3d 100644 --- a/StepForm/src/model.ts +++ b/StepForm/src/model.ts @@ -15,7 +15,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/StepForm/src/style.less b/StepForm/src/style.less index 6b12d3c3eaf4ad2159d35b7a8550f20ac37d72e5..cb23b0b4c69f60b6c03d029a335e0ca62c0e1a00 100644 --- a/StepForm/src/style.less +++ b/StepForm/src/style.less @@ -5,9 +5,9 @@ } .heading { + margin: 0 0 16px 0; font-size: 14px; line-height: 22px; - margin: 0 0 16px 0; } .steps:global(.ant-steps) { @@ -16,9 +16,9 @@ } .errorIcon { - cursor: pointer; - color: @error-color; margin-right: 24px; + color: @error-color; + cursor: pointer; i { margin-right: 4px; } @@ -27,18 +27,18 @@ .errorPopover { :global { .ant-popover-inner-content { - padding: 0; + min-width: 256px; max-height: 290px; + padding: 0; overflow: auto; - min-width: 256px; } } } .errorListItem { + padding: 8px 16px; list-style: none; border-bottom: 1px solid @border-color-split; - padding: 8px 16px; cursor: pointer; transition: all 0.3s; &:hover { @@ -48,16 +48,16 @@ border: 0; } .errorIcon { - color: @error-color; float: left; margin-top: 4px; margin-right: 12px; padding-bottom: 22px; + color: @error-color; } .errorField { - font-size: 12px; - color: @text-color-secondary; margin-top: 2px; + color: @text-color-secondary; + font-size: 12px; } } diff --git a/TableList/package.json b/TableList/package.json index a2293e525b6eea87c309a6656ce978eb2ab594dd..9249ac84951ce0d3a3a3f82fee0cfc9b02006299 100644 --- a/TableList/package.json +++ b/TableList/package.json @@ -26,4 +26,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/TableList/src/_mock.ts b/TableList/src/_mock.ts index 46d8a02b3fc96d28255b95c3971d8829a4170b7a..918e7fb469644015f18007f653366647f22aee8d 100644 --- a/TableList/src/_mock.ts +++ b/TableList/src/_mock.ts @@ -31,10 +31,10 @@ function getRule( arg0: { list: TableListItem[]; pagination: { total: number; pageSize: number; current: number }; - } + }, ) => void; }, - u: any + u: any, ) { let url = u; if (!url || Object.prototype.toString.call(url) !== '[object String]') { @@ -58,14 +58,14 @@ function getRule( if (params.status) { const status = params.status.split(','); let filterDataSource: TableListItem[] = []; - status.forEach(s => { + status.forEach((s: string) => { filterDataSource = filterDataSource.concat( dataSource.filter(item => { if (parseInt(item.status + '', 10) === parseInt(s.split('')[0], 10)) { return true; } return false; - }) + }), ); }); dataSource = filterDataSource; @@ -75,9 +75,9 @@ function getRule( dataSource = dataSource.filter(data => data.name.indexOf(params.name) > -1); } - let pageSize = 10; + let pageSize: number = 10; if (params.pageSize) { - pageSize = parseInt(params.pageSize) * 1; + pageSize = parseInt(params.pageSize + '', 0); } const result = { @@ -96,7 +96,7 @@ function postRule( req: { url: any; body: any }, res: { json: (arg0: { list: TableListItem[]; pagination: { total: number } }) => void }, u: any, - b: { body: any } + b: { body: any }, ) { let url = u; if (!url || Object.prototype.toString.call(url) !== '[object String]') { diff --git a/TableList/src/components/CreateForm.tsx b/TableList/src/components/CreateForm.tsx index 5195e820e85b13ccd20084cd277dfae682e8d3a8..0598f3cf6515d0d85e63b301701576dd25fc2361 100644 --- a/TableList/src/components/CreateForm.tsx +++ b/TableList/src/components/CreateForm.tsx @@ -9,7 +9,7 @@ interface CreateFormProps extends FormComponentProps { handleAdd: ( fieldsValue: { desc: string; - } + }, ) => void; handleModalVisible: () => void; } diff --git a/TableList/src/components/StandardTable/index.tsx b/TableList/src/components/StandardTable/index.tsx index ab7d071035c5baf8df910ffffd6b57453279dd31..9ee88886115216ecbb3858e3fba5995ef4c195d8 100644 --- a/TableList/src/components/StandardTable/index.tsx +++ b/TableList/src/components/StandardTable/index.tsx @@ -40,17 +40,6 @@ interface StandardTableState { } class StandardTable extends Component, StandardTableState> { - constructor(props: StandardTableProps) { - super(props); - const { columns } = props; - const needTotalList = initTotalList(columns); - - this.state = { - selectedRowKeys: [], - needTotalList, - }; - } - static getDerivedStateFromProps(nextProps: StandardTableProps) { // clean state if (nextProps.selectedRows.length === 0) { @@ -62,6 +51,16 @@ class StandardTable extends Component, Standar } return null; } + constructor(props: StandardTableProps) { + super(props); + const { columns } = props; + const needTotalList = initTotalList(columns); + + this.state = { + selectedRowKeys: [], + needTotalList, + }; + } handleRowSelectChange = (selectedRowKeys: string[], selectedRows: TableListItem[]) => { let { needTotalList } = this.state; diff --git a/TableList/src/components/UpdateForm.tsx b/TableList/src/components/UpdateForm.tsx index 40b9a058cfd5d244ccc1a1a121ccfceb9a69e4cc..9883dcd034cae382560a8486c9081891273f781e 100644 --- a/TableList/src/components/UpdateForm.tsx +++ b/TableList/src/components/UpdateForm.tsx @@ -72,7 +72,7 @@ class UpdateForm extends Component { } else { handleUpdate(formVals); } - } + }, ); }); }; @@ -102,7 +102,7 @@ class UpdateForm extends Component { + , )} , @@ -112,7 +112,7 @@ class UpdateForm extends Component { + , )} , @@ -122,7 +122,7 @@ class UpdateForm extends Component { - + , )} , ]; @@ -138,7 +138,7 @@ class UpdateForm extends Component { showTime format="YYYY-MM-DD HH:mm:ss" placeholder="选择开始时间" - /> + />, )} , @@ -148,7 +148,7 @@ class UpdateForm extends Component { + , )} , ]; diff --git a/TableList/src/data.d.ts b/TableList/src/data.d.ts index a4ae013d1ec696c80a75a8a52a9d78cbb046c942..6c3d1452fb5048f9124c69b421bf8eb478f48860 100644 --- a/TableList/src/data.d.ts +++ b/TableList/src/data.d.ts @@ -1,4 +1,4 @@ -export interface TableListItem { +export interface tablelistitem { key: number; disabled?: boolean; href: string; @@ -14,18 +14,18 @@ export interface TableListItem { progress: number; } -export interface TableListPagination { +export interface tablelistpagination { total: number; pageSize: number; current: number; } -export interface TableListDate { +export interface tablelistdate { list: TableListItem[]; pagination: Partial; } -export interface TableListParams { +export interface tablelistparams { sorter: string; status: string; name: string; diff --git a/TableList/src/index.tsx b/TableList/src/index.tsx index 6dc6c2b714e44cd1685ed1e2f4c35f2f406f8487..ca7f8f9b6287eb43148c17ff07be83962d47f8d9 100644 --- a/TableList/src/index.tsx +++ b/TableList/src/index.tsx @@ -40,7 +40,7 @@ const statusMap = ['default', 'processing', 'success', 'error']; const status = ['关闭', '运行中', '已上线', '异常']; interface TableListProps extends FormComponentProps { - dispatch: Dispatch; + dispatch: Dispatch; loading: boolean; BLOCK_NAME_CAMEL_CASE: IStateType; } @@ -69,7 +69,7 @@ interface TableListState { }) => ({ BLOCK_NAME_CAMEL_CASE, loading: loading.models.rule, - }) + }), ) class TableList extends Component { state: TableListState = { @@ -152,7 +152,7 @@ class TableList extends Component { handleStandardTableChange = ( pagination: Partial, filtersArg: Record, - sorter: SorterResult + sorter: SorterResult, ) => { const { dispatch } = this.props; const { formValues } = this.state; @@ -310,7 +310,7 @@ class TableList extends Component { + , )} @@ -350,7 +350,7 @@ class TableList extends Component { + , )} @@ -364,7 +364,7 @@ class TableList extends Component {
    {getFieldDecorator('date')( - + , )} @@ -374,7 +374,7 @@ class TableList extends Component { + , )} @@ -384,7 +384,7 @@ class TableList extends Component { + , )} diff --git a/TableList/src/model.ts b/TableList/src/model.ts index 2d1c696967b413d9286494bd7bf46b83f2035917..231a3d2b0c972509b733eeb133e070333c227586 100644 --- a/TableList/src/model.ts +++ b/TableList/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/TableList/src/style.less b/TableList/src/style.less index 0140a75704530c6ce49c3714e4bdcb928c3de940..854309c2edbfafd84e483f72b55bff30686eff36 100644 --- a/TableList/src/style.less +++ b/TableList/src/style.less @@ -13,13 +13,13 @@ .tableListForm { :global { .ant-form-item { - margin-bottom: 24px; - margin-right: 0; display: flex; + margin-right: 0; + margin-bottom: 24px; > .ant-form-item-label { width: auto; - line-height: 32px; padding-right: 8px; + line-height: 32px; } .ant-form-item-control { line-height: 32px; @@ -31,8 +31,8 @@ } .submitButtons { display: block; - white-space: nowrap; margin-bottom: 24px; + white-space: nowrap; } } diff --git a/TableList/src/utils/utils.less b/TableList/src/utils/utils.less index 725792252787f49efba4f4e887301195a9818f3f..de1aa64222b6f14328d3a9e3c262ac5a31cce5af 100644 --- a/TableList/src/utils/utils.less +++ b/TableList/src/utils/utils.less @@ -1,34 +1,34 @@ .textOverflow() { overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; word-break: break-all; - white-space: nowrap; } .textOverflowMulti(@line: 3, @bg: #fff) { - overflow: hidden; position: relative; - line-height: 1.5em; max-height: @line * 1.5em; - text-align: justify; margin-right: -1em; padding-right: 1em; - &:before { - background: @bg; - content: '...'; - padding: 0 1px; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { position: absolute; right: 14px; bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; } - &:after { - background: white; - content: ''; - margin-top: 0.2em; + &::after { position: absolute; right: 14px; width: 1em; height: 1em; + margin-top: 0.2em; + background: white; + content: ''; } } @@ -36,15 +36,15 @@ // ------------------------ .clearfix() { zoom: 1; - &:before, - &:after { - content: ' '; + &::before, + &::after { display: table; + content: ' '; } - &:after { + &::after { clear: both; - visibility: hidden; - font-size: 0; height: 0; + font-size: 0; + visibility: hidden; } } diff --git a/UserLogin/package.json b/UserLogin/package.json index 8d2af3f1fac09256d240ef9a464e9e1cf9d69b98..b958db3012764bce3231c0a10ac64722c25895f6 100644 --- a/UserLogin/package.json +++ b/UserLogin/package.json @@ -27,4 +27,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/UserLogin/src/_mock.ts b/UserLogin/src/_mock.ts index 1bdba394c355190defbbe2dc0ef703c15f2b629e..f416d45619dce9d0cc202e6211d475d43472abdd 100644 --- a/UserLogin/src/_mock.ts +++ b/UserLogin/src/_mock.ts @@ -7,7 +7,7 @@ export default { req: { body: { password: any; userName: any; type: any } }, res: { send: (data: any) => void; - } + }, ) => { const { password, userName, type } = req.body; if (password === 'ant.design' && userName === 'admin') { diff --git a/UserLogin/src/components/Login/LoginItem.tsx b/UserLogin/src/components/Login/LoginItem.tsx index 18a80e750063a482be28f0c3f44645252e2aa116..185b66b538eff38e8a2413e403d49ea4ca5afef1 100644 --- a/UserLogin/src/components/Login/LoginItem.tsx +++ b/UserLogin/src/components/Login/LoginItem.tsx @@ -42,6 +42,7 @@ class WrapFormItem extends Component { getCaptchaButtonText: 'captcha', getCaptchaSecondText: 'second', }; + interval: number | undefined; constructor(props: LoginItemProps) { super(props); @@ -49,7 +50,6 @@ class WrapFormItem extends Component { count: 0, }; } - interval: number | undefined; componentDidMount() { const { updateActive, name = '' } = this.props; if (updateActive) { @@ -122,7 +122,6 @@ class WrapFormItem extends Component { ...restProps } = this.props; if (!name) { - console.warn('name is required!'); return null; } if (!form) { @@ -170,7 +169,6 @@ Object.keys(ItemMap).forEach(key => { LoginItem[key] = (props: LoginItemProps) => ( {context => { - console.log(context); return ( { + uniqueId: string; constructor(props: LoginTabProps) { super(props); this.uniqueId = generateId('login-tab-'); } - uniqueId: string; componentDidMount() { const { tabUtil } = this.props; - tabUtil && tabUtil.addTab(this.uniqueId); + if (tabUtil) { + tabUtil.addTab(this.uniqueId); + } } render() { diff --git a/UserLogin/src/components/Login/index.tsx b/UserLogin/src/components/Login/index.tsx index 38de86828ff321ed8508afeb0c8b2ca857b23ab9..da37e1f1d02b7d0140af85e4f7eff7026b07242c 100644 --- a/UserLogin/src/components/Login/index.tsx +++ b/UserLogin/src/components/Login/index.tsx @@ -14,7 +14,7 @@ export interface LoginProps { style?: React.CSSProperties; onSubmit?: (error: any, values: any) => void; className?: string; - form?: FormComponentProps['form']; + form: FormComponentProps['form']; children: React.ReactElement[]; } @@ -57,7 +57,7 @@ class Login extends Component { if (onTabChange) { onTabChange(type); } - } + }, ); }; @@ -97,10 +97,13 @@ class Login extends Component { const { active = {}, type = '' } = this.state; const { form, onSubmit } = this.props; const activeFields = active[type] || []; - form && + if (form) { form.validateFields(activeFields, { force: true }, (err, values) => { - onSubmit && onSubmit(err, values); + if (onSubmit) { + onSubmit(err, values); + } }); + } }; render() { @@ -119,7 +122,7 @@ class Login extends Component { } else { otherChildren.push(child); } - } + }, ); return ( @@ -151,4 +154,4 @@ class Login extends Component { Login[item] = LoginItem[item]; }); -export default Form.create>()(Login); +export default Form.create()(Login); diff --git a/UserLogin/src/index.tsx b/UserLogin/src/index.tsx index 9446bb48ebdb1e9bfdcfd2fe2fb18f3a575905fc..e79cd913a41fa968d8ed5486d5e581f61c477163 100644 --- a/UserLogin/src/index.tsx +++ b/UserLogin/src/index.tsx @@ -12,12 +12,12 @@ import { CheckboxChangeEvent } from 'antd/lib/checkbox'; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; -interface BLOCK_NAME_CAMEL_CASEProps { - dispatch: Dispatch; +interface PAGE_NAME_UPPER_CAMEL_CASEProps { + dispatch: Dispatch; BLOCK_NAME_CAMEL_CASE: IStateType; submitting: boolean; } -interface BLOCK_NAME_CAMEL_CASEState { +interface PAGE_NAME_UPPER_CAMEL_CASEState { type: string; autoLogin: boolean; } @@ -42,21 +42,21 @@ export interface FromDataType { }) => ({ BLOCK_NAME_CAMEL_CASE, submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/login'], - }) + }), ) -class BLOCK_NAME_CAMEL_CASE extends Component< - BLOCK_NAME_CAMEL_CASEProps, - BLOCK_NAME_CAMEL_CASEState +class PAGE_NAME_UPPER_CAMEL_CASE extends Component< + PAGE_NAME_UPPER_CAMEL_CASEProps, + PAGE_NAME_UPPER_CAMEL_CASEState > { - state: BLOCK_NAME_CAMEL_CASEState = { + state: PAGE_NAME_UPPER_CAMEL_CASEState = { type: 'account', autoLogin: true, }; + loginForm: FormComponentProps['form'] | undefined | null; onTabChange = (type: string) => { this.setState({ type }); }; - loginForm: FormComponentProps['form'] | undefined | null; onGetCaptcha = () => new Promise((resolve, reject) => { if (!this.loginForm) { @@ -120,7 +120,7 @@ class BLOCK_NAME_CAMEL_CASE extends Component< loginType === 'account' && !submitting && this.renderMessage( - formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }) + formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }), )} (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/UserLogin/src/style.less b/UserLogin/src/style.less index eb5da08a64d52cbc0dcca2977cd30ace3b0607ce..897d8bdfb00be3a00ce498326b0a051bc541c01e 100644 --- a/UserLogin/src/style.less +++ b/UserLogin/src/style.less @@ -8,9 +8,9 @@ } .icon { - font-size: 24px; - color: rgba(0, 0, 0, 0.2); margin-left: 16px; + color: rgba(0, 0, 0, 0.2); + font-size: 24px; vertical-align: middle; cursor: pointer; transition: color 0.3s; @@ -21,9 +21,9 @@ } .other { - text-align: left; margin-top: 24px; line-height: 22px; + text-align: left; .register { float: right; diff --git a/UserLogin/src/utils/utils.js b/UserLogin/src/utils/utils.ts similarity index 100% rename from UserLogin/src/utils/utils.js rename to UserLogin/src/utils/utils.ts diff --git a/UserRegister/package.json b/UserRegister/package.json index b5887e92cc111f8e143210cd3ac8b4596e2e1b64..8d6268abe356ec52648870e336b003a9bdbe4439 100644 --- a/UserRegister/package.json +++ b/UserRegister/package.json @@ -28,4 +28,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/UserRegister/src/_mock.ts b/UserRegister/src/_mock.ts index f57799be601c84640959eab61c93bcebfe560fdc..6fc7eb46b0d59f503d916385150c9876f1f4fe0f 100644 --- a/UserRegister/src/_mock.ts +++ b/UserRegister/src/_mock.ts @@ -1,7 +1,7 @@ export default { 'POST /api/BLOCK_NAME/register': ( req: any, - res: { send: (arg0: { status: string; currentAuthority: string }) => void } + res: { send: (arg0: { status: string; currentAuthority: string }) => void }, ) => { res.send({ status: 'ok', currentAuthority: 'user' }); }, diff --git a/UserRegister/src/index.tsx b/UserRegister/src/index.tsx index 808c837dfbae8e01f86677d8ced1896897f469eb..3d91b3bde674a9701a9f2268c94affdf5bbcb1fe 100644 --- a/UserRegister/src/index.tsx +++ b/UserRegister/src/index.tsx @@ -41,7 +41,7 @@ const passwordProgressMap: { }; interface BLOCK_NAME_CAMEL_CASEProps extends FormComponentProps { - dispatch: Dispatch; + dispatch: Dispatch; BLOCK_NAME_CAMEL_CASE: IStateType; submitting: boolean; } @@ -76,7 +76,7 @@ export interface IUserRegisterParams { }) => ({ BLOCK_NAME_CAMEL_CASE, submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submit'], - }) + }), ) class PAGE_NAME_UPPER_CAMEL_CASE extends Component< BLOCK_NAME_CAMEL_CASEProps, @@ -89,9 +89,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< help: '', prefix: '86', }; + interval: number | undefined; componentDidUpdate() { - const { form, BLOCK_NAME_CAMEL_CASE } = this.props; + const { BLOCK_NAME_CAMEL_CASE } = this.props; if (BLOCK_NAME_CAMEL_CASE.status === 'ok') { message.success('注册成功!'); } @@ -100,7 +101,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< componentWillUnmount() { clearInterval(this.interval); } - interval: number | undefined; onGetCaptcha = () => { let count = 59; this.setState({ count }); @@ -193,6 +193,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< return value && value.length ? (
    + />, )} @@ -261,7 +262,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< size="large" type="password" placeholder={formatMessage({ id: 'BLOCK_NAME.password.placeholder' })} - /> + />, )} @@ -281,7 +282,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< size="large" type="password" placeholder={formatMessage({ id: 'BLOCK_NAME.confirm-password.placeholder' })} - /> + />, )} @@ -311,7 +312,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< size="large" style={{ width: '80%' }} placeholder={formatMessage({ id: 'BLOCK_NAME.phone-number.placeholder' })} - /> + />, )} @@ -329,7 +330,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component< + />, )}
    diff --git a/UserRegister/src/model.ts b/UserRegister/src/model.ts index f5a1fc17620aa3b199cfe1d256e82a1dfd14e8fd..d138c909cd3370dbc787f8d33255143ecab4dc7f 100644 --- a/UserRegister/src/model.ts +++ b/UserRegister/src/model.ts @@ -10,7 +10,7 @@ export interface IStateType { export type Effect = ( action: AnyAction, - effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T } + effects: EffectsCommandMap & { select: (func: (state: IStateType) => T) => T }, ) => void; export interface ModelType { diff --git a/UserRegister/src/style.less b/UserRegister/src/style.less index acd1211a7f1458d3306dd52083015c4ed69fd7d6..c6d5b77c202386b477bdb8e4d8f19454f2142b85 100644 --- a/UserRegister/src/style.less +++ b/UserRegister/src/style.less @@ -11,8 +11,8 @@ } h3 { - font-size: 16px; margin-bottom: 20px; + font-size: 16px; } .getCaptcha { diff --git a/UserRegisterResult/package.json b/UserRegisterResult/package.json index 11b360493444e21d850d79eb4f8e2a2ddd40d5c6..e77d52de59dee307331f3cabb14ed1d58e259e42 100644 --- a/UserRegisterResult/package.json +++ b/UserRegisterResult/package.json @@ -23,4 +23,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Workplace/package.json b/Workplace/package.json index c382be0acedb40743a3dad56551e8606d5625b79..f1ce312670bb55075ecb7640837dcaf8935e4e5e 100644 --- a/Workplace/package.json +++ b/Workplace/package.json @@ -28,4 +28,4 @@ "blockConfig": { "specVersion": "0.1" } -} \ No newline at end of file +} diff --git a/Workplace/src/_mock.js b/Workplace/src/_mock.ts similarity index 100% rename from Workplace/src/_mock.js rename to Workplace/src/_mock.ts diff --git a/Workplace/src/components/EditableLinkGroup/index.less b/Workplace/src/components/EditableLinkGroup/index.less index a421df6fe8d1f132c04db8f326e45660cd8621cb..ba53315d9ae8bfffe574959032ff27e8c7f41bb0 100644 --- a/Workplace/src/components/EditableLinkGroup/index.less +++ b/Workplace/src/components/EditableLinkGroup/index.less @@ -4,11 +4,11 @@ padding: 20px 0 8px 24px; font-size: 0; & > a { - color: @text-color; display: inline-block; - font-size: @font-size-base; - margin-bottom: 13px; width: 25%; + margin-bottom: 13px; + color: @text-color; + font-size: @font-size-base; &:hover { color: @primary-color; } diff --git a/Workplace/src/components/EditableLinkGroup/index.tsx b/Workplace/src/components/EditableLinkGroup/index.tsx index 3e3462047c4624aa4cb350cfef8f552873f14686..be9b253cdc97687444fd64909df4708cd07859b4 100644 --- a/Workplace/src/components/EditableLinkGroup/index.tsx +++ b/Workplace/src/components/EditableLinkGroup/index.tsx @@ -33,8 +33,8 @@ class EditableLinkGroup extends PureComponent { to: link.href, href: link.href, }, - link.title - ) + link.title, + ), )} {