李志伟 3 lat temu
rodzic
commit
ab93629e21

+ 0
- 11
config/routes.js Wyświetl plik

@@ -78,17 +78,6 @@ export default [
78 78
         component: './ContentManagementSystem/InformationList/InformationListEdit',
79 79
         hideInMenu: true,
80 80
       },
81
-      {
82
-        path: '/ContentManagementSystem/BannerClassification',
83
-        name: 'Banner资讯',
84
-        component: './ContentManagementSystem/BannerClassification',
85
-      },
86
-      {
87
-        path: '/ContentManagementSystem/BannerClassification/BannerClassificationEdit',
88
-        name: 'Banner资讯编辑',
89
-        component: './ContentManagementSystem/BannerClassification/BannerClassificationEdit',
90
-        hideInMenu: true,
91
-      },
92 81
       {
93 82
         path: '/ContentManagementSystem/Advertisement',
94 83
         name: '广告位管理',

+ 0
- 73
src/pages/ContentManagementSystem/BannerClassification/BannerClassificationEdit/index.jsx Wyświetl plik

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

+ 0
- 141
src/pages/ContentManagementSystem/BannerClassification/index.jsx Wyświetl plik

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