commit 947af21d6d830d1402735381b009fe8553b1a18e Author: mustafa-rezae Date: Tue Feb 4 16:10:58 2025 +0330 first commit diff --git a/apis/researchApi.js b/apis/researchApi.js new file mode 100644 index 0000000..345e49c --- /dev/null +++ b/apis/researchApi.js @@ -0,0 +1,24 @@ +export default { + admin: { + list: "", + show: "", + edit: "", + update: "", + delete: "", + }, + + research:{ + listDefault:"research/search/{{user_id}}/{{offset}}/{{limit}}", + listBySearch:"research/search/{{user_id}}/{{offset}}/{{limit}}/q=", + deleteItem: "/public/{{index_key}}/delete/{{id}}", //ایدی فیش و یا حاشیه + }, + subject: { + move: 'subject/order/move/parent', + order: 'subject/order/move/one', + list: 'list/subject/list', + add: 'list/subject/add', + edit: 'list/subject/edit', + delete: 'list/subject/delete', + order: 'list/subject/order', + }, +}; diff --git a/assets/research/scss/research.scss b/assets/research/scss/research.scss new file mode 100644 index 0000000..718e20d --- /dev/null +++ b/assets/research/scss/research.scss @@ -0,0 +1,142 @@ +.research-system { + .main-page__content { + margin-right: var(--sidebar-collapsed-width); + .search-items { + height: calc(100vh - 10em); + overflow: auto; + } + .myResearches { + .search-container { + .input-group { + /* justify-content: space-between; */ + border-radius: 50px; + .form-control { + border: 0; + border-right: 1px solid #eee; + border-left: 1px solid #eee; + height: 3em; + } + + .btn-primary { + border-radius: 50px 0 0 50px; + min-width: 5em; + } + } + } + } + .advanced-search { + position: absolute; + top: 0; + right: 0; + bottom: 0; + + padding-top: 1em; + padding-bottom: 1em; + + width: 20em; + // height: calc(100dvh - 10em); + overflow-y: auto; + background: #fff; + z-index: 99; + 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); + // border-radius: 0.25em; + + .multiselect__tags { + border: unset !important; + } + + .bottom-close-form { + &:hover { + color: #6acfef; + } + } + @media (max-width: 768px) { + .bottom-close-form { + position: absolute; + bottom: 7em !important; + } + } + // .search-page__search.in-search { + // input { + // padding-right: 5em !important; + // border: 1px solid transparent; + // } + // } + .form-group { + &.inside-advanced-search { + .form-control { + border-radius: 0.5em; + border: 1px solid #ced4da; + // padding: 1.2em; + // width: 14em; + &:focus { + border: 1px solid #61bb9e; + } + } + .date-picker { + .vpd-input-group { + direction: ltr; + .vpd-icon-btn { + margin-bottom: 0; + // position: absolute; + // right: 15.6em; + // height: 3em; + border-radius: 0.5em 0em 0em 0.5em; + } + .form-control { + border-radius: 0 0.5em 0.5em 0; + } + } + } + } + } + .select.in-advanced-search { + // padding: 0.3em !important; + border-radius: 0.5em; + font-size: 1rem; + // height: 3em; + // width: 15em !important; + border: 1px solid #ced4da !important; + &:focus { + border: 1px solid rgb(127, 170, 170) !important; + } + } + // .tribute.in-advanced-search { + // width: 18em !important; + // } + .form-control { + height: 2.2em; + } + } + .filter-list-container { + .mobile-mode { + display: none; + } + } + .TermPage { + .nav-tabs-container { + display: flex; + justify-content: center; + .nav-link { + .active { + color: #495057; + background-color: #fff; + border-color: #dee2e6 #dee2e6 #fff; + } + } + } + .pages-content { + width: 100%; + + // margin-top: 2em; + padding: 0; + // height: calc(100dvh - 2em); + + } + } + } + @import "./responsive/responsive"; +} diff --git a/assets/research/scss/responsive/max_width/399/chat-list.scss b/assets/research/scss/responsive/max_width/399/chat-list.scss new file mode 100644 index 0000000..e69de29 diff --git a/assets/research/scss/responsive/max_width/991/_group.scss b/assets/research/scss/responsive/max_width/991/_group.scss new file mode 100644 index 0000000..b96d3cd --- /dev/null +++ b/assets/research/scss/responsive/max_width/991/_group.scss @@ -0,0 +1,130 @@ +.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/research/scss/responsive/max_width/991/_replays.scss b/assets/research/scss/responsive/max_width/991/_replays.scss new file mode 100644 index 0000000..54cac9d --- /dev/null +++ b/assets/research/scss/responsive/max_width/991/_replays.scss @@ -0,0 +1,40 @@ +#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/research/scss/responsive/max_width/991/_the-footer.scss b/assets/research/scss/responsive/max_width/991/_the-footer.scss new file mode 100644 index 0000000..2204fde --- /dev/null +++ b/assets/research/scss/responsive/max_width/991/_the-footer.scss @@ -0,0 +1,78 @@ +.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/research/scss/responsive/max_width/991/chat-list.scss b/assets/research/scss/responsive/max_width/991/chat-list.scss new file mode 100644 index 0000000..001af77 --- /dev/null +++ b/assets/research/scss/responsive/max_width/991/chat-list.scss @@ -0,0 +1,126 @@ +.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/research/scss/responsive/max_width/max_width.scss b/assets/research/scss/responsive/max_width/max_width.scss new file mode 100644 index 0000000..eab4adb --- /dev/null +++ b/assets/research/scss/responsive/max_width/max_width.scss @@ -0,0 +1,130 @@ +// 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 - 13em); + } + .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; + right: 0; + margin-right: var(--sidebar-collapsed-width); + background: #fff; + justify-content: center; + box-shadow: -1px 0px 7px 1px #eee; + + .main-filter { + display: block; + } + } + } + + } + + // @import "./991/group"; + // @import "./991/the-footer"; + // @import "./991/chat-list.scss"; + // @import "./991/replays"; + // @import "./991/_sub_header_991"; + // @import "./991/my_table_991"; +} + +// 767px +@media screen and (max-width: 47.938em) { + .main-page__content { + .search-items { + height: calc(100vh - 15em); + } + + + } + // @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) { + .main-page__content { + .search-items { + height: calc(100vh - 15em); + } + + + } + + // @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"; +} + +// 399px +@media screen and (max-width: 24.938em) { + .main-page__content { + .search-items { + height: calc(100vh - 15em); + } + + + } + // @import "./399/chat-list.scss"; + // @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/research/scss/responsive/min_width/400/_group.scss b/assets/research/scss/responsive/min_width/400/_group.scss new file mode 100644 index 0000000..72cc0c5 --- /dev/null +++ b/assets/research/scss/responsive/min_width/400/_group.scss @@ -0,0 +1,78 @@ +.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/research/scss/responsive/min_width/576/_group.scss b/assets/research/scss/responsive/min_width/576/_group.scss new file mode 100644 index 0000000..548c4c6 --- /dev/null +++ b/assets/research/scss/responsive/min_width/576/_group.scss @@ -0,0 +1,80 @@ +.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/research/scss/responsive/min_width/768/_group.scss b/assets/research/scss/responsive/min_width/768/_group.scss new file mode 100644 index 0000000..a54f04c --- /dev/null +++ b/assets/research/scss/responsive/min_width/768/_group.scss @@ -0,0 +1,81 @@ +.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/research/scss/responsive/min_width/992/_group.scss b/assets/research/scss/responsive/min_width/992/_group.scss new file mode 100644 index 0000000..1c16246 --- /dev/null +++ b/assets/research/scss/responsive/min_width/992/_group.scss @@ -0,0 +1,81 @@ +.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/research/scss/responsive/min_width/992/_the-footer.scss b/assets/research/scss/responsive/min_width/992/_the-footer.scss new file mode 100644 index 0000000..109b6ef --- /dev/null +++ b/assets/research/scss/responsive/min_width/992/_the-footer.scss @@ -0,0 +1,3 @@ +.mobile-footer { + display: none; +} \ No newline at end of file diff --git a/assets/research/scss/responsive/min_width/min-width.scss b/assets/research/scss/responsive/min_width/min-width.scss new file mode 100644 index 0000000..532ffdf --- /dev/null +++ b/assets/research/scss/responsive/min_width/min-width.scss @@ -0,0 +1,45 @@ +// 200px +@media screen and (min-width: 200px) { + // @import "./200/main_200"; +} + +//400px + +@media screen and (min-width: 24.938em) { + // @import "./400/group"; + // @import "./399/sub_header_399"; + // @import "./399/the_navbar_399"; +} +// 576px +@media screen and (min-width: 36em) { + // @import "./576/group"; + // @import "./576/sub_header_576"; + // @import "./576/my_table_576"; +} +// 768px +@media screen and (min-width: 48em) { + // @import "./768/group"; + // @import "./576/sub_header_576"; + // @import "./576/my_table_576"; +} +// 992px +@media screen and (min-width: 62em) { + // @import "./992/group"; + // @import "./992/the-footer"; + // @import "./992/sub_header_992"; +} + +// 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/research/scss/responsive/responsive.scss b/assets/research/scss/responsive/responsive.scss new file mode 100644 index 0000000..71295ae --- /dev/null +++ b/assets/research/scss/responsive/responsive.scss @@ -0,0 +1,11 @@ +// 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"; diff --git a/components/research/components/AdvancedSearch.vue b/components/research/components/AdvancedSearch.vue new file mode 100644 index 0000000..60166a0 --- /dev/null +++ b/components/research/components/AdvancedSearch.vue @@ -0,0 +1,178 @@ + + + diff --git a/components/research/components/FormAddChildrenToTree.vue b/components/research/components/FormAddChildrenToTree.vue new file mode 100644 index 0000000..fb24f4a --- /dev/null +++ b/components/research/components/FormAddChildrenToTree.vue @@ -0,0 +1,76 @@ + + + diff --git a/components/research/components/FormAddToTree.vue b/components/research/components/FormAddToTree.vue new file mode 100644 index 0000000..6bc8b52 --- /dev/null +++ b/components/research/components/FormAddToTree.vue @@ -0,0 +1,74 @@ + + + diff --git a/components/research/components/FormEditToTree.vue b/components/research/components/FormEditToTree.vue new file mode 100644 index 0000000..6a75ae8 --- /dev/null +++ b/components/research/components/FormEditToTree.vue @@ -0,0 +1,78 @@ + + + diff --git a/components/research/components/FormForAdd.vue b/components/research/components/FormForAdd.vue new file mode 100644 index 0000000..8eb1f7b --- /dev/null +++ b/components/research/components/FormForAdd.vue @@ -0,0 +1,169 @@ + + + diff --git a/components/research/components/FormForDelete.vue b/components/research/components/FormForDelete.vue new file mode 100644 index 0000000..436d27a --- /dev/null +++ b/components/research/components/FormForDelete.vue @@ -0,0 +1,94 @@ + + + diff --git a/components/research/components/MainContent.vue b/components/research/components/MainContent.vue new file mode 100644 index 0000000..da853fe --- /dev/null +++ b/components/research/components/MainContent.vue @@ -0,0 +1,290 @@ + + + + diff --git a/components/research/components/ProcessologyPage.vue b/components/research/components/ProcessologyPage.vue new file mode 100644 index 0000000..13b53ca --- /dev/null +++ b/components/research/components/ProcessologyPage.vue @@ -0,0 +1,29 @@ + + + diff --git a/components/research/components/ResearchContent.vue b/components/research/components/ResearchContent.vue new file mode 100644 index 0000000..3220a29 --- /dev/null +++ b/components/research/components/ResearchContent.vue @@ -0,0 +1,843 @@ + + + + + diff --git a/components/research/components/ResearchContentForTerm.vue b/components/research/components/ResearchContentForTerm.vue new file mode 100644 index 0000000..98f1840 --- /dev/null +++ b/components/research/components/ResearchContentForTerm.vue @@ -0,0 +1,749 @@ + + + + + diff --git a/components/research/components/ResearchFilterList.vue b/components/research/components/ResearchFilterList.vue new file mode 100644 index 0000000..34899b7 --- /dev/null +++ b/components/research/components/ResearchFilterList.vue @@ -0,0 +1,677 @@ + + + + + + + diff --git a/components/research/components/ResearchFishModal.vue b/components/research/components/ResearchFishModal.vue new file mode 100644 index 0000000..02a33da --- /dev/null +++ b/components/research/components/ResearchFishModal.vue @@ -0,0 +1,448 @@ + + + diff --git a/components/research/components/ResearchTreeList.vue b/components/research/components/ResearchTreeList.vue new file mode 100644 index 0000000..6fe645f --- /dev/null +++ b/components/research/components/ResearchTreeList.vue @@ -0,0 +1,647 @@ + + + + + + + diff --git a/components/research/components/RightPanel.vue b/components/research/components/RightPanel.vue new file mode 100644 index 0000000..30018a4 --- /dev/null +++ b/components/research/components/RightPanel.vue @@ -0,0 +1,443 @@ + + + + + diff --git a/components/research/components/SubjectForm.vue b/components/research/components/SubjectForm.vue new file mode 100644 index 0000000..df29ef2 --- /dev/null +++ b/components/research/components/SubjectForm.vue @@ -0,0 +1,579 @@ + + + + + diff --git a/components/research/components/WikiPage.vue b/components/research/components/WikiPage.vue new file mode 100644 index 0000000..30d9806 --- /dev/null +++ b/components/research/components/WikiPage.vue @@ -0,0 +1,59 @@ + + + diff --git a/json/research/json/menu.json b/json/research/json/menu.json new file mode 100644 index 0000000..43a5bda --- /dev/null +++ b/json/research/json/menu.json @@ -0,0 +1,28 @@ +{ + "researches": [ + { + "icon": "Home-21", + "color": 1, + "link": "defaultRoute", + "actionMode": 1, + "title": "خانه", + "translateKey": "Home" + }, + { + "color": 1, + "icon": "reports", + "link": "myResearches", + "title": "تحقیقات", + "longTitle": "تحقیقات ", + "translateKey": "MyResearchs" + }, + { + "color": 1, + "icon": "Component-68--1", + "link": "TermPage", + "title": "اصطلاحات", + "longTitle": "اصطلاحات", + "translateKey": "TermPage" + } + ] +} \ No newline at end of file diff --git a/json/research/json/test.json b/json/research/json/test.json new file mode 100644 index 0000000..bb3a276 --- /dev/null +++ b/json/research/json/test.json @@ -0,0 +1,184 @@ +{ + "key": "sanad", + "label": "منابع", + "info": { + "title": "اسناد فرهنگستان", + "index_name": "sanad", + "meta": "[{\"title\":\"مشخصات اصلی\",\"items\":[{\"key\":\"title\",\"label\":\"عنوان\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"{3-100}\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 100 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"author\",\"label\":\"صاحب اثر\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"{3-100}\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 100 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"branch\",\"label\":\"دوره\",\"type\":\"string\",\"placeholder\":\"دوره را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"{3-100}\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 100 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"meet_no\",\"label\":\"شماره\",\"type\":\"number\",\"placeholder\":\"شماره جلسه را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"{1-11}\",\"validation_error\":\"خطا: شماره عدد و حداکثر تا 11 رقم می باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"format\",\"label\":\"نوع\",\"type\":\"select\",\"placeholder\":\"انتخاب کنید\",\"required\":\"1\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[{\"value\":\"جلسه علمی\",\"title\":\"جلسه علمی\"},{\"value\":\"سخنرانی\",\"title\":\"سخنرانی\"},{\"value\":\"منبر\",\"title\":\"منبر\"},{\"value\":\"کتاب\",\"title\":\"کتاب\"},{\"value\":\"مقاله\",\"title\":\"مقاله\"},{\"value\":\"سایر\",\"title\":\"سایر\"}]},{\"key\":\"begin_date\",\"label\":\"تاریخ\",\"type\":\"string\",\"placeholder\":\"مثل: 1401/2/2، پاییز1400، زمستان99\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"طبق قالب مثال تاریخ وارد کنید\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"مشخصات فرعی\",\"items\":[{\"key\":\"subtitle\",\"label\":\"عنوان موضوعی\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 100 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"link\",\"label\":\"پیوند\",\"type\":\"string\",\"placeholder\":\"پیوند اینترنتی را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 200 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"city\",\"label\":\"شهر\",\"type\":\"string\",\"placeholder\":\"شهر را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 100 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"place\",\"label\":\"مکان\",\"type\":\"string\",\"placeholder\":\"مکان را بنویسید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"عبارت باید حداقل 3 و حداکثر 100 حرف باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"address\",\"label\":\"نشانی\",\"type\":\"string\",\"placeholder\":\"نشانی را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"end_date\",\"label\":\"تاریخ پایان\",\"type\":\"string\",\"placeholder\":\"مثل: 1401/2/2، پاییز1400، زمستان99\",\"required\":\"0\",\"validation_regex\":\".*\",\"validation_error\":\"طبق قالب مثال تاریخ وارد کنید\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"اطلاعات جلسه\",\"items\":[{\"key\":\"audience\",\"label\":\"نوع مخاطب\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"ralation\",\"label\":\"مناسبت\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"attendees\",\"label\":\"حاضرین\",\"type\":\"string\",\"placeholder\":\"عناوین را با ، جدا کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"چند رسانه\",\"items\":[{\"key\":\"photo_links\",\"label\":\"تصاویر\",\"type\":\"img\",\"placeholder\":\"انتخاب کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"sound_links\",\"label\":\"صوت\",\"type\":\"sound\",\"placeholder\":\"انتخاب کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"video_links\",\"label\":\"فیلم\",\"type\":\"video\",\"placeholder\":\"انتخاب کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"کدها\",\"items\":[{\"key\":\"meet_code\",\"label\":\"کدجلسه\",\"type\":\"number\",\"placeholder\":\"کد عددی را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"\",\"validation_error\":\"خطا: شماره عدد و حداکثر تا 11 رقم می باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"person_code\",\"label\":\"کدشخص\",\"type\":\"number\",\"placeholder\":\"کد عددی را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"\",\"validation_error\":\"خطا: شماره عدد و حداکثر تا 11 رقم می باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"research_code\",\"label\":\"کدپژوهش\",\"type\":\"number\",\"placeholder\":\"کد عددی را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"\",\"validation_error\":\"خطا: شماره عدد و حداکثر تا 11 رقم می باشد\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"meet_lid\",\"label\":\"کد1\",\"type\":\"number\",\"placeholder\":\"کد عددی را وارد کنید\",\"required\":\"1\",\"validation_regex\":\"\",\"validation_error\":\"خطا: شماره عدد و حداکثر تا 11 رقم می باشد\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"خلاصه\",\"items\":[{\"key\":\"verb\",\"label\":\"فعل\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"keywords\",\"label\":\"واژگان کلیدی\",\"type\":\"string\",\"placeholder\":\"عناوین را با ، جدا کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"mintro\",\"label\":\"چکیده\",\"type\":\"textarea\",\"placeholder\":\"متن را اینجا بنویسید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"فهرست\",\"items\":[{\"key\":\"mindex\",\"label\":\"فهرست\",\"type\":\"textarea\",\"placeholder\":\"هر عنوان را با خط جدید جدا کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"amplify\",\"label\":\"شرح\",\"type\":\"textarea\",\"placeholder\":\"شما شروع کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"متن 1\",\"items\":[{\"key\":\"sanad_type1\",\"label\":\"نوع\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]},{\"key\":\"content\",\"label\":\"متن\",\"type\":\"textarea\",\"placeholder\":\"چیزی نیست!!!\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]}]},{\"title\":\"متن 2\",\"items\":[{\"key\":\"sanad_type2\",\"label\":\"نوع\",\"type\":\"string\",\"placeholder\":\"عنوان را وارد کنید\",\"required\":\"0\",\"validation_regex\":\"\",\"validation_error\":\"\",\"multi_select\":\"0\",\"options\":[]}]}]", + "table_columns": "[{\"key\":\"title\",\"title\":\"عنوان\",\"width\":\"2\"},{\"key\":\"meet_no\",\"title\":\"شماره\",\"width\":\"1\"},{\"key\":\"meet_code\",\"title\":\"کد جلسه\",\"width\":\"1\"},{\"key\":\"voices\",\"title\":\"صوت\",\"width\":\"1\"},{\"key\":\"format\",\"title\":\"نوع\",\"width\":\"1\"},{\"key\":\"subtitle\",\"title\":\"عنوان محتوایی\",\"width\":\"3\"}]", + "table_columns_subject": "[{\"key\":\"title\",\"title\":\"عنوان\",\"width\":\"2\"},{\"key\":\"meet_no\",\"title\":\"شماره\",\"width\":\"1\"},{\"key\":\"meet_code\",\"title\":\"کد جلسه\",\"width\":\"1\"},{\"key\":\"voices\",\"title\":\"صوت\",\"width\":\"1\"},{\"key\":\"format\",\"title\":\"نوع\",\"width\":\"1\"},{\"key\":\"subject_order\",\"title\":\"ترتیب\",\"width\":\"1\"},{\"key\":\"amplify\",\"title\":\"توضیحات\",\"width\":\"3\"}]", + "entity_view": "{\"top_main\":[{\"title\":\"عنوان:\",\"key\":\"title\",\"type\":\"string\"},{\"title\":\"دوره:\",\"key\":\"branch\",\"type\":\"string\"}],\"top_jump\":{\"type\":\"nextprev\",\"title\":\"جلسه\",\"key\":\"meet_no\"},\"top_mirror\":[{\"title\":\"صاحب اثر:\",\"key\":\"author\",\"type\":\"string\"},{\"title\":\"تاریخ:\",\"key\":\"begin_date\",\"type\":\"date\"},{\"title\":\"کد:\",\"key\":\"meet_lid\",\"type\":\"string\"},{\"title\":\"نوع:\",\"key\":\"format\",\"type\":\"string\"}],\"panel_heading\":{\"title\":\"فهرست عناوین\"\"key\":\"mindex\"},\"panel_navigate\":{\"title\":\"فهرست پیمایش\"\"key\":\"title\"},\"panle_base\":[{\"title\":\"متن اصلی\",\"key\":\"content\",\"type\":\"text\"},{\"title\":\"صوت جلسه\",\"key\":\"sound_links\",\"type\":\"audio\"},{\"title\":\"فیلم جلسه\",\"key\":\"video_links\",\"type\":\"video\"}]}", + "lists": [ + { + "items": "author,branch,subject", + "title": "فهرست دوره ای مولفین" + }, + { + "items": "author,subject,subject", + "title": "فهرست موضوعی مولفین" + }, + { + "items": "subject,author,subject", + "title": "فهرست موضوعی" + } + ], + "items": [ + { + "name": "author", + "title": "مولف" + }, + { + "name": "branch", + "title": "دوره" + }, + { + "name": "subject", + "title": "موضوع" + }, + { + "name": "format", + "title": "نوع" + }, + { + "name": "begin_date", + "title": "تاریخ شروع" + }, + { + "name": "end_date", + "title": "تاریخ پایان" + }, + { + "name": "subtitle", + "title": "عنوان محتوایی" + }, + { + "name": "voices", + "title": "تعداد صوت" + }, + { + "name": "title", + "title": "عنوان جلسه" + }, + { + "name": "person_code", + "title": "کدشخص" + }, + { + "name": "research_code", + "title": "کدپژوهش" + }, + { + "name": "meet_code", + "title": "کدجلسه" + }, + { + "name": "meet_no", + "title": "شماره جلسه" + }, + { + "name": "films", + "title": "تعداد فیلم" + }, + { + "name": "photos", + "title": "تعداد تصویر" + }, + { + "name": "keywords", + "title": "واژگان کلیدی" + }, + { + "name": "verb", + "title": "فعل" + }, + { + "name": "begin_year", + "title": "سال" + }, + { + "name": "ralation", + "title": "مناسبت" + }, + { + "name": "sanad_type1", + "title": "نوع متن اولیه" + }, + { + "name": "sanad_type2", + "title": "نوع متن ثانویه" + }, + { + "name": "place", + "title": "مکان" + }, + { + "name": "city", + "title": "شهر" + }, + { + "name": "report_tmp.address", + "title": "نشانی دارد؟" + }, + { + "name": "report_tmp.mindex", + "title": "فهرست دارد؟" + }, + { + "name": "report_tmp.mintro", + "title": "خلاصه دارد؟" + } + ] + }, + "filter": [ + { + "title": "صاحب اثر", + "filter_key": "f_au", + "source_key": "author", + "by_more": 1 + }, + { + "title": "دوره‌ها", + "filter_key": "f_br", + "source_key": "branch", + "by_more": 1 + }, + { + "title": "نوع سند", + "filter_key": "f_fo", + "source_key": "format", + "by_more": 0 + }, + { + "title": "سال", + "filter_key": "f_ye", + "source_key": "begin_year", + "by_more": 1 + }, + { + "title": "واژگان کلیدی", + "filter_key": "f_tg", + "source_key": "tags", + "by_more": 1 + } + ], + "items": [ + { + "key": "subject-jahat", + "id": 1, + "label": "فیش", + "field_collapsed": "normal" + }, + { + "key": "subject-monir", + "id": 2, + "label": "جمع بندی", + "field_collapsed": "normal" + }, + { + "key": "subject-monir2", + "id": 3, + "label": "روند", + "field_collapsed": "normal" + } + ] +} \ No newline at end of file diff --git a/mixins/research/searchLineMixin.js b/mixins/research/searchLineMixin.js new file mode 100644 index 0000000..0314f80 --- /dev/null +++ b/mixins/research/searchLineMixin.js @@ -0,0 +1,50 @@ +const HISTORY_SEARCH_RECENT = "historysearchrecent"; + +export default { + mounted() { + if (window.localStorage.getItem([HISTORY_SEARCH_RECENT])) { + try { + this.historySearch = JSON.parse( + window.localStorage.getItem([HISTORY_SEARCH_RECENT]) + ); + } catch (e) { + window.localStorage.removeItem([HISTORY_SEARCH_RECENT]); + } + } + }, + methods: { + initText(item) { + this.textSearch = item; + }, + + getHighlight(item) { + var find = this.textSearch; + var text = item.replaceAll(find, "" + find + ""); + return text; + }, + selectHistorySearch(item) { + this.textSearch = item; + this.searchStart(this.textSearch); + }, + addHistorySearch(newSearch = "") { + if (newSearch == "") { + return; + } + var index = this.historySearch.indexOf(newSearch); + if (index != -1) { + this.historySearch.splice(index, 1); + } + + this.historySearch.unshift(newSearch); + this.saveHistorySearch(); + }, + removeHistorySearch(x) { + this.historySearch.splice(x, 1); + this.saveHistorySearch(); + }, + saveHistorySearch() { + const parsed = JSON.stringify(this.historySearch); + window.localStorage.setItem([HISTORY_SEARCH_RECENT], parsed); + }, + }, +}; diff --git a/mixins/research/selectTextMixin.js b/mixins/research/selectTextMixin.js new file mode 100644 index 0000000..9195c74 --- /dev/null +++ b/mixins/research/selectTextMixin.js @@ -0,0 +1,441 @@ +import apis from "~/apis/tahrirApi"; +// import tinyTahrir from "assets/tahrir/vendors/tinymce-files/tinytahrir"; + +export default { + created() { + this.httpService = useNuxtApp()["$http"]; + }, + // beforeMount() { + // this.commentHttpService = new HttpService( + // import.meta.env.VITE_TAHRIR_BASE_URL + // ); + // }, + destroyed() { + // window.removeEventListener("scroll", this.handleScroll); + }, + + data() { + return { + id: "", + + comments: [], + newComment: false, + selectedText: null, + globalGuid: undefined, + paragraphId: undefined, + paragraphParentId: undefined, + commentHttpService: undefined, + }; + }, + methods: { + /* + open comment form when user select a text + */ + onMouseUp($event) { + // Get selected text and encode it + const selection = encodeURIComponent( + this.getSelected().toString() + ).replace(/[!'()*]/g); + + if (selection) { + this.selectedText = selection; + + this.setParagraphId($event); + // this.createPopup($event); + this.saveSelectedTextComment($event); + } + }, + /* + extract user selected text + */ + getSelected() { + if (window.getSelection) { + return window.getSelection(); + } else if (document.getSelection) { + return document.getSelection(); + } else { + var selection = document.selection && document.selection.createRange(); + if (selection.text) { + return selection.text; + } + return false; + } + }, + setParagraphId(ev) { + this.paragraphId = ev.target.id; + this.paragraphParentId = ev.target.parentNode?.id; + }, + /* + create comment popup and place it on top fo the selected text; + */ + createPopup(event) { + // this.openCommentForm(); + // Get cursor position + // const posX = event.clientX - 130; + // const posY = event.clientY - 200; + // const posX = event.clientX; + // const posY = event.clientY; + // try { + // this.$refs.popupMenu.$el.style.top = posY + "px"; + // this.$refs.popupMenu.$el.style.left = posX + "px"; + // this.$refs.popupMenu.$el.style.opacity = 1; + // } + // catch(err) { + // setTimeout(() => { + // this.$refs.popupMenu.$el.style.top = posY + "px"; + // this.$refs.popupMenu.$el.style.left = posX + "px"; + // this.$refs.popupMenu.$el.style.opacity = 1; + // }, 700); + // } + }, + openCommentForm() { + this.newComment = true; + }, + + /* + summary: save selected text + + description: replace selected text with the new span.tcomment tag and then save it. + send a new request to api for saving the comment. + then update/replace paragraph content with newely created content. + then crawle all paragraphs for .tcomment ids. + then request api for paragraphs comments. + + @fires when user clicked on comment popup save button. + @param {userComment} Html user comment. + @return void. + */ + saveSelectedTextComment(userComment) { + const url = tahrirUrl()+ apis.comments.addCommentToSelectedParag; + const replacedContent = this.replaceSelectedText(); + + const payload = { + content: replacedContent, + guid: this.paragraphId, + }; + + this.commentHttpService + .formDataRequest(url, payload) + .then((res) => { + this.newComment = false; + + this.addComment( + { + text: userComment, + pid: this.globalGuid, + }, + replacedContent + ); + }) + .catch((err) => { + mySwalToast({ + html: err?.message, + }); + }) + .finally(() => (this.loading = false)); + }, + /* + summary: save comment + + description: + send a new request to api for saving the comment. + then update/replace paragraph content with newely created content. + then crawle all paragraphs for .tcomment ids. + then request api for paragraphs comments. + + @fires when saveSelectedTextComment method completed... + + @param {text} String user comment. + @param {pid} String globalGuid. + @param {replacedContent} Html user comment. + + @return void. + */ + addComment({ text, pid }, replacedContent) { + const payload = { text: JSON.stringify(text) }; + const url = tahrirUrl()+ apis.comments.add + "/" + pid; + + this.commentHttpService.formDataRequest(url, payload).then((res) => { + this.updateParagraphContentProperty(replacedContent); + + this.crawlParagsForCommentId(this.localParagraphs).then((guidList) => { + this.getComments(guidList); + }); + + mySwalToast({ + html: res.message, + }); + }); + }, + /* + summary: update paragraph content property + + description: update paragraph old content property with updated content. + + @fires when addComment method completed... + + @param {replacedContent} Html user comment. + + @return void. + */ + updateParagraphContentProperty(replacedContent) { + this.localParagraphs.forEach((pars) => { + if (pars.id == this.paragraphParentId.slice(7)) + pars.content = replacedContent; + }); + }, + + /* + summary: update new comment form position + + description: update position of new comment form when scrolling. + + @fires when user scroll + + @param {event} event window scroll event. + + @return void. + */ + updateCommentFormTopPosition(event) { + // Find out how much (if any) user has scrolled + var scrollTop = + window.screenY !== undefined + ? window.screenY + : ( + document.documentElement || + document.body.parentNode || + document.body + ).scrollTop; + + const posY = event.clientY - 200 + scrollTop; + this.$refs.popupMenu._vnode.elm.style.top = posY + "px"; + }, + + /* + summary: comment list + description: getting list of comments from the api. + + @fires after page crawl for tcomment complete. + + @param {array} guidList paragraph's comment ids. + + @return void. + */ + + getComments(guidList) { + const payload = { + pids: guidList, + }; + + this.commentHttpService + .formDataRequest(tahrirUrl()+apis.comments.documentComment, payload) + .then((res) => { + if (res.data) this.attachCommentsToParags(res.data); + }); + }, + /* + summary: attach comments to paragraphs object + description: loop over paragraphs and find paragraphs that + its content property math the comment id catched from the api. + + @fires after getComment method called. + + @param {object} + + @return void. + */ + attachCommentsToParags(comments) { + try { + this.localParagraphs.forEach((parag) => { + const commentList = []; + + Object.keys(comments).forEach((value) => { + if (parag.content.includes(value)) + commentList.push(comments[value]); + }); + this.$set(parag, "comments", commentList); + }); + } catch (err) { + this.comments = comments; + } + + this.fetchingData = false; + }, + + /* + summary: replace selected text with new span. + description: find the parent paragraph with its refs and + then replace the selected text with new span. + + @fires when saveSelectedTextComment method called. + + @return Html. + */ + replaceSelectedText() { + const text = decodeURIComponent(this.selectedText); + this.globalGuid = this.newGuid(); + const replacementTag = `${text} ORG×`; + const refContent = this.$refs[this.paragraphParentId]; + refContent.innerHTML = refContent.innerHTML.replace(text, replacementTag); + + return refContent.innerHTML; + }, + + closeCommentForm() { + this.newComment = false; + }, + + /* + summary: crawl paragraphs for .tcomment. + description: crawl paragraph fot .tcomment tags and getting its id. + + @fires when addComment method called. + + @return Html. + */ + async crawlParagsForCommentId(pars) { + return await pars + .map((par) => { + if (par?.content.includes("tcomment")) + return this.geCommenttIds(par.content); + }) + .filter((item) => item) + .join(","); + }, + + /* + summary: create unique id. + + @fires when crawlParagsForCommentId method called. + + @return string. + */ + newGuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace( + /[xy]/g, + function (c) { + var r = (Math.random() * 16) | 0, + v = c == "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + } + ); + }, + + /* + summary: separate spans id property.. + + @fires when crawlParagsForCommentId method called. + + @return string. + */ + + geCommenttIds(content) { + var ids = ""; + var regex = + /\/g; + var m = regex.exec(content); + while (m !== null) { + if (m.index === regex.lastIndex) { + regex.lastIndex++; + } + if (ids != "") ids += ","; + ids += m[1]; + m = regex.exec(content); + } + + return ids; + }, + + handleScroll(event) { + // Any code to be executed when the window is scrolled + }, + + /* + summary: hide/show other paragraphs comments. + description: when user clicked on comment, hide other + comments and add active class to .tcomment tag in the paragraph + + @fires when user open/close the comments. + + @param {object} paragraph + @param {Number} commentIndex + + @return void. + */ + + hideOtherComments({ paragraph, commentIndex }) { + const _this = this; + + _this.localParagraphs.forEach((par) => { + // parse other paragraphs + if (par.id != paragraph.id) { + if (par.comments?.length) { + par.comments.forEach((com, index) => { + const res = com.isShow == undefined ? false : !com.isShow; + _this.$set(par.comments[index], "isShow", res); + }); + } + } + // parse selected paragraph + else { + if (par.comments?.length) { + par.comments.forEach((com, index) => { + // hide sibling comments in the active paragraph. + if (index != commentIndex) { + const res = com.isShow == undefined ? false : !com.isShow; + _this.$set(par.comments[index], "isShow", res); + } + // toggle paragraph .tcomment class + else { + Array.from( + _this.$refs["parent-" + par.id][0].children[0].children + ).forEach((child) => { + if (child.id == com[0].pid) { + child.classList.toggle("active"); + } + }); + } + }); + } + } + }); + }, + + removSpan(comment) { + const spanTag = document.getElementsById(comment.pid); + const rawText = spanTag.innerHTML; + + this.paragraph.content = this.paragraph.content.replace(spanTag, rawText); + return this.paragraph.content; + }, + + saveChangeSelectedTextComment(userComment) { + const url = apis.comments.addCommentToSelectedParag; + const replacedContent = this.removSpan(); + + const payload = { + content: replacedContent, + guid: this.paragraphId, + }; + + ApiService.formData(url, payload) + .then((res) => { + this.newComment = false; + + this.addComment( + { + text: userComment, + pid: this.globalGuid, + }, + replacedContent + ); + }) + .catch((err) => { + mySwalToast({ + html: err?.message, + }); + }) + .finally(() => (this.loading = false)); + }, + }, +}; diff --git a/pages/Research.vue b/pages/Research.vue new file mode 100644 index 0000000..b3da65e --- /dev/null +++ b/pages/Research.vue @@ -0,0 +1,1018 @@ + + + + diff --git a/pages/TermPage.vue b/pages/TermPage.vue new file mode 100644 index 0000000..90b30d8 --- /dev/null +++ b/pages/TermPage.vue @@ -0,0 +1,421 @@ + + + + diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 0000000..c2efd33 --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,1176 @@ + + + + + diff --git a/stores/researchStore.ts b/stores/researchStore.ts new file mode 100644 index 0000000..f75abc1 --- /dev/null +++ b/stores/researchStore.ts @@ -0,0 +1,116 @@ +import type { + domain, + researchActiveSchema, + researchTerms, + searchActiveTab, + selectionFilterItems, +} from "~/types/researchTypes"; +import { defineStore } from "pinia"; + +export const useResearchStore = defineStore("researchStore", { + persist: { + storage: piniaPluginPersistedstate.localStorage(), + + }, state: () => ({ + researchActiveSchema: [] as researchActiveSchema[], + researchSchema: [] as researchActiveSchema[], + researchDomainActive: {} as domain, + searchActiveTab: undefined as searchActiveTab | undefined, + selectionFilterItems: [] as selectionFilterItems, + researchTerms: undefined as researchTerms | undefined, + // dataForTreeMap: undefined, + // activeTab: undefined, + // navigateListActiveTab: undefined, + // navigateListSchema: undefined, + // activeNavigateListSchema: undefined, + // navigateChartActiveTab: undefined, + // navigateChartSchema: undefined, + // activeNavigateChartSchema: undefined, + }), + getters: { + researchSchemaGetter(state) { + return state.researchSchema; + }, + researchActiveSchemaGetter(state) { + return state.researchActiveSchema; + }, + researchDomainActiveGetter(state) { + return state.researchDomainActive; + }, + searchActiveTabGetter(state) { + return state.searchActiveTab; + }, + selectionFilterItemsGetter(state) { + return state.selectionFilterItems; + }, + researchTermsGetter(state) { + return state.researchTerms; + }, + // dataForTreeMapGetter(state) { + // return state.dataForTreeMap; + // }, + // activeTabGetter(state) { + // return state.activeTab; + // }, + // navigateListActiveTabGetter(state) { + // return state.activeTab; + // }, + // navigateListSchemaGetter(state) { + // return state.navigateListSchema; + // }, + // activeNavigateListSchemaGetter(state) { + // return state.activeNavigateListSchema; + // }, + // activeTabGetter(state) { + // return state.activeTab; + // }, + // navigateChartSchemaGetter(state) { + // return state.navigateChartSchema; + // }, + // activeNavigateChartSchemaGetter(state) { + // return state.activeNavigateChartSchema; + // }, + }, + actions: { + researchTermsSetter( researchTerms = undefined) { + this.researchTerms = researchTerms; + }, + + researchSchemaSetter( researchSchema = undefined) { + this.researchSchema = researchSchema; + }, + + researchActiveSchemaSetter( researchActiveSchema = undefined) { + this.researchActiveSchema = researchActiveSchema; + }, + researchDomainActiveSetter(domain:domain) { + this.researchDomainActive = domain; + }, + searchActiveTabSetter( searchActiveTab = undefined) { + this.searchActiveTab = searchActiveTab; + }, + selectionFilterItemsSetter( selectionFilterItems: selectionFilterItems = []) { + this.selectionFilterItems = selectionFilterItems; + }, + // dataForTreeMapSetter(state, dataForTreeMap = undefined) { + // state.dataForTreeMap = dataForTreeMap; + // }, + // activeTabSetter(state, activeTab = undefined) { + // state.activeTab = activeTab; + // }, + // navigateChartActiveTabSetter(state, navigateChartActiveTab = undefined) { + // state.navigateChartActiveTab = navigateChartActiveTab; + // }, + // navigateChartSchemaSetter(state, navigateChartSchema = undefined) { + // state.navigateChartSchema = navigateChartSchema; + // }, + // activeNavigateChartSchemaSetter( + // state, + // activeNavigateChartSchema = undefined + // ) { + // state.activeNavigateChartSchema = activeNavigateChartSchema; + // }, + + + }, +}); diff --git a/types/researchTypes.ts b/types/researchTypes.ts new file mode 100644 index 0000000..9e70ea1 --- /dev/null +++ b/types/researchTypes.ts @@ -0,0 +1,307 @@ +export type researchTerms = { + id: number; + created_at: number; + updated_at: number; + type: number; + title: string; + color: number; + meta: string; + guid: string; + owner: number; + comment: string; + ispublic: number; + stt: number; + project_version: number; + organ_code: number; + project_relations: null; + item_state: number; + table_columns: string; + tags: string; + repo_index: number; +}; +export type options = [{ value: string; title: string }]; +export type items_main = [ + { + key: string; + label: string; + type: string; + placeholder: string; + required: string; + classes: string; + inputClass: string; + multi_select: string; + options: options[]; + } +]; +export type items_more = [ + { + key: string; + label: string; + type: string; + placeholder: string; + required: number | string; + classes: string; + inputClass: string; + multi_select: number | string; + options: options[]; + } +]; +export type form = { + title: string; + key: string; + items_main: items_main[]; + items_more: items_more[]; +}; +export type contextMenu = [ + { key: string; title: string; icon: string; form: form } +]; +export type filter = [ + { title: string; filter_key: string; source_key: string; by_more: number } +]; +export type advance = [ + { + key: string; + label: string; + tag: string; + placeholder: string; + labelClass: string; + inputClass: string; + options: []; + } +]; +export type lists = [ + { + title: string; + list_key: string; + filter_key: string; + icon: string; + key: string; + number: number; + label: string; + type: string; + placeholder: string; + required: number | string; + classes: number | string; + multi_select: number | string; + url_GET: string; + } +]; +export type researchSchemaRes = { + status: number; + message: string; + postion: number; + meta: null; + data: { + dataset: researchActiveSchema[]; + }; +}; + +export type researchActiveSchema = { + key: string; + routeName: string; + searchContent: string; + label: string; + description: string; + contextMenu: contextMenu[]; + summary: null; + + filter: filter[]; + domain: { + tags: { عنوان: string; منبع: string; تاریخ: string }; + domain: domain; + }; + advance: advance[]; + lists: lists[]; + tabs: [ + { + title: string; + key: string; + url_GET: string; + } + ]; +}; +export type domain = { label: string; key: string }; + +export type table_actions = [ + { + icon: string; + title: string; + key: string; + "v-can": string; + type: string; + api_items: { + data_type: string; + ref_key: string; + id: string; + title: string; + }; + toggle_icons: { icon1: string; icon2: string }; + link_route: { id: string; name: string; key: string }; + } +]; +export type table_columns = [ + { + key: string; + title: string; + width: number | string; + textAlign: string; + isLink: boolean; + link_route: { id: string; name: string; key: string }; + trancate_word: 50; + } +]; + +export type domainActive = { + label: string; + tag: string; + key: string; + field_collapse: string; + table_actions: table_actions[]; + table_columns: table_columns[]; +}; +export type summary = { + title: string; + key: string; + options: [{ key: string; label: string; type: string }]; +}; +export type items = [ + { + key: string; + items: [ + { + key: string; + source_key: string; + label: string; + style: string; + hilight_key: string; + link_route: { id: string; name: string; key: string }; + } + ]; + } +]; +export type actions = [ + { + icon: string; + title: string; + key: string; + "v-can": string; + type: string; + api_items: { + data_type: string; + ref_key: string; + id: string; + title: string; + }; + toggle_icons: { + icon1: string; + icon2: string; + }; + link_route: { + id: string; + name: string; + key: string; + }; + } +]; +export type search_content = { + items: items[]; + actions: actions[]; +}; +export type searchActiveTab = { + key: string; + routeName: string; + searchContent: string; + label: string; + description: string; + showTableList: number; + summary: summary; + filter: filter[]; + domain: { + tags: { + قانون: string; + عنوان: string; + متن: string; + سال: string; + مقنن: string; + منبع: string; + مصوب: string; + تاریخ: string; + }; + domain: domainActive[]; + }; + advance: advance[]; + searchType: [ + { key: string; label: string }, + { + key: string; + description: string; + label: string; + }, + { + key: string; + description: string; + label: string; + }, + { + key: string; + description: string; + label: string; + item: { + label: string; + type: string; + component: string; + }; + }, + { + key: string; + description: string; + label: string; + } + ]; + search_content: search_content; + lists: lists[]; +}; +export type selectionFilterItems = []; +export type researchQuery = [ + { + _index: string; + _id: string; + _score: null; + _ignored: [string]; + _source: { + research_type: string; + research_key: string; + service: string; + ref_key: string; + ref_id: string; + text_position: string; + address: string; + date_create: number; + text_main: string; + username: string; + take_type: string; + text_user: string; + user_create: number; + title: null; + text_target: null; + text_subject: null; + text_verb: null; + subject_public: null; + subject_specific: null; + time_edit: number; + date_edit: string; + user_edit: number; + user: { + id: number; + user_id: number; + first_name: string; + last_name: string; + username: string; + full_name: string; + avatar: string; + color: string; + }; + }; + sort: [number]; + } +];