mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 项目、消息对话置顶后要滚动到可以看到它的位置
This commit is contained in:
parent
b0b7c63561
commit
41ceb9bd82
@ -889,9 +889,17 @@ export default {
|
|||||||
project_id: this.topOperateItem.id,
|
project_id: this.topOperateItem.id,
|
||||||
},
|
},
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch("getProjects").catch(() => {});
|
this.$store.dispatch("getProjects").then(() => {
|
||||||
|
let active = this.$refs.projectWrapper.querySelector(".active")
|
||||||
|
if (active) {
|
||||||
|
$A.scrollToView(active, {
|
||||||
|
behavior: 'smooth',
|
||||||
|
scrollMode: 'if-needed',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(() => {});
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalError(msg, 301);
|
$A.modalError(msg);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -470,11 +470,11 @@ export default {
|
|||||||
dialog_id: this.topOperateItem.id,
|
dialog_id: this.topOperateItem.id,
|
||||||
},
|
},
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch("getDialogs");
|
this.$store.dispatch("getDialogs").then(() => {
|
||||||
this.$Modal.remove();
|
this.scrollIntoActive(true)
|
||||||
|
});
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalError(msg, 301);
|
$A.modalError(msg);
|
||||||
this.$Modal.remove();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
resources/assets/js/store/actions.js
vendored
28
resources/assets/js/store/actions.js
vendored
@ -205,7 +205,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
getBasicData({dispatch}) {
|
getBasicData({dispatch}) {
|
||||||
dispatch("getProjects").catch(() => {});
|
dispatch("getProjects").catch(() => {});
|
||||||
dispatch("getDialogs");
|
dispatch("getDialogs").catch(() => {});
|
||||||
dispatch("getTaskForDashboard");
|
dispatch("getTaskForDashboard");
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1813,18 +1813,24 @@ export default {
|
|||||||
* 获取会话列表
|
* 获取会话列表
|
||||||
* @param state
|
* @param state
|
||||||
* @param dispatch
|
* @param dispatch
|
||||||
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
getDialogs({state, dispatch}) {
|
getDialogs({state, dispatch}) {
|
||||||
if (state.userId === 0) {
|
return new Promise(function (resolve, reject) {
|
||||||
state.cacheDialogs = [];
|
if (state.userId === 0) {
|
||||||
return;
|
state.cacheDialogs = [];
|
||||||
}
|
reject({msg: 'Parameter error'});
|
||||||
dispatch("call", {
|
return;
|
||||||
url: 'dialog/lists',
|
}
|
||||||
}).then(result => {
|
dispatch("call", {
|
||||||
dispatch("saveDialog", result.data.data);
|
url: 'dialog/lists',
|
||||||
}).catch(e => {
|
}).then(result => {
|
||||||
console.warn(e);
|
dispatch("saveDialog", result.data.data);
|
||||||
|
resolve(result)
|
||||||
|
}).catch(e => {
|
||||||
|
console.warn(e);
|
||||||
|
reject(e)
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user