日志操作增加
This commit is contained in:
parent
98bb6e3ae4
commit
0f4c438bbf
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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 (
|
||||
<div style={{height:"100%"}}>
|
||||
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@jp3tsb`} />
|
||||
<WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@mc1954`} {...this.state} onCancel={this.onCancel}/>
|
||||
<LogView ecId={`${this && this.props && this.props.ecId || ''}_LogView@mc1954`} {...this.state} onCancel={this.onCancel}/>
|
||||
{/* <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@mc1954`} {...this.state} onCancel={this.onCancel}/> */}
|
||||
<WeaLocaleProvider ecId={`${this && this.props && this.props.ecId || ''}_WeaLocaleProvider@3on3aj`}>
|
||||
{this.props.children}
|
||||
</WeaLocaleProvider>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export default class NewAndEditDialog extends React.Component {
|
|||
width: 700,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
getForm() {
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -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(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index % 2 == 0) ? 10 : 11} offset={1}>
|
||||
<div style={{ marginTop: 20 }}>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form} formParams={formParams} />}
|
||||
</WeaFormItem>
|
||||
</div>
|
||||
</Col>)
|
||||
})
|
||||
})
|
||||
|
||||
if (searchConditionLoading) {
|
||||
return (
|
||||
<div className='hrm-loading-center-small' style={{ top: '25%' }}>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@lbktzb`} spinning={searchConditionLoading}></Spin>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
|
||||
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
|
||||
logViewStore.getTableInfo();
|
||||
logViewStore.setPanelStatus(false)
|
||||
}
|
||||
}}>{arr}</Row>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getTabBtn() {
|
||||
const {
|
||||
logViewStore
|
||||
} = this.props;
|
||||
const {
|
||||
form
|
||||
} = logViewStore;
|
||||
|
||||
const btn = [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { logViewStore.getTableInfo(); logViewStore.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form.reset()}>{i18n.button.reset()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => logViewStore.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
|
||||
];
|
||||
|
||||
return btn;
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
const {
|
||||
visible, onCancel, logViewStore
|
||||
} = this.props, {
|
||||
tableStore,isPanelShow,conditionNum
|
||||
} = logViewStore, {
|
||||
height, dialogTitle, width,
|
||||
} = this.state;
|
||||
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
|
||||
title={dialogTitle}
|
||||
icon="icon-coms-currency"
|
||||
iconBgcolor="#217346"
|
||||
visible={visible}
|
||||
closable={true}
|
||||
hasScroll={true}
|
||||
onCancel={() => onCancel()}
|
||||
style={{ height: height, width: width }}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
searchType={['advanced']}
|
||||
showSearchAd={isPanelShow}
|
||||
setShowSearchAd={bool => logViewStore.setPanelStatus(bool)}
|
||||
hideSearchAd={() => logViewStore.setPanelStatus(false)}
|
||||
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||
hasMask={false}
|
||||
buttonsAd={this.getTabBtn()}
|
||||
onSearch={() => logViewStore.getTableInfo()}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
/>
|
||||
</WeaDialog>)
|
||||
}
|
||||
}
|
||||
|
|
@ -266,8 +266,9 @@ export default class StaffScheme extends React.Component {
|
|||
}
|
||||
|
||||
log = () => {
|
||||
window.setLogViewProps({
|
||||
logSmallType: '3010',
|
||||
window.setLogViewProp({
|
||||
logMoudleType: '0',
|
||||
keys: new Date().getTime(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue