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.BASE_URL = "http://test.marketapi.1688sup.com"
// process.env.UNIFIED_API = "http://api.test.user.1688sup.com/v1"
// process.env.UNIFIED_URL = "http://test.user.1688sup.com/#/login"
process.env.BASE_URL = "http://test.marketapi.1688sup.com"
process.env.UNIFIED_API = "http://api.test.user.1688sup.com/v1"
process.env.UNIFIED_URL = "http://test.user.1688sup.com/#/login"
// 镜像
process.env.BASE_URL = "http://pre.marketapi.1688sup.com"
process.env.UNIFIED_API = "http://api.gray.user.1688sup.com/v1"
process.env.UNIFIED_URL = "http://gray.user.1688sup.com/#/login"
// process.env.BASE_URL = "http://pre.marketapi.1688sup.com"
// process.env.UNIFIED_API = "http://api.gray.user.1688sup.com/v1"
// process.env.UNIFIED_URL = "http://gray.user.1688sup.com/#/login"
// Makes the script crash on unhandled rejections instead of silently
// 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 TabPage from "@/components/tabPage/main.js"
import { cloneDeep } from "lodash-es"
import { useEffect, useState } from "react"
import { useEffect } from "react"
import { useSetState } from "ahooks"
import { Button } from "zent"
import "./index.less"
import { getClientPrompt } from "@/assets/api.js"
@ -13,7 +14,7 @@ const data = [
defaultPrompt: "还没开始哟,兑换时间为${开始时间}至${结束时间}",
customizePrompt: "",
typeText: "通用",
variables: "开始时间,结束时间",
variables: "开始时间:${start_time},结束时间:${end_time}",
readOnly: true
},
{
@ -101,7 +102,7 @@ export default function Message() {
title: "可用变量",
name: "variables",
prop: "variables",
type: "normal",
type: "slot",
width: "200px"
},
{
@ -114,12 +115,13 @@ export default function Message() {
{
title: "定制提示",
prop: "customizePrompt",
name: "customizePrompt",
type: "slot",
width: "520px"
}
]
const [state, setState] = useState({
const [state, setState] = useSetState({
tableData: [],
backupTableData: [],
tabs: [{ title: "提示列表" }],
@ -128,7 +130,6 @@ export default function Message() {
useEffect(() => {
setState({
...state,
tableData: cloneDeep(data),
backupTableData: cloneDeep(data)
})
@ -162,6 +163,7 @@ export default function Message() {
Column={Column}
maxheight={670}
ComponentHandler={(com, rowData) => {
if (com === "customizePrompt") {
return (
<Ipt
onChange={(e) => {
@ -173,7 +175,7 @@ export default function Message() {
setState({ ...state })
}}
value={rowData.customizePrompt}
placeholder="请输入请勿输入过长文案以防C端弹窗展示异常变量使用${xxxx}格式。)"
placeholder="请输入请勿输入过长文案以防C端弹窗展示异常变量使用 ${xx} 格式。)"
labelWidth={"0px"}
countShow={false}
disabled={rowData.readOnly}
@ -182,6 +184,20 @@ export default function Message() {
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>

View File

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