From 5c2268f4f9715fdf2fe6e0eb856660fecb2a1684 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Mon, 30 May 2022 10:25:30 +0800 Subject: [PATCH 001/155] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/branchNumSetting/index.js | 189 ++++++++---------- 1 file changed, 83 insertions(+), 106 deletions(-) diff --git a/pc4mobx/organization/components/branchNumSetting/index.js b/pc4mobx/organization/components/branchNumSetting/index.js index 6ab1d7d..05f4148 100644 --- a/pc4mobx/organization/components/branchNumSetting/index.js +++ b/pc4mobx/organization/components/branchNumSetting/index.js @@ -1,124 +1,101 @@ -const { inject, observer } = mobxReact; -const ProductItem = ecodeSDK.imp(ProductItem); -const ProductDialog = ecodeSDK.imp(ProductDialog); -const { toJS } = mobx; -// const { product } = ecodeSDK.imp(productDataSource); -const { WeaDialog } = ecCom; -const { createRef } = React; +/* + * Author: 黎永顺 + * Description: 分部编号设置 + * Date: 2022-05-17 14:30:57 + * LastEditTime: 2022-05-30 10:23:18 + */ +import React, { Component, Fragment } from "react"; +import { Button } from "antd"; +import { WeaTop, WeaFormItem, WeaCheckbox, WeaSearchGroup } from "ecCom"; +import StartReservedNumberSet from "./components/startReservedNumberSet"; +import NumberComposition from "./components/numberComposition"; +import { i18n } from "../../public/i18n"; +import "./index.less"; -@inject("projectStore") -@observer -class ProductIndex extends React.Component { +const btns = []; +const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => alert(`点击了搜索 key = ${key}`), + }, +]; +export default class BranchNumSetting extends Component { constructor() { super(); this.state = { - dialogParams: { - visible: false, - productId: "", - }, - dialogWidth: 1200, - dialogHeight: 100, + checkVal: "0", }; - this.productRef = createRef(); - } - componentDidMount() { - window.addEventListener("resize", this.resizeWidthHeight); - this.resizeWidthHeight(); - this.init(); - } - conponentWillUnmount() { - window.removeEventListener("resize", this.resizeWidthHeight); } - resizeWidthHeight = () => { - requestAnimationFrame(() => { - if (!this.productRef.current) { - return; - } - const { offsetWidth, offsetHeight } = this.productRef.current; - this.setState({ - dialogWidth: offsetWidth - 100, - // offsetHeight / 2 - dialogHeight: 80, - }); - }); - }; + componentDidMount() {} - init = () => { - const { - projectStore: { init }, - } = this.props; - init(); - }; - - handlePickProduct = async (productId) => { - const { - projectStore: { viewProject, init }, - } = this.props; - const { api_status } = await viewProject(productId); - if (api_status) init(); - this.setState({ - dialogParams: { ...this.state.dialogParams, visible: true, productId }, - }); + /** + * name:提示文本 + * return {*} + */ + helpContent = () => { + return ( +
+

开启后,可根据设置的分部编号规则自动生成分部编号,涉及场景如下:

+

1.手动新建和手动编辑分部时可选择重新生成编号和选择预留分部编号;

+

2.组织结构导入-添加新分部且分部编号列为空时,会自动生成分部编号;

+

3.导入人员-添加时,新创建的分部可自动生成分部编号;

+

【注意】开启前请先确认分部编号字段已启用!

+
+ ); }; render() { - const { dialogParams, dialogHeight, dialogWidth } = this.state; - const { - projectStore: { product }, - } = this.props; + const { checkVal } = this.state; return ( -
-
- {_.map(toJS(product), (item, index) => { - const { id, title, subTitle, products } = item; - return ( -
- {/*

{title}

-

{subTitle}

*/} - +
+ } + iconBgcolor="#217346" + buttons={btns} + showDropIcon={true} + dropMenuDatas={dropMenuDatas} + /> +
+
+ + this.setState({ checkVal })} + /> + +
+ {/* 内容区 */} + {checkVal === "1" && ( + +
+ + +
- ); - })} - {/* - - 演示 -
- 脚本 -
-
*/} +
+ + + +
+
+ )}
- {/* 弹框 */} - {dialogParams.visible && ( - { - this.resizeWidthHeight(); - this.setState({ - dialogParams: { - ...this.state.dialogParams, - visible: false, - productId: "", - }, - }); - }} - visible={dialogParams.visible} - style={{ width: dialogWidth }}> -
- -
-
- )}
); } } - -ecodeSDK.exp(ProductIndex); From 204613099aa2fc5787a6751b9e520e51b21c00df Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Mon, 6 Jun 2022 14:01:41 +0800 Subject: [PATCH 002/155] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/branchNumSetting/index.js | 2 +- .../components/branchNumSetting/index.less | 23 ++- .../components/deptNumberSet/index.js | 154 ++++++++++++++++++ pc4mobx/organization/index.js | 8 +- pc4mobx/organization/public/i18n.js | 2 + pc4mobx/organization/style/index.less | 20 +-- 6 files changed, 194 insertions(+), 15 deletions(-) create mode 100644 pc4mobx/organization/components/deptNumberSet/index.js diff --git a/pc4mobx/organization/components/branchNumSetting/index.js b/pc4mobx/organization/components/branchNumSetting/index.js index 05f4148..960e39c 100644 --- a/pc4mobx/organization/components/branchNumSetting/index.js +++ b/pc4mobx/organization/components/branchNumSetting/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 分部编号设置 * Date: 2022-05-17 14:30:57 - * LastEditTime: 2022-05-30 10:23:18 + * LastEditTime: 2022-06-06 09:42:23 */ import React, { Component, Fragment } from "react"; import { Button } from "antd"; diff --git a/pc4mobx/organization/components/branchNumSetting/index.less b/pc4mobx/organization/components/branchNumSetting/index.less index 7ae8a45..727212b 100644 --- a/pc4mobx/organization/components/branchNumSetting/index.less +++ b/pc4mobx/organization/components/branchNumSetting/index.less @@ -1,9 +1,11 @@ -.branch-wapper { +.branch-wapper, +.dept-number-set { height: 100%; display: flex; flex-direction: column; - .branch-content { + .branch-content, + .dept-content { flex: 1; overflow: hidden auto; @@ -16,6 +18,23 @@ background: #f7fbfe; } + .codeNumbering { + .codeNumbering-operateWapper { + display: flex; + align-items: center; + + .wea-select { + width: inherit !important; + margin-left: 8px; + } + + .wea-helpful-tip { + margin-left: 8px; + margin-top: 3px; + } + } + } + .numberComposition { .preview { margin-top: 20px; diff --git a/pc4mobx/organization/components/deptNumberSet/index.js b/pc4mobx/organization/components/deptNumberSet/index.js new file mode 100644 index 0000000..17ce04c --- /dev/null +++ b/pc4mobx/organization/components/deptNumberSet/index.js @@ -0,0 +1,154 @@ +/* + * Author: 黎永顺 + * Description: 部门编号设 + * Date: 2022-06-06 09:37:39 + * LastEditTime: 2022-06-06 10:26:35 + */ +import React, { Component, Fragment } from "react"; +import { Button } from "antd"; +import { + WeaTop, + WeaFormItem, + WeaCheckbox, + WeaSearchGroup, + WeaSelect, + WeaHelpfulTip, +} from "ecCom"; +import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; +import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { i18n } from "../../public/i18n"; +import "../branchNumSetting/index.less"; + +export default class DeptNumberSet extends Component { + constructor() { + super(); + this.state = { + checkVal: "0", + isSingle: "0", //是否单独流水 + singleDate: "month", //日期单独流水 + }; + } + + /** + * name:提示文本 + * return {*} + */ + helpContent = () => { + return ( +
+

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

+

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

+

2.导入人员-添加时,新创建的部门可自动生成部门编号;

+

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

+

【注意】开启前请先确认部门编号字段已启用!

+
+ ); + }; + render() { + const { checkVal, isSingle, singleDate } = this.state; + const btns = []; + const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => alert(`点击了搜索 key = ${key}`), + }, + ]; + const options = [ + { + key: "month", + selected: false, + showname: "月", + }, + { + key: "day", + selected: true, + showname: "日", + }, + ]; + return ( +
+ } + iconBgcolor="#217346" + buttons={btns} + showDropIcon={true} + dropMenuDatas={dropMenuDatas} + /> +
+
+ + this.setState({ checkVal })} + /> + +
+ {/* 内容区 */} + {checkVal === "1" && ( + +
+ + + +
+
+ +
+ +
+ this.setState({ isSingle })} + /> + {isSingle == "1" && ( + { + console.log("v", v, "showname", showname); + }} + /> + )} + +
+
+
+
+
+
+ + + +
+
+ )} +
+
+ ); + } +} diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index a97b765..d0ca84f 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -12,8 +12,9 @@ import Group from "./components/group/Group"; import OfficeManage from "./components/office/officeManage"; import CompanyExtend from "./components/company/CompanyExtend"; import BranchNumSetting from "./components/branchNumSetting"; +import DeptNumberSet from "./components/deptNumberSet"; import Company from "./components/company/company"; -import DepartmentManage from "./components/deptment"; +import DepartmentManage from "./components/department/department"; import StaffScheme from "./components/staff/StaffScheme"; import Staff from "./components/staff/Staff"; import Job from "./components/job/Job"; @@ -57,6 +58,11 @@ const Routes = ( path="branchNumSetting" component={BranchNumSetting} /> + diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index b322bdf..7f7137a 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -129,6 +129,8 @@ export const i18n = { editOfficeName: () => getLabel(386247, '编辑职务信息'), newOfficeClassifyName: () => getLabel(386246, '新建职务分类信息'), branchNumSetting: () => getLabel(386246, '分部编号设置'), + deptNumSetting: () => getLabel(386246, '部门编号设置'), + posiNumSetting: () => getLabel(386246, '岗位编号设置'), companyName: () => getLabel(385937, '分部'), staffSchemeName: () => getLabel(385936, '编制方案'), newStaffScheme: () => getLabel(386246, '新建编制方案'), diff --git a/pc4mobx/organization/style/index.less b/pc4mobx/organization/style/index.less index 2915a1e..f661c00 100644 --- a/pc4mobx/organization/style/index.less +++ b/pc4mobx/organization/style/index.less @@ -1,16 +1,16 @@ - - // loading 效果 .wea-demo-loading { height: 100%; text-align: center; + >div { position: absolute; top: 50%; } } -html,body { +html, +body { height: 100%; margin: 0; padding: 0; @@ -22,7 +22,9 @@ body { color: #333333; } -#container, body, html { +#container, +body, +html { height: 100%; overflow: scroll !important } @@ -40,7 +42,7 @@ body { height: 100%; } -.quickOperate{ +.quickOperate { position: fixed; width: 45px; height: 250px; @@ -48,7 +50,7 @@ body { top: 20px; // border: 1px solid #8b4513; - img{ + img { cursor: pointer; width: 30px; height: 30px; @@ -60,8 +62,4 @@ body { display: block; margin-top: 10px; } -} - - - - +} \ No newline at end of file From 2b34890e6de33e7cfddfa18b8bdb96f1bfb5c9bc Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 6 Jun 2022 16:48:19 +0800 Subject: [PATCH 003/155] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=BD=AC=E7=A7=BB=20=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/department.js | 38 +- .../components/company/company.js | 13 +- .../components/department/NewPopconfirm.js | 17 +- .../components/department/department.js | 83 +- pc4mobx/organization/index.js | 1 - pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/department.js | 958 ++++++++++-------- 7 files changed, 615 insertions(+), 496 deletions(-) diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js index 47ddcd6..799ff3d 100644 --- a/pc4mobx/organization/apis/department.js +++ b/pc4mobx/organization/apis/department.js @@ -29,12 +29,20 @@ export const getAdvanceSearchCondition = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/dept/getSearchCondition', 'GET', params); } -export const getHrmListByJobId = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/job/getHrmListByJobId', 'GET', params); +export const getPostionTable = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/dept/getJobListByPid', 'GET', params); } export const getCopyForm = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/dept/getCopyForm', 'GET', params); +} + +export const getMergeForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', params); +} + +export const getTransferForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params); } export const add = (params) => { @@ -49,7 +57,29 @@ export const add = (params) => { } export const copy = (params) => { - return fetch('/api/bs/hrmorganization/job/copyJobItem', { + return fetch('/api/bs/hrmorganization/dept/copyDepartment', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const merge = (params) => { + return fetch('/api/bs/hrmorganization/dept/mergeDepartment', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const transfer = (params) => { + return fetch('/api/bs/hrmorganization/dept/moveDepartment', { method: 'POST', mode: 'cors', headers: { diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index fcc0034..e32d334 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-01 17:15:50 + * @LastEditTime: 2022-06-06 14:21:43 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -271,12 +271,10 @@ export default class Company extends React.Component { c.render = function (text, record) { const menu = ( - { - record.isUsed === 0 ? - { _this.doDel(record.id) }}>删除 - : '' - } - + + { _this.doDel(record.id) }}>删除 + + { _this.select(record.id) }}>联查部门 @@ -402,6 +400,7 @@ export default class Company extends React.Component { } = company; const rowSelection = { + type: "checkbox", onChange(selectedRowKeys, selectedRows) { company.setSelectedRowKeys(selectedRowKeys); }, diff --git a/pc4mobx/organization/components/department/NewPopconfirm.js b/pc4mobx/organization/components/department/NewPopconfirm.js index e68370e..db925d6 100644 --- a/pc4mobx/organization/components/department/NewPopconfirm.js +++ b/pc4mobx/organization/components/department/NewPopconfirm.js @@ -23,7 +23,7 @@ export default class NewPopconfirm extends React.Component { constructor(props) { super(props); this.state = { - width: 700, + padding: "20px" } } @@ -38,19 +38,25 @@ export default class NewPopconfirm extends React.Component { let arr = []; isFormInit && condition.map(c => { c.items.map((field, index) => { - arr.push( - {} + {} ) }) }) return
{arr}
} + onChange = data => { + debugger + + }; + render() { const { title, @@ -59,8 +65,9 @@ export default class NewPopconfirm extends React.Component { onCancel, loading, height, + width } = this.props, { - width, + padding } = this.state; const buttons = [ @@ -84,7 +91,7 @@ export default class NewPopconfirm extends React.Component { loading ?
- : this.getForm() + : this.getForm() } ) diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index dccdfe1..cea9224 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-02 16:41:55 + * @LastEditTime: 2022-06-06 16:40:18 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -42,8 +42,8 @@ import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; - import NewWeaTableDialog from '../NewWeaTableDialog'; -import NewPopconfirm from './NewPopconfirm' + import NewTableDialog from '../NewTableDialog'; + import NewPopconfirm from './NewPopconfirm' const toJS = mobx.toJS; const confirm = Modal.confirm; @@ -132,13 +132,14 @@ import NewPopconfirm from './NewPopconfirm' //联查岗位 select(id) { - // const { - // department - // } = this.props; + const { + department + } = this.props; - // department.setNeDialogTitle("联查人员"); - // department.setVisible(true); - // department.getHrmTable(id); + department.setNeDialogTitle("联查岗位"); + department.setVisible(true); + department.setDialogLoadingStatus(true); + department.getPostionTable(id); } @@ -149,8 +150,10 @@ import NewPopconfirm from './NewPopconfirm' } = this.props; department.setNeDialogTitle(i18n.label.mergeDept()); - department.confirmVisible(true); - department.getMergeForm(); + department.setConfirmVisible(true); + department.setIds(id); + department.setIsMerge(true); + department.getMergeForm(id); } //转移 @@ -159,9 +162,11 @@ import NewPopconfirm from './NewPopconfirm' department } = this.props; - department.setNeDialogTitle(i18n.label.mergeDept()); - department.confirmVisible(true); - department.getTransferForm(); + department.setNeDialogTitle(i18n.label.transferDept()); + department.setConfirmVisible(true); + department.setIds(id); + department.setIsMerge(false); + department.getTransferForm(id); } @@ -331,18 +336,16 @@ import NewPopconfirm from './NewPopconfirm' c.render = function (text, record) { const menu = ( - { - record.isUsed === 0 ? - { _this.doDel(record.id) }}>删除 - : '' - } - + + { _this.doDel(record.id) }}>删除 + + { _this.merge(record.id) }}>合并 - + { _this.transfer(record.id) }}>转移 - + { _this.select(record.id) }}>联查岗位 @@ -372,6 +375,15 @@ import NewPopconfirm from './NewPopconfirm' } = this.props; department.save(); } + + PopconfirmSave() { + const { + department + } = this.props; + const {isMerge} = department; + isMerge && department.merge(); + !isMerge && department.transfer(); + } getTabBtn() { const { @@ -514,10 +526,11 @@ import NewPopconfirm from './NewPopconfirm' isPanelShow, departmentName, conditionNum, visible, condition, form, tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, form1, isEdit, newVisible, jobDataSource, jobColumns, selectedRowKeys, total, current, pageSize, init, - defaultShowLeft,confirmVisible,confirmLoading + defaultShowLeft,confirmVisible,confirmLoading,postionDataSource,postionColumns,isMerge } = department; const rowSelection = { + type:"checkbox", onChange(selectedRowKeys, selectedRows) { department.setSelectedRowKeys(selectedRowKeys); }, @@ -597,13 +610,15 @@ import NewPopconfirm from './NewPopconfirm' - department.setVisible(false)} - /> + department.setVisible(false)} + /> this.handleSave()} - onCancel={() => department.setNewVisible(false)} + height={isMerge ? 100 : 140} + width={400} + isMerge={isMerge} + save={() => this.PopconfirmSave()} + onCancel={() => department.setConfirmVisible(false)} />
) diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index a97b765..4ed6499 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -13,7 +13,6 @@ import OfficeManage from "./components/office/officeManage"; import CompanyExtend from "./components/company/CompanyExtend"; import BranchNumSetting from "./components/branchNumSetting"; import Company from "./components/company/company"; -import DepartmentManage from "./components/deptment"; import StaffScheme from "./components/staff/StaffScheme"; import Staff from "./components/staff/Staff"; import Job from "./components/job/Job"; diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index b322bdf..1542efc 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -142,6 +142,7 @@ export const i18n = { deptManage: () => getLabel(385936, '部门管理'), newDept: () => getLabel(386246, '新建部门'), mergeDept:()=> getLabel(386246, '合并部门'), + transferDept:()=> getLabel(386246, '转移部门'), diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index fa19819..c9d38ea 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -1,457 +1,523 @@ import { - observable, - action - } from 'mobx'; - import * as mobx from 'mobx'; - import * as Api from '../apis/department'; // 引入API接口文件 - import { - WeaForm - } from 'comsMobx'; - import { - WeaTableNew - } from 'comsMobx'; - import { - Modal, - message, - } from 'antd' - import { - i18n - } from '../public/i18n'; - - const toJS = mobx.toJS; - const { - TableStore - } = WeaTableNew; - - - export class DepartmentStore { - @observable tableStore = new TableStore(); - @observable topMenu = [] - @observable rightMenu = []; - @observable dataSource = []; - @observable columns = []; - @observable jobDataSource = []; - @observable jobColumns = []; - @observable loading = true; - @observable dialogLoading = true; - @observable isEdit = true; - @observable nEdialogTitle = ''; - @observable searchCondition = []; - @observable condition = []; - @observable copyCondition = []; - @observable isPanelShow = false; //高级搜索面板 - @observable form = new WeaForm(); - @observable form1 = new WeaForm(); //新增主表表单 - @observable form2 = new WeaForm(); //复制表单 - @observable departmentName = ''; - @observable conditionNum = 8; - @observable ids = ''; //选择行id - @observable id = ''; //页面跳转参数id - @observable searchConditionLoading = true; - @observable visible = false; - @observable newVisible = false; //新增弹窗 - @observable departmentId = ''; - @observable selectedRowKeys = ''; - @observable date = ''; - @observable init = true; //是否首次加载 - @observable total = ''; - @observable current = 1; - @observable pageSize = 10; - - @observable defaultShowLeft = true; - @observable companysId = 1 //集团id - - @observable confirmVisible = false; - @observable confirmLoading = true; - - - @action - getTableInfo(params) { - this.setLoading(true); + observable, + action +} from 'mobx'; +import * as mobx from 'mobx'; +import * as Api from '../apis/department'; // 引入API接口文件 +import { + WeaForm +} from 'comsMobx'; +import { + WeaTableNew +} from 'comsMobx'; +import { + Modal, + message, +} from 'antd' +import { + i18n +} from '../public/i18n'; + +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; + + +export class DepartmentStore { + @observable tableStore = new TableStore(); + @observable topMenu = [] + @observable rightMenu = []; + @observable dataSource = []; + @observable columns = []; + @observable loading = true; + @observable dialogLoading = true; + @observable isEdit = true; + @observable nEdialogTitle = ''; + @observable searchCondition = []; + @observable condition = []; + @observable copyCondition = []; + @observable isPanelShow = false; //高级搜索面板 + @observable form = new WeaForm(); + @observable form1 = new WeaForm(); //新增主表表单 + @observable form2 = new WeaForm(); //复制表单 + @observable departmentName = ''; + @observable conditionNum = 8; + @observable ids = ''; //选择行id + @observable id = ''; //页面跳转参数id + @observable searchConditionLoading = true; + @observable visible = false; + @observable newVisible = false; //新增弹窗 + @observable departmentId = ''; + @observable selectedRowKeys = ''; + @observable date = ''; + @observable init = true; //是否首次加载 + @observable total = ''; + @observable current = 1; + @observable pageSize = 10; + @observable defaultShowLeft = true; + @observable companysId = 1 //集团id + @observable postionDataSource = []; + @observable postionColumns = []; + + @observable confirmVisible = false; + @observable confirmLoading = true; + @observable isMerge = true; + + + @action + getTableInfo(params) { + this.setLoading(true); + params = { + ...params, + current: this.current, + pageSize: this.pageSize + } + if (this.isEmptyObject(this.form.getFormParams())) { params = { ...params, - current: this.current, - pageSize: this.pageSize - } - if (this.isEmptyObject(this.form.getFormParams())) { - params = { - ...params, - ...this.form.getFormParams(), - departmentName: this.departmentName - }; + ...this.form.getFormParams(), + departmentName: this.departmentName + }; + } else { + params = { + ...params, + ...this.form.getFormParams(), + }; + } + Api.getSearchList(params).then(response => { + return response.json() + }).then(res => { + if (res.code === 200) { + res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); + this.setTotal(res.data.pageInfo.total); + res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); + this.setLoading(false); + this.setInit(false); } else { - params = { - ...params, - ...this.form.getFormParams(), - }; + message.warning(res.msg); } - Api.getSearchList(params).then(response => { - return response.json() - }).then(res => { - if (res.code === 200) { - res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); - this.setTotal(res.data.pageInfo.total); - res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); - this.setLoading(false); - this.setInit(false); - } else { - message.warning(res.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } - - @action("nodetree事件") - doSearch(params) { - this.setInit(true); - this.getTableInfo(params); - } - - @action("联查人员") - getHrmTable(id) { - // let params = { - // departmentId: id - // } - // this.tableStore = new TableStore(); - // Api.getHrmListBydepartmentId(params).then(res => { - // if (res.code === 200) { - // res.data.datas && this.tableStore.getDatas(res.data.datas, 1); - // } else { - // message.warning(res.msg); - // } - // }, error => { - // message.warning(error.msg); - // }) - } - - //删除 - delete() { - let params = { - ids: this.ids - }; - Api.deleteTableData(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(i18n.message.deleteSuccess()); - this.setSelectedRowKeys(''); - this.getTableInfo(); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } - - updateForbiddenTag(checked, id) { - let params = { - forbiddenTag: checked, - id: id - } - Api.updateForbiddenTag(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg, 1); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } - - getSearchCondition() { - this.setScLoadingStatus(true); - Api.getAdvanceSearchCondition().then(res => { - if (res.code === 200) { - this.setScLoadingStatus(false); - res.data.conditions && this.setSearchCondition(res.data.conditions); - res.data.conditions && this.form.initFormFields(res.data.conditions); - } else { - message.warning(res.msg); - } - }, error => { - message.warning(error.msg); - }) - } - - - getDeptForm() { - let params = {}; - this.setDialogLoadingStatus(true); - Api.getDeptForm(params).then(res => { - if (res.code === 200) { - this.setDialogLoadingStatus(false); - res.data.condition && this.setCondition(res.data.condition); - res.data.condition && this.form1.initFormFields(res.data.condition); - } else { - message.warning(res.msg); - } - }, error => { - message.warning(error.msg); - }) - } + }).catch(error => { + message.warning(error.msg); + }) + } - @action("合并部门") - getMergeForm() { - // let params = {}; - // this.setConfirmLoading(true); - // Api.getDeptForm(params).then(res => { - // if (res.code === 200) { - // this.setConfirmLoading(false); - // res.data.condition && this.setCondition(res.data.condition); - // res.data.condition && this.form1.initFormFields(res.data.condition); - // } else { - // message.warning(res.msg); - // } - // }, error => { - // message.warning(error.msg); - // }) - } + @action("nodetree事件") + doSearch(params) { + this.setInit(true); + this.getTableInfo(params); + } - @action("转移部门") - getTransferForm() { - // let params = {}; - // this.setConfirmLoading(true); - // Api.getDeptForm(params).then(res => { - // if (res.code === 200) { - // this.setConfirmLoading(false); - // res.data.condition && this.setCondition(res.data.condition); - // res.data.condition && this.form1.initFormFields(res.data.condition); - // } else { - // message.warning(res.msg); - // } - // }, error => { - // message.warning(error.msg); - // }) + @action("联查岗位") + getPostionTable(id) { + let params = { + parentDept: id } - - @action("复制表单") - getCopyForm() { - let params = {}; - Api.getCopyForm(params).then(res => { - if (res.code === 200) { - res.data && this.setCopyCondition(res.data); - res.data && this.form2.initFormFields(res.data); - } else { - message.warning(res.msg); - } - }, error => { - message.warning(error.msg); - }) - } - - - save() { - let params = { - ...this.form1.getFormParams() - }; - this.form1.validateForm().then(f => { - if (f.isValid) { - Api.add(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - this.setNewVisible(false); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } else { - f.showErrors(); - this.setDate(new Date()); - } - }); - } - - copy() { - let params = { - ids: this.ids, - ...this.form2.getFormParams() - }; - Api.copy(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - this.form2 = new WeaForm(); - this.setSelectedRowKeys(''); - } else { - message.error(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - - } - - - @action - getHasRight() { - Api.getHasRight().then(res => { - if (res.code === 200) { - res.data.rightMenu && this.setRightMenu(res.data.rightMenu); - res.data.topMenu && this.setTopMenu(res.data.topMenu); - } else { - message.warning(res.msg); - } - }, error => { - message.warning(error.msg); - }) - } - - updateFields(val) { - this.form.updateFields({ - compName: { - value: val - } - }); - } - - setSearchCondition(condition) { - this.searchCondition = condition; - } - - setScLoadingStatus(bool) { - this.searchConditionLoading = bool; - } - - setPanelStatus(bool) { - this.isPanelShow = bool; - bool && this.getSearchCondition(); - if (!bool) { - this.scLoadingReset(); + Api.getPostionTable(params).then(response => { + return response.json() + }).then(res => { + if (res.code === 200) { + res.data.list && this.setPostionDataSource(res.data.list); + res.data.columns && this.setPostionColumns(res.data.columns); + this.setDialogLoadingStatus(false); + } else { + message.warning(res.msg); } - } - - setDepartmentName(val) { - this.departmentName = val; - } - - isEmptyObject(obj) { - for (let key in obj) { - return false; - } - return true; - } - - setIds(ids) { - this.ids = ids; - } - - setId(id) { - this.id = id; - } - - scLoadingReset() { - this.searchConditionLoading = true; - } - - - formReset() { - this.form1 = new WeaForm(); - } - - - setVisible(bool) { - this.visible = bool; - } - - setDialogLoadingStatus(bool) { - this.dialogLoading = bool; - } - - - setSearchCondition(searchCondition) { - this.searchCondition = searchCondition; - } - - setDepartmentId(departmentId) { - this.departmentId = departmentId; - } - - setDate(date) { - this.date = date; - } - - setTopMenu(topMenu) { - this.topMenu = topMenu; - } - - setRightMenu(rightMenu) { - this.rightMenu = rightMenu; - } - - setDataSource(dataSource) { - this.dataSource = dataSource; - } - - setJobDataSource(jobDataSource) { - this.jobDataSource = jobDataSource; - } - - setColumns(columns) { - this.columns = columns - } - - setJobColumns(jobColumns) { - this.jobColumns = jobColumns - } - - setSelectedRowKeys(selectedRowKeys) { - this.selectedRowKeys = selectedRowKeys; - } - - setLoading(bool) { - this.loading = bool; - } - - setNeDialogTitle(title) { - this.nEdialogTitle = title - } - - setCondition(condition) { - this.condition = condition; - } - - setCopyCondition(copyCondition) { - this.copyCondition = copyCondition; - } - - setNewVisible(bool) { - this.formReset(); - this.newVisible = bool; - } - - setTotal(total) { - this.total = total; - } - - setCurrent(current) { - this.current = current; - } - - setPageSize(pageSize) { - this.pageSize = pageSize; - } - - setInit(bool) { - this.init = bool; - } - - setConfirmVisible(confirmVisible) { - this.confirmVisible = confirmVisible; - } + }).catch(error => { + message.warning(error.msg); + }) + } - setConfirmLoading(confirmLoading) { - this.confirmLoading = confirmLoading; + //删除 + delete() { + let params = { + ids: this.ids + }; + Api.deleteTableData(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(i18n.message.deleteSuccess()); + this.setSelectedRowKeys(''); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + + updateForbiddenTag(checked, id) { + let params = { + forbiddenTag: checked, + id: id } - } \ No newline at end of file + Api.updateForbiddenTag(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg, 1); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + + getSearchCondition() { + this.setScLoadingStatus(true); + Api.getAdvanceSearchCondition().then(res => { + if (res.code === 200) { + this.setScLoadingStatus(false); + res.data.conditions && this.setSearchCondition(res.data.conditions); + res.data.conditions && this.form.initFormFields(res.data.conditions); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + + getDeptForm() { + let params = {}; + this.setDialogLoadingStatus(true); + Api.getDeptForm(params).then(res => { + if (res.code === 200) { + this.setDialogLoadingStatus(false); + res.data.condition && this.setCondition(res.data.condition); + res.data.condition && this.form1.initFormFields(res.data.condition); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action("合并部门") + getMergeForm(id) { + let params = { + id:id + }; + this.setConfirmLoading(true); + Api.getMergeForm(params).then(res => { + if (res.code === 200) { + this.setConfirmLoading(false); + res.data && this.setCondition(res.data); + res.data && this.form1.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action("转移部门") + getTransferForm(id) { + let params = { + id:id + }; + this.setConfirmLoading(true); + Api.getTransferForm(params).then(res => { + if (res.code === 200) { + this.setConfirmLoading(false); + res.data && this.setCondition(res.data); + res.data && this.form1.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action("复制表单") + getCopyForm() { + let params = {}; + Api.getCopyForm(params).then(res => { + if (res.code === 200) { + res.data && this.setCopyCondition(res.data); + res.data && this.form2.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + + save() { + let params = { + ...this.form1.getFormParams() + }; + this.form1.validateForm().then(f => { + if (f.isValid) { + Api.add(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setNewVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + merge() { + let params = { + id:this.ids, + ...this.form1.getFormParams() + }; + this.form1.validateForm().then(f => { + if (f.isValid) { + Api.merge(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setConfirmVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + transfer() { + let params = { + id:this.ids, + ...this.form1.getFormParams() + }; + this.form1.validateForm().then(f => { + if (f.isValid) { + Api.transfer(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setConfirmVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + copy() { + let params = { + ids: this.ids, + ...this.form2.getFormParams() + }; + Api.copy(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.form2 = new WeaForm(); + this.setSelectedRowKeys(''); + } else { + message.error(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + + } + + + @action + getHasRight() { + Api.getHasRight().then(res => { + if (res.code === 200) { + res.data.rightMenu && this.setRightMenu(res.data.rightMenu); + res.data.topMenu && this.setTopMenu(res.data.topMenu); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + updateFields(val) { + this.form.updateFields({ + compName: { + value: val + } + }); + } + + setSearchCondition(condition) { + this.searchCondition = condition; + } + + setScLoadingStatus(bool) { + this.searchConditionLoading = bool; + } + + setPanelStatus(bool) { + this.isPanelShow = bool; + bool && this.getSearchCondition(); + if (!bool) { + this.scLoadingReset(); + } + } + + setDepartmentName(val) { + this.departmentName = val; + } + + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + setIds(ids) { + this.ids = ids; + } + + setId(id) { + this.id = id; + } + + scLoadingReset() { + this.searchConditionLoading = true; + } + + + formReset() { + this.form1 = new WeaForm(); + } + + + setVisible(bool) { + this.visible = bool; + } + + setDialogLoadingStatus(bool) { + this.dialogLoading = bool; + } + + + setSearchCondition(searchCondition) { + this.searchCondition = searchCondition; + } + + setDepartmentId(departmentId) { + this.departmentId = departmentId; + } + + setDate(date) { + this.date = date; + } + + setTopMenu(topMenu) { + this.topMenu = topMenu; + } + + setRightMenu(rightMenu) { + this.rightMenu = rightMenu; + } + + setDataSource(dataSource) { + this.dataSource = dataSource; + } + + setColumns(columns) { + this.columns = columns + } + + setSelectedRowKeys(selectedRowKeys) { + this.selectedRowKeys = selectedRowKeys; + } + + setLoading(bool) { + this.loading = bool; + } + + setNeDialogTitle(title) { + this.nEdialogTitle = title + } + + setCondition(condition) { + this.condition = condition; + } + + setCopyCondition(copyCondition) { + this.copyCondition = copyCondition; + } + + setNewVisible(bool) { + this.formReset(); + this.newVisible = bool; + } + + setTotal(total) { + this.total = total; + } + + setCurrent(current) { + this.current = current; + } + + setPageSize(pageSize) { + this.pageSize = pageSize; + } + + setInit(bool) { + this.init = bool; + } + + setConfirmVisible(confirmVisible) { + this.formReset(); + this.confirmVisible = confirmVisible; + } + + setConfirmLoading(confirmLoading) { + this.confirmLoading = confirmLoading; + } + + setPostionDataSource(postionDataSource) { + this.postionDataSource = postionDataSource; + } + + setPostionColumns(postionColumns) { + this.postionColumns = postionColumns; + } + + setIsMerge(bool) { + this.isMerge = bool; + } +} \ No newline at end of file From 772f0b66ee6d766ecfeb83ee097d2199e41c6596 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 7 Jun 2022 09:34:25 +0800 Subject: [PATCH 004/155] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AC=E7=A7=BB?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/department/NewPopconfirm.js | 53 +++++++++++++------ .../components/department/department.js | 4 +- pc4mobx/organization/stores/department.js | 7 +-- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/pc4mobx/organization/components/department/NewPopconfirm.js b/pc4mobx/organization/components/department/NewPopconfirm.js index db925d6..87c9407 100644 --- a/pc4mobx/organization/components/department/NewPopconfirm.js +++ b/pc4mobx/organization/components/department/NewPopconfirm.js @@ -23,38 +23,61 @@ export default class NewPopconfirm extends React.Component { constructor(props) { super(props); this.state = { - padding: "20px" + value: '0' } } + renderComponent(field, index,form) { + return + {} + + } + getForm() { const { condition, form, isFormInit, - } = this.props; + isMerge + } = this.props, { + value + } = this.state; let arr = []; isFormInit && condition.map(c => { c.items.map((field, index) => { - arr.push( - {} - ) + if(!isMerge){ + if (field.domkey[0] !== 'company' && field.domkey[0] !== 'department') { + arr.push( + this.renderComponent(field,index,form) + ) + } + value === '0' && field.domkey[0] === 'company' && arr.push( + this.renderComponent(field,index,form) + ) + value === '1' && field.domkey[0] === 'department' && arr.push( + this.renderComponent(field,index,form) + ) + }else{ + arr.push( + this.renderComponent(field,index,form)) + } }) }) return
{arr}
} onChange = data => { - debugger - + data.moveType && this.setState({ + value:data.moveType.value + }) }; render() { @@ -66,9 +89,7 @@ export default class NewPopconfirm extends React.Component { loading, height, width - } = this.props, { - padding - } = this.state; + } = this.props const buttons = [ (), diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index cea9224..aebd925 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-06 16:40:18 + * @LastEditTime: 2022-06-06 19:32:11 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -640,7 +640,7 @@ form={form1} isFormInit={form1.isFormInit} loading={confirmLoading} - height={isMerge ? 100 : 140} + height={100} width={400} isMerge={isMerge} save={() => this.PopconfirmSave()} diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index c9d38ea..057f255 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -113,9 +113,7 @@ export class DepartmentStore { let params = { parentDept: id } - Api.getPostionTable(params).then(response => { - return response.json() - }).then(res => { + Api.getPostionTable(params).then(res => { if (res.code === 200) { res.data.list && this.setPostionDataSource(res.data.list); res.data.columns && this.setPostionColumns(res.data.columns); @@ -123,7 +121,7 @@ export class DepartmentStore { } else { message.warning(res.msg); } - }).catch(error => { + },error => { message.warning(error.msg); }) } @@ -343,7 +341,6 @@ export class DepartmentStore { if (data.code === 200) { message.success(data.msg); this.getTableInfo(); - this.form2 = new WeaForm(); this.setSelectedRowKeys(''); } else { message.error(data.msg); From 84b6f732c6429da4fa2afd30828745e189087ea9 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 7 Jun 2022 16:52:12 +0800 Subject: [PATCH 005/155] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/company/company.js | 12 +- .../components/department/department.js | 11 +- pc4mobx/organization/components/job/Job.js | 13 +- .../components/office/officeManage.js | 63 ++++---- .../components/postionrank/JobGrade.js | 8 +- .../components/postionrank/JobLevel.js | 51 +++--- .../components/postionrank/RankScheme.js | 54 ++++--- .../components/sequence/Sequence.js | 8 +- .../organization/components/staff/Staff.js | 11 +- .../components/staff/StaffScheme.js | 22 ++- pc4mobx/organization/stores/company.js | 153 +++++++++--------- pc4mobx/organization/stores/department.js | 6 + pc4mobx/organization/stores/job.js | 7 +- pc4mobx/organization/stores/jobgrade.js | 7 +- pc4mobx/organization/stores/joblevel.js | 6 + pc4mobx/organization/stores/officeManage.js | 6 + pc4mobx/organization/stores/rankscheme.js | 7 +- pc4mobx/organization/stores/sequence.js | 7 +- pc4mobx/organization/stores/staff.js | 7 +- pc4mobx/organization/stores/staffscheme.js | 17 +- 20 files changed, 287 insertions(+), 189 deletions(-) diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index e32d334..f026a49 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-06 14:21:43 + * @LastEditTime: 2022-06-07 16:39:25 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -41,7 +41,7 @@ import '../../style/common.less'; import NewTableDialog from '../NewTableDialog'; import NewAndEditDialog from '../NewAndEditDialog'; import NewWeaTable from '../NewWeaTableDialog'; -import { renderLoading } from '../../util'; // 从util文件引入公共的方法 +import { renderNoright } from '../../util'; @@ -396,9 +396,13 @@ export default class Company extends React.Component { const { isPanelShow, companyName, conditionNum, visible, condition, form, tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, - form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total, current, pageSize, init + form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total, current, pageSize, init,hasRight } = company; + if (hasRight === false) { + return renderNoright(); + } + const rowSelection = { type: "checkbox", onChange(selectedRowKeys, selectedRows) { @@ -426,7 +430,7 @@ export default class Company extends React.Component { return ( -
+ hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index aebd925..ec8277f 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-06 19:32:11 + * @LastEditTime: 2022-06-07 16:15:54 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -40,6 +40,7 @@ } from '../../public/i18n'; import '../../style/common.less'; + import { renderNoright } from '../../util'; import NewAndEditDialog from '../NewAndEditDialog'; import NewTableDialog from '../NewTableDialog'; @@ -526,8 +527,12 @@ isPanelShow, departmentName, conditionNum, visible, condition, form, tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, form1, isEdit, newVisible, jobDataSource, jobColumns, selectedRowKeys, total, current, pageSize, init, - defaultShowLeft,confirmVisible,confirmLoading,postionDataSource,postionColumns,isMerge + defaultShowLeft,confirmVisible,confirmLoading,postionDataSource,postionColumns,isMerge,hasRight } = department; + + if (hasRight === false) { + return renderNoright(); + } const rowSelection = { type:"checkbox", @@ -556,7 +561,7 @@ return ( -
+ hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index f02b16a..c4eaf64 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-02 15:51:37 + * @LastEditTime: 2022-06-07 16:44:49 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -42,7 +42,7 @@ import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; import NewWeaTableDialog from '../NewWeaTableDialog'; -import { renderLoading } from '../../util'; // 从util文件引入公共的方法 +import { renderNoright } from '../../util'; @@ -487,9 +487,14 @@ export default class Job extends React.Component { isPanelShow, jobName, conditionNum, visible, condition, form, tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, form1, isEdit, newVisible,selectedRowKeys, total, current, pageSize, init, - defaultShowLeft,form2 + defaultShowLeft,form2,hasRight } = job; + if (hasRight === false) { + return renderNoright(); + } + + const rowSelection = { onChange(selectedRowKeys, selectedRows) { job.setSelectedRowKeys(selectedRowKeys); @@ -516,7 +521,7 @@ export default class Job extends React.Component { return ( -
+ hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 97995bf..0242424 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -14,6 +14,8 @@ import { import { Row, Col, Spin, Modal, Button, message, Switch } from "antd"; import { WeaSwitch, WeaTableNew } from "comsMobx"; import "./index.less"; +import { renderNoright } from '../../util'; + const confirm = Modal.confirm; const WeaTable = WeaTableNew.WeaTable; @@ -58,7 +60,7 @@ export default class OfficeManage extends Component { handleMenuClick = (key) => { const { officeManageStore } = this.props; - const { isPanelShow,tableStore} = officeManageStore; + const { isPanelShow, tableStore } = officeManageStore; isPanelShow && officeManageStore.setPanelStatus(false); switch (key) { case "new": @@ -248,11 +250,11 @@ export default class OfficeManage extends Component { const { officeManageStore } = this.props, { - tableStore, + tableStore, } = officeManageStore; - -} + + } getPanelComponents = () => { const { officeManageStore } = this.props; @@ -266,24 +268,21 @@ export default class OfficeManage extends Component { c.items.map((field, index) => { arr.push(
{
); @@ -370,24 +368,28 @@ export default class OfficeManage extends Component { condition, form, dialogLoading, + hasRight } = officeManageStore; + + if (hasRight === false) { + return renderNoright(); + } + return ( -
+ hasRight &&
} onCollapse={(showLeft) => console.log("showLeft:", showLeft)}> this.handleMenuClick(key)}> } iconBgcolor="#217346" @@ -397,9 +399,8 @@ export default class OfficeManage extends Component { dropMenuDatas={this.getDropMenuDatas()} onDropMenuClick={(e) => this.handleMenuClick(e)}> this.onSearchChange(val)} /> + hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index 7c3cfdd..426ff7b 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -30,7 +30,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; - +import { renderNoright } from '../../util'; const toJS = mobx.toJS; @@ -225,18 +225,18 @@ export default class JobLevel extends React.Component { let _this = this; columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { - c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + c.render = function (text, record) { + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) } - updateForbiddenTag(checked,id) { + updateForbiddenTag(checked, id) { const { jobLevel } = this.props; - jobLevel.updateForbiddenTag(checked,id); + jobLevel.updateForbiddenTag(checked, id); } onOperatesClick(record, rowIndex, operate) { @@ -262,7 +262,7 @@ export default class JobLevel extends React.Component { const { jobLevel } = this.props; - + jobLevel.setNeDialogTitle(i18n.label.editJobLevel()); jobLevel.setLevelId(id); jobLevel.setIsNew(false); @@ -309,29 +309,29 @@ export default class JobLevel extends React.Component { isFormInit && searchCondition.map(c => { c.items.map((field, index) => { - arr.push( -
- - {} - -
- ) + arr.push( +
+ + {} + +
+ ) }) }) if (searchConditionLoading) { return ( -
+
) } else { return { - if ( e.keyCode == 13 && e.target.tagName === "INPUT") { - jobLevel.getTableInfo(); + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + jobLevel.getTableInfo(); jobLevel.setPanelStatus(false) } }}>{arr} @@ -356,13 +356,16 @@ export default class JobLevel extends React.Component { jobLevel } = this.props; const { - isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date + isPanelShow, form2, levelName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight } = jobLevel; + if (hasRight === false) { + return renderNoright(); + } return ( -
+ hasRight &&
this.handleMenuClick(key)} @@ -389,7 +392,7 @@ export default class JobLevel extends React.Component { searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? levelName : form2.getFormParams().levelName} setShowSearchAd={bool => jobLevel.setPanelStatus(bool)} hideSearchAd={() => jobLevel.setPanelStatus(false)} - searchsAd= {isPanelShow ? this.getPanelComponents() :
} + searchsAd={isPanelShow ? this.getPanelComponents() :
} advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hasMask={false} buttonsAd={this.getTabBtn()} @@ -405,7 +408,7 @@ export default class JobLevel extends React.Component { />
- { if (c.dataIndex == 'forbidden_tag') { - c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + c.render = function (text, record) { + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) } - updateForbiddenTag(checked,id) { + updateForbiddenTag(checked, id) { const { rankScheme } = this.props; - rankScheme.updateForbiddenTag(checked,id); + rankScheme.updateForbiddenTag(checked, id); } onOperatesClick(record, rowIndex, operate) { @@ -256,7 +258,7 @@ export default class RankScheme extends React.Component { const { rankScheme } = this.props; - + rankScheme.setNeDialogTitle(i18n.label.editRankScheme()); rankScheme.setSchemeId(id); rankScheme.setIsNew(false); @@ -303,29 +305,29 @@ export default class RankScheme extends React.Component { isFormInit && searchCondition.map(c => { c.items.map((field, index) => { - arr.push( -
- - {} - -
- ) + arr.push( +
+ + {} + +
+ ) }) }) if (searchConditionLoading) { return ( -
+
) } else { return { - if ( e.keyCode == 13 && e.target.tagName === "INPUT") { - rankScheme.getTableInfo(); + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + rankScheme.getTableInfo(); rankScheme.setPanelStatus(false) } }}>{arr} @@ -350,12 +352,16 @@ export default class RankScheme extends React.Component { rankScheme } = this.props; const { - isPanelShow, form2, schemeName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,date + isPanelShow, form2, schemeName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, date, hasRight } = rankScheme; + if (hasRight === false) { + return renderNoright(); + } + return ( -
+ hasRight &&
this.handleMenuClick(key)} @@ -376,7 +382,7 @@ export default class RankScheme extends React.Component { searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? schemeName : form2.getFormParams().schemeName} setShowSearchAd={bool => rankScheme.setPanelStatus(bool)} hideSearchAd={() => rankScheme.setPanelStatus(false)} - searchsAd= {isPanelShow ? this.getPanelComponents() :
} + searchsAd={isPanelShow ? this.getPanelComponents() :
} advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hasMask={false} buttonsAd={this.getTabBtn()} @@ -392,7 +398,7 @@ export default class RankScheme extends React.Component { />
-
- ) + ) } } \ No newline at end of file diff --git a/pc4mobx/organization/components/sequence/Sequence.js b/pc4mobx/organization/components/sequence/Sequence.js index 1cb9bde..deb6b49 100644 --- a/pc4mobx/organization/components/sequence/Sequence.js +++ b/pc4mobx/organization/components/sequence/Sequence.js @@ -30,6 +30,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; +import { renderNoright } from '../../util'; @@ -358,12 +359,15 @@ export default class Sequence extends React.Component { } = this.props; const { isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date + form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date,hasRight } = sequence; + if (hasRight === false) { + return renderNoright(); + } return ( -
+ hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 38f7e08..a4d1dd0 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -30,6 +30,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; +import { renderNoright } from '../../util'; @@ -210,7 +211,7 @@ export default class Staff extends React.Component { form2 } = staff; - staff.setSchemeName(val); + staff.setStaffName(val); !this.isEmptyObject(form2.getFormParams()) && staff.updateFields(val); } @@ -353,11 +354,15 @@ export default class Staff extends React.Component { } = this.props; const { isPanelShow, form2, staffName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,date + form,dialogLoading,isEdit,date,hasRight } = staff; + if (hasRight === false) { + return renderNoright(); + } + return ( -
+ hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index 28ee2b8..2ee79bf 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -30,6 +30,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; +import { renderNoright } from '../../util'; @@ -210,7 +211,7 @@ export default class StaffScheme extends React.Component { form2 } = staffScheme; - staffScheme.setSchemeName(val); + staffScheme.setPlanName(val); !this.isEmptyObject(form2.getFormParams()) && staffScheme.updateFields(val); } @@ -238,7 +239,7 @@ export default class StaffScheme extends React.Component { } = operate; (index == '0') && this.doEdit(record.randomFieldId); (index == '1') && this.doDel(record.randomFieldId); - + (index == '2') && this.doWorkflow(record.randomFieldId); } doEdit(id) { @@ -282,6 +283,10 @@ export default class StaffScheme extends React.Component { this.showConfirm('del'); } + doWorkflow(id) { + alert("逻辑太自由,暂缓") + } + handleSave() { const { @@ -360,12 +365,17 @@ export default class StaffScheme extends React.Component { staffScheme } = this.props; const { - isPanelShow, form2, schemeName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,date + isPanelShow, form2, planName, conditionNum, tableStore,nEdialogTitle,visible,condition, + form,dialogLoading,isEdit,date,hasRight } = staffScheme; + if (hasRight === false) { + return renderNoright(); + } + + return ( -
+ hasRight &&
this.handleMenuClick(key)} @@ -383,7 +393,7 @@ export default class StaffScheme extends React.Component { staffScheme.setPanelStatus(bool)} hideSearchAd={() => staffScheme.setPanelStatus(false)} searchsAd= {isPanelShow ? this.getPanelComponents() :
} diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index a4e7768..4a799a3 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -55,7 +55,7 @@ export class CompanyStore { @observable total = ''; @observable current = 1; @observable pageSize = 10; - + @observable hasRight = ''; @@ -63,8 +63,8 @@ export class CompanyStore { getTableInfo() { this.setLoading(true); let params = { - current:this.current, - pageSize:this.pageSize + current: this.current, + pageSize: this.pageSize } if (this.isEmptyObject(this.form.getFormParams())) { params = { @@ -82,11 +82,12 @@ export class CompanyStore { return response.json() }).then(res => { if (res.code === 200) { - res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); - this.setTotal(res.data.pageInfo.total); - res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); - this.setLoading(false); - this.setInit(false); + this.setHasRight(res.data.hasRight); + res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); + this.setTotal(res.data.pageInfo.total); + res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); + this.setLoading(false); + this.setInit(false); } else { message.warning(res.msg); } @@ -103,7 +104,7 @@ export class CompanyStore { @action("联查部门") getDeptTable(id) { let params = { - parentComp:id + parentComp: id } Api.getDeptListByPid(params).then(response => { return response.json() @@ -126,17 +127,17 @@ export class CompanyStore { ids: this.ids }; Api.deleteTableData(params).then(response => { - return response.json() + return response.json() }).then(data => { - if (data.code === 200) { - message.success(i18n.message.deleteSuccess()); - this.setSelectedRowKeys(''); - this.getTableInfo(); - } else { - message.warning(data.msg); - } + if (data.code === 200) { + message.success(i18n.message.deleteSuccess()); + this.setSelectedRowKeys(''); + this.getTableInfo(); + } else { + message.warning(data.msg); + } }).catch(error => { - message.warning(error.msg); + message.warning(error.msg); }) } @@ -146,31 +147,31 @@ export class CompanyStore { id: id } Api.updateForbiddenTag(params).then(response => { - return response.json() + return response.json() }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - } else { - message.warning(data.msg); - } + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + } else { + message.warning(data.msg); + } }).catch(error => { - message.warning(error.msg); + message.warning(error.msg); }) } getSearchCondition() { this.setScLoadingStatus(true); Api.getAdvanceSearchCondition().then(res => { - if (res.code === 200) { - this.setScLoadingStatus(false); - res.data.conditions && this.setSearchCondition(res.data.conditions); - res.data.conditions && this.form.initFormFields(res.data.conditions); - } else { - message.warning(res.msg); - } + if (res.code === 200) { + this.setScLoadingStatus(false); + res.data.conditions && this.setSearchCondition(res.data.conditions); + res.data.conditions && this.form.initFormFields(res.data.conditions); + } else { + message.warning(res.msg); + } }, error => { - message.warning(error.msg); + message.warning(error.msg); }) } @@ -179,57 +180,57 @@ export class CompanyStore { let params = {}; this.setDialogLoadingStatus(true); Api.getCompanyForm(params).then(res => { - if (res.code === 200) { - this.setDialogLoadingStatus(false); - res.data.condition && this.setCondition(res.data.condition); - res.data.condition && this.form1.initFormFields(res.data.condition); - } else { - message.warning(res.msg); - } + if (res.code === 200) { + this.setDialogLoadingStatus(false); + res.data.condition && this.setCondition(res.data.condition); + res.data.condition && this.form1.initFormFields(res.data.condition); + } else { + message.warning(res.msg); + } }, error => { - message.warning(error.msg); + message.warning(error.msg); }) -} + } -save() { - let params = { + save() { + let params = { ...this.form1.getFormParams() - }; - this.form1.validateForm().then(f => { + }; + this.form1.validateForm().then(f => { if (f.isValid) { - Api.add(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - this.setNewVisible(false); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) + Api.add(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setNewVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) } else { - f.showErrors(); - this.setDate(new Date()); + f.showErrors(); + this.setDate(new Date()); } - }); -} + }); + } @action getHasRight() { Api.getHasRight().then(res => { - if (res.code === 200) { - res.data.rightMenu && this.setRightMenu(res.data.rightMenu); - res.data.topMenu && this.setTopMenu(res.data.topMenu); - } else { - message.warning(res.msg); - } + if (res.code === 200) { + res.data.rightMenu && this.setRightMenu(res.data.rightMenu); + res.data.topMenu && this.setTopMenu(res.data.topMenu); + } else { + message.warning(res.msg); + } }, error => { - message.warning(error.msg); + message.warning(error.msg); }) } @@ -273,7 +274,7 @@ save() { } setId(id) { - this.id =id; + this.id = id; } scLoadingReset() { @@ -292,7 +293,7 @@ save() { setDialogLoadingStatus(bool) { this.dialogLoading = bool; -} + } setSearchCondition(searchCondition) { @@ -359,7 +360,7 @@ save() { setCurrent(current) { this.current = current; } - + setPageSize(pageSize) { this.pageSize = pageSize; } @@ -367,5 +368,9 @@ save() { setInit(bool) { this.init = bool; } + + setHasRight(bool) { + this.hasRight = bool; + } } \ No newline at end of file diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 057f255..224bd5f 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -63,6 +63,7 @@ export class DepartmentStore { @observable confirmVisible = false; @observable confirmLoading = true; @observable isMerge = true; + @observable hasRight = ''; @action @@ -89,6 +90,7 @@ export class DepartmentStore { return response.json() }).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); this.setTotal(res.data.pageInfo.total); res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); @@ -517,4 +519,8 @@ export class DepartmentStore { setIsMerge(bool) { this.isMerge = bool; } + + setHasRight(bool) { + this.hasRight = bool; +} } \ No newline at end of file diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 063d4d1..72764ec 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -58,7 +58,7 @@ export class JobStore { @observable defaultShowLeft = true; @observable companysId = 1 - + @observable hasRight = ''; @action @@ -85,6 +85,7 @@ export class JobStore { return response.json() }).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns); this.setTotal(res.data.pageInfo.total); res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); @@ -402,4 +403,8 @@ export class JobStore { this.init = bool; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 9edb713..e6adaf2 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -48,7 +48,7 @@ export class JobGradeStore { @observable topTab = []; @observable topTabCount = {}; @observable key = '';// - + @observable hasRight = ''; @action @@ -69,6 +69,7 @@ export class JobGradeStore { } Api.getSearchList(params).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); @@ -378,4 +379,8 @@ export class JobGradeStore { this.key = key; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index 65ad030..607bc43 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -47,6 +47,7 @@ export class JobLevelStore { @observable selectedKey = -1; @observable topTab = []; @observable topTabCount = {}; + @observable hasRight = ''; @@ -70,6 +71,7 @@ export class JobLevelStore { } Api.getSearchList(params).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); @@ -337,4 +339,8 @@ export class JobLevelStore { this.rightMenu = rightMenu; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js index 54b502a..b593dd6 100644 --- a/pc4mobx/organization/stores/officeManage.js +++ b/pc4mobx/organization/stores/officeManage.js @@ -31,6 +31,7 @@ export class OfficeManageStore { @observable dialogLoading = false; @observable schemeId = ""; @observable date = ""; + @observable hasRight = ''; @action getHasRight() { @@ -94,6 +95,7 @@ export class OfficeManageStore { } API.getPostInfoTable(params).then((res) => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.error(res.msg); @@ -227,4 +229,8 @@ export class OfficeManageStore { officeFormReset() { this.form1 = new WeaForm(); } + + setHasRight(bool) { + this.hasRight = bool; + } } diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js index 4705bd9..11f799a 100644 --- a/pc4mobx/organization/stores/rankscheme.js +++ b/pc4mobx/organization/stores/rankscheme.js @@ -44,7 +44,7 @@ export class RankSchemeStore { @observable dialogLoading = true; @observable schemeId = ''; @observable date = ''; - + @observable hasRight = ''; @@ -65,6 +65,7 @@ export class RankSchemeStore { } Api.getSearchList(params).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); @@ -305,4 +306,8 @@ export class RankSchemeStore { this.rightMenu = rightMenu; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/sequence.js b/pc4mobx/organization/stores/sequence.js index 547cfbd..d7556c7 100644 --- a/pc4mobx/organization/stores/sequence.js +++ b/pc4mobx/organization/stores/sequence.js @@ -47,7 +47,7 @@ export class SequenceStore { @observable selectedKey = -1; @observable topTab = []; @observable topTabCount = {}; - + @observable hasRight = ''; @action @@ -68,6 +68,7 @@ export class SequenceStore { } Api.getSearchList(params).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); @@ -337,4 +338,8 @@ export class SequenceStore { this.rightMenu = rightMenu; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index 9a1b4f7..aafcbc0 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -44,7 +44,7 @@ export class StaffStore { @observable dialogLoading = true; @observable staffId = ''; @observable date = ''; - + @observable hasRight = ''; @@ -65,6 +65,7 @@ export class StaffStore { } Api.getSearchList(params).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); @@ -287,4 +288,8 @@ export class StaffStore { this.rightMenu = rightMenu; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js index 00b4a61..11fe89e 100644 --- a/pc4mobx/organization/stores/staffscheme.js +++ b/pc4mobx/organization/stores/staffscheme.js @@ -35,7 +35,7 @@ export class StaffSchemeStore { @observable form2 = new WeaForm(); @observable form = new WeaForm(); @observable form1 = new WeaForm(); - @observable schemeName = ''; + @observable planName = ''; @observable conditionNum = 8; @observable ids = ''; //选择行id @observable searchConditionLoading = true; @@ -44,7 +44,7 @@ export class StaffSchemeStore { @observable dialogLoading = true; @observable schemeId = ''; @observable date = ''; - + @observable hasRight = ''; @@ -56,7 +56,7 @@ export class StaffSchemeStore { if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...this.form2.getFormParams(), - schemeName: this.schemeName + planName: this.planName }; } else { params = { @@ -65,6 +65,7 @@ export class StaffSchemeStore { } Api.getSearchList(params).then(res => { if (res.code === 200) { + this.setHasRight(res.data.hasRight) res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); @@ -216,7 +217,7 @@ export class StaffSchemeStore { updateFields(val) { this.form2.updateFields({ - schemeName: { + planName: { value: val } }); @@ -238,8 +239,8 @@ export class StaffSchemeStore { } } - setSchemeName(val) { - this.schemeName = val; + setPlanName(val) { + this.planName = val; } isEmptyObject(obj) { @@ -305,4 +306,8 @@ export class StaffSchemeStore { this.rightMenu = rightMenu; } + setHasRight(bool) { + this.hasRight = bool; + } + } \ No newline at end of file From 79916567d5cb7f829cd6612183e5ce452b105c04 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 7 Jun 2022 17:56:29 +0800 Subject: [PATCH 006/155] =?UTF-8?q?=E7=BC=96=E5=88=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/components/staff/Staff.js | 30 ++++++++++++------- pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/staff.js | 7 ++++- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index a4d1dd0..5b354b6 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -212,18 +212,14 @@ export default class Staff extends React.Component { } = staff; staff.setStaffName(val); - !this.isEmptyObject(form2.getFormParams()) && staff.updateFields(val); + //!this.isEmptyObject(form2.getFormParams()) && staff.updateFields(val); } reRenderColumns(columns) { let _this = this; - columns.forEach((c, index) => { - // if (c.dataIndex == 'forbidden_tag') { - // c.render = function(text, record) { - // return _this.updateForbiddenTag(checked,record.id)} /> - // } - // }; - }) + // columns.forEach((c, index) => { + + // }) } updateForbiddenTag(checked,id) { @@ -239,7 +235,7 @@ export default class Staff extends React.Component { } = operate; (index == '0') && this.doEdit(record.randomFieldId); (index == '1') && this.doDel(record.randomFieldId); - + (index == '2') && this.doChange(record.randomFieldId); } doEdit(id) { @@ -248,7 +244,21 @@ export default class Staff extends React.Component { } = this.props; staff.setNeDialogTitle(i18n.label.editStaff()); - staff.setSchemeId(id); + staff.setStaffId(id); + staff.setOperateType("1"); + staff.setIsNew(false); + staff.setVisible(true); + staff.getForm(); + } + + doChange(id) { + const { + staff + } = this.props; + + staff.setNeDialogTitle(i18n.label.changeStaff()); + staff.setStaffId(id); + staff.setOperateType("2"); staff.setIsNew(false); staff.setVisible(true); staff.getForm(); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 1542efc..badfdd0 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -136,6 +136,7 @@ export const i18n = { staffName: () => getLabel(385936, '编制上报'), newStaff: () => getLabel(386246, '新建编制'), editStaff: () => getLabel(386247, '编辑编制'), + changeStaff: () => getLabel(386247, '编辑变更'), jobName: () => getLabel(385936, '岗位'), newJob: () => getLabel(386246, '新建岗位'), editJob: () => getLabel(386247, '编辑岗位'), diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index aafcbc0..61ee658 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -45,7 +45,7 @@ export class StaffStore { @observable staffId = ''; @observable date = ''; @observable hasRight = ''; - + @observable operateType = ''; //1 编辑 2 变更 @@ -292,4 +292,9 @@ export class StaffStore { this.hasRight = bool; } + setOperateType(operateType) { + this.operateType = operateType; + } + + } \ No newline at end of file From ce772613972d45b188cd6010c0f716651083e938 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 7 Jun 2022 17:58:20 +0800 Subject: [PATCH 007/155] =?UTF-8?q?=E7=BC=96=E5=88=B6=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/public/i18n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index badfdd0..32a40a1 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -136,7 +136,7 @@ export const i18n = { staffName: () => getLabel(385936, '编制上报'), newStaff: () => getLabel(386246, '新建编制'), editStaff: () => getLabel(386247, '编辑编制'), - changeStaff: () => getLabel(386247, '编辑变更'), + changeStaff: () => getLabel(386247, '编制变更'), jobName: () => getLabel(385936, '岗位'), newJob: () => getLabel(386246, '新建岗位'), editJob: () => getLabel(386247, '编辑岗位'), From 76051adc16ec5dc2461290ee05de98749f15fbc1 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Tue, 7 Jun 2022 18:01:50 +0800 Subject: [PATCH 008/155] =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83=E5=AE=8C=E6=88=9080%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/numberSet.js | 50 +++ .../components/numberComposition.js | 345 ++++++++++++------ .../components/startNumberSetting.js | 40 ++ .../components/startReservedNumberSet.js | 98 ++++- .../components/branchNumSetting/index.js | 254 +++++++++++-- .../components/deptNumberSet/index.js | 278 +++++++++++--- .../components/postNumberSet/index.js | 312 ++++++++++++++++ .../components/resourceNumberSet/index.js | 312 ++++++++++++++++ pc4mobx/organization/index.js | 16 +- pc4mobx/organization/public/i18n.js | 3 +- pc4mobx/organization/stores/index.js | 19 +- pc4mobx/organization/stores/numberSet.js | 30 ++ 12 files changed, 1539 insertions(+), 218 deletions(-) create mode 100644 pc4mobx/organization/apis/numberSet.js create mode 100644 pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js create mode 100644 pc4mobx/organization/components/postNumberSet/index.js create mode 100644 pc4mobx/organization/components/resourceNumberSet/index.js create mode 100644 pc4mobx/organization/stores/numberSet.js diff --git a/pc4mobx/organization/apis/numberSet.js b/pc4mobx/organization/apis/numberSet.js new file mode 100644 index 0000000..d300660 --- /dev/null +++ b/pc4mobx/organization/apis/numberSet.js @@ -0,0 +1,50 @@ +/* + * Author: 黎永顺 + * Description: + * Date: 2022-06-07 09:52:01 + * LastEditTime: 2022-06-07 17:00:34 + */ +import { WeaTools } from "ecCom"; + +/** + * name:获取编号设置 + * param {*} params serialtype, SUBCOMPANY:分部 + * return {*} + */ +export const getCodeSetting = (params) => { + return WeaTools.callApi("/api/hrm/codeSetting/getCodeSetting", "GET", params); +}; + +/** + * name: 保存编号设置 + * param {*} params + * return {*} + */ +export const saveOrUpdateCodeSetting = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/saveOrUpdateCodeSetting", + "POST", + params + ); +}; +/** + * name: 保存起始编号设置 + * param {*} params + * return {*} + */ +export const saveStartNum = (params) => { + return WeaTools.callApi("/api/hrm/codeSetting/saveStartNum", "POST", params); +}; + +/** + * name: 起始编号设置 + * param {*} params + * return {*} + */ +export const getStartNumForm = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getStartNumForm", + "GET", + params + ); +}; diff --git a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js index 25f9140..4bf954b 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js +++ b/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-05-17 16:02:56 - * LastEditTime: 2022-05-18 18:03:07 + * LastEditTime: 2022-06-07 15:30:43 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; @@ -13,21 +13,13 @@ import { WeaFormItem, WeaSelect, WeaInput, + WeaInputNumber, } from "ecCom"; import Preview from "./preview"; import { i18n } from "../../../public/i18n"; import _ from "lodash"; import "../index.less"; -const dataSource = [ - { - value: "", - numFieldName: "字符串", - numField: "string", - }, - { value: "3", numFieldName: "流水号位数", numField: "number" }, -]; - const options = [ { key: "string", @@ -51,12 +43,69 @@ class NumberComposition extends Component { super(); this.state = { visible: false, - numField: "string", - numFieldName: "字符串", - dataSource, + objectData: { + numField: "string", + numFieldName: "字符串", + }, + dataSource: [], }; } + componentDidMount() { + const enums = { + STRING: "字符串", + NUMBER: "流水号位数", + YEAR: "当前年份", + MONTH: "当前月份", + DAY: "当前日期", + }; + let num = 0; + const { dataSource: details, onChange } = this.props; + for (let i in details) { + if (details[i].ruletype === "STRING") { + details[i].showorder = num; + num++; + } + } + const tmpV = _.map(details, (it, index) => { + const { ruletype, rulevalue, showorder } = it; + return { + id: index, + value: rulevalue, + strLogo: Number(showorder) + 1, + numFieldName: + ruletype === "STRING" + ? `${enums[ruletype]}${Number(showorder) + 1}` + : enums[ruletype], + numField: _.toLower(ruletype), + }; + }); + this.setState( + { + dataSource: !_.isEmpty(tmpV) + ? tmpV + : [ + { + id: 1, + value: "", + strLogo: 1, + numFieldName: "字符串1", + numField: "string", + }, + { + id: 2, + value: 3, + numFieldName: "流水号位数", + numField: "number", + }, + ], + }, + () => { + onChange && onChange(this.state.dataSource); + } + ); + } + /** * name:复选框禁用 * param undefined @@ -82,20 +131,26 @@ class NumberComposition extends Component { * return {*} */ handleSave = () => { - const { numField, numFieldName, dataSource } = this.state; - const objWrite = { - value: "", - numFieldName, - numField, - }; - const objView = { - com: { - value: [{ key: numField, label: "", type: "TEXT" }], - }, - [numField]: "", - numFieldName, - numField, - }; + let newDataSource = []; + const { objectData, dataSource } = this.state; + const { onChange } = this.props; + const { numField, numFieldName } = objectData; + const stringRow = _.filter(dataSource, (it) => it.numField === "string"); //字符串列表 + const maxStrLen = !_.isEmpty(stringRow) + ? _.sortBy(stringRow, function (o) { + return -o.strLogo; + })[0].strLogo + : 0; //字符串列表 + const maxIdLen = _.sortBy(dataSource, function (o) { + return -o.id; + })[0].id; //字符串列表 + + const index = _.findIndex(dataSource, (item) => item.numField !== "string"); + const lastStrindex = _.findLastIndex( + dataSource, + (item) => item.numField === "string" + ); + if (numField === "year" || numField === "month" || numField === "day") { const hasYearOrMonthOrDay = _.some( dataSource, @@ -122,87 +177,158 @@ class NumberComposition extends Component { }); return; } - this.setState({ - visible: false, - numField: "string", - numFieldName: "字符串", - dataSource: [...dataSource, objView], - }); } else { this.showConfirm(); + return; } - } else { - this.setState({ - visible: false, - numField: "string", - numFieldName: "字符串", - dataSource: [...dataSource, objWrite], - }); } + + // 如果前n项为空或者当中包含非字符串项,则 + if (index > lastStrindex) { + if (numField === "month") { + const tmpVLastYearindex = _.findLastIndex( + dataSource, + (item) => item.numField === "year" + ); + dataSource.splice(tmpVLastYearindex + 1, 0, { + id: maxIdLen + 1, + value: "", + numFieldName: + numField === "string" + ? `${numFieldName}${stringRow.length + 1}` + : numFieldName, + numField, + }); + } else if (numField === "day") { + const tmpVLastMonthindex = _.findLastIndex( + dataSource, + (item) => item.numField === "month" + ); + dataSource.splice(tmpVLastMonthindex + 1, 0, { + id: maxIdLen + 1, + value: "", + numFieldName: + numField === "string" + ? `${numFieldName}${stringRow.length + 1}` + : numFieldName, + numField, + }); + } else { + const tmpVLastStrindex = _.findLastIndex( + dataSource, + (item) => item.numField === "string" + ); + dataSource.splice(tmpVLastStrindex + 1, 0, { + id: maxIdLen + 1, + value: "", + strLogo: maxStrLen + 1, + numFieldName: + numField === "string" + ? `${numFieldName}${maxStrLen + 1}` + : numFieldName, + numField, + }); + } + newDataSource = [...dataSource]; + } else { + if (numField === "month") { + const tmpVLastYearindex = _.findLastIndex( + dataSource, + (item) => item.numField === "year" + ); + dataSource.splice(tmpVLastYearindex + 1, 0, { + id: maxIdLen + 1, + value: "", + numFieldName: + numField === "string" + ? `${numFieldName}${stringRow.length + 1}` + : numFieldName, + numField, + }); + } else if (numField === "day") { + const tmpVLastMonthindex = _.findLastIndex( + dataSource, + (item) => item.numField === "month" + ); + dataSource.splice(tmpVLastMonthindex + 1, 0, { + id: maxIdLen + 1, + value: "", + numFieldName: + numField === "string" + ? `${numFieldName}${stringRow.length + 1}` + : numFieldName, + numField, + }); + } else { + const tmpVLastStrindex = _.findLastIndex( + dataSource, + (item) => item.numField === "string" + ); + dataSource.splice(tmpVLastStrindex, 0, { + id: maxIdLen + 1, + value: "", + strLogo: maxStrLen + 1, + numFieldName: + numField === "string" + ? `${numFieldName}${maxStrLen + 1}` + : numFieldName, + numField, + }); + } + newDataSource = [...dataSource]; + } + this.setState({ + visible: false, + objectData: { numField: "string", numFieldName: "字符串" }, + dataSource: newDataSource, + }); + onChange && onChange(newDataSource); }; /** * name:年月日字段重复提示 * return {*} */ showConfirm = () => { - const { numFieldName } = this.state; + const { objectData } = this.state; Modal.warning({ title: "信息确认", - content: `已经添加过一个${numFieldName},请选择其他编号字段!`, + content: `已经添加过一个${objectData.numFieldName},请选择其他编号字段!`, footer: [], onOk() {}, okText: "确认", }); }; - /** - * name: 编号字段删除 - * return {*} - */ - handleDeleteTable = (keys, datas) => { + + handleChangeInput = (value, index, record) => { const { dataSource } = this.state; - const stringRow = _.filter(dataSource, (it) => it.numField === "string"); - const yearRow = _.filter(dataSource, (it) => it.numField === "year"); - const monthRow = _.filter(dataSource, (it) => it.numField === "month"); - const dayRow = _.filter(dataSource, (it) => it.numField === "day"); - const disableRow = _.filter(dataSource, (it) => it.numField === "number"); - const tmpV = [ - ...stringRow, - ...yearRow, - ...monthRow, - ...dayRow, - ...disableRow, - ]; - this.setState({ - dataSource: _.filter(tmpV, (it, idx) => !keys.includes(idx)), - }); + const { onChange } = this.props; + this.setState( + { + dataSource: _.map(dataSource, (it) => { + if (it.id === record.id) { + return { + ...it, + value, + }; + } + return { ...it }; + }), + }, + () => { + onChange && onChange(this.state.dataSource); + } + ); }; - handleChangeInput = (value, index) => { - const { dataSource } = this.state; - const stringRow = _.filter(dataSource, (it) => it.numField === "string"); - const yearRow = _.filter(dataSource, (it) => it.numField === "year"); - const monthRow = _.filter(dataSource, (it) => it.numField === "month"); - const dayRow = _.filter(dataSource, (it) => it.numField === "day"); - const disableRow = _.filter(dataSource, (it) => it.numField === "number"); - const tmpV = _.map( - [...stringRow, ...yearRow, ...monthRow, ...dayRow, ...disableRow], - (it, idx) => ({ ...it, key: idx }) - ); - this.setState({ - dataSource: _.map(tmpV, (it) => { - if (it.key === index) { - return { - ...it, - value, - }; - } - return { ...it }; - }), - }); + handleDragChange = (dataSource) => { + const { onChange } = this.props; + this.setState({ dataSource }); + onChange && onChange(dataSource); }; render() { - const { visible, numField, dataSource } = this.state; + const { visible, objectData, dataSource } = this.state; + const { numField, numFieldName } = objectData; const columns = [ { title: "", @@ -230,6 +356,17 @@ class NumberComposition extends Component { ) { return ; } + if (numField === "number") { + return ( + + this.handleChangeInput(value, index, record) + } + /> + ); + } return ( , ]; - const stringRow = _.map( - _.filter(dataSource, (it) => it.numField === "string"), - (item, index) => { - return { - ...item, - numFieldName: `${item.numFieldName}${index + 1}`, - }; - } - ); - const yearRow = _.filter(dataSource, (it) => it.numField === "year"); - const monthRow = _.filter(dataSource, (it) => it.numField === "month"); - const dayRow = _.filter(dataSource, (it) => it.numField === "day"); - const disableRow = _.filter(dataSource, (it) => it.numField === "number"); return ( {/* 预览 */} - + {/* 新增弹框 */} @@ -335,7 +442,7 @@ class NumberComposition extends Component { value={numField} viewAttr={2} onChange={(numField, numFieldName) => { - this.setState({ numField, numFieldName }); + this.setState({ objectData: { numField, numFieldName } }); }} /> diff --git a/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js b/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js new file mode 100644 index 0000000..2fb2365 --- /dev/null +++ b/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js @@ -0,0 +1,40 @@ +/* + * Author: 黎永顺 + * Description: 起始编号设置 + * Date: 2022-06-07 15:27:43 + * LastEditTime: 2022-06-07 17:21:03 + */ +import React, { Component } from "react"; +import { WeaTableEdit, WeaInputNumber } from "ecCom"; + +class StartNumberSetting extends Component { + handleChangeTable = (datas) => { + const { onChange, startNumberInfo } = this.props; + const newColumns = _.map(startNumberInfo.columns, (it) => ({ + ...it, + com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }], + })); + onChange && onChange(newColumns, datas); + }; + render() { + const { startNumberInfo } = this.props; + const newColumns = _.map(startNumberInfo.columns, (it) => ({ + ...it, + com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }], + })); + return ( + + ); + } +} + +export default StartNumberSetting; diff --git a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js b/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js index b5cd812..b39d4a0 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js +++ b/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js @@ -2,27 +2,117 @@ * Author: 黎永顺 * Description: 起始编号及预留编号设置 * Date: 2022-05-17 15:51:41 - * LastEditTime: 2022-05-17 16:01:33 + * LastEditTime: 2022-06-07 17:40:30 */ import React, { Component, Fragment } from "react"; -import { WeaFormItem } from "ecCom"; +import { Button, Modal } from "antd"; +import StartNumberSetting from "./startNumberSetting"; +import { WeaFormItem, WeaDialog, WeaMoreButton } from "ecCom"; +import { i18n } from "../../../public/i18n"; class StartReservedNumberSet extends Component { + constructor() { + super(); + this.state = { + dialogProps: { + type: "start", + visible: false, + title: "", + }, + }; + } + handleClickStartNumber = (type) => { + const { onSet } = this.props; + const { dialogProps } = this.state; + onSet && onSet(type); + this.setState({ + dialogProps: { + ...dialogProps, + type, + visible: true, + title: type === "start" ? "起始编号" : "预留编号", + }, + }); + }; + handleChangeTable = (newColumns, datas) => { + const { onChange } = this.props; + onChange && onChange(newColumns, datas); + }; + handleSave = () => { + const { onSaveStartNumber } = this.props; + onSaveStartNumber && onSaveStartNumber(); + }; + handleClose = () => { + this.setState({ + dialogProps: { + ...this.state.dialogProps, + visible: false, + }, + }); + }; render() { + const { dialogProps } = this.state; + const { type } = dialogProps; + const { startNumberInfo } = this.props; return ( - + this.handleClickStartNumber("start")}> - + this.handleClickStartNumber("reserved")}> + {/* 起始/预留编号设置 */} + + {i18n.button.save()} + , + , + ] + : [ + , + ] + }> + {type === "start" && ( + + )} + ); } diff --git a/pc4mobx/organization/components/branchNumSetting/index.js b/pc4mobx/organization/components/branchNumSetting/index.js index 960e39c..e8743e7 100644 --- a/pc4mobx/organization/components/branchNumSetting/index.js +++ b/pc4mobx/organization/components/branchNumSetting/index.js @@ -2,35 +2,161 @@ * Author: 黎永顺 * Description: 分部编号设置 * Date: 2022-05-17 14:30:57 - * LastEditTime: 2022-06-06 09:42:23 + * LastEditTime: 2022-06-07 17:49:14 */ import React, { Component, Fragment } from "react"; -import { Button } from "antd"; -import { WeaTop, WeaFormItem, WeaCheckbox, WeaSearchGroup } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Button, message } from "antd"; +import { + WeaTop, + WeaFormItem, + WeaCheckbox, + WeaSearchGroup, + WeaSelect, + WeaHelpfulTip, +} from "ecCom"; import StartReservedNumberSet from "./components/startReservedNumberSet"; import NumberComposition from "./components/numberComposition"; import { i18n } from "../../public/i18n"; +import moment from "moment"; import "./index.less"; -const btns = []; -const dropMenuDatas = [ - { - key: "save", - disabled: false, - icon: , - content: "保存", - onClick: (key) => alert(`点击了搜索 key = ${key}`), - }, -]; +@inject("numberSet") +@observer export default class BranchNumSetting extends Component { constructor() { super(); this.state = { - checkVal: "0", + options: [], + loading: false, + dataSource: [], + startNumberInfo: { + columns: [], + dataSource: [], + }, + subCompanyInfo: { + details: [], + serialenable: "0", + dateSerial: { + enable: "0", + key: "", + }, + }, }; } - componentDidMount() {} + componentDidMount() { + this.getCodeSetting(); + } + + getCodeSetting = () => { + const { numberSet } = this.props; + numberSet + .getCodeSetting({ serialtype: "SUBCOMPANY" }) + .then(({ api_status, details, serialenable, dateSerial = {} }) => { + if (api_status && !_.isEmpty(details)) { + this.setState({ + subCompanyInfo: { details, serialenable, dateSerial }, + }); + } + }); + }; + + handleSubmit = () => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "SUBCOMPANY", + }), + }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + } + }); + }; + + handleChangeCode = (data) => { + const tmpV = _.filter( + data, + (it) => + it.numField === "year" || + it.numField === "month" || + it.numField === "day" + ); + this.setState({ + dataSource: _.cloneDeep(data), + options: _.map(tmpV, (it) => { + const { numFieldName: showname, numField: key } = it; + return { key: _.upperCase(key), showname }; + }), + }); + }; + + handleSetNumber = (type) => { + this.handleSubmit(); + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 1, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } + }; + handleChangeTable = (newColumns, datas) => { + this.setState({ + startNumberInfo: { + ...this.state.startNumberInfo, + columns: newColumns, + dataSource: datas, + }, + }); + }; + + handleSubmitStartNumber = () => { + const { numberSet } = this.props; + const payload = { + datas: JSON.stringify({ + coderuleid: 1, + ...this.state.startNumberInfo, + }), + }; + numberSet.saveStartNum(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleClose(); + } + }); + }; /** * name:提示文本 @@ -49,7 +175,22 @@ export default class BranchNumSetting extends Component { }; render() { - const { checkVal } = this.state; + const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { details, serialenable, dateSerial } = subCompanyInfo; + const btns = [ + , + ]; + const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => this.handleSubmit(), + }, + ]; return (
this.setState({ checkVal })} + onChange={(checkVal) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + serialenable: checkVal, + }, + }) + } />
{/* 内容区 */} - {checkVal === "1" && ( + {serialenable === "1" && (
- +
+ {!_.isEmpty(options) && ( +
+ +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + enable: isSingle, + }, + }, + }) + } + /> + {dateSerial.enable == "1" && ( + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+
+
+ )}
- + (this.numberSetRef = dom)} + onSet={this.handleSetNumber} + startNumberInfo={startNumberInfo} + onChange={this.handleChangeTable} + onSaveStartNumber={this.handleSubmitStartNumber} + />
diff --git a/pc4mobx/organization/components/deptNumberSet/index.js b/pc4mobx/organization/components/deptNumberSet/index.js index 17ce04c..4a384a2 100644 --- a/pc4mobx/organization/components/deptNumberSet/index.js +++ b/pc4mobx/organization/components/deptNumberSet/index.js @@ -1,11 +1,12 @@ /* * Author: 黎永顺 - * Description: 部门编号设 + * Description: 部门编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-06 10:26:35 + * LastEditTime: 2022-06-07 17:44:30 */ import React, { Component, Fragment } from "react"; -import { Button } from "antd"; +import { inject, observer } from "mobx-react"; +import { Button, message } from "antd"; import { WeaTop, WeaFormItem, @@ -17,18 +18,146 @@ import { import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; import { i18n } from "../../public/i18n"; +import moment from 'moment'; import "../branchNumSetting/index.less"; +@inject("numberSet") +@observer export default class DeptNumberSet extends Component { constructor() { super(); this.state = { - checkVal: "0", - isSingle: "0", //是否单独流水 - singleDate: "month", //日期单独流水 + options: [], + loading: false, + dataSource: [], + startNumberInfo: { + columns: [], + dataSource: [], + }, + subCompanyInfo: { + details: [], + serialenable: "0", + dateSerial: { + enable: "0", + key: "", + }, + }, }; } + componentDidMount() { + this.getCodeSetting(); + } + + getCodeSetting = () => { + const { numberSet } = this.props; + numberSet + .getCodeSetting({ serialtype: "DEPARTMENT" }) + .then(({ api_status, details, serialenable, dateSerial = {} }) => { + if (api_status && !_.isEmpty(details)) { + this.setState({ + subCompanyInfo: { details, serialenable, dateSerial }, + }); + } + }); + }; + + handleSubmit = () => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "DEPARTMENT", + }), + }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + } + }); + }; + + handleChangeCode = (data) => { + const tmpV = _.filter( + data, + (it) => + it.numField === "year" || + it.numField === "month" || + it.numField === "day" + ); + this.setState({ + dataSource: _.cloneDeep(data), + options: _.map(tmpV, (it) => { + const { numFieldName: showname, numField: key } = it; + return { key: _.upperCase(key), showname }; + }), + }); + }; + + handleSetNumber = (type) => { + this.handleSubmit(); + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 2, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } + }; + handleChangeTable = (newColumns, datas) => { + this.setState({ + startNumberInfo: { + ...this.state.startNumberInfo, + columns: newColumns, + dataSource: datas, + }, + }); + }; + + handleSubmitStartNumber = () => { + const { numberSet } = this.props; + const payload = { + datas: JSON.stringify({ + coderuleid: 2, + ...this.state.startNumberInfo, + }), + }; + numberSet.saveStartNum(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleClose(); + } + }); + }; + /** * name:提示文本 * return {*} @@ -45,27 +174,20 @@ export default class DeptNumberSet extends Component { ); }; render() { - const { checkVal, isSingle, singleDate } = this.state; - const btns = []; + const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { details, serialenable, dateSerial } = subCompanyInfo; + const btns = [ + , + ]; const dropMenuDatas = [ { key: "save", disabled: false, icon: , content: "保存", - onClick: (key) => alert(`点击了搜索 key = ${key}`), - }, - ]; - const options = [ - { - key: "month", - selected: false, - showname: "月", - }, - { - key: "day", - selected: true, - showname: "日", + onClick: (key) => this.handleSubmit(), }, ]; return ( @@ -85,64 +207,100 @@ export default class DeptNumberSet extends Component { labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}> this.setState({ checkVal })} + onChange={(checkVal) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + serialenable: checkVal, + }, + }) + } />
{/* 内容区 */} - {checkVal === "1" && ( + {serialenable === "1" && (
- +
-
- -
- -
- this.setState({ isSingle })} - /> - {isSingle == "1" && ( - { - console.log("v", v, "showname", showname); - }} + {!_.isEmpty(options) && ( +
+ +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + enable: isSingle, + }, + }, + }) + } /> - )} - -
-
-
-
-
+ {dateSerial.enable == "1" && ( + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+
+
+ )}
- + (this.numberSetRef = dom)} + onSet={this.handleSetNumber} + startNumberInfo={startNumberInfo} + onChange={this.handleChangeTable} + onSaveStartNumber={this.handleSubmitStartNumber} + />
diff --git a/pc4mobx/organization/components/postNumberSet/index.js b/pc4mobx/organization/components/postNumberSet/index.js new file mode 100644 index 0000000..9164bb2 --- /dev/null +++ b/pc4mobx/organization/components/postNumberSet/index.js @@ -0,0 +1,312 @@ +/* + * Author: 黎永顺 + * Description: 岗位编号设置 + * Date: 2022-06-06 09:37:39 + * LastEditTime: 2022-06-07 17:49:19 + */ +import React, { Component, Fragment } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message } from "antd"; +import { + WeaTop, + WeaFormItem, + WeaCheckbox, + WeaSearchGroup, + WeaSelect, + WeaHelpfulTip, +} from "ecCom"; +import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; +import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { i18n } from "../../public/i18n"; +import moment from "moment"; +import "../branchNumSetting/index.less"; + +@inject("numberSet") +@observer +export default class PostNumberSet extends Component { + constructor() { + super(); + this.state = { + options: [], + loading: false, + dataSource: [], + startNumberInfo: { + columns: [], + dataSource: [], + }, + subCompanyInfo: { + details: [], + serialenable: "0", + dateSerial: { + enable: "0", + key: "", + }, + }, + }; + } + + componentDidMount() { + this.getCodeSetting(); + } + + getCodeSetting = () => { + const { numberSet } = this.props; + numberSet + .getCodeSetting({ serialtype: "JOBTITLES" }) + .then(({ api_status, details, serialenable, dateSerial = {} }) => { + if (api_status && !_.isEmpty(details)) { + this.setState({ + subCompanyInfo: { details, serialenable, dateSerial }, + }); + } + }); + }; + + handleSubmit = () => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "JOBTITLES", + }), + }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + } + }); + }; + + handleChangeCode = (data) => { + const tmpV = _.filter( + data, + (it) => + it.numField === "year" || + it.numField === "month" || + it.numField === "day" + ); + this.setState({ + dataSource: _.cloneDeep(data), + options: _.map(tmpV, (it) => { + const { numFieldName: showname, numField: key } = it; + return { key: _.upperCase(key), showname }; + }), + }); + }; + + handleSetNumber = (type) => { + this.handleSubmit(); + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 3, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } + }; + handleChangeTable = (newColumns, datas) => { + this.setState({ + startNumberInfo: { + ...this.state.startNumberInfo, + columns: newColumns, + dataSource: datas, + }, + }); + }; + + handleSubmitStartNumber = () => { + const { numberSet } = this.props; + const payload = { + datas: JSON.stringify({ + coderuleid: 3, + ...this.state.startNumberInfo, + }), + }; + numberSet.saveStartNum(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleClose(); + } + }); + }; + + /** + * name:提示文本 + * return {*} + */ + helpContent = () => { + return ( +
+

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

+

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

+

2.导入人员-添加时,新创建的部门可自动生成部门编号;

+

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

+

【注意】开启前请先确认部门编号字段已启用!

+
+ ); + }; + render() { + const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { details, serialenable, dateSerial } = subCompanyInfo; + const btns = [ + , + ]; + const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => this.handleSubmit(), + }, + ]; + return ( +
+ } + iconBgcolor="#217346" + buttons={btns} + showDropIcon={true} + dropMenuDatas={dropMenuDatas} + /> +
+
+ + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + serialenable: checkVal, + }, + }) + } + /> + +
+ {/* 内容区 */} + {serialenable === "1" && ( + +
+ + + +
+ {!_.isEmpty(options) && ( +
+ +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + enable: isSingle, + }, + }, + }) + } + /> + {dateSerial.enable == "1" && ( + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+
+
+ )} +
+ + (this.numberSetRef = dom)} + onSet={this.handleSetNumber} + startNumberInfo={startNumberInfo} + onChange={this.handleChangeTable} + onSaveStartNumber={this.handleSubmitStartNumber} + /> + +
+
+ )} +
+
+ ); + } +} diff --git a/pc4mobx/organization/components/resourceNumberSet/index.js b/pc4mobx/organization/components/resourceNumberSet/index.js new file mode 100644 index 0000000..702528b --- /dev/null +++ b/pc4mobx/organization/components/resourceNumberSet/index.js @@ -0,0 +1,312 @@ +/* + * Author: 黎永顺 + * Description: 岗位编号设置 + * Date: 2022-06-06 09:37:39 + * LastEditTime: 2022-06-07 17:56:42 + */ +import React, { Component, Fragment } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message } from "antd"; +import { + WeaTop, + WeaFormItem, + WeaCheckbox, + WeaSearchGroup, + WeaSelect, + WeaHelpfulTip, +} from "ecCom"; +import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; +import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { i18n } from "../../public/i18n"; +import moment from "moment"; +import "../branchNumSetting/index.less"; + +@inject("numberSet") +@observer +export default class ResourceNumberSet extends Component { + constructor() { + super(); + this.state = { + options: [], + loading: false, + dataSource: [], + startNumberInfo: { + columns: [], + dataSource: [], + }, + subCompanyInfo: { + details: [], + serialenable: "0", + dateSerial: { + enable: "0", + key: "", + }, + }, + }; + } + + componentDidMount() { + this.getCodeSetting(); + } + + getCodeSetting = () => { + const { numberSet } = this.props; + numberSet + .getCodeSetting({ serialtype: "USER" }) + .then(({ api_status, details, serialenable, dateSerial = {} }) => { + if (api_status && !_.isEmpty(details)) { + this.setState({ + subCompanyInfo: { details, serialenable, dateSerial }, + }); + } + }); + }; + + handleSubmit = () => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "USER", + }), + }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + } + }); + }; + + handleChangeCode = (data) => { + const tmpV = _.filter( + data, + (it) => + it.numField === "year" || + it.numField === "month" || + it.numField === "day" + ); + this.setState({ + dataSource: _.cloneDeep(data), + options: _.map(tmpV, (it) => { + const { numFieldName: showname, numField: key } = it; + return { key: _.upperCase(key), showname }; + }), + }); + }; + + handleSetNumber = (type) => { + this.handleSubmit(); + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 4, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } + }; + handleChangeTable = (newColumns, datas) => { + this.setState({ + startNumberInfo: { + ...this.state.startNumberInfo, + columns: newColumns, + dataSource: datas, + }, + }); + }; + + handleSubmitStartNumber = () => { + const { numberSet } = this.props; + const payload = { + datas: JSON.stringify({ + coderuleid: 4, + ...this.state.startNumberInfo, + }), + }; + numberSet.saveStartNum(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleClose(); + } + }); + }; + + /** + * name:提示文本 + * return {*} + */ + helpContent = () => { + return ( +
+

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

+

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

+

2.导入人员-添加时,新创建的部门可自动生成部门编号;

+

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

+

【注意】开启前请先确认部门编号字段已启用!

+
+ ); + }; + render() { + const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { details, serialenable, dateSerial } = subCompanyInfo; + const btns = [ + , + ]; + const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => this.handleSubmit(), + }, + ]; + return ( +
+ } + iconBgcolor="#217346" + buttons={btns} + showDropIcon={true} + dropMenuDatas={dropMenuDatas} + /> +
+
+ + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + serialenable: checkVal, + }, + }) + } + /> + +
+ {/* 内容区 */} + {serialenable === "1" && ( + +
+ + + +
+ {!_.isEmpty(options) && ( +
+ +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + enable: isSingle, + }, + }, + }) + } + /> + {dateSerial.enable == "1" && ( + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+
+
+ )} +
+ + (this.numberSetRef = dom)} + onSet={this.handleSetNumber} + startNumberInfo={startNumberInfo} + onChange={this.handleChangeTable} + onSaveStartNumber={this.handleSubmitStartNumber} + /> + +
+
+ )} +
+
+ ); + } +} diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index d0ca84f..f234ebc 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -13,6 +13,8 @@ import OfficeManage from "./components/office/officeManage"; import CompanyExtend from "./components/company/CompanyExtend"; import BranchNumSetting from "./components/branchNumSetting"; import DeptNumberSet from "./components/deptNumberSet"; +import PostNumberSet from "./components/postNumberSet"; +import ResourceNumberSet from "./components/resourceNumberSet"; import Company from "./components/company/company"; import DepartmentManage from "./components/department/department"; import StaffScheme from "./components/staff/StaffScheme"; @@ -58,14 +60,20 @@ const Routes = ( path="branchNumSetting" component={BranchNumSetting} /> + + - + diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 7f7137a..aa401a4 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -130,7 +130,8 @@ export const i18n = { newOfficeClassifyName: () => getLabel(386246, '新建职务分类信息'), branchNumSetting: () => getLabel(386246, '分部编号设置'), deptNumSetting: () => getLabel(386246, '部门编号设置'), - posiNumSetting: () => getLabel(386246, '岗位编号设置'), + postNumSetting: () => getLabel(386246, '岗位编号设置'), + userNumSetting: () => getLabel(386246, '人员编号设置'), companyName: () => getLabel(385937, '分部'), staffSchemeName: () => getLabel(385936, '编制方案'), newStaffScheme: () => getLabel(386246, '新建编制方案'), diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index ca257b8..d42be77 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -6,15 +6,15 @@ import { JobGradeStore } from "./jobgrade"; import { OfficeManageStore } from "./officeManage"; import { SequenceStore } from "./sequence"; import { GroupStore } from "./group"; -import {CompanyExtendStore} from "./companyextend"; -import {CompanyStore} from "./company"; -import {DepartmentStore} from "./department"; -import {DepartmentExtendStore} from "./departmentextend"; -import {StaffSchemeStore} from "./staffscheme"; -import {StaffStore} from "./staff"; -import {JobStore} from "./job"; -import {JobExtendStore} from "./jobextend"; - +import { CompanyExtendStore } from "./companyextend"; +import { CompanyStore } from "./company"; +import { DepartmentStore } from "./department"; +import { DepartmentExtendStore } from "./departmentextend"; +import { StaffSchemeStore } from "./staffscheme"; +import { StaffStore } from "./staff"; +import { JobStore } from "./job"; +import { JobExtendStore } from "./jobextend"; +import { NumberSetStore } from "./numberSet"; module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -33,4 +33,5 @@ module.exports = { staff: new StaffStore(), job: new JobStore(), jobExtend: new JobExtendStore(), + numberSet: new NumberSetStore(), }; diff --git a/pc4mobx/organization/stores/numberSet.js b/pc4mobx/organization/stores/numberSet.js new file mode 100644 index 0000000..55917a5 --- /dev/null +++ b/pc4mobx/organization/stores/numberSet.js @@ -0,0 +1,30 @@ +/* + * Author: 黎永顺 + * Description: 编号设置 + * Date: 2022-06-07 09:54:46 + * LastEditTime: 2022-06-07 17:00:49 + */ +import { observable, action } from "mobx"; +import * as mobx from "mobx"; +import * as API from "../apis/numberSet"; // 引入API接口文件 + +export class NumberSetStore { + @action + getCodeSetting(params) { + return API.getCodeSetting(params); + } + + @action + saveOrUpdateCodeSetting(params) { + return API.saveOrUpdateCodeSetting(params); + } + + @action + getStartNumForm(params) { + return API.getStartNumForm(params); + } + @action + saveStartNum(params) { + return API.saveStartNum(params); + } +} From 14b7080a28167a3e969a3db7a8b70d00797a17a6 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 7 Jun 2022 18:11:10 +0800 Subject: [PATCH 009/155] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E5=88=B6?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/stores/staff.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index 61ee658..be15286 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -149,7 +149,8 @@ export class StaffStore { getForm() { let params = this.isNew ? {} : { - id: this.staffId + id: this.staffId, + operateType: this.operateType } this.setDialogLoadingStatus(true); From cbaea8f2da195ac64009d668ae3c967ef31bb382 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Tue, 7 Jun 2022 18:14:39 +0800 Subject: [PATCH 010/155] =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E8=AF=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/components/postNumberSet/index.js | 11 +++++------ .../components/resourceNumberSet/index.js | 13 +++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pc4mobx/organization/components/postNumberSet/index.js b/pc4mobx/organization/components/postNumberSet/index.js index 9164bb2..5866c6c 100644 --- a/pc4mobx/organization/components/postNumberSet/index.js +++ b/pc4mobx/organization/components/postNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 17:49:19 + * LastEditTime: 2022-06-07 18:13:32 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -165,11 +165,10 @@ export default class PostNumberSet extends Component { helpContent = () => { return (
-

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

-

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

-

2.导入人员-添加时,新创建的部门可自动生成部门编号;

-

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

-

【注意】开启前请先确认部门编号字段已启用!

+

开启后,可根据设置的岗位编号规则自动生成岗位编号,涉及场景如下:

+

1.新建岗位和编辑岗位时可选择重新生成编号和选择预留编号;

+

2.导入人员-添加时,新创建的岗位可自动生成岗位编号;

+

3.岗位导入新岗位且岗位编号列为空时可自动生成编号;

); }; diff --git a/pc4mobx/organization/components/resourceNumberSet/index.js b/pc4mobx/organization/components/resourceNumberSet/index.js index 702528b..dda9ed6 100644 --- a/pc4mobx/organization/components/resourceNumberSet/index.js +++ b/pc4mobx/organization/components/resourceNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 17:56:42 + * LastEditTime: 2022-06-07 18:12:11 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -165,11 +165,12 @@ export default class ResourceNumberSet extends Component { helpContent = () => { return (
-

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

-

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

-

2.导入人员-添加时,新创建的部门可自动生成部门编号;

-

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

-

【注意】开启前请先确认部门编号字段已启用!

+

开启后,可根据设置的人员编号规则自动生成人员编号,涉及场景如下:

+

1.手动新建和手动编辑人员时可选择自动生成和选择预留人员编号;

+

+ 2.导入人员类型选择-添加,导入Excel中人员编号为空时,可自动生成人员编号; +

+

3.人员入职流程中人员编号字段为空时可自动生成人员编号;

); }; From 88bf00cc8d5cec794617bae8c5ca324abff4a60d Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 8 Jun 2022 09:44:19 +0800 Subject: [PATCH 011/155] =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/numberSet.js | 41 ++++++++++++++++++- .../components/numberComposition.js | 2 +- .../branchNumSetting/components/preview.js | 0 .../components/startNumberSetting.js | 0 .../components/startReservedNumberSet.js | 2 +- .../branchNumSetting/index.js | 2 +- .../branchNumSetting/index.less | 0 .../deptNumberSet/index.js | 4 +- .../postNumberSet/index.js | 4 +- .../resourceNumberSet/index.js | 4 +- pc4mobx/organization/index.js | 8 ++-- 11 files changed, 53 insertions(+), 14 deletions(-) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/numberComposition.js (99%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/preview.js (100%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/startNumberSetting.js (100%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/startReservedNumberSet.js (98%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/index.js (99%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/index.less (100%) rename pc4mobx/organization/components/{ => numberSetting}/deptNumberSet/index.js (99%) rename pc4mobx/organization/components/{ => numberSetting}/postNumberSet/index.js (99%) rename pc4mobx/organization/components/{ => numberSetting}/resourceNumberSet/index.js (99%) diff --git a/pc4mobx/organization/apis/numberSet.js b/pc4mobx/organization/apis/numberSet.js index d300660..f3820f6 100644 --- a/pc4mobx/organization/apis/numberSet.js +++ b/pc4mobx/organization/apis/numberSet.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-06-07 09:52:01 - * LastEditTime: 2022-06-07 17:00:34 + * LastEditTime: 2022-06-08 09:37:41 */ import { WeaTools } from "ecCom"; @@ -48,3 +48,42 @@ export const getStartNumForm = (params) => { params ); }; + +/** + * name: 高级搜索条件 + * param {*} params + * return {*} + */ +export const getAdvanceSearchCondition = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getAdvanceSearchCondition", + "GET", + params + ); +}; + +/** + * name: 预留编号设置列表查询 + * param {*} params + * return {*} + */ +export const getSearchReservedCodeList = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getSearchReservedCodeList", + "POST", + params + ); +}; + +/** + * name: 新增预留编号表单查询 + * param {*} params + * return {*} + */ +export const getReservedCodeFrom = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getReservedCodeFrom", + "GET", + params + ); +}; diff --git a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js similarity index 99% rename from pc4mobx/organization/components/branchNumSetting/components/numberComposition.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js index 4bf954b..f7b1f2a 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js @@ -16,7 +16,7 @@ import { WeaInputNumber, } from "ecCom"; import Preview from "./preview"; -import { i18n } from "../../../public/i18n"; +import { i18n } from "../../../../public/i18n"; import _ from "lodash"; import "../index.less"; diff --git a/pc4mobx/organization/components/branchNumSetting/components/preview.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js similarity index 100% rename from pc4mobx/organization/components/branchNumSetting/components/preview.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js diff --git a/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js similarity index 100% rename from pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js diff --git a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js similarity index 98% rename from pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js index b39d4a0..762dc6d 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; import StartNumberSetting from "./startNumberSetting"; import { WeaFormItem, WeaDialog, WeaMoreButton } from "ecCom"; -import { i18n } from "../../../public/i18n"; +import { i18n } from "../../../../public/i18n"; class StartReservedNumberSet extends Component { constructor() { diff --git a/pc4mobx/organization/components/branchNumSetting/index.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js similarity index 99% rename from pc4mobx/organization/components/branchNumSetting/index.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/index.js index e8743e7..344521c 100644 --- a/pc4mobx/organization/components/branchNumSetting/index.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js @@ -17,7 +17,7 @@ import { } from "ecCom"; import StartReservedNumberSet from "./components/startReservedNumberSet"; import NumberComposition from "./components/numberComposition"; -import { i18n } from "../../public/i18n"; +import { i18n } from "../../../public/i18n"; import moment from "moment"; import "./index.less"; diff --git a/pc4mobx/organization/components/branchNumSetting/index.less b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.less similarity index 100% rename from pc4mobx/organization/components/branchNumSetting/index.less rename to pc4mobx/organization/components/numberSetting/branchNumSetting/index.less diff --git a/pc4mobx/organization/components/deptNumberSet/index.js b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js similarity index 99% rename from pc4mobx/organization/components/deptNumberSet/index.js rename to pc4mobx/organization/components/numberSetting/deptNumberSet/index.js index 4a384a2..44bc55b 100644 --- a/pc4mobx/organization/components/deptNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 部门编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 17:44:30 + * LastEditTime: 2022-06-08 09:32:09 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,7 +17,7 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; -import { i18n } from "../../public/i18n"; +import { i18n } from "../../../public/i18n"; import moment from 'moment'; import "../branchNumSetting/index.less"; diff --git a/pc4mobx/organization/components/postNumberSet/index.js b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js similarity index 99% rename from pc4mobx/organization/components/postNumberSet/index.js rename to pc4mobx/organization/components/numberSetting/postNumberSet/index.js index 9164bb2..4f66049 100644 --- a/pc4mobx/organization/components/postNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 17:49:19 + * LastEditTime: 2022-06-08 09:32:24 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,7 +17,7 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; -import { i18n } from "../../public/i18n"; +import { i18n } from "../../../public/i18n"; import moment from "moment"; import "../branchNumSetting/index.less"; diff --git a/pc4mobx/organization/components/resourceNumberSet/index.js b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js similarity index 99% rename from pc4mobx/organization/components/resourceNumberSet/index.js rename to pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js index 702528b..1505038 100644 --- a/pc4mobx/organization/components/resourceNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 17:56:42 + * LastEditTime: 2022-06-08 09:32:33 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,7 +17,7 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; -import { i18n } from "../../public/i18n"; +import { i18n } from "../../../public/i18n"; import moment from "moment"; import "../branchNumSetting/index.less"; diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index f234ebc..4b1308e 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -11,10 +11,10 @@ import Sequence from "./components/sequence/Sequence"; import Group from "./components/group/Group"; import OfficeManage from "./components/office/officeManage"; import CompanyExtend from "./components/company/CompanyExtend"; -import BranchNumSetting from "./components/branchNumSetting"; -import DeptNumberSet from "./components/deptNumberSet"; -import PostNumberSet from "./components/postNumberSet"; -import ResourceNumberSet from "./components/resourceNumberSet"; +import BranchNumSetting from "./components/numberSetting/branchNumSetting"; +import DeptNumberSet from "./components/numberSetting/deptNumberSet"; +import PostNumberSet from "./components/numberSetting/postNumberSet"; +import ResourceNumberSet from "./components/numberSetting/resourceNumberSet"; import Company from "./components/company/company"; import DepartmentManage from "./components/department/department"; import StaffScheme from "./components/staff/StaffScheme"; From faf37dba1df22c6e89937a97adebebb2de79cdd9 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 8 Jun 2022 14:10:17 +0800 Subject: [PATCH 012/155] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/components/group/Group.js | 9 +++++++-- pc4mobx/organization/index.js | 2 +- pc4mobx/organization/stores/group.js | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pc4mobx/organization/components/group/Group.js b/pc4mobx/organization/components/group/Group.js index c33be85..28e56f4 100644 --- a/pc4mobx/organization/components/group/Group.js +++ b/pc4mobx/organization/components/group/Group.js @@ -30,6 +30,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; +import { renderNoright } from '../../util'; const toJS = mobx.toJS; @@ -174,11 +175,15 @@ export default class Group extends React.Component { group } = this.props; const { - nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey,date + nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey,date,hasRight } = group; + if (hasRight === false) { + return renderNoright(); + } + return ( -
+ hasRight &&
this.handleMenuClick(key)} diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index db4a266..917c942 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -53,7 +53,7 @@ const Routes = ( - + { if (res.code === 200) { + this.setHasRight(res.data.hasRight); res.data.rightMenu && this.setRightMenu(res.data.rightMenu); res.data.topMenu && this.setTopMenu(res.data.topMenu); } else { @@ -159,6 +161,8 @@ export class GroupStore { this.dialogLoading = bool; } - + setHasRight(bool) { + this.hasRight = bool; + } } \ No newline at end of file From 74879c046d85a9e23e0b727ff34adebb7ec72436 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 8 Jun 2022 16:51:54 +0800 Subject: [PATCH 013/155] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E9=AB=98=E7=BA=A7?= =?UTF-8?q?=E6=90=9C=E7=B4=A2bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/components/job/Job.js | 10 ++++------ pc4mobx/organization/stores/job.js | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index c4eaf64..3d6ce54 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-07 16:44:49 + * @LastEditTime: 2022-06-08 16:03:50 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -310,11 +310,9 @@ export default class Job extends React.Component { c.render = function (text, record) { const menu = ( - { - record.isUsed === 0 ? - { _this.doDel(record.id) }}>删除 - : '' - } + + { _this.doDel(record.id) }}>删除 + { _this.select(record.id) }}>联查人员 diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 72764ec..306b269 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -73,7 +73,7 @@ export class JobStore { params = { ...params, ...this.form.getFormParams(), - compName: this.jobName + jobName: this.jobName }; } else { params = { @@ -273,7 +273,7 @@ export class JobStore { updateFields(val) { this.form.updateFields({ - compName: { + jobName: { value: val } }); From 938e17aaadf377a1c21781b71adf84ba943f40c0 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Thu, 9 Jun 2022 16:51:37 +0800 Subject: [PATCH 014/155] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/numberSet.js | 28 +- .../components/numberComposition.js | 10 +- .../branchNumSetting/components/preview.js | 7 +- .../components/reservedNumberSetting.js | 406 ++++++++++++++++++ .../components/startNumberSetting.js | 8 +- .../components/startReservedNumberSet.js | 48 ++- .../numberSetting/branchNumSetting/index.js | 163 +++++-- .../numberSetting/deptNumberSet/index.js | 163 +++++-- .../numberSetting/postNumberSet/index.js | 160 +++++-- .../numberSetting/resourceNumberSet/index.js | 162 +++++-- .../components/office/officeManage.js | 16 +- pc4mobx/organization/stores/numberSet.js | 75 +++- 12 files changed, 1034 insertions(+), 212 deletions(-) create mode 100644 pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js diff --git a/pc4mobx/organization/apis/numberSet.js b/pc4mobx/organization/apis/numberSet.js index f3820f6..19f2571 100644 --- a/pc4mobx/organization/apis/numberSet.js +++ b/pc4mobx/organization/apis/numberSet.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-06-07 09:52:01 - * LastEditTime: 2022-06-08 09:37:41 + * LastEditTime: 2022-06-08 14:57:56 */ import { WeaTools } from "ecCom"; @@ -75,6 +75,19 @@ export const getSearchReservedCodeList = (params) => { ); }; +/** + * name: 保存预留编号设置 + * param {*} params + * return {*} + */ +export const saveReservedCode = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/saveReservedCode", + "POST", + params + ); +}; + /** * name: 新增预留编号表单查询 * param {*} params @@ -87,3 +100,16 @@ export const getReservedCodeFrom = (params) => { params ); }; + +/** + * name: 删除预留编号 + * param {*} params + * return {*} + */ +export const deleteReservedCodeById = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/deleteReservedCodeById", + "POST", + params + ); +}; diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js index f7b1f2a..277a215 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-05-17 16:02:56 - * LastEditTime: 2022-06-07 15:30:43 + * LastEditTime: 2022-06-08 16:35:49 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; @@ -58,6 +58,9 @@ class NumberComposition extends Component { YEAR: "当前年份", MONTH: "当前月份", DAY: "当前日期", + SUBCOMPANY: "分部编号", + DEPARTMENT: "部门编号", + JOBTITLES: "岗位编号", }; let num = 0; const { dataSource: details, onChange } = this.props; @@ -352,7 +355,10 @@ class NumberComposition extends Component { if ( numField === "year" || numField === "month" || - numField === "day" + numField === "day" || + numField === "subcompany" || + numField === "department" || + numField === "jobtitles" ) { return ; } diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js index 506eaf0..d791f22 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 编号设置预览 * Date: 2022-05-18 10:21:09 - * LastEditTime: 2022-05-18 13:26:11 + * LastEditTime: 2022-06-08 16:37:01 */ import React, { Component } from "react"; @@ -19,7 +19,10 @@ class Preview extends Component { if ( numField === "year" || numField === "month" || - numField === "day" + numField === "day" || + numField === "subcompany" || + numField === "department" || + numField === "jobtitles" ) { return { ...item, diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js new file mode 100644 index 0000000..b1c8bb2 --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js @@ -0,0 +1,406 @@ +/* + * Author: 黎永顺 + * Description: 预留编号设置 + * Date: 2022-06-08 09:53:51 + * LastEditTime: 2022-06-09 16:07:51 + */ +import React, { Component } from "react"; +import { Row, Col, Spin, Modal, Button, Alert, message } from "antd"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { i18n } from "../../../../public/i18n"; +import { + WeaTab, + WeaButtonIcon, + WeaFormItem, + WeaDialog, + WeaMoreButton, + WeaSearchGroup, +} from "ecCom"; +import { WeaSwitch, WeaTableNew } from "comsMobx"; + +const WeaTable = WeaTableNew.WeaTable; + +@inject("numberSet") +@observer +class ReservedNumberSetting extends Component { + constructor() { + super(); + this.state = { + addVisible: false, + showSearchAd: false, + reservedcode: "", + previewStr: "", + date: "", + }; + } + componentWillReceiveProps(nextProps) { + const { numberSet, onChangeAddVisible } = this.props; + const { reservedForm } = numberSet; + if (nextProps.addVisible !== this.props.addVisible) { + !nextProps.addVisible && + this.setState({ addVisible: false }, () => { + reservedForm.reset(); + onChangeAddVisible && onChangeAddVisible(); + }); + } + } + /** + * name:渲染搜索栏 + * return {*} + */ + getPanelComponents = () => { + const { numberSet } = this.props; + const { searchCondition, form } = numberSet; + let colList = []; + const { isFormInit } = form; + isFormInit && + searchCondition.map((c) => { + c.items.map((field, index) => { + colList.push( + +
+ + { + + } + +
+ + ); + }); + }); + return ( + + {colList} + + ); + }; + + onSearchChange = (reservedcode) => { + const { numberSet } = this.props; + const { form } = numberSet; + this.setState({ reservedcode }); + !_.isEmpty(form.getFormParams()) && + form.updateFields({ + reservedcode: { + value: reservedcode, + }, + }); + }; + /** + * name: 查询 + * return {*} + */ + handelSearch = () => { + const { onSearchReservedNumberset } = this.props; + onSearchReservedNumberset && onSearchReservedNumberset(); + }; + /** + * name: 删除 预留编号 + * return {*} + */ + handleDelete = () => { + const { numberSet, onDeleteReservedNumber } = this.props; + const { tableStore } = numberSet; + const selectedKeys = toJS(tableStore.selectedRowKeys); + Modal.confirm({ + title: "信息确认", + content: `确定要删除选择的记录吗?`, + onOk: () => { + onDeleteReservedNumber && + onDeleteReservedNumber(selectedKeys.join(",")); + }, + onCancel: () => {}, + }); + }; + handleAddReservedNumber = () => { + const { onAddReservedNumber } = this.props; + this.setState({ addVisible: true }, () => { + onAddReservedNumber && onAddReservedNumber(); + }); + }; + /** + * name: 提交预留编号设置 + * return {*} + */ + handleSubmitReservedNumber = () => { + const { numberSet, onSubmitReservedNumber } = this.props; + const { reservedForm, condition } = numberSet; + reservedForm.validateForm().then((f) => { + if (f.isValid) { + const { desc: reserveddesc, flowcode: reservedcodes } = + reservedForm.getFormParams() || {}; + if (!/(^[1-9]\d*$)/.test(reservedcodes)) { + message.warning(`"流水号"格式不正确,请重新输入!`); + return; + } + onSubmitReservedNumber && + onSubmitReservedNumber({ + reserveddesc, + reservedcodes: this.state.previewStr, + }); + } else { + message.warning("请完善表单信息"); + f.showErrors(); + this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新 + } + }); + }; + /** + * name: 新增预留编号表单渲染 + * return {*} + */ + getReservedForm = () => { + const { condition, reservedForm } = this.props.numberSet; + let reservedFormItem = []; + const { isFormInit } = reservedForm; + isFormInit && + condition.map((c, i) => { + let switchItem = []; + c.items.map((field, index) => { + switchItem.push({ + com: ( +
+ {i === condition.length - 1 && index === 0 && ( +
+ +
+ )} + + + {field.domkey[0] === "flowcode" && ( +

格式为:5,6-10,21,66,99

+ )} +
+
+ ), + colSpan: 1, + }); + }); + reservedFormItem.push( + + ); + }); + + return reservedFormItem; + }; + + /** + * name: 输出指定个数0 + * param {*} num + * param {*} length + * return {*} + */ + prefixInteger = (num, length) => { + return (Array(length).join("0") + num).slice(-length); + }; + /** + * name: 字符串替换 + * param {*} str + * param {*} index + * param {*} char + * return {*} + */ + replaceStr2 = (str, index, char) => { + return str.substring(0, index) + char; + }; + + /** + * name: 预留编号的设置 + * param {*} formVal + * return {*} + */ + handleFormItemChange = (formVal) => { + const { numberSet, onSubmitReservedNumber } = this.props; + const { reservedForm, condition } = numberSet; + const NumberOfData = reservedForm.getFormParams() || {}; + let previewStr = "", + originStr = ""; + for (let i in NumberOfData) { + if ( + i.indexOf("STRING") > -1 || + i.indexOf("YEAR") > -1 || + i.indexOf("MONTH") > -1 || + i.indexOf("DAY") > -1 + ) { + originStr = originStr + NumberOfData[i]; + } + } + let integer_0 = this.prefixInteger(0, Number(NumberOfData["NUMBER"])); + //预留流水号值输入 + if (_.hasIn(formVal, "flowcode")) { + const inputValue = formVal["flowcode"].value; + if (inputValue.length <= Number(NumberOfData["NUMBER"])) { + previewStr = + originStr + + this.replaceStr2( + integer_0, + integer_0.length - inputValue.length, + inputValue + ); + } else { + previewStr = originStr + previewStr + inputValue; + } + this.setState({ previewStr: inputValue ? previewStr : "" }); + } else if ( + _.hasIn(formVal, "YEAR") || + _.hasIn(formVal, "MONTH") || + _.hasIn(formVal, "DAY") + ) { + const { flowcode } = NumberOfData; + if (flowcode.length <= Number(NumberOfData["NUMBER"])) { + previewStr = + originStr + + this.replaceStr2( + integer_0, + integer_0.length - flowcode.length, + flowcode + ); + } else { + previewStr = originStr + previewStr + flowcode; + } + this.setState({ previewStr }); + } + }; + render() { + const { + showSearchAd, + reservedcodem, + addVisible, + reservedcode, + date, + previewStr, + } = this.state; + const { numberSet, loading } = this.props; + const { form, tableStore, reservedForm } = numberSet; + return ( +
+ { + this.setState({ + showSearchAd: bool, + }); + }} + searchsAd={this.getPanelComponents()} + searchsBaseValue={ + _.isEmpty(form.getFormParams()) + ? reservedcode + : form.getFormParams().reservedcode + } + onSearchChange={this.onSearchChange} + onSearch={this.handelSearch} + onAdReset={() => form.reset()} + onAdSearch={this.handelSearch} + hasMask={false} + buttons={[ + , + , + ]} + /> + + {/* 起始/预留编号设置 */} + { + reservedForm.resetForm(); + this.setState({ addVisible: false, previewStr: "" }); + }} + icon="icon-coms-hrm" + iconBgcolor="#217346" + hasScroll + style={{ width: 640, height: 480 }} + buttons={[ + , + , + ]}> + {this.getReservedForm()} + +

+ {previewStr} +

+
+
+
+ ); + } +} + +export default ReservedNumberSetting; diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js index 2fb2365..ac48d27 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 起始编号设置 * Date: 2022-06-07 15:27:43 - * LastEditTime: 2022-06-07 17:21:03 + * LastEditTime: 2022-06-09 16:14:32 */ import React, { Component } from "react"; import { WeaTableEdit, WeaInputNumber } from "ecCom"; @@ -16,6 +16,10 @@ class StartNumberSetting extends Component { })); onChange && onChange(newColumns, datas); }; + getRowSelection = (rowSelection) => { + return null; + }; + render() { const { startNumberInfo } = this.props; const newColumns = _.map(startNumberInfo.columns, (it) => ({ @@ -28,7 +32,7 @@ class StartNumberSetting extends Component { showAdd={false} showDelete={false} showCopy={false} - tableProps={{ rowSelection: {} }} + getRowSelection={this.getRowSelection} columns={newColumns} datas={startNumberInfo.dataSource} onChange={this.handleChangeTable} diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js index 762dc6d..23b5367 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js @@ -2,18 +2,19 @@ * Author: 黎永顺 * Description: 起始编号及预留编号设置 * Date: 2022-05-17 15:51:41 - * LastEditTime: 2022-06-07 17:40:30 + * LastEditTime: 2022-06-08 18:03:02 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; import StartNumberSetting from "./startNumberSetting"; +import ReservedNumberSetting from "./reservedNumberSetting"; import { WeaFormItem, WeaDialog, WeaMoreButton } from "ecCom"; import { i18n } from "../../../../public/i18n"; - class StartReservedNumberSet extends Component { constructor() { super(); this.state = { + reservedAddVisible: true, dialogProps: { type: "start", visible: false, @@ -40,7 +41,14 @@ class StartReservedNumberSet extends Component { }; handleSave = () => { const { onSaveStartNumber } = this.props; - onSaveStartNumber && onSaveStartNumber(); + Modal.confirm({ + title: "信息确认", + content: `是否保存数据?`, + onOk: () => { + onSaveStartNumber && onSaveStartNumber(); + }, + onCancel: () => {}, + }); }; handleClose = () => { this.setState({ @@ -50,10 +58,23 @@ class StartReservedNumberSet extends Component { }, }); }; + handleCloseReservedModal = () => { + this.setState({ + reservedAddVisible: false, + }); + }; + render() { - const { dialogProps } = this.state; + const { dialogProps, reservedAddVisible } = this.state; const { type } = dialogProps; - const { startNumberInfo } = this.props; + const { + startNumberInfo, + onDeleteReservedNumber, + onAddReservedNumber, + onSubmitReservedNumber, + onSearchReservedNumberset, + loading, + } = this.props; return ( , ] }> - {type === "start" && ( + {type === "start" ? ( + ) : ( + + this.setState({ reservedAddVisible: true }) + } + /> )} diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js index 344521c..9aa465a 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 分部编号设置 * Date: 2022-05-17 14:30:57 - * LastEditTime: 2022-06-07 17:49:14 + * LastEditTime: 2022-06-09 15:12:50 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -63,32 +63,38 @@ export default class BranchNumSetting extends Component { }; handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "SUBCOMPANY", + }), }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "SUBCOMPANY", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); + return promise; }; handleChangeCode = (data) => { @@ -109,28 +115,35 @@ export default class BranchNumSetting extends Component { }; handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 1, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } + this.handleSubmit().then((res) => { + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 1, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", }); - } + } + }); }; handleChangeTable = (newColumns, datas) => { this.setState({ @@ -158,6 +171,53 @@ export default class BranchNumSetting extends Component { }); }; + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + numberSet.getReservedCodeFrom({ serialtype: "SUBCOMPANY" }); + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "SUBCOMPANY" }; + this.setState({ loading: true }); + numberSet.saveReservedCode(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", + }); + } + }); + }; + /** * name:提示文本 * return {*} @@ -175,6 +235,7 @@ export default class BranchNumSetting extends Component { }; render() { + const { numberSet } = this.props; const { options, subCompanyInfo, loading, startNumberInfo } = this.state; const { details, serialenable, dateSerial } = subCompanyInfo; const btns = [ @@ -297,10 +358,20 @@ export default class BranchNumSetting extends Component { center> (this.numberSetRef = dom)} + loading={loading} onSet={this.handleSetNumber} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} onSaveStartNumber={this.handleSubmitStartNumber} + onDeleteReservedNumber={this.deleteReservedNumber} + onAddReservedNumber={this.handleAddReservedNumber} + onSubmitReservedNumber={this.handleSubmitReservedNumber} + onSearchReservedNumberset={() => + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", + }) + } />
diff --git a/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js index 44bc55b..1d5226a 100644 --- a/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 部门编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-08 09:32:09 + * LastEditTime: 2022-06-09 15:12:57 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -18,7 +18,7 @@ import { import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; import { i18n } from "../../../public/i18n"; -import moment from 'moment'; +import moment from "moment"; import "../branchNumSetting/index.less"; @inject("numberSet") @@ -63,32 +63,38 @@ export default class DeptNumberSet extends Component { }; handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "DEPARTMENT", + }), }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "DEPARTMENT", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); + return promise; }; handleChangeCode = (data) => { @@ -109,28 +115,35 @@ export default class DeptNumberSet extends Component { }; handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 2, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } + this.handleSubmit().then((res) => { + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 2, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", }); - } + } + }); }; handleChangeTable = (newColumns, datas) => { this.setState({ @@ -158,6 +171,51 @@ export default class DeptNumberSet extends Component { }); }; + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + numberSet.getReservedCodeFrom({ serialtype: "DEPARTMENT" }); + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "DEPARTMENT" }; + numberSet.saveReservedCode(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", + }); + } + }); + }; + /** * name:提示文本 * return {*} @@ -175,6 +233,7 @@ export default class DeptNumberSet extends Component { }; render() { const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { numberSet } = this.props; const { details, serialenable, dateSerial } = subCompanyInfo; const btns = [
diff --git a/pc4mobx/organization/components/numberSetting/postNumberSet/index.js b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js index 4f66049..dccc7b1 100644 --- a/pc4mobx/organization/components/numberSetting/postNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-08 09:32:24 + * LastEditTime: 2022-06-09 11:31:39 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -63,32 +63,38 @@ export default class PostNumberSet extends Component { }; handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "JOBTITLES", + }), }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "JOBTITLES", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); + return promise; }; handleChangeCode = (data) => { @@ -109,28 +115,35 @@ export default class PostNumberSet extends Component { }; handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 3, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } + this.handleSubmit().then(() => { + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 3, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", }); - } + } + }); }; handleChangeTable = (newColumns, datas) => { this.setState({ @@ -157,6 +170,50 @@ export default class PostNumberSet extends Component { } }); }; + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + numberSet.getReservedCodeFrom({ serialtype: "JOBTITLES" }); + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "JOBTITLES" }; + numberSet.saveReservedCode(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", + }); + } + }); + }; /** * name:提示文本 @@ -174,6 +231,7 @@ export default class PostNumberSet extends Component { ); }; render() { + const { numberSet } = this.props; const { options, subCompanyInfo, loading, startNumberInfo } = this.state; const { details, serialenable, dateSerial } = subCompanyInfo; const btns = [ @@ -297,9 +355,19 @@ export default class PostNumberSet extends Component { (this.numberSetRef = dom)} onSet={this.handleSetNumber} + loading={loading} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} onSaveStartNumber={this.handleSubmitStartNumber} + onDeleteReservedNumber={this.deleteReservedNumber} + onAddReservedNumber={this.handleAddReservedNumber} + onSubmitReservedNumber={this.handleSubmitReservedNumber} + onSearchReservedNumberset={() => + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", + }) + } />
diff --git a/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js index 1505038..f84e629 100644 --- a/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-08 09:32:33 + * LastEditTime: 2022-06-09 11:33:03 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -63,32 +63,38 @@ export default class ResourceNumberSet extends Component { }; handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "USER", + }), }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "USER", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); + return promise; }; handleChangeCode = (data) => { @@ -109,29 +115,37 @@ export default class ResourceNumberSet extends Component { }; handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 4, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } + this.handleSubmit().then(() => { + const { numberSet } = this.props; + if (type === "start") { + const payload = { + coderuleid: 4, + type: "", + dateStart: moment().format("YYYY"), + dateEnd: moment().format("YYYY"), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", }); - } + } + }); }; + handleChangeTable = (newColumns, datas) => { this.setState({ startNumberInfo: { @@ -158,6 +172,51 @@ export default class ResourceNumberSet extends Component { }); }; + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + numberSet.getReservedCodeFrom({ serialtype: "USER" }); + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "USER" }; + numberSet.saveReservedCode(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", + }); + } + }); + }; + /** * name:提示文本 * return {*} @@ -175,6 +234,7 @@ export default class ResourceNumberSet extends Component { }; render() { const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { numberSet } = this.props; const { details, serialenable, dateSerial } = subCompanyInfo; const btns = [
diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 97995bf..656ec1b 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -58,7 +58,7 @@ export default class OfficeManage extends Component { handleMenuClick = (key) => { const { officeManageStore } = this.props; - const { isPanelShow,tableStore} = officeManageStore; + const { isPanelShow, tableStore } = officeManageStore; isPanelShow && officeManageStore.setPanelStatus(false); switch (key) { case "new": @@ -244,15 +244,10 @@ export default class OfficeManage extends Component { }; custom = () => { - debugger - const { - officeManageStore - } = this.props, { - tableStore, - } = officeManageStore; - - -} + debugger; + const { officeManageStore } = this.props, + { tableStore } = officeManageStore; + }; getPanelComponents = () => { const { officeManageStore } = this.props; @@ -429,7 +424,6 @@ export default class OfficeManage extends Component { needScroll={true} rowSelection={{ getCheckboxProps: (record) => { - console.log(record); return { disabled: true, // 配置无法勾选的列 }; diff --git a/pc4mobx/organization/stores/numberSet.js b/pc4mobx/organization/stores/numberSet.js index 55917a5..31ca342 100644 --- a/pc4mobx/organization/stores/numberSet.js +++ b/pc4mobx/organization/stores/numberSet.js @@ -2,13 +2,75 @@ * Author: 黎永顺 * Description: 编号设置 * Date: 2022-06-07 09:54:46 - * LastEditTime: 2022-06-07 17:00:49 + * LastEditTime: 2022-06-09 15:05:37 */ import { observable, action } from "mobx"; +import { WeaForm } from "comsMobx"; +import { WeaTableNew } from "comsMobx"; import * as mobx from "mobx"; import * as API from "../apis/numberSet"; // 引入API接口文件 +const { TableStore } = WeaTableNew; + export class NumberSetStore { + @observable searchCondition = []; //高级搜索框form数据 + @observable tableStore = new TableStore(); //列表store + @observable form = new WeaForm(); //高级搜索渲染的表单 + @observable condition = []; //新增职务信息form数据 + @observable reservedForm = new WeaForm(); //新增预留编号表单 + + @action("高级搜索表单渲染") + getAdvanceSearchCondition() { + API.getAdvanceSearchCondition().then(({ api_status, conditions }) => { + if (api_status && !_.isEmpty(conditions)) { + this.setSearchCondition(conditions); + this.form.initFormFields(conditions); + } + }); + } + + @action("获取表格数据") + getSearchReservedCodeList(params) { + const payload = { + ...this.form.getFormParams(), + ...params, + }; + API.getSearchReservedCodeList(payload).then( + ({ api_status, sessionkey }) => { + if (api_status && !_.isEmpty(sessionkey)) { + this.tableStore.getDatas(sessionkey, 1); + } + } + ); + } + + @action("新增预留编号表单查询") + getReservedCodeFrom(payload) { + API.getReservedCodeFrom(payload).then(({ api_status, conditioninfo }) => { + if (api_status && !_.isEmpty(conditioninfo)) { + conditioninfo.map((c) => + c.items.map((item) => { + if (item.domkey[0] == "YEAR") { + item.value = item.value.toString(); + } + }) + ); + this.setCondition(conditioninfo); + this.reservedForm.initFormFields(conditioninfo); + } + }); + } + + @action + setCondition(condition) { + this.condition = condition; + } + + @action + setSearchCondition(condition) { + this.searchCondition = condition; + } + @action getCodeSetting(params) { return API.getCodeSetting(params); @@ -23,8 +85,19 @@ export class NumberSetStore { getStartNumForm(params) { return API.getStartNumForm(params); } + @action saveStartNum(params) { return API.saveStartNum(params); } + + @action("删除预留编号") + deleteReservedCodeById(params) { + return API.deleteReservedCodeById(params); + } + + @action("保存预留编号") + saveReservedCode(params) { + return API.saveReservedCode(params); + } } From 5bfb12938025225418bdb5410e56faf867460b81 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 10 Jun 2022 16:37:52 +0800 Subject: [PATCH 015/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/fieldDefined.js | 43 ++ .../fieldDefinedSet/FieldDefined.js | 272 +++++++ .../components/fieldDefinedSet/FormInfo.js | 151 ++++ pc4mobx/organization/index.js | 3 + pc4mobx/organization/stores/baseStore.js | 626 +++++++++++++++ pc4mobx/organization/stores/fieldDefined.js | 730 ++++++++++++++++++ pc4mobx/organization/stores/index.js | 2 + pc4mobx/organization/style/index.less | 17 + 8 files changed, 1844 insertions(+) create mode 100644 pc4mobx/organization/apis/fieldDefined.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/FormInfo.js create mode 100644 pc4mobx/organization/stores/baseStore.js create mode 100644 pc4mobx/organization/stores/fieldDefined.js diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js new file mode 100644 index 0000000..5a5a66a --- /dev/null +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -0,0 +1,43 @@ +import { + WeaTools +} from 'ecCom'; + +/** + * 获取tab数据 + * @param {Object} params [description] + * @return {[type]} [description] + */ +export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/getTabInfo?is_multilang_set=true`, 'GET', params) + +export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/getFieldDefinedInfo?is_multilang_set=true`, 'GET', params) + +export const saveFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/save`, 'POST', params) + +export const removeFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/del`, 'POST', params) + +export const saveGroupInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/saveGroup`, 'POST', params) + +export const removeGroupInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/delGroup`, 'POST', params) + +export const getTree = (params = {}) => WeaTools.callApi(`/api/hrm/resourcefielddefined/getTree`, 'GET', params) + +export const saveTree = (params = {}) => WeaTools.callApi(`/api/hrm/resourcefielddefined/saveTree`, 'POST', params) + +export const changeGroup = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/changeGroup`, 'POST', params) + +export const getEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/getEncryptFieldSettingForm`, 'GET', params) + +export const saveEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/saveEncryptFieldSettingForm`, 'POST', params) + +//获取字段可查看范围列表 +export const getEncryptFieldScopeList = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/getEncryptFieldScopeList', 'POST', params); + +//获取字段可查看范围表单 +export const getEncryptFieldScopeForm = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/getEncryptFieldScopeForm', 'GET', params); + +//保存字段可查看范围 +export const saveEncryptFieldScopeSetting = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/saveEncryptFieldScopeSetting', 'POST', params); + +//删除字段可查看范围 +export const delEncryptFieldScopeSetting = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/delEncryptFieldScopeSetting', 'POST', params); + diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js new file mode 100644 index 0000000..8300743 --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -0,0 +1,272 @@ +import '../../style/index.less'; +import React, { + Component +} from 'react'; +import * as mobx from 'mobx' +import { + inject, + observer +} from 'mobx-react'; +import { + WeaTop, + WeaTab, + WeaAlertPage, + WeaLeftTree, + WeaLeftRightLayout, + WeaDropdown, + WeaRightMenu, + WeaTableEdit, + WeaDialog + +} from 'ecCom'; +import { Spin, Button } from 'antd'; + +import { + i18n +} from '../../public/i18n'; +import FormInfo from './FormInfo'; +const { ButtonSelect } = WeaDropdown; +const toJS = mobx.toJS; + + +@inject('fieldDefined') +@observer +export default class FieldDefined extends Component { + constructor(props) { + super(props); + this.setState = { + + } + } + + componentDidMount() { + this.init(this.props); + } + + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key) { + this.init(nextProps); + } + } + + init = (props) => { + const { + fieldDefined: store, + params + } = props, { + // checkAuthorized, + //initData, + initResourceData + } = store, { + type: moduleType + } = params + let moduleName, logSmallType; + if (moduleType === 'subCompany') { + moduleName = 'subcompanyfielddefined'; + } else if (moduleType === 'department') { + moduleName = 'departmentfielddefined'; + } else if (moduleType === 'job') { + moduleName = 'jobfielddefined'; + } else { + moduleName = 'resourcefielddefined'; + } + initResourceData(moduleName); + //checkAuthorized(moduleName, null, callbackFunc); + } + + getDropMenuDatas() { + const { + fieldDefined + } = this.props; + const { + rightMenu + } = fieldDefined; + + let menus = []; + toJS(rightMenu).map((item, index) => { + let obj = { + key: item.menuFun, + icon: , + content: item.menuName, + } + if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { + obj.disabled = true; + } + menus.push(obj); + }) + return menus; + } + + getTopMenuBtns() { + const { + fieldDefined + } = this.props; + const { + topMenu, + } = fieldDefined; + + let btns = []; + topMenu.map((item, i) => { + btns.push(); + }); + + return btns; + } + + handleClick(item) { + const { + fieldDefined + } = this.props; + this[item.menuFun] && this[item.menuFun](); + } + + new() { + const { + fieldDefined + } = this.props; + fieldDefined.editGroup(); + } + + onTabChange = tabKey => { + const { + fieldDefined + } = this.props; + fieldDefined.onTabChange(tabKey); + } + + onTabEdit = (tabKey, type) => { + debugger + console.log('onTabEdit: ', tabKey, type); + } + + render() { + + + const { + fieldDefined: store, + params + } = this.props, { + spinning, + refreshMainTabComponent, + treeConfig, + formTarget, + tabInfo, + tabKey, + setEditTable, + tableEditConfig, + dialogParams, + setDialogVisible, + getDialogOpButtons, + editorDialogRightMenu, + + } = store, { + type: moduleType + } = params, + title = moduleType === 'subCompany' ? i18n.module.subCompanyFieldDef() : moduleType === 'department' ? i18n.module.departmentFieldDef() : i18n.module.resourceFieldDef(), + topProps = { + title, + icon: , + iconBgcolor: '#217346', + showDropIcon: true, + buttons: this.getTopMenuBtns(), + dropMenuDatas: this.getDropMenuDatas(), + + }; + let children = []; + + //tabprops + let tabsData = cloneDeep(tabConfig.tabs) || []; + let tabProps = { + type: 'editable-inline', + datas: tabsData, + keyParam: tabConfig.keyParam, + selectedKey: tabConfig.activeTabKey, + onChange: tabChangeHandle, + leftStyle + } + + //end + + const { + groupInfoFrom, + groupInfoFromFields, + childInfoForm, + childInfoFormFields + } = formTarget; + + const { + editGroupInfo, + groupInfoSetting, + createChildInfo, + childInfoSetting + } = dialogParams; + + + const { + data, + onSelectedTreeNode, + selectedKeys, + onExpand, + treeExpandKeys + } = store.toJS(treeConfig); + const treeCom = ( + + ) + children = [ + ( + + + + + + { + + setEditTable(editTable, 'fieldDef')} + {...tableEditConfig['fieldDef']} + /> + + } + setDialogVisible('editGroupInfo', false)} + buttons={getDialogOpButtons()} + moreBtn={{ datas: editorDialogRightMenu }} + > + + + + + + ) + ] + + + return ( +
+ {children} +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/FormInfo.js b/pc4mobx/organization/components/fieldDefinedSet/FormInfo.js new file mode 100644 index 0000000..0c626ba --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/FormInfo.js @@ -0,0 +1,151 @@ +import React, { + Component +} from 'react'; +import { + observer +} from 'mobx-react'; +import { + Button +} from 'antd'; +import { + WeaFormItem, + WeaSearchGroup, + WeaCheckbox +} from 'ecCom'; +import { + WeaSwitch +} from 'comsMobx'; +import findIndex from 'lodash/findIndex'; + +@observer +export default class FormInfo extends Component { + renderForm = () => { + const { + formFields, + form, + colCount, + itemRender, + onSelectedChangeHandle, + showLabel, + multiColumn, + custLabelCol, + childrenComponents, + onSwitchChange, + } = this.props; + + let groupArr = []; + const formParams = form.getFormParams(); + const labelVisible = showLabel == null || showLabel == true; + const col = colCount ? colCount : 1; + const labelCol = labelVisible ? (custLabelCol || `${window.HrmEngineLabelCol}`) : 0; + const itemProps = { + ratio1to2: labelVisible && custLabelCol == null, + style: { + marginLeft: 0 //labelVisible ? -30 : 0 + }, + tipPosition: 'bottom', + labelCol: { + span: labelCol + }, + wrapperCol: { + span: 24 - labelCol + } + } + + const textAreaProps = { + minRows: 4, + maxRows: 4 + } + + formFields.map((fields, i) => { + let formItems = []; + fields.items.map((field, index) => { + const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null; + const showCheckbox = field.checkbox || false; + let label = field.label; + if (showCheckbox) + label = {field.checkboxValue = v === '1'; onSelectedChangeHandle && onSelectedChangeHandle(field, v)}}/> + + let coms; + if (customerRender == null) { + coms = onSwitchChange && onSwitchChange(datas)}/>; + } else { + coms = customerRender(field, textAreaProps, form, formParams); + } + Object.assign(itemProps, { + label, + error: form.getError(field) + }) + let col = 1; + if (multiColumn != null) { //检查有哪些字段需要一行显示多个 + const idx = findIndex(multiColumn, item => item.key === field.domkey[0]); + if (idx > -1) { + col = field.colSpan || 1; + if (multiColumn[idx].labelCol != null) //检查字段是否有配置标题宽度 + Object.assign(itemProps, { + labelCol: { + span: multiColumn[idx].labelCol + }, + wrapperCol: { + span: 24 - multiColumn[idx].labelCol + } + }) + } else { + Object.assign(itemProps, { + labelCol: { + span: labelCol + }, + wrapperCol: { + span: 24 - labelCol + } + }) + } + } + + coms != null && formItems.push({ + com: ( + + {coms} + + ), + col + }) + + if (childrenComponents && childrenComponents[field.domkey[0]]) { + childrenComponents[field.domkey[0]]().map(child => formItems.push(child)); + } + }) + + groupArr.push( + ( + + ) + ) + }); + + return groupArr; + } + + render() { + const { + formFields, + className, + showError + } = this.props; + if (formFields == null) + return (
) + + return ( +
+ {this.renderForm()} +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 917c942..38c1391 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -22,6 +22,7 @@ import Job from "./components/job/Job"; import JobExtend from "./components/job/JobExtend"; import Department from "./components/department/department"; import DepartmentExtendStore from "./components/department/departmentExtend"; +import FieldDefined from "./components/fieldDefinedSet/FieldDefined"; import stores from "./stores"; import "./style/index"; @@ -77,6 +78,8 @@ const Routes = ( + + ); diff --git a/pc4mobx/organization/stores/baseStore.js b/pc4mobx/organization/stores/baseStore.js new file mode 100644 index 0000000..ad4852c --- /dev/null +++ b/pc4mobx/organization/stores/baseStore.js @@ -0,0 +1,626 @@ +/** + * @Author: 程亮 + * @Date: 2022-06-09 10:14:20 + * @LastEditTime: 2022-06-09 10:41:31 + * @Description: + * @FilePath: /trunk/src4js/pc4mobx/organization/stores/baseStore.js + */ +import { + observable, + action, + computed, + extendObservable, + autorun +} from 'mobx'; +import { + Button, + message, + Modal +} from 'antd'; +import { + WeaForm, + WeaTableNew, + WeaLogView +} from 'comsMobx'; +import { + WeaTableEdit, + WeaBrowser, + WeaButtonIcon, + WeaCascader, + WeaLoadingGlobal +} from 'ecCom'; +import classnames from 'classnames'; +import * as mobx from 'mobx'; +import { + authorized, + detachable, + checkAuthAndDetach, + getPinYin +} from '../apis/common'; +import { + i18n +} from '../public/i18n'; +// import { +// logTypeDef +// } from '../public/logType'; +import has from 'lodash/has'; +import moment from 'moment'; + +const {OptionManage} = WeaCascader; + +const confirm = Modal.confirm; +const info = Modal.confirm; +const { + LogStore +} = WeaLogView; + +export default class HrmBaseStore { + /********************* unobservable list *********************/ + //logTypeDef = logTypeDef; + getPinYin = getPinYin; + toJS = mobx.toJS; + moment = moment; + tabConfig = { //模块主tab组件参数,通过继承来重写 + keyParam: 'viewCondition', + activeTabKey: '' + }; + basicDialogParams = { + icon: "icon-coms-hrm", + iconBgcolor: "#217346", + style: { + width: 520, + height: 300 + }, + visible: false, + title: '', + } + menuIconCollection = { + save: 'icon-coms-Preservation', + create: 'icon-coms-New-Flow', + modify: 'icon-coms-edit', + remove: 'icon-coms-Batch-delete', + copy: 'icon-coms-form-copy', + entry: 'icon-coms-edit', + setting: 'icon-coms-Flow-setting', + log: 'icon-coms-Print-log', + multiModify: 'icon-coms-BatchEditing', + import: ' icon-coms-leading-in', + export: 'icon-coms-export', + search: 'icon-coms-search', + sync: 'icon-coms-Update-synchronization', + done: 'icon-coms-Upload-successfully', + selectAll: 'icon-coms-batch' + } + getBasicMenus = (logTypeKey, targetId = null) => { + let arr = []; + if(logTypeKey){ + arr.push({ + key: '99', + content: i18n.button.log(), + icon: , + onClick: () => this.showLog({logSmallType: this.logTypeDef[logTypeKey], targetId}) + }); + } + return arr; + } + + generateLogMenu = (logType = '4', logTypeKey, targetId = null) => { + let arr = []; + if(logTypeKey){ + arr.push({ + key: '99', + content: i18n.button.log(), + icon: , + onClick: () => this.showLog({logType, logSmallType: this.logTypeDef[logTypeKey], targetId}) + }); + } + return arr; + } + + dialogPropsDef = { + moduleName: 'hrm', + visible: false, + title: '', + moreBtn: { + datas: [] + }, + // hasScroll: true + } + refsDialogPropsDef = { + moduleName: 'hrm', + visible: false, + title: '', + } + dateSwitchTypeList = ['year', 'month', 'week', 'day']; + formTarget = {}; //form collection + opId = null; //数据操作对象主键ID + authorizationInfo = {}; + + /** + * 权限验证 + * @param {String} moduleName [模块名] + * @param {Object} params [restful request url params] + * @param {Function} callback [验证通过后的callback function] + * @return {null} + */ + checkAuthorized = (moduleName, params, callback, apiMethod, needCheckDetachable = false) => { + if (needCheckDetachable) { + checkAuthAndDetach(moduleName, params, apiMethod).then(rs => { + rs.map((result, index) => { + if (result.status === '1') { + switch (index) { + case 0: + const init = !result.hasRight; + this.authorizationInfo = result; + this.containerInitFinished = { + ...this.containerInitFinished, + init, + authorized: result.hasRight, + userId: result.userId + } + this.containerInitFinished.authorized && callback && callback(); + break; + case 1: + this.containerInitFinished.detachable = result.detachable === '0' ? false : true + break; + } + } + }) + }) + } else { + authorized(moduleName, params, apiMethod).then((data) => { + if (data.status === '1') { + const init = !data.hasRight; + this.authorizationInfo = data; + this.containerInitFinished = { + init, + authorized: data.hasRight + } + this.containerInitFinished.authorized && callback && callback(); + } + }, error => { + this.containerInitFinished = { + init: true, + authorized: false + } + }); + } + } + + /** + * 获取激活的tab页下标 + * @param {Array} tabs [tabData数组] + * @param {String} key [tabKey] + * @return {Integer} [tab下标] + */ + getTabIndex(tabs, key) { + if (tabs != null && tabs.length > 0) { + return _.findIndex(tabs, { + viewCondition: key + }) + } + return -1; + } + + /** + * 获取WeaTop按钮、WeaTab按钮以及右键菜单列表 + * @param {Object} tabConfig [description] + * @return {Object} [description] + */ + btnsAndMenus = (tabConfig) => { + let topBtnDef = [], //WeaTop按钮 + menuDef = [], //右键菜单 + tabBtnDef = []; //WeaTab按钮 + + const activeTabIndex = this.getTabIndex(tabConfig.tabs, tabConfig.activeTabKey); + if (tabConfig.activeTabKey === '' || activeTabIndex < 0) { + return { + btns: topBtnDef, + menus: menuDef, + tabBtnDef: tabBtnDef + } + } + const tab = tabConfig.tabs[activeTabIndex]; + const { + topButtonDef, + tabButtonDef + } = tab; + topButtonDef && topButtonDef.map((def, idx) => { //组织WeaTop按钮 + const lbl = (typeof(def.label) == 'function' ? def.label() : def.label); + switch (def.comType) { + case 'button': + let disabled = false; + if (def.checkAction) + disabled = this[def.checkAction]; + topBtnDef.push(); + menuDef.push({ //组织右键菜单 + key: `$top-btn-${idx}`, + content: lbl, + icon: , + onClick: def.onClickHandle, + disabled: disabled || def.disabled || false + }) + break; + default: + break; + } + }); + tabButtonDef && tabButtonDef.map((def, idx) => { //组织WeaTab按钮 + const lab = (typeof(def.label) == 'function' ? def.label() : def.label); + let disabled = false; + if (def.checkAction) + disabled = this[def.checkAction]; + switch (def.comType) { + case 'button': + const classes = classnames({ + [def.icon]: true, + 'tabBtn': true, + 'tabBtn-active': !disabled, + 'tabBtn-disable': disabled + }); + if (def.brower == null) { + tabBtnDef.push( + + ); + } else { + switch (def.brower) { + case 'authorization': + tabBtnDef.push( + def.onClickHandle(ids, names, datas)} + isSingle={false} + > + + + ); + break; + } + } + break; + case 'WeaButtonIcon': + tabBtnDef.push( + + ); + break; + case 'customer': + tabBtnDef.push(def.coms) + break; + default: + tabBtnDef.push( + + ); + break; + } + }); + // menuDef.push(...this.getBasicMenus()); //组织右键菜单 + return { + btns: topBtnDef, + menus: menuDef, + tabBtnDef: tabBtnDef + } + } + + /** + * [description] + * @param {String} com [dialog's name] + * @param {Boolean} val [visible: true or false] + * @param {String} title [dialog's title] + * @param {Function} callback [callback function] + * @return {null} + */ + setDialogVisible = (com, val, title = '', callback) => { + this.dialogParams[com] = { + ...this.dialogParams[com], + visible: val, + title: title + }; + callback && callback(); + } + + confirmInfo = (props) => { + confirm({ ...props, + title: props.title || i18n.confirm.defaultTitle(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel() + }); + } + + hint = (props) => { + info({ ...props, + title: i18n.confirm.defaultTitle(), + okText: i18n.button.ok(), + }); + } + + /** + * 初始化formStore + * @param {String} formName [form's name] + * @param {Array} fields [form field definition] + * @return {null} + */ + setFormData = (formName, fields) => { + this.formTarget[`${formName}Fields`] = fields; + this.formTarget[formName] = new WeaForm(); + this.formTarget[formName].initFormFields(fields); + //this.formTarget[formName].setCondition(fields); + } + + /** + * 请求高级搜索表单的通用方法 + * @param {String} form [form's name] + * @param {Function} api [restful api function] + * @param {Object} params [restful request url params] + * @param {Function} callback [callback function] + * @return {null} + */ + requestFormData = (form, api, params = {}, callback) => { + api(params).then((data) => { + if (data.status === '1') { + this.setFormData(form, data.formField); + callback && callback(); + } + }, error => { + + }); + } + + /** + * 获取表格数据的通用方法 + * @param {String} tableStore [tableStore's name] + * @param {Function} api [restful api function] + * @param {Object} params [restful request url params] + * @return {null} + */ + requestTableData = (tableStore, api, params = {}, callback) => { + api(params).then(data => { + if (data.status === '1') { + tableStore.getDatas(data.sessionkey, 1); + callback && callback(); + } else + message.error(data.message); + }, error => { + message.error(i18n.message.actionError()); + }); + } + + showLog = (logTypeParams) => { + window.setLogViewProps({ + ...logTypeParams + }); + } + /********************* unobservable list *********************/ + + /********************* observable list *********************/ + @observable containerInitFinished = { //模块初始化状态 + init: false, + authorized: false, + detachable: false + } + @observable topTabCount = {}; //WeaTab统计值 + @observable rDate = new Date().getTime(); //状态刷新,组件引用该值监听变化重新render + @observable showError = new Date().getTime(); //状态刷新,组件引用该值监听变化重新render + @observable dialogParams = {}; //模态框参数 + @observable i18nLoaded = false; + + monitorI18n = () => { + this.i18nLoaded; + } + + monitor = autorun(this.monitorI18n) + /********************* observable list *********************/ + + /********************* action list *********************/ + @action definedColumn = (table, callback) => {//显示列定义 + table.setColSetVisible(true); + table.tableColSet(true, callback); + } + /********************* action list *********************/ + + /********************* tableEdit props & functions *********************/ + editTable = {}; //可编辑表格refs对象 + editTableConfig = { //WeaTableEdit参数定义,通过继承来重写 + showTitle: false, + draggable: true, + showAdd: false, + showDelete: false, + showCopy: false, + deleteConfirm: true + } + + /** + * 设置WeaTableEdit的refs对象 + * @param {Object} refs [WeaTableEdit] + */ + setEditTable = (refs, name) => { + this.editTable[name] = refs; + } + + /** + * 通过refs对WeaTableEdit进行添加行、删除行、复制行操作 + * @param {String} type [action] + */ + @action + recordOP = (target, type, callback = null) => { + switch (type) { + case 'add': + target.refs.edit.doAdd() + break; + case 'remove': + target.refs.edit.doDelete() + break; + case 'copy': + target.refs.edit.doCopy() + break; + case 'valid': + return target.refs.edit.doRequiredCheck() + default: + break; + } + } + + generateTableEditRightMenuInfo = (tableConfig) => { + let rightMenuInfo = []; + const keys = Object.keys(tableConfig); + keys.map((key, index) => { + rightMenuInfo.push({ + key: `8${index + 1}`, + disabled: tableConfig[key].disabled, + content: tableConfig[key].content, + icon: , + onClick: tableConfig[key].callback + }) + }) + return rightMenuInfo; + } + + generateTableSelectedData = (target) => { + let selectedData = {}; + this.tableEditConfig[target].columns.map(column => { + column.hasOwnProperty('checkType') && column.checkType === 'checkbox' && Object.assign(selectedData, { + [column.dataIndex]: [] + }) + }) + return selectedData; + } + + generateOtherParams = (componentType, used, domkey) => { + let otherParams = { + customProps: { + 'root': { + viewAttr: 1 + } + }, + optionManageProps: { + dialogProps: { + icon: "icon-coms-hrm", + iconBgcolor: "#217346", + }, + showAdd: !used, + showCopy: !used, + showDelete: !used, + tableEditDraggable: !used + } + } + switch (componentType) { + case 'input': + Object.assign(otherParams.customProps, { + 'input': { + viewAttr: 1 + }, + 'input.text': { + viewAttr: 1 + } + }); + break; + case 'select': + Object.assign(otherParams.customProps, { + 'select': { + viewAttr: 1, + }, + // 'select.*': { + // parent: { type: "span", className: `${domkey}-clz` } + // }, + }); + break; + } + return otherParams; + } + + convertData = (datas, target) => { + let tData = [], + selectedData = this.generateTableSelectedData(target); + datas.map((data, index) => { + let d = {}; + Object.assign(d, { + ...data.record, + ...data.props, + isSysField: data.isSysField + }); + delete d.key; + const selectedDataKey = Object.keys(selectedData); + selectedDataKey.map(key => { + data.record.hasOwnProperty(key) && data.record[key] === '1' && selectedData[key].push(index); + }) + + if (data.hasOwnProperty('com')) { + const keys = Object.keys(data.com); + keys.map(key => { + if (data.com[key].length > 0) { + let comDef = data.com[key][0]; + if (comDef.type === 'CUSTOMFIELD' && data.hasOwnProperty(comDef.key) && data[comDef.key].length > 0) { + Object.assign(d, { + [comDef.key]: data[comDef.key], + }); + Object.assign(comDef, { + viewAttr: 1, + otherParams: this.generateOtherParams(data[comDef.key][0], d.isSysField, d.fieldname), + }) + } else if (comDef.type === 'INPUT' && key != 'fieldname') { + comDef.otherParams = { + ...window.inputType + } + } + } + }) + Object.assign(d, { + com: data.com + }); + } + + tData.push(d); + }) + return { + datas: tData, + selectedData + } + } + + getLocale() { + return { + firstDayOfWeek: 0, + lang: { + format: { + eras: [getLabel(383357, "公元前"), getLabel(383358, "公元")], + months: [getLabel(1492, "一月"), getLabel(1493, "二月"), getLabel(383385, "三月"), getLabel(383387, "四月"), getLabel(1496, "五月"), getLabel(383392, "六月"), + getLabel(383393, "七月"), getLabel(383394, "八月"), getLabel(383395, "九月"), getLabel(383396, "十月"), getLabel(383397, "十一月"), getLabel(383398, "十二月") + ], + shortMonths: [getLabel(1492, "一月"), getLabel(1493, "二月"), getLabel(383385, "三月"), getLabel(383387, "四月"), getLabel(1496, "五月"), getLabel(383392, "六月"), + getLabel(383393, "七月"), getLabel(383394, "八月"), getLabel(383395, "九月"), getLabel(383396, "十月"), getLabel(383397, "十一月"), getLabel(383398, "十二月") + ], + weekdays: [getLabel(24626, "星期天"), getLabel(383399, "星期一"), getLabel(383400, "星期二"), getLabel(383402, "星期三"), getLabel(383403, "星期四"), + getLabel(383404, "星期五"), getLabel(383405, "星期六") + ], + shortWeekdays: [getLabel(16106, "周日"), getLabel(16100, "周一"), getLabel(16101, "周二"), getLabel(16102, "周三"), getLabel(16103, "周四"), getLabel(16104, "周五"), + getLabel(16105, "周六") + ], + veryShortWeekdays: [getLabel(16106, "周日"), getLabel(16100, "周一"), getLabel(16101, "周二"), getLabel(16102, "周三"), getLabel(16103, "周四"), getLabel(16104, "周五"), getLabel(16105, "周六")], + ampms: [getLabel(383408, "上午"), getLabel(383409, "下午")], + datePatterns: [`yyyy'${getLabel(383372,"年")}'M'${getLabel(383373,"月")}'d'${getLabel(383374,"日")}' EEEE`, `yyyy'${getLabel(383372,"年")}'M'${getLabel(383373,"月")}'d'${getLabel(383374,"日")}'`, "yyyy-M-d", "yy-M-d"], + timePatterns: [`ahh'${getLabel(383411,"时")}'mm'${getLabel(383412,"分")}'ss'${getLabel(383414,"秒")}' 'GMT'Z`, `ahh'${getLabel(383411,"时")}'mm'${getLabel(383412,"分")}'ss'${getLabel(383414,"秒")}'`, "H:mm:ss", "ah:mm"], + dateTimePattern: '{date} {time}' + } + }, + } + } + + @action showWeaLoadingGlobal = (tip = '') => WeaLoadingGlobal.start({tip}); + @action hideWeaLoadingGlobal = () => { + WeaLoadingGlobal.end(); // 停止遮罩loading + WeaLoadingGlobal.destroy(); // 销毁遮罩loading + } + /********************* tableEdit props & functions *********************/ +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js new file mode 100644 index 0000000..c576ff0 --- /dev/null +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -0,0 +1,730 @@ +/** + * @Author: 程亮 + * @Date: 2022-06-09 10:16:00 + * @LastEditTime: 2022-06-10 16:32:02 + * @Description: + * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js + */ +import { + observable, + action, + computed +} from 'mobx'; +import { + WeaForm, + WeaTableNew, + WeaSwitch +} from 'comsMobx'; +import {WeaLocaleProvider, WeaInputLocale, WeaButtonIcon, WeaSelect} from 'ecCom'; +import { + Button, + message, + Menu +} from 'antd'; +import HrmBaseStore from './baseStore'; +import * as api from '../apis/fieldDefined'; +import { + cloneDeep, + indexOf, + findIndex, + uniq, + has, + remove, + filter +} from 'lodash'; +import find from 'lodash/find'; +import isEmpty from 'lodash/isEmpty'; +import { + i18n +} from '../public/i18n'; +const getLabel = WeaLocaleProvider.getLabel; +const getCurrentLabel = WeaInputLocale.getCurrentLabel; +const {TableStore} = WeaTableNew; + +export class FieldDefinedStore extends HrmBaseStore { + + tabDef = { + topButtonDef: [{ + isBatch: 0, + isTop:1, + menuFun: "save", + menuIcon: "icon-coms-Preservation", + menuName: "保存", + type: "BTN_Save" + }, { + isBatch: 0, + isTop:1, + menuFun: "new", + menuIcon: "icon-coms-New-Flow", + menuName: "新建分组", + type: "BTN_Addnew" + }, { + isBatch: 0, + isTop:1, + menuFun: "set", + menuIcon: "icon-coms-Flow-setting", + menuName: "分组维护", + type: "BTN_GroupSet" + }], + tabButtonDef: [{ + comType: 'button', + icon: 'icon-coms-Add-to-hot', + label: i18n.button.create, + rightMenuIcon: this.menuIconCollection.create, + onClickHandle: () => this.recordOP(this.editTable['fieldDef'], 'add') + }] + } + + /********************* tabProps *********************/ + tabConfig = { + tabs: [], + keyParam: 'viewCondition', + activeTabKey: '1', + onTabEdit: this.onTabEdit + }; + activeTabInfo = {} + tabRecord = []; + + fieldDefColumns = () => { + const columns = [{ + title: i18n.label.fieldLabel(), //列名 + dataIndex: 'fieldlabel', //列的id 对应数据 + key: 'fieldlabel', //前端渲染key值 + useRecord: true, + colSpan: 1, + width: '15%', + com: [{ + label: '', + type: 'INPUT', + key: 'fieldlabel', + viewAttr: '3', + otherParams: { + ...window.inputType + } + }], + }, { + title: i18n.label.fieldName(), + dataIndex: 'fieldname', + key: 'fieldname', + useRecord: true, + colSpan: 1, + width: '15%', + com: [{ + label: '', + type: 'INPUT', + key: 'fieldname', + viewAttr: '3', + otherParams: { + length: 25, + regExp: /^[a-zA-Z][a-zA-Z0-9]*$/, + filter: (val) => { + const { + isValid, + value + } = validDBKeys(val); + this.isDBKeyValid = isValid; + return value; + } + } + }], + }, { + title: i18n.label.fieldType(), + dataIndex: 'fieldType', + key: 'fieldType', + useRecord: true, + colSpan: 1, + width: (this.moduleName === 'resourcefielddefined' && !this.isJobTreeNode) ? "30%" : "40%", + com: [{ + label: '', + type: 'CUSTOMFIELD', + key: 'fieldType', + viewAttr: '3', + options: ['peculiar'], + otherParams: { + customProps: { + 'input.text': { + viewAttr: 3 + }, + 'textarea': { + parent: { + type: "div", + style: { + display: "none" + } + }, + style: { + display: "none" + } + }, + 'textarea.*': { + parent: { + type: "div", + style: { + display: "none" + } + }, + style: { + display: "none" + } + }, + 'textarea.*.*': { + style: { + display: "none" + } + }, + "select": { + options: [{ + key: 'select', + selected: true, + showname: i18n.label.selectComponent() + }] + }, + "upload": { + options: [{ + key: 'file', + selected: true, + showname: i18n.label.uploadFile() + }] + } + } + } + }], + }, { + title: i18n.label.enable(), + dataIndex: 'enable', + key: 'enable', + checkType: 'checkbox', + colSpan: 1, + width: '7%' + }, { + title: i18n.label.required(), + dataIndex: 'required', + key: 'required', + checkType: 'checkbox', + colSpan: 1, + width: '8%' + }]; + + //人员卡片字段定义-添加【允许个人修改】列 + if (this.moduleName === 'resourcefielddefined') { + if (this.isJobTreeNode) {//【工作信息】列表不添加【允许个人修改】列 + } else { + columns.push({ + title: getLabel(510359,'允许个人修改'), + dataIndex: 'isModify', + key: 'isModify', + checkType: 'checkbox', + colSpan: 1, + width: '11%' + }); + } + } + this.encryptEnable && columns.push({ + title: getLabel('526997','加密设置'), + dataIndex: 'canEncrypt', + key: 'canEncrypt', + com: [ + { + type: 'custom', + key: 'custom', + render: (text, record, index, onEdit) => { + const {canEncrypt} = record; + if(canEncrypt == '1') + return ( + this.onEncryptHandle(record)}>{getLabel('526997','加密设置')} + ) + return null; + } + } + ], + colSpan: 1, + width: '8%' + }); + return columns; + } + + groupDefColumns = () => [{ + title: i18n.label.groupName(), //列名 + dataIndex: 'groupName', //列的id 对应数据 + key: 'groupName', //前端渲染key值 + colSpan: 1, + width: '70%', + useRecord: true, + com: [{ + label: '', + type: 'INPUT', + key: 'groupName', + viewAttr: '3', + otherParams: { + ...window.inputType + } + }], + }, { + title: i18n.label.show(), + dataIndex: 'isShow', + key: 'isShow', + checkType: 'checkbox', + colSpan: 1, + useRecord: true, + width: '30%' + }]; + + childInfoDefColumns = () => [{ + title: i18n.label.childInfoName(), //列名 + dataIndex: 'name', //列的id 对应数据 + key: 'name', //前端渲染key值 + colSpan: 1, + width: '70%', + useRecord: true, + com: [{ + label: '', + type: 'INPUT', + key: 'name', + viewAttr: '3', + otherParams: { + ...window.inputType + } + }], + }, { + title: i18n.label.show(), + dataIndex: 'isShow', + key: 'isShow', + checkType: 'checkbox', + colSpan: 1, + useRecord: true, + width: '30%' + }]; + + getColumns = () => { + let columns = cloneDeep(this.fieldDefColumns()) + return columns; + } + + tableEditConfig = { + fieldDef: { + ...this.editTableConfig, + showAdd: false, + showDelete: false, + showCopy: false, + columns: this.getColumns(), + copyFilterProps: ['id', 'fieldlabel', 'fieldname', 'com.fieldname', 'com.fieldlabel'], + datas: [], + selectedData: {}, + onChange: this.onFieldDefChange, + onRowSelect: this.onFieldDefRowSelect, + getRowSelection: this.onFieldDefRowSelection, + onDelete: this.onFieldDefDeleteOpr, + onEdit: this.onEdit, + onAdd: this.onAdd + }, + groupSetting: { + ...this.editTableConfig, + showTitle: true, + showAdd: true, + showDelete: true, + showCopy: false, + columns: this.groupDefColumns(), + copyFilterProps: ['id', 'groupName', 'isShow'], + datas: [], + selectedData: {}, + onChange: (datas) => this.onGroupSettingChange(datas, 'group'), + onRowSelect: (sRowKeys, rows, dataIndex, selectedDatas) => this.onGroupSettingRowSelect(sRowKeys, rows, dataIndex, selectedDatas, 'group'), + getRowSelection: this.onGroupSettingRowSelection, + onDelete: (ks, ds) => this.onGroupSettingDeleteOpr(ks, ds, 'group') + }, + childInfoSetting: { + ...this.editTableConfig, + showTitle: true, + showAdd: true, + showDelete: true, + showCopy: false, + columns: this.childInfoDefColumns(), + copyFilterProps: ['id', 'name', 'isShow'], + datas: [], + selectedData: {}, + onChange: (datas) => this.onGroupSettingChange(datas, 'childInfo'), + onRowSelect: (sRowKeys, rows, dataIndex, selectedDatas) => this.onGroupSettingRowSelect(sRowKeys, rows, dataIndex, selectedDatas, 'childInfo'), + getRowSelection: this.onGroupSettingRowSelection, + onDelete: (ks, ds) => this.onGroupSettingDeleteOpr(ks, ds, 'childInfo') + } + } + + + + /********************* dialog info setting *********************/ + editorDialogRightMenu = []; + getDialogOpButtons = () => { //获取权限组编辑对话框按钮列表 + this.editorDialogRightMenu.length = 0; + let buttons = []; + this.editorDialogRightMenu.push({ + key: '1', + content: i18n.button.save(), + icon: , + onClick: () => this.dialogSaveOp(false) + }); + + if(this.dialogParams.groupInfoSetting.visible){ + let logType = ''; + // switch(this.moduleName){ + // case 'subcompanyfielddefined': + // logType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED_GROUP'; + // break; + // case 'departmentfielddefined': + // logType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED_GROUP'; + // break; + // case 'resourcefielddefined': + // logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_GROUP'; + // break; + // } + this.editorDialogRightMenu.push(...this.getBasicMenus(logType)); + } + + return buttons; + } + + /***** form ****/ + editGroupInfoFormFields = [{ + "title": i18n.label.basicSetting(), + "items": [{ + "colSpan": 2, + "conditionType": "INPUT", + "domkey": ["groupName"], + "fieldcol": 12, + "isQuickSearch": false, + "label": i18n.label.groupName, + "labelcol": 6, + "precision": 0, + "rules": "required|string", + "value": "", + "viewAttr": 3, + }], + "defaultshow": true + }] + + editChildInfoFormFields = [{ + "title": i18n.label.basicSetting, + "items": [{ + "colSpan": 2, + "conditionType": "INPUT", + "domkey": ["name"], + "fieldcol": 12, + "isQuickSearch": false, + "label": i18n.label.childInfoName, + "labelcol": 6, + "precision": 0, + "rules": "required|string", + "value": "", + "viewAttr": 3 + }, { + "colSpan": 2, + "conditionType": "INPUTNUMBER", + "domkey": ["infoOrder"], + "fieldcol": 12, + "isQuickSearch": false, + "label": i18n.label.displayOrder, + "labelcol": 6, + "precision": 0, + "value": "0", + "viewAttr": 2 + }], + "defaultshow": true + }] + + /********************* observable list *********************/ + dialogParams = { //override baseStore.dialogParams + editGroupInfo: { + visible: false, + title: '', + moreBtn: { + datas: [] + } + }, + groupInfoSetting: { + visible: false, + title: '', + moreBtn: { + datas: [] + } + }, + createChildInfo: { + visible: false, + title: '', + moreBtn: { + datas: [] + } + }, + childInfoSetting: { + visible: false, + title: '', + moreBtn: { + datas: [] + } + } + } + + @observable spinning = false; + @observable moduleName = ''; //模块名称 + @observable topMenu = []; + @observable rightMenu = []; + + @observable tabKey = '1' + @observable tabInfo = [] //需要自定义返回 + + //选中树节点信息 + @observable selectedTreeNodeInfo; + @observable treeConfig = { + data: [], + selectedKeys: [], + treeExpandKeys: [], + onExpand: (keys) => { + this.treeConfig.treeExpandKeys = keys; + }, + onSelectedTreeNode: (key, count, countType) => { + this.treeConfig.selectedKeys = [key]; + this.selectedTreeNodeInfo = countType.node.props.data; + this.getTabInfoByTreeNode(null, true); + } + } + + @observable refreshMainTabComponent = new Date().getTime(); + + + @observable moveToGroup = false; //移动到组 + /** + * 初始化模块数据 + */ + @action initResourceData = (module) => { + this.selectedTreeNodeInfo = null; + this.treeConfig.treeExpandKeys.length = 0; + this.moduleName = module; + api.getTree().then(data => { + if (data.status === '1') { + // this.setTableEditColTitle(); + if (data.treejson.length > 0) { + this.treeConfig.data = data.treejson; + this.treeConfig.selectedKeys = [data.treejson[0].key]; + this.selectedTreeNodeInfo = data.treejson[0]; + this.getTabInfoByTreeNode(null, true); + + } + } else { + message.error(data.message); + } + }, error => {}) + } + + @action getTabInfoByTreeNode = (create = false, init = false, isLeaf) => { + api.getTabInfo(this.moduleName, { + groupType: this.treeConfig.selectedKeys[0] + }).then(data => { + if (data.status === '1') { + let t = cloneDeep(this.tabDef); + this.setTopMenu(t.topButtonDef); + this.setRightMenu(t.topButtonDef); + data.tabs && this.setTabInfo(data.tabs); + this.getFieldDefinedInfo(this.tabKey); + } else { + message.error(data.message); + } + }) + } + + + + @action("tab切换") onTabChange(tabKey) { + this.setTabKey(tabKey); + this.getFieldDefinedInfo(tabKey); + } + + @action onTabEdit = (targetKey, action) => { + const tabIndex = this.getTabIndex(this.tabConfig.tabs, targetKey); + if (tabIndex < 0) return; + const tabInfo = this.tabConfig.tabs[tabIndex]; + switch (action) { + case 'remove': + this.confirmInfo({ + content: i18n.confirm.delete(), + onOk: () => { + let params = { + id: tabInfo.groupid + } + if (this.selectedTreeNodeInfo != null) + params.groupType = this.selectedTreeNodeInfo.key + api.removeGroupInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + message.success(i18n.message.deleteSuccess()); + this.tabConfig.activeTabKey = '1'; + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + else + this.initData(); + } else { + message.error(data.message); + } + }) + } + }); + break; + default: + break; + } + } + + @action getFieldDefinedInfo(tabKey) { + let params = { + groupId:tabKey, + groupType: -1 + } + api.getFieldDefinedInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + const { + datas, + selectedData + } = this.convertData(data.data, 'fieldDef'); + this.encryptEnable = data.encryptEnable; + this.tableEditConfig.fieldDef.datas = datas; + this.tableEditConfig.fieldDef.columns = this.getColumns(); + + //人员卡片字段定义columns是动态的,因此需要重新计算得出selectedData + if (this.moduleName === 'resourcefielddefined') { + const { + selectedData + } = this.convertData(data.data, 'fieldDef'); + this.tableEditConfig.fieldDef.selectedData = selectedData; + } else { + this.tableEditConfig.fieldDef.selectedData = selectedData; + } + + // if (this.tabRecord.length > 0) { + // this.tabRecord[this.activeTabInfo.activeTabIndex].editable = (data.data.length === 0); + // this.activeTabInfo.tabInfo.editable = (data.data.length === 0); + // } + } else + message.error(data.message); + this.spinning = false; + this.refreshMainTabComponent = new Date().getTime(); + }, error => {this.spinning = false;}) + } + + + @action editGroup = (group, moveToGroup = false) => { + this.moveToGroup = moveToGroup; + this.editGroupInfoFormFields.map(f => { + if (typeof(f.title) == 'function') + f.title = f.title(); + f.items.map(item => { + if (typeof(item.label) == 'function') + item.label = item.label(); + item.otherParams = {...window.inputType}; + }) + }) + let fields = [...this.editGroupInfoFormFields], + dialogTitle = ''; + this.setFormData('groupInfoFrom', fields); + if (group) { + this.formTarget.groupInfoFrom.updateFields({ + groupName: {value: group.multiTitle || group.title || ''} + }); + this.opId = group.groupid; + dialogTitle = i18n.button.editGroup(); + } else { + this.formTarget.groupInfoFrom.updateFields({ + groupName: {value: ''} + }); + this.opId = null; + dialogTitle = i18n.button.createGroup(); + } + this.setDialogVisible('editGroupInfo', true, dialogTitle); + } + + @action dialogSaveOp = () => { + this.dialogParams.editGroupInfo.visible && this.doSaveGroupInfo(); + // this.dialogParams.groupInfoSetting.visible && this.doSaveGroupSetting(); + // this.dialogParams.createChildInfo.visible && this.doSaveChildInfo(); + // this.dialogParams.childInfoSetting.visible && this.doSaveChildInfoSetting(); + } + + + doSaveGroupInfo = () => { + this.formTarget.groupInfoFrom.validateForm().then(f => { + if (f.isValid) { + let record = { + ...this.formTarget.groupInfoFrom.getFormParams(), + isShow: 1 + } + const recordIndex = findIndex(this.tabInfo.tabs, { + title: getCurrentLabel(record.groupName) + }); + if (recordIndex >= 0) { + f.showError('groupName', i18n.confirm.groupNameExist()); + this.showError = new Date().getTime(); + return; + } + let found = false, + records = []; + this.opId != null && Object.assign(record, { + id: this.opId, + isShow: this.tabInfo.isShow + }); + this.tabInfo.map(tabInfo => { + if (tabInfo.groupid === this.opId) { + found = true; + records.push(record) + } else { + records.push({ + id: tabInfo.groupid, + isShow: tabInfo.isShow, + groupName: tabInfo.title + }) + } + }); + !found && records.push(record); + let params = { + data: JSON.stringify({ + records: records + }) + } + if (this.selectedTreeNodeInfo != null) + params.groupType = this.selectedTreeNodeInfo.key + + api.saveGroupInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + this.setDialogVisible('editGroupInfo', false, ''); + if(this.moveToGroup){ + const ids = data.groupid.split(','); + //this.changeGroup(null, ids[ids.length - 1]); 移动到组 + }else{ + this.getTabInfoByTreeNode(); + message.success(i18n.message.saveSuccess()); + } + } else + message.error(data.message); + }, error => { + message.error(i18n.message.actionError()); + }); + } else { + f.showErrors(); + this.showError = new Date().getTime(); + } + }); + } + + setTabInfo(tabInfo) { + this.tabInfo = tabInfo; + } + + setTabKey(tabKey) { + this.tabKey = tabKey; + } + + setTopMenu(topMenu) { + this.topMenu = topMenu; + } + + + setRightMenu(rightMenu) { + this.rightMenu = rightMenu; + } + + +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index d42be77..ca229ff 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -15,6 +15,7 @@ import { StaffStore } from "./staff"; import { JobStore } from "./job"; import { JobExtendStore } from "./jobextend"; import { NumberSetStore } from "./numberSet"; +import {FieldDefinedStore} from "./fieldDefined"; module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -34,4 +35,5 @@ module.exports = { job: new JobStore(), jobExtend: new JobExtendStore(), numberSet: new NumberSetStore(), + fieldDefined: new FieldDefinedStore() }; diff --git a/pc4mobx/organization/style/index.less b/pc4mobx/organization/style/index.less index f661c00..683be40 100644 --- a/pc4mobx/organization/style/index.less +++ b/pc4mobx/organization/style/index.less @@ -35,6 +35,23 @@ html { background-color: transparent; } +//自定义设置 +.fieldDef{ + width: 100%; + height: 100%; + .wea-tab .wea-search-tab{ + &>span{ + margin-left: 0px !important; + } + } + + .status-clz, .sex-clz, .accounttype-clz{ + a { + display: none; + } + } +} + //组织架构图 #node { From aa499d7855e5e7e8a4c359a170a98e39263e6d4d Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 10 Jun 2022 17:51:55 +0800 Subject: [PATCH 016/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEtest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fieldDefinedSet/AdvanceSearchFormInfo.js | 143 ++ .../fieldDefinedSet/EncryptSetting.js | 26 + .../components/fieldDefinedSet/FieldDef.js | 178 ++ .../fieldDefinedSet/FieldDefined.js | 436 ++-- .../components/fieldDefinedSet/Tabs.js | 220 ++ .../components/fieldDefinedSet/Tip.js | 13 + .../fieldDefinedSet/ViewRangeForm.js | 16 + .../fieldDefinedSet/ViewRangeSetting.js | 21 + pc4mobx/organization/stores/fieldDefined.js | 1824 +++++++++++++++-- pc4mobx/organization/style/index.less | 12 + pc4mobx/organization/util/index.js | 17 + 11 files changed, 2494 insertions(+), 412 deletions(-) create mode 100644 pc4mobx/organization/components/fieldDefinedSet/AdvanceSearchFormInfo.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/EncryptSetting.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/FieldDef.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/Tabs.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/Tip.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/ViewRangeForm.js create mode 100644 pc4mobx/organization/components/fieldDefinedSet/ViewRangeSetting.js diff --git a/pc4mobx/organization/components/fieldDefinedSet/AdvanceSearchFormInfo.js b/pc4mobx/organization/components/fieldDefinedSet/AdvanceSearchFormInfo.js new file mode 100644 index 0000000..8af9ca3 --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/AdvanceSearchFormInfo.js @@ -0,0 +1,143 @@ +import React, { + Component +} from 'react'; +import { + Button, + Form, + Row, + Col +} from 'antd'; +import { + WeaFormItem, + WeaNewScroll, + WeaSearchGroup, +} from 'ecCom'; +import { + WeaSwitch +} from 'comsMobx'; +import _ from 'lodash'; + +export default class AdvanceSearchFormInfo extends Component { + renderForm = () => { + const { + form, + formFields, + itemRender + } = this.props; + let arr = []; + let formParams = form.getFormParams(); + formFields.map(c => { + let _arr = []; + c.items.map((field, index) => { + const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null; + const itemProps = { + ratio1to2: true, + label: field.label, + labelCol: { + span: `${window.HrmEngineLabelCol}` + }, + error: form.getError(field), + tipPosition: 'bottom', + wrapperCol: { + span: `${window.HrmEngineWrapperCol}` + } + } + let coms; + if (customerRender == null) { + coms = ; + } else { + coms = customerRender(field, form, formParams); + } + coms != null && _arr.push( + ( + + + {coms} + + + ) + ) + if (_arr.length === 2 || index === c.items.length - 1) { + const clone = [..._arr]; + _arr.length = 0; + arr.push({clone}); + } + }) + }) + return
{arr}
; + } + + renderGroupForm = () => { + const { + form, + formFields, + itemRender + } = this.props; + let formParams = form.getFormParams(); + let arr = []; + formFields.map((c, i) => { + let _arr = []; + c.items.map((field, index) => { + const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null; + const itemProps = { + ratio1to2: true, + label: field.label, + labelCol: { + span: `${window.HrmEngineLabelCol}` + }, + error: form.getError(field), + tipPosition: 'bottom', + wrapperCol: { + span: `${window.HrmEngineWrapperCol}` + } + } + let coms; + if (customerRender == null) { + coms = ; + } else { + coms = customerRender(field, form, formParams); + } + coms != null && _arr.push({ + com: ( + + {coms} + + ), + col: field.colSpan || 2 + }) + }) + arr.push(); + }) + return arr; + } + + renderFormComponent = () => { + const { + formFields + } = this.props; + + const com = formFields.length > 1 ? this.renderGroupForm() : this.renderForm(); + return com; + } + + render() { + return ( + + {this.renderGroupForm()} + + ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/EncryptSetting.js b/pc4mobx/organization/components/fieldDefinedSet/EncryptSetting.js new file mode 100644 index 0000000..57c0063 --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/EncryptSetting.js @@ -0,0 +1,26 @@ +import React, {Component} from 'react'; +import {observer} from 'mobx-react'; +import { WeaDialog } from "ecCom"; +import Tip from './Tip'; +import FormInfo from './FormInfo'; + +@observer +export default class EncryptSetting extends Component{ + render(){ + const {store} = this.props; + const {encryptDialogProps, formTarget, encryptFormItemRender} = store; + const { + encryptForm, + encryptFormFields, + } = formTarget; + + return ( + + +
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js new file mode 100644 index 0000000..b5f613f --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js @@ -0,0 +1,178 @@ +import React, { + Component +} from 'react'; +import { + observer +} from 'mobx-react'; +import { + WeaRightMenu, + WeaTableEdit, + WeaDialog +} from 'ecCom'; +import classnames from 'classnames'; +import EncryptSetting from './EncryptSetting'; +import ViewRangeForm from './ViewRangeForm'; +import ViewRangeSetting from './ViewRangeSetting'; +import FormInfo from './FormInfo'; + +@observer +export default class FieldDef extends Component { + constructor(props) { + super(props); + this.state = { + resize: new Date().getTime() + } + } + + componentDidMount() { + window.addEventListener('resize', this.resizeHandle); + } + + componentWillUnmount() { + window.removeEventListener('resize', this.resizeHandle); + } + + resizeHandle = (e) => { + this.setState({ + resize: new Date().getTime() + }) + } + + render() { + const { + resize + } = this.state; + const { + rightMenu, + store, + resetClass + } = this.props; + const { + setEditTable, + tableEditConfig, + formTarget, + dialogParams, + setDialogVisible, + getDialogOpButtons, + showError, + editorDialogRightMenu, + refreshFeildDef, + refreshForm, + dropdownSelectedKey, + + moduleName, + isJobTreeNode + } = store; + const classes = classnames({ + ['tabPane']: true, + ['tabPane-include']: resetClass + }) + const { + groupInfoFrom, + groupInfoFromFields, + childInfoForm, + childInfoFormFields + } = formTarget; + const { + editGroupInfo, + groupInfoSetting, + createChildInfo, + childInfoSetting + } = dialogParams; + + let tableProps = {}; + if (this.tabDom) { + tableProps = { + scroll: { + y: this.tabDom.offsetHeight - 80, + } + } + //人员卡片字段定义页面 + if (moduleName === 'resourcefielddefined') { + if ((window.e9_locale.userLanguage == 7)) { //系统语言为中文 + Object.assign(tableProps.scroll, { + x: 1200 + }); + } else { + Object.assign(tableProps.scroll, { + x: isJobTreeNode ? 1400 : 1900 + }); + } + } + } + + const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)] + + return ( +
{this.tabDom = dom}}> + + setEditTable(editTable, 'fieldDef')} + {...tableEditConfig['fieldDef']} + /> + + + + + setDialogVisible('editGroupInfo', false)} + buttons={getDialogOpButtons()} + moreBtn={{datas:editorDialogRightMenu}} + > + + + setDialogVisible('groupInfoSetting', false, '')} + buttons={getDialogOpButtons()} + moreBtn={{datas:editorDialogRightMenu}} + > + + setEditTable(editTable, 'groupSetting')} + tableProps={{scroll: {y: 360}}} + {...tableEditConfig['groupSetting']}/> + + + setDialogVisible('createChildInfo', false)} + buttons={getDialogOpButtons()} + moreBtn={{datas:editorDialogRightMenu}} + > + + + setDialogVisible('childInfoSetting', false, '')} + buttons={getDialogOpButtons()} + moreBtn={{datas:editorDialogRightMenu}} + > + + setEditTable(editTable, 'childInfoSetting')} + tableProps={{scroll: {y: 360}}} + {...tableEditConfig['childInfoSetting']}/> + + +
+ ) + }; +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index 8300743..7b71756 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -1,272 +1,210 @@ import '../../style/index.less'; import React, { - Component + Component } from 'react'; -import * as mobx from 'mobx' import { - inject, - observer + inject, + observer } from 'mobx-react'; import { - WeaTop, - WeaTab, - WeaAlertPage, - WeaLeftTree, - WeaLeftRightLayout, - WeaDropdown, - WeaRightMenu, - WeaTableEdit, - WeaDialog - + WeaTop, + WeaAlertPage, + WeaLeftTree, + WeaLeftRightLayout, + WeaDropdown } from 'ecCom'; -import { Spin, Button } from 'antd'; - +import {Spin} from 'antd'; +import Tabs from './Tabs'; +import FieldDef from './FieldDef'; import { - i18n + i18n } from '../../public/i18n'; -import FormInfo from './FormInfo'; const { ButtonSelect } = WeaDropdown; -const toJS = mobx.toJS; @inject('fieldDefined') @observer export default class FieldDefined extends Component { constructor(props) { - super(props); - this.setState = { + super(props); + this.state = { + logSmallType: '' + } + } - } - } + componentDidMount() { + this.init(this.props); + } - componentDidMount() { - this.init(this.props); - } + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key) { + this.init(nextProps); + } + } - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.init(nextProps); - } - } + init = (props) => { + const { + fieldDefined: store, + params + } = props, { + checkAuthorized, + initData, + initResourceData + } = store, { + type: moduleType + } = params + let moduleName, logSmallType; + if(moduleType === 'subCompany'){ + moduleName = 'subcompanyfielddefined'; + logSmallType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED'; + }else if(moduleType === 'department'){ + moduleName = 'departmentfielddefined'; + logSmallType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED'; + }else{ + moduleName = 'resourcefielddefined'; + logSmallType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; + } + let callbackFunc = () => initData(false, true, moduleName); + if (moduleType === 'resource') + callbackFunc = () => initResourceData(moduleName); + checkAuthorized(moduleName, null, callbackFunc); + this.setState({logSmallType}) + } - init = (props) => { - const { - fieldDefined: store, - params - } = props, { - // checkAuthorized, - //initData, - initResourceData - } = store, { - type: moduleType - } = params - let moduleName, logSmallType; - if (moduleType === 'subCompany') { - moduleName = 'subcompanyfielddefined'; - } else if (moduleType === 'department') { - moduleName = 'departmentfielddefined'; - } else if (moduleType === 'job') { - moduleName = 'jobfielddefined'; - } else { - moduleName = 'resourcefielddefined'; - } - initResourceData(moduleName); - //checkAuthorized(moduleName, null, callbackFunc); - } + tabChangeHandle = (key) => { + const { + fieldDefined: store + } = this.props, { + tabConfig + } = store; + store.setActiveTab(tabConfig, key); + } - getDropMenuDatas() { - const { - fieldDefined - } = this.props; - const { - rightMenu - } = fieldDefined; + render() { + const { + fieldDefined: store, + params + } = this.props, { + containerInitFinished, + refreshMainTabComponent, + spinning + } = store, { + type: moduleType + } = params, { + tabConfig, + btnsAndMenus, + formTarget, + activeTabInfo, + treeConfig, + refreshTree, + selectedTreeNodeInfo, + dropdownProps, + feildDefRemoveable + } = store, { + btns, + menus, + tabBtnDef + } = btnsAndMenus(tabConfig), { + conditionForm: form, + conditionFormFields: fields, + } = formTarget, tabProps = { + tabConfig: tabConfig, + tabChangeHandle: this.tabChangeHandle, + activeTabInfo, + rightMenu: menus, + store: store, + conditionForm: form, + conditionFormFields: fields, + tabBtnDef: [ + ...tabBtnDef, + + ] + }, title = moduleType === 'subCompany' ? i18n.module.subCompanyFieldDef() : moduleType === 'department' ? i18n.module.departmentFieldDef() : i18n.module.resourceFieldDef(), + topProps = { + title, + icon: , + iconBgcolor: '#217346', + showDropIcon: true, + buttons: btns, + dropMenuDatas: menus + }; + let logType; + if(selectedTreeNodeInfo){ + if(selectedTreeNodeInfo.viewAttr == 1){ + logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; + }else{ + logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_DETAIL'; + } + } + let children = []; + if (containerInitFinished.init && containerInitFinished.authorized) { + switch (moduleType) { + case 'resource': + const { + data, + onSelectedTreeNode, + selectedKeys, + onExpand, + treeExpandKeys + } = store.toJS(treeConfig); + const treeCom = ( + + ) + children = [ + ( + + + + { + + + + } + + + + ) + ] + break; + default: + children = [ + ( + + + + + + + + ) + ] + break; + } + } else if (containerInitFinished.init && !containerInitFinished.authorized) { + children = [ + ( + +
{i18n.message.authFailed()}
+
+ ) + ]; + } - let menus = []; - toJS(rightMenu).map((item, index) => { - let obj = { - key: item.menuFun, - icon: , - content: item.menuName, - } - if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { - obj.disabled = true; - } - menus.push(obj); - }) - return menus; - } - - getTopMenuBtns() { - const { - fieldDefined - } = this.props; - const { - topMenu, - } = fieldDefined; - - let btns = []; - topMenu.map((item, i) => { - btns.push(); - }); - - return btns; - } - - handleClick(item) { - const { - fieldDefined - } = this.props; - this[item.menuFun] && this[item.menuFun](); - } - - new() { - const { - fieldDefined - } = this.props; - fieldDefined.editGroup(); - } - - onTabChange = tabKey => { - const { - fieldDefined - } = this.props; - fieldDefined.onTabChange(tabKey); - } - - onTabEdit = (tabKey, type) => { - debugger - console.log('onTabEdit: ', tabKey, type); - } - - render() { - - - const { - fieldDefined: store, - params - } = this.props, { - spinning, - refreshMainTabComponent, - treeConfig, - formTarget, - tabInfo, - tabKey, - setEditTable, - tableEditConfig, - dialogParams, - setDialogVisible, - getDialogOpButtons, - editorDialogRightMenu, - - } = store, { - type: moduleType - } = params, - title = moduleType === 'subCompany' ? i18n.module.subCompanyFieldDef() : moduleType === 'department' ? i18n.module.departmentFieldDef() : i18n.module.resourceFieldDef(), - topProps = { - title, - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - buttons: this.getTopMenuBtns(), - dropMenuDatas: this.getDropMenuDatas(), - - }; - let children = []; - - //tabprops - let tabsData = cloneDeep(tabConfig.tabs) || []; - let tabProps = { - type: 'editable-inline', - datas: tabsData, - keyParam: tabConfig.keyParam, - selectedKey: tabConfig.activeTabKey, - onChange: tabChangeHandle, - leftStyle - } - - //end - - const { - groupInfoFrom, - groupInfoFromFields, - childInfoForm, - childInfoFormFields - } = formTarget; - - const { - editGroupInfo, - groupInfoSetting, - createChildInfo, - childInfoSetting - } = dialogParams; - - - const { - data, - onSelectedTreeNode, - selectedKeys, - onExpand, - treeExpandKeys - } = store.toJS(treeConfig); - const treeCom = ( - - ) - children = [ - ( - - - - - - { - - setEditTable(editTable, 'fieldDef')} - {...tableEditConfig['fieldDef']} - /> - - } - setDialogVisible('editGroupInfo', false)} - buttons={getDialogOpButtons()} - moreBtn={{ datas: editorDialogRightMenu }} - > - - - - - - ) - ] - - - return ( -
- {children} -
- ) - } + return ( +
+ {children} +
+ ) + } } \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/Tabs.js b/pc4mobx/organization/components/fieldDefinedSet/Tabs.js new file mode 100644 index 0000000..d9ef164 --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/Tabs.js @@ -0,0 +1,220 @@ +import React, { + Component +} from 'react'; +import { + WeaTab +} from 'ecCom'; +import { + observer +} from 'mobx-react'; +import { + Button +} from 'antd'; +import AdvanceSearchFormInfo from './AdvanceSearchFormInfo'; +import { + cloneDeep +} from 'lodash'; +import { + calFormHeight +} from '../../util/index'; +import { + i18n +} from '../../public/i18n'; + +@observer +export default class Tabs extends Component { + constructor(props) { + super(props); + this.state = { + showSearchAd: false, + }; + } + + componentWillReceiveProps(nextProps) { + this.setState({ + showSearchAd: false, + }) + } + + doSearch = () => { + const { + conditionForm, + tabConfig, + activeTabInfo, + } = this.props; + + let tabInfo = tabConfig.tabs[activeTabInfo.activeTabIndex]; + tabInfo.doSearch(conditionForm.getFormParams()); + this.setState({ + showSearchAd: false + }); + } + + doReset = () => { + const { + conditionForm + } = this.props; + conditionForm.resetConditionValue(); + } + + doCancel = () => { + const { + conditionForm + } = this.props; + this.setState({ + showSearchAd: false, + }); + } + + getTabButtonsAd() { + return [ + (), + (), + () + ] + } + + renderForm = () => { + const { + conditionForm, + conditionFormFields, + itemRender + } = this.props; + const { + isFormInit + } = conditionForm; + if (isFormInit) + return + else + return ''; + } + + initTab = (props) => { + return React.cloneElement(, { + ...props + }); + } + + renderTabNav = () => { + //data + const { + activeTabInfo, + tabConfig, + tabChangeHandle, + tabBtnDef, + conditionForm, + conditionFormFields, + advanceHeight, + store, + leftStyle, + } = this.props; + + let tabInfo = tabConfig.tabs[activeTabInfo.activeTabIndex]; + let tabsData = cloneDeep(tabConfig.tabs) || []; + tabsData != null && tabsData.map(tab => { + if (typeof(tab.title) == 'function'){ + tab.title = tab.title(); + } + delete tab.topButtonDef; + delete tab.tabButtonDef; + }); + let tabProps = { + type: 'editable-inline', + datas: tabsData, + keyParam: tabConfig.keyParam, + selectedKey: tabConfig.activeTabKey, + onChange: tabChangeHandle, + leftStyle + } + tabBtnDef && Object.assign(tabProps, { + buttons: tabBtnDef + }); + const searchType = tabInfo.searchType || []; + if (searchType.length > 0) { + Object.assign(tabProps, { + searchType: searchType, + onSearch: (value) => { + if (searchType.indexOf('advanced') >= 0) { + tabInfo.doSearch(conditionForm.getFormParams()); + } else { + tabInfo.doSearch({ + [tabInfo.searchKey]: value + }); + } + } + }); + if (searchType.indexOf('advanced') >= 0 && conditionForm != null && conditionForm.isFormInit) { + const formParams = conditionForm.getFormParams(); + Object.assign(tabProps, { + searchsBaseValue: formParams[tabInfo.searchKey] || '', + showSearchAd: this.state.showSearchAd, + setShowSearchAd: (bool) => { + this.setState({ + showSearchAd: bool + }) + }, + onSearchChange: (value) => conditionForm.updateFields({ + [tabInfo.searchKey]: { + value + } + }, false), + buttonsAd: this.getTabButtonsAd(), + searchsAd:
{ + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + tabInfo.doSearch(conditionForm.getFormParams()); + this.setState({ + showSearchAd: false + }) + } + } } + >{this.renderForm()}
+ }); + + Object.assign(tabProps, { + //advanceHeight: calFormHeight(conditionFormFields.length, _.keys(formParams).length) + advanceHeight: advanceHeight ? advanceHeight : calFormHeight(conditionFormFields.length, conditionForm.fieldArr) + }); + } + } + tabConfig.onTabEdit && Object.assign(tabProps, { + onEdit: tabConfig.onTabEdit + }); + + return this.initTab(tabProps); + } + + renderTabContent = () => { + const { + children, + activeTabInfo, + rightMenu, + store + } = this.props; + if (Array.isArray(children)) { + return React.cloneElement(children[activeTabInfo.activeTabIndex], { + rightMenu, + activeTabIndex: activeTabInfo.activeTabIndex, + store + }); + } else { + return React.cloneElement(children, { + rightMenu, + activeTabIndex: activeTabInfo.activeTabIndex, + store + }); + } + } + + render() { + const { + tabConfig + } = this.props; + return ( +
+ {tabConfig.tabs.length > 0 && this.renderTabNav()} + {tabConfig.tabs.length > 0 && this.renderTabContent()} +
+ ); + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/Tip.js b/pc4mobx/organization/components/fieldDefinedSet/Tip.js new file mode 100644 index 0000000..22986ff --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/Tip.js @@ -0,0 +1,13 @@ +import React, {Component} from 'react'; +import {WeaLocaleProvider} from 'ecCom'; + +const {getLabel} = WeaLocaleProvider; + +export default class Tip extends Component{ + render(){ + const label = this.props.label || getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!'); + return ( +
{label}
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/ViewRangeForm.js b/pc4mobx/organization/components/fieldDefinedSet/ViewRangeForm.js new file mode 100644 index 0000000..c4d94be --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/ViewRangeForm.js @@ -0,0 +1,16 @@ +import React, {Component} from 'react'; +import {observer} from 'mobx-react'; +import { WeaAuth } from "ecCom"; + +@observer +export default class ViewRangeForm extends Component{ + render(){ + const {store} = this.props; + const {viewRangeAuthProps} = store; + + return ( + + + ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/ViewRangeSetting.js b/pc4mobx/organization/components/fieldDefinedSet/ViewRangeSetting.js new file mode 100644 index 0000000..5af2c8a --- /dev/null +++ b/pc4mobx/organization/components/fieldDefinedSet/ViewRangeSetting.js @@ -0,0 +1,21 @@ +import React, {Component} from 'react'; +import {observer} from 'mobx-react'; +import { WeaDialog, WeaTab } from "ecCom"; +import {WeaTableNew} from "comsMobx"; + +const {WeaTable} = WeaTableNew; + +@observer +export default class ViewRangeSetting extends Component{ + render(){ + const {store} = this.props; + const {dialogProps, rangeViewTabProps, rangeViewTableProps} = store; + + return ( + + + + + ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index c576ff0..713d838 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -43,28 +43,31 @@ const {TableStore} = WeaTableNew; export class FieldDefinedStore extends HrmBaseStore { - tabDef = { + /********************* unobservable list *********************/ + //override baseStore.tabConfig + tabDef = { + color: '#000000', + groupId: '', + viewCondition: '1', topButtonDef: [{ - isBatch: 0, - isTop:1, - menuFun: "save", - menuIcon: "icon-coms-Preservation", - menuName: "保存", - type: "BTN_Save" + comType: 'button', + type: 'primary', + onClickHandle: this.saveFieldDefine, + label: i18n.button.save, + icon: this.menuIconCollection.save }, { - isBatch: 0, - isTop:1, - menuFun: "new", - menuIcon: "icon-coms-New-Flow", - menuName: "新建分组", - type: "BTN_Addnew" + comType: 'button', + type: 'primary', + onClickHandle: () => this.editGroup(), + label: i18n.button.createGroup, + icon: this.menuIconCollection.create }, { - isBatch: 0, - isTop:1, - menuFun: "set", - menuIcon: "icon-coms-Flow-setting", - menuName: "分组维护", - type: "BTN_GroupSet" + comType: 'button', + type: 'primary', + onClickHandle: this.doGroupSetting, + label: i18n.button.groupMaintain, + icon: this.menuIconCollection.setting, + checkAction: 'groupInfoOperability' }], tabButtonDef: [{ comType: 'button', @@ -74,18 +77,93 @@ export class FieldDefinedStore extends HrmBaseStore { onClickHandle: () => this.recordOP(this.editTable['fieldDef'], 'add') }] } - - /********************* tabProps *********************/ - tabConfig = { + tabConfig = { tabs: [], keyParam: 'viewCondition', activeTabKey: '1', onTabEdit: this.onTabEdit }; - activeTabInfo = {} - tabRecord = []; + moveToGroup = false; + moveDropDown = () => ( + + { + filter(this.tabConfig.tabs, (d) => { + try{ + return d.groupid != this.activeTabInfo.tabInfo.groupid + }catch(e){ + return true; + } + }).map((tab, index) => ( + +
{tab.title}
+
+ )) + } + + +
{i18n.label.createAndMoveGroup()}
+
+
+ ) + getDropdownDatas = () => { + let datas = [ + { + key: '1', + text: i18n.button.delete(), + show: , + selected: this.dropdownSelectedKey === '1' + }, + { + key: '2', + text: i18n.button.copy(), + show: , + selected: this.dropdownSelectedKey === '2' + }, + { + key: '3', + text: i18n.button.moveToGroup(), + show: , + selected: this.dropdownSelectedKey === '3', + isDropBtn: true + } + ] + if(this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1){ + datas.splice(2, 1); + } + return datas; + } + dropdownProps = () => ({ + type: 'small', + datas: this.getDropdownDatas(), + dropBtnProps: { + style: { padding: '10px 4px' } + }, + btnDropPropsDatas: { + '3': { + overlay: this.moveDropDown() + } + }, + btnOnClick: key => { + switch(key){ + case '1': + this.recordOP(this.editTable['fieldDef'], 'remove') + break; + case '2': + this.recordOP(this.editTable['fieldDef'], 'copy') + break; + case '3': + break; + } + }, + menuOnClick: (key, e) => { + this.tableEditConfig.fieldDef.selectedRowKeys = []; + this.feildDefTableSelectedRows.length = 0; + this.refreshMainTabComponent = new Date().getTime(); + this.dropdownSelectedKey = key; + } + }) - fieldDefColumns = () => { + fieldDefColumns = () => { const columns = [{ title: i18n.label.fieldLabel(), //列名 dataIndex: 'fieldlabel', //列的id 对应数据 @@ -295,12 +373,19 @@ export class FieldDefinedStore extends HrmBaseStore { width: '30%' }]; - getColumns = () => { + getColumns = () => { let columns = cloneDeep(this.fieldDefColumns()) + if (this.moduleName.indexOf('resource') >= 0) { + columns[1].com = [{ + label: '', + type: 'TEXT', + key: 'fieldname', + }] + } return columns; } - - tableEditConfig = { + + tableEditConfig = { fieldDef: { ...this.editTableConfig, showAdd: false, @@ -349,10 +434,13 @@ export class FieldDefinedStore extends HrmBaseStore { } } - + activeTabInfo = {} + tabRecord = []; + isDBKeyValid = true; + /********************* unobservable list *********************/ - /********************* dialog info setting *********************/ - editorDialogRightMenu = []; + /********************* dialog info setting *********************/ + editorDialogRightMenu = []; getDialogOpButtons = () => { //获取权限组编辑对话框按钮列表 this.editorDialogRightMenu.length = 0; let buttons = []; @@ -365,23 +453,24 @@ export class FieldDefinedStore extends HrmBaseStore { if(this.dialogParams.groupInfoSetting.visible){ let logType = ''; - // switch(this.moduleName){ - // case 'subcompanyfielddefined': - // logType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED_GROUP'; - // break; - // case 'departmentfielddefined': - // logType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED_GROUP'; - // break; - // case 'resourcefielddefined': - // logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_GROUP'; - // break; - // } + switch(this.moduleName){ + case 'subcompanyfielddefined': + logType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED_GROUP'; + break; + case 'departmentfielddefined': + logType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED_GROUP'; + break; + case 'resourcefielddefined': + logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_GROUP'; + break; + } this.editorDialogRightMenu.push(...this.getBasicMenus(logType)); } return buttons; } - + /********************* dialog info setting *********************/ + /***** form ****/ editGroupInfoFormFields = [{ "title": i18n.label.basicSetting(), @@ -430,7 +519,7 @@ export class FieldDefinedStore extends HrmBaseStore { "defaultshow": true }] - /********************* observable list *********************/ + /********************* observable list *********************/ dialogParams = { //override baseStore.dialogParams editGroupInfo: { visible: false, @@ -462,81 +551,147 @@ export class FieldDefinedStore extends HrmBaseStore { } } - @observable spinning = false; - @observable moduleName = ''; //模块名称 - @observable topMenu = []; - @observable rightMenu = []; + @observable dropdownSelectedKey = '1'; + @observable _groupInfoOperability = true; + @observable feildDefTableSelectedRows = []; + @observable groupSettingTableSelectedRows = []; + @observable _feildDefSaveable = true; - @observable tabKey = '1' - @observable tabInfo = [] //需要自定义返回 - - //选中树节点信息 - @observable selectedTreeNodeInfo; - @observable treeConfig = { - data: [], - selectedKeys: [], - treeExpandKeys: [], - onExpand: (keys) => { - this.treeConfig.treeExpandKeys = keys; - }, - onSelectedTreeNode: (key, count, countType) => { - this.treeConfig.selectedKeys = [key]; - this.selectedTreeNodeInfo = countType.node.props.data; - this.getTabInfoByTreeNode(null, true); - } + @observable refreshMainTabComponent = new Date().getTime(); + @observable refreshFeildDef = new Date().getTime(); //当需要刷新主页面tab时,变更此值 + @observable refreshForm = new Date().getTime(); + @observable refreshEditGroupTabComponent = new Date().getTime(); //当需要刷新权限组编辑tab时,变更此值 + @observable spinning = false; + @observable moduleName = ''; + /********************* observable list *********************/ + + /********************* computed list *********************/ + @computed get feildDefRemoveable() { //字段定义表是否有选中行 + return this.feildDefTableSelectedRows.length === 0; } - @observable refreshMainTabComponent = new Date().getTime(); + @computed get groupInfoRemoveable() { //字段定义表是否有选中行 + return this.groupSettingTableSelectedRows.length === 0; + } + @computed get feildDefSaveable() { //字段定义表是否有记录 + return this._feildDefSaveable; + } - @observable moveToGroup = false; //移动到组 - /** - * 初始化模块数据 - */ - @action initResourceData = (module) => { - this.selectedTreeNodeInfo = null; - this.treeConfig.treeExpandKeys.length = 0; - this.moduleName = module; - api.getTree().then(data => { + @computed get groupInfoOperability() { //是否有组信息 + return this._groupInfoOperability; + } + /********************* computed list *********************/ + + /********************* action list *********************/ + /** + * 初始化模块数据 + * @return {null} + */ + @action initData = (create = false, init = false, module) => { + this.dropdownSelectedKey = '1'; + if (module != null) { + this.moduleName = module; + } + this.selectedTreeNodeInfo = null; + // this.tableEditConfig.fieldDef.columns = cloneDeep(this.fieldDefColumns()); + api.getTabInfo(this.moduleName).then(data => { + this._groupInfoOperability = data.tabs.length === 0; if (data.status === '1') { - // this.setTableEditColTitle(); - if (data.treejson.length > 0) { - this.treeConfig.data = data.treejson; - this.treeConfig.selectedKeys = [data.treejson[0].key]; - this.selectedTreeNodeInfo = data.treejson[0]; - this.getTabInfoByTreeNode(null, true); - + let tabArr = []; + this.tabRecord = data.tabs; + data.tabs && data.tabs.map((tabInfo, index) => { + let t = cloneDeep(this.tabDef); + tabArr.push({ + ...t, + ...tabInfo, + viewCondition: `${tabArr.length + 1}` + }); + }); + if (tabArr.length > 0) { + this.tabConfig.tabs = [...tabArr]; + // this.setTableEditColTitle(); + this.setActiveTab(this.tabConfig, init ? '1' : !create ? this.tabConfig.activeTabKey : `${tabArr.length}`); + this.containerInitFinished = { + ...this.containerInitFinished, + init: true + } } } else { message.error(data.message); } - }, error => {}) - } + }, error => { - @action getTabInfoByTreeNode = (create = false, init = false, isLeaf) => { - api.getTabInfo(this.moduleName, { - groupType: this.treeConfig.selectedKeys[0] - }).then(data => { - if (data.status === '1') { - let t = cloneDeep(this.tabDef); - this.setTopMenu(t.topButtonDef); - this.setRightMenu(t.topButtonDef); - data.tabs && this.setTabInfo(data.tabs); - this.getFieldDefinedInfo(this.tabKey); - } else { - message.error(data.message); - } }) - } + } - - - @action("tab切换") onTabChange(tabKey) { - this.setTabKey(tabKey); - this.getFieldDefinedInfo(tabKey); - } + setTableEditColTitle = () => { + [...Object.keys(this.tableEditConfig)].map(k => { + this.tableEditConfig[k].columns.map(c => { + if (typeof(c.title) == 'function') + c.title = c.title(); + else + c.title = c.title; + }) + }) + } - @action onTabEdit = (targetKey, action) => { + /** + * tab change事件(通过变更refreshMainTabComponent使index重新render) + * @param {Object} tabConfig [tabConfig] + * @param {String} key [tabKey] + * @return {null} + */ + @action setActiveTab = (tabConfig, key) => { + tabConfig.activeTabKey = key || tabConfig.tabs[0].viewCondition; + const tabIndex = this.getTabIndex(this.tabConfig.tabs, key); + if (tabIndex < 0) return; + this.dropdownSelectedKey = '1'; + this.feildDefTableSelectedRows.length = 0; + this.tableEditConfig.fieldDef.selectedRowKeys = []; + this.activeTabInfo = { + activeTabKey: this.tabConfig.activeTabKey, + activeTabIndex: this.getTabIndex(this.tabConfig.tabs, this.tabConfig.activeTabKey), + tabInfo: this.tabConfig.tabs[tabIndex] + } + let params = { + groupId: this.activeTabInfo.tabInfo.groupid, + } + if (this.selectedTreeNodeInfo != null) + params.groupType = this.selectedTreeNodeInfo.key + this.spinning = true; + api.getFieldDefinedInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + const { + datas, + selectedData + } = this.convertData(data.data, 'fieldDef'); + this.encryptEnable = data.encryptEnable; + this.tableEditConfig.fieldDef.datas = datas; + this.tableEditConfig.fieldDef.columns = this.getColumns(); + + //人员卡片字段定义columns是动态的,因此需要重新计算得出selectedData + if (this.moduleName === 'resourcefielddefined') { + const { + selectedData + } = this.convertData(data.data, 'fieldDef'); + this.tableEditConfig.fieldDef.selectedData = selectedData; + } else { + this.tableEditConfig.fieldDef.selectedData = selectedData; + } + + if (this.tabRecord.length > 0) { + this.tabRecord[this.activeTabInfo.activeTabIndex].editable = (data.data.length === 0); + this.activeTabInfo.tabInfo.editable = (data.data.length === 0); + } + } else + message.error(data.message); + this.spinning = false; + this.refreshMainTabComponent = new Date().getTime(); + }, error => {this.spinning = false;}) + } + + @action onTabEdit = (targetKey, action) => { const tabIndex = this.getTabIndex(this.tabConfig.tabs, targetKey); if (tabIndex < 0) return; const tabInfo = this.tabConfig.tabs[tabIndex]; @@ -570,44 +725,14 @@ export class FieldDefinedStore extends HrmBaseStore { } } - @action getFieldDefinedInfo(tabKey) { - let params = { - groupId:tabKey, - groupType: -1 - } - api.getFieldDefinedInfo(this.moduleName, params).then(data => { - if (data.status === '1') { - const { - datas, - selectedData - } = this.convertData(data.data, 'fieldDef'); - this.encryptEnable = data.encryptEnable; - this.tableEditConfig.fieldDef.datas = datas; - this.tableEditConfig.fieldDef.columns = this.getColumns(); + @action dialogSaveOp = () => { + this.dialogParams.editGroupInfo.visible && this.doSaveGroupInfo(); + this.dialogParams.groupInfoSetting.visible && this.doSaveGroupSetting(); + this.dialogParams.createChildInfo.visible && this.doSaveChildInfo(); + this.dialogParams.childInfoSetting.visible && this.doSaveChildInfoSetting(); + } - //人员卡片字段定义columns是动态的,因此需要重新计算得出selectedData - if (this.moduleName === 'resourcefielddefined') { - const { - selectedData - } = this.convertData(data.data, 'fieldDef'); - this.tableEditConfig.fieldDef.selectedData = selectedData; - } else { - this.tableEditConfig.fieldDef.selectedData = selectedData; - } - - // if (this.tabRecord.length > 0) { - // this.tabRecord[this.activeTabInfo.activeTabIndex].editable = (data.data.length === 0); - // this.activeTabInfo.tabInfo.editable = (data.data.length === 0); - // } - } else - message.error(data.message); - this.spinning = false; - this.refreshMainTabComponent = new Date().getTime(); - }, error => {this.spinning = false;}) - } - - - @action editGroup = (group, moveToGroup = false) => { + @action editGroup = (group, moveToGroup = false) => { this.moveToGroup = moveToGroup; this.editGroupInfoFormFields.map(f => { if (typeof(f.title) == 'function') @@ -637,22 +762,60 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('editGroupInfo', true, dialogTitle); } - @action dialogSaveOp = () => { - this.dialogParams.editGroupInfo.visible && this.doSaveGroupInfo(); - // this.dialogParams.groupInfoSetting.visible && this.doSaveGroupSetting(); - // this.dialogParams.createChildInfo.visible && this.doSaveChildInfo(); - // this.dialogParams.childInfoSetting.visible && this.doSaveChildInfoSetting(); + @action doGroupSetting = () => { + this.tableEditConfig.groupSetting.datas.length = 0; + let arr = []; + this.tabRecord.map(tabInfo => { + let viewAttr = tabInfo.viewAttr; + // if (viewAttr != 1 && has(tabInfo, 'editable')) { + // viewAttr = !tabInfo.editable ? 1 : 2; + // } + arr.push({ + "record": { + "id": tabInfo.groupid, + "viewAttr": tabInfo.viewAttr, + "isShow": tabInfo.isShow, + "groupName": tabInfo.multiTitle || tabInfo.title || '', + "editable": tabInfo.editable + }, + "props": { + "checkProps": { + "isShow": { + viewAttr + } + } + } + }) + }) + Object.assign(this.tableEditConfig.groupSetting, { ...this.convertData(arr, 'groupSetting') + }); + this.tableEditConfig.groupSetting.columns = this.groupDefColumns(); + this.tableEditConfig.groupSetting.datas.map(d => { + Object.assign(d, { + com: { + groupName: [{ + label: '', + type: 'INPUT', + key: 'groupName', + viewAttr: d.viewAttr, + otherParams: { + ...window.inputType + } + }] + } + }) + }) + this.setDialogVisible('groupInfoSetting', true, i18n.button.groupMaintain()); } - - doSaveGroupInfo = () => { + doSaveGroupInfo = () => { this.formTarget.groupInfoFrom.validateForm().then(f => { if (f.isValid) { let record = { ...this.formTarget.groupInfoFrom.getFormParams(), isShow: 1 } - const recordIndex = findIndex(this.tabInfo.tabs, { + const recordIndex = findIndex(this.tabConfig.tabs, { title: getCurrentLabel(record.groupName) }); if (recordIndex >= 0) { @@ -664,9 +827,9 @@ export class FieldDefinedStore extends HrmBaseStore { records = []; this.opId != null && Object.assign(record, { id: this.opId, - isShow: this.tabInfo.isShow + isShow: this.activeTabInfo.tabInfo.isShow }); - this.tabInfo.map(tabInfo => { + this.tabConfig.tabs.map(tabInfo => { if (tabInfo.groupid === this.opId) { found = true; records.push(record) @@ -692,9 +855,12 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('editGroupInfo', false, ''); if(this.moveToGroup){ const ids = data.groupid.split(','); - //this.changeGroup(null, ids[ids.length - 1]); 移动到组 + this.changeGroup(null, ids[ids.length - 1]); }else{ - this.getTabInfoByTreeNode(); + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + else + this.initData(this.opId == null); message.success(i18n.message.saveSuccess()); } } else @@ -709,22 +875,1354 @@ export class FieldDefinedStore extends HrmBaseStore { }); } - setTabInfo(tabInfo) { - this.tabInfo = tabInfo; + @action saveFieldDefine = () => { + if(this.spinning) + return; + this.spinning = true; + this.recordOP(this.editTable['fieldDef'], 'valid'); + let data = cloneDeep(this.tableEditConfig.fieldDef.datas), + labelArr = [], + nameArr = []; + if (!this.isDBKeyValid) { + this.spinning = false; + return; + } + + const invalidEmpty = data.some((d, index) => { + d.key = index; + delete d.com; + delete d.checkProps; + delete d.viewAttr; + if (has(d, 'fieldTypeObj')) { + if (Array.isArray(d.fieldTypeObj) && d.fieldTypeObj.length > 0 && d.fieldTypeObj[0] != 'select') + d.fieldType = d.fieldTypeObj; + delete d.fieldTypeObj; + } + if (!Array.isArray(d.fieldType)) + delete d.fieldType; + + if (!has(d, 'enable')) + d.enable = '0'; + if (!has(d, 'required')) + d.required = '0'; + + let fieldlabel = d.fieldlabel || '', + fieldname = d.fieldname || ''; + if (fieldlabel === '' || (this.moduleName != 'resourcefielddefined' && fieldname === '')) { + return true; + } + labelArr.push(getCurrentLabel(d.fieldlabel)); + nameArr.push(d.fieldname); + return false; + }) + let checkSame = false; + if (this.moduleName.indexOf('resource') >= 0) + checkSame = uniq(labelArr).length === data.length; + else + checkSame = uniq(labelArr).length === data.length && uniq(nameArr).length === data.length; + if (invalidEmpty) { + this.spinning = false; + return; + } else if (checkSame) { + this.spinning = true; + let dataObj = { + groupId: this.activeTabInfo.tabInfo.groupid, + records: data + } + if (this.selectedTreeNodeInfo != null) + dataObj.groupType = this.selectedTreeNodeInfo.key; + let params = { + data: JSON.stringify(dataObj) + } + if (this.selectedTreeNodeInfo != null) + params.groupType = this.selectedTreeNodeInfo.key; + + const checkRs = this.editTable['fieldDef'] && this.editTable['fieldDef'].refs.edit.doRequiredCheck() || {pass: true}; + if(!checkRs.pass){ + this.spinning = false; + return; + } + + api.saveFieldDefinedInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + message.success(i18n.message.saveSuccess()); + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + else + this.initData(); + } else { + message.error(data.message); + } + this.spinning = false; + }, error => {this.spinning = false;}) + } else { + message.error(i18n.confirm.displayOrDBFieldExist()); + this.spinning = false; + } + } + + @action onEdit = (keys, datas, c, dataIndex) => { + if(dataIndex === 'fieldlabel' && this.moduleName != 'resourcefielddefined'){ + const oldRecord = this.tableEditConfig.fieldDef.datas[keys[0]]; + if(has(oldRecord, 'com') && has(oldRecord.com, 'fieldname') && oldRecord.com.fieldname.length > 0 && oldRecord.com.fieldname[0].type === 'TEXT'){ + return; + } + this.getPinYin({labelName: getCurrentLabel(datas[0].fieldlabel)}).then(data => { + const {pinyin} = data; + oldRecord.fieldname = pinyin; + const arr = filter(this.tableEditConfig.fieldDef.datas, {fieldname: pinyin}); + if(arr.length > 1 && pinyin != ''){ + oldRecord.fieldname = pinyin + '1'; + } + this.refreshFeildDef = new Date().getTime(); + }); + } + } + @action onAdd = (keys, datas) => { + try{ + this.tableEditConfig.fieldDef.datas[keys[0] - 1].enable = '1'; + (this.tableEditConfig.fieldDef.selectedData.enable || []).push(keys[0] - 1); + this.refreshFeildDef = new Date().getTime(); + }catch(e){ + + } + } + + @action onFieldDefChange = (datas) => { + let selectedData = { + enable: [], + required: [] + } + if (this.moduleName === 'resourcefielddefined') { + Object.assign(selectedData,{ + isModify:[] + }); + } + datas.map((data, index) => { + if (data['enable'] === '1') + selectedData.enable.push(index); + if (data['required'] === '1') + selectedData.required.push(index); + if (data['isModify'] && data['isModify'] === '1' && this.moduleName === 'resourcefielddefined') { + selectedData.isModify.push(index); + } + }) + this.tableEditConfig.fieldDef.datas = datas; + this.tableEditConfig.fieldDef.selectedData = selectedData; + this._feildDefSaveable = datas.length === 0; + if (datas.length === 0) { + // this.initData(); + } else + this.refreshFeildDef = new Date().getTime() + } + + @action onFieldDefRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => { + if (dataIndex == null) { + this.feildDefTableSelectedRows = sRowKeys; + this.tableEditConfig.fieldDef.selectedRowKeys = sRowKeys; + } else { + if (selectedDatas != null && selectedDatas.hasOwnProperty(dataIndex)) { + const arr = selectedDatas[dataIndex]; + this.tableEditConfig.fieldDef.datas.map((data, index) => { + if(dataIndex === 'enable'){ + data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; + if(data[dataIndex] === '0'){ + data['required'] = '0'; + remove(selectedDatas['required'], v => v === index); + data['isModify'] = '0'; + remove(selectedDatas['isModify'], v => v === index); + } + }else if(dataIndex === 'required'){ + data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; + if (data[dataIndex] === '1') { + data['enable'] = '1'; + if (selectedDatas['enable'].indexOf(index) < 0) + selectedDatas['enable'].push(index); + } + } else if (dataIndex === 'isModify') { + data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; + if (data[dataIndex] === '1') { + data['enable'] = '1'; + if (selectedDatas['enable'].indexOf(index) < 0) + selectedDatas['enable'].push(index); + } + + } else + data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; + }) + + this.tableEditConfig.fieldDef.selectedData = selectedDatas; + } + } + this.processLinkage(selectedDatas); + this.refreshFeildDef = new Date().getTime() + } + + //处理账号类型和主账号的联动(允许个人修改):账号类型选中,主账号也会选中,反之亦然。 + processLinkage = (selectedDatas) => { + const {datas} = this.tableEditConfig.fieldDef; + + const target = datas.find(data => data.fieldname === 'accounttype'); + + if (!target) return; + + const accounttype = target.isModify; + + const belongto = datas.find(data => data.fieldname === 'belongto').isModify; + + if (belongto !== accounttype) { + datas.find(data => data.fieldname === 'belongto').isModify = accounttype; + + const belongtoIndex = datas.findIndex(data => data.fieldname === 'belongto'); + + if (accounttype === '1') { + selectedDatas['isModify'].push(belongtoIndex); + }else{ + remove(selectedDatas['isModify'], v => v === belongtoIndex); + } + } + + } + + @action onFieldDefRowSelection = (rowSelection) => { + let sel = { + ...rowSelection + } + sel.getCheckboxProps = (record) => { + let disabled = false; + switch(this.dropdownSelectedKey){ + case '2': + disabled = false;//复制时,checkbox全部启用 + break; + case '3': + disabled = record.id == null || record.checkProps.enable.viewAttr === 1;//移动到组时,checkbox根据id是否为空或是否引用启用按钮状态赋值 + break; + default: + disabled = record.viewAttr === 1;//删除时,checkbox根据record.viewAttr赋值 + break + } + return { + disabled + }; + } + return sel; + } + + @action onFieldDefDeleteOpr = (ks, ds) => { + let ids = []; + ds.map(d => { + if (has(d, 'id')) + ids.push(d.id) + }); + let params = { + id: ids.join(',') + } + if (this.selectedTreeNodeInfo != null) + params.groupType = this.selectedTreeNodeInfo.key; + params.groupId = this.activeTabInfo.tabInfo.groupid; + if(ids.length > 0){ + api.removeFieldDefinedInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + // this.initData(); + this.tableEditConfig.fieldDef.selectedRowKeys.length = 0; + message.success(i18n.message.deleteSuccess()); + } else + message.error(data.message); + }, error => { + + }) + }else{ + this.tableEditConfig.fieldDef.selectedRowKeys.length = 0; + } + + this.feildDefTableSelectedRows.length = 0; + } + + @action onGroupSettingChange = (datas, type) => { + this.tableEditConfig[type === 'group' ? 'groupSetting' : 'childInfoSetting'].datas = datas; + } + + @action onGroupSettingRowSelect = (sRowKeys, rows, dataIndex, selectedDatas, type) => { + if (dataIndex == null) { + this.groupSettingTableSelectedRows = sRowKeys; + } else { + if (selectedDatas != null && selectedDatas.hasOwnProperty(dataIndex)) { + const arr = selectedDatas[dataIndex]; + this.tableEditConfig[type === 'group' ? 'groupSetting' : 'childInfoSetting'].datas.map((data, index) => { + data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; + }) + } + } + } + + @action onGroupSettingRowSelection = (rowSelection) => { + let sel = { + ...rowSelection + } + sel.getCheckboxProps = (record) => { + return { + disabled: record.editable === false // ? true : has(record, 'editable') ? !record.editable : false + }; + } + return sel; + } + + doSaveGroupSetting = () => { + this.recordOP(this.editTable['groupSetting'], 'valid'); + let groupNameArr = [], + tabArr = []; + const invalidEmpty = this.tableEditConfig.groupSetting.datas.some(group => { + groupNameArr.push(getCurrentLabel(group.groupName)); + tabArr.push({ + id: group.id, + isShow: group.isShow == null ? '0' : group.isShow, + groupName: group.groupName + }) + return group.groupName === ''; + }) + if (invalidEmpty) { + // message.error(i18n.confirm.groupNameIsEmpty()); + return; + } else if (uniq(groupNameArr).length === this.tableEditConfig.groupSetting.datas.length) { + let dataObj = { + records: tabArr + } + let params = {} + if (this.selectedTreeNodeInfo != null) { + dataObj.groupType = this.selectedTreeNodeInfo.key; + params.groupType = this.selectedTreeNodeInfo.key; + } + params.data = JSON.stringify(dataObj); + api.saveGroupInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + this.setDialogVisible('groupInfoSetting', false, ''); + + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(false, true); + else + this.initData(false, true); + message.success(i18n.message.saveSuccess()); + } else + message.error(data.message); + }, error => { + message.error(i18n.message.actionError()); + }); + } else { + message.error(i18n.confirm.groupNameExist()); + } + } + + @action onGroupSettingDeleteOpr = (ks, ds, type) => { + let ids = []; + ds.map(d => { + if (has(d, 'id')) + ids.push(d.id) + }); + let params = { + id: ids.join(',') + } + if (this.selectedTreeNodeInfo != null) + params.groupType = this.selectedTreeNodeInfo.key; + if (type === 'group') { + ids.length > 0 && api.removeGroupInfo(this.moduleName, params).then(data => { + if (data.status === '1') { + message.success(i18n.message.deleteSuccess()); + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(false, true); + else + this.initData(false, true); + } else { + message.error(data.message); + } + }) + } else {} + } + + //人员卡片字段定义部分 + @observable refreshTree = new Date().getTime(); + @observable treeConfig = { + data: [], + selectedKeys: [], + treeExpandKeys: [], + onExpand: (keys) => { + this.treeConfig.treeExpandKeys = keys; + }, + onSelectedTreeNode: (key, count, countType) => { + this.treeConfig.selectedKeys = [key]; + this.selectedTreeNodeInfo = countType.node.props.data; + this.getTabInfoByTreeNode(null, true); + } + } + //人员卡片字段定义-选中树节点的信息 + @observable selectedTreeNodeInfo; + + //计算【工作信息】树节点以及子节点的domid + @computed get jobTreeNodeDomids() { + const { + data + } = this.treeConfig; + const domids = ['3']; + data && data.forEach(obj => { + const { + key, + childs + } = obj; + if (key === '3') { + childs.forEach(child => { + const { + domid + } = child; + domids.push(domid); + }) + } + }); + return domids; + } + + //当前树节点是否为【工作信息】 + @computed get isJobTreeNode() { + if (this.selectedTreeNodeInfo) { + const { + domid, + } = this.selectedTreeNodeInfo; + + return this.jobTreeNodeDomids.includes(domid); + } + } + + @computed get childInfoOperability() { + return this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid == '-1'; + } + + @action initResourceData = (module) => { + this.selectedTreeNodeInfo = null; + this.dropdownSelectedKey = '1'; + this.moduleName = module; + // let columns = cloneDeep(this.fieldDefColumns()) + // columns.splice(1, 1); + // columns[1].width = '65%'; + // this.tableEditConfig.fieldDef.columns = this.getColumns(); + this.treeConfig.treeExpandKeys.length = 0; + api.getTree().then(data => { + if (data.status === '1') { + this.containerInitFinished = { + ...this.containerInitFinished, + init: true + } + + // this.setTableEditColTitle(); + if (data.treejson.length > 0) { + this.treeConfig.data = data.treejson; + this.treeConfig.selectedKeys = [data.treejson[0].key]; + this.selectedTreeNodeInfo = data.treejson[0]; + this.getTabInfoByTreeNode(null, true); + } + } else { + message.error(data.message); + } + }, error => {}) + } + + getTree = (callback) => { + this.treeConfig.data.length = 0; + this.refreshTree = new Date().getTime(); + api.getTree().then(data => { + if (data.status === '1') { + this.treeConfig.data = data.treejson; + this.treeConfig.data.map(p => { + if (p.domid === this.treeConfig.selectedKeys[0]) + this.selectedTreeNodeInfo = p; + p.childs && p.childs.map(c => { + if (c.domid === this.treeConfig.selectedKeys[0]) + this.selectedTreeNodeInfo = c; + }) + }) + callback && callback(); + } else { + message.error(data.message); + } + this.refreshTree = new Date().getTime(); + }, error => {}) + } + + setBtn = (t) => { + if (!this.selectedTreeNodeInfo.hasGroup) { + t.topButtonDef.splice(1, 3); + } + if (this.selectedTreeNodeInfo.addChild) { + this.tableEditConfig.childInfoSetting.showTitle = true; + this.tableEditConfig.childInfoSetting.showAdd = true; + this.tableEditConfig.childInfoSetting.showDelete = true; + this.selectedTreeNodeInfo.domid != '-1' && t.topButtonDef.push({ + comType: 'button', + type: 'primary', + onClickHandle: this.doChildInfoSetting, + label: i18n.button.childInfoMaintain(), + icon: this.menuIconCollection.setting, + checkAction: 'childInfoOperability' + }); + } else { + this.tableEditConfig.childInfoSetting.showTitle = false; + this.tableEditConfig.childInfoSetting.showAdd = false; + this.tableEditConfig.childInfoSetting.showDelete = false; + this.selectedTreeNodeInfo.domid != '-1' && t.topButtonDef.push({ + comType: 'button', + type: 'primary', + onClickHandle: () => this.createChildInfo(false, { + name: this.selectedTreeNodeInfo.name, + multiName: this.selectedTreeNodeInfo.multiName + }), + label: i18n.button.editChildInfo(), + icon: this.menuIconCollection.setting + }) && t.topButtonDef.push({ + comType: 'button', + type: 'primary', + onClickHandle: this.removeChildInfo, + label: i18n.button.delete(), + icon: this.menuIconCollection.setting + }); + } + + if (this.selectedTreeNodeInfo.domid === '-1' || this.selectedTreeNodeInfo.addChild) { + this.tableEditConfig.fieldDef.columns[2].com[0].options = remove(this.tableEditConfig.fieldDef.columns[1].com[0].options, (v) => v != 'upload'); + } else { + this.tableEditConfig.fieldDef.columns[2].com[0].options.push('upload'); + } + } + + addEmptyTab = (groupid) => { + let tabArr = []; + let t = cloneDeep(this.tabDef); + this.setBtn(t); + tabArr.push({ + ...t, + groupid, + viewCondition: '1' + }); + this.tabConfig.tabs = [...tabArr]; + } + + @action getTabInfoByTreeNode = (create = false, init = false, isLeaf) => { + api.getTabInfo(this.moduleName, { + groupType: this.treeConfig.selectedKeys[0] + }).then(data => { + if (data.status === '1') { + this._groupInfoOperability = data.tabs.length === 0; + let tabArr = []; + this.tabRecord = data.tabs; + data.tabs && data.tabs.map((tabInfo, index) => { + let t = cloneDeep(this.tabDef); + this.setBtn(t); + tabArr.push({ + ...t, + ...tabInfo, + viewCondition: `${tabArr.length + 1}` + }); + }); + this.tabConfig.tabs = [...tabArr]; + if (tabArr.length > 0) { + this.setActiveTab(this.tabConfig, init ? '1' : !create ? this.tabConfig.activeTabKey : `${tabArr.length}`); + } else { + this.addEmptyTab(this.treeConfig.selectedKeys[0]); + this.setActiveTab(this.tabConfig, '1'); + this.refreshMainTabComponent = new Date().getTime(); + } + } else { + message.error(data.message); + } + }) + } + + isCreateChildInfo = false; + @action createChildInfo = (create = true, data = {}) => { + this.isCreateChildInfo = create; + this.editChildInfoFormFields.map(f => { + if (typeof(f.title) == 'function') + f.title = f.title(); + f.items.map(item => { + if (typeof(item.label) == 'function') + item.label = item.label(); + if (item.conditionType === 'INPUT') + item.otherParams = {...window.inputType}; + }) + }) + let fields = [...this.editChildInfoFormFields], + dialogTitle = create ? i18n.button.createChildInfo() : i18n.button.editChildInfo(); + if (create) { + this.dialogParams.createChildInfo.height = 110; + } else { + fields[0].items.splice(1, 1); + this.dialogParams.createChildInfo.height = 70; + } + this.setFormData('childInfoForm', fields); + if (!create) { + this.formTarget.childInfoForm.updateFields({ + name: { + value: data.multiName || data.name || '' + }, + infoOrder: { + value: data.infoOrder + } + }) + } + this.setDialogVisible('createChildInfo', true, dialogTitle); + } + + @action doSaveChildInfo = () => { + this.formTarget.childInfoForm.validateForm().then(f => { + if (f.isValid) { + let record = { + ...this.formTarget.childInfoForm.getFormParams(), + isShow: 1 + } + + let cloneTree = cloneDeep(this.toJS(this.treeConfig.data)); + let parentId; + let nameArr = []; + if (this.isCreateChildInfo) { + this.selectedTreeNodeInfo.childs.map(c => { + nameArr.push(getCurrentLabel(c.name)); + }) + nameArr.push(getCurrentLabel(record.name)); + if (uniq(nameArr).length != nameArr.length) { + f.showError('name', i18n.confirm.childInfoNameExist()); + this.showError = new Date().getTime(); + return; + } + const i = findIndex(cloneTree, { + key: this.selectedTreeNodeInfo.key + }); + cloneTree[i].childs.push(record) + parentId = this.selectedTreeNodeInfo.domid; + } else { + let checked = true; + cloneTree.map(p => { + p.childs && p.childs.map(c => { + if (c.domid === this.selectedTreeNodeInfo.domid) { + p.childs.map(child => { + if (child.domid != c.domid) + nameArr.push(getCurrentLabel(child.name)); + else + nameArr.push(getCurrentLabel(record.name)); + }) + + if (uniq(nameArr).length != nameArr.length) { + f.showError('name', i18n.confirm.childInfoNameExist()); + this.showError = new Date().getTime(); + checked = false; + return; + } else { + Object.assign(c, { + name: record.name + }); + parentId = p.domid; + } + }else{ + Object.assign(c, { + name: c.multiName + }); + } + }) + }) + if (!checked) + return; + } + const params = { + data: JSON.stringify({ + records: this.convertAttr(cloneTree) + }), + parentId + } + api.saveTree(params).then(data => { + if (data.status === '1') { + this.setDialogVisible('createChildInfo', false, ''); + this.getTree(); + message.success(i18n.message.saveSuccess()); + } else + message.error(data.message); + }, error => { + message.error(i18n.message.actionError()); + }); + // } + } else { + f.showErrors(); + this.showError = new Date().getTime(); + } + }); + } + + @action doChildInfoSetting = () => { + this.tableEditConfig.childInfoSetting.datas.length = 0; + let arr = []; + if (!this.selectedTreeNodeInfo.addChild) { + arr.push({ + "record": { + "id": this.selectedTreeNodeInfo.key, + "viewAttr": this.selectedTreeNodeInfo.viewAttr, + "isShow": this.selectedTreeNodeInfo.isShow, + "name": this.selectedTreeNodeInfo.multiName || this.selectedTreeNodeInfo.name || '' + }, + "props": { + "checkProps": { + "isShow": { + "viewAttr": this.selectedTreeNodeInfo.viewAttr + } + } + } + }) + } else { + this.selectedTreeNodeInfo.childs.map(child => { + let viewAttr = child.viewAttr; + if (viewAttr != 1 && has(child, 'editable')) { + viewAttr = !child.editable ? 1 : 2; + } + arr.push({ + "record": { + "id": child.key, + "viewAttr": child.viewAttr, + "isShow": child.isShow, + "name": child.multiName || child.name || '' + }, + "props": { + "checkProps": { + "isShow": { + viewAttr + } + } + } + }) + }) + } + + Object.assign(this.tableEditConfig.childInfoSetting, { ...this.convertData(arr, 'childInfoSetting') + }); + this.tableEditConfig.childInfoSetting.columns = this.childInfoDefColumns(); + this.tableEditConfig.childInfoSetting.datas.map(d => { + Object.assign(d, { + com: { + name: [{ + label: '', + type: 'INPUT', + key: 'name', + viewAttr: d.viewAttr, + otherParams: { + ...window.inputType + } + }] + } + }) + }) + this.setDialogVisible('childInfoSetting', true, i18n.button.childInfoMaintain()); + } + + convertAttr = (cloneTree) => { + let arr = []; + cloneTree.map(root => { + let parent = { + id: root.key, + infoOrder: root.infoOrder, + name: root.name, + isShow: root.isShow + } + if (root.childs) { + parent.childs = []; + root.childs.map(c => { + parent.childs.push({ + id: c.key || c.id, + name: c.name, + isShow: c.isShow, + infoOrder: c.infoOrder + }) + }) + } + arr.push(parent); + }) + return arr; + } + + removeChildInfo = () => { + this.confirmInfo({ + content: i18n.confirm.deleteSelected(), + onOk: () => { + let parentId; + let cloneTree = cloneDeep(this.toJS(this.treeConfig.data)); + cloneTree.map(p => { + p.childs && p.childs.map((c, i) => { + if (c.domid === this.selectedTreeNodeInfo.domid) { + parentId = p.domid; + p.childs.splice(i, 1); + } + }) + }) + const params = { + data: JSON.stringify({ + records: this.convertAttr(cloneTree) + }), + parentId + } + api.saveTree(params).then(data => { + if (data.status === '1') { + message.success(i18n.message.deleteSuccess()); + this.getTree(() => { + this.treeConfig.selectedKeys = ['-1']; + this.selectedTreeNodeInfo = this.treeConfig.data[0]; + this.getTabInfoByTreeNode(null, true); + }); + // this.treeConfig.selectedKeys = [this.treeConfig.data[0].key]; + // this.selectedTreeNodeInfo = this.treeConfig.data[0]; + // this.getTabInfoByTreeNode(null, true); + } else + message.error(data.message); + }, error => { + message.error(i18n.message.actionError()); + }); + } + }); + } + + doSaveChildInfoSetting = () => { + this.recordOP(this.editTable['childInfoSetting'], 'valid'); + let infoNameArr = [], + infoArr = []; + const invalidEmpty = this.tableEditConfig.childInfoSetting.datas.some(group => { + infoNameArr.push(getCurrentLabel(group.name)); + infoArr.push({ + id: group.id, + isShow: group.isShow == null ? '0' : group.isShow, + name: group.name + }) + return group.name === ''; + }) + if (invalidEmpty) { + return; + } else if (uniq(infoNameArr).length === this.tableEditConfig.childInfoSetting.datas.length) { + let parentId; + let cloneTree = cloneDeep(this.toJS(this.treeConfig.data)); + if (!this.selectedTreeNodeInfo.addChild) { + cloneTree.map(p => { + p.childs && p.childs.map(c => { + if (c.domid === infoArr[0].id) { + Object.assign(c, infoArr[0]); + parentId = p.domid; + } + }) + }) + } else { + parentId = this.selectedTreeNodeInfo.key; + const i = findIndex(cloneTree, { + key: this.selectedTreeNodeInfo.key + }); + cloneTree[i].childs = []; + infoArr.map(info => { + cloneTree[i].childs.push({ ...info + }) + }) + } + + const params = { + data: JSON.stringify({ + records: this.convertAttr(cloneTree) + }), + parentId + } + api.saveTree(params).then(data => { + if (data.status === '1') { + this.setDialogVisible('childInfoSetting', false, ''); + this.getTree(); + this.getTabInfoByTreeNode(null, true); + message.success(i18n.message.saveSuccess()); + } else + message.error(data.message); + }, error => { + message.error(i18n.message.actionError()); + }); + } else { + message.error(i18n.confirm.groupNameExist()); + } + } + //移动到组 + @action dropdownClick = (e) => { + switch(e.key){ + case 'createAndMove': + this.editGroup(null, true); + break; + default: + const groupid = e.key; + const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, {groupid})]; + let moveFieldConfirm = i18n.confirm.moveFieldConfirm().replace('{params}', tabInfo.title); + this.changeGroup(moveFieldConfirm, groupid); + } + } + + @action changeGroup = (moveFieldConfirm, groupid) => { + const params = {}; + let ids = []; + let names = []; + this.tableEditConfig.fieldDef.selectedRowKeys.map(idx => { + try{ + ids.push(this.tableEditConfig.fieldDef.datas[idx].id); + names.push(this.tableEditConfig.fieldDef.datas[idx].fieldname); + }catch(e){ + + } + }); + if(this.moduleName.indexOf('resource') > -1){ + Object.assign(params, { + fieldids: ids.join(','), + fieldnames: names.join(','), + groupid, + scopeid: this.selectedTreeNodeInfo.domid + }) + }else{ + Object.assign(params, { + ids: ids.join(','), + groupid + }); + } + moveFieldConfirm == null ? + this.doChangeGroup(params) : + this.confirmInfo({ + content:moveFieldConfirm, + onOk: () => { + this.doChangeGroup(params) + } + }); + } + + @action doChangeGroup = (params) => { + api.changeGroup(this.moduleName, params).then(data => { + if (data.status === '1') { + message.success(i18n.message.moveSuccess()); + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + else + this.initData(); + } else + message.error(data.message); + }, error => {message.error(i18n.message.actionError());}); + } + + @observable encryptDialogVisible = false; + @observable encryptDialogTitle = ""; + get encryptDialogButtons(){ + const buttonDef = [ + { + content: getLabel(30986, '保存'), + icon: 'icon-coms-Preservation', + onClickHandle: this.saveEncryptFieldSettingForm + } + ] + const buttons = [], moreBtnData = []; + buttonDef.map((btn, index) => { + const {content, icon, onClickHandle} = btn; + buttons.push( + () + ); + + moreBtnData.push({ + key: index.toString(), + content, + icon: , + onClick: onClickHandle + }); + }) + const {scopeId} = this.opParams; + let arr = []; + if(scopeId == '-1'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEBASE', this.encryptParams.encryptId); + }else if(scopeId == '1'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEPERSONAL', this.encryptParams.encryptId); + }else if(scopeId == '3'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEWORK', this.encryptParams.encryptId); + }else if(scopeId == 'subcompany'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SUBCOMPANY', this.encryptParams.encryptId); + }else if(scopeId == 'department'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_DEPARTEMENT', this.encryptParams.encryptId); + }else if(scopeId == 'salary'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SALARY'); + }else{} + moreBtnData.push(...arr); + return {buttons, moreBtn: {datas: moreBtnData}}; + } + + @computed get encryptDialogProps(){ + return { + title: this.encryptDialogTitle, + style: { + width: 600, + height: 350 + }, + ...ecCom.WeaTools.getIconBGC('currency'), + ...this.encryptDialogButtons, + visible: this.encryptDialogVisible, + onCancel: this.onEncryptDialogClose + } + } + + @computed get encryptFormItemRender(){ + return { + desensitization: (field, textAreaProps, form, formParams) => { + return ( + + ) + }, + secondauth: (field, textAreaProps, form, formParams) => { + return ( + + ) + }, + viewscope: (field, textAreaProps, form, formParams) => { + if(formParams.desensitization == '1') + return ( +
+
+ +
+ { + formParams.viewscope == '1' && + {getLabel(30747, '设置')} + } +
+ ) + return null; + }, + } + } + + @action onDesensitizationChangeHandle = data => { + const desensitization = data.desensitization.value; + desensitization == '0' && this.formTarget.encryptForm.updateFields({ + secondauth: { + value: '0' + } + }) + } + + @action onEncryptDialogClose = () => this.encryptDialogVisible = false; + + encryptParams = {}; + @action onEncryptHandle = async record => { + const {fieldname, tablename, fieldlabel, encryptId} = record; + this.encryptParams = {fieldname, tablename, encryptId}; + const label = getCurrentLabel(fieldlabel); + const data = await api.getEncryptFieldSettingForm({...this.encryptParams, ...this.opParams}); + if(data.status == '1'){ + this.setFormData('encryptForm', data.conditions); + if(this.formTarget.encryptForm.isFormInit){ + this.encryptDialogTitle = `${getLabel('526997','加密设置')}(${getLabel('261','字段')}:${label})`; + this.encryptDialogVisible = true; + } + }else{ + message.error(data.message); + } + } + + @observable needInitData = '1'; + get encrypt(){ + const {isencrypt} = this.formTarget.encryptForm.getFormParams(); + const fields = this.formTarget.encryptFormFields; + const col = find(fields[0].items, {domkey: ['isencrypt']}); + const {otherParams} = col || {}; + const {disabled} = otherParams || {}; + return isencrypt == '1' && !disabled; + } + @action saveEncryptFieldSettingForm = async () => { + const f = await this.formTarget.encryptForm.validateForm(); + if (f.isValid) { + if(this.encrypt){ + this.confirmInfo({ + width: 500, + content: ( +
+
1.{getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!')}

+
+ 2.{getLabel('531157','历史数据量可能较大, 此操作可能需要较长时间,对系统性能也可能会造成一定影响,请确认是否处理历史数据:')} + + { + this.needInitData = v; + }} + /> + +
+
+ ), + onOk: this.doSaveEncryptFieldSettingForm + }) + }else{ + this.needInitData = '0'; + this.doSaveEncryptFieldSettingForm(); + } + } else { + f.showErrors(); + this.showError = new Date().getTime(); + } + } + + @action doSaveEncryptFieldSettingForm = async () => { + if(this.spinning) + return; + this.spinning = true; + const params = {...this.formTarget.encryptForm.getFormParams(), ...this.encryptParams, needInitData: this.needInitData, ...this.opParams} + if (this.selectedTreeNodeInfo != null) { + Object.assign(params, { + scopeid: this.selectedTreeNodeInfo.key + }) + } + try{ + const data = await api.saveEncryptFieldSettingForm(params); + if(data.status == '1'){ + this.encryptDialogVisible = false; + message.success(i18n.message.saveSuccess()); + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + else + this.initData(); + }else{ + message.error(data.message); + } + this.spinning = false; + }catch(e){ + this.spinning = false; + } + } + + //#region 查看范围设置 + target = {}; + @observable dialogVisible = false; + @observable table = new TableStore(); + @observable canAdd = false; + @observable canDel = false; + + @computed get tableMultiDelete() { + return this.table.selectedRowKeys.length === 0 || !this.canDel; } - setTabKey(tabKey) { - this.tabKey = tabKey; + @computed get rangeViewTabProps(){ + return { + datas: [], + buttons: [ + , + , + ] + } } - setTopMenu(topMenu) { - this.topMenu = topMenu; + @action onDialogCancleHandle = () => this.dialogVisible = false; + + get dialogButtons(){ + const buttonDef = [ + { + content: getLabel(30986, '保存'), + icon: 'icon-coms-Preservation', + onClickHandle: this.saveViewRange + } + ] + const buttons = [], moreBtnData = []; + buttonDef.map((btn, index) => { + const {content, icon, onClickHandle} = btn; + buttons.push( + () + ); + + moreBtnData.push({ + key: index.toString(), + content, + icon: , + onClick: onClickHandle + }); + }) + + const {scopeId} = this.opParams; + let arr = []; + if(scopeId == '-1'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEBASE', this.encryptParams.encryptId); + }else if(scopeId == '1'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEPERSONAL', this.encryptParams.encryptId); + }else if(scopeId == '3'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEWORK', this.encryptParams.encryptId); + }else if(scopeId == 'subcompany'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SUBCOMPANY', this.encryptParams.encryptId); + }else if(scopeId == 'department'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_DEPARTEMENT', this.encryptParams.encryptId); + }else if(scopeId == 'salary'){ + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SALARY'); + }else{} + moreBtnData.push(...arr); + return {buttons, moreBtn: {datas: moreBtnData}}; } - - setRightMenu(rightMenu) { - this.rightMenu = rightMenu; + @computed get dialogProps(){ + return { + title: getLabel('125012','查看范围设置'), + style: { + width: 800, + height: 600 + }, + ...ecCom.WeaTools.getIconBGC('currency'), + ...this.dialogButtons, + visible: this.dialogVisible, + onCancel: this.onDialogCancleHandle, + } } + @computed get rangeViewTableProps(){ + return { + comsWeaTableStore: this.table, + hasOrder: true, + needScroll: true, + scroll: { + y: 550 + }, + onOperatesClick: this.onOperatesClickHandle + } + } + + @action showSettingDialog = async () => { + if(this.encryptParams.encryptId == null || this.encryptParams.encryptId == ''){ + this.confirmInfo({ + content: getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!'), + onOk: async () => { + const rs = await api.saveEncryptFieldSettingForm({...this.formTarget.encryptForm.getFormParams(), ...this.encryptParams, ...this.opParams}); + if(rs.status == '1'){ + this.encryptParams.encryptId = rs.encryptId; + if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + else + this.initData(); + this.dialogVisible = this.getEncryptFieldScopeList(); + }else{ + message.error(data.message); + } + } + }); + }else + this.dialogVisible = this.getEncryptFieldScopeList(); + } + + @action getEncryptFieldScopeList = async () => { + const d = await api.getEncryptFieldScopeList({id: this.encryptParams.encryptId}); + if(d.status == '1'){ + const {canAdd, canDel, sessionkey} = d; + this.canAdd = canAdd; + this.canDel = canDel; + this.table = new TableStore(); + this.table.getDatas(sessionkey); + return true; + }else{ + message.error(d.message); + return false; + } + } + + @action onOperatesClickHandle = (record, index, operate) => { + const func = operate.href ? operate.href.split(':')[1].split('(')[0] : ''; + const id = record.id || ''; + this[func] && this[func](id, record); + } + + @action doMultiDel = () => this.doDel(); + + @action doDel = ids => { + const params = { + fieldid: this.encryptParams.encryptId, + ids: ids || this.table.selectedRowKeys + }; + let content = isEmpty(ids) ? getLabel(385625, '确定要删除选择的记录吗?') : getLabel(83877, '确定要删除吗?'); + this.confirmInfo({ + content, + onOk: async () => { + const data = await api.delEncryptFieldScopeSetting({...params, ...this.opParams}); + if (data.status === "1") { + message.success(getLabel(83472, '删除成功!')); + this.table.getDatas(null, 1); + }else{ + message.error(data.message); + } + } + }); + } + + @action saveViewRange = async () => { + this.onDialogCancleHandle(); + } + //#endregion + + //#region 范围form + @observable conditions = []; + + @observable viewRangeAuthVisible = false; + + @computed get viewRangeAuthProps(){ + return { + title: getLabel('383694','添加人员'), + conditions: this.toJS(this.conditions), + ...ecCom.WeaTools.getIconBGC('currency'), + visible: this.viewRangeAuthVisible, + onOk: this.onOKHandle, + onCancel: this.onViewRangeAuthCancleHandle, + } + } + + @action getViewRangeForm = async () => { + const data = await api.getEncryptFieldScopeForm(); + if(data.status == "1"){ + this.conditions = data.conditions; + this.viewRangeAuthVisible = true; + } + } + + @action onOKHandle = async data => { + const d = await api.saveEncryptFieldScopeSetting({id: this.encryptParams.encryptId, ...data, ...this.opParams}); + if(d.status == '1'){ + message.success(getLabel(83551, '保存成功!')); + this.getEncryptFieldScopeList(); + }else{ + message.error(d.message); + } + this.viewRangeAuthVisible = false; + } + + @action onViewRangeAuthCancleHandle = () => { + this.viewRangeAuthVisible = !this.viewRangeAuthVisible; + } + + get opParams(){ + const obj = { + fieldname: this.encryptParams.fieldname + } + const name = (this.moduleName || '').toLocaleLowerCase(); + if(name.indexOf('subcompany') > -1){ + Object.assign(obj, { + scopeId: 'subcompany' + }); + }else if(name.indexOf('department') > -1){ + Object.assign(obj, { + scopeId: 'department' + }); + } + this.selectedTreeNodeInfo != null && Object.assign(obj, { + scopeId: this.selectedTreeNodeInfo.key + }); + + return obj; + } + //#endregion + /********************* action list *********************/ + } \ No newline at end of file diff --git a/pc4mobx/organization/style/index.less b/pc4mobx/organization/style/index.less index 683be40..5dd610b 100644 --- a/pc4mobx/organization/style/index.less +++ b/pc4mobx/organization/style/index.less @@ -52,6 +52,18 @@ html { } } +.tabBtn-active { + color: #34a2ff; +} + +.tabBtn { + cursor: pointer; + font-size: 20px; + position: relative; + top: 6px; + right: 15px; +} + //组织架构图 #node { diff --git a/pc4mobx/organization/util/index.js b/pc4mobx/organization/util/index.js index 341d13c..ebe5892 100644 --- a/pc4mobx/organization/util/index.js +++ b/pc4mobx/organization/util/index.js @@ -72,4 +72,21 @@ export const renderNoData = () => ( export const isEmpty = (obj) =>{ for(var n in obj){return false} return true; +} + + +export const calFormHeight = (groupLength, children) => { + let childrenLength = 0; + children.map(c => { + if (c.colSpan != null) { + childrenLength += c.colSpan == 2 ? 1 : 2; + } else + childrenLength += 1; + }) + let height = (childrenLength / 2 + childrenLength % 2) * 52 + 10; + if (groupLength > 1) + height += groupLength * 45; + if (height > 300) + return 300; + return height; } \ No newline at end of file From 1a35ec1bd5cf8e2d046c2060c63b8eb5796012b9 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 13 Jun 2022 15:38:26 +0800 Subject: [PATCH 017/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/fieldDefinedSet/FieldDef.js | 71 +- .../fieldDefinedSet/FieldDefined.js | 123 +-- pc4mobx/organization/public/i18n.js | 3 +- pc4mobx/organization/stores/baseStore.js | 18 +- pc4mobx/organization/stores/fieldDefined.js | 924 ++++++++++-------- pc4mobx/organization/util/index.js | 42 + 6 files changed, 687 insertions(+), 494 deletions(-) diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js index b5f613f..1bf4129 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js @@ -70,11 +70,14 @@ export default class FieldDef extends Component { const { groupInfoFrom, groupInfoFromFields, + typeInfoFrom, + typeInfoFromFields, childInfoForm, childInfoFormFields } = formTarget; const { editGroupInfo, + editTypeInfo, groupInfoSetting, createChildInfo, childInfoSetting @@ -101,10 +104,10 @@ export default class FieldDef extends Component { } } - const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)] + const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)] return ( -
{this.tabDom = dom}}> +
{ this.tabDom = dom }}> setEditTable(editTable, 'fieldDef')} @@ -114,62 +117,76 @@ export default class FieldDef extends Component { + {/* 新增分组 */} setDialogVisible('editGroupInfo', false)} buttons={getDialogOpButtons()} - moreBtn={{datas:editorDialogRightMenu}} - > - - + moreBtn={{ datas: editorDialogRightMenu }} + > + + + {/* 新增类型 */} + setDialogVisible('editTypeInfo', false)} + buttons={getDialogOpButtons()} + moreBtn={{ datas: editorDialogRightMenu }} + > + + setDialogVisible('groupInfoSetting', false, '')} buttons={getDialogOpButtons()} - moreBtn={{datas:editorDialogRightMenu}} + moreBtn={{ datas: editorDialogRightMenu }} > setEditTable(editTable, 'groupSetting')} - tableProps={{scroll: {y: 360}}} - {...tableEditConfig['groupSetting']}/> + tableProps={{ scroll: { y: 360 } }} + {...tableEditConfig['groupSetting']} /> - setDialogVisible('createChildInfo', false)} - buttons={getDialogOpButtons()} - moreBtn={{datas:editorDialogRightMenu}} - > - - + setDialogVisible('createChildInfo', false)} + buttons={getDialogOpButtons()} + moreBtn={{ datas: editorDialogRightMenu }} + > + + setDialogVisible('childInfoSetting', false, '')} buttons={getDialogOpButtons()} - moreBtn={{datas:editorDialogRightMenu}} + moreBtn={{ datas: editorDialogRightMenu }} > setEditTable(editTable, 'childInfoSetting')} - tableProps={{scroll: {y: 360}}} - {...tableEditConfig['childInfoSetting']}/> + tableProps={{ scroll: { y: 360 } }} + {...tableEditConfig['childInfoSetting']} />
diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index 7b71756..d835966 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -13,7 +13,7 @@ import { WeaLeftRightLayout, WeaDropdown } from 'ecCom'; -import {Spin} from 'antd'; +import { Spin } from 'antd'; import Tabs from './Tabs'; import FieldDef from './FieldDef'; import { @@ -25,7 +25,7 @@ const { ButtonSelect } = WeaDropdown; @inject('fieldDefined') @observer export default class FieldDefined extends Component { - constructor(props) { + constructor(props) { super(props); this.state = { logSmallType: '' @@ -54,21 +54,21 @@ export default class FieldDefined extends Component { type: moduleType } = params let moduleName, logSmallType; - if(moduleType === 'subCompany'){ + if (moduleType === 'subCompany') { moduleName = 'subcompanyfielddefined'; logSmallType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED'; - }else if(moduleType === 'department'){ + } else if (moduleType === 'department') { moduleName = 'departmentfielddefined'; logSmallType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED'; - }else{ + } else { moduleName = 'resourcefielddefined'; logSmallType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; } - let callbackFunc = () => initData(false, true, moduleName); - if (moduleType === 'resource') - callbackFunc = () => initResourceData(moduleName); + // let callbackFunc = () => initData(false, true, moduleName); + // if (moduleType === 'resource') + let callbackFunc = () => initResourceData(moduleName); checkAuthorized(moduleName, null, callbackFunc); - this.setState({logSmallType}) + this.setState({ logSmallType }) } tabChangeHandle = (key) => { @@ -116,87 +116,70 @@ export default class FieldDefined extends Component { conditionForm: form, conditionFormFields: fields, tabBtnDef: [ - ...tabBtnDef, + ...tabBtnDef, ] }, title = moduleType === 'subCompany' ? i18n.module.subCompanyFieldDef() : moduleType === 'department' ? i18n.module.departmentFieldDef() : i18n.module.resourceFieldDef(), - topProps = { - title, - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - buttons: btns, - dropMenuDatas: menus - }; + topProps = { + title, + icon: , + iconBgcolor: '#217346', + showDropIcon: true, + buttons: btns, + dropMenuDatas: menus + }; let logType; - if(selectedTreeNodeInfo){ - if(selectedTreeNodeInfo.viewAttr == 1){ + if (selectedTreeNodeInfo) { + if (selectedTreeNodeInfo.viewAttr == 1) { logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; - }else{ + } else { logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_DETAIL'; } } let children = []; if (containerInitFinished.init && containerInitFinished.authorized) { - switch (moduleType) { - case 'resource': - const { - data, - onSelectedTreeNode, - selectedKeys, - onExpand, - treeExpandKeys - } = store.toJS(treeConfig); - const treeCom = ( - - ) - children = [ - ( - - - - { - - - - } - - - - ) - ] - break; - default: - children = [ - ( - - - - + const { + data, + onSelectedTreeNode, + selectedKeys, + onExpand, + treeExpandKeys + } = store.toJS(treeConfig); + const treeCom = ( + + ) + children = [ + ( + + + + { + + - - - ) - ] - break; - } + } + + + + ) + ] } else if (containerInitFinished.init && !containerInitFinished.authorized) { children = [ ( -
{i18n.message.authFailed()}
-
+
{i18n.message.authFailed()}
+ ) ]; } diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index dc077a5..567877f 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -147,7 +147,7 @@ export const i18n = { newDept: () => getLabel(386246, '新建部门'), mergeDept:()=> getLabel(386246, '合并部门'), transferDept:()=> getLabel(386246, '转移部门'), - + typeName: () => getLabel(129927, '类型名称'), authorizationGroup: () => getLabel(492, '权限组'), @@ -842,6 +842,7 @@ export const i18n = { }, button: { back: () => getLabel(1290, '返回'), + createType: () => getLabel(30131, '新建类型'), batchOpen: () => getLabel(534249, '批量解锁'), collect: () => getLabel(28111, '收藏'), diff --git a/pc4mobx/organization/stores/baseStore.js b/pc4mobx/organization/stores/baseStore.js index ad4852c..0a23a00 100644 --- a/pc4mobx/organization/stores/baseStore.js +++ b/pc4mobx/organization/stores/baseStore.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:14:20 - * @LastEditTime: 2022-06-09 10:41:31 + * @LastEditTime: 2022-06-13 14:50:36 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/baseStore.js */ @@ -93,14 +93,14 @@ export default class HrmBaseStore { } getBasicMenus = (logTypeKey, targetId = null) => { let arr = []; - if(logTypeKey){ - arr.push({ - key: '99', - content: i18n.button.log(), - icon: , - onClick: () => this.showLog({logSmallType: this.logTypeDef[logTypeKey], targetId}) - }); - } + // if(logTypeKey){ + // arr.push({ + // key: '99', + // content: i18n.button.log(), + // icon: , + // onClick: () => this.showLog({logSmallType: this.logTypeDef[logTypeKey], targetId}) + // }); + // } return arr; } diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 713d838..8ada3bd 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-10 16:32:02 + * @LastEditTime: 2022-06-13 15:06:29 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -15,7 +15,7 @@ import { WeaTableNew, WeaSwitch } from 'comsMobx'; -import {WeaLocaleProvider, WeaInputLocale, WeaButtonIcon, WeaSelect} from 'ecCom'; +import { WeaLocaleProvider, WeaInputLocale, WeaButtonIcon, WeaSelect } from 'ecCom'; import { Button, message, @@ -34,16 +34,19 @@ import { } from 'lodash'; import find from 'lodash/find'; import isEmpty from 'lodash/isEmpty'; +import { + validDBKeys +} from '../util/index'; import { i18n } from '../public/i18n'; const getLabel = WeaLocaleProvider.getLabel; const getCurrentLabel = WeaInputLocale.getCurrentLabel; -const {TableStore} = WeaTableNew; +const { TableStore } = WeaTableNew; export class FieldDefinedStore extends HrmBaseStore { - /********************* unobservable list *********************/ + /********************* unobservable list *********************/ //override baseStore.tabConfig tabDef = { color: '#000000', @@ -61,6 +64,12 @@ export class FieldDefinedStore extends HrmBaseStore { onClickHandle: () => this.editGroup(), label: i18n.button.createGroup, icon: this.menuIconCollection.create + }, { + comType: 'button', + type: 'primary', + onClickHandle: () => this.editType(), + label: i18n.button.createType, + icon: this.menuIconCollection.create }, { comType: 'button', type: 'primary', @@ -88,9 +97,9 @@ export class FieldDefinedStore extends HrmBaseStore { { filter(this.tabConfig.tabs, (d) => { - try{ + try { return d.groupid != this.activeTabInfo.tabInfo.groupid - }catch(e){ + } catch (e) { return true; } }).map((tab, index) => ( @@ -100,7 +109,7 @@ export class FieldDefinedStore extends HrmBaseStore { )) } - +
{i18n.label.createAndMoveGroup()}
@@ -114,20 +123,20 @@ export class FieldDefinedStore extends HrmBaseStore { selected: this.dropdownSelectedKey === '1' }, { - key: '2', - text: i18n.button.copy(), + key: '2', + text: i18n.button.copy(), show: , selected: this.dropdownSelectedKey === '2' }, { - key: '3', - text: i18n.button.moveToGroup(), + key: '3', + text: i18n.button.moveToGroup(), show: , selected: this.dropdownSelectedKey === '3', isDropBtn: true } ] - if(this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1){ + if (this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1) { datas.splice(2, 1); } return datas; @@ -144,7 +153,7 @@ export class FieldDefinedStore extends HrmBaseStore { } }, btnOnClick: key => { - switch(key){ + switch (key) { case '1': this.recordOP(this.editTable['fieldDef'], 'remove') break; @@ -288,7 +297,7 @@ export class FieldDefinedStore extends HrmBaseStore { if (this.isJobTreeNode) {//【工作信息】列表不添加【允许个人修改】列 } else { columns.push({ - title: getLabel(510359,'允许个人修改'), + title: getLabel(510359, '允许个人修改'), dataIndex: 'isModify', key: 'isModify', checkType: 'checkbox', @@ -298,7 +307,7 @@ export class FieldDefinedStore extends HrmBaseStore { } } this.encryptEnable && columns.push({ - title: getLabel('526997','加密设置'), + title: getLabel('526997', '加密设置'), dataIndex: 'canEncrypt', key: 'canEncrypt', com: [ @@ -306,10 +315,10 @@ export class FieldDefinedStore extends HrmBaseStore { type: 'custom', key: 'custom', render: (text, record, index, onEdit) => { - const {canEncrypt} = record; - if(canEncrypt == '1') + const { canEncrypt } = record; + if (canEncrypt == '1') return ( - this.onEncryptHandle(record)}>{getLabel('526997','加密设置')} + this.onEncryptHandle(record)}>{getLabel('526997', '加密设置')} ) return null; } @@ -447,13 +456,13 @@ export class FieldDefinedStore extends HrmBaseStore { this.editorDialogRightMenu.push({ key: '1', content: i18n.button.save(), - icon: , + icon: , onClick: () => this.dialogSaveOp(false) }); - if(this.dialogParams.groupInfoSetting.visible){ + if (this.dialogParams.groupInfoSetting.visible) { let logType = ''; - switch(this.moduleName){ + switch (this.moduleName) { case 'subcompanyfielddefined': logType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED_GROUP'; break; @@ -490,6 +499,77 @@ export class FieldDefinedStore extends HrmBaseStore { "defaultshow": true }] + editTypeInfoFormFields = [{ + "title": i18n.label.basicSetting(), + "items": [{ + "colSpan": 2, + "conditionType": "INPUT", + "domkey": ["typeName"], + "fieldcol": 12, + "isQuickSearch": false, + "label": i18n.label.typeName, + "labelcol": 6, + "precision": 0, + "rules": "required|string", + "value": "", + "viewAttr": 3, + }, { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "SELECT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 3, + "domkey": [ + "tableType" + ], + "entSearch": false, + "fieldcol": 16, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "新增到", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "options": [ + { + "disabled": false, + "key": "0", + "selected": false, + "showname": "主表", + "visible": true + }, + { + "disabled": false, + "key": "1", + "selected": false, + "showname": "明细表", + "visible": true + } + ], + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "0", + "valueList": [], + "rules": "required|string", + "viewAttr": 3 + }], + "defaultshow": true + }] + editChildInfoFormFields = [{ "title": i18n.label.basicSetting, "items": [{ @@ -528,6 +608,13 @@ export class FieldDefinedStore extends HrmBaseStore { datas: [] } }, + editTypeInfo: { + visible: false, + title: '', + moreBtn: { + datas: [] + } + }, groupInfoSetting: { visible: false, title: '', @@ -559,7 +646,7 @@ export class FieldDefinedStore extends HrmBaseStore { @observable refreshMainTabComponent = new Date().getTime(); @observable refreshFeildDef = new Date().getTime(); //当需要刷新主页面tab时,变更此值 - @observable refreshForm = new Date().getTime(); + @observable refreshForm = new Date().getTime(); @observable refreshEditGroupTabComponent = new Date().getTime(); //当需要刷新权限组编辑tab时,变更此值 @observable spinning = false; @observable moduleName = ''; @@ -628,7 +715,7 @@ export class FieldDefinedStore extends HrmBaseStore { setTableEditColTitle = () => { [...Object.keys(this.tableEditConfig)].map(k => { this.tableEditConfig[k].columns.map(c => { - if (typeof(c.title) == 'function') + if (typeof (c.title) == 'function') c.title = c.title(); else c.title = c.title; @@ -688,7 +775,7 @@ export class FieldDefinedStore extends HrmBaseStore { message.error(data.message); this.spinning = false; this.refreshMainTabComponent = new Date().getTime(); - }, error => {this.spinning = false;}) + }, error => { this.spinning = false; }) } @action onTabEdit = (targetKey, action) => { @@ -709,10 +796,11 @@ export class FieldDefinedStore extends HrmBaseStore { if (data.status === '1') { message.success(i18n.message.deleteSuccess()); this.tabConfig.activeTabKey = '1'; - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(); - else - this.initData(); + // if (this.moduleName.indexOf('resource') >= 0) + // this.getTabInfoByTreeNode(); + // else + // this.initData(); + this.getTabInfoByTreeNode(); } else { message.error(data.message); } @@ -727,6 +815,7 @@ export class FieldDefinedStore extends HrmBaseStore { @action dialogSaveOp = () => { this.dialogParams.editGroupInfo.visible && this.doSaveGroupInfo(); + this.dialogParams.editTypeInfo.visible && this.doSaveTypeInfo(); this.dialogParams.groupInfoSetting.visible && this.doSaveGroupSetting(); this.dialogParams.createChildInfo.visible && this.doSaveChildInfo(); this.dialogParams.childInfoSetting.visible && this.doSaveChildInfoSetting(); @@ -735,12 +824,12 @@ export class FieldDefinedStore extends HrmBaseStore { @action editGroup = (group, moveToGroup = false) => { this.moveToGroup = moveToGroup; this.editGroupInfoFormFields.map(f => { - if (typeof(f.title) == 'function') + if (typeof (f.title) == 'function') f.title = f.title(); f.items.map(item => { - if (typeof(item.label) == 'function') + if (typeof (item.label) == 'function') item.label = item.label(); - item.otherParams = {...window.inputType}; + item.otherParams = { ...window.inputType }; }) }) let fields = [...this.editGroupInfoFormFields], @@ -748,13 +837,13 @@ export class FieldDefinedStore extends HrmBaseStore { this.setFormData('groupInfoFrom', fields); if (group) { this.formTarget.groupInfoFrom.updateFields({ - groupName: {value: group.multiTitle || group.title || ''} + groupName: { value: group.multiTitle || group.title || '' } }); this.opId = group.groupid; dialogTitle = i18n.button.editGroup(); } else { this.formTarget.groupInfoFrom.updateFields({ - groupName: {value: ''} + groupName: { value: '' } }); this.opId = null; dialogTitle = i18n.button.createGroup(); @@ -762,6 +851,27 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('editGroupInfo', true, dialogTitle); } + @action editType = () => { + this.editTypeInfoFormFields.map(f => { + if (typeof (f.title) == 'function') + f.title = f.title(); + f.items.map(item => { + if (typeof (item.label) == 'function') + item.label = item.label(); + item.otherParams = { ...window.inputType }; + }) + }) + let fields = [...this.editTypeInfoFormFields], + dialogTitle = ''; + this.setFormData('typeInfoFrom', fields); + // this.formTarget.typeInfoFrom.updateFields({ + // typeName: { value: '' } + // }); + // this.opId = null; + dialogTitle = i18n.button.createType(); + this.setDialogVisible('editTypeInfo', true, dialogTitle); + } + @action doGroupSetting = () => { this.tableEditConfig.groupSetting.datas.length = 0; let arr = []; @@ -787,7 +897,8 @@ export class FieldDefinedStore extends HrmBaseStore { } }) }) - Object.assign(this.tableEditConfig.groupSetting, { ...this.convertData(arr, 'groupSetting') + Object.assign(this.tableEditConfig.groupSetting, { + ...this.convertData(arr, 'groupSetting') }); this.tableEditConfig.groupSetting.columns = this.groupDefColumns(); this.tableEditConfig.groupSetting.datas.map(d => { @@ -808,6 +919,44 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('groupInfoSetting', true, i18n.button.groupMaintain()); } + + @action doSaveTypeInfo = () => { + this.formTarget.typeInfoFrom.validateForm().then(f => { + if (f.isValid) { + let record = { + ...this.formTarget.typeInfoFrom.getFormParams(), + } + let params = { + data: JSON.stringify({ + record: record + }) + } + // api.saveTypeInfo(this.moduleName, params).then(data => { + // if (data.status === '1') { + // this.setDialogVisible('editGroupInfo', false, ''); + // if (this.moveToGroup) { + // const ids = data.groupid.split(','); + // this.changeGroup(null, ids[ids.length - 1]); + // } else { + // //if (this.moduleName.indexOf('resource') >= 0) + // this.getTabInfoByTreeNode(); + // // else + // // this.initData(this.opId == null); + // message.success(i18n.message.saveSuccess()); + // } + // } else + // message.error(data.message); + // }, error => { + // message.error(i18n.message.actionError()); + // }); + this.getTree() + } else { + f.showErrors(); + this.showError = new Date().getTime(); + } + }); + } + doSaveGroupInfo = () => { this.formTarget.groupInfoFrom.validateForm().then(f => { if (f.isValid) { @@ -853,14 +1002,14 @@ export class FieldDefinedStore extends HrmBaseStore { api.saveGroupInfo(this.moduleName, params).then(data => { if (data.status === '1') { this.setDialogVisible('editGroupInfo', false, ''); - if(this.moveToGroup){ + if (this.moveToGroup) { const ids = data.groupid.split(','); this.changeGroup(null, ids[ids.length - 1]); - }else{ - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(); - else - this.initData(this.opId == null); + } else { + //if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + // else + // this.initData(this.opId == null); message.success(i18n.message.saveSuccess()); } } else @@ -876,7 +1025,7 @@ export class FieldDefinedStore extends HrmBaseStore { } @action saveFieldDefine = () => { - if(this.spinning) + if (this.spinning) return; this.spinning = true; this.recordOP(this.editTable['fieldDef'], 'valid'); @@ -937,24 +1086,24 @@ export class FieldDefinedStore extends HrmBaseStore { if (this.selectedTreeNodeInfo != null) params.groupType = this.selectedTreeNodeInfo.key; - const checkRs = this.editTable['fieldDef'] && this.editTable['fieldDef'].refs.edit.doRequiredCheck() || {pass: true}; - if(!checkRs.pass){ + const checkRs = this.editTable['fieldDef'] && this.editTable['fieldDef'].refs.edit.doRequiredCheck() || { pass: true }; + if (!checkRs.pass) { this.spinning = false; return; } - + api.saveFieldDefinedInfo(this.moduleName, params).then(data => { if (data.status === '1') { message.success(i18n.message.saveSuccess()); - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(); - else - this.initData(); + // if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + // else + // this.initData(); } else { message.error(data.message); } this.spinning = false; - }, error => {this.spinning = false;}) + }, error => { this.spinning = false; }) } else { message.error(i18n.confirm.displayOrDBFieldExist()); this.spinning = false; @@ -962,16 +1111,16 @@ export class FieldDefinedStore extends HrmBaseStore { } @action onEdit = (keys, datas, c, dataIndex) => { - if(dataIndex === 'fieldlabel' && this.moduleName != 'resourcefielddefined'){ + if (dataIndex === 'fieldlabel' && this.moduleName != 'resourcefielddefined') { const oldRecord = this.tableEditConfig.fieldDef.datas[keys[0]]; - if(has(oldRecord, 'com') && has(oldRecord.com, 'fieldname') && oldRecord.com.fieldname.length > 0 && oldRecord.com.fieldname[0].type === 'TEXT'){ + if (has(oldRecord, 'com') && has(oldRecord.com, 'fieldname') && oldRecord.com.fieldname.length > 0 && oldRecord.com.fieldname[0].type === 'TEXT') { return; } - this.getPinYin({labelName: getCurrentLabel(datas[0].fieldlabel)}).then(data => { - const {pinyin} = data; + this.getPinYin({ labelName: getCurrentLabel(datas[0].fieldlabel) }).then(data => { + const { pinyin } = data; oldRecord.fieldname = pinyin; - const arr = filter(this.tableEditConfig.fieldDef.datas, {fieldname: pinyin}); - if(arr.length > 1 && pinyin != ''){ + const arr = filter(this.tableEditConfig.fieldDef.datas, { fieldname: pinyin }); + if (arr.length > 1 && pinyin != '') { oldRecord.fieldname = pinyin + '1'; } this.refreshFeildDef = new Date().getTime(); @@ -979,11 +1128,11 @@ export class FieldDefinedStore extends HrmBaseStore { } } @action onAdd = (keys, datas) => { - try{ + try { this.tableEditConfig.fieldDef.datas[keys[0] - 1].enable = '1'; (this.tableEditConfig.fieldDef.selectedData.enable || []).push(keys[0] - 1); this.refreshFeildDef = new Date().getTime(); - }catch(e){ + } catch (e) { } } @@ -994,8 +1143,8 @@ export class FieldDefinedStore extends HrmBaseStore { required: [] } if (this.moduleName === 'resourcefielddefined') { - Object.assign(selectedData,{ - isModify:[] + Object.assign(selectedData, { + isModify: [] }); } datas.map((data, index) => { @@ -1024,15 +1173,15 @@ export class FieldDefinedStore extends HrmBaseStore { if (selectedDatas != null && selectedDatas.hasOwnProperty(dataIndex)) { const arr = selectedDatas[dataIndex]; this.tableEditConfig.fieldDef.datas.map((data, index) => { - if(dataIndex === 'enable'){ + if (dataIndex === 'enable') { data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; - if(data[dataIndex] === '0'){ + if (data[dataIndex] === '0') { data['required'] = '0'; remove(selectedDatas['required'], v => v === index); data['isModify'] = '0'; remove(selectedDatas['isModify'], v => v === index); } - }else if(dataIndex === 'required'){ + } else if (dataIndex === 'required') { data[dataIndex] = indexOf(arr, index) >= 0 ? '1' : '0'; if (data[dataIndex] === '1') { data['enable'] = '1'; @@ -1060,7 +1209,7 @@ export class FieldDefinedStore extends HrmBaseStore { //处理账号类型和主账号的联动(允许个人修改):账号类型选中,主账号也会选中,反之亦然。 processLinkage = (selectedDatas) => { - const {datas} = this.tableEditConfig.fieldDef; + const { datas } = this.tableEditConfig.fieldDef; const target = datas.find(data => data.fieldname === 'accounttype'); @@ -1068,7 +1217,7 @@ export class FieldDefinedStore extends HrmBaseStore { const accounttype = target.isModify; - const belongto = datas.find(data => data.fieldname === 'belongto').isModify; + const belongto = datas.find(data => data.fieldname === 'belongto').isModify; if (belongto !== accounttype) { datas.find(data => data.fieldname === 'belongto').isModify = accounttype; @@ -1077,7 +1226,7 @@ export class FieldDefinedStore extends HrmBaseStore { if (accounttype === '1') { selectedDatas['isModify'].push(belongtoIndex); - }else{ + } else { remove(selectedDatas['isModify'], v => v === belongtoIndex); } } @@ -1090,7 +1239,7 @@ export class FieldDefinedStore extends HrmBaseStore { } sel.getCheckboxProps = (record) => { let disabled = false; - switch(this.dropdownSelectedKey){ + switch (this.dropdownSelectedKey) { case '2': disabled = false;//复制时,checkbox全部启用 break; @@ -1120,7 +1269,7 @@ export class FieldDefinedStore extends HrmBaseStore { if (this.selectedTreeNodeInfo != null) params.groupType = this.selectedTreeNodeInfo.key; params.groupId = this.activeTabInfo.tabInfo.groupid; - if(ids.length > 0){ + if (ids.length > 0) { api.removeFieldDefinedInfo(this.moduleName, params).then(data => { if (data.status === '1') { // this.initData(); @@ -1129,9 +1278,9 @@ export class FieldDefinedStore extends HrmBaseStore { } else message.error(data.message); }, error => { - + }) - }else{ + } else { this.tableEditConfig.fieldDef.selectedRowKeys.length = 0; } @@ -1196,11 +1345,10 @@ export class FieldDefinedStore extends HrmBaseStore { api.saveGroupInfo(this.moduleName, params).then(data => { if (data.status === '1') { this.setDialogVisible('groupInfoSetting', false, ''); - - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(false, true); - else - this.initData(false, true); + // if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(false, true); + // else + // this.initData(false, true); message.success(i18n.message.saveSuccess()); } else message.error(data.message); @@ -1227,15 +1375,15 @@ export class FieldDefinedStore extends HrmBaseStore { ids.length > 0 && api.removeGroupInfo(this.moduleName, params).then(data => { if (data.status === '1') { message.success(i18n.message.deleteSuccess()); - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(false, true); - else - this.initData(false, true); + // if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(false, true); + // else + // this.initData(false, true); } else { message.error(data.message); } }) - } else {} + } else { } } //人员卡片字段定义部分 @@ -1320,7 +1468,7 @@ export class FieldDefinedStore extends HrmBaseStore { } else { message.error(data.message); } - }, error => {}) + }, error => { }) } getTree = (callback) => { @@ -1342,7 +1490,7 @@ export class FieldDefinedStore extends HrmBaseStore { message.error(data.message); } this.refreshTree = new Date().getTime(); - }, error => {}) + }, error => { }) } setBtn = (t) => { @@ -1437,13 +1585,13 @@ export class FieldDefinedStore extends HrmBaseStore { @action createChildInfo = (create = true, data = {}) => { this.isCreateChildInfo = create; this.editChildInfoFormFields.map(f => { - if (typeof(f.title) == 'function') + if (typeof (f.title) == 'function') f.title = f.title(); f.items.map(item => { - if (typeof(item.label) == 'function') + if (typeof (item.label) == 'function') item.label = item.label(); if (item.conditionType === 'INPUT') - item.otherParams = {...window.inputType}; + item.otherParams = { ...window.inputType }; }) }) let fields = [...this.editChildInfoFormFields], @@ -1517,7 +1665,7 @@ export class FieldDefinedStore extends HrmBaseStore { }); parentId = p.domid; } - }else{ + } else { Object.assign(c, { name: c.multiName }); @@ -1594,7 +1742,8 @@ export class FieldDefinedStore extends HrmBaseStore { }) } - Object.assign(this.tableEditConfig.childInfoSetting, { ...this.convertData(arr, 'childInfoSetting') + Object.assign(this.tableEditConfig.childInfoSetting, { + ...this.convertData(arr, 'childInfoSetting') }); this.tableEditConfig.childInfoSetting.columns = this.childInfoDefColumns(); this.tableEditConfig.childInfoSetting.datas.map(d => { @@ -1714,7 +1863,8 @@ export class FieldDefinedStore extends HrmBaseStore { }); cloneTree[i].childs = []; infoArr.map(info => { - cloneTree[i].childs.push({ ...info + cloneTree[i].childs.push({ + ...info }) }) } @@ -1742,13 +1892,13 @@ export class FieldDefinedStore extends HrmBaseStore { } //移动到组 @action dropdownClick = (e) => { - switch(e.key){ + switch (e.key) { case 'createAndMove': this.editGroup(null, true); break; default: const groupid = e.key; - const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, {groupid})]; + const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, { groupid })]; let moveFieldConfirm = i18n.confirm.moveFieldConfirm().replace('{params}', tabInfo.title); this.changeGroup(moveFieldConfirm, groupid); } @@ -1759,99 +1909,99 @@ export class FieldDefinedStore extends HrmBaseStore { let ids = []; let names = []; this.tableEditConfig.fieldDef.selectedRowKeys.map(idx => { - try{ + try { ids.push(this.tableEditConfig.fieldDef.datas[idx].id); names.push(this.tableEditConfig.fieldDef.datas[idx].fieldname); - }catch(e){ + } catch (e) { } }); - if(this.moduleName.indexOf('resource') > -1){ + if (this.moduleName.indexOf('resource') > -1) { Object.assign(params, { fieldids: ids.join(','), fieldnames: names.join(','), groupid, scopeid: this.selectedTreeNodeInfo.domid }) - }else{ + } else { Object.assign(params, { - ids: ids.join(','), + ids: ids.join(','), groupid }); } - moveFieldConfirm == null ? - this.doChangeGroup(params) : - this.confirmInfo({ - content:moveFieldConfirm, - onOk: () => { - this.doChangeGroup(params) - } - }); + moveFieldConfirm == null ? + this.doChangeGroup(params) : + this.confirmInfo({ + content: moveFieldConfirm, + onOk: () => { + this.doChangeGroup(params) + } + }); } @action doChangeGroup = (params) => { api.changeGroup(this.moduleName, params).then(data => { if (data.status === '1') { message.success(i18n.message.moveSuccess()); - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(); - else - this.initData(); + // if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + // else + // this.initData(); } else message.error(data.message); - }, error => {message.error(i18n.message.actionError());}); + }, error => { message.error(i18n.message.actionError()); }); } @observable encryptDialogVisible = false; @observable encryptDialogTitle = ""; - get encryptDialogButtons(){ - const buttonDef = [ - { - content: getLabel(30986, '保存'), - icon: 'icon-coms-Preservation', - onClickHandle: this.saveEncryptFieldSettingForm - } - ] - const buttons = [], moreBtnData = []; - buttonDef.map((btn, index) => { - const {content, icon, onClickHandle} = btn; - buttons.push( - () - ); + get encryptDialogButtons() { + const buttonDef = [ + { + content: getLabel(30986, '保存'), + icon: 'icon-coms-Preservation', + onClickHandle: this.saveEncryptFieldSettingForm + } + ] + const buttons = [], moreBtnData = []; + buttonDef.map((btn, index) => { + const { content, icon, onClickHandle } = btn; + buttons.push( + () + ); - moreBtnData.push({ - key: index.toString(), - content, - icon: , - onClick: onClickHandle - }); + moreBtnData.push({ + key: index.toString(), + content, + icon: , + onClick: onClickHandle + }); }) - const {scopeId} = this.opParams; + const { scopeId } = this.opParams; let arr = []; - if(scopeId == '-1'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEBASE', this.encryptParams.encryptId); - }else if(scopeId == '1'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEPERSONAL', this.encryptParams.encryptId); - }else if(scopeId == '3'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEWORK', this.encryptParams.encryptId); - }else if(scopeId == 'subcompany'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_SUBCOMPANY', this.encryptParams.encryptId); - }else if(scopeId == 'department'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_DEPARTEMENT', this.encryptParams.encryptId); - }else if(scopeId == 'salary'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_SALARY'); - }else{} + if (scopeId == '-1') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEBASE', this.encryptParams.encryptId); + } else if (scopeId == '1') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEPERSONAL', this.encryptParams.encryptId); + } else if (scopeId == '3') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEWORK', this.encryptParams.encryptId); + } else if (scopeId == 'subcompany') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SUBCOMPANY', this.encryptParams.encryptId); + } else if (scopeId == 'department') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_DEPARTEMENT', this.encryptParams.encryptId); + } else if (scopeId == 'salary') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SALARY'); + } else { } moreBtnData.push(...arr); - return {buttons, moreBtn: {datas: moreBtnData}}; + return { buttons, moreBtn: { datas: moreBtnData } }; } - - @computed get encryptDialogProps(){ + + @computed get encryptDialogProps() { return { title: this.encryptDialogTitle, - style: { - width: 600, - height: 350 - }, + style: { + width: 600, + height: 350 + }, ...ecCom.WeaTools.getIconBGC('currency'), ...this.encryptDialogButtons, visible: this.encryptDialogVisible, @@ -1859,28 +2009,28 @@ export class FieldDefinedStore extends HrmBaseStore { } } - @computed get encryptFormItemRender(){ + @computed get encryptFormItemRender() { return { desensitization: (field, textAreaProps, form, formParams) => { return ( - + ) }, secondauth: (field, textAreaProps, form, formParams) => { return ( - + ) }, viewscope: (field, textAreaProps, form, formParams) => { - if(formParams.desensitization == '1') + if (formParams.desensitization == '1') return (
-
- +
+
{ formParams.viewscope == '1' && - {getLabel(30747, '设置')} + {getLabel(30747, '设置')} }
) @@ -1902,58 +2052,58 @@ export class FieldDefinedStore extends HrmBaseStore { encryptParams = {}; @action onEncryptHandle = async record => { - const {fieldname, tablename, fieldlabel, encryptId} = record; - this.encryptParams = {fieldname, tablename, encryptId}; + const { fieldname, tablename, fieldlabel, encryptId } = record; + this.encryptParams = { fieldname, tablename, encryptId }; const label = getCurrentLabel(fieldlabel); - const data = await api.getEncryptFieldSettingForm({...this.encryptParams, ...this.opParams}); - if(data.status == '1'){ + const data = await api.getEncryptFieldSettingForm({ ...this.encryptParams, ...this.opParams }); + if (data.status == '1') { this.setFormData('encryptForm', data.conditions); - if(this.formTarget.encryptForm.isFormInit){ - this.encryptDialogTitle = `${getLabel('526997','加密设置')}(${getLabel('261','字段')}:${label})`; + if (this.formTarget.encryptForm.isFormInit) { + this.encryptDialogTitle = `${getLabel('526997', '加密设置')}(${getLabel('261', '字段')}:${label})`; this.encryptDialogVisible = true; } - }else{ + } else { message.error(data.message); } } @observable needInitData = '1'; - get encrypt(){ - const {isencrypt} = this.formTarget.encryptForm.getFormParams(); + get encrypt() { + const { isencrypt } = this.formTarget.encryptForm.getFormParams(); const fields = this.formTarget.encryptFormFields; - const col = find(fields[0].items, {domkey: ['isencrypt']}); - const {otherParams} = col || {}; - const {disabled} = otherParams || {}; + const col = find(fields[0].items, { domkey: ['isencrypt'] }); + const { otherParams } = col || {}; + const { disabled } = otherParams || {}; return isencrypt == '1' && !disabled; } @action saveEncryptFieldSettingForm = async () => { const f = await this.formTarget.encryptForm.validateForm(); if (f.isValid) { - if(this.encrypt){ + if (this.encrypt) { this.confirmInfo({ width: 500, content: (
-
1.{getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!')}

+
1.{getLabel('524355', '提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!')}

- 2.{getLabel('531157','历史数据量可能较大, 此操作可能需要较长时间,对系统性能也可能会造成一定影响,请确认是否处理历史数据:')} + 2.{getLabel('531157', '历史数据量可能较大, 此操作可能需要较长时间,对系统性能也可能会造成一定影响,请确认是否处理历史数据:')} - { + onChange={(v, showname) => { this.needInitData = v; }} /> @@ -1963,7 +2113,7 @@ export class FieldDefinedStore extends HrmBaseStore { ), onOk: this.doSaveEncryptFieldSettingForm }) - }else{ + } else { this.needInitData = '0'; this.doSaveEncryptFieldSettingForm(); } @@ -1974,243 +2124,243 @@ export class FieldDefinedStore extends HrmBaseStore { } @action doSaveEncryptFieldSettingForm = async () => { - if(this.spinning) + if (this.spinning) return; this.spinning = true; - const params = {...this.formTarget.encryptForm.getFormParams(), ...this.encryptParams, needInitData: this.needInitData, ...this.opParams} + const params = { ...this.formTarget.encryptForm.getFormParams(), ...this.encryptParams, needInitData: this.needInitData, ...this.opParams } if (this.selectedTreeNodeInfo != null) { Object.assign(params, { scopeid: this.selectedTreeNodeInfo.key }) } - try{ + try { const data = await api.saveEncryptFieldSettingForm(params); - if(data.status == '1'){ + if (data.status == '1') { this.encryptDialogVisible = false; message.success(i18n.message.saveSuccess()); - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(); - else - this.initData(); - }else{ + // if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + // else + // this.initData(); + } else { message.error(data.message); } this.spinning = false; - }catch(e){ + } catch (e) { this.spinning = false; } } //#region 查看范围设置 - target = {}; - @observable dialogVisible = false; - @observable table = new TableStore(); - @observable canAdd = false; - @observable canDel = false; + target = {}; + @observable dialogVisible = false; + @observable table = new TableStore(); + @observable canAdd = false; + @observable canDel = false; - @computed get tableMultiDelete() { - return this.table.selectedRowKeys.length === 0 || !this.canDel; - } - - @computed get rangeViewTabProps(){ - return { - datas: [], - buttons: [ - , - , - ] - } - } - - @action onDialogCancleHandle = () => this.dialogVisible = false; - - get dialogButtons(){ - const buttonDef = [ - { - content: getLabel(30986, '保存'), - icon: 'icon-coms-Preservation', - onClickHandle: this.saveViewRange - } - ] - const buttons = [], moreBtnData = []; - buttonDef.map((btn, index) => { - const {content, icon, onClickHandle} = btn; - buttons.push( - () - ); - - moreBtnData.push({ - key: index.toString(), - content, - icon: , - onClick: onClickHandle - }); - }) - - const {scopeId} = this.opParams; - let arr = []; - if(scopeId == '-1'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEBASE', this.encryptParams.encryptId); - }else if(scopeId == '1'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEPERSONAL', this.encryptParams.encryptId); - }else if(scopeId == '3'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEWORK', this.encryptParams.encryptId); - }else if(scopeId == 'subcompany'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_SUBCOMPANY', this.encryptParams.encryptId); - }else if(scopeId == 'department'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_DEPARTEMENT', this.encryptParams.encryptId); - }else if(scopeId == 'salary'){ - arr = this.generateLogMenu('38', 'HRM_RSOURCE_SALARY'); - }else{} - moreBtnData.push(...arr); - return {buttons, moreBtn: {datas: moreBtnData}}; - } - - @computed get dialogProps(){ - return { - title: getLabel('125012','查看范围设置'), - style: { - width: 800, - height: 600 - }, - ...ecCom.WeaTools.getIconBGC('currency'), - ...this.dialogButtons, - visible: this.dialogVisible, - onCancel: this.onDialogCancleHandle, - } - } - - @computed get rangeViewTableProps(){ - return { - comsWeaTableStore: this.table, - hasOrder: true, - needScroll: true, - scroll: { - y: 550 - }, - onOperatesClick: this.onOperatesClickHandle - } - } - - @action showSettingDialog = async () => { - if(this.encryptParams.encryptId == null || this.encryptParams.encryptId == ''){ - this.confirmInfo({ - content: getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!'), - onOk: async () => { - const rs = await api.saveEncryptFieldSettingForm({...this.formTarget.encryptForm.getFormParams(), ...this.encryptParams, ...this.opParams}); - if(rs.status == '1'){ - this.encryptParams.encryptId = rs.encryptId; - if (this.moduleName.indexOf('resource') >= 0) - this.getTabInfoByTreeNode(); - else - this.initData(); - this.dialogVisible = this.getEncryptFieldScopeList(); - }else{ - message.error(data.message); - } - } - }); - }else - this.dialogVisible = this.getEncryptFieldScopeList(); - } - - @action getEncryptFieldScopeList = async () => { - const d = await api.getEncryptFieldScopeList({id: this.encryptParams.encryptId}); - if(d.status == '1'){ - const {canAdd, canDel, sessionkey} = d; - this.canAdd = canAdd; - this.canDel = canDel; - this.table = new TableStore(); - this.table.getDatas(sessionkey); - return true; - }else{ - message.error(d.message); - return false; - } - } - - @action onOperatesClickHandle = (record, index, operate) => { - const func = operate.href ? operate.href.split(':')[1].split('(')[0] : ''; - const id = record.id || ''; - this[func] && this[func](id, record); - } - - @action doMultiDel = () => this.doDel(); - - @action doDel = ids => { - const params = { - fieldid: this.encryptParams.encryptId, - ids: ids || this.table.selectedRowKeys - }; - let content = isEmpty(ids) ? getLabel(385625, '确定要删除选择的记录吗?') : getLabel(83877, '确定要删除吗?'); - this.confirmInfo({ - content, - onOk: async () => { - const data = await api.delEncryptFieldScopeSetting({...params, ...this.opParams}); - if (data.status === "1") { - message.success(getLabel(83472, '删除成功!')); - this.table.getDatas(null, 1); - }else{ - message.error(data.message); - } - } - }); - } - - @action saveViewRange = async () => { - this.onDialogCancleHandle(); - } - //#endregion - - //#region 范围form - @observable conditions = []; - - @observable viewRangeAuthVisible = false; - - @computed get viewRangeAuthProps(){ - return { - title: getLabel('383694','添加人员'), - conditions: this.toJS(this.conditions), - ...ecCom.WeaTools.getIconBGC('currency'), - visible: this.viewRangeAuthVisible, - onOk: this.onOKHandle, - onCancel: this.onViewRangeAuthCancleHandle, - } - } - - @action getViewRangeForm = async () => { - const data = await api.getEncryptFieldScopeForm(); - if(data.status == "1"){ - this.conditions = data.conditions; - this.viewRangeAuthVisible = true; - } - } - - @action onOKHandle = async data => { - const d = await api.saveEncryptFieldScopeSetting({id: this.encryptParams.encryptId, ...data, ...this.opParams}); - if(d.status == '1'){ - message.success(getLabel(83551, '保存成功!')); - this.getEncryptFieldScopeList(); - }else{ - message.error(d.message); - } - this.viewRangeAuthVisible = false; - } - - @action onViewRangeAuthCancleHandle = () => { - this.viewRangeAuthVisible = !this.viewRangeAuthVisible; + @computed get tableMultiDelete() { + return this.table.selectedRowKeys.length === 0 || !this.canDel; } - - get opParams(){ + + @computed get rangeViewTabProps() { + return { + datas: [], + buttons: [ + , + , + ] + } + } + + @action onDialogCancleHandle = () => this.dialogVisible = false; + + get dialogButtons() { + const buttonDef = [ + { + content: getLabel(30986, '保存'), + icon: 'icon-coms-Preservation', + onClickHandle: this.saveViewRange + } + ] + const buttons = [], moreBtnData = []; + buttonDef.map((btn, index) => { + const { content, icon, onClickHandle } = btn; + buttons.push( + () + ); + + moreBtnData.push({ + key: index.toString(), + content, + icon: , + onClick: onClickHandle + }); + }) + + const { scopeId } = this.opParams; + let arr = []; + if (scopeId == '-1') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEBASE', this.encryptParams.encryptId); + } else if (scopeId == '1') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEPERSONAL', this.encryptParams.encryptId); + } else if (scopeId == '3') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_RESOURCEWORK', this.encryptParams.encryptId); + } else if (scopeId == 'subcompany') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SUBCOMPANY', this.encryptParams.encryptId); + } else if (scopeId == 'department') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_DEPARTEMENT', this.encryptParams.encryptId); + } else if (scopeId == 'salary') { + arr = this.generateLogMenu('38', 'HRM_RSOURCE_SALARY'); + } else { } + moreBtnData.push(...arr); + return { buttons, moreBtn: { datas: moreBtnData } }; + } + + @computed get dialogProps() { + return { + title: getLabel('125012', '查看范围设置'), + style: { + width: 800, + height: 600 + }, + ...ecCom.WeaTools.getIconBGC('currency'), + ...this.dialogButtons, + visible: this.dialogVisible, + onCancel: this.onDialogCancleHandle, + } + } + + @computed get rangeViewTableProps() { + return { + comsWeaTableStore: this.table, + hasOrder: true, + needScroll: true, + scroll: { + y: 550 + }, + onOperatesClick: this.onOperatesClickHandle + } + } + + @action showSettingDialog = async () => { + if (this.encryptParams.encryptId == null || this.encryptParams.encryptId == '') { + this.confirmInfo({ + content: getLabel('524355', '提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!'), + onOk: async () => { + const rs = await api.saveEncryptFieldSettingForm({ ...this.formTarget.encryptForm.getFormParams(), ...this.encryptParams, ...this.opParams }); + if (rs.status == '1') { + this.encryptParams.encryptId = rs.encryptId; + // if (this.moduleName.indexOf('resource') >= 0) + this.getTabInfoByTreeNode(); + // else + // this.initData(); + this.dialogVisible = this.getEncryptFieldScopeList(); + } else { + message.error(data.message); + } + } + }); + } else + this.dialogVisible = this.getEncryptFieldScopeList(); + } + + @action getEncryptFieldScopeList = async () => { + const d = await api.getEncryptFieldScopeList({ id: this.encryptParams.encryptId }); + if (d.status == '1') { + const { canAdd, canDel, sessionkey } = d; + this.canAdd = canAdd; + this.canDel = canDel; + this.table = new TableStore(); + this.table.getDatas(sessionkey); + return true; + } else { + message.error(d.message); + return false; + } + } + + @action onOperatesClickHandle = (record, index, operate) => { + const func = operate.href ? operate.href.split(':')[1].split('(')[0] : ''; + const id = record.id || ''; + this[func] && this[func](id, record); + } + + @action doMultiDel = () => this.doDel(); + + @action doDel = ids => { + const params = { + fieldid: this.encryptParams.encryptId, + ids: ids || this.table.selectedRowKeys + }; + let content = isEmpty(ids) ? getLabel(385625, '确定要删除选择的记录吗?') : getLabel(83877, '确定要删除吗?'); + this.confirmInfo({ + content, + onOk: async () => { + const data = await api.delEncryptFieldScopeSetting({ ...params, ...this.opParams }); + if (data.status === "1") { + message.success(getLabel(83472, '删除成功!')); + this.table.getDatas(null, 1); + } else { + message.error(data.message); + } + } + }); + } + + @action saveViewRange = async () => { + this.onDialogCancleHandle(); + } + //#endregion + + //#region 范围form + @observable conditions = []; + + @observable viewRangeAuthVisible = false; + + @computed get viewRangeAuthProps() { + return { + title: getLabel('383694', '添加人员'), + conditions: this.toJS(this.conditions), + ...ecCom.WeaTools.getIconBGC('currency'), + visible: this.viewRangeAuthVisible, + onOk: this.onOKHandle, + onCancel: this.onViewRangeAuthCancleHandle, + } + } + + @action getViewRangeForm = async () => { + const data = await api.getEncryptFieldScopeForm(); + if (data.status == "1") { + this.conditions = data.conditions; + this.viewRangeAuthVisible = true; + } + } + + @action onOKHandle = async data => { + const d = await api.saveEncryptFieldScopeSetting({ id: this.encryptParams.encryptId, ...data, ...this.opParams }); + if (d.status == '1') { + message.success(getLabel(83551, '保存成功!')); + this.getEncryptFieldScopeList(); + } else { + message.error(d.message); + } + this.viewRangeAuthVisible = false; + } + + @action onViewRangeAuthCancleHandle = () => { + this.viewRangeAuthVisible = !this.viewRangeAuthVisible; + } + + get opParams() { const obj = { fieldname: this.encryptParams.fieldname } const name = (this.moduleName || '').toLocaleLowerCase(); - if(name.indexOf('subcompany') > -1){ + if (name.indexOf('subcompany') > -1) { Object.assign(obj, { scopeId: 'subcompany' }); - }else if(name.indexOf('department') > -1){ + } else if (name.indexOf('department') > -1) { Object.assign(obj, { scopeId: 'department' }); @@ -2224,5 +2374,5 @@ export class FieldDefinedStore extends HrmBaseStore { //#endregion /********************* action list *********************/ - + } \ No newline at end of file diff --git a/pc4mobx/organization/util/index.js b/pc4mobx/organization/util/index.js index ebe5892..b6482dd 100644 --- a/pc4mobx/organization/util/index.js +++ b/pc4mobx/organization/util/index.js @@ -2,8 +2,36 @@ import { Spin } from 'antd'; import { WeaSwitch } from 'comsMobx'; import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom'; const getLabel = WeaLocaleProvider.getLabel; +import { + indexOf +} from 'lodash'; import '../style/index.less' +const dbKeys = ["PERCENT", "PLAN", "PRECISION", "PRIMARY", "PRINT", "PROC", "PROCEDURE", "PUBLIC", "RAISERROR", + "READ", "READTEXT", "RECONFIGURE", "REFERENCES", "REPLICATION", "RESTORE", "RESTRICT", "RETURN", "REVOKE", + "RIGHT", "ROLLBACK", "ROWCOUNT", "ROWGUIDCOL", "RULE", "SAVE", "SCHEMA", "SELECT", "SESSION_USER", "SET", + "SETUSER", "SHUTDOWN", "SOME", "STATISTICS", "SYSTEM_USER", "TABLE", "TEXTSIZE", "THEN", "TO", "TOP", "TRAN", + "TRANSACTION", "TRIGGER", "TRUNCATE", "TSEQUAL", "UNION", "UNIQUE", "UPDATE", "UPDATETEXT", "USE", "USER", + "VALUES", "VARYING", "VIEW", "WAITFOR", "WHEN", "WHERE", "WHILE", "WITH", "WRITETEXT", "EXCEPT", "EXEC", "EXECUTE", + "EXISTS", "EXIT", "FETCH", "FILE", "FILLFACTOR", "FOR", "FOREIGN", "FREETEXT", "FREETEXTTABLE", "FROM", "FULL", + "FUNCTION", "GOTO", "GRANT", "GROUP", "HAVING", "HOLDLOCK", "IDENTITY", "IDENTITY_INSERT", "IDENTITYCOL", "IF", "IN", + "INDEX", "INNER", "INSERT", "INTERSECT", "INTO", "IS", "JOIN", "KEY", "KILL", "LEFT", "LIKE", "LINENO", "LOAD", "NATIONAL", + "NOCHECK", "NONCLUSTERED", "NOT", "NULL", "NULLIF", "OF", "OFF", "OFFSETS", "ON", "OPEN", "OPENDATASOURCE", "OPENQUERY", + "OPENROWSET", "OPENXML", "OPTION", "OR", "ORDER", "OUTER", "OVER", "ADD", "ALL", "ALTER", "AND", "ANY", "AS", "ASC", "AUTHORIZATION", + "BACKUP", "BEGIN", "BETWEEN", "BREAK", "BROWSE", "BULK", "BY", "CASCADE", "CASE", "CHECK", "CHECKPOINT", "CLOSE", "CLUSTERED", + "COALESCE", "COLLATE", "COLUMN", "COMMIT", "COMPUTE", "CONSTRAINT", "CONTAINS", "CONTAINSTABLE", "CONTINUE", "CONVERT", "CREATE", + "CROSS", "CURRENT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "CURSOR", "DATABASE", "DBCC", "DEALLOCATE", + "DECLARE", "DEFAULT", "DELETE", "DENY", "DESC", "DISK", "DISTINCT", "DISTRIBUTED", "DOUBLE", "DROP", "DUMMY", "DUMP", "ELSE", "END", "ERRLVL", + "ESCAPE", "ACCESS", "ADD", "ALL", "ALTER", "AND", "ANY", "AS", "ASC", "AUDIT", "BETWEEN", "BY", "CHAR", "CHECK", "CLUSTER", "COLUMN", "COMMENT", + "COMPRESS", "CONNECT", "CREATE", "CURRENT", "DATE", "DECIMAL", "DEFAULT", "DELETE", "DESC", "DISTINCT", "DROP", "ELSE", "EXCLUSIVE", "EXISTS", + "FILE", "FLOAT", "FOR", "FROM", "GRANT", "GROUP", "HAVING", "IDENTIFIED", "IMMEDIATE", "IN", "INCREMENT", "INDEX", "INITIAL", "INSERT", "INTEGER", + "INTERSECT", "INTO", "IS", "LEVEL", "LIKE", "LOCK", "LONG", "MAXEXTENTS", "MINUS", "MLSLABEL", "MODE", "MODIFY", "NOAUDIT", "NOCOMPRESS", "NOT", + "NOWAIT", "NULL", "NUMBER", "OF", "OFFLINE", "ON", "ONLINE", "OPTION", "OR", "ORDER", "PCTFREE", "PRIOR", "PRIVILEGES", "PUBLIC", "RAW", "RENAME", + "RESOURCE", "REVOKE", "ROW", "ROWID", "ROWNUM", "ROWS", "SELECT", "SESSION", "SET", "SHARE", "SIZE", "SMALLINT", "START", "SUCCESSFUL", "SYNONYM", + "SYSDATE", "TABLE", "THEN", "TO", "TRIGGER", "UID", "UNION", "UNIQUE", "UPDATE", "USER", "VALIDATE", "VALUES", "VARCHAR", "VARCHAR2", "VIEW", "WHENEVER", + "WHERE", "WITH" +] + // 渲染form表单: 一般对form的渲染都统一使用该方法 export const getSearchs = (form, condition, col, isCenter) => { const { isFormInit } = form; @@ -89,4 +117,18 @@ export const calFormHeight = (groupLength, children) => { if (height > 300) return 300; return height; +} + +export const validDBKeys = (value) => { + if (indexOf(dbKeys, value.toUpperCase()) >= 0) { + message.error("不能使用数据库保留字作为字段名!"); + return { + isValid: false, + value: '' + }; + } + return { + isValid: true, + value + }; } \ No newline at end of file From 88dd830ce35898a43a7578147a1a7b0c57120d7d Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 13 Jun 2022 17:35:34 +0800 Subject: [PATCH 018/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/stores/fieldDefined.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 8ada3bd..d034da6 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-13 15:06:29 + * @LastEditTime: 2022-06-13 16:55:34 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -1501,14 +1501,14 @@ export class FieldDefinedStore extends HrmBaseStore { this.tableEditConfig.childInfoSetting.showTitle = true; this.tableEditConfig.childInfoSetting.showAdd = true; this.tableEditConfig.childInfoSetting.showDelete = true; - this.selectedTreeNodeInfo.domid != '-1' && t.topButtonDef.push({ - comType: 'button', - type: 'primary', - onClickHandle: this.doChildInfoSetting, - label: i18n.button.childInfoMaintain(), - icon: this.menuIconCollection.setting, - checkAction: 'childInfoOperability' - }); + // this.selectedTreeNodeInfo.domid != '-1' && t.topButtonDef.push({ + // comType: 'button', + // type: 'primary', + // onClickHandle: this.doChildInfoSetting, + // label: i18n.button.childInfoMaintain(), + // icon: this.menuIconCollection.setting, + // checkAction: 'childInfoOperability' + // }); } else { this.tableEditConfig.childInfoSetting.showTitle = false; this.tableEditConfig.childInfoSetting.showAdd = false; From 2b1093ca1dd4646d3d4bf39196122a8fe879c00d Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 15 Jun 2022 11:02:24 +0800 Subject: [PATCH 019/155] =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=83=A8=E5=88=86bug=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/numberComposition.js | 76 +++--- .../components/reservedNumberSetting.js | 49 ++-- .../components/startNumberSetting.js | 128 ++++++++- .../components/startReservedNumberSet.js | 39 +-- .../numberSetting/branchNumSetting/index.js | 47 +++- .../components/numberSetting/constants.js | 6 + .../numberSetting/deptNumberSet/index.js | 222 ++++++++++----- .../numberSetting/postNumberSet/index.js | 51 +++- .../numberSetting/resourceNumberSet/index.js | 257 ++++++++++++++---- pc4mobx/organization/stores/numberSet.js | 4 +- 10 files changed, 640 insertions(+), 239 deletions(-) create mode 100644 pc4mobx/organization/components/numberSetting/constants.js diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js index 277a215..3f65be5 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-05-17 16:02:56 - * LastEditTime: 2022-06-08 16:35:49 + * LastEditTime: 2022-06-14 14:16:16 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; @@ -20,24 +20,6 @@ import { i18n } from "../../../../public/i18n"; import _ from "lodash"; import "../index.less"; -const options = [ - { - key: "string", - showname: "字符串", - }, - { - key: "year", - showname: "当前年份", - }, - { - key: "month", - showname: "当前月份", - }, - { - key: "day", - showname: "当前日期", - }, -]; class NumberComposition extends Component { constructor() { super(); @@ -88,20 +70,20 @@ class NumberComposition extends Component { dataSource: !_.isEmpty(tmpV) ? tmpV : [ - { - id: 1, - value: "", - strLogo: 1, - numFieldName: "字符串1", - numField: "string", - }, - { - id: 2, - value: 3, - numFieldName: "流水号位数", - numField: "number", - }, - ], + { + id: 1, + value: "", + strLogo: 1, + numFieldName: "字符串1", + numField: "string", + }, + { + id: 2, + value: 3, + numFieldName: "流水号位数", + numField: "number", + }, + ], }, () => { onChange && onChange(this.state.dataSource); @@ -141,8 +123,8 @@ class NumberComposition extends Component { const stringRow = _.filter(dataSource, (it) => it.numField === "string"); //字符串列表 const maxStrLen = !_.isEmpty(stringRow) ? _.sortBy(stringRow, function (o) { - return -o.strLogo; - })[0].strLogo + return -o.strLogo; + })[0].strLogo : 0; //字符串列表 const maxIdLen = _.sortBy(dataSource, function (o) { return -o.id; @@ -153,7 +135,17 @@ class NumberComposition extends Component { dataSource, (item) => item.numField === "string" ); - + if (numField === "subcompany" || numField === "department" || numField === "jobtitles") { + if (_.findIndex(dataSource, it => it.numField === numField) !== -1) { + Modal.warning({ + title: "信息确认", + content: `已经添加过一个${numFieldName},请选择其他编号字段!`, + onOk() { }, + okText: "确认", + }); + return; + } + } if (numField === "year" || numField === "month" || numField === "day") { const hasYearOrMonthOrDay = _.some( dataSource, @@ -166,7 +158,7 @@ class NumberComposition extends Component { Modal.warning({ title: "信息确认", content: `添加【${numFieldName}】时,请先添加【当前年份】!`, - onOk() {}, + onOk() { }, okText: "确认", }); return; @@ -175,7 +167,7 @@ class NumberComposition extends Component { Modal.warning({ title: "信息确认", content: `添加【${numFieldName}】时,请先添加【当前年份】和【当前月份】!`, - onOk() {}, + onOk() { }, okText: "确认", }); return; @@ -297,7 +289,7 @@ class NumberComposition extends Component { title: "信息确认", content: `已经添加过一个${objectData.numFieldName},请选择其他编号字段!`, footer: [], - onOk() {}, + onOk() { }, okText: "确认", }); }; @@ -331,6 +323,7 @@ class NumberComposition extends Component { render() { const { visible, objectData, dataSource } = this.state; + const { options } = this.props; const { numField, numFieldName } = objectData; const columns = [ { @@ -397,9 +390,8 @@ class NumberComposition extends Component { {i18n.button.save()} , , ]; diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js index b1c8bb2..4baaf71 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 预留编号设置 * Date: 2022-06-08 09:53:51 - * LastEditTime: 2022-06-09 16:07:51 + * LastEditTime: 2022-06-15 11:00:55 */ import React, { Component } from "react"; import { Row, Col, Spin, Modal, Button, Alert, message } from "antd"; @@ -59,24 +59,21 @@ class ReservedNumberSetting extends Component { c.items.map((field, index) => { colList.push(
{ @@ -128,7 +125,7 @@ class ReservedNumberSetting extends Component { onDeleteReservedNumber && onDeleteReservedNumber(selectedKeys.join(",")); }, - onCancel: () => {}, + onCancel: () => { }, }); }; handleAddReservedNumber = () => { @@ -189,17 +186,15 @@ class ReservedNumberSetting extends Component {
)} {i18n.button.save()} , , ]}> {this.getReservedForm()} diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js index ac48d27..aa4091e 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js @@ -2,12 +2,51 @@ * Author: 黎永顺 * Description: 起始编号设置 * Date: 2022-06-07 15:27:43 - * LastEditTime: 2022-06-09 16:14:32 + * LastEditTime: 2022-06-15 10:47:55 */ -import React, { Component } from "react"; -import { WeaTableEdit, WeaInputNumber } from "ecCom"; +import React, { Component, Fragment } from "react"; +import { WeaTableEdit, WeaInputNumber, WeaDatePicker, WeaBrowser, WeaError } from "ecCom"; +import moment from 'moment'; +const enumStr = { + YEAR: '年', + MONTH: '月份', + DAY: '日期' +} +const browserProps = { + iconBgcolor: '#217346', + icon: 'icon-coms-hrm', + isSingle: false, + inputStyle: { width: 200 }, + viewAttr: 3 +} class StartNumberSetting extends Component { + constructor() { + super(); + this.state = { + startDate: '', + endDate: '', + subCompanyId: '', + jobtitlesId: "" + } + } + handleDatePickerChange = (val, type) => { + this.setState({ + [type]: val + }, () => { + const { startDate, endDate, subCompanyId, jobtitlesId } = this.state; + const { onSet } = this.props; + onSet('start', { startDate, endDate, subCompanyId, jobtitlesId }) + }) + } + handleBrowserChange = (val, type) => { + this.setState({ + [type]: val + }, () => { + const { onSet } = this.props; + onSet('start', { ...this.state, [type]: val }) + }) + } handleChangeTable = (datas) => { const { onChange, startNumberInfo } = this.props; const newColumns = _.map(startNumberInfo.columns, (it) => ({ @@ -21,22 +60,81 @@ class StartNumberSetting extends Component { }; render() { - const { startNumberInfo } = this.props; + const { startDate, endDate } = this.state; + const { startNumberInfo, companyInfo } = this.props; + const { deptSerial = {}, dateSerial = {}, jobtitlesSerial = {} } = companyInfo; const newColumns = _.map(startNumberInfo.columns, (it) => ({ ...it, - com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }], + com: [{ type: it.dataIndex === 'startnum' ? "INPUTNUMBER" : "TEXT", key: it.dataIndex, viewAttr: 3, min: 0 }], })); + const format = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "yyyy-MM-dd"; + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "yyyy-MM-DD"; return ( - + + {dateSerial.enable == '1' && ( +
+ {enumStr[dateSerial.key]} + this.handleDatePickerChange(val, 'startDate')} /> + + this.handleDatePickerChange(val, 'endDate')} /> +
+ )} + { + (deptSerial.enable == '1' && (deptSerial.key === "SUBCOMPANY" || deptSerial.key === "DEPARTMENT")) && ( +
+ 分部名称 + + this.handleBrowserChange(ids, 'subCompanyId')} + /> + +
+ ) + } + { + (deptSerial.enable == '1' && deptSerial.key === "DEPARTMENT") && ( +
+ 部门名称 + + this.handleBrowserChange(ids, 'deptId')} + /> + +
+ ) + } + { + (jobtitlesSerial.enable == '1' && jobtitlesSerial.key === "JOBTITLES") && ( +
+ 岗位名称 + + this.handleBrowserChange(ids, 'jobtitlesId')} + /> + +
+ ) + } + +
); } } diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js index 23b5367..9df6825 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 起始编号及预留编号设置 * Date: 2022-05-17 15:51:41 - * LastEditTime: 2022-06-08 18:03:02 + * LastEditTime: 2022-06-14 18:29:38 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; @@ -47,7 +47,7 @@ class StartReservedNumberSet extends Component { onOk: () => { onSaveStartNumber && onSaveStartNumber(); }, - onCancel: () => {}, + onCancel: () => { }, }); }; handleClose = () => { @@ -68,6 +68,8 @@ class StartReservedNumberSet extends Component { const { dialogProps, reservedAddVisible } = this.state; const { type } = dialogProps; const { + onSet, + companyInfo, startNumberInfo, onDeleteReservedNumber, onAddReservedNumber, @@ -104,30 +106,29 @@ class StartReservedNumberSet extends Component { buttons={ type === "start" ? [ - , - + {i18n.button.save()} + , + , - ] + />, + ] : [ - , - ] + />, + ] }> {type === "start" ? ( diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js index 9aa465a..bed9e63 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 分部编号设置 * Date: 2022-05-17 14:30:57 - * LastEditTime: 2022-06-09 15:12:50 + * LastEditTime: 2022-06-14 18:26:07 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -16,6 +16,7 @@ import { WeaHelpfulTip, } from "ecCom"; import StartReservedNumberSet from "./components/startReservedNumberSet"; +import { serialFieldOptions } from "../constants"; import NumberComposition from "./components/numberComposition"; import { i18n } from "../../../public/i18n"; import moment from "moment"; @@ -114,15 +115,18 @@ export default class BranchNumSetting extends Component { }); }; - handleSetNumber = (type) => { + handleSetNumber = (type, data = {}) => { this.handleSubmit().then((res) => { const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial } = subCompanyInfo; if (type === "start") { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; const payload = { coderuleid: 1, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), subCompanyId: "", deptId: "", jobtitlesId: "", @@ -194,7 +198,33 @@ export default class BranchNumSetting extends Component { */ handleAddReservedNumber = () => { const { numberSet } = this.props; - numberSet.getReservedCodeFrom({ serialtype: "SUBCOMPANY" }); + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "SUBCOMPANY" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 1, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) }; /** * name: 保存预留设置 @@ -293,6 +323,7 @@ export default class BranchNumSetting extends Component {
@@ -316,6 +347,7 @@ export default class BranchNumSetting extends Component { dateSerial: { ...dateSerial, enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key }, }, }) @@ -323,7 +355,7 @@ export default class BranchNumSetting extends Component { /> {dateSerial.enable == "1" && ( ({ ...item, showname: item.showname.substr(2, 1) }))} value={dateSerial.key} detailtype={3} supportCancel @@ -360,6 +392,7 @@ export default class BranchNumSetting extends Component { ref={(dom) => (this.numberSetRef = dom)} loading={loading} onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} onSaveStartNumber={this.handleSubmitStartNumber} diff --git a/pc4mobx/organization/components/numberSetting/constants.js b/pc4mobx/organization/components/numberSetting/constants.js new file mode 100644 index 0000000..a45a284 --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/constants.js @@ -0,0 +1,6 @@ +export const serialFieldOptions = [ + { key: "string", showname: "字符串" }, + { key: "year", showname: "当前年份" }, + { key: "month", showname: "当前月份" }, + { key: "day", showname: "当前日期" }, +]; \ No newline at end of file diff --git a/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js index 1d5226a..01fa1ad 100644 --- a/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 部门编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-09 15:12:57 + * LastEditTime: 2022-06-15 09:52:04 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,10 +17,13 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { serialFieldOptions } from "../constants"; import { i18n } from "../../../public/i18n"; import moment from "moment"; import "../branchNumSetting/index.less"; +const deptSerialFieldOptions = [{ key: 'subcompany', showname: "分部编号" }] + @inject("numberSet") @observer export default class DeptNumberSet extends Component { @@ -37,6 +40,10 @@ export default class DeptNumberSet extends Component { subCompanyInfo: { details: [], serialenable: "0", + deptSerial: { + enable: "0", + key: "", + }, dateSerial: { enable: "0", key: "", @@ -53,10 +60,10 @@ export default class DeptNumberSet extends Component { const { numberSet } = this.props; numberSet .getCodeSetting({ serialtype: "DEPARTMENT" }) - .then(({ api_status, details, serialenable, dateSerial = {} }) => { + .then(({ api_status, details, serialenable, dateSerial = {}, deptSerial = {} }) => { if (api_status && !_.isEmpty(details)) { this.setState({ - subCompanyInfo: { details, serialenable, dateSerial }, + subCompanyInfo: { details, serialenable, dateSerial, deptSerial }, }); } }); @@ -66,7 +73,7 @@ export default class DeptNumberSet extends Component { let promise = new Promise((resolve, reject) => { const { numberSet } = this.props; const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; + const { serialenable, dateSerial, deptSerial } = subCompanyInfo; const details = _.map(dataSource, (it, showorder) => { const { numField, value: rulevalue } = it; return { @@ -80,6 +87,7 @@ export default class DeptNumberSet extends Component { serialenable, details, dateSerial, + deptSerial, serialtype: "DEPARTMENT", }), }; @@ -103,7 +111,10 @@ export default class DeptNumberSet extends Component { (it) => it.numField === "year" || it.numField === "month" || - it.numField === "day" + it.numField === "day" || + it.numField === "subcompany" || + it.numField === "department" || + it.numField === "jobtitles" ); this.setState({ dataSource: _.cloneDeep(data), @@ -114,28 +125,33 @@ export default class DeptNumberSet extends Component { }); }; - handleSetNumber = (type) => { + handleSetNumber = (type, data = {}) => { this.handleSubmit().then((res) => { const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial, deptSerial } = subCompanyInfo; if (type === "start") { - const payload = { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; + let payload = { coderuleid: 2, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), + subCompanyId: data.subCompanyId ? data.subCompanyId : "", deptId: "", jobtitlesId: "", }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } - }); + if (deptSerial.enable === '1' && !data.subCompanyId) return + if (deptSerial.enable === '1' && data.subCompanyId) { + payload = { ...payload, type: payload.type + ',' + deptSerial.key } + } + numberSet.getStartNumForm(payload).then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); } else { numberSet.getAdvanceSearchCondition(); numberSet.getSearchReservedCodeList({ @@ -194,7 +210,33 @@ export default class DeptNumberSet extends Component { */ handleAddReservedNumber = () => { const { numberSet } = this.props; - numberSet.getReservedCodeFrom({ serialtype: "DEPARTMENT" }); + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "DEPARTMENT" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 2, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) }; /** * name: 保存预留设置 @@ -234,7 +276,7 @@ export default class DeptNumberSet extends Component { render() { const { options, subCompanyInfo, loading, startNumberInfo } = this.state; const { numberSet } = this.props; - const { details, serialenable, dateSerial } = subCompanyInfo; + const { details, serialenable, dateSerial = {}, deptSerial = {} } = subCompanyInfo; const btns = [
{!_.isEmpty(options) && (
-
- -
- - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - dateSerial: { - ...dateSerial, - enable: isSingle, - }, - }, - }) - } - /> - {dateSerial.enable == "1" && ( - + { + !_.isEmpty(_.filter(options, item => ["YEAR", "MONTH", "DAY"].includes(item.key))) && +
!["YEAR", "MONTH", "DAY"].includes(item.key))) && 0 }}> + +
+ this.setState({ subCompanyInfo: { ...subCompanyInfo, dateSerial: { ...dateSerial, - key, + enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key }, }, }) } /> - )} - -
-
-
+ {dateSerial.enable == "1" && ( + ["YEAR", "MONTH", "DAY"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(2, 1) }))} + value={dateSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } + { + !_.isEmpty(_.filter(options, item => !["YEAR", "MONTH", "DAY"].includes(item.key))) && +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + enable: isSingle, + }, + }, + }) + } + /> + {deptSerial.enable == "1" && ( + ["SUBCOMPANY", "DEPARTMENT"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(0, 2) }))} + value={deptSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ }
)} @@ -356,6 +455,7 @@ export default class DeptNumberSet extends Component { (this.numberSetRef = dom)} onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} loading={loading} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} diff --git a/pc4mobx/organization/components/numberSetting/postNumberSet/index.js b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js index dccc7b1..593a9d6 100644 --- a/pc4mobx/organization/components/numberSetting/postNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-09 11:31:39 + * LastEditTime: 2022-06-15 10:27:13 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,6 +17,7 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { serialFieldOptions } from "../constants"; import { i18n } from "../../../public/i18n"; import moment from "moment"; import "../branchNumSetting/index.less"; @@ -114,15 +115,18 @@ export default class PostNumberSet extends Component { }); }; - handleSetNumber = (type) => { + handleSetNumber = (type, data = {}) => { this.handleSubmit().then(() => { const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial } = subCompanyInfo; if (type === "start") { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; const payload = { - coderuleid: 3, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), + coderuleid: 4, + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), subCompanyId: "", deptId: "", jobtitlesId: "", @@ -159,7 +163,7 @@ export default class PostNumberSet extends Component { const { numberSet } = this.props; const payload = { datas: JSON.stringify({ - coderuleid: 3, + coderuleid: 4, ...this.state.startNumberInfo, }), }; @@ -193,7 +197,33 @@ export default class PostNumberSet extends Component { */ handleAddReservedNumber = () => { const { numberSet } = this.props; - numberSet.getReservedCodeFrom({ serialtype: "JOBTITLES" }); + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "JOBTITLES" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 4, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) }; /** * name: 保存预留设置 @@ -289,6 +319,7 @@ export default class PostNumberSet extends Component {
@@ -312,6 +343,7 @@ export default class PostNumberSet extends Component { dateSerial: { ...dateSerial, enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key }, }, }) @@ -319,7 +351,7 @@ export default class PostNumberSet extends Component { /> {dateSerial.enable == "1" && ( ({ ...item, showname: item.showname.substr(2, 1) }))} value={dateSerial.key} detailtype={3} supportCancel @@ -355,6 +387,7 @@ export default class PostNumberSet extends Component { (this.numberSetRef = dom)} onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} loading={loading} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} diff --git a/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js index f84e629..d1245a2 100644 --- a/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-09 11:33:03 + * LastEditTime: 2022-06-15 10:36:30 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,9 +17,15 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { serialFieldOptions } from "../constants"; import { i18n } from "../../../public/i18n"; import moment from "moment"; import "../branchNumSetting/index.less"; +const resourceSerialFieldOptions = [ + { key: 'subcompany', showname: "分部编号" }, + { key: 'department', showname: "部门编号" }, + { key: 'jobtitles', showname: "岗位编号" } +] @inject("numberSet") @observer @@ -37,6 +43,14 @@ export default class ResourceNumberSet extends Component { subCompanyInfo: { details: [], serialenable: "0", + deptSerial: { + enable: "0", + key: "", + }, + jobtitlesSerial: { + enable: "0", + key: "", + }, dateSerial: { enable: "0", key: "", @@ -53,10 +67,10 @@ export default class ResourceNumberSet extends Component { const { numberSet } = this.props; numberSet .getCodeSetting({ serialtype: "USER" }) - .then(({ api_status, details, serialenable, dateSerial = {} }) => { + .then(({ api_status, details, serialenable, dateSerial = {}, jobtitlesSerial = {}, deptSerial = {} }) => { if (api_status && !_.isEmpty(details)) { this.setState({ - subCompanyInfo: { details, serialenable, dateSerial }, + subCompanyInfo: { details, serialenable, dateSerial, jobtitlesSerial, deptSerial }, }); } }); @@ -66,7 +80,7 @@ export default class ResourceNumberSet extends Component { let promise = new Promise((resolve, reject) => { const { numberSet } = this.props; const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; + const { serialenable, dateSerial, jobtitlesSerial, deptSerial } = subCompanyInfo; const details = _.map(dataSource, (it, showorder) => { const { numField, value: rulevalue } = it; return { @@ -80,6 +94,7 @@ export default class ResourceNumberSet extends Component { serialenable, details, dateSerial, + jobtitlesSerial, deptSerial, serialtype: "USER", }), }; @@ -103,7 +118,10 @@ export default class ResourceNumberSet extends Component { (it) => it.numField === "year" || it.numField === "month" || - it.numField === "day" + it.numField === "day" || + it.numField === "subcompany" || + it.numField === "department" || + it.numField === "jobtitles" ); this.setState({ dataSource: _.cloneDeep(data), @@ -114,19 +132,31 @@ export default class ResourceNumberSet extends Component { }); }; - handleSetNumber = (type) => { + handleSetNumber = (type, data = {}) => { this.handleSubmit().then(() => { const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial, deptSerial, jobtitlesSerial } = subCompanyInfo; if (type === "start") { - const payload = { - coderuleid: 4, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; + let payload = { + coderuleid: 3, + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), + subCompanyId: data.subCompanyId ? data.subCompanyId : "", + deptId: data.deptId ? data.deptId : "", + jobtitlesId: data.jobtitlesId ? data.jobtitlesId : "", }; + if (deptSerial.enable === '1' && deptSerial.key === 'SUBCOMPANY' && !data.subCompanyId) return + if (deptSerial.enable === '1' && deptSerial.key === 'DEPARTMENT' && !data.deptId) return + if (jobtitlesSerial.enable === '1' && !data.jobtitlesId) return + if (deptSerial.enable === '1' && data.subCompanyId) { + payload = { ...payload, type: payload.type + ',' + deptSerial.key } + } + if (jobtitlesSerial.enable === '1' && data.jobtitlesId) { + payload = { ...payload, type: payload.type + ',' + jobtitlesSerial.key } + } numberSet .getStartNumForm(payload) .then(({ api_status, columns, dataSource }) => { @@ -195,7 +225,33 @@ export default class ResourceNumberSet extends Component { */ handleAddReservedNumber = () => { const { numberSet } = this.props; - numberSet.getReservedCodeFrom({ serialtype: "USER" }); + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "USER" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 3, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) }; /** * name: 保存预留设置 @@ -235,7 +291,7 @@ export default class ResourceNumberSet extends Component { render() { const { options, subCompanyInfo, loading, startNumberInfo } = this.state; const { numberSet } = this.props; - const { details, serialenable, dateSerial } = subCompanyInfo; + const { details, serialenable, dateSerial, jobtitlesSerial, deptSerial } = subCompanyInfo; const btns = [
{!_.isEmpty(options) && (
-
- -
- - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - dateSerial: { - ...dateSerial, - enable: isSingle, - }, - }, - }) - } - /> - {dateSerial.enable == "1" && ( - + { + !_.isEmpty(_.filter(options, item => ["YEAR", "MONTH", "DAY"].includes(item.key))) && +
!["YEAR", "MONTH", "DAY"].includes(item.key))) && 0 }}> + +
+ this.setState({ subCompanyInfo: { ...subCompanyInfo, dateSerial: { ...dateSerial, - key, + enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key }, }, }) } /> - )} - -
-
-
+ {dateSerial.enable == "1" && ( + ["YEAR", "MONTH", "DAY"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(2, 1) }))} + value={dateSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } + { + !_.isEmpty(_.filter(options, item => ["SUBCOMPANY", "DEPARTMENT"].includes(item.key))) && +
!["JOBTITLES"].includes(item.key))) && 0 }}> + +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + enable: isSingle, + }, + }, + }) + } + /> + {deptSerial.enable == "1" && ( + ["SUBCOMPANY", "DEPARTMENT"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(0, 2) }))} + value={deptSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } + { + !_.isEmpty(_.filter(options, item => ["JOBTITLES"].includes(item.key))) && +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + jobtitlesSerial: { + ...jobtitlesSerial, + enable: isSingle, + }, + }, + }) + } + /> + +
+
+
+ }
)} @@ -357,6 +503,7 @@ export default class ResourceNumberSet extends Component { (this.numberSetRef = dom)} onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} loading={loading} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} diff --git a/pc4mobx/organization/stores/numberSet.js b/pc4mobx/organization/stores/numberSet.js index 31ca342..a6dde49 100644 --- a/pc4mobx/organization/stores/numberSet.js +++ b/pc4mobx/organization/stores/numberSet.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 编号设置 * Date: 2022-06-07 09:54:46 - * LastEditTime: 2022-06-09 15:05:37 + * LastEditTime: 2022-06-14 16:06:31 */ import { observable, action } from "mobx"; import { WeaForm } from "comsMobx"; @@ -46,7 +46,7 @@ export class NumberSetStore { @action("新增预留编号表单查询") getReservedCodeFrom(payload) { - API.getReservedCodeFrom(payload).then(({ api_status, conditioninfo }) => { + return API.getReservedCodeFrom(payload).then(({ api_status, conditioninfo }) => { if (api_status && !_.isEmpty(conditioninfo)) { conditioninfo.map((c) => c.items.map((item) => { From 5be0bb68e6660e93563cc3f5b913ce3090441bcb Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 15 Jun 2022 13:17:33 +0800 Subject: [PATCH 020/155] =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/numberSet.js | 67 ++- .../components/startNumberSetting.js | 40 -- .../components/numberComposition.js | 86 ++- .../branchNumSetting/components/preview.js | 7 +- .../components/reservedNumberSetting.js | 397 +++++++++++++ .../components/startNumberSetting.js | 142 +++++ .../components/startReservedNumberSet.js | 85 ++- .../branchNumSetting/index.js | 202 +++++-- .../branchNumSetting/index.less | 0 .../components/numberSetting/constants.js | 18 + .../numberSetting/deptNumberSet/index.js | 481 ++++++++++++++++ .../postNumberSet}/index.js | 213 +++++-- .../numberSetting/resourceNumberSet/index.js | 529 ++++++++++++++++++ .../components/postNumberSet/index.js | 311 ---------- .../components/resourceNumberSet/index.js | 313 ----------- pc4mobx/organization/index.js | 8 +- pc4mobx/organization/stores/numberSet.js | 76 ++- 17 files changed, 2127 insertions(+), 848 deletions(-) delete mode 100644 pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/numberComposition.js (89%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/preview.js (84%) create mode 100644 pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js create mode 100644 pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/components/startReservedNumberSet.js (56%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/index.js (64%) rename pc4mobx/organization/components/{ => numberSetting}/branchNumSetting/index.less (100%) create mode 100644 pc4mobx/organization/components/numberSetting/constants.js create mode 100644 pc4mobx/organization/components/numberSetting/deptNumberSet/index.js rename pc4mobx/organization/components/{deptNumberSet => numberSetting/postNumberSet}/index.js (62%) create mode 100644 pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js delete mode 100644 pc4mobx/organization/components/postNumberSet/index.js delete mode 100644 pc4mobx/organization/components/resourceNumberSet/index.js diff --git a/pc4mobx/organization/apis/numberSet.js b/pc4mobx/organization/apis/numberSet.js index d300660..b287162 100644 --- a/pc4mobx/organization/apis/numberSet.js +++ b/pc4mobx/organization/apis/numberSet.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-06-07 09:52:01 - * LastEditTime: 2022-06-07 17:00:34 + * LastEditTime: 2022-06-15 13:06:02 */ import { WeaTools } from "ecCom"; @@ -48,3 +48,68 @@ export const getStartNumForm = (params) => { params ); }; + +/** + * name: 高级搜索条件 + * param {*} params + * return {*} + */ + export const getAdvanceSearchCondition = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getAdvanceSearchCondition", + "GET", + params + ); +}; + +/** + * name: 预留编号设置列表查询 + * param {*} params + * return {*} + */ +export const getSearchReservedCodeList = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getSearchReservedCodeList", + "POST", + params + ); +}; + +/** + * name: 保存预留编号设置 + * param {*} params + * return {*} + */ +export const saveReservedCode = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/saveReservedCode", + "POST", + params + ); +}; + +/** + * name: 新增预留编号表单查询 + * param {*} params + * return {*} + */ +export const getReservedCodeFrom = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/getReservedCodeFrom", + "GET", + params + ); +}; + +/** + * name: 删除预留编号 + * param {*} params + * return {*} + */ +export const deleteReservedCodeById = (params) => { + return WeaTools.callApi( + "/api/hrm/codeSetting/deleteReservedCodeById", + "POST", + params + ); +}; \ No newline at end of file diff --git a/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js b/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js deleted file mode 100644 index 2fb2365..0000000 --- a/pc4mobx/organization/components/branchNumSetting/components/startNumberSetting.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: 黎永顺 - * Description: 起始编号设置 - * Date: 2022-06-07 15:27:43 - * LastEditTime: 2022-06-07 17:21:03 - */ -import React, { Component } from "react"; -import { WeaTableEdit, WeaInputNumber } from "ecCom"; - -class StartNumberSetting extends Component { - handleChangeTable = (datas) => { - const { onChange, startNumberInfo } = this.props; - const newColumns = _.map(startNumberInfo.columns, (it) => ({ - ...it, - com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }], - })); - onChange && onChange(newColumns, datas); - }; - render() { - const { startNumberInfo } = this.props; - const newColumns = _.map(startNumberInfo.columns, (it) => ({ - ...it, - com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }], - })); - return ( - - ); - } -} - -export default StartNumberSetting; diff --git a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js similarity index 89% rename from pc4mobx/organization/components/branchNumSetting/components/numberComposition.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js index 4bf954b..3f65be5 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: * Date: 2022-05-17 16:02:56 - * LastEditTime: 2022-06-07 15:30:43 + * LastEditTime: 2022-06-14 14:16:16 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; @@ -16,28 +16,10 @@ import { WeaInputNumber, } from "ecCom"; import Preview from "./preview"; -import { i18n } from "../../../public/i18n"; +import { i18n } from "../../../../public/i18n"; import _ from "lodash"; import "../index.less"; -const options = [ - { - key: "string", - showname: "字符串", - }, - { - key: "year", - showname: "当前年份", - }, - { - key: "month", - showname: "当前月份", - }, - { - key: "day", - showname: "当前日期", - }, -]; class NumberComposition extends Component { constructor() { super(); @@ -58,6 +40,9 @@ class NumberComposition extends Component { YEAR: "当前年份", MONTH: "当前月份", DAY: "当前日期", + SUBCOMPANY: "分部编号", + DEPARTMENT: "部门编号", + JOBTITLES: "岗位编号", }; let num = 0; const { dataSource: details, onChange } = this.props; @@ -85,20 +70,20 @@ class NumberComposition extends Component { dataSource: !_.isEmpty(tmpV) ? tmpV : [ - { - id: 1, - value: "", - strLogo: 1, - numFieldName: "字符串1", - numField: "string", - }, - { - id: 2, - value: 3, - numFieldName: "流水号位数", - numField: "number", - }, - ], + { + id: 1, + value: "", + strLogo: 1, + numFieldName: "字符串1", + numField: "string", + }, + { + id: 2, + value: 3, + numFieldName: "流水号位数", + numField: "number", + }, + ], }, () => { onChange && onChange(this.state.dataSource); @@ -138,8 +123,8 @@ class NumberComposition extends Component { const stringRow = _.filter(dataSource, (it) => it.numField === "string"); //字符串列表 const maxStrLen = !_.isEmpty(stringRow) ? _.sortBy(stringRow, function (o) { - return -o.strLogo; - })[0].strLogo + return -o.strLogo; + })[0].strLogo : 0; //字符串列表 const maxIdLen = _.sortBy(dataSource, function (o) { return -o.id; @@ -150,7 +135,17 @@ class NumberComposition extends Component { dataSource, (item) => item.numField === "string" ); - + if (numField === "subcompany" || numField === "department" || numField === "jobtitles") { + if (_.findIndex(dataSource, it => it.numField === numField) !== -1) { + Modal.warning({ + title: "信息确认", + content: `已经添加过一个${numFieldName},请选择其他编号字段!`, + onOk() { }, + okText: "确认", + }); + return; + } + } if (numField === "year" || numField === "month" || numField === "day") { const hasYearOrMonthOrDay = _.some( dataSource, @@ -163,7 +158,7 @@ class NumberComposition extends Component { Modal.warning({ title: "信息确认", content: `添加【${numFieldName}】时,请先添加【当前年份】!`, - onOk() {}, + onOk() { }, okText: "确认", }); return; @@ -172,7 +167,7 @@ class NumberComposition extends Component { Modal.warning({ title: "信息确认", content: `添加【${numFieldName}】时,请先添加【当前年份】和【当前月份】!`, - onOk() {}, + onOk() { }, okText: "确认", }); return; @@ -294,7 +289,7 @@ class NumberComposition extends Component { title: "信息确认", content: `已经添加过一个${objectData.numFieldName},请选择其他编号字段!`, footer: [], - onOk() {}, + onOk() { }, okText: "确认", }); }; @@ -328,6 +323,7 @@ class NumberComposition extends Component { render() { const { visible, objectData, dataSource } = this.state; + const { options } = this.props; const { numField, numFieldName } = objectData; const columns = [ { @@ -352,7 +348,10 @@ class NumberComposition extends Component { if ( numField === "year" || numField === "month" || - numField === "day" + numField === "day" || + numField === "subcompany" || + numField === "department" || + numField === "jobtitles" ) { return ; } @@ -391,9 +390,8 @@ class NumberComposition extends Component { {i18n.button.save()} , , ]; diff --git a/pc4mobx/organization/components/branchNumSetting/components/preview.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js similarity index 84% rename from pc4mobx/organization/components/branchNumSetting/components/preview.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js index 506eaf0..d791f22 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/preview.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/preview.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 编号设置预览 * Date: 2022-05-18 10:21:09 - * LastEditTime: 2022-05-18 13:26:11 + * LastEditTime: 2022-06-08 16:37:01 */ import React, { Component } from "react"; @@ -19,7 +19,10 @@ class Preview extends Component { if ( numField === "year" || numField === "month" || - numField === "day" + numField === "day" || + numField === "subcompany" || + numField === "department" || + numField === "jobtitles" ) { return { ...item, diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js new file mode 100644 index 0000000..4baaf71 --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/reservedNumberSetting.js @@ -0,0 +1,397 @@ +/* + * Author: 黎永顺 + * Description: 预留编号设置 + * Date: 2022-06-08 09:53:51 + * LastEditTime: 2022-06-15 11:00:55 + */ +import React, { Component } from "react"; +import { Row, Col, Spin, Modal, Button, Alert, message } from "antd"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { i18n } from "../../../../public/i18n"; +import { + WeaTab, + WeaButtonIcon, + WeaFormItem, + WeaDialog, + WeaMoreButton, + WeaSearchGroup, +} from "ecCom"; +import { WeaSwitch, WeaTableNew } from "comsMobx"; + +const WeaTable = WeaTableNew.WeaTable; + +@inject("numberSet") +@observer +class ReservedNumberSetting extends Component { + constructor() { + super(); + this.state = { + addVisible: false, + showSearchAd: false, + reservedcode: "", + previewStr: "", + date: "", + }; + } + componentWillReceiveProps(nextProps) { + const { numberSet, onChangeAddVisible } = this.props; + const { reservedForm } = numberSet; + if (nextProps.addVisible !== this.props.addVisible) { + !nextProps.addVisible && + this.setState({ addVisible: false }, () => { + reservedForm.reset(); + onChangeAddVisible && onChangeAddVisible(); + }); + } + } + /** + * name:渲染搜索栏 + * return {*} + */ + getPanelComponents = () => { + const { numberSet } = this.props; + const { searchCondition, form } = numberSet; + let colList = []; + const { isFormInit } = form; + isFormInit && + searchCondition.map((c) => { + c.items.map((field, index) => { + colList.push( + +
+ + { + + } + +
+ + ); + }); + }); + return ( + + {colList} + + ); + }; + + onSearchChange = (reservedcode) => { + const { numberSet } = this.props; + const { form } = numberSet; + this.setState({ reservedcode }); + !_.isEmpty(form.getFormParams()) && + form.updateFields({ + reservedcode: { + value: reservedcode, + }, + }); + }; + /** + * name: 查询 + * return {*} + */ + handelSearch = () => { + const { onSearchReservedNumberset } = this.props; + onSearchReservedNumberset && onSearchReservedNumberset(); + }; + /** + * name: 删除 预留编号 + * return {*} + */ + handleDelete = () => { + const { numberSet, onDeleteReservedNumber } = this.props; + const { tableStore } = numberSet; + const selectedKeys = toJS(tableStore.selectedRowKeys); + Modal.confirm({ + title: "信息确认", + content: `确定要删除选择的记录吗?`, + onOk: () => { + onDeleteReservedNumber && + onDeleteReservedNumber(selectedKeys.join(",")); + }, + onCancel: () => { }, + }); + }; + handleAddReservedNumber = () => { + const { onAddReservedNumber } = this.props; + this.setState({ addVisible: true }, () => { + onAddReservedNumber && onAddReservedNumber(); + }); + }; + /** + * name: 提交预留编号设置 + * return {*} + */ + handleSubmitReservedNumber = () => { + const { numberSet, onSubmitReservedNumber } = this.props; + const { reservedForm, condition } = numberSet; + reservedForm.validateForm().then((f) => { + if (f.isValid) { + const { desc: reserveddesc, flowcode: reservedcodes } = + reservedForm.getFormParams() || {}; + if (!/(^[1-9]\d*$)/.test(reservedcodes)) { + message.warning(`"流水号"格式不正确,请重新输入!`); + return; + } + onSubmitReservedNumber && + onSubmitReservedNumber({ + reserveddesc, + reservedcodes: this.state.previewStr, + }); + } else { + message.warning("请完善表单信息"); + f.showErrors(); + this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新 + } + }); + }; + /** + * name: 新增预留编号表单渲染 + * return {*} + */ + getReservedForm = () => { + const { condition, reservedForm } = this.props.numberSet; + let reservedFormItem = []; + const { isFormInit } = reservedForm; + isFormInit && + condition.map((c, i) => { + let switchItem = []; + c.items.map((field, index) => { + switchItem.push({ + com: ( +
+ {i === condition.length - 1 && index === 0 && ( +
+ +
+ )} + + + {field.domkey[0] === "flowcode" && ( +

格式为:5,6-10,21,66,99

+ )} +
+
+ ), + colSpan: 1, + }); + }); + reservedFormItem.push( + + ); + }); + + return reservedFormItem; + }; + + /** + * name: 输出指定个数0 + * param {*} num + * param {*} length + * return {*} + */ + prefixInteger = (num, length) => { + return (Array(length).join("0") + num).slice(-length); + }; + /** + * name: 字符串替换 + * param {*} str + * param {*} index + * param {*} char + * return {*} + */ + replaceStr2 = (str, index, char) => { + return str.substring(0, index) + char; + }; + + /** + * name: 预留编号的设置 + * param {*} formVal + * return {*} + */ + handleFormItemChange = (formVal) => { + const { numberSet, onSubmitReservedNumber } = this.props; + const { reservedForm, condition } = numberSet; + const NumberOfData = reservedForm.getFormParams() || {}; + let previewStr = "", + originStr = ""; + for (let i in NumberOfData) { + if ( + i.indexOf("STRING") > -1 || + i.indexOf("YEAR") > -1 || + i.indexOf("MONTH") > -1 || + i.indexOf("DAY") > -1 + ) { + originStr = originStr + NumberOfData[i]; + } + } + let integer_0 = this.prefixInteger(0, Number(NumberOfData["NUMBER"])); + //预留流水号值输入 + if (_.hasIn(formVal, "flowcode")) { + const inputValue = formVal["flowcode"].value; + if (inputValue.length <= Number(NumberOfData["NUMBER"])) { + previewStr = + originStr + + this.replaceStr2( + integer_0, + integer_0.length - inputValue.length, + inputValue + ); + } else { + previewStr = originStr + previewStr + inputValue; + } + this.setState({ previewStr: inputValue ? previewStr : "" }); + } else if ( + _.hasIn(formVal, "YEAR") || + _.hasIn(formVal, "MONTH") || + _.hasIn(formVal, "DAY") + ) { + const { flowcode } = NumberOfData; + if (flowcode.length <= Number(NumberOfData["NUMBER"])) { + previewStr = + originStr + + this.replaceStr2( + integer_0, + integer_0.length - flowcode.length, + flowcode + ); + } else { + previewStr = originStr + previewStr + flowcode; + } + this.setState({ previewStr }); + } + }; + render() { + const { + showSearchAd, + reservedcodem, + addVisible, + reservedcode, + date, + previewStr, + } = this.state; + const { numberSet, loading } = this.props; + const { form, tableStore, reservedForm } = numberSet; + return ( +
+ { + this.setState({ + showSearchAd: bool, + }); + }} + searchsAd={this.getPanelComponents()} + searchsBaseValue={ + _.isEmpty(form.getFormParams()) + ? reservedcode + : form.getFormParams().reservedcode + } + onSearchChange={this.onSearchChange} + onSearch={this.handelSearch} + onAdReset={() => form.reset()} + onAdSearch={this.handelSearch} + hasMask={false} + buttons={[ + , + , + ]} + /> + + {/* 起始/预留编号设置 */} + { + reservedForm.resetForm(); + this.setState({ addVisible: false, previewStr: "" }); + }} + icon="icon-coms-hrm" + iconBgcolor="#217346" + hasScroll + style={{ width: 640, height: 480 }} + buttons={[ + , + , + ]}> + {this.getReservedForm()} + +

+ {previewStr} +

+
+
+
+ ); + } +} + +export default ReservedNumberSetting; diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js new file mode 100644 index 0000000..aa4091e --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startNumberSetting.js @@ -0,0 +1,142 @@ +/* + * Author: 黎永顺 + * Description: 起始编号设置 + * Date: 2022-06-07 15:27:43 + * LastEditTime: 2022-06-15 10:47:55 + */ +import React, { Component, Fragment } from "react"; +import { WeaTableEdit, WeaInputNumber, WeaDatePicker, WeaBrowser, WeaError } from "ecCom"; +import moment from 'moment'; + +const enumStr = { + YEAR: '年', + MONTH: '月份', + DAY: '日期' +} +const browserProps = { + iconBgcolor: '#217346', + icon: 'icon-coms-hrm', + isSingle: false, + inputStyle: { width: 200 }, + viewAttr: 3 +} +class StartNumberSetting extends Component { + constructor() { + super(); + this.state = { + startDate: '', + endDate: '', + subCompanyId: '', + jobtitlesId: "" + } + } + handleDatePickerChange = (val, type) => { + this.setState({ + [type]: val + }, () => { + const { startDate, endDate, subCompanyId, jobtitlesId } = this.state; + const { onSet } = this.props; + onSet('start', { startDate, endDate, subCompanyId, jobtitlesId }) + }) + } + handleBrowserChange = (val, type) => { + this.setState({ + [type]: val + }, () => { + const { onSet } = this.props; + onSet('start', { ...this.state, [type]: val }) + }) + } + handleChangeTable = (datas) => { + const { onChange, startNumberInfo } = this.props; + const newColumns = _.map(startNumberInfo.columns, (it) => ({ + ...it, + com: [{ type: "INPUTNUMBER", key: it.dataIndex, viewAttr: 3, min: 0 }], + })); + onChange && onChange(newColumns, datas); + }; + getRowSelection = (rowSelection) => { + return null; + }; + + render() { + const { startDate, endDate } = this.state; + const { startNumberInfo, companyInfo } = this.props; + const { deptSerial = {}, dateSerial = {}, jobtitlesSerial = {} } = companyInfo; + const newColumns = _.map(startNumberInfo.columns, (it) => ({ + ...it, + com: [{ type: it.dataIndex === 'startnum' ? "INPUTNUMBER" : "TEXT", key: it.dataIndex, viewAttr: 3, min: 0 }], + })); + const format = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "yyyy-MM-dd"; + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "yyyy-MM-DD"; + return ( + + {dateSerial.enable == '1' && ( +
+ {enumStr[dateSerial.key]} + this.handleDatePickerChange(val, 'startDate')} /> + + this.handleDatePickerChange(val, 'endDate')} /> +
+ )} + { + (deptSerial.enable == '1' && (deptSerial.key === "SUBCOMPANY" || deptSerial.key === "DEPARTMENT")) && ( +
+ 分部名称 + + this.handleBrowserChange(ids, 'subCompanyId')} + /> + +
+ ) + } + { + (deptSerial.enable == '1' && deptSerial.key === "DEPARTMENT") && ( +
+ 部门名称 + + this.handleBrowserChange(ids, 'deptId')} + /> + +
+ ) + } + { + (jobtitlesSerial.enable == '1' && jobtitlesSerial.key === "JOBTITLES") && ( +
+ 岗位名称 + + this.handleBrowserChange(ids, 'jobtitlesId')} + /> + +
+ ) + } + +
+ ); + } +} + +export default StartNumberSetting; diff --git a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js similarity index 56% rename from pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js index b39d4a0..9df6825 100644 --- a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/startReservedNumberSet.js @@ -2,18 +2,19 @@ * Author: 黎永顺 * Description: 起始编号及预留编号设置 * Date: 2022-05-17 15:51:41 - * LastEditTime: 2022-06-07 17:40:30 + * LastEditTime: 2022-06-14 18:29:38 */ import React, { Component, Fragment } from "react"; import { Button, Modal } from "antd"; import StartNumberSetting from "./startNumberSetting"; +import ReservedNumberSetting from "./reservedNumberSetting"; import { WeaFormItem, WeaDialog, WeaMoreButton } from "ecCom"; -import { i18n } from "../../../public/i18n"; - +import { i18n } from "../../../../public/i18n"; class StartReservedNumberSet extends Component { constructor() { super(); this.state = { + reservedAddVisible: true, dialogProps: { type: "start", visible: false, @@ -40,7 +41,14 @@ class StartReservedNumberSet extends Component { }; handleSave = () => { const { onSaveStartNumber } = this.props; - onSaveStartNumber && onSaveStartNumber(); + Modal.confirm({ + title: "信息确认", + content: `是否保存数据?`, + onOk: () => { + onSaveStartNumber && onSaveStartNumber(); + }, + onCancel: () => { }, + }); }; handleClose = () => { this.setState({ @@ -50,10 +58,25 @@ class StartReservedNumberSet extends Component { }, }); }; + handleCloseReservedModal = () => { + this.setState({ + reservedAddVisible: false, + }); + }; + render() { - const { dialogProps } = this.state; + const { dialogProps, reservedAddVisible } = this.state; const { type } = dialogProps; - const { startNumberInfo } = this.props; + const { + onSet, + companyInfo, + startNumberInfo, + onDeleteReservedNumber, + onAddReservedNumber, + onSubmitReservedNumber, + onSearchReservedNumberset, + loading, + } = this.props; return ( - {i18n.button.save()} - , - + {i18n.button.save()} + , + , - ] + />, + ] : [ - , - ] + />, + ] }> - {type === "start" && ( + {type === "start" ? ( + ) : ( + + this.setState({ reservedAddVisible: true }) + } + /> )} diff --git a/pc4mobx/organization/components/branchNumSetting/index.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js similarity index 64% rename from pc4mobx/organization/components/branchNumSetting/index.js rename to pc4mobx/organization/components/numberSetting/branchNumSetting/index.js index e8743e7..bed9e63 100644 --- a/pc4mobx/organization/components/branchNumSetting/index.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.js @@ -2,7 +2,7 @@ * Author: 黎永顺 * Description: 分部编号设置 * Date: 2022-05-17 14:30:57 - * LastEditTime: 2022-06-07 17:49:14 + * LastEditTime: 2022-06-14 18:26:07 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -16,8 +16,9 @@ import { WeaHelpfulTip, } from "ecCom"; import StartReservedNumberSet from "./components/startReservedNumberSet"; +import { serialFieldOptions } from "../constants"; import NumberComposition from "./components/numberComposition"; -import { i18n } from "../../public/i18n"; +import { i18n } from "../../../public/i18n"; import moment from "moment"; import "./index.less"; @@ -63,32 +64,38 @@ export default class BranchNumSetting extends Component { }; handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "SUBCOMPANY", + }), }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "SUBCOMPANY", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); + return promise; }; handleChangeCode = (data) => { @@ -108,29 +115,39 @@ export default class BranchNumSetting extends Component { }); }; - handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 1, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } + handleSetNumber = (type, data = {}) => { + this.handleSubmit().then((res) => { + const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial } = subCompanyInfo; + if (type === "start") { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; + const payload = { + coderuleid: 1, + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", }); - } + } + }); }; handleChangeTable = (newColumns, datas) => { this.setState({ @@ -158,6 +175,79 @@ export default class BranchNumSetting extends Component { }); }; + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "SUBCOMPANY" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 1, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "SUBCOMPANY" }; + this.setState({ loading: true }); + numberSet.saveReservedCode(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", + }); + } + }); + }; + /** * name:提示文本 * return {*} @@ -175,6 +265,7 @@ export default class BranchNumSetting extends Component { }; render() { + const { numberSet } = this.props; const { options, subCompanyInfo, loading, startNumberInfo } = this.state; const { details, serialenable, dateSerial } = subCompanyInfo; const btns = [ @@ -232,6 +323,7 @@ export default class BranchNumSetting extends Component {
@@ -255,6 +347,7 @@ export default class BranchNumSetting extends Component { dateSerial: { ...dateSerial, enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key }, }, }) @@ -262,7 +355,7 @@ export default class BranchNumSetting extends Component { /> {dateSerial.enable == "1" && ( ({ ...item, showname: item.showname.substr(2, 1) }))} value={dateSerial.key} detailtype={3} supportCancel @@ -297,10 +390,21 @@ export default class BranchNumSetting extends Component { center> (this.numberSetRef = dom)} + loading={loading} onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} onSaveStartNumber={this.handleSubmitStartNumber} + onDeleteReservedNumber={this.deleteReservedNumber} + onAddReservedNumber={this.handleAddReservedNumber} + onSubmitReservedNumber={this.handleSubmitReservedNumber} + onSearchReservedNumberset={() => + numberSet.getSearchReservedCodeList({ + serialtype: "SUBCOMPANY", + checkboxType: "multi", + }) + } />
diff --git a/pc4mobx/organization/components/branchNumSetting/index.less b/pc4mobx/organization/components/numberSetting/branchNumSetting/index.less similarity index 100% rename from pc4mobx/organization/components/branchNumSetting/index.less rename to pc4mobx/organization/components/numberSetting/branchNumSetting/index.less diff --git a/pc4mobx/organization/components/numberSetting/constants.js b/pc4mobx/organization/components/numberSetting/constants.js new file mode 100644 index 0000000..442abae --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/constants.js @@ -0,0 +1,18 @@ +export const serialFieldOptions = [ + { + key: "string", + showname: "字符串", + }, + { + key: "year", + showname: "当前年份", + }, + { + key: "month", + showname: "当前月份", + }, + { + key: "day", + showname: "当前日期", + }, +] \ No newline at end of file diff --git a/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js new file mode 100644 index 0000000..01fa1ad --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/deptNumberSet/index.js @@ -0,0 +1,481 @@ +/* + * Author: 黎永顺 + * Description: 部门编号设置 + * Date: 2022-06-06 09:37:39 + * LastEditTime: 2022-06-15 09:52:04 + */ +import React, { Component, Fragment } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message } from "antd"; +import { + WeaTop, + WeaFormItem, + WeaCheckbox, + WeaSearchGroup, + WeaSelect, + WeaHelpfulTip, +} from "ecCom"; +import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; +import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { serialFieldOptions } from "../constants"; +import { i18n } from "../../../public/i18n"; +import moment from "moment"; +import "../branchNumSetting/index.less"; + +const deptSerialFieldOptions = [{ key: 'subcompany', showname: "分部编号" }] + +@inject("numberSet") +@observer +export default class DeptNumberSet extends Component { + constructor() { + super(); + this.state = { + options: [], + loading: false, + dataSource: [], + startNumberInfo: { + columns: [], + dataSource: [], + }, + subCompanyInfo: { + details: [], + serialenable: "0", + deptSerial: { + enable: "0", + key: "", + }, + dateSerial: { + enable: "0", + key: "", + }, + }, + }; + } + + componentDidMount() { + this.getCodeSetting(); + } + + getCodeSetting = () => { + const { numberSet } = this.props; + numberSet + .getCodeSetting({ serialtype: "DEPARTMENT" }) + .then(({ api_status, details, serialenable, dateSerial = {}, deptSerial = {} }) => { + if (api_status && !_.isEmpty(details)) { + this.setState({ + subCompanyInfo: { details, serialenable, dateSerial, deptSerial }, + }); + } + }); + }; + + handleSubmit = () => { + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial, deptSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + deptSerial, + serialtype: "DEPARTMENT", + }), + }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); + }); + return promise; + }; + + handleChangeCode = (data) => { + const tmpV = _.filter( + data, + (it) => + it.numField === "year" || + it.numField === "month" || + it.numField === "day" || + it.numField === "subcompany" || + it.numField === "department" || + it.numField === "jobtitles" + ); + this.setState({ + dataSource: _.cloneDeep(data), + options: _.map(tmpV, (it) => { + const { numFieldName: showname, numField: key } = it; + return { key: _.upperCase(key), showname }; + }), + }); + }; + + handleSetNumber = (type, data = {}) => { + this.handleSubmit().then((res) => { + const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial, deptSerial } = subCompanyInfo; + if (type === "start") { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; + let payload = { + coderuleid: 2, + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), + subCompanyId: data.subCompanyId ? data.subCompanyId : "", + deptId: "", + jobtitlesId: "", + }; + if (deptSerial.enable === '1' && !data.subCompanyId) return + if (deptSerial.enable === '1' && data.subCompanyId) { + payload = { ...payload, type: payload.type + ',' + deptSerial.key } + } + numberSet.getStartNumForm(payload).then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", + }); + } + }); + }; + handleChangeTable = (newColumns, datas) => { + this.setState({ + startNumberInfo: { + ...this.state.startNumberInfo, + columns: newColumns, + dataSource: datas, + }, + }); + }; + + handleSubmitStartNumber = () => { + const { numberSet } = this.props; + const payload = { + datas: JSON.stringify({ + coderuleid: 2, + ...this.state.startNumberInfo, + }), + }; + numberSet.saveStartNum(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleClose(); + } + }); + }; + + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "DEPARTMENT" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 2, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "DEPARTMENT" }; + numberSet.saveReservedCode(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", + }); + } + }); + }; + + /** + * name:提示文本 + * return {*} + */ + helpContent = () => { + return ( +
+

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

+

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

+

2.导入人员-添加时,新创建的部门可自动生成部门编号;

+

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

+

【注意】开启前请先确认部门编号字段已启用!

+
+ ); + }; + render() { + const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { numberSet } = this.props; + const { details, serialenable, dateSerial = {}, deptSerial = {} } = subCompanyInfo; + const btns = [ + , + ]; + const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => this.handleSubmit(), + }, + ]; + return ( +
+ } + iconBgcolor="#217346" + buttons={btns} + showDropIcon={true} + dropMenuDatas={dropMenuDatas} + /> +
+
+ + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + serialenable: checkVal, + }, + }) + } + /> + +
+ {/* 内容区 */} + {serialenable === "1" && ( + +
+ + + +
+ {!_.isEmpty(options) && ( +
+ + { + !_.isEmpty(_.filter(options, item => ["YEAR", "MONTH", "DAY"].includes(item.key))) && +
!["YEAR", "MONTH", "DAY"].includes(item.key))) && 0 }}> + +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key + }, + }, + }) + } + /> + {dateSerial.enable == "1" && ( + ["YEAR", "MONTH", "DAY"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(2, 1) }))} + value={dateSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } + { + !_.isEmpty(_.filter(options, item => !["YEAR", "MONTH", "DAY"].includes(item.key))) && +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + enable: isSingle, + }, + }, + }) + } + /> + {deptSerial.enable == "1" && ( + ["SUBCOMPANY", "DEPARTMENT"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(0, 2) }))} + value={deptSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } +
+
+ )} +
+ + (this.numberSetRef = dom)} + onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} + loading={loading} + startNumberInfo={startNumberInfo} + onChange={this.handleChangeTable} + onSaveStartNumber={this.handleSubmitStartNumber} + onDeleteReservedNumber={this.deleteReservedNumber} + onAddReservedNumber={this.handleAddReservedNumber} + onSubmitReservedNumber={this.handleSubmitReservedNumber} + onSearchReservedNumberset={() => + numberSet.getSearchReservedCodeList({ + serialtype: "DEPARTMENT", + checkboxType: "multi", + }) + } + /> + +
+
+ )} +
+
+ ); + } +} diff --git a/pc4mobx/organization/components/deptNumberSet/index.js b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js similarity index 62% rename from pc4mobx/organization/components/deptNumberSet/index.js rename to pc4mobx/organization/components/numberSetting/postNumberSet/index.js index 4a384a2..9bb1745 100644 --- a/pc4mobx/organization/components/deptNumberSet/index.js +++ b/pc4mobx/organization/components/numberSetting/postNumberSet/index.js @@ -1,8 +1,8 @@ /* * Author: 黎永顺 - * Description: 部门编号设置 + * Description: 岗位编号设置 * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 17:44:30 + * LastEditTime: 2022-06-15 12:47:43 */ import React, { Component, Fragment } from "react"; import { inject, observer } from "mobx-react"; @@ -17,13 +17,14 @@ import { } from "ecCom"; import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; import NumberComposition from "../branchNumSetting/components/numberComposition"; -import { i18n } from "../../public/i18n"; -import moment from 'moment'; +import { serialFieldOptions } from "../constants"; +import { i18n } from "../../../public/i18n"; +import moment from "moment"; import "../branchNumSetting/index.less"; @inject("numberSet") @observer -export default class DeptNumberSet extends Component { +export default class PostNumberSet extends Component { constructor() { super(); this.state = { @@ -52,7 +53,7 @@ export default class DeptNumberSet extends Component { getCodeSetting = () => { const { numberSet } = this.props; numberSet - .getCodeSetting({ serialtype: "DEPARTMENT" }) + .getCodeSetting({ serialtype: "JOBTITLES" }) .then(({ api_status, details, serialenable, dateSerial = {} }) => { if (api_status && !_.isEmpty(details)) { this.setState({ @@ -63,32 +64,38 @@ export default class DeptNumberSet extends Component { }; handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + serialtype: "JOBTITLES", + }), }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "DEPARTMENT", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); + return promise; }; handleChangeCode = (data) => { @@ -108,29 +115,39 @@ export default class DeptNumberSet extends Component { }); }; - handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 2, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } + handleSetNumber = (type, data = {}) => { + this.handleSubmit().then(() => { + const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial } = subCompanyInfo; + if (type === "start") { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; + const payload = { + coderuleid: 4, + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", }); - } + } + }); }; handleChangeTable = (newColumns, datas) => { this.setState({ @@ -146,7 +163,7 @@ export default class DeptNumberSet extends Component { const { numberSet } = this.props; const payload = { datas: JSON.stringify({ - coderuleid: 2, + coderuleid: 4, ...this.state.startNumberInfo, }), }; @@ -157,6 +174,76 @@ export default class DeptNumberSet extends Component { } }); }; + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "JOBTITLES" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 4, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "JOBTITLES" }; + numberSet.saveReservedCode(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", + }); + } + }); + }; /** * name:提示文本 @@ -174,6 +261,7 @@ export default class DeptNumberSet extends Component { ); }; render() { + const { numberSet } = this.props; const { options, subCompanyInfo, loading, startNumberInfo } = this.state; const { details, serialenable, dateSerial } = subCompanyInfo; const btns = [ @@ -193,7 +281,7 @@ export default class DeptNumberSet extends Component { return (
} iconBgcolor="#217346" buttons={btns} @@ -203,7 +291,7 @@ export default class DeptNumberSet extends Component {
@@ -254,6 +343,7 @@ export default class DeptNumberSet extends Component { dateSerial: { ...dateSerial, enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key }, }, }) @@ -261,7 +351,7 @@ export default class DeptNumberSet extends Component { /> {dateSerial.enable == "1" && ( ({ ...item, showname: item.showname.substr(2, 1) }))} value={dateSerial.key} detailtype={3} supportCancel @@ -297,9 +387,20 @@ export default class DeptNumberSet extends Component { (this.numberSetRef = dom)} onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} + loading={loading} startNumberInfo={startNumberInfo} onChange={this.handleChangeTable} onSaveStartNumber={this.handleSubmitStartNumber} + onDeleteReservedNumber={this.deleteReservedNumber} + onAddReservedNumber={this.handleAddReservedNumber} + onSubmitReservedNumber={this.handleSubmitReservedNumber} + onSearchReservedNumberset={() => + numberSet.getSearchReservedCodeList({ + serialtype: "JOBTITLES", + checkboxType: "multi", + }) + } />
diff --git a/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js new file mode 100644 index 0000000..d1245a2 --- /dev/null +++ b/pc4mobx/organization/components/numberSetting/resourceNumberSet/index.js @@ -0,0 +1,529 @@ +/* + * Author: 黎永顺 + * Description: 岗位编号设置 + * Date: 2022-06-06 09:37:39 + * LastEditTime: 2022-06-15 10:36:30 + */ +import React, { Component, Fragment } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message } from "antd"; +import { + WeaTop, + WeaFormItem, + WeaCheckbox, + WeaSearchGroup, + WeaSelect, + WeaHelpfulTip, +} from "ecCom"; +import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; +import NumberComposition from "../branchNumSetting/components/numberComposition"; +import { serialFieldOptions } from "../constants"; +import { i18n } from "../../../public/i18n"; +import moment from "moment"; +import "../branchNumSetting/index.less"; +const resourceSerialFieldOptions = [ + { key: 'subcompany', showname: "分部编号" }, + { key: 'department', showname: "部门编号" }, + { key: 'jobtitles', showname: "岗位编号" } +] + +@inject("numberSet") +@observer +export default class ResourceNumberSet extends Component { + constructor() { + super(); + this.state = { + options: [], + loading: false, + dataSource: [], + startNumberInfo: { + columns: [], + dataSource: [], + }, + subCompanyInfo: { + details: [], + serialenable: "0", + deptSerial: { + enable: "0", + key: "", + }, + jobtitlesSerial: { + enable: "0", + key: "", + }, + dateSerial: { + enable: "0", + key: "", + }, + }, + }; + } + + componentDidMount() { + this.getCodeSetting(); + } + + getCodeSetting = () => { + const { numberSet } = this.props; + numberSet + .getCodeSetting({ serialtype: "USER" }) + .then(({ api_status, details, serialenable, dateSerial = {}, jobtitlesSerial = {}, deptSerial = {} }) => { + if (api_status && !_.isEmpty(details)) { + this.setState({ + subCompanyInfo: { details, serialenable, dateSerial, jobtitlesSerial, deptSerial }, + }); + } + }); + }; + + handleSubmit = () => { + let promise = new Promise((resolve, reject) => { + const { numberSet } = this.props; + const { dataSource, subCompanyInfo } = this.state; + const { serialenable, dateSerial, jobtitlesSerial, deptSerial } = subCompanyInfo; + const details = _.map(dataSource, (it, showorder) => { + const { numField, value: rulevalue } = it; + return { + ruletype: _.upperCase(numField), + rulevalue, + showorder, + }; + }); + const payload = { + datas: JSON.stringify({ + serialenable, + details, + dateSerial, + jobtitlesSerial, deptSerial, + serialtype: "USER", + }), + }; + this.setState({ loading: true }); + numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { + this.setState({ loading: false }); + if (api_status) { + message.success("保存成功"); + resolve(api_status); + } else { + reject("接口调用失败"); + } + }); + }); + return promise; + }; + + handleChangeCode = (data) => { + const tmpV = _.filter( + data, + (it) => + it.numField === "year" || + it.numField === "month" || + it.numField === "day" || + it.numField === "subcompany" || + it.numField === "department" || + it.numField === "jobtitles" + ); + this.setState({ + dataSource: _.cloneDeep(data), + options: _.map(tmpV, (it) => { + const { numFieldName: showname, numField: key } = it; + return { key: _.upperCase(key), showname }; + }), + }); + }; + + handleSetNumber = (type, data = {}) => { + this.handleSubmit().then(() => { + const { numberSet } = this.props; + const { subCompanyInfo } = this.state; + const { dateSerial, deptSerial, jobtitlesSerial } = subCompanyInfo; + if (type === "start") { + const formatVal = dateSerial.key === "YEAR" ? "YYYY" : dateSerial.key === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD"; + let payload = { + coderuleid: 3, + type: dateSerial.enable == '1' ? dateSerial.key : '', + dateStart: data.startDate ? data.startDate : moment().format(formatVal), + dateEnd: data.endDate ? data.endDate : moment().format(formatVal), + subCompanyId: data.subCompanyId ? data.subCompanyId : "", + deptId: data.deptId ? data.deptId : "", + jobtitlesId: data.jobtitlesId ? data.jobtitlesId : "", + }; + if (deptSerial.enable === '1' && deptSerial.key === 'SUBCOMPANY' && !data.subCompanyId) return + if (deptSerial.enable === '1' && deptSerial.key === 'DEPARTMENT' && !data.deptId) return + if (jobtitlesSerial.enable === '1' && !data.jobtitlesId) return + if (deptSerial.enable === '1' && data.subCompanyId) { + payload = { ...payload, type: payload.type + ',' + deptSerial.key } + } + if (jobtitlesSerial.enable === '1' && data.jobtitlesId) { + payload = { ...payload, type: payload.type + ',' + jobtitlesSerial.key } + } + numberSet + .getStartNumForm(payload) + .then(({ api_status, columns, dataSource }) => { + if (api_status) { + this.setState({ + startNumberInfo: { columns, dataSource }, + }); + } + }); + } else { + numberSet.getAdvanceSearchCondition(); + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", + }); + } + }); + }; + + handleChangeTable = (newColumns, datas) => { + this.setState({ + startNumberInfo: { + ...this.state.startNumberInfo, + columns: newColumns, + dataSource: datas, + }, + }); + }; + + handleSubmitStartNumber = () => { + const { numberSet } = this.props; + const payload = { + datas: JSON.stringify({ + coderuleid: 4, + ...this.state.startNumberInfo, + }), + }; + numberSet.saveStartNum(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleClose(); + } + }); + }; + + /** + * name: 删除预留编号 + * param {*} ids + * return {*} + */ + deleteReservedNumber = (ids) => { + const { numberSet } = this.props; + numberSet.deleteReservedCodeById({ ids }).then(({ api_status }) => { + if (api_status) { + message.success("删除成功"); + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", + }); + } + }); + }; + /** + * name:新增预留编号 + * return {*} + */ + handleAddReservedNumber = () => { + const { numberSet } = this.props; + const { reservedForm } = numberSet; + const { options } = this.state; + numberSet.getReservedCodeFrom({ serialtype: "USER" }).then(() => { + const type = _.get(_.last(options), ['key']); + const format = type === "YEAR" ? "YYYY" : type === "MONTH" ? "YYYY-MM" : "YYYY-MM-DD" + const payload = { + coderuleid: 3, + type, + dateStart: moment().format(format), + dateEnd: moment().format(format), + subCompanyId: "", + deptId: "", + jobtitlesId: "", + }; + numberSet + .getStartNumForm(payload) + .then(({ api_status, dataSource }) => { + if (api_status && !_.isEmpty(dataSource)) { + const currentnumber = _.get(_.last(dataSource), ['startnum']); + reservedForm.updateFields({ + currentnumber: { + value: currentnumber, + }, + }); + } + }); + }) + }; + /** + * name: 保存预留设置 + * param {*} params + * return {*} + */ + handleSubmitReservedNumber = (params) => { + const { numberSet } = this.props; + const payload = { ...params, serialtype: "USER" }; + numberSet.saveReservedCode(payload).then(({ api_status }) => { + if (api_status) { + message.success("保存成功"); + this.numberSetRef.handleCloseReservedModal(); + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", + }); + } + }); + }; + + /** + * name:提示文本 + * return {*} + */ + helpContent = () => { + return ( +
+

开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:

+

1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;

+

2.导入人员-添加时,新创建的部门可自动生成部门编号;

+

3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;

+

【注意】开启前请先确认部门编号字段已启用!

+
+ ); + }; + render() { + const { options, subCompanyInfo, loading, startNumberInfo } = this.state; + const { numberSet } = this.props; + const { details, serialenable, dateSerial, jobtitlesSerial, deptSerial } = subCompanyInfo; + const btns = [ + , + ]; + const dropMenuDatas = [ + { + key: "save", + disabled: false, + icon: , + content: "保存", + onClick: (key) => this.handleSubmit(), + }, + ]; + return ( +
+ } + iconBgcolor="#217346" + buttons={btns} + showDropIcon={true} + dropMenuDatas={dropMenuDatas} + /> +
+
+ + + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + serialenable: checkVal, + }, + }) + } + /> + +
+ {/* 内容区 */} + {serialenable === "1" && ( + +
+ + + +
+ {!_.isEmpty(options) && ( +
+ + { + !_.isEmpty(_.filter(options, item => ["YEAR", "MONTH", "DAY"].includes(item.key))) && +
!["YEAR", "MONTH", "DAY"].includes(item.key))) && 0 }}> + +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + enable: isSingle, + key: isSingle == '0' ? 'YEAR' : dateSerial.key + }, + }, + }) + } + /> + {dateSerial.enable == "1" && ( + ["YEAR", "MONTH", "DAY"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(2, 1) }))} + value={dateSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + dateSerial: { + ...dateSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } + { + !_.isEmpty(_.filter(options, item => ["SUBCOMPANY", "DEPARTMENT"].includes(item.key))) && +
!["JOBTITLES"].includes(item.key))) && 0 }}> + +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + enable: isSingle, + }, + }, + }) + } + /> + {deptSerial.enable == "1" && ( + ["SUBCOMPANY", "DEPARTMENT"].includes(item.key)), it => ({ ...it, showname: it.showname.substr(0, 2) }))} + value={deptSerial.key} + detailtype={3} + supportCancel + onChange={(key) => + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + deptSerial: { + ...deptSerial, + key, + }, + }, + }) + } + /> + )} + +
+
+
+ } + { + !_.isEmpty(_.filter(options, item => ["JOBTITLES"].includes(item.key))) && +
+ +
+ + this.setState({ + subCompanyInfo: { + ...subCompanyInfo, + jobtitlesSerial: { + ...jobtitlesSerial, + enable: isSingle, + }, + }, + }) + } + /> + +
+
+
+ } +
+
+ )} +
+ + (this.numberSetRef = dom)} + onSet={this.handleSetNumber} + companyInfo={subCompanyInfo} + loading={loading} + startNumberInfo={startNumberInfo} + onChange={this.handleChangeTable} + onSaveStartNumber={this.handleSubmitStartNumber} + onDeleteReservedNumber={this.deleteReservedNumber} + onAddReservedNumber={this.handleAddReservedNumber} + onSubmitReservedNumber={this.handleSubmitReservedNumber} + onSearchReservedNumberset={() => + numberSet.getSearchReservedCodeList({ + serialtype: "USER", + checkboxType: "multi", + }) + } + /> + +
+
+ )} +
+
+ ); + } +} diff --git a/pc4mobx/organization/components/postNumberSet/index.js b/pc4mobx/organization/components/postNumberSet/index.js deleted file mode 100644 index 5866c6c..0000000 --- a/pc4mobx/organization/components/postNumberSet/index.js +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Author: 黎永顺 - * Description: 岗位编号设置 - * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 18:13:32 - */ -import React, { Component, Fragment } from "react"; -import { inject, observer } from "mobx-react"; -import { Button, message } from "antd"; -import { - WeaTop, - WeaFormItem, - WeaCheckbox, - WeaSearchGroup, - WeaSelect, - WeaHelpfulTip, -} from "ecCom"; -import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; -import NumberComposition from "../branchNumSetting/components/numberComposition"; -import { i18n } from "../../public/i18n"; -import moment from "moment"; -import "../branchNumSetting/index.less"; - -@inject("numberSet") -@observer -export default class PostNumberSet extends Component { - constructor() { - super(); - this.state = { - options: [], - loading: false, - dataSource: [], - startNumberInfo: { - columns: [], - dataSource: [], - }, - subCompanyInfo: { - details: [], - serialenable: "0", - dateSerial: { - enable: "0", - key: "", - }, - }, - }; - } - - componentDidMount() { - this.getCodeSetting(); - } - - getCodeSetting = () => { - const { numberSet } = this.props; - numberSet - .getCodeSetting({ serialtype: "JOBTITLES" }) - .then(({ api_status, details, serialenable, dateSerial = {} }) => { - if (api_status && !_.isEmpty(details)) { - this.setState({ - subCompanyInfo: { details, serialenable, dateSerial }, - }); - } - }); - }; - - handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, - }; - }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "JOBTITLES", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); - }; - - handleChangeCode = (data) => { - const tmpV = _.filter( - data, - (it) => - it.numField === "year" || - it.numField === "month" || - it.numField === "day" - ); - this.setState({ - dataSource: _.cloneDeep(data), - options: _.map(tmpV, (it) => { - const { numFieldName: showname, numField: key } = it; - return { key: _.upperCase(key), showname }; - }), - }); - }; - - handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 3, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } - }); - } - }; - handleChangeTable = (newColumns, datas) => { - this.setState({ - startNumberInfo: { - ...this.state.startNumberInfo, - columns: newColumns, - dataSource: datas, - }, - }); - }; - - handleSubmitStartNumber = () => { - const { numberSet } = this.props; - const payload = { - datas: JSON.stringify({ - coderuleid: 3, - ...this.state.startNumberInfo, - }), - }; - numberSet.saveStartNum(payload).then(({ api_status }) => { - if (api_status) { - message.success("保存成功"); - this.numberSetRef.handleClose(); - } - }); - }; - - /** - * name:提示文本 - * return {*} - */ - helpContent = () => { - return ( -
-

开启后,可根据设置的岗位编号规则自动生成岗位编号,涉及场景如下:

-

1.新建岗位和编辑岗位时可选择重新生成编号和选择预留编号;

-

2.导入人员-添加时,新创建的岗位可自动生成岗位编号;

-

3.岗位导入新岗位且岗位编号列为空时可自动生成编号;

-
- ); - }; - render() { - const { options, subCompanyInfo, loading, startNumberInfo } = this.state; - const { details, serialenable, dateSerial } = subCompanyInfo; - const btns = [ - , - ]; - const dropMenuDatas = [ - { - key: "save", - disabled: false, - icon: , - content: "保存", - onClick: (key) => this.handleSubmit(), - }, - ]; - return ( -
- } - iconBgcolor="#217346" - buttons={btns} - showDropIcon={true} - dropMenuDatas={dropMenuDatas} - /> -
-
- - - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - serialenable: checkVal, - }, - }) - } - /> - -
- {/* 内容区 */} - {serialenable === "1" && ( - -
- - - -
- {!_.isEmpty(options) && ( -
- -
- -
- - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - dateSerial: { - ...dateSerial, - enable: isSingle, - }, - }, - }) - } - /> - {dateSerial.enable == "1" && ( - - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - dateSerial: { - ...dateSerial, - key, - }, - }, - }) - } - /> - )} - -
-
-
-
-
- )} -
- - (this.numberSetRef = dom)} - onSet={this.handleSetNumber} - startNumberInfo={startNumberInfo} - onChange={this.handleChangeTable} - onSaveStartNumber={this.handleSubmitStartNumber} - /> - -
-
- )} -
-
- ); - } -} diff --git a/pc4mobx/organization/components/resourceNumberSet/index.js b/pc4mobx/organization/components/resourceNumberSet/index.js deleted file mode 100644 index dda9ed6..0000000 --- a/pc4mobx/organization/components/resourceNumberSet/index.js +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Author: 黎永顺 - * Description: 岗位编号设置 - * Date: 2022-06-06 09:37:39 - * LastEditTime: 2022-06-07 18:12:11 - */ -import React, { Component, Fragment } from "react"; -import { inject, observer } from "mobx-react"; -import { Button, message } from "antd"; -import { - WeaTop, - WeaFormItem, - WeaCheckbox, - WeaSearchGroup, - WeaSelect, - WeaHelpfulTip, -} from "ecCom"; -import StartReservedNumberSet from "../branchNumSetting/components/startReservedNumberSet"; -import NumberComposition from "../branchNumSetting/components/numberComposition"; -import { i18n } from "../../public/i18n"; -import moment from "moment"; -import "../branchNumSetting/index.less"; - -@inject("numberSet") -@observer -export default class ResourceNumberSet extends Component { - constructor() { - super(); - this.state = { - options: [], - loading: false, - dataSource: [], - startNumberInfo: { - columns: [], - dataSource: [], - }, - subCompanyInfo: { - details: [], - serialenable: "0", - dateSerial: { - enable: "0", - key: "", - }, - }, - }; - } - - componentDidMount() { - this.getCodeSetting(); - } - - getCodeSetting = () => { - const { numberSet } = this.props; - numberSet - .getCodeSetting({ serialtype: "USER" }) - .then(({ api_status, details, serialenable, dateSerial = {} }) => { - if (api_status && !_.isEmpty(details)) { - this.setState({ - subCompanyInfo: { details, serialenable, dateSerial }, - }); - } - }); - }; - - handleSubmit = () => { - const { numberSet } = this.props; - const { dataSource, subCompanyInfo } = this.state; - const { serialenable, dateSerial } = subCompanyInfo; - const details = _.map(dataSource, (it, showorder) => { - const { numField, value: rulevalue } = it; - return { - ruletype: _.upperCase(numField), - rulevalue, - showorder, - }; - }); - const payload = { - datas: JSON.stringify({ - serialenable, - details, - dateSerial, - serialtype: "USER", - }), - }; - this.setState({ loading: true }); - numberSet.saveOrUpdateCodeSetting(payload).then(({ api_status }) => { - this.setState({ loading: false }); - if (api_status) { - message.success("保存成功"); - } - }); - }; - - handleChangeCode = (data) => { - const tmpV = _.filter( - data, - (it) => - it.numField === "year" || - it.numField === "month" || - it.numField === "day" - ); - this.setState({ - dataSource: _.cloneDeep(data), - options: _.map(tmpV, (it) => { - const { numFieldName: showname, numField: key } = it; - return { key: _.upperCase(key), showname }; - }), - }); - }; - - handleSetNumber = (type) => { - this.handleSubmit(); - const { numberSet } = this.props; - if (type === "start") { - const payload = { - coderuleid: 4, - type: "", - dateStart: moment().format("YYYY"), - dateEnd: moment().format("YYYY"), - subCompanyId: "", - deptId: "", - jobtitlesId: "", - }; - numberSet - .getStartNumForm(payload) - .then(({ api_status, columns, dataSource }) => { - if (api_status) { - this.setState({ - startNumberInfo: { columns, dataSource }, - }); - } - }); - } - }; - handleChangeTable = (newColumns, datas) => { - this.setState({ - startNumberInfo: { - ...this.state.startNumberInfo, - columns: newColumns, - dataSource: datas, - }, - }); - }; - - handleSubmitStartNumber = () => { - const { numberSet } = this.props; - const payload = { - datas: JSON.stringify({ - coderuleid: 4, - ...this.state.startNumberInfo, - }), - }; - numberSet.saveStartNum(payload).then(({ api_status }) => { - if (api_status) { - message.success("保存成功"); - this.numberSetRef.handleClose(); - } - }); - }; - - /** - * name:提示文本 - * return {*} - */ - helpContent = () => { - return ( -
-

开启后,可根据设置的人员编号规则自动生成人员编号,涉及场景如下:

-

1.手动新建和手动编辑人员时可选择自动生成和选择预留人员编号;

-

- 2.导入人员类型选择-添加,导入Excel中人员编号为空时,可自动生成人员编号; -

-

3.人员入职流程中人员编号字段为空时可自动生成人员编号;

-
- ); - }; - render() { - const { options, subCompanyInfo, loading, startNumberInfo } = this.state; - const { details, serialenable, dateSerial } = subCompanyInfo; - const btns = [ - , - ]; - const dropMenuDatas = [ - { - key: "save", - disabled: false, - icon: , - content: "保存", - onClick: (key) => this.handleSubmit(), - }, - ]; - return ( -
- } - iconBgcolor="#217346" - buttons={btns} - showDropIcon={true} - dropMenuDatas={dropMenuDatas} - /> -
-
- - - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - serialenable: checkVal, - }, - }) - } - /> - -
- {/* 内容区 */} - {serialenable === "1" && ( - -
- - - -
- {!_.isEmpty(options) && ( -
- -
- -
- - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - dateSerial: { - ...dateSerial, - enable: isSingle, - }, - }, - }) - } - /> - {dateSerial.enable == "1" && ( - - this.setState({ - subCompanyInfo: { - ...subCompanyInfo, - dateSerial: { - ...dateSerial, - key, - }, - }, - }) - } - /> - )} - -
-
-
-
-
- )} -
- - (this.numberSetRef = dom)} - onSet={this.handleSetNumber} - startNumberInfo={startNumberInfo} - onChange={this.handleChangeTable} - onSaveStartNumber={this.handleSubmitStartNumber} - /> - -
-
- )} -
-
- ); - } -} diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 917c942..e51c7ef 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -11,10 +11,10 @@ import Sequence from "./components/sequence/Sequence"; import Group from "./components/group/Group"; import OfficeManage from "./components/office/officeManage"; import CompanyExtend from "./components/company/CompanyExtend"; -import BranchNumSetting from "./components/branchNumSetting"; -import DeptNumberSet from "./components/deptNumberSet"; -import PostNumberSet from "./components/postNumberSet"; -import ResourceNumberSet from "./components/resourceNumberSet"; +import BranchNumSetting from "./components/numberSetting/branchNumSetting"; +import DeptNumberSet from "./components/numberSetting/deptNumberSet"; +import PostNumberSet from "./components/numberSetting/postNumberSet"; +import ResourceNumberSet from "./components/numberSetting/resourceNumberSet"; import Company from "./components/company/company"; import StaffScheme from "./components/staff/StaffScheme"; import Staff from "./components/staff/Staff"; diff --git a/pc4mobx/organization/stores/numberSet.js b/pc4mobx/organization/stores/numberSet.js index 55917a5..6a8610a 100644 --- a/pc4mobx/organization/stores/numberSet.js +++ b/pc4mobx/organization/stores/numberSet.js @@ -2,13 +2,74 @@ * Author: 黎永顺 * Description: 编号设置 * Date: 2022-06-07 09:54:46 - * LastEditTime: 2022-06-07 17:00:49 + * LastEditTime: 2022-06-15 13:09:28 */ import { observable, action } from "mobx"; +import { WeaForm } from "comsMobx"; +import { WeaTableNew } from "comsMobx"; import * as mobx from "mobx"; import * as API from "../apis/numberSet"; // 引入API接口文件 +const { TableStore } = WeaTableNew; + export class NumberSetStore { + @observable searchCondition = []; //高级搜索框form数据 + @observable tableStore = new TableStore(); //列表store + @observable form = new WeaForm(); //高级搜索渲染的表单 + @observable condition = []; //新增职务信息form数据 + @observable reservedForm = new WeaForm(); //新增预留编号表单 + + @action("高级搜索表单渲染") + getAdvanceSearchCondition() { + API.getAdvanceSearchCondition().then(({ api_status, conditions }) => { + if (api_status && !_.isEmpty(conditions)) { + this.setSearchCondition(conditions); + this.form.initFormFields(conditions); + } + }); + } + + @action("获取表格数据") + getSearchReservedCodeList(params) { + const payload = { + ...this.form.getFormParams(), + ...params, + }; + API.getSearchReservedCodeList(payload).then( + ({ api_status, sessionkey }) => { + if (api_status && !_.isEmpty(sessionkey)) { + this.tableStore.getDatas(sessionkey, 1); + } + } + ); + } + + @action("新增预留编号表单查询") + getReservedCodeFrom(payload) { + return API.getReservedCodeFrom(payload).then(({ api_status, conditioninfo }) => { + if (api_status && !_.isEmpty(conditioninfo)) { + conditioninfo.map((c) => + c.items.map((item) => { + if (item.domkey[0] == "YEAR") { + item.value = item.value.toString(); + } + }) + ); + this.setCondition(conditioninfo); + this.reservedForm.initFormFields(conditioninfo); + } + }); + } + @action + setCondition(condition) { + this.condition = condition; + } + + @action + setSearchCondition(condition) { + this.searchCondition = condition; + } + @action getCodeSetting(params) { return API.getCodeSetting(params); @@ -23,8 +84,19 @@ export class NumberSetStore { getStartNumForm(params) { return API.getStartNumForm(params); } + @action saveStartNum(params) { return API.saveStartNum(params); } -} + + @action("删除预留编号") + deleteReservedCodeById(params) { + return API.deleteReservedCodeById(params); + } + + @action("保存预留编号") + saveReservedCode(params) { + return API.saveReservedCode(params); + } +} \ No newline at end of file From 2d1c75698524c496bb7f5d829d7ff56782c621a6 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 16 Jun 2022 08:43:36 +0800 Subject: [PATCH 021/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=91=E5=92=8Ctab=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/fieldDefined.js | 29 +- .../fieldDefinedSet/FieldDefined.js | 10 +- pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/companyextend.js | 2 +- pc4mobx/organization/stores/fieldDefined.js | 272 +++++++----------- 5 files changed, 137 insertions(+), 177 deletions(-) diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js index 5a5a66a..a642d7d 100644 --- a/pc4mobx/organization/apis/fieldDefined.js +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -7,7 +7,7 @@ import { * @param {Object} params [description] * @return {[type]} [description] */ -export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/getTabInfo?is_multilang_set=true`, 'GET', params) +export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi('/api/bs/hrmorganization/fieldDefined/getTabInfo', 'GET', params) export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/getFieldDefinedInfo?is_multilang_set=true`, 'GET', params) @@ -15,11 +15,34 @@ export const saveFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callAp export const removeFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/del`, 'POST', params) -export const saveGroupInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/saveGroup`, 'POST', params) +export const saveGroupInfo = (moduleName,params) => { + return fetch('/api/bs/hrmorganization/fieldDefined/saveTitle', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + + +export const changeTypeInfo = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeTree`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + + export const removeGroupInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/delGroup`, 'POST', params) -export const getTree = (params = {}) => WeaTools.callApi(`/api/hrm/resourcefielddefined/getTree`, 'GET', params) +export const getTree = (moduleName,params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTree`, 'GET', params) export const saveTree = (params = {}) => WeaTools.callApi(`/api/hrm/resourcefielddefined/saveTree`, 'POST', params) diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index d835966..698ff79 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -56,13 +56,15 @@ export default class FieldDefined extends Component { let moduleName, logSmallType; if (moduleType === 'subCompany') { moduleName = 'subcompanyfielddefined'; - logSmallType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED'; + //logSmallType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED'; } else if (moduleType === 'department') { moduleName = 'departmentfielddefined'; - logSmallType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED'; - } else { + //logSmallType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED'; + } else if(moduleType === 'job') { + moduleName = 'jobfielddefined'; + }else { moduleName = 'resourcefielddefined'; - logSmallType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; + //logSmallType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; } // let callbackFunc = () => initData(false, true, moduleName); // if (moduleType === 'resource') diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 567877f..fad5e61 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -843,6 +843,7 @@ export const i18n = { button: { back: () => getLabel(1290, '返回'), createType: () => getLabel(30131, '新建类型'), + editTypeInfo: () => getLabel(32732, '编辑类型'), batchOpen: () => getLabel(534249, '批量解锁'), collect: () => getLabel(28111, '收藏'), diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 95ba257..8079896 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -56,9 +56,9 @@ export class CompanyExtendStore { save = () => { if (this.loading) return; - this.loading = true; this.form.validateForm().then(f => { if (f.isValid) { + this.loading = true; if (this.personalEditTables) { const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index d034da6..e64f25f 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-13 16:55:34 + * @LastEditTime: 2022-06-15 18:47:39 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -67,7 +67,9 @@ export class FieldDefinedStore extends HrmBaseStore { }, { comType: 'button', type: 'primary', - onClickHandle: () => this.editType(), + onClickHandle: () => this.editTypeInfo(true, { + name: this.selectedTreeNodeInfo.name, + }), label: i18n.button.createType, icon: this.menuIconCollection.create }, { @@ -504,7 +506,7 @@ export class FieldDefinedStore extends HrmBaseStore { "items": [{ "colSpan": 2, "conditionType": "INPUT", - "domkey": ["typeName"], + "domkey": ["name"], "fieldcol": 12, "isQuickSearch": false, "label": i18n.label.typeName, @@ -513,59 +515,6 @@ export class FieldDefinedStore extends HrmBaseStore { "rules": "required|string", "value": "", "viewAttr": 3, - }, { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "SELECT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 3, - "domkey": [ - "tableType" - ], - "entSearch": false, - "fieldcol": 16, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "新增到", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "options": [ - { - "disabled": false, - "key": "0", - "selected": false, - "showname": "主表", - "visible": true - }, - { - "disabled": false, - "key": "1", - "selected": false, - "showname": "明细表", - "visible": true - } - ], - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "value": "0", - "valueList": [], - "rules": "required|string", - "viewAttr": 3 }], "defaultshow": true }] @@ -821,7 +770,7 @@ export class FieldDefinedStore extends HrmBaseStore { this.dialogParams.childInfoSetting.visible && this.doSaveChildInfoSetting(); } - @action editGroup = (group, moveToGroup = false) => { + @action("新建分组") editGroup = (group, moveToGroup = false) => { this.moveToGroup = moveToGroup; this.editGroupInfoFormFields.map(f => { if (typeof (f.title) == 'function') @@ -851,7 +800,9 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('editGroupInfo', true, dialogTitle); } - @action editType = () => { + isCreateTypeInfo = false; + @action("新增或创建类型") editTypeInfo = (create = true, data = {}) => { + this.isCreateTypeInfo = create; this.editTypeInfoFormFields.map(f => { if (typeof (f.title) == 'function') f.title = f.title(); @@ -862,17 +813,20 @@ export class FieldDefinedStore extends HrmBaseStore { }) }) let fields = [...this.editTypeInfoFormFields], - dialogTitle = ''; + dialogTitle = create ? i18n.button.createType() : i18n.button.editTypeInfo(); this.setFormData('typeInfoFrom', fields); - // this.formTarget.typeInfoFrom.updateFields({ - // typeName: { value: '' } - // }); - // this.opId = null; - dialogTitle = i18n.button.createType(); + if (!create) { + this.formTarget.typeInfoFrom.updateFields({ + name: { value: data.name } + }); + }else { + this.selectedTreeNodeInfo.domid = null; + } + this.setDialogVisible('editTypeInfo', true, dialogTitle); } - @action doGroupSetting = () => { + @action("分组维护") doGroupSetting = () => { this.tableEditConfig.groupSetting.datas.length = 0; let arr = []; this.tabRecord.map(tabInfo => { @@ -920,36 +874,27 @@ export class FieldDefinedStore extends HrmBaseStore { } - @action doSaveTypeInfo = () => { + @action("保存类型") doSaveTypeInfo = () => { this.formTarget.typeInfoFrom.validateForm().then(f => { if (f.isValid) { - let record = { - ...this.formTarget.typeInfoFrom.getFormParams(), - } + debugger let params = { - data: JSON.stringify({ - record: record - }) + ... this.formTarget.typeInfoFrom.getFormParams(), + id: this.selectedTreeNodeInfo.domid } - // api.saveTypeInfo(this.moduleName, params).then(data => { - // if (data.status === '1') { - // this.setDialogVisible('editGroupInfo', false, ''); - // if (this.moveToGroup) { - // const ids = data.groupid.split(','); - // this.changeGroup(null, ids[ids.length - 1]); - // } else { - // //if (this.moduleName.indexOf('resource') >= 0) - // this.getTabInfoByTreeNode(); - // // else - // // this.initData(this.opId == null); - // message.success(i18n.message.saveSuccess()); - // } - // } else - // message.error(data.message); - // }, error => { - // message.error(i18n.message.actionError()); - // }); - this.getTree() + api.changeTypeInfo(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + this.setDialogVisible('editTypeInfo', false, ''); + this.getTree() + message.success(i18n.message.saveSuccess()); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) } else { f.showErrors(); this.showError = new Date().getTime(); @@ -957,7 +902,7 @@ export class FieldDefinedStore extends HrmBaseStore { }); } - doSaveGroupInfo = () => { + @action("分组保存") doSaveGroupInfo = () => { this.formTarget.groupInfoFrom.validateForm().then(f => { if (f.isValid) { let record = { @@ -972,51 +917,33 @@ export class FieldDefinedStore extends HrmBaseStore { this.showError = new Date().getTime(); return; } - let found = false, - records = []; - this.opId != null && Object.assign(record, { - id: this.opId, - isShow: this.activeTabInfo.tabInfo.isShow - }); - this.tabConfig.tabs.map(tabInfo => { - if (tabInfo.groupid === this.opId) { - found = true; - records.push(record) - } else { - records.push({ - id: tabInfo.groupid, - isShow: tabInfo.isShow, - groupName: tabInfo.title - }) - } - }); - !found && records.push(record); let params = { - data: JSON.stringify({ - records: records - }) + ...this.formTarget.groupInfoFrom.getFormParams(), + isShow: 1 } + if (this.selectedTreeNodeInfo != null) params.groupType = this.selectedTreeNodeInfo.key - api.saveGroupInfo(this.moduleName, params).then(data => { - if (data.status === '1') { + api.saveGroupInfo(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { this.setDialogVisible('editGroupInfo', false, ''); if (this.moveToGroup) { - const ids = data.groupid.split(','); + const ids = data.data.groupid.split(','); this.changeGroup(null, ids[ids.length - 1]); } else { - //if (this.moduleName.indexOf('resource') >= 0) this.getTabInfoByTreeNode(); - // else - // this.initData(this.opId == null); message.success(i18n.message.saveSuccess()); } - } else - message.error(data.message); - }, error => { - message.error(i18n.message.actionError()); - }); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { f.showErrors(); this.showError = new Date().getTime(); @@ -1341,7 +1268,8 @@ export class FieldDefinedStore extends HrmBaseStore { dataObj.groupType = this.selectedTreeNodeInfo.key; params.groupType = this.selectedTreeNodeInfo.key; } - params.data = JSON.stringify(dataObj); + params.data = dataObj; + api.saveGroupInfo(this.moduleName, params).then(data => { if (data.status === '1') { this.setDialogVisible('groupInfoSetting', false, ''); @@ -1355,6 +1283,7 @@ export class FieldDefinedStore extends HrmBaseStore { }, error => { message.error(i18n.message.actionError()); }); + } else { message.error(i18n.confirm.groupNameExist()); } @@ -1446,27 +1375,21 @@ export class FieldDefinedStore extends HrmBaseStore { this.selectedTreeNodeInfo = null; this.dropdownSelectedKey = '1'; this.moduleName = module; - // let columns = cloneDeep(this.fieldDefColumns()) - // columns.splice(1, 1); - // columns[1].width = '65%'; - // this.tableEditConfig.fieldDef.columns = this.getColumns(); this.treeConfig.treeExpandKeys.length = 0; - api.getTree().then(data => { - if (data.status === '1') { + api.getTree(this.moduleName).then(res => { + if (res.code === 200) { this.containerInitFinished = { ...this.containerInitFinished, init: true } - - // this.setTableEditColTitle(); - if (data.treejson.length > 0) { - this.treeConfig.data = data.treejson; - this.treeConfig.selectedKeys = [data.treejson[0].key]; - this.selectedTreeNodeInfo = data.treejson[0]; + if (res.data.length > 0) { + this.treeConfig.data = res.data; + this.treeConfig.selectedKeys = [res.data[0].key]; + this.selectedTreeNodeInfo = res.data[0]; this.getTabInfoByTreeNode(null, true); } } else { - message.error(data.message); + message.error(res.msg); } }, error => { }) } @@ -1474,9 +1397,9 @@ export class FieldDefinedStore extends HrmBaseStore { getTree = (callback) => { this.treeConfig.data.length = 0; this.refreshTree = new Date().getTime(); - api.getTree().then(data => { - if (data.status === '1') { - this.treeConfig.data = data.treejson; + api.getTree(this.moduleName).then(res => { + if (res.code === 200) { + this.treeConfig.data = res.data; this.treeConfig.data.map(p => { if (p.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = p; @@ -1487,7 +1410,7 @@ export class FieldDefinedStore extends HrmBaseStore { }) callback && callback(); } else { - message.error(data.message); + message.error(res.msg); } this.refreshTree = new Date().getTime(); }, error => { }) @@ -1497,38 +1420,46 @@ export class FieldDefinedStore extends HrmBaseStore { if (!this.selectedTreeNodeInfo.hasGroup) { t.topButtonDef.splice(1, 3); } - if (this.selectedTreeNodeInfo.addChild) { + t.topButtonDef.push({ + comType: 'button', + type: 'primary', + onClickHandle: () => this.editTypeInfo(false, { + name: this.selectedTreeNodeInfo.name, + }), + label: i18n.button.editTypeInfo(), + icon: this.menuIconCollection.setting + }) + if (this.selectedTreeNodeInfo.addChild) { //非子节点 this.tableEditConfig.childInfoSetting.showTitle = true; this.tableEditConfig.childInfoSetting.showAdd = true; this.tableEditConfig.childInfoSetting.showDelete = true; - // this.selectedTreeNodeInfo.domid != '-1' && t.topButtonDef.push({ - // comType: 'button', - // type: 'primary', - // onClickHandle: this.doChildInfoSetting, - // label: i18n.button.childInfoMaintain(), - // icon: this.menuIconCollection.setting, - // checkAction: 'childInfoOperability' - // }); + let domid = this.selectedTreeNodeInfo.domid; + //非基本类型() + (domid != '-1' && domid != '-2' && domid != '-3' && domid != '-4') && t.topButtonDef.push({ + comType: 'button', + type: 'primary', + onClickHandle: this.doChildInfoSetting, + label: i18n.button.childInfoMaintain(), + icon: this.menuIconCollection.setting, + checkAction: 'childInfoOperability' + }) && t.topButtonDef.push({ + comType: 'button', + type: 'primary', + onClickHandle: this.removeTypeInfo, + label: i18n.button.delete(), + icon: this.menuIconCollection.setting + }); } else { this.tableEditConfig.childInfoSetting.showTitle = false; this.tableEditConfig.childInfoSetting.showAdd = false; this.tableEditConfig.childInfoSetting.showDelete = false; - this.selectedTreeNodeInfo.domid != '-1' && t.topButtonDef.push({ + t.topButtonDef.push({ comType: 'button', type: 'primary', - onClickHandle: () => this.createChildInfo(false, { - name: this.selectedTreeNodeInfo.name, - multiName: this.selectedTreeNodeInfo.multiName - }), - label: i18n.button.editChildInfo(), - icon: this.menuIconCollection.setting - }) && t.topButtonDef.push({ - comType: 'button', - type: 'primary', - onClickHandle: this.removeChildInfo, + onClickHandle: this.removeTypeInfo, label: i18n.button.delete(), icon: this.menuIconCollection.setting - }); + }) } if (this.selectedTreeNodeInfo.domid === '-1' || this.selectedTreeNodeInfo.addChild) { @@ -1553,12 +1484,12 @@ export class FieldDefinedStore extends HrmBaseStore { @action getTabInfoByTreeNode = (create = false, init = false, isLeaf) => { api.getTabInfo(this.moduleName, { groupType: this.treeConfig.selectedKeys[0] - }).then(data => { - if (data.status === '1') { - this._groupInfoOperability = data.tabs.length === 0; + }).then(res => { + if (res.code === 200) { + this._groupInfoOperability = res.data.tabs.length === 0; let tabArr = []; - this.tabRecord = data.tabs; - data.tabs && data.tabs.map((tabInfo, index) => { + this.tabRecord = res.data.tabs; + res.data.tabs && res.data.tabs.map((tabInfo, index) => { let t = cloneDeep(this.tabDef); this.setBtn(t); tabArr.push({ @@ -1616,6 +1547,9 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('createChildInfo', true, dialogTitle); } + + + @action doSaveChildInfo = () => { this.formTarget.childInfoForm.validateForm().then(f => { if (f.isValid) { From 19e1d07e3c4153b3bf801d9aec9b990a63078e93 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 16 Jun 2022 18:35:17 +0800 Subject: [PATCH 022/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/fieldDefined.js | 59 ++++-- .../fieldDefinedSet/FieldDefined.js | 15 +- pc4mobx/organization/stores/baseStore.js | 3 +- pc4mobx/organization/stores/fieldDefined.js | 180 ++++++++++-------- 4 files changed, 155 insertions(+), 102 deletions(-) diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js index a642d7d..8306fbb 100644 --- a/pc4mobx/organization/apis/fieldDefined.js +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -7,16 +7,12 @@ import { * @param {Object} params [description] * @return {[type]} [description] */ -export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi('/api/bs/hrmorganization/fieldDefined/getTabInfo', 'GET', params) +export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTabInfo`, 'GET', params) -export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/getFieldDefinedInfo?is_multilang_set=true`, 'GET', params) +export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getFieldDefinedInfo`, 'GET', params) -export const saveFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/save`, 'POST', params) - -export const removeFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/del`, 'POST', params) - -export const saveGroupInfo = (moduleName,params) => { - return fetch('/api/bs/hrmorganization/fieldDefined/saveTitle', { +export const saveFieldDefinedInfo = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, { method: 'POST', mode: 'cors', headers: { @@ -26,6 +22,30 @@ export const saveGroupInfo = (moduleName,params) => { }) } +export const removeFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/del`, 'POST', params) + +export const saveGroupInfo = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + + +export const saveGroupSettingInfo = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveGroup`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} export const changeTypeInfo = (moduleName,params) => { return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeTree`, { @@ -38,13 +58,30 @@ export const changeTypeInfo = (moduleName,params) => { }) } +export const removeGroupInfo = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/deleteTitle`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} -export const removeGroupInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/delGroup`, 'POST', params) - export const getTree = (moduleName,params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTree`, 'GET', params) -export const saveTree = (params = {}) => WeaTools.callApi(`/api/hrm/resourcefielddefined/saveTree`, 'POST', params) +export const saveTree = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTree`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} export const changeGroup = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/changeGroup`, 'POST', params) diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index 698ff79..c2812e6 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -56,20 +56,18 @@ export default class FieldDefined extends Component { let moduleName, logSmallType; if (moduleType === 'subCompany') { moduleName = 'subcompanyfielddefined'; - //logSmallType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED'; } else if (moduleType === 'department') { moduleName = 'departmentfielddefined'; - //logSmallType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED'; } else if(moduleType === 'job') { moduleName = 'jobfielddefined'; }else { moduleName = 'resourcefielddefined'; - //logSmallType = 'HRM_ENGINE_RESOURCEFIELDDEFINED'; } // let callbackFunc = () => initData(false, true, moduleName); // if (moduleType === 'resource') - let callbackFunc = () => initResourceData(moduleName); - checkAuthorized(moduleName, null, callbackFunc); + //let callbackFunc = () => initResourceData(moduleName); + //checkAuthorized(moduleName, null, callbackFunc); + initResourceData(moduleName); this.setState({ logSmallType }) } @@ -87,7 +85,7 @@ export default class FieldDefined extends Component { fieldDefined: store, params } = this.props, { - containerInitFinished, + //containerInitFinished,//权限验证 refreshMainTabComponent, spinning } = store, { @@ -145,7 +143,8 @@ export default class FieldDefined extends Component { } } let children = []; - if (containerInitFinished.init && containerInitFinished.authorized) { + const hasRight = true;//todo + if (hasRight) { const { data, onSelectedTreeNode, @@ -176,7 +175,7 @@ export default class FieldDefined extends Component { ) ] - } else if (containerInitFinished.init && !containerInitFinished.authorized) { + } else { children = [ ( diff --git a/pc4mobx/organization/stores/baseStore.js b/pc4mobx/organization/stores/baseStore.js index 0a23a00..fe5b741 100644 --- a/pc4mobx/organization/stores/baseStore.js +++ b/pc4mobx/organization/stores/baseStore.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:14:20 - * @LastEditTime: 2022-06-13 14:50:36 + * @LastEditTime: 2022-06-16 18:26:17 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/baseStore.js */ @@ -540,6 +540,7 @@ export default class HrmBaseStore { return otherParams; } + //重新计算列 convertData = (datas, target) => { let tData = [], selectedData = this.generateTableSelectedData(target); diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index e64f25f..c2950f2 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-15 18:47:39 + * @LastEditTime: 2022-06-16 18:34:18 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -648,10 +648,10 @@ export class FieldDefinedStore extends HrmBaseStore { this.tabConfig.tabs = [...tabArr]; // this.setTableEditColTitle(); this.setActiveTab(this.tabConfig, init ? '1' : !create ? this.tabConfig.activeTabKey : `${tabArr.length}`); - this.containerInitFinished = { - ...this.containerInitFinished, - init: true - } + // this.containerInitFinished = { + // ...this.containerInitFinished, + // init: true + // } } } else { message.error(data.message); @@ -696,38 +696,38 @@ export class FieldDefinedStore extends HrmBaseStore { if (this.selectedTreeNodeInfo != null) params.groupType = this.selectedTreeNodeInfo.key this.spinning = true; - api.getFieldDefinedInfo(this.moduleName, params).then(data => { - if (data.status === '1') { + + api.getFieldDefinedInfo(this.moduleName, params).then(response => { + return response.json() + }).then(res => { + if (res.code === 200) { const { datas, selectedData - } = this.convertData(data.data, 'fieldDef'); - this.encryptEnable = data.encryptEnable; + } = this.convertData(res.data.data, 'fieldDef'); + this.encryptEnable = res.data.encryptEnable; this.tableEditConfig.fieldDef.datas = datas; this.tableEditConfig.fieldDef.columns = this.getColumns(); - - //人员卡片字段定义columns是动态的,因此需要重新计算得出selectedData - if (this.moduleName === 'resourcefielddefined') { - const { - selectedData - } = this.convertData(data.data, 'fieldDef'); - this.tableEditConfig.fieldDef.selectedData = selectedData; - } else { - this.tableEditConfig.fieldDef.selectedData = selectedData; - } + this.tableEditConfig.fieldDef.selectedData = selectedData; if (this.tabRecord.length > 0) { - this.tabRecord[this.activeTabInfo.activeTabIndex].editable = (data.data.length === 0); - this.activeTabInfo.tabInfo.editable = (data.data.length === 0); + this.tabRecord[this.activeTabInfo.activeTabIndex].editable = (res.data.data.length === 0); + this.activeTabInfo.tabInfo.editable = (res.data.data.length === 0); } - } else - message.error(data.message); + } else { + message.warning(res.msg); + } this.spinning = false; this.refreshMainTabComponent = new Date().getTime(); - }, error => { this.spinning = false; }) + }).catch(error => { + this.spinning = false; + message.warning(error.msg); + }) + + } - @action onTabEdit = (targetKey, action) => { + @action("分组tab删除") onTabEdit = (targetKey, action) => { const tabIndex = this.getTabIndex(this.tabConfig.tabs, targetKey); if (tabIndex < 0) return; const tabInfo = this.tabConfig.tabs[tabIndex]; @@ -741,18 +741,19 @@ export class FieldDefinedStore extends HrmBaseStore { } if (this.selectedTreeNodeInfo != null) params.groupType = this.selectedTreeNodeInfo.key - api.removeGroupInfo(this.moduleName, params).then(data => { - if (data.status === '1') { + + api.removeGroupInfo(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { message.success(i18n.message.deleteSuccess()); this.tabConfig.activeTabKey = '1'; - // if (this.moduleName.indexOf('resource') >= 0) - // this.getTabInfoByTreeNode(); - // else - // this.initData(); this.getTabInfoByTreeNode(); } else { - message.error(data.message); + message.warning(data.msg); } + }).catch(error => { + message.warning(error.msg); }) } }); @@ -819,10 +820,10 @@ export class FieldDefinedStore extends HrmBaseStore { this.formTarget.typeInfoFrom.updateFields({ name: { value: data.name } }); - }else { + } else { this.selectedTreeNodeInfo.domid = null; } - + this.setDialogVisible('editTypeInfo', true, dialogTitle); } @@ -877,7 +878,6 @@ export class FieldDefinedStore extends HrmBaseStore { @action("保存类型") doSaveTypeInfo = () => { this.formTarget.typeInfoFrom.validateForm().then(f => { if (f.isValid) { - debugger let params = { ... this.formTarget.typeInfoFrom.getFormParams(), id: this.selectedTreeNodeInfo.domid @@ -1019,18 +1019,20 @@ export class FieldDefinedStore extends HrmBaseStore { return; } - api.saveFieldDefinedInfo(this.moduleName, params).then(data => { - if (data.status === '1') { + api.saveFieldDefinedInfo(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { message.success(i18n.message.saveSuccess()); - // if (this.moduleName.indexOf('resource') >= 0) this.getTabInfoByTreeNode(); - // else - // this.initData(); } else { - message.error(data.message); + message.warning(data.msg); } this.spinning = false; - }, error => { this.spinning = false; }) + }).catch(error => { + message.warning(error.msg); + }) + } else { message.error(i18n.confirm.displayOrDBFieldExist()); this.spinning = false; @@ -1243,7 +1245,7 @@ export class FieldDefinedStore extends HrmBaseStore { return sel; } - doSaveGroupSetting = () => { + @action("分组维护保存") doSaveGroupSetting = () => { this.recordOP(this.editTable['groupSetting'], 'valid'); let groupNameArr = [], tabArr = []; @@ -1270,26 +1272,27 @@ export class FieldDefinedStore extends HrmBaseStore { } params.data = dataObj; - api.saveGroupInfo(this.moduleName, params).then(data => { - if (data.status === '1') { + api.saveGroupSettingInfo(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { this.setDialogVisible('groupInfoSetting', false, ''); - // if (this.moduleName.indexOf('resource') >= 0) this.getTabInfoByTreeNode(false, true); - // else - // this.initData(false, true); message.success(i18n.message.saveSuccess()); - } else - message.error(data.message); - }, error => { - message.error(i18n.message.actionError()); - }); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) } else { message.error(i18n.confirm.groupNameExist()); } } - @action onGroupSettingDeleteOpr = (ks, ds, type) => { + @action("分组维护中删除") onGroupSettingDeleteOpr = (ks, ds, type) => { + debugger let ids = []; ds.map(d => { if (has(d, 'id')) @@ -1315,7 +1318,7 @@ export class FieldDefinedStore extends HrmBaseStore { } else { } } - //人员卡片字段定义部分 + //字段定义部分 @observable refreshTree = new Date().getTime(); @observable treeConfig = { data: [], @@ -1330,7 +1333,7 @@ export class FieldDefinedStore extends HrmBaseStore { this.getTabInfoByTreeNode(null, true); } } - //人员卡片字段定义-选中树节点的信息 + //选中树节点的信息 @observable selectedTreeNodeInfo; //计算【工作信息】树节点以及子节点的domid @@ -1378,10 +1381,10 @@ export class FieldDefinedStore extends HrmBaseStore { this.treeConfig.treeExpandKeys.length = 0; api.getTree(this.moduleName).then(res => { if (res.code === 200) { - this.containerInitFinished = { - ...this.containerInitFinished, - init: true - } + // this.containerInitFinished = { + // ...this.containerInitFinished, + // init: true + // } if (res.data.length > 0) { this.treeConfig.data = res.data; this.treeConfig.selectedKeys = [res.data[0].key]; @@ -1434,21 +1437,23 @@ export class FieldDefinedStore extends HrmBaseStore { this.tableEditConfig.childInfoSetting.showAdd = true; this.tableEditConfig.childInfoSetting.showDelete = true; let domid = this.selectedTreeNodeInfo.domid; - //非基本类型() - (domid != '-1' && domid != '-2' && domid != '-3' && domid != '-4') && t.topButtonDef.push({ + t.topButtonDef.push({ comType: 'button', type: 'primary', onClickHandle: this.doChildInfoSetting, label: i18n.button.childInfoMaintain(), - icon: this.menuIconCollection.setting, - checkAction: 'childInfoOperability' - }) && t.topButtonDef.push({ + icon: this.menuIconCollection.setting + //checkAction: 'childInfoOperability' + }); + //非基本类型() + (domid != '-1' && domid != '-2' && domid != '-3' && domid != '-4') && t.topButtonDef.push({ comType: 'button', type: 'primary', onClickHandle: this.removeTypeInfo, label: i18n.button.delete(), icon: this.menuIconCollection.setting }); + } else { this.tableEditConfig.childInfoSetting.showTitle = false; this.tableEditConfig.childInfoSetting.showAdd = false; @@ -1462,6 +1467,8 @@ export class FieldDefinedStore extends HrmBaseStore { }) } + + if (this.selectedTreeNodeInfo.domid === '-1' || this.selectedTreeNodeInfo.addChild) { this.tableEditConfig.fieldDef.columns[2].com[0].options = remove(this.tableEditConfig.fieldDef.columns[1].com[0].options, (v) => v != 'upload'); } else { @@ -1550,7 +1557,7 @@ export class FieldDefinedStore extends HrmBaseStore { - @action doSaveChildInfo = () => { + @action("编辑子信息保存(f)") doSaveChildInfo = () => { this.formTarget.childInfoForm.validateForm().then(f => { if (f.isValid) { let record = { @@ -1625,7 +1632,8 @@ export class FieldDefinedStore extends HrmBaseStore { }, error => { message.error(i18n.message.actionError()); }); - // } + + } else { f.showErrors(); this.showError = new Date().getTime(); @@ -1633,7 +1641,7 @@ export class FieldDefinedStore extends HrmBaseStore { }); } - @action doChildInfoSetting = () => { + @action("子信息维护") doChildInfoSetting = () => { this.tableEditConfig.childInfoSetting.datas.length = 0; let arr = []; if (!this.selectedTreeNodeInfo.addChild) { @@ -1653,6 +1661,7 @@ export class FieldDefinedStore extends HrmBaseStore { } }) } else { + this.selectedTreeNodeInfo.childs = this.selectedTreeNodeInfo.childs ? this.selectedTreeNodeInfo.childs : []; this.selectedTreeNodeInfo.childs.map(child => { let viewAttr = child.viewAttr; if (viewAttr != 1 && has(child, 'editable')) { @@ -1698,6 +1707,7 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('childInfoSetting', true, i18n.button.childInfoMaintain()); } + convertAttr = (cloneTree) => { let arr = []; cloneTree.map(root => { @@ -1763,7 +1773,8 @@ export class FieldDefinedStore extends HrmBaseStore { }); } - doSaveChildInfoSetting = () => { + @action("保存子信息维护") doSaveChildInfoSetting = () => { + debugger this.recordOP(this.editTable['childInfoSetting'], 'valid'); let infoNameArr = [], infoArr = []; @@ -1772,7 +1783,7 @@ export class FieldDefinedStore extends HrmBaseStore { infoArr.push({ id: group.id, isShow: group.isShow == null ? '0' : group.isShow, - name: group.name + groupName: group.name }) return group.name === ''; }) @@ -1802,30 +1813,35 @@ export class FieldDefinedStore extends HrmBaseStore { }) }) } - const params = { - data: JSON.stringify({ - records: this.convertAttr(cloneTree) - }), + // data: JSON.stringify({ + // records: this.convertAttr(cloneTree) + // }), + data: JSON.stringify(infoArr), parentId } - api.saveTree(params).then(data => { - if (data.status === '1') { + + api.saveTree(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { this.setDialogVisible('childInfoSetting', false, ''); this.getTree(); this.getTabInfoByTreeNode(null, true); message.success(i18n.message.saveSuccess()); - } else - message.error(data.message); - }, error => { + } else { + message.warning(data.msg); + } + }).catch(error => { message.error(i18n.message.actionError()); - }); + }) + } else { message.error(i18n.confirm.groupNameExist()); } } - //移动到组 - @action dropdownClick = (e) => { + + @action("移动到组") dropdownClick = (e) => { switch (e.key) { case 'createAndMove': this.editGroup(null, true); From 1dce4484278bac500223072199516f00f17e4921 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 17 Jun 2022 18:06:07 +0800 Subject: [PATCH 023/155] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/fieldDefined.js | 24 ++- pc4mobx/organization/stores/baseStore.js | 6 +- pc4mobx/organization/stores/fieldDefined.js | 177 ++++++++++---------- 3 files changed, 116 insertions(+), 91 deletions(-) diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js index 8306fbb..155fb2a 100644 --- a/pc4mobx/organization/apis/fieldDefined.js +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -12,7 +12,7 @@ export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getFieldDefinedInfo`, 'GET', params) export const saveFieldDefinedInfo = (moduleName,params) => { - return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveFields`, { method: 'POST', mode: 'cors', headers: { @@ -22,7 +22,16 @@ export const saveFieldDefinedInfo = (moduleName,params) => { }) } -export const removeFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/del`, 'POST', params) +export const removeFieldDefinedInfo = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/del`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} export const saveGroupInfo = (moduleName,params) => { return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, { @@ -83,6 +92,17 @@ export const saveTree = (moduleName,params) => { }) } +export const deleteTree = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/deleteTree`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + export const changeGroup = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/changeGroup`, 'POST', params) export const getEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/getEncryptFieldSettingForm`, 'GET', params) diff --git a/pc4mobx/organization/stores/baseStore.js b/pc4mobx/organization/stores/baseStore.js index fe5b741..4801715 100644 --- a/pc4mobx/organization/stores/baseStore.js +++ b/pc4mobx/organization/stores/baseStore.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:14:20 - * @LastEditTime: 2022-06-16 18:26:17 + * @LastEditTime: 2022-06-17 10:59:30 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/baseStore.js */ @@ -539,8 +539,8 @@ export default class HrmBaseStore { } return otherParams; } - - //重新计算列 + + convertData = (datas, target) => { let tData = [], selectedData = this.generateTableSelectedData(target); diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index c2950f2..b1c4fe6 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-16 18:34:18 + * @LastEditTime: 2022-06-17 18:05:13 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -202,7 +202,7 @@ export class FieldDefinedStore extends HrmBaseStore { label: '', type: 'INPUT', key: 'fieldname', - viewAttr: '3', + viewAttr: '1', otherParams: { length: 25, regExp: /^[a-zA-Z][a-zA-Z0-9]*$/, @@ -222,7 +222,7 @@ export class FieldDefinedStore extends HrmBaseStore { key: 'fieldType', useRecord: true, colSpan: 1, - width: (this.moduleName === 'resourcefielddefined' && !this.isJobTreeNode) ? "30%" : "40%", + width: "30%", com: [{ label: '', type: 'CUSTOMFIELD', @@ -386,13 +386,13 @@ export class FieldDefinedStore extends HrmBaseStore { getColumns = () => { let columns = cloneDeep(this.fieldDefColumns()) - if (this.moduleName.indexOf('resource') >= 0) { - columns[1].com = [{ - label: '', - type: 'TEXT', - key: 'fieldname', - }] - } + // if (this.moduleName.indexOf('resource') >= 0) { + // columns[1].com = [{ + // label: '', + // type: 'TEXT', + // key: 'fieldname', + // }] + // } return columns; } @@ -464,17 +464,6 @@ export class FieldDefinedStore extends HrmBaseStore { if (this.dialogParams.groupInfoSetting.visible) { let logType = ''; - switch (this.moduleName) { - case 'subcompanyfielddefined': - logType = 'HRM_ENGINE_SUBCOMPANYFIELDDEFINED_GROUP'; - break; - case 'departmentfielddefined': - logType = 'HRM_ENGINE_DEPARTMENTFIELDDEFINED_GROUP'; - break; - case 'resourcefielddefined': - logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_GROUP'; - break; - } this.editorDialogRightMenu.push(...this.getBasicMenus(logType)); } @@ -697,9 +686,7 @@ export class FieldDefinedStore extends HrmBaseStore { params.groupType = this.selectedTreeNodeInfo.key this.spinning = true; - api.getFieldDefinedInfo(this.moduleName, params).then(response => { - return response.json() - }).then(res => { + api.getFieldDefinedInfo(this.moduleName, params).then(res => { if (res.code === 200) { const { datas, @@ -719,10 +706,9 @@ export class FieldDefinedStore extends HrmBaseStore { } this.spinning = false; this.refreshMainTabComponent = new Date().getTime(); - }).catch(error => { this.spinning = false; - message.warning(error.msg); - }) + this.refreshMainTabComponent = new Date().getTime(); + }, error => {this.spinning = false;}) } @@ -748,7 +734,13 @@ export class FieldDefinedStore extends HrmBaseStore { if (data.code === 200) { message.success(i18n.message.deleteSuccess()); this.tabConfig.activeTabKey = '1'; - this.getTabInfoByTreeNode(); + if(data.data === 0) { + this.getTabInfoByTreeNode(); + }else { + this.initResourceData(this.moduleName) + } + + } else { message.warning(data.msg); } @@ -951,7 +943,8 @@ export class FieldDefinedStore extends HrmBaseStore { }); } - @action saveFieldDefine = () => { + @action("保存按钮") saveFieldDefine = () => { + if (this.spinning) return; this.spinning = true; @@ -984,18 +977,21 @@ export class FieldDefinedStore extends HrmBaseStore { let fieldlabel = d.fieldlabel || '', fieldname = d.fieldname || ''; - if (fieldlabel === '' || (this.moduleName != 'resourcefielddefined' && fieldname === '')) { + if (fieldlabel === '' ) { return true; } labelArr.push(getCurrentLabel(d.fieldlabel)); nameArr.push(d.fieldname); return false; }) - let checkSame = false; - if (this.moduleName.indexOf('resource') >= 0) - checkSame = uniq(labelArr).length === data.length; - else - checkSame = uniq(labelArr).length === data.length && uniq(nameArr).length === data.length; + let checkSame = true; + + //数据库字段名不校验 后端生成 + // if (this.moduleName.indexOf('resource') >= 0) + // checkSame = uniq(labelArr).length === data.length; + // else + // checkSame = uniq(labelArr).length === data.length && uniq(nameArr).length === data.length; + if (invalidEmpty) { this.spinning = false; return; @@ -1008,7 +1004,7 @@ export class FieldDefinedStore extends HrmBaseStore { if (this.selectedTreeNodeInfo != null) dataObj.groupType = this.selectedTreeNodeInfo.key; let params = { - data: JSON.stringify(dataObj) + data: dataObj } if (this.selectedTreeNodeInfo != null) params.groupType = this.selectedTreeNodeInfo.key; @@ -1040,20 +1036,20 @@ export class FieldDefinedStore extends HrmBaseStore { } @action onEdit = (keys, datas, c, dataIndex) => { - if (dataIndex === 'fieldlabel' && this.moduleName != 'resourcefielddefined') { + if (dataIndex === 'fieldlabel') { const oldRecord = this.tableEditConfig.fieldDef.datas[keys[0]]; if (has(oldRecord, 'com') && has(oldRecord.com, 'fieldname') && oldRecord.com.fieldname.length > 0 && oldRecord.com.fieldname[0].type === 'TEXT') { return; } - this.getPinYin({ labelName: getCurrentLabel(datas[0].fieldlabel) }).then(data => { - const { pinyin } = data; - oldRecord.fieldname = pinyin; - const arr = filter(this.tableEditConfig.fieldDef.datas, { fieldname: pinyin }); - if (arr.length > 1 && pinyin != '') { - oldRecord.fieldname = pinyin + '1'; - } - this.refreshFeildDef = new Date().getTime(); - }); + // this.getPinYin({ labelName: getCurrentLabel(datas[0].fieldlabel) }).then(data => { + // const { pinyin } = data; + // oldRecord.fieldname = pinyin; + // const arr = filter(this.tableEditConfig.fieldDef.datas, { fieldname: pinyin }); + // if (arr.length > 1 && pinyin != '') { + // oldRecord.fieldname = pinyin + '1'; + // } + // this.refreshFeildDef = new Date().getTime(); + // }); } } @action onAdd = (keys, datas) => { @@ -1292,7 +1288,7 @@ export class FieldDefinedStore extends HrmBaseStore { } @action("分组维护中删除") onGroupSettingDeleteOpr = (ks, ds, type) => { - debugger + let ids = []; ds.map(d => { if (has(d, 'id')) @@ -1407,6 +1403,8 @@ export class FieldDefinedStore extends HrmBaseStore { if (p.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = p; p.childs && p.childs.map(c => { + + console.log(this.treeConfig.selectedKeys[0]) if (c.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = c; }) @@ -1437,7 +1435,10 @@ export class FieldDefinedStore extends HrmBaseStore { this.tableEditConfig.childInfoSetting.showAdd = true; this.tableEditConfig.childInfoSetting.showDelete = true; let domid = this.selectedTreeNodeInfo.domid; - t.topButtonDef.push({ + + let defaultType = domid != '1' && domid != '2' && domid != '3' && domid != '4' + + defaultType && t.topButtonDef.push({ comType: 'button', type: 'primary', onClickHandle: this.doChildInfoSetting, @@ -1445,14 +1446,15 @@ export class FieldDefinedStore extends HrmBaseStore { icon: this.menuIconCollection.setting //checkAction: 'childInfoOperability' }); - //非基本类型() - (domid != '-1' && domid != '-2' && domid != '-3' && domid != '-4') && t.topButtonDef.push({ - comType: 'button', - type: 'primary', - onClickHandle: this.removeTypeInfo, - label: i18n.button.delete(), - icon: this.menuIconCollection.setting - }); + + // defaultType && !this.tableEditConfig.childInfoSetting.hasGroup && t.topButtonDef.push({ + // comType: 'button', + // type: 'primary', + // onClickHandle: this.removeTypeInfo, + // label: i18n.button.delete(), + // icon: this.menuIconCollection.setting + // }) + } else { this.tableEditConfig.childInfoSetting.showTitle = false; @@ -1514,7 +1516,7 @@ export class FieldDefinedStore extends HrmBaseStore { this.refreshMainTabComponent = new Date().getTime(); } } else { - message.error(data.message); + message.error(res.message); } }) } @@ -1554,9 +1556,6 @@ export class FieldDefinedStore extends HrmBaseStore { this.setDialogVisible('createChildInfo', true, dialogTitle); } - - - @action("编辑子信息保存(f)") doSaveChildInfo = () => { this.formTarget.childInfoForm.validateForm().then(f => { if (f.isValid) { @@ -1644,6 +1643,7 @@ export class FieldDefinedStore extends HrmBaseStore { @action("子信息维护") doChildInfoSetting = () => { this.tableEditConfig.childInfoSetting.datas.length = 0; let arr = []; + if (!this.selectedTreeNodeInfo.addChild) { arr.push({ "record": { @@ -1733,48 +1733,56 @@ export class FieldDefinedStore extends HrmBaseStore { return arr; } - removeChildInfo = () => { + @action("删除树信息") removeTypeInfo = () => { this.confirmInfo({ content: i18n.confirm.deleteSelected(), onOk: () => { - let parentId; - let cloneTree = cloneDeep(this.toJS(this.treeConfig.data)); - cloneTree.map(p => { - p.childs && p.childs.map((c, i) => { - if (c.domid === this.selectedTreeNodeInfo.domid) { - parentId = p.domid; - p.childs.splice(i, 1); - } - }) - }) + // let parentId; + // let cloneTree = cloneDeep(this.toJS(this.treeConfig.data)); + // cloneTree.map(p => { + // p.childs && p.childs.map((c, i) => { + // if (c.domid === this.selectedTreeNodeInfo.domid) { + // parentId = p.domid; + // p.childs.splice(i, 1); + // } + // }) + // }) + // const params = { + // data: JSON.stringify({ + // records: this.convertAttr(cloneTree) + // }), + // parentId + // } const params = { - data: JSON.stringify({ - records: this.convertAttr(cloneTree) - }), - parentId + id: this.selectedTreeNodeInfo.domid } - api.saveTree(params).then(data => { - if (data.status === '1') { + + api.deleteTree(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { message.success(i18n.message.deleteSuccess()); this.getTree(() => { - this.treeConfig.selectedKeys = ['-1']; + this.treeConfig.selectedKeys = ['1']; this.selectedTreeNodeInfo = this.treeConfig.data[0]; this.getTabInfoByTreeNode(null, true); }); // this.treeConfig.selectedKeys = [this.treeConfig.data[0].key]; // this.selectedTreeNodeInfo = this.treeConfig.data[0]; // this.getTabInfoByTreeNode(null, true); - } else - message.error(data.message); - }, error => { + } else { + message.warning(data.msg); + } + }).catch(error => { message.error(i18n.message.actionError()); - }); + }) + + } }); } @action("保存子信息维护") doSaveChildInfoSetting = () => { - debugger this.recordOP(this.editTable['childInfoSetting'], 'valid'); let infoNameArr = [], infoArr = []; @@ -1814,9 +1822,6 @@ export class FieldDefinedStore extends HrmBaseStore { }) } const params = { - // data: JSON.stringify({ - // records: this.convertAttr(cloneTree) - // }), data: JSON.stringify(infoArr), parentId } From ed990bcfb20ad59f1a2909bec1c28b7eebe9fd3e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 20 Jun 2022 11:08:19 +0800 Subject: [PATCH 024/155] =?UTF-8?q?=E5=AE=8C=E6=88=90v1.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/fieldDefined.js | 11 ++++- pc4mobx/organization/stores/fieldDefined.js | 48 +++++++++------------ 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js index 155fb2a..0d550c1 100644 --- a/pc4mobx/organization/apis/fieldDefined.js +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -103,7 +103,16 @@ export const deleteTree = (moduleName,params) => { }) } -export const changeGroup = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/changeGroup`, 'POST', params) +export const changeGroup = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeGroup`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} export const getEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/getEncryptFieldSettingForm`, 'GET', params) diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index b1c4fe6..cc230f6 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-17 18:05:13 + * @LastEditTime: 2022-06-20 11:07:43 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -50,7 +50,7 @@ export class FieldDefinedStore extends HrmBaseStore { //override baseStore.tabConfig tabDef = { color: '#000000', - groupId: '', + //groupId: '', viewCondition: '1', topButtonDef: [{ comType: 'button', @@ -138,9 +138,14 @@ export class FieldDefinedStore extends HrmBaseStore { isDropBtn: true } ] - if (this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1) { + // if (this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1) { + // datas.splice(2, 1); + // } + + if (this.selectedTreeNodeInfo != null && !this.selectedTreeNodeInfo.addChild) { datas.splice(2, 1); } + return datas; } dropdownProps = () => ({ @@ -635,7 +640,7 @@ export class FieldDefinedStore extends HrmBaseStore { }); if (tabArr.length > 0) { this.tabConfig.tabs = [...tabArr]; - // this.setTableEditColTitle(); + //this.setTableEditColTitle(); this.setActiveTab(this.tabConfig, init ? '1' : !create ? this.tabConfig.activeTabKey : `${tabArr.length}`); // this.containerInitFinished = { // ...this.containerInitFinished, @@ -1403,8 +1408,6 @@ export class FieldDefinedStore extends HrmBaseStore { if (p.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = p; p.childs && p.childs.map(c => { - - console.log(this.treeConfig.selectedKeys[0]) if (c.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = c; }) @@ -1446,16 +1449,6 @@ export class FieldDefinedStore extends HrmBaseStore { icon: this.menuIconCollection.setting //checkAction: 'childInfoOperability' }); - - // defaultType && !this.tableEditConfig.childInfoSetting.hasGroup && t.topButtonDef.push({ - // comType: 'button', - // type: 'primary', - // onClickHandle: this.removeTypeInfo, - // label: i18n.button.delete(), - // icon: this.menuIconCollection.setting - // }) - - } else { this.tableEditConfig.childInfoSetting.showTitle = false; this.tableEditConfig.childInfoSetting.showAdd = false; @@ -1470,7 +1463,6 @@ export class FieldDefinedStore extends HrmBaseStore { } - if (this.selectedTreeNodeInfo.domid === '-1' || this.selectedTreeNodeInfo.addChild) { this.tableEditConfig.fieldDef.columns[2].com[0].options = remove(this.tableEditConfig.fieldDef.columns[1].com[0].options, (v) => v != 'upload'); } else { @@ -1853,7 +1845,7 @@ export class FieldDefinedStore extends HrmBaseStore { break; default: const groupid = e.key; - const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, { groupid })]; + const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, {groupid })]; let moveFieldConfirm = i18n.confirm.moveFieldConfirm().replace('{params}', tabInfo.title); this.changeGroup(moveFieldConfirm, groupid); } @@ -1880,7 +1872,7 @@ export class FieldDefinedStore extends HrmBaseStore { }) } else { Object.assign(params, { - ids: ids.join(','), + fieldids: ids.join(','), groupid }); } @@ -1895,16 +1887,18 @@ export class FieldDefinedStore extends HrmBaseStore { } @action doChangeGroup = (params) => { - api.changeGroup(this.moduleName, params).then(data => { - if (data.status === '1') { + api.changeGroup(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { message.success(i18n.message.moveSuccess()); - // if (this.moduleName.indexOf('resource') >= 0) this.getTabInfoByTreeNode(); - // else - // this.initData(); - } else - message.error(data.message); - }, error => { message.error(i18n.message.actionError()); }); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.error(i18n.message.actionError()); + }) } @observable encryptDialogVisible = false; From 74d55222397d423ef6fc71918a7198180d6a847f Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 20 Jun 2022 17:08:10 +0800 Subject: [PATCH 025/155] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/resource.js | 64 +++ .../components/resource/ResourceExtend.js | 0 .../components/resource/resource.js | 448 ++++++++++++++++++ pc4mobx/organization/index.js | 2 + pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/index.js | 4 +- pc4mobx/organization/stores/resource.js | 316 ++++++++++++ pc4mobx/organization/stores/resourceExtend.js | 0 8 files changed, 834 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/organization/apis/resource.js create mode 100644 pc4mobx/organization/components/resource/ResourceExtend.js create mode 100644 pc4mobx/organization/components/resource/resource.js create mode 100644 pc4mobx/organization/stores/resource.js create mode 100644 pc4mobx/organization/stores/resourceExtend.js diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js new file mode 100644 index 0000000..c3fff25 --- /dev/null +++ b/pc4mobx/organization/apis/resource.js @@ -0,0 +1,64 @@ + +import { + WeaTools +} from 'ecCom' + +export const getSearchList = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTable', 'GET', params); +} + +export const deleteTableData = (params) => { + return fetch('/api/bs/hrmorganization/scheme/deleteByIds', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const getAdvanceSearchCondition = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSearchCondition', 'GET', params); +} + +export const add = (params) => { + return fetch('/api/bs/hrmorganization/scheme/save', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const edit = (params) => { + return fetch('/api/bs/hrmorganization/scheme/updateScheme', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const updateForbiddenTag = (params) => { + return fetch('/api/bs/hrmorganization/scheme/updateForbiddenTagById', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const getSchemeForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSchemeForm', 'GET', params); +} + +export const getHasRight = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/resource/ResourceExtend.js b/pc4mobx/organization/components/resource/ResourceExtend.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js new file mode 100644 index 0000000..26ac068 --- /dev/null +++ b/pc4mobx/organization/components/resource/resource.js @@ -0,0 +1,448 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, + WeaLeftRightLayout, + WeaOrgTree, +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch, + Menu, Dropdown, Icon +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; + +import NewAndEditDialog from '../NewAndEditDialog'; +import { renderNoright } from '../../util'; + + + +const toJS = mobx.toJS; +const confirm = Modal.confirm; +const WeaTable = WeaTableNew.WeaTable; + + +@inject('resource') +@observer +export default class Resource extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + const { + resource + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + resource + } = this.props; + resource.getTableInfo(); + resource.getHasRight(); + } + + //左侧树 + getTree = () => { + const { + resource + } = this.props; + const { + companysId, + } = resource + + let tree = ( + ${i18n.label.organization()}`} + treeNodeClick={this.treeNodeClick} + expandAllChildrenOnSearch={true} + /> + ) + + return tree; + } + + getTopMenuBtns() { + const { + resource + } = this.props; + const { + topMenu, + tableStore + } = resource; + + let btns = []; + topMenu.map((item, i) => { + if (item.menuFun !== 'batchDelete') { + btns.push(); + } else { + btns.push(); + } + + }); + + return btns; + } + + handleClick(item) { + const { + resource + } = this.props; + const { + isPanelShow + } = resource; + + isPanelShow && resource.setPanelStatus(false); + this[item.menuFun] && this[item.menuFun](); + } + + new() { + const { + resource + } = this.props; + + resource.setNeDialogTitle(i18n.label.newRankScheme()); + resource.setIsNew(true); + resource.setVisible(true); + resource.getForm(); + } + + batchDelete() { + const { + resource + } = this.props; + const { + tableStore + } = resource; + + let keys = toJS(tableStore.selectedRowKeys).toString(); + resource.setIds(keys); + this.showConfirm('batchDel'); + } + showConfirm(v) { + let _this = this; + confirm({ + title: i18n.confirm.defaultTitle(), + content: (v == 'del') ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + _this.onOk(); + }, + onCancel() { + return false; + }, + }); + } + onOk() { + const { + resource + } = this.props; + resource.delete(); + } + + + getDropMenuDatas() { + const { + resource + } = this.props; + const { + rightMenu + } = resource; + + let menus = []; + toJS(rightMenu).map((item, index) => { + let obj = { + key: item.menuFun, + icon: , + content: item.menuName, + } + if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { + obj.disabled = true; + } + menus.push(obj); + }) + return menus; + } + + handleMenuClick(key) { + const { + resource + } = this.props; + const { + isPanelShow + } = resource; + + isPanelShow && resource.setPanelStatus(false); + this[key] && this[key](); + } + + getTabBtn() { + const { + resource + } = this.props; + const { + form2 + } = resource; + + const btn = [ + (), + (), + (), + ]; + + return btn; + } + + custom = () => { + const { + resource + } = this.props, { + tableStore, + } = resource; + + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + } + + onSearchChange(val) { + const { + resource + } = this.props; + const { + form2 + } = resource; + + resource.setSchemeName(val); + !this.isEmptyObject(form2.getFormParams()) && resource.updateFields(val); + } + + reRenderColumns(columns) { + let _this = this; + columns.forEach((c, index) => { + //todo + }) + } + + updateForbiddenTag(checked, id) { + const { + resource + } = this.props; + resource.updateForbiddenTag(checked, id); + } + + onOperatesClick(record, rowIndex, operate) { + const { + index + } = operate; + (index == '0') && this.doEdit(record.randomFieldId); + (index == '1') && this.doDel(record.randomFieldId); + + } + + doEdit(id) { + const { + resource + } = this.props; + + resource.setNeDialogTitle(i18n.label.editRankScheme()); + resource.setSchemeId(id); + resource.setIsNew(false); + resource.setVisible(true); + resource.getForm(); + } + + doDel(id) { + const { + resource + } = this.props; + resource.setIds(id); + this.showConfirm('del'); + } + + + handleSave() { + const { + resource + } = this.props; + const { + isNew + } = resource; + + isNew && resource.save(); + !isNew && resource.edit(); + } + + getPanelComponents() { + const { + resource + } = this.props; + const { + searchCondition, + form2, + searchConditionLoading + } = resource; + + let arr = []; + let formParams = form2.getFormParams(); + const { + isFormInit + } = form2; + + isFormInit && searchCondition.map(c => { + c.items.map((field, index) => { + arr.push( +
+ + {} + +
+ ) + }) + }) + + if (searchConditionLoading) { + return ( +
+ +
+ ) + } else { + return { + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + resource.getTableInfo(); + resource.setPanelStatus(false) + } + }}>{arr} + } + + } + + //非空判断 + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + + + + render() { + + const { + resource + } = this.props; + const { + isPanelShow, form2, schemeName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, date, hasRight,defaultShowLeft + } = resource; + + if (hasRight === false) { + return renderNoright(); + } + + return ( + hasRight &&
+ this.handleMenuClick(key)} + > + } + iconBgcolor='#217346' + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={(e) => this.handleMenuClick(e)} + > + + resource.setPanelStatus(bool)} + hideSearchAd={() => resource.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => resource.getTableInfo()} + onSearchChange={val => this.onSearchChange(val)} + /> + this.reRenderColumns(c)} + onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} + /> +
+
+
+ this.handleSave()} + onCancel={() => resource.setVisible(false)} + enable={false} //是否开启字段联动 + /> +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 475b598..0217c86 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -23,6 +23,7 @@ import JobExtend from "./components/job/JobExtend"; import Department from "./components/department/department"; import DepartmentExtendStore from "./components/department/departmentExtend"; import FieldDefined from "./components/fieldDefinedSet/FieldDefined"; +import Resource from "./components/resource/resource"; import stores from "./stores"; import "./style/index"; @@ -79,6 +80,7 @@ const Routes = ( + ); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index fad5e61..9f31395 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -148,6 +148,7 @@ export const i18n = { mergeDept:()=> getLabel(386246, '合并部门'), transferDept:()=> getLabel(386246, '转移部门'), typeName: () => getLabel(129927, '类型名称'), + ResourceName: () => getLabel(385936, '人员'), authorizationGroup: () => getLabel(492, '权限组'), diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index ca229ff..7eed1b0 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -16,6 +16,7 @@ import { JobStore } from "./job"; import { JobExtendStore } from "./jobextend"; import { NumberSetStore } from "./numberSet"; import {FieldDefinedStore} from "./fieldDefined"; +import {ResourceStore} from "./resource"; module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -35,5 +36,6 @@ module.exports = { job: new JobStore(), jobExtend: new JobExtendStore(), numberSet: new NumberSetStore(), - fieldDefined: new FieldDefinedStore() + fieldDefined: new FieldDefinedStore(), + resource: new ResourceStore() }; diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js new file mode 100644 index 0000000..0a093c0 --- /dev/null +++ b/pc4mobx/organization/stores/resource.js @@ -0,0 +1,316 @@ +import { + observable, + action +} from 'mobx'; +import * as mobx from 'mobx'; +import * as Api from '../apis/resource'; // 引入API接口文件 +import { + WeaForm +} from 'comsMobx'; +import { + WeaTableNew +} from 'comsMobx'; +import { + Modal, + message, +} from 'antd' +import { + i18n +} from '../public/i18n'; + +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; + + + export class ResourceStore { + @observable tableStore = new TableStore(); + @observable topMenu = [] + @observable rightMenu = []; + @observable condition = []; + @observable searchCondition = []; + @observable isEdit = true; + @observable isNew = true; + @observable isPanelShow = false; //高级搜索面板 + @observable form2 = new WeaForm(); + @observable form = new WeaForm(); + @observable form1 = new WeaForm(); + @observable schemeName = ''; + @observable conditionNum = 2; + @observable ids = ''; //选择行id + @observable searchConditionLoading = true; + @observable nEdialogTitle = ''; + @observable visible = false; + @observable dialogLoading = true; + @observable schemeId = ''; + @observable date = ''; + + @observable defaultShowLeft = true; + @observable companysId = 1 + @observable hasRight = ''; + + + @action + getTableInfo() { + let params; + this.tableStore = new TableStore(); + if (this.isEmptyObject(this.form2.getFormParams())) { + params = { + ...this.form2.getFormParams(), + schemeName: this.schemeName + }; + } else { + params = { + ...this.form2.getFormParams() + }; + } + Api.getSearchList(params).then(res => { + if (res.code === 200) { + this.setHasRight(res.data.hasRight); + res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + } + + //删除 + delete() { + let params = { + ids: this.ids + }; + Api.deleteTableData(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(i18n.message.deleteSuccess()); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }) + .catch(error => { + message.warning(error.msg); + }) + } + + save() { + let params = { + ...this.form.getFormParams() + }; + this.form.validateForm().then(f => { + if (f.isValid) { + Api.add(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + edit() { + let params = { ...this.form.getFormParams(), id: this.schemeId }; + this.form.validateForm().then(f => { + if (f.isValid) { + Api.edit(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + updateForbiddenTag(checked, id) { + let params = { + forbiddenTag: checked, + id: id + } + Api.updateForbiddenTag(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + + } + + getForm() { + let params = this.isNew ? {} : { + id: this.schemeId + } + this.setDialogLoadingStatus(true); + + Api.getSchemeForm(params).then(res => { + if (res.code === 200) { + this.setDialogLoadingStatus(false); + res.data.condition && this.setCondition(res.data.condition); + res.data.condition && this.form.initFormFields(res.data.condition); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + } + + getSearchCondition() { + this.setScLoadingStatus(false); + Api.getAdvanceSearchCondition().then(res => { + if (res.code === 200) { + this.setScLoadingStatus(false); + res.data.conditions && this.setSearchCondition(res.data.conditions); + res.data.conditions && this.form2.initFormFields(res.data.conditions); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + + @action + getHasRight() { + Api.getHasRight().then(res => { + if (res.code === 200) { + res.data.rightMenu && this.setRightMenu(res.data.rightMenu); + res.data.topMenu && this.setTopMenu(res.data.topMenu); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + updateFields(val) { + this.form2.updateFields({ + schemeName: { + value: val + } + }); + } + + setSearchCondition(condition) { + this.searchCondition = condition; + } + + setScLoadingStatus(bool) { + this.searchConditionLoading = bool; + } + + setPanelStatus(bool) { + this.isPanelShow = bool; + bool && this.getSearchCondition(); + if (!bool) { + this.scLoadingReset(); + } + } + + setSchemeName(val) { + this.schemeName = val; + } + + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + setIds(ids) { + this.ids = ids; + } + + scLoadingReset() { + this.searchConditionLoading = true; + } + + + formReset() { + this.form = new WeaForm(); + } + + dialogLoadingReset() { + this.dialogLoading = true; + } + + setVisible(bool) { + this.visible = bool; + this.formReset(); + !bool && this.dialogLoadingReset(); + } + + setDialogLoadingStatus(bool) { + this.dialogLoading = bool; + } + + setNeDialogTitle(title) { + this.nEdialogTitle = title; + } + + setIsNew(bool) { + this.isNew = bool; + } + + setCondition(condition) { + this.condition = condition; + } + + setSchemeId(schemeId) { + this.schemeId = schemeId; + } + + @action + setDate(date) { + this.date = date; + } + + setTopMenu(topMenu) { + this.topMenu = topMenu; + } + + setRightMenu(rightMenu) { + this.rightMenu = rightMenu; + } + + setHasRight(bool) { + this.hasRight = bool; + } + + + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/resourceExtend.js b/pc4mobx/organization/stores/resourceExtend.js new file mode 100644 index 0000000..e69de29 From 32a0c9cbd2c9b888fee7a7aa766d386136894f3a Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 21 Jun 2022 18:39:50 +0800 Subject: [PATCH 026/155] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/resource.js | 16 +- .../components/postionrank/RankScheme.js | 15 +- .../components/resource/ResourceExtend.js | 282 ++++++++++++++++++ .../components/resource/resource.js | 15 +- pc4mobx/organization/index.js | 2 + pc4mobx/organization/public/i18n.js | 5 + pc4mobx/organization/stores/index.js | 4 +- pc4mobx/organization/stores/resource.js | 4 +- pc4mobx/organization/stores/resourceExtend.js | 237 +++++++++++++++ 9 files changed, 568 insertions(+), 12 deletions(-) diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index c3fff25..bd794ec 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -4,7 +4,7 @@ import { } from 'ecCom' export const getSearchList = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTable', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params); } export const deleteTableData = (params) => { @@ -23,7 +23,7 @@ export const getAdvanceSearchCondition = (params) => { } export const add = (params) => { - return fetch('/api/bs/hrmorganization/scheme/save', { + return fetch('/api/bs/hrmorganization/hrmresource/saveBaseForm', { method: 'POST', mode: 'cors', headers: { @@ -56,9 +56,17 @@ export const updateForbiddenTag = (params) => { } export const getSchemeForm = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSchemeForm', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSaveForm', 'GET', params); } export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params); -} \ No newline at end of file +} + +export const editResource = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/updateForm', 'POST', params); +} + +export const getResourceExtendForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params); +} diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 2289d6f..86e8ab6 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -239,10 +239,23 @@ export default class RankScheme extends React.Component { } updateForbiddenTag(checked, id) { + debugger const { rankScheme } = this.props; - rankScheme.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == '0') ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + rankScheme.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); + } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/resource/ResourceExtend.js b/pc4mobx/organization/components/resource/ResourceExtend.js index e69de29..a241998 100644 --- a/pc4mobx/organization/components/resource/ResourceExtend.js +++ b/pc4mobx/organization/components/resource/ResourceExtend.js @@ -0,0 +1,282 @@ +/** + * @Author: 程亮 + * @Date: 2022-06-20 14:59:21 + * @LastEditTime: 2022-06-21 18:05:35 + * @Description: + * @FilePath: /trunk/src4js/pc4mobx/organization/components/resource/ResourceExtend.js + */ + + + import { Button, Modal, message, Row, Col, Spin } from 'antd'; + import isEmpty from 'lodash/isEmpty' + import cloneDeep from 'lodash/cloneDeep' + import forEach from 'lodash/forEach' + import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom' + import { WeaSwitch } from 'comsMobx'; + import { inject, observer } from 'mobx-react'; + import * as mobx from 'mobx'; + import { i18n } from '../../public/i18n'; + + const toJS = mobx.toJS; + import '../../style/common.less'; + + + @inject('resourceExtend') + @inject('resource') + @observer + export default class ResourceExtend extends React.Component { + + componentDidMount() { + this.init(); + } + init = () => { + const { resourceExtend,resource } = this.props; + let {hash} = window.location; + hash = hash.split("?")[0]; + let id = hash.match("[^/]+(?=/$|$)")[0]; + resourceExtend.init(); + resourceExtend.setId(id); + resourceExtend.getData(); + } + + getTabChildren = () => { + const { resourceExtend } = this.props; + let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = resourceExtend; + let tabChildren = []; + tableInfo = toJS(tableInfo); + tableInfo && tableInfo.map((t, i) => { + if (detailSelectedKey == i) { + tabChildren.push( + resourceExtend.setPersonalEditTables(ref)} + showTitle={isEditor} + // title={'列表信息'} + //addFirstRow={isEditor} + columns={t.tabinfo.columns} + datas={t.tabinfo.datas} + onChange={this.tableEditChange} + selectedRowKeys={toJS(selectedRowKeys)} + onRowSelect={keys => onRowSelect(keys)} + onBtnsSelect={key => this.onBtnsSelect(key, i)} + viewAttr={isEditor ? 2 : 1} + getRowSelection={isEditor ? (rowSelection) => { + Object.assign(rowSelection, { + getCheckboxProps: record => ({ + disabled: record.viewAttr === 1, // 配置无法勾选的列 + }) + }) + return rowSelection; + } : () => null} + /> + ); + } + }) + return tabChildren; + } + + onBtnsSelect = (key, index) => { + const { + resourceExtend + } = this.props, { + tableInfo, + selectedRows, + setSelectedRowKeys, + selectedRowKeys + } = resourceExtend; + + const datas = tableInfo[index].tabinfo.datas; + if (key === 'copy') { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (!selectedRows[index].includes(i)) { + data.viewAttr = 2; + } + return data + }) + } + if (key === 'delete') { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (selectedRows[index].includes(i)) { + data.viewAttr = 1; + } + return data + }); + setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) + } + } + + getSearchs = () => { + const { resourceExtend } = this.props; + let { form, conditions, isEditor } = resourceExtend; + const { isFormInit } = form; + let group = []; + let tipPosition = 'bottom'; + window.e9HideFormFieldKeys = []; + isFormInit && conditions.forEach((c, i) => { + let items = []; + c.items.forEach((field, j) => { + if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { + window.e9HideFormFieldKeys.push(field.domkey[0]); + } else { + items.push({ + com: ( + + ), + colSpan: 1 + }); + } + }); + group.push() + }); + return group; + } + + tableEditChange = (data) => { + const { resourceExtend } = this.props; + let { detailSelectedKey = '0', tableInfo } = resourceExtend; + tableInfo = toJS(tableInfo); + let d = cloneDeep(tableInfo); + d[Number(detailSelectedKey)].tabinfo.datas = data; + resourceExtend.updateTableInfo(d); + } + + getRightMenu = () => { + const { resourceExtend } = this.props; + const { isEditor, buttons } = resourceExtend; + let arr = []; + try { + if (buttons.hasEdit) { + if (isEditor) { + arr = [{ + icon: , + content: i18n.button.save(), + key: 'save', + onClick: key => { + this.saveEditCard(); + } + }, { + icon: , + content: i18n.button.back(), + key: 'back', + onClick: key => { + this.backCard(); + } + }] + } else { + arr = [{ + icon: , + content: i18n.button.modify(), + key: 'editCard', + onClick: key => { + this.editCard(); + } + } + ] + } + } + } catch (e) { } + return arr; + } + + getTopButtons = () => { + const { resourceExtend } = this.props; + const { isEditor, buttons } = resourceExtend; + const save = ; + const back = ; + const edit = ; + const btns = []; + try { + if (isEditor) { + if (buttons.hasSave) { + btns.push(save); + btns.push(back); + } + } else { + if (buttons.hasEdit) { + btns.push(edit); + } + } + } catch (e) { } + return btns; + } + + editCard = () => { + const { resourceExtend } = this.props; + resourceExtend.edit(); + } + + saveEditCard = () => { + const { resourceExtend } = this.props; + resourceExtend.save(); + } + + backCard = () => { + this.init(); + } + + changeData(key) { + const { + resourceExtend + } = this.props; + resourceExtend.changeData(key); + } + + render() { + const { resourceExtend } = this.props; + const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = resourceExtend; + + try { + return ( +
+ + + + + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + resourceExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ } +
+
+
+ +
+ ) + } catch (e) { + return +
{i18n.message.authFailed()}
+
+ } + } + } + + \ No newline at end of file diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 26ac068..014f296 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -86,7 +86,7 @@ export default class Resource extends React.Component { let tree = ( { - //todo + if (c.dataIndex == 'last_name') { + c.render = function (text, record) { + return { + window.open(`/spa/organization/static/index.html#/main/organization/ResourceExtend/${record.id}`, "_blank") + }}>{text} + } + } }) } @@ -363,7 +369,7 @@ export default class Resource extends React.Component { } - //非空判断 + // 非空判断 isEmptyObject(obj) { for (let key in obj) { return false; @@ -388,6 +394,7 @@ export default class Resource extends React.Component { return renderNoright(); } + return ( hasRight &&
this.handleSave()} onCancel={() => resource.setVisible(false)} diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 0217c86..bbc703d 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -24,6 +24,7 @@ import Department from "./components/department/department"; import DepartmentExtendStore from "./components/department/departmentExtend"; import FieldDefined from "./components/fieldDefinedSet/FieldDefined"; import Resource from "./components/resource/resource"; +import ResourceExtend from "./components/resource/ResourceExtend"; import stores from "./stores"; import "./style/index"; @@ -81,6 +82,7 @@ const Routes = ( + ); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 9f31395..2a44586 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -149,6 +149,7 @@ export const i18n = { transferDept:()=> getLabel(386246, '转移部门'), typeName: () => getLabel(129927, '类型名称'), ResourceName: () => getLabel(385936, '人员'), + newPeople: () => getLabel(386246, '新建人员'), authorizationGroup: () => getLabel(492, '权限组'), @@ -939,6 +940,10 @@ export const i18n = { deleteImg: () => getLabel('16075', "删除图片") }, confirm: { + forbiddenTag: () => getLabel(131329, '确定禁用该记录吗'), + enableTag: () => getLabel(131329, '确定启用该记录吗'), + + defaultTitle: () => getLabel(131329, '信息确认'), removeGroupInfo: () => getLabel(383053, '删除分组,该分组下的字段将显示到“基本信息”分组中,确定要删除吗?'), groupNameExist: () => getLabel(130074, '已存在同名分组,请确认'), diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 7eed1b0..b1c5c1d 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -17,6 +17,7 @@ import { JobExtendStore } from "./jobextend"; import { NumberSetStore } from "./numberSet"; import {FieldDefinedStore} from "./fieldDefined"; import {ResourceStore} from "./resource"; +import {ResourceExtendStore} from "./resourceExtend"; module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -37,5 +38,6 @@ module.exports = { jobExtend: new JobExtendStore(), numberSet: new NumberSetStore(), fieldDefined: new FieldDefinedStore(), - resource: new ResourceStore() + resource: new ResourceStore(), + resourceExtend: new ResourceExtendStore() }; diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 0a093c0..8dc8d88 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -48,7 +48,7 @@ const { @observable defaultShowLeft = true; @observable companysId = 1 - @observable hasRight = ''; + @observable hasRight = true; @action @@ -67,7 +67,7 @@ const { } Api.getSearchList(params).then(res => { if (res.code === 200) { - this.setHasRight(res.data.hasRight); + //this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { message.warning(res.msg); diff --git a/pc4mobx/organization/stores/resourceExtend.js b/pc4mobx/organization/stores/resourceExtend.js index e69de29..4faa146 100644 --- a/pc4mobx/organization/stores/resourceExtend.js +++ b/pc4mobx/organization/stores/resourceExtend.js @@ -0,0 +1,237 @@ +import { observable, action, toJS } from "mobx"; +import { WeaForm } from "comsMobx"; +import isEmpty from 'lodash/isEmpty' +import { WeaTableNew } from "comsMobx"; +import { Modal, message } from "antd"; +import { i18n } from "../public/i18n"; +import forEach from 'lodash/forEach' +import * as Api from '../apis/resource'; // 引入API接口文件 + + +export class ResourceExtendStore { + @observable form = new WeaForm(); + @observable tableInfo = [] + @observable conditions = []; + @observable isEditor = false; + @observable isNew = true; + @observable loading = true; + @observable tabInfo = []; + @observable selectedKey = '0'; + @observable detailSelectedKey = '0'; + @observable topTab = []; + @observable buttons = {}; + @observable id = ''; //人员id + @observable date = ''; + @observable personalEditTables; + @observable tabkey = '0' + + + @observable selectedRowKeys = []; + @observable selectedRows = []; + + @action onRowSelect = (keys) => { + this.setSelectedRowKeys(keys); + } + + @action setSelectedRowKeys = (keys) => { + this.selectedRowKeys = keys; + } + + + @action + edit = () => { + this.isEditor = true; + this.getData(); + this.getTabInfo(); + this.detailSelectedKey = '0' + } + + init = () => { + this.detailSelectedKey = '0' + this.isEditor = false; + } + + save = () => { + if (this.loading) + return; + this.loading = true; + this.form.validateForm().then(f => { + if (f.isValid) { + if (this.personalEditTables) { + const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, + isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true + if (isPass) { + this.editResource() + } else { + this.loading = false; + } + } else { + this.editResource(); + } + } else { + f.showErrors(); + this.setDate(new Date()); + this.loading = false; + } + }) + } + + editResource = () => { + let pDatas = this.form.getFormParams(); + Api.editResource({ ...{ + id: this.id + }, + ...pDatas, + ...this.getTableEditParams() + }).then(data => { + if (data.code == 200) { + message.success(i18n.message.saveSuccess()); + this.init(); + this.getData(); + this.selectedRowKeys = []; + } else { + message.warning(data.message); + } + this.loading = false; + }, error => { + message.warning(error.message); + this.loading = false; + }) + } + + getTableEditParams = () => { + const params = {}; + this.tableInfo && this.tableInfo.forEach(t => { + t.tabinfo.datas = t.tabinfo.datas || []; + params[t.tabinfo.rownum] = t.tabinfo.datas.length; + t.tabinfo && t.tabinfo.datas && t.tabinfo.datas.forEach((item, index) => { + !isEmpty(item) && forEach(item, (value, key) => { + Object.assign(params, { + [`${key}_${index}`]: value + }); + }) + }) + }) + return params + } + + + + getData = () => { + this.setLoading(true); + let params = { + viewAttr: this.isEditor ? 2 : 1, + id: this.id, + viewCondition:this.selectedKey + } + Api.getResourceExtendForm(params).then((res) => { + if (res.code === 200) { + res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); + res.data.result.conditions && this.setConditions(res.data.result.conditions); + this.tableInfo = this.handleTable(res.data.result.tables); + this.getTabInfo(); + res.data.result.buttons && this.setButtons(res.data.result.buttons); + res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo); + this.isEditor && this.getSelectedRows(); + this.setLoading(false); + + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + + + + } + + handleTable = (datas) => { + return datas && datas.map(data => { + const { tabinfo: { columns } } = data; + const length = columns.length; + columns.map(c => { + c.width = `${95 / length}%` + }) + return data + }) + } + + getTabInfo = () => { + this.tabInfo = []; + this.tableInfo && this.tableInfo.forEach((c, idx) => { + if (!c.hide) { + this.tabInfo.push({ + key: `${idx}`, + title: c.tabname, + }) + } + }) + //if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; + if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; + } + + setLoading(val) { + this.loading = val; + } + + + updateTabKey = (key) => { + this.tabKey = key; + } + + updateDetailSelectedKey =(key) => { + this.detailSelectedKey = key; + } + + updateTableInfo = (data) => { + this.tableInfo = data + } + + setSelectedKey = (key) => { + this.selectedKey = key; + } + + getSelectedRows = () => { + const selectedRows = []; + this.tableInfo.forEach(t => { + const singleTableRows = []; + t.tabinfo.datas.forEach((data, i) => { + if (data.viewAttr === 1) { + singleTableRows.push(i); + } + }); + selectedRows.push(singleTableRows); + }) + this.selectedRows = selectedRows; + } + + + setTopTab(topTab) { + this.topTab = topTab; + } + + changeData(key) { + this.setSelectedKey(key); + this.getData(); + } + + setId(id) { + this.id = id; + } + + setPersonalEditTables = (ref) => { + this.personalEditTables = ref; + } + + setConditions(conditions) { + this.conditions = conditions; + } + + setButtons(buttons) { + this.buttons = buttons; + } + + +} From 4102c1e135d29cfcfea6c715caa04b979242fd8b Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 22 Jun 2022 10:28:25 +0800 Subject: [PATCH 027/155] =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/resource.js | 36 +-------------- .../components/company/company.js | 17 +++++-- .../components/department/department.js | 17 +++++-- pc4mobx/organization/components/job/Job.js | 17 +++++-- .../components/postionrank/JobGrade.js | 15 +++++- .../components/postionrank/JobLevel.js | 15 +++++- .../components/postionrank/RankScheme.js | 5 +- .../components/sequence/Sequence.js | 15 +++++- .../organization/components/staff/Staff.js | 6 --- .../components/staff/StaffScheme.js | 15 +++++- pc4mobx/organization/public/i18n.js | 4 +- pc4mobx/organization/stores/department.js | 1 + pc4mobx/organization/stores/job.js | 1 + pc4mobx/organization/stores/jobgrade.js | 5 +- pc4mobx/organization/stores/joblevel.js | 3 +- pc4mobx/organization/stores/rankscheme.js | 1 + pc4mobx/organization/stores/resource.js | 46 +------------------ pc4mobx/organization/stores/sequence.js | 3 +- pc4mobx/organization/stores/staffscheme.js | 1 + 19 files changed, 112 insertions(+), 111 deletions(-) diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index bd794ec..9f64dcf 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -7,19 +7,8 @@ export const getSearchList = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params); } -export const deleteTableData = (params) => { - return fetch('/api/bs/hrmorganization/scheme/deleteByIds', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} - export const getAdvanceSearchCondition = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSearchCondition', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSearchCondition', 'GET', params); } export const add = (params) => { @@ -33,34 +22,13 @@ export const add = (params) => { }) } -export const edit = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateScheme', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} - -export const updateForbiddenTag = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateForbiddenTagById', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} export const getSchemeForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSaveForm', 'GET', params); } export const getHasRight = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getHasRight', 'GET', params); } export const editResource = (params) => { diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index f026a49..560202f 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-07 16:39:25 + * @LastEditTime: 2022-06-22 10:08:54 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -255,7 +255,7 @@ export default class Company extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbiddenTag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; if (c.dataIndex == 'compName') { @@ -294,7 +294,18 @@ export default class Company extends React.Component { const { company } = this.props; - company.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + company.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } doDel(id) { diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index ec8277f..b533783 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-07 16:15:54 + * @LastEditTime: 2022-06-22 10:10:28 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -295,7 +295,18 @@ const { department } = this.props; - department.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + department.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } @@ -321,7 +332,7 @@ columns.forEach((c, index) => { if (c.dataIndex == 'forbiddenTag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; if (c.dataIndex == 'deptName') { diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 3d6ce54..1131898 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-08 16:03:50 + * @LastEditTime: 2022-06-22 10:10:58 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -268,7 +268,18 @@ export default class Job extends React.Component { const { job } = this.props; - job.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + job.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } @@ -294,7 +305,7 @@ export default class Job extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbiddenTag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; if (c.dataIndex == 'jobName') { diff --git a/pc4mobx/organization/components/postionrank/JobGrade.js b/pc4mobx/organization/components/postionrank/JobGrade.js index a3be8e6..347501d 100644 --- a/pc4mobx/organization/components/postionrank/JobGrade.js +++ b/pc4mobx/organization/components/postionrank/JobGrade.js @@ -241,7 +241,7 @@ export default class JobGrade extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) @@ -251,7 +251,18 @@ export default class JobGrade extends React.Component { const { jobGrade } = this.props; - jobGrade.updateForbiddenTag(checked,id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + jobGrade.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index 426ff7b..88a1103 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -226,7 +226,7 @@ export default class JobLevel extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) @@ -236,7 +236,18 @@ export default class JobLevel extends React.Component { const { jobLevel } = this.props; - jobLevel.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + jobLevel.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 86e8ab6..2158d77 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -232,20 +232,19 @@ export default class RankScheme extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) } updateForbiddenTag(checked, id) { - debugger const { rankScheme } = this.props; confirm({ title: i18n.confirm.defaultTitle(), - content: (checked == '0') ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), okText: i18n.button.ok(), cancelText: i18n.button.cancel(), onOk() { diff --git a/pc4mobx/organization/components/sequence/Sequence.js b/pc4mobx/organization/components/sequence/Sequence.js index deb6b49..042000f 100644 --- a/pc4mobx/organization/components/sequence/Sequence.js +++ b/pc4mobx/organization/components/sequence/Sequence.js @@ -227,7 +227,7 @@ export default class Sequence extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) @@ -248,7 +248,18 @@ export default class Sequence extends React.Component { const { sequence } = this.props; - sequence.updateForbiddenTag(checked,id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + sequence.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 5b354b6..7b8222f 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -222,12 +222,6 @@ export default class Staff extends React.Component { // }) } - updateForbiddenTag(checked,id) { - const { - staff - } = this.props; - staff.updateForbiddenTag(checked,id); - } onOperatesClick(record, rowIndex, operate) { const { diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index 2ee79bf..7860494 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -220,7 +220,7 @@ export default class StaffScheme extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) @@ -230,7 +230,18 @@ export default class StaffScheme extends React.Component { const { staffScheme } = this.props; - staffScheme.updateForbiddenTag(checked,id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + staffScheme.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 2a44586..aa5228b 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -940,8 +940,8 @@ export const i18n = { deleteImg: () => getLabel('16075', "删除图片") }, confirm: { - forbiddenTag: () => getLabel(131329, '确定禁用该记录吗'), - enableTag: () => getLabel(131329, '确定启用该记录吗'), + forbiddenTag: () => getLabel(-131329, '确定禁用该记录吗'), + enableTag: () => getLabel(-131328, '确定启用该记录吗'), defaultTitle: () => getLabel(131329, '信息确认'), diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 224bd5f..1f6f10b 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -158,6 +158,7 @@ export class DepartmentStore { }).then(data => { if (data.code === 200) { message.success(data.msg, 1); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 306b269..853dd2a 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -152,6 +152,7 @@ export class JobStore { }).then(data => { if (data.code === 200) { message.success(data.msg, 1); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index e6adaf2..5014b82 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -77,8 +77,8 @@ export class JobGradeStore { }, error => { message.warning(error.msg); }) - //获取tab信息 - this.getTabInfo(); + //获取tab信息(去除) + //this.getTabInfo(); } @@ -175,6 +175,7 @@ export class JobGradeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index 607bc43..8a2e8e2 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -55,7 +55,7 @@ export class JobLevelStore { getTableInfo() { let params; //获取tab信息 - this.getTabInfo(); + // this.getTabInfo(); this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { params = { @@ -166,6 +166,7 @@ export class JobLevelStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js index 11f799a..955f10a 100644 --- a/pc4mobx/organization/stores/rankscheme.js +++ b/pc4mobx/organization/stores/rankscheme.js @@ -156,6 +156,7 @@ export class RankSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 8dc8d88..2eba6ae 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -37,7 +37,7 @@ const { @observable form = new WeaForm(); @observable form1 = new WeaForm(); @observable schemeName = ''; - @observable conditionNum = 2; + @observable conditionNum = 8; @observable ids = ''; //选择行id @observable searchConditionLoading = true; @observable nEdialogTitle = ''; @@ -78,26 +78,6 @@ const { } - //删除 - delete() { - let params = { - ids: this.ids - }; - Api.deleteTableData(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(i18n.message.deleteSuccess()); - this.getTableInfo(); - } else { - message.warning(data.msg); - } - }) - .catch(error => { - message.warning(error.msg); - }) - } - save() { let params = { ...this.form.getFormParams() @@ -124,30 +104,6 @@ const { }); } - edit() { - let params = { ...this.form.getFormParams(), id: this.schemeId }; - this.form.validateForm().then(f => { - if (f.isValid) { - Api.edit(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - this.setVisible(false); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } else { - f.showErrors(); - this.setDate(new Date()); - } - }); - } - updateForbiddenTag(checked, id) { let params = { forbiddenTag: checked, diff --git a/pc4mobx/organization/stores/sequence.js b/pc4mobx/organization/stores/sequence.js index d7556c7..e2ec395 100644 --- a/pc4mobx/organization/stores/sequence.js +++ b/pc4mobx/organization/stores/sequence.js @@ -77,7 +77,7 @@ export class SequenceStore { message.warning(error.msg); }) //获取tab信息 - this.getTabInfo(); + // this.getTabInfo(); } @@ -165,6 +165,7 @@ export class SequenceStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js index 11fe89e..adf62a4 100644 --- a/pc4mobx/organization/stores/staffscheme.js +++ b/pc4mobx/organization/stores/staffscheme.js @@ -156,6 +156,7 @@ export class StaffSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } From 4878b6be1d3c34d5eccae59cae7e790f1bbb9e17 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 22 Jun 2022 16:09:43 +0800 Subject: [PATCH 028/155] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=81=8C=E5=8A=A1?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/officeManage.js | 60 +++--- .../components/office/components/leftTree.js | 187 ++++++++-------- .../components/office/officeManage.js | 202 ++++++++++-------- pc4mobx/organization/public/i18n.js | 3 +- pc4mobx/organization/stores/officeManage.js | 51 +++-- 5 files changed, 282 insertions(+), 221 deletions(-) diff --git a/pc4mobx/organization/apis/officeManage.js b/pc4mobx/organization/apis/officeManage.js index db1be85..1d081fc 100644 --- a/pc4mobx/organization/apis/officeManage.js +++ b/pc4mobx/organization/apis/officeManage.js @@ -2,11 +2,11 @@ * Author: 黎永顺 * Description: * Date: 2022-05-13 16:36:09 - * LastEditTime: 2022-05-16 16:27:08 + * LastEditTime: 2022-06-22 14:37:27 */ import { WeaTools } from "ecCom"; -export const getHasRight = (params) => { +export const getHasRight = params => { return WeaTools.callApi( "/api/bs/hrmorganization/postinfo/getHasRight", "GET", @@ -14,7 +14,7 @@ export const getHasRight = (params) => { ); }; -export const getSearchCondition = (params) => { +export const getSearchCondition = params => { return WeaTools.callApi( "/api/bs/hrmorganization/postinfo/getSearchCondition", "GET", @@ -22,84 +22,94 @@ export const getSearchCondition = (params) => { ); }; -export const getPostInfoForm = (params) => { +export const getPostInfoForm = params => { return WeaTools.callApi( "/api/bs/hrmorganization/postinfo/getPostInfoForm", "GET", params ); }; -export const savePostInfo = (params) => { +export const savePostInfo = params => { return fetch("/api/bs/hrmorganization/postinfo/savePostInfo", { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }); }; -export const updatePostInfo = (params) => { +export const updatePostInfo = params => { return fetch("/api/bs/hrmorganization/postinfo/updatePostInfo", { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }); }; -export const updateForbiddenTagById = (params) => { +export const updateForbiddenTagById = params => { return fetch("/api/bs/hrmorganization/postinfo/updateForbiddenTagById", { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }); }; -export const savePost = (params) => { +export const savePost = params => { return fetch("/api/bs/hrmorganization/post/savePost", { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) + }); +}; +export const updatePost = params => { + return fetch("/api/bs/hrmorganization/post/updatePost", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) }); }; -export const deleteByIds = (params) => { +export const deleteByIds = params => { return fetch("/api/bs/hrmorganization/post/deleteByIds", { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }); }; -export const deletePostinfoByIds = (params) => { +export const deletePostinfoByIds = params => { return fetch("/api/bs/hrmorganization/postinfo/deleteByIds", { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }); }; -export const getTreeData = (params) => { +export const getTreeData = params => { return WeaTools.callApi( "/api/bs/hrmorganization/post/getTreeData", "GET", params ); }; -export const getPostForm = (params) => { +export const getPostForm = params => { return WeaTools.callApi( "/api/bs/hrmorganization/post/getPostForm", "GET", @@ -107,7 +117,7 @@ export const getPostForm = (params) => { ); }; -export const getPostInfoTable = (params) => { +export const getPostInfoTable = params => { return WeaTools.callApi( "/api/bs/hrmorganization/postinfo/getPostInfoTable", "GET", diff --git a/pc4mobx/organization/components/office/components/leftTree.js b/pc4mobx/organization/components/office/components/leftTree.js index 4fa7773..d84ffc5 100644 --- a/pc4mobx/organization/components/office/components/leftTree.js +++ b/pc4mobx/organization/components/office/components/leftTree.js @@ -10,49 +10,6 @@ import "../index.less"; const confirm = Modal.confirm; const TreeNode = Tree.TreeNode; -const treeData = [ - { - title: "0-0", - key: "0-0", - children: [ - { - title: "0-0-0", - key: "0-0-0", - children: [ - { title: "0-0-0-0-88", key: "0-0-0-0" }, - { title: "0-0-0-1", key: "0-0-0-1" }, - { title: "0-0-0-2", key: "0-0-0-2" }, - ], - }, - { - title: "0-0-1", - key: "0-0-1", - children: [ - { title: "0-0-1-0", key: "0-0-1-0" }, - { title: "0-0-1-1", key: "0-0-1-1" }, - { title: "0-0-1-2", key: "0-0-1-2" }, - ], - }, - { - title: "0-0-2", - key: "0-0-2", - }, - ], - }, - { - title: "99", - key: "0-1", - children: [ - { title: "0-1-0-0", key: "0-1-0-0" }, - { title: "9988", key: "0-1-0-1" }, - { title: "0-1-0-2-99988", key: "0-1-0-2" }, - ], - }, - { - title: "0-2", - key: "0-2", - }, -]; @inject("officeManageStore") @observer @@ -66,7 +23,7 @@ class LeftTree extends Component { copyTree: [], copyExpandedKeys: [], searchValue: "", - rightClickNodeTreeItem: null, + rightClickNodeTreeItem: null }; } componentDidMount() { @@ -77,9 +34,19 @@ class LeftTree extends Component { document.removeEventListener("click", this.handleClick); } + componentWillReceiveProps(nextProps) { + if ( + nextProps.deleteOfficeClassifyFlag !== this.props.deleteOfficeClassifyFlag + ) { + const { officeManageStore } = this.props; + const { officeClassifyId } = officeManageStore; + this.handleDelete(officeClassifyId); + } + } + getTreeData = () => { const { officeManageStore } = this.props; - officeManageStore.getTreeData().then((res) => { + officeManageStore.getTreeData().then(res => { const { code, data, msg } = res; if (code === 200) { let cp = JSON.stringify([data]); @@ -87,7 +54,7 @@ class LeftTree extends Component { treeData: [data], expandedKeys: this.expandedKeysFun([data]), copyTree: cp, - copyExpandedKeys: [], + copyExpandedKeys: [] }); } else { message.error(res.msg); @@ -98,23 +65,28 @@ class LeftTree extends Component { handleClick = () => { this.setState({ rightClickNodeTreeItem: null }); }; - onSelect = (node) => { + onSelect = node => { const [postId] = node; const { officeManageStore } = this.props; + officeManageStore.setOfficeClassifyId( + !postId + ? officeManageStore.officeClassifyId + : postId != "-1" ? postId : "" + ); officeManageStore.getPostInfoTable(postId); this.setState({ - rightClickNodeTreeItem: null, + rightClickNodeTreeItem: null }); }; - treeNodeonRightClick = (e) => { + treeNodeonRightClick = e => { this.setState({ rightClickNodeTreeItem: { pageX: e.event.pageX, pageY: e.event.pageY, id: e.node.props["eventKey"], - categoryName: e.node.props["data-title"], - }, + categoryName: e.node.props["data-title"] + } }); }; @@ -149,9 +121,9 @@ class LeftTree extends Component { } return new RegExp(filterText, "i").test(data.title); }; - flatTreeFun = (treeData) => { + flatTreeFun = treeData => { let arr = []; - const flatTree = (treeData) => { + const flatTree = treeData => { treeData.map((item, index) => { arr.push(item); if (item.children && item.children.length > 0) { @@ -163,12 +135,12 @@ class LeftTree extends Component { flatTree(treeData); return arr; }; - expandedKeysFun = (treeData) => { + expandedKeysFun = treeData => { if (treeData && treeData.length == 0) { return []; } let arr = []; - const expandedKeysFn = (treeData) => { + const expandedKeysFn = treeData => { treeData.map((item, index) => { arr.push(item.key); if (item.children && item.children.length > 0) { @@ -179,13 +151,13 @@ class LeftTree extends Component { expandedKeysFn(treeData); return arr; }; - onChange = (value) => { + onChange = value => { if (value == "") { let { copyTree, copyExpandedKeys } = this.state; this.setState({ treeData: JSON.parse(copyTree), expandedKeys: copyExpandedKeys, - searchValue: value, + searchValue: value }); } else { let { copyTree, copyExpandedKeys } = this.state; @@ -198,7 +170,7 @@ class LeftTree extends Component { this.setState({ treeData: res, expandedKeys: expkey, - searchValue: value, + searchValue: value }); } }; @@ -208,7 +180,7 @@ class LeftTree extends Component { const tmpStyle = { position: "absolute", left: `${pageX}px`, - top: `${pageY}px`, + top: `${pageY}px` }; const menu = ( { + handleMenuClick = menu => { const { officeManageStore } = this.props; const { id } = this.state.rightClickNodeTreeItem; const { key } = menu; @@ -240,7 +212,7 @@ class LeftTree extends Component { onOk: () => this.handleDelete(id), onCancel() { return false; - }, + } }); break; default: @@ -248,26 +220,28 @@ class LeftTree extends Component { } }; - renderTreeNode = (data) => { + renderTreeNode = data => { //生成树结构函数 if (data.length == 0) { return; } let { expandedKeys, searchValue } = this.state; - return data.map((item) => { + return data.map(item => { const index = item.title.indexOf(searchValue); const beforeStr = item.title.substr(0, index); const afterStr = item.title.substr(index + searchValue.length); const title = - index > -1 ? ( - - {beforeStr} - {searchValue} - {afterStr} - - ) : ( - {item.title} - ); + index > -1 + ? + {beforeStr} + + {searchValue} + + {afterStr} + + : + {item.title} + ; if (item.children && item.children.length > 0) { return ( @@ -275,31 +249,46 @@ class LeftTree extends Component { ); } - return ( - - ); + return ; }); }; - onExpand = (expandedKeys) => { + onExpand = expandedKeys => { this.setState({ - expandedKeys, + expandedKeys }); }; handleSave = () => { - const { form1, savePost } = this.props.officeManageStore; - form1.validateForm().then((f) => { + const { + form1, + savePost, + updatePost, + officeClassifyId, + officeVisible + } = this.props.officeManageStore; + form1.validateForm().then(f => { if (f.isValid) { // 验证通过, balabala业务代码 - const payload = { ...form1.getFormParams() }; + const payload = { ...form1.getFormParams(), id: officeClassifyId }; + const result = + officeClassifyId && officeVisible.type === "editPlan" + ? updatePost(payload) + : savePost(payload); this.setState({ loading: true }); - savePost(payload).then(({ code, msg }) => { + result.then(({ code, msg }) => { this.setState({ loading: false }); if (code === 200) { - message.success("新增成功"); + message.success( + officeClassifyId && officeVisible.type === "editPlan" + ? "编辑成功" + : "新增成功" + ); this.getTreeData(); - this.props.officeManageStore.setOfficeVisible(false); + this.props.officeManageStore.setOfficeVisible({ + bool: false, + type: officeVisible.type + }); } else { message.error(msg || "新增失败"); } @@ -310,11 +299,12 @@ class LeftTree extends Component { } }); }; - handleDelete = (ids) => { + handleDelete = ids => { const { deleteByIds } = this.props.officeManageStore; deleteByIds({ ids }).then(({ code, msg }) => { if (code === 200) { message.success("删除成功"); + this.props.officeManageStore.setOfficeClassifyId(""); this.getTreeData(); } else { message.error(msg || "删除失败"); @@ -325,7 +315,12 @@ class LeftTree extends Component { render() { let { expandedKeys, treeData, searchValue, loading } = this.state; const { officeManageStore } = this.props; - const { officeCondition, form1, officeVisible } = officeManageStore; + const { + officeCondition, + form1, + officeVisible, + officeClassifyId + } = officeManageStore; return (
@@ -338,17 +333,21 @@ class LeftTree extends Component { {this.renderTreeNode(treeData)} {this.getNodeTreeRightClickMenu()} this.handleSave()} - onCancel={() => officeManageStore.setOfficeVisible(false)} + onCancel={() => + officeManageStore.setOfficeVisible({ + bool: false, + type: officeVisible.type + })} />
); diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 0242424..48df78f 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -9,13 +9,12 @@ import { WeaTab, WeaFormItem, WeaRightMenu, - WeaLeftRightLayout, + WeaLeftRightLayout } from "ecCom"; import { Row, Col, Spin, Modal, Button, message, Switch } from "antd"; import { WeaSwitch, WeaTableNew } from "comsMobx"; import "./index.less"; -import { renderNoright } from '../../util'; - +import { renderNoright } from "../../util"; const confirm = Modal.confirm; const WeaTable = WeaTableNew.WeaTable; @@ -28,6 +27,7 @@ export default class OfficeManage extends Component { date: "", editId: "", loading: false, + deleteOfficeClassifyFlag: false }; } componentDidMount() { @@ -44,7 +44,7 @@ export default class OfficeManage extends Component { let obj = { key: item.menuFun, icon: , - content: item.menuName, + content: item.menuName }; if ( item.menuFun == "collection" || @@ -58,7 +58,7 @@ export default class OfficeManage extends Component { return menus; }; - handleMenuClick = (key) => { + handleMenuClick = key => { const { officeManageStore } = this.props; const { isPanelShow, tableStore } = officeManageStore; isPanelShow && officeManageStore.setPanelStatus(false); @@ -78,10 +78,14 @@ export default class OfficeManage extends Component { }; handleSave() { - const { form, condition, savePostInfo, updatePostInfo } = - this.props.officeManageStore; + const { + form, + condition, + savePostInfo, + updatePostInfo + } = this.props.officeManageStore; const { editId } = this.state; - form.validateForm().then((f) => { + form.validateForm().then(f => { if (f.isValid) { // 验证通过, balabala业务代码 const payload = editId @@ -121,21 +125,63 @@ export default class OfficeManage extends Component { } getTopMenuBtns = () => { const { officeManageStore } = this.props; - const { topMenu, tableStore } = officeManageStore; + const { topMenu, tableStore, officeClassifyId } = officeManageStore; let btns = []; topMenu.map((item, i) => { - if (item.menuFun !== "batchDelete") { + if (item.menuFun !== "batchDelete" && item.menuFun !== "delPlan") { + btns.push( + + ); + } else if (item.menuFun === "delPlan") { btns.push( ); @@ -168,11 +214,11 @@ export default class OfficeManage extends Component { onOk: () => this.deletePostinfoByIds(ids), onCancel() { return false; - }, + } }); }; - deletePostinfoByIds = (ids) => { + deletePostinfoByIds = ids => { const { officeManageStore } = this.props; const { deletePostinfoByIds } = officeManageStore; deletePostinfoByIds({ ids }).then(({ code, msg }) => { @@ -185,27 +231,25 @@ export default class OfficeManage extends Component { }); }; - reRenderColumns = (columns) => { + reRenderColumns = columns => { let _this = this; columns.forEach((c, index) => { if (c.dataIndex == "forbidden_tag") { - c.render = function (text, record) { + c.render = function(text, record) { return ( { + onChange={checked => { confirm({ title: i18n.confirm.defaultTitle(), content: - record.forbidden_tag === "0" - ? "确定要禁用吗?" - : "确定要启用吗?", + record.forbidden_tag === "0" ? "确定禁用该记录吗?" : "确定启用该记录吗?", okText: i18n.button.ok(), cancelText: i18n.button.cancel(), onOk: () => _this.updateForbiddenTag(checked, record.id), onCancel() { return false; - }, + } }); }} /> @@ -220,7 +264,7 @@ export default class OfficeManage extends Component { const { updateForbiddenTagById } = officeManageStore; const payload = { id, - forbiddentag, + forbiddentag }; updateForbiddenTagById(payload).then(({ code, msg }) => { if (code === 200) { @@ -236,7 +280,7 @@ export default class OfficeManage extends Component { operate.index == "0" && this.doEdit(record.randomFieldId); operate.index === "1" && this.showConfirm("del", record.randomFieldId); }; - doEdit = (editId) => { + doEdit = editId => { this.setState({ editId }); const { officeManageStore } = this.props; officeManageStore.isPanelShow && officeManageStore.setPanelStatus(false); @@ -245,44 +289,36 @@ export default class OfficeManage extends Component { officeManageStore.setNeDialogTitle(i18n.label.editOfficeName()); }; - custom = () => { - debugger - const { - officeManageStore - } = this.props, { - tableStore, - } = officeManageStore; - - - } - getPanelComponents = () => { const { officeManageStore } = this.props; - const { searchCondition, form2, searchConditionLoading } = - officeManageStore; + const { + searchCondition, + form2, + searchConditionLoading + } = officeManageStore; let arr = []; let formParams = form2.getFormParams(); const { isFormInit } = form2; isFormInit && - searchCondition.map((c) => { + searchCondition.map(c => { c.items.map((field, index) => { arr.push(
{ + ecId={`${(this && this.props && this.props.ecId) || + ""}_Spin@lbktzb`} + spinning={searchConditionLoading} + />
); } else { return ( { + onKeyDown={e => { if (e.keyCode == 13 && e.target.tagName === "INPUT") { officeManageStore.getPostInfoTable(); officeManageStore.setPanelStatus(false); @@ -342,12 +379,12 @@ export default class OfficeManage extends Component { ecId={`${(this && this.props && this.props.ecId) || ""}_Button@5u9mfz`} onClick={() => officeManageStore.setPanelStatus(false)}> {i18n.button.cancel()} - , + ]; return btn; }; - onSearchChange = (val) => { + onSearchChange = val => { const { officeManageStore } = this.props; const { form2 } = officeManageStore; officeManageStore.setPostInfoName(val); @@ -356,7 +393,7 @@ export default class OfficeManage extends Component { render() { const { officeManageStore } = this.props; - const { date, loading } = this.state; + const { date, loading, deleteOfficeClassifyFlag } = this.state; const { isPanelShow, form2, @@ -374,22 +411,24 @@ export default class OfficeManage extends Component { if (hasRight === false) { return renderNoright(); } - + return ( - hasRight &&
+
} - onCollapse={(showLeft) => console.log("showLeft:", showLeft)}> + leftCom={ + + } + onCollapse={showLeft => console.log("showLeft:", showLeft)}> this.handleMenuClick(key)}> + onClick={key => this.handleMenuClick(key)}> } iconBgcolor="#217346" @@ -397,10 +436,10 @@ export default class OfficeManage extends Component { buttons={this.getTopMenuBtns()} showDropIcon={true} dropMenuDatas={this.getDropMenuDatas()} - onDropMenuClick={(e) => this.handleMenuClick(e)}> + onDropMenuClick={e => this.handleMenuClick(e)}> - officeManageStore.setPanelStatus(bool) - } + setShowSearchAd={bool => officeManageStore.setPanelStatus(bool)} hideSearchAd={() => officeManageStore.setPanelStatus(false)} - searchsAd={ - isPanelShow ? this.getPanelComponents() :
- } + searchsAd={isPanelShow ? this.getPanelComponents() :
} advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hasMask={false} buttonsAd={this.getTabBtn()} onSearch={() => officeManageStore.getPostInfoTable()} - onSearchChange={(val) => this.onSearchChange(val)} + onSearchChange={val => this.onSearchChange(val)} /> { + getCheckboxProps: record => { console.log(record); return { - disabled: true, // 配置无法勾选的列 + disabled: true // 配置无法勾选的列 }; - }, + } }} - getColumns={(c) => this.reRenderColumns(c)} + getColumns={c => this.reRenderColumns(c)} onOperatesClick={(record, index, operate) => - this.onOperatesClick(record, index, operate) - } + this.onOperatesClick(record, index, operate)} /> getLabel(385936, '职务管理'), newOfficeName: () => getLabel(386246, '新建职务信息'), editOfficeName: () => getLabel(386247, '编辑职务信息'), - newOfficeClassifyName: () => getLabel(386246, '新建职务分类信息'), + newOfficeClassifyName: () => getLabel(386246, '新建职务分类'), + editOfficeClassifyName: () => getLabel(386246, '编辑职务分类'), branchNumSetting: () => getLabel(386246, '分部编号设置'), deptNumSetting: () => getLabel(386246, '部门编号设置'), postNumSetting: () => getLabel(386246, '岗位编号设置'), diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js index b593dd6..c848b9a 100644 --- a/pc4mobx/organization/stores/officeManage.js +++ b/pc4mobx/organization/stores/officeManage.js @@ -22,20 +22,26 @@ export class OfficeManageStore { @observable form = new WeaForm(); //新增编辑渲染的表单 @observable form1 = new WeaForm(); //职务分类渲染的表单 @observable postInfoName = ""; + @observable officeClassifyId = ""; //选中职务分类的id @observable conditionNum = 2; @observable ids = ""; //选择行id @observable searchConditionLoading = false; @observable nEdialogTitle = ""; - @observable officeVisible = false; + @observable officeVisible = {}; @observable visible = false; @observable dialogLoading = false; @observable schemeId = ""; @observable date = ""; - @observable hasRight = ''; + @observable hasRight = ""; + + @action + setOfficeClassifyId(id) { + this.officeClassifyId = id; + } @action getHasRight() { - API.getHasRight().then((res) => { + API.getHasRight().then(res => { const { code, data, msg } = res; if (code === 200) { const { rightMenu, topMenu } = data; @@ -50,7 +56,7 @@ export class OfficeManageStore { @action("高级搜索表单渲染") getSearchCondition() { this.setScLoadingStatus(true); - API.getSearchCondition().then((res) => { + API.getSearchCondition().then(res => { this.setScLoadingStatus(false); const { code, data, msg } = res; if (code === 200) { @@ -65,7 +71,7 @@ export class OfficeManageStore { @action("获取新增/编辑表单") getPostInfoForm(id) { this.setDialogLoadingStatus(true); - API.getPostInfoForm({ id }).then((res) => { + API.getPostInfoForm({ id }).then(res => { this.setDialogLoadingStatus(false); const { code, data, msg } = res; if (code === 200) { @@ -85,15 +91,15 @@ export class OfficeManageStore { params = { ...this.form2.getFormParams(), postId, - postInfoName: this.postInfoName, + postInfoName: this.postInfoName }; } else { params = { postId, - ...this.form2.getFormParams(), + ...this.form2.getFormParams() }; } - API.getPostInfoTable(params).then((res) => { + API.getPostInfoTable(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); @@ -110,21 +116,28 @@ export class OfficeManageStore { @action("保存职务分类") savePost(payload) { - return API.savePost(payload).then((response) => { + return API.savePost(payload).then(response => { + return response.json(); + }); + } + + @action("编辑职务分类") + updatePost(payload) { + return API.updatePost(payload).then(response => { return response.json(); }); } @action("删除职务分类") deleteByIds(payload) { - return API.deleteByIds(payload).then((response) => { + return API.deleteByIds(payload).then(response => { return response.json(); }); } @action("删除职务信息") deletePostinfoByIds(payload) { - return API.deletePostinfoByIds(payload).then((response) => { + return API.deletePostinfoByIds(payload).then(response => { return response.json(); }); } @@ -132,7 +145,7 @@ export class OfficeManageStore { @action("获取职务分类表单") getPostForm(id) { this.setDialogLoadingStatus(true); - API.getPostForm({ id }).then((res) => { + API.getPostForm({ id }).then(res => { this.setDialogLoadingStatus(false); const { code, data, msg } = res; if (code === 200) { @@ -155,21 +168,21 @@ export class OfficeManageStore { @action("新增职务信息") savePostInfo(payload) { - return API.savePostInfo(payload).then((response) => { + return API.savePostInfo(payload).then(response => { return response.json(); }); } @action("更新职务信息") updatePostInfo(payload) { - return API.updatePostInfo(payload).then((response) => { + return API.updatePostInfo(payload).then(response => { return response.json(); }); } @action("更新禁用标识 ") updateForbiddenTagById(payload) { - return API.updateForbiddenTagById(payload).then((response) => { + return API.updateForbiddenTagById(payload).then(response => { return response.json(); }); } @@ -200,8 +213,8 @@ export class OfficeManageStore { if (!bool) this.setDialogLoadingStatus(false); } - setOfficeVisible(bool) { - this.officeVisible = bool; + setOfficeVisible({ bool, type }) { + this.officeVisible = { bool, type }; this.officeFormReset(); if (!bool) this.setDialogLoadingStatus(false); } @@ -217,8 +230,8 @@ export class OfficeManageStore { updateFields(val) { this.form2.updateFields({ postInfoName: { - value: val, - }, + value: val + } }); } From ebf1cb58d97ba77dc891bae784435c289900eeab Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 22 Jun 2022 17:19:28 +0800 Subject: [PATCH 029/155] =?UTF-8?q?=E9=9C=80=E6=B1=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/jobgrade.js | 4 + pc4mobx/organization/apis/joblevel.js | 4 + .../components/company/CompanyExtend.js | 15 +- .../components/company/company.js | 4 +- .../components/department/department.js | 4 +- .../components/department/departmentExtend.js | 548 ++++++++--------- pc4mobx/organization/components/job/Job.js | 4 +- .../organization/components/job/JobExtend.js | 557 +++++++++--------- .../components/postionrank/JobGrade.js | 120 ++-- .../components/postionrank/JobLevel.js | 79 ++- pc4mobx/organization/public/i18n.js | 11 +- pc4mobx/organization/stores/companyextend.js | 2 - pc4mobx/organization/stores/jobgrade.js | 55 +- pc4mobx/organization/stores/joblevel.js | 54 +- 14 files changed, 793 insertions(+), 668 deletions(-) diff --git a/pc4mobx/organization/apis/jobgrade.js b/pc4mobx/organization/apis/jobgrade.js index 5ef46d5..2029137 100644 --- a/pc4mobx/organization/apis/jobgrade.js +++ b/pc4mobx/organization/apis/jobgrade.js @@ -64,4 +64,8 @@ export const getTabInfo = (params) => { export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/grade/getHasRight', 'GET', params); +} + +export const getTree = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTreeData', 'GET', params); } \ No newline at end of file diff --git a/pc4mobx/organization/apis/joblevel.js b/pc4mobx/organization/apis/joblevel.js index 0203910..8fb9365 100644 --- a/pc4mobx/organization/apis/joblevel.js +++ b/pc4mobx/organization/apis/joblevel.js @@ -65,4 +65,8 @@ export const getTabInfo = (params) => { export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/level/getTableBtn', 'GET', params); +} + +export const getTree = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTreeData', 'GET', params); } \ No newline at end of file diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index b766975..92b4901 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 14:52:39 - * @LastEditTime: 2022-05-26 17:11:02 + * @LastEditTime: 2022-06-22 16:37:43 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js */ @@ -228,15 +228,7 @@ export default class CompanyExtend extends React.Component { render() { const { companyExtend } = this.props; - const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = companyExtend; - - // if(!hasRight && !loading){ - // return ( - // - //
{i18n.message.authFailed()}
- //
- // ) - // } + const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey,isEditor } = companyExtend; try { return ( @@ -246,6 +238,9 @@ export default class CompanyExtend extends React.Component { > } + iconBgcolor='#217346' buttons={this.getTopButtons()} showDropIcon={true} dropMenuDatas={this.getRightMenu()} diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 560202f..e28f0fc 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-22 10:08:54 + * @LastEditTime: 2022-06-22 15:13:10 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -121,7 +121,7 @@ export default class Company extends React.Component { company } = this.props; - company.setNeDialogTitle(i18n.label.companyName()); + company.setNeDialogTitle(i18n.label.newCompany()); company.setNewVisible(true); company.getCompanyForm(); diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index b533783..4b6de65 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-22 10:10:28 + * @LastEditTime: 2022-06-22 16:42:37 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -125,7 +125,7 @@ department } = this.props; - department.setNeDialogTitle(i18n.label.deptManage()); + department.setNeDialogTitle(i18n.label.newDept()); department.setNewVisible(true); department.getDeptForm(); diff --git a/pc4mobx/organization/components/department/departmentExtend.js b/pc4mobx/organization/components/department/departmentExtend.js index e54a2cb..d31b86c 100644 --- a/pc4mobx/organization/components/department/departmentExtend.js +++ b/pc4mobx/organization/components/department/departmentExtend.js @@ -1,282 +1,284 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:20:03 - * @LastEditTime: 2022-06-02 11:40:57 + * @LastEditTime: 2022-06-22 16:54:39 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js */ - import { Button, Modal, message, Row, Col, Spin } from 'antd'; - import isEmpty from 'lodash/isEmpty' - import cloneDeep from 'lodash/cloneDeep' - import forEach from 'lodash/forEach' - import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom' - import { WeaSwitch } from 'comsMobx'; - import { inject, observer } from 'mobx-react'; - import * as mobx from 'mobx'; - import { i18n } from '../../public/i18n'; - - const toJS = mobx.toJS; - import '../../style/common.less'; - - - @inject('departmentExtend') - @inject('department') - @observer - export default class DepartmentExtendStore extends React.Component { - - componentDidMount() { - this.init(); - } - init = () => { - const { departmentExtend,department } = this.props; - let {hash} = window.location; - hash = hash.split("?")[0]; - let id = hash.match("[^/]+(?=/$|$)")[0]; - departmentExtend.init(); - departmentExtend.setId(id); - departmentExtend.getData(); - } - - getTabChildren = () => { - const { departmentExtend } = this.props; - let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = departmentExtend; - let tabChildren = []; - tableInfo = toJS(tableInfo); - tableInfo && tableInfo.map((t, i) => { - if (detailSelectedKey == i) { - tabChildren.push( - departmentExtend.setPersonalEditTables(ref)} - showTitle={isEditor} - // title={'列表信息'} - //addFirstRow={isEditor} - columns={t.tabinfo.columns} - datas={t.tabinfo.datas} - onChange={this.tableEditChange} - selectedRowKeys={toJS(selectedRowKeys)} - onRowSelect={keys => onRowSelect(keys)} - onBtnsSelect={key => this.onBtnsSelect(key, i)} - viewAttr={isEditor ? 2 : 1} - getRowSelection={isEditor ? (rowSelection) => { - Object.assign(rowSelection, { - getCheckboxProps: record => ({ - disabled: record.viewAttr === 1, // 配置无法勾选的列 - }) - }) - return rowSelection; - } : () => null} - /> - ); - } - }) - return tabChildren; - } - - onBtnsSelect = (key, index) => { - const { - departmentExtend - } = this.props, { - tableInfo, - selectedRows, - setSelectedRowKeys, - selectedRowKeys - } = departmentExtend; - - const datas = tableInfo[index].tabinfo.datas; - if (key === 'copy') { - tableInfo[index].tabinfo.datas = datas.map((data, i) => { - if (!selectedRows[index].includes(i)) { - data.viewAttr = 2; - } - return data - }) - } - if (key === 'delete') { - tableInfo[index].tabinfo.datas = datas.map((data, i) => { - if (selectedRows[index].includes(i)) { - data.viewAttr = 1; - } - return data - }); - setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) - } - } - - getSearchs = () => { - const { departmentExtend } = this.props; - let { form, conditions, isEditor } = departmentExtend; - const { isFormInit } = form; - let group = []; - let tipPosition = 'bottom'; - window.e9HideFormFieldKeys = []; - isFormInit && conditions.forEach((c, i) => { - let items = []; - c.items.forEach((field, j) => { - if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { - window.e9HideFormFieldKeys.push(field.domkey[0]); - } else { - items.push({ - com: ( - - ), - colSpan: 1 - }); - } - }); - group.push() - }); - return group; - } - - tableEditChange = (data) => { - const { departmentExtend } = this.props; - let { detailSelectedKey = '0', tableInfo } = departmentExtend; - tableInfo = toJS(tableInfo); - let d = cloneDeep(tableInfo); - d[Number(detailSelectedKey)].tabinfo.datas = data; - departmentExtend.updateTableInfo(d); - } - - getRightMenu = () => { - const { departmentExtend } = this.props; - const { isEditor, buttons } = departmentExtend; - let arr = []; - try { - if (buttons.hasEdit) { - if (isEditor) { - arr = [{ - icon: , - content: i18n.button.save(), - key: 'save', - onClick: key => { - this.saveEditCard(); - } - }, { - icon: , - content: i18n.button.back(), - key: 'back', - onClick: key => { - this.backCard(); - } - }] - } else { - arr = [{ - icon: , - content: i18n.button.modify(), - key: 'editCard', - onClick: key => { - this.editCard(); - } - } - ] - } - } - } catch (e) { } - return arr; - } - - getTopButtons = () => { - const { departmentExtend } = this.props; - const { isEditor, buttons } = departmentExtend; - const save = ; - const back = ; - const edit = ; - const btns = []; - try { - if (isEditor) { - if (buttons.hasSave) { - btns.push(save); - btns.push(back); - } - } else { - if (buttons.hasEdit) { - btns.push(edit); - } - } - } catch (e) { } - return btns; - } - - editCard = () => { - const { departmentExtend } = this.props; - departmentExtend.edit(); - } - - saveEditCard = () => { - const { departmentExtend } = this.props; - departmentExtend.save(); - } - - backCard = () => { - this.init(); - } - - changeData(key) { - const { - departmentExtend - } = this.props; - departmentExtend.changeData(key); - } - - render() { - const { departmentExtend } = this.props; - const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = departmentExtend; - +import { Button, Modal, message, Row, Col, Spin } from 'antd'; +import isEmpty from 'lodash/isEmpty' +import cloneDeep from 'lodash/cloneDeep' +import forEach from 'lodash/forEach' +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop } from 'ecCom' +import { WeaSwitch } from 'comsMobx'; +import { inject, observer } from 'mobx-react'; +import * as mobx from 'mobx'; +import { i18n } from '../../public/i18n'; + +const toJS = mobx.toJS; +import '../../style/common.less'; + + +@inject('departmentExtend') +@inject('department') +@observer +export default class DepartmentExtendStore extends React.Component { + + componentDidMount() { + this.init(); + } + init = () => { + const { departmentExtend, department } = this.props; + let { hash } = window.location; + hash = hash.split("?")[0]; + let id = hash.match("[^/]+(?=/$|$)")[0]; + departmentExtend.init(); + departmentExtend.setId(id); + departmentExtend.getData(); + } + + getTabChildren = () => { + const { departmentExtend } = this.props; + let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = departmentExtend; + let tabChildren = []; + tableInfo = toJS(tableInfo); + tableInfo && tableInfo.map((t, i) => { + if (detailSelectedKey == i) { + tabChildren.push( + departmentExtend.setPersonalEditTables(ref)} + showTitle={isEditor} + // title={'列表信息'} + //addFirstRow={isEditor} + columns={t.tabinfo.columns} + datas={t.tabinfo.datas} + onChange={this.tableEditChange} + selectedRowKeys={toJS(selectedRowKeys)} + onRowSelect={keys => onRowSelect(keys)} + onBtnsSelect={key => this.onBtnsSelect(key, i)} + viewAttr={isEditor ? 2 : 1} + getRowSelection={isEditor ? (rowSelection) => { + Object.assign(rowSelection, { + getCheckboxProps: record => ({ + disabled: record.viewAttr === 1, // 配置无法勾选的列 + }) + }) + return rowSelection; + } : () => null} + /> + ); + } + }) + return tabChildren; + } + + onBtnsSelect = (key, index) => { + const { + departmentExtend + } = this.props, { + tableInfo, + selectedRows, + setSelectedRowKeys, + selectedRowKeys + } = departmentExtend; + + const datas = tableInfo[index].tabinfo.datas; + if (key === 'copy') { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (!selectedRows[index].includes(i)) { + data.viewAttr = 2; + } + return data + }) + } + if (key === 'delete') { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (selectedRows[index].includes(i)) { + data.viewAttr = 1; + } + return data + }); + setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) + } + } + + getSearchs = () => { + const { departmentExtend } = this.props; + let { form, conditions, isEditor } = departmentExtend; + const { isFormInit } = form; + let group = []; + let tipPosition = 'bottom'; + window.e9HideFormFieldKeys = []; + isFormInit && conditions.forEach((c, i) => { + let items = []; + c.items.forEach((field, j) => { + if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { + window.e9HideFormFieldKeys.push(field.domkey[0]); + } else { + items.push({ + com: ( + + ), + colSpan: 1 + }); + } + }); + group.push() + }); + return group; + } + + tableEditChange = (data) => { + const { departmentExtend } = this.props; + let { detailSelectedKey = '0', tableInfo } = departmentExtend; + tableInfo = toJS(tableInfo); + let d = cloneDeep(tableInfo); + d[Number(detailSelectedKey)].tabinfo.datas = data; + departmentExtend.updateTableInfo(d); + } + + getRightMenu = () => { + const { departmentExtend } = this.props; + const { isEditor, buttons } = departmentExtend; + let arr = []; try { - return ( -
- - - - - {this.getSearchs()} - { - !isEmpty(tabInfo) &&
- { - departmentExtend.updateDetailSelectedKey(v); - }} - /> - {this.getTabChildren()} -
- } -
-
-
- -
- ) - } catch (e) { - return -
{i18n.message.authFailed()}
-
- } - } - } - - \ No newline at end of file + if (buttons.hasEdit) { + if (isEditor) { + arr = [{ + icon: , + content: i18n.button.save(), + key: 'save', + onClick: key => { + this.saveEditCard(); + } + }, { + icon: , + content: i18n.button.back(), + key: 'back', + onClick: key => { + this.backCard(); + } + }] + } else { + arr = [{ + icon: , + content: i18n.button.modify(), + key: 'editCard', + onClick: key => { + this.editCard(); + } + } + ] + } + } + } catch (e) { } + return arr; + } + + getTopButtons = () => { + const { departmentExtend } = this.props; + const { isEditor, buttons } = departmentExtend; + const save = ; + const back = ; + const edit = ; + const btns = []; + try { + if (isEditor) { + if (buttons.hasSave) { + btns.push(save); + btns.push(back); + } + } else { + if (buttons.hasEdit) { + btns.push(edit); + } + } + } catch (e) { } + return btns; + } + + editCard = () => { + const { departmentExtend } = this.props; + departmentExtend.edit(); + } + + saveEditCard = () => { + const { departmentExtend } = this.props; + departmentExtend.save(); + } + + backCard = () => { + this.init(); + } + + changeData(key) { + const { + departmentExtend + } = this.props; + departmentExtend.changeData(key); + } + + render() { + const { departmentExtend } = this.props; + const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor } = departmentExtend; + + try { + return ( +
+ + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + > + + + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + departmentExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ } +
+
+
+ +
+ ) + } catch (e) { + return +
{i18n.message.authFailed()}
+
+ } + } +} + diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 1131898..fc2b1f2 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-22 10:10:58 + * @LastEditTime: 2022-06-22 16:43:08 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -126,7 +126,7 @@ export default class Job extends React.Component { job } = this.props; - job.setNeDialogTitle(i18n.label.jobName()); + job.setNeDialogTitle(i18n.label.newJob()); job.setNewVisible(true); job.getJobForm(); diff --git a/pc4mobx/organization/components/job/JobExtend.js b/pc4mobx/organization/components/job/JobExtend.js index ba34a54..5f900cd 100644 --- a/pc4mobx/organization/components/job/JobExtend.js +++ b/pc4mobx/organization/components/job/JobExtend.js @@ -1,289 +1,284 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:07:12 - * @LastEditTime: 2022-05-30 17:16:47 + * @LastEditTime: 2022-06-22 17:01:11 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js */ - import { Button, Modal, message, Row, Col, Spin } from 'antd'; - import isEmpty from 'lodash/isEmpty' - import cloneDeep from 'lodash/cloneDeep' - import forEach from 'lodash/forEach' - import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom' - import { WeaSwitch } from 'comsMobx'; - import { inject, observer } from 'mobx-react'; - import * as mobx from 'mobx'; - import { i18n } from '../../public/i18n'; - - const toJS = mobx.toJS; - import '../../style/common.less'; - - - @inject('jobExtend') - @inject('job') - @observer - export default class JobExtend extends React.Component { - - componentDidMount() { - this.init(); - } - init = () => { - const { jobExtend,job } = this.props; - let {hash} = window.location; - hash = hash.split("?")[0]; - let id = hash.match("[^/]+(?=/$|$)")[0]; - jobExtend.init(); - jobExtend.setId(id); - jobExtend.getData(); - } - - getTabChildren = () => { - const { jobExtend } = this.props; - let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = jobExtend; - let tabChildren = []; - tableInfo = toJS(tableInfo); - tableInfo && tableInfo.map((t, i) => { - if (detailSelectedKey == i) { - tabChildren.push( - jobExtend.setPersonalEditTables(ref)} - showTitle={isEditor} - // title={'列表信息'} - //addFirstRow={isEditor} - columns={t.tabinfo.columns} - datas={t.tabinfo.datas} - onChange={this.tableEditChange} - selectedRowKeys={toJS(selectedRowKeys)} - onRowSelect={keys => onRowSelect(keys)} - onBtnsSelect={key => this.onBtnsSelect(key, i)} - viewAttr={isEditor ? 2 : 1} - getRowSelection={isEditor ? (rowSelection) => { - Object.assign(rowSelection, { - getCheckboxProps: record => ({ - disabled: record.viewAttr === 1, // 配置无法勾选的列 - }) - }) - return rowSelection; - } : () => null} - /> - ); - } - }) - return tabChildren; - } - - onBtnsSelect = (key, index) => { - const { - jobExtend - } = this.props, { - tableInfo, - selectedRows, - setSelectedRowKeys, - selectedRowKeys - } = jobExtend; - - const datas = tableInfo[index].tabinfo.datas; - if (key === 'copy') { - tableInfo[index].tabinfo.datas = datas.map((data, i) => { - if (!selectedRows[index].includes(i)) { - data.viewAttr = 2; - } - return data - }) - } - if (key === 'delete') { - tableInfo[index].tabinfo.datas = datas.map((data, i) => { - if (selectedRows[index].includes(i)) { - data.viewAttr = 1; - } - return data - }); - setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) - } - } - - getSearchs = () => { - const { jobExtend } = this.props; - let { form, conditions, isEditor } = jobExtend; - const { isFormInit } = form; - let group = []; - let tipPosition = 'bottom'; - window.e9HideFormFieldKeys = []; - isFormInit && conditions.forEach((c, i) => { - let items = []; - c.items.forEach((field, j) => { - if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { - window.e9HideFormFieldKeys.push(field.domkey[0]); - } else { - items.push({ - com: ( - - ), - colSpan: 1 - }); - } - }); - group.push() - }); - return group; - } - - tableEditChange = (data) => { - const { jobExtend } = this.props; - let { detailSelectedKey = '0', tableInfo } = jobExtend; - tableInfo = toJS(tableInfo); - let d = cloneDeep(tableInfo); - d[Number(detailSelectedKey)].tabinfo.datas = data; - jobExtend.updateTableInfo(d); - } - - getRightMenu = () => { - const { jobExtend } = this.props; - const { isEditor, buttons } = jobExtend; - let arr = []; - try { - if (buttons.hasEdit) { - if (isEditor) { - arr = [{ - icon: , - content: i18n.button.save(), - key: 'save', - onClick: key => { - this.saveEditCard(); - } - }, { - icon: , - content: i18n.button.back(), - key: 'back', - onClick: key => { - this.backCard(); - } - }] - } else { - arr = [{ - icon: , - content: i18n.button.modify(), - key: 'editCard', - onClick: key => { - this.editCard(); - } - } - ] - } - } - } catch (e) { } - return arr; - } - - getTopButtons = () => { - const { jobExtend } = this.props; - const { isEditor, buttons } = jobExtend; - const save = ; - const back = ; - const edit = ; - const btns = []; - try { - if (isEditor) { - if (buttons.hasSave) { - btns.push(save); - btns.push(back); - } - } else { - if (buttons.hasEdit) { - btns.push(edit); - } - } - } catch (e) { } - return btns; - } - - editCard = () => { - const { jobExtend } = this.props; - jobExtend.edit(); - } - - saveEditCard = () => { - const { jobExtend } = this.props; - jobExtend.save(); - } - - backCard = () => { - this.init(); - } - - changeData(key) { - const { - jobExtend - } = this.props; - jobExtend.changeData(key); - } - - render() { - const { jobExtend } = this.props; - const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = jobExtend; - - // if(!hasRight && !loading){ - // return ( - // - //
{i18n.message.authFailed()}
- //
- // ) - // } - +import { Button, Modal, message, Row, Col, Spin } from 'antd'; +import isEmpty from 'lodash/isEmpty' +import cloneDeep from 'lodash/cloneDeep' +import forEach from 'lodash/forEach' +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop } from 'ecCom' +import { WeaSwitch } from 'comsMobx'; +import { inject, observer } from 'mobx-react'; +import * as mobx from 'mobx'; +import { i18n } from '../../public/i18n'; + +const toJS = mobx.toJS; +import '../../style/common.less'; + + +@inject('jobExtend') +@inject('job') +@observer +export default class JobExtend extends React.Component { + + componentDidMount() { + this.init(); + } + init = () => { + const { jobExtend, job } = this.props; + let { hash } = window.location; + hash = hash.split("?")[0]; + let id = hash.match("[^/]+(?=/$|$)")[0]; + jobExtend.init(); + jobExtend.setId(id); + jobExtend.getData(); + } + + getTabChildren = () => { + const { jobExtend } = this.props; + let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = jobExtend; + let tabChildren = []; + tableInfo = toJS(tableInfo); + tableInfo && tableInfo.map((t, i) => { + if (detailSelectedKey == i) { + tabChildren.push( + jobExtend.setPersonalEditTables(ref)} + showTitle={isEditor} + // title={'列表信息'} + //addFirstRow={isEditor} + columns={t.tabinfo.columns} + datas={t.tabinfo.datas} + onChange={this.tableEditChange} + selectedRowKeys={toJS(selectedRowKeys)} + onRowSelect={keys => onRowSelect(keys)} + onBtnsSelect={key => this.onBtnsSelect(key, i)} + viewAttr={isEditor ? 2 : 1} + getRowSelection={isEditor ? (rowSelection) => { + Object.assign(rowSelection, { + getCheckboxProps: record => ({ + disabled: record.viewAttr === 1, // 配置无法勾选的列 + }) + }) + return rowSelection; + } : () => null} + /> + ); + } + }) + return tabChildren; + } + + onBtnsSelect = (key, index) => { + const { + jobExtend + } = this.props, { + tableInfo, + selectedRows, + setSelectedRowKeys, + selectedRowKeys + } = jobExtend; + + const datas = tableInfo[index].tabinfo.datas; + if (key === 'copy') { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (!selectedRows[index].includes(i)) { + data.viewAttr = 2; + } + return data + }) + } + if (key === 'delete') { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (selectedRows[index].includes(i)) { + data.viewAttr = 1; + } + return data + }); + setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) + } + } + + getSearchs = () => { + const { jobExtend } = this.props; + let { form, conditions, isEditor } = jobExtend; + const { isFormInit } = form; + let group = []; + let tipPosition = 'bottom'; + window.e9HideFormFieldKeys = []; + isFormInit && conditions.forEach((c, i) => { + let items = []; + c.items.forEach((field, j) => { + if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { + window.e9HideFormFieldKeys.push(field.domkey[0]); + } else { + items.push({ + com: ( + + ), + colSpan: 1 + }); + } + }); + group.push() + }); + return group; + } + + tableEditChange = (data) => { + const { jobExtend } = this.props; + let { detailSelectedKey = '0', tableInfo } = jobExtend; + tableInfo = toJS(tableInfo); + let d = cloneDeep(tableInfo); + d[Number(detailSelectedKey)].tabinfo.datas = data; + jobExtend.updateTableInfo(d); + } + + getRightMenu = () => { + const { jobExtend } = this.props; + const { isEditor, buttons } = jobExtend; + let arr = []; try { - return ( -
- - - - - {this.getSearchs()} - { - !isEmpty(tabInfo) &&
- { - jobExtend.updateDetailSelectedKey(v); - }} - /> - {this.getTabChildren()} -
- } -
-
-
- -
- ) - } catch (e) { - return -
{i18n.message.authFailed()}
-
- } - } - } - - \ No newline at end of file + if (buttons.hasEdit) { + if (isEditor) { + arr = [{ + icon: , + content: i18n.button.save(), + key: 'save', + onClick: key => { + this.saveEditCard(); + } + }, { + icon: , + content: i18n.button.back(), + key: 'back', + onClick: key => { + this.backCard(); + } + }] + } else { + arr = [{ + icon: , + content: i18n.button.modify(), + key: 'editCard', + onClick: key => { + this.editCard(); + } + } + ] + } + } + } catch (e) { } + return arr; + } + + getTopButtons = () => { + const { jobExtend } = this.props; + const { isEditor, buttons } = jobExtend; + const save = ; + const back = ; + const edit = ; + const btns = []; + try { + if (isEditor) { + if (buttons.hasSave) { + btns.push(save); + btns.push(back); + } + } else { + if (buttons.hasEdit) { + btns.push(edit); + } + } + } catch (e) { } + return btns; + } + + editCard = () => { + const { jobExtend } = this.props; + jobExtend.edit(); + } + + saveEditCard = () => { + const { jobExtend } = this.props; + jobExtend.save(); + } + + backCard = () => { + this.init(); + } + + changeData(key) { + const { + jobExtend + } = this.props; + jobExtend.changeData(key); + } + + render() { + const { jobExtend } = this.props; + const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor } = jobExtend; + + + try { + return ( +
+ + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + > + + + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + jobExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ } +
+
+
+ +
+ ) + } catch (e) { + return +
{i18n.message.authFailed()}
+
+ } + } +} + diff --git a/pc4mobx/organization/components/postionrank/JobGrade.js b/pc4mobx/organization/components/postionrank/JobGrade.js index 347501d..7237106 100644 --- a/pc4mobx/organization/components/postionrank/JobGrade.js +++ b/pc4mobx/organization/components/postionrank/JobGrade.js @@ -9,6 +9,8 @@ import { WeaTab, WeaFormItem, WeaRightMenu, + WeaLeftRightLayout, + WeaLeftTree } from 'ecCom' import { Row, @@ -67,10 +69,10 @@ export default class JobGrade extends React.Component { const { jobGrade } = this.props; - jobGrade.getTableInfo(); jobGrade.getHasRight(); + jobGrade.initData(); } - + getTopMenuBtns() { const { @@ -117,7 +119,7 @@ export default class JobGrade extends React.Component { jobGrade.getForm(); } - + custom = () => { const { jobGrade @@ -240,14 +242,14 @@ export default class JobGrade extends React.Component { let _this = this; columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { - c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + c.render = function (text, record) { + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) } - updateForbiddenTag(checked,id) { + updateForbiddenTag(checked, id) { const { jobGrade } = this.props; @@ -278,7 +280,7 @@ export default class JobGrade extends React.Component { const { jobGrade } = this.props; - + jobGrade.setNeDialogTitle(i18n.label.editJobGrade()); jobGrade.setGradeId(id); jobGrade.setIsNew(false); @@ -325,29 +327,29 @@ export default class JobGrade extends React.Component { isFormInit && searchCondition.map(c => { c.items.map((field, index) => { - arr.push( -
- - {} - -
- ) + arr.push( +
+ + {} + +
+ ) }) }) if (searchConditionLoading) { return ( -
+
) } else { return { - if ( e.keyCode == 13 && e.target.tagName === "INPUT") { - jobGrade.getTableInfo(); + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + jobGrade.getTableInfo(); jobGrade.setPanelStatus(false) } }}>{arr} @@ -371,14 +373,32 @@ export default class JobGrade extends React.Component { jobGrade } = this.props; const { - isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date,hasRight + isPanelShow, form2, gradeName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading } = jobGrade; if (hasRight === false) { return renderNoright(); } + const { + data, + onSelectedTreeNode, + selectedKeys, + onExpand, + treeExpandKeys + } = toJS(treeConfig); + const treeCom = ( + + ) + return ( hasRight &&
this.handleMenuClick(e)} > - jobGrade.setPanelStatus(bool)} - hideSearchAd={() => jobGrade.setPanelStatus(false)} - searchsAd= {isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => jobGrade.getTableInfo()} - onSearchChange={val => this.onSearchChange(val)} - /> - this.reRenderColumns(c)} - onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} - /> + + jobGrade.setPanelStatus(bool)} + hideSearchAd={() => jobGrade.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => jobGrade.getTableInfo()} + onSearchChange={val => this.onSearchChange(val)} + /> + this.reRenderColumns(c)} + onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} + /> +
- + ) + return ( hasRight &&
this.handleMenuClick(e)} > - jobLevel.setPanelStatus(bool)} - hideSearchAd={() => jobLevel.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => jobLevel.getTableInfo()} - onSearchChange={val => this.onSearchChange(val)} - /> - this.reRenderColumns(c)} - onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} - /> + + + jobLevel.setPanelStatus(bool)} + hideSearchAd={() => jobLevel.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => jobLevel.getTableInfo()} + onSearchChange={val => this.onSearchChange(val)} + /> + this.reRenderColumns(c)} + onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} + /> +
getLabel(386246, '岗位编号设置'), userNumSetting: () => getLabel(386246, '人员编号设置'), companyName: () => getLabel(385937, '分部'), + newCompany: () => getLabel(385937, '新增分部'), + viewCompany: () => getLabel(385937, '分部信息'), + updateCompany: () => getLabel(385937, '修改分部信息'), staffSchemeName: () => getLabel(385936, '编制方案'), newStaffScheme: () => getLabel(386246, '新建编制方案'), ediStaffScheme: () => getLabel(386247, '编辑编制方案'), @@ -141,12 +144,14 @@ export const i18n = { editStaff: () => getLabel(386247, '编辑编制'), changeStaff: () => getLabel(386247, '编制变更'), jobName: () => getLabel(385936, '岗位'), - newJob: () => getLabel(386246, '新建岗位'), - editJob: () => getLabel(386247, '编辑岗位'), + newJob: () => getLabel(386246, '新增岗位'), + editJobInfo: () => getLabel(386247, '修改岗位信息'), + jobInfo: () => getLabel(386247, '岗位信息'), deptManage: () => getLabel(385936, '部门管理'), - newDept: () => getLabel(386246, '新建部门'), + newDept: () => getLabel(386246, '新增部门'), mergeDept:()=> getLabel(386246, '合并部门'), transferDept:()=> getLabel(386246, '转移部门'), + editDept:()=> getLabel(386246, '修改部门信息'), typeName: () => getLabel(129927, '类型名称'), ResourceName: () => getLabel(385936, '人员'), newPeople: () => getLabel(386246, '新建人员'), diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 8079896..2e70f03 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -43,12 +43,10 @@ export class CompanyExtendStore { this.isEditor = true; this.getData(); this.getTabInfo(); - //this.tabkey = '0'; this.detailSelectedKey = '0' } init = () => { - //this.tabkey = '0'; this.detailSelectedKey = '0' this.isEditor = false; } diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 5014b82..11a6e8e 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -48,38 +48,73 @@ export class JobGradeStore { @observable topTab = []; @observable topTabCount = {}; @observable key = '';// - @observable hasRight = ''; + @observable hasRight = true; + @observable treeLoading = true; + + @observable treeConfig = { + data: [], + selectedKeys: [], + treeExpandKeys: [], + onExpand: (keys) => { + this.treeConfig.treeExpandKeys = keys; + }, + onSelectedTreeNode: (key, count, countType) => { + this.treeConfig.selectedKeys = [key]; + this.selectedTreeNodeInfo = countType.node.props.data; + this.getTableInfo(); + } + } + //选中树节点的信息 + @observable selectedTreeNodeInfo; + + @action initData = () => { + this.selectedTreeNodeInfo = null; + this.treeConfig.treeExpandKeys.length = 0; + Api.getTree().then(res => { + if (res.code === 200) { + if (res.data.length > 0) { + this.treeConfig.data = res.data; + this.treeConfig.selectedKeys = [res.data[0].key]; + this.treeConfig.treeExpandKeys = "-1"; + this.selectedTreeNodeInfo = res.data[0]; + this.getTableInfo(); + this.setTreeLoading(false); + } + } else { + message.error(res.msg); + } + }, error => { }) + } @action getTableInfo() { - let params; + let params = { + schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, + } this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { params = { - ...this.form2.getFormParams(), + ...params, gradeName: this.gradeName, - viewCondition:this.selectedKey }; } else { params = { + ...params, ...this.form2.getFormParams(), - viewCondition:this.selectedKey }; } Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + } else { message.warning(res.msg); } }, error => { message.warning(error.msg); }) - //获取tab信息(去除) - //this.getTabInfo(); - } @action @@ -384,4 +419,8 @@ export class JobGradeStore { this.hasRight = bool; } + setTreeLoading(bool) { + this.treeLoading = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index 8a2e8e2..350389d 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -48,25 +48,59 @@ export class JobLevelStore { @observable topTab = []; @observable topTabCount = {}; @observable hasRight = ''; + @observable treeLoading = true; + @observable treeConfig = { + data: [], + selectedKeys: [], + treeExpandKeys: [], + onExpand: (keys) => { + this.treeConfig.treeExpandKeys = keys; + }, + onSelectedTreeNode: (key, count, countType) => { + this.treeConfig.selectedKeys = [key]; + this.selectedTreeNodeInfo = countType.node.props.data; + this.getTableInfo(); + } + } + //选中树节点的信息 + @observable selectedTreeNodeInfo; + + @action initData = () => { + this.selectedTreeNodeInfo = null; + this.treeConfig.treeExpandKeys.length = 0; + Api.getTree().then(res => { + if (res.code === 200) { + if (res.data.length > 0) { + this.treeConfig.data = res.data; + this.treeConfig.selectedKeys = [res.data[0].key]; + this.treeConfig.treeExpandKeys = "-1"; + this.selectedTreeNodeInfo = res.data[0]; + this.getTableInfo(); + this.setTreeLoading(false); + } + } else { + message.error(res.msg); + } + }, error => { }) + } @action getTableInfo() { - let params; - //获取tab信息 - // this.getTabInfo(); + let params = { + schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, + } this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { params = { - ...this.form2.getFormParams(), + ...params, levelName: this.levelName, - viewCondition:this.selectedKey }; } else { params = { + ...params, ...this.form2.getFormParams(), - viewCondition:this.selectedKey }; } Api.getSearchList(params).then(res => { @@ -79,7 +113,7 @@ export class JobLevelStore { }, error => { message.warning(error.msg); }) - + } //删除 @@ -225,7 +259,7 @@ export class JobLevelStore { @action - getHasRight() { + getHasRight() { Api.getHasRight().then(res => { if (res.code === 200) { res.data.rightMenu && this.setRightMenu(res.data.rightMenu); @@ -344,4 +378,8 @@ export class JobLevelStore { this.hasRight = bool; } + setTreeLoading(bool) { + this.treeLoading = bool; + } + } \ No newline at end of file From 09d7776a3e416c918b3f579276a382310d616077 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 23 Jun 2022 11:53:57 +0800 Subject: [PATCH 030/155] =?UTF-8?q?=E9=9C=80=E6=B1=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NewAndEditDialog.js | 13 +- .../components/company/company.js | 20 +++- .../components/department/department.js | 16 ++- pc4mobx/organization/components/job/Job.js | 16 ++- .../components/resource/resource.js | 5 + .../organization/components/staff/Staff.js | 113 ++++++++++++------ .../components/staff/StaffScheme.js | 3 +- pc4mobx/organization/stores/department.js | 15 ++- pc4mobx/organization/stores/fieldDefined.js | 2 +- pc4mobx/organization/stores/job.js | 13 +- pc4mobx/organization/stores/staff.js | 2 +- pc4mobx/organization/stores/staffscheme.js | 23 ++++ 12 files changed, 178 insertions(+), 63 deletions(-) diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 7513c42..1340383 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -54,14 +54,15 @@ export default class NewAndEditDialog extends React.Component { } onChange = data => { + const { + bindChangeEnvent, + } = this.props; if(this.state.enable && data.schemeId) { - const { - condition, - form, - bindChangeEnvent, - } = this.props; bindChangeEnvent(data.schemeId.value); } + if(this.state.enable && data.planYear){ + bindChangeEnvent(data.planYear.value); + } }; @@ -118,12 +119,14 @@ export default class NewAndEditDialog extends React.Component { isEdit, height, conditionLen, + saveAndSetting } = this.props, { width, } = this.state; const buttons = [ (), + (saveAndSetting && ), () ]; diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index e28f0fc..cd9c90b 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-22 15:13:10 + * @LastEditTime: 2022-06-23 11:49:05 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -47,7 +47,6 @@ import { renderNoright } from '../../util'; const toJS = mobx.toJS; const confirm = Modal.confirm; -//const WeaTable = WeaTableNew.WeaTable @inject('company') @@ -132,13 +131,17 @@ export default class Company extends React.Component { const { company } = this.props; - company.setNeDialogTitle(i18n.label.companyName()); company.setVisible(true); company.setDialogLoadingStatus(true); company.getDeptTable(id); } + //查看 + view(id) { + window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${id}`, "_blank") + } + batchDelete() { const { company @@ -277,6 +280,9 @@ export default class Company extends React.Component { { _this.select(record.id) }}>联查部门 + + { _this.view(record.id) }}>查看 +
) return @@ -324,6 +330,13 @@ export default class Company extends React.Component { company.save(); } + handleSaveAndSetting() { + const { + company + } = this.props; + company.save(); + } + getTabBtn() { const { company @@ -516,6 +529,7 @@ export default class Company extends React.Component { save={() => this.handleSave()} onCancel={() => company.setNewVisible(false)} enable={false} //是否开启字段联动 + saveAndSetting = {() => this.handleSaveAndSetting()} />
) diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 4b6de65..31b0004 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-22 16:42:37 + * @LastEditTime: 2022-06-23 11:49:38 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -162,7 +162,6 @@ const { department } = this.props; - department.setNeDialogTitle(i18n.label.transferDept()); department.setConfirmVisible(true); department.setIds(id); @@ -170,6 +169,11 @@ department.getTransferForm(id); } + + //查看 + view(id) { + window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${id}`, "_blank") + } copy() { const { @@ -348,6 +352,9 @@ c.render = function (text, record) { const menu = ( + + { _this.view(record.id) }}>查看 + { _this.doDel(record.id) }}>删除 @@ -388,6 +395,10 @@ department.save(); } + handleSaveAndSetting() { + + } + PopconfirmSave() { const { department @@ -648,6 +659,7 @@ save={() => this.handleSave()} onCancel={() => department.setNewVisible(false)} enable={false} //是否开启字段联动 + saveAndSetting = {() => this.handleSaveAndSetting()} /> + + { _this.view(record.id) }}>查看 + { _this.doDel(record.id) }}>删除 - + { _this.select(record.id) }}>联查人员 @@ -347,6 +350,10 @@ export default class Job extends React.Component { this.showConfirm('del'); } + view(id) { + window.open(`/spa/organization/static/index.html#/main/organization/jobExtend/${id}`, "_blank") + } + handleSave() { const { @@ -355,6 +362,10 @@ export default class Job extends React.Component { job.save(); } + handleSaveAndSetting() { + + } + getTabBtn() { const { job @@ -604,6 +615,7 @@ export default class Job extends React.Component { save={() => this.handleSave()} onCancel={() => job.setNewVisible(false)} enable={false} //是否开启字段联动 + saveAndSetting = {() => this.handleSaveAndSetting()} />
) diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 014f296..18b6fb3 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -321,6 +321,10 @@ export default class Resource extends React.Component { !isNew && resource.edit(); } + handleSaveAndSetting() { + + } + getPanelComponents() { const { resource @@ -448,6 +452,7 @@ export default class Resource extends React.Component { save={() => this.handleSave()} onCancel={() => resource.setVisible(false)} enable={false} //是否开启字段联动 + saveAndSetting = {() => this.handleSaveAndSetting()} />
) diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 7b8222f..885aefe 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -9,6 +9,8 @@ import { WeaTab, WeaFormItem, WeaRightMenu, + WeaLeftRightLayout, + WeaOrgTree } from 'ecCom' import { Row, @@ -218,10 +220,40 @@ export default class Staff extends React.Component { reRenderColumns(columns) { let _this = this; // columns.forEach((c, index) => { - + // }) } + getTree = () => { + const { + staff + } = this.props; + const { + companysId, + } = staff + + let tree = ( + ${i18n.label.organization()}`} + treeNodeClick={this.treeNodeClick} + expandAllChildrenOnSearch={true} + /> + ) + + return tree; + } + + onOperatesClick(record, rowIndex, operate) { const { @@ -236,7 +268,7 @@ export default class Staff extends React.Component { const { staff } = this.props; - + staff.setNeDialogTitle(i18n.label.editStaff()); staff.setStaffId(id); staff.setOperateType("1"); @@ -249,7 +281,7 @@ export default class Staff extends React.Component { const { staff } = this.props; - + staff.setNeDialogTitle(i18n.label.changeStaff()); staff.setStaffId(id); staff.setOperateType("2"); @@ -310,29 +342,29 @@ export default class Staff extends React.Component { isFormInit && searchCondition.map(c => { c.items.map((field, index) => { - arr.push( -
- - {} - -
- ) + arr.push( +
+ + {} + +
+ ) }) }) if (searchConditionLoading) { return ( -
+
) } else { return { - if ( e.keyCode == 13 && e.target.tagName === "INPUT") { - staff.getTableInfo(); + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + staff.getTableInfo(); staff.setPanelStatus(false) } }}>{arr} @@ -357,8 +389,8 @@ export default class Staff extends React.Component { staff } = this.props; const { - isPanelShow, form2, staffName, conditionNum, tableStore,nEdialogTitle,visible,condition, - form,dialogLoading,isEdit,date,hasRight + isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, date, hasRight } = staff; if (hasRight === false) { @@ -381,29 +413,32 @@ export default class Staff extends React.Component { dropMenuDatas={this.getDropMenuDatas()} onDropMenuClick={(e) => this.handleMenuClick(e)} > - staff.setPanelStatus(bool)} - hideSearchAd={() => staff.setPanelStatus(false)} - searchsAd= {isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => staff.getTableInfo()} - onSearchChange={val => this.onSearchChange(val)} - /> - this.reRenderColumns(c)} - onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} - /> + + + staff.setPanelStatus(bool)} + hideSearchAd={() => staff.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => staff.getTableInfo()} + onSearchChange={val => this.onSearchChange(val)} + /> + this.reRenderColumns(c)} + onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} + /> +
- this.handleSave()} onCancel={() => staffScheme.setVisible(false)} - enable={false} //是否开启字段联动 + enable={true} //是否开启字段联动 + bindChangeEnvent={val => staffScheme.updateConditions(val)} />
) diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 1f6f10b..6c8497d 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -65,12 +65,14 @@ export class DepartmentStore { @observable isMerge = true; @observable hasRight = ''; + @observable selectTreeNodeInfo; + @action - getTableInfo(params) { + getTableInfo() { this.setLoading(true); - params = { - ...params, + let params = { + ...this.selectTreeNodeInfo, current: this.current, pageSize: this.pageSize } @@ -106,8 +108,11 @@ export class DepartmentStore { @action("nodetree事件") doSearch(params) { + this.selectTreeNodeInfo = params; + this.setCurrent(1); + this.setPageSize(10); this.setInit(true); - this.getTableInfo(params); + this.getTableInfo(); } @action("联查岗位") @@ -371,7 +376,7 @@ export class DepartmentStore { updateFields(val) { this.form.updateFields({ - compName: { + departmentName: { value: val } }); diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index cc230f6..ae8839b 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-20 11:07:43 + * @LastEditTime: 2022-06-23 09:58:27 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 853dd2a..1eb56c4 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -60,12 +60,14 @@ export class JobStore { @observable companysId = 1 @observable hasRight = ''; + @observable selectTreeNodeInfo; + @action - getTableInfo(params) { + getTableInfo() { this.setLoading(true); - params = { - ...params, + let params = { + ...this.selectTreeNodeInfo, current: this.current, pageSize: this.pageSize } @@ -101,8 +103,11 @@ export class JobStore { @action("nodetree事件") doSearch(params) { + this.selectTreeNodeInfo = params; + this.setCurrent(1); + this.setPageSize(10); this.setInit(true); - this.getTableInfo(params); + this.getTableInfo(); } @action("联查人员") diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index be15286..e4e10df 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -46,7 +46,7 @@ export class StaffStore { @observable date = ''; @observable hasRight = ''; @observable operateType = ''; //1 编辑 2 变更 - + @observable companysId = 1; @action diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js index adf62a4..84bc659 100644 --- a/pc4mobx/organization/stores/staffscheme.js +++ b/pc4mobx/organization/stores/staffscheme.js @@ -17,6 +17,9 @@ import { import { i18n } from '../public/i18n'; +import { + findIndex +} from 'lodash'; const toJS = mobx.toJS; const { @@ -216,6 +219,26 @@ export class StaffSchemeStore { }) } + updateConditions(val) { + const timeStartValue = val+'-01-01'; + const timeEndValue = val+'-12-31' + // const label = "年度" + // let item = findIndex(this.condition[0].items,{label}); + this.form.updateFields({ + timeStart: { + value: timeStartValue + } + }); + this.form.updateFields({ + timeEnd: { + value: timeEndValue + } + }); + + + + } + updateFields(val) { this.form2.updateFields({ planName: { From 82b54b8bde783a2c3744b0e5740bac1082bd165c Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 24 Jun 2022 14:38:54 +0800 Subject: [PATCH 031/155] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NewAndEditDialog.js | 17 ++- .../components/company/company.js | 57 +++++++- .../components/department/department.js | 14 +- .../organization/components/group/Group.js | 1 - pc4mobx/organization/components/job/Job.js | 23 ++- .../components/postionrank/JobGrade.js | 2 +- .../components/postionrank/JobLevel.js | 1 - .../components/postionrank/RankScheme.js | 1 - .../components/resource/resource.js | 1 - .../components/sequence/Sequence.js | 1 - .../organization/components/staff/Staff.js | 66 ++++++++- .../components/staff/StaffScheme.js | 2 +- pc4mobx/organization/stores/company.js | 136 ++++++++++++++++-- pc4mobx/organization/stores/companyextend.js | 4 +- pc4mobx/organization/stores/department.js | 45 ++++-- .../organization/stores/departmentextend.js | 4 +- pc4mobx/organization/stores/job.js | 47 ++++-- pc4mobx/organization/stores/jobextend.js | 4 +- pc4mobx/organization/stores/staff.js | 34 ++++- 19 files changed, 390 insertions(+), 70 deletions(-) diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 1340383..8f4ea36 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -24,8 +24,6 @@ export default class NewAndEditDialog extends React.Component { super(props); this.state = { width: 700, - enable: props.enable - } } @@ -56,15 +54,20 @@ export default class NewAndEditDialog extends React.Component { onChange = data => { const { bindChangeEnvent, + moduleName } = this.props; - if(this.state.enable && data.schemeId) { + if(moduleName == 'jobGrade' && data.schemeId) { bindChangeEnvent(data.schemeId.value); } - if(this.state.enable && data.planYear){ + if(moduleName == 'staffScheme' && data.planYear){ bindChangeEnvent(data.planYear.value); } - - + if(moduleName == 'department' && data.parent_comp ){ + bindChangeEnvent(data); + } + if(moduleName == 'job' && (data.sequence_id)){ + bindChangeEnvent(data); + } }; onBlur = data => { @@ -126,7 +129,7 @@ export default class NewAndEditDialog extends React.Component { const buttons = [ (), - (saveAndSetting && ), + (saveAndSetting && ), () ]; diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index cd9c90b..2783ea4 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-23 11:49:05 + * @LastEditTime: 2022-06-24 14:15:51 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -142,6 +142,52 @@ export default class Company extends React.Component { window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${id}`, "_blank") } + transfer(id) { + const { + company + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: this.getTransferForm(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + company.transfer(id) + }, + onCancel() { + return false; + }, + }); + } + + getTransferForm() { + const { + company + } = this.props; + const { + transferCondition, + form2, + } = company; + let formParams = form2.getFormParams(); + const { + isFormInit + } = form2; + let arr = []; + isFormInit && transferCondition.map(c => { + c.items.map((field, index) => { + arr.push( + + {} + + ) + }) + }) + return arr; + } + batchDelete() { const { company @@ -283,6 +329,9 @@ export default class Company extends React.Component { { _this.view(record.id) }}>查看 + + { _this.transfer(record.id) }}>转移 + ) return @@ -327,6 +376,7 @@ export default class Company extends React.Component { const { company } = this.props; + company.setSaveAndSetting(false); company.save(); } @@ -334,7 +384,9 @@ export default class Company extends React.Component { const { company } = this.props; + company.setSaveAndSetting(true); company.save(); + } getTabBtn() { @@ -428,6 +480,7 @@ export default class Company extends React.Component { } const rowSelection = { + selectedRowKeys:selectedRowKeys, type: "checkbox", onChange(selectedRowKeys, selectedRows) { company.setSelectedRowKeys(selectedRowKeys); @@ -497,6 +550,7 @@ export default class Company extends React.Component { rowSelection={rowSelection} pagination={pagination} onChange={(pagination, filters, sorter) => { + company.setSortParams(sorter); company.setCurrent(pagination.current); company.setPageSize(pagination.pageSize); company.getTableInfo(); @@ -528,7 +582,6 @@ export default class Company extends React.Component { conditionLen={4} save={() => this.handleSave()} onCancel={() => company.setNewVisible(false)} - enable={false} //是否开启字段联动 saveAndSetting = {() => this.handleSaveAndSetting()} />
diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 31b0004..fe39a14 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-23 11:49:38 + * @LastEditTime: 2022-06-24 13:46:13 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -392,11 +392,16 @@ const { department } = this.props; + department.setSaveAndSetting(false); department.save(); } handleSaveAndSetting() { - + const { + department + } = this.props; + department.setSaveAndSetting(true); + department.save(); } PopconfirmSave() { @@ -557,6 +562,7 @@ } const rowSelection = { + selectedRowKeys:selectedRowKeys, type:"checkbox", onChange(selectedRowKeys, selectedRows) { department.setSelectedRowKeys(selectedRowKeys); @@ -627,6 +633,7 @@ rowSelection={rowSelection} pagination={pagination} onChange={(pagination, filters, sorter) => { + department.setSortParams(sorter); department.setCurrent(pagination.current); department.setPageSize(pagination.pageSize); department.getTableInfo(); @@ -658,8 +665,9 @@ conditionLen={13} save={() => this.handleSave()} onCancel={() => department.setNewVisible(false)} - enable={false} //是否开启字段联动 saveAndSetting = {() => this.handleSaveAndSetting()} + moduleName={"department"} + bindChangeEnvent={val => department.updateConditions(val)} /> this.handleSave()} onCancel={() => group.setVisible(false)} - enable={false} //是否开启字段联动 />
) diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index eadd5ef..002be5e 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-23 11:50:44 + * @LastEditTime: 2022-06-24 14:36:50 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -126,7 +126,7 @@ export default class Job extends React.Component { job } = this.props; - job.setNeDialogTitle(i18n.label.newJob()); + job.setNeDialogTitle(i18n.label.newPost()); job.setNewVisible(true); job.getJobForm(); @@ -143,6 +143,10 @@ export default class Job extends React.Component { job.getHrmTable(id); } + merge(id) { + alert("后续更新") + } + copy() { const { @@ -330,6 +334,9 @@ export default class Job extends React.Component { { _this.select(record.id) }}>联查人员 + + { _this.merge(record.id) }}>合并 + ) return @@ -359,11 +366,16 @@ export default class Job extends React.Component { const { job } = this.props; + job.setSaveAndSetting(false); job.save(); } handleSaveAndSetting() { - + const { + job + } = this.props; + job.setSaveAndSetting(true); + job.save() } getTabBtn() { @@ -516,6 +528,7 @@ export default class Job extends React.Component { const rowSelection = { + selectedRowKeys:selectedRowKeys, onChange(selectedRowKeys, selectedRows) { job.setSelectedRowKeys(selectedRowKeys); }, @@ -585,6 +598,7 @@ export default class Job extends React.Component { rowSelection={rowSelection} pagination={pagination} onChange={(pagination, filters, sorter) => { + job.setSortParams(sorter); job.setCurrent(pagination.current); job.setPageSize(pagination.pageSize); job.getTableInfo(); @@ -614,8 +628,9 @@ export default class Job extends React.Component { conditionLen={13} save={() => this.handleSave()} onCancel={() => job.setNewVisible(false)} - enable={false} //是否开启字段联动 saveAndSetting = {() => this.handleSaveAndSetting()} + moduleName={"job"} + bindChangeEnvent={val => job.updateConditions(val)} />
) diff --git a/pc4mobx/organization/components/postionrank/JobGrade.js b/pc4mobx/organization/components/postionrank/JobGrade.js index 7237106..f10c527 100644 --- a/pc4mobx/organization/components/postionrank/JobGrade.js +++ b/pc4mobx/organization/components/postionrank/JobGrade.js @@ -457,7 +457,7 @@ export default class JobGrade extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => jobGrade.setVisible(false)} - enable={true} //是否开启字段联动 + moduleName={"jobGrade"} bindChangeEnvent={val => jobGrade.updateConditions(val)} />
diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index 3df8592..a8959f0 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -454,7 +454,6 @@ export default class JobLevel extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => jobLevel.setVisible(false)} - enable={false} //是否开启字段联动 />
) diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 2158d77..4008a37 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -422,7 +422,6 @@ export default class RankScheme extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => rankScheme.setVisible(false)} - enable={false} //是否开启字段联动 />
) diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 18b6fb3..5e035eb 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -451,7 +451,6 @@ export default class Resource extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => resource.setVisible(false)} - enable={false} //是否开启字段联动 saveAndSetting = {() => this.handleSaveAndSetting()} />
diff --git a/pc4mobx/organization/components/sequence/Sequence.js b/pc4mobx/organization/components/sequence/Sequence.js index 042000f..75ec848 100644 --- a/pc4mobx/organization/components/sequence/Sequence.js +++ b/pc4mobx/organization/components/sequence/Sequence.js @@ -433,7 +433,6 @@ export default class Sequence extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => sequence.setVisible(false)} - enable={false} //是否开启字段联动 />
) diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 885aefe..8c5ab4f 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -212,7 +212,6 @@ export default class Staff extends React.Component { const { form2 } = staff; - staff.setStaffName(val); //!this.isEmptyObject(form2.getFormParams()) && staff.updateFields(val); } @@ -249,10 +248,69 @@ export default class Staff extends React.Component { expandAllChildrenOnSearch={true} /> ) - return tree; } + treeNodeClick = (event, ids, nodeids, nodes) => { + const { + staff + } = this.props; + const { + form2, + companysId + } = staff; + const type = event.node.props.type || '0'; + const id = event.node.props.id || ''; + let params = {}; + form2.resetConditionValue(); + if (type == '0') { + params['virtualtype'] = companysId; + } + if (type == '1') { + params['compId'] = id; + } + if (type == '2') { + params['deptId'] = id; + } + staff.doSearch(params); + } + + replaceLeft() { + const { + staff + } = this.props; + const { + leftCondition, + form1, + } = staff; + let formParams = form1.getFormParams(); + const { + isFormInit + } = form1; + let arr = []; + isFormInit && leftCondition.map(c => { + c.items.map((field, index) => { + arr.push( +
+ + {} + +
+ ) + }) + }) + return arr; + } + + onChange = data => { + const { + staff + } = this.props; + staff.setPlanId(data.planId.value) + }; onOperatesClick(record, rowIndex, operate) { @@ -415,7 +473,7 @@ export default class Staff extends React.Component { > - staff.getTableInfo()} onSearchChange={val => this.onSearchChange(val)} + replaceLeft={this.replaceLeft()} /> this.handleSave()} onCancel={() => staff.setVisible(false)} - enable={false} //是否开启字段联动 />
) diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index b7e92f1..0810c4d 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -435,7 +435,7 @@ export default class StaffScheme extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => staffScheme.setVisible(false)} - enable={true} //是否开启字段联动 + moduleName={"staffScheme"} bindChangeEnvent={val => staffScheme.updateConditions(val)} />
diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 4a799a3..500af3e 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -49,27 +49,34 @@ export class CompanyStore { @observable visible = false; @observable newVisible = false; //新增弹窗 @observable companyId = ''; - @observable selectedRowKeys = ''; + @observable selectedRowKeys = []; @observable date = ''; @observable init = true; //是否首次加载 @observable total = ''; @observable current = 1; @observable pageSize = 10; + @observable sortParams = []; @observable hasRight = ''; + saveAndSetting = false; + + @observable form2 = new WeaForm(); //转移表单 + @action transfer(id) { + debugger + } @action getTableInfo() { this.setLoading(true); let params = { current: this.current, - pageSize: this.pageSize + pageSize: this.pageSize, + sortParams: this.sortParams } if (this.isEmptyObject(this.form.getFormParams())) { params = { ...params, - ...this.form.getFormParams(), compName: this.companyName }; } else { @@ -88,17 +95,15 @@ export class CompanyStore { res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); this.setLoading(false); this.setInit(false); + + //form2 + this.form2.initFormFields(this.transferCondition); } else { message.warning(res.msg); } }).catch(error => { message.warning(error.msg); }) - - - - - } @action("联查部门") @@ -131,7 +136,7 @@ export class CompanyStore { }).then(data => { if (data.code === 200) { message.success(i18n.message.deleteSuccess()); - this.setSelectedRowKeys(''); + this.setSelectedRowKeys([]); this.getTableInfo(); } else { message.warning(data.msg); @@ -206,6 +211,7 @@ export class CompanyStore { message.success(data.msg); this.getTableInfo(); this.setNewVisible(false); + this.saveAndSetting && window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${data.data}`, "_blank") } else { message.warning(data.msg); } @@ -219,7 +225,6 @@ export class CompanyStore { }); } - @action getHasRight() { Api.getHasRight().then(res => { @@ -368,9 +373,118 @@ export class CompanyStore { setInit(bool) { this.init = bool; } - + setHasRight(bool) { this.hasRight = bool; } + setSortParams(sorter) { + this.sortParams = []; + sorter.order && this.sortParams.push({ + orderkey: sorter.field, + sortOrder: sorter.order + }) + } + + setSaveAndSetting(bool) { + this.saveAndSetting = bool; + } + + /********************* form2 *********************/ + + transferCondition = [ + { + "defaultshow": true, + "items": [ + { + "belong": "PC", + "browserConditionParam": { + "asynLoadAll": false, + "checkStrictly": true, + "completeParams": { + "type": 161, + "fielddbtype": "browser.compBrowser" + }, + "conditionDataParams": { + "type": "browser.compBrowser" + }, + "dataParams": { + "currenttime": new Date(), + "type": "browser.compBrowser" + }, + "defaultCheckStrictly": true, + "defaultExpandedLevel": 0, + "destDataParams": { + "type": "browser.compBrowser" + }, + "expandfirstnode": false, + "handleTypes": "", + "hasAddBtn": false, + "hasAdvanceSerach": false, + "hasBorder": false, + "hasTabConditions": false, + "hideAdvanceSearch": false, + "hideVirtualOrg": false, + "icon": "icon-coms-integration", + "iconColor": "#1a57a0", + "idSeparator": ",", + "isAutoComplete": 1, + "isDetail": 0, + "isMultCheckbox": false, + "isSingle": true, + "linkUrl": "", + "noOperate": true, + "otherParams": {}, + "pageSize": -1, + "quickSearchName": "", + "replaceDatas": [], + "replaceNotCtrl": false, + "scrollx": true, + "searchParams": {}, + "searchPlaceholder": "", + "showCheckStrictly": true, + "title": "公司分部浏览按钮", + "type": "161", + "viewAttr": 2 + }, + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "BROWSER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "parent_company" + ], + "entSearch": false, + "fieldcol": 16, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "转移到", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "valueList": [], + "viewAttr": 2 + }, + ], + "title": "基本信息" + } + ] + + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 2e70f03..6d15ee8 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -90,11 +90,11 @@ export class CompanyExtendStore { this.getData(); this.selectedRowKeys = []; } else { - message.warning(data.message); + message.warning(data.msg); } this.loading = false; }, error => { - message.warning(error.message); + message.warning(error.msg); this.loading = false; }) } diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 6c8497d..22bac93 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -49,12 +49,13 @@ export class DepartmentStore { @observable visible = false; @observable newVisible = false; //新增弹窗 @observable departmentId = ''; - @observable selectedRowKeys = ''; + @observable selectedRowKeys = []; @observable date = ''; @observable init = true; //是否首次加载 @observable total = ''; @observable current = 1; @observable pageSize = 10; + @observable sortParams = []; @observable defaultShowLeft = true; @observable companysId = 1 //集团id @observable postionDataSource = []; @@ -66,6 +67,7 @@ export class DepartmentStore { @observable hasRight = ''; @observable selectTreeNodeInfo; + saveAndSetting = false; @action @@ -74,12 +76,12 @@ export class DepartmentStore { let params = { ...this.selectTreeNodeInfo, current: this.current, - pageSize: this.pageSize + pageSize: this.pageSize, + sortParams: this.sortParams } if (this.isEmptyObject(this.form.getFormParams())) { params = { ...params, - ...this.form.getFormParams(), departmentName: this.departmentName }; } else { @@ -128,7 +130,7 @@ export class DepartmentStore { } else { message.warning(res.msg); } - },error => { + }, error => { message.warning(error.msg); }) } @@ -143,7 +145,7 @@ export class DepartmentStore { }).then(data => { if (data.code === 200) { message.success(i18n.message.deleteSuccess()); - this.setSelectedRowKeys(''); + this.setSelectedRowKeys([]); this.getTableInfo(); } else { message.warning(data.msg); @@ -207,7 +209,7 @@ export class DepartmentStore { @action("合并部门") getMergeForm(id) { let params = { - id:id + id: id }; this.setConfirmLoading(true); Api.getMergeForm(params).then(res => { @@ -226,7 +228,7 @@ export class DepartmentStore { @action("转移部门") getTransferForm(id) { let params = { - id:id + id: id }; this.setConfirmLoading(true); Api.getTransferForm(params).then(res => { @@ -271,6 +273,7 @@ export class DepartmentStore { message.success(data.msg); this.getTableInfo(); this.setNewVisible(false); + this.saveAndSetting && window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${data.data}`, "_blank") } else { message.warning(data.msg); } @@ -286,7 +289,7 @@ export class DepartmentStore { merge() { let params = { - id:this.ids, + id: this.ids, ...this.form1.getFormParams() }; this.form1.validateForm().then(f => { @@ -313,7 +316,7 @@ export class DepartmentStore { transfer() { let params = { - id:this.ids, + id: this.ids, ...this.form1.getFormParams() }; this.form1.validateForm().then(f => { @@ -349,7 +352,7 @@ export class DepartmentStore { if (data.code === 200) { message.success(data.msg); this.getTableInfo(); - this.setSelectedRowKeys(''); + this.setSelectedRowKeys([]); } else { message.error(data.msg); } @@ -374,6 +377,14 @@ export class DepartmentStore { }) } + updateConditions(data) { + this.form1.updateFields({ + parent_dept: { + value: '' + } + }); + } + updateFields(val) { this.form.updateFields({ departmentName: { @@ -528,5 +539,17 @@ export class DepartmentStore { setHasRight(bool) { this.hasRight = bool; -} + } + + setSortParams(sorter) { + this.sortParams = []; + sorter.order && this.sortParams.push({ + orderkey: sorter.field, + sortOrder: sorter.order + }) + } + + setSaveAndSetting(bool) { + this.saveAndSetting = bool; + } } \ No newline at end of file diff --git a/pc4mobx/organization/stores/departmentextend.js b/pc4mobx/organization/stores/departmentextend.js index d95c3ec..3595bab 100644 --- a/pc4mobx/organization/stores/departmentextend.js +++ b/pc4mobx/organization/stores/departmentextend.js @@ -89,11 +89,11 @@ export class DepartmentExtendStore { this.getData(); this.selectedRowKeys = []; } else { - message.warning(data.message); + message.warning(data.msg); } this.loading = false; }, error => { - message.warning(error.message); + message.warning(error.msg); this.loading = false; }) } diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 1eb56c4..7146422 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -17,6 +17,9 @@ import { import { i18n } from '../public/i18n'; +import { + findIndex +} from 'lodash'; const toJS = mobx.toJS; const { @@ -49,19 +52,19 @@ export class JobStore { @observable visible = false; @observable newVisible = false; //新增弹窗 @observable jobId = ''; - @observable selectedRowKeys = ''; + @observable selectedRowKeys = []; @observable date = ''; @observable init = true; //是否首次加载 @observable total = ''; @observable current = 1; @observable pageSize = 10; - + @observable sortParams = []; @observable defaultShowLeft = true; @observable companysId = 1 @observable hasRight = ''; @observable selectTreeNodeInfo; - + saveAndSetting = false; @action getTableInfo() { @@ -69,13 +72,13 @@ export class JobStore { let params = { ...this.selectTreeNodeInfo, current: this.current, - pageSize: this.pageSize + pageSize: this.pageSize, + sortParams: this.sortParams } if (this.isEmptyObject(this.form.getFormParams())) { params = { ...params, - ...this.form.getFormParams(), - jobName: this.jobName + jobName: this.jobName, }; } else { params = { @@ -101,7 +104,7 @@ export class JobStore { }) } - @action("nodetree事件") + @action("leftTree事件") doSearch(params) { this.selectTreeNodeInfo = params; this.setCurrent(1); @@ -137,7 +140,7 @@ export class JobStore { }).then(data => { if (data.code === 200) { message.success(i18n.message.deleteSuccess()); - this.setSelectedRowKeys(''); + this.setSelectedRowKeys([]); this.getTableInfo(); } else { message.warning(data.msg); @@ -227,6 +230,7 @@ export class JobStore { message.success(data.msg); this.getTableInfo(); this.setNewVisible(false); + this.saveAndSetting && window.open(`/spa/organization/static/index.html#/main/organization/jobExtend/${data.data}`, "_blank") } else { message.warning(data.msg); } @@ -251,8 +255,7 @@ export class JobStore { if (data.code === 200) { message.success(data.msg); this.getTableInfo(); - this.form2 = new WeaForm(); - this.setSelectedRowKeys(''); + this.setSelectedRowKeys([]); } else { message.error(data.msg); } @@ -262,6 +265,18 @@ export class JobStore { } + updateConditions(data) { + this.form1.updateFields({ + scheme_id: { + value: '', + }, + }); + const label = "等级方案" + let index = findIndex(this.condition[0].items,{label}); + this.condition[0].items[index].browserConditionParam.replaceDatas = []; + + } + @action getHasRight() { @@ -413,4 +428,16 @@ export class JobStore { this.hasRight = bool; } + setSortParams(sorter) { + this.sortParams = []; + sorter.order && this.sortParams.push({ + orderkey: sorter.field, + sortOrder: sorter.order + }) + } + + setSaveAndSetting(bool) { + this.saveAndSetting = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index f16c8d7..1c6f8c3 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -92,11 +92,11 @@ export class JobExtendStore { this.getData(); this.selectedRowKeys = []; } else { - message.warning(data.message); + message.warning(data.msg); } this.loading = false; }, error => { - message.warning(error.message); + message.warning(error.msg); this.loading = false; }) } diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index e4e10df..aeff9ba 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -10,7 +10,7 @@ import { import { WeaTableNew } from 'comsMobx'; -import { +import { Modal, message, } from 'antd' @@ -28,6 +28,7 @@ export class StaffStore { @observable topMenu = [] @observable rightMenu = []; @observable condition = []; + @observable leftCondition = []; @observable searchCondition = []; @observable isEdit = true; @observable isNew = true; @@ -48,19 +49,26 @@ export class StaffStore { @observable operateType = ''; //1 编辑 2 变更 @observable companysId = 1; + @observable planId = ''; + @observable selectTreeNodeInfo; + @action getTableInfo() { - let params; + let params = { + planId: this.planId, + ...this.selectTreeNodeInfo, + } this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { params = { - ...this.form2.getFormParams(), - staffName: this.staffName + ...params, + staffName: this.staffName, }; } else { params = { - ...this.form2.getFormParams() + ...this.form2.getFormParams(), + ...params, }; } Api.getSearchList(params).then(res => { @@ -146,6 +154,11 @@ export class StaffStore { }); } + @action("leftTree事件") + doSearch(params) { + this.selectTreeNodeInfo = params; + this.getTableInfo(); + } getForm() { let params = this.isNew ? {} : { @@ -190,6 +203,8 @@ export class StaffStore { if (res.code === 200) { res.data.rightMenu && this.setRightMenu(res.data.rightMenu); res.data.topMenu && this.setTopMenu(res.data.topMenu); + res.data.condition && this.setLeftCondition(res.data.condition); + res.data.condition && this.form1.initFormFields(res.data.condition); } else { message.warning(res.msg); } @@ -297,5 +312,14 @@ export class StaffStore { this.operateType = operateType; } + setLeftCondition(leftCondition) { + this.leftCondition = leftCondition; + } + + setPlanId(planId) { + this.planId = planId; + this.getTableInfo(); + } + } \ No newline at end of file From 58b118ebe365e0fbc5eaabc126572d7418d05eba Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 24 Jun 2022 17:58:51 +0800 Subject: [PATCH 032/155] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/company.js | 15 ++ .../components/NewAndEditDialog.js | 2 +- .../components/company/company.js | 3 +- pc4mobx/organization/stores/company.js | 139 +++++------------- pc4mobx/organization/stores/department.js | 19 ++- pc4mobx/organization/stores/jobgrade.js | 15 -- 6 files changed, 74 insertions(+), 119 deletions(-) diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index 6fb261f..d90adc4 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -76,11 +76,26 @@ export const updateForbiddenTag = (params) => { }) } +export const move = (params) => { + return fetch('/api/bs/hrmorganization/comp/moveCompany', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + export const getCompanyForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', params); } +export const getMoveForm = () => { + return WeaTools.callApi('/api/bs/hrmorganization/comp/getMoveForm', 'GET'); +} + export const getCompanyExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params); } diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 8f4ea36..cd2ba9f 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -63,7 +63,7 @@ export default class NewAndEditDialog extends React.Component { bindChangeEnvent(data.planYear.value); } if(moduleName == 'department' && data.parent_comp ){ - bindChangeEnvent(data); + bindChangeEnvent(data.parent_comp.value); } if(moduleName == 'job' && (data.sequence_id)){ bindChangeEnvent(data); diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 2783ea4..002cbfa 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-24 14:15:51 + * @LastEditTime: 2022-06-24 16:47:53 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -79,6 +79,7 @@ export default class Company extends React.Component { } = this.props; company.getTableInfo(); company.getHasRight(); + company.getMoveForm(); } getTopMenuBtns() { diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 500af3e..40f0e1e 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -60,11 +60,10 @@ export class CompanyStore { saveAndSetting = false; @observable form2 = new WeaForm(); //转移表单 + @observable transferCondition = []; - @action transfer(id) { - debugger - } + @action getTableInfo() { @@ -95,9 +94,6 @@ export class CompanyStore { res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list); this.setLoading(false); this.setInit(false); - - //form2 - this.form2.initFormFields(this.transferCondition); } else { message.warning(res.msg); } @@ -198,6 +194,38 @@ export class CompanyStore { } + getMoveForm() { + Api.getMoveForm().then(res => { + if (res.code === 200) { + res.data && this.setTransferCondition(res.data); + res.data && this.form2.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action transfer(id) { + let params = { + id: id, + ...this.form2.getFormParams(), + }; + Api.move(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + save() { let params = { ...this.form1.getFormParams() @@ -390,101 +418,10 @@ export class CompanyStore { this.saveAndSetting = bool; } - /********************* form2 *********************/ - - transferCondition = [ - { - "defaultshow": true, - "items": [ - { - "belong": "PC", - "browserConditionParam": { - "asynLoadAll": false, - "checkStrictly": true, - "completeParams": { - "type": 161, - "fielddbtype": "browser.compBrowser" - }, - "conditionDataParams": { - "type": "browser.compBrowser" - }, - "dataParams": { - "currenttime": new Date(), - "type": "browser.compBrowser" - }, - "defaultCheckStrictly": true, - "defaultExpandedLevel": 0, - "destDataParams": { - "type": "browser.compBrowser" - }, - "expandfirstnode": false, - "handleTypes": "", - "hasAddBtn": false, - "hasAdvanceSerach": false, - "hasBorder": false, - "hasTabConditions": false, - "hideAdvanceSearch": false, - "hideVirtualOrg": false, - "icon": "icon-coms-integration", - "iconColor": "#1a57a0", - "idSeparator": ",", - "isAutoComplete": 1, - "isDetail": 0, - "isMultCheckbox": false, - "isSingle": true, - "linkUrl": "", - "noOperate": true, - "otherParams": {}, - "pageSize": -1, - "quickSearchName": "", - "replaceDatas": [], - "replaceNotCtrl": false, - "scrollx": true, - "searchParams": {}, - "searchPlaceholder": "", - "showCheckStrictly": true, - "title": "公司分部浏览按钮", - "type": "161", - "viewAttr": 2 - }, - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "BROWSER", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "parent_company" - ], - "entSearch": false, - "fieldcol": 16, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "转移到", - "labelcol": 6, - "length": 0, - "maxFilesNumber": 0, - "maxUploadSize": 0, - "multiSelection": false, - "multiple": false, - "precision": 0, - "secretLimit": false, - "showOrder": 0, - "showTime": false, - "stringLength": 0, - "supportCancel": false, - "tipPosition": "bottom", - "valueList": [], - "viewAttr": 2 - }, - ], - "title": "基本信息" - } - ] + setTransferCondition(transferCondition) { + this.transferCondition = transferCondition; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 22bac93..408d22b 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -17,6 +17,9 @@ import { import { i18n } from '../public/i18n'; +import { + findIndex +} from 'lodash'; const toJS = mobx.toJS; const { @@ -377,12 +380,26 @@ export class DepartmentStore { }) } - updateConditions(data) { + key = ''; + updateConditions(val) { this.form1.updateFields({ parent_dept: { value: '' } }); + const label = "上级部门" + let index = findIndex(this.condition[0].items, { label }); + let currenttime = Date.now(); + let key = `parentComp_${currenttime}`; + const lastKey = this.key; + Reflect.deleteProperty(this.condition[0].items[index].browserConditionParam.dataParams, lastKey) + this.key = key; + this.condition[0].items[index].browserConditionParam.dataParams = { + [key]: val, + ...this.condition[0].items[index].browserConditionParam.dataParams, + currenttime: currenttime + } + } updateFields(val) { diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 11a6e8e..ab9b623 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -280,21 +280,6 @@ export class JobGradeStore { let currenttime = Date.now(); let key = `schemId_${currenttime}`; const lastKey = this.key; - // let conditions = []; - // this.condition[0].items.map(item => { - // if(item.domkey[0] === 'levelId') { - // Reflect.deleteProperty(item.browserConditionParam.dataParams,lastKey) - // this.setKey(key); - // //completeParams conditionDataParams - // item.browserConditionParam.dataParams = { - // [key]:val, - // ...item.browserConditionParam.dataParams, - // currenttime: currenttime - // } - // } - // conditions.push(item); - // }) - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams,lastKey) this.setKey(key); this.condition[0].items[4].browserConditionParam.dataParams = { From c52d10323addd7a9a9325781a8b1f25b4713be23 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 27 Jun 2022 18:48:28 +0800 Subject: [PATCH 033/155] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/datasImport.js | 17 + pc4mobx/organization/apis/job.js | 16 +- .../components/import/datasImport.js | 341 ++++++++++++++++++ pc4mobx/organization/components/job/Job.js | 33 +- .../components/resource/resource.js | 17 +- pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/datasImport.js | 255 +++++++++++++ pc4mobx/organization/stores/fieldDefined.js | 8 +- pc4mobx/organization/stores/index.js | 4 +- pc4mobx/organization/stores/job.js | 54 ++- pc4mobx/organization/util/index.js | 17 + 11 files changed, 740 insertions(+), 23 deletions(-) create mode 100644 pc4mobx/organization/apis/datasImport.js create mode 100644 pc4mobx/organization/components/import/datasImport.js create mode 100644 pc4mobx/organization/stores/datasImport.js diff --git a/pc4mobx/organization/apis/datasImport.js b/pc4mobx/organization/apis/datasImport.js new file mode 100644 index 0000000..5201064 --- /dev/null +++ b/pc4mobx/organization/apis/datasImport.js @@ -0,0 +1,17 @@ +import { WeaTools } from 'ecCom' +//获取导入表单 +export const getImportForm = (params) => { + return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params); +} +//导入文件提交 +export const saveImport = (params) => { + return WeaTools.callApi(`/api/hrm/import/resource/saveImport`, 'POST', params); +} +//获取导入结果回调数据 +export const getImportProcessLog = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getImportProcessLog`, 'GET', params); +} +//获取导入结果 +export const getImportResult = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getImportResult`, 'GET', params); +} diff --git a/pc4mobx/organization/apis/job.js b/pc4mobx/organization/apis/job.js index 6f44f6a..d3fc1ec 100644 --- a/pc4mobx/organization/apis/job.js +++ b/pc4mobx/organization/apis/job.js @@ -83,7 +83,21 @@ export const getJobExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getJobBaseForm', 'GET', params); } - export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getHasRight', 'GET', params); +} + +export const getMergeForm = (params = {}) => { + return WeaTools.callApi('/api/bs/hrmorganization/job/getMergeForm', 'GET', params); +} + +export const merge = (params) => { + return fetch('/api/bs/hrmorganization/job/mergeJob', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) } \ No newline at end of file diff --git a/pc4mobx/organization/components/import/datasImport.js b/pc4mobx/organization/components/import/datasImport.js new file mode 100644 index 0000000..74de4cf --- /dev/null +++ b/pc4mobx/organization/components/import/datasImport.js @@ -0,0 +1,341 @@ +import { + inject, + observer +} from 'mobx-react'; +import { + WeaUpload, + WeaDialog, + WeaFormItem, + WeaSearchGroup, + WeaNewScroll, + WeaSelect, + WeaInput, + WeaAlertPage, + WeaLocaleProvider +} from 'ecCom' + +import { + Row, + Col, + Button, + Spin +} from 'antd' + +import { + WeaSwitch +} from 'comsMobx' +import React from 'react' +import { + i18n +} from '../../public/i18n'; +import { addContentPath, renderNoright } from '../../util/index.js' +import '../../style/common.less' +const getLabel = WeaLocaleProvider.getLabel; + +@inject('datasImport') +@observer +export default class DatasImport extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + const { + datasImport + } = this.props; + datasImport.list = []; + } + + getCircle() { + let style = { + width: 20, + height: 20, + backgroundColor: '#D8D8D8', + webkitBorderRadius: 10, + mozBorderRadius: 10, + msBorderRadius: 10, + oBorderRadius: 10, + borderRadius: 10, + //paddingLeft: 6, + textAlign: 'center', + } + return style; + } + + getForm() { + const { + datasImport + } = this.props; + const { + condition + } = datasImport; + let _arr = []; + + condition.map((c, i) => { + let arr = []; + if (i == 0) { //基本信息 + c.items.map((field, index) => { + arr.push({ + com: ( +
+ + +
+
{index + 1}
+
+ + +
+ + {field.label}: + + {this.getDom(field)} + + +
+ +
+
+ ), + colSpan: 1, + }) + }) + } + if (i == 1) { //导入说明 + c.items.map((field, index) => { + arr.push({ + com: ( +
+ + +
+
{index + 1}
+
+ + + {this.getIllustration(field.value, field.link, index, field)} + +
+
+ ), + colSpan: 1 + }) + }) + } + _arr.push(
) + + }); + return _arr; + } + + getDom(field) { + const { + datasImport + } = this.props; + const { + templetName, + filelist, + getTemplateUrl, + importParams + } = datasImport; + let dom; + let domkey = field.domkey; + if (domkey[0] == 'templet') { + dom = {i18n.label.importTemplate()}; + } else if (domkey[0] === 'exportData') { + const href = datasImport.operateType === 'add' ? field.otherParams.fileVal[0].add : field.otherParams.fileVal[0].update; + if (datasImport.importType === 'matrix') { + dom = { getTemplateUrl(datasImport.otherParams.matrixid, datasImport.operateType, importParams) }}>{i18n.label.importTemplate()} + } else + dom = {i18n.label.importTemplate()}; + } else if (domkey[0] == 'excelfile' || domkey[0] == 'importfile') { + dom = (
+
+ { + this.setFileId(ids, list) + } + } > + + +
+
+ {filelist.length == 0 ?

{i18n.label.noFileSelected()}

: filelist.map(file =>

{file.filename}

)} +
+
) + } else if (domkey[0].indexOf('keyField') > -1) { + const vals = field.options.filter(v => v.selected == true); + let val = ''; + vals.length > 0 && (val = vals[0].key); + dom = { datasImport.setParam(domkey[0], v) }} + /> + } else if (domkey[0] == 'importType') { + dom = { datasImport.operateType = v }} + /> + } else { + dom = + } + return dom; + } + + getIllustration(val, url, index, link) { + const { + datasImport + } = this.props; + const { + templetName, + getTemplateUrl, + importParams + } = datasImport; + let p; + if (index == 0) { + if (url instanceof Object) { + const href = datasImport.operateType === 'add' ? url.add : url.update; + let dom; + if (datasImport.importType === 'matrix') { + dom = { getTemplateUrl(datasImport.otherParams.matrixid, datasImport.operateType, importParams) }}>{i18n.label.importTemplate()} + } else + dom = {i18n.label.importTemplate()}; + p = (

{i18n.label.downLoadTemplete()}:{dom}

); + } else if (url != null) { + if (datasImport.importType === 'matrix') { + p = (

{i18n.label.downLoadTemplete()}: { getTemplateUrl(datasImport.otherParams.matrixid, datasImport.operateType) }}>{i18n.label.importTemplate()}

); + } else + p = (

{i18n.label.downLoadTemplete()}:{i18n.label.importTemplate()}

); + } else { + p = (

); + } + } else { + p = (

); + } + return p; + } + + setFileId(ids, list) { + const { + datasImport + } = this.props; + datasImport.excelfile = ids; + datasImport.filelist = list; + } + + onUploading(s) { + const { + datasImport + } = this.props; + datasImport.status = s; + } + + submit() { + const { + datasImport + } = this.props; + datasImport.saveImport({}, () => { + this.refs.scroll && this.refs.scroll.scrollToLast() + }); + } + + cancel() { + const { + datasImport, + onClose + } = this.props; + datasImport.visible = false + datasImport.init(); + onClose && onClose(); + } + + importHistoryQuery() { + const { + datasImport + } = this.props; + datasImport.visibleHistory = true; + datasImport.getImportHistory(); + } + + render() { + debugger + const { + datasImport, + mainTitle, + importLog, + viewLog, + viewLogTitle, + } = this.props; + const { + title, + visible, + titleResult, + visibleResult, + importResultColumns, + importProcessLogDatas, + failnum, + succnum, + importResultTip, + importResultStore, + importStatus, + errorInfo, + setScrollRef, + single, + showLoadingSpin, + condition + } = datasImport; + const buttons = condition.length ? [ + (), + ] : []; + + let dialogHeight = window.innerHeight - 150; + if (dialogHeight > 560) dialogHeight = 560; + + return ( +
+ { + this.cancel()} + buttons={buttons} + style={{ width: 870, height: dialogHeight }} + moreBtn={{ + datas: condition ? [{ + key: '1', + content: i18n.button.submit(), + icon: , + onClick: () => this.submit(), + }] : [] + }} + > + {condition.length ? ( + + + {this.getForm()} + + + ) :
+ } +
+ } + +
+ ) + } +} + diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 002be5e..01671ac 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-24 14:36:50 + * @LastEditTime: 2022-06-27 11:23:42 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -79,9 +79,7 @@ export default class Job extends React.Component { const { job } = this.props; - job.getTableInfo(); - job.getHasRight(); - job.getCopyForm() + job.initData(); } getTopMenuBtns() { @@ -144,7 +142,21 @@ export default class Job extends React.Component { } merge(id) { - alert("后续更新") + const { + job + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: this.getCopyForm({isCopy:false}), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + job.merge(id) + }, + onCancel() { + return false; + }, + }); } @@ -159,7 +171,7 @@ export default class Job extends React.Component { job.setIds(keys); confirm({ title: i18n.confirm.defaultTitle(), - content: this.getCopyForm(), + content: this.getCopyForm({isCopy:true}), okText: i18n.button.ok(), cancelText: i18n.button.cancel(), onOk() { @@ -171,20 +183,23 @@ export default class Job extends React.Component { }); } - getCopyForm() { + getCopyForm(params) { const { job } = this.props; const { copyCondition, + mergeCondition, form2, } = job; + params.isCopy ? form2.initFormFields(copyCondition) : form2.initFormFields(mergeCondition); let formParams = form2.getFormParams(); + let condition = params.isCopy ? copyCondition : mergeCondition; const { - isFormInit + isFormInit } = form2; let arr = []; - isFormInit && copyCondition.map(c => { + isFormInit && condition.map(c => { c.items.map((field, index) => { arr.push( this.handleMenuClick(key)} > } iconBgcolor='#217346' loading={true} @@ -453,6 +465,7 @@ export default class Resource extends React.Component { onCancel={() => resource.setVisible(false)} saveAndSetting = {() => this.handleSaveAndSetting()} /> +
) } diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 0c0d344..53a0ac5 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -156,6 +156,7 @@ export const i18n = { typeName: () => getLabel(129927, '类型名称'), ResourceName: () => getLabel(385936, '人员'), newPeople: () => getLabel(386246, '新建人员'), + resourceMange: () => getLabel(386246, '人员管理'), authorizationGroup: () => getLabel(492, '权限组'), diff --git a/pc4mobx/organization/stores/datasImport.js b/pc4mobx/organization/stores/datasImport.js new file mode 100644 index 0000000..c856575 --- /dev/null +++ b/pc4mobx/organization/stores/datasImport.js @@ -0,0 +1,255 @@ +import { + observable, + action + } from 'mobx'; + import { + WeaForm + } from 'comsMobx'; + import * as API from '../apis/datasImport'; + import * as Util from '../util/index'; + import { + validate, + getFormParamValue + } from '../util' + import { + message, + Modal, + Button + } from 'antd'; + import { + WeaTableNew + } from 'comsMobx' + import * as mobx from 'mobx'; + import isEmpty from 'lodash/isEmpty'; + import { + has + } from 'lodash'; + const toJS = mobx.toJS; + const { + TableStore + } = WeaTableNew; + const confirm = Modal.confirm; + import { + i18n + } from '../public/i18n'; + + + export class DatasImportStore { + @observable title = "人员导入"; + @observable templetName = "导入模板"; + titleResult = i18n.label.importResult; + titleHistory = i18n.button.importHistoryQuery; + titleImportLog = i18n.button.getImportLog; + importResultColumns = []; + index = 1; + @observable scrollTarget; + @observable visible = false; + @observable visibleResult = false; + @observable visibleHistory = false; + @observable visibleImportLog = false; + @observable condition = []; + @observable single = true; + @observable keyField = 'workcode'; + @observable importType = ''; + @observable operateType = 'add'; + @observable filelist = []; + @observable excelfile = ''; + @observable searchCondition = []; + @observable form = new WeaForm(); + @observable showSearchAd = false; + @observable searchParamsAd = {}; + @observable importResultStore = new TableStore(); + @observable importHistoryStore = new TableStore(); + @observable importLogStore = new TableStore(); + @observable buttons = []; + @observable importProcessLogDatas = []; + @observable succnum = 0; + @observable failnum = 0; + @observable importResultTip = ''; + @observable importStatus = ''; + @observable pId = ''; + @observable ref; + @observable errorInfo = ''; + @observable dialogKey = new Date().getTime(); + @observable otherParams; + @observable showLoadingSpin = false; + interval; + importCallback; + getTemplateUrl; + @observable importParams = {}; + + importResultColumns = [{ + "title": i18n.label.confirmInfo(), + "width": "100%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + + @action + init() { + this.condition = []; + this.keyField = 'workcode'; + this.importType = ''; + this.operateType = 'add'; + this.filelist = []; + this.excelfile = ''; + this.searchCondition = []; + this.buttons = []; + this.importProcessLogDatas = []; + this.succnum = 0; + this.failnum = 0; + this.importResultTip = ''; + this.importStatus = ''; + this.pId = ''; + this.errorInfo = ''; + this.importParams = {}; + } + + @action setParam = (k, v) => { + const p = toJS(this.importParams); + Object.assign(p, { + [k]: v + }); + this.importParams = p; + } + + getImportForm(params = {}) { + this.showLoadingSpin = true; + params.importType = this.importType; + this.otherParams != null && Object.assign(params, { + otherParams: JSON.stringify({ ...this.otherParams, + type: this.operateType + }) + }) + API.getImportForm(params).then(data => { + if (data.status == '1') { + this.condition = data.condition; + if (data.condition != null && Array.isArray(data.condition) && data.condition.length > 0) { + this.condition[0].items.map(item => { + if (item.conditionType === 'SELECT' && item.domkey[0] === 'importType') { + item.options.map(op => { + if (op.selected) + this.operateType = op.key; + }) + } + item.domkey[0].indexOf('keyField') > -1 && this.setParam(item.domkey[0], item.value); + }) + } + } else { + // message.warning(data.message); + } + + this.showLoadingSpin = false; + }, error => { + message.warning(error.message); + this.showLoadingSpin = false; + }) + } + + saveImport = (params = {}) => { + params.keyField = this.keyField; + params.importType = this.importType; + params.operateType = this.operateType; + params.excelfile = this.excelfile || ''; + if (params.excelfile == '') { + message.warning(i18n.message.selectImportTemplete()); + return; + } + if (this.otherParams != null) { + Object.assign(params, { + otherParams: JSON.stringify(this.otherParams) + }) + has(this.otherParams, 'logSmallType') && Object.assign(params, { + logSmallType: this.otherParams.logSmallType + }) + } + + this.importResultColumns = [{ + "title": i18n.label.confirmInfo(), + "width": "100%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + this.index = 1; + this.importStatus = ''; + this.importProcessLogDatas = []; + this.importStatus = 'importing'; + this.doImport({...params, ...this.importParams, confirm: 0}); + this.dialogKey = new Date().getTime(); + this.visibleResult = true; + } + + @action doImport = params => { + API.saveImport(params).then(data => { + if (data.status == '1') { + if(data.message != null && data.message.trim().length > 0 && params.importType == 'matrix'){ + confirm({ + title: i18n.confirm.defaultTitle(), + content: data.message, + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk: () => { + this.doImport({...params, confirm: 1}) + } + }); + }else if (!isEmpty(data.errorInfo)) { + this.importStatus = 'error'; + this.importResultTip = i18n.message.selectImportTempleteError(); + this.importResultColumns = [{ + "title": i18n.label.confirmInfo(), + "width": "100%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + this.importProcessLogDatas = data.errorInfo; + }else{ + this.importCallback && this.importCallback(); + } + }else { + this.importStatus = 'error'; + message.warning(data.message); + } + }) + } + + setScrollTarget(scroll) { + this.scrollTarget = scroll; + } + + getImportResult(params = {}) { + this.importStatus = 'over'; + if (params.pId) { + this.pId = params.pId; + } + API.getImportResult(params).then((data) => { + if (data.status == '1') { + this.failnum = data.datas.failnum; + this.succnum = data.datas.succnum; + if (this.failnum > 0) { + let info = i18n.label.importResourceResultInfo(); + info = info.replace('{rownum}', this.succnum + this.failnum).replace('{succnum}', this.succnum); + this.importResultTip = info; + this.importResultStore.getDatas(data.datas.sessionkey, 1); + } else { + let info = i18n.label.importResourceResultInfo1(); + info = info.replace('{rownum}', this.succnum); + this.importResultTip = info; + } + } else { + message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + doSearch(params = {}) { + let formParams = this.form.getFormParams(); + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index ae8839b..3f22ea6 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-23 09:58:27 + * @LastEditTime: 2022-06-27 15:32:03 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -1405,10 +1405,10 @@ export class FieldDefinedStore extends HrmBaseStore { if (res.code === 200) { this.treeConfig.data = res.data; this.treeConfig.data.map(p => { - if (p.domid === this.treeConfig.selectedKeys[0]) + if (p.domid === this.treeConfig.selectedKeys[0]+'') this.selectedTreeNodeInfo = p; p.childs && p.childs.map(c => { - if (c.domid === this.treeConfig.selectedKeys[0]) + if (c.domid === this.treeConfig.selectedKeys[0]+'') this.selectedTreeNodeInfo = c; }) }) @@ -1441,7 +1441,7 @@ export class FieldDefinedStore extends HrmBaseStore { let defaultType = domid != '1' && domid != '2' && domid != '3' && domid != '4' - defaultType && t.topButtonDef.push({ + t.topButtonDef.push({ comType: 'button', type: 'primary', onClickHandle: this.doChildInfoSetting, diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index b1c5c1d..7db733f 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -18,6 +18,7 @@ import { NumberSetStore } from "./numberSet"; import {FieldDefinedStore} from "./fieldDefined"; import {ResourceStore} from "./resource"; import {ResourceExtendStore} from "./resourceExtend"; +import {DatasImportStore} from "./datasImport"; module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -39,5 +40,6 @@ module.exports = { numberSet: new NumberSetStore(), fieldDefined: new FieldDefinedStore(), resource: new ResourceStore(), - resourceExtend: new ResourceExtendStore() + resourceExtend: new ResourceExtendStore(), + datasImport: new DatasImportStore() }; diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 7146422..0164c1e 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -18,7 +18,7 @@ import { i18n } from '../public/i18n'; import { - findIndex + findIndex } from 'lodash'; const toJS = mobx.toJS; @@ -40,10 +40,11 @@ export class JobStore { @observable searchCondition = []; @observable condition = []; @observable copyCondition = []; + @observable mergeCondition = []; @observable isPanelShow = false; //高级搜索面板 @observable form = new WeaForm(); @observable form1 = new WeaForm(); //新增主表表单 - @observable form2 = new WeaForm(); //复制表单 + @observable form2 = new WeaForm(); //复制表单 合并表单 @observable jobName = ''; @observable conditionNum = 12; @observable ids = ''; //选择行id @@ -66,6 +67,13 @@ export class JobStore { @observable selectTreeNodeInfo; saveAndSetting = false; + @action initData() { + this.getTableInfo(); + this.getHasRight(); + this.getCopyForm(); + this.getMergeForm(); + } + @action getTableInfo() { this.setLoading(true); @@ -207,7 +215,19 @@ export class JobStore { Api.getCopyForm(params).then(res => { if (res.code === 200) { res.data && this.setCopyCondition(res.data); - res.data && this.form2.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action("合并表单") + getMergeForm() { + Api.getMergeForm().then(res => { + if (res.code === 200) { + res.data && this.setMergeCondition(res.data); } else { message.warning(res.msg); } @@ -262,7 +282,25 @@ export class JobStore { }).catch(error => { message.warning(error.msg); }) + } + merge(id) { + let params = { + id: id, + ...this.form2.getFormParams() + }; + Api.merge(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + } else { + message.error(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) } updateConditions(data) { @@ -271,9 +309,9 @@ export class JobStore { value: '', }, }); - const label = "等级方案" - let index = findIndex(this.condition[0].items,{label}); - this.condition[0].items[index].browserConditionParam.replaceDatas = []; + // const label = "等级方案" + // const index = findIndex(this.condition[0].items, { label }); + // this.condition[0].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: "18" }]; } @@ -440,4 +478,8 @@ export class JobStore { this.saveAndSetting = bool; } + setMergeCondition(mergeCondition) { + this.mergeCondition = mergeCondition; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/util/index.js b/pc4mobx/organization/util/index.js index b6482dd..ea6320b 100644 --- a/pc4mobx/organization/util/index.js +++ b/pc4mobx/organization/util/index.js @@ -102,6 +102,23 @@ export const isEmpty = (obj) =>{ return true; } +/** + * 添加多级路径 + * + * @param {*} url + */ + export const addContentPath = (url) => { + const ecologyContentPath = window.ecologyContentPath || ''; + if (url && ecologyContentPath) { + //避免重复添加ecologyContentPath + //避免传入的参数不是链接 + if (url.startsWith('/') && !url.startsWith(ecologyContentPath)) { + url = ecologyContentPath + url; + } + } + return url; +}; + export const calFormHeight = (groupLength, children) => { let childrenLength = 0; From 07dec3350fb97ace2683f38b6f85a968d72225bc Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 29 Jun 2022 18:37:25 +0800 Subject: [PATCH 034/155] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/resource.js | 14 ++++ .../components/department/departmentExtend.js | 4 +- .../components/fieldDefinedSet/FieldDef.js | 22 +++--- .../components/import/datasImport.js | 1 - .../components/resource/resource.js | 38 ++++++++-- pc4mobx/organization/stores/companyextend.js | 3 + .../organization/stores/departmentextend.js | 6 +- pc4mobx/organization/stores/fieldDefined.js | 70 +++++++++---------- pc4mobx/organization/stores/jobextend.js | 15 ++-- pc4mobx/organization/stores/resource.js | 8 +++ pc4mobx/organization/stores/resourceExtend.js | 2 +- pc4mobx/organization/util/index.js | 23 ++++++ 12 files changed, 143 insertions(+), 63 deletions(-) diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index 9f64dcf..6199217 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -38,3 +38,17 @@ export const editResource = (params) => { export const getResourceExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params); } + + + +export const exportResource = (ids) => { + fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => { + var filename=`人员档案.xlsx` + var a = document.createElement('a'); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })) +} diff --git a/pc4mobx/organization/components/department/departmentExtend.js b/pc4mobx/organization/components/department/departmentExtend.js index d31b86c..33a6ee0 100644 --- a/pc4mobx/organization/components/department/departmentExtend.js +++ b/pc4mobx/organization/components/department/departmentExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:20:03 - * @LastEditTime: 2022-06-22 16:54:39 + * @LastEditTime: 2022-06-29 17:42:27 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js */ @@ -238,7 +238,7 @@ export default class DepartmentExtendStore extends React.Component { datas={this.getRightMenu()} > } iconBgcolor='#217346' diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js index 1bf4129..5a01160 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js @@ -91,17 +91,17 @@ export default class FieldDef extends Component { } } //人员卡片字段定义页面 - if (moduleName === 'resourcefielddefined') { - if ((window.e9_locale.userLanguage == 7)) { //系统语言为中文 - Object.assign(tableProps.scroll, { - x: 1200 - }); - } else { - Object.assign(tableProps.scroll, { - x: isJobTreeNode ? 1400 : 1900 - }); - } - } + // if (moduleName === 'resourcefielddefined') { + // if ((window.e9_locale.userLanguage == 7)) { //系统语言为中文 + // Object.assign(tableProps.scroll, { + // x: 1200 + // }); + // } else { + // Object.assign(tableProps.scroll, { + // x: isJobTreeNode ? 1400 : 1900 + // }); + // } + // } } const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)] diff --git a/pc4mobx/organization/components/import/datasImport.js b/pc4mobx/organization/components/import/datasImport.js index 74de4cf..7683122 100644 --- a/pc4mobx/organization/components/import/datasImport.js +++ b/pc4mobx/organization/components/import/datasImport.js @@ -269,7 +269,6 @@ export default class DatasImport extends React.Component { } render() { - debugger const { datasImport, mainTitle, diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 8e5e4e5..2496424 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -11,6 +11,7 @@ import { WeaRightMenu, WeaLeftRightLayout, WeaOrgTree, + WeaDropdown } from 'ecCom' import { Row, @@ -34,14 +35,14 @@ import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; import { renderNoright } from '../../util'; -import DatasImport from '../import/datasImport'; +import DatasImport from '../import/datasImport'; const toJS = mobx.toJS; const confirm = Modal.confirm; const WeaTable = WeaTableNew.WeaTable; - +const { ButtonSelect } = WeaDropdown; @inject('resource') @inject('datasImport') @@ -125,6 +126,28 @@ export default class Resource extends React.Component { }); + const datas = [ + { + key: "1", show: (全部导出), text: "全部导出", selected: true + }, + + { + key: "2", show: (批量导出), text: "批量导出" + } + ]; + btns.push( { + if (key == "1") { + resource.export(); + } + if(key == "2") { + tableStore.selectedRowKeys.length > 0 ? resource.export() : message.error("请选择需要导出的数据") + } + }} + //menuOnClick={(key, e) => console.log("选择了按钮:", e)} + />) + return btns; } @@ -161,6 +184,7 @@ export default class Resource extends React.Component { datasImport.getImportForm(); } + batchDelete() { const { resource @@ -334,7 +358,7 @@ export default class Resource extends React.Component { } handleSaveAndSetting() { - + } getPanelComponents() { @@ -402,8 +426,8 @@ export default class Resource extends React.Component { resource } = this.props; const { - isPanelShow, form2, schemeName, conditionNum, tableStore, nEdialogTitle, visible, condition, - form, dialogLoading, isEdit, date, hasRight,defaultShowLeft + isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, date, hasRight, defaultShowLeft } = resource; if (hasRight === false) { @@ -431,7 +455,7 @@ export default class Resource extends React.Component { resource.setPanelStatus(bool)} hideSearchAd={() => resource.setPanelStatus(false)} searchsAd={isPanelShow ? this.getPanelComponents() :
} @@ -463,7 +487,7 @@ export default class Resource extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => resource.setVisible(false)} - saveAndSetting = {() => this.handleSaveAndSetting()} + saveAndSetting={() => this.handleSaveAndSetting()} />
diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 6d15ee8..95dea9a 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -233,5 +233,8 @@ export class CompanyExtendStore { this.buttons = buttons; } + setDate(date) { + this.date = date; + } } diff --git a/pc4mobx/organization/stores/departmentextend.js b/pc4mobx/organization/stores/departmentextend.js index 3595bab..01639d6 100644 --- a/pc4mobx/organization/stores/departmentextend.js +++ b/pc4mobx/organization/stores/departmentextend.js @@ -53,9 +53,9 @@ export class DepartmentExtendStore { save = () => { if (this.loading) return; - this.loading = true; this.form.validateForm().then(f => { if (f.isValid) { + this.loading = true; if (this.personalEditTables) { const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true @@ -231,5 +231,9 @@ export class DepartmentExtendStore { this.buttons = buttons; } + setDate(date) { + this.date = date; + } + } diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 3f22ea6..6c8affa 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-27 15:32:03 + * @LastEditTime: 2022-06-29 17:23:37 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -300,40 +300,40 @@ export class FieldDefinedStore extends HrmBaseStore { }]; //人员卡片字段定义-添加【允许个人修改】列 - if (this.moduleName === 'resourcefielddefined') { - if (this.isJobTreeNode) {//【工作信息】列表不添加【允许个人修改】列 - } else { - columns.push({ - title: getLabel(510359, '允许个人修改'), - dataIndex: 'isModify', - key: 'isModify', - checkType: 'checkbox', - colSpan: 1, - width: '11%' - }); - } - } - this.encryptEnable && columns.push({ - title: getLabel('526997', '加密设置'), - dataIndex: 'canEncrypt', - key: 'canEncrypt', - com: [ - { - type: 'custom', - key: 'custom', - render: (text, record, index, onEdit) => { - const { canEncrypt } = record; - if (canEncrypt == '1') - return ( - this.onEncryptHandle(record)}>{getLabel('526997', '加密设置')} - ) - return null; - } - } - ], - colSpan: 1, - width: '8%' - }); + // if (this.moduleName === 'resourcefielddefined') { + // if (this.isJobTreeNode) {//【工作信息】列表不添加【允许个人修改】列 + // } else { + // columns.push({ + // title: getLabel(510359, '允许个人修改'), + // dataIndex: 'isModify', + // key: 'isModify', + // checkType: 'checkbox', + // colSpan: 1, + // width: '11%' + // }); + // } + // } + // this.encryptEnable && columns.push({ + // title: getLabel('526997', '加密设置'), + // dataIndex: 'canEncrypt', + // key: 'canEncrypt', + // com: [ + // { + // type: 'custom', + // key: 'custom', + // render: (text, record, index, onEdit) => { + // const { canEncrypt } = record; + // if (canEncrypt == '1') + // return ( + // this.onEncryptHandle(record)}>{getLabel('526997', '加密设置')} + // ) + // return null; + // } + // } + // ], + // colSpan: 1, + // width: '8%' + // }); return columns; } diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index 1c6f8c3..ba32c8b 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -56,9 +56,9 @@ export class JobExtendStore { save = () => { if (this.loading) return; - this.loading = true; this.form.validateForm().then(f => { if (f.isValid) { + this.loading = true; if (this.personalEditTables) { const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true @@ -80,7 +80,8 @@ export class JobExtendStore { editResource = () => { let pDatas = this.form.getFormParams(); - Api.editResource({ ...{ + Api.editResource({ + ...{ id: this.id }, ...pDatas, @@ -124,7 +125,7 @@ export class JobExtendStore { let params = { viewAttr: this.isEditor ? 2 : 1, id: this.id, - viewCondition:this.selectedKey + viewCondition: this.selectedKey } Api.getJobExtendForm(params).then((res) => { if (res.code === 200) { @@ -144,7 +145,7 @@ export class JobExtendStore { message.warning(error.msg); }) - + } @@ -183,7 +184,7 @@ export class JobExtendStore { this.tabKey = key; } - updateDetailSelectedKey =(key) => { + updateDetailSelectedKey = (key) => { this.detailSelectedKey = key; } @@ -235,5 +236,9 @@ export class JobExtendStore { this.buttons = buttons; } + setDate(date) { + this.date = date; + } + } diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 2eba6ae..25ec5b3 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -17,6 +17,7 @@ import { import { i18n } from '../public/i18n'; +import {getSecondPath} from '../util/index' const toJS = mobx.toJS; const { @@ -173,6 +174,13 @@ const { }) } + @action export(){ + const params = { + ...this.form.getFormParams() + } + Api.exportResource(toJS(this.tableStore.selectedRowKeys).toString()); + } + updateFields(val) { this.form2.updateFields({ schemeName: { diff --git a/pc4mobx/organization/stores/resourceExtend.js b/pc4mobx/organization/stores/resourceExtend.js index 4faa146..a07aa4d 100644 --- a/pc4mobx/organization/stores/resourceExtend.js +++ b/pc4mobx/organization/stores/resourceExtend.js @@ -54,9 +54,9 @@ export class ResourceExtendStore { save = () => { if (this.loading) return; - this.loading = true; this.form.validateForm().then(f => { if (f.isValid) { + this.loading = true; if (this.personalEditTables) { const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true diff --git a/pc4mobx/organization/util/index.js b/pc4mobx/organization/util/index.js index ea6320b..f1e4790 100644 --- a/pc4mobx/organization/util/index.js +++ b/pc4mobx/organization/util/index.js @@ -148,4 +148,27 @@ export const validDBKeys = (value) => { isValid: true, value }; +} + +//二级路径加前缀 +export const getSecondPath=(url)=>{ + const ecologyContentPath = window.ecologyContentPath||"";//二级路径 + if(ecologyContentPath!="" && url && url!=""){ + if(url.startsWith("/")){ + if(!url.startsWith(ecologyContentPath)){ + url = ecologyContentPath+url; + } + }else if(url.startsWith("http")){ + let origin = window.location.origin; + if(!origin){ + origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); + } + if(url.startsWith(origin) && !url.startsWith(origin+ecologyContentPath)){ + url = url.replace(origin,origin+ecologyContentPath); + } + }else { + url = ecologyContentPath+"/"+url; + } + } + return url; } \ No newline at end of file From 98bb6e3ae41a566017e38fa47b2d78049d343322 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 30 Jun 2022 17:14:04 +0800 Subject: [PATCH 035/155] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/basicImport.js | 7 + pc4mobx/organization/apis/datasImport.js | 6 +- pc4mobx/organization/apis/importresource.js | 29 ++ .../components/import/datasImport.js | 9 +- .../organization/components/import/index.js | 204 ++++++++ .../components/importresource/Import.js | 353 ++++++++++++++ .../importresource/ImportHistory.js | 137 ++++++ .../components/importresource/ImportLog.js | 175 +++++++ .../components/importresource/ImportResult.js | 185 +++++++ .../components/resource/resource.js | 2 +- pc4mobx/organization/index.js | 3 + pc4mobx/organization/stores/adareaset.js | 0 pc4mobx/organization/stores/datasImport.js | 30 +- pc4mobx/organization/stores/import.js | 56 +++ pc4mobx/organization/stores/importCommon.js | 458 ++++++++++++++++++ pc4mobx/organization/stores/importresource.js | 370 ++++++++++++++ pc4mobx/organization/stores/index.js | 8 +- pc4mobx/organization/stores/resource.js | 1 + pc4mobx/organization/style/import.css | 86 ++++ 19 files changed, 2103 insertions(+), 16 deletions(-) create mode 100644 pc4mobx/organization/apis/basicImport.js create mode 100644 pc4mobx/organization/apis/importresource.js create mode 100644 pc4mobx/organization/components/import/index.js create mode 100644 pc4mobx/organization/components/importresource/Import.js create mode 100644 pc4mobx/organization/components/importresource/ImportHistory.js create mode 100644 pc4mobx/organization/components/importresource/ImportLog.js create mode 100644 pc4mobx/organization/components/importresource/ImportResult.js create mode 100644 pc4mobx/organization/stores/adareaset.js create mode 100644 pc4mobx/organization/stores/import.js create mode 100644 pc4mobx/organization/stores/importCommon.js create mode 100644 pc4mobx/organization/stores/importresource.js create mode 100644 pc4mobx/organization/style/import.css diff --git a/pc4mobx/organization/apis/basicImport.js b/pc4mobx/organization/apis/basicImport.js new file mode 100644 index 0000000..930d757 --- /dev/null +++ b/pc4mobx/organization/apis/basicImport.js @@ -0,0 +1,7 @@ +import { + WeaTools +} from 'ecCom' + +export const getBasicDataImportHasRight = (params) => { + return WeaTools.callApi('/api/hrm/import/resource/getBasicDataImportHasRight', 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/apis/datasImport.js b/pc4mobx/organization/apis/datasImport.js index 5201064..438e698 100644 --- a/pc4mobx/organization/apis/datasImport.js +++ b/pc4mobx/organization/apis/datasImport.js @@ -1,12 +1,16 @@ import { WeaTools } from 'ecCom' + +//作废 //获取导入表单 export const getImportForm = (params) => { return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params); } //导入文件提交 export const saveImport = (params) => { - return WeaTools.callApi(`/api/hrm/import/resource/saveImport`, 'POST', params); + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveImportResource`, 'POST', params); } + + //获取导入结果回调数据 export const getImportProcessLog = (params) => { return WeaTools.callApi(`/api/hrm/importlog/getImportProcessLog`, 'GET', params); diff --git a/pc4mobx/organization/apis/importresource.js b/pc4mobx/organization/apis/importresource.js new file mode 100644 index 0000000..6446a7c --- /dev/null +++ b/pc4mobx/organization/apis/importresource.js @@ -0,0 +1,29 @@ +import { WeaTools } from 'ecCom' +//获取导入表单 +export const getImportForm = (params) => { + return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params); +} +//导入文件提交 +export const saveImport = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveImportResource`, 'POST', params); +} +//获取导入结果回调数据 +export const getImportProcessLog = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getImportProcessLog`, 'GET', params); +} +//获取导入结果 +export const getImportResult = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getImportResult`, 'GET', params); +} +//历史导入信息查询 +export const getImportHistory = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getImportHistory`, 'GET', params); +} +//导入日志 +export const getImportLogDetail = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getImportColResultLog`, 'GET', params); +} +//导入日志 - 高级搜索 +export const getImportLogSearchCondition = (params) => { + return WeaTools.callApi(`/api/hrm/importlog/getHistorySearchCondition`, 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/import/datasImport.js b/pc4mobx/organization/components/import/datasImport.js index 7683122..e46e097 100644 --- a/pc4mobx/organization/components/import/datasImport.js +++ b/pc4mobx/organization/components/import/datasImport.js @@ -33,6 +33,7 @@ import '../../style/common.less' const getLabel = WeaLocaleProvider.getLabel; @inject('datasImport') +@inject('resource') @observer export default class DatasImport extends React.Component { constructor(props) { @@ -243,11 +244,15 @@ export default class DatasImport extends React.Component { submit() { const { - datasImport + datasImport, + resource } = this.props; datasImport.saveImport({}, () => { - this.refs.scroll && this.refs.scroll.scrollToLast() + this.refs.scroll && this.refs.scroll.scrollToLast(); }); + + // resource.getTableInfo(); + // resource.getHasRight(); } cancel() { diff --git a/pc4mobx/organization/components/import/index.js b/pc4mobx/organization/components/import/index.js new file mode 100644 index 0000000..e916e79 --- /dev/null +++ b/pc4mobx/organization/components/import/index.js @@ -0,0 +1,204 @@ +import React from 'react' +import { + toJS +} from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaAlertPage, +} from 'ecCom' +import { + Spin, +} from 'antd'; +import { + i18n +} from '../../public/i18n'; +import ImportResource from '../importresource/Import'; +//import Import from '../importRelatedComponet/index' +import {addContentPath} from '../../util/index.js' +import '../../style/import.css' + +@inject('hrmBasicDataImport') +@inject('hrmImportResource') +@inject('hrmImportCommon') +@observer +export default class BasicInfoImport extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + let bool = window.location.href.indexOf('/spa/hrm/engine.html') > -1; + if (bool) { + document.title = i18n.module.basicInfoImport(); + } + } + + componentDidMount() { + const { + hrmBasicDataImport + } = this.props, { + getRight + } = hrmBasicDataImport; + + getRight(); + } + + getImportCard = () => { + const { + hrmBasicDataImport + } = this.props, { + isMouseOver, + curIndex, + cardConfig, + setMouseStatus, + } = hrmBasicDataImport; + + let arr = []; + + cardConfig.map((c, index) => { + arr.push(
setMouseStatus(index, true)} onMouseLeave={() => setMouseStatus(index, false)}> +
+ { curIndex == index && isMouseOver ? this.getLinkName(c.linkName,index) : this.getIcon(c.icon)} + { curIndex == index && isMouseOver ? this.getSubTitle(c.subTitle,c.url) : this.getTitle(c.title)} +
+
) + }); + return arr; + } + + getIcon = (icon) => { + return (
+ +
) + } + + getTitle = (title) => { + return (
{title}
) + } + + getLinkName = (linkName, index) => { + return () + } + + getSubTitle = (subTitle, url) => { + return () + } + + handleClick = (index) => { + const { + hrmImportResource, + hrmImportCommon, + } = this.props, { + setTempletName, + setImportDialogTitle, + setImportType, + setImportDialogVisible + } = hrmImportCommon; + + switch (index) { + case 0: //@lvyi + hrmImportResource.visible = true; + hrmImportResource.title = i18n.button.importOrg(); + hrmImportResource.importType = 'company'; + hrmImportResource.getImportForm(); + break; + case 1: + setTempletName(i18n.label.importTemplate()); + setImportDialogTitle(i18n.button.postSystemImport()); + setImportType('jobtitle'); + setImportDialogVisible(true); + break; + case 2: //@lvyi + hrmImportResource.visible = true; + hrmImportResource.title = i18n.button.importResource(); + hrmImportResource.importType = 'resource'; + hrmImportResource.getImportForm(); + break; + case 3: + setTempletName(i18n.label.importTemplate()); + setImportDialogTitle(i18n.button.groupInfoImport()); + setImportType('group'); + setImportDialogVisible(true); + break; + case 4: + setTempletName(i18n.label.importTemplate()); + setImportDialogTitle(i18n.button.personalAndWorkInfoImport()); + setImportType('resourcedetial'); + setImportDialogVisible(true); + break; + case 5: + setTempletName(i18n.label.importTemplate()); + setImportDialogTitle(i18n.button.areaInfoImport()); + setImportType('area'); + setImportDialogVisible(true); + break; + case 6: + setTempletName(i18n.label.importTemplate()); + setImportDialogTitle(i18n.button.workingPlaceImport()); + setImportType('location'); + setImportDialogVisible(true); + break; + case 7: + setTempletName(i18n.label.importTemplate()); + setImportDialogTitle(i18n.button.majorImport()); + setImportType('special'); + setImportDialogVisible(true); + break; + } + + } + + render() { + const { + hrmBasicDataImport, + hrmImportResource, + hrmImportCommon, + } = this.props, { + title, + isMouseOver, + loading, + authorized, + } = hrmBasicDataImport; + + if (!authorized) { + return ( +
+ {loading ?
+ +
+ :
+ +
+ {i18n.message.authFailed()} +
+
+
+ } +
+ ) + } else { + return ( + } + iconBgcolor='#217346' + loading={true} + showDropIcon={true} + > +
{this.getImportCard()}
+ {hrmImportResource.visible && } + {/*其它导入暂时未实现 {hrmImportCommon.importDialog.visible && } */} +
+ ) + } + + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/importresource/Import.js b/pc4mobx/organization/components/importresource/Import.js new file mode 100644 index 0000000..1386d31 --- /dev/null +++ b/pc4mobx/organization/components/importresource/Import.js @@ -0,0 +1,353 @@ +import { + inject, + observer +} from 'mobx-react'; +import { + WeaUpload, + WeaDialog, + WeaFormItem, + WeaSearchGroup, + WeaNewScroll, + WeaSelect, + WeaInput +} from 'ecCom' + +import { + Row, + Col, + Button, + Spin +} from 'antd' + +import { + WeaSwitch +} from 'comsMobx' +import React from 'react' +import ImportResult from './ImportResult' +import ImportHistory from './ImportHistory' +import { + WeaLocaleProvider +} from 'ecCom'; +import { + i18n +} from '../../public/i18n'; +import {addContentPath} from '../../util/index.js' +import '../../style/common.less' + +@inject('hrmImportResource') +@observer +export default class ImportResource extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + const { + hrmImportResource + } = this.props; + hrmImportResource.list = []; + } + + getCircle() { + let style = { + width: 20, + height: 20, + backgroundColor: '#D8D8D8', + webkitBorderRadius: 10, + mozBorderRadius: 10, + msBorderRadius: 10, + oBorderRadius: 10, + borderRadius: 10, + //paddingLeft: 6, + textAlign: 'center', + } + return style; + } + + getForm() { + const { + hrmImportResource + } = this.props; + const { + condition + } = hrmImportResource; + let _arr = []; + + condition.map((c, i) => { + let arr = []; + if (i == 0) { //基本信息 + c.items.map((field, index) => { + arr.push({ + com: ( +
+ + +
+
{index + 1}
+
+ + +
+ + {field.label}: + + {this.getDom(field)} + + +
+ +
+
+ ), + colSpan: 1, + }) + }) + } + if (i == 1) { //导入说明 + c.items.map((field, index) => { + arr.push({ + com: ( +
+ + +
+
{index + 1}
+
+ + + {this.getIllustration(field.value, field.link, index, field)} + +
+
+ ), + colSpan: 1 + }) + }) + } + _arr.push(
) + + }); + return _arr; + } + + getDom(field) { + const { + hrmImportResource + } = this.props; + const { + templetName, + filelist, + getTemplateUrl, + importParams + } = hrmImportResource; + let dom; + let domkey = field.domkey; + if (domkey[0] == 'templet') { + dom = {i18n.label.importTemplate()}; + } else if (domkey[0] === 'exportData') { + const href = hrmImportResource.operateType === 'add' ? field.otherParams.fileVal[0].add : field.otherParams.fileVal[0].update; + if(hrmImportResource.importType === 'matrix'){ + dom = {getTemplateUrl(hrmImportResource.otherParams.matrixid, hrmImportResource.operateType, importParams)}}>{i18n.label.importTemplate()} + }else + dom = {i18n.label.importTemplate()}; + } else if (domkey[0] == 'excelfile' || domkey[0] == 'importfile') { + dom = (
+
+ { + this.setFileId(ids, list) + } + } > + + +
+
+ {filelist.length == 0 ?

{i18n.label.noFileSelected()}

: filelist.map(file =>

{file.filename}

)} +
+
) + } else if (domkey[0].indexOf('keyField') > -1) { + const vals = field.options.filter(v => v.selected == true); + let val = ''; + vals.length>0 && (val = vals[0].key); + dom = { hrmImportResource.setParam(domkey[0], v)}} + /> + } else if (domkey[0] == 'importType') { + dom = { hrmImportResource.operateType = v }} + /> + } else { + dom = + } + return dom; + } + + getIllustration(val, url, index, link) { + const { + hrmImportResource + } = this.props; + const { + templetName, + getTemplateUrl, + importParams + } = hrmImportResource; + let p; + if (index == 0) { + if (url instanceof Object) { + const href = hrmImportResource.operateType === 'add' ? url.add : url.update; + let dom; + if(hrmImportResource.importType === 'matrix'){ + dom = {getTemplateUrl(hrmImportResource.otherParams.matrixid, hrmImportResource.operateType, importParams)}}>{i18n.label.importTemplate()} + }else + dom = {i18n.label.importTemplate()}; + p = (

{i18n.label.downLoadTemplete()}:{dom}

); + } else if (url != null) { + if(hrmImportResource.importType === 'matrix'){ + p = (

{i18n.label.downLoadTemplete()}: {getTemplateUrl(hrmImportResource.otherParams.matrixid, hrmImportResource.operateType)}}>{i18n.label.importTemplate()}

); + }else + p = (

{i18n.label.downLoadTemplete()}:{i18n.label.importTemplate()}

); + } else { + p = (

); + } + } else { + p = (

); + } + return p; + } + + setFileId(ids, list) { + const { + hrmImportResource + } = this.props; + hrmImportResource.excelfile = ids; + hrmImportResource.filelist = list; + } + + onUploading(s) { + const { + hrmImportResource + } = this.props; + hrmImportResource.status = s; + } + + submit() { + const { + hrmImportResource + } = this.props; + hrmImportResource.saveImport({}, () => { + this.refs.scroll && this.refs.scroll.scrollToLast() + }); + } + + cancel() { + const { + hrmImportResource, + onClose + } = this.props; + hrmImportResource.visible = false + hrmImportResource.init(); + onClose && onClose(); + } + + importHistoryQuery() { + const { + hrmImportResource + } = this.props; + hrmImportResource.visibleHistory = true; + hrmImportResource.getImportHistory(); + } + + render() { + const { + hrmImportResource, + mainTitle, + importLog, + viewLog, + viewLogTitle, + } = this.props; + const { + title, + visible, + titleResult, + visibleResult, + importResultColumns, + importProcessLogDatas, + failnum, + succnum, + importResultTip, + importResultStore, + importStatus, + errorInfo, + setScrollRef, + single, + showLoadingSpin, + condition + } = hrmImportResource; + const buttons = condition.length ? [ + (), + (), + ] : []; + + let dialogHeight = window.innerHeight - 150; + if (dialogHeight > 560) dialogHeight = 560; + + return ( +
+ { + single && visible ? + + {this.getForm()} + + : + this.cancel()} + buttons={buttons} + style={{ width: 870, height: dialogHeight }} + moreBtn={{datas:condition ? [{ + key: '1', + content: i18n.button.submit(), + icon: , + onClick: () => this.submit(), + }, + { + key: '2', + content: importLog || i18n.button.importHistoryQuery(), + icon: , + onClick: () => this.importHistoryQuery(), + } + ]: []}} + > + { condition.length ? ( + + + {this.getForm()} + + + ): ''} + + } + + + +
+ ) + } +} diff --git a/pc4mobx/organization/components/importresource/ImportHistory.js b/pc4mobx/organization/components/importresource/ImportHistory.js new file mode 100644 index 0000000..d13699c --- /dev/null +++ b/pc4mobx/organization/components/importresource/ImportHistory.js @@ -0,0 +1,137 @@ +import { + inject, + observer +} from 'mobx-react'; +import { + WeaDialog, +} from 'ecCom' + +import { + Modal, + Table, + Button, +} from 'antd' + +import React from 'react' +import { + WeaTableNew +} from 'comsMobx'; +import ImportLog from './ImportLog' +import { + i18n +} from '../../public/i18n'; + +const WeaTable = WeaTableNew.WeaTable; + +@inject('hrmImportResource') +@observer +class ImportHistory extends React.Component { + constructor(props) { + super(props); + } + + reRenderColumns(c) { + let _this = this; + c.forEach(item => { + if (item.dataIndex == 'operator') { + item.render = function(text, record) { + return _this.jumpToHrmCard(record.operator)}>{record.operatorspan} + } + } + if (item.dataIndex == 'allnum') { + item.render = function(text, record) { + return _this.jumpToImportResult(record.randomFieldId)}>{record.allnumspan} + } + } + }); + } + + jumpToHrmCard(id) { + window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${id}`); + } + + jumpToImportResult(pId) { + const { + hrmImportResource + } = this.props; + hrmImportResource.dialogKey = new Date().getTime(); + hrmImportResource.visibleResult = true; + hrmImportResource.getImportResult({ + pId, + importType: 'resource' + }); + } + + queryImportLog() { + const { + hrmImportResource + } = this.props; + let params = {}; + params.importType = 'resource'; + hrmImportResource.pId = ''; + hrmImportResource.getImportLogDetail(params); + hrmImportResource.getImportLogSearchCondition(params); + hrmImportResource.visibleImportLog = true; + } + + cancel() { + const { + hrmImportResource + } = this.props; + hrmImportResource.visibleHistory = false; + } + + render() { + const { + hrmImportResource, + importLog, + viewLog, + } = this.props; + const { + titleHistory, + visibleHistory, + onCancel, + importHistoryStore + } = hrmImportResource; + const buttons = [ + (), + ]; + let dialogHeight = window.innerHeight - 150; + if (dialogHeight > 510) dialogHeight = 510; + return ( +
+ + {visibleHistory && + this.cancel()} + buttons={buttons} + style={{ width: 870, height: dialogHeight }} + moreBtn={{datas:[{ + key: '1', + content: viewLog || i18n.button.queryImportLog(), + icon: , + onClick: () => this.queryImportLog(), + } + ]}} + > + index} + getColumns={c => this.reRenderColumns(c)} + /> + + } +
+ ) + } +} + +export default ImportHistory \ No newline at end of file diff --git a/pc4mobx/organization/components/importresource/ImportLog.js b/pc4mobx/organization/components/importresource/ImportLog.js new file mode 100644 index 0000000..38a6484 --- /dev/null +++ b/pc4mobx/organization/components/importresource/ImportLog.js @@ -0,0 +1,175 @@ +import { + inject, + observer +} from 'mobx-react'; +import { + WeaTab, + WeaDialog, + WeaFormItem, + WeaSearchGroup, +} from 'ecCom' + +import { + Row, + Col, + Button, +} from 'antd' +import * as mobx from 'mobx'; +const toJS = mobx.toJS; +import { + WeaSwitch +} from 'comsMobx' +import { + WeaTableNew +} from 'comsMobx'; +import React from 'react' + +const WeaTable = WeaTableNew.WeaTable; +import { + i18n +} from '../../public/i18n'; + +@inject('hrmImportResource') +@observer +class ImportLog extends React.Component { + constructor(props) { + super(props); + } + + componentWillReceiveProps(nextProps) { + + } + + getSearchs() { + const { + hrmImportResource + } = this.props; + const { + form, + searchCondition + } = hrmImportResource; + + const { + isFormInit + } = form; + let group = []; + + const formParams = form.getFormParams(); + isFormInit && toJS(searchCondition).map((c, i) => { + let items = []; + c.items.map((fields, index) => { + let hide = false; + let dom = ; + items.push({ + com: ( + {dom} + ), + colSpan: 1, + hide: hide + }) + }); + group.push() + }); + return group; + } + + jumpToHrmCard(id) { + window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${id}`); + } + + reRenderColumns(c) { + let _this = this; + let status = ""; + c.forEach(item => { + if (item.dataIndex == 'operator') { + item.render = function(text, record) { + return _this.jumpToHrmCard(record.operator)}>{record.operatorspan} + } + } else if (item.dataIndex == 'status') { + item.render = function(text, record) { + status = text; + return {text=='1'?i18n.label.success():i18n.label.fail()} + } + } else if (item.dataIndex == 'operatedetail') { + item.render = function(text, record) { + return {status=="1"?"":text} + } + } + }); + } + + cancel() { + const { + hrmImportResource + } = this.props; + hrmImportResource.visibleImportLog = false; + } + + render() { + const { + hrmImportResource, + viewLogTitle + } = this.props; + const { + form, + titleImportLog, + visibleImportLog, + importLogStore, + showSearchAd + } = hrmImportResource; + const btn = [ + (), + (), + () + ] + return ( +
+ { + visibleImportLog && + { this.cancel()} } + //buttons={buttons} + style={{width: 970, height: 510}} + > + { + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + hrmImportResource.doSearch(); + hrmImportResource.showSearchAd=false + } + } + } + >{this.getSearchs()}
} + setShowSearchAd={bool => {hrmImportResource.showSearchAd = bool}} + hideSearchAd={() => hrmImportResource.showSearchAd = false} + advanceHeight={200} + hasMask={false} + buttonsAd={btn} + /> + index} + getColumns={c => this.reRenderColumns(c)} + /> + + } +
+ ) + } +} + +export default ImportLog \ No newline at end of file diff --git a/pc4mobx/organization/components/importresource/ImportResult.js b/pc4mobx/organization/components/importresource/ImportResult.js new file mode 100644 index 0000000..e3e1ed2 --- /dev/null +++ b/pc4mobx/organization/components/importresource/ImportResult.js @@ -0,0 +1,185 @@ +import { + inject, + observer +} from 'mobx-react'; +import { + WeaDialog, + WeaNewScroll, +} from 'ecCom' + +import { + Row, + Col, + Icon, + Spin, + Modal, + Table, + Button, +} from 'antd' +import isEmpty from 'lodash/isEmpty'; +import React from 'react' +import { + WeaTableNew +} from 'comsMobx'; +import { + toJS +} from 'mobx'; + +const WeaTable = WeaTableNew.WeaTable; +import { + i18n +} from '../../public/i18n'; + +@inject('hrmImportResource') +@observer +class ImportResult extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + const { + hrmImportResource + } = this.props; + hrmImportResource.errorInfo = ''; + } + + getButtons() { + const { + hrmImportResource + } = this.props; + const { + failnum, + importStatus + } = hrmImportResource; + const buttons = []; + if (importStatus == 'over') { + // if (failnum > 0) { + // buttons.push(); + // } + // buttons.push(); + buttons.push(); + } + + return buttons; + } + + reRenderColumns(c) { + c.forEach(item => { + if (item.dataIndex == 'operatedetail') { + item.render = function(text, record) { + return {text} + } + } + }); + } + + cancel() { + const { + hrmImportResource + } = this.props; + this.dialogKey = new Date().getTime(); + hrmImportResource.visibleResult = false; + } + + getImportLog() { + const { + hrmImportResource + } = this.props; + hrmImportResource.visibleImportLog = true; + let params = {}; + params.importType = 'resource'; + hrmImportResource.getImportLogSearchCondition(params); + hrmImportResource.getImportLogDetail(params); + } + + render() { + const { + hrmImportResource + } = this.props; + const { + titleResult, + visibleResult, + importResultColumns, + importProcessLogDatas, + failnum, + succnum, + importResultTip, + importResultStore, + importStatus, + errorInfo, + setScrollRef, + dialogKey + } = hrmImportResource; + const buttons = []; + if (importStatus == 'over') { + buttons.push( + { + key: '1', + content: i18n.button.getImportLog(), + icon: , + onClick: () => this.getImportLog(), + } + ); + } + return ( +
+ { + visibleResult && + this.cancel()} + buttons={this.getButtons()} + style={{ width: 720, height: 480 }} + moreBtn={{datas:buttons}} + > +
+ { + importStatus == '' || importStatus == 'importing' || importStatus == 'error'?
+ { + importStatus == 'error'?
+
+ +
{importResultTip} +
: +
+ } +
+ {hrmImportResource.setScrollTarget(scroll)}}> + + + + :
+
+
0 ? '#54D3A2' : '#FF0000' }}> + 0 ? 'check' : 'cross'} style={{ color: '#fff' }} /> +
{importResultTip} +
+ { + failnum > 0 && + index} + getColumns={c => this.reRenderColumns(c)} + /> + } +
+ } + + + } + + ) + } +} + +export default ImportResult \ No newline at end of file diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 2496424..8b8fe2a 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -145,7 +145,7 @@ export default class Resource extends React.Component { tableStore.selectedRowKeys.length > 0 ? resource.export() : message.error("请选择需要导出的数据") } }} - //menuOnClick={(key, e) => console.log("选择了按钮:", e)} + menuOnClick={(key, e) => key == '1' ? tableStore.selectedRowKeys = []: ''} />) return btns; diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index bbc703d..6ef44b5 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -25,6 +25,7 @@ import DepartmentExtendStore from "./components/department/departmentExtend"; import FieldDefined from "./components/fieldDefinedSet/FieldDefined"; import Resource from "./components/resource/resource"; import ResourceExtend from "./components/resource/ResourceExtend"; +import BasicInfoImport from "./components/import"; import stores from "./stores"; import "./style/index"; @@ -83,7 +84,9 @@ const Routes = ( + + ); diff --git a/pc4mobx/organization/stores/adareaset.js b/pc4mobx/organization/stores/adareaset.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/stores/datasImport.js b/pc4mobx/organization/stores/datasImport.js index c856575..168e3c4 100644 --- a/pc4mobx/organization/stores/datasImport.js +++ b/pc4mobx/organization/stores/datasImport.js @@ -33,6 +33,10 @@ import { i18n } from '../public/i18n'; + import {ResourceStore} from "./resource"; + + const resource = new ResourceStore(); + // const hrmAdAreaSet = new HrmAdAreaSet(); export class DatasImportStore { @observable title = "人员导入"; @@ -148,7 +152,7 @@ import { }) } - saveImport = (params = {}) => { + @action saveImport = (params = {}) => { params.keyField = this.keyField; params.importType = this.importType; params.operateType = this.operateType; @@ -185,17 +189,21 @@ import { @action doImport = params => { API.saveImport(params).then(data => { - if (data.status == '1') { + if (data.code == 200) { + this.visible = false; + resource.getTableInfo(); + //window.location.reload(); + //导入进程暂未实现 if(data.message != null && data.message.trim().length > 0 && params.importType == 'matrix'){ - confirm({ - title: i18n.confirm.defaultTitle(), - content: data.message, - okText: i18n.button.ok(), - cancelText: i18n.button.cancel(), - onOk: () => { - this.doImport({...params, confirm: 1}) - } - }); + // confirm({ + // title: i18n.confirm.defaultTitle(), + // content: data.message, + // okText: i18n.button.ok(), + // cancelText: i18n.button.cancel(), + // onOk: () => { + // this.doImport({...params, confirm: 1}) + // } + // }); }else if (!isEmpty(data.errorInfo)) { this.importStatus = 'error'; this.importResultTip = i18n.message.selectImportTempleteError(); diff --git a/pc4mobx/organization/stores/import.js b/pc4mobx/organization/stores/import.js new file mode 100644 index 0000000..1c4776f --- /dev/null +++ b/pc4mobx/organization/stores/import.js @@ -0,0 +1,56 @@ +import * as Api from '../apis/basicImport'; +import { + observable, + action +} from 'mobx'; +import { + message, +} from 'antd'; +import { + i18n +} from '../public/i18n'; + +export class HrmBasicDataImport { + @observable title = i18n.module.basicInfoImport(); + @observable isMouseOver = false; + @observable curIndex = ''; + @observable loading = true; + @observable authorized = false; + @observable cardConfig = [] + + @action + getRight = () => { + this.loading = true; + const params = { + type: 'HrmBasicDataImport' + } + Api.getBasicDataImportHasRight(params).then(action(rs => { + const { + status, + hasRight + } = rs; + + if (status == '1') { + if (hasRight) { + this.authorized = true; + if (rs.cardConfig) { + this.cardConfig = rs.cardConfig + } else { + this.authorized = false; + } + } + this.loading = false; + } else { + this.loading = false; + } + })).catch(error => { + message.error(error); + }); + } + + @action + setMouseStatus = (index, bool) => { + this.curIndex = index; + this.isMouseOver = bool; + } +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/importCommon.js b/pc4mobx/organization/stores/importCommon.js new file mode 100644 index 0000000..0594f58 --- /dev/null +++ b/pc4mobx/organization/stores/importCommon.js @@ -0,0 +1,458 @@ +import * as Api from '../apis/importresource'; +import { + observable, + action, + extendObservable +} from 'mobx'; +import { + WeaForm, + WeaTableNew +} from 'comsMobx'; +import { + message +} from 'antd' +import { + i18n +} from '../public/i18n'; +const { + TableStore +} = WeaTableNew; + +// import { +// HrmAdAreaSet +// } from './adareaset'; +// import { +// HrmOfficeAddress +// } from './officeaddress'; +// import { +// HrmPostSet +// } from './postset'; +// import { +// HrmMajorSet +// } from './majorset'; +// const hrmAdAreaSet = new HrmAdAreaSet(); +// const hrmOfficeAddress = new HrmOfficeAddress(); +// const hrmPostSet = new HrmPostSet(); +// const hrmMajorSet = new HrmMajorSet(); + +export class HrmImportCommon { + sourceStore = null; + @observable pageName = ''; + @observable importType = ''; + @observable importDialog = { + visible: false, + condition: [], + form: new WeaForm(), + title: '', + loading: true, + templetName: '', + selectedValue: 'workcode', + } + + @observable resultDialog = { + title: observable.ref(i18n.label.importResult()), + errorTip: observable.ref(i18n.message.selectImportTempleteError()), + visible: false, + index: 1, + datas: [], + importStatus: '', + pId: '', + interval: '', + tableStore: new TableStore(), + errorInfo: [], + succnum: 0, + failnum: 0, + loading: true, + component: '', + } + + @observable recordDialog = { + title: observable.ref(i18n.button.importHistoryQuery()), + visible: false, + tableStore: new TableStore(), + } + + @observable logDialog = { + title: observable.ref(i18n.button.getImportLog()), + visible: false, + tableStore: new TableStore(), + isPanelShow: false, + form: new WeaForm(), + condition: [], + loading: true, + } + + @action + getImportForm = () => { + this.importDialog.loading = true; + let params = { + importType: this.importType + } + Api.getImportForm(params).then(rs => { + const { + status, + condition = [], + } = rs; + + if (status == '1') { + this.importDialog.condition = condition; + const copy = [...condition]; + copy.splice(1); + copy[0].items.splice(2); + this.importDialog.form.initFormFields(copy); + this.importDialog.loading = false; + } else { + // message.error(rs.message); + } + }).catch(error => { + message.error(error); + }); + } + + @action + getImportProcessInfo = () => { + let params = { + importType: this.importType, + index: this.resultDialog.index, + }; + Api.getImportProcessLog(params).then(rs => { + const { + datas, + index, + pId = '', + status + } = rs; + + this.resultDialog.loading = false; + if (status == '1') { + const { + importStatus, + interval, + errorInfo, + component + } = this.resultDialog; + + component.scrollToLast(); + + if (importStatus == 'over' || importStatus == 'error') { + clearInterval(interval); + if (!this.hasErrorInfo(errorInfo)) this.getResultInfo(); + + this.sourceStore && this.sourceStore.getTable(); + + //根据pageName判断刷新那个页面的列表 + // switch (this.pageName) { + // case 'adareaset': + // hrmAdAreaSet.setOperation('getTable'); + // hrmAdAreaSet.setFuncName('getCountryList'); + // hrmAdAreaSet.getTable(); + // break; + // case 'officeaddress': + // hrmOfficeAddress.getTableInfo(); + // break; + // case 'post': + // hrmPostSet.initSet('getTableInfo', 'getJobGroupList'); + // hrmPostSet.getTableInfo(); + // break; + // case 'major': + // hrmMajorSet.setOperation('getTableInfo'); + // hrmMajorSet.getTableInfo(); + // break; + // } + return + } + + if (rs.importStatus == 'over' || rs.importStatus == 'error') { + this.resultDialog.loading = true; + } + + this.resultDialog.importStatus = rs.importStatus; + + if (pId) this.resultDialog.pId = pId; + + if (this.resultDialog.datas.length == 0) { + this.resultDialog.datas = datas; + } else { + this.resultDialog.datas = [...this.resultDialog.datas, ...datas] + } + + this.resultDialog.index = index; + } + + }); + } + + @action + getResultInfo = () => { + let params = { + pId: this.resultDialog.pId + }; + this.resultDialog.loading = true; + Api.getImportResult(params).then(rs => { + const { + datas, + status + } = rs, { + succnum, + failnum, + sessionkey = '' + } = datas; + + if (status == '1') { + this.resultDialog.succnum = succnum; + this.resultDialog.failnum = failnum; + sessionkey && this.resultDialog.tableStore.getDatas(sessionkey, 1); + } + this.resultDialog.loading = false; + }); + } + + @action + getRecordTable = () => { + let params = { + importType: this.importType + }; + Api.getImportHistory(params).then(rs => { + const { + status, + sessionkey, + } = rs; + + if (status == '1') { + this.recordDialog.tableStore.getDatas(sessionkey, 1); + } else { + message.error(rs.message); + } + }).catch(error => { + message.error(error); + }); + } + + @action + getLogTable = () => { + let params = { + importType: this.importType, + ...this.logDialog.form.getFormParams(), + }; + if (this.resultDialog.pId) { + params = { ...params, + pId: this.resultDialog.pId + } + } + Api.getImportLogDetail(params).then(rs => { + const { + status, + sessionkey + } = rs; + + if (status == '1') { + this.logDialog.tableStore.getDatas(sessionkey, 1); + } else { + message.error(rs.message); + } + }).catch(error => { + message.error(error); + }); + } + + @action + submitImportInfo = () => { + let params = { + importType: this.importType, + excelfile: this.importDialog.excelFileId, + operateType: 'add' + }; + if (this.importType == 'group') { + params = { + ...params, + ...this.importDialog.form.getFormParams() + } + } + this.setResultInfoDialogVisible(true); + Api.saveImport(params).then(rs => { + const { + status, + errorInfo + } = rs; + + if (status == '1') { + if (this.hasErrorInfo(errorInfo)) { + this.resultDialog.errorInfo = errorInfo; + this.resultDialog.importStatus = 'error'; + } + } else { + message.error(rs.message); + } + }).catch(error => { + message.error(error); + }); + this.resultDialog.interval = setInterval(() => this.getImportProcessInfo(), 2000); + } + + @action + getLogSearchPanelCondition = () => { + this.logDialog.loading = true; + let params = { + importType: this.importType + }; + Api.getImportLogSearchCondition(params).then(rs => { + const { + status, + searchCondition + } = rs; + + if (status == '1') { + this.logDialog.condition = searchCondition; + this.logDialog.form.initFormFields(searchCondition); + } else { + message.error(rs.message); + } + this.logDialog.loading = false; + }).catch(error => { + message.error(error); + }); + } + + @action + setExcelFileNo = (id) => { + extendObservable(this.importDialog, { + excelFileId: id + }); + } + + @action + submitExcel = () => { + if (!this.importDialog.excelFileId) { + message.warning(i18n.message.selectImportTemplete()); + return; + } + this.submitImportInfo(); + } + + @action + queryRecord = () => { + this.setRecordDialogVisible(true); + } + + @action + queryLog = () => { + this.setLogDialogVisible(true); + } + + @action + jumpToImportResult = (id) => { + this.resultDialog.pId = id; + this.resultDialog.importStatus = 'over'; + this.setResultInfoDialogVisible(true); + this.getResultInfo(); + } + + + @action + setImportDialogVisible = (bool) => { + this.importDialog.visible = bool; + if (bool) { + this.getImportForm(); + } else { + this.importDialogReset(); + } + + } + + //设置标识,标识当前是那个页面在导入 + @action + setImportPage = (pageName) => { + this.pageName = pageName; + } + + @action + setResultInfoDialogVisible = (bool) => { + this.resultDialog.visible = bool; + if (!bool) { + clearInterval(this.resultDialog.interval); + this.resetResultDialogStatus(); + } + } + + @action + importDialogReset = () => { + this.importDialog.condition = []; + this.importDialog.form = new WeaForm(); + this.importDialog.selectedValue = 'workcode'; + this.importDialog.excelFileId = ''; + } + + @action + resetResultDialogStatus = () => { + this.resultDialog.index = 1; + this.resultDialog.datas = []; + this.resultDialog.importStatus = ''; + this.resultDialog.pId = ''; + this.resultDialog.interval = ''; + this.resultDialog.errorInfo = ''; + this.resultDialog.loading = true; + } + + @action + setRecordDialogVisible = (bool) => { + this.recordDialog.visible = bool; + bool && this.getRecordTable(); + } + + @action + setLogDialogVisible = (bool) => { + this.logDialog.visible = bool; + bool && this.getLogTable(); + if (!bool) { + this.logDialog.isPanelShow = false; + this.logDialog.form = new WeaForm(); + this.logDialog.condition = []; + } + } + + @action + setLogPanelStatus = (bool) => { + this.logDialog.isPanelShow = bool; + bool && this.logDialog.condition.length == 0 && this.getLogSearchPanelCondition(); + } + + @action + searchLogInfo = () => { + this.getLogTable(); + } + + hasErrorInfo = (errorInfo) => { + if (errorInfo.length == 0) return false; + return true + } + + @action + setTempletName = (templetName) => { + this.importDialog.templetName = templetName; + } + + @action + setImportDialogTitle = (title) => { + this.importDialog.title = title; + } + + @action + setImportType = (type) => { + this.importType = type; + } + + @action + setSelectedValue = (value) => { + this.importDialog.selectedValue = value; + } + + @action + setScoll = (component) => { + this.resultDialog.component = component; + } + + setSourceStore = (store) => { + this.sourceStore = store; + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/importresource.js b/pc4mobx/organization/stores/importresource.js new file mode 100644 index 0000000..3f000b0 --- /dev/null +++ b/pc4mobx/organization/stores/importresource.js @@ -0,0 +1,370 @@ +import { + observable, + action +} from 'mobx'; +import { + WeaForm +} from 'comsMobx'; +import * as API from '../apis/importresource'; +import * as Util from '../util/index'; +import { + validate, + getFormParamValue +} from '../util' +import { + message, + Modal, + Button +} from 'antd'; +import { + WeaTableNew +} from 'comsMobx' +import * as mobx from 'mobx'; +import isEmpty from 'lodash/isEmpty'; +import { + has +} from 'lodash'; +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; +const confirm = Modal.confirm; +import { + i18n +} from '../public/i18n'; + + +export class HrmImportResource { + @observable title = "人员导入"; + @observable templetName = "导入模板"; + titleResult = i18n.label.importResult; + titleHistory = i18n.button.importHistoryQuery; + titleImportLog = i18n.button.getImportLog; + importResultColumns = []; + index = 1; + @observable scrollTarget; + @observable visible = false; + @observable visibleResult = false; + @observable visibleHistory = false; + @observable visibleImportLog = false; + @observable condition = []; + @observable single = false; + @observable keyField = 'workcode'; + @observable importType = ''; + @observable operateType = 'add'; + @observable filelist = []; + @observable excelfile = ''; + @observable searchCondition = []; + @observable form = new WeaForm(); + @observable showSearchAd = false; + @observable searchParamsAd = {}; + @observable importResultStore = new TableStore(); + @observable importHistoryStore = new TableStore(); + @observable importLogStore = new TableStore(); + @observable buttons = []; + @observable importProcessLogDatas = []; + @observable succnum = 0; + @observable failnum = 0; + @observable importResultTip = ''; + @observable importStatus = ''; + @observable pId = ''; + @observable ref; + @observable errorInfo = ''; + @observable dialogKey = new Date().getTime(); + @observable otherParams; + @observable showLoadingSpin = false; + interval; + importCallback; + getTemplateUrl; + @observable importParams = {}; + + importResultColumns = [{ + "title": i18n.label.confirmInfo(), + "width": "100%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + + @action + init() { + this.condition = []; + this.keyField = 'workcode'; + this.importType = ''; + this.operateType = 'add'; + this.filelist = []; + this.excelfile = ''; + this.searchCondition = []; + this.buttons = []; + this.importProcessLogDatas = []; + this.succnum = 0; + this.failnum = 0; + this.importResultTip = ''; + this.importStatus = ''; + this.pId = ''; + this.errorInfo = ''; + this.importParams = {}; + } + + @action setParam = (k, v) => { + const p = toJS(this.importParams); + Object.assign(p, { + [k]: v + }); + this.importParams = p; + } + + getImportForm(params = {}) { + this.showLoadingSpin = true; + params.importType = this.importType; + this.otherParams != null && Object.assign(params, { + otherParams: JSON.stringify({ ...this.otherParams, + type: this.operateType + }) + }) + API.getImportForm(params).then(data => { + if (data.status == '1') { + this.condition = data.condition; + if (data.condition != null && Array.isArray(data.condition) && data.condition.length > 0) { + this.condition[0].items.map(item => { + if (item.conditionType === 'SELECT' && item.domkey[0] === 'importType') { + item.options.map(op => { + if (op.selected) + this.operateType = op.key; + }) + } + item.domkey[0].indexOf('keyField') > -1 && this.setParam(item.domkey[0], item.value); + }) + } + } else { + // message.warning(data.message); + } + + this.showLoadingSpin = false; + }, error => { + message.warning(error.message); + this.showLoadingSpin = false; + }) + } + + saveImport = (params = {}) => { + params.keyField = this.keyField; + params.importType = this.importType; + params.operateType = this.operateType; + params.excelfile = this.excelfile || ''; + if (params.excelfile == '') { + message.warning(i18n.message.selectImportTemplete()); + return; + } + if (this.otherParams != null) { + Object.assign(params, { + otherParams: JSON.stringify(this.otherParams) + }) + has(this.otherParams, 'logSmallType') && Object.assign(params, { + logSmallType: this.otherParams.logSmallType + }) + } + + this.importResultColumns = [{ + "title": i18n.label.confirmInfo(), + "width": "100%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + this.index = 1; + this.importStatus = ''; + this.importProcessLogDatas = []; + this.importStatus = 'importing'; + this.getImportProcess(); + this.doImport({...params, ...this.importParams, confirm: 0}); + this.dialogKey = new Date().getTime(); + this.visibleResult = true; + } + + @action doImport = params => { + API.saveImport(params).then(data => { + if (data.code == 200) { + if(data.message != null && data.message.trim().length > 0 && params.importType == 'matrix'){ + confirm({ + title: i18n.confirm.defaultTitle(), + content: data.message, + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk: () => { + this.doImport({...params, confirm: 1}) + } + }); + }else if (!isEmpty(data.errorInfo)) { + this.importStatus = 'error'; + this.importResultTip = i18n.message.selectImportTempleteError(); + this.importResultColumns = [{ + "title": i18n.label.confirmInfo(), + "width": "100%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + this.importProcessLogDatas = data.errorInfo; + }else{ + this.importCallback && this.importCallback(); + } + }else { + this.importStatus = 'error'; + message.warning(data.message); + } + }) + } + + getImportProcess() { + this.interval = setInterval(() => this.getImportProcessLog(), 2000); + } + + getImportProcessLog(params = {}) { + if (this.visibleResult == false || this.importStatus == 'over' || this.importStatus == 'error') { + clearInterval(this.interval); + return; + } + params.index = this.index; + params.importType = this.importType; + let textColor = ""; + this.importResultColumns = [{ + "title": i18n.label.row(), + "width": "15%", + "dataIndex": "rownum" + }, { + "title": i18n.label.status(), + "width": "15%", + "dataIndex": "status", + render: (text, record, index) => { + if (text == '1') { + textColor = "#54D3A2"; + } else { + textColor = "#FF0000"; + } + return {text=='1'?i18n.label.success():i18n.label.fail()} + } + }, { + "title": i18n.label.confirmInfo(), + "width": "70%", + "dataIndex": "message", + render: (text, record, index) => { + return {text} + } + }]; + API.getImportProcessLog(params).then((data) => { + if (data.status == '1') { + if (!isEmpty(this.importProcessLogDatas)) { + this.importProcessLogDatas = [...this.importProcessLogDatas, ...data.datas] + } else { + this.importProcessLogDatas = data.datas; + } + this.index = data.index; + if (data.pId) { + this.pId = data.pId; + } + + const {importStatus} = data; + if(['over', 'error'].indexOf(importStatus) > -1) + this.importStatus = importStatus; + //this.scrollTarget.scrollToLast(); + if (data.importStatus == 'over') { + this.getImportResult({ + pId: this.pId + }); + clearInterval(this.interval); + } + } else { + message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + setScrollTarget(scroll) { + this.scrollTarget = scroll; + } + + getImportResult(params = {}) { + this.importStatus = 'over'; + if (params.pId) { + this.pId = params.pId; + } + API.getImportResult(params).then((data) => { + if (data.status == '1') { + this.failnum = data.datas.failnum; + this.succnum = data.datas.succnum; + if (this.failnum > 0) { + let info = i18n.label.importResourceResultInfo(); + info = info.replace('{rownum}', this.succnum + this.failnum).replace('{succnum}', this.succnum); + this.importResultTip = info; + this.importResultStore.getDatas(data.datas.sessionkey, 1); + } else { + let info = i18n.label.importResourceResultInfo1(); + info = info.replace('{rownum}', this.succnum); + this.importResultTip = info; + } + } else { + message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + getImportHistory(params = {}) { + params.importType = this.importType; + this.otherParams != null && has(this.otherParams, 'logSmallType') && Object.assign(params, { + logSmallType: this.otherParams.logSmallType + }) + API.getImportHistory(params).then((data) => { + if (data.status == '1') { + data.sessionkey && this.importHistoryStore.getDatas(data.sessionkey, 1); + } else { + message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + getImportLogDetail(params = {}) { + if (this.pId) params.pId = this.pId; + params.importType = this.importType; + API.getImportLogDetail(params).then((data) => { + if (data.status == '1') { + data.sessionkey && this.importLogStore.getDatas(data.sessionkey, 1); + } else { + message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + getImportLogSearchCondition(params = {}) { + if (this.pId) params.pId = this.pId; + this.form.updateIsFormInit(false); + this.form = new WeaForm(); + API.getImportLogSearchCondition(params).then((data) => { + if (data.status == '1') { + this.searchCondition = data.searchCondition; + this.form.initFormFields(data.searchCondition); + } else { + message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + + doSearch(params = {}) { + let formParams = this.form.getFormParams(); + this.getImportLogDetail(formParams); + } +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 7db733f..9466607 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -19,6 +19,9 @@ import {FieldDefinedStore} from "./fieldDefined"; import {ResourceStore} from "./resource"; import {ResourceExtendStore} from "./resourceExtend"; import {DatasImportStore} from "./datasImport"; +import {HrmImportResource} from "./importresource"; +import {HrmImportCommon} from "./importCommon"; +import {HrmBasicDataImport} from "./import" module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -41,5 +44,8 @@ module.exports = { fieldDefined: new FieldDefinedStore(), resource: new ResourceStore(), resourceExtend: new ResourceExtendStore(), - datasImport: new DatasImportStore() + datasImport: new DatasImportStore(), + hrmImportResource:new HrmImportResource(), + hrmImportCommon:new HrmImportCommon(), + hrmBasicDataImport:new HrmBasicDataImport() }; diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 25ec5b3..8ed79a2 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -179,6 +179,7 @@ const { ...this.form.getFormParams() } Api.exportResource(toJS(this.tableStore.selectedRowKeys).toString()); + this.tableStore.selectedRowKeys = []; } updateFields(val) { diff --git a/pc4mobx/organization/style/import.css b/pc4mobx/organization/style/import.css new file mode 100644 index 0000000..5e68d7b --- /dev/null +++ b/pc4mobx/organization/style/import.css @@ -0,0 +1,86 @@ +.hrm-card-out{ + width: 24%; + height: 130px; + float: left; + margin-left: 1.3%; + margin-top: 10px; +} + +.hrm-card-inwrap{ + height: 100%; + position: relative; + cursor: pointer; +} + +.hrm-card-icon{ + width: 40px; + font-size: 40px; + position: absolute; + left: 50%; + margin-left: -20px; + margin-top: 30px; + color: #fff; +} + +.hrm-card-title{ + /*width: 80px;*/ + text-align: right; + position: absolute; + right: 20px; + font-size: 17px; + bottom: 15px; + color: #fff; +} + +.hrm-import-wrap{ + width: 90%; + height: 100%; + margin-left: 5%; + padding-top: 30px; +} + +.hrm-import-table-th .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ + padding: 8px 8px; + color: #666; +} + +.hrm-import-table-th .ant-table-thead>tr>th{ + background-color: #F0F6F6; +} + +.hrm-import-table-th .ant-table{ + border-radius: 0; +} + +.hrm-import-table-th .ant-table table{ + border-radius: 0; +} + +.hrm-import-loading .ant-spin.ant-spin-show-text .ant-spin-text{ + float: right; + margin-left: 20px; + padding-top: 2px +} + +.hrm-import-error-tip{ + width: 30px; + height: 30px; + border-radius: 25px; + padding: 6px; + /* margin-left: 230px; */ + margin-right: 10px; + display: inline-block; + background-color: rgb(255, 0, 0); +} + +.hrm-import-ant-table .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ + padding: 8px 8px; +} + +.hrm-import-link{ + color: #B4B4B4; +} + +.hrm-import-link:hover{ + color: #FFF; +} \ No newline at end of file From 0f4c438bbfeecbc5acd6d8052845ffd80f9d7240 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 5 Jul 2022 18:54:56 +0800 Subject: [PATCH 036/155] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/logview.js | 12 ++ pc4mobx/organization/components/Home.js | 24 +-- .../components/NewAndEditDialog.js | 2 +- .../organization/components/log/LogView.js | 167 ++++++++++++++++++ .../components/staff/StaffScheme.js | 5 +- pc4mobx/organization/stores/fieldDefined.js | 2 +- pc4mobx/organization/stores/index.js | 5 +- pc4mobx/organization/stores/job.js | 14 +- pc4mobx/organization/stores/jobgrade.js | 87 +++++---- pc4mobx/organization/stores/logview.js | 114 ++++++++++++ 10 files changed, 372 insertions(+), 60 deletions(-) create mode 100644 pc4mobx/organization/apis/logview.js create mode 100644 pc4mobx/organization/components/log/LogView.js create mode 100644 pc4mobx/organization/stores/logview.js diff --git a/pc4mobx/organization/apis/logview.js b/pc4mobx/organization/apis/logview.js new file mode 100644 index 0000000..887b841 --- /dev/null +++ b/pc4mobx/organization/apis/logview.js @@ -0,0 +1,12 @@ + +import { + WeaTools +} from 'ecCom' + +export const getLogList = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params); +} + +export const getAdvanceSearchCondition = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSearchCondition', 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/Home.js b/pc4mobx/organization/components/Home.js index 244ed50..86a3b3d 100644 --- a/pc4mobx/organization/components/Home.js +++ b/pc4mobx/organization/components/Home.js @@ -12,18 +12,20 @@ const WeaLogViewComp = WeaLogView.Component; const { LogStore } = WeaLogView; +import LogView from "./log/logView"; + +import {LogViewStore} from "../stores/logview" class Home extends React.Component { constructor(props) { super(props); this.state = { - key: new Date().getTime(), + keys: new Date().getTime(), visible: false, - logStore: new LogStore(), - logType: '4', - logSmallType: '' + logViewStore: new LogViewStore() + } - window.setLogViewProps = this.setLogViewProps; + window.setLogViewProp = this.setLogViewProp; } componentDidMount(){ @@ -46,13 +48,10 @@ class Home extends React.Component { }); } - setLogViewProps = (props) => { + setLogViewProp = (props) => { this.setState({ - key: new Date().getTime(), - targetId: '', visible: true, - logType: '4', - logStore: new LogStore(), + logViewStore: new LogViewStore(), ...props }); } @@ -61,15 +60,18 @@ class Home extends React.Component { visible: false }) } + render() { //const isSingle = window.location.pathname.indexOf('/spa/hrm/engine') > -1; return (
- + + {/* */} {this.props.children} +
) } diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index cd2ba9f..f5ab0f4 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -26,7 +26,7 @@ export default class NewAndEditDialog extends React.Component { width: 700, } } - + getForm() { const { diff --git a/pc4mobx/organization/components/log/LogView.js b/pc4mobx/organization/components/log/LogView.js new file mode 100644 index 0000000..5c58323 --- /dev/null +++ b/pc4mobx/organization/components/log/LogView.js @@ -0,0 +1,167 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaDialog, + WeaSearchGroup +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; + +const toJS = mobx.toJS; +const confirm = Modal.confirm; +const WeaTable = WeaTableNew.WeaTable; + + +export default class LogView extends React.Component { + constructor(props) { + super(props); + this.state = ({ + height: 402, + width: 1075, + dialogTitle: '日志查看', + }) + } + + componentWillMount() { + } + + + componentDidMount() { + + } + + componentWillReceiveProps(nextProps) { + if (this.props.keys !== nextProps.keys) { + nextProps.logViewStore.init(nextProps.logMoudleType); + } + } + + getPanelComponents() { + const { + logViewStore + } = this.props; + const { + searchCondition, + form, + searchConditionLoading + } = logViewStore; + + let arr = []; + let formParams = form.getFormParams(); + const { + isFormInit + } = form; + + isFormInit && searchCondition.map(c => { + c.items.map((field, index) => { + arr.push(
+
+ + {} + +
+ ) + }) + }) + + if (searchConditionLoading) { + return ( +
+ +
+ ) + } else { + return { + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + logViewStore.getTableInfo(); + logViewStore.setPanelStatus(false) + } + }}>{arr} + } + + } + + getTabBtn() { + const { + logViewStore + } = this.props; + const { + form + } = logViewStore; + + const btn = [ + (), + (), + (), + ]; + + return btn; + } + + + render() { + + const { + visible, onCancel, logViewStore + } = this.props, { + tableStore,isPanelShow,conditionNum + } = logViewStore, { + height, dialogTitle, width, + } = this.state; + + return ( + onCancel()} + style={{ height: height, width: width }} + > + logViewStore.setPanelStatus(bool)} + hideSearchAd={() => logViewStore.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => logViewStore.getTableInfo()} + /> + +
) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index 0810c4d..c527d33 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -266,8 +266,9 @@ export default class StaffScheme extends React.Component { } log = () => { - window.setLogViewProps({ - logSmallType: '3010', + window.setLogViewProp({ + logMoudleType: '0', + keys: new Date().getTime(), }); } diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 6c8affa..0a646b7 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-29 17:23:37 + * @LastEditTime: 2022-07-04 15:12:06 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 9466607..4d66441 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -21,7 +21,8 @@ import {ResourceExtendStore} from "./resourceExtend"; import {DatasImportStore} from "./datasImport"; import {HrmImportResource} from "./importresource"; import {HrmImportCommon} from "./importCommon"; -import {HrmBasicDataImport} from "./import" +import {HrmBasicDataImport} from "./import"; + module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -47,5 +48,5 @@ module.exports = { datasImport: new DatasImportStore(), hrmImportResource:new HrmImportResource(), hrmImportCommon:new HrmImportCommon(), - hrmBasicDataImport:new HrmBasicDataImport() + hrmBasicDataImport:new HrmBasicDataImport(), }; diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 0164c1e..fc23b6d 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -304,15 +304,11 @@ export class JobStore { } updateConditions(data) { - this.form1.updateFields({ - scheme_id: { - value: '', - }, - }); - // const label = "等级方案" - // const index = findIndex(this.condition[0].items, { label }); - // this.condition[0].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: "18" }]; - + const label = "等级方案" + const index = findIndex(this.condition[0].items, { label }); + this.condition[0].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: data.sequence_id.valueObj[0].scheme_values }]; + this.setCondition(this.condition,false); + this.form1.initFormFields(this.condition); } diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index ab9b623..9e098c8 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -51,39 +51,39 @@ export class JobGradeStore { @observable hasRight = true; @observable treeLoading = true; - @observable treeConfig = { - data: [], - selectedKeys: [], - treeExpandKeys: [], - onExpand: (keys) => { - this.treeConfig.treeExpandKeys = keys; - }, - onSelectedTreeNode: (key, count, countType) => { - this.treeConfig.selectedKeys = [key]; - this.selectedTreeNodeInfo = countType.node.props.data; - this.getTableInfo(); - } - } - //选中树节点的信息 - @observable selectedTreeNodeInfo; + @observable treeConfig = { + data: [], + selectedKeys: [], + treeExpandKeys: [], + onExpand: (keys) => { + this.treeConfig.treeExpandKeys = keys; + }, + onSelectedTreeNode: (key, count, countType) => { + this.treeConfig.selectedKeys = [key]; + this.selectedTreeNodeInfo = countType.node.props.data; + this.getTableInfo(); + } + } + //选中树节点的信息 + @observable selectedTreeNodeInfo; @action initData = () => { this.selectedTreeNodeInfo = null; - this.treeConfig.treeExpandKeys.length = 0; - Api.getTree().then(res => { - if (res.code === 200) { - if (res.data.length > 0) { - this.treeConfig.data = res.data; - this.treeConfig.selectedKeys = [res.data[0].key]; + this.treeConfig.treeExpandKeys.length = 0; + Api.getTree().then(res => { + if (res.code === 200) { + if (res.data.length > 0) { + this.treeConfig.data = res.data; + this.treeConfig.selectedKeys = [res.data[0].key]; this.treeConfig.treeExpandKeys = "-1"; - this.selectedTreeNodeInfo = res.data[0]; - this.getTableInfo(); + this.selectedTreeNodeInfo = res.data[0]; + this.getTableInfo(); this.setTreeLoading(false); - } - } else { - message.error(res.msg); - } - }, error => { }) + } + } else { + message.error(res.msg); + } + }, error => { }) } @@ -108,7 +108,7 @@ export class JobGradeStore { if (res.code === 200) { this.setHasRight(res.data.hasRight); res.data.datas && this.tableStore.getDatas(res.data.datas, 1); - + } else { message.warning(res.msg); } @@ -255,7 +255,7 @@ export class JobGradeStore { @action - getHasRight() { + getHasRight() { Api.getHasRight().then(res => { if (res.code === 200) { res.data.rightMenu && this.setRightMenu(res.data.rightMenu); @@ -278,15 +278,34 @@ export class JobGradeStore { updateConditions(val) { let currenttime = Date.now(); - let key = `schemId_${currenttime}`; + let key = `scheme_id_${currenttime}`; const lastKey = this.key; - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams,lastKey) + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.completeParams, lastKey); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.conditionDataParams, lastKey); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams, lastKey); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.destDataParams, lastKey); this.setKey(key); + this.condition[0].items[4].browserConditionParam.completeParams = { + [key]: val, + ...this.condition[0].items[4].browserConditionParam.completeParams, + currenttime: currenttime + } + this.condition[0].items[4].browserConditionParam.conditionDataParams = { + [key]: val, + ...this.condition[0].items[4].browserConditionParam.conditionDataParams, + currenttime: currenttime + } this.condition[0].items[4].browserConditionParam.dataParams = { - [key]:val, + [key]: val, ...this.condition[0].items[4].browserConditionParam.dataParams, currenttime: currenttime } + this.condition[0].items[4].browserConditionParam.destDataParams = { + [key]: val, + ...this.condition[0].items[4].browserConditionParam.destDataParams, + currenttime: currenttime + } + this.form.updateFields({ levelId: { value: '' @@ -396,7 +415,7 @@ export class JobGradeStore { this.rightMenu = rightMenu; } - setKey (key) { + setKey(key) { this.key = key; } diff --git a/pc4mobx/organization/stores/logview.js b/pc4mobx/organization/stores/logview.js new file mode 100644 index 0000000..88cef75 --- /dev/null +++ b/pc4mobx/organization/stores/logview.js @@ -0,0 +1,114 @@ +import { + observable, + action +} from 'mobx'; +import * as mobx from 'mobx'; +import * as Api from '../apis/logview'; +import { + WeaForm +} from 'comsMobx'; +import { + WeaTableNew +} from 'comsMobx'; +import { + Modal, + message, +} from 'antd' +import { + i18n +} from '../public/i18n'; + +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; + +export class LogViewStore { + @observable tableStore = new TableStore(); + @observable searchCondition = []; + @observable isPanelShow = false; //高级搜索面板 + @observable form = new WeaForm(); + @observable conditionNum = 20; + @observable searchConditionLoading = true; + @observable visible = false; + @observable dialogLoading = false; + @observable moduleType = ""; //模块类型 + + init(logMoudleType) { + this.setModuleType(logMoudleType); + this.getTableInfo(); + this.getSearchCondition(); + } + + @action getTableInfo() { + let params = { + ...this.form.getFormParams(), + moduleType:this.moduleType + } + this.tableStore = new TableStore(); + Api.getLogList(params).then(res => { + if (res.code === 200) { + res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + + + @action getSearchCondition() { + this.setDialogLoading(true); + Api.getAdvanceSearchCondition().then(res => { + if (res.code === 200) { + this.setDialogLoading(false); + res.data.conditions && this.setSearchCondition(res.data.conditions); + res.data.conditions && this.form.initFormFields(res.data.conditions); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + + + setDialogLoading(bool) { + this.dialogLoading = bool; + } + + setPanelStatus(bool) { + this.isPanelShow = bool; + bool && this.getSearchCondition(); + if (!bool) { + this.scLoadingReset(); + } + } + + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + setSearchCondition(searchCondition) { + this.searchCondition = searchCondition; + } + + scLoadingReset() { + this.searchConditionLoading = true; + } + + setVisable(bool) { + this.visible = bool; + } + + setModuleType(moduleType) { + this.moduleType = moduleType; + } + +} \ No newline at end of file From ba2d6f7f8b61e4ff8b73a849865652ffff083f21 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 6 Jul 2022 11:21:13 +0800 Subject: [PATCH 037/155] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ pc4mobx/organization/index.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3c3629e..379f712 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ node_modules +.idea +.vscode + diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 6ef44b5..739d5bc 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -86,7 +86,7 @@ const Routes = ( - + ); From d5e13c6057e8d4bd807831294d65fcb16c63644c Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Wed, 6 Jul 2022 18:11:23 +0800 Subject: [PATCH 038/155] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../branchNumSetting/components/numberComposition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js index 3f65be5..ccbe1e7 100644 --- a/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js +++ b/pc4mobx/organization/components/numberSetting/branchNumSetting/components/numberComposition.js @@ -428,6 +428,7 @@ class NumberComposition extends Component { title={i18n.label.addNumberField()} visible={visible} hasScroll + initLoadCss maxHeight={150} buttons={buttons}>
From dd023861d7a362ef6425d6993e0852deaa03d09e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 7 Jul 2022 18:06:02 +0800 Subject: [PATCH 039/155] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/logview.js | 4 +- pc4mobx/organization/components/Home.js | 2 +- .../components/NewAndEditDialog.js | 2 +- .../components/company/company.js | 10 +- .../components/department/department.js | 10 +- pc4mobx/organization/components/job/Job.js | 10 +- .../organization/components/log/LogView.js | 117 ++++++++++++------ .../components/office/officeManage.js | 12 +- .../components/postionrank/JobGrade.js | 8 ++ .../components/postionrank/JobLevel.js | 6 + .../components/postionrank/RankScheme.js | 8 ++ .../components/resource/resource.js | 8 ++ .../components/sequence/Sequence.js | 6 + .../organization/components/staff/Staff.js | 8 ++ .../components/staff/StaffScheme.js | 2 +- pc4mobx/organization/stores/job.js | 101 ++++++++++++++- pc4mobx/organization/stores/logview.js | 27 ++-- 17 files changed, 275 insertions(+), 66 deletions(-) diff --git a/pc4mobx/organization/apis/logview.js b/pc4mobx/organization/apis/logview.js index 887b841..cc12e6c 100644 --- a/pc4mobx/organization/apis/logview.js +++ b/pc4mobx/organization/apis/logview.js @@ -4,9 +4,9 @@ import { } from 'ecCom' export const getLogList = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/log/listPage', 'GET', params); } export const getAdvanceSearchCondition = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSearchCondition', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/log/getSearchCondition', 'GET', params); } \ No newline at end of file diff --git a/pc4mobx/organization/components/Home.js b/pc4mobx/organization/components/Home.js index 86a3b3d..5cc0369 100644 --- a/pc4mobx/organization/components/Home.js +++ b/pc4mobx/organization/components/Home.js @@ -12,7 +12,7 @@ const WeaLogViewComp = WeaLogView.Component; const { LogStore } = WeaLogView; -import LogView from "./log/logView"; +import LogView from "./log/LogView"; import {LogViewStore} from "../stores/logview" diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index f5ab0f4..1c3705c 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -65,7 +65,7 @@ export default class NewAndEditDialog extends React.Component { if(moduleName == 'department' && data.parent_comp ){ bindChangeEnvent(data.parent_comp.value); } - if(moduleName == 'job' && (data.sequence_id)){ + if(moduleName == 'job' && (data.sequence_id || data.level_id)){ bindChangeEnvent(data); } }; diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 002cbfa..6d14e3c 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-06-24 16:47:53 + * @LastEditTime: 2022-07-06 10:48:30 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -104,6 +104,14 @@ export default class Company extends React.Component { return btns; } + + log = () => { + window.setLogViewProp({ + logMoudleType: 8, + keys: new Date().getTime(), + }); + } + handleClick(item) { const { company diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index fe39a14..dd66750 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-06-24 13:46:13 + * @LastEditTime: 2022-07-06 10:48:46 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -225,6 +225,14 @@ }) return arr; } + + + log = () => { + window.setLogViewProp({ + logMoudleType: 9, + keys: new Date().getTime(), + }); + } batchDelete() { const { diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 01671ac..0f78484 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-27 11:23:42 + * @LastEditTime: 2022-07-06 10:49:02 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -524,6 +524,14 @@ export default class Job extends React.Component { } + log = () => { + window.setLogViewProp({ + logMoudleType: 10, + keys: new Date().getTime(), + }); + } + + render() { diff --git a/pc4mobx/organization/components/log/LogView.js b/pc4mobx/organization/components/log/LogView.js index 5c58323..2487d5e 100644 --- a/pc4mobx/organization/components/log/LogView.js +++ b/pc4mobx/organization/components/log/LogView.js @@ -9,7 +9,8 @@ import { WeaTab, WeaFormItem, WeaDialog, - WeaSearchGroup + WeaSearchGroup, + WeaProgress } from 'ecCom' import { Row, @@ -39,9 +40,14 @@ export default class LogView extends React.Component { constructor(props) { super(props); this.state = ({ - height: 402, + height: 502, width: 1075, dialogTitle: '日志查看', + showSearchAd: false, + //**** */ + detailDialogTitle: "", + detailVisible: false, + record:{} }) } @@ -54,11 +60,31 @@ export default class LogView extends React.Component { } componentWillReceiveProps(nextProps) { + this.setState({ showSearchAd: false }) if (this.props.keys !== nextProps.keys) { nextProps.logViewStore.init(nextProps.logMoudleType); } } + doView(record) { + this.setState({ + record:record, + detailVisible: true, + detailDialogTitle: record.operate_typespan + " - " + record.operate_module_name + " : "+record.value + }) + } + + reRenderColumns(columns) { + let _this = this; + columns.forEach((c, index) => { + if (c.dataIndex == 'message') { + c.render = function (text, record) { + return { _this.doView(record) }}>查看 + } + }; + }) + } + getPanelComponents() { const { logViewStore @@ -89,7 +115,6 @@ export default class LogView extends React.Component { ) }) }) - if (searchConditionLoading) { return (
@@ -100,7 +125,7 @@ export default class LogView extends React.Component { return { if (e.keyCode == 13 && e.target.tagName === "INPUT") { logViewStore.getTableInfo(); - logViewStore.setPanelStatus(false) + this.setState({ showSearchAd: false }) } }}>{arr} } @@ -116,9 +141,9 @@ export default class LogView extends React.Component { } = logViewStore; const btn = [ - (), + (), (), - (), + (), ]; return btn; @@ -130,38 +155,58 @@ export default class LogView extends React.Component { const { visible, onCancel, logViewStore } = this.props, { - tableStore,isPanelShow,conditionNum + tableStore, conditionNum } = logViewStore, { - height, dialogTitle, width, + height, dialogTitle, width, showSearchAd, detailDialogTitle, detailVisible,record } = this.state; - return ( - onCancel()} - style={{ height: height, width: width }} - > - logViewStore.setPanelStatus(bool)} - hideSearchAd={() => logViewStore.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => logViewStore.getTableInfo()} - /> - -
) +
+ onCancel()} + style={{ height: height, width: width }} + > + { this.setState({ showSearchAd: bool }) }} + advanceHeight={161} + searchsAd={showSearchAd ? this.getPanelComponents() :
} + buttonsAd={this.getTabBtn()} + /> + this.reRenderColumns(c)} + /> +
+ this.setState({ + detailVisible: false + })} + style={{ height: 676, width: 1000 }} + > +
+
+ {/* */} +
原始参数查看
+
+
+ +
+
+ ) } } \ No newline at end of file diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 48df78f..d228ae6 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -58,6 +58,13 @@ export default class OfficeManage extends Component { return menus; }; + showlog = () => { + window.setLogViewProp({ + logMoudleType: 6, + keys: new Date().getTime(), + }); + } + handleMenuClick = key => { const { officeManageStore } = this.props; const { isPanelShow, tableStore } = officeManageStore; @@ -68,6 +75,9 @@ export default class OfficeManage extends Component { officeManageStore.setVisible(true); officeManageStore.setNeDialogTitle(i18n.label.newOfficeName()); break; + case "log": + this.showlog(); + break; case "custom": tableStore.setColSetVisible(true); tableStore.tableColSet(true); @@ -235,7 +245,7 @@ export default class OfficeManage extends Component { let _this = this; columns.forEach((c, index) => { if (c.dataIndex == "forbidden_tag") { - c.render = function(text, record) { + c.render = function (text, record) { return ( { + window.setLogViewProp({ + logMoudleType: 3, + keys: new Date().getTime(), + }); + } + getPanelComponents() { const { jobGrade diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index a8959f0..0b1a491 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -361,6 +361,12 @@ export default class JobLevel extends React.Component { } + log = () => { + window.setLogViewProp({ + logMoudleType: 2, + keys: new Date().getTime(), + }); + } render() { diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 4008a37..24883d9 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -287,6 +287,14 @@ export default class RankScheme extends React.Component { } + log = () => { + window.setLogViewProp({ + logMoudleType: 1, + keys: new Date().getTime(), + }); + } + + handleSave() { const { rankScheme diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 8b8fe2a..2914f81 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -163,6 +163,14 @@ export default class Resource extends React.Component { this[item.menuFun] && this[item.menuFun](); } + + log = () => { + window.setLogViewProp({ + logMoudleType: 11, + keys: new Date().getTime(), + }); + } + new() { const { resource diff --git a/pc4mobx/organization/components/sequence/Sequence.js b/pc4mobx/organization/components/sequence/Sequence.js index 75ec848..c5f85ee 100644 --- a/pc4mobx/organization/components/sequence/Sequence.js +++ b/pc4mobx/organization/components/sequence/Sequence.js @@ -362,6 +362,12 @@ export default class Sequence extends React.Component { + log = () => { + window.setLogViewProp({ + logMoudleType: 4, + keys: new Date().getTime(), + }); + } render() { diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 8c5ab4f..555ed9c 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -118,6 +118,14 @@ export default class Staff extends React.Component { staff.getForm(); } + + log = () => { + window.setLogViewProp({ + logMoudleType: 13, + keys: new Date().getTime(), + }); + } + batchDelete() { const { staff diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index c527d33..c6795c6 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -267,7 +267,7 @@ export default class StaffScheme extends React.Component { log = () => { window.setLogViewProp({ - logMoudleType: '0', + logMoudleType: 12, keys: new Date().getTime(), }); } diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index fc23b6d..d3e0666 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -63,7 +63,8 @@ export class JobStore { @observable defaultShowLeft = true; @observable companysId = 1 @observable hasRight = ''; - + @observable key = ''; + @observable key1 = ''; @observable selectTreeNodeInfo; saveAndSetting = false; @@ -304,10 +305,96 @@ export class JobStore { } updateConditions(data) { - const label = "等级方案" - const index = findIndex(this.condition[0].items, { label }); - this.condition[0].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: data.sequence_id.valueObj[0].scheme_values }]; - this.setCondition(this.condition,false); + if (data.sequence_id) { + let label = "等级方案" + const index = findIndex(this.condition[1].items, { label }); + const schemeId = data.sequence_id.valueObj[0].scheme_values; + this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; + //清空职等并限制范围 + label = "职等" + const index1 = findIndex(this.condition[1].items, { label }); + let currenttime = Date.now(); + let key = `scheme_id_${currenttime}`; + const lastKey = this.key; + this.setKey(key); + + Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.completeParams, lastKey); + Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.conditionDataParams, lastKey); + Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.dataParams, lastKey); + Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.destDataParams, lastKey); + + this.condition[1].items[index1].browserConditionParam.completeParams = { + [key]: schemeId, + ...this.condition[1].items[index1].browserConditionParam.completeParams, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.conditionDataParams = { + [key]: schemeId, + ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.dataParams = { + [key]: schemeId, + ...this.condition[1].items[index1].browserConditionParam.dataParams, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.destDataParams = { + [key]: schemeId, + ...this.condition[1].items[index1].browserConditionParam.destDataParams, + currenttime: currenttime + } + + this.form.updateFields({ + levelId: { + value: '' + }, + grade_id: { + value: '' + } + }); + } else { + + //清空职级并限制范围 + let label = "职级" + const index2 = findIndex(this.condition[1].items, { label }); + let currenttime = Date.now(); + let key1 = `level_id_${currenttime}`; + const lastKey = this.key1; + this.key1 = key1; + const levelId = data.level_id.value; + Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.completeParams, lastKey); + Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.conditionDataParams, lastKey); + Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.dataParams, lastKey); + Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.destDataParams, lastKey); + + this.condition[1].items[index2].browserConditionParam.completeParams = { + [key1]: levelId, + ...this.condition[1].items[index2].browserConditionParam.completeParams, + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.conditionDataParams = { + [key1]: levelId, + ...this.condition[1].items[index2].browserConditionParam.conditionDataParams, + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.dataParams = { + [key1]: levelId, + ...this.condition[1].items[index2].browserConditionParam.dataParams, + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.destDataParams = { + [key]: levelId, + ...this.condition[1].items[index2].browserConditionParam.destDataParams, + currenttime: currenttime + } + + this.form.updateFields({ + grade_id: { + value: '' + } + }); + } + this.setCondition(this.condition, false); this.form1.initFormFields(this.condition); } @@ -478,4 +565,8 @@ export class JobStore { this.mergeCondition = mergeCondition; } + setKey(key) { + this.key = key; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/logview.js b/pc4mobx/organization/stores/logview.js index 88cef75..6e229a9 100644 --- a/pc4mobx/organization/stores/logview.js +++ b/pc4mobx/organization/stores/logview.js @@ -26,14 +26,13 @@ const { export class LogViewStore { @observable tableStore = new TableStore(); @observable searchCondition = []; - @observable isPanelShow = false; //高级搜索面板 @observable form = new WeaForm(); @observable conditionNum = 20; - @observable searchConditionLoading = true; + @observable searchConditionLoading = false; @observable visible = false; @observable dialogLoading = false; @observable moduleType = ""; //模块类型 - + init(logMoudleType) { this.setModuleType(logMoudleType); this.getTableInfo(); @@ -43,9 +42,9 @@ export class LogViewStore { @action getTableInfo() { let params = { ...this.form.getFormParams(), - moduleType:this.moduleType + moduleType: this.moduleType } - this.tableStore = new TableStore(); + this.tableStore = new TableStore(); Api.getLogList(params).then(res => { if (res.code === 200) { res.data.datas && this.tableStore.getDatas(res.data.datas, 1); @@ -58,12 +57,11 @@ export class LogViewStore { } - @action getSearchCondition() { - this.setDialogLoading(true); + this.setSearchConditionLoading(true); Api.getAdvanceSearchCondition().then(res => { if (res.code === 200) { - this.setDialogLoading(false); + this.setSearchConditionLoading(false); res.data.conditions && this.setSearchCondition(res.data.conditions); res.data.conditions && this.form.initFormFields(res.data.conditions); } else { @@ -75,18 +73,11 @@ export class LogViewStore { } - + setDialogLoading(bool) { this.dialogLoading = bool; } - setPanelStatus(bool) { - this.isPanelShow = bool; - bool && this.getSearchCondition(); - if (!bool) { - this.scLoadingReset(); - } - } isEmptyObject(obj) { for (let key in obj) { @@ -99,6 +90,10 @@ export class LogViewStore { this.searchCondition = searchCondition; } + setSearchConditionLoading(bool) { + this.searchConditionLoading = bool; + } + scLoadingReset() { this.searchConditionLoading = true; } From 6e152af3a25b166ba80f4a76452ef6b5ef0dadec Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Thu, 7 Jul 2022 18:49:54 +0800 Subject: [PATCH 040/155] =?UTF-8?q?=E8=81=8C=E5=8A=A1=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=92=8C=E7=BC=96=E8=BE=91=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/office/components/leftTree.js | 20 ++-- .../components/office/officeManage.js | 109 +++++++++--------- 2 files changed, 66 insertions(+), 63 deletions(-) diff --git a/pc4mobx/organization/components/office/components/leftTree.js b/pc4mobx/organization/components/office/components/leftTree.js index d84ffc5..3559189 100644 --- a/pc4mobx/organization/components/office/components/leftTree.js +++ b/pc4mobx/organization/components/office/components/leftTree.js @@ -1,11 +1,10 @@ import React, { Component } from "react"; -import { Input, Tree, Menu, message, Modal } from "antd"; +import { Menu, message, Modal, Tree } from "antd"; import { WeaInputSearch } from "ecCom"; import { i18n } from "../../../public/i18n"; import NewAndEditDialog from "../../NewAndEditDialog"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import _ from "lodash"; import "../index.less"; const confirm = Modal.confirm; @@ -26,10 +25,12 @@ class LeftTree extends Component { rightClickNodeTreeItem: null }; } + componentDidMount() { this.getTreeData(); document.addEventListener("click", this.handleClick); } + componentWillUnmount() { document.removeEventListener("click", this.handleClick); } @@ -71,9 +72,11 @@ class LeftTree extends Component { officeManageStore.setOfficeClassifyId( !postId ? officeManageStore.officeClassifyId - : postId != "-1" ? postId : "" + : postId !== "-1" ? postId : "" ); - officeManageStore.getPostInfoTable(postId); + officeManageStore.getPostInfoTable(!postId + ? officeManageStore.officeClassifyId + : postId !== "-1" ? postId : ""); this.setState({ rightClickNodeTreeItem: null }); @@ -234,10 +237,10 @@ class LeftTree extends Component { index > -1 ? {beforeStr} - + {searchValue} - {afterStr} + {afterStr} : {item.title} @@ -249,7 +252,7 @@ class LeftTree extends Component { ); } - return ; + return ; }); }; @@ -341,7 +344,7 @@ class LeftTree extends Component { {this.getNodeTreeRightClickMenu()} { const { officeManageStore } = this.props; const { rightMenu } = officeManageStore; @@ -43,7 +39,7 @@ export default class OfficeManage extends Component { toJS(rightMenu).map((item, index) => { let obj = { key: item.menuFun, - icon: , + icon: , content: item.menuName }; if ( @@ -97,9 +93,10 @@ export default class OfficeManage extends Component { this.setState({ loading: false }); if (code === 200) { message.success("编辑成功"); - this.props.officeManageStore.setVisible(false); - this.props.officeManageStore.getPostInfoTable(); - this.setState({ editId: "" }); + this.setState({ editId: "" }, () => { + this.props.officeManageStore.setVisible(false); + this.props.officeManageStore.getPostInfoTable(this.props.officeManageStore.officeClassifyId); + }); } else { message.error(msg || "编辑失败"); } @@ -110,9 +107,10 @@ export default class OfficeManage extends Component { this.setState({ loading: false }); if (code === 200) { message.success("新增成功"); - this.props.officeManageStore.setVisible(false); - this.props.officeManageStore.getPostInfoTable(); - this.setState({ editId: "" }); + this.setState({ editId: "" }, () => { + this.props.officeManageStore.setVisible(false); + this.props.officeManageStore.getPostInfoTable(this.props.officeManageStore.officeClassifyId); + }); } else { message.error(msg || "新增失败"); } @@ -123,6 +121,7 @@ export default class OfficeManage extends Component { } }); } + getTopMenuBtns = () => { const { officeManageStore } = this.props; const { topMenu, tableStore, officeClassifyId } = officeManageStore; @@ -137,7 +136,7 @@ export default class OfficeManage extends Component { const { officeManageStore } = this.props; if (item.menuFun == "new") { officeManageStore.isPanelShow && - officeManageStore.setPanelStatus(false); + officeManageStore.setPanelStatus(false); officeManageStore.getPostInfoForm(); officeManageStore.setVisible(true); officeManageStore.setNeDialogTitle(i18n.label.newOfficeName()); @@ -235,7 +234,7 @@ export default class OfficeManage extends Component { let _this = this; columns.forEach((c, index) => { if (c.dataIndex == "forbidden_tag") { - c.render = function(text, record) { + c.render = function (text, record) { return ( { - c.items.map((field, index) => { - arr.push( -
-
- - { - - } - -
- - ); - }); + searchCondition.map(c => { + c.items.map((field, index) => { + arr.push( +
+
+ + { + + } + +
+ + ); }); + }); if (searchConditionLoading) { return (
@@ -418,19 +417,19 @@ export default class OfficeManage extends Component { isNew={true} leftWidth={310} leftCom={ - + } onCollapse={showLeft => console.log("showLeft:", showLeft)}> this.handleMenuClick(key)}> } + icon={} iconBgcolor="#217346" loading={true} buttons={this.getTopMenuBtns()} @@ -439,7 +438,7 @@ export default class OfficeManage extends Component { onDropMenuClick={e => this.handleMenuClick(e)}> officeManageStore.setPanelStatus(bool)} hideSearchAd={() => officeManageStore.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} + searchsAd={isPanelShow ? this.getPanelComponents() :
} advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hasMask={false} buttonsAd={this.getTabBtn()} @@ -458,7 +457,7 @@ export default class OfficeManage extends Component { /> Date: Fri, 8 Jul 2022 10:25:32 +0800 Subject: [PATCH 041/155] =?UTF-8?q?=E8=81=8C=E5=8A=A1=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=92=8C=E7=BC=96=E8=BE=91=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?bug,=E4=BB=A5=E5=8F=8A=E6=96=B0=E5=A2=9E=E6=97=B6=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=8E=A5=E5=8F=A3=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/office/components/leftTree.js | 13 +++++-------- .../components/office/officeManage.js | 12 ++++++------ pc4mobx/organization/stores/officeManage.js | 18 ++++++++---------- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/pc4mobx/organization/components/office/components/leftTree.js b/pc4mobx/organization/components/office/components/leftTree.js index 3559189..bb12530 100644 --- a/pc4mobx/organization/components/office/components/leftTree.js +++ b/pc4mobx/organization/components/office/components/leftTree.js @@ -67,16 +67,13 @@ class LeftTree extends Component { this.setState({ rightClickNodeTreeItem: null }); }; onSelect = node => { - const [postId] = node; const { officeManageStore } = this.props; - officeManageStore.setOfficeClassifyId( - !postId - ? officeManageStore.officeClassifyId - : postId !== "-1" ? postId : "" - ); - officeManageStore.getPostInfoTable(!postId + const [postId] = node; + const officeId = !postId ? officeManageStore.officeClassifyId - : postId !== "-1" ? postId : ""); + : postId !== "-1" ? postId : ""; + officeManageStore.setOfficeClassifyId(officeId); + officeManageStore.getPostInfoTable(officeId); this.setState({ rightClickNodeTreeItem: null }); diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index e3f0706..0266e9a 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -56,11 +56,11 @@ export default class OfficeManage extends Component { handleMenuClick = key => { const { officeManageStore } = this.props; - const { isPanelShow, tableStore } = officeManageStore; + const { isPanelShow, tableStore, officeClassifyId } = officeManageStore; isPanelShow && officeManageStore.setPanelStatus(false); switch (key) { case "new": - officeManageStore.getPostInfoForm(); + officeManageStore.getPostInfoForm({ planId: officeClassifyId }); officeManageStore.setVisible(true); officeManageStore.setNeDialogTitle(i18n.label.newOfficeName()); break; @@ -137,7 +137,7 @@ export default class OfficeManage extends Component { if (item.menuFun == "new") { officeManageStore.isPanelShow && officeManageStore.setPanelStatus(false); - officeManageStore.getPostInfoForm(); + officeManageStore.getPostInfoForm({ planId: officeClassifyId }); officeManageStore.setVisible(true); officeManageStore.setNeDialogTitle(i18n.label.newOfficeName()); } else if ( @@ -223,7 +223,7 @@ export default class OfficeManage extends Component { deletePostinfoByIds({ ids }).then(({ code, msg }) => { if (code === 200) { message.success("删除成功"); - officeManageStore.getPostInfoTable(); + officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId); } else { message.error(msg || "删除失败"); } @@ -268,7 +268,7 @@ export default class OfficeManage extends Component { updateForbiddenTagById(payload).then(({ code, msg }) => { if (code === 200) { message.success("操作成功"); - officeManageStore.getPostInfoTable(); + officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId); } else { message.error(msg || "操作失败"); } @@ -283,7 +283,7 @@ export default class OfficeManage extends Component { this.setState({ editId }); const { officeManageStore } = this.props; officeManageStore.isPanelShow && officeManageStore.setPanelStatus(false); - officeManageStore.getPostInfoForm(editId); + officeManageStore.getPostInfoForm({ id: editId }); officeManageStore.setVisible(true); officeManageStore.setNeDialogTitle(i18n.label.editOfficeName()); }; diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js index c848b9a..87c5cd3 100644 --- a/pc4mobx/organization/stores/officeManage.js +++ b/pc4mobx/organization/stores/officeManage.js @@ -1,8 +1,6 @@ -import { observable, action, toJS } from "mobx"; -import { WeaForm } from "comsMobx"; -import { WeaTableNew } from "comsMobx"; -import { Modal, message } from "antd"; -import { i18n } from "../public/i18n"; +import { action, observable } from "mobx"; +import { WeaForm, WeaTableNew } from "comsMobx"; +import { message } from "antd"; import * as API from "../apis/officeManage"; import _ from "lodash"; @@ -69,13 +67,12 @@ export class OfficeManageStore { } @action("获取新增/编辑表单") - getPostInfoForm(id) { + getPostInfoForm(params) { this.setDialogLoadingStatus(true); - API.getPostInfoForm({ id }).then(res => { + API.getPostInfoForm(params).then(res => { this.setDialogLoadingStatus(false); const { code, data, msg } = res; if (code === 200) { - console.log(); data.condition && this.setCondition(data.condition); data.condition && this.form.initFormFields(data.condition); } else { @@ -83,6 +80,7 @@ export class OfficeManageStore { } }); } + @action("获取表格数据") getPostInfoTable(postId) { let params; @@ -95,8 +93,8 @@ export class OfficeManageStore { }; } else { params = { - postId, - ...this.form2.getFormParams() + ...this.form2.getFormParams(), + postId }; } API.getPostInfoTable(params).then(res => { From db5101250e07795a0929cc08f3d0fb78f90103a4 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 8 Jul 2022 13:31:40 +0800 Subject: [PATCH 042/155] fixed --- pc4mobx/organization/stores/job.js | 12 +++++------ pc4mobx/organization/stores/jobgrade.js | 27 +++++++++++++++---------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index d3e0666..361250f 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -310,8 +310,8 @@ export class JobStore { const index = findIndex(this.condition[1].items, { label }); const schemeId = data.sequence_id.valueObj[0].scheme_values; this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; - //清空职等并限制范围 - label = "职等" + //清空职级并限制范围 + label = "职级" const index1 = findIndex(this.condition[1].items, { label }); let currenttime = Date.now(); let key = `scheme_id_${currenttime}`; @@ -354,14 +354,14 @@ export class JobStore { }); } else { - //清空职级并限制范围 - let label = "职级" + //清空职等并限制范围 + let label = "职等" const index2 = findIndex(this.condition[1].items, { label }); let currenttime = Date.now(); - let key1 = `level_id_${currenttime}`; + let key1 = `id_${currenttime}`; const lastKey = this.key1; this.key1 = key1; - const levelId = data.level_id.value; + const levelId = '11,12'; Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.completeParams, lastKey); Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.conditionDataParams, lastKey); Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.dataParams, lastKey); diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 9e098c8..83141e5 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -277,33 +277,38 @@ export class JobGradeStore { } updateConditions(val) { - let currenttime = Date.now(); + let currenttime = 1657247378274; let key = `scheme_id_${currenttime}`; - const lastKey = this.key; - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.completeParams, lastKey); - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.conditionDataParams, lastKey); - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams, lastKey); - Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.destDataParams, lastKey); - this.setKey(key); + let id_key = `level_id_${currenttime}` + // const lastKey = this.key; + // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.completeParams, lastKey); + // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.conditionDataParams, lastKey); + // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams, lastKey); + // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.destDataParams, lastKey); + // this.setKey(key); this.condition[0].items[4].browserConditionParam.completeParams = { [key]: val, ...this.condition[0].items[4].browserConditionParam.completeParams, - currenttime: currenttime + currenttime: currenttime, + [id_key]:"''" } this.condition[0].items[4].browserConditionParam.conditionDataParams = { [key]: val, ...this.condition[0].items[4].browserConditionParam.conditionDataParams, - currenttime: currenttime + currenttime: currenttime, + [id_key]:"''" } this.condition[0].items[4].browserConditionParam.dataParams = { [key]: val, ...this.condition[0].items[4].browserConditionParam.dataParams, - currenttime: currenttime + currenttime: currenttime, + [id_key]:"''" } this.condition[0].items[4].browserConditionParam.destDataParams = { [key]: val, ...this.condition[0].items[4].browserConditionParam.destDataParams, - currenttime: currenttime + currenttime: currenttime, + [id_key]:"''" } this.form.updateFields({ From 39e60335ec9051d1752ff03baf8b3b893c4bb3d2 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 11 Jul 2022 10:06:45 +0800 Subject: [PATCH 043/155] =?UTF-8?q?=E9=9C=80=E6=B1=82=E4=BC=98=E5=8C=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/components/Home.js | 2 +- .../components/NewAndEditDialog.js | 18 +- .../components/department/department.js | 1239 +++++++++-------- 3 files changed, 631 insertions(+), 628 deletions(-) diff --git a/pc4mobx/organization/components/Home.js b/pc4mobx/organization/components/Home.js index 5cc0369..9e68164 100644 --- a/pc4mobx/organization/components/Home.js +++ b/pc4mobx/organization/components/Home.js @@ -65,7 +65,7 @@ class Home extends React.Component { //const isSingle = window.location.pathname.indexOf('/spa/hrm/engine') > -1; return (
- + {/* */} diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 1c3705c..6e65d79 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -4,6 +4,7 @@ import { WeaNewScroll, WeaSearchGroup, WeaMoreButton, + WeaPopoverHrm } from 'ecCom' import { @@ -26,7 +27,7 @@ export default class NewAndEditDialog extends React.Component { width: 700, } } - + getForm() { const { @@ -56,16 +57,16 @@ export default class NewAndEditDialog extends React.Component { bindChangeEnvent, moduleName } = this.props; - if(moduleName == 'jobGrade' && data.schemeId) { + if (moduleName == 'jobGrade' && data.schemeId) { bindChangeEnvent(data.schemeId.value); } - if(moduleName == 'staffScheme' && data.planYear){ + if (moduleName == 'staffScheme' && data.planYear) { bindChangeEnvent(data.planYear.value); } - if(moduleName == 'department' && data.parent_comp ){ + if (moduleName == 'department' && data.parent_comp) { bindChangeEnvent(data.parent_comp.value); } - if(moduleName == 'job' && (data.sequence_id || data.level_id)){ + if (moduleName == 'job' && (data.sequence_id || data.level_id)) { bindChangeEnvent(data); } }; @@ -149,10 +150,9 @@ export default class NewAndEditDialog extends React.Component { loading ?
- :
1 ? '' : 'hrm-dialog-form'}> - {conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()} -
- } + : this.getSearchGroupForm()} + + ) } diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index dd66750..df668ac 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,151 +1,153 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-07-06 10:48:46 + * @LastEditTime: 2022-07-08 16:50:58 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ - import React from 'react' - import * as mobx from 'mobx' - import { - inject, - observer, - } from 'mobx-react' - import { - WeaTop, - WeaTab, - WeaFormItem, - WeaRightMenu, - WeaTable, - WeaLeftRightLayout, - WeaOrgTree - } from 'ecCom' - import { - Row, - Col, - Spin, - Modal, - Button, - message, - Switch, - Menu, Dropdown, Icon - } from 'antd' - import { - WeaSwitch, - WeaTableNew - } from 'comsMobx' - import { - i18n - } from '../../public/i18n'; - - import '../../style/common.less'; - import { renderNoright } from '../../util'; - - import NewAndEditDialog from '../NewAndEditDialog'; - import NewTableDialog from '../NewTableDialog'; - import NewPopconfirm from './NewPopconfirm' - - const toJS = mobx.toJS; - const confirm = Modal.confirm; - - - @inject('department') - @observer - export default class Department extends React.Component { - constructor(props) { - super(props); - } - - componentWillMount() { - } - - componentDidMount() { - this.init(); - } - - componentWillReceiveProps(nextProps) { - const { - department - } = this.props; - - if (this.props.location.key !== nextProps.location.key) { - this.init(); - } - } - - init() { - const { - department - } = this.props; - department.getTableInfo(); - department.getHasRight(); - department.getCopyForm(); - } - - getTopMenuBtns() { - const { - department - } = this.props; - const { - topMenu, - selectedRowKeys - } = department; - - let btns = []; - topMenu.map((item, i) => { - if (item.menuFun === 'batchDelete') { - btns.push(); - } else if (item.menuFun === 'copy') { - btns.push(); - } else { - btns.push(); - - } - - }); - - return btns; - } - - handleClick(item) { - const { - department - } = this.props; - const { - isPanelShow - } = department; - - isPanelShow && department.setPanelStatus(false); - this[item.menuFun] && this[item.menuFun](); - } - - new() { - const { - department - } = this.props; - - department.setNeDialogTitle(i18n.label.newDept()); - department.setNewVisible(true); - department.getDeptForm(); - - } - - //联查岗位 - select(id) { - const { - department - } = this.props; - - department.setNeDialogTitle("联查岗位"); - department.setVisible(true); - department.setDialogLoadingStatus(true); - department.getPostionTable(id); - } +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, + WeaTable, + WeaLeftRightLayout, + WeaOrgTree, + WeaDialog, + WeaPopoverHrm +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch, + Menu, Dropdown, Icon +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; +import { renderNoright } from '../../util'; + +import NewAndEditDialog from '../NewAndEditDialog'; +import NewTableDialog from '../NewTableDialog'; +import NewPopconfirm from './NewPopconfirm' + +const toJS = mobx.toJS; +const confirm = Modal.confirm; - //合并 - merge(id){ +@inject('department') +@observer +export default class Department extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + const { + department + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + department + } = this.props; + department.getTableInfo(); + department.getHasRight(); + department.getCopyForm(); + } + + getTopMenuBtns() { + const { + department + } = this.props; + const { + topMenu, + selectedRowKeys + } = department; + + let btns = []; + topMenu.map((item, i) => { + if (item.menuFun === 'batchDelete') { + btns.push(); + } else if (item.menuFun === 'copy') { + btns.push(); + } else { + btns.push(); + + } + + }); + + return btns; + } + + handleClick(item) { + const { + department + } = this.props; + const { + isPanelShow + } = department; + + isPanelShow && department.setPanelStatus(false); + this[item.menuFun] && this[item.menuFun](); + } + + new() { + const { + department + } = this.props; + + department.setNeDialogTitle(i18n.label.newDept()); + department.setNewVisible(true); + department.getDeptForm(); + + } + + //联查岗位 + select(id) { + const { + department + } = this.props; + + department.setNeDialogTitle("联查岗位"); + department.setVisible(true); + department.setDialogLoadingStatus(true); + department.getPostionTable(id); + } + + + //合并 + merge(id) { const { department } = this.props; @@ -155,10 +157,10 @@ department.setIds(id); department.setIsMerge(true); department.getMergeForm(id); - } + } - //转移 - transfer(id) { + //转移 + transfer(id) { const { department } = this.props; @@ -168,63 +170,63 @@ department.setIsMerge(false); department.getTransferForm(id); - } + } - //查看 - view(id) { + //查看 + view(id) { window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${id}`, "_blank") } - - copy() { - const { - department - } = this.props; - const { - selectedRowKeys - } = department; - let keys = toJS(selectedRowKeys).toString(); - department.setIds(keys); - confirm({ - title: i18n.confirm.defaultTitle(), - content: this.getCopyForm(), - okText: i18n.button.ok(), - cancelText: i18n.button.cancel(), - onOk() { - department.copy() - }, - onCancel() { - return false; - }, - }); - } - - getCopyForm() { - const { - department - } = this.props; - const { - copyCondition, - form2, - } = department; - let formParams = form2.getFormParams(); - const { - isFormInit - } = form2; - let arr = []; - isFormInit && copyCondition.map(c => { - c.items.map((field, index) => { - arr.push( - - {} - - ) - }) - }) - return arr; - } + + copy() { + const { + department + } = this.props; + const { + selectedRowKeys + } = department; + let keys = toJS(selectedRowKeys).toString(); + department.setIds(keys); + confirm({ + title: i18n.confirm.defaultTitle(), + content: this.getCopyForm(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + department.copy() + }, + onCancel() { + return false; + }, + }); + } + + getCopyForm() { + const { + department + } = this.props; + const { + copyCondition, + form2, + } = department; + let formParams = form2.getFormParams(); + const { + isFormInit + } = form2; + let arr = []; + isFormInit && copyCondition.map(c => { + c.items.map((field, index) => { + arr.push( + + {} + + ) + }) + }) + return arr; + } log = () => { @@ -233,81 +235,81 @@ keys: new Date().getTime(), }); } - - batchDelete() { - const { - department - } = this.props; - const { - selectedRowKeys - } = department; - let keys = toJS(selectedRowKeys).toString(); - department.setIds(keys); - this.showConfirm('batchDel'); - } - showConfirm(v) { - let _this = this; - confirm({ - title: i18n.confirm.defaultTitle(), - content: (v == 'del') ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(), - okText: i18n.button.ok(), - cancelText: i18n.button.cancel(), - onOk() { - _this.onOk(); - }, - onCancel() { - return false; - }, - }); - } - onOk() { - const { - department - } = this.props; - department.delete(); - } - - - getDropMenuDatas() { - const { - department - } = this.props; - const { - rightMenu - } = department; - - let menus = []; - toJS(rightMenu).map((item, index) => { - let obj = { - key: item.menuFun, - icon: , - content: item.menuName, - } - if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { - obj.disabled = true; - } - menus.push(obj); - }) - return menus; - } - - handleMenuClick(key) { - const { - department - } = this.props; - const { - isPanelShow - } = department; - - isPanelShow && department.setPanelStatus(false); - this[key] && this[key](); - } - - updateForbiddenTag(checked, id) { - const { - department - } = this.props; - confirm({ + + batchDelete() { + const { + department + } = this.props; + const { + selectedRowKeys + } = department; + let keys = toJS(selectedRowKeys).toString(); + department.setIds(keys); + this.showConfirm('batchDel'); + } + showConfirm(v) { + let _this = this; + confirm({ + title: i18n.confirm.defaultTitle(), + content: (v == 'del') ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + _this.onOk(); + }, + onCancel() { + return false; + }, + }); + } + onOk() { + const { + department + } = this.props; + department.delete(); + } + + + getDropMenuDatas() { + const { + department + } = this.props; + const { + rightMenu + } = department; + + let menus = []; + toJS(rightMenu).map((item, index) => { + let obj = { + key: item.menuFun, + icon: , + content: item.menuName, + } + if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { + obj.disabled = true; + } + menus.push(obj); + }) + return menus; + } + + handleMenuClick(key) { + const { + department + } = this.props; + const { + isPanelShow + } = department; + + isPanelShow && department.setPanelStatus(false); + this[key] && this[key](); + } + + updateForbiddenTag(checked, id) { + const { + department + } = this.props; + confirm({ title: i18n.confirm.defaultTitle(), content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), okText: i18n.button.ok(), @@ -319,340 +321,340 @@ return false; }, }); - } - - - - onSearchChange(val) { - const { - department - } = this.props; - const { - form - } = department; - - department.setDepartmentName(val); - !this.isEmptyObject(form.getFormParams()) && department.updateFields(val); - } - - - reRenderColumns(columns) { - const { - department - } = this.props; - let _this = this; - columns.forEach((c, index) => { - if (c.dataIndex == 'forbiddenTag') { - c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> - } - }; - if (c.dataIndex == 'deptName') { - c.render = function (text, record) { - return { - window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${record.id}`, "_blank") - }}>{text} - } - } - if (c.dataIndex == 'operate') { - c.className = "wea-table-operates" - c.width = 80 - c.render = function (text, record) { - const menu = ( - + } + + + + onSearchChange(val) { + const { + department + } = this.props; + const { + form + } = department; + + department.setDepartmentName(val); + !this.isEmptyObject(form.getFormParams()) && department.updateFields(val); + } + + + reRenderColumns(columns) { + const { + department + } = this.props; + let _this = this; + columns.forEach((c, index) => { + if (c.dataIndex == 'forbiddenTag') { + c.render = function (text, record) { + return _this.updateForbiddenTag(checked, record.id)} /> + } + }; + if (c.dataIndex == 'deptName') { + c.render = function (text, record) { + return { + window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${record.id}`, "_blank") + }}>{text} + } + } + if (c.dataIndex == 'operate') { + c.className = "wea-table-operates" + c.width = 80 + c.render = function (text, record) { + const menu = ( + { _this.view(record.id) }}>查看 - + { _this.doDel(record.id) }}>删除 - - { _this.merge(record.id) }}>合并 - - - { _this.transfer(record.id) }}>转移 - - - { _this.select(record.id) }}>联查岗位 - - - ) - return - - - } - } - }) - return columns; - } - - - doDel(id) { - const { - department - } = this.props; - department.setIds(id); - this.showConfirm('del'); - } - - - handleSave() { - const { - department - } = this.props; - department.setSaveAndSetting(false); - department.save(); - } + + { _this.merge(record.id) }}>合并 + + + { _this.transfer(record.id) }}>转移 + + + { _this.select(record.id) }}>联查岗位 + + + ) + return + + + } + } + }) + return columns; + } - handleSaveAndSetting() { + + doDel(id) { + const { + department + } = this.props; + department.setIds(id); + this.showConfirm('del'); + } + + + handleSave() { + const { + department + } = this.props; + department.setSaveAndSetting(false); + department.save(); + } + + handleSaveAndSetting() { const { department } = this.props; department.setSaveAndSetting(true); department.save(); - } + } - PopconfirmSave() { + PopconfirmSave() { const { department } = this.props; - const {isMerge} = department; + const { isMerge } = department; isMerge && department.merge(); !isMerge && department.transfer(); - } - - getTabBtn() { - const { - department - } = this.props; - const { - form - } = department; - - const btn = [ - (), - (), - (), - ]; - - return btn; - } - - getPanelComponents() { - const { - department - } = this.props; - const { - searchCondition, - form, - searchConditionLoading - } = department; - - let arr = []; - let formParams = form.getFormParams(); - const { - isFormInit - } = form; - - isFormInit && searchCondition.map(c => { - c.items.map((field, index) => { - arr.push(
-
- - {} - -
- ) - }) - }) - - if (searchConditionLoading) { - return ( -
- -
- ) - } else { - return { - if (e.keyCode == 13 && e.target.tagName === "INPUT") { - department.getTableInfo(); - department.setPanelStatus(false) - } - }}>{arr} - } - - } - - //非空判断 - isEmptyObject(obj) { - for (let key in obj) { - return false; - } - return true; - } - - //左侧树 - getTree = () => { - const { - department - } = this.props; - const { - companysId, - } = department - - let tree = ( - ${i18n.label.organization()}`} - treeNodeClick={this.treeNodeClick} - expandAllChildrenOnSearch={true} - /> - ) - - return tree; - } - - treeNodeClick = (event, ids, nodeids, nodes) => { - const { - department - } = this.props; - const { - form, - companysId - } = department; - const type = event.node.props.type || '0'; - const id = event.node.props.id || ''; - let params = {}; - form.resetConditionValue(); - department.setPanelStatus(false) - // department.tabkey = 'default_3'; - department.nodeType = type; - if (type == '0') { - params['virtualtype'] = companysId; - } - if (type == '1') { - params['subcompanyid1'] = id; - } - if (type == '2') { - params['departmentid'] = id; - } - department.doSearch(params); - } - - - - render() { - - const { - department - } = this.props; - const { - isPanelShow, departmentName, conditionNum, visible, condition, form, - tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, - form1, isEdit, newVisible, jobDataSource, jobColumns, selectedRowKeys, total, current, pageSize, init, - defaultShowLeft,confirmVisible,confirmLoading,postionDataSource,postionColumns,isMerge,hasRight - } = department; + } - if (hasRight === false) { + getTabBtn() { + const { + department + } = this.props; + const { + form + } = department; + + const btn = [ + (), + (), + (), + ]; + + return btn; + } + + getPanelComponents() { + const { + department + } = this.props; + const { + searchCondition, + form, + searchConditionLoading + } = department; + + let arr = []; + let formParams = form.getFormParams(); + const { + isFormInit + } = form; + + isFormInit && searchCondition.map(c => { + c.items.map((field, index) => { + arr.push(
+
+ + {} + +
+ ) + }) + }) + + if (searchConditionLoading) { + return ( +
+ +
+ ) + } else { + return { + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + department.getTableInfo(); + department.setPanelStatus(false) + } + }}>{arr} + } + + } + + //非空判断 + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + //左侧树 + getTree = () => { + const { + department + } = this.props; + const { + companysId, + } = department + + let tree = ( + ${i18n.label.organization()}`} + treeNodeClick={this.treeNodeClick} + expandAllChildrenOnSearch={true} + /> + ) + + return tree; + } + + treeNodeClick = (event, ids, nodeids, nodes) => { + const { + department + } = this.props; + const { + form, + companysId + } = department; + const type = event.node.props.type || '0'; + const id = event.node.props.id || ''; + let params = {}; + form.resetConditionValue(); + department.setPanelStatus(false) + // department.tabkey = 'default_3'; + department.nodeType = type; + if (type == '0') { + params['virtualtype'] = companysId; + } + if (type == '1') { + params['subcompanyid1'] = id; + } + if (type == '2') { + params['departmentid'] = id; + } + department.doSearch(params); + } + + + + render() { + + const { + department + } = this.props; + const { + isPanelShow, departmentName, conditionNum, visible, condition, form, + tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, + form1, isEdit, newVisible, jobDataSource, jobColumns, selectedRowKeys, total, current, pageSize, init, + defaultShowLeft, confirmVisible, confirmLoading, postionDataSource, postionColumns, isMerge, hasRight + } = department; + + if (hasRight === false) { return renderNoright(); - } - - const rowSelection = { - selectedRowKeys:selectedRowKeys, - type:"checkbox", - onChange(selectedRowKeys, selectedRows) { - department.setSelectedRowKeys(selectedRowKeys); - }, - getCheckboxProps: record => ({ - disabled: record.isUsed === 1, // 配置无法勾选的列 - }), - }; - - const pagination = { - current: current, - pageSize: pageSize, - total: total, - showSizeChanger: true, - showQuickJumper: true, - onShowSizeChange(current, pageSize) { - }, - onChange(current) { - }, - showTotal(total) { - return `共 ${total} 条` - } - }; - - - return ( + } + + const rowSelection = { + selectedRowKeys: selectedRowKeys, + type: "checkbox", + onChange(selectedRowKeys, selectedRows) { + department.setSelectedRowKeys(selectedRowKeys); + }, + getCheckboxProps: record => ({ + disabled: record.isUsed === 1, // 配置无法勾选的列 + }), + }; + + const pagination = { + current: current, + pageSize: pageSize, + total: total, + showSizeChanger: true, + showQuickJumper: true, + onShowSizeChange(current, pageSize) { + }, + onChange(current) { + }, + showTotal(total) { + return `共 ${total} 条` + } + }; + + + return ( hasRight &&
- this.handleMenuClick(key)} - > - } - iconBgcolor='#217346' - loading={true} - buttons={this.getTopMenuBtns()} - showDropIcon={true} - dropMenuDatas={this.getDropMenuDatas()} - onDropMenuClick={(e) => this.handleMenuClick(e)} - > - - department.setPanelStatus(bool)} - hideSearchAd={() => department.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => { - department.setCurrent(1); - department.setPageSize(10); - department.getTableInfo() - }} - onSearchChange={val => this.onSearchChange(val)} - /> - { - init ?
- -
: - record.id} ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`} - loading={loading} - dataSource={dataSource} childrenColumnName="children" - columns={this.reRenderColumns(columns)} - rowSelection={rowSelection} - pagination={pagination} - onChange={(pagination, filters, sorter) => { - department.setSortParams(sorter); - department.setCurrent(pagination.current); - department.setPageSize(pagination.pageSize); - department.getTableInfo(); - }} - indentSize={15} - /> - } -
-
-
- this.handleMenuClick(key)} + > + } + iconBgcolor='#217346' + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={(e) => this.handleMenuClick(e)} + > + + department.setPanelStatus(bool)} + hideSearchAd={() => department.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => { + department.setCurrent(1); + department.setPageSize(10); + department.getTableInfo() + }} + onSearchChange={val => this.onSearchChange(val)} + /> + { + init ?
+ +
: + record.id} ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`} + loading={loading} + dataSource={dataSource} childrenColumnName="children" + columns={this.reRenderColumns(columns)} + rowSelection={rowSelection} + pagination={pagination} + onChange={(pagination, filters, sorter) => { + department.setSortParams(sorter); + department.setCurrent(pagination.current); + department.setPageSize(pagination.pageSize); + department.getTableInfo(); + }} + indentSize={15} + /> + } +
+
+ + department.setVisible(false)} /> - this.handleSave()} - onCancel={() => department.setNewVisible(false)} - saveAndSetting = {() => this.handleSaveAndSetting()} - moduleName={"department"} - bindChangeEnvent={val => department.updateConditions(val)} - /> - this.PopconfirmSave()} - onCancel={() => department.setConfirmVisible(false)} - /> -
- ) - } - } \ No newline at end of file + this.handleSave()} + onCancel={() => department.setNewVisible(false)} + saveAndSetting={() => this.handleSaveAndSetting()} + moduleName={"department"} + bindChangeEnvent={val => department.updateConditions(val)} + > + + this.PopconfirmSave()} + onCancel={() => department.setConfirmVisible(false)} + /> + + ) + } +} \ No newline at end of file From b5d1e00b919403ca291e07e5c9d0f80a92443260 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 12 Jul 2022 16:45:03 +0800 Subject: [PATCH 044/155] =?UTF-8?q?=E6=89=A9=E5=B1=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8F=8A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/hrmInfoExtend.js | 11 ++ pc4mobx/organization/apis/job.js | 4 + pc4mobx/organization/apis/jobgrade.js | 1 + .../components/NewAndEditDialog.js | 2 +- .../organization/components/job/JobExtend.js | 20 +- .../components/resource/HrmInfoExtend.js | 187 ++++++++++++++++++ pc4mobx/organization/index.js | 2 + pc4mobx/organization/public/i18n.js | 2 +- pc4mobx/organization/stores/job.js | 159 +++++++-------- pc4mobx/organization/stores/jobextend.js | 122 ++++++++++-- pc4mobx/organization/stores/jobgrade.js | 33 ++-- pc4mobx/organization/stores/resourceExtend.js | 4 - 12 files changed, 431 insertions(+), 116 deletions(-) create mode 100644 pc4mobx/organization/apis/hrmInfoExtend.js create mode 100644 pc4mobx/organization/components/resource/HrmInfoExtend.js diff --git a/pc4mobx/organization/apis/hrmInfoExtend.js b/pc4mobx/organization/apis/hrmInfoExtend.js new file mode 100644 index 0000000..c2dea13 --- /dev/null +++ b/pc4mobx/organization/apis/hrmInfoExtend.js @@ -0,0 +1,11 @@ +import { + WeaTools +} from 'ecCom'; + +export const editResource = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/updateForm', 'POST', params); +} + +export const getResourceExtendForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getTabForm', 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/apis/job.js b/pc4mobx/organization/apis/job.js index d3fc1ec..694f9f4 100644 --- a/pc4mobx/organization/apis/job.js +++ b/pc4mobx/organization/apis/job.js @@ -87,6 +87,10 @@ export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getHasRight', 'GET', params); } +export const getLevelId = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/grade/getLevelId', 'GET', params); +} + export const getMergeForm = (params = {}) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getMergeForm', 'GET', params); } diff --git a/pc4mobx/organization/apis/jobgrade.js b/pc4mobx/organization/apis/jobgrade.js index 2029137..8109602 100644 --- a/pc4mobx/organization/apis/jobgrade.js +++ b/pc4mobx/organization/apis/jobgrade.js @@ -62,6 +62,7 @@ export const getTabInfo = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/grade/getTabInfo', 'GET', params); } + export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/grade/getHasRight', 'GET', params); } diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 6e65d79..c041255 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -66,7 +66,7 @@ export default class NewAndEditDialog extends React.Component { if (moduleName == 'department' && data.parent_comp) { bindChangeEnvent(data.parent_comp.value); } - if (moduleName == 'job' && (data.sequence_id || data.level_id)) { + if (moduleName == 'job' && (data.sequence_id || data.grade_id)) { bindChangeEnvent(data); } }; diff --git a/pc4mobx/organization/components/job/JobExtend.js b/pc4mobx/organization/components/job/JobExtend.js index 5f900cd..3338e57 100644 --- a/pc4mobx/organization/components/job/JobExtend.js +++ b/pc4mobx/organization/components/job/JobExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:07:12 - * @LastEditTime: 2022-06-22 17:01:11 + * @LastEditTime: 2022-07-12 16:25:58 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js */ @@ -105,12 +105,12 @@ export default class JobExtend extends React.Component { getSearchs = () => { const { jobExtend } = this.props; - let { form, conditions, isEditor } = jobExtend; + let { form, condition, isEditor } = jobExtend; const { isFormInit } = form; let group = []; let tipPosition = 'bottom'; window.e9HideFormFieldKeys = []; - isFormInit && conditions.forEach((c, i) => { + isFormInit && condition.forEach((c, i) => { let items = []; c.items.forEach((field, j) => { if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { @@ -124,7 +124,7 @@ export default class JobExtend extends React.Component { tipPosition={tipPosition} labelCol={{ span: `${field.labelcol}` }} wrapperCol={{ span: `${field.fieldcol}` }}> - + ), colSpan: 1 }); @@ -136,6 +136,14 @@ export default class JobExtend extends React.Component { return group; } + onChange = (data) => { + const { jobExtend } = this.props; + if (data.sequence_id || data.grade_id) { + jobExtend.updateConditions(data); + } + } + + tableEditChange = (data) => { const { jobExtend } = this.props; let { detailSelectedKey = '0', tableInfo } = jobExtend; @@ -228,7 +236,7 @@ export default class JobExtend extends React.Component { render() { const { jobExtend } = this.props; - const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor } = jobExtend; + const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor } = jobExtend; try { @@ -239,7 +247,7 @@ export default class JobExtend extends React.Component { > } iconBgcolor='#217346' buttons={this.getTopButtons()} diff --git a/pc4mobx/organization/components/resource/HrmInfoExtend.js b/pc4mobx/organization/components/resource/HrmInfoExtend.js new file mode 100644 index 0000000..5c16bea --- /dev/null +++ b/pc4mobx/organization/components/resource/HrmInfoExtend.js @@ -0,0 +1,187 @@ + +import { Button, Modal, message, Row, Col, Spin } from 'antd'; +import isEmpty from 'lodash/isEmpty' +import cloneDeep from 'lodash/cloneDeep' +import forEach from 'lodash/forEach' +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop } from 'ecCom' +import { WeaSwitch, WeaForm } from 'comsMobx'; +import { inject, observer } from 'mobx-react'; +import * as mobx from 'mobx'; +import { i18n } from '../../public/i18n'; +import * as Api from '../../apis/hrmInfoExtend'; // 引入API接口文件 + + +const toJS = mobx.toJS; +import '../../style/common.less'; + + + +export default class HrmInfoExtend extends React.Component { + constructor(props) { + super(props); + this.state = { + id: props.location.query.hrmResourceID, + isEditor: false, + loading: false, + form: new WeaForm(), + conditions: [], + buttons: {}, + date: '' + } + } + + componentDidMount() { + this.init(); + } + + init = () => { + this.setState({ + isEditor: false + }); + this.getData(); + } + + getData = () => { + this.state.loading = true; + let params = { + viewAttr: this.isEditor ? 2 : 1, + id: this.state.id, + } + Api.getResourceExtendForm(params).then((res) => { + if (res.code === 200) { + this.state.form.initFormFields(res.data.conditions); + this.setState({ + conditions: res.data.conditions, + buttons: res.data.buttons, + loading: false + }) + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + getTopButtons = () => { + const { isEditor, buttons } = this.state; + const save = ; + const back = ; + const edit = ; + const btns = []; + try { + if (isEditor) { + if (buttons.hasSave) { + btns.push(save); + btns.push(back); + } + } else { + if (buttons.hasEdit) { + btns.push(edit); + } + } + } catch (e) { } + return btns; + } + + getSearchs = () => { + let { form, conditions, isEditor } = this.state; + const { isFormInit } = form; + let group = []; + let tipPosition = 'bottom'; + window.e9HideFormFieldKeys = []; + isFormInit && conditions.forEach((c, i) => { + let items = []; + c.items.forEach((field, j) => { + if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { + window.e9HideFormFieldKeys.push(field.domkey[0]); + } else { + items.push({ + com: ( + + ), + colSpan: 1 + }); + } + }); + group.push() + }); + return group; + } + + editCard = () => { + this.setState({ + isEditor: true + }) + this.getData(); + } + + //todo 更新操作暂不处理 + saveEditCard = () => { + const {loading,form} = this.state; + this.state.form.validateForm().then(f => { + if (f.isValid) { + this.state.loading = true; + let pDatas = this.form.getFormParams(); + Api.editResource({ + ...{ + id: this.id + }, + ...pDatas, + ...this.getTableEditParams() + }).then(data => { + if (data.code == 200) { + message.success(i18n.message.saveSuccess()); + this.init(); + this.getData(); + this.selectedRowKeys = []; + } else { + message.warning(data.message); + } + this.loading = false; + }, error => { + message.warning(error.message); + this.loading = false; + }) + } else { + f.showErrors(); + this.setDate(new Date()); + this.loading = false; + } + }) + } + + backCard = () => { + this.init(); + } + + + render() { + + const { loading } = this.state; + + return ( +
+ + { + loading ?
+ +
+ : this.getSearchs() + } + +
+
+ ) + } +} + diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 739d5bc..5b5d7f0 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -26,6 +26,7 @@ import FieldDefined from "./components/fieldDefinedSet/FieldDefined"; import Resource from "./components/resource/resource"; import ResourceExtend from "./components/resource/ResourceExtend"; import BasicInfoImport from "./components/import"; +import HrmInfoExtend from "./components/resource/HrmInfoExtend"; import stores from "./stores"; import "./style/index"; @@ -84,6 +85,7 @@ const Routes = ( + diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 53a0ac5..ab5efc7 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -147,7 +147,7 @@ export const i18n = { jobName: () => getLabel(385936, '岗位'), newJob: () => getLabel(386246, '新增岗位'), editJobInfo: () => getLabel(386247, '修改岗位信息'), - jobInfo: () => getLabel(386247, '岗位信息'), + jobsInfo: () => getLabel(386247, '岗位信息'), deptManage: () => getLabel(385936, '部门管理'), newDept: () => getLabel(386246, '新增部门'), mergeDept:()=> getLabel(386246, '合并部门'), diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 361250f..d968ff4 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -306,95 +306,100 @@ export class JobStore { updateConditions(data) { if (data.sequence_id) { - let label = "等级方案" - const index = findIndex(this.condition[1].items, { label }); - const schemeId = data.sequence_id.valueObj[0].scheme_values; - this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; - //清空职级并限制范围 - label = "职级" - const index1 = findIndex(this.condition[1].items, { label }); - let currenttime = Date.now(); - let key = `scheme_id_${currenttime}`; - const lastKey = this.key; - this.setKey(key); - - Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.completeParams, lastKey); - Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.conditionDataParams, lastKey); - Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.dataParams, lastKey); - Reflect.deleteProperty(this.condition[1].items[index1].browserConditionParam.destDataParams, lastKey); - - this.condition[1].items[index1].browserConditionParam.completeParams = { - [key]: schemeId, - ...this.condition[1].items[index1].browserConditionParam.completeParams, - currenttime: currenttime + if (data.sequence_id.valueObj.length > 0) { + let label = "等级方案" + const index = findIndex(this.condition[1].items, { label }); + const schemeId = data.sequence_id.valueObj[0].scheme_values; + this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; + //清空职级并限制范围 + label = "职级" + const index1 = findIndex(this.condition[1].items, { label }); + let currenttime = 1657247378274 + let key = `scheme_id_${currenttime}`; + this.condition[1].items[index1].browserConditionParam.completeParams = { + ...this.condition[1].items[index1].browserConditionParam.completeParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.conditionDataParams = { + ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.dataParams = { + ...this.condition[1].items[index1].browserConditionParam.dataParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.destDataParams = { + ...this.condition[1].items[index1].browserConditionParam.destDataParams, + [key]: schemeId, + currenttime: currenttime + } } - this.condition[1].items[index1].browserConditionParam.conditionDataParams = { - [key]: schemeId, - ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.dataParams = { - [key]: schemeId, - ...this.condition[1].items[index1].browserConditionParam.dataParams, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.destDataParams = { - [key]: schemeId, - ...this.condition[1].items[index1].browserConditionParam.destDataParams, - currenttime: currenttime - } - - this.form.updateFields({ - levelId: { + this.form1.updateFields({ + scheme_id: { + value: '' + }, + level_id: { value: '' }, grade_id: { value: '' } }); - } else { - - //清空职等并限制范围 - let label = "职等" - const index2 = findIndex(this.condition[1].items, { label }); - let currenttime = Date.now(); - let key1 = `id_${currenttime}`; - const lastKey = this.key1; - this.key1 = key1; - const levelId = '11,12'; - Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.completeParams, lastKey); - Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.conditionDataParams, lastKey); - Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.dataParams, lastKey); - Reflect.deleteProperty(this.condition[1].items[index2].browserConditionParam.destDataParams, lastKey); - - this.condition[1].items[index2].browserConditionParam.completeParams = { - [key1]: levelId, - ...this.condition[1].items[index2].browserConditionParam.completeParams, - currenttime: currenttime + } else if (data.grade_id) { + if (data.grade_id.valueObj.length > 0) { + //清空职等并限制范围 + let label = "职等" + const index2 = findIndex(this.condition[1].items, { label }); + let currenttime = 1657247378274; + let key1 = `level_id_${currenttime}`; + let key2 = `scheme_id_${currenttime}`; + let params = { + id:data.grade_id.value + }; + Api.getLevelId(params).then(res => { + if (res.code === 200) { + const levelId = res.data; + this.condition[1].items[index2].browserConditionParam.completeParams = { + ...this.condition[1].items[index2].browserConditionParam.completeParams, + [key1]: levelId, + [key2]: "''", + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.conditionDataParams = { + ...this.condition[1].items[index2].browserConditionParam.conditionDataParams, + [key1]: levelId, + [key2]: "''", + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.dataParams = { + ...this.condition[1].items[index2].browserConditionParam.dataParams, + [key1]: levelId, + [key2]: "''", + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.destDataParams = { + ...this.condition[1].items[index2].browserConditionParam.destDataParams, + [key]: levelId, + [key2]: "''", + currenttime: currenttime + } + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) } - this.condition[1].items[index2].browserConditionParam.conditionDataParams = { - [key1]: levelId, - ...this.condition[1].items[index2].browserConditionParam.conditionDataParams, - currenttime: currenttime - } - this.condition[1].items[index2].browserConditionParam.dataParams = { - [key1]: levelId, - ...this.condition[1].items[index2].browserConditionParam.dataParams, - currenttime: currenttime - } - this.condition[1].items[index2].browserConditionParam.destDataParams = { - [key]: levelId, - ...this.condition[1].items[index2].browserConditionParam.destDataParams, - currenttime: currenttime - } - - this.form.updateFields({ - grade_id: { + this.form1.updateFields({ + level_id: { value: '' } }); } - this.setCondition(this.condition, false); + this.setCondition(this.condition); this.form1.initFormFields(this.condition); } diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index ba32c8b..c1ba6bc 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -4,14 +4,15 @@ import isEmpty from 'lodash/isEmpty' import { WeaTableNew } from "comsMobx"; import { Modal, message } from "antd"; import { i18n } from "../public/i18n"; -import forEach from 'lodash/forEach' import * as Api from '../apis/job'; // 引入API接口文件 - +import { + findIndex, forEach +} from 'lodash'; export class JobExtendStore { @observable form = new WeaForm(); @observable tableInfo = [] - @observable conditions = []; + @observable condition = []; @observable isEditor = false; @observable isNew = true; @observable loading = true; @@ -43,12 +44,10 @@ export class JobExtendStore { this.isEditor = true; this.getData(); this.getTabInfo(); - //this.tabkey = '0'; this.detailSelectedKey = '0' } init = () => { - //this.tabkey = '0'; this.detailSelectedKey = '0' this.isEditor = false; } @@ -130,7 +129,7 @@ export class JobExtendStore { Api.getJobExtendForm(params).then((res) => { if (res.code === 200) { res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); - res.data.result.conditions && this.setConditions(res.data.result.conditions); + res.data.result.conditions && this.setCondition(res.data.result.conditions); this.tableInfo = this.handleTable(res.data.result.tables); this.getTabInfo(); res.data.result.buttons && this.setButtons(res.data.result.buttons); @@ -144,10 +143,6 @@ export class JobExtendStore { }, error => { message.warning(error.msg); }) - - - - } handleTable = (datas) => { @@ -171,15 +166,114 @@ export class JobExtendStore { }) } }) - //if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; } + + updateConditions(data) { + if (data.sequence_id) { + if (data.sequence_id.valueObj.length > 0) { + let label = "等级方案" + const index = findIndex(this.condition[1].items, { label }); + const schemeId = data.sequence_id.valueObj[0].scheme_values; + this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; + //清空职级并限制范围 + label = "职级" + const index1 = findIndex(this.condition[1].items, { label }); + let currenttime = 1657247378274 + let key = `scheme_id_${currenttime}`; + this.condition[1].items[index1].browserConditionParam.completeParams = { + ...this.condition[1].items[index1].browserConditionParam.completeParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.conditionDataParams = { + ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.dataParams = { + ...this.condition[1].items[index1].browserConditionParam.dataParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.destDataParams = { + ...this.condition[1].items[index1].browserConditionParam.destDataParams, + [key]: schemeId, + currenttime: currenttime + } + } + this.form.updateFields({ + scheme_id: { + value: '' + }, + level_id: { + value: '' + }, + grade_id: { + value: '' + } + }); + } else if (data.grade_id) { + if (data.grade_id.valueObj.length > 0) { + //清空职等并限制范围 + let label = "职等" + const index2 = findIndex(this.condition[1].items, { label }); + let currenttime = 1657247378274; + let key1 = `level_id_${currenttime}`; + let key2 = `scheme_id_${currenttime}`; + let params = { + id:data.grade_id.value + }; + Api.getLevelId(params).then(res => { + if (res.code === 200) { + const levelId = res.data; + this.condition[1].items[index2].browserConditionParam.completeParams = { + ...this.condition[1].items[index2].browserConditionParam.completeParams, + [key1]: levelId, + [key2]: "''", + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.conditionDataParams = { + ...this.condition[1].items[index2].browserConditionParam.conditionDataParams, + [key1]: levelId, + [key2]: "''", + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.dataParams = { + ...this.condition[1].items[index2].browserConditionParam.dataParams, + [key1]: levelId, + [key2]: "''", + currenttime: currenttime + } + this.condition[1].items[index2].browserConditionParam.destDataParams = { + ...this.condition[1].items[index2].browserConditionParam.destDataParams, + [key]: levelId, + [key2]: "''", + currenttime: currenttime + } + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + } + this.form.updateFields({ + level_id: { + value: '' + } + }); + } + this.setCondition(this.condition); + //this.form.initFormFields(this.condition); + } + setLoading(val) { this.loading = val; } - updateTabKey = (key) => { this.tabKey = key; } @@ -228,8 +322,8 @@ export class JobExtendStore { this.personalEditTables = ref; } - setConditions(conditions) { - this.conditions = conditions; + setCondition(condition) { + this.condition = condition; } setButtons(buttons) { diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 83141e5..242e4a8 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -47,7 +47,7 @@ export class JobGradeStore { @observable selectedKey = -1; @observable topTab = []; @observable topTabCount = {}; - @observable key = '';// + @observable lastime = '';// @observable hasRight = true; @observable treeLoading = true; @@ -277,36 +277,39 @@ export class JobGradeStore { } updateConditions(val) { - let currenttime = 1657247378274; + let currenttime = Date.now(); let key = `scheme_id_${currenttime}`; - let id_key = `level_id_${currenttime}` - // const lastKey = this.key; - // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.completeParams, lastKey); - // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.conditionDataParams, lastKey); - // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams, lastKey); - // Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.destDataParams, lastKey); - // this.setKey(key); + let id_key = `level_id_${currenttime}`; + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.completeParams, `scheme_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.conditionDataParams, `scheme_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams, `scheme_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.destDataParams, `scheme_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.completeParams, `level_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.conditionDataParams, `level_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams, `level_id_${this.lastime}`); + Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.destDataParams, `level_id_${this.lastime}`); + this.setLastTime(currenttime); this.condition[0].items[4].browserConditionParam.completeParams = { - [key]: val, ...this.condition[0].items[4].browserConditionParam.completeParams, + [key]: val, currenttime: currenttime, [id_key]:"''" } this.condition[0].items[4].browserConditionParam.conditionDataParams = { - [key]: val, ...this.condition[0].items[4].browserConditionParam.conditionDataParams, + [key]: val, currenttime: currenttime, [id_key]:"''" } this.condition[0].items[4].browserConditionParam.dataParams = { - [key]: val, ...this.condition[0].items[4].browserConditionParam.dataParams, + [key]: val, currenttime: currenttime, [id_key]:"''" } this.condition[0].items[4].browserConditionParam.destDataParams = { - [key]: val, ...this.condition[0].items[4].browserConditionParam.destDataParams, + [key]: val, currenttime: currenttime, [id_key]:"''" } @@ -424,6 +427,10 @@ export class JobGradeStore { this.key = key; } + setLastTime(time) { + this.lastime = time; + } + setHasRight(bool) { this.hasRight = bool; } diff --git a/pc4mobx/organization/stores/resourceExtend.js b/pc4mobx/organization/stores/resourceExtend.js index a07aa4d..98f645a 100644 --- a/pc4mobx/organization/stores/resourceExtend.js +++ b/pc4mobx/organization/stores/resourceExtend.js @@ -141,10 +141,6 @@ export class ResourceExtendStore { }, error => { message.warning(error.msg); }) - - - - } handleTable = (datas) => { From cb010edefa130a24423073d32b1031148b032ed2 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 18 Jul 2022 10:44:14 +0800 Subject: [PATCH 045/155] fixed --- pc4mobx/organization/components/job/Job.js | 2 +- pc4mobx/organization/stores/job.js | 7 +++++-- pc4mobx/organization/stores/jobgrade.js | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 0f78484..926b46b 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-07-06 10:49:02 + * @LastEditTime: 2022-07-15 14:36:46 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index d968ff4..deed2b2 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -316,6 +316,9 @@ export class JobStore { const index1 = findIndex(this.condition[1].items, { label }); let currenttime = 1657247378274 let key = `scheme_id_${currenttime}`; + // Object.defineProperty(this.condition[1].items[index1].browserConditionParam.completeParams, [key], { + // value: schemeId, + // }) this.condition[1].items[index1].browserConditionParam.completeParams = { ...this.condition[1].items[index1].browserConditionParam.completeParams, [key]: schemeId, @@ -357,7 +360,7 @@ export class JobStore { let key1 = `level_id_${currenttime}`; let key2 = `scheme_id_${currenttime}`; let params = { - id:data.grade_id.value + id: data.grade_id.value }; Api.getLevelId(params).then(res => { if (res.code === 200) { @@ -391,7 +394,7 @@ export class JobStore { } }, error => { message.warning(error.msg); - }) + }) } this.form1.updateFields({ level_id: { diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 242e4a8..489b9bb 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -301,12 +301,12 @@ export class JobGradeStore { currenttime: currenttime, [id_key]:"''" } - this.condition[0].items[4].browserConditionParam.dataParams = { - ...this.condition[0].items[4].browserConditionParam.dataParams, - [key]: val, - currenttime: currenttime, - [id_key]:"''" - } + // this.condition[0].items[4].browserConditionParam.dataParams = { + // ...this.condition[0].items[4].browserConditionParam.dataParams, + // [key]: val, + // currenttime: currenttime, + // [id_key]:"''" + // } this.condition[0].items[4].browserConditionParam.destDataParams = { ...this.condition[0].items[4].browserConditionParam.destDataParams, [key]: val, From d3ca08680f5f7b000144f2662591822ba0935f67 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 25 Jul 2022 17:53:00 +0800 Subject: [PATCH 046/155] =?UTF-8?q?=E6=96=B0=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/newImport.js | 6 + .../components/newImport/index.js | 141 +++++++++++ .../components/newImport/stepContent.js | 231 ++++++++++++++++++ .../components/newImport/stepDialog.js | 96 ++++++++ pc4mobx/organization/index.js | 3 +- pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/index.js | 2 + pc4mobx/organization/stores/newImport.js | 170 +++++++++++++ 8 files changed, 649 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/organization/apis/newImport.js create mode 100644 pc4mobx/organization/components/newImport/index.js create mode 100644 pc4mobx/organization/components/newImport/stepContent.js create mode 100644 pc4mobx/organization/components/newImport/stepDialog.js create mode 100644 pc4mobx/organization/stores/newImport.js diff --git a/pc4mobx/organization/apis/newImport.js b/pc4mobx/organization/apis/newImport.js new file mode 100644 index 0000000..3a16b62 --- /dev/null +++ b/pc4mobx/organization/apis/newImport.js @@ -0,0 +1,6 @@ +import { WeaTools } from 'ecCom' + +//获取导入表单 +export const getImportForm = (params) => { + return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/newImport/index.js b/pc4mobx/organization/components/newImport/index.js new file mode 100644 index 0000000..234b93b --- /dev/null +++ b/pc4mobx/organization/components/newImport/index.js @@ -0,0 +1,141 @@ +import React from 'react' +import { + toJS +} from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaAlertPage, +} from 'ecCom' +import { + Spin, +} from 'antd'; +import { + i18n +} from '../../public/i18n'; + +import '../../style/import.css'; +import {addContentPath} from '../../util/index.js'; +import StepDialog from './stepDialog'; + + +@inject("newImport") +@observer +export default class newImport extends React.Component { + constructor(props) { + super(props); + this.state = ({ + title:'基础数据导入', + + }) + } + + componentWillMount() { + + } + + componentDidMount() { + + } + + + getImportCard = () => { + const { + newImport + } = this.props, { + isMouseOver, + curIndex, + cardConfig, + setMouseStatus, + } = newImport; + + let arr = []; + + cardConfig.map((c, index) => { + arr.push(
setMouseStatus(index, true)} onMouseLeave={() => setMouseStatus(index, false)}> +
+ { curIndex == index && isMouseOver ? this.getLinkName(c.linkName,index) : this.getIcon(c.icon)} + { curIndex == index && isMouseOver ? this.getSubTitle(c.subTitle,c.url) : this.getTitle(c.title)} +
+
) + }); + return arr; + } + + getIcon = (icon) => { + return (
+ +
) + } + + getTitle = (title) => { + return (
{title}
) + } + + getLinkName = (linkName, index) => { + return () + } + + getSubTitle = (subTitle, url) => { + return () + } + + handleClick = (index) => { + const { + newImport + } = this.props, { + } = newImport; + switch (index) { + case 0: + newImport.importType = 'company'; + break; + case 1: + newImport.importType = 'department'; + break; + case 2: + newImport.importType = 'jobtitle'; + break; + case 3: + newImport.importType = 'resource'; + break; + } + newImport.buttonTitle = i18n.button.nextStep(); + newImport.current = 0; + newImport.visible = true; + newImport.getImportField(); + + + } + + + render() { + const { + newImport, + } = this.props,{ + visible + } = newImport,{ + title, + } = this.state; + + return ( + } + iconBgcolor='#217346' + loading={true} + showDropIcon={true} + > +
{this.getImportCard()}
+ {visible && } +
+ ) + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/components/newImport/stepContent.js b/pc4mobx/organization/components/newImport/stepContent.js new file mode 100644 index 0000000..59129a8 --- /dev/null +++ b/pc4mobx/organization/components/newImport/stepContent.js @@ -0,0 +1,231 @@ + +import { + WeaSearchGroup, + WeaTransfer, + WeaNewScroll, + WeaSelect, + WeaUpload +} from 'ecCom' +import { + Spin, + Button, + Pagination, + Steps, + Row, + Col, +} from 'antd' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' + +import { + i18n +} from '../../public/i18n'; +import { addContentPath } from '../../util/index.js' + + +@inject("newImport") +@observer +export default class StepDialog extends React.Component { + constructor(props) { + super(props); + } + + getCircle() { + let style = { + width: 20, + height: 20, + backgroundColor: '#D8D8D8', + webkitBorderRadius: 10, + mozBorderRadius: 10, + msBorderRadius: 10, + oBorderRadius: 10, + borderRadius: 10, + //paddingLeft: 6, + textAlign: 'center', + } + return style; + } + + getForm() { + const { + newImport + } = this.props; + const { + condition + } = newImport; + let _arr = []; + + condition.map((c, i) => { + let arr = []; + if (i == 0) { //基本信息 + c.items.map((field, index) => { + arr.push({ + com: ( +
+ +
+
+
{index + 1}
+
+ +
+
+ +
{field.label}: + + {this.getDom(field)} + + + + + + + ), + colSpan: 1, + }) + }) + } + if (i == 1) { //导入说明 + c.items.map((field, index) => { + arr.push({ + com: ( +
+ +
+
+
{index + 1}
+
+ +
+ {this.getIllustration(field.value, field.link, index, field)} + + + + + ), + colSpan: 1 + }) + }) + } + _arr.push(
) + + }); + return _arr; + } + + getDom(field) { + const { + newImport + } = this.props; + const { + filelist + } = newImport; + let dom; + let domkey = field.domkey; + if (domkey[0] == 'templet') { + dom = {i18n.label.importTemplate()}; + } else if (domkey[0].indexOf('keyField') > -1) { + const vals = field.options.filter(v => v.selected == true); + let val = ''; + vals.length > 0 && (val = vals[0].key); + dom = { newImport.setParam(domkey[0], v) }} + /> + } else if (domkey[0] == 'importType') { + dom = { newImport.operateType = v }} + /> + } else if (domkey[0] == 'excelfile' || domkey[0] == 'importfile') { + dom = (
+
+ { + this.setFileId(ids, list) + } + } > + + +
+
+ {filelist.length == 0 ?

{i18n.label.noFileSelected()}

: filelist.map(file =>

{file.filename}

)} +
+
) + } + return dom; + } + + setFileId(ids, list) { + const { + newImport + } = this.props; + newImport.excelfile = ids; + newImport.filelist = list; + } + + getIllustration(val, url, index, link) { + const { + newImport + } = this.props; + const { + getTemplateUrl, + importParams + } = newImport; + let p; + if (index == 0) { + p = (

{i18n.label.downLoadTemplete()}: {i18n.label.importTemplate()}

); + } else { + p = (

); + } + return p; + } + + render = () => { + const { + newImport + } = this.props, { + data, selectedKeys, current + } = newImport; + + return ( +
+ { + current == 0 && newImport.setSelectedKeys(keys)} + /> + } + { + current == 1 && + {this.getForm()} + + } + { + current == 2 &&
获取导入结果
+ } + +
+ ) + } +} + + diff --git a/pc4mobx/organization/components/newImport/stepDialog.js b/pc4mobx/organization/components/newImport/stepDialog.js new file mode 100644 index 0000000..d209963 --- /dev/null +++ b/pc4mobx/organization/components/newImport/stepDialog.js @@ -0,0 +1,96 @@ +import { + WeaNewScroll, + WeaSearchGroup, + WeaMoreButton, + WeaDialog +} from 'ecCom' +import { + inject, + observer, +} from 'mobx-react' +import { + Spin, + Button, + Pagination, + Steps +} from 'antd' + +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' + +import { + i18n +} from '../../public/i18n'; + +const Step = Steps.Step; +import StepContent from './stepContent'; + +@inject("newImport") +@observer +export default class StepDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + width: 800, + height: 600, + title: '数据导入', + } + } + + next() { + const {newImport} = this.props; + let {current,steps} = newImport; + current = current + 1; + if (current === steps.length) { + current = 0; + newImport.init(); + } + newImport.current = current; + current === 1 && newImport.getImportForm(); + current === steps.length - 1 && newImport.getImportResult(); + } + + render() { + const { + newImport + } = this.props, { + current, + visible, + steps + } = newImport,{ + width, + height, + title + } = this.state; + + const buttons = [ + (), + ]; + + return ( + newImport.init()} + buttons={buttons} + style={{ width: width, height: height }} + > +
+ + {steps.map((s, i) => )} + +
+
+ +
+ +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 5b5d7f0..0abe74e 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -27,6 +27,7 @@ import Resource from "./components/resource/resource"; import ResourceExtend from "./components/resource/ResourceExtend"; import BasicInfoImport from "./components/import"; import HrmInfoExtend from "./components/resource/HrmInfoExtend"; +import NewImport from "./components/newImport" import stores from "./stores"; import "./style/index"; @@ -87,7 +88,7 @@ const Routes = ( - + ); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index ab5efc7..655e455 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -853,6 +853,7 @@ export const i18n = { back: () => getLabel(1290, '返回'), createType: () => getLabel(30131, '新建类型'), editTypeInfo: () => getLabel(32732, '编辑类型'), + nextStep:() => getLabel(30131, '下一步'), batchOpen: () => getLabel(534249, '批量解锁'), collect: () => getLabel(28111, '收藏'), diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 4d66441..45a7974 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -22,6 +22,7 @@ import {DatasImportStore} from "./datasImport"; import {HrmImportResource} from "./importresource"; import {HrmImportCommon} from "./importCommon"; import {HrmBasicDataImport} from "./import"; +import {newImportStore} from "./newImport"; module.exports = { @@ -49,4 +50,5 @@ module.exports = { hrmImportResource:new HrmImportResource(), hrmImportCommon:new HrmImportCommon(), hrmBasicDataImport:new HrmBasicDataImport(), + newImport: new newImportStore() }; diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js new file mode 100644 index 0000000..6f3eead --- /dev/null +++ b/pc4mobx/organization/stores/newImport.js @@ -0,0 +1,170 @@ +import { + observable, + action +} from 'mobx'; +import { + WeaForm +} from 'comsMobx'; + +import * as API from '../apis/newImport'; +import * as Util from '../util/index'; +import { + validate, + getFormParamValue +} from '../util' +import { + message, + Modal, + Button +} from 'antd'; +import { + WeaTableNew +} from 'comsMobx' +import * as mobx from 'mobx'; +import isEmpty from 'lodash/isEmpty'; +import { + has +} from 'lodash'; +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; +const confirm = Modal.confirm; +// import { +// i18n +// } from '../public/i18n'; + +export class newImportStore { + + /********************* cardConfig *********************/ + cardConfig = [ + { + "subTitle": "分部设置", + "bgColor": "#92B75B", + "icon": "icon-coms-Department-number", + "title": "分部", + "linkName": "分部导入", + "url": "/spa/hrm/engine.html#/hrmengine/organization" + }, + { + "subTitle": "部门设置", + "bgColor": "#92B75B", + "icon": "icon-coms-Department-number", + "title": "部门", + "linkName": "部门导入", + "url": "/spa/hrm/engine.html#/hrmengine/organization" + }, + { + "subTitle": "岗位设置", + "bgColor": "#49B2FE", + "icon": "icon-coms-hrm", + "title": "岗位", + "linkName": "岗位体系导入", + "url": "/spa/hrm/engine.html#/hrmengine/post" + }, + { + "subTitle": "组织维护", + "bgColor": "#51A39A", + "icon": "icon-coms-crm", + "title": "人员", + "linkName": "人员导入", + "url": "/spa/hrm/engine.html#/hrmengine/organization" + } + ] + + @observable isMouseOver = false; + @observable curIndex = ''; + @observable visible = false; + + @action setMouseStatus = (index, bool) => { + this.curIndex = index; + this.isMouseOver = bool; + } + + + + /********************* stepDialog *********************/ + + steps = [ + { title: '设置导入字段'}, + { title: '获取导入模板' }, + { title: '导入结果' } + ]; + @observable importType = ''; + @observable current = 0; + @observable buttonTitle = ''; + + + + /********************* stepContent *********************/ + data = [ + { id: 1, name: '杨文元' }, + { id: 2, name: '李妍' }, + { id: 3, name: '刘长庚' }, + { id: 4, name: '孟玲' }, + { id: 5, name: '张建华' }, + ]; + selectedKeys = [1, 2]; + + @observable condition = []; + @observable importParams = {}; //重复验证字段 + @observable operateType = 'add'; //导入类型 + @observable filelist = []; //文件信息 + @observable excelfile = []; //文件id + @observable templetName = "导入模板"; + getTemplateUrl + + @action setParam = (k, v) => { + const p = toJS(this.importParams); + Object.assign(p, { + [k]: v + }); + this.importParams = p; + } + + @action("获取导入字段") getImportField() { + + } + + @action("获取导入表单") getImportForm() { + const params = { + importType: this.importType, + } + API.getImportForm(params).then(data => { + if (data.status == '1') { + this.condition = data.condition; + if (data.condition != null && Array.isArray(data.condition) && data.condition.length > 0) { + this.condition[0].items.map(item => { + if (item.conditionType === 'SELECT' && item.domkey[0] === 'importType') { + item.options.map(op => { + if (op.selected) + this.operateType = op.key; + }) + } + item.domkey[0].indexOf('keyField') > -1 && this.setParam(item.domkey[0], item.value); + }) + } + } else { + // message.warning(data.message); + } + }, error => { + message.warning(error.message); + }) + } + + @action("获取导入结果") getImportResult() { + + } + + setSelectedKeys(keys) { + this.selectedKeys = keys; + } + + @action("初始化弹框内容") init() { + this.filelist = []; + this.excelfile = []; + this.visible = false; + } + + +} \ No newline at end of file From 9263c27fd33cf14e33e0bfb845d6f83a3d330955 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 27 Jul 2022 14:54:59 +0800 Subject: [PATCH 047/155] fix --- pc4mobx/organization/apis/newImport.js | 20 +- .../components/newImport/index.js | 51 ++--- .../components/newImport/stepContent.js | 74 ++++++- .../components/newImport/stepDialog.js | 2 +- pc4mobx/organization/stores/newImport.js | 187 +++++++++++++++--- 5 files changed, 273 insertions(+), 61 deletions(-) diff --git a/pc4mobx/organization/apis/newImport.js b/pc4mobx/organization/apis/newImport.js index 3a16b62..e334637 100644 --- a/pc4mobx/organization/apis/newImport.js +++ b/pc4mobx/organization/apis/newImport.js @@ -1,6 +1,22 @@ import { WeaTools } from 'ecCom' +//选择导入字段 +export const getImportFields = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportFields`, 'GET', params); +} + +//导入文件提交 +export const saveImport = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveImport`, 'POST', params); +} + //获取导入表单 export const getImportForm = (params) => { - return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params); -} \ No newline at end of file + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportForm`, 'GET', params); +} + +//获取导入结果 +export const getImportResult = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportResult`, 'GET', params); +} + diff --git a/pc4mobx/organization/components/newImport/index.js b/pc4mobx/organization/components/newImport/index.js index 234b93b..07a5237 100644 --- a/pc4mobx/organization/components/newImport/index.js +++ b/pc4mobx/organization/components/newImport/index.js @@ -9,6 +9,7 @@ import { import { WeaTop, WeaAlertPage, + WeaBrowser } from 'ecCom' import { Spin, @@ -18,7 +19,7 @@ import { } from '../../public/i18n'; import '../../style/import.css'; -import {addContentPath} from '../../util/index.js'; +import { addContentPath } from '../../util/index.js'; import StepDialog from './stepDialog'; @@ -28,8 +29,8 @@ export default class newImport extends React.Component { constructor(props) { super(props); this.state = ({ - title:'基础数据导入', - + title: '基础数据导入', + }) } @@ -41,7 +42,7 @@ export default class newImport extends React.Component { } - + getImportCard = () => { const { newImport @@ -55,20 +56,20 @@ export default class newImport extends React.Component { let arr = []; cardConfig.map((c, index) => { - arr.push(
setMouseStatus(index, true)} onMouseLeave={() => setMouseStatus(index, false)}> -
- { curIndex == index && isMouseOver ? this.getLinkName(c.linkName,index) : this.getIcon(c.icon)} - { curIndex == index && isMouseOver ? this.getSubTitle(c.subTitle,c.url) : this.getTitle(c.title)} -
-
) + arr.push(
setMouseStatus(index, true)} onMouseLeave={() => setMouseStatus(index, false)}> +
+ {curIndex == index && isMouseOver ? this.getLinkName(c.linkName, index) : this.getIcon(c.icon)} + {curIndex == index && isMouseOver ? this.getSubTitle(c.subTitle, c.url) : this.getTitle(c.title)} +
+
) }); return arr; } getIcon = (icon) => { return (
- -
) + +
) } getTitle = (title) => { @@ -76,33 +77,33 @@ export default class newImport extends React.Component { } getLinkName = (linkName, index) => { - return () + return () } getSubTitle = (subTitle, url) => { - return () + return () } handleClick = (index) => { const { - newImport + newImport } = this.props, { } = newImport; switch (index) { - case 0: + case 0: newImport.importType = 'company'; break; case 1: newImport.importType = 'department'; break; - case 2: + case 2: newImport.importType = 'jobtitle'; break; - case 3: + case 3: newImport.importType = 'resource'; break; } @@ -118,9 +119,9 @@ export default class newImport extends React.Component { render() { const { newImport, - } = this.props,{ + } = this.props, { visible - } = newImport,{ + } = newImport, { title, } = this.state; @@ -133,7 +134,7 @@ export default class newImport extends React.Component { showDropIcon={true} >
{this.getImportCard()}
- {visible && } + {visible && } ) } diff --git a/pc4mobx/organization/components/newImport/stepContent.js b/pc4mobx/organization/components/newImport/stepContent.js index 59129a8..61301f6 100644 --- a/pc4mobx/organization/components/newImport/stepContent.js +++ b/pc4mobx/organization/components/newImport/stepContent.js @@ -4,7 +4,9 @@ import { WeaTransfer, WeaNewScroll, WeaSelect, - WeaUpload + WeaUpload, + WeaDialog, + WeaInput } from 'ecCom' import { Spin, @@ -13,6 +15,8 @@ import { Steps, Row, Col, + Progress, + Icon } from 'antd' import { inject, @@ -27,6 +31,8 @@ import { i18n } from '../../public/i18n'; import { addContentPath } from '../../util/index.js' +import { toJS } from 'mobx'; +const WeaTable = WeaTableNew.WeaTable; @inject("newImport") @@ -34,8 +40,13 @@ import { addContentPath } from '../../util/index.js' export default class StepDialog extends React.Component { constructor(props) { super(props); + this.state = { + data: [], + selectedKeys: [] + } } + getCircle() { let style = { width: 20, @@ -155,6 +166,7 @@ export default class StepDialog extends React.Component { category='string' limitType='xls,xlsx' maxFilesNumber={1} + viewAttr={3} datas={filelist} {...field.otherParams} onChange={ @@ -166,9 +178,11 @@ export default class StepDialog extends React.Component {
- {filelist.length == 0 ?

{i18n.label.noFileSelected()}

: filelist.map(file =>

{file.filename}

)} + {filelist.length == 0 ?

{i18n.label.noFileSelected()}

: filelist.map(file =>

{file.filename}

)}
) + }else { + dom = } return dom; } @@ -186,7 +200,6 @@ export default class StepDialog extends React.Component { newImport } = this.props; const { - getTemplateUrl, importParams } = newImport; let p; @@ -198,20 +211,35 @@ export default class StepDialog extends React.Component { return p; } + reRenderColumns(c) { + c.forEach(item => { + if (item.dataIndex == 'operatedetail') { + item.render = function (text, record) { + return {text} + } + } + }); + } + render = () => { const { newImport } = this.props, { - data, selectedKeys, current + data, selectedKeys, current, pvisable, percent, failnum, succnum, importResultTip, importResultStore, importStatus, loading, date } = newImport; + + return (
{ current == 0 && newImport.setSelectedKeys(keys)} + data={toJS(data)} + selectedKeys={toJS(selectedKeys)} + onChange={(keys, datas) => { + newImport.setSelectedKeys(keys); + newImport.setSelectData(datas); + }} /> } { @@ -220,10 +248,38 @@ export default class StepDialog extends React.Component { } { - current == 2 &&
获取导入结果
+ current == 2 &&
+ { + importStatus == 'over' &&
+
0 ? '#54D3A2' : '#FF0000' }}> + 0 ? 'check' : 'cross'} style={{ color: '#fff' }} /> +
{importResultTip} +
+ } + { + failnum > 0 && + this.reRenderColumns(c)} + /> + } + newImport.pvisable = false} + visible={pvisable} + style={{ width: 300, height: 50 }} + > +
+ +
+
+
} -
+ ) } } diff --git a/pc4mobx/organization/components/newImport/stepDialog.js b/pc4mobx/organization/components/newImport/stepDialog.js index d209963..957caa3 100644 --- a/pc4mobx/organization/components/newImport/stepDialog.js +++ b/pc4mobx/organization/components/newImport/stepDialog.js @@ -49,7 +49,7 @@ export default class StepDialog extends React.Component { } newImport.current = current; current === 1 && newImport.getImportForm(); - current === steps.length - 1 && newImport.getImportResult(); + current === steps.length - 1 && newImport.startImport(); } render() { diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js index 6f3eead..fe64764 100644 --- a/pc4mobx/organization/stores/newImport.js +++ b/pc4mobx/organization/stores/newImport.js @@ -1,6 +1,7 @@ import { observable, - action + action, + computed } from 'mobx'; import { WeaForm @@ -30,9 +31,12 @@ const { TableStore } = WeaTableNew; const confirm = Modal.confirm; -// import { -// i18n -// } from '../public/i18n'; +import { + i18n +} from '../public/i18n'; +import { + findIndex +} from 'lodash'; export class newImportStore { @@ -93,26 +97,33 @@ export class newImportStore { @observable importType = ''; @observable current = 0; @observable buttonTitle = ''; - + @observable pvisable = false; /********************* stepContent *********************/ - data = [ - { id: 1, name: '杨文元' }, - { id: 2, name: '李妍' }, - { id: 3, name: '刘长庚' }, - { id: 4, name: '孟玲' }, - { id: 5, name: '张建华' }, - ]; - selectedKeys = [1, 2]; + @observable data = []; + @observable selectedKeys = []; + selectData = []; @observable condition = []; @observable importParams = {}; //重复验证字段 @observable operateType = 'add'; //导入类型 @observable filelist = []; //文件信息 - @observable excelfile = []; //文件id + @observable excelfile = ''; //文件id @observable templetName = "导入模板"; - getTemplateUrl + @observable percent = 0; + @observable failnum = 0; //失败数量 + @observable succnum = 0; //成功数量 + @observable importResultTip = ''; //导入结果提示 + @observable importResultStore = new TableStore(); + @observable importStatus = 'importing'; //导入状态 + @observable loading = true; + @observable date = ''; + @observable keyField = 'workcode'; + @observable otherParams; //表单其它参数 + @observable pId = '';//导入记录 + + interval @action setParam = (k, v) => { const p = toJS(this.importParams); @@ -123,17 +134,43 @@ export class newImportStore { } @action("获取导入字段") getImportField() { - + this.loading = true; + const params = { + importType:this.importType + } + API.getImportFields(params).then(res => { + if(res.code == 200) { + this.data = res.data.data; + this.selectedKeys = res.data.selectedKeys; + res.data.data && this.selectedKeys.forEach(id => { + const index = findIndex(res.data.data, { id }); + this.selectData.push(res.data.data[index]) + }) + this.loading = false; + }else { + message.warning(res.msg); + } + },error => { + message.warning(error.msg); + }) } + @action("获取导入表单") getImportForm() { + let columns = []; + this.selectData.forEach(item => { + columns.push(item.name) + }) + + const params = { importType: this.importType, + columns:columns } - API.getImportForm(params).then(data => { - if (data.status == '1') { - this.condition = data.condition; - if (data.condition != null && Array.isArray(data.condition) && data.condition.length > 0) { + API.getImportForm(params).then(res => { + if (res.code == 200) { + this.condition = res.data.condition; + if (res.data.condition != null && Array.isArray(res.data.condition) && res.data.condition.length > 0) { this.condition[0].items.map(item => { if (item.conditionType === 'SELECT' && item.domkey[0] === 'importType') { item.options.map(op => { @@ -142,28 +179,130 @@ export class newImportStore { }) } item.domkey[0].indexOf('keyField') > -1 && this.setParam(item.domkey[0], item.value); + }) } } else { - // message.warning(data.message); + message.warning(res.msg); } }, error => { - message.warning(error.message); + message.warning(error.msg); }) } + @action("开始导入") startImport() { + if(this.filelist.length == 0) { + message.error("请上传需要导入的文件!") + this.current = this.current - 1; + return; + } + this.pvisable = true; + //导入文件提交 + let params = { + ...this.importParams, + keyField:this.keyField, + importType:this.importType, + operateType:this.operateType, + excelfile:this.excelfile + } + if (this.otherParams != null) { + Object.assign(params, { + otherParams: JSON.stringify(this.otherParams) + }) + } + this.doImport(params) + this.interval = setInterval(() => this.getImportProcess(), 200); + + } + + @action("文件提交") doImport(params) { + API.saveImport(params).then(res => { + if(res.code == 200) { + this.pId = res.data.pId; + }else { + clearInterval(this.interval); + this.pvisable = false; + message.error("文件导入失败") + } + }) + } + + // @computed get pId() { + // return this.percent = 100; + // } + + @action("获取导入进度") getImportProcess() { + if(this.pId != '') { + clearInterval(this.interval); + this.percent = 100; + const _this = this; + setTimeout(function(){ + _this.pvisable = false; + _this.getImportResult(); + },1000) + }else { + //调用导入进度api + let max = 95; + let min = this.percent; + if(this.percent < max) { + this.percent = Math.floor(Math.random() * (max - min)) + min; + } + + } + } + @action("获取导入结果") getImportResult() { - + let params = { + pId:this.pId + } + API.getImportResult(params).then((res) => { + if (res.code == 200) { + this.failnum = res.data.failnum; + this.succnum = res.data.succnum; + this.importStatus = res.data.importStatus; + if (this.failnum > 0) { + let info = i18n.label.importResourceResultInfo(); + info = info.replace('{rownum}', this.succnum + this.failnum).replace('{succnum}', this.succnum); + this.importResultTip = info; + this.importResultStore.getDatas(res.data.datas, 1); + } else { + let info = i18n.label.importResourceResultInfo1(); + info = info.replace('{rownum}', this.succnum); + this.importResultTip = info; + } + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) } setSelectedKeys(keys) { this.selectedKeys = keys; + this.date = new Date(); + } + + setSelectData(value){ + this.selectData = value; } @action("初始化弹框内容") init() { this.filelist = []; - this.excelfile = []; + this.excelfile = ''; this.visible = false; + this.percent = 0; + this.failnum = 0; + this.succnum = 0; + this.importResultTip = ''; + this.importResultStore = new TableStore(); + this.importStatus = 'importing'; + this.data = []; + this.selectData = []; + this.selectedKeys = []; + this.condition = []; + this.keyField = 'workcode'; + this.pId = ''; } From 5849a2251474df2688b326fc4f81d8b8f9e50bad Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 3 Aug 2022 09:23:36 +0800 Subject: [PATCH 048/155] =?UTF-8?q?=E7=BC=96=E5=88=B6=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/staff/StaffWorkflowSet.js | 121 ++++++++++++++++++ .../organization/components/staff/index.less | 43 +++++++ pc4mobx/organization/images/action.jpg | Bin 0 -> 25488 bytes pc4mobx/organization/images/workflow.jpg | Bin 0 -> 23157 bytes pc4mobx/organization/index.js | 4 +- 5 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/organization/components/staff/StaffWorkflowSet.js create mode 100644 pc4mobx/organization/components/staff/index.less create mode 100644 pc4mobx/organization/images/action.jpg create mode 100644 pc4mobx/organization/images/workflow.jpg diff --git a/pc4mobx/organization/components/staff/StaffWorkflowSet.js b/pc4mobx/organization/components/staff/StaffWorkflowSet.js new file mode 100644 index 0000000..242a940 --- /dev/null +++ b/pc4mobx/organization/components/staff/StaffWorkflowSet.js @@ -0,0 +1,121 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer +} from 'mobx-react' +import { + WeaTop, + WeaTab +} from 'ecCom' +import { + Table +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import './index.less'; + +const toJS = mobx.toJS; + +export default class StaffWorkflowSet extends React.Component { + constructor(props) { + super(props); + this.state = { + + } + } + + componentWillMount() { + } + + componentDidMount() { + + } + + componentWillReceiveProps(nextProps) { + + } + + + render() { + + const columns = [{ + title: '动作名称', + dataIndex: 'name', + }, { + title: '动作标识', + dataIndex: 'id', + }, { + title: '动作类文件', + dataIndex: 'url', + }, { + title: '参数', + dataIndex: 'param', + }]; + + const data = [{ + key: '1', + name: '冻结', + id: 'staffDeduction', + url: 'weaver.interfaces.organization.action.StaffChangeAction', + param:'changeType=3' + }, { + key: '2', + name: '扣减', + id: 'staffDeduction', + url: 'weaver.interfaces.organization.action.StaffChangeAction', + param:'changeType=5' + }, { + key: '3', + name: '释放', + id: 'staffDeduction', + url: 'weaver.interfaces.organization.action.StaffChangeAction', + param:'changeType=6' + }]; + + + + return ( +
+ 编制流程设置说明} + icon={} + iconBgcolor="#55D2D4" + /> +
+

+ 1、概述 +

客户可自行通过编制流程配置Action接口完成编制方案数据的更新操作;
+

+

+ 2、编制流程字段说明 +

数据库字段名称需保持一致;
+ +

+

+ 3、Action配置示例 +

编制控制接口(冻结接口,扣减接口,释放接口);
+ +

+

+ 4、接口配置详细 +

+

+ + + + + ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/staff/index.less b/pc4mobx/organization/components/staff/index.less new file mode 100644 index 0000000..2e59f51 --- /dev/null +++ b/pc4mobx/organization/components/staff/index.less @@ -0,0 +1,43 @@ +.staff-workdlow-set { + width: 100%; + height: 100%; + + .content { + width: 100%; + height: 100%; + margin: 0px 20px 60px 30px; + padding: 20px; + font-family: 'Microsoft YaHei'; + white-space: normal; + + p { + font-size: 14px; + display: block; + margin-block-start: 1em; + margin-block-end: 1em; + margin-inline-start: 0px; + margin-inline-end: 0px; + + strong { + font-weight: bold; + color: rgb(63, 63, 63); + } + + img{ + margin-top: 20px; + width: 1200px; + height: 200px; + } + .action { + margin-top: 20px; + width: 1200px; + height: 528px; + } + .action-table { + margin-top: 10px; + width: 1200px; + } + } + + } +} \ No newline at end of file diff --git a/pc4mobx/organization/images/action.jpg b/pc4mobx/organization/images/action.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5e79cf633c8ad92a0fa05c914ec0e8c09015a63d GIT binary patch literal 25488 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 literal 0 HcmV?d00001 diff --git a/pc4mobx/organization/images/workflow.jpg b/pc4mobx/organization/images/workflow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..421100aeca2c522b23c8443d3fdf7b17b56a350e GIT binary patch literal 23157 zcmd?RXIN8d*ESp#bi~4pj-nLNk)j|VDor3*L8L@V2-2b=A|+Jmh9Hi^C{3wK3r?sB z5NSbL0xBRNASFZ+ASfjg2th)ENl5rM&OOfD_xn8WaeRNi?|9#5ABt>~y|1#@Ue`L$ zbFJ&)6>GB{QnFGY5NL<_r3{}IdF zm5{x8b8H93_FYZS%LXjvvGu=KnD#zmX;Iesp4U#LP2K zU08+7hzs#<1n28yG8?g^jOwZnX7rAwZ1`(t0*;lbgr~<0a_1;|FudECk!X2vO9YEr zix8)!F7?Xco0hs}w!y!?;%SdIMFeveUrYNdW-j&`vVA!yem9)h2$;u2D`&pC&kwxD z@ADsz7P1it>5a|-^HaviFKsexu<&R^GHJO`YYfQ?3?)Bc$-k+C7 zD8{GN6&zSlGh_%y`l5M&({yW8rz|wBkm!(_01;<@5-xPe⁢yW`}kE%}R>g~D{IrYR$*W_!f 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 literal 0 HcmV?d00001 diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 0abe74e..aa78e0c 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -28,6 +28,7 @@ import ResourceExtend from "./components/resource/ResourceExtend"; import BasicInfoImport from "./components/import"; import HrmInfoExtend from "./components/resource/HrmInfoExtend"; import NewImport from "./components/newImport" +import StaffWorkflowSet from "./components/staff/StaffWorkflowSet" import stores from "./stores"; import "./style/index"; @@ -89,7 +90,8 @@ const Routes = ( - + + ); From 68af2808ddcc0e245b4d3b42c443a28b3f4c5adc Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 5 Aug 2022 09:22:29 +0800 Subject: [PATCH 049/155] fix --- .../organization/components/department/department.js | 10 +++++++--- pc4mobx/organization/components/job/Job.js | 9 ++++++--- pc4mobx/organization/stores/jobgrade.js | 12 ++++++------ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index df668ac..13c7358 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-07-08 16:50:58 + * @LastEditTime: 2022-08-03 15:11:19 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -177,14 +177,15 @@ export default class Department extends React.Component { window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${id}`, "_blank") } - copy() { + copy(id) { const { department } = this.props; const { selectedRowKeys } = department; - let keys = toJS(selectedRowKeys).toString(); + + let keys = id == undefined ? toJS(selectedRowKeys).toString() : id; department.setIds(keys); confirm({ title: i18n.confirm.defaultTitle(), @@ -377,6 +378,9 @@ export default class Department extends React.Component { { _this.select(record.id) }}>联查岗位 + + { _this.copy(record.id) }}>复制 + ) return diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 926b46b..960174c 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-07-15 14:36:46 + * @LastEditTime: 2022-08-03 15:13:55 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -160,14 +160,14 @@ export default class Job extends React.Component { } - copy() { + copy(id) { const { job } = this.props; const { selectedRowKeys, } = job; - let keys = toJS(selectedRowKeys).toString(); + let keys = id == undefined ? toJS(selectedRowKeys).toString() : id; job.setIds(keys); confirm({ title: i18n.confirm.defaultTitle(), @@ -352,6 +352,9 @@ export default class Job extends React.Component { { _this.merge(record.id) }}>合并 + + { _this.copy(record.id) }}>复制 + ) return diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 489b9bb..242e4a8 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -301,12 +301,12 @@ export class JobGradeStore { currenttime: currenttime, [id_key]:"''" } - // this.condition[0].items[4].browserConditionParam.dataParams = { - // ...this.condition[0].items[4].browserConditionParam.dataParams, - // [key]: val, - // currenttime: currenttime, - // [id_key]:"''" - // } + this.condition[0].items[4].browserConditionParam.dataParams = { + ...this.condition[0].items[4].browserConditionParam.dataParams, + [key]: val, + currenttime: currenttime, + [id_key]:"''" + } this.condition[0].items[4].browserConditionParam.destDataParams = { ...this.condition[0].items[4].browserConditionParam.destDataParams, [key]: val, From 919b778398616523887e0d6a5aa3dabe305b32c0 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 17 Aug 2022 15:13:26 +0800 Subject: [PATCH 050/155] fixed --- .../components/NewAndEditDialog.js | 3 ++ .../organization/components/staff/Staff.js | 2 + pc4mobx/organization/stores/staff.js | 38 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index c041255..be503bb 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -69,6 +69,9 @@ export default class NewAndEditDialog extends React.Component { if (moduleName == 'job' && (data.sequence_id || data.grade_id)) { bindChangeEnvent(data); } + if (moduleName == 'staff' && data.planId) { + bindChangeEnvent(data); + } }; onBlur = data => { diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 555ed9c..1d2dd36 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -517,6 +517,8 @@ export default class Staff extends React.Component { conditionLen={3} save={() => this.handleSave()} onCancel={() => staff.setVisible(false)} + moduleName={"staff"} + bindChangeEnvent={val => staff.updateConditions(val)} /> ) diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index aeff9ba..aa06b70 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -28,6 +28,7 @@ export class StaffStore { @observable topMenu = [] @observable rightMenu = []; @observable condition = []; + fcondition = []; @observable leftCondition = []; @observable searchCondition = []; @observable isEdit = true; @@ -170,6 +171,7 @@ export class StaffStore { Api.getForm(params).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); + res.data.condition && this.setFcondition(res.data.condition); res.data.condition && this.setCondition(res.data.condition); res.data.condition && this.form.initFormFields(res.data.condition); } else { @@ -178,7 +180,39 @@ export class StaffStore { }, error => { message.warning(error.msg); }) + } + updateConditions(data) { + this.form.updateFields({ + compId: { + value: '' + }, + deptId: { + value: '' + }, + jobId: { + value: '' + } + }); + const type = data.planId.valueObj[0].control_dimensions; + this.condition = this.fcondition; + switch(type) { + case '分部': + this.condition[0].items = this.condition[0].items.filter(item => { + return (item.domkey[0] != 'deptId' && item.domkey[0] != 'jobId') + }); + break; + case '部门': + this.condition[0].items = this.condition[0].items.filter(item => { + return item.domkey[0] != 'jobId' + }) + break; + case '岗位': + break; + + } + this.setCondition(this.condition); + this.form.initFormFields(this.condition); } getSearchCondition() { @@ -321,5 +355,9 @@ export class StaffStore { this.getTableInfo(); } + setFcondition(condition) { + this.fcondition = condition; + } + } \ No newline at end of file From 1d9ac506e84623387ead2d1ef286cb18247a0729 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 18 Aug 2022 17:42:15 +0800 Subject: [PATCH 051/155] =?UTF-8?q?=E6=9D=83=E9=99=90=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/newImport.js | 5 +++++ .../fieldDefinedSet/FieldDefined.js | 4 ++-- .../components/newImport/index.js | 19 ++++++++++++++----- .../components/office/officeManage.js | 2 +- .../components/postionrank/JobGrade.js | 2 +- pc4mobx/organization/stores/fieldDefined.js | 4 +++- pc4mobx/organization/stores/jobgrade.js | 2 +- pc4mobx/organization/stores/newImport.js | 13 +++++++++++++ pc4mobx/organization/stores/officeManage.js | 2 +- 9 files changed, 41 insertions(+), 12 deletions(-) diff --git a/pc4mobx/organization/apis/newImport.js b/pc4mobx/organization/apis/newImport.js index e334637..eac6738 100644 --- a/pc4mobx/organization/apis/newImport.js +++ b/pc4mobx/organization/apis/newImport.js @@ -1,5 +1,10 @@ import { WeaTools } from 'ecCom' +//导入页面权限 +export const getHasRight = () => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getHasRight`, 'GET'); +} + //选择导入字段 export const getImportFields = (params) => { return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportFields`, 'GET', params); diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index c2812e6..26239ac 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -87,7 +87,8 @@ export default class FieldDefined extends Component { } = this.props, { //containerInitFinished,//权限验证 refreshMainTabComponent, - spinning + spinning, + hasRight } = store, { type: moduleType } = params, { @@ -143,7 +144,6 @@ export default class FieldDefined extends Component { } } let children = []; - const hasRight = true;//todo if (hasRight) { const { data, diff --git a/pc4mobx/organization/components/newImport/index.js b/pc4mobx/organization/components/newImport/index.js index 07a5237..8ce9ed4 100644 --- a/pc4mobx/organization/components/newImport/index.js +++ b/pc4mobx/organization/components/newImport/index.js @@ -21,6 +21,8 @@ import { import '../../style/import.css'; import { addContentPath } from '../../util/index.js'; import StepDialog from './stepDialog'; +import { renderNoright } from '../../util'; + @inject("newImport") @@ -34,12 +36,14 @@ export default class newImport extends React.Component { }) } - componentWillMount() { - + componentDidMount() { + const {newImport} = this.props; + newImport.getHasRight(); } - componentDidMount() { + componentWillMount() { + } @@ -120,13 +124,18 @@ export default class newImport extends React.Component { const { newImport, } = this.props, { - visible + visible, + hasRight } = newImport, { title, } = this.state; + if (hasRight === false) { + return renderNoright(); + } + return ( - } iconBgcolor='#217346' diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index b8e2535..34b4587 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -422,7 +422,7 @@ export default class OfficeManage extends Component { } return ( -
+ hasRight &&
{ tabConfig.activeTabKey = key || tabConfig.tabs[0].viewCondition; const tabIndex = this.getTabIndex(this.tabConfig.tabs, key); @@ -697,6 +698,7 @@ export class FieldDefinedStore extends HrmBaseStore { datas, selectedData } = this.convertData(res.data.data, 'fieldDef'); + this.hasRight = res.data.hasRight; this.encryptEnable = res.data.encryptEnable; this.tableEditConfig.fieldDef.datas = datas; this.tableEditConfig.fieldDef.columns = this.getColumns(); diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 242e4a8..0a69083 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -48,7 +48,7 @@ export class JobGradeStore { @observable topTab = []; @observable topTabCount = {}; @observable lastime = '';// - @observable hasRight = true; + @observable hasRight = ''; @observable treeLoading = true; @observable treeConfig = { diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js index fe64764..8ff836e 100644 --- a/pc4mobx/organization/stores/newImport.js +++ b/pc4mobx/organization/stores/newImport.js @@ -40,6 +40,19 @@ import { export class newImportStore { + @observable hasRight = ''; + @action getHasRight(){ + API.getHasRight().then(res => { + if(res.code == 200) { + this.hasRight = res.data.hasRight; + }else { + message.warning(res.msg); + } + },error => { + message.warning(error.msg); + }) + } + /********************* cardConfig *********************/ cardConfig = [ { diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js index 87c5cd3..1966840 100644 --- a/pc4mobx/organization/stores/officeManage.js +++ b/pc4mobx/organization/stores/officeManage.js @@ -30,7 +30,7 @@ export class OfficeManageStore { @observable dialogLoading = false; @observable schemeId = ""; @observable date = ""; - @observable hasRight = ""; + @observable hasRight = ''; @action setOfficeClassifyId(id) { From 7ba0a51fd47e62289885830d5846c6409957027a Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Mon, 22 Aug 2022 16:13:10 +0800 Subject: [PATCH 052/155] =?UTF-8?q?=E8=81=8C=E5=8A=A1=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=A0=91=E6=8A=98=E5=8F=A0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/components/office/components/leftTree.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pc4mobx/organization/components/office/components/leftTree.js b/pc4mobx/organization/components/office/components/leftTree.js index bb12530..e8d7f80 100644 --- a/pc4mobx/organization/components/office/components/leftTree.js +++ b/pc4mobx/organization/components/office/components/leftTree.js @@ -253,9 +253,10 @@ class LeftTree extends Component { }); }; - onExpand = expandedKeys => { + onExpand = keys => { + const { expandedKeys } = this.state; this.setState({ - expandedKeys + expandedKeys: expandedKeys.includes("-1") ? [] : keys }); }; From 07d2ff983209f4a9dc2d13c6e839ae492cb15272 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 22 Aug 2022 16:19:22 +0800 Subject: [PATCH 053/155] fixed --- .../components/postionrank/JobLevel.js | 1 - pc4mobx/organization/index.js | 1 + pc4mobx/organization/stores/fieldDefined.js | 4 +- pc4mobx/organization/stores/jobextend.js | 172 +++++++++++------- pc4mobx/organization/stores/newImport.js | 6 +- pc4mobx/organization/stores/rankscheme.js | 2 +- 6 files changed, 115 insertions(+), 71 deletions(-) diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index 0b1a491..bdc99c2 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -51,7 +51,6 @@ export default class JobLevel extends React.Component { } componentDidMount() { - this.init(); } componentWillReceiveProps(nextProps) { diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index aa78e0c..0819a6d 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -1,5 +1,6 @@ import React from "react"; import Route from "react-router/lib/Route"; +import { message } from "antd"; import { WeaLocaleProvider } from "ecCom"; import Home from "./components/Home"; import SimpleOrg from "./components/tree/index"; diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 2a1980b..3602dad 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-08-18 13:53:57 + * @LastEditTime: 2022-08-22 15:25:05 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -227,7 +227,7 @@ export class FieldDefinedStore extends HrmBaseStore { key: 'fieldType', useRecord: true, colSpan: 1, - width: "30%", + width: "40%", com: [{ label: '', type: 'CUSTOMFIELD', diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index c1ba6bc..c64f000 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -128,8 +128,25 @@ export class JobExtendStore { } Api.getJobExtendForm(params).then((res) => { if (res.code === 200) { - res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); - res.data.result.conditions && this.setCondition(res.data.result.conditions); + //默认职级职等范围 + let conditions = res.data.result.conditions; + if(this.isEditor == true && this.selectedKey == '0'){ + let currenttime = 1657247378274; + let key0 = `scheme_id_${currenttime}`; + let key1 = `level_id_${currenttime}`; + let key2 = `scheme_id_${currenttime}`; + let label = "职级" + const index1 = findIndex(conditions[1].items, { label }); + label = "职等" + const index2 = findIndex(conditions[1].items, { label }); + let schemeId = conditions[1].items[1].browserConditionParam.replaceDatas[0].id; + let levelIds = res.data.levelIds; + this.rangeLimit(key0,schemeId,index1,currenttime,conditions); + this.rangeLimitLevel(key1,key2,index2,levelIds,currenttime,conditions) + } + + res.data.result.conditions && this.form.initFormFields(conditions); + res.data.result.conditions && this.setCondition(conditions); this.tableInfo = this.handleTable(res.data.result.tables); this.getTabInfo(); res.data.result.buttons && this.setButtons(res.data.result.buttons); @@ -173,7 +190,12 @@ export class JobExtendStore { updateConditions(data) { if (data.sequence_id) { if (data.sequence_id.valueObj.length > 0) { - let label = "等级方案" + let label = "岗位序列"; + const item = findIndex(this.condition[1].items, { label }); + this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].sequence_names, id: data.sequence_id.value }]; + this.condition[1].items[2].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; + this.condition[1].items[3].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; + label = "等级方案" const index = findIndex(this.condition[1].items, { label }); const schemeId = data.sequence_id.valueObj[0].scheme_values; this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; @@ -182,43 +204,33 @@ export class JobExtendStore { const index1 = findIndex(this.condition[1].items, { label }); let currenttime = 1657247378274 let key = `scheme_id_${currenttime}`; - this.condition[1].items[index1].browserConditionParam.completeParams = { - ...this.condition[1].items[index1].browserConditionParam.completeParams, - [key]: schemeId, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.conditionDataParams = { - ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, - [key]: schemeId, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.dataParams = { - ...this.condition[1].items[index1].browserConditionParam.dataParams, - [key]: schemeId, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.destDataParams = { - ...this.condition[1].items[index1].browserConditionParam.destDataParams, - [key]: schemeId, - currenttime: currenttime - } - } - this.form.updateFields({ - scheme_id: { - value: '' - }, - level_id: { - value: '' - }, - grade_id: { - value: '' - } - }); + let condition = this.rangeLimit(key,schemeId,index1,currenttime,this.condition); + this.form.updateFields({ + scheme_id: { + value: schemeId + }, + level_id: { + value: '' + }, + grade_id: { + value: '' + } + }); + this.setCondition(condition); + this.form.initFormFields(condition); + } } else if (data.grade_id) { - if (data.grade_id.valueObj.length > 0) { - //清空职等并限制范围 + let condition = this.condition; + //清空职等并限制范围 let label = "职等" const index2 = findIndex(this.condition[1].items, { label }); + this.condition[1].items[index2].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; + label = "职级"; + const item = findIndex(this.condition[1].items, { label }); + let grade_names = data.grade_id.valueObj.length > 0 ? data.grade_id.valueObj[0].grade_names : ""; + let value = data.grade_id.valueObj.length > 0 ? data.grade_id.value : ""; + this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: grade_names, id: value }]; + if (data.grade_id.valueObj.length > 0) { let currenttime = 1657247378274; let key1 = `level_id_${currenttime}`; let key2 = `scheme_id_${currenttime}`; @@ -228,46 +240,78 @@ export class JobExtendStore { Api.getLevelId(params).then(res => { if (res.code === 200) { const levelId = res.data; - this.condition[1].items[index2].browserConditionParam.completeParams = { - ...this.condition[1].items[index2].browserConditionParam.completeParams, - [key1]: levelId, - [key2]: "''", - currenttime: currenttime - } - this.condition[1].items[index2].browserConditionParam.conditionDataParams = { - ...this.condition[1].items[index2].browserConditionParam.conditionDataParams, - [key1]: levelId, - [key2]: "''", - currenttime: currenttime - } - this.condition[1].items[index2].browserConditionParam.dataParams = { - ...this.condition[1].items[index2].browserConditionParam.dataParams, - [key1]: levelId, - [key2]: "''", - currenttime: currenttime - } - this.condition[1].items[index2].browserConditionParam.destDataParams = { - ...this.condition[1].items[index2].browserConditionParam.destDataParams, - [key]: levelId, - [key2]: "''", - currenttime: currenttime - } + condition = this.rangeLimitLevel(key1,key2,index2,levelId,currenttime,this.condition); } else { message.warning(res.msg); } }, error => { message.warning(error.msg); }) - + } this.form.updateFields({ level_id: { value: '' } }); + this.setCondition(condition); + this.form.initFormFields(condition); + } - this.setCondition(this.condition); - //this.form.initFormFields(this.condition); + } + + rangeLimit(key,value,index,currenttime,condition) { + condition[1].items[index].browserConditionParam.completeParams = { + ...condition[1].items[index].browserConditionParam.completeParams, + [key]: value, + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.conditionDataParams = { + ...condition[1].items[index].browserConditionParam.conditionDataParams, + [key]: value, + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.dataParams = { + ...condition[1].items[index].browserConditionParam.dataParams, + [key]: value, + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.destDataParams = { + ...condition[1].items[index].browserConditionParam.destDataParams, + [key]: value, + currenttime: currenttime + } + return condition; + } + + rangeLimitLevel(key1,key2,index,value,currenttime,condition) { + condition[1].items[index].browserConditionParam.completeParams = { + ...condition[1].items[index].browserConditionParam.completeParams, + [key1]: value, + [key2]: "''", + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.conditionDataParams = { + ...condition[1].items[index].browserConditionParam.conditionDataParams, + [key1]: value, + [key2]: "''", + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.dataParams = { + ...condition[1].items[index].browserConditionParam.dataParams, + [key1]: value, + [key2]: "''", + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.destDataParams = { + ...condition[1].items[index].browserConditionParam.destDataParams, + [key]: value, + [key2]: "''", + currenttime: currenttime + } + + return condition; + } setLoading(val) { diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js index 8ff836e..220dd76 100644 --- a/pc4mobx/organization/stores/newImport.js +++ b/pc4mobx/organization/stores/newImport.js @@ -61,7 +61,7 @@ export class newImportStore { "icon": "icon-coms-Department-number", "title": "分部", "linkName": "分部导入", - "url": "/spa/hrm/engine.html#/hrmengine/organization" + "url": "/spa/organization/static/index.html#/main/organization/company" }, { "subTitle": "部门设置", @@ -69,7 +69,7 @@ export class newImportStore { "icon": "icon-coms-Department-number", "title": "部门", "linkName": "部门导入", - "url": "/spa/hrm/engine.html#/hrmengine/organization" + "url": "/spa/organization/static/index.html#/main/organization/department" }, { "subTitle": "岗位设置", @@ -77,7 +77,7 @@ export class newImportStore { "icon": "icon-coms-hrm", "title": "岗位", "linkName": "岗位体系导入", - "url": "/spa/hrm/engine.html#/hrmengine/post" + "url": "/spa/organization/static/index.html#/main/organization/job" }, { "subTitle": "组织维护", diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js index 955f10a..f8a18b0 100644 --- a/pc4mobx/organization/stores/rankscheme.js +++ b/pc4mobx/organization/stores/rankscheme.js @@ -85,8 +85,8 @@ export class RankSchemeStore { return response.json() }).then(data => { if (data.code === 200) { - message.success(i18n.message.deleteSuccess()); this.getTableInfo(); + message.success(i18n.message.deleteSuccess()); } else { message.warning(data.msg); } From 766df1a6349179a128f1fa758560fbbb8cd1c67a Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 23 Aug 2022 17:53:21 +0800 Subject: [PATCH 054/155] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/apis/resourceBasicInfo.js | 0 .../organization/components/group/Group.js | 7 +- .../components/postionrank/JobLevel.js | 1 + .../components/postionrank/RankScheme.js | 6 + .../components/resource/ResourceBasicInfo.js | 467 ++++++++++++++++++ pc4mobx/organization/index.js | 2 + pc4mobx/organization/public/i18n.js | 3 +- pc4mobx/organization/stores/group.js | 14 +- pc4mobx/organization/stores/index.js | 4 +- .../organization/stores/reserouseBasicInfo.js | 385 +++++++++++++++ pc4mobx/organization/style/common.less | 4 + 11 files changed, 888 insertions(+), 5 deletions(-) create mode 100644 pc4mobx/organization/apis/resourceBasicInfo.js create mode 100644 pc4mobx/organization/components/resource/ResourceBasicInfo.js create mode 100644 pc4mobx/organization/stores/reserouseBasicInfo.js diff --git a/pc4mobx/organization/apis/resourceBasicInfo.js b/pc4mobx/organization/apis/resourceBasicInfo.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/components/group/Group.js b/pc4mobx/organization/components/group/Group.js index 60ee893..7880bfb 100644 --- a/pc4mobx/organization/components/group/Group.js +++ b/pc4mobx/organization/components/group/Group.js @@ -175,7 +175,7 @@ export default class Group extends React.Component { group } = this.props; const { - nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey,date,hasRight + nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey, date, hasRight,loading } = group; if (hasRight === false) { @@ -205,7 +205,10 @@ export default class Group extends React.Component { onChange={this.changeData.bind(this)} />
- {this.getFormField()} + { + loading ?
+ +
: this.getFormField()}
diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index bdc99c2..0b1a491 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -51,6 +51,7 @@ export default class JobLevel extends React.Component { } componentDidMount() { + this.init(); } componentWillReceiveProps(nextProps) { diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 24883d9..a569b53 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -54,6 +54,12 @@ export default class RankScheme extends React.Component { this.init(); } + componentWillUnmount() { + debugger + alert('组件销毁?') + } + + componentWillReceiveProps(nextProps) { const { rankScheme diff --git a/pc4mobx/organization/components/resource/ResourceBasicInfo.js b/pc4mobx/organization/components/resource/ResourceBasicInfo.js new file mode 100644 index 0000000..1dbb5b7 --- /dev/null +++ b/pc4mobx/organization/components/resource/ResourceBasicInfo.js @@ -0,0 +1,467 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, + WeaLeftRightLayout, + WeaLeftTree +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; + +import NewAndEditDialog from '../NewAndEditDialog'; +import { renderNoright } from '../../util'; + + +const toJS = mobx.toJS; +const confirm = Modal.confirm; +const WeaTable = WeaTableNew.WeaTable; + + +@inject('resourceBasicInfo') +@observer +export default class ResourceBasicInfo extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + const { + resourceBasicInfo + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + resourceBasicInfo + } = this.props; + resourceBasicInfo.getHasRight(); + resourceBasicInfo.initData(); + } + + getTopMenuBtns() { + const { + resourceBasicInfo + } = this.props; + const { + topMenu, + tableStore + } = resourceBasicInfo; + + let btns = []; + topMenu.map((item, i) => { + if (item.menuFun !== 'batchDelete') { + btns.push(); + } else { + btns.push(); + } + + }); + + return btns; + } + + handleClick(item) { + const { + resourceBasicInfo + } = this.props; + const { + isPanelShow + } = resourceBasicInfo; + + isPanelShow && resourceBasicInfo.setPanelStatus(false); + this[item.menuFun] && this[item.menuFun](); + } + + new() { + const { + resourceBasicInfo + } = this.props; + + resourceBasicInfo.setNeDialogTitle(i18n.label.newJobLevel()); + resourceBasicInfo.setIsNew(true); + resourceBasicInfo.setVisible(true); + resourceBasicInfo.getForm(); + } + + batchDelete() { + const { + resourceBasicInfo + } = this.props; + const { + tableStore + } = resourceBasicInfo; + + let keys = toJS(tableStore.selectedRowKeys).toString(); + resourceBasicInfo.setIds(keys); + this.showConfirm('batchDel'); + } + showConfirm(v) { + let _this = this; + confirm({ + title: i18n.confirm.defaultTitle(), + content: (v == 'del') ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + _this.onOk(); + }, + onCancel() { + return false; + }, + }); + } + onOk() { + const { + resourceBasicInfo + } = this.props; + resourceBasicInfo.delete(); + } + + + getDropMenuDatas() { + const { + resourceBasicInfo + } = this.props; + const { + rightMenu + } = resourceBasicInfo; + + let menus = []; + toJS(rightMenu).map((item, index) => { + let obj = { + key: item.menuFun, + icon: , + content: item.menuName, + } + if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { + obj.disabled = true; + } + menus.push(obj); + }) + return menus; + } + + handleMenuClick(key) { + const { + resourceBasicInfo + } = this.props; + const { + isPanelShow + } = resourceBasicInfo; + + isPanelShow && resourceBasicInfo.setPanelStatus(false); + this[key] && this[key](); + } + + getTabBtn() { + const { + resourceBasicInfo + } = this.props; + const { + form2 + } = resourceBasicInfo; + + const btn = [ + (), + (), + (), + ]; + + return btn; + } + + onSearchChange(val) { + const { + resourceBasicInfo + } = this.props; + const { + form2 + } = resourceBasicInfo; + + resourceBasicInfo.setLevelName(val); + !this.isEmptyObject(form2.getFormParams()) && resourceBasicInfo.updateFields(val); + } + + changeData(key) { + const { + resourceBasicInfo + } = this.props; + resourceBasicInfo.changeData(key); + } + + reRenderColumns(columns) { + let _this = this; + columns.forEach((c, index) => { + if (c.dataIndex == 'forbidden_tag') { + c.render = function (text, record) { + return _this.updateForbiddenTag(checked, record.id)} /> + } + }; + }) + } + + updateForbiddenTag(checked, id) { + const { + resourceBasicInfo + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + resourceBasicInfo.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); + } + + onOperatesClick(record, rowIndex, operate) { + const { + index + } = operate; + (index == '0') && this.doEdit(record.randomFieldId); + (index == '1') && this.doDel(record.randomFieldId); + } + + custom = () => { + const { + resourceBasicInfo + } = this.props, { + tableStore, + } = resourceBasicInfo; + + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + } + + doEdit(id) { + const { + resourceBasicInfo + } = this.props; + + resourceBasicInfo.setNeDialogTitle(i18n.label.editJobLevel()); + resourceBasicInfo.setLevelId(id); + resourceBasicInfo.setIsNew(false); + resourceBasicInfo.setVisible(true); + resourceBasicInfo.getForm(); + } + + doDel(id) { + const { + resourceBasicInfo + } = this.props; + resourceBasicInfo.setIds(id); + this.showConfirm('del'); + } + + + handleSave() { + const { + resourceBasicInfo + } = this.props; + const { + isNew + } = resourceBasicInfo; + + isNew && resourceBasicInfo.save(); + !isNew && resourceBasicInfo.edit(); + } + + getPanelComponents() { + const { + resourceBasicInfo + } = this.props; + const { + searchCondition, + form2, + searchConditionLoading + } = resourceBasicInfo; + + let arr = []; + let formParams = form2.getFormParams(); + const { + isFormInit + } = form2; + + isFormInit && searchCondition.map(c => { + c.items.map((field, index) => { + arr.push(
+
+ + {} + +
+ ) + }) + }) + + if (searchConditionLoading) { + return ( +
+ +
+ ) + } else { + return { + if (e.keyCode == 13 && e.target.tagName === "INPUT") { + resourceBasicInfo.getTableInfo(); + resourceBasicInfo.setPanelStatus(false) + } + }}>{arr} + } + + } + + //非空判断 + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + + log = () => { + window.setLogViewProp({ + logMoudleType: 2, + keys: new Date().getTime(), + }); + } + + + render() { + + const { + resourceBasicInfo + } = this.props; + const { + isPanelShow, form2, levelName, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading + } = resourceBasicInfo; + + if (hasRight === false) { + return renderNoright(); + } + + const { + data, + onSelectedTreeNode, + selectedKeys, + onExpand, + treeExpandKeys + } = toJS(treeConfig); + const treeCom = ( + + ) + + return ( + hasRight &&
+ this.handleMenuClick(key)} + > + } + iconBgcolor='#217346' + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={(e) => this.handleMenuClick(e)} + > + + + resourceBasicInfo.setPanelStatus(bool)} + hideSearchAd={() => resourceBasicInfo.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => resourceBasicInfo.getTableInfo()} + onSearchChange={val => this.onSearchChange(val)} + /> + this.reRenderColumns(c)} + onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} + /> +
+
+
+ this.handleSave()} + onCancel={() => resourceBasicInfo.setVisible(false)} + /> +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 0819a6d..b77ee0c 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -30,6 +30,7 @@ import BasicInfoImport from "./components/import"; import HrmInfoExtend from "./components/resource/HrmInfoExtend"; import NewImport from "./components/newImport" import StaffWorkflowSet from "./components/staff/StaffWorkflowSet" +import ResourceBasicInfo from "./components/resource/ResourceBasicInfo"; import stores from "./stores"; import "./style/index"; @@ -92,6 +93,7 @@ const Routes = ( + ); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 655e455..05779cc 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -157,7 +157,8 @@ export const i18n = { ResourceName: () => getLabel(385936, '人员'), newPeople: () => getLabel(386246, '新建人员'), resourceMange: () => getLabel(386246, '人员管理'), - + resourceBasicInfo: () => getLabel(386246, '人员信息'), + authorizationGroup: () => getLabel(492, '权限组'), allAuthorization: () => getLabel(33363, '全部权限'), diff --git a/pc4mobx/organization/stores/group.js b/pc4mobx/organization/stores/group.js index e8eb1d7..8cbaed4 100644 --- a/pc4mobx/organization/stores/group.js +++ b/pc4mobx/organization/stores/group.js @@ -32,6 +32,7 @@ export class GroupStore { @observable topTab = []; @observable date = ''; @observable hasRight = ''; + @observable loading = true; @action getGroupForm() { @@ -39,10 +40,13 @@ export class GroupStore { viewattr: 1, id: 1 } + this.setLoading(true); + this.form1 = new WeaForm(); Api.getGroupForm(params).then(res => { if (res.code === 200) { res.data.condition && this.setGroupCondition(res.data.condition); res.data.condition && this.form1.initFormFields(res.data.condition); + this.setLoading(false); } else { message.warning(res.msg); } @@ -90,8 +94,8 @@ export class GroupStore { return response.json() }).then(data => { if (data.code === 200) { - message.success(data.msg); this.getGroupForm(); + message.success(data.msg); this.setVisible(false); } else { message.warning(data.msg); @@ -165,4 +169,12 @@ export class GroupStore { this.hasRight = bool; } + setDate(date) { + this.date = date; + } + + setLoading(bool) { + this.loading = bool; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 45a7974..9648672 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -23,6 +23,7 @@ import {HrmImportResource} from "./importresource"; import {HrmImportCommon} from "./importCommon"; import {HrmBasicDataImport} from "./import"; import {newImportStore} from "./newImport"; +import {ResourceBasicInfoStore} from "./reserouseBasicInfo" module.exports = { @@ -50,5 +51,6 @@ module.exports = { hrmImportResource:new HrmImportResource(), hrmImportCommon:new HrmImportCommon(), hrmBasicDataImport:new HrmBasicDataImport(), - newImport: new newImportStore() + newImport: new newImportStore(), + resourceBasicInfo: new ResourceBasicInfoStore(), }; diff --git a/pc4mobx/organization/stores/reserouseBasicInfo.js b/pc4mobx/organization/stores/reserouseBasicInfo.js new file mode 100644 index 0000000..5078808 --- /dev/null +++ b/pc4mobx/organization/stores/reserouseBasicInfo.js @@ -0,0 +1,385 @@ +import { + observable, + action +} from 'mobx'; +import * as mobx from 'mobx'; +import * as Api from '../apis/joblevel'; // 引入API接口文件 +import { + WeaForm +} from 'comsMobx'; +import { + WeaTableNew +} from 'comsMobx'; +import { + Modal, + message, +} from 'antd' +import { + i18n +} from '../public/i18n'; + +const toJS = mobx.toJS; +const { + TableStore +} = WeaTableNew; + +export class ResourceBasicInfoStore { + @observable tableStore = new TableStore(); + @observable topMenu = [] + @observable rightMenu = []; + @observable condition = []; + @observable searchCondition = []; + @observable isEdit = true; + @observable isNew = true; + @observable isPanelShow = false; //高级搜索面板 + @observable form2 = new WeaForm(); + @observable form = new WeaForm(); + @observable form1 = new WeaForm(); + @observable levelName = ''; + @observable conditionNum = 2; + @observable ids = ''; //选择行id + @observable searchConditionLoading = true; + @observable nEdialogTitle = ''; + @observable visible = false; + @observable dialogLoading = true; + @observable levelId = ''; + @observable date = ''; + @observable selectedKey = -1; + @observable topTab = []; + @observable topTabCount = {}; + @observable hasRight = ''; + @observable treeLoading = true; + + @observable treeConfig = { + data: [], + selectedKeys: [], + treeExpandKeys: [], + onExpand: (keys) => { + this.treeConfig.treeExpandKeys = keys; + }, + onSelectedTreeNode: (key, count, countType) => { + this.treeConfig.selectedKeys = [key]; + this.selectedTreeNodeInfo = countType.node.props.data; + this.getTableInfo(); + } + } + //选中树节点的信息 + @observable selectedTreeNodeInfo; + + @action initData = () => { + this.selectedTreeNodeInfo = null; + this.treeConfig.treeExpandKeys.length = 0; + Api.getTree().then(res => { + if (res.code === 200) { + if (res.data.length > 0) { + this.treeConfig.data = res.data; + this.treeConfig.selectedKeys = [res.data[0].key]; + this.treeConfig.treeExpandKeys = "-1"; + this.selectedTreeNodeInfo = res.data[0]; + this.getTableInfo(); + this.setTreeLoading(false); + } + } else { + message.error(res.msg); + } + }, error => { }) + } + + + @action + getTableInfo() { + let params = { + schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, + } + this.tableStore = new TableStore(); + if (this.isEmptyObject(this.form2.getFormParams())) { + params = { + ...params, + levelName: this.levelName, + }; + } else { + params = { + ...params, + ...this.form2.getFormParams(), + }; + } + Api.getSearchList(params).then(res => { + if (res.code === 200) { + this.setHasRight(res.data.hasRight); + res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + } + + //删除 + delete() { + let params = { + ids: this.ids + }; + Api.deleteTableData(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(i18n.message.deleteSuccess()); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + + save() { + let params = { + ...this.form.getFormParams() + }; + this.form.validateForm().then(f => { + if (f.isValid) { + Api.add(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + edit() { + let params = { ...this.form.getFormParams(), id: this.levelId }; + this.form.validateForm().then(f => { + if (f.isValid) { + Api.edit(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + this.setVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + changeData(key) { + this.setSelectedKey(key); + this.getTableInfo(); + } + + updateForbiddenTag(checked, id) { + let params = { + forbiddenTag: checked, + id: id + } + Api.updateForbiddenTag(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + + getForm() { + let params = this.isNew ? {} : { + id: this.levelId + } + this.setDialogLoadingStatus(true); + Api.getLevelForm(params).then(res => { + if (res.code === 200) { + this.setDialogLoadingStatus(false); + res.data.condition && this.setCondition(res.data.condition); + res.data.condition && this.form.initFormFields(res.data.condition); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + + } + + getSearchCondition() { + this.setScLoadingStatus(false); + Api.getAdvanceSearchCondition().then(res => { + if (res.code === 200) { + this.setScLoadingStatus(false); + res.data.conditions && this.setSearchCondition(res.data.conditions); + res.data.conditions && this.form2.initFormFields(res.data.conditions); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action + getTabInfo() { + Api.getTabInfo().then(res => { + if (res.code === 200) { + res.data.topTabs && this.setTopTab(res.data.topTabs); + res.data.topTabCount && this.setTopTabCount(res.data.topTabCount); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + + @action + getHasRight() { + Api.getHasRight().then(res => { + if (res.code === 200) { + res.data.rightMenu && this.setRightMenu(res.data.rightMenu); + res.data.topMenu && this.setTopMenu(res.data.topMenu); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + updateFields(val) { + this.form2.updateFields({ + levelName: { + value: val + } + }); + } + + setSearchCondition(condition) { + this.searchCondition = condition; + } + + setScLoadingStatus(bool) { + this.searchConditionLoading = bool; + } + + setPanelStatus(bool) { + this.isPanelShow = bool; + bool && this.getSearchCondition(); + if (!bool) { + this.scLoadingReset(); + } + } + + setLevelName(val) { + this.levelName = val; + } + + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + setIds(ids) { + this.ids = ids; + } + + scLoadingReset() { + this.searchConditionLoading = true; + } + + + formReset() { + this.form = new WeaForm(); + } + + dialogLoadingReset() { + this.dialogLoading = true; + } + + setVisible(bool) { + this.visible = bool; + this.formReset(); + !bool && this.dialogLoadingReset(); + } + + setDialogLoadingStatus(bool) { + this.dialogLoading = bool; + } + + setNeDialogTitle(title) { + this.nEdialogTitle = title; + } + + setIsNew(bool) { + this.isNew = bool; + } + + setCondition(condition) { + this.condition = condition; + } + + setLevelId(levelId) { + this.levelId = levelId; + } + + setDate(date) { + this.date = date; + } + + setSelectedKey(selectedKey) { + this.selectedKey = selectedKey; + } + + setTopTab(topTab) { + this.topTab = topTab; + } + + setTopTabCount(topTabCount) { + this.topTabCount = topTabCount; + } + + setTopMenu(topMenu) { + this.topMenu = topMenu; + } + + setRightMenu(rightMenu) { + this.rightMenu = rightMenu; + } + + setHasRight(bool) { + this.hasRight = bool; + } + + setTreeLoading(bool) { + this.treeLoading = bool; + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 5f506ee..411086b 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -46,6 +46,10 @@ overflow: auto; } +.organization-group-loading{ + text-align: center; +} + //公司、分部管理 .hrm-my-cardInfo { padding-bottom: 20px; From 67ccf9cbba13c73b6a54573cf5c6aee6b0ce5fca Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 26 Aug 2022 15:28:50 +0800 Subject: [PATCH 055/155] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/apis/resourceBasicInfo.js | 68 +++++++++++ .../components/resource/ResourceBasicInfo.js | 103 +++++++--------- pc4mobx/organization/public/i18n.js | 4 +- .../organization/stores/reserouseBasicInfo.js | 110 +++++++----------- 4 files changed, 150 insertions(+), 135 deletions(-) diff --git a/pc4mobx/organization/apis/resourceBasicInfo.js b/pc4mobx/organization/apis/resourceBasicInfo.js index e69de29..f827f6d 100644 --- a/pc4mobx/organization/apis/resourceBasicInfo.js +++ b/pc4mobx/organization/apis/resourceBasicInfo.js @@ -0,0 +1,68 @@ + +import { + WeaTools +} from 'ecCom' + +export const getSearchList = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getTable', 'GET', params); +} + +export const deleteTableData = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/delete', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const recoverData = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/recover', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const getAdvanceSearchCondition = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getSearchCondition', 'GET', params); +} + +export const add = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/save', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const edit = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/update', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const getForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getForm', 'GET', params); +} + +export const getHasRight = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getHasRight', 'GET', params); +} + +export const getTree = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getTreeData', 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/resource/ResourceBasicInfo.js b/pc4mobx/organization/components/resource/ResourceBasicInfo.js index 1dbb5b7..8be6c00 100644 --- a/pc4mobx/organization/components/resource/ResourceBasicInfo.js +++ b/pc4mobx/organization/components/resource/ResourceBasicInfo.js @@ -19,7 +19,8 @@ import { Modal, Button, message, - Switch + Switch, + Tag } from 'antd' import { WeaSwitch, @@ -111,7 +112,7 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo } = this.props; - resourceBasicInfo.setNeDialogTitle(i18n.label.newJobLevel()); + resourceBasicInfo.setNeDialogTitle(i18n.label.newResourceBasicInfo()); resourceBasicInfo.setIsNew(true); resourceBasicInfo.setVisible(true); resourceBasicInfo.getForm(); @@ -129,6 +130,7 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo.setIds(keys); this.showConfirm('batchDel'); } + showConfirm(v) { let _this = this; confirm({ @@ -144,6 +146,7 @@ export default class ResourceBasicInfo extends React.Component { }, }); } + onOk() { const { resourceBasicInfo @@ -216,60 +219,27 @@ export default class ResourceBasicInfo extends React.Component { !this.isEmptyObject(form2.getFormParams()) && resourceBasicInfo.updateFields(val); } - changeData(key) { - const { - resourceBasicInfo - } = this.props; - resourceBasicInfo.changeData(key); - } reRenderColumns(columns) { let _this = this; columns.forEach((c, index) => { - if (c.dataIndex == 'forbidden_tag') { + if (c.dataIndex == 'fdelete') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return record.fdelete == '0' ? 正常 : 停用 } }; }) } - updateForbiddenTag(checked, id) { - const { - resourceBasicInfo - } = this.props; - confirm({ - title: i18n.confirm.defaultTitle(), - content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), - okText: i18n.button.ok(), - cancelText: i18n.button.cancel(), - onOk() { - resourceBasicInfo.updateForbiddenTag(checked, id); - }, - onCancel() { - return false; - }, - }); - } - onOperatesClick(record, rowIndex, operate) { const { index } = operate; (index == '0') && this.doEdit(record.randomFieldId); (index == '1') && this.doDel(record.randomFieldId); + (index == '2') && this.doRecover(record.randomFieldId); } - custom = () => { - const { - resourceBasicInfo - } = this.props, { - tableStore, - } = resourceBasicInfo; - - tableStore.setColSetVisible(true); - tableStore.tableColSet(true); - } doEdit(id) { const { @@ -277,7 +247,7 @@ export default class ResourceBasicInfo extends React.Component { } = this.props; resourceBasicInfo.setNeDialogTitle(i18n.label.editJobLevel()); - resourceBasicInfo.setLevelId(id); + resourceBasicInfo.setFId(id); resourceBasicInfo.setIsNew(false); resourceBasicInfo.setVisible(true); resourceBasicInfo.getForm(); @@ -291,6 +261,33 @@ export default class ResourceBasicInfo extends React.Component { this.showConfirm('del'); } + doRecover(id) { + const { + resourceBasicInfo + } = this.props; + this.showRecoverConfirm(id); + } + + showRecoverConfirm(id) { + const { + resourceBasicInfo + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: i18n.confirm.recoverConfirm(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + resourceBasicInfo.recover(id); + }, + onCancel() { + return false; + }, + }); + } + + + handleSave() { const { @@ -363,7 +360,7 @@ export default class ResourceBasicInfo extends React.Component { log = () => { window.setLogViewProp({ - logMoudleType: 2, + logMoudleType: 11, keys: new Date().getTime(), }); } @@ -375,8 +372,8 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo } = this.props; const { - isPanelShow, form2, levelName, conditionNum, tableStore, nEdialogTitle, visible, condition, - form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading + isPanelShow, form2, fname, conditionNum, tableStore, nEdialogTitle, visible, condition, + form, dialogLoading, isEdit, date, hasRight, treeConfig, treeLoading } = resourceBasicInfo; if (hasRight === false) { @@ -393,7 +390,7 @@ export default class ResourceBasicInfo extends React.Component { const treeCom = ( this.handleMenuClick(e)} > - - resourceBasicInfo.setPanelStatus(bool)} - hideSearchAd={() => resourceBasicInfo.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => resourceBasicInfo.getTableInfo()} - onSearchChange={val => this.onSearchChange(val)} - /> getLabel(386246, '新建人员'), resourceMange: () => getLabel(386246, '人员管理'), resourceBasicInfo: () => getLabel(386246, '人员信息'), + newResourceBasicInfo: () => getLabel(386246, '新建人员资料'), + authorizationGroup: () => getLabel(492, '权限组'), @@ -951,7 +953,7 @@ export const i18n = { confirm: { forbiddenTag: () => getLabel(-131329, '确定禁用该记录吗'), enableTag: () => getLabel(-131328, '确定启用该记录吗'), - + recoverConfirm: () => getLabel(-131310, '确定恢复该记录吗'), defaultTitle: () => getLabel(131329, '信息确认'), removeGroupInfo: () => getLabel(383053, '删除分组,该分组下的字段将显示到“基本信息”分组中,确定要删除吗?'), diff --git a/pc4mobx/organization/stores/reserouseBasicInfo.js b/pc4mobx/organization/stores/reserouseBasicInfo.js index 5078808..5fa9ab0 100644 --- a/pc4mobx/organization/stores/reserouseBasicInfo.js +++ b/pc4mobx/organization/stores/reserouseBasicInfo.js @@ -3,7 +3,7 @@ import { action } from 'mobx'; import * as mobx from 'mobx'; -import * as Api from '../apis/joblevel'; // 引入API接口文件 +import * as Api from '../apis/resourceBasicInfo'; // 引入API接口文件 import { WeaForm } from 'comsMobx'; @@ -32,21 +32,17 @@ export class ResourceBasicInfoStore { @observable isEdit = true; @observable isNew = true; @observable isPanelShow = false; //高级搜索面板 - @observable form2 = new WeaForm(); - @observable form = new WeaForm(); - @observable form1 = new WeaForm(); - @observable levelName = ''; + @observable form2 = new WeaForm(); //高级搜索 + @observable form = new WeaForm(); //新增编辑 + @observable fname = ''; @observable conditionNum = 2; @observable ids = ''; //选择行id @observable searchConditionLoading = true; @observable nEdialogTitle = ''; @observable visible = false; @observable dialogLoading = true; - @observable levelId = ''; + @observable fId = ''; @observable date = ''; - @observable selectedKey = -1; - @observable topTab = []; - @observable topTabCount = {}; @observable hasRight = ''; @observable treeLoading = true; @@ -89,13 +85,13 @@ export class ResourceBasicInfoStore { @action getTableInfo() { let params = { - schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, + fclassid: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, } this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...params, - levelName: this.levelName, + fname: this.fname, }; } else { params = { @@ -135,6 +131,25 @@ export class ResourceBasicInfoStore { }) } + //恢复 + recover(id){ + let params = { + ids: id + }; + Api.recoverData(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(i18n.message.opSuccess()); + this.getTableInfo(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + save() { let params = { ...this.form.getFormParams() @@ -162,7 +177,7 @@ export class ResourceBasicInfoStore { } edit() { - let params = { ...this.form.getFormParams(), id: this.levelId }; + let params = { ...this.form.getFormParams(), fid: this.fId }; this.form.validateForm().then(f => { if (f.isValid) { Api.edit(params).then(response => { @@ -185,40 +200,19 @@ export class ResourceBasicInfoStore { }); } - changeData(key) { - this.setSelectedKey(key); - this.getTableInfo(); - } - - updateForbiddenTag(checked, id) { - let params = { - forbiddenTag: checked, - id: id - } - Api.updateForbiddenTag(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } getForm() { - let params = this.isNew ? {} : { - id: this.levelId + let params = this.isNew ? { + fclassid: this.selectedTreeNodeInfo.domid + } : { + fid: this.fId } this.setDialogLoadingStatus(true); - Api.getLevelForm(params).then(res => { + Api.getForm(params).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); - res.data.condition && this.setCondition(res.data.condition); - res.data.condition && this.form.initFormFields(res.data.condition); + res.data && this.setCondition(res.data); + res.data && this.form.initFormFields(res.data); } else { message.warning(res.msg); } @@ -243,21 +237,6 @@ export class ResourceBasicInfoStore { }) } - @action - getTabInfo() { - Api.getTabInfo().then(res => { - if (res.code === 200) { - res.data.topTabs && this.setTopTab(res.data.topTabs); - res.data.topTabCount && this.setTopTabCount(res.data.topTabCount); - } else { - message.warning(res.msg); - } - }, error => { - message.warning(error.msg); - }) - } - - @action getHasRight() { Api.getHasRight().then(res => { @@ -274,7 +253,7 @@ export class ResourceBasicInfoStore { updateFields(val) { this.form2.updateFields({ - levelName: { + fname: { value: val } }); @@ -296,8 +275,8 @@ export class ResourceBasicInfoStore { } } - setLevelName(val) { - this.levelName = val; + setFName(val) { + this.fname = val; } isEmptyObject(obj) { @@ -346,25 +325,14 @@ export class ResourceBasicInfoStore { this.condition = condition; } - setLevelId(levelId) { - this.levelId = levelId; + setFId(fId) { + this.fId = fId; } setDate(date) { this.date = date; } - setSelectedKey(selectedKey) { - this.selectedKey = selectedKey; - } - - setTopTab(topTab) { - this.topTab = topTab; - } - - setTopTabCount(topTabCount) { - this.topTabCount = topTabCount; - } setTopMenu(topMenu) { this.topMenu = topMenu; From 2128fcae7cb54d3c86afbdb9323ef69cb6425e03 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 30 Aug 2022 11:42:11 +0800 Subject: [PATCH 056/155] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/apis/resourceBasicInfo.js | 38 +++++++ .../components/resource/ResourceBasicInfo.js | 106 ++++++++++++++++-- pc4mobx/organization/public/i18n.js | 5 +- .../organization/stores/reserouseBasicInfo.js | 105 ++++++++++++++++- 4 files changed, 235 insertions(+), 19 deletions(-) diff --git a/pc4mobx/organization/apis/resourceBasicInfo.js b/pc4mobx/organization/apis/resourceBasicInfo.js index f827f6d..fd06371 100644 --- a/pc4mobx/organization/apis/resourceBasicInfo.js +++ b/pc4mobx/organization/apis/resourceBasicInfo.js @@ -33,6 +33,44 @@ export const getAdvanceSearchCondition = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getSearchCondition', 'GET', params); } +export const addType = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/saveResourceItemClass', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const editType = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/updateResourceItemClass', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const deleteType = (params) => { + return fetch('/api/bs/hrmorganization/resourceBasicInfo/deleteResourceItemClass', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} + +export const getTypeForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getItemClassForm', 'GET', params); +} + + export const add = (params) => { return fetch('/api/bs/hrmorganization/resourceBasicInfo/save', { method: 'POST', diff --git a/pc4mobx/organization/components/resource/ResourceBasicInfo.js b/pc4mobx/organization/components/resource/ResourceBasicInfo.js index 8be6c00..7d62222 100644 --- a/pc4mobx/organization/components/resource/ResourceBasicInfo.js +++ b/pc4mobx/organization/components/resource/ResourceBasicInfo.js @@ -73,23 +73,26 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo.initData(); } + getTopMenuBtns() { const { resourceBasicInfo } = this.props; const { topMenu, - tableStore + tableStore, + selectedTreeNodeInfo } = resourceBasicInfo; let btns = []; topMenu.map((item, i) => { - if (item.menuFun !== 'batchDelete') { - btns.push(); - } else { + if (item.menuFun === 'batchDelete') { btns.push(); + } else if (item.menuFun === 'delItemClass' || item.menuFun === 'editItemClass') { + btns.push(); + } else { + btns.push(); } - }); return btns; @@ -107,6 +110,17 @@ export default class ResourceBasicInfo extends React.Component { this[item.menuFun] && this[item.menuFun](); } + custom = () => { + const { + resourceBasicInfo + } = this.props, { + tableStore, + } = resourceBasicInfo; + + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + } + new() { const { resourceBasicInfo @@ -114,10 +128,53 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo.setNeDialogTitle(i18n.label.newResourceBasicInfo()); resourceBasicInfo.setIsNew(true); + resourceBasicInfo.setOperateType("1"); resourceBasicInfo.setVisible(true); resourceBasicInfo.getForm(); } + addItemClass() { + const { + resourceBasicInfo + } = this.props; + + resourceBasicInfo.setNeDialogTitle(i18n.label.newResourceBasicType()); + resourceBasicInfo.setVisible(true); + resourceBasicInfo.setOperateType("2") + resourceBasicInfo.getTypeForm(); + } + + editItemClass() { + const { + resourceBasicInfo + } = this.props; + + resourceBasicInfo.setNeDialogTitle(i18n.label.editResourceBasicType()); + resourceBasicInfo.setVisible(true); + resourceBasicInfo.setOperateType("4") + resourceBasicInfo.getTypeForm(); + } + + delItemClass() { + const { + resourceBasicInfo + } = this.props; + confirm({ + title: i18n.confirm.defaultTitle(), + content: "确认删除该类型吗!", + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + resourceBasicInfo.deleteType(); + }, + onCancel() { + return false; + }, + }); + } + + + batchDelete() { const { resourceBasicInfo @@ -215,7 +272,7 @@ export default class ResourceBasicInfo extends React.Component { form2 } = resourceBasicInfo; - resourceBasicInfo.setLevelName(val); + resourceBasicInfo.setFName(val); !this.isEmptyObject(form2.getFormParams()) && resourceBasicInfo.updateFields(val); } @@ -225,7 +282,7 @@ export default class ResourceBasicInfo extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'fdelete') { c.render = function (text, record) { - return record.fdelete == '0' ? 正常 : 停用 + return record.fdelete == '0' ? 正常 : 停用 } }; }) @@ -246,9 +303,10 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo } = this.props; - resourceBasicInfo.setNeDialogTitle(i18n.label.editJobLevel()); + resourceBasicInfo.setNeDialogTitle(i18n.label.editResourceBasicInfo()); resourceBasicInfo.setFId(id); resourceBasicInfo.setIsNew(false); + resourceBasicInfo.setOperateType("3") resourceBasicInfo.setVisible(true); resourceBasicInfo.getForm(); } @@ -294,11 +352,24 @@ export default class ResourceBasicInfo extends React.Component { resourceBasicInfo } = this.props; const { - isNew + isNew, + operateType } = resourceBasicInfo; - isNew && resourceBasicInfo.save(); - !isNew && resourceBasicInfo.edit(); + switch(operateType){ + case "1": + resourceBasicInfo.save(); + break; + case "2": + resourceBasicInfo.saveType(); + break; + case "3": + resourceBasicInfo.edit(); + break; + case "4": + resourceBasicInfo.editType(); + break; + } } getPanelComponents() { @@ -415,6 +486,19 @@ export default class ResourceBasicInfo extends React.Component { onDropMenuClick={(e) => this.handleMenuClick(e)} > + resourceBasicInfo.setPanelStatus(bool)} + hideSearchAd={() => resourceBasicInfo.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => resourceBasicInfo.getTableInfo()} + onSearchChange={val => this.onSearchChange(val)} + /> getLabel(386246, '人员管理'), resourceBasicInfo: () => getLabel(386246, '人员信息'), newResourceBasicInfo: () => getLabel(386246, '新建人员资料'), - - + newResourceBasicType: () => getLabel(386246, '新建人员资料类型'), + editResourceBasicInfo: () => getLabel(386246, '编辑人员资料'), + editResourceBasicType: () => getLabel(386246, '编辑人员资料类型'), authorizationGroup: () => getLabel(492, '权限组'), allAuthorization: () => getLabel(33363, '全部权限'), diff --git a/pc4mobx/organization/stores/reserouseBasicInfo.js b/pc4mobx/organization/stores/reserouseBasicInfo.js index 5fa9ab0..f409350 100644 --- a/pc4mobx/organization/stores/reserouseBasicInfo.js +++ b/pc4mobx/organization/stores/reserouseBasicInfo.js @@ -30,7 +30,8 @@ export class ResourceBasicInfoStore { @observable condition = []; @observable searchCondition = []; @observable isEdit = true; - @observable isNew = true; + @observable isNew = false; + @observable operateType = '';//1 资料新增 2类型新增 3资料编辑 4类型编辑 @observable isPanelShow = false; //高级搜索面板 @observable form2 = new WeaForm(); //高级搜索 @observable form = new WeaForm(); //新增编辑 @@ -65,13 +66,17 @@ export class ResourceBasicInfoStore { @action initData = () => { this.selectedTreeNodeInfo = null; this.treeConfig.treeExpandKeys.length = 0; + this.getTree(); + } + + @action getTree(){ Api.getTree().then(res => { if (res.code === 200) { if (res.data.length > 0) { this.treeConfig.data = res.data; - this.treeConfig.selectedKeys = [res.data[0].key]; + this.treeConfig.selectedKeys = this.selectedTreeNodeInfo != null ? [this.selectedTreeNodeInfo.domid] : [res.data[0].key]; this.treeConfig.treeExpandKeys = "-1"; - this.selectedTreeNodeInfo = res.data[0]; + this.selectedTreeNodeInfo = this.selectedTreeNodeInfo != null ? this.selectedTreeNodeInfo : res.data[0]; this.getTableInfo(); this.setTreeLoading(false); } @@ -131,8 +136,25 @@ export class ResourceBasicInfoStore { }) } + //删除类型 + deleteType() { + Api.deleteType(this.selectedTreeNodeInfo.domid).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(i18n.message.deleteSuccess()); + this.getTree(); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } + + //恢复 - recover(id){ + recover(id) { let params = { ids: id }; @@ -176,6 +198,34 @@ export class ResourceBasicInfoStore { }); } + + saveType() { + let params = { + ...this.form.getFormParams() + }; + this.form.validateForm().then(f => { + if (f.isValid) { + Api.addType(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTree(); + this.setVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } + + edit() { let params = { ...this.form.getFormParams(), fid: this.fId }; this.form.validateForm().then(f => { @@ -200,6 +250,29 @@ export class ResourceBasicInfoStore { }); } + editType() { + let params = { ...this.form.getFormParams(), fid: this.selectedTreeNodeInfo.domid }; + this.form.validateForm().then(f => { + if (f.isValid) { + Api.editType(params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { + message.success(data.msg); + this.getTree(); + this.setVisible(false); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.warning(error.msg); + }) + } else { + f.showErrors(); + this.setDate(new Date()); + } + }); + } getForm() { let params = this.isNew ? { @@ -219,7 +292,24 @@ export class ResourceBasicInfoStore { }, error => { message.warning(error.msg); }) + } + getTypeForm() { + let params = this.isNew ? {} : { + fid: this.selectedTreeNodeInfo.domid + } + this.setDialogLoadingStatus(true); + Api.getTypeForm(params).then(res => { + if (res.code === 200) { + this.setDialogLoadingStatus(false); + res.data && this.setCondition(res.data); + res.data && this.form.initFormFields(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) } getSearchCondition() { @@ -227,8 +317,8 @@ export class ResourceBasicInfoStore { Api.getAdvanceSearchCondition().then(res => { if (res.code === 200) { this.setScLoadingStatus(false); - res.data.conditions && this.setSearchCondition(res.data.conditions); - res.data.conditions && this.form2.initFormFields(res.data.conditions); + res.data && this.setSearchCondition(res.data); + res.data && this.form2.initFormFields(res.data); } else { message.warning(res.msg); } @@ -320,6 +410,9 @@ export class ResourceBasicInfoStore { setIsNew(bool) { this.isNew = bool; } + setOperateType(val) { + this.operateType = val; + } setCondition(condition) { this.condition = condition; From a578e4e3abe19327f299d0bfbc0240f97555c5a9 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 2 Sep 2022 11:00:27 +0800 Subject: [PATCH 057/155] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/department/department.js | 13 +++++++++++-- pc4mobx/organization/components/job/Job.js | 11 ++++++++++- .../organization/components/office/officeManage.js | 2 +- .../organization/components/staff/StaffScheme.js | 5 +---- pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/jobgrade.js | 11 +++++------ pc4mobx/organization/stores/joblevel.js | 11 ++++++----- pc4mobx/organization/stores/officeManage.js | 6 +++--- pc4mobx/organization/stores/rankscheme.js | 11 ++++++----- pc4mobx/organization/stores/sequence.js | 10 +++++----- pc4mobx/organization/stores/staff.js | 8 ++++---- pc4mobx/organization/stores/staffscheme.js | 10 +++++----- 12 files changed, 58 insertions(+), 41 deletions(-) diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 13c7358..0afa088 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-08-03 15:11:19 + * @LastEditTime: 2022-09-01 15:06:53 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -184,7 +184,7 @@ export default class Department extends React.Component { const { selectedRowKeys } = department; - + let keys = id == undefined ? toJS(selectedRowKeys).toString() : id; department.setIds(keys); confirm({ @@ -524,12 +524,21 @@ export default class Department extends React.Component { inputLeftDom={`${i18n.label.organization()}`} treeNodeClick={this.treeNodeClick} expandAllChildrenOnSearch={true} + renderNode={item => this.renderNode(item)} /> ) return tree; } + renderNode(item) { + return
+ + {item.name} + {item.canceled && ({i18n.label.forbidden()})} +
+ } + treeNodeClick = (event, ids, nodeids, nodes) => { const { department diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 960174c..3de6483 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-08-03 15:13:55 + * @LastEditTime: 2022-09-01 15:08:26 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -493,12 +493,21 @@ export default class Job extends React.Component { inputLeftDom={`${i18n.label.organization()}`} treeNodeClick={this.treeNodeClick} expandAllChildrenOnSearch={true} + renderNode={item => this.renderNode(item)} /> ) return tree; } + renderNode(item) { + return
+ + {item.name} + {item.canceled && ({i18n.label.forbidden()})} +
+ } + treeNodeClick = (event, ids, nodeids, nodes) => { const { job diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 34b4587..ed5d73b 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -278,7 +278,7 @@ export default class OfficeManage extends Component { updateForbiddenTagById(payload).then(({ code, msg }) => { if (code === 200) { message.success("操作成功"); - officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId); + officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId,true); } else { message.error(msg || "操作失败"); } diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index c6795c6..3f96376 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -250,7 +250,7 @@ export default class StaffScheme extends React.Component { } = operate; (index == '0') && this.doEdit(record.randomFieldId); (index == '1') && this.doDel(record.randomFieldId); - (index == '2') && this.doWorkflow(record.randomFieldId); + //(index == '2') && this.doWorkflow(record.randomFieldId); } doEdit(id) { @@ -295,9 +295,6 @@ export default class StaffScheme extends React.Component { this.showConfirm('del'); } - doWorkflow(id) { - alert("逻辑太自由,暂缓") - } handleSave() { diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index ff05f20..8adef79 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -162,6 +162,7 @@ export const i18n = { newResourceBasicType: () => getLabel(386246, '新建人员资料类型'), editResourceBasicInfo: () => getLabel(386246, '编辑人员资料'), editResourceBasicType: () => getLabel(386246, '编辑人员资料类型'), + forbidden: () => getLabel('531114', '已禁用'), authorizationGroup: () => getLabel(492, '权限组'), allAuthorization: () => getLabel(33363, '全部权限'), diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 0a69083..d2f622b 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -88,11 +88,11 @@ export class JobGradeStore { @action - getTableInfo() { + getTableInfo(isOnChange = false) { let params = { schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, } - this.tableStore = new TableStore(); + const {current} = this.tableStore; if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...params, @@ -107,8 +107,7 @@ export class JobGradeStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); - + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); } @@ -185,7 +184,7 @@ export class JobGradeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); this.setVisible(false); } else { message.warning(data.msg); @@ -210,7 +209,7 @@ export class JobGradeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index 350389d..a80543d 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -87,11 +87,12 @@ export class JobLevelStore { @action - getTableInfo() { + getTableInfo(isOnChange = false) { let params = { schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid, } - this.tableStore = new TableStore(); + const { current } = this.tableStore; + if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...params, @@ -106,7 +107,7 @@ export class JobLevelStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); } @@ -170,7 +171,7 @@ export class JobLevelStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); this.setVisible(false); } else { message.warning(data.msg); @@ -200,7 +201,7 @@ export class JobLevelStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js index 1966840..ac769d7 100644 --- a/pc4mobx/organization/stores/officeManage.js +++ b/pc4mobx/organization/stores/officeManage.js @@ -82,9 +82,9 @@ export class OfficeManageStore { } @action("获取表格数据") - getPostInfoTable(postId) { + getPostInfoTable(postId,isOnChange = false) { let params; - this.tableStore = new TableStore(); + const {current} = this.tableStore; if (_.isEmpty(this.form2.getFormParams())) { params = { ...this.form2.getFormParams(), @@ -100,7 +100,7 @@ export class OfficeManageStore { API.getPostInfoTable(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.error(res.msg); } diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js index f8a18b0..a61d18b 100644 --- a/pc4mobx/organization/stores/rankscheme.js +++ b/pc4mobx/organization/stores/rankscheme.js @@ -50,9 +50,10 @@ export class RankSchemeStore { @action - getTableInfo() { + getTableInfo(isOnChange = false) { let params; - this.tableStore = new TableStore(); + //this.tableStore = new TableStore(); + const { current } = this.tableStore; if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...this.form2.getFormParams(), @@ -66,7 +67,7 @@ export class RankSchemeStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); } @@ -131,7 +132,7 @@ export class RankSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); this.setVisible(false); } else { message.warning(data.msg); @@ -156,7 +157,7 @@ export class RankSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/sequence.js b/pc4mobx/organization/stores/sequence.js index e2ec395..92e0a09 100644 --- a/pc4mobx/organization/stores/sequence.js +++ b/pc4mobx/organization/stores/sequence.js @@ -51,9 +51,9 @@ export class SequenceStore { @action - getTableInfo() { + getTableInfo(isOnChange = false) { let params; - this.tableStore = new TableStore(); + const {current} = this.tableStore; if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...this.form2.getFormParams(), @@ -69,7 +69,7 @@ export class SequenceStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); } @@ -135,7 +135,7 @@ export class SequenceStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); this.setVisible(false); } else { message.warning(data.msg); @@ -165,7 +165,7 @@ export class SequenceStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index aa06b70..4d826dd 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -55,12 +55,12 @@ export class StaffStore { @action - getTableInfo() { + getTableInfo(isOnChange = false) { let params = { planId: this.planId, ...this.selectTreeNodeInfo, } - this.tableStore = new TableStore(); + const {current} = this.tableStore; if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...params, @@ -75,7 +75,7 @@ export class StaffStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); } @@ -140,7 +140,7 @@ export class StaffStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); this.setVisible(false); } else { message.warning(data.msg); diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js index 84bc659..c27756d 100644 --- a/pc4mobx/organization/stores/staffscheme.js +++ b/pc4mobx/organization/stores/staffscheme.js @@ -53,9 +53,9 @@ export class StaffSchemeStore { @action - getTableInfo() { + getTableInfo(isOnChange = false) { let params; - this.tableStore = new TableStore(); + const {current} = this.tableStore; if (this.isEmptyObject(this.form2.getFormParams())) { params = { ...this.form2.getFormParams(), @@ -69,7 +69,7 @@ export class StaffSchemeStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight) - res.data.datas && this.tableStore.getDatas(res.data.datas, 1); + isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); } @@ -134,7 +134,7 @@ export class StaffSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); this.setVisible(false); } else { message.warning(data.msg); @@ -159,7 +159,7 @@ export class StaffSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); - this.getTableInfo(); + this.getTableInfo(true); } else { message.warning(data.msg); } From 64cfbffaf036d996c363aaa2e84398278378fa5f Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 2 Sep 2022 16:17:54 +0800 Subject: [PATCH 058/155] fixed --- .../organization/components/department/NewPopconfirm.js | 4 ++-- pc4mobx/organization/components/department/department.js | 7 ++++--- pc4mobx/organization/components/office/officeManage.js | 2 +- pc4mobx/organization/components/sequence/Sequence.js | 2 +- pc4mobx/organization/stores/jobgrade.js | 5 ++++- pc4mobx/organization/stores/joblevel.js | 4 +++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pc4mobx/organization/components/department/NewPopconfirm.js b/pc4mobx/organization/components/department/NewPopconfirm.js index 87c9407..43752a5 100644 --- a/pc4mobx/organization/components/department/NewPopconfirm.js +++ b/pc4mobx/organization/components/department/NewPopconfirm.js @@ -93,7 +93,7 @@ export default class NewPopconfirm extends React.Component { const buttons = [ (), - () + () ]; return ( @@ -104,7 +104,7 @@ export default class NewPopconfirm extends React.Component { visible={visible} closable={true} hasScroll={true} - onCancel={() => onCancel()} + onCancel={() => {this.setState({value:"0"});onCancel()}} buttons={buttons} style={{ width: width, height: height }} > diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 0afa088..25f0857 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-09-01 15:06:53 + * @LastEditTime: 2022-09-02 15:22:00 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -91,7 +91,8 @@ export default class Department extends React.Component { } = this.props; const { topMenu, - selectedRowKeys + selectedRowKeys, + selectTreeNodeInfo } = department; let btns = []; @@ -102,7 +103,6 @@ export default class Department extends React.Component { btns.push(); } else { btns.push(); - } }); @@ -703,6 +703,7 @@ export default class Department extends React.Component { height={100} width={400} isMerge={isMerge} + defaultValue={"0"} save={() => this.PopconfirmSave()} onCancel={() => department.setConfirmVisible(false)} /> diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index ed5d73b..5f088b2 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -425,7 +425,7 @@ export default class OfficeManage extends Component { hasRight &&
} diff --git a/pc4mobx/organization/components/sequence/Sequence.js b/pc4mobx/organization/components/sequence/Sequence.js index c5f85ee..8fc5288 100644 --- a/pc4mobx/organization/components/sequence/Sequence.js +++ b/pc4mobx/organization/components/sequence/Sequence.js @@ -435,7 +435,7 @@ export default class Sequence extends React.Component { isFormInit={form.isFormInit} loading={dialogLoading} isEdit={isEdit} - height={250} + height={300} conditionLen={3} save={() => this.handleSave()} onCancel={() => sequence.setVisible(false)} diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index d2f622b..79e54d9 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -219,7 +219,9 @@ export class JobGradeStore { } getForm() { - let params = this.isNew ? {} : { + let params = this.isNew ? { + schemeId:this.selectedTreeNodeInfo.domid + } : { id: this.gradeId } this.setDialogLoadingStatus(true); @@ -228,6 +230,7 @@ export class JobGradeStore { this.setDialogLoadingStatus(false); res.data.condition && this.setCondition(res.data.condition); res.data.condition && this.form.initFormFields(res.data.condition); + this.updateConditions(this.selectedTreeNodeInfo.domid); } else { message.warning(res.msg); } diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index a80543d..5f43f7e 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -211,7 +211,9 @@ export class JobLevelStore { } getForm() { - let params = this.isNew ? {} : { + let params = this.isNew ? { + schemeId:this.selectedTreeNodeInfo.domid + } : { id: this.levelId } this.setDialogLoadingStatus(true); From 8db2ed84c60e26369d0206b5be2ec35058661e4e Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 5 Sep 2022 16:17:36 +0800 Subject: [PATCH 059/155] =?UTF-8?q?=E8=81=8C=E5=8A=A1=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=A0=91=E6=90=9C=E7=B4=A2=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/office/components/leftTree.js | 8 +- .../components/office/officeManage.js | 103 +++++++++--------- 2 files changed, 55 insertions(+), 56 deletions(-) diff --git a/pc4mobx/organization/components/office/components/leftTree.js b/pc4mobx/organization/components/office/components/leftTree.js index e8d7f80..c7f6ab8 100644 --- a/pc4mobx/organization/components/office/components/leftTree.js +++ b/pc4mobx/organization/components/office/components/leftTree.js @@ -152,15 +152,15 @@ class LeftTree extends Component { return arr; }; onChange = value => { - if (value == "") { - let { copyTree, copyExpandedKeys } = this.state; + if (_.isEmpty(value)) { + let { copyTree, copyExpandedKeys, expandedKeys } = this.state; this.setState({ treeData: JSON.parse(copyTree), - expandedKeys: copyExpandedKeys, + expandedKeys, searchValue: value }); } else { - let { copyTree, copyExpandedKeys } = this.state; + let { copyTree } = this.state; let res = this.arrayTreeFilter( JSON.parse(copyTree), this.filterFn, diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 5f088b2..4d25114 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -57,9 +57,9 @@ export default class OfficeManage extends Component { showlog = () => { window.setLogViewProp({ logMoudleType: 6, - keys: new Date().getTime(), + keys: new Date().getTime() }); - } + }; handleMenuClick = key => { const { officeManageStore } = this.props; @@ -278,7 +278,7 @@ export default class OfficeManage extends Component { updateForbiddenTagById(payload).then(({ code, msg }) => { if (code === 200) { message.success("操作成功"); - officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId,true); + officeManageStore.getPostInfoTable(officeManageStore.officeClassifyId, true); } else { message.error(msg || "操作失败"); } @@ -423,67 +423,66 @@ export default class OfficeManage extends Component { return ( hasRight &&
+ } + iconBgcolor="#217346" + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={e => this.handleMenuClick(e)}> + - } - onCollapse={showLeft => console.log("showLeft:", showLeft)}> + }> this.handleMenuClick(key)}> - } - iconBgcolor="#217346" - loading={true} - buttons={this.getTopMenuBtns()} - showDropIcon={true} - dropMenuDatas={this.getDropMenuDatas()} - onDropMenuClick={e => this.handleMenuClick(e)}> - officeManageStore.setPanelStatus(bool)} + hideSearchAd={() => officeManageStore.setPanelStatus(false)} + searchsAd={isPanelShow ? this.getPanelComponents() :
} + advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} + hasMask={false} + buttonsAd={this.getTabBtn()} + onSearch={() => officeManageStore.getPostInfoTable()} + onSearchChange={val => this.onSearchChange(val)} + /> + { + console.log(record); + return { + disabled: true // 配置无法勾选的列 + }; } - setShowSearchAd={bool => officeManageStore.setPanelStatus(bool)} - hideSearchAd={() => officeManageStore.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} - advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} - hasMask={false} - buttonsAd={this.getTabBtn()} - onSearch={() => officeManageStore.getPostInfoTable()} - onSearchChange={val => this.onSearchChange(val)} - /> - { - console.log(record); - return { - disabled: true // 配置无法勾选的列 - }; - } - }} - getColumns={c => this.reRenderColumns(c)} - onOperatesClick={(record, index, operate) => - this.onOperatesClick(record, index, operate)} - /> - + }} + getColumns={c => this.reRenderColumns(c)} + onOperatesClick={(record, index, operate) => + this.onOperatesClick(record, index, operate)} + /> Date: Tue, 6 Sep 2022 09:26:38 +0800 Subject: [PATCH 060/155] fixed --- pc4mobx/organization/components/company/company.js | 4 ++-- pc4mobx/organization/components/staff/Staff.js | 11 ++++++++++- pc4mobx/organization/components/staff/StaffScheme.js | 2 +- pc4mobx/organization/public/i18n.js | 1 + pc4mobx/organization/stores/jobextend.js | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 6d14e3c..f11bd3b 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-07-06 10:48:30 + * @LastEditTime: 2022-09-05 17:46:05 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -140,7 +140,7 @@ export default class Company extends React.Component { const { company } = this.props; - company.setNeDialogTitle(i18n.label.companyName()); + company.setNeDialogTitle(i18n.label.selectDept()); company.setVisible(true); company.setDialogLoadingStatus(true); company.getDeptTable(id); diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 1d2dd36..37fbfd0 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -254,11 +254,20 @@ export default class Staff extends React.Component { inputLeftDom={`${i18n.label.organization()}`} treeNodeClick={this.treeNodeClick} expandAllChildrenOnSearch={true} + renderNode={item => this.renderNode(item)} /> ) return tree; } + renderNode(item) { + return
+ + {item.name} + {item.canceled && ({i18n.label.forbidden()})} +
+ } + treeNodeClick = (event, ids, nodeids, nodes) => { const { staff @@ -513,7 +522,7 @@ export default class Staff extends React.Component { isFormInit={form.isFormInit} loading={dialogLoading} isEdit={isEdit} - height={250} + height={400} conditionLen={3} save={() => this.handleSave()} onCancel={() => staff.setVisible(false)} diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index 3f96376..8929728 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -429,7 +429,7 @@ export default class StaffScheme extends React.Component { isFormInit={form.isFormInit} loading={dialogLoading} isEdit={isEdit} - height={250} + height={450} conditionLen={3} save={() => this.handleSave()} onCancel={() => staffScheme.setVisible(false)} diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 8adef79..9b4c907 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -152,6 +152,7 @@ export const i18n = { newDept: () => getLabel(386246, '新增部门'), mergeDept:()=> getLabel(386246, '合并部门'), transferDept:()=> getLabel(386246, '转移部门'), + selectDept:()=> getLabel(386246, '联查部门'), editDept:()=> getLabel(386246, '修改部门信息'), typeName: () => getLabel(129927, '类型名称'), ResourceName: () => getLabel(385936, '人员'), diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index c64f000..6d24428 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -139,7 +139,7 @@ export class JobExtendStore { const index1 = findIndex(conditions[1].items, { label }); label = "职等" const index2 = findIndex(conditions[1].items, { label }); - let schemeId = conditions[1].items[1].browserConditionParam.replaceDatas[0].id; + let schemeId = conditions[1].items[1].browserConditionParam.replaceDatas.length > 0 && conditions[1].items[1].browserConditionParam.replaceDatas[0].id; let levelIds = res.data.levelIds; this.rangeLimit(key0,schemeId,index1,currenttime,conditions); this.rangeLimitLevel(key1,key2,index2,levelIds,currenttime,conditions) From 8a44f31d647e825b636e4032f8b2cea969264fd5 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Tue, 6 Sep 2022 10:08:08 +0800 Subject: [PATCH 061/155] =?UTF-8?q?=E3=80=90ID1000165=E3=80=91=20=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=9C=BA=E6=9E=84=EF=BC=9A=E5=88=86=E9=83=A8/?= =?UTF-8?q?=E9=83=A8=E9=97=A8/=E5=B2=97=E4=BD=8D=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20=E5=A2=9E=E5=8A=A0=20=E9=A2=84=E7=95=99?= =?UTF-8?q?=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NewAndEditDialog.js | 6 +- .../organization/components/NewNumberField.js | 140 ++++++++++++++++++ .../organization/components/office/index.less | 4 +- .../components/office/officeManage.js | 1 - 4 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 pc4mobx/organization/components/NewNumberField.js diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index be503bb..535f8a3 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -19,6 +19,7 @@ import { import { i18n } from '../public/i18n'; +import AttachToNumberField from './NewNumberField'; export default class NewAndEditDialog extends React.Component { constructor(props) { @@ -103,6 +104,9 @@ export default class NewAndEditDialog extends React.Component { > + {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } + {field.domkey[0] == 'dept_no' && field.viewAttr != '1' && } + {field.domkey[0] == 'job_no' && field.viewAttr != '1' && } ), colSpan: 1 @@ -159,4 +163,4 @@ export default class NewAndEditDialog extends React.Component { ) } -} \ No newline at end of file +} diff --git a/pc4mobx/organization/components/NewNumberField.js b/pc4mobx/organization/components/NewNumberField.js new file mode 100644 index 0000000..91724ff --- /dev/null +++ b/pc4mobx/organization/components/NewNumberField.js @@ -0,0 +1,140 @@ +import React, { PureComponent } from "react"; +import { i18n } from "../public/i18n"; +import { WeaTools } from "ecCom"; + +/** + * 添加多级路径 + * + * @param {*} url + */ +export const addContentPath = (url) => { + const ecologyContentPath = window.ecologyContentPath || ""; + if (url && ecologyContentPath) { + //避免重复添加ecologyContentPath + //避免传入的参数不是链接 + if (url.startsWith("/") && !url.startsWith(ecologyContentPath)) { + url = ecologyContentPath + url; + } + } + return url; +}; + +export default class AttachToNumberField extends PureComponent { + constructor(props) { + super(props); + + this.state = { + canRe: false, + canCheck: false, + canNew: false + }; + this.typeMap = { + comp_no: "SUBCOMPANY", + dept_no: "DEPARTMENT", + job_no: "JOBTITLES", + workcode: "USER" + }; + + } + + componentWillMount() { + const { field: { domkey: [targetKey] } } = this.props; + this.targetKey = targetKey; + this.type = this.typeMap[this.targetKey]; + } + + componentDidMount() { + this.init(this.props.isEdit); + } + + componentWillReceiveProps(nextProps) { + if (nextProps.form != this.props.form) { + this.init(nextProps.isEdit); + } + } + + init = (isEdit) => { + WeaTools.callApi("/api/hrm/codeSetting/getHasSelect", "GET", {}).then(res => { + if (res) { + //后台设置页面开关关闭,接口不会返回对应的权限,所以这里做下兼容 + const target = res[this.type] || { hasSelect: false, hasRight: false }; + const { hasSelect, hasRight } = target; + this.setState({ + canRe: hasSelect && isEdit, + canCheck: hasSelect, + canNew: hasRight + }); + } + }); + }; + + handleClick = (e) => { + const urlMap = { + select: { + title: i18n.label.selectReserveNumber(), + url: addContentPath(`/spa/hrm/engine.html#/hrmengine/reservedNumber?type=${this.type}&isSimple=1`) + }, + add: { + title: i18n.label.newReserveNumber(), + url: addContentPath(`/spa/hrm/engine.html#/hrmengine/newReservedNumberContent?type=${this.type}`) + } + }; + + const { title, url } = urlMap[e.target.id]; + + ecCom.WeaTools.createDialog({ + title, + url, + moduleName: "hrm", + style: { width: 800, height: 600 }, + callback: this.updateFormField, + onCancel: () => { // 关闭通信 + } + }).show(); + }; + updateFormField = (value) => { + const { form } = this.props; + form.updateFields({ + [this.targetKey]: value + }); + }; + //重新生成编号 + reNumber = () => { + const { form, useId } = this.props; + const fieldMap = { + subcompanycode: "subshowid", + departmentcode: "showid", + jobtitlecode: "jobactivityid", + workcode: "useid" + }, + fieldname = fieldMap[this.targetKey]; + + WeaTools.callApi("/api/hrm/codeSetting/regenerateCode", "POST", { + serialtype: this.type, + [`${this.type.toLocaleLowerCase()}id`]: form.getFormParams()[fieldname] || useId + }).then(res => { + const { api_status, code } = res; + if (api_status) { + if (code) { + this.updateFormField(code); + } else { + message.error(res.api_errormsg); + } + } + }); + }; + + + render() { + const { canRe, canCheck, canNew } = this.state; + return ( +
+ {canRe && {i18n.label.reNumber()}} + {canCheck && {i18n.label.selectReserveNumber()}} + {canCheck && canNew && + {i18n.label.newReserveNumber()}} +
+ ); + } +} diff --git a/pc4mobx/organization/components/office/index.less b/pc4mobx/organization/components/office/index.less index d39a49d..ba6f3eb 100644 --- a/pc4mobx/organization/components/office/index.less +++ b/pc4mobx/organization/components/office/index.less @@ -1,6 +1,8 @@ // office-wapper .office-wapper { height: 100%; + display: flex; + flex-direction: column; .rightmenu { border-right: none; @@ -17,4 +19,4 @@ } } -} \ No newline at end of file +} diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index 4d25114..6ead8fb 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -437,7 +437,6 @@ export default class OfficeManage extends Component { }> From fc9c510619b309221559646535d7147bb392a09b Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 6 Sep 2022 18:53:08 +0800 Subject: [PATCH 062/155] fixed --- pc4mobx/organization/stores/department.js | 4 ++-- pc4mobx/organization/stores/fieldDefined.js | 4 ++-- pc4mobx/organization/stores/job.js | 3 +-- pc4mobx/organization/stores/jobgrade.js | 2 +- pc4mobx/organization/stores/staff.js | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 408d22b..b51b9cd 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -194,9 +194,9 @@ export class DepartmentStore { getDeptForm() { - let params = {}; + this.setDialogLoadingStatus(true); - Api.getDeptForm(params).then(res => { + Api.getDeptForm(this.selectTreeNodeInfo).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); res.data.condition && this.setCondition(res.data.condition); diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 3602dad..037e602 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-08-22 15:25:05 + * @LastEditTime: 2022-09-06 09:43:39 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -227,7 +227,7 @@ export class FieldDefinedStore extends HrmBaseStore { key: 'fieldType', useRecord: true, colSpan: 1, - width: "40%", + width: "45%", com: [{ label: '', type: 'CUSTOMFIELD', diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index deed2b2..a66a783 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -195,9 +195,8 @@ export class JobStore { getJobForm() { - let params = {}; this.setDialogLoadingStatus(true); - Api.getJobForm(params).then(res => { + Api.getJobForm(this.selectTreeNodeInfo).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); res.data.condition && this.setCondition(res.data.condition); diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 79e54d9..eaaa626 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -230,7 +230,7 @@ export class JobGradeStore { this.setDialogLoadingStatus(false); res.data.condition && this.setCondition(res.data.condition); res.data.condition && this.form.initFormFields(res.data.condition); - this.updateConditions(this.selectedTreeNodeInfo.domid); + this.isNew ? this.updateConditions(this.selectedTreeNodeInfo.domid):''; } else { message.warning(res.msg); } diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index 4d826dd..d512a27 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -3,7 +3,7 @@ import { action } from 'mobx'; import * as mobx from 'mobx'; -import * as Api from '../apis/staff'; // 引入API接口文件 +import * as Api from '../apis/staff'; // 引入API接口文件 import { WeaForm } from 'comsMobx'; @@ -199,7 +199,7 @@ export class StaffStore { switch(type) { case '分部': this.condition[0].items = this.condition[0].items.filter(item => { - return (item.domkey[0] != 'deptId' && item.domkey[0] != 'jobId') + return (item.domkey[0] != 'ecDepartment' && item.domkey[0] != 'jobId') }); break; case '部门': From cbfed11819ac82ac9f18149b46fc626c934653c4 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Tue, 6 Sep 2022 19:30:44 +0800 Subject: [PATCH 063/155] =?UTF-8?q?=E3=80=90ID1000135=E3=80=91=20=E7=BC=96?= =?UTF-8?q?=E5=88=B6=E7=AE=A1=E7=90=86-=E7=BC=96=E5=88=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF-=E6=96=B0=E5=BB=BA=E7=BC=96=E5=88=B6=20=E3=80=90ID100?= =?UTF-8?q?0132=E3=80=91=20=E6=97=A5=E5=BF=97=E6=9F=A5=E7=9C=8B=EF=BC=9A?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E5=8C=BA=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/components/NewAndEditDialog.js | 3 +++ pc4mobx/organization/components/index.less | 6 ++++++ pc4mobx/organization/components/log/LogView.js | 4 +++- pc4mobx/organization/style/common.less | 11 +++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 pc4mobx/organization/components/index.less diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 535f8a3..4ead83a 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -20,6 +20,7 @@ import { i18n } from '../public/i18n'; import AttachToNumberField from './NewNumberField'; +import "./index.less"; export default class NewAndEditDialog extends React.Component { constructor(props) { @@ -143,6 +144,7 @@ export default class NewAndEditDialog extends React.Component { return ( onCancel()} buttons={isEdit ? buttons : buttons.slice(1, 2)} style={{ width: width, height: height }} + initLoadCss > { loading ?
diff --git a/pc4mobx/organization/components/index.less b/pc4mobx/organization/components/index.less new file mode 100644 index 0000000..abeb9fb --- /dev/null +++ b/pc4mobx/organization/components/index.less @@ -0,0 +1,6 @@ +//新建编辑弹框 +.new-edit-wrapper{ + .wea-select, .ant-select{ + width: 100%; + } +} diff --git a/pc4mobx/organization/components/log/LogView.js b/pc4mobx/organization/components/log/LogView.js index 2487d5e..15851f9 100644 --- a/pc4mobx/organization/components/log/LogView.js +++ b/pc4mobx/organization/components/log/LogView.js @@ -170,6 +170,8 @@ export default class LogView extends React.Component { hasScroll={true} onCancel={() => onCancel()} style={{ height: height, width: width }} + initLoadCss + className="logWrapper" > ) } -} \ No newline at end of file +} diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 411086b..fc4cfca 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -18,7 +18,7 @@ width: 400px !important; line-height: 30px; } - } + } } .hrm-new-weatable-spin { @@ -68,4 +68,11 @@ } -} \ No newline at end of file +} + +//日志弹框样式 +.logWrapper{ + .ant-table-body{ + max-height: 350px!important; + } +} From 57b165f6d80bb903f9c2424f3ea94ad513afeb0f Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Tue, 6 Sep 2022 20:09:24 +0800 Subject: [PATCH 064/155] =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/components/company/CompanyExtend.js | 6 +++++- .../organization/components/department/departmentExtend.js | 5 ++++- pc4mobx/organization/components/job/JobExtend.js | 5 ++++- pc4mobx/organization/style/common.less | 4 ++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index 92b4901..ac76f0f 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -2,7 +2,7 @@ * @Author: 程亮 * @Date: 2022-05-18 14:52:39 * @LastEditTime: 2022-06-22 16:37:43 - * @Description: + * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js */ import { Button, Modal, message, Row, Col, Spin } from 'antd'; @@ -14,9 +14,11 @@ import { WeaSwitch } from 'comsMobx'; import { inject, observer } from 'mobx-react'; import * as mobx from 'mobx'; import { i18n } from '../../public/i18n'; +import '../../style/common.less'; const toJS = mobx.toJS; import '../../style/common.less'; +import AttachToNumberField from "../NewNumberField"; @inject('companyExtend') @@ -122,9 +124,11 @@ export default class CompanyExtend extends React.Component { label={`${field.label}`} error={form.getError(field)} tipPosition={tipPosition} + className={j === 1 && "minH5"} labelCol={{ span: `${field.labelcol}` }} wrapperCol={{ span: `${field.fieldcol}` }}> + {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } ), colSpan: 1 }); diff --git a/pc4mobx/organization/components/department/departmentExtend.js b/pc4mobx/organization/components/department/departmentExtend.js index 33a6ee0..a310b69 100644 --- a/pc4mobx/organization/components/department/departmentExtend.js +++ b/pc4mobx/organization/components/department/departmentExtend.js @@ -2,7 +2,7 @@ * @Author: 程亮 * @Date: 2022-06-02 09:20:03 * @LastEditTime: 2022-06-29 17:42:27 - * @Description: + * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js */ @@ -16,6 +16,7 @@ import { WeaSwitch } from 'comsMobx'; import { inject, observer } from 'mobx-react'; import * as mobx from 'mobx'; import { i18n } from '../../public/i18n'; +import AttachToNumberField from "../NewNumberField"; const toJS = mobx.toJS; import '../../style/common.less'; @@ -123,9 +124,11 @@ export default class DepartmentExtendStore extends React.Component { label={`${field.label}`} error={form.getError(field)} tipPosition={tipPosition} + className={j === 1 && "minH5"} labelCol={{ span: `${field.labelcol}` }} wrapperCol={{ span: `${field.fieldcol}` }}> + {field.domkey[0] == 'dept_no' && field.viewAttr != '1' && } ), colSpan: 1 }); diff --git a/pc4mobx/organization/components/job/JobExtend.js b/pc4mobx/organization/components/job/JobExtend.js index 3338e57..e101ba9 100644 --- a/pc4mobx/organization/components/job/JobExtend.js +++ b/pc4mobx/organization/components/job/JobExtend.js @@ -2,7 +2,7 @@ * @Author: 程亮 * @Date: 2022-05-26 14:07:12 * @LastEditTime: 2022-07-12 16:25:58 - * @Description: + * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js */ @@ -18,6 +18,7 @@ import { i18n } from '../../public/i18n'; const toJS = mobx.toJS; import '../../style/common.less'; +import AttachToNumberField from "../NewNumberField"; @inject('jobExtend') @@ -122,9 +123,11 @@ export default class JobExtend extends React.Component { label={`${field.label}`} error={form.getError(field)} tipPosition={tipPosition} + className={j === 1 && "minH5"} labelCol={{ span: `${field.labelcol}` }} wrapperCol={{ span: `${field.fieldcol}` }}> + {field.domkey[0] == 'job_no' && field.viewAttr != '1' && } ), colSpan: 1 }); diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index fc4cfca..4b5ad4b 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -76,3 +76,7 @@ max-height: 350px!important; } } +//编辑页面的表单项样式 +.minH5{ + min-height: 50px!important; +} From f79a0a3ef501850749fbe000b6b9be5eb42367c1 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 7 Sep 2022 19:23:30 +0800 Subject: [PATCH 065/155] fixed --- pc4mobx/organization/apis/job.js | 3 + pc4mobx/organization/stores/job.js | 104 ++++++++------- pc4mobx/organization/stores/jobextend.js | 163 ++++++++++++----------- 3 files changed, 148 insertions(+), 122 deletions(-) diff --git a/pc4mobx/organization/apis/job.js b/pc4mobx/organization/apis/job.js index 694f9f4..4a5e8ef 100644 --- a/pc4mobx/organization/apis/job.js +++ b/pc4mobx/organization/apis/job.js @@ -78,6 +78,9 @@ export const getJobForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getSaveForm', 'GET', params); } +export const getSchemeInfo = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/sequence/getSchemeInfo', 'GET', params); +} export const getJobExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getJobBaseForm', 'GET', params); diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index a66a783..a78751a 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -306,52 +306,65 @@ export class JobStore { updateConditions(data) { if (data.sequence_id) { if (data.sequence_id.valueObj.length > 0) { - let label = "等级方案" - const index = findIndex(this.condition[1].items, { label }); - const schemeId = data.sequence_id.valueObj[0].scheme_values; - this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; - //清空职级并限制范围 - label = "职级" - const index1 = findIndex(this.condition[1].items, { label }); - let currenttime = 1657247378274 - let key = `scheme_id_${currenttime}`; - // Object.defineProperty(this.condition[1].items[index1].browserConditionParam.completeParams, [key], { - // value: schemeId, - // }) - this.condition[1].items[index1].browserConditionParam.completeParams = { - ...this.condition[1].items[index1].browserConditionParam.completeParams, - [key]: schemeId, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.conditionDataParams = { - ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, - [key]: schemeId, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.dataParams = { - ...this.condition[1].items[index1].browserConditionParam.dataParams, - [key]: schemeId, - currenttime: currenttime - } - this.condition[1].items[index1].browserConditionParam.destDataParams = { - ...this.condition[1].items[index1].browserConditionParam.destDataParams, - [key]: schemeId, - currenttime: currenttime + const params = { + "sequenceId":data.sequence_id.value } + Api.getSchemeInfo(params).then(res => { + if (res.code === 200) { + let label = "等级方案"; + const index = findIndex(this.condition[1].items, { label }); + const schemeId = res.data.id; + this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: res.data.name, id: schemeId }]; + //清空职级并限制范围 + label = "职级" + const index1 = findIndex(this.condition[1].items, { label }); + let currenttime = 1657247378274 + let key = `scheme_id_${currenttime}`; + // Object.defineProperty(this.condition[1].items[index1].browserConditionParam.completeParams, [key], { + // value: schemeId, + // }) + this.condition[1].items[index1].browserConditionParam.completeParams = { + ...this.condition[1].items[index1].browserConditionParam.completeParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.conditionDataParams = { + ...this.condition[1].items[index1].browserConditionParam.conditionDataParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.dataParams = { + ...this.condition[1].items[index1].browserConditionParam.dataParams, + [key]: schemeId, + currenttime: currenttime + } + this.condition[1].items[index1].browserConditionParam.destDataParams = { + ...this.condition[1].items[index1].browserConditionParam.destDataParams, + [key]: schemeId, + currenttime: currenttime + } + this.form1.updateFields({ + scheme_id: { + value: '' + }, + level_id: { + value: '' + }, + grade_id: { + value: '' + } + }); + this.setCondition(this.condition); + this.form1.initFormFields(this.condition); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }); + } - this.form1.updateFields({ - scheme_id: { - value: '' - }, - level_id: { - value: '' - }, - grade_id: { - value: '' - } - }); } else if (data.grade_id) { - if (data.grade_id.valueObj.length > 0) { //清空职等并限制范围 let label = "职等" const index2 = findIndex(this.condition[1].items, { label }); @@ -394,15 +407,14 @@ export class JobStore { }, error => { message.warning(error.msg); }) - } this.form1.updateFields({ level_id: { value: '' } }); + this.setCondition(this.condition); + this.form1.initFormFields(this.condition); } - this.setCondition(this.condition); - this.form1.initFormFields(this.condition); } diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index 6d24428..f77b83a 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -130,21 +130,21 @@ export class JobExtendStore { if (res.code === 200) { //默认职级职等范围 let conditions = res.data.result.conditions; - if(this.isEditor == true && this.selectedKey == '0'){ + if (this.isEditor == true && this.selectedKey == '0') { let currenttime = 1657247378274; let key0 = `scheme_id_${currenttime}`; let key1 = `level_id_${currenttime}`; let key2 = `scheme_id_${currenttime}`; let label = "职级" - const index1 = findIndex(conditions[1].items, { label }); + const index1 = findIndex(conditions[1].items, { label }); label = "职等" const index2 = findIndex(conditions[1].items, { label }); let schemeId = conditions[1].items[1].browserConditionParam.replaceDatas.length > 0 && conditions[1].items[1].browserConditionParam.replaceDatas[0].id; let levelIds = res.data.levelIds; - this.rangeLimit(key0,schemeId,index1,currenttime,conditions); - this.rangeLimitLevel(key1,key2,index2,levelIds,currenttime,conditions) + this.rangeLimit(key0, schemeId, index1, currenttime, conditions); + this.rangeLimitLevel(key1, key2, index2, levelIds, currenttime, conditions) } - + res.data.result.conditions && this.form.initFormFields(conditions); res.data.result.conditions && this.setCondition(conditions); this.tableInfo = this.handleTable(res.data.result.tables); @@ -192,63 +192,74 @@ export class JobExtendStore { if (data.sequence_id.valueObj.length > 0) { let label = "岗位序列"; const item = findIndex(this.condition[1].items, { label }); - this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].sequence_names, id: data.sequence_id.value }]; + this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].sequence_names || data.sequence_id.valueObj[0].name, id: data.sequence_id.value }]; this.condition[1].items[2].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; this.condition[1].items[3].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; - label = "等级方案" - const index = findIndex(this.condition[1].items, { label }); - const schemeId = data.sequence_id.valueObj[0].scheme_values; - this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }]; - //清空职级并限制范围 - label = "职级" - const index1 = findIndex(this.condition[1].items, { label }); - let currenttime = 1657247378274 - let key = `scheme_id_${currenttime}`; - let condition = this.rangeLimit(key,schemeId,index1,currenttime,this.condition); - this.form.updateFields({ - scheme_id: { - value: schemeId - }, - level_id: { - value: '' - }, - grade_id: { - value: '' - } - }); - this.setCondition(condition); - this.form.initFormFields(condition); - } - } else if (data.grade_id) { - let condition = this.condition; - //清空职等并限制范围 - let label = "职等" - const index2 = findIndex(this.condition[1].items, { label }); - this.condition[1].items[index2].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; - label = "职级"; - const item = findIndex(this.condition[1].items, { label }); - let grade_names = data.grade_id.valueObj.length > 0 ? data.grade_id.valueObj[0].grade_names : ""; - let value = data.grade_id.valueObj.length > 0 ? data.grade_id.value : ""; - this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: grade_names, id: value }]; - if (data.grade_id.valueObj.length > 0) { - let currenttime = 1657247378274; - let key1 = `level_id_${currenttime}`; - let key2 = `scheme_id_${currenttime}`; - let params = { - id:data.grade_id.value - }; - Api.getLevelId(params).then(res => { + + const params = { + "sequenceId": data.sequence_id.value + } + Api.getSchemeInfo(params).then(res => { if (res.code === 200) { - const levelId = res.data; - condition = this.rangeLimitLevel(key1,key2,index2,levelId,currenttime,this.condition); + label = "等级方案" + const index = findIndex(this.condition[1].items, { label }); + const schemeId = res.data.id; + this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: res.data.name, id: schemeId }]; + //清空职级并限制范围 + label = "职级" + const index1 = findIndex(this.condition[1].items, { label }); + let currenttime = 1657247378274; + let key = `scheme_id_${currenttime}`; + let condition = this.rangeLimit(key, schemeId, index1, currenttime, this.condition); + this.form.updateFields({ + scheme_id: { + value: schemeId + }, + level_id: { + value: '' + }, + grade_id: { + value: '' + } + }); + this.setCondition(condition); + this.form.initFormFields(condition); } else { message.warning(res.msg); } }, error => { message.warning(error.msg); - }) - + }); + + } + } else if (data.grade_id) { + let condition = this.condition; + //清空职等并限制范围 + let label = "职等" + const index2 = findIndex(this.condition[1].items, { label }); + this.condition[1].items[index2].browserConditionParam.replaceDatas = [{ name: "", id: "" }]; + label = "职级"; + const item = findIndex(this.condition[1].items, { label }); + let grade_names = data.grade_id.valueSpan ? data.grade_id.valueSpan.replace(/<.*?>/g, '') : ""; + let value = data.grade_id.value; + this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: grade_names, id: value }]; + let currenttime = 1657247378274; + let key1 = `level_id_${currenttime}`; + let key2 = `scheme_id_${currenttime}`; + let params = { + id: data.grade_id.value + }; + Api.getLevelId(params).then(res => { + if (res.code === 200) { + const levelId = res.data; + condition = this.rangeLimitLevel(key1, key2, index2, levelId, currenttime, this.condition); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) this.form.updateFields({ level_id: { value: '' @@ -256,35 +267,35 @@ export class JobExtendStore { }); this.setCondition(condition); this.form.initFormFields(condition); - + } } - rangeLimit(key,value,index,currenttime,condition) { + rangeLimit(key, value, index, currenttime, condition) { condition[1].items[index].browserConditionParam.completeParams = { - ...condition[1].items[index].browserConditionParam.completeParams, - [key]: value, - currenttime: currenttime - } - condition[1].items[index].browserConditionParam.conditionDataParams = { - ...condition[1].items[index].browserConditionParam.conditionDataParams, - [key]: value, - currenttime: currenttime - } - condition[1].items[index].browserConditionParam.dataParams = { - ...condition[1].items[index].browserConditionParam.dataParams, - [key]: value, - currenttime: currenttime - } - condition[1].items[index].browserConditionParam.destDataParams = { - ...condition[1].items[index].browserConditionParam.destDataParams, - [key]: value, - currenttime: currenttime - } - return condition; + ...condition[1].items[index].browserConditionParam.completeParams, + [key]: value, + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.conditionDataParams = { + ...condition[1].items[index].browserConditionParam.conditionDataParams, + [key]: value, + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.dataParams = { + ...condition[1].items[index].browserConditionParam.dataParams, + [key]: value, + currenttime: currenttime + } + condition[1].items[index].browserConditionParam.destDataParams = { + ...condition[1].items[index].browserConditionParam.destDataParams, + [key]: value, + currenttime: currenttime + } + return condition; } - rangeLimitLevel(key1,key2,index,value,currenttime,condition) { + rangeLimitLevel(key1, key2, index, value, currenttime, condition) { condition[1].items[index].browserConditionParam.completeParams = { ...condition[1].items[index].browserConditionParam.completeParams, [key1]: value, From b63006a7bc556db1e6f46ef5238a2d8bdd4c7d41 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Thu, 8 Sep 2022 17:50:03 +0800 Subject: [PATCH 066/155] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/components/NewAndEditDialog.js | 2 +- pc4mobx/organization/components/index.less | 6 ------ pc4mobx/organization/style/common.less | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 pc4mobx/organization/components/index.less diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 4ead83a..ef92d79 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -20,7 +20,7 @@ import { i18n } from '../public/i18n'; import AttachToNumberField from './NewNumberField'; -import "./index.less"; +import "../style/common.less"; export default class NewAndEditDialog extends React.Component { constructor(props) { diff --git a/pc4mobx/organization/components/index.less b/pc4mobx/organization/components/index.less deleted file mode 100644 index abeb9fb..0000000 --- a/pc4mobx/organization/components/index.less +++ /dev/null @@ -1,6 +0,0 @@ -//新建编辑弹框 -.new-edit-wrapper{ - .wea-select, .ant-select{ - width: 100%; - } -} diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 4b5ad4b..33a6c32 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -80,3 +80,10 @@ .minH5{ min-height: 50px!important; } + +//dialog弹框中下拉框组件宽度的样式问题 +.new-edit-wrapper{ + .wea-select, .ant-select{ + width: 100%; + } +} From 0b5f70a080cd392995601fbee406d51974e8b151 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 8 Sep 2022 17:50:42 +0800 Subject: [PATCH 067/155] fixed --- .../components/company/CompanyExtend.js | 2 +- .../components/company/company.js | 7 ++++++- .../organization/components/staff/index.less | 2 +- pc4mobx/organization/images/workflow.jpg | Bin 23157 -> 37548 bytes 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index ac76f0f..a3c903c 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 14:52:39 - * @LastEditTime: 2022-06-22 16:37:43 + * @LastEditTime: 2022-09-08 17:11:51 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js */ diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index f11bd3b..ec4013f 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-09-05 17:46:05 + * @LastEditTime: 2022-09-08 17:35:40 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -42,7 +42,11 @@ import NewTableDialog from '../NewTableDialog'; import NewAndEditDialog from '../NewAndEditDialog'; import NewWeaTable from '../NewWeaTableDialog'; import { renderNoright } from '../../util'; +import { + CompanyExtendStore +} from '../../stores/companyextend'; +const companyExtend = new CompanyExtendStore(); const toJS = mobx.toJS; @@ -148,6 +152,7 @@ export default class Company extends React.Component { //查看 view(id) { + //companyExtend.isEditor = true; window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${id}`, "_blank") } diff --git a/pc4mobx/organization/components/staff/index.less b/pc4mobx/organization/components/staff/index.less index 2e59f51..d2ae513 100644 --- a/pc4mobx/organization/components/staff/index.less +++ b/pc4mobx/organization/components/staff/index.less @@ -26,7 +26,7 @@ img{ margin-top: 20px; width: 1200px; - height: 200px; + height: 265px; } .action { margin-top: 20px; diff --git a/pc4mobx/organization/images/workflow.jpg b/pc4mobx/organization/images/workflow.jpg index 421100aeca2c522b23c8443d3fdf7b17b56a350e..dc930674e861cebc925ed46419d343e9dd7fc008 100644 GIT binary patch literal 37548 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

-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 literal 23157 zcmd?RXIN8d*ESp#bi~4pj-nLNk)j|VDor3*L8L@V2-2b=A|+Jmh9Hi^C{3wK3r?sB z5NSbL0xBRNASFZ+ASfjg2th)ENl5rM&OOfD_xn8WaeRNi?|9#5ABt>~y|1#@Ue`L$ zbFJ&)6>GB{QnFGY5NL<_r3{}IdF zm5{x8b8H93_FYZS%LXjvvGu=KnD#zmX;Iesp4U#LP2K zU08+7hzs#<1n28yG8?g^jOwZnX7rAwZ1`(t0*;lbgr~<0a_1;|FudECk!X2vO9YEr zix8)!F7?Xco0hs}w!y!?;%SdIMFeveUrYNdW-j&`vVA!yem9)h2$;u2D`&pC&kwxD z@ADsz7P1it>5a|-^HaviFKsexu<&R^GHJO`YYfQ?3?)Bc$-k+C7 zD8{GN6&zSlGh_%y`l5M&({yW8rz|wBkm!(_01;<@5-xPe⁢yW`}kE%}R>g~D{IrYR$*W_!f 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 From dfda1222c4854af93d48a348f5ce7b4ee639d5bd Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 16 Sep 2022 18:11:28 +0800 Subject: [PATCH 068/155] fixed --- pc4mobx/organization/apis/fieldDefined.js | 2 + pc4mobx/organization/apis/importDialog.js | 16 ++ pc4mobx/organization/apis/resourceCard.js | 0 pc4mobx/organization/components/Home.js | 1 - .../organization/components/ImportDialog.js | 240 ++++++++++++++++++ .../fieldDefinedSet/FieldDefined.js | 2 +- .../components/resource/ResourceCard.js | 0 .../organization/components/staff/Staff.js | 21 +- pc4mobx/organization/stores/fieldDefined.js | 18 +- pc4mobx/organization/stores/importDialog.js | 202 +++++++++++++++ pc4mobx/organization/stores/index.js | 8 +- pc4mobx/organization/stores/newImport.js | 2 +- pc4mobx/organization/stores/resourceCard.js | 231 +++++++++++++++++ 13 files changed, 729 insertions(+), 14 deletions(-) create mode 100644 pc4mobx/organization/apis/importDialog.js create mode 100644 pc4mobx/organization/apis/resourceCard.js create mode 100644 pc4mobx/organization/components/ImportDialog.js create mode 100644 pc4mobx/organization/components/resource/ResourceCard.js create mode 100644 pc4mobx/organization/stores/importDialog.js create mode 100644 pc4mobx/organization/stores/resourceCard.js diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js index 0d550c1..122308d 100644 --- a/pc4mobx/organization/apis/fieldDefined.js +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -7,6 +7,8 @@ import { * @param {Object} params [description] * @return {[type]} [description] */ + export const getHasRight = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getHasRight`, 'GET', params) + export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTabInfo`, 'GET', params) export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getFieldDefinedInfo`, 'GET', params) diff --git a/pc4mobx/organization/apis/importDialog.js b/pc4mobx/organization/apis/importDialog.js new file mode 100644 index 0000000..9f5f60c --- /dev/null +++ b/pc4mobx/organization/apis/importDialog.js @@ -0,0 +1,16 @@ +import { WeaTools } from 'ecCom' + +//获取导入表单 +export const getImportForm = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getCommonForm`, 'GET', params); + } + + //导入文件提交 +export const saveImport = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveCommonImport`, 'POST', params); +} + + //获取导入结果 +export const getImportResult = (params) => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportResult`, 'GET', params); +} \ No newline at end of file diff --git a/pc4mobx/organization/apis/resourceCard.js b/pc4mobx/organization/apis/resourceCard.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/components/Home.js b/pc4mobx/organization/components/Home.js index 9e68164..669915c 100644 --- a/pc4mobx/organization/components/Home.js +++ b/pc4mobx/organization/components/Home.js @@ -67,7 +67,6 @@ class Home extends React.Component {

- {/* */} {this.props.children} diff --git a/pc4mobx/organization/components/ImportDialog.js b/pc4mobx/organization/components/ImportDialog.js new file mode 100644 index 0000000..6f11810 --- /dev/null +++ b/pc4mobx/organization/components/ImportDialog.js @@ -0,0 +1,240 @@ +import { + WeaNewScroll, + WeaSearchGroup, + WeaMoreButton, + WeaDialog +} from 'ecCom' +import { + inject, + observer, +} from 'mobx-react' +import { + Spin, + Button, + Pagination, + Steps, + Upload, + Icon, + Row, + Col, + Progress +} from 'antd' + +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' + +import { + i18n +} from '../public/i18n'; +import { addContentPath } from '../util/index.js' + +const Step = Steps.Step; +const Dragger = Upload.Dragger; +const WeaTable = WeaTableNew.WeaTable; + + +@inject("importDialog") +@observer +export default class ImportDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + width: 800, + height: 600, + title: '数据导入', + } + } + + getCircle() { + let style = { + width: 20, + height: 20, + backgroundColor: '#D8D8D8', + webkitBorderRadius: 10, + mozBorderRadius: 10, + msBorderRadius: 10, + oBorderRadius: 10, + borderRadius: 10, + //paddingLeft: 6, + textAlign: 'center', + } + return style; + } + + getIllustration(val, url, index, link) { + let p; + if (index == 0) { + p = (

{i18n.label.downLoadTemplete()}: {i18n.label.importTemplate()}

); + } else { + p = (

); + } + return p; + } + + next() { + const { importDialog } = this.props; + let { current, steps } = importDialog; + current = current + 1; + if (current === steps.length) { + current = 0; + importDialog.init(); + } + importDialog.current = current; + current === steps.length - 1 && importDialog.startImport(); + } + + getForm() { + const { + importDialog + } = this.props; + const { + condition + } = importDialog; + let _arr = []; + + condition.map((c, i) => { + let arr = []; + c.items.map((field, index) => { + arr.push({ + com: ( +
+ +
+
+
{index + 1}
+
+ +
+ {this.getIllustration(field.value, field.link, index, field)} + + + + + ), + colSpan: 1 + }) + }) + _arr.push(
) + + }); + return _arr; + } + + setFileId(fileInfo) { + const { importDialog } = this.props; + fileInfo.file.response && importDialog.setExcelfile(fileInfo.file.response.data.fileid); + importDialog.filelist = fileInfo.fileList; + } + + reRenderColumns(c) { + c.forEach(item => { + if (item.dataIndex == 'operatedetail') { + item.render = function (text, record) { + return {text} + } + } + }); + } + + render() { + const { + importDialog + } = this.props, { + importVisible,steps,current, pvisable, percent, failnum, succnum, importResultTip, importResultStore, importStatus, loading, date + } = importDialog, { + width, + height, + title + } = this.state; + + const buttons = [ + (), + ]; + + + const props = { + name: 'file', + action: '/api/doc/upload/uploadFile', + accept: '.xls,.xlsx', + multiple:false + + }; + + return ( + importDialog.init()} + buttons={buttons} + style={{ width: width, height: height }} + > +
+ + {steps.map((s, i) => )} + +
+
+ { + current == 0 && + { + this.setFileId(fileInfo) + } + } + > +
+

+ +

+

点击或将文件拖拽到此区域上传

+

支持单个或批量上传,严禁上传公司内部资料及其他违禁文件

+
+
+ {this.getForm()} +
+ } + { + current == 1 &&
+ { + importStatus == 'over' &&
+
0 ? '#54D3A2' : '#FF0000' }}> + 0 ? 'check' : 'cross'} style={{ color: '#fff' }} /> +
{importResultTip} +
+ } + { + failnum > 0 && + this.reRenderColumns(c)} + /> + } + importDialog.pvisable = false} + visible={pvisable} + style={{ width: 300, height: 50 }} + > +
+ +
+
+
+ } +
+ +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index 26239ac..c25e4f5 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -186,7 +186,7 @@ export default class FieldDefined extends Component { } return ( -
+ hasRight &&
{children}
) diff --git a/pc4mobx/organization/components/resource/ResourceCard.js b/pc4mobx/organization/components/resource/ResourceCard.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 37fbfd0..5a0ce31 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -32,6 +32,7 @@ import { import '../../style/common.less'; import NewAndEditDialog from '../NewAndEditDialog'; +import ImportDialog from '../ImportDialog'; import { renderNoright } from '../../util'; @@ -42,6 +43,7 @@ const WeaTable = WeaTableNew.WeaTable; @inject('staff') +@inject('importDialog') @observer export default class Staff extends React.Component { constructor(props) { @@ -118,6 +120,16 @@ export default class Staff extends React.Component { staff.getForm(); } + import() { + const { + importDialog + } = this.props; + importDialog.importVisible=true; + importDialog.importModule='staff'; + importDialog.current = 0; + importDialog.getImportForm(); + } + log = () => { window.setLogViewProp({ @@ -221,14 +233,11 @@ export default class Staff extends React.Component { form2 } = staff; staff.setStaffName(val); - //!this.isEmptyObject(form2.getFormParams()) && staff.updateFields(val); } reRenderColumns(columns) { let _this = this; - // columns.forEach((c, index) => { - - // }) + return columns; } getTree = () => { @@ -461,12 +470,13 @@ export default class Staff extends React.Component { render() { const { - staff + staff,importDialog } = this.props; const { isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition, form, dialogLoading, isEdit, date, hasRight } = staff; + const {importVisible} = importDialog; if (hasRight === false) { return renderNoright(); @@ -529,6 +539,7 @@ export default class Staff extends React.Component { moduleName={"staff"} bindChangeEnvent={val => staff.updateConditions(val)} /> + {importVisible && }
) } diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index 037e602..d67de8a 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-09-06 09:43:39 + * @LastEditTime: 2022-09-16 11:49:18 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -672,7 +672,6 @@ export class FieldDefinedStore extends HrmBaseStore { * @param {String} key [tabKey] * @return {null} */ - @observable hasRight = ''; @action setActiveTab = (tabConfig, key) => { tabConfig.activeTabKey = key || tabConfig.tabs[0].viewCondition; const tabIndex = this.getTabIndex(this.tabConfig.tabs, key); @@ -698,7 +697,6 @@ export class FieldDefinedStore extends HrmBaseStore { datas, selectedData } = this.convertData(res.data.data, 'fieldDef'); - this.hasRight = res.data.hasRight; this.encryptEnable = res.data.encryptEnable; this.tableEditConfig.fieldDef.datas = datas; this.tableEditConfig.fieldDef.columns = this.getColumns(); @@ -1377,11 +1375,25 @@ export class FieldDefinedStore extends HrmBaseStore { return this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid == '-1'; } + @observable hasRight = ''; @action initResourceData = (module) => { this.selectedTreeNodeInfo = null; this.dropdownSelectedKey = '1'; this.moduleName = module; this.treeConfig.treeExpandKeys.length = 0; + api.getHasRight(this.moduleName).then(res => { + if (res.code === 200) { + this.hasRight = res.data.hasRight; + res.data.hasRight && this.initPage(); + } else { + message.error(res.msg); + } + }, error => { }) + + + } + + initPage = () => { api.getTree(this.moduleName).then(res => { if (res.code === 200) { // this.containerInitFinished = { diff --git a/pc4mobx/organization/stores/importDialog.js b/pc4mobx/organization/stores/importDialog.js new file mode 100644 index 0000000..210967c --- /dev/null +++ b/pc4mobx/organization/stores/importDialog.js @@ -0,0 +1,202 @@ +import { + observable, + action, + computed + } from 'mobx'; + import { + WeaForm + } from 'comsMobx'; + + import * as API from '../apis/importDialog'; + import * as Util from '../util/index'; + import { + validate, + getFormParamValue + } from '../util' + import { + message, + Modal, + Button + } from 'antd'; + import { + WeaTableNew + } from 'comsMobx' + import * as mobx from 'mobx'; + import isEmpty from 'lodash/isEmpty'; + import { + has + } from 'lodash'; + const toJS = mobx.toJS; + const { + TableStore + } = WeaTableNew; + const confirm = Modal.confirm; + import { + i18n + } from '../public/i18n'; + import { + findIndex + } from 'lodash'; + + export class ImportDialogStore { + + @observable importVisible = false; + @observable importModule = ''; //导入模块 + + + + /********************* importDialog *********************/ + + steps = [ + { title: '上传文件'}, + { title: '导入结果' } + ]; + + @observable importType = ''; + @observable current = 0; + @observable buttonTitle = ''; + @observable pvisable = false; + + + /********************* importContent *********************/ + @observable data = []; + + + @observable condition = []; + @observable filelist = []; //文件信息 + @observable excelfile = ''; //文件id + @observable templetName = "导入模板"; + @observable percent = 0; + @observable failnum = 0; //失败数量 + @observable succnum = 0; //成功数量 + @observable importResultTip = ''; //导入结果提示 + @observable importResultStore = new TableStore(); + @observable importStatus = 'importing'; //导入状态 + @observable loading = true; + @observable date = ''; + @observable pId = '';//导入记录 + + interval + + @action("获取导入表单") getImportForm() { + + const params = { + importModule: this.importModule, + } + API.getImportForm(params).then(res => { + if (res.code == 200) { + this.condition = res.data.condition; + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action("开始导入") startImport() { + if(this.filelist.length == 0) { + message.error("请上传需要导入的文件!") + this.current = this.current - 1; + return; + } + this.pvisable = true; + //导入文件提交 + let params = { + importModule: this.importModule, + excelfile:this.excelfile + } + if (this.otherParams != null) { + Object.assign(params, { + otherParams: JSON.stringify(this.otherParams) + }) + } + this.doImport(params) + this.interval = setInterval(() => this.getImportProcess(), 200); + + } + + @action("文件提交") doImport(params) { + API.saveImport(params).then(res => { + if(res.code == 200) { + this.pId = res.data.pId; + }else { + clearInterval(this.interval); + this.pvisable = false; + message.error("文件导入失败") + } + }) + } + + + + @action("获取导入进度") getImportProcess() { + if(this.pId != '') { + clearInterval(this.interval); + this.percent = 100; + const _this = this; + setTimeout(function(){ + _this.pvisable = false; + _this.getImportResult(); + },1000) + }else { + //调用导入进度api + let max = 95; + let min = this.percent; + if(this.percent < max) { + this.percent = Math.floor(Math.random() * (max - min)) + min; + } + + } + } + + @action("获取导入结果") getImportResult() { + let params = { + pId:this.pId + } + API.getImportResult(params).then((res) => { + if (res.code == 200) { + this.failnum = res.data.failnum; + this.succnum = res.data.succnum; + this.importStatus = res.data.importStatus; + if (this.failnum > 0) { + let info = i18n.label.importResourceResultInfo(); + info = info.replace('{rownum}', this.succnum + this.failnum).replace('{succnum}', this.succnum); + this.importResultTip = info; + this.importResultStore.getDatas(res.data.datas, 1); + } else { + let info = i18n.label.importResourceResultInfo1(); + info = info.replace('{rownum}', this.succnum); + this.importResultTip = info; + } + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + @action init(){ + this.filelist = []; + this.excelfile = ''; + this.importVisible = false; + this.percent = 0; + this.failnum = 0; + this.succnum = 0; + this.importResultTip = ''; + this.importResultStore = new TableStore(); + this.importStatus = 'importing'; + this.data = []; + this.condition = []; + this.pId = ''; + } + + + setExcelfile(field) { + this.excelfile = field; + } + + + + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 9648672..5c00af0 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -22,8 +22,9 @@ import {DatasImportStore} from "./datasImport"; import {HrmImportResource} from "./importresource"; import {HrmImportCommon} from "./importCommon"; import {HrmBasicDataImport} from "./import"; -import {newImportStore} from "./newImport"; -import {ResourceBasicInfoStore} from "./reserouseBasicInfo" +import {NewImportStore} from "./newImport"; +import {ResourceBasicInfoStore} from "./reserouseBasicInfo"; +import {ImportDialogStore} from "./importDialog"; module.exports = { @@ -51,6 +52,7 @@ module.exports = { hrmImportResource:new HrmImportResource(), hrmImportCommon:new HrmImportCommon(), hrmBasicDataImport:new HrmBasicDataImport(), - newImport: new newImportStore(), + newImport: new NewImportStore(), resourceBasicInfo: new ResourceBasicInfoStore(), + importDialog: new ImportDialogStore() }; diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js index 220dd76..8fe6448 100644 --- a/pc4mobx/organization/stores/newImport.js +++ b/pc4mobx/organization/stores/newImport.js @@ -38,7 +38,7 @@ import { findIndex } from 'lodash'; -export class newImportStore { +export class NewImportStore { @observable hasRight = ''; @action getHasRight(){ diff --git a/pc4mobx/organization/stores/resourceCard.js b/pc4mobx/organization/stores/resourceCard.js new file mode 100644 index 0000000..de4b4a6 --- /dev/null +++ b/pc4mobx/organization/stores/resourceCard.js @@ -0,0 +1,231 @@ +import { observable, action, toJS } from "mobx"; +import isEmpty from 'lodash/isEmpty' +import { Modal, message } from "antd"; +import { i18n } from "../public/i18n"; +import forEach from 'lodash/forEach' +import * as Api from '../apis/resourceCard'; // 引入API接口文件 + + +export class ResourceExtendStore { + @observable form = new WeaForm(); + @observable tableInfo = [] + @observable conditions = []; + @observable isEditor = false; + @observable isNew = true; + @observable loading = true; + @observable tabInfo = []; + @observable selectedKey = '0'; + @observable detailSelectedKey = '0'; + @observable topTab = []; + @observable buttons = {}; + @observable id = ''; //人员id + @observable date = ''; + @observable personalEditTables; + @observable tabkey = '0' + + + @observable selectedRowKeys = []; + @observable selectedRows = []; + + @action onRowSelect = (keys) => { + this.setSelectedRowKeys(keys); + } + + @action setSelectedRowKeys = (keys) => { + this.selectedRowKeys = keys; + } + + + @action + edit = () => { + this.isEditor = true; + this.getData(); + this.getTabInfo(); + this.detailSelectedKey = '0' + } + + init = () => { + this.detailSelectedKey = '0' + this.isEditor = false; + } + + save = () => { + if (this.loading) + return; + this.form.validateForm().then(f => { + if (f.isValid) { + this.loading = true; + if (this.personalEditTables) { + const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, + isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true + if (isPass) { + this.editResource() + } else { + this.loading = false; + } + } else { + this.editResource(); + } + } else { + f.showErrors(); + this.setDate(new Date()); + this.loading = false; + } + }) + } + + editResource = () => { + let pDatas = this.form.getFormParams(); + Api.editResource({ ...{ + id: this.id + }, + ...pDatas, + ...this.getTableEditParams() + }).then(data => { + if (data.code == 200) { + message.success(i18n.message.saveSuccess()); + this.init(); + this.getData(); + this.selectedRowKeys = []; + } else { + message.warning(data.message); + } + this.loading = false; + }, error => { + message.warning(error.message); + this.loading = false; + }) + } + + getTableEditParams = () => { + const params = {}; + this.tableInfo && this.tableInfo.forEach(t => { + t.tabinfo.datas = t.tabinfo.datas || []; + params[t.tabinfo.rownum] = t.tabinfo.datas.length; + t.tabinfo && t.tabinfo.datas && t.tabinfo.datas.forEach((item, index) => { + !isEmpty(item) && forEach(item, (value, key) => { + Object.assign(params, { + [`${key}_${index}`]: value + }); + }) + }) + }) + return params + } + + + + getData = () => { + this.setLoading(true); + let params = { + viewAttr: this.isEditor ? 2 : 1, + id: this.id, + viewCondition:this.selectedKey + } + Api.getResourceExtendForm(params).then((res) => { + if (res.code === 200) { + res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); + res.data.result.conditions && this.setConditions(res.data.result.conditions); + this.tableInfo = this.handleTable(res.data.result.tables); + this.getTabInfo(); + res.data.result.buttons && this.setButtons(res.data.result.buttons); + res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo); + this.isEditor && this.getSelectedRows(); + this.setLoading(false); + + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + + handleTable = (datas) => { + return datas && datas.map(data => { + const { tabinfo: { columns } } = data; + const length = columns.length; + columns.map(c => { + c.width = `${95 / length}%` + }) + return data + }) + } + + getTabInfo = () => { + this.tabInfo = []; + this.tableInfo && this.tableInfo.forEach((c, idx) => { + if (!c.hide) { + this.tabInfo.push({ + key: `${idx}`, + title: c.tabname, + }) + } + }) + //if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; + if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; + } + + setLoading(val) { + this.loading = val; + } + + + updateTabKey = (key) => { + this.tabKey = key; + } + + updateDetailSelectedKey =(key) => { + this.detailSelectedKey = key; + } + + updateTableInfo = (data) => { + this.tableInfo = data + } + + setSelectedKey = (key) => { + this.selectedKey = key; + } + + getSelectedRows = () => { + const selectedRows = []; + this.tableInfo.forEach(t => { + const singleTableRows = []; + t.tabinfo.datas.forEach((data, i) => { + if (data.viewAttr === 1) { + singleTableRows.push(i); + } + }); + selectedRows.push(singleTableRows); + }) + this.selectedRows = selectedRows; + } + + + setTopTab(topTab) { + this.topTab = topTab; + } + + changeData(key) { + this.setSelectedKey(key); + this.getData(); + } + + setId(id) { + this.id = id; + } + + setPersonalEditTables = (ref) => { + this.personalEditTables = ref; + } + + setConditions(conditions) { + this.conditions = conditions; + } + + setButtons(buttons) { + this.buttons = buttons; + } + + +} From 0d3d6c79f0e76be540957a50453ae1d3da3a077b Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 20 Sep 2022 14:15:13 +0800 Subject: [PATCH 069/155] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/postionrank/RankScheme.js | 4 +- .../components/resource/ResourceCard.js | 76 ++++++ pc4mobx/organization/index.js | 3 +- pc4mobx/organization/stores/index.js | 4 +- pc4mobx/organization/stores/resourceCard.js | 224 +----------------- pc4mobx/organization/style/common.less | 3 + 6 files changed, 87 insertions(+), 227 deletions(-) diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index a569b53..efe0e7c 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -55,9 +55,7 @@ export default class RankScheme extends React.Component { } componentWillUnmount() { - debugger - alert('组件销毁?') - } + } componentWillReceiveProps(nextProps) { diff --git a/pc4mobx/organization/components/resource/ResourceCard.js b/pc4mobx/organization/components/resource/ResourceCard.js index e69de29..752dd06 100644 --- a/pc4mobx/organization/components/resource/ResourceCard.js +++ b/pc4mobx/organization/components/resource/ResourceCard.js @@ -0,0 +1,76 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, + WeaAlertPage +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; + +import { renderNoright } from '../../util'; // 从util文件引入公共的方法 + + + +const toJS = mobx.toJS; +const confirm = Modal.confirm; + +@inject('resourceCard') +@observer +export default class ResourceCard extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillUnmount() { + } + + + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + resourceCard + } = this.props; + } + + render(){ + return( +
111
+ ) + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index b77ee0c..45f21a9 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -31,6 +31,7 @@ import HrmInfoExtend from "./components/resource/HrmInfoExtend"; import NewImport from "./components/newImport" import StaffWorkflowSet from "./components/staff/StaffWorkflowSet" import ResourceBasicInfo from "./components/resource/ResourceBasicInfo"; +import ResourceCard from "./components/resource/ResourceCard"; import stores from "./stores"; import "./style/index"; @@ -94,7 +95,7 @@ const Routes = ( - + ); diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 5c00af0..83502fe 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -25,6 +25,7 @@ import {HrmBasicDataImport} from "./import"; import {NewImportStore} from "./newImport"; import {ResourceBasicInfoStore} from "./reserouseBasicInfo"; import {ImportDialogStore} from "./importDialog"; +import {ResourceCardStore} from "./resourceCard"; module.exports = { @@ -54,5 +55,6 @@ module.exports = { hrmBasicDataImport:new HrmBasicDataImport(), newImport: new NewImportStore(), resourceBasicInfo: new ResourceBasicInfoStore(), - importDialog: new ImportDialogStore() + importDialog: new ImportDialogStore(), + resourceCard:new ResourceCardStore() }; diff --git a/pc4mobx/organization/stores/resourceCard.js b/pc4mobx/organization/stores/resourceCard.js index de4b4a6..baa4ecd 100644 --- a/pc4mobx/organization/stores/resourceCard.js +++ b/pc4mobx/organization/stores/resourceCard.js @@ -6,226 +6,6 @@ import forEach from 'lodash/forEach' import * as Api from '../apis/resourceCard'; // 引入API接口文件 -export class ResourceExtendStore { - @observable form = new WeaForm(); - @observable tableInfo = [] - @observable conditions = []; - @observable isEditor = false; - @observable isNew = true; - @observable loading = true; - @observable tabInfo = []; - @observable selectedKey = '0'; - @observable detailSelectedKey = '0'; - @observable topTab = []; - @observable buttons = {}; - @observable id = ''; //人员id - @observable date = ''; - @observable personalEditTables; - @observable tabkey = '0' - - - @observable selectedRowKeys = []; - @observable selectedRows = []; - - @action onRowSelect = (keys) => { - this.setSelectedRowKeys(keys); - } - - @action setSelectedRowKeys = (keys) => { - this.selectedRowKeys = keys; - } - - - @action - edit = () => { - this.isEditor = true; - this.getData(); - this.getTabInfo(); - this.detailSelectedKey = '0' - } - - init = () => { - this.detailSelectedKey = '0' - this.isEditor = false; - } - - save = () => { - if (this.loading) - return; - this.form.validateForm().then(f => { - if (f.isValid) { - this.loading = true; - if (this.personalEditTables) { - const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas, - isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true - if (isPass) { - this.editResource() - } else { - this.loading = false; - } - } else { - this.editResource(); - } - } else { - f.showErrors(); - this.setDate(new Date()); - this.loading = false; - } - }) - } - - editResource = () => { - let pDatas = this.form.getFormParams(); - Api.editResource({ ...{ - id: this.id - }, - ...pDatas, - ...this.getTableEditParams() - }).then(data => { - if (data.code == 200) { - message.success(i18n.message.saveSuccess()); - this.init(); - this.getData(); - this.selectedRowKeys = []; - } else { - message.warning(data.message); - } - this.loading = false; - }, error => { - message.warning(error.message); - this.loading = false; - }) - } - - getTableEditParams = () => { - const params = {}; - this.tableInfo && this.tableInfo.forEach(t => { - t.tabinfo.datas = t.tabinfo.datas || []; - params[t.tabinfo.rownum] = t.tabinfo.datas.length; - t.tabinfo && t.tabinfo.datas && t.tabinfo.datas.forEach((item, index) => { - !isEmpty(item) && forEach(item, (value, key) => { - Object.assign(params, { - [`${key}_${index}`]: value - }); - }) - }) - }) - return params - } - - - - getData = () => { - this.setLoading(true); - let params = { - viewAttr: this.isEditor ? 2 : 1, - id: this.id, - viewCondition:this.selectedKey - } - Api.getResourceExtendForm(params).then((res) => { - if (res.code === 200) { - res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); - res.data.result.conditions && this.setConditions(res.data.result.conditions); - this.tableInfo = this.handleTable(res.data.result.tables); - this.getTabInfo(); - res.data.result.buttons && this.setButtons(res.data.result.buttons); - res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo); - this.isEditor && this.getSelectedRows(); - this.setLoading(false); - - } else { - message.warning(res.msg); - } - }, error => { - message.warning(error.msg); - }) - } - - handleTable = (datas) => { - return datas && datas.map(data => { - const { tabinfo: { columns } } = data; - const length = columns.length; - columns.map(c => { - c.width = `${95 / length}%` - }) - return data - }) - } - - getTabInfo = () => { - this.tabInfo = []; - this.tableInfo && this.tableInfo.forEach((c, idx) => { - if (!c.hide) { - this.tabInfo.push({ - key: `${idx}`, - title: c.tabname, - }) - } - }) - //if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; - if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; - } - - setLoading(val) { - this.loading = val; - } - - - updateTabKey = (key) => { - this.tabKey = key; - } - - updateDetailSelectedKey =(key) => { - this.detailSelectedKey = key; - } - - updateTableInfo = (data) => { - this.tableInfo = data - } - - setSelectedKey = (key) => { - this.selectedKey = key; - } - - getSelectedRows = () => { - const selectedRows = []; - this.tableInfo.forEach(t => { - const singleTableRows = []; - t.tabinfo.datas.forEach((data, i) => { - if (data.viewAttr === 1) { - singleTableRows.push(i); - } - }); - selectedRows.push(singleTableRows); - }) - this.selectedRows = selectedRows; - } - - - setTopTab(topTab) { - this.topTab = topTab; - } - - changeData(key) { - this.setSelectedKey(key); - this.getData(); - } - - setId(id) { - this.id = id; - } - - setPersonalEditTables = (ref) => { - this.personalEditTables = ref; - } - - setConditions(conditions) { - this.conditions = conditions; - } - - setButtons(buttons) { - this.buttons = buttons; - } - - +export class ResourceCardStore { + } diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 33a6c32..024cb19 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -87,3 +87,6 @@ width: 100%; } } + +//我的卡片样式 + From 01dc126302e8d78bed9b9225a20db17dbe468a5b Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 22 Sep 2022 18:55:14 +0800 Subject: [PATCH 070/155] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/resource/FormItem.js | 59 ++++++ .../components/resource/IframeItem.js | 44 ++++ .../components/resource/ResourceCard.js | 182 ++++++++++++++++- pc4mobx/organization/images/resource.png | Bin 0 -> 7207 bytes pc4mobx/organization/stores/resourceCard.js | 117 ++++++++++- pc4mobx/organization/style/card.less | 192 ++++++++++++++++++ pc4mobx/organization/style/common.less | 2 - 7 files changed, 583 insertions(+), 13 deletions(-) create mode 100644 pc4mobx/organization/components/resource/FormItem.js create mode 100644 pc4mobx/organization/components/resource/IframeItem.js create mode 100644 pc4mobx/organization/images/resource.png create mode 100644 pc4mobx/organization/style/card.less diff --git a/pc4mobx/organization/components/resource/FormItem.js b/pc4mobx/organization/components/resource/FormItem.js new file mode 100644 index 0000000..571b717 --- /dev/null +++ b/pc4mobx/organization/components/resource/FormItem.js @@ -0,0 +1,59 @@ +import { + WeaFormItem, +} from 'ecCom' + +import { + Spin, + Button, +} from 'antd' + +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; +import Group from '../group/Group'; +import { chunk } from 'lodash'; + +export default class FormItem extends React.Component { + constructor(props) { + super(props); + this.state = { + } + } + + render() { + const { + groupInfo + } = this.props, { + } = this.state; + const newData = chunk(groupInfo.items, 3); + + return ( +
+
+
+

{groupInfo.title}

+
+
+ {newData.map((item, index) => { + return ( +
+ {item.map((subItem) => { + return ( +
+ {subItem.fieldId} + {subItem.fieldValue} +
+ + ); + })} +
+ ); + })} +
+ +
+ ) + } +} diff --git a/pc4mobx/organization/components/resource/IframeItem.js b/pc4mobx/organization/components/resource/IframeItem.js new file mode 100644 index 0000000..1f17337 --- /dev/null +++ b/pc4mobx/organization/components/resource/IframeItem.js @@ -0,0 +1,44 @@ +import { + WeaFormItem, +} from 'ecCom' + +import { + Spin, + Button, +} from 'antd' + +import { + i18n +} from '../../public/i18n'; + +import '../../style/common.less'; +import Group from '../group/Group'; +import { chunk } from 'lodash'; + +export default class IframeItem extends React.Component { + constructor(props) { + super(props); + this.state = { + } + } + + render() { + const { + iframeInfo + } = this.props, { + } = this.state; + + return ( +
+
+
+

{iframeInfo.title}

+
+
+ + + {this.props.children} + +
+ ) + } +} + +export default Home diff --git a/pc4backstage/integration/components/LDAPInit/index.js b/pc4backstage/integration/components/LDAPInit/index.js new file mode 100644 index 0000000..17f5fbe --- /dev/null +++ b/pc4backstage/integration/components/LDAPInit/index.js @@ -0,0 +1,119 @@ +import React from 'react'; +import {toJS} from 'mobx'; +import {inject, observer} from "mobx-react"; +import {WeaRightMenu, WeaTop, WeaFormItem, WeaSearchGroup, WeaLocaleProvider, WeaNewScroll} from 'ecCom'; +import {WeaSwitch} from "comsMobx"; +import {Button, Spin} from 'antd'; + +const {getLabel} = WeaLocaleProvider; + +@inject("ldapInit") +@observer +export default class LDAPInit extends React.Component{ + constructor(props) { + super(props); + } + + componentDidMount() { + const {ldapInit} = this.props; + ldapInit.getForm(); + } + + componentWillReceiveProps(nextProps) { + if(this.props.location.key != nextProps.location.key) { + this.props.ldapInit.getForm(); + } + } + + getRightMenus = () => { + return [{ + key: "init", + icon: , + content: getLabel(20873, "初始化"), + onClick: () => this.onMenuClick("init") + }] + } + + getBtns = () => { + return [ + + ] + } + + onMenuClick = (type) => { + const {ldapInit} = this.props; + const {save, newForm} = ldapInit; + + if(type === "init") { + newForm.validateForm().then(f => { + if(f.isValid) { + save(); + }else { + f.showErrors(); + } + }) + } + } + + getSearch = (form, condition) => { + const {isFormInit} = form; + const formParams = form.getFormParams(); + let group = []; + + isFormInit && condition && condition.map((c, index) => { + let items = []; + c.items && c.items.map(fields => { + items.push({ + com: ( + + ) + }) + }) + group.push() + }) + + return group; + } + + render() { + const {ldapInit} = this.props; + const {status, newForm} = ldapInit; + const {loading, condition} = toJS(status); + const collectParams = { + favname: "LDAP初始化", + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/LDAPInit", + importantlevel: 1 + } + + return ( + + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenus()} + dropMenuProps={{collectParams}} + /> + + + {this.getSearch(newForm, condition)} + + + + ) + } + +} \ No newline at end of file diff --git a/pc4backstage/integration/components/Webservice/index.js b/pc4backstage/integration/components/Webservice/index.js new file mode 100644 index 0000000..a8fd748 --- /dev/null +++ b/pc4backstage/integration/components/Webservice/index.js @@ -0,0 +1,206 @@ +import React from "react"; +import { + toJS, +} from "mobx"; +import { + inject, + observer, +} from "mobx-react"; +import { + WeaLocaleProvider, + WeaLeftRightLayout, + WeaTop, + WeaTab, + WeaRightMenu, +} from "ecCom"; +import { + WeaTableNew, +} from "comsMobx"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; +import OrganizationTree from '../../public/OrganizationTree'; +import WebServiceCreate from './webServiceCreate'; + +const {WeaTable} = WeaTableNew; +const {getLabel} = WeaLocaleProvider; + +@inject("webservice") +@observer +export default class Main extends React.Component { + constructor(props) { + super(props); + this.state = { + showSearchAd: false, + } + } + + componentDidMount() { + const { webservice } = this.props; + webservice.doInit(); + } + + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key) { + const { webservice } = this.props; + webservice.doInit(); + } + } + + // 分权刷新 + refreshData = (id, type) => { + const { + webservice + } = this.props; + if("1" === type) { + // 如果点击的是分部 + webservice.setState({ + subcompanyid: id, + }); + } else{ + webservice.setState({ + subcompanyid: "", + }); + } + webservice.getConditions(webservice.getTableInfo); + } + + getSearchs = () => { + const { webservice } = this.props; + const { status: { condition }, form } = webservice; + return IntegrationUtil.getAdvancedItem( + form, + condition, + this.handleSearchFun, + false, + this && this.props && this.props.ecId || '', + "integrationWebservice" + ); + } + + handleSearchFun = () => { + const { webservice } = this.props; + webservice.setState({ + subcompanyid: webservice.form.getFormParams().subcompanyid1, + }); + webservice.getTableInfo(); + this.setState({ showSearchAd: false }); + } + + getTabButtonsAd = () => { + const { webservice } = this.props; + const { form } = webservice; + return IntegrationUtil.getSearchBtns( + this.handleSearchFun, + () => form.reset(), + () => this.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "integrationWebservice" + ); + } + + getColumns = (columns) => { + const { webservice } = this.props; + return columns.map(column => { + if (column.dataIndex == 'customname') { + return { + ...column, + render: (text, record, index) => { + return ( webservice.edit(record)}>{record.customname}); + } + } + } else if (column.dataIndex == 'subcompanyid') { + return { + ...column, + render: (text, record, index) => { + return ({record.subcompanyidspan}); + } + } + } else { + return column; + } + }); + } + + render() { + const { + webservice + } = this.props, { + status, + form, + tableStore, + getRightMenuData, + getTopButton, + onOperatesClick, + hasRight, + rightLoading, + } = webservice, { + loading, + advanceHeight, + hasNonStandard, + nonStandLoading, + collectParams, + hasOrganization, + subcompanyid, + } = toJS(status), { + showSearchAd, + } = this.state; + + return (nonStandLoading + ? null + : hasNonStandard + ? rightLoading + ? null + : hasRight + ? + } + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + showDropIcon={true} + dropMenuDatas={getRightMenuData()} + dropMenuProps={{collectParams}} + loading={loading} + /> + } + > + this.setState({showSearchAd})} + hideSearchAd={() => this.setState({showSearchAd: false})} + searchsAd={this.getSearchs()} + searchsBaseValue={form.getFormParams().customname || ''} + onSearch={this.handleSearchFun} + onSearchChange={value => form.updateFields({customname: {value}})} + /> + + + + + : + : + ); + } +} diff --git a/pc4backstage/integration/components/Webservice/webServiceCreate.js b/pc4backstage/integration/components/Webservice/webServiceCreate.js new file mode 100644 index 0000000..6fb925d --- /dev/null +++ b/pc4backstage/integration/components/Webservice/webServiceCreate.js @@ -0,0 +1,273 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import {checkTableFieldValueUnique} from "../../apis/CommonService"; +import {WeaSwitch} from 'comsMobx' +import { + WeaLocaleProvider, + WeaDialog, + WeaSearchGroup, + WeaButtonIcon, + WeaTableEditable, + WeaRightMenu, + WeaFormItem, + WeaTools, +} from "ecCom"; +import { isEmpty } from 'lodash'; +import { Spin, Button } from 'antd'; + +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; +const { GeneralTitleColor } = IntegrationUtil; + +@inject("webservice") +@observer +export default class Main extends React.Component { + onCancel = () => { + const { webservice } = this.props; + webservice.doInitCreate(); + } + + getOtherCom = () => { + const { webservice } = this.props; + const { parseWSDL, formCreate } = webservice; + const allParams = formCreate.getFormParams(); + const com = ; + return com; + } + + onChange = (datas) => { + const { webservice } = this.props; + const { setState } = webservice; + setState({wsdlParamData:datas}); + } + + save = () => { + const { webservice } = this.props; + let { status: { wsdlParamData }, formCreate, doSave } = webservice; + wsdlParamData = toJS(wsdlParamData); + const result = this.refs.serviceRegister.doValidate(); + formCreate.validateForm().then(f => { + if (f.isValid) { + if (result.pass) { + wsdlParamData.forEach((v, l) => { + if (v.methodid.indexOf('$') > -1) { + wsdlParamData[l].methodid = '0'; + } + }); + doSave(wsdlParamData); + } + } else { + f.showErrors(); + } + }) + } + + del = () => { + const { webservice } = this.props; + const { delList, status: { webserviceid } } = webservice; + delList({ pointid: webserviceid }, false); + } + + onClick = type => { + const { webservice } = this.props; + const { formCreate, status } = webservice; + let checkParams = { + tableName: 'wsregiste', + fieldName: 'customname', + fieldValue: formCreate.getFormParams().customname.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: webservice.editRecordId + }; + switch (type) { + case 'BTN_Save': + checkTableFieldValueUnique(checkParams).then(result => { + if(result&&result.isNotUnique) { + formCreate.showError('customname',getLabel('129943','名称已存在')); + }else { + this.save(); + } + }); + break; + case 'BTN_Delete': this.del(); break; + } + } + + getSearchs = (form, datas, needTigger = true, center = true, lableCol, fieldcol, otherCom = null) => { + const { webservice } = this.props; + const { isFormInit } = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && datas && datas.map((c, index) => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + { + if(getKey(fields) === 'customname') { + let checkParams = { + tableName: 'wsregiste', + fieldName: 'customname', + fieldValue: form.getFormParams().customname.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: webservice.editRecordId + }; + checkTableFieldValueUnique(checkParams).then(result => { + if(result&&result.isNotUnique) { + form.showError('customname',getLabel('129943','名称已存在')); + } + }); + } + }} + /> + {fields.showOtherCom && otherCom} + ), + colSpan: 1 + }) + }); + if (needTigger) { + group.push() + } else { + group.push() + } + }); + return group; + } + + getBtn = () => { + const { webservice } = this.props; + const { rightMenuForm } = webservice.status; + let btnArr = []; + + rightMenuForm && rightMenuForm.map( v => { + if(v.type == 'BTN_Save') { + btnArr.push( + + ) + } + }) + + return btnArr; + } + + getRightMenu = () => { + const { webservice } = this.props; + const { rightMenuForm } = webservice.status; + let btnArr = []; + + rightMenuForm && rightMenuForm.map( v => { + if(v.type == 'BTN_Save') { + btnArr.push({ + key: v.type, + content: v.menuName, + icon: , + onClick: () => this.onClick(v.type), + }) + } + }) + + return btnArr; + } + + render() { + const { + webservice, + } = this.props, { + status: { + type, + visible, + conditionCreate, + loadingCreate, + columns, + showRegister, + analysisWSDL, + selectedRowKeys, + wsdlParamData, + wsdlParamPass, + }, + formCreate, + setState, + addRegister, + delRegister, + } = webservice; + const validator = { + rules: { + methodname: 'required', + }, + errorMessage: { + required: getLabel(385869,'此项必填'), + }, + }, collectParams = { + favname: getLabel(33717, "WebService注册"), + favouritetype: 2, + objid: 0, + importantlevel: 1, + link: 'wui/engine.html#/main/integration/webservice', + }; + const title = type === 'create' ? getLabel('365,33717','新建WebService注册') : getLabel('26473,33717','编辑WebService注册'); + return ( + + + {this.getSearchs(formCreate, toJS(conditionCreate), true, true, 7, 16, this.getOtherCom())} + +
+ setState({ showRegister })} + customComponent={[ + , + , + ]}> setState({ selectedRowKeys })} + columns={toJS(columns)} + onChange={this.onChange} /> + +
+
+
+
+ ); + } +} diff --git a/pc4backstage/integration/components/accountSetting.js b/pc4backstage/integration/components/accountSetting.js new file mode 100644 index 0000000..83195bf --- /dev/null +++ b/pc4backstage/integration/components/accountSetting.js @@ -0,0 +1,269 @@ +import React from 'react'; +import { + inject, + observer +} from "mobx-react"; +import { + toJS +} from 'mobx'; +import { + Button, + message +} from 'antd'; +import { + WeaLocaleProvider, + WeaTop, + WeaRightMenu, + WeaFormItem, + WeaSearchGroup, + WeaTools, +} from "ecCom"; +import * as IntegrationUtil from "../util/IntegrationUtil"; +import { + WeaSwitch +} from "comsMobx"; +import { checkValidateCode } from "../apis/CommonService"; +import NoRight from '../public/NoRight'; + +const getLabel = WeaLocaleProvider.getLabel; +const { getKey } = WeaTools; + +@inject("accountSettingStore") +@observer +class Main extends React.Component { + constructor(props) { + super(props); + this.state = { + src: (window.ecologyContentPath || "") + '/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4', + num: 0 + } + } + + componentDidMount() { + const { + accountSettingStore + } = this.props; + const { + doInit, + singleInit + } = accountSettingStore; + + if (this.props.params.id !== undefined) { + singleInit(this.props.params.id); + } else { + doInit(); + } + } + + getDropMenuDatas = () => { + const { + accountSettingStore + } = this.props; + const { + doInit, + buttons + } = accountSettingStore; + const btnArr = []; + toJS(buttons).forEach(item => { + btnArr.push({ + key: item.type, + icon: , + content: item.menuName, + onClick: () => this.clickEvent(item.type) + }) + }) + return btnArr; + } + + getWeaTopBtns = () => { + return [ + + ] + } + + clickEvent = type => { + const { + accountSettingStore + } = this.props; + const { + status, + setStatus, + form, + singleForm, + condition, + doSave, + doInit + } = accountSettingStore; + if("BTN_Save" == type) { + const params = form.getFormParams() || {}; + const otherParams = singleForm.getFormParams(); + + if(this.props.params.id == undefined){ + if(params.validatecode !== undefined) { + if(!(params.validatecode && params.validatecode.trim())) { + message.error(getLabel('390564','"验证码"未填写')); + return; + } + checkValidateCode({validatecode: params.validatecode}).then(result => { + if(result&&result.isValid) { + doSave(this.props.params.id !== undefined ? { ...otherParams, + sysid: this.props.params.id + } : params, doInit); + this.setState({num: this.state.num + 1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }) + }else { + form.showError('validatecode',getLabel('129308','无效的验证码!')); + this.setState({num: this.state.num+1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }); + return; + } + }) + }else { + doSave(this.props.params.id !== undefined ? { ...otherParams, + sysid: this.props.params.id + } : params, doInit); + this.setState({num: this.state.num + 1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }) + } + }else{ + if(otherParams.validatecode !== undefined) { + if(!(otherParams.validatecode && otherParams.validatecode.trim())) { + singleForm.showError('validatecode', getLabel('390564','"验证码"未填写')); + return; + } + checkValidateCode({validatecode: otherParams.validatecode}).then(result => { + if(result&&result.isValid) { + doSave(this.props.params.id !== undefined ? { ...otherParams, + sysid: this.props.params.id + } : params); + this.setState({num: this.state.num + 1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }) + }else { + singleForm.showError('validatecode',getLabel('129308','无效的验证码!')); + this.setState({num: this.state.num+1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }); + return; + } + }) + }else { + doSave(this.props.params.id !== undefined ? { ...otherParams, + sysid: this.props.params.id + } : params); + this.setState({num: this.state.num + 1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }) + } + } + } + } + + getFormSearchs = (form, datas=[]) => { + const { isFormInit } = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && datas && datas.map((c, index) => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + { + getKey(fields) == 'validatecode' + ?
+ + { + this.setState({num: this.state.num+1}, function() { + this.setState({src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}`}) + }) + }}> +
+ : + } +
), + colSpan: 1 + }) + }); + group.push(); + }); + return group; + } + + render() { + const { + accountSettingStore + } = this.props; + const { + status, + form, + condition, + singleForm, + singleCondition, + hasRight + } = accountSettingStore; + const { + loading, + formLoading + } = toJS(status); + + return ( + formLoading + ? null + : hasRight + ? + + } + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + dropMenuProps={{ + collectParams: { + favname: `${getLabel("19667", "账号设置")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/129787", + importantlevel: 1 + } + }} + > + {this.props.params.id !== undefined ? ( +
+ {this.getFormSearchs(singleForm, toJS(singleCondition))} +
+ ) : ( +
+ {this.getFormSearchs(form, toJS(condition))} +
+ )} +
+
+ : + ) + } +} + +export default Main; \ No newline at end of file diff --git a/pc4backstage/integration/components/authenticationApp/AppDataMappingEditDialog.js b/pc4backstage/integration/components/authenticationApp/AppDataMappingEditDialog.js new file mode 100644 index 0000000..f9ead74 --- /dev/null +++ b/pc4backstage/integration/components/authenticationApp/AppDataMappingEditDialog.js @@ -0,0 +1,167 @@ +import React from "react"; +import {inject, observer} from "mobx-react"; +import { Button} from "antd"; +import {toJS} from "mobx"; +import {WeaSwitch} from "comsMobx"; +import {WeaDialog, WeaLocaleProvider, WeaTools, WeaSearchGroup, WeaFormItem, WeaRightMenu} from "ecCom"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import {checkUserMappingLoginIdUnique,checkUserMappingAppLoginIdUnique} from "../../apis/AuthenticationCenterService" +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +const store = ["authenticationCenterStore"]; + +@inject(...store) +@observer +export default class AppDataMappingEditDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + collectParams: { + favname: `${getLabel(381908, "统一认证中心")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/AuthenticationCenter", + importantlevel: 1 + } + } + } + + render() { + const {authenticationCenterStore} = this.props; + const status = toJS(authenticationCenterStore.status); + const {collectParams} = this.state; + return authenticationCenterStore.setState({appEditFormDetailDataMappingDialogVisible: false})} + visible={status.appEditFormDetailDataMappingDialogVisible} + style={{width: 700, height: 400}} + hasScroll + moduleName="integration" + buttons={[ + + ]} + moreBtn={{ + datas: this.getRightMenu(), + collectParams: collectParams + }} + > + + { + authenticationCenterStore.registerAppDataMappingEditForm.render({col: 1},{ + onChange: (v)=> { + }, + isHide: (key, formParams) => {} + + },true,(c, idx)=>{ + if(idx==0){ + let items = []; + let bottomDis = 0; + let form = authenticationCenterStore.registerAppDataMappingEditForm; + let formParams = form.getFormParams(); + c.items.map(fields => { + if(getKey(fields) == 'apploginid') { + bottomDis = 15; + }else { + bottomDis = 0; + } + items.push({ + com: ( +
+ + + { + if(getKey(fields) === 'userid') { + let params={userid:form.getFormParams().userid,operation:'getUserInfo'}; + authenticationCenterStore.getRegisterAppDataMappingOperation(params,(result)=>{ + if(result) { + if(result.depname) { + form.updateFields({depname: result.depname}); + } + if(result.subname) { + form.updateFields({subname: result.subname}); + } + if(result.loginid) { + form.updateFields({loginid: result.loginid}); + } + } + }) + } + }} + /> + {/*{getKey(fields)==='account_rules'&&formParams.account_rules>5?:""}*/} + + +
), + colSpan: 1, + hide: form.isHide(fields, (key, formParams) => { + let hide = false; + if ('definebroswerType' == key && formParams.account_rules !== '7') { + hide = true; + } + return hide; + }), + onChange: (v)=> { + + } + }) + }); + + return + } + })} +
+
+ } + + getRightMenu() { + let btnArr = [ + { + key: 'BTN_SAVE', + icon: , + content : `${getLabel(86,'保存')}`, + onClick : () => this.onRightMenuClick('BTN_SAVE') + } + ]; + return btnArr; + } + + onRightMenuClick = (type) => { + const {authenticationCenterStore} = this.props; + const {registerAppEditForm,registerAppDataMappingEditForm} = authenticationCenterStore; + if(type == 'BTN_SAVE'){ + let id=authenticationCenterStore.registerAppDataMappingId||""; + let appid = registerAppEditForm.getFormParams().appid; + let loginid = registerAppDataMappingEditForm.getFormParams().loginid; + let apploginid = registerAppDataMappingEditForm.getFormParams().apploginid; + checkUserMappingLoginIdUnique({appId: appid, idValue: id, loginId: loginid, appLoginId: apploginid}).then(result=>{ + if(result&&result.isNotUnique) { + registerAppDataMappingEditForm.showError('userid',getLabel('31053','已存在,请确认')); + }else{ + checkUserMappingAppLoginIdUnique({appId: appid, idValue: id, loginId: loginid, appLoginId: apploginid}).then(result=>{ + if(result&&result.isNotUnique) { + registerAppDataMappingEditForm.showError('apploginid',getLabel('31053','已存在,请确认')); + return; + }else{ + IntegrationUtil.onCheck(registerAppDataMappingEditForm,function () { + let operation = id==""?"adduser":"edit"; + let params = Object.assign({id:id,appid:appid,operation:operation}, registerAppDataMappingEditForm.getFormParams()); + authenticationCenterStore.getRegisterAppDataMappingOperation(params); + }); + } + }); + } + }); + } + } +} diff --git a/pc4backstage/integration/components/authenticationApp/AppDataMappingImportDialog.js b/pc4backstage/integration/components/authenticationApp/AppDataMappingImportDialog.js new file mode 100644 index 0000000..f144493 --- /dev/null +++ b/pc4backstage/integration/components/authenticationApp/AppDataMappingImportDialog.js @@ -0,0 +1,169 @@ +import { Button } from "antd"; +import { WeaSwitch } from "comsMobx"; +import { WeaDialog, WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaUpload } from "ecCom"; +import { toJS } from "mobx"; +import { inject, observer } from "mobx-react"; +import React from "react"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +const getLabel = WeaLocaleProvider.getLabel; + +const store = ["authenticationCenterStore"]; + +@inject(...store) +@observer +export default class AppDataMappingImportDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + file: [], + filelist: [], + collectParams: { + favname: `${getLabel(381908, "统一认证中心")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/AuthenticationCenter", + importantlevel: 1 + } + } + } + + componentDidMount() { + this.setState({ + file: [], + filelist: [], + }) + } + + render() { + const { authenticationCenterStore } = this.props; + const status = toJS(authenticationCenterStore.status); + const {collectParams} = this.state; + + return authenticationCenterStore.setState({ appEditFormDetailDataMappingImportDialogVisible: false })} + visible={status.appEditFormDetailDataMappingImportDialogVisible} + style={{ width: 700, height: 400 }} + hasScroll + moduleName="integration" + buttons={[ + + ]} + moreBtn={{ + datas: this.getRightMenu(), + collectParams: collectParams + }} + > + + { + authenticationCenterStore.registerAppDataMappingImportForm.render({ col: 1, center: true }, { + onChange: (v) => { + }, + isHide: (key, formParams) => { } + + }, true, (c, idx) => { + if (idx == 0) { + let items = []; + let form = authenticationCenterStore.registerAppDataMappingImportForm; + let formParams = form.getFormParams(); + c.items.map((fields, index) => { + if (index === 0) { + items.push({ + com: ( + +
+
+ {this.setState({ file: ids, filelist: list }) }} + > + + +
+
+ {this.state.filelist.length == 0 ?

{getLabel('384040','未选择任何文件')}

: this.state.filelist.map(file =>

{file.filename}

)} +
+
+
), + colSpan: 1, + hide: form.isHide(fields, (key, formParams) => { + let hide = false; + return hide; + }), + }) + + } else { + items.push({ + com: ( + +
+ +
+
), + colSpan: 1, + hide: form.isHide(fields, (key, formParams) => { + let hide = false; + return hide; + }), + }) + } + }); + return + } + })} +
+
+ } + + getRightMenu() { + let btnArr = [ + { + key: 'BTN_SAVE', + icon: , + content: `${getLabel(18596, '导入')}`, + onClick: () => { this.onRightMenuClick('BTN_SAVE') } + } + ]; + return btnArr; + } + + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { registerAppEditForm, registerAppDataMappingImportForm } = authenticationCenterStore; + if (type == 'BTN_SAVE') { + //导入 + IntegrationUtil.onCheck(registerAppDataMappingImportForm, () => { + let operation = "excelImport"; + let params = Object.assign({ appid: registerAppEditForm.getFormParams().appid, operation: operation }, registerAppDataMappingImportForm.getFormParams()); + params.file = JSON.stringify(this.state.file); + params.filelist = JSON.stringify(this.state.filelist); + authenticationCenterStore.getRegisterAppDataMappingOperation(params, (result) => { + authenticationCenterStore.setState({ resultTableHeader: result.resultTableHeader, resultTableData: result.resultTableData }) + authenticationCenterStore.setState({ appEditFormDetailDataMappingImportDialogVisible: false, appEditFormDetailDataMappingImportResultDialogVisible: true }) + }); + }); + + } + + } + +} diff --git a/pc4backstage/integration/components/authenticationApp/AppDataMappingImportResultDialog.js b/pc4backstage/integration/components/authenticationApp/AppDataMappingImportResultDialog.js new file mode 100644 index 0000000..930706b --- /dev/null +++ b/pc4backstage/integration/components/authenticationApp/AppDataMappingImportResultDialog.js @@ -0,0 +1,75 @@ +import React from "react"; +import {inject, observer} from "mobx-react"; +import { Button} from "antd"; +import {toJS} from "mobx"; +import {WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaRightMenu,WeaTable} from "ecCom"; +const getLabel = WeaLocaleProvider.getLabel; + +const store = ["authenticationCenterStore"]; + +const transformArray = function (origin) { + if (origin.length === 0) { + return false; + } + return Object.keys(origin[0]).map(item => { + return { + title: origin[0][item], + dataIndex: item, + key: item, + } + }) +} + +@inject(...store) +@observer +export default class AppDataMappingImportResultDialog extends React.Component { + render() { + const {authenticationCenterStore} = this.props; + const status = toJS(authenticationCenterStore.status); + const {resultTableHeader,resultTableData} = toJS(status); + + return authenticationCenterStore.setState({appEditFormDetailDataMappingImportResultDialogVisible: false})} + visible={status.appEditFormDetailDataMappingImportResultDialogVisible} + style={{width: 700, height: 600}} + hasScroll + moduleName="integration" + buttons={[ + + ]} + moreBtn={[]} + > + + + + + + + } + + getRightMenu() { + let btnArr = [ + { + key: 'BTN_SAVE', + icon: , + content : `${getLabel(309,'关闭')}`, + onClick : () => {this.onRightMenuClick('BTN_SAVE')} + } + ]; + return btnArr; + } + + onRightMenuClick = (type) => { + const {authenticationCenterStore} = this.props; + if(type == 'BTN_SAVE'){ + //关闭 + authenticationCenterStore.setState({appEditFormDetailDataMappingImportResultDialogVisible: false}); + } + + } + +} diff --git a/pc4backstage/integration/components/authenticationApp/AppEditDetailDialog.js b/pc4backstage/integration/components/authenticationApp/AppEditDetailDialog.js new file mode 100644 index 0000000..24b6dbf --- /dev/null +++ b/pc4backstage/integration/components/authenticationApp/AppEditDetailDialog.js @@ -0,0 +1,791 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { message, Button } from "antd"; +import { toJS } from "mobx"; +import { WeaSwitch, WeaTableNew } from "comsMobx"; +import { WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaFormItem, WeaRightMenu, WeaTab, WeaNewScroll, WeaButtonIcon, WeaPopoverHrm } from "ecCom"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import AppDataMappingEditDialog from "./AppDataMappingEditDialog"; +import AppDataMappingImportDialog from "./AppDataMappingImportDialog"; +import AppDataMappingImportResultDialog from "./AppDataMappingImportResultDialog"; +import uuid from 'uuid'; +import { checkTableFieldValueUnique } from "../../apis/CommonService"; +import NewShare from "./NewShare"; +import UploadPic from '../../public/UploadPic'; +import copy from 'copy-to-clipboard'; + +const getLabel = WeaLocaleProvider.getLabel; +const { WeaTable } = WeaTableNew; +const store = ["authenticationCenterStore"]; + +@inject(...store) +@observer +export default class AppEditDetailDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + showSearchAd: false, + tokenTopTab: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(81711, "基本信息")}`, + viewcondition_dt: 0 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(131274, "运行日志")}`, + viewcondition_dt: 3 + } + ], + tokenTopTabAll: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(81711, "基本信息")}`, + viewcondition_dt: 0 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(381943, "数据映射")}`, + viewcondition_dt: 2 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(131274, "运行日志")}`, + viewcondition_dt: 3 + } + ], + topTab: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(81711, "基本信息")}`, + viewcondition_dt: 0 + }, { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: getLabel('501806', '授权设置'), + viewcondition_dt: 1 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(131274, "运行日志")}`, + viewcondition_dt: 3 + } + ], + topTabAll: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(81711, "基本信息")}`, + viewcondition_dt: 0 + }, { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: getLabel('501806', '授权设置'), + viewcondition_dt: 1 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(381943, "数据映射")}`, + viewcondition_dt: 2 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(131274, "运行日志")}`, + viewcondition_dt: 3 + } + ], + collectParams: { + favname: `${getLabel(381908, "统一认证中心")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/AuthenticationCenter", + importantlevel: 1 + } + } + } + + componentWillMount () { + this.setState({ + showSearchAd: false, + }) + } + + render () { + const { + authenticationCenterStore, + } = this.props, { + status, + registerAppEditForm, + tableStore2, + tableStore3, + } = authenticationCenterStore, { + registerAppEditFormCodition, + appEditFormDetailDialogVisible, + registerAppId = "", + editDetailDialogSelectedKey = "0", + } = status, { + collectParams, + } = this.state; + + return + + + {this.getTabComp()} + + { + (registerAppId && editDetailDialogSelectedKey == 0) || (registerAppId == "") + ? this.getForm(registerAppEditForm, toJS(registerAppEditFormCodition)) + : + } + + + + + + + + } + + /** + * 关闭弹窗 + */ + closeEditDialog = () => { + const { authenticationCenterStore } = this.props; + + authenticationCenterStore.setState({ + appEditFormDetailDialogVisible: false, + registerAppId: "", + editDetailDialogSelectedKey: "0", + }); + + this.setState({ + showSearchAd: false, + }) + } + + /** + * 是否渲染weatab组件 + */ + getTabComp = () => { + const { + authenticationCenterStore, + } = this.props, { + status, + } = authenticationCenterStore, { + registerAppId, + editDetailDialogSelectedKey, + } = status, { + showSearchAd, + } = this.state; + + return registerAppId + ? + : null; + } + + /** + * 编辑的时候获取weatab的datas数据 + */ + getTabDatas = () => { + const { + authenticationCenterStore, + } = this.props, { + registerAppEditFormOrg, + } = authenticationCenterStore, { + topTab, + topTabAll, + tokenTopTab, + tokenTopTabAll, + } = this.state, { + account_rules, + auth_type_, + } = registerAppEditFormOrg.getFormParams(); + + if (['6', '7'].includes(account_rules)) { + return (auth_type_ === "TOKEN" ? tokenTopTabAll : topTabAll); + } else { + return (auth_type_ === "TOKEN" ? tokenTopTab : topTab); + } + } + + /** + * weatab高级搜索的方法 + */ + showSearchAd = bool => this.setState({ showSearchAd: bool }); + + hideSearchAd = () => this.setState({ showSearchAd: false }); + + /** + * 高级搜索 + */ + getAdvancedSearch = () => { + const { + authenticationCenterStore + } = this.props, { + searchForm2, + status, + } = authenticationCenterStore, { + condition2 = [], + } = status; + + return IntegrationUtil.getAdvancedItem( + searchForm2, + condition2, + this.onSearch, + false, + this && this.props && this.props.ecId || '', + "IntegrationAuthAppEditDetail", + ); + }; + + onSearch = () => { + const { + authenticationCenterStore + } = this.props, { + status, + } = authenticationCenterStore; + + authenticationCenterStore.getRegisterAppDataMappingList({ id: status.registerAppId }); + this.setState({ showSearchAd: false }); + } + + getTabButtonsAd () { + const { + authenticationCenterStore, + } = this.props; + + return IntegrationUtil.getSearchBtns( + this.onSearch, + () => authenticationCenterStore.searchForm2.reset(), + () => this.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "IntegrationAuthAppEditDetail", + ); + } + + /** + * weatab切换tab时调用的接口 + */ + onTabChange = v => { + const { + authenticationCenterStore, + } = this.props, { + registerAppId, + } = authenticationCenterStore.status; + + if (v == 2) { + authenticationCenterStore.getRegisterAppDataMappingCondition({}, () => { + authenticationCenterStore.getRegisterAppDataMappingInfo({ id: registerAppId }); + }); + } else if (v == 3) { + authenticationCenterStore.getRegisterAppLoginLogList({ id: registerAppId }); + } else if (v == 0) { + authenticationCenterStore.getRegisterAppEditForm({ id: registerAppId }); + } else if (v == 1) { + authenticationCenterStore.getRegisterAppShareList({ sysid: registerAppId }); + } + authenticationCenterStore.setState({ + editDetailDialogSelectedKey: v, + }); + } + + /** + * weatab的右侧按钮 + */ + getTabButton = () => { + const { + authenticationCenterStore + } = this.props, { + status, + tableStore3, + tableStore2, + } = authenticationCenterStore, { + rightMenus2 = [], + editDetailDialogSelectedKey, + } = status; + + if (editDetailDialogSelectedKey == 2) { + return rightMenus2 && rightMenus2.map((m, index) => ( + + )); + } else if (editDetailDialogSelectedKey == "1") { + return [ + this.onRightMenuClick("share_add")} + />, + this.onRightMenuClick("share_delete")} + /> + ]; + } + return []; + }; + + getIconSize = (form) => { + const { + authenticationCenterStore + } = this.props, { + logoItems = [], + } = toJS(authenticationCenterStore); + return ( + + {logoItems.map((field, index) => { + return ( +
+ + + +
+ ) + })} +
+ ) + } + + getForm = (form, datas) => { + const { + authenticationCenterStore, + } = this.props, { + urllinkimagid = "", + showPic, + registerAppId, + } = authenticationCenterStore.status; + const formParams = form.getFormParams(); + const { isFormInit } = form; + let group = []; + isFormInit && datas && datas.forEach((c, groupI) => { + let items = []; + c.items && c.items.map(fields => { + let domkey = fields.domkey[0]; + if ("logo_width" === domkey) { + return; + } else if (["logo_height"].includes(domkey) && form.getFormParams().auth_type_ != "" && form.getFormParams().auth_type_ != "TOKEN") { + items.push({ + com: this.getIconSize(form), + colSpan: 1, + }) + } else { + if ("service_id" === domkey) { + fields.viewAttr = form.getFormParams().auth_type_ === "OAUTH2" ? 3 : 2; + } + items.push({ + com: ( + + { + domkey === "logo_pic" + ? authenticationCenterStore.setState({ urllinkimagid: id, showPic: false })} + onDel={() => authenticationCenterStore.setState({ urllinkimagid: "", showPic: false })} + /> + :
+ { + if (domkey === 'appid') { + let checkParams = { + tableName: 'weaver_sso_app', + fieldName: 'appid', + fieldValue: form.getFormParams().appid.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: '' + }; + checkTableFieldValueUnique(checkParams).then(result => { + if (result && result.isNotUnique) { + form.showError('appid', getLabel('387654', '标识已存在')); + } + }); + } + }} /> +
+ {this.getFormOtherComp(domkey, fields, form)} +
+
+ } +
), + colSpan: 1, + hide: form.isHide(fields, (key, allParams) => { + return this.getFormHiddenFields(domkey, allParams); + }) + }) + } + }) + group.push() + }) + return group; + } + + /** + * form按钮的渲染 + */ + getFormOtherComp = (domkey, fields, form) => { + if (domkey === "appid") { + return (); + } else if (domkey === "app_secret_") { + return (); + } else if (domkey === "pub_key") { + return (); + } + } + + /** + * form表单显隐控制 + */ + getFormHiddenFields = (domkey, allParams) => { + const { + authenticationCenterStore, + } = this.props, { + registerAppId, + } = authenticationCenterStore.status; + let hide = false; + + !["isuse", "auth_type_"].includes(domkey) && allParams.auth_type_ == '' && (hide = true); + 'app_secret_' == domkey && allParams.auth_type_ == "CAS" && (hide = true); + ['service_id', "logo_pic", "logo_height", "logo_width"].includes(domkey) && allParams.auth_type_ == "TOKEN" && (hide = true); + ["app_secret_"].includes(domkey) && allParams.auth_type_ == "DELEGATE" && (hide = true); + ['pub_key'].includes(domkey) && ((!registerAppId) || (registerAppId && allParams.auth_type_ != "DELEGATE")) && (hide = true); + 'definebroswerType' == domkey && allParams.account_rules !== '7' && (hide = true); + + return hide; + } + + getBtns = () => { + const { + authenticationCenterStore, + } = this.props, { + status, + registerAppEditForm, + } = authenticationCenterStore, { + editDetailDialogSelectedKey, + registerAppId = "", + } = status; + if (!registerAppId) { + if (registerAppEditForm.getFormParams().auth_type_ === "TOKEN") { + return [ + , + ]; + } else { + return [ + , + , + ]; + } + } else { + if (editDetailDialogSelectedKey == 0) { + return [ + , + ]; + } + } + return []; + } + + getRightMenu = () => { + const { + authenticationCenterStore, + } = this.props, { + status, + registerAppEditForm, + } = authenticationCenterStore, { + rightMenus2, + rowSelectIds2, + registerAppId, + editDetailDialogSelectedKey, + } = status; + + let btnArr = []; + if (editDetailDialogSelectedKey == 0) { + btnArr = [{ + key: 'BTN_SAVE', + icon: , + content: `${getLabel(86, '保存')}`, + onClick: () => { this.onRightMenuClick('BTN_SAVE') } + }]; + if ((!registerAppId) && registerAppEditForm.getFormParams().auth_type_ != "TOKEN") { + btnArr.push({ + key: 'BTN_SAVE_OPEN_SHARE', + icon: , + content: getLabel('521924', '保存并进入授权设置'), + onClick: () => this.onRightMenuClick('BTN_SAVE_OPEN_SHARE') + }) + } + } else if (editDetailDialogSelectedKey == 2) { + rightMenus2 && rightMenus2.forEach(m => { + btnArr.push({ + key: m.type, + icon: , + content: m.menuName, + onClick: () => this.onRightMenuClick(m.type), + disabled: m.menuIcon === 'icon-coms-delete' && rowSelectIds2.length === 0 + }); + }); + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + } + return btnArr; + } + + ipv6Test = (value) => { + let reg = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; + let regV4 = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]|(\*))\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]|(\*))\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]|(\*))\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]|(\*))$/ + + let datas = value.split(','); + for (let i = 0; i < datas.length; i++) { + if (!reg.test(datas[i].trim()) && (!regV4.test(datas[i].trim()))) { + return false; + } + } + return true; + } + + onBaseInfoSave = (type) => { + const { authenticationCenterStore } = this.props; + const { registerAppEditForm, status } = authenticationCenterStore; + const { registerAppId, urllinkimagid = "" } = status; + const formParams = registerAppEditForm.getFormParams(); + + if (formParams.auth_type_ != "OAUTH2") { + let hideFieldsKey = ["service_id"]; + if (["CAS", "DELEGATE"].includes(formParams.auth_type_)) { + hideFieldsKey.push("app_secret_"); + } + window.e9HideFormFieldKeys = hideFieldsKey; + } + let checkParams = { + tableName: 'weaver_sso_app', + fieldName: 'appid', + fieldValue: formParams.appid.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: '' + }; + IntegrationUtil.checkUnique(checkParams, registerAppEditForm, "appid", "2", registerAppId, () => { + let value = formParams.allow_ip; + let ipv6 = this.ipv6Test(value.trim()); + formParams.logo_pic = urllinkimagid; + IntegrationUtil.onCheck(registerAppEditForm, () => { + if (value.trim() == '' || (value.trim() && ipv6)) { + let params = Object.assign({ id: registerAppId, operation: registerAppId ? "edit" : "add" }, formParams); + authenticationCenterStore.getRegisterAppOperation(params, (record) => { + if ('BTN_SAVE_OPEN_SHARE' === type) { + authenticationCenterStore.setState({ + editDetailDialogSelectedKey: '1', + registerAppId: record.id, + }); + authenticationCenterStore.getRegisterAppShareList({ sysid: record.id }); + } + }, 'BTN_SAVE_OPEN_SHARE' != type); + } else { + registerAppEditForm.showError('allow_ip', getLabel('531149', "ip格式不合法")); + } + }); + }) + } + + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { registerAppEditForm, status, tableStore2, tableStore3 } = authenticationCenterStore; + const { registerAppId, editDetailDialogSelectedKey } = status; + const formParams = registerAppEditForm.getFormParams(); + + if (type === "BTN_COLUMN") { + if (editDetailDialogSelectedKey == 2) { + tableStore2.setColSetVisible(true); + tableStore2.tableColSet(true); + } + } else if ("BTN_SAVE_OPEN_SHARE" === type) { + this.onBaseInfoSave('BTN_SAVE_OPEN_SHARE'); + } else if (type == 'BTN_SAVE') { + this.onBaseInfoSave('BTN_SAVE'); + } else if (type == 'rb_1') { + //注册数据映射 + this.doDataMappingEditById({ randomField0: '', appid: formParams.appid }); + } else if (type == 'rb_2') { + //导入 + authenticationCenterStore.registerAppDataMappingImportForm.reset(); + let params = Object.assign({ id: registerAppId, operation: "import" }, formParams); + authenticationCenterStore.getRegisterAppDataMappingImportForm(params); + authenticationCenterStore.setState({ appEditFormDetailDataMappingImportDialogVisible: true }); + } else if (type == 'rb_3') { + //删除 + if (toJS(tableStore2.selectedRowKeys).length > 0) { + authenticationCenterStore.confirmModal( + `${getLabel(385625, '确定要删除选择的记录吗?')}`, + authenticationCenterStore.getRegisterAppDataMappingOperation, + { + operation: 'delete', id: toJS(tableStore2.selectedRowKeys) + }); + } + } else if (type === "share_delete") { + IntegrationUtil.doConfirm( + getLabel(385625, '确定要删除选择的记录吗?'), + authenticationCenterStore.getRegisterAppShareForm, + { operate: "delShare", sysid: registerAppId, id: toJS(tableStore3.selectedRowKeys) } + ) + } else if (type === "share_add") { + authenticationCenterStore.setState({ + showAddShare: true + }) + authenticationCenterStore.getRegisterAppShareForm({ operate: "getAddShareForm", sysid: registerAppId }); + } + } + + onOperatesClick = (record, index, operate) => { + const { + authenticationCenterStore, + } = this.props, { + registerAppId, + editDetailDialogSelectedKey, + } = authenticationCenterStore.status; + + if (operate.index == "0") { + this.doDataMappingEditById(record); + } else if (operate.index == "1") { + //删除 + if (editDetailDialogSelectedKey == "1") { + IntegrationUtil.doConfirm( + getLabel(15097, '确定要删除吗?'), + authenticationCenterStore.getRegisterAppShareForm, + { operate: "delShare", sysid: registerAppId, id: record.randomFieldId } + ) + } else { + authenticationCenterStore.confirmModal( + `${getLabel(15097, '确定要删除吗?')}`, + authenticationCenterStore.getRegisterAppDataMappingOperation, + { operation: 'delete', id: record.randomField0 } + ); + } + } + }; + + doDataMappingEditById = (record) => { + const { authenticationCenterStore } = this.props; + const { registerAppEditForm } = authenticationCenterStore; + authenticationCenterStore.registerAppDataMappingEditForm.reset(); + authenticationCenterStore.setOperateDataMappingIndex(record.randomField0); + authenticationCenterStore.getRegisterAppDataMappingEditForm({ id: record.randomField0, appid: record.appid, account_rules: registerAppEditForm.getFormParams().account_rules }); + authenticationCenterStore.setState({ appEditFormDetailDataMappingDialogVisible: true }); + } + + getColumns = (columns = []) => { + return columns && columns.map(item => { + if (item.dataIndex === "LoginId") { + item.render = (text, record) => { + return this.doDataMappingEditById(record)}>{text} + } + } + return item; + }) + } +} diff --git a/pc4backstage/integration/components/authenticationApp/NewShare.js b/pc4backstage/integration/components/authenticationApp/NewShare.js new file mode 100644 index 0000000..e99772d --- /dev/null +++ b/pc4backstage/integration/components/authenticationApp/NewShare.js @@ -0,0 +1,361 @@ +import React, { Component } from 'react'; +import { + WeaDialog, + WeaRightMenu, + WeaLocaleProvider, + WeaFormItem, + WeaCheckbox, +} from "ecCom"; +import { + WeaSwitch +} from "comsMobx"; +import { + inject, + observer +} from "mobx-react"; +import {toJS} from "mobx"; +import { + Button +} from "antd"; +import {onCheck} from "../../util/IntegrationUtil"; + +const {getLabel} = WeaLocaleProvider; + +@inject("authenticationCenterStore") +@observer +export default class NewShare extends Component { + constructor(props) { + super(props); + this.state = { + collectParams: { + favname: `${getLabel(381908, "统一认证中心")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/AuthenticationCenter", + importantlevel: 1 + } + } + } + + getRightMenus = () => { + return [{ + type: "primary", + key: "BTN_SAVE", + icon: , + content: getLabel(30986, '保存'), + onClick: () => this.onMenuClick("BTN_SAVE") + }]; + } + + getBtns = () => { + return []; + } + + hideShareField = (params) => { + const { + permissiontype, + jobtitlelevel, + } = params; + + let temp; + + if (permissiontype == '1') { + temp = ['sharevalue6', 'sharevalue5', 'sharevalue2', 'sharevalue7', 'jobtitlesharevalue2', 'jobtitlesharevalue3']; + } + if (permissiontype == '6') { + temp = ['sharevalue1', 'sharevalue5', 'sharevalue2', 'sharevalue7', 'jobtitlesharevalue2', 'jobtitlesharevalue3']; + } + if (permissiontype == '3') { + temp = ['sharevalue1', 'sharevalue6', 'sharevalue5', 'sharevalue2', 'sharevalue7', 'jobtitlesharevalue2', 'jobtitlesharevalue3']; + } + if (permissiontype == '5') { + temp = ['sharevalue1', 'sharevalue6', 'sharevalue2', 'sharevalue7', 'jobtitlesharevalue2', 'jobtitlesharevalue3']; + } + if (permissiontype == '2') { + temp = ['sharevalue1', 'sharevalue6', 'sharevalue5', 'sharevalue7', 'jobtitlesharevalue2', 'jobtitlesharevalue3']; + } + if (permissiontype == '7') { + if (jobtitlelevel == '1') { + temp = ['sharevalue1', 'sharevalue6', 'sharevalue5', 'sharevalue2', 'jobtitlesharevalue2', 'jobtitlesharevalue3']; + } + if (jobtitlelevel == '2') { + temp = ['sharevalue1', 'sharevalue6', 'sharevalue5', 'sharevalue2', 'jobtitlesharevalue3']; + } + if (jobtitlelevel == '3') { + temp = ['sharevalue1', 'sharevalue6', 'sharevalue5', 'sharevalue2', 'jobtitlesharevalue2']; + } + } + window.e9HideFormFieldKeys = temp; + } + + onMenuClick = (type="") => { + const{ + authenticationCenterStore + } = this.props, { + getRegisterAppShareForm, + addShareForm, + status, + } = authenticationCenterStore; + if(type === "BTN_SAVE") { + const params = addShareForm.getFormParams(); + this.hideShareField(params); + onCheck(addShareForm, () => { + getRegisterAppShareForm({ + operate: "addShare", + sysid: status.registerAppId, + ...params + }) + }) + } + } + + getForm = (form, condition=[]) => { + const { + permissiontype, + } = form.getFormParams(), { + isFormInit, + } = form; + + let arr = []; + isFormInit && condition.forEach(c => { + c && c.items && c.items.forEach(field => { + const key = field.domkey[0]; + if (this.filter({ + permissiontype, + key + })) { + return + } + + arr.push( + this.handleChange(cb, key, form)}/> + ) + + arr = [...arr, this.add({ + permissiontype, + key, + form, + })]; + }) + }) + return
{arr}
+ } + + filter = (params) => { + const { + permissiontype, + key + } = params; + + if (key == 'sharevalue2' || key == 'rolelevel' || key == 'jobtitlelevel' || key == 'jobtitlesharevalue2' || key == 'jobtitlesharevalue3') { + return true + } + + if (permissiontype == '1' && !(key == 'permissiontype' || key == 'seclevel')) { + return true + } + + if (permissiontype == '6' && !(key == 'permissiontype' || key == 'seclevel')) { + return true + } + + if (permissiontype == '3' && !(key == 'permissiontype' || key == 'seclevel')) { + return true + } + + if (permissiontype == '5' && !(key == 'permissiontype' || key == 'sharevalue5')) { + return true + } + + if (permissiontype == '2' && !(key == 'permissiontype' || key == 'seclevel')) { + return true + } + + if (permissiontype == '7' && !(key == 'permissiontype' || key == 'sharevalue7')) { + return true + } + } + + add = (params) => { + const { + permissiontype, + key, + form, + } = params; + + let temp = []; + if (permissiontype == '2' && key == 'permissiontype') { + temp.push(this.getRole(form)); + } + if (permissiontype == '7' && key == 'sharevalue7') { + temp.push(this.getPost(form)); + } + if ((permissiontype == '6' || permissiontype == '1') && key == 'permissiontype') { + temp.push(this.getContainSubDom(form, permissiontype)); + } + return temp + } + + getContainSubDom = (form, permissiontype) => { + const { + authenticationCenterStore + } = this.props, { + shareFormDepFields, + shareFormSubFields, + } = toJS(authenticationCenterStore); + const temp = permissiontype == "1" ? [...shareFormDepFields] : [...shareFormSubFields]; + return ( + + {temp.map((field, index) => { + return ( + { + index == 0 + ? this.handleChange(cb)}/> + : form.updateFields({has_child: v})} /> + } + + ) + })} + + ) + } + + handleChange = (cb, key, form) => { + if(key === "permissiontype") { + if(['1', '6'].includes(form.getFormParams().permissiontype)) { + form.updateFields({has_child: '0'}); + } + } + } + + getRole = (form) => { + const { + authenticationCenterStore + } = this.props, { + shareFormRole + } = toJS(authenticationCenterStore); + return ( + + {shareFormRole.map((field, index) => { + return ( + this.handleChange(cb)}/> + ) + })} + + ) + } + + getPost = (form) => { + const { + authenticationCenterStore + } = this.props, { + shareFormPost + } = toJS(authenticationCenterStore), { + jobtitlelevel + } = form.getFormParams(); + + let temp; + if (jobtitlelevel == '1') { + temp = shareFormPost.slice(0, 1) + } + if (jobtitlelevel == '2') { + temp = shareFormPost.slice(0, 2) + } + if (jobtitlelevel == '3') { + temp = shareFormPost.slice(0, 1).concat(shareFormPost.slice(2)) + } + + return ( + + {temp.map((field, index) => { + return ( + this.handleChange(cb)}/> + ) + })} + + ) + } + + render() { + const{ + authenticationCenterStore + } = this.props, { + status, + addShareForm, + } = authenticationCenterStore, { + showAddShare, + addShareCondition, + } = toJS(status), { + collectParams + } = this.state; + + return ( + authenticationCenterStore.setState({showAddShare: false})} + buttons={this.getBtns()} + moreBtn={{ + datas: this.getRightMenus(), + collectParams + }} + > + + {this.getForm(addShareForm, addShareCondition)} + + + ) + } +} diff --git a/pc4backstage/integration/components/authenticationApp/index.js b/pc4backstage/integration/components/authenticationApp/index.js new file mode 100644 index 0000000..a593937 --- /dev/null +++ b/pc4backstage/integration/components/authenticationApp/index.js @@ -0,0 +1,304 @@ +import {inject, observer} from "mobx-react"; +import {Button} from "antd"; +import {WeaLocaleProvider, WeaRightMenu, WeaTab, WeaTop} from "ecCom"; +import {WeaLogView, WeaTableNew} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import { + getAdvancedItem, + getSearchBtns, +} from "../../util/IntegrationUtil"; +import AppEditDetailDialog from "./AppEditDetailDialog"; + +const { WeaTable } = WeaTableNew; +const getLabel = WeaLocaleProvider.getLabel; +const WeaLogViewComp = WeaLogView.Component; + +@inject("authenticationCenterStore") +@observer +class AuthenticationCenter extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable: false, + targetId: "", + showSearchAd: false, + searchType: ['base','advanced'], + collectParams: { + favname: getLabel('131607','应用管理'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/appcenter", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.doAppCenterInit(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationCenterStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.doAppCenterInit(); + } + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu = () => { + const { + authenticationCenterStore, + } = this.props, { + status, + newForm, + tableStore, + } = authenticationCenterStore, { + rightMenus=[], + } = status, { + selectedRowKeys + } = tableStore, { + isuse, + token_isuse, + oauth2_isuse, + dlgt_isuse, + } = newForm.getFormParams(); + + let btnArr = rightMenus && rightMenus.map(m => { + return { + key: m.type, + icon: , + content: m.menuName, + onClick: () => this.onRightMenuClick(m.type), + disabled: (m.menuIcon==='icon-coms-delete' && selectedRowKeys.length === 0) || (m.menuIcon === "icon-coms-New-Flow" && isuse == 0 && token_isuse == 0&& oauth2_isuse == 0&& dlgt_isuse == 0), + } + }); + //显示列定制 + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + return btnArr; + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + const { + authenticationCenterStore, + } = this.props, { + status, + newForm, + tableStore, + } = authenticationCenterStore, { + rightMenus=[], + } = status, { + selectedRowKeys + } = tableStore, { + isuse, + token_isuse, + oauth2_isuse, + dlgt_isuse, + } = newForm.getFormParams(); + + return rightMenus && rightMenus.map(m => ( + + )); + }; + + /** + * 打开编辑弹窗 + */ + doEditDetailById = (record={}) => { + const { authenticationCenterStore } = this.props; + let tabIndex = record.tabIndex ? record.tabIndex : 0; + + authenticationCenterStore.setState({ + appEditFormDetailDialogVisible: true, + registerAppId: record.id || "", + editDetailDialogSelectedKey: tabIndex, + }); + + if("3" == tabIndex) { + authenticationCenterStore.getRegisterAppLoginLogList({id: record.id}); + } else if("2" == tabIndex) { + authenticationCenterStore.getRegisterAppDataMappingCondition({}, () => { + authenticationCenterStore.getRegisterAppDataMappingInfo({id: record.id}); + }); + } else { + authenticationCenterStore.getRegisterAppEditForm({id: record.id}); + } + } + + /** + * 右键菜单点击事件 + * @param type + */ + onRightMenuClick = (type, record) => { + const { + authenticationCenterStore, + } = this.props, { + tableStore, + confirmModal, + getRegisterAppOperation, + } = authenticationCenterStore; + let id = record ? record.id || "" : tableStore.selectedRowKeys || ""; + + if(type == "rb_1") { + authenticationCenterStore.getRegisterAppEditForm({id}); + authenticationCenterStore.setState({ + appEditFormDetailDialogVisible: true, + registerAppId: "", + editDetailDialogSelectedKey: "0", + }); + } else if(type == "rb_2" || type == "1") { + let title = getLabel(385625, '确定要删除选择的记录吗?'); + + if(type == "1") { + title = getLabel( 15097, '确定要删除吗?'); + } + + confirmModal(title, getRegisterAppOperation, {operation:'delete', id}); + } else if(type == "BTN_COLUMN") { + //显示列定制 + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + } else if("0" === type) { + // 编辑 + this.doEditDetailById({id}); + } else if("2" === type) { + //数据映射 + this.doEditDetailById({id, tabIndex: 2}); + } else if("3" === type) { + this.setState({visiable: true, targetId: id}); + } else if("4" === type) { + // 运行日志 + this.doEditDetailById({id, tabIndex: 3}); + } + }; + + /** + * 数据列表行数据的操作项 + * @param record + * @param index + * @param operate + * @param flag + */ + onOperatesClick = (record, index, operate) => this.onRightMenuClick(operate.index, record); + + getColumnsInfo = (datas=[]) => { + return datas && datas.map(data => { + if(data.dataIndex === "appid") { + data.render = (text, record, index) => this.onRightMenuClick("0", record)}>{text}; + } + + return data; + }) + } + + getAdvancedSearch = (form, datas=[]) => { + return getAdvancedItem( + form, + datas, + this.handleSearchFun, + true, + this && this.props && this.props.ecId || '', + "authAppIndex" + ); + }; + + handleSearchFun = () => { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.getRegisterAppList(); + this.setState({ showSearchAd: false }); + } + + getTabButtonsAd = () => { + const { authenticationCenterStore } = this.props; + return getSearchBtns( + this.handleSearchFun, + () => authenticationCenterStore.appCenterForm.reset(), + () => this.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "authAppIndex", + ); + } + + onCloseLogDialog = () => { + this.setState({ + visiable: false, + targetId: "", + }) + }; + + render() { + const {authenticationCenterStore} = this.props; + const {tableStore, hasRight, logStore, rightLoading, appCenterForm, status} = authenticationCenterStore; + const {appCenterCondition, advanceHeight} = status; + const {collectParams, showSearchAd=false, visiable, targetId, searchType} = this.state; + + return ( + rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + > + appCenterForm.updateFields({appid: value})} + showSearchAd={showSearchAd} + setShowSearchAd={() => this.setState({ showSearchAd: !showSearchAd })} + hideSearchAd={() => this.setState({ showSearchAd: false })} + /> + + + + + + : + ); + } +} + +export default AuthenticationCenter; diff --git a/pc4backstage/integration/components/authenticationDelegate/index.js b/pc4backstage/integration/components/authenticationDelegate/index.js new file mode 100644 index 0000000..6b1695e --- /dev/null +++ b/pc4backstage/integration/components/authenticationDelegate/index.js @@ -0,0 +1,202 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {Button} from "antd"; +import {WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaTop} from "ecCom"; +import {WeaSwitch} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("authenticationCenterStore") +@observer +class AuthenticationDelegate extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable:false, + collectParams: { + favname: getLabel('521345','Delegate认证'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/delegate_server", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.doInit(); + } + + componentWillUnmount() { + this.props.authenticationCenterStore.clearStore(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationCenterStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.doInit(); + } + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu = () => { + return [{ + key: "BTN_BASE_SAVE", + icon: , + content: `${getLabel(30986, '保存')}`, + onClick: () => this.onRightMenuClick("BTN_BASE_SAVE") + }, { + key: 'BTN_TEST', + icon: , + content: `${getLabel(25496, '测试')}`, + onClick: () => this.onRightMenuClick('BTN_TEST') + }]; + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + return [ + , + + ] + }; + + /** + * 右键菜单点击事件 + * @param type + */ + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { newForm } = authenticationCenterStore; + + IntegrationUtil.onCheck(newForm, () => { + let params = newForm.getFormParams(); + delete params.isuse; + delete params.token_isuse; + delete params.oauth2_isuse; + delete params.spnego_isuse; + + if (type == "BTN_BASE_SAVE") { + params.method = 'weaversso'; + + if(params.dlgt_isuse == "1") { + authenticationCenterStore.getBaseInfoFormOperation({casserverurl: params.loginurl || "", method: 'test', testBeforeSave: true}, (result) => { + if(result.success) { + if(params.dlgt_ec_isuse == '1') { + IntegrationUtil.doConfirm( + getLabel('529602','经检测,需要同时开启Delegate集成(会重新生成Delegate集成配置),保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + authenticationCenterStore.getBaseInfoFormOperation, + params, + ) + } else { + authenticationCenterStore.getBaseInfoFormOperation(params); + } + } + }); + } else { + if(params.dlgt_ec_isuse == '1') { + IntegrationUtil.doConfirm( + getLabel('529601','经检测,需要同时关闭Delegate集成,保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + authenticationCenterStore.getBaseInfoFormOperation, + params + ) + } else { + authenticationCenterStore.getBaseInfoFormOperation(params); + } + } + } else if ("BTN_TEST" === type) { + params = { + method: 'test', + casserverurl: params.loginurl || "", + }; + authenticationCenterStore.getBaseInfoFormOperation(params); + } + }); + }; + + getBaseInfoForm = () => { + const {authenticationCenterStore} = this.props; + const {newForm, status} = authenticationCenterStore; + const {BaseInfoFormFields} = toJS(status); + const {isFormInit} = newForm; + let group = []; + + isFormInit && BaseInfoFormFields && BaseInfoFormFields.forEach(c =>{ + if(['delegate', 'desc'].includes(c.key)) { + let items = []; + c.items && c.items.forEach(fields => { + items.push({ + com:(
+ + + +
), + colSpan:1, + hide: newForm.isHide(fields, (keys, allParams) => { + let bool = false; + !["delegate_desc_", "dlgt_isuse"].includes(fields.domkey[0]) && allParams.dlgt_isuse != '1' && (bool = true); + return bool; + }) + }); + }); + group.push( + ); + } + }); + return group; + } + + render() { + const {authenticationCenterStore} = this.props; + const {hasRight, rightLoading} = authenticationCenterStore; + const {collectParams} = this.state; + + return ( + rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + > + {this.getBaseInfoForm()} + + + : + ); + } +} + +export default AuthenticationDelegate; diff --git a/pc4backstage/integration/components/authenticationHelp/index.js b/pc4backstage/integration/components/authenticationHelp/index.js new file mode 100644 index 0000000..5d668c3 --- /dev/null +++ b/pc4backstage/integration/components/authenticationHelp/index.js @@ -0,0 +1,102 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {WeaLocaleProvider, WeaRightMenu, WeaTab, WeaTop} from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("authenticationCenterStore") +@observer +class AuthenticationCenter extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable:false, + topTab: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(381910, "配置说明")}`, + viewcondition: 2 + } + ,{ + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(381911, "开发说明")}`, + viewcondition: 3 + } + ], + collectParams: { + favname: getLabel('516460','帮助中心'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/helpcenter", + importantlevel: 1 + } + }; + } + + componentWillMount() { + this.props.authenticationCenterStore.setState({selectedKey: "2"}); + } + + componentWillUnmount() { + this.props.authenticationCenterStore.clearStore(); + } + + componentDidMount() { + const {authenticationCenterStore} = this.props; + authenticationCenterStore.setState({selectedKey: "2"}) + } + + componentWillReceiveProps(nextProps) { + const {authenticationCenterStore} = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.setState({selectedKey: "2"}); + } + } + + render() { + const { authenticationCenterStore } = this.props; + const {status} = authenticationCenterStore; + const {selectedKey} = toJS(status); + const {topTab, collectParams} = this.state; + + return ( + } + iconBgcolor="#1a57a0" + buttons={[]} + showDropIcon={true} + dropMenuDatas={[]} + dropMenuProps={{collectParams}} + > + authenticationCenterStore.setState({selectedKey: v})} + /> + { + selectedKey == 2 ? ( +
+ +
+ ) : selectedKey == 3 ? ( +
+ +
+ ):(
) + } +
+
+ ); + } +} + +export default AuthenticationCenter; diff --git a/pc4backstage/integration/components/authenticationOAuth2/index.js b/pc4backstage/integration/components/authenticationOAuth2/index.js new file mode 100644 index 0000000..b0089a4 --- /dev/null +++ b/pc4backstage/integration/components/authenticationOAuth2/index.js @@ -0,0 +1,203 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {Button} from "antd"; +import {WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaTop, WeaTools} from "ecCom"; +import {WeaSwitch} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import PopoverButton from '../../public/PopoverButton'; +import "../../style/webxml.less"; + +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("authenticationCenterStore") +@observer +class AuthenticationCenter extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable:false, + collectParams: { + favname: getLabel('518323','OAuth2认证'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/oauth2_server", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.doInit("oauth2"); + } + + componentWillUnmount() { + this.props.authenticationCenterStore.clearStore(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationCenterStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.doInit("oauth2"); + } + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu = () => { + return [{ + key: "BTN_BASE_SAVE", + icon: , + content: getLabel(30986, '保存'), + onClick: () => this.onRightMenuClick("BTN_BASE_SAVE") + } + , { + key: 'BTN_TEST', + icon: , + content: `${getLabel(25496, '测试')}`, + onClick: () => this.onRightMenuClick('BTN_TEST') + } + ] + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + return [ + this.onRightMenuClick("BTN_BASE_SAVE")} + />, + + ] + }; + + /** + * 右键菜单点击事件 + * @param type + */ + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { newForm } = authenticationCenterStore; + + if (type == "BTN_BASE_SAVE") { + IntegrationUtil.onCheck(newForm,()=>{ + let params = Object.assign({}, newForm.getFormParams(), {method: 'weaversso'}); + delete params.isuse; + delete params.token_isuse; + delete params.spnego_isuse; + delete params.dlgt_isuse; + if(params.oauth2_isuse == "1") { + authenticationCenterStore.getBaseInfoFormOperation({oauth2_heartbeat_url: params.oauth2_heartbeat_url, method: 'oauth2_test', testBeforeSave: true}, (result) => { + if(result.success) { + if(params.oauth2_client_isuse == '1') { + IntegrationUtil.doConfirm( + getLabel('521937','经检测,需要同时开启OAuth2集成(会重新生成OAuth2集成配置),保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + authenticationCenterStore.getBaseInfoFormOperation, + params, + ) + } else { + authenticationCenterStore.getBaseInfoFormOperation(params); + } + } + }); + }else { + if(params.oauth2_client_isuse == '1') { + IntegrationUtil.doConfirm( + getLabel('521939','经检测,需要同时关闭OAuth2集成,保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + authenticationCenterStore.getBaseInfoFormOperation, + params + ) + } else { + authenticationCenterStore.getBaseInfoFormOperation(params); + } + } + }); + }else if(type == "BTN_TEST") { + let loginurl = newForm.getFormParams().oauth2_heartbeat_url; + let params = {oauth2_heartbeat_url: loginurl, method: 'oauth2_test'}; + authenticationCenterStore.getBaseInfoFormOperation(params); + } + }; + + getBaseInfoForm = () => { + const {authenticationCenterStore} = this.props; + const {newForm, status} = authenticationCenterStore; + const {BaseInfoFormFields} = toJS(status); + const {isFormInit} = newForm; + let group = []; + const formParams = newForm.getFormParams(); + + isFormInit && BaseInfoFormFields && BaseInfoFormFields.map((c, index) =>{ + if(index == 2) { + let items = []; + c.items && c.items.map(fields => { + items.push({ + com:( + + {}} /> + ), + colSpan:1, + hide: newForm.isHide(fields, (keys, allParams) => { + let bool = false; + getKey(fields) != 'oauth2_isuse' && allParams.oauth2_isuse != '1' && (bool = true); + return bool; + }) + }); + }); + group.push(); + } + }); + return group; + } + + render() { + const {authenticationCenterStore} = this.props; + const {hasRight, rightLoading, status} = authenticationCenterStore; + const {hasNonStandard, nonStandLoading} = toJS(status); + const {collectParams} = this.state; + + return (nonStandLoading + ? null + : hasNonStandard + ? rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + > + {this.getBaseInfoForm()} + + + : + : + ); + } +} + +export default AuthenticationCenter; diff --git a/pc4backstage/integration/components/authenticationSPNEGO/index.js b/pc4backstage/integration/components/authenticationSPNEGO/index.js new file mode 100644 index 0000000..c39e912 --- /dev/null +++ b/pc4backstage/integration/components/authenticationSPNEGO/index.js @@ -0,0 +1,169 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {Button} from "antd"; +import {WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaTop, WeaTools} from "ecCom"; +import {WeaSwitch} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; + +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("authenticationCenterStore") +@observer +class AuthenticationSPNEGO extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable:false, + collectParams: { + favname: getLabel('521386','SPNEGO认证'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/spnego", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.doInit(); + } + + componentWillUnmount() { + this.props.authenticationCenterStore.clearStore(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationCenterStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.doInit(); + } + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu() { + return [{ + key: "BTN_BASE_SAVE", + icon: , + content: `${getLabel(30986, '保存')}`, + onClick: () => this.onRightMenuClick("BTN_BASE_SAVE") + } + ] + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + return [ + , + ] + }; + + /** + * 右键菜单点击事件 + * @param type + */ + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { newForm } = authenticationCenterStore; + + if (type == "BTN_BASE_SAVE") { + IntegrationUtil.onCheck(newForm,()=>{ + let params = Object.assign({}, newForm.getFormParams(), {method: 'weaversso'}); + delete params.isuse; + delete params.token_isuse; + delete params.oauth2_isuse; + delete params.dlgt_isuse; + authenticationCenterStore.getBaseInfoFormOperation(params); + }); + } + }; + + getBaseInfoForm = () => { + const {authenticationCenterStore} = this.props; + const {newForm, status} = authenticationCenterStore; + const {BaseInfoFormFields, spnegoDescription=""} = toJS(status); + const {isFormInit} = newForm; + let group = []; + const formParams = newForm.getFormParams(); + + isFormInit && BaseInfoFormFields && BaseInfoFormFields.forEach((c, index) =>{ + if(index == 3) { + let items = []; + c.items && c.items.forEach(fields => { + if(fields.domkey[0] != "spnego_desc_") { + items.push({ + com:( + + {}} /> + ), + colSpan:1, + hide: newForm.isHide(fields, (keys, allParams) => { + let bool = false; + getKey(fields) === 'spnego_ds' && allParams.spnego_isuse != '1' && (bool = true); + return bool; + }) + }); + } + }); + group.push(); + } + }); + group.push( + +
+ + ); + return group; + } + + render() { + const {authenticationCenterStore} = this.props; + const {hasRight, rightLoading} = authenticationCenterStore; + const {collectParams} = this.state; + + return ( + rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + > + {this.getBaseInfoForm()} + + + : + ); + } +} + +export default AuthenticationSPNEGO; diff --git a/pc4backstage/integration/components/authenticationToken/index.js b/pc4backstage/integration/components/authenticationToken/index.js new file mode 100644 index 0000000..e27fd01 --- /dev/null +++ b/pc4backstage/integration/components/authenticationToken/index.js @@ -0,0 +1,167 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaTop, WeaTools} from "ecCom"; +import {WeaSwitch} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import {Button} from "antd"; +import "../../style/webxml.less"; + +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("authenticationCenterStore") +@observer +class AuthenticationCenter extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable:false, + collectParams: { + favname: getLabel('516738','Token认证'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/token", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.doInit(); + } + + componentWillUnmount() { + this.props.authenticationCenterStore.clearStore(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationCenterStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.doInit(); + } + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu() { + return [{ + key: "BTN_BASE_SAVE", + icon: , + content: getLabel(30986, '保存'), + onClick: () => this.onRightMenuClick("BTN_BASE_SAVE") + } + ] + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + return [ + + ] + }; + + /** + * 右键菜单点击事件 + * @param type + */ + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { newForm } = authenticationCenterStore; + + if (type == "BTN_BASE_SAVE") { + IntegrationUtil.onCheck(newForm,()=>{ + let params = Object.assign({}, newForm.getFormParams(), {method: 'weaversso'}); + delete params.isuse; + delete params.oauth2_isuse; + delete params.spnego_isuse; + delete params.dlgt_isuse; + IntegrationUtil.doConfirm( + getLabel('512788','保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + authenticationCenterStore.getBaseInfoFormOperation, + params + ) + }); + }else if(type == "BTN_TEST") { + let loginurl = newForm.getFormParams().loginurl; + let params = {casserverurl: loginurl, method: 'test'}; + authenticationCenterStore.getBaseInfoFormOperation(params); + } + }; + + getBaseInfoForm = () => { + const {authenticationCenterStore} = this.props; + const {newForm, status} = authenticationCenterStore; + const {BaseInfoFormFields} = toJS(status); + const {isFormInit} = newForm; + let group = []; + const formParams = newForm.getFormParams(); + + isFormInit && BaseInfoFormFields && BaseInfoFormFields.map((c, index) =>{ + if(index == 1) { + let items = []; + c.items && c.items.map(fields => { + items.push({ + com:( + + {}} /> + ), + colSpan:1, + hide: newForm.isHide(fields, (keys, allParams) => { + let bool = false; + getKey(fields) === 'get_token_url' && allParams.token_isuse != '1' && (bool = true); + getKey(fields) === 'check_token_url' && allParams.token_isuse != '1' && (bool = true); + return bool; + }) + }); + }); + group.push(); + } + }); + return group; + } + + render() { + const {authenticationCenterStore} = this.props; + const {hasRight, rightLoading} = authenticationCenterStore; + const {collectParams} = this.state; + + return ( + rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + > + {this.getBaseInfoForm()} + + + : + ); + } +} + +export default AuthenticationCenter; diff --git a/pc4backstage/integration/components/authenticationcenter/AppDataMappingEditDialog.js b/pc4backstage/integration/components/authenticationcenter/AppDataMappingEditDialog.js new file mode 100644 index 0000000..4aadcbf --- /dev/null +++ b/pc4backstage/integration/components/authenticationcenter/AppDataMappingEditDialog.js @@ -0,0 +1,167 @@ +// import React from "react"; +// import {inject, observer} from "mobx-react"; +// import { Button} from "antd"; +// import {toJS} from "mobx"; +// import {WeaForm, WeaLogView, WeaNewScroll, WeaSwitch, WeaTableNew} from "comsMobx"; +// import {WeaDialog, WeaLocaleProvider, WeaTools, WeaSearchGroup, WeaFormItem, WeaRightMenu} from "ecCom"; +// import * as IntegrationUtil from "../../util/IntegrationUtil"; +// import {checkUserMappingLoginIdUnique,checkUserMappingAppLoginIdUnique} from "../../apis/AuthenticationCenterService" +// const { getKey } = WeaTools; +// const getLabel = WeaLocaleProvider.getLabel; + +// const store = ["authenticationCenterStore"]; + +// @inject(...store) +// @observer +// export default class AppDataMappingEditDialog extends React.Component { +// constructor(props) { +// super(props); +// this.state = { +// collectParams: { +// favname: `${getLabel(381908, "统一认证中心")}`, +// favouritetype: 1, +// objid: 0, +// link: "wui/engine.html#/integration/AuthenticationCenter", +// importantlevel: 1 +// } +// } +// } + +// render() { +// const {authenticationCenterStore} = this.props; +// const status = toJS(authenticationCenterStore.status); +// const {collectParams} = this.state; +// return authenticationCenterStore.setState({appEditFormDetailDataMappingDialogVisible: false})} +// visible={status.appEditFormDetailDataMappingDialogVisible} +// style={{width: 700, height: 400}} +// hasScroll +// moduleName="integration" +// buttons={[ +// +// ]} +// moreBtn={{ +// datas: this.getRightMenu(), +// collectParams: collectParams +// }} +// > +// +// { +// authenticationCenterStore.registerAppDataMappingEditForm.render({col: 1},{ +// onChange: (v)=> { +// }, +// isHide: (key, formParams) => {} + +// },true,(c, idx)=>{ +// if(idx==0){ +// let items = []; +// let bottomDis = 0; +// let form = authenticationCenterStore.registerAppDataMappingEditForm; +// let formParams = form.getFormParams(); +// c.items.map(fields => { +// if(getKey(fields) == 'apploginid') { +// bottomDis = 15; +// }else { +// bottomDis = 0; +// } +// items.push({ +// com: ( +//
+// +// +// { +// if(getKey(fields) === 'userid') { +// let params={userid:form.getFormParams().userid,operation:'getUserInfo'}; +// authenticationCenterStore.getRegisterAppDataMappingOperation(params,(result)=>{ +// if(result) { +// if(result.depname) { +// form.updateFields({depname: result.depname}); +// } +// if(result.subname) { +// form.updateFields({subname: result.subname}); +// } +// if(result.loginid) { +// form.updateFields({loginid: result.loginid}); +// } +// } +// }) +// } +// }} +// /> +// {/*{getKey(fields)==='account_rules'&&formParams.account_rules>5?:""}*/} +// + +//
), +// colSpan: 1, +// hide: form.isHide(fields, (key, formParams) => { +// let hide = false; +// if ('definebroswerType' == key && formParams.account_rules !== '7') { +// hide = true; +// } +// return hide; +// }), +// onChange: (v)=> { + +// } +// }) +// }); + +// return +// } +// })} +//
+//
+// } + +// getRightMenu() { +// let btnArr = [ +// { +// key: 'BTN_SAVE', +// icon: , +// content : `${getLabel(86,'保存')}`, +// onClick : () => this.onRightMenuClick('BTN_SAVE') +// } +// ]; +// return btnArr; +// } + +// onRightMenuClick = (type) => { +// const {authenticationCenterStore} = this.props; +// const {registerAppEditForm,registerAppDataMappingEditForm, status} = authenticationCenterStore; +// if(type == 'BTN_SAVE'){ +// let id=authenticationCenterStore.registerAppDataMappingId||""; +// let appid = registerAppEditForm.getFormParams().appid; +// let loginid = registerAppDataMappingEditForm.getFormParams().loginid; +// let apploginid = registerAppDataMappingEditForm.getFormParams().apploginid; +// checkUserMappingLoginIdUnique({appId: appid, idValue: id, loginId: loginid, appLoginId: apploginid}).then(result=>{ +// if(result&&result.isNotUnique) { +// registerAppDataMappingEditForm.showError('userid',getLabel('31053','已存在,请确认')); +// }else{ +// checkUserMappingAppLoginIdUnique({appId: appid, idValue: id, loginId: loginid, appLoginId: apploginid}).then(result=>{ +// if(result&&result.isNotUnique) { +// registerAppDataMappingEditForm.showError('apploginid',getLabel('31053','已存在,请确认')); +// return; +// }else{ +// IntegrationUtil.onCheck(registerAppDataMappingEditForm,function () { +// let operation = id==""?"adduser":"edit"; +// let params = Object.assign({id:id,appid:appid,operation:operation}, registerAppDataMappingEditForm.getFormParams()); +// authenticationCenterStore.getRegisterAppDataMappingOperation(params); +// }); +// } +// }); +// } +// }); +// } +// } +// } diff --git a/pc4backstage/integration/components/authenticationcenter/AppDataMappingImportDialog.js b/pc4backstage/integration/components/authenticationcenter/AppDataMappingImportDialog.js new file mode 100644 index 0000000..d0dd2d1 --- /dev/null +++ b/pc4backstage/integration/components/authenticationcenter/AppDataMappingImportDialog.js @@ -0,0 +1,183 @@ +// import { Button } from "antd"; +// import { WeaSwitch } from "comsMobx"; +// import { WeaDialog, WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaTools, WeaUpload } from "ecCom"; +// import { toJS } from "mobx"; +// import { inject, observer } from "mobx-react"; +// import React from "react"; +// import * as IntegrationUtil from "../../util/IntegrationUtil"; +// const { getKey } = WeaTools; +// const getLabel = WeaLocaleProvider.getLabel; + +// const store = ["authenticationCenterStore"]; + +// @inject(...store) +// @observer +// export default class AppDataMappingImportDialog extends React.Component { +// constructor(props) { +// super(props); +// this.state = { +// file: [], +// filelist: [], +// collectParams: { +// favname: `${getLabel(381908, "统一认证中心")}`, +// favouritetype: 1, +// objid: 0, +// link: "wui/engine.html#/integration/AuthenticationCenter", +// importantlevel: 1 +// } +// } +// } + +// componentDidMount() { +// this.setState({ +// file: [], +// filelist: [], +// }) +// } + +// render() { +// const { authenticationCenterStore } = this.props; +// const status = toJS(authenticationCenterStore.status); +// const {collectParams} = this.state; + +// return authenticationCenterStore.setState({ appEditFormDetailDataMappingImportDialogVisible: false })} +// visible={status.appEditFormDetailDataMappingImportDialogVisible} +// style={{ width: 700, height: 400 }} +// hasScroll +// moduleName="integration" +// buttons={[ +// +// ]} +// moreBtn={{ +// datas: this.getRightMenu(), +// collectParams: collectParams +// }} +// > +// +// { +// authenticationCenterStore.registerAppDataMappingImportForm.render({ col: 1, center: true }, { +// onChange: (v) => { +// }, +// isHide: (key, formParams) => { } + +// }, true, (c, idx) => { +// if (idx == 0) { +// let items = []; +// let form = authenticationCenterStore.registerAppDataMappingImportForm; +// let formParams = form.getFormParams(); +// c.items.map((fields, index) => { +// if (index === 0) { +// items.push({ +// com: ( +// +//
+//
+// {this.setState({ file: ids, filelist: list }) }} +// > +// +// +//
+//
+// {this.state.filelist.length == 0 ?

{getLabel('384040','未选择任何文件')}

: this.state.filelist.map(file =>

{file.filename}

)} +//
+//
+//
), +// colSpan: 1, +// hide: form.isHide(fields, (key, formParams) => { +// let hide = false; +// return hide; +// }), +// onChange: (v) => { + +// } +// }) + +// } else { +// items.push({ +// com: ( +// +//
+// { +// if (getKey(fields) === 'userid') { +// } +// }} +// /> +//
+ +//
), +// colSpan: 1, +// hide: form.isHide(fields, (key, formParams) => { +// let hide = false; +// return hide; +// }), +// onChange: (v) => { + +// } +// }) +// } +// }); +// return +// } +// })} +//
+//
+// } + +// getRightMenu() { +// let btnArr = [ +// { +// key: 'BTN_SAVE', +// icon: , +// content: `${getLabel(18596, '导入')}`, +// onClick: () => { this.onRightMenuClick('BTN_SAVE') } +// } +// ]; +// return btnArr; +// } + +// onRightMenuClick = (type) => { +// const { authenticationCenterStore } = this.props; +// const { registerAppEditForm, registerAppDataMappingImportForm, status } = authenticationCenterStore; +// if (type == 'BTN_SAVE') { +// //导入 +// IntegrationUtil.onCheck(registerAppDataMappingImportForm, () => { +// let operation = "excelImport"; +// let params = Object.assign({ appid: registerAppEditForm.getFormParams().appid, operation: operation }, registerAppDataMappingImportForm.getFormParams()); +// params.file = JSON.stringify(this.state.file); +// params.filelist = JSON.stringify(this.state.filelist); +// authenticationCenterStore.getRegisterAppDataMappingOperation(params, (result) => { +// authenticationCenterStore.setState({ resultTableHeader: result.resultTableHeader, resultTableData: result.resultTableData }) +// authenticationCenterStore.setState({ appEditFormDetailDataMappingImportDialogVisible: false, appEditFormDetailDataMappingImportResultDialogVisible: true }) +// }); +// }); + +// } + +// } + +// } diff --git a/pc4backstage/integration/components/authenticationcenter/AppDataMappingImportResultDialog.js b/pc4backstage/integration/components/authenticationcenter/AppDataMappingImportResultDialog.js new file mode 100644 index 0000000..aaf959e --- /dev/null +++ b/pc4backstage/integration/components/authenticationcenter/AppDataMappingImportResultDialog.js @@ -0,0 +1,80 @@ +// import React from "react"; +// import {inject, observer} from "mobx-react"; +// import { Button} from "antd"; +// import {toJS} from "mobx"; +// import {WeaForm, WeaLogView, WeaNewScroll, WeaSwitch, WeaTableNew} from "comsMobx"; +// import {WeaDialog, WeaLocaleProvider, WeaTools, WeaSearchGroup, WeaFormItem, WeaRightMenu,WeaTable} from "ecCom"; +// import * as IntegrationUtil from "../../util/IntegrationUtil"; +// const { getKey } = WeaTools; +// const getLabel = WeaLocaleProvider.getLabel; + +// const store = ["authenticationCenterStore"]; + +// const transformArray = function (origin) { +// if (origin.length === 0) { +// return false; +// } +// return Object.keys(origin[0]).map(item => { +// return { +// title: origin[0][item], +// dataIndex: item, +// key: item, +// } +// }) +// } + +// @inject(...store) +// @observer +// export default class AppDataMappingImportResultDialog extends React.Component { +// render() { +// const {authenticationCenterStore} = this.props; +// const status = toJS(authenticationCenterStore.status); +// const {resultTableHeader,resultTableData} = toJS(status); + +// return authenticationCenterStore.setState({appEditFormDetailDataMappingImportResultDialogVisible: false})} +// visible={status.appEditFormDetailDataMappingImportResultDialogVisible} +// style={{width: 700, height: 600}} +// hasScroll +// moduleName="integration" +// buttons={[ +// +// ]} +// moreBtn={[]} +// > +// +// +// +// +// +// +// } + +// getRightMenu() { +// let btnArr = [ +// { +// key: 'BTN_SAVE', +// icon: , +// content : `${getLabel(309,'关闭')}`, +// onClick : () => {this.onRightMenuClick('BTN_SAVE')} +// } +// ]; +// return btnArr; +// } + +// onRightMenuClick = (type) => { +// const {authenticationCenterStore} = this.props; +// const {registerAppEditForm,registerAppDataMappingImportForm, status} = authenticationCenterStore; +// if(type == 'BTN_SAVE'){ +// //关闭 +// authenticationCenterStore.setState({appEditFormDetailDataMappingImportResultDialogVisible: false}); + +// } + +// } + +// } diff --git a/pc4backstage/integration/components/authenticationcenter/AppEditDetailDialog.js b/pc4backstage/integration/components/authenticationcenter/AppEditDetailDialog.js new file mode 100644 index 0000000..e65772a --- /dev/null +++ b/pc4backstage/integration/components/authenticationcenter/AppEditDetailDialog.js @@ -0,0 +1,381 @@ +// import React from "react"; +// import {inject, observer} from "mobx-react"; +// import { Button} from "antd"; +// import {toJS} from "mobx"; +// import {WeaForm, WeaLogView, WeaSwitch, WeaTableNew} from "comsMobx"; +// import {WeaDialog, WeaLocaleProvider, WeaTools, WeaSearchGroup, WeaFormItem, WeaRightMenu,WeaTab,WeaNewScroll,WeaTop,WeaPopoverHrm} from "ecCom"; +// import * as IntegrationUtil from "../../util/IntegrationUtil"; +// import AppDataMappingEditDialog from "./AppDataMappingEditDialog"; +// import AppDataMappingImportDialog from "./AppDataMappingImportDialog"; +// import AppDataMappingImportResultDialog from "./AppDataMappingImportResultDialog"; +// import uuid from 'uuid'; +// import {checkTableFieldValueUnique} from "../../apis/CommonService"; + +// const { getKey } = WeaTools; +// const getLabel = WeaLocaleProvider.getLabel; +// const { WeaTable } = WeaTableNew; +// const store = ["authenticationCenterStore"]; + +// @inject(...store) +// @observer +// export default class AppEditDetailDialog extends React.Component { +// constructor (props) { +// super(props); +// this.state = { +// topTab: [ +// { +// color: "#000000", +// groupid: "flowAll", +// showcount: true, +// title: `${getLabel(81711, "基本信息")}`, +// viewcondition_dt: 0 +// } +// ,{ +// color: "#000000", +// groupid: "flowAll", +// showcount: true, +// title: `${getLabel(131274, "运行日志")}`, +// viewcondition_dt: 2 +// } +// ], +// topTabAll: [ +// { +// color: "#000000", +// groupid: "flowAll", +// showcount: true, +// title: `${getLabel(81711, "基本信息")}`, +// viewcondition_dt: 0 +// } +// ,{ +// color: "#000000", +// groupid: "flowAll", +// showcount: true, +// title: `${getLabel(381943, "数据映射")}`, +// viewcondition_dt: 1 +// } +// ,{ +// color: "#000000", +// groupid: "flowAll", +// showcount: true, +// title: `${getLabel(131274, "运行日志")}`, +// viewcondition_dt: 2 +// } +// ], +// collectParams: { +// favname: `${getLabel(381908, "统一认证中心")}`, +// favouritetype: 1, +// objid: 0, +// link: "wui/engine.html#/integration/AuthenticationCenter", +// importantlevel: 1 +// } +// } +// } + +// render() { +// const {authenticationCenterStore} = this.props; +// const {status, registerAppEditForm, registerAppEditFormOrg, registerAppId, editDetailDialogSelectedKey, tableStore2, tableStore3} = authenticationCenterStore; +// const {showSearchAd2, selectedKey, registerAppEditFormHiddenFields, registerAppEditFormCodition, appEditFormDetailDialogVisible} = toJS(status); +// const {topTab, topTabAll, collectParams} = this.state; + +// return authenticationCenterStore.setState({appEditFormDetailDialogVisible: false})} +// visible={appEditFormDetailDialogVisible} +// style={{width: 900, height: 600}} +// hasScroll +// moduleName="integration" +// buttons={(registerAppEditFormHiddenFields && registerAppEditFormHiddenFields.id == "") || editDetailDialogSelectedKey == 0 +// ? [] : []} +// moreBtn={{datas: this.getRightMenu(), collectParams: collectParams}} +// > +// +// +// { +// registerAppEditFormHiddenFields && registerAppEditFormHiddenFields.id +// ? {authenticationCenterStore.setState({ showSearchAd2: !showSearchAd2 })}} +// hideSearchAd={() => {authenticationCenterStore.setState({ showSearchAd2: false })}} +// onChange={v => { +// if(v == 1) { +// authenticationCenterStore.searchForm2 = new WeaForm(); +// authenticationCenterStore.getRegisterAppDataMappingCondition(); +// authenticationCenterStore.getRegisterAppDataMappingRightMenu(); +// authenticationCenterStore.getRegisterAppDataMappingList({id: registerAppId}); +// }else if(v == 2) { +// authenticationCenterStore.getRegisterAppLoginLogList({id: registerAppId}); +// }else { +// authenticationCenterStore.getRegisterAppEditForm({id: registerAppId}); +// } +// authenticationCenterStore.setEditDetailDialogSelectedKey(v); +// }} +// /> +// : "" +// } +// +// { +// registerAppEditFormHiddenFields && registerAppEditFormHiddenFields.id +// ? editDetailDialogSelectedKey == 0 +// ? this.getForm(registerAppEditForm, registerAppEditFormCodition) +// : +// : this.getForm(registerAppEditForm, registerAppEditFormCodition) +// } +// +// +// +// +// +// +// } + +// getAdvancedSearch = () => { +// const { authenticationCenterStore } = this.props; +// const {searchForm2, status} = authenticationCenterStore; +// const {showSearchAd, selectedKey, condition2} = toJS(status); +// let btns = []; +// btns = IntegrationUtil.getAdvancedSearchs( +// searchForm2, +// condition2, +// false, +// 2 +// ); +// return btns; +// }; + +// getTabButtonsAd() { +// const { authenticationCenterStore } = this.props; +// let searchFun = () => { +// authenticationCenterStore.getRegisterAppDataMappingList({id: authenticationCenterStore.registerAppId}); +// authenticationCenterStore.setState({showSearchAd2: false}); +// }; +// let resetFun = () => authenticationCenterStore.searchForm2.reset(); +// let cancelFun = () => authenticationCenterStore.setState({showSearchAd2: false}); +// return IntegrationUtil.getSearchBtns(searchFun, resetFun, cancelFun); +// } + +// getTabButton = () => { +// const {authenticationCenterStore} = this.props; +// let {rightMenus2, rowSelectIds2} = toJS(authenticationCenterStore.status); +// let btnArr = []; +// let rightDis = 0; +// if(!rightMenus2){return btnArr} +// for (let j = 0, len = rightMenus2.length; j < len; j++) { +// if (j == 4) break; +// if(j == 2) rightDis = 15; +// let m = rightMenus2[j]; +// btnArr.push( +// +// ); +// } +// return btnArr; +// }; + +// getForm = (form, datas) => { +// const formParams = form.getFormParams(); +// const {isFormInit} = form; +// let group = []; + +// isFormInit && datas && datas.forEach(c => { +// let items = []; +// c.items && c.items.map(fields => { +// let domkey = fields.domkey[0]; +// items.push({ +// com: ( +// +// +// { +// if(getKey(fields) === 'appid') { +// let checkParams = { +// tableName: 'weaver_sso_app', +// fieldName: 'appid', +// fieldValue: form.getFormParams().appid.replace(/^(\s*)|(\s*)$/g, ''), +// idName: 'id', +// idValue: '' +// }; +// checkTableFieldValueUnique(checkParams).then(result => { +// if(result && result.isNotUnique) { +// form.showError('appid',getLabel('387654','标识已存在')); +// } +// }); +// } +// }}/> +// {/*{getKey(fields)==='account_rules'&&formParams.account_rules>5?:""}*/} +// {getKey(fields) === "appid" && } +// {getKey(fields) === "app_secret_" && } +// +// ), +// colSpan: 1, +// hide: form.isHide(fields, (key, allParams) => { +// let hide = false; +// 'app_secret_' == domkey && allParams.auth_type_ == "CAS" && (hide = true); +// 'definebroswerType' == domkey && allParams.account_rules !== '7' && (hide = true); +// ["appid", "app_secret_", "appname", "allow_ip", "account_rules", "definebroswerType"].includes(domkey) && allParams.auth_type_ == "" && (hide = true); +// return hide; +// }) +// }) +// }) +// group.push() +// }) +// return group; +// } + +// getRightMenu = () => { +// const {authenticationCenterStore} = this.props; +// let {rightMenus2,rowSelectIds2} = toJS(authenticationCenterStore.status); +// let btnArr = []; +// if(authenticationCenterStore.editDetailDialogSelectedKey==0) { +// btnArr=[ +// { +// key: 'BTN_SAVE', +// icon: , +// content : `${getLabel(86,'保存')}`, +// onClick : () => {this.onRightMenuClick('BTN_SAVE')} +// } +// ]; +// }else if(authenticationCenterStore.editDetailDialogSelectedKey==1) { +// btnArr = []; +// rightMenus2&&rightMenus2.map(m => { +// var btn= { +// key: m.type, +// icon: , +// content: m.menuName, +// onClick: () => this.onRightMenuClick(m.type), +// disabled: m.menuIcon==='icon-coms-delete' && rowSelectIds2.length === 0 +// } ; +// btnArr.push(btn); +// }); +// btnArr.push({ +// key: "BTN_COLUMN", +// icon: , +// content: `${getLabel(32535, "显示列定制")}`, +// onClick: () => this.onRightMenuClick("BTN_COLUMN") +// }); +// } + +// return btnArr; +// } + +// ipv6Test = (value) => { +// let reg = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; +// let regV4 = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/ + +// let datas = value.split(','); +// for(let i = 0; i < datas.length; i++) { +// if(!reg.test(datas[i].trim()) && (!regV4.test(datas[i].trim()))) { +// return false; +// } +// } +// return true; +// } + +// onRightMenuClick = (type) => { +// const {authenticationCenterStore} = this.props; +// const {registerAppEditForm, status, editDetailDialogSelectedKey, tableStore2} = authenticationCenterStore; +// const {rowSelectIds2, registerAppEditFormHiddenFields} = toJS(authenticationCenterStore.status); +// const formParams = registerAppEditForm.getFormParams(); + +// if(type === "BTN_COLUMN") { +// if(editDetailDialogSelectedKey == 1) { +// authenticationCenterStore.tableStore2.setColSetVisible(true); +// authenticationCenterStore.tableStore2.tableColSet(true); +// } +// } + +// if(type == 'BTN_SAVE'){ +// if(formParams.auth_type_ == "CAS") { +// window.e9HideFormFieldKeys = ["app_secret_"]; +// } +// let checkParams = { +// tableName: 'weaver_sso_app', +// fieldName: 'appid', +// fieldValue: formParams.appid.replace(/^(\s*)|(\s*)$/g, ''), +// idName: 'id', +// idValue: '' +// }; +// checkTableFieldValueUnique(checkParams).then(result => { +// if(result && result.isNotUnique && registerAppEditFormHiddenFields.id == "") { +// registerAppEditForm.showError('appid',getLabel('387654','标识已存在')); +// }else { +// let value = formParams.allow_ip; +// let ipv6 = this.ipv6Test(value.trim()); +// IntegrationUtil.onCheck(registerAppEditForm,function () { +// if(value.trim() == '' || (value.trim() && ipv6)) { +// let params = Object.assign({id: registerAppEditFormHiddenFields.id || "", operation: registerAppEditFormHiddenFields.id ? "edit" : "add"}, formParams); +// authenticationCenterStore.getRegisterAppOperation(params); +// }else { +// registerAppEditForm.showError('allow_ip',getLabel('382232','应用服务器地址非法')); +// } +// }); +// } +// }); +// } + +// if(type == 'rb_1'){ +// //注册数据映射 +// this.doDataMappingEditById({randomField0: '',appid: formParams.appid}); +// } + +// if(type == 'rb_2'){ +// //导入 +// authenticationCenterStore.registerAppDataMappingImportForm.reset(); +// let id=authenticationCenterStore.registerAppId; +// let params = Object.assign({id: id, operation:"import"}, formParams); +// authenticationCenterStore.getRegisterAppDataMappingImportForm(params); +// authenticationCenterStore.setState({ appEditFormDetailDataMappingImportDialogVisible: true }); + +// } + +// if(type == 'rb_3'){ +// //删除 +// if(toJS(tableStore2.selectedRowKeys).length>0) { +// authenticationCenterStore.confirmModal(`${getLabel(385625, '确定要删除选择的记录吗?')}`, authenticationCenterStore.getRegisterAppDataMappingOperation, {operation:'delete', id: toJS(tableStore2.selectedRowKeys)}); +// } +// } +// } + +// onOperatesClick = (record, index, operate) => { +// const { authenticationCenterStore } = this.props; +// const { selectedKey } = toJS(authenticationCenterStore.status); +// if (operate.index == "0") { +// this.doDataMappingEditById(record); +// } +// if (operate.index == "1") { +// //删除 +// authenticationCenterStore.confirmModal(`${getLabel(15097, '确定要删除吗?')}`, authenticationCenterStore.getRegisterAppDataMappingOperation, {operation:'delete',id: record.randomField0}); +// } +// }; + +// doDataMappingEditById(record) { +// const { authenticationCenterStore } = this.props; +// const { registerAppEditForm } = authenticationCenterStore; +// authenticationCenterStore.registerAppDataMappingEditForm.reset(); +// authenticationCenterStore.setOperateDataMappingIndex(record.randomField0); +// authenticationCenterStore.getRegisterAppDataMappingEditForm({ id: record.randomField0,appid:record.appid ,account_rules:registerAppEditForm.getFormParams().account_rules}); +// authenticationCenterStore.setState({ appEditFormDetailDataMappingDialogVisible: true }); +// } + +// } diff --git a/pc4backstage/integration/components/authenticationcenter/AppEditDialog.js b/pc4backstage/integration/components/authenticationcenter/AppEditDialog.js new file mode 100644 index 0000000..4c8e103 --- /dev/null +++ b/pc4backstage/integration/components/authenticationcenter/AppEditDialog.js @@ -0,0 +1,187 @@ +// import React from "react"; +// import {inject, observer} from "mobx-react"; +// import { Button} from "antd"; +// import {toJS} from "mobx"; +// import {WeaForm, WeaLogView, WeaNewScroll, WeaSwitch, WeaTableNew} from "comsMobx"; +// import {WeaDialog, WeaLocaleProvider, WeaTools, WeaSearchGroup, WeaFormItem, WeaRightMenu} from "ecCom"; +// import * as IntegrationUtil from "../../util/IntegrationUtil"; +// import {checkTableFieldValueUnique} from "../../apis/CommonService"; +// const { getKey } = WeaTools; +// const getLabel = WeaLocaleProvider.getLabel; + +// const store = ["authenticationCenterStore"]; + +// @inject(...store) +// @observer +// export default class AppEditDialog extends React.Component { +// render() { +// const {authenticationCenterStore} = this.props; +// const status = toJS(authenticationCenterStore.status); + +// return authenticationCenterStore.setState({appEditFormDialogVisible: false})} +// visible={status.appEditFormDialogVisible} +// style={{width: 700, height: 600}} +// hasScroll +// moduleName="integration" +// buttons={[ +// , +// // , +// ]} +// moreBtn={{ +// datas : this.getRightMenu(), +// collectParams: [] +// }} +// > +// +// { +// authenticationCenterStore.registerAppEditForm.render({col: 1},{ +// onChange: (v)=> {}, +// isHide: (key, formParams) => {} + +// },true,(c, idx)=>{ +// if(idx==0){ +// let items = []; +// let form = authenticationCenterStore.registerAppEditForm; +// let formParams = form.getFormParams(); +// c.items.map(fields => { +// items.push({ +// com: ( +// +// +// { +// if(getKey(fields) === 'appid') { +// let checkParams = { +// tableName: 'weaver_sso_app', +// fieldName: 'appid', +// fieldValue: form.getFormParams().appid.replace(/^(\s*)|(\s*)$/g, ''), +// idName: 'id', +// idValue: '' +// }; +// checkTableFieldValueUnique(checkParams).then(result => { +// if(result&&result.isNotUnique) { +// form.showError('appid',getLabel('387654','标识已存在')); +// // message.error(getLabel('387654','标识已存在')); +// } +// }); +// } +// }} +// /> +// {/*{getKey(fields)==='account_rules'&&formParams.account_rules>5?:""}*/} +// + +// ), +// colSpan: 1, +// hide: form.isHide(fields, (key, formParams) => { +// let hide = false; +// if ('definebroswerType' == key && formParams.account_rules !== '7') { +// hide = true; +// } +// return hide; +// }), +// onChange: (v)=> { +// // console.log(v); +// } +// }) +// }); + +// return +// } +// })} +// +// +// } + +// getRightMenu() { +// let btnArr = [ +// { +// key: 'BTN_SAVE', +// icon: , +// content : `${getLabel(86,'保存')}`, +// onClick : () => {this.onRightMenuClick('BTN_SAVE')} +// } +// // ,{ +// // key: 'BTN_SAVE_AND_OPEN_DETAIL', +// // icon: , +// // content : `${getLabel(125540,'保存后详细设置')}`, +// // onClick : () => {this.onRightMenuClick('BTN_SAVE_AND_OPEN_DETAIL')} +// // } +// ]; +// return btnArr; +// } + +// ipv6Test = (value) => { +// let reg = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; +// let regV4 = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/ + +// let datas = value.split(','); +// for(let i = 0; i < datas.length; i++) { +// if(!reg.test(datas[i].trim()) && (!regV4.test(datas[i].trim()))) { +// return false; +// } +// } +// return true; +// } + +// onRightMenuClick = (type) => { +// const {authenticationCenterStore} = this.props; +// const {registerAppEditForm, status} = authenticationCenterStore; +// const {interfaceRegisterCustomFormHiddenFields} = toJS(authenticationCenterStore.status); +// if(type == 'BTN_SAVE'){ +// let checkParams = { +// tableName: 'weaver_sso_app', +// fieldName: 'appid', +// fieldValue: registerAppEditForm.getFormParams().appid.replace(/^(\s*)|(\s*)$/g, ''), +// idName: 'id', +// idValue: '' +// }; +// checkTableFieldValueUnique(checkParams).then(result => { +// if(result&&result.isNotUnique) { +// registerAppEditForm.showError('appid',getLabel('387654','标识已存在')); +// // message.error(getLabel('387654','标识已存在')); +// }else { +// let value = registerAppEditForm.getFormParams().allow_ip; +// let ipv6 = this.ipv6Test(value.trim()); +// IntegrationUtil.onCheck(registerAppEditForm,function () { +// if(value.trim() == '' || (value.trim() && ipv6)) { +// let id=""; +// let operation = "add"; +// let params = Object.assign({id:id,operation:operation}, registerAppEditForm.getFormParams()); +// authenticationCenterStore.getRegisterAppOperation(params); +// }else { +// registerAppEditForm.showError('allow_ip',getLabel('382232','应用服务器地址非法')); +// } +// }); +// } +// }); +// } + +// if(type == 'BTN_SAVE_AND_OPEN_DETAIL'){ +// IntegrationUtil.onCheck(registerAppEditForm,function () { +// let id=""; +// let operation = ("add"); +// let params = Object.assign({id:id,operation:operation}, registerAppEditForm.getFormParams()); +// authenticationCenterStore.getRegisterAppOperation(params,(result)=>{ +// if(result.id) { +// let p={id:result.id,operation:"edit"} +// authenticationCenterStore.getRegisterAppEditForm(p); +// } +// }); +// }); + +// } + +// } + +// } diff --git a/pc4backstage/integration/components/authenticationcenter/index.js b/pc4backstage/integration/components/authenticationcenter/index.js new file mode 100644 index 0000000..a9b6cf4 --- /dev/null +++ b/pc4backstage/integration/components/authenticationcenter/index.js @@ -0,0 +1,206 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {Button} from "antd"; +import {WeaFormItem, WeaLocaleProvider, WeaRightMenu, WeaSearchGroup, WeaTop, WeaTools} from "ecCom"; +import {WeaSwitch} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import PopoverButton from '../../public/PopoverButton'; +import "../../style/webxml.less"; + +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("authenticationCenterStore") +@observer +class AuthenticationCenter extends React.Component { + constructor(props) { + super(props); + this.state = { + visiable:false, + collectParams: { + favname: getLabel('516737','CAS认证'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/authenticationcenter", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationCenterStore } = this.props; + authenticationCenterStore.doInit("cas"); + } + + componentWillUnmount() { + this.props.authenticationCenterStore.clearStore(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationCenterStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationCenterStore.doInit("cas"); + } + } + + /** + * 右键菜单点击事件 + * @param type + */ + onRightMenuClick = (type) => { + const { authenticationCenterStore } = this.props; + const { newForm } = authenticationCenterStore; + const {BaseInfoFormHiddenFields} = toJS(authenticationCenterStore.status); + if (type == "BTN_BASE_SAVE") { + IntegrationUtil.onCheck(newForm,()=>{ + let formParams = newForm.getFormParams(); + let params = Object.assign({}, formParams, {method: 'weaversso'}); + delete params.token_isuse; + delete params.oauth2_isuse; + delete params.spnego_isuse; + delete params.dlgt_isuse; + let isOpenCas = BaseInfoFormHiddenFields.isOpenCas; + + // 开启需要检测是否通过 + if(params.isuse == "1") { + authenticationCenterStore.getBaseInfoFormOperation({casserverurl: formParams.loginurl, method: 'test', testBeforeSave: true}, (result) => { + if(result.success) { + if(isOpenCas) { + if(newForm.getFormParams().isuse=="1"){ + authenticationCenterStore.confirmModal(`${getLabel(382221 ,'经检测,需要同时开启CAS客户端,保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!')}`, authenticationCenterStore.getBaseInfoFormOperation , params); + }else{ + authenticationCenterStore.confirmModal(`${getLabel(382222 ,'经检测,需要同时关闭CAS客户端,保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!')}`, authenticationCenterStore.getBaseInfoFormOperation , params); + } + }else{ + IntegrationUtil.doConfirm(getLabel('512788','保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), authenticationCenterStore.getBaseInfoFormOperation , params); + } + } + }); + }else { + if(isOpenCas) { + if(newForm.getFormParams().isuse=="1"){ + authenticationCenterStore.confirmModal(`${getLabel( 382221 ,'经检测,需要同时开启CAS客户端,保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!')}`, authenticationCenterStore.getBaseInfoFormOperation , params); + }else{ + authenticationCenterStore.confirmModal(`${getLabel( 382222 ,'经检测,需要同时关闭CAS客户端,保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!')}`, authenticationCenterStore.getBaseInfoFormOperation , params); + } + }else{ + IntegrationUtil.doConfirm(getLabel('512788','保存后将自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), authenticationCenterStore.getBaseInfoFormOperation , params); + } + } + }); + }else if(type == "BTN_TEST") { + let loginurl = newForm.getFormParams().loginurl; + let params = {casserverurl: loginurl, method: 'test'}; + authenticationCenterStore.getBaseInfoFormOperation(params); + } + }; + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu() { + return [{ + key: "BTN_BASE_SAVE", + icon: , + content: getLabel(30986, '保存'), + onClick: () => this.onRightMenuClick("BTN_BASE_SAVE") + }, { + key: 'BTN_TEST', + icon: , + content: `${getLabel(25496, '测试')}`, + onClick: () => this.onRightMenuClick('BTN_TEST') + }] + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + return [ + this.onRightMenuClick('BTN_BASE_SAVE')} + />, + + ] + }; + + getBaseInfoForm = () => { + const {authenticationCenterStore} = this.props; + const {newForm, status} = authenticationCenterStore; + const {BaseInfoFormFields} = toJS(status); + const {isFormInit} = newForm; + let group = []; + const formParams = newForm.getFormParams(); + + isFormInit && BaseInfoFormFields && BaseInfoFormFields.map((c, index) =>{ + if(index == 0) { + let items = []; + c.items && c.items.map(fields => { + items.push({ + com:( + + {}} /> + ), + colSpan:1, + hide: newForm.isHide(fields, (keys, allParams) => { + let bool = false; + getKey(fields) === 'loginurl' && allParams.isuse != '1' && (bool = true); + getKey(fields) === 'logouturl' && allParams.isuse != '1' && (bool = true); + getKey(fields) === 'oaadress' && allParams.isuse != '1' && (bool = true); + return bool; + }) + }); + }); + group.push(); + } + }); + return group; + } + + render() { + const {authenticationCenterStore} = this.props; + const {hasRight, rightLoading, status: {hasNonStandard, nonStandLoading}} = authenticationCenterStore; + const {collectParams} = this.state; + return ( + nonStandLoading + ? null + : hasNonStandard + ? rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + > + {this.getBaseInfoForm()} + + + : + : + ); + } +} + +export default AuthenticationCenter; diff --git a/pc4backstage/integration/components/authenticationsource/EditFormDialog.js b/pc4backstage/integration/components/authenticationsource/EditFormDialog.js new file mode 100644 index 0000000..e80fdcd --- /dev/null +++ b/pc4backstage/integration/components/authenticationsource/EditFormDialog.js @@ -0,0 +1,137 @@ +import React from "react"; +import { + inject, + observer, +} from "mobx-react"; +import { + Button, +} from "antd"; +import { + toJS, +} from "mobx"; +import { + WeaDialog, + WeaLocaleProvider, + WeaRightMenu, +} from "ecCom"; +import { + getForm, + checkUnique, + onCheck, +} from "../../util/IntegrationUtil" + +const {getLabel} = WeaLocaleProvider; + +@inject("authenticationSourceStore") +@observer +export default class EditFormDialog extends React.Component { + + closeDialog = () => { + const {authenticationSourceStore} = this.props; + authenticationSourceStore.setState({showNewFormDialog: false}); + } + + getBtns = () => { + return [ + + ]; + } + + getRightMenu() { + return [{ + key: 'BTN_SAVE', + icon: , + content : `${getLabel(86,'保存')}`, + onClick : () => this.onRightMenuClick('BTN_SAVE') + }]; + } + + onRightMenuClick = (type) => { + const { + authenticationSourceStore, + } = this.props, { + newForm, + status, + } = authenticationSourceStore, { + newFormHiddenFields, + paramsData, + } = toJS(status); + if(type == 'BTN_SAVE'){ + onCheck(newForm, () => { + checkUnique({ + tableName: 'weaver_sso_src', + fieldName: 'name_', + fieldValue: newForm.getFormParams()["name_"].replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: newFormHiddenFields.id, + }, newForm, "name_", name="2", newFormHiddenFields.id, () => { + let formParams = newForm.getFormParams(); + let params = Object.assign({}, newFormHiddenFields, formParams, { + orderNum: typeof(formParams.orderNum) === "object" + ? formParams.orderNum.join && formParams.orderNum.join(",") + ? formParams.orderNum + : "0" + : formParams.orderNum + }); + params.dtinfo_paramsData = JSON.stringify(paramsData); + authenticationSourceStore.getAuthenticationSourceOperation(params); + }); + }) + } + } + + onChangeForm = (form, allParams, fields) => { + const { + authenticationSourceStore, + } = this.props, { + newFormHiddenFields, + } = toJS(authenticationSourceStore.status); + const key = fields.domkey[0], formParams = form.getFormParams(); + if("name_" === key && formParams.name_ && formParams.name_.trim()) { + checkUnique({ + tableName: 'weaver_sso_src', + fieldName: 'name_', + fieldValue: form.getFormParams()[key].replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: newFormHiddenFields.id, + }, form, key, name="2"); + } + if(typeof(form.getFormParams()[key]) === "string") { + form.updateFields({[key]: form.getFormParams()[key] ? form.getFormParams()[key].trim() : ""}); + } + } + + render() { + const { + authenticationSourceStore, + } = this.props, { + status, + newForm, + } = authenticationSourceStore, { + showNewFormDialog, + newFormHiddenFields, + newFormCondition=[], + } = toJS(status); + + return + + {getForm(newForm, newFormCondition, true, this.onChangeForm, this && this.props && this.props.ecId || '', "integrationAuthSourceEditForm")} + + + } +} diff --git a/pc4backstage/integration/components/authenticationsource/index.js b/pc4backstage/integration/components/authenticationsource/index.js new file mode 100644 index 0000000..03ed30d --- /dev/null +++ b/pc4backstage/integration/components/authenticationsource/index.js @@ -0,0 +1,237 @@ +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import {Button} from "antd"; +import {WeaLocaleProvider, WeaRightMenu, WeaTab, WeaTop} from "ecCom"; +import {WeaLogView, WeaTableNew} from "comsMobx"; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import EditFormDialog from "./EditFormDialog"; + +const {WeaTable} = WeaTableNew; +const getLabel = WeaLocaleProvider.getLabel; +const WeaLogViewComp = WeaLogView.Component; + +@inject("authenticationSourceStore") +@observer +class TodoClient extends React.Component { + constructor(props) { + super(props); + this.state = { + showSearchAd: false, + visible: false, + targetId: "", + collectParams: { + favname: `${getLabel(521396, "认证源")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/authentication_source", + importantlevel: 1 + } + }; + } + + componentDidMount() { + const { authenticationSourceStore } = this.props; + authenticationSourceStore.doInit(); + } + + componentWillReceiveProps(nextProps) { + const { authenticationSourceStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + authenticationSourceStore.doInit(); + } + } + + getAdvancedSearch = () => { + const {authenticationSourceStore} = this.props; + const {searchForm, status} = authenticationSourceStore; + const {condition} = toJS(status); + return IntegrationUtil.getAdvancedItem(searchForm, condition, this.handleSearchFun, false, this && this.props && this.props.ecId || '', "integrationAuthSource"); + }; + + handleSearchFun = () => { + const { authenticationSourceStore } = this.props; + authenticationSourceStore.getAuthenticationSourceList(); + this.setState({showSearchAd: false}); + } + + getTabButtonsAd = () => { + const { authenticationSourceStore } = this.props; + return IntegrationUtil.getSearchBtns( + this.handleSearchFun, + () => authenticationSourceStore.searchForm.reset(), + () => this.setState({showSearchAd: false}), + this && this.props && this.props.ecId || '', + "integrationAuthSource" + ); + } + + getRightMenu() { + const { + authenticationSourceStore, + } = this.props, { + tableStore, + status, + } = authenticationSourceStore, { + rightMenus, + } = toJS(status); + let btnArr = rightMenus && rightMenus.map(m => { + return { + key: m.type, + icon: , + content: m.menuName, + onClick: () => this.onRightMenuClick(m.type), + disabled: m.type==='rb_2' && toJS(tableStore.selectedRowKeys).length === 0 + }; + }); + btnArr = btnArr.concat([{ + key: "BTN_Log", + icon: , + content: getLabel('83','日志'), + onClick: () => this.onRightMenuClick("4") + }, { + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }]); + return btnArr; + } + + getColumnsInfo = (data) => { + return data && data.map(item => { + if("name_" === item.dbField) { + item.render = (text, record) => this.onRightMenuClick("2", record)}>{text} + } + return item; + }) + } + + onRightMenuClick = (type, record={}) => { + const { + authenticationSourceStore, + } = this.props, { + tableStore, + } = authenticationSourceStore; + if (type == "rb_1") { + authenticationSourceStore.getAuthenticationSourceForm(); + authenticationSourceStore.setState({showNewFormDialog: true}); + }else if (type == "rb_2" || type == "3") { + let title = "3" == type ? getLabel( 15097, '确定要删除吗?') : getLabel(385625, '确定要删除选择的记录吗?'); + let id = "3" == type ? record.randomFieldId : toJS(tableStore.selectedRowKeys); + IntegrationUtil.doConfirm(title, authenticationSourceStore.getAuthenticationSourceOperation, {operation:'delete', id}); + }else if (type == "BTN_COLUMN") { + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + }else if (type == "2") { + authenticationSourceStore.getAuthenticationSourceForm({id: record.randomFieldId}); + authenticationSourceStore.setState({showNewFormDialog: true}); + }else if (type == "4") { + this.setState({ + visible: true, + targetId: record.randomFieldId || "", + }) + } + }; + + getBtns = () => { + const { + authenticationSourceStore, + } = this.props, { + tableStore, + status, + } = authenticationSourceStore, { + rightMenus, + } = toJS(status); + let datas = rightMenus.slice(0, 2); + return datas && datas.map(m => ); + }; + + onOperatesClick = (record, index, operate) => { + this.onRightMenuClick(operate.index, record); + }; + + onCloseLogDialog = () => this.setState({visible: false, targetId: ""}); + + render() { + const { + authenticationSourceStore, + } = this.props, { + searchForm, + tableStore, + status, + hasRight, + rightLoading, + logTable, + } = authenticationSourceStore, { + advanceHeight, + hasNonStandard, + nonStandLoading, + selectedKey=0, + tabDatas=[], + } = toJS(status), { + showSearchAd, + visible, + targetId, + collectParams, + } = this.state; + + return (nonStandLoading + ? null + : hasNonStandard + ? rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + /> + this.setState({showSearchAd: !showSearchAd})} + hideSearchAd={() => this.setState({showSearchAd: false})} + searchsBaseValue={searchForm.getFormParams().name_} + onChange={v => authenticationSourceStore.setState({selectedKey: v})} + onSearch={this.handleSearchFun} + onSearchChange={value => searchForm.updateFields({name_: value})} + /> + + + + + : + : + ); + } +} + +export default TodoClient; diff --git a/pc4backstage/integration/components/cas/index.js b/pc4backstage/integration/components/cas/index.js new file mode 100644 index 0000000..bd2f38d --- /dev/null +++ b/pc4backstage/integration/components/cas/index.js @@ -0,0 +1,581 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { Button, Spin, Modal } from "antd"; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; +import WhiteList from '../../public/WhiteList'; +import '../../style/cas.less'; +import { + WeaLocaleProvider, + WeaTop, + WeaTab, + WeaRightMenu, + WeaFormItem, + WeaTools, + WeaSearchGroup, + WeaNewScroll, + WeaHelpfulTip, + WeaInput, + WeaDialog, + WeaCheckbox, +} from "ecCom"; + +import { WeaSwitch } from "comsMobx"; +import DoubleInput from '../doubleInput'; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import PopoverButton from '../../public/PopoverButton'; + +const getLabel = WeaLocaleProvider.getLabel; +@inject("cas") +@inject("whiteListStore") +@observer +export default class Cas extends React.Component { + constructor(props) { + super(props); + this.state = { + editTableSelected: [], + clazz: "weaver.interfaces.sso.cas.AuthenticationFilter", + ticketClazz: "weaver.interfaces.sso.cas.AbstractTicketValidationFilter", + datas: [{ + title: getLabel('513856','登录校验'), + viewcondition: "0" + }, { + title: `Ticket${getLabel('128877','校验')}`, + viewcondition: "1" + }], + selectedKey: "0" + }; + } + + componentDidMount() { + const { cas, whiteListStore } = this.props; + whiteListStore.getRegisterFilterId({filter_clazz: this.state.clazz}, cas.doInit); + } + + onRightMenuClick = (type, recordId) => { + const { cas } = this.props; + const { save, newBaseForm } = cas; + const formParams = newBaseForm.getFormParams(); + switch (type) { + case "save": + save(); + break; + case "test": + if (formParams.isuse == 1) { + Modal.confirm({ + title: `${getLabel(131329,'信息确认')}`, + content: getLabel('514734','部署后会自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + okText: `${getLabel(382958,'确定')}`, + cancelText:`${getLabel(31129,'取消')}`, + onOk: () => this.complete(), + }); + }else { + Modal.confirm({ + title: `${getLabel(131329,'信息确认')}`, + content: getLabel(387003,'是否要关闭CAS?'), + okText: `${getLabel(382958,'确定')}`, + cancelText:`${getLabel(31129,'取消')}`, + onOk: () => this.complete(), + }); + } + break; + } + } + + /** + * 完成 + */ + complete = () => { + const { cas } = this.props; + const { save, newBaseForm } = cas; + const formParams = newBaseForm.getFormParams(); + if (formParams.isuse == '1' && formParams.appauth != 1 && formParams.pcauth != 1) { + Modal.info({ + title: getLabel(15172,'系统提示'), + content: getLabel(386921,'请开启pc认证或手机认证!'), + okText: getLabel(826,'确定'), + onOk:() => {}, + }); + } else { + save(1); + } + } + + getBtns = () => { + const { cas } = this.props; + const { loading } = cas; + let btns = []; + btns = [ + , + this.onRightMenuClick("test")} + />, + ]; + return btns; + } + + getRightMenu() { + const { cas } = this.props; + const { loading } = cas; + let btnArr = [{ + key: "save", + disabled: loading, + icon: , + content: getLabel("86", "保存"), + onClick: () => this.onRightMenuClick("save") + },{ + key: "test", + disabled: loading, + icon: , + // content: , + content: getLabel('514733','部署'), + onClick: () => this.onRightMenuClick("test") + }]; + return btnArr; + } + getColumns = (columns) => { + let cols = []; + columns && columns.forEach((col)=> { + if (col.dataIndex === 'excludeurl') { + col.com = [{ + type: 'CUSTOM', + key: 'excludeurl', + render: (text, record, index, onEdit) => { + return { + onEdit({ + type: 'CUSTOM', + record, + index, + key: 'excludeurl', + value: v + }) + }} + /> + } + }] + cols.push(col); + }else if (col.dataIndex === 'excludedescription') { + col.com = [{ + type: 'CUSTOM', + key: 'excludedescription', + render: (text, record, index, onEdit) => { + return { + onEdit({ + type: 'CUSTOM', + record: { + ...record, + excludedescription: v ? v.trim() : "", + }, + index, + }) + }} + /> + } + }] + cols.push(col); + }else if (col.dataIndex === 'logincheck') { + col.com = [{ + type: 'CHECKBOX', + key: 'logincheck', + render: (text, record, index, onEdit) => { + return { + onEdit({ + type: 'CHECKBOX', + record: { + ...record, + logincheck: v, + }, + index, + }) + }} + /> + } + }] + col.title= + + {col.title}

{getLabel('', '启用登录校验 : 勾选,表示认证排除地址生效,不走CAS认证。')}

+
}/>
+ + cols.push(col); + }else if (col.dataIndex === 'ticketcheck') { + col.com = [{ + type: 'CHECKBOX', + key: 'ticketcheck', + render: (text, record, index, onEdit) => { + return { + onEdit({ + type: 'CHECKBOX', + record: { + ...record, + ticketcheck: v, + }, + index, + }) + }} + /> + } + }] + col.title= + + {col.title}

{getLabel('', '启用Ticket校验:勾选,表示认证排除地址生效,若排除地址后带有ticket则不走Ticket校验。')}

+
}/> + + cols.push(col); + } + + }) + return cols; + } + + tableEditOperate = type => { + const { cas } = this.props; + const { tableEdit } = cas; + switch (type) { + case "add": + tableEdit.doAdd(); + break; + case "del": + tableEdit.doDelete(); + break; + } + }; + + willDelete = (datas, keys) => new Promise((resolve, reject) => { + Modal.confirm({ + title: `${getLabel(131329,'信息确认')}`, + content: `${getLabel(385625,'确定要删除选择的记录吗?')}`, + okText: `${getLabel(382958,'确定')}`, + cancelText:`${getLabel(31129,'取消')}`, + onOk: () => resolve(true), + onCancel: () => resolve(false), + }) + }) + + willAdd = (allDatas, addData) => { + const {cas} = this.props; + const {tableDatas} = toJS(cas.status); + let currentData = []; + + currentData = { + ...addData, + logincheck: '1' + } + + allDatas && allDatas.map((v, index) => { + if(v.key === addData.key) { + allDatas[index] = currentData; + } + }) + + cas.setState({tableDatas: allDatas}); + } + + getTabs = () => { + const {datas, selectedKey, ticketClazz, clazz} = this.state; + return { + let clazz_ = ""; + this.setState({selectedKey: v}); + if(v == 0) { + clazz_ = clazz; + }else if(v == 1) { + clazz_ = ticketClazz; + } + this.props.whiteListStore.getRegisterFilterId({filter_clazz: clazz_}); + }} + /> + } + + getFormSearchs = (form, datas) => { + const { cas } = this.props; + const { res, userAgent } = toJS(cas.status); + const {isFormInit} = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && datas && datas.forEach((c, idx) => { + let leftDis = idx == 6 ? -17 : 0; + let items = []; + c.items && c.items.forEach(field => { + let hideLabel = false; + let fieldcolSpan = field.fieldcol; + const key = WeaTools.getKey(field); + const bindObj = form.$(key); + if ('DESCRIPTION' == field.conditionType) { + fieldcolSpan = 24; + } + let dom = + if ('casserverurl' == field.domkey[0]) { + dom =
+ {dom} + +
+ }else if ('casserverloginpage' == field.domkey[0] || 'casserverlogoutpage' == field.domkey[0]) { + dom = + }else if ('ecologyurl' == field.domkey[0]) { + dom =
+ {dom} + +
+ }else if ('ecologyloginpage' == field.domkey[0] ) { + dom = + }else if ('appauthAddress' == field.domkey[0]) { + dom =
+ + +
+ hideLabel = false; + }else if('strgy_ua_val' === field.domkey[0]) { + return; + }else if('strgy_ua' === field.domkey[0]) { + let userAgentDom = null; + if(form.getFormParams().strgy_ua == '1') { + userAgentDom = userAgent && userAgent.map((field, index) => { + return
+ + + +
+ }); + } + dom = + {dom} + {userAgentDom} + + }else if('accounttype' === field.domkey[0] && form.getFormParams().accounttype == '7') { + let marginLeft = 15, marginTop = 5, title = ""; + if(field.selectLinkageDatas && field.selectLinkageDatas["7"]) { + if(field.selectLinkageDatas["7"].conditionType.toLocaleLowerCase() == "textarea") { + field.selectLinkageDatas["7"].maxRows = 4; + field.selectLinkageDatas["7"].minRows = 4; + marginLeft = 20; + marginTop = 35; + } + title = field.selectLinkageDatas["7"].helpfulTip; + } + dom = + {dom} + + + } + + items.push({ + com:(
+ + {dom} + +
), + colSpan: 1, + hide: form.isHide(field, (keys, allParams)=> { + let hide = false; + "strgy_ua_val" === field.domkey[0] && allParams.strgy_ua == 0 && (hide = true); + "clusterNodes" === field.domkey[0] && allParams.is_cluster == 0 && (hide = true); + return hide; + }) + }) + }); + if (formParams.isuse == '0' && (idx == 1 || idx == 2 || idx == 3 || idx == 4 || idx == 5)) { + } else { + if (idx !== 5 && idx !== 6) { + group.push() + } else if(idx == 6) { + group.push() + } else if(idx == 5){ + group.push(
) + } + } + }); + return group; + } + /**获取白名单的helpfulTip */ + getWhiteListTip = () => { + return
+

1、{getLabel('514625','点击‘+’如果选择不到需要的白名单地址,可以去【统一白名单地址配置】-【通用白名单】里面进行设置;【统一白名单地址配置】页面需要“统一白名单地址配置”权限')}。

+

2、{getLabel('514627','白名单地址也可以直接在【统一白名单地址配置】-【过滤器白名单】中进行维护,登录校验对应过滤器weaver.interfaces.sso.cas.AuthenticationFilter;Ticket校验对应过滤器weaver.interfaces.sso.cas.AbstractTicketValidationFilter')}。

+
+ } + + getRowSelection = rowSelection => { + const sel = { ...rowSelection }; + sel.getCheckboxProps = record => { + return { disabled: record.viewAttr === '1' }; + }; + return sel; + } + + getDialogBtnsRightMenu() { + const { cas } = this.props; + let btnArr = [{ + key: "test", + icon: , + content: getLabel("25496", "测试"), + onClick: () => cas.telTest() + }]; + return btnArr; + } + + render() { + const { cas, whiteListStore } = this.props; + const { newBaseForm, status,hasRight, rightLoading, loading } = cas; + const { newBaseFormFields, testVisible, hasNonStandard, nonStandLoading } = toJS(status); + return ( + nonStandLoading + ? null + : hasNonStandard + ? rightLoading + ? null + :
+ { + hasRight + ?
+ + + } + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + loading={loading} + dropMenuProps={{ + collectParams: { + favname: `${getLabel(128653, "CAS集成")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/cas", + importantlevel: 1 + } + }} + > + + {this.getFormSearchs(newBaseForm, newBaseFormFields)} + + + + + cas.setState({testVisible: false})} + visible={testVisible} + style={{width: 500, height: 300}} + icon={IntegrationUtil.GeneralTitleColor.icon} + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + hasScroll + buttons={[ + + ]} + moreBtn={{ + datas: this.getDialogBtnsRightMenu(), + collectParams: { + favname: getLabel("128643", "手机认证"), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/cas", + importantlevel: 1 + } + }} + > + + {cas.telForm.render({col: 1})} + + + { + window.weaPortalPublic && window.weaPortalPublic.WeaSystemSetting && + whiteListStore.getRegisterFilterId({filter_clazz: this.state.clazz}, cas.doInit)} + /> + } +
+ : + } +
+ : + ); + } +} diff --git a/pc4backstage/integration/components/cas/index.jsx b/pc4backstage/integration/components/cas/index.jsx new file mode 100644 index 0000000..3ccbf21 --- /dev/null +++ b/pc4backstage/integration/components/cas/index.jsx @@ -0,0 +1,142 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { Button, Menu, Tabs, TopTitle, Tree } from "antd"; +import { + WeaLocaleProvider, + WeaLeftRightLayout, + WeaTop, + WeaTab, + WeaRightMenu, + WeaFormItem, + WeaTools, + WeaSearchGroup +} from "ecCom"; + +import { WeaTableNew, WeaSwitch } from "comsMobx"; + +const { WeaTable } = WeaTableNew; +const { getKey } = WeaTools; + +import * as IntegrationUtil from "../../util/IntegrationUtil"; +const getFormSearchs = (form, datas, needTigger = true, lableCol, fieldcol) => { + const {isFormInit} = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && datas && datas.map(c =>{ + let items = []; + c.items.map(fields => { + items.push({ + com:( + + + ), + colSpan: 1, + hide: form.isHide(fields, (keys, allParams) => { + let bool = false; + getKey(fields) === 'clusterNodes' && allParams.is_cluster != '1' && (bool = true); + return bool; + }) + }) + }); + if(needTigger){ + group.push() + }else { + group.push() + } + }); + return group; +} + +const getLabel = WeaLocaleProvider.getLabel; +@inject("cas") +@observer +export default class Cas extends React.Component { + componentDidMount() { + const { cas } = this.props; + cas.doInit(); + } + + onRightMenuClick = (type, recordId) => { + const { cas } = this.props; + const { save } = cas; + switch (type) { + case "save": + save(); + break; + } + }; + + getBtns = () => { + const { cas } = this.props; + let btns = []; + btns = [ + , + + ]; + return btns; + }; + + getRightMenu() { + const { imrtx } = this.props; + // const { selectedKey, rightMenus, rightMenus1 } = toJS( + // workflowFlowStore.status + // ); + let btnArr = []; + + return btnArr; + } + + render() { + const { cas } = this.props; + const { newBaseForm, status } = cas; + const { newBaseFormFields } = toJS(status); + return ( +
+ } + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{ + collectParams: { + favname: `${getLabel(131795, "CAS集成")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/inteengine/imrtx", + importantlevel: 1 + } + }} + /> + {getFormSearchs(newBaseForm, newBaseFormFields)} +
+ ); + } +} diff --git a/pc4backstage/integration/components/coremail/AddOrEdit.js b/pc4backstage/integration/components/coremail/AddOrEdit.js new file mode 100644 index 0000000..240f563 --- /dev/null +++ b/pc4backstage/integration/components/coremail/AddOrEdit.js @@ -0,0 +1,120 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { + WeaLocaleProvider, + WeaRightMenu, + WeaFormItem, + WeaDialog, + WeaSearchGroup, +} from "ecCom"; +import {WeaSwitch} from "comsMobx"; +import { + onCheck, +} from "../../util/IntegrationUtil"; +import {Button} from 'antd'; + +const {getLabel} = WeaLocaleProvider; + +@inject("coremailStore") +@observer +export default class AddOrEdit extends React.Component { + + getCondition = (form, datas=[]) => { + const {isFormInit} = form; + let group = []; + + isFormInit && datas && datas.forEach((c, index) => { + let items = []; + c.items && c.items.forEach(fields => { + items.push({ + com: ( + + ), + colSpan: 1 + }) + }); + group.push() + }); + return group; + } + + onMenuClick = () => { + const {coremailStore} = this.props; + const {newForm, getCoreMailSaveOperation} = coremailStore; + + onCheck(newForm, getCoreMailSaveOperation); + } + + onTestDatas=()=>{ + const {coremailStore} = this.props; + const {status, newForm, testCoreMail} = coremailStore; + const {operateIndex} = status; + + onCheck(newForm, () => { + let params = Object.assign({}, newForm.getFormParams(), {coremailid: operateIndex,operate:'test',isFormEdit:'1'}); + testCoreMail(params); + }); + } + + render() { + const { + coremailStore, + } = this.props, { + status, + newForm, + flag, + } = coremailStore, { + coremailDialogVisible, + newFormCondition, + operateIndex, + } = status; + + return ( + coremailStore.setStatus('coremailDialogVisible', false)} + buttons={[, + + ]} + moreBtn={{ + datas: [{ + key: 'BTN_SAVE', + icon: , + content : getLabel(30986, '保存'), + onClick : this.onMenuClick + }], + collectParams: [] + }} + > + , + content : getLabel(30986, '保存'), + onClick : this.onMenuClick + }]} + collectParams={[]} + > + { + flag + ? this.getCondition(newForm, newFormCondition) + : null + } + + + ); + } +} diff --git a/pc4backstage/integration/components/coremail/createAndEdit.js b/pc4backstage/integration/components/coremail/createAndEdit.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4backstage/integration/components/coremail/index.js b/pc4backstage/integration/components/coremail/index.js new file mode 100644 index 0000000..fc78d9a --- /dev/null +++ b/pc4backstage/integration/components/coremail/index.js @@ -0,0 +1,560 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { Button, Spin} from "antd"; +import { + WeaLocaleProvider, + WeaTop, + WeaTab, + WeaRightMenu, + WeaFormItem, + WeaSearchGroup, + WeaHelpfulTip +} from "ecCom"; +import { WeaTableNew, WeaSwitch } from "comsMobx"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import Login from "../login/index" +import AddOrEdit from './AddOrEdit'; +import InitializedData from "./initializedData"; +import NonStand from "../../public/NonStand"; + +const { WeaTable } = WeaTableNew; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("coremailStore") +@inject('intelogin') +@observer +export default class DataShow extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + const { initPage } = this.props.coremailStore; + initPage(); + } + + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key) { + const { initPage } = this.props.coremailStore; + initPage(); + } + } + + + getDropMenuDatas = () => { + const { coremailStore } = this.props; + const { status,tableStore } = coremailStore; + const { tabSelected, coremailRightMenu=[] } = toJS(status); + const btnArr = []; + // inteLogin + const { intelogin } = this.props; + const { menus } = intelogin; + const { dropMenuDatas } = menus; + const {selectedRowKeys} = toJS(tableStore); + + switch (tabSelected) { + case 0: + coremailRightMenu && coremailRightMenu.map(item => { + btnArr.push({ + key: item.type, + icon: , + content: item.menuName, + onClick: () => this.onRightMenuClick(item.type), + disabled: (item.type != "rb_1" && selectedRowKeys.length === 0)|| + (item.type=="rb_4"&&selectedRowKeys.length == 0) + ||(item.type=="rb_3"&&selectedRowKeys.length == 0) + ||(item.type=="rb_2"&&selectedRowKeys.length == 0), + }) + }) + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + break; + case 1: + dropMenuDatas && dropMenuDatas.map(item => { + btnArr.push(item); + }) + break; + case 2: + //显示列定制 + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + break; + + } + return btnArr; + } + + getWeaTopBtns = () => { + const { coremailStore } = this.props; + const {status, tableStore} = coremailStore; + const {tabSelected, coremailRightMenu=[]} = toJS(status); + const {selectedRowKeys} = toJS(tableStore); + // inteLogin + const { intelogin } = this.props; + const { menus } = intelogin; + const btns = menus.buttons; + const btnArr = []; + + switch (tabSelected) { + case 0: + coremailRightMenu && coremailRightMenu.forEach(item => { + btnArr.push( + + ) + }) + break; + case 1: + btns && btns.forEach(item => { + btnArr.push(item); + }) + break; + case 2: + break; + } + return btnArr; + } + + getTab = () => { + return [ + { + title: getLabel('505949','集成列表'), + viewcondition: 0 + },{ + title: getLabel('20960','集成登录'), + viewcondition: 1 + },{ + title: getLabel('125928','同步日志'), + viewcondition: 2 + } + ]; + } + + onRightMenuClick = (type, selectedIndex) => { + const { coremailStore } = this.props; + const { save, init, test, pageForm, logFormTable, tableStore, getCoreMailDelete ,getInitalDialog, testCoreMail, status: {tabSelected}} = coremailStore; + const {selectedRowKeys} = toJS(tableStore); + const params = pageForm.getFormParams(); + selectedIndex = selectedIndex != undefined ? selectedIndex : selectedRowKeys; + + switch (type) { + case "BTN_SAVE": + IntegrationUtil.onCheck(pageForm, () => { + save(params) + }) + break; + case "BTN_INIT": + init(params); + break; + case "BTN_TEST": + IntegrationUtil.onCheck(pageForm, () => { + test(params) + }) + break; + case "BTN_COLUMN": + if(tabSelected == 0) { + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + }else if(tabSelected == 2){ + logFormTable.setColSetVisible(true); + logFormTable.tableColSet(true); + } + break; + case "BTN_NEW": + this.onRightMenuClick2("BTN_NEW"); + break; + case "BTN_DEL": + this.onRightMenuClick2("BTN_DEL"); + break; + case "BTN_LOG": + this.onRightMenuClick2("BTN_LOG"); + break; + case "rb_1": + coremailStore.setStatus('coremailDialogVisible', true); + coremailStore.setStatus('operateIndex', ''); + coremailStore.getCoremailMailAddForm(); + break; + case "BTN_EDIT": + coremailStore.setStatus('coremailDialogVisible', true); + coremailStore.setStatus('operateIndex', selectedIndex); + coremailStore.getCoremailMailAddForm(); + break; + case "rb_2": + IntegrationUtil.doConfirm(getLabel(385625, '确定要删除选择的记录吗?'), getCoreMailDelete, {coremailid: selectedIndex}) + break; + case "rb_3": + getInitalDialog(selectedIndex); + break; + case "rb_4": + testCoreMail({coremailid: selectedIndex,operate:'test'}); + break; + } + } + + resetSearchCondition=v=>{ + const { coremailStore } = this.props; + const {listSearchForm,logSearchForm,getCoreMailList,getDatas} = coremailStore; + switch (v) { + case 0: + listSearchForm.reset(); + getCoreMailList(listSearchForm.getFormParams()); + + break; + case 1: + const { + intelogin + } = this.props, { + search, + mainTab, + } = intelogin, { + form + } = mainTab; + form.reset(); + search(); + break; + case 2:; + logSearchForm.reset(); + getDatas(null, true); + break; + } + } + + getSearchAD = () => { + const { coremailStore } = this.props; + const { logSearchForm, logSearchFormConditions=[], status, listSearchForm } = coremailStore; + const { tabSelected, listSearchCondition=[] } = toJS(status); + let searchForm = null, datas = []; + switch (Number(tabSelected)) { + case 0: + searchForm = listSearchForm; + datas = [...listSearchCondition]; + break; + case 2: + searchForm = logSearchForm; + datas = [...toJS(logSearchFormConditions)]; + break; + case 1: + const { intelogin } = this.props; + const { mainTab } = intelogin; + const { + form, + condition=[], + } = mainTab; + searchForm = form; + datas = [...condition]; + break; + } + try { + return IntegrationUtil.getAdvancedItem(searchForm, datas, this.onSearch, false, this && this.props && this.props.ecId || '', "integrationCoremail"); + }catch(err){ + return null; + } + }; + + onSearch = () => { + const { coremailStore } = this.props; + const { status, getDatas, setStatus, getCoreMailList, listSearchForm } = coremailStore; + const { tabSelected } = toJS(status); + + switch (tabSelected) { + case 0: + getCoreMailList(listSearchForm.getFormParams()); + setStatus("searchShow", false); + break; + case 2: + getDatas(null, true); + setStatus("searchShow", false); + break; + case 1: + const { + intelogin + } = this.props, { + search, + } = intelogin; + search(); + setStatus("searchShow", false); + break; + } + } + + getSearchButtonsAd = () => { + const { coremailStore } = this.props; + const { status, setStatus, listSearchForm, logSearchForm } = coremailStore; + const { tabSelected } = toJS(status); + let resetFun = null; + switch (Number(tabSelected)) { + case 0: + resetFun = () => listSearchForm.reset(); + break; + case 2: + resetFun = () => logSearchForm.reset(); + break; + case 1: + const { + intelogin + } = this.props, { + mainTab, + } = intelogin, { + form + } = mainTab; + resetFun = () => form.reset(); + break; + } + return IntegrationUtil.getSearchBtns( + this.onSearch, + resetFun, + () => setStatus("searchShow", false), + this && this.props && this.props.ecId || '', + "integrationCoremail", + ); + }; + + handleSearch = () => { + const { intelogin } = this.props; + const { search } = intelogin; + let params = {} + params.typename = '8';//筛选 + + isPanelShow && changeSearchPanelStatus(false); + getTableInfo(params); + } + + doOnSearchChange = v => { + const { coremailStore } = this.props; + const { status, setStatus, listSearchForm } = coremailStore; + const { tabSelected } = toJS(status); + switch (tabSelected) { + case 0: + listSearchForm.updateFields({systemaddress: v}); + break; + case 1: + const { + intelogin + } = this.props, { + mainTab, + } = intelogin, { + form, + } = mainTab; + form.updateFields({name: v}); + break; + case 2: + setStatus("searchValue", v); + break; + } + } + + doOnSearch = () => { + const { coremailStore } = this.props; + const { status, getDatas, getCoreMailList, listSearchForm } = coremailStore; + const { tabSelected, searchValue } = toJS(status); + // intelogin + const { intelogin } = this.props; + const { search } = intelogin; + switch (tabSelected) { + case 0: + getCoreMailList({systemaddress: listSearchForm.getFormParams().systemaddress}); + break; + case 1: + search(); + break; + case 2: + getDatas({ operatedata: searchValue }); + break; + } + } + + getSearchBaseValue = () => { + const { coremailStore } = this.props; + const { status, listSearchForm } = coremailStore; + const { tabSelected } = toJS(status); + // intelogin + const { + intelogin + } = this.props, { + mainTab, + } = intelogin, { + form + } = mainTab; + return tabSelected == 0 ? listSearchForm.getFormParams().systemaddress : form.getFormParams().name; + } + + getFormSearchs = (pageForm, pageFormConditions=[]) => { + const { isFormInit } = pageForm; + let group = []; + const formParams = pageForm.getFormParams(); + isFormInit && pageFormConditions && pageFormConditions.map((c, index) => { + let items = []; + c && c.items && c.items.map(field => { + let key = field.domkey[0]; + items.push({ + com: ( + + + {key === 'domain' ? + : '' + } + + + ) + }) + }) + group.push() + }) + return group; + } + + // 列表的三个点 + onOperatesClick = (record, index, operate) => { + let selectIndex = record.randomFieldId; + let type = ''; + + switch (Number(operate.index)) { + case 0: + type = 'BTN_EDIT';//编辑 + break; + case 1: + type = 'rb_2';//删除 + break; + case 2: + type = 'rb_4';//测试 + break; + case 3: + type= 'rb_3';//初始化 + break; + } + this.onRightMenuClick(type, selectIndex); + } + + // 列表重定义列 + getColumns = (columns) => { + let newColumns = ''; + + newColumns = columns && columns.map(column => { + let newColumn = column; + newColumn.render = (text, record, index) => { //前端元素转义 + let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex]; + return ( + newColumn && (newColumn.dataIndex === 'systemaddress'||newColumn.dataIndex === 'coremailsys') + ? this.onRightMenuClick('BTN_EDIT', record.randomFieldId)} dangerouslySetInnerHTML={{__html: valueSpan}}/> + :
+ ) + }; + return newColumn; + }); + return newColumns; + } + + render() { + const { coremailStore } = this.props; + const { status, setStatus, logFormTable, tableStore, initialList, showInitDia} = coremailStore; + const { loading, tabSelected, searchShow, rightLoading, hasNonStandard, nonStandLoading } = toJS(status); + + return (nonStandLoading + ? null + : hasNonStandard + ?
+ + + } + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + dropMenuProps={{ + collectParams: { + favname: `${getLabel("129787", "CoreMail集成")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/coremail", + importantlevel: 1 + } + }} + > + setStatus("searchShow", e)} + hideSearchAd={() => setStatus("searchShow", false)} + onChange={v =>{this.resetSearchCondition(Number(v)); setStatus("tabSelected", Number(v))}} + onSearchChange={v => { this.doOnSearchChange(v); }} + onSearch={v => this.doOnSearch()} + searchsBaseValue={this.getSearchBaseValue()} + /> + + {tabSelected === 0 && + + } + {tabSelected === 1 && ( +
+ +
)} + {tabSelected === 2 && ( +
+ +
)} +
+ + +
+
+
+ : + ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/coremail/initializedData.js b/pc4backstage/integration/components/coremail/initializedData.js new file mode 100644 index 0000000..fe94b78 --- /dev/null +++ b/pc4backstage/integration/components/coremail/initializedData.js @@ -0,0 +1,108 @@ +import React from "react"; +import {inject, observer} from 'mobx-react'; +import {WeaDialog,WeaSearchGroup,WeaProgress,WeaLocaleProvider,WeaNewScroll,WeaRightMenu} from "ecCom"; +import {Button} from 'antd'; +import "./style/default.css" + +import SycnProcess from './sycnProcess' + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("coremailStore") +@inject('intelogin') +@observer +class InitializedData extends React.Component{ + constructor(props) { + super(props); + this.getButtons = this.getButtons.bind(this); + this.getRightMenus = this.getRightMenus.bind(this); + } + + + componentWillUnmount() { + const {coremailStore:cs}= this.props; + cs.clearTimer(); + } + + getButtons(){ + let buttons = []; + return buttons; + } + + getRightMenus(){ + let menus = []; + return menus; + } + + render() { + const footer = []; + const {coremailStore: cs} = this.props; + const {oncancelInit} = cs; + const {showInit} = this.props; + const moreBtn = { + datas: [ + { + key: "1", + disabled: false, + icon: , + content: getLabel('309','关闭') , + onClick: key => oncancelInit() + }, + + ] + }; + let {initialList} = this.props; + if (!initialList) { + initialList = []; + } + return oncancelInit()} + moreBtn={moreBtn} + buttons={this.getButtons()} + > + + { + this.setState({ + scrollTop: e.target.scrollTop, + }) + }} + > + {initialList.length>0? + initialList.map((item, idx) => + +
+ + + +
+
+ ):
+ {getLabel('506794','暂无同步数据!') } +
+ } +
+
+
+ } +} + +export default InitializedData; \ No newline at end of file diff --git a/pc4backstage/integration/components/coremail/style/default.css b/pc4backstage/integration/components/coremail/style/default.css new file mode 100644 index 0000000..ea3c92d --- /dev/null +++ b/pc4backstage/integration/components/coremail/style/default.css @@ -0,0 +1,10 @@ +.int-initial-process{ + margin:5px 0; + +} + + +.int-initial-sycn-item{ + width:80%; + margin:10px auto; +} \ No newline at end of file diff --git a/pc4backstage/integration/components/coremail/sycnProcess.js b/pc4backstage/integration/components/coremail/sycnProcess.js new file mode 100644 index 0000000..a353454 --- /dev/null +++ b/pc4backstage/integration/components/coremail/sycnProcess.js @@ -0,0 +1,49 @@ +import React from "react" +import {WeaLocaleProvider, WeaProgress} from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SycnProcess extends React.Component{ + + constructor(props) { + super(props); + } + + render() { + + const {type, syncData} = this.props; + if(!syncData){ + return ; + } + let tempSyncData = Number(syncData); + let typeName = type === 1 ? getLabel('506795','分部同步') : type === 2 ? getLabel('506796','部门同步') : getLabel('386890','人员同步'); + let stateName =""; + if(tempSyncData){ + if(tempSyncData==100){ + stateName = getLabel('506797', '同步结束'); + }else if(tempSyncData==0){ + stateName = getLabel('506798', '未同步'); + }else if(tempSyncData==-1){ + stateName = getLabel('508158','coremail未启用'); + }else if(tempSyncData==-2){ + stateName = getLabel('508159','coremail同步组织架构开关没开启'); + }else if(tempSyncData==-3){ + stateName = getLabel('508160','同步中出现异常'); + }else if(tempSyncData>0&&tempSyncData<100){ + stateName = getLabel('391133', '同步中'); + }else{ + stateName = getLabel('32104','异常'); + } + } + + return
+
{typeName}:{stateName}
+ { syncData === -1|| tempSyncData< 0 ?
: + } +
+ } + +} + +export default SycnProcess; \ No newline at end of file diff --git a/pc4backstage/integration/components/dataSource/createAndEdit.js b/pc4backstage/integration/components/dataSource/createAndEdit.js new file mode 100644 index 0000000..6e8f7a4 --- /dev/null +++ b/pc4backstage/integration/components/dataSource/createAndEdit.js @@ -0,0 +1,408 @@ +/** + * @description 21.04.25 重构数据源功能 + * @author fyj + */ + +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { Spin, Button } from "antd"; +import { WeaSwitch } from "comsMobx"; +import { WeaLocaleProvider, WeaSearchGroup, WeaRightMenu, WeaCheckbox, WeaDialog, WeaFormItem, WeaTools, WeaUpload } from "ecCom"; +import { GeneralTitleColor, checkFormValidator, checkFieldValueUnique } from "../../util/IntegrationUtil.js"; +import { checkTableFieldValueUnique } from "../../apis/CommonService"; + +const getLabel = WeaLocaleProvider.getLabel; +const { getKey } = WeaTools; + +@inject("dataSource") +@observer +export default class CreateOrEditTask extends React.Component { + + constructor(props) { + super(props); + this.state = { + src: '/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4', + num: 0, + collectParams: { + favname: getLabel("28051", "新建模板"), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/blogengine/templateSetCreate", + importantlevel: 1 + } + } + } + + /** + * 获取弹窗的标题 + * @returns title + */ + getDialogTitle = () => { + const { + tab, + dataSourceType={}, + dataSourceCreateAndEdit={} + } = this.props.dataSource; + + if(0 === Number(tab.selectedKey)) { + return (dataSourceCreateAndEdit.isEdit ? getLabel(26473, "编辑") : getLabel(365, "新建")) + getLabel(385388, "数据源"); + } else if(1 === Number(tab.selectedKey)) { + return (dataSourceType.isEdit ? getLabel(26473, "编辑") : getLabel(365, "新建")) + getLabel(15025, "数据库类型"); + } + }; + + /** + * 获取弹窗内的按钮 + * @returns buttons + */ + getDialogBtns = () => { + const { tab, rightmenus } = this.props.dataSource; + const whichRightMenu = [rightmenus.dataSource, rightmenus.dataSourceType][Number(tab.selectedKey)] || []; + + return whichRightMenu.map(m => ( + + )); + }; + + /** + * 获取右键的操作菜单 + * @returns buttons + */ + getDialogBtnsRightMenu = () => { + const { tab, rightmenus } = this.props.dataSource; + const whichRightMenu = [rightmenus.dataSource, rightmenus.dataSourceType][Number(tab.selectedKey)] || []; + + return whichRightMenu.map(item => ( + { + key: item.type, + icon: , + content: item.menuName, + onClick: () => this.onRightMenuClick(item.type) + } + )); + } + + onRightMenuClick = (type) => { + switch (type) { + case "BTN_Save": + this.saveBaseInfo(); + break; + case "BTN_Test": + this.saveBaseInfo(this.testSaveCallBack); + break; + } + } + + /** + * 表单保存之前的必填项处理 + */ + hideFormRequiredFieldKey = () => { + const { dataSourceCreateAndEdit } = this.props.dataSource; + const { form } = dataSourceCreateAndEdit; + const params = form.getFormParams(); + + if (params.iscluster == '1') { + window.e9HideFormFieldKeys = ["host", "port", "dbname", "sortid"]; + } else if(["gs", "dm"].includes(params.type)) { + window.e9HideFormFieldKeys = ["url", "dbname", "sortid"]; + } else { + window.e9HideFormFieldKeys = ["url", "sortid"]; + } + } + + /** + * 处理保存时传递给后端的数据 + * @returns params + */ + handleFormParams = () => { + const { dataSourceCreateAndEdit, source } = this.props.dataSource; + const { form } = dataSourceCreateAndEdit; + const params = form.getFormParams(); + + if(source) { + // 新建保存时添加 typename 分类 + params.typename = source; + } + params.id = dataSourceCreateAndEdit.editId || ''; + params.iscluster = (params.iscluster === "0" ? "1" : "2"); + params.sortid = (typeof(params.sortid) === "object" + ? params.sortid.join && params.sortid.join(",") + ? params.sortid + : "0" + : params.sortid); + + return params; + } + + /** + * 保存 + * @param {function} testSaveCallBack 测试函数 + * @returns + */ + saveBaseInfo = (testSaveCallBack=null) => { + const { tab, dataSourceType, datasourceAPI, dataSourceCreateAndEdit } = this.props.dataSource; + const { form } = dataSourceCreateAndEdit; + // 获取 form 表单提交时传递给接口的数据 + const params = this.handleFormParams(); + + if (Number(tab.selectedKey) === 0) { + if(/^(ecology)$/gi.test(params.pointid)) { + form.showError('pointid', getLabel('519109','ecology不允许作为数据源名称')); + return; + } + + // 隐藏必填项的校验 + this.hideFormRequiredFieldKey(); + + checkFormValidator(form) + .then(() => { + let checkParams = { + tableName: 'datasourcesetting', + fieldName: 'pointid', + fieldValue: form.getFormParams().pointid.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: dataSourceCreateAndEdit.editId + }; + return checkFieldValueUnique(checkParams, 1); + }) + .then(title => { + if(title) { + form.showError('pointid', title); + } else { + if(dataSourceCreateAndEdit.isEdit || dataSourceType.isEdit) { + if(testSaveCallBack && typeof(testSaveCallBack) === "function") { + params.operate = 'test'; + } + datasourceAPI().update(params, (result) => { + if(result.status != "false") { + typeof(this.props.saveCallBack) === "function" && this.props.saveCallBack(result); + } + }, typeof(testSaveCallBack) != "function"); + } else { + datasourceAPI().insert(params, (result) => { + if(result.status != "false") { + typeof(this.props.saveCallBack) === "function" && this.props.saveCallBack(result); + typeof(testSaveCallBack) === "function" && testSaveCallBack(result.datasourcesettingid); + } + }, typeof(testSaveCallBack) != "function"); + } + } + }) + .catch(reason => { + console.error(reason.message); + }); + } + } + + testSaveCallBack = (datasourcesettingid) => { + const { + dataSourceCreateAndEdit, + datasourceAPI, + getForm + } = this.props.dataSource; + + datasourceAPI().test({datasourcesettingid}, () => { + getForm({ id: datasourcesettingid }); + dataSourceCreateAndEdit.isEdit = true; + dataSourceCreateAndEdit.editId = datasourcesettingid; + }); + } + + getSearchs = (form, datas, hide) => { + const { isFormInit } = form; + const { isclusterAttr, dataSourceCreateAndEdit } = this.props.dataSource; + const group = []; + const formParams = form.getFormParams(); + + isFormInit && datas && datas.forEach((c, index) => { + const items = []; + c && c.items && c.items.forEach(fields => { + const key = fields.domkey[0]; + + if('driverfilename' !== key) { + items.push({ + com: ( + + {"iscluster" === key ? + jdbc:sqlserver://${getLabel('83578', '地址')}:${getLabel('84629', '端口')};DatabaseName=${getLabel('504419','数据库名')}
Oracle:
jdbc:oracle:thin:@${getLabel('83578', '地址')}:${getLabel('84629','端口')}:${getLabel('504419','数据库名')}
MySQL:
jdbc:mysql://${getLabel('83578', '地址')}:${getLabel('84629','端口')}/${getLabel('504419','数据库名')}?useUnicode=true&characterEncoding=utf8
DB2:
jdbc:db2://${getLabel('83578', '地址')}:${getLabel('84629','端口')}/${getLabel('504419','数据库名')}
Sybase:
jdbc:sybase:Tds:${getLabel('83578', '地址')}:${getLabel('84629','端口')}/${getLabel('504419','数据库名')}?charset=cp936
Informix:
jdbc:informix-sqli://${getLabel('83578', '地址')}:${getLabel('84629','端口')}/${getLabel('504419','数据库名')}:INFORMIXSERVER=myserver
Hana:
jdbc:sap://${getLabel('83578', '地址')}:${getLabel('84629','端口')}?reconnect=true`}} />} onChange={v => form.updateFields({iscluster: v})} + onChange={v => form.updateFields({iscluster: v})} + /> + : { + if(getKey(fields) === 'pointid') { + if(v.pointid && v.pointid.value) { + if(/^(ecology)$/gi.test(v.pointid.value)) { + form.showError('pointid', getLabel('519109','ecology不允许作为数据源名称') ); + }else { + let checkParams = { + tableName: 'datasourcesetting', + fieldName: 'pointid', + fieldValue: form.getFormParams().pointid.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: dataSourceCreateAndEdit.editId + }; + checkFieldValueUnique(checkParams, 1) + .then(title => { + if(title) { + form.showError('pointid', title); + } + }); + } + } + }else if(getKey(fields) === 'dbtype') { + let checkParams = { + tableName: 'datasource_type', + fieldName: 'dbtype', + fieldValue: form.getFormParams().dbtype.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: '' + }; + checkTableFieldValueUnique(checkParams).then(result => { + if(result&&result.isNotUnique) { + form.showError('dbtype',getLabel('129943','名称已存在')); + } + }); + } + }} + /> + } +
), + colSpan: 1, + hide: form.isHide(fields, (keys, allParams) => { + if (hide) { + return hide(getKey(fields), keys, allParams) + } + }) + }) + }else if(getKey(fields) === 'driverfilename') { + if(fields.datas[0]) { + let params = fields.datas[0]; + Object.assign(params, {imgSrc : ''}) + } + items.push({ + com:( + { + if(arr[0].length === 0) { + document.querySelector('.wea-upload-container').style.display='block'; + form.updateFields({ + driverfilename:'' + }) + }else { + document.querySelector('.wea-upload-container').style.display='none'; + form.updateFields({ + driverfilename: `${arr[0][0].fileid}` + }) + } + }} + /> + ) + }) + } + }); + + group.push( + + ) + }); + return group; + } + + closeDialog = () => { + const { dataSourceCreateAndEdit, dataSourceType } = this.props.dataSource; + + dataSourceCreateAndEdit.show = false; + dataSourceType.show = false; + this.setState({num: 0}); + } + + render() { + const { loading, dataSourceCreateAndEdit, tab, dataSourceType} = this.props.dataSource; + const {collectParams} = this.state; + + return ( + + + + { + Number(tab.selectedKey) === 0 + ? this.getSearchs( + dataSourceCreateAndEdit.form, + toJS(dataSourceCreateAndEdit.conditions), + (key, b, c) => { + switch (key) { + case "host": + case "port": + return c.iscluster == 1; + case "url": + return c.iscluster == 0 || c.iscluster == 2; + case "dbname": + return c.iscluster == 1 || ["gs", "dm"].includes(c.type); + } + return false; + } + ) + : this.getSearchs(dataSourceType.form, toJS(dataSourceType.conditions)) + } + + + + ); + } +} diff --git a/pc4backstage/integration/components/dataSource/index.js b/pc4backstage/integration/components/dataSource/index.js new file mode 100644 index 0000000..38262a2 --- /dev/null +++ b/pc4backstage/integration/components/dataSource/index.js @@ -0,0 +1,553 @@ +/** + * @description 21.04.25 重构数据源功能 + * @author fyj + */ + +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaTableNew, WeaLogView } from "comsMobx"; +import { getSearchBtns, getAdvancedItem, GeneralTitleColor, findOriginFromRoute, showDeleteDataConfirmDialog } from "../../util/IntegrationUtil.js"; +import { + WeaLocaleProvider, + WeaRightMenu, + WeaTop, + WeaTab, + WeaLeftRightLayout, +} from "ecCom"; +import { Button } from "antd"; +import NoRight from "../../public/NoRight"; +import CreateAndEdit from "./createAndEdit.js"; +import OrganizationTree from '../../public/OrganizationTree'; + +const { WeaTable } = WeaTableNew; +const getLabel = WeaLocaleProvider.getLabel; +const WeaLogViewComp = WeaLogView.Component; + +@inject("dataSource") +@observer +export default class DataSource extends React.Component { + + state = { + /** tabData, weatab 的 datas 属性值 */ + tabData: [ + { + title: getLabel("32264", "数据源设置"), + viewcondition: 0 + }, + { + title: getLabel("129690", "数据库类型设置"), + viewcondition: 1 + } + ] + } + + componentWillMount() { + const {dataSource} = this.props; + dataSource.source = findOriginFromRoute(); + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + if(nextProps.location.key != this.props.location.key) { + this.init(); + } + } + + /** + * 页面挂载后初始化数据,所有初始化的操作都在该方法中进行 + */ + init = () => { + const { init } = this.props.dataSource; + init(); + } + + // 分权刷新 + refreshData = (id, type) => { + const { + dataSource + } = this.props, { + datasourceAPI, + tab, + } = dataSource; + + // 如果点击的是分部 + dataSource.subcompanyid = ('1' === type ? id : ''); + if(tab.selectedKey == 0) { + datasourceAPI().getListConditions(() => { + dataSource.getList(); + datasourceAPI().getListRightMenus(); + }); + } + } + + getTabButtonsAd = () => { + const { dataSource } = this.props; + const { searchAdvance } = dataSource; + return getSearchBtns( + this.handleSearchFun, + () => searchAdvance.form.reset(), + () => searchAdvance.show = false, + this && this.props && this.props.ecId || '', + "integrationDatasource" + ); + }; + + getSearchAD = () => { + const { dataSource } = this.props; + const { form, conditions=[] } = dataSource.searchAdvance; + return getAdvancedItem( + form, + toJS(conditions), + this.handleSearchFun, + false, + this && this.props && this.props.ecId || '', + "integrationDatasource" + ); + }; + + /** + * 获取删除按钮的 disabled + * @returns disabled 获取按钮的 disabled 状态 + */ + getBtnDisabledStatus = () => { + const { + dataSourceTable, + dataSourceType, + tab, + } = this.props.dataSource; + + if (Number(tab.selectedKey) === 0) { + return toJS(dataSourceTable.selectedRowKeys).length === 0; + } else { + return toJS(dataSourceType.table.selectedRowKeys).length === 0; + } + } + + getWeaTopBtns = () => { + const { tab, dropMenuDatas } = this.props.dataSource; + + const disable = this.getBtnDisabledStatus(); + if (Number(tab.selectedKey) === 0) { + return toJS(dropMenuDatas) && toJS(dropMenuDatas).map((item, i) => { + if (i < 2) { + if (item.type === "BTN_BatchDelete") { + return ( + + ) + } else { + return ( + + ) + } + } + }) + } + return []; + } + + getDropMenuDatas = () => { + const { dropMenuDatas, tab, source } = this.props.dataSource; + const btnArr = []; + + toJS(dropMenuDatas) && toJS(dropMenuDatas).forEach((item, i) => { + let disable = false; + if (item.type === "BTN_BatchDelete") { + disable = this.getBtnDisabledStatus(); + } + if (Number(tab.selectedKey) === 1 && i<2) { + }else{ + if(!(Number(tab.selectedKey) === 0 && source && item.type === "BTN_log")) { + btnArr.push({ + key: item.type, + icon: , + content: item.menuName, + disabled: disable, + onClick: () => this.onRightMenuClick(item.type) + }) + } + } + }) + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + return btnArr; + } + + onRightMenuClick = (type, record) => { + switch (type) { + case "BTN_Insert": + this.createTask(); + break; + case "BTN_EDIT": + this.doEditById(record); + break; + case "BTN_BatchDelete": + this.deleteData('batch'); + break; + case "BTN_DEL": + this.deleteData('single', record); + break; + case "BTN_TEST": + this.test(record); + break; + case "BTN_log": + this.handleClickBtnLog(record); + break; + case "BTN_COLUMN": + this.handleClickBtnColumn(); + break; + case "BTN_DOWNLOAD": + this.downloadDriver(record); + break; + } + } + + /** + * 下载驱动 + * @param {object} record 操作的当前数据 + */ + downloadDriver = (record) => { + const driverfilename = record.driverfilename || ''; + + if(isNaN(driverfilename)){ + window.location.href = (window.ecologyContentPath || "") + '/resource/DriverFile/'+driverfilename; + }else{ + window.location.href = (window.ecologyContentPath || "") + "/weaver/weaver.file.FileDownload?fileid="+driverfilename+"&download=1"; + } + } + + /** + * 【编辑】按钮对应的事件 + * @param {object} record + */ + doEditById = (record) => { + const { dataSourceCreateAndEdit, dataSourceType, getForm, tab } = this.props.dataSource; + + getForm({ id: record.id }); + if (Number(tab.selectedKey) === 0) { + dataSourceCreateAndEdit.show = true; + dataSourceCreateAndEdit.isEdit = true; + dataSourceCreateAndEdit.editId = record.id; + } else { + dataSourceType.show = true; + dataSourceType.isEdit = true; + dataSourceType.editId = record.id; + } + }; + + /** + * 【测试】 按钮的对应事件 + */ + test = (record) => { + const { datasourceAPI } = this.props.dataSource; + + datasourceAPI().listTest({ id: record.id }); + } + + /** + * 【新建】按钮对应的事件 + */ + createTask = () => { + const { dataSourceCreateAndEdit, dataSourceType, tab, getFormDataSource, getFormDataSourceType, datasourceAPI } = this.props.dataSource; + + if (Number(tab.selectedKey) === 0) { + getFormDataSource({isEdit: "0"}); + datasourceAPI().getFormRightMenus({isEdit: "0"}); + dataSourceCreateAndEdit.isEdit = false; + dataSourceCreateAndEdit.show = true; + } else { + getFormDataSourceType(); + dataSourceType.isEdit = false; + dataSourceType.show = true; + } + }; + + /** + * 【批量删除】 按钮的对应事件 + */ + deleteData = (type, record) => { + const { + dataSourceTable, + datasourceAPI, + datasourcetypeAPI, + dataSourceType, + tab + } = this.props.dataSource; + + showDeleteDataConfirmDialog(type) + .then(() => { + if (Number(tab.selectedKey) === 0) { + if('single' === type) { + datasourceAPI().delete({ pointids: record.pointid, id: record.id }); + } else { + datasourceAPI().batchDelete({ + ids: toJS(dataSourceTable.selectedRowKeysAllPages) + }); + } + } else { + if('single' === type) { + datasourcetypeAPI().delete({ id: record.id }); + } else { + datasourcetypeAPI().batchDelete({ + ids: toJS(dataSourceType.table.selectedRowKeysAllPages) + }); + } + } + }); + }; + + /** + * 【日志】按钮的对应事件 + */ + handleClickBtnLog = (record = {id: ''}) => { + const { + toggleView, + setOperateIndex + } = this.props.dataSource; + + setOperateIndex(record.id); + toggleView(); + } + + /** + * 【显示列定制】按钮的对应事件 + */ + handleClickBtnColumn = () => { + const { + dataSourceType={}, + tab, + dataSourceTable, + } = this.props.dataSource; + + if (Number(tab.selectedKey) === 0) { + dataSourceTable.setColSetVisible(true); + dataSourceTable.tableColSet(true); + } else { + dataSourceType.table.setColSetVisible(true); + dataSourceType.table.tableColSet(true); + } + } + + /** + * 切换 tab 时调用的事件 + * @param {string} v 当前选中的 tab key + */ + handleChangeTab = v => { + const { dataSource } = this.props; + const { tab, datasourceAPI } = dataSource; + + dataSource.subcompanyid = ""; + tab.selectedKey = Number(v); + if(v == 0) { + datasourceAPI().getListConditions(() => { + dataSource.getList(); + datasourceAPI().getListRightMenus(); + }); + } else { + dataSource.getList(); + } + } + + /** + * 快速搜索框输入值联动到 form 表单中 + * @param {string} v 快速搜索框输入的值 + */ + onSearchChange = v => { + const { searchAdvance } = this.props.dataSource; + searchAdvance.form.updateFields({pointid: v}); + } + + /** + * 搜索事件 + */ + handleSearchFun = () => { + const { dataSource } = this.props; + + dataSource.searchAdvance.show = false; + dataSource.subcompanyid = dataSource.searchAdvance.form.getFormParams().subcomId; + dataSource.getList(true); + dataSource.datasourceAPI().getListRightMenus(); + } + + /** + * 设置高级搜索面板是否显示 + * @param {boolean} e + * @returns + */ + setShowSearchAd = e => this.props.dataSource.searchAdvance.show = e; + + /** + * 隐藏高级搜索的面板 + * @returns + */ + hideSearchAd = () => this.props.dataSource.searchAdvance.show = false; + + /** + * 每行数据的操作菜单 + * @param {object} record + * @param {number} recordIndex + * @param {object} operate + * @param {number} opertaeIndex + */ + onOperatesClick = (record, recordIndex, operate, opertaeIndex) => { + const { tab } = this.props.dataSource; + const arr = Number(tab.selectedKey) === 0 ? ['BTN_EDIT', 'BTN_DEL', 'BTN_TEST', 'BTN_log'] : ['BTN_EDIT', 'BTN_EDIT', 'BTN_DEL', 'BTN_DOWNLOAD', 'BTN_log']; + + this.onRightMenuClick(arr[Number(opertaeIndex)], record); + }; + + /** + * 重新渲染列 + * @param {array} columns 列信息 + * @returns + */ + redoColumnsByName = columns => { + const { tab, getTableList } = this.props.dataSource; + + return columns.map(column => { + column.render = (text, record, index) => { + //前端元素转义 + const valueSpan = + record[column.dataIndex] !== undefined + ? record[column.dataIndex] + : record[column.dataIndex + "span"]; + + switch (column.dataIndex.toString()) { + case "pointid": + case "dbtype": + return ( +
this.doEditById(record)} + dangerouslySetInnerHTML={{ __html: valueSpan }} + /> + ); + case "type": + return ( + { + tab.selectedKey = 1; + getTableList(true); + doEditById({id : record.dbtypeid}); + }} + > + {record.typespan} + + ); + case 'subcompanyid': + return ( + + {record.subcompanyidspan} + + ); + default: + return (
); + } + }; + return column; + }); + }; + + /** + * 渲染列表页面 + * @returns 渲染列表页面 + */ + getWhichTable = () => { + const { tab, dataSourceTable, dataSourceType } = this.props.dataSource; + + return ( + + ); + }; + + render() { + const { dataSource } = this.props; + const { + searchAdvance, + tab, + loading, + logStore, + logView, + toggleView, + rightLoading, + operateIndex, + hasOrganization, + subcompanyid, + hasManageDetachableRight, + } = dataSource; + const formParams = searchAdvance.form.getFormParams(); + + return (rightLoading + ? null + : + } + iconBgcolor={GeneralTitleColor.iconBgcolor} + showDropIcon={true} + dropMenuDatas={(!hasManageDetachableRight && tab.selectedKey == 0) ? [] : this.getDropMenuDatas()} + /> + } + > + + { + (!hasManageDetachableRight && tab.selectedKey == 0) + ? + : this.getWhichTable() + } + + + + + ); + } +} diff --git a/pc4backstage/integration/components/datashow/CacheDataManage.js b/pc4backstage/integration/components/datashow/CacheDataManage.js new file mode 100644 index 0000000..32bd3e1 --- /dev/null +++ b/pc4backstage/integration/components/datashow/CacheDataManage.js @@ -0,0 +1,353 @@ +import React, { + Component +} from 'react'; +import { + inject, + observer, +} from "mobx-react"; +import { + WeaTab, + WeaLocaleProvider, + WeaButtonIcon, +} from "ecCom"; +import { + WeaTableNew, +} from "comsMobx"; +import { + getAdvancedItem, + getSearchBtns, + getForm, + onCheck, + checkUnique, + doConfirm, +} from "../../util/IntegrationUtil"; +import DataShowDialog from "./DataShowDialog"; + +const {getLabel} = WeaLocaleProvider; +const {WeaTable} = WeaTableNew; + +@inject("dataShowStore") +@observer +export default class CacheDataManage extends Component { + constructor(props) { + super(props); + this.state = { + searchType: ["base", "advanced"], + showSearchAd: false, + }; + } + + componentWillReceiveProps(nextProps) { + this.setState({ + showSearchAd: false, + }) + } + + componentWillMount() { + this.setState({ + showSearchAd: false, + }) + } + + // 详情页面 + handleChange = (form, allParams, fields) => { + const key = fields.domkey[0]; + + if("keyid" === key) { + this.checkFlagUnique(); + } + } + + checkFlagUnique = (callBack) => { + const { + dataShowStore, + } = this.props, { + newForm, + status, + } = dataShowStore, { + cacheDataDetailOperateInfo={}, + cacheDataDialogTitle, + } = status, { + id, + } = cacheDataDetailOperateInfo; + + let func = () => { + if(callBack && typeof(callBack) === "function") { + callBack(); + } + }; + + let fieldValue = newForm.getFormParams().keyid.replace(/^(\s*)|(\s*)$/g, ''); + if(fieldValue) { + checkUnique({ + tableName: cacheDataDialogTitle, + fieldName: 'keyid', + fieldValue, + idName: 'id', + idValue: id + }, newForm, "keyid", "8", "", func); + } + } + + onDetailMenuClick = (type) => { + const { + dataShowStore, + } = this.props, { + newForm, + status, + } = dataShowStore, { + cacheDataDetailOperateInfo, + } = status; + + if("BTN_SAVE" === type) { + onCheck(newForm, () => this.checkFlagUnique(() => { + dataShowStore.getDataShowCacheOperation({ + ...newForm.getFormParams(), + operate: cacheDataDetailOperateInfo ? "updateCache" : "addCache", + id: cacheDataDetailOperateInfo ? cacheDataDetailOperateInfo.id : "", + }); + })); + } + } + + // Table的一些操作 + onOperatesClick = (record, index, operate, flag) => { + this.onMenuClick(operate.index, record); + }; + + getColumnsInfo = (datas=[]) => { + return datas && datas.map(item => { + if("keyid" === item.dataIndex) { + item.render = (text, record) => this.onMenuClick("0", record)}>{text}; + } + + return item; + }) + } + + getTabButtonsAd = () => { + return getSearchBtns( + this.handleSearchFun, + () => this.props.dataShowStore.cacheDataSearchForm.reset(), + () => this.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "integrationDatashowCacheDataManage" + ); + } + + // 高级搜索的搜索方法 + handleSearchFun = () => { + const { + dataShowStore, + } = this.props; + + dataShowStore.getCacheDataManageInfo(); + this.setState({ showSearchAd: false }); + } + + getAdvancedSearch = () => { + const { + dataShowStore, + } = this.props, { + cacheDataSearchForm, + status, + } = dataShowStore, { + cacheDataSearchCondition, + } = status; + return getAdvancedItem(cacheDataSearchForm, cacheDataSearchCondition, this.handleSearchFun, false, this && this.props && this.props.ecId || '', "integrationDatashowCacheDataManage"); + }; + + onSearchChange = (value) => { + const { + dataShowStore, + } = this.props, { + cacheDataSearchForm, + } = dataShowStore; + + cacheDataSearchForm.updateFields({key: value}); + } + + getSearchBaseValue = () => { + const { + dataShowStore, + } = this.props, { + cacheDataSearchForm, + } = dataShowStore, { + key, + } = cacheDataSearchForm.getFormParams(); + + return key; + } + + setShowSearchAd = bool => this.setState({showSearchAd: bool}); + + hideSearchAd = () => this.setState({showSearchAd: false}); + + onMenuClick = (type, record) => { + const { + dataShowStore, + } = this.props, { + cacheDataTableStore, + status, + } = dataShowStore, { + selectedRowKeys, + } = cacheDataTableStore, { + cacheDataOperateInfo={}, + } = status; + + let id = record ? record.id : selectedRowKeys; + + if("BTN_NEW" === type) { + dataShowStore.setState({ + cacheDataManageDetailVisible: true, + cacheDataDetailOperateInfo: "", + }); + + dataShowStore.getDataShowCacheDataForm({browsertype: cacheDataOperateInfo ? cacheDataOperateInfo.showname : ""}); + } else if("BTN_DEL" === type || "1" === type) { + let title = getLabel(385625, '确定要删除选择的记录吗?'); + + if("1" === type) { + title = getLabel(15097, '确定要删除吗?'); + } + doConfirm(title, dataShowStore.getDataShowCacheOperation, {operate: "delCache", id, browsertype: cacheDataOperateInfo ? cacheDataOperateInfo.showname : ""}); + } else if("BTN_COLUMN" === type) { + cacheDataTableStore.setColSetVisible(true); + cacheDataTableStore.tableColSet(true); + } else if("0" === type) { + dataShowStore.setState({ + cacheDataManageDetailVisible: true, + cacheDataDetailOperateInfo: record, + }); + + dataShowStore.getDataShowCacheDataForm({ + browsertype: cacheDataOperateInfo ? cacheDataOperateInfo.showname : "", + id, + browsertype: cacheDataOperateInfo ? cacheDataOperateInfo.showname : "", + }); + } + } + + getRightMenus = (datas=[]) => { + const { + dataShowStore, + } = this.props, { + selectedRowKeys, + } = dataShowStore.cacheDataTableStore; + + let rightMenus = datas && datas.map(item => { + if(item.type === "BTN_DEL") { + item.disabled = selectedRowKeys.length === 0; + } + + return { + ...item, + key: item.type, + icon: , + content: item.menuName, + onClick: () => this.onMenuClick(item.type), + }; + }); + + rightMenus.push({ + key: "BTN_COLUMN", + icon: , + content: getLabel(32535, "显示列定制"), + onClick: () => this.onMenuClick("BTN_COLUMN"), + }) + + return rightMenus || []; + } + + getButtons = (datas=[]) => { + const { + dataShowStore, + } = this.props, { + selectedRowKeys, + } = dataShowStore.cacheDataTableStore; + + return datas && datas.map(item => this.onMenuClick(item.type)} + />); + } + + onCancel = () => { + const { + dataShowStore, + } = this.props; + + dataShowStore.setState({ + cacheDataManageVisible: false, + cacheDataOperateInfo: "", + }); + } + + render() { + const { + dataShowStore, + } = this.props, { + status, + cacheDataTableStore, + newForm, + cleanCacheDetailDialogStore, + } = dataShowStore, { + cacheDataManageVisible, + menus=[], + cacheDataDialogTitle, + cacheDataSearchAdvancedHeight, + cacheDataManageDetailVisible, + cacheDetailMenus=[], + cacheDataDetailOperateInfo, + dataShowFormFields, + tabButtonDisabled, + } = status, { + searchType, + showSearchAd, + } = this.state; + + return ( + + + + + {getForm(newForm, dataShowFormFields, true, this.handleChange)} + + + ) + } +} diff --git a/pc4backstage/integration/components/datashow/DataShowDialog.js b/pc4backstage/integration/components/datashow/DataShowDialog.js new file mode 100644 index 0000000..76b189b --- /dev/null +++ b/pc4backstage/integration/components/datashow/DataShowDialog.js @@ -0,0 +1,74 @@ +import React, { + Component + } from 'react'; + import { + WeaDialog, + WeaRightMenu, + } from "ecCom"; + import { + Button, + } from "antd"; + + export default class DataShowDialog extends Component { + + getButton = () => { + const {menus=[], disabled} = this.props; + return menus && menus.map(item => ); + } + + getMenus = () => { + const {menus=[], disabled} = this.props; + return menus && menus.map(item => { + return { + key: item.key || item.type, + icon: , + content: item.content || item.menuName, + disabled, + onClick: () => this.onMenuClick(item.key || item.type), + } + }); + } + + onMenuClick = (type) => { + if(this.props.onMenuClick && typeof(this.props.onMenuClick) === "function") { + this.props.onMenuClick(type); + } + } + + onCancel = () => { + if(this.props.onCancel && typeof(this.props.onCancel) === "function") { + this.props.onCancel(); + } + } + + render() { + return ( + + + {this.props.children} + + + ) + } + } + \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/IndexTestDialog.js b/pc4backstage/integration/components/datashow/IndexTestDialog.js new file mode 100644 index 0000000..674fc8d --- /dev/null +++ b/pc4backstage/integration/components/datashow/IndexTestDialog.js @@ -0,0 +1,244 @@ +import React from "react"; +import {inject, observer} from "mobx-react"; +import {Button, Row} from "antd"; +import {toJS} from "mobx"; +import { + WeaSearchGroup, + WeaRightMenu, + WeaDialog, + WeaLocaleProvider, + WeaHelpfulTip, + WeaTable as WeaTableTest, + WeaTab, + WeaNewScroll, +} from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("dataShowStore") +@observer +export default class IndexTestDialog extends React.Component { + + getTest = () => { + const {dataShowStore} = this.props; + const {status} = dataShowStore; + const {testInitDatas} = toJS(status); + let testTitle = { + "base": getLabel(82751, "基础设置"), + "field": getLabel(21903, "字段设置"), + }; + let group = []; + for (let key in testInitDatas) { + let items = []; + items.push({ + com: ( + ), + colSpan: 1 + }); + group.push(); + } + return group; + }; + + getColumns = () => { + let columns = [ + { + "title":getLabel(511410, "测试项"), + "dataIndex": "name", + "key": "name", + "width": "30%", + "sorter": true + }, + { + "title": getLabel(509969, "测试内容"), + "dataIndex": "content", + "key": "content", + "width": "40%", + "sorter": true + }, + { + "title": getLabel(503912, "测试结果"), + "dataIndex": "status", + "key": "status", + "width": "30%", + "sorter": true + } + ]; + let datas = []; + columns && columns.forEach(column => { + if(column['key'] === 'status') { + datas.push({ + dataIndex: column['dataIndex'], + key: column['key'], + sorter: column['sorter'], + title: column['title'], + width: column['width'], + render: (text, record) => { + if(text == '1') { + return + }else if(text == '0') { + return ×{record.details !== undefined ? : ''} + }else if(text == '2') { + return !{record.details !== undefined ? : ''} + } + } + }) + } else { + datas.push({ + dataIndex: column['dataIndex'], + key: column['key'], + sorter: column['sorter'], + title: column['title'], + width: column['width'], + }); + } + }); + return datas; + }; + + getTable = () => { + let topinfo = { + "tab": { + "datas": [ + { + "title": getLabel(82743, "基础信息"), + "key": "base" + }, + ], + "keyParam": "key", + "selectedKey": "base", + "advanceHeight": "123" + } + }; + + if (topinfo && topinfo.tab) { + return (); + } + }; + + getButtons = () => { + const {dataShowStore} = this.props; + const {dataShowFormHiddenFields} = toJS(dataShowStore.status); + let id = dataShowFormHiddenFields.id || ""; + let buttoninfo = [ + { + "btnName": getLabel(501169, "编辑"), + "btnType": "primary", + "type": "BTN_EDIT" + } + ]; + + let btnArr = []; + buttoninfo && buttoninfo.forEach(b => { + btnArr.push( + ); + }); + return btnArr; + }; + + getMoreBtn = () => { + const {dataShowStore} = this.props; + const {dataShowFormHiddenFields} = toJS(dataShowStore.status); + let id = dataShowFormHiddenFields.id || ""; + let moreBtninfo = [ + { + "key": "1", + "type": "BTN_EDIT", + "icon": "icon-coms-Preservation", + "btnName": getLabel(501169, "编辑"), + } + ]; + let btnArr = []; + moreBtninfo && moreBtninfo.forEach(m => { + btnArr.push({ + key: m.key, + icon: , + content: m.btnName, + onClick: () =>{ + dataShowStore.initIndexTestDialog(); + dataShowStore.initSqlTestForm(); + dataShowStore.newForm.reset(); + dataShowStore.getDataShowEditForm({ id: id}); + dataShowStore.setState({ showNewFormDialog: true }); + } + }); + }); + return btnArr; + }; + + getRightMenu = () => { + const {dataShowStore} = this.props; + const {dataShowFormHiddenFields} = toJS(dataShowStore.status); + let id = dataShowFormHiddenFields.id || ""; + let menuinfo = [ + { + "menuIcon": "icon-coms-Preservation", + "isTop": "1", + "menuName": getLabel(501169, "编辑"), + "isControl": "0", + "type": "BTN_EDIT" + } + ]; + let btnArr = []; + menuinfo && menuinfo.forEach(m => { + btnArr.push({ + key: m.type, + icon: , + content: m.menuName, + onClick: () => { + dataShowStore.initIndexTestDialog(); + dataShowStore.initSqlTestForm(); + dataShowStore.newForm.reset(); + dataShowStore.getDataShowEditForm({ id: id}); + dataShowStore.setState({ showNewFormDialog: true }); + } + }); + }); + return btnArr; + }; + + render() { + const {dataShowStore, showTestVersion} = this.props; + return ( + { + dataShowStore.initIndexTestDialog(); + dataShowStore.initSqlTestForm(); + }} + buttons={this.getButtons()} + moreBtn={{ + datas: this.getMoreBtn(), + collectParams: [] + }} + > + + + {this.getTable()} + + {this.getTest()} + + + + + ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/NewE7Form.js b/pc4backstage/integration/components/datashow/NewE7Form.js new file mode 100644 index 0000000..9c1ffd4 --- /dev/null +++ b/pc4backstage/integration/components/datashow/NewE7Form.js @@ -0,0 +1,174 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { toJS } from "mobx"; +import { WeaSwitch } from "comsMobx"; +import { + WeaSearchGroup, + WeaFormItem, + WeaRightMenu, + WeaDialog, + WeaLocaleProvider +} from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("dataShowStore") +@observer +export default class NewE7Form extends React.Component { + constructor (props) { + super(props); + this.state = {} + } + + getBtns = () => { + const { + dataShowStore + } = this.props, { + menus=[], + buttonDisabled, + } = dataShowStore.status; + return menus && menus.map(item => ); + } + + getRightMenu = () => { + const { + dataShowStore + } = this.props, { + menus=[], + buttonDisabled + } = dataShowStore.status; + + return menus && menus.map(item => { + return { + key: item.key, + icon: , + content : item.content, + disabled: buttonDisabled, + onClick : () => this.onRightMenuClick(item.key) + }; + }); + } + + onRightMenuClick = (type) => { + const {dataShowStore} = this.props; + const {newE7Form, status} = dataShowStore; + const {dataShowE7FormHiddenFields} = toJS(status); + + + if(type == 'BTN_SAVE'){ + newE7Form.validateForm().then(f=>{ + if(f.isValid){ + //合并hiddenfield参数 + let params = Object.assign(dataShowE7FormHiddenFields, newE7Form.getFormParams()); + params.method = "add"; + dataShowStore.getDataShowOperation4E7(params); + }else{ + f.showErrors(); + this.setState({date: new Date()}); + } + }); + + } + } + + getSearchs = () => { + const {dataShowStore} = this.props; + const {newE7Form, status} = dataShowStore; + const {dataShowE7FormFields} = toJS(status); + const {isFormInit} = newE7Form; + let group = []; + let i = 0; + const formParams = newE7Form.getFormParams(); + isFormInit && dataShowE7FormFields && dataShowE7FormFields.map(c =>{ + let items = []; + + c.items.map(fields => { + items.push({ + com:( + + + {}} /> + ), + colSpan:1, + hide: newE7Form.isHide(fields, (keys, allParams) => { + let bool = false; + return bool; + }) + }); + + }); + if(i==1) { + //说明 + items.push({ + com: ( +
+
1、{getLabel(23953,'浏览按钮字段类型中有自定义单选和自定义多选两种类型字段,所引用的自定义浏览按钮即在此设置,自定义浏览框标识不能重复')};
+
2、{getLabel(23954,'数据源选择——从指定数据源中查找并显示数据')};
+
3、{getLabel(23955,'自定义浏览页面只能显示一个查询条件和两列内容,即所有查询不能超过三个字段')};
+
4、{getLabel(23956,'浏览选择时初始数据按“无条件查询”内容查询数据,条件搜索时按“条件2查询”内容查询数据')};
+
5、{getLabel(23957,'.选择后流程字段保存的是“无条件查询”的第一列的值,流程中显示值是按“条件1查询”内容查询出的第一列的值,第二列的值作为链接的title')};
+
6、{getLabel(23958,'“列1显示名”和“列2显示名”指定无条件查询的第二列和第三列对应的字段说明')};
+
7、{getLabel(23959,'所有查询中的参数变量用?代替')}。
+
+ ), + hide: newE7Form.isHide(newE7Form,(keys, allParams) => { + return ( false ); + }) + }); + + } + group.push(); + i++; + }); + return group; + } + + render() { + const {dataShowStore} = this.props; + const {showNewE7FormDialog} = toJS(dataShowStore.status); + return ( + +
+ { + dataShowStore.setState({showNewE7FormDialog : false}); + dataShowStore.newForm.reset(); + }} + buttons={this.getBtns()} + moreBtn={{ + datas : this.getRightMenu(), + collectParams: [] + }} + > + + + + {this.getSearchs()} + + + + +
+ ) + } +} diff --git a/pc4backstage/integration/components/datashow/NewForm.js b/pc4backstage/integration/components/datashow/NewForm.js new file mode 100644 index 0000000..e4ddf71 --- /dev/null +++ b/pc4backstage/integration/components/datashow/NewForm.js @@ -0,0 +1,1480 @@ +import React from "react"; +import {inject, observer} from "mobx-react"; +import {Button, message, Modal} from "antd"; +import {checkTableFieldValueUnique} from "../../apis/CommonService"; +import {toJS} from "mobx"; +import {WeaSwitch} from "comsMobx"; +import { + WeaTableEdit, + WeaSearchGroup, + WeaInput, + WeaFormItem, + WeaTools, + WeaRightMenu, + WeaDialog, + WeaSelect, + WeaLocaleProvider, + WeaHelpfulTip, + WeaTableEditable, +} from "ecCom"; +import uuid from 'uuid'; +import copy from 'copy-to-clipboard'; +import { + onCheck, + checkUnique, +} from '../../util/IntegrationUtil'; +import PreviewDialog from "./PreviewDialog"; +import SqlTestDialog from "./SqlTestDialog"; +import IndexTestDialog from "./IndexTestDialog"; + +const {getKey} = WeaTools; +const {getLabel} = WeaLocaleProvider; +const {confirm} = Modal; +const {Base64} = WeaTools; + +@inject("dataShowStore") +@observer +export default class NewForm extends React.Component { + constructor(props) { + super(props); + this.state = { + dialogStyle: {width: 1200, height: 700}, + regExpValue: /^(requestid|type|fielddbtype|currenttime|workflowid|wfid|billid|isbill|f_weaver_belongto_userid|f_weaver_belongto_usertype|wfTestStr|fieldid|viewtype|fromModule|wfCreate|_random_)$/gi, + baseConfig: { + validatePass: '', + draggable: true, + showAdd: true, + showDelete: true, + showCopy: false, + showMove: false, + showCollapse: true, + tableProps: {showEmptyText: false, scroll: {x: "auto"}} + }, + esbInitCells: { + new_istitle: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_istitle"}]}, + new_issearch: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_issearch"}]}, + new_isshow: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_isshow"}]}, + new_fieldtype: {com: [{type: "SELECT", viewAttr: 1, hasBorder: true, key: "new_fieldtype", defaultValue: "2", options: [ + {disabled: false, key: "2", selected: true, showname: getLabel('22360', '文字'), visible: true}, + {disabled: false, key: "1", selected: false, showname: getLabel('607', '数字'), visible: true} + ]}]}, + new_width: {com: [{type: "INPUTNUMBER", viewAttr: 1, hasBorder: true, key: "new_width", otherParams: {min: 1}}]}, + new_transql: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_transql"}]}, + new_wokflowfieldname: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_wokflowfieldname"}]}, + }, + esbIsShowTitleOpen: { + new_istitle: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_istitle"}]}, + new_isshow: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_isshow"}]}, + new_issearch: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_issearch"}]}, + new_fieldtype: {com: [{type: "SELECT", viewAttr: 1, hasBorder: true, key: "new_fieldtype", defaultValue: "2", options: [ + {disabled: false, key: "2", selected: true, showname: getLabel('22360', '文字'), visible: true}, + {disabled: false, key: "1", selected: false, showname: getLabel('607', '数字'), visible: true} + ]}]}, + new_wokflowfieldname: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_wokflowfieldname"}]}, + // new_desensitization: {com: [{type: "CHECKBOX", viewAttr: 2, hasBorder: true, key: "new_desensitization"}]}, + }, + esbIsSearchOpen: { + new_fieldname: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_fieldname"}]}, + new_issearch: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_issearch"}]}, + new_width: {com: [{type: "INPUTNUMBER", viewAttr: 1, hasBorder: true, key: "new_width", otherParams: {min: 1}}]}, + new_transql: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_transql"}]}, + }, + esbIsTitleOpen: { + new_fieldname: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_fieldname"}]}, + new_issearch: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_issearch"}]} + }, + initCells: { + new_fieldtype: {com: [{type: "SELECT", viewAttr: 1, className: "inte-datashow-selectStyle", hasBorder: true, key: "new_fieldtype", defaultValue: "2", options: [ + {disabled: false, key: "2", selected: true, showname: getLabel('22360', '文字'), visible: true}, + {disabled: false, key: "1", selected: false, showname: getLabel('607', '数字'), visible: true} + ]}]}, + new_width: {com: [{type: "INPUTNUMBER",viewAttr: 1,hasBorder: true,key: "new_width",otherParams: {min: 1}}]}, + new_transql: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_transql"}]}, + new_wokflowfieldname: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_wokflowfieldname"}]}, + new_isshow: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_isshow"}]}, + }, + isShowTitleOpen: { + new_fieldtype: {com: [{ + type: "SELECT", viewAttr: 1, hasBorder: true, key: "new_fieldtype", defaultValue: "2", options: [ + {disabled: false, key: "2", selected: true, showname: getLabel('22360', '文字'), visible: true}, + {disabled: false, key: "1", selected: false, showname: getLabel('607', '数字'), visible: true} + ] + }]}, + new_isshow: {com: [{type: "CHECKBOX", viewAttr: 1, hasBorder: true, key: "new_isshow"}]}, + new_wokflowfieldname: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_wokflowfieldname"}]}, + // new_desensitization: {com: [{type: "CHECKBOX", viewAttr: 2, hasBorder: true, key: "new_desensitization"}]}, + }, + isSearchOpen: { + new_width: {com: [{type: "INPUTNUMBER",viewAttr: 1,hasBorder: true,key: "new_width", otherParams: {min: 1}}]}, + new_transql: {com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_transql"}]}, + }, + showClass_is_2_newWorkFlowFieldName: { + com: [{type: "INPUT", viewAttr: 1, hasBorder: true, key: "new_wokflowfieldname"}] + }, + // 脱敏设置 + // 允许设置二次验证 + new_desensitization_is_1_cells: { + new_secondAuth: {com: [{type: "CHECKBOX", viewAttr: 2, hasBorder: true, key: "new_secondAuth"}]}, + }, + // 允许进行脱敏显示的设置 + allow_desensitization_cells: { + new_desensitization: {com: [{type: "CHECKBOX", viewAttr: 2, hasBorder: true, key: "new_desensitization"}]}, + } + } + } + + getBtns = () => { + const { + dataShowStore, + } = this.props, { + newForm, + status, + } = dataShowStore, { + dataShowFormHiddenFields, + menus, + buttonDisabled, + } = status; + const formParams = newForm.getFormParams(); + let btns = []; + + menus && menus.forEach(v => { + if('BTN_TEST' === v.key) { + if(!(formParams.datafrom == '4')) { + btns.push(); + } + }else if('BTN_GET_SEARCHPAGE' === v.key) { + if (formParams.showclass == "2" && dataShowFormHiddenFields && dataShowFormHiddenFields.id) { + btns.push(); + } + }else { + btns.push(); + } + }) + + return btns; + } + + getRightMenu = () => { + const { + dataShowStore, + } = this.props, { + newForm, + status, + } = dataShowStore, { + dataShowFormHiddenFields, + menus, + buttonDisabled, + } = status; + const formParams = newForm.getFormParams(); + let btnArr = []; + + menus && menus.forEach(v => { + if('BTN_TEST' === v.key) { + if(!(formParams.datafrom == '4')) { + btnArr.push({ + key: v.key, + icon: , + content: v.content, + disabled: buttonDisabled, + onClick: () => this.onRightMenuClick(v.key) + }) + } + }else if('BTN_GET_SEARCHPAGE' === v.key) { + if (formParams.showclass == "2" && dataShowFormHiddenFields && dataShowFormHiddenFields.id) { + btnArr.push({ + key: v.key, + icon: , + content: v.content, + disabled: buttonDisabled, + onClick: () => this.onRightMenuClick(v.key) + }); + } + }else { + btnArr.push({ + key: v.key, + icon: , + content: v.content, + disabled: buttonDisabled, + onClick: () => this.onRightMenuClick(v.key) + }); + } + }); + + return btnArr; + } + + isValidFieldKey = () => { + const {dataShowStore} = this.props; + const {newForm} = dataShowStore; + const formParams = newForm.getFormParams(); + if(formParams.keyfield && formParams.keyfield.trim()) { + let isValid = /^(requestid|type|fielddbtype|currenttime|workflowid|wfid|billid|isbill|f_weaver_belongto_userid|f_weaver_belongto_usertype|wfTestStr|fieldid|viewtype|fromModule|wfCreate|_random_)$/gi.test(formParams.keyfield); + if(isValid) { + newForm.showError('keyfield', `${formParams.keyfield.trim()}${getLabel('519489','不允许作为主键')}`); + return false; + } + } + return true; + } + + onRightMenuClick = (type) => { + const {dataShowStore} = this.props; + const {newForm, source} = dataShowStore; + const {dataShowFormHiddenFields, WebserviceMethodParameterDatas, specialDatas, WeaTableEdit_MergedFieldData, esbSearchDatas, esbShowDatas} = toJS(dataShowStore.status); + const formParams = newForm.getFormParams(); + let {showname, sqltext, searchById, showclass, showtype, datafrom} = formParams; + + if (['BTN_SAVE', 'BTN_TEST'].includes(type)) { + dataShowStore.setState({type}); + if('BTN_SAVE' === type) { + dataShowStore.setState({buttonDisabled: true}); + } + + //必填的校验 ESB + if (formParams.datafrom != '4' || (formParams.datafrom == "4" && formParams.showtype == "3")) { + let hideFieldKeys = ["esbid", "esbshowid"]; + if(formParams.datafrom == '3' && formParams.showtype == '1' && formParams.unconditionalQuery != '1') { + hideFieldKeys.push('sqltext1'); + } + window.e9HideFormFieldKeys = hideFieldKeys; + } + if (formParams.datafrom == '4' && formParams.showclass == '2') { + window.e9HideFormFieldKeys = ["esbshowid"]; + } + + onCheck(newForm, () => { + // 必填的校验 + if ((!formParams.customhref) && (formParams.showtype == '3' || formParams.datafrom == '2')) { + newForm.showError('customhref', getLabel('507143', '“自定义地址”未填写')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + + if (formParams.datafrom == '3' && (formParams.showtype == '2' || (formParams.showtype == '1' && formParams.unconditionalQuery == '1'))) { + if (!formParams.sqltext1) { + newForm.showError('sqltext1', getLabel('506472', '“无条件查询”未填写')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + if ((!formParams.searchById1) && formParams.showclass != '2') { + newForm.showError('searchById1', getLabel('506473', '“回显查询”未填写')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + + if (formParams.datafrom == '1' && (formParams.showtype != '3')) { + if (!formParams.sqltext) { + newForm.showError('sqltext', getLabel('506474', '“查询SQL语句”未填写')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + + if (formParams.datafrom == '0' && (formParams.showtype != '3')) { + if (!formParams.wsurl) { + newForm.showError('wsurl', getLabel('507142', '“WebService地址”未填写')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + if (!formParams.wsoperation) { + newForm.showError('wsoperation', getLabel('507141', '“WebService方法”未填写')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + + // 当数据来源为数据库时,查询sql不允许以delete开头 + if(datafrom == '1') { + if(sqltext && sqltext.trim() && (!(sqltext.trim().toLowerCase()).startsWith('select'))) { + newForm.showError("sqltext", getLabel('513870','查询SQL语句需要以select开始')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + if(searchById && searchById.trim() && (!(searchById.trim().toLowerCase()).startsWith('select'))) { + newForm.showError("searchById", getLabel('513894','回显SQL语句需要以select开始')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + + // 数据来源datafrom为存储过程3的时候,需要检测回显查询searchById1是否含有不允许的字段 + if (formParams.datafrom == '3') { + if (formParams.searchById1) { + if ((/{?[A-Za-z0-9]}/).test(formParams.searchById1)) { + newForm.showError('searchById1', getLabel('506393', '不允许使用人员变量')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + } + + // 主键字段不允许设置的值 + if(!this.isValidFieldKey()) { + dataShowStore.setState({buttonDisabled: false}); + return; + } + + // 校验参数设置必填项validator + if (formParams.showtype == 1 || formParams.showclass == 2) { + let result = this.table ? this.table.doValidate() : {}; + this.setState({validatePass: result.pass}) + if (!result.pass) { + dataShowStore.setState({buttonDisabled: false}); + return; + }; + } + + // 参数设置中显示字段设置必填验证 + if (datafrom == "4" && showtype == "1") { + // ESB检测ESB查询服务中的查询参数必须存在于字段设置中 + let esbParamName = [], flag = false; + esbSearchDatas && esbSearchDatas.forEach(data => { + if (data.paramtype === "3") { + flag = true; + if (WeaTableEdit_MergedFieldData && WeaTableEdit_MergedFieldData.find(v => v.new_fieldname === data.paramname)) { + if (WeaTableEdit_MergedFieldData.find(v => v.new_fieldname === data.paramname).new_issearch == 0) { + esbParamName.push(data.paramname); + } + } else { + esbParamName.push(data.paramname); + } + } + }) + if (!flag) { + message.error(getLabel('511544', 'ESB查询服务中至少需要配置一个条件查询字段类型')); + dataShowStore.setState({buttonDisabled: false}); + return; + } else if (flag && esbParamName && esbParamName.length) { + message.error(`${getLabel('511547', '字段设置中需要设置')}【${esbParamName.join(',')}】${getLabel('511549', '查询字段')}`); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + + //显示标题字段必须要有1个验证 + if (((showclass == "1" && showtype == "1") || showclass == "2")) { + let hasTitleField = false; + if (WeaTableEdit_MergedFieldData && WeaTableEdit_MergedFieldData.length > 0) { + + for (let j = 0, len = WeaTableEdit_MergedFieldData.length; j < len; j++) { + let o = WeaTableEdit_MergedFieldData[j]; + if (o.new_istitle == "1") { + hasTitleField = true; + break; + } + } + } + if (!hasTitleField) { + message.error(getLabel(82993, '请设置标题栏字段')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + // 至少设置一个check框可选 + for (let i = 0; i < WeaTableEdit_MergedFieldData.length; i++) { + let data = WeaTableEdit_MergedFieldData[i]; + if (!(Number(data.new_istitle) || Number(data.new_islist) || Number(data.new_issearch))) { + message.error(getLabel(389329, '请至少设置查询字段或者显示字段')); + dataShowStore.setState({buttonDisabled: false}); + return; + } + } + } + + // 判断字段/XML路径重复 + let newLists = []; + for (let i = 0; i < WeaTableEdit_MergedFieldData.length; i++) { + let data = WeaTableEdit_MergedFieldData[i]; + if (data.new_islist == '1') { + if (newLists.indexOf(data.new_fieldname) != -1) { + message.error(getLabel('389333,18082', '字段/XML路径重复')); + dataShowStore.setState({buttonDisabled: false}); + return; + } else { + newLists.push(data.new_fieldname); + } + } + } + + // 测试的时候新增的一个判断 + if (type === "BTN_TEST") { + let flg = true; + let flg3 = true; + if (formParams.datafrom === '3' && formParams.showtype === '1' && formParams.searchByName && (/[#]+[_a-zA-Z0-9]+[#]/).test(formParams.searchByName)) { + let new_fieldnames = []; + let array = formParams.searchByName.match(/[#]+[_a-zA-Z0-9]+[#]/g); + + for (let i = 0; i < WeaTableEdit_MergedFieldData.length; i++) { + let data = WeaTableEdit_MergedFieldData[i]; + new_fieldnames.push(data.new_fieldname); + array.map(function (value, index) { + value = value.replace(/#/g, ""); + if (data.new_fieldname == value) { + //查询字段 + if (!Number(data.new_issearch)) { + flg3 = false; + } + } + }); + } + //条件查询参数必须在字段设置中字段/XML路径存在 + array.map(function (value, index) { + value = value.replace(/#/g, ""); + if (new_fieldnames.toString().indexOf(value) <= -1) { + flg = false; + } + }); + } + + if (!flg) { + message.error(getLabel('510639', '条件查询参数必须在字段设置中字段/XML路径存在')); + return; + } + if (!flg3) { + message.error(getLabel('510639', '条件查询参数需要在字段设置中的查询字段存在')); + return; + } + } + + // 保存的真正逻辑 标识唯一性检查 + let id = dataShowFormHiddenFields.id || ""; + + checkUnique({ + tableName: 'datashowset', + fieldName: 'showname', + fieldValue: showname.replace(/^(\s*)|(\s*)$/g, ''), + }, newForm, 'showname', '2', id, () => { + let params = Object.assign({}, dataShowFormHiddenFields, { + ...formParams, + sqltext: Base64.encode(sqltext || ""), + searchById: Base64.encode(searchById || ""), + isPhyPage: formParams.isPhyPage != "1" ? "2" : "1", + operator: "save" + }); + if (source && id == "") { + params.typename = source; + } + let datas = WeaTableEdit_MergedFieldData && WeaTableEdit_MergedFieldData.map(data => { + let transSQL = data.new_transql ? data.new_transql : ''; + return Object.assign({}, data, {new_transql: Base64.encode(transSQL)}); + }) + + let searchDatas = esbSearchDatas.concat(specialDatas).map(v => { + if (["pageNo", "startNo", "endNo", "pagesize"].includes(v.paramname.trim())) { + return Object.assign({}, v, {paramtype: "5"}); + } else if(["eventType"].includes(v.paramname.trim())) { + return Object.assign({}, v, {paramtype: "6"}); + } else return v; + }) + + dataShowStore.getDataShowOperation({ + ...params, + type, + dtinfo_MergedFieldData: JSON.stringify(datas), + dtinfo_WebserviceMethodParameterDatas: JSON.stringify(WebserviceMethodParameterDatas), + dtinfo_EsbsearchParameterDatas: JSON.stringify(searchDatas), // esb相关的数据 + dtinfo_EsbshowParameterDatas: JSON.stringify(esbShowDatas), // esb相关的数据 + }); + }, {}, () => { + dataShowStore.setState({buttonDisabled: false}); + }) + }, () => { + dataShowStore.setState({buttonDisabled: false}); + }); + } else if (type == "BTN_GET_SEARCHPAGE") { + this.viewSearchUrl(); + } + }; + + viewSearchUrl = () => { + const {dataShowStore} = this.props; + const {newForm, status} = dataShowStore; + const {dataShowFormHiddenFields} = toJS(status); + + if (newForm.getFormParams().showclass == "2") { + confirm({ + content: (window.ecologyContentPath || "") + "/spa/inte/static/index.html#/main/inte/tab/" + dataShowFormHiddenFields.id, + okText: getLabel("77", "复制"), + cancelText: getLabel(31129, "取消"), + onOk: () => { + if (copy(`${window.ecologyContentPath || ""}/spa/inte/static/index.html#/main/inte/tab/${dataShowFormHiddenFields.id}`)) { + message.success(getLabel('126081', '地址已经复制成功,您可以使用Ctrl+v粘贴')); + } + }, + onCancle: () => { + }, + }) + } else { + message.info(getLabel(32324, '当前展现集成不是查询页面,请重新操作')); + } + } + + willEdit = (datas = [], editData) => { + const {dataShowStore} = this.props; + const formParams = dataShowStore.newForm.getFormParams(); + const {record, key, index, value} = editData; + + if("new_islist" === key) { + if(record.new_fieldname && formParams.keyfield && record.new_fieldname.trim() && formParams.keyfield.trim() && record.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) { + datas[index] = { + ...datas[index], + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } else { + if(value == '0') { + datas[index] = { + ...datas[index], + new_istitle: '0', + } + + if(record.new_issearch == '1') { + datas[index] = { + ...datas[index], + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } + } + } + } else if("new_issearch" === key) { + if(record.new_fieldname && formParams.keyfield && record.new_fieldname.trim() && formParams.keyfield.trim() && record.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) { + datas[index] = { + ...datas[index], + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } else { + if(value == '0') { + datas[index] = { + ...datas[index], + new_isshow: '0', + new_istitle: '0', + } + } else if(value == '1' && record.new_islist != '1') { + datas[index] = { + ...datas[index], + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } + } + } else if("new_istitle" === key) { + if (value == '1') { + let preIndex = datas.find(data => data.new_istitle == '1' && data.id != record.id); + if (preIndex) { + preIndex.new_istitle = '0'; + } + datas.forEach((data, index) => { + if (data.id === record.id) { + datas[index] = { + ...datas[index], + new_istitle: '1', + new_issearch: '1', + new_islist: '1', + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } + }) + } else { + if(record.new_fieldname && formParams.keyfield && record.new_fieldname.trim() && formParams.keyfield.trim() && record.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) { + datas[index] = { + ...datas[index], + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } + } + } else if("new_desensitization" === key) { + // 没有选择脱敏显示的情况下,【二次身份校验】为禁用 + if(value != '1') { + datas[index] = { + ...datas[index], + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } + } else if("new_fieldname" === key) { + // 主键字段不可以进行脱敏显示设置 + if(value && formParams.keyfield && value.trim() && formParams.keyfield.trim() && value.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) { + datas[index] = { + ...datas[index], + new_desensitization: record.new_desensitization ? '0' : '', + new_secondAuth: record.new_secondAuth ? '0' : '', + } + } + } + dataShowStore.setState({WeaTableEdit_MergedFieldData: datas}); + }; + + willDelete = (datas, key) => new Promise((resolve, reject) => { + confirm({ + content: getLabel(385625, '确定要删除选择的记录吗?'), + onOk: () => resolve(true), + onCancle: () => resolve(false), + }) + }); + + willEditESB = (allDatas, editDatas, key) => { + const {dataShowStore} = this.props; + const {WeaTableEdit_MergedFieldData} = toJS(dataShowStore.status); + const {key: editKey, value, record} = editDatas; + let mergedDatas = [...WeaTableEdit_MergedFieldData]; + if (editKey == "paramtype") { + allDatas && allDatas.forEach((v, index) => { + if (v.paramname === record.paramname) { + allDatas[index] = { + ...allDatas[index], + paramvalue: "" + } + } + }) + if (value === '3' && record.paramtype != '3' && key === "esbid") { + let index = mergedDatas.findIndex(v => v.new_fieldname === record.paramname && v.new_issearch == '1'); + if (index === -1) { + mergedDatas.push({ + id: uuid(), + new_fieldname: record.paramname, + new_issearch: '1', + new_fieldtype: '2' + }) + } + } + if (value != '3' && record.paramtype == '3' && key === "esbid") { + let index = mergedDatas.findIndex(v => v.new_fieldname === record.paramname && v.new_issearch == '1'); + if (index != -1) { + mergedDatas.splice(index, 1); + } + } + // 只能有一个主键 + if (key === "esbshowid") { + if (value === '3') { + allDatas && allDatas.forEach((v, index) => { + if ((v.paramname != record.paramname) && v.paramtype === '3') { + allDatas[index] = { + ...allDatas[index], + paramtype: '' + } + } + }) + dataShowStore.newForm.updateFields({keyfield: record.paramname}); + } else { + let keyField = allDatas && allDatas.find(v => v.paramtype === "3"); + if (keyField) { + dataShowStore.newForm.updateFields({keyfield: keyField.paramname}); + } else { + dataShowStore.newForm.updateFields({keyfield: ""}); + } + } + } + } + dataShowStore.setState({[key === "esbid" ? "esbSearchDatas" : "esbShowDatas"]: allDatas}); + if (key === "esbid") { + dataShowStore.setState({WeaTableEdit_MergedFieldData: mergedDatas}); + } + }; + + getESBColumns = (columns, key) => { + const {newForm} = this.props.dataShowStore; + const formParams = newForm.getFormParams(); + columns && columns.forEach(v => { + if (v.dataIndex === "paramtype" && key === "esbid") { + let options = [...v.com[0].options]; + if (formParams.showclass === "2") { + let index = options.findIndex(option => option.key === "2"); + options.splice(index, 1); + } + if (formParams.isSupportPaging == 0) { + let index = options.findIndex(option => option.key === "5"); + options.splice(index, 1); + } + v.com[0] = { + type: "custom", + key: v.key, + render: (text, record, index, onEdit) => { + if (["pageNo", "startNo", "endNo", "pagesize", "eventType"].includes(record.paramname)) { + return + } else { + let option = options.slice(0); + // 去除分页参数 + let index1 = option.findIndex(v => v.key === "5"); + if (index1 != -1) { + option.splice(index1, 1); + } + // 去除接口类型 + let idx = option.findIndex(v => v.key === "6"); + if (idx != -1) { + option.splice(idx, 1); + } + return onEdit({ + type: "CUSTOM", + record, + index, + key: v.dataIndex, + value, + })} + /> + } + } + } + } else if (v.dataIndex === "paramvalue") { + v.com[0] = { + type: "custom", + key: v.key, + render: (text, record, index, onEdit) => { + if ((["3", "5"].includes(record.paramtype) && key === "esbid") || (record.paramtype == 3 && key === "esbshowid")) { + return + } else if ((["2", "1", "4"].includes(record.paramtype) && key === "esbid") || (["2", "1"].includes(record.paramtype) && key === "esbshowid")) { + let paramvalue = ""; + try { + paramvalue = record.paramvalue ? JSON.parse(record.paramvalue) : ""; + } catch (err) { + paramvalue = ""; + } + return onEdit({ + type: "CUSTOM", + record, + index, + key: v.dataIndex, + value + })} + /> + } + } + } + } + }) + }; + + getMergedCells = (datas = []) => { + const {newForm} = this.props.dataShowStore; + const { + esbIsTitleOpen, + esbIsShowTitleOpen, + esbIsSearchOpen, + esbInitCells, + initCells, + isShowTitleOpen, + isSearchOpen, + showClass_is_2_newWorkFlowFieldName, + new_desensitization_is_1_cells, + allow_desensitization_cells, + } = this.state; + const formParams = newForm.getFormParams(); + let cells = []; + + if (formParams.datafrom == "4" && formParams.showtype != "3") { + datas && datas.forEach(data => { + let itemCells = {}; + + // 优化之前的写法: 相关任务QC699869 + if(formParams.showclass === "2") { + + itemCells = { + ...itemCells, + new_wokflowfieldname: showClass_is_2_newWorkFlowFieldName, + } + } + + // // 主键字段, 标题栏字段不可以进行脱敏显示设置 + // if((data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) || data.new_istitle == '1') { + + // itemCells = { + // ...itemCells, + // ...new_istitle_or_primaryKey_is_1_cells, + // } + // } + + // new_desensitization_is_1,进行二次验证的设置 + if(data.new_desensitization == '1') { + + itemCells = { + ...itemCells, + ...new_desensitization_is_1_cells, + } + } + + if (data.new_istitle == '1' || (data.new_issearch == '1' && data.new_islist == '1')) { + itemCells = { + ...esbIsTitleOpen, + ...itemCells, + } + if(data.new_istitle != '1' && data.new_issearch == '1' && data.new_islist == '1') { + if(!(data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase())) { + itemCells = { + ...itemCells, + ...allow_desensitization_cells, + } + } + } + } else { + if (data.new_issearch == '1') { + itemCells = { + ...esbIsSearchOpen, + ...itemCells, + } + } else if (data.new_islist == '1') { + itemCells = { + ...esbIsShowTitleOpen, + ...itemCells, + }; + if(!(data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase())) { + itemCells = { + ...itemCells, + ...allow_desensitization_cells, + } + } + } else { + itemCells = { + ...esbInitCells, + ...itemCells, + }; + } + } + + if(Object.keys(itemCells) && Object.keys(itemCells).length) { + cells.push({ + id: data.id, + ...itemCells + }); + } + }) + } else { + datas && datas.forEach(data => { + let itemCells = {}; + + // 优化之前的写法: 相关任务QC699869 + if(formParams.showclass === "2") { + + itemCells = { + ...itemCells, + new_wokflowfieldname: showClass_is_2_newWorkFlowFieldName, + } + } + + // // 主键字段, 标题栏字段不可以进行脱敏显示设置 + // if((data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) || data.new_istitle == '1') { + + // itemCells = { + // ...itemCells, + // ...new_istitle_or_primaryKey_is_1_cells, + // } + // } + + // new_desensitization_is_1,进行二次验证的设置 + if(data.new_desensitization == '1') { + + itemCells = { + ...itemCells, + ...new_desensitization_is_1_cells, + } + } + if (data.new_istitle == '1' || (data.new_islist == '1' && data.new_issearch == '1')) { + if(data.new_istitle != '1' && data.new_islist == '1' && data.new_issearch == '1') { + if(!(data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase())) { + itemCells = { + ...itemCells, + ...allow_desensitization_cells, + } + } + } + } else { + if (data.new_issearch == '1') { + itemCells = { + ...isSearchOpen, + ...itemCells, + } + } else if (data.new_islist == '1') { + itemCells = { + ...isShowTitleOpen, + ...itemCells, + } + if(!(data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase())) { + itemCells = { + ...itemCells, + ...allow_desensitization_cells, + } + } + } else { + itemCells = { + ...initCells, + ...itemCells, + } + } + } + + if(Object.keys(itemCells) && Object.keys(itemCells).length) { + cells.push({ + id: data.id, + ...itemCells + }); + } + }) + } + + return cells; + }; + + getESBSearchDatas = (flag) => { + const {dataShowStore} = this.props; + const {specialDatas, esbSearchDatas} = toJS(dataShowStore.status); + let datas = [], special = []; + if (flag == 0) { + esbSearchDatas && esbSearchDatas.forEach(v => { + if (!["pageNo", "startNo", "endNo", "pagesize"].includes(v.paramname.trim())) { + datas.push(v); + } else { + special.push(v); + } + }) + } else { + datas = esbSearchDatas.concat(specialDatas); + special = []; + } + dataShowStore.setState({esbSearchDatas: datas, specialDatas: special}); + } + + getMergedDatas = () => { + const {dataShowStore} = this.props; + const {esbSearchDatas, WeaTableEdit_MergedFieldData} = toJS(dataShowStore.status); + let mergedDatas = [...(WeaTableEdit_MergedFieldData || [])]; + + esbSearchDatas && esbSearchDatas.map(record => { + if(record.paramtype == '3') { + let index = mergedDatas && mergedDatas.findIndex(v => v.new_fieldname === record.paramname && v.new_issearch == '1'); + if(index == -1) { + mergedDatas.push({ + id: uuid(), + new_fieldname: record.paramname, + new_issearch: '1', + new_fieldtype: '2' + }) + } + } + }) + dataShowStore.setState({WeaTableEdit_MergedFieldData: mergedDatas}); + } + + getKeyField = () => { + const {dataShowStore} = this.props; + const {esbShowDatas} = toJS(dataShowStore.status); + let keyfield = ""; + + if (esbShowDatas && esbShowDatas.length) { + let keyField = esbShowDatas.find(v => v.paramtype === "3"); + if (keyField) { + keyfield = keyField.paramname; + } + } + return keyfield; + } + + onChangeFields = (key, otherParams) => { + const {dataShowStore} = this.props; + const {newForm, status} = dataShowStore; + const datas = status.WeaTableEdit_MergedFieldData; + const formParams = newForm.getFormParams(); + let keyfield = this.getKeyField(); + + if (key === 'wsurl') { + dataShowStore.getDataShowOperation({wsid: formParams.wsurl, operator: 'getregisteinfo'}, () => { + newForm.updateFields({wsoperation: ""}); + }); + } else if (key === 'wsoperation') { + dataShowStore.getDataShowOperation({methodid: formParams.wsoperation, operator: 'getmethodinfo'}); + } else if (key === "esbid") { + if (formParams.esbid != otherParams.esbid) { + dataShowStore.setState({WeaTableEdit_MergedFieldData: []}); + if (formParams.esbid) { + dataShowStore.getDataShowOperation({esbid: formParams.esbid, operator: "getSearchEsbinfo"}); + } else { + dataShowStore.setState({esbSearchDatas: []}); + } + } + } else if (key === "esbshowid") { + if (formParams.esbshowid != otherParams.esbshowid) { + newForm.updateFields({keyfield: ""}); + if (formParams.esbshowid) { + dataShowStore.getDataShowOperation({esbid: formParams.esbshowid, operator: "getEsbinfo"}); + } else { + dataShowStore.setState({esbShowDatas: []}); + } + } + } else if (key === "isSupportPaging") { + this.getESBSearchDatas(formParams.isSupportPaging); + } else if (key === 'showclass') { + if (formParams.datafrom == '4' && formParams.showtype != '3' && formParams.showclass == '1') { + newForm.updateFields({keyfield}); + } + if (formParams.showclass == '2') { + newForm.updateFields({showtype: "1"}); + if (formParams.datafrom == '4') { + this.getMergedDatas(); + } + } + dataShowStore.getOpenPyhStatus(); + } else if (key === 'showname' && formParams.showname != "") { + let checkParams = { + tableName: 'datashowset', + fieldName: 'showname', + fieldValue: formParams.showname.replace(/^(\s*)|(\s*)$/g, ''), + }; + checkTableFieldValueUnique(checkParams).then(result => { + if (result && result.isNotUnique) { + newForm.showError('showname', getLabel('387654', '标识已存在')); + } + }); + } else if (key === 'datafrom') { + newForm.updateFields({ + sqltext: '', + searchById: '', + sqltext1: '', + searchByName: '', + searchById1: '', + wsurl: '', + wsoperation: '', + wsworkname: '', + customhref: '' + }); + if (formParams.datafrom == '4' && formParams.showtype != '3' && formParams.showclass == '1') { + newForm.updateFields({keyfield}); + } + if (formParams.datafrom == "4" && formParams.showtype == '1') { + this.getMergedDatas(); + } else { + dataShowStore.setState({WeaTableEdit_MergedFieldData: []}) + } + dataShowStore.getOpenPyhStatus(); + } else if (key === "showtype") { + if (formParams.showtype == '2' && formParams.datafrom == '4') { + newForm.updateFields({isSupportPaging: 0}); + this.getESBSearchDatas(0); + } + if (formParams.datafrom == '4' && formParams.showtype != '3' && formParams.showclass == '1') { + newForm.updateFields({keyfield}); + } + if (formParams.showtype == '1' && formParams.datafrom == '4') { + this.getMergedDatas(); + } else { + dataShowStore.setState({WeaTableEdit_MergedFieldData: []}); + } + dataShowStore.getOpenPyhStatus(); + } else if ("datasourceid" === key) { + dataShowStore.getOpenPyhStatus(); + } + } + + // 对主键失去焦点后的信息判断 + checkKeyField = () => { + const {dataShowStore} = this.props; + const {newForm, status} = dataShowStore; + const datas = status.WeaTableEdit_MergedFieldData; + const formParams = newForm.getFormParams(); + + if(this.isValidFieldKey()) { + // 如果字段设置中设置了主键,则不可进行显示设置 + let checkTrue = false; + + datas && datas.forEach((data, index) => { + if(data.new_fieldname && formParams.keyfield && data.new_fieldname.trim() && formParams.keyfield.trim() && data.new_fieldname.trim().toLowerCase() === formParams.keyfield.trim().toLowerCase()) { + checkTrue = true; + datas[index] = { + ...datas[index], + new_desensitization: data.new_desensitization ? '0' : '', + new_secondAuth: data.new_secondAuth ? '0' : '' + } + } + }) + + if(checkTrue) { + dataShowStore.setState({WeaTableEdit_MergedFieldData: datas}); + } + } + } + + getHideFields = (key, allParams) => { + const {showOpenPyh} = this.props.dataShowStore.status; + let bool = false; + + key === 'showtype' && allParams.showclass == '2' && (bool = true); + key === 'datafrom' && (allParams.showtype == '3' && allParams.showclass == '1') && (bool = true); + key === 'datasourceid' && (!['1', '3'].includes(allParams.datafrom) || allParams.showtype == '3') && (bool = true); + key === 'sqltext' && (allParams.showtype == '3' || allParams.datafrom != '1') && (bool = true); + key === 'searchById' && (allParams.showtype == '3' || allParams.datafrom != '1' || allParams.showclass == '2') && (bool = true); + key === 'keyfield' && allParams.showtype == '3' && (bool = true); + key === 'wsurl' && (allParams.datafrom != '0' || allParams.showtype == '3') && (bool = true); + key === 'wsoperation' && (allParams.datafrom != '0' || allParams.showtype == '3') && (bool = true); + key === 'wsworkname' && (allParams.datafrom != '0' || allParams.showtype == '3') && (bool = true); + key === 'parentfield' && (allParams.showtype != '2' || allParams.showclass == "2") && (bool = true); + key === 'showfield' && (allParams.showtype != '2' || allParams.showclass == "2") && (bool = true); + key === 'onlylowestnode' && (allParams.showtype != '2' || allParams.showclass == "2" || (allParams.showtype == '2' && ['3', '4'].includes(allParams.datafrom))) && (bool = true); + key === 'customhref' && (allParams.showtype != '3' && allParams.datafrom != '2') && (bool = true); + key === 'sqltext1' && (allParams.datafrom != '3' || allParams.showtype == '3' || (allParams.datafrom == '3' && allParams.showtype == '1' && allParams.unconditionalQuery != '1')) && (bool = true); + key === 'searchByName' && (allParams.datafrom != '3' || allParams.showtype == '3') && (bool = true); + key === 'searchById1' && (allParams.datafrom != '3' || allParams.showtype == '3') && (bool = true); + key === 'characterset' && (allParams.datafrom != '2') && (bool = true); + key === 'showpageurl' && (allParams.showclass != '1' || allParams.showtype != '1' || allParams.datafrom != '1') && (bool = true); + key === 'searchById1' && (allParams.showclass == '2' && allParams.datafrom == '3') && (bool = true); + key === 'unconditionalQuery' && (allParams.showtype == '2') && (bool = true); + ["isSupportPaging", "esbid", "esbshowid"].includes(key) && (allParams.datafrom != '4' || allParams.showtype == '3') && (bool = true); + ["esbshowid"].includes(key) && (allParams.showclass === "2") && (bool = true); + ["isSupportPaging"].includes(key) && (allParams.showtype === "2" && allParams.datafrom == '4') && (bool = true); + "isPhyPage" === key && (!showOpenPyh) && (bool = true); + + return bool; + } + + getHelpfulTip = (key) => { + if (key === 'isSupportPaging') { + return +

{getLabel('511394', '需要第三方接口支持分页查询,目前分页方式有三种')}:

+

1.{getLabel('511390', '行号方式,最小行号~最大行号;例如 1~20')};

+

2.{getLabel('511391', '页码+数量,例如 第3页,每页数量20')};

+

3.{getLabel('511392', '行号+数量,例如从第20行起获取20条数据')}。

+
+ }/> + } else if (key === 'sqltext') { + return + } else if (key === 'searchById') { + return + } else if (key === 'detailpageurl') { + return + } else if (key === 'customhref') { + return + } else if (key === 'searchById1') { + return + } else if (key === 'searchByName') { + return + } else if (key === 'showpageurl') { + return
+ + {getLabel(506848, '示例下载链接')}: + demo.zip + +
+ } else if(key === "keyfield") { + let title = ""; + if(this.state.regExpValue) { + title = `${this.state.regExpValue}`.replace(/(\/|\^|\(|\)|\$)/g, ''); + title = title.slice(0, title.length-2).split('|').join('、'); + } + return ; + } else { + return null; + } + } + + getParamRowSelection = (rowSelection) => { + const {dataShowStore} = this.props; + const {esbSearchDatas} = toJS(dataShowStore.status); + const sel = {...rowSelection}; + let searchKeys = []; + const formParams = dataShowStore.newForm.getFormParams(); + esbSearchDatas && esbSearchDatas.forEach(data => { + if (data.paramtype == '3') { + searchKeys.push(data.paramname); + } + }) + sel.getCheckboxProps = record => { + if (formParams.datafrom == '4' && formParams.showtype == '1' && searchKeys.includes(record.new_fieldname) && record.new_issearch == 1) { + return {disabled: true}; + } else { + return {disabled: false}; + } + }; + return sel; + } + + getRowSelection = v => false; + + getTableProps = () => { + return {showEmptyText: false, scroll: {x: "auto"}}; + } + + getWsDataChange = (datas) => this.props.dataShowStore.setState({WebserviceMethodParameterDatas: datas}); + + getValidator = () => { + return { + rules: { + new_fieldname: 'required|specialStr', + new_showname: 'required', + new_width: 'minNumber', + new_transql: "sqlValid" + }, + customRegister: [ + { + name: 'minNumber', + rules: (value, requirement, attribute) => { + return /^[0-9]*[1-9][0-9]*$/.test(value); + }, + errorMessage: getLabel('504118', '最小值为1'), + }, + { + name: "specialStr", + rules: (value, record, attr) => { + return (!(/^id$/.test(value) || /^href$/.test(value) || /^desc$/.test(value))) + }, + errorMessage: getLabel('507113', '不能配置此字段') + }, + { + name: "sqlValid", + rules: (value, record, attr) => { + return value.trim().startsWith('select') + }, + errorMessage: getLabel('513895','SQL语句需要以select开始') + } + ] + }; + } + + handleChangeKeyField = v => { + this.props.dataShowStore.newForm.updateFields({keyfield: v}); + this.isValidFieldKey(); + } + + getSearchs = () => { + const { + dataShowStore + } = this.props, { + newForm, + status, + } = dataShowStore, { + dataShowFormFields, + WeaTableEdit_WebserviceParameterSet, + WebserviceMethodParameterDatas, + WeaTableEdit_ESBShowParameterSet, + WeaTableEdit_ESBSearchParameterSet, + WeaTableEdit_MergedSearchFieldAndListField, + WeaTableEdit_MergedFieldData, + formLoading, + esbShowDatas, + esbSearchDatas, + } = toJS(status), { + isFormInit, + } = newForm; + const formParams = newForm.getFormParams(); + let group = []; + + formLoading && isFormInit && dataShowFormFields && dataShowFormFields.forEach((c, i) => { + let items = []; + c && c.items && c.items.forEach(fields => { + let key = fields.domkey[0]; + const dom = this.getHelpfulTip(key); + items.push({ + com: ( + + + { + key === "keyfield" + ? formParams.datafrom == '4' && formParams.showtype != '3' && formParams.showclass == '1' + ? + : newForm.updateFields({keyfield: value})} onBlur={this.checkKeyField}/> + : this.onChangeFields(key, formParams)}/> + } + {dom} + + ), + colSpan: 1, + hide: newForm.isHide(fields, (keys, allParams) => { + return this.getHideFields(fields.domkey[0], allParams); + }) + }); + if (getKey(fields) === "wsworkname" && formParams.wsoperation != "" && formParams.datafrom == "0" && formParams.showtype != '3') { + items.push({ + com: ( + + ), + hide: newForm.isHide(fields, (keys, allParams) => { + return (allParams.datafrom != '0' || WebserviceMethodParameterDatas.length == 0); + }) + }); + } else if (((getKey(fields) === "esbid" && formParams.esbid) || (getKey(fields) === "esbshowid" && formParams.esbshowid && formParams.showclass != "2")) && formParams.datafrom == "4" && formParams.showtype != '3') { + this.getESBColumns(key === "esbid" ? WeaTableEdit_ESBSearchParameterSet : WeaTableEdit_ESBShowParameterSet, key); + items.push({ + com: ( + this.willEditESB(allDatas, editDatas, key)} + onChange={(datas) => dataShowStore.setState({[key === "esbid" ? "esbSearchDatas" : "esbShowDatas"]: datas})} + /> + ), + hide: newForm.isHide(fields, (keys, allParams) => { + return (allParams.datafrom != '4' || (esbSearchDatas.length == 0 && key === "esbid") || (key === "esbshowid" && esbShowDatas.length == 0)); + }) + }); + } + }); + if (i == 1 && (formParams.showtype == 1 || formParams.showclass == 2)) { + group.push(
+ +
) + } + if (i == 0) { + group.push(); + } + }); + return group; + } + + getRef = el => this.table = el; + + getColumnsTips = (WeaTableEdit_MergedSearchFieldAndListField=[]) => { + return WeaTableEdit_MergedSearchFieldAndListField && WeaTableEdit_MergedSearchFieldAndListField.map(c => { + let title = ''; + if (["new_fieldname", "new_transql", "new_width"].includes(c.dataIndex)) { + if (c.dataIndex === "new_fieldname") { + title = getLabel('508146', '不能设置以下三个字段:id,desc,href'); + } else if (c.dataIndex === "new_transql") { + title = getLabel(131015, "参数可设置如下内容,格式为:select 最终字段 from tablename where 条件字段={?currentvalue},{?currentvalue}表示当前值"); + } else if (c.dataIndex === "new_width") { + title =

{getLabel('504070', '1.只能输入正整数。')}

+

{getLabel('504032', '2.输入列宽,按照输入的值显示。不输入时,会自动均分。')}

; + } + c.title =
{c.title}
; + } + return c; + }) + } + + onTableEditDataChange = datas => this.props.dataShowStore.setState({WeaTableEdit_MergedFieldData: datas}) + + onCancel = () => { + const { + dataShowStore, + } = this.props; + + dataShowStore.initSqlTestForm(); + dataShowStore.setState({showNewFormDialog: false}); + dataShowStore.newForm.reset(); + } + + getTitle = () => { + const { + dataShowFormHiddenFields, + } = toJS(this.props.dataShowStore.status); + + return ((dataShowFormHiddenFields && dataShowFormHiddenFields.id) > 0 ? getLabel('26473', '编辑') : getLabel('365', '新建')) + `${getLabel('32303', '数据展现集成')}`; + } + + getMoreBtn = () => { + return { + datas: this.getRightMenu(), + collectParams: [] + } + } + + render() { + const { + dataShowStore, + } = this.props, { + showNewFormDialog, + showPreviewDialog, + showsSqlTextFormDialog2, + showIndexTestDialog2, + } = toJS(dataShowStore.status); + + return ( +
+ + + {this.getSearchs()} + + + + + +
+ ) + } +} diff --git a/pc4backstage/integration/components/datashow/PreviewDialog.js b/pc4backstage/integration/components/datashow/PreviewDialog.js new file mode 100644 index 0000000..7cec982 --- /dev/null +++ b/pc4backstage/integration/components/datashow/PreviewDialog.js @@ -0,0 +1,77 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { Button} from "antd"; +import { toJS } from "mobx"; +import { + WeaRightMenu, + WeaDialog, + WeaLocaleProvider, +} from "ecCom"; + +import './style/index.css'; +import TestForm from "./TestForm"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("dataShowStore") +@observer +export default class PreviewDialog extends React.Component { + + getLastStep = () =>{ + const {dataShowStore} = this.props; + dataShowStore.initTestFrom(); + dataShowStore.testForm.reset(); + dataShowStore.setState({showsSqlTextFormDialog: true}); + }; + + getRightMenu = () => { + return []; + }; + + + closeDialog = ()=> { + const { + dataShowStore, + } = this.props; + + dataShowStore.initTestFrom(); + dataShowStore.testForm.reset(); + dataShowStore.initSqlTestForm(); + } + + render() { + const {dataShowStore, showDialog} = this.props; + const {status} = dataShowStore; + const {dataShowFormHiddenFields,showIframe,showTextFormButton} = toJS(status); + let show = showIframe?`block`:`none`; + let url = showIframe && dataShowFormHiddenFields ? `${window.ecologyContentPath || ""}/spa/inte/static/index.html#/main/inte/tab/${dataShowFormHiddenFields.id}?from=1` : ``; + + let buttons = showTextFormButton + ? [] + : []; + return ( + + + + +
+ +
+
+
+ ) + } + +} \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/SqlTestDialog.js b/pc4backstage/integration/components/datashow/SqlTestDialog.js new file mode 100644 index 0000000..9102ad9 --- /dev/null +++ b/pc4backstage/integration/components/datashow/SqlTestDialog.js @@ -0,0 +1,144 @@ +import React from "react"; +import {inject, observer} from "mobx-react"; +import {toJS} from "mobx"; +import * as API from "../../apis/DataShowService"; +import { + WeaTools, + WeaRightMenu, + WeaDialog, + WeaLocaleProvider, +} from "ecCom"; +import {Button} from "antd"; +import SqlTextForm from "./SqlTextForm"; + +const getLabel = WeaLocaleProvider.getLabel; +let Base64 = WeaTools.Base64; +const store = ["dataShowStore"]; + +@inject(...store) +@observer +export default class SqlTestDialog extends React.Component { + + constructor(props) { + super(props); + } + + getRightMenu =() =>{ + + let btn = []; + return btn; + }; + + //检查返回值 + checkValuePROC = (type) => { + const {dataShowStore} = this.props; + const {sqlTextForm, newForm,source} = dataShowStore; + const {form} = sqlTextForm; + const {dataShowFormHiddenFields, WebserviceMethodParameterDatas, WeaTableEdit_MergedFieldData} = toJS(dataShowStore.status); + + let id = dataShowFormHiddenFields.id || ""; + + form.validateForm().then(f => { + if (f.isValid) { + //合并hiddenfield参数 + let sqltextValue = newForm.getFormParams().sqltext ? newForm.getFormParams().sqltext : ''; + let sqltext = Base64.encode(sqltextValue); + let searchByIdValue = newForm.getFormParams().searchById ? newForm.getFormParams().searchById : ''; + let searchById = Base64.encode(searchByIdValue); + let formParams = Object.assign({}, newForm.getFormParams(), { + sqltext: sqltext, + searchById: searchById + }); + let params = Object.assign(dataShowFormHiddenFields, formParams); + params.operator = "save"; + if (source) { + params.typename = source; + } + + let datas = WeaTableEdit_MergedFieldData && WeaTableEdit_MergedFieldData.map(data => { + let transSQL = data.new_transql ? data.new_transql : ''; + return Object.assign({}, data, {new_transql: Base64.encode(transSQL)}); + }); + params.dtinfo_MergedFieldData = JSON.stringify(datas); + params.dtinfo_WebserviceMethodParameterDatas = JSON.stringify(WebserviceMethodParameterDatas); + + //dataShowStore.setState({showsSqlTextFormDialog: false}); + dataShowStore.setState({showTextFormButton: true}); + let checkParams = { + showname: formParams.showname, + sqlTextForm: JSON.stringify(form.getFormParams()), + }; + API.saveFormParam(checkParams).then(result => { + if (result.status === '1') { + //关闭sql表单,不是重置 + //dataShowStore.initSqlTestForm(); + dataShowStore.setState({ + showsSqlTextFormDialog: false, + showsSqlTextFormDialog2:false, + }); + + API.getIndexTest(id).then(result=>{ + if (result.ext === 'true') { + if (result.status) { + //获取测试的form数据 + dataShowStore.getDataShowTestForm(newForm.getFormParams(),dataShowFormHiddenFields, WebserviceMethodParameterDatas,type); + } else { + dataShowStore.setState({ + testInitDatas: result.data.base, + }); + console.log("type================" + type); + if (type == 'INDEX_TEST') { + dataShowStore.setState({ + showIndexTestDialog: true, + }); + } + if (type == 'BTN_TEST') { + dataShowStore.setState({ + showIndexTestDialog2: true, + }); + } + } + } else { + //异常处理 + + } + }); + } + }); + + } else { + f.showErrors(); + this.setState({date: new Date()}); + } + }); + }; + + render() { + const {dataShowStore,showSqlDialog} = this.props; + const{type} = dataShowStore.status; + let buttons = [ + , + ]; + + return ( + + + + + + + ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/SqlTextForm.js b/pc4backstage/integration/components/datashow/SqlTextForm.js new file mode 100644 index 0000000..191afb4 --- /dev/null +++ b/pc4backstage/integration/components/datashow/SqlTextForm.js @@ -0,0 +1,57 @@ +import React from "react"; +import {inject, observer} from "mobx-react"; +import {WeaSwitch} from "comsMobx"; +import {toJS} from "mobx"; +import { + WeaSearchGroup, + WeaFormItem, +} from "ecCom"; + +const store = ["dataShowStore"]; + +@inject(...store) +@observer +export default class SqlTextForm extends React.Component { + + constructor(props) { + super(props); + } + + getItem = () => { + const {dataShowStore} = this.props; + const {sqlTextForm, status} = dataShowStore; + const {} = toJS(status); + const {form, condition} = sqlTextForm; + const {isFormInit} = form; + + let arr = []; + isFormInit && condition && condition.map((c, index) => { + let items = []; + c.items.map((field) => { + items.push({ + com: ( + + + ), + colSpan: 1 + }) + }); + arr.push(); + }); + return
{arr}
+ }; + + render() { + return (
+ {this.getItem()} +
) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/TestForm.js b/pc4backstage/integration/components/datashow/TestForm.js new file mode 100644 index 0000000..43d3e18 --- /dev/null +++ b/pc4backstage/integration/components/datashow/TestForm.js @@ -0,0 +1,69 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaSwitch } from "comsMobx"; +import { + WeaFormItem, + WeaTools, +} from "ecCom"; +import './style/index.css'; + +const { getKey } = WeaTools; +const store = ["dataShowStore"]; + + +@inject(...store) +@observer +export default class TestForm extends React.Component{ + + constructor (props) { + super(props); + this.state={}; + } + + getItems = () => { + const {dataShowStore} = this.props; + const {testForm, status} = dataShowStore; + const {dataShowTestFormFields,showXml} = toJS(status); + const {isFormInit} = testForm; + + let group = []; + isFormInit && dataShowTestFormFields && dataShowTestFormFields.forEach(c => { + c && c.items && c.items.forEach(fields => { + let key = fields.domkey[0]; + + // 处理浏览框的图标 + if('BROWSER' === fields.conditionType && fields.browserConditionParam) { + // 设置图标 + fields.browserConditionParam.icon = "icon-coms-integration"; + fields.browserConditionParam.iconBgcolor = "#1a57a0"; + } + + group.push( + + + + ) + }); + }); + + return
{group}
; + }; + + render() { + return ( +
+ {this.getItems()} +
+ ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/index.js b/pc4backstage/integration/components/datashow/index.js new file mode 100644 index 0000000..96b3874 --- /dev/null +++ b/pc4backstage/integration/components/datashow/index.js @@ -0,0 +1,514 @@ +import React from "react"; +import { + inject, + observer, +} from "mobx-react"; +import { + Button, +} from "antd"; +import { + WeaLocaleProvider, + WeaLeftRightLayout, + WeaTop, + WeaTab, + WeaRightMenu, +} from "ecCom"; +import { + WeaTableNew, + WeaLogView, +} from "comsMobx"; +import { + doConfirm, + getAdvancedItem, + getSearchBtns, +} from "../../util/IntegrationUtil"; +import NewForm from "./NewForm"; +import NewE7Form from "./NewE7Form"; +import NoRight from "../../public/NoRight"; +import PreviewDialog from "./PreviewDialog"; +import IndexTestDialog from "./IndexTestDialog"; +import SqlTestDialog from "./SqlTestDialog"; +import OrganizationTree from '../../public/OrganizationTree'; +import CacheDataManage from "./CacheDataManage"; + +const {getLabel} = WeaLocaleProvider; +const {WeaTable} = WeaTableNew; +const WeaLogViewComp = WeaLogView.Component; + +@inject("dataShowStore") +@observer +export default class DataShow extends React.Component { + constructor(props) { + super(props); + this.state = { + visible: false, + targetId: "", + showSearchAd: false, + searchType: ['base','advanced'], + tabDatas: [{ + key: "0", + title: getLabel("526043", "数据展现集成列表") + }, { + key: "1", + title: getLabel("526044", "缓存管理") + }], + }; + } + + // 从NC等产品集成入口进来的数据 + componentWillMount() { + const {dataShowStore} = this.props; + let paramsIndex = location.href.trim() && location.href.trim().indexOf('?'); + if((paramsIndex != -1) && (location.href.trim().indexOf('typename') > paramsIndex) && (location.href.trim().indexOf('from=productEntrance') > paramsIndex)) { + let url = location.href.split('?')[1]; + if(url) { + let params = url.split('&'); + let query = {}; + for(let i = 0; i < params.length; i++) { + query[params[i].split('=')[0]] = params[i].split('=')[1]; + } + dataShowStore.source = (query.typename ? query.typename : ""); + }else { + dataShowStore.source = ""; + } + }else { + dataShowStore.source = ""; + } + } + + // 组件渲染后调用 + componentDidMount() { + const { dataShowStore } = this.props; + dataShowStore.doInit(); + } + + componentWillReceiveProps(nextProps) { + const { dataShowStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + dataShowStore.doInit(); + } + } + + // 分权刷新 + refreshData = (id, type) => { + const { + dataShowStore + } = this.props, { + status, + } = dataShowStore, { + selectedKey, + } = status; + + if("1" === type) { + // 如果点击的是分部 + dataShowStore.setState({ + subcompanyid: id, + }) + } else{ + dataShowStore.setState({ + subcompanyid: "", + }) + } + + if(selectedKey == "1") { + dataShowStore.getCacheManageCondition({}, dataShowStore.getCacheManageListInfo); + } else { + dataShowStore.getDataShowCondition({}, dataShowStore.getDataShowInfo); + } + } + + getBtns = () => { + const { + dataShowStore, + } = this.props, { + status, + tableStore, + } = dataShowStore, { + rightMenus, + selectedKey, + tabButtonDisabled, + } = status, { + selectedRowKeys + } = tableStore; + + return rightMenus && rightMenus.map(m => ); + }; + + getRightMenu = () => { + const { + dataShowStore, + } = this.props, { + status, + tableStore, + } = dataShowStore, { + rightMenus, + selectedKey, + tabButtonDisabled, + } = status; + + let btnArr = rightMenus && rightMenus.map(m => { + return { + key: m.type, + icon: , + content: m.menuName, + onClick: () => this.onRightMenuClick(m.type), + disabled: tabButtonDisabled || (selectedKey == "0" ? (m.menuIcon==='icon-coms-delete' && tableStore.selectedRowKeys.length === 0) : this.getButtonSelectProps(m.type)), + }; + }); + //显示列定制 + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: getLabel(32535, "显示列定制"), + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + return btnArr; + } + + getButtonSelectProps = (type) => { + const { + dataShowStore, + } = this.props, { + tableStore, + } = dataShowStore, { + selectedRowKeys, + datas, + } = tableStore; + let disabled = selectedRowKeys.length === 0, + list = []; + + if(!disabled) { + selectedRowKeys && selectedRowKeys.forEach(key => { + let data = datas && datas.find(data => data.randomFieldId === key); + if(data) { + if(list.indexOf(data.isopencache) == -1) { + list.push(data.isopencache); + } + } + }) + if(list.length > 1) { + disabled = true; + } else { + return (type === "BTN_NEW" && list[0] == "1") || (type === "BTN_DEL" && list[0] == "0"); + } + } + + return disabled; + } + + onRightMenuClick = (type, record=null) => { + const { + dataShowStore, + } = this.props, { + tableStore, + status, + getDataShowCacheOperation, + getCacheDataManageCondition, + getCacheDataManageInfo, + } = dataShowStore, { + selectedKey, + } = status; + const operateKey = record ? record.id : tableStore.selectedRowKeys; + + if("0" == selectedKey) { + if (type == "BTN_NEW") { + dataShowStore.setState({showNewFormDialog: true}); + dataShowStore.getDataShowEditForm({id: ''}); + }else if (type == "BTN_DEL" || type == "2") { + let ids = "", title = ""; + if(type == "2") { + title = getLabel(15097, '确定要删除吗?'); + ids = record.id; + } else { + title = getLabel(385625, '确定要删除选择的记录吗?'); + ids = tableStore.selectedRowKeys; + } + doConfirm( + title, + dataShowStore.getDataShowOperation, + {operator: 'delete', id: ids} + ); + }else if (type == "0") { + dataShowStore.setState({type: 'INDEX_TEST'}); + dataShowStore.getIndexTest(record.id); + }else if (type == "1") { + if(record.browserfrom == '0') { + dataShowStore.getDataShowEditForm4E7({id: record.id, browserid:record.showname}); + dataShowStore.setState({showNewE7FormDialog: true}); + }else { + dataShowStore.getDataShowEditForm({id: record.id}); + dataShowStore.setState({showNewFormDialog: true}); + } + } + } else if ("1" == selectedKey) { + if("0" == type || "BTN_NEW" == type) { + // 开启缓存 + let title = ''; + if('0' == type) { + title = `${getLabel('529052','确定开启缓存吗')}?`; + } else { + title = `${getLabel('529054','确定要开启选择的记录的缓存吗')}?`; + } + doConfirm( + title, + getDataShowCacheOperation, + {operate: "openCache", id: operateKey} + ); + } else if("1" == type || "BTN_DEL" == type) { + // 关闭缓存 + let title = ''; + if('1' == type) { + title = `${getLabel('529051','确定关闭缓存吗')}?` ; + } else { + title = `${getLabel('529053','确定要关闭选择的记录的缓存吗')}?`; + } + doConfirm( + title, + getDataShowCacheOperation, + {operate: "closeCache", id: operateKey} + ); + } else if("2" == type) { + // 缓存数据管理 + dataShowStore.setState({ + cacheDataManageVisible: true, + cacheDataOperateInfo: record, + }) + getCacheDataManageCondition({}, getCacheDataManageInfo); + } else if("3" == type) { + // 系统日志 + this.setState({ + visible: true, + targetId: record ? record.id : "", + }) + } + } + + if (type == "BTN_COLUMN") { + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + } + }; + + getAdvancedSearch = () => { + const { + dataShowStore, + } = this.props, { + searchForm, + status, + } = dataShowStore, { + dataShowConditionInfo + } = status; + return getAdvancedItem(searchForm, dataShowConditionInfo, this.handleSearchFun, false, this && this.props && this.props.ecId || '', "integrationDatashow"); + }; + + handleSearchFun = () => { + const { + dataShowStore, + } = this.props, { + status, + searchForm, + } = dataShowStore, { + selectedKey, + }= status; + + dataShowStore.setState({ + subcompanyid: searchForm.getFormParams().subcompanyid1, + }); + + if(selectedKey == "1") { + dataShowStore.getCacheManageListInfo(); + } else { + dataShowStore.getDataShowInfo(); + } + + this.setState({ showSearchAd: false }); + } + + getTabButtonsAd = () => { + return getSearchBtns( + this.handleSearchFun, + () => this.props.dataShowStore.searchForm.reset(), + () => this.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "integrationDatashow" + ); + } + + onOperatesClick = (record, index, operate) => { + this.onRightMenuClick(operate.index, record); + }; + + getColumnsInfo = (datas=[]) => { + const {selectedKey} = this.props.dataShowStore.status; + + return datas && datas.map(item => { + if("0" == selectedKey) { + if("id" === item.dataIndex) { + item.render = (text, record) => this.onRightMenuClick("1", record)}>{record.showname}; + } else if(["unconditionalQuery", "physicalPaging", "isPhyPage"].includes(item.dataIndex)) { + item.render = (text, record) => {record[`${item.dataIndex}span`] || record[item.dataIndex]}; + } + } + + if("subcompanyid" === item.dataIndex) { + item.render = (text, record) => {record.subcompanyidspan}; + } + + return item; + }) + } + + setShowSearchAd = (bool) => this.setState({showSearchAd: bool}); + + hideSearchAd = () => this.setState({showSearchAd: false}); + + onSearchChange = value => { + const { + dataShowStore, + } = this.props, { + searchForm, + status, + } = dataShowStore, { + selectedKey, + } = status; + + searchForm.updateFields({[selectedKey == "0" ? "name" : "showname"]: value}) + }; + + getSearchBaseValue = () => { + const { + dataShowStore, + } = this.props, { + searchForm, + status, + } = dataShowStore, { + selectedKey, + } = status; + + const formParams = searchForm.getFormParams(); + + return selectedKey == "0" ? formParams.name : formParams.showname; + } + + onChange = (selectedKey) => { + const { + dataShowStore, + } = this.props; + + if(selectedKey == "1") { + dataShowStore.getCacheManageCondition({}, dataShowStore.getCacheManageListInfo); + } else { + dataShowStore.getDataShowCondition({}, dataShowStore.getDataShowInfo); + } + + dataShowStore.setState({selectedKey}); + } + + // 关闭日志弹窗 + closeLogDialog = () => { + this.setState({ + visible: false, + targetId: "", + }) + } + + render() { + const { + dataShowStore, + } = this.props, { + tableStore, + status, + hasRight, + rightLoading, + logStore, + } = dataShowStore, { + advanceHeight, + showTestFormDialog, + showsSqlTextFormDialog, + showIndexTestDialog, + collectParams, + hasOrganization, + subcompanyid, + selectedKey, + } = status, { + showSearchAd, + searchType, + tabDatas=[], + visible, + targetId, + } = this.state; + + return (rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + /> + } + > + + + + + + + + + + + + : + ); + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/datashow/style/index.css b/pc4backstage/integration/components/datashow/style/index.css new file mode 100644 index 0000000..8a73e32 --- /dev/null +++ b/pc4backstage/integration/components/datashow/style/index.css @@ -0,0 +1,16 @@ +.specialCol_dataShow span.wea-field-readonly { + margin-top:10px; + /*line-height: 30px;*/ + word-break: break-all; + +} + +span.inte-datashow-selectStyle>span.child-item { + word-break: keep-all !important; +} + +/* +.specialCol2 span.wea-field-readonly { + cursor:pointer; + line-height: 80px; +}*/ diff --git a/pc4backstage/integration/components/delegateClient/index.js b/pc4backstage/integration/components/delegateClient/index.js new file mode 100644 index 0000000..4b350f5 --- /dev/null +++ b/pc4backstage/integration/components/delegateClient/index.js @@ -0,0 +1,230 @@ +import { + inject, + observer, +} from "mobx-react"; +import { + toJS +} from 'mobx'; +import uuid from 'uuid'; +import { + WeaFormItem, + WeaLocaleProvider, + WeaRightMenu, + WeaSearchGroup, + WeaTop, + WeaNewScroll, +} from "ecCom"; +import { + WeaSwitch, +} from "comsMobx"; +import { + onCheck, + doConfirm, +} from "../../util/IntegrationUtil"; +import { + Button, +} from "antd"; +import NoRight from "../../public/NoRight"; + +const {getLabel} = WeaLocaleProvider; + +@inject("delegateClientStore") +@observer +class DelegateClient extends React.Component { + constructor(props) { + super(props); + this.state = { + collectParams: { + favname: getLabel('528480','Delegate集成'), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/delegate_client", + importantlevel: 1 + } + }; + } + + componentDidMount() { + this.props.delegateClientStore.doInit(); + } + + componentWillUnmount() { + this.props.delegateClientStore.cleanStore(); + } + + componentWillReceiveProps(nextProps) { + const { delegateClientStore } = this.props; + if (this.props.location && nextProps.location && (this.props.location.key !== nextProps.location.key)) { + delegateClientStore.doInit(); + } + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu() { + const { + formLoading + } = this.props.delegateClientStore.status; + + return [{ + key: "BTN_SAVE", + icon: , + content: getLabel(30986, '保存'), + disabled: formLoading, + onClick: () => this.onMenuClick("BTN_SAVE") + }, { + key: "test", + icon: , + content: getLabel('514733','部署'), + disabled: formLoading, + onClick: () => this.onMenuClick("test") + }] + } + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + const { + formLoading + } = this.props.delegateClientStore.status; + + return [ + , + + ] + }; + + /** + * 右键菜单点击事件 + * @param type + */ + onMenuClick = (type) => { + const { + delegateClientStore, + } = this.props, { + baseForm, + hiddenFields={}, + } = delegateClientStore; + + if (['BTN_SAVE', 'test'].includes(type)) { + const formParams = baseForm.getFormParams(); + let params = Object.assign({}, formParams, toJS(hiddenFields)); + // 提取保存的公共方法 + let saveMethod = () => { + if('test' === type) { + doConfirm( + getLabel('514734','部署后会自动重启服务,若有失败,请手动重启服务,以确保系统能正常使用!'), + delegateClientStore.getBaseInfoFormOperation, + params, + ) + } else { + delegateClientStore.getBaseInfoFormOperation(params); + } + }; + + if('test' === type) { + params = Object.assign({}, params, {isdeploy: '1'}); + } + + if(formParams.isuse != '1') { + saveMethod(); + } else { + onCheck(baseForm, () => { + if(formParams.isuse == '1' && formParams.ec_isuse != '1' && formParams.em_isuse != '1') { + doConfirm(getLabel('528310','请开启pc认证或移动端认证!')); + return; + } + + saveMethod(); + }); + } + } + }; + + /** + * 渲染form表单 + */ + getBaseInfoForm = (form, datas=[]) => { + const { + isFormInit, + } = form; + let group = []; + + isFormInit && datas && datas.forEach((c, index) =>{ + let items = []; + + if(form.getFormParams().isuse == '1' || ('1' != form.getFormParams().isuse && 'baseInfo' === c.key)) { + c.items && c.items.forEach(fields => { + let key = fields.domkey[0]; + items.push({ + com:( + + + + ), + colSpan:1, + hide: form.isHide(fields, (keys, allParams) => { + let bool = false; + 'customsql' === key && allParams.accounttype != '7' && (bool = true); + return bool; + }) + }); + }); + group.push(); + } + }); + + return group; + } + + render() { + const { + delegateClientStore, + } = this.props, { + status, + baseForm, + } = delegateClientStore, { + hasRight, + loading, + condition, + } = status, { + collectParams, + } = this.state; + + return ( + loading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{collectParams}} + /> + + {this.getBaseInfoForm(baseForm, condition)} + + + : + ); + } +} + +export default DelegateClient; diff --git a/pc4backstage/integration/components/docx/index.js b/pc4backstage/integration/components/docx/index.js new file mode 100644 index 0000000..bbe067d --- /dev/null +++ b/pc4backstage/integration/components/docx/index.js @@ -0,0 +1,231 @@ +import React from 'react' +import {WeaTop, WeaTab, WeaTree, WeaDropMenu, WeaLocaleProvider} from 'ecCom'; +import {Row, Col, Menu, Dropdown, Icon, Button} from 'antd'; +import docxInfo from '../../util/docxInfo.js'; + +const SubMenu = Menu.SubMenu; +const getLabel = WeaLocaleProvider.getLabel; + +export default class Docx extends React.Component { + constructor(props) { + super(props); + this.state = { + version: '', + key: '', + selectedKey: '', + hash: '', + docxHeight: 0, + scrollWidth: 0, + } + this.resize.bind(this); + } + + componentDidMount() { + this.init(); + this.screenChange(); + + try{ + let docxHeight = Number(document.body.clientHeight) + Number(window.screenTop); + let docxWidth = Number(document.body.clientWidth) + Number(window.screenLeft); + document.getElementById('docx').style.height = docxHeight + 'px'; + document.getElementById('docx').style.width = window.screen.width + 'px'; + let topHeight = document.getElementsByClassName('wea-new-top')[0].clientHeight; + document.getElementById('leftPart').style.height = Number(document.body.clientHeight) - Number(topHeight) + 'px'; + let menuWidth = document.getElementsByClassName('wea-drop-menu')[0].clientWidth; + document.getElementById('rightPart').style.height = Number(docxHeight) - Number(topHeight) + 'px'; + let tabHeight = document.getElementsByClassName('wea-tab')[0].clientHeight + 2; + let scrollWidth = (Number(document.body.clientWidth) - Number(menuWidth)) * 0.98 + 'px'; + document.getElementById('srcIframe').style.height = Number(document.body.clientHeight) - Number(topHeight) - Number(tabHeight) + 'px'; + let height = Number(document.getElementsByClassName('wea-tree')[0].clientHeight) + 35 + 'px'; + document.getElementById('treePart').style.height = height + 'px'; + this.setState({ + docxHeight: docxHeight, + docxWidth: docxWidth, + scrollWidth: scrollWidth + }) + }catch(err) { + + } + } + + componentWillUnmount() { + window.removeEventListener('resize',this.resize); + } + +  screenChange() { +     window.addEventListener('resize', this.resize); +  } + + resize = () => { + try{ + document.getElementById('docx').style.height = this.state.docxHeight + 'px'; + document.getElementById('docx').style.width = window.screen.width + 'px'; + let topHeight = document.getElementsByClassName('wea-new-top')[0].clientHeight; + let menuWidth = document.getElementsByClassName('wea-drop-menu')[0].clientWidth; + document.getElementById('leftPart').style.height = Number(document.body.clientHeight) - Number(topHeight) + 'px'; + document.getElementById('rightPart').style.height = Number(this.state.docxHeight) - Number(topHeight) + 'px'; + let tabHeight = document.getElementsByClassName('wea-tab')[0].clientHeight + 2; + let scrollWidth = (Number(document.body.clientWidth) - Number(menuWidth)) * 0.98 + 'px'; + this.setState({ + scrollWidth: scrollWidth + }) + let height = Number(document.getElementsByClassName('wea-tree')[0].clientHeight) + 35 + 'px'; + document.getElementById('treePart').style.height = height + 'px'; + document.getElementById('srcIframe').style.height = Number(document.body.clientHeight) - Number(topHeight) - Number(tabHeight) + 'px'; + }catch(err) {} + } + + scrollToAnchor = (anchorName) => { + if (anchorName) { + let anchorElement = document.getElementById(anchorName); + if(anchorElement) { anchorElement.scrollIntoView(); } + } + } + + init = () => { + this.setState({ + version: 'e8', + showVersion: 'e-cology8.0', + key: 'datasource', + selectedKey: '1', + hash:'', + }) + } + + getMenu = (children) => { + return children.map(child => ( + child.children.length + ? this.handleClick(item)} + >{this.getMenu(child.children)} + : {child.title} + )) + } + + handleClick = (item) => { + item && item.key && this.setState({ + hash: `#${item.key}` + }) + } + + getTopDatas = () => { + let topDatas = []; + + docxInfo[this.state.version] && docxInfo[this.state.version].topTitle && docxInfo[this.state.version].topTitle.map(data => { + if(data && data[this.state.key]) { + data[this.state.key].length && data[this.state.key].map((ds, index) => { + let children = this.getMenu(ds.children) + let menu = ( this.handleClick(key)}>); + menu.props.children = children; + + topDatas.push({ + title: this.state.selectedKey == ds.key + ?
} trigger={['click']}> + + : ds.title, + viewcondition: ds.key + }) + }) + } + }) + return topDatas; + } + + getDatas = () => { + let datas = []; + + docxInfo[this.state.version] && docxInfo[this.state.version].leftTitle && docxInfo[this.state.version].leftTitle.map(title => { + title && datas.push({ + "canClick": true, // 标识节点是否可以点击 (单选 多选模式下生效) + "icon": "", // 图标展示 + "id": title.key, // 节点唯一标识,作为key值。 + "nodeid": title.key, // 节点唯一标识,作为key值(没设置的情况下取id)。 注意: 在单多选模式下,节点的id或者nodeid必须唯一(选中受控) + "isParent": false, // 父节点标识 + "name": title.showName, // 名称 + "dragDisabled": true, // 禁止节点拖拽 + }) + }) + return datas; + } + + handleSelect = (item) => { + item && this.setState({ + version: item.key, + showVersion: item.item.props.children + }) + } + + render() { + const dropMenuDatas = [{ + companyid: 'e8', + name: 'ecology8.0' + }, { + companyid: 'e9', + name: 'ecology9.0' + }] + + return (
+
+ } + iconBgcolor="#1a57a0" + buttons={[]} + showDropIcon={true} + dropMenuDatas={[]} + dropMenuProps={{ + collectParams: { + favname: getLabel('32269',"集成中心") + getLabel('275',"帮助") + getLabel('30041',"文档"), + favouritetype: 1, + objid: 0, + link: (window.ecologyContentPath || "") + "/spa/integration/static4engine/engine.html#/main/integration/docx", + importantlevel: 1 + } + }} + />
+ +
+
+ +
+ this.setState({key, selectedKey: '1'})} + /> + +
+
+ +
+
+ this.setState({selectedKey: v})} + /> +
+ +
+
+ + + ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/doubleInput.js b/pc4backstage/integration/components/doubleInput.js new file mode 100644 index 0000000..51bb933 --- /dev/null +++ b/pc4backstage/integration/components/doubleInput.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react'; +import {Row, Col} from "antd"; +import {WeaInput} from 'ecCom'; + +class Main extends Component { + constructor(props) { + super(props); + } + render() { + return ( +
+ + + + + + ); + } +} + +export default Main; \ No newline at end of file diff --git a/pc4backstage/integration/components/email/AddOrEdit.js b/pc4backstage/integration/components/email/AddOrEdit.js new file mode 100644 index 0000000..225c168 --- /dev/null +++ b/pc4backstage/integration/components/email/AddOrEdit.js @@ -0,0 +1,174 @@ +import React, { Component } from 'react'; +import {toJS} from "mobx"; +import {Button, Spin} from "antd"; +import {observer, inject} from "mobx-react"; +import {WeaDialog, WeaLocaleProvider, WeaRightMenu} from 'ecCom'; +import {getForm, onCheck, checkUnique, doConfirm} from '../../util/IntegrationUtil'; + +const {getLabel} = WeaLocaleProvider; + +@inject("alyMail") +@observer +class AddOrEdit extends Component { + + componentWillUnmount() { + const {alyMail} = this.props; + alyMail.closeDialog(); + } + + getButtons = () => { + const {status: {formLoading, buttonDisabled}} = this.props.alyMail; + return [ + , + , + , + ]; + } + + getRightMenus = () => { + const {status: {formLoading, buttonDisabled}} = this.props.alyMail; + return [{ + key: "BTN_SAVE", + icon: , + content: getLabel(30986, "保存"), + disabled: formLoading || buttonDisabled, + onClick: () => this.onMenuClick("BTN_SAVE"), + }, { + key: "BTN_TEST", + icon: , + content: getLabel(25496, "测试"), + disabled: formLoading || buttonDisabled, + onClick: () => this.onMenuClick("BTN_TEST"), + }, { + key: "BTN_INIT", + icon: , + content: getLabel(20873, "初始化"), + disabled: formLoading || buttonDisabled, + onClick: () => this.onMenuClick("BTN_INIT"), + }] + } + + handleMenuClick = (type) => { + const {alyMail} = this.props; + const {form, mailForm, getMailSaveOperation, getMailAddSetForm, status: {operateIndex}} = alyMail; + let params = {} + if(type === "BTN_TEST") { + params = {operate: "test", mailMasterId: operateIndex}; + }else if(type === "BTN_INIT") { + params = {operate: "init", mailMasterId: operateIndex}; + } else if ("BTN_SAVE" === type) { + params = {operate: "save", mailMasterId: operateIndex}; + } + let saveCallBack = (callback) => checkUnique({ + tableName: 'Mail_master', + fieldName: 'syscode', + fieldValue: form.getFormParams().syscode.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: operateIndex + }, form, "syscode", "2", operateIndex, callback); + onCheck(form, () => { + if(operateIndex == "") { + if("BTN_TEST" === type || "BTN_INIT" === type) { + onCheck(mailForm, () => { + saveCallBack(() => { + getMailSaveOperation({...params, operate: "save"}, (result) => { + alyMail.setState({operateIndex: result.maxId}); + getMailAddSetForm({mailMasterId: result.maxId}, () => getMailSaveOperation({...params, mailMasterId: result.maxId})); + }) + }) + }); + } else { + onCheck(mailForm, () => saveCallBack(() => getMailSaveOperation(params))); + } + }else { + if("BTN_TEST" === type || "BTN_INIT" === type) { + saveCallBack(() => { + getMailSaveOperation({...params, operate: "save"}, () => { + getMailAddSetForm({mailMasterId: operateIndex}, () => getMailSaveOperation(params)); + }) + }) + } else { + saveCallBack(() => getMailSaveOperation(params)); + } + } + }); + } + + onMenuClick = (type) => { + if("BTN_INIT" === type) { + doConfirm(getLabel('519656','确定要初始化吗?'), () => { + this.handleMenuClick(type); + }); + } else { + this.handleMenuClick(type); + } + } + + handleChange = (form, formParams, fields) => { + const {alyMail} = this.props; + const {status: {operateIndex}} = alyMail; + const key = fields.domkey[0]; + if(key === "mailtype") { + alyMail.getMailSelectSetForm(form.getFormParams()); + }else if(key === "syscode") { + const value = form.getFormParams()[key].replace(/^(\s*)|(\s*)$/g, ''); + if(value) { + checkUnique({ + tableName: 'Mail_master', + fieldName: 'syscode', + fieldValue: form.getFormParams()[key].replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: operateIndex + }, form, key, "2", operateIndex); + } + } + } + + otherDom = (form, fields) => { + const key = fields.domkey[0]; + if(key === "email163_pubkey") { + return + }else { + return null; + } + } + + render() { + const {alyMail} = this.props; + const {status: {baseDialogVisible, condition, operateIndex, formLoading, mailFormCondition, mailFormLoading, buttonDisabled}, form, mailForm} = alyMail; + return ( + + + + { + operateIndex + ? (!formLoading) && getForm(form, toJS(condition), true, this.handleChange, this.otherDom) + :
+ {(!formLoading) && getForm(form, toJS(condition), false, this.handleChange)} +
+ {(!mailFormLoading) && getForm(mailForm, toJS(mailFormCondition), false, null, this.otherDom)} +
+
+ } +
+
+
+ ); + } +} + +export default AddOrEdit; \ No newline at end of file diff --git a/pc4backstage/integration/components/email/Header.js b/pc4backstage/integration/components/email/Header.js new file mode 100644 index 0000000..c45a2db --- /dev/null +++ b/pc4backstage/integration/components/email/Header.js @@ -0,0 +1,405 @@ +import React, { Component } from 'react'; +import { + inject, + observer +} from 'mobx-react'; +import {toJS} from "mobx"; +import {WeaRightMenu, WeaTop, WeaTab, WeaLocaleProvider, WeaHelpfulTip, WeaFormItem, WeaSearchGroup} from "ecCom"; +import {Button, Spin} from "antd"; +import {WeaTableNew, WeaSwitch} from "comsMobx"; +import {getSearchBtns, getAdvancedItem} from '../../util/IntegrationUtil'; +import MainTable from "../login/MainTable"; +import isEmpty from 'lodash/isEmpty'; +import CronExp from '../../public/CronExp'; +import '../../style/email.less'; + +const {getLabel} = WeaLocaleProvider; +const {WeaTable} = WeaTableNew; + +@inject('intelogin') +@observer +export default class Header extends Component { + constructor(props) { + super(props); + this.state = { + tabDatas: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: getLabel('505949','集成列表'), + viewcondition: 0 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: getLabel(20960, "集成登录"), + viewcondition: 1 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: getLabel(125928, "同步日志"), + viewcondition: 2 + } + , { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: getLabel('516042','日志清理'), + viewcondition: 3 + } + ], + baseRightMenus: [{ + key: "BTN_NEW", + icon: , + content: getLabel('365','新建'), + type: "primary" + }, { + key: "BTN_DELETE", + icon: , + content: getLabel('32136','批量删除'), + type: "primary" + }], + logRightMenus: [{ + key: "BTN_INTERVAL_SAVE", + icon: , + content: getLabel(30986, "保存"), + type: "primary" + }], + showSearchAd: false, + selectedKey: "0" + } + } + + getBtns = () => { + const {selectedKey, baseRightMenus, logRightMenus} = this.state; + const { + intelogin, + initLoading, + } = this.props, { + menus + } = intelogin, { + outTopButtons=[] + } = menus; + let datas = []; + if(selectedKey == 1) { + return outTopButtons.map(item => + + ) + }else { + if(selectedKey == 0) { + datas = [...baseRightMenus]; + }else if(selectedKey == 2) { + datas = [...this.props.rightMenus]; + }else if(selectedKey == 3) { + datas = [...logRightMenus]; + } + return datas.map(item => + ); + } + }; + + getRightMenus = () => { + const {selectedKey, baseRightMenus, logRightMenus} = this.state; + const { + intelogin, + initLoading, + } = this.props, { + menus + } = intelogin, { + dropMenuDatas=[] + } = menus; + + if(selectedKey == 1) { + return dropMenuDatas.map(item => { + if(item.key === "BTN_NEW") { + return { + ...item, + disabled: item.disabled + } + }else { + return { + ...item, + onClick: () => item.onClick({typename: this.props.typename}) + }; + } + }) + }else { + let buttons = [], columnSet = { + key: "BTN_COLUMN", + icon: , + content: getLabel(32535, "显示列定制"), + onClick: () => this.onMenuClick("BTN_COLUMN") + }, logSet = { + key: "BTN_LOG", + icon: , + content: getLabel('83','日志'), + onClick: () => this.onMenuClick("BTN_LOG") + }; + if(selectedKey == 0) { + buttons = [...baseRightMenus]; + buttons.push(logSet); + buttons.push(columnSet); + }else if(selectedKey == 2) { + buttons = [...this.props.rightMenus]; + buttons.push(columnSet); + }else if(selectedKey == 3) { + buttons = [...logRightMenus]; + } + return buttons.map(item => { + return { + ...item, + disabled: this.props.buttonLoading || initLoading || (item.key === "BTN_DELETE" && toJS(this.props.tableStore.selectedRowKeys).length === 0), + onClick: () => this.onMenuClick(item.key) + } + }) + } + } + + onMenuClick = (type, record=null) => { + const {selectedKey} = this.state; + this.props.onMenuClick(selectedKey, type, record); + } + + getButtonAd = () => { + const { + intelogin, + } = this.props, { + mainTab, + } = intelogin, { + form, + } = mainTab; + let resetFun = () => this.state.selectedKey == 0 ? this.props.searchForm1.reset() : this.state.selectedKey == 1 ? form.reset() : this.props.searchForm.reset(); + let closeFun = () => this.setState({showSearchAd: false}); + return getSearchBtns(this.getSearchFun, resetFun, closeFun, this && this.props && this.props.ecId || '', "integrationIntemail"); + } + + getSearchFun = () => { + if(this.state.selectedKey == 1) { + const { + intelogin, + } = this.props; + intelogin.search({type: "mail"}); + } else { + this.props.onSearch(this.state.selectedKey); + } + this.setState({showSearchAd: false}); + } + + onOperatesClick = (record, index, operate) => { + this.onMenuClick(operate.index, record); + }; + + getColumnsInfo = (data) => { + const {selectedKey} = this.state; + if(selectedKey == 0) { + if(!isEmpty(data)) { + for(let index = 0; index < data.length; index++) { + if(data[index].dbField == "syscode") { + data[index].render = (text, record, index) => { + return ( this.onMenuClick("BTN_EDIT", record)}>{text}); + } + } else if(data[index].dataIndex === "mailicon") { + data[index].render = (text, record, index) => { + return record.mailtype == '1' + ?
+ : record.mailtype == '2' + ?
+ : null; + } + } else if(data[index].dataIndex === "isuse") { + data[index].render = (text, record, index) => { + return record.isuse == 0 ? getLabel('21888','未开启') : {getLabel('21889','已开启')}; + } + } else if(data[index].dataIndex === "issync") { + data[index].render = (text, record, index) => { + return record.issync == 0 ? getLabel('21888','未开启') : {getLabel('21889','已开启')}; + } + } + } + } + } + } + + // 日志清理 + getForm = (form, datas=[]) => { + const {isFormInit} = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && datas && datas.forEach((c, index) => { + let items = []; + c && c.items && c.items.forEach(fields => { + let dom = null, key = fields.domkey[0]; + if(key === "cleanCronExpr") { + dom = form.updateFields({cleanCronExpr: v.trim()})} + />; + } else{ + dom = ; + } + items.push({ + com: ( + + + {dom} + { + key === "cleanType" + ? + : null + } + + ), + colSpan: 1, + hide: form.isHide(fields, (keys, allParams) => { + let bool = false; + fields.domkey[0] != "cleanStatus" && allParams.cleanStatus != 1 && (bool=true); + fields && fields.showWhere && fields.showWhere.length > 0 && fields.showWhere.map(w => { + if(!bool){ + let show = false; + for(let val of w.value){ + if(allParams[w.domkey] == val){ + show = true; + break; + } + } + bool = !show; + } + }) + return bool; + }) + }); + }) + group.push() + }); + return group; + } + + render() { + const { + tabDatas, + showSearchAd, + selectedKey, + } = this.state, { + intelogin, + initLoading, + } = this.props, { + searchsAd, + mainTab, + } = intelogin, { + condition, + } = mainTab; + let advanceHeight = 72, + datas = selectedKey == 0 ? this.props.searchCondition1 : selectedKey == 1 ? condition : this.props.searchCondition, + form = selectedKey == 0 ? this.props.searchForm1 : selectedKey == 1 ? mainTab.form : this.props.searchForm, + searchKey = selectedKey == 1 ? 'name' : this.props.searchKey; + try{ + advanceHeight = Math.ceil(datas[0].items.length/2) * 72; + }catch(err){} + let hasAdSearch = selectedKey != 3; + return ( + +
+ } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenus()} + dropMenuProps={{ + collectParams: this.props.collectParams + }} + /> + form.updateFields({[searchKey]: value})} + onSearch={this.getSearchFun} + showSearchAd={showSearchAd} + setShowSearchAd={showSearchAd => this.setState({showSearchAd})} + hideSearchAd={() => this.setState({showSearchAd: false})} + onChange={v => { + this.setState({selectedKey: v}); + if(v == 1) { + mainTab.form.reset(); + } + if(this.props.onChange && typeof(this.props.onChange) === "function") { + this.props.onChange(v); + } + }} + /> + { + selectedKey == 3 + ?
+ {this.getForm(this.props.form, this.props.condition)} +
+ : selectedKey == 1 + ? this.props.buttonLoading + ? null + : + : + + + } +
+
+ ) + } +} diff --git a/pc4backstage/integration/components/email/index.js b/pc4backstage/integration/components/email/index.js new file mode 100644 index 0000000..4eb7f59 --- /dev/null +++ b/pc4backstage/integration/components/email/index.js @@ -0,0 +1,195 @@ +import React, { Component } from 'react'; +import {toJS} from "mobx"; +import {observer, inject} from "mobx-react"; +import {WeaLocaleProvider} from "ecCom"; +import {WeaForm, WeaLogView} from 'comsMobx'; +import Header from './Header'; +import {onCheck, doConfirm} from '../../util/IntegrationUtil'; +import AddOrEdit from './AddOrEdit'; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; + +const WeaLogViewComp = WeaLogView.Component; +const {getLabel} = WeaLocaleProvider; + +@inject("alyMail") +@observer +export default class alymail extends Component { + constructor(props) { + super(props); + this.state = { + targetId: "", + visible: false, + } + } + + componentDidMount() { + this.props.alyMail.doInit(); + } + + componentWillReceiveProps(nextProps) { + if(nextProps.location.key != this.props.location.key) { + this.props.alyMail.doInit(); + } + } + + handleChangeTab = (selectedKey) => { + const {alyMail} = this.props; + const {getMailCondition, getLogInfo, getMailList} = alyMail; + + if(selectedKey == 3) { + alyMail.getLogSettingFields(); + }else if(selectedKey == 2) { + getLogInfo(); + }else if(selectedKey == 0) { + getMailCondition(getMailList); + } + } + + onSearch = (selectedKey) => { + const {alyMail} = this.props; + const {searchForm, getLogDatas, getMailList, searchForm1} = alyMail; + + if(selectedKey == 2) { + getLogDatas(searchForm.getFormParams()); + }else if(selectedKey == 0) { + getMailList(searchForm1.getFormParams()); + } + } + + onMenuClick = (selectedKey, type="", record=null) => { + const {alyMail} = this.props; + const {tableStore, getMailAddSetForm, getMailSaveOperation, getMailSelectSetForm, getMailDeleteOperation, logSettingForm, saveLogSetting} = alyMail; + + if(type.toLocaleUpperCase() === "BTN_COLUMN") { + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + }else { + if(selectedKey == "0") { + let ids = record ? record.randomField0 : toJS(tableStore.selectedRowKeys); + if(type === "BTN_NEW") { + alyMail.setState({ + baseDialogVisible: true, + operateIndex: "", + formLoading: false, + buttonDisabled: false, + }); + alyMail.mailForm = new WeaForm(); + getMailAddSetForm({mailtype: 1}); + getMailSelectSetForm({mailtype: 1}); + }else if(["BTN_DELETE", "1"].includes(type)) { + let content = getLabel(385625, '确定要删除选择的记录吗?'); + if(record) { + content = getLabel(15097, '确定要删除吗?'); + } + doConfirm(content, getMailDeleteOperation, {operate: "delete", mailMasterIds: ids}); + }else if(["BTN_EDIT", "0"].includes(type)) { + alyMail.setState({ + baseDialogVisible: true, + operateIndex: ids, + formLoading: false, + buttonDisabled: false, + }); + getMailAddSetForm({mailMasterId: ids}); + }else if(type === "2") { + getMailSaveOperation({operate: "test", mailMasterId: ids}); + }else if(type === "3") { + let content = getLabel('519656','确定要初始化吗?'); + doConfirm(content, getMailSaveOperation, {operate: "init", mailMasterId: ids}); + }else if(type === "BTN_LOG" || type == "4") { + this.setState({ + visible: true, + targetId: record ? record.randomField0 : "", + }); + } + } else if(selectedKey == "3") { + if(type === "BTN_INTERVAL_SAVE") { + onCheck(logSettingForm, () => { + const formParams = logSettingForm.getFormParams(); + try{ + if(formParams.cleanType == "4") { + if(formParams.cleanCustomValue === undefined) { + logSettingForm.showError("cleanType", getLabel('516269','"日志记录" 未填写')); + }else { + saveLogSetting({ + ...formParams, + }); + } + }else { + saveLogSetting({ + ...formParams, + }); + } + }catch(err) {} + }) + } + } + } + } + + closeLogDialog = () => this.setState({visible: false, targetId: ""}); + + render() { + const {alyMail} = this.props; + const {logSettingForm, form, tableStore, searchForm, logStore, searchForm1, status: { + hasNonStandard, + nonStandLoading, + logSettingCondition, + buttonDisabled, + buttonLoading, + searchCondition, + buttons, + searchCondition1, + hasRightLoading, + hasRight, + baseDialogVisible, + }} = alyMail; + const {visible, targetId} = this.state; + return (nonStandLoading + ? null + : hasNonStandard + ? hasRightLoading + ? null + : hasRight + ?
+
this.handleChangeTab(v)} + /> + + +
+ : + : + ) + } +} diff --git a/pc4backstage/integration/components/homepage/index.js b/pc4backstage/integration/components/homepage/index.js new file mode 100644 index 0000000..2cd9c4d --- /dev/null +++ b/pc4backstage/integration/components/homepage/index.js @@ -0,0 +1,119 @@ +import React from 'react'; +import { inject, observer } from 'mobx-react'; +import { toJS } from 'mobx'; +import { + WeaLocaleProvider, + WeaTop, + WeaTab, + WeaSearchGroup, + WeaAppCenter, + WeaRightMenu, +} from 'ecCom'; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject('homepageStore','routing') +@observer +class IntegrationHomePage extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + const { homepageStore } = this.props; + homepageStore.getApps(); + } + + onClick = datas => { + // const { pathname, basename } = this.props.location; + // const hashname = pathname + basename; + // const urlHashIndex = hashname.indexOf('/integration/'); + + // if(urlHashIndex === -1) { + // return; + // } + + // if(urlHashIndex === 0) { + // weaHistory.push({ pathname: datas.routeUrl }); + // } else { + // const prefix = pathname.substr(0, urlHashIndex); + // weaHistory.push({ pathname: `${prefix}${datas.routeUrl}` }); + // } + + // console.log(this.props.location) + const { routing } = this.props; + window.doEngineThemeAction('onSubMenuClick', { infoId: datas.appid }) + datas.issingle == '0' ? routing.push(datas.routeUrl) : window.open(datas.routeUrl); + } + + render() { + const { homepageStore } = this.props; + const { + loading, + tabDatas, + selectedKey, + functionals, + products, + auth_center_server, + auth_center_client, + auth_center_other + } = homepageStore; + const collectParams = { + favname: getLabel(32269, '集成中心'), + favouritetype: 2, + objid: 0, + importantlevel: 1, + link: 'wui/engine.html#/main/integration/homepage', + }; + let datas = selectedKey == 0 ? toJS(functionals) : selectedKey == 1 ? toJS(products) : []; + return ( + } + iconBgcolor='#1a57a0' + loading={loading} + buttons={[]} + buttonSpace={10} + showDropIcon={true} + dropMenuProps={{ + collectParams: collectParams + }}> + + homepageStore.selectedKey = v} + /> + { + selectedKey == 2 + ?
+ +
+ 1} onClick={this.onClick} /> +
+
+ +
+ 1} onClick={this.onClick} /> +
+
+ +
+ 1} onClick={this.onClick} /> +
+
+
+ : +
+ +
+
+ } +
+
+ ); + } +} + +export default IntegrationHomePage; diff --git a/pc4backstage/integration/components/hrsync/LogList.js b/pc4backstage/integration/components/hrsync/LogList.js new file mode 100644 index 0000000..b7f2a8f --- /dev/null +++ b/pc4backstage/integration/components/hrsync/LogList.js @@ -0,0 +1,268 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import {WeaTableNew} from 'comsMobx'; +import {WeaDialog, WeaLocaleProvider, WeaTab, WeaRightMenu, WeaHelpfulTip} from 'ecCom'; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import uuid from "uuid"; + +const WeaTable = WeaTableNew.WeaTable; +const {getLabel} = WeaLocaleProvider; + +@inject("hrSyncStore") +@observer +export default class LogList extends React.Component { + state = { + selectedKey: 0, + showSearchAd: false, + key: '', + errorTipDialogVisible: false, + } + + // 列表重定义列 + getColumns = (columns) => { + let newColumns = ''; + + newColumns = columns && columns.map(column => { + let newColumn = column; + newColumn.render = (text, record, index) => { //前端元素转义 + let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex]; + return ( + newColumn && newColumn.dataIndex === 'synDetail' + ? this.handleOpenDetailDialog(record.synDetail)} dangerouslySetInnerHTML={{__html: valueSpan}}/> + :
+ ) + }; + return newColumn; + }); + return newColumns; + } + + handleOpenDetailDialog = (key) => { + const { hrSyncStore } = this.props; + const {getLogDetailList, getLogDetailListConditions, getLogTab} = hrSyncStore; + let type = 0; + // let type = dataSyncForm.getFormParams().type; + + this.setState({key}); + hrSyncStore.setState({detailDialogVisible: true}); + type != 0 ? getLogDetailListConditions({synId: key, synType: type}) : getLogDetailListConditions({synId: key, synType: type, synTypeTab: 1}); + type != 0 ? getLogDetailList({synId: key, synType: type}) : getLogDetailList({synId: key, synType: type, synTypeTab: 1}); + getLogTab({synId: key, synType: type}); + } + + // 同步日志的高级搜索框 + getSearchAd = () => { + const {hrSyncStore} = this.props; + const {detailSearchForm, status} = hrSyncStore; + const {detailSearchFormCondition} = toJS(status); + + return IntegrationUtil.getAdvancedItem( + detailSearchForm, + detailSearchFormCondition, + this.onEnterSearch, + false, + this && this.props && this.props.ecId || '', + "integrationHrSync", + ); + } + + onEnterSearch = () => { + const { hrSyncStore } = this.props; + const {detailSearchForm} = hrSyncStore; + const {key, selectedKey} = this.state; + let type = 0; + this.setState({ showSearchAd: false }); + type != 0 + ? hrSyncStore.getLogDetailList({...detailSearchForm.getFormParams(), synId: key, synType: type}) + : hrSyncStore.getLogDetailList({...detailSearchForm.getFormParams(), synId: key, synType: type, synTypeTab: Number(selectedKey) + 1}); + + } + + // 高级搜索上的按钮 + getTabButtonsAd = () => { + const { hrSyncStore } = this.props; + const {detailSearchForm} = hrSyncStore; + return IntegrationUtil.getSearchBtns( + this.onEnterSearch, + () => detailSearchForm.reset(), + () => this.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "integrationHrSync", + ); + } + + onSearch = (value) => { + const { hrSyncStore } = this.props; + const {detailSearchForm} = hrSyncStore; + const {key, selectedKey} = this.state; + let type = 0; + + detailSearchForm.updateFields({outpk: value}); + this.setState({ showSearchAd: false }); + type != 0 + ? hrSyncStore.getLogDetailList({outpk: value, synId: key, synType: type}) + : hrSyncStore.getLogDetailList({outpk: value, synId: key, synType: type, synTypeTab: Number(selectedKey) + 1}); + } + + handleChangeTab = (v) => { + const { hrSyncStore } = this.props; + const {getLogDetailList, getLogDetailListConditions, getLogTab} = hrSyncStore; + let type = 0; + // let type = dataSyncForm.getFormParams().type; + const {key} = this.state; + + this.setState({selectedKey: v, uid: uuid()}); + getLogDetailListConditions({synId: key, synType: type, synTypeTab: Number(v) + 1}); + getLogDetailList({synId: key, synType: type, synTypeTab: Number(v) + 1}); + } + + // 详细日志 + getDetailColumns = (columns) => { + let newColumns = ''; + let resultStatus = [getLabel('25009','失败') , getLabel('83326','插入成功') , getLabel('31439','更新成功'), getLabel('20461','删除成功') , getLabel('502844','封存成功'), getLabel('502845','解封成功'), getLabel('127354','警告')]; + + newColumns = columns && columns.map(column => { + let newColumn = column; + newColumn.render = (text, record, index) => { //前端元素转义 + let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex]; + let title = ''; + if(newColumn && newColumn.dataIndex === 'synState') { + if([0, 6].indexOf(Number(record.synState)) != -1) { + title = record.error.includes('#') ? getLabel(record.error.split('#')[0].trim(), '') : record.error; + } + } + return ( + newColumn && newColumn.dataIndex === 'synState' + ? ([0, 6].indexOf(Number(record.synState)) != -1 ? this.handleOpenErrorTip(record.randomFieldId, record.error)} dangerouslySetInnerHTML={{__html: resultStatus[Number(record.synState)]}}/> + + + :
) + :
+ ) + }; + return newColumn; + }); + return newColumns; + } + + handleOpenErrorTip = (key, error) => { + this.props.hrSyncStore.getRealError({error: key}); + } + + render() { + const { hrSyncStore } = this.props; + const {logTableStore, status, logDetailTableStore, detailSearchForm} = hrSyncStore; + const {detailDialogVisible, detailDialogTab, errorInfo, errorTipDialogVisible} = toJS(status); + const {selectedKey, showSearchAd} = this.state; + + return ( +
+ + {hrSyncStore.setState({detailDialogVisible: false}), this.setState({ + selectedKey: 0, + showSearchAd: false, + key: '', + errorTipDialogVisible: false + })}} + title={getLabel(501519, '同步详情')} + style={{width: 900, height:700}} + hasScroll + buttons={[]} + moreBtn={{ + datas: [], + collectParams: [{ + favname: `${getLabel(33719, "HR同步")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/hrsync", + importantlevel: 1 + }] + }} + > + + { + this.setState({ + showSearchAd: bool + }) + }} + onChange={v => this.handleChangeTab(v)} + onSearch={this.onSearch} + onSearchChange={value => detailSearchForm.updateFields({outpk: value})} + searchsBaseValue={detailSearchForm.getFormParams().outpk} + /> + + + + this.props.hrSyncStore.setState({errorTipDialogVisible: false, errorInfo: ''})} + title={getLabel('22045','详情')} + style={{width: 400, height:200}} + hasScroll + buttons={[]} + moreBtn={{ + datas: [], + collectParams: [{ + favname: `${getLabel(33719, "HR同步")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/hrsync", + importantlevel: 1 + }] + }} + > + +
+
+
+ + +
+ ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/hrsync/index.js b/pc4backstage/integration/components/hrsync/index.js new file mode 100644 index 0000000..3dc2681 --- /dev/null +++ b/pc4backstage/integration/components/hrsync/index.js @@ -0,0 +1,959 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import NoRight from "../../public/NoRight"; +import NonStand from "../../public/NonStand"; +import { Button, Modal, Icon, message, } from "antd"; +import { WeaUpload, WeaTable, WeaDialog, WeaTableEditable, WeaTools, WeaHelpfulTip, WeaLocaleProvider, WeaRightMenu, WeaTab, WeaTop, WeaFormItem, WeaSearchGroup, WeaNewScroll } from "ecCom"; +import { WeaSwitch, WeaForm } from "comsMobx"; +import SyncSetFields from "./partial/SyncSetFields"; +import LogList from './LogList'; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import "./style/index.less" + +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("hrSyncStore") +@observer +class HrSync extends React.Component { + constructor(props) { + super(props); + this.state = { + syncTableTab: "0", + hasSyncClick: false, + file: [], + filelist: [], + sync: true, + topTab: [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(32783, "集成设置")}`, + viewcondition: 0 + }, + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(82923, "数据同步")}`, + viewcondition: 1 + }, + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: `${getLabel(125928, "同步日志")}`, + viewcondition: 2 + } + ] + } + } + + componentDidMount() { + const { hrSyncStore } = this.props; + hrSyncStore.setState({selectedKey: 0}); + hrSyncStore.doInit(); + } + + componentWillReceiveProps(nextProps) { + const { hrSyncStore } = this.props; + if (this.props.location.key !== nextProps.location.key) { + hrSyncStore.setState({selectedKey: 0}); + hrSyncStore.doInit(); + } + } + + getFormSearchs = (form, datas, needTigger = true, lableCol, fieldcol) => { + const { isFormInit } = form; + const { hrSyncStore } = this.props; + const {getHrSyncSettingsOperation, status, webserviceParamValuesData, setWebserviceParamValuesData} = hrSyncStore; + const { WeaTableEdit_WebserviceParameterSet, } = toJS(status); + let group = []; + let className=""; + const formParams = form.getFormParams(); + isFormInit && datas && datas.map((c, index) => { + // render webService WeaTab 同步接口方法 + const { intetype } = form.getFormParams(); + if ([2].includes(index) && intetype === "2") { + const tabs = c.items.map((item, index) => { + return { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: item.label, + viewcondition: index + }; + }) + // webService WeaTab + group.push(
+ this.setState({ syncTableTab: v })} + /> +
) + } + // render 基本信息 同步表设置 同步对应字段设置方法 + let center = true; + if (index === 1) { + center = false; + } + let items = []; + // condition + c.items.map((fields, cIndex) => { + let onChange = (e) => { }; + // 同步表设置 + // subcomtable depttable jobtable hrmtable + + if (["subcomouternew"].includes(getKey(fields))) { + className="hr-syn-table-setting"; + fields.dataParams = { + mouldID: "integration", callSource: "hrsetting", + dmltablename: formParams["subcomtable"], + datasourceid: formParams["dbsource"], + } + } + if (["deptouternew"].includes(getKey(fields))) { + className="hrsync-tablesetting"; + fields.dataParams = { + mouldID: "integration", callSource: "hrsetting", + dmltablename: formParams["depttable"], + datasourceid: formParams["dbsource"] + } + } + if (["jobouternew"].includes(getKey(fields))) { + className="hrsync-tablesetting"; + fields.dataParams = { + mouldID: "integration", callSource: "hrsetting", + dmltablename: formParams["jobtable"], + datasourceid: formParams["dbsource"] + } + } + if (["hrmouternew"].includes(getKey(fields))) { + className="hrsync-tablesetting"; + fields.dataParams = { + mouldID: "integration", callSource: "hrsetting", + dmltablename: formParams["hrmtable"], + datasourceid: formParams["dbsource"] + } + } + + // WEBSERVICE地址 select onchange + if (getKey(fields) === "webserviceurl") { + onChange = (e) => { + getHrSyncSettingsOperation({ operation: "getregisteinfo", webserviceurl: e.webserviceurl.value }, res => { + // update fields + // subcommothod deptmothod jobmothod hrmmethod + status.newFormFields[2].items.forEach(item => { + item.options = res.webserviceMethodsList; + }) + }); + // 清空接口方法 + form.updateFields({ + subcommothod: "", + deptmothod: "", + jobmothod: "", + hrmmethod: "" + }) + // 清空接口方法对应的数据 + webserviceParamValuesData.subWebserviceParamValuesData = []; + webserviceParamValuesData.deptWebserviceParamValuesData = []; + webserviceParamValuesData.jobWebserviceParamValuesData = []; + webserviceParamValuesData.hrmWebserviceParamValuesData = []; + } + // 同步接口方法 + } else if (["subcommothod", "deptmothod", "jobmothod", "hrmmethod"].includes(getKey(fields))) { + onChange = (e) => { + getHrSyncSettingsOperation({ operation: "getmethodinfo", methodid: e[Object.keys(e)[0]]["value"] }, res => { + const { webserviceParamValuesData } = hrSyncStore; + setWebserviceParamValuesData(this.state.syncTableTab, res.WebserviceMethodParameterDatas); + }); + } + } else if (["syncmethodHz"].includes(getKey(fields))) { + fields.otherParams = { + valueIsObject: true + } + } + items.push({ + com: ( + + + + {getKey(fields) === 'defaultPwd' && } + + ), + col: 2, + hide: form.isHide(fields, (keys, allParams) => { + switch (getKey(fields)) { + // 集成方式 数据库 + case "dbsource": + return allParams["intetype"] !== "1"; + // 集成方式 接口方式 + case "webserviceurl": + return allParams["intetype"] !== "2"; + // 集成方式 自定义 + case "custominterface": + return allParams["intetype"] !== "3"; + case "defaultPwd": + case "pwdsynctype": + case "issynrtx": + return allParams["intetype"] === "3"; + case "subcommothod": + return this.state.syncTableTab !== "0"; + case "deptmothod": + return this.state.syncTableTab !== "1"; + case "jobmothod": + return this.state.syncTableTab !== "2"; + case "hrmmethod": + return this.state.syncTableTab !== "3"; + case "syncmethodHz": + return allParams["hrmethod"] === '1'; + } + return false; + }) + }) + }); + let title = ""; + if (needTigger) { + const intetype = form.getFormParams().intetype; + // 集成方式 数据库 + if (intetype === "1" && [2].includes(index)) { + title = ""; + items = []; + } else if (intetype === "2" && [1].includes(index)) { + // 集成方式 接口方式 + title = ""; + items = []; + } else if (intetype === "3" && index !== 0) { + // 集成方式 自定义方式 + title = ""; + items = []; + } else { + title = c.title; + } + // remove 同步接口方法 title + if ([2].includes(index)) { + needTigger = false; + title = ""; + } + group.push() + } else { + group.push() + } + + // WEBSERVICE 明细表 table + if ([2].includes(index) && intetype === "2") { + const whichData = [ + webserviceParamValuesData.subWebserviceParamValuesData, + webserviceParamValuesData.deptWebserviceParamValuesData, + webserviceParamValuesData.jobWebserviceParamValuesData, + webserviceParamValuesData.hrmWebserviceParamValuesData, + ]; + group.push( +
+ { + return false; + }} + showTitle={false} + tableProps={{ + showEmptyText: false, + scroll: { x: "100%" } + }} + datas={toJS(whichData[this.state.syncTableTab])} + columns={WeaTableEdit_WebserviceParameterSet} + onChange={(datas) => { + switch (Number(this.state.syncTableTab)) { + case 0: + webserviceParamValuesData.subWebserviceParamValuesData = datas; + break; + case 1: + webserviceParamValuesData.deptWebserviceParamValuesData = datas; + break; + case 2: + webserviceParamValuesData.jobWebserviceParamValuesData = datas; + break; + case 3: + webserviceParamValuesData.hrmWebserviceParamValuesData = datas; + break; + } + }} + /> +
+ ) + } + }); + return group; + } + + + // 同步日志的高级搜索框 + getSearchAd = () => { + const {hrSyncStore} = this.props; + const {logSearchForm, status} = hrSyncStore; + const {logSearchFormCondition} = toJS(status); + + return IntegrationUtil.getAdvancedItem(logSearchForm, logSearchFormCondition, this.searchFun, false, this && this.props && this.props.ecId || '', "integrationHrSyncIndex"); + } + + searchFun = () => { + const { hrSyncStore } = this.props; + const {logSearchForm} = hrSyncStore; + hrSyncStore.getLogList(logSearchForm.getFormParams()); + hrSyncStore.setState({ showSearchAd: false }); + }; + + getTabButtonsAd() { + const { hrSyncStore } = this.props; + const {logSearchForm} = hrSyncStore; + let resetFun = () => logSearchForm.reset(); + let cancelFun = () => hrSyncStore.setState({showSearchAd: false}); + + return IntegrationUtil.getSearchBtns(this.searchFun, resetFun, cancelFun, this && this.props && this.props.ecId || '', "integrationHrSyncIndex"); + } + + /** + * 获取右键菜单 + * @returns {Array} + */ + getRightMenu() { + const { hrSyncStore } = this.props; + const {newForm, initialNewForm} = hrSyncStore; + const { selectedKey, rightMenus, rightMenusTab2, rowSelectIds, canexport, syncFlag, saveDisabled } = toJS(hrSyncStore.status); + const whichRightMenu = Number(selectedKey) === 0 ? rightMenus : Number(selectedKey) === 1 ? rightMenusTab2 : ''; + + let btnArr = []; + whichRightMenu && whichRightMenu.map(m => { + let btn = { + key: m.type, + icon: , + content: m.menuName, + onClick: () => this.onRightMenuClick(m.type) + }; + if (m.type == "BTN_EXP") { + if (!canexport) { + btn.disabled = true; + } else { + btn.disabled = false; + } + }else if(m.type == 'BTN_EXPDATA') { + btn.disabled = !this.state.hasSyncClick; + }else if(m.type == 'BTN_SYNC') { + btn.disabled = syncFlag; + }else if(m.type === "BTN_SAVE") { + btn.disabled = saveDisabled; + } + if (!(m.menuIcon === 'icon-coms-delete' && rowSelectIds.length === 0)) { + btnArr.push(btn); + } + }); + if (selectedKey === "1") { + if (initialNewForm.getFormParams()["isuselhr"] === "0"){ + return []; + } + if (initialNewForm.getFormParams()["hrmethod"] === "2") { + return []; + } + if(this.state.sync == false) { + return []; + } + } + + if(selectedKey === '2') { + // 添加列定制 + btnArr.push({ + key: "BTN_COLUMN", + icon: , + content: `${getLabel(32535, "显示列定制")}`, + onClick: () => this.onRightMenuClick("BTN_COLUMN") + }); + } + + return btnArr; + } + + getRightMenu2() { + const { hrSyncStore } = this.props; + const { importForm, getHrSyncSettingsOperation } = hrSyncStore; + const { selectedKey, rightMenus, rightMenusTab2, rowSelectIds } = toJS( + hrSyncStore.status + ); + let btnArr = []; + var btn = { + key: 'aaa', + icon: , + content: getLabel("725", "提交"), + onClick: () => { + this.doImport(); + } + }; + btnArr.push(btn); + + return btnArr; + } + + doImport() { + const { hrSyncStore } = this.props; + const { importForm, getHrSyncSettingsOperation } = hrSyncStore; + const { selectedKey, rightMenus, rightMenusTab2, rowSelectIds } = toJS( + hrSyncStore.status + ); + let params = Object.assign({ operation: "import" }, importForm.getFormParams()); + params.file = JSON.stringify(this.state.file); + params.filelist = JSON.stringify(this.state.filelist); + IntegrationUtil.onCheck(importForm, () => { + getHrSyncSettingsOperation(params, () => { + hrSyncStore.setState({ showImportForm: false }); + hrSyncStore.doInit(); + this.setState({filelist:[]}); + }) + }) + } + + /** + * 右键菜单点击事件 + * @param type + */ + getAllPrams = () => { + const { hrSyncStore } = this.props; + const { newForm, SyncSetTable, webserviceParamValuesData } = hrSyncStore; + const params = newForm.getFormParams(); + // 明细表数据 + // webservice 明细表 + const { + subWebserviceParamValuesData, + deptWebserviceParamValuesData, + jobWebserviceParamValuesData, + hrmWebserviceParamValuesData + } = toJS(webserviceParamValuesData); + const { + WeaTableEdit_subSyncFieldData, + WeaTableEdit_deptSyncFieldData, + WeaTableEdit_jobSyncFieldData, + WeaTableEdit_hrmSyncFieldData } = toJS(SyncSetTable); + + const New_WeaTableEdit_jobSyncFieldData = ((params.intetype == 1 && params.jobtable == '') || (params.intetype == 2 && params.jobmothod == "")) ? [] : WeaTableEdit_jobSyncFieldData; + const allParams = { + ...params, + isUnique: true, + subWebserviceParamValuesData: JSON.stringify(subWebserviceParamValuesData), + deptWebserviceParamValuesData: JSON.stringify(deptWebserviceParamValuesData), + jobWebserviceParamValuesData: JSON.stringify(jobWebserviceParamValuesData), + hrmWebserviceParamValuesData: JSON.stringify(hrmWebserviceParamValuesData), + WeaTableEdit_subSyncFieldData: JSON.stringify(WeaTableEdit_subSyncFieldData), + WeaTableEdit_deptSyncFieldData: JSON.stringify(WeaTableEdit_deptSyncFieldData), + WeaTableEdit_jobSyncFieldData: JSON.stringify(New_WeaTableEdit_jobSyncFieldData), + WeaTableEdit_hrmSyncFieldData: JSON.stringify(WeaTableEdit_hrmSyncFieldData) + }; + + [WeaTableEdit_subSyncFieldData, WeaTableEdit_deptSyncFieldData, New_WeaTableEdit_jobSyncFieldData, WeaTableEdit_hrmSyncFieldData].map(datas => { + let allConfig = ''; + + datas && datas.map(data => { + if (allConfig.indexOf(`(#@#)${data.oafieldspan}(#@#)`) < 0) { + allConfig += `(#@#)${data.oafieldspan}(#@#)`; + } else { + Modal.warning({ + title: getLabel("15172", "系统提示"), + content: getLabel('389520',"存在重复属性,请检查") + }) + allParams.isUnique = false; + return + } + }) + }) + + const WebserviceParamValuesData = [] + .concat(subWebserviceParamValuesData.map(item => ({ methodtype: 1, ...item }))) + .concat(deptWebserviceParamValuesData.map(item => ({ methodtype: 2, ...item }))) + .concat(jobWebserviceParamValuesData.map(item => ({ methodtype: 3, ...item }))) + .concat(hrmWebserviceParamValuesData.map(item => ({ methodtype: 4, ...item }))); + const syncFieldData = [] + .concat(WeaTableEdit_subSyncFieldData.map(item => ({ type: 1, ...item }))) + .concat(WeaTableEdit_deptSyncFieldData.map(item => ({ type: 2, ...item }))) + .concat(New_WeaTableEdit_jobSyncFieldData.map(item => ({ type: 3, ...item }))) + .concat(WeaTableEdit_hrmSyncFieldData.map(item => ({ type: 4, ...item }))) + allParams.WebserviceParamValuesData = JSON.stringify(WebserviceParamValuesData); + allParams.syncFieldData = JSON.stringify(syncFieldData); + return allParams; + } + + onRightMenuClick = (type, recordId) => { + const { hrSyncStore } = this.props; + const { + newForm, + dataSyncForm, + getHrSyncDataSyncOperation, + getHrSyncSettingsOperation, updateSyncData, logTableStore, status } = hrSyncStore; + switch (type) { + case "BTN_SAVE": + const allParams = this.getAllPrams(); + if((allParams.intetype == 2) && allParams.jobmothod) { + if(JSON.parse(allParams.WeaTableEdit_jobSyncFieldData).length == 0) { + Modal.warning({ + title: getLabel("15172", "系统提示"), + content: getLabel("32256", "岗位表必须有一个关键匹配标识字段,请选择") + }) + return; + }else { + let WeaTableEdit_jobSyncFieldData = JSON.parse(allParams.WeaTableEdit_jobSyncFieldData); + let keyIndex = WeaTableEdit_jobSyncFieldData.findIndex(data => data.iskeyfield == 1) + if(keyIndex == -1) { + Modal.warning({ + title: getLabel("15172", "系统提示"), + content: getLabel("32256", "岗位表必须有一个关键匹配标识字段,请选择") + }) + return; + } + } + } + if(allParams.isUnique) { + IntegrationUtil.onCheck(newForm, () => { + const result = hrSyncStore.syncSetField.table && hrSyncStore.syncSetField.table.doValidate(); + if (result && (!result.pass)) { + return; + } + // first validate + allParams.checkBeforeSave = true; + getHrSyncSettingsOperation(allParams, (result) => { + if (result && !result.error) { + // and save + delete allParams.checkBeforeSave; + getHrSyncSettingsOperation(allParams, () => { + if(result.ret == true) { + message.success(getLabel(22619, '保存成功')); + hrSyncStore.getHrSyncSettingsForm(); + hrSyncStore.getRightMenu(); + hrSyncStore.getHrSyncSettingsImportForm(); + } + }); + } else { + return; + } + }) + }) + } + break; + case "BTN_EXP": + // 集成设置导出 + const expAllParams = this.getAllPrams(); + Modal.confirm({ + title: getLabel("131329", "信息确认"), + content: getLabel("386087", "同步设置将以sql脚本文件的形式导出,确定要导出吗?"), + onOk: () => { + alert("The inteface named getHrSyncSettingsSqlFile is deleted!"); + /*getHrSyncSettingsOperation({ operation: "export", ...expAllParams }, (result) => { + window.location.href = (window.ecologyContentPath || "") + "/api/integration/hrsync/getHrSyncSettingsSqlFile"; + });*/ + }, + onCancel: () => { } + }) + break + case "BTN_IMP": + // 集成设置导入 + //status.showImportForm = true; + break; + case "BTN_SYNC": + const syncparams = dataSyncForm.getFormParams(); + getHrSyncDataSyncOperation(syncparams, (res) => { + this.setState({ hasSyncClick: true }); + updateSyncData(res); + }); + break; + case "BTN_EXPDATA": + window.location.href = (window.ecologyContentPath || "") + "/weaver/weaver.file.ExcelOut"; + break; + case "BTN_COLUMN": + logTableStore.setColSetVisible(true); + logTableStore.tableColSet(true); + } + }; + + /** + * 获取顶部按钮 + * @returns {Array} + */ + getBtns = () => { + const { hrSyncStore } = this.props; + const { status, newForm, initialNewForm } = hrSyncStore; + const { selectedKey, rightMenus, rightMenusTab2, rowSelectIds, loading, syncLoading, canexport, syncFlag, saveDisabled } = toJS(status); + let btnArr = []; + const whichRightMenu = Number(selectedKey) === 0 ? rightMenus : Number(selectedKey) === 1 ? rightMenusTab2 : []; + if (whichRightMenu) { + for (let j = 0; j < whichRightMenu.length; j++) { + if (j == 3) { + break + } + let m = whichRightMenu[j]; + let btn = null; + if (m.type === "BTN_EXPDATA") { + btn = ; + }else if(m.type === "BTN_SAVE") { + btn = ; + } else { + btn = + ; + } + btnArr.push(btn); + } + } + + // 未启用 数据同步隐藏按钮 + if (selectedKey === "1") { + if (initialNewForm.getFormParams()["isuselhr"] === "0"){ + return []; + } + if (initialNewForm.getFormParams()["hrmethod"] === "2") { + return []; + } + } + return btnArr; + }; + + getDialogBtns = () => { + return [ + ( + + ) + ] + } + + getDataSyncDescription = (form, condition=[]) => { + const {isFormInit} = form; + const formParams = form.getFormParams(); + let group = []; + + isFormInit && condition && condition.map((c, index) => { + let items = []; + c.items.map(fields => { + items.push({ + com: (
+ + + {fields.showOtherCom && otherCom} +
), + colSpan: 1 + }) + }); + group.push() + }) + + return group; + } + + handleChangeTab = (v) => { + const {hrSyncStore} = this.props; + const {initialNewForm, getLogList} = hrSyncStore; + const formParams = initialNewForm.getFormParams(); + + if(v == 1) { + this.setState({hasSyncClick: false, sync: true}); + let content = formParams["isuselhr"] === "0" ? getLabel("386893", "HR同步未启用!") + : formParams["hrmethod"] === "2" ? getLabel("32326", "未启用HR同步手动同步!") : ''; + + if (formParams["isuselhr"] === "0" || formParams["hrmethod"] === "2") { + this.setState({sync: false}); + hrSyncStore.setState({selectedKey: v}); + Modal.warning({ + title: getLabel("15172", "系统提示"), + content: content + }) + return; + } + // 刷新页面 + hrSyncStore.getHrSyncDataSyncForm(); + hrSyncStore.getHrSyncDataSyncRightMenu(); + }else if(v == 0) { + hrSyncStore.newForm = new WeaForm(); + hrSyncStore.initialNewForm = new WeaForm(); + hrSyncStore.getHrSyncSettingsForm(); + hrSyncStore.getRightMenu(); + hrSyncStore.getHrSyncSettingsImportForm(); + }else if(v == 2) { + hrSyncStore.getListConditions(); + getLogList(); + } + hrSyncStore.setState({selectedKey: v}); + } + + render() { + const { hrSyncStore } = this.props; + const { + status, + newForm, + dataSyncForm, + importForm, + syncTable, + hasRight, + rightLoading, + } = hrSyncStore; + const { + syncFieldRelationShipSummaryLabel, + showSearchAd, + newFormFields, + dataSyncFormFields, + selectedKey, + syncLoading, + advanceHeight, + showImportForm, + hasNonStandard, + nonStandLoading, + } = toJS(status); + const { + jobSyncResultHeaderList, + jobSyncResultDataList, + jobTypeSyncResultHeaderList, + jobTypeSyncResultDataList, + deptSyncResultHeaderList, + deptSyncResultDataList, + subSyncResultHeaderList, + subSyncResultDataList, + gwSyncResultHeaderList, + gwSyncResultDataList, + hrmSyncResultHeaderList, + hrmSyncResultDataList, + hqSyncResultHeaderList, + hqSyncResultDataList, + lastLineSyncResultDataList, + } = toJS(syncTable); + const {topTab} = this.state; + return (nonStandLoading + ? null + : hasNonStandard + ? rightLoading + ? null + : hasRight + ? + } + iconBgcolor="#1a57a0" + buttons={this.getBtns()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{ + collectParams: { + favname: `${getLabel(33719, "HR同步")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/hrsync", + importantlevel: 1 + } + }} + /> + + hrSyncStore.setState({ showSearchAd: !showSearchAd }) + } + hideSearchAd={() => + hrSyncStore.setState({ showSearchAd: false }) + } + onChange={this.handleChangeTab} + onSearch={() => hrSyncStore.getDataShowList()} + onSearchChange={value => { + }} + /> + { + Number(selectedKey) === 2 + ? + : + { + Number(selectedKey) === 0 + ? ( + // 集成设置 +
+ {/* 基本信息 */} + {this.getFormSearchs(newForm, newFormFields)} + {/* 同步对应字段设置方法 */} + {newForm.getFormParams()["intetype"] !== "3" && ( +
+ + {/* 说明 */} + { + return `${syncFieldRelationShipSummaryLabel[item]}
`; + }).join('') + }} /> + }]} + /> +
+ )} + + { + status.showImportForm = false; + }} + buttons={this.getDialogBtns()} + moreBtn={{ + datas: this.getRightMenu2(), + collectParams: { + favname: getLabel("32935", "导入"), + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/hrsync", + importantlevel: 1 + } + }} + > + + {importForm.render({ col: 1 }, { + onChange: () => { } + }, true, (item, index) => { + switch (Number(index)) { + case 0: + return +
+ +
+ { this.setState({ file: ids, filelist: list }) }} + > + + +
+
+ {this.state.filelist.length == 0 ?

{getLabel("384040", "未选择任何文件")}

: this.state.filelist.map(file =>

{file.filename}

)} +
+
+
+
+ case 1: + return {item.items[0].value}
+ }]} + /> + } + })} +
+
+
+ ) + : ( + // 数据同步 +
+ {IntegrationUtil.getFormSearchs(dataSyncForm, [dataSyncFormFields[0]], true, true, "", "", null, this && this.props && this.props.ecId || '', "integrationHrSyncIndex")} + {syncLoading && ( +
+ + {getLabel('386883', '正在同步,请不要离开该页面,请稍后…')} +
+ )} + {!syncLoading && this.state.hasSyncClick && ( + +
+ {subSyncResultDataList.length > 0 && } + {jobSyncResultDataList.length > 0 && } + {jobTypeSyncResultDataList.length > 0 && } + {deptSyncResultDataList.length > 0 && } + {gwSyncResultDataList.length > 0 && } + {hrmSyncResultDataList.length > 0 && } + {hqSyncResultDataList.length > 0 && } + {lastLineSyncResultDataList.length > 0 && lastLineSyncResultDataList[0].lastLine} +
+
+ )} + {!syncLoading && (!this.state.hasSyncClick) && this.getDataSyncDescription(dataSyncForm, [dataSyncFormFields[2]])} +
+ ) + } + + } + + : + : + ); + } +} + +export default HrSync; diff --git a/pc4backstage/integration/components/hrsync/partial/SyncSetFields.js b/pc4backstage/integration/components/hrsync/partial/SyncSetFields.js new file mode 100644 index 0000000..8701da7 --- /dev/null +++ b/pc4backstage/integration/components/hrsync/partial/SyncSetFields.js @@ -0,0 +1,164 @@ + +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { Modal } from "antd"; +import { WeaTableEditable, WeaLocaleProvider, WeaTab, WeaButtonIcon} from "ecCom"; + +const { confirm } = Modal; +const getLabel = WeaLocaleProvider.getLabel; + +// 为了排序 所以写死, 因为是字段名,变了也要改代码,所以无妨 +const syncFileds = ['sub', 'dept', 'job', 'hrm']; + +@inject("hrSyncStore") +@observer +class SyncSetFields extends React.Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "0", + selectedRowDatas:[], + selectedRowKeys: [] + } + } + + getSyncTableEdit = () => { + const { hrSyncStore } = this.props; + const { newForm, SyncSetTable, setSyncSetTable } = hrSyncStore; + const + { WeaTableEdit_subSyncFieldSet, + WeaTableEdit_subSyncFieldData, + WeaTableEdit_hrmSyncFieldSet, + WeaTableEdit_hrmSyncFieldData, + WeaTableEdit_deptSyncFieldSet, + WeaTableEdit_deptSyncFieldData, + WeaTableEdit_jobSyncFieldSet, + WeaTableEdit_jobSyncFieldData, } = toJS(SyncSetTable); + const whichFields = [WeaTableEdit_subSyncFieldSet, WeaTableEdit_deptSyncFieldSet, WeaTableEdit_jobSyncFieldSet, WeaTableEdit_hrmSyncFieldSet]; + const whichDatas = [WeaTableEdit_subSyncFieldData, WeaTableEdit_deptSyncFieldData, WeaTableEdit_jobSyncFieldData, WeaTableEdit_hrmSyncFieldData]; + const params = newForm.getFormParams(); + const whichFather = [params.subcomtable, params.depttable, params.jobtable, params.hrmtable]; + if (whichFields[this.state.selectedKey] && whichFields[this.state.selectedKey][1]) { + if (newForm.getFormParams().intetype === "1") { + whichFields[this.state.selectedKey][1].com[0].browserConditionParam.dataParams = { + datasourceid: params.dbsource, + dmltablename: whichFather[this.state.selectedKey] + } + } else { + whichFields[this.state.selectedKey][1].com[0].type = "INPUT"; + } + } + return ( +
+ { hrSyncStore.syncSetField.table = el }} + rowKey="id" + tableProps={{ + showEmptyText: false, + scroll: {x: "100%"} + }} + showTitle={false} + // showCopy={false} + showAdd={false} + showDelete={false} + showCopy={false} + willDelete={this.willDelete} + selectedRowKeys={this.state.selectedRowKeys} + datas={whichDatas[this.state.selectedKey]} + columns={whichFields[this.state.selectedKey]} + onChange={(datas) => { + setSyncSetTable(this.state.selectedKey, datas) + }} + onRowSelect={v => { + this.setState({selectedRowDatas:v, selectedRowKeys: v}) + }} + validator={{ + rules: { + oafield: 'required', + outfield: 'required', + } + }} + /> +
+ ) + } + + willDelete = (datas, keys) => new Promise((resolve, reject) => { + confirm({ + content: `${getLabel(385625, '确定要删除选择的记录吗?')}`, + onOk: () => resolve(true), + onCancel: () => resolve(false) + }) + }) + + getBtn = () => { + const { hrSyncStore } = this.props; + let btnArr = []; + + btnArr.push( + {hrSyncStore.syncSetField.table.doAdd();}} buttonType='add' type="primary" />, + ); + + if(this.state.selectedKey == 0) { + btnArr.push([ + {hrSyncStore.syncSetField.table.doDelete();}} buttonType='del' type="primary" disabled={this.state.selectedRowDatas.length == 0 ? true : false} /> + ]); + }else if(this.state.selectedKey == 1) { + btnArr.push([ + {hrSyncStore.syncSetField.table.doDelete();}} buttonType='del' type="primary" disabled={this.state.selectedRowDatas.length == 0 ? true : false} /> + ]); + }else if(this.state.selectedKey == 2) { + btnArr.push([ + {hrSyncStore.syncSetField.table.doDelete();}} buttonType='del' type="primary" disabled={this.state.selectedRowDatas.length == 0 ? true : false} /> + ]); + }else if(this.state.selectedKey == 3) { + btnArr.push([ + {hrSyncStore.syncSetField.table.doDelete();}} buttonType='del' type="primary" disabled={this.state.selectedRowDatas.length == 0 ? true : false} /> + ]); + } + + return btnArr; + } + + render() { + const { hrSyncStore } = this.props; + const { status } = hrSyncStore; + const { + showSearchAd, + newFormFields, + dataSyncFormFields, + selectedKey, + syncFieldSettingsGroupLabel + } = toJS(status); + const tabs = [] + for (let i = 0; i < syncFileds.length; i++) { + tabs.push({ + color: "#000000", + groupid: "flowAll", + showcount: true, + title: syncFieldSettingsGroupLabel && syncFieldSettingsGroupLabel[syncFileds[i]], + viewcondition: i + }) + } + return ( +
+ {/* 同步关系设置说明 hrm deptjob*/} + { + this.setState({ selectedKey: v, selectedRowDatas: [], selectedRowKeys: [] }); + }} + className="no-bg" + buttons={this.getBtn()} + /> + {this.getSyncTableEdit()} +
+ ) + } +} +export default SyncSetFields; diff --git a/pc4backstage/integration/components/hrsync/style/index.less b/pc4backstage/integration/components/hrsync/style/index.less new file mode 100644 index 0000000..c896a11 --- /dev/null +++ b/pc4backstage/integration/components/hrsync/style/index.less @@ -0,0 +1,25 @@ +.boring-align { + .wea-form-cell { + padding-left: 10px; + } +} +.no-bg { + .wea-tab-right { + background: none; + } +} + + +/* + 同步表设置start +*/ +.hrsync-tablesetting .ant-col-12 { + width: 33%; +} + +.hrsync-tablesetting .wea-helpful-tip { + z-index: 2; +} +/* + 同步表设置end +*/ diff --git a/pc4backstage/integration/components/imrtx/IMInitDialog.js b/pc4backstage/integration/components/imrtx/IMInitDialog.js new file mode 100644 index 0000000..392e139 --- /dev/null +++ b/pc4backstage/integration/components/imrtx/IMInitDialog.js @@ -0,0 +1,43 @@ +import React from 'react'; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaDialog, WeaProgress, WeaLocaleProvider } from "ecCom"; + +const {getLabel} = WeaLocaleProvider; + +@inject("imrtx") +@observer +export default class Main extends React.Component { + render() { + const { imrtx } = this.props; + const { status } = imrtx; + const { initializeVisible, initializeResult } = toJS(status); + return imrtx.closeInitialize()} + visible={initializeVisible} + style={{width: 500, height: 300}} + moduleName="integration" + > +
+

+ {getLabel('31151', "组织结构同步")} +

+ { + initializeResult.flag == 'error'? +
{initializeResult.errorMessage}
: + + } +


+

+ {getLabel('386890',"人员同步")} +

+ { + initializeResult.flag == 'error'? +
{initializeResult.errorMessage}
: + + } +
+
+ } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/imrtx/index.js b/pc4backstage/integration/components/imrtx/index.js new file mode 100644 index 0000000..d0ae3b0 --- /dev/null +++ b/pc4backstage/integration/components/imrtx/index.js @@ -0,0 +1,321 @@ +import React from "react"; +import {CopyToClipboard} from 'react-copy-to-clipboard'; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { Button, message } from "antd"; +import { WeaTableNew, WeaSwitch } from "comsMobx"; +import * as IntegrationUtil from "../../util/IntegrationUtil"; +import NoRight from "../../public/NoRight"; +import IMInitDialog from './IMInitDialog'; +import { + WeaLocaleProvider, + WeaTop, + WeaTab, + WeaRightMenu, + WeaFormItem, + WeaTools, + WeaSearchGroup, + WeaNewScroll +} from "ecCom"; + +const { WeaTable } = WeaTableNew; +const { getKey } = WeaTools; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("imrtx") +@observer +export default class IMrtx extends React.Component { + constructor(props) { + super(props); + this.state = { + topTab: [ + { + title: `${getLabel(81711, "基本信息")}`, + viewcondition: 0 + }, + { + title: `${getLabel(125928, "同步日志")}`, + viewcondition: 1 + } + ], + collectParams: { + favname: `${getLabel('386889', "IM集成设置")}`, + favouritetype: 1, + objid: 0, + link: "wui/engine.html#/integration/imrtx", + importantlevel: 1 + } + } + } + + componentWillReceiveProps(nextProps) { + const { imrtx } = this.props; + if (this.props.location.key !== nextProps.location.key) { + imrtx.doInit(); + } + } + + componentDidMount() { + const { imrtx } = this.props; + imrtx.doInit(); + } + + getRightMenu() { + const { imrtx } = this.props; + const { selectedKey} = toJS(imrtx.status); + let data = []; + if (selectedKey == 1) { + data = [{ + key: "BTN_COLUMN", + icon: "icon-coms-Custom", + content: getLabel(32535, "显示列定制") + }] + }else { + data = [{ + key: "save", + icon: "icon-coms-Preservation", + content: getLabel(86, "保存") + }, { + key: "test", + icon: "icon-coms-currency-Task", + content: getLabel(25496, "测试") + }, { + key: "initialize", + icon: "icon-coms-operation", + content: getLabel(20873, "初始化") + }] + } + + return data && data.map(v => { + return { + key: v.key, + icon: , + content: v.content, + onClick: () => this.onRightMenuClick(v.key) + } + }) + } + + getAdvancedSearch = () => { + const { imrtx } = this.props; + const { status, searchForm } = imrtx; + const { searchFormFields } = toJS(status); + + return IntegrationUtil.getAdvancedItem( + searchForm, + searchFormFields, + this.handleSearchFun, + false, + this && this.props && this.props.ecId || '', + "integrationImRtx", + ); + }; + + handleSearchFun = () => { + const { imrtx } = this.props; + imrtx.getTable(); + imrtx.setState({ showSearchAd: false }); + } + + getTabButtonsAd() { + const { imrtx } = this.props; + return IntegrationUtil.getSearchBtns( + this.handleSearchFun, + () => imrtx.searchForm.reset(), + () => imrtx.setState({ showSearchAd: false }), + this && this.props && this.props.ecId || '', + "integrationImRtx", + ); + } + + getBtns = () => { + let data = [{ + key: "save", + content: getLabel(86, "保存") + }, { + key: "test", + content: getLabel(25496, "测试") + }, { + key: "initialize", + content: getLabel(20873, "初始化") + }]; + return data.map(v => ); + }; + + + onRightMenuClick = type => { + const { imrtx } = this.props; + const { save, newBaseForm, initialize, status} = imrtx; + const params = newBaseForm.getFormParams(); + const { initializeResult } = toJS(status); + switch (type) { + case "save": + save(params); + break; + case "BTN_COLUMN": + imrtx.tableBaseInfo.setColSetVisible(true); + imrtx.tableBaseInfo.tableColSet(true); + break; + case "initialize": + if (initializeResult && initializeResult.flag && initializeResult.flag == 'syning') { + imrtx.initialize(); + } else { + IntegrationUtil.doConfirm(getLabel(81592, "是否开始同步"), imrtx.initialize); + } + break; + case "test": + params.method = "test"; + save(params); + break; + } + }; + + getFormSearchs = (form, datas) => { + const { imrtx } = this.props; + const { inputfaceOptions, inputface, getPassWord, status: {showOCSPassWord} } = imrtx; + const { isFormInit } = form; + const formParams = form.getFormParams(); + let group = []; + + isFormInit && datas && datas.map((c, index) => { + let items = []; + c.items && c.items.map(fields => { + items.push({ + com: ( + + { + getKey(fields) === "download" + ?
{ + window.location.href = `${location.origin}${fields.helpfulTip}`; + }}>{getLabel(31156, "下载")} + : + { + if(getKey(fields) === 'rtxOrElinkType') { + if(form.getFormParams().rtxOrElinkType=="1"){ + form.updateFields({inputface:inputfaceOptions.ocsInputface}); + getPassWord(); + }else{ + form.updateFields({inputface:inputfaceOptions.rtxInputface}); + } + } + }}/> + { + getKey(fields) === "inputface" + ? message.success(getLabel('126081', '地址已经复制成功,您可以使用Ctrl+v粘贴'))} + > + + + : "" + } + + } + + ), + colSpan: 1, + hide: form.isHide(fields, (keys, allParams)=> { + let hide = true; + let key = keys[0]; + if (allParams.rtxOrElinkType == '0' && ['rtxserverurl','rtxserverouturl','rtxserverport','rtxConnServer','rtxVersion','rtxDenyHrm', + 'rtxOnload','impwd','rtxAlert','userattr', + 'isDownload','download','userattr'].indexOf(key) > -1) { + hide = false; + } else if (allParams.rtxOrElinkType == '1' && ['domainName','rtxserverurl','rtxDenyHrm','rtxOnload','impwd', 'rtxConnServer', + 'rtxAlert','userattr','rtxLoginToOA','isDownload'].indexOf(key) > -1) { + hide = false; + } else if (allParams.rtxOrElinkType == '2' && ['rtxserverurl','rtxDenyHrm', + 'rtxOnload','rtxAlert','isDownload'].indexOf(key) > -1) { + hide = false; + } + if (key =='inputface' && allParams.rtxLoginToOA === '0') { + hide = true; + } else if (key =='inputface' && allParams.rtxLoginToOA === '1' && allParams.rtxOrElinkType == '1') { + hide = false; + } + if (key == 'isusedtx' || key == 'rtxOrElinkType') { + hide = false; + } + allParams.rtxOrElinkType == "1" && key === 'impwd' && showOCSPassWord == 0 && (hide = true); + return hide; + }) + }); + }); + group.push(); + }); + return group; + }; + + render() { + const { imrtx } = this.props; + const { status, tableBaseInfo, newBaseForm,hasRight, rightLoading } = imrtx; + const { selectedKey, showSearchAd, baseFormFields, advanceHeight } = toJS(status); + const { topTab, collectParams } = this.state; + + return ( + !rightLoading &&
+ { + hasRight + ? + } + iconBgcolor={IntegrationUtil.GeneralTitleColor.iconBgcolor} + buttons={selectedKey == 0 ? this.getBtns() : []} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + dropMenuProps={{ + collectParams + }} + /> + imrtx.setState({ showSearchAd: !showSearchAd })} + hideSearchAd={() => imrtx.setState({ showSearchAd: false })} + onChange={(v)=> { + imrtx.setState({ selectedKey: v }) + if (v == 1) { + imrtx.getCondition(); + imrtx.searchForm.reset(); + imrtx.getTable(); + } else { + imrtx.getForm(); + } + }} + /> + { + selectedKey == 0 + ? + {this.getFormSearchs(newBaseForm, baseFormFields)} + + : + } + + + : + } +
+ ); + } +} diff --git a/pc4backstage/integration/components/ldap/InputSelect.js b/pc4backstage/integration/components/ldap/InputSelect.js new file mode 100644 index 0000000..15f845b --- /dev/null +++ b/pc4backstage/integration/components/ldap/InputSelect.js @@ -0,0 +1,112 @@ +import React from 'react' +import {Row,Button,Col} from "antd"; +import { WeaLocaleProvider,WeaInput,WeaSelect } from 'ecCom'; +import isEqual from "lodash/isEqual"; +import {toJS} from 'mobx'; +import {inject, observer} from 'mobx-react'; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject('ldapStore') +@observer +export default class InputSelect extends React.Component { + constructor(props) { + super(props); + this.state = { + value: props.value || '', + inputType: props.inputType || 'select', + selectConfig: props.selectConfig || {}, + inputConfig: props.inputConfig || {}, + isMust: props.isMust || false + + } + } + + componentDidMount() { + const { value,inputType,selectConfig,inputConfig,isMust } = this.props; + this.setState({ + value: value || '', + inputType: inputType || 'select', + selectConfig: selectConfig || {}, + inputConfig: inputConfig || {}, + isMust: isMust || false + + }); + } + componentWillReceiveProps(nextProps) { + const { value } = this.props; + const nextValue = nextProps.value; + + const selectConfig = nextProps.selectConfig; + const inputConfig = nextProps.inputConfig; + + if (!isEqual(value, nextValue) && nextValue) { + this.setState({value: nextValue}); + } + this.setState({ + selectConfig: selectConfig || {}, + inputConfig: inputConfig || {} + }); + } + + buttonClick = (inputType,key) => { + this.setState({ + inputType, + value: '', + isMust: false + }); + this.props.onChange && typeof(this.props.onChange) == "function" && this.props.onChange("",key); + } + + render(){ + + const { fieldsName = '',isInput = false, showName = '', customInterface=false} = this.props; + const { value,inputType, isMust} = toJS(this.state); + + let {selectConfig, inputConfig} = toJS(this.state); + + if(isMust){ + return ({showName}); + } else if(isInput || inputType == 'input'){ + inputConfig.value = value; + return ( + { + this.setState({ value ,isMust:false}); + this.props.onChange && typeof(this.props.onChange) == "function" && this.props.onChange(value,fieldsName); + }} + /> + + ); + } else if(!selectConfig || !selectConfig.options || !selectConfig.options.length || selectConfig.options.length == 0){ + inputConfig.value = value; + return ( + { + this.setState({ value ,isMust:false}); + this.props.onChange && typeof(this.props.onChange) == "function" && this.props.onChange(value,fieldsName); + }} + /> + ); + }else{ + selectConfig.value = value; + return ( + { + this.setState({value,isMust:false}); + this.props.onChange && typeof(this.props.onChange) == "function" && this.props.onChange(value,fieldsName); + }} + /> + + ); + } + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/ldap/LdapFilter.js b/pc4backstage/integration/components/ldap/LdapFilter.js new file mode 100644 index 0000000..5c4c642 --- /dev/null +++ b/pc4backstage/integration/components/ldap/LdapFilter.js @@ -0,0 +1,90 @@ +import React from 'react' +import {Button} from "antd"; + +import {WeaLocaleProvider,WeaCheckbox,WeaDialog,WeaTextarea,WeaSearchGroup,WeaFormItem} from "ecCom"; +import isEqual from "lodash/isEqual"; + +const getLabel = WeaLocaleProvider.getLabel; + +export default class LdapFilter extends React.Component { + constructor(props) { + super(props); + this.state = { + value: props.checkValue || '0', + filter: props.filterValue || '', + visible: false + } + } + + componentDidMount() { + const { checkValue, filterValue } = this.props; + this.setState({ + value: checkValue || '0', + filter: filterValue || '' + }); + } + componentWillReceiveProps(nextProps) { + const { checkValue, filterValue } = this.props; + const nextCheckValue = nextProps.checkValue; + const nextFilterValue = nextProps.filterValue; + + if (!isEqual(checkValue, nextCheckValue) && nextCheckValue) { + this.setState({checkValue: nextCheckValue }); + } + if (!isEqual(filterValue, nextFilterValue) && filterValue) { + this.setState({filterValue:nextFilterValue }); + } + } + + render() { + const { checkKey = '',filterKey = '', type = '' ,title = ''} = this.props; + const { value,filter,visible } = this.state; + + let disabled = !(value && value=='1'); + let submit = !(filter && filter!=''); + + return ( + { + this.setState({value:value}); + this.props.onChange && typeof(this.props.onChange) == "function" + && this.props.onChange({[filterKey]:filter},checkKey,value); + + }}> + + + + {this.setState({visible:false});}} + visible={visible} + style={{width: 700, height: 150}} + hasScroll + buttons={[ + , + , + ]} + > + + + { + this.setState({filter:value}); + }} + /> + + + + ); + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/ldap/index.js b/pc4backstage/integration/components/ldap/index.js new file mode 100644 index 0000000..ed66c37 --- /dev/null +++ b/pc4backstage/integration/components/ldap/index.js @@ -0,0 +1,1804 @@ +import React from 'react'; +import List from '../../public/list/components/ListComponent'; +import BaseSet from '../../public/baseSet/components/BaseSetComponent'; +import LdapFilter from './LdapFilter'; +import InputSelect from './InputSelect'; + +import {inject, observer} from 'mobx-react'; +import {toJS} from 'mobx'; +import {Button, message, Row,Modal} from "antd"; +import {WeaDialog, WeaLocaleProvider, WeaRightMenu, WeaNewScroll, WeaTab, WeaTable, WeaSearchGroup, WeaHelpfulTip} from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject('ldapStore') +@observer +export default class Ldap extends React.Component { + constructor(props) { + super(props); + const {ldapStore} = this.props; + ldapStore.setState({ + baseApiUrl: '/api/integration/ldap/base', + listApiUrl: '/api/integration/ldap/list', + showBase: false, + initList: false, + baseDatas: {}, + key: Math.random().toString(36).substr(2, 6), + baseKey: Math.random().toString(36).substr(2, 6) + }); + } + + componentDidMount() { + this.props.ldapStore.setState({ + selectedKey: "base" + }) + } + + /** + * 列表菜单点击 + * @param type + * @param datas + */ + onListMenuClick = (type, datas) => { + const {ldapStore} = this.props; + const { status, listStore } = ldapStore; + const { selectedKey } = toJS(status); + const { rowSelectIds } = toJS(listStore.status); + if (selectedKey === 'base') { + if (type == 'BTN_ADD') {//新建 + ldapStore.setState({ + showBase: true, + dialogType: "base", + baseApiUrl: '/api/integration/ldap/base', + baseDatas: {} + }); + } + + if (type == 'BTN_BatchDelete') {// 批量删除 + this.batchDelete({ + ldapId: rowSelectIds, + type: "base" + }); + } + } + if (selectedKey === 'custominterface') { + if (type == 'BTN_ADD') {//新建 + ldapStore.setState({ + showBase: true, + dialogType: "custominterface", + baseApiUrl: '/api/integration/ldap/custominterfacebase', + baseDatas: {} + }); + } + if (type == 'BTN_BatchDelete') {// 批量删除 + var ids = toJS(ldapStore.listStore.status.rowSelectIds); + this.batchDelete({ + formartid: ids, + type: "custominterface" + }); + } + } + if(selectedKey === 'useraccount') { + if(type === 'BTN_DESIGN_DEPARTMENT') { + ldapStore.setState({ + showBase: true, + dialogType: "userdesigndepartment", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/userdesigndepartment', + baseDatas: { + ldapId: rowSelectIds, + } + }); + }else if (type === "BTN_MERGE_USER") { + ldapStore.setState({ + showBase: true, + dialogType: "useraccountmatchbase", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/useraccountmatchbase', + baseDatas: { + ldapId: rowSelectIds, + } + }); + } + } + } + + /** + * 列表行点击 + * @param record + * @param index + * @param operate + * @param flag + */ + onListRowClick = (record, index, operate, flag) => { + const { ldapStore } = this.props; + const { status } = ldapStore; + const { selectedKey } = toJS(status); + if (selectedKey === 'base') { + if (operate && operate.type) { + const {ldapStore} = this.props; + + // 测试 + if(operate.type == 'BTN_TEST') { + ldapStore.baseTableEdit = []; + ldapStore.setState({ + showTestVersion: true, + dialogType: "test", + baseTabKey: "base", + testInitDatas: {}, + errorMessage: '', + baseApiUrl: '/api/integration/ldap/test', + baseDatas: { + ldapId: record.ldapid, + ldapType: record.ldaptype + } + }); + ldapStore.getTestFields(); + ldapStore.getTestMenu(); + ldapStore.getBase('base'); + } else if (operate.type == "BTN_EDIT") { + ldapStore.setState({ + showBase: true, + dialogType: "base", + baseTabKey: "", + baseApiUrl: '/api/integration/ldap/base', + baseDatas: { + ldapId: record.ldapid + } + }); + } else if (operate.type == "BTN_DEL") { + this.deleteLdap({ldapId: record.ldapid}); + + } else if (operate.type == "BTN_PULL") { + ldapStore.baseTableEdit = []; + ldapStore.setState({ + showBase: true, + dialogType: "pull", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/pull', + baseDatas: { + ldapId: record.ldapid, + ldapType: record.ldaptype + } + }); + } else if (operate.type == "BTN_PUSH") { + ldapStore.baseTableEdit = []; + ldapStore.setState({ + showBase: true, + dialogType: "push", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/push', + baseDatas: { + ldapId: record.ldapid, + ldapType: record.ldaptype + } + }); + } else if (operate.type == "BTN_SYNC_LOG") { + ldapStore.setState({ + showBase: true, + showLogDetail: false, + dialogType: "synclog", + baseApiUrl: '/api/integration/ldap/synclog', + baseDatas: { + ldapId: record.ldapid + } + }); + }else if (operate.type == "BTN_DEL_LOG") { + this.deleteLdap({ + logId: record.logId, + ldapId: record.ldapId + }); + + }else if (operate.type == "BTN_LOG") { + ldapStore.setState({ + logDatas: { + show: true, + targetId: record.ldapid + } + }); + } + } + }else{ + if (operate && operate.type) { + if (operate.type == "BTN_DEL") { + this.deleteLdap({formartid: record.formartid}); + }else if (operate.type == "BTN_EDIT" || operate.type == "BTN_DETAIL") { + ldapStore.baseSetStore.setButtonShowStatus(record.formartlevel); + ldapStore.baseSetStore.setInputModifyType(operate.type); + ldapStore.setState({ + showBase: true, + dialogType: "custominterface", + baseTabKey: "", + baseApiUrl: '/api/integration/ldap/custominterfacebase', + baseDatas: { + formartid: record.formartid + } + }); + }else if(operate.type === "BTN_DESIGN_DEPARTMENT") { + ldapStore.setState({ + showBase: true, + dialogType: "userdesigndepartment", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/userdesigndepartment', + baseDatas: { + ldapId: [record.randomFieldId], + } + }); + }else if(operate.type === "BTN_DESIGN_MERGE_USER") { + ldapStore.setState({ + showBase: true, + dialogType: "usermerge", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/usermerge', + baseDatas: { + ldapId: record["ID"], + loginid: record["LOGINID"], + ldapType: record.ldaptype + } + }); + } + } + } + } + + /** + * 列表列点击 + * @param record + * @param type + */ + onColumClick = (record, type) => { + const {ldapStore} = this.props; + const { status } = ldapStore; + const { selectedKey } = toJS(status); + + if (selectedKey === 'base') { + if (type && type == "BTN_EDIT") { + ldapStore.setState({ + showBase: true, + dialogType: "base", + baseApiUrl: '/api/integration/ldap/base', + baseDatas: { + ldapId: record.ldapid + } + }); + }else if(type && type == "BTN_DETAIL_LOG"){ + ldapStore.setState({ + showLogDetail: true, + dialogType: "synclogdetail", + baseApiUrl: '/api/integration/ldap/getLogDetial', + baseDatas: { + logId: record.logId + } + }); + } + }else{ + if (type && type == "BTN_EDIT") { + ldapStore.baseSetStore.setButtonShowStatus(record.formartlevel); + ldapStore.setState({ + showBase: true, + dialogType: "custominterface", + baseTabKey: "", + baseApiUrl: '/api/integration/ldap/custominterfacebase', + baseDatas: { + formartid: record.formartid + } + }); + } + } + } + + /** + * 弹框按钮点击 + * @param type + * @param form + * @param tableDatas + * @param refs + */ + onBaseMenuClick = (type, form, tableDatas, refs) => { + const {ldapStore} = this.props; + const {status} = ldapStore; + const {dialogType, baseTabKey, baseDatas} = toJS(status); + if (type && type == "BTN_SAVE") { + if ("base" == dialogType) { + //基础信息保存 + ldapStore.saveBase(form); + } else if ("pull" == dialogType) { + if (!baseTabKey || "" == baseTabKey || "base" == baseTabKey) { + //正向同步,同步节点保存 + this.configPullSync(tableDatas, refs); + } else if ("mapping" == baseTabKey) { + //正向同步,字段映射保存 + this.configPullMapping(tableDatas, refs); + } else if ("sync" == baseTabKey) { + //正向同步,手动同步 + this.runSync("run", form); + } else if("schedule" == baseTabKey) { + ldapStore.configSchedule(form); + } + } else if ("push" == dialogType) { + if (!baseTabKey || "" == baseTabKey || "base" == baseTabKey) { + //反向同步,同步节点保存 + this.configPushSync(tableDatas, refs); + } else if ("mapping" == baseTabKey) { + //反向同步,字段映射保存 + this.configPushMapping(tableDatas, refs); + } else if ("sync" == baseTabKey) { + //反向同步,手动同步 + this.runSync("oarun", form); + } else if("schedule" == baseTabKey) { + ldapStore.configSchedule(form); + } + }else if("custominterface" == dialogType){ + // 自定义接口基础信息保存 + ldapStore.saveCustomInterfaceBase(form); + } + } else if (type && type == "BTN_DEL") { + const {ldapStore} = this.props; + const {status} = ldapStore; + const {baseDatas} = toJS(status); + + if (baseDatas && baseDatas.ldapId) { + this.deleteLdap({ldapId: baseDatas.ldapId}); + } + } else if (type && type == "BTN_BatchDelete_Log") { + const {ldapStore} = this.props; + var ids = toJS(ldapStore.baseSetStore.status.rowSelectIds); + this.batchDelete({ + logId: ids, + type: "synclog" + }); + } else if(type && type === "BTN_CONFIRM") { + if(dialogType === "userdesigndepartment") { + let params = form.getFormParams(); + form.validateForm().then(f => { + if(f.isValid) { + ldapStore.updateUserInfo({...params, userIds: baseDatas.ldapId, subcompanyId: ldapStore.baseSetStore.status.subcompanyId}); + }else { + f.showErrors(); + } + }) + } else if(dialogType === 'usermerge') { + let params = form.getFormParams(); + form.validateForm().then(f => { + if(f.isValid) { + ldapStore.mergeUserInfo({targetId: params.userId , modifyId: baseDatas.ldapId, loginid: baseDatas.loginid}); + }else { + f.showErrors(); + } + }) + } + } else if(type && type === "BTN_CANCLE") { + if(dialogType === "userdesigndepartment" || dialogType === "usermerge") { + ldapStore.setState({ + showBase: false + }) + } + } else if(type && type === "BTN_MATCH_TEST") { + let params = form.getFormParams(); + form.validateForm().then(f => { + if(f.isValid) { + ldapStore.getTestMatchData(params); + }else { + f.showErrors(); + } + }) + } else if(type && type === "BTN_BATCH_MERGE") { + let params = form.getFormParams(); + form.validateForm().then(f => { + if(f.isValid) { + ldapStore.batchMergeUserInfo(params); + }else { + f.showErrors(); + } + }) + } + } + + /** + * 手动同步 + * @param form + */ + runSync = (type, form) => { + + const {ldapStore} = this.props; + form && form.isFormInit && form.validateForm().then(f => { + if (f.isValid) { + if (form.getFormDatas().isSync && form.getFormDatas().isSync.value == "1") { + message.error(getLabel(131202, '该同步正在运行中,不可重复运行,您可以查看运行详情')); + return; + } else { + form.updateFields({ + isSync: "1", + syncLogShow: getLabel(131322, '同步程序正在初始化……') + "\n\r" + }); + } + + ldapStore.runSync(type, form); + + } else { + f.showErrors(); + } + }); + } + + /** + * 配置反向同步字段映射 + * @param tableDatas + * @param refs + */ + configPushMapping = (tableDatas, refs) => { + //反向同步字段映射保存 + + const {ldapStore} = this.props; + const {template, baseTableEdit} = ldapStore; + + //未配置有效的同步节点 + if (!baseTableEdit || !baseTableEdit || baseTableEdit.length <= 0) { + message.error(this.stringFormart(getLabel(131534, '请至%s设置%s'), [getLabel(21952, '同步设置'), getLabel(125555, '同步节点')])); + return; + } + + if (!refs) { + return; + } + + let submitDatas = []; + for (let tableKey of baseTableEdit) { + if (!refs[tableKey] || !refs[tableKey].doValidate().pass) { + return; + } + + let lable = ''; + let templateKey = ''; + if ("pushSubcompanySet" == tableKey) { + lable = getLabel(82267, '分部同步字段对应设置'); + templateKey = "oasubcompany"; + } else if ("pushDepartmentSet" == tableKey) { + lable = getLabel(82268, '部门同步字段对应设置'); + templateKey = "oadepartment"; + } else if ("pushUserSet" == tableKey) { + lable = getLabel(32239, ' 人员同步对应关系设置 '); + templateKey = "oauser"; + } + + //至少配置一个 + if (!tableDatas || !tableDatas[tableKey] || !tableDatas[tableKey].length || tableDatas[tableKey].length <= 0) { + message.error(getLabel(131183, '至少设置一个') + lable); + return; + } + + + let allConfig = ''; + + for (let elem of tableDatas[tableKey].values()) { + //同步域重名检测 + let showName = elem.attributeName; + if (template && template[templateKey] && template[templateKey].options) { + for (let t of template[templateKey].options.values()) { + if (showName == t.key) { + showName = t.showname; + } + } + } + + if(allConfig.indexOf(`(#@#)${showName}(#@#)`) < 0) { + allConfig += `(#@#)${showName}(#@#)`; + }else { + message.error(`${lable}(${showName}) ${getLabel(18082, '重复')}`); + return + } + } + + if("pushSubcompanySet" === tableKey){ + var flag = this.judgeAttributeName("name",tableDatas[tableKey]); + lable = getLabel(82267, '分部同步字段对应设置'); + // if(flag == false){ + // message.error(`${lable}-${getLabel(390997,'请添加LDAP分部名称')}(name)`); + // return; + // } + var oper = this.judgeOperation("name",tableDatas[tableKey]); + var ldapLable = getLabel(391339,'LDAP分部名称'); + if("1" === oper){ + message.error(`${ldapLable}(name)${getLabel(391335,'操作类别为仅添加,则其他对应字段操作类别需设置为仅添加')}`); + return; + } + if("2" === oper){ + message.error(`${ldapLable}(name)${getLabel(391336,'操作类别为仅修改,则其他对应字段操作类别需设置为仅修改')}`); + return; + } + + } + else if("pushDepartmentSet" === tableKey){ + var flag = this.judgeAttributeName("name",tableDatas[tableKey]); + lable = getLabel(82268, '部门同步字段对应设置'); + // if(flag == false){ + // message.error(`${lable}-${getLabel(391000,'请添加LDAP部门名称')}(name)`); + // return; + // } + var oper = this.judgeOperation("name",tableDatas[tableKey]); + var ldapLable = getLabel(391340,'LDAP部门名称'); + if("1" === oper){ + message.error(`${ldapLable}(name)${getLabel(391335,'操作类别为仅添加,则其他对应字段操作类别需设置为仅添加')}`); + return; + } + if("2" === oper){ + message.error(`${ldapLable}(name)${getLabel(391336,'操作类别为仅修改,则其他对应字段操作类别需设置为仅修改')}`); + return; + } + } + else if("pushUserSet" === tableKey){ + var flag = this.judgeAttributeName("sAMAccountName",tableDatas[tableKey]); + lable = getLabel(32239, ' 人员同步对应关系设置 '); + //if(flag == false){ + // message.error(`${lable}-${getLabel(390999,'请添加LDAP用户帐号')}(sAMAccountName)`); + // return; + //} + var oper = this.judgeOperation("sAMAccountName",tableDatas[tableKey]); + var ldapLable = getLabel(391341,'LDAP用户帐号'); + if("1" === oper){ + message.error(`${ldapLable}(name)${getLabel(391335,'操作类别为仅添加,则其他对应字段操作类别需设置为仅添加')}`); + return; + } + if("2" === oper){ + message.error(`${ldapLable}(name)${getLabel(391336,'操作类别为仅修改,则其他对应字段操作类别需设置为仅修改')}`); + return; + } + } + submitDatas.push(...tableDatas[tableKey]); + } + ldapStore.configMapping("push", {mapping: JSON.stringify(submitDatas)}); + } + + /** + * 配置正向同步字段映射 + * @param tableDatas + * @param refs + */ + configPullMapping = (tableDatas, refs) => { + //正向同步字段映射保存 + const {ldapStore} = this.props; + const {status, template, baseTableEdit} = ldapStore; + const {baseDatas} = toJS(status); + + //未配置有效的同步节点 + if (!baseTableEdit || !baseTableEdit || baseTableEdit.length <= 0) { + message.error(this.stringFormart(getLabel(131534, '请至%s设置%s'), [getLabel(21952, '同步设置'), getLabel(125555, '同步节点')])); + ldapStore.baseTableEdit = []; + ldapStore.setState({ + showBase: true, + dialogType: "pull", + baseTabKey: "base", + baseApiUrl: '/api/integration/ldap/pull', + baseDatas: baseDatas + }); + return; + } + + if (!refs) { + return; + } + + let submitDatas = []; + for (let tableKey of baseTableEdit) { + if (!refs[tableKey] || !refs[tableKey].doValidate().pass) { + return; + } + + let lable = ''; + let templateKey = ''; + if ("subcompanySet" == tableKey) { + lable = getLabel(82267, '分部同步字段对应设置'); + templateKey = "subcompany"; + } else if ("departmentSet" == tableKey) { + lable = getLabel(82268, '部门同步字段对应设置'); + templateKey = "department"; + } else if ("userSet" == tableKey) { + lable = getLabel(32239, ' 人员同步对应关系设置 '); + templateKey = "user"; + } + + //至少配置一个 + if (!tableDatas || !tableDatas[tableKey] || !tableDatas[tableKey].length || tableDatas[tableKey].length <= 0) { + message.error(getLabel(131183, '至少设置一个') + lable); + return; + } + + + let allConfig = ''; + for (let elem of tableDatas[tableKey].values()) { + let showName = elem.attributeName; + + if (template && template[templateKey] && template[templateKey].options) { + for (let t of template[templateKey].options.values()) { + if (showName == t.key) { + showName = t.showname; + } + } + } + //同步域重名检测 + if (allConfig.indexOf(`(#@#)${showName}(#@#)`) < 0) { + allConfig += `(#@#)${showName}(#@#)`; + } else { + message.error(`${lable}(${showName}) ${getLabel(18082, '重复')}`); + return + } + } + + if("subcompanySet" === tableKey){ + var flag = this.judgeAttributeName("subcompanyname",tableDatas[tableKey]); + lable = getLabel(82267, '分部同步字段对应设置'); + if(flag == false){ + message.error(`${lable}-${getLabel(390994,'请添加OA分部名称')}(subcompanyname)`); + return; + } + var oper = this.judgeOperation("subcompanyname",tableDatas[tableKey]); + var oaLable = getLabel(391338,'OA分部名称'); + if("1" === oper){ + message.error(`${oaLable}(subcompanyname)${getLabel(391335,'操作类别为仅添加,则其他对应字段操作类别需设置为仅添加')}`); + return; + } + if("2" === oper){ + message.error(`${oaLable}(subcompanyname)${getLabel(391336,'操作类别为仅修改,则其他对应字段操作类别需设置为仅修改')}`); + return; + } + + } + else if("departmentSet" === tableKey){ + var flag = this.judgeAttributeName("departmentmark",tableDatas[tableKey]); + lable = getLabel(82268, '部门同步字段对应设置'); + if(flag == false){ + message.error(`${lable}-${getLabel(390995,'请添加OA部门标识')}(departmentmark)`); + return; + } + var oper = this.judgeOperation("departmentmark",tableDatas[tableKey]); + var oaLable = getLabel(391337,'OA部门标识'); + if("1" === oper){ + message.error(`${oaLable}(departmentmark)${getLabel(391335,'操作类别为仅添加,则其他对应字段操作类别需设置为仅添加')}`); + return; + } + if("2" === oper){ + message.error(`${oaLable}(departmentmark)${getLabel(391336,'操作类别为仅修改,则其他对应字段操作类别需设置为仅修改')}`); + return; + } + } + else if("userSet" === tableKey){ + var flag = this.judgeAttributeName("loginid",tableDatas[tableKey]); + lable = getLabel(32239, ' 人员同步对应关系设置 '); + if(flag == false){ + message.error(`${lable}-${getLabel(390996,'请添加OA用户标识')}(loginid)`); + return; + } + var oper = this.judgeOperation("loginid",tableDatas[tableKey]); + var oaLable = getLabel(391334,'OA用户账号'); + if("1" === oper){ + message.error(`${oaLable}(loginid)${getLabel(391335,'操作类别为仅添加,则其他对应字段操作类别需设置为仅添加')}`); + return; + } + if("2" === oper){ + message.error(`${oaLable}(loginid)${getLabel(391336,'操作类别为仅修改,则其他对应字段操作类别需设置为仅修改')}`); + return; + } + } + submitDatas.push(...tableDatas[tableKey]); + } + + ldapStore.configMapping("pull", {mapping: JSON.stringify(submitDatas)}); + } + + judgeAttributeName = (attrname,arr) => { + var flag = false; + for(let elem of arr.values()){ + if(attrname === elem.attributeName){ + flag = true; + } + } + return flag; + } + + judgeOperation = (attrname,arr) =>{ + let compareOper; + let addOper = []; + let editOper = []; + for(let elem of arr.values()){ + if(attrname === elem.attributeName){ + compareOper = elem.attributeOperation; + continue; + } + if("1" === elem.attributeOperation){ + addOper.push(elem.attributeOperation); + } + if("2" === elem.attributeOperation){ + editOper.push(elem.attributeOperation); + } + if("0" === elem.attributeOperation){ + addOper.push(elem.attributeOperation); + editOper.push(elem.attributeOperation); + } + } + if("1" === compareOper){ + if(editOper.length>0){ + return "1"; + } + } + if("2" === compareOper){ + if(addOper.length>0){ + return "2"; + } + } + } + + stringFormart = function (str, val) { + for (let i = 0; i < val.length; i++) { + str = str.replace("%s", val[i]); + } + return str; + } + + + /** + * 配置正向同步同步节点 + * @param tableDatas + * @param refs + */ + configPullSync = (tableDatas, refs) => { + //正向同步同步节点保存 + //同步节点 必填校验 + if (!refs || !refs.syncSet || !refs.syncSet.doValidate().pass) { + return; + } + + //OU组织类型设置 必填校验 + if (!refs || !refs.attributeSet || !refs.attributeSet.doValidate().pass) { + return; + } + + //至少配置一个同步节点 + if (!tableDatas || !tableDatas.syncSet || !tableDatas.syncSet.length || tableDatas.syncSet.length <= 0) { + message.error(`${getLabel(131183, '至少设置一个')}${getLabel(125555, '同步节点')}`); + return; + } + + let isMustOrg = false; + if (!tableDatas || !tableDatas.attributeSet || !tableDatas.attributeSet.length || tableDatas.attributeSet.length <= 0) { + isMustOrg = true; + } + + let check = true; + let allConfig = ''; + for (let elem of tableDatas.syncSet.values()) { + + //同步域重名检测 + let data = elem.baseDomain.replace(/^(\s*)|(\s*)$/g, ''); + if (allConfig.indexOf(`(#@#)${data}(#@#)`) < 0) { + allConfig += `(#@#)${data}(#@#)`; + } else { + message.error(getLabel(32287, '同步域') + data + getLabel(18082, '重复')); + return + } + + //未设置OU组织类型时,同步节点必须指定部门 + if (isMustOrg && elem.syncOrg == "1" && (!elem.departmentId || elem.departmentId == "" || elem.departmentId == "0")) { + //请设置OU组织类型或为所有的组织结构指定部门 + message.error(`${getLabel(131185, '请设置OU组织类型或为所有的组织结构指定部门!')}`); + return; + } + + if (check && (elem.syncOrg == "1" || elem.syncUser == "1")) { + check = false; + } + } + + // if (check) { + // //同步节点中至少开启一个同步组织结构或用户 + // message.error(`${getLabel(131533, '至少开启一个同步组织结构或用户')}`); + // return; + // } + + let ouConfig = ''; + for(let elem of tableDatas.attributeSet.values()) { + // OU组织类型设置 + let attributeName = elem.attributeName.replace(/^(\s*)|(\s*)$/g, ''); + let attributeValue = elem.attributeValue.replace(/^(\s*)|(\s*)$/g, ''); + if(ouConfig.indexOf(`(#@#)${attributeName}+${attributeValue}(#@#)`) < 0) { + ouConfig += `(#@#)${attributeName}+${attributeValue}(#@#)`; + }else { + message.error(getLabel(82372, 'OU类型的标识属性') + attributeName + ',' + getLabel(129025, '属性值') + attributeValue + getLabel(18082, '重复')); + return + } + } + + //let params = [...tableDatas.syncSet, ...tableDatas.attributeSet]; + let params = { + sync:JSON.stringify(tableDatas.syncSet), + auttibute:JSON.stringify(tableDatas.attributeSet) + }; + const {ldapStore} = this.props; + ldapStore.configSync("pull", params); + } + + /** + * 配置反向同步同步节点 + * @param tableDatas + * @param refs + */ + configPushSync = (tableDatas, refs) => { + //反向同步同步节点保存 + //同步节点 必填校验 + if (!refs || !refs.pushSyncSet || !refs.pushSyncSet.doValidate().pass) { + return; + } + + //OU组织类型设置 必填校验 + if (!refs || !refs.pushAttributeSet || !refs.pushAttributeSet.doValidate().pass) { + return; + } + + //至少配置一个同步节点 + if (!tableDatas || !tableDatas.pushSyncSet || !tableDatas.pushSyncSet.length || tableDatas.pushSyncSet.length <= 0) { + message.error(`${getLabel(131183, '至少设置一个')}${getLabel(125555, '同步节点')}`); + return; + } + + let check = true; + let allOrgConfig = ''; + let allUserConfig = ''; + for (let elem of tableDatas.pushSyncSet.values()) { + if(elem.syncOrg != '0' || elem.syncUser != '0') { + let tempOrgVal = `(#@#)${elem.subcompanyId}(||)${elem.departmentId}(||)${elem.syncOrg}(#@#)`; + let tempUserVal = `(#@#)${elem.subcompanyId}(||)${elem.departmentId}(||)${elem.syncUser}(#@#)`; + //同步域重名检测 + if (allOrgConfig.indexOf(tempOrgVal) < 0 && allUserConfig.indexOf(tempUserVal) < 0) { + allOrgConfig += tempOrgVal; + allUserConfig += tempUserVal; + } else { + message.error(getLabel(125555, '同步节点') + " ( " + elem.subcompanyIdspan + " ) " + getLabel(18082, '重复')); + return + } + + if (check && (elem.syncOrg == "1" || elem.syncUser == "1")) { + check = false; + } + } + } + + if (check) { + //同步节点中至少开启一个同步组织结构或用户 + message.error(`${getLabel(131533, '至少开启一个同步组织结构或用户')}`); + return; + } + + // ou组织类型设置的数据添加showOrder + tableDatas.pushAttributeSet && tableDatas.pushAttributeSet.map((data, index) => { + let attributeName = data.attributeName; + data.showOrder = attributeName === 'subkey' ? '1' : attributeName === 'subValue' ? '2' : attributeName === 'subClass' ? '3' + : attributeName === 'depkey' ? '4' : attributeName === 'depValue' ? '5' : attributeName === 'depClass' ? '6' + : attributeName === 'userkey' ? '7' : attributeName === 'userValue' ? '8' : attributeName === 'userClass' ? '9' : ''; + }) + + let params = { + sync:JSON.stringify(tableDatas.pushSyncSet), + auttibute:JSON.stringify(tableDatas.pushAttributeSet) + }; + //[...tableDatas.pushSyncSet, ...tableDatas.pushAttributeSet]; + const {ldapStore} = this.props; + ldapStore.configSync("push", params); + } + + /** + * 删除LDAP + * @param params + */ + deleteLdap = (params) => { + const {ldapStore} = this.props; + const { status } = ldapStore; + const { selectedKey, dialogType } = toJS(status); + Modal.confirm({ + title: `${getLabel(386786, '信息确认')}`, + content: `${getLabel(15097, '确定要删除吗?')}`, + okText: `${getLabel(16631, '确定')}`, + cancelText: `${getLabel(31129, '取消')}`, + onOk: () => { + if(selectedKey == 'base'){ + if(dialogType == 'synclog' || dialogType == 'synclogdetail'){ + ldapStore.deleteLdapSyncLog(params); + }else{ + ldapStore.deleteLdap(params); + } + }else{ + ldapStore.deleteCustomInterface(params); + } + + }, + }); + } + + /** + * 批量删除 + * + */ + batchDelete = (params) => { + const {ldapStore} = this.props; + Modal.confirm({ + title: `${getLabel(386786, '信息确认')}`, + content: `${getLabel(385625, '确定要删除选择的记录吗?')}`, + okText: `${getLabel(16631, '确定')}`, + cancelText: `${getLabel(31129, '取消')}`, + onOk: () => { + if(params.type == 'custominterface'){ + ldapStore.deleteCustomInterface(params); + }else if(params.type == 'synclog'){ + ldapStore.deleteLdapSyncLog(params); + }else if(params.type == 'base') { + delete params.type; + ldapStore.deleteLdap(params); + } + } + }); + }; + + /** + * 弹框Tab点击 + * @param tabKey + */ + onBaseTabChange = (tabKey) => { + const {ldapStore} = this.props; + const {status, getBase} = ldapStore; + const {dialogType, baseDatas} = toJS(status); + + ldapStore.template = []; + ldapStore.baseTableEdit = []; + if ("pull" == dialogType) { + if (tabKey && tabKey == "base") { + ldapStore.setState({ + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/pull', + }); + } else if (tabKey && tabKey == "mapping") { + ldapStore.initFormart("ldap"); + ldapStore.setState({ + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/pullMapping', + }); + } else if (tabKey && tabKey == "sync") { + ldapStore.setState({ + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/pullSync', + }); + } else if (tabKey && tabKey == "schedule") { + Object.assign(baseDatas, {syncType:dialogType}); + + ldapStore.setState({ + baseDatas: baseDatas, + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/schedule', + }); + } + } else if ("push" == dialogType) { + if (tabKey && tabKey == "base") { + ldapStore.setState({ + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/push', + }); + } else if (tabKey && tabKey == "mapping") { + ldapStore.initFormart("oa"); + ldapStore.setState({ + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/pushMapping', + }); + } else if (tabKey && tabKey == "sync") { + ldapStore.setState({ + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/pushSync', + }); + } else if (tabKey && tabKey == "schedule") { + Object.assign(baseDatas, {syncType:dialogType}); + + ldapStore.setState({ + baseDatas: baseDatas, + baseTabKey: tabKey, + baseApiUrl: '/api/integration/ldap/schedule', + }); + } + } else if("test" == dialogType) { + if(tabKey && tabKey == 'base') { + getBase('base'); + }else if(tabKey && tabKey == 'pull'){ + getBase('pull'); + }else if(tabKey && tabKey == 'push') { + getBase('push'); + } + } + } + + /** + * 列表Tab点击 + * @param tabKey + */ + onTabListChange = (tabKey) => { + const {ldapStore} = this.props; + const {status, getBase} = ldapStore; + + if ("base" == tabKey) { + ldapStore.setState({ + selectedKey: tabKey, + listApiUrl: '/api/integration/ldap/list', + }); + } else if ("custominterface" == tabKey) { + ldapStore.setState({ + selectedKey: tabKey, + listApiUrl: '/api/integration/ldap/custominterface', + }); + } else if("useraccount" == tabKey) { + ldapStore.setState({ + selectedKey: tabKey, + listApiUrl: '/api/integration/ldap/useraccount', + }); + } + } + + willEdit = ( editType, rowKey, datas, result) =>{ + const { + baseTabKey, + } = this.props.ldapStore.status; + const {key,record} = result; + let ret = new Object(); + if(key=="subcompanyId"){ + ret["datas"] = datas.map(data => { + if(data[rowKey] === record[rowKey]) { + ret["cells"] = [{ + [rowKey]: record[rowKey], + departmentId: { + com: [{ + viewAttr: 2, + editType: 1, + label: "", + type: "BROWSER", + browserConditionParam: { + type: "4", + title: getLabel(27511,"部门"), + icon: "icon-coms-hrm", + iconBgcolor: "#217346", + hasAddBtn: false, + hasAdvanceSerach: true, + hasBorder: false, + hideVirtualOrg: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: (window.ecologyContentPath || "") + "/spa/hrm/engine.html#/hrmengine/organization?showTree=false&type=department&id=", + showCheckStrictly: true, + dataParams:{ + subcompanyid1:data.subcompanyId == '' ? '-1' : data.subcompanyId + }, + tabs: [{ + isSearch: false, + key: "2", + name: getLabel(25332,"组织结构"), + selected: false, + showOrder: 0 + },{ + dataParams: { + list: "1" + }, + isSearch: true, + key: "1", + name: getLabel(130619,"按列表"), + selected: false, + showOrder: 0 + }] + }, + key: "departmentId" + }] + } + }]; + //return data; + return { + ...data, + departmentId: "", + departmentIdspan: "" + } + } + return data; + }); + return ret; + } + if(key=="attributeType"){ + ret["datas"] = datas.map(data => { + let attributeObj = {}; + if(["mapping"].includes(baseTabKey)) { + attributeObj = {attributeValue: ""}; + } + if(data[rowKey]===record[rowKey]){ + if(data.attributeType=="1" || data.attributeType=="2") { + data.attributeOperation = "1"; + + } + return { + ...data, + ...attributeObj, + } + } + return { + ...data, + }; + }); + return ret; + } + ret["datas"] = datas; + return ret; + } + + /** + * 初始化TableEdit + * @param editType + */ + initBaseTableEdit = (editType) => { + const {ldapStore} = this.props; + const {baseSetStore} = ldapStore; + + ldapStore.baseTableEdit.push(editType); + let p = []; + let isRun = true; + if ("subcompanySet" == editType || "pushSubcompanySet" == editType) { + let p1 = ldapStore.getTemplate("subcompany"); + let p2 = ldapStore.getTemplate("oasubcompany"); + p.push(p1, p2); + } else if ("departmentSet" == editType || "pushDepartmentSet" == editType) { + + let p1 = ldapStore.getTemplate("department"); + let p2 = ldapStore.getTemplate("oadepartment"); + p.push(p1, p2); + + } else if ("userSet" == editType || "pushUserSet" == editType) { + + let p1 = ldapStore.getTemplate("user"); + let p2 = ""; + if("userSet" == editType) { + p2 = ldapStore.getTemplate("ldapToOauser"); + } else if("pushUserSet" == editType) { + p2 = ldapStore.getTemplate("oauser"); + } + p.push(p1, p2); + } else if ("pushAttributeSet" == editType) { + + let p1 = ldapStore.getTemplate("oaou"); + let p2 = ldapStore.getTemplate("subcompany"); + let p3 = ldapStore.getTemplate("department"); + let p4 = ldapStore.getTemplate("user"); + p.push(p1, p2, p3, p4); + + } else { + isRun = false; + } + Promise.all(p).finally((result) => { + baseSetStore.tableInit(editType); + }); + } + + /** + * 初始化同步节点自定义组件 + * @param editType + * @param com + * @returns {{key, type: {label: string, type: string, viewAttr: string, key: string, width: number}[], render: function(*, *, *, *): *}} + */ + initBaseTableEditColumn = (editType, com) => { + + const {ldapStore} = this.props; + const {status} = ldapStore; + const {baseDatas} = toJS(status); + if (editType && com && com.key) { + if (editType == "syncSet") { + return this.getLdapFilter(com); + } else if (editType == "subcompanySet") { + if (com.key == "attributeName") { + return this.getInputSelect("subcompany", com); + } else if (com.key == "attributeValue") { + return this.getInputSelect("oasubcompany", com); + } + } else if (editType == "departmentSet") { + if (com.key == "attributeName") { + return this.getInputSelect("department", com); + } else if (com.key == "attributeValue") { + return this.getInputSelect("oadepartment", com); + } + } else if (editType == "userSet") { + if (com.key == "attributeName") { + return this.getInputSelect("user", com); + } else if (com.key == "attributeValue") { + return this.getInputSelect("ldapToOauser", com); + } + } else if (editType == "pushAttributeSet") { + return this.getInputSelectOfPush("oaou", com); + + } else if (editType == "pushSubcompanySet") { + if (com.key == "attributeName") { + return this.getInputSelect("oasubcompany", com); + } else if (com.key == "attributeValue") { + return this.getInputSelect("subcompany", com); + } + } else if (editType == "pushDepartmentSet") { + if (com.key == "attributeName") { + return this.getInputSelect("oadepartment", com); + } else if (com.key == "attributeValue") { + return this.getInputSelect("department", com); + } + } else if (editType == "pushUserSet") { + if (com.key == "attributeName") { + return this.getInputSelect("oauser", com); + } else if (com.key == "attributeValue") { + return this.getInputSelect("user", com); + } + } + } + } + + /** + * + * 获取LDAP过虑配置组件 + * + * @param com + * @returns {{key, type: {label: string, type: string, viewAttr: string, key: string, width: number}[], render: function(*, *=, *, *): *}} + */ + getLdapFilter = (com) => { + const {ldapStore} = this.props; + const {status} = ldapStore; + const {baseDatas} = toJS(status); + + if (com.key == "syncOrg") { + let defFilter = '(|(objectClass=organization)(objectClass=organizationalUnit))'; + if ("AD" == baseDatas.ldapType) { + defFilter = "(|(objectClass=organization)(objectClass=organizationalUnit))"; + } + return { + key: com.key, + type: com.type, + render: (text, record, index, onEdit) => ( + { + Object.assign(record, values); + onEdit({record, index, key, value}); + }} + > + ) + } + } else if (com.key == "syncUser") { + let defFilter = '(|(objectClass=user)(objectClass=person))'; + if ("AD" == baseDatas.ldapType) { + defFilter = "(|(objectClass=user)(objectClass=person))"; + } + return { + key: com.key, + type: com.type, + render: (text, record, index, onEdit) => ( + { + Object.assign(record, values); + onEdit({record, index, key, value}); + }} + > + ) + } + } + } + + /** + * 反向同步INPUT、Select切换控件 + * @param type + * @param com + * @returns {{key, type: {label: string, type: string, viewAttr: string, key: string, width: number}[], render: function(*, *, *, *)}} + */ + getInputSelectOfPush = (type, com) => { + const {ldapStore} = this.props; + const {template, formart} = ldapStore; + return { + key: com.key, + type: com.type, + render: (text, record, index, onEdit) => { + let options = []; + let isMust = false; + let showName = ''; + + if (com.key == "attributeValue" && record.attributeType && record.attributeType == "0") { + let valueType; + if ("subValue" == record.attributeName) { + valueType = "subcompany"; + } else if ("depValue" == record.attributeName) { + valueType = "department"; + } else if ("userValue" == record.attributeName) { + valueType = "user"; + } + options = template && template[valueType] && template[valueType].options ? template[valueType].options.slice() : []; + + } else if (com.key == "attributeName") { + if (template && template[type] && template[type].datas && template[type].datas[record.attributeName]) { + isMust = true; + showName = template[type].datas[record.attributeName].showName; + } + } + + let inputType = 'input'; + let value; + if (com.key == 'attributeName') { + value = record.attributeName; + } else if (com.key == 'attributeValue') { + value = record.attributeValue; + } + if (!value || value == "" && options.length > 0) { + inputType = 'select'; + } else { + for (let v of options) { + if (v && v.key && v.key == value) { + inputType = 'select'; + } + } + } + + + return ( { + onEdit({record, index, key, value}); + }} + >); + } + } + } + + /** + * 获取Input、Select切换组件 + * @param type + * @param com + * @returns {{key, type: {label: string, type: string, viewAttr: string, key: string, width: number}[], render: function(*, *=, *, *)}} + */ + getInputSelect = (type, com) => { + const {ldapStore} = this.props; + const {template, formart} = ldapStore; + + return { + key: com.key, + type: com.type, + render: (text, record, index, onEdit) => { + let options = []; + let isMust = false; + let showName = ''; + + if (com.key == "attributeValue") { + if (record.attributeType && record.attributeType == "2") { + options = formart ? formart.slice() : []; + } else { + options = template && template[type] && template[type].options ? template[type].options.slice() : []; + } + } else if (com.key == "attributeName") { + if (template && template[type] && template[type].datas) { + if (template[type].datas[record.attributeName] + && template[type].datas[record.attributeName].isMust == "1") { + isMust = true; + showName = template[type].datas[record.attributeName].showName; + } else { + isMust = false; + let datas = template[type].datas; + for (let op in datas) { + if (datas[op].isMust != "1") { + options.push({ + key: op, + showname: datas[op].showName + }); + } + } + } + } + } + + let inputType = 'input'; + let value; + if (com.key == 'attributeName') { + value = record.attributeName; + } else if (com.key == 'attributeValue') { + value = record.attributeValue; + } + + + for (let v of options) { + if (v && v.key && v.key == value) { + inputType = 'select'; + } + } + + if(!value || (value == '' && options.length > 0) || (value && options.length == 0)) { + inputType ='select'; + } + + // if (!value || value == "" && options.length > 0) { + // inputType = 'select'; + // } else { + // for (let v of options) { + // if (v && v.key && v.key == value) { + // inputType = 'select'; + // } + // } + // } + /** + * 对应字段后面的 切换 按钮,是什么情况下都不会置灰的; + * 字段对应值那儿的 切换 按钮,在数据类型为 自定义接口 和 固定值 时,是置灰的 + */ + return ( { + //如果是属性名,同时修改默认属性值类型、默认属性值 + if (key == "attributeName" && template && template[type] && template[type].datas + && template[type].datas[value]) { + + Object.assign(record, template[type].datas[value]); + if("1" === record.attributeType) { + Object.assign(record,{attributeOperation:"1"}); + } else{ + Object.assign(record,{attributeOperation:"0"}); + } + } + onEdit({record, index, key, value}); + }} + >); + } + } + } + + /** + * 禁用行 + * @param editType + * @param rowSelection + * @returns {{}} + */ + getRowSelection = (editType, rowSelection) => { + const sel = {...rowSelection}; + if (editType == "attributeSet" || editType == "subcompanySet" || editType == "departmentSet" + || editType == "userSet" || editType == "pushSubcompanySet" || editType == "pushDepartmentSet" + || editType == "pushUserSet") { + + sel.getCheckboxProps = record => { + return {disabled: record.isMust == "1"}; + }; + } else if (editType == "pushAttributeSet") { + return undefined; + } + + return sel; + } + + initTableData = (editType,rowKey,datas) =>{ + let ret = new Object(); + let cells = new Array(); + + if(datas){ + for(let data of datas){ + if(data.subcompanyId){ + cells.push({ + [rowKey]: data[rowKey], + departmentId: { + com: [{ + viewAttr: 2, + editType: 1, + label: "", + type: "BROWSER", + browserConditionParam: { + type: "4", + title: getLabel(27511,"部门"), + icon: "icon-coms-hrm", + iconBgcolor: "#217346", + hasAddBtn: false, + hasAdvanceSerach: true, + hasBorder: false, + hideVirtualOrg: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: (window.ecologyContentPath || "") + "/spa/hrm/engine.html#/hrmengine/organization?showTree=false&type=department&id=", + showCheckStrictly: true, + dataParams:{ + subcompanyid1:data.subcompanyId + }, + tabs: [{ + isSearch: false, + key: "2", + name: getLabel(25332,"组织结构"), + selected: false, + showOrder: 0 + },{ + dataParams: { + list: "1" + }, + isSearch: true, + key: "1", + name: getLabel(130619,"按列表"), + selected: false, + showOrder: 0 + }] + }, + key: "departmentId" + }] + } + }); + } + } + } + ret.cells = cells; + return ret; + } + + getBase = () => { + const {ldapStore} = this.props; + const {getBase} = ldapStore; + + getBase('base'); + } + + getBtns = () => { + const {ldapStore} = this.props; + const {buttoninfo} = toJS(ldapStore.status); + + let btnArr = []; + buttoninfo && buttoninfo.map(b => { + btnArr.push( + ); + }); + return btnArr; + } + + getMoreBtn = () => { + const {ldapStore} = this.props; + const {moreBtninfo} = toJS(ldapStore.status); + let btnArr = []; + moreBtninfo && moreBtninfo.map(m => { + btnArr.push({ + key: m.key, + icon: , + content: m.btnName, + onClick: () => this.onRightMenuClick(m.type) + }); + }); + return btnArr; + } + + onRightMenuClick = () => { + const {ldapStore} = this.props; + const {topinfo} = toJS(ldapStore.status); + + ldapStore.getBase(topinfo.tab.selectedKey); + } + + getRightMenu = () => { + const {ldapStore} = this.props; + const {menuinfo} = toJS(ldapStore.status); + let btnArr = []; + menuinfo && menuinfo.map(m => { + btnArr.push({ + key: m.type, + icon: , + content: m.menuName, + onClick: () => this.onRightMenuClick(m.type) + }); + }); + return btnArr; + } + + getTab = () => { + const {ldapStore} = this.props; + const {status} = ldapStore; + const {topinfo} = toJS(status); + + if (topinfo && topinfo.tab) { + return ( { + var that = this; + setTimeout(function(){ + topinfo.tab.selectedKey = tabKey; + ldapStore.setState({ + topinfo: topinfo, + testInitDatas: {}, + errorMessage: '', + }); + ldapStore.getBase(tabKey); + }, 300) + }} + />); + } + } + + getColumns = (columns) => { + let datas = []; + + columns && columns.map(column => { + if(column['key'] == 'status') { + datas.push({ + dataIndex: column['dataIndex'], + key: column['key'], + sorter: column['sorter'], + title: column['title'], + render: (text, record) => { + if(text == '1') { + return + }else if(text == '0') { + return ×{record.details != undefined ? : ''} + }else if(text == '2') { + return !{record.details != undefined ? : ''} + } + } + }) + }else { + datas.push({ + dataIndex: column['dataIndex'], + key: column['key'], + sorter: column['sorter'], + title: column['title'] + }) + } + }) + + return datas; + } + + getTest = () => { + const {ldapStore} = this.props; + const {status} = ldapStore; + const {testColumns, testTitle, testInitDatas} = toJS(status); + let group = []; + + for(let key in testInitDatas) { + let items = []; + items.push({ + com: ( + ), + colSpan: 1 + }) + group.push(); + } + + return group; + } + + getErrorMessage = () => { + const {ldapStore} = this.props; + const {status} = ldapStore; + const {errorMessage} = toJS(status); + + return

{errorMessage}

+ } + + render() { + const {ldapStore} = this.props; + const {status, listStore, baseSetStore} = ldapStore; + const {listApiUrl, baseApiUrl, baseDatas, showBase, showLogDetail, key, baseKey, logDatas, testInitDatas, dialogType, showTestVersion, topinfo, collectinfo, errorMessage} = toJS(status); + + return
+ { + ldapStore.setState({ + logDatas: { + show: false, + targetId: '' + } + }); + }} + colums={ + [ + { + type: 'BTN_EDIT', + key: 'ldapid' + }, + { + type: 'BTN_EDIT', + key: 'formartid' + } + ] + } + onMenuClick={this.onListMenuClick} + onRowClick={this.onListRowClick} + onColumClick={this.onColumClick} + onTabListChange={this.onTabListChange} + /> + { + ldapStore.ldapRef = r + }} + key={baseKey} + dialogType={dialogType} + apiUrl={baseApiUrl} + show={showBase} + showLogDetail={showLogDetail} + baseSetStore={baseSetStore} + datas={baseDatas} + initTableData={this.initTableData} + onMenuClick={this.onBaseMenuClick} + onTabChange={this.onBaseTabChange} + initTableEdit={this.initBaseTableEdit} + initCustomColum={this.initBaseTableEditColumn} + getRowSelection={this.getRowSelection} + willEdit={this.willEdit} + onRowClick={this.onListRowClick} + onColumClick={this.onColumClick} + onCancel={() => { + ldapStore.setState({ + showBase: false, + showLogDetail: false + }); + }} + colums={ + [ + { + type: 'BTN_DETAIL_LOG', + key: 'ldapId' + }, + { + type: 'BTN_DETAIL_LOG', + key: 'fileName' + } + ] + } + /> + + ldapStore.setState({showTestVersion: false})} + hasScroll={true} + title={topinfo.title} + icon={topinfo.icon} + iconBgcolor={topinfo.iconColor} + style={{width: 800, height: 600}} + buttons={this.getBtns()} + moreBtn={this.getMoreBtn().length > 0 ? { + datas: this.getMoreBtn(), + collectParams: collectinfo + } : []} + > + + {this.getTab()} + + {errorMessage == '' ? this.getTest() : this.getErrorMessage()} + + + +
+ } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/login/AlgorithmFormSetting.js b/pc4backstage/integration/components/login/AlgorithmFormSetting.js new file mode 100644 index 0000000..3042868 --- /dev/null +++ b/pc4backstage/integration/components/login/AlgorithmFormSetting.js @@ -0,0 +1,279 @@ +import { + inject, + observer, +} from 'mobx-react' +import { + WeaFormItem, + WeaSearchGroup, + WeaLocaleProvider, +} from 'ecCom' +import { + Spin, +} from 'antd' +import { + WeaSwitch +} from 'comsMobx' +const getLabel = WeaLocaleProvider.getLabel + +@inject('intelogin') +@observer +export default class AlgorithmFormSetting extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + this.props.intelogin.getAlgorithmForm(); + } + + componentWillUnmount() { + this.props.intelogin.resetAlgorithmForm(); + } + + getForm = () => { + const { + intelogin + } = this.props, { + algorithmForm, + mainTable, + } = intelogin, { + form, + condition, + } = algorithmForm, { + isFormInit, + } = form, { + isSysAlgorithm + } = mainTable; + + let outterArray = []; + isFormInit && condition.forEach((c, i) => { + let innerArray = [], + eleStyle = (i == 1 ? {margin: "0 -20px"} : {}); + + c && c.items && c.items.forEach(field => { + const key = field.domkey[0]; + + if (i == 0 && this.filter({ + isSysAlgorithm, + key + })) { + return + } + + innerArray.push({ + com: (
+ + + +
), + colSpan: 1 + }) + + if (i == 0) { + innerArray = [...innerArray, { + com: ( + this.add({ + isSysAlgorithm, + key, + form, + }) + ), + colSpan: 1 + }] + } + }) + outterArray.push( + + ) + }) + return outterArray; + } + + filter = (params) => { + const { + isSysAlgorithm, + key + } = params; + + if (!isSysAlgorithm && (key == 'isneedpwd' || key == 'password' || key == 'isneediv' || key == 'ivparam')) { + return true + } + } + + add = (params) => { + const { + isSysAlgorithm, + key, + form, + } = params; + + let temp = []; + if (!isSysAlgorithm && key == 'decryptmethod') { + ['getPwd', 'getIv'].map(f => { + temp.push(this[f]({ + form, + })) + }); + } + + return temp; + } + + getPwd = (params) => { + const { + intelogin + } = this.props, { + algorithmForm + } = intelogin, { + pwd, + isneedpwd, + } = algorithmForm, { + form + } = params; + + return ( + +
+ {pwd.map((field, index) => { + if (isneedpwd !== '1' && index == 1) return + + return ( + this.handleChange(cb)}/> + ) + })} +
+
+ ) + } + + getIv = (params) => { + const { + intelogin + } = this.props, { + algorithmForm + } = intelogin, { + iv, + isneediv + } = algorithmForm, { + form + } = params; + + return ( + +
+ {iv.map((field, index) => { + if (isneediv !== '1' && index == 1) return + + return ( + this.handleChange(cb)}/> + ) + })} +
+
+ ) + } + + handleChange = (cb) => { + const { + intelogin + } = this.props, { + exportafsSelectedValue, + checkTableFieldValueUnique, + mainTable, + algorithmForm, + } = intelogin, { + id + } = mainTable; + + Object.entries(cb).map(arr => { + const key = arr[0], + t = arr[1], + val = Array.isArray(t.value) ? t.value[0] : t.value; + + exportafsSelectedValue({ + val, + key + }); + + (key == 'encryptname') && ['outter_encryptclass_sys', 'outter_encryptclass'].map((v, i) => { + // 加密算法有两个入口,集成设置新建弹窗自定义加密算法入口和加密tab页新建入口,因此校验的时候需要注意 + checkTableFieldValueUnique({ + tableName: v, + fieldName: 'encryptname', + fieldValue: val.replace(/^(\s*)|(\s*)$/g, ''), + idName: 'id', + idValue: algorithmForm.from ? "" : id + }, i, algorithmForm.from); + }) + + }); + } + + render() { + const { + intelogin, + } = this.props, { + algorithmForm, + } = intelogin, { + loading, + } = algorithmForm; + + if (loading) { + return ( +
+ +
+ ) + } else { + return ( +
+ {this.getForm()} +
+ ) + } + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/login/AlgorithmTestForm.js b/pc4backstage/integration/components/login/AlgorithmTestForm.js new file mode 100644 index 0000000..9bb3560 --- /dev/null +++ b/pc4backstage/integration/components/login/AlgorithmTestForm.js @@ -0,0 +1,131 @@ +import { + inject, + observer, +} from 'mobx-react' +import { + WeaSearchGroup, + WeaFormItem, + WeaLocaleProvider, +} from 'ecCom' +import { + WeaSwitch +} from 'comsMobx' +import { + Spin, +} from 'antd' +const getLabel = WeaLocaleProvider.getLabel + +@inject('intelogin') +@observer +export default class AlgorithmTestForm extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + this.props.intelogin.getAlgorithmTestForm() + } + + componentWillUnmount() { + this.props.intelogin.resetAlgorithmTestForm() + } + + getTestResult = () => { + const { + intelogin + } = this.props, { + algorithmTestForm, + } = intelogin, { + testResult + } = algorithmTestForm; + + return testResult && Object.entries(testResult).map(arr => { + return ( +
+ {arr[0]} + { + (arr[1] == '0') + ? + : + } +
+ ) + }); + } + + getForm = () => { + const { + intelogin + } = this.props, { + algorithmTestForm, + } = intelogin, { + condition, + form, + } = algorithmTestForm, { + isFormInit + } = form; + + let outterArray = []; + isFormInit && condition.map((c, i) => { + let innerArray = []; + c.items.map((field) => { + const key = field.domkey[0]; + innerArray.push({ + com: ( + + {} + + ), + colSpan: 1 + }) + }) + outterArray.push() + }) + + return outterArray; + } + + render() { + const { + intelogin + } = this.props, { + algorithmTestForm, + } = intelogin, { + loading, + } = algorithmTestForm; + + + if (loading) { + return ( +
+ +
+ ) + } else { + return ( +
+ + {this.getForm()} +
+ ) + } + + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/login/ErrorDialog.js b/pc4backstage/integration/components/login/ErrorDialog.js new file mode 100644 index 0000000..aca0be8 --- /dev/null +++ b/pc4backstage/integration/components/login/ErrorDialog.js @@ -0,0 +1,47 @@ +import { + inject, + observer +} from 'mobx-react' +import { + WeaDialog, +} from 'ecCom' +import { toJS } from "mobx"; +import { Button } from "antd"; + +@inject('intelogin') +@observer +export default class ErrorDialog extends React.Component { + constructor(props) { + super(props); + this.state = {} + } + + render() { + const {intelogin} = this.props; + const {showErrorDialog,errorMessage} = toJS(intelogin.status); + + let buttons = [ + , + ]; + return ( +
+ { + intelogin.setState({showErrorDialog : false}); + }} + buttons={buttons} + > +
+

{errorMessage}

+
+
+
+ ) + } +} \ No newline at end of file diff --git a/pc4backstage/integration/components/login/Expression.js b/pc4backstage/integration/components/login/Expression.js new file mode 100644 index 0000000..d713bf9 --- /dev/null +++ b/pc4backstage/integration/components/login/Expression.js @@ -0,0 +1,113 @@ +import { + inject, + observer, +} from 'mobx-react' +import { + WeaInput, + WeaNewScroll, + WeaHelpfulTip, + WeaLocaleProvider, +} from 'ecCom' +const getLabel = WeaLocaleProvider.getLabel + +import TextArea from './TextArea'; + +@inject('intelogin') +@observer +export default class Expression extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + this.props.intelogin.getAllParams(); + } + + componentWillUnmount() { + this.props.intelogin.resetExpression(); + } + + + render() { + const { + intelogin + } = this.props, { + expression, + exportDelimiter, + insertDelimiter, + insertParams, + } = intelogin, { + allParams, + value, + } = expression; + + const regExp = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]·!#¥(——):;“”‘、,|《。》?、【】[\]]/im; + + return ( +
+
+
+
+ + {getLabel(1361, '基本信息')} +
+
+
{getLabel(15636,'表达式')}
+
+