Skip to content

Commit

Permalink
refactor: Form
Browse files Browse the repository at this point in the history
  • Loading branch information
xjh22222228 committed Oct 2, 2020
1 parent 68d5672 commit 465274c
Show file tree
Hide file tree
Showing 18 changed files with 120 additions and 273 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<a href="https://github.com/xjh22222228/tomato-work/stargazers"><img src="https://img.shields.io/github/stars/xjh22222228/tomato-work" alt="Stars Badge"/></a>
<img src="https://img.shields.io/github/package-json/v/xjh22222228/tomato-work" />
<img src="https://img.shields.io/github/license/xjh22222228/tomato-work" />
<a href="https://hits.dwyl.com/xjh22222228/tomato-work">
<img src="https://hits.dwyl.com/xjh22222228/tomato-work.svg" />
</a>
</p>
</p>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/react-router-dom": "^5.1.5",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^3.6.1",
"antd": "^4.6.5",
"antd": "^4.6.6",
"axios": "^0.20.0",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
Expand Down
134 changes: 0 additions & 134 deletions src/assets/styles/style.scss
Original file line number Diff line number Diff line change
@@ -1,59 +1,5 @@
@charset "utf-8";

* {
margin: 0;
padding: 0;
}

body {
-webkit-font-smoothing: antialiased;
overflow-x: hidden;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}

h1 {
font-size: 18px;
}

h2 {
font-size: 16px;
}

h3 {
font-size: 14px;
}

h4,
h5,
h6 {
font-size: 100%;
}

address,
cite,
dfn,
em,
var {
font-style: normal;
}

small {
font-size: 12px;
}

ol,
ul,
li {
Expand All @@ -69,86 +15,6 @@ pre {
word-break: break-all;
}

abbr[title],
acronym[title] {
border-bottom: 1px dotted;
cursor: help;
}

q:after,
q:before {
content: '';
}

legend {
color: #000;
}

fieldset,
img,
iframe {
border: none;
}

button,
input,
select,
textarea {
font-size: 100%;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

input[type="text"],
input[type="password"],
input[type="submit"],
input[type="reset"],
input[type="tel"],
button {
-webkit-appearance: none;
outline: none;
border: 1px solid #e1e1e1;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none; /* 移除number类型样式 */
}

textarea {
resize: none;
outline: none;
-webkit-appearance: none;
}

button,
input[type="submit"],
input[type="reset"] {
cursor: pointer;
outline:none;
}

i,
em {
font-style: normal;
}
// 禁用系统默认菜单
a,
img {
-webkit-touch-callout: none;
}

img {
max-width: 100%;
}

input,
textarea {

&::-webkit-input-placeholder{
color:#999;
}
}
4 changes: 1 addition & 3 deletions src/services/capitalFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import api from '@/api';

// 类型
export function serviceGetCapitalFlowType() {
return http.get(api.capitalFlowType, {
headers: { isLoading: true }
});
return http.get(api.capitalFlowType);
}

export function serviceDeleteCapitalFlowType(id: string) {
Expand Down
7 changes: 2 additions & 5 deletions src/services/memorandum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ export function serviceCreateMemorandum(data: object) {
// 查询所有
export function serviceGetMemorandum(params?: object) {
return http.get(api.memorandum, {
params,
headers: { isLoading: true }
params
});
}

// 通过id查询
export function serviceGetMemorandumById(id: unknown) {
return http.get(`${api.memorandum}/${id}`, {
headers: { isLoading: true }
});
return http.get(`${api.memorandum}/${id}`);
}

// 删除
Expand Down
5 changes: 1 addition & 4 deletions src/services/todayTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export function serviceCreateTask(data: object) {

// 查询
export function serviceGetTask(params?: object) {
return http.get(api.todayTask, {
params,
headers: { isLoading: true }
});
return http.get(api.todayTask, { params });
}

// 删除
Expand Down
8 changes: 0 additions & 8 deletions src/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import CONFIG from '@/config';
import store from '@/store';
import { message } from 'antd';
import { logout } from '@/store/actions';
import { spin } from '@/utils';

let exiting = false;
const CancelToken = axios.CancelToken;
Expand Down Expand Up @@ -57,10 +56,6 @@ httpInstance.interceptors.request.use(function (config) {

const data: { [k: string]: any } = {};

if (config.headers.isLoading) {
spin.start();
}

if (method === 'post' || method === 'put') {
if (config.data instanceof FormData) {
for (let key in data) {
Expand All @@ -79,9 +74,6 @@ httpInstance.interceptors.request.use(function (config) {

httpInstance.interceptors.response.use(function (res) {
const headers = res.config.headers;
if (headers.isLoading) {
spin.done();
}

if (!res.data.success && headers.errorAlert) {
message.warn(res.data.msg ?? '服务器出小差');
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './helper';
export * from './date';
export * from './spin';
27 changes: 0 additions & 27 deletions src/utils/spin.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/views/home/capital-flow/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ const Reminder: React.FC = function() {
</div>
</div>
</div>

<Table
ref={tableRef}
getTableData={getCapitalFlow}
Expand All @@ -334,6 +335,7 @@ const Reminder: React.FC = function() {
onDelete={serviceDeleteCapitalFlow}
onAdd={() => setState({ showCreateCapitalFlowModal: true, currentRow: null })}
/>

<CreateCapitalFlow
visible={state.showCreateCapitalFlowModal}
rowData={state.currentRow}
Expand Down
Loading

0 comments on commit 465274c

Please sign in to comment.