You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 9.3 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <div class="ui container">
  3. <div class="tuomin-title">
  4. <h2>数据脱敏模型体验</h2>
  5. <p>利用人工智能AI技术,把图片中的人脸、车牌号码进行脱敏处理。该模型更多信息请访问项目 &nbsp;<a href="">tengxiao / tuomin</a></p>
  6. </div>
  7. <el-row :gutter="12" style="margin-top: 33px;">
  8. <el-col :span="12">
  9. <div class="tuomin-content-image">
  10. <div class="tuomin-icon">
  11. <i class="ri-image-line" style="font-size: 16px;margin-right:2px;"></i>
  12. <span style="font-size: 12px;">img</span>
  13. </div>
  14. <div style="height:230px;width: 96%;margin: 0 auto;">
  15. <el-upload
  16. action="#"
  17. accept=".jpg,.jpeg,.png,.gif,.JPG,.JPEG"
  18. :show-file-list="false"
  19. :on-change="handleLicensePreview"
  20. :before-upload="beforeLicenseUpload"
  21. list-type="picture-card"
  22. :style="{display:(ImageUrl ? 'none':'block')}"
  23. :auto-upload="false"
  24. >
  25. <div class="el-upload__text">拖动图片到这里 <span style="color: rgba(136, 136, 136, 0.87);">或</span> 点击上传</div>
  26. </el-upload>
  27. <img class="preview-image" v-if="ImageUrl" :src="ImageUrl" alt="">
  28. </div>
  29. <div>
  30. <div class="tuomin-radio-model">
  31. <label class="radio-label">脱敏对象:</label>
  32. <div>
  33. <el-radio-group v-model="radio">
  34. <el-radio :label="2">全部</el-radio>
  35. <el-radio :label="1">仅人脸</el-radio>
  36. <el-radio :label="0">仅车牌</el-radio>
  37. </el-radio-group>
  38. </div>
  39. </div>
  40. <div class="tuomin-button-model">
  41. <el-button @click="cancelUpload">取消</el-button>
  42. <el-button @click="startTranform" type="primary">开始处理</el-button>
  43. </div>
  44. </div>
  45. </div>
  46. </el-col>
  47. <el-col :span="12">
  48. <div class="tuomin-content-image">
  49. <div class="tuomin-icon">
  50. <i class="ri-image-line" style="font-size: 16px;margin-right:2px;"></i>
  51. <span style="font-size: 12px;">output</span>
  52. </div>
  53. </div>
  54. </el-col>
  55. </el-row>
  56. <div class="table-container">
  57. <div>
  58. <el-table border style="width:100%">
  59. <el-table-column :label="$t('user.invitedFriends')" header-align="center">
  60. <template slot-scope="scope">
  61. <div style="display:flex;align-items:center;padding-left:20px;">
  62. <img :src="scope.row.avatarSrc" alt="" style="height:45px;width:45px;margin-right:10px;" />
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column prop="statusStr" :label="$t('status')" align="center" header-align="center">
  67. <template slot-scope="scope">
  68. <span :style="{ color: scope.row.statusColor }">{{ scope.row.statusStr }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="regTime" :label="$t('user.registrationTime')" align="center" header-align="center">
  72. </el-table-column>
  73. </el-table>
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import Clipboard from 'clipboard';
  80. import QRCode from 'qrcodejs2';
  81. import { formatDate } from 'element-ui/lib/utils/date-util';
  82. import { imageTranform } from '~/apis/modules/tuomin';
  83. import axios from 'axios';
  84. export default {
  85. data() {
  86. return {
  87. bannerImg: '',
  88. bannerTitle: '',
  89. pageLink: '',
  90. pageLinkDesc: '',
  91. invitationLink: window.origin + '/user/sign_up?sharedUser=',
  92. invitationCode: '',
  93. pageOpeniDesc: '',
  94. loading: false,
  95. tableData: [],
  96. pageInfo: {
  97. curpage: 1,
  98. pageSize: 10,
  99. pageSizes: [10],
  100. total: 0,
  101. },
  102. dialogImageUrl: '',
  103. dialogVisible: false,
  104. disabled: false,
  105. form:{},
  106. ImageUrl:'',
  107. radio:2,
  108. file:''
  109. };
  110. },
  111. components: {},
  112. methods: {
  113. handleLicensePreview(file) {
  114. console.log(file)
  115. this.ImageUrl = URL.createObjectURL(file.raw);
  116. this.file = file
  117. },
  118. cancelUpload(){
  119. this.ImageUrl = ''
  120. this.file=''
  121. },
  122. startTranform(){
  123. let fd = new FormData();
  124. fd.append('file', this.file.raw);
  125. console.log(fd.get("file"))
  126. axios({
  127. method:'POST',
  128. url: '/extension/tuomin/upload',
  129. headers: {'Accept': 'image/png'},
  130. responseType: 'blob',
  131. params: { mode: this.radio },
  132. data:fd
  133. }).then(res => {
  134. console.log(res)
  135. }).catch(err => {
  136. console.log(err);
  137. this.$message({
  138. type: 'error',
  139. message: this.$t('submittedFailed')
  140. });
  141. })
  142. },
  143. beforeLicenseUpload(){
  144. console.log("----------")
  145. },
  146. },
  147. mounted() {
  148. },
  149. beforeDestroy() {
  150. },
  151. };
  152. </script>
  153. <style scoped lang="less">
  154. .tuomin-title{
  155. margin-top: 34px;
  156. h2 {
  157. display: flex;
  158. justify-content: center;
  159. }
  160. p{
  161. display: flex;
  162. justify-content: center;
  163. color: rgba(136, 136, 136, 0.87);
  164. }
  165. }
  166. .tuomin-content-image{
  167. border: 1px solid rgba(0, 0, 0, 0.1);
  168. border-radius: 5px;
  169. min-height: 358px;
  170. position: relative;
  171. .tuomin-icon {
  172. display: flex;
  173. align-items: center;
  174. position: absolute;
  175. left: 0;
  176. top: 0;
  177. width: 66px;
  178. height: 22px;
  179. justify-content: center;
  180. color: rgba(136, 136, 136, 0.87);
  181. border-radius: 5px 0px 10px 0px;
  182. border: 1px solid rgba(0, 0, 0, 0.1);
  183. }
  184. .el-upload__text{
  185. height: 100%;
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. }
  190. .preview-image{
  191. height: 100%;
  192. width: 100%;
  193. }
  194. .tuomin-radio-model{
  195. display: flex;
  196. margin: 25px 12px 0 12px;
  197. .radio-label{
  198. font-weight: 600;
  199. margin-right: 4px;
  200. color: rgba(16, 16, 16, 1);
  201. }
  202. }
  203. .tuomin-button-model{
  204. text-align: right;
  205. margin: 22px 12px 0 12px;
  206. }
  207. }
  208. /deep/ .el-upload--picture-card{
  209. width: 100%;
  210. background: #ffff;
  211. border: none;
  212. border-bottom: 1px dashed #888;
  213. border-radius: 0;
  214. min-height: 230px;
  215. }
  216. .title {
  217. margin-top: 15px;
  218. margin-bottom: 15px;
  219. .title-1 {
  220. font-weight: 500;
  221. font-size: 20px;
  222. color: rgba(16, 16, 16, 1);
  223. margin-bottom: 10px;
  224. }
  225. .title-2 {
  226. font-weight: 400;
  227. font-size: 14px;
  228. color: rgba(136, 136, 136, 1);
  229. }
  230. }
  231. .content-1 {
  232. margin-bottom: 32px;
  233. .img-c {
  234. height: 80px;
  235. position: relative;
  236. .img {
  237. width: 100%;
  238. height: 100%;
  239. }
  240. .txt {
  241. position: absolute;
  242. width: 100%;
  243. height: 100%;
  244. left: 0;
  245. top: 0;
  246. line-height: 80px;
  247. padding-left: 25px;
  248. font-weight: 500;
  249. font-size: 24px;
  250. color: rgb(255, 255, 255);
  251. }
  252. }
  253. .descr {
  254. font-weight: 300;
  255. font-size: 16px;
  256. color: rgb(16, 16, 16);
  257. padding: 25px;
  258. border-left: 1px solid rgba(0, 0, 0, 0.1);
  259. border-right: 1px solid rgba(0, 0, 0, 0.1);
  260. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  261. border-radius: 0px 0px 4px 4px;
  262. }
  263. }
  264. .content-2 {
  265. display: flex;
  266. background-color: rgb(228, 242, 255);
  267. border-color: rgb(228, 242, 255);
  268. border-width: 1px;
  269. border-style: solid;
  270. border-radius: 5px;
  271. padding: 25px;
  272. margin-bottom: 32px;
  273. .txt-c {
  274. flex: 1;
  275. font-weight: 300;
  276. font-size: 16px;
  277. color: rgb(16, 16, 16);
  278. span {
  279. line-height: 24px;
  280. }
  281. div {
  282. margin-bottom: 6px;
  283. }
  284. .txt-3 {
  285. margin-bottom: 15px;
  286. }
  287. }
  288. .__copy_link_btn__ {
  289. font-size: 14px;
  290. padding: 11px 15px;
  291. background: rgb(21, 114, 255);
  292. border-radius: 0;
  293. }
  294. .qr-code {
  295. width: 150px;
  296. display: flex;
  297. flex-direction: column;
  298. align-items: end;
  299. }
  300. }
  301. .table-container {
  302. margin-bottom: 16px;
  303. /deep/ .el-table__header {
  304. th {
  305. background: rgb(245, 245, 246);
  306. font-size: 14px;
  307. color: rgb(36, 36, 36);
  308. font-weight: 400;
  309. }
  310. }
  311. /deep/ .el-table__body {
  312. td {
  313. font-size: 14px;
  314. }
  315. }
  316. .op-btn {
  317. cursor: pointer;
  318. font-size: 12px;
  319. color: rgb(25, 103, 252);
  320. margin: 0 5px;
  321. }
  322. }
  323. .center {
  324. display: flex;
  325. justify-content: center;
  326. }
  327. </style>