fix(src/views/user): 修复一些问题

duizhaopin_ui
duan 2 years ago
parent 6ab63e1a29
commit 4d2dcfce2f

@ -91,8 +91,8 @@
>
<template slot-scope="scope">
<el-tag :type="scope.row.is_enabled === 1?'success':'danger'">{{
scope.row.is_enabled === 1 ? '启用' : '未启用'
}}
scope.row.is_enabled === 1 ? '启用' : '未启用'
}}
</el-tag>
</template>
</el-table-column>
@ -251,7 +251,7 @@
>
<div>
<div class="face-content">
<img v-if="play" id="video" width="200px" height="200px" :src="play" alt="">
<img v-if="play" id="video" ref="$img" width="200px" height="200px" :src="play" alt="">
</div>
<div class="name">程小红</div>
<div class="code">工号779</div>
@ -437,31 +437,31 @@ export default {
faceStart().then(res => {
setTimeout(() => {
this.play = process.env.VUE_APP_FACE_API + '/face/play/'
}, 200)
})
this.rflag = true
this.dialogFaceVisible = true
this.web_stream = webStream.get(process.env.VUE_APP_FACE_API + '/face/play/', (data) => {
if (data.length > 41) {
const buffer = Buffer.allocUnsafe(data.byteLength - 41)
data.copy(buffer, 0, 37)
this.img_src = buffer.toString('base64')
const count = Math.floor(Math.random() * 10 + 1)
//
if (count < 3) {
this.img_list.push('data:image/png;base64,' + this.img_src)
}
if (this.img_list.length > 10 && this.rflag) {
const data = {
'images': this.img_list,
'user_id': row.user_id
this.web_stream = webStream.get(process.env.VUE_APP_FACE_API + '/face/play/', (data) => {
if (data.length > 41) {
const buffer = Buffer.allocUnsafe(data.byteLength - 41)
data.copy(buffer, 0, 37)
this.img_src = buffer.toString('base64')
const count = Math.floor(Math.random() * 10 + 1)
//
if (count < 2) {
this.img_list.push('data:image/png;base64,' + this.img_src)
}
if (this.img_list.length > 10 && this.rflag) {
const data = {
'images': this.img_list,
'user_id': row.user_id
}
faceAdd(data).then((res) => {
this.rflag = false
})
this.img_list = []
}
}
faceAdd(data).then((res) => {
this.rflag = false
})
this.img_list = []
}
}
})
this.rflag = true
this.dialogFaceVisible = true
}, 200)
})
},
handleRole(index, row) {

Loading…
Cancel
Save