Merge branch 'master' of http://47.122.43.22:3000/wyw/mh_jy_safe_web
This commit is contained in:
commit
028f8d85d7
10
package.json
10
package.json
@ -1,11 +1,11 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "set PORT=2000 && cross-env ESLINT=none roadhog server",
|
||||
"startbt": "set PORT=2001 && cross-env ESLINT=none roadhog server",
|
||||
"startly": "set PORT=2002 && cross-env ESLINT=none roadhog server",
|
||||
"startkljl": "set PORT=2003 && cross-env ESLINT=none roadhog server",
|
||||
"startxt": "set PORT=2004 && cross-env ESLINT=none roadhog server",
|
||||
"start": "set PORT=5000 && cross-env ESLINT=none roadhog server",
|
||||
"startbt": "set PORT=5001 && cross-env ESLINT=none roadhog server",
|
||||
"startly": "set PORT=5002 && cross-env ESLINT=none roadhog server",
|
||||
"startkljl": "set PORT=5003 && cross-env ESLINT=none roadhog server",
|
||||
"startxt": "set PORT=5004 && cross-env ESLINT=none roadhog server",
|
||||
"build": "cross-env ESLINT=none roadhog build",
|
||||
"build:report": "cross-env ESLINT=none NODE_ENV=production ANALYZE=true roadhog build"
|
||||
},
|
||||
|
||||
797
src/components/CustomPages/FM/UserEditPageAuth.js
Normal file
797
src/components/CustomPages/FM/UserEditPageAuth.js
Normal file
@ -0,0 +1,797 @@
|
||||
import React from 'react'
|
||||
import { connect } from 'dva'
|
||||
import { Button, Row, Col, Form, Input, Select, Transfer, message, Upload, Icon, Modal, DatePicker, Checkbox } from 'antd'
|
||||
import {
|
||||
extend,
|
||||
extendRule,
|
||||
initFilter,
|
||||
getOnlyPropertyData,
|
||||
extendInclude,
|
||||
setDataFieldValue,
|
||||
getPropertyData,
|
||||
guid
|
||||
} from '../../../utils/common'
|
||||
import moment from 'moment'
|
||||
import DropDownPagination from '../../common/DropDownPaginationEx'
|
||||
import config from '../../../config'
|
||||
import classNames from 'classnames'
|
||||
import styles from '../../../baseComponents/Component.css'
|
||||
import storage from '../../../utils/storage'
|
||||
import FormPage from '../../FormPage';
|
||||
import MultiSelectPagination from "../../common/MultiSelectPagination";
|
||||
const Option = Select.Option
|
||||
const { TextArea } = Input
|
||||
const CheckboxGroup = Checkbox.Group
|
||||
class UserEditPageAuth extends React.Component {
|
||||
// UserEditPage 复制过来处理授权问题
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
data: {
|
||||
PASSWORD: 'E10ADC3949BA59ABBE56E057F20F883E', // 默认密码为123456
|
||||
},
|
||||
btns: [],
|
||||
userGroupTargetKeys: [],
|
||||
roleTargetKeys: [],
|
||||
roleGroupTargetKeys: [],
|
||||
disabled: true,
|
||||
SignaturePhoto: ""
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.form.resetFields()
|
||||
this.loadData()
|
||||
};
|
||||
|
||||
componentWillReceiveProps(NextProps) {
|
||||
const { data } = this.props
|
||||
let { id } = data ? data : {}
|
||||
if (!id)
|
||||
id = ''
|
||||
if (NextProps.custom['userEditClick' + id]) {
|
||||
this.props.form.resetFields()
|
||||
this.props.dispatch({
|
||||
type: 'custom/save',
|
||||
payload: {
|
||||
['userEditClick' + id]: false
|
||||
},
|
||||
})
|
||||
this.loadData()
|
||||
}
|
||||
}
|
||||
|
||||
loadDataSource = (orgId) => {
|
||||
const { dispatch } = this.props
|
||||
const userGroupJson = initFilter(orgId, '', 'CODE', 1)
|
||||
extendRule(userGroupJson, 'ENABLE_STATUS', 1, 0)
|
||||
userGroupJson.OrgType = 1
|
||||
dispatch({
|
||||
type: 'FMBase/getUserGroupDatasource',
|
||||
payload: userGroupJson,
|
||||
})
|
||||
const roleJson = initFilter(orgId, '', 'CODE', 1)
|
||||
extendRule(roleJson, 'ENABLE_STATUS', 1, 0)
|
||||
roleJson.OrgType = 1
|
||||
dispatch({
|
||||
type: 'FMBase/getRoleDatasource',
|
||||
payload: roleJson,
|
||||
|
||||
})
|
||||
const roleGroupJson = initFilter(orgId, '', 'CODE', 1)
|
||||
extendRule(roleGroupJson, 'ENABLE_STATUS', 1, 0)
|
||||
roleGroupJson.OrgType = 1
|
||||
dispatch({
|
||||
type: 'FMBase/getRoleGroupDatasource',
|
||||
payload: roleGroupJson,
|
||||
})
|
||||
};
|
||||
loadData = () => {
|
||||
const { data, formId, login } = this.props
|
||||
const { id } = data || {}
|
||||
|
||||
if (id) {
|
||||
const userJson = initFilter(this.props.login.OrgId)
|
||||
extendRule(userJson, 'ID', 1, id)
|
||||
extendInclude(userJson, 'Nav_Department')
|
||||
extendInclude(userJson, 'Nav_ApproveRole')
|
||||
extendInclude(userJson, 'Nav_Person.Nav_TeamPersons.Nav_Team')
|
||||
extendInclude(userJson, 'Nav_Person.Nav_Post')
|
||||
extendInclude(userJson, 'Nav_BelongRoles')
|
||||
// extendInclude(userJson, 'Nav_BelongRoleGroups')
|
||||
// extendInclude(userJson, 'Nav_BelongUserGroups')
|
||||
// extendInclude(userJson, 'Nav_UserPhotoFiles')
|
||||
extendInclude(userJson, 'Nav_UserPhotoFiles.Nav_ImgFile')
|
||||
extendInclude(userJson, 'Nav_UserSignFiles.Nav_ImgFile')
|
||||
extendInclude(userJson, 'Nav_ProdutionUnit.Nav_Enums')
|
||||
this.props.dispatch({
|
||||
type: 'FMUserEdit/getUser',
|
||||
payload: userJson,
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
ret.ID_CARD_SHOW = ret.ID_CARD
|
||||
if (ret.ID_CARD_SHOW != null && ret.ID_CARD_SHOW.length > 1) {
|
||||
ret.ID_CARD_SHOW = ret.ID_CARD_SHOW.replace(/^(.{5})(?:\d+)(.{2})$/, "$1***********$2")
|
||||
}
|
||||
let userGroup = []
|
||||
let role = []
|
||||
let roleGroup = []
|
||||
if (ret.Nav_BelongRoles) {
|
||||
ret.Nav_BelongRoles.forEach(item => {
|
||||
role.push(item.BELONG_ROLE_ID.toString().toUpperCase())
|
||||
})
|
||||
}
|
||||
if (ret.Nav_BelongRoleGroups) {
|
||||
ret.Nav_BelongRoleGroups.forEach(item => {
|
||||
roleGroup.push(item.BELONG_ROLE_GROUP_ID.toString().toUpperCase())
|
||||
})
|
||||
}
|
||||
|
||||
if (ret.Nav_BelongUserGroups) {
|
||||
ret.Nav_BelongUserGroups.forEach(item => {
|
||||
userGroup.push(item.BELONG_USER_GROUP_ID.toString().toUpperCase())
|
||||
})
|
||||
}
|
||||
|
||||
this.loadDataSource(ret.ORG_ID)
|
||||
this.fillData(ret)
|
||||
this.fillSignData(ret)
|
||||
this.setState({
|
||||
data: ret,
|
||||
userGroupTargetKeys: userGroup,
|
||||
roleTargetKeys: role,
|
||||
roleGroupTargetKeys: roleGroup,
|
||||
disabled: true,
|
||||
SignaturePhoto: (ret?.FILE_PATH) ? (config.picServerHost + ret.FILE_PATH) : '',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
this.props.form.resetFields()
|
||||
this.loadDataSource(login.OrgId)
|
||||
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
ORG_ID: this.props.login.OrgId,
|
||||
ENABLE_STATUS: 0,
|
||||
ID: guid(),
|
||||
Nav_Person: {
|
||||
Nav_TeamPersons: [],
|
||||
Nav_Post: {}
|
||||
},
|
||||
},
|
||||
disabled: false,
|
||||
})
|
||||
const { form, } = this.props
|
||||
const { setFieldsValue } = form
|
||||
if (this.props.login.OrgCode) {
|
||||
setFieldsValue({
|
||||
CODE: (this.props.login.OrgCode),
|
||||
})
|
||||
}
|
||||
}
|
||||
if (formId) {
|
||||
const btnJson = initFilter(this.props.login.OrgId, '', 'NUM', 0)
|
||||
extendRule(btnJson, 'PAGE_CUSTOM_FORM_ID', 1, formId)
|
||||
this.props.dispatch({
|
||||
type: 'FMUserEdit/getBtnList',
|
||||
payload: btnJson,
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
this.setState({
|
||||
btns: ret,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
fillData = (ret) => {
|
||||
const updateLoadFileList = []
|
||||
if (ret.Nav_UserPhotoFiles) {
|
||||
ret.Nav_UserPhotoFiles.forEach(t => {
|
||||
updateLoadFileList.push({
|
||||
uid: t.ID,
|
||||
name: t.Nav_ImgFile ? t.Nav_ImgFile.FILE_NAME : '未知文件',
|
||||
status: 'done',
|
||||
response: { Data: { imgFileID: t.IMG_FILE_ID }, file: t },
|
||||
})
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
updateLoadFileList: updateLoadFileList,
|
||||
})
|
||||
}
|
||||
|
||||
fillSignData = (ret) => {
|
||||
const updateLoadSignFileList = []
|
||||
if (ret.Nav_UserSignFiles) {
|
||||
ret.Nav_UserSignFiles.forEach(t => {
|
||||
updateLoadSignFileList.push({
|
||||
uid: t.ID,
|
||||
name: t.Nav_ImgFile ? t.Nav_ImgFile.FILE_NAME : '未知文件',
|
||||
status: 'done',
|
||||
response: { Data: { imgFileID: t.IMG_FILE_ID }, file: t },
|
||||
})
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
updateLoadSignFileList: updateLoadSignFileList,
|
||||
})
|
||||
}
|
||||
saveAuth = () => {
|
||||
debugger
|
||||
const { form, dispatch, data } = this.props
|
||||
const { validateFieldsAndScroll } = form
|
||||
const { updateLoadFileList, updateLoadSignFileList } = this.state
|
||||
this.state.data.FILE_PATH = this.state.SignaturePhoto.replace(config.picServerHost, '')
|
||||
|
||||
validateFieldsAndScroll((errors, values) => {
|
||||
if (errors) return
|
||||
extend(this.state.data, values)
|
||||
let updateData = getOnlyPropertyData(this.state.data)
|
||||
const ret = this.state.data
|
||||
if (values.ID_CARD_SHOW != null && values.ID_CARD_SHOW != '' && values.ID_CARD_SHOW.indexOf('*') < 0 && (ret.ID_CARD == null || ret.ID_CARD != values.ID_CARD_SHOW)) {
|
||||
ret.ID_CARD = values.ID_CARD_SHOW
|
||||
updateData.ID_CARD = values.ID_CARD_SHOW
|
||||
}
|
||||
let personTeam = getPropertyData(this.state.data.Nav_Person);
|
||||
let userGroup = []
|
||||
let role = []
|
||||
let roleGroup = []
|
||||
let userPhoto = []
|
||||
let userSign = []
|
||||
if (updateLoadFileList) {
|
||||
updateLoadFileList.forEach(item => {
|
||||
if (item.response && item.response.Data) {
|
||||
userPhoto.push({ IMG_FILE_ID: item.response.Data.imgFileID, ORG_ID: updateData.ORG_ID, USER_ID: updateData.ID })
|
||||
}
|
||||
})
|
||||
}
|
||||
if (updateLoadSignFileList) {
|
||||
updateLoadSignFileList.forEach(item => {
|
||||
if (item.response && item.response.Data) {
|
||||
userSign.push({ IMG_FILE_ID: item.response.Data.imgFileID, ORG_ID: updateData.ORG_ID, USER_ID: updateData.ID })
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.state.roleTargetKeys) {
|
||||
this.state.roleTargetKeys.forEach(item => {
|
||||
let isGet = false
|
||||
if (ret.Nav_BelongRoles) {
|
||||
ret.Nav_BelongRoles.forEach(t => {
|
||||
if (t.BELONG_ROLE_ID.toString().toUpperCase() == item) {
|
||||
role.push(t)
|
||||
isGet = true
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!isGet) {
|
||||
role.push({ BELONG_ROLE_ID: item, ORG_ID: updateData.ORG_ID })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (this.state.userGroupTargetKeys) {
|
||||
this.state.userGroupTargetKeys.forEach(item => {
|
||||
let isGet = false
|
||||
if (ret.Nav_BelongUserGroups) {
|
||||
ret.Nav_BelongUserGroups.forEach(t => {
|
||||
if (t.BELONG_USER_GROUP_ID.toString().toUpperCase() == item) {
|
||||
userGroup.push(t)
|
||||
isGet = true
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!isGet) {
|
||||
userGroup.push({ BELONG_USER_GROUP_ID: item, ORG_ID: updateData.ORG_ID })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (this.state.roleGroupTargetKeys) {
|
||||
this.state.roleGroupTargetKeys.forEach(item => {
|
||||
let isGet = false
|
||||
if (ret.Nav_BelongRoleGroups) {
|
||||
ret.Nav_BelongRoleGroups.forEach(t => {
|
||||
if (t.BELONG_ROLE_GROUP_ID.toString().toUpperCase() == item) {
|
||||
roleGroup.push(t)
|
||||
isGet = true
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!isGet) {
|
||||
roleGroup.push({ BELONG_ROLE_GROUP_ID: item, ORG_ID: updateData.ORG_ID })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
updateData['Nav_BelongRoles'] = role
|
||||
updateData['Nav_BelongUserGroups'] = userGroup
|
||||
updateData['Nav_BelongRoleGroups'] = roleGroup
|
||||
// updateData['Nav_UserPhotoFiles'] = userPhoto
|
||||
// updateData['Nav_UserSignFiles'] = userSign
|
||||
// updateData['Nav_Person'] = personTeam;
|
||||
dispatch({
|
||||
// type: 'FMUserEdit/updateUserAuth',
|
||||
// //type: 'FMUserEdit/updateUser',
|
||||
// payload: updateData,
|
||||
|
||||
type: 'app/getDataByPost',
|
||||
payload: updateData,
|
||||
url: 'FM/User/UpdateAuth',
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
if (data.close) {
|
||||
data.close()
|
||||
}
|
||||
message.success('执行成功')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// if (data && data.length > 0) {
|
||||
// let json = initFilter(this.props.login.OrgId, record.ID);
|
||||
// this.props.dispatch({
|
||||
// type: 'app/getDataByPost',
|
||||
// payload: json,
|
||||
// url: 'FM/User/GetProductionUnit',
|
||||
// onComplete: (ret) => {
|
||||
// if (ret) {
|
||||
// this.setState({
|
||||
// data: {
|
||||
// ...this.state.data,
|
||||
// MineType: ret.MineType
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// this.setState({
|
||||
// data: {
|
||||
// ...this.state.data,
|
||||
// DEPARTMENT_ID: data[0],
|
||||
// Nav_Department: { NAME: record.NAME },
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// else {
|
||||
// this.setState({
|
||||
// data: {
|
||||
// ...this.state.data,
|
||||
// Nav_Department: { NAME: null },
|
||||
// DEPARTMENT_ID: null,
|
||||
// }
|
||||
// })
|
||||
// };
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
handleSopClick = async function (recordId, ids) {
|
||||
await this.props.dispatch({
|
||||
type: 'custom/save',
|
||||
payload: {
|
||||
['sopViewClick' + recordId]: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
handleSopShowModal = (file) => {
|
||||
this.setState({
|
||||
sopData: { ids: file.response.Data.imgFileID, id: file.response.Data.imgFileID },
|
||||
sopVisible: true
|
||||
}, () => {
|
||||
this.handleSopClick(file.response.Data.imgFileID, file.response.Data.imgFileID);
|
||||
});
|
||||
};
|
||||
handleSopCloseModal = () => {
|
||||
this.setState({
|
||||
sopVisible: false
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { form } = this.props
|
||||
const { getFieldDecorator } = form
|
||||
|
||||
const handleRoleChange = (nextTargetKeys, direction, moveKeys) => {
|
||||
this.setState({ roleTargetKeys: nextTargetKeys })
|
||||
}
|
||||
const formItemLayout = {
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 18 },
|
||||
}
|
||||
const onSelectDepartment = ({ data, record }) => {
|
||||
|
||||
if (data && data.length > 0) {
|
||||
let json = initFilter(this.props.login.OrgId, record.ID);
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
payload: json,
|
||||
url: 'FM/User/GetProductionUnit',
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
MineType: ret.MineType
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
DEPARTMENT_ID: data[0],
|
||||
Nav_Department: { NAME: record.NAME },
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
Nav_Department: { NAME: null },
|
||||
DEPARTMENT_ID: null,
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
const onSelectApproveRole = ({ data, record }) => {
|
||||
|
||||
if (data && data.length > 0) {
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
APPROVE_ROLE_ID: data[0],
|
||||
Nav_ApproveRole: { NAME: record.NAME }
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
Nav_ApproveRole: { NAME: null },
|
||||
APPROVE_ROLE_ID: null,
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
const onSelectPost = ({ data, record }) => {
|
||||
var tmpData = { ...this.state.data };
|
||||
if (data && data.length > 0) {
|
||||
tmpData.Nav_Person.Post_ID = data[0];
|
||||
tmpData.Nav_Person.Nav_Post = { NAME: record.NAME };
|
||||
|
||||
}
|
||||
else {
|
||||
tmpData.Nav_Person.Post_ID = '';
|
||||
tmpData.Nav_Person.Nav_Post = { NAME: '' };
|
||||
};
|
||||
this.setState({
|
||||
data: tmpData
|
||||
})
|
||||
}
|
||||
const onSelectPerson = ({ data, record }) => {
|
||||
if (data && data.length > 0) {
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
PERSON_ID: data[0],
|
||||
Nav_Person: { NAME: record.NAME }
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
this.setState({
|
||||
data: {
|
||||
...this.state.data,
|
||||
Nav_Person: { NAME: null },
|
||||
PERSON_ID: null,
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
const onSelectTeam = (value) => {
|
||||
var tmpData = { ...this.state.data }
|
||||
setDataFieldValue(tmpData, 'Nav_Person.Nav_TeamPersons', value)
|
||||
this.setState({
|
||||
data: tmpData,
|
||||
});
|
||||
}
|
||||
const onSelectProduction = (value) => {
|
||||
var tmpData = { ...this.state.data }
|
||||
setDataFieldValue(tmpData, 'Nav_ProdutionUnit', value)
|
||||
this.setState({
|
||||
data: tmpData,
|
||||
});
|
||||
}
|
||||
const onUnitChange = (value) => {
|
||||
var tmpData = { ...this.state.data }
|
||||
if (value.length == 0) {
|
||||
setDataFieldValue(tmpData, 'MineType', value.toString())
|
||||
}
|
||||
else {
|
||||
setDataFieldValue(tmpData, 'MineType', tmpData.MineType + "," + value.toString())
|
||||
}
|
||||
this.setState({
|
||||
data: tmpData,
|
||||
});
|
||||
}
|
||||
const onChange = (field, value,) => {
|
||||
const data = { ...this.state.data };
|
||||
data[field] = value;
|
||||
this.setState({
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
const that = this
|
||||
const Tenant = storage('lacal').getItem('Tenant').val
|
||||
const uploadSopProps = {
|
||||
name: 'file',
|
||||
action: config.serviceHost('api/PF/File/UploadFileToImage'),
|
||||
data: { OrgId: this.props.login.OrgId, IsSaveSelf: true },
|
||||
fileList: this.state.updateLoadFileList,
|
||||
headers: {
|
||||
Tenant: Tenant,
|
||||
},
|
||||
onPreview: function (file) {
|
||||
that.handleSopShowModal(file);
|
||||
},
|
||||
onChange(info) {
|
||||
that.setState({
|
||||
updateLoadFileList: info.fileList,
|
||||
})
|
||||
if (info.file.status === 'done') {
|
||||
message.success(`${info.file.name} file uploaded successfully`)
|
||||
} else if (info.file.status === 'error') {
|
||||
message.error(`${info.file.name} file upload failed.`)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
const uploadSingProps = {
|
||||
name: 'file',
|
||||
action: config.serviceHost('api/PF/File/UploadFileToImage'),
|
||||
data: { OrgId: this.props.login.OrgId, IsSaveSelf: true, USER_ID: this.props.data.id },
|
||||
fileList: this.state.updateLoadSignFileList,
|
||||
headers: {
|
||||
Tenant: Tenant,
|
||||
},
|
||||
onPreview: function (file) {
|
||||
that.handleSopShowModal(file);
|
||||
},
|
||||
onChange(info) {
|
||||
that.setState({
|
||||
updateLoadSignFileList: info.fileList,
|
||||
SignaturePhoto: config.picServerHost + info?.file?.response?.Data.imgFilePath
|
||||
})
|
||||
if (info.file.status === 'done') {
|
||||
// console.log(that.state)
|
||||
message.success(`${info.file.name} file uploaded successfully`)
|
||||
} else if (info.file.status === 'error') {
|
||||
message.error(`${info.file.name} file upload failed.`)
|
||||
}
|
||||
},
|
||||
}
|
||||
return (
|
||||
<Form style={{ padding: 12, overflow: 'hidden' }}>
|
||||
<div className={styles.topBar}>
|
||||
<div className={classNames(styles.topBarLeftBtns, styles.antBtns_mr8)}>
|
||||
<Button type="primary" icon="save" onClick={() => this.saveAuth()}>权限保存</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Row gutter={32}>
|
||||
<Col span={16}>
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'姓名'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('NAME', {
|
||||
validateTrigger: 'onBlur',
|
||||
initialValue: this.state.data.NAME,
|
||||
rules: [{ required: true, message: '请输入姓名' }],
|
||||
})(<Input disabled={this.state.disabled} maxLength={30} placeholder={'请输入姓名'} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'登入名'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('CODE', {
|
||||
validateTrigger: 'onBlur',
|
||||
initialValue: this.state.data.CODE,
|
||||
rules: [{ required: true, message: '请输入登入名' }],
|
||||
})(<Input disabled={this.state.disabled} maxLength={30} placeholder={'请输入登入名'} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'组织结构'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('Nav_Department.NAME', {
|
||||
validateTrigger: 'onBlur',
|
||||
initialValue: this.state.data?.Nav_Department?.NAME,
|
||||
})(<Input disabled={this.state.disabled} maxLength={30} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'岗位'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('Nav_Person.Nav_Post.NAME', {
|
||||
validateTrigger: 'onBlur',
|
||||
initialValue: this.state.data?.Nav_Person?.Nav_Post?.NAME,
|
||||
})(<Input disabled={this.state.disabled} maxLength={30} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'手机号'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('PHONE', {
|
||||
validateTrigger: 'onBlur',
|
||||
initialValue: this.state.data.PHONE,
|
||||
rules: [],
|
||||
})(<Input disabled={this.state.disabled} maxLength={13} placeholder={'请输入手机号'} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item disabled={this.state.disabled}
|
||||
label={'身份证号'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('ID_CARD_SHOW', {
|
||||
initialValue: this.state.data.ID_CARD_SHOW,
|
||||
rules: [],
|
||||
})(<Input disabled={this.state.disabled} maxLength={50} placeholder={'请输入身份证号'} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'性别'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('SEX', {
|
||||
initialValue: this.state.data.SEX ? this.state.data.SEX.toString() : "0",
|
||||
rules: [],
|
||||
})(<Select disabled='false' placeholder="性别" >
|
||||
<Option value="0">女</Option>
|
||||
<Option value="1">男</Option>
|
||||
</Select>)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'入职时间'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
<DatePicker disabled={this.state.disabled}
|
||||
value={moment(this.state.data.ENTRYTIME)}
|
||||
placeholder={'请输入入职时间'}
|
||||
onChange={(value, dateString) => { onChange('ENTRYTIME', dateString, 0) }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'离职时间'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
<DatePicker disabled={this.state.disabled}
|
||||
value={moment(this.state.data.DEPARTURETIME ? this.state.data.DEPARTURETIME : '2099-01-01')}
|
||||
placeholder={'请输入离职时间'}
|
||||
onChange={(value, dateString) => { onChange('DEPARTURETIME', dateString, 0) }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'工龄'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('WORKINGYEAR', {
|
||||
initialValue: this.state.data.WORKINGYEAR,
|
||||
rules: [],
|
||||
})(<Input disabled={this.state.disabled} placeholder={'请输入工龄'} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'审核角色'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('Nav_ApproveRole.NAME', {
|
||||
validateTrigger: 'onBlur',
|
||||
initialValue: this.state.data?.Nav_ApproveRole?.NAME,
|
||||
})(<Input disabled={this.state.disabled} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={'生产单元'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
<MultiSelectPagination disabled={this.state.disabled}
|
||||
data={
|
||||
{
|
||||
navField: 'ID,VALUE,NAME',
|
||||
saveField: 'ENUMS_ID,Nav_Enums.VALUE,Nav_Enums.NAME',
|
||||
labelField: "Nav_Enums.NAME",
|
||||
showField: "NAME",
|
||||
filterField: "NAME",
|
||||
idField: "USER_ID",
|
||||
selectLabelField: "NAME",//不配置则默认取labelField,如果labelField也不配置,默认取NAME字段
|
||||
}
|
||||
}
|
||||
colConfig={{ field: "Nav_ProdutionUnit" }}
|
||||
record={this.state.data} onChange={onSelectProduction} onFilter={({ params }) => {
|
||||
// extendRule(params, 'CODE', 1, 'BSMineTypeEnum');
|
||||
params.OrderType = 1
|
||||
params.OrgId = this.state.data ? this.state.data.ORG_ID : this.props.login.OrgId
|
||||
// params.Parameter1='BSMineTypeEnum'
|
||||
}} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label={'备注'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{getFieldDecorator('REMARK', {
|
||||
initialValue: this.state.data.REMARK,
|
||||
})(<TextArea disabled={this.state.disabled} maxLength={300} rows={4} placeholder={'请输入备注'} />)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label={'签名图片'}
|
||||
{...formItemLayout}
|
||||
>
|
||||
{
|
||||
this.state.SignaturePhoto === '' ?
|
||||
<div>暂无签名图片</div> :
|
||||
<img width='30%' src={this.state.SignaturePhoto} />
|
||||
}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={8} >
|
||||
<Transfer
|
||||
dataSource={this.props.FMBase.roleDatasource}
|
||||
titles={['角色', '已选择']}
|
||||
targetKeys={this.state.roleTargetKeys}
|
||||
onChange={handleRoleChange}
|
||||
render={item => item.title}
|
||||
style={{ marginTop: 4 }}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(({ login, FMBase, custom, app }) => ({ login, FMBase, custom, app }))(Form.create()(UserEditPageAuth))
|
||||
@ -244,13 +244,19 @@ class FormConfigSqlPage extends React.Component {
|
||||
data,
|
||||
})
|
||||
}} >
|
||||
<Option value="b043b28b-bbc3-c452-6052-4fba1457abfa">行洛坑</Option>
|
||||
{/* <Option value="b043b28b-bbc3-c452-6052-4fba1457abfa">行洛坑</Option>
|
||||
<Option value="d9871ba8-0eec-9e4a-bb87-7d5a540d8913">洛阳豫鹭</Option>
|
||||
<Option value="8b3c41aa-51b1-7ce9-1879-248a038c1b5c">都昌金鼎</Option>
|
||||
<Option value="8f1cf418-8bf3-ea3f-7a6d-fc5d61247008">龙岩稀土</Option>
|
||||
<Option value="3EFD5276-632B-E379-9FF3-7A7546591FCA">广西博白</Option>
|
||||
<Option value="A3DCE14A-13D9-D879-D9AB-821D4A3F1F93">SMS</Option>
|
||||
<Option value="88888888-8888-8888-8888-888888888888">demo8</Option>
|
||||
<Option value="88888888-8888-8888-8888-888888888888">demo8</Option> */}
|
||||
<Option value="00300000-0000-0000-0000-000000000000">金源</Option>
|
||||
<Option value="00500000-0000-0000-0000-000000000000">邦泰</Option>
|
||||
<Option value="01000000-0000-0000-0000-000000000000">路源</Option>
|
||||
<Option value="01500000-0000-0000-0000-000000000000">金能昆仑</Option>
|
||||
<Option value="02000000-0000-0000-0000-000000000000">西拓</Option>
|
||||
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
121
src/config.js
121
src/config.js
@ -1,8 +1,8 @@
|
||||
const getServiceHost = api => {
|
||||
const apimodules = [{ OP: 3116 }, { BD: 3101 }, { DD: 3102 }, { EA: 3103 }, { ED: 3104 }, { EM: 3105 }, { FC: 3106 },
|
||||
{ FM: 3107 }, { KR: 3108 }, { LG: 3109 }, { MR: 3110 }, { NW: 3111 }, { PF: 3112 }, { PM: 3113 }, { QC: 3114 }, { FW: 3115 }, { OP: 3116 },
|
||||
{ HM: 3117 }, { PP: 3118 }, { FO: 3119 }, { UT: 3177 }, { BS: 3178 }, { SC: 3179 }, { TI: 3179 }, { SE: 3179 }, { AE: 3179 }, { PT: 3179 }, { LR: 3179 }, { OG: 3179 }, { PE: 3179 }, { OH: 3179 }, { CM: 3179 }, { PR: 3179 }, { DM: 3179 }, { BI: 3179 }, { TL: 3179 }, { WB: 3179 }, { PC: 3179 }, { SK: 3180 }]
|
||||
let port = 3112
|
||||
const apimodules = [{ OP: 5116 }, { BD: 5101 }, { DD: 5102 }, { EA: 5103 }, { ED: 5104 }, { EM: 5105 }, { FC: 5106 },
|
||||
{ FM: 5107 }, { KR: 5108 }, { LG: 5109 }, { MR: 5110 }, { NW: 5111 }, { PF: 5112 }, { PM: 5113 }, { QC: 5114 }, { FW: 5115 },
|
||||
{ HM: 5117 }, { PP: 5118 }, { FO: 5119 }, { UT: 5177 }, { BS: 5178 }, { SC: 5179 }, { TI: 5179 }, { SE: 5179 }, { AE: 5179 }, { PT: 5179 }, { LR: 5179 }, { OG: 5179 }, { PE: 5179 }, { OH: 5179 }, { CM: 5179 }, { PR: 5179 }, { DM: 5179 }, { BI: 5179 }, { TL: 5179 }, { WB: 5179 }, { PC: 5179 }, { SK: 5180 }]
|
||||
let port = 5112
|
||||
for (let i = 0; i < apimodules.length; i++) {
|
||||
const apimodule = apimodules[i]
|
||||
const key = Object.keys(apimodule)[0]
|
||||
@ -22,10 +22,10 @@ const config = {
|
||||
return `http://localhost:${apis}`
|
||||
},
|
||||
cookieDomain: "",
|
||||
flowServiceHost: "http://120.25.146.51:3188/",
|
||||
flowServiceHost: "http://120.25.146.31:3188/",
|
||||
hmiUrl: "http://localhost:8060/",
|
||||
webSocketHost: 'ws://localhost:3140/',
|
||||
picServerHost: 'http://localhost:3199',
|
||||
picServerHost: 'http://localhost:5199',
|
||||
dataVUrl: "http://localhost:8062/home",
|
||||
version: version,
|
||||
guideSeverHost: "http://47.122.43.22/apk/",
|
||||
@ -35,14 +35,14 @@ const config = {
|
||||
cloud: {
|
||||
serviceHost: api => {
|
||||
const apis = getServiceHost(api)
|
||||
return `http://120.25.146.51:${apis}`
|
||||
return `http://120.25.146.31:${apis}`
|
||||
},
|
||||
flowServiceHost: "http://120.25.146.51:3188",
|
||||
flowServiceHost: "http://120.25.146.31:3188",
|
||||
cookieDomain: "",
|
||||
hmiUrl: "http://120.25.146.51:8098/",
|
||||
webSocketHost: 'ws://120.25.146.51:3140/',
|
||||
picServerHost: 'http://120.25.146.51:3199',
|
||||
dataVUrl: "http://120.25.146.51:3167/home",
|
||||
hmiUrl: "http://120.25.146.31:8098/",
|
||||
webSocketHost: 'ws://120.25.146.31:3140/',
|
||||
picServerHost: 'http://120.25.146.31:5199',
|
||||
dataVUrl: "http://120.25.146.31:3167/home",
|
||||
version: version,
|
||||
guideSeverHost: "http://www.xmmhe.com/apk/",
|
||||
guideH5Host: "http://www.xmmhe.com:9100/",
|
||||
@ -57,7 +57,7 @@ const config = {
|
||||
cookieDomain: "",
|
||||
hmiUrl: "http://47.122.43.22:8098/",
|
||||
webSocketHost: 'ws://47.122.43.22:3140/',
|
||||
picServerHost: 'http://47.122.43.22:3199',
|
||||
picServerHost: 'http://47.122.43.22:5199',
|
||||
dataVUrl: "http://47.122.43.22:3167/home",
|
||||
version: version,
|
||||
guideSeverHost: "http://47.122.43.22/apk/",
|
||||
@ -68,79 +68,32 @@ const config = {
|
||||
|
||||
let env = ""
|
||||
switch (window.location.host) {
|
||||
case "120.25.146.51":
|
||||
case "120.25.146.31":
|
||||
case "120.25.146.31:5000":
|
||||
case "120.25.146.31:5001":
|
||||
case "120.25.146.31:5002":
|
||||
case "120.25.146.31:5003":
|
||||
case "120.25.146.31:5004":
|
||||
case "www.xmmhe.com":
|
||||
case "www.xmmhe.com:5000":
|
||||
case "www.xmmhe.com:5001":
|
||||
case "www.xmmhe.com:5002":
|
||||
case "www.xmmhe.com:5003":
|
||||
case "www.xmmhe.com:5004":
|
||||
case "xmmhe.com":
|
||||
case "xmmhe.com:5000":
|
||||
case "xmmhe.com:5001":
|
||||
case "xmmhe.com:5002":
|
||||
case "xmmhe.com:5003":
|
||||
case "xmmhe.com:5004":
|
||||
case "xmmhe.com:5005":
|
||||
env = "cloud"
|
||||
break
|
||||
case "120.25.146.51:8001":
|
||||
env = "cloud"
|
||||
break
|
||||
case "120.25.146.51:8002":
|
||||
env = "cloud"
|
||||
break
|
||||
case "120.25.146.51:8003":
|
||||
env = "cloud"
|
||||
break
|
||||
case "120.25.146.51:8004":
|
||||
env = "cloud"
|
||||
break
|
||||
case "120.25.146.51:8005":
|
||||
env = "cloud"
|
||||
break
|
||||
case "www.xmmhe.com:8001":
|
||||
env = "cloud"
|
||||
break
|
||||
case "www.xmmhe.com:8002":
|
||||
env = "cloud"
|
||||
break
|
||||
case "www.xmmhe.com:8003":
|
||||
env = "cloud"
|
||||
break
|
||||
case "www.xmmhe.com:8004":
|
||||
env = "cloud"
|
||||
break
|
||||
case "www.xmmhe.com:8005":
|
||||
env = "cloud"
|
||||
break
|
||||
case "xmmhe.com:8001":
|
||||
env = "cloud"
|
||||
break
|
||||
case "xmmhe.com:8002":
|
||||
env = "cloud"
|
||||
break
|
||||
case "xmmhe.com:8003":
|
||||
env = "cloud"
|
||||
break
|
||||
case "xmmhe.com:8004":
|
||||
env = "cloud"
|
||||
break
|
||||
case "xmmhe.com:8005":
|
||||
env = "cloud"
|
||||
break
|
||||
case "10.50.4.139:8000":
|
||||
env = "cloud"
|
||||
break
|
||||
case "10.50.2.189:8000":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8001":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8002":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8003":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8004":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8005":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8008":
|
||||
env = "test"
|
||||
break
|
||||
case "47.122.43.22:8006":
|
||||
case "47.122.43.22:5000":
|
||||
case "47.122.43.22:5001":
|
||||
case "47.122.43.22:5002":
|
||||
case "47.122.43.22:5003":
|
||||
case "47.122.43.22:5004":
|
||||
env = "test"
|
||||
break
|
||||
default:
|
||||
|
||||
@ -29,6 +29,29 @@ export default {
|
||||
click: regClick
|
||||
}
|
||||
},
|
||||
btnEditAuth: ({ record, close, loadData, login, dispatch }) => {
|
||||
const closeF = () => {
|
||||
close();
|
||||
loadData();
|
||||
};
|
||||
const regClick = async function () {
|
||||
await dispatch({
|
||||
type: 'custom/save',
|
||||
payload: {
|
||||
['userEditClick' + (record ? record.ID : '')]: true
|
||||
},
|
||||
});
|
||||
};
|
||||
const data = {
|
||||
id: (record ? record.ID : ''),
|
||||
close: closeF,
|
||||
userEditClick: login.userEditClick,
|
||||
};
|
||||
return {
|
||||
content: <FormPage formCode={'FM006'} data={data} />,
|
||||
click: regClick
|
||||
}
|
||||
},
|
||||
reset: ({ record, close, loadData, getLoadParam, login, btn, dispatch }) => {
|
||||
let val = initQueryFilter(login.OrgId, 1, 100, "NUM", 0);
|
||||
val["Keyword"] = record.ID;
|
||||
|
||||
@ -4,7 +4,7 @@ export function getOrg(params) { // 获取组织列表(service)
|
||||
return httpPost('OP/TenantInfo/GetOrgList', params)
|
||||
}
|
||||
|
||||
export function getToken(params) { // 获取Token(service)
|
||||
export function getToken(params) { // 获取Token(service) PF
|
||||
return httpPost('Token/Gen', params, false)
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,10 @@ const FMUserEditPage = Loadable({
|
||||
loader: () => import('../components/CustomPages/FM/UserEditPage'),
|
||||
loading: () => <div />
|
||||
})
|
||||
const FMUserEditPageAuth = Loadable({
|
||||
loader: () => import('../components/CustomPages/FM/UserEditPageAuth'),
|
||||
loading: () => <div />
|
||||
})
|
||||
|
||||
const FMUserGroupEditPage = Loadable({
|
||||
loader: () => import('../components/CustomPages/FM/UserGroupEditPage'),
|
||||
@ -2234,6 +2238,7 @@ const WB053ShowPrint = Loadable({
|
||||
export default function (componentName, formId, formParam, data, formCode, formData) {
|
||||
return {
|
||||
FMUserEditPage: <FMUserEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||
FMUserEditPageAuth: <FMUserEditPageAuth formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||
FMUserGroupEditPage: <FMUserGroupEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||
FMRoleGroupEditPage: <FMRoleGroupEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||
FMRoleEditPage: <FMRoleEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user