suomingxiang před 4 měsíci
rodič
revize
93e25b6294

+ 18
- 9
src/pages/GoinZZ/honor/edit.tsx Zobrazit soubor

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

+ 1
- 3
src/pages/GoinZZ/honor/setting.tsx Zobrazit soubor

@@ -266,9 +266,7 @@ const NoticeForm: React.FC<NoticeFormProps> = (props) => {
266 266
           formRef={formTableRef}
267 267
           rowKey="noticeId"
268 268
           key="noticeList"
269
-          search={{
270
-            labelWidth: 120,
271
-          }}
269
+          search={false}
272 270
           toolBarRender={() => [
273 271
             <Button
274 272
               type="primary"

+ 2
- 2
src/pages/News/NewsList/edit.tsx Zobrazit soubor

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

+ 1
- 0
src/pages/Other/footer/index.tsx Zobrazit soubor

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

Načítá se…
Zrušit
Uložit