Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhaomeijing
2022-06-17 14:30:50 +08:00
3 changed files with 31 additions and 9 deletions
@@ -115,7 +115,8 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
*/
@Override
public void editById(DummyInventoryBaseEO dummyInventoryBaseEO) {
DummyInventoryBaseEO baseEO = queryById(dummyInventoryBaseEO.getId());
List<String> baseIdList = Arrays.asList(dummyInventoryBaseEO.getId().split(","));
List<DummyInventoryBaseEO> baseEOList = listByIds(baseIdList);
List<String> createByNameList =new ArrayList<>();
if (StringUtils.isNotBlank(dummyInventoryBaseEO.getCreateBy())) {
createByNameList = Arrays.asList(dummyInventoryBaseEO.getCreateBy().split(","));
@@ -124,14 +125,19 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
// 增加创建者校验
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String loginUserName = sysUser.getUsername();
if (!baseEO.getCreateBy().contains(loginUserName)) {
if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
throw new JeroBootException("当前用户非创建者,无法编辑");
} else {
throw new JeroBootException("The current user is not the creator and cannot be edited.");
StringBuilder messageBuilder = new StringBuilder();
for (DummyInventoryBaseEO baseEO : baseEOList) {
if (!baseEO.getCreateBy().contains(loginUserName)) {
messageBuilder.append(baseEO.getName()).append(",");
}
}
String message = messageBuilder.substring(0, messageBuilder.length() - 1);
if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
throw new JeroBootException("当前用户非"+message+"的创建者,无法编辑");
} else {
throw new JeroBootException(
"The current user is not the creator of "+message+" and cannot be edited.");
}
}
}
@@ -97,6 +97,13 @@
this.visibleTree = false
},
handleSubmit() {
if (this.userName.length > 1) {
this.$message.warning(this.$t('onlyOnePersonCanBeSelected'))
return
} else if (this.userName.length == 0) {
this.$message.warning(this.$t('pleaseSelectPersonFirst'))
return
}
let query = {
id: this.tableKey,
createBy: this.userName.join(',')
@@ -70,6 +70,7 @@
<updateLog :url="url" ref="updateLogRef"/>
<historicalVersionList ref="historicalVersionListRef"/>
<commentList ref="commentListRef"/>
<JLoading :loading="loading"></JLoading>
</div>
</template>
@@ -103,6 +104,7 @@
isDisplayNum: '',
textTitle: '',
isTrue: true,
loading: false,
url: {
logList: '/project/projectLawsInventoryLogEO/page',
historicalVersionUrl: '',
@@ -224,10 +226,14 @@
postAction('/project/projectRelatedPersonnel/page', query).then((res) => {
if (res.success) {
let dataSource = res.result || []
console.log(dataSource)
dataSource.forEach(res => {
this.engineeringInterfacePerson += res.engineeringInterfacePerson + ','
if (res.engineeringInterfacePerson || res.certificationEngineer || res.lawEngineer) {
this.engineeringInterfacePerson += res.engineeringInterfacePerson + ',' + res.certificationEngineer + ',' + res.lawEngineer + ','
}
})
if (this.engineeringInterfacePerson.includes(this.userInfo().id)) {
if (this.engineeringInterfacePerson.includes(this.userInfo().id) ||
this.$route.query.studioEngineer == this.userInfo().id) {
this.isTrue = true
} else {
this.isTrue = false
@@ -235,8 +241,10 @@
this.$nextTick(() => {
this.textColor(0)
})
this.loading = false
} else {
this.textColor(0)
this.loading = false
}
})
},
@@ -264,6 +272,7 @@
.doc-detail {
background: #fff;
height: 100%;
position: relative;
.Virtual-detail-header {
width: 100%;