ManualDrawingTool.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <el-container :class="'content'">
  3. <el-header>
  4. <el-button type="primary" class="add-item" @click="handleAddPoint"> 激活绘点 </el-button>
  5. <el-button type="primary" class="add-item" @click="handleAddLine"> 激活绘线 </el-button>
  6. <el-button type="primary" class="add-item" @click="handleDownload"> 下载工具包 </el-button>
  7. </el-header>
  8. <el-main>
  9. <iframe :src="loadSrc" frameborder="0"></iframe>
  10. </el-main>
  11. </el-container>
  12. </template>
  13. <script>
  14. // 手动落图工具
  15. export default {
  16. data() {
  17. return {
  18. loadSrc: "",
  19. src: "./static/package/collectdata/dist/index.html"
  20. };
  21. },
  22. mounted() {
  23. this.loadSrc = this.src;
  24. },
  25. methods: {
  26. handleAddPoint() {
  27. this.loadSrc = this.src + "?type=1";
  28. },
  29. handleAddLine() {
  30. this.loadSrc = this.src + "?type=2";
  31. },
  32. handleDownload() {
  33. let item = systemConfig.plugins[2];
  34. const elink = document.createElement("a");
  35. elink.href = item.src;
  36. elink.setAttribute("download", item.name);
  37. elink.style.display = "none";
  38. document.body.appendChild(elink);
  39. setTimeout(() => {
  40. elink.click();
  41. document.body.removeChild(elink);
  42. }, 66);
  43. }
  44. }
  45. };
  46. </script>
  47. <style lang="less" scoped>
  48. .content {
  49. width: calc(100% - 20px);
  50. margin-left: 20px;
  51. .el-header {
  52. background: #ffffff;
  53. margin-bottom: 20px;
  54. padding-top: 10px;
  55. }
  56. .el-main {
  57. background: #ffffff;
  58. overflow: hidden;
  59. box-sizing: border-box;
  60. position: relative;
  61. border-radius: 5px;
  62. padding: 0px 0px;
  63. iframe {
  64. width: 100%;
  65. height: 100%;
  66. }
  67. }
  68. }
  69. </style>