|
@@ -34,6 +34,7 @@ function Wall() {
|
|
console.log(data);
|
|
console.log(data);
|
|
setValueType(data.isAuto);
|
|
setValueType(data.isAuto);
|
|
setTimeType0(data.startTime + "," + data.endTime);
|
|
setTimeType0(data.startTime + "," + data.endTime);
|
|
|
|
+ setTypeDisplay(data.type)
|
|
}
|
|
}
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
@@ -85,6 +86,12 @@ function Wall() {
|
|
// 文物类型列表
|
|
// 文物类型列表
|
|
const [types, setTypes] = useState([]);
|
|
const [types, setTypes] = useState([]);
|
|
|
|
|
|
|
|
+ // 文物类型展示
|
|
|
|
+ const [typeDisplay, setTypeDisplay] = useState([]);
|
|
|
|
+
|
|
|
|
+ // 文物类型修改
|
|
|
|
+ const [typeEdit, setTypeEdit] = useState([]);
|
|
|
|
+
|
|
// 点击修改(海报/场景)
|
|
// 点击修改(海报/场景)
|
|
const editAutoPlay = useCallback(() => {
|
|
const editAutoPlay = useCallback(() => {
|
|
setValue1(value0);
|
|
setValue1(value0);
|
|
@@ -104,9 +111,10 @@ function Wall() {
|
|
setTime1(dateString);
|
|
setTime1(dateString);
|
|
};
|
|
};
|
|
// 时间选择器改变
|
|
// 时间选择器改变
|
|
- // const timeTyoChange = (date: any, dateString: any) => {
|
|
|
|
- // setTime1(dateString);
|
|
|
|
- // };
|
|
|
|
|
|
+ const timeTypeChange = (date: any, dateString: any) => {
|
|
|
|
+ setTimeType1(dateString);
|
|
|
|
+ console.log(dateString);
|
|
|
|
+ };
|
|
|
|
|
|
// 点击确定 (海报/场景)
|
|
// 点击确定 (海报/场景)
|
|
const btnOk = useCallback(async () => {
|
|
const btnOk = useCallback(async () => {
|
|
@@ -130,15 +138,15 @@ function Wall() {
|
|
endTime: timeType1[1],
|
|
endTime: timeType1[1],
|
|
startTime: timeType1[0],
|
|
startTime: timeType1[0],
|
|
isAuto: value2,
|
|
isAuto: value2,
|
|
|
|
+ type: typeEdit
|
|
};
|
|
};
|
|
-
|
|
|
|
const res: any = await editWallTypeApi({ content: JSON.stringify(obj) });
|
|
const res: any = await editWallTypeApi({ content: JSON.stringify(obj) });
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
MessageFu.success("修改成功!");
|
|
MessageFu.success("修改成功!");
|
|
getWallCategoryApiFu();
|
|
getWallCategoryApiFu();
|
|
}
|
|
}
|
|
- setEdit(false);
|
|
|
|
- }, [getWallCategoryApiFu, timeType1, value2]);
|
|
|
|
|
|
+ setEditType(false);
|
|
|
|
+ }, [getWallCategoryApiFu, timeType1, typeEdit, value2]);
|
|
|
|
|
|
// 点击新增或者编辑
|
|
// 点击新增或者编辑
|
|
const [editId, setEditId] = useState(0);
|
|
const [editId, setEditId] = useState(0);
|
|
@@ -257,37 +265,54 @@ function Wall() {
|
|
</div>
|
|
</div>
|
|
{editType ? (
|
|
{editType ? (
|
|
// 修改信息
|
|
// 修改信息
|
|
- <div className="edit">
|
|
|
|
- <div>展示日期:</div>
|
|
|
|
- <Radio.Group
|
|
|
|
- onChange={(e) => setValueType(e.target.value)}
|
|
|
|
- value={valueType}
|
|
|
|
- >
|
|
|
|
- <Radio value={0}>关闭</Radio>
|
|
|
|
- <Radio value={1}>开启</Radio>
|
|
|
|
- </Radio.Group>
|
|
|
|
-  
|
|
|
|
- <RangePicker
|
|
|
|
- allowClear={false}
|
|
|
|
- // defaultValue={[
|
|
|
|
- // dayjs(timeType1[0], "YYYY/MM/DD"),
|
|
|
|
- // dayjs(timeType1[1], "YYYY/MM/DD"),
|
|
|
|
- // ]}
|
|
|
|
- onChange={timeChange}
|
|
|
|
- />
|
|
|
|
-  
|
|
|
|
- <Button type="primary" onClick={btnOkType}>
|
|
|
|
- 确定
|
|
|
|
- </Button>
|
|
|
|
-  
|
|
|
|
- <Popconfirm
|
|
|
|
- title="放弃编辑后,信息将不会保存!"
|
|
|
|
- okText="放弃"
|
|
|
|
- cancelText="取消"
|
|
|
|
- onConfirm={() => setEditType(false)}
|
|
|
|
- >
|
|
|
|
- <Button>取消</Button>
|
|
|
|
- </Popconfirm>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <div className="edit">
|
|
|
|
+ <div>展示日期:</div>
|
|
|
|
+ <Radio.Group
|
|
|
|
+ onChange={(e) => setValue2(e.target.value)}
|
|
|
|
+ value={value2}
|
|
|
|
+ >
|
|
|
|
+ <Radio value={0}>关闭</Radio>
|
|
|
|
+ <Radio value={1}>开启</Radio>
|
|
|
|
+ </Radio.Group>
|
|
|
|
+  
|
|
|
|
+ <RangePicker
|
|
|
|
+ allowClear={false}
|
|
|
|
+ defaultValue={[
|
|
|
|
+ dayjs(timeType1[0], "YYYY/MM/DD"),
|
|
|
|
+ dayjs(timeType1[1], "YYYY/MM/DD"),
|
|
|
|
+ ]}
|
|
|
|
+ onChange={timeTypeChange}
|
|
|
|
+ />
|
|
|
|
+  
|
|
|
|
+ <Button type="primary" onClick={btnOkType}>
|
|
|
|
+ 确定
|
|
|
|
+ </Button>
|
|
|
|
+  
|
|
|
|
+ <Popconfirm
|
|
|
|
+ title="放弃编辑后,信息将不会保存!"
|
|
|
|
+ okText="放弃"
|
|
|
|
+ cancelText="取消"
|
|
|
|
+ onConfirm={() => setEditType(false)}
|
|
|
|
+ >
|
|
|
|
+ <Button>取消</Button>
|
|
|
|
+ </Popconfirm>
|
|
|
|
+ </div>
|
|
|
|
+ <div className="txt">
|
|
|
|
+ <div style={{ marginRight: "5px" }}>展示类别:</div>
|
|
|
|
+ <Radio.Group
|
|
|
|
+ onChange={(e) => setTypeEdit(e.target.value)}
|
|
|
|
+ value={typeEdit}
|
|
|
|
+ >
|
|
|
|
+ {types.map((item) => {
|
|
|
|
+ return (
|
|
|
|
+ <Radio key={item} value={item}>
|
|
|
|
+ {item}
|
|
|
|
+ </Radio>
|
|
|
|
+ );
|
|
|
|
+ })}
|
|
|
|
+ </Radio.Group>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
) : (
|
|
) : (
|
|
// 展示信息
|
|
// 展示信息
|
|
@@ -305,7 +330,7 @@ function Wall() {
|
|
</div>
|
|
</div>
|
|
<div className="txt">
|
|
<div className="txt">
|
|
<div style={{ marginRight: "5px" }}>展示类别:</div>
|
|
<div style={{ marginRight: "5px" }}>展示类别:</div>
|
|
- <div>{types}</div>
|
|
|
|
|
|
+ <div>{typeDisplay}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)}
|
|
)}
|