Commit 91677ce7 by liyuhang19990520

工具类函数以及比中和认定逻辑修改样式修改

parent 35eee2ff
......@@ -65,7 +65,7 @@ _axios.interceptors.response.use(
function (response) {
NProgress.done();
loadingIndex--;
console.log('请求后' + loadingIndex)
// console.log('请求后' + loadingIndex)
if (loadingIndex <= 0) {
clearTimeout(timer)
timer = setTimeout(() => {
......
......@@ -57,19 +57,19 @@ export default {
* @param {Object} arr
* @param {Object} i
*/
inArray: function(elem, arr) {
inArray: function (elem, arr) {
return arr == null ? -1 : arr.indexOf(elem);
},
/**
* 获取某天日期
* @param {Object} day
*/
getDay: function(day) {
getDay: function (day) {
var today = new Date();
var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
today.setTime(targetday_milliseconds);
const doHandleMonth = function(month) {
const doHandleMonth = function (month) {
var m = month;
if (month.toString().length == 1) {
m = "0" + month;
......@@ -99,7 +99,7 @@ export default {
* @param {Object} obj
*/
deepClone(obj) {
const isObject = function(obj) {
const isObject = function (obj) {
return typeof obj == "object";
};
......@@ -114,5 +114,66 @@ export default {
cloneObj[key] = isObject(obj[key]) ? this.deepClone(obj[key]) : obj[key];
}
return cloneObj;
},
//一个数组减去另一个数组中的值
arrToValue(souceArr, targetArr, key) {
if (!key) {
return souceArr.filter((x) => targetArr.indexOf(x) < 0);
} else {
souceArr.filter((x) => {
return targetArr.findIndex(y => y[key] == x[key]) < 0
});
}
},
// 转换字符串,undefined,null等转化为""
praseStrEmpty(str) {
return !str || str === 'undefined' || str === 'null' ? '' : str
},
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
* @param {*} rootId 根Id 默认 0
*/
handleTree(data = [], id = 'id', parentId = 'parentId', children = 'children', rootId) {
rootId =
rootId ||
Math.min.apply(
Math,
data.map(item => {
return item[parentId]
})
) ||
0
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
//循环所有项
const treeData = cloneData.filter(father => {
let branchArr = cloneData.filter(child => {
//返回每一项的子级数组
return father[id] === child[parentId]
})
branchArr.length > 0 && (father.children = branchArr)
//返回第一层
return father[parentId] === rootId
})
// 排序
treeData
.sort((a, b) => {
return Number(a.code) - Number(b.code)
})
.forEach(m => {
if (m.children && m.children.length) {
m.children.sort((c, d) => {
return Number(c.code) - Number(d.code)
})
}
})
return treeData !== '' ? treeData : data
}
};
......@@ -21,8 +21,9 @@ $phone: var(--phone, #606266); //#ff4242;
padding: 20px;
box-sizing: border-box;
position: absolute;
top: calc(50% - 300px);
left: calc(50% - 300px);
top: 30%;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
width: 600px;
height: 152px;
......
......@@ -60,16 +60,16 @@
<div class="btns">
<div
class="btn"
:class="{ active: isFinger === true }"
:class="{ active: isFinger == true }"
@click="finger"
>
指纹
</div>
<div class="btn" :class="{ active: isPlam === true, hui: true }">
<div class="btn" :class="{ active: isPlam == true, hui: true }">
<!-- @click="plam" -->
掌纹
</div>
<div class="btn" :class="{ active: isFace === true, hui: true }">
<div class="btn" :class="{ active: isFace == true, hui: true }">
<!-- @click="face" -->
人像
</div>
......@@ -78,14 +78,14 @@
<div v-show="isFinger" class="menu middle">
<div
class="menu-item"
:class="{ active: activeIndex === 1 }"
:class="{ active: activeIndex == 1 }"
@click="handleSelect(1)"
>
滚动
</div>
<div
class="menu-item"
:class="{ active: activeIndex === 2 }"
:class="{ active: activeIndex == 2 }"
@click="handleSelect(2)"
>
平面
......@@ -155,7 +155,7 @@
</div>
<div class="imgs middle">
<div v-show="isFinger === true" class="fingers">
<div v-show="isFinger == true" class="fingers">
<div class="data-label">
<div class="source-label"><br /><br /></div>
<div class="dest-label"><br /><br /><br /></div>
......@@ -163,7 +163,7 @@
<!-- 指纹图部分-->
<div class="finger-data">
<!-- 滚动 1-10 右拇始 -->
<div v-if="activeIndex === 1">
<div v-if="activeIndex == 1">
<!-- Swiper -->
<div class="swiper-main">
<swiper :options="swiperOption" ref="swiper1">
......@@ -387,7 +387,7 @@
</div>
</div>
<!-- 平面 11-20 右拇始 -->
<div v-if="activeIndex === 2">
<div v-if="activeIndex == 2">
<!-- Swiper -->
<div class="swiper-main">
<swiper :options="swiperOption1" ref="swiper1">
......@@ -614,26 +614,20 @@
</div>
<!-- <t-t-finger-print-->
<!-- style="margin-top: -40px"-->
<!-- v-show="isFinger === true"-->
<!-- v-show="isFinger == true"-->
<!-- ></t-t-finger-print>-->
<t-t-plam v-show="isPlam === true"></t-t-plam>
<t-t-face v-show="isFace === true"></t-t-face>
<t-t-plam v-show="isPlam == true"></t-t-plam>
<t-t-face v-show="isFace == true"></t-t-face>
</div>
</div>
<!-- 认定完成确认框 -->
<div
<!-- <div
class="rdwcDialog"
v-show="isShowrdwcDialogBg"
@click="cancelrdwc"
></div>
<div class="rdwccontent" v-show="isShowrdwcDialog">
<div class="title">当前候选未全部查看,是否确认认定完成?</div>
<div class="rdwcbtns">
<button class="rdwcconfirm" @click="confirmrdwc">确认</button>
<button class="rdwccancel" @click="cancelrdwc">取消</button>
</div>
</div>
></div> -->
<div
class="jiantou"
ref="jiantou"
......@@ -648,7 +642,14 @@
/>
</div>
</div>
<!-- 认定判断弹框 -->
<div class="rdwccontent" v-show="isShowrdwcDialog">
<div class="title">当前候选未全部查看,是否确认认定完成?</div>
<div class="rdwcbtns">
<button class="rdwcconfirm" @click="confirmrdwc">确认</button>
<button class="rdwccancel" @click="cancelrdwc">取消</button>
</div>
</div>
<!-- 指纹详情 -->
<div class="detail" v-show="isShowDetail">
<div class="head-title">{{ zwName }}</div>
......@@ -817,6 +818,7 @@ export default {
targetDelText: "",
swiperOption: {
//swiper3
observer: true,
direction: "vertical",
mousewheel: true,
// loop: true,
......@@ -831,6 +833,7 @@ export default {
},
swiperOption1: {
//swiper3
observer: true,
direction: "vertical",
mousewheel: true,
// loop: true,
......@@ -964,8 +967,8 @@ export default {
this.currentQqid = this.$route.query.qqid;
this.getSourceList();
this.activeIndex = 1;
//console.log("源qid====>", this.qid);
//console.log("源qqid====>", this.currentQqid);
//console.log("源qid===>", this.qid);
//console.log("源qqid===>", this.currentQqid);
},
watch: {
phone(newValue, oldValue) {
......@@ -999,10 +1002,10 @@ export default {
handleSelect(index) {
this.activeIndex = index;
//console.info(this.activeIndex);
if (index === 1) {
if (index == 1) {
//console.info("滚动指纹");
}
if (index === 2) {
if (index == 2) {
//console.info("平面指纹");
}
},
......@@ -1022,10 +1025,10 @@ export default {
last(index) {
let i = index;
if (index > 0) {
debugger;
this.currentQqid = this.sourcedatas[i - 1].qqid;
this.sourcebarcode = this.sourcedatas[i - 1].barcode;
this.fingerLoading = true;
this.$set(this.sourcedatas[i - 1], "clickLog", "1");
if (this.sourcedatas[i - 1].removeFlag == "1") {
this.souceDel = true;
this.souceDelText = this.$moment(
......@@ -1054,6 +1057,7 @@ export default {
if (this.sourcedatas.length - 1 > index) {
this.currentQqid = this.sourcedatas[i + 1].qqid;
this.sourcebarcode = this.sourcedatas[i + 1].barcode;
this.$set(this.sourcedatas[i + 1], "clickLog", "1");
if (this.sourcedatas[i + 1].removeFlag == "1") {
this.souceDel = true;
this.souceDelText = this.$moment(
......@@ -1082,7 +1086,7 @@ export default {
let me = this;
this.screenLoading = true;
this.loadingIndex++;
if (me.dataType === "father") {
if (me.dataType == "father") {
me.$axios
.post(
"/api/queryque/standardAll",
......@@ -1093,11 +1097,13 @@ export default {
)
.then((res) => {
me.loadingIndex--;
if (res.data.code === 0) {
if (res.data.code == 0) {
me.sourcedatas = res.data.ret;
me.sourcedatasLength = res.data.ret.length;
me.sourcebarcode = res.data.ret[0].barcode;
me.currentQqid = res.data.ret[0].qqid;
me.$set(me.sourcedatas[0], "clickLog", 1);
if (res.data.ret[0].removeFlag == "1") {
this.souceDel = true;
this.souceDelText = this.$moment(
......@@ -1137,7 +1143,7 @@ export default {
)
.then((res) => {
me.loadingIndex--;
if (res.data.code === 0) {
if (res.data.code == 0) {
me.sourcedatas = res.data.ret;
me.sourcedatasLength = res.data.ret.length;
me.sourcebarcode = res.data.ret[0].barcode;
......@@ -1150,6 +1156,9 @@ export default {
} else {
this.souceDel = false;
}
me.$set(me.sourcedatas[0], "clickLog", 1);
this.getSourceRollFingerPrintDetail(
res.data.ret[0].barcode,
"yes"
......@@ -1160,8 +1169,8 @@ export default {
);
me.getMatchcandList(me.currentQqid);
if (
me.sourcedatas[0].affirmStatus === "1" ||
me.sourcedatas[0].affirmStatus === "3"
me.sourcedatas[0].affirmStatus == "1" ||
me.sourcedatas[0].affirmStatus == "3"
) {
this.rdcount = 1;
} else {
......@@ -1171,7 +1180,7 @@ export default {
//console.info("源数据", me.sourcedatas);
});
}
//console.log("源barcode====>", this.sourcebarcode);
//console.log("源barcode===>", this.sourcebarcode);
},
// 获取候选列表
getMatchcandList() {
......@@ -1185,7 +1194,7 @@ export default {
)
.then((res) => {
me.loadingIndex--;
if (res.data.code === 0) {
if (res.data.code == 0) {
me.tableData = res.data.ret;
me.$nextTick(() => {
me.$refs.singleTable.setCurrentRow(me.tableData[0]);
......@@ -1210,25 +1219,25 @@ export default {
)
.then(function (response) {
self.loadingIndex--;
if (response.data.code === 0) {
if (response.data.code == 0) {
//console.info("源plan", response.data.ret);
response.data.ret.forEach((element, index) => {
// 源 左手 平面
self.sourceFingersLeftL.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
// 源 右手 平面
self.sourceFingersRightL.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
});
// 去掉加载状态
self.fingerLoading = false;
} else if (response.data.code === 4) {
} else if (response.data.code == 4) {
// 去掉加载状态
self.fingerLoading = false;
}
......@@ -1250,24 +1259,24 @@ export default {
)
.then(function (response) {
self.loadingIndex--;
if (response.data.code === 0) {
if (response.data.code == 0) {
response.data.ret.forEach((element, index) => {
// 源 左手 滚动
self.sourceFingersLeftR.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
// 源 右手 滚动
self.sourceFingersRightR.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
});
// 去掉加载状态
self.fingerLoading = false;
} else if (response.data.code === 4) {
} else if (response.data.code == 4) {
// 去掉加载状态
self.fingerLoading = false;
}
......@@ -1291,25 +1300,25 @@ export default {
)
.then(function (response) {
self.loadingIndex--;
if (response.data.code === 0) {
if (response.data.code == 0) {
//console.info("目标plan", response.data.ret);
response.data.ret.forEach((element, index) => {
// 目标 左手 平面
self.destFingersLeftL.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
// 目标 右手 平面
self.destFingersRightL.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
});
// 去掉加载状态
self.fingerLoading = false;
} else if (response.data.code === 4) {
} else if (response.data.code == 4) {
// 去掉加载状态
self.fingerLoading = false;
}
......@@ -1331,23 +1340,23 @@ export default {
)
.then(function (response) {
self.loadingIndex--;
if (response.data.code === 0) {
if (response.data.code == 0) {
//console.info("目标roll", response.data.ret);
response.data.ret.forEach((element, index) => {
// 目标 左手 滚动
self.destFingersLeftR.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
// 目标 右手 滚动
self.destFingersRightR.forEach((item) => {
if (item.code === element.seq) {
if (item.code == element.seq) {
item.img = element.image;
}
});
}); // 去掉加载状态
} else if (response.data.code === 4) {
} else if (response.data.code == 4) {
}
//console.log(response);
})
......@@ -1374,14 +1383,14 @@ export default {
tableRowClassName({ row, column, rowIndex, columnIndex }) {
//console.log("row", row.clickLog);
// 比中的行
if (row.affirmStatus === "2" || row.affirmStatus === "3") {
if (row.affirmstatus == "2" || row.affirmstatus == "3") {
return "Bizhong";
} else if (row.affirmStatus === "1") {
} else if (row.affirmstatus == "1") {
// 认定完成的行
return "Identification";
}
// 浏览过的
if (row.clickLog === "1") {
if (row.clickLog == "1") {
return "looked";
}
},
......@@ -1425,7 +1434,7 @@ export default {
// self.loadingIndex--;
// if (res.data.code == 0) {
// let data = res.data.ret[0];
// //console.log("userInfo===>", data);
// //console.log("userInfo==>", data);
// let dw = await self.$axios({
// method: "get",
// url: "/api/code/unit/one/" + data.userunit,
......@@ -1447,6 +1456,7 @@ export default {
* @return {*}
*/
cancelrdwc() {
this.isShowbzDialogBg = false;
this.isShowrdwcDialogBg = false;
this.isShowrdwcDialog = false;
},
......@@ -1465,6 +1475,7 @@ export default {
this.loadingIndex--;
//console.log(res);
if (!res.data.ret) {
this.isShowbzDialogBg = true;
this.isShowrdwcDialogBg = true;
this.isShowrdwcDialog = true;
} else {
......@@ -1477,6 +1488,7 @@ export default {
confirmrdwc() {
let self = this;
this.isShowrdwcDialogBg = false;
this.isShowbzDialogBg = false;
this.isShowrdwcDialog = false;
this.loadingIndex++;
// 1:倒查
......@@ -1497,6 +1509,32 @@ export default {
this.loadingIndex--;
// 跟新列表数据
self.$bus.emit("updateTTSourceData");
// this.getMatchcandList();
let index = this.sourcedatas.findIndex(
(i) => i.barcode == this.sourcebarcode
);
if (index >= 0) {
let obj = this.sourcedatas[index];
if (obj.affirmStatus != "1" && obj.affirmStatus != "3") {
this.rdcount += 1;
}
if (obj.affirmStatus == "2" || obj.affirmStatus == "3") {
obj.affirmStatus = "3";
} else {
obj.affirmStatus = "1";
}
this.$set(this.sourcedatas, index, obj);
}
this.tableData = this.tableData.map((i) => {
if (i.affirmstatus == "2" || i.affirmstatus == "3") {
i.affirmstatus = "3";
} else {
i.affirmstatus = "1";
}
return i;
});
//console.log(response);
this.$message.success("认定完成!");
if (self.datatype == "son") {
......@@ -1527,6 +1565,7 @@ export default {
this.isShowbzDialogBg = false;
this.isShowbzDialog = false;
this.cancelDetail();
this.cancelrdwc();
},
// 确认比中
confirmbz() {
......@@ -1547,16 +1586,42 @@ export default {
{ loading: false }
)
.then((response) => {
debugger;
this.loadingIndex--;
// 跟新列表数据
self.$bus.emit("updateTTSourceData");
//源数据手动修改状态
let index = this.sourcedatas.findIndex(
(i) => i.barcode == this.sourcebarcode
);
if (index >= 0) {
let obj = this.sourcedatas[index];
if (obj.affirmStatus == "1" || obj.affirmStatus == "3") {
obj.affirmStatus = "3";
} else {
obj.affirmStatus = "2";
}
this.$set(this.sourcedatas, index, obj);
}
//目标数据手动修改状态
let tableDataIndex = this.tableData.findIndex((i)=>i.destbarcode == this.destbarcode);
let newObj = this.tableData[tableDataIndex];
if(newObj.affirmstatus == '1' || newObj.affirmstatus == '3'){
newObj.affirmstatus = '3'
}else{
newObj.affirmstatus = '2'
}
this.$set(this.tableData,tableDataIndex,newObj)
self.isShowbzDialogBg = false;
self.isShowbzDialog = false;
this.$message.success("比中成功!");
//console.log(response);
})
.catch((err) => {
this.$message.error("比中失败!");
});
self.isShowbzDialogBg = false;
self.isShowbzDialog = false;
},
// 展示详情
showDetail(fingerData, index, name) {
......@@ -1569,28 +1634,28 @@ export default {
let sourceimg = "";
let destimg = "";
// 源 左手的滚动
if (name === "sourceFingersLeftR") {
if (name == "sourceFingersLeftR") {
sourceimg = fingerData.img;
destimg = this.destFingersLeftR[index].img;
} else if (name === "sourceFingersRightR") {
} else if (name == "sourceFingersRightR") {
sourceimg = fingerData.img;
destimg = this.destFingersRightR[index].img;
} else if (name === "sourceFingersLeftL") {
} else if (name == "sourceFingersLeftL") {
sourceimg = fingerData.img;
destimg = this.destFingersLeftL[index].img;
} else if (name === "sourceFingersRightL") {
} else if (name == "sourceFingersRightL") {
sourceimg = fingerData.img;
destimg = this.destFingersRightL[index].img;
} else if (name === "destFingersLeftR") {
} else if (name == "destFingersLeftR") {
destimg = fingerData.img;
sourceimg = this.sourceFingersLeftR[index].img;
} else if (name === "destFingersRightR") {
} else if (name == "destFingersRightR") {
destimg = fingerData.img;
sourceimg = this.sourceFingersRightR[index].img;
} else if (name === "destFingersLeftL") {
} else if (name == "destFingersLeftL") {
destimg = fingerData.img;
sourceimg = this.sourceFingersLeftL[index].img;
} else if (name === "destFingersRightL") {
} else if (name == "destFingersRightL") {
destimg = fingerData.img;
sourceimg = this.sourceFingersRightL[index].img;
} else {
......@@ -1698,9 +1763,6 @@ export default {
},
},
mounted() {
setTimeout(() => {
//console.log(this.sourcedatas);
}, 2000);
this.finger();
this.$bus.on("ccbarcode", (code) => {
this.cleardest();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment