fei.wang
2024-05-10 96ad5792d7fcb35d0b05533bd5a3ff94a3ffc79d
Initial commit
已修改1个文件
165 ■■■■■ 文件已修改
src/components/toplane.vue 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/toplane.vue
@@ -13,16 +13,13 @@
            <!-- <el-form :inline="true" :label-position="labelPosition" label-width="80px" :model="formLabelAlign"> -->
            <div style="display: flex; ">
                <div
                    style="width:15.9%;height: 60px;border-right: 1px solid black">
                <div style="width:16%;height: 60px;border-right: 1px solid black">
                    <h2 style="color: #f5f7fa;margin-left: 5px;width: 50px;">名称</h2>
                </div>
                <div
                    style="width:42%;height: 60px;border-right: 1px solid black">
                <div style="width:42%;height: 60px;border-right: 1px solid black">
                    <h3 style="color: #f5f7fa;font-size: 18px;">激光点云</h3>
                </div>
                <div
                    style="width:42%;height: 60px;">
                <div style="width:42%;height: 60px;">
                    <h3 style="color: #f5f7fa;font-size: 18px;">CAD地图</h3>
                </div>
            </div>
@@ -52,8 +49,7 @@
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <h3>Y</h3>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                <div style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <h3>Z</h3>
                </div>
@@ -65,61 +61,71 @@
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input  style=" border: none;" v-model="three.threeAX" oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云A点X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeAX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云A点X坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeAY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云A点Y坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeAY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云A点Y坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeAZ"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云A点Z坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeAZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云A点Z坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeAX"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图A点X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="plane.planeAX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图A点X坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeAY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图A点Y坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="plane.planeAY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图A点Y坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <el-input style=" border: none;" v-model="plane.planeAZ"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图A点Z坐标"></el-input>
                <div style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <el-input class="class1" style=" border: none;" v-model="plane.planeAZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图A点Z坐标"></el-input>
                </div>
            </div>
            <div style="display: flex; border-top: 1px solid black">
                <div
                    style="width:16%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black" >
                    style="width:16%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <h3 style="margin-left: 5px;width: 70px;">已知B点</h3>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeBX"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云B点X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeBX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云B点X坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeBY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云B点Y坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeBY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云B点Y坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeBZ"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云B点Z坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeBZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云B点Z坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeBX"oninput ="value=value.replace(/[^\d.-]/g,'')"  placeholder="输入CAD地图B点X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="plane.planeBX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图B点X坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeBY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图B点Y坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="plane.planeBY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图B点Y坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <el-input style=" border: none;" v-model="plane.planeBZ"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图B点Z坐标"></el-input>
                <div style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <el-input class="class1" style=" border: none;" v-model="plane.planeBZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图B点Z坐标"></el-input>
                </div>
            </div>
            <div style="display: flex; border-top: 1px solid black; border-bottom: 1px solid black">
@@ -129,29 +135,34 @@
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeCX"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云C点X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeCX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云C点X坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeCY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云C点Y坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeCY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云C点Y坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeCZ"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云C点Z坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeCZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入激光点云C点Z坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeCX"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图C点X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="plane.planeCX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图C点X坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);border-right: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeCY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图C点Y坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="plane.planeCY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图C点Y坐标"></el-input>
                </div>
                <div
                    style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <el-input style=" border: none;" v-model="plane.planeCZ"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图C点Z坐标"></el-input>
                <div style="width:14%;height: 40px;background-color:rgba(205, 211, 232, 100);">
                    <el-input class="class1" style=" border: none;" v-model="plane.planeCZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入CAD地图C点Z坐标"></el-input>
                </div>
            </div>
@@ -214,31 +225,41 @@
                </div>
                <div style="width:14%;height: 40px;border: 1px solid black;">
                    <!-- <template slot-scope="scope"> -->
                    <el-input style=" border: none;" v-model="three.threeDX"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入待计算X坐标"></el-input>
                    <el-input class="class1" style=" border: none;" v-model="three.threeDX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入待计算X坐标"></el-input>
                    <!-- </template> -->
                </div>
                <div style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeDY"oninput ="value=value.replace(/[^\d.-]/g,'')" placeholder="输入待计算Y坐标"></el-input>
                <div
                    style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input class="class1" style=" border: none;" v-model="three.threeDY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入待计算Y坐标"></el-input>
                </div>
                <div style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input style=" border: none;" v-model="three.threeDZ"oninput ="value=value.replace(/[^\d.-]/g,'')"  placeholder="输入待计算Z坐标"></el-input>
                <div
                    style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input class="class1" style=" border: none;" v-model="three.threeDZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" placeholder="输入待计算Z坐标"></el-input>
                </div>
                <div style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeDX"oninput ="value=value.replace(/[^\d.-]/g,'')" readonly></el-input>
                <div
                    style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input class="class1" style=" border: none;" v-model="plane.planeDX"
                        oninput="value=value.replace(/[^\d.-]/g,'')" readonly></el-input>
                </div>
                <div style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeDY"oninput ="value=value.replace(/[^\d.-]/g,'')" readonly></el-input>
                <div
                    style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input class="class1" style=" border: none;" v-model="plane.planeDY"
                        oninput="value=value.replace(/[^\d.-]/g,'')" readonly></el-input>
                </div>
                <div style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input style=" border: none;" v-model="plane.planeDZ"oninput ="value=value.replace(/[^\d.-]/g,'')" readonly></el-input>
                <div
                    style="width:14%;height: 40px;border-right: 1px solid black;border-top: 1px solid black;border-bottom: 1px solid black">
                    <el-input class="class1" style=" border: none;" v-model="plane.planeDZ"
                        oninput="value=value.replace(/[^\d.-]/g,'')" readonly></el-input>
                </div>
            </div>
            <el-button @click="onDfSubmit" type="success"
                style="margin-top: 5px;">计算坐标</el-button>
            <el-button @click="onDfSubmit" type="success" style="margin-top: 5px;">计算坐标</el-button>
                <el-button @click="onClear" type="success" style="margin-left: 180px; margin-top: 50px;"  >清空数据</el-button>
            <el-button @click="onClear" type="success" style="margin-left: 180px; margin-top: 50px;">清空数据</el-button>
        </div>
