|
@@ -78,6 +78,7 @@ export default {
|
|
|
props: {
|
|
|
addFloorFileVisible: Boolean,
|
|
|
FolderName: String,
|
|
|
+ floorList: Array,
|
|
|
FolderId: String
|
|
|
},
|
|
|
computed: {
|
|
@@ -133,17 +134,18 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onSubmit() {
|
|
|
+ let FloorName = null;
|
|
|
if (this.form.file == null) {
|
|
|
this.$message.error("模型文件不能为空!");
|
|
|
} else {
|
|
|
let FloorName = null;
|
|
|
// 根据是否有夹层拼接楼层名
|
|
|
- if (this.haveInterlayer) {
|
|
|
+ if (this.form.haveInterlayer) {
|
|
|
if (this.form.floorTypeVal == "RF") {
|
|
|
- FloorName = this.form.floorTypeVal + interlayerType;
|
|
|
+ FloorName = this.form.floorTypeVal + this.form.interlayerTypeVal;
|
|
|
} else {
|
|
|
FloorName =
|
|
|
- this.form.floorTypeVal + this.form.floorNum + interlayerType;
|
|
|
+ this.form.floorTypeVal + this.form.floorNum + this.form.interlayerTypeVal;
|
|
|
}
|
|
|
} else {
|
|
|
if (this.form.floorTypeVal == "RF") {
|
|
@@ -152,25 +154,29 @@ export default {
|
|
|
FloorName = this.form.floorTypeVal + this.form.floorNum;
|
|
|
}
|
|
|
}
|
|
|
- let data = {
|
|
|
- ProjectId: this.projectId,
|
|
|
- FolderId: this.FolderId,
|
|
|
- FloorName: FloorName,
|
|
|
- Form: this.form,
|
|
|
- userName:this.userInfo.username
|
|
|
- };
|
|
|
- request.createFloor(data).then(res => {
|
|
|
- if (res.Result == "success") {
|
|
|
- // 创建成功
|
|
|
- this.$emit("finishCreateFloor", {
|
|
|
- FloorModelId: res.FloorModelId,
|
|
|
- CurrentModelId:res.CurrentModelId,
|
|
|
- Form: this.form
|
|
|
- });
|
|
|
- this.handleClose();
|
|
|
- // this.submitUpload(res.FloorModelId);
|
|
|
- }
|
|
|
- });
|
|
|
+ if(this.floorList.some((item) => {return item.FloorName == FloorName})) {
|
|
|
+ this.$message.error('该楼层名称已存在,请勿重复创建!');
|
|
|
+ } else {
|
|
|
+ let data = {
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ FolderId: this.FolderId,
|
|
|
+ FloorName: FloorName,
|
|
|
+ Form: this.form,
|
|
|
+ userName:this.userInfo.username
|
|
|
+ };
|
|
|
+ request.createFloor(data).then(res => {
|
|
|
+ if (res.Result == "success") {
|
|
|
+ // 创建成功
|
|
|
+ this.$emit("finishCreateFloor", {
|
|
|
+ FloorModelId: res.FloorModelId,
|
|
|
+ CurrentModelId:res.CurrentModelId,
|
|
|
+ Form: this.form
|
|
|
+ });
|
|
|
+ this.handleClose();
|
|
|
+ // this.submitUpload(res.FloorModelId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// /上传到服务器/
|