This commit is contained in:
熊成强 2020-11-19 09:34:10 +08:00
parent 88a6c22910
commit 0ec6168a4a
2 changed files with 15 additions and 4 deletions

View File

@ -110,3 +110,14 @@ export function loadingClose () {
this.$loading.service(opt).close()
}, 100)
}
export function getUrlParams () {
var query = decodeURI(window.location.search.substring(1))
var vars = query.split('&')
const obj = {}
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=')
obj[pair[0]] = pair[1]
}
return obj
}

View File

@ -38,7 +38,7 @@ import report from './report'
import tableItem from '../todo/tableItem'
import { apiGetWaitList } from '@/api/toDo'
import performance from '../../assessment/performance'
import { getUrlParams } from '@/utils/common'
export default {
data () {
return {
@ -62,9 +62,9 @@ export default {
computed: {},
beforeMount () {},
mounted () {
let search = window.location.search
if (search) {
const item = this.list.filter(i => '?' + i.tag === search.split('=')[0])
let obj = getUrlParams()
if (obj.id) {
const item = this.list.filter(i => obj[i.tag])
if (item.length > 0) {
this.$nextTick(() => {
this.$router.replace({