From 35a56e74bb340a301cb2e63f647c05af607d5a9d Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 11 Jun 2022 03:53:30 +0900 Subject: [PATCH] =?UTF-8?q?refac:=20=EA=B8=88=EC=8C=80=20=EA=B2=BD?= =?UTF-8?q?=EB=A7=A4=EC=9E=A5=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/AuctionResource.vue | 242 +++++++++++++++------- hwe/ts/components/NumberInputWithInfo.vue | 3 +- 2 files changed, 169 insertions(+), 76 deletions(-) diff --git a/hwe/ts/components/AuctionResource.vue b/hwe/ts/components/AuctionResource.vue index 5e2093d5..6fb282ae 100644 --- a/hwe/ts/components/AuctionResource.vue +++ b/hwe/ts/components/AuctionResource.vue @@ -2,89 +2,101 @@
거래장
쌀 구매
-
-
번호
-
판매자
-
물품
-
수량
-
시작 구매가
-
현재 구매가
-
즉시 구매가
-
단가
-
구매 예정자
-
거래 종료
+
+
번호
+
판매자
+
수량
+
입찰자
+
입찰가
+
단가
+
마감가
+
거래 종료
-
-
{{ auction.id }}
-
{{ auction.hostName }}
-
-
{{ auction.amount }}
-
{{ auction.startBidAmount }}
-
{{ auction.highestBid ? auction.highestBid.amount : "-" }}
-
{{ auction.finishBidAmount }}
-
{{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }}
-
{{ auction.highestBid ? auction.highestBid.generalName : "-" }}
-
{{ auction.closeDate }}
+
+
{{ auction.id }}
+
{{ auction.hostName }}
+
쌀 {{ auction.amount.toLocaleString() }}
+
{{ auction.highestBid?.generalName ?? "-" }}
+
+ 금 {{ (auction.highestBid?.amount ?? auction.startBidAmount).toLocaleString() }} +
+
+ {{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }} +
+
금 {{ auction.finishBidAmount.toLocaleString() }}
+
{{ cutDateTime(auction.closeDate) }}
-
-
{{ selectedBuyRiceAuction.id }}번 쌀 {{ selectedBuyRiceAuction.amount }} 경매에
-
+
+
+ {{ selectedBuyRiceAuction.id }}번 쌀 {{ selectedBuyRiceAuction.amount }} 경매에 금 +
+
-
입찰
+
입찰
쌀 판매
-
-
번호
-
판매자
-
물품
-
수량
-
시작 구매가
-
현재 구매가
-
즉시 구매가
-
단가
-
구매 예정자
-
거래 종료
+
+
번호
+
판매자
+
수량
+
입찰자
+
입찰가
+
단가
+
마감가
+
거래 종료
-
-
{{ auction.id }}
-
{{ auction.hostName }}
-
-
{{ auction.amount }}
-
{{ auction.startBidAmount }}
-
{{ auction.highestBid ? auction.highestBid.amount : "-" }}
-
{{ auction.finishBidAmount }}
-
{{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }}
-
{{ auction.highestBid ? auction.highestBid.generalName : "-" }}
-
{{ auction.closeDate }}
+
+
{{ auction.id }}
+
{{ auction.hostName }}
+
금{{ auction.amount.toLocaleString() }}
+
{{ auction.highestBid?.generalName ?? "-" }}
+
+ 쌀 {{ (auction.highestBid?.amount ?? auction.startBidAmount).toLocaleString() }} +
+
+ {{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }} +
+
쌀 {{ auction.finishBidAmount.toLocaleString() }}
+
{{ cutDateTime(auction.closeDate) }}
-
-
{{ selectedSellRiceAuction.id }}번 금 {{ selectedSellRiceAuction.amount }} 경매에
-
+
+
+ {{ selectedSellRiceAuction.id }}번 금 {{ selectedSellRiceAuction.amount }} 경매에 쌀 +
+
-
입찰
+
입찰
경매 등록
-
-
- 매물 +
+
+ 매물
@@ -92,47 +104,48 @@
-
- -
-
+ +
+ 수량 ({{ openAuctionInfo.type == "buyRice" ? "쌀" : "금" }})
-
+
+ 기간(턴) + +
+
+ 시작가 ({{ openAuctionInfo.type == "buyRice" ? "금" : "쌀" }})
-
+
+ 마감가 ({{ openAuctionInfo.type == "buyRice" ? "금" : "쌀" }})
-
+
등록
@@ -162,6 +175,12 @@ watch(selectedBuyRiceAuction, (auction) => { bidAmountBuyRiceAuction.value = auction.highestBid ? auction.highestBid.amount : auction.startBidAmount; }); +function cutDateTime(dateTime: string, showSecond = false) { + if (showSecond) { + return dateTime.substring(5, 19); + } + return dateTime.substring(5, 16); +} async function bidBuyRiceAuction() { if (selectedBuyRiceAuction.value === undefined) { @@ -284,10 +303,83 @@ async function openAuction() { defineExpose({ refresh, -}) +}); onMounted(async () => { void refresh(); console.log("mounted"); }); + + diff --git a/hwe/ts/components/NumberInputWithInfo.vue b/hwe/ts/components/NumberInputWithInfo.vue index 82d6b45a..f4acd479 100644 --- a/hwe/ts/components/NumberInputWithInfo.vue +++ b/hwe/ts/components/NumberInputWithInfo.vue @@ -47,7 +47,8 @@ export default defineComponent({ }, title: { type: String, - required: true, + required: false, + default: null, }, min: { type: Number,