fangmingyue 1 anno fa
parent
commit
16a5519b4b

+ 13
- 13
src/pages/adUser/index.jsx Vedi File

@@ -29,15 +29,15 @@ export default (props) => {
29 29
       title: "手机号",
30 30
       dataIndex: "phone",
31 31
     },
32
-    {
33
-      title: "标签",
34
-      dataIndex: "tag",
35
-      search: false,
36
-    },
32
+    // {
33
+    //   title: "标签",
34
+    //   dataIndex: "tag",
35
+    //   search: false,
36
+    // },
37 37
     {
38 38
       title: "状态",
39 39
       dataIndex: "status",
40
-      render: (t) => (t == 0 ? "未激活" : t == 1 ? "已激活" : "停用"),
40
+      render: (_,row) => (row.status == 0 ? "未激活" : row.status == 1 ? "已激活" : "停用"),
41 41
       valueEnum: {
42 42
         0: "未激活",
43 43
         1: "已激活",
@@ -49,15 +49,15 @@ export default (props) => {
49 49
       title: "创建时间",
50 50
       dataIndex: "createdAt",
51 51
       search: false,
52
-      render:(t)=>moment(t).format("YYYY-MM-DD HH:mm:ss")
52
+      render: (_,row)=>row.createdAt?moment(row.createdAt).format("YYYY-MM-DD HH:mm:ss"):""
53 53
     },
54 54
    
55
-    {
56
-      title: "更新时间",
57
-      dataIndex: "updatedAt",
58
-      search: false,
59
-      render:(t)=>moment(t).format("YYYY-MM-DD HH:mm:ss")
60
-    },
55
+    // {
56
+    //   title: "更新时间",
57
+    //   dataIndex: "updatedAt",
58
+    //   search: false,
59
+    //   render: (_,row)=>row.updatedAt?moment(row.updatedAt).format("YYYY-MM-DD HH:mm:ss"):""
60
+    // },
61 61
   ];
62 62
 
63 63
   return (

+ 47
- 55
src/pages/dept/components/Form.jsx Vedi File

@@ -1,101 +1,93 @@
1
-import React from "react";
2
-import { Button, Form, Input, Select } from "antd";
3
-import useBool from "@/utils/hooks/useBool";
4
-import { postDept, putDeptId } from "@/services/sysDept";
5
-import { formItemLayout, tailFormItemLayout } from "@/utils/form";
1
+import React from 'react'
2
+import { Button, Card, Form, Input, Select, InputNumber } from 'antd'
3
+import useBool from '@/utils/hooks/useBool'
4
+import { postDept, putDeptId } from '@/services/sysDept'
5
+import { formItemLayout, tailFormItemLayout } from '@/utils/form'
6 6
 
7 7
 export default (props) => {
8
-  const { dept, list, parentId, onChange } = props;
8
+  const { dept, list, parentId, onChange } = props
9
+
10
+  const [submiting, startSubmit, cancelSubmit] = useBool()
11
+  const [form] = Form.useForm()
9 12
 
10
-  const [submiting, startSubmit, cancelSubmit] = useBool();
11
-  const [form] = Form.useForm();
12 13
   const onFinish = (values) => {
13
-    startSubmit();
14
+    startSubmit()
14 15
     if (dept?.deptId) {
16
+      const deptId = dept.deptId
15 17
       // 修改
16
-      putDeptId(dept.deptId, values)
18
+      putDeptId(dept.deptId, { ...values, deptId, tenantName: 'pc.admin' })
17 19
         .then((res) => {
18
-          cancelSubmit();
19
-          onChange(res);
20
+          cancelSubmit()
21
+          onChange(res)
20 22
         })
21 23
         .catch(() => {
22
-          cancelSubmit();
23
-        });
24
+          cancelSubmit()
25
+        })
24 26
     } else {
25 27
       // 新增
26
-      postDept(values)
28
+      postDept({ ...values, tenantName: 'pc.admin' })
27 29
         .then((res) => {
28
-          cancelSubmit();
29
-          onChange(res);
30
+          cancelSubmit()
31
+          onChange(res)
30 32
         })
31 33
         .catch(() => {
32
-          cancelSubmit();
33
-        });
34
+          cancelSubmit()
35
+        })
34 36
     }
35
-  };
37
+  }
36 38
 
