SOURCE

console 命令行工具 X clear

                    
>
console
new Vue({
    el: "#app",
    data() {
        return {
            camInfoBefore: null,
            camInfoAfter: null,
            finalResult: '暂无数据',
        }
    },
    mounted(){

    },
    methods: {
        formatInfo() {

            if (!this.camInfoBefore || !this.camInfoAfter) {
                this.$message({
                    message: '请先粘贴数据!!',
                    type: 'warning'
                });
                return;
            }


            var camInfoBefore = JSON.parse(this.camInfoBefore);
            var camInfoAfter = JSON.parse(this.camInfoAfter);

            console.log(camInfoBefore)

            // // 输入起始镜头
            // var camInfoBefore =
            // {
            //     "相机经度": 1,
            //     "相机纬度": 1,
            //     "相机高度": 1,
            //     "视点经度": 2,
            //     "视点纬度": 2,
            //     "视点高度": 2
            // }

            // //输入终点镜头
            // var camInfoAfter =
            // {
            //     "相机经度": 3,
            //     "相机纬度": 3,
            //     "相机高度": 3,
            //     "视点经度": 4,
            //     "视点纬度": 4,
            //     "视点高度": 4
            // }


            var forceTargetBefore = [];
            var pathBefore = [];

            forceTargetBefore[0] = camInfoBefore["视点经度"];
            forceTargetBefore[1] = camInfoBefore["视点纬度"];
            forceTargetBefore[2] = camInfoBefore["视点高度"];
            pathBefore[0] = camInfoBefore["相机经度"];
            pathBefore[1] = camInfoBefore["相机纬度"];
            pathBefore[2] = camInfoBefore["相机高度"];

            var forceTargetAfter = [];
            var pathAfter = [];

            forceTargetAfter[0] = camInfoAfter["视点经度"];
            forceTargetAfter[1] = camInfoAfter["视点纬度"];
            forceTargetAfter[2] = camInfoAfter["视点高度"];
            pathAfter[0] = camInfoAfter["相机经度"];
            pathAfter[1] = camInfoAfter["相机纬度"];
            pathAfter[2] = camInfoAfter["相机高度"];


            var data = {
                "delay": 0,
                "duration": 6000,
                "distance": 0,
                "emit": "inner",
                "transition": 0,
                "easeing": [
                    0.76,
                    0.01,
                    0.27,
                    0.78
                ],
                "forceTarget": [forceTargetBefore, forceTargetAfter],
                "path": [pathBefore, pathAfter]
            };

            this.finalResult = JSON.stringify(data);



            console.log(JSON.stringify(data))


        },

        copyResult(){

             this.$message({
                    message: '此功能待开发,别瞎点',
                    type: 'warning'
                });
            // window.clipboardData.setData("Text",this.finalResult);
        }

    }
})

<script src="//unpkg.com/vue/dist/vue.js">

</script>
<script src="//unpkg.com/element-ui@2.0.11/lib/index.js">

</script>

<div id="app">

	<el-container>
		<el-header>乐高镜头转换</el-header>
		<el-main>

			<el-input class="v-input" width="400px" type="textarea" :rows="2" placeholder="请粘贴前一个镜头的数据" v-model="camInfoBefore">
			</el-input>

			<el-input class="v-input" width="400px" type="textarea" :rows="2" placeholder="请粘贴后一个镜头的数据" v-model="camInfoAfter">
			</el-input>

			<el-button type="primary" @click="formatInfo" size="small">转换</el-button>
			<el-button type="warning" @click="copyResult" size="small" class="btn">复制结果</el-button>

			<br>
   
    <el-card  class="v-card">
        <el-input :rows="6" type="textarea" id="copyid" v-model="finalResult" > </el-input>
    </el-card>

        </el-main>

	</el-container>
</div>
 @import url("//unpkg.com/element-ui@2.0.11/lib/theme-chalk/index.css");
 
  .el-header, .el-footer {
    /* background-color: #B3C0D1; */
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 60px;
    font-weight: bold;
  }
  
  .el-main {
    /* background-color: #E9EEF3; */
    color: #333;
  }

  .el-input{
      margin-bottom: 20px;
  }

  .v-card{
      margin-top: 20px;
  }
  
  .v-input{
      margin-bottom: 20px;
  }

本项目引用的自定义外部资源