init
commit
57077512f1
|
|
@ -0,0 +1,13 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
insert_final_newline = false
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# production
|
||||||
|
/dist
|
||||||
|
/demo
|
||||||
|
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.idea
|
||||||
|
yarn.lock
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"prettier.enable": false,
|
||||||
|
"editor.formatOnSave": false,
|
||||||
|
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": "explicit",
|
||||||
|
"source.organizeImports": "never"
|
||||||
|
},
|
||||||
|
|
||||||
|
"eslint.rules.customizations": [
|
||||||
|
{ "rule": "style/*", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "format/*", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*-order", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
||||||
|
{ "rule": "*semi", "severity": "off", "fixable": true }
|
||||||
|
],
|
||||||
|
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"vue",
|
||||||
|
"html",
|
||||||
|
"markdown",
|
||||||
|
"json",
|
||||||
|
"json5",
|
||||||
|
"jsonc",
|
||||||
|
"yaml",
|
||||||
|
"toml",
|
||||||
|
"xml",
|
||||||
|
"gql",
|
||||||
|
"graphql",
|
||||||
|
"astro",
|
||||||
|
"svelte",
|
||||||
|
"css",
|
||||||
|
"less",
|
||||||
|
"scss",
|
||||||
|
"pcss",
|
||||||
|
"postcss"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
# 微应用模板说明文档
|
||||||
|
|
||||||
|
## 在线文档
|
||||||
|
|
||||||
|
https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko
|
||||||
|
|
||||||
|
|
||||||
|
## 安装依赖
|
||||||
|
项目依赖可通过 **yarn** 或 **npm** 进行安装:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 使用 yarn
|
||||||
|
yarn
|
||||||
|
|
||||||
|
# 或使用 npm
|
||||||
|
npm i
|
||||||
|
```
|
||||||
|
|
||||||
|
## 开发服务&打包应用
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 启动开发服务
|
||||||
|
yarn serve:<env>
|
||||||
|
# 或
|
||||||
|
npm run serve:<env>
|
||||||
|
|
||||||
|
# 开发环境打包
|
||||||
|
yarn build:<env>
|
||||||
|
# 或
|
||||||
|
npm run build:<env>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 路由配置&路由访问&自动化路由
|
||||||
|
所有页面必须放在`src/pages/container`目录下,启动访问页面请在浏览器地址栏输入`/<appIdentifier>/container/<你的路由页面文件名称>`
|
||||||
|
解释:
|
||||||
|
1. 所有页面组件命名为`index.js`或`index.jsx`,必须放在一个首字母大写的文件中。
|
||||||
|
2. `container`为固定路径访问格式
|
||||||
|
3. `<appIdentifier>`为应用的唯一标识符,也是应用路由的`basename`,在底座中用于区分其他应用。可在根目录 `jjb.config.js` 文件的 `appIdentifier` 节点中进行修改。
|
||||||
|
4. 自动化路由将根据`pages/container`中的路由页面文件自动生成路由树。
|
||||||
|
5. `id`匹配路由,文件夹命名`_id`
|
||||||
|
|
||||||
|
## 应用接口环境配置
|
||||||
|
应用接口环境相关配置在根目录 `jjb.config.js` 文件的 `environment` 节点中进行定义。
|
||||||
|
|
||||||
|
## 应用开发服务配置
|
||||||
|
应用开发服务相关配置在根目录 `jjb.config.js` 文件的 `server` 节点中进行定义。
|
||||||
|
|
||||||
|
## Babel 配置
|
||||||
|
应用的 `Babel` 配置在根目录 `jjb.babel.js` 文件中进行管理。
|
||||||
|
|
||||||
|
## 目录说明
|
||||||
|
|
||||||
|
1. `src/api/` 配置各个 store 模块的接口数据。
|
||||||
|
2. `src/components/` 全局公共组件。
|
||||||
|
3. `src/enumerate/` 全局各种枚举配置。
|
||||||
|
4. `src/pages/` 页面文件目录。
|
||||||
|
5. `src/main.js` 应用的入口文件。
|
||||||
|
|
||||||
|
## 核心依赖
|
||||||
|
1. `@cqsjjb/jjb-common-decorator`
|
||||||
|
1. 公共装饰器库,内部包含:
|
||||||
|
1. 按钮权限处理
|
||||||
|
2. antd/Table 控制
|
||||||
|
3. 文本重命名处理
|
||||||
|
4. 具体使用方式可参考各个模块的 `d.ts`。
|
||||||
|
2. `@cqsjjb/jjb-common-lib`
|
||||||
|
1. 公共工具库,具体 API 使用请查看 `d.ts`
|
||||||
|
3. `@cqsjjb/jjb-dva-runtime`
|
||||||
|
1. 核心运行时,基于 `dvajs` 实现。
|
||||||
|
1. 应用核心依赖模块
|
||||||
|
2. 应用的自动化路由
|
||||||
|
3. `store` 模块接口数据处理
|
||||||
|
4. 均基于此依赖实现,具体使用方式请查看 `d.ts`。
|
||||||
|
4. `@cqsjjb/jjb-react-admin-component`
|
||||||
|
1. 公共组件库,具体组件使用方式请查看 `d.ts`。
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
_ooOoo_
|
||||||
|
o8888888o
|
||||||
|
88" . "88
|
||||||
|
(| -_- |)
|
||||||
|
O\ = /O
|
||||||
|
____/`---'\____
|
||||||
|
. ' \\| |// `.
|
||||||
|
/ \\||| : |||// \
|
||||||
|
/ _||||| -:- |||||- \
|
||||||
|
| | \\\ - /// | |
|
||||||
|
| \_| ''\---/'' | |
|
||||||
|
\ .-\__ `-` ___/-. /
|
||||||
|
___`. .' /--.--\ `. . __
|
||||||
|
."" '< `.___\_<|>_/___.' >'"".
|
||||||
|
| | : `- \`.;`\ _ /`;.`/ - ` : | |
|
||||||
|
\ \ `-. \_ __\ /__ _/ .-` / /
|
||||||
|
======`-.____`-.___\_____/___.-`____.-'======
|
||||||
|
`=---='
|
||||||
|
|
||||||
|
.............................................
|
||||||
|
佛祖保佑 永无BUG
|
||||||
|
佛曰:
|
||||||
|
写字楼里写字间,写字间里程序员;
|
||||||
|
程序人员写程序,又拿程序换酒钱。
|
||||||
|
酒醒只在网上坐,酒醉还来网下眠;
|
||||||
|
酒醉酒醒日复日,网上网下年复年。
|
||||||
|
但愿老死电脑间,不愿鞠躬老板前;
|
||||||
|
奔驰宝马贵者趣,公交自行程序员。
|
||||||
|
别人笑我忒疯癫,我笑自己命太贱;
|
||||||
|
不见满街漂亮妹,哪个归得程序员?
|
||||||
|
*/
|
||||||
|
|
||||||
|
const blessedByBuddha
|
||||||
|
= "%c _ooOoo_\n"
|
||||||
|
+ " o8888888o\n"
|
||||||
|
+ " 88\" . \"88\n"
|
||||||
|
+ " (| -_- |)\n"
|
||||||
|
+ " O\\ = /O\n"
|
||||||
|
+ " ____/`---'\\____\n"
|
||||||
|
+ " . ' \\\\| |// `.\n"
|
||||||
|
+ " / \\\\||| : |||// \\\n"
|
||||||
|
+ " / _||||| -:- |||||- \\\n"
|
||||||
|
+ " | | \\\\\\ - /// | |\n"
|
||||||
|
+ " | \\_| ''\\---/'' | |\n"
|
||||||
|
+ " \\ .-\\__ `-` ___/-. /\n"
|
||||||
|
+ " ___`. .' /--.--\\ `. . __\n"
|
||||||
|
+ " .\"\" '< `.___\\_<|>_/___.' >'\"\".\n"
|
||||||
|
+ " | | : `- \\`.;`\\ _ /`;.`/ - ` : | |\n"
|
||||||
|
+ " \\ \\ `-. \\_ __\\ /__ _/ .-` / /\n"
|
||||||
|
+ " ======`-.____`-.___\\_____/___.-`____.-'======\n"
|
||||||
|
+ " `=---='\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "%c .............................................\n"
|
||||||
|
+ " 佛祖保佑 永无BUG\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "%c 佛曰:\n"
|
||||||
|
+ " 写字楼里写字间,写字间里程序员;\n"
|
||||||
|
+ " 程序人员写程序,又拿程序换酒钱。\n"
|
||||||
|
+ " 酒醒只在网上坐,酒醉还来网下眠;\n"
|
||||||
|
+ " 酒醉酒醒日复日,网上网下年复年。\n"
|
||||||
|
+ " 但愿老死电脑间,不愿鞠躬老板前;\n"
|
||||||
|
+ " 奔驰宝马贵者趣,公交自行程序员。\n"
|
||||||
|
+ " 别人笑我忒疯癫,我笑自己命太贱;\n"
|
||||||
|
+ " 不见满街漂亮妹,哪个归得程序员?";
|
||||||
|
console.log(blessedByBuddha, "color:#ffd700", "color:red", "color:#1e80ff");
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
import antfu from "@antfu/eslint-config";
|
||||||
|
|
||||||
|
export default antfu({
|
||||||
|
formatters: {
|
||||||
|
html: false,
|
||||||
|
css: true,
|
||||||
|
},
|
||||||
|
test: false,
|
||||||
|
typescript: true,
|
||||||
|
react: true,
|
||||||
|
vue: false,
|
||||||
|
markdown: false,
|
||||||
|
stylistic: {
|
||||||
|
semi: true,
|
||||||
|
quotes: "double",
|
||||||
|
},
|
||||||
|
overrides: {
|
||||||
|
react: {
|
||||||
|
"react/no-comment-textnodes": "off",
|
||||||
|
"react-hooks-extra/no-unnecessary-use-prefix": "off",
|
||||||
|
"react-hooks-extra/prefer-use-state-lazy-initialization": "off",
|
||||||
|
"react-hooks/exhaustive-deps": "off",
|
||||||
|
"react/no-implicit-key": "off",
|
||||||
|
},
|
||||||
|
javascript: {
|
||||||
|
"no-console": process.env.NODE_ENV === "production" ? "error" : "warn",
|
||||||
|
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "warn",
|
||||||
|
"no-alert": process.env.NODE_ENV === "production" ? "error" : "warn",
|
||||||
|
"no-restricted-syntax": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
selector: "VariableDeclarator[id.name='pd']",
|
||||||
|
message: "不允许使用 pd,请改用有语义化的变量名",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "ObjectExpression > Property[key.name='pd']",
|
||||||
|
message: "不允许使用 pd,请改用有语义化的变量名",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"no-unused-vars": ["error", { varsIgnorePattern: "^React$" }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"antfu/top-level-function": "off",
|
||||||
|
"node/prefer-global/process": "off",
|
||||||
|
"dot-notation": "off",
|
||||||
|
"linebreak-style": ["off", "windows"],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
module.exports = {
|
||||||
|
compact: false,
|
||||||
|
// 插件
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
"@babel/plugin-proposal-decorators",
|
||||||
|
{
|
||||||
|
legacy: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
// 预设
|
||||||
|
presets: [
|
||||||
|
["@babel/preset-env", {
|
||||||
|
targets: {
|
||||||
|
browsers: ["ie >= 10"],
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
["@babel/preset-react", {
|
||||||
|
runtime: "automatic",
|
||||||
|
}],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
module.exports = {
|
||||||
|
// 应用后端git地址,部署上线需要
|
||||||
|
javaGit: "<git-url>",
|
||||||
|
// 应用后端仓库名称,部署上线需要
|
||||||
|
javaGitName: "<git-name>",
|
||||||
|
// 环境配置
|
||||||
|
environment: {
|
||||||
|
development: {
|
||||||
|
// 应用后端分支名称,部署上线需要
|
||||||
|
javaGitBranch: "<branch-name>",
|
||||||
|
// 接口服务地址
|
||||||
|
API_HOST: "http://192.168.20.100:30140",
|
||||||
|
// API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||||
|
},
|
||||||
|
production: {
|
||||||
|
// 应用后端分支名称,部署上线需要
|
||||||
|
javaGitBranch: "<branch-name>",
|
||||||
|
// 接口服务地址
|
||||||
|
API_HOST: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 应用唯一标识符
|
||||||
|
appIdentifier: "hidden_evaluation",
|
||||||
|
// 应用上下文注入全局变量
|
||||||
|
contextInject: {
|
||||||
|
// 应用Key
|
||||||
|
appKey: "",
|
||||||
|
// fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||||
|
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||||
|
},
|
||||||
|
// public/index.html注入全局变量
|
||||||
|
windowInject: {
|
||||||
|
// 应用标题
|
||||||
|
title: "微应用模板",
|
||||||
|
// 注入css链接集合
|
||||||
|
links: [],
|
||||||
|
element: {
|
||||||
|
root: {
|
||||||
|
// 挂载DOM元素ID
|
||||||
|
id: "root",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 注入js链接集合
|
||||||
|
scripts: [],
|
||||||
|
},
|
||||||
|
// 开发服务
|
||||||
|
server: {
|
||||||
|
// 监听端口号
|
||||||
|
port: "8085",
|
||||||
|
// 服务地址
|
||||||
|
host: "127.0.0.1",
|
||||||
|
// 是否自动打开浏览器
|
||||||
|
open: true,
|
||||||
|
},
|
||||||
|
// 框架
|
||||||
|
framework: {
|
||||||
|
// ant-design
|
||||||
|
antd: {
|
||||||
|
// 全局antd-class-name前缀
|
||||||
|
"ant-prefix": "micro-temp",
|
||||||
|
// 全局字体
|
||||||
|
"fontFamily": "PingFangSC-Regular",
|
||||||
|
// 全局主题色
|
||||||
|
"colorPrimary": "#1677ff",
|
||||||
|
// 全局圆角
|
||||||
|
"borderRadius": 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// webpack
|
||||||
|
webpackConfig: {
|
||||||
|
// 单页面插件
|
||||||
|
htmlWebpackPluginOption: {
|
||||||
|
// 自动注入编译后的文件到public/index.html中
|
||||||
|
inject: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"paths": {
|
||||||
|
"~/*": ["*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["src"]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"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": {
|
||||||
|
"@ahooksjs/use-url-state": "^3.5.1",
|
||||||
|
"@ant-design/icons": "^6.1.0",
|
||||||
|
"@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.28.0",
|
||||||
|
"dayjs": "^1.11.7",
|
||||||
|
"lodash-es": "^4.17.21",
|
||||||
|
"react": "^18.2.0",
|
||||||
|
"react-dom": "^18.2.0",
|
||||||
|
"react-to-print": "^3.2.0",
|
||||||
|
"zy-react-library": "^1.2.10"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@antfu/eslint-config": "^5.4.1",
|
||||||
|
"@babel/plugin-proposal-decorators": "^7.19.3",
|
||||||
|
"@cqsjjb/scripts": "2.0.0-alpha-1",
|
||||||
|
"@eslint-react/eslint-plugin": "^2.2.2",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"eslint": "^9.37.0",
|
||||||
|
"eslint-plugin-format": "^1.0.2",
|
||||||
|
"eslint-plugin-react-hooks": "^7.0.0",
|
||||||
|
"eslint-plugin-react-refresh": "^0.4.23",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
<!--BEGIN-->
|
||||||
|
<!--<% var { env: $env, process: $process, mode: $mode, builtInfo: $builtInfo, links: $links, redirectLogin: $redirectLogin, framework: $framework, scripts: $scripts, element: $element } = htmlWebpackPlugin.options %>-->
|
||||||
|
<!--<% var { appKey: $appKey, antd: $antd, basename: $basename, API_HOST: $API_HOST } = $process %>-->
|
||||||
|
<!--<% var { ['ant-prefix']: $antPrefix, fontFamily: $fontFamily, colorPrimary: $colorPrimary, borderRadius: $borderRadius } = $antd %>-->
|
||||||
|
<!--NED-->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh">
|
||||||
|
<head data-built-info="<%= $builtInfo %>">
|
||||||
|
<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.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
|
||||||
|
<% for (const item of $links) { %>
|
||||||
|
<link type="text/css" rel="stylesheet" href="<%= item %>"></link>
|
||||||
|
<% } %>
|
||||||
|
<title>--</title>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
const APP_ENV = {
|
||||||
|
antd: {
|
||||||
|
'ant-prefix': '<%= $antPrefix %>',
|
||||||
|
fontFamily: '<%= $fontFamily %>',
|
||||||
|
colorPrimary: '<%= $colorPrimary %>',
|
||||||
|
borderRadius: parseInt('<%= $borderRadius %>')
|
||||||
|
},
|
||||||
|
appKey: '<%= $appKey %>',
|
||||||
|
basename: '<%= $basename %>',
|
||||||
|
API_HOST: '<%= $API_HOST %>'
|
||||||
|
};
|
||||||
|
APP_ENV.API_HOST = sessionStorage.API_HOST || APP_ENV.API_HOST || window.location.origin;
|
||||||
|
window.process = {
|
||||||
|
env: { app: APP_ENV },
|
||||||
|
NODE_ENV: '<%= $mode %>'
|
||||||
|
};
|
||||||
|
window.__JJB_ENVIRONMENT__ = {
|
||||||
|
API_HOST: APP_ENV.API_HOST,
|
||||||
|
redirect: '<%= $redirectLogin %>',
|
||||||
|
FRAMEWORK: APP_ENV.antd
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<!-- SCRIPTS -->
|
||||||
|
<% for (const item of $scripts) { %>
|
||||||
|
<script src="<%= item %>" type="text/javascript"></script>
|
||||||
|
<% } %>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- NOSCRIPT -->
|
||||||
|
<noscript>此网页需要开启JavaScript功能。</noscript>
|
||||||
|
<!-- MAIN -->
|
||||||
|
<% const { root } = $element; %>
|
||||||
|
<div id="<%= root.id %>" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
### 监管端
|
||||||
|
#### /hidden_evaluation/container/supervision/evaluationTeamConfig/list 分公司考评组配置
|
||||||
|
#### /hidden_evaluation/container/supervision/hiddenEvaluation/list 分公司隐患考评
|
||||||
|
#### /hidden_evaluation/container/supervision/personnelEvaluation/list 人员考评管理
|
||||||
|
#### /hidden_evaluation/container/supervision/performanceEvaluation/list 分公司绩效考评
|
||||||
|
|
||||||
|
### 分公司端
|
||||||
|
#### /hidden_evaluation/container/enterprise/hiddenEvaluation/list 分公司隐患考评
|
||||||
|
#### /hidden_evaluation/container/enterprise/personnelEvaluation/userExchangeList 人员考评管理
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const evaluationTeamConfigList = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hiddenEvaluation/evaluationConfig/list",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigAdd = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hiddenEvaluation/evaluationCorp/save",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigUpdate = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hiddenEvaluation/evaluationConfig/editBath",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigView = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
"Post > @/hiddenEvaluation/evaluationConfig/listAll",
|
||||||
|
);
|
||||||
|
export const evaluationTeamConfigChangeLog = declareRequest(
|
||||||
|
"evaluationTeamConfigLoading",
|
||||||
|
`Post > @/hiddenEvaluation/evaluationConfigLog/list`,
|
||||||
|
);
|
||||||
|
export const corpInfoList = declareRequest(
|
||||||
|
`Post > @/basicInfo/corpInfo/list`,
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
export {};
|
||||||
|
|
||||||
|
// export const riskList = declareRequest(
|
||||||
|
// "loading",
|
||||||
|
// "Post > @/xxx",
|
||||||
|
// "dataSource: [] | res.data || [] & total: 0 | res.totalCount || 0 & pageIndex: 1 | res.pageIndex || 1 & pageSize: 10 | res.pageSize || 10",
|
||||||
|
// );
|
||||||
|
// export const riskDelete = declareRequest(
|
||||||
|
// "loading",
|
||||||
|
// "Delete > @/xxx/{id}",
|
||||||
|
// );
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const hiddenEvaluationList = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationRecord/corpHidddenPage",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenList = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationRecord/hidddenPage",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenEvaluationView = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationDetail/listAll",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenEvaluationViewComplete = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationDetail/listAllComplete",
|
||||||
|
);
|
||||||
|
export const hiddenEvaluationHiddenEvaluationAdd = declareRequest(
|
||||||
|
"hiddenEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationDetail/save",
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const performanceEvaluationList = declareRequest(
|
||||||
|
"performanceEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationRecord/corpEvalPage",
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const personnelEvaluationList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationRecord/corpEvalStatisticsPage",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationUserExchangeList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationRecord/userEvalStatisticsPage",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationExchange = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenExchangeBath/exchangeScore",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationUserExchangeRecordList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenExchangeBath/list",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationHiddenExchangeList = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenExchangeInfo/list",
|
||||||
|
);
|
||||||
|
export const personnelEvaluationHiddenEvalPage = declareRequest(
|
||||||
|
"personnelEvaluationLoading",
|
||||||
|
"Post > @/hiddenEvaluation/hiddenEvaluationRecord/hiddenEvalPage",
|
||||||
|
);
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -0,0 +1,56 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Descriptions, Modal } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { EVALUATION_IS_COMPLIANT_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const ViewEvaluationModal = (props) => {
|
||||||
|
const { query = {} } = props;
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props[props.complete ? "hiddenEvaluationHiddenEvaluationViewComplete" : "hiddenEvaluationHiddenEvaluationView"]({
|
||||||
|
hiddenId: props.hiddenId,
|
||||||
|
corpinfoId: query.corpinfoId,
|
||||||
|
evaluationType: query.evaluationType,
|
||||||
|
});
|
||||||
|
setList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="考评详情"
|
||||||
|
width={800}
|
||||||
|
open
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
footer={[
|
||||||
|
<Button key="cancel" onClick={props.onCancel}>
|
||||||
|
取消
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={2}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 150 } }}
|
||||||
|
items={[
|
||||||
|
...list.flatMap(item => ([
|
||||||
|
{ label: "考评人员", children: `${item.evaluationDeptName}-${item.evaluationUserName}` },
|
||||||
|
{
|
||||||
|
label: "是否符合",
|
||||||
|
children: getLabelName({ list: EVALUATION_IS_COMPLIANT_ENUM, status: item.isCompliant }) || "未考评",
|
||||||
|
},
|
||||||
|
...(item.isCompliant === 0 ? [{ label: "不符合原因", children: "nonCompliantReason", span: 2 }] : []),
|
||||||
|
])),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Connect([NS_HIDDEN_EVALUATION], true)(ViewEvaluationModal);
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
* 全局常量定义
|
||||||
|
*/
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|
||||||
|
export const EVALUATION_RESULT_ENUM = [
|
||||||
|
{ bianma: "1", name: "考核未完成" },
|
||||||
|
{ bianma: "2", name: "考评合格" },
|
||||||
|
{ bianma: "3", name: "考核不合格" },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const EVALUATION_IS_COMPLIANT_ENUM = [
|
||||||
|
{ bianma: "0", name: "不符合" },
|
||||||
|
{ bianma: "1", name: "符合" },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const EVALUATION_TYPE_ENUM = [
|
||||||
|
{ bianma: "1", name: "安全类" },
|
||||||
|
{ bianma: "2", name: "环保类" },
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* 全局上下文定义
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
// 获取antd全局静态方法
|
||||||
|
export const InjectContext = React.createContext({});
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* 全局数据状态管理模块定义
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { defineNamespace } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const NS_GLOBAL = defineNamespace("global");
|
||||||
|
export const NS_EVALUATION_TEAM_CONFIG = defineNamespace("evaluationTeamConfig");
|
||||||
|
export const NS_HIDDEN_EVALUATION = defineNamespace("hiddenEvaluation");
|
||||||
|
export const NS_PERSONNEL_EVALUATION = defineNamespace("personnelEvaluation");
|
||||||
|
export const NS_PERFORMANCE_EVALUATION = defineNamespace("performanceEvaluation");
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
import { setJJBCommonAntdMessage } from "@cqsjjb/jjb-common-lib";
|
||||||
|
import { setup } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { message } from "antd";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { getFileUrlFromServer } from "zy-react-library/utils";
|
||||||
|
import "dayjs/locale/zh-cn";
|
||||||
|
import "../blessed_by_buddha";
|
||||||
|
|
||||||
|
require("antd/dist/reset.css");
|
||||||
|
require("zy-react-library/css/common.less");
|
||||||
|
|
||||||
|
window.mapLongitude = "119.69457721306945";
|
||||||
|
window.mapLatitude = "39.940504336846665";
|
||||||
|
window.mapBaiDuKey = "OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr";
|
||||||
|
|
||||||
|
dayjs.locale("zh-cn");
|
||||||
|
setJJBCommonAntdMessage(message);
|
||||||
|
|
||||||
|
const app = setup();
|
||||||
|
getFileUrlFromServer();
|
||||||
|
// 非底座环境运行
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 挂载
|
||||||
|
* @param props {{ setGlobalState: ({ rendered: boolean }) => void }}
|
||||||
|
* @returns {Promise<*>} ''
|
||||||
|
*/
|
||||||
|
export const mount = async (props) => {
|
||||||
|
// 云组件默认依赖
|
||||||
|
window.__coreLib.React = require("react");
|
||||||
|
window.__coreLib.ReactDOM = require("react-dom");
|
||||||
|
window.__coreLib.jjbCommonLib = require("@cqsjjb/jjb-common-lib");
|
||||||
|
app.mount(props);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 卸载
|
||||||
|
* @param props {object}
|
||||||
|
* @returns {Promise<*>} ''
|
||||||
|
*/
|
||||||
|
export const unmount = async props => app.unmount(props);
|
||||||
|
/**
|
||||||
|
* @description 启动
|
||||||
|
* @param props
|
||||||
|
*/
|
||||||
|
export const bootstrap = async props => app.bootstrap(props);
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import HiddenListPage from "~/pages/Container/Supervision/HiddenEvaluation/HiddenList";
|
||||||
|
|
||||||
|
function HiddenList(props) {
|
||||||
|
return (<HiddenListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenList;
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
|
||||||
|
function HiddenView() {
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
|
<HiddenInfo />
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenView;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import ListPage from "~/pages/Container/Supervision/HiddenEvaluation/List";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
return (<ListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default List;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function HiddenEvaluation(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenEvaluation;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import HiddenEvaluationListPage from "~/pages/Container/Supervision/PersonnelEvaluation/HiddenEvaluationList";
|
||||||
|
|
||||||
|
function HiddenEvaluationList(props) {
|
||||||
|
return (<HiddenEvaluationListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenEvaluationList;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import HiddenExchangeListPage from "~/pages/Container/Supervision/PersonnelEvaluation/HiddenExchangeList";
|
||||||
|
|
||||||
|
function HiddenExchangeList(props) {
|
||||||
|
return (<HiddenExchangeListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenExchangeList;
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
|
||||||
|
function HiddenView() {
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
|
<HiddenInfo />
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenView;
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||||
|
import UserExchangeListPage from "~/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList";
|
||||||
|
|
||||||
|
function UserExchangeList(props) {
|
||||||
|
const { getUserInfo } = useGetUserInfo();
|
||||||
|
|
||||||
|
const [userInfo, setUserInfo] = useState({});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
(async () => {
|
||||||
|
const userInfo = await getUserInfo();
|
||||||
|
setUserInfo(userInfo);
|
||||||
|
})();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{userInfo.corpinfoId && (
|
||||||
|
<UserExchangeListPage
|
||||||
|
isShowAllAction={false}
|
||||||
|
corpinfoId={userInfo.corpinfoId}
|
||||||
|
entrance="enterprise"
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UserExchangeList;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import UserExchangeRecordListPage from "~/pages/Container/Supervision/PersonnelEvaluation/UserExchangeRecordList";
|
||||||
|
|
||||||
|
function UserExchangeRecordList(props) {
|
||||||
|
return (<UserExchangeRecordListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UserExchangeRecordList;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function PersonnelEvaluation(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PersonnelEvaluation;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function Enterprise(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Enterprise;
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { ImportCore } from "@cqsjjb/jjb-common-decorator/module";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export default class Entry extends React.Component {
|
||||||
|
state = {
|
||||||
|
Component: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if (process.env.app.appKey) {
|
||||||
|
ImportCore({
|
||||||
|
name: "$",
|
||||||
|
from: "https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest",
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.status) {
|
||||||
|
this.setState({ Component: res.module?.default });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { Component } = this.state;
|
||||||
|
return (Component && process.env.app.appKey) && (
|
||||||
|
<Component
|
||||||
|
detail={{ componentKey: process.env.app.appKey }}
|
||||||
|
appKey={process.env.app.appKey}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,457 @@
|
||||||
|
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Descriptions, message, Modal, Space } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useIsExistenceDuplicateSelection from "zy-react-library/hooks/useIsExistenceDuplicateSelection";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { EVALUATION_TYPE_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_EVALUATION_TEAM_CONFIG } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const STATE_ENUM = [
|
||||||
|
{ bianma: "1", name: "安全类已分配" },
|
||||||
|
{ bianma: "2", name: "安全类未分配" },
|
||||||
|
{ bianma: "3", name: "环保类已分配" },
|
||||||
|
{ bianma: "4", name: "环保类未分配" },
|
||||||
|
{ bianma: "5", name: "安全类和环保类已分配" },
|
||||||
|
{ bianma: "6", name: "安全类和环保类未分配" },
|
||||||
|
];
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const [configModalOpen, setConfigModalOpen] = useState(false);
|
||||||
|
const [evaluationType, setEvaluationType] = useState(0);
|
||||||
|
const [currentData, setCurrentData] = useState({});
|
||||||
|
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||||
|
const [viewModalOpen, setViewModalOpen] = useState(false);
|
||||||
|
const [changeLogModalOpen, setChangeLogModalOpen] = useState(false);
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["evaluationTeamConfigList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "corpinfoName", label: "分公司名称" },
|
||||||
|
{ name: "status", label: "考评组状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: STATE_ENUM },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<AddIcon />}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "分公司名称", dataIndex: "corpinfoName" },
|
||||||
|
{ title: "安全类隐患考评组分配状态", dataIndex: "safeEvaluationConfigStatus", width: 220 },
|
||||||
|
{ title: "考评组成员", dataIndex: "safeEvaluationMember" },
|
||||||
|
{ title: "环保类隐患考评组分配状态", dataIndex: "envEvaluationConfigStatus", width: 220 },
|
||||||
|
{ title: "考评组成员", dataIndex: "envEvaluationMember" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 330,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setViewModalOpen(true);
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setConfigModalOpen(true);
|
||||||
|
setEvaluationType(1);
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
安全类组分配
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setConfigModalOpen(true);
|
||||||
|
setEvaluationType(2);
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
环保类组分配
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setChangeLogModalOpen(true);
|
||||||
|
setCurrentData(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
变更记录
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{configModalOpen
|
||||||
|
&& (
|
||||||
|
<ConfigModal
|
||||||
|
evaluationType={evaluationType}
|
||||||
|
onCancel={() => {
|
||||||
|
setConfigModalOpen(false);
|
||||||
|
setEvaluationType(0);
|
||||||
|
setCurrentData({});
|
||||||
|
}}
|
||||||
|
getData={getData}
|
||||||
|
data={currentData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{addModalOpen
|
||||||
|
&& (
|
||||||
|
<AddModal
|
||||||
|
onCancel={() => setAddModalOpen(false)}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{viewModalOpen
|
||||||
|
&& (
|
||||||
|
<ViewModal
|
||||||
|
onCancel={() => {
|
||||||
|
setViewModalOpen(false);
|
||||||
|
setCurrentData({});
|
||||||
|
}}
|
||||||
|
data={currentData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{changeLogModalOpen
|
||||||
|
&& (
|
||||||
|
<ChangeLogModal
|
||||||
|
onCancel={() => {
|
||||||
|
setChangeLogModalOpen(false);
|
||||||
|
setCurrentData({});
|
||||||
|
}}
|
||||||
|
data={currentData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const ConfigModalComponent = (props) => {
|
||||||
|
const evaluationType = props.evaluationType;
|
||||||
|
const evaluationTypeName = getLabelName({ list: EVALUATION_TYPE_ENUM, status: evaluationType });
|
||||||
|
const corpinfoId = props.data.corpinfoId;
|
||||||
|
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
const updateCmdList = FormBuilder.useWatch("updateCmdList", form);
|
||||||
|
|
||||||
|
const { isExistenceDuplicateSelection } = useIsExistenceDuplicateSelection();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["evaluationTeamConfigView"]({
|
||||||
|
corpinfoId,
|
||||||
|
evaluationType,
|
||||||
|
});
|
||||||
|
if (data.length) {
|
||||||
|
form.setFieldValue("updateCmdList", data);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
form.setFieldValue("updateCmdList", [
|
||||||
|
{ corpinfoId: "", departmentId: "", evaluationType, userId: "" },
|
||||||
|
{ corpinfoId: "", departmentId: "", evaluationType, userId: "" },
|
||||||
|
{ corpinfoId: "", departmentId: "", evaluationType, userId: "" },
|
||||||
|
{ corpinfoId: "", departmentId: "", evaluationType, userId: "" },
|
||||||
|
{ corpinfoId: "", departmentId: "", evaluationType, userId: "" },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
corpinfoId && getData();
|
||||||
|
}, []);
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
await isExistenceDuplicateSelection({ data: values.updateCmdList, key: "userId", message: "考评人员存在重复项,请勿重复选择" });
|
||||||
|
const { success } = await props["evaluationTeamConfigUpdate"]({
|
||||||
|
...values,
|
||||||
|
corpinfoId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title={`${evaluationTypeName}隐患考评组分配`}
|
||||||
|
width={1000}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
values={{ evaluationTypeName }}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
showActionButtons={false}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
options={[
|
||||||
|
{ name: "evaluationTypeName", label: "隐患考评组类型", componentProps: { disabled: true }, span: 24 },
|
||||||
|
{
|
||||||
|
name: "updateCmdList",
|
||||||
|
span: 24,
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.FORM_LIST,
|
||||||
|
formListUniqueProps: {
|
||||||
|
showRemoveButton: false,
|
||||||
|
showAddButton: false,
|
||||||
|
options: field => ([
|
||||||
|
{
|
||||||
|
name: [field.name, "departmentId"],
|
||||||
|
label: "考评部门",
|
||||||
|
render: (
|
||||||
|
<DepartmentSelectTree
|
||||||
|
isNeedCorpInfoId={true}
|
||||||
|
params={{ eqCorpinfoId: corpinfoId }}
|
||||||
|
onChange={() => {
|
||||||
|
form.setFieldValue(["updateCmdList", field.name, "userId"], "");
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: [field.name, "userId"],
|
||||||
|
label: "考评人员",
|
||||||
|
render: (
|
||||||
|
<PersonnelSelect
|
||||||
|
params={{ departmentId: updateCmdList?.[field.name]?.departmentId || "" }}
|
||||||
|
onGetOption={(option) => {
|
||||||
|
form.setFieldValue("corpinfoId", option.corpinfoId);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: [field.name, "evaluationType"], label: "用户类型", onlyForLabel: true },
|
||||||
|
{ name: [field.name, "corpinfoId"], label: "企业ID", onlyForLabel: true },
|
||||||
|
]),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
const [corpInfoList, setCorpInfoList] = useState([]);
|
||||||
|
|
||||||
|
const getCorpInfoList = async () => {
|
||||||
|
const { data } = await props["corpInfoList"]({ pageIndex: 1, pageSize: 1000 });
|
||||||
|
setCorpInfoList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getCorpInfoList();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props["evaluationTeamConfigAdd"]({
|
||||||
|
...values,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="新增"
|
||||||
|
width={600}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.evaluationTeamConfig.evaluationTeamConfigLoading}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
showActionButtons={false}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
span={24}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
name: "corpinfoId",
|
||||||
|
label: "分公司",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: corpInfoList,
|
||||||
|
itemsField: { valueKey: "id", labelKey: "corpName" },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ViewModalComponent = (props) => {
|
||||||
|
const corpinfoId = props.data.corpinfoId;
|
||||||
|
|
||||||
|
const [safetyList, setSafetyList] = useState([]);
|
||||||
|
const [environmentalList, setEnvironmentalList] = useState([]);
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data: safetyList } = await props["evaluationTeamConfigView"]({
|
||||||
|
corpinfoId,
|
||||||
|
evaluationType: 1,
|
||||||
|
});
|
||||||
|
setSafetyList(safetyList);
|
||||||
|
const { data: environmentalList } = await props["evaluationTeamConfigView"]({
|
||||||
|
corpinfoId,
|
||||||
|
evaluationType: 2,
|
||||||
|
});
|
||||||
|
setEnvironmentalList(environmentalList);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="查看"
|
||||||
|
width={600}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
footer={[
|
||||||
|
<Button key="back" onClick={props.onCancel}>关闭</Button>,
|
||||||
|
]}
|
||||||
|
maskClosable={false}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={1}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "隐患考评组类型", children: "安全类" },
|
||||||
|
{
|
||||||
|
label: "考评组成员",
|
||||||
|
children: (
|
||||||
|
<div>
|
||||||
|
{safetyList.map(item => (
|
||||||
|
item.departmentName && (
|
||||||
|
<div key={item.id}>
|
||||||
|
{`${item.departmentName}-${item.userName}`}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<Descriptions
|
||||||
|
column={1}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "隐患考评组类型", children: "环保类" },
|
||||||
|
{
|
||||||
|
label: "考评组成员",
|
||||||
|
children: (
|
||||||
|
<div>
|
||||||
|
{environmentalList.map(item => (
|
||||||
|
item.departmentName && (
|
||||||
|
<div key={item.id}>
|
||||||
|
{`${item.departmentName}-${item.userName}`}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ChangeLogModalComponent = (props) => {
|
||||||
|
const corpinfoId = props.data.corpinfoId;
|
||||||
|
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["evaluationTeamConfigChangeLog"]({
|
||||||
|
corpinfoId,
|
||||||
|
});
|
||||||
|
setList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="查看"
|
||||||
|
width={1200}
|
||||||
|
open
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
maskClosable={false}
|
||||||
|
footer={[
|
||||||
|
<Button key="back" onClick={props.onCancel}>关闭</Button>,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={3}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 100 }, content: { width: 100 } }}
|
||||||
|
items={[
|
||||||
|
...list.flatMap(item => ([
|
||||||
|
{ label: "隐患考评组类型", children: getLabelName({ list: EVALUATION_TYPE_ENUM, status: item.evaluateType }) },
|
||||||
|
{ label: "变更前", children: `${item.oldDepartmentName || ""}-${item.oldUserName || ""}` },
|
||||||
|
{ label: "变更后", children: `${item.newDepartmentName || ""}-${item.newUserName || ""}` },
|
||||||
|
])),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ConfigModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ConfigModalComponent);
|
||||||
|
const AddModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(AddModalComponent);
|
||||||
|
const ViewModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ViewModalComponent);
|
||||||
|
const ChangeLogModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ChangeLogModalComponent);
|
||||||
|
export default Connect([NS_EVALUATION_TEAM_CONFIG], true)(Permission(List));
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function EvaluationTeamConfig(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EvaluationTeamConfig;
|
||||||
|
|
@ -0,0 +1,262 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Descriptions, message, Modal, Space, Spin } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import DictionarySelectTree 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 { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import ViewEvaluationModal from "~/components/ViewEvaluationModal";
|
||||||
|
import { EVALUATION_IS_COMPLIANT_ENUM, EVALUATION_RESULT_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function HiddenList(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const [viewEvaluationModalOpen, setViewEvaluationModalOpen] = useState(false);
|
||||||
|
const [evaluationModalOpen, setEvaluationModalOpen] = useState(false);
|
||||||
|
const [currentHiddenId, setCurrentHiddenId] = useState("");
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["hiddenEvaluationHiddenList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
corpinfoId: query.corpinfoId,
|
||||||
|
evaluationType: query.evaluationType,
|
||||||
|
},
|
||||||
|
transform: formData => ({
|
||||||
|
findStartTime: formData.findTime?.[0],
|
||||||
|
findEndTime: formData.findTime?.[1],
|
||||||
|
completeStartTime: formData.completeTime?.[0],
|
||||||
|
completeEndTime: formData.completeTime?.[1],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle="分公司考评隐患">
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "hiddenDesc", label: "隐患描述" },
|
||||||
|
{ name: "source", label: "隐患来源", render: FORM_ITEM_RENDER_ENUM.SELECT, items: HIDDEN_SOURCE_ENUM },
|
||||||
|
{ name: "departmentId", label: "发现部门", render: (<DepartmentSelectTree />) },
|
||||||
|
{ name: "findUserName", label: "隐患发现人" },
|
||||||
|
{ name: "findTime", label: "隐患发现时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
{
|
||||||
|
name: "hiddenType",
|
||||||
|
label: "隐患类型",
|
||||||
|
render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "evaluationResult",
|
||||||
|
label: "考评结果",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: EVALUATION_RESULT_ENUM,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "selfEvaluationFlag",
|
||||||
|
label: "本人是否考评",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: [{ bianma: "0", name: "是" }, { bianma: "1", name: "否" }],
|
||||||
|
},
|
||||||
|
{ name: "completeTime", label: "考评完成时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "隐患来源",
|
||||||
|
dataIndex: "source",
|
||||||
|
render: (_, record) => getLabelName({ list: HIDDEN_SOURCE_ENUM, status: record.source }),
|
||||||
|
},
|
||||||
|
{ title: "隐患描述", dataIndex: "hiddenDesc" },
|
||||||
|
{ title: "隐患发现时间", dataIndex: "hiddenFindTime" },
|
||||||
|
{ title: "隐患发现人", dataIndex: "findUserName" },
|
||||||
|
{ title: "隐患验收人", dataIndex: "checkUserName" },
|
||||||
|
{
|
||||||
|
title: "隐患状态",
|
||||||
|
dataIndex: "state",
|
||||||
|
render: (_, record) => getLabelName({ list: HIDDEN_STATE_ENUM, status: record.state }),
|
||||||
|
},
|
||||||
|
{ title: "已考评组成员", dataIndex: "evaluationMembers" },
|
||||||
|
{ title: "待考评组成员", dataIndex: "noEvaluationMembers" },
|
||||||
|
{
|
||||||
|
title: "考评结果",
|
||||||
|
dataIndex: "evaluationResult",
|
||||||
|
render: (_, record) => getLabelName({ list: EVALUATION_RESULT_ENUM, status: record.evaluationResult }) || "考核未完成",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 230,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./hiddenView?hiddenId=${record.hiddenId}&id=${record.hiddenSnowFlakeId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看隐患详情
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setViewEvaluationModalOpen(true);
|
||||||
|
setCurrentHiddenId(record.hiddenId);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评详情
|
||||||
|
</Button>
|
||||||
|
{!record.currentEvaluationFlag && (
|
||||||
|
<Button
|
||||||
|
disabled={record.finalResult === 2 || record.finalResult === 3}
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setEvaluationModalOpen(true);
|
||||||
|
setCurrentHiddenId(record.hiddenId);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{viewEvaluationModalOpen
|
||||||
|
&& (
|
||||||
|
<ViewEvaluationModal
|
||||||
|
onCancel={() => {
|
||||||
|
setViewEvaluationModalOpen(false);
|
||||||
|
setCurrentHiddenId("");
|
||||||
|
}}
|
||||||
|
hiddenId={currentHiddenId}
|
||||||
|
query={query}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{evaluationModalOpen
|
||||||
|
&& (
|
||||||
|
<EvaluationModal
|
||||||
|
onCancel={() => {
|
||||||
|
setEvaluationModalOpen(false);
|
||||||
|
setCurrentHiddenId("");
|
||||||
|
}}
|
||||||
|
hiddenId={currentHiddenId}
|
||||||
|
query={query}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const EvaluationModalComponent = (props) => {
|
||||||
|
const { getUserInfo } = useGetUserInfo();
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
const [list, setList] = useState([]);
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["hiddenEvaluationHiddenEvaluationView"]({
|
||||||
|
hiddenId: props.hiddenId,
|
||||||
|
corpinfoId: props.query.corpinfoId,
|
||||||
|
evaluationType: props.query.evaluationType,
|
||||||
|
});
|
||||||
|
setList(data);
|
||||||
|
const userInfo = await getUserInfo();
|
||||||
|
form.setFieldValue("user", `${userInfo.departmentName}-${userInfo.name}`);
|
||||||
|
form.setFieldValue("evaluationDeptId", userInfo.departmentId);
|
||||||
|
form.setFieldValue("evaluationDeptName", userInfo.departmentName);
|
||||||
|
form.setFieldValue("evaluationUserId", userInfo.id);
|
||||||
|
form.setFieldValue("evaluationUserName", userInfo.name);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props["hiddenEvaluationHiddenEvaluationAdd"]({
|
||||||
|
...values,
|
||||||
|
hiddenId: props.hiddenId,
|
||||||
|
corpinfoId: props.query.corpinfoId,
|
||||||
|
evaluationType: props.query.evaluationType,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("考评成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="考评"
|
||||||
|
width={1000}
|
||||||
|
open
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.hiddenEvaluation.hiddenEvaluationLoading}
|
||||||
|
>
|
||||||
|
<Spin spinning={props.hiddenEvaluation.hiddenEvaluationLoading}>
|
||||||
|
<Descriptions
|
||||||
|
column={2}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 150 } }}
|
||||||
|
items={[
|
||||||
|
...list.flatMap(item => ([
|
||||||
|
{ label: "考评人员", children: `${item.evaluationDeptName}-${item.evaluationUserName}` },
|
||||||
|
{
|
||||||
|
label: "是否符合",
|
||||||
|
children: getLabelName({ list: EVALUATION_IS_COMPLIANT_ENUM, status: item.isCompliant }) || "未考评",
|
||||||
|
},
|
||||||
|
...(item.isCompliant === 0 ? [{ label: "不符合原因", children: "nonCompliantReason", span: 2 }] : []),
|
||||||
|
])),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<FormBuilder
|
||||||
|
style={{ marginTop: 20 }}
|
||||||
|
form={form}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
labelCol={{ span: 6 }}
|
||||||
|
values={{
|
||||||
|
isCompliant: "1",
|
||||||
|
}}
|
||||||
|
options={[
|
||||||
|
{ name: "user", label: "考评人员", required: false, componentProps: { disabled: true } },
|
||||||
|
{ name: "evaluationDeptId", label: "考评部门ID", onlyForLabel: true },
|
||||||
|
{ name: "evaluationDeptName", label: "考评部门名称", onlyForLabel: true },
|
||||||
|
{ name: "evaluationUserId", label: "考评人ID", onlyForLabel: true },
|
||||||
|
{ name: "evaluationUserName", label: "考评人姓名", onlyForLabel: true },
|
||||||
|
{
|
||||||
|
name: "isCompliant",
|
||||||
|
label: "是否符合",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: EVALUATION_IS_COMPLIANT_ENUM,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "resultCase",
|
||||||
|
label: "不符合原因",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||||
|
dependencies: ["isCompliant"],
|
||||||
|
hidden: formValues => !(formValues.isCompliant === "0"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const EvaluationModal = Connect([NS_HIDDEN_EVALUATION], true)(EvaluationModalComponent);
|
||||||
|
export default Connect([NS_HIDDEN_EVALUATION], true)(HiddenList);
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
|
||||||
|
function HiddenView() {
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
|
<HiddenInfo />
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenView;
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Space } from "antd";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
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 { EVALUATION_TYPE_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_HIDDEN_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["hiddenEvaluationList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "corpinfoName", label: "分公司名称" },
|
||||||
|
{ name: "evaluationType", label: "隐患考评组类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: EVALUATION_TYPE_ENUM },
|
||||||
|
{ name: "userName", label: "考评组成员" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{ title: "分公司名称", dataIndex: "corpinfoName" },
|
||||||
|
{
|
||||||
|
title: "隐患考评组类型",
|
||||||
|
dataIndex: "evaluationType",
|
||||||
|
render: (_, record) => getLabelName({ list: EVALUATION_TYPE_ENUM, status: record.evaluationType }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "安全环保奖惩监管端",
|
||||||
|
dataIndex: "safetyRewardPunishAdminEvalCount",
|
||||||
|
render: (_, record) => (`${record.safetyRewardPunishAdminEvalCount}/${record.safetyRewardPunishAdminTotalCount}`),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "安全环保奖惩企业端",
|
||||||
|
dataIndex: "safetyRewardPunishEntEvalCount",
|
||||||
|
render: (_, record) => (`${record.safetyRewardPunishEntEvalCount}/${record.safetyRewardPunishEntTotalCount}`),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "隐患排查",
|
||||||
|
dataIndex: "hazardCheckEvalCount",
|
||||||
|
render: (_, record) => (`${record.hazardCheckEvalCount}/${record.hazardCheckTotalCount}`),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "隐患快报",
|
||||||
|
dataIndex: "hazardReportEvalCount",
|
||||||
|
render: (_, record) => (`${record.hazardReportEvalCount}/${record.hazardReportTotalCount}`),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "消防检查",
|
||||||
|
dataIndex: "fireCheckEvalCount",
|
||||||
|
render: (_, record) => (`${record.fireCheckEvalCount}/${record.fireCheckTotalCount}`),
|
||||||
|
},
|
||||||
|
{ title: "考评组成员", dataIndex: "evaluationMembers" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 100,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./hiddenList?corpinfoId=${record.corpinfoId}&evaluationType=${record.evaluationType}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_HIDDEN_EVALUATION], true)(Permission(List));
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function HiddenEvaluation(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenEvaluation;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import HiddenEvaluationListPage from "../../PersonnelEvaluation/HiddenEvaluationList";
|
||||||
|
|
||||||
|
function HiddenEvaluationList(props) {
|
||||||
|
return (<HiddenEvaluationListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenEvaluationList;
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
|
||||||
|
function HiddenView() {
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
|
<HiddenInfo />
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenView;
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button } from "antd";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { EVALUATION_TYPE_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_PERFORMANCE_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["performanceEvaluationList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
const getRowSpan = (data, index, dataIndex) => {
|
||||||
|
if (!data || data.length === 0)
|
||||||
|
return 1;
|
||||||
|
const currentRow = data[index];
|
||||||
|
if (!currentRow)
|
||||||
|
return 1;
|
||||||
|
if (index === 0 || currentRow[dataIndex] !== data[index - 1]?.[dataIndex]) {
|
||||||
|
let rowSpan = 1;
|
||||||
|
for (let i = index + 1; i < data.length; i++) {
|
||||||
|
if (data[i]?.[dataIndex] === currentRow[dataIndex]) {
|
||||||
|
rowSpan++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rowSpan;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "corpinfoName", label: "分公司名称" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "分公司名称",
|
||||||
|
dataIndex: "corpinfoName",
|
||||||
|
render: (_, record, index) => {
|
||||||
|
const rowSpan = getRowSpan(tableProps.dataSource || [], index, "corpinfoName");
|
||||||
|
if (!record)
|
||||||
|
return null;
|
||||||
|
return {
|
||||||
|
children: (
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() =>
|
||||||
|
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`)}
|
||||||
|
>
|
||||||
|
{record.corpinfoName}
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
props: { rowSpan },
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "隐患考评组类型",
|
||||||
|
dataIndex: "evaluationType",
|
||||||
|
render: (_, record) => getLabelName({ list: EVALUATION_TYPE_ENUM, status: record.evaluationType }),
|
||||||
|
},
|
||||||
|
{ title: "发现隐患数", dataIndex: "findHiddenCount" },
|
||||||
|
{ title: "已验收隐患数", dataIndex: "checkHiddenCount" },
|
||||||
|
{ title: "已评审合格数", dataIndex: "passHiddenCount" },
|
||||||
|
{ title: "待评审数量", dataIndex: "reviewHiddenCount" },
|
||||||
|
{ title: "已兑换积分", dataIndex: "exchangeScoreCount" },
|
||||||
|
{ title: "未兑换积分", dataIndex: "unExchangeScoreCount" },
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERFORMANCE_EVALUATION], true)(List);
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import UserExchangeListPage from "../../PersonnelEvaluation/UserExchangeList";
|
||||||
|
|
||||||
|
function UserExchangeList(props) {
|
||||||
|
return (<UserExchangeListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UserExchangeList;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import UserExchangeRecordListPage from "../../PersonnelEvaluation/UserExchangeRecordList";
|
||||||
|
|
||||||
|
function UserExchangeRecordList(props) {
|
||||||
|
return (<UserExchangeRecordListPage {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UserExchangeRecordList;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function PerformanceEvaluation(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PerformanceEvaluation;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import HiddenExchangeList from "../HiddenExchangeList";
|
||||||
|
|
||||||
|
function HiddenEvaluationList(props) {
|
||||||
|
return <HiddenExchangeList userHidden={true} {...props} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenEvaluationList;
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Space } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import DictionarySelectTree 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 { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import ViewEvaluationModal from "~/components/ViewEvaluationModal";
|
||||||
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function HiddenExchangeList(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const [viewEvaluationModalOpen, setViewEvaluationModalOpen] = useState(false);
|
||||||
|
const [currentHiddenId, setCurrentHiddenId] = useState("");
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const {
|
||||||
|
tableProps,
|
||||||
|
getData,
|
||||||
|
} = useTable(props[props.userHidden ? "personnelEvaluationHiddenEvalPage" : "personnelEvaluationHiddenExchangeList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
hiddenExchangeBathId: query.hiddenExchangeBathId,
|
||||||
|
findUserId: query.userId,
|
||||||
|
},
|
||||||
|
transform: formData => ({
|
||||||
|
exchangeStartTime: formData.exchangeTime?.[0],
|
||||||
|
exchangeEndTime: formData.exchangeTime?.[1],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle="隐患详情">
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "source", label: "隐患来源", render: FORM_ITEM_RENDER_ENUM.SELECT, items: HIDDEN_SOURCE_ENUM },
|
||||||
|
{ name: "departmentId", label: "发现部门", render: (<DepartmentSelectTree />) },
|
||||||
|
{ name: "findUserName", label: "隐患发现人" },
|
||||||
|
{
|
||||||
|
name: "hiddenType",
|
||||||
|
label: "隐患类型",
|
||||||
|
render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />,
|
||||||
|
},
|
||||||
|
{ name: "exchangeTime", label: "兑换时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: "隐患来源",
|
||||||
|
dataIndex: "source",
|
||||||
|
render: (_, record) => getLabelName({ list: HIDDEN_SOURCE_ENUM, status: record.source }),
|
||||||
|
},
|
||||||
|
{ title: "隐患描述", dataIndex: "hiddenDesc" },
|
||||||
|
{ title: "隐患发现时间", dataIndex: "hiddenFindTime" },
|
||||||
|
{ title: "隐患发现人", dataIndex: "findUserName" },
|
||||||
|
{ title: "隐患验收人", dataIndex: "checkUserName" },
|
||||||
|
{
|
||||||
|
title: "隐患状态",
|
||||||
|
dataIndex: "state",
|
||||||
|
render: (_, record) => getLabelName({ list: HIDDEN_STATE_ENUM, status: record.state }),
|
||||||
|
},
|
||||||
|
{ title: "考评组成员", dataIndex: "evaluationMembers" },
|
||||||
|
{
|
||||||
|
title: "兑换状态",
|
||||||
|
dataIndex: "exchangeFlag",
|
||||||
|
render: (_, record) => record.exchangeFlag === "1" ? "已兑换" : "未兑换",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 230,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./hiddenView?hiddenId=${record.hiddenId}&id=${record.hiddenSnowFlakeId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看隐患详情
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setViewEvaluationModalOpen(true);
|
||||||
|
setCurrentHiddenId(record.hiddenId);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评详情
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{viewEvaluationModalOpen
|
||||||
|
&& (
|
||||||
|
<ViewEvaluationModal
|
||||||
|
onCancel={() => {
|
||||||
|
setViewEvaluationModalOpen(false);
|
||||||
|
setCurrentHiddenId("");
|
||||||
|
}}
|
||||||
|
hiddenId={currentHiddenId}
|
||||||
|
complete={true}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION], true)(HiddenExchangeList);
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
|
||||||
|
function HiddenView() {
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看" contentPadding="0 20px 20px 20px">
|
||||||
|
<HiddenInfo />
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HiddenView;
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Space } from "antd";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["personnelEvaluationList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "departmentId", label: "考评组部门", render: (<DepartmentSelectTree searchType="all" />) },
|
||||||
|
{ name: "evaluationUserName", label: "考评组人员" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{ title: "单位名称", dataIndex: "corpinfoName" },
|
||||||
|
{ title: "完成考评隐患数", dataIndex: "completeEvaluationHiddenNum" },
|
||||||
|
{ title: "待考评隐患数", dataIndex: "waitEvaluationHiddenNum" },
|
||||||
|
{ title: "涉及奖励人数", dataIndex: "involveRewardPersonNum" },
|
||||||
|
{
|
||||||
|
title: "奖励兑换情况",
|
||||||
|
dataIndex: "exchangedHiddenNum",
|
||||||
|
render: (_, record) => (`${record.exchangedHiddenNum}/${record.totalExchangeHiddenNum}`),
|
||||||
|
},
|
||||||
|
{ title: "安全类隐患考评组成员", dataIndex: "safeEvaluationMember" },
|
||||||
|
{ title: "环保类隐患考评组成员", dataIndex: "envEvaluationMember" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 100,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION], true)(Permission(List));
|
||||||
|
|
@ -0,0 +1,180 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space, Spin } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
|
import EditIcon from "zy-react-library/components/Icon/EditIcon";
|
||||||
|
import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_HIDDEN_EVALUATION, NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function UserExchangeList(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const corpinfoId = props.corpinfoId || query.corpinfoId;
|
||||||
|
const { loading: downloadBlobLoading, downloadBlob } = useDownloadBlob();
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["personnelEvaluationUserExchangeList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
corpinfoId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const onBatchExchange = async () => {
|
||||||
|
if (!selectedRowKeys.length) {
|
||||||
|
message.warning("请选择需要兑换的人员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: "兑换确认",
|
||||||
|
content: "确定要兑换吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await props["personnelEvaluationExchange"]({ userIdList: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("兑换成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
message.info("已取消兑换");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const OnRedeemAll = async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "兑换确认",
|
||||||
|
content: "确定要兑换所有人得分吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { data } = await props["personnelEvaluationUserExchangeList"]({ corpinfoId, ...form.getFieldsValue(), pageIndex: 1, pageSize: 9999 });
|
||||||
|
const success = await props["personnelEvaluationExchange"]({
|
||||||
|
userIdList: data.map(item => item.userId),
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("兑换成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
message.info("已取消兑换");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onExportExcel = async () => {
|
||||||
|
if (!selectedRowKeys.length) {
|
||||||
|
message.warning("请选择需要导出的人员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: "导出确认",
|
||||||
|
content: "确定要导出excel吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
await downloadBlob("/hiddenEvaluation/hiddenEvaluationRecord/exportUserEvalStatisticsPage", { params: { corpinfoId, ids: selectedRowKeys } });
|
||||||
|
message.success("导出成功");
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
message.warning("已取消导出");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle="人员考评情况" isShowAllAction={props.isShowAllAction ?? true}>
|
||||||
|
<Spin spinning={downloadBlobLoading}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
name: "departmentId",
|
||||||
|
label: "部门",
|
||||||
|
render: (<DepartmentSelectTree isNeedCorpInfoId params={{ eqCorpinfoId: corpinfoId }} />),
|
||||||
|
},
|
||||||
|
{ name: "userName", label: "姓名" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={
|
||||||
|
!props.corpinfoId && {
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rowKey="userId"
|
||||||
|
toolBarRender={() => (
|
||||||
|
props.entrance !== "enterprise" && (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<EditIcon />}
|
||||||
|
onClick={onBatchExchange}
|
||||||
|
>
|
||||||
|
批量兑换
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<EditIcon />}
|
||||||
|
onClick={OnRedeemAll}
|
||||||
|
>
|
||||||
|
全选兑换
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<ExportIcon />}
|
||||||
|
onClick={onExportExcel}
|
||||||
|
>
|
||||||
|
导出数据
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "用户名", dataIndex: "userName" },
|
||||||
|
{ title: "姓名", dataIndex: "name" },
|
||||||
|
{ title: "部门", dataIndex: "departmentName" },
|
||||||
|
{ title: "岗位", dataIndex: "postName" },
|
||||||
|
{ title: "奖励总得分", dataIndex: "totalScore" },
|
||||||
|
{ title: "已兑换分数", dataIndex: "exchangedScore" },
|
||||||
|
{ title: "未兑换奖励数", dataIndex: "notExchangedScore" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 200,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./userExchangeRecordList?userId=${record.userId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
兑换记录
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./hiddenEvaluationList?userId=${record.userId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
考评详情
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION, NS_HIDDEN_EVALUATION], true)(UserExchangeList);
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Space } from "antd";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
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 useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_PERSONNEL_EVALUATION } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function UserExchangeRecordList(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { tableProps, getData } = useTable(props["personnelEvaluationUserExchangeRecordList"], {
|
||||||
|
form,
|
||||||
|
params: {
|
||||||
|
exchangeUserId: query.userId,
|
||||||
|
},
|
||||||
|
transform: formData => ({
|
||||||
|
exchangeStartTime: formData.dates?.[0],
|
||||||
|
exchangeEndTime: formData.dates?.[1],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle="兑换记录">
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "dates", label: "兑换时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{ title: "兑换时间", dataIndex: "exchangeTime" },
|
||||||
|
{ title: "兑换操作人员", dataIndex: "operateUserName" },
|
||||||
|
{ title: "兑换隐患数", dataIndex: "exchageNum" },
|
||||||
|
{ title: "兑换积分", dataIndex: "exchangeIntegral", render: (_, record) => record.exchageNum },
|
||||||
|
{ title: "剩余积分数", dataIndex: "exchangeRemaining" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 100,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./hiddenExchangeList?hiddenExchangeBathId=${record.hiddenExchangeBathId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
隐患详情
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_PERSONNEL_EVALUATION], true)(UserExchangeRecordList);
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function PersonnelEvaluation(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PersonnelEvaluation;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function Supervision(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Supervision;
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
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";
|
||||||
|
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
get token() {
|
||||||
|
const {
|
||||||
|
colorPrimary,
|
||||||
|
borderRadius,
|
||||||
|
} = this.state;
|
||||||
|
return {
|
||||||
|
fontFamily: window.process.env.app.antd.fontFamily,
|
||||||
|
colorPrimary,
|
||||||
|
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) => {
|
||||||
|
const config = e.data;
|
||||||
|
this.setState({ [config.field]: config.value });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<ConfigProvider
|
||||||
|
theme={{
|
||||||
|
token: this.token,
|
||||||
|
algorithm: this.algorithm,
|
||||||
|
}}
|
||||||
|
locale={language}
|
||||||
|
prefixCls={window.process.env.app.antd["ant-prefix"]}
|
||||||
|
>
|
||||||
|
<App style={{ height: "100%" }}>
|
||||||
|
<AppMiddle {...this.props} />
|
||||||
|
</App>
|
||||||
|
</ConfigProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AppMiddle(props) {
|
||||||
|
return (
|
||||||
|
<InjectContext.Provider value={App.useApp()}>
|
||||||
|
{process.env.NODE_ENV === "development"
|
||||||
|
? props.children
|
||||||
|
: (
|
||||||
|
<Interceptor>
|
||||||
|
{props.children}
|
||||||
|
</Interceptor>
|
||||||
|
)}
|
||||||
|
</InjectContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Interceptor extends React.Component {
|
||||||
|
state = {
|
||||||
|
Component: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if (process.env.app.appKey) {
|
||||||
|
ImportCore({
|
||||||
|
name: "$",
|
||||||
|
from: "https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest",
|
||||||
|
}).then(async (res) => {
|
||||||
|
if (res.status) {
|
||||||
|
this.setState({ 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>
|
||||||
|
)
|
||||||
|
: this.props.children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
export default function () {
|
||||||
|
return (
|
||||||
|
<h1>
|
||||||
|
底座微应用模板,技术文档:
|
||||||
|
<a rel="noreferrer noopener" target="_blank" href="https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko">https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko</a>
|
||||||
|
</h1>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
"use strict";
|
||||||
|
const path = require("node:path");
|
||||||
|
|
||||||
|
function resolve(dir) {
|
||||||
|
return path.join(__dirname, ".", dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
context: path.resolve(__dirname, "./"),
|
||||||
|
resolve: {
|
||||||
|
extensions: [".js"],
|
||||||
|
alias: {
|
||||||
|
"~": resolve("src/"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue