StudioPlus Module Update

Fix statistic counting
This commit is contained in:
Leonard Biano
2024-07-01 11:52:29 +08:00
parent 57f766a371
commit e64bd78fd9
3 changed files with 67 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
"/css/createstudio.css": "/css/createstudio.css?id=90c646eed5b6f0f41a2d4d25bc4810f1",
"/css/studioplus.css": "/css/studioplus.css?id=096a234e0902baf96e505e975bf3fdf1",
"/css/primevue.css": "/css/primevue.css?id=fb4028e64652ab655a2eb3aee0319852",
"/js/creator-studio.js": "/js/creator-studio.js?id=b5e3838c15e9bfa4c84da120c2d3e204",
"/js/creator-studio.js": "/js/creator-studio.js?id=f3809ddf2bf7913633d56ec4818950a4",
"/css/base.css": "/css/base.css?id=5b077e566a0979dd4bfdd14f429f3a4a",
"/js/creator-studio-settings.js": "/js/creator-studio-settings.js?id=dbc22d5742da1cf7d07b7405e2f69ad6",
"/css/creator-studio-settings.css": "/css/creator-studio-settings.css?id=68b329da9893e34099c7d8ad5cb9c940",

View File

@@ -440,34 +440,71 @@ export default {
handleUpdateStatistics(data){
const e = this;
const { filter } = e;
if(data.oldStatus){
if(filter.status && filter.status.length > 0){
if(filter.status.includes('Published') && data.status !== 'Published'){
e.statistics.all = e.statistics.all > 0 ? (e.statistics.all - 1) : 0;
e.statistics.published = e.statistics.published > 0 ? (e.statistics.published - 1) : 0;
} else if(filter.status.includes('Rejected') && data.status !== 'Rejected'){
e.statistics.all = e.statistics.all > 0 ? (e.statistics.all - 1) : 0;
e.statistics.published = e.statistics.rejected > 0 ? (e.statistics.rejected - 1) : 0;
} else if(!filter.status.includes(data.status)){
e.statistics.all = e.statistics.all > 0 ? (e.statistics.all - 1) : 0;
}
} else {
if(data.oldStatus == 'Published' && data.status == 'Rejected'){
e.statistics.published = e.statistics.published > 0 ? (e.statistics.published - 1) : 0;
e.statistics.rejected = e.statistics.rejected + 1;
} else if(data.oldStatus == 'Rejected' && data.status == 'Published'){
e.statistics.published = e.statistics.published + 1;
e.statistics.rejected = e.statistics.rejected > 0 ? (e.statistics.rejected - 1) : 0;
}
}
} else {
e.statistics.all = e.statistics.all > 0 ? (e.statistics.all - 1) : 0;
if(data.status == 'Published'){
e.statistics.published = e.statistics.published > 0 ? (e.statistics.published - 1) : 0;
} else if(data.status == 'Rejected'){
e.statistics.rejected = e.statistics.rejected > 0 ? (e.statistics.rejected - 1) : 0;
}
}
e.getStatistics();
// console.log(data);
// var deductAll = false,
// deductPublished = false,
// deductRejected = false,
// incrementPublished = false,
// incrementRejected = false;
// if(filter.status && filter.status.length > 0){
// deductAll = true;
// if(filter.status.includes('Published')){
// if(data.status != 'Published'){
// deductPublished = true;
// }
// }
// if(filter.status.includes('Rejected')){
// if(data.status != 'Rejected'){
// deductRejected = true;
// }
// }
// }
// if(data?.oldStatus){
// if(data.oldStatus == 'Published'){
// deductPublished = true;
// }
// if(data.oldStatus == 'Rejected'){
// deductRejected = true;
// }
// if(data.status == 'Published'){
// incrementPublished = true;
// }
// if(data.status == 'Rejected'){
// incrementRejected = true;
// }
// } else {
// deductAll = true;
// if(data.status == 'Published'){
// deductPublished = true;
// }
// if(data.status == 'Rejected'){
// deductRejected = true;
// }
// }
// if(deductAll){
// e.statistics.all = e.statistics.all > 0 ? (e.statistics.all - 1) : 0;
// }
// if(deductPublished){
// e.statistics.published = e.statistics.published > 0 ? (e.statistics.published - 1) : 0;
// }
// if(deductRejected){
// e.statistics.rejected = e.statistics.rejected > 0 ? (e.statistics.rejected - 1) : 0;
// }
// if(incrementPublished && filter.status.length == 0){
// e.statistics.published = e.statistics.published + 1;
// }
// if(incrementRejected && filter.status.length == 0){
// e.statistics.rejected = e.statistics.rejected + 1;
// }
},
getJobStatusColor(status) {
switch (status) {