Browse Source

flowinput update

fuyanting 1 year ago
parent
commit
45f47ee4c5

+ 1 - 1
fidms-admin/src/main/java/com/fidms/web/domain/FlowFieldInput.java

@@ -444,7 +444,7 @@ public class FlowFieldInput extends BaseEntity
         //公式中,单位的换算;
         double R=287,T0=288.15,P0=1.01325*pow(10,5),D0=1.225,g=9.8;
 
-            if(altitude>0 && altitude<=11000 )
+            if(altitude>=0 && altitude<=11000 )
             {
                 temperature = T0 - 0.0065*altitude;
                 pressure = P0*pow((1-0.0065*altitude/T0),(g/0.0065/R));

+ 6 - 7
fidms-ui/src/views/data/flowIn/index.vue

@@ -810,10 +810,9 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-
-            if ((this.form.flowDirectionX !== null && this.form.flowDirectionX !== '') ||
-                (this.form.flowDirectionY !== null && this.form.flowDirectionY !== '') ||
-                (this.form.flowDirectionZ !== null && this.form.flowDirectionZ !== '')){
+            if ((this.form.flowDirectionX !== null && this.form.flowDirectionX !== '' && this.form.flowDirectionX != "0") ||
+                (this.form.flowDirectionY !== null && this.form.flowDirectionY !== ''&& this.form.flowDirectionY != "0") ||
+                (this.form.flowDirectionZ !== null && this.form.flowDirectionZ !== ''&& this.form.flowDirectionZ != "0")){
                   updateFlowIn(this.form).then(response => {
                   this.$modal.msgSuccess("修改成功");
                   this.open = false;
@@ -824,9 +823,9 @@ export default {
                 this.$message.error('请保证来流方向X,Y,Z数据至少一项有效且取值不为0');
           } 
           }else {
-           if ((this.form.flowDirectionX !== null && this.form.flowDirectionX !== '') ||
-                (this.form.flowDirectionY !== null && this.form.flowDirectionY !== '') ||
-                (this.form.flowDirectionZ !== null && this.form.flowDirectionZ !== '')) {
+           if ((this.form.flowDirectionX !== null && this.form.flowDirectionX !== ''&& this.form.flowDirectionX != "0") ||
+                (this.form.flowDirectionY !== null && this.form.flowDirectionY !== ''&& this.form.flowDirectionY != "0") ||
+                (this.form.flowDirectionZ !== null && this.form.flowDirectionZ !== ''&& this.form.flowDirectionZ != "0")) {
               addFlowIn(this.form).then(response => {
                 this.$modal.msgSuccess("新增成功");
                 this.open = false;