shared-ritm 1.2.17 → 1.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
package/src/App.vue CHANGED
@@ -1,7 +1,13 @@
1
1
  <template>
2
2
  <app-layout :logged="false">
3
- <template #header>
4
- <app-layout-header page-title="Проекты и рабочие задания" :user-data="userData" full-width auto-margin />
3
+ <template #header="{ style }">
4
+ <app-layout-header
5
+ :style="style"
6
+ page-title="Проекты и рабочие задания"
7
+ :user-data="userData"
8
+ full-width
9
+ auto-margin
10
+ />
5
11
  </template>
6
12
  <template #drawer>
7
13
  <app-sidebar :is-drawer="true" :menu-items="menuItems" :is-route-active="isRouteActive" />
@@ -1,67 +1,67 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
-
3
- import { Api_Project_Dto } from '@/api/types/Api_Projects'
4
-
5
- class ProjectsService extends ApiService {
6
- public async fetchProjectById(id: string): Promise<ResponseApi<Api_Project_Dto>> {
7
- return this.get(`/projects/${id}`)
8
- }
9
-
10
- public createProject(params: any): Promise<ResponseApi<any>> {
11
- return this.post<any, ResponseApi<any>>('/projects', params)
12
- }
13
-
14
- public editProject(id: string, params: any): Promise<ResponseApi<any>> {
15
- return this.put<any, ResponseApi<any>>(`/projects/${id}`, params)
16
- }
17
-
18
- public fetchProjects(params: any): Promise<ResponseApi<Api_Project_Dto[]>> {
19
- return this.get(`/get_list_project`, { params })
20
- }
21
-
22
- public cloneProject(project: any): Promise<ResponseApi<any>> {
23
- return this.post<any, ResponseApi<any>>(`projects/${project.id}/clone`, project)
24
- }
25
-
26
- public archiveProject(id: string, data: any): Promise<ResponseApi<any>> {
27
- return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
28
- }
29
-
30
- public unArchiveProject(id: string, data: any): Promise<ResponseApi<any>> {
31
- return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
32
- }
33
-
34
- public moveAprProject(id: string): Promise<ResponseApi<any>> {
35
- return this.post<any, ResponseApi<any>>('repairs/move_plan_to_real', {
36
- repairs: [id],
37
- })
38
- }
39
- public restoreProject(id: string): Promise<ResponseApi<any>> {
40
- return this.post<any, ResponseApi<any>>('/restore_project', { projects_ids: [id] })
41
- }
42
-
43
- public importTasks(payload: any): Promise<ResponseApi<any>> {
44
- return this.post<any, ResponseApi<any>>('tasks/import', payload)
45
- }
46
-
47
- public importKtd(payload: any): Promise<ResponseApi<any>> {
48
- return this.post<any, ResponseApi<any>>('/parse_ktd', payload, {
49
- headers: { 'Content-Type': 'multipart/form-data' },
50
- })
51
- }
52
-
53
- public fetchProjectTeamList(id: string): Promise<ResponseApi<any>> {
54
- return this.put<any, ResponseApi<any>>(`/projects/${id}`, null)
55
- }
56
-
57
- public deleteProject(id: string): Promise<any> {
58
- return this.delete<ResponseApi<any>>(`/projects/${id}`)
59
- }
60
- }
61
-
62
- let api: ProjectsService
63
-
64
- export default function useProjectsService() {
65
- if (!api) api = new ProjectsService()
66
- return api
67
- }
1
+ import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
+
3
+ import { Api_Project_Dto } from '@/api/types/Api_Projects'
4
+
5
+ class ProjectsService extends ApiService {
6
+ public async fetchProjectById(id: string): Promise<ResponseApi<Api_Project_Dto>> {
7
+ return this.get(`/projects/${id}`)
8
+ }
9
+
10
+ public createProject(params: any): Promise<ResponseApi<any>> {
11
+ return this.post<any, ResponseApi<any>>('/projects', params)
12
+ }
13
+
14
+ public editProject(id: string, params: any): Promise<ResponseApi<any>> {
15
+ return this.put<any, ResponseApi<any>>(`/projects/${id}`, params)
16
+ }
17
+
18
+ public fetchProjects(params: any): Promise<ResponseApi<Api_Project_Dto[]>> {
19
+ return this.get(`/search/projects`, { params })
20
+ }
21
+
22
+ public cloneProject(project: any): Promise<ResponseApi<any>> {
23
+ return this.post<any, ResponseApi<any>>(`projects/${project.id}/clone`, project)
24
+ }
25
+
26
+ public archiveProject(id: string, data: any): Promise<ResponseApi<any>> {
27
+ return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
28
+ }
29
+
30
+ public unArchiveProject(id: string, data: any): Promise<ResponseApi<any>> {
31
+ return this.put<any, ResponseApi<any>>(`/projects/${id}`, data)
32
+ }
33
+
34
+ public moveAprProject(id: string): Promise<ResponseApi<any>> {
35
+ return this.post<any, ResponseApi<any>>('repairs/move_plan_to_real', {
36
+ repairs: [id],
37
+ })
38
+ }
39
+ public restoreProject(id: string): Promise<ResponseApi<any>> {
40
+ return this.post<any, ResponseApi<any>>('/restore_project', { projects_ids: [id] })
41
+ }
42
+
43
+ public importTasks(payload: any): Promise<ResponseApi<any>> {
44
+ return this.post<any, ResponseApi<any>>('tasks/import', payload)
45
+ }
46
+
47
+ public importKtd(payload: any): Promise<ResponseApi<any>> {
48
+ return this.post<any, ResponseApi<any>>('/parse_ktd', payload, {
49
+ headers: { 'Content-Type': 'multipart/form-data' },
50
+ })
51
+ }
52
+
53
+ public fetchProjectTeamList(id: string): Promise<ResponseApi<any>> {
54
+ return this.put<any, ResponseApi<any>>(`/projects/${id}`, null)
55
+ }
56
+
57
+ public deleteProject(id: string): Promise<any> {
58
+ return this.delete<ResponseApi<any>>(`/projects/${id}`)
59
+ }
60
+ }
61
+
62
+ let api: ProjectsService
63
+
64
+ export default function useProjectsService() {
65
+ if (!api) api = new ProjectsService()
66
+ return api
67
+ }
@@ -4,18 +4,22 @@
4
4
  <app-loader :loading="logged" size="md" :thickness="3" :backdrop="true" />
