|
@@ -16,10 +16,14 @@ import {
|
|
|
scoreLimitSaveAPI,
|
|
scoreLimitSaveAPI,
|
|
|
} from "@/store/action/A1Rule";
|
|
} from "@/store/action/A1Rule";
|
|
|
import RuleEdit from "./RuleEdit";
|
|
import RuleEdit from "./RuleEdit";
|
|
|
|
|
+import TopicSetting from "./TopicSetting";
|
|
|
import { MessageFu } from "@/utils/message";
|
|
import { MessageFu } from "@/utils/message";
|
|
|
function A1Rule() {
|
|
function A1Rule() {
|
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
|
|
+ // 打开题目设置页面
|
|
|
|
|
+ const [topicSettingShow, setTopicSettingShow] = useState(false);
|
|
|
|
|
+
|
|
|
// 从仓库中获取表格数据
|
|
// 从仓库中获取表格数据
|
|
|
const tableInfo = useSelector((state: RootState) => state.A1Rule.tableInfo);
|
|
const tableInfo = useSelector((state: RootState) => state.A1Rule.tableInfo);
|
|
|
|
|
|
|
@@ -96,7 +100,13 @@ function A1Rule() {
|
|
|
>
|
|
>
|
|
|
编辑
|
|
编辑
|
|
|
</Button>
|
|
</Button>
|
|
|
- <Button size="small" type="text">
|
|
|
|
|
|
|
+ <Button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setTopicSettingShow(true);
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
设置题目
|
|
设置题目
|
|
|
</Button>
|
|
</Button>
|
|
|
</>
|
|
</>
|
|
@@ -151,117 +161,124 @@ function A1Rule() {
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
dispatch(getRuleAPI());
|
|
dispatch(getRuleAPI());
|
|
|
}, [dispatch]);
|
|
}, [dispatch]);
|
|
|
- return (
|
|
|
|
|
- <div className={styles.A1Rule}>
|
|
|
|
|
- <div className="ruleTop">
|
|
|
|
|
- <div className="pageTitle">游戏规则</div>
|
|
|
|
|
- <button
|
|
|
|
|
- className="scoreLimitBtn"
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- console.log("打开");
|
|
|
|
|
- setLimitScoreShow(true);
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- 单日可获得积分上线:5000
|
|
|
|
|
- </button>
|
|
|
|
|
- {/* 表格主体 */}
|
|
|
|
|
- <div className="tableBox1">
|
|
|
|
|
- <Table
|
|
|
|
|
- scroll={{ y: 500 }}
|
|
|
|
|
- bordered={false}
|
|
|
|
|
- dataSource={tableInfo.list}
|
|
|
|
|
- columns={columns}
|
|
|
|
|
- rowKey="id"
|
|
|
|
|
- pagination={{
|
|
|
|
|
- showQuickJumper: true,
|
|
|
|
|
- position: ["bottomCenter"],
|
|
|
|
|
- showSizeChanger: true,
|
|
|
|
|
- total: tableInfo.total,
|
|
|
|
|
|
|
+ return topicSettingShow ? (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <div className={styles.A1Rule}>
|
|
|
|
|
+ <div className="ruleTop">
|
|
|
|
|
+ <div className="pageTitle">游戏规则</div>
|
|
|
|
|
+ <button
|
|
|
|
|
+ className="scoreLimitBtn"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ console.log("打开");
|
|
|
|
|
+ setLimitScoreShow(true);
|
|
|
}}
|
|
}}
|
|
|
- />
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ 单日可获得积分上线:5000
|
|
|
|
|
+ </button>
|
|
|
|
|
+ {/* 表格主体 */}
|
|
|
|
|
+ <div className="tableBox1">
|
|
|
|
|
+ <Table
|
|
|
|
|
+ scroll={{ y: 500 }}
|
|
|
|
|
+ bordered={false}
|
|
|
|
|
+ dataSource={tableInfo.list}
|
|
|
|
|
+ columns={columns}
|
|
|
|
|
+ rowKey="id"
|
|
|
|
|
+ pagination={{
|
|
|
|
|
+ showQuickJumper: true,
|
|
|
|
|
+ position: ["bottomCenter"],
|
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
|
+ total: tableInfo.total,
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div className="ruleTop ruleBottom">
|
|
|
|
|
- <div className="pageTitle">线上展厅</div>
|
|
|
|
|
- {/* 表格主体 */}
|
|
|
|
|
- <div className="tableBox2">
|
|
|
|
|
- <Table
|
|
|
|
|
- scroll={{ y: 500 }}
|
|
|
|
|
- bordered={false}
|
|
|
|
|
- dataSource={tableInfo.list}
|
|
|
|
|
- columns={columns2}
|
|
|
|
|
- rowKey="id"
|
|
|
|
|
- pagination={{
|
|
|
|
|
- showQuickJumper: true,
|
|
|
|
|
- position: ["bottomCenter"],
|
|
|
|
|
- showSizeChanger: true,
|
|
|
|
|
- total: tableInfo.total,
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div className="ruleTop ruleBottom">
|
|
|
|
|
+ <div className="pageTitle">线上展厅</div>
|
|
|
|
|
+ {/* 表格主体 */}
|
|
|
|
|
+ <div className="tableBox2">
|
|
|
|
|
+ <Table
|
|
|
|
|
+ scroll={{ y: 500 }}
|
|
|
|
|
+ bordered={false}
|
|
|
|
|
+ dataSource={tableInfo.list}
|
|
|
|
|
+ columns={columns2}
|
|
|
|
|
+ rowKey="id"
|
|
|
|
|
+ pagination={{
|
|
|
|
|
+ showQuickJumper: true,
|
|
|
|
|
+ position: ["bottomCenter"],
|
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
|
+ total: tableInfo.total,
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- {/* 点击游戏编辑 */}
|
|
|
|
|
- {editPageShow && editMode.current === 1 ? (
|
|
|
|
|
- <RuleEdit
|
|
|
|
|
- id={editId.current}
|
|
|
|
|
- closePage={() => setEditPageShow(false)}
|
|
|
|
|
- upTableList={getList}
|
|
|
|
|
- editMode={editMode.current}
|
|
|
|
|
- />
|
|
|
|
|
- ) : null}
|
|
|
|
|
- {/* 设置积分上线弹窗 */}
|
|
|
|
|
- <Modal
|
|
|
|
|
- destroyOnClose
|
|
|
|
|
- closable={false}
|
|
|
|
|
- maskClosable={false}
|
|
|
|
|
- open={limitScoreShow}
|
|
|
|
|
- title=" "
|
|
|
|
|
- onCancel={() => setLimitScoreShow(false)}
|
|
|
|
|
- footer={
|
|
|
|
|
- [] // 设置footer为空,去掉 取消 确定默认按钮
|
|
|
|
|
- }
|
|
|
|
|
- >
|
|
|
|
|
- <Form
|
|
|
|
|
- form={form}
|
|
|
|
|
- name="basic"
|
|
|
|
|
- labelCol={{ span: 8 }}
|
|
|
|
|
- onFinish={onFinish}
|
|
|
|
|
- autoComplete="off"
|
|
|
|
|
|
|
+ {/* 点击游戏编辑 */}
|
|
|
|
|
+ {editPageShow && editMode.current === 1 ? (
|
|
|
|
|
+ <RuleEdit
|
|
|
|
|
+ id={editId.current}
|
|
|
|
|
+ closePage={() => setEditPageShow(false)}
|
|
|
|
|
+ upTableList={getList}
|
|
|
|
|
+ editMode={editMode.current}
|
|
|
|
|
+ />
|
|
|
|
|
+ ) : null}
|
|
|
|
|
+ {/* 设置积分上线弹窗 */}
|
|
|
|
|
+ <Modal
|
|
|
|
|
+ destroyOnClose
|
|
|
|
|
+ closable={false}
|
|
|
|
|
+ maskClosable={false}
|
|
|
|
|
+ open={limitScoreShow}
|
|
|
|
|
+ title=" "
|
|
|
|
|
+ onCancel={() => setLimitScoreShow(false)}
|
|
|
|
|
+ footer={
|
|
|
|
|
+ [] // 设置footer为空,去掉 取消 确定默认按钮
|
|
|
|
|
+ }
|
|
|
>
|
|
>
|
|
|
- <Form.Item
|
|
|
|
|
- label="单日可获得积分上限"
|
|
|
|
|
- name="numberVal"
|
|
|
|
|
- style={{ marginTop: "40px" }}
|
|
|
|
|
- rules={[{ required: true, message: "不能为空!" }]}
|
|
|
|
|
- hide-required-asterisk={true}
|
|
|
|
|
- getValueFromEvent={(e) =>
|
|
|
|
|
- e.target.value.replace(/^(0+)|[^\d]+/g, "")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ <Form
|
|
|
|
|
+ form={form}
|
|
|
|
|
+ name="basic"
|
|
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
|
|
+ onFinish={onFinish}
|
|
|
|
|
+ autoComplete="off"
|
|
|
>
|
|
>
|
|
|
- <Input maxLength={9} placeholder="请输入正整数,不超过999999999" />
|
|
|
|
|
- </Form.Item>
|
|
|
|
|
- {/* 确定和取消按钮 */}
|
|
|
|
|
- <br />
|
|
|
|
|
- <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
|
|
|
|
|
- <Button type="primary" htmlType="submit">
|
|
|
|
|
- 提交
|
|
|
|
|
- </Button>
|
|
|
|
|
-  
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title="放弃编辑后,信息将不会保存!"
|
|
|
|
|
- okText="放弃"
|
|
|
|
|
- cancelText="取消"
|
|
|
|
|
- onConfirm={() => {
|
|
|
|
|
- setLimitScoreShow(false);
|
|
|
|
|
- }}
|
|
|
|
|
- okButtonProps={{ loading: false }}
|
|
|
|
|
|
|
+ <Form.Item
|
|
|
|
|
+ label="单日可获得积分上限"
|
|
|
|
|
+ name="numberVal"
|
|
|
|
|
+ style={{ marginTop: "40px" }}
|
|
|
|
|
+ rules={[{ required: true, message: "不能为空!" }]}
|
|
|
|
|
+ hide-required-asterisk={true}
|
|
|
|
|
+ getValueFromEvent={(e) =>
|
|
|
|
|
+ e.target.value.replace(/^(0+)|[^\d]+/g, "")
|
|
|
|
|
+ }
|
|
|
>
|
|
>
|
|
|
- <Button>取消</Button>
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Form.Item>
|
|
|
|
|
- </Form>
|
|
|
|
|
- </Modal>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <Input
|
|
|
|
|
+ maxLength={9}
|
|
|
|
|
+ placeholder="请输入正整数,不超过999999999"
|
|
|
|
|
+ />
|
|
|
|
|
+ </Form.Item>
|
|
|
|
|
+ {/* 确定和取消按钮 */}
|
|
|
|
|
+ <br />
|
|
|
|
|
+ <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
|
|
|
|
|
+ <Button type="primary" htmlType="submit">
|
|
|
|
|
+ 提交
|
|
|
|
|
+ </Button>
|
|
|
|
|
+  
|
|
|
|
|
+ <Popconfirm
|
|
|
|
|
+ title="放弃编辑后,信息将不会保存!"
|
|
|
|
|
+ okText="放弃"
|
|
|
|
|
+ cancelText="取消"
|
|
|
|
|
+ onConfirm={() => {
|
|
|
|
|
+ setLimitScoreShow(false);
|
|
|
|
|
+ }}
|
|
|
|
|
+ okButtonProps={{ loading: false }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Button>取消</Button>
|
|
|
|
|
+ </Popconfirm>
|
|
|
|
|
+ </Form.Item>
|
|
|
|
|
+ </Form>
|
|
|
|
|
+ </Modal>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <TopicSetting closeFu={() => setTopicSettingShow(false)} />
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|