diff --git a/.umirc.ts b/.umirc.ts
index e64d073..633ddc8 100644
--- a/.umirc.ts
+++ b/.umirc.ts
@@ -2,7 +2,7 @@
* @Author: Chengliang 1546584672@qq.com
* @Date: 2022-08-04 10:22:55
* @LastEditors: Chengliang 1546584672@qq.com
- * @LastEditTime: 2022-12-16 11:24:29
+ * @LastEditTime: 2023-07-24 09:57:14
* @FilePath: /org-chart-frant/.umirc.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -26,7 +26,8 @@ export default defineConfig({
proxy: {
'/api': {
// 标识需要进行转换的请求的url
- target: 'http://127.0.0.1:8686/api', // 服务端域名 / http://localhost:8686
+ //target: 'http://127.0.0.1:8686/api', // 服务端域名 / http://localhost:8686
+ target: 'http://221.226.25.34:11080/api',
changeOrigin: true, // 允许域名进行转换
pathRewrite: { '^/api': '' }, // 将请求url里的ci去掉
},
diff --git a/src/components/dialog/index.jsx b/src/components/dialog/index.jsx
new file mode 100644
index 0000000..0199402
--- /dev/null
+++ b/src/components/dialog/index.jsx
@@ -0,0 +1,134 @@
+import React from 'react';
+import { TreeSelect, Modal, message } from 'antd';
+
+export default class OperateDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ treeData: [],
+ open: false,
+ confirmLoading: false,
+ title: '',
+ operateType: '',
+ root: '',
+ type: 1,
+ };
+ }
+
+ componentDidMount() {}
+
+ handleOk = () => {
+ const { type } = this.state;
+ if (type === 1) {
+ this.props.addFolderNode();
+ } else {
+ this.props.deleteNode();
+ }
+ setTimeout(() => {
+ this.setState({ open: false });
+ message.success('操作成功');
+ }, 200);
+ // if (description.length == 0) {
+ // return message.error('请填写描述信息');
+ // }
+ // this.setState({ confirmLoading: true });
+ // let api =
+ // '/api/bs/hrmorganization/orgchart/versionRecord?fclass=' +
+ // requestData.fclass +
+ // '&description=' +
+ // description;
+ // fetch(api)
+ // .then((res) => res.json())
+ // .then((data) => {
+ // if (data.api_status) {
+ // this.setState({
+ // open: false,
+ // confirmLoading: false,
+ // description: '',
+ // });
+ // message.success('版本记录成功,请重新刷新页面', 2, 3);
+ // } else {
+ // message.error('版本记录失败,请联系相关人员处理数据', 2, 3);
+ // }
+ // });
+ };
+
+ /**
+ * 根节点树数据
+ * @param {} parentId
+ * @returns
+ */
+ getNodeTreeNode = (parentId) => {
+ this.setState({ confirmLoading: true });
+ fetch(`/api/bs/hrmorganization/orgchart/getSubCompanyTree`)
+ .then((res) => res.json())
+ .then((data) => {
+ if (data.api_status) {
+ let arr = [];
+ arr = [...this.state.treeData, ...data.companyTree];
+ this.setState({
+ treeData: arr,
+ confirmLoading: false,
+ });
+ }
+ });
+ };
+
+ /**
+ * 根节点树异步加载
+ * @param {} parentId
+ * @returns
+ */
+ onRootLoadData = (treeNode) =>
+ new Promise((resolve) => {
+ const { id } = treeNode.props;
+ setTimeout(() => {
+ let api = `/api/bs/hrmorganization/orgchart/getSubCompanyTree?subcompany=${id}`;
+ this.getNodeTreeNode(api);
+ resolve(undefined);
+ }, 500);
+ });
+
+ showOperate = (id, title, type) => {
+ this.setState({
+ open: true,
+ confirmLoading: true,
+ title: title,
+ type: type,
+ });
+ this.getNodeTreeNode(id);
+ };
+
+ onRootChange = (value) => {
+ this.setState({ root: value });
+ };
+
+ render() {
+ const { treeData, open, confirmLoading, title } = this.state;
+ return (
+ <>
+