This commit is contained in:
zhutianqi
2022-01-26 17:20:02 +08:00
parent 7f66222a6c
commit bebc201341
2 changed files with 9 additions and 11 deletions
@@ -80,8 +80,6 @@
}, },
methods: { methods: {
saveUserInfo () { saveUserInfo () {
this.$store.commit('SET_REFRESH_FLAG', true)
return false
this.$refs['formAdd'].validate((valid) => { this.$refs['formAdd'].validate((valid) => {
if (valid) { if (valid) {
this.isSubmit = true this.isSubmit = true
@@ -104,6 +102,7 @@
}, res => { }, res => {
if (res.respCode === '200') { if (res.respCode === '200') {
// 储存变量监听刷新页面 // 储存变量监听刷新页面
this.$store.commit('SET_REFRESH_FLAG', true)
localStorage.setItem('freshClueNum', new Date().getTime()) localStorage.setItem('freshClueNum', new Date().getTime())
this.isSubmit = false this.isSubmit = false
this.opinionContent.partCode = '' this.opinionContent.partCode = ''
@@ -401,13 +401,11 @@
} else { } else {
localStorage.setItem('freshClueNum', new Date().getTime()) localStorage.setItem('freshClueNum', new Date().getTime())
this.freshClueNum = localStorage.getItem('freshClueNum') || ''; this.freshClueNum = localStorage.getItem('freshClueNum') || '';
const that = this const that = this
const watcherRefreshData = function(ev) { const watcherRefreshData = function(ev) {
const { key: eventType, newValue } = ev const { key: eventType, newValue } = ev
if (eventType === 'refreshFlag' && eval(newValue) === true) { if (eventType === 'refreshFlag' && eval(newValue) === true) {
// 更新数据... // 更新数据...
console.log('更新数据')
that.$store.commit('SET_REFRESH_FLAG', false) that.$store.commit('SET_REFRESH_FLAG', false)
} }
} }
@@ -540,7 +538,8 @@
}, },
watch: { watch: {
refreshFlag(val) { refreshFlag(val) {
console.log('refresh刷新了') this.form.page = 1
this.getList()
} }
}, },
computed: { computed: {
@@ -561,12 +560,12 @@
} }
} }
// 详情数据 // 详情数据
window.addEventListener("storage", ev => { // window.addEventListener("storage", ev => {
if(ev.key === 'freshClueNum'){ // if(ev.key === 'freshClueNum'){
this.form.page = 1 // this.form.page = 1
this.getList() // this.getList()
} // }
}) // })
if (JSON.parse(this.lawsStand.wkfiles).length) { if (JSON.parse(this.lawsStand.wkfiles).length) {
this.fileInfoLists = JSON.parse(this.lawsStand.wkfiles) this.fileInfoLists = JSON.parse(this.lawsStand.wkfiles)
} else { } else {