37 39
   React.useEffect(() => {
38
-    form.resetFields();
40
+    form.resetFields()
39 41
     if (dept) {
40
-      form.setFieldsValue(dept);
42
+      form.setFieldsValue(dept)
41 43
     } else {
42
-      form.setFieldValue("parentId", parentId);
44
+      form.setFieldValue('parentId', parentId)
43 45
     }
44
-
45
-  }, [dept, parentId]);
46
-
46
+  }, [dept, parentId])
47 47
   return (
48 48
     <Form
49 49
       form={form}
50 50
       {...formItemLayout}
51
-      style={{ maxWidth: "800px" }}
51
+      style={{ maxWidth: '800px' }}
52 52
       onFinish={onFinish}
53 53
     >
54 54
       <Form.Item
55 55
         name="deptName"
56 56
         label="部门名称"
57
-        rules={[{ required: true, message: "请填写部门名称" }]}
57
+        rules={[{ required: true, message: '请填写部门名称' }]}
58 58
       >
59 59
         <Input />
60 60
       </Form.Item>
61
-      <Form.Item
62
-        name="tenantName"
63
-        label="租户名称"
64
-        rules={[{ required: true, message: "请填写租户名称" }]}
61
+      {/* <Form.Item
62
+        name="orgId"
63
+        label="机构名称"
64
+        rules={[{ required: true, message: "请填写部门名称" }]}
65 65
       >
66
-        <Input />
67
-      </Form.Item>
68
-      <Form.Item name="parentId" label="上级单位">
69
-        <Select disabled={true}>
66
+        <Select disabled>
67
+          {(orgList || []).map((x) => (
68
+            <Select.Option key={x.orgId}>{x.name}</Select.Option>
69
+          ))}
70
+        </Select>
71
+      </Form.Item> */}
72
+      <Form.Item name="parentId" label="上级部门">
73
+        <Select disabled>
70 74
           {(list || []).map((x) => (
71 75
             <Select.Option key={x.deptId}>{x.deptName}</Select.Option>
72 76
           ))}
73 77
         </Select>
74 78
       </Form.Item>
75
-      <Form.Item
76
-        name="sortNo"
77
-        label="排序"
78
-        rules={[{ required: true, message: "请填写排序" }]}
79
-      >
80
-        <Input />
81
-      </Form.Item>
82 79
 
83
-      {/* <Form.Item
84
-        name="status"
85
-        label="状态"
86
-        initialValue={1}
87
-        rules={[{ required: true, message: "请填写状态" }]}
88
-      >
89
-        <Select style={{ width: "100%" }} placeholder="请选择状态">
90
-          <Select.Option value={0}>禁用</Select.Option>
91
-          <Select.Option value={1}>启用</Select.Option>
80
+      <Form.Item name="status" label="状态">
81
+        <Select style={{ width: '100%' }} placeholder="请选择状态">
82
+          <Select.Option value={0}>不正常</Select.Option>
83
+          <Select.Option value={1}>正常</Select.Option>
92 84
         </Select>
93
-      </Form.Item> */}
85
+      </Form.Item>
94 86
       <Form.Item {...tailFormItemLayout}>
95 87
         <Button loading={submiting} type="primary" htmlType="submit">
96 88
           保存
97 89
         </Button>
98 90
       </Form.Item>
99 91
     </Form>
100
-  );
101
-};
92
+  )
93
+}

+ 0
- 101
src/pages/dept/components/List.jsx Vedi File

@@ -1,101 +0,0 @@
1
-import React from "react";
2
-import { Modal } from "antd";
3
-import PureList from "@/components/Page/PureList";
4
-import AuthSwitch from "@/components/Auth/AuthSwitch";
5
-import Form from "./Form";
6
-import { getDept, deleteDeptId } from "@/services/sysDept";
7
-
8
-export default (props) => {
9
-  const { parentId = -1, allData, onFinish } = props;
10
-
11
-  const [current, setCurrernt] = React.useState();
12
-  const [open, setOpen] = React.useState(false);
13
-  const params = React.useMemo(() => ({ parentId }), [parentId]);
14
-  const listRef = React.useRef();
15
-
16
-  const columns = [
17
-    {
18
-      title: "部门名称",
19
-      dataIndex: "deptName",
20
-    },
21
-    {
22
-      title: "租户名称",
23
-      dataIndex: "tenantName",
24
-      search: false,
25
-    },
26
-    {
27
-      title: "排序",
28
-      dataIndex: "sortNo",
29
-      search: false,
30
-    },
31
-    // {
32
-    //   title: "状态",
33
-    //   dataIndex: "status",
34
-    //   search: false,
35
-    //   render: (_, row) => (
36
-    //     <AuthSwitch
37
-    //       checkedChildren="启用"
38
-    //       unCheckedChildren="禁用"
39
-    //       checked={row.status == 1}
40
-    //       fallback={row.status == 1 ? '启用' : '禁用'}
41
-    //       onChange={(checked) => onStatusChange(row, checked)}
42
-    //     />
43
-    //   )
44
-    // },
45
-  ];
46
-
47
-  const onStatusChange = () => {};
48
-
49
-  const onAdd = () => {
50
-    setCurrernt({ parentId });
51
-    setOpen(true);
52
-  };
53
-
54
-  const onEdit = (row) => {
55
-    setCurrernt(row);
56
-    setOpen(true);
57
-  };
58
-
59
-  const onDelete = (row) => {
60
-    deleteDeptId(row?.deptId)
61
-      .then(() => {
62
-        listRef.current.reload();
63
-      })
64
-      .catch((err) => {});
65
-  };
66
-
67
-  const handleFinish = () => {
68
-    setOpen(false);
69
-    listRef.current.reload();
70
-    onFinish();
71
-  };
72
-
73
-  return (
74
-    <>
75
-      <PureList
76
-        rowKey="deptId"
77
-        ref={listRef}
78
-        columns={columns}
79
-        request={getDept}
80
-        params={params}
81
-        onAdd={onAdd}
82
-        onEdit={onEdit}
83
-        onDelete={onDelete}
84
-      />
85
-      <Modal
86
-        title="部门维护"
87
-        open={open}
88
-        footer={null}
89
-        maskClosable={false}
90
-        onCancel={() => setOpen(false)}
91
-      >
92
-        <Form
93
-          dept={current}
94
-          parentId={parentId}
95
-          list={allData}
96
-          onChange={handleFinish}
97
-        />
98
-      </Modal>
99
-    </>
100
-  );
101
-};

