From 8c6d1df37c0586f4b2fe1fa86081ccc2735135c5 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 10 May 2022 18:02:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=89=E7=BA=A7=E6=96=B9=E6=A1=88=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AE=8C=E6=88=90=20=E8=81=8C=E7=AD=89=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AE=8C=E6=88=90=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/jobgrade.js | 0 pc4mobx/organization/apis/joblevel.js | 0 pc4mobx/organization/apis/rankscheme.js | 54 +++ .../components/NewAndEditDialog.js | 133 ++++++ .../components/postionrank/JobGrade.js | 425 +++++++++++++++++ .../components/postionrank/JobLevel.js | 426 ++++++++++++++++++ .../components/postionrank/RankScheme.js | 83 +++- pc4mobx/organization/index.js | 4 + pc4mobx/organization/public/i18n.js | 131 +++--- pc4mobx/organization/stores/index.js | 6 +- pc4mobx/organization/stores/jobgrade.js | 333 ++++++++++++++ pc4mobx/organization/stores/joblevel.js | 333 ++++++++++++++ pc4mobx/organization/stores/rankscheme.js | 281 +++++++----- pc4mobx/organization/style/common.less | 22 + pc4mobx/organization/style/index.less | 2 +- 15 files changed, 2051 insertions(+), 182 deletions(-) create mode 100644 pc4mobx/organization/apis/jobgrade.js create mode 100644 pc4mobx/organization/apis/joblevel.js create mode 100644 pc4mobx/organization/components/NewAndEditDialog.js create mode 100644 pc4mobx/organization/components/postionrank/JobGrade.js create mode 100644 pc4mobx/organization/components/postionrank/JobLevel.js create mode 100644 pc4mobx/organization/stores/jobgrade.js create mode 100644 pc4mobx/organization/stores/joblevel.js create mode 100644 pc4mobx/organization/style/common.less diff --git a/pc4mobx/organization/apis/jobgrade.js b/pc4mobx/organization/apis/jobgrade.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/apis/joblevel.js b/pc4mobx/organization/apis/joblevel.js new file mode 100644 index 0000000..e69de29 diff --git a/pc4mobx/organization/apis/rankscheme.js b/pc4mobx/organization/apis/rankscheme.js index e2c225a..7a1aee7 100644 --- a/pc4mobx/organization/apis/rankscheme.js +++ b/pc4mobx/organization/apis/rankscheme.js @@ -5,4 +5,58 @@ import { export const getSearchList = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTable', 'GET', params); +} + +export const deleteTableData = (params) => { + //return WeaTools.callApi('/api/bs/hrmorganization/scheme/deleteByIds', 'POST', 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 WeaTools.callApi('/api/bs/hrmorganization/scheme/save', 'POST', 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); } \ No newline at end of file diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js new file mode 100644 index 0000000..b447c5a --- /dev/null +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -0,0 +1,133 @@ +import { + WeaDialog, + WeaFormItem, + WeaNewScroll, + WeaSearchGroup, + WeaMoreButton, +} from 'ecCom' + +import { + Spin, + Button, +} from 'antd' + +import { + WeaSwitch +} from 'comsMobx' + +import { + i18n +} from '../public/i18n'; + +export default class NewAndEditDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + width: 700, + } + } + + + getForm() { + const { + condition, + form, + isFormInit, + } = this.props; + + let arr = []; + isFormInit && condition.map(c => { + c.items.map((field, index) => { + arr.push( + {} + ) + }) + }) + return
{arr}
+ } + + getSearchGroupForm() { + const { + condition, + form, + isFormInit, + domkey, + isEdit + } = this.props; + + let arr = []; + isFormInit && condition.map((c, i) => { + let _arr = []; + c.items.map((field, index) => { + _arr.push({ + com: ( + + + + ), + colSpan: 1 + }) + }) + arr.push() + }) + + return arr; + } + + + + render() { + const { + title, + visible, + save, + onCancel, + loading, + isEdit, + height, + conditionLen, + } = this.props, { + width, + } = this.state; + + const buttons = [ + (), + () + ]; + + return ( + onCancel() } + buttons={isEdit?buttons:buttons.slice(1,2)} + style={{width: width, height: height}} + > + { + loading ?
+ +
+ :
1 ? '' : 'hrm-dialog-form'}> + {conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()} +
+ } +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/postionrank/JobGrade.js b/pc4mobx/organization/components/postionrank/JobGrade.js new file mode 100644 index 0000000..8a3b279 --- /dev/null +++ b/pc4mobx/organization/components/postionrank/JobGrade.js @@ -0,0 +1,425 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, +} 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'; + + + +const toJS = mobx.toJS; +const confirm = Modal.confirm; +const WeaTable = WeaTableNew.WeaTable; + + +@inject('jobGrade') +@observer +export default class JobGrade extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + const { + jobGrade + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + jobGrade + } = this.props; + jobGrade.getTableInfo(); + jobGrade.getHasRight(); + } + + getTopMenuBtns() { + const { + jobGrade + } = this.props; + const { + topMenu, + tableStore + } = jobGrade; + + let btns = []; + topMenu.map((item, i) => { + if (item.menuFun !== 'batchDelete') { + btns.push(); + } else { + btns.push(); + } + + }); + + return btns; + } + + handleClick(item) { + const { + jobGrade + } = this.props; + const { + isPanelShow + } = jobGrade; + + isPanelShow && jobGrade.setPanelStatus(false); + this[item.menuFun] && this[item.menuFun](); + } + + new() { + const { + jobGrade + } = this.props; + + jobGrade.setNeDialogTitle(i18n.label.newRankScheme()); + jobGrade.setIsNew(true); + jobGrade.setVisible(true); + jobGrade.getForm(); + } + + batchDelete() { + const { + jobGrade + } = this.props; + const { + tableStore + } = jobGrade; + + let keys = toJS(tableStore.selectedRowKeys).toString(); + jobGrade.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 { + jobGrade + } = this.props; + jobGrade.delete(); + } + + + getDropMenuDatas() { + const { + jobGrade + } = this.props; + const { + rightMenu + } = jobGrade; + + 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) { + + } + + getTabBtn() { + const { + jobGrade + } = this.props; + const { + form2 + } = jobGrade; + + const btn = [ + (), + (), + (), + ]; + + return btn; + } + + onSearchChange(val) { + const { + jobGrade + } = this.props; + const { + form2 + } = jobGrade; + + jobGrade.setRankName(val); + !this.isEmptyObject(form2.getFormParams()) && jobGrade.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)} /> + } + }; + }) + } + + updateForbiddenTag(checked,id) { + const { + jobGrade + } = this.props; + jobGrade.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 { + jobGrade + } = this.props; + + jobGrade.setNeDialogTitle(i18n.label.editRankScheme()); + jobGrade.setLevelId(id); + jobGrade.setIsNew(false); + jobGrade.setVisible(true); + jobGrade.getForm(); + } + + doDel(id) { + const { + jobGrade + } = this.props; + jobGrade.setIds(id); + this.showConfirm('del'); + } + + + handleSave() { + const { + jobGrade + } = this.props; + const { + isNew + } = jobGrade; + + isNew && jobGrade.save(); + !isNew && jobGrade.edit(); + } + + getPanelComponents() { + const { + jobGrade + } = this.props; + const { + searchCondition, + form2, + searchConditionLoading + } = jobGrade; + + 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") { + jobGrade.getTableInfo(); + jobGrade.setPanelStatus(false) + } + }}>{arr} + } + + } + + //非空判断 + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + + + render() { + + const { + jobGrade + } = this.props; + const { + isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition, + form,dialogLoading,isEdit,selectedKey + } = jobGrade; + + const topTab = [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: "全部", + viewcondition: "0" + }, + { + color: "#ff3232", + groupid: "flowNew", + showcount: true, + title: "启用", + viewcondition: "1" + }, + { + color: "#fea468", + groupid: "flowRes", + showcount: true, + title: "禁用", + viewcondition: "2" + } + ]; + const topTabCount = { + flowAll: "120", + flowNew: "112", + flowOver: "0", + }; + + return ( +
+ this.handleMenuClick(key)} + > + } + iconBgcolor='#217346' + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={(e) => 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)} + /> +
+
+ this.handleSave()} + onCancel={() => jobGrade.setVisible(false)} + /> +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js new file mode 100644 index 0000000..020cd11 --- /dev/null +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -0,0 +1,426 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer, +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, +} 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'; + + + +const toJS = mobx.toJS; +const confirm = Modal.confirm; +const WeaTable = WeaTableNew.WeaTable; + + +@inject('jobLevel') +@observer +export default class JobLevel extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillReceiveProps(nextProps) { + const { + jobLevel + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + jobLevel + } = this.props; + jobLevel.getTableInfo(); + jobLevel.getHasRight(); + } + + getTopMenuBtns() { + const { + jobLevel + } = this.props; + const { + topMenu, + tableStore + } = jobLevel; + + let btns = []; + topMenu.map((item, i) => { + if (item.menuFun !== 'batchDelete') { + btns.push(); + } else { + btns.push(); + } + + }); + + return btns; + } + + handleClick(item) { + const { + jobLevel + } = this.props; + const { + isPanelShow + } = jobLevel; + + isPanelShow && jobLevel.setPanelStatus(false); + this[item.menuFun] && this[item.menuFun](); + } + + new() { + const { + jobLevel + } = this.props; + + jobLevel.setNeDialogTitle(i18n.label.newRankScheme()); + jobLevel.setIsNew(true); + jobLevel.setVisible(true); + jobLevel.getForm(); + } + + batchDelete() { + const { + jobLevel + } = this.props; + const { + tableStore + } = jobLevel; + + let keys = toJS(tableStore.selectedRowKeys).toString(); + jobLevel.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 { + jobLevel + } = this.props; + jobLevel.delete(); + } + + + getDropMenuDatas() { + const { + jobLevel + } = this.props; + const { + rightMenu + } = jobLevel; + + 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) { + + } + + getTabBtn() { + const { + jobLevel + } = this.props; + const { + form2 + } = jobLevel; + + const btn = [ + (), + (), + (), + ]; + + return btn; + } + + onSearchChange(val) { + const { + jobLevel + } = this.props; + const { + form2 + } = jobLevel; + + jobLevel.setLevelName(val); + !this.isEmptyObject(form2.getFormParams()) && jobLevel.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)} /> + } + }; + }) + } + + updateForbiddenTag(checked,id) { + const { + jobLevel + } = this.props; + jobLevel.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 { + jobLevel + } = this.props; + + jobLevel.setNeDialogTitle(i18n.label.editRankScheme()); + jobLevel.setLevelId(id); + jobLevel.setIsNew(false); + jobLevel.setVisible(true); + jobLevel.getForm(); + } + + doDel(id) { + const { + jobLevel + } = this.props; + jobLevel.setIds(id); + this.showConfirm('del'); + } + + + handleSave() { + const { + jobLevel + } = this.props; + const { + isNew + } = jobLevel; + + isNew && jobLevel.save(); + !isNew && jobLevel.edit(); + } + + getPanelComponents() { + const { + jobLevel + } = this.props; + const { + searchCondition, + form2, + searchConditionLoading + } = jobLevel; + + 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") { + jobLevel.getTableInfo(); + jobLevel.setPanelStatus(false) + } + }}>{arr} + } + + } + + //非空判断 + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + + + + render() { + + const { + jobLevel + } = this.props; + const { + isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition, + form,dialogLoading,isEdit,selectedKey + } = jobLevel; + + const topTab = [ + { + color: "#000000", + groupid: "flowAll", + showcount: true, + title: "全部", + viewcondition: "0" + }, + { + color: "#ff3232", + groupid: "flowNew", + showcount: true, + title: "启用", + viewcondition: "1" + }, + { + color: "#fea468", + groupid: "flowRes", + showcount: true, + title: "禁用", + viewcondition: "2" + } + ]; + const topTabCount = { + flowAll: "120", + flowNew: "112", + flowOver: "0", + }; + + return ( +
+ this.handleMenuClick(key)} + > + } + iconBgcolor='#217346' + loading={true} + buttons={this.getTopMenuBtns()} + showDropIcon={true} + dropMenuDatas={this.getDropMenuDatas()} + onDropMenuClick={(e) => 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)} + /> +
+
+ this.handleSave()} + onCancel={() => jobLevel.setVisible(false)} + /> +
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 0a41678..41deb7d 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -27,6 +27,12 @@ import { i18n } from '../../public/i18n'; +import '../../style/common.less'; + +import NewAndEditDialog from '../NewAndEditDialog'; + + + const toJS = mobx.toJS; const confirm = Modal.confirm; const WeaTable = WeaTableNew.WeaTable; @@ -98,6 +104,17 @@ export default class RankScheme extends React.Component { this[item.menuFun] && this[item.menuFun](); } + new() { + const { + rankScheme + } = this.props; + + rankScheme.setNeDialogTitle(i18n.label.newRankScheme()); + rankScheme.setIsNew(true); + rankScheme.setVisible(true); + rankScheme.getForm(); + } + batchDelete() { const { rankScheme @@ -194,20 +211,59 @@ export default class RankScheme extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return console.log(checked)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) } + updateForbiddenTag(checked,id) { + const { + rankScheme + } = this.props; + rankScheme.updateForbiddenTag(checked,id); + } + onOperatesClick(record, rowIndex, operate) { const { index } = operate; + (index == '0') && this.doEdit(record.randomFieldId); + (index == '1') && this.doDel(record.randomFieldId); - // (index == '0') && this.doEdit(record.randomFieldId); - // (index == '1') && this.doDel(record.randomFieldId); - // (index == '2') && this.deLog(record.randomFieldId); + } + + doEdit(id) { + const { + rankScheme + } = this.props; + + rankScheme.setNeDialogTitle(i18n.label.editRankScheme()); + rankScheme.setSchemeId(id); + rankScheme.setIsNew(false); + rankScheme.setVisible(true); + rankScheme.getForm(); + } + + doDel(id) { + const { + rankScheme + } = this.props; + rankScheme.setIds(id); + this.showConfirm('del'); + } + + + handleSave() { + const { + rankScheme + } = this.props; + const { + isNew + } = rankScheme; + + isNew && rankScheme.save(); + !isNew && rankScheme.edit(); } getPanelComponents() { @@ -275,7 +331,8 @@ export default class RankScheme extends React.Component { rankScheme } = this.props; const { - isPanelShow, form2, schemeName, conditionNum, tableStore + isPanelShow, form2, schemeName, conditionNum, tableStore,nEdialogTitle,visible,condition, + form,dialogLoading,isEdit } = rankScheme; return ( @@ -297,7 +354,7 @@ export default class RankScheme extends React.Component { rankScheme.setPanelStatus(bool)} hideSearchAd={() => rankScheme.setPanelStatus(false)} searchsAd= {isPanelShow ? this.getPanelComponents() :
} @@ -315,8 +372,20 @@ export default class RankScheme extends React.Component { onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} /> - + this.handleSave()} + onCancel={() => rankScheme.setVisible(false)} + /> ) } diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 03fad76..f99c5d4 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -4,6 +4,8 @@ import { WeaLocaleProvider } from 'ecCom' import SimpleOrg from './components/tree/index'; import StandardOrg from './components/tree/standard_org' import RankScheme from './components/postionrank/RankScheme'; +import JobLevel from './components/postionrank/JobLevel'; +import JobGrade from './components/postionrank/JobGrade' import stores from './stores'; import './style/index'; @@ -20,6 +22,8 @@ const Routes = ( + + ); diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index f019ee8..c8b905e 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -109,6 +109,18 @@ export const i18n = { loginFailLog: () => getLabel('391172', "人员登入失败日志"), }, label: { + //新增 + schemeName: () => getLabel(385936, '等级方案'), + newRankScheme: () => getLabel(386246, '新建等级方案'), + editRankScheme: () => getLabel(386247, '编辑等级方案'), + levelName: () => getLabel(385936, '职等'), + newJobLevel: () => getLabel(386246, '新建职等'), + editJobLevel: () => getLabel(386247, '编辑职等'), + gradeName: () => getLabel(385936, '职级'), + newJobGrade: () => getLabel(386246, '新建职级'), + editJobGrade: () => getLabel(386247, '编辑职级'), + + authorizationGroup: () => getLabel(492, '权限组'), allAuthorization: () => getLabel(33363, '全部权限'), authorizationGroupInfo: () => getLabel(383045, '权限组信息'), @@ -206,7 +218,7 @@ export const i18n = { group: () => getLabel(81554, '常用组'), resource: () => getLabel(1867, '人员'), batchOperateTitle: () => getLabel(384039, '点击切换批量操作'), - canceled: () => getLabel('531114','已封存') , + canceled: () => getLabel('531114', '已封存'), noFileSelected: () => getLabel(384040, '未选择任何文件'), downLoadTemplete: () => getLabel(125333, '选择文件'), success: () => getLabel(15242, '成功'), @@ -380,7 +392,6 @@ export const i18n = { newSalaryItemsSet: () => getLabel(385934, '新建工资项设置'), editSalaryItemsSet: () => getLabel(385935, '编辑工资项设置'), levelSet: () => getLabel(385936, '等级设置'), - schemeName: () => getLabel(385936, '等级方案'), benchmarkSet: () => getLabel(33603, '个人基准设置'), customerSetting: () => getLabel(32470, '自定义设置'), condition: () => getLabel(15364, '条件'), @@ -601,7 +612,7 @@ export const i18n = { notIncludeChildren: () => getLabel('387277', "不包含下级"), haveNotDepartment: () => getLabel('387278', "您选择的分部下无部门信息,请重新选择!"), haveNotPerson: () => getLabel('387279', "您选择的部门下无人员信息,请重新选择!"), - '532854': () => getLabel('532854','所选分部无可调整的分部'), + '532854': () => getLabel('532854', '所选分部无可调整的分部'), adminSet: () => getLabel(17869, '管理员设置'), tips: () => getLabel('558', "提示"), dbEncryption: () => getLabel('387371', "数据库加密"), @@ -739,69 +750,69 @@ export const i18n = { newReserveNumber: () => getLabel(530311, '新建预留编号'), reNumber: () => getLabel(530312, '重新生成编号'), batchUnblock: () => getLabel(534247, '批量解锁人员'), - confirmBatchUnblock:()=>getLabel(534247,"是否确认批量解锁人员?"), - '529914':() => getLabel('529914','密级防篡改') , - '529915':() => getLabel('532553','什么是密级防篡改?') , - '387099':() => getLabel('387099','已启用'), - '32386':() => getLabel('32386','未启用'), - '31676':() => getLabel('31676','启用'), - '529920': () =>getLabel('529920','确定启用密级防篡改吗,启用后将不能再关闭!') , - '530834':() => getLabel('531835','层级间分隔符的长度不能超过10') , - '514133': ()=> getLabel(514133,"未设置"), - '530915': ()=>getLabel('530915','确定要停用该管理员的二次验证密码吗?') , - '530916': ()=>getLabel('530916','为确保账户安全,请及时重设密码!') , - '531833': ()=>getLabel('531833','开启后,可选择按分部进行单独流水') , + confirmBatchUnblock: () => getLabel(534247, "是否确认批量解锁人员?"), + '529914': () => getLabel('529914', '密级防篡改'), + '529915': () => getLabel('532553', '什么是密级防篡改?'), + '387099': () => getLabel('387099', '已启用'), + '32386': () => getLabel('32386', '未启用'), + '31676': () => getLabel('31676', '启用'), + '529920': () => getLabel('529920', '确定启用密级防篡改吗,启用后将不能再关闭!'), + '530834': () => getLabel('531835', '层级间分隔符的长度不能超过10'), + '514133': () => getLabel(514133, "未设置"), + '530915': () => getLabel('530915', '确定要停用该管理员的二次验证密码吗?'), + '530916': () => getLabel('530916', '为确保账户安全,请及时重设密码!'), + '531833': () => getLabel('531833', '开启后,可选择按分部进行单独流水'), - '531342': ()=>getLabel('531342','敏感词设置') , - '531343': ()=>getLabel('531343','敏感词列表') , - '531344':() => getLabel('531344','批量设置处理方式') , - '531345': ()=>getLabel('531345','编辑敏感词') , - '531346': ()=>getLabel('531346','添加敏感词') , - '531347':()=>getLabel('531347','敏感词类型') , - '531348':()=>getLabel('531348','新建敏感词类型') , - '531349':()=>getLabel('531349','编辑敏感词类型') , - '531350':()=>getLabel('531350','敏感词拦截列表') , - '531351': ()=>getLabel('531351','批量改为脱敏显示') , - '531352':() =>getLabel('531352','待审批敏感词列表') , - '531353': () =>getLabel('531353','批量添加到敏感词库') , + '531342': () => getLabel('531342', '敏感词设置'), + '531343': () => getLabel('531343', '敏感词列表'), + '531344': () => getLabel('531344', '批量设置处理方式'), + '531345': () => getLabel('531345', '编辑敏感词'), + '531346': () => getLabel('531346', '添加敏感词'), + '531347': () => getLabel('531347', '敏感词类型'), + '531348': () => getLabel('531348', '新建敏感词类型'), + '531349': () => getLabel('531349', '编辑敏感词类型'), + '531350': () => getLabel('531350', '敏感词拦截列表'), + '531351': () => getLabel('531351', '批量改为脱敏显示'), + '531352': () => getLabel('531352', '待审批敏感词列表'), + '531353': () => getLabel('531353', '批量添加到敏感词库'), - '531396': ()=>getLabel('531396','敏感词加密存储后则无法取消,确定加密吗?') , - '531439': ()=>getLabel('531439','敏感词导入') , + '531396': () => getLabel('531396', '敏感词加密存储后则无法取消,确定加密吗?'), + '531439': () => getLabel('531439', '敏感词导入'), - '531584': ()=>getLabel('531584','提醒设置') , - '531602': ()=>getLabel('531602','添加提醒设置') , - '531603':() => getLabel('531603','敏感词处理') , - '531604': ()=>getLabel('531604','确定要将敏感词脱敏显示吗?') , - '531605': ()=>getLabel('531605','(即用 * 号代替敏感词显示)') , - '531606': ()=>getLabel('531606','确定要将提交内容中的敏感词删除吗?') , - '531607': ()=>getLabel('531607','确定添加到敏感词库吗?') , - '531608': ()=>getLabel('531608','敏感词列表中已存在“**”!') , - '531609': ()=>getLabel('531609','编辑待审批敏感词') , - '531728': ()=>getLabel('531728','保存并添加到敏感词库') , - '531731': ()=>getLabel('531731','脱敏显示敏感词') , - '531732': ()=>getLabel('531732','删除敏感词') , - '532024': ()=>getLabel('532024','确定要将选中的敏感词添加到敏感词库吗?') , + '531584': () => getLabel('531584', '提醒设置'), + '531602': () => getLabel('531602', '添加提醒设置'), + '531603': () => getLabel('531603', '敏感词处理'), + '531604': () => getLabel('531604', '确定要将敏感词脱敏显示吗?'), + '531605': () => getLabel('531605', '(即用 * 号代替敏感词显示)'), + '531606': () => getLabel('531606', '确定要将提交内容中的敏感词删除吗?'), + '531607': () => getLabel('531607', '确定添加到敏感词库吗?'), + '531608': () => getLabel('531608', '敏感词列表中已存在“**”!'), + '531609': () => getLabel('531609', '编辑待审批敏感词'), + '531728': () => getLabel('531728', '保存并添加到敏感词库'), + '531731': () => getLabel('531731', '脱敏显示敏感词'), + '531732': () => getLabel('531732', '删除敏感词'), + '532024': () => getLabel('532024', '确定要将选中的敏感词添加到敏感词库吗?'), - '531678': ()=>getLabel('531678','开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:') , - '531679': ()=>getLabel('531679','1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;') , - '531680': ()=>getLabel('531680','2.导入人员-添加时,新创建的部门可自动生成部门编号;') , - '531681': ()=>getLabel('531681','3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;') , - '531682': ()=>getLabel('531682','【注意】开启前请先确认部门编号字段已启用!') , - '531683': ()=>getLabel('531683','总部节点的部门编号设置主要用于新建分部时将总部的编号设置自动复制给新分部,不用于全局的开关控制,实际根据各分部的开关独立控制。') , - - '531684': ()=>getLabel('531684','开启后,可根据设置的岗位编号规则自动生成岗位编号,涉及场景如下:') , - '531685': ()=>getLabel('531685','1.新建岗位和编辑岗位时可选择重新生成编号和选择预留编号;') , - '531686': ()=>getLabel('531686','2.导入人员-添加时,新创建的岗位可自动生成岗位编号;') , - '531687': ()=>getLabel('531687','3.岗位导入新岗位且岗位编号列为空时可自动生成编号;') , + '531678': () => getLabel('531678', '开启后,可根据设置的部门编号规则自动生成部门编号,涉及场景如下:'), + '531679': () => getLabel('531679', '1.手动新建和手动编辑部门时可选择重新生成编号和选择预留部门编号;'), + '531680': () => getLabel('531680', '2.导入人员-添加时,新创建的部门可自动生成部门编号;'), + '531681': () => getLabel('531681', '3.组织结构导入-添加新部门且部门编号列为空时可自动生成部门编号;'), + '531682': () => getLabel('531682', '【注意】开启前请先确认部门编号字段已启用!'), + '531683': () => getLabel('531683', '总部节点的部门编号设置主要用于新建分部时将总部的编号设置自动复制给新分部,不用于全局的开关控制,实际根据各分部的开关独立控制。'), - '531688': ()=>getLabel('531688','开启后,可根据设置的人员编号规则自动生成人员编号,涉及场景如下:') , - '531689': ()=>getLabel('531689','1.手动新建和手动编辑人员时可选择自动生成和选择预留人员编号;') , - '531690': ()=>getLabel('531690','2.导入人员类型选择-添加,导入Excel中人员编号为空时,可自动生成人员编号;') , - '531691': ()=>getLabel('531691','3.人员入职流程中人员编号字段为空时可自动生成人员编号;') , - '531692': ()=>getLabel('531692','说明:总部节点的人员编号设置主要用于新建分部时将总部的编号设置自动复制给新分部,不用于全局的开关控制,实际根据各分部的开关独立控制。') , + '531684': () => getLabel('531684', '开启后,可根据设置的岗位编号规则自动生成岗位编号,涉及场景如下:'), + '531685': () => getLabel('531685', '1.新建岗位和编辑岗位时可选择重新生成编号和选择预留编号;'), + '531686': () => getLabel('531686', '2.导入人员-添加时,新创建的岗位可自动生成岗位编号;'), + '531687': () => getLabel('531687', '3.岗位导入新岗位且岗位编号列为空时可自动生成编号;'), + + '531688': () => getLabel('531688', '开启后,可根据设置的人员编号规则自动生成人员编号,涉及场景如下:'), + '531689': () => getLabel('531689', '1.手动新建和手动编辑人员时可选择自动生成和选择预留人员编号;'), + '531690': () => getLabel('531690', '2.导入人员类型选择-添加,导入Excel中人员编号为空时,可自动生成人员编号;'), + '531691': () => getLabel('531691', '3.人员入职流程中人员编号字段为空时可自动生成人员编号;'), + '531692': () => getLabel('531692', '说明:总部节点的人员编号设置主要用于新建分部时将总部的编号设置自动复制给新分部,不用于全局的开关控制,实际根据各分部的开关独立控制。'), }, button: { - batchOpen:()=>getLabel(534249,'批量解锁'), + batchOpen: () => getLabel(534249, '批量解锁'), collect: () => getLabel(28111, '收藏'), helper: () => getLabel(275, '帮助'), search: () => getLabel(82529, '搜索'), @@ -886,7 +897,7 @@ export const i18n = { otherBatchOp: () => getLabel(534250, '其他批量操作'), importMatrix: () => getLabel('386933', "矩阵导入"), synchroDecentModules: () => getLabel(33901, "同步所有分权模块"), - bind: () => getLabel(514134,"绑定"), + bind: () => getLabel(514134, "绑定"), clickToSet: () => getLabel(-1, "点击设置"), moveToGroup: () => getLabel('-81296', "移动到组"), testConnect: () => getLabel('383271', "测试连接"), diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index 5fcc8e4..d77503f 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -2,9 +2,13 @@ import { SimpleOrgStore } from './tree/simple_org'; import {StandardOrgStore} from './tree/standard_org' import {RankSchemeStore} from './rankscheme'; +import {JobLevelStore} from './joblevel'; +import {JobGradeStore} from './jobgrade' module.exports = { simpleOrgStore: new SimpleOrgStore(), standardOrgStore: new StandardOrgStore(), - rankScheme: new RankSchemeStore() + rankScheme: new RankSchemeStore(), + jobLevel: new JobLevelStore(), + jobGrade: new JobGradeStore(), }; diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js new file mode 100644 index 0000000..11ad9cf --- /dev/null +++ b/pc4mobx/organization/stores/jobgrade.js @@ -0,0 +1,333 @@ +import { + observable, + action +} from 'mobx'; +import * as mobx from 'mobx'; +import * as Api from '../apis/jobgrade'; // 引入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 JobGradeStore { + @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 gradeName = ''; + @observable conditionNum = 2; + @observable ids = ''; //选择行id + @observable searchConditionLoading = true; + @observable nEdialogTitle = ''; + @observable visible = false; + @observable dialogLoading = true; + @observable gradeId = ''; + @observable date = ''; + @observable selectedKey = 0; + + + + @action + getTableInfo() { + let params; + this.tableStore = new TableStore(); + // if (this.isEmptyObject(this.form2.getFormParams())) { + // params = { + // ...this.form2.getFormParams(), + // gradeName: this.gradeName + // }; + // } else { + // params = { + // ...this.form2.getFormParams() + // }; + // } + // Api.getSearchList(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.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.gradeId }; + // 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.gradeId + } + 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() { + this.topMenu = [ + { + "isBatch": "1", + "isTop": "1", + "menuFun": "new", + "menuIcon": "icon-coms-New-Flow", + "menuName": "新建", + "type": "BTN_Addnew" + }, + { + "isBatch": "1", + "isTop": "1", + "menuFun": "batchDelete", + "menuIcon": "icon-coms-Batch-delete", + "menuName": "批量删除", + "type": "BTN_BatchDelete" + } + ]; + this.rightMenu = [ + { + "isBatch": "0", + "isTop": "1", + "menuFun": "new", + "menuIcon": "icon-coms-New-Flow", + "menuName": "新建", + "type": "BTN_Addnew" + }, + { + "isBatch": "0", + "isTop": "0", + "menuFun": "log", + "menuIcon": "icon-coms-Print-log", + "menuName": "日志", + "type": "BTN_log" + }, + { + "isBatch": "0", + "isTop": "0", + "menuFun": "custom", + "menuIcon": "icon-coms-task-list", + "menuName": "显示列定制", + "type": "BTN_COLUMN" + } + ] + } + + updateFields(val) { + this.form2.updateFields({ + gradeName: { + value: val + } + }); + } + + setSearchCondition(condition) { + this.searchCondition = condition; + } + + setScLoadingStatus(bool) { + this.searchConditionLoading = bool; + } + + setPanelStatus(bool) { + this.isPanelShow = bool; + bool && this.getSearchCondition(); + if (!bool) { + this.scLoadingReset(); + } + } + + setGradeName(val) { + this.gradeName = 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; + } + + setGradeId(gradeId) { + this.gradeId = gradeId; + } + + setDate(date) { + this.date = date; + } + + setSelectedKey(selectedKey) { + this.selectedKey = selectedKey; + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js new file mode 100644 index 0000000..98971ad --- /dev/null +++ b/pc4mobx/organization/stores/joblevel.js @@ -0,0 +1,333 @@ +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 JobLevelStore { + @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 = 0; + + + + @action + getTableInfo() { + let params; + this.tableStore = new TableStore(); + // if (this.isEmptyObject(this.form2.getFormParams())) { + // params = { + // ...this.form2.getFormParams(), + // levelName: this.levelName + // }; + // } else { + // params = { + // ...this.form2.getFormParams() + // }; + // } + // Api.getSearchList(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.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()); + // } + // }); + } + + 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.levelId + } + 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() { + this.topMenu = [ + { + "isBatch": "1", + "isTop": "1", + "menuFun": "new", + "menuIcon": "icon-coms-New-Flow", + "menuName": "新建", + "type": "BTN_Addnew" + }, + { + "isBatch": "1", + "isTop": "1", + "menuFun": "batchDelete", + "menuIcon": "icon-coms-Batch-delete", + "menuName": "批量删除", + "type": "BTN_BatchDelete" + } + ]; + this.rightMenu = [ + { + "isBatch": "0", + "isTop": "1", + "menuFun": "new", + "menuIcon": "icon-coms-New-Flow", + "menuName": "新建", + "type": "BTN_Addnew" + }, + { + "isBatch": "0", + "isTop": "0", + "menuFun": "log", + "menuIcon": "icon-coms-Print-log", + "menuName": "日志", + "type": "BTN_log" + }, + { + "isBatch": "0", + "isTop": "0", + "menuFun": "custom", + "menuIcon": "icon-coms-task-list", + "menuName": "显示列定制", + "type": "BTN_COLUMN" + } + ] + } + + 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; + } + +} \ No newline at end of file diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js index c47e0a6..658efd0 100644 --- a/pc4mobx/organization/stores/rankscheme.js +++ b/pc4mobx/organization/stores/rankscheme.js @@ -3,7 +3,7 @@ import { action } from 'mobx'; import * as mobx from 'mobx'; -import * as APi from '../apis/rankscheme'; // 引入API接口文件 +import * as Api from '../apis/rankscheme'; // 引入API接口文件 import { WeaForm } from 'comsMobx'; @@ -30,14 +30,20 @@ export class RankSchemeStore { @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 = ''; @@ -48,14 +54,16 @@ export class RankSchemeStore { let params; this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { - params = { ...this.form2.getFormParams(), - name: this.schemeName + params = { + ...this.form2.getFormParams(), + schemeName: this.schemeName }; } else { - params = { ...this.form2.getFormParams() + params = { + ...this.form2.getFormParams() }; } - APi.getSearchList(params).then(res => { + Api.getSearchList(params).then(res => { if (res.code === 200) { res.data.datas && this.tableStore.getDatas(res.data.datas, 1); } else { @@ -72,119 +80,127 @@ export class RankSchemeStore { let params = { ids: this.ids }; - // Api.deleteTableData(params).then(res => { - // if (res.api_status) { - // message.success(i18n.message.deleteSuccess()); - // this.getTableInfo(); - // } else { - // message.warning(data.message); - // } - // }, error => { - // message.warning(error.message); - // }) + 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 }; + debugger + 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); - let conditions = [ - { - "title": "高级查询条件", - "defaultshow": true, - "items": [ - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "name" - ], - "entSearch": false, - "fieldcol": 16, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "办公地点简称", - "labelcol": 8, - "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 - }, - { - "belong": "PC", - "checkbox": false, - "checkboxValue": false, - "colSpan": 2, - "conditionType": "INPUT", - "dateGroup": false, - "defaultDisplayInBar": false, - "detailtype": 1, - "domkey": [ - "mark" - ], - "entSearch": false, - "fieldcol": 16, - "hasBorder": false, - "helpfulTipProps": {}, - "hide": false, - "isBase64": false, - "isQuickSearch": false, - "label": "办公地点全称", - "labelcol": 8, - "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 - } - ] + 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); } - ] - this.setSearchCondition(conditions); - this.form2.initFormFields(conditions); - - - // Api.getAdvanceSearchCondition().then(res => { - // if (res.api_status) { - // this.setScLoadingStatus(false); - // res.conditions && this.setSearchCondition(res.conditions); - // res.conditions && this.form2.initFormFields(res.conditions); - // } else { - // message.warning(data.message); - // } - // }, error => { - // message.warning(error.message); - // }) + }, error => { + message.warning(error.msg); + }) } - + @action getHasRight() { this.topMenu = [ @@ -235,7 +251,7 @@ export class RankSchemeStore { updateFields(val) { this.form2.updateFields({ - name: { + schemeName: { value: val } }); @@ -276,4 +292,43 @@ export class RankSchemeStore { 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; + } + + setDate(date) { + this.date = date; + } + } \ No newline at end of file diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less new file mode 100644 index 0000000..bf62c98 --- /dev/null +++ b/pc4mobx/organization/style/common.less @@ -0,0 +1,22 @@ +/* 公共样式 */ +.hrm-loading-center-small{ + position: absolute; + top:50%; + left:50%; + margin-left:-8px; + margin-top: -8px; + } + + .hrm-dialog-form{ + padding-top: 27px; + padding-right: 8%; + padding-left: 8%; + padding-bottom: 25px; + + .wea-upload-list-item { + & > div{ + width: 400px !important; + line-height: 30px; + } + } + } \ No newline at end of file diff --git a/pc4mobx/organization/style/index.less b/pc4mobx/organization/style/index.less index b60ef04..2915a1e 100644 --- a/pc4mobx/organization/style/index.less +++ b/pc4mobx/organization/style/index.less @@ -1,4 +1,4 @@ -/* 公共样式 */ + // loading 效果 .wea-demo-loading {