修改BUG 添加按钮权限
parent
9ac6566331
commit
363f6f6e37
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
module.exports={compact:!1,plugins:[["@babel/plugin-proposal-decorators",{legacy:!0}]],presets:[["@babel/preset-env",{targets:{browsers:["ie >= 10"]}}],["@babel/preset-react",{runtime:"automatic"}]]};
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"http://192.168.20.100:30140"},production:{javaGitBranch:"<branch-name>",API_HOST:"https://gbs-gateway.qhdsafety.com"}},appIdentifier:"basicInfo",contextInject:{appKey:"",fileUrl:"https://jpfz.qhdsafety.com/gbsFileTest/"},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:["https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr"]},server:{port:"8080",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,105 @@
|
|||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* isobject <https://github.com/jonschlinkert/isobject>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/** @preserve
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/
|
||||
|
||||
/** @preserve
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,79 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "micro-app",
|
||||
"version": "2.0.0",
|
||||
"description": "建教帮微应用模板",
|
||||
"author": "JJB",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"serve": "node node_modules/@cqsjjb/scripts/webpack.dev.server.js",
|
||||
"build": "node node_modules/@cqsjjb/scripts/webpack.build.js",
|
||||
"push": "jjb-cmd push java production",
|
||||
"clean-cache": "rimraf node_modules/.cache/webpack",
|
||||
"serve:development": "cross-env NODE_ENV=development npm run serve",
|
||||
"serve:production": "cross-env NODE_ENV=production npm run serve",
|
||||
"build:development": "cross-env NODE_ENV=development npm run build",
|
||||
"build:production": "cross-env NODE_ENV=production npm run build",
|
||||
"code-optimization": "node node_modules/@cqsjjb/scripts/code-optimization.js",
|
||||
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "latest",
|
||||
"@ant-design/pro-components": "^2.8.10",
|
||||
"@cqsjjb/jjb-common-decorator": "latest",
|
||||
"@cqsjjb/jjb-common-lib": "latest",
|
||||
"@cqsjjb/jjb-dva-runtime": "latest",
|
||||
"@cqsjjb/jjb-react-admin-component": "latest",
|
||||
"ahooks": "^3.9.5",
|
||||
"antd": "5.27.6",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.0.127"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.19.3",
|
||||
"@cqsjjb/scripts": "latest",
|
||||
"@eslint-react/eslint-plugin": "^2.2.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.37.0",
|
||||
"eslint-plugin-format": "^1.0.2",
|
||||
"eslint-plugin-react-hooks": "^7.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.23",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2025/11/28 08:30:50) App/basicInfo"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
|
||||
const APP_ENV = {
|
||||
antd: {
|
||||
'ant-prefix': 'micro-temp',
|
||||
fontFamily: 'PingFangSC-Regular',
|
||||
colorPrimary: '#1677ff',
|
||||
borderRadius: parseInt('2')
|
||||
},
|
||||
appKey: '',
|
||||
basename: 'basicInfo',
|
||||
API_HOST: 'https://gbs-gateway.qhdsafety.com'
|
||||
};
|
||||
APP_ENV.API_HOST = sessionStorage.API_HOST || APP_ENV.API_HOST || window.location.origin;
|
||||
window.process = {
|
||||
env: { app: APP_ENV },
|
||||
NODE_ENV: 'production'
|
||||
};
|
||||
window.__JJB_ENVIRONMENT__ = {
|
||||
API_HOST: APP_ENV.API_HOST,
|
||||
redirect: '',
|
||||
FRAMEWORK: APP_ENV.antd
|
||||
};
|
||||
})();</script><script src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr"></script><script defer="defer" src="/basicInfo/static/js/595.130d20daa4c086622151.js"></script><script defer="defer" src="/basicInfo/static/js/772.70198efca40e46c3b98b.js"></script><script defer="defer" src="/basicInfo/static/js/main.64002fd3d0290847193e.js"></script><link href="/basicInfo/static/css/main.640d8c3fc4701f655c3c.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2025/11/28 08:30:50) App/basicInfo Version/master Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>
|
||||
|
|
@ -20,7 +20,7 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
// 应用唯一标识符
|
||||
appIdentifier: "basic-info",
|
||||
appIdentifier: "basicInfo",
|
||||
// 应用上下文注入全局变量
|
||||
contextInject: {
|
||||
// 应用Key
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"qrcode.react": "^4.2.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.0.122"
|
||||
"zy-react-library": "^1.0.127"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Divider } from "antd";
|
||||
|
||||
import { Button, Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
function Info(props) {
|
||||
|
|
@ -155,7 +156,7 @@ function Info(props) {
|
|||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
children: `${info.licenseStart} 至 ${info.licenseEnd}`,
|
||||
children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "",
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
|
|
@ -192,16 +193,19 @@ function Info(props) {
|
|||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
props.history.push(`./update?id=${info.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
{props.permission("qyxx-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
props.history.push(`./update?id=${info.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(Info);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(Info));
|
||||
|
|
|
|||
|
|
@ -193,8 +193,6 @@ function Update(props) {
|
|||
values.corpStateName = getLabelName({
|
||||
status: values.corpState,
|
||||
list: ENTERPRISE_STATUS,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
values.cityName = getLabelName({
|
||||
status: values.city,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { LeftOutlined } from "@ant-design/icons";
|
||||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -7,13 +9,11 @@ import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"
|
|||
import Search from "zy-react-library/components/Search";
|
||||
import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function OrganizationStructure(props) {
|
||||
|
|
@ -21,18 +21,18 @@ function OrganizationStructure(props) {
|
|||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
eqCorpinfoId: selectedNodeId,
|
||||
};
|
||||
},
|
||||
transform: formData => ({
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
}),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
getUserInfo().then((res) => {
|
||||
|
|
@ -41,20 +41,26 @@ function OrganizationStructure(props) {
|
|||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
setSelectedNodeId(key);
|
||||
|
||||
// 核心:LeftTree 点击时提供完整路径
|
||||
const onGetNodePaths = (nodes) => {
|
||||
if (!Array.isArray(nodes) || nodes.length === 0)
|
||||
return;
|
||||
|
||||
const current = nodes[nodes.length - 1];
|
||||
setPathNodes(nodes); // 记录完整路径
|
||||
setSelectedNodeId(current.id);
|
||||
setSelectedNodeName(current.name);
|
||||
|
||||
getData();
|
||||
};
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["departmentRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
props["departmentRemove"]({ id }).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
|
|
@ -63,37 +69,56 @@ function OrganizationStructure(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 返回上一级(仅基于 pathNodes)
|
||||
const fnReturn = () => {
|
||||
if (pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")) {
|
||||
message.warning("已是顶级部门,无法继续返回");
|
||||
return;
|
||||
}
|
||||
// 移除当前节点
|
||||
const parent = pathNodes[pathNodes.length - 1];
|
||||
setSelectedNodeId(parent.parentId);
|
||||
setSelectedNodeName(parent.name);
|
||||
const newPaths = pathNodes.slice(0, -1);
|
||||
setPathNodes(newPaths);
|
||||
getData();
|
||||
};
|
||||
|
||||
const handleTableNodeClick = (record) => {
|
||||
const currentPath = pathNodes;
|
||||
// 情况1:当前路径为空(如初始化状态)
|
||||
if (currentPath.length === 0) {
|
||||
setPathNodes([record]);
|
||||
// 无法构建路径,只切换选中项
|
||||
setSelectedNodeId(record.id);
|
||||
setSelectedNodeName(record.name);
|
||||
getData();
|
||||
}
|
||||
else {
|
||||
// 安全地扩展路径
|
||||
const newPath = [...currentPath, { id: record.id, name: record.name, parentId: record.parentId }];
|
||||
|
||||
setPathNodes(newPath);
|
||||
setSelectedNodeId(record.id);
|
||||
setSelectedNodeName(record.name);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree onGetNodePaths={onGetNodePaths} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likeName",
|
||||
label: "部门名称",
|
||||
},
|
||||
{ name: "likeName", label: "部门名称" },
|
||||
{
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect dictValue="companyDepartmentLevel0000" />
|
||||
),
|
||||
render: <DictionarySelect dictValue="companyDepartmentLevel0000" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -101,14 +126,18 @@ function OrganizationStructure(props) {
|
|||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
{props.permission("zzjgqyd-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => setAddModalOpen(true)}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)}
|
||||
<Button icon={<LeftOutlined />} onClick={fnReturn}>
|
||||
返回
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
|
@ -120,49 +149,40 @@ function OrganizationStructure(props) {
|
|||
<Button
|
||||
block
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setSelectedNodeId(record.id);
|
||||
getData();
|
||||
}}
|
||||
onClick={() => handleTableNodeClick(record)}
|
||||
>
|
||||
{`${record.name}>`}
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "部门级别",
|
||||
dataIndex: "levelName",
|
||||
},
|
||||
{
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
dataIndex: "depOrder",
|
||||
},
|
||||
{ title: "部门级别", dataIndex: "levelName" },
|
||||
{ title: "部门排序", dataIndex: "depOrder" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
|
||||
{props.permission("zzjgqyd-edit")
|
||||
&& (
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("zzjgqyd-delete")
|
||||
&& (
|
||||
<Button danger type="link" onClick={() => onDelete(record.id)}>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -171,6 +191,7 @@ function OrganizationStructure(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
|
|
@ -185,36 +206,38 @@ function OrganizationStructure(props) {
|
|||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
setSelectedNodeId("");
|
||||
getData();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ====== AddModalComponent ======
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
const [levelData, setlevelData] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props
|
||||
.requestDetails({
|
||||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
if (res.success) {
|
||||
form.setFieldsValue(res.data);
|
||||
setParentName(res.data.parentName);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
}
|
||||
}, []);
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
values.levelName = getLabelName({
|
||||
status: values.level,
|
||||
|
|
@ -223,34 +246,33 @@ function AddModalComponent(props) {
|
|||
nameKey: "dictLabel",
|
||||
});
|
||||
values.parentId = props.parentId;
|
||||
|
||||
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
|
||||
message.error("部门排序请输入正整数!");
|
||||
return;
|
||||
}
|
||||
|
||||
let res;
|
||||
if (props.currentId) {
|
||||
values.parentId = props.parentId;
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("编辑成功");
|
||||
}
|
||||
});
|
||||
res = await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("新增成功");
|
||||
}
|
||||
});
|
||||
res = await props.requestAdd(values);
|
||||
}
|
||||
|
||||
if (res?.success) {
|
||||
message.success(props.currentId ? "编辑成功" : "新增成功");
|
||||
onCancel();
|
||||
}
|
||||
onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
onOk={form.submit}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
|
|
@ -267,19 +289,14 @@ function AddModalComponent(props) {
|
|||
label: "上级部门",
|
||||
render: <Tag color="processing">{parentName}</Tag>,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "部门名称",
|
||||
},
|
||||
{ name: "name", label: "部门名称" },
|
||||
{
|
||||
name: "level",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="companyDepartmentLevel0000"
|
||||
onGetData={(data) => {
|
||||
setlevelData(data);
|
||||
}}
|
||||
onGetData={data => setlevelData(data)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
|
@ -294,14 +311,8 @@ function AddModalComponent(props) {
|
|||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -310,14 +321,8 @@ function AddModalComponent(props) {
|
|||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -328,10 +333,7 @@ function AddModalComponent(props) {
|
|||
dependencies: ["superviseFlag"],
|
||||
hidden: formValues => formValues.superviseFlag === 0,
|
||||
},
|
||||
{
|
||||
name: "departmentFunction",
|
||||
label: "部门职能",
|
||||
},
|
||||
{ name: "departmentFunction", label: "部门职能" },
|
||||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
|
|
@ -339,14 +341,14 @@ function AddModalComponent(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
]}
|
||||
labelCol={{
|
||||
span: 10,
|
||||
}}
|
||||
labelCol={{ span: 10 }}
|
||||
showActionButtons={false}
|
||||
onFinish={onSubmit}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_DEPARTMENT], true)(OrganizationStructure);
|
||||
|
||||
export default Connect([NS_DEPARTMENT], true)(Permission(OrganizationStructure));
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_POST } from "~/enumerate/namespace";
|
||||
|
||||
// import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
|
|
@ -18,11 +19,12 @@ import { NS_POST } from "~/enumerate/namespace";
|
|||
function Post(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState("0");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState("");
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["postList"], {
|
||||
form,
|
||||
manual: true,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
|
|
@ -49,10 +51,17 @@ function Post(props) {
|
|||
};
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
if (key) {
|
||||
setSelectedNodeName(event.node.name);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
const onGetData = (data) => {
|
||||
if (data && data.length !== 0) {
|
||||
setSelectedNodeId(data[0].id);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div
|
||||
|
|
@ -66,7 +75,7 @@ function Post(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree onSelect={onTreeChange} onGetData={data => onGetData(data)} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -83,17 +92,21 @@ function Post(props) {
|
|||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
{props.permission("gwglqyd-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -111,22 +124,28 @@ function Post(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{props.permission("gwglqyd-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gwglqyd-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -256,4 +275,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_POST], true)(Post);
|
||||
export default Connect([NS_POST], true)(Permission(Post));
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ function Add(props) {
|
|||
<FormBuilder
|
||||
form={form}
|
||||
values={{
|
||||
departmentLeaderFlag: "0",
|
||||
departmentLeaderFlag: 0,
|
||||
}}
|
||||
loading={uploadFileLoading || props.user.userLoading}
|
||||
options={[
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -7,13 +8,13 @@ import ImportIcon from "zy-react-library/components/Icon/ImportIcon";
|
|||
import ImportFile from "zy-react-library/components/ImportFile";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
|
||||
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||
import useImportFile from "zy-react-library/hooks/useImportFile";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -36,6 +37,7 @@ function List(props) {
|
|||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
|
|
@ -118,31 +120,48 @@ function List(props) {
|
|||
}}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ImportIcon />}
|
||||
onClick={() => {
|
||||
setImportOpen(true);
|
||||
}}
|
||||
>
|
||||
导入
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ExportIcon />}
|
||||
onClick={() => onExportExcel()}
|
||||
>
|
||||
导出Excel
|
||||
</Button>
|
||||
{
|
||||
props.permission("yhglqyd-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
props.permission("yhglqyd-import")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ImportIcon />}
|
||||
onClick={() => {
|
||||
setImportOpen(true);
|
||||
}}
|
||||
>
|
||||
导入
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglqyd-export")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ExportIcon />}
|
||||
onClick={() => onExportExcel()}
|
||||
>
|
||||
导出Excel
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -167,30 +186,46 @@ function List(props) {
|
|||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{
|
||||
props.permission("yhglqyd-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglqyd-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.permission("yhglqyd-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -202,7 +237,7 @@ function List(props) {
|
|||
{importOpen && (
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl={`${process.env.app["fileUrl"]}template/user_template.xlsx`}
|
||||
templateUrl="template/user_template.xlsx"
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
|
|
@ -215,6 +250,7 @@ function List(props) {
|
|||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -227,8 +263,13 @@ function List(props) {
|
|||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
|
|
@ -272,7 +313,12 @@ function AddModalComponent(props) {
|
|||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: info.username,
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
|
|
@ -348,4 +394,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
export default Connect([NS_USER], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,58 +1,59 @@
|
|||
import Map from 'zy-react-library/components/Map';
|
||||
import Upload from 'zy-react-library/components/Upload';
|
||||
import useGetFile from 'zy-react-library/hooks/useGetFile';
|
||||
import FormBuilder from 'zy-react-library/components/FormBuilder';
|
||||
import useDeleteFile from 'zy-react-library/hooks/useDeleteFile';
|
||||
import useUploadFile from 'zy-react-library/hooks/useUploadFile';
|
||||
import IndustrySelect from 'zy-react-library/components/SelectTree/Industry';
|
||||
import DictionarySelect from 'zy-react-library/components/SelectTree/Dictionary';
|
||||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, QRCode } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import Map from "zy-react-library/components/Map";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import IndustrySelect from "zy-react-library/components/SelectTree/Industry";
|
||||
|
||||
import { Connect } from '@cqsjjb/jjb-dva-runtime';
|
||||
import { getLabelName } from 'zy-react-library/utils';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { FORM_ITEM_RENDER_ENUM } from 'zy-react-library/enum/formItemRender';
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from 'zy-react-library/enum/uploadFile/gwj';
|
||||
import { Button, Form, message, Modal, QRCode } from 'antd';
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
import {
|
||||
PHONE,
|
||||
POSTAL_CODE,
|
||||
UNIFIED_SOCIAL_CREDIT_CODE
|
||||
} from 'zy-react-library/regular';
|
||||
UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
} from "zy-react-library/regular";
|
||||
|
||||
import { useDebounce } from '~/utils';
|
||||
import { NS_ENTERPRISE } from '~/enumerate/namespace';
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
bianma: 'filialstate01',
|
||||
name: '在产'
|
||||
bianma: "filialstate01",
|
||||
name: "在产",
|
||||
},
|
||||
{
|
||||
bianma: 'filialstate02',
|
||||
name: '在建'
|
||||
bianma: "filialstate02",
|
||||
name: "在建",
|
||||
},
|
||||
{
|
||||
bianma: 'filialstate03',
|
||||
name: '代建'
|
||||
bianma: "filialstate03",
|
||||
name: "代建",
|
||||
},
|
||||
{
|
||||
bianma: 'filialstate04',
|
||||
name: '停产'
|
||||
bianma: "filialstate04",
|
||||
name: "停产",
|
||||
},
|
||||
{
|
||||
bianma: 'filialstate05',
|
||||
name: '破产'
|
||||
}
|
||||
bianma: "filialstate05",
|
||||
name: "破产",
|
||||
},
|
||||
];
|
||||
const WHETHER_ENUM = [
|
||||
{
|
||||
bianma: 1,
|
||||
name: '是'
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: '否'
|
||||
}
|
||||
name: "否",
|
||||
},
|
||||
];
|
||||
// const xgfStateMap = {
|
||||
// 0: "未填报",
|
||||
|
|
@ -68,14 +69,15 @@ function CorpInfo(props) {
|
|||
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
|
||||
const [keyId, setKeyId] = useState({});
|
||||
const [scaleData, setScaleData] = useState([]);
|
||||
const [ecoTypeData, setEcoTypeData] = useState([]);
|
||||
const [industryData, setIndustryData] = useState([]);
|
||||
const [cityData, setCityData] = useState([]);
|
||||
const [info, setInfoData] = useState([]);
|
||||
const [codeValue, setCodeValue] = useState('');
|
||||
const [corpNameValue, setCorpNameValue] = useState('');
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
function getLastValidCorpTypeName(item) {
|
||||
|
|
@ -84,75 +86,74 @@ function CorpInfo(props) {
|
|||
item.corpType,
|
||||
item.corpType2,
|
||||
item.corpType3,
|
||||
item.corpType4
|
||||
item.corpType4,
|
||||
];
|
||||
|
||||
// 从后往前找第一个非空值
|
||||
for (let i = names.length - 1; i >= 0; i--) {
|
||||
if (names[i] != null && names[i] !== '') {
|
||||
if (names[i] != null && names[i] !== "") {
|
||||
return names[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 全为空则返回空字符串或默认值
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props['userGetInfo']();
|
||||
const { data } = await props['corpInfoDetails']({
|
||||
id: res.data.corpinfoId
|
||||
const res = await props["userGetInfo"]();
|
||||
const { data } = await props["corpInfoDetails"]({
|
||||
id: res.data.corpinfoId,
|
||||
});
|
||||
setInfoData(data);
|
||||
setKeyId({
|
||||
id: res.data.corpinfoId,
|
||||
corpinfoId: res.data.userId
|
||||
corpinfoId: res.data.userId,
|
||||
});
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM['6'],
|
||||
eqForeignKey: res.data.userId ? res.data.userId : ''
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.userId ? res.data.userId : "",
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
data.scaleType = data.scaleType ?? 0;
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data
|
||||
...data,
|
||||
};
|
||||
form.setFieldsValue({
|
||||
...values
|
||||
...values,
|
||||
});
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const onSubmit = async values => {
|
||||
const onSubmit = async (values) => {
|
||||
await deleteFile({
|
||||
single: false,
|
||||
files: deleteHiddenImageFiles
|
||||
files: deleteHiddenImageFiles,
|
||||
});
|
||||
values.ecoTypeName = getLabelName({
|
||||
status: values.ecoType,
|
||||
list: ecoTypeData,
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
values.scaleName = getLabelName({
|
||||
status: values.scale,
|
||||
list: scaleData,
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
values.corpStateName = getLabelName({
|
||||
status: values.corpState,
|
||||
list: ENTERPRISE_STATUS,
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
|
||||
});
|
||||
values.cityName = getLabelName({
|
||||
status: values.city,
|
||||
list: cityData,
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
if (industryData.length > 0) {
|
||||
values.corpType = industryData[0].dict_value;
|
||||
|
|
@ -168,18 +169,19 @@ function CorpInfo(props) {
|
|||
single: false,
|
||||
files: values.licenseFile,
|
||||
params: {
|
||||
type: UPLOAD_FILE_TYPE_ENUM['6'],
|
||||
foreignKey: keyId.corpinfoId
|
||||
}
|
||||
type: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
foreignKey: keyId.corpinfoId,
|
||||
},
|
||||
});
|
||||
values.corpinfoId = keyId.corpinfoId;
|
||||
values.id = keyId.id;
|
||||
values.licenseStart = values.license[0];
|
||||
values.licenseEnd = values.license[1];
|
||||
delete values.license;
|
||||
props['corpInfoEdit'](values).then(res => {
|
||||
props["corpInfoEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success('操作成功!');
|
||||
message.success("操作成功!");
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -189,22 +191,22 @@ function CorpInfo(props) {
|
|||
if (!debouncedCode) {
|
||||
form.setFields([
|
||||
{
|
||||
name: 'code',
|
||||
errors: []
|
||||
}
|
||||
name: "code",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props['corplnfoCheckCorpcode']({
|
||||
props["corplnfoCheckCorpcode"]({
|
||||
code: debouncedCode,
|
||||
id: keyId.id
|
||||
}).then(res => {
|
||||
id: keyId.id,
|
||||
}).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([
|
||||
{
|
||||
name: 'code',
|
||||
errors: ['该社会统一信用代码已被其他企业使用']
|
||||
}
|
||||
name: "code",
|
||||
errors: ["该社会统一信用代码已被其他企业使用"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
|
@ -215,251 +217,253 @@ function CorpInfo(props) {
|
|||
if (!debouncedCorpName) {
|
||||
form.setFields([
|
||||
{
|
||||
name: 'corpName',
|
||||
errors: []
|
||||
}
|
||||
name: "corpName",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props['corplnfoCheckCorpName']({
|
||||
props["corplnfoCheckCorpName"]({
|
||||
corpName: debouncedCorpName,
|
||||
id: keyId.id
|
||||
}).then(res => {
|
||||
id: keyId.id,
|
||||
}).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([
|
||||
{
|
||||
name: 'corpName',
|
||||
errors: ['企业名称重复']
|
||||
}
|
||||
name: "corpName",
|
||||
errors: ["企业名称重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
const onValuesChange = changed => {
|
||||
if ('code' in changed) setCodeValue(changed.code ?? '');
|
||||
if ('corpName' in changed) setCorpNameValue(changed.corpName ?? '');
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
paddingBottom: 10
|
||||
paddingBottom: 10,
|
||||
}}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
loading={
|
||||
deleteFileLoading ||
|
||||
uploadFileLoading ||
|
||||
getFileLoading ||
|
||||
props.enterprise.enterpriseLoading
|
||||
deleteFileLoading
|
||||
|| uploadFileLoading
|
||||
|| getFileLoading
|
||||
|| props.enterprise.enterpriseLoading
|
||||
}
|
||||
options={[
|
||||
{
|
||||
label: '基本信息',
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER
|
||||
label: "基本信息",
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER,
|
||||
},
|
||||
{
|
||||
label: '企业名称',
|
||||
name: 'corpName',
|
||||
label: "企业名称",
|
||||
name: "corpName",
|
||||
span: 24,
|
||||
componentProps: {
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '企业状态',
|
||||
name: 'corpState',
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '社会统一信用代码',
|
||||
name: 'code',
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
rules: [
|
||||
{
|
||||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: '请输入正确的社会统一信用代码'
|
||||
}
|
||||
]
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '所属区域',
|
||||
label: "所属区域",
|
||||
required: false,
|
||||
name: 'city',
|
||||
name: "city",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="res_region_enum"
|
||||
onGetData={data => {
|
||||
onGetData={(data) => {
|
||||
setCityData(data);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '邮政编码',
|
||||
name: 'postalCode',
|
||||
label: "邮政编码",
|
||||
name: "postalCode",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: POSTAL_CODE,
|
||||
message: '请输入正确的邮政编码'
|
||||
}
|
||||
]
|
||||
message: "请输入正确的邮政编码",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '规模',
|
||||
name: 'scale',
|
||||
label: "规模",
|
||||
name: "scale",
|
||||
required: false,
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="scale"
|
||||
onGetData={data => {
|
||||
onGetData={(data) => {
|
||||
setScaleData(data);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '成立时间',
|
||||
name: 'createDate',
|
||||
label: "成立时间",
|
||||
name: "createDate",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
{
|
||||
name: 'map',
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
render: <Map required={false} />,
|
||||
span: 24
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: '职工人数',
|
||||
name: 'employees',
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
label: "职工人数",
|
||||
name: "employees",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: '占地面积(㎡)',
|
||||
name: 'areaCovered',
|
||||
label: "占地面积(㎡)",
|
||||
name: "areaCovered",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: '注册资金(万元)',
|
||||
name: 'regcapital',
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
label: "注册资金(万元)",
|
||||
name: "regcapital",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: '资产总额(万元)',
|
||||
name: 'totalAssets',
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
label: "资产总额(万元)",
|
||||
name: "totalAssets",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: '经济类型',
|
||||
name: 'ecoType',
|
||||
label: "经济类型",
|
||||
name: "ecoType",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
onGetData={data => {
|
||||
onGetData={(data) => {
|
||||
setEcoTypeData(data);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '所属行业',
|
||||
name: 'INDUSTRYALL',
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
render: (
|
||||
<IndustrySelect
|
||||
onGetNodePaths={data => {
|
||||
onGetNodePaths={(data) => {
|
||||
console.log(data);
|
||||
setIndustryData(data);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '法定代表人',
|
||||
name: 'lrName',
|
||||
required: false
|
||||
label: "法定代表人",
|
||||
name: "lrName",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
label: '法人手机号',
|
||||
name: 'lrMobile',
|
||||
label: "法人手机号",
|
||||
name: "lrMobile",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: '请输入正确的手机号'
|
||||
}
|
||||
]
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '主要负责人',
|
||||
name: 'contacts'
|
||||
label: "主要负责人",
|
||||
name: "contacts",
|
||||
},
|
||||
{
|
||||
label: '主要负责人手机号',
|
||||
name: 'contactsPhone',
|
||||
label: "主要负责人手机号",
|
||||
name: "contactsPhone",
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: '请输入正确的手机号'
|
||||
}
|
||||
]
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '安全负责人',
|
||||
name: 'safetyName',
|
||||
required: false
|
||||
label: "安全负责人",
|
||||
name: "safetyName",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
label: '安全负责人电话手机号',
|
||||
name: 'safetyPhone',
|
||||
label: "安全负责人电话手机号",
|
||||
name: "safetyPhone",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: '请输入正确的手机号'
|
||||
}
|
||||
]
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '是否规模以上',
|
||||
name: 'scaleType',
|
||||
label: "是否规模以上",
|
||||
name: "scaleType",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: '企事业单位经营地址',
|
||||
name: 'addressBusiness'
|
||||
label: "企事业单位经营地址",
|
||||
name: "addressBusiness",
|
||||
},
|
||||
{
|
||||
label: '营业执照',
|
||||
name: 'licenseFile',
|
||||
label: "营业执照",
|
||||
name: "licenseFile",
|
||||
render: (
|
||||
<Upload
|
||||
onGetRemoveFile={file => {
|
||||
onGetRemoveFile={(file) => {
|
||||
setDeleteHiddenImageFiles([
|
||||
...deleteHiddenImageFiles,
|
||||
file
|
||||
file,
|
||||
]);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '营业执照有效期',
|
||||
name: 'license',
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE
|
||||
label: "营业执照有效期",
|
||||
name: "license",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
{
|
||||
name: 'qrCode',
|
||||
label: '企业二维码',
|
||||
name: "qrCode",
|
||||
label: "企业二维码",
|
||||
required: false,
|
||||
render: (
|
||||
<Button
|
||||
|
|
@ -470,8 +474,8 @@ function CorpInfo(props) {
|
|||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
),
|
||||
},
|
||||
// { label: "单位资质信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
// { name: "qualification", customizeRender: true, span: 24, render: <Qualification /> },
|
||||
]}
|
||||
|
|
@ -489,7 +493,7 @@ function CorpInfo(props) {
|
|||
</>
|
||||
);
|
||||
}
|
||||
const CorpInfoQrCode = props => {
|
||||
const CorpInfoQrCode = (props) => {
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
|
|
@ -500,20 +504,20 @@ const CorpInfoQrCode = props => {
|
|||
onClick={props.onCancel}
|
||||
>
|
||||
关闭
|
||||
</Button>
|
||||
</Button>,
|
||||
]}
|
||||
onCancel={props.onCancel}
|
||||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({
|
||||
corpName: props.row.corpName,
|
||||
corpinfoId: props.row.corpinfoId
|
||||
corpinfoId: props.row.corpinfoId,
|
||||
})}
|
||||
style={{
|
||||
margin: '0 auto'
|
||||
margin: "0 auto",
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
export default Connect([NS_ENTERPRISE], true)(CorpInfo);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(CorpInfo));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { LeftOutlined } from "@ant-design/icons";
|
||||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -5,15 +7,15 @@ import FormBuilder from "zy-react-library/components/FormBuilder";
|
|||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
|
|
@ -22,6 +24,8 @@ function Department(props) {
|
|||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
|
|
@ -40,11 +44,7 @@ function Department(props) {
|
|||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
|
|
@ -61,6 +61,54 @@ function Department(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
// 核心:LeftTree 点击时提供完整路径
|
||||
const onGetNodePaths = (nodes) => {
|
||||
if (!Array.isArray(nodes) || nodes.length === 0)
|
||||
return;
|
||||
|
||||
const current = nodes[nodes.length - 1];
|
||||
setPathNodes(nodes); // 记录完整路径
|
||||
setSelectedNodeId(current.id);
|
||||
setSelectedNodeName(current.name);
|
||||
|
||||
getData();
|
||||
};
|
||||
|
||||
// 返回上一级(仅基于 pathNodes)
|
||||
const fnReturn = () => {
|
||||
if (pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")) {
|
||||
message.warning("已是顶级部门,无法继续返回");
|
||||
return;
|
||||
}
|
||||
// 移除当前节点
|
||||
const parent = pathNodes[pathNodes.length - 1];
|
||||
setSelectedNodeId(parent.parentId);
|
||||
setSelectedNodeName(parent.name);
|
||||
const newPaths = pathNodes.slice(0, -1);
|
||||
setPathNodes(newPaths);
|
||||
getData();
|
||||
};
|
||||
|
||||
const handleTableNodeClick = (record) => {
|
||||
const currentPath = pathNodes;
|
||||
// 情况1:当前路径为空(如初始化状态)
|
||||
if (currentPath.length === 0) {
|
||||
setPathNodes([record]);
|
||||
// 无法构建路径,只切换选中项
|
||||
setSelectedNodeId(record.id);
|
||||
setSelectedNodeName(record.name);
|
||||
getData();
|
||||
}
|
||||
else {
|
||||
// 安全地扩展路径
|
||||
const newPath = [...currentPath, { id: record.id, name: record.name, parentId: record.parentId }];
|
||||
|
||||
setPathNodes(newPath);
|
||||
setSelectedNodeId(record.id);
|
||||
setSelectedNodeName(record.name);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -73,7 +121,7 @@ function Department(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree onGetNodePaths={onGetNodePaths} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -99,14 +147,23 @@ function Department(props) {
|
|||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
{" "}
|
||||
{
|
||||
props.permission("bmglxgf-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
<Button icon={<LeftOutlined />} onClick={fnReturn}>
|
||||
返回
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
|
@ -118,18 +175,15 @@ function Department(props) {
|
|||
<Button
|
||||
block
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setSelectedNodeId(record.id);
|
||||
getData();
|
||||
}}
|
||||
onClick={() => handleTableNodeClick(record)}
|
||||
>
|
||||
{`${record.name}>`}
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
title: "部门级别",
|
||||
dataIndex: "levelName",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
|
|
@ -140,23 +194,33 @@ function Department(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{
|
||||
props.permission("bmglxgf-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("bmglxgf-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -180,7 +244,6 @@ function Department(props) {
|
|||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
setSelectedNodeId("");
|
||||
getData();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -346,4 +409,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_DEPARTMENT], true)(Department);
|
||||
export default Connect([NS_DEPARTMENT], true)(Permission(Department));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -5,14 +6,14 @@ import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
|||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -107,15 +108,21 @@ function List(props) {
|
|||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
{
|
||||
props.permission("yhglxgf-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -144,56 +151,86 @@ function List(props) {
|
|||
width: 600,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(
|
||||
`./SpecialPersonnel?id=${record.id}&corpinfoId=${record.corpinfoId}`,
|
||||
);
|
||||
}}
|
||||
>
|
||||
特种作业人员证书
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(
|
||||
`./SecurityPersonnel?id=${record.id}&corpinfoId=${record.corpinfoId}`,
|
||||
);
|
||||
}}
|
||||
>
|
||||
安全人员证书
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{
|
||||
props.permission("yhglxgf-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-special")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(
|
||||
`./SpecialPersonnel?id=${record.id}&corpinfoId=${record.corpinfoId}`,
|
||||
);
|
||||
}}
|
||||
>
|
||||
特种作业人员证书
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-safety")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(
|
||||
`./SecurityPersonnel?id=${record.id}&corpinfoId=${record.corpinfoId}`,
|
||||
);
|
||||
}}
|
||||
>
|
||||
安全人员证书
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("hglxgf-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -349,4 +386,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
export default Connect([NS_USER], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -9,17 +10,17 @@ import Table from "zy-react-library/components/Table";
|
|||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
function SecurityPersonnel(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
|
@ -119,15 +120,20 @@ function Department(props) {
|
|||
loading={getFileLoading}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
{
|
||||
props.permission("yhglxgf-safety-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -180,22 +186,32 @@ function Department(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{
|
||||
props.permission("yhglxgf-safety-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-safety-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -217,6 +233,15 @@ function Department(props) {
|
|||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
onSuccess={(userQualificationinfoId) => {
|
||||
console.log(userQualificationinfoId);
|
||||
// 清除该记录的图片缓存,强制下次 render 时重新加载
|
||||
setFileCache((prev) => {
|
||||
const newCache = { ...prev };
|
||||
delete newCache[userQualificationinfoId];
|
||||
return newCache;
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -279,6 +304,7 @@ function AddModalComponent(props) {
|
|||
values.id = props.currentId;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
await props.requestEdit(values);
|
||||
props.onSuccess(userQualificationinfoId);
|
||||
}
|
||||
else {
|
||||
values.userQualificationinfoId = id;
|
||||
|
|
@ -355,4 +381,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Permission(SecurityPersonnel));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -10,17 +11,17 @@ import Table from "zy-react-library/components/Table";
|
|||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
function SpecialPersonnel(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
|
@ -121,15 +122,20 @@ function Department(props) {
|
|||
loading={getFileLoading}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
{
|
||||
props.permission("yhglxgf-special-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -190,22 +196,34 @@ function Department(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
|
||||
{
|
||||
props.permission("yhglxgf-special-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("hglxgf-special-delete")
|
||||
&& (
|
||||
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -229,6 +247,14 @@ function Department(props) {
|
|||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
onSuccess={(userQualificationinfoId) => {
|
||||
// 清除该记录的图片缓存,强制下次 render 时重新加载
|
||||
setFileCache((prev) => {
|
||||
const newCache = { ...prev };
|
||||
delete newCache[userQualificationinfoId];
|
||||
return newCache;
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -300,6 +326,7 @@ function AddModalComponent(props) {
|
|||
values.id = props.currentId;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
await props.requestEdit(values);
|
||||
props.onSuccess(userQualificationinfoId);
|
||||
}
|
||||
else {
|
||||
values.userQualificationinfoId = id;
|
||||
|
|
@ -402,4 +429,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Permission(SpecialPersonnel));
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
|
@ -181,16 +181,23 @@ function List(props) {
|
|||
<Table
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
toolBarRender={() => (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setOpenType("add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
<>
|
||||
{
|
||||
props.permission("zgszhgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setOpenType("add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{
|
||||
|
|
@ -239,56 +246,90 @@ function List(props) {
|
|||
width: 550,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setOpenType("edit");
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setOpenType("editName");
|
||||
}}
|
||||
>
|
||||
修改分公司名称
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => fnIsEnable(record)}
|
||||
>
|
||||
{record.useFlag === 1
|
||||
? "停用"
|
||||
: record.useFlag === 0
|
||||
? "启用"
|
||||
: ""}
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{" "}
|
||||
{
|
||||
props.permission("zgszhgl-edit")
|
||||
&& (
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setOpenType("edit");
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-editName")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setOpenType("editName");
|
||||
}}
|
||||
>
|
||||
修改分公司名称
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.permission("zhgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.permission("zhgl-editFlag")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => fnIsEnable(record)}
|
||||
>
|
||||
{record.useFlag === 1
|
||||
? "停用"
|
||||
: record.useFlag === 0
|
||||
? "启用"
|
||||
: ""}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -498,4 +539,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -151,6 +151,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
hidden: !(props.permission("zgsbmgl-list")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
@ -171,4 +172,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function View(props) {
|
||||
|
|
@ -61,21 +62,20 @@ function View(props) {
|
|||
title: "部门名称",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门级别",
|
||||
dataIndex: "name",
|
||||
},
|
||||
|
||||
{
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
dataIndex: "depOrder",
|
||||
title: "部门级别",
|
||||
dataIndex: "name",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
hidden: !(props.permission("zgsbmgl-info")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
@ -182,4 +182,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_DEPARTMENT], true)(View);
|
||||
export default Connect([NS_DEPARTMENT], true)(Permission(View));
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import MapSelector from "zy-react-library/components/Map/MapSelector";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
|
|
@ -116,7 +116,7 @@ function List(props) {
|
|||
{
|
||||
label: "所属区域",
|
||||
required: false,
|
||||
name: "city",
|
||||
name: "eqCity",
|
||||
render: <DictionarySelect dictValue="res_region_enum" />,
|
||||
},
|
||||
{
|
||||
|
|
@ -257,18 +257,28 @@ function List(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => handleOpen(record)}
|
||||
>
|
||||
定位
|
||||
</Button>
|
||||
{
|
||||
props.permission("zgsqyxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zgsqyxxgl-location")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => handleOpen(record)}
|
||||
>
|
||||
定位
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -287,4 +297,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
children: `${info.licenseStart} 至 ${info.licenseEnd}`,
|
||||
children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "",
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
|
|
@ -113,6 +114,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
hidden: !(props.permission("zgsyhgl-info")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
@ -131,4 +133,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import Table from "zy-react-library/components/Table";
|
|||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ function List(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -93,6 +93,7 @@ function List(props) {
|
|||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -104,7 +105,11 @@ function List(props) {
|
|||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
useEffect(() => {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
|
|
@ -115,6 +120,7 @@ function AddModalComponent(props) {
|
|||
filePath: res.data.userAvatarUrl,
|
||||
},
|
||||
];
|
||||
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -147,7 +153,13 @@ function AddModalComponent(props) {
|
|||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: info.username,
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -89,8 +89,10 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
hidden: !(props.permission("qyyhzt-info")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
|
|
@ -98,6 +100,7 @@ function List(props) {
|
|||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -107,4 +110,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
|||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -153,6 +153,7 @@ function List(props) {
|
|||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -164,8 +165,12 @@ function List(props) {
|
|||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
|
|
@ -207,7 +212,12 @@ function AddModalComponent(props) {
|
|||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: info.username,
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
|
||||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
|
|
@ -109,15 +110,20 @@ function List(props) {
|
|||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
<>
|
||||
{props.permission("gszhxxgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{
|
||||
|
|
@ -145,34 +151,46 @@ function List(props) {
|
|||
width: 350,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{props.permission("gszhxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gszhxxgl-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gszhxxgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gszhxxgl-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -355,4 +373,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -15,6 +15,15 @@ function View(props) {
|
|||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false);
|
||||
const queryParams = useGetUrlQuery();
|
||||
const getCorpTypeNamePath = (item) => {
|
||||
const names = [
|
||||
item.corpTypeName,
|
||||
item.corpType2Name,
|
||||
item.corpType3Name,
|
||||
item.corpType4Name,
|
||||
].filter(name => name != null && name !== "");
|
||||
return names.join("/");
|
||||
};
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoDetails({
|
||||
|
|
@ -68,7 +77,7 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
children: info.companyArea,
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
},
|
||||
{
|
||||
label: "企业规模",
|
||||
|
|
@ -152,7 +161,7 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
children: `${info.licenseStart} 至 ${info.licenseEnd}`,
|
||||
children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "",
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function Department(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 2,
|
||||
eqUserId: queryParams["id"],
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
|
@ -83,6 +84,8 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 150,
|
||||
hidden: !(props.permission("tszyzsgl-list")),
|
||||
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
@ -101,4 +104,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function Department(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
eqUserId: queryParams["id"],
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
|
@ -83,6 +84,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 150,
|
||||
hidden: !(props.permission("aqryzsglgfd-list")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
@ -101,4 +103,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
|
@ -83,6 +84,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 150,
|
||||
hidden: !(props.permission("ryxxgl-list")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
@ -101,4 +103,4 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -64,7 +66,7 @@ function List(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -74,8 +76,17 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likeUsername",
|
||||
label: "用户名",
|
||||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "likeUserIdCard",
|
||||
label: "身份证号",
|
||||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -98,26 +109,37 @@ function List(props) {
|
|||
title: "岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
{props.permission("ryxxgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("ryxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -132,6 +154,7 @@ function List(props) {
|
|||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -141,11 +164,16 @@ function List(props) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
useEffect(() => {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
|
|
@ -162,9 +190,11 @@ function AddModalComponent(props) {
|
|||
res.data.userImg = userImg;
|
||||
res.data.cardImg = cardImg;
|
||||
console.log(res.data);
|
||||
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
|
@ -203,7 +233,12 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "用户角色",
|
||||
children: info.username,
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
|
|
@ -278,4 +313,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
export default Connect([NS_USER], true)(Permission(List));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -5,20 +6,22 @@ import FormBuilder from "zy-react-library/components/FormBuilder";
|
|||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
|
||||
import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
|
|
@ -29,10 +32,22 @@ function Department(props) {
|
|||
};
|
||||
},
|
||||
});
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
getUserInfo().then((res) => {
|
||||
setSelectedNodeName(res.departmentName);
|
||||
});
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
if (key) {
|
||||
setSelectedNodeName(event.node.name);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
|
|
@ -88,15 +103,21 @@ function Department(props) {
|
|||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
{
|
||||
props.permission("jgzzjg-add")
|
||||
&& (
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -110,6 +131,7 @@ function Department(props) {
|
|||
onClick={() => {
|
||||
setSelectedNodeId(record.id);
|
||||
getData();
|
||||
setSelectedNodeName(record.name);
|
||||
}}
|
||||
>
|
||||
{`${record.name}>`}
|
||||
|
|
@ -129,23 +151,33 @@ function Department(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{
|
||||
props.permission("jgzzjg-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("jgzzjg-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -164,6 +196,7 @@ function Department(props) {
|
|||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
selectedNodeName={selectedNodeName}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -188,6 +221,9 @@ function AddModalComponent(props) {
|
|||
setParentName(res.data.parentName);
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
|
|
@ -233,6 +269,8 @@ function AddModalComponent(props) {
|
|||
span={24}
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
superviseFlag: 0,
|
||||
|
||||
}}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -319,4 +357,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_DEPARTMENT], true)(Department);
|
||||
export default Connect([NS_DEPARTMENT], true)(Permission(Department));
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { NS_POST } from "~/enumerate/namespace";
|
||||
|
||||
function Post(props) {
|
||||
|
|
@ -21,6 +21,7 @@ function Post(props) {
|
|||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["postList"], {
|
||||
form,
|
||||
manual: true,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
|
|
@ -47,10 +48,17 @@ function Post(props) {
|
|||
};
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
if (key) {
|
||||
setSelectedNodeName(event.node.name);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
const onGetData = (data) => {
|
||||
if (data && data.length !== 0) {
|
||||
setSelectedNodeId(data[0].id);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div
|
||||
|
|
@ -64,7 +72,7 @@ function Post(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree onSelect={onTreeChange} onGetData={data => onGetData(data)} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -83,15 +91,20 @@ function Post(props) {
|
|||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
{
|
||||
props.permission("gwgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -109,22 +122,33 @@ function Post(props) {
|
|||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
{
|
||||
props.permission("gwgl-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.permission("gwgl-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -254,4 +278,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_POST], true)(Post);
|
||||
export default Connect([NS_POST], true)(Permission(Post));
|
||||
|
|
|
|||
|
|
@ -264,8 +264,8 @@ function Add(props) {
|
|||
<FormBuilder
|
||||
form={form}
|
||||
values={{
|
||||
departmentLeaderFlag: "0",
|
||||
deputyLeaderFlag: "0",
|
||||
departmentLeaderFlag: 0,
|
||||
deputyLeaderFlag: 0,
|
||||
}}
|
||||
loading={uploadFileLoading || props.user.userLoading}
|
||||
options={[
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
@ -11,12 +12,11 @@ import Search from "zy-react-library/components/Search";
|
|||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||
import useImportFile from "zy-react-library/hooks/useImportFile";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ function List(props) {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "personnelType",
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
},
|
||||
|
|
@ -165,55 +165,75 @@ function List(props) {
|
|||
}}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="primary"
|
||||
icon={<DeleteIcon />}
|
||||
onClick={() => {
|
||||
if (!selectedRowKeys.length)
|
||||
return message.warning("请选择要删除的行");
|
||||
Modal.confirm({
|
||||
title: "确定删除吗?",
|
||||
onOk: async () => {
|
||||
await props["userRemoveIds"]({
|
||||
ids: selectedRowKeys.join(","),
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-batchDelete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="primary"
|
||||
icon={<DeleteIcon />}
|
||||
onClick={() => {
|
||||
if (!selectedRowKeys.length)
|
||||
return message.warning("请选择要删除的行");
|
||||
Modal.confirm({
|
||||
title: "确定删除吗?",
|
||||
onOk: async () => {
|
||||
await props["userRemoveIds"]({
|
||||
ids: selectedRowKeys.join(","),
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
批量删除
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ImportIcon />}
|
||||
onClick={() => {
|
||||
setImportOpen(true);
|
||||
}}
|
||||
>
|
||||
导入
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ExportIcon />}
|
||||
onClick={() => onExportExcel()}
|
||||
>
|
||||
导出Excel
|
||||
</Button>
|
||||
}}
|
||||
>
|
||||
批量删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-import")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ImportIcon />}
|
||||
onClick={() => {
|
||||
setImportOpen(true);
|
||||
}}
|
||||
>
|
||||
导入
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-export")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ExportIcon />}
|
||||
onClick={() => onExportExcel()}
|
||||
>
|
||||
导出Excel
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -246,36 +266,57 @@ function List(props) {
|
|||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
|
||||
{
|
||||
props.permission("zhgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -287,7 +328,7 @@ function List(props) {
|
|||
{importOpen && (
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl={`${process.env.app["fileUrl"]}template/user_template.xlsx`}
|
||||
templateUrl="template/user_template.xlsx"
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
|
|
@ -300,6 +341,7 @@ function List(props) {
|
|||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -312,7 +354,12 @@ function List(props) {
|
|||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
|
|
@ -355,7 +402,12 @@ function AddModalComponent(props) {
|
|||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: info.username,
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
|
|
@ -431,4 +483,4 @@ function AddModalComponent(props) {
|
|||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
export default Connect([NS_USER], true)(Permission(List));
|
||||
|
|
|
|||
Loading…
Reference in New Issue