5
5
  </div>
6
6
 
7
- <slot name="drawer"></slot>
8
- <slot name="header"></slot>
7
+ <slot name="drawer" />
8
+
9
+ <slot name="header" :style="marginLeft" />
10
+
9
11
  <q-page-container :class="{ container: container }" @wheel="mouseMove">
10
- <slot name="content"></slot>
12
+ <div :style="marginLeft">
13
+ <slot name="content" />
14
+ </div>
11
15
  </q-page-container>
12
16
 
13
- <slot name="footer"></slot>
17
+ <slot name="footer" />
14
18
  </q-layout>
15
19
  </template>
16
20
 
17
21
  <script lang="ts" setup>
18
- import { defineProps } from 'vue'
22
+ import { computed, defineProps, onBeforeUnmount, onMounted, ref } from 'vue'
19
23
  import AppLoader from '@/common/app-loader/index.vue'
20
24
  interface LayoutProps {
21
25
  logged: boolean
@@ -26,6 +30,8 @@ interface LayoutProps {
26
30
 
27
31
  const props = defineProps<LayoutProps>()
28
32
 
33
+ const hasPaddingLeft = ref(false)
34
+
29
35
  function mouseMove(e: any) {
30
36
  const content = document.getElementById('content')
31
37
  const scrollable = e.target
@@ -33,6 +39,27 @@ function mouseMove(e: any) {
33
39
  content.scrollBy({ top: e.deltaY })
34
40
  }
35
41
  }
42
+
43
+ const marginLeft = computed(() => {
44
+ return hasPaddingLeft.value ? { 'margin-left': '0px' } : { 'margin-left': '72px' }
45
+ })
46
+
47
+ function checkPaddingLeft() {
48
+ const el = document.querySelector('.q-page-container') as HTMLElement | null
49
+
50
+ if (el) {
51
+ const observer = new ResizeObserver(() => {
52
+ console.log(window.getComputedStyle(el).paddingLeft)
53
+ hasPaddingLeft.value = window.getComputedStyle(el).paddingLeft !== '0px'
54
+ })
55
+ observer.observe(el)
56
+ onBeforeUnmount(() => observer.disconnect())
57
+ }
58
+ }
59
+
60
+ onMounted(() => {
61
+ checkPaddingLeft()
62
+ })
36
63
  </script>
37
64
 
38
65
  <style lang="scss" module>
@@ -1,135 +1,108 @@
1
- <template>
2
- <q-header ref="myDiv" :style="marginLeft" :class="[$style.header, { [$style[`header-full`]]: fullWidth }]">
3
- <q-toolbar :class="$style.toolbar">
4
- <h1>{{ pageTitle }}</h1>
5
- <div :class="$style['action-buttons']">
6
- <app-button icon="person" text-color="black" :label="shortName" rounded :class="$style['button-person']" />
7
- </div>
8
- </q-toolbar>
9
- </q-header>
10
- </template>
11
-
12
- <script lang="ts" setup>
13
- import { computed, defineProps, withDefaults, onBeforeUnmount, onMounted, ref } from 'vue'
14
- import AppButton from '@/common/app-button/AppButton.vue'
15
- interface Props {
16
- userData: any
17
- fullWidth?: boolean
18
- autoMargin?: boolean
19
- pageTitle?: string
20
- leftMini?: string
21
- leftMax?: string
22
- }
23
-
24
- const props = withDefaults(defineProps<Props>(), {
25
- pageTitle: '',
26
- leftMini: '100px',
27
- leftMax: '30px',
28
- })
29
-
30
- const hasPaddingLeft = ref(false)
31
- // const counter = ref(1)
32
- const shortName = computed(
33
- () =>
34
- `${props.userData?.last_name} ${props.userData?.first_name?.[0]}. ${props.userData?.patronymic?.[0] || ''} ${
35
- props.userData?.patronymic?.[0] ? '.' : ''
36
- }`,
37
- )
38
-
39
- const marginLeft = computed(() => {
40
- if (!props.autoMargin) return {}
41
- return hasPaddingLeft.value ? { 'margin-left': props.leftMax } : { 'margin-left': props.leftMini }
42
- })
43
-
44
- function checkPaddingLeft() {
45
- const el = document.querySelector('.q-header') as HTMLElement | null
46
- if (el) {
47
- const observer = new ResizeObserver(() => {
48
- console.log(window.getComputedStyle(el).left)
49
- hasPaddingLeft.value = window.getComputedStyle(el).left !== '0px'
50
- })
51
- observer.observe(el)
52
- onBeforeUnmount(() => observer.disconnect())
53
- }
54
- }
55
-
56
- onMounted(() => {
57
- checkPaddingLeft()
58
- })
59
- </script>
60
-
61
- <style lang="scss" module>
62
- .header {
63
- height: 100px;
64
- background: transparent;
65
- margin: 0 auto;
66
- max-width: 1300px;
67
- }
68
- .header-full {
69
- max-width: 100%;
70
- padding-right: 20px;
71
- }
72
- .toolbar {
73
- padding: 0;
74
- min-height: 100%;
75
- h1 {
76
- font-weight: 600;
77
- font-size: 28px;
78
- line-height: 100%;
79
- font-family: Montserrat, sans-serif;
80
- }
81
- }
82
-
83
- .header-search {
84
- width: 412px;
85
- font-size: 16px;
86
- }
87
-
88
- .action-buttons {
89
- flex: 1;
90
- position: relative;
91
- display: flex;
92
- align-items: center;
93
- column-gap: 16px;
94
- justify-content: end;
95
- }
96
-
97
- .button {
98
- padding: 12px;
99
- background: white;
100
- transition: all 0.3s ease, color 0.3s ease;
101
- }
102
-
103
- .button-person {
104
- padding: 10px 14px;
105
- background: white;
106
- }
107
-
108
- @media (max-width: 1440px) {
109
- .header {
110
- height: 100px;
111
- background: transparent;
112
- margin: 0 auto;
113
- max-width: 874px;
114
- }
115
- .header-search {
116
- width: 343px;
117
- font-size: 16px;
118
- }
119
- .action-buttons {
120
- position: relative;
121
- display: flex;
122
- align-items: center;
123
- column-gap: 8px;
124
- }
125
- .button {
126
- padding: 10px;
127
- background: white;
128
- transition: all 0.3s ease, color 0.3s ease;
129
- }
130
- .button-person {
131
- padding: 8px 10px;
132
- background: white;
133
- }
134
- }
135
- </style>
1
+ <template>
2
+ <q-header :class="[$style.header, { [$style[`header-full`]]: fullWidth }]">
3
+ <q-toolbar :class="$style.toolbar">
4
+ <h1>{{ pageTitle }}</h1>
5
+ <div :class="$style['action-buttons']">
6
+ <app-button icon="person" text-color="black" :label="shortName" rounded :class="$style['button-person']" />
7
+ </div>
8
+ </q-toolbar>
9
+ </q-header>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import { computed, defineProps, withDefaults } from 'vue'
14
+ import AppButton from '@/common/app-button/AppButton.vue'
15
+ interface Props {
16
+ userData: any
17
+ fullWidth?: boolean
18
+ pageTitle?: string
19
+ }
20
+
21
+ const props = withDefaults(defineProps<Props>(), {
22
+ pageTitle: '',
23
+ })
24
+
25
+ const shortName = computed(
26
+ () =>
27
+ `${props.userData?.last_name} ${props.userData?.first_name?.[0]}. ${props.userData?.patronymic?.[0] || ''} ${
28
+ props.userData?.patronymic?.[0] ? '.' : ''
29
+ }`,
30
+ )
31
+ </script>
32
+
33
+ <style lang="scss" module>
34
+ .header {
35
+ height: 100px;
36
+ background: transparent;
37
+ margin: 0 auto;
38
+ max-width: 1300px;
39
+ }
40
+ .header-full {
41
+ max-width: 100%;
42
+ padding-right: 20px;
43
+ padding-left: 20px;
44
+ }
45
+ .toolbar {
46
+ padding: 0;
47
+ min-height: 100%;
48
+ h1 {
49
+ font-weight: 600;
50
+ font-size: 28px;
51
+ line-height: 100%;
52
+ font-family: Montserrat, sans-serif;
53
+ }
54
+ }
55
+
56
+ .header-search {
57
+ width: 412px;
58
+ font-size: 16px;
59
+ }
60
+
61
+ .action-buttons {
62
+ flex: 1;
63
+ position: relative;
64
+ display: flex;
65
+ align-items: center;
66
+ column-gap: 16px;
67
+ justify-content: end;
68
+ }
69
+
70
+ .button {
71
+ padding: 12px;
72
+ background: white;
73
+ transition: all 0.3s ease, color 0.3s ease;
74
+ }
75
+
76
+ .button-person {
77
+ padding: 10px 14px;
78
+ background: white;
79
+ }
80
+
81
+ @media (max-width: 1440px) {
82
+ .header {
83
+ height: 100px;
84
+ background: transparent;
85
+ margin: 0 auto;
86
+ max-width: 874px;
87
+ }
88
+ .header-search {
89
+ width: 343px;
90
+ font-size: 16px;
91
+ }
92
+ .action-buttons {
93
+ position: relative;
94
+ display: flex;
95
+ align-items: center;
96
+ column-gap: 8px;
97
+ }
98
+ .button {
99
+ padding: 10px;
100
+ background: white;
101
+ transition: all 0.3s ease, color 0.3s ease;
102
+ }
103
+ .button-person {
104
+ padding: 8px 10px;
105
+ background: white;
106
+ }
107
+ }
108
+ </style>
@@ -1,32 +1,15 @@
1
- <template>
2
- <q-page class="page-container" :style="marginLeft">
3
- <slot />
4
- </q-page>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { computed, onMounted, ref, onBeforeUnmount } from 'vue'
9
-
10
- const hasPaddingLeft = ref(false)
11
-
12
- const marginLeft = computed(() => {
13
- return hasPaddingLeft.value ? { 'margin-left': '0px' } : { 'margin-left': '72px' }
14
- })
15
-
16
- function checkPaddingLeft() {
17
- const el = document.querySelector('.q-page-container') as HTMLElement | null
18
- if (el) {
19
- const observer = new ResizeObserver(() => {
20
- hasPaddingLeft.value = window.getComputedStyle(el).paddingLeft !== '0px'
21
- })
22
- observer.observe(el)
23
- onBeforeUnmount(() => observer.disconnect())
24
- }
25
- }
26
-
27
- onMounted(() => {
28
- checkPaddingLeft()
29
- })
30
- </script>
31
-
32
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <q-page class="page-container">
3
+ <slot />
4
+ </q-page>
5
+ </template>
6
+
7
+ <script setup lang="ts"></script>
8
+
9
+ <style scoped lang="scss">
10
+ .page-container {
11
+ display: flex;
12
+ flex-direction: column;
13
+ padding: 0px 20px;
14
+ }
15
+ </style>
package/src/index.ts CHANGED
@@ -1,64 +1,64 @@
1
- import '@/shared/styles/general.css'
2
- import AppButton from '@/common/app-button/AppButton.vue'
3
- import AppCheckbox from '@/common/app-checkbox/AppCheckbox.vue'
4
- import AppDatePicker from '@/common/app-date-picker/AppDatePicker.vue'
5
- import AppInput from '@/common/app-input/AppInput.vue'
6
- import AppInputSearch from '@/common/app-input-search/AppInputSearch.vue'
7
- import AppLayout from '@/common/app-layout/AppLayout.vue'
8
- import AppLayoutHeader from '@/common/app-layout/components/AppLayoutHeader.vue'
9
- import AppLayoutPage from '@/common/app-layout/components/AppLayoutPage.vue'
10
- import AppLoader from '@/common/app-loader/index.vue'
11
- import AppSelect from '@/common/app-select/AppSelect.vue'
12
- import AppSheet from '@/common/app-sheet/AppSheet.vue'
13
- import AppSidebar from '@/common/app-sidebar/AppSidebar.vue'
14
- import AppToggle from '@/common/app-toggle/AppToggle.vue'
15
- import AppWrapper from '@/common/app-wrapper/AppWrapper.vue'
16
- import AppConfirmDialog from '@/common/app-dialogs/AppConfirmDialog.vue'
17
- import AppDropdown from '@/common/app-dropdown/AppDropdown.vue'
18
-
19
- import useGanttService from '@/api/services/GanttService'
20
- import useMetricsService from '@/api/services/MetricsService'
21
- import useProjectsService from '@/api/services/ProjectsService'
22
- import useRepairsService from '@/api/services/RepairsService'
23
- import useTasksService from '@/api/services/TasksService'
24
- import useAuthService from '@/api/services/AuthService'
25
- import useFileService from '@/api/services/FileService'
26
- import ApiService from '@/api/settings/ApiService'
27
-
28
- export {
29
- AppButton,
30
- AppCheckbox,
31
- AppDatePicker,
32
- AppInput,
33
- AppInputSearch,
34
- AppLayout,
35
- AppLayoutHeader,
36
- AppLayoutPage,
37
- AppLoader,
38
- AppSelect,
39
- AppSheet,
40
- AppSidebar,
41
- AppToggle,
42
- AppWrapper,
43
- AppConfirmDialog,
44
- AppDropdown,
45
- }
46
-
47
- export {
48
- ApiService,
49
- useAuthService,
50
- useGanttService,
51
- useMetricsService,
52
- useProjectsService,
53
- useRepairsService,
54
- useTasksService,
55
- useFileService,
56
- }
57
-
58
- export type { NotificationType } from './utils/notification'
59
- export { notificationSettings } from './utils/notification'
60
-
61
- export * from './api/types/Api_Tasks'
62
- export * from './api/types/Api_Repairs'
63
- export * from './api/types/Api_Projects'
64
- // export * from '@/api/types/Api_Metrics'
1
+ import '@/shared/styles/general.css'
2
+ import AppButton from '@/common/app-button/AppButton.vue'
3
+ import AppCheckbox from '@/common/app-checkbox/AppCheckbox.vue'
4
+ import AppDatePicker from '@/common/app-date-picker/AppDatePicker.vue'
5
+ import AppInput from '@/common/app-input/AppInput.vue'
6
+ import AppInputSearch from '@/common/app-input-search/AppInputSearch.vue'
7
+ import AppLayout from '@/common/app-layout/AppLayout.vue'
8
+ import AppLayoutHeader from '@/common/app-layout/components/AppLayoutHeader.vue'
9
+ import AppLayoutPage from '@/common/app-layout/components/AppLayoutPage.vue'
10
+ import AppLoader from '@/common/app-loader/index.vue'
11
+ import AppSelect from '@/common/app-select/AppSelect.vue'
12
+ import AppSheet from '@/common/app-sheet/AppSheet.vue'
13
+ import AppSidebar from '@/common/app-sidebar/AppSidebar.vue'
14
+ import AppToggle from '@/common/app-toggle/AppToggle.vue'
15
+ import AppWrapper from '@/common/app-wrapper/AppWrapper.vue'
16
+ import AppConfirmDialog from '@/common/app-dialogs/AppConfirmDialog.vue'
17
+ import AppDropdown from '@/common/app-dropdown/AppDropdown.vue'
18
+
19
+ import useGanttService from '@/api/services/GanttService'
20
+ import useMetricsService from '@/api/services/MetricsService'
21
+ import useProjectsService from '@/api/services/ProjectsService'
22
+ import useRepairsService from '@/api/services/RepairsService'
23
+ import useTasksService from '@/api/services/TasksService'
24
+ import useAuthService from '@/api/services/AuthService'
25
+ import useFileService from '@/api/services/FileService'
26
+ import ApiService from '@/api/settings/ApiService'
27
+
28
+ export {
29
+ AppButton,
30
+ AppCheckbox,
31
+ AppDatePicker,
32
+ AppInput,
33
+ AppInputSearch,
34
+ AppLayout,
35
+ AppLayoutHeader,
36
+ AppLayoutPage,
37
+ AppLoader,
38
+ AppSelect,
39
+ AppSheet,
40
+ AppSidebar,
41
+ AppToggle,
42
+ AppWrapper,
43
+ AppConfirmDialog,
44
+ AppDropdown,
45
+ }
46
+
47
+ export {
48
+ ApiService,
49
+ useAuthService,
50
+ useGanttService,
51
+ useMetricsService,
52
+ useProjectsService,
53
+ useRepairsService,
54
+ useTasksService,
55
+ useFileService,
56
+ }
57
+
58
+ export type { NotificationType } from './utils/notification'
59
+ export { notificationSettings } from './utils/notification'
60
+
61
+ export * from './api/types/Api_Tasks'
62
+ export * from './api/types/Api_Repairs'
63
+ export * from './api/types/Api_Projects'
64
+ // export * from '@/api/types/Api_Metrics'