Browse Source

修改bug

master
suomingxiang 5 months ago
parent
commit
93e25b6294

+ 18
- 9
src/pages/GoinZZ/honor/edit.tsx View File

19
 
19
 
20
 const NoticeForm: React.FC<NoticeFormProps> = (props) => {
20
 const NoticeForm: React.FC<NoticeFormProps> = (props) => {
21
   const [form] = Form.useForm();
21
   const [form] = Form.useForm();
22
-
22
+  const [fileList, setFileList] = useState<any>([]);
23
+  const intl = useIntl();
24
+  const [img, setImg] = useState<any>('');
23
   // const { noticeTypeOptions, statusOptions, cur, setVisible } = props;
25
   // const { noticeTypeOptions, statusOptions, cur, setVisible } = props;
24
 
26
 
25
   useEffect(() => {
27
   useEffect(() => {
26
     form.resetFields();
28
     form.resetFields();
29
+    console.log(props.values)
30
+    setImg(props)
31
+    if(props?.values?.imgUrl){
32
+      setFileList([{
33
+        id:'',
34
+        url:props.values.imgUrl,
35
+      }])
36
+      setImg(props.values.imgUrl)
37
+    }else{
38
+      setFileList([])
39
+    }
27
     form.setFieldsValue({
40
     form.setFieldsValue({
28
       name: props.values.name,
41
       name: props.values.name,
29
       sort: props.values.sort,
42
       sort: props.values.sort,
38
 
51
 
39
   // const intl = useIntl();
52
   // const intl = useIntl();
40
   const handleOk = () => {
53
   const handleOk = () => {
41
-    console.log(`form-->`, form);
42
-
43
     form?.submit?.();
54
     form?.submit?.();
44
   };
55
   };
45
   const handleCancel = () => {
56
   const handleCancel = () => {
46
     props.onCancel();
57
     props.onCancel();
47
   };
58
   };
48
   const handleFinish = async (values: Record<string, any>) => {
59
   const handleFinish = async (values: Record<string, any>) => {
49
-    console.log(`values-->`, values);
60
+    values.img = img;
50
-
51
     props.onSubmit(values as NoticeFormData);
61
     props.onSubmit(values as NoticeFormData);
52
   };
62
   };
53
-  const intl = useIntl();
63
+
54
-  const [fileList, setFileList] = useState<any>([]);
55
-  const [img, setImg] = useState<any>('');
56
   const handleChange = async (res) => {
64
   const handleChange = async (res) => {
57
     const { fileList } = res;
65
     const { fileList } = res;
58
     setFileList(fileList);
66
     setFileList(fileList);
83
         submitter={false}
91
         submitter={false}
84
         layout="horizontal"
92
         layout="horizontal"
85
         onFinish={handleFinish}
93
         onFinish={handleFinish}
94
+        labelCol={{ span:2 }}
86
       >
95
       >
87
         {!props?.setVisible && (
96
         {!props?.setVisible && (
88
           <ProFormText
97
           <ProFormText
120
           label={'证书'}
129
           label={'证书'}
121
           extra={'图片尺寸1218*915'}
130
           extra={'图片尺寸1218*915'}
122
           labelCol={{
131
           labelCol={{
123
-            style: { width: 95 }
132
+            style: { width: 70 }
124
           }}
133
           }}
125
           rules={[
134
           rules={[
126
             {
135
             {

+ 1
- 3
src/pages/GoinZZ/honor/setting.tsx View File

266
           formRef={formTableRef}
266
           formRef={formTableRef}
267
           rowKey="noticeId"
267
           rowKey="noticeId"
268
           key="noticeList"
268
           key="noticeList"
269
-          search={{
269
+          search={false}
270
-            labelWidth: 120,
271
-          }}
272
           toolBarRender={() => [
270
           toolBarRender={() => [
273
             <Button
271
             <Button
274
               type="primary"
272
               type="primary"

+ 2
- 2
src/pages/News/NewsList/edit.tsx View File

96
   let editorRef = useRef<HTMLDivElement>(null)
96
   let editorRef = useRef<HTMLDivElement>(null)
97
 
97
 
98
   useEffect(() => {
98
   useEffect(() => {
99
-    console.log(props)
100
     form.resetFields();
99
     form.resetFields();
101
     if(!props.open) return;
100
     if(!props.open) return;
102
     // const { title, content, surface, surfaceUrl, date } = props;
101
     // const { title, content, surface, surfaceUrl, date } = props;
321
         </ProForm.Item>
320
         </ProForm.Item>
322
         <ProFormDatePicker
321
         <ProFormDatePicker
323
           name="date"
322
           name="date"
324
-          label='展示日期'
323
+          label='日期'
325
           fieldProps={{
324
           fieldProps={{
326
             format: (value) => value.format('YYYY.MM.DD'),
325
             format: (value) => value.format('YYYY.MM.DD'),
327
           }}
326
           }}
384
             style: { width: 95 }
383
             style: { width: 95 }
385
           }}
384
           }}
386
           placeholder={'中泽集团'}
385
           placeholder={'中泽集团'}
386
+          initialValue={'中泽集团'}
387
         />
387
         />
388
 
388
 
389
         <ProForm.Item 
389
         <ProForm.Item 

+ 1
- 0
src/pages/Other/footer/index.tsx View File

13
 import './index.less'
13
 import './index.less'
14
 import DictTag from '../../../components/DictTag';
14
 import DictTag from '../../../components/DictTag';
15
 import { getDataEnumList } from '../../../services/system/Enum';
15
 import { getDataEnumList } from '../../../services/system/Enum';
16
+import { RcFile } from 'antd/es/upload';
16
 
17
 
17
 
18
 
18
 const NoticeTableList: React.FC = () => {
19
 const NoticeTableList: React.FC = () => {

Loading…
Cancel
Save