瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/nanyang/machinery-admin

张延森 3 年之前
父節點
當前提交
e12fb14e55

+ 48
- 32
src/pages/ContentManagementSystem/BannerClassification/BannerClassificationEdit/index.jsx 查看文件

@@ -1,19 +1,20 @@
1
-import { Input, Card, Select, Button, message, Upload, Modal } from "antd"
2
-import { useEffect, useState } from 'react'
3
-import { Form } from "antd";
1
+import { Input, Card, Select, Button, message, Upload, Modal } from 'antd';
2
+import { useEffect, useState } from 'react';
3
+import { Form } from 'antd';
4 4
 import { history } from 'umi';
5
-import ProCard from '@ant-design/pro-card'
6
-import { UploadOutlined } from '@ant-design/icons';
5
+import ProCard from '@ant-design/pro-card';
6
+import { UploadImage } from '@/components/Upload';
7
+import ExtendContent from '@/components/ExtendContent';
7 8
 
8
-const { Option } = Select
9
+const { Option } = Select;
9 10
 const goBack = () => {
10
-  history.goBack()
11
-}
12
-const FormItem = Form.Item
11
+  history.goBack();
12
+};
13
+const FormItem = Form.Item;
13 14
 export default (props) => {
14
-
15
-  const [form] = Form.useForm()
16
-  const [loading, setLoading] = useState(false)
15
+  const [form] = Form.useForm();
16
+  const [loading, setLoading] = useState(false);
17
+  const [image, setImage] = useState();
17 18
 
18 19
   const formItemLayout = {
19 20
     //布局
@@ -21,36 +22,51 @@ export default (props) => {
21 22
     wrapperCol: { span: 14 },
22 23
   };
23 24
 
24
-  const Submit = values => {
25
+  const Submit = (values) => {
25 26
     message.success(`成功成功成功`);
26
-    console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
27
-
27
+    console.log('🚀 ~ file: index.jsx ~ line 21 ~ values', values);
28 28
   };
29 29
 
30 30
   return (
31
-    <Card >
32
-      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
33
-      >
31
+    <Card>
32
+      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
34 33
         <ProCard.TabPane key={1} tab="资讯管理">
35
-          <Form {...formItemLayout} onFinish={Submit} form={form} >
36
-            <FormItem label="Banner图集" name="user" rules={[{ required: true, message: '请选择' }]}>
37
-              <Upload {...props}>
38
-                <Button icon={<UploadOutlined />}>Upload</Button>
39
-              </Upload>
40
-            </FormItem>
41
-            <FormItem label="资讯分类名称" name="shopName" rules={[{ required: true, message: '请输入' }]}>
34
+          <Form {...formItemLayout} onFinish={Submit} form={form}>
35
+            <FormItem label="名称" name="title" rules={[{ required: true, message: '请输入' }]}>
42 36
               <Input placeholder="请输入" style={{ width: '350px' }} />
43 37
             </FormItem>
44
-            <FormItem label="资讯内容" name="s1hopName" rules={[{ required: true, message: '请输入' }]}>
45
-              <Input placeholder="请输入" style={{ width: '350px' }} />
38
+            <FormItem label="图片" name="thumb" rules={[{ required: true, message: '请选择' }]}>
39
+              <UploadImage value={image} onChange={setImage} />
40
+            </FormItem>
41
+            <FormItem label="位置" name="position" rules={[{ required: true, message: '请选择' }]}>
42
+              <Select>
43
+                <Option value="index">首屏</Option>
44
+                <Option value="banner">banner页面</Option>
45
+              </Select>
46
+            </FormItem>
47
+            <FormItem label="详细信息" colon={false}>
48
+              <ExtendContent
49
+                targetType="tourist"
50
+                targetId={'66'}
51
+                onCancel={() => history.goBack()}
52
+              />
46 53
             </FormItem>
47
-            <FormItem label=" " colon={false} >
48
-              <Button type='default' onClick={() => goBack()} >返回</Button>
49
-              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
54
+            <FormItem label=" " colon={false}>
55
+              <Button type="default" onClick={() => goBack()}>
56
+                返回
57
+              </Button>
58
+              <Button
59
+                type="primary"
60
+                loading={loading}
61
+                htmlType="Submit"
62
+                style={{ marginLeft: '4em' }}
63
+              >
64
+                保存
65
+              </Button>
50 66
             </FormItem>
51 67
           </Form>
52 68
         </ProCard.TabPane>
53 69
       </ProCard>
54 70
     </Card>
55
-  )
56
-}
71
+  );
72
+};

