bug修复

This commit is contained in:
Chengliang 2023-08-04 17:49:42 +08:00
parent 0e9eb6db03
commit 72a3d27b16
2 changed files with 21 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-18 14:52:39
* @LastEditTime: 2023-07-26 18:59:02
* @LastEditTime: 2023-08-04 16:52:47
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
*/
@ -28,11 +28,16 @@ import AttachToNumberField from "../NewNumberField";
export default class CompanyExtend extends React.Component {
componentDidMount() {
this.init();
this.handleHashChange();
window.addEventListener('hashchange', this.handleHashChange);
}
init = () => {
componentWillUnmount() {
window.removeEventListener('hashchange', this.handleHashChange);
}
handleHashChange = () => {
const { companyExtend, company } = this.props;
//const {id} = company;
let { hash } = window.location;
hash = hash.split("?")[0];
let id = hash.match("[^/]+(?=/$|$)")[0];
@ -129,7 +134,7 @@ export default class CompanyExtend extends React.Component {
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
{field.domkey[0] == 'subcompanycode' && <AttachToNumberField field={field} form={form} isEdit={true} />}
{field.domkey[0] == 'subcompanycode' && isEditor &&<AttachToNumberField field={field} form={form} isEdit={true} />}
</WeaFormItem>),
colSpan: 1
});
@ -231,7 +236,7 @@ export default class CompanyExtend extends React.Component {
}
backCard = () => {
this.init();
this.handleHashChange();
}
view = () => {

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-06-02 09:20:03
* @LastEditTime: 2023-07-26 18:59:14
* @LastEditTime: 2023-08-04 16:51:56
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js
*/
@ -29,9 +29,15 @@ import '../../style/common.less';
export default class DepartmentExtendStore extends React.Component {
componentDidMount() {
this.init();
this.handleHashChange();
window.addEventListener('hashchange', this.handleHashChange);
}
init = () => {
componentWillUnmount() {
window.removeEventListener('hashchange', this.handleHashChange);
}
handleHashChange = () => {
const { departmentExtend, department } = this.props;
let { hash } = window.location;
hash = hash.split("?")[0];
@ -242,7 +248,7 @@ export default class DepartmentExtendStore extends React.Component {
}
backCard = () => {
this.init();
this.handleHashChange();
}
changeData(key) {