From ebf82547d2597f1446bb3b4504bb49e85b959de3 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Fri, 21 Oct 2022 17:51:28 +0800
Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fieldDefinedSet/FieldDefined.js | 3 +-
.../components/resource/resource.js | 33 ++++++++++++-
pc4mobx/organization/stores/department.js | 14 ++----
pc4mobx/organization/stores/jobgrade.js | 4 +-
pc4mobx/organization/stores/joblevel.js | 4 +-
pc4mobx/organization/stores/newImport.js | 4 +-
pc4mobx/organization/stores/officeManage.js | 4 +-
pc4mobx/organization/stores/rankscheme.js | 4 +-
pc4mobx/organization/stores/resource.js | 49 +++++++------------
pc4mobx/organization/stores/sequence.js | 4 +-
pc4mobx/organization/stores/staff.js | 4 +-
pc4mobx/organization/stores/staffscheme.js | 6 ++-
pc4mobx/organization/style/common.less | 8 +--
13 files changed, 82 insertions(+), 59 deletions(-)
diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js
index c25e4f5..883998f 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js
@@ -144,6 +144,7 @@ export default class FieldDefined extends Component {
}
}
let children = [];
+ debugger
if (hasRight) {
const {
data,
@@ -186,7 +187,7 @@ export default class FieldDefined extends Component {
}
return (
- hasRight &&
+
{children}
)
diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js
index c2b9d7f..627b8e6 100644
--- a/pc4mobx/organization/components/resource/resource.js
+++ b/pc4mobx/organization/components/resource/resource.js
@@ -73,8 +73,8 @@ export default class Resource extends React.Component {
const {
resource
} = this.props;
- resource.getTableInfo();
resource.getHasRight();
+ resource.getTableInfo();
}
//左侧树
@@ -116,6 +116,35 @@ export default class Resource extends React.Component {
}
+ treeNodeClick = (event, ids, nodeids, nodes) => {
+ const {
+ resource
+ } = this.props;
+ const {
+ form2,
+ companysId
+ } = resource;
+ const type = event.node.props.type || '0';
+ const id = event.node.props.id || '';
+ let params = {};
+ form2.resetConditionValue();
+ resource.setPanelStatus(false)
+ // resource.tabkey = 'default_3';
+ resource.nodeType = type;
+ if (type == '0') {
+ params['virtualtype'] = companysId;
+ }
+ if (type == '1') {
+ params['companyId'] = id;
+ }
+ if (type == '2') {
+ params['departmentId'] = id;
+ }
+ if (type == '3') {
+ params['jobTitle'] = id;
+ }
+ resource.doSearch(params);
+ }
getTopMenuBtns() {
const {
@@ -273,7 +302,7 @@ export default class Resource extends React.Component {
form2
} = resource;
- resource.setSchemeName(val);
+ resource.setLastName(val);
!this.isEmptyObject(form2.getFormParams()) && resource.updateFields(val);
}
diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js
index b51b9cd..b9c33bb 100644
--- a/pc4mobx/organization/stores/department.js
+++ b/pc4mobx/organization/stores/department.js
@@ -138,7 +138,6 @@ export class DepartmentStore {
})
}
- //删除
delete() {
let params = {
ids: this.ids
@@ -194,7 +193,6 @@ export class DepartmentStore {
getDeptForm() {
-
this.setDialogLoadingStatus(true);
Api.getDeptForm(this.selectTreeNodeInfo).then(res => {
if (res.code === 200) {
@@ -209,8 +207,7 @@ export class DepartmentStore {
})
}
- @action("合并部门")
- getMergeForm(id) {
+ @action("合并部门") getMergeForm(id) {
let params = {
id: id
};
@@ -228,8 +225,7 @@ export class DepartmentStore {
})
}
- @action("转移部门")
- getTransferForm(id) {
+ @action("转移部门") getTransferForm(id) {
let params = {
id: id
};
@@ -247,8 +243,7 @@ export class DepartmentStore {
})
}
- @action("复制表单")
- getCopyForm() {
+ @action("复制表单") getCopyForm() {
let params = {};
Api.getCopyForm(params).then(res => {
if (res.code === 200) {
@@ -366,8 +361,7 @@ export class DepartmentStore {
}
- @action
- getHasRight() {
+ @action getHasRight() {
Api.getHasRight().then(res => {
if (res.code === 200) {
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js
index eaaa626..c4e27c0 100644
--- a/pc4mobx/organization/stores/jobgrade.js
+++ b/pc4mobx/organization/stores/jobgrade.js
@@ -107,7 +107,9 @@ export class JobGradeStore {
Api.getSearchList(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ if(res.data.hasRight) {
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.warning(res.msg);
}
diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js
index 5f43f7e..f164ef1 100644
--- a/pc4mobx/organization/stores/joblevel.js
+++ b/pc4mobx/organization/stores/joblevel.js
@@ -107,7 +107,9 @@ export class JobLevelStore {
Api.getSearchList(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ if(res.data.hasRight) {
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.warning(res.msg);
}
diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js
index 8fe6448..564634b 100644
--- a/pc4mobx/organization/stores/newImport.js
+++ b/pc4mobx/organization/stores/newImport.js
@@ -212,11 +212,11 @@ export class NewImportStore {
this.pvisable = true;
//导入文件提交
let params = {
- ...this.importParams,
keyField:this.keyField,
importType:this.importType,
operateType:this.operateType,
- excelfile:this.excelfile
+ excelfile:this.excelfile,
+ ...this.importParams,
}
if (this.otherParams != null) {
Object.assign(params, {
diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js
index ac769d7..f880029 100644
--- a/pc4mobx/organization/stores/officeManage.js
+++ b/pc4mobx/organization/stores/officeManage.js
@@ -100,7 +100,9 @@ export class OfficeManageStore {
API.getPostInfoTable(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ if(res.data.hasRight) {
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.error(res.msg);
}
diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js
index 5891ddb..0b50179 100644
--- a/pc4mobx/organization/stores/rankscheme.js
+++ b/pc4mobx/organization/stores/rankscheme.js
@@ -67,7 +67,9 @@ export class RankSchemeStore {
Api.getSearchList(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ if(res.data.hasRight){
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.warning(res.msg);
}
diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js
index 8ed79a2..38cca01 100644
--- a/pc4mobx/organization/stores/resource.js
+++ b/pc4mobx/organization/stores/resource.js
@@ -36,8 +36,7 @@ const {
@observable isPanelShow = false; //高级搜索面板
@observable form2 = new WeaForm();
@observable form = new WeaForm();
- @observable form1 = new WeaForm();
- @observable schemeName = '';
+ @observable lastName = '';
@observable conditionNum = 8;
@observable ids = ''; //选择行id
@observable searchConditionLoading = true;
@@ -49,20 +48,23 @@ const {
@observable defaultShowLeft = true;
@observable companysId = 1
- @observable hasRight = true;
+ @observable hasRight = '';
+
+ @observable selectTreeNodeInfo;
- @action
- getTableInfo() {
+ @action getTableInfo() {
let params;
this.tableStore = new TableStore();
if (this.isEmptyObject(this.form2.getFormParams())) {
params = {
+ ...this.selectTreeNodeInfo,
...this.form2.getFormParams(),
- schemeName: this.schemeName
+ lastName: this.lastName
};
} else {
params = {
+ ...this.selectTreeNodeInfo,
...this.form2.getFormParams()
};
}
@@ -76,7 +78,11 @@ const {
}, error => {
message.warning(error.msg);
})
+ }
+ @action("nodetree事件") doSearch(params) {
+ this.selectTreeNodeInfo = params;
+ this.getTableInfo();
}
save() {
@@ -105,25 +111,6 @@ const {
});
}
- 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
@@ -160,10 +147,10 @@ const {
}
- @action
- getHasRight() {
+ @action getHasRight() {
Api.getHasRight().then(res => {
if (res.code === 200) {
+ this.setHasRight(res.data.hasRight);
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
res.data.topMenu && this.setTopMenu(res.data.topMenu);
} else {
@@ -184,7 +171,7 @@ const {
updateFields(val) {
this.form2.updateFields({
- schemeName: {
+ lastName: {
value: val
}
});
@@ -206,8 +193,8 @@ const {
}
}
- setSchemeName(val) {
- this.schemeName = val;
+ setLastName(val) {
+ this.lastName = val;
}
isEmptyObject(obj) {
@@ -260,7 +247,6 @@ const {
this.schemeId = schemeId;
}
- @action
setDate(date) {
this.date = date;
}
@@ -276,6 +262,5 @@ const {
setHasRight(bool) {
this.hasRight = bool;
}
-
}
\ No newline at end of file
diff --git a/pc4mobx/organization/stores/sequence.js b/pc4mobx/organization/stores/sequence.js
index 92e0a09..fb7481d 100644
--- a/pc4mobx/organization/stores/sequence.js
+++ b/pc4mobx/organization/stores/sequence.js
@@ -69,7 +69,9 @@ export class SequenceStore {
Api.getSearchList(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ if(res.data.hasRight){
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.warning(res.msg);
}
diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js
index d512a27..8f133c0 100644
--- a/pc4mobx/organization/stores/staff.js
+++ b/pc4mobx/organization/stores/staff.js
@@ -75,7 +75,9 @@ export class StaffStore {
Api.getSearchList(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ if(res.data.hasRight) {
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.warning(res.msg);
}
diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js
index c27756d..3b6d1eb 100644
--- a/pc4mobx/organization/stores/staffscheme.js
+++ b/pc4mobx/organization/stores/staffscheme.js
@@ -68,8 +68,10 @@ export class StaffSchemeStore {
}
Api.getSearchList(params).then(res => {
if (res.code === 200) {
- this.setHasRight(res.data.hasRight)
- isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ this.setHasRight(res.data.hasRight);
+ if(res.data.hasRight) {
+ isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
+ }
} else {
message.warning(res.msg);
}
diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less
index b5002b0..512675e 100644
--- a/pc4mobx/organization/style/common.less
+++ b/pc4mobx/organization/style/common.less
@@ -82,9 +82,9 @@
}
//dialog弹框中下拉框组件宽度的样式问题
-.new-edit-wrapper{
- .wea-select, .ant-select{
- width: 100%;
+ .new-edit-wrapper{
+ .wea-select, .ant-select{
+ width: 100%;
+ }
}
-}