Commit ff23185a by 李君

优化

1 parent b4bfa343
......@@ -14,7 +14,7 @@ const axiosInstance = axios.create(
// 请求拦截器
axiosInstance.interceptors.request.use(
config => {
// Cookies.set('atoken','57ac28e0-c2d9-4287-8d20-bc0332372dad')
// Cookies.set('atoken','33b0df7a-e5c6-49c3-b549-959179cd5904')
if(!Cookies.get('atoken')){
ElMessage({
message: `登录过期,请重新登录`,
......
......@@ -96,6 +96,16 @@ class FeatureMatchingAccuracy {
}
)
}
addMatchReg(data){
return axiosInstance.request(
{
method: 'POST',
url: `/feature/match/reg`,
data: data
}
)
}
}
const FeatureMatchingAccuracyApi = new FeatureMatchingAccuracy()
......
<template>
<a-modal
title="编辑注册人员"
title="添加注册样本图"
v-model:visible="isVisible"
width="1500px"
:dialog-style="{ top: '20px',height:'90%' }"
class="detail-modal"
@cancel = 'onCancel()'
>
<div style="height: 700px;">
<a-form :model="formObj" layout="inline" :label-col="{ style: { width: '100px' } }">
<a-form-item label="姓名:">
<a-input v-model:value="formObj.name" style="width: 500px">
</a-input>
</a-form-item>
<a-form-item label="描述:">
<a-input v-model:value="formObj.dec" style="width: 500px">
</a-input>
</a-form-item>
<a-form-item label="选择样本图:" class="pictures">
<a-form-item class="pictures">
<a-tabs type="card" v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="本地上传">
<a-upload
......@@ -85,11 +78,12 @@
<el-row v-for="row in getPagedList(person.perrsonList, 8)">
<el-col :span="3" v-for="item in row">
<div style="margin: 0 5px" class="picBox">
<el-checkbox class="checkBox" v-model="item.checked"></el-checkbox>
<!-- <el-checkbox class="checkBox" v-model="item.checked"></el-checkbox> -->
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image" >
</el-image>
<el-button type="primary" :disabled="item.checked?true:false" class="checkBox" @click="onConfirm(item)">选中</el-button>
</div>
</el-col>
</el-row>
......@@ -116,7 +110,7 @@
</div>
<template #footer>
<a-button @click="onCancel">返回</a-button>
<a-button @click="onConfirm" type="primary">确定</a-button>
<!-- <a-button @click="onConfirm" type="primary">确定</a-button> -->
</template>
</a-modal>
</template>
......@@ -184,57 +178,42 @@ export default {
}
)
}
const disabledPicList = ref([])
const initDialog = function(parmas) {
accountId.value = parmas.accountId;
mallId.value = parmas.mallId;
formObj.name = parmas.name;
formObj.dec = parmas.description;
formObj.id = parmas.id;
// checkGateList.value = parmas.faceIds
getGateList()
disabledPicList.value = parmas.faceIds || []
isVisible.value = true;
};
const onCancel = () => {
if(isAdd.value){
refreshParentTable()
}
isVisible.value = false;
};
const refreshParentTable = function(){
context.emit('refreshParentTable')
}
const onConfirm = function(){
let faceIds = []
dataList.value.forEach((itemPerson)=>{
itemPerson.perrsonList.forEach((item)=>{
if (item.checked) {
faceIds.push(item.id)
}
})
})
if(faceIds.length<1 && checkGateList.length<1){
ElMessage({
message: `请选择图片`,
type: 'warning'
})
return false;
}
const isAdd = ref(false)
const onConfirm = function(resData){
const data = filterEmptyValueInObject(
{
// accountId: accountId.value,
// mallId: mallId.value,
name: formObj.name,
description: formObj.dec,
faceIds:faceIds.length<1?checkGateList.value:faceIds,
faceIds:[resData.id],
id:formObj.id
}
)
FeatureMatchingAccuracyApi.editMatch(data).then(
FeatureMatchingAccuracyApi.addMatchReg(data).then(
(r) => {
if(r.msg_code==200){
ElMessage({
message: r.msg_info,
type: 'success'
})
refreshParentTable()
isVisible.value = false
isAdd.value = true;
disabledPicList.value.push(resData.id)
clickSearch()
}else{
ElMessage({
message: r.msg_info,
......@@ -300,7 +279,7 @@ export default {
r.data.persons.forEach((itemPerson)=>{
itemPerson.expand = false
itemPerson.perrsonList.forEach((item)=>{
if(checkGateList.value.includes(item.id)){
if(disabledPicList.value.includes(item.id)){
item.checked = true;
}else{
item.checked = false;
......@@ -362,7 +341,8 @@ export default {
expandChange,
clickCheck,
refreshParentTable,
picSearch
picSearch,
disabledPicList
};
},
};
......@@ -419,9 +399,18 @@ export default {
.picBox{
position: relative;
}
.picBox:hover .checkBox{
display: block;
}
.checkBox{
display: none;
width: 80px;
height: 30px;
position: absolute;
left: 5px;
left: 0px;
top: 0;
right: 0;
bottom: 0;
margin: auto;
}
</style>
......@@ -142,7 +142,7 @@
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':(item.person_type==0?'顾客':'未知') }}</div>
<div>性别:{{ formatGender(item.gender) }}</div>
<div>性别:{{ formatGender(item.gender) }}({{item.age}})</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
......
......@@ -118,7 +118,7 @@
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':(item.person_type==0?'顾客':'未知')}}</div>
<div>性别:{{ formatGender(item.gender) }}</div>
<div>性别:{{ formatGender(item.gender) }}({{item.age}})</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!