commit 57077512f1362cd54bb593c87af2604ba94eb5a4 Author: LiuJiaNan <15703339975@163.com> Date: Mon Mar 30 17:38:24 2026 +0800 init diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..271822f --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b840685 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..96ed201 --- /dev/null +++ b/.vscode/settings.json @@ -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" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3da031 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# 微应用模板说明文档 + +## 在线文档 + +https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko + + +## 安装依赖 +项目依赖可通过 **yarn** 或 **npm** 进行安装: + +```bash +# 使用 yarn +yarn + +# 或使用 npm +npm i +``` + +## 开发服务&打包应用 + +```bash +# 启动开发服务 +yarn serve: +# 或 +npm run serve: + +# 开发环境打包 +yarn build: +# 或 +npm run build: +``` + +## 路由配置&路由访问&自动化路由 +所有页面必须放在`src/pages/container`目录下,启动访问页面请在浏览器地址栏输入`//container/<你的路由页面文件名称>` +解释: +1. 所有页面组件命名为`index.js`或`index.jsx`,必须放在一个首字母大写的文件中。 +2. `container`为固定路径访问格式 +3. ``为应用的唯一标识符,也是应用路由的`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`。 diff --git a/blessed_by_buddha.js b/blessed_by_buddha.js new file mode 100644 index 0000000..340fa53 --- /dev/null +++ b/blessed_by_buddha.js @@ -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"); diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..fab559e --- /dev/null +++ b/eslint.config.js @@ -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"], + }, +}); diff --git a/jjb.babel.js b/jjb.babel.js new file mode 100644 index 0000000..e58cbef --- /dev/null +++ b/jjb.babel.js @@ -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", + }], + ], +}; diff --git a/jjb.config.js b/jjb.config.js new file mode 100644 index 0000000..caafb9f --- /dev/null +++ b/jjb.config.js @@ -0,0 +1,77 @@ +module.exports = { + // 应用后端git地址,部署上线需要 + javaGit: "", + // 应用后端仓库名称,部署上线需要 + javaGitName: "", + // 环境配置 + environment: { + development: { + // 应用后端分支名称,部署上线需要 + javaGitBranch: "", + // 接口服务地址 + API_HOST: "http://192.168.20.100:30140", + // API_HOST: "https://gbs-gateway.qhdsafety.com", + }, + production: { + // 应用后端分支名称,部署上线需要 + javaGitBranch: "", + // 接口服务地址 + 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, + }, + }, +}; diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..4cf89dc --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "src", + "paths": { + "~/*": ["*"] + } + }, + "include": ["src"] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d36a67d --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..9bfa85d --- /dev/null +++ b/public/index.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + <% for (const item of $links) { %> + + <% } %> + -- + + + <% for (const item of $scripts) { %> + + <% } %> + + + + + + <% const { root } = $element; %> +
+ + diff --git a/router.md b/router.md new file mode 100644 index 0000000..d8f7acd --- /dev/null +++ b/router.md @@ -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 人员考评管理 diff --git a/src/api/evaluationTeamConfig/index.js b/src/api/evaluationTeamConfig/index.js new file mode 100644 index 0000000..1dd6b75 --- /dev/null +++ b/src/api/evaluationTeamConfig/index.js @@ -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`, +); diff --git a/src/api/global/index.js b/src/api/global/index.js new file mode 100644 index 0000000..ba35796 --- /dev/null +++ b/src/api/global/index.js @@ -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}", +// ); diff --git a/src/api/hiddenEvaluation/index.js b/src/api/hiddenEvaluation/index.js new file mode 100644 index 0000000..cb55c0c --- /dev/null +++ b/src/api/hiddenEvaluation/index.js @@ -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", +); diff --git a/src/api/performanceEvaluation/index.js b/src/api/performanceEvaluation/index.js new file mode 100644 index 0000000..04c480e --- /dev/null +++ b/src/api/performanceEvaluation/index.js @@ -0,0 +1,6 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const performanceEvaluationList = declareRequest( + "performanceEvaluationLoading", + "Post > @/hiddenEvaluation/hiddenEvaluationRecord/corpEvalPage", +); diff --git a/src/api/personnelEvaluation/index.js b/src/api/personnelEvaluation/index.js new file mode 100644 index 0000000..cb76f56 --- /dev/null +++ b/src/api/personnelEvaluation/index.js @@ -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", +); diff --git a/src/assets/images/ai_recognize.png b/src/assets/images/ai_recognize.png new file mode 100644 index 0000000..e3cc0fc Binary files /dev/null and b/src/assets/images/ai_recognize.png differ diff --git a/src/components/ViewEvaluationModal/index.js b/src/components/ViewEvaluationModal/index.js new file mode 100644 index 0000000..55a0bfc --- /dev/null +++ b/src/components/ViewEvaluationModal/index.js @@ -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 ( + + 取消 + , + ]} + > + ([ + { 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 }] : []), + ])), + ]} + /> + + ); +}; + +export default Connect([NS_HIDDEN_EVALUATION], true)(ViewEvaluationModal); diff --git a/src/components/index.js b/src/components/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/index.js @@ -0,0 +1 @@ +export {}; diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js new file mode 100644 index 0000000..2a0eb66 --- /dev/null +++ b/src/enumerate/constant/index.js @@ -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: "环保类" }, +]; diff --git a/src/enumerate/context/index.js b/src/enumerate/context/index.js new file mode 100644 index 0000000..2b11e05 --- /dev/null +++ b/src/enumerate/context/index.js @@ -0,0 +1,8 @@ +/** + * 全局上下文定义 + */ + +import React from "react"; + +// 获取antd全局静态方法 +export const InjectContext = React.createContext({}); diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js new file mode 100644 index 0000000..c033077 --- /dev/null +++ b/src/enumerate/namespace/index.js @@ -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"); diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..8eb4fed --- /dev/null +++ b/src/main.js @@ -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); diff --git a/src/pages/Container/Enterprise/HiddenEvaluation/HiddenList/index.js b/src/pages/Container/Enterprise/HiddenEvaluation/HiddenList/index.js new file mode 100644 index 0000000..e22549f --- /dev/null +++ b/src/pages/Container/Enterprise/HiddenEvaluation/HiddenList/index.js @@ -0,0 +1,7 @@ +import HiddenListPage from "~/pages/Container/Supervision/HiddenEvaluation/HiddenList"; + +function HiddenList(props) { + return (); +} + +export default HiddenList; diff --git a/src/pages/Container/Enterprise/HiddenEvaluation/HiddenView/index.js b/src/pages/Container/Enterprise/HiddenEvaluation/HiddenView/index.js new file mode 100644 index 0000000..aa91bb4 --- /dev/null +++ b/src/pages/Container/Enterprise/HiddenEvaluation/HiddenView/index.js @@ -0,0 +1,12 @@ +import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj"; +import Page from "zy-react-library/components/Page"; + +function HiddenView() { + return ( + + + + ); +} + +export default HiddenView; diff --git a/src/pages/Container/Enterprise/HiddenEvaluation/List/index.js b/src/pages/Container/Enterprise/HiddenEvaluation/List/index.js new file mode 100644 index 0000000..d1f1090 --- /dev/null +++ b/src/pages/Container/Enterprise/HiddenEvaluation/List/index.js @@ -0,0 +1,7 @@ +import ListPage from "~/pages/Container/Supervision/HiddenEvaluation/List"; + +function List(props) { + return (); +} + +export default List; diff --git a/src/pages/Container/Enterprise/HiddenEvaluation/index.js b/src/pages/Container/Enterprise/HiddenEvaluation/index.js new file mode 100644 index 0000000..315bd29 --- /dev/null +++ b/src/pages/Container/Enterprise/HiddenEvaluation/index.js @@ -0,0 +1,5 @@ +function HiddenEvaluation(props) { + return props.children; +} + +export default HiddenEvaluation; diff --git a/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenEvaluationList/index.js b/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenEvaluationList/index.js new file mode 100644 index 0000000..cf3fee7 --- /dev/null +++ b/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenEvaluationList/index.js @@ -0,0 +1,7 @@ +import HiddenEvaluationListPage from "~/pages/Container/Supervision/PersonnelEvaluation/HiddenEvaluationList"; + +function HiddenEvaluationList(props) { + return (); +} + +export default HiddenEvaluationList; diff --git a/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenExchangeList/index.js b/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenExchangeList/index.js new file mode 100644 index 0000000..41f7a2f --- /dev/null +++ b/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenExchangeList/index.js @@ -0,0 +1,7 @@ +import HiddenExchangeListPage from "~/pages/Container/Supervision/PersonnelEvaluation/HiddenExchangeList"; + +function HiddenExchangeList(props) { + return (); +} + +export default HiddenExchangeList; diff --git a/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenView/index.js b/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenView/index.js new file mode 100644 index 0000000..aa91bb4 --- /dev/null +++ b/src/pages/Container/Enterprise/PersonnelEvaluation/HiddenView/index.js @@ -0,0 +1,12 @@ +import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj"; +import Page from "zy-react-library/components/Page"; + +function HiddenView() { + return ( + + + + ); +} + +export default HiddenView; diff --git a/src/pages/Container/Enterprise/PersonnelEvaluation/UserExchangeList/index.js b/src/pages/Container/Enterprise/PersonnelEvaluation/UserExchangeList/index.js new file mode 100644 index 0000000..3a0b4ba --- /dev/null +++ b/src/pages/Container/Enterprise/PersonnelEvaluation/UserExchangeList/index.js @@ -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 ( +
+ {userInfo.corpinfoId && ( + + )} +
+ ); +} + +export default UserExchangeList; diff --git a/src/pages/Container/Enterprise/PersonnelEvaluation/UserExchangeRecordList/index.js b/src/pages/Container/Enterprise/PersonnelEvaluation/UserExchangeRecordList/index.js new file mode 100644 index 0000000..64b9d69 --- /dev/null +++ b/src/pages/Container/Enterprise/PersonnelEvaluation/UserExchangeRecordList/index.js @@ -0,0 +1,7 @@ +import UserExchangeRecordListPage from "~/pages/Container/Supervision/PersonnelEvaluation/UserExchangeRecordList"; + +function UserExchangeRecordList(props) { + return (); +} + +export default UserExchangeRecordList; diff --git a/src/pages/Container/Enterprise/PersonnelEvaluation/index.js b/src/pages/Container/Enterprise/PersonnelEvaluation/index.js new file mode 100644 index 0000000..7c17913 --- /dev/null +++ b/src/pages/Container/Enterprise/PersonnelEvaluation/index.js @@ -0,0 +1,5 @@ +function PersonnelEvaluation(props) { + return props.children; +} + +export default PersonnelEvaluation; diff --git a/src/pages/Container/Enterprise/index.js b/src/pages/Container/Enterprise/index.js new file mode 100644 index 0000000..c7a390b --- /dev/null +++ b/src/pages/Container/Enterprise/index.js @@ -0,0 +1,5 @@ +function Enterprise(props) { + return props.children; +} + +export default Enterprise; diff --git a/src/pages/Container/Entry/index.js b/src/pages/Container/Entry/index.js new file mode 100644 index 0000000..c51ecfd --- /dev/null +++ b/src/pages/Container/Entry/index.js @@ -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) && ( + + ); + } +} diff --git a/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js b/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js new file mode 100644 index 0000000..7d5e4c0 --- /dev/null +++ b/src/pages/Container/Supervision/EvaluationTeamConfig/List/index.js @@ -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 ( + + + ( + + + + )} + 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) => ( + + + + + + + ), + }, + ]} + {...tableProps} + /> + {configModalOpen + && ( + { + setConfigModalOpen(false); + setEvaluationType(0); + setCurrentData({}); + }} + getData={getData} + data={currentData} + /> + )} + {addModalOpen + && ( + setAddModalOpen(false)} + getData={getData} + /> + )} + {viewModalOpen + && ( + { + setViewModalOpen(false); + setCurrentData({}); + }} + data={currentData} + /> + )} + {changeLogModalOpen + && ( + { + setChangeLogModalOpen(false); + setCurrentData({}); + }} + data={currentData} + /> + )} + + ); +} + +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 ( + + ([ + { + name: [field.name, "departmentId"], + label: "考评部门", + render: ( + { + form.setFieldValue(["updateCmdList", field.name, "userId"], ""); + }} + /> + ), + }, + { + name: [field.name, "userId"], + label: "考评人员", + render: ( + { + form.setFieldValue("corpinfoId", option.corpinfoId); + }} + /> + ), + }, + { name: [field.name, "evaluationType"], label: "用户类型", onlyForLabel: true }, + { name: [field.name, "corpinfoId"], label: "企业ID", onlyForLabel: true }, + ]), + }, + }, + ]} + /> + + ); +}; + +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 ( + + + + ); +}; + +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 ( + 关闭, + ]} + maskClosable={false} + > + + {safetyList.map(item => ( + item.departmentName && ( +
+ {`${item.departmentName}-${item.userName}`} +
+ ) + ))} + + ), + }, + ]} + /> + + {environmentalList.map(item => ( + item.departmentName && ( +
+ {`${item.departmentName}-${item.userName}`} +
+ ) + ))} + + ), + }, + ]} + /> +
+ ); +}; + +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 ( + 关闭, + ]} + > + ([ + { label: "隐患考评组类型", children: getLabelName({ list: EVALUATION_TYPE_ENUM, status: item.evaluateType }) }, + { label: "变更前", children: `${item.oldDepartmentName || ""}-${item.oldUserName || ""}` }, + { label: "变更后", children: `${item.newDepartmentName || ""}-${item.newUserName || ""}` }, + ])), + ]} + /> + + ); +}; + +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)); diff --git a/src/pages/Container/Supervision/EvaluationTeamConfig/index.js b/src/pages/Container/Supervision/EvaluationTeamConfig/index.js new file mode 100644 index 0000000..8c07b03 --- /dev/null +++ b/src/pages/Container/Supervision/EvaluationTeamConfig/index.js @@ -0,0 +1,5 @@ +function EvaluationTeamConfig(props) { + return props.children; +} + +export default EvaluationTeamConfig; diff --git a/src/pages/Container/Supervision/HiddenEvaluation/HiddenList/index.js b/src/pages/Container/Supervision/HiddenEvaluation/HiddenList/index.js new file mode 100644 index 0000000..5731883 --- /dev/null +++ b/src/pages/Container/Supervision/HiddenEvaluation/HiddenList/index.js @@ -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 ( + + ) }, + { name: "findUserName", label: "隐患发现人" }, + { name: "findTime", label: "隐患发现时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE }, + { + name: "hiddenType", + label: "隐患类型", + render: , + }, + { + 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} + /> +
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) => ( + + + + {!record.currentEvaluationFlag && ( + + )} + + ), + }, + ]} + {...tableProps} + /> + {viewEvaluationModalOpen + && ( + { + setViewEvaluationModalOpen(false); + setCurrentHiddenId(""); + }} + hiddenId={currentHiddenId} + query={query} + /> + )} + {evaluationModalOpen + && ( + { + setEvaluationModalOpen(false); + setCurrentHiddenId(""); + }} + hiddenId={currentHiddenId} + query={query} + getData={getData} + /> + )} + + ); +} + +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 ( + + + ([ + { 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 }] : []), + ])), + ]} + /> + !(formValues.isCompliant === "0"), + }, + ]} + /> + + + ); +}; + +const EvaluationModal = Connect([NS_HIDDEN_EVALUATION], true)(EvaluationModalComponent); +export default Connect([NS_HIDDEN_EVALUATION], true)(HiddenList); diff --git a/src/pages/Container/Supervision/HiddenEvaluation/HiddenView/index.js b/src/pages/Container/Supervision/HiddenEvaluation/HiddenView/index.js new file mode 100644 index 0000000..aa91bb4 --- /dev/null +++ b/src/pages/Container/Supervision/HiddenEvaluation/HiddenView/index.js @@ -0,0 +1,12 @@ +import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj"; +import Page from "zy-react-library/components/Page"; + +function HiddenView() { + return ( + + + + ); +} + +export default HiddenView; diff --git a/src/pages/Container/Supervision/HiddenEvaluation/List/index.js b/src/pages/Container/Supervision/HiddenEvaluation/List/index.js new file mode 100644 index 0000000..1d57ebf --- /dev/null +++ b/src/pages/Container/Supervision/HiddenEvaluation/List/index.js @@ -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 ( + + +
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) => ( + + + + ), + }, + ]} + {...tableProps} + /> + + ); +} + +export default Connect([NS_HIDDEN_EVALUATION], true)(Permission(List)); diff --git a/src/pages/Container/Supervision/HiddenEvaluation/index.js b/src/pages/Container/Supervision/HiddenEvaluation/index.js new file mode 100644 index 0000000..315bd29 --- /dev/null +++ b/src/pages/Container/Supervision/HiddenEvaluation/index.js @@ -0,0 +1,5 @@ +function HiddenEvaluation(props) { + return props.children; +} + +export default HiddenEvaluation; diff --git a/src/pages/Container/Supervision/PerformanceEvaluation/HiddenEvaluationList/index.js b/src/pages/Container/Supervision/PerformanceEvaluation/HiddenEvaluationList/index.js new file mode 100644 index 0000000..694474a --- /dev/null +++ b/src/pages/Container/Supervision/PerformanceEvaluation/HiddenEvaluationList/index.js @@ -0,0 +1,7 @@ +import HiddenEvaluationListPage from "../../PersonnelEvaluation/HiddenEvaluationList"; + +function HiddenEvaluationList(props) { + return (); +} + +export default HiddenEvaluationList; diff --git a/src/pages/Container/Supervision/PerformanceEvaluation/HiddenView/index.js b/src/pages/Container/Supervision/PerformanceEvaluation/HiddenView/index.js new file mode 100644 index 0000000..aa91bb4 --- /dev/null +++ b/src/pages/Container/Supervision/PerformanceEvaluation/HiddenView/index.js @@ -0,0 +1,12 @@ +import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj"; +import Page from "zy-react-library/components/Page"; + +function HiddenView() { + return ( + + + + ); +} + +export default HiddenView; diff --git a/src/pages/Container/Supervision/PerformanceEvaluation/List/index.js b/src/pages/Container/Supervision/PerformanceEvaluation/List/index.js new file mode 100644 index 0000000..1631343 --- /dev/null +++ b/src/pages/Container/Supervision/PerformanceEvaluation/List/index.js @@ -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 ( + + +
{ + const rowSpan = getRowSpan(tableProps.dataSource || [], index, "corpinfoName"); + if (!record) + return null; + return { + children: ( + + ), + 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} + /> + + ); +} + +export default Connect([NS_PERFORMANCE_EVALUATION], true)(List); diff --git a/src/pages/Container/Supervision/PerformanceEvaluation/UserExchangeList/index.js b/src/pages/Container/Supervision/PerformanceEvaluation/UserExchangeList/index.js new file mode 100644 index 0000000..6eedf17 --- /dev/null +++ b/src/pages/Container/Supervision/PerformanceEvaluation/UserExchangeList/index.js @@ -0,0 +1,7 @@ +import UserExchangeListPage from "../../PersonnelEvaluation/UserExchangeList"; + +function UserExchangeList(props) { + return (); +} + +export default UserExchangeList; diff --git a/src/pages/Container/Supervision/PerformanceEvaluation/UserExchangeRecordList/index.js b/src/pages/Container/Supervision/PerformanceEvaluation/UserExchangeRecordList/index.js new file mode 100644 index 0000000..3db8fe5 --- /dev/null +++ b/src/pages/Container/Supervision/PerformanceEvaluation/UserExchangeRecordList/index.js @@ -0,0 +1,7 @@ +import UserExchangeRecordListPage from "../../PersonnelEvaluation/UserExchangeRecordList"; + +function UserExchangeRecordList(props) { + return (); +} + +export default UserExchangeRecordList; diff --git a/src/pages/Container/Supervision/PerformanceEvaluation/index.js b/src/pages/Container/Supervision/PerformanceEvaluation/index.js new file mode 100644 index 0000000..2700c96 --- /dev/null +++ b/src/pages/Container/Supervision/PerformanceEvaluation/index.js @@ -0,0 +1,5 @@ +function PerformanceEvaluation(props) { + return props.children; +} + +export default PerformanceEvaluation; diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/HiddenEvaluationList/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/HiddenEvaluationList/index.js new file mode 100644 index 0000000..2ba1936 --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/HiddenEvaluationList/index.js @@ -0,0 +1,7 @@ +import HiddenExchangeList from "../HiddenExchangeList"; + +function HiddenEvaluationList(props) { + return ; +} + +export default HiddenEvaluationList; diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/HiddenExchangeList/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/HiddenExchangeList/index.js new file mode 100644 index 0000000..1f74889 --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/HiddenExchangeList/index.js @@ -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 ( + + ) }, + { name: "findUserName", label: "隐患发现人" }, + { + name: "hiddenType", + label: "隐患类型", + render: , + }, + { name: "exchangeTime", label: "兑换时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE }, + ]} + form={form} + onFinish={getData} + /> +
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) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + {viewEvaluationModalOpen + && ( + { + setViewEvaluationModalOpen(false); + setCurrentHiddenId(""); + }} + hiddenId={currentHiddenId} + complete={true} + /> + )} + + ); +} + +export default Connect([NS_PERSONNEL_EVALUATION], true)(HiddenExchangeList); diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/HiddenView/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/HiddenView/index.js new file mode 100644 index 0000000..aa91bb4 --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/HiddenView/index.js @@ -0,0 +1,12 @@ +import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj"; +import Page from "zy-react-library/components/Page"; + +function HiddenView() { + return ( + + + + ); +} + +export default HiddenView; diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/List/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/List/index.js new file mode 100644 index 0000000..d9975fb --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/List/index.js @@ -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 ( + + ) }, + { name: "evaluationUserName", label: "考评组人员" }, + ]} + form={form} + onFinish={getData} + /> +
(`${record.exchangedHiddenNum}/${record.totalExchangeHiddenNum}`), + }, + { title: "安全类隐患考评组成员", dataIndex: "safeEvaluationMember" }, + { title: "环保类隐患考评组成员", dataIndex: "envEvaluationMember" }, + { + title: "操作", + width: 100, + fixed: "right", + render: (_, record) => ( + + + + ), + }, + ]} + {...tableProps} + /> + + ); +} + +export default Connect([NS_PERSONNEL_EVALUATION], true)(Permission(List)); diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js new file mode 100644 index 0000000..4e60bce --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeList/index.js @@ -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 ( + + + ), + }, + { name: "userName", label: "姓名" }, + ]} + form={form} + onFinish={getData} + labelCol={{ span: 4 }} + /> +
{ + setSelectedRowKeys(selectedRowKeys); + }, + } + } + rowKey="userId" + toolBarRender={() => ( + props.entrance !== "enterprise" && ( + + + + + + ) + )} + 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) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + ); +} + +export default Connect([NS_PERSONNEL_EVALUATION, NS_HIDDEN_EVALUATION], true)(UserExchangeList); diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeRecordList/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeRecordList/index.js new file mode 100644 index 0000000..74ba40b --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/UserExchangeRecordList/index.js @@ -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 ( + + +
record.exchageNum }, + { title: "剩余积分数", dataIndex: "exchangeRemaining" }, + { + title: "操作", + width: 100, + fixed: "right", + render: (_, record) => ( + + + + ), + }, + ]} + {...tableProps} + /> + + ); +} + +export default Connect([NS_PERSONNEL_EVALUATION], true)(UserExchangeRecordList); diff --git a/src/pages/Container/Supervision/PersonnelEvaluation/index.js b/src/pages/Container/Supervision/PersonnelEvaluation/index.js new file mode 100644 index 0000000..7c17913 --- /dev/null +++ b/src/pages/Container/Supervision/PersonnelEvaluation/index.js @@ -0,0 +1,5 @@ +function PersonnelEvaluation(props) { + return props.children; +} + +export default PersonnelEvaluation; diff --git a/src/pages/Container/Supervision/index.js b/src/pages/Container/Supervision/index.js new file mode 100644 index 0000000..e8ad3c1 --- /dev/null +++ b/src/pages/Container/Supervision/index.js @@ -0,0 +1,5 @@ +function Supervision(props) { + return props.children; +} + +export default Supervision; diff --git a/src/pages/Container/index.js b/src/pages/Container/index.js new file mode 100644 index 0000000..c26d322 --- /dev/null +++ b/src/pages/Container/index.js @@ -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 ( + + + + + + ); + } +} + +function AppMiddle(props) { + return ( + + {process.env.NODE_ENV === "development" + ? props.children + : ( + + {props.children} + + )} + + ); +} + +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") + ? ( + + {this.props.children} + + ) + : this.props.children; + } +} diff --git a/src/pages/index.js b/src/pages/index.js new file mode 100644 index 0000000..64c36bb --- /dev/null +++ b/src/pages/index.js @@ -0,0 +1,8 @@ +export default function () { + return ( +

+ 底座微应用模板,技术文档: + https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko +

+ ); +} diff --git a/webstorm.config.js b/webstorm.config.js new file mode 100644 index 0000000..ca262cd --- /dev/null +++ b/webstorm.config.js @@ -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/"), + }, + }, +};