添加 组织架构图
parent
363f6f6e37
commit
f88c8573d8
BIN
basicInfo.zip
BIN
basicInfo.zip
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
module.exports={compact:!1,plugins:[["@babel/plugin-proposal-decorators",{legacy:!0}]],presets:[["@babel/preset-env",{targets:{browsers:["ie >= 10"]}}],["@babel/preset-react",{runtime:"automatic"}]]};
|
||||
|
|
@ -1 +0,0 @@
|
|||
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
|
|
@ -1,105 +0,0 @@
|
|||
/*!
|
||||
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
|
|
@ -1,79 +0,0 @@
|
|||
/*! 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
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<!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>
|
||||
|
|
@ -16,7 +16,8 @@ module.exports = {
|
|||
// 应用后端分支名称,部署上线需要
|
||||
javaGitBranch: "<branch-name>",
|
||||
// 接口服务地址
|
||||
API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
// API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
API_HOST: "http://192.168.20.100:30140",
|
||||
},
|
||||
},
|
||||
// 应用唯一标识符
|
||||
|
|
@ -25,8 +26,8 @@ module.exports = {
|
|||
contextInject: {
|
||||
// 应用Key
|
||||
appKey: "",
|
||||
// fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
// fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
},
|
||||
// public/index.html注入全局变量
|
||||
windowInject: {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@
|
|||
"qrcode.react": "^4.2.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.0.127"
|
||||
"relation-graph": "^2.2.11",
|
||||
"zy-react-library": "^1.0.134"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const corpQualificationInfoList = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/list",
|
||||
"Post > @/basicInfo/corpQualificationInfo/list",
|
||||
);
|
||||
export const corpQualificationInfoDetails = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/info/{id}",
|
||||
"Post > @/basicInfo/corpQualificationInfo/info/{id}",
|
||||
);
|
||||
export const corpQualificationInfoAdd = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/save",
|
||||
"Post > @/basicInfo/corpQualificationInfo/save",
|
||||
);
|
||||
export const corpQualificationInfoEdit = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/edit",
|
||||
"Post > @/basicInfo/corpQualificationInfo/edit",
|
||||
);
|
||||
export const corpQualificationInfoRemove = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/remove/{id}",
|
||||
"Post > @/basicInfo/corpQualificationInfo/remove/{id}",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,26 +2,32 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const departmentList = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/list",
|
||||
"Post > @/basicInfo/department/list",
|
||||
);
|
||||
export const departmentAdd = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/save",
|
||||
"Post > @/basicInfo/department/save",
|
||||
);
|
||||
export const departmentEdit = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/edit",
|
||||
"Post > @/basicInfo/department/edit",
|
||||
);
|
||||
export const departmentDetails = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/info/{id}",
|
||||
"Post > @/basicInfo/department/info/{id}",
|
||||
);
|
||||
export const departmentRemove = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/remove/{id}",
|
||||
"Post > @/basicInfo/department/remove/{id}",
|
||||
);
|
||||
// 获取当前登录人信息
|
||||
export const userGetInfo = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Get > /basic-info/user/getInfo",
|
||||
"Get > /basicInfo/user/getInfo",
|
||||
);
|
||||
export const corpDepartlist = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/corpInfo/corpDepartlist",
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,55 +2,59 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const corpInfoList = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/list",
|
||||
"Post > @/basicInfo/corpInfo/list",
|
||||
);
|
||||
export const corpInfoDetails = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/info/{id}",
|
||||
"Post > @/basicInfo/corpInfo/info/{id}",
|
||||
);
|
||||
export const corpInfoAdd = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/save",
|
||||
"Post > @/basicInfo/corpInfo/save",
|
||||
);
|
||||
export const corpInfoEdit = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/edit",
|
||||
"Post > @/basicInfo/corpInfo/edit",
|
||||
);
|
||||
export const corpInfoChangePassword = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/changePassword/{id}",
|
||||
"Post > @/basicInfo/corpInfo/changePassword/{id}",
|
||||
);
|
||||
export const corpInfoChangeCompanyName = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/changeCompanyName",
|
||||
"Post > @/basicInfo/corpInfo/changeCompanyName",
|
||||
);
|
||||
export const corpInfoChangeUseFlag = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/changeUseFlag",
|
||||
"Post > @/basicInfo/corpInfo/changeUseFlag",
|
||||
);
|
||||
export const corpInfoRemove = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/remove/{id}",
|
||||
"Post > @/basicInfo/corpInfo/remove/{id}",
|
||||
);
|
||||
export const corpInfoRemoveMultiple = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/ids",
|
||||
"Post > @/basicInfo/corpInfo/ids",
|
||||
);
|
||||
export const corpUserMiddlePage = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/corpUserMiddlePage",
|
||||
"Post > @/basicInfo/corpInfo/corpUserMiddlePage",
|
||||
);
|
||||
|
||||
// 获取当前登录人信息
|
||||
export const userGetInfo = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Get > /basic-info/user/getInfo",
|
||||
"Get > /basicInfo/user/getInfo",
|
||||
);
|
||||
export const corplnfoCheckCorpcode = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/checkCorpCode",
|
||||
"Post > @/basicInfo/corpInfo/checkCorpCode",
|
||||
);
|
||||
export const corplnfoCheckCorpName = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/checkCorpName",
|
||||
"Post > @/basicInfo/corpInfo/checkCorpName",
|
||||
);
|
||||
export const corpDepartlist = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basicInfo/corpInfo/corpDepartlist",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,23 +2,23 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const userQualificationInfoList = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Post > @/basic-info/userQualificationInfo/list",
|
||||
"Post > @/basicInfo/userQualificationInfo/list",
|
||||
);
|
||||
export const userQualificationInfoDetails = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Get > /basic-info/userQualificationInfo/getInfoById?id={id}",
|
||||
"Get > /basicInfo/userQualificationInfo/getInfoById?id={id}",
|
||||
);
|
||||
export const userQualificationInfoAdd = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Post > @/basic-info/userQualificationInfo/save",
|
||||
"Post > @/basicInfo/userQualificationInfo/save",
|
||||
);
|
||||
export const userQualificationInfoEdit = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Put > @/basic-info/userQualificationInfo/edit",
|
||||
"Put > @/basicInfo/userQualificationInfo/edit",
|
||||
);
|
||||
export const userQualificationInfoRemove = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Put > @/basic-info/userQualificationInfo/remove?id={id}",
|
||||
"Put > @/basicInfo/userQualificationInfo/remove?id={id}",
|
||||
);
|
||||
export const dictData = declareRequest(
|
||||
"userLoading",
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const postList = declareRequest(
|
||||
"postLoading",
|
||||
"Post > @/basic-info/post/list",
|
||||
"Post > @/basicInfo/post/list",
|
||||
);
|
||||
export const postAdd = declareRequest(
|
||||
"postLoading",
|
||||
"Post > @/basic-info/post/save",
|
||||
"Post > @/basicInfo/post/save",
|
||||
);
|
||||
export const postEdit = declareRequest(
|
||||
"postLoading",
|
||||
"Put > @/basic-info/post/edit",
|
||||
"Put > @/basicInfo/post/edit",
|
||||
);
|
||||
export const postDetails = declareRequest(
|
||||
"postLoading",
|
||||
"Get > /basic-info/post/getInfoById?id={id}",
|
||||
"Get > /basicInfo/post/getInfoById?id={id}",
|
||||
);
|
||||
export const postRemove = declareRequest(
|
||||
"postLoading",
|
||||
"Put > @/basic-info/post/remove?id={id}",
|
||||
"Put > @/basicInfo/post/remove?id={id}",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,35 +2,41 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const userList = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/list",
|
||||
"Post > @/basicInfo/user/list",
|
||||
);
|
||||
|
||||
export const userXgfList = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basicInfo/user/listXgf",
|
||||
);
|
||||
|
||||
export const userAdd = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/save",
|
||||
"Post > @/basicInfo/user/save",
|
||||
);
|
||||
export const userEdit = declareRequest(
|
||||
"userLoading",
|
||||
"Put > @/basic-info/user/edit",
|
||||
"Put > @/basicInfo/user/edit",
|
||||
);
|
||||
export const userDetails = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /basic-info/user/{id}",
|
||||
"Get > /basicInfo/user/{id}",
|
||||
);
|
||||
export const userSaveXgfAdd = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/saveXgf",
|
||||
"Post > @/basicInfo/user/saveXgf",
|
||||
);
|
||||
export const userRemove = declareRequest(
|
||||
"userLoading",
|
||||
"Delete > @/basic-info/user/{id}",
|
||||
"Delete > @/basicInfo/user/{id}",
|
||||
);
|
||||
export const userRemoveIds = declareRequest(
|
||||
"userLoading",
|
||||
"Delete > @/basic-info/user/ids?ids={ids}",
|
||||
"Delete > @/basicInfo/user/ids?ids={ids}",
|
||||
);
|
||||
export const postAll = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/post/listAll",
|
||||
"Post > @/basicInfo/post/listAll",
|
||||
);
|
||||
// 获取角色
|
||||
export const rolesAll = declareRequest(
|
||||
|
|
@ -43,15 +49,21 @@ export const dictData = declareRequest(
|
|||
);
|
||||
export const userEmploymentLogAll = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /basic-info/userEmploymentLog/listAll",
|
||||
"Get > /basicInfo/userEmploymentLog/listAll",
|
||||
);
|
||||
export const userChangePassword = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/changePassword/{id}",
|
||||
"Post > @/basicInfo/user/changePassword/{id}",
|
||||
);
|
||||
|
||||
// 校验用户名 手机号 身份证号是否重复
|
||||
export const verifyUser = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/verifyUser",
|
||||
"Post > @/basicInfo/user/verifyUser",
|
||||
);
|
||||
|
||||
// 根据登录密码获取手机号 身份证号
|
||||
export const getEncryInfo = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basicInfo/user/getEncryInfo",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,181 @@
|
|||
export const MySelector = ({ small, data, onChange, currentValue }) => {
|
||||
return (
|
||||
<div className="flex flex-wrap justify-center rounded-lg border border-gray-900 overflow-hidden">
|
||||
{data.map(item => (
|
||||
<div
|
||||
key={item.value}
|
||||
className={`border-r w-auto text-xs cursor-pointer whitespace-nowrap ${
|
||||
currentValue === item.value ? "bg-blue-500 text-white" : ""
|
||||
} ${small ? "px-2 h-6 leading-6" : "h-8 px-3 leading-8"}`}
|
||||
onClick={() => onChange(item.value, item.text)}
|
||||
>
|
||||
{item.text}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const MySwitch = ({ onChange, currentValue }) => {
|
||||
return (
|
||||
<div
|
||||
className={`w-14 flex rounded-full border p-0.5 ${
|
||||
currentValue ? "justify-end border-blue-500" : "justify-start border-gray-500"
|
||||
}`}
|
||||
>
|
||||
<div
|
||||
className={`w-8 h-5 rounded-full px-3 text-xs cursor-pointer whitespace-nowrap ${
|
||||
currentValue ? "bg-blue-500" : "bg-gray-500"
|
||||
}`}
|
||||
onClick={() => onChange(!currentValue)}
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const MySlider = ({ min, max, step, currentValue, onChange }) => {
|
||||
return (
|
||||
<div>
|
||||
<input
|
||||
type="range"
|
||||
className="w-72"
|
||||
min={min}
|
||||
max={max}
|
||||
step={step}
|
||||
value={currentValue}
|
||||
onChange={e => onChange(Number.parseFloat(e.target.value))}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const MyRangeSlider = ({ min, max, step, currentValue, onChange }) => {
|
||||
return (
|
||||
<div className="w-72">
|
||||
<div>Min:</div>
|
||||
<input
|
||||
type="range"
|
||||
className="w-full"
|
||||
min={min}
|
||||
max={max}
|
||||
step={step}
|
||||
value={currentValue[0]}
|
||||
onChange={(e) => {
|
||||
const val = Number.parseFloat(e.target.value);
|
||||
if (val < currentValue[1]) {
|
||||
onChange([val, currentValue[1]]);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<div>Max:</div>
|
||||
<input
|
||||
type="range"
|
||||
className="w-full"
|
||||
min={min}
|
||||
max={max}
|
||||
step={step}
|
||||
value={currentValue[1]}
|
||||
onChange={(e) => {
|
||||
const val = Number.parseFloat(e.target.value);
|
||||
if (val > currentValue[0]) {
|
||||
onChange([currentValue[0], val]);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const MyButton = ({ children, onClick, disabled }) => {
|
||||
return (
|
||||
<button
|
||||
className={`mr-2 px-2 py-1 rounded ${
|
||||
disabled === true
|
||||
? "bg-gray-300 text-black cursor-not-allowed"
|
||||
: "bg-blue-500 hover:bg-blue-700 text-white"
|
||||
}`}
|
||||
onClick={onClick}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export const MyLinkButton = ({ children, onClick }) => {
|
||||
return (
|
||||
<div
|
||||
className="text-blue-600 cursor-pointer underline decoration-1"
|
||||
onClick={onClick}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const MyCheckBox = ({ data, onChange, currentValue }) => {
|
||||
return (
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{data.map(thisItem => (
|
||||
<div
|
||||
key={thisItem.value}
|
||||
className={`px-1 py-0.5 flex justify-center place-items-center rounded-sm text-sm cursor-pointer hover:bg-gray-300 ${
|
||||
currentValue === thisItem.value ? "text-blue-600" : "text-gray-500"
|
||||
}`}
|
||||
onClick={() => onChange(thisItem.value, thisItem.text)}
|
||||
>
|
||||
<div
|
||||
className={`w-4 h-4 mr-1 rounded-full ${
|
||||
currentValue === thisItem.value
|
||||
? "border border-blue-500 bg-blue-500 text-blue-600"
|
||||
: "border border-gray-500 text-gray-500"
|
||||
}`}
|
||||
>
|
||||
</div>
|
||||
{thisItem.text}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const MyMultiCheckBox = ({ data, onChange, currentValue }) => {
|
||||
const onClickItem = (itemValue) => {
|
||||
const newValue = currentValue.includes(itemValue)
|
||||
? currentValue.filter(value => value !== itemValue)
|
||||
: [...currentValue, itemValue];
|
||||
onChange(newValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{data.map(thisItem => (
|
||||
<div
|
||||
key={thisItem.value}
|
||||
className={`px-1 py-0.5 flex justify-center place-items-center rounded-sm text-sm cursor-pointer hover:bg-gray-300 ${
|
||||
currentValue.includes(thisItem.value) ? "text-blue-600" : "text-gray-500"
|
||||
}`}
|
||||
onClick={() => onClickItem(thisItem.value)}
|
||||
>
|
||||
<div
|
||||
className={`w-4 h-4 mr-1 rounded-full ${
|
||||
currentValue.includes(thisItem.value)
|
||||
? "border border-blue-500 bg-blue-500 text-blue-600"
|
||||
: "border border-gray-500 text-gray-500"
|
||||
}`}
|
||||
>
|
||||
</div>
|
||||
{thisItem.text}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const ElMessage = (messageObject) => {
|
||||
console.warn(messageObject);
|
||||
};
|
||||
|
||||
export const ElNotification = (messageObject) => {
|
||||
console.warn(messageObject);
|
||||
};
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
import RelationGraph from "relation-graph/react";
|
||||
import { MySwitch } from "./RGDemoComponents/MyUIComponents";
|
||||
|
||||
const ExpandAnimation = (departmentData) => {
|
||||
const graphRef = useRef(null);
|
||||
const [relayout, setRelayout] = useState(true);
|
||||
|
||||
const graphOptions = {
|
||||
layout: {
|
||||
layoutName: "tree",
|
||||
min_per_width: 80,
|
||||
max_per_width: 150,
|
||||
min_per_height: 200,
|
||||
},
|
||||
defaultNodeShape: 1,
|
||||
defaultNodeWidth: 130,
|
||||
defaultLineShape: 2,
|
||||
defaultJunctionPoint: "tb",
|
||||
defaultNodeBorderWidth: 0,
|
||||
defaultLineColor: "rgba(0, 186, 189, 1)",
|
||||
defaultNodeColor: "rgba(0, 206, 209, 1)",
|
||||
defaultNodeHeight: 70,
|
||||
reLayoutWhenExpandedOrCollapsed: true,
|
||||
defaultExpandHolderPosition: "bottom",
|
||||
zoomToFitWhenRefresh: true,
|
||||
useAnimationWhenExpanded: true,
|
||||
debug: false,
|
||||
};
|
||||
|
||||
function convertDeptTreeToGraphData(deptTreeArray) {
|
||||
const nodes = [];
|
||||
const lines = [];
|
||||
|
||||
function walk(node, parentId = null, level = 0) {
|
||||
nodes.push({
|
||||
id: node.id,
|
||||
text: node.name,
|
||||
expanded: true,
|
||||
width: level === 0 ? 260 : undefined,
|
||||
|
||||
});
|
||||
|
||||
if (parentId !== null) {
|
||||
lines.push({ from: parentId, to: node.id });
|
||||
}
|
||||
|
||||
if (node.childrenList && node.childrenList.length > 0) {
|
||||
node.childrenList.forEach((child) => {
|
||||
walk(child, node.id, level + 1); // 传入下一层级
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let rootId = null;
|
||||
deptTreeArray.forEach((rootNode) => {
|
||||
if (rootId === null)
|
||||
rootId = rootNode.id;
|
||||
walk(rootNode, null, 0); // 根节点 level = 0
|
||||
});
|
||||
|
||||
return {
|
||||
rootId,
|
||||
nodes,
|
||||
lines,
|
||||
};
|
||||
}
|
||||
|
||||
const showHTree = async () => {
|
||||
const graphInstance = graphRef.current?.getInstance();
|
||||
if (graphInstance) {
|
||||
await graphInstance.setOptions(graphOptions);
|
||||
await graphInstance.setJsonData(convertDeptTreeToGraphData(departmentData.data));
|
||||
await graphInstance.playShowEffect();
|
||||
}
|
||||
};
|
||||
|
||||
const syncOptionsToGraph = () => {
|
||||
const instance = graphRef.current?.getInstance();
|
||||
if (instance) {
|
||||
instance.options.reLayoutWhenExpandedOrCollapsed = relayout;
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
showHTree();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
syncOptionsToGraph();
|
||||
}, [relayout]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ height: "70vh" }}>
|
||||
<div className="w-96 rounded-lg absolute left-20 top-20 z-20 p-4 bg-white border-solid border-2 border-black shadow-lg">
|
||||
<MySwitch
|
||||
data={[
|
||||
{ value: true, text: "Re-layout" },
|
||||
{ value: false, text: "Do not re-layout" },
|
||||
]}
|
||||
currentValue={relayout}
|
||||
onChange={(newValue) => {
|
||||
setRelayout(newValue);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<RelationGraph ref={graphRef} options={graphOptions} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ExpandAnimation;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from "react";
|
||||
|
||||
/**
|
||||
* 全局上下文定义
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { defineNamespace } from '@cqsjjb/jjb-dva-runtime';
|
||||
import { defineNamespace } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
/**
|
||||
* 全局数据状态管理模块定义
|
||||
*/
|
||||
|
||||
export const NS_GLOBAL = defineNamespace('global');
|
||||
export const NS_ENTERPRISE = defineNamespace('enterprise');
|
||||
export const NS_DEPARTMENT = defineNamespace('department');
|
||||
export const NS_POST = defineNamespace('post');
|
||||
export const NS_USER = defineNamespace('user');
|
||||
export const NS_PERSNONEL_CERTFICATE = defineNamespace('personnelCertificate');
|
||||
export const NS_BUSINESSLICENSE = defineNamespace('businessLicense');
|
||||
export const NS_GLOBAL = defineNamespace("global");
|
||||
export const NS_ENTERPRISE = defineNamespace("enterprise");
|
||||
export const NS_DEPARTMENT = defineNamespace("department");
|
||||
export const NS_POST = defineNamespace("post");
|
||||
export const NS_USER = defineNamespace("user");
|
||||
export const NS_PERSNONEL_CERTFICATE = defineNamespace("personnelCertificate");
|
||||
export const NS_BUSINESSLICENSE = defineNamespace("businessLicense");
|
||||
|
|
|
|||
31
src/main.js
31
src/main.js
|
|
@ -1,15 +1,16 @@
|
|||
import dayjs from 'dayjs';
|
||||
import { setJJBCommonAntdMessage } from "@cqsjjb/jjb-common-lib";
|
||||
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import { setup } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
import { setup } from '@cqsjjb/jjb-dva-runtime';
|
||||
import { message } from 'antd';
|
||||
import { setJJBCommonAntdMessage } from '@cqsjjb/jjb-common-lib';
|
||||
import { message } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import "dayjs/locale/zh-cn";
|
||||
|
||||
import '../blessed_by_buddha';
|
||||
import "../blessed_by_buddha";
|
||||
|
||||
require('antd/dist/reset.css');
|
||||
dayjs.locale('zh-cn');
|
||||
require("antd/dist/reset.css");
|
||||
|
||||
dayjs.locale("zh-cn");
|
||||
setJJBCommonAntdMessage(message);
|
||||
const app = setup();
|
||||
|
||||
|
|
@ -17,9 +18,9 @@ const app = setup();
|
|||
if (!window.__POWERED_BY_QIANKUN__) {
|
||||
// 云组件默认依赖
|
||||
window.__coreLib = {};
|
||||
window.__coreLib.React = require('react');
|
||||
window.__coreLib.ReactDOM = require('react-dom');
|
||||
window.__coreLib.jjbCommonLib = require('@cqsjjb/jjb-common-lib');
|
||||
window.__coreLib.React = require("react");
|
||||
window.__coreLib.ReactDOM = require("react-dom");
|
||||
window.__coreLib.jjbCommonLib = require("@cqsjjb/jjb-common-lib");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -27,11 +28,11 @@ if (!window.__POWERED_BY_QIANKUN__) {
|
|||
* @param props {{ setGlobalState: ({ rendered: boolean }) => void }}
|
||||
* @returns {Promise<*>} ''
|
||||
*/
|
||||
export const mount = async props => {
|
||||
export const mount = async (props) => {
|
||||
// 云组件默认依赖
|
||||
window.__coreLib.React = require('react');
|
||||
window.__coreLib.ReactDOM = require('react-dom');
|
||||
window.__coreLib.jjbCommonLib = require('@cqsjjb/jjb-common-lib');
|
||||
window.__coreLib.React = require("react");
|
||||
window.__coreLib.ReactDOM = require("react-dom");
|
||||
window.__coreLib.jjbCommonLib = require("@cqsjjb/jjb-common-lib");
|
||||
app.mount(props);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
import { Button, Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
|
|
@ -12,6 +12,7 @@ import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
|||
function Info(props) {
|
||||
const [info, setInfo] = useState({});
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
|
||||
const getCorpTypeNamePath = (item) => {
|
||||
const names = [
|
||||
item.corpTypeName,
|
||||
|
|
@ -21,6 +22,17 @@ function Info(props) {
|
|||
].filter(name => name != null && name !== "");
|
||||
return names.join("/");
|
||||
};
|
||||
const getAreaNamePath = (item) => {
|
||||
const names = [
|
||||
item.provinceName,
|
||||
item.cityName,
|
||||
item.countryName,
|
||||
item.streetName,
|
||||
item.villageName,
|
||||
|
||||
].filter(name => name != null && name !== "");
|
||||
return names.join("/");
|
||||
};
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const { data } = await props["userGetInfo"]();
|
||||
|
|
@ -58,13 +70,10 @@ function Info(props) {
|
|||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属区域",
|
||||
children: info.cityName,
|
||||
children: <div>{getAreaNamePath(info)}</div>,
|
||||
},
|
||||
{
|
||||
label: "邮政编码",
|
||||
|
|
@ -74,17 +83,29 @@ function Info(props) {
|
|||
label: "成立时间",
|
||||
children: info.createDate,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
children: info.scaleName,
|
||||
},
|
||||
{
|
||||
label: "经度",
|
||||
children: info.longitude,
|
||||
label: "是否规模以上",
|
||||
children: (
|
||||
<div>
|
||||
{info.scaleType === 1
|
||||
? "是"
|
||||
: info.scaleType === 0
|
||||
? "否"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "纬度",
|
||||
children: info.latitude,
|
||||
label: "经度/纬度",
|
||||
children: info.longitude && `${info.longitude}/${info.latitude}`,
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
|
|
@ -94,18 +115,19 @@ function Info(props) {
|
|||
label: "占地面积(㎡)",
|
||||
children: info.areaCovered,
|
||||
},
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
children: info.regcapital,
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
//
|
||||
// {
|
||||
// label: "经济类型",
|
||||
// children: info.ecoTypeName,
|
||||
// },
|
||||
{
|
||||
label: "所属行业",
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
|
|
@ -134,25 +156,14 @@ function Info(props) {
|
|||
label: "安全负责人手机号",
|
||||
children: info.safetyPhone,
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
children: (
|
||||
<div>
|
||||
{info.scaleType === 1
|
||||
? "是"
|
||||
: info.scaleType === 0
|
||||
? "否"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
},
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
children: <PreviewImg files={info.licenseFile} />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
|
|||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Map from "zy-react-library/components/Map";
|
||||
import AreaSelect from "zy-react-library/components/SelectTree/Area";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import IndustrySelect from "zy-react-library/components/SelectTree/Industry";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
|
|
@ -65,7 +66,6 @@ function Update(props) {
|
|||
const [form] = Form.useForm();
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [scaleData, setScaleData] = useState([]);
|
||||
const [ecoTypeData, setEcoTypeData] = useState([]);
|
||||
const [cityData, setCityData] = useState([]);
|
||||
const [industryData, setIndustryData] = useState([]);
|
||||
const [keyId, setKeyId] = useState("");
|
||||
|
|
@ -83,6 +83,7 @@ function Update(props) {
|
|||
id: queryParams["id"],
|
||||
});
|
||||
setKeyId(data.corpinfoId);
|
||||
data.region = data.village || data.street || data.country || data.city || data.province;
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: data.corpinfoId,
|
||||
|
|
@ -178,12 +179,7 @@ function Update(props) {
|
|||
files: deleteLicenseImageFiles,
|
||||
});
|
||||
values.id = queryParams["id"];
|
||||
values.ecoTypeName = getLabelName({
|
||||
status: values.ecoType,
|
||||
list: ecoTypeData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
|
||||
values.scaleName = getLabelName({
|
||||
status: values.scale,
|
||||
list: scaleData,
|
||||
|
|
@ -194,12 +190,19 @@ function Update(props) {
|
|||
status: values.corpState,
|
||||
list: ENTERPRISE_STATUS,
|
||||
});
|
||||
values.cityName = getLabelName({
|
||||
status: values.city,
|
||||
list: cityData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
|
||||
if (cityData.length > 0) {
|
||||
values.province = cityData[0].value;
|
||||
values.provinceName = cityData[0].label;
|
||||
values.city = cityData[1] && cityData[1].value;
|
||||
values.cityName = cityData[1] && cityData[1].label;
|
||||
values.country = cityData[2] && cityData[2].value;
|
||||
values.countryName = cityData[2] && cityData[2].label;
|
||||
values.street = cityData[3] && cityData[3].value;
|
||||
values.streetName = cityData[3] && cityData[3].label;
|
||||
values.village = cityData[4] && cityData[4].value;
|
||||
values.villageName = cityData[4] && cityData[4].label;
|
||||
}
|
||||
if (industryData.length > 0) {
|
||||
values.corpType = industryData[0].dict_value;
|
||||
values.corpTypeName = industryData[0].dict_label;
|
||||
|
|
@ -288,49 +291,34 @@ function Update(props) {
|
|||
{
|
||||
label: "企业名称",
|
||||
name: "corpName",
|
||||
required: false,
|
||||
|
||||
span: 24,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "开户人",
|
||||
name: "createName",
|
||||
required: false,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
required: false,
|
||||
span: 24,
|
||||
rules: [
|
||||
{
|
||||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
required: false,
|
||||
name: "city",
|
||||
span: 24,
|
||||
name: "region",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="res_region_enum"
|
||||
onGetData={(data) => {
|
||||
setCityData(data);
|
||||
}}
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
setCityData(nodes)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
|
@ -364,15 +352,26 @@ function Update(props) {
|
|||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
render: <Map required={false} />,
|
||||
render: <Map />,
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
name: "employees",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
|
|
@ -384,37 +383,28 @@ function Update(props) {
|
|||
{
|
||||
label: "注册资金(万元)",
|
||||
name: "regcapital",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
name: "totalAssets",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
name: "ecoType",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
onGetData={(data) => {
|
||||
setEcoTypeData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// label: "开户人",
|
||||
// name: "createName",
|
||||
// required: false,
|
||||
// componentProps: {
|
||||
// disabled: true,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
span: 24,
|
||||
render: (
|
||||
// <DictionarySelect
|
||||
// dictValue="config_industry_enum"
|
||||
// onGetNodePaths={(node) => {
|
||||
// setIndustryData(node);
|
||||
// console.log(node);
|
||||
// }}
|
||||
// />
|
||||
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
console.log(data);
|
||||
|
|
@ -499,6 +489,12 @@ function Update(props) {
|
|||
name: "license",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
|
||||
{
|
||||
label: "办公地址",
|
||||
required: false,
|
||||
name: "addressOffice",
|
||||
},
|
||||
// { label: "企业相关属性", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
// {
|
||||
// label: "有无职业卫生信息",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ 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";
|
||||
|
|
@ -118,7 +117,7 @@ function OrganizationStructure(props) {
|
|||
{
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: <DictionarySelect dictValue="companyDepartmentLevel0000" />,
|
||||
render: <DictionarySelect dictValue="departmentLevel" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -155,8 +154,8 @@ function OrganizationStructure(props) {
|
|||
</Button>
|
||||
),
|
||||
},
|
||||
{ title: "部门负责人", dataIndex: "departmentUserLeaderList" },
|
||||
{ title: "部门级别", dataIndex: "levelName" },
|
||||
{ title: "部门排序", dataIndex: "depOrder" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -201,6 +200,7 @@ function OrganizationStructure(props) {
|
|||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
getData={getData}
|
||||
selectedNodeName={selectedNodeName}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
|
|
@ -263,6 +263,7 @@ function AddModalComponent(props) {
|
|||
|
||||
if (res?.success) {
|
||||
message.success(props.currentId ? "编辑成功" : "新增成功");
|
||||
props.getData();
|
||||
onCancel();
|
||||
}
|
||||
};
|
||||
|
|
@ -295,51 +296,18 @@ function AddModalComponent(props) {
|
|||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="companyDepartmentLevel0000"
|
||||
dictValue="departmentLevel"
|
||||
onGetData={data => setlevelData(data)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
{ name: "departmentFunction", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
|
||||
{
|
||||
name: "depOrder",
|
||||
label: "部门排序",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
name: "securityFlag",
|
||||
label: "是否安全管理部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "superviseFlag",
|
||||
label: "是否监管部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "departmentIdsList",
|
||||
label: "数据权限",
|
||||
required: false,
|
||||
render: <SelectTree multiple />,
|
||||
dependencies: ["superviseFlag"],
|
||||
hidden: formValues => formValues.superviseFlag === 0,
|
||||
},
|
||||
{ name: "departmentFunction", label: "部门职能" },
|
||||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
]}
|
||||
labelCol={{ span: 10 }}
|
||||
showActionButtons={false}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ 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 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";
|
||||
|
|
@ -19,12 +18,12 @@ import { NS_POST } from "~/enumerate/namespace";
|
|||
function Post(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState("0");
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["postList"], {
|
||||
form,
|
||||
manual: true,
|
||||
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
|
|
@ -57,12 +56,7 @@ function Post(props) {
|
|||
getData();
|
||||
}
|
||||
};
|
||||
const onGetData = (data) => {
|
||||
if (data && data.length !== 0) {
|
||||
setSelectedNodeId(data[0].id);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -75,22 +69,22 @@ function Post(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} onGetData={data => onGetData(data)} />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likePostName",
|
||||
label: "岗位名称",
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
{/* <Search */}
|
||||
{/* form={form} */}
|
||||
{/* options={[ */}
|
||||
{/* { */}
|
||||
{/* name: "likePostName", */}
|
||||
{/* label: "岗位名称", */}
|
||||
{/* }, */}
|
||||
{/* ]} */}
|
||||
{/* onFinish={getData} */}
|
||||
{/* /> */}
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
|
|
@ -262,6 +256,7 @@ function AddModalComponent(props) {
|
|||
{
|
||||
name: "remarks",
|
||||
label: "岗位职责",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ function Add(props) {
|
|||
const { data } = await props["userDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
data.sex = data.sex === "男" ? "1" : "0";
|
||||
|
||||
// const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["13"], eqForeignKey: queryParams["id"] });
|
||||
const filepath
|
||||
|
|
@ -265,7 +265,6 @@ function Add(props) {
|
|||
{
|
||||
name: "roleId",
|
||||
label: "用户角色",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: rolesData,
|
||||
itemsField: {
|
||||
|
|
@ -277,8 +276,9 @@ function Add(props) {
|
|||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
render: (
|
||||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} />
|
||||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} disabled={queryParams["id"]} />
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
name: "postId",
|
||||
|
|
@ -291,18 +291,10 @@ function Add(props) {
|
|||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa12345678”",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "phone",
|
||||
label: "手机号",
|
||||
tip: "* 手机号为用户名,修改手机号,登录密码则会变成初始密码“Aa@123456789",
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
|
|
@ -310,6 +302,11 @@ function Add(props) {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
|
||||
{
|
||||
name: "personnelType",
|
||||
label: "人员类型",
|
||||
|
|
@ -323,7 +320,6 @@ function Add(props) {
|
|||
{
|
||||
name: "userIdCard",
|
||||
label: "身份证号",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: ID_NUMBER,
|
||||
|
|
@ -383,6 +379,7 @@ function Add(props) {
|
|||
{
|
||||
name: "sort",
|
||||
label: "部门排序",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
// { name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
|
||||
|
|
|
|||
|
|
@ -1,23 +1,34 @@
|
|||
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 { Button, Descriptions, Form, Input, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
||||
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 PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
|
||||
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 { 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 { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const WHETHER_ENUM = [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
];
|
||||
function List(props) {
|
||||
const [importOpen, setImportOpen] = useState(false);
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
|
|
@ -105,11 +116,18 @@ function List(props) {
|
|||
>
|
||||
<Search
|
||||
form={form}
|
||||
labelCol={{ span: 8 }}
|
||||
options={[
|
||||
{
|
||||
name: "likeUsername",
|
||||
label: "用户名",
|
||||
},
|
||||
{
|
||||
name: "人资系统是否存在",
|
||||
label: "人资系统是否存在",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -117,6 +135,7 @@ function List(props) {
|
|||
rowSelection={{
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => setSelectedRowKeys(selectedRowKeys),
|
||||
preserveSelectedRowKeys: true,
|
||||
}}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -181,6 +200,19 @@ function List(props) {
|
|||
title: "岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人资系统是否存在",
|
||||
dataIndex: "flag",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.flag === 0
|
||||
? "否"
|
||||
: record.flag === 1
|
||||
? "是"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
|
|
@ -215,8 +247,8 @@ function List(props) {
|
|||
}
|
||||
|
||||
{
|
||||
props.permission("yhglqyd-delete")
|
||||
&& (
|
||||
(props.permission("yhglqyd-delete")
|
||||
&& record.flag === 1) && (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
|
|
@ -251,6 +283,7 @@ function List(props) {
|
|||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -264,6 +297,9 @@ function AddModalComponent(props) {
|
|||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [viewType, setViewType] = useState(false);
|
||||
const [viewData, setViewData] = useState(false);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
|
|
@ -279,7 +315,7 @@ function AddModalComponent(props) {
|
|||
filePath: res.data.userAvatarUrl,
|
||||
},
|
||||
];
|
||||
console.log(res.data);
|
||||
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -290,107 +326,192 @@ function AddModalComponent(props) {
|
|||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const handleOk = async () => {
|
||||
const values = await form.validateFields();
|
||||
|
||||
const { data } = await props.requestGetEncryInfo({ id: props.currentId, password: values.password });
|
||||
if (data) {
|
||||
if (viewType === "phone") {
|
||||
setViewData(data.phone);
|
||||
}
|
||||
else {
|
||||
setViewData(data.userIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={900}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
<>
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: info.phone,
|
||||
},
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: info.userIdCard,
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名(手机号)",
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.phone}
|
||||
{info.phone
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("phone");
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: (
|
||||
<div>
|
||||
{info.userIdCard}
|
||||
{ info.userIdCard
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("userIdCard");
|
||||
form.resetFields();
|
||||
setViewData("");
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <PreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机号"
|
||||
hidden={!(viewType === "phone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="身份证号"
|
||||
hidden={!(viewType === "userIdCard" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@ 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 AreaSelect from "zy-react-library/components/SelectTree/Area";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import IndustrySelect from "zy-react-library/components/SelectTree/Industry";
|
||||
|
||||
import IndustrySelect from "zy-react-library/components/SelectTree/Industry";
|
||||
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";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
|
@ -105,6 +105,7 @@ function CorpInfo(props) {
|
|||
const { data } = await props["corpInfoDetails"]({
|
||||
id: res.data.corpinfoId,
|
||||
});
|
||||
data.region = data.village || data.street || data.country || data.city || data.province;
|
||||
setInfoData(data);
|
||||
setKeyId({
|
||||
id: res.data.corpinfoId,
|
||||
|
|
@ -149,12 +150,19 @@ function CorpInfo(props) {
|
|||
list: ENTERPRISE_STATUS,
|
||||
|
||||
});
|
||||
values.cityName = getLabelName({
|
||||
status: values.city,
|
||||
list: cityData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
|
||||
if (cityData.length > 0) {
|
||||
values.province = cityData[0].value;
|
||||
values.provinceName = cityData[0].label;
|
||||
values.city = cityData[1] && cityData[1].value;
|
||||
values.cityName = cityData[1] && cityData[1].label;
|
||||
values.country = cityData[2] && cityData[2].value;
|
||||
values.countryName = cityData[2] && cityData[2].label;
|
||||
values.street = cityData[3] && cityData[3].value;
|
||||
values.streetName = cityData[3] && cityData[3].label;
|
||||
values.village = cityData[4] && cityData[4].value;
|
||||
values.villageName = cityData[4] && cityData[4].label;
|
||||
}
|
||||
if (industryData.length > 0) {
|
||||
values.corpType = industryData[0].dict_value;
|
||||
values.corpTypeName = industryData[0].dict_label;
|
||||
|
|
@ -260,23 +268,21 @@ function CorpInfo(props) {
|
|||
}
|
||||
options={[
|
||||
{
|
||||
label: "基本信息",
|
||||
label: "相关方单位基础信息",
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
label: "单位名称",
|
||||
name: "corpName",
|
||||
span: 24,
|
||||
required: false,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
label: "开户人",
|
||||
name: "accountContactName",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
|
|
@ -290,80 +296,47 @@ function CorpInfo(props) {
|
|||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
],
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
required: false,
|
||||
name: "city",
|
||||
label: "属地",
|
||||
name: "region",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="res_region_enum"
|
||||
onGetData={(data) => {
|
||||
setCityData(data);
|
||||
}}
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
setCityData(nodes)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "邮政编码",
|
||||
name: "postalCode",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: POSTAL_CODE,
|
||||
message: "请输入正确的邮政编码",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
name: "scale",
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
required: false,
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="scale"
|
||||
onGetData={(data) => {
|
||||
setScaleData(data);
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
setIndustryData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "成立时间",
|
||||
name: "createDate",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
{
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
render: <Map required={false} />,
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
name: "employees",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: "占地面积(㎡)",
|
||||
name: "areaCovered",
|
||||
required: false,
|
||||
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: "corpState",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
// items: ENTERPRISE_STATUS,
|
||||
// componentProps: {
|
||||
// disabled: true,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: "经济类型",
|
||||
name: "ecoType",
|
||||
required: false,
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
|
|
@ -374,13 +347,24 @@ function CorpInfo(props) {
|
|||
),
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
render: <Map required={false} />,
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
name: "addressBusiness",
|
||||
},
|
||||
{
|
||||
label: "企业规模",
|
||||
name: "scale",
|
||||
|
||||
render: (
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
console.log(data);
|
||||
setIndustryData(data);
|
||||
<DictionarySelect
|
||||
dictValue="scale"
|
||||
onGetData={(data) => {
|
||||
setScaleData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
|
@ -388,12 +372,12 @@ function CorpInfo(props) {
|
|||
{
|
||||
label: "法定代表人",
|
||||
name: "lrName",
|
||||
required: false,
|
||||
|
||||
},
|
||||
{
|
||||
label: "法人手机号",
|
||||
name: "lrMobile",
|
||||
required: false,
|
||||
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
|
|
@ -416,32 +400,29 @@ function CorpInfo(props) {
|
|||
],
|
||||
},
|
||||
{
|
||||
label: "安全负责人",
|
||||
name: "safetyName",
|
||||
required: false,
|
||||
label: "成立日期",
|
||||
name: "createDate",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
|
||||
{
|
||||
label: "职工人数",
|
||||
name: "employees",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
name: "regcapital",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
label: "安全负责人电话手机号",
|
||||
name: "safetyPhone",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
name: "scaleType",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
name: "addressBusiness",
|
||||
label: "资产总额(万元)",
|
||||
name: "totalAssets",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
|
||||
{
|
||||
label: "营业执照",
|
||||
name: "licenseFile",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ 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";
|
||||
|
|
@ -138,7 +138,7 @@ function Department(props) {
|
|||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect dictValue="companyDepartmentLevel0000" />
|
||||
<DictionarySelect dictValue="stakeholderLeve" />
|
||||
),
|
||||
},
|
||||
]}
|
||||
|
|
@ -149,18 +149,18 @@ function Department(props) {
|
|||
<>
|
||||
{" "}
|
||||
{
|
||||
props.permission("bmglxgf-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
// props.permission("bmglxgf-add")
|
||||
// && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
// )
|
||||
}
|
||||
<Button icon={<LeftOutlined />} onClick={fnReturn}>
|
||||
返回
|
||||
|
|
@ -186,7 +186,7 @@ function Department(props) {
|
|||
dataIndex: "levelName",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
title: "主管领导",
|
||||
dataIndex: "depOrder",
|
||||
},
|
||||
{
|
||||
|
|
@ -336,7 +336,7 @@ function AddModalComponent(props) {
|
|||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="companyDepartmentLevel0000"
|
||||
dictValue="stakeholderLeve"
|
||||
onGetData={(data) => {
|
||||
setlevelData(data);
|
||||
}}
|
||||
|
|
@ -348,50 +348,50 @@ function AddModalComponent(props) {
|
|||
label: "部门排序",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
name: "securityFlag",
|
||||
label: "是否安全管理部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "superviseFlag",
|
||||
label: "是否监管部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "departmentIdsList",
|
||||
label: "数据权限",
|
||||
required: false,
|
||||
render: <SelectTree multiple />,
|
||||
dependencies: ["superviseFlag"],
|
||||
hidden: formValues => formValues.superviseFlag === 0,
|
||||
},
|
||||
{
|
||||
name: "departmentFunction",
|
||||
label: "部门职能",
|
||||
},
|
||||
// {
|
||||
// name: "securityFlag",
|
||||
// label: "是否安全管理部门",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: [
|
||||
// {
|
||||
// bianma: 1,
|
||||
// name: "是",
|
||||
// },
|
||||
// {
|
||||
// bianma: 0,
|
||||
// name: "否",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// name: "superviseFlag",
|
||||
// label: "是否监管部门",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: [
|
||||
// {
|
||||
// bianma: 1,
|
||||
// name: "是",
|
||||
// },
|
||||
// {
|
||||
// bianma: 0,
|
||||
// name: "否",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// name: "departmentIdsList",
|
||||
// label: "数据权限",
|
||||
// required: false,
|
||||
// render: <SelectTree multiple />,
|
||||
// dependencies: ["superviseFlag"],
|
||||
// hidden: formValues => formValues.superviseFlag === 0,
|
||||
// },
|
||||
// {
|
||||
// name: "departmentFunction",
|
||||
// label: "部门职能",
|
||||
// },
|
||||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce } from "~/utils";
|
|||
export const WHETHER_ENUM = [
|
||||
{
|
||||
name: "是",
|
||||
bianma: "1",
|
||||
bianma: 1,
|
||||
},
|
||||
{
|
||||
name: "否",
|
||||
bianma: "0",
|
||||
bianma: 0,
|
||||
},
|
||||
];
|
||||
export const SEX_ENUM = [
|
||||
|
|
@ -74,9 +74,7 @@ function Add(props) {
|
|||
const { data } = await props["userDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
form.setFieldValue("age", getAgeByIdCard(data.userIdCard));
|
||||
form.setFieldValue("birthday", getBirthDateFromIdCard(data.userIdCard));
|
||||
data.sex = data.sex === "男" ? "1" : "0";
|
||||
setUserID(data.userId);
|
||||
const userImg = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["13"],
|
||||
|
|
@ -278,6 +276,7 @@ function Add(props) {
|
|||
|| getFileLoading
|
||||
|| props.user.userLoading
|
||||
}
|
||||
values={{ flowFlag: 0 }}
|
||||
options={[
|
||||
{
|
||||
label: "用户照片",
|
||||
|
|
@ -335,15 +334,16 @@ function Add(props) {
|
|||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa12345678”",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
tip: "* 用户名为手机号,修改手机号,登录密码则会变成初始密码“Aa@123456789",
|
||||
},
|
||||
|
||||
{
|
||||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
|
|
@ -373,7 +373,6 @@ function Add(props) {
|
|||
{
|
||||
name: "nation",
|
||||
label: "民族",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: nation,
|
||||
},
|
||||
|
|
@ -439,6 +438,18 @@ function Add(props) {
|
|||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "postName",
|
||||
label: "岗位(工种)",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "flowFlag",
|
||||
label: "是否流动人员",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
|
||||
},
|
||||
// { name: "deputyLeaderFlag", label: "是否为
|
||||
// 分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
// {
|
||||
|
|
|
|||
|
|
@ -1,19 +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 { Button, Descriptions, Form, Input, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
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 PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
// import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
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 { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -21,7 +21,7 @@ function List(props) {
|
|||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
const { tableProps, getData } = useTable(props["userXgfList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
|
|
@ -88,6 +88,7 @@ function List(props) {
|
|||
>
|
||||
<Search
|
||||
form={form}
|
||||
labelCol={{ span: 8 }}
|
||||
options={[
|
||||
{
|
||||
name: "likeName",
|
||||
|
|
@ -99,9 +100,20 @@ function List(props) {
|
|||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
label: "基础信息填报状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [
|
||||
{
|
||||
bianma: "1",
|
||||
name: "已填报",
|
||||
},
|
||||
{
|
||||
bianma: "0",
|
||||
name: "未填报",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -110,18 +122,18 @@ function List(props) {
|
|||
<>
|
||||
|
||||
{
|
||||
props.permission("yhglxgf-add")
|
||||
&& (
|
||||
<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>
|
||||
// )
|
||||
}
|
||||
</>
|
||||
)}
|
||||
|
|
@ -135,101 +147,99 @@ function List(props) {
|
|||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
title: "入职状态",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
width: 600,
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
props.permission("yhglxgf-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
// props.permission("yhglxgf-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
// )
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
// props.permission("yhglxgf-resetPassword")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
// )
|
||||
}
|
||||
{
|
||||
props.permission("yhglxgf-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
// props.permission("yhglxgf-edit")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${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("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>
|
||||
)
|
||||
// props.permission("yhglxgf-delete")
|
||||
// && (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
// )
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
|
|
@ -245,6 +255,7 @@ function List(props) {
|
|||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -258,6 +269,10 @@ function AddModalComponent(props) {
|
|||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [viewType, setViewType] = useState(false);
|
||||
const [viewData, setViewData] = useState(false);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
|
|
@ -285,104 +300,190 @@ function AddModalComponent(props) {
|
|||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const handleOk = async () => {
|
||||
const values = await form.validateFields();
|
||||
|
||||
const { data } = await props.requestGetEncryInfo({ id: props.currentId, password: values.password });
|
||||
if (data) {
|
||||
if (viewType === "phone") {
|
||||
setViewData(data.phone);
|
||||
}
|
||||
else {
|
||||
setViewData(data.userIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
<>
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
loading={getFileLoading}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <TooltipPreviewImg files={info.userImg} />,
|
||||
},
|
||||
{
|
||||
label: "身份证照片",
|
||||
children: <TooltipPreviewImg files={info.cardImg} />,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "出生年月",
|
||||
children: info.birthday,
|
||||
},
|
||||
{
|
||||
label: "年龄",
|
||||
children: info.age,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: info.phone,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: info.userIdCard,
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "户口所在地",
|
||||
children: info.locationAddress,
|
||||
},
|
||||
{
|
||||
label: "现住址",
|
||||
children: info.currentAddress,
|
||||
},
|
||||
{
|
||||
label: "文化程度",
|
||||
children: info.culturalLevelName,
|
||||
},
|
||||
{
|
||||
label: "婚姻状况",
|
||||
children: info.maritalStatusName,
|
||||
},
|
||||
{
|
||||
label: "政治面貌",
|
||||
children: info.politicalAffiliationName,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <PreviewImg files={info.userImg} />,
|
||||
},
|
||||
{
|
||||
label: "身份证照片",
|
||||
children: <PreviewImg files={info.cardImg} />,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
|
||||
},
|
||||
{
|
||||
label: "出生年月",
|
||||
children: info.birthday,
|
||||
},
|
||||
{
|
||||
label: "年龄",
|
||||
children: info.age,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.phone}
|
||||
{info.phone
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("phone");
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: (
|
||||
<div>
|
||||
{info.userIdCard}
|
||||
{ info.userIdCard
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("userIdCard");
|
||||
form.resetFields();
|
||||
setViewData("");
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "婚姻状况",
|
||||
children: info.maritalStatusName,
|
||||
},
|
||||
{
|
||||
label: "政治面貌",
|
||||
children: info.politicalAffiliationName,
|
||||
},
|
||||
{
|
||||
label: "户口所在地",
|
||||
children: info.locationAddress,
|
||||
},
|
||||
{
|
||||
label: "现住址",
|
||||
children: info.currentAddress,
|
||||
},
|
||||
{
|
||||
label: "文化程度",
|
||||
children: info.culturalLevelName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: info.postName,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机号"
|
||||
hidden={!(viewType === "phone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="身份证号"
|
||||
hidden={!(viewType === "userIdCard" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
|
|
|
|||
|
|
@ -10,11 +10,21 @@ 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 { getLabelName } from "zy-react-library/utils";
|
||||
// import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
const USER_FLAG = [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "启用",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "停用",
|
||||
},
|
||||
];
|
||||
const ENTERPRISE_TYPE = [
|
||||
{
|
||||
bianma: 0,
|
||||
|
|
@ -47,20 +57,7 @@ const ENTERPRISE_STATUS = [
|
|||
name: "破产",
|
||||
},
|
||||
];
|
||||
const ECONOMY_TYPE = [
|
||||
{
|
||||
bianma: "economic_type19",
|
||||
name: "外资",
|
||||
},
|
||||
{
|
||||
bianma: "economic_type18",
|
||||
name: "中外合作",
|
||||
},
|
||||
{
|
||||
bianma: "economic_type17",
|
||||
name: "中外合资",
|
||||
},
|
||||
];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
|
|
@ -91,19 +88,20 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
const onDelete = (id) => {
|
||||
const onDelete = () => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
content: "请联系管理员进行操作!",
|
||||
onOk: () => {
|
||||
props["corpInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
|
||||
// props["corpInfoRemove"]({
|
||||
// id,
|
||||
// }).then((res) => {
|
||||
// if (res.success) {
|
||||
// message.success("删除成功");
|
||||
// getData();
|
||||
// }
|
||||
// });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -154,24 +152,13 @@ function List(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
// { name: "createDate", label: "开户时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{
|
||||
name: "eqEcoType",
|
||||
label: "经济类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
onGetLabel={(label) => {
|
||||
form.setFieldValue("ecoTypeName", label);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "ecoTypeName",
|
||||
label: "经济类型名称",
|
||||
onlyForLabel: true,
|
||||
name: "eqUseFlag",
|
||||
label: "状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: USER_FLAG,
|
||||
},
|
||||
|
||||
]}
|
||||
labelCol={{
|
||||
span: 7,
|
||||
|
|
@ -183,19 +170,19 @@ function List(props) {
|
|||
toolBarRender={() => (
|
||||
<>
|
||||
{
|
||||
props.permission("zgszhgl-add")
|
||||
&& (
|
||||
<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>
|
||||
// )
|
||||
}
|
||||
</>
|
||||
)}
|
||||
|
|
@ -208,29 +195,29 @@ function List(props) {
|
|||
title: "社会统一信用代码",
|
||||
dataIndex: "code",
|
||||
},
|
||||
{
|
||||
title: "企业类型",
|
||||
dataIndex: "type",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{getLabelName({
|
||||
status: record.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
})}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "经济类型",
|
||||
dataIndex: "ecoTypeName",
|
||||
},
|
||||
// {
|
||||
// title: "企业类型",
|
||||
// dataIndex: "type",
|
||||
// render: (_, record) => (
|
||||
// <div>
|
||||
// {getLabelName({
|
||||
// status: record.type,
|
||||
// list: ENTERPRISE_TYPE,
|
||||
// })}
|
||||
// </div>
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// title: "经济类型",
|
||||
// dataIndex: "ecoTypeName",
|
||||
// },
|
||||
{
|
||||
title: "分公司状态",
|
||||
dataIndex: "corpStateName",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "corpStateName",
|
||||
dataIndex: "useFlag",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.useFlag === 0
|
||||
|
|
@ -269,9 +256,16 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setOpenType("editName");
|
||||
// setAddModalOpen(true);
|
||||
// setCurrentId(record.id);
|
||||
// setOpenType("editName");
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "请联系管理员进行操作!",
|
||||
onOk: () => {
|
||||
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
修改分公司名称
|
||||
|
|
@ -381,10 +375,6 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.corpStateName = getLabelName({
|
||||
status: values.corpState,
|
||||
list: ENTERPRISE_STATUS,
|
||||
});
|
||||
if (props.openType === "editName") {
|
||||
values.id = props.currentId;
|
||||
await props.requestChangeCompanyName(values);
|
||||
|
|
@ -514,13 +504,7 @@ function AddModalComponent(props) {
|
|||
label: "经济类型名称",
|
||||
onlyForLabel: true,
|
||||
},
|
||||
{
|
||||
name: "corpState",
|
||||
label: "分公司状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
hidden: props.openType === "editName",
|
||||
},
|
||||
|
||||
{
|
||||
name: "corpOrder",
|
||||
label: "列表排序",
|
||||
|
|
|
|||
|
|
@ -79,10 +79,10 @@ function View(props) {
|
|||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
},
|
||||
// {
|
||||
// label: "经济类型",
|
||||
// children: info.ecoTypeName,
|
||||
// },
|
||||
{
|
||||
label: "分公司状态",
|
||||
children: info.corpStateName,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ 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 { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -53,12 +52,11 @@ const STATUS = [
|
|||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
const { tableProps, getData } = useTable(props["corpDepartlist"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -106,35 +104,40 @@ function List(props) {
|
|||
{
|
||||
title: "分公司名称",
|
||||
dataIndex: "corpName",
|
||||
|
||||
},
|
||||
{
|
||||
title: "社会统一信用代码",
|
||||
dataIndex: "code",
|
||||
},
|
||||
{
|
||||
title: "企业类型",
|
||||
dataIndex: "type",
|
||||
title: "厂级部门数",
|
||||
dataIndex: "factoryCount",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{getLabelName({
|
||||
status: record.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
})}
|
||||
{record.factoryCount ?? 0 }
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "经济类型",
|
||||
dataIndex: "ecoTypeName",
|
||||
title: "科/队部门数",
|
||||
dataIndex: "sectionCount",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.sectionCount ?? 0 }
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "班组级部门数",
|
||||
dataIndex: "classCount",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.classCount ?? 0 }
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "分公司状态",
|
||||
dataIndex: "corpStateName",
|
||||
},
|
||||
{
|
||||
title: "列表排序",
|
||||
dataIndex: "corpOrder",
|
||||
},
|
||||
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "corpOrder",
|
||||
|
|
@ -151,7 +154,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
hidden: !(props.permission("zgsbmgl-list")),
|
||||
// hidden: !(props.permission("zgsbmgl-list")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ function View(props) {
|
|||
},
|
||||
|
||||
{
|
||||
title: "部门负责人",
|
||||
title: "负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
|
|
@ -152,18 +152,7 @@ function AddModalComponent(props) {
|
|||
label: "部门级别",
|
||||
children: info.levelName,
|
||||
},
|
||||
{
|
||||
label: "是否安全部门",
|
||||
children: (
|
||||
<div>
|
||||
{info.securityFlag === 1
|
||||
? "是"
|
||||
: info.securityFlag === 0
|
||||
? "否"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
|
|
|
|||
|
|
@ -5,22 +5,11 @@ import { useState } from "react";
|
|||
import MapSelector from "zy-react-library/components/Map/MapSelector";
|
||||
|
||||
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 = [
|
||||
{
|
||||
bianma: 0,
|
||||
name: "普通企业",
|
||||
},
|
||||
{
|
||||
bianma: 1,
|
||||
name: "集团单位",
|
||||
},
|
||||
];
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
bianma: "filialstate01",
|
||||
|
|
@ -43,20 +32,7 @@ const ENTERPRISE_STATUS = [
|
|||
name: "破产",
|
||||
},
|
||||
];
|
||||
const ECONOMY_TYPE = [
|
||||
{
|
||||
bianma: "economic_type19",
|
||||
name: "外资",
|
||||
},
|
||||
{
|
||||
bianma: "economic_type18",
|
||||
name: "中外合作",
|
||||
},
|
||||
{
|
||||
bianma: "economic_type17",
|
||||
name: "中外合资",
|
||||
},
|
||||
];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
|
|
@ -114,93 +90,12 @@ function List(props) {
|
|||
label: "分公司名称",
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
required: false,
|
||||
name: "eqCity",
|
||||
render: <DictionarySelect dictValue="res_region_enum" />,
|
||||
},
|
||||
{
|
||||
name: "eqAddressBusiness",
|
||||
label: "企业经营地址",
|
||||
},
|
||||
{
|
||||
name: "eqAddressOffice",
|
||||
label: "企业办公地址",
|
||||
},
|
||||
{
|
||||
name: "eqCode",
|
||||
label: "社会统一信用代码",
|
||||
},
|
||||
{
|
||||
name: "eqCorpState",
|
||||
label: "分公司状态",
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
{
|
||||
name: "eqEcoType",
|
||||
label: "经济类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
onGetLabel={(label) => {
|
||||
form.setFieldValue("ecoTypeName", label);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "eqCreateDate",
|
||||
label: "成立时间",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
{
|
||||
name: "eqRegcapital",
|
||||
label: "注册资金",
|
||||
},
|
||||
{
|
||||
name: "eqTotalAssets",
|
||||
label: "固定资产",
|
||||
},
|
||||
{
|
||||
name: "eqType",
|
||||
label: "企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
{
|
||||
name: "eqScale",
|
||||
label: "企业规模",
|
||||
render: <DictionarySelect dictValue="scale" />,
|
||||
},
|
||||
{
|
||||
label: "法定代表人信息",
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER,
|
||||
},
|
||||
{
|
||||
name: "eqLrName",
|
||||
label: "法人姓名",
|
||||
},
|
||||
{
|
||||
name: "eqLrMobile",
|
||||
label: "手机号",
|
||||
},
|
||||
{
|
||||
label: "主要负责人信息",
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER,
|
||||
},
|
||||
{
|
||||
name: "eqContacts",
|
||||
label: "主要负责人姓名",
|
||||
},
|
||||
{
|
||||
name: "eqContactsPhone",
|
||||
label: "手机号",
|
||||
},
|
||||
]}
|
||||
labelCol={{
|
||||
span: 10,
|
||||
}}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
|
@ -213,7 +108,7 @@ function List(props) {
|
|||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
title: "经营地址",
|
||||
title: "企事业单位经营地址",
|
||||
dataIndex: "addressBusiness",
|
||||
},
|
||||
{
|
||||
|
|
@ -258,15 +153,15 @@ function List(props) {
|
|||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
props.permission("zgsqyxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
// props.permission("zgsqyxxgl-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
// )
|
||||
}
|
||||
{
|
||||
props.permission("zgsqyxxgl-location")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions, Divider, Tabs } from "antd";
|
||||
import { Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
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";
|
||||
|
|
@ -38,22 +37,27 @@ function View(props) {
|
|||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const items = [
|
||||
{
|
||||
key: "1",
|
||||
label: "基础信息",
|
||||
children: (
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
loading={getFileLoading}
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
label: "登录账号",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
{
|
||||
|
|
@ -61,20 +65,51 @@ function View(props) {
|
|||
children: info.code,
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
label: "属地",
|
||||
children: info.cityName,
|
||||
},
|
||||
{
|
||||
label: "邮政编码",
|
||||
children: info.postalCode,
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
children: info.scaleName,
|
||||
},
|
||||
{
|
||||
label: "成立时间",
|
||||
children: info.createDate,
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
children: info.scaleName,
|
||||
label: "经度/纬度",
|
||||
children: info.longitude && `${info.longitude}/${info.latitude}`,
|
||||
},
|
||||
|
||||
{
|
||||
label: "职工人数",
|
||||
children: info.employees,
|
||||
},
|
||||
{
|
||||
label: "占地面积(㎡)",
|
||||
children: info.areaCovered,
|
||||
},
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
children: info.regcapital,
|
||||
},
|
||||
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
|
|
@ -88,78 +123,24 @@ function View(props) {
|
|||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "经度",
|
||||
children: info.longitude,
|
||||
},
|
||||
{
|
||||
label: "纬度",
|
||||
children: info.latitude,
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
children: info.employees,
|
||||
},
|
||||
{
|
||||
label: "占地面积(㎡)",
|
||||
children: info.areaCovered,
|
||||
},
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
children: info.regcapital,
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
},
|
||||
{
|
||||
label: "法定代表人",
|
||||
children: info.lrName,
|
||||
},
|
||||
{
|
||||
label: "法人手机号",
|
||||
children: info.lrMobile,
|
||||
},
|
||||
{
|
||||
label: "主要负责人",
|
||||
children: info.contacts,
|
||||
},
|
||||
{
|
||||
label: "主要负责人手机号",
|
||||
children: info.contactsPhone,
|
||||
},
|
||||
{
|
||||
label: "安全负责人",
|
||||
children: info.safetyName,
|
||||
},
|
||||
{
|
||||
label: "安全负责人手机号",
|
||||
children: info.safetyPhone,
|
||||
},
|
||||
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
children: <PreviewImg files={info.licenseFile} />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "",
|
||||
},
|
||||
{
|
||||
label: "分公司状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
|
|
@ -244,59 +225,6 @@ function View(props) {
|
|||
{/* ]} */}
|
||||
{/* /> */}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
label: "人员证照管理",
|
||||
children: (
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "specialTypeName",
|
||||
},
|
||||
{
|
||||
title: "性别",
|
||||
dataIndex: "operationTypeName",
|
||||
},
|
||||
{
|
||||
title: "证照名称",
|
||||
dataIndex: "certificate",
|
||||
},
|
||||
{
|
||||
title: "职务",
|
||||
dataIndex: "certificate",
|
||||
},
|
||||
{
|
||||
title: "有效期",
|
||||
dataIndex: "certificate",
|
||||
},
|
||||
{
|
||||
title: "照片",
|
||||
dataIndex: "filepath",
|
||||
render: (_, record) => <TooltipPreviewImg files={[]} />,
|
||||
},
|
||||
]}
|
||||
pagination={false}
|
||||
dataSource={info.special}
|
||||
disabledResizer={true}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Tabs
|
||||
items={items}
|
||||
defaultActiveKey="1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ function List(props) {
|
|||
),
|
||||
},
|
||||
{
|
||||
title: "公司状态",
|
||||
title: "分公司状态",
|
||||
dataIndex: "corpStateName",
|
||||
},
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
hidden: !(props.permission("zgsyhgl-info")),
|
||||
// hidden: !(props.permission("zgsyhgl-info")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Modal, Space } from "antd";
|
||||
import { Button, Descriptions, Form, Input, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
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 { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ function List(props) {
|
|||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
title: "所属部门",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
|
|
@ -94,6 +94,7 @@ function List(props) {
|
|||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -106,6 +107,9 @@ function AddModalComponent(props) {
|
|||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [viewType, setViewType] = useState(false);
|
||||
const [viewData, setViewData] = useState(false);
|
||||
useEffect(() => {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
|
|
@ -131,107 +135,196 @@ function AddModalComponent(props) {
|
|||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={900}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
const handleOk = async () => {
|
||||
const values = await form.validateFields();
|
||||
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: info.phone,
|
||||
},
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: info.userIdCard,
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
const { data } = await props.requestGetEncryInfo({ id: props.currentId, password: values.password });
|
||||
if (data) {
|
||||
if (viewType === "phone") {
|
||||
setViewData(data.phone);
|
||||
}
|
||||
else {
|
||||
setViewData(data.userIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.phone}
|
||||
{info.phone
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("phone");
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: (
|
||||
<div>
|
||||
{info.userIdCard}
|
||||
{ info.userIdCard
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("userIdCard");
|
||||
form.resetFields();
|
||||
setViewData("");
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <PreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机号"
|
||||
hidden={!(viewType === "phone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="身份证号"
|
||||
hidden={!(viewType === "userIdCard" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
|
|
|
|||
|
|
@ -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 { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
|
|
@ -259,12 +259,7 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
children: info.sex,
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ 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 { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
|
|
@ -84,10 +85,11 @@ function List(props) {
|
|||
>
|
||||
<Search
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
options={[
|
||||
{
|
||||
name: "likecorpName",
|
||||
label: "分公司名称",
|
||||
label: "相关方名称",
|
||||
},
|
||||
{
|
||||
name: "eqCity",
|
||||
|
|
@ -105,13 +107,16 @@ function List(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
||||
/>
|
||||
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
{props.permission("gszhxxgl-add")
|
||||
{
|
||||
props.permission("gszhxxgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
@ -122,12 +127,13 @@ function List(props) {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
)}
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{
|
||||
title: "分公司名称",
|
||||
title: "相关方名称",
|
||||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
|
|
@ -135,9 +141,13 @@ function List(props) {
|
|||
dataIndex: "cityName",
|
||||
},
|
||||
{
|
||||
title: "开户人",
|
||||
title: "创建单位",
|
||||
dataIndex: "createName",
|
||||
},
|
||||
{
|
||||
title: "开户人",
|
||||
dataIndex: "accountContactName",
|
||||
},
|
||||
{
|
||||
title: "社会统一信用代码",
|
||||
dataIndex: "code",
|
||||
|
|
@ -146,12 +156,25 @@ function List(props) {
|
|||
title: "开户时间",
|
||||
dataIndex: "createTime",
|
||||
},
|
||||
{
|
||||
title: "相关方类型",
|
||||
dataIndex: "type",
|
||||
|
||||
render: (_, record) => (
|
||||
getLabelName({
|
||||
status: record.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
})
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 350,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{props.permission("gszhxxgl-info")
|
||||
{
|
||||
props.permission("gszhxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
|
|
@ -159,8 +182,11 @@ function List(props) {
|
|||
>
|
||||
查看
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("gszhxxgl-edit")
|
||||
)
|
||||
}
|
||||
{
|
||||
|
||||
props.permission("gszhxxgl-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
|
|
@ -171,7 +197,8 @@ function List(props) {
|
|||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
)
|
||||
}
|
||||
{props.permission("gszhxxgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
|
|
@ -223,7 +250,7 @@ function AddModalComponent(props) {
|
|||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
console.log(props);
|
||||
const [selectfromData, setSelectfromData] = useState([]);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props
|
||||
|
|
@ -231,6 +258,12 @@ function AddModalComponent(props) {
|
|||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
const arr = [];
|
||||
|
||||
res.data.selectfromList.forEach((item) => {
|
||||
arr.push(item.itemCode);
|
||||
});
|
||||
res.data.selectfromList = arr;
|
||||
form.setFieldsValue(res.data);
|
||||
});
|
||||
}
|
||||
|
|
@ -240,6 +273,19 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
const arr = [];
|
||||
values.selectfromList.forEach((item) => {
|
||||
selectfromData.forEach((row) => {
|
||||
if (item === row.dictValue) {
|
||||
arr.push({
|
||||
itemName: row.dictLabel,
|
||||
itemCode: row.dictValue,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
values.selectfromList = arr;
|
||||
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
|
|
@ -361,6 +407,22 @@ function AddModalComponent(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
{
|
||||
name: "selectfromList",
|
||||
label: "选取形式",
|
||||
|
||||
render: (
|
||||
<DictionarySelect
|
||||
mode="multiple"
|
||||
dictValue="select_from_List"
|
||||
|
||||
onGetData={(data) => {
|
||||
setSelectfromData(data);
|
||||
}}
|
||||
|
||||
/>
|
||||
),
|
||||
},
|
||||
]}
|
||||
labelCol={{
|
||||
span: 10,
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
import { Descriptions, Divider } from "antd";
|
||||
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
function View() {
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">查看用户</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: "Zhou",
|
||||
},
|
||||
{
|
||||
label: "是否为部门负责人",
|
||||
children: "Zhou",
|
||||
},
|
||||
]}
|
||||
column={1}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default View;
|
||||
|
|
@ -3,7 +3,7 @@ import { Button, Descriptions, Divider, Modal, QRCode } from "antd";
|
|||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
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";
|
||||
|
|
@ -24,17 +24,36 @@ function View(props) {
|
|||
].filter(name => name != null && name !== "");
|
||||
return names.join("/");
|
||||
};
|
||||
const getAreaNamePath = (item) => {
|
||||
const names = [
|
||||
item.provinceName,
|
||||
item.cityName,
|
||||
item.countryName,
|
||||
item.streetName,
|
||||
item.villageName,
|
||||
|
||||
].filter(name => name != null && name !== "");
|
||||
return names.join("/");
|
||||
};
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoDetails({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
setInfo(res.data);
|
||||
const arr = [];
|
||||
|
||||
res.data.selectfromList.forEach((item) => {
|
||||
arr.push(item.itemName);
|
||||
});
|
||||
res.data.selectfromList = arr.join(",");
|
||||
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.corpinfoId,
|
||||
});
|
||||
res.data.licenseFile = licenseFile;
|
||||
|
||||
setInfo(res.data);
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -67,34 +86,35 @@ function View(props) {
|
|||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
},
|
||||
{
|
||||
label: "成立日期",
|
||||
children: info.createDate,
|
||||
},
|
||||
|
||||
{
|
||||
label: "属地",
|
||||
children: info.cityName,
|
||||
children: <div>{getAreaNamePath(info)}</div>,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属行业",
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
},
|
||||
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
},
|
||||
{
|
||||
label: "经度/纬度",
|
||||
children: info.longitude && `${info.longitude}/${info.latitude}`,
|
||||
},
|
||||
|
||||
{
|
||||
label: "单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
},
|
||||
{
|
||||
label: "企业规模",
|
||||
children: info.scaleName,
|
||||
},
|
||||
{
|
||||
label: "经度",
|
||||
children: info.longitude,
|
||||
},
|
||||
{
|
||||
label: "纬度",
|
||||
children: info.latitude,
|
||||
},
|
||||
{
|
||||
label: "单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
},
|
||||
|
||||
{
|
||||
label: "法定代表人",
|
||||
children: info.lrName,
|
||||
|
|
@ -111,6 +131,10 @@ function View(props) {
|
|||
label: "主要负责人手机号",
|
||||
children: info.contactsPhone,
|
||||
},
|
||||
{
|
||||
label: "成立日期",
|
||||
children: info.createDate,
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
children: info.employees,
|
||||
|
|
@ -119,18 +143,16 @@ function View(props) {
|
|||
label: "占地面积(㎡)",
|
||||
children: info.areaCovered,
|
||||
},
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
children: info.regcapital,
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
|
||||
{
|
||||
label: "企业二维码",
|
||||
children: (
|
||||
|
|
@ -144,6 +166,14 @@ function View(props) {
|
|||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "创建单位",
|
||||
children: info.createName,
|
||||
},
|
||||
{
|
||||
label: "选取形式",
|
||||
children: info.selectfromList,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
loading={getFileLoading}
|
||||
|
|
@ -157,7 +187,7 @@ function View(props) {
|
|||
items={[
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
children: <PreviewImg files={info.licenseFile} />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
|
|
|
|||
|
|
@ -3,20 +3,21 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|||
import { Button, Form, Space } from "antd";
|
||||
|
||||
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 { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
||||
// import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
// const ENTERPRISE_TYPE = [
|
||||
// { bianma: 3, name: "相关方企业" },
|
||||
// { bianma: 4, name: "货主单位" },
|
||||
// { bianma: 5, name: "驻港单位" },
|
||||
// ];
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 3, name: "相关方企业" },
|
||||
{ bianma: 4, name: "货主单位" },
|
||||
{ bianma: 5, name: "驻港单位" },
|
||||
];
|
||||
// const ENTERPRISE_STATUS = [
|
||||
// { bianma: "filialstate01", name: "在产" },
|
||||
// { bianma: "filialstate02", name: "在建" },
|
||||
|
|
@ -49,8 +50,12 @@ function List(props) {
|
|||
name: "likeCorpName",
|
||||
label: "相关方单位名称",
|
||||
},
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
// { name: "eqtype", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
{ name: "eqType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
{ name: "selectFrom", label: "选取形式", render: (
|
||||
<DictionarySelect
|
||||
dictValue="select_from_List"
|
||||
/>
|
||||
) },
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -60,6 +65,19 @@ function List(props) {
|
|||
title: "相关方单位名称",
|
||||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
title: "选取形式",
|
||||
dataIndex: "selectfromString",
|
||||
},
|
||||
{
|
||||
title: "属地",
|
||||
dataIndex: "cityName",
|
||||
|
||||
},
|
||||
{
|
||||
title: "创建单位",
|
||||
dataIndex: "createName",
|
||||
},
|
||||
{
|
||||
title: "企业人数",
|
||||
dataIndex: "userCount",
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
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 { Button, Descriptions, Form, Input, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
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 { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -79,10 +78,6 @@ function List(props) {
|
|||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "likeUserIdCard",
|
||||
label: "身份证号",
|
||||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
|
|
@ -105,10 +100,6 @@ function List(props) {
|
|||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
|
|
@ -127,19 +118,21 @@ function List(props) {
|
|||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("ryxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
{
|
||||
// props.permission("ryxxgl-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
)}
|
||||
// )
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -155,6 +148,7 @@ function List(props) {
|
|||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -169,11 +163,11 @@ function AddModalComponent(props) {
|
|||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [viewType, setViewType] = useState(false);
|
||||
const [viewData, setViewData] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
|
|
@ -202,114 +196,198 @@ function AddModalComponent(props) {
|
|||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const handleOk = async () => {
|
||||
const values = await form.validateFields();
|
||||
|
||||
const { data } = await props.requestGetEncryInfo({ id: props.currentId, password: values.password });
|
||||
if (data) {
|
||||
if (viewType === "phone") {
|
||||
setViewData(data.phone);
|
||||
}
|
||||
else {
|
||||
setViewData(data.userIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={900}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
<>
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <TooltipPreviewImg files={info.userImg} />,
|
||||
},
|
||||
{
|
||||
label: "身份证照片",
|
||||
children: <TooltipPreviewImg files={info.cardImg} />,
|
||||
},
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: info.phone,
|
||||
},
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: info.userIdCard,
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
// { label: "文化程度", children: info.culturalLevelName },
|
||||
// { label: "婚姻状况", children: info.maritalStatusName },
|
||||
// { label: "政治面貌", children: info.politicalAffiliationName },
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <PreviewImg files={info.userImg} />,
|
||||
},
|
||||
{
|
||||
label: "身份证照片",
|
||||
children: <PreviewImg files={info.cardImg} />,
|
||||
},
|
||||
// {
|
||||
// label: "用户角色",
|
||||
// children: getLabelName({
|
||||
// status: info.roleId,
|
||||
// list: rolesData,
|
||||
// idKey: "id",
|
||||
// nameKey: "roleName",
|
||||
// }),
|
||||
// },
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
},
|
||||
|
||||
{
|
||||
label: "出生年月",
|
||||
children: info.birthday,
|
||||
},
|
||||
{
|
||||
label: "年龄",
|
||||
children: info.age,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.phone}
|
||||
{info.phone
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("phone");
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: (
|
||||
<div>
|
||||
{info.userIdCard}
|
||||
{ info.userIdCard
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("userIdCard");
|
||||
form.resetFields();
|
||||
setViewData("");
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "婚姻状况",
|
||||
children: info.maritalStatusName,
|
||||
},
|
||||
{
|
||||
label: "政治面貌",
|
||||
children: info.politicalAffiliationName,
|
||||
},
|
||||
{
|
||||
label: "户口所在地",
|
||||
children: info.locationAddress,
|
||||
},
|
||||
{
|
||||
label: "现住址",
|
||||
children: info.currentAddress,
|
||||
},
|
||||
{
|
||||
label: "文化程度",
|
||||
children: info.culturalLevelName,
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: info.postName,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机号"
|
||||
hidden={!(viewType === "phone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="身份证号"
|
||||
hidden={!(viewType === "userIdCard" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
|
|
|
|||
|
|
@ -7,13 +7,11 @@ 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 OrgChartModal from "~/components/OrgChartModal";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
|
|
@ -22,6 +20,8 @@ function Department(props) {
|
|||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const [chartModalOpen, setChartModalOpen] = useState(false);
|
||||
const [departmentData, setDepartmentData] = useState(null);
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
|
|
@ -41,6 +41,12 @@ function Department(props) {
|
|||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const handleChartClick = () => {
|
||||
// 获取当前选中的部门树结构(可以请求后台接口)
|
||||
|
||||
setChartModalOpen(true);
|
||||
};
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
if (key) {
|
||||
|
|
@ -65,6 +71,7 @@ function Department(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -77,7 +84,7 @@ function Department(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree onSelect={onTreeChange} onGetData={data => setDepartmentData(data)} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -90,13 +97,7 @@ function Department(props) {
|
|||
name: "likeName",
|
||||
label: "部门名称",
|
||||
},
|
||||
{
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect dictValue="companyDepartmentLevel0000" />
|
||||
),
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -118,6 +119,13 @@ function Department(props) {
|
|||
</Button>
|
||||
)
|
||||
}
|
||||
<Button
|
||||
onClick={() => {
|
||||
handleChartClick();
|
||||
}}
|
||||
>
|
||||
结构图
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -203,13 +211,26 @@ function Department(props) {
|
|||
}}
|
||||
/>
|
||||
)}
|
||||
{chartModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
open={chartModalOpen}
|
||||
title="组织架构图"
|
||||
width="80%"
|
||||
height="60vh"
|
||||
onCancel={() => setChartModalOpen(false)}
|
||||
footer={null}
|
||||
>
|
||||
<OrgChartModal data={departmentData} />
|
||||
</Modal>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
const [levelData, setlevelData] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props
|
||||
|
|
@ -230,12 +251,6 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.levelName = getLabelName({
|
||||
status: values.level,
|
||||
list: levelData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
|
||||
message.error("部门排序请输入正整数!");
|
||||
return;
|
||||
|
|
@ -284,68 +299,17 @@ function AddModalComponent(props) {
|
|||
label: "部门名称",
|
||||
},
|
||||
{
|
||||
name: "level",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="companyDepartmentLevel0000"
|
||||
onGetData={(data) => {
|
||||
setlevelData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
{
|
||||
name: "depOrder",
|
||||
label: "部门排序",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
name: "securityFlag",
|
||||
label: "是否安全管理部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "superviseFlag",
|
||||
label: "是否监管部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "departmentIdsList",
|
||||
label: "数据权限",
|
||||
required: false,
|
||||
render: <SelectTree multiple />,
|
||||
dependencies: ["superviseFlag"],
|
||||
hidden: formValues => formValues.superviseFlag === 0,
|
||||
},
|
||||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
|
||||
]}
|
||||
labelCol={{
|
||||
span: 10,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ 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 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";
|
||||
|
|
@ -21,7 +20,6 @@ function Post(props) {
|
|||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["postList"], {
|
||||
form,
|
||||
manual: true,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
|
|
@ -54,12 +52,7 @@ function Post(props) {
|
|||
getData();
|
||||
}
|
||||
};
|
||||
const onGetData = (data) => {
|
||||
if (data && data.length !== 0) {
|
||||
setSelectedNodeId(data[0].id);
|
||||
getData();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -72,22 +65,22 @@ function Post(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} onGetData={data => onGetData(data)} />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likePostName",
|
||||
label: "岗位名称",
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
{/* <Search */}
|
||||
{/* form={form} */}
|
||||
{/* options={[ */}
|
||||
{/* { */}
|
||||
{/* name: "likePostName", */}
|
||||
{/* label: "岗位名称", */}
|
||||
{/* }, */}
|
||||
{/* ]} */}
|
||||
{/* onFinish={getData} */}
|
||||
{/* /> */}
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -265,6 +258,7 @@ function AddModalComponent(props) {
|
|||
{
|
||||
name: "remarks",
|
||||
label: "岗位职责",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function Add(props) {
|
|||
const { data } = await props["userDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
data.sex = data.sex === "男" ? "1" : "0";
|
||||
fnChoiceDepartment(
|
||||
[
|
||||
{
|
||||
|
|
@ -265,14 +265,12 @@ function Add(props) {
|
|||
form={form}
|
||||
values={{
|
||||
departmentLeaderFlag: 0,
|
||||
deputyLeaderFlag: 0,
|
||||
}}
|
||||
loading={uploadFileLoading || props.user.userLoading}
|
||||
options={[
|
||||
{
|
||||
name: "roleId",
|
||||
label: "用户角色",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: rolesData,
|
||||
itemsField: {
|
||||
|
|
@ -287,6 +285,14 @@ function Add(props) {
|
|||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} />
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
name: "departmentLeaderFlag",
|
||||
label: "是否为部门负责人",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "postId",
|
||||
label: "所属岗位",
|
||||
|
|
@ -297,10 +303,6 @@ function Add(props) {
|
|||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
|
|
@ -308,6 +310,7 @@ function Add(props) {
|
|||
{
|
||||
name: "phone",
|
||||
label: "手机号",
|
||||
tip: "*手机号为用户的登陆账号,请谨慎操作,如果账号有修改,密码将会重置为默认密码。.",
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
|
|
@ -318,6 +321,7 @@ function Add(props) {
|
|||
{
|
||||
name: "personnelType",
|
||||
label: "人员类型",
|
||||
required: false,
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="renyuanleixing"
|
||||
|
|
@ -330,7 +334,6 @@ function Add(props) {
|
|||
{
|
||||
name: "userIdCard",
|
||||
label: "身份证号",
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: ID_NUMBER,
|
||||
|
|
@ -392,6 +395,7 @@ function Add(props) {
|
|||
{
|
||||
name: "sort",
|
||||
label: "部门排序",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
|
|
@ -421,24 +425,10 @@ function Add(props) {
|
|||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
span: 24,
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
{
|
||||
name: "departmentLeaderFlag",
|
||||
label: "是否为部门负责人",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "deputyLeaderFlag",
|
||||
label: "是否为分管领导",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
|
||||
]}
|
||||
labelCol={{
|
||||
span: 6,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
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 { Button, Descriptions, Form, Input, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||
|
|
@ -8,17 +8,17 @@ import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
|||
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 PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
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 { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
import { maskPhone } from "~/utils";
|
||||
|
||||
function List(props) {
|
||||
const [importOpen, setImportOpen] = useState(false);
|
||||
|
|
@ -26,7 +26,8 @@ function List(props) {
|
|||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||
const [postData, setPostData] = useState([]);
|
||||
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
const { downloadBlob } = useDownloadBlob();
|
||||
const { importFile } = useImportFile();
|
||||
const [form] = Form.useForm();
|
||||
|
|
@ -41,18 +42,9 @@ function List(props) {
|
|||
});
|
||||
useEffect(() => {
|
||||
const fetchPostData = async () => {
|
||||
const deptId = selectedNodeId ?? "0";
|
||||
try {
|
||||
const res = await props["postAll"]({
|
||||
corpFlag: 1,
|
||||
departmentId: deptId,
|
||||
});
|
||||
setPostData(res?.data || []);
|
||||
}
|
||||
catch {
|
||||
message.error("岗位数据加载失败");
|
||||
setPostData([]);
|
||||
}
|
||||
props["rolesAll"]().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
};
|
||||
fetchPostData();
|
||||
}, [selectedNodeId]);
|
||||
|
|
@ -139,21 +131,17 @@ function List(props) {
|
|||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
|
||||
{
|
||||
name: "eqPostId",
|
||||
label: "所属岗位",
|
||||
name: "eqRoleId",
|
||||
label: "用户角色",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: postData,
|
||||
items: rolesData,
|
||||
itemsField: {
|
||||
labelKey: "postName",
|
||||
labelKey: "roleName",
|
||||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -162,6 +150,7 @@ function List(props) {
|
|||
rowSelection={{
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => setSelectedRowKeys(selectedRowKeys),
|
||||
preserveSelectedRowKeys: true,
|
||||
}}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -197,6 +186,7 @@ function List(props) {
|
|||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
setSelectedRowKeys([]);
|
||||
getData();
|
||||
}
|
||||
});
|
||||
|
|
@ -238,9 +228,22 @@ function List(props) {
|
|||
)}
|
||||
columns={[
|
||||
{
|
||||
title: "用户名",
|
||||
title: "所属角色",
|
||||
dataIndex: "username",
|
||||
render: (text, record) => (
|
||||
|
||||
<div>
|
||||
{ getLabelName({
|
||||
status: record.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
})}
|
||||
</div>
|
||||
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
|
|
@ -248,6 +251,9 @@ function List(props) {
|
|||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
render: (text, record) => (
|
||||
<div>{maskPhone(record.phone)}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "所属部门",
|
||||
|
|
@ -257,26 +263,25 @@ function List(props) {
|
|||
title: "所属岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
|
||||
{
|
||||
props.permission("zhgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
// props.permission("zhgl-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
// )
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-edit")
|
||||
|
|
@ -292,19 +297,17 @@ function List(props) {
|
|||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-info")
|
||||
props.permission("zhgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
查看
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.permission("zhgl-delete")
|
||||
&& (
|
||||
|
|
@ -342,6 +345,7 @@ function List(props) {
|
|||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -355,6 +359,9 @@ function AddModalComponent(props) {
|
|||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [viewType, setViewType] = useState(false);
|
||||
const [viewData, setViewData] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
props.requwstRolesAll().then((res) => {
|
||||
|
|
@ -379,107 +386,195 @@ function AddModalComponent(props) {
|
|||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const handleOk = async () => {
|
||||
const values = await form.validateFields();
|
||||
|
||||
const { data } = await props.requestGetEncryInfo({ id: props.currentId, password: values.password });
|
||||
if (data) {
|
||||
if (viewType === "phone") {
|
||||
setViewData(data.phone);
|
||||
}
|
||||
else {
|
||||
setViewData(data.userIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={900}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
<>
|
||||
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: info.phone,
|
||||
},
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: info.userIdCard,
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "所属岗位",
|
||||
children: info.postName,
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.name,
|
||||
},
|
||||
{
|
||||
label: "手机号",
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.phone}
|
||||
{info.phone
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("phone");
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "人员类型",
|
||||
children: info.personnelTypeName,
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: (
|
||||
<div>
|
||||
{info.userIdCard}
|
||||
{ info.userIdCard
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("userIdCard");
|
||||
form.resetFields();
|
||||
setViewData("");
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
label: "民族",
|
||||
children: info.nationName,
|
||||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
},
|
||||
{
|
||||
label: "上传人脸照片",
|
||||
children: <PreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机号"
|
||||
hidden={!(viewType === "phone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="身份证号"
|
||||
hidden={!(viewType === "userIdCard" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
|
|
|
|||
|
|
@ -1,52 +1,56 @@
|
|||
import React from 'react';
|
||||
import language from 'antd/locale/zh_CN';
|
||||
import { ImportCore } from "@cqsjjb/jjb-common-decorator/module";
|
||||
import { theme as antdTheme, App, ConfigProvider } from "antd";
|
||||
|
||||
import { ImportCore } from '@cqsjjb/jjb-common-decorator/module';
|
||||
import { theme as antdTheme, App, ConfigProvider } from 'antd';
|
||||
import language from "antd/locale/zh_CN";
|
||||
import React from "react";
|
||||
|
||||
import { InjectContext } from '~/enumerate/context';
|
||||
import { InjectContext } from "~/enumerate/context";
|
||||
|
||||
export default class Container extends React.Component {
|
||||
state = window?.base?.themeConfig || {
|
||||
algorithm: window.process.env.app.antd.algorithm,
|
||||
borderRadius: window.process.env.app.antd.borderRadius,
|
||||
colorPrimary: window.process.env.app.antd.colorPrimary
|
||||
colorPrimary: window.process.env.app.antd.colorPrimary,
|
||||
};
|
||||
|
||||
get token() {
|
||||
const { colorPrimary, borderRadius } = this.state;
|
||||
return {
|
||||
fontFamily: window.process.env.app.antd.fontFamily,
|
||||
colorPrimary,
|
||||
borderRadius
|
||||
borderRadius,
|
||||
};
|
||||
}
|
||||
|
||||
get algorithm() {
|
||||
return antdTheme[this.state.algorithm];
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
if (window.__IN_BASE__) {
|
||||
// eslint-disable-next-line react-web-api/no-leaked-event-listener
|
||||
window.base.addEventListener('EVENT_THEME_CONTROL', e => {
|
||||
window.base.addEventListener("EVENT_THEME_CONTROL", (e) => {
|
||||
const config = e.data;
|
||||
this.setState({
|
||||
[config.field]: config.value
|
||||
[config.field]: config.value,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ConfigProvider
|
||||
theme={{
|
||||
token: this.token,
|
||||
algorithm: this.algorithm
|
||||
algorithm: this.algorithm,
|
||||
}}
|
||||
locale={language}
|
||||
prefixCls={window.process.env.app.antd['ant-prefix']}
|
||||
prefixCls={window.process.env.app.antd["ant-prefix"]}
|
||||
>
|
||||
<App
|
||||
style={{
|
||||
height: '100%'
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
<AppMiddle {...this.props} />
|
||||
|
|
@ -58,40 +62,44 @@ export default class Container extends React.Component {
|
|||
function AppMiddle(props) {
|
||||
return (
|
||||
<InjectContext.Provider value={App.useApp()}>
|
||||
{process.env.NODE_ENV === 'development' ?
|
||||
props.children
|
||||
: <Interceptor>{props.children}</Interceptor>}
|
||||
{process.env.NODE_ENV === "development"
|
||||
? props.children
|
||||
: <Interceptor>{props.children}</Interceptor>}
|
||||
</InjectContext.Provider>
|
||||
);
|
||||
}
|
||||
class Interceptor extends React.Component {
|
||||
state = {
|
||||
Component: undefined
|
||||
Component: undefined,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (process.env.app.appKey) {
|
||||
ImportCore({
|
||||
name: '$',
|
||||
from: 'https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest'
|
||||
}).then(async res => {
|
||||
name: "$",
|
||||
from: "https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest",
|
||||
}).then(async (res) => {
|
||||
if (res.status) {
|
||||
this.setState({
|
||||
Component: res.module?.PageCover
|
||||
Component: res.module?.PageCover,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { Component } = this.state;
|
||||
return (
|
||||
Component &&
|
||||
process.env.app.appKey &&
|
||||
process.env.NODE_ENV === 'development'
|
||||
) ?
|
||||
<Component appKey={process.env.app.appKey}>
|
||||
{this.props.children}
|
||||
</Component>
|
||||
Component
|
||||
&& process.env.app.appKey
|
||||
&& process.env.NODE_ENV === "development"
|
||||
)
|
||||
? (
|
||||
<Component appKey={process.env.app.appKey}>
|
||||
{this.props.children}
|
||||
</Component>
|
||||
)
|
||||
: this.props.children;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,3 +108,28 @@ export function useDebounce(value, delay = 500) {
|
|||
}, [value, delay]);
|
||||
return debouncedValue;
|
||||
}
|
||||
// 手机号脱敏
|
||||
export function maskPhone(phone) {
|
||||
if (!phone)
|
||||
return "";
|
||||
const str = String(phone).replace(/\s+/g, ""); // 去除空格
|
||||
if (!/^1[3-9]\d{9}$/.test(str)) {
|
||||
return phone; // 非标准手机号,原样返回
|
||||
}
|
||||
return `${str.substring(0, 3)}****${str.substring(7)}`;
|
||||
}
|
||||
// 身份证号脱敏
|
||||
export function maskIdCard(idCard) {
|
||||
if (!idCard)
|
||||
return "";
|
||||
|
||||
// 转为字符串并去除空格
|
||||
const str = String(idCard).replace(/\s+/g, "");
|
||||
|
||||
// 判断是否为 18 位身份证(支持末尾 X/x)
|
||||
if (!/^\d{17}[\dX]$/i.test(str)) {
|
||||
return idCard; // 非标准身份证,原样返回
|
||||
}
|
||||
|
||||
return `${str.substring(0, 6)}********${str.substring(14)}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue