Commit 29779967 by 李金轩

初始版本

1 parent 6620a84a
...@@ -19,10 +19,23 @@ new Vue({ ...@@ -19,10 +19,23 @@ new Vue({
data: function() { data: function() {
return { return {
currentIndex6: '1', currentIndex6: '1',
type6: '', type6: 1,
direction6: '', direction6: 1,
picType6: '', picType6: 1,
personType6: '', personType6: 1,
time6: [new Date(), new Date()],
minPic: 0,
maxPic: 10,
pageNum1: 1,
pageSize1: 24,
total1: 0,
pageNum2: 1,
pageSize2: 24,
total2: 0,
dataList1: [],
dataList2: [],
zoneList: [],
zoneValue: [],
pickerOpts: { pickerOpts: {
disabledDate(time) { disabledDate(time) {
return Date.parse(time) > Date.parse(new Date()) return Date.parse(time) > Date.parse(new Date())
...@@ -204,6 +217,12 @@ new Vue({ ...@@ -204,6 +217,12 @@ new Vue({
} }
}, },
computed: { computed: {
pagedTableDataList1: function() {
return getPagedList(this.dataList1, 8)
},
pagedTableDataList2: function() {
return getPagedList(this.dataList2, 8)
},
isResultsShow() { isResultsShow() {
return this.dateFormat === 'revisitFeature' || return this.dateFormat === 'revisitFeature' ||
this.dateFormat === 'rebuildFeatureLib' || this.dateFormat === 'rebuildFeatureLib' ||
...@@ -283,6 +302,20 @@ new Vue({ ...@@ -283,6 +302,20 @@ new Vue({
}, },
methods: { methods: {
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
getPagedList: function(list, columnNum) {
const baseArray = list
const len = baseArray.length
const lineNum = len % columnNum === 0 ? len / columnNum : Math.floor((len / columnNum) + 1)
let result = []
for (let i = 0; i < lineNum; i++)
{
// slice() 方法返回一个从开始到结束(不包括结束)选择的数组的一部分浅拷贝到一个新数组对象。且原始数组不会被修改。
const temp = baseArray.slice(i * columnNum, i * columnNum + columnNum)
result.push(temp)
}
return result
},
dateLevel: function() { dateLevel: function() {
if (this.dateFormat == "repair") if (this.dateFormat == "repair")
{ {
...@@ -291,8 +324,13 @@ new Vue({ ...@@ -291,8 +324,13 @@ new Vue({
else if (this.dateFormat == "snapGatherClass") else if (this.dateFormat == "snapGatherClass")
{ {
this.getGate() this.getGate()
get('http://36.112.68.214:9999' + '/faceRecognitions/faceRecord', {}).then( get(
function(r) { 'http://36.112.68.214:9999' + '/malls',
{
accountIds: 2
}
).then(
(r) => {
log(r) log(r)
} }
) )
...@@ -305,18 +343,117 @@ new Vue({ ...@@ -305,18 +343,117 @@ new Vue({
onMenuSelect: function(value) { onMenuSelect: function(value) {
this.currentIndex6 = value this.currentIndex6 = value
}, },
formatDirection: function(number) {
switch (number)
{
case 1:
{
return '进'
}
case 0:
{
return '出'
}
case 2:
{
return '横穿'
}
default:
{
break
}
}
},
confirmSearch: function() { confirmSearch: function() {
log( const data = filterEmptyValueInObject(
// this.accountVal, {
this.type6, account_id: this.accountVal.toString(),
// this.mallVal, // account_id: 16,
// this.gateVal, type: this.type6,
this.direction6, // type: 3,
this.picType6, zone_id: this.mallVal.toString(),
this.personType6, // zone_id: 48,
gate_id: this.gateVal,
// gate_id: 268,
direction: this.direction6,
picType: this.picType6,
personType: this.personType6,
// personType: 0,
// plaza_id: 40,
plaza_id: this.zoneValue.toString(),
startTime: formatDate(this.time6[0]),
endTime: formatDate(this.time6[1]),
page: this.pageNum1 - 1,
pageSize: this.pageSize1,
}
)
get(
'http://36.112.68.214:9999' + '/faceRecognitions/faceRecord',
data
).then(
(r) => {
this.dataList1 = r.data.persons
this.total1 = r.data.pageNum
}
)
},
confirmSearch2: function() {
const data = filterEmptyValueInObject(
{
account_id: this.accountVal.toString(),
// account_id: 16,
type: this.type6,
// type: 3,
zone_id: this.mallVal.toString(),
// zone_id: 48,
gate_id: this.gateVal,
// gate_id: 268,
direction: this.direction6,
picType: this.picType6,
personType: this.personType6,
// personType: 0,
// plaza_id: 40,
plaza_id: this.zoneValue.toString(),
startTime: formatDate(this.time6[0]),
endTime: formatDate(this.time6[1]),
minPic: this.minPic,
maxPic: this.maxPic,
page: this.pageNum2 - 1,
pageSize: this.pageSize2,
}
)
get(
'http://36.112.68.214:9999' + '/faceRecognitions/faceRecordGroup',
data
).then(
(r) => {
this.dataList2 = r.data.persons
this.total2 = r.data.pageNum
}
) )
}, },
onPageNumChange1(num) {
this.pageNum1 = num
this.confirmSearch()
},
onPageSizeChange1(size) {
this.pageNum1 = 1
this.pageSize1 = size
this.confirmSearch()
},
onPageNumChange2(num) {
this.pageNum2 = num
this.confirmSearch2()
},
onPageSizeChange2(size) {
this.pageNum2 = 1
this.pageSize2 = size
this.confirmSearch2()
},
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
createDate() { createDate() {
var nowDate = new Date() var nowDate = new Date()
...@@ -412,8 +549,23 @@ new Vue({ ...@@ -412,8 +549,23 @@ new Vue({
if (this.accountVal.length > 0) if (this.accountVal.length > 0)
{ {
this.getMall(linkGate) this.getMall(linkGate)
this.getZone()
} }
}, },
getZone() {
let _this = this
_this.mallOpts = []
get('http://36.112.68.214:9999' + '/zones/zoneList', {
account_id: _this.accountVal.join(","),
plaza_id: _this.mallVal.join(",")
// account_id: 16,
// plaza_id: 40,
}).then(
(data) => {
_this.zoneList = data
}
)
},
mallchange(linkGate) { mallchange(linkGate) {
this.isMallSelAll = this.isMallSelAll this.isMallSelAll = this.isMallSelAll
? this.mallVal.length < this.mallOpts.length ? this.mallVal.length < this.mallOpts.length
...@@ -425,6 +577,7 @@ new Vue({ ...@@ -425,6 +577,7 @@ new Vue({
if (linkGate) if (linkGate)
{ {
this.getGate() this.getGate()
this.getZone()
} }
}, },
selAllHandle(level) { selAllHandle(level) {
...@@ -435,6 +588,7 @@ new Vue({ ...@@ -435,6 +588,7 @@ new Vue({
this.accountVal = [] this.accountVal = []
this.isAccoutSelAll = false this.isAccoutSelAll = false
this.getMall() this.getMall()
this.getZone()
} }
else else
{ {
...@@ -444,6 +598,7 @@ new Vue({ ...@@ -444,6 +598,7 @@ new Vue({
}) })
this.isAccoutSelAll = true this.isAccoutSelAll = true
this.getMall() this.getMall()
this.getZone()
} }
} }
else else
...@@ -466,7 +621,6 @@ new Vue({ ...@@ -466,7 +621,6 @@ new Vue({
getAccount: function() { getAccount: function() {
var _this = this var _this = this
_this.accoutOpts = [] _this.accoutOpts = []
log(454, window._CONF_.apiUrl + API.Accounts)
get(window._CONF_.apiUrl + API.Accounts).then(function(data) { get(window._CONF_.apiUrl + API.Accounts).then(function(data) {
_this.accoutOpts = data _this.accoutOpts = data
if (_this.accoutOpts.length > 0) if (_this.accoutOpts.length > 0)
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -12,7 +12,7 @@ Axios.interceptors.request.use( ...@@ -12,7 +12,7 @@ Axios.interceptors.request.use(
const atoken = Cookies.get('atoken') const atoken = Cookies.get('atoken')
// console.log('atoken', atoken) // console.log('atoken', atoken)
// atoken && (config.headers.Authorization = atoken) // atoken && (config.headers.Authorization = atoken)
config.headers.Authorization = '3a9b4412-12c8-473c-8216-8c9b6db00ea3' config.headers.Authorization = 'a054367f-717d-47fb-b870-7c599e030e16'
return config return config
}, },
error => { error => {
......
const formatDate = function(date) {
return moment(date).format("YYYY-MM-DD HH:mm:ss")
}
const getPagedList = function(list, columnNum) {
const baseArray = list
const len = baseArray.length
const lineNum = len % columnNum === 0 ? len / columnNum : Math.floor((len / columnNum) + 1)
let result = []
for (let i = 0; i < lineNum; i++)
{
// slice() 方法返回一个从开始到结束(不包括结束)选择的数组的一部分浅拷贝到一个新数组对象。且原始数组不会被修改。
const temp = baseArray.slice(i * columnNum, i * columnNum + columnNum)
result.push(temp)
}
return result
}
const isEqual = (value, other) => {
return _.isEqual(value, other)
}
const isOneOfTheseValue = function(value, expectedValueList) {
for (let expectedValue of expectedValueList)
{
if (isEqual(value, expectedValue))
{
return true
}
}
return false
}
const filterEmptyValueInObject = function(object) {
for (let key in object)
{
let value = object[key]
if (isOneOfTheseValue(value, ['', NaN, undefined, null]))
{
delete object[key]
}
}
return object
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!