+ 143
- 28
src/pages/dept/index.jsx Vedi File

@@ -1,37 +1,152 @@
1
-import React from 'react';
2
-import { Card } from 'antd';
3
-import Page from '@/components/Page';
4
-import DeptTree from '@/components/DeptTree';
5
-import List from './components/List';
1
+import React from "react";
2
+import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
3
+import { Button, Card, Row, Col, Tree, Tooltip, Popconfirm, Spin } from "antd";
4
+import Page from "@/components/Page";
5
+import { getDept, deleteDeptId } from "@/services/sysDept";
6
+import { arr2Tree } from "@/utils/array";
7
+import useBool from "@/utils/hooks/useBool";
8
+import Form from "./components/Form";
6 9
 
7 10
 export default (props) => {
11
+  const [loading, startLoading, stopLoading] = useBool();
12
+  const [list, setList] = React.useState([]);
13
+  const [current, setCurrernt] = React.useState();
14
+  const [parentId, setParentId] = React.useState();
8 15
 
9
-  const [deptList, setDeptList] = React.useState([])
10
-  const treeRef = React.useRef();
11
-  const [current, setCurrernt] = React.useState()
16
+  const [parentList, treeData] = React.useMemo(() => {
17
+    const plist = [{ deptId: "-1", deptName: "根节点" }].concat(list);
18
+    const [tree] = arr2Tree(
19
+      (list || []).map((x) => ({
20
+        title: x.deptName,
21
+        key: x.deptId,
22
+        parentId: x.parentId,
23
+        raw: x,
24
+      }))
25
+    );
26
+    return [plist, tree];
27
+  }, [list]);
12 28
 
13
-  const onFinish = () => {
14
-    treeRef.current.reload();
15
-  }
29
+  const changeCurrent = (dept) => {
30
+    setCurrernt(dept);
31
+    setParentId(dept?.deptPId || "-1");
32
+  };
16 33
 
17
-  const onSelect = (e) => {
18
-    setCurrernt(deptList.find(x => x.deptId == e))
19
-  }
34
+  const onSelect = (selectedKeys, e) => {
35
+    changeCurrent(e.node.raw);
36
+  };
20 37
 
38
+  const onClick = (dept) => {
39
+    changeCurrent(dept);
40
+  };
41
+
42
+  const onAdd = (parentId = "-1") => {
43
+    setParentId(parentId);
44
+    setCurrernt({ parentId });
45
+  };
46
+
47
+  const onDelete = (dept) => {
48
+    deleteDeptId(dept.deptId).then(() => {
49
+      queryList();
50
+    });
51
+  };
52
+
53
+  const queryList = React.useCallback(() => {
54
+    startLoading();
55
+    getDept({ pageSize: 500 }).then((res) => {
56
+      setList(res.records || []);
57
+      stopLoading();
58
+    });
59
+  }, []);
60
+
61
+  const onFormChange = () => {
62
+    // 重新查一次数据
63
+    queryList();
64
+  };
65
+
66
+  React.useEffect(() => {
67
+    queryList();
68
+  }, []);
21 69
   return (
22 70
     <Page>
23
-      <div className="flex">
24
-        {/* <Card className="flex-0" style={{ width: '480px', marginRight: '24px' }}>
25
-          <DeptTree ref={treeRef} onList={setDeptList} onSelect={onSelect} />
26
-        </Card> */}
27
-        <div className="flex-1">
28
-          <List
29
-            parentId={current?.deptId}
30
-            allData={deptList}
31
-            onFinish={onFinish}
32
-          />
33
-        </div>
34
-      </div>
71
+      <Row gutter={24}>
72
+        <Col span={8} style={{ overflow: "hidden" }}>
73
+          <Card
74
+            title="部门"
75
+            extra={
76
+              <Button type="link" onClick={() => onAdd()}>
77
+                新增
78
+              </Button>
79
+            }
80
+          >
81
+            <Spin spinning={loading}>
82
+              <Tree
83
+                blockNode
84
+                defaultExpandParent={true}
85
+                treeData={treeData}
86
+                onSelect={onSelect}
87
+                titleRender={(node) => (
88
+                  <div
89
+                    style={{ display: "flex" }}
90
+                    onClick={(e) => e.stopPropagation()}
91
+                  >
92
+                    <div
93
+                      style={{
94
+                        lineHeight: "32px",
95
+                        flex: 1,
96
+                        width: 0,
97
+                      }}
98
+                      onClick={() => onClick(node.raw)}
99
+                    >
100
+                      <div
101
+                        style={{
102
+                          overflow: "hidden",
103
+                          whiteSpace: "nowrap",
104
+                          textOverflow: "ellipsis",
105
+                        }}
106
+                      >
107
+                        {node.title}
108
+                      </div>
109
+                    </div>
110
+                    <div style={{ width: "80px", flex: "none" }}>
111
+                      <Tooltip title="新增子节点">
112
+                        <Button
113
+                          type="link"
114
+                          icon={<PlusOutlined />}
115
+                          onClick={() => onAdd(node.raw.deptId)}
116
+                        ></Button>
117
+                      </Tooltip>
118
+                      <Tooltip title="删除节点">
119
+                        <Popconfirm
120
+                          title="确认进行删除操作?"
121
+                          onConfirm={() => onDelete(node.raw)}
122
+                        >
123
+                          <Button
124
+                            type="link"
125
+                            danger
126
+                            icon={<DeleteOutlined />}
127
+                          ></Button>
128
+                        </Popconfirm>
129
+                      </Tooltip>
130
+                    </div>
131
+                  </div>
132
+                )}
133
+              />
134
+            </Spin>
135
+          </Card>
136
+        </Col>
137
+        <Col span={16}>
138
+          <Card>
139
+            {parentId && (
140
+              <Form
141
+                dept={current}
142
+                parentId={parentId}
143
+                list={parentList}
144
+                onChange={onFormChange}
145
+              />
146
+            )}
147
+          </Card>
148
+        </Col>
149
+      </Row>
35 150
     </Page>
36
-  )
37
-}
151
+  );
152
+};

+ 2
- 2
src/pages/package/Edit.jsx Vedi File

@@ -33,9 +33,9 @@ export default (props) => {
33 33
   ];
34 34
   const contentList = {
35 35
     // 套餐项目
36
-    tab1: <Package id={id} packageList={packageList} />,
36
+    tab1: <Package key="1" id={id} packageList={packageList} />,
37 37
     // 套餐内容
38
-    tab2: <PackageItem id={id}   />,
38
+    tab2: <PackageItem key="2" id={id}   />,
39 39
   };
40 40
 
41 41
   return (

+ 7
- 1
src/pages/package/components/ModalPackageItem.jsx Vedi File

@@ -13,6 +13,11 @@ import {
13 13
 import { Modal } from "antd";
14 14
 import { postTaPackageItem, putTaPackageItem } from "@/services/taPackageItem";
15 15
 import { getTaPackage } from "@/services/taPackage";
16
+const LAYOUT_TYPE_HORIZONTAL = "horizontal";
17
+const formItemLayout = {
18
+  labelCol: { span: 4 },
19
+  wrapperCol: { span: 14 },
20
+};
16 21
 export default forwardRef((props, ref) => {
17 22
   const { curd, open, setOpen } = props;
18 23
   const formRef = useRef();
@@ -70,7 +75,8 @@ export default forwardRef((props, ref) => {
70 75
       onCancel={() => setOpen(false)}
71 76
     >
72 77
       <ProForm
73
-        layout="horizontal"
78
+        {...formItemLayout}
79
+        layout={LAYOUT_TYPE_HORIZONTAL}
74 80
         formRef={formRef}
75 81
         onFinish={onFinish}
76 82
         submitter={{

+ 18
- 5
src/pages/package/components/Package.jsx Vedi File

@@ -33,9 +33,9 @@ export default (props) => {
33 33
     }
34 34
   };
35 35
 
36
-  const onChange=(file)=>{
37
-    console.log(file)
38
-  }
36
+  const onChange = (file) => {
37
+    console.log(file);
38
+  };
39 39
   return (
40 40
     <ProForm
41 41
       formRef={formRef}
@@ -51,7 +51,7 @@ export default (props) => {
51 51
       <ProFormText name="packageName" label="套餐名称" />
52 52
       <ProFormText name="packageType" label="套餐类型" />
53 53
       <ProForm.Item name="thumb" label="图片">
54
-        <UploadImage onChange={onChange}/>
54
+        <UploadImage onChange={onChange} />
55 55
       </ProForm.Item>
56 56
       <ProFormMoney name="charge" label="价格" />
57 57
       <ProFormText name="limitType" label="是否限制型消费" />
@@ -67,7 +67,20 @@ export default (props) => {
67 67
         ]}
68 68
       />
69 69
       <ProFormText name="desc" label="说明" />
70
-      <ProFormSelect name="status" label="状态" />
70
+      <ProFormSelect
71
+        name="status"
72
+        label="状态"
73
+        options={[
74
+          {
75
+            label: "下架",
76
+            value: 0,
77
+          },
78
+          {
79
+            label: "上架",
80
+            value: 1,
81
+          },
82
+        ]}
83
+      />
71 84
     </ProForm>
72 85
   );
73 86
 };

+ 2
- 1
src/pages/package/components/PackageItem.jsx Vedi File

@@ -14,6 +14,7 @@ import moment from "moment";
14 14
 import { useNavigate } from "react-router-dom";
15 15
 import ModalPackageItem from "./ModalPackageItem";
16 16
 import { Button } from "antd";
17
+import PureList from "@/components/Page/PureList";
17 18
 export default (props) => {
18 19
   const { id } = props;
19 20
   const [open, setOpen] = useState(false);
@@ -57,7 +58,7 @@ export default (props) => {
57 58
 //   const [params, setParams] = useState();
58 59
   return (
59 60
     <>
60
-      <List
61
+      <PureList
61 62
         actionRef={actionRef}
62 63
         rowKey="packageItemId"
63 64
         onEdit={(record) => onEdit(record)}

+ 8
- 8
src/pages/package/index.jsx Vedi File

@@ -21,14 +21,8 @@ export default (props) => {
21 21
       title: "图片",
22 22
       dataIndex: "thumb",
23 23
       search: false,
24
-      render: (t) => (
25
-        <Image
26
-          src={t}
27
-          height={60}
28
-          style={{ borderRadius: "15px" }}
29
-          // fallback="/image/default_1.png"
30
-        />
31
-      ),
24
+      valueType:"image"
25
+    
32 26
     },
33 27
     {
34 28
       title: "价格",
@@ -52,9 +46,15 @@ export default (props) => {
52 46
       dataIndex: "limitUnit",
53 47
       search: false,
54 48
     },
49
+
55 50
     {
56 51
       title: "状态",
57 52
       dataIndex: "status",
53
+      render:(_,row)=>row.status==0?"下架":"上架" ,
54
+      valueEnum: {
55
+        0: "下架",
56
+        1: "上架",
57
+      },
58 58
     },
59 59
 
60 60
     {

+ 0
- 1
src/pages/role/list.jsx Vedi File

@@ -9,7 +9,6 @@ import {
9 9
   putSysRoleId,
10 10
   deleteSysRoleId
11 11
 } from "@/services/sysrole";
12
-import "./style.less";
13 12
 
14 13
 const Header = (props) => {
15 14
   return (

+ 2
- 1
src/pages/role/menus.jsx Vedi File

@@ -2,6 +2,7 @@ import React from "react";
2 2
 import { Button, Card, Tree, message, Row, Col } from "antd";
3 3
 import { useModel } from "@/store";
4 4
 import { arr2Tree } from "@/utils/array";
5
+import styles from './style.module.less';
5 6
 
6 7
 export default (props) => {
7 8
   const { roleId, value, onChange, onMenuChange } = props;
@@ -107,7 +108,7 @@ export default (props) => {
107 108
   };
108 109
 
109 110
   return (
110
-    <Card title="菜单">
111
+    <Card title="菜单" className={styles.cardTree}>
111 112
       <Tree
112 113
         disabled={!roleId}
113 114
         multiple={false}

src/pages/role/style.less → src/pages/role/style.module.less Vedi File

@@ -17,11 +17,13 @@
17 17
   }
18 18
 }
19 19
 
20
-.ant-col-16{
21
-  .ant-card-body {
22
-    .ant-row {
23
-      overflow-y: scroll !important;
24
-      height: 500px !important;
20
+.cardTree {
21
+  :global(.ant-col-16) {
22
+    .ant-card-body {
23
+      .ant-row {
24
+        overflow-y: scroll !important;
25
+        max-height: 500px !important;
26
+      }
25 27
     }
26
-}
27
-}
28
+  }
29
+}

+ 97
- 0
src/pages/tenant/Edit.jsx Vedi File

@@ -0,0 +1,97 @@
1
+import React, { useEffect } from "react";
2
+import { postFxTenant, putFxTenant, getFxTenantId } from "@/services/fxtenant";
3
+import { useNavigate, useSearchParams } from "react-router-dom";
4
+import {
5
+  ProForm,
6
+  ProFormText,
7
+  ProFormDateRangePicker,
8
+  ProFormSelect,
9
+} from "@ant-design/pro-components";
10
+import { Card, Form } from "antd";
11
+import Page from "@/components/Page";
12
+import moment from "moment";
13
+export default (props) => {
14
+  const [form] = Form.useForm();
15
+  const navigate = useNavigate();
16
+  const [searchParams] = useSearchParams();
17
+  const id = searchParams.get("id");
18
+  useEffect(() => {
19
+    if (id) {
20
+      getFxTenantId(id).then((res) => {
21
+        form.setFieldsValue({
22
+          ...res,
23
+          // time:[moment(res.startTime).format("YYYY-mm-dd"),moment(res.endTime).format("YYYY-mm-dd")],
24
+          time: [res.startTime, res.endTime],
25
+          status:
26
+            res.status == 0 ? "未激活" : res.status == 1 ? "已激活" : "停用",
27
+        });
28
+      });
29
+    }
30
+  }, []);
31
+
32
+  const onFinish = (values) => {
33
+    console.log(values);
34
+    const data = {
35
+      ...values,
36
+      startTime: values?.time[0],
37
+      endTime: values?.time[1],
38
+      status: values.status == "未激活" ? 0 : values.status == "已激活" ? 1 : 2,
39
+    };
40
+    if (!id) {
41
+      postFxTenant(data).then((res) => {
42
+        navigate(-1);
43
+      });
44
+    } else {
45
+      putFxTenant(id, data).then((res) => {
46
+        navigate(-1);
47
+      });
48
+    }
49
+  };
50
+
51
+  return (
52
+    <Page>
53
+      <Card>
54
+        <ProForm form={form} onFinish={onFinish} layout="horizontal">
55
+          <ProFormText
56
+            name="tenantName"
57
+            label="租户名称"
58
+            placeholder="请输入租户名称"
59
+            rules={[{ required: true, message: "租户名称不能为空" }]}
60
+          />
61
+          <ProFormDateRangePicker
62
+            name={["time"]}
63
+            label="合同生效时间"
64
+            rules={[{ required: true, message: "合同生效时间不能为空" }]}
65
+          />
66
+          <ProFormText
67
+            name="tenantCode"
68
+            label="租户编号"
69
+            placeholder="请输入租户编号"
70
+          />
71
+
72
+          <ProFormText
73
+            name="manager"
74
+            label="管理员名称"
75
+            placeholder="请输入管理员名称"
76
+          />
77
+          <ProFormText
78
+            name="phone"
79
+            label="手机号 "
80
+            placeholder="请输入手机号"
81
+            rules={[{ required: true, message: "手机号不能为空" }]}
82
+
83
+          />
84
+          <ProFormSelect
85
+            label="状态 "
86
+            name="status"
87
+            valueEnum={{
88
+              0: "未激活",
89
+              1: "已激活",
90
+              2: "停用",
91
+            }}
92
+          />
93
+        </ProForm>
94
+      </Card>
95
+    </Page>
96
+  );
97
+};

+ 122
- 0
src/pages/tenant/index.jsx Vedi File

@@ -0,0 +1,122 @@
1
+import List from "@/components/Page/List";
2
+import React from "react";
3
+
4
+import { getFxTenant, deleteFxTenant } from "@/services/fxtenant";
5
+
6
+import { useNavigate } from "react-router-dom";
7
+import { Button } from "antd";
8
+import moment from "moment";
9
+export default (props) => {
10
+  const navigate = useNavigate();
11
+  const actionRef = React.useRef();
12
+  const columns = [
13
+    {
14
+      title: "时间",
15
+      dataIndex: "time",
16
+      valueType: "dateRange",
17
+      hideInTable: true,
18
+      search: {
19
+        transform: (value) => {
20
+          return {
21
+            startTime: value[0],
22
+            endTime: value[1],
23
+          };
24
+        },
25
+      },
26
+    },
27
+    {
28
+      title: "租户编号",
29
+      dataIndex: "tenantCode",
30
+    },
31
+    {
32
+      title: "租户名称",
33
+      dataIndex: "tenantName",
34
+    },
35
+    {
36
+      title: "开始时间",
37
+      dataIndex: "startTime",
38
+      render: (_,row) =>row.startTime? moment(row.startTime).format("YYYY-MM-DD HH:mm") :"",
39
+      search: false,
40
+    },
41
+    {
42
+      title: "结束时间",
43
+      dataIndex: "endTime",
44
+      render: (_,row) =>row.endTime? moment(row.endTime).format("YYYY-MM-DD HH:mm") :"",
45
+      search: false,
46
+    },
47
+    // {
48
+    //   title: "管理人名称",
49
+    //   dataIndex: "manager",
50
+    // },
51
+    {
52
+      title: "手机号",
53
+      dataIndex: "phone",
54
+    },
55
+    {
56
+      title: "状态",
57
+      dataIndex: "status",
58
+      valueType: "select",
59
+      render: (_, record) =>
60
+        record.status == 0 ? "未激活" : record.status == 1 ? "已激活" : "停用",
61
+      valueEnum: {
62
+        0: "未激活",
63
+        1: "已激活",
64
+        2: "停用",
65
+      },
66
+    },
67
+    // {
68
+    //   title: "创建人",
69
+    //   dataIndex: "createdBy",
70
+    //   key: "createdBy",
71
+    //   search: false,
72
+    // },
73
+    {
74
+      title: "创建时间",
75
+      dataIndex: "createdAt",
76
+      key: "createdAy",
77
+      search: false,
78
+      render: (t) => moment(t).format("YYYY-MM-DD HH:mm:ss"),
79
+      // new Date(t).toLocaleString("zh")
80
+    },
81
+    {
82
+      title: "更新人",
83
+      dataIndex: "updatedBy",
84
+      key: "updatedBy",
85
+      search: false,
86
+    },
87
+    {
88
+      title: "更新时间",
89
+      dataIndex: "updatedAt",
90
+      key: "updatedAt",
91
+      search: false,
92
+      render: (t) => moment(t).format("YYYY-MM-DD HH:mm:ss"),
93
+    },
94
+  ];
95
+
96
+  const DeleteFxUser = (record) => {
97
+    deleteFxTenant(record.tenantId).then((res) => {
98
+      actionRef.current.reload();
99
+    });
100
+  };
101
+  return (
102
+    <List
103
+      rowKey="tenantId"
104
+      actionRef={actionRef}
105
+      request={getFxTenant}
106
+      onEdit={(record) => navigate(`/tenant/edit?id=${record.tenantId}`)}
107
+      onDelete={DeleteFxUser}
108
+      toolBarRender={() => [
109
+        <Button
110
+          key="1"
111
+          type="primary"
112
+          onClick={() => {
113
+            navigate("edit");
114
+          }}
115
+        >
116
+          新增
117
+        </Button>,
118
+      ]}
119
+      columns={columns}
120
+    />
121
+  );
122
+};

+ 33
- 25
src/routes/routes.jsx Vedi File

@@ -15,7 +15,6 @@ import AdUserEdit from '@/pages/adUser/Edit'
15 15
 import Project from '@/pages/project'
16 16
 import ProjectEdit from '@/pages/project/Edit'
17 17
 import ProjectContact from '@/pages/projectContact'
18
-import ProjectDeployEdit from '@/pages/project/components/ProjectDeployEdit'
19 18
 import ProjectDeploy from '@/pages/projectDeploy'
20 19
 import ProjectNode from '@/pages/projectNode'
21 20
 
@@ -28,6 +27,8 @@ import MemberEdit from '@/pages/member/Edit'
28 27
 import Custom from '@/pages/custom'
29 28
 import CustomEdit from '@/pages/custom/Edit'
30 29
 import Finance from '@/pages/finance'
30
+import Tenant from '@/pages/tenant'
31
+import TenantEdit from '@/pages/tenant/Edit'
31 32
 
32 33
 // import RoleEdit from "@/pages/role/Edit";
33 34
 /**
@@ -81,37 +82,29 @@ export const authRoutes = [
81 82
     },
82 83
   },
83 84
   {
84
-    path: 'projectDeploy/edit',
85
-    element: <ProjectDeployEdit />,
85
+    path: 'projectContact',
86
+    element: <ProjectContact />,
86 87
     meta: {
87
-      title: '部署维护',
88
-      hideInMenu: true,
88
+      title: '项目联系人管理',
89
+      icon: <FileTextOutlined />,
89 90
     },
90 91
   },
91 92
   {
92
-    path: 'projectContact',
93
-    element: <ProjectContact />,
93
+    path: 'projectDeploy',
94
+    element: <ProjectDeploy />,
94 95
     meta: {
95
-      title: '项目联系人管理',
96
+      title: '服务器管理',
97
+      icon: <FileTextOutlined />,
98
+    },
99
+  },
100
+  {
101
+    path: 'projectNode',
102
+    element: <ProjectNode />,
103
+    meta: {
104
+      title: '流程节点管理',
96 105
       icon: <FileTextOutlined />,
97 106
     },
98 107
   },
99
-  // {
100
-  //   path: "projectDeploy",
101
-  //   element: <ProjectDeploy />,
102
-  //   meta: {
103
-  //     title: "服务器管理",
104
-  //     icon: <FileTextOutlined />,
105
-  //   },
106
-  // },
107
-  // {
108
-  //   path: "projectNode",
109
-  //   element: <ProjectNode />,
110
-  //   meta: {
111
-  //     title: "流程节点管理",
112
-  //     icon: <FileTextOutlined />,
113
-  //   },
114
-  // },
115 108
   {
116 109
     path: 'dept',
117 110
     element: <Dept />,
@@ -120,7 +113,22 @@ export const authRoutes = [
120 113
       icon: <HeartOutlined />,
121 114
     },
122 115
   },
123
-
116
+  {
117
+    path: 'tenant',
118
+    element: <Tenant />,
119
+    meta: {
120
+      title: '租户管理',
121
+      icon: <UserOutlined />,
122
+    },
123
+  },
124
+  {
125
+    path: 'tenant/edit',
126
+    element: <TenantEdit />,
127
+    meta: {
128
+      title: '租户编辑',
129
+      hideInMenu: true,
130
+    },
131
+  },
124 132
   {
125 133
     path: 'role',
126 134
     element: <Role />,

+ 26
- 0
src/services/fxTenant.js Vedi File

@@ -0,0 +1,26 @@
1
+import request from "@/utils/request";
2
+
3
+/*
4
+ * 分页查询
5
+ */
6
+export const getFxTenant = (params) => request(`/fxTenant`, { params });
7
+
8
+/*
9
+ * 新增数据
10
+ */
11
+export const postFxTenant = (data) => request('/fxTenant', { data, method: 'post' });
12
+
13
+/*
14
+ * 更新数据
15
+ */
16
+export const putFxTenant = (id, data) => request(`/fxTenant/${id}`, { data, method: 'put' });
17
+
18
+/*
19
+ * 通过主键删除数据
20
+ */
21
+export const deleteFxTenant = (id) => request(`/fxTenant/${id}`, { method: 'delete' });
22
+
23
+/*
24
+ * 通过ID查询单条数据
25
+ */
26
+export const getFxTenantId = (id) => request(`/fxTenant/${id}`);

+ 43
- 0
src/services/taMemberCard.js Vedi File

@@ -0,0 +1,43 @@
1
+import request from "@/utils/request";
2
+
3
+/**
4
+ * 部门查询
5
+ */
6
+export const getTaMemberCard = (params) =>
7
+  request("/taMemberCard", {
8
+    params,
9
+  });
10
+
11
+/**
12
+ * 新增数据
13
+ */
14
+
15
+export const postTaMemberCard = (data) => request("/taMemberCard", { method: "post", data });
16
+
17
+/**
18
+ * ID查询
19
+ */
20
+export const getTaMemberCardId = (id, data) => request(`/taMemberCard/${id}`, { data });
21
+
22
+/**
23
+ * 更新数据
24
+ */
25
+export const putTaMemberCardId = (id, data) =>
26
+  request(`/taMemberCard/${id}`, { method: "put", data });
27
+
28
+/**
29
+ * 删除数据
30
+ */
31
+export const deleteTaMemberCardId = (id) =>
32
+  request(`/taMemberCard/${id}`, { method: "delete" });
33
+
34
+  /**
35
+   * 开卡
36
+   */
37
+  export const postTaMemberCardIdActive = (cardId) =>
38
+  request(`/taMemberCard/${cardId}/active`, { method: "post" });
39
+
40
+  /**
41
+   * 核销卡
42
+   */ export const putTaMemberCardIdWrite = (cardId) =>
43
+  request(`/taMemberCard/${cardId}/write`, { method: "post" });

+ 1
- 1
vite.config.js Vedi File

@@ -11,7 +11,7 @@ export default defineConfig({
11 11
     host: "0.0.0.0",
12 12
     proxy: {
13 13
       '/api/admin': {
14
-        target: 'http://192.168.89.25:9101',
14
+        target: 'http://localhost:9101',
15 15
         changeOrigin: true,
16 16
       },
17 17
     },