|
|
@ -64,8 +64,33 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getInitIntoNum() { |
|
|
|
this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1] |
|
|
|
console.log(this.otherDoorOther) |
|
|
|
// this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1] |
|
|
|
const currentURL = window.location.href |
|
|
|
const query = currentURL.split('?')[1] |
|
|
|
console.log(query) |
|
|
|
console.log(query.indexOf('startTime')) |
|
|
|
if (query.indexOf('startTime') !== -1 || query.indexOf('endTime') !== -1) { |
|
|
|
const paramsUrl = query.split('&') |
|
|
|
console.log(paramsUrl) |
|
|
|
let startTimeIndex = -1 |
|
|
|
for (let i = 0; i < paramsUrl.length; i++) { |
|
|
|
const [key] = paramsUrl[i].split('=') |
|
|
|
if (key === 'startTime' || key === 'endTime') { |
|
|
|
startTimeIndex = i |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
// 去除 startTime 参数及其后面的参数 |
|
|
|
const filteredParams = startTimeIndex >= 0 ? paramsUrl.slice(0, startTimeIndex) : params |
|
|
|
const newQueryString = filteredParams.join('&') |
|
|
|
this.otherDoorOther = newQueryString.split('=')[1] |
|
|
|
} else { |
|
|
|
this.otherDoorOther = query.split('=')[1] |
|
|
|
} |
|
|
|
|
|
|
|
const startTime = this.$route.query.startTime |
|
|
|
const endTime = this.$route.query.endTime |
|
|
|
|
|
|
|
if (this.otherDoorOther && this.otherDoorOther !== '' && this.otherDoorOther.indexOf('&')) { |
|
|
|
this.otherDoorOther = this.otherDoorOther.replace(/\&/g, '、') |
|
|
|
} else { |
|
|
@ -74,11 +99,15 @@ export default { |
|
|
|
let params |
|
|
|
if (!this.isSelfService) { |
|
|
|
params = { |
|
|
|
doorCodes: this.otherDoorOther |
|
|
|
doorCodes: this.otherDoorOther, |
|
|
|
startTime: startTime, |
|
|
|
endTime: endTime |
|
|
|
} |
|
|
|
} else { |
|
|
|
params = { |
|
|
|
doorCodes: 'D001' |
|
|
|
doorCodes: 'D001', |
|
|
|
startTime: startTime, |
|
|
|
endTime: endTime |
|
|
|
} |
|
|
|
} |
|
|
|
FetchInitIntoNum(params).then((res) => { |
|
|
|