npm i --save lodash
<el-row>
<el-col :span="2">
<el-button type="primary" class="el-btn" @click="ShowPLY">ShowPLY</el-button>
</el-col>
<!-- <el-button type="primary" class="el-btn" @click="testScene">testPLY </el-button> -->
<div id="my-three" style="height:600px;width:100%"></div>
</el-row>
import { debounce, throttle } from 'lodash'
const ShowPLYExec = async () => {
GluePlyFileDate.value = getFileNameFromPath(GluePlyResultFile.value)
try {
//let pa = { No: "", PlyFile: "D:/aaa/work/project/aaa/aa/aa/PythonScript/GluePLY/Glue5.ply" GluePlyResultFile }
let pa = { No: "", PlyFile: GluePlyResultFile.value }
//let plyUrl = ""
await axios.post(global_const.WEBAPI + `Python/ShowPLY`, pa)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
//ElMessage.error(cmd + '命令执行异常!' + error)
console.log(error);
});
}
catch (err) {
//在此处理错误
console.log(err)
}
}
const ShowPLY = debounce((evt) => {
// ---- ^ 业务逻辑 ----
// 定义fn方法
const fn = (evt: any) => {
console.log('debounce =>', evt)
ShowPLYExec()
}
// 调用fn方法
fn(evt)
// ---- / 业务逻辑 ----
}, 3000)