diff --git a/assets/hadith/images/location.png b/assets/hadith/images/location.png new file mode 100644 index 0000000..776158a Binary files /dev/null and b/assets/hadith/images/location.png differ diff --git a/assets/hadith/images/sample-bgi.svg b/assets/hadith/images/sample-bgi.svg new file mode 100644 index 0000000..76e193d --- /dev/null +++ b/assets/hadith/images/sample-bgi.svg @@ -0,0 +1,3 @@ +<svg width="140" height="201" viewBox="0 0 140 201" fill="none" xmlns="http://www.w3.org/2000/svg"> +<rect y="0.28418" width="140" height="200" rx="8" fill="#D9D9D9"/> +</svg> diff --git a/assets/hadith/images/save.png b/assets/hadith/images/save.png new file mode 100644 index 0000000..76dfd68 Binary files /dev/null and b/assets/hadith/images/save.png differ diff --git a/assets/hadith/scss/components/_category_responsive.scss b/assets/hadith/scss/components/_category_responsive.scss deleted file mode 100644 index e69de29..0000000 diff --git a/assets/hadith/scss/components/_modal-search.scss b/assets/hadith/scss/components/_modal-search.scss deleted file mode 100644 index 2887fea..0000000 --- a/assets/hadith/scss/components/_modal-search.scss +++ /dev/null @@ -1,486 +0,0 @@ -.user-modal { - width: 720px; - height: 528px; - top: 50%; - left: 50%; - bottom: unset; - right: unset; - -webkit-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - .popUp-tab { - &__header { - position: absolute; - z-index: 10; - right: 0; - top: 0; - width: 160px; - height: calc(100% - 65px); - background: white; - border-left: 1px solid #f1f1f1; - padding: 20px 0; - &-title { - font-size: 16px; - color: #444444; - margin-bottom: 32px; - padding-right: 23px; - padding-left: 23px; - } - } - &__menu { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column !important ; - .nav-tabs { - border: unset; - display: flex; - flex-direction: column !important ; - } - a { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - flex-direction: column !important ; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding-right: 23px; - border-radius: 0; - width: 100%; - border: unset; - margin: 0; - font-size: 14px; - color: #444444; - padding-top: 6px; - padding-bottom: 6px; - margin-bottom: 5px; - padding-left: 23px; - -webkit-transition: all 0.3s ease; - transition: all 0.3s ease; - &.active { - background-color: #e8fcff; - } - &:hover { - background-color: #e8fcff; - } - } - } - &__content { - padding-top: 0px !important ; - height: calc(100% - 75px); - .tab-pane { - padding-right: 205px; - } - } - &__buttons { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - z-index: 11; - padding-left: 24px; - padding-right: 24px; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - border-top: 1px solid #f1f1f1; - background: white; - border-bottom-left-radius: 20px; - border-bottom-right-radius: 20px; - height: 65px; - } - } - .my-profile { - padding-left: 48px; - padding-bottom: 80px; - height: 100%; - position: relative; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - &__pic { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding-top: 45px; - padding-bottom: 45px; - border-bottom: 1px solid #f1f1f1; - position: relative; - .aks-file-upload-content { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - } - .aks-file-upload-preview { - height: unset !important; - position: absolute; - left: 50%; - top: 50%; - -webkit-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - } - .aks-file-upload-image img { - width: 72px; - height: 72px !important; - border-radius: 50%; - } - .aks-file-upload-p-header { - display: none; - } - label { - margin: 0; - } - .aks-file-upload-label { - background: #f7fafe; - border-radius: 50%; - width: 72px; - height: 72px; - border: 2px solid #f1f1f1; - position: relative; - color: rgba(0, 0, 0, 0); - } - .aks-file-upload-label::before { - content: "+"; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - width: 100%; - height: 100%; - position: absolute; - color: #bac4ce; - font-weight: bold; - font-size: 18px; - } - } - &__form { - padding-top: 10px; - overflow: unset !important; - } - &__container { - height: 100%; - } - .form-row { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding: 0; - border: unset; - margin-right: 0; - margin-left: 0; - -ms-flex-wrap: nowrap; - flex-wrap: nowrap; - &:not(:last-child) { - margin-bottom: 16px; - } - } - label { - width: 130px; - font-size: 14px; - color: #444444; - } - input { - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1; - background: white; - border: 1px solid #f1f1f1; - border-radius: 10px; - height: 40px; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding-right: 25px; - padding-left: 25px; - color: #444444; - // &::-webkit-input-placeholder { - // color: #444444; - // font-size: 14px; - // opacity: 1; - // } - // &:-ms-input-placeholder { - // color: #444444; - // font-size: 14px; - // opacity: 1; - // } - // &::-ms-input-placeholder { - // color: #444444; - // font-size: 14px; - // opacity: 1; - // } - // &::placeholder { - // color: #444444; - // font-size: 14px; - // opacity: 1; - // } - &:focus { - border-radius: 10px; - outline: unset; - border-color: #00b6e3; - } - } - .input-container { - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1; - input, - textarea { - width: 100%; - } - } - textarea { - flex: 1; - background: white; - border: 1px solid #f1f1f1; - border-radius: 10px; - min-height: max-content; - // height: 155px; - display: flex; - align-items: center; - padding-right: 25px; - padding-left: 25px; - resize: none; - padding-top: 10px; - /* color: rgba(78, 78, 78, 0.3); */ - height: 10em; - // &::-moz-placeholder { - // color: rgba(78, 78, 78, 0.3); - // font-size: 14px; - // opacity: 1; - // } - // &:-ms-input-placeholder { - // color: rgba(78, 78, 78, 0.3); - // font-size: 14px; - // opacity: 1; - // } - // &::placeholder { - // color: rgba(78, 78, 78, 0.3); - // font-size: 14px; - // opacity: 1; - // } - &:focus { - border-radius: 10px; - outline: unset; - border-color: #00b6e3; - } - } - } - .tab-pane { - height: 100%; - } -} -.user-modal .os-host-rtl > .os-scrollbar-vertical { - right: unset; - left: 10px; - width: 6px; - padding-top: 25px; -} -.user-modal - .os-theme-dark - > .os-scrollbar - > .os-scrollbar-track - > .os-scrollbar-handle { - background: rgba(0, 0, 0, 0.1); -} -.show.user-modal__modal { - background-color: rgba(27, 39, 51, 0.1); -} -.show.user-modal__modal .modal-dialog { - z-index: 3; -} -#user-modal .modal-dialog { - -webkit-transform: unset; - transform: unset; - left: 0; - right: 0; -} -#user-modal .user-modal { - -webkit-transition: all 0.3s ease-in-out; - transition: all 0.3s ease-in-out; - top: 40%; -} -#user-modal.show .user-modal { - top: 50%; -} -.popUp-tab { - position: fixed; - top: 30%; - width: 304px; - background-color: white; - border-radius: 20px; - border: 1px solid #bac4ce; - overflow: hidden; - &__clear { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - color: #444444; - font-size: 14px; - padding-right: 16px; - padding-left: 16px; - height: 32px; - margin-left: 15px; - &:hover { - color: #00b6e3; - } - } - &__submit { - border-radius: 20px; - border: 2px solid #00b6e3; - font-size: 14px; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding-right: 16px; - padding-left: 16px; - color: #00b6e3; - height: 32px; - -webkit-transition: all 0.2s ease-in; - transition: all 0.2s ease-in; - &:hover { - background-color: #00b6e3; - color: #fff; - } - } - &__header { - padding: 24px; - padding-top: 17px; - font-size: 14px; - } - form { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .form-row { - padding-right: 24px; - padding-left: 24px; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - padding-bottom: 16px; - &:not(:first-child) { - padding-top: 16px; - } - &:not(:last-child) { - border-bottom: 1px solid #f1f1f1; - } - &--radio { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; - } - } - &__buttons { - padding: 24px; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - justify-content: flex-end; - border-top: 1px solid #f1f1f1; - } - input { - max-width: 100%; - color: #444444; - font-size: 16px; - // &::-webkit-input-placeholder { - // color: #bac4ce; - // } - // &:-ms-input-placeholder { - // color: #bac4ce; - // } - // &::-ms-input-placeholder { - // color: #bac4ce; - // } - // &::placeholder { - // color: #bac4ce; - // } - } - textarea { - max-width: 100%; - color: #444444; - font-size: 14px; - outline: none !important; - height: 20px; - resize: none; - overflow: hidden; - // &::-webkit-input-placeholder { - // color: #bac4ce; - // } - // &:-ms-input-placeholder { - // color: #bac4ce; - // } - // &::-ms-input-placeholder { - // color: #bac4ce; - // } - // &::placeholder { - // color: #bac4ce; - // } - } - .close-btn { - display: none !important; - } -} -.modal-dialog-scrollable { - - .modal-body { - overflow-y: hidden !important; - } -} -#overlay-plugin2 { - height: 350px !important ; - -} -#overlay-plugin1{ - max-width: 100% !important ; -} - diff --git a/assets/hadith/scss/components/search-line.scss b/assets/hadith/scss/components/search-line.scss deleted file mode 100644 index ef0fd03..0000000 --- a/assets/hadith/scss/components/search-line.scss +++ /dev/null @@ -1,71 +0,0 @@ -.search-page__search-container { - .dropdown-toggle { - /* min-width: 9.5em; */ - background: #fff !important; - border: unset !important; - } - .myStyle { - width: 100%; - } - .button-search { - background-color: #fff !important; - border: 1px solid #fff !important; - width: 34px !important; - height: 90% !important; - margin-top: 2px; - /* margin-left: 2px; */ - z-index: 99; - } - .input-group-prepend { - position: absolute; - left: 1em; - top: 11px; - margin-right: 4em; - border-right: solid #eee 1px; - } - .input-group { - width: 45em; - height: 3.5em; - border: 1px solid #eee; - // border-radius: 0.5em; - border-color: rgba(150, 243, 243, 0.4588235294); - background: #fff; - align-items: center; - z-index: 9; - } - .dropdown-menu { - transform: unset !important; - left: 0; - right: auto; - min-width: 10em; - font-size: 0.9rem; - border: none; - // border-radius: 0.5em; - text-align: right; - margin-top: 4em; - background-color: #fff; - box-shadow: 0 0.4688rem 2.1875rem rgba(4, 9, 20, 0.03), - 0 0.9375rem 1.4063rem rgba(4, 9, 20, 0.03), - 0 0.25rem 0.5313rem rgba(4, 9, 20, 0.03), - 0 0.125rem 0.1875rem rgba(4, 9, 20, 0.03); - top: -10px !important; - left: 8px !important; - } - .button { - width: 143px !important; - border-radius: 4px !important; - } - .dropdown-item { - display: block; - width: 100%; - padding: 0.25rem 1.5rem; - clear: both; - font-weight: 400; - color: #212529; - text-align: inherit; - white-space: nowrap; - background-color: transparent; - border: 0; - position: relative; - } -} diff --git a/assets/hadith/scss/components/search_navigation.scss b/assets/hadith/scss/components/search_navigation.scss deleted file mode 100644 index 58c9f11..0000000 --- a/assets/hadith/scss/components/search_navigation.scss +++ /dev/null @@ -1,841 +0,0 @@ -.searchNavigation { - .nav-tabs-container { - display: flex; - justify-content: center; - } - .filters__delete { - margin-bottom: 0; - } - .filter-items { - li { - min-width: 14em; - max-width: 16em; - width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - margin-left: 1em; - button { - top: -0.4em !important; - left: -0.9em !important; - } - } - } - // .sub-header { - // div { - // width: 5em; - // } - // } - .float-label { - position: absolute; - top: -1.5em; - right: 0.5em; - background-color: #fff; - padding: 0px 0.5em; - font-size: 0.8rem; - color: #6f6f6f; - z-index: 1; - } - .tabel-main { - position: static !important; - top: unset; - } - - .dropdown-main { - position: relative; - right: 18px; - top: 5px; - - .dropdown-toggle::after { - background-image: none; - } - } - - .header { - display: flex; - justify-content: space-between; - align-items: center; - height: 10vh !important; - width: 100%; - - // right: 56px; - // height: 64px; - // width: calc(100% - 56px); - // border-bottom: 1px solid white; - // background: #fff; - //padding-top: 15px; - //padding-bottom: 15px; - - .header-Breadcrumbs { - position: relative; - flex: 1; - margin: auto 5px; - display: flex; - } - .header-button { - position: relative; - - display: flex; - top: auto; - right: 0px; - flex: 2; - - justify-content: flex-start; - div { - margin-left: 8px; - } - } - } - - .detail-page { - &__header { - display: flex; - align-items: center; - justify-content: space-between; - padding-left: 47px; - padding-right: 47px; - border-bottom: 1px solid #f1f1f1; - padding-bottom: 10px; - height: 64px; - - .document-list__star { - opacity: 1 !important; - } - } - - &__head { - display: flex; - flex-direction: column; - } - - &__title { - font-size: 14px; - display: flex; - align-items: center; - - i { - margin-right: 3px; - font-size: 26px !important; - background: -webkit-linear-gradient(#c1d4da 0%, #e2e8ef 100%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - } - } - - &__breadcrumb { - ul { - display: flex; - align-items: center; - list-style: none; - } - - li { - display: flex; - align-items: center; - - &:not(:last-child):after { - content: ">"; - padding-right: 8px; - padding-left: 8px; - padding-top: 4px; - font-size: 10px; - font-weight: bold; - color: #bac4ce; - display: flex; - justify-content: center; - align-items: center; - } - - &:last-child { - flex: 1; - - a { - } - } - } - - a { - display: block; - font-size: 12px; - color: #92a2b2; - } - } - - &__meta { - ul { - display: flex; - align-items: center; - } - - li { - } - } - - &__shared-user { - } - - &__content { - max-height: calc(100vh - 151px); - padding-right: 40px; - padding-top: 40px; - padding-bottom: 40px; - max-width: 696px; - margin-right: auto; - margin-left: auto; - - h1 { - font-size: 24px; - color: #444444; - margin-top: 8px; - margin-bottom: 8px; - } - - p { - font-size: 16px; - font-weight: lighter; - line-height: 30px; - margin-bottom: 8px; - } - } - - &__edit-btn { - position: fixed; - bottom: 30px; - left: 50%; - transform: translateX(-50%); - - a { - min-width: 88px; - height: 40px; - color: white; - display: flex; - justify-content: center; - align-items: center; - font-size: 14px; - border-radius: 20px; - background: #1b2733; - - &:hover { - color: white; - opacity: 0.8; - } - } - } - } - - .pages-content { - width: 100%; - - padding: 0; - } - .combo-list { - position: relative; - border-bottom: 1px solid #eee; - - .form-control, - .multiselect { - // width: 15em; - font-family: sahel-semi-bold; - } - } - .select-export-container { - // position: absolute; - // top: 1rem; - // left: 0; - // z-index: 999; - - .select-export-type-label { - display: flex; - align-items: center; - position: absolute; - top: 0em; - background-color: #fff; - right: 0.6em; - padding: 0 0.4em; - margin: 0; - font-size: 0.8rem; - } - - // .tavasi::before { - // font-size: 1.1rem; - // } - - .form-control { - font-size: 0.9rem; - padding-top: 0.3em; - height: 2.2em; - } - } - .position1 { - grid-template-columns: 0fr 2fr; - } - .position2 { - grid-template-columns: 23em auto; - } - .navigation-filter { - position: fixed; - right: 0px; - top: 103px; - border-radius: 50%; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - background-color: #eee; - display: flex; - align-items: center; - justify-content: center; - } - - @media (max-width: 575.98px) { - .nav { - li { - .nav-link { - font-size: 0.8rem; - } - } - li.desktop:nth-child(n + 4) { - display: none; - } - .dropdown-menu { - a.dropdown-item:nth-child(-n + 3) { - display: none; - } - } - // .combo-list { - // margin-top: 1em; - // } - } - .header-avatar { - left: 0px; - position: absolute; - bottom: 0.25rem; - } - .dropdown-main { - margin-bottom: 10px; - width: 100%; - text-align: right; - } - - #table1 { - // background-color: red !important; - } - - #myTabContent { - position: relative; - } - - .position1 { - grid-template-columns: auto; - } - .position2 { - grid-template-columns: auto; - } - .tabel { - display: grid !important; - } - .tabel-main { - position: relative; - top: 5rem; - width: 100%; - } - .m1 { - margin-top: 25px; - } - - .pages-content { - width: 22em; - position: fixed !important; - z-index: 10; - background-color: #fff; - top: 0em !important; - height: 100dvh; - right: 0px; - .main-tree { - .filter-list { - // height: 10em; - } - .main-tree-body { - overflow: auto; - - overflow-x: hidden; - width: 100%; - } - .min-height-tree { - height: calc(100vh - 8em) !important; - } - .max-height-tree { - height: calc(100vh - 5em); - } - } - } - .tab-content { - margin-top: 2em; - } - .navigation-filter { - position: fixed; - right: 0px; - top: 103px; - border-radius: 50%; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - background-color: #eee; - display: flex; - align-items: center; - justify-content: center; - } - .my-table { - width: 100%; - overflow-x: hidden !important; - // height: calc(100vh - 24em) !important; - .table-responsive { - height: calc(100vh - 24em) !important; - table { - .thead { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - .subtitle { - display: none; - } - } - } - tbody { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - .subtitle { - display: none; - } - } - } - } - } - } - .my-list { - .list-content { - height: calc(-19em + 100vh) !important; - } - } - } - @media only screen and (min-width: 576px) and (max-width: 767.98px) { - .nav { - li { - .nav-link { - font-size: 0.8rem; - } - } - li.desktop:nth-child(n + 4) { - display: none; - } - .dropdown-menu { - a.dropdown-item:nth-child(-n + 3) { - display: none; - } - } - // .combo-list { - // margin-top: 1em; - // } - } - .dropdown-main { - position: relative; - right: 18px; - width: 90%; - top: 5px; - margin-bottom: 10px; - - .dropdown-toggle::after { - background-image: none; - } - } - .table .table-borderless .table-hover { - display: inline-block !important; - } - - #myTabContent { - position: relative; - } - // .dropdown { - // top: 10px; - // } - .multiselect { - // width: 11em; - } - .tabel { - display: grid; - } - .tabel-main { - position: relative; - top: 3rem; - } - .position1 { - grid-template-columns: auto; - } - .position2 { - grid-template-columns: auto; - } - .m1 { - margin-top: 22px; - width: 100%; - } - .multiselect { - // width: 43rem !important; - margin-bottom: 5px; - div { - width: 100%; - } - } - - .pages-content { - width: 23em; - position: fixed !important; - z-index: 9; - background-color: #fff; - top: 0em !important; - height: 100dvh; - right: 0px; - .main-tree { - .filter-list { - // height: 10em; - } - .main-tree-body { - overflow: auto; - - overflow-x: hidden; - width: 100%; - } - .min-height-tree { - height: calc(100vh - 8em) !important; - } - .max-height-tree { - height: calc(100vh - 5em); - } - } - } - .tab-content { - margin-top: 2em; - } - .navigation-filter { - position: fixed; - right: 0px; - top: 103px; - border-radius: 50%; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - background-color: #eee; - display: flex; - align-items: center; - justify-content: center; - } - .my-table { - overflow-x: hidden !important; - .table-responsive { - height: calc(100dvh - 22em); - - table { - .thead { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - tbody { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - } - } - } - .my-list { - .list-content { - height: calc(-19em + 100vh) !important; - } - } - .main-page__content { - } - } - @media only screen and (min-width: 768px) and (max-width: 991.98px) { - #myTabContent { - position: relative; - } - .multiselect { - // width: 11em; - } - .tabel { - display: grid; - } - .tabel-main { - position: relative; - top: 3rem; - } - .smart_phones { - display: none; - } - .pages-content { - .main-tree { - .filter-list { - // height: 10em; - } - .main-tree-body { - overflow: auto; - - overflow-x: hidden; - width: 100%; - } - .min-height-tree { - height: calc(100vh - 12em) !important; - } - .max-height-tree { - height: calc(100vh - 9em); - } - } - } - .tab-content { - margin-top: 2em; - } - .position1 { - grid-template-columns: auto; - } - .position2 { - grid-template-columns: auto; - } - .navigation-filter { - position: fixed; - right: 0px; - top: 103px; - border-radius: 50%; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - background-color: #eee; - display: flex; - align-items: center; - justify-content: center; - } - .my-table { - overflow-x: hidden !important; - .table-responsive { - height: calc(100dvh - 22em); - - table { - .thead { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - tbody { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - } - } - } - .my-list { - .list-content { - height: calc(-19em + 100vh) !important; - } - } - } - @media only screen and (min-width: 992px) and (max-width: 1199.98px) { - .multiselect { - // width: 13em; - } - #myTabContent { - position: relative; - } - .tabel { - display: grid; - } - - .tabel-main { - position: relative; - top: 3rem; - } - .smart_phones { - display: none; - } - .pages-content { - .main-tree { - .filter-list { - // height: 10em; - } - .main-tree-body { - overflow: auto; - - overflow-x: hidden; - width: 100%; - } - .min-height-tree { - height: calc(100vh - 12em) !important; - } - .max-height-tree { - height: calc(100vh - 9em); - } - } - } - .my-table { - overflow-x: hidden !important; - .table-responsive { - height: calc(100dvh - 20em); - - table { - .thead { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - tbody { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - } - } - } - .my-list { - .list-content { - height: calc(-15em + 100vh) !important; - } - } - } - @media (min-width: 1200px) { - .multiselect { - // width: 13em; - } - #myTabContent { - position: relative; - } - .tabel { - display: grid; - } - - .tabel-main { - position: relative; - top: 3rem; - } - .smart_phones { - display: none; - } - .pages-content { - .main-tree { - .filter-list { - // height: 10em; - } - .main-tree-body { - overflow: auto; - - overflow-x: hidden; - width: 100%; - } - - .max-height-tree { - height: calc(100vh - 9em); - } - } - } - .my-table { - overflow-x: hidden !important; - .table-responsive { - height: calc(100dvh - 20em); - - table { - .thead { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - tbody { - tr { - .voices { - display: none; - } - .meet_no { - display: none; - } - .format { - display: none; - } - } - } - } - } - } - .my-list { - .list-content { - height: calc(-15em + 100vh) !important; - } - } - } -} diff --git a/assets/hadith/scss/components/search_responsive.scss b/assets/hadith/scss/components/search_responsive.scss deleted file mode 100644 index e69de29..0000000 diff --git a/assets/hadith/scss/components/top-header.scss b/assets/hadith/scss/components/top-header.scss deleted file mode 100644 index 556151a..0000000 --- a/assets/hadith/scss/components/top-header.scss +++ /dev/null @@ -1,589 +0,0 @@ -// .main { -// position: fixed; -// z-index: 99; -// background-color: #fff; -// // width: 97%; -// // right: 58px; -// left: 0; -// right: 400px; -// } - -// .main-full { -// width: 97%; -// right: 58px; -// } - -// .button-text { -// border: none; -// background-color: initial; -// position: relative; -// top: 4px; -// } - -// .Active { -// color: #00b6e3; -// position: relative; -// &::before { -// content: ""; -// position: absolute; -// top: 36px; -// width: 52px; -// } -// } - -// .nav-item-link:hover { - // color: #00b6e3 !important; -// } -// .active { - // color: #00b6e3 !important; - // position: relative; - // &::after { - // content: ""; - // top: 30px; - // right: -3px; - // width: 100%; - // } -// } -// .schemasGetter { -// width: auto; -// margin-left: 20px; -// } -// .nav-item-header { -// display: flex; -// // justify-content: space-around; -// div { -// cursor: pointer; -// text-align: center; - -// .nav-item-link { -// text-decoration: none; -// } -// } -// } -// .nav-item { -// display: flex; -// justify-content: flex-end; -// } -// .main-option { -// display: flex; -// justify-content: flex-end; -// } -.header__logo { - display: flex; - justify-content: space-between; - align-items: center; -} -// .select-button { -// border: 0px !important; -// } - -// .dropdown-item { -// text-align: right !important; -// } -// .dropdown { -// appearance: none; -// } - -// .Possibilities { -// // background-color: red; -// width: 97%; -// top: 3px; -// position: relative; -// margin: 0 auto; -// height: auto; -// padding: 5px; -// } - -// .Possibilities-select { -// width: 6rem; -// // background-color: red; -// position: absolute; -// right: 49%; -// display: flex; -// align-content: center; -// justify-content: center; -// align-items: center; -// } -// .Possibilities-select-item { -// padding: 4px; -// border: 0; -// outline: 0 !important; -// } -// .state-button { -// color: red; -// } -// .class-border { -// height: 99px !important; -// } - -// @media (max-width: 575.98px) { -// .row-nav.topheader { -// width: 360px; -// margin-right: 0; -// } -// .row-nav { -// font-size: 12px; -// } -// } - -// @media only screen and (min-width: 768px) and (max-width: 991.98px) { -// .img-img { -// display: none !important; -// } -// } -// @media only screen and (min-width: 576px) and (max-width: 767.98px) { -// // .main { -// // right: 8px; -// // } -// .img-img { -// display: none !important; -// } - -// .header__logo { -// justify-content: flex-start; -// } - -// // .class-border { -// // height: 174px !important; -// // } -// .display-none { -// display: none !important; -// } -// } - -// @media (max-width: 575.98px) { -// .main { -// right: 8px; -// } -// .img-img { -// display: none !important; -// } - -// .header__logo { -// justify-content: flex-start; -// } -// .class-border { -// height: 174px !important; -// } -// .display-none { -// display: none !important; -// // display: inline; -// } -// } -// .active { -// // color:active; -// } - -// .smart_phones { -// display: none; -// } -// .dropdown-container { -// position: relative; -// } - -// .m-w1 { -// // min-width: 34em; -// min-width: 60em; -// } -// .main { -// // position: fixed; -// // z-index: 99; -// // background-color: #fff; -// // width: 97%; -// // right: 58px; -// // left: 0; -// // right: 400px; - -// margin-right: var(--sidebar-collapsed-width); - -// &.expanded { -// margin-right: var(--sidebar-width) !important; -// } - -// .nav-tabs { -// .nav-item { -// &.show .nav-link { -// color: #22b0d2; -// } - -// .nav-link { -// border-top-left-radius: 0.3em; -// border-top-right-radius: 0.3em; -// border-bottom-right-radius: 0; -// border-bottom-left-radius: 0; - -// &.active { -// color: #22b0d2; -// } -// } -// } - -// .float-label { -// position: absolute; -// top: -0.5em; -// right: 0; -// background-color: #fff; -// padding: 0 1em; -// font-size: 0.8rem; -// color: #6f6f6f; -// } -// .form-control { -// min-width: 11em; -// border-radius: 0.5em; -// } -// } -// } - -// .button-text { -// border: none; -// background-color: initial; -// margin-top: 6px; -// position: relative; - -// top: 4px; -// } - -// .description { -// position: absolute; -// right: 0; -// margin-right: 1.5em; -// margin-top: 1em; - -// // margin-right: 30px; -// } - -// .nav-item-link:hover { -// // color: #00b6e3 !important ; -// color: var(--primary-color); -// } - -// .nav-item-header { -// display: flex; -// // justify-content: space-around; -// div { -// cursor: pointer; -// text-align: center; - -// .nav-item-link { -// text-decoration: none; -// } -// } -// } -// .nav-item { -// display: flex; -// justify-content: flex-end; -// height: 3em; -// a { -// span { -// display: none; -// } -// } -// } -// .main-option { -// display: flex; -// justify-content: flex-end; -// } -// .header__logo { -// width: 12em; -// margin: 15px; -// display: flex; -// justify-content: space-between; -// align-items: center; -// } -// .select-button { -// border: 0px !important; -// } - -// .dropdown-item { -// text-align: right !important; -// } -// // .dropdown { -// // appearance: none; -// // } -// // .dropdown-toggle::after { -// // background-image: none; -// // } - -// .Possibilities { -// // background-color: red; -// width: 97%; -// top: 3px; -// position: relative; -// margin: 0 auto; -// height: auto; -// padding: 5px; -// } - -// .Possibilities-select { -// margin-left: 20px; -// margin-top: 5px; -// } -// .Possibilities-select-item { -// padding: 4px; -// border: 0; -// outline: 0 !important; -// } -// .state-button { -// color: red; -// } - -// @media (max-width: 575.98px) { -// .desktop { -// display: none; -// } -// .button-advanced-search { -// right: 1.3em !important; -// top: 5.1em !important; -// } -// .smart_phones { -// display: flex; -// flex-direction: column; -// .button-text { -// margin-top: 0; -// } -// .button-filter { -// position: relative; - -// .button-filter-active { -// color: var(--primary-color); -// } -// } -// .dropdown-content { -// position: absolute; -// top: 46px; -// left: -42px; -// z-index: 9999; -// background-color: #fff; -// width: 10em; -// height: auto; -// border: 1px solid var(--primary-color); -// border-radius: 15px; - -// // display: block; -// /* Add other styling as needed */ -// } -// } - -// .row-nav { -// width: 360px; -// margin-right: 0; -// // margin-top: 16px; -// } -// .active { -// color: var(--primary-color); -// position: relative; - -// // &::after { -// // content: ""; -// // border-bottom: 2px solid var(--primary-color); -// // position: absolute; -// // top: 40px; -// // right: -3px; -// // width: 100%; -// // } -// } - -// .m-w1 { -// // min-width: 21em; -// min-width: 50em; -// } -// // .main { -// // right: 8px; -// // } -// .img-img { -// display: none !important; -// } -// .dropdown-toggle { -// span { -// display: none; -// } -// } - -// .header__logo { -// justify-content: flex-start; -// } -// .class-border { -// height: 12em !important; -// } -// .display-none { -// display: none !important; -// // display: inline; -// } -// } -// @media only screen and (min-width: 576px) and (max-width: 767.98px) { -// .desktop { -// display: none; -// } -// .button-advanced-search { -// right: 1.3em !important; -// top: 5.1em !important; -// } -// .smart_phones { -// display: flex; -// flex-direction: column; -// .button-text { -// margin-top: 0; -// } -// .button-filter { -// position: relative; - -// .button-filter-active { -// color: var(--primary-color); -// } -// } -// .dropdown-content { -// position: absolute; -// top: 46px; -// left: -42px; -// z-index: 9999; -// background-color: #fff; -// width: 10em; -// height: auto; -// border: 1px solid var(--primary-color); -// border-radius: 15px; - -// // display: block; -// /* Add other styling as needed */ -// } -// } -// // .main { -// // right: 8px; -// // } -// .img-img { -// display: none !important; -// } -// .dropdown-toggle { -// span { -// display: none; -// } -// } - -// .header__logo { -// justify-content: flex-start; -// } - -// .class-border { -// height: 12em !important; -// } -// .display-none { -// display: none !important; -// } -// } -// @media only screen and (min-width: 768px) and (max-width: 991.98px) { -// .img-img { -// display: none !important; -// } -// .class-border { -// height: 99px !important; -// } -// .display-logo { -// display: none; -// } -// .dropdown-toggle { -// span { -// display: none; -// } -// } -// .nav-item-header-desktop { -// display: none; -// } -// .dropdown-content { -// position: absolute; -// top: 38px; -// left: -42px; -// z-index: 9999; -// background-color: #fff; -// width: 10em; -// height: auto; -// border: 1px solid var(--primary-color); -// border-radius: 15px; -// } - -// .active { -// &::after { -// content: ""; -// top: 32px; -// } -// } -// .button-advanced-search { -// right: 1em !important; -// top: 0.8em !important; -// } -// } -// @media only screen and (min-width: 992px) and (max-width: 1199.98px) { -// .display-logo { -// display: none; -// } -// .nav-item-header-tablet { -// display: none; -// } -// .description { -// margin-top: 2em; -// } -// .class-border { -// height: 8.3em !important; -// } -// .button-advanced-search { -// right: 1em !important; -// top: 0.8em !important; -// } -// } -// @media only screen and (min-width: 1200px) and (max-width: 1919.98px) { -// .nav-item-header-tablet { -// display: none; -// } -// .description { -// margin-right: -12.5em; -// margin-top: 1.6em; -// } -// .class-border { -// height: 7.8em !important; -// } -// .button-advanced-search { -// right: 1em !important; -// top: 0.6em !important; -// } -// } -// @media only screen and (min-width: 1920px) { -// .class-border { -// height: 7.2em !important; -// } -// .smart_phones { -// display: none; -// } -// .nav-item-header-tablet { -// display: none; -// } -// .description { -// margin-right: -12.5em; -// margin-top: 1.6em; -// } -// .button-advanced-search { -// // right: 16em !important; -// // top: 1.3em !important; -// right: 1em !important; -// top: 0.3em !important; -// } -// } - -// .active { -// color: var(--primary-color); -// } -// .show-category-btn { -// } -// .button-advanced-search { -// margin-top: 0.2em; -// position: absolute; -// right: 2.5em; -// top: 1.5em; -// border-left: 1px #eee solid; -// border-radius: unset !important; -// z-index: 99; -// color: var(--primary-color); -// // svg { -// &:hover { -// font-weight: bold; -// transition-duration: 0.3s; -// } -// // } -// } diff --git a/assets/hadith/scss/hadith.css b/assets/hadith/scss/hadith.css index 9c89155..11303be 100644 --- a/assets/hadith/scss/hadith.css +++ b/assets/hadith/scss/hadith.css @@ -1,12 +1,24 @@ +:root { + --ui-primary: #00a762; + --ui-color-four: #4be8ae; + --ui-container-wide: 1200px; + --ui-color-one: #444; + --ui-color-three: #626b84; + --ui-color-two: #1b2132; + + --ui-container: 720px; /* library show page*/ + --ui-container-two: 1232px; /* library show page*/ +} + @import "tailwindcss"; @import "@nuxt/ui"; /* custom imports */ @import "../../../../../assets/common/scss/_IRANSansX.scss"; +@import "../../../../../assets/common/scss/_takrim.scss"; @theme { --font-sans: "IRANSansX", "Public Sans", sans-serif; - --container-lg: 720px; } @layer { diff --git a/assets/hadith/scss/responsive/max_width/399/chat-list.scss b/assets/hadith/scss/responsive/max_width/399/chat-list.scss deleted file mode 100644 index 95b81e5..0000000 --- a/assets/hadith/scss/responsive/max_width/399/chat-list.scss +++ /dev/null @@ -1,3 +0,0 @@ -.comment-list .comments .comment-container.replayer .comment { - max-width: 20em; -} \ No newline at end of file diff --git a/assets/hadith/scss/responsive/max_width/991/_group.scss b/assets/hadith/scss/responsive/max_width/991/_group.scss deleted file mode 100644 index b96d3cd..0000000 --- a/assets/hadith/scss/responsive/max_width/991/_group.scss +++ /dev/null @@ -1,130 +0,0 @@ -.main-page__content { - // .pages { - // .pages-content { - .menu-bar__content { - position: fixed !important; - max-width: 24em; - min-width: 22em; - z-index: 3; - background-color: #fff; - right: 0; - // overflow: hidden; - transition: right 0.3s ease-out; - top: 0; - bottom: 4.5em; - - &.mini { - right: -100%; - transition: right 0.3s ease-out; - - - } - - - - .home-list__header { - .search-form { - .form-group { - .form-control { - // width: 98%; - } - - .dropdown { - // width: 1.5rem; - // position: relative; - // left: 0.5rem; - // top: 0.25rem; - } - } - } - } - - .home-list__content { - .scroll-needed { - height: calc(100dvh - 10em); - } - } - .hide-list-panel { - } - - - .groups-header { - display: flex; - justify-content: space-between; - align-items: center; - - .right-icons { - .toggle-list { - display: none!important; - } - // .group-name { - // display: none; - // } - } - .left-icons { - position: relative; - display: flex; - align-items: center; - } - - .dropdown { - &.profile-dropdown { - .nav-link { - &.dropdown-toggle { - span { - display: none; - } - } - } - } - } - - .btn { - // display: none; - } - } - - .create-forms { - right: 0; - z-index: 99; - max-width: 80%; - border-left: 1px solid #eee; - } - } - - .position-relative { - .show-toggle-list-panel { - // position: absolute; - // right: 3rem; - // top: 0.25rem; - // display: block; - // button { - // left: 0px; - // } - } - .dropdown { - // position: absolute; - // top: 0px; - } - } - .hide-list-panel .toggle-mobile-nav { - // position: absolute; - // bottom: 0.25rem; - // right: 0.25rem; - } -} -#myTabContent { - #property { - // position: relative; - // top: 8rem; - } -} -// } -// } -// } - -.navbar { - .profile-dropdown { - // bottom: 0.5rem; - } -} diff --git a/assets/hadith/scss/responsive/max_width/991/_replays.scss b/assets/hadith/scss/responsive/max_width/991/_replays.scss deleted file mode 100644 index 54cac9d..0000000 --- a/assets/hadith/scss/responsive/max_width/991/_replays.scss +++ /dev/null @@ -1,40 +0,0 @@ -#replays { - position: fixed !important; - left: -25em; - top: 0; - bottom: 4.5em; - transition: left 0.3s ease-out; - max-width: 80%; - z-index: 98; - - &.show { - transition: left 0.3s ease-out; - left: 0; - } - - .replay-list { - .comment-container { - .comment { - margin-right: 0; - - &::after, - &::before { - display: none; - } - .comment-header { - display: flex; - align-items: center; - margin-bottom: 0.5em; - - .commentor-avatar { - margin-left: 0.5em; - position: static; - } - } - .comment-actions { - visibility: visible; - } - } - } - } -} diff --git a/assets/hadith/scss/responsive/max_width/991/_the-footer.scss b/assets/hadith/scss/responsive/max_width/991/_the-footer.scss deleted file mode 100644 index 2204fde..0000000 --- a/assets/hadith/scss/responsive/max_width/991/_the-footer.scss +++ /dev/null @@ -1,78 +0,0 @@ -.mobile-footer { - position: fixed; - bottom: 0; - left: 0; - right: 0; - /* height: 3.5em; */ - /* -webkit-box-shadow: 0px 1px 6px 3px #eee; */ - box-shadow: 0px 1px 6px 3px #eee; - display: flex; - flex-direction: column; - justify-content: center; - padding: 0.5em 1em; - background-color: #fafafa; - z-index: 98; - - .footer-menu { - display: flex; - align-items: center; - justify-content: space-between; - justify-content: space-around; - list-style: none; - margin: 0; - padding: 0; - - .footer-menu-item { - .footer-menu-item-btn { - width: 3.3em; - height: 3.3em; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - border-radius: 50%; - padding: 0; - color: #333; - position: relative; - - - - * { - padding: 0; - } - - .button-title { - font-size: 0.8rem; - // color:#6f6f6f; - } - - &.active { - color: #00b6e3; - // fill:blue; - .icon { - // background-color: blue; - } - // border: 1px solid #c7c7c7; - // background-color: #fafafa; - // border-color: green; - // transform: translateY(-10px) scale(1.1); - - &::before { - content: ""; - display: block; - position: absolute; - top: -0.6em; - left: 0; - right: 0; - border-top: 2px solid #00b6e3; - } - } - - &.disabled, &:disabled { - opacity: 0.4; - // filter: grayscale(0.6); - } - } - } - } -} diff --git a/assets/hadith/scss/responsive/max_width/991/chat-list.scss b/assets/hadith/scss/responsive/max_width/991/chat-list.scss deleted file mode 100644 index 001af77..0000000 --- a/assets/hadith/scss/responsive/max_width/991/chat-list.scss +++ /dev/null @@ -1,126 +0,0 @@ -.main-page__content { - #comments-and-replays { - .chat-list-group-info { - .group-info-actions { - & > .btn:not(.issue-redirect-btn), - & > .multiselect, - & > .multiselect-container { - display: none; - } - } - - .group-row .group-content .group-title-container .group-title { - max-width: 13em; - } - .group-row - .group-content - .group-description-container - .group-description { - max-width: 13em; - } - } - - .comment-list { - .comments { - // height: 70vh; - // height: calc(100dvh - 70px - 63px - 3.7em); - // height: calc(100dvh - 8.5em); - // height: calc(100dvh - 10em); - .drop { - // height: calc(100dvh - 16.5em); - - .stream { - // height: calc(100dvh - 12em); - // height: calc(100dvh - 16.5em); - height: calc(100dvh - 16.5em); - - &.filter-is-active { - // height: calc(100dvh - 21em) !important; - // height: calc(100dvh - 24.5em) !important; - height: calc(100dvh - 21em); - - & + .empty .wrapper { - bottom: 5em; - } - } - } - } - } - - &.replays-is-open { - .comments { - // height: 70vh; - // height: calc(100dvh - 70px - 63px - 3.7em); - // height: calc(100dvh - 8.5em); - // height: calc(100dvh - 10em); - .drop { - // height: calc(100dvh - 16.5em); - - .stream { - height: calc(100dvh - 20em); - - &.filter-is-active { - // height: calc(100dvh - 21em) !important; - // height: calc(100dvh - 24.5em) !important; - height: calc(100dvh - 24em); - - & + .empty .wrapper { - bottom: 8.5em; - } - } - } - } - } - } - - .comment-form-container { - min-width: unset; - } - - .comments { - .comment-container { - margin: 0; - - &.replayer { - .comment { - margin-left: 0; - } - } - .comment { - margin-right: 0; - max-width: 20em; - - &::after, - &::before { - display: none; - } - .comment-header { - display: flex; - align-items: center; - margin-bottom: 0.5em; - - .commentor-avatar { - margin-left: 0.5em; - position: static; - } - } - .comment-actions { - visibility: visible; - } - } - } - - .first-last-button { - display: none; - } - } - } - - .menu-multiselect { - } - - .auth-page .sign-up--tabs { - height: auto; - } - } -} diff --git a/assets/hadith/scss/responsive/max_width/max_width.scss b/assets/hadith/scss/responsive/max_width/max_width.scss deleted file mode 100644 index a0a6c19..0000000 --- a/assets/hadith/scss/responsive/max_width/max_width.scss +++ /dev/null @@ -1,157 +0,0 @@ -// 1600px -@media screen and (max-width: 100em) { - // @import "./1600/my_table_1600"; - // @import "./1600/the_list_panel_1600"; - // @import "./1600/sub_header_1600"; -} -// 1399px -@media screen and (max-width: 87.499em) { - // @import "./1399/the_list_panel-1399"; - // @import "./1399/_sub_header_1399"; -} - -// 991px -@media screen and (max-width: 61.998em) { - .main-page__content { - .search-items { - height: calc(100vh - 18em); - } - .filter-list-container { - padding-top: 0.5em; - position: fixed; - width: 23em; - z-index: 9; - // width: auto; - - .main-filter { - display: none; - } - .mobile-mode { - display: flex; - justify-content: flex-start; - - .btn { - border-radius: 50%; - // font-size: 0.7rem; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - display: flex; - justify-content: center; - align-items: center; - transform: translateX(1.5em); - background-color: #eee; - - &:hover { - filter: brightness(0.8); - } - } - } - - &.expanded { - top: 0; - bottom: 0; - background: #fff; - justify-content: center; - box-shadow: -1px 0px 7px 1px #eee; - - .main-filter { - display: block; - } - } - } - .nav.nav-tabs { - li { - .nav-link { - font-size: 0.8rem; - } - } - li.desktop:nth-child(n + 4) { - display: none; - } - // .combo-list { - // margin-top: 1em; - // } - } - - .summary-container { - padding-top: 0.5em; - position: fixed; - top: 0; - bottom: 0; - left: 0; - z-index: 9; - width: auto; - - &.expanded { - background: #fff; - justify-content: center; - box-shadow: -1px 0px 7px 1px #eee; - } - } - .search-container { - .btn, - .form-control { - font-size: 0.9rem; - } - .logo { - max-width: 2.3em; - } - } - .advanced-search { - position: fixed; - } - } - - // .nav-sidebar { - // display: block; - - // &.sidebar-expanded-mobile { - // display: block; - // } - // } - - // @import "./991/_sub_header_991"; - // @import "./991/my_table_991"; -} - -// 767px -@media screen and (max-width: 47.938em) { - .main-page__content { - margin-right: 0 !important; - } - // @import "./767/group"; - // @import "./767/the_list_panel_767"; - // @import "./767/the_navbar_767"; - // @import "./767/_sub_header_767"; - // @import "./767/the-footer"; -} - -// 575px -@media screen and (max-width: 35.938em) { - // @import "./575/main_575"; - // @import "./575/my_table_575"; - // @import "./575/the_list_panel_575"; - // @import "./575/the_navbar_575"; - // @import "./575/sub_header_575"; - .majles-search-table { - .table-responsive { - height: calc(-28em + 100vh); - } - } -} - -// 399px -@media screen and (max-width: 24.938em) { - // @import "./399/my_table_399"; - // @import "./399/sub_header_399"; - // @import "./399/the-_navbar_399"; - // @import "./399/the_list_panel_399"; -} -//360px -@media screen and (max-width: 22.5em) { - // @import "./360/main_360"; - // @import "./360/sub_header_360"; - // @import "./360/the_list_panel_360"; - // @import "./360/the_navbar_360"; -} diff --git a/assets/hadith/scss/responsive/min_and_max/min-and-max.scss b/assets/hadith/scss/responsive/min_and_max/min-and-max.scss deleted file mode 100644 index e3c5b04..0000000 --- a/assets/hadith/scss/responsive/min_and_max/min-and-max.scss +++ /dev/null @@ -1,7 +0,0 @@ -@media only screen and (min-width: 576px) and (max-width: 767.98px){ - .majles-search-table { - .table-responsive { - height: calc(-17em + 100vh); - } - } -} \ No newline at end of file diff --git a/assets/hadith/scss/responsive/min_width/400/_group.scss b/assets/hadith/scss/responsive/min_width/400/_group.scss deleted file mode 100644 index 72cc0c5..0000000 --- a/assets/hadith/scss/responsive/min_width/400/_group.scss +++ /dev/null @@ -1,78 +0,0 @@ -.main-page__content { - .menu-bar__content { - // max-width: 50%; - // min-width: 50%; - - .groups-header { - // display: flex; - // justify-content: space-between; - // align-items: center; - - .dropdown { - &.profile-dropdown { - // display: none; - } - } - } - .group-filter-mobile { - // display: none; - } - - .toggle-sidebar { - // display: none; - } - .toggle-menu-bar { - // display: none; - } - - &.mini { - // max-width: 5em; - // min-width: 5em; - - .right-icons { - & > .btn:not(.toggle-list), .group-name ,& > svg { - // display: none; - } - } - - .groups-header { - .toggle-search { - // display: none; - } - .toggle-filter { - // display: none; - } - } - - .group-item { - .group-row { - .group-picture-container { - .context-menu-dropdown { - // display: none !important; - } - - .group-picture.mini-mode { - // display: inline !important; - // cursor: pointer; - } - .group-picture { - // display: none; - } - } - - .group-content { - // display: none; - } - } - } - - .home-list__content { - } - } - } - .position-relative { - .dropdown { - // top: 50px; - } - } -} diff --git a/assets/hadith/scss/responsive/min_width/576/_group.scss b/assets/hadith/scss/responsive/min_width/576/_group.scss deleted file mode 100644 index 548c4c6..0000000 --- a/assets/hadith/scss/responsive/min_width/576/_group.scss +++ /dev/null @@ -1,80 +0,0 @@ -.main-page__content { - .menu-bar__content { - // max-width: 24em; - // min-width: 20em; - - .groups-header { - // display: flex; - // justify-content: space-between; - // align-items: center; - - .dropdown { - &.profile-dropdown { - // display: none; - } - } - } - .group-filter-mobile { - // display: none; - } - - .toggle-sidebar { - // display: none; - } - .toggle-menu-bar { - // display: none; - } - - &.mini { - // max-width: 5em; - // min-width: 5em; - - .right-icons { - & > .btn:not(.toggle-list), - .group-name, - & > svg { - // display: none; - } - } - - .groups-header { - .toggle-search { - // display: none; - } - .toggle-filter { - // display: none; - } - } - - .group-item { - .group-row { - .group-picture-container { - .context-menu-dropdown { - // display: none !important; - } - - .group-picture.mini-mode { - // display: inline !important; - // cursor: pointer; - } - .group-picture { - // display: none; - } - } - - .group-content { - // display: none; - } - } - } - - .home-list__content { - } - } - } - .position-relative { - .dropdown { - // top: 50px; - } - } -} diff --git a/assets/hadith/scss/responsive/min_width/768/_group.scss b/assets/hadith/scss/responsive/min_width/768/_group.scss deleted file mode 100644 index a54f04c..0000000 --- a/assets/hadith/scss/responsive/min_width/768/_group.scss +++ /dev/null @@ -1,81 +0,0 @@ -.main-page__content { - .menu-bar__content { - // max-width: 40%; - // min-width: 40%; - right:4.5em; - - .groups-header { - // display: flex; - // justify-content: space-between; - // align-items: center; - - .dropdown { - &.profile-dropdown { - // display: none; - } - } - } - .group-filter-mobile { - // display: none; - } - - .toggle-sidebar { - // display: none; - } - .toggle-menu-bar { - // display: none; - } - - &.mini { - // max-width: 5em; - // min-width: 5em; - - .right-icons { - & > .btn:not(.toggle-list), - .group-name, - & > svg { - // display: none; - } - } - - .groups-header { - .toggle-search { - // display: none; - } - .toggle-filter { - // display: none; - } - } - - .group-item { - .group-row { - .group-picture-container { - .context-menu-dropdown { - // display: none !important; - } - - .group-picture.mini-mode { - // display: inline !important; - // cursor: pointer; - } - .group-picture { - // display: none; - } - } - - .group-content { - // display: none; - } - } - } - - .home-list__content { - } - } - } - .position-relative { - .dropdown { - // top: 50px; - } - } -} diff --git a/assets/hadith/scss/responsive/min_width/992/_group.scss b/assets/hadith/scss/responsive/min_width/992/_group.scss deleted file mode 100644 index 1c16246..0000000 --- a/assets/hadith/scss/responsive/min_width/992/_group.scss +++ /dev/null @@ -1,81 +0,0 @@ -.main-page__content { - .menu-bar__content { - // -webkit-box-flex: 1; - // -ms-flex: 1 1 100%; - // max-width: 200px; - // width: auto; - // position: fixed!important; - - .groups-header { - display: flex; - justify-content: space-between; - align-items: center; - - .dropdown { - &.profile-dropdown { - display: none; - } - } - } - .group-filter-mobile { - display: none; - } - - .toggle-sidebar { - display: none; - } - .toggle-menu-bar { - display: none; - } - - &.mini { - max-width: 5em; - min-width: 5em; - - .right-icons { - & > .btn:not(.toggle-list), .group-name ,& > svg { - display: none; - } - } - - .groups-header { - .toggle-search { - display: none; - } - .toggle-filter { - display: none; - } - } - - .group-item { - .group-row { - .group-picture-container { - .context-menu-dropdown { - display: none !important; - } - - .group-picture.mini-mode { - display: inline !important; - cursor: pointer; - } - .group-picture { - display: none; - } - } - - .group-content { - display: none; - } - } - } - - .home-list__content { - } - } - } - .position-relative { - .dropdown { - // top: 50px; - } - } -} diff --git a/assets/hadith/scss/responsive/min_width/992/_the-footer.scss b/assets/hadith/scss/responsive/min_width/992/_the-footer.scss deleted file mode 100644 index 109b6ef..0000000 --- a/assets/hadith/scss/responsive/min_width/992/_the-footer.scss +++ /dev/null @@ -1,3 +0,0 @@ -.mobile-footer { - display: none; -} \ No newline at end of file diff --git a/assets/hadith/scss/responsive/min_width/min-width.scss b/assets/hadith/scss/responsive/min_width/min-width.scss deleted file mode 100644 index 00f054e..0000000 --- a/assets/hadith/scss/responsive/min_width/min-width.scss +++ /dev/null @@ -1,63 +0,0 @@ -// 200px -@media screen and (min-width: 200px) { -} - -//400px -@media screen and (min-width: 24.938em) { -} -// 576px -@media screen and (min-width: 36em) { - .main-page__content { - .search-items { - height: calc(100vh - 17em); - } - } -} -// 768px -@media screen and (min-width: 48em) { -} -// 992px -@media screen and (min-width: 62em) { - .mobile-mode { - display: none; - } - - .main-page__content { - .search-items { - height: calc(100vh - 12.5em); - } - } - .qanon-content, - .majles-qaSection-content, - .majles-qanon-content, - .majles-mashruh-content { - .search-items { - height: calc(100vh - 14.5em); - } - } - .main-filter { - .search-items { - height: calc(100vh - 16.8em); - } - } - .majles-search-table { - .table-responsive { - height: calc(-15em + 100vh); - } - } -} - -// 1200px - -// 1400px - -// // 1600px -// @media screen and (min-width: 100.000em) { -// @import "./992/category_992"; -// } - -// //1800px -// @media screen and (min-width: 112.500em) {} - -// //2000px -// @media screen and (min-width: 125.000em) {} diff --git a/assets/hadith/scss/responsive/responsive.scss b/assets/hadith/scss/responsive/responsive.scss deleted file mode 100644 index 6192295..0000000 --- a/assets/hadith/scss/responsive/responsive.scss +++ /dev/null @@ -1,12 +0,0 @@ -// the base pixel size is : "16px" - -// -// max width media queries -// -@import "./max_width/max_width.scss"; - -// -// min width media queries -// -@import "./min_width/min-width.scss"; -@import "./min_and_max/min-and-max.scss"; diff --git a/components/hadith/AutoComplation.vue b/components/hadith/AutoComplation.vue index 107c6c6..bb6cf45 100644 --- a/components/hadith/AutoComplation.vue +++ b/components/hadith/AutoComplation.vue @@ -3,8 +3,12 @@ const props = defineProps({ showFilter: { default: false, }, + showPrevSearch: { + default: false, + }, }); const emit = defineEmits(["response-ready"]); +const router = useRouter(); export type Sample = { fromPerson: string; @@ -123,17 +127,23 @@ const loading = ref(false); // } // ); +const clearSimilar = () => { + console.info("clearSimilar"); +}; const onBlur = () => { // console.info("onBlue"); }; const onChange = () => { // console.info("onChange"); }; -const onUpdateModel = (newVal) => { - // console.info("onUpdateModel", newVal); +const onUpdateModel = (newVal: string) => { + console.info("onUpdateModel", newVal); }; const onSearch = () => { console.info("onSearch"); + router.push({ + name: "hadithSearch", + }); }; const onKeyDown = () => { // console.info("onKeyDown"); @@ -152,49 +162,54 @@ const onSend = () => { </script> <template> - <div class="hadith-search-root"> - <div class="prev-search-item flex items-center"> - <span class="total">۴۷ مشابه </span> - <span class="text me-auto"> - عَنِ الْحَسَنِ بْنِ عَلِيِّ بْنِ يُوسُفَ، عَنْ جَدِّهِ، قَالَ: - </span> - <UButton - icon="i-lucide:x" - color="neutral" - variant="ghost" - class="clear-similar-btn" - @click="clearSimilar" - /> - </div> - <div class="search-input"> - <UInputMenu - class="w-full" - :items="[]" - v-model="searchTerm" - v-model:open="open" - v-model:search-term="searchTerm" - placeholder="هوشمند جستجو کنید..." - :ui="{ - base: ['hadith-search-input'], - }" - :content="{ - align: 'start', - side: 'bottom', - sideOffset: 4, - }" - :loading="loading" - highlight - highlightOnHover - @focus="open = true" - @blur="open = false" - @change="onChange" - @update:modelValue="onUpdateModel" - @update:searchTerm="onUpdateModel" - @keydown="onKeyDown" - @keyup="onKeyUp" - @keydown.enter="onSend" - > - </UInputMenu> + <div class="hadith-search-root-wrapper"> + <div class="hadith-search-root"> + <div v-if="showPrevSearch" class="prev-search-item flex items-center"> + <span class="total">۴۷ مشابه </span> + <span class="text me-auto"> + عَنِ الْحَسَنِ بْنِ عَلِيِّ بْنِ يُوسُفَ، عَنْ جَدِّهِ، قَالَ: + </span> + <UButton + icon="i-lucide:x" + color="neutral" + variant="ghost" + class="clear-similar-btn" + @click="clearSimilar" + /> + </div> + <div class="search-input"> + <UInputMenu + class="w-full focus:placeholder-gray-800" + :items="[]" + v-model="searchTerm" + v-model:open="open" + v-model:search-term="searchTerm" + placeholder="هوشمند جستجو کنید..." + :ui="{ + base: ['hadith-search-input'], + }" + :content="{ + align: 'start', + side: 'bottom', + sideOffset: 4, + }" + :loading="loading" + highlight + highlightOnHover + @focus="open = true" + @blur="open = false" + @change="onChange" + @update:modelValue="onUpdateModel" + @update:searchTerm="onUpdateModel" + @keydown="onKeyDown" + @keyup="onKeyUp" + @keydown.enter="onSend" + > + </UInputMenu> + </div> + <UButton class="my-trailing-button"> + <UIcon @click.prevent="onSearch" name="i-lucide-search" /> + </UButton> </div> <div class="search-filter my-3 space-x-2" v-if="props.showFilter"> <UDropdownMenu @@ -219,188 +234,200 @@ const onSend = () => { </div> </template> -<style> -.hadith-search-root { - position: relative; +<style scoped> +.hadith-search-root-wrapper { max-width: 656px; width: 100%; margin: 0 1em; - &::before { - content: ""; - - position: absolute; - left: 1em; - right: 1em; - top: 50%; - - backdrop-filter: blur(60px); - background: linear-gradient(137.41deg, #ffffff -42.82%, #e5e0ff 87.9%); - filter: blur(60px); - width: 626px; - height: 68px; - z-index: 0; - } - - .prev-search-item { - width: 328; - height: 49; - gap: 6px; - border-radius: 12px; - border-width: 0.5px; - padding-top: 8px; - padding-right: 12px; - padding-bottom: 8px; - padding-left: 12px; - background: #626b84; - border: 0.5px solid; - margin-bottom: 0.7em; - - border-image-source: linear-gradient( - 102.02deg, - #4be8ae 7.38%, - #00a762 91.78% - ); - - .total { - width: 53; - height: 24; - gap: 4px; - border-radius: 6px; - padding: 5px 7px; - background: #1b213266; - - font-family: IRANSansX; - font-weight: 500; - font-size: 10px; - line-height: 15px; - letter-spacing: 0%; - text-align: right; - color: #ffffff; - } - .text { - font-family: Takrim; - font-weight: 400; - font-size: 16px; - line-height: 32px; - letter-spacing: 0%; - text-align: right; - color: #ffffff; - } - .clear-similar-btn { - width: 32px; - height: 32px; - gap: 4px; - border-radius: 60px; - padding-top: 11px; - padding-right: 6px; - padding-bottom: 11px; - padding-left: 6px; - background: #1b213266; - color: #fff; - } - } - - .search-input { + .hadith-search-root { position: relative; - } - .search-filter { - .filter-item { - /* width: 81px; */ - height: 40px; + + &::before { + content: ""; + + position: absolute; + left: 1em; + right: 1em; + top: 50%; + + backdrop-filter: blur(60px); + background: linear-gradient(137.41deg, #ffffff -42.82%, #e5e0ff 87.9%); + filter: blur(60px); + width: 626px; + height: 68px; + z-index: 0; + } + + .prev-search-item { + width: 328; + height: 49; + gap: 6px; border-radius: 12px; - border-width: 0.3px; + border-width: 0.5px; padding-top: 8px; padding-right: 12px; padding-bottom: 8px; padding-left: 12px; - gap: 4px; - background-color: #fff; - border: 0.3px solid #e0e0e0; - box-shadow: 0px 1px 4px 0px #0000000d; - color: #8a92a8; - font-family: IRANSansX; - font-weight: 400; - font-size: 13px; - line-height: 20px; - letter-spacing: 0%; - text-align: right; + background: #626b84; + border: 0.5px solid; + margin-bottom: 0.7em; - &.active { - color: linear-gradient(102.02deg, #4be8ae 7.38%, #00a762 91.78%); + border-image-source: linear-gradient( + 102.02deg, + #4be8ae 7.38%, + #00a762 91.78% + ); - * { - color: #fff; + .total { + width: 53; + height: 24; + gap: 4px; + border-radius: 6px; + padding: 5px 7px; + background: #1b213266; + + font-family: IRANSansX; + font-weight: 500; + font-size: 10px; + line-height: 15px; + letter-spacing: 0%; + text-align: right; + color: #ffffff; + } + .text { + font-family: Takrim; + font-weight: 400; + font-size: 16px; + line-height: 32px; + letter-spacing: 0%; + text-align: right; + color: #ffffff; + } + .clear-similar-btn { + width: 32px; + height: 32px; + gap: 4px; + border-radius: 60px; + padding-top: 11px; + padding-right: 6px; + padding-bottom: 11px; + padding-left: 6px; + background: #1b213266; + color: #fff; + } + } + + .search-input { + position: relative; + } + .search-filter { + .filter-item { + /* width: 81px; */ + height: 40px; + border-radius: 12px; + border-width: 0.3px; + padding-top: 8px; + padding-right: 12px; + padding-bottom: 8px; + padding-left: 12px; + gap: 4px; + background-color: #fff; + border: 0.3px solid #e0e0e0; + box-shadow: 0px 1px 4px 0px #0000000d; + color: #8a92a8; + font-family: IRANSansX; + font-weight: 400; + font-size: 13px; + line-height: 20px; + letter-spacing: 0%; + text-align: right; + + &.active { + color: linear-gradient(102.02deg, #4be8ae 7.38%, #00a762 91.78%); + + * { + color: #fff; + } } } } - } - &.search-page { - &::before { - content: none; - } - .my-trailing-button { - width: 32px; - height: 32px; - } - .hadith-search-input { - height: 56px; + &.search-page { + &::before { + content: none; + } + .my-trailing-button { + width: 32px; + height: 32px; + } + .hadith-search-input { + height: 56px; + } } } } -.my-trailing-button { - position: absolute; - - z-index: 1; - width: 48px; - height: 48px; - justify-content: center; - align-items: center; - - padding: 0; - border-radius: 50px; - background: linear-gradient(320.71deg, #b9fde0 6.56%, #e4f9f0 69.69%); - left: 12px; - top: 0; - bottom: 0; - margin: auto; - transition: all 0.2s ease-in-out; - - &:hover { - transition: all 0.2s ease-in-out; - background: linear-gradient(320.71deg, #54ecaa 6.56%, #b6f0d9 69.69%); - } - - & > span { - width: 18px; - height: 18px; - - background-image: linear-gradient(102.02deg, #4be8ae 7.38%, #00a762 91.78%); - } -} -.hadith-search-input { - z-index: 0; - - height: 72px; - justify-content: space-between; - padding-top: 12px; - padding-right: 12px; - padding-bottom: 12px; - padding-left: 12px; - border-radius: 12px; - border-width: 0.3px; - - background-color: #fff; - border: 0.3px solid #e0e0e0; - box-shadow: 0px 1px 4px 0px #0000000d; - - font-family: IRANSansX; - font-weight: 300; - font-size: 14px; - line-height: 21px; - letter-spacing: 0%; - text-align: right; - color: #a7acbe; -} +</style> + +<style> +.hadith-search-root-wrapper { + .my-trailing-button { + position: absolute; + + z-index: 1; + width: 48px; + height: 48px; + justify-content: center; + align-items: center; + + padding: 0; + border-radius: 50px; + background: linear-gradient(320.71deg, #b9fde0 6.56%, #e4f9f0 69.69%); + left: 12px; + top: 0; + bottom: 0; + margin: auto; + transition: all 0.2s ease-in-out; + + &:hover { + transition: all 0.2s ease-in-out; + background: linear-gradient(320.71deg, #54ecaa 6.56%, #b6f0d9 69.69%); + } + + & > span { + width: 18px; + height: 18px; + + background-image: linear-gradient( + 102.02deg, + #4be8ae 7.38%, + #00a762 91.78% + ); + } + } + .hadith-search-input { + z-index: 0; + + height: 72px; + justify-content: space-between; + padding-top: 12px; + padding-right: 12px; + padding-bottom: 12px; + padding-left: 12px; + border-radius: 12px; + border-width: 0.3px; + + background-color: #fff; + border: 0.3px solid #e0e0e0; + box-shadow: 0px 1px 4px 0px #0000000d; + + font-family: IRANSansX; + font-weight: 300; + font-size: 14px; + line-height: 21px; + letter-spacing: 0%; + text-align: right; + color: #a7acbe; + } +} </style> diff --git a/components/hadith/CardList.vue b/components/hadith/CardList.vue new file mode 100644 index 0000000..853bb5a --- /dev/null +++ b/components/hadith/CardList.vue @@ -0,0 +1,147 @@ +<script setup> +const props = defineProps({ + list: { + default() { + return []; + }, + }, + noDataText: { + default: "نتیجهای یافت نشد!", + }, + noDataIcon: { + default: "/img/no-data.png", + }, +}); +</script> + +<template> + <div class="library-list-contianer"> + <div class="page-header flex items-center"> + <span class="title">کتابخانه</span> + <NuxtImg + fit="auto" + quality="80" + placeholder + src="/img/haditha-title.svg" + /> + </div> + + <div class="library-list grid grid-cols-5 gap-x-28 gap-y-12"> + <UCard + v-if="props.list.length" + v-for="(item, index) in props.list" + :key="index" + variant="solid" + :ui="{ + root: 'ring ring-[white] divide-y divide-[var(--ui-border)] rounded-0 shadow-none bg-transparent library-list-item', + header: 'header', + body: 'sm:p-0 p-0 bg-transparent', + footer: 'footer', + }" + > + <!-- <template #header></template> --> + + <ULink + :to="{ + name:'hadithLibraryShow', + params:{ + id:1, + slug:'اصول کافی-جلد 1' + } + }" + color="neutral" + variant="outline" + :ui="{ + leadingIcon: 'text-(--ui-primary)', + }" + @click="" + > + <NuxtImg + fit="auto" + quality="80" + placeholder + src="/img/sample-bgi.svg" + /> + <p class="title">اصول کافی</p> + <p class="version">جلد 1</p> + </ULink> + <!-- <template #footer> </template> --> + </UCard> + + <no-data + class="h-full w-full flex flex-col justify-center items-center" + v-else + > + <NuxtImg fit="auto" quality="80" placeholder :src="props.noDataIcon" /> + <p class="no-data-text">{{ props.noDataText }}</p> + </no-data> + </div> + </div> +</template> + +<style scoped> +.library-list-contianer { + margin-top: 10em; + max-width: 1200px; + width: 100%; + margin: 0 1em; + margin-right: auto; + margin-left: auto; + + .page-header { + margin-bottom: 2em; + .title { + margin-left: 0.4em; + font-family: IRANSansX; + font-weight: 300; + font-size: 24px; + line-height: 36px; + letter-spacing: 0%; + text-align: center; + + color: var(--ui-color-two); + } + } + + .library-list { + /* padding: 1em 1.3em; */ + height: calc(100dvh - 13.5em); + overflow-y: auto; + + .library-list-item { + width: 140; + height: 200; + border-radius: 8px; + + .title { + margin-top: 0.7em; + font-family: IRANSansX; + font-weight: 400; + font-size: 13px; + line-height: 19.5px; + letter-spacing: 0%; + text-align: right; + color: #444444; + } + + .version { + font-family: IRANSansX; + font-weight: 400; + font-size: 10px; + line-height: 15px; + letter-spacing: 0%; + text-align: right; + color: #444444; + } + } + } + .no-data-text { + font-family: IRANSansX; + font-weight: 300; + font-size: 16px; + line-height: 24px; + letter-spacing: 0%; + text-align: center; + } +} +</style> diff --git a/components/hadith/FooterMenu.vue b/components/hadith/FooterMenu.vue deleted file mode 100644 index f5e59db..0000000 --- a/components/hadith/FooterMenu.vue +++ /dev/null @@ -1,900 +0,0 @@ -<template> - <div class="my-content"> - <template v-if="viewMode == 'list'"> - <div class="row"> - <div class="col-12 main-content firefox-scrollbar"> - <template v-if="items.length"> - <div - class="mb-3 border-bottom main-content-item p-3" - v-for="(itemData, i) in items" - :key="i" - > - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-12" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div - class="search-item__actions" - v-if="schemaItems.actions?.length" - > - <span class="tavasi tavasi-more-vert"></span> - - <template v-for="(schema, indexIcon) in schemaItems.actions"> - <button - :key="'action' + indexIcon" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </template> - </div> - </div> - </template> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - <template v-if="viewMode == 'table'"> - <div class="row"> - <div class="col-12 px-0"> - <my-table - :key="reRender" - :height="'calc(-16em + 100vh)'" - :items="items" - :tableColumns="tableColumns" - :tableActions="tableActions" - :paginationInfo="page" - :sortingInfo="sorting" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @show-details="showDetailsHandler" - @copy-link="copyLinkHandler" - @on-linked-title-click="onOnLinkedTitleClick" - @show-text="showTextPage" - @actions="handlerActions" - :showHeaderSortButton="false" - class="my-table px-0 my-content-table" - > - </my-table> - </div> - </div> - </template> - <template v-if="viewMode == 'three-column-card'"> - <div class="row"> - <div class="col-12 main-content firefox-scrollbar"> - <div class="row" v-if="items.length"> - <div - class="mb-3 main-content-item p-3 col-4" - v-for="(itemData, i) in items" - :key="i" - > - <div class="d-flex"> - <img - class="img-fluid mx-auto w-50" - src="assets/common/img/default.svg" - alt="" - /> - </div> - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-3" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div class="search-item__actions" v-if="schemaItems.actions"> - <span class="tavasi tavasi-more-vert"></span> - - <button - :key="'action' + indexIcon" - v-for="(schema, indexIcon) in schemaItems.actions" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </div> - </div> - </div> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - <template v-if="viewMode == 'two-column-card'"> - <div class="row"> - <div class="col-6 main-content firefox-scrollbar"> - <template v-if="items.length"> - <div - class="mb-3 border-bottom main-content-item p-3" - v-for="(itemData, i) in items" - :key="i" - > - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-12" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div class="search-item__actions" v-if="schemaItems.actions"> - <span class="tavasi tavasi-more-vert"></span> - - <button - :key="'action' + indexIcon" - v-for="(schema, indexIcon) in schemaItems.actions" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </div> - </div> - </template> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - </div> -</template> - -<script> -// import HttpService from "@services/httpService"; -// import tableActions from "@search/json/listTableContextMenu"; -import favoriteApi from "~/apis/favoriteApi"; -import researchApi from "~/apis/researchApi"; - -import { mapState, mapActions } from "pinia"; -import { useSearchStore } from "~/stores/searchStore"; -import { useEntityStore } from "@search/stores/entityStore"; -import { useAuthStore } from "~/stores/authStore"; - -export default { - props: { - schemaItems: { - default() { - return []; - }, - }, - viewMode: { - default: "table", - }, - items: { - default() { - return []; - }, - }, - pagination: { - default() { - return {}; - }, - }, - tableColumns: { - default() { - return []; - }, - }, - tableActions: { - default() { - return []; - }, - }, - textSearch: { - default: "", - }, - }, - beforeMount() { - // this.httpService = new HttpService(process.env.VUE_APP_REPO_BASE_URL); - if (this.items) { - this.items.forEach((item) => { - if ( - !item._source.qanon_etebar || - item._source.qanon_etebar.trim() == "" - ) { - item._source.qanon_etebar = "معتبر"; - } - }); - } - }, - mounted() { - this.page = this.pagination; - this.setTableColumns(); - }, - watch: { - pagination(newVal) { - this.page = newVal; - }, - }, - data() { - return { - page: "", - curTableColumns: this.tableColumns, - // tableActions: tableActions, - reRender: 1, - sorting: { - sortby: "created", - sortorder: undefined, // asc | desc | none - }, - }; - }, - computed: { - ...mapState(useSearchStore, ["searchActiveTabGetter"]), - ...mapState(useAuthStore, ["isRealUser"]), - }, - methods: { - ...mapActions(useEntityStore, ["SET_ITEM_ENTITY", "SET_LIST_ENTITY"]), - openPrevent(item, isReadonly = true) { - this.$emit("ModalHandler", { item, isReadonly }); - }, - handlerActions(event) { - let key = event.rowAction.key; - if (key == "summary") this.$emit("changeCurrent", event.item); - else if (key == "copy") { - this.copyToClipboard( - "", - this.urlResolver( - event.item._id, - event.rowAction.link_route, - event.item - ) - ); - } else if (key == "tbookmark") { - this.AddToFavorites(event.item, event.rowAction, event.index); - } - }, - setTableColumns() { - if (this.tableColumns.length) this.curTableColumns = this.tableColumns; - else if (this.domainActiveGetter?.table_columns) - this.curTableColumns = this.domainActiveGetter?.table_columns; - }, - async AddToFavorites(item, icon, index) { - let sourceData = item; - icon.api_items.title.split(".").forEach((key) => { - if (sourceData[key]) sourceData = sourceData[key]; - }); - - if (item._source.tbookmark == 0) { - let url = favoriteApi.favorite.add; - url = url.replace("{{data_type}}", icon.api_items.data_type); - url = url.replace("{{ref_key}}", icon.api_items.ref_key); - const formData = { - ref_id: item[icon.api_items.id], - title: sourceData, - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - body: formData, - method: "post", - }); - - this.updateListAnswer(index, "tbookmark", 1); - } catch (err) {} - - // this.httpService.postRequest(url, formData).then((res) => { - // this.updateListAnswer(index, "tbookmark", 1); - // }); - } else { - // let url = favoriteApi.favorite.delete; - let url = favoriteApi.favorite.deleteByRefid; - url = url.replace("{{data_type}}", icon.api_items.data_type); - // url = url.replace("{{id}}", item[icon.api_items.id]); - url = url.replace("{{index_key}}", this.searchActiveTabGetter?.key); - url = url.replace("{{ref_id}}", item[icon.api_items.id]); - - []; - const formData = { - ref_id: item[icon.api_items.id], - title: sourceData, - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - body: formData, - method: "post", - }); - - this.updateListAnswer(index, "tbookmark", 0); - } catch (err) {} - - // this.httpService.postRequest(url, formData).then((res) => { - // this.updateListAnswer(index, "tbookmark", 0); - // }); - } - }, - updateListAnswer(index, key, value) { - if (index in this.items) { - if (key in this.items[index]["_source"]) - this.items[index]["_source"][key] = value; - this.reRender++; - } - }, - handlerActionsList(item, key, icon) { - if (key == "summary") this.$emit("changeCurrent", item); - else if (key == "copy") { - let keyid = icon.link_route.id; - let id = ""; - id = this.findvalueForKey(item, keyid); - - this.copyToClipboard("", this.urlResolver(id, icon.link_route, item)); - } else if (key == "SubjectForm") { - this.$emit("SubjectForm", item); - } else if (key == "edit") { - this.openPrevent({ item }, false); - } else if (key == "delete") { - this.deleteResearch(item, false); - } - }, - urlResolver(_id, route, item) { - let keyMain = ""; - let query_key = ""; - let query_value = ""; - let keys = ""; - let key = ""; - let query = { searchtext: this.textSearch ?? undefined }; - if (route?.query) { - let querys = route.query; - - if (typeof querys === "string") { - keys = route?.query.split("="); - - if (keys.length >= 2) { - query_key = keys[0]; - query_value = keys[1]; - } - if (query_key && query_value) { - query[query_key] = query_value; // کلید پویا و مقدار از قسمت بالایی - } - } else { - let newObject = {}; - for (const [key, value] of Object.entries(querys)) { - if (value in item) { - newObject[key] = item[value]; - } else { - newObject[key] = item?._source[value]; - } - } - Object.assign(query, newObject); - } - } - - if (route?.key_item || route.key) { - if (route?.key_item) key = this.getSourceData(item, route.key_item); - else key = route.key; - } - - const routeData = this.$router.resolve({ - path: "/search/show", - params: { - id: _id, - key: key, - }, - query: query, - }); - - return routeData.href; - }, - getSourceData(itemData, key) { - let sourceData = itemData; - key.split(".").forEach((key) => { - if (sourceData[key]) sourceData = sourceData[key]; - }); - - return sourceData; - }, - - getArrayData(itemData, collapseItem) { - if (!collapseItem.array_key) return [itemData]; - let sourceData = this.getSourceData(itemData, collapseItem.array_key); - if (!Array.isArray(sourceData)) return [itemData]; - - return sourceData; - }, - - showDetailsHandler(event) { - this.$emit("changeCurrent", this.items[event.index]); - }, - copyLinkHandler(event) { - let id = this.items[event]._id; - - this.copyToClipboard("", this.urlResolver(id)); - }, - findvalueForKey(item, keyName) { - let value = ""; - if (keyName in item) { - value = item[keyName]; - } else { - value = item?._source[keyName]; - } - return value; - }, - onOnLinkedTitleClick({ rowItem, tableColumn, index }) { - let valueId = this.findvalueForKey(rowItem, tableColumn.link_route.id); - let route = tableColumn.link_route; - // let href = this.urlResolver(valueId, tableColumn.link_route); - - let keyMain = ""; - let query_key = ""; - let query_value = ""; - let keys = ""; - let key = ""; - let query = { searchtext: this.textSearch ?? undefined }; - if (route?.query) { - let querys = route.query; - - if (typeof querys === "string") { - keys = route?.query.split("="); - - if (keys.length >= 2) { - query_key = keys[0]; - query_value = keys[1]; - } - if (query_key && query_value) { - query[query_key] = query_value; // کلید پویا و مقدار از قسمت بالایی - } - } else { - let newObject = {}; - for (const [key, value] of Object.entries(querys)) { - if (value in item) { - newObject[key] = item[value]; - } else { - newObject[key] = item?._source[value]; - } - } - Object.assign(query, newObject); - } - } - - if (route?.key_item || route.key) { - if (route?.key_item) key = this.getSourceData(item, route.key_item); - else key = route.key; - } - - this.$router.push({ - path: `/search/${key}/${valueId}`, - params: { - id: valueId, - key: key, - name:tableColumn?.link_route?.name - }, - query: query?.length ? query : undefined, - }); - - localStorage.setItem("myList", JSON.stringify(this.items)); - localStorage.setItem("myItem", JSON.stringify(rowItem)); - - this.SET_ITEM_ENTITY(rowItem); - this.SET_LIST_ENTITY(this.items); - - // window.open(href, "_blank"); - }, - showTextPage(event) {}, - async deleteResearch(item) { - this.mySwalConfirm({ - title: "هشدار!!!", - html: `از حذف <b>${item._source.text_subject}</b> اطمینان دارید؟ `, - icon: "warning", - }).then(async (result) => { - if (result.isConfirmed) { - let url = researchApi.research.deleteItem; - url = url.replace("{{index_key}}", item._source.ref_key); - url = url.replace("{{id}}", item._id); - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - method: "post", - }); - - this.mySwalToast({ - html: res.message, - }); - setTimeout(() => { - this.$emit("updateForDeleteResearch"); - }, 500); - } catch (err) {} - - // this.httpService.postRequest(url).then((res) => { - // }); - } - }); - }, - /** - * تغییر محدودیت صفحهبندی و ارسال آن با استفاده از رویداد - * @param {Object} paging - تنظیمات صفحهبندی - */ - pageLimitChanged(paging) { - this.resetPagination(); - this.page.limit = paging.limit; - - this.$emit("changePage", this.page); - }, - - /** - * تغییر صفحه فعلی و ارسال آن با استفاده از رویداد - * @param {Object} paging - تنظیمات صفحهبندی - */ - pageChanged(paging) { - let page = paging.pageNumber; - page -= 1; - this.page.offset = page * paging.limit; - this.page.limit = paging.limit; - this.page.page = paging.pageNumber; - - this.$emit("changePage", this.page); - }, - - /** - * تغییر مرتبسازی و ارسال آن با استفاده از رویداد - * @param {Object} sorting - تنظیمات مرتبسازی - */ - sortChanged(sorting) { - this.page.page = this.page.offset = 0; - this.sorting = sorting; - - this.$emit("changePage", this.sorting); - }, - - /** - * بازنشانی تنظیمات صفحهبندی به حالت اولیه - */ - resetPagination() { - this.page = { - pages: 0, - total: 0, - page: 1, - offset: 0, - limit: 10, - }; - }, - }, - components: { - lineContent: defineAsyncComponent(() => - import("@search/components/search/view/lineContent.vue") - ), - }, -}; -</script> - -<style lang="scss" scoped> -.main-content-item { - position: relative; - overflow: hidden; - &:hover, - &.active { - background-color: var(--list-background-color); - - .search-item__actions { - // width: 6.5em; - width: auto; - - transition: width 0.5s; - background: #fff; - border-radius: 0 0.5em 0.5em 0; - - .tavasi-more-vert { - transition: all 0.2s; - display: none; - } - } - } - .search-item__actions { - .btn { - font-size: 0.8rem; - } - } -} -.search-item__actions { - position: absolute; - left: 0; - width: 1.6em; - top: 1em; - // overflow: hidden; - transition: all 0.5s; - display: flex; - align-items: center; - - .btn { - display: flex; - align-items: center; - justify-content: center; - padding: 0.175rem 0.35rem; - - &:hover { - filter: brightness(0.7); - } - .icon-copy2 { - font-size: 0.8rem; - } - - &.favorites { - color: calc(--primary-color); - .icon-bookmark-1, - .icon-bookmark-2 { - height: 1.3em; - } - } - } -} -.main-content { - height: calc(100dvh - 15em); - overflow: auto; -} - -@media (max-width: 575.98px) { - .main-content { - height: calc(100dvh - 17em); - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { -} -@media only screen and (min-width: 768px) and (max-width: 900.98px) { -} -@media only screen and (min-width: 901px) and (max-width: 1049.98px) { -} -@media (min-width: 1050px) { -} -</style> diff --git a/components/hadith/LibraryTree.vue b/components/hadith/LibraryTree.vue deleted file mode 100644 index f5e59db..0000000 --- a/components/hadith/LibraryTree.vue +++ /dev/null @@ -1,900 +0,0 @@ -<template> - <div class="my-content"> - <template v-if="viewMode == 'list'"> - <div class="row"> - <div class="col-12 main-content firefox-scrollbar"> - <template v-if="items.length"> - <div - class="mb-3 border-bottom main-content-item p-3" - v-for="(itemData, i) in items" - :key="i" - > - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-12" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div - class="search-item__actions" - v-if="schemaItems.actions?.length" - > - <span class="tavasi tavasi-more-vert"></span> - - <template v-for="(schema, indexIcon) in schemaItems.actions"> - <button - :key="'action' + indexIcon" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </template> - </div> - </div> - </template> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - <template v-if="viewMode == 'table'"> - <div class="row"> - <div class="col-12 px-0"> - <my-table - :key="reRender" - :height="'calc(-16em + 100vh)'" - :items="items" - :tableColumns="tableColumns" - :tableActions="tableActions" - :paginationInfo="page" - :sortingInfo="sorting" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @show-details="showDetailsHandler" - @copy-link="copyLinkHandler" - @on-linked-title-click="onOnLinkedTitleClick" - @show-text="showTextPage" - @actions="handlerActions" - :showHeaderSortButton="false" - class="my-table px-0 my-content-table" - > - </my-table> - </div> - </div> - </template> - <template v-if="viewMode == 'three-column-card'"> - <div class="row"> - <div class="col-12 main-content firefox-scrollbar"> - <div class="row" v-if="items.length"> - <div - class="mb-3 main-content-item p-3 col-4" - v-for="(itemData, i) in items" - :key="i" - > - <div class="d-flex"> - <img - class="img-fluid mx-auto w-50" - src="assets/common/img/default.svg" - alt="" - /> - </div> - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-3" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div class="search-item__actions" v-if="schemaItems.actions"> - <span class="tavasi tavasi-more-vert"></span> - - <button - :key="'action' + indexIcon" - v-for="(schema, indexIcon) in schemaItems.actions" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </div> - </div> - </div> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - <template v-if="viewMode == 'two-column-card'"> - <div class="row"> - <div class="col-6 main-content firefox-scrollbar"> - <template v-if="items.length"> - <div - class="mb-3 border-bottom main-content-item p-3" - v-for="(itemData, i) in items" - :key="i" - > - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-12" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div class="search-item__actions" v-if="schemaItems.actions"> - <span class="tavasi tavasi-more-vert"></span> - - <button - :key="'action' + indexIcon" - v-for="(schema, indexIcon) in schemaItems.actions" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </div> - </div> - </template> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - </div> -</template> - -<script> -// import HttpService from "@services/httpService"; -// import tableActions from "@search/json/listTableContextMenu"; -import favoriteApi from "~/apis/favoriteApi"; -import researchApi from "~/apis/researchApi"; - -import { mapState, mapActions } from "pinia"; -import { useSearchStore } from "~/stores/searchStore"; -import { useEntityStore } from "@search/stores/entityStore"; -import { useAuthStore } from "~/stores/authStore"; - -export default { - props: { - schemaItems: { - default() { - return []; - }, - }, - viewMode: { - default: "table", - }, - items: { - default() { - return []; - }, - }, - pagination: { - default() { - return {}; - }, - }, - tableColumns: { - default() { - return []; - }, - }, - tableActions: { - default() { - return []; - }, - }, - textSearch: { - default: "", - }, - }, - beforeMount() { - // this.httpService = new HttpService(process.env.VUE_APP_REPO_BASE_URL); - if (this.items) { - this.items.forEach((item) => { - if ( - !item._source.qanon_etebar || - item._source.qanon_etebar.trim() == "" - ) { - item._source.qanon_etebar = "معتبر"; - } - }); - } - }, - mounted() { - this.page = this.pagination; - this.setTableColumns(); - }, - watch: { - pagination(newVal) { - this.page = newVal; - }, - }, - data() { - return { - page: "", - curTableColumns: this.tableColumns, - // tableActions: tableActions, - reRender: 1, - sorting: { - sortby: "created", - sortorder: undefined, // asc | desc | none - }, - }; - }, - computed: { - ...mapState(useSearchStore, ["searchActiveTabGetter"]), - ...mapState(useAuthStore, ["isRealUser"]), - }, - methods: { - ...mapActions(useEntityStore, ["SET_ITEM_ENTITY", "SET_LIST_ENTITY"]), - openPrevent(item, isReadonly = true) { - this.$emit("ModalHandler", { item, isReadonly }); - }, - handlerActions(event) { - let key = event.rowAction.key; - if (key == "summary") this.$emit("changeCurrent", event.item); - else if (key == "copy") { - this.copyToClipboard( - "", - this.urlResolver( - event.item._id, - event.rowAction.link_route, - event.item - ) - ); - } else if (key == "tbookmark") { - this.AddToFavorites(event.item, event.rowAction, event.index); - } - }, - setTableColumns() { - if (this.tableColumns.length) this.curTableColumns = this.tableColumns; - else if (this.domainActiveGetter?.table_columns) - this.curTableColumns = this.domainActiveGetter?.table_columns; - }, - async AddToFavorites(item, icon, index) { - let sourceData = item; - icon.api_items.title.split(".").forEach((key) => { - if (sourceData[key]) sourceData = sourceData[key]; - }); - - if (item._source.tbookmark == 0) { - let url = favoriteApi.favorite.add; - url = url.replace("{{data_type}}", icon.api_items.data_type); - url = url.replace("{{ref_key}}", icon.api_items.ref_key); - const formData = { - ref_id: item[icon.api_items.id], - title: sourceData, - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - body: formData, - method: "post", - }); - - this.updateListAnswer(index, "tbookmark", 1); - } catch (err) {} - - // this.httpService.postRequest(url, formData).then((res) => { - // this.updateListAnswer(index, "tbookmark", 1); - // }); - } else { - // let url = favoriteApi.favorite.delete; - let url = favoriteApi.favorite.deleteByRefid; - url = url.replace("{{data_type}}", icon.api_items.data_type); - // url = url.replace("{{id}}", item[icon.api_items.id]); - url = url.replace("{{index_key}}", this.searchActiveTabGetter?.key); - url = url.replace("{{ref_id}}", item[icon.api_items.id]); - - []; - const formData = { - ref_id: item[icon.api_items.id], - title: sourceData, - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - body: formData, - method: "post", - }); - - this.updateListAnswer(index, "tbookmark", 0); - } catch (err) {} - - // this.httpService.postRequest(url, formData).then((res) => { - // this.updateListAnswer(index, "tbookmark", 0); - // }); - } - }, - updateListAnswer(index, key, value) { - if (index in this.items) { - if (key in this.items[index]["_source"]) - this.items[index]["_source"][key] = value; - this.reRender++; - } - }, - handlerActionsList(item, key, icon) { - if (key == "summary") this.$emit("changeCurrent", item); - else if (key == "copy") { - let keyid = icon.link_route.id; - let id = ""; - id = this.findvalueForKey(item, keyid); - - this.copyToClipboard("", this.urlResolver(id, icon.link_route, item)); - } else if (key == "SubjectForm") { - this.$emit("SubjectForm", item); - } else if (key == "edit") { - this.openPrevent({ item }, false); - } else if (key == "delete") { - this.deleteResearch(item, false); - } - }, - urlResolver(_id, route, item) { - let keyMain = ""; - let query_key = ""; - let query_value = ""; - let keys = ""; - let key = ""; - let query = { searchtext: this.textSearch ?? undefined }; - if (route?.query) { - let querys = route.query; - - if (typeof querys === "string") { - keys = route?.query.split("="); - - if (keys.length >= 2) { - query_key = keys[0]; - query_value = keys[1]; - } - if (query_key && query_value) { - query[query_key] = query_value; // کلید پویا و مقدار از قسمت بالایی - } - } else { - let newObject = {}; - for (const [key, value] of Object.entries(querys)) { - if (value in item) { - newObject[key] = item[value]; - } else { - newObject[key] = item?._source[value]; - } - } - Object.assign(query, newObject); - } - } - - if (route?.key_item || route.key) { - if (route?.key_item) key = this.getSourceData(item, route.key_item); - else key = route.key; - } - - const routeData = this.$router.resolve({ - path: "/search/show", - params: { - id: _id, - key: key, - }, - query: query, - }); - - return routeData.href; - }, - getSourceData(itemData, key) { - let sourceData = itemData; - key.split(".").forEach((key) => { - if (sourceData[key]) sourceData = sourceData[key]; - }); - - return sourceData; - }, - - getArrayData(itemData, collapseItem) { - if (!collapseItem.array_key) return [itemData]; - let sourceData = this.getSourceData(itemData, collapseItem.array_key); - if (!Array.isArray(sourceData)) return [itemData]; - - return sourceData; - }, - - showDetailsHandler(event) { - this.$emit("changeCurrent", this.items[event.index]); - }, - copyLinkHandler(event) { - let id = this.items[event]._id; - - this.copyToClipboard("", this.urlResolver(id)); - }, - findvalueForKey(item, keyName) { - let value = ""; - if (keyName in item) { - value = item[keyName]; - } else { - value = item?._source[keyName]; - } - return value; - }, - onOnLinkedTitleClick({ rowItem, tableColumn, index }) { - let valueId = this.findvalueForKey(rowItem, tableColumn.link_route.id); - let route = tableColumn.link_route; - // let href = this.urlResolver(valueId, tableColumn.link_route); - - let keyMain = ""; - let query_key = ""; - let query_value = ""; - let keys = ""; - let key = ""; - let query = { searchtext: this.textSearch ?? undefined }; - if (route?.query) { - let querys = route.query; - - if (typeof querys === "string") { - keys = route?.query.split("="); - - if (keys.length >= 2) { - query_key = keys[0]; - query_value = keys[1]; - } - if (query_key && query_value) { - query[query_key] = query_value; // کلید پویا و مقدار از قسمت بالایی - } - } else { - let newObject = {}; - for (const [key, value] of Object.entries(querys)) { - if (value in item) { - newObject[key] = item[value]; - } else { - newObject[key] = item?._source[value]; - } - } - Object.assign(query, newObject); - } - } - - if (route?.key_item || route.key) { - if (route?.key_item) key = this.getSourceData(item, route.key_item); - else key = route.key; - } - - this.$router.push({ - path: `/search/${key}/${valueId}`, - params: { - id: valueId, - key: key, - name:tableColumn?.link_route?.name - }, - query: query?.length ? query : undefined, - }); - - localStorage.setItem("myList", JSON.stringify(this.items)); - localStorage.setItem("myItem", JSON.stringify(rowItem)); - - this.SET_ITEM_ENTITY(rowItem); - this.SET_LIST_ENTITY(this.items); - - // window.open(href, "_blank"); - }, - showTextPage(event) {}, - async deleteResearch(item) { - this.mySwalConfirm({ - title: "هشدار!!!", - html: `از حذف <b>${item._source.text_subject}</b> اطمینان دارید؟ `, - icon: "warning", - }).then(async (result) => { - if (result.isConfirmed) { - let url = researchApi.research.deleteItem; - url = url.replace("{{index_key}}", item._source.ref_key); - url = url.replace("{{id}}", item._id); - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - method: "post", - }); - - this.mySwalToast({ - html: res.message, - }); - setTimeout(() => { - this.$emit("updateForDeleteResearch"); - }, 500); - } catch (err) {} - - // this.httpService.postRequest(url).then((res) => { - // }); - } - }); - }, - /** - * تغییر محدودیت صفحهبندی و ارسال آن با استفاده از رویداد - * @param {Object} paging - تنظیمات صفحهبندی - */ - pageLimitChanged(paging) { - this.resetPagination(); - this.page.limit = paging.limit; - - this.$emit("changePage", this.page); - }, - - /** - * تغییر صفحه فعلی و ارسال آن با استفاده از رویداد - * @param {Object} paging - تنظیمات صفحهبندی - */ - pageChanged(paging) { - let page = paging.pageNumber; - page -= 1; - this.page.offset = page * paging.limit; - this.page.limit = paging.limit; - this.page.page = paging.pageNumber; - - this.$emit("changePage", this.page); - }, - - /** - * تغییر مرتبسازی و ارسال آن با استفاده از رویداد - * @param {Object} sorting - تنظیمات مرتبسازی - */ - sortChanged(sorting) { - this.page.page = this.page.offset = 0; - this.sorting = sorting; - - this.$emit("changePage", this.sorting); - }, - - /** - * بازنشانی تنظیمات صفحهبندی به حالت اولیه - */ - resetPagination() { - this.page = { - pages: 0, - total: 0, - page: 1, - offset: 0, - limit: 10, - }; - }, - }, - components: { - lineContent: defineAsyncComponent(() => - import("@search/components/search/view/lineContent.vue") - ), - }, -}; -</script> - -<style lang="scss" scoped> -.main-content-item { - position: relative; - overflow: hidden; - &:hover, - &.active { - background-color: var(--list-background-color); - - .search-item__actions { - // width: 6.5em; - width: auto; - - transition: width 0.5s; - background: #fff; - border-radius: 0 0.5em 0.5em 0; - - .tavasi-more-vert { - transition: all 0.2s; - display: none; - } - } - } - .search-item__actions { - .btn { - font-size: 0.8rem; - } - } -} -.search-item__actions { - position: absolute; - left: 0; - width: 1.6em; - top: 1em; - // overflow: hidden; - transition: all 0.5s; - display: flex; - align-items: center; - - .btn { - display: flex; - align-items: center; - justify-content: center; - padding: 0.175rem 0.35rem; - - &:hover { - filter: brightness(0.7); - } - .icon-copy2 { - font-size: 0.8rem; - } - - &.favorites { - color: calc(--primary-color); - .icon-bookmark-1, - .icon-bookmark-2 { - height: 1.3em; - } - } - } -} -.main-content { - height: calc(100dvh - 15em); - overflow: auto; -} - -@media (max-width: 575.98px) { - .main-content { - height: calc(100dvh - 17em); - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { -} -@media only screen and (min-width: 768px) and (max-width: 900.98px) { -} -@media only screen and (min-width: 901px) and (max-width: 1049.98px) { -} -@media (min-width: 1050px) { -} -</style> diff --git a/components/hadith/NavigationMenu.vue b/components/hadith/NavigationMenu.vue index 933fa51..fc641db 100644 --- a/components/hadith/NavigationMenu.vue +++ b/components/hadith/NavigationMenu.vue @@ -139,9 +139,10 @@ onMounted(() => { v-else raw :to="item.to" - class="w-full h-full flex justify-center items-center" + class="w-full flex justify-center items-center me-3" + active-class="text-(--color-white) bg-(--ui-primary) link-is-active" > - <UIcon :name="item.icon" class="size-7" /> + <UIcon :name="item.icon" class="size-6" /> </ULink> </template> </div> @@ -167,6 +168,10 @@ onMounted(() => { border: 0.3px solid #e0e0e0; box-shadow: 0px 4px 15px 0px #0000001a; + @media screen and (max-width: 991.99px) { + height: 76px; + } + nav > div { width: 100%; display: flex; @@ -221,6 +226,10 @@ onMounted(() => { color: #fff; } } + + @media screen and (max-width: 991.99px) { + height: 60px; + } } .hide-label { @@ -237,6 +246,30 @@ onMounted(() => { display: none; } } + + .link-is-active { + width: 64; + height: 60; + gap: 4px; + border-radius: 12px; + + padding-top: 16px; + padding-right: 18px; + padding-bottom: 16px; + padding-left: 18px; + + background: linear-gradient(102.02deg, #4be8ae 7.38%, #00a762 91.78%); + box-shadow: 0px 4px 10px 0px #00745933; + + // .icon { + // width: 24; + // height: 24; + // } + + * { + color: #fff; + } + } } } </style> diff --git a/components/hadith/SearchTopHeader.vue b/components/hadith/SearchTopHeader.vue deleted file mode 100644 index f5e59db..0000000 --- a/components/hadith/SearchTopHeader.vue +++ /dev/null @@ -1,900 +0,0 @@ -<template> - <div class="my-content"> - <template v-if="viewMode == 'list'"> - <div class="row"> - <div class="col-12 main-content firefox-scrollbar"> - <template v-if="items.length"> - <div - class="mb-3 border-bottom main-content-item p-3" - v-for="(itemData, i) in items" - :key="i" - > - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-12" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div - class="search-item__actions" - v-if="schemaItems.actions?.length" - > - <span class="tavasi tavasi-more-vert"></span> - - <template v-for="(schema, indexIcon) in schemaItems.actions"> - <button - :key="'action' + indexIcon" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </template> - </div> - </div> - </template> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - <template v-if="viewMode == 'table'"> - <div class="row"> - <div class="col-12 px-0"> - <my-table - :key="reRender" - :height="'calc(-16em + 100vh)'" - :items="items" - :tableColumns="tableColumns" - :tableActions="tableActions" - :paginationInfo="page" - :sortingInfo="sorting" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @show-details="showDetailsHandler" - @copy-link="copyLinkHandler" - @on-linked-title-click="onOnLinkedTitleClick" - @show-text="showTextPage" - @actions="handlerActions" - :showHeaderSortButton="false" - class="my-table px-0 my-content-table" - > - </my-table> - </div> - </div> - </template> - <template v-if="viewMode == 'three-column-card'"> - <div class="row"> - <div class="col-12 main-content firefox-scrollbar"> - <div class="row" v-if="items.length"> - <div - class="mb-3 main-content-item p-3 col-4" - v-for="(itemData, i) in items" - :key="i" - > - <div class="d-flex"> - <img - class="img-fluid mx-auto w-50" - src="assets/common/img/default.svg" - alt="" - /> - </div> - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-3" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div class="search-item__actions" v-if="schemaItems.actions"> - <span class="tavasi tavasi-more-vert"></span> - - <button - :key="'action' + indexIcon" - v-for="(schema, indexIcon) in schemaItems.actions" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </div> - </div> - </div> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - <template v-if="viewMode == 'two-column-card'"> - <div class="row"> - <div class="col-6 main-content firefox-scrollbar"> - <template v-if="items.length"> - <div - class="mb-3 border-bottom main-content-item p-3" - v-for="(itemData, i) in items" - :key="i" - > - <template v-if="itemData.inner_hits"> - <div - class="row" - v-for="(collapseItem, indexCollapse) in schemaItems - .collapse_items?.items || []" - :key="indexCollapse" - > - <template v-if="collapseItem.array_key"> - <div - class="col-12" - v-for="(subItemData, s) in getArrayData( - itemData, - collapseItem - )" - > - <lineContent - :lineSchema="collapseItem" - :itemData="subItemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </div> - </template> - <template v-else> - <lineContent - :lineSchema="collapseItem" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - > - </lineContent> - </template> - </div> - </template> - - <template v-else> - <div - v-if="schemaItems && schemaItems.items" - class="row" - v-for="(lineSchema, index) in schemaItems?.items || []" - :key="index" - > - <lineContent - :lineSchema="lineSchema" - :itemData="itemData" - :arrayItemData="items" - :textSearch="textSearch" - @openPrevent="openPrevent" - > - </lineContent> - </div> - </template> - <div class="search-item__actions" v-if="schemaItems.actions"> - <span class="tavasi tavasi-more-vert"></span> - - <button - :key="'action' + indexIcon" - v-for="(schema, indexIcon) in schemaItems.actions" - v-if="schema.key != 'tbookmark' || isRealUser" - :title="schema.title" - class="btn" - :type="schema.type" - > - <svg - v-if="schema.key == 'tbookmark'" - @click.pevent="AddToFavorites(itemData, schema, i)" - class="" - :class=" - itemData._source[schema.key] == 1 - ? 'icon icon-' + schema.toggle_icons.icon1 - : 'icon icon-' + schema.toggle_icons.icon2 - " - > - <use - :xlink:href=" - itemData._source[schema.key] == 1 - ? '#icon-' + schema.toggle_icons.icon1 - : '#icon-' + schema.toggle_icons.icon2 - " - ></use> - </svg> - <svg - @click="handlerActionsList(itemData, schema.key, schema)" - v-else - :class="'icon icon-' + schema.icon" - > - <use :xlink:href="'#icon-' + schema.icon"></use> - </svg> - </button> - </div> - </div> - </template> - <template v-else> - <table-no-data> </table-no-data> - </template> - </div> - </div> - <div class=""> - <jahat-pagination - class="border-0 w-100" - v-if="page.total" - :paginationInfo="page" - @page-changed="pageChanged" - @page-limit-changed="pageLimitChanged" - @sort-changed="sortChanged" - > - </jahat-pagination> - </div> - </template> - </div> -</template> - -<script> -// import HttpService from "@services/httpService"; -// import tableActions from "@search/json/listTableContextMenu"; -import favoriteApi from "~/apis/favoriteApi"; -import researchApi from "~/apis/researchApi"; - -import { mapState, mapActions } from "pinia"; -import { useSearchStore } from "~/stores/searchStore"; -import { useEntityStore } from "@search/stores/entityStore"; -import { useAuthStore } from "~/stores/authStore"; - -export default { - props: { - schemaItems: { - default() { - return []; - }, - }, - viewMode: { - default: "table", - }, - items: { - default() { - return []; - }, - }, - pagination: { - default() { - return {}; - }, - }, - tableColumns: { - default() { - return []; - }, - }, - tableActions: { - default() { - return []; - }, - }, - textSearch: { - default: "", - }, - }, - beforeMount() { - // this.httpService = new HttpService(process.env.VUE_APP_REPO_BASE_URL); - if (this.items) { - this.items.forEach((item) => { - if ( - !item._source.qanon_etebar || - item._source.qanon_etebar.trim() == "" - ) { - item._source.qanon_etebar = "معتبر"; - } - }); - } - }, - mounted() { - this.page = this.pagination; - this.setTableColumns(); - }, - watch: { - pagination(newVal) { - this.page = newVal; - }, - }, - data() { - return { - page: "", - curTableColumns: this.tableColumns, - // tableActions: tableActions, - reRender: 1, - sorting: { - sortby: "created", - sortorder: undefined, // asc | desc | none - }, - }; - }, - computed: { - ...mapState(useSearchStore, ["searchActiveTabGetter"]), - ...mapState(useAuthStore, ["isRealUser"]), - }, - methods: { - ...mapActions(useEntityStore, ["SET_ITEM_ENTITY", "SET_LIST_ENTITY"]), - openPrevent(item, isReadonly = true) { - this.$emit("ModalHandler", { item, isReadonly }); - }, - handlerActions(event) { - let key = event.rowAction.key; - if (key == "summary") this.$emit("changeCurrent", event.item); - else if (key == "copy") { - this.copyToClipboard( - "", - this.urlResolver( - event.item._id, - event.rowAction.link_route, - event.item - ) - ); - } else if (key == "tbookmark") { - this.AddToFavorites(event.item, event.rowAction, event.index); - } - }, - setTableColumns() { - if (this.tableColumns.length) this.curTableColumns = this.tableColumns; - else if (this.domainActiveGetter?.table_columns) - this.curTableColumns = this.domainActiveGetter?.table_columns; - }, - async AddToFavorites(item, icon, index) { - let sourceData = item; - icon.api_items.title.split(".").forEach((key) => { - if (sourceData[key]) sourceData = sourceData[key]; - }); - - if (item._source.tbookmark == 0) { - let url = favoriteApi.favorite.add; - url = url.replace("{{data_type}}", icon.api_items.data_type); - url = url.replace("{{ref_key}}", icon.api_items.ref_key); - const formData = { - ref_id: item[icon.api_items.id], - title: sourceData, - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - body: formData, - method: "post", - }); - - this.updateListAnswer(index, "tbookmark", 1); - } catch (err) {} - - // this.httpService.postRequest(url, formData).then((res) => { - // this.updateListAnswer(index, "tbookmark", 1); - // }); - } else { - // let url = favoriteApi.favorite.delete; - let url = favoriteApi.favorite.deleteByRefid; - url = url.replace("{{data_type}}", icon.api_items.data_type); - // url = url.replace("{{id}}", item[icon.api_items.id]); - url = url.replace("{{index_key}}", this.searchActiveTabGetter?.key); - url = url.replace("{{ref_id}}", item[icon.api_items.id]); - - []; - const formData = { - ref_id: item[icon.api_items.id], - title: sourceData, - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - body: formData, - method: "post", - }); - - this.updateListAnswer(index, "tbookmark", 0); - } catch (err) {} - - // this.httpService.postRequest(url, formData).then((res) => { - // this.updateListAnswer(index, "tbookmark", 0); - // }); - } - }, - updateListAnswer(index, key, value) { - if (index in this.items) { - if (key in this.items[index]["_source"]) - this.items[index]["_source"][key] = value; - this.reRender++; - } - }, - handlerActionsList(item, key, icon) { - if (key == "summary") this.$emit("changeCurrent", item); - else if (key == "copy") { - let keyid = icon.link_route.id; - let id = ""; - id = this.findvalueForKey(item, keyid); - - this.copyToClipboard("", this.urlResolver(id, icon.link_route, item)); - } else if (key == "SubjectForm") { - this.$emit("SubjectForm", item); - } else if (key == "edit") { - this.openPrevent({ item }, false); - } else if (key == "delete") { - this.deleteResearch(item, false); - } - }, - urlResolver(_id, route, item) { - let keyMain = ""; - let query_key = ""; - let query_value = ""; - let keys = ""; - let key = ""; - let query = { searchtext: this.textSearch ?? undefined }; - if (route?.query) { - let querys = route.query; - - if (typeof querys === "string") { - keys = route?.query.split("="); - - if (keys.length >= 2) { - query_key = keys[0]; - query_value = keys[1]; - } - if (query_key && query_value) { - query[query_key] = query_value; // کلید پویا و مقدار از قسمت بالایی - } - } else { - let newObject = {}; - for (const [key, value] of Object.entries(querys)) { - if (value in item) { - newObject[key] = item[value]; - } else { - newObject[key] = item?._source[value]; - } - } - Object.assign(query, newObject); - } - } - - if (route?.key_item || route.key) { - if (route?.key_item) key = this.getSourceData(item, route.key_item); - else key = route.key; - } - - const routeData = this.$router.resolve({ - path: "/search/show", - params: { - id: _id, - key: key, - }, - query: query, - }); - - return routeData.href; - }, - getSourceData(itemData, key) { - let sourceData = itemData; - key.split(".").forEach((key) => { - if (sourceData[key]) sourceData = sourceData[key]; - }); - - return sourceData; - }, - - getArrayData(itemData, collapseItem) { - if (!collapseItem.array_key) return [itemData]; - let sourceData = this.getSourceData(itemData, collapseItem.array_key); - if (!Array.isArray(sourceData)) return [itemData]; - - return sourceData; - }, - - showDetailsHandler(event) { - this.$emit("changeCurrent", this.items[event.index]); - }, - copyLinkHandler(event) { - let id = this.items[event]._id; - - this.copyToClipboard("", this.urlResolver(id)); - }, - findvalueForKey(item, keyName) { - let value = ""; - if (keyName in item) { - value = item[keyName]; - } else { - value = item?._source[keyName]; - } - return value; - }, - onOnLinkedTitleClick({ rowItem, tableColumn, index }) { - let valueId = this.findvalueForKey(rowItem, tableColumn.link_route.id); - let route = tableColumn.link_route; - // let href = this.urlResolver(valueId, tableColumn.link_route); - - let keyMain = ""; - let query_key = ""; - let query_value = ""; - let keys = ""; - let key = ""; - let query = { searchtext: this.textSearch ?? undefined }; - if (route?.query) { - let querys = route.query; - - if (typeof querys === "string") { - keys = route?.query.split("="); - - if (keys.length >= 2) { - query_key = keys[0]; - query_value = keys[1]; - } - if (query_key && query_value) { - query[query_key] = query_value; // کلید پویا و مقدار از قسمت بالایی - } - } else { - let newObject = {}; - for (const [key, value] of Object.entries(querys)) { - if (value in item) { - newObject[key] = item[value]; - } else { - newObject[key] = item?._source[value]; - } - } - Object.assign(query, newObject); - } - } - - if (route?.key_item || route.key) { - if (route?.key_item) key = this.getSourceData(item, route.key_item); - else key = route.key; - } - - this.$router.push({ - path: `/search/${key}/${valueId}`, - params: { - id: valueId, - key: key, - name:tableColumn?.link_route?.name - }, - query: query?.length ? query : undefined, - }); - - localStorage.setItem("myList", JSON.stringify(this.items)); - localStorage.setItem("myItem", JSON.stringify(rowItem)); - - this.SET_ITEM_ENTITY(rowItem); - this.SET_LIST_ENTITY(this.items); - - // window.open(href, "_blank"); - }, - showTextPage(event) {}, - async deleteResearch(item) { - this.mySwalConfirm({ - title: "هشدار!!!", - html: `از حذف <b>${item._source.text_subject}</b> اطمینان دارید؟ `, - icon: "warning", - }).then(async (result) => { - if (result.isConfirmed) { - let url = researchApi.research.deleteItem; - url = url.replace("{{index_key}}", item._source.ref_key); - url = url.replace("{{id}}", item._id); - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - method: "post", - }); - - this.mySwalToast({ - html: res.message, - }); - setTimeout(() => { - this.$emit("updateForDeleteResearch"); - }, 500); - } catch (err) {} - - // this.httpService.postRequest(url).then((res) => { - // }); - } - }); - }, - /** - * تغییر محدودیت صفحهبندی و ارسال آن با استفاده از رویداد - * @param {Object} paging - تنظیمات صفحهبندی - */ - pageLimitChanged(paging) { - this.resetPagination(); - this.page.limit = paging.limit; - - this.$emit("changePage", this.page); - }, - - /** - * تغییر صفحه فعلی و ارسال آن با استفاده از رویداد - * @param {Object} paging - تنظیمات صفحهبندی - */ - pageChanged(paging) { - let page = paging.pageNumber; - page -= 1; - this.page.offset = page * paging.limit; - this.page.limit = paging.limit; - this.page.page = paging.pageNumber; - - this.$emit("changePage", this.page); - }, - - /** - * تغییر مرتبسازی و ارسال آن با استفاده از رویداد - * @param {Object} sorting - تنظیمات مرتبسازی - */ - sortChanged(sorting) { - this.page.page = this.page.offset = 0; - this.sorting = sorting; - - this.$emit("changePage", this.sorting); - }, - - /** - * بازنشانی تنظیمات صفحهبندی به حالت اولیه - */ - resetPagination() { - this.page = { - pages: 0, - total: 0, - page: 1, - offset: 0, - limit: 10, - }; - }, - }, - components: { - lineContent: defineAsyncComponent(() => - import("@search/components/search/view/lineContent.vue") - ), - }, -}; -</script> - -<style lang="scss" scoped> -.main-content-item { - position: relative; - overflow: hidden; - &:hover, - &.active { - background-color: var(--list-background-color); - - .search-item__actions { - // width: 6.5em; - width: auto; - - transition: width 0.5s; - background: #fff; - border-radius: 0 0.5em 0.5em 0; - - .tavasi-more-vert { - transition: all 0.2s; - display: none; - } - } - } - .search-item__actions { - .btn { - font-size: 0.8rem; - } - } -} -.search-item__actions { - position: absolute; - left: 0; - width: 1.6em; - top: 1em; - // overflow: hidden; - transition: all 0.5s; - display: flex; - align-items: center; - - .btn { - display: flex; - align-items: center; - justify-content: center; - padding: 0.175rem 0.35rem; - - &:hover { - filter: brightness(0.7); - } - .icon-copy2 { - font-size: 0.8rem; - } - - &.favorites { - color: calc(--primary-color); - .icon-bookmark-1, - .icon-bookmark-2 { - height: 1.3em; - } - } - } -} -.main-content { - height: calc(100dvh - 15em); - overflow: auto; -} - -@media (max-width: 575.98px) { - .main-content { - height: calc(100dvh - 17em); - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { -} -@media only screen and (min-width: 768px) and (max-width: 900.98px) { -} -@media only screen and (min-width: 901px) and (max-width: 1049.98px) { -} -@media (min-width: 1050px) { -} -</style> diff --git a/components/hadith/hero-page/SectionOne.vue b/components/hadith/hero-page/SectionOne.vue index 1ca812c..000c736 100644 --- a/components/hadith/hero-page/SectionOne.vue +++ b/components/hadith/hero-page/SectionOne.vue @@ -1,9 +1,9 @@ <template> <section class="section-one flex flex-col justify-center"> - <div class="bg-container h-full" :style="backgroundImageStyle"> + <div class="background-image h-full" :style="backgroundImageStyle"> <navigation-menu></navigation-menu> - <div class="text-logo flex justify-center flex-col items-center"> + <div class="logo-container flex justify-center flex-col items-center"> <NuxtImg fit="auto" quality="80" placeholder src="/img/logo.png" /> <div class="title"> کاوش با @@ -49,16 +49,16 @@ export default { </script> <style scoped> .section-one { - .bg-container { + .background-image { height: 521px; background-size: 100% auto; background-repeat: no-repeat; - /* background-attachment: fixed; */ + background-attachment: fixed; /* background-image: url("/img/background.svg"), linear-gradient(199.05deg, #ffffff 9.99%, #e4fff7 42.07%, #ffffff 97.12%); */ } - .text-logo { + .logo-container { padding-top: 10em; position: relative; @@ -69,7 +69,7 @@ export default { line-height: 21px; letter-spacing: 0%; text-align: center; - color: #1b2132; + color: var(--ui-color-two); } .badge-style { width: 100; diff --git a/components/hadith/hero-page/SectionTwo.vue b/components/hadith/hero-page/SectionTwo.vue index 34324c6..be83649 100644 --- a/components/hadith/hero-page/SectionTwo.vue +++ b/components/hadith/hero-page/SectionTwo.vue @@ -68,9 +68,7 @@ </div> </section> </template> -<script> -export default {}; -</script> +<script></script> <style scoped> .section-two { font-weight: 200; @@ -93,7 +91,7 @@ export default {}; font-size: 24px; line-height: 36px; letter-spacing: 0%; - color: #1b2132; + color: var(--ui-color-two); text-align: right; } diff --git a/components/hadith/library-show/AccordionMenu..vue b/components/hadith/library-show/AccordionMenu..vue new file mode 100644 index 0000000..281a6f1 --- /dev/null +++ b/components/hadith/library-show/AccordionMenu..vue @@ -0,0 +1,183 @@ +<script setup> +const props = defineProps({ + list: { + default() { + return []; + }, + }, + noDataText: { + default: "نتیجهای یافت نشد!", + }, + noDataIcon: { + default: "/img/no-data.png", + }, +}); + +const items = [ + { + label: "Parent 1", + content: "This is the content of Parent 1", + children: [ + { + label: "Child 1.1", + content: "This is the content of Child 1.1", + }, + { + label: "Child 1.2", + content: "This is the content of Child 1.2", + }, + ], + }, + { + label: "Parent 2", + content: "This is the content of Parent 2", + children: [ + { + label: "Child 2.1", + content: "This is the content of Child 2.1", + }, + { + label: "Child 2.2", + content: "This is the content of Child 2.2", + }, + ], + }, +]; + +function toggleAccordion(id) { + const allHiddenClasses = querySelectorAll(".hidden"); + console.info(element); + + allHiddenClasses.forEach((element) => { + console.info(element); + // element.classList.remove('hidden') + }); + const content = document.getElementById(`content-${id}`); + const icon = document.getElementById(`icon-${id}`); + + // Toggle visibility + content.classList.toggle("hidden"); + // Rotate icon + icon.classList.toggle("rotate-180"); +} +</script> + +<template> + <div class="accordion-menu max-w-xl mx-auto p-4"> + <!-- Parent Accordion Item 1 --> + <div class="mb-2"> + <button + class="w-full flex justify-between items-center p-4 bg-gray-100 rounded-lg hover:bg-gray-200 transition-all delay-500 duration-300 ease-in-out" + @click.prevent="toggleAccordion('parent1')" + > + <span>Parent 1</span> + <svg + id="icon-parent1" + class="w-5 h-5 transform transition-transform" + fill="none" + stroke="currentColor" + viewBox="0 0 24 24" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2" + d="M19 9l-7 7-7-7" + /> + </svg> + </button> + <div + id="content-parent1" + class="mt-2 pl-4 hidden transition delay-500 duration-300 ease-in-out" + > + <!-- Child Accordion Item 1 --> + <div class="mb-2 transition delay-500 duration-300 ease-in-out"> + <button + class="w-full flex justify-between items-center p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-all" + @click.prevent="toggleAccordion('child1')" + > + <span>Child 1.1</span> + <svg + id="icon-child1" + class="w-5 h-5 transform transition-transform" + fill="none" + stroke="currentColor" + viewBox="0 0 24 24" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2" + d="M19 9l-7 7-7-7" + /> + </svg> + </button> + <div id="content-child1" class="mt-2 pl-4 hidden"> + <p class="p-3 bg-gray-50 rounded-lg"> + This is the content of Child 1.1. + </p> + </div> + </div> + <!-- Child Accordion Item 2 --> + <div class="mb-2 transition delay-500 duration-300 ease-in-out"> + <button + class="w-full flex justify-between items-center p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-all" + @click.prevent="toggleAccordion('child2')" + > + <span>Child 1.2</span> + <svg + id="icon-child2" + class="w-5 h-5 transform transition-transform" + fill="none" + stroke="currentColor" + viewBox="0 0 24 24" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2" + d="M19 9l-7 7-7-7" + /> + </svg> + </button> + <div id="content-child2" class="mt-2 pl-4 hidden"> + <p class="p-3 bg-gray-50 rounded-lg"> + This is the content of Child 1.2. + </p> + </div> + </div> + </div> + </div> + + <!-- Parent Accordion Item 2 --> + <div class="mb-2"> + <button + class="w-full flex justify-between items-center p-4 bg-gray-100 rounded-lg hover:bg-gray-200 transition-all" + @click.prevent="toggleAccordion('parent2')" + > + <span>Parent 2</span> + <svg + id="icon-parent2" + class="w-5 h-5 transform transition-transform" + fill="none" + stroke="currentColor" + viewBox="0 0 24 24" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2" + d="M19 9l-7 7-7-7" + /> + </svg> + </button> + <div id="content-parent2" class="mt-2 pl-4 hidden"> + <p class="p-3 bg-gray-50 rounded-lg"> + This is the content of Parent 2. + </p> + </div> + </div> + </div> +</template> + +<style scoped></style> diff --git a/components/hadith/search-page/SearchList.vue b/components/hadith/search-page/SearchList.vue index 46e3dad..09da5f1 100644 --- a/components/hadith/search-page/SearchList.vue +++ b/components/hadith/search-page/SearchList.vue @@ -5,11 +5,14 @@ const props = defineProps({ return []; }, }, + noDataText: { + default: "نتیجهای یافت نشد!", + }, + noDataIcon: { + default: "/img/no-data.png", + }, }); - -const SearchShow = defineAsyncComponent(() => - import("@hadith/components/hadith/search-page/SearchShow.vue") -); +const route = useRoute(); const modal = useModal(); const isModalOpen = ref(false); @@ -27,6 +30,11 @@ function resetModal() { function updateModalTitle() { modal.patch({ title: "Updated Title" }); } + +// components declaration +const SearchShow = defineAsyncComponent(() => + import("@hadith/components/hadith/search-page/SearchShow.vue") +); </script> <template> @@ -36,8 +44,9 @@ function updateModalTitle() { نتیجه </div> - <div class="search-list"> + <div class="search-list" :class="route.name"> <div + v-if="props.list.length" class="search-list-item" v-for="(item, index) in props.list" :key="index" @@ -55,6 +64,14 @@ function updateModalTitle() { <p class="reference">الکافی، جلد ۱، صفحه ۱۰۳</p> </div> </div> + + <no-data + class="h-full w-full flex flex-col justify-center items-center" + v-else + > + <NuxtImg fit="auto" quality="80" placeholder :src="props.noDataIcon" /> + <p class="no-data-text">{{ props.noDataText }}</p> + </no-data> </div> <UModal @@ -104,6 +121,10 @@ function updateModalTitle() { height: calc(100dvh - 15.2em); overflow-y: auto; + &.hadithFavorites { + height: calc(100dvh - 8em); + } + &:not(:last-child) { border-bottom: 0.3px solid #d9d9d9; } @@ -133,7 +154,7 @@ function updateModalTitle() { line-height: 32px; letter-spacing: 0%; text-align: right; - color: #1b2132; + color: var(--ui-color-two); margin-bottom: 0.5em; &:hover, @@ -181,6 +202,14 @@ function updateModalTitle() { } } } + .no-data-text { + font-family: IRANSansX; + font-weight: 300; + font-size: 16px; + line-height: 24px; + letter-spacing: 0%; + text-align: center; + } } </style> @@ -189,14 +218,14 @@ function updateModalTitle() { border: 0.3px solid #e0e0e0; box-shadow: 0px 8px 20px 0px #0000001a; background: #ffffff; - + width: 100%; + max-width: 720px; border-radius: 16px; gap: 8px; border-width: 0.3px; .modal-body { border-radius: 16px; - width: 100%; - max-width: 720px; + height: 800px; position: relative; diff --git a/components/hadith/search-page/SearchShow.vue b/components/hadith/search-page/SearchShow.vue index f28ed00..23f0e45 100644 --- a/components/hadith/search-page/SearchShow.vue +++ b/components/hadith/search-page/SearchShow.vue @@ -84,7 +84,8 @@ const closeModal = () => { <span class="section-title"> ترجمه </span> <UButton variant="ghost" class="copy-btn" label="کپی" /> </div> - <p class="font-bold">امام جعفر صادق علیهالسلام:</p> + + <p class="from">امام جعفر صادق علیهالسلام:</p> <p class="persian-text"> انسان دانش میآموزد تا بداند، و میداند تا عمل کند، و عمل میکند تا به سبب آن شناخته شود، و شناخته میشود تا (عمل او) @@ -100,13 +101,13 @@ const closeModal = () => { <span class="section-title"> شرح </span> <UButton variant="ghost" class="copy-btn" label="کپی" /> </div> - <p> + <p class="description-item"> این حدیث به سلسله مراتب علم و عمل اشاره دارد و تأکید میکند که علم باید به عمل منتهی شود و عمل نیز باید با نیت خالص و برای رضای خداوند باشد تا مورد قبول واقع شود و انسان را به سعادت ابدی برساند. </p> - <p> + <p class="description-item"> این حدیث به سلسله مراتب علم و عمل اشاره دارد و تأکید میکند که علم باید به عمل منتهی شود و عمل نیز باید با نیت خالص و برای رضای خداوند باشد تا مورد قبول واقع شود و انسان را به سعادت @@ -157,6 +158,7 @@ const closeModal = () => { </div> </template> +<!-- because of the buttons, using without scoped. --> <style> .search-show-modal { .body-header { @@ -165,7 +167,8 @@ const closeModal = () => { margin-bottom: 2.5em; .close-btn { - color: #1b2132; + color: var(--ui-color-two); + /* width: 24px; */ /* height: 24px; */ padding: 0.2em; @@ -244,11 +247,7 @@ const closeModal = () => { .section-header { display: flex; justify-content: space-between; - font-family: IRANSansX; - font-weight: 300; - font-size: 12px; - line-height: 18px; - letter-spacing: 0%; + text-align: right; margin-bottom: 0.5em; @@ -314,7 +313,8 @@ const closeModal = () => { line-height: 32px; letter-spacing: 0%; text-align: right; - color: #1b2132; + color: var(--ui-color-two); + margin-bottom: 0.5em; } } @@ -322,7 +322,20 @@ const closeModal = () => { .text-persian-section { padding: 2em 0; + .section-header { + } + + .from, .persian-text { + font-family: Takrim; + font-weight: 400; + font-size: 18px; + line-height: 30px; + letter-spacing: 0%; + text-align: right; + color: var(--ui-color-two); + } + /* .persian-text { font-family: Takrim; font-weight: 400; font-size: 16px; @@ -331,14 +344,21 @@ const closeModal = () => { text-align: right; color: #626b84; margin-bottom: 0.5em; - } + } */ } .text-description-section { padding: 2em 0; - .reference { - padding: 2em 0; + .description-item { + font-family: Takrim; + font-weight: 400; + font-size: 18px; + line-height: 30px; + letter-spacing: 0%; + text-align: right; + color: var(--ui-color-two); + /* height: 24px; gap: 4px; padding-top: 4px; @@ -355,7 +375,7 @@ const closeModal = () => { line-height: 15px; letter-spacing: 0%; text-align: right; - color: #8a92a8; + color: #8a92a8; */ } } @@ -406,7 +426,7 @@ const closeModal = () => { line-height: 22.5px; letter-spacing: 0%; text-align: right; - color: #1b2132; + color: var(--ui-color-two); } .explore-btn { width: 118; @@ -450,7 +470,7 @@ const closeModal = () => { line-height: 20px; letter-spacing: 0%; text-align: right; - color: #1b2132; + color: var(--ui-color-two); } .next-hadith { font-family: IRANSansX; @@ -459,7 +479,7 @@ const closeModal = () => { line-height: 20px; letter-spacing: 0%; text-align: right; - color: #1b2132; + color: var(--ui-color-two); } } } diff --git a/layouts/HadithLayout.vue b/layouts/HadithLayout.vue index 8f6b8b7..f4241f4 100644 --- a/layouts/HadithLayout.vue +++ b/layouts/HadithLayout.vue @@ -1,5 +1,8 @@ <script setup> import { clearBodyClass } from "@manuals/utilities"; +definePageMeta({ + layout: false, +}); onMounted(() => { clearBodyClass(); @@ -14,4 +17,4 @@ onUnmounted(() => { <slot name="named-slot"></slot> <slot></slot> </main> -</template> \ No newline at end of file +</template> diff --git a/pages/hadith/(show)/EntityAddDraft.vue b/pages/hadith/(show)/EntityAddDraft.vue deleted file mode 100644 index c311b30..0000000 --- a/pages/hadith/(show)/EntityAddDraft.vue +++ /dev/null @@ -1,512 +0,0 @@ -<template> - <div class="d-flex flex-column" style="min-height: calc(100dvh - 4em)"> - <div class="container-fluid flex-grow-1 d-flex flex-column"> - <div class="row"> - <div class="col-12 py-3 border-bottom mb-3"> - <div class="row"> - <div class="col-auto"> - <div class="d-flex align-items-center"> - <router-link - class="btn btn-primary" - :to="{ - name: 'lawDraftList', - }" - > - <svg class="icon icon-forward-2"> - <use xlink:href="#icon-forward-2"></use> - </svg> - بازگشت - </router-link> - <div class="d-flex flex-column align-items-start me-2"> - <h4 class="m-0"> - {{ "ثبت " + draftActiveSchemaGetter?.label }} - </h4> - <p - v-if="draftActiveSchemaGetter?.tabs?.length" - class="text__light text__13 d-none d-md-block mb-0" - > - شما در مرحله ({{ - draftActiveSchemaGetter?.tabs[currentStep].title - }})هستید. - </p> - </div> - </div> - </div> - <div class="col" v-if="Boolean(entity?.islock)"> - <div class="d-flex"> - <div class="alert alert-warning mb-0 py-1" role="alert"> - داده جاری به دلیل ثبت نهایی قفل شده است و قابل تغییر نمی باشد. - - <button - @click.prevent="unlockLawModal" - class="btn btn-primary me-3" - > - بازکردن کردن قفل - </button> - </div> - </div> - </div> - </div> - </div> - <div class="col-12 steps-and-prev-next-box"> - <div class="row align-items-center"> - <div class="col-auto"> - <button - @click.prevent="prevStep" - type="button" - class="btn btn-primary" - > - <svg class="icon icon-Component-71--1"> - <use xlink:href="#icon-Component-71--1"></use> - </svg> - قبلی - </button> - </div> - <div class="col"> - <wizard - :currentStepProp="currentStep" - :steps="draftActiveSchemaGetter?.tabs" - @step-changed="onStepChanged" - ></wizard> - <p - v-if="draftActiveSchemaGetter?.tabs?.length" - class="text__light text__13 d-block d-md-none d-flex justify-content-center mt-2" - > - شما در مرحله ({{ - draftActiveSchemaGetter?.tabs[currentStep].title - }})هستید. - </p> - </div> - <div class="col-auto"> - <button - @click.prevent="nextStep" - type="button" - class="btn btn-primary" - - > - <svg class="icon icon-Component-71--1" style="transform: rotate(180deg);"> - <use xlink:href="#icon-Component-71--1"></use> - </svg> - بعدی - </button> - </div> - </div> - </div> - </div> - <div class="row flex-grow-1 overflow-auto mt-md-5"> - <div class="col"> - <component - :key="renderComponent" - :formElements="formElements" - :entity="entity" - :entityProp="entity" - :is="activeComponent" - @saveProperty="saveProperty" - @lock-component="lockComponent" - ref="formRef" - ></component> - </div> - </div> - </div> - <!-- <div class="row"> - <div class="col-12 d-flex justify-content-between border-top mt-2"> - <div class="col-auto align-self-end mt-3"> - <button - @click.prevent="prevStep" - type="button" - class="btn btn-primary" - > - <svg class="icon icon-Component-71--1"> - <use xlink:href="#icon-Component-71--1"></use> - </svg> - قبلی - </button> - </div> - <div class="col-auto align-self-end mt-3"> - <button - @click.prevent="nextStep" - type="button" - class="btn btn-primary" - > - <svg class="icon icon-Component-71--2"> - <use xlink:href="#icon-Component-71--2"></use> - </svg> - بعدی - </button> - </div> - </div> - </div> --> - </div> -</template> - -<script> -import { mapState, mapActions } from "pinia"; - -import entityApi from "~/apis/entityApi"; -import repoApi from "~/apis/repoApi"; - -export default { - props: { - }, - beforeMount() { - this.httpService = new HttpService(import.meta.env.VITE_BASE_URL); - }, - mounted() { - let schemaExist = typeof this.draftSchemaGetter == "object"; - - if (!schemaExist) { - this.getSchemas().then(() => { - this.initData(); - }); - } else { - this.initData(); - } - - if (window.outerWidth < 992) { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - } - - // setDocumentTitle(); - }, - data() { - return { - currentStep: 0, - httpService: undefined, - activeComponent: "", - entity: {}, - data_changed: {}, - renderComponent: 1, - }; - }, - computed: { - ...mapState([ - "organNameGetter", - ]), - ...mapState("entity", [ - "draftSchemaGetter", - "draftActiveSchemaGetter", - "draftActiveStepGetter", - ]), - ...mapState(["isSidebarCollapsed", "currentUser"]), - sidbarMenu() { - if (isMajlesBuild()) return this.sidbarMenuMajles; - else return this.sidbarMenuDefault; - }, - formElements() { - if ( - this.draftActiveSchemaGetter && - this.draftActiveSchemaGetter.tabs && - this.draftActiveSchemaGetter.tabs.length - ) - return this.draftActiveSchemaGetter?.tabs[this.currentStep].items; - return []; - }, - }, - methods: { - ...mapActions("entity", [ - "SET_ITEM_ENTITY", - "draftSchemaSetter", - "draftActiveSchemaSetter", - "draftActiveStepSetter", - ]), - ...mapActions(["TOGGLE_PANEL"]), - - lockComponent(islock = 1){ - this.entity["islock"]=islock; - // console.log(islock) - // console.log(this.entity) - // islock - this.renderComponent++; - }, - unlockLawModal() { - const html = - "با این عملیات، شما تمامی داده های مرتبط با این قانون و آثار تنقیحی آن را از مخزن اصلی حذف کرده و به مرحله قبل ثبت نهایی می رسانید. آیا مطئن به حذف داده های مذکور از مخزن اصلی هستید ؟!"; - this.mySwalConfirm({ - title: "هشدار!!!", - html: html, - icon: "error", - }).then((result) => { - if (result.isConfirmed) { - this.unlockLaw(); - } - }); - }, - async unlockLaw() { - let to_key = this.draftActiveStepGetter?.to_index_key; - - let url = ""; - url = repoUrl() + repoApi.entity.draftUnlock; - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", this.draftActiveStepGetter.key); - url = url.replace("{{entity_id}}", this.entity?._id); - url = url.replace("{{to_index_key}}", to_key); - - return await this.httpService - .postRequest(url, {}) - .then((res) => { - this.entity = res._source; - this.entity["_id"] = res._id; - this.entity["id"] = res._id; - this.renderComponent++; - - this.mySwalToast({ - html: res?.message ?? "با موفقیت عملیات انجام شد .", - }); - }) - .catch((err) => { - this.fetchingData = false; - return err; - }); - }, - initData() { - let ativeSchema = this.draftSchemaGetter.find( - (item) => item.key == "new" - ); - - this.draftActiveSchemaSetter(ativeSchema); - this.draftActiveStepSetter(ativeSchema.tabs[this.currentStep]); - this.getEntityInfo(); - }, - // /** - // * دریافت اطلاعات موجودیت بر اساس نوع و شناسه آن. - // * @param {String} _entityType - نوع موجودیت. - // * @param {String} _entityId - شناسه موجودیت. - // */ - - getEntityInfo() { - if (this.fetchingData) return; - this.fetchingData = true; - - let id = this.$route.params?.id; - - if (!id) { - this.entity = {}; - this.currentStep = 0; - this.fetchingData = false; - this.onStepChanged( - this.draftActiveSchemaGetter?.tabs[this.currentStep] - ); - this.renderComponent++; - return; - } - - // let key = this.$route.params.key; - let key = this.draftActiveSchemaGetter?.index_key; - - let url = repoUrl() + repoApi.public.get; - url = url.replace("{{index_key}}", key); - url = url.replace("{{entity_id}}", id); - - this.httpService.getRequest(url).then((res) => { - this.entity = res._source; - this.entity["_id"] = res._id; - this.entity["id"] = res._id; - - this.currentStep = this.entity.step; - this.fetchingData = false; - - this.onStepChanged( - this.draftActiveSchemaGetter?.tabs[this.currentStep] - ); - this.renderComponent++; - }); - }, - - async saveProperty() { - if (this.fetchingData) return; - this.fetchingData = true; - - let dataChanged = {}; - if (!this.$refs.formRef?.isChanged()) - dataChanged["step"] = this.currentStep; - else { - dataChanged = this.$refs.formRef.formData; - dataChanged["step"] = this.currentStep; - } - - // اگر تغییری نداشته باشیم، meta به صورت "{}" خواهد بود. - if (!dataChanged && !JSON.stringify(dataChanged).length > 2) return; - - let id = this.$route.params.id ?? this.entity._id; - - // if (this.$route.params.id) { - // id = this.$route.params.id ?? undefined; - // } else id = this.entity._id ?? undefined; - - let url = ""; - if (id) { - url = repoUrl() + repoApi.public.updateEntity; - url = url.replace("{{id}}", id); - } else { - url = repoUrl() + repoApi.public.addEntity; - // let r = Math.random() * (99); - // id = "df" + new Date().toLocaleDateString("fa-IR") + r - } - - let key = this.draftActiveSchemaGetter?.index_key; - url = url.replace("{{index_key}}", key); - - let formData = dataChanged; - - return await this.httpService - .postRequest(url, formData) - .then((res) => { - this.entity = res._source; - this.entity["_id"] = res._id; - this.entity["id"] = res._id; - - this.mySwalToast({ - html: res?.message ?? "با موفقیت ثبت شد.", - }); - this.fetchingData = false; - return true; - }) - .catch((err) => { - this.fetchingData = false; - return err; - }); - }, - nextStep() { - let step = this.currentStep + 1; - if (step >= this.draftActiveSchemaGetter?.tabs.length) return; - if (!this.draftActiveSchemaGetter?.tabs[step]) return; - - if (this.currentStep == 1) { - this.$refs.formRef?.setLastChangedData(); - } - - if ( - this.$refs.formRef?.isChanged() && - this.currentStep != 2 && - this.currentStep < this.entity.step - ) { - this.mySwalConfirm({ - title: "هشدار!!!", - html: `با تغییراتی که در اطلاعات این مرحله دادید، چنانچه در مراحل بعدی قبلا تغییر داشتید ، ممکن است از دست برود `, - icon: "warning", - }).then((result) => { - if (result.isConfirmed) { - this.currentStep = step; - this.saveProperty().then(() => { - this.onStepChanged(this.draftActiveSchemaGetter?.tabs[step]); - }); - } - }); - } else { - this.currentStep = step; - this.saveProperty().then(() => { - this.onStepChanged(this.draftActiveSchemaGetter?.tabs[step]); - }); - } - }, - prevStep() { - let step = this.currentStep - 1; - if (step < 0) return; - - if (this.draftActiveSchemaGetter?.tabs[step]) - this.onStepChanged(this.draftActiveSchemaGetter?.tabs[step]); - }, - onStepChanged(stepItem) { - console.log(stepItem) - if (!stepItem) return; - this.activeComponent = stepItem.componentName; - this.currentStep = stepItem.step; - this.draftActiveStepSetter(stepItem); - }, - - /** - * دریافت اطلاعات schema. - */ - async getSchemas() { - let url = repoUrl() + entityApi.schema.list; - - return await this.httpService - .postRequest(url, { - organ: this.organNameGetter, - system: "edit", - }) - .then((response) => { - // console.log(response.data.edit); - this.draftSchemaSetter(response.data.edit); - let sch = response.data.edit.find((item) => item.key == "new"); - if (sch) this.draftActiveSchemaSetter(sch); - // this.draftActiveSchemaSetter(response.data.edit[0]); - }) - - }, - /** - * تغییر وضعیت نمایش منوی سایدبار. - */ - toggleSidebarMenu() { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - }, - }, - - -}; -</script> -<style scoped lang="scss"> -.nav-tabs-container { - display: flex; - justify-content: center; -} -.filter-list-container { - // padding-top: 0.5em; - // // position: fixed; - - // z-index: 9; - // width: 20em; - height: 100dvh; - .main-filter { - display: none; - } - .mobile-mode { - display: flex; - justify-content: flex-end; - - .btn { - border-radius: 50%; - // font-size: 0.7rem; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - display: flex; - justify-content: center; - align-items: center; - transform: translateX(1.5em); - background-color: #eee; - - &:hover { - filter: brightness(0.8); - } - } - } - - &.expanded { - top: 0; - bottom: 0; - background: #fff; - justify-content: center; - box-shadow: -1px 0px 7px 1px #eee; - width: 20em; - .main-filter { - display: block; - } - } -} -.main-filter { - padding: 0 1em; - overflow: auto; -} -.component_page { - height: calc(100dvh - 11em); - overflow: auto; - padding-left: 1em; - overflow-x: hidden; -} -.steps-and-prev-next-box { - padding: 1em 1em 2.5em 1em; - box-shadow: 0px 5px 8px 4px #eee; - border-radius: 1em; -} -</style> diff --git a/pages/hadith/(show)/EntityListDraft.vue b/pages/hadith/(show)/EntityListDraft.vue deleted file mode 100644 index dca7b81..0000000 --- a/pages/hadith/(show)/EntityListDraft.vue +++ /dev/null @@ -1,327 +0,0 @@ -<template> - <div class="row"> - <div class="col-12 py-3"> - <div class="d-flex align-items-center"> - <div class="col"> - <h3 class="m-0"> - {{ activeSchemaGetter?.label }} - </h3> - </div> - <div class="col-auto"> - <router-link - class="btn btn-primary" - :to="{ - name: 'addDraft', - key: activeSchemaGetter?.index_key, - }" - > - <svg class="icon icon-Component-133--1"> - <use xlink:href="#icon-Component-133--1"></use> - </svg> - جدید - </router-link> - </div> - </div> - </div> - <div class="col-12"> - <my-table - :hasSearch="false" - :fetchingData="fetchingData" - :items="listDrafts" - :tableActions="tableActions" - :tableColumns="activeSchemaGetter?.table_columns" - :paginationInfo="pagination" - :sortingInfo="sorting" - @edit-table-item="onEditTableItem" - @delete-table-item="onDeleteTableItem" - @on-linked-title-click="onLinkedTitleClick" - /> - </div> - </div> -</template> - -<script> -import sidbarMenuDefault from "~/json/entity/json/entityMenu.json"; -import sidbarMenuMajles from "~/json/entity/json/entityMenuMajles.json"; -import { mapState, mapActions } from "pinia"; -// import entityViewMixin from "~/entity/mixins/entityViewMixin.js"; - -import entityApi from "~/apis/entityApi"; -import repoApi from "~/apis/repoApi"; -import searchApi from "~/apis/searchApi"; - -/** - * @vue-data {String} [readingMode="false"] - حالت مطالعه - */ -export default { - beforeMount() { - this.httpService = new HttpService(import.meta.env.VITE_BASE_URL); - }, - mounted() { - let schemaExist = typeof this.draftSchemaGetter == "object"; - - if (!schemaExist) { - this.getSchemas().then(() => { - this.initData(); - }); - } else { - this.initData(); - } - - if (window.outerWidth < 992) { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - } - - // setDocumentTitle(); - }, - data() { - return { - tableActions: [ - { - showOutside: true, - show: true, - icon: "tavasi tavasi-Component-242--1", - title: "ویرایش", - to: { - name: "undefined", - }, - selected: false, - disabled: false, - howToOpen: "", - href: "", - class: "edit-btn", - action: "edit-table-item", - // can: "subject-", - }, - { - showOutside: true, - show: true, - icon: "tavasi tavasi-Component-295--1", - title: "حذف", - to: { - name: "undefined", - }, - selected: false, - disabled: false, - howToOpen: "", - href: "", - class: "delete-btn", - action: "delete-table-item", - }, - ], - pagination: { - pages: 0, - total: 0, - page: 1, - offset: 0, - limit: 10, - }, - sorting: { - sortby: "created", - sortorder: undefined, // asc | desc | none - }, - listDrafts: [], - currentDraft: {}, - activeSchemaGetter: [], - httpService: undefined, - fetchingData: false, - sidbarMenuDefault: sidbarMenuDefault, - sidbarMenuMajles: sidbarMenuMajles, - }; - }, - computed: { - ...mapState("entity", ["draftSchemaGetter"]), - ...mapState(["isSidebarCollapsed", "currentUser"]), - sidbarMenu() { - if (isMajlesBuild()) return this.sidbarMenuMajles; - else return this.sidbarMenuDefault; - }, - }, - methods: { - ...mapActions("entity", [ - "SET_ITEM_ENTITY", - - "draftSchemaSetter", - "draftActiveSchemaSetter", - "draftActiveStepSetter", - ]), - ...mapActions(["TOGGLE_PANEL"]), - initData() { - this.setActiveSchema(); - this.getDrafts(); - }, - setActiveSchema() { - this.activeSchemaGetter = []; - - this.activeSchemaGetter = this.draftSchemaGetter.find( - (item) => item.key == "list" - ); - }, - - async getSchemas() { - let url = repoUrl() + entityApi.schema.list; - - return await this.httpService - .postRequest(url, { - organ: "majles", - system: "edit", - }) - .then((response) => { - // console.log(response.data.edit); - this.draftSchemaSetter(response.data.edit); - - let sch = response.data.edit.find((item) => item.key == "list"); - if (sch) this.draftActiveSchemaSetter(sch); - }) - - }, - getDrafts() { - if (this.fetchingData) return; - this.fetchingData = true; - - let url = repoUrl() + repoApi.entity.draftList; - - let key = this.activeSchemaGetter?.index_key ?? "dfqanon"; - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", key); - url = url.replace("{{sortKey}}", "lasttitle"); - url = url.replace("/{{filter}}", ""); - url = url.replace("{{offset}}", this.pagination.offset); - url = url.replace("{{limit}}", this.pagination.limit); - - this.httpService.getRequest(url).then((res) => { - this.listDrafts = res.hits.hits ?? []; - - const total = res.hits.total.value; - const pages = Math.ceil(total / this.pagination.limit); - const pagination = { - total: total, - pages: pages == 0 ? 1 : pages, - }; - - this.pagination = { ...this.pagination, ...pagination }; - - this.fetchingData = false; - }); - }, - deleteEntity(index) { - if (index < 0 || index >= this.listDrafts.length) return; - this.currentDraft = this.listDrafts[index]; - - if (!this.currentDraft || !this.currentDraft._id) return; - - let key = this.activeSchemaGetter?.index_key ?? "dfqanon"; - - let url = repoUrl() + repoApi.entity.delete; - url = url.replace("{{index_key}}", key); - url = url.replace("{{entity_id}}", this.currentDraft._id); - - this.httpService - .postRequest(url) - .then((res) => { - this.listDrafts = this.listDrafts.slice(index, 1); - this.mySwalToast({ - html: res.data.message, - icon: "success", - }); - - // this.getListSpecial(this.entity_type, this.listType); - // this.updateListSpecial() - }) - .catch((err) => { - // this.mySwalToast({ - // title: "خطا!!!", - // html: err.message, - // icon: "error", - // }); - }); - }, - - onLinkedTitleClick(data) { - this.activeRowItem = data.rowItem; - // let index = data.index; - // let item = this.listDrafts[index]; - - this.$router.push({ - name: "editDraft", - params: { - id: this.activeRowItem._id, - key: this.activeSchemaGetter?.index_key, - }, - }); - }, - - onEditTableItem(index) { - if (index < 0 || index >= this.listDrafts.length) return; - this.currentDraft = this.listDrafts[index]; - - this.$router.push({ - name: "editDraft", - params: { - id: this.currentDraft._id, - key: this.activeSchemaGetter?.index_key, - }, - }); - }, - onDeleteTableItem(index) { - if (index < 0 || index >= this.listDrafts.length) return; - this.currentDraft = this.listDrafts[index]; - - if (this.currentDraft?._source?.islock) { - this.mySwalToast({ - title: "ممنوع!!!", - html: "این مورد بخاطر ثبت نهایی قفل شده است و امکان حذف ندارد", - icon: "error", - }); - return; - } - - this.mySwalConfirm({ - title: "هشدار!!!", - html: `از حذف اطلاعات جاری اطمینان دارید؟ `, - icon: "warning", - }).then((result) => { - if (result.isConfirmed) { - this.deleteEntity(index); - } - }); - }, - - /** - * تغییر وضعیت نمایش منوی سایدبار. - */ - toggleSidebarMenu() { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - }, - - resetPagination() { - this.pagination = { - pages: 0, - total: 0, - page: 0, - offset: 0, - limit: 10, - }; - }, - pageLimitChanged(paging) { - this.resetPagination(); - this.pagination.limit = paging.limit; - }, - pageChanged(paging) { - let page = paging.pageNumber; - page -= 1; - - this.pagination.offset = this.pagination.page * paging.limit; - this.pagination.limit = paging.limit; - this.pagination.page = paging.pageNumber; - }, - sortChanged(sorting) { - this.resetPagination(); - this.sorting = sorting; - }, - }, - - -}; -</script> -<style scoped lang="scss"></style> diff --git a/pages/hadith/(show)/NewEntity.vue b/pages/hadith/(show)/NewEntity.vue deleted file mode 100644 index 3e01c98..0000000 --- a/pages/hadith/(show)/NewEntity.vue +++ /dev/null @@ -1,393 +0,0 @@ -<template> - <div class="wrapper"> - <the-sidebar - :showUserAvatar="!isMajlesBuild" - :menu="sidbarMenu" - class="hiddens" - ></the-sidebar> - <main> - <header> - <div class="logo-and-dropdown"> - <img :src="logoPhoto()" alt="" class="logo" /> - </div> - - <div class="avatar"> - <user-avatar-dropdown class="nav-item rounded-circle"> - <router-link :to="{ name: 'searchAbout' }" class="dropdown-item" - >درباره ما</router-link - > - <router-link :to="{ name: 'searchConnect' }" class="dropdown-item" - >تماس با ما</router-link - > - </user-avatar-dropdown> - </div> - </header> - <div class="dropdown mb-3 mt-2"> - <div class="dropdown me-auto text__13 sortlist" ref="dropdownSortlist"> - <button - class="btn dropdown-toggle" - type="button" - data-bs-toggle="dropdown" - aria-expanded="false" - > - <span style="color: #adbec4"> افزودن مورد جدید: </span> - <span> {{ titleSelected }}</span> - </button> - <div class="dropdown-menu"> - <button - class="dropdown-item text__13" - v-for="(item, index) in schemasGetter" - @click.prevent="setItemDropdown(item, item.label)" - :key="index" - > - {{ item.label }} - </button> - </div> - </div> - </div> - <section class="mt-3"> - <div> - <div class="accordion" id="accordionExample"> - <div - class="card rounded-0" - v-for="(innerGroupItem, j) in activeSchemaGetter?.property" - :key="j" - > - <div class="card-header" :id="'heading' + j" style="height: 4em"> - <div class="d-flex justify-content-between"> - <p style="font-size: 12px; color: black"> - {{ innerGroupItem.title }} - </p> - <button - class="btn btn-link btn-block text-end collapsed button-meno" - type="button" - data-bs-toggle="collapse" - :data-bs-target="'#collapse' + j" - aria-expanded="false" - :aria-controls="'collapse' + j" - > - <span class="tavasi tavasi-Component-358--1"></span> - </button> - </div> - </div> - - <div - :id="'collapse' + j" - class="collapse" - :class="{ show: 'collapse' + j == 'collapse0' }" - :aria-labelledby="'heading' + j" - data-parent="#accordionExample" - > - <div class="card-body"> - <form> - <component - v-for="(formElement, index) in innerGroupItem.items" - :key="index" - :formElement="formElement" - :inputClass="handlerInputClass(formElement)" - :labelClass="'col-md-3'" - :rows="formElement.rows" - :is=" - returnComponentName(innerGroupItem, formElement.type) - " - @take-value="saveComponentValue($event, formElement)" - @keydown="saveKeydown($event)" - class="component" - ></component> - <div - class="" - style=" - position: relative; - display: flex; - justify-content: flex-end; - " - > - <button - type="submit" - class="btn btn-primary" - style="font-size: 11px" - v-can="innerGroupItem.key + '_edit'" - @click.prevent="addNewEntity(activeSchemaGetter)" - > - ثبت - </button> - </div> - </form> - </div> - </div> - </div> - </div> - </div> - </section> - </main> - </div> -</template> -<script> -import { mapState, mapActions } from "pinia"; -import sidbarMenu from "~/pages/search/json/menu.json"; -import newEntityBuilder from "~/pages/search/json/newEntityBuilder.json"; -import searchApi from "~/apis/searchApi"; -import { useStorage } from "@vueuse/core"; - -export default { - mounted() { - this.titleSelected = this.activeSchemaGetter.label; - }, - watch: { - $route: { - handler: function (to, from) { - console.log("to", to); - console.log("from", from); - }, - }, - }, - data() { - return { - sidbarMenu: sidbarMenu, - newEntityBuilder: newEntityBuilder, - listUpdatedText: {}, - titleSelected: "", - newEntityId: undefined, - }; - }, - computed: { - ...mapState({ - organNameGetter: "organNameGetter", - schemasGetter: "schemasGetter", - activeSchemaGetter: "activeSchemaGetter", - }), - }, - methods: { - ...mapActions(["schemasSetter", "activeSchemaSetter"]), - returnComponentName(innerGroupItem, type) { - if (type == "textarea") return "TextareaComponent"; - else if (type == "select") return "SelectComponent"; - else if (type == "date") return "DateComponent"; - else return "InputComponent"; - }, - saveComponentValue(value, formElement) { - // console.log("🚀 ~ saveComponentValue ~ formElement:", formElement); - // console.log("🚀 ~ saveComponentValue ~ value:", value); - //در صورت تغییر نگهداری می شود تا وقتی کلید ثبت زد، ذخیره شود - // if (this.activeSchemaGetter[formElement.key] != value) { - // this.listUpdatedText[formElement.key] = value; - // } - if (value !== "") { - this.listUpdatedText[formElement.key] = value; - } - }, - async getSchemas() { - try { - const { $api } = useNuxtApp(); - const res = await $api(searchApi.schema.list, { - baseURL: repoUrl(), - method: "POST", - body: { - organ: this.organNameGetter, - system: "entityCreate", - build_state: buildState(), - }, - }); - let newEntitySchema = useStorage("newEntitySchema", undefined); - newEntitySchema.value = response.data.entityCreate; - - this.schemasSetter(response.data.entityCreate); - - let activeSchema = response.data.entityCreate[0]; - this.activeSchemaSetter(activeSchema); - - let activeNewEntitySchema = useStorage("activeNewEntitySchema", undefined); - activeNewEntitySchema.value = activeSchema; - } catch (err) { - this.fetchingData = false; - } - }, - setItemDropdown(item, title) { - this.titleSelected = title; - this.activeSchemaSetter(item); - console.log("item", item); - }, - handlerInputClass(item) { - if (item.type == "textarea") { - return "col-md-12"; - } else if (item.type == "date" || item.type == "select") { - return "col-md-3"; - } else { - return "col-md-8"; - } - // console.log(item); - }, - async addNewEntity(item) { - if (this.newEntityId !== undefined) { - this.updateNewEntity(item); - } else { - let url = searchApi.newEntity.add; - url = url.replace("{{index_key}}", item.key); - - const formData = { - meta: JSON.stringify(this.listUpdatedText), - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: repoUrl(), - method: "POST", - body: formData, - }); - this.newEntityId = res._id; - } catch (err) { - this.fetchingData = false; - } - } - }, - async updateNewEntity(item) { - let url = searchApi.newEntity.update; - url = url.replace("{{index_key}}", item.key); - url = url.replace("{{id}}", this.newEntityId); - const formData = { - meta: JSON.stringify(this.listUpdatedText), - }; - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: repoUrl(), - method: "POST", - body: formData, - }); - } catch (err) { - this.fetchingData = false; - } - }, - }, -}; -</script> -<style lang="scss"> -main { - // background-color: red; - margin-right: 6em; - height: 100dvh; - header { - height: 6em; - // background-color: green; - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid #a7a098; - - .logo-and-dropdown { - display: flex; - align-items: center; - justify-content: flex-start; - - .dropdown { - margin-right: 2em; - } - .logo { - width: 40%; - } - } - } - section { - height: calc(100dvh - 10em); - overflow: auto; - // background-color: aqua; - } -} -.button-meno { - font-size: 12px; - transform: rotate(90deg); - width: 10px; - height: 10px; - margin-top: 15px; - text-decoration: none; - span:hover { - color: #00b6e3; - } -} -// .select-text { -// text-align: right; -// background-color: #fff; -// font-size: 14px; -// border-radius: 8px; -// border-color: #f1f1f1; -// padding: 6px; -// &:hover { -// border-color: #afbac6; -// } -// } -.component { - input { - border-radius: 0.5rem; - border-color: var(--primary-color); - font-size: 14px; - // color: #afbac6; - &:focus { - border-color: var(--primary-color); - } - } - label { - font-size: 15px; - &:focus { - border-color: var(--primary-color); - } - } - select { - border-radius: 0.5rem; - border-color: var(--primary-color); - font-size: 14px; - // color: #afbac6; - &:focus { - border-color: var(--primary-color); - } - } - textarea { - border-radius: 0.5rem; - border-color: var(--primary-color); - padding: 1em; - &:focus { - border-color: var(--primary-color); - } - } -} -.accordion { - margin: 0 4em; -} -@media (max-width: 575.98px) { - main { - margin-right: 0; - header { - .logo-and-dropdown { - .logo { - display: none; - } - } - } - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { - main { - margin-right: 0; - header { - .logo-and-dropdown { - .logo { - display: none; - } - } - } - } -} -@media only screen and (min-width: 768px) and (max-width: 991.98px) { - main { - margin-right: 5em; - } -} -@media only screen and (min-width: 992px) and (max-width: 1199.98px) { - main { - margin-right: 5em; - } -} -@media (min-width: 1200px) { -} -</style> diff --git a/pages/hadith/(show)/[key]/[id]/EntityDetail.vue b/pages/hadith/(show)/[key]/[id]/EntityDetail.vue deleted file mode 100644 index a539d78..0000000 --- a/pages/hadith/(show)/[key]/[id]/EntityDetail.vue +++ /dev/null @@ -1,389 +0,0 @@ -<!-- برای نمایش یک جزء از قانون استفاده می شود --> - -<!-- don't change the class: problem-section__content, - otherwise the remove link will not work. --> -<template> - <main class="main" id="top"> - <the-sidebar - :showUserAvatar="!isMajlesBuild" - :menu="sidbarMenu" - ></the-sidebar> - - <section - class="main-page__content" - :class="{ expanded: !isSidebarCollapsed }" - > - <div class="container-fluid"> - <div - :class="buildName + '-header-color'" - class="row align-items-center" - > - <div class="col col-lg-auto order-1"> - <div class="d-flex align-items-center"> - <button - name="button" - type="button" - class="toggle-mobile-nav dropdown-hamburger d-md-none" - @click.prevent="toggleSidebarMenu()" - > - <span class="sr-only">باز کردن منوی کنار</span> - <svg class="s18" data-testid="sidebar-icon"> - <use href="assets/common/img/icons.svg#sidebar"></use> - </svg> - </button> - - <router-link - :to="{ - name: 'defaultRoute', - }" - classes="btn me-3" - > - <img - :src="logoPhoto()" - :alt="appLongTitle" - class="img-fluid logo" - style="max-width: 2.5em" - /> - </router-link> - </div> - <!-- <div - class="d-flex align-items-center" - v-if="navigateChartSchemaGetter?.length" - > - <label for="repositories-desktop" class="ms-2 no-wrap"> - بانک داده - </label> - <multiselect - :allow-empty="false" - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="label" - track-by="key" - placeholder="انتخاب فهرست" - :value="selectedNavigation" - :options="navigateChartSchemaGetter" - @select="onSelectNavigation" - :hide-selected="false" - :max-height="200" - id="repositories-desktop" - > - </multiselect> - </div> --> - </div> - <div class="col-12 col-lg order-3 order-lg-2"> - <div class="nav-tabs-container nav-tabs"> - <ul v-if="navList" class="nav"> - <li - class="nav-item desktop" - v-for="(navItem, index) in navList" - :key="index" - > - <button - :title="navItem.title" - type="button" - class="btn nav-link" - @click.prevent="setActiveTab(navItem)" - :class="{ - active: activeTabGetter?.key == navItem.key, - }" - > - {{ navItem.title }} - </button> - </li> - - <li - class="nav-item mobile tabs-more-btn d-lg-none" - v-if="navList?.length > 2" - > - <div class="dropdown"> - <button - class="btn" - type="button" - id="dropdownMenuButton" - data-bs-toggle="dropdown" - aria-haspopup="true" - aria-expanded="false" - > - <svg class="icon icon-Component-81--1"> - <use xlink:href="#icon-Component-81--1"></use> - </svg> - </button> - <div - class="dropdown-menu" - aria-labelledby="dropdownMenuButton" - > - <!-- v-if="canSee(navItem.key + '_view') && index > 2" --> - - <a - class="dropdown-item" - href="#" - v-for="(navItem, index) in navList" - :key="index" - @click.prevent="setActiveTab(navItem)" - :class="{ - active: activeTabGetter?.key == navItem.key, - }" - v-if="index > 2" - >{{ navItem.title }}</a - > - </div> - </div> - </li> - </ul> - </div> - <!-- <div - class="d-flex pt-2" - v-if="activeNavigateChartSchemaGetter?.info?.items" - > - <div class="ms-2"> - <multiselect - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="title" - track-by="name" - placeholder="انتخاب فیلتر" - v-model=" - schemaFilters[activeNavigateChartSchemaGetter?.key] - " - :options="activeNavigateChartSchemaGetter?.info?.items" - @select="onComboChanged()" - @remove="onComboChanged()" - :hide-selected="false" - :max-height="200" - openDirection="rtl" - > - <span slot="noResult">موردی پیدا نشد.</span> - </multiselect> - </div> - </div> --> - </div> - - <div - v-if="!isMajlesBuild" - class="col-auto col-lg-auto order-2 order-lg-3" - > - <user-avatar-dropdown - style="position: static" - class="user-avatar-component" - ></user-avatar-dropdown> - </div> - </div> - <div class="row mx-2"> - <div class="col-12"> - <component - v-if="mainComponentName" - :key="renderId" - :propText="mainComponentName" - :is="mainComponentName" - :slug="slug" - :schemaItems="tabSchemaItems" - :routeEntityid="myEntityid" - @changeEntityid="changeEntityid" - ></component> - </div> - </div> - </div> - </section> - </main> -</template> - -<script> -import sidbarMenuDefault from "~/json/entity/json/detailMenu.json"; -import sidbarMenuMajles from "~/json/entity/json/detailMenuMajles.json"; - - - -import { mapActions, mapState } from "pinia"; -import entityApi from "~/apis/entityApi"; -import { useStorage } from "@vueuse/core"; - -export default { - name:'detail', - props: { - slug: { - default: "mqsection", - }, - }, - beforeMount() { - this.httpService = new HttpService(import.meta.env.VITE_REPO_BASE_URL); - }, - mounted() { - this.getSchemas(); - - if (this.activeEntityViewSchemaGetter?.tabs) this.setActiveTab(); - - this.myEntityid = - this.myEntityid == "" ? this.$route.params?.id : this.myEntityid; - }, - - data() { - return { - sidbarMenuDefault: sidbarMenuDefault, - sidbarMenuMajles: sidbarMenuMajles, - - myEntityid: "", - renderId: 1, - mainComponentName: null, - tabSchemaItems: undefined, - }; - }, - computed: { - ...mapState("entity", [ - "selectedItemEntityGetter", - "entityViewSchemaGetter", - "activeEntityViewSchemaGetter", - "activeTabGetter", - ]), - ...mapState(["organNameGetter"]), - ...mapState(["isSidebarCollapsed"]), - sidbarMenu() { - if (isMajlesBuild()) return this.sidbarMenuMajles; - else return this.sidbarMenuDefault; - }, - navList() { - if (!isMajlesBuild()) return this.activeEntityViewSchemaGetter?.tabs; - - if (this.activeEntityViewSchemaGetter?.tabs) - return this.activeEntityViewSchemaGetter?.tabs.slice( - 0, - this.activeEntityViewSchemaGetter.tabs.length - 1 - ); - else return []; - }, - }, - methods: { - ...mapActions("entity", [ - "activeEntityViewSchemaSetter", - "entityViewSchemaSetter", - "activeTabSetter", - ]), - ...mapActions(["checkPermissions"]), - - changeEntityid(newEntityid) { - this.myEntityid = newEntityid; - // this.renderId++; - }, - getSchemas() { - let localStoageSchema = useStorage("qaSchema", undefined).value; - - if (localStoageSchema) { - let schema = JSON.parse(localStoageSchema); - this.activeEntityViewSchemaSetter(schema); - this.setActiveTab(); - return; - } - this.httpService - .postRequest(entityApi.schema.list, { - organ: this.organNameGetter, - system: "entityView", - build_state: buildState(), - }) - .then((response) => { - // console.log(response); - const routeParamsKey = this.$route.params.key; - let schemaBasedOnRouteKeyIndex = response.data.entityView.findIndex( - (item) => item.key == routeParamsKey - ); - schemaBasedOnRouteKeyIndex = - schemaBasedOnRouteKeyIndex == -1 ? 0 : schemaBasedOnRouteKeyIndex; - this.entityViewSchemaSetter(response.data.entityView); - this.activeEntityViewSchemaSetter( - response.data.entityView[schemaBasedOnRouteKeyIndex] - ); - this.setActiveTab(); - // this.activeTabSetter( - // response.data.entityView[schemaBasedOnRouteKeyIndex].tabs[0] - // ); - - // this.updateMainContent(); - }); - }, - - setActiveTab(tab = undefined) { - if (!tab) { - if (this.$route?.hash) { - let hash = this.$route?.hash.replace("#", ""); - console.log(hash); - let index = this.activeEntityViewSchemaGetter?.tabs.findIndex( - (item) => item.key == hash - ); - if (index != -1) tab = this.activeEntityViewSchemaGetter?.tabs[index]; - } else tab = this.activeEntityViewSchemaGetter?.tabs[0]; - } - if (!tab) return; - - this.renderId++; - this.activeTabSetter(tab); - this.tabSchemaItems = undefined; - this.mainComponentName = "EntityQSection"; - this.tabSchemaItems = tab.items - ? tab.items - : this.activeEntityViewSchemaGetter.items; - - if (tab.componentName) { - this.mainComponentName = tab.componentName; - } - - // if (tab?.key == "content") { - // this.mainComponentName = "EntityQSection"; - // this.tabSchemaItems = tab.items - // ? tab.items - // : this.activeEntityViewSchemaGetter.items; - // } - // if (tab?.key == "qmodel") { - // this.mainComponentName = "EntityQModel"; - // this.tabSchemaItems = tab.items - // ? tab.items - // : this.activeEntityViewSchemaGetter.items; - // } - // if (tab?.key == "graph") { - // this.mainComponentName = "ChartGraph"; - // } - }, - }, -}; -</script> - -<style scoped lang="scss"> -.show-reports-button { - opacity: 0.6; - color: #92a2b2; -} -.problem-detail { - width: 98% !important; - margin: 0 !important; -} - -.text-title-QSection1 { - color: #00abff !important; - &:hover { - // color: blue !important; - text-decoration: underline !important; - } -} -.text-title-nextItem { - color: #00abff !important; - &:hover { - color: #0575ad !important; - } -} -.text-title-prevItem { - color: #00abff !important; - &:hover { - color: #0575ad !important; - } -} -.text-title-QSection2 { - color: #00abff !important; - &:hover { - // color: blue !important; - text-decoration: underline !important; - } -} -.nav-tabs-container { - display: flex; - justify-content: center; -} -</style> diff --git a/pages/hadith/(show)/[key]/[id]/EntityQRule.vue b/pages/hadith/(show)/[key]/[id]/EntityQRule.vue deleted file mode 100644 index 96f7216..0000000 --- a/pages/hadith/(show)/[key]/[id]/EntityQRule.vue +++ /dev/null @@ -1,354 +0,0 @@ -<!-- برای نمایش یک جزء از قانون استفاده می شود --> - -<!-- don't change the class: problem-section__content, - otherwise the remove link will not work. --> -<template> - <main class="main" id="top"> - <the-sidebar - :showUserAvatar="!isMajlesBuild" - :menu="sidbarMenu" - ></the-sidebar> - - <section - class="main-page__content" - :class="{ expanded: !isSidebarCollapsed }" - > - <div class="container-fluid"> - <div - :class="buildName + '-header-color'" - class="row align-items-center" - > - <div class="col col-lg-auto order-1"> - <div class="d-flex align-items-center"> - <button - name="button" - type="button" - class="toggle-mobile-nav dropdown-hamburger d-md-none" - @click.prevent="toggleSidebarMenu()" - > - <span class="sr-only">باز کردن منوی کنار</span> - <svg class="s18" data-testid="sidebar-icon"> - <use href="assets/common/img/icons.svg#sidebar"></use> - </svg> - </button> - - <router-link - :to="{ - name: 'defaultRoute', - }" - classes="btn me-3" - > - <img - :src="logoPhoto()" - :alt="appLongTitle" - class="img-fluid logo" - style="max-width: 2.5em" - /> - </router-link> - </div> - <!-- <div - class="d-flex align-items-center" - v-if="navigateChartSchemaGetter?.length" - > - <label for="repositories-desktop" class="ms-2 no-wrap"> - بانک داده - </label> - <multiselect - :allow-empty="false" - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="label" - track-by="key" - placeholder="انتخاب فهرست" - :value="selectedNavigation" - :options="navigateChartSchemaGetter" - @select="onSelectNavigation" - :hide-selected="false" - :max-height="200" - id="repositories-desktop" - > - </multiselect> - </div> --> - </div> - <div class="col-12 col-lg order-3 order-lg-2"> - <div class="nav-tabs-container nav-tabs"> - <ul v-if="navList" class="nav"> - <li - class="nav-item desktop" - v-for="(navItem, index) in navList" - :key="index" - > - <button - :title="navItem.title" - type="button" - class="btn nav-link" - @click.prevent="setActiveTab(navItem)" - :class="{ - active: qruleActiveTabGetter?.key == navItem.key, - }" - > - {{ navItem.title }} - </button> - </li> - - <li - class="nav-item mobile tabs-more-btn d-lg-none" - v-if="navList?.length > 2" - > - <div class="dropdown"> - <button - class="btn" - type="button" - id="dropdownMenuButton" - data-bs-toggle="dropdown" - aria-haspopup="true" - aria-expanded="false" - > - <svg class="icon icon-Component-81--1"> - <use xlink:href="#icon-Component-81--1"></use> - </svg> - </button> - <div - class="dropdown-menu" - aria-labelledby="dropdownMenuButton" - > - <!-- v-if="canSee(navItem.key + '_view') && index > 2" --> - - <a - class="dropdown-item" - href="#" - v-for="(navItem, index) in navList" - :key="index" - @click.prevent="setActiveTab(navItem)" - :class="{ - active: qruleActiveTabGetter?.key == navItem.key, - }" - v-if="index > 2" - >{{ navItem.title }}</a - > - </div> - </div> - </li> - </ul> - </div> - - </div> - - </div> - <div class="row mx-2"> - <div class="col-12"> - <component - v-if="mainComponentName" - :key="renderId" - :propText="mainComponentName" - :is="mainComponentName" - :slug="slug" - :schemaItems="tabSchemaItems" - :routeEntityid="myEntityid" - @changeEntityid="changeEntityid" - @set-active-tab="setActiveTab" - ></component> - </div> - - </div> - </div> - </section> - </main> -</template> - -<script> -import sidbarMenuDefault from "~/json/entity/json/detailMenu.json"; -import sidbarMenuMajles from "~/json/entity/json/detailMenuMajles.json"; - - - -import { mapActions, mapState } from "pinia"; -import entityApi from "~/apis/entityApi"; -import { useStorage } from "@vueuse/core"; - -export default { - name:'qrule', - props: { - slug: { - default: "qmodel", - }, - }, - - beforeMount() { - this.httpService = new HttpService(import.meta.env.VITE_REPO_BASE_URL); - }, - mounted() { - this.getSchemas(); - - if (this.qruleActiveSchemaGetter?.tabs) - this.setActiveTab(this.qruleActiveSchemaGetter?.tabs[0]); - - // if (this.qruleSchemaGetter) { - // let qModelRuleIndex = this.qruleSchemaGetter.findIndex( - // (item) => item.key == "qmodelrule" - // ); - - // this.setActiveTab(this.qruleSchemaGetter[qModelRuleIndex]?.tabs[0]); - // } - - this.myEntityid = - this.myEntityid == "" ? this.$route.params?.id : this.myEntityid; - }, - - data() { - return { - sidbarMenuDefault: sidbarMenuDefault, - sidbarMenuMajles: sidbarMenuMajles, - - myEntityid: "", - renderId: 1, - mainComponentName: null, - tabSchemaItems: undefined, - }; - }, - computed: { - ...mapState("entity", [ - "selectedItemEntityGetter", - "qruleSchemaGetter", - "qruleActiveSchemaGetter", - "qruleActiveTabGetter", - "breadCrumbGetter", - ]), - ...mapState(["organNameGetter"]), - ...mapState(["isSidebarCollapsed"]), - sidbarMenu() { - if (isMajlesBuild()) return this.sidbarMenuMajles; - else return this.sidbarMenuDefault; - }, - navList() { - if (!isMajlesBuild()) return this.qruleActiveSchemaGetter?.tabs; - - if (this.qruleActiveSchemaGetter?.tabs) - return this.qruleActiveSchemaGetter?.tabs.slice( - 0, - this.qruleActiveSchemaGetter.tabs.length - 1 - ); - else return []; - }, - }, - methods: { - ...mapActions("entity", [ - "qruleActiveSchemaSetter", - "qruleSchemaSetter", - "qruleActiveTabSetter", - "breadCrumbSetter", - ]), - ...mapActions(["checkPermissions"]), - - changeEntityid(newEntityid) { - this.myEntityid = newEntityid; - // this.renderId++; - }, - getSchemas() { - let localStoageSchema = useStorage("qaSchema",undefined).value; - - if (localStoageSchema) { - let schema = JSON.parse(localStoageSchema); - this.qruleActiveSchemaSetter(schema); - this.setActiveTab(this.qruleActiveSchemaGetter?.tabs[0]); - return; - } - this.httpService - .postRequest(entityApi.schema.list, { - organ: this.organNameGetter, - system: "entityView", - build_state: buildState(), - }) - .then((response) => { - // console.log(response); - const routeParamsKey = this.$route.name; - let schemaBasedOnRouteKeyIndex = response.data.entityView.findIndex( - (item) => item.key == routeParamsKey - ); - schemaBasedOnRouteKeyIndex = - schemaBasedOnRouteKeyIndex == -1 ? 0 : schemaBasedOnRouteKeyIndex; - this.qruleSchemaSetter(response.data.entityView); - this.qruleActiveSchemaSetter( - response.data.entityView[schemaBasedOnRouteKeyIndex] - ); - this.setActiveTab(this.qruleActiveSchemaGetter?.tabs[0]); - // this.qruleActiveTabSetter( - // response.data.entityView[schemaBasedOnRouteKeyIndex].tabs[0] - // ); - - // this.updateMainContent(); - }) - - }, - - setActiveTab(tab) { - this.renderId++; - this.qruleActiveTabSetter(tab); - this.tabSchemaItems = undefined; - this.mainComponentName = "EntityQModelRule"; - this.tabSchemaItems = tab.items - ? tab.items - : this.qruleActiveSchemaGetter.items; - - if (tab.componentName) { - this.mainComponentName = tab.componentName; - } - this.resetBreadcrumb(); - }, - resetBreadcrumb() { - if (this.qruleActiveTabGetter.key == "rulelist") { - this.breadCrumbSetter(); - } else if (this.qruleActiveTabGetter.key == "rulelogic") { - let bread = this.breadCrumbGetter; - bread.pop(); - this.breadCrumbSetter(bread.length ?? undefined ); - } - // else if(this.qruleActiveTabGetter.key == 'ruletriple') - }, - }, - -}; -</script> - -<style scoped lang="scss"> -.show-reports-button { - opacity: 0.6; - color: #92a2b2; -} -.problem-detail { - width: 98% !important; - margin: 0 !important; -} - -.text-title-QSection1 { - color: #00abff !important; - &:hover { - // color: blue !important; - text-decoration: underline !important; - } -} -.text-title-nextItem { - color: #00abff !important; - &:hover { - color: #0575ad !important; - } -} -.text-title-prevItem { - color: #00abff !important; - &:hover { - color: #0575ad !important; - } -} -.text-title-QSection2 { - color: #00abff !important; - &:hover { - // color: blue !important; - text-decoration: underline !important; - } -} -.nav-tabs-container { - display: flex; - justify-content: center; -} -</style> diff --git a/pages/hadith/(show)/[key]/[id]/index.vue b/pages/hadith/(show)/[key]/[id]/index.vue deleted file mode 100644 index b13d0ed..0000000 --- a/pages/hadith/(show)/[key]/[id]/index.vue +++ /dev/null @@ -1,1838 +0,0 @@ -<template> - <NuxtLayout name="search-layout" :menu="sidbarMenu"> - <!-- <Head> --> - <!-- <Title>{{ metaTitle }}</Title> --> - <!-- <Meta name="description" :content="title" /> --> - <!-- <Style type="text/css" children="body { background-color: green; }" ></Style> --> - <!-- </Head> --> - <div class="container-fluid"> - <div class="row"> - <!-- #region منو سمت راست --> - <div class="col-auto col-md-3"> - <template v-if="!isMajlesBuild() && showListRight"> - <div - class="filter-list-container" - :class="{ expanded: showFilter }" - > - <ul - :class="buildName() + '-header-color'" - v-if="$route.name != 'research'" - class="nav nav-tabs pt-1 d-none d-xl-flex" - > - <li class="nav-item desktop"> - <button - title="" - type="button" - @click.prevent="setActiveListType('Navigation', 'simple')" - class="btn nav-link" - :class="{ - active: activeListType == 'simple', - }" - > - {{ listTabTitle1 }} - </button> - </li> - <li class="nav-item desktop"> - <button - title="" - type="button" - @click.prevent="setActiveListType('UserHistory', 'history')" - class="btn nav-link" - :class="{ - active: activeListType == 'history', - }" - > - {{ listTabTitle2 }} - </button> - </li> - </ul> - <div class="mobile-mode d-lg-none"> - <button - v-if="showFilter" - class="btn mb-1" - @click.prevnet="showFilter = !showFilter" - > - <svg class="icon icon-chevron-double-right ms-1"> - <use xlink:href="#icon-chevron-double-right"></use> - </svg> - </button> - </div> - <component - :key="renderResearch" - class="main-filter" - :item="getPanelComponent" - :is="panelComponentName" - ref="panelComponent" - @fishHandlerInResearch="researchModalHandler" - @content-updated="updateMainContent" - ></component> - </div> - </template> - </div> - <!-- #endregion --> - - <!-- #region بخش محتوای اصلی سایت --> - <div :class="columnClass"> - <!-- #region بخش هِدر --> - <div - class="row align-items-center" - :class="buildName() + '-header-color'" - > - <div class="pt-2 d-flex justify-content-between align-items-center"> - <div class="d-md-none"> - <div class="d-flex align-items-center"> - <button - name="button" - type="button" - class="toggle-mobile-nav dropdown-hamburger pe-0" - @click.prevent="toggleSidebarMenu()" - > - <span class="sr-only">باز کردن منوی کنار</span> - <svg class="s18" data-testid="sidebar-icon"> - <use href="~/assets/common/img/icons.svg#sidebar"></use> - </svg> - </button> - </div> - </div> - <div class=""> - <div class="nav-tabs-container nav-tabs justify-content-start"> - <ul v-if="navList" class="nav al"> - <li - class="nav-item desktop" - v-for="(navItem, index) in navList" - :key="index" - > - <button - :title="navItem.title" - type="button" - class="btn nav-link" - @click.prevent="setActiveTab(navItem)" - :class="{ - active: activeTabGetter?.key == navItem.key, - }" - > - {{ navItem.title }} - </button> - </li> - - <li - class="nav-item mobile tabs-more-btn d-lg-none d-flex align-items-center" - v-if="navList?.length > 3" - > - <div class="dropdown"> - <button - class="btn" - type="button" - id="dropdownMenuButton" - data-bs-toggle="dropdown" - aria-haspopup="true" - aria-expanded="false" - > - <svg class="icon icon-Component-81--1"> - <use xlink:href="#icon-Component-81--1"></use> - </svg> - </button> - <div - class="dropdown-menu" - aria-labelledby="dropdownMenuButton" - > - <a - class="dropdown-item" - href="#" - v-for="(navItem, index) in navList" - :key="index" - @click.prevent="setActiveTab(navItem)" - :class="{ - active: activeTabGetter?.key == navItem.key, - }" - v-if="index > 2" - >{{ navItem.title }}</a - > - </div> - </div> - </li> - </ul> - </div> - </div> - - <div class="d-none d-lg-block"> - <auto-complation - :key="'auto' + renderAutoComplation" - :showAppend="false" - class="entityTheme entity-auto-complation" - ref="autoComplationRef" - :contentKey="activeEntityViewSchemaGetter?.key" - :textSearch="$route.query?.searchtext ?? ''" - :placeholder="autoComplationPlaceholder" - @onSelectHistory="onSelectHistory" - ></auto-complation> - </div> - <div class="d-lg-none"> - <a - class="" - type="button" - data-bs-toggle="collapse" - data-bs-target="#mobileCollapse" - aria-expanded="false" - aria-controls="collapseExample" - name="button" - > - <svg class="icon icon-Component-198--1"> - <use xlink:href="#icon-Component-198--1"></use> - </svg> - </a> - </div> - </div> - <div id="mobileCollapse" class="collapse d-lg-none"> - <div class="col-12 d-flex justify-content-center"> - <div class="col-10 col-sm-6"> - <auto-complation - :key="'auto' + renderAutoComplation" - :showAppend="false" - class="my-2 entityTheme entity-auto-complation" - ref="autoComplationRef" - :contentKey="activeEntityViewSchemaGetter?.key" - :textSearch="$route.query?.searchtext ?? ''" - :placeholder="autoComplationPlaceholder" - @onSelectHistory="onSelectHistory" - ></auto-complation> - </div> - </div> - </div> - </div> - - <!-- #endregion --> - <!-- #region بخش محتوای متنی سایت --> - <div class="row"> - <EntityHeader - v-if=" - mainComponentName !== ('EntityCompareText2', 'EntityChartGantt') - " - @toggle-reading-mode="toggleReadingMode" - @groupEditComponent="EditComponent" - @selectedItem="selectedItemlevel" - @NewComponent="NewComponent" - @show-compare-modal="showCompareModal" - @showListHeadline="showListHeadline" - @close-compare="closeCompare()" - @change-compare="changeCompare($event)" - @switch-view="switchView" - :isCompareState="mainComponentName == 'EntityCompareText2'" - ref="headers" - class="col-12" - > - </EntityHeader> - <template v-if="!isMajlesBuild() && showListRight"> - <div class="button-cloce"> - <button - v-if="showFilter == false" - class="btn_close" - @click.prevnet="showFilter = !showFilter" - > - <svg class="icon icon-chevron-double-left"> - <use xlink:href="#icon-chevron-double-left"></use> - </svg> - </button> - </div> - </template> - - <div - v-if="hideCircleButton == false" - class="circle--button" - @click.prevent="circleButton()" - ref="circle" - > - <svg - class="icon-chevron-double-lg-left" - data-testid="chevron-double-lg-left-icon" - > - <use - href="~/assets/common/img/icons.svg#chevron-double-lg-left" - ></use> - </svg> - </div> - - <div class="col"> - <div class="row mx-2"> - <div - class="col-12" - :class="{ - 'col-lg': - mainComponentName != 'PropertyBuilder' && - mainComponentName != 'EntityRepetitionWords' && - mainComponentName !== 'EntityChartGantt', - }" - > - <component - v-if="mainComponentName" - :class="{ - component_page: - mainComponentName !== 'EntityQaSection' || - mainComponentName !== 'LibraryText' || - mainComponentName !== 'EntityChartGantt', - }" - :readingMode="isReadingModeGetter" - :propText="mainComponentName" - :is="mainComponentName" - :slug="slug" - :selectedItem="selectedItemEntityGetter" - :editItem="editItem" - :editComponent="editComponent" - :text1Compare="text1Compare" - :text2Compare="text2Compare" - :copmareSideBySide="copmareSideBySide" - :compareLineByLine="compareLineByLine" - :routeEntityid="params.id" - :listBooks="listBooks" - :viewMode="viewMode" - @is-search-mode="closeSearchMode" - @fishHandler="fishHandler" - @termHandler="termHandler" - @statusEdit="statusEdit" - @annotationHandler="annotationHandler" - @editPropertyTags="editPropertyTags" - @close-compare="closeCompare()" - @click-node="chartGanttClickNode" - @linked-title-click="linkedTitleClick" - @column-title-click="columnTitleClick" - @handler-icon-click="handlerIconClick" - :propertyBuilderForm=" - activeEntityViewSchemaGetter?.property - " - ></component> - <!-- //:key="renderResearch" --> - <!-- این مقدار حذف شد به این دلیل که بعد از فیش زدن به اول صفحه میرفت --> - </div> - - <div - :class="{ 'col-4': buildName() == 'hadith' }" - class="col-3 entity-tree-list" - v-if="isSearchMode || isHeadingMode" - > - <div class="container-fluid"> - <!-- <div class="row"> - <div - class="d-flex justify-content-between align-items-center w-100" - > - <div>سرفصل ها</div> - <button - class="close" - @click="showEntityHeading = false" - > - <span aria-hidden="true">×</span> - </button> - </div> - </div> --> - <div class="row"> - <text-search - @is-search-mode="closeSearchMode" - @showListHeadline="showListHeadline" - v-if="isSearchMode" - class="" - ></text-search> - - <entity-tree-list - :dataTree="dataTree" - @showListHeadline="showListHeadline" - @is-treelist-mode="closeTreelistMode" - v-if="isHeadingMode" - class="" - ></entity-tree-list> - </div> - </div> - </div> - </div> - </div> - - <!-- <base-modal - v-if="uploadForFirstTime" - @close="closeModal" - @save="saveBaseModal" - @canel="closeModal()" - :description="description" - :showHeaderCloseButton="true" - :modalTitle="modalTitle" - class="borhan-modal" - :height="getModalHeight()" - maxHeight="30em" - overflow="hidden" - :hasFooter="false" - :showSaveButton="false" - :showCloseButton="false" - > - <component - :is="slotComponentName" - :uploadForFirstTime="uploadForFirstTime" - :listData="listData" - :valueModal="valueResearchModal" - @canel="closeModal()" - @close="closeModal()" - @closeAfterSaving="closeAfterSaving" - @compare-text="compareText" - @load-text="loadText" - @word-file="wordFile" - @after-select-file="afterSelectFile()" - ></component> - </base-modal> --> - <base-modal-v2 - v-if="uploadForFirstTime" - @close="closeModal" - :showHeaderCloseButton="true" - :hasFooter="false" - :modalTitle="modalTitle" - :modalSize="modalWidthManagement" - :height="modalHeightManagement" - maxHeight="36em" - overflow="hidden" - :showSaveButton="true" - :showCloseButton="true" - :showDeleteButton="false" - > - <template v-slot:default> {{ modalTitle }}</template> - - <template v-slot:body> - <component - :is="slotComponentName" - :uploadForFirstTime="uploadForFirstTime" - :listData="listData" - :valueModal="valueResearchModal" - :sectionItem="sectionItem" - :versionItem="versionItem" - :listItemsCompare="listItemsCompare" - :numberCurrentTab="2" - :showCurrentTab="false" - @edit-sections="editSections" - @canel="closeModal()" - @close="closeModal()" - @closeAfterSaving="closeAfterSaving" - @compare-text="compareText" - @load-text="loadText" - @word-file="wordFile" - @compare-versions-qanon="compareVersionsQanon" - :elements="dataOrganhMeta" - @after-select-file="afterSelectFile()" - height="100%" - ></component> - </template> - </base-modal-v2> - </div> - <!-- #endregion --> - </div> - <!-- #endregion --> - </div> - </div> - </NuxtLayout> -</template> - -<script> -import { mapActions, mapState } from "pinia"; - -import { useEntityStore } from "@search/stores/entityStore"; -import { useSearchStore } from "~/stores/searchStore"; -import { useCommonStore } from "~/stores/commonStore"; - -import sidbarMenuDefault from "~/json/entity/entityMenu.json"; -import sidbarMenuMajles from "~/json/entity/entityMenuMajles.json"; - -import entityApi from "~/apis/entityApi"; -import repoApi from "~/apis/repoApi"; - -export default { - setup() { - useHead({ - title: import.meta.env.VITE_ENTITY_PAGE_TITLE, - meta: [{ name: "description", content: "My page description" }], - bodyAttrs: { - class: import.meta.env.VITE_ENTITY_SYSTEM, - }, - }); - - definePageMeta({ - // names: [ - // "search/key/id", - // "search/key/id/show", - // "search/key/id/list", - // "search/key/id/research", - // ], - // middleware: "redirect", - // alias: [ - // "/search/key/id", - // "/search/key/id/show", - // "/search/key/id/list", - // "/search/key/id/research", - // ], - layout: false, - }); - }, - created() { - this.routeKey = this.$route.params.key; - this.routeId = this.$route.params.id; - - this.httpService = useNuxtApp()["$http"]; - }, - mounted() { - sidbarMenuDefault.entity.forEach((element) => { - if (element.link.includes("/key/id/") > 0) - element.link = element.link - .replace("id", this.$route.params.id) - .replace("key", this.$route.params.key); - }); - - console.info("sidbarMenuDefault", sidbarMenuDefault); - - if (this.$route.query?.listkey == "branch") - this.listTabTitle1 = "جلسات دوره"; - - this.setPanelComponentName(); - - this.getEntityInfo(this.routeKey, this.routeId); - this.getListInformation(); - - this.listData = this.listEntityGetter; - this.setShowListRight(); - - var font = JSON.parse(localStorage.getItem("settings")); - this.progress = font?.fontSize; - - // اگر شرط سوم فعال باشه، هر سری که کامپوننت (entityview1) لود بشه ، درخواست به سرور ارسال میشه - // گرفتن دوباره اسکیما - // این کامنت موقت - - let isRouterKeyFixed = - this.activeEntityViewSchemaGetter && - this.entityViewSchemaGetter && - this.activeEntityViewSchemaGetter?.key == this.$route.params?.key; - - if (isRouterKeyFixed) { - this.updateMainContent(); - } else this.getSchemas(); - - if (window.outerWidth < 992) { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - } - - if (this.activeEntityViewSchemaGetter?.tabs) { - if (this.activeTabGetter) this.setActiveTab(this.activeTabGetter); - else this.setActiveTab(this.activeEntityViewSchemaGetter.tabs[0]); - } - - const { $eventBus } = useNuxtApp(); - $eventBus.on("update-component-data", () => { - this.updateComponentData(); - }); - - this.getDataTree(); - if (buildName() == "hadith") { - this.getBooksList(); - } - }, - watch: { - mainComponentName(newVal) { - this.setShowListRight(newVal); - // if (this.$route.name !== "show") { - // if ( - // // newVal === "PropertyBuilder" || - // // newVal === "EntityRepetitionWords" || - // newVal === "Gantt" - // ) { - // this.showListRight = false; - // } else { - // this.showListRight = true; - // } - // } - }, - similarInfoGetter(newVal) { - if (newVal.show) { - this.openModal("EntitySimilar", newVal.label, newVal.text); - } - }, - statusButtonGetter(newVal) { - this.statusPage = newVal; - }, - // statusRemovCheckBoxGetter(newVal) { - // this.removCheckBox(); - // }, - $route: { - handler(to, from) { - this.setPanelComponentName(); - }, - deep: true, - nested: true, - }, - }, - data() { - return { - routeKey: "", - routeId: "", - - dataOrganhMeta: "", - renderAutoComplation: 1, - listTabTitle1: "از جستجو", - listTabTitle2: "تاریخچه", - activeListType: "simple", - // readingMode: false, - renderResearch: 1, - httpService: undefined, - slotComponentName: null, - mainComponentName: null, - tempComponentName: null, - modalTitle: null, - slug: null, - statusPage: 1, - copmareSideBySide: true, - compareLineByLine: false, - uploadForFirstTime: false, - showFilter: true, - showListRight: true, - hideCircleButton: true, - showSimilar: false, - isSearchMode: false, - isHeadingMode: false, - showEntityHeading: false, - valueResearchModal: {}, - firstItem: {}, - sidbarMenuDefault: sidbarMenuDefault, - sidbarMenuMajles: sidbarMenuMajles, - params: this.$route.params, - firstList: [], - listData: [], - description: "", - editItem: "", - editComponent: "", - newComponent: "", - panelComponentName: "Navigation", - text1Compare: "", - text2Compare: "", - listBooks: [], - pagination: { - page: 0, - total: 0, - pageTop: 0, - pageBottom: 1, - offset: 0, // page * per_page - limit: 25, //per_page - }, - path: this.$route.path, - dataTree: [], - listBooks: [], - pagination: { - page: 0, - total: 0, - pageTop: 0, - pageBottom: 1, - offset: 0, // page * per_page - limit: 25, //per_page - }, - viewMode: "table", - sectionItem: {}, - versionItem: [], - listItemsCompare: {}, - isPrevComponent: "text", - // text: "", - // uuid: undefined, - // texts3: "تحلیل", - // editDescription: "", - // editData: "", - // bedtimeText: "", - // showchang: true, - // editTitle: "", - // editVersion: "", - // showFish: false, - // fishModalTitle: "", - }; - }, - computed: { - ...mapState(useEntityStore, [ - "selectedItemEntityGetter", - "listEntityGetter", - "statusButtonGetter", - "similarInfoGetter", - "entityViewSchemaGetter", - "activeEntityViewSchemaGetter", - "activeTabGetter", - "isReadingModeGetter", - ]), - ...mapState(useCommonStore, [ - "organNameGetter", - "isSidebarCollapsed", - "currentUser", - ]), - - autoComplationPlaceholder() { - if (this.activeEntityViewSchemaGetter?.search_placeholder) - return this.activeEntityViewSchemaGetter.search_placeholder; - else return "جستجو در عنوان"; - }, - - navList() { - if (!isMajlesBuild()) return this.activeEntityViewSchemaGetter?.tabs; - - if (this.activeEntityViewSchemaGetter?.tabs) { - let list = this.activeEntityViewSchemaGetter?.tabs; - if (!this.isDevelopMode) - list = this.activeEntityViewSchemaGetter?.tabs.filter((item) => { - item?.isDevelopMode == 1; - }); - return list; - } else return []; - }, - columnClass() { - if (!isMajlesBuild() && this.showListRight) { - return "col-12 col-md-9"; // وقتی شرط برقرار باشد - } - return "col-12"; // در حالت عادی - }, - sidbarMenu() { - if (isMajlesBuild()) return sidbarMenuMajles; - else return sidbarMenuDefault; - }, - modalWidthManagement() { - switch (this.slotComponentName) { - case "EntitiyModalCompareVersionQa": - return "modal-md"; - break; - - default: - return "modal-xl"; - break; - } - }, - modalHeightManagement() { - switch (this.slotComponentName) { - case "EntitiyModalCompareVersionQa": - return "430px"; - break; - - default: - return "556px"; - break; - } - }, - }, - methods: { - ...mapActions(useEntityStore, [ - "SET_ITEM_ENTITY", - "SET_LIST_ENTITY", - "SET_STATUS_ENTITY_VIEWPAGE", - "SET_STATUS_BUTTON", - "SET_FONT", - "activeEntityViewSchemaSetter", - "entityViewSchemaSetter", - "activeTabSetter", - ]), - ...mapActions(useCommonStore, ["TOGGLE_PANEL"]), - editProperty(innerGroupItem) { - this.dataOrganhMeta = innerGroupItem; - this.openModal("TagsEdit", "ویرایش " + innerGroupItem?.label); - }, - onSelectHistory(payload) { - let _id = payload.searchItem._source.qanon_id; - let _listkey = this.$route.query.listkey; - let name = "navigationView"; - - if (_listkey) name = "navigation"; - - this.$router - .push({ - name: name, - params: { - id: _id, - key: this.$route.params?.key, - }, - query: { - searchtext: payload.textSearch ?? undefined, - listkey: _listkey, - }, - }) - .catch(() => {}); - }, - getBooksList() { - let field_collapse = "book_title"; //"normal" - - let url = repoUrl() + libraryApi.search.volume; - url = url.replace("{{field_collapse}}", field_collapse); - url = url.replace("{{offset}}", this.pagination.offset); - url = url.replace("{{limit}}", this.pagination.limit); - url = url.replace("{{filter}}", "none"); - - this.httpService - .postRequest(url) - .then((response) => { - this.listBooks = []; - - this.listBooks = response.hits?.hits.map((item) => { - const source = item._source; - const publishDate = item._source.publish_date - ? new Date(source.publish_date).toLocaleDateString("fa-IR") - : null; - // console.log(publishDate); - - return { - ...item, - _source: { - ...source, - publish_date: publishDate, - }, - }; - }); - }) - .catch((error) => {}); - }, - updateComponentData() { - if (this.$route.query?.listkey == "branch") - this.listTabTitle1 = "جلسات دوره"; - - this.setPanelComponentName(); - - this.getEntityInfo(this.routeKey, this.routeId); - this.getListInformation(); - - this.listData = this.listEntityGetter; - this.setShowListRight(); - - var font = JSON.parse(localStorage.getItem("settings")); - this.progress = font?.fontSize; - - // اگر شرط سوم فعال باشه، هر سری که کامپوننت (entityview1) لود بشه ، درخواست به سرور ارسال میشه - // گرفتن دوباره اسکیما - // این کامنت موقت - - let isRouterKeyFixed = - this.activeEntityViewSchemaGetter && - this.entityViewSchemaGetter && - this.activeEntityViewSchemaGetter?.key == this.$route.params?.key; - - if (isRouterKeyFixed) { - this.updateMainContent(); - } else this.getSchemas(); - - if (window.outerWidth < 992) { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - } - - if (this.activeEntityViewSchemaGetter?.tabs) { - if (this.activeTabGetter) this.setActiveTab(this.activeTabGetter); - else this.setActiveTab(this.activeEntityViewSchemaGetter.tabs[0]); - } - }, - // switchViewGraph(event) { - // if (event == "show") this.mainComponentName = "EntityChartGraph"; - // else this.mainComponentName = "EntityQaRelation"; - // }, - - switchView(event) { - if (event == "show") { - if (this.activeTabGetter?.key == "graph") { - this.mainComponentName = "EntityChartGraph"; - } else if (this.activeTabGetter?.key == "gantt") { - this.mainComponentName = "EntityChartGantt"; - this.viewMode = "table"; - } - } else { - if (this.activeTabGetter?.key == "graph") { - this.mainComponentName = "EntityQaRelation"; - } else if (this.activeTabGetter?.key == "gantt") { - this.mainComponentName = "EntityChartGantt"; - this.viewMode = "chart"; - } - } - }, - setActiveListType(componentName, listType) { - this.panelComponentName = componentName; - this.activeListType = listType; - }, - toggleReadingMode(event) { - // if (event) this.readingMode = false; - // else this.readingMode = true; - }, - - getModalHeight() { - return this.slotComponentName === "SelectEntityText" ? "30em" : "auto"; - }, - - // removCheckBox() { - // let remov = this.statusRemovCheckBoxGetter; - // let index; - // this.listResearch.forEach((item) => { - // if (item === remov) { - // index = this.listItem.indexOf(item); - // this.listItem.splice(index, 1); - // } - // }); - // }, - // datefa(item) { - // var m = this.selectedItemEntityGetter.begin_date; - // var d = new Date(m).toLocaleDateString("fa-IR"); - // return d; - // }, - // updateFont(event) { - // if (this.progress == "15") { - // this.progress = JSON.parse(localStorage.getItem("settings")); - // } else { - // this.progress = event.target?.value; - // this.SET_FONT(this.progress); - // const settings = { - // fontSize: this.progress, - // }; - // localStorage.setItem("settings", JSON.stringify(settings)); - // } - // }, - - /** - * مدیریت نمایش مدال تحقیق. - * @param {Object} value - مقدار شامل اطلاعات ویرایش آیتم. - */ - researchModalHandler(value) { - if (value.itemEdit._source.research_key == "term") { - this.termHandler(value); - } else if (value.itemEdit._source.research_key == "note") { - this.annotationHandler(value); - } else if (value.itemEdit._source.research_key == "fish") { - this.fishHandler(value); - } else { - // let key = value.itemEdit._source?.research_key; - - let schema = this.activeEntityViewSchemaGetter.contextMenu.find( - (item) => item.key === value.itemEdit._source?.research_key - ); - this.valueResearchModal = value; - this.valueResearchModal.itemSchema = schema; - this.openModal("ComponentTextFish", schema.title); - } - }, - /** - * مدیریت نمایش مدال حاشیهنویسی. - * @param {Object} item - آیتم شامل اطلاعات schema. - */ - - annotationHandler(item) { - this.valueResearchModal = item; - this.openModal("ComponentTextFish", item.itemSchema.title); - }, - /** - * مدیریت نمایش مدال فیش. - * @param {Object} item - آیتم شامل اطلاعات schema. - */ - fishHandler(item) { - this.valueResearchModal = item; - this.openModal("ComponentTextFish", item.itemSchema.title); - }, - /** - * مدیریت نمایش مدال اصطلاح. - * @param {Object} item - آیتم شامل اطلاعات schema. - */ - termHandler(item) { - this.valueResearchModal = item; - this.openModal("SelectTerm", "انتخاب اصطلاح ", "", "term"); - }, - /** - * تغییر وضعیت نمایش سرخط نهاد. - */ - showListHeadline({ isSearchMode, isHeadingMode }) { - this.isSearchMode = isSearchMode; - this.isHeadingMode = isHeadingMode; - - // this.showEntityHeading = !this.showEntityHeading; - }, - /** - * بررسی اینکه آیا کاربر میتواند یک کلید خاص را ببیند. - * @param {String} keyName - نام کلید برای بررسی. - * @returns {Boolean} - اگر کاربر میتواند کلید را ببیند true و در غیر اینصورت false. - */ - canSee(keyName) { - if (this.currentUser?.user_level > 1) return true; - return this.userPermisionGetter.includes(keyName); - }, - async getEntityText(id) { - let key = this.routeKey; - let url = ""; - - if (key == "qasection" || key == "rgsection") { - url = repoUrl() + entityApi.comparison.getParent; - url = url.replace("@index_key", key); - url = url.replace("@parent_id", id); - } else { - url = repoUrl() + entityApi.comparison.getText; - url = url.replace("@index_key", key); - url = url.replace("@id", id); - } - // console.log(url) - - return await this.httpService - .getRequest(url) - .then((res) => { - return res.text; - }) - .catch(() => { - return ""; - }); - }, - - /** - * بارگذاری متن برای مقایسه - * @param {String} text - متنی که باید بارگذاری شود. - */ - loadText(text) { - this.text2Compare = text; - let vm = this; - this.closeModal(); - this.getEntityText(this.routeId).then((text) => { - vm.text1Compare = text; - vm.mainComponentName = "EntityCompareText2"; - }); - }, - /** - * مدیریت مقایسه فایل ورد. - * @param {String} text - متنی که باید مقایسه شود. - */ - wordFile(text) { - this.text2Compare = text; - this.closeModal(); - this.getEntityText(this.routeId).then((text) => { - this.text1Compare = text; - this.mainComponentName = "EntityCompareText2"; - }); - }, - /** - * مدیریت مقایسه متن. - * @param {String} id - شناسه متنی که باید مقایسه شود. - */ - compareText(id) { - this.mainComponentName = "EntityCompareText2"; - this.closeModal(); - - let vm = this; - - this.getEntityText(id).then((text) => { - vm.text2Compare = text; - vm.getEntityText(vm.routeId).then((text) => { - vm.text1Compare = text; - vm.mainComponentName = "EntityCompareText2"; - }); - }); - }, - /** - * بستن نمای مقایسه. - */ - closeCompare() { - if (this.activeEntityViewSchemaGetter?.tabs) { - switch (this.isPrevComponent) { - case "text": - this.setActiveTab(this.activeEntityViewSchemaGetter.tabs[0]); - break; - case "gantt": - this.setActiveTab(this.activeEntityViewSchemaGetter.tabs[4]); - break; - default: - this.setActiveTab(this.activeEntityViewSchemaGetter.tabs[0]); - } - } - }, - /** - * بستن مدال. - */ - closeModal() { - // $("#base-modal").modal("hide"); - this.slotComponentName = undefined; - this.modalTitle = undefined; - this.description = undefined; - this.listData = []; - this.valueResearchModal = {}; - - setTimeout(() => { - this.uploadForFirstTime = false; - }, 500); - }, - closeAfterSaving() { - this.renderResearch++; - this.closeModal(); - }, - saveBaseModal() {}, - /** - * باز کردن مدال با کامپوننت و عنوان مشخص. - * @param {String} componentName - نام کامپوننتی که باید در مدال نمایش داده شود. - * @param {String} title - عنوان مدال. - * @param {String} [description=""] - توضیحات مدال. - * @param {String} [key=undefined] - کلید برای مدال. - */ - openModal(componentName, title, description, key = undefined) { - this.slotComponentName = componentName; - this.modalTitle = title; - this.description = description; - this.uploadForFirstTime = true; - // setTimeout(() => { - // $("#base-modal").modal({ backdrop: "static", keyboard: false }, "show"); - // }, 500); - }, - /** - * تنظیم نمایش موارد مشابه. - * @param {Boolean} [isShow=true] - نشان میدهد که آیا باید موارد مشابه نمایش داده شوند یا خیر. - */ - setShowSimilar(isShow = true) { - this.showSimilar = isShow; - }, - /** - * نمایش تجزیهگر در صورت صحیح بودن شرط. - * @param {Boolean} isShow - نشان میدهد که آیا باید تجزیهگر نمایش داده شود یا خیر. - */ - showParserIfTrue(isShow) { - if (!isShow) { - this.tempComponentName = this.mainComponentName; - this.mainComponentName = "EntityRepetitionWords"; - } else { - this.mainComponentName = this.tempComponentName ?? "EntityText"; - } - }, - /** - * مدیریت دکمه دایرهای. - */ - circleButton() { - this.hideCircleButton = true; - this.isVisiablePanel = true; - }, - /** - * مدیریت رویداد کامپوننت جدید. - * @param {Event} event - شیء رویداد. - */ - NewComponent(event) { - this.newComponent = event; - if (event == true) { - this.statusPage = 2; - } else { - this.statusPage = 1; - } - }, - /** - * مدیریت رویداد ویرایش وضعیت. - * @param {Event} event - شیء رویداد. - */ - statusEdit(event) { - if (event == false) { - this.statusPage = 1; - } - }, - - /** - * مدیریت رویداد انتخاب سطح آیتم. - * @param {Event} event - شیء رویداد. - */ - selectedItemlevel(event) { - this.editItem = event; - }, - /** - * مدیریت رویداد ویرایش کامپوننت. - * @param {Event} event - شیء رویداد. - */ - EditComponent(event) { - this.editComponent = event; - - if (event.EditComponent == true || event.EditComponent == false) { - this.statusPage = 2; - } else { - this.statusPage = 1; - } - }, - /** - * تنظیم تب فعال. - * @param {Object} tab - شیء تب که باید فعال شود. - */ - setActiveTab(tab) { - this.activeTabSetter(tab); - // close text headings and search section. - this.showListHeadline({ - isSearchMode: false, - isHeadingMode: false, - }); - - if (this.showSimilar) this.showSimilar = tab?.key == "content"; - - this.mainComponentName = "EntityText"; - if (tab?.key == "content") { - // if (this.activeEntityViewSchemaGetter?.key == this.routeKey) - if (this.activeEntityViewSchemaGetter?.type) - this.mainComponentName = this.activeEntityViewSchemaGetter?.type; - else this.mainComponentName = "EntityText"; - } else if (tab.key == "meta") { - this.mainComponentName = "PropertyBuilder"; - } else if (tab.key == "parser") { - this.mainComponentName = "EntityRepetitionWords"; - } else if (tab.key == "gantt") { - this.mainComponentName = "EntityChartGantt"; - } else if (tab.key == "graph") { - this.mainComponentName = "EntityChartGraph"; - } else if (tab.key == "compare") { - this.mainComponentName = "EntityQaSection"; - } - }, - /** - * تنظیم وضعیت صفحه به ۱ برای ویرایش واگذاری. - */ - - waiverEdit() { - this.statusPage = 1; - }, - /** - * دریافت اطلاعات schema. - */ - getSchemas() { - let url = repoUrl() + entityApi.schema.list; - - this.httpService - .postRequest(url, { - organ: this.organNameGetter, - system: "entityView", - build_state: buildState(), - }) - .then((response) => { - const routeParamsKey = this.routeKey; - - let schemaBasedOnRouteKeyIndex = response.data.entityView.findIndex( - (item) => item.key == routeParamsKey - ); - schemaBasedOnRouteKeyIndex = - schemaBasedOnRouteKeyIndex == -1 ? 0 : schemaBasedOnRouteKeyIndex; - - this.entityViewSchemaSetter(response.data.entityView); - this.activeEntityViewSchemaSetter( - response.data.entityView[schemaBasedOnRouteKeyIndex] - ); - this.activeTabSetter( - response.data.entityView[schemaBasedOnRouteKeyIndex].tabs[0] - ); - - this.renderAutoComplation++; - this.updateMainContent(); - }); - }, - /** - * تغییر وضعیت نمایش منوی سایدبار. - */ - toggleSidebarMenu() { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - }, - /** - * تغییر وضعیت نمایش پنل لیست. - */ - showToggleListPanel() { - this.showListPanel = !this.showListPanel; - }, - /** - * دریافت مقدار یک داده بر اساس کلید و نوع آن (در صورت وجود). - * @param {String} key - کلید داده مورد نظر. - * @param {String} [type=""] - نوع داده (اختیاری). - * @returns {String} - مقدار داده. - */ - // getDataValue(key, type = "") { - // let value = ""; - // if (this.selectedItemEntityGetter[key]) { - // value = this.selectedItemEntityGetter[key]; - // if (type == "date") value = this.datefa(value); - // } - // return value; - // }, - - /** - * دریافت اطلاعات موجودیت بر اساس نوع و شناسه آن. - * @param {String} _entityType - نوع موجودیت. - * @param {String} _entityId - شناسه موجودیت. - */ - - getEntityInfo(_entityType, _entityId) { - if (this.fetchingData) return; - this.fetchingData = true; - - this.entity_type = _entityType; - - if (_entityType == "qasection" || _entityType == "rgsection") { - //در این حالت استفاده ندارد تست کردم - // // برای تنظیم داده های هدر در تبهای مختلف غیر متن نیاز هست - // let url = repoUrl() + repoApi.entity.qanonList; - // url = url.replace("@index_key", _entityType); - // url = url.replace("@parent_key", "qanon_id"); - // url = url.replace("@parent_id", _entityId); - // url = url.replace("@from", 0); - // url = url.replace("@countInPage", 1); - // this.httpService.getRequest(url).then((response) => { - // if (response.hits.total.value > 0) { - // let res = response.hits.hits[0]; - // this.entity = { ...res, ...res._source }; - // this.SET_ITEM_ENTITY(this.entity); - // setDocumentTitle(this.selectedItemEntityGetter); - // } - // this.fetchingData = false; - // }); - } else { - let url = repoUrl() + repoApi.public.get; - url = url.replace("{{index_key}}", _entityType); - url = url.replace("{{entity_id}}", _entityId); - - this.httpService.getRequest(url).then((res) => { - this.entity = { ...res, ...res._source }; - - this.SET_ITEM_ENTITY(this.entity); - this.fetchingData = false; - useHead({ - title: this.selectedItemEntityGetter, - }); - }); - } - }, - /** - * دریافت اطلاعات لیست موجودیتها از localStorage در صورت عدم وجود در getter. - */ - getListInformation() { - const myList = localStorage.getItem("myList"); - this.jsonList = JSON.parse(myList); - const myItem = localStorage.getItem("myItem"); - this.firstItem = JSON.parse(myItem); - this.SET_LIST_ENTITY(this.jsonList); - if (this.selectedItemEntityGetter === undefined) { - this.SET_ITEM_ENTITY(this.firstItem); - useHead({ - title: this.selectedItemEntityGetter, - }); - // setDocumentTitle(this.selectedItemEntityGetter); - } - }, - /** - * بهروزرسانی تاریخ در عنصر با کلاس begin_date. - */ - updateDate() { - const myelement = document.getElementsByClassName("begin_date"); - const date = myelement[0].innerHTML; - }, - - /** - * تنظیم نام کامپوننت پنل بر اساس مسیر جاری. - */ - setPanelComponentName() { - // if (this.$route.name == "entityEdit") { - // this.panelComponentName = "EntityTreeList"; - // } else - - if (this.$route.name == "navigationView") { - this.panelComponentName = "navigation"; - } else if (this.$route.name == "entityResearch") { - this.panelComponentName = "research"; - } else { - this.panelComponentName = this.$route.name; - } - }, - setShowListRight(mainComponent = undefined) { - let routeName = this.$route.name; - - if (mainComponent === "EntityChartGantt") { - this.showListRight = false; - } else if (routeName == "showEntity") { - this.showListRight = false; - } else if (routeName == "navigation" && !this.listEntityGetter) { - this.showListRight = false; - } else if (routeName == "research") { - this.showListRight = false; - } else this.showListRight = true; - }, - /** - * دریافت کامپوننت پنل بر اساس مسیر جاری. - * @returns {String|null} - نام کامپوننت پنل. - */ - getPanelComponent() { - this.setShowListRight(); - - if (!this.showListRight) return null; - - if ( - this.activeEntityViewSchemaGetter?.entityPanel && - this.activeEntityViewSchemaGetter?.entityPanel[this.$route.name] - ) - return this.activeEntityViewSchemaGetter?.entityPanel[this.$route.name]; - else return this.activeEntityViewSchemaGetter?.entityPanel[0]; - }, - /** - * بهروزرسانی محتوای اصلی بر اساس کلید موجود در مسیر. - */ - updateMainContent() { - if (this.routeKey) { - if (this.activeEntityViewSchemaGetter?.key == this.routeKey) - this.mainComponentName = this.activeEntityViewSchemaGetter?.type; - else this.mainComponentName = "EntityText"; - } else this.mainComponentName = "EntityText"; - }, - /** - * یافتن ایندکس و بازگرداندن نام کامپوننت بر اساس کلید. - * @param {String} keyName - کلید موجودیت. - * @returns {String} - نام کامپوننت. - */ - findIndexAndReturnComponentName(keyName) { - const contentIndex = this.entityViewSchemaGetter?.findIndex( - (item) => item.key == keyName - ); - return this.entityViewSchemaGetter[contentIndex]?.type; - }, - /** - * پنهان کردن پنل. - */ - hidePanel() { - this.hideCircleButton = false; - this.isVisiablePanel = false; - }, - /** - * تغییر حالت مقایسه. - * @param {Boolean} item - وضعیت مقایسه. - */ - changeCompare(item) { - if (!item) { - this.copmareSideBySide = false; - this.compareLineByLine = true; - } else { - this.copmareSideBySide = true; - this.compareLineByLine = false; - } - }, - closeSearchMode() { - this.isSearchMode = false; - }, - closeTreelistMode() { - this.isHeadingMode = false; - }, - getDataTree() { - if (buildName() === "majles") { - let url = repoUrl() + buildName() + "/" + entityApi.edit.treeList; - url = url.replace("@index_key", this.routeKey); - url = url.replace("@qanon_id", this.routeId); - - this.httpService.getRequest(url).then((res) => { - this.dataTree = res.data; - // this.loading = false; - }); - } else if (buildName() === "hadith") { - let id = this.routeId; - let url = repoUrl() + libraryApi.tree.getDataTree; - url = url.replace("@offset", 0); - url = url.replace("@limit", 500); - url = url.replace("@vol_id", id); - url = url.replace("@q", "none"); - - this.httpService.getRequest(url).then((res) => { - this.dataTree = this.convertToTree(res.hits.hits); - // this.loading = false; - }); - } - }, - /** - * تبدیل دادههای خطی به ساختار درختی. - * @param {Array} rawData - آرایهای از دادههای ورودی که باید به ساختار درختی تبدیل شوند. - * @returns {Array} - ساختار درختی شامل آیتمهای سطح اول و زیرآیتمهایشان. - */ - convertToTree(rawData) { - let prevlevel = -1; // سطح قبلی برای مقایسه (مقدار اولیه -1 به معنای بدون سطح قبلی) - let pathItems = []; // آرایهای برای ذخیره مسیر آیتمها در ساختار درختی - let prevItem = undefined; // آیتم قبلی که در حال پردازش است - - let list = []; // لیست نهایی که شامل آیتمهای سطح اول درخت است - - rawData.forEach((el) => { - let jumpPage = el._source?.meta?.page; - // استخراج سطح و ایجاد آیتم جدید - let level = el._source?.meta?.level; - let item = { - id: el._id, - text: el._source?.content, - jumpPage: jumpPage, - children: [], - }; - - // قرار دادن آیتم در ساختار درختی بر اساس سطح آن - if (prevlevel == -1 || level == 1) { - // اگر این اولین آیتم است یا سطح آن 1 است، به سطح اول اضافه میشود - list.push(item); - pathItems.push(item); - } else if (level > prevlevel) { - // اگر سطح فعلی بیشتر از سطح قبلی باشد، آیتم فرزند آیتم قبلی میشود - prevItem.children.push(item); - pathItems.push(item); - } else if (level == prevlevel) { - // اگر سطح فعلی برابر با سطح قبلی باشد، آیتم به خواهر/برادر آیتم قبلی اضافه میشود - if (pathItems.length > 1) { - pathItems[pathItems.length - 2].children.push(item); - } - } else { - // اگر سطح فعلی کمتر از سطح قبلی باشد - let diff = prevlevel - level; // اختلاف سطح فعلی و قبلی - if (pathItems.length > diff + 1) { - pathItems[pathItems.length - 1 - diff].children.push(item); - } - } - - // بهروزرسانی مقادیر قبلی برای پردازش آیتم بعدی - prevlevel = level; - prevItem = item; - }); - - return list; // بازگرداندن ساختار درختی نهایی - }, - chartGanttClickNode(event) { - this.openModal("EntityQaSection", event.name, ""); - // .then( - // () => { - // // this.name = event.name; - // // this.y = event.y; - // // this.getChartTreeItems(this.name, this.y); - // } - // ); - }, - linkedTitleClick(rowItem, tableColumn, index) { - this.sectionItem = rowItem; - setTimeout(() => { - this.openModal("EntityQaHistory", "وضعیت", ""); - }, 500); - }, - columnTitleClick(tableColumn) { - console.log("5555555555"); - this.listItemsCompare = tableColumn; - - let id = this.routeId; - - let payload = { - qanon_id: id, - date: tableColumn.title, - }; - - let url = entityApi.chart.version; - let key = this.activeEntityViewSchemaGetter?.key; - url = url.replace("@index_key", key); - - this.httpService.postRequest(url, payload).then((res) => { - this.versionItem = res.data; - let data = res.data; - data.forEach((element) => { - this.text1Compare = element._source.content; - this.text2Compare = element._source.content; - }); - this.openModal("EntityShowVersionsQa", tableColumn.titleTooltip, ""); - }); - }, - handlerIconClick(tableColumn) { - this.listItemsCompare = tableColumn; - this.openModal("EntitiyModalCompareVersionQa", "مقایسه نسخه ها"); - }, - compareVersionsQanon(versionOneContent, versionTwoContent) { - this.text1Compare = versionOneContent; - this.text2Compare = versionTwoContent; - - this.isPrevComponent = "gantt"; - this.closeModal(); - this.mainComponentName = "EntityCompareText2"; - }, - showCompareModal() { - this.isPrevComponent = "text"; - this.openModal("SelectEntityText", "انتخاب متن مقایسه"); - }, - editSections() { - this.openModal("DraftImportEffectModal", "ویرایش"); - }, - chartGanttClickNode(event) { - this.openModal("EntityQaSection", event.name, ""); - // .then( - // () => { - // // this.name = event.name; - // // this.y = event.y; - // // this.getChartTreeItems(this.name, this.y); - // } - // ); - }, - linkedTitleClick(rowItem, tableColumn, index) { - this.sectionItem = rowItem; - setTimeout(() => { - this.openModal("EntityQaHistory", "وضعیت", ""); - }, 500); - }, - columnTitleClick(tableColumn) { - this.listItemsCompare = tableColumn; - - let id = this.$route.params.id; - - let payload = { - qanon_id: id, - date: tableColumn.title, - }; - - let url = entityApi.chart.version; - let key = this.activeEntityViewSchemaGetter?.key; - url = url.replace("@index_key", key); - - this.httpService.postRequest(url, payload).then((res) => { - this.versionItem = res.data; - let data = res.data; - data.forEach((element) => { - this.text1Compare = element._source.content; - this.text2Compare = element._source.content; - }); - this.openModal("EntityShowVersionsQa", tableColumn.titleTooltip, ""); - }); - }, - handlerIconClick(tableColumn) { - this.listItemsCompare = tableColumn; - this.openModal("EntitiyModalCompareVersionQa", "مقایسه نسخه ها"); - }, - compareVersionsQanon(versionOneContent, versionTwoContent) { - this.text1Compare = versionOneContent; - this.text2Compare = versionTwoContent; - - this.isPrevComponent = "gantt"; - this.closeModal(); - this.mainComponentName = "EntityCompareText2"; - }, - showCompareModal() { - this.isPrevComponent = "text"; - this.openModal("SelectEntityText", "انتخاب متن مقایسه"); - }, - editSections() { - this.openModal("DraftImportEffectModal", "ویرایش"); - }, - }, - - components: { - AutoComplation: defineAsyncComponent(() => - import("../../../../../../components/global/AutoComplation.vue") - ), - EntityQaRelation: defineAsyncComponent(() => - import("~/components/entity/components/EntityQaRelation.vue") - ), - ComponentTextFish: defineAsyncComponent(() => - import("~/components/entity/components/ComponentTextFish.vue") - ), - ComparisonEntity: defineAsyncComponent(() => - import("~/components/entity/components/ComparisonEntity.vue") - ), - SelectEntityText: defineAsyncComponent(() => - import("~/components/entity/components/SelectEntityText.vue") - ), - EntitySelectTerm: defineAsyncComponent(() => - import("~/components/entity/components/EntitySelectTerm.vue") - ), - EntityText: defineAsyncComponent(() => - import("~/components/entity/components/EntityText.vue") - ), - EntityMqSection: defineAsyncComponent(() => - import("~/components/entity/components/EntityMqSection.vue") - ), - EntityQaSection: defineAsyncComponent(() => - import("~/components/entity/components/EntityQaSection.vue") - ), - EntityChartGraph: defineAsyncComponent(() => - import("~/components/entity/components/EntityChartGraph.vue") - ), - EntityChartGantt: defineAsyncComponent(() => - import("~/components/entity/components/EntityChartGantt.vue") - ), - EntityCompareText: defineAsyncComponent(() => - import("~/components/entity/components/EntityCompareText.vue") - ), - EntityCompareText2: defineAsyncComponent(() => - import("~/components/entity/components/EntityCompareText2.vue") - ), - EntitySimilar: defineAsyncComponent(() => - import("~/components/entity/components/EntitySimilar.vue") - ), - EntitySanad: defineAsyncComponent(() => - import("~/components/entity/components/EntitySanad.vue") - ), - EntityVoice: defineAsyncComponent(() => - import("~/components/entity/components/EntityVoice.vue") - ), - EntityVideo: defineAsyncComponent(() => - import("~/components/entity/components/EntityVideo.vue") - ), - EntityFile: defineAsyncComponent(() => - import("~/components/entity/components/EntityFile.vue") - ), - EntityRepetitionWords: defineAsyncComponent(() => - import("~/components/entity/components/EntityRepetitionWords.vue") - ), - LibraryText: defineAsyncComponent(() => - import("~/components/library/components/LibraryText.vue") - ), - EntityQaHistory: defineAsyncComponent(() => - import("~/components/entity/components/EntityQaHistory.vue") - ), - EntityShowVersionsQa: defineAsyncComponent(() => - import("~/components/entity/components/EntityShowVersionsQa.vue") - ), - EntitiyModalCompareVersionQa: defineAsyncComponent(() => - import("~/components/entity/components/EntitiyModalCompareVersionQa.vue") - ), - UserHistory: defineAsyncComponent(() => - import("~/components/entity/sidebar-panels/UserHistory.vue") - ), - TextSearch: defineAsyncComponent(() => - import("~/components/entity/sidebar-panels/TextSearch.vue") - ), - NavigationView: defineAsyncComponent(() => - import("~/components/entity/sidebar-panels/Navigation.vue") - ), - Navigation: defineAsyncComponent(() => - import("~/components/entity/sidebar-panels/Navigation.vue") - ), - Research: defineAsyncComponent(() => - import("~/components/entity/sidebar-panels/Research.vue") - ), - EntityTreeList: defineAsyncComponent(() => - import("~/components/entity/sidebar-panels/EntityTreeList.vue") - ), - PropertyBuilder: defineAsyncComponent(() => - import("~/components/other/PropertyBuilder.vue") - ), - TagsEdit: defineAsyncComponent(() => - import("~/components/other/TagsEdit.vue") - ), - DraftImportEffectModal: defineAsyncComponent(() => - import("~/components/entity/modals/DraftImportEffectModal.vue") - ), - }, -}; -</script> -<style scoped lang="scss"> -.button-cloce { - position: relative; - right: 3em; - top: 1em; - z-index: 100; - .btn_close { - border-radius: 50%; - font-size: 0.8rem; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - display: flex; - justify-content: center; - align-items: center; - transform: translateX(1.5em); - background-color: #eee; - - &:hover { - filter: brightness(0.8); - } - } -} - -.nav-tabs-container { - display: flex; - justify-content: center; -} -.filter-list-container { - // padding-top: 0.5em; - // // position: fixed; - - // z-index: 9; - // width: 20em; - height: 100dvh; - .main-filter { - display: none; - } - .mobile-mode { - display: flex; - justify-content: flex-end; - - .btn { - border-radius: 50%; - // font-size: 0.7rem; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - display: flex; - justify-content: center; - align-items: center; - transform: translateX(1.5em); - background-color: #eee; - - &:hover { - filter: brightness(0.8); - } - } - } - - &.expanded { - top: 0; - bottom: 0; - background: #fff; - justify-content: center; - box-shadow: -1px 0px 7px 1px #eee; - // width: 20em; - .main-filter { - display: block; - height: 90dvh; - } - } -} -.main-filter { - padding: 0 1em; - // overflow: auto; -} -.component_page { - height: calc(100dvh - 13em); - overflow: auto; - padding-left: 1em; - overflow-x: hidden; - scrollbar-width: thin; - scrollbar-color: #ccc #eee; -} -.entity-tree-list { - border-radius: 0.5em; - overflow-y: auto; - box-shadow: 0 0.4688rem 2.1875rem rgba(4, 9, 20, 0.03), - 0 0.9375rem 1.4063rem rgba(4, 9, 20, 0.03), - 0 0.25rem 0.5313rem rgba(4, 9, 20, 0.03), - 0 0.125rem 0.1875rem rgba(4, 9, 20, 0.03); -} - -@media (max-width: 575.98px) { - .component_page { - height: calc(100dvh - 15em); - padding-left: 0.5em; - } - .button-cloce { - right: 2em; - } - .filter-list-container { - margin-right: -1em; - } - .main-filter { - width: 20em !important; - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { - .component_page { - height: calc(100dvh - 16em); - } - .filter-list-container { - margin-right: -1em; - } - .main-filter { - width: 20em !important; - } -} -@media only screen and (min-width: 768px) and (max-width: 991.98px) { - .component_page { - height: calc(100dvh - 16em); - } - .filter-list-container { - width: 20em !important; - margin-right: -1em; - } -} -@media only screen and (min-width: 992px) and (max-width: 1199.98px) { - .main-filter { - height: calc(100dvh - 11em); - // overflow: auto; - } - .component_page { - height: calc(100dvh - 15em); - } -} -@media (min-width: 1200px) { - .main-filter { - height: calc(100dvh - 5em); - // overflow: auto; - } -} -</style> diff --git a/pages/hadith/chat-bot.vue b/pages/hadith/chat-bot.vue new file mode 100644 index 0000000..ab9512c --- /dev/null +++ b/pages/hadith/chat-bot.vue @@ -0,0 +1,30 @@ +<template> + <HadithLayout> </HadithLayout> +</template> +<script> +export default { + name: "hadithChatBot", + setup() { + useHead({ + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | چت بات `, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, + }, + }); + + definePageMeta({ + layout: false, + name: "hadithChatBot", + }); + }, + components: { + // SectionOne: defineAsyncComponent(() => + // import("@hadith/components/hadith/hero-page/SectionOne.vue") + // ), + }, +}; +</script> +<style scoped></style> diff --git a/pages/hadith/chat.vue b/pages/hadith/chat.vue deleted file mode 100644 index d348817..0000000 --- a/pages/hadith/chat.vue +++ /dev/null @@ -1,247 +0,0 @@ -<template> - <div class="wrapper detail-page"> - <TopHeader - ref="topheader" - @searchStart="searchStart" - @showfilter="showfilter" - @searchType="searchTyping" - @="searchCoding" - ></TopHeader> - - <Content - :pagination="pagination" - @changeCurrent="changeCurrent" - @changePage="changePaging" - ref="content" - ></Content> - - <filter-list-search @filterUpdate="filterUpdate" ref="filterlist"></filter-list-search> - <Summary - ref="summary" - :meets="meets" - @hideSummary="hideSummary" - v-show="showSummary" - > - </Summary> - <!-- <ChartTree> - </ChartTree> --> - </div> -</template> - -<script> -// import axios from "axios"; -import TopHeader from "~/search/view/layout/Top.vue"; -import FilterListSearch from "~/search/view/layout/FilterListSearch.vue"; -import Content from "~/search/view/pages/TermContent.vue"; -import Summary from "~/search/view/layout/TermSummary.vue"; -import LogService from "~/services/log.service"; -import {mapState} from "pinia"; - -// -// const API = axios.create({ -// //baseURL: 'http://2.182.155.188', -// baseURL: import.meta.env.VITE_API_SEARCH, -// }) - -export default { - props: ["q"], - name: "Term", - data() { - return { - meets: [], - tq: this.q, - filterUrl: "", - loading: false, - showSummary: false, - countInPage: 10, - currentItem: [], - searchType: "", - searchCode: "all", - ismultword: false, - iscode: false, - page: 0, - pagination: { - page: 1, - pages: 0, - total: 0, - offset: 0, // page * per_page - limit: 10, //per_page - }, - }; - }, - computed:{ - ...mapState(["currentUser"]) - }, - - mounted() { - this.$refs.topheader.modetab = 3; - this.$refs.topheader.state = 2; - if (this.tq != "") { - var item = this.tq; - this.checkMultiword(item); - this.$refs.topheader.setSearchLine(this.tq); - this.$refs.content.setTextSearch(this.tq, this.countInPage); - this.getQuery(); - } - }, - methods: { - searchTyping(type) { - this.searchType = type; - }, - searchCoding(code) { - this.searchCode = code; - }, - resetOptions() { - this.page = 0; - this.filterUrl = ""; - this.$refs.filterlist.resetFilter(); - }, - showfilter: function() { - this.$refs.filterlist.showfilter(); - }, - checkMultiword(item) { - this.ismultword = false; - if (item == null || item == "") return; - var ww = item.split(" "); - this.iscode = /^\d+$/.test(item); - if (this.iscode == false) this.ismultword = item.split(" ").length > 1; - - this.$refs.topheader.setOptions(this.ismultword, this.iscode); - }, - searchStart: function(item) { - if (item != null) { - item = item.trim(); - this.tq = item; - - this.checkMultiword(item); - this.$refs.content.setTextSearch(item, this.countInPage); - } - this.resetOptions(); - this.getQuery(); - }, - changePaging: function(item) { - this.pagination = item; - this.getQuery(true); - }, - hideSummary: function() { - this.showSummary = false; - }, - changeCurrent(item) { - - if (item == this.currentItem) this.showSummary = !this.showSummary; - else this.showSummary = true; - this.currentItem = item; - - - - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/items/"; - - ApiService.getRequest( - suburl + - this.page + - "/" + - item.doc_count + - "/q=" + - item.key + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - - // if (title == this.currentItem) this.showSummary = !this.showSummary; - // else this.showSummary = true; - - // this.showSummary = true; - this.meets = response.data.hits.hits; - - // this.$refs.summary.setInfo(response.data.hits.hits); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - filterUpdate: function(filter) { - this.filterUrl = filter; - // history.pushState(null, '', '/list' + '/q='+ this.tq+ filter); - this.$router.push({ - name: "TermResult", - query: { q: this.tq + filter }, - }); - this.page = 0; - this.getQuery(false, true); - }, - - // typeNormal : جستجوی عادی - // typeAnd : جستجوی عطفی - // typePhrase : جستجوی عبارتی - - getQuery: function(pageOnly = false, filteronly = false) { - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/"; - if (this.ismultword) { - if (this.searchType == "typeAnd") suburl = "/monir/search/term/and/"; - else if (this.searchType == "typePhrase") - suburl = "/monir/search/term/phrase/"; - } - - ApiService.getRequest( - suburl + - this.pagination.offset + - "/" + - this.pagination.limit + - "/q=" + - this.tq + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - if (pageOnly) { - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets - ); - } else if (filteronly) { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - } else { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - response.data.aggregations.branch.buckets = []; - this.$refs.filterlist.setAnswer(response.data.aggregations); - } - - const total = response.data.hits.total.value; - const pages = Math.ceil(total / this.pagination.limit); - const pagination = { - total: total, - pages: pages == 0 ? 1 : pages - } - - this.pagination = { ...this.pagination, ...pagination }; - LogService.index(this.currentUser,vm.tq, vm.page, vm.filterUrl, response.data.took); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - }, -}; -</script> diff --git a/pages/hadith/favorites/[id]/[slug]/index.vue b/pages/hadith/favorites/[id]/[slug]/index.vue index d9265be..2cabc6e 100644 --- a/pages/hadith/favorites/[id]/[slug]/index.vue +++ b/pages/hadith/favorites/[id]/[slug]/index.vue @@ -1,257 +1,11 @@ <template> - - <div class="wrapper detail-page"> - <div class="detail-page__header" style="padding-top: 10px !important"> - <div class="detail-page__nav container-fluid"> - <ul class="list-unstyled"> - - </ul> - </div> - </div> - - - - - - <div ref="filterdiv" class="detail-page__filters div-meno" style="top: 80px"> - - - <button - id="m1" - style="border-radius: 50%;" - - class="btn buttonshow" - @click.prevent="showfilter" - > - <span class="tavasi tavasi-Component-356--1"></span> - </button> - - <button - id="m2" - - - class="btn buttonclose rounded-circle " - @click.prevent="hidefilter" - > - <span class="tavasi tavasi-Component-21--1"></span> - </button> - - <div> - <div class="scrollbar" - - - v-if="showAitem"> - <p v-for="(item, i) in listindexs" :key="i"> - <span v-html="item"></span> - </p> - <!-- <button type="bu" @click.prevent="hidefilter" class="text__15 btn btn-default popUp-tab__clear button_giveup"> - <svg - data-v-46e9fe5b="" - data-testid="chevron-double-lg-left-icon" - class="s12 icon-chevron-double-lg-left " - > - <use - data-v-46e9fe5b="" - href="/assets/img/icons.d6ff8c17.svg#chevron-double-lg-left" - ></use> - </svg> - بستن - </button> --> - </div> - </div> - </div> - - - - <div> - <div class="detail-page__content" style="padding-top: 80px"> - <div class="detail-page__tab-content"> - - - <div class="search-items"> - <div class="search-items__item"> - - <h1 class="text__14 text__dark-blue">{{ title }}</h1> - <br /> - <div v-if="paragraphs.length > 0"> - <p - v-for="(paragraph, i) in paragraphs" - :key="i" - style="line-height: 30px" - > - <span v-html="paragraph"></span> - </p> - </div> - <h3 v-else class="text__14 text__dark-gray"> - این جلسه متن ندارد - </h3> - - </div> - </div> - </div> - </div> - </div> - - </div> + <h1>favorite show page</h1> </template> <script> export default { - name: "ShowText", - props: ["index", "textSearch"], - data() { - return { - datainput: [], - initdata: false, - indexitem: this.index, - searchText: this.textSearch, - text: "", - text2: "", - showAitem: true, - showStatus: 1, - }; - }, - - created: function () { - let data = JSON.parse(localStorage.getItem("answer")); - this.datainput = data[this.indexitem]._source; - }, - computed: { - paragraphs() { - this.text = this.datainput.content; - - if (this.text.length > 0) { - this.text2 = this.getHighlight(this.text); - return this.text2.split("\n"); - } - return []; - }, - listindexs() { - var list = this.getHighlight(this.datainput.mindex); - return list.split("\n"); - }, - title() { - if (this.datainput.title) - return `${this.datainput.title} (کد جلسه: ${this.datainput.meet_code})`; - else - return `${this.datainput.subtitle} (کد جلسه: ${this.datainput.meet_code})`; - }, - }, - - mounted() { - //////this.setsummary(); - //this.$refs.summarytext.setInfo(this.datainput); - this.initdata = true; - - }, - methods: { - showfilter: function () { - // this.$refs.filterdiv.classList.add("show"); - this.showAitem = true; - this.showStatus = 1; - document.getElementById("m1").style.display = "none"; - document.getElementById("m2").style.display = "inline-block"; - - }, - hidefilter: function () { - // this.$refs.filterdiv.classList.remove("show"); - this.showAitem = false; - this.showStatus = 2; - document.getElementById("m1").style.display = "inline-block"; - document.getElementById("m2").style.display = "none"; - - // if(showAitem=false){ - // this.showfilter=!this.showfilter; - // } - }, - getHighlight(text) { - var words = this.searchText.split(" "); - var index = 1; - words.forEach((w) => { - if (w == "" || w == " ") { - return; - } - let classname = `searchHilight${index}`; - text = text.replaceAll( - w, - "<span class='" + classname + "'>" + w + "</span>" - ); - var w1 = this.normalize(w); - if (w1 != w) { - text = text.replaceAll( - w1, - "<span class='" + classname + "'>" + w1 + "</span>" - ); - } - index = index + 1; - if (index > 5) index = 1; - }); - return text; - }, - normalize(item) { - item = item.replaceAll("،", ""); - item = item.replaceAll(":", ""); - item = item.replaceAll(".", ""); - - item = item.replaceAll("ک", "ك"); - item = item.replaceAll("ی", "ي"); - item = item.replaceAll("إ", "ا"); - item = item.replaceAll("أ", "ا"); - item = item.replaceAll("آ", "ا"); - item = item.replaceAll("ة", "ت"); - return item; - }, - }, + name: "hadithFavoritesShow", }; </script> -<style lang="scss" scoped> -.search-system { - .detail-page__content { - top: 0; - } -} - -@media screen and (min-width: 992px) { - .detail-page .detail-page__content .detail-page__tab-content .search-items { - height: calc(100vh - 8em) !important; - overflow: auto; - } -} -.buttonclose { - - position: relative; - right: 5px; - width: 50px; - height: 50px; - z-index: 99999; - -} -.buttonclose span{ -font-size: 35px; -color: black; - - -} -.buttonshow span{ - color: black; - - } -.buttonshow { - position: relative; - color:inherit; - right: 5px; - width: 50px; - height: 50px; - z-index: 99999; -} -.div-meno{ - background-color: #f9f9f9 !important; -} - -#m1{ - display: none; -} - - -</style> +<style lang="scss" scoped></style> diff --git a/pages/hadith/favorites/index.vue b/pages/hadith/favorites/index.vue index d9265be..d693259 100644 --- a/pages/hadith/favorites/index.vue +++ b/pages/hadith/favorites/index.vue @@ -1,257 +1,75 @@ +<script setup> +definePageMeta({ + layout: false, + name: "hadithFavorites", +}); +useHead({ + name: "hadithFavorites", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | ذخیره ها`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, + }, +}); + +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); + +const SearchList = defineAsyncComponent(() => + import("@hadith/components/hadith/search-page/SearchList.vue") +); + +const state = reactive({ + searchList: new Array(5).fill(0), +}); +</script> + <template> - - <div class="wrapper detail-page"> - <div class="detail-page__header" style="padding-top: 10px !important"> - <div class="detail-page__nav container-fluid"> - <ul class="list-unstyled"> - - </ul> - </div> - </div> + <HadithLayout> + <div class="h-full flex flex-col justify-center"> + <div class="bg-container h-full"> + <navigation-menu></navigation-menu> - - - - - <div ref="filterdiv" class="detail-page__filters div-meno" style="top: 80px"> - - - <button - id="m1" - style="border-radius: 50%;" - - class="btn buttonshow" - @click.prevent="showfilter" - > - <span class="tavasi tavasi-Component-356--1"></span> - </button> - - <button - id="m2" - - - class="btn buttonclose rounded-circle " - @click.prevent="hidefilter" - > - <span class="tavasi tavasi-Component-21--1"></span> - </button> - - <div> - <div class="scrollbar" - - - v-if="showAitem"> - <p v-for="(item, i) in listindexs" :key="i"> - <span v-html="item"></span> - </p> - <!-- <button type="bu" @click.prevent="hidefilter" class="text__15 btn btn-default popUp-tab__clear button_giveup"> - <svg - data-v-46e9fe5b="" - data-testid="chevron-double-lg-left-icon" - class="s12 icon-chevron-double-lg-left " - > - <use - data-v-46e9fe5b="" - href="/assets/img/icons.d6ff8c17.svg#chevron-double-lg-left" - ></use> - </svg> - بستن - </button> --> - </div> - </div> - </div> - - - - <div> - <div class="detail-page__content" style="padding-top: 80px"> - <div class="detail-page__tab-content"> - - - <div class="search-items"> - <div class="search-items__item"> - - <h1 class="text__14 text__dark-blue">{{ title }}</h1> - <br /> - <div v-if="paragraphs.length > 0"> - <p - v-for="(paragraph, i) in paragraphs" - :key="i" - style="line-height: 30px" - > - <span v-html="paragraph"></span> - </p> - </div> - <h3 v-else class="text__14 text__dark-gray"> - این جلسه متن ندارد - </h3> - - </div> + <div class="text-logo"> + <div class="search-box-container pb-0 flex justify-center"> + <search-list + no-data-text="هنوز چیزی ذخیره نکردهاید!" + no-data-icon="/img/save.png" + :list="state.searchList" + ></search-list> </div> </div> </div> </div> - - </div> + </HadithLayout> </template> -<script> -export default { - name: "ShowText", - props: ["index", "textSearch"], - data() { - return { - datainput: [], - initdata: false, - indexitem: this.index, - searchText: this.textSearch, - text: "", - text2: "", - showAitem: true, - showStatus: 1, - }; - }, - - created: function () { - let data = JSON.parse(localStorage.getItem("answer")); - this.datainput = data[this.indexitem]._source; - }, - computed: { - paragraphs() { - this.text = this.datainput.content; - - if (this.text.length > 0) { - this.text2 = this.getHighlight(this.text); - return this.text2.split("\n"); - } - return []; - }, - listindexs() { - var list = this.getHighlight(this.datainput.mindex); - return list.split("\n"); - }, - title() { - if (this.datainput.title) - return `${this.datainput.title} (کد جلسه: ${this.datainput.meet_code})`; - else - return `${this.datainput.subtitle} (کد جلسه: ${this.datainput.meet_code})`; - }, - }, - - mounted() { - //////this.setsummary(); - //this.$refs.summarytext.setInfo(this.datainput); - this.initdata = true; - - }, - methods: { - showfilter: function () { - // this.$refs.filterdiv.classList.add("show"); - this.showAitem = true; - this.showStatus = 1; - document.getElementById("m1").style.display = "none"; - document.getElementById("m2").style.display = "inline-block"; - - }, - hidefilter: function () { - // this.$refs.filterdiv.classList.remove("show"); - this.showAitem = false; - this.showStatus = 2; - document.getElementById("m1").style.display = "inline-block"; - document.getElementById("m2").style.display = "none"; - - // if(showAitem=false){ - // this.showfilter=!this.showfilter; - // } - }, - getHighlight(text) { - var words = this.searchText.split(" "); - var index = 1; - words.forEach((w) => { - if (w == "" || w == " ") { - return; - } - let classname = `searchHilight${index}`; - text = text.replaceAll( - w, - "<span class='" + classname + "'>" + w + "</span>" - ); - var w1 = this.normalize(w); - if (w1 != w) { - text = text.replaceAll( - w1, - "<span class='" + classname + "'>" + w1 + "</span>" - ); - } - index = index + 1; - if (index > 5) index = 1; - }); - return text; - }, - normalize(item) { - item = item.replaceAll("،", ""); - item = item.replaceAll(":", ""); - item = item.replaceAll(".", ""); - - item = item.replaceAll("ک", "ك"); - item = item.replaceAll("ی", "ي"); - item = item.replaceAll("إ", "ا"); - item = item.replaceAll("أ", "ا"); - item = item.replaceAll("آ", "ا"); - item = item.replaceAll("ة", "ت"); - return item; - }, - }, -}; -</script> - -<style lang="scss" scoped> -.search-system { - .detail-page__content { - top: 0; - } +<style scoped> +.bg-container { + min-height: 100%; + /* height: 100dvh; */ + background-size: cover; + background-repeat: no-repeat; + background: #f7fffd; } -@media screen and (min-width: 992px) { - .detail-page .detail-page__content .detail-page__tab-content .search-items { - height: calc(100vh - 8em) !important; - overflow: auto; - } -} -.buttonclose { - +.text-logo { + padding-top: 4.5em; position: relative; - right: 5px; - width: 50px; - height: 50px; - z-index: 99999; - } -.buttonclose span{ -font-size: 35px; -color: black; +.search-box-container { + padding-top: 0.7em; + padding-bottom: 4em; /*64px */ -} -.buttonshow span{ - color: black; - + &.pb-0 { + padding-bottom: 0 !important; } -.buttonshow { - position: relative; - color:inherit; - right: 5px; - width: 50px; - height: 50px; - z-index: 99999; } -.div-meno{ - background-color: #f9f9f9 !important; -} - -#m1{ - display: none; -} - - </style> diff --git a/pages/hadith/index.vue b/pages/hadith/index.vue index f0b3295..2276723 100644 --- a/pages/hadith/index.vue +++ b/pages/hadith/index.vue @@ -5,7 +5,6 @@ </HadithLayout> </template> <script> - export default { name: "hadith", setup() { @@ -37,96 +36,4 @@ export default { }, }; </script> -<style scoped> -.section-one { - .bg-container { - height: 521px; - background-size: 100% auto; - background-repeat: no-repeat; - /* background-attachment: fixed; */ - /* background-image: url("/img/background.svg"), - linear-gradient(199.05deg, #ffffff 9.99%, #e4fff7 42.07%, #ffffff 97.12%); */ - } - - .text-logo { - padding-top: 10em; - position: relative; - - .title { - margin-top: 3.5em; - font-family: IRANSansX; - font-size: 14px; - line-height: 21px; - letter-spacing: 0%; - text-align: center; - color: #1b2132; - } - .badge-style { - width: 100; - height: 23; - border-radius: 40px; - padding-right: 8px; - padding-bottom: 2px; - padding-left: 8px; - gap: 10px; - color: #fff; - - background: linear-gradient(270.29deg, #d284ff 8.12%, #4d00ff 109.58%); - } - } - - .search-box-container { - padding-top: 1em; - padding-bottom: 4em; /*64px */ - } -} - -.section-two { - font-weight: 200; - font-size: 20px; - line-height: 30px; - letter-spacing: 0%; - text-align: center; - - .my-card { - background-repeat: no-repeat; - background-size: auto; - height: 660px; - - .inner-container { - max-width: 21.25em; - margin: auto; - } - .title { - font-weight: 500; - font-size: 24px; - line-height: 36px; - letter-spacing: 0%; - color: #1b2132; - text-align: right; - } - - .description { - font-weight: 300; - font-size: 20px; - line-height: 30px; - letter-spacing: 0%; - text-align: right; - color: #626b84; - } - - &.card-one { - background-image: url("/img/card-one-bgi.png"), - linear-gradient(134.17deg, #ffffff -9.81%, #e5e0ff 87.62%); - } - &.card-two { - background-image: url("/img/card-two-bgi.png"), - linear-gradient(329.16deg, #b9fde0 13.45%, #eefff8 63.57%); - } - &.card-three { - background-image: url("/img/card-three-bgi.png"), - linear-gradient(134.17deg, #ffffff -9.81%, #e5e0ff 87.62%); - } - } -} -</style> +<style scoped></style> diff --git a/pages/hadith/library/[id]/[slug]/index.vue b/pages/hadith/library/[id]/[slug]/index.vue index 700195a..be63c2a 100644 --- a/pages/hadith/library/[id]/[slug]/index.vue +++ b/pages/hadith/library/[id]/[slug]/index.vue @@ -1,1206 +1,234 @@ -<template> - <NuxtLayout name="search-layout" :menu="sidbarMenu"> - <div class="container-fluid"> - <div class="row border-bottom header-height main-page__content-header"> - <div - class="col-12 order-1 order-lg-1 col-lg-3 d-flex justify-content-start" - > - <div - class="d-flex position-relative align-items-center" - v-if="searchChartSchemaGetter?.length" - > - <button - name="button" - type="button" - class="toggle-mobile-nav dropdown-hamburger d-md-none" - @click.prevent="toggleSidebarMenu()" - > - <span class="sr-only">باز کردن منوی کنار</span> - <svg class="s18" data-testid="sidebar-icon"> - <use href="assets/common/img/icons.svg#sidebar"></use> - </svg> - </button> - <label for="repositories-desktop" class="ms-2 no-wrap"> - بانک داده - </label> +<script setup> +const route = useRoute(); +const router = useRouter(); - <USelectMenu - v-model="dataBankSelectValue" - :options="searchChartSchemaGetter" - placeholder="انتخاب فهرست" - @update:model-value="onSelectNavigation" - > - </USelectMenu> - - <!-- - <multiselect - :allow-empty="false" - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="label" - track-by="key" - placeholder="انتخاب فهرست" - :value="searchChartActiveSchemaGetter" - :options="searchChartSchemaGetter" - @select="onSelectNavigation" - :hide-selected="false" - :max-height="200" - id="repositories-desktop" - > - </multiselect> --> - </div> - </div> - <div - class="col-12 order-2 order-lg-1 col-lg-7 d-flex align-items-end justify-content-center" - > - <div class="nav-tabs-container nav-tabs border-bottom-0"> - <ul class="nav"> - <li - class="nav-item desktop" - v-for="(navItem, index) in searchChartActiveSchemaGetter?.items" - :key="index" - > - <button - :title="navItem.label" - type="button" - @click.prevent="updateCategoryList(navItem, index)" - class="btn nav-link" - :class="{ - active: searchChartActiveTabGetter?.key == navItem.key, - }" - > - {{ navItem.label }} - </button> - </li> - <li - class="nav-item mobile tabs-more-btn d-md-none" - v-if="searchChartActiveSchemaGetter?.items?.length > 3" - > - <div class="dropdown"> - <button - class="btn" - type="button" - id="dropdownMenuButton" - data-bs-toggle="dropdown" - aria-haspopup="true" - aria-expanded="false" - > - <svg class="icon icon-Component-81--1"> - <use xlink:href="#icon-Component-81--1"></use> - </svg> - </button> - <div - class="dropdown-menu" - aria-labelledby="dropdownMenuButton" - > - <a - class="dropdown-item" - @click.prevent="updateCategoryList(navItem, index)" - v-for="( - navItem, index - ) in searchChartActiveSchemaGetter?.items" - :key="index" - :class="{ - active: searchChartActiveTabGetter?.key == navItem.key, - }" - >{{ navItem.label }}</a - > - </div> - </div> - </li> - </ul> - </div> - </div> - </div> - - <div class="row"> - <div class="col"> - <div - class="d-flex pt-1 pb-2 justify-content-center custom-filter-container" - > - <div - v-if="searchChartActiveTabGetter?.chartBase" - class="d-flex align-items-center" - > - <label - for="choose-filter" - class="d-none d-lg-inline label-change no-wrap ms-1" - >{{ searchChartActiveTabGetter?.chartBase?.label }}</label - > - <USelectMenu - v-model="schemaFilters" - :options="searchChartActiveTabGetter?.chartBase?.items" - :placeholder="searchChartActiveTabGetter?.chartBase?.label" - @update:model-value="changeFilter" - > - </USelectMenu> - - <!-- <multiselect - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="label" - track-by="key" - :placeholder="searchChartActiveTabGetter?.chartBase?.label" - v-model="schemaFilters" - :options="searchChartActiveTabGetter?.chartBase?.items" - @select="changeFilter" - :hide-selected="false" - :max-height="200" - openDirection="rtl" - id="chart-base" - > - <label slot="noResult">موردی پیدا نشد.</label> - </multiselect> --> - </div> - <div - v-if="searchChartActiveTabGetter?.chartType" - class="d-flex align-items-center" - > - <label - for="filter-chart" - class="d-none d-lg-inline me-2 label-change no-wrap ms-1" - >{{ searchChartActiveTabGetter?.chartType?.label }}:</label - > - <USelectMenu - v-model="pieModel" - :options="searchChartActiveTabGetter?.chartBase?.items" - :placeholder="searchChartActiveTabGetter?.chartType?.label" - @update:model-value="changeChart" - > - </USelectMenu> - - <!-- <multiselect - :allow-empty="false" - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="chartName" - track-by="chartkey" - :placeholder="searchChartActiveTabGetter?.chartType?.label" - v-model="pieModel" - :options="searchChartActiveTabGetter?.chartType?.items" - @select="changeChart" - :hide-selected="false" - :max-height="200" - id="chart-type" - > - </multiselect> --> - </div> - </div> - </div> - </div> - - <div class="row"> - <div - class="col-8 col-lg-3 filter-list-container" - :class="{ expanded: showFilter }" - > - <div class="mobile-mode"> - <button class="btn" @click.prevnet="showFilter = !showFilter"> - <svg - v-if="showFilter" - class="icon icon-chevron-double-right ms-1" - > - <use xlink:href="#icon-chevron-double-right"></use> - </svg> - <svg v-else class="icon icon-chevron-double-left"> - <use xlink:href="#icon-chevron-double-left"></use> - </svg> - <!-- بستن فیلتر --> - </button> - </div> - <chart-filter-list - v-if="showInCharts" - :key="componentCounter" - :listFilter="listFilter" - :activeTabGetter="searchChartActiveSchemaGetter" - @hide-panel="showToggleListPanel()" - @changeAmplify="onChangeAmplify" - @changeType="onChangeType" - @changeCode="onChangeCode" - @filterUpdate="filterUpdate" - ></chart-filter-list> - </div> - <div class="col"> - <div v-if="canView"> - <ChartContent - :activeTabGetter="searchChartActiveSchemaGetter" - :schemaFilters="schemaFilters" - :selectedCategory="schemaFilters?.key" - :dataChart="dataChart" - :chartComponentName="chartComponentName" - class="ChartContent" - ></ChartContent> - </div> - <no-data v-else> - <p class="text-center p-3">عدم دسترسی</p> - </no-data> - </div> - </div> - </div> - </NuxtLayout> -</template> - -<script> -import { mapState, mapActions } from "pinia"; -import searchApis from "@search/apis/searchApi"; -import chartType from "@search/json/search/json/chart.json"; - -import sidbarMenuDefault from "@search/json/search/json/menu.json"; -import sidbarMenuMin from "@search/json/search/json/sidbarMenuMin.json"; - -import tableActions from "@search/json/search/json/listTableContextMenu"; -import { useSearchStore } from "@search/stores/searchStore"; - -export default { - name: "searchChart", - - setup() { - useHead({ - title: import.meta.env.VITE_ENTITY_PAGE_TITLE, - meta: [{ name: "description", content: "My page description" }], - bodyAttrs: { - class: import.meta.env.VITE_SEARCH_PAGE_TITLE, - }, - }); - definePageMeta({ - layout: false, - name: "searchChart", - }); +definePageMeta({ + layout: false, + name: "hadithLibraryShow", +}); +useHead({ + name: "hadithLibraryShow", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | ${route.params.slug}`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, }, - - mounted() { - let schemaExist = - this.searchChartActiveTabGetter && this.searchChartSchemaGetter; - - if (schemaExist) { - this.dataBankSelectValue = this.searchChartActiveSchemaGetter; - this.schemaFilters = this.searchChartActiveTabGetter?.chartBase?.items[0]; - this.pieModel = this.searchChartActiveTabGetter?.chartType?.items[0]; - - // when component load, setting default chart component to load based on the active tab. - this.chartComponentName = this.searchChartActiveTabGetter.componentName; - - this.intiChartData(); - } else this.getSchemas(); - - if (window.outerWidth < 992) { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - } - - if (this.searchChartActiveTabGetter?.key == "tree-graph") { - this.showInCharts = false; - } else { - this.showInCharts = true; - } - }, - data() { - return { - dataBankSelectValue: {}, - searchingState: false, - - showFilter: false, - listFilter: [], - dataChart: [], - chartComponentName: chartType[0].componentName, - pieModel: undefined, - schemaFilters: undefined, - listAmplify: [], - // addressBarUrl: null, - - viewMode: "table", - tableTitle: " فهرست کدهای تقیح 51 گانه / آمار، برنامه و بودجه ", - changePageFilter: "", - - lastSearchInListMode: true, - showfilterCategory: true, - activeListItem: undefined, - treeLists: "", - filterUrl: "", - page: 0, - activeTab: "", - // activeTab: null, - fetchingDataForExport: false, - componentCounter: 1, - selectedNavigationIndex: undefined, - selectedNavigation: undefined, - navigationOptions: [], - fields: [], - statusPag: "", - fieldOne: null, - fieldTwo: null, - fieldThree: null, - - listPanelSorting: undefined, - listPanelSorting: undefined, - - tableActions: tableActions, - showListPanel: false, - showInCharts: true, - currentPageName: "list", - - sidbarMenuDefault: sidbarMenuDefault, - sidbarMenuMin: sidbarMenuMin, - - canView: true, - pagination: { - pages: 0, - total: 0, - page: 1, - offset: 0, - limit: 10, - }, - fetchingData: false, - sorting: { - sortby: "id", - sortorder: "asc", // asc | desc - }, - colors: [ - "#5470C6", - "#d44646", - "#008b8b", - "#3BA272", - "#FC8452", - "#9A60B4", - "#EA7CCC", - "#F59F00", - "#ddc4b0", - "#73C0DE", - "#b333ad", - "#e86c6b", - "#39cfed", - ], - currentIndex: 0, - }; - }, - computed: { - ...mapState(useCommonStore, [ - "currentUser", - "organNameGetter", - "isSidebarCollapsed", - ]), - ...mapState(useSearchStore, [ - "searchChartSchemaGetter", - "searchChartActiveSchemaGetter", - "searchChartActiveTabGetter", - ]), - - getTableColumns() { - let subjectIndex = this.fields.findIndex( - (item) => item.name == "subject" - ); - this.subjectItemState = false; - this.subjectTitle = ""; - if ( - subjectIndex >= -1 && - this.listGetter != undefined && - subjectIndex == this.listGetter.length - 1 - ) { - this.subjectItemState = true; - this.subjectTitle = this.listGetter[subjectIndex]?.key; - return this.selectedProjectGetter?.table_columns_subject; - } - return this.selectedProjectGetter?.table_columns; - }, - repoUrl() { - return import.meta.env.VITE_REPO + "/"; - }, - sidbarMenu() { - if (isMajlesBuild()) return this.sidbarMenuMin; - else return this.sidbarMenuDefault; +}); +const props = defineProps({ + list: { + default() { + return []; }, }, - methods: { - ...mapActions(useSearchStore, [ - "SET_SELECTED_PROJECT", - "SET_LIST", - - "searchChartActiveSchemaSetter", - "searchChartSchemaSetter", - "searchChartActiveTabSetter", - ]), - intiChartData() { - if ( - this.searchChartActiveTabGetter?.key == "tree-graph" - // || - // this.searchChartActiveTabGetter?.key == "Large-tree-map" - ) { - this.getListInTree(); - } else this.getChartData(); - }, - async getListInTree() { - const payload = { - parent: 0, - sortby: "id", - projectid: this.schemaFilters?.id, - listtype: 0, - limit: 100, - listtype: 0, - }; - let url = searchApis.chart.tree; - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - method: "POST", - body: payload, - }); - - this.mainList = res.data; - this.dataChart = [ - { - key_filter: this.schemaFilters?.key_filter, - projectId: this.schemaFilters?.id, - name: this.schemaFilters?.label, - children: this.ConvertDataToTree(this.mainList), - item: "Root", - id: "0", - disabled: true, - pid: "Root", - opened: true, - selected: false, - text: "Root", - label: { - backgroundColor: "#ee6666", - }, - itemStyle: { - color: "#ee6666", - }, - }, - ]; - } catch (err) {} - }, - getNextColor() { - // Get the color at the current index - const color = this.colors[this.currentIndex]; - - // Update the index to the next color - this.currentIndex = (this.currentIndex + 1) % this.colors.length; - - return color; - }, - ConvertDataToTree(list) { - var finalList = []; - list.forEach((element) => { - const color = this.getNextColor(); - finalList.push({ - value: 0, - item: element, - value: element.title, - name: element.title, - text: element.title, - id: element.id, - pid: element.parent, - collapsed: true, - children: [], - // children: element.children > 0 ? [1] : [], - label: { - backgroundColor: color, - }, - itemStyle: { - color: color, - }, - }); - }); - return finalList; - }, - // Basic data for all charts - async getChartData() { - let key = this.searchChartActiveSchemaGetter?.key; - let url = this.makeApiUrl(key); - - // let otherParams = ""; - // if (this.addressBarUrl) otherParams = this.addressBarUrl; - // url = url + otherParams - - try { - const { $api } = useNuxtApp(); - const res = await $api(url); - - this.listFilter = res.aggregations ?? undefined; - if ( - this.chartComponentName == "HiChartPie" || - this.chartComponentName == "HiChartXy" - ) { - this.preparePieAndLineData(res); - } else if (this.chartComponentName == "MyTimeLine") { - this.dataChart = res.result; - } else this.dataChart = res.data; - } catch (err) { - this.dataChart = []; - } - }, - - changeChart(e) { - if (e.chartName == "دایره ای") { - this.chartComponentName = "HiChartPie"; - this.pieModel = e; - this.getChartData(); - } else if (e.chartName == "میله ای") { - this.chartComponentName = "HiChartXy"; - this.pieModel = e; - this.getChartData(); - } - }, - changeFilter() { - this.intiChartData(); - }, - // Set url for getChartData() - makeApiUrl(type) { - if (this.chartComponentName == "MyTimeLine") { - let url = repoUrl() + searchApis.chart.timeline; - - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", type); - - if (this.filterUrl?.length) { - url += "/" + this.filterUrl; - } - return url; - } else if ( - this.chartComponentName == "HiChartPie" || - this.chartComponentName == "HiChartXy" - ) { - let url = repoUrl() + searchApis.chart.xy; - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", type); - if (this.schemaFilters?.key) - url = url.replace("{{field_key}}", this.schemaFilters?.key); - else url = url.replace("/{{field_key}}", ""); - - if (this.filterUrl?.length) { - url += "/" + this.filterUrl; - } - - return url; - } else if ( - this.chartComponentName == "largeTreeMapChart" || - this.chartComponentName == "HiChartTreegraph" - ) { - let url = ""; - let filter = ""; - if (this.filterUrl?.length) { - filter += this.filterUrl; - } - - url = searchApis.chart.chartTreeMap; - url = url.replace("{{chart_key}}", this.schemaFilters?.key); - // url = url.replace("{{chart_key}}", this.schemaFilters?.key_filter); - if (filter) url = url.replace("{{filter}}", filter); - else url = url.replace("/{{filter}}", ""); - - return url; - } else { - let field_key = this.navigationItem.name; - let url = repoUrl() + searchApis.chart.xy; - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", type); - url = url.replace("{{field_key}}", field_key); - - // let filter = this.filterUrl; - // if (this.textAmplify != undefined && this.textAmplify != "") { - // filter += "&o_am=" + this.textAmplify; - // } - - if (this.filterUrl?.length) { - url += "/" + this.filterUrl; - } - - return url; - } - }, - // Set data for charts - preparePieAndLineData(res) { - // this.dataTreeMap = res.data ?? undefined; - this.dataChart = res.aggregations.result.buckets.map((item) => { - return { - name: item.key, - y: item.doc_count, - }; - }); - - if (res.aggregations.result.sum_other_doc_count > 0) { - this.dataChart.push({ - name: "-سایر-", - y: res.aggregations.result.sum_other_doc_count, - }); - } - }, - - canSee(keyName) { - if (this.currentUser?.user_level > 1) return true; - return this.userPermisionGetter.includes(keyName); - }, - onChangeAmplify(data) { - this.amplifyIndex = data; - this.changeAmplify(); - }, - onChangeType(data) { - this.searchType = data; - this.changeType(); - }, - onChangeCode(data) { - this.searchCode = data; - this.changeCode(); - }, - switchViewMode(mode) { - this.viewMode = mode; - }, - changeHideFilter(event) { - if (event === 0) { - this.$refs.axis.classList.remove("hiden"); - this.$refs.showFilter.classList.toggle("d-none"); - - this.showButton = false; - this.showFilter = true; - } else if (event === 1) { - this.$refs.axis.classList.add("hiden"); - this.$refs.showFilter.classList.toggle("d-none"); - this.showButton = true; - this.showFilter = false; - } - }, - updateTitle(list) { - this.tableTitle = list.title; - }, - updateCategoryList(navItem, index) { - if (navItem.key == "tree-graph") { - this.showInCharts = false; - } else { - this.showInCharts = true; - } - this.searchChartActiveTabSetter(navItem); - this.chartComponentName = navItem.componentName ?? "HiChartPie"; - this.schemaFilters = navItem?.chartBase?.items[0] ?? undefined; - this.pieModel = navItem?.chartType?.items[0] ?? undefined; - - // this.activeTab = navItem; - // if (navItem.label == "پایش زمانی") { - // this.chartComponentName = "MyTimeLine"; - // } - // else if (navItem.label == "دستهای") - // this.chartComponentName = "HiChartPie"; - // else if (navItem.label == "درختی موضوعی") - // this.chartComponentName = "largeTreeMapChart"; - // else if (navItem.label == "تجمیعی موضوعی") - // this.chartComponentName = "HiChartTreegraph"; - - // if (this.chartComponentName == "HiChartTreegraph") this.getListInTree(); - // else this.getChartData(); - this.intiChartData(); - }, - - listChanged(tags) { - let res = []; - tags.split(",").forEach((e) => { - let i = e.lastIndexOf("_"); - if (i != -1) { - res.push(e.substring(0, i)); - } - }); - this.setFilterNavigate(res); - }, - setFilterNavigate(value = []) { - this.filterNavigate = value; - }, - filterUpdate: function (filter) { - this.filterUrl = filter; - this.page = 0; - - this.getChartData(); - - // if (this.searchingState) this.getQuery(false, true); - // else this.getDefaultByFilter(); - }, - - async getSchemas(item) { - try { - const { $api } = useNuxtApp(); - const res = await $api(searchApis.schema.list, { - baseURL: repoUrl(), - method: "POST", - body: { - organ: this.organNameGetter, - system: "navigateChart", - build_state: buildState(), - }, - }); - - this.searchChartSchemaSetter(res.data.navigateChart); - this.searchChartActiveSchemaSetter(res.data.navigateChart[0]); - this.searchChartActiveTabSetter(res.data.navigateChart[0].items[0]); - - this.dataBankSelectValue = this.searchChartActiveSchemaGetter; - - this.getChartData(); - } catch (err) {} - }, - //mehdi - AddToFolder(text) { - if (this.selectedProjectGetter.lists.length) { - if (text == "positionOne") { - let myString = this.selectedProjectGetter.lists[0].items; - let myArray1 = myString.split(","); - let myArray2 = this.selectedProjectGetter.items; - let myArray3 = []; - for (let i = 0; i < myArray1.length; i++) { - for (let j = 0; j < myArray2.length; j++) { - if (myArray1[i] === myArray2[j].name) { - myArray3.push(myArray2[j]); - break; - } - } - } - this.fieldOne = myArray3[0]; - this.fieldTwo = myArray3[1]; - this.fieldThree = myArray3[2]; - setTimeout(() => { - this.onComboChanged(); - - this.componentCounter++; - }, 300); - } else if (text == "positionTow") { - let myString = this.selectedProjectGetter.lists[1].items; - let myArray1 = myString.split(","); - let myArray2 = this.selectedProjectGetter.items; - let myArray3 = []; - for (let i = 0; i < myArray1.length; i++) { - for (let j = 0; j < myArray2.length; j++) { - if (myArray1[i] === myArray2[j].name) { - myArray3.push(myArray2[j]); - break; - } - } - } - this.fieldOne = myArray3[0]; - this.fieldTwo = myArray3[1]; - this.fieldThree = myArray3[2]; - setTimeout(() => { - this.onComboChanged(); - - this.componentCounter++; - }, 300); - } else { - let myString = this.selectedProjectGetter.lists[2].items; - let myArray1 = myString.split(","); - let myArray2 = this.selectedProjectGetter.items; - let myArray3 = []; - for (let i = 0; i < myArray1.length; i++) { - for (let j = 0; j < myArray2.length; j++) { - if (myArray1[i] === myArray2[j].name) { - myArray3.push(myArray2[j]); - break; - } - } - } - this.fieldOne = myArray3[0]; - this.fieldTwo = myArray3[1]; - this.fieldThree = myArray3[2]; - setTimeout(() => { - this.onComboChanged(); - - this.componentCounter++; - }, 300); - } - } - }, - - openNavigationFilter(item) { - // if (item == 1) { - // this.$refs.pags.classList.add("position1"); - // this.$refs.pags.classList.remove("position2"); - // } else { - // this.$refs.pags.classList.add("position2"); - // this.$refs.pags.classList.remove("position1"); - // } - // this.$refs.navigationFilter.classList.remove("d-none"); - }, - statusPag2($event) { - this.statusPag = $event; - // if(this.statusPag=3){ - // this.showtextpag=false; - // }else if (this.statusPag=2){ - // this.showtextpag=true; - // } - switch (this.statusPag) { - case (this.statusPag = 2): - this.$refs.pags.classList.add("position1"); - this.$refs.pags.classList.remove("position2"); - break; - case (this.statusPag = 1): - this.$refs.pags.classList.add("position2"); - this.$refs.pags.classList.remove("position1"); - break; - } - }, - isShowPag(event) { - // this.$refs.navigationFilter.classList.add("d-none"); - // this.$refs.navigationFilter.classList.remove("position2"); - }, - - //mehdi - - exportJsonToExcel(evt) { - if (evt === "current") { - convertJsonToExcelUsingPlugin( - this.filterColumns(this.listItem, this.getTableColumns), - this.listGetter[this.listGetter.length - 1].key - ).finally(() => { - this.fetchingDataForExport = false; - }); - } else if (evt === "all") { - if (this.pagination.total > 500) { - this.mySwalConfirm({ - title: "خطا!!!", - html: "حداکثر تعداد قابل خروجی گرفتن، 500 مورد می باشد.لطفا با مدیریت تماس بگیرید.", - }).then((result) => { - this.getAllListItemForExport(500) - .then((response) => { - convertJsonToExcelUsingPlugin( - this.filterColumns(response.hits.hits, this.getTableColumns), - this.listGetter[this.listGetter.length - 1].key - ) - .then(() => {}) - .finally(() => { - this.fetchingDataForExport = false; - }); - }) - - .finally(() => { - this.fetchingDataForExport = false; - }); - }); - } else { - this.getAllListItemForExport() - .then((response) => { - convertJsonToExcelUsingPlugin( - this.filterColumns(response.hits.hits, this.getTableColumns), - this.listGetter[this.listGetter.length - 1].key - ) - .then(() => {}) - .finally(() => { - this.fetchingDataForExport = false; - }); - }) - - .finally(() => { - this.fetchingDataForExport = false; - }); - } - } - }, - filterColumns(listItem, columns) { - let clonedItems = structuredClone(listItem); - let clonedColumns = structuredClone(columns); - let filteredItems = []; - - clonedItems.forEach((item, index) => { - let filterObject = {}; - - clonedColumns.forEach((j) => { - filterObject[j.title] = item[j.key]; - }); - - filteredItems[index] = filterObject; - }); - return filteredItems; - }, - async getAllListItemForExport(maxAmount = undefined) { - if (this.fetchingDataForExport) return; - this.fetchingDataForExport = true; - - let url = - repoUrl() + - searchApis.navigation.reportItem + - `/${this.searchChartActiveSchemaGetter?.index_name}`; - - url += `/${this.sorting.sortby}/${this.sorting.sortorder}`; - url += `/0/${maxAmount ?? this.pagination.total}/`; - - if (this.listGetter && this.listGetter.length) { - if (this.listGetter.length <= this.fields.length) { - for (let i = 0; i < this.listGetter.length; i++) { - url += `${this.fields[i].name}=${this.listGetter[i].key}`; - if (i != this.listGetter.length - 1) url += "&"; - } - } - } - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: repoUrl(), - method: "POST", - body: { - organ: this.organNameGetter, - system: "navigateChart", - build_state: buildState(), - }, - }); - return res; - } catch (err) {} - }, - - async updateOrder({ rowItem, newOrder }) { - const res = rowItem.subject.filter( - (item) => item.title == this.listGetter[this.listGetter.length - 1].key - ); - - const payload = { - id: rowItem.id_store, - subject_id: res[0].id, - subject_title: res[0].title, - subject_order: +newOrder, - }; - - const url = repoUrl() + searchApis.subject.order; - - try { - const { $api } = useNuxtApp(); - const res = await $api(searchApis.schema.list, { - baseURL: repoUrl(), - method: "POST", - body: payload, - }); - - this.mySwalToast({ - title: res.message, - html: "", - }); - } catch (err) {} - }, - async getComboList() { - if (this.fetchingData) return; - this.fetchingData = true; - - let url = repoUrl() + searchApis.navigation.list; - url = url.replace("~/entity", this.searchChartActiveSchemaGetter?.key); - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: repoUrl(), - }); - - this.navigationOptions = res.data; - - this.navigationOptions[0].meta = JSON.parse( - this.navigationOptions[0].meta - ); - this.navigationOptions[0].table_columns = JSON.parse( - this.navigationOptions[0].table_columns - ); - this.navigationOptions[0].table_columns_subject = JSON.parse( - this.navigationOptions[0].table_columns_subject - ); - - this.SET_SELECTED_PROJECT(this.navigationOptions[0]); - this.fetchingData = false; - } catch (err) { - this.fetchingData = false; - } - }, - - onSelectNavigation(evt) { - // this.fieldOne = null; - // this.fieldTwo = null; - // this.fieldThree = null; - // this.SET_LIST([]); - // this.listItem = []; - // this.fields = []; - - // if (typeof evt?.meta == "string") { - // try { - // evt.meta = JSON.parse(evt.meta); - // evt.table_columns = JSON.parse(evt.table_columns); - // evt.table_columns_subject = JSON.parse(evt.table_columns_subject); - // } catch (e) {} - // } - - // this.selectedNavigation = evt; - // this.searchChartSchemaSetter(); - // this.searchChartActiveTabSetter(); - this.searchChartActiveSchemaSetter(evt); - - this.getChartData(); - - // this.$nextTick(() => { - // this.componentCounter++; - // }); - }, - onComboChanged() { - this.SET_LIST([]); - this.listItem = []; - const vm = this; - setTimeout(() => { - vm.fields = [vm.fieldOne, vm.fieldTwo, vm.fieldThree].filter( - (item) => item != null - ); - vm.componentCounter++; - }, 300); - }, - toggleSidebarMenu() { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - }, - showToggleListPanel() { - this.showListPanel = !this.showListPanel; - }, - searchInTable() {}, - - getChartListItems() { - const payload = { - projectid: this.selectedProjectGetter?.id, - item_state: this.selectedProjectGetter?.item_state, - ...this.sorting, - ...this.pagination, - }; - - const url = - this.currentPageName == "list" - ? listApis.item.listNotRel - : listApis.item.subjectNotRel; - - ApiService.formData(url, payload) - .then((res) => { - this.listItem = res.data.data; - this.pagination = { ...this.pagination, ...res.data.pagination }; - }) - .catch((err) => { - handleErrors(err); - - // this.mySwalToast({ - // title: response.data.message, - // html: "", - // text: "لطفا با پشتیبانی تماس بگیرید.", - // icon: "error", - // }); - }); - }, + noDataText: { + default: "نتیجهای یافت نشد!", }, + noDataIcon: { + default: "/img/no-data.png", + }, +}); + +const isModalOpen = ref(false); + +const onOpenList = () => { + console.info("onOpenList"); + isModalOpen.value = true; }; +const onSearch = () => { + // console.info("onSearch"); +}; +const onClose = () => { + console.info("onClose"); + router.push({ + name: "hadithLibrary", + }); +}; +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const AccordionMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/library-show/AccordionMenu..vue") +); </script> -<style lang="scss"> -.custom-filter-container { - @media screen and (min-width: 575px) { - background-color: rgba(0, 0, 0, 0.05); - } +<template> + <HadithLayout> + <div class="page-container h-full"> + <UContainer + ui="{ + base: 'sm:px-6 lg:px-4', + }" + class="page-inner-container sm:px-6 lg:px-4" + > + <div class="page-header py-4 flex justify-between items-center"> + <div class="flex items-center"> + <UButton + class="menu p-1 me-8" + @click="onOpenList" + icon="i-lucide-menu" + variant="" + /> - .multiselect { - // width: 16em; - // border: 2px solid rgb(127, 170, 170) !important; - border-radius: 0.5em; + <h1 class="m-0 title"> + {{ route.params.slug }} + </h1> + </div> - @media screen and (max-width: 575px) { - .multiselect__tags { - font-size: 0.8rem; + <div class="flex items-center"> + <UButton + @click="onSearch" + class="my-trailing-button search p-0" + icon="i-lucide-search" + variant="" + size="xl" + > + </UButton> + + <UButton + @click="onClose" + class="my-trailing-button close p-0 ms-8" + icon="i-lucide:x" + variant="" + size="xl" + > + </UButton> + </div> + </div> + <div class="separator"></div> + + <div class="page-content py-14 p-2"> + <h2> + عَنِ الْحَسَنِ بْنِ عَلِيِّ بْنِ يُوسُفَ، عَنْ جَدِّهِ، قَالَ: قَالَ + أَبُو عَبْدِ اللَّهِ (عَلَيْهِ السَّلَامُ): + </h2> + <p> + إِنَّمَا يَدْرُسُ الْإِنسَانُ لِيَعْلَمَ، وَإِنَّمَا يَعْلَمُ + لِيَعْمَلَ، وَإِنَّمَا يَعْمَلُ لِيُعْرَفَ بِهِ، وَإِنَّمَا يُعْرَفُ + بِهِ لِيُقْبَلَ بِهِ، وَإِنَّمَا يُقْبَلُ بِهِ لِيُؤْمَنَ عَلَيْهِ، + وَإِنَّمَا يُؤْمَنُ عَلَيْهِ لِيُدْخَلَ الْجَنَّة امام جعفر صادق + علیهالسلام:عَنِ الْحَسَنِ بْنِ عَلِيِّ بْنِ يُوسُفَ، عَنْ جَدِّهِ، + قَالَ: قَالَ أَبُو عَبْدِ اللَّهِ إِنَّمَا يَدْرُسُ الْإِنسَانُ + لِيَعْلَمَ، وَإِنَّمَا يَعْلَمُ لِيَعْمَلَ، وَإِنَّمَا يَعْمَلُ + لِيُعْرَفَ بِهِ، وَإِنَّمَا يُعْرَفُ بِهِ لِيُقْبَلَ بِهِ، + وَإِنَّمَا يُقْبَلُ بِهِ لِيُؤْمَنَ عَلَيْهِ، وَإِنَّمَا يُؤْمَنُ + عَلَيْهِ لِيُدْخَلَ الْجَنَّةَ + </p> + + <h2>امام جعفر صادق علیهالسلام:</h2> + <p> + عَنِ الْحَسَنِ بْنِ عَلِيِّ بْنِ يُوسُفَ، عَنْ جَدِّهِ، قَالَ: قَالَ + أَبُو عَبْدِ اللَّهِ (عَلَيْهِ السَّلَامُ): إِنَّمَا يَدْرُسُ + الْإِنسَانُ لِيَعْلَمَ، وَإِنَّمَا يَعْلَمُ لِيَعْمَلَ، وَإِنَّمَا + يَعْمَلُ لِيُعْرَفَ بِهِ، وَإِنَّمَا يُعْرَفُ بِهِ لِيُقْبَلَ بِهِ، + وَإِنَّمَا يُقْبَلُ بِهِ لِيُؤْمَنَ عَلَيْهِ، وَإِنَّمَا يُؤْمَنُ + عَلَيْهِ لِيُدْخَلَ الْجَنَّةَ + </p> + </div> + </UContainer> + </div> + + <UModal + v-model:open="isModalOpen" + :dismissible="false" + :ui="{ + footer: 'modal-footer', + overlay: 'modal-overlay', + content: 'modal-content', + header: 'modal-header', + wrapper: 'modal-wrapper', + body: 'modal-body', + title: 'modal-title', + description: 'modal-description', + close: 'modal-close', + }" + title="فهرست" + :close="{ + color: 'primary', + variant: 'outline', + class: 'rounded-full', + }" + > + <UButton label="Open" color="neutral" variant="subtle" /> + <!-- <template #header></template> --> + <!-- <template #content></template> --> + <template #body> + <accordion-menu @close="isModalOpen = !isModalOpen"></accordion-menu> + </template> + <!-- <template #footer></template> --> + </UModal> + </HadithLayout> +</template> + +<style scoped> +.page-container { + background: #f7fffd; + + .page-inner-container { + /* width: 100%; */ + /* max-width: 1200px; */ + /* margin-right: auto; */ + /* margin-left: auto; */ + .page-header { + color: var(--ui-color-two); + + .menu { + width: 24; + height: 24; + + margin-left: 2.2em; } + .title { + font-family: IRANSansX; + font-weight: 400; + font-size: 16px; + line-height: 20px; + letter-spacing: 0%; + text-align: right; + + /* Fallback color */ + color: #4d00ff; + + /* Gradient background */ + background: linear-gradient(268.94deg, #d284ff -0.65%, #4d00ff 104.59%); + + /* Clip the background to the text */ + background-clip: text; + -webkit-background-clip: text; /* For Safari */ + + /* Make the text transparent */ + color: transparent; + -webkit-text-fill-color: transparent; /* For Safari */ + } + } + .separator { + /* border: 0.5px solid #eee; */ + height: 1px; + background-position: center center; + background-size: contain; + + background-image: linear-gradient( + 90deg, + #ffffff 0%, + #a0f5ff 30.4%, + #3fc9fa 71.47%, + #a7ffe7 100% + ); + } + .page-content { + /* margin: 1.5em; */ + + font-family: Takrim; + font-weight: 400; + font-size: 20px; + line-height: 40px; + letter-spacing: 0%; + text-align: right; + + color: var(--ui-color-two); } } } </style> -<style scoped lang="scss"> -.main-page__content-header { - background: linear-gradient(to top, #fcfcfc 0%, #eee 90%); - padding-top: 1em; -} -.multiselect { - width: 12em; - white-space: nowrap; -} -.header-height { - height: 4em; -} -.nav-tabs-container { - display: flex; - justify-content: center; -} -.label-change { - width: auto; - // min-width: 5em; - margin-bottom: 0em; -} - -@media (max-width: 575.98px) { - li.desktop:nth-child(n + 3) { - display: none; - } - - .dropdown-menu { - a.dropdown-item:nth-child(-n + 2) { - display: none; - } - } - .header-height { - height: 6em; - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { - li.desktop:nth-child(n + 4) { - display: none; - } - .dropdown-menu { - a.dropdown-item:nth-child(-n + 3) { - display: none; - } - } - .header-height { - height: 6em; - } - .filter-list-container { - padding-top: 0.5em; - position: fixed; - - z-index: 9; - width: auto; - - .main-filter { - display: none; - } - .mobile-mode { - display: flex; - justify-content: flex-end; - - .btn { - border-radius: 50%; - // font-size: 0.7rem; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - display: flex; - justify-content: center; - align-items: center; - transform: translateX(1.5em); - background-color: #eee; - - &:hover { - filter: brightness(0.8); - } - } - } - - &.expanded { - top: 0; - bottom: 0; - background: #fff; - justify-content: center; - box-shadow: -1px 0px 7px 1px #eee; - - .main-filter { - display: block; - } - } - } -} -@media only screen and (min-width: 768px) and (max-width: 991.98px) { - .header-height { - height: 6em; - } -} -@media only screen and (min-width: 992px) and (max-width: 1199.98px) { -} -@media (min-width: 1200px) { -} -</style> diff --git a/pages/hadith/library/index.vue b/pages/hadith/library/index.vue index 700195a..7ab1124 100644 --- a/pages/hadith/library/index.vue +++ b/pages/hadith/library/index.vue @@ -1,1206 +1,52 @@ -<template> - <NuxtLayout name="search-layout" :menu="sidbarMenu"> - <div class="container-fluid"> - <div class="row border-bottom header-height main-page__content-header"> - <div - class="col-12 order-1 order-lg-1 col-lg-3 d-flex justify-content-start" - > - <div - class="d-flex position-relative align-items-center" - v-if="searchChartSchemaGetter?.length" - > - <button - name="button" - type="button" - class="toggle-mobile-nav dropdown-hamburger d-md-none" - @click.prevent="toggleSidebarMenu()" - > - <span class="sr-only">باز کردن منوی کنار</span> - <svg class="s18" data-testid="sidebar-icon"> - <use href="assets/common/img/icons.svg#sidebar"></use> - </svg> - </button> - <label for="repositories-desktop" class="ms-2 no-wrap"> - بانک داده - </label> - - <USelectMenu - v-model="dataBankSelectValue" - :options="searchChartSchemaGetter" - placeholder="انتخاب فهرست" - @update:model-value="onSelectNavigation" - > - </USelectMenu> - - <!-- - <multiselect - :allow-empty="false" - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="label" - track-by="key" - placeholder="انتخاب فهرست" - :value="searchChartActiveSchemaGetter" - :options="searchChartSchemaGetter" - @select="onSelectNavigation" - :hide-selected="false" - :max-height="200" - id="repositories-desktop" - > - </multiselect> --> - </div> - </div> - <div - class="col-12 order-2 order-lg-1 col-lg-7 d-flex align-items-end justify-content-center" - > - <div class="nav-tabs-container nav-tabs border-bottom-0"> - <ul class="nav"> - <li - class="nav-item desktop" - v-for="(navItem, index) in searchChartActiveSchemaGetter?.items" - :key="index" - > - <button - :title="navItem.label" - type="button" - @click.prevent="updateCategoryList(navItem, index)" - class="btn nav-link" - :class="{ - active: searchChartActiveTabGetter?.key == navItem.key, - }" - > - {{ navItem.label }} - </button> - </li> - <li - class="nav-item mobile tabs-more-btn d-md-none" - v-if="searchChartActiveSchemaGetter?.items?.length > 3" - > - <div class="dropdown"> - <button - class="btn" - type="button" - id="dropdownMenuButton" - data-bs-toggle="dropdown" - aria-haspopup="true" - aria-expanded="false" - > - <svg class="icon icon-Component-81--1"> - <use xlink:href="#icon-Component-81--1"></use> - </svg> - </button> - <div - class="dropdown-menu" - aria-labelledby="dropdownMenuButton" - > - <a - class="dropdown-item" - @click.prevent="updateCategoryList(navItem, index)" - v-for="( - navItem, index - ) in searchChartActiveSchemaGetter?.items" - :key="index" - :class="{ - active: searchChartActiveTabGetter?.key == navItem.key, - }" - >{{ navItem.label }}</a - > - </div> - </div> - </li> - </ul> - </div> - </div> - </div> - - <div class="row"> - <div class="col"> - <div - class="d-flex pt-1 pb-2 justify-content-center custom-filter-container" - > - <div - v-if="searchChartActiveTabGetter?.chartBase" - class="d-flex align-items-center" - > - <label - for="choose-filter" - class="d-none d-lg-inline label-change no-wrap ms-1" - >{{ searchChartActiveTabGetter?.chartBase?.label }}</label - > - <USelectMenu - v-model="schemaFilters" - :options="searchChartActiveTabGetter?.chartBase?.items" - :placeholder="searchChartActiveTabGetter?.chartBase?.label" - @update:model-value="changeFilter" - > - </USelectMenu> - - <!-- <multiselect - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="label" - track-by="key" - :placeholder="searchChartActiveTabGetter?.chartBase?.label" - v-model="schemaFilters" - :options="searchChartActiveTabGetter?.chartBase?.items" - @select="changeFilter" - :hide-selected="false" - :max-height="200" - openDirection="rtl" - id="chart-base" - > - <label slot="noResult">موردی پیدا نشد.</label> - </multiselect> --> - </div> - <div - v-if="searchChartActiveTabGetter?.chartType" - class="d-flex align-items-center" - > - <label - for="filter-chart" - class="d-none d-lg-inline me-2 label-change no-wrap ms-1" - >{{ searchChartActiveTabGetter?.chartType?.label }}:</label - > - <USelectMenu - v-model="pieModel" - :options="searchChartActiveTabGetter?.chartBase?.items" - :placeholder="searchChartActiveTabGetter?.chartType?.label" - @update:model-value="changeChart" - > - </USelectMenu> - - <!-- <multiselect - :allow-empty="false" - :searchable="true" - :close-on-select="true" - :show-labels="false" - label="chartName" - track-by="chartkey" - :placeholder="searchChartActiveTabGetter?.chartType?.label" - v-model="pieModel" - :options="searchChartActiveTabGetter?.chartType?.items" - @select="changeChart" - :hide-selected="false" - :max-height="200" - id="chart-type" - > - </multiselect> --> - </div> - </div> - </div> - </div> - - <div class="row"> - <div - class="col-8 col-lg-3 filter-list-container" - :class="{ expanded: showFilter }" - > - <div class="mobile-mode"> - <button class="btn" @click.prevnet="showFilter = !showFilter"> - <svg - v-if="showFilter" - class="icon icon-chevron-double-right ms-1" - > - <use xlink:href="#icon-chevron-double-right"></use> - </svg> - <svg v-else class="icon icon-chevron-double-left"> - <use xlink:href="#icon-chevron-double-left"></use> - </svg> - <!-- بستن فیلتر --> - </button> - </div> - <chart-filter-list - v-if="showInCharts" - :key="componentCounter" - :listFilter="listFilter" - :activeTabGetter="searchChartActiveSchemaGetter" - @hide-panel="showToggleListPanel()" - @changeAmplify="onChangeAmplify" - @changeType="onChangeType" - @changeCode="onChangeCode" - @filterUpdate="filterUpdate" - ></chart-filter-list> - </div> - <div class="col"> - <div v-if="canView"> - <ChartContent - :activeTabGetter="searchChartActiveSchemaGetter" - :schemaFilters="schemaFilters" - :selectedCategory="schemaFilters?.key" - :dataChart="dataChart" - :chartComponentName="chartComponentName" - class="ChartContent" - ></ChartContent> - </div> - <no-data v-else> - <p class="text-center p-3">عدم دسترسی</p> - </no-data> - </div> - </div> - </div> - </NuxtLayout> -</template> - -<script> -import { mapState, mapActions } from "pinia"; -import searchApis from "@search/apis/searchApi"; -import chartType from "@search/json/search/json/chart.json"; - -import sidbarMenuDefault from "@search/json/search/json/menu.json"; -import sidbarMenuMin from "@search/json/search/json/sidbarMenuMin.json"; - -import tableActions from "@search/json/search/json/listTableContextMenu"; -import { useSearchStore } from "@search/stores/searchStore"; - -export default { - name: "searchChart", - - setup() { - useHead({ - title: import.meta.env.VITE_ENTITY_PAGE_TITLE, - meta: [{ name: "description", content: "My page description" }], - bodyAttrs: { - class: import.meta.env.VITE_SEARCH_PAGE_TITLE, - }, - }); - definePageMeta({ - layout: false, - name: "searchChart", - }); +<script setup> +definePageMeta({ + layout: false, + name: "hadithLibrary", +}); +useHead({ + name: "hadithLibrary", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | کتابخانه`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, }, - - mounted() { - let schemaExist = - this.searchChartActiveTabGetter && this.searchChartSchemaGetter; - - if (schemaExist) { - this.dataBankSelectValue = this.searchChartActiveSchemaGetter; - this.schemaFilters = this.searchChartActiveTabGetter?.chartBase?.items[0]; - this.pieModel = this.searchChartActiveTabGetter?.chartType?.items[0]; - - // when component load, setting default chart component to load based on the active tab. - this.chartComponentName = this.searchChartActiveTabGetter.componentName; - - this.intiChartData(); - } else this.getSchemas(); - - if (window.outerWidth < 992) { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - } - - if (this.searchChartActiveTabGetter?.key == "tree-graph") { - this.showInCharts = false; - } else { - this.showInCharts = true; - } - }, - data() { - return { - dataBankSelectValue: {}, - searchingState: false, - - showFilter: false, - listFilter: [], - dataChart: [], - chartComponentName: chartType[0].componentName, - pieModel: undefined, - schemaFilters: undefined, - listAmplify: [], - // addressBarUrl: null, - - viewMode: "table", - tableTitle: " فهرست کدهای تقیح 51 گانه / آمار، برنامه و بودجه ", - changePageFilter: "", - - lastSearchInListMode: true, - showfilterCategory: true, - activeListItem: undefined, - treeLists: "", - filterUrl: "", - page: 0, - activeTab: "", - // activeTab: null, - fetchingDataForExport: false, - componentCounter: 1, - selectedNavigationIndex: undefined, - selectedNavigation: undefined, - navigationOptions: [], - fields: [], - statusPag: "", - fieldOne: null, - fieldTwo: null, - fieldThree: null, - - listPanelSorting: undefined, - listPanelSorting: undefined, - - tableActions: tableActions, - showListPanel: false, - showInCharts: true, - currentPageName: "list", - - sidbarMenuDefault: sidbarMenuDefault, - sidbarMenuMin: sidbarMenuMin, - - canView: true, - pagination: { - pages: 0, - total: 0, - page: 1, - offset: 0, - limit: 10, - }, - fetchingData: false, - sorting: { - sortby: "id", - sortorder: "asc", // asc | desc - }, - colors: [ - "#5470C6", - "#d44646", - "#008b8b", - "#3BA272", - "#FC8452", - "#9A60B4", - "#EA7CCC", - "#F59F00", - "#ddc4b0", - "#73C0DE", - "#b333ad", - "#e86c6b", - "#39cfed", - ], - currentIndex: 0, - }; - }, - computed: { - ...mapState(useCommonStore, [ - "currentUser", - "organNameGetter", - "isSidebarCollapsed", - ]), - ...mapState(useSearchStore, [ - "searchChartSchemaGetter", - "searchChartActiveSchemaGetter", - "searchChartActiveTabGetter", - ]), - - getTableColumns() { - let subjectIndex = this.fields.findIndex( - (item) => item.name == "subject" - ); - this.subjectItemState = false; - this.subjectTitle = ""; - if ( - subjectIndex >= -1 && - this.listGetter != undefined && - subjectIndex == this.listGetter.length - 1 - ) { - this.subjectItemState = true; - this.subjectTitle = this.listGetter[subjectIndex]?.key; - return this.selectedProjectGetter?.table_columns_subject; - } - return this.selectedProjectGetter?.table_columns; - }, - repoUrl() { - return import.meta.env.VITE_REPO + "/"; - }, - sidbarMenu() { - if (isMajlesBuild()) return this.sidbarMenuMin; - else return this.sidbarMenuDefault; - }, - }, - methods: { - ...mapActions(useSearchStore, [ - "SET_SELECTED_PROJECT", - "SET_LIST", - - "searchChartActiveSchemaSetter", - "searchChartSchemaSetter", - "searchChartActiveTabSetter", - ]), - intiChartData() { - if ( - this.searchChartActiveTabGetter?.key == "tree-graph" - // || - // this.searchChartActiveTabGetter?.key == "Large-tree-map" - ) { - this.getListInTree(); - } else this.getChartData(); - }, - async getListInTree() { - const payload = { - parent: 0, - sortby: "id", - projectid: this.schemaFilters?.id, - listtype: 0, - limit: 100, - listtype: 0, - }; - let url = searchApis.chart.tree; - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: import.meta.env.VITE_REPO_BASE_URL, - method: "POST", - body: payload, - }); - - this.mainList = res.data; - this.dataChart = [ - { - key_filter: this.schemaFilters?.key_filter, - projectId: this.schemaFilters?.id, - name: this.schemaFilters?.label, - children: this.ConvertDataToTree(this.mainList), - item: "Root", - id: "0", - disabled: true, - pid: "Root", - opened: true, - selected: false, - text: "Root", - label: { - backgroundColor: "#ee6666", - }, - itemStyle: { - color: "#ee6666", - }, - }, - ]; - } catch (err) {} - }, - getNextColor() { - // Get the color at the current index - const color = this.colors[this.currentIndex]; - - // Update the index to the next color - this.currentIndex = (this.currentIndex + 1) % this.colors.length; - - return color; - }, - ConvertDataToTree(list) { - var finalList = []; - list.forEach((element) => { - const color = this.getNextColor(); - finalList.push({ - value: 0, - item: element, - value: element.title, - name: element.title, - text: element.title, - id: element.id, - pid: element.parent, - collapsed: true, - children: [], - // children: element.children > 0 ? [1] : [], - label: { - backgroundColor: color, - }, - itemStyle: { - color: color, - }, - }); - }); - return finalList; - }, - // Basic data for all charts - async getChartData() { - let key = this.searchChartActiveSchemaGetter?.key; - let url = this.makeApiUrl(key); - - // let otherParams = ""; - // if (this.addressBarUrl) otherParams = this.addressBarUrl; - // url = url + otherParams - - try { - const { $api } = useNuxtApp(); - const res = await $api(url); - - this.listFilter = res.aggregations ?? undefined; - if ( - this.chartComponentName == "HiChartPie" || - this.chartComponentName == "HiChartXy" - ) { - this.preparePieAndLineData(res); - } else if (this.chartComponentName == "MyTimeLine") { - this.dataChart = res.result; - } else this.dataChart = res.data; - } catch (err) { - this.dataChart = []; - } - }, - - changeChart(e) { - if (e.chartName == "دایره ای") { - this.chartComponentName = "HiChartPie"; - this.pieModel = e; - this.getChartData(); - } else if (e.chartName == "میله ای") { - this.chartComponentName = "HiChartXy"; - this.pieModel = e; - this.getChartData(); - } - }, - changeFilter() { - this.intiChartData(); - }, - // Set url for getChartData() - makeApiUrl(type) { - if (this.chartComponentName == "MyTimeLine") { - let url = repoUrl() + searchApis.chart.timeline; - - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", type); - - if (this.filterUrl?.length) { - url += "/" + this.filterUrl; - } - return url; - } else if ( - this.chartComponentName == "HiChartPie" || - this.chartComponentName == "HiChartXy" - ) { - let url = repoUrl() + searchApis.chart.xy; - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", type); - if (this.schemaFilters?.key) - url = url.replace("{{field_key}}", this.schemaFilters?.key); - else url = url.replace("/{{field_key}}", ""); - - if (this.filterUrl?.length) { - url += "/" + this.filterUrl; - } - - return url; - } else if ( - this.chartComponentName == "largeTreeMapChart" || - this.chartComponentName == "HiChartTreegraph" - ) { - let url = ""; - let filter = ""; - if (this.filterUrl?.length) { - filter += this.filterUrl; - } - - url = searchApis.chart.chartTreeMap; - url = url.replace("{{chart_key}}", this.schemaFilters?.key); - // url = url.replace("{{chart_key}}", this.schemaFilters?.key_filter); - if (filter) url = url.replace("{{filter}}", filter); - else url = url.replace("/{{filter}}", ""); - - return url; - } else { - let field_key = this.navigationItem.name; - let url = repoUrl() + searchApis.chart.xy; - url = url.replace("{{appname}}", buildName()); - url = url.replace("{{index_key}}", type); - url = url.replace("{{field_key}}", field_key); - - // let filter = this.filterUrl; - // if (this.textAmplify != undefined && this.textAmplify != "") { - // filter += "&o_am=" + this.textAmplify; - // } - - if (this.filterUrl?.length) { - url += "/" + this.filterUrl; - } - - return url; - } - }, - // Set data for charts - preparePieAndLineData(res) { - // this.dataTreeMap = res.data ?? undefined; - this.dataChart = res.aggregations.result.buckets.map((item) => { - return { - name: item.key, - y: item.doc_count, - }; - }); - - if (res.aggregations.result.sum_other_doc_count > 0) { - this.dataChart.push({ - name: "-سایر-", - y: res.aggregations.result.sum_other_doc_count, - }); - } - }, - - canSee(keyName) { - if (this.currentUser?.user_level > 1) return true; - return this.userPermisionGetter.includes(keyName); - }, - onChangeAmplify(data) { - this.amplifyIndex = data; - this.changeAmplify(); - }, - onChangeType(data) { - this.searchType = data; - this.changeType(); - }, - onChangeCode(data) { - this.searchCode = data; - this.changeCode(); - }, - switchViewMode(mode) { - this.viewMode = mode; - }, - changeHideFilter(event) { - if (event === 0) { - this.$refs.axis.classList.remove("hiden"); - this.$refs.showFilter.classList.toggle("d-none"); - - this.showButton = false; - this.showFilter = true; - } else if (event === 1) { - this.$refs.axis.classList.add("hiden"); - this.$refs.showFilter.classList.toggle("d-none"); - this.showButton = true; - this.showFilter = false; - } - }, - updateTitle(list) { - this.tableTitle = list.title; - }, - updateCategoryList(navItem, index) { - if (navItem.key == "tree-graph") { - this.showInCharts = false; - } else { - this.showInCharts = true; - } - this.searchChartActiveTabSetter(navItem); - this.chartComponentName = navItem.componentName ?? "HiChartPie"; - this.schemaFilters = navItem?.chartBase?.items[0] ?? undefined; - this.pieModel = navItem?.chartType?.items[0] ?? undefined; - - // this.activeTab = navItem; - // if (navItem.label == "پایش زمانی") { - // this.chartComponentName = "MyTimeLine"; - // } - // else if (navItem.label == "دستهای") - // this.chartComponentName = "HiChartPie"; - // else if (navItem.label == "درختی موضوعی") - // this.chartComponentName = "largeTreeMapChart"; - // else if (navItem.label == "تجمیعی موضوعی") - // this.chartComponentName = "HiChartTreegraph"; - - // if (this.chartComponentName == "HiChartTreegraph") this.getListInTree(); - // else this.getChartData(); - this.intiChartData(); - }, - - listChanged(tags) { - let res = []; - tags.split(",").forEach((e) => { - let i = e.lastIndexOf("_"); - if (i != -1) { - res.push(e.substring(0, i)); - } - }); - this.setFilterNavigate(res); - }, - setFilterNavigate(value = []) { - this.filterNavigate = value; - }, - filterUpdate: function (filter) { - this.filterUrl = filter; - this.page = 0; - - this.getChartData(); - - // if (this.searchingState) this.getQuery(false, true); - // else this.getDefaultByFilter(); - }, - - async getSchemas(item) { - try { - const { $api } = useNuxtApp(); - const res = await $api(searchApis.schema.list, { - baseURL: repoUrl(), - method: "POST", - body: { - organ: this.organNameGetter, - system: "navigateChart", - build_state: buildState(), - }, - }); - - this.searchChartSchemaSetter(res.data.navigateChart); - this.searchChartActiveSchemaSetter(res.data.navigateChart[0]); - this.searchChartActiveTabSetter(res.data.navigateChart[0].items[0]); - - this.dataBankSelectValue = this.searchChartActiveSchemaGetter; - - this.getChartData(); - } catch (err) {} - }, - //mehdi - AddToFolder(text) { - if (this.selectedProjectGetter.lists.length) { - if (text == "positionOne") { - let myString = this.selectedProjectGetter.lists[0].items; - let myArray1 = myString.split(","); - let myArray2 = this.selectedProjectGetter.items; - let myArray3 = []; - for (let i = 0; i < myArray1.length; i++) { - for (let j = 0; j < myArray2.length; j++) { - if (myArray1[i] === myArray2[j].name) { - myArray3.push(myArray2[j]); - break; - } - } - } - this.fieldOne = myArray3[0]; - this.fieldTwo = myArray3[1]; - this.fieldThree = myArray3[2]; - setTimeout(() => { - this.onComboChanged(); - - this.componentCounter++; - }, 300); - } else if (text == "positionTow") { - let myString = this.selectedProjectGetter.lists[1].items; - let myArray1 = myString.split(","); - let myArray2 = this.selectedProjectGetter.items; - let myArray3 = []; - for (let i = 0; i < myArray1.length; i++) { - for (let j = 0; j < myArray2.length; j++) { - if (myArray1[i] === myArray2[j].name) { - myArray3.push(myArray2[j]); - break; - } - } - } - this.fieldOne = myArray3[0]; - this.fieldTwo = myArray3[1]; - this.fieldThree = myArray3[2]; - setTimeout(() => { - this.onComboChanged(); - - this.componentCounter++; - }, 300); - } else { - let myString = this.selectedProjectGetter.lists[2].items; - let myArray1 = myString.split(","); - let myArray2 = this.selectedProjectGetter.items; - let myArray3 = []; - for (let i = 0; i < myArray1.length; i++) { - for (let j = 0; j < myArray2.length; j++) { - if (myArray1[i] === myArray2[j].name) { - myArray3.push(myArray2[j]); - break; - } - } - } - this.fieldOne = myArray3[0]; - this.fieldTwo = myArray3[1]; - this.fieldThree = myArray3[2]; - setTimeout(() => { - this.onComboChanged(); - - this.componentCounter++; - }, 300); - } - } - }, - - openNavigationFilter(item) { - // if (item == 1) { - // this.$refs.pags.classList.add("position1"); - // this.$refs.pags.classList.remove("position2"); - // } else { - // this.$refs.pags.classList.add("position2"); - // this.$refs.pags.classList.remove("position1"); - // } - // this.$refs.navigationFilter.classList.remove("d-none"); - }, - statusPag2($event) { - this.statusPag = $event; - // if(this.statusPag=3){ - // this.showtextpag=false; - // }else if (this.statusPag=2){ - // this.showtextpag=true; - // } - switch (this.statusPag) { - case (this.statusPag = 2): - this.$refs.pags.classList.add("position1"); - this.$refs.pags.classList.remove("position2"); - break; - case (this.statusPag = 1): - this.$refs.pags.classList.add("position2"); - this.$refs.pags.classList.remove("position1"); - break; - } - }, - isShowPag(event) { - // this.$refs.navigationFilter.classList.add("d-none"); - // this.$refs.navigationFilter.classList.remove("position2"); - }, - - //mehdi - - exportJsonToExcel(evt) { - if (evt === "current") { - convertJsonToExcelUsingPlugin( - this.filterColumns(this.listItem, this.getTableColumns), - this.listGetter[this.listGetter.length - 1].key - ).finally(() => { - this.fetchingDataForExport = false; - }); - } else if (evt === "all") { - if (this.pagination.total > 500) { - this.mySwalConfirm({ - title: "خطا!!!", - html: "حداکثر تعداد قابل خروجی گرفتن، 500 مورد می باشد.لطفا با مدیریت تماس بگیرید.", - }).then((result) => { - this.getAllListItemForExport(500) - .then((response) => { - convertJsonToExcelUsingPlugin( - this.filterColumns(response.hits.hits, this.getTableColumns), - this.listGetter[this.listGetter.length - 1].key - ) - .then(() => {}) - .finally(() => { - this.fetchingDataForExport = false; - }); - }) - - .finally(() => { - this.fetchingDataForExport = false; - }); - }); - } else { - this.getAllListItemForExport() - .then((response) => { - convertJsonToExcelUsingPlugin( - this.filterColumns(response.hits.hits, this.getTableColumns), - this.listGetter[this.listGetter.length - 1].key - ) - .then(() => {}) - .finally(() => { - this.fetchingDataForExport = false; - }); - }) - - .finally(() => { - this.fetchingDataForExport = false; - }); - } - } - }, - filterColumns(listItem, columns) { - let clonedItems = structuredClone(listItem); - let clonedColumns = structuredClone(columns); - let filteredItems = []; - - clonedItems.forEach((item, index) => { - let filterObject = {}; - - clonedColumns.forEach((j) => { - filterObject[j.title] = item[j.key]; - }); - - filteredItems[index] = filterObject; - }); - return filteredItems; - }, - async getAllListItemForExport(maxAmount = undefined) { - if (this.fetchingDataForExport) return; - this.fetchingDataForExport = true; - - let url = - repoUrl() + - searchApis.navigation.reportItem + - `/${this.searchChartActiveSchemaGetter?.index_name}`; - - url += `/${this.sorting.sortby}/${this.sorting.sortorder}`; - url += `/0/${maxAmount ?? this.pagination.total}/`; - - if (this.listGetter && this.listGetter.length) { - if (this.listGetter.length <= this.fields.length) { - for (let i = 0; i < this.listGetter.length; i++) { - url += `${this.fields[i].name}=${this.listGetter[i].key}`; - if (i != this.listGetter.length - 1) url += "&"; - } - } - } - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: repoUrl(), - method: "POST", - body: { - organ: this.organNameGetter, - system: "navigateChart", - build_state: buildState(), - }, - }); - return res; - } catch (err) {} - }, - - async updateOrder({ rowItem, newOrder }) { - const res = rowItem.subject.filter( - (item) => item.title == this.listGetter[this.listGetter.length - 1].key - ); - - const payload = { - id: rowItem.id_store, - subject_id: res[0].id, - subject_title: res[0].title, - subject_order: +newOrder, - }; - - const url = repoUrl() + searchApis.subject.order; - - try { - const { $api } = useNuxtApp(); - const res = await $api(searchApis.schema.list, { - baseURL: repoUrl(), - method: "POST", - body: payload, - }); - - this.mySwalToast({ - title: res.message, - html: "", - }); - } catch (err) {} - }, - async getComboList() { - if (this.fetchingData) return; - this.fetchingData = true; - - let url = repoUrl() + searchApis.navigation.list; - url = url.replace("~/entity", this.searchChartActiveSchemaGetter?.key); - - try { - const { $api } = useNuxtApp(); - const res = await $api(url, { - baseURL: repoUrl(), - }); - - this.navigationOptions = res.data; - - this.navigationOptions[0].meta = JSON.parse( - this.navigationOptions[0].meta - ); - this.navigationOptions[0].table_columns = JSON.parse( - this.navigationOptions[0].table_columns - ); - this.navigationOptions[0].table_columns_subject = JSON.parse( - this.navigationOptions[0].table_columns_subject - ); - - this.SET_SELECTED_PROJECT(this.navigationOptions[0]); - this.fetchingData = false; - } catch (err) { - this.fetchingData = false; - } - }, - - onSelectNavigation(evt) { - // this.fieldOne = null; - // this.fieldTwo = null; - // this.fieldThree = null; - // this.SET_LIST([]); - // this.listItem = []; - // this.fields = []; - - // if (typeof evt?.meta == "string") { - // try { - // evt.meta = JSON.parse(evt.meta); - // evt.table_columns = JSON.parse(evt.table_columns); - // evt.table_columns_subject = JSON.parse(evt.table_columns_subject); - // } catch (e) {} - // } - - // this.selectedNavigation = evt; - // this.searchChartSchemaSetter(); - // this.searchChartActiveTabSetter(); - this.searchChartActiveSchemaSetter(evt); - - this.getChartData(); - - // this.$nextTick(() => { - // this.componentCounter++; - // }); - }, - onComboChanged() { - this.SET_LIST([]); - this.listItem = []; - const vm = this; - setTimeout(() => { - vm.fields = [vm.fieldOne, vm.fieldTwo, vm.fieldThree].filter( - (item) => item != null - ); - vm.componentCounter++; - }, 300); - }, - toggleSidebarMenu() { - this.$store.commit("TOGGLE_SIDEBAR_MENU"); - }, - showToggleListPanel() { - this.showListPanel = !this.showListPanel; - }, - searchInTable() {}, - - getChartListItems() { - const payload = { - projectid: this.selectedProjectGetter?.id, - item_state: this.selectedProjectGetter?.item_state, - ...this.sorting, - ...this.pagination, - }; - - const url = - this.currentPageName == "list" - ? listApis.item.listNotRel - : listApis.item.subjectNotRel; - - ApiService.formData(url, payload) - .then((res) => { - this.listItem = res.data.data; - this.pagination = { ...this.pagination, ...res.data.pagination }; - }) - .catch((err) => { - handleErrors(err); - - // this.mySwalToast({ - // title: response.data.message, - // html: "", - // text: "لطفا با پشتیبانی تماس بگیرید.", - // icon: "error", - // }); - }); - }, - }, -}; +}); + +const state = reactive({ + libraryList: new Array(20).fill(0), +}); + +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); +const CardList = defineAsyncComponent(() => + import("@hadith/components/hadith/CardList.vue") +); </script> -<style lang="scss"> -.custom-filter-container { - @media screen and (min-width: 575px) { - background-color: rgba(0, 0, 0, 0.05); - } +<template> + <HadithLayout> + <div class="search-box-container h-full flex flex-col justify-center"> + <navigation-menu></navigation-menu> - .multiselect { - // width: 16em; - // border: 2px solid rgb(127, 170, 170) !important; - border-radius: 0.5em; + <card-list + no-data-text="هنوز چیزی ذخیره نکردهاید!" + no-data-icon="/img/no-data.png" + :list="state.libraryList" + ></card-list> + </div> + </HadithLayout> +</template> - @media screen and (max-width: 575px) { - .multiselect__tags { - font-size: 0.8rem; - } - } - } -} -</style> -<style scoped lang="scss"> -.main-page__content-header { - background: linear-gradient(to top, #fcfcfc 0%, #eee 90%); - padding-top: 1em; -} -.multiselect { - width: 12em; - white-space: nowrap; -} -.header-height { - height: 4em; -} -.nav-tabs-container { - display: flex; - justify-content: center; -} -.label-change { - width: auto; - // min-width: 5em; - margin-bottom: 0em; -} - -@media (max-width: 575.98px) { - li.desktop:nth-child(n + 3) { - display: none; - } - - .dropdown-menu { - a.dropdown-item:nth-child(-n + 2) { - display: none; - } - } - .header-height { - height: 6em; - } -} -@media only screen and (min-width: 576px) and (max-width: 767.98px) { - li.desktop:nth-child(n + 4) { - display: none; - } - .dropdown-menu { - a.dropdown-item:nth-child(-n + 3) { - display: none; - } - } - .header-height { - height: 6em; - } - .filter-list-container { - padding-top: 0.5em; - position: fixed; - - z-index: 9; - width: auto; - - .main-filter { - display: none; - } - .mobile-mode { - display: flex; - justify-content: flex-end; - - .btn { - border-radius: 50%; - // font-size: 0.7rem; - width: 2.5em; - height: 2.5em; - box-shadow: 0px 0px 7px 1px #eee; - display: flex; - justify-content: center; - align-items: center; - transform: translateX(1.5em); - background-color: #eee; - - &:hover { - filter: brightness(0.8); - } - } - } - - &.expanded { - top: 0; - bottom: 0; - background: #fff; - justify-content: center; - box-shadow: -1px 0px 7px 1px #eee; - - .main-filter { - display: block; - } - } - } -} -@media only screen and (min-width: 768px) and (max-width: 991.98px) { - .header-height { - height: 6em; - } -} -@media only screen and (min-width: 992px) and (max-width: 1199.98px) { -} -@media (min-width: 1200px) { +<style scoped> +.search-box-container { + padding-top: 8.3em; + background: #f7fffd; } </style> diff --git a/pages/hadith/login.vue b/pages/hadith/login.vue index 700195a..abd3645 100644 --- a/pages/hadith/login.vue +++ b/pages/hadith/login.vue @@ -246,12 +246,12 @@ <script> import { mapState, mapActions } from "pinia"; import searchApis from "@search/apis/searchApi"; -import chartType from "@search/json/search/json/chart.json"; +import chartType from "@search/json/search/chart.json"; -import sidbarMenuDefault from "@search/json/search/json/menu.json"; -import sidbarMenuMin from "@search/json/search/json/sidbarMenuMin.json"; +import sidbarMenuDefault from "@search/json/search/menu.json"; +import sidbarMenuMin from "@search/json/search/sidbarMenuMin.json"; -import tableActions from "@search/json/search/json/listTableContextMenu"; +import tableActions from "@search/json/search/listTableContextMenu"; import { useSearchStore } from "@search/stores/searchStore"; export default { diff --git a/pages/hadith/public-pages/about-us.vue b/pages/hadith/public-pages/about-us.vue index d348817..b2d2de2 100644 --- a/pages/hadith/public-pages/about-us.vue +++ b/pages/hadith/public-pages/about-us.vue @@ -1,247 +1,113 @@ +<script setup> +definePageMeta({ + layout: false, + name: "hadithAbout", +}); +useHead({ + name: "hadithAbout", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | در باره حدیثا`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, + }, +}); + +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); +</script> + <template> - <div class="wrapper detail-page"> - <TopHeader - ref="topheader" - @searchStart="searchStart" - @showfilter="showfilter" - @searchType="searchTyping" - @="searchCoding" - ></TopHeader> + <HadithLayout> + <div class="page-container h-full"> + <!-- max-w-[var(--ui-container-two)] --> + <UContainer class="page-inner-container sm:px-6 lg:px-4"> + <navigation-menu></navigation-menu> - <Content - :pagination="pagination" - @changeCurrent="changeCurrent" - @changePage="changePaging" - ref="content" - ></Content> + <div class="page-header pt-38 pb-4 flex justify-between items-center"> + <div class="flex items-center"> + <h1 class="m-0 title">درباره</h1> + <NuxtImg + fit="auto" + quality="80" + placeholder + src="/img/haditha-title.svg" + /> + </div> + </div> - <filter-list-search @filterUpdate="filterUpdate" ref="filterlist"></filter-list-search> - <Summary - ref="summary" - :meets="meets" - @hideSummary="hideSummary" - v-show="showSummary" - > - </Summary> - <!-- <ChartTree> - </ChartTree> --> - </div> + <div class="page-content p-6"> + <p> + حدیثا، یک موتور جستجوی پیشرفته و تخصصی در حوزه احادیث اسلامی است که + با هدف دسترسی آسان و سریع به منابع معتبر حدیثی طراحی شده است. این + پلتفرم، بستری است برای پژوهشگران، علاقهمندان به معارف اسلامی، و + تمامی افرادی که به دنبال دسترسی به گنجینه ارزشمند احادیث نبوی و + اهلبیت (علیهمالسلام) هستند. + </p> + + <p> + ما در حدیثا تلاش میکنیم تا با بهرهگیری از فناوریهای نوین و منابع + اصیل اسلامی، بهترین تجربه جستجو را به کاربران ارائه دهیم. تمامی + محتوای این موتور جستجو از کتب معتبر حدیثی و منابع شناختهشده استخراج + شده و با دقت علمی بالا ساماندهی شده است. + </p> + + <p>اهداف ما شامل موارد زیر است:</p> + + <ul class="list-disc list-inside"> + <li>ارائه محتوای معتبر و دستهبندیشده از احادیث اسلامی.</li> + <li>تسهیل دسترسی به معارف اسلامی برای پژوهشگران و عموم مردم.</li> + <li>کمک به ترویج فرهنگ و اخلاق اسلامی از طریق انتشار احادیث.</li> + </ul> + + <p> + ما به حریم خصوصی کاربران خود احترام میگذاریم و متعهد به ارائه + خدماتی با کیفیت و دقیق هستیم. حدیثا پلی است میان شما و کلام گهربار + اهلبیت و پیامبر اسلام (صلیاللهعلیهوآله). + </p> + <p>به خانواده حدیثا بپیوندید و در مسیر دانش و معرفت گام بردارید.</p> + </div> + </UContainer> + </div> + </HadithLayout> </template> -<script> -// import axios from "axios"; -import TopHeader from "~/search/view/layout/Top.vue"; -import FilterListSearch from "~/search/view/layout/FilterListSearch.vue"; -import Content from "~/search/view/pages/TermContent.vue"; -import Summary from "~/search/view/layout/TermSummary.vue"; -import LogService from "~/services/log.service"; -import {mapState} from "pinia"; +<style scoped> +.page-container { + background: #f7fffd; -// -// const API = axios.create({ -// //baseURL: 'http://2.182.155.188', -// baseURL: import.meta.env.VITE_API_SEARCH, -// }) + .page-inner-container { + .page-header { + color: var(--ui-color-two); -export default { - props: ["q"], - name: "Term", - data() { - return { - meets: [], - tq: this.q, - filterUrl: "", - loading: false, - showSummary: false, - countInPage: 10, - currentItem: [], - searchType: "", - searchCode: "all", - ismultword: false, - iscode: false, - page: 0, - pagination: { - page: 1, - pages: 0, - total: 0, - offset: 0, // page * per_page - limit: 10, //per_page - }, - }; - }, - computed:{ - ...mapState(["currentUser"]) - }, - - mounted() { - this.$refs.topheader.modetab = 3; - this.$refs.topheader.state = 2; - if (this.tq != "") { - var item = this.tq; - this.checkMultiword(item); - this.$refs.topheader.setSearchLine(this.tq); - this.$refs.content.setTextSearch(this.tq, this.countInPage); - this.getQuery(); + .title { + font-family: IRANSansX; + font-weight: 300; + font-size: 24px; + line-height: 36px; + letter-spacing: 0%; + text-align: center; + } } - }, - methods: { - searchTyping(type) { - this.searchType = type; - }, - searchCoding(code) { - this.searchCode = code; - }, - resetOptions() { - this.page = 0; - this.filterUrl = ""; - this.$refs.filterlist.resetFilter(); - }, - showfilter: function() { - this.$refs.filterlist.showfilter(); - }, - checkMultiword(item) { - this.ismultword = false; - if (item == null || item == "") return; - var ww = item.split(" "); - this.iscode = /^\d+$/.test(item); - if (this.iscode == false) this.ismultword = item.split(" ").length > 1; - this.$refs.topheader.setOptions(this.ismultword, this.iscode); - }, - searchStart: function(item) { - if (item != null) { - item = item.trim(); - this.tq = item; + .page-content { + color: var(--ui-color-two); - this.checkMultiword(item); - this.$refs.content.setTextSearch(item, this.countInPage); - } - this.resetOptions(); - this.getQuery(); - }, - changePaging: function(item) { - this.pagination = item; - this.getQuery(true); - }, - hideSummary: function() { - this.showSummary = false; - }, - changeCurrent(item) { - - if (item == this.currentItem) this.showSummary = !this.showSummary; - else this.showSummary = true; - this.currentItem = item; - - - - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/items/"; - - ApiService.getRequest( - suburl + - this.page + - "/" + - item.doc_count + - "/q=" + - item.key + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - - // if (title == this.currentItem) this.showSummary = !this.showSummary; - // else this.showSummary = true; - - // this.showSummary = true; - this.meets = response.data.hits.hits; - - // this.$refs.summary.setInfo(response.data.hits.hits); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - filterUpdate: function(filter) { - this.filterUrl = filter; - // history.pushState(null, '', '/list' + '/q='+ this.tq+ filter); - this.$router.push({ - name: "TermResult", - query: { q: this.tq + filter }, - }); - this.page = 0; - this.getQuery(false, true); - }, - - // typeNormal : جستجوی عادی - // typeAnd : جستجوی عطفی - // typePhrase : جستجوی عبارتی - - getQuery: function(pageOnly = false, filteronly = false) { - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/"; - if (this.ismultword) { - if (this.searchType == "typeAnd") suburl = "/monir/search/term/and/"; - else if (this.searchType == "typePhrase") - suburl = "/monir/search/term/phrase/"; - } - - ApiService.getRequest( - suburl + - this.pagination.offset + - "/" + - this.pagination.limit + - "/q=" + - this.tq + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - if (pageOnly) { - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets - ); - } else if (filteronly) { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - } else { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - response.data.aggregations.branch.buckets = []; - this.$refs.filterlist.setAnswer(response.data.aggregations); - } - - const total = response.data.hits.total.value; - const pages = Math.ceil(total / this.pagination.limit); - const pagination = { - total: total, - pages: pages == 0 ? 1 : pages - } - - this.pagination = { ...this.pagination, ...pagination }; - LogService.index(this.currentUser,vm.tq, vm.page, vm.filterUrl, response.data.took); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - }, -}; -</script> +p { + font-family: IRANSansX; + font-weight: 300; + font-size: 14px; + line-height: 21px; + letter-spacing: 0%; + text-align: right; +} + } + } +} +</style> diff --git a/pages/hadith/public-pages/contact-us.vue b/pages/hadith/public-pages/contact-us.vue deleted file mode 100644 index d348817..0000000 --- a/pages/hadith/public-pages/contact-us.vue +++ /dev/null @@ -1,247 +0,0 @@ -<template> - <div class="wrapper detail-page"> - <TopHeader - ref="topheader" - @searchStart="searchStart" - @showfilter="showfilter" - @searchType="searchTyping" - @="searchCoding" - ></TopHeader> - - <Content - :pagination="pagination" - @changeCurrent="changeCurrent" - @changePage="changePaging" - ref="content" - ></Content> - - <filter-list-search @filterUpdate="filterUpdate" ref="filterlist"></filter-list-search> - <Summary - ref="summary" - :meets="meets" - @hideSummary="hideSummary" - v-show="showSummary" - > - </Summary> - <!-- <ChartTree> - </ChartTree> --> - </div> -</template> - -<script> -// import axios from "axios"; -import TopHeader from "~/search/view/layout/Top.vue"; -import FilterListSearch from "~/search/view/layout/FilterListSearch.vue"; -import Content from "~/search/view/pages/TermContent.vue"; -import Summary from "~/search/view/layout/TermSummary.vue"; -import LogService from "~/services/log.service"; -import {mapState} from "pinia"; - -// -// const API = axios.create({ -// //baseURL: 'http://2.182.155.188', -// baseURL: import.meta.env.VITE_API_SEARCH, -// }) - -export default { - props: ["q"], - name: "Term", - data() { - return { - meets: [], - tq: this.q, - filterUrl: "", - loading: false, - showSummary: false, - countInPage: 10, - currentItem: [], - searchType: "", - searchCode: "all", - ismultword: false, - iscode: false, - page: 0, - pagination: { - page: 1, - pages: 0, - total: 0, - offset: 0, // page * per_page - limit: 10, //per_page - }, - }; - }, - computed:{ - ...mapState(["currentUser"]) - }, - - mounted() { - this.$refs.topheader.modetab = 3; - this.$refs.topheader.state = 2; - if (this.tq != "") { - var item = this.tq; - this.checkMultiword(item); - this.$refs.topheader.setSearchLine(this.tq); - this.$refs.content.setTextSearch(this.tq, this.countInPage); - this.getQuery(); - } - }, - methods: { - searchTyping(type) { - this.searchType = type; - }, - searchCoding(code) { - this.searchCode = code; - }, - resetOptions() { - this.page = 0; - this.filterUrl = ""; - this.$refs.filterlist.resetFilter(); - }, - showfilter: function() { - this.$refs.filterlist.showfilter(); - }, - checkMultiword(item) { - this.ismultword = false; - if (item == null || item == "") return; - var ww = item.split(" "); - this.iscode = /^\d+$/.test(item); - if (this.iscode == false) this.ismultword = item.split(" ").length > 1; - - this.$refs.topheader.setOptions(this.ismultword, this.iscode); - }, - searchStart: function(item) { - if (item != null) { - item = item.trim(); - this.tq = item; - - this.checkMultiword(item); - this.$refs.content.setTextSearch(item, this.countInPage); - } - this.resetOptions(); - this.getQuery(); - }, - changePaging: function(item) { - this.pagination = item; - this.getQuery(true); - }, - hideSummary: function() { - this.showSummary = false; - }, - changeCurrent(item) { - - if (item == this.currentItem) this.showSummary = !this.showSummary; - else this.showSummary = true; - this.currentItem = item; - - - - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/items/"; - - ApiService.getRequest( - suburl + - this.page + - "/" + - item.doc_count + - "/q=" + - item.key + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - - // if (title == this.currentItem) this.showSummary = !this.showSummary; - // else this.showSummary = true; - - // this.showSummary = true; - this.meets = response.data.hits.hits; - - // this.$refs.summary.setInfo(response.data.hits.hits); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - filterUpdate: function(filter) { - this.filterUrl = filter; - // history.pushState(null, '', '/list' + '/q='+ this.tq+ filter); - this.$router.push({ - name: "TermResult", - query: { q: this.tq + filter }, - }); - this.page = 0; - this.getQuery(false, true); - }, - - // typeNormal : جستجوی عادی - // typeAnd : جستجوی عطفی - // typePhrase : جستجوی عبارتی - - getQuery: function(pageOnly = false, filteronly = false) { - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/"; - if (this.ismultword) { - if (this.searchType == "typeAnd") suburl = "/monir/search/term/and/"; - else if (this.searchType == "typePhrase") - suburl = "/monir/search/term/phrase/"; - } - - ApiService.getRequest( - suburl + - this.pagination.offset + - "/" + - this.pagination.limit + - "/q=" + - this.tq + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - if (pageOnly) { - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets - ); - } else if (filteronly) { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - } else { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - response.data.aggregations.branch.buckets = []; - this.$refs.filterlist.setAnswer(response.data.aggregations); - } - - const total = response.data.hits.total.value; - const pages = Math.ceil(total / this.pagination.limit); - const pagination = { - total: total, - pages: pages == 0 ? 1 : pages - } - - this.pagination = { ...this.pagination, ...pagination }; - LogService.index(this.currentUser,vm.tq, vm.page, vm.filterUrl, response.data.took); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - }, -}; -</script> diff --git a/pages/hadith/public-pages/contactus.vue b/pages/hadith/public-pages/contactus.vue new file mode 100644 index 0000000..8745f7a --- /dev/null +++ b/pages/hadith/public-pages/contactus.vue @@ -0,0 +1,189 @@ +<script setup> +definePageMeta({ + layout: false, + name: "hadithContact", +}); +useHead({ + name: "hadithContact", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | تماس با ما`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, + }, +}); + +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); +</script> + +<template> + <HadithLayout> + <div class="page-container h-full"> + <!-- max-w-[var(--ui-container-two)] --> + <UContainer class="page-inner-container sm:px-6 lg:px-4"> + <span class="top-left-bgi z-0"></span> + + <navigation-menu></navigation-menu> + + <div class="page-header pt-38 pb-4 flex justify-between items-center"> + <div class="flex items-center"> + <h1 class="m-0 title">تماس با ما</h1> + </div> + </div> + + <div class="page-content p-6"> + <div class="mb-4"> + <span class="label">تلفن ثابت</span> + <span class="value"> ۰۲۵۳۲۹۰۶۴۵۲</span> + </div> + + <div class="mb-4"> + <span class="label">تلفن همراه </span> + <span class="value">۰۹۱۲۷۵۰۵۰۵۰ </span> + </div> + <div class="mb-4"> + <span class="label">پشتیبان ایتا </span> + <span class="value"> ۰۹۱۲۷۵۰۵۰۵۰</span> + </div> + <div class="mb-4"> + <span class="label">کدپستی </span> + <span class="value">۱۲۳۴۵۶۷۸ </span> + </div> + <div class="mb-4"> + <span class="label"> آدرس</span> + <span class="value"> + دفتر مرکزی: قم، خیابان معلم، کوچه ۱۰، فرعی ۳ پلاک ۵۵ ساختمان + اشراق، واحد ۳۰۵</span + > + </div> + <div class="location"> + <NuxtImg + fit="auto" + quality="80" + placeholder + src="/img/location.png" + /> + </div> + </div> + </UContainer> + </div> + </HadithLayout> +</template> + +<style scoped> +.page-container { + background: #f7fffd; + position: relative; + z-index: 1; + + .top-left-bgi { + position: absolute; + top: 0; + left: 0; + background-image: url("../../../assets/hadith/images/modal-top-bgi.png"); + backdrop-filter: blur(54px); + width: 447px; + height: 447px; + top: 0; + left: 0; + + background-repeat: no-repeat; + background-size: auto; + z-index: -1; + } + &::before { + content: ""; + position: absolute; + right: 0; + bottom: 0; + background-image: url("../../../assets/hadith/images/modal-bttom-right-bgi.png"); + backdrop-filter: blur(54px); + width: 438px; + height: 238px; + mix-blend-mode: Multiply; + background-repeat: no-repeat; + background-size: cover; + z-index: -1; + } + + &::after { + content: ""; + + position: absolute; + bottom: 0; + left: 0; + + width: 458px; + height: 239px; + mix-blend-mode: Multiply; + background-image: url("../../../assets/hadith/images/modal-bottom-left-bgi.png"); + background-repeat: no-repeat; + background-size: cover; + backdrop-filter: blur(54px); + z-index: -1; + } + .page-inner-container { + .page-header { + color: var(--ui-color-two); + + .title { + font-family: IRANSansX; + font-weight: 300; + font-size: 24px; + line-height: 36px; + letter-spacing: 0%; + text-align: center; + } + } + + .page-content { + color: var(--ui-color-two); + + .label { + display: inline-block; + margin-inline-end: 1em; + font-family: IRANSansX; + font-weight: 300; + font-size: 14px; + line-height: 21px; + letter-spacing: 0%; + text-align: right; + color: #626b84; + width: 77px; + height: 21; + } + .value { + font-family: IRANSansX; + font-weight: 300; + font-size: 14px; + line-height: 21px; + letter-spacing: 0%; + text-align: right; + color: #1b2132; + } + + .location { + width: 672; + height: 348; + border-width: 1px; + border-radius: 16px; + + border: 1px solid; + + border-image-source: linear-gradient( + 102.02deg, + #4be8ae 7.38%, + #00a762 91.78% + ); + } + } + } +} +</style> diff --git a/pages/hadith/public-pages/index.vue b/pages/hadith/public-pages/index.vue new file mode 100644 index 0000000..b35dc08 --- /dev/null +++ b/pages/hadith/public-pages/index.vue @@ -0,0 +1,106 @@ +<script setup> +const route = useRoute(); + +definePageMeta({ + layout: false, + name: "hadithPublicPage", +}); +useHead({ + name: "hadithPublicPage", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | در باره حدیثا`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, + }, +}); +const componentName = ref(""); + +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); +const AboutUs = defineAsyncComponent(() => + import("@hadith/pages/hadith/public-pages/about-us.vue") +); +const ContactUs = defineAsyncComponent(() => + import("@hadith/pages/hadith/public-pages/contactus.vue") +); +const Rules = defineAsyncComponent(() => + import("@hadith/pages/hadith/public-pages/rules.vue") +); + +onMounted(() => { + console.info(route.path); + // if (route.path == "/hadith/about-us") componentName.value = "AboutUs"; + // if (route.path == "/hadith/contact-us") componentName.value = "ContactUs"; + // if (route.path == "/hadith/rules") componentName.value = "Rules"; +}); +</script> + +<template> + <HadithLayout> + <div class="page-container h-full"> + <!-- max-w-[var(--ui-container-two)] --> + <UContainer class="page-inner-container sm:px-6 lg:px-4"> + <navigation-menu></navigation-menu> + + <div class="page-header pt-38 pb-4 flex justify-between items-center"> + <div class="flex items-center"> + <h1 class="m-0 title">درباره</h1> + <NuxtImg + fit="auto" + quality="80" + placeholder + src="/img/haditha-title.svg" + /> + </div> + </div> + + <div class="page-content p-6"> + <ContactUs v-if="route.path == '/hadith/contact-us'"></ContactUs> + <AboutUs v-if="route.path == '/hadith/about-us'"></AboutUs> + <Rules v-else-if="route.path == '/hadith/rules'"></Rules> + </div> + </UContainer> + </div> + </HadithLayout> +</template> + +<style scoped> +.page-container { + background: #f7fffd; + + .page-inner-container { + .page-header { + color: var(--ui-color-two); + + .title { + font-family: IRANSansX; + font-weight: 300; + font-size: 24px; + line-height: 36px; + letter-spacing: 0%; + text-align: center; + } + } + + .page-content { + color: var(--ui-color-two); + + p { + font-family: IRANSansX; + font-weight: 300; + font-size: 14px; + line-height: 21px; + letter-spacing: 0%; + text-align: right; + } + } + } +} +</style> diff --git a/pages/hadith/public-pages/rules.vue b/pages/hadith/public-pages/rules.vue index d348817..ad634ea 100644 --- a/pages/hadith/public-pages/rules.vue +++ b/pages/hadith/public-pages/rules.vue @@ -1,247 +1,126 @@ +<script setup> +definePageMeta({ + layout: false, + name: "hadithRules", +}); +useHead({ + name: "hadithRules", + title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | قوانین و مقررات حدیثا`, + meta: [ + { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" }, + ], + bodyAttrs: { + class: import.meta.env.VITE_HADITH_SYSTEM, + }, +}); + +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); +</script> + <template> - <div class="wrapper detail-page"> - <TopHeader - ref="topheader" - @searchStart="searchStart" - @showfilter="showfilter" - @searchType="searchTyping" - @="searchCoding" - ></TopHeader> + <HadithLayout> + <div class="page-container h-full"> + <!-- max-w-[var(--ui-container-two)] --> + <UContainer class="page-inner-container sm:px-6 lg:px-4"> + <navigation-menu></navigation-menu> - <Content - :pagination="pagination" - @changeCurrent="changeCurrent" - @changePage="changePaging" - ref="content" - ></Content> + <div class="page-header pt-38 pb-4 flex justify-between items-center"> + <div class="flex items-center"> + <h1 class="m-0 title">قوانین و مقررات</h1> + <NuxtImg + fit="auto" + quality="80" + placeholder + src="/img/haditha-title.svg" + /> + </div> + </div> - <filter-list-search @filterUpdate="filterUpdate" ref="filterlist"></filter-list-search> - <Summary - ref="summary" - :meets="meets" - @hideSummary="hideSummary" - v-show="showSummary" - > - </Summary> - <!-- <ChartTree> - </ChartTree> --> - </div> + <div class="page-content p-6"> + <ul class="list-decimal list-inside"> + <li> + احترام به حقوق معنوی: تمامی محتواهای ارائهشده در این سایت متعلق + به منابع معتبر بوده و هرگونه استفاده بدون ذکر منبع ممنوع است. + </li> + <li> + منابع معتبر: احادیث منتشرشده از منابع معتبر اسلامی استخراج شدهاند + و هرگونه ادعای مغایرت باید با دلایل علمی و معتبر باشد. + </li> + <li> + استفاده شخصی و غیرتجاری: کاربران مجاز به استفاده از محتوای سایت + تنها برای مقاصد شخصی و غیرتجاری هستند. + </li> + <li> + مسئولیت صحت برداشت: مسئولیت هرگونه برداشت اشتباه از محتوای سایت بر + عهده کاربر است و سایت مسئولیتی در قبال آن ندارد. + </li> + <li> + حریم خصوصی: اطلاعات کاربران به صورت کاملاً محرمانه نگهداری میشود + و هیچگونه اطلاعاتی بدون رضایت کاربر به اشتراک گذاشته نخواهد شد. + </li> + <li> + عدم انتشار محتوا: کاربران مجاز به انتشار مجدد احادیث یا مطالب سایت + در دیگر پلتفرمها بدون اجازه کتبی نیستند. + </li> + <li> + پاسخگویی به نظرات: نظرات و پیشنهادات کاربران با احترام بررسی + میشود، اما سایت الزامی برای پاسخ به همه موارد ندارد. + </li> + <li> + تغییر در محتوا و قوانین: سایت حق دارد هرگونه تغییر در محتوا یا + قوانین را بدون اطلاع قبلی انجام دهد. + </li> + <li> + تبعیت از قوانین اسلامی: تمامی فعالیتها و محتوای سایت بر اساس اصول + و قوانین اسلامی طراحی شدهاند. + </li> + <li> + محدودیت دسترسی: در صورت استفاده نامناسب یا تخطی از قوانین، سایت + میتواند دسترسی کاربر را محدود یا مسدود کند. + </li> + </ul> + </div> + </UContainer> + </div> + </HadithLayout> </template> -<script> -// import axios from "axios"; -import TopHeader from "~/search/view/layout/Top.vue"; -import FilterListSearch from "~/search/view/layout/FilterListSearch.vue"; -import Content from "~/search/view/pages/TermContent.vue"; -import Summary from "~/search/view/layout/TermSummary.vue"; -import LogService from "~/services/log.service"; -import {mapState} from "pinia"; +<style scoped> +.page-container { + background: #f7fffd; -// -// const API = axios.create({ -// //baseURL: 'http://2.182.155.188', -// baseURL: import.meta.env.VITE_API_SEARCH, -// }) + .page-inner-container { + .page-header { + color: var(--ui-color-two); -export default { - props: ["q"], - name: "Term", - data() { - return { - meets: [], - tq: this.q, - filterUrl: "", - loading: false, - showSummary: false, - countInPage: 10, - currentItem: [], - searchType: "", - searchCode: "all", - ismultword: false, - iscode: false, - page: 0, - pagination: { - page: 1, - pages: 0, - total: 0, - offset: 0, // page * per_page - limit: 10, //per_page - }, - }; - }, - computed:{ - ...mapState(["currentUser"]) - }, - - mounted() { - this.$refs.topheader.modetab = 3; - this.$refs.topheader.state = 2; - if (this.tq != "") { - var item = this.tq; - this.checkMultiword(item); - this.$refs.topheader.setSearchLine(this.tq); - this.$refs.content.setTextSearch(this.tq, this.countInPage); - this.getQuery(); + .title { + font-family: IRANSansX; + font-weight: 300; + font-size: 24px; + line-height: 36px; + letter-spacing: 0%; + text-align: center; + } } - }, - methods: { - searchTyping(type) { - this.searchType = type; - }, - searchCoding(code) { - this.searchCode = code; - }, - resetOptions() { - this.page = 0; - this.filterUrl = ""; - this.$refs.filterlist.resetFilter(); - }, - showfilter: function() { - this.$refs.filterlist.showfilter(); - }, - checkMultiword(item) { - this.ismultword = false; - if (item == null || item == "") return; - var ww = item.split(" "); - this.iscode = /^\d+$/.test(item); - if (this.iscode == false) this.ismultword = item.split(" ").length > 1; - this.$refs.topheader.setOptions(this.ismultword, this.iscode); - }, - searchStart: function(item) { - if (item != null) { - item = item.trim(); - this.tq = item; + .page-content { + color: var(--ui-color-two); - this.checkMultiword(item); - this.$refs.content.setTextSearch(item, this.countInPage); + ul li { + font-family: IRANSansX; + font-weight: 300; + font-size: 14px; + line-height: 21px; + letter-spacing: 0%; + text-align: right; } - this.resetOptions(); - this.getQuery(); - }, - changePaging: function(item) { - this.pagination = item; - this.getQuery(true); - }, - hideSummary: function() { - this.showSummary = false; - }, - changeCurrent(item) { - - if (item == this.currentItem) this.showSummary = !this.showSummary; - else this.showSummary = true; - this.currentItem = item; - - - - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/items/"; - - ApiService.getRequest( - suburl + - this.page + - "/" + - item.doc_count + - "/q=" + - item.key + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - - // if (title == this.currentItem) this.showSummary = !this.showSummary; - // else this.showSummary = true; - - // this.showSummary = true; - this.meets = response.data.hits.hits; - - // this.$refs.summary.setInfo(response.data.hits.hits); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - filterUpdate: function(filter) { - this.filterUrl = filter; - // history.pushState(null, '', '/list' + '/q='+ this.tq+ filter); - this.$router.push({ - name: "TermResult", - query: { q: this.tq + filter }, - }); - this.page = 0; - this.getQuery(false, true); - }, - - // typeNormal : جستجوی عادی - // typeAnd : جستجوی عطفی - // typePhrase : جستجوی عبارتی - - getQuery: function(pageOnly = false, filteronly = false) { - var vm = this; - this.loading = true; - var suburl = "/monir/search/term/"; - if (this.ismultword) { - if (this.searchType == "typeAnd") suburl = "/monir/search/term/and/"; - else if (this.searchType == "typePhrase") - suburl = "/monir/search/term/phrase/"; - } - - ApiService.getRequest( - suburl + - this.pagination.offset + - "/" + - this.pagination.limit + - "/q=" + - this.tq + - this.filterUrl - ) - .then((response) => { - vm.loading = false; - if (pageOnly) { - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets - ); - } else if (filteronly) { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - } else { - this.$refs.topheader.setCount( - response.data.hits.total.value, - response.data.hits.total.relation - ); - this.$refs.content.setAnswer( - response.data.aggregations.branch.buckets, - response.data.hits.total.value, - response.data.hits.total.relation - ); - response.data.aggregations.branch.buckets = []; - this.$refs.filterlist.setAnswer(response.data.aggregations); - } - - const total = response.data.hits.total.value; - const pages = Math.ceil(total / this.pagination.limit); - const pagination = { - total: total, - pages: pages == 0 ? 1 : pages - } - - this.pagination = { ...this.pagination, ...pagination }; - LogService.index(this.currentUser,vm.tq, vm.page, vm.filterUrl, response.data.took); - }) - .catch((error) => { - vm.loading = false; - vm.$alert(error); - }); - }, - }, -}; -</script> + } + } +} +</style> diff --git a/pages/hadith/search/index.vue b/pages/hadith/search/index.vue index b94e17f..8569751 100644 --- a/pages/hadith/search/index.vue +++ b/pages/hadith/search/index.vue @@ -16,19 +16,6 @@ useHead({ const img = useImage(); -const HadithLayout = defineAsyncComponent(() => - import("@hadith/layouts/HadithLayout.vue") -); -const NavigationMenu = defineAsyncComponent(() => - import("@hadith/components/hadith/NavigationMenu.vue") -); -const AutoComplation = defineAsyncComponent(() => - import("@hadith/components/hadith/AutoComplation.vue") -); -const SearchList = defineAsyncComponent(() => - import("@hadith/components/hadith/search-page/SearchList.vue") -); - const searchQuery = ref(""); const state = reactive({ searchList: [], @@ -62,16 +49,28 @@ const renderContent = (payload) => { searchQuery.value = payload.searchQuery; }; - +// components declaration +const HadithLayout = defineAsyncComponent(() => + import("@hadith/layouts/HadithLayout.vue") +); +const NavigationMenu = defineAsyncComponent(() => + import("@hadith/components/hadith/NavigationMenu.vue") +); +const AutoComplation = defineAsyncComponent(() => + import("@hadith/components/hadith/AutoComplation.vue") +); +const SearchList = defineAsyncComponent(() => + import("@hadith/components/hadith/search-page/SearchList.vue") +); </script> <template> <HadithLayout> <div class="h-full flex flex-col justify-center"> - <div class="bg-container h-full" :style="backgroundImageStyle"> + <div class="background-image h-full" :style="backgroundImageStyle"> <navigation-menu></navigation-menu> - <div class="text-logo"> + <div class="logo-container"> <div class="search-box-container flex justify-center" :class="{ 'pb-0': state.searchList.length }" @@ -94,7 +93,7 @@ const renderContent = (payload) => { </div> </div> - <no-data + <!-- <no-data class="h-full" v-if="searchQuery?.length && state.searchList?.length == 0" > @@ -105,12 +104,16 @@ const renderContent = (payload) => { src="/img/no-data.png" /> <p class="no-data-text">نتیجهای یافت نشد!</p> - </no-data> + </no-data> --> <div v-if="searchQuery?.length && state.searchList?.length" class="search-box-container pb-0 bg-white flex justify-center" > - <search-list :list="state.searchList"></search-list> + <search-list + no-data-text="نتیجهای یافت نشد!" + no-data-icon="/img/no-data.png" + :list="state.searchList" + ></search-list> </div> </div> </div> @@ -119,14 +122,14 @@ const renderContent = (payload) => { </template> <style scoped> -.bg-container { +.background-image { min-height: 100%; /* height: 100dvh; */ - background-size: cover; + background-size: auto; background-repeat: no-repeat; } -.text-logo { +.logo-container { padding-top: 4.5em; position: relative; @@ -137,7 +140,7 @@ const renderContent = (payload) => { line-height: 21px; letter-spacing: 0%; text-align: center; - color: #1b2132; + color: var(--ui-color-two); } .badge-style { width: 100; @@ -161,13 +164,4 @@ const renderContent = (payload) => { padding-bottom: 0 !important; } } - -.no-data-text { - font-family: IRANSansX; - font-weight: 300; - font-size: 16px; - line-height: 24px; - letter-spacing: 0%; - text-align: center; -} </style>