Commit f50e4225 by 李金轩

ljx

1 parent 29779967
window._serverHost = window.location.hostname === 'localhost' ? 'store.keliuyun.com:9998' : window.location.host
window._baseUrl = `http://${window._serverHost}`
window._CONF_ = {
window._CONF_ = {
reportApiUrl: '',
apiUrl: window._baseUrl,
apiUrl: window.location.hostname === 'localhost' ? 'http://store.keliuyun.com:9998' : '',
apiUrl2: window.location.hostname === 'localhost' ? 'http://36.112.68.214:9999' : '',
webSockUrl: ''
}
......
......@@ -34,8 +34,8 @@ new Vue({
total2: 0,
dataList1: [],
dataList2: [],
zoneList: [],
zoneValue: [],
zone_idList: [],
zone_id: [],
pickerOpts: {
disabledDate(time) {
return Date.parse(time) > Date.parse(new Date())
......@@ -69,12 +69,19 @@ new Vue({
referenceDate: "",
repairDate: "",
accountVal: [],
account_id: [],
plaza_id: [],
mallVal: [],
mallOpts: [],
accountId: [],
accoutOpts: [],
account_id_list: [],
plaza_id_list: [],
gate_idList: [],
deviceVal: "",
gateVal: "",
gateVal2: "",
gate_id: '',
channelVal: "",
showDiv: true,
loading: "",
......@@ -323,15 +330,12 @@ new Vue({
}
else if (this.dateFormat == "snapGatherClass")
{
this.getGate()
// initialize
get(
'http://36.112.68.214:9999' + '/malls',
{
accountIds: 2
}
window._CONF_.apiUrl2 + '/accounts',
).then(
(r) => {
log(r)
this.account_id_list = r
}
)
}
......@@ -340,8 +344,70 @@ new Vue({
// this.getMall();
}
},
onAccount_idChange: function() {
this.getMallList()
this.getZoneList()
this.getGateList()
},
getMallList: function() {
this.plaza_id_list = []
get(
window._CONF_.apiUrl2 + '/malls',
{
accountIds: this.account_id.toString(),
}
).then(
(r) => {
this.plaza_id_list = r
}
)
},
onPlaza_idChange: function() {
this.getZoneList()
this.getGateList()
},
getZoneList: function() {
this.zone_idList = []
get(
window._CONF_.apiUrl2 + '/zones/zoneList',
{
account_id: this.account_id.toString(),
plaza_id: this.plaza_id.toString(),
}
).then(
(r) => {
this.zone_idList = r
}
)
},
onGate_idChange: function() {
this.getGateList()
},
getGateList: function() {
this.gate_idList = []
get(
window._CONF_.apiUrl2 + '/gates/gateByInfo',
{
account_id: this.account_id.toString(),
plaza_id: this.plaza_id.toString(),
zone_id: this.zone_id.toString(),
type: this.type6,
}
).then(
(r) => {
this.gate_idList = r.data
}
)
},
onTypeChange: function() {
this.getGateList()
},
onMenuSelect: function(value) {
this.currentIndex6 = value
// this.pageNum1 = 1
// this.pageNum2 = 1
// this.total1 = 0
// this.total2 = 0
},
formatDirection: function(number) {
switch (number)
......@@ -368,20 +434,21 @@ new Vue({
confirmSearch: function() {
const data = filterEmptyValueInObject(
{
account_id: this.accountVal.toString(),
account_id: this.account_id.toString(),
// account_id: 16,
type: this.type6,
// type: 3,
zone_id: this.mallVal.toString(),
// plaza_id: 40,
plaza_id: this.plaza_id.toString(),
zone_id: this.zone_id.toString(),
// zone_id: 48,
gate_id: this.gateVal,
gate_id: this.gate_id,
// 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,
......@@ -389,7 +456,7 @@ new Vue({
}
)
get(
'http://36.112.68.214:9999' + '/faceRecognitions/faceRecord',
window._CONF_.apiUrl2 + '/faceRecognitions/faceRecord',
data
).then(
(r) => {
......@@ -402,31 +469,31 @@ new Vue({
confirmSearch2: function() {
const data = filterEmptyValueInObject(
{
account_id: this.accountVal.toString(),
account_id: this.account_id.toString(),
// account_id: 16,
type: this.type6,
// type: 3,
zone_id: this.mallVal.toString(),
// plaza_id: 40,
plaza_id: this.plaza_id.toString(),
zone_id: this.zone_id.toString(),
// zone_id: 48,
gate_id: this.gateVal,
gate_id: this.gate_id,
// 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,
minPic: this.minPic,
maxPic: this.maxPic,
}
)
get(
'http://36.112.68.214:9999' + '/faceRecognitions/faceRecordGroup',
window._CONF_.apiUrl2 + '/faceRecognitions/faceRecordGroup',
data
).then(
(r) => {
......@@ -555,7 +622,7 @@ new Vue({
getZone() {
let _this = this
_this.mallOpts = []
get('http://36.112.68.214:9999' + '/zones/zoneList', {
get(window._CONF_.apiUrl2 + '/zones/zoneList', {
account_id: _this.accountVal.join(","),
plaza_id: _this.mallVal.join(",")
// account_id: 16,
......@@ -659,6 +726,17 @@ new Vue({
_this.getChannel()
})
},
getGate2: function() {
var _this = this
get(window._CONF_.apiUrl2 + '/gates/gateByInfo', {
account_id: _this.accountVal.toString(),
plaza_id: _this.mallVal.toString(),
zone_id: _this.zoneValue.toString(),
type: _this.type6,
}).then(function(data) {
log(data)
})
},
getDevice: function() {
var _this = this
get(window._CONF_.apiUrl + API.Devices, {
......@@ -714,6 +792,26 @@ new Vue({
_this.channelOpt.length > 0 ? _this.channelOpt[0].value : ""
})
},
getChannel2() {
var _this = this
get(window._CONF_.apiUrl + API.Channels, {
// accountIds: _this.accountVal.join(","),
// mallIds: _this.mallVal.join(','),
gateId: this.gateVal
}).then(function(data) {
_this.channelOpt = []
for (var i = 0; i < data.length; i++)
{
var temp = {}
temp.name = data[i]
temp.value = data[i]
temp.id = i
_this.channelOpt.push(temp)
}
_this.channelVal =
_this.channelOpt.length > 0 ? _this.channelOpt[0].value : ""
})
},
clearDiv() {
$("#showDiv").empty()
},
......
......@@ -7,12 +7,34 @@ const Axios = axios.create({
}
})
const getUrlQueryByName = function(name) {
name = name.replace(/[\[\]]/g, '\\$&')
let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)')
let results = regex.exec(window.location.href)
if (!results)
{
return null
}
if (!results[2])
{
return ''
}
return decodeURIComponent(results[2].replace(/\+/g, ' '))
}
Axios.interceptors.request.use(
config => {
const atoken = Cookies.get('atoken')
// const atoken = Cookies.get('atoken')
// console.log('atoken', atoken)
// atoken && (config.headers.Authorization = atoken)
config.headers.Authorization = 'a054367f-717d-47fb-b870-7c599e030e16'
if (window.location.hostname === 'localhost')
{
config.headers.Authorization = 'a054367f-717d-47fb-b870-7c599e030e16'
}
else
{
config.headers.Authorization = getUrlQueryByName('authorization')
}
return config
},
error => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!