feat: 调整代码

This commit is contained in:
wangsongsole 2024-03-15 11:26:42 +08:00
parent 9400717476
commit f4facb8b6f
3 changed files with 56 additions and 31 deletions

View File

@ -3,14 +3,14 @@ process.env.BABEL_ENV = "test"
process.env.NODE_ENV = "test" process.env.NODE_ENV = "test"
// 测试 // 测试
// process.env.BASE_URL = "http://test.marketapi.1688sup.com" process.env.BASE_URL = "http://test.marketapi.1688sup.com"
// process.env.UNIFIED_API = "http://api.test.user.1688sup.com/v1" process.env.UNIFIED_API = "http://api.test.user.1688sup.com/v1"
// process.env.UNIFIED_URL = "http://test.user.1688sup.com/#/login" process.env.UNIFIED_URL = "http://test.user.1688sup.com/#/login"
// 镜像 // 镜像
process.env.BASE_URL = "http://pre.marketapi.1688sup.com" // process.env.BASE_URL = "http://pre.marketapi.1688sup.com"
process.env.UNIFIED_API = "http://api.gray.user.1688sup.com/v1" // process.env.UNIFIED_API = "http://api.gray.user.1688sup.com/v1"
process.env.UNIFIED_URL = "http://gray.user.1688sup.com/#/login" // process.env.UNIFIED_URL = "http://gray.user.1688sup.com/#/login"
// Makes the script crash on unhandled rejections instead of silently // Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will // ignoring them. In the future, promise rejections that are not handled will

View File

@ -2,7 +2,8 @@ import Grid from "@/components/gird/main.js"
import Ipt from "@/components/input/main" import Ipt from "@/components/input/main"
import TabPage from "@/components/tabPage/main.js" import TabPage from "@/components/tabPage/main.js"
import { cloneDeep } from "lodash-es" import { cloneDeep } from "lodash-es"
import { useEffect, useState } from "react" import { useEffect } from "react"
import { useSetState } from "ahooks"
import { Button } from "zent" import { Button } from "zent"
import "./index.less" import "./index.less"
import { getClientPrompt } from "@/assets/api.js" import { getClientPrompt } from "@/assets/api.js"
@ -13,7 +14,7 @@ const data = [
defaultPrompt: "还没开始哟,兑换时间为${开始时间}至${结束时间}", defaultPrompt: "还没开始哟,兑换时间为${开始时间}至${结束时间}",
customizePrompt: "", customizePrompt: "",
typeText: "通用", typeText: "通用",
variables: "开始时间,结束时间", variables: "开始时间:${start_time},结束时间:${end_time}",
readOnly: true readOnly: true
}, },
{ {
@ -101,7 +102,7 @@ export default function Message() {
title: "可用变量", title: "可用变量",
name: "variables", name: "variables",
prop: "variables", prop: "variables",
type: "normal", type: "slot",
width: "200px" width: "200px"
}, },
{ {
@ -114,12 +115,13 @@ export default function Message() {
{ {
title: "定制提示", title: "定制提示",
prop: "customizePrompt", prop: "customizePrompt",
name: "customizePrompt",
type: "slot", type: "slot",
width: "520px" width: "520px"
} }
] ]
const [state, setState] = useState({ const [state, setState] = useSetState({
tableData: [], tableData: [],
backupTableData: [], backupTableData: [],
tabs: [{ title: "提示列表" }], tabs: [{ title: "提示列表" }],
@ -128,7 +130,6 @@ export default function Message() {
useEffect(() => { useEffect(() => {
setState({ setState({
...state,
tableData: cloneDeep(data), tableData: cloneDeep(data),
backupTableData: cloneDeep(data) backupTableData: cloneDeep(data)
}) })
@ -162,6 +163,7 @@ export default function Message() {
Column={Column} Column={Column}
maxheight={670} maxheight={670}
ComponentHandler={(com, rowData) => { ComponentHandler={(com, rowData) => {
if (com === "customizePrompt") {
return ( return (
<Ipt <Ipt
onChange={(e) => { onChange={(e) => {
@ -173,7 +175,7 @@ export default function Message() {
setState({ ...state }) setState({ ...state })
}} }}
value={rowData.customizePrompt} value={rowData.customizePrompt}
placeholder="请输入请勿输入过长文案以防C端弹窗展示异常变量使用${xxxx}格式。)" placeholder="请输入请勿输入过长文案以防C端弹窗展示异常变量使用 ${xx} 格式。)"
labelWidth={"0px"} labelWidth={"0px"}
countShow={false} countShow={false}
disabled={rowData.readOnly} disabled={rowData.readOnly}
@ -182,6 +184,20 @@ export default function Message() {
alignment={"left"} alignment={"left"}
/> />
) )
}
if (com === "variables") {
return (
<div>
<p className="variable">
开始时间: <span>{"${start_time}"}</span>
</p>
<p className="variable">
结束时间: <span>{"${end_time}"}</span>
</p>
</div>
)
}
}} }}
/> />
</TabPage> </TabPage>

View File

@ -10,4 +10,13 @@
margin-top: 10px; margin-top: 10px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.variable {
color: #b5b5b5;
margin-bottom: 5px;
span {
color: red
}
}
} }