|
@@ -32,7 +32,7 @@
|
|
<div class="footer">
|
|
<div class="footer">
|
|
<view class="result dir-top-wrap cross-center" v-if="showResult">
|
|
<view class="result dir-top-wrap cross-center" v-if="showResult">
|
|
<view v-for="item in rules" v-if="item.value && item.show">
|
|
<view v-for="item in rules" v-if="item.value && item.show">
|
|
- <text>{{item.name}}=</text>{{item.value}}{{item.unit}}
|
|
|
|
|
|
+ <text>{{item.name}}=</text>{{$util.round(item.value,2)}}{{item.unit}}
|
|
<text v-if="item.isHalf">{{$util.round(item.value/2,2)}}{{item.unit}}</text>
|
|
<text v-if="item.isHalf">{{$util.round(item.value/2,2)}}{{item.unit}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -90,6 +90,10 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.initRules();
|
|
this.initRules();
|
|
|
|
+ if(this.formData.xiebian){
|
|
|
|
+ this.rules.xiebian.value = this.formData.xiebian;
|
|
|
|
+ this.rules.xiebian.show = false;
|
|
|
|
+ }
|
|
/*1:已知高、角度:底边=高÷tan角度° 斜边=高÷sin角度°*/
|
|
/*1:已知高、角度:底边=高÷tan角度° 斜边=高÷sin角度°*/
|
|
if(this.formData.height && this.formData.angle){
|
|
if(this.formData.height && this.formData.angle){
|
|
this.rules.dibian.value = this.formData.height/this.$util.tan(this.formData.angle);
|
|
this.rules.dibian.value = this.formData.height/this.$util.tan(this.formData.angle);
|
|
@@ -115,6 +119,11 @@
|
|
this.rules.height.value = Math.sqrt(Math.pow(this.formData.xiebian,2) - Math.pow(this.formData.dibian,2));
|
|
this.rules.height.value = Math.sqrt(Math.pow(this.formData.xiebian,2) - Math.pow(this.formData.dibian,2));
|
|
this.rules.angle.value = this.$util.acos(this.formData.dibian/this.formData.xiebian);
|
|
this.rules.angle.value = this.$util.acos(this.formData.dibian/this.formData.xiebian);
|
|
}
|
|
}
|
|
|
|
+ /* 6:已知高、斜边:底边²=斜边²-高² cos角度°=底边÷斜边*/
|
|
|
|
+ if(this.formData.height && this.formData.xiebian){
|
|
|
|
+ this.rules.dibian.value = Math.sqrt(Math.pow(this.formData.xiebian,2) - Math.pow(this.formData.height,2));
|
|
|
|
+ this.rules.angle.value = this.$util.acos(this.rules.dibian.value/this.formData.xiebian);
|
|
|
|
+ }
|
|
/*选填(输入边高计算出切口):1、 切口=边高×tan(角度°÷2)×2 2、 起弯=长-底边*/
|
|
/*选填(输入边高计算出切口):1、 切口=边高×tan(角度°÷2)×2 2、 起弯=长-底边*/
|
|
if(this.formData.biangao){
|
|
if(this.formData.biangao){
|
|
let angle = this.rules.angle.value ? this.rules.angle.value : this.formData.angle
|
|
let angle = this.rules.angle.value ? this.rules.angle.value : this.formData.angle
|
|
@@ -124,12 +133,13 @@
|
|
let dibian = this.formData.dibian ? this.formData.dibian : this.rules.dibian.value
|
|
let dibian = this.formData.dibian ? this.formData.dibian : this.rules.dibian.value
|
|
this.rules.qiwan.value = this.formData.length - dibian;
|
|
this.rules.qiwan.value = this.formData.length - dibian;
|
|
}
|
|
}
|
|
|
|
+ console.log('-->data',this.rules)
|
|
this.roundRules();
|
|
this.roundRules();
|
|
this.$u.toast("请参考计算示意图")
|
|
this.$u.toast("请参考计算示意图")
|
|
},
|
|
},
|
|
roundRules(){
|
|
roundRules(){
|
|
for (const itemKey in this.rules) {
|
|
for (const itemKey in this.rules) {
|
|
- this.rules[itemKey].value = this.$util.round(this.rules[itemKey].value,2);
|
|
|
|
|
|
+ //this.rules[itemKey].value = this.$util.round(this.rules[itemKey].value,2);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
initRules(){
|
|
initRules(){
|