+ 39
- 31
src/pages/ContentManagementSystem/BannerClassification/index.jsx 查看文件

@@ -5,7 +5,6 @@ import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5 5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6 6
 import ProTable, { TableDropdown } from '@ant-design/pro-table';
7 7
 
8
-
9 8
 export default (props) => {
10 9
   const dataSource = [
11 10
     {
@@ -14,56 +13,63 @@ export default (props) => {
14 13
       name: '胡彦斌',
15 14
       age: 32,
16 15
       zz: '西湖区湖底公园1号',
16
+      status: 1
17 17
     },
18
-
19 18
   ];
20 19
 
21
-
22 20
   // 测试内容👆-------------------------
23 21
 
24 22
   const actionRef = useRef();
25 23
   const gotoDetail = (id) => {
26
-    history.push(`BannerClassification/BannerClassificationEdit`)
27
-  }
28
-
24
+    history.push(`BannerClassification/BannerClassificationEdit`);
25
+  };
29 26
 
30 27
   const handleDelete = (e) => {
31
-    deleteNote(e.noteId).then(res => {
28
+    deleteNote(e.noteId).then((res) => {
32 29
       message.success('删除成功');
33 30
       actionRef.current.reload();
34
-    })
35
-  }
31
+    });
32
+  };
36 33
 
37 34
   const handleOK = (record, data) => {
38
-    const titleCourse = record.status ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!' : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
35
+    const titleCourse = record.status
36
+      ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!'
37
+      : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
39 38
     Modal.confirm({
40 39
       title: titleCourse,
41 40
       okText: '确认',
42 41
       cancelText: '取消',
43 42
       onOk () {
44
-        publishNote(record.noteId, record.status ? 'off' : 'on').then(res => {
43
+        publishNote(record.noteId, record.status ? 'off' : 'on').then((res) => {
45 44
           message.success('操作成功');
46
-          actionRef.current.reload()
47
-        })
45
+          actionRef.current.reload();
46
+        });
48 47
       },
49 48
     });
50
-  }
49
+  };
51 50
   const actions = () => [
52
-    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增</Button>,
53
-  ]
51
+    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>
52
+      新增
53
+    </Button>,
54
+  ];
54 55
   const columns = [
55 56
     {
56
-      title: 'Banner图片',
57
-      key: 'zz',
58
-      dataIndex: 'zz',
57
+      title: '名称',
58
+      key: 'title',
59
+      dataIndex: 'title',
60
+      search: false,
61
+    },
62
+    {
63
+      title: '图片',
64
+      key: 'thumb',
65
+      dataIndex: 'thumb',
59 66
       search: false,
60 67
       render: (t) => <img width={110} src={t} alt="" />,
61
-
62 68
     },
63 69
     {
64
-      title: '资讯详情',
65
-      dataIndex: 'name',
66
-      key: 'name',
70
+      title: '位置',
71
+      key: 'position',
72
+      dataIndex: 'position',
67 73
       search: false,
68 74
     },
69 75
     {
@@ -74,7 +80,7 @@ export default (props) => {
74 80
       valueEnum: {
75 81
         0: { text: '已发布', status: 'Success' },
76 82
         1: { text: '未发布', status: 'Error' },
77
-      }
83
+      },
78 84
     },
79 85
 
80 86
     {
@@ -93,7 +99,7 @@ export default (props) => {
93 99
       dataIndex: 'createdAt',
94 100
       valueType: 'date',
95 101
       // render: (t) => formatterTime(t),
96
-      sorter: (a, b) => a.createdAt - b.createdAt,//时间排序
102
+      sorter: (a, b) => a.createdAt - b.createdAt, //时间排序
97 103
     },
98 104
     {
99 105
       title: '操作',
@@ -102,7 +108,9 @@ export default (props) => {
102 108
       ellipsis: true,
103 109
       width: 200,
104 110
       render: (_, record) => [
105
-        <Link key={2} to={`BannerClassification/BannerClassificationEdit`}>编辑</Link>,
111
+        <Link key={2} to={`BannerClassification/BannerClassificationEdit`}>
112
+          编辑
113
+        </Link>,
106 114
         <Popconfirm
107 115
           key={3}
108 116
           title="您是否确认删除 ?"
@@ -110,11 +118,11 @@ export default (props) => {
110 118
           okText="确定"
111 119
           cancelText="取消"
112 120
         >
113
-          <a href="#"  >删除</a>
121
+          <a href="#">删除</a>
114 122
         </Popconfirm>,
115
-      ]
123
+      ],
116 124
     },
117
-  ]
125
+  ];
118 126
 
119 127
   return (
120 128
     <PageHeaderWrapper>
@@ -129,5 +137,5 @@ export default (props) => {
129 137
         actionRef={actionRef}
130 138
       />
131 139
     </PageHeaderWrapper>
132
-  )
133
-}
140
+  );
141
+};

