Reduce default pagination limit to 10 and add description column to
transactions table Add description column to the Transactions page with ellipsis styling for long text Update default limit from 20 to 10 across all paginated endpoints (deals, transactions, and upload confirmation)
This commit is contained in:
@@ -28,7 +28,7 @@ function fmtDatetime(dt) {
|
|||||||
|
|
||||||
const DEAL_FILTER_DEFAULT = {
|
const DEAL_FILTER_DEFAULT = {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 10,
|
||||||
start_date: "",
|
start_date: "",
|
||||||
end_date: "",
|
end_date: "",
|
||||||
direction: "",
|
direction: "",
|
||||||
@@ -47,7 +47,7 @@ export default function Transactions() {
|
|||||||
});
|
});
|
||||||
const [filters, setFilters] = useState({
|
const [filters, setFilters] = useState({
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 10,
|
||||||
start_date: "",
|
start_date: "",
|
||||||
end_date: "",
|
end_date: "",
|
||||||
source_type: "",
|
source_type: "",
|
||||||
@@ -431,6 +431,7 @@ export default function Transactions() {
|
|||||||
金额
|
金额
|
||||||
</Th>
|
</Th>
|
||||||
<Th field="counterparty">对方</Th>
|
<Th field="counterparty">对方</Th>
|
||||||
|
<th>描述</th>
|
||||||
<Th field="source_type">来源</Th>
|
<Th field="source_type">来源</Th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -468,6 +469,18 @@ export default function Transactions() {
|
|||||||
{formatAmount(tx.amount)}
|
{formatAmount(tx.amount)}
|
||||||
</td>
|
</td>
|
||||||
<td>{tx.counterparty || "--"}</td>
|
<td>{tx.counterparty || "--"}</td>
|
||||||
|
<td
|
||||||
|
style={{
|
||||||
|
maxWidth: 140,
|
||||||
|
overflow: "hidden",
|
||||||
|
textOverflow: "ellipsis",
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
fontSize: 13,
|
||||||
|
}}
|
||||||
|
title={tx.description}
|
||||||
|
>
|
||||||
|
{tx.description || "--"}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span
|
<span
|
||||||
className={`source-type-label source-${tx.source_type}`}
|
className={`source-type-label source-${tx.source_type}`}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ router.get("/", (req, res) => {
|
|||||||
const db = getDB();
|
const db = getDB();
|
||||||
const {
|
const {
|
||||||
page = 1,
|
page = 1,
|
||||||
limit = 20,
|
limit = 10,
|
||||||
start_date,
|
start_date,
|
||||||
end_date,
|
end_date,
|
||||||
category,
|
category,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ router.get("/", (req, res) => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
page = 1,
|
page = 1,
|
||||||
limit = 20,
|
limit = 10,
|
||||||
start_date,
|
start_date,
|
||||||
end_date,
|
end_date,
|
||||||
source_type,
|
source_type,
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ router.post("/confirm", (req, res) => {
|
|||||||
const ins = db.prepare(`INSERT OR IGNORE INTO transactions (
|
const ins = db.prepare(`INSERT OR IGNORE INTO transactions (
|
||||||
transaction_code, source_id, source_type, transaction_date, transaction_time,
|
transaction_code, source_id, source_type, transaction_date, transaction_time,
|
||||||
counterparty, description, notes, amount, direction, status, method, balance
|
counterparty, description, notes, amount, direction, status, method, balance
|
||||||
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)`);
|
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)`);
|
||||||
|
|
||||||
let inserted = 0,
|
let inserted = 0,
|
||||||
skip = 0;
|
skip = 0;
|
||||||
@@ -180,7 +180,6 @@ router.post("/confirm", (req, res) => {
|
|||||||
tx.status || "",
|
tx.status || "",
|
||||||
tx.method || "",
|
tx.method || "",
|
||||||
tx.balance || null,
|
tx.balance || null,
|
||||||
null,
|
|
||||||
);
|
);
|
||||||
if (r.changes > 0) inserted++;
|
if (r.changes > 0) inserted++;
|
||||||
else skip++;
|
else skip++;
|
||||||
|
|||||||
Reference in New Issue
Block a user