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

duizhaopin_ui
duan 2 years ago
parent 6ab63e1a29
commit 4d2dcfce2f

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

Loading…
Cancel
Save