修复创建套餐编码格式问题 & 其他样式问题
This commit is contained in:
@@ -139,7 +139,7 @@ function PermissionTable() {
|
||||
}, [data])
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-3 overflow-auto">
|
||||
{process.env.NODE_ENV === "development" && (
|
||||
<div>
|
||||
<Button variant="outline" size="sm" onClick={handleCopy}>
|
||||
@@ -150,7 +150,7 @@ function PermissionTable() {
|
||||
)}
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow className="h-10">
|
||||
<TableRow className="h-10 sticky top-0 bg-background">
|
||||
<TableHead>编码</TableHead>
|
||||
<TableHead>描述</TableHead>
|
||||
</TableRow>
|
||||
|
||||
@@ -130,6 +130,9 @@ function ProductLongCode<T extends { code: string }>(
|
||||
live?: string
|
||||
expire?: string
|
||||
}) => {
|
||||
if (!params.get("mode")) params.set("mode", "quota")
|
||||
if (!params.get("expire")) params.set("expire", "0")
|
||||
|
||||
if (data.mode) params.set("mode", data.mode)
|
||||
if (data.live) params.set("live", data.live)
|
||||
if (data.expire) params.set("expire", data.expire)
|
||||
@@ -137,8 +140,13 @@ function ProductLongCode<T extends { code: string }>(
|
||||
}
|
||||
|
||||
const onModeChange = (value: string) => {
|
||||
setParams({ mode: value })
|
||||
if (value === "quota") {
|
||||
setParams({ mode: value, expire: "0" })
|
||||
} else {
|
||||
setParams({ mode: value })
|
||||
}
|
||||
}
|
||||
|
||||
const onLiveChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
let value = e.target.value || "0"
|
||||
if (value.length > 1 && value[0] === "0") {
|
||||
@@ -147,6 +155,7 @@ function ProductLongCode<T extends { code: string }>(
|
||||
if (!/^([0-9]+)$/.test(value)) return
|
||||
setParams({ live: value })
|
||||
}
|
||||
|
||||
const onExpireChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
let value = e.target.value || "0"
|
||||
if (value.length > 1 && value[0] === "0") {
|
||||
|
||||
Reference in New Issue
Block a user