@@ -250,6 +271,10 @@
</template>
<script>
//测试数据
//  String posPlane = "158,596,0;671,596,0;158,1430,0";
//             String posPointCloud = "3.851,8.806,-0.207;7.68,5.362,-0.197;-1.71,2.54,-0.21";
//         String posPointCloudCheck = "-1.161,3.115,2.424";
import axios from 'axios';
//const dfurl = 'http://39.106.210.13:8848/hxzkuwb/ddmm2d';
const plane = 'http://39.106.210.13:8848/hxzkuwb/toplane';
@@ -413,7 +438,7 @@
            this.three.threeA = this.three.threeAX + "," + this.three.threeAY + "," + this.three.threeAZ
            this.three.threeB = this.three.threeBX + "," + this.three.threeBY + "," + this.three.threeBZ
            this.three.threeC = this.three.threeCX + "," + this.three.threeCY + "," + this.three.threeCZ
            const  posPointCloud= this.three.threeA + ";" + this.three.threeB + ";" + this.three.threeC
            const posPointCloud = this.three.threeA + ";" + this.three.threeB + ";" + this.three.threeC
            console.log(this.plane.planeAX);
            this.plane.planeA = this.plane.planeAX + "," + this.plane.planeAY + "," + this.plane.planeAZ
@@ -426,24 +451,24 @@
            console.log(posPlane);
            console.log(posPointCloud);
            console.log(posPointCloudCheck);
            const params = { posPlane: posPlane,posPointCloud:posPointCloud,posPointCloudCheck:posPointCloudCheck };
            const params = { posPlane: posPlane, posPointCloud: posPointCloud, posPointCloudCheck: posPointCloudCheck };
            axios.get(plane, { params })
                .then((response) => {
                    console.log('成功获取到后端数据', response.data);
                    // 处理返回的数据
                    // console.log(res);
                    if(response.data=="选点有问题,请重新选点"){
                    if (response.data == "选点有问题,请重新选点") {
                        this.$message.error('选点有问题,请重新选点');
                    }else{
                    //     this.plane.planeDX = response.data.split(";")[0]
                    // this.plane.planeDY = response.data.split(";")[1]
                    // this.plane.planeDZ = response.data.split(";")[2]
                    } else {
                        //     this.plane.planeDX = response.data.split(";")[0]
                        // this.plane.planeDY = response.data.split(";")[1]
                        // this.plane.planeDZ = response.data.split(";")[2]
                    this.plane.planeDX = parseFloat(response.data.split(";")[0]).toFixed(2)
                    this.plane.planeDY = parseFloat(response.data.split(";")[1]).toFixed(2)
                    this.plane.planeDZ = parseFloat(response.data.split(";")[2]).toFixed(2)
                        this.plane.planeDX = parseFloat(response.data.split(";")[0]).toFixed(2)
                        this.plane.planeDY = parseFloat(response.data.split(";")[1]).toFixed(2)
                        this.plane.planeDZ = parseFloat(response.data.split(";")[2]).toFixed(2)
                    }
                })
                .catch((error) => {
                    this.$message.error('坐标数据不能为空');
@@ -461,10 +486,10 @@
            this.three.threeBX = ''
            this.three.threeBY = ''
            this.three.threeBZ = ''
            this.three.threeC= ''
            this.three.threeCX= ''
            this.three.threeCY= ''
            this.three.threeCZ= ''
            this.three.threeC = ''
            this.three.threeCX = ''
            this.three.threeCY = ''
            this.three.threeCZ = ''
            this.three.threeDX = ''
            this.three.threeDY = ''
            this.three.threeDZ = ''
@@ -514,7 +539,7 @@
.plane {
    /* border-radius: 10px; */
    background-color:#0783e991;
    background-color: #0783e991;
    text-align: center;
    width: 1300px;
    height: 430px;
@@ -543,18 +568,20 @@
}
.class1 .el-input__inner {
    background-color: rgba(231, 233, 243, 100) !important;
    height: 40px;
    border-radius: 0px;
    /* background-color: rgba(231, 233, 243, 100) !important;
    height: 40px; */
}
.class2 .el-input__inner {
    background-color: rgba(205, 211, 232, 100) !important;
    height: 40px;
    border-radius: 0px;
    /* background-color: rgba(205, 211, 232, 100) !important;
    height: 40px; */
}
.class3 .el-input__inner {
    background-color: rgba(67, 113, 1194, 100) !important;
    /* background-color: rgba(67, 113, 1194, 100) !important; */
    border-radius: 0px;
    height: 40px;
    /* height: 40px; */
}
</style>