✨ feat: 调整代码
This commit is contained in:
parent
9400717476
commit
f4facb8b6f
|
@ -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
|
||||||
|
|
|
@ -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,26 +163,41 @@ export default function Message() {
|
||||||
Column={Column}
|
Column={Column}
|
||||||
maxheight={670}
|
maxheight={670}
|
||||||
ComponentHandler={(com, rowData) => {
|
ComponentHandler={(com, rowData) => {
|
||||||
return (
|
if (com === "customizePrompt") {
|
||||||
<Ipt
|
return (
|
||||||
onChange={(e) => {
|
<Ipt
|
||||||
rowData.customizePrompt = e
|
onChange={(e) => {
|
||||||
setState({ ...state })
|
rowData.customizePrompt = e
|
||||||
}}
|
setState({ ...state })
|
||||||
onClearItem={() => {
|
}}
|
||||||
rowData.customizePrompt = ""
|
onClearItem={() => {
|
||||||
setState({ ...state })
|
rowData.customizePrompt = ""
|
||||||
}}
|
setState({ ...state })
|
||||||
value={rowData.customizePrompt}
|
}}
|
||||||
placeholder="请输入(请勿输入过长文案,以防C端弹窗展示异常,变量使用${xxxx}格式。)"
|
value={rowData.customizePrompt}
|
||||||
labelWidth={"0px"}
|
placeholder="请输入(请勿输入过长文案,以防C端弹窗展示异常,变量使用 ${xx} 格式。)"
|
||||||
countShow={false}
|
labelWidth={"0px"}
|
||||||
disabled={rowData.readOnly}
|
countShow={false}
|
||||||
height={"36px"}
|
disabled={rowData.readOnly}
|
||||||
width={"400px"}
|
height={"36px"}
|
||||||
alignment={"left"}
|
width={"400px"}
|
||||||
/>
|
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>
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue