Pārlūkot izejas kodu

1227提交

master
liqi pirms 4 mēnešiem
vecāks
revīzija
cec8159161
36 mainītis faili ar 146 papildinājumiem un 5431 dzēšanām
  1. 0
    41
      config/routes.ts
  2. 0
    17
      src/pages/ContactUs/Appoint/Appoint/AppointList.less
  3. 0
    207
      src/pages/ContactUs/Appoint/Appoint/AppointList.tsx
  4. 0
    0
      src/pages/ContactUs/Appoint/index.less
  5. 0
    16
      src/pages/ContactUs/Appoint/index.tsx
  6. 0
    17
      src/pages/ContactUs/LeadInfo/LeadInfo/LeadInfoList.less
  7. 0
    203
      src/pages/ContactUs/LeadInfo/LeadInfo/LeadInfoList.tsx
  8. 0
    0
      src/pages/ContactUs/LeadInfo/index.less
  9. 0
    16
      src/pages/ContactUs/LeadInfo/index.tsx
  10. 7
    3
      src/pages/Home/banner/index.tsx
  11. 5
    3
      src/pages/JoinZZ/biddingDocument/edit.tsx
  12. 1
    1
      src/pages/JoinZZ/vacancy/edit.tsx
  13. 0
    238
      src/pages/MapDot/MapDot/edit.tsx
  14. 0
    3
      src/pages/MapDot/MapDot/index.less
  15. 0
    301
      src/pages/MapDot/MapDot/index.tsx
  16. 4
    3
      src/pages/News/NewsList/edit.tsx
  17. 15
    3
      src/pages/News/NewsList/index.tsx
  18. 4
    3
      src/pages/PartyWork/partyWork/edit.tsx
  19. 23
    3
      src/pages/PartyWork/partyWork/index.tsx
  20. 0
    290
      src/pages/Product/ProductManage/index.less
  21. 0
    261
      src/pages/Product/ProductManage/index.tsx
  22. 0
    274
      src/pages/Product/ProductManage/page/TestimonyDetail.tsx
  23. 0
    283
      src/pages/Product/ProductManage/page/carBrandDetail.tsx
  24. 0
    354
      src/pages/Product/ProductManage/page/carModels.tsx
  25. 0
    1986
      src/pages/Product/ProductManage/page/carModelsDetail.tsx
  26. 0
    327
      src/pages/Product/ProductManage/page/carSeries.tsx
  27. 0
    195
      src/pages/Product/ProductManage/page/carouselImage.tsx
  28. 6
    4
      src/pages/SocialRespon/socialRespon/edit.tsx
  29. 22
    3
      src/pages/SocialRespon/socialRespon/index.tsx
  30. 0
    68
      src/services/contactUs/contactUs.ts
  31. 10
    0
      src/services/home/banner.ts
  32. 0
    57
      src/services/mapDot/mapDot.ts
  33. 12
    1
      src/services/news/news.ts
  34. 24
    2
      src/services/partyWork/partyWork.ts
  35. 0
    246
      src/services/product/index.ts
  36. 13
    2
      src/services/socialRespon/socialRespon.ts

+ 0
- 41
config/routes.ts Parādīt failu

@@ -96,18 +96,6 @@ export default [
96 96
       },
97 97
     ],
98 98
   },
99
-  {
100
-    name: 'Product',
101
-    path: '/Product',
102
-    icon: 'smile',
103
-    routes: [
104
-      {
105
-        name: 'ProductManage',
106
-        path: '/Product/ProductManage',
107
-        component: './Product/ProductManage',
108
-      },
109
-    ],
110
-  },
111 99
   {
112 100
     name: 'News',
113 101
     path: '/News',
@@ -178,35 +166,6 @@ export default [
178 166
       },
179 167
     ],
180 168
   },
181
-  {
182
-    name: 'ContactUs',
183
-    path: '/ContactUs',
184
-    icon: 'smile',
185
-    routes: [
186
-      {
187
-        name: 'LeadInfo',
188
-        path: '/ContactUs/LeadInfo',
189
-        component: './ContactUs/LeadInfo',
190
-      },
191
-      {
192
-        name: 'Appoint',
193
-        path: '/ContactUs/Appoint',
194
-        component: './ContactUs/Appoint',
195
-      },
196
-    ],
197
-  },
198
-  {
199
-    name: 'MapDot',
200
-    path: '/MapDot',
201
-    icon: 'smile',
202
-    routes: [
203
-      {
204
-        name: 'MapDot',
205
-        path: '/MapDot/MapDot',
206
-        component: './MapDot/MapDot',
207
-      },
208
-    ],
209
-  },
210 169
   {
211 170
     name: 'monitor',
212 171
     path: '/monitor',

+ 0
- 17
src/pages/ContactUs/Appoint/Appoint/AppointList.less Parādīt failu

@@ -1,17 +0,0 @@
1
-.LeadInfoListContainer {
2
-  position: static !important;
3
-  width: 100% !important;
4
-  height: 100% !important;
5
-  margin: 0px !important;
6
-  background-color: transparent !important;
7
-
8
-
9
-  .the-tool-options {
10
-    display: flex;
11
-    align-items: center;
12
-    justify-content: flex-end;
13
-    > .ant-btn {
14
-      margin: 0px 0px 0px 10px;
15
-    }
16
-  }
17
-}

+ 0
- 207
src/pages/ContactUs/Appoint/Appoint/AppointList.tsx Parādīt failu

@@ -1,207 +0,0 @@
1
-import {
2
-  GetClueListType,
3
-  deleteClueRemove,
4
-  getClueListList,
5
-} from '@/services/contactUs/contactUs';
6
-import type { ActionType, ProColumns, ProTableProps } from '@ant-design/pro-components';
7
-import { ProTable } from '@ant-design/pro-components';
8
-import { Button, ConfigProvider, Empty, message } from 'antd';
9
-import moment from 'moment';
10
-import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
11
-import './AppointList.less';
12
-
13
-export type StateType = 'none' | 'add' | 'check' | 'modify';
14
-export type AppointListProps = {
15
-  theAccess?: any; //权限;
16
-  ref?: React.ForwardedRef<any>; //用于取到转发的ref;
17
-  onStateChange?: () => any;
18
-};
19
-
20
-const AppointList = forwardRef((props: AppointListProps, theRef) => {
21
-  const [messageApi, contextHolder] = message.useMessage();
22
-  const theFormRef = useRef();
23
-
24
-  const actionRef = useRef<ActionType>();
25
-
26
-  // 查询表单;
27
-  type TableQueryParams = {
28
-    [property: string]: any;
29
-  };
30
-  type TheRequestType = ProTableProps<GetClueListType, TableQueryParams>['request'];
31
-  const handleRequest: TheRequestType = async (params, sort, filter) => {
32
-    console.log('handleRequest-params', params);
33
-    console.log('handleRequest-sort', sort);
34
-    console.log('handleRequest-filter', filter);
35
-    const result = {
36
-      data: [] as GetClueListType[], //表格要渲染的数据列;
37
-      total: 0, //不传会使用result.data的长度,如果是分页一定要传;
38
-      success: false, //result.success请返回true,不然表格会停止解析数据,即使有数据;
39
-    };
40
-    const theParams = {
41
-      type : 2,
42
-      ...params,
43
-      // emailTopic: theInputValue || '',
44
-    };
45
-    let res = await getClueListList(theParams);
46
-    console.log('res', res);
47
-    if (res.code !== 200) {
48
-      return result;
49
-    }
50
-
51
-    result.total = res.total;
52
-    result.success = true;
53
-    result.data = res.rows;
54
-    return result;
55
-  };
56
-  useEffect(() => {
57
-    actionRef?.current?.reload?.();
58
-  }, [props.currentId]);
59
-
60
-  const handleSumbit = async () => {
61
-    console.log(`重置-->`);
62
-
63
-    actionRef?.current?.reload?.();
64
-  };
65
-
66
-  const handleDelete = async (item: GetClueListType) => {
67
-    const params = {
68
-      clueUuid: item?.uuid || ``,
69
-    };
70
-    const res = await deleteClueRemove(params);
71
-    console.log(`res-->`, res);
72
-    if (res?.code !== 200) {
73
-      messageApi.error(res?.msg || `操作失败`);
74
-      return;
75
-    }
76
-    messageApi.success(res?.msg || `操作成功`);
77
-    actionRef?.current?.reload?.();
78
-  };
79
-
80
-  // 使用useImperativeHandle来暴露给父组件的方法
81
-  useImperativeHandle(theRef, () => ({
82
-    refresh: () => {
83
-      actionRef?.current?.reload?.();
84
-    },
85
-  }));
86
-
87
-  const theDOMRef = useRef<HTMLDivElement>(null);
88
-  const theColumns: ProColumns<GetClueListType>[] = [
89
-    {
90
-      title: '预约日期',
91
-      dataIndex: 'date',
92
-      valueType: 'dateRange',
93
-      hideInTable: true,
94
-      search: {
95
-        transform: (value) => {
96
-          console.log(`value-->`, value);
97
-
98
-          return {
99
-            startTime: value[0],
100
-            endTime: value[1],
101
-          };
102
-        },
103
-      },
104
-    },
105
-    {
106
-      title: '姓名',
107
-      dataIndex: 'name',
108
-      search: false,
109
-    },
110
-    {
111
-      title: '电话',
112
-      dataIndex: 'phone',
113
-      search: false,
114
-    },
115
-    {
116
-      title: '意向车型',
117
-      dataIndex: 'product',
118
-      search: false,
119
-    },
120
-    {
121
-      title: '省',
122
-      dataIndex: 'province',
123
-      search: false,
124
-    },
125
-    {
126
-      title: '市',
127
-      dataIndex: 'city',
128
-      search: false,
129
-    },
130
-    {
131
-      title: '预约门店',
132
-      dataIndex: 'shop',
133
-      search: false,
134
-    },
135
-    {
136
-      title: '预约提交日期时间',
137
-      dataIndex: 'date',
138
-      search: false,
139
-      render(text, record, index) {
140
-        if (!text) {
141
-          return `-`;
142
-        }
143
-        let theText = moment(record?.date).format('YYYY-MM-DD HH:mm:ss');
144
-        return theText;
145
-      },
146
-    },
147
-
148
-    {
149
-      title: '操作',
150
-      valueType: 'option',
151
-      fixed: 'right',
152
-      key: 'option',
153
-      width: '150px',
154
-      render: (text, record, _, action) => {
155
-        console.log(`props-->`, props);
156
-
157
-        return (
158
-          <div className="table-option-box">
159
-            <Button type="link" size="small" onClick={handleDelete.bind(null, record)}>
160
-              删除
161
-            </Button>
162
-          </div>
163
-        );
164
-      },
165
-    },
166
-  ];
167
-
168
-  return (
169
-    <ConfigProvider
170
-      renderEmpty={() => {
171
-        return <Empty imageStyle={{ height: 260, width: 260 }} description={`暂无数据`}></Empty>;
172
-      }}
173
-    >
174
-      {contextHolder}
175
-      <ProTable<GetClueListType, TableQueryParams>
176
-        className="AppointListContainer"
177
-        tableClassName="the-table-container custom-scrollbar02"
178
-        toolBarRender={() => {
179
-          return [
180
-            <div key="theKey" className="the-tool-options" ref={theDOMRef}>
181
-              <Button onClick={handleSumbit?.bind?.(null)}>导出</Button>
182
-            </div>,
183
-          ];
184
-        }}
185
-        columns={theColumns}
186
-        actionRef={actionRef}
187
-        formRef={theFormRef}
188
-        rowSelection={false}
189
-        options={false}
190
-        // headerTitle={`门店预约`}
191
-        tableAlertRender={false}
192
-        cardBordered
193
-        request={handleRequest.bind(null)}
194
-        scroll={{
195
-          x: '100%',
196
-        }}
197
-        rowKey="uuid"
198
-        pagination={{
199
-          pageSize: 10,
200
-          onChange: (page) => console.log(page),
201
-        }}
202
-        // dateFormatter="string"
203
-      />
204
-    </ConfigProvider>
205
-  );
206
-});
207
-export default AppointList;

+ 0
- 0
src/pages/ContactUs/Appoint/index.less Parādīt failu


+ 0
- 16
src/pages/ContactUs/Appoint/index.tsx Parādīt failu

@@ -1,16 +0,0 @@
1
-import { KeepAlive, useAccess } from '@umijs/max';
2
-import React from 'react';
3
-import './index.less';
4
-import AppointList from './Appoint/AppointList';
5
-
6
-const Home: React.FC = () => {
7
-  const access = useAccess();
8
-
9
-  return (
10
-    <KeepAlive name="门店预约" path="/ContactUs/Appoint">
11
-      <div><AppointList></AppointList></div>
12
-    </KeepAlive>
13
-  );
14
-};
15
-
16
-export default Home;

+ 0
- 17
src/pages/ContactUs/LeadInfo/LeadInfo/LeadInfoList.less Parādīt failu

@@ -1,17 +0,0 @@
1
-.LeadInfoListContainer {
2
-  position: static !important;
3
-  width: 100% !important;
4
-  height: 100% !important;
5
-  margin: 0px !important;
6
-  background-color: transparent !important;
7
-
8
-
9
-  .the-tool-options {
10
-    display: flex;
11
-    align-items: center;
12
-    justify-content: flex-end;
13
-    > .ant-btn {
14
-      margin: 0px 0px 0px 10px;
15
-    }
16
-  }
17
-}

+ 0
- 203
src/pages/ContactUs/LeadInfo/LeadInfo/LeadInfoList.tsx Parādīt failu

@@ -1,203 +0,0 @@
1
-import {
2
-  GetClueListType,
3
-  deleteClueRemove,
4
-  getClueListList,
5
-} from '@/services/contactUs/contactUs';
6
-import type { ActionType, ProColumns, ProTableProps } from '@ant-design/pro-components';
7
-import { ProTable } from '@ant-design/pro-components';
8
-import { Button, ConfigProvider, Empty, message } from 'antd';
9
-import moment from 'moment';
10
-import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
11
-import './LeadInfoList.less';
12
-
13
-export type StateType = 'none' | 'add' | 'check' | 'modify';
14
-export type LeadInfoListProps = {
15
-  theAccess?: any; //权限;
16
-  ref?: React.ForwardedRef<any>; //用于取到转发的ref;
17
-  onStateChange?: () => any;
18
-};
19
-
20
-const LeadInfoList = forwardRef((props: LeadInfoListProps, theRef) => {
21
-  const [messageApi, contextHolder] = message.useMessage();
22
-  // console.log('LeadInfoList-props', props);
23
-  const theFormRef = useRef();
24
-
25
-  const actionRef = useRef<ActionType>();
26
-
27
-  // 查询表单;
28
-  type TableQueryParams = {
29
-    [property: string]: any;
30
-  };
31
-  type TheRequestType = ProTableProps<GetClueListType, TableQueryParams>['request'];
32
-  const handleRequest: TheRequestType = async (params, sort, filter) => {
33
-    console.log('handleRequest-params', params);
34
-    console.log('handleRequest-sort', sort);
35
-    console.log('handleRequest-filter', filter);
36
-    const result = {
37
-      data: [] as GetClueListType[], //表格要渲染的数据列;
38
-      total: 0, //不传会使用result.data的长度,如果是分页一定要传;
39
-      success: false, //result.success请返回true,不然表格会停止解析数据,即使有数据;
40
-    };
41
-    const theParams = {
42
-      type : 2,
43
-      ...params,
44
-      // emailTopic: theInputValue || '',
45
-    };
46
-    let res = await getClueListList(theParams);
47
-    console.log('res', res);
48
-    if (res.code !== 200) {
49
-      return result;
50
-    }
51
-
52
-    result.total = res.total;
53
-    result.success = true;
54
-    result.data = res.rows;
55
-    return result;
56
-  };
57
-  useEffect(() => {
58
-    actionRef?.current?.reload?.();
59
-  }, [props.currentId]);
60
-
61
-  const handleSumbit = async () => {
62
-    console.log(`重置-->`);
63
-
64
-    actionRef?.current?.reload?.();
65
-  };
66
-
67
-  const handleDelete = async (item: GetClueListType) => {
68
-    const params = {
69
-      clueUuid: item?.uuid || ``,
70
-    };
71
-    const res = await deleteClueRemove(params);
72
-    console.log(`res-->`, res);
73
-    if (res?.code !== 200) {
74
-      messageApi.error(res?.msg || `操作失败`);
75
-      return;
76
-    }
77
-    messageApi.success(res?.msg || `操作成功`);
78
-    actionRef?.current?.reload?.();
79
-  };
80
-
81
-  // 使用useImperativeHandle来暴露给父组件的方法
82
-  useImperativeHandle(theRef, () => ({
83
-    refresh: () => {
84
-      actionRef?.current?.reload?.();
85
-    },
86
-  }));
87
-
88
-  const theDOMRef = useRef<HTMLDivElement>(null);
89
-  const theColumns: ProColumns<GetClueListType>[] = [
90
-    {
91
-      title: '留言日期',
92
-      dataIndex: 'date',
93
-      valueType: 'dateRange',
94
-      hideInTable: true,
95
-      search: {
96
-        transform: (value) => {
97
-          console.log(`value-->`, value);
98
-
99
-          return {
100
-            startTime: value[0],
101
-            endTime: value[1],
102
-          };
103
-        },
104
-      },
105
-    },
106
-    {
107
-      title: '姓名',
108
-      dataIndex: 'name',
109
-      search: false,
110
-    },
111
-    {
112
-      title: '电话',
113
-      dataIndex: 'phone',
114
-      search: false,
115
-    },
116
-    {
117
-      title: '邮箱',
118
-      dataIndex: 'email',
119
-      search: false,
120
-    },
121
-    {
122
-      title: '类别',
123
-      dataIndex: 'leawordType',
124
-      search: false,
125
-    },
126
-    {
127
-      title: '留言',
128
-      dataIndex: 'email',
129
-      search: false,
130
-    },
131
-    {
132
-      title: '留言日期时间',
133
-      dataIndex: 'date',
134
-      search: false,
135
-      render(text, record, index) {
136
-        if (!text) {
137
-          return `-`;
138
-        }
139
-        let theText = moment(record?.date).format('YYYY-MM-DD HH:mm:ss');
140
-        return theText;
141
-      },
142
-    },
143
-
144
-    {
145
-      title: '操作',
146
-      valueType: 'option',
147
-      fixed: 'right',
148
-      key: 'option',
149
-      width: '150px',
150
-      render: (text, record, _, action) => {
151
-        console.log(`props-->`, props);
152
-
153
-        return (
154
-          <div className="table-option-box">
155
-            <Button type="link" size="small" onClick={handleDelete.bind(null, record)}>
156
-              删除
157
-            </Button>
158
-          </div>
159
-        );
160
-      },
161
-    },
162
-  ];
163
-
164
-  return (
165
-    <ConfigProvider
166
-      renderEmpty={() => {
167
-        return <Empty imageStyle={{ height: 260, width: 260 }} description={`暂无数据`}></Empty>;
168
-      }}
169
-    >
170
-      {contextHolder}
171
-      <ProTable<GetClueListType, TableQueryParams>
172
-        className="LeadInfoListContainer"
173
-        tableClassName="the-table-container custom-scrollbar02"
174
-        toolBarRender={() => {
175
-          return [
176
-            <div key="theKey" className="the-tool-options" ref={theDOMRef}>
177
-              <Button onClick={handleSumbit?.bind?.(null)}>导出</Button>
178
-            </div>,
179
-          ];
180
-        }}
181
-        columns={theColumns}
182
-        actionRef={actionRef}
183
-        formRef={theFormRef}
184
-        rowSelection={false}
185
-        options={false}
186
-        // headerTitle={`用户留言`}
187
-        tableAlertRender={false}
188
-        cardBordered
189
-        request={handleRequest.bind(null)}
190
-        scroll={{
191
-          x: '100%',
192
-        }}
193
-        rowKey="uuid"
194
-        pagination={{
195
-          pageSize: 10,
196
-          onChange: (page) => console.log(page),
197
-        }}
198
-        // dateFormatter="string"
199
-      />
200
-    </ConfigProvider>
201
-  );
202
-});
203
-export default LeadInfoList;

+ 0
- 0
src/pages/ContactUs/LeadInfo/index.less Parādīt failu


+ 0
- 16
src/pages/ContactUs/LeadInfo/index.tsx Parādīt failu

@@ -1,16 +0,0 @@
1
-import { KeepAlive, useAccess } from '@umijs/max';
2
-import React from 'react';
3
-import './index.less';
4
-import LeadInfoList from './LeadInfo/LeadInfoList';
5
-
6
-const Home: React.FC = () => {
7
-  const access = useAccess();
8
-
9
-  return (
10
-    <KeepAlive name="用户留言" path="/ContactUs/LeadInfo">
11
-      <div><LeadInfoList></LeadInfoList></div>
12
-    </KeepAlive>
13
-  );
14
-};
15
-
16
-export default Home;

+ 7
- 3
src/pages/Home/banner/index.tsx Parādīt failu

@@ -6,7 +6,7 @@ import { Button, message, Modal, Image } from 'antd';
6 6
 import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
7 7
 import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
8 8
 // import { getNoticeList, removeNotice, addNotice, updateNotice, exportNotice } from '@/services/system/notice';
9
-import { getBannerList, saveBanner, deleteBanner } from '@/services/home/banner';
9
+import { getBannerList, saveBanner, deleteBanner,push } from '@/services/home/banner';
10 10
 import BannerForm from './edit';
11 11
 import moment from 'moment';
12 12
 import { KeepAlive } from 'react-activation';
@@ -162,8 +162,12 @@ const NoticeTableList: React.FC = () => {
162 162
      */
163 163
     const publishing = async () => {
164 164
         try {
165
-            // 接口逻辑写这里
166
-
165
+            const resp = await push();
166
+            if (resp.code === 200) {
167
+                message.success('发布成功');
168
+            } else {
169
+                message.error(resp.msg);
170
+            }
167 171
         } catch (error) { }
168 172
     }
169 173
 

+ 5
- 3
src/pages/JoinZZ/biddingDocument/edit.tsx Parādīt failu

@@ -5,6 +5,7 @@ import {
5 5
   ProFormUploadButton,
6 6
   ProFormSelect,
7 7
   ProFormDatePicker,
8
+  ProFormTextArea,
8 9
   ProFormRadio
9 10
 } from '@ant-design/pro-components';
10 11
 import { Form, Modal, Drawer, message, Upload, Space, Button, Switch,Input,Tooltip } from 'antd';
@@ -209,7 +210,7 @@ const BiddingDocumentForm: React.FC<BiddingDocumentProps> = (props) => {
209 210
     let content = editor.getContents()
210 211
     // console.log('htmlStr----', htmlStr)
211 212
     editor.setContents(content)
212
-    data.date = moment(data.date).format('YYYY.MM.DD');
213
+    data.date = moment(data.date).format('YYYY-MM-DD');
213 214
     if(checkTop){
214 215
       data.top = 1;
215 216
     }else{
@@ -296,7 +297,7 @@ const BiddingDocumentForm: React.FC<BiddingDocumentProps> = (props) => {
296 297
             },
297 298
           ]}
298 299
         />
299
-        <ProFormText
300
+        <ProFormTextArea
300 301
           name="digest"
301 302
           label='摘要'
302 303
           labelCol={{
@@ -308,7 +309,7 @@ const BiddingDocumentForm: React.FC<BiddingDocumentProps> = (props) => {
308 309
           name="date"
309 310
           label='展示日期'
310 311
           fieldProps={{
311
-            format: (value) => value.format('YYYY.MM.DD'),
312
+            format: (value) => value.format('YYYY-MM-DD'),
312 313
           }}
313 314
           labelCol={{
314 315
             style: { width: 95 }
@@ -337,6 +338,7 @@ const BiddingDocumentForm: React.FC<BiddingDocumentProps> = (props) => {
337 338
             style: { width: 95 }
338 339
           }}
339 340
           placeholder={'中泽集团'}
341
+          initialValue={'中泽集团'}
340 342
         />
341 343
 
342 344
         <ProForm.Item 

+ 1
- 1
src/pages/JoinZZ/vacancy/edit.tsx Parādīt failu

@@ -209,7 +209,7 @@ const VacancyForm: React.FC<VacancyProps> = (props) => {
209 209
     let content = editor.getContents()
210 210
     // console.log('htmlStr----', htmlStr)
211 211
     editor.setContents(content)
212
-    data.date = moment(data.date).format('YYYY.MM.DD');
212
+    data.date = moment(data.date).format('YYYY-MM-DD');
213 213
     if(checkTop){
214 214
       data.top = 1;
215 215
     }else{

+ 0
- 238
src/pages/MapDot/MapDot/edit.tsx Parādīt failu

@@ -1,238 +0,0 @@
1
-import React, { useEffect, useState, useRef } from 'react';
2
-import {
3
-  ProForm,
4
-  ProFormText,
5
-  ProFormSelect,
6
-} from '@ant-design/pro-components';
7
-import { Form, Modal, Drawer, message, Upload, Space, Button, Switch,Input,Tooltip } from 'antd';
8
-import {InfoCircleOutlined} from '@ant-design/icons';
9
-import { useIntl, FormattedMessage } from '@umijs/max';
10
-import { DictValueEnumObj } from '@/components/DictTag';
11
-import Editor from '@/components/ueditor';
12
-import { upload,getArea } from '@/services/mapDot/mapDot';
13
-import Quill from "quill";
14
-import "quill/dist/quill.snow.css";
15
-import moment from 'moment';
16
-import { trim } from 'lodash';
17
-let editor: any;
18
-
19
-export type MapDotProps = {
20
-  onCancel: (flag?: boolean, formVals?: any) => void;
21
-  onSubmit: (values: any) => Promise<void>;
22
-  open: boolean;
23
-  currentRow: any;
24
-  name: string;
25
-  addr: string;
26
-  type: number;
27
-  img: string;
28
-  imgUrl: string;
29
-  phone: string;
30
-  province: string;
31
-  city: string;
32
-  lon: string;
33
-  lat: string;
34
-  use: number
35
-};
36
-
37
-const MapDotForm: React.FC<MapDotProps> = (props) => {
38
-  const [form] = Form.useForm();
39
-  const intl = useIntl();
40
-  let editorRef = useRef<HTMLDivElement>(null)
41
-
42
-  useEffect(() => {
43
-    console.log(props)
44
-    form.resetFields();
45
-    if(!props.open) return;
46
-    if(!props.currentRow) return;
47
-    const {name,addr,type,img,imgUrl,phone,province,city,lon,lat,use} = props.currentRow;
48
-    if (props.currentRow) {
49
-      form.setFieldsValue({
50
-        name,addr,type,img,imgUrl,phone,province,city,lon,lat,use
51
-      })
52
-    }
53
-
54
-    setimg(img)
55
-    
56
-    if (imgUrl && img) {
57
-      setFileList([
58
-        {
59
-          uid: img,
60
-          thumbUrl: imgUrl
61
-        }
62
-      ])
63
-    }
64
-    if (editorRef && editorRef.current && editorRef.current.children[0]) {
65
-      editorRef.current.children[0].innerHTML = content
66
-    }
67
-
68
-  }, [props.open]);
69
-
70
-  
71
-  const [fileList, setFileList] = useState<any>([]);
72
-  const [img, setimg] = useState<any>('');
73
-
74
-  const [checkTop, setCheckTop] = useState<any>('')
75
-  const handleOk = async () => {
76
-    let data = form.getFieldsValue()
77
-    
78
-    let val = await form.validateFields()
79
-    
80
-    data.beginTime = moment(data.beginTime).format('YYYY-MM-DD HH:mm:ss');
81
-    
82
-    
83
-    let formData = {
84
-      ...data,
85
-      img,
86
-    }
87
-    form.setFieldsValue({
88
-      title: '',
89
-      topicList: '',
90
-      digest: ""
91
-    })
92
-    setFileList([]);
93
-    setCheckTop(false)
94
-    props.onSubmit(formData);
95
-  };
96
-  const handleCancel = () => {
97
-    form.setFieldsValue({
98
-      title: '',
99
-      topicList: '',
100
-      digest: "",
101
-      top: ""
102
-    })
103
-    setFileList([]);
104
-    setCheckTop(false)
105
-    props.onCancel();
106
-
107
-  };
108
-
109
-  const handleChange = async (res) => {
110
-    const { fileList } = res;
111
-    setFileList(fileList);
112
-  };
113
-
114
-  const handleBeforeUpload = async (file: RcFile) => {
115
-    const formData = new FormData();
116
-    formData.append('file', file, file.name);
117
-    const res = await upload(formData);
118
-    if (res?.data?.uuid) {
119
-      setimg(res.data.uuid)
120
-    }
121
-    return false;
122
-  };
123
-
124
-
125
-  return (
126
-    <Drawer
127
-      width={'80%'}
128
-      title={props.currentRow ? '编辑' : '新建'}
129
-      forceRender
130
-      open={props.open}
131
-      destroyOnClose
132
-      onClose={handleCancel}
133
-      extra={
134
-        <Space>
135
-          <Button onClick={handleCancel}>取消</Button>
136
-          <Button type="primary" onClick={handleOk}>确认</Button>
137
-        </Space>
138
-      }
139
-    >
140
-      <ProForm
141
-        form={form}
142
-        grid={true}
143
-        submitter={false}
144
-        layout="horizontal"
145
-      >
146
-        <Form.Item 
147
-          name='type' 
148
-          label={'类型'}
149
-          rules={[
150
-            { required: true}]}>
151
-              <Radio.Group>
152
-                <Radio value={'1'}>门店</Radio>
153
-                <Radio value={'2'}>售后</Radio>
154
-                <Radio value={'3'}>充电站</Radio>
155
-              </Radio.Group>
156
-            </Form.Item>
157
-        <ProForm.Item
158
-          label={'上传图片'}
159
-          extra={'图片尺寸1218*915'}
160
-          labelCol={{
161
-            style: { width: 95 }
162
-          }}
163
-        >
164
-          <Upload
165
-            listType="picture-card" // 设置为图片卡片模式
166
-            fileList={fileList}
167
-            maxCount={1}
168
-            onChange={handleChange}
169
-            beforeUpload={handleBeforeUpload}
170
-          >
171
-            {fileList?.length < 1 && '+' + intl.formatMessage({ id: 'public.uploadImg' })}
172
-          </Upload>
173
-        </ProForm.Item>     
174
-        <ProFormText
175
-          name="name"
176
-          label='名称'
177
-          labelCol={{
178
-            style: { width: 95 }
179
-          }}
180
-          placeholder={'请输入名称'}
181
-          rules={[
182
-            {
183
-              required: true,
184
-              message: '请输入名称!',
185
-            },
186
-          ]}
187
-        />
188
-        <ProFormText
189
-          name="addr"
190
-          label='地址'
191
-          labelCol={{
192
-            style: { width: 95 }
193
-          }}
194
-          placeholder={'请输入地址'}
195
-          rules={[
196
-            {
197
-              required: true,
198
-              message: '请输入地址!',
199
-            },
200
-          ]}
201
-        />
202
-        <ProFormText
203
-          name="phone"
204
-          label='电话/简述'
205
-          labelCol={{
206
-            style: { width: 95 }
207
-          }}
208
-          placeholder={'请输入地址'}
209
-        />
210
-        <ProFormSelect
211
-          name="province"
212
-          key="province"
213
-          label='省'
214
-          request={() =>
215
-            getArea({type: 1}).then((res) => {
216
-              let tList = []
217
-              res.rows.forEach(item => {
218
-                tList.push({
219
-                  label: item.name,
220
-                  value: item.code,
221
-                })
222
-              })
223
-              return tList;
224
-            })
225
-
226
-          }
227
-          labelCol={{
228
-            style: { width: 95 }
229
-          }}
230
-          placeholder={'请选择省份'}
231
-        />
232
-        
233
-      </ProForm>
234
-    </Drawer>
235
-  );
236
-};
237
-
238
-export default MapDotForm;

+ 0
- 3
src/pages/MapDot/MapDot/index.less Parādīt failu

@@ -1,3 +0,0 @@
1
-.ant-pro-table-list-toolbar-title{
2
-    display:none;
3
-}

+ 0
- 301
src/pages/MapDot/MapDot/index.tsx Parādīt failu

@@ -1,301 +0,0 @@
1
-
2
-import React, { useState, useRef, useEffect } from 'react';
3
-import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
4
-import type { FormInstance } from 'antd';
5
-import { Button, message, Modal, Image } from 'antd';
6
-import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
7
-import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
8
-// import { getNoticeList, removeNotice, addNotice, updateNotice, exportNotice } from '@/services/system/notice';
9
-import { getMapDotList, saveMapDot, deleteMapDot, importData} from '@/services/mapDot/mapDot';
10
-import MapDotForm from './edit';
11
-import moment from 'moment';
12
-import { KeepAlive } from 'react-activation';
13
-import './index.less'
14
-import DictTag from '../../../components/DictTag';
15
-import { getDataEnumList } from '../../../services/system/Enum';
16
-
17
-const typeEnum = [
18
-    { label: '门店', value: 1 },
19
-    { label: '售后', value: 2 },
20
-    { label: '充电站', value: 3 },
21
-]
22
-const useEnum = [
23
-    { label: '禁用', value: 0 },
24
-    { label: '启用', value: 1 },
25
-]
26
-
27
-const NoticeTableList: React.FC = () => {
28
-    const formTableRef = useRef<FormInstance>();
29
-
30
-    const [modalVisible, setModalVisible] = useState<boolean>(false);
31
-
32
-    const actionRef = useRef<ActionType>();
33
-    const intl = useIntl();
34
-    const [currentRow, setCurrentRow] = useState<any>();
35
-    const [enumList,setEnumList] = useState()
36
-
37
-    const handleRemoveOne = async (selectedRow: API.System.Notice) => {
38
-        const hide = message.loading(intl.formatMessage({ id: 'public.loadingDelete' }));
39
-        if (!selectedRow) return true;
40
-        try {
41
-            const params = [selectedRow.uuid];
42
-            const resp = await deleteMapDot(params.join(','));
43
-            hide();
44
-            if (resp.code === 200) {
45
-                message.success(intl.formatMessage({ id: 'public.deleteSuccess' }));
46
-            } else {
47
-                message.error(resp.msg);
48
-            }
49
-            return true;
50
-        } catch (error) {
51
-            hide();
52
-            message.error(intl.formatMessage({ id: 'public.deleteError' }));
53
-            return false;
54
-        }
55
-    };
56
-
57
-    useEffect(() => {
58
-        getEnum()
59
-    }, [])
60
-
61
-    const getEnum = ()=>{
62
-        getDataEnumList({ enumUuid: '2024810214616101' }).then((res) => {
63
-            console.log(res.rows)
64
-
65
-            const enumOptions = res.rows.map((item: any) => ({
66
-                label: item.dataName,
67
-                value: item.uuid,
68
-            }));
69
-            setEnumList(enumOptions); // 设置 enumList
70
-        })
71
-    }
72
-    const columns: ProColumns<API.System.Notice>[] = [
73
-        {
74
-            title: '序号',
75
-            dataIndex: 'id',
76
-            valueType: 'text',
77
-            hideInSearch: true,
78
-            render: (_, record: any) => {
79
-                // console.log('record---',_,record)
80
-                return record.rowIndex;
81
-            },
82
-        },
83
-        {
84
-            title: '类别',
85
-            dataIndex: 'type',
86
-            valueType: 'radio',
87
-            request: async () => typeEnum,
88
-            render: (_, record) => {
89
-                return (<DictTag enums={typeEnum} value={record.type} />);
90
-            },
91
-        },
92
-        {
93
-            title: '配图',
94
-            dataIndex: 'imgUrl',
95
-            valueType: 'text',
96
-            hideInSearch: true,
97
-            render: (_, record: any) => {
98
-                // console.log('record---',_,record)
99
-                return <Image src={record.imgUrl} style={{ 'height': '40px' }}></Image>;
100
-            }
101
-        },
102
-        {
103
-            title: '名称',
104
-            dataIndex: 'name',
105
-            valueType: 'text',
106
-        },
107
-        {
108
-            title: '地址',
109
-            dataIndex: 'addr',
110
-            valueType: 'text',
111
-        },
112
-        {
113
-            title: '电话/简述',
114
-            dataIndex: 'phone',
115
-            valueType: 'text',
116
-        },
117
-        {
118
-            title: '省',
119
-            dataIndex: 'province',
120
-            valueType: 'text',
121
-        },
122
-        {
123
-            title: '市',
124
-            dataIndex: 'city',
125
-            valueType: 'text',
126
-        },
127
-        {
128
-            title: '经度',
129
-            dataIndex: 'lon',
130
-            valueType: 'text',
131
-        },
132
-        {
133
-            title: '纬度',
134
-            dataIndex: 'lat',
135
-            valueType: 'text',
136
-        },
137
-        {
138
-            title: '状态',
139
-            dataIndex: 'use',
140
-            valueType: 'radio',
141
-            request: async () => useEnum,
142
-            render: (_, record) => {
143
-                return (<DictTag enums={useEnum} value={record.use} />);
144
-            },
145
-        },
146
-        {
147
-            title: '操作',
148
-            dataIndex: 'option',
149
-            width: '120px',
150
-            valueType: 'option',
151
-            render: (_, record: any) => [
152
-                <Button
153
-                    type="link"
154
-                    size="small"
155
-                    key="edit"
156
-
157
-                    onClick={() => {
158
-                        setModalVisible(true);
159
-                        setCurrentRow(record);
160
-                    }}
161
-                >
162
-                    编辑
163
-                </Button>,
164
-                //   <Button
165
-                //   type="link"
166
-                //   size="small"
167
-                //   key="preview"
168
-                //   onClick={() => {
169
-                //     window.open('/api/system/wysiwyg/MapDotDetail/'+record.uuid);
170
-
171
-                //   }}
172
-                // >
173
-                //   <FormattedMessage id="public.preview" defaultMessage="预览" />
174
-                // </Button>,
175
-                <Button
176
-                    type="link"
177
-                    size="small"
178
-                    key="publish"
179
-                    disabled={record.status == 0 ? false : true}
180
-                    onClick={() => {
181
-                        let params = {
182
-                            status: 1,
183
-                            MapDotUuid: record.uuid,
184
-                        }
185
-                        saveMapDot(params).then((res: any) => {
186
-                            if (res.code == 200) {
187
-                                if (actionRef.current) {
188
-                                    actionRef.current.reload();
189
-                                }
190
-                                message.success(res.msg)
191
-                            } else {
192
-                                message.error(res.msg)
193
-                            }
194
-                        })
195
-
196
-                    }}
197
-                >
198
-                    {record.status == 0 ? '禁用' : '启用'}
199
-                </Button>,
200
-                <Button
201
-                    type="link"
202
-                    size="small"
203
-                    danger
204
-                    key="batchRemove"
205
-
206
-                    onClick={async () => {
207
-                        Modal.confirm({
208
-                            title: intl.formatMessage({ id: 'public.delete' }),
209
-                            content: intl.formatMessage({ id: 'public.confirmdeletemsg' }),
210
-                            okText: intl.formatMessage({ id: 'public.confirm' }),
211
-                            cancelText: intl.formatMessage({ id: 'public.cancel' }),
212
-                            onOk: async () => {
213
-                                const success = await handleRemoveOne(record);
214
-                                if (success) {
215
-                                    if (actionRef.current) {
216
-                                        actionRef.current.reload();
217
-                                    }
218
-                                }
219
-                            },
220
-                        });
221
-                    }}
222
-                >
223
-                    <FormattedMessage id="public.delete" defaultMessage="删除" />
224
-                </Button>,
225
-            ],
226
-        },
227
-    ];
228
-
229
-    return (
230
-        <KeepAlive name='地图打点' path="/MapDot/MapDotList">
231
-            <PageContainer>
232
-                <div style={{ width: '100%', float: 'right' }}>
233
-                    <ProTable<API.System.Notice>
234
-                        actionRef={actionRef}
235
-                        formRef={formTableRef}
236
-                        rowKey="uuid"
237
-                        key="MapDotList"
238
-                        search={{
239
-                            labelWidth: 120,
240
-                        }}
241
-                        toolBarRender={() => [
242
-                            <Button
243
-                                type="primary"
244
-                                key="add"
245
-                                onClick={async () => {
246
-                                    setCurrentRow(undefined);
247
-                                    setModalVisible(true);
248
-                                }}
249
-                            >
250
-                                <PlusOutlined /> <FormattedMessage id="public.add" defaultMessage="新建" />
251
-                            </Button>
252
-                        ]}
253
-                        request={(params) => {
254
-                            return getMapDotList({ ...params } as API.System.NoticeListParams).then((res) => {
255
-
256
-                                res.rows.forEach((item: any, index: any) => {
257
-                                    item.rowIndex = index + 1
258
-                                })
259
-                                const result = {
260
-                                    data: res.rows,
261
-                                    total: res.total,
262
-                                    success: true,
263
-
264
-                                };
265
-                                return result;
266
-                            })
267
-                        }
268
-                        }
269
-                        columns={columns}
270
-                    />
271
-                </div>
272
-                <MapDotForm
273
-                    onSubmit={async (values) => {
274
-                        let success = false;
275
-                        if (currentRow) {
276
-                            values.uuid = currentRow.uuid;
277
-                        }
278
-                        
279
-                        success = await saveMapDot({ ...values });
280
-                        if (success) {
281
-                            setModalVisible(false);
282
-                            setCurrentRow(undefined);
283
-                            if (actionRef.current) {
284
-                                actionRef.current.reload();
285
-                            }
286
-                        }
287
-                    }}
288
-                    onCancel={() => {
289
-                        setModalVisible(false);
290
-                        setCurrentRow(undefined);
291
-                    }}
292
-                    currentRow={currentRow}
293
-                    open={modalVisible}
294
-                />
295
-            </PageContainer>
296
-        </KeepAlive>
297
-
298
-    );
299
-};
300
-
301
-export default NoticeTableList;

+ 4
- 3
src/pages/News/NewsList/edit.tsx Parādīt failu

@@ -2,6 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
2 2
 import {
3 3
   ProForm,
4 4
   ProFormText,
5
+  ProFormTextArea,
5 6
   ProFormUploadButton,
6 7
   ProFormSelect,
7 8
   ProFormDatePicker,
@@ -208,7 +209,7 @@ const NewsForm: React.FC<NewsProps> = (props) => {
208 209
     let content = editor.getContents()
209 210
     // console.log('htmlStr----', htmlStr)
210 211
     editor.setContents(content)
211
-    data.date = moment(data.date).format('YYYY.MM.DD');
212
+    data.date = moment(data.date).format('YYYY-MM-DD');
212 213
     if(checkTop){
213 214
       data.top = 1;
214 215
     }else{
@@ -322,7 +323,7 @@ const NewsForm: React.FC<NewsProps> = (props) => {
322 323
           name="date"
323 324
           label='日期'
324 325
           fieldProps={{
325
-            format: (value) => value.format('YYYY.MM.DD'),
326
+            format: (value) => value.format('YYYY-MM-DD'),
326 327
           }}
327 328
           labelCol={{
328 329
             style: { width: 95 }
@@ -358,7 +359,7 @@ const NewsForm: React.FC<NewsProps> = (props) => {
358 359
           placeholder={'请选择新闻分类'}
359 360
 
360 361
         />
361
-        <ProFormText
362
+        <ProFormTextArea
362 363
           name="digest"
363 364
           label='摘要'
364 365
           labelCol={{

+ 15
- 3
src/pages/News/NewsList/index.tsx Parādīt failu

@@ -6,7 +6,7 @@ import { Button, message, Modal, Image } from 'antd';
6 6
 import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
7 7
 import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
8 8
 // import { getNoticeList, removeNotice, addNotice, updateNotice, exportNotice } from '@/services/system/notice';
9
-import { getNewsList, saveNews, deleteNews, pushNewsDetail } from '@/services/news/news';
9
+import { getNewsList, saveNews, deleteNews, pushNewsDetail,push } from '@/services/news/news';
10 10
 import NewsForm from './edit';
11 11
 import { getDictValueEnum } from '@/services/system/dict';
12 12
 import moment from 'moment';
@@ -205,7 +205,19 @@ const NoticeTableList: React.FC = () => {
205 205
             ],
206 206
         },
207 207
     ];
208
-
208
+/**
209
+     * 一键发布
210
+     */
211
+const publishing = async () => {
212
+    try {
213
+        const resp = await push();
214
+        if (resp.code === 200) {
215
+            message.success('发布成功');
216
+        } else {
217
+            message.error(resp.msg);
218
+        }
219
+    } catch (error) { }
220
+}
209 221
     return (
210 222
         <KeepAlive name={intl.formatMessage({ id: 'new.newsManagement' })} path="/News/NewsList">
211 223
             <PageContainer>
@@ -232,7 +244,7 @@ const NoticeTableList: React.FC = () => {
232 244
                             <Button
233 245
                             type="primary"
234 246
                             key="fabu"
235
-                            onClick={()=>{}}
247
+                            onClick={publishing}
236 248
                         >
237 249
                             一键发布
238 250
                         </Button>,

+ 4
- 3
src/pages/PartyWork/partyWork/edit.tsx Parādīt failu

@@ -209,7 +209,7 @@ const PartyWorkForm: React.FC<PartyWorkProps> = (props) => {
209 209
     let content = editor.getContents()
210 210
     // console.log('htmlStr----', htmlStr)
211 211
     editor.setContents(content)
212
-    data.date = moment(data.date).format('YYYY.MM.DD');
212
+    data.date = moment(data.date).format('YYYY-MM-DD');
213 213
     if(checkTop){
214 214
       data.top = 1;
215 215
     }else{
@@ -264,7 +264,7 @@ const PartyWorkForm: React.FC<PartyWorkProps> = (props) => {
264 264
   return (
265 265
     <Drawer
266 266
       width={'80%'}
267
-      title={props.currentRow ? '新闻编辑' : '新建新闻'}
267
+      title={props.currentRow ? '文章编辑' : '新建文章'}
268 268
       forceRender
269 269
       open={props.open}
270 270
       destroyOnClose
@@ -323,7 +323,7 @@ const PartyWorkForm: React.FC<PartyWorkProps> = (props) => {
323 323
           name="date"
324 324
           label='展示日期'
325 325
           fieldProps={{
326
-            format: (value) => value.format('YYYY.MM.DD'),
326
+            format: (value) => value.format('YYYY-MM-DD'),
327 327
           }}
328 328
           labelCol={{
329 329
             style: { width: 95 }
@@ -376,6 +376,7 @@ const PartyWorkForm: React.FC<PartyWorkProps> = (props) => {
376 376
             style: { width: 95 }
377 377
           }}
378 378
           placeholder={'中泽集团'}
379
+          initialValue={'中泽集团'}
379 380
         />
380 381
 
381 382
         <ProForm.Item 

+ 23
- 3
src/pages/PartyWork/partyWork/index.tsx Parādīt failu

@@ -6,7 +6,7 @@ import { Button, message, Modal, Image } from 'antd';
6 6
 import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
7 7
 import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
8 8
 // import { getNoticeList, removeNotice, addNotice, updateNotice, exportNotice } from '@/services/system/notice';
9
-import { getPartyWorkList, savePartyWork, deletePartyWork, pushPartyWorkDetail } from '@/services/partyWork/partyWork';
9
+import { getPartyWorkList, savePartyWork, deletePartyWork, pushPartyWorkDetail,push1,push2 } from '@/services/partyWork/partyWork';
10 10
 import PartyWorkForm from './edit';
11 11
 import { getDictValueEnum } from '@/services/system/dict';
12 12
 import moment from 'moment';
@@ -205,7 +205,20 @@ const NoticeTableList: React.FC = () => {
205 205
             ],
206 206
         },
207 207
     ];
208
-
208
+/**
209
+     * 一键发布
210
+     */
211
+const publishing = async () => {
212
+    try {
213
+        const resp1 = await push1();
214
+        const resp2 = await push2();
215
+        if (resp1.code === 200 && resp2.code === 200) {
216
+            message.success('发布成功');
217
+        } else {
218
+            message.error(resp1.msg + resp2.msg);
219
+        }
220
+    } catch (error) { }
221
+}
209 222
     return (
210 223
         <KeepAlive name={'党建工作'} path="/PartyWork/partyWork">
211 224
             <PageContainer>
@@ -228,7 +241,14 @@ const NoticeTableList: React.FC = () => {
228 241
                                 }}
229 242
                             >
230 243
                                 <PlusOutlined /> <FormattedMessage id="public.add" defaultMessage="新建" />
231
-                            </Button>
244
+                            </Button>,
245
+                            <Button
246
+                            type="primary"
247
+                            key="fabu"
248
+                            onClick={publishing}
249
+                            >
250
+                                一键发布
251
+                            </Button>,
232 252
                         ]}
233 253
                         request={(params) => {
234 254
                             return getPartyWorkList({ ...params } as API.System.NoticeListParams).then((res) => {

+ 0
- 290
src/pages/Product/ProductManage/index.less Parādīt failu

@@ -1,290 +0,0 @@
1
-.productAll{
2
-    width: 100%;
3
-    height: 100%;
4
-    background-color: rgba(242, 242, 242, 1);
5
-    display: flex;
6
-    .leftDiv{
7
-        width: 220px;
8
-        height: 100%;
9
-        background: #fff;
10
-        box-sizing: border-box;
11
-        padding: 20px 10px;
12
-        .leftUp{
13
-            width: 100%;
14
-        }
15
-        .leftDw{
16
-            .ant-tree{
17
-                .ant-tree-list{
18
-                    .ant-tree-node-selected{
19
-                        pointer-events: none;
20
-                    }
21
-                }
22
-            }
23
-        }
24
-    }
25
-    .rightDiv{
26
-        width: calc( 100% - 220px);
27
-        height: 100%;
28
-        box-sizing: border-box;
29
-        background: rgba(242, 242, 242, 1);
30
-        position: relative;
31
-        .carTabs{
32
-            .ant-tabs-nav{
33
-                padding-left: 20px;background: #fff;
34
-            }
35
-        }
36
-        .carRight{
37
-            padding: 0px 20px;
38
-            margin-top: 10px;
39
-            .carTitle{
40
-                margin-bottom: 20px;
41
-                height: 28px;
42
-                line-height: 28px;
43
-            }
44
-            .btn{
45
-                margin-left: 10px;
46
-                width: 94px;
47
-                height: 30px;
48
-                background: rgba(22, 155, 213, 1);
49
-                box-shadow:none;
50
-                line-height: 28px;
51
-                padding:0px;
52
-                text-align: center;
53
-                float: right;
54
-            }
55
-            .ant-table-wrapper{
56
-                background: #fff;
57
-            }
58
-        }
59
-        
60
-        .tdkStyle{
61
-            position: absolute;
62
-            right: 21px;
63
-            top: 7px;
64
-        }
65
-    }
66
-
67
-}
68
-.carModal{
69
-    .ant-modal-header{
70
-        margin-bottom: 20px;
71
-        padding-bottom: 10px;
72
-        border-bottom: 1px solid #d6d6d6;
73
-    }
74
-    .showImg{
75
-        width: 110px;max-height:110px;float:left;
76
-        img{
77
-            width: 100%;max-height:110px;display:block;
78
-        }
79
-        video{
80
-            width: 100%;max-height:110px;display:block;
81
-        }
82
-        margin-right: 20px;
83
-    }
84
-    .showFile{
85
-        width: 28px;float:left;margin-right: 20px;
86
-        img{
87
-            width: 100%;display:block;
88
-        }
89
-    }
90
-    .uploadBtn{
91
-        float:left;margin-right:20px;
92
-        button{
93
-            width: 90px;height:30px;border-radius:5px;
94
-        }
95
-    }
96
-    .designImg{
97
-        width: 100%;
98
-        input{
99
-            width: 102px;
100
-            margin-block: 0 8px;
101
-            margin-inline: 0 8px;
102
-            vertical-align: top;
103
-        }
104
-    }
105
-    .ant-form-horizontal .ant-form-item-control{
106
-        max-width: calc(100% - 160px);
107
-    }
108
-    .designTable{
109
-        display: flex;
110
-        flex-wrap: wrap;
111
-        div{
112
-            width: 40%;
113
-            margin-right: 10px;
114
-            margin-bottom: 5px;
115
-            text-align: center;
116
-        }
117
-        input{
118
-            width: 40%;
119
-            margin-right: 10px;
120
-            margin-bottom: 5px;
121
-        }
122
-    }
123
-    .designTableA{
124
-        display: flex;
125
-        .txt{
126
-            width: calc( 20% - 30px);
127
-            color: rgba(0, 0, 0, 0.3);
128
-            font-size: 14px;
129
-            text-align: left;
130
-            box-sizing: border-box;
131
-            padding-top: 27px;
132
-            &>div{
133
-                height: 30px;
134
-                margin-bottom: 5px;
135
-                line-height: 30px;
136
-            }
137
-        }
138
-        
139
-    }
140
-    .pTextDeleTitle{
141
-        margin-bottom: 10px;
142
-        display: flex;
143
-        justify-content: space-between;
144
-        align-items: flex-end;
145
-        width: calc(100% - 60px);
146
-        span{
147
-            display: inline-block;
148
-            width:48%;
149
-            text-align: center;
150
-            margin-bottom: 5px;
151
-        }
152
-    }
153
-    .pTextDele{
154
-        margin-bottom: 10px;
155
-        display: flex;
156
-        justify-content: space-between;
157
-        align-items: flex-end;
158
-        input{
159
-            width: calc(100% - 60px);
160
-        }
161
-        &>div{
162
-            width: calc(100% - 60px);
163
-            display: flex;
164
-            flex-wrap: wrap;
165
-            justify-content: space-between;
166
-            
167
-            input{
168
-                width:48%;
169
-            }
170
-        }
171
-    }
172
-    .pTextThree{
173
-        &>div{
174
-            align-items: flex-end;
175
-            &>span{
176
-                width:110px;
177
-                .ant-upload-list-picture-card .ant-upload-select{
178
-                    margin-bottom: 0;
179
-                }
180
-            }
181
-            input{
182
-                width:calc((100% - 130px)/2);
183
-            }
184
-        }
185
-    }
186
-    .pTextTwo{
187
-        align-items: flex-start;
188
-        &>div{
189
-            align-items: flex-start;
190
-            &>span{
191
-                width:110px;
192
-                .ant-upload-list-picture-card .ant-upload-select{
193
-                    margin-bottom: 0;
194
-                }
195
-            }
196
-            
197
-            
198
-            .pConTit{
199
-                width: calc((100% - 130px));
200
-                input{
201
-                    width:100%;
202
-                }
203
-                .pTwoTxt{
204
-                    width: 100%;
205
-                    margin: 8px 0;
206
-                    span{
207
-                        width: calc((100% - 70px)/2);
208
-                        text-align: center;
209
-                        display: inline-block;
210
-                    }
211
-                }
212
-                .pCon{
213
-                    width:100%;
214
-                    margin-left: auto;
215
-                    margin-bottom: 5px;
216
-                    input{
217
-                        width: 204px;
218
-                        margin-right: 5px;
219
-                    }
220
-                }
221
-                .light1{
222
-                    width: 100%;
223
-                    display: flex;
224
-                    justify-content: space-between;
225
-                    margin-bottom: 8px;
226
-                    .titleA{
227
-                        width:calc(100% - 60px);
228
-                    }
229
-                }
230
-            }
231
-            .titleA{
232
-                width:calc(100% - 130px);
233
-            }
234
-            
235
-        }
236
-    }
237
-    .pTextOne{
238
-        &>div{
239
-            .pConTit .pTwoTxt span{
240
-                width: calc(100% - 70px);
241
-            }
242
-            .pConTit .pCon input{
243
-                width: 413px;
244
-            }
245
-        }
246
-    }
247
-    .pTextTitle{
248
-        width: calc(100% - 60px);
249
-        display: flex;
250
-        justify-content: space-between;
251
-        margin-bottom: 10px;
252
-        span{
253
-            display: inline-block;
254
-            text-align: center;
255
-            width: calc((100% - 130px)/2);
256
-            &:first-child{
257
-                width: 110px;
258
-            }
259
-        }
260
-    }
261
-    .titleTwo{
262
-        span{
263
-            width: calc(100% - 110px);
264
-        }
265
-    }
266
-    .imgColor{
267
-        width: 100%;
268
-        border: 1px solid rgb(228, 232, 239);
269
-        padding:10px 0 0;
270
-        margin-bottom: 10px;
271
-        border-left: 0;
272
-        .colorTxt{
273
-            width: 100%;
274
-            height: 32px;
275
-            line-height: 32px;
276
-            margin-bottom: 5px;
277
-            &>button{
278
-                float: right;
279
-            }
280
-            &>span{
281
-                display: inline-block;
282
-                position: relative;
283
-                top: -7px;
284
-                margin-left: 10px;
285
-                color: rgba(0, 0, 0, 0.3);
286
-            }
287
-        }
288
-        
289
-    }
290
-}

+ 0
- 261
src/pages/Product/ProductManage/index.tsx Parādīt failu

@@ -1,261 +0,0 @@
1
-import React,{Ref,useEffect,useState,useRef } from 'react';
2
-import { KeepAlive, useAccess } from '@umijs/max';
3
-import { PlusOutlined,EditOutlined,DeleteOutlined,DownOutlined,ExclamationCircleFilled } from '@ant-design/icons';
4
-import {Button,Tree,Tabs,Modal,Form, Input, message  } from 'antd'
5
-import type { TreeDataNode,TreeProps,TabsProps } from 'antd';
6
-import { getProductTree,editProductTree,getDeleteTree } from '@/services/product/index.ts';
7
-import CarSeriesTable  from './page/carSeries';  //车系列表
8
-import CarModelsTable  from './page/carModels';  //车型列表
9
-import CarModelsDetailTable  from './page/carModelsDetail';  //车型详情
10
-import CarBrandDetailTable  from './page/carBrandDetail';  //车型详情
11
-import TestimonyTable  from './page/TestimonyDetail';  //品牌概览-用户证词
12
-import CarouselImage from './page/carouselImage';  //轮播图
13
-import { FormattedMessage,useIntl } from 'umi';
14
-import TdkEdit from '@/components/TdkEdit';
15
-
16
-
17
-import './index.less';
18
-
19
-const { confirm } = Modal;
20
-
21
-const Home: React.FC = () => {
22
-  //tdk弹框
23
-  const [isModalOpenTdk, setIsModalOpenTdk] = useState(false);
24
-
25
-//编辑tdk
26
-  const changeTdk=()=>{
27
-    setIsModalOpenTdk(true)
28
-  }
29
-  const intl = useIntl();
30
-
31
-  const [treeData,setTreeData] = useState([]);  //树形列表
32
-  const [productId,setProductId] = useState('');  //产品id
33
-  const [productLevel,setProductLevel] = useState('catege');  //产品层级
34
-  const [productLevelDefault,setProductLevelDefault] = useState<any>([]);  //默认展示产品层级
35
-  //弹框
36
-  const [isModalOpen, setIsModalOpen] = useState(false);
37
-  const [modalTitle, setModalTitle] = useState(true);
38
-  const [form] = Form.useForm();
39
-  const [oneTreeId,setOneTreeId] = useState('');  //左侧第一级品牌id
40
-  const [selectedInfo,setSelectedInfo] = useState<any>([]);
41
-
42
-  //加载数据
43
-  const getTreeData =async () => {
44
-    const res = await getProductTree();
45
-    if(res?.code == 200 &&res?.data &&res?.data.length>0){
46
-      let data = res.data;
47
-      if(productLevelDefault.length==0){
48
-        setProductLevelDefault([data[0].uuid]);
49
-        setProductId(data[0].uuid);
50
-        setOneTreeId(data[0].uuid);
51
-      }
52
-      setTreeData(data);
53
-      
54
-    }
55
-  }
56
-  const items: TabsProps['items'] = [
57
-    {
58
-      key: '1',
59
-      label: intl.formatMessage({id:'product.carlist'}) ,
60
-      children: <CarSeriesTable id={productId} upTree={getTreeData} />,
61
-    },
62
-    {
63
-      key: '2',
64
-      label: intl.formatMessage({id:'public.performanceIntroduction'}) ,
65
-      children: <CarBrandDetailTable id={productId} upTree={getTreeData}/>,
66
-    },
67
-    {
68
-      key: '3',
69
-      label: '轮播图' ,
70
-      children: <CarouselImage id={productId} upTree={getTreeData}/>,
71
-    },
72
-  ];
73
-  const items2: TabsProps['items'] = [
74
-    {
75
-      key: '1',
76
-      label: intl.formatMessage({id:'public.carTypeList'}) ,
77
-      children: <CarModelsTable id={productId} upTree={getTreeData} treeDataAll={treeData}/>,
78
-    }
79
-  ];
80
-  const items3: TabsProps['items'] = [
81
-    {
82
-      key: '1',
83
-      label: intl.formatMessage({id:'public.carTypeDetail'}) ,
84
-      children: <CarModelsDetailTable id={productId} upTree={getTreeData}/>,
85
-    },
86
-    // {
87
-    //   key: '2',
88
-    //   label: '车型参数',
89
-    //   children: 'Content of Tab Pane 2',
90
-    // }
91
-  ];
92
-  
93
-  //左侧车系选中事件
94
-  const onSelect: TreeProps['onSelect'] = (selectedKeys:any, info:any) => {
95
-    console.log(selectedKeys,info)
96
-    setProductId(selectedKeys[0]);
97
-    setSelectedInfo(info.node)
98
-    setProductLevelDefault(selectedKeys);
99
-    setProductLevel(info.node.carType);
100
-
101
-  };
102
-  //右侧内容选择事件
103
-  const onChange = (key: string) => {
104
-    console.log(key);
105
-  };
106
-
107
-  
108
-  //打开弹框新增品牌
109
-  const addTree=()=>{
110
-    form.setFieldsValue({
111
-      sort: undefined,
112
-      title:undefined,
113
-    });
114
-    setIsModalOpen(true);
115
-    setModalTitle(true);
116
-  }
117
-  //编辑品牌
118
-  const openTreeEdit=()=>{
119
-    
120
-      setIsModalOpen(true);
121
-      setModalTitle(false);
122
-      // let nowTreeId:any = treeData.filter((item:any)=> item.uuid == oneTreeId);
123
-
124
-      form.setFieldsValue({
125
-        sort: selectedInfo.sort,
126
-        title:selectedInfo.title,
127
-      });
128
-  }
129
-  //删除品牌
130
-  const showDeleteConfirm = () => {
131
-    let nowTreeId:any = treeData.filter((item:any)=> item.uuid == oneTreeId);
132
-    if(!selectedInfo) return;
133
-    confirm({
134
-      title: intl.formatMessage({id:'product.ifConfirmDeleteMsg'}) +"?",
135
-      icon: <ExclamationCircleFilled />,
136
-      content: intl.formatMessage({id:'product.brandName'})+":" +nowTreeId[0].title,
137
-      okText: intl.formatMessage({id:'public.confirm'}) ,
138
-      okType: 'danger',
139
-      cancelText: intl.formatMessage({id:'public.cancel'}) ,
140
-      async onOk() {
141
-        let res:any=await getDeleteTree(selectedInfo.uuid);
142
-        if(res.code==200){
143
-          message.success(res.msg);
144
-          getTreeData();
145
-        }else{
146
-          message.error(res.msg)
147
-        }
148
-      },
149
-      onCancel() {
150
-        console.log('Cancel');
151
-      },
152
-    });
153
-  };
154
-  const handleOk = () => {
155
-    form.submit();
156
-  };
157
-
158
-  const handleCancel = () => {
159
-    setIsModalOpen(false);
160
-  };
161
-  //表单数据保存
162
-  const formSend = ()=>{
163
-    form.validateFields();
164
-    
165
-    let dataNow=form.getFieldsValue();
166
-    
167
-    if(modalTitle){
168
-      dataNow={
169
-        ...dataNow,
170
-        carType:"catege"
171
-      }
172
-    }else{
173
-      dataNow={
174
-        ...dataNow,
175
-        uuid:oneTreeId
176
-      }
177
-    }
178
-    console.log('dataNow===',dataNow)
179
-    console.log('productLevel===',productLevel)
180
-    dataNow.fatherId = selectedInfo.fatherId;
181
-    editProductTree(dataNow).then((res:any)=>{
182
-      console.log("res",res);
183
-      if(res.code == 200){
184
-        message.success(res.msg);
185
-        getTreeData();
186
-        setIsModalOpen(false);
187
-      }else{
188
-        message.error(res.msg);
189
-      }
190
-    });
191
-    
192
-  }
193
-
194
-  useEffect(() => {
195
-    getTreeData();
196
-    // setProductId(treeData[0].key);
197
-    // setProductLevelDefault([treeData[0].key]);
198
-    // console.log([treeData[0].key],'[treeData[0].key]');
199
-    
200
-    
201
-  }, []);
202
-
203
-  return (
204
-    <KeepAlive name={intl.formatMessage({id:'product.productManage'})} path="/Product/ProductManage">
205
-      <div className='productAll'>
206
-        <div className='leftDiv'>
207
-          <div className='leftUp'>
208
-            <Button type="link" icon={<PlusOutlined />} onClick={addTree} />
209
-            <Button type="link" icon={<EditOutlined />} onClick={openTreeEdit}/>
210
-            <Button type="link" icon={<DeleteOutlined />} onClick={showDeleteConfirm} />
211
-          </div>
212
-          <div className='leftDw'>
213
-          {treeData.length>0&&<Tree
214
-            selectedKeys={productLevelDefault}
215
-            autoExpandParent
216
-            fieldNames={{key:'uuid'}}
217
-            onSelect={onSelect}
218
-            treeData={treeData}
219
-          />}
220
-          </div>
221
-        </div>
222
-        <div className='rightDiv'>
223
-          {/* <FormattedMessage id="navBar.lang" /> */}
224
-          { productLevel=='catege' && <Tabs className='carTabs' defaultActiveKey="1" items={items} onChange={onChange} />}
225
-          {/* { productLevel=='series' && <Tabs className='carTabs' defaultActiveKey="1" items={items2} onChange={onChange} />}
226
-          { productLevel=='model' && <Tabs className='carTabs' defaultActiveKey="1" items={items3} onChange={onChange} />}
227
-          { productLevel=='catege' && <div className='tdkStyle'><Button type="primary" onClick={changeTdk}><FormattedMessage id="public.tdk" /></Button></div>} */}
228
-        </div>
229
-        <Modal title={modalTitle?intl.formatMessage({id:'product.newBrandInfo'}) :intl.formatMessage({id:'product.editBrandInfo'}) } open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
230
-        <Form
231
-            form={form}
232
-            labelCol={{ flex: '70px' }}
233
-            labelAlign="left"
234
-            labelWrap
235
-            wrapperCol={{ flex: 1 }}
236
-            colon={false}
237
-            style={{ maxWidth: 680 }}
238
-            onFinish={formSend}
239
-          >
240
-            <Form.Item
241
-              label={intl.formatMessage({id:'public.name'}) }
242
-              name="title"
243
-              rules={[{ required: true }]}
244
-            >
245
-              <Input />
246
-            </Form.Item>
247
-            <Form.Item
248
-              label={intl.formatMessage({id:'public.sort'})}
249
-              name="sort"
250
-            >
251
-              <Input />
252
-            </Form.Item>
253
-          </Form>
254
-        </Modal>
255
-      </div>
256
-      <TdkEdit isModalOpenTdk={isModalOpenTdk} htmlName={'products'} setIsModalOpenTdk={setIsModalOpenTdk}/>
257
-    </KeepAlive>
258
-  );
259
-};
260
-
261
-export default Home;

+ 0
- 274
src/pages/Product/ProductManage/page/TestimonyDetail.tsx Parādīt failu

@@ -1,274 +0,0 @@
1
-import React,{Ref,useEffect,useState,useRef } from 'react';
2
-import {Button,Tree,Tabs,Table,Modal,Space,Form, Input,TreeSelect,Select,Upload, message,Radio,ColorPicker,Image,Popconfirm } from 'antd'
3
-import { PlusOutlined,DeleteOutlined } from '@ant-design/icons';
4
-import { upload } from '@/services/news/news';
5
-import { getTestimonyList,editTestimony,TestimonyDelete,pushProductsBrand } from '@/services/product';
6
-import '../index.less';
7
-import { FormattedMessage,useIntl } from 'umi';
8
-
9
-const { TextArea } = Input;
10
-
11
-const TestimonyTable: React.FC<{id:any,upTree:any}> = (prop:any) => {
12
-  let intl = useIntl()
13
-  const [listData, setListData] = useState([]);  //列表数据
14
-
15
-  const [isModalOpen, setIsModalOpen] = useState(false);  //弹框
16
-  const [modalTitle, setModalTitle] = useState(true);  //弹框标题
17
-  const [form] = Form.useForm();
18
-
19
-  const [imgPc, setImgPc] = useState({id:undefined,url:''});   //pc图片
20
-  const [imgM, setImgM] = useState({id:undefined,url:''});   //移动端图片
21
-
22
-  //弹框确定
23
-  const handleOk = () => {
24
-    form.submit();
25
-  };
26
-  //弹框取消
27
-  const handleCancel = () => {
28
-    setIsModalOpen(false);
29
-  };
30
-  //删除数据
31
-  const deleteCar = async (e:any) => {
32
-    console.log('删除:',e);
33
-    let res:any=await TestimonyDelete(e.uuid);
34
-        if(res.code==200){
35
-          getListData();
36
-          message.success(res.msg);
37
-        }else{
38
-          message.error(res.msg)
39
-        }
40
-  };
41
-  //修改数据
42
-  const revise = (e:any) => {
43
-    console.log('修改',e);
44
-    form.setFieldsValue({ 
45
-      userName: e?.userName,
46
-      job: e?.job,
47
-      brandTestimony: e?.brandTestimony,
48
-      sort:e?.sort,
49
-      uuid:e?.uuid,
50
-    });
51
-    setImgPc({id:e?.pcImg,url:e?.pcImgUrl});
52
-    setIsModalOpen(true);
53
-    setModalTitle(false);
54
-  };
55
-  //新增
56
-  const addDom = ()=>{
57
-    form.resetFields();
58
-    form.setFieldsValue({
59
-      userName: undefined,
60
-      job:undefined,
61
-      brandTestimony:undefined,
62
-      sort:undefined,
63
-      uuid:undefined,
64
-    });
65
-    setImgPc({id:undefined,url:''});
66
-    setIsModalOpen(true);
67
-    setModalTitle(true);
68
-  }
69
-  //表单数据保存
70
-  const formSend = ()=>{
71
-    form.validateFields();
72
-    
73
-    
74
-    let dataNow=form.getFieldsValue();
75
-    dataNow={
76
-      ...dataNow,
77
-      menuUuid:prop.id,
78
-      pcImg:imgPc.id?imgPc.id:'',
79
-    }
80
-    
81
-    console.log(dataNow,'dataNowModel');
82
-    
83
-    editTestimony(dataNow).then((res:any)=>{
84
-      if(res.code == 200){
85
-        getListData();
86
-        setIsModalOpen(false);
87
-        message.success(res.msg);
88
-      }else{
89
-        message.error(res.msg);
90
-      }
91
-    });
92
-  }
93
-  
94
-  //图片上传
95
-  const handleBeforeUpload = async (file: any,type:any) => {
96
-    console.log(file,'file');
97
-    
98
-    const formData = new FormData();
99
-    formData.append('file', file, file.name);
100
-    const res = await upload(formData);
101
-    if (res?.data?.uuid) {
102
-      if(type == 'pc'){
103
-        setImgPc({id:res.data.uuid,url:res.data.url})
104
-      }
105
-      else{
106
-        setImgM({id:res.data.uuid,url:res.data.url})
107
-      }
108
-      
109
-    }
110
-    return false;
111
-  };
112
-  //图片删除
113
-  const imgDele = (value: string) => {
114
-    if(value == 'pc'){
115
-      setImgPc({id:undefined,url:''})
116
-    }else{
117
-      setImgM({id:undefined,url:''})
118
-    }
119
-  };
120
-  
121
-  //表格列设置
122
-  const columns: any = [
123
-    {
124
-      title: intl.formatMessage({id:'public.username'}),
125
-      dataIndex: 'userName',
126
-      key: 'userName',
127
-      width:200,
128
-    },
129
-    {
130
-      title: intl.formatMessage({id:'public.job'}),
131
-      dataIndex: 'job',
132
-      key: 'job',
133
-      align: 'center',
134
-      width:100,
135
-    },
136
-    {
137
-      title: intl.formatMessage({id:'public.testimony'}),
138
-      dataIndex: 'brandTestimony',
139
-      key: 'brandTestimony',
140
-      align: 'center',
141
-      width:400,
142
-    },
143
-    {
144
-      title: intl.formatMessage({id:'public.avator'}),
145
-      dataIndex: 'pcImg',
146
-      key: 'pcImg',
147
-      align: 'center',
148
-      width:150,
149
-      render: (text:any,record:any) => <img src={record?.pcImgUrl} style={{ height:'110px'}}/>,
150
-    },
151
-    {
152
-      title: intl.formatMessage({id:'public.sort'}),
153
-      dataIndex: 'sort',
154
-      key: 'sort',
155
-      align: 'center',
156
-      width:100,
157
-    },
158
-    {
159
-      title: intl.formatMessage({id:'public.action'}),
160
-      dataIndex: '',
161
-      align: 'center',
162
-      width:160,
163
-      render: (text:any,record:any) => {
164
-        return <Space size="middle"><Button type='text' onClick={()=>revise(record)}>修改</Button><Button type='text' onClick={()=>deleteCar(record)}>删除</Button></Space>
165
-      },
166
-    },
167
-  ];
168
-  //获取列表数据
169
-  const getListData:any =()=>{
170
-    if(prop.id=='')return;
171
-    getTestimonyList(prop.id).then((res)=>{
172
-      if(res.code==200){
173
-        if(res.rows.length>0){
174
-          setListData(res.rows);
175
-        }else{
176
-          setListData([]);
177
-        }
178
-      }else{
179
-        message.error(res.msg);
180
-      }
181
-    })
182
-  }
183
-  useEffect(() => {
184
-    getListData();
185
-    
186
-  }, [prop.id]);
187
-  
188
-    //发布静态化
189
-  const pushStatusPage:any =()=>{
190
-    if(prop.id==''){
191
-      message.error('没有id');
192
-      return;
193
-    }
194
-    pushProductsBrand(prop.id).then((res:any)=>{
195
-      if(res.code==200){
196
-        message.success(res.msg)
197
-      }else{
198
-        message.error(res.msg);
199
-      }
200
-    })
201
-  }
202
-    
203
-
204
-
205
-const uploadButton = (
206
-  <button style={{ border: 0, background: 'none' }} type="button">
207
-    <PlusOutlined />
208
-    <div style={{ marginTop: 8 }}>Upload</div>
209
-  </button>
210
-);
211
-
212
-  return (
213
-      <div className='carRight'>
214
-        <div className='carTitle'>
215
-          {intl.formatMessage({id:'public.usertestimony'})}
216
-          <Popconfirm title="是否确定发布?" onConfirm={pushStatusPage}>
217
-                <Button className='btn' type="primary">{intl.formatMessage({id:'public.publishAll'})}</Button>
218
-          </Popconfirm>
219
-          <Button className='btn' type="primary" onClick={addDom}>{intl.formatMessage({id:'public.add'})}</Button>
220
-        </div>
221
-        <Table
222
-          columns={columns}
223
-          dataSource={listData}
224
-          rowKey={(record:any)=>record?.uuid}
225
-        />
226
-        <Modal title={modalTitle?intl.formatMessage({id:'public.newModal'}):intl.formatMessage({id:'public.updateModal'})} className='carModal' open={isModalOpen} onOk={handleOk} onCancel={handleCancel} width={880}>
227
-        <Form
228
-            form={form}
229
-            labelCol={{ flex: '160px' }}
230
-            labelAlign="left"
231
-            labelWrap
232
-            wrapperCol={{ flex: 1 }}
233
-            colon={false}
234
-            style={{ maxWidth: 880 }}
235
-            onFinish={formSend}
236
-          >
237
-            <Form.Item label="uuid" name="uuid" hidden>
238
-              <Input />
239
-            </Form.Item>
240
-            <Form.Item label={intl.formatMessage({id:'public.username'})} name="userName">
241
-                <Input />
242
-            </Form.Item>
243
-            <Form.Item label={intl.formatMessage({id:'public.job'})} name="job">
244
-                <Input />
245
-            </Form.Item>
246
-            <Form.Item label={intl.formatMessage({id:'public.sort'})} name="sort">
247
-                <Input />
248
-            </Form.Item>
249
-            <Form.Item label={intl.formatMessage({id:'public.testimony'})} name="brandTestimony">
250
-              <TextArea rows={4} />
251
-            </Form.Item>
252
-            <Form.Item label={intl.formatMessage({id:'public.avator'})}  extra={intl.formatMessage({id:'public.pictureSize'})+":340*340"}>
253
-                  {(imgPc&&imgPc?.id) && <div className='showImg'><img src={imgPc.url} /></div>}
254
-                  <div className='uploadBtn'>
255
-                      <Upload
256
-                          beforeUpload={(e)=>handleBeforeUpload(e,'pc')}
257
-                          maxCount={1}
258
-                          showUploadList={false}
259
-                          accept={'.png, .jpg, .gif'}
260
-                        >
261
-                          <Button>{intl.formatMessage({id:'public.upload'})}</Button>
262
-                      </Upload>
263
-                  </div>
264
-                  <div className='uploadBtn'><Button onClick={()=>{imgDele('pc')}} >{intl.formatMessage({id:'public.delete'})}</Button></div>
265
-              </Form.Item>
266
-          </Form>
267
-          
268
-        </Modal>
269
-
270
-      </div>
271
-  );
272
-};
273
-
274
-export default TestimonyTable;

+ 0
- 283
src/pages/Product/ProductManage/page/carBrandDetail.tsx Parādīt failu

@@ -1,283 +0,0 @@
1
-import React, { Ref, useEffect, useState, useRef } from 'react';
2
-import { Button, Tree, Tabs, Table, Modal, Space, Form, Input, TreeSelect, Select, Upload, message, Radio, ColorPicker, Image, Popconfirm, UploadFile, UploadProps, GetProp } from 'antd'
3
-import { PlusOutlined, DeleteOutlined } from '@ant-design/icons';
4
-import { upload } from '@/services/news/news';
5
-import { getCarBrandDetialList, editCarBrandDetail, carBrandDetailDelete, pushProductsBrand,getDeleteDetailPerform,getDetailPerformSave,getDetailPerformDetail } from '@/services/product';
6
-import { FormattedMessage, useIntl } from 'umi';
7
-import '../index.less';
8
-import modelBanner from '/public/image/model_banner.jpg';
9
-import brandLight1 from '/public/image/brand_light1.jpg';
10
-import brandLight2 from '/public/image/brand_light2.jpg';
11
-import brandLight3 from '/public/image/brand_light3.jpg';
12
-
13
-const { Option } = Select;
14
-const { TextArea } = Input;
15
-const modleImg: any = {
16
-    'banner': modelBanner,
17
-    'brandLight1': brandLight1,
18
-    'brandLight2': brandLight2,
19
-    'brandLight3': brandLight3,
20
-}
21
-
22
-type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
23
-const getBase64 = (file: FileType): Promise<string> =>
24
-    new Promise((resolve, reject) => {
25
-        const reader = new FileReader();
26
-        reader.readAsDataURL(file);
27
-        reader.onload = () => resolve(reader.result as string);
28
-        reader.onerror = (error) => reject(error);
29
-    });
30
-const CarBrandDetailTable: React.FC<{ id: any, upTree: any }> = (prop: any) => {
31
-
32
-    const intl = useIntl()
33
-    const modleList = [
34
-        { value: 'banner', label: intl.formatMessage({ id: 'public.focusImg' }) },  //最上面banner图
35
-        { value: 'brandLight1', label: intl.formatMessage({ id: 'public.light1' }) },    //车轮播显示
36
-        { value: 'brandLight2', label: intl.formatMessage({ id: 'public.light2' }) }, //左标题描述配置,右图
37
-        { value: 'brandLight3', label: intl.formatMessage({ id: 'public.light3' }) }, //模块四  上图标题描述,下左轮播4图右标题描述
38
-    ]
39
-    const imgVideo = [
40
-        [{
41
-            label: intl.formatMessage({ id: 'public.img' }) + '(PC)',
42
-            extra: intl.formatMessage({ id: 'public.pictureSize' }) + ':1920*1080',
43
-            accept: '.png, .jpg, .gif'
44
-        }, {
45
-            label: intl.formatMessage({ id: 'public.img' }) + "(Mob)",
46
-            extra: intl.formatMessage({ id: 'public.pictureSize' }) + ':750*1624',
47
-            accept: '.png, .jpg, .gif'
48
-        }],
49
-        [{
50
-            label: intl.formatMessage({ id: 'public.video' }) + '(PC)',
51
-            extra: intl.formatMessage({ id: 'public.videoSize' }) + ':1920*1080',
52
-            accept: '.mp4'
53
-        }, {
54
-            label: intl.formatMessage({ id: 'public.video' }) + '(Mob)',
55
-            extra: intl.formatMessage({ id: 'public.videoSize' }) + ':750*1624',
56
-            accept: '.mp4'
57
-        }]
58
-    ];
59
-
60
-    const [listData, setListData] = useState([]);  //列表数据
61
-
62
-    const [isModalOpen, setIsModalOpen] = useState(false);  //弹框
63
-    const [modalTitle, setModalTitle] = useState(true);  //弹框标题
64
-    const [form] = Form.useForm();
65
-    const [formModel] = Form.useForm();
66
-    // const [nodes, setNodes] = useState<string>();
67
-
68
-    const [modelType, setModelType] = useState('');  //模块类型,是什么模块
69
-
70
-    const [imgPc, setImgPc] = useState({ id: undefined, url: '' });   //pc图片
71
-    const [imgM, setImgM] = useState({ id: undefined, url: '' });   //移动端图片
72
-
73
-
74
-
75
-    //弹框确定
76
-    const handleOk = () => {
77
-        form.submit();
78
-    };
79
-    //弹框取消
80
-    const handleCancel = () => {
81
-        setIsModalOpen(false);
82
-    };
83
-    //删除数据
84
-    const deleteCar = async (e: any) => {
85
-        console.log('删除:', e);
86
-        let res: any = await getDeleteDetailPerform(e.uuid);
87
-        if (res.code == 200) {
88
-            getListData();
89
-            message.success(res.msg);
90
-        } else {
91
-            message.error(res.msg)
92
-        }
93
-    };
94
-    //修改数据
95
-    const revise = (e: any) => {
96
-        console.log('修改', e);
97
-        form.setFieldsValue({
98
-            title: e?.title,
99
-            content: e?.content,
100
-            sort: e?.sort,
101
-            uuid: e?.uuid,
102
-        });
103
-        setImgPc({id:e.img,url:e.imgUrl})        // setNodes(e?.nodes);
104
-
105
-        setIsModalOpen(true);
106
-        setModalTitle(false);
107
-    };
108
-    //新增
109
-    const addDom = () => {
110
-        form.resetFields();
111
-        form.setFieldsValue({
112
-            column: undefined,
113
-            columnName: undefined,
114
-            sort: undefined,
115
-            uuid: undefined,
116
-        });
117
-        setImgPc({ id: undefined, url: '' });
118
-        setModelType('');
119
-        // setNodes(undefined);
120
-        setIsModalOpen(true);
121
-        setModalTitle(true);
122
-    }
123
-
124
-    //表单数据保存
125
-    const formSend = () => {
126
-        form.validateFields();
127
-
128
-        let dataNow = form.getFieldsValue();
129
-       
130
-        dataNow = {
131
-            ...dataNow,
132
-            img: imgPc?.id ? imgPc.id : undefined,
133
-            productMenuUuid: prop.id,
134
-        }
135
-
136
-        getDetailPerformSave(dataNow).then((res: any) => {
137
-            if (res.code == 200) {
138
-                getListData();
139
-                setIsModalOpen(false);
140
-                message.success(res.msg);
141
-            } else {
142
-                message.error(res.msg);
143
-            }
144
-        });
145
-    }
146
-
147
-    //图片上传
148
-    const handleBeforeUpload = async (file: any) => {
149
-        console.log(file, 'file');
150
-
151
-        const formData = new FormData();
152
-        formData.append('file', file, file.name);
153
-        const res = await upload(formData);
154
-        if (res?.data?.uuid) {
155
-            setImgPc({ id: res.data.uuid, url: res.data.url })
156
-
157
-        }
158
-        return false;
159
-    };
160
-    //图片删除
161
-    const imgDele = () => {
162
-        setImgPc({ id: undefined, url: '' })
163
-    };
164
-
165
-    //表格列设置
166
-    const columns: any = [
167
-        {
168
-            title: intl.formatMessage({ id: 'public.title' }),
169
-            dataIndex: 'title',
170
-            key: 'title',
171
-        },
172
-        {
173
-            title: intl.formatMessage({ id: 'public.desctiption' }),
174
-            dataIndex: 'content',
175
-            key: 'content',
176
-        },
177
-        
178
-        {
179
-            title: '图片',
180
-            dataIndex: 'imgUrl',
181
-            key: 'imgUrl',
182
-            render:(_,record)=>{
183
-                return <Image src={record.imgUrl} />
184
-            }
185
-        },
186
-       
187
-
188
-        {
189
-            title: intl.formatMessage({ id: 'public.action' }),
190
-            dataIndex: '',
191
-            align: 'center',
192
-            width: 160,
193
-            render: (text: any, record: any) => {
194
-                return <Space size="middle">
195
-                    <Button type='text' onClick={() => revise(record)}>{intl.formatMessage({ id: 'public.update' })}</Button>
196
-                    <Popconfirm title={intl.formatMessage({ id: 'public.ifconfirmdelete' })} onConfirm={() => deleteCar(record)}>
197
-                        <Button danger type='text'>{intl.formatMessage({ id: 'public.delete' })}</Button>
198
-                    </Popconfirm>
199
-
200
-                </Space>
201
-            },
202
-        },
203
-    ];
204
-    //获取列表数据
205
-    const getListData: any = () => {
206
-        if (prop.id == '') return;
207
-        getDetailPerformDetail(prop.id).then((res) => {
208
-            if (res.code == 200) {
209
-                if (res.rows.length > 0) {
210
-                    setListData(res.rows);
211
-                } else {
212
-                    setListData([]);
213
-                }
214
-            } else {
215
-                message.error(res.msg);
216
-            }
217
-        })
218
-    }
219
-    useEffect(() => {
220
-        getListData();
221
-
222
-    }, [prop.id]);
223
-
224
-
225
-    return (
226
-        <div className='carRight'>
227
-            <div className='carTitle'>
228
-                {'性能介绍'}
229
-                {/* <Popconfirm title={intl.formatMessage({id:'public.ifConfirmPublish'})} onConfirm={pushStatusPage}>
230
-                <Button className='btn' type="primary">{intl.formatMessage({id:'public.publishAll'})}</Button>
231
-          </Popconfirm> */}
232
-                {/* <Button className='btn' type="primary" onClick={previewPage}>{intl.formatMessage({id:'public.preview'})}</Button> */}
233
-                <Button className='btn' type="primary" onClick={addDom}>{intl.formatMessage({ id: 'public.add' })}</Button>
234
-            </div>
235
-            <Table
236
-                columns={columns}
237
-                dataSource={listData}
238
-                rowKey={(record: any) => record?.uuid}
239
-            />
240
-            <Modal title={modalTitle ? intl.formatMessage({ id: 'public.addIntroduce' }) : intl.formatMessage({ id: 'public.editIntroduce' })} className='carModal' open={isModalOpen} onOk={handleOk} onCancel={handleCancel} width={880}>
241
-                <Form
242
-                    form={form}
243
-                    labelCol={{ flex: '160px' }}
244
-                    labelAlign="left"
245
-                    labelWrap
246
-                    wrapperCol={{ flex: 1 }}
247
-                    colon={false}
248
-                    style={{ maxWidth: 880 }}
249
-                    onFinish={formSend}
250
-                >
251
-                    <Form.Item label="uuid" name="uuid" hidden>
252
-                        <Input />
253
-                    </Form.Item>
254
-                    <Form.Item label={intl.formatMessage({ id: 'public.title' })} rules={[{ required: true }]} name="title" >
255
-                        <Input />
256
-                    </Form.Item>
257
-                    <Form.Item label={intl.formatMessage({ id: 'public.description' })} rules={[{ required: true }]} name="content">
258
-                        <TextArea rows={4} />
259
-                    </Form.Item>
260
-                    <Form.Item label={'banner'}  >
261
-                        {imgPc.id && <div className='showImg'><img src={imgPc.url} /></div>}
262
-                        <div className='uploadBtn'>
263
-                            <Upload
264
-                                beforeUpload={(e) => handleBeforeUpload(e)}
265
-                                maxCount={1}
266
-                                accept={'.png, .jpg, .gif'}
267
-                            >
268
-                                <Button>{intl.formatMessage({ id: 'public.upload' })}</Button>
269
-                            </Upload>
270
-                        </div>
271
-                        <div className='uploadBtn'><Button onClick={()=>{imgDele()}} >{intl.formatMessage({id:'public.delete'})}</Button></div>
272
-                    </Form.Item>
273
-                    <Form.Item label={'排序'} name="sort">
274
-                        <Input />
275
-                    </Form.Item>
276
-                </Form>
277
-            </Modal>
278
-
279
-        </div>
280
-    );
281
-};
282
-
283
-export default CarBrandDetailTable;

+ 0
- 354
src/pages/Product/ProductManage/page/carModels.tsx Parādīt failu

@@ -1,354 +0,0 @@
1
-import React,{Ref,useEffect,useState,useRef } from 'react';
2
-import {Button,Tree,Tabs,Table,Modal,Space,Form, Input,TreeSelect,Select,Upload, message,Popconfirm,Tooltip   } from 'antd'
3
-import { PlusOutlined,LoadingOutlined,InfoCircleOutlined } from '@ant-design/icons';
4
-import { upload } from '@/services/news/news';
5
-import { FormattedMessage,useIntl } from 'umi';
6
-import { getCarList,editProductTree,getDeleteTree,pushProducts, } from '@/services/product';
7
-import '../index.less';
8
-import { trim } from 'lodash';
9
-
10
-const { Option } = Select;
11
-const { TextArea } = Input;
12
-
13
-const CarModelsTable: React.FC<{id:any,upTree:any,treeDataAll:any}> = (prop:any) => {
14
-  let intl = useIntl()
15
-  const [listData, setListData] = useState([]);  //列表数据
16
-
17
-  const [isModalOpen, setIsModalOpen] = useState(false);  //弹框
18
-  const [modalTitle, setModalTitle] = useState(true);  //弹框标题
19
-  const [form] = Form.useForm();
20
-  // const [nodes, setNodes] = useState<string>();
21
-
22
-  const [loading, setLoading] = useState(false);
23
-  const [imgPc, setImgPc] = useState({id:undefined,url:''});   //pc图片
24
-  const [imgM, setImgM] = useState({id:undefined,url:''});   //移动端图片
25
-  const [htmlPath, setHtmlPath] = useState(1);   //页面路径,为1成功,为2失败不能保存
26
-  // 页面路径是否显示
27
-  const [pagePathShow, setPagePathShow] = useState(true);
28
-  //弹框确定
29
-  const handleOk = () => {
30
-    let dataNow=form.getFieldsValue();
31
-    
32
-      if(dataNow.htmlUrl==undefined||trim(dataNow.htmlUrl).length==0){
33
-        setHtmlPath(3)
34
-      }
35
-    form.submit();
36
-  };
37
-  //弹框取消
38
-  const handleCancel = () => {
39
-    setIsModalOpen(false);
40
-  };
41
-  //删除数据
42
-  const deleteCar = async (e:any) => {
43
-    console.log('删除:',e);
44
-    let res:any=await getDeleteTree(e.uuid);
45
-        if(res.code==200){
46
-          getListData();
47
-          prop.upTree();
48
-          message.success(res.msg);
49
-        }else{
50
-          message.error(res.msg)
51
-        }
52
-  };
53
-  //修改数据
54
-  const revise = (e:any) => {
55
-    console.log('修改',e);
56
-    form.setFieldsValue(e);
57
-    setHtmlPath(1);
58
-    // setNodes(e?.nodes);
59
-    setImgPc({id:e?.pcImg,url:e?.pcImgUrl});
60
-    // setImgM({id:e?.mImg,url:e?.mImgUrl});
61
-    setIsModalOpen(true);
62
-    setModalTitle(false);
63
-  };
64
-  //新增
65
-  const addDom = ()=>{
66
-    
67
-    
68
-    form.resetFields();
69
-    form.setFieldsValue({ 
70
-      carType: undefined,
71
-      pText: undefined,
72
-      title:undefined,
73
-      sort:undefined,
74
-      uuid:undefined,
75
-      key:undefined,
76
-      htmlUrl:undefined,
77
-    });
78
-    setHtmlPath(1);
79
-    // setNodes(undefined);
80
-    setImgPc({id:undefined,url:''});
81
-    // setImgM({id:undefined,url:''});
82
-    setIsModalOpen(true);
83
-    setModalTitle(true);
84
-  }
85
-  //表单数据保存
86
-  const formSend = ()=>{
87
-    form.validateFields();
88
-    
89
-    let dataNow=form.getFieldsValue();
90
-    if(pagePathShow)dataNow.htmlUrl=trim(dataNow.htmlUrl);
91
-    dataNow={
92
-      ...dataNow,
93
-      // nodes,
94
-      pcImg:imgPc.id?imgPc.id:'',
95
-      // mImg:imgM.id?imgM.id:'',
96
-      fatherId:prop.id,
97
-      carType:'model'
98
-    }
99
-    
100
-    
101
-    if(pagePathShow&&htmlPath!=1){
102
-      return
103
-    }
104
-    editProductTree(dataNow).then((res:any)=>{
105
-      if(res.code == 200){
106
-        getListData();
107
-        prop.upTree();
108
-        setIsModalOpen(false);
109
-        message.success(res.msg);
110
-      }else{
111
-        message.error(res.msg);
112
-      }
113
-    });
114
-  }
115
-  //树形选择
116
-  const onChangeTreeSelect = (newValue: string) => {
117
-    console.log(newValue,'newValue');
118
-    
119
-    // setNodes(newValue);
120
-  };
121
-  //类型选择
122
-  const onCarTypeChange = (value: string) => {
123
-    form.setFieldsValue({ carType: value });
124
-  };
125
-  //图片上传
126
-  const handleBeforeUpload = async (file: any,type:any) => {
127
-    const formData = new FormData();
128
-    formData.append('file', file, file.name);
129
-    const res = await upload(formData);
130
-    if (res?.data?.uuid) {
131
-      if(type == 'pc'){
132
-        setImgPc({id:res.data.uuid,url:res.data.url})
133
-      }else{
134
-        setImgM({id:res.data.uuid,url:res.data.url})
135
-      }
136
-      
137
-    }
138
-    return false;
139
-  };
140
-  //图片删除
141
-  const imgDele = (value: string) => {
142
-    if(value == 'pc'){
143
-      setImgPc({id:undefined,url:''})
144
-    }else{
145
-      setImgM({id:undefined,url:''})
146
-    }
147
-  };
148
-  
149
-  //表格列设置
150
-  const columns: any = [
151
-    {
152
-      title: intl.formatMessage({id:'public.title'}),
153
-      dataIndex: 'title',
154
-      key: 'title',
155
-      width:200,
156
-    },
157
-    {
158
-      title: intl.formatMessage({id:'public.sort'}),
159
-      dataIndex: 'sort',
160
-      key: 'sort',
161
-      align: 'center',
162
-      width:100,
163
-    },
164
-    {
165
-      title: intl.formatMessage({id:'public.desctiption'}),
166
-      dataIndex: 'pText',
167
-      key: 'pText',
168
-      align: 'center',
169
-      width:400,
170
-    },
171
-    {
172
-      title: intl.formatMessage({id:'public.img'}),
173
-      dataIndex: 'carImg',
174
-      key: 'carImg',
175
-      align: 'center',
176
-      width:150,
177
-      render: (text,record:any) => <img src={record?.pcImgUrl} style={{ height:'110px'}}/>,
178
-    },
179
-    {
180
-      title: intl.formatMessage({id:'public.action'}),
181
-      dataIndex: '',
182
-      align: 'center',
183
-      width:160,
184
-      render: (text,record) => {
185
-        return <Space size="middle"><Button type='text' onClick={()=>revise(record)}>{intl.formatMessage({id:'public.update'})}</Button><Button type='text' onClick={()=>deleteCar(record)}>{intl.formatMessage({id:'public.delete'})}</Button></Space>
186
-      },
187
-    },
188
-  ];
189
-  
190
-  const getListData:any =()=>{
191
-    if(prop.id=='')return;
192
-    let showPage=true;
193
-    prop.treeDataAll.map((e:any)=>{
194
-      if(e.uuid =="9a99b2abf66e45269306c3c34bd64d8c"){
195
-        if(e.children.filter((item:any)=>item.uuid==prop.id).length>0){
196
-          showPage=false;
197
-        }
198
-      }
199
-    });
200
-    setPagePathShow(showPage);
201
-    getCarList(prop.id).then((res)=>{
202
-      if(res.code==200){
203
-        if(res.rows.length>0){
204
-          setListData(res.rows);
205
-        }else{
206
-          setListData([]);
207
-        }
208
-      }else{
209
-        message.error(res.msg);
210
-      }
211
-    })
212
-  }
213
-  //发布静态化
214
-  const pushStatusPage:any =()=>{
215
-    if(prop.id==''){
216
-      message.error('没有id');
217
-      return;
218
-    }
219
-    pushProducts(prop.id).then((res:any)=>{
220
-      if(res.code==200){
221
-        message.success(res.msg)
222
-      }else{
223
-        message.error(res.msg);
224
-      }
225
-    })
226
-  }
227
-  useEffect(() => {
228
-    getListData();
229
-    
230
-  }, [prop.id]);
231
-  //路径校验
232
-  const onPagePathChange=(val:any)=>{
233
-    let str=trim(val.target.value);
234
-    if(str.length==0||str==undefined||str==null){
235
-      setHtmlPath(3)
236
-    }else if(str.indexOf('?')!==-1||str.indexOf('*')!==-1||str.indexOf(':')!==-1||str.indexOf('"')!==-1||str.indexOf('<')!==-1||str.indexOf('>')!==-1||str.indexOf('|')!==-1||str.indexOf('\\')!==-1){
237
-      setHtmlPath(2)
238
-    }
239
-    else{
240
-      setHtmlPath(1)
241
-    }
242
-  }
243
-
244
-  return (
245
-      <div className='carRight'>
246
-        <div className='carTitle'>
247
-          
248
-          {intl.formatMessage({id:'public.carTypeList'})}
249
-          <Popconfirm title={intl.formatMessage({id:'public.ifConfirmPublish'})+'?'} onConfirm={pushStatusPage}>
250
-                <Button className='btn' type="primary">{intl.formatMessage({id:'public.publishAll'})}</Button>
251
-          </Popconfirm>
252
-          <Button className='btn' type="primary" onClick={addDom}>{intl.formatMessage({id:'public.add'})}</Button>
253
-        </div>
254
-        <Table
255
-          columns={columns}
256
-          dataSource={listData}
257
-          rowKey={(record:any)=>record?.uuid}
258
-        />
259
-        <Modal title={modalTitle?intl.formatMessage({id:'public.newCarTypeInfo'}):intl.formatMessage({id:'public.updateCarTypeInfo'})} className='carModal' open={isModalOpen} onOk={handleOk} onCancel={handleCancel} width={880}>
260
-        <Form
261
-            form={form}
262
-            labelCol={{ flex: '160px' }}
263
-            labelAlign="left"
264
-            labelWrap
265
-            wrapperCol={{ flex: 1 }}
266
-            colon={false}
267
-            style={{ maxWidth: 880 }}
268
-            onFinish={formSend}
269
-          >
270
-            <Form.Item label="uuid" name="uuid" hidden>
271
-              <Input />
272
-            </Form.Item>
273
-            <Form.Item label={intl.formatMessage({id:'public.carTypeName'})} name="title" rules={[{ required: true }]}>
274
-              <Input />
275
-            </Form.Item>
276
-            {/* <Form.Item name="carType" label="类型" rules={[{ required: true }]}>
277
-              <Select
278
-                placeholder="请选择类型"
279
-                onChange={onCarTypeChange}
280
-                allowClear
281
-              >
282
-                <Option value="series">车系</Option>
283
-                <Option value="overview">概览</Option>
284
-              </Select>
285
-            </Form.Item> */}
286
-            <Form.Item label={intl.formatMessage({id:'public.sort'})} name="sort">
287
-              <Input />
288
-            </Form.Item>
289
-            {/* <Form.Item label="关联节点" rules={[{ required: true }]}>
290
-              <TreeSelect
291
-                  showSearch
292
-                  style={{ width: '100%' }}
293
-                  value={nodes}
294
-                  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
295
-                  placeholder="请选择"
296
-                  allowClear
297
-                  treeDefaultExpandAll
298
-                  onChange={onChangeTreeSelect}
299
-                  treeData={prop.treeDataMy}
300
-                  fieldNames={{label:'title',value:'uuid'}}
301
-                />
302
-            </Form.Item> */}
303
-            
304
-            <Form.Item label={intl.formatMessage({id:'public.description'})} name="pText">
305
-              <TextArea rows={4} />
306
-            </Form.Item>
307
-            <Form.Item label={intl.formatMessage({id:'public.keyword'})} name="key">
308
-              <Input />
309
-            </Form.Item>
310
-            {pagePathShow&&
311
-            <Form.Item label={intl.formatMessage({id:'public.pagePath'})} name="htmlUrl" rules={[{ required: true }]}
312
-            validateStatus={(htmlPath==2||htmlPath==3)?"error":""} help={htmlPath==2?intl.formatMessage({id:'public.pagePathInfo'}):htmlPath==3?intl.formatMessage({id:'public.inputPlaceholder'})+intl.formatMessage({id:'public.pagePath'}):""}
313
-            >
314
-              <Input suffix={<Tooltip title={intl.formatMessage({id:'public.pagePathMess'})}>
315
-          <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
316
-        </Tooltip>} onChange={onPagePathChange} placeholder={intl.formatMessage({id:'public.inputPlaceholder'})+intl.formatMessage({id:'public.pagePath'})}/>
317
-            </Form.Item>}
318
-
319
-            <Form.Item label={intl.formatMessage({id:'public.img'})+'(PC)'} extra={intl.formatMessage({id:'public.pictureSize'})+':1280*720'}>
320
-                {imgPc.id && <div className='showImg'><img src={imgPc.url} /></div>}
321
-                <div className='uploadBtn'>
322
-                    <Upload
323
-                        beforeUpload={(e)=>handleBeforeUpload(e,'pc')}
324
-                        maxCount={1}
325
-                        showUploadList={false}
326
-                        accept={'.png, .jpg, .gif'}
327
-                      >
328
-                        <Button>{intl.formatMessage({id:'public.upload'})}</Button>
329
-                    </Upload>
330
-                </div>
331
-                <div className='uploadBtn'><Button onClick={()=>{imgDele('pc')}} >{intl.formatMessage({id:'public.delete'})}</Button></div>
332
-            </Form.Item>
333
-            {/* <Form.Item label="图片(移动)">
334
-                {imgM.id && <div className='showImg'><img src={imgM.url} /></div>}
335
-                <div className='uploadBtn'>
336
-                    <Upload
337
-                        beforeUpload={(e)=>handleBeforeUpload(e,'m')}
338
-                        maxCount={1}
339
-                        showUploadList={false}
340
-                        accept={'.png, .jpg, .gif'}
341
-                      >
342
-                        <Button>上传</Button>
343
-                    </Upload>
344
-                </div>
345
-                <div className='uploadBtn'><Button onClick={()=>{imgDele('m')}}>删除</Button></div>
346
-            </Form.Item> */}
347
-
348
-          </Form>
349
-        </Modal>
350
-      </div>
351
-  );
352
-};
353
-
354
-export default CarModelsTable;

+ 0
- 1986
src/pages/Product/ProductManage/page/carModelsDetail.tsx
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 0
- 327
src/pages/Product/ProductManage/page/carSeries.tsx Parādīt failu

@@ -1,327 +0,0 @@
1
-import React, { Ref, useEffect, useState, useRef } from 'react';
2
-import { Button, Tree, Tabs, Table, Modal, Space, Form, Input, Image, TreeSelect, Select, Upload, message, Popconfirm, Tooltip, UploadFile, UploadProps, GetProp } from 'antd'
3
-import { PlusOutlined, LoadingOutlined, InfoCircleOutlined } from '@ant-design/icons';
4
-import { upload } from '@/services/news/news';
5
-import { getCarList, editProductTree, getDeleteTree, pushProducts, getProductDetail, editProductDetail } from '@/services/product';
6
-import '../index.less';
7
-import { FormattedMessage, useIntl } from 'umi';
8
-import { trim } from 'lodash';
9
-import { EditableProTable } from '@ant-design/pro-components';
10
-
11
-const { Option } = Select;
12
-const { TextArea } = Input;
13
-type DataSourceType = {
14
-  id: React.Key;
15
-  key?: string;
16
-  readonly?: string;
17
-  decs?: string;
18
-  state?: string;
19
-  created_at?: number;
20
-  update_at?: number;
21
-  children?: DataSourceType[];
22
-  value?: string;
23
-};
24
-
25
-
26
-type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
27
-
28
-const CarListTable: React.FC<{ id: any, upTree: any }> = (prop: any) => {
29
-
30
-  const [listData, setListData] = useState([]);  //列表数据
31
-  let intl = useIntl()
32
-  const [form] = Form.useForm();
33
-
34
-  const [imgPc, setImgPc] = useState({ id: undefined, url: '' });   //pc图片
35
-  const [imgM, setImgM] = useState({ id: undefined, url: '' });   //移动端图片
36
-  const [imgParameter, setimgParameter] = useState({ id: undefined, url: '' });   //参数
37
-  const [imgListShow, setimgListShow] = useState({ id: undefined, url: '' });   //列表显示图
38
-
39
-  const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]);
40
-  const [dataSource, setDataSource] = useState<readonly DataSourceType[]>([]);
41
-
42
-  //弹框确定
43
-  const handleOk = () => {
44
-    form.submit();
45
-  };
46
-
47
-  //表单数据保存
48
-  const formSend = () => {
49
-    form.validateFields();
50
-    let dataNow = form.getFieldsValue();
51
-
52
-    dataNow = {
53
-      ...dataNow,
54
-      bannerPc: imgPc.id ? imgPc.id : '',
55
-      bannerM: imgM.id ? imgM.id : '',
56
-      img: imgListShow.id ? imgListShow.id : '',
57
-      config: imgParameter.id ? imgParameter.id : '',
58
-      productMenuUuid: prop.id,
59
-    }
60
-    if (dataSource.length > 0) {
61
-      let list = [];
62
-      for (let i in dataSource) {
63
-        list.push({ [dataSource[i].key]: dataSource[i].value })
64
-      }
65
-      dataNow.perform = JSON.stringify(list)
66
-
67
-    }
68
-
69
-    editProductDetail(dataNow).then((res: any) => {
70
-      if (res.code == 200) {
71
-        prop.upTree();
72
-        message.success(res.msg);
73
-      } else {
74
-        message.error(res.msg);
75
-      }
76
-    });
77
-  }
78
-  //图片上传
79
-  const handleBeforeUpload = async (file: any, type: any) => {
80
-    const formData = new FormData();
81
-    formData.append('file', file, file.name);
82
-    const res = await upload(formData);
83
-    if (res?.data?.uuid) {
84
-      if (type == '1') {
85
-        setImgPc({ id: res.data.uuid, url: res.data.url })
86
-      } else if (type == '2') {
87
-        setImgM({ id: res.data.uuid, url: res.data.url })
88
-      } else if (type == '3') {
89
-        setimgParameter({ id: res.data.uuid, url: res.data.url })
90
-      } else if (type == '4') {
91
-        setimgListShow({ id: res.data.uuid, url: res.data.url })
92
-      }
93
-
94
-    }
95
-    return false;
96
-  };
97
-  //图片删除
98
-  const imgDele = (value: string) => {
99
-    if (value == 'pc') {
100
-      setImgPc({ id: undefined, url: '' })
101
-    } else {
102
-      setImgM({ id: undefined, url: '' })
103
-    }
104
-  };
105
-
106
-  //表格列设置
107
-  const columns: any = [
108
-    {
109
-      title: intl.formatMessage({ id: 'public.key' }),
110
-      dataIndex: 'key',
111
-      key: 'key',
112
-    },
113
-    {
114
-      title: intl.formatMessage({ id: 'public.value' }),
115
-      dataIndex: 'value',
116
-      key: 'value',
117
-    },
118
-    {
119
-      title: intl.formatMessage({ id: 'public.action' }),
120
-      align: 'center',
121
-      width: 140,
122
-      valueType: 'option',
123
-      render: (text: string, record: any, _, action) => [
124
-        <a
125
-          key="editable"
126
-          onClick={() => {
127
-            action?.startEditable?.(record.id);
128
-          }}
129
-        >
130
-          编辑
131
-        </a>,
132
-        <a
133
-          key="delete"
134
-          onClick={() => {
135
-            setDataSource(dataSource.filter((item) => item.id !== record.id));
136
-          }}
137
-        >
138
-          删除
139
-        </a>,
140
-      ],
141
-    },
142
-  ];
143
-
144
-  useEffect(() => {
145
-    getDetail()
146
-  }, [prop.id]);
147
-
148
-  const getDetail = async () => {
149
-    try {
150
-      const res = await getProductDetail(prop.id);
151
-      if (res.code == 200) {
152
-        form.setFieldsValue({
153
-          uuid: res.data.uuid,
154
-          title: res.data.title,
155
-          digest: res.data.digest,
156
-        })
157
-        if (res.data.bannerPc) {
158
-          setImgPc({ id: res.data.bannerPc, url: res.data.bannerPcUrl })
159
-        }else{
160
-          setImgPc({ id: undefined, url: undefined })
161
-        }
162
-        if (res.data.bannerM) {
163
-          setImgM({ id: res.data.bannerM, url: res.data.bannerMUrl })
164
-        }else{
165
-          setImgM({ id: undefined, url: undefined })
166
-        }
167
-        if (res.data.config) {
168
-          setimgParameter({ id: res.data.config, url: res.data.configUrl })
169
-        }else{
170
-          setimgParameter({ id: undefined, url: undefined })
171
-        }
172
-        if (res.data.img) {
173
-          setimgListShow({ id: res.data.img, url: res.data.imgUrl })
174
-        }else{
175
-          setimgListShow({ id: undefined, url: undefined })
176
-        }
177
-        if(res.data.perform){
178
-          let list = JSON.parse(res.data.perform);
179
-          list = list.map((item,index)=>{
180
-            const key = Object.keys(item)[0]; // 获取对象的第一个键
181
-            return {
182
-              key: key, 
183
-              value: item[key],
184
-              id:(Math.random() * 1000000).toFixed(0)
185
-            }
186
-          })
187
-          console.log(list)
188
-          setDataSource(list)
189
-        }else{
190
-          setDataSource([])
191
-
192
-        }
193
-      }
194
-    } catch (error) { }
195
-  }
196
-
197
-
198
-  return (
199
-    <div className='carRight'>
200
-      <div className='carTitle'>
201
-        {intl.formatMessage({ id: 'product.carlist' })}
202
-        <Button className='btn' type="primary" onClick={handleOk}>{intl.formatMessage({ id: 'public.save' })}</Button>
203
-      </div>
204
-
205
-      <Form
206
-        form={form}
207
-        labelCol={{ flex: '160px' }}
208
-        labelAlign="left"
209
-        labelWrap
210
-        wrapperCol={{ flex: 1 }}
211
-        colon={false}
212
-        style={{ maxWidth: 880 }}
213
-        onFinish={formSend}
214
-      >
215
-        <Form.Item label="uuid" name="uuid" hidden>
216
-          <Input />
217
-        </Form.Item>
218
-        <Form.Item label={intl.formatMessage({ id: 'public.title' })} name="title" rules={[{ required: true }]}>
219
-          <Input />
220
-        </Form.Item>
221
-
222
-        <Form.Item label={intl.formatMessage({ id: 'public.description' })} name="digest">
223
-          <TextArea rows={4} />
224
-        </Form.Item>
225
-        <Form.Item label={intl.formatMessage({ id: 'public.performanceIndex' })}>
226
-          <EditableProTable
227
-            rowKey="id"
228
-            headerTitle={false}
229
-            maxLength={5}
230
-
231
-            recordCreatorProps={
232
-              {
233
-                position: 'bottom',
234
-                record: () => ({ id: (Math.random() * 1000000).toFixed(0) }),
235
-                onClick: () => {
236
-                  // 你可以在这里执行添加新行的逻辑
237
-                  if (dataSource.length >= 4) {
238
-                    message.warning('最多添加四条数据')
239
-                    return false
240
-                  }
241
-                  // const newData = { id: (Math.random() * 1000000).toFixed(0) };
242
-                  // setDataSource((prev) => [...prev, newData]);
243
-                },
244
-              }
245
-            }
246
-            loading={false}
247
-            columns={columns}
248
-
249
-            value={dataSource}
250
-            onChange={setDataSource}
251
-            editable={{
252
-              type: 'multiple',
253
-              editableKeys,
254
-              onSave: async (rowKey, data, row) => {
255
-                console.log(rowKey, data, row);
256
-                // await waitTime(2000);
257
-              },
258
-              onChange: setEditableRowKeys,
259
-            }}
260
-          />
261
-        </Form.Item>
262
-        {/* extra={intl.formatMessage({id:'public.pictureSize'})+":1280*720"} */}
263
-        <Form.Item label="banner(PC)">
264
-          {imgPc.id && <div className='showImg'><img src={imgPc.url} /></div>}
265
-          <div className='uploadBtn'>
266
-            <Upload
267
-              beforeUpload={(e) => handleBeforeUpload(e, '1')}
268
-              maxCount={1}
269
-              showUploadList={false}
270
-              accept={'.png, .jpg, .gif'}
271
-            >
272
-              <Button>上传</Button>
273
-            </Upload>
274
-          </div>
275
-          <div className='uploadBtn'><Button onClick={() => { imgDele('1') }}>删除</Button></div>
276
-        </Form.Item>
277
-        <Form.Item label="banner(移动端)">
278
-          {imgM.id && <div className='showImg'><img src={imgM.url} /></div>}
279
-          <div className='uploadBtn'>
280
-            <Upload
281
-              beforeUpload={(e) => handleBeforeUpload(e, '2')}
282
-              maxCount={1}
283
-              showUploadList={false}
284
-              accept={'.png, .jpg, .gif'}
285
-            >
286
-              <Button>上传</Button>
287
-            </Upload>
288
-          </div>
289
-          <div className='uploadBtn'><Button onClick={() => { imgDele('2') }}>删除</Button></div>
290
-        </Form.Item>
291
-        <Form.Item label="参数图片">
292
-          {imgParameter.id && <div className='showImg'><img src={imgParameter.url} /></div>}
293
-          <div className='uploadBtn'>
294
-            <Upload
295
-              beforeUpload={(e) => handleBeforeUpload(e, '3')}
296
-              maxCount={1}
297
-              showUploadList={false}
298
-              accept={'.png, .jpg, .gif'}
299
-            >
300
-              <Button>上传</Button>
301
-            </Upload>
302
-          </div>
303
-          <div className='uploadBtn'><Button onClick={() => { imgDele('3') }}>删除</Button></div>
304
-        </Form.Item>
305
-        <Form.Item label="列表显示图片">
306
-          {imgListShow.id && <div className='showImg'><img src={imgListShow.url} /></div>}
307
-          <div className='uploadBtn'>
308
-            <Upload
309
-              beforeUpload={(e) => handleBeforeUpload(e, '4')}
310
-              maxCount={1}
311
-              showUploadList={false}
312
-              accept={'.png, .jpg, .gif'}
313
-            >
314
-              <Button>上传</Button>
315
-            </Upload>
316
-          </div>
317
-          <div className='uploadBtn'><Button onClick={() => { imgDele('4') }}>删除</Button></div>
318
-        </Form.Item>
319
-
320
-
321
-
322
-      </Form>
323
-    </div>
324
-  );
325
-};
326
-
327
-export default CarListTable;

+ 0
- 195
src/pages/Product/ProductManage/page/carouselImage.tsx Parādīt failu

@@ -1,195 +0,0 @@
1
-import React, { Ref, useEffect, useState, useRef } from 'react';
2
-import { Button, Tree, Tabs, Table, Modal, Space, Form, Input, Image, TreeSelect, Select, Upload, message, Popconfirm, Tooltip, UploadFile, UploadProps, GetProp } from 'antd'
3
-import { PlusOutlined, LoadingOutlined, InfoCircleOutlined } from '@ant-design/icons';
4
-import { upload } from '@/services/news/news';
5
-import { getCarList, editProductTree, getDeleteTree, getDeleteBanner,getProductBannerSave, getProductBannerDetail, editProductDetail } from '@/services/product';
6
-import '../index.less';
7
-import { FormattedMessage, useIntl } from 'umi';
8
-import { trim } from 'lodash';
9
-import { EditableProTable } from '@ant-design/pro-components';
10
-
11
-const { Option } = Select;
12
-const { TextArea } = Input;
13
-type DataSourceType = {
14
-    id: React.Key;
15
-    key?: string;
16
-    readonly?: string;
17
-    decs?: string;
18
-    state?: string;
19
-    created_at?: number;
20
-    update_at?: number;
21
-    children?: DataSourceType[];
22
-    value?: string;
23
-};
24
-
25
-
26
-type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
27
-const getBase64 = (file: FileType): Promise<string> =>
28
-    new Promise((resolve, reject) => {
29
-        const reader = new FileReader();
30
-        reader.readAsDataURL(file);
31
-        reader.onload = () => resolve(reader.result as string);
32
-        reader.onerror = (error) => reject(error);
33
-    });
34
-const CarListTable: React.FC<{ id: any, upTree: any }> = (prop: any) => {
35
-
36
-    let intl = useIntl()
37
-    const [form] = Form.useForm();
38
-
39
-    const [imgPc, setImgPc] = useState({ id: undefined, url: '' });   //pc图片
40
-    const [dataSource, setDataSource] = useState<readonly DataSourceType[]>([]);
41
-    const [listData,setListData] = useState([]);
42
-    const [fileUploadList, setFileUploadList] = useState({});
43
-    const [fileList, setFileList] = useState<UploadFile[]>();
44
-    const [previewOpen, setPreviewOpen] = useState(false);
45
-    const [previewImage, setPreviewImage] = useState('');
46
-    const [isModalOpen,setIsModalOpen] = useState<boolean>(false);
47
-
48
-    //弹框确定
49
-    const handleOk = () => {
50
-        form.submit();
51
-    };
52
-
53
-    //表单数据保存
54
-    const formSend = () => {
55
-        form.validateFields();
56
-        let dataNow = form.getFieldsValue();
57
-
58
-        dataNow = {
59
-            ...dataNow,
60
-            img:imgPc.id ? imgPc.id : '',
61
-            productMenuUuid: prop.id,
62
-        }
63
-
64
-        console.log('保存数据-----》', dataNow)
65
-        getProductBannerSave(dataNow).then((res: any) => {
66
-            if (res.code == 200) {
67
-                message.success(res.msg);
68
-                getDetail()
69
-                setIsModalOpen(false)
70
-                setImgPc({ id: undefined, url: '' });
71
-                form.resetFields();
72
-            } else {
73
-                message.error(res.msg);
74
-            }
75
-        });
76
-    }
77
-    //图片上传
78
-    const handleBeforeUpload = async (file: any) => {
79
-        const formData = new FormData();
80
-        formData.append('file', file, file.name);
81
-        const res = await upload(formData);
82
-        if (res?.data?.uuid) {
83
-            setImgPc({ id: res.data.uuid, url: res.data.url })
84
-        }
85
-        return false;
86
-    };
87
-
88
-    useEffect(() => {
89
-        getDetail()
90
-    }, [prop.id]);
91
-    
92
-    const getDetail = async () => {
93
-        try {
94
-            const res = await getProductBannerDetail(prop.id);
95
-            if(res.code == 200){
96
-                setListData(res.rows)
97
-            }
98
-            console.log(res)
99
-        } catch (error) {
100
-
101
-        }
102
-    }
103
-    const deleteCar = async (e: any) => {
104
-        console.log('删除:', e);
105
-        let res: any = await getDeleteBanner(e.uuid);
106
-        if (res.code == 200) {
107
-            getDetail();
108
-            message.success(res.msg);
109
-        } else {
110
-            message.error(res.msg)
111
-        }
112
-    };
113
-    //表格列设置
114
-    const columns: any = [
115
-        {
116
-            title: '图片地址',
117
-            dataIndex: 'imgUrl',
118
-            key: 'imgUrl',
119
-            align: 'center',
120
-            render: (text: any) => {
121
-                return <Image src={text} />;
122
-            }
123
-        },
124
-
125
-        {
126
-            title: intl.formatMessage({ id: 'public.action' }),
127
-            dataIndex: '',
128
-            align: 'center',
129
-            width: 100,
130
-            render: (text: any, record: any) => {
131
-                return <Space size="middle">
132
-                    <Popconfirm title={intl.formatMessage({ id: 'public.ifconfirmdelete' })} onConfirm={() => deleteCar(record)}>
133
-                        <Button danger type='text'>{intl.formatMessage({ id: 'public.delete' })}</Button>
134
-                    </Popconfirm>
135
-
136
-                </Space>
137
-            },
138
-        },
139
-    ];
140
-
141
-    const imgDele = () => {
142
-          setImgPc({ id: undefined, url: '' })
143
-      };
144
-    
145
-
146
-    return (
147
-        <div className='carRight'>
148
-            <div className='carTitle'>
149
-                {'轮播图'}
150
-                {/* <Popconfirm title={intl.formatMessage({id:'public.ifConfirmPublish'})} onConfirm={pushStatusPage}>
151
-                <Button className='btn' type="primary">{intl.formatMessage({id:'public.publishAll'})}</Button>
152
-          </Popconfirm> */}
153
-
154
-                <Button className='btn' type="primary" onClick={()=>setIsModalOpen(true)}>{intl.formatMessage({ id: 'public.uploadImg' })}</Button>
155
-            </div>
156
-            <Table
157
-                columns={columns}
158
-                dataSource={listData}
159
-                rowKey={(record: any) => record?.uuid}
160
-            />
161
-            <Modal title={'上传轮播图'} className='carModal' open={isModalOpen} onOk={handleOk} onCancel={()=>setIsModalOpen(false)} width={880}>
162
-                <Form
163
-                    form={form}
164
-                    labelCol={{ flex: '160px' }}
165
-                    labelAlign="left"
166
-                    labelWrap
167
-                    wrapperCol={{ flex: 1 }}
168
-                    colon={false}
169
-                    style={{ maxWidth: 880 }}
170
-                    onFinish={formSend}
171
-                >
172
-                    <Form.Item label={'banner'}  >
173
-                        {imgPc.id && <div className='showImg'><img src={imgPc.url} /></div>}
174
-                        <div className='uploadBtn'>
175
-                            <Upload
176
-                                beforeUpload={(e) => handleBeforeUpload(e)}
177
-                                maxCount={1}
178
-                                accept={'.png, .jpg, .gif'}
179
-                            >
180
-                                <Button>{intl.formatMessage({ id: 'public.upload' })}</Button>
181
-                            </Upload>
182
-                        </div>
183
-                        <div className='uploadBtn'><Button onClick={()=>{imgDele()}} >{intl.formatMessage({id:'public.delete'})}</Button></div>
184
-                    </Form.Item>
185
-                    <Form.Item label={'排序'} name="sort">
186
-                        <Input />
187
-                    </Form.Item>
188
-
189
-                </Form>
190
-            </Modal>
191
-        </div>
192
-    );
193
-};
194
-
195
-export default CarListTable;

+ 6
- 4
src/pages/SocialRespon/socialRespon/edit.tsx Parādīt failu

@@ -2,6 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
2 2
 import {
3 3
   ProForm,
4 4
   ProFormText,
5
+  ProFormTextArea,
5 6
   ProFormUploadButton,
6 7
   ProFormSelect,
7 8
   ProFormDatePicker,
@@ -209,7 +210,7 @@ const SocialResponForm: React.FC<SocialResponProps> = (props) => {
209 210
     let content = editor.getContents()
210 211
     // console.log('htmlStr----', htmlStr)
211 212
     editor.setContents(content)
212
-    data.date = moment(data.date).format('YYYY.MM.DD');
213
+    data.date = moment(data.date).format('YYYY-MM-DD');
213 214
     if(checkTop){
214 215
       data.top = 1;
215 216
     }else{
@@ -264,7 +265,7 @@ const SocialResponForm: React.FC<SocialResponProps> = (props) => {
264 265
   return (
265 266
     <Drawer
266 267
       width={'80%'}
267
-      title={props.currentRow ? '新闻编辑' : '新建新闻'}
268
+      title={props.currentRow ? '文章编辑' : '新建文章'}
268 269
       forceRender
269 270
       open={props.open}
270 271
       destroyOnClose
@@ -296,7 +297,7 @@ const SocialResponForm: React.FC<SocialResponProps> = (props) => {
296 297
             },
297 298
           ]}
298 299
         />
299
-        <ProFormText
300
+        <ProFormTextArea
300 301
           name="digest"
301 302
           label='摘要'
302 303
           labelCol={{
@@ -308,7 +309,7 @@ const SocialResponForm: React.FC<SocialResponProps> = (props) => {
308 309
           name="date"
309 310
           label='展示日期'
310 311
           fieldProps={{
311
-            format: (value) => value.format('YYYY.MM.DD'),
312
+            format: (value) => value.format('YYYY-MM-DD'),
312 313
           }}
313 314
           labelCol={{
314 315
             style: { width: 95 }
@@ -361,6 +362,7 @@ const SocialResponForm: React.FC<SocialResponProps> = (props) => {
361 362
             style: { width: 95 }
362 363
           }}
363 364
           placeholder={'中泽集团'}
365
+          initialValue={'中泽集团'}
364 366
         />
365 367
 
366 368
         <ProForm.Item 

+ 22
- 3
src/pages/SocialRespon/socialRespon/index.tsx Parādīt failu

@@ -6,7 +6,7 @@ import { Button, message, Modal, Image } from 'antd';
6 6
 import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
7 7
 import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
8 8
 // import { getNoticeList, removeNotice, addNotice, updateNotice, exportNotice } from '@/services/system/notice';
9
-import { getSocialResponList, saveSocialRespon, deleteSocialRespon, pushSocialResponDetail } from '@/services/socialRespon/socialRespon';
9
+import { getSocialResponList, saveSocialRespon, deleteSocialRespon, pushSocialResponDetail,push } from '@/services/socialRespon/socialRespon';
10 10
 import SocialResponForm from './edit';
11 11
 import { getDictValueEnum } from '@/services/system/dict';
12 12
 import moment from 'moment';
@@ -195,7 +195,19 @@ const NoticeTableList: React.FC = () => {
195 195
             ],
196 196
         },
197 197
     ];
198
-
198
+/**
199
+     * 一键发布
200
+     */
201
+const publishing = async () => {
202
+    try {
203
+        const resp = await push();
204
+        if (resp.code === 200) {
205
+            message.success('发布成功');
206
+        } else {
207
+            message.error(resp.msg);
208
+        }
209
+    } catch (error) { }
210
+}
199 211
     return (
200 212
         <KeepAlive name={'党建工作'} path="/SocialRespon/partyWork">
201 213
             <PageContainer>
@@ -218,7 +230,14 @@ const NoticeTableList: React.FC = () => {
218 230
                                 }}
219 231
                             >
220 232
                                 <PlusOutlined /> <FormattedMessage id="public.add" defaultMessage="新建" />
221
-                            </Button>
233
+                            </Button>,
234
+                            <Button
235
+                            type="primary"
236
+                            key="fabu"
237
+                            onClick={publishing}
238
+                            >
239
+                                一键发布
240
+                            </Button>,
222 241
                         ]}
223 242
                         request={(params) => {
224 243
                             return getSocialResponList({ ...params } as API.System.NoticeListParams).then((res) => {

+ 0
- 68
src/services/contactUs/contactUs.ts Parādīt failu

@@ -1,68 +0,0 @@
1
-import { request } from '@umijs/max';
2
-// <联系我们-=-线索信息>----新增或修改一个线索;
3
-// params: ModifyClueListType;
4
-// return: ModifyClueListResponse;
5
-export interface ModifyClueListType {
6
-    shop?: string; //预约门店;
7
-    city?: string; //城市;
8
-    province?: string; //预约省;
9
-    product?: string;//预约意向车型
10
-    date?: string; //咨询日期;
11
-    leaword?: string; //留言;
12
-    leawordType?: string;//留言类型
13
-    email?: string; //邮箱;
14
-    phone?: string; //电话;
15
-    name?: string; //用户姓名;
16
-    type?: number; //咨询类型;
17
-    uuid?: string; //线索id;
18
-  }
19
-  export interface ModifyClueListResponse {
20
-    msg: string;
21
-    code: number;
22
-  }
23
-  export function modifyClueList(params: ModifyClueListType) {
24
-    return request<ModifyClueListResponse>(`/api/system/clue/list`, {
25
-      method: 'POST',
26
-      data: params,
27
-    });
28
-  }
29
-  
30
-  // <联系我们-=-线索信息>----删除一个线索;
31
-  // params: DeleteClueRemoveType;
32
-  // return: DeleteClueRemoveResponse;
33
-  export interface DeleteClueRemoveType {
34
-    clueUuid: string; //经销商id;
35
-  }
36
-  export interface DeleteClueRemoveResponse extends Partial<ModifyClueListType> {
37
-    [porperty: string]: any;
38
-  }
39
-  export function deleteClueRemove(params: DeleteClueRemoveType) {
40
-    return request<DeleteClueRemoveResponse>(`/api/system/clue/remove`, {
41
-      method: 'DELETE',
42
-      params: params,
43
-    });
44
-  }
45
-  
46
-  // <联系我们-=-线索信息>----查询多个线索;
47
-  export interface GetClueListType extends Partial<ModifyClueListType> {
48
-    endTime?: string; //结束时间;
49
-    startTime?: string; //开始时间;
50
-    type?: number; //留资类型;
51
-    pageNum?: number; //分页-当前处于第几页。
52
-    pageSize?: number; //分页-一页最多多少条数据。
53
-  }
54
-  export interface GetClueListItem extends Partial<ModifyClueListType> {
55
-    [porperty: string]: any;
56
-  }
57
-  export interface GetClueListResponse {
58
-    total: number;
59
-    rows: GetClueListItem[];
60
-    code: number;
61
-    msg: string;
62
-  }
63
-  export function getClueListList(params: GetClueListType) {
64
-    return request<GetDealerListResponse>(`/api/system/clue/list`, {
65
-      method: 'GET',
66
-      params: params,
67
-    });
68
-  }

+ 10
- 0
src/services/home/banner.ts Parādīt failu

@@ -40,3 +40,13 @@ export async function deleteBanner(bannerUuid:any) {
40 40
   });
41 41
 }
42 42
 
43
+//发布
44
+export async function push(params: any) {
45
+  return request('/api/staticize/static/index', {
46
+    method: 'GET',
47
+    headers: {
48
+      'Content-Type': 'application/json;charset=UTF-8',
49
+    },
50
+    params,
51
+  });
52
+}

+ 0
- 57
src/services/mapDot/mapDot.ts Parādīt failu

@@ -1,57 +0,0 @@
1
-import { request } from '@umijs/max'; 
2
-
3
-// 查询
4
-export async function getMapDotList(params: any) {
5
-    return request('/api/system/mapDot/list', {
6
-      method: 'GET',
7
-      headers: {
8
-        'Content-Type': 'application/json;charset=UTF-8',
9
-      },
10
-      params,
11
-    });
12
-  }
13
-
14
-// 保存
15
-export async function saveMapDot(data: any) {
16
-  return request('/api/system/mapDot/save', {
17
-    method: 'post',
18
-    data: data, 
19
-  });
20
-}
21
-
22
-// 上传图片
23
-export async function upload(data: any) {
24
-  return request('/api/file/upload', {
25
-    method: 'post',
26
-    data: data,
27
-  });
28
-}
29
-
30
-//删除
31
-export async function deleteMapDot(mapDotUuid:any) {
32
-  return request(`/api/system/mapDot/remove`, {
33
-    method: 'DELETE',
34
-    headers: {
35
-      'Content-Type': 'application/json;charset=UTF-8',
36
-    },
37
-    params:{
38
-      mapDotUuid:mapDotUuid
39
-    },
40
-  });
41
-}
42
-
43
-// 上传图片
44
-export async function importData(data: any) {
45
-  return request('/api/system/mapDot/importData', {
46
-    method: 'post',
47
-    data: data,
48
-  });
49
-}
50
-
51
-// 地区
52
-export async function getArea(data: any) {
53
-  return request('/api/system/area/list', {
54
-    method: 'post',
55
-    data: data, 
56
-  });
57
-}

+ 12
- 1
src/services/news/news.ts Parādīt failu

@@ -53,10 +53,21 @@ export async function deleteNews(newsUuid:any) {
53 53
 
54 54
 //发布新闻
55 55
 export async function pushNewsDetail(params: any) {
56
-  return request('/api/system/static/newsDetail?newsUuid='+params.newsUuid, {
56
+  return request('/api/system/static/articleDetail/news/'+params.newsUuid, {
57 57
     method: 'GET',
58 58
     headers: {
59 59
       'Content-Type': 'application/json;charset=UTF-8',
60 60
     },
61 61
   });
62 62
 }
63
+
64
+//发布
65
+export async function push(params: any) {
66
+  return request('/api/staticize/static/news', {
67
+    method: 'GET',
68
+    headers: {
69
+      'Content-Type': 'application/json;charset=UTF-8',
70
+    },
71
+    params,
72
+  });
73
+}

+ 24
- 2
src/services/partyWork/partyWork.ts Parādīt failu

@@ -51,12 +51,34 @@ export async function deletePartyWork(partyWorkUuid:any) {
51 51
   });
52 52
 }
53 53
 
54
-//发布新闻
54
+//发布
55 55
 export async function pushPartyWorkDetail(params: any) {
56
-  return request('/api/system/static/partyWorkDetail?partyWorkUuid='+params.partyWorkUuid, {
56
+  return request('/api/system/static/articleDetail/partyWork/'+params.partyWorkUuid, {
57 57
     method: 'GET',
58 58
     headers: {
59 59
       'Content-Type': 'application/json;charset=UTF-8',
60 60
     },
61 61
   });
62 62
 }
63
+
64
+//发布
65
+export async function push1(params: any) {
66
+  return request('/api/staticize/static/partyBuilding', {
67
+    method: 'GET',
68
+    headers: {
69
+      'Content-Type': 'application/json;charset=UTF-8',
70
+    },
71
+    params,
72
+  });
73
+}
74
+
75
+//发布
76
+export async function push2(params: any) {
77
+  return request('/api/staticize/static/enterprisePartyBuilding', {
78
+    method: 'GET',
79
+    headers: {
80
+      'Content-Type': 'application/json;charset=UTF-8',
81
+    },
82
+    params,
83
+  });
84
+}

+ 0
- 246
src/services/product/index.ts Parādīt failu

@@ -1,246 +0,0 @@
1
-import { request } from '@umijs/max'; 
2
-
3
-//删除产品banner
4
-export async function getDeleteDetailPerform(param:any) {
5
-  return request('/api/system/product/detailPerform/remove?bannerId='+param, {
6
-    method: 'DELETE',
7
-    headers: {
8
-      'Content-Type': 'application/json;charset=UTF-8',
9
-    },
10
-  });
11
-}
12
-
13
-//新增编辑产品banner
14
-export async function getDetailPerformSave(param:any) {
15
-  return request('/api/system/product/detailPerform/save', {
16
-    method: 'POST',
17
-    headers: {
18
-      'Content-Type': 'application/json;charset=UTF-8',
19
-    },
20
-    data:param
21
-  });
22
-}
23
-
24
-//获取产品banner
25
-export async function getDetailPerformDetail(param) {
26
-  return request('/api/system/product/detailPerform/list?menuId='+param, {
27
-    method: 'GET',
28
-    headers: {
29
-      'Content-Type': 'application/json;charset=UTF-8',
30
-    },
31
-  });
32
-}
33
-
34
-//删除产品banner
35
-export async function getDeleteBanner(param:any) {
36
-  return request('/api/system/product/detailBanner/remove?bannerId='+param, {
37
-    method: 'DELETE',
38
-    headers: {
39
-      'Content-Type': 'application/json;charset=UTF-8',
40
-    },
41
-  });
42
-}
43
-
44
-//新增编辑产品banner
45
-export async function getProductBannerSave(param:any) {
46
-  return request('/api/system/product/detailBanner/save', {
47
-    method: 'POST',
48
-    headers: {
49
-      'Content-Type': 'application/json;charset=UTF-8',
50
-    },
51
-    data:param
52
-  });
53
-}
54
-
55
-//获取产品banner
56
-export async function getProductBannerDetail(param) {
57
-  return request('/api/system/product/detailBanner/list?menuId='+param, {
58
-    method: 'GET',
59
-    headers: {
60
-      'Content-Type': 'application/json;charset=UTF-8',
61
-    },
62
-  });
63
-}
64
-
65
-//获取产品概览详情
66
-export async function getProductDetail(param) {
67
-  return request('/api/system/product/detail/list?menuId='+param, {
68
-    method: 'GET',
69
-    headers: {
70
-      'Content-Type': 'application/json;charset=UTF-8',
71
-    },
72
-  });
73
-}
74
-//新增编辑产品数列表
75
-export async function editProductDetail(param:any) {
76
-  return request('/api/system/product/detail/save', {
77
-    method: 'POST',
78
-    headers: {
79
-      'Content-Type': 'application/json;charset=UTF-8',
80
-    },
81
-    data:param
82
-  });
83
-}
84
-
85
-//获取产品树列表
86
-export async function getProductTree() {
87
-    return request('/api/system/product/menu/list', {
88
-      method: 'GET',
89
-      headers: {
90
-        'Content-Type': 'application/json;charset=UTF-8',
91
-      },
92
-    });
93
-}
94
-//新增编辑产品数列表
95
-export async function editProductTree(param:any) {
96
-  return request('/api/system/product/menu/save', {
97
-    method: 'POST',
98
-    headers: {
99
-      'Content-Type': 'application/json;charset=UTF-8',
100
-    },
101
-    data:param
102
-  });
103
-}
104
-//删除产品数列表
105
-export async function getDeleteTree(param:any) {
106
-  return request('/api/system/product/menu/remove?menuId='+param, {
107
-    method: 'DELETE',
108
-    headers: {
109
-      'Content-Type': 'application/json;charset=UTF-8',
110
-    },
111
-  });
112
-}
113
-
114
-//获取车系列表
115
-export async function getCarList(param:any) {
116
-  return request('/api/system/product/menu/childList?menuId='+param, {
117
-    method: 'GET',
118
-    headers: {
119
-      'Content-Type': 'application/json;charset=UTF-8',
120
-    }
121
-  });
122
-}
123
-
124
-//获取车型详情列表
125
-export async function getCarDetialList(param:any) {
126
-  return request('/api/system/product/carDetail/list?menuId='+param, {
127
-    method: 'GET',
128
-    headers: {
129
-      'Content-Type': 'application/json;charset=UTF-8',
130
-    }
131
-  });
132
-}
133
-//新增编辑车型详情数据
134
-export async function editCarDetail(param:any) {
135
-  return request('/api/system/product/carDetail/save', {
136
-    method: 'POST',
137
-    headers: {
138
-      'Content-Type': 'application/json;charset=UTF-8',
139
-    },
140
-    data:param
141
-  });
142
-}
143
-//删除车型详情数据
144
-export async function carDetailDelete(param:any) {
145
-  return request('/api/system/product/carDetail/remove?carDetailId='+param, {
146
-    method: 'DELETE',
147
-    headers: {
148
-      'Content-Type': 'application/json;charset=UTF-8',
149
-    },
150
-  });
151
-}
152
-
153
-//获取品牌详情列表
154
-export async function getCarBrandDetialList(param:any) {
155
-  return request('/api/system/product/brandDetail/list?menuId='+param, {
156
-    method: 'GET',
157
-    headers: {
158
-      'Content-Type': 'application/json;charset=UTF-8',
159
-    }
160
-  });
161
-}
162
-//新增编辑品牌详情数据
163
-export async function editCarBrandDetail(param:any) {
164
-  return request('/api/system/product/brandDetail/save', {
165
-    method: 'POST',
166
-    headers: {
167
-      'Content-Type': 'application/json;charset=UTF-8',
168
-    },
169
-    data:param
170
-  });
171
-}
172
-//删除品牌详情数据
173
-export async function carBrandDetailDelete(param:any) {
174
-  return request('/api/system/product/brandDetail/remove?productDetailId='+param, {
175
-    method: 'DELETE',
176
-    headers: {
177
-      'Content-Type': 'application/json;charset=UTF-8',
178
-    },
179
-  });
180
-}
181
-
182
-//获取品牌详情列表
183
-export async function getTestimonyList(param:any) {
184
-  return request('/api/system/product/testimony/list?menuId='+param, {
185
-    method: 'GET',
186
-    headers: {
187
-      'Content-Type': 'application/json;charset=UTF-8',
188
-    }
189
-  });
190
-}
191
-//新增编辑品牌详情数据
192
-export async function editTestimony(param:any) {
193
-  return request('/api/system/product/testimony/save', {
194
-    method: 'POST',
195
-    headers: {
196
-      'Content-Type': 'application/json;charset=UTF-8',
197
-    },
198
-    data:param
199
-  });
200
-}
201
-//删除品牌详情数据
202
-export async function TestimonyDelete(param:any) {
203
-  return request('/api/system/product/testimony/remove?brandTestimonyId='+param, {
204
-    method: 'DELETE',
205
-    headers: {
206
-      'Content-Type': 'application/json;charset=UTF-8',
207
-    },
208
-  });
209
-}
210
-
211
-//发布品牌详情
212
-export async function pushProductsBrand(params: any) {
213
-  return request('/api/staticize/productsBrand?menuUuid='+params, {
214
-    method: 'GET',
215
-    headers: {
216
-      'Content-Type': 'application/json;charset=UTF-8',
217
-    },
218
-  });
219
-}
220
-//发布车型列表
221
-export async function pushProducts(params: any) {
222
-  return request('/api/staticize/noSelect/products', {
223
-    method: 'GET',
224
-    headers: {
225
-      'Content-Type': 'application/json;charset=UTF-8',
226
-    },
227
-  });
228
-}
229
-//发布车型详情
230
-export async function pushProductsDetail(params: any) {
231
-  return request('/api/staticize/productsDetail?menuUuid='+params, {
232
-    method: 'GET',
233
-    headers: {
234
-      'Content-Type': 'application/json;charset=UTF-8',
235
-    },
236
-  });
237
-}
238
-
239
-//上传exl文件
240
-// 上传图片
241
-export async function uploadExl(data: any) {
242
-  return request('/api/system/product/importData', {
243
-    method: 'post',
244
-    data: data,
245
-  });
246
-}

+ 13
- 2
src/services/socialRespon/socialRespon.ts Parādīt failu

@@ -51,12 +51,23 @@ export async function deleteSocialRespon(socialResponUuid:any) {
51 51
   });
52 52
 }
53 53
 
54
-//发布新闻
54
+//发布
55 55
 export async function pushSocialResponDetail(params: any) {
56
-  return request('/api/system/static/socialResponDetail?socialResponUuid='+params.socialResponUuid, {
56
+  return request('/api/system/static/articleDetail/socialRespon/'+params.socialResponUuid, {
57 57
     method: 'GET',
58 58
     headers: {
59 59
       'Content-Type': 'application/json;charset=UTF-8',
60 60
     },
61 61
   });
62 62
 }
63
+
64
+//发布
65
+export async function push(params: any) {
66
+  return request('/api/staticize/static/socialRespon', {
67
+    method: 'GET',
68
+    headers: {
69
+      'Content-Type': 'application/json;charset=UTF-8',
70
+    },
71
+    params,
72
+  });
73
+}

Notiek ielāde…
Atcelt
Saglabāt