IdentificatView.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="containe">
  3. <div class="main1" v-show="aaa">
  4. <div class="left">
  5. <el-image style="width: 350px; height: 350px" :src="url" fit="contain"></el-image>
  6. </div>
  7. <div class="right">
  8. {{ tt }}
  9. </div>
  10. </div>
  11. <div class="main2" v-show="bbb">
  12. <div class="top">
  13. <img src="../../../assets/img/shangchuan.png" alt="" />
  14. </div>
  15. <el-upload class="upload-demo" :action="ocrUrl" :on-preview="handlePreview" :on-success="handleAvatarSuccess"
  16. list-type="picture" :show-file-list="false">
  17. <el-button size="small" type="primary">点击上传图片</el-button>
  18. </el-upload>
  19. </div>
  20. <el-button class="returns" @click="returns" v-if="ccc">上传新的</el-button>
  21. <el-button class="copys" @click="copys" v-if="ccc">复制</el-button>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. url: "",
  29. //扫描界面默认关闭
  30. aaa: false,
  31. //图片上传界面默认打开
  32. bbb: true,
  33. //返回按钮与扫描界面同步
  34. ccc: false,
  35. //复制按钮与扫描界面同步
  36. tt: null,
  37. ocrUrl: ""
  38. };
  39. },
  40. created() {
  41. // this.ocrUrl=process.env.VUE_APP_BASE_API+"/ocr/";
  42. this.ocrUrl="http://192.168.1.28/dev-api/ocr/";
  43. },
  44. methods: {
  45. handlePreview(file) {
  46. console.log(file);
  47. },
  48. handleAvatarSuccess(response, file, fileList) {
  49. this.url = file.url;
  50. this.tt = response;
  51. this.aaa = true;
  52. this.bbb = false;
  53. this.ccc = true;
  54. },
  55. returns() {
  56. this.aaa = false;
  57. this.bbb = true;
  58. this.ccc = false;
  59. this.url = "";
  60. },
  61. copys() {
  62. this.$copyText(this.tt).then(
  63. this.$modal.alertSuccess("复制成功")
  64. );
  65. },
  66. },
  67. };
  68. </script>
  69. <style scoped lang='scss'>
  70. .containe {
  71. .main1 {
  72. display: flex;
  73. justify-content: space-around;
  74. padding-top: calc(100vh * (100 / 1080));
  75. .left {
  76. width: calc(100vw * (800 / 1920));
  77. height: calc(100vh * (700 / 1080));
  78. border: 1px dashed white;
  79. display: flex;
  80. justify-content: center;
  81. align-items: center;
  82. }
  83. .right {
  84. width: calc(100vw * (800 / 1920));
  85. height: calc(100vh * (700 / 1080));
  86. border: 1px dashed white;
  87. color: #7ea4c8ff;
  88. }
  89. }
  90. .main2 {
  91. width: calc(100vw * (800 / 1920));
  92. height: calc(100vh * (700 / 1080));
  93. position: absolute;
  94. left: 30%;
  95. top: 15%;
  96. text-align: center;
  97. .top {
  98. margin-top: 10%;
  99. margin-bottom: calc(100vh * (20 / 1080));
  100. }
  101. }
  102. .returns {
  103. margin-left: 20%;
  104. margin-top: calc(100vh * (50 / 1080));
  105. }
  106. .copys {
  107. margin-left: 30%;
  108. margin-top: calc(100vh * (50 / 1080));
  109. }
  110. }
  111. ::v-deep .el-button--small {
  112. width: calc(100vw * (400 / 1920));
  113. height: calc(100vh * (80 / 1080));
  114. font-size: 25px;
  115. text-align: center;
  116. border-radius: 30px 30px 30px 30px;
  117. }
  118. </style>