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 = {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
limit: 10,
|
||||
start_date: "",
|
||||
end_date: "",
|
||||
direction: "",
|
||||
@@ -47,7 +47,7 @@ export default function Transactions() {
|
||||
});
|
||||
const [filters, setFilters] = useState({
|
||||
page: 1,
|
||||
limit: 20,
|
||||
limit: 10,
|
||||
start_date: "",
|
||||
end_date: "",
|
||||
source_type: "",
|
||||
@@ -431,6 +431,7 @@ export default function Transactions() {
|
||||
金额
|
||||
</Th>
|
||||
<Th field="counterparty">对方</Th>
|
||||
<th>描述</th>
|
||||
<Th field="source_type">来源</Th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -468,6 +469,18 @@ export default function Transactions() {
|
||||
{formatAmount(tx.amount)}
|
||||
</td>
|
||||
<td>{tx.counterparty || "--"}</td>
|
||||
<td
|
||||
style={{
|
||||
maxWidth: 140,
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
fontSize: 13,
|
||||
}}
|
||||
title={tx.description}
|
||||
>
|
||||
{tx.description || "--"}
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
className={`source-type-label source-${tx.source_type}`}
|
||||
|
||||
@@ -7,7 +7,7 @@ router.get("/", (req, res) => {
|
||||
const db = getDB();
|
||||
const {
|
||||
page = 1,
|
||||
limit = 20,
|
||||
limit = 10,
|
||||
start_date,
|
||||
end_date,
|
||||
category,
|
||||
|
||||
@@ -11,7 +11,7 @@ router.get("/", (req, res) => {
|
||||
|
||||
const {
|
||||
page = 1,
|
||||
limit = 20,
|
||||
limit = 10,
|
||||
start_date,
|
||||
end_date,
|
||||
source_type,
|
||||
|
||||
@@ -155,7 +155,7 @@ router.post("/confirm", (req, res) => {
|
||||
const ins = db.prepare(`INSERT OR IGNORE INTO transactions (
|
||||
transaction_code, source_id, source_type, transaction_date, transaction_time,
|
||||
counterparty, description, notes, amount, direction, status, method, balance
|
||||
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)`);
|
||||
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)`);
|
||||
|
||||
let inserted = 0,
|
||||
skip = 0;
|
||||
@@ -180,7 +180,6 @@ router.post("/confirm", (req, res) => {
|
||||
tx.status || "",
|
||||
tx.method || "",
|
||||
tx.balance || null,
|
||||
null,
|
||||
);
|
||||
if (r.changes > 0) inserted++;
|
||||
else skip++;
|
||||
|
||||
Reference in New Issue
Block a user