+ 12
- 10
src/pages/ContentManagementSystem/InformationList/InformationListEdit/index.jsx 查看文件

@@ -1,9 +1,9 @@
1
-import { Input, Card, Select, Button, message } from 'antd';
1
+import { Input, Card, Select, Button, Form, message } from 'antd';
2 2
 import { useEffect, useState } from 'react';
3
-import { Form } from 'antd';
4 3
 import { history } from 'umi';
5 4
 import ProCard from '@ant-design/pro-card';
6
-// import ModalImage from './Modalimage';
5
+import ExtendContent from '@/components/ExtendContent';
6
+import { UploadImage } from '@/components/Upload';
7 7
 
8 8
 const { Option } = Select;
9 9
 const goBack = () => {
@@ -13,6 +13,7 @@ const FormItem = Form.Item;
13 13
 export default (props) => {
14 14
   const [form] = Form.useForm();
15 15
   const [loading, setLoading] = useState(false);
16
+  const [image, setImage] = useState();
16 17
 
17 18
   const formItemLayout = {
18 19
     //布局
@@ -48,13 +49,14 @@ export default (props) => {
48 49
               <Input placeholder="请输入" style={{ width: '350px' }} />
49 50
             </FormItem>
50 51
             <FormItem label="资讯封面" name="thumb" rules={[{ required: true, message: '请输入' }]}>
51
-              {/* <ModalImage
52
-                sortVale={sortVale}
53
-                visible={visible}
54
-                value={content}
55
-                onChange={handleChange}
56
-                onCancel={handleClose}
57
-              /> */}
52
+              <UploadImage value={image} onChange={setImage} />
53
+            </FormItem>
54
+            <FormItem label="详细信息" colon={false}>
55
+              <ExtendContent
56
+                targetType="tourist"
57
+                targetId={'66'}
58
+                onCancel={() => history.goBack()}
59
+              />
58 60
             </FormItem>
59 61
             <FormItem label=" " colon={false}>
60 62
               <Button type="default" onClick={() => goBack()}>

+ 5
- 5
src/pages/ContentManagementSystem/InformationList/index.jsx 查看文件

@@ -8,7 +8,7 @@ import ProTable, { TableDropdown } from '@ant-design/pro-table';
8 8
 export default (props) => {
9 9
   const dataSource = [
10 10
     {
11
-      id: 9,
11
+      status: 0,
12 12
       key: '1',
13 13
       name: '胡彦斌',
14 14
       age: 32,
@@ -39,14 +39,14 @@ export default (props) => {
39 39
   const columns = [
40 40
     {
41 41
       title: '分类名',
42
-      key: 'typeName',
43
-      dataIndex: 'typeName',
42
+      key: 'name',
43
+      dataIndex: 'name',
44 44
       search: false,
45 45
     },
46 46
     {
47 47
       title: '资讯标题',
48
-      dataIndex: 'title',
49
-      key: 'title',
48
+      dataIndex: 'zz',
49
+      key: 'zz',
50 50
       search: false,
51 51
     },
52 52
     {

+ 3
- 2
src/pages/Machinery/MachineryType/index.jsx 查看文件

@@ -65,7 +65,7 @@ export default (props) => {
65 65
       search: false,
66 66
     },
67 67
   ];
68
-  const handleDelete = () => {};
68
+  const handleDelete = () => { };
69 69
 
70 70
   const Submit = () => {
71 71
     setLoading(true);
@@ -84,6 +84,7 @@ export default (props) => {
84 84
     form.resetFields();
85 85
     setSelectModal(false);
86 86
   };
87
+
87 88
   useEffect(() => {
88 89
     form.setFieldsValue({ targetName: '' });
89 90
     // setPackageList();
@@ -94,7 +95,7 @@ export default (props) => {
94 95
   return (
95 96
     <PageHeaderWrapper>
96 97
       <Modal
97
-        title="套餐权重修改"
98
+        title="修改"
98 99
         visible={selectModal}
99 100
         onCancel={onCancel}
100 101
         destroyOnClose={true}