تغییرات

This commit is contained in:
Mehdi104797 2025-03-16 12:45:43 +03:30
parent 815f61b76f
commit a52cf49dc0
4 changed files with 73 additions and 96 deletions

View File

@ -182,7 +182,7 @@
</div>
<div class="subject-box" v-if="source.showSubjectBox ?? false">
<div class="subject-list">
<button type="button" class="btn subject-list-item">
<div type="button" class="btn subject-list-item">
{{ subjectInput }}
<!-- edit remove -->
@ -203,7 +203,7 @@
<use xlink:href="#icon-Component-242--1"></use>
</svg>
</button>
</button>
</div>
<button
type="button"

View File

@ -1,5 +1,5 @@
<template>
<div class="group-item" >
<div class="group-item">
<div class="group-row enable-hover">
<div class="group-picture-container">
<context-menu
@ -78,8 +78,9 @@
import ImageUploader from "vue-image-upload-resize";
import chatApi from "~/apis/chatApi";
import keyValueApi from "~/apis/keyValueApi";
import { mapState, mapActions } from "pinia";
import { mapState, mapActions } from "pinia";
import { useChatStore } from "@chat/stores/chatStore";
import { useCommonStore } from "@stores/commonStore";
import privatesContextMenu from "~/json/chat/json/privatesContextMenu.json";
import groupsContextMenu from "~/json/chat/json/groupsContextMenu.json";
@ -359,23 +360,22 @@ export default {
},
computed: {
...mapState([
...mapState(useCommonStore, [
"isSidebarCollapsed",
"getForwardItem",
"userPermisionGetter",
"getPanelStatus",
"sidebarListStatusGetter",
]),
...mapState("list", ["listGetter"]),
...mapState(useChatStore, ["listGetter"]),
},
methods: {
...mapActions([
...mapActions(useChatStore, [
"TOGGLE_PANEL",
"checkPermissions",
"SET_SIDEBAR_LIST_STATUS",
]),
...mapActions("list", ["SET_LIST"]),
...mapActions(useChatStore, ["SET_LIST"]),
getGroupTypes() {
this.httpService
.postRequest("keyvalue/" + keyValueApi.forms.groupTypes)
@ -551,7 +551,7 @@ export default {
}
return response;
})
.finally(() => {
this.fetchingData = false;
this.busy = false;
@ -607,8 +607,7 @@ export default {
logout(this.$route);
this.fetchingData = false;
}
})
});
},
// remove group/remove lobby group
removeItem(groups, groupItem, index) {
@ -785,11 +784,11 @@ export default {
},
markActive(groups, index) {
if (this.prevSelectedItemIndex != index) {
this.$set(groups[this.prevSelectedItemIndex], "active", false);
groups[this.prevSelectedItemIndex], "active", false;
}
this.prevSelectedItemIndex = index;
this.$set(groups[index], "active", true);
groups[index], "active", true;
},
resizeAction(event) {
@ -809,16 +808,16 @@ export default {
// برای دریافت درست پاسخ ها بایستی invite-id
// در روت رو اصلاح کرد
if (groupItem.redirectViaInviteLink)
this.$set(this.$route.query, "invite-id", this.listGetter.invite_id);
else this.$set(this.$route.query, "invite-id", undefined);
this.$route.query, "invite-id", this.listGetter.invite_id;
else this.$route.query, "invite-id", undefined;
if (!this.redirectViaInviteLink)
history.pushState({}, document.title, this.$route.path);
this.isRedirectedFromOtherSystems = false;
this.redirectViaInviteLink = false;
this.$set(this.$route.query, "group-id", undefined);
this.$set(this.$route.query, "message-id", undefined);
this.$route.query, "group-id", undefined;
this.$route.query, "message-id", undefined;
// this.$route.query["group-id"] = undefined;
// this.$route.query["message-id"] = undefined;
@ -828,28 +827,24 @@ export default {
lobbyParentShowMessages(lobby, parentIndex, groupItem) {
// اگر تالارثابت باشه و کاربر بر روی گروه های تالار کلیک کند.
if (this.prevParentSelectedItemIndex == parentIndex) {
this.$set(
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
"active",
false
);
false;
}
// کاربر بر روی تالار دیگری کلیک کرده است.
else if (this.prevParentSelectedItemIndex != parentIndex) {
this.$set(
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
"active",
false
);
false;
}
this.prevParentSelectedItemIndex = parentIndex;
this.$set(lobby[parentIndex], "active", true);
lobby[parentIndex], "active", true;
this.SET_LIST(groupItem);
this.$emit("update-messages");
@ -862,29 +857,25 @@ export default {
this.prevParentSelectedItemIndex == parentIndex &&
this.prevSelectedItemIndex != index
) {
this.$set(
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
"active",
false
);
false;
}
// کاربر بر روی تالار دیگری کلیک کرده است.
else if (this.prevParentSelectedItemIndex != parentIndex) {
this.$set(
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
lobby[this.prevParentSelectedItemIndex].sub_groups[
this.prevSelectedItemIndex
],
"active",
false
);
false;
}
this.prevSelectedItemIndex = index;
this.prevParentSelectedItemIndex = parentIndex;
this.$set(lobby[parentIndex].sub_groups[index], "active", true);
lobby[parentIndex].sub_groups[index], "active", true;
this.SET_LIST(groupItem);
this.$emit("update-messages");
@ -919,7 +910,7 @@ export default {
.then((response) => {
this.foundGroups = response.data ?? [];
})
.finally(() => {
// this.isLoading = false;
});
@ -946,7 +937,7 @@ export default {
});
this.closeCreateForm();
})
.finally(() => {
this.fetchingData = false;
});
@ -969,18 +960,15 @@ export default {
parent_id: 0,
};
this.httpService
.formDataRequest(url, payload)
.then((res) => {
this.fetchingData = false;
this.httpService.formDataRequest(url, payload).then((res) => {
this.fetchingData = false;
// mySwalToast({
// html: res.message,
// });
this.resetPagination();
this.getAll("lobbies");
})
// mySwalToast({
// html: res.message,
// });
this.resetPagination();
this.getAll("lobbies");
});
}
});
},
@ -996,25 +984,7 @@ export default {
if (this.$route.name == "privates") {
this.findUser(payload);
} else {
this.httpService
.postRequest(url, payload)
.then((response) => {
this.groups = response.data;
this.users = response.users;
this.pagination = { ...this.pagination, ...response.pagination };
if (this.searchText == "") {
this.groups = [];
}
})
}
},
findUser(query) {
const url = loginUrl() + "/user/suggestion";
this.httpService
.postRequest(url, query)
.then((response) => {
this.httpService.postRequest(url, payload).then((response) => {
this.groups = response.data;
this.users = response.users;
this.pagination = { ...this.pagination, ...response.pagination };
@ -1022,9 +992,20 @@ export default {
if (this.searchText == "") {
this.groups = [];
}
})
});
}
},
findUser(query) {
const url = loginUrl() + "/user/suggestion";
this.httpService.postRequest(url, query).then((response) => {
this.groups = response.data;
this.users = response.users;
this.pagination = { ...this.pagination, ...response.pagination };
if (this.searchText == "") {
this.groups = [];
}
});
},
replayCount(replays) {
@ -1047,9 +1028,7 @@ export default {
.then((response) => {
// this.isLoading = false;
this.foundUsers = response.data ?? [];
})
});
}
},
@ -1105,7 +1084,7 @@ export default {
this.closeCreateForm();
// this.getAll();
})
.finally(() => {
this.uploading = false;
});
@ -1130,7 +1109,7 @@ export default {
// this.closeCreateForm();
// this.getAll();
})
.finally(() => {
this.resetFoundUsers();
this.fetchingData = false;
@ -1147,16 +1126,13 @@ export default {
.postRequest(url, payload)
.then((res) => {
// this.$route.query["invite-id"] = undefined;
this.$set(this.$route.query, "invite-id", undefined);
this.$route.query, "invite-id", undefined;
this.groupId = res.data.id;
this.resetPagination();
this.getAll(this.$route.name);
})
.catch((err) => {
})
.catch((err) => {});
},
// #region mehdi
@ -1207,6 +1183,5 @@ export default {
},
// #endregion
},
};
</script>

View File

@ -39,8 +39,8 @@ export default {
payload.file = fileItem;
payload.length = fileItem.size;
this.fileUploadHttpService
.formDataRequest(url, payload)
this.httpService
.formDataRequest(messageUrl() +url, payload)
.then((res) => {
// this.closeDroppedList();
// this.toLastItem();
@ -66,8 +66,8 @@ export default {
payload.file = this.files[0];
payload.length = this.files[0].size;
return await this.fileUploadHttpService
.formDataRequest(url, payload)
return await this.httpService
.formDataRequest(messageUrl() +url, payload)
.then((res) => {
this.closeDroppedList();

View File

@ -75,11 +75,12 @@ export default {
// #endregion
rerenderChatList: 1,
enablePanelToggling: 1,
showListPanel: false,
};
},
computed: {
...mapState(useCommonStore, [
...mapState(useChatStore, [
"getPanelStatus",
"isSidebarCollapsed",
"sidebarListStatusGetter",
@ -136,6 +137,7 @@ export default {
// #region mehdi
openPagGrup(data) {
console.log("🚀 ~ openPagGrup ~ data:", data)
this.enablePanelToggling = data;
if (this.enablePanelToggling == 1) {
this.showToggleListPanel();