Skip to content

Commit

Permalink
#6 Merchants Add UI Part, TODO: API and debug
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshen committed May 1, 2020
1 parent 16c598d commit d90be09
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 184 deletions.
5 changes: 5 additions & 0 deletions src/assets/css/duocun.css
Expand Up @@ -7,4 +7,9 @@
/** table */
table.dc-table {
min-width: 750
}

/** select */
.dc-full-select {
width: 100%;
}
18 changes: 8 additions & 10 deletions src/services/api/ApiAccountService.js
@@ -1,18 +1,16 @@
import ApiService from "services/api/ApiService";
import { buildPaginationQuery } from "helper/index";
export default {
getAccountList: (page, pageSize, search = "", sort = []) => {
getAccountList: (page, pageSize, {username, type}, sort = []) => {
let query = {};
if (!search) {
query.query = buildPaginationQuery(page, pageSize, {}, [], sort);
} else {
const condition = {
username: {
$regex: search,
},
};
query.query = buildPaginationQuery(page, pageSize, condition, [], sort);
let conditions = {};
if (username) {
conditions.username = { $regex: username };
}
if (type) {
conditions.type = type;
}
query.query = buildPaginationQuery(page, pageSize, conditions, [], sort);
return ApiService.v2().get("accounts", query);
},
getAccountAllKeyword: (keyword = "") => {
Expand Down
2 changes: 1 addition & 1 deletion src/views/Accounts/AccountsTablePage.js
Expand Up @@ -45,7 +45,7 @@ export default function AccountsTablePage({ location }) {
}, [page, rowsPerPage, sort]);

const updateData = () => {
ApiAccountService.getAccountList(page, rowsPerPage, query, [sort]).then(
ApiAccountService.getAccountList(page, rowsPerPage, {username:query}, [sort]).then(
({ data }) => {
setAccounts(data.data);
setTotalRows(data.count);
Expand Down
10 changes: 10 additions & 0 deletions src/views/Common/EditSkeleton.js
Expand Up @@ -30,5 +30,15 @@ const EditSkeleton = () => (
</GridItem>
</React.Fragment>
);
export const EditSkeletonShort = () => (
<React.Fragment>
<GridItem xs={12} lg={12}>
<Skeleton height={48} />
</GridItem>
<GridItem xs={12} lg={12}>
<Skeleton height={48} />
</GridItem>
</React.Fragment>
);

export default EditSkeleton;

0 comments on commit d90be09

Please sign in to comment.