shenwu hai 7 meses
pai
achega
71aceb7b92

+ 12 - 1
src/components/bookSelect/index.tsx

@@ -36,7 +36,18 @@ const BookSelect = (props: { value?: any, onChange?: (value: any) => void }) =>
         }
         timeOut.current = setTimeout(() => { func() }, wait);
     }, [])
-
+    useEffect(()=>{
+        if(value && data?.records?.length === 0){
+            console.log("value",value)
+            // api.run({ ...params, ...publicData }).then(res => {
+            //     if (res?.data?.total > 0) {
+            //         setData({ records: res.data.records, total: res.data.total })
+            //     } else {
+            //         setData({ records: [], total: 0 })
+            //     }
+            // })
+        }
+    },[])
     // 使用自定义防抖函数
     useEffect(() => {
         if (params.bookName) {

+ 1 - 0
src/pages/MiniApp/CompConfig/DrawerBox/compConfig.tsx

@@ -61,6 +61,7 @@ export function CompConfig(props: Props) {
     // 初始化内容
     useEffect(() => {
         let thatConfig = list.find(item => item.componentType === compName)
+        console.log("初始化内容",thatConfig)
         formRef.current?.setFieldsValue(thatConfig)
     }, [list])
     // 值变化

+ 9 - 0
src/pages/MiniApp/CompConfig/DrawerBox/compFormConfig.tsx

@@ -35,6 +35,9 @@ export function bannersConfig(pageList: any[]): ProFormColumnsType<any>[] {
                             title: 'banner类型',
                             dataIndex: 'bannerType',
                             valueType: 'radio',
+                            convertValue:(value)=>{
+                                return value?.toString()
+                            },
                             valueEnum: { 0: { text: "小说" }, 1: { text: "活动" } },
                             colProps: {
                                 span: 24
@@ -58,6 +61,9 @@ export function bannersConfig(pageList: any[]): ProFormColumnsType<any>[] {
                                         dataIndex: "bookId",
                                         title: '小说',
                                         hideInForm: bannerType != 0,
+                                        convertValue:(value)=>{
+                                            return value?.toString()
+                                        },
                                         formItemProps: {
                                             style: { marginBottom: 10 },
                                             rules: [
@@ -206,6 +212,9 @@ export function hotBooksConfig(): ProFormColumnsType<any>[] {
                             colProps: {
                                 span: 12
                             },
+                            convertValue:(value)=>{
+                                return value?.toString()
+                            },
                             formItemProps: {
                                 style: { marginBottom: 10 },
                                 rules: [

+ 1 - 1
src/pages/MiniApp/CompConfig/index.tsx

@@ -117,7 +117,7 @@ const Page: React.FC = () => {
                             <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'end' }}>
                                 <Space>
                                     <Button size='small' type='primary' onClick={(e) => { e.stopPropagation(); edit(item) }}><EditOutlined /></Button>
-                                    <Button size='small' type="primary" danger onClick={(e) => { e.stopPropagation(); delTemplate(item.id) }}><DeleteOutlined /></Button>
+                                    <Button size='small' type="primary" danger onClick={(e) => { e.stopPropagation(); delTemplate(item?.templateName) }}><DeleteOutlined /></Button>
                                 </Space>
                             </div>
                         </Card>

+ 1 - 1
src/services/miniApp/compConfig/index.tsx

@@ -28,7 +28,7 @@ export async function updateTemplate(params: any) {
 export async function remove(params: any) {
     let { templateName, ...data } = params
     return request(api + `/admin/appComponentConfig/remove/${templateName}`, {
-        method: 'PUT',
+        method: 'DELETE',
         params: data
     });
 }