|
@@ -2,11 +2,14 @@ import React from 'react';
|
|
|
import ReactDom from 'react-dom';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
-import { Form, Radio, Icon, Button, Input, Select, AutoComplete, Spin, Table, Switch, message, DatePicker, Modal, Upload, Popconfirm, Tabs } from 'antd';
|
|
|
+import {
|
|
|
+ Form, Icon, Button, Input, Select, AutoComplete, Spin, Table,
|
|
|
+ message, DatePicker, Modal, TreeSelect, Popconfirm, Tabs
|
|
|
+} from 'antd';
|
|
|
import Newuser from "./newUser.jsx"
|
|
|
import './userMangagement.less'
|
|
|
import { techAuditStatusList, station, post } from '../../../dataDic.js';
|
|
|
-import { getPost, getStation } from '../../../tools.js';
|
|
|
+import { getPost, getStation, getRole } from '../../../tools.js';
|
|
|
import { ChooseList } from "../../order/orderNew/chooseList";
|
|
|
|
|
|
const { TabPane } = Tabs
|
|
@@ -35,7 +38,10 @@ const User = Form.create()(React.createClass({
|
|
|
position: this.state.stationSearch,
|
|
|
status: this.state.statusSeach,
|
|
|
mobile: this.state.signNameSearch,
|
|
|
- superiorId: this.state.theTypes
|
|
|
+ superiorId: this.state.theTypes,
|
|
|
+ ambManage: this.state.ambManage,
|
|
|
+ ambId: this.state.amb == 1 ? this.state.ambId : undefined,
|
|
|
+ ancestors: this.state.amb == 2 ? this.state.ambId : undefined,
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -62,9 +68,13 @@ const User = Form.create()(React.createClass({
|
|
|
userNo: thisdata.userNo,
|
|
|
departmentName: thisdata.departmentName, //部门名称
|
|
|
departmentId: thisdata.departmentId, //部门id
|
|
|
- roles: thisdata.roles.join(','),
|
|
|
+ roles: thisdata.roles,
|
|
|
rolesId: thisdata.rolesId,
|
|
|
lastLoginTime: thisdata.lastLoginTime,
|
|
|
+ rolesName: thisdata.rolesName,
|
|
|
+ ancestorsNames: thisdata.ancestorsNames, //分巴
|
|
|
+ ambName: thisdata.ambName,
|
|
|
+ ambRole: thisdata.ambRole,
|
|
|
});
|
|
|
};
|
|
|
this.state.pagination.current = data.data.pageNo ? data.data.pageNo : '0';
|
|
@@ -137,8 +147,13 @@ const User = Form.create()(React.createClass({
|
|
|
userNo: thisdata.userNo,
|
|
|
departmentName: thisdata.departmentName, //部门名称
|
|
|
departmentId: thisdata.departmentId, //部门id
|
|
|
- roles: thisdata.roles.join(','),
|
|
|
- rolesId: thisdata.rolesId
|
|
|
+ roles: thisdata.roles,
|
|
|
+ rolesId: thisdata.rolesId,
|
|
|
+ lastLoginTime: thisdata.lastLoginTime,
|
|
|
+ rolesName: thisdata.rolesName,
|
|
|
+ ancestorsNames: thisdata.ancestorsNames, //分巴
|
|
|
+ ambName: thisdata.ambName,
|
|
|
+ ambRole: thisdata.ambRole,
|
|
|
});
|
|
|
};
|
|
|
this.state.paginations.current = data.data.pageNo ? data.data.pageNo : '0';
|
|
@@ -161,6 +176,7 @@ const User = Form.create()(React.createClass({
|
|
|
},
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
+ amb: 1,
|
|
|
datauser: {},
|
|
|
searchMore: true,
|
|
|
selectedRowKeys: [],
|
|
@@ -197,32 +213,50 @@ const User = Form.create()(React.createClass({
|
|
|
title: '用户编号',
|
|
|
dataIndex: 'userNo',
|
|
|
key: 'userNo',
|
|
|
+ isNoD: true,
|
|
|
}, {
|
|
|
title: '登录用户名',
|
|
|
dataIndex: 'mobile',
|
|
|
key: 'mobile',
|
|
|
+ width: "140px",
|
|
|
}, {
|
|
|
title: '角色',
|
|
|
- dataIndex: 'roles',
|
|
|
- key: 'roles',
|
|
|
+ dataIndex: 'rolesName',
|
|
|
+ key: 'rolesName',
|
|
|
+ render: (text, record) =>
|
|
|
+ <span>
|
|
|
+ {text + (getRole(record.ambRole) ? ("(" + getRole(record.ambRole) + ")") : "")}
|
|
|
+ </span>
|
|
|
}, {
|
|
|
title: '用户姓名',
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
+ width: "140px",
|
|
|
}, {
|
|
|
title: '部门',
|
|
|
dataIndex: 'departmentName',
|
|
|
key: 'departmentName',
|
|
|
}, {
|
|
|
+ title: '分巴',
|
|
|
+ dataIndex: 'ancestorsNames',
|
|
|
+ key: 'ancestorsNames',
|
|
|
+ render: (text, record) =>
|
|
|
+ <span>
|
|
|
+ {!!text && text.replace(/,/g, "-")}
|
|
|
+ {!!record.ambName && "-" + record.ambName}
|
|
|
+ </span>
|
|
|
+ }, {
|
|
|
title: '职务',
|
|
|
dataIndex: 'duty',
|
|
|
key: 'duty',
|
|
|
+ isNoD: true,
|
|
|
render: text => { return getPost(text) }
|
|
|
},
|
|
|
{
|
|
|
title: '岗位',
|
|
|
dataIndex: 'position',
|
|
|
key: 'position',
|
|
|
+ isNoD: true,
|
|
|
render: text => { return getStation(text) }
|
|
|
},
|
|
|
|
|
@@ -230,6 +264,7 @@ const User = Form.create()(React.createClass({
|
|
|
title: '上级主管姓名',
|
|
|
dataIndex: 'superior',
|
|
|
key: 'superior',
|
|
|
+ width: "140px",
|
|
|
},
|
|
|
{
|
|
|
title: '状态',
|
|
@@ -335,7 +370,25 @@ const User = Form.create()(React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ // 设置默认table(用来默认不显示某列数据 isNoD:true)
|
|
|
+ defaultcolumns() {
|
|
|
+ const newArr = [];
|
|
|
+ this.state.columns.forEach((item) => {
|
|
|
+ if (item.isNoD) {
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ newArr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.setState({
|
|
|
+ changeList: newArr,
|
|
|
+ }, () => {
|
|
|
+ this.loadData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
componentWillMount() {
|
|
|
+ this.defaultcolumns();
|
|
|
this.loadData();
|
|
|
this.departmentList();
|
|
|
this.rolesList();
|
|
@@ -634,16 +687,19 @@ const User = Form.create()(React.createClass({
|
|
|
this.loadDatas();
|
|
|
},
|
|
|
reset() {
|
|
|
- this.state.userNameSearch = '';
|
|
|
+ this.state.ambManage = undefined
|
|
|
+ this.state.ambId = undefined;
|
|
|
+ this.state.amb = 1;
|
|
|
+ this.state.userNameSearch = undefined;
|
|
|
this.state.organizationSearch = undefined;
|
|
|
this.state.rolesSearch = undefined;
|
|
|
this.state.postSearch = undefined;
|
|
|
this.state.stationSearch = undefined;
|
|
|
this.state.statusSeach = undefined;
|
|
|
- this.state.signNameSearch = '';
|
|
|
- this.state.mobileSearch = '';
|
|
|
- this.state.auto = '';
|
|
|
- this.state.theTypes = '';
|
|
|
+ this.state.signNameSearch = undefined;
|
|
|
+ this.state.mobileSearch = undefined;
|
|
|
+ this.state.auto = undefined;
|
|
|
+ this.state.theTypes = undefined;
|
|
|
this.loadData();
|
|
|
},
|
|
|
resets() {
|
|
@@ -811,10 +867,10 @@ const User = Form.create()(React.createClass({
|
|
|
<div className="content-title">
|
|
|
<Tabs defaultActiveKey="1" onChange={this.callback} className="test">
|
|
|
<TabPane tab="搜索" key="1">
|
|
|
- <div className="user-search">
|
|
|
+ <div className="user-search" style={{ paddingBottom: 10 }}>
|
|
|
<Input
|
|
|
placeholder="用户姓名"
|
|
|
- style={{ width: "150px" }}
|
|
|
+ style={{ width: "180px" }}
|
|
|
value={this.state.userNameSearch}
|
|
|
onChange={e => {
|
|
|
this.setState({ userNameSearch: e.target.value });
|
|
@@ -823,7 +879,7 @@ const User = Form.create()(React.createClass({
|
|
|
{window.adminData.isSuperAdmin ? (
|
|
|
<Select
|
|
|
placeholder="部门"
|
|
|
- style={{ width: 160 }}
|
|
|
+ style={{ width: 180 }}
|
|
|
value={this.state.organizationSearch}
|
|
|
onChange={e => {
|
|
|
this.setState({ organizationSearch: e });
|
|
@@ -840,7 +896,7 @@ const User = Form.create()(React.createClass({
|
|
|
)}
|
|
|
<Select
|
|
|
placeholder="角色"
|
|
|
- style={{ width: 160 }}
|
|
|
+ style={{ width: 180 }}
|
|
|
value={this.state.rolesSearch}
|
|
|
onChange={e => {
|
|
|
this.setState({ rolesSearch: e });
|
|
@@ -854,97 +910,123 @@ const User = Form.create()(React.createClass({
|
|
|
);
|
|
|
})}
|
|
|
</Select>
|
|
|
- <div
|
|
|
- className="search-more"
|
|
|
- style={{ display: "inline-block" }}
|
|
|
+ <Select
|
|
|
+ placeholder="职务"
|
|
|
+ style={{ width: 180 }}
|
|
|
+ value={this.state.postSearch}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ postSearch: e });
|
|
|
+ }}
|
|
|
>
|
|
|
+ {post.map(function (item) {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.value}>
|
|
|
+ {item.key}
|
|
|
+ </Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ <Select
|
|
|
+ placeholder="岗位"
|
|
|
+ style={{ width: 180 }}
|
|
|
+ value={this.state.stationSearch}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ stationSearch: e });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {station.map(function (item) {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.value}>
|
|
|
+ {item.key}
|
|
|
+ </Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ <Select
|
|
|
+ placeholder="状态"
|
|
|
+ style={{ width: 180 }}
|
|
|
+ value={this.state.statusSeach}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ statusSeach: e });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Select.Option value={0}>正常</Select.Option>
|
|
|
+ <Select.Option value={1}>锁定</Select.Option>
|
|
|
+ </Select>
|
|
|
+ <Input
|
|
|
+ placeholder="登录用户名"
|
|
|
+ style={{ width: "180px" }}
|
|
|
+ value={this.state.signNameSearch}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ signNameSearch: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <AutoComplete
|
|
|
+ className="certain-category-search"
|
|
|
+ dropdownClassName="certain-category-search-dropdown"
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ style={{ width: 180 }}
|
|
|
+ dataSource={options}
|
|
|
+ placeholder="输入上级主管名字"
|
|
|
+ value={this.state.auto}
|
|
|
+ onChange={this.httpChange}
|
|
|
+ filterOption={true}
|
|
|
+ onBlur={this.blurChange}
|
|
|
+ onSelect={this.selectAuto}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </AutoComplete>
|
|
|
+ <div style={{ marginTop: 10 }}>
|
|
|
<Select
|
|
|
- placeholder="职务"
|
|
|
- style={{ width: 160 }}
|
|
|
- value={this.state.postSearch}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ postSearch: e });
|
|
|
- }}
|
|
|
- >
|
|
|
- {post.map(function (item) {
|
|
|
- return (
|
|
|
- <Select.Option key={item.value}>
|
|
|
- {item.key}
|
|
|
- </Select.Option>
|
|
|
- );
|
|
|
- })}
|
|
|
- </Select>
|
|
|
- <Select
|
|
|
- placeholder="岗位"
|
|
|
- style={{ width: 160 }}
|
|
|
- value={this.state.stationSearch}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ stationSearch: e });
|
|
|
- }}
|
|
|
- >
|
|
|
- {station.map(function (item) {
|
|
|
- return (
|
|
|
- <Select.Option key={item.value}>
|
|
|
- {item.key}
|
|
|
- </Select.Option>
|
|
|
- );
|
|
|
- })}
|
|
|
- </Select>
|
|
|
- <Select
|
|
|
- placeholder="状态"
|
|
|
- style={{ width: 160 }}
|
|
|
- value={this.state.statusSeach}
|
|
|
+ placeholder="巴主"
|
|
|
+ style={{ width: 180 }}
|
|
|
+ value={this.state.ambManage}
|
|
|
onChange={e => {
|
|
|
- this.setState({ statusSeach: e });
|
|
|
+ this.setState({ ambManage: e });
|
|
|
}}
|
|
|
>
|
|
|
- <Select.Option value={0}>正常</Select.Option>
|
|
|
- <Select.Option value={1}>锁定</Select.Option>
|
|
|
+ <Select.Option value={0}>非巴主</Select.Option>
|
|
|
+ <Select.Option value={1}>巴主</Select.Option>
|
|
|
</Select>
|
|
|
- <Input
|
|
|
- placeholder="登录用户名"
|
|
|
- style={{ width: "150px" }}
|
|
|
- value={this.state.signNameSearch}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ signNameSearch: e.target.value });
|
|
|
+ <TreeSelect
|
|
|
+ style={{ width: 300 }}
|
|
|
+ value={this.state.ambId}
|
|
|
+ dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
|
+ treeData={this.state.level1Data}
|
|
|
+ placeholder="请选择分巴"
|
|
|
+ showSearch
|
|
|
+ treeNodeFilterProp="title"
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ ambId: e,
|
|
|
+ });
|
|
|
}}
|
|
|
/>
|
|
|
-
|
|
|
- <AutoComplete
|
|
|
- className="certain-category-search"
|
|
|
- dropdownClassName="certain-category-search-dropdown"
|
|
|
- dropdownMatchSelectWidth={false}
|
|
|
- dropdownStyle={{ width: 200 }}
|
|
|
- size="large"
|
|
|
- style={{
|
|
|
- width: "150px",
|
|
|
- height: "28px",
|
|
|
- marginLeft: "10px"
|
|
|
- }}
|
|
|
- dataSource={options}
|
|
|
- placeholder="输入上级主管名字"
|
|
|
- value={this.state.auto}
|
|
|
- onChange={this.httpChange}
|
|
|
- filterOption={true}
|
|
|
- onBlur={this.blurChange}
|
|
|
- onSelect={this.selectAuto}
|
|
|
+ {
|
|
|
+ !!this.state.ambId &&
|
|
|
+ <Select
|
|
|
+ placeholder=""
|
|
|
+ style={{ width: 180 }}
|
|
|
+ value={this.state.amb}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ amb: e });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Select.Option value={1}>本巴</Select.Option>
|
|
|
+ <Select.Option value={2}>全部</Select.Option>
|
|
|
+ </Select>
|
|
|
+ }
|
|
|
+ <Button style={{ marginRight: 10 }} type="primary" onClick={this.search}>搜索</Button>
|
|
|
+ <Button style={{ marginRight: 10 }} onClick={this.reset}>重置</Button>
|
|
|
+ <Button
|
|
|
+ style={{ background: "red", border: "none", color: "#fff", display: "none" }}
|
|
|
+ disabled={!hasSelected}
|
|
|
+ onClick={this.delectRow}
|
|
|
>
|
|
|
- <Input />
|
|
|
- </AutoComplete>
|
|
|
+ 删除
|
|
|
+ <Icon type="minus" />
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
- <Button type="primary" onClick={this.search}>
|
|
|
- 搜索
|
|
|
- </Button>
|
|
|
- <Button onClick={this.reset}>重置</Button>
|
|
|
- <Button
|
|
|
- style={{ background: "red", border: "none", color: "#fff", display: "none" }}
|
|
|
- disabled={!hasSelected}
|
|
|
- onClick={this.delectRow}
|
|
|
- >
|
|
|
- 删除
|
|
|
- <Icon type="minus" />
|
|
|
- </Button>
|
|
|
-
|
|
|
{/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span> */}
|
|
|
</div>
|
|
|
</TabPane>
|
|
@@ -1011,6 +1093,7 @@ const User = Form.create()(React.createClass({
|
|
|
<div className="patent-table">
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Table
|
|
|
+ bordered
|
|
|
columns={
|
|
|
this.state.changeList
|
|
|
? this.state.changeList
|
|
@@ -1052,7 +1135,7 @@ const User = Form.create()(React.createClass({
|
|
|
<Input
|
|
|
placeholder="用户姓名"
|
|
|
style={{
|
|
|
- width: "150px",
|
|
|
+ width: "180px",
|
|
|
marginRight: "10px",
|
|
|
marginBottom: "10px"
|
|
|
}}
|