first commit
This commit is contained in:
parent
22d46fe2c4
commit
5d1689ae2a
|
@ -1,6 +1,6 @@
|
|||
import { FormType } from "@/components/form/interface";
|
||||
import { UserDataType } from "@/model/userModel";
|
||||
import { DepConfig } from "@/service/user_config";
|
||||
import { CompanyConfig, DepConfig } from "@/service/user_config";
|
||||
import { ColumnsType } from "antd/lib/table";
|
||||
export const defaultConfig = [
|
||||
{
|
||||
|
@ -31,7 +31,6 @@ export const defaultConfig = [
|
|||
value: "",
|
||||
rules: [{ required: true, message: "请输入部门电话" }],
|
||||
},
|
||||
|
||||
{
|
||||
type: FormType.input,
|
||||
label: "部门邮箱",
|
||||
|
@ -48,6 +47,15 @@ export const defaultConfig = [
|
|||
key:"dep_name",
|
||||
rules: [],
|
||||
},
|
||||
{
|
||||
type: FormType.select,
|
||||
label: "所属企业",
|
||||
name: "company_id",
|
||||
value: 0,
|
||||
selectUrl:CompanyConfig.LIST,
|
||||
key:"name",
|
||||
rules: [],
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: ColumnsType<UserDataType> = [
|
||||
|
|
|
@ -2,8 +2,9 @@ import { FormType } from "@/components/form/interface";
|
|||
import { UserDataType } from "@/model/userModel";
|
||||
import { ColumnsType } from "antd/lib/table";
|
||||
import { getBirthDateAndGender } from "@/util/util";
|
||||
import { MenuConfig } from "@/service/user_config";
|
||||
|
||||
export const defaultConfig = [
|
||||
export const defaultConfig = [
|
||||
{
|
||||
type: FormType.input,
|
||||
label: "菜单名称",
|
||||
|
@ -11,12 +12,6 @@ export const defaultConfig = [
|
|||
value: "",
|
||||
rules: [{ required: true, message: "请输入名称!" }],
|
||||
},
|
||||
{
|
||||
type: FormType.upload,
|
||||
label: "图标",
|
||||
name: "icon",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
type: FormType.input,
|
||||
label: "路由",
|
||||
|
@ -38,10 +33,13 @@ export const defaultConfig = [
|
|||
value: "",
|
||||
},
|
||||
{
|
||||
type: FormType.input,
|
||||
type: FormType.select,
|
||||
label: "上级菜单",
|
||||
name: "pid",
|
||||
value: "",
|
||||
selectUrl:MenuConfig.LIST,
|
||||
key:"name",
|
||||
rules: [],
|
||||
},
|
||||
{
|
||||
type: FormType.input,
|
||||
|
@ -54,7 +52,6 @@ export const defaultConfig = [
|
|||
label: "本地图标",
|
||||
name: "local_icon",
|
||||
value: "",
|
||||
rules: [{ required: true, message: "请输入路由" }],
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -1,48 +1,23 @@
|
|||
import { Button, Space, Modal, FormInstance } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import BTable from "@/components/b_table";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { Store } from "antd/lib/form/interface";
|
||||
import React from "react";
|
||||
import { columns } from "./permission_config";
|
||||
import "./permission.less";
|
||||
|
||||
const Permission = (props: Store) => {
|
||||
const { usrStore } = props;
|
||||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
||||
const formRef = React.useRef<FormInstance>(null);
|
||||
const [userId, setId] = useState<Number | null>(null);
|
||||
|
||||
useEffect(() => {}, []);
|
||||
useEffect(() => { }, []);
|
||||
|
||||
const addHandler = () => {};
|
||||
return (
|
||||
<div className="contentBox">
|
||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||
<Button type="default" onClick={() => addHandler()}>
|
||||
添加权限
|
||||
</Button>
|
||||
<BTable
|
||||
store={usrStore}
|
||||
scroll={{ x: "max-content" }}
|
||||
columns={columns}
|
||||
dataSource={usrStore.list}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
title={!userId ? "添加权限" : "编辑权限"}
|
||||
width={800}
|
||||
open={isModalOpen}
|
||||
afterClose={() => formRef.current?.resetFields()}
|
||||
onOk={() => formRef.current?.submit()}
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
onCancel={() => {
|
||||
setId(null);
|
||||
setIsModalOpen(false);
|
||||
}}
|
||||
></Modal>
|
||||
</Space>
|
||||
<BTable
|
||||
store={usrStore}
|
||||
scroll={{ x: "max-content" }}
|
||||
columns={columns}
|
||||
dataSource={usrStore.list}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue