商户修复
This commit is contained in:
@@ -804,30 +804,32 @@ export default function MerchantsPage() {
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="totalMerchant">选择总商户(可选)</Label>
|
||||
<Select
|
||||
value={newMerchant.totalMerchant}
|
||||
onValueChange={(value) => setNewMerchant({ ...newMerchant, totalMerchant: value })}
|
||||
disabled={loadingTotalMerchants}
|
||||
onOpenChange={(open) => {
|
||||
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
|
||||
fetchTotalMerchants()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{totalMerchants.map((merchant) => (
|
||||
<SelectItem key={merchant.userId} value={merchant.userId}>
|
||||
{merchant.nickName}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
{userRole === "admin" && (
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="totalMerchant">选择总商户(可选)</Label>
|
||||
<Select
|
||||
value={newMerchant.totalMerchant}
|
||||
onValueChange={(value) => setNewMerchant({ ...newMerchant, totalMerchant: value })}
|
||||
disabled={loadingTotalMerchants}
|
||||
onOpenChange={(open) => {
|
||||
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
|
||||
fetchTotalMerchants()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{totalMerchants.map((merchant) => (
|
||||
<SelectItem key={merchant.userId} value={merchant.userId}>
|
||||
{merchant.nickName}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
)}
|
||||
<div className="col-span-2 space-y-2">
|
||||
<Label htmlFor="detailedAddress">详细地址</Label>
|
||||
<Textarea
|
||||
@@ -1033,30 +1035,32 @@ export default function MerchantsPage() {
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="edit-totalMerchant">选择总商户(可选)</Label>
|
||||
<Select
|
||||
value={editMerchant.totalMerchant}
|
||||
onValueChange={(value) => setEditMerchant({ ...editMerchant, totalMerchant: value })}
|
||||
disabled={loadingTotalMerchants}
|
||||
onOpenChange={(open) => {
|
||||
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
|
||||
fetchTotalMerchants()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{totalMerchants.map((merchant) => (
|
||||
<SelectItem key={merchant.userId} value={merchant.userId}>
|
||||
{merchant.nickName}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
{userRole === "admin" && (
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="edit-totalMerchant">选择总商户(可选)</Label>
|
||||
<Select
|
||||
value={editMerchant.totalMerchant}
|
||||
onValueChange={(value) => setEditMerchant({ ...editMerchant, totalMerchant: value })}
|
||||
disabled={loadingTotalMerchants}
|
||||
onOpenChange={(open) => {
|
||||
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
|
||||
fetchTotalMerchants()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{totalMerchants.map((merchant) => (
|
||||
<SelectItem key={merchant.userId} value={merchant.userId}>
|
||||
{merchant.nickName}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
)}
|
||||
<div className="col-span-2 space-y-2">
|
||||
<Label htmlFor="edit-detailedAddress">详细地址</Label>
|
||||
<Textarea
|
||||
|
Reference in New Issue
Block a user