From 6d8478f019fcc06b269a400c704cd6c4358f8caf Mon Sep 17 00:00:00 2001 From: Mehdi104797 <92753457+Mehdi104797@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:31:22 +0330 Subject: [PATCH] =?UTF-8?q?=D8=AA=D8=BA=DB=8C=DB=8C=D8=B1=D8=A7=D8=AA=20?= =?UTF-8?q?=D8=A8=D8=B1=D8=A7=DB=8C=20=20=D8=AC=D8=B3=D8=AA=D8=AC=D9=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/favoriteApi.js | 15 ++ apis/researchApi.js | 24 +++ .../components/EntityRepetitionWords.vue | 4 +- components/entity/components/EntityText.vue | 4 +- components/global/SwitchComponent.vue | 192 ++++++++++++++++++ components/search/AdvancedSearch.vue | 178 ++++++++++++++++ components/search/MyContent.vue | 18 +- components/search/SearchFilter.vue | 5 +- components/search/view/FilterListSearch.vue | 2 +- pages/search/(show)/[key]/[id]/index.vue | 7 +- pages/search/index.vue | 138 ++++++++++++- stores/entityStore.ts | 28 ++- 12 files changed, 585 insertions(+), 30 deletions(-) create mode 100644 apis/favoriteApi.js create mode 100644 apis/researchApi.js create mode 100644 components/global/SwitchComponent.vue create mode 100644 components/search/AdvancedSearch.vue diff --git a/apis/favoriteApi.js b/apis/favoriteApi.js new file mode 100644 index 0000000..b2b1009 --- /dev/null +++ b/apis/favoriteApi.js @@ -0,0 +1,15 @@ +export default { + favorite: { + add: "favorite/add/{{data_type}}/{{ref_key}}", + delete: "favorite/delete/{{data_type}}/{{id}}", //id = portal_meet_22569 + deleteByRefid: "favorite/delete/{{data_type}}/{{index_key}}/{{ref_id}}", //id = portal_meet_22569 + // getListSearch: "favorite/list/{{data_type}}/{{offset}}/{{limit}}", //offset=0 , limit=10 + // counts: "favorite/counts/@data_type", // get + + setFavoritesCat: "favorite/tags/@data_type/set/doc/@id", + getCategories: "favorite/tags/@data_type/get", + setCategories: "favorite/tags/@data_type/set", + getCounts: "favorite/tags/@data_type/counts", + getList: "favorite/list/@data_type/@offset/@limit/@filter", + }, +}; diff --git a/apis/researchApi.js b/apis/researchApi.js new file mode 100644 index 0000000..345e49c --- /dev/null +++ b/apis/researchApi.js @@ -0,0 +1,24 @@ +export default { + admin: { + list: "", + show: "", + edit: "", + update: "", + delete: "", + }, + + research:{ + listDefault:"research/search/{{user_id}}/{{offset}}/{{limit}}", + listBySearch:"research/search/{{user_id}}/{{offset}}/{{limit}}/q=", + deleteItem: "/public/{{index_key}}/delete/{{id}}", //ایدی فیش و یا حاشیه + }, + subject: { + move: 'subject/order/move/parent', + order: 'subject/order/move/one', + list: 'list/subject/list', + add: 'list/subject/add', + edit: 'list/subject/edit', + delete: 'list/subject/delete', + order: 'list/subject/order', + }, +}; diff --git a/components/entity/components/EntityRepetitionWords.vue b/components/entity/components/EntityRepetitionWords.vue index 4074663..580e32e 100644 --- a/components/entity/components/EntityRepetitionWords.vue +++ b/components/entity/components/EntityRepetitionWords.vue @@ -373,11 +373,11 @@ + + diff --git a/components/search/AdvancedSearch.vue b/components/search/AdvancedSearch.vue new file mode 100644 index 0000000..24e5d6a --- /dev/null +++ b/components/search/AdvancedSearch.vue @@ -0,0 +1,178 @@ + + + diff --git a/components/search/MyContent.vue b/components/search/MyContent.vue index f5e59db..bbb7903 100644 --- a/components/search/MyContent.vue +++ b/components/search/MyContent.vue @@ -399,13 +399,14 @@ diff --git a/components/search/view/FilterListSearch.vue b/components/search/view/FilterListSearch.vue index 92b2494..9aa1eb4 100644 --- a/components/search/view/FilterListSearch.vue +++ b/components/search/view/FilterListSearch.vue @@ -129,7 +129,7 @@ diff --git a/pages/search/index.vue b/pages/search/index.vue index 7aa8bd8..1628a81 100644 --- a/pages/search/index.vue +++ b/pages/search/index.vue @@ -795,7 +795,7 @@ import { mapActions, mapState } from "pinia"; import { useSearchStore } from "@search/stores/searchStore"; import { useCommonStore } from "~/stores/commonStore"; -import searchApi from "@search/apis/searchApi.js"; +import searchApi from "@search/apis/searchApi"; import adminApi from "~/apis/adminApi"; import sidbarMenuDefault from "@search/json/search/menu.json"; @@ -960,6 +960,7 @@ export default { // showFilter: false, ismultiWord: false, showButton: false, + showSummary: false, // topRepeatInListMode: true, iscode: false, lastSearchInListMode: true, @@ -1035,7 +1036,6 @@ export default { computed: { ...mapState(useSearchStore, [ - "domainActiveGetter", "searchActiveTabGetter", "searchSchemaGetter", "searchSynonymTitleGetter", @@ -1045,6 +1045,7 @@ export default { "organNameGetter", "isSidebarCollapsed", "userPermisionGetter", + "domainActiveGetter", ]), // metaTitle() { // return import.meta.env.VITE_SEARCH_PAGE_TITLE; @@ -1162,14 +1163,35 @@ export default { ...mapActions(useCommonStore, [ "TOGGLE_SIDEBAR_MENU", "sidebarCollapsedSetter", + "domainActiveSetter", ]), ...mapActions(useSearchStore, [ "searchActiveTabSetter", "searchSchemaSetter", - "domainActiveSetter", "searchSynonymTitleSetter", ]), + initComponent() { + let activeItem = this.searchSchemaGetter[0]; + if (this.$route.query.key) { + let key = this.$route.query.key; + activeItem = this.searchSchemaGetter?.find((item) => item.key === key); + } + this.searchActiveTabSetter(activeItem); + + if (this.$route.query.q) { + this.setInputText(this.$route.query.q); + } + setTimeout(() => { + this.searchStart(this.textSearch); + // if (this.textSearch != undefined && this.textSearch != "") { + // this.searchStart(this.textSearch); + // } else { + // this.getDefaultByFilter(); + // } + }, 500); + }, + setMode(item) { this.mode = item; }, @@ -1197,7 +1219,8 @@ export default { * @param {string} value.domain[].key - کلید دامنه. */ setSearchDomain(value) { - this.searchDomain = value.domain.domain; + this.searchDomain = value.domain?.domain; + if (this.searchDomain == undefined) return; let update = false; if (this.searchDomain && this.searchDomain[0].key != "all") { @@ -1211,8 +1234,7 @@ export default { // this.searchDomain = [...this.searchDomain, ...value.domain.domain]; } - // if (update || !this.domainActiveGetter) - { + if (update || !this.domainActiveGetter) { if (isMajlesBuild()) this.domainActiveSetter(this.searchDomain[1]); else this.domainActiveSetter(this.searchDomain[0]); } @@ -2056,3 +2078,107 @@ export default { }, }; + + diff --git a/stores/entityStore.ts b/stores/entityStore.ts index f124762..0194ba7 100644 --- a/stores/entityStore.ts +++ b/stores/entityStore.ts @@ -1,4 +1,5 @@ import type { + ActiveEntityViewSchema, activeResearchType, ActiveTab, EntityViewSchema, @@ -21,6 +22,7 @@ export const useEntityStore = defineStore("entityStore", { "activeTab", "isReadingMode", "entityViewSchema", + "activeEntityViewSchema", "qruleActiveTab", "qruleSchema", @@ -31,9 +33,11 @@ export const useEntityStore = defineStore("entityStore", { ], }, state: () => ({ + activeTab: undefined as ActiveTab | undefined, entityViewSchema: undefined as EntityViewSchema | undefined, selectedItemEntity: undefined as SelectedItemEntity | undefined, listEntity: undefined as ListEntity | undefined, + activeEntityViewSchema: undefined as ActiveEntityViewSchema | undefined, similarInfo: {} as SimilarInfo | undefined, vuexEntity: undefined, //پیدا نکردم qruleActiveSchema: undefined as qruleActiveTabGetter | undefined, @@ -100,7 +104,9 @@ export const useEntityStore = defineStore("entityStore", { entityViewSchemaGetter(state) { return state.entityViewSchema; }, - + activeTabGetter(state) { + return state.activeTab; + }, qruleActiveTabGetter(state) { return state.qruleActiveTab; }, @@ -113,6 +119,9 @@ export const useEntityStore = defineStore("entityStore", { listEntityGetter(state) { return state.listEntity; }, + activeEntityViewSchemaGetter(state) { + return state.activeEntityViewSchema; + }, fontSizeGerrer(state) { return state.fontSize; }, @@ -174,7 +183,9 @@ export const useEntityStore = defineStore("entityStore", { entityViewSchemaSetter(entityViewSchema = undefined) { this.entityViewSchema = entityViewSchema; }, - + activeEntityViewSchemaSetter(activeEntityViewSchema = undefined) { + this.activeEntityViewSchema = activeEntityViewSchema; + }, qruleActiveTabSetter(qruleActiveTab = undefined) { this.qruleActiveTab = qruleActiveTab; }, @@ -184,15 +195,18 @@ export const useEntityStore = defineStore("entityStore", { qruleActiveSchemaSetter(qruleActiveSchema = undefined) { this.qruleActiveSchema = qruleActiveSchema; }, + activeTabSetter(activeTab = undefined) { + this.activeTab = activeTab; + }, - SET_ITEM_ENTITY(item) { + SET_ITEM_ENTITY(item=undefined) { this.selectedItemEntity = item; }, - SET_LIST_ENTITY(list) { + SET_LIST_ENTITY(list=undefined) { this.listEntity = list; }, - SET_FONT(fontSize) { + SET_FONT(fontSize=undefined) { this.fontSize = fontSize; }, // SET_QUERY( queryParams) { @@ -201,10 +215,10 @@ export const useEntityStore = defineStore("entityStore", { SET_ITEM_LIST_SELECTED_ID(itemListIdSelected) { this.itemListIdSelected = itemListIdSelected; }, - SET_STATUS_BUTTON(statusButton) { + SET_STATUS_BUTTON(statusButton = undefined) { this.statusButton = statusButton; }, - SET_STATUS_ENTITY_VIEWPAGE(statusEntityViewPage) { + SET_STATUS_ENTITY_VIEWPAGE(statusEntityViewPage=undefined) { this.statusEntityViewPage = statusEntityViewPage; }, SET_STATUS_REMOVE_CHECKBOX(statusRemovCheckBox) {