Skip to content

Commit

Permalink
优化缓存机制
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Dec 19, 2021
1 parent f69de50 commit 5c2a82b
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.3.81",
"version": "0.3.88",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",
Expand Down
15 changes: 12 additions & 3 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -4502,6 +4502,7 @@ body .ivu-select-dropdown.select-node .ivu-select-item .option-title {
}

body .ivu-select-dropdown.select-node .ivu-select-item .ivu-tag {
flex-shrink: 0;
margin-left: 18px;
margin-right: 0;
transform: scale(0.9);
Expand Down Expand Up @@ -9295,16 +9296,20 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
}

.project-management .project-name {
line-height: 1;
display: flex;
align-items: center;
}

.project-management .project-name .ivu-tag {
height: 18px;
line-height: 18px;
padding: 0 4px;
margin: 0 -2px 0 0;
transform: scale(0.8);
transform-origin: left bottom;
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.project-management .project-percent {
Expand Down Expand Up @@ -10367,5 +10372,9 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
padding: 0 4px;
transform: scale(0.8);
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/build/365.js → public/js/build/751.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion resources/assets/js/functions/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,10 @@
* @returns {*}
*/
urlAddParams(url, params) {
if (typeof params === "object" && params !== null) {
if ($A.isJson(params)) {
if (url) {
url = this.removeURLParameter(url, Object.keys(params))
}
url+= "";
url+= url.indexOf("?") === -1 ? '?' : '';
for (var key in params) {
Expand Down
10 changes: 7 additions & 3 deletions resources/assets/js/pages/manage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ export default {
},
mounted() {
if ($A.getObject(this.$route.query, '_cc')) {
this.$store.state.method.clearLocal();
this.$store.dispatch("saveUserInfo", this.userInfo);
$A.messageSuccess("清除成功");
}
//
this.$store.dispatch("getUserInfo");
this.$store.dispatch("getTaskPriority");
//
Expand Down Expand Up @@ -420,9 +426,7 @@ export default {
this.archivedProjectShow = true;
return;
case 'clearCache':
this.$store.state.method.clearLocal();
this.$store.dispatch("saveUserInfo", this.userInfo);
$A.messageSuccess("清除成功");
this.$store.dispatch("clearCache");
return;
case 'signout':
$A.modalConfirm({
Expand Down
18 changes: 14 additions & 4 deletions resources/assets/js/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,20 @@ export default {
*/
logout({state, dispatch}) {
state.method.clearLocal();
dispatch("saveUserInfo", {}).then(() => {
const from = window.location.pathname == '/' ? '' : encodeURIComponent(window.location.href);
$A.goForward({path: '/login', query: from ? {from: from} : {}}, true);
});
dispatch("saveUserInfo", {});
const from = ["/", "/login"].includes(window.location.pathname) ? "" : encodeURIComponent(window.location.href);
window.location.href = $A.urlAddParams(window.systemInformation.origin + "login", from ? {from: from} : {})
},

/**
* 清除缓存
* @param state
* @param dispatch
*/
clearCache({state, dispatch}) {
state.method.clearLocal();
dispatch("saveUserInfo", state.userInfo);
window.location.href = $A.urlAddParams(window.location.href, {'_cc': $A.randomString(6)})
},

/** *****************************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions resources/assets/sass/pages/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ body {
flex: 1;
}
.ivu-tag {
flex-shrink: 0;
margin-left: 18px;
margin-right: 0;
transform: scale(0.9);
Expand Down
10 changes: 7 additions & 3 deletions resources/assets/sass/pages/components/project-management.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
margin-bottom: 24px;
}
.project-name {
line-height: 1;
display: flex;
align-items: center;
.ivu-tag {
height: 18px;
line-height: 18px;
padding: 0 4px;
margin: 0 -2px 0 0;
transform: scale(0.8);
transform-origin: left bottom;
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
}
.project-percent {
Expand Down
4 changes: 4 additions & 0 deletions resources/assets/sass/pages/components/team-management.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
padding: 0 4px;
transform: scale(0.8);
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
}
}

0 comments on commit 5c2a82b

Please sign in to comment.