|
@@ -1,6 +1,6 @@
|
|
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
|
import styles from "./index.module.scss";
|
|
|
-import { A5_APIgetInfo, A5_APIsave } from "@/store/action/A5goods";
|
|
|
+import { A5_APIgetAgeList, A5_APIgetInfo, A5_APIsave } from "@/store/action/A5goods";
|
|
|
import dayjs from "dayjs";
|
|
|
import {
|
|
|
Button,
|
|
@@ -50,6 +50,23 @@ type Props = {
|
|
|
};
|
|
|
|
|
|
function A5add({ addId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
+
|
|
|
+
|
|
|
+ // 获取时代下拉数组
|
|
|
+ const [ageList,setAgeList] =useState<any[]>([])
|
|
|
+
|
|
|
+ const getAgeListFu =useCallback(async()=>{
|
|
|
+ const res =await A5_APIgetAgeList()
|
|
|
+ if(res.code===0){
|
|
|
+ setAgeList(res.data||[])
|
|
|
+
|
|
|
+ }
|
|
|
+ },[])
|
|
|
+
|
|
|
+ useEffect(()=>{
|
|
|
+ getAgeListFu()
|
|
|
+ },[getAgeListFu])
|
|
|
+
|
|
|
const getInfoFu = useCallback(async (id: number) => {
|
|
|
const res = await A5_APIgetInfo(id);
|
|
|
if (res.code === 0) {
|
|
@@ -280,13 +297,21 @@ function A5add({ addId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
/>
|
|
|
</Form.Item>
|
|
|
|
|
|
- <Form.Item
|
|
|
+ <Form.Item label="时代" name="dictAgeId">
|
|
|
+ <Select
|
|
|
+ placeholder="请选择"
|
|
|
+ style={{ width: 400 }}
|
|
|
+ options={ageList.map(v=>({value:v.id,label:v.name}))}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+
|
|
|
+ {/* <Form.Item
|
|
|
label="时代"
|
|
|
name="dictAge"
|
|
|
getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
|
|
|
>
|
|
|
<Input maxLength={10} showCount placeholder="请输入内容" />
|
|
|
- </Form.Item>
|
|
|
+ </Form.Item> */}
|
|
|
|
|
|
<Form.Item
|
|
|
label="质地"
|