瀏覽代碼

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

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

+ 48
- 0
src/components/SettingRow/index.jsx 查看文件

@@ -0,0 +1,48 @@
1
+import { Input, Button, Tooltip, message } from 'antd';
2
+import { useState } from 'react';
3
+import { CheckOutlined, UndoOutlined } from '@ant-design/icons';
4
+
5
+const SettingRow = (props) => {
6
+  const { value, onChange } = props;
7
+  const [val, setVal] = useState(value.settingValue);
8
+  const [isShow, setIsShow] = useState(false);
9
+  const handleInput = () => {
10
+    setIsShow(true);
11
+  };
12
+  const handleClick = () => {
13
+    if (val) {
14
+      onChange(value, val);
15
+    } else {
16
+      message.info(value.settingDesc + '不能为空');
17
+      setVal(value.settingValue);
18
+    }
19
+  };
20
+  const handleChange = (e) => {
21
+    setVal(e.target.value);
22
+  };
23
+  const handleReset = () => {
24
+    setVal(value.settingValue);
25
+    setIsShow(false);
26
+  };
27
+  return (
28
+    <div style={{ textAlign: 'center' }}>
29
+      {value.settingDesc}:
30
+      <Input style={{ width: '400px' }} value={val} onChange={handleChange} onInput={handleInput} />
31
+      <Button
32
+        type="text"
33
+        style={{ color: '#1890ff', visibility: isShow ? 'inherit' : 'hidden' }}
34
+        icon={<CheckOutlined />}
35
+        onClick={handleClick}
36
+      />
37
+      <Tooltip placement="top" title={'重置' + value.settingDesc}>
38
+        <Button
39
+          type="text"
40
+          style={{ color: 'green', visibility: isShow ? 'inherit' : 'hidden' }}
41
+          icon={<UndoOutlined />}
42
+          onClick={handleReset}
43
+        />
44
+      </Tooltip>
45
+    </div>
46
+  );
47
+};
48
+export default SettingRow;

+ 127
- 65
src/pages/Machinery/MachineryType/index.jsx 查看文件

@@ -1,37 +1,99 @@
1
-import React from 'react';
2
-import { history, Link } from 'umi';
3
-import { Button, Popconfirm, Modal, Form, Input, message, Space, Tooltip } from 'antd';
1
+import { Button, Popconfirm, Modal, Form, Input, message, Select } from 'antd';
4 2
 import { PlusOutlined } from '@ant-design/icons';
5
-// import { getPersonList, exportPersonList } from '@/services/person';
6 3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
7
-import { useRef, useState, useEffect } from 'react';
4
+import React, { useRef, useState, useEffect } from 'react';
8 5
 import moment from 'moment';
9 6
 import PageTable from '@/components/PageTable';
7
+import {
8
+  getMachineryTypeList,
9
+  addMachineryType,
10
+  updateMachineryType,
11
+  deleteMachineryType,
12
+} from '@/services/machineryType';
10 13
 
11 14
 const formatterTime = (val) => {
12
-  return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
15
+  return val ? moment(val).format('YYYY-MM-DD') : '';
13 16
 };
14 17
 const FormItem = Form.Item;
18
+const { Option } = Select;
19
+
15 20
 export default (props) => {
16 21
   const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
17 22
   const [loading, setLoading] = useState(false);
18 23
   const [form] = Form.useForm();
19 24
   const actionRef = useRef();
20
-  const [name, setName] = useState();
21 25
   const [selectModal, setSelectModal] = useState(false);
22
-  const [machineryTypeList, setMachineryTypeList] = useState([]);
26
+  const [typeId, setTypeId] = useState();
23 27
 
24
-  const handleName = (val) => {
25
-    setName(val);
28
+  //列表切换分类状态方法
29
+  const handleOK = (record, data) => {
30
+    const title = record.status
31
+      ? '您确定要将该分类状态变更为禁用吗? 禁用后该分类将不能登录'
32
+      : '您确定要将该分类状态变更为启用吗? 启用后该分类可以登录!';
33
+    Modal.confirm({
34
+      title: title,
35
+      okText: '确认',
36
+      cancelText: '取消',
37
+      onOk() {
38
+        updateMachineryType(record.typeId, { ...record, status: record.status === 1 ? 0 : 1 })
39
+          .then((res) => {
40
+            message.success('操作成功');
41
+            actionRef.current.reload();
42
+          })
43
+          .catch((err) => {
44
+            message.error(err);
45
+          });
46
+      },
47
+    });
26 48
   };
27
-  const changeWeight = (record) => {
49
+  const handleChange = (val) => {
28 50
     setSelectModal(true);
51
+    setTypeId(val.typeId);
52
+    form.setFieldsValue(val);
53
+  };
54
+
55
+  const handleDelete = (val) => {
56
+    deleteMachineryType(val).then(() => {
57
+      message.success('删除成功');
58
+      actionRef.current.reload();
59
+    });
60
+  };
29 61
 
30
-    // setWeight(record.weight || 0)
31
-    // setEditDetail(record)
62
+  const Submit = (data) => {
63
+    setLoading(true);
64
+    if (typeId) {
65
+      updateMachineryType(typeId, data)
66
+        .then(() => {
67
+          message.success(`修改成功`);
68
+          setLoading(false);
69
+          onCancel();
70
+          actionRef.current.reload();
71
+        })
72
+        .catch((err) => {
73
+          setLoading(false);
74
+          message.error(err.message || err);
75
+        });
76
+    } else {
77
+      addMachineryType(data)
78
+        .then(() => {
79
+          message.success(`添加成功`);
80
+          setLoading(false);
81
+          onCancel();
82
+          actionRef.current.reload();
83
+        })
84
+        .catch((err) => {
85
+          setLoading(false);
86
+          message.error(err.message || err);
87
+        });
88
+    }
89
+  };
90
+  const onCancel = () => {
91
+    form.resetFields();
92
+    setSelectModal(false);
93
+    setTypeId();
32 94
   };
33 95
   const actions = () => [
34
-    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={selectModalOpen}>
96
+    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => setSelectModal(true)}>
35 97
       新增农机分类
36 98
     </Button>,
37 99
   ];
@@ -42,68 +104,67 @@ export default (props) => {
42 104
       key: 'name',
43 105
     },
44 106
     {
45
-      title: '操作',
46
-      key: 'option',
107
+      title: '创建时间',
108
+      dataIndex: 'createDate',
109
+      key: 'createDate',
110
+      render: formatterTime,
111
+      search: false,
112
+      width: 240,
113
+    },
114
+    {
115
+      title: '状态',
116
+      dataIndex: 'status',
117
+      key: 'status',
118
+      width: 80,
119
+      search: false,
47 120
       render: (_, record) => {
48
-        return (
49
-          <Space>
50
-            <Button key={1} onClick={() => changeWeight(record)} type="link">
51
-              编辑
52
-            </Button>
53
-            <Popconfirm
54
-              key={2}
55
-              title="您是否确认删除 ?"
56
-              onConfirm={() => handleDelete(record.cooperativeId)}
57
-              okText="确定"
58
-              cancelText="取消"
59
-            >
60
-              <a href="#">删除</a>
61
-            </Popconfirm>
62
-          </Space>
63
-        );
121
+        return record.status === 1 ? '发布' : '未发布';
64 122
       },
65
-      search: false,
123
+    },
124
+    {
125
+      title: '操作',
126
+      valueType: 'option',
127
+      width: 160,
128
+      render: (_, record) => [
129
+        <Button style={{ padding: 0 }} type="link" key={1} onClick={() => handleOK(record)}>
130
+          {record.status === 0 ? '发布' : '取消发布'}
131
+        </Button>,
132
+        <Button style={{ padding: 0 }} type="link" key={2} onClick={() => handleChange(record)}>
133
+          编辑
134
+        </Button>,
135
+        <Popconfirm
136
+          key={3}
137
+          title="您是否确认删除 ?"
138
+          onConfirm={() => handleDelete(record.typeId)}
139
+          okText="确定"
140
+          cancelText="取消"
141
+        >
142
+          <Button style={{ padding: 0 }} type="link">
143
+            删除
144
+          </Button>
145
+        </Popconfirm>,
146
+      ],
66 147
     },
67 148
   ];
68
-  const handleDelete = () => { };
69
-
70
-  const Submit = () => {
71
-    setLoading(true);
72
-    editRecommend({ ...editdetail, weight }, editdetail.serialNo).then(() => {
73
-      message.success(`修改成功`);
74
-      setLoading(false);
75
-      onCancel();
76
-      setName();
77
-      actionRef.current.reload();
78
-    });
79
-  };
80
-  const selectModalOpen = () => {
81
-    setSelectModal(true);
82
-  };
83
-  const onCancel = () => {
84
-    form.resetFields();
85
-    setSelectModal(false);
86
-  };
87
-
88
-  useEffect(() => {
89
-    form.setFieldsValue({ targetName: '' });
90
-    // setPackageList();
91
-    // getResource({ pageSize: 100 }).then((res) => {
92
-    //   setMachineryTypeList(res.records || []);
93
-    // });
94
-  }, []);
95 149
   return (
96 150
     <PageHeaderWrapper>
97 151
       <Modal
98
-        title="修改"
152
+        forceRender
153
+        title="农机分类"
99 154
         visible={selectModal}
100 155
         onCancel={onCancel}
101 156
         destroyOnClose={true}
102 157
         footer={null}
103 158
       >
104 159
         <Form {...formItemLayout} onFinish={Submit} form={form}>
105
-          <FormItem label="分类名" name="name" initialValue={name}>
106
-            <Input onChange={handleName} style={{ width: '100%' }} placeholder="请输入分类名" />
160
+          <FormItem label="分类名" name="name">
161
+            <Input placeholder="请输入分类名" />
162
+          </FormItem>
163
+          <FormItem label="状态" name="status" rules={[{ required: true, message: '请选择' }]}>
164
+            <Select placeholder="请选择是否发布">
165
+              <Option value={1}>发布</Option>
166
+              <Option value={0}>未发布</Option>
167
+            </Select>
107 168
           </FormItem>
108 169
           <FormItem label=" " colon={false}>
109 170
             <Button type="default" onClick={onCancel}>
@@ -115,15 +176,16 @@ export default (props) => {
115 176
               htmlType="Submit"
116 177
               style={{ marginLeft: '4em' }}
117 178
             >
118
-              修改
179
+              确定
119 180
             </Button>
120 181
           </FormItem>
121 182
         </Form>
122 183
       </Modal>
123 184
       <PageTable
124
-        // request={getPersonList}
185
+        request={getMachineryTypeList}
125 186
         // expfunc={exportPersonList}
126 187
         toolBarRender={actions}
188
+        actionRef={actionRef}
127 189
         columns={columns}
128 190
         rowKey="typeId"
129 191
         options={false}

+ 93
- 34
src/pages/SystemManagement/Administrator/index.jsx 查看文件

@@ -1,5 +1,20 @@
1 1
 import React, { useState, useEffect, useRef } from 'react';
2
-import { Button, Popconfirm, Modal, Form, Input, message, Radio, Select, Checkbox } from 'antd';
2
+import {
3
+  Button,
4
+  Popconfirm,
5
+  Modal,
6
+  Form,
7
+  Input,
8
+  message,
9
+  Radio,
10
+  Select,
11
+  List,
12
+  Row,
13
+  Col,
14
+  Card,
15
+  Tree,
16
+  Checkbox,
17
+} from 'antd';
3 18
 import { PlusOutlined } from '@ant-design/icons';
4 19
 import { getCooperativeList } from '@/services/cooperative';
5 20
 import {
@@ -16,6 +31,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
16 31
 import PageTable from '@/components/PageTable';
17 32
 import moment from 'moment';
18 33
 import Search from '@/components/CooperativeSearch';
34
+import './index.less';
19 35
 
20 36
 const FormItem = Form.Item;
21 37
 const { Option } = Select;
@@ -39,7 +55,32 @@ export default (props) => {
39 55
   const [currentCheckbox, setCurrentCheckbox] = useState();
40 56
   //列表数据
41 57
   const actionRef = useRef();
58
+  const [data, setData] = useState([]);
59
+  const [orgId, setOrgId] = useState();
42 60
 
61
+  // 动态生成树
62
+  const handelNode = (item) => {
63
+    let node = (
64
+      <div
65
+        key={item.orgId}
66
+        style={{
67
+          justifyContent: 'space-between',
68
+          display: 'flex',
69
+          padding: '8px 0',
70
+        }}
71
+      >
72
+        <span>{item.title}</span>
73
+      </div>
74
+    );
75
+    return node;
76
+  };
77
+  const onSelect = (checkedKeys, info) => {
78
+    if (info.selected) {
79
+      setOrgId(info.node.key);
80
+    } else {
81
+      setOrgId();
82
+    }
83
+  };
43 84
   // 编辑弹窗的表单提交
44 85
   const Submit = (values) => {
45 86
     const newData = { ...values };
@@ -182,6 +223,10 @@ export default (props) => {
182 223
     //获取机构列表数据
183 224
     getCooperativeList().then((res) => {
184 225
       setCooperativeList(res.records);
226
+      const list = res.records?.map((item) => {
227
+        return { title: item.name, key: item.orgId };
228
+      });
229
+      setData(list);
185 230
     });
186 231
     //获取角色列表数据
187 232
     getRoleList().then((res) => {
@@ -233,6 +278,7 @@ export default (props) => {
233 278
       title: '邮箱',
234 279
       dataIndex: 'email',
235 280
       key: 'email',
281
+      search: false,
236 282
     },
237 283
     {
238 284
       title: '注册时间',
@@ -240,19 +286,14 @@ export default (props) => {
240 286
       key: 'createDate',
241 287
       render: formatterTime,
242 288
       search: false,
289
+      width: 160,
243 290
     },
244 291
     {
245 292
       title: '状态',
246 293
       dataIndex: 'status',
247 294
       key: 'status',
248
-      renderFormItem: () => {
249
-        return (
250
-          <Select placeholder="请选择">
251
-            <Option value={1}>启用</Option>
252
-            <Option value={0}>禁用</Option>
253
-          </Select>
254
-        );
255
-      },
295
+      width: 80,
296
+      search: false,
256 297
       render: (_, record) => {
257 298
         return record.status === 1 ? '启用' : '未启用';
258 299
       },
@@ -260,16 +301,17 @@ export default (props) => {
260 301
     {
261 302
       title: '操作',
262 303
       valueType: 'option',
304
+      width: 160,
263 305
       render: (_, record) => [
264
-        <Button type="link" key={1} onClick={() => handleOK(record)}>
306
+        <Button style={{ padding: 0 }} type="link" key={1} onClick={() => handleOK(record)}>
265 307
           {record.status === 0 ? '启用' : '禁用'}
266 308
         </Button>,
267
-        <a key={2} onClick={() => handleEdit(record)}>
309
+        <Button style={{ padding: 0 }} type="link" key={2} onClick={() => handleEdit(record)}>
268 310
           编辑
269
-        </a>,
270
-        <a key={3} onClick={() => handleRole(record)}>
311
+        </Button>,
312
+        <Button style={{ padding: 0 }} type="link" key={3} onClick={() => handleRole(record)}>
271 313
           授权角色
272
-        </a>,
314
+        </Button>,
273 315
         <Popconfirm
274 316
           key={4}
275 317
           title="您是否确认删除 ?"
@@ -277,7 +319,9 @@ export default (props) => {
277 319
           okText="确定"
278 320
           cancelText="取消"
279 321
         >
280
-          <a href="#">删除</a>
322
+          <Button style={{ padding: 0 }} type="link">
323
+            删除
324
+          </Button>
281 325
         </Popconfirm>,
282 326
       ],
283 327
     },
@@ -285,16 +329,31 @@ export default (props) => {
285 329
 
286 330
   return (
287 331
     <PageHeaderWrapper>
288
-      <PageTable
289
-        request={getUserList}
290
-        // expfunc={exportPersonList}
291
-        columns={columns}
292
-        actionRef={actionRef}
293
-        rowKey="userId"
294
-        options={false}
295
-        toolBarRender={actions}
296
-        scroll={{ x: 1000 }}
297
-      />
332
+      <Row gutter={16}>
333
+        <Col span={6}>
334
+          <Card title="机构列表">
335
+            <Tree
336
+              onSelect={onSelect}
337
+              className="treeClass"
338
+              titleRender={(data) => handelNode(data)}
339
+              treeData={data}
340
+            />
341
+          </Card>
342
+        </Col>
343
+        <Col span={18}>
344
+          <PageTable
345
+            request={getUserList}
346
+            params={{ org_id: orgId }}
347
+            // expfunc={exportPersonList}
348
+            columns={columns}
349
+            actionRef={actionRef}
350
+            rowKey="userId"
351
+            options={false}
352
+            toolBarRender={actions}
353
+            scroll={{ x: 1000 }}
354
+          />
355
+        </Col>
356
+      </Row>
298 357
       <Modal
299 358
         forceRender
300 359
         title={userId ? '人员编辑' : '人员新增'}
@@ -310,7 +369,7 @@ export default (props) => {
310 369
             <Input placeholder="请输入" />
311 370
           </FormItem>
312 371
           <FormItem label="性别" name="sex">
313
-            <Radio.Group name="sex" defaultValue={1}>
372
+            <Radio.Group>
314 373
               <Radio value={1}>男</Radio>
315 374
               <Radio value={0}>女</Radio>
316 375
             </Radio.Group>
@@ -371,7 +430,7 @@ export default (props) => {
371 430
       </Modal>
372 431
       <Modal
373 432
         forceRender
374
-        title="角色授权"
433
+        title="授权角色"
375 434
         visible={editRoleModal}
376 435
         onCancel={onRoleCancel}
377 436
         keyboard={false}
@@ -385,14 +444,14 @@ export default (props) => {
385 444
           value={currentCheckbox}
386 445
           onChange={handleCheckboxChange}
387 446
         >
388
-          {roleList.map((item) => {
389
-            return (
390
-              <div key={item.roleId}>
447
+          <List
448
+            dataSource={roleList}
449
+            renderItem={(item) => (
450
+              <List.Item>
391 451
                 <Checkbox value={item.roleId}>{item.name}</Checkbox>
392
-                <br />
393
-              </div>
394
-            );
395
-          })}
452
+              </List.Item>
453
+            )}
454
+          />
396 455
         </Checkbox.Group>
397 456
       </Modal>
398 457
     </PageHeaderWrapper>

+ 15
- 0
src/pages/SystemManagement/Administrator/index.less 查看文件

@@ -0,0 +1,15 @@
1
+@import (reference) '~antd/es/style/themes/index';
2
+
3
+.treeClass {
4
+  .ant-tree-list {
5
+    & div {
6
+      width: 100% !important;
7
+      .ant-tree-switcher-noop {
8
+        display: none !important;
9
+      }
10
+      span:nth-child(3) {
11
+        width: 100%;
12
+      }
13
+    }
14
+  }
15
+}

+ 25
- 31
src/pages/SystemManagement/BasicParameters/index.jsx 查看文件

@@ -1,41 +1,35 @@
1
-import { Input, Card, InputNumber, Button, message } from "antd"
2
-import { useEffect, useState } from 'react'
3
-import { Form } from "antd";
4
-import { history } from 'umi';
5
-import ProCard from '@ant-design/pro-card'
1
+import { Card, message } from 'antd';
2
+import { useEffect, useState } from 'react';
3
+import ProCard from '@ant-design/pro-card';
4
+import { getSetting, updateSetting } from '@/services/setting';
5
+import SettingRow from '@/components/SettingRow';
6 6
 
7
-
8
-const FormItem = Form.Item
9 7
 export default (props) => {
8
+  const [data, setData] = useState([]);
10 9
 
11
-  const [form] = Form.useForm()
12
-  const [loading, setLoading] = useState(false)
13
-
14
-  const formItemLayout = {
15
-    //布局
16
-    labelCol: { span: 6 },
17
-    wrapperCol: { span: 14 },
18
-  };
19
-
20
-  const Submit = values => {
21
-    console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
10
+  const handleChange = (item, val) => {
11
+    updateSetting(item.settingId, { ...item, settingValue: val })
12
+      .then(() => {
13
+        message.success('修改' + item.settingDesc + '成功');
14
+      })
15
+      .catch((err) => {
16
+        message.error(err.message || err);
17
+      });
22 18
   };
23
-
19
+  useEffect(() => {
20
+    getSetting().then((res) => {
21
+      setData(res.records);
22
+    });
23
+  }, []);
24 24
   return (
25
-    <Card >
25
+    <Card>
26 26
       <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
27 27
         <ProCard.TabPane key={1} tab="基本参数">
28
-          <Form {...formItemLayout} onFinish={Submit} form={form} >
29
-            <FormItem label="平台联系电话" name="shopName" rules={[{ required: true, message: '请输入' }]}>
30
-              <Input placeholder="请输入" type={"number"} maxLength={11} style={{ width: '350px' }} />
31
-            </FormItem>
32
-
33
-            <FormItem label=" " colon={false} >
34
-              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
35
-            </FormItem>
36
-          </Form>
28
+          {data.map((item) => {
29
+            return <SettingRow key={item.settingId} value={item} onChange={handleChange} />;
30
+          })}
37 31
         </ProCard.TabPane>
38 32
       </ProCard>
39 33
     </Card>
40
-  )
41
-}
34
+  );
35
+};

+ 1
- 2
src/pages/SystemManagement/Cooperative/index.jsx 查看文件

@@ -62,12 +62,11 @@ export default (props) => {
62 62
       });
63 63
   };
64 64
   // 动态生成树
65
-
66 65
   const handelNode = (item) => {
67 66
     let node = (
68 67
       <div
69 68
         key={item.orgId}
70
-        style={{ justifyContent: 'space-between', display: 'flex', width: '100%' }}
69
+        style={{ justifyContent: 'space-between', display: 'flex', padding: '8px 0' }}
71 70
         onClick={() => handleslect(item.key)}
72 71
       >
73 72
         <span>{item.title}</span>

+ 7
- 3
src/pages/SystemManagement/Region/index.jsx 查看文件

@@ -85,14 +85,16 @@ export default (props) => {
85 85
       key: 'createDate',
86 86
       render: formatterTime,
87 87
       search: false,
88
+      width: 240,
88 89
     },
89 90
     {
90 91
       title: '操作',
91 92
       valueType: 'option',
93
+      width: 160,
92 94
       render: (_, record) => [
93
-        <a key={1} onClick={() => handelEdit(record)}>
95
+        <Button type="link" style={{ padding: 0 }} key={1} onClick={() => handelEdit(record)}>
94 96
           编辑
95
-        </a>,
97
+        </Button>,
96 98
         <Popconfirm
97 99
           key={2}
98 100
           title="您是否确认删除 ?"
@@ -100,7 +102,9 @@ export default (props) => {
100 102
           okText="确定"
101 103
           cancelText="取消"
102 104
         >
103
-          <a href="#">删除</a>
105
+          <Button style={{ padding: 0 }} type="link">
106
+            删除
107
+          </Button>
104 108
         </Popconfirm>,
105 109
       ],
106 110
     },

+ 11
- 7
src/pages/SystemManagement/UserRights/index.jsx 查看文件

@@ -336,14 +336,16 @@ export default (props) => {
336 336
       dataIndex: 'createDate',
337 337
       key: 'createDate',
338 338
       render: formatterTime,
339
+      width: 160,
339 340
     },
340 341
     {
341 342
       title: '操作',
342 343
       valueType: 'option',
344
+      width: 160,
343 345
       render: (_, record) => [
344
-        <a key={1} onClick={() => handelEdit(record)}>
346
+        <Button key={1} style={{ padding: 0 }} type="link" onClick={() => handelEdit(record)}>
345 347
           编辑
346
-        </a>,
348
+        </Button>,
347 349
         <Popconfirm
348 350
           key={2}
349 351
           title="您是否确认删除 ?"
@@ -351,11 +353,13 @@ export default (props) => {
351 353
           okText="确定"
352 354
           cancelText="取消"
353 355
         >
354
-          <a href="#">删除</a>
356
+          <Button style={{ padding: 0 }} type="link">
357
+            删除
358
+          </Button>
355 359
         </Popconfirm>,
356
-        <a key={3} onClick={() => handelEmpower(record)}>
357
-          角色授权
358
-        </a>,
360
+        <Button key={3} style={{ padding: 0 }} type="link" onClick={() => handelEmpower(record)}>
361
+          授权菜单
362
+        </Button>,
359 363
       ],
360 364
     },
361 365
   ];
@@ -402,7 +406,7 @@ export default (props) => {
402 406
         </Form>
403 407
       </Modal>
404 408
       <Modal
405
-        title="角色授权"
409
+        title="授权菜单"
406 410
         visible={showModal}
407 411
         onCancel={onEmpowerCancel}
408 412
         keyboard={false}

+ 37
- 0
src/services/machineryType.js 查看文件

@@ -0,0 +1,37 @@
1
+import request from '@/utils/request';
2
+
3
+/**
4
+ * 保存农机类型
5
+ * @param {*} data
6
+ * @returns
7
+ */
8
+export const addMachineryType = (data) => request('/machinery-type', { method: 'post', data });
9
+
10
+/**
11
+ * 修改农机类型
12
+ * @param {*} data
13
+ * @returns
14
+ */
15
+export const updateMachineryType = (id, data) =>
16
+  request(`/machinery-type/${id}`, { method: 'put', data });
17
+
18
+/**
19
+ * 查询农机类型列表
20
+ * @param {*} params
21
+ * @returns
22
+ */
23
+export const getMachineryTypeList = (params) => request('/machinery-type', { params });
24
+
25
+/**
26
+ * 删除农机类型
27
+ * @param {*} data
28
+ * @returns
29
+ */
30
+export const deleteMachineryType = (id) => request(`/machinery-type/${id}`, { method: 'delete' });
31
+
32
+/**
33
+ * 查询农机类型详情
34
+ * @param {*} params
35
+ * @returns
36
+ */
37
+export const getMachineryTypeDetail = (id) => request(`/machinery-type/${id}`);

+ 14
- 0
src/services/setting.js 查看文件

@@ -0,0 +1,14 @@
1
+import request from '@/utils/request';
2
+/**
3
+ * 系统基本数据更新
4
+ * @param {*} data
5
+ * @returns
6
+ */
7
+export const updateSetting = (id, data) => request(`/setting/${id}`, { method: 'put', data });
8
+
9
+/**
10
+ * 查询系统基本信息
11
+ * @param {*} params
12
+ * @returns
13
+ */
14
+export const getSetting = (params) => request('/setting', { params });