Compare commits
No commits in common. 'master' and 'feature/drag' have entirely different histories.
master
...
feature/dr
Binary file not shown.
Before Width: | Height: | Size: 485 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
@ -1,115 +0,0 @@
|
||||
import { Form, Input, Modal, TreeSelect, message, Checkbox } from 'antd';
|
||||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
useRef,
|
||||
forwardRef,
|
||||
useImperativeHandle,
|
||||
} from 'react';
|
||||
import * as d3 from 'd3';
|
||||
import './index.less';
|
||||
import { HomeOutlined } from '@ant-design/icons';
|
||||
import './index.less';
|
||||
import { getLabel } from '../../util/i18n.js';
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 8 },
|
||||
wrapperCol: { span: 14 },
|
||||
};
|
||||
|
||||
const CopyDialog = forwardRef(
|
||||
({ open, onCreate, onCancel, labelData }, ref) => {
|
||||
const [treeData, setData] = useState([]);
|
||||
const [form] = Form.useForm();
|
||||
const formRef = useRef(null);
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
getTreeData() {
|
||||
form.resetFields();
|
||||
d3.json('/api/bs/hrmorganization/orgchart/getSubCompanyTree').then(
|
||||
(data) => {
|
||||
data.companyTree.map((item, index) => {
|
||||
item.icon = <HomeOutlined />;
|
||||
});
|
||||
setData(data.companyTree);
|
||||
},
|
||||
);
|
||||
},
|
||||
}));
|
||||
|
||||
/**
|
||||
* 根节点树异步加载
|
||||
* @param {} parentId
|
||||
* @returns
|
||||
*/
|
||||
const onRootLoadData = (treeNode) =>
|
||||
new Promise((resolve) => {
|
||||
const { id } = treeNode.props;
|
||||
setTimeout(() => {
|
||||
d3.json(
|
||||
`/api/bs/hrmorganization/orgchart/getSubCompanyTree?subcompany=${id}`,
|
||||
).then((data) => {
|
||||
data.companyTree.map((item, index) => {
|
||||
item.icon = <HomeOutlined />;
|
||||
});
|
||||
let arr = [...treeData, ...data.companyTree];
|
||||
setData(arr);
|
||||
});
|
||||
resolve(undefined);
|
||||
}, 200);
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
title={getLabel(547505, labelData)}
|
||||
okText={getLabel(547319, labelData)}
|
||||
cancelText={getLabel(547318, labelData)}
|
||||
onCancel={onCancel}
|
||||
onOk={() => {
|
||||
form
|
||||
.validateFields()
|
||||
.then((values) => {
|
||||
onCreate(values);
|
||||
})
|
||||
.catch((info) => {
|
||||
console.log('Validate Failed:', info);
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Form ref={formRef} {...layout} form={form} name="form_in_modal">
|
||||
<Form.Item
|
||||
name="company"
|
||||
label={getLabel(547506, labelData)}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `${getLabel(547507, labelData)}`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<TreeSelect
|
||||
className="custom-tree-select"
|
||||
treeDataSimpleMode
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
loadData={onRootLoadData}
|
||||
treeData={treeData}
|
||||
treeIcon
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="copySubDept"
|
||||
valuePropName="checked"
|
||||
label={getLabel(547262, labelData)}
|
||||
>
|
||||
<Checkbox />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
},
|
||||
);
|
||||
export default CopyDialog;
|
@ -1,5 +0,0 @@
|
||||
.ant-select-tree
|
||||
.ant-select-tree-treenode-disabled
|
||||
.ant-select-tree-node-content-wrapper {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
import { Form, Input, Modal, TreeSelect, message } from 'antd';
|
||||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
useRef,
|
||||
forwardRef,
|
||||
useImperativeHandle,
|
||||
} from 'react';
|
||||
import * as d3 from 'd3';
|
||||
import './index.less';
|
||||
import { HomeOutlined, FolderOutlined } from '@ant-design/icons';
|
||||
import './index.less';
|
||||
import { getLabel } from '../../util/i18n.js';
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 14 },
|
||||
};
|
||||
|
||||
const MergeDialog = forwardRef(
|
||||
({ open, onCreate, onCancel, labelData }, ref) => {
|
||||
const [treeData, setData] = useState([]);
|
||||
const [form] = Form.useForm();
|
||||
const formRef = useRef(null);
|
||||
|
||||
const [treeLine, setTreeLine] = useState(true);
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
getTreeData() {
|
||||
form.resetFields();
|
||||
d3.json('/api/bs/hrmorganization/orgchart/getDepartmentTree').then(
|
||||
(data) => {
|
||||
data.departmentTree.map((item, index) => {
|
||||
item.icon = <HomeOutlined />;
|
||||
});
|
||||
setData(data.departmentTree);
|
||||
},
|
||||
);
|
||||
},
|
||||
}));
|
||||
|
||||
/**
|
||||
* 根节点树异步加载
|
||||
* @param {} parentId
|
||||
* @returns
|
||||
*/
|
||||
const onRootLoadData = (treeNode) =>
|
||||
new Promise((resolve) => {
|
||||
const { id } = treeNode.props;
|
||||
setTimeout(() => {
|
||||
d3.json(
|
||||
`/api/bs/hrmorganization/orgchart/getDepartmentTree?subcompany=${id}`,
|
||||
).then((data) => {
|
||||
data.departmentTree.map((item, index) => {
|
||||
if (item.key.indexOf('d') > -1) {
|
||||
item.icon = <FolderOutlined />;
|
||||
} else {
|
||||
item.icon = <HomeOutlined />;
|
||||
}
|
||||
});
|
||||
let arr = [...treeData, ...data.departmentTree];
|
||||
setData(arr);
|
||||
});
|
||||
resolve(undefined);
|
||||
}, 200);
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
title={getLabel(547508, labelData)}
|
||||
okText={getLabel(547319, labelData)}
|
||||
cancelText={getLabel(547318, labelData)}
|
||||
onCancel={onCancel}
|
||||
onOk={() => {
|
||||
form
|
||||
.validateFields()
|
||||
.then((values) => {
|
||||
onCreate(values);
|
||||
})
|
||||
.catch((info) => {
|
||||
console.log('Validate Failed:', info);
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Form ref={formRef} {...layout} form={form} name="form_in_modal">
|
||||
<Form.Item
|
||||
name="department"
|
||||
label={getLabel(547264, labelData)}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `${getLabel(547509, labelData)}`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<TreeSelect
|
||||
className="custom-tree-select"
|
||||
treeDataSimpleMode
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
loadData={onRootLoadData}
|
||||
treeData={treeData}
|
||||
treeIcon
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="mergeName"
|
||||
label={getLabel(547265, labelData)}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `${getLabel(547510, labelData)}`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
},
|
||||
);
|
||||
export default MergeDialog;
|
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,5 @@
|
||||
import React from 'react'
|
||||
|
||||
export default () => {
|
||||
return <div>Hello</div>
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
/*
|
||||
* @Author: Chengliang 1546584672@qq.com
|
||||
* @Date: 2023-09-11 15:33:27
|
||||
* @LastEditors: Chengliang 1546584672@qq.com
|
||||
* @LastEditTime: 2023-09-15 11:39:05
|
||||
* @FilePath: /org-chart-frant/src/pages/statisticsTable.jsx
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import * as d3 from 'd3';
|
||||
import qs from 'qs';
|
||||
import { Table } from 'antd';
|
||||
import { getLabel } from '../util/i18n.js';
|
||||
|
||||
const StatisticsTable = () => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [columns, setColumns] = useState([]);
|
||||
const [labelData, setLabelData] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
d3.json('/api/bs/hrmorganization/orgchart/i18n').then((res) => {
|
||||
setLabelData(res.data);
|
||||
const columns = [
|
||||
{
|
||||
title: `${getLabel(547327, res.data)}`,
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547517, res.data)}`,
|
||||
dataIndex: 'dataIdName',
|
||||
key: 'dataIdName',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547518, res.data)}`,
|
||||
dataIndex: 'superIdName',
|
||||
key: 'superIdName',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547519, res.data)}`,
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
render(value, row, index) {
|
||||
if (value == 1) {
|
||||
return `${getLabel(547332, res.data)}`;
|
||||
} else {
|
||||
return `${getLabel(547331, res.data)}`;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547346, res.data)}`,
|
||||
dataIndex: 'onJobNum',
|
||||
key: 'onJobNum',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547345, res.data)}`,
|
||||
dataIndex: 'staffNum',
|
||||
key: 'staffNum',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547520, res.data)}`,
|
||||
dataIndex: 'creator',
|
||||
key: 'creator',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547521, res.data)}`,
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
},
|
||||
{
|
||||
title: `${getLabel(547522, res.data)}`,
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
},
|
||||
];
|
||||
setColumns(columns);
|
||||
selectData();
|
||||
});
|
||||
}, []);
|
||||
|
||||
const selectData = () => {
|
||||
d3.json(`/api/bs/hrmorganization/orgchart/selectStatistics`).then((res) => {
|
||||
setDataSource(res.data.result);
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ padding: '50px' }}>
|
||||
<Table
|
||||
dataSource={dataSource}
|
||||
columns={columns}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
showTotal: (total) =>
|
||||
`${getLabel(547523, labelData)} ${dataSource.length} ${getLabel(
|
||||
547524,
|
||||
labelData,
|
||||
)}`,
|
||||
}}
|
||||
/>
|
||||
;
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default StatisticsTable;
|
@ -1,15 +0,0 @@
|
||||
let languageIdWeaver = document.cookie
|
||||
.split('; ')
|
||||
.find((row) => row.startsWith('languageidweaver='))
|
||||
?.split('=')[1];
|
||||
if (languageIdWeaver == undefined) {
|
||||
languageIdWeaver = 7;
|
||||
}
|
||||
|
||||
export const getLabel = (key, labelData) => {
|
||||
if (labelData[key]) {
|
||||
return labelData[key].labelName;
|
||||
} else {
|
||||
return languageIdWeaver == 7 ? '标签不存在' : 'Label does not exist';
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue