shared-ritm 1.2.144 → 1.2.145

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.
Files changed (51) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +14 -13
  3. package/dist/shared-ritm.umd.js +8 -8
  4. package/dist/types/api/services/ComentsServise.d.ts +10 -0
  5. package/dist/types/api/services/PhotoService.d.ts +51 -38
  6. package/dist/types/api/services/TasksService.d.ts +1 -0
  7. package/dist/types/api/types/Api_Tasks.d.ts +32 -0
  8. package/dist/types/api/types/Api_Users.d.ts +43 -0
  9. package/package.json +64 -64
  10. package/src/api/services/BrigadesService.ts +32 -32
  11. package/src/api/services/ControlsService.ts +92 -92
  12. package/src/api/services/EquipmentService.ts +29 -29
  13. package/src/api/services/InstrumentsService.ts +63 -63
  14. package/src/api/services/MetricsService.ts +110 -110
  15. package/src/api/services/ModulesService.ts +27 -27
  16. package/src/api/services/ProjectsService.ts +83 -83
  17. package/src/api/services/RepairsService.ts +124 -124
  18. package/src/api/services/ScheduleService.ts +69 -69
  19. package/src/api/services/SearchService.ts +22 -22
  20. package/src/api/services/TasksService.ts +4 -0
  21. package/src/api/services/UserService.ts +113 -113
  22. package/src/api/services/VideoService.ts +103 -103
  23. package/src/api/settings/ApiService.ts +124 -124
  24. package/src/api/types/Api_Auth.ts +105 -105
  25. package/src/api/types/Api_Brigades.ts +36 -36
  26. package/src/api/types/Api_Controls.ts +111 -111
  27. package/src/api/types/Api_Equipment.ts +3 -3
  28. package/src/api/types/Api_Instruments.ts +136 -136
  29. package/src/api/types/Api_Modules.ts +21 -21
  30. package/src/api/types/Api_Projects.ts +62 -62
  31. package/src/api/types/Api_Repairs.ts +140 -140
  32. package/src/api/types/Api_Schedule.ts +64 -64
  33. package/src/api/types/Api_Search.ts +80 -80
  34. package/src/api/types/Api_Tasks.ts +34 -0
  35. package/src/api/types/Api_User.ts +145 -145
  36. package/src/api/types/Api_Video.ts +145 -145
  37. package/src/common/app-datepicker/AppDatepicker.vue +176 -176
  38. package/src/common/app-dropdown/AppDropdown.vue +37 -37
  39. package/src/common/app-input-new/AppInputNew.vue +175 -175
  40. package/src/common/app-layout/AppLayout.vue +84 -84
  41. package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
  42. package/src/common/app-sidebar/AppSidebar.vue +168 -168
  43. package/src/common/app-sidebar/components/SidebarMenuItem.vue +149 -149
  44. package/src/common/app-table/AppTable.vue +308 -308
  45. package/src/common/app-table/AppTableLayout.vue +137 -137
  46. package/src/common/app-table/components/ModalSelect.vue +285 -285
  47. package/src/common/app-table/components/TableModal.vue +356 -356
  48. package/src/common/app-table/controllers/useBaseTable.ts +45 -45
  49. package/src/common/app-table/controllers/useTableModel.ts +102 -102
  50. package/src/index.ts +126 -126
  51. package/src/styles/variables.sass +12 -12
@@ -1,176 +1,176 @@
1
- <template>
2
- <div class="datepicker">
3
- <app-input-new
4
- v-model="model"
5
- readonly
6
- input-class="cursor-pointer"
7
- :label="label"
8
- :required="required"
9
- :rules="rules"
10
- :error="error"
11
- :disable="disabled"
12
- placeholder="Выберите дату"
13
- >
14
- <q-popup-proxy v-if="!disabled" class="datepicker__wrapper" @update:model-value="updateError">
15
- <q-date
16
- v-model="model"
17
- :mask="time ? `DD.MM.YYYY ${timeFormat}` : 'DD.MM.YYYY'"
18
- :options="disablePastDates"
19
- @update:model-value="error = false"
20
- />
21
- <q-time
22
- v-if="time"
23
- v-model="model"
24
- :mask="`DD.MM.YYYY ${timeFormat}`"
25
- format24h
26
- :hour-options="hourOptions()"
27
- :minute-options="minuteOptions()"
28
- />
29
- </q-popup-proxy>
30
- <template #append>
31
- <q-icon name="event" class="cursor-pointer"></q-icon>
32
- </template>
33
- </app-input-new>
34
- </div>
35
- </template>
36
-
37
- <script setup lang="ts">
38
- import AppInputNew from '@/common/app-input-new/AppInputNew.vue'
39
- import { ref, withDefaults, defineEmits, defineProps, defineModel } from 'vue'
40
-
41
- interface Props {
42
- label?: string
43
- modelValue?: string
44
- rules?: ((val?: string | number | null) => boolean | string)[]
45
- disableRuleDates?: string | string[]
46
- time?: boolean
47
- noPastDates?: boolean
48
- disabled?: boolean
49
- required?: boolean
50
- timeFormat?: string
51
- }
52
- const props = withDefaults(defineProps<Props>(), {
53
- label: '',
54
- timeFormat: 'HH:mm',
55
- rules: () => [],
56
- disableRuleDates: undefined,
57
- modelValue: undefined,
58
- })
59
-
60
- defineEmits(['update:modelValue'])
61
-
62
- const model = defineModel<string | null | undefined>()
63
-
64
- const error = ref(false)
65
-
66
- const updateError = (state: boolean) => {
67
- if (props.required && !error.value && !model.value && !state) {
68
- error.value = true
69
- }
70
- }
71
-
72
- const disablePastDates = (date: string) => {
73
- if (!props.noPastDates && !props.disableRuleDates) return true
74
-
75
- const [year, month, day] = date.split('/')
76
- const currentDate = new Date(Number(year), Number(month) - 1, Number(day))
77
- currentDate.setHours(0, 0, 0, 0)
78
-
79
- if (props.disableRuleDates) {
80
- if (Array.isArray(props.disableRuleDates)) {
81
- const firstDate = props.disableRuleDates[0] ? new Date(props.disableRuleDates[0]) : null
82
- firstDate?.setHours(0, 0, 0, 0)
83
- const lastDate = props.disableRuleDates[1] ? new Date(props.disableRuleDates[1]) : null
84
- lastDate?.setHours(0, 0, 0, 0)
85
-
86
- return (!firstDate || currentDate >= firstDate) && (!lastDate || currentDate <= lastDate)
87
- } else {
88
- const firstDate = new Date(props.disableRuleDates)
89
- return currentDate >= firstDate
90
- }
91
- }
92
-
93
- const today = new Date()
94
- const todayDate = new Date(today.getFullYear(), today.getMonth(), today.getDate())
95
-
96
- return currentDate >= todayDate
97
- }
98
-
99
- function getSelectedDate() {
100
- if (!model.value) return null
101
-
102
- return model.value.toString().substring(0, 10)
103
- }
104
-
105
- function getSelectedHour() {
106
- if (!model.value) return null
107
-
108
- const timePart = model.value.toString().split(' ')[1]
109
- return timePart ? Number(timePart.split(':')[0]) : null
110
- }
111
-
112
- function hourOptions(): number[] {
113
- const today = new Date()
114
- const selectedDate = getSelectedDate()
115
- const todayStr = today.toISOString().slice(0, 10)
116
-
117
- if (selectedDate !== todayStr) {
118
- return Array.from({ length: 24 }, (_, i) => i)
119
- }
120
-
121
- const currentHour = today.getHours()
122
- return Array.from({ length: 24 - currentHour }, (_, i) => currentHour + i)
123
- }
124
-
125
- function minuteOptions(): number[] {
126
- const today = new Date()
127
- const selectedDate = getSelectedDate()
128
- const todayStr = today.toISOString().slice(0, 10)
129
- const selectedHour = getSelectedHour()
130
-
131
- if (selectedDate !== todayStr) {
132
- return Array.from({ length: 60 }, (_, i) => i)
133
- }
134
-
135
- if (selectedHour === today.getHours()) {
136
- const currentMinutes = today.getMinutes()
137
- return Array.from({ length: 60 - currentMinutes }, (_, i) => currentMinutes + i)
138
- }
139
-
140
- return Array.from({ length: 60 }, (_, i) => i)
141
- }
142
- </script>
143
-
144
- <style scoped lang="scss">
145
- .datepicker {
146
- :deep(input),
147
- :deep(.q-field--readonly.q-field--float .q-field__native) {
148
- cursor: pointer;
149
- }
150
-
151
- &__label {
152
- font-size: 14px;
153
- font-weight: 700;
154
- color: #7d8592;
155
-
156
- .required {
157
- color: #f65160;
158
- font-weight: bold;
159
- }
160
- }
161
- }
162
- </style>
163
-
164
- <style lang="scss">
165
- .datepicker {
166
- &__wrapper {
167
- display: flex;
168
-
169
- .q-time,
170
- .q-date {
171
- box-shadow: none;
172
- border-radius: 0;
173
- }
174
- }
175
- }
176
- </style>
1
+ <template>
2
+ <div class="datepicker">
3
+ <app-input-new
4
+ v-model="model"
5
+ readonly
6
+ input-class="cursor-pointer"
7
+ :label="label"
8
+ :required="required"
9
+ :rules="rules"
10
+ :error="error"
11
+ :disable="disabled"
12
+ placeholder="Выберите дату"
13
+ >
14
+ <q-popup-proxy v-if="!disabled" class="datepicker__wrapper" @update:model-value="updateError">
15
+ <q-date
16
+ v-model="model"
17
+ :mask="time ? `DD.MM.YYYY ${timeFormat}` : 'DD.MM.YYYY'"
18
+ :options="disablePastDates"
19
+ @update:model-value="error = false"
20
+ />
21
+ <q-time
22
+ v-if="time"
23
+ v-model="model"
24
+ :mask="`DD.MM.YYYY ${timeFormat}`"
25
+ format24h
26
+ :hour-options="hourOptions()"
27
+ :minute-options="minuteOptions()"
28
+ />
29
+ </q-popup-proxy>
30
+ <template #append>
31
+ <q-icon name="event" class="cursor-pointer"></q-icon>
32
+ </template>
33
+ </app-input-new>
34
+ </div>
35
+ </template>
36
+
37
+ <script setup lang="ts">
38
+ import AppInputNew from '@/common/app-input-new/AppInputNew.vue'
39
+ import { ref, withDefaults, defineEmits, defineProps, defineModel } from 'vue'
40
+
41
+ interface Props {
42
+ label?: string
43
+ modelValue?: string
44
+ rules?: ((val?: string | number | null) => boolean | string)[]
45
+ disableRuleDates?: string | string[]
46
+ time?: boolean
47
+ noPastDates?: boolean
48
+ disabled?: boolean
49
+ required?: boolean
50
+ timeFormat?: string
51
+ }
52
+ const props = withDefaults(defineProps<Props>(), {
53
+ label: '',
54
+ timeFormat: 'HH:mm',
55
+ rules: () => [],
56
+ disableRuleDates: undefined,
57
+ modelValue: undefined,
58
+ })
59
+
60
+ defineEmits(['update:modelValue'])
61
+
62
+ const model = defineModel<string | null | undefined>()
63
+
64
+ const error = ref(false)
65
+
66
+ const updateError = (state: boolean) => {
67
+ if (props.required && !error.value && !model.value && !state) {
68
+ error.value = true
69
+ }
70
+ }
71
+
72
+ const disablePastDates = (date: string) => {
73
+ if (!props.noPastDates && !props.disableRuleDates) return true
74
+
75
+ const [year, month, day] = date.split('/')
76
+ const currentDate = new Date(Number(year), Number(month) - 1, Number(day))
77
+ currentDate.setHours(0, 0, 0, 0)
78
+
79
+ if (props.disableRuleDates) {
80
+ if (Array.isArray(props.disableRuleDates)) {
81
+ const firstDate = props.disableRuleDates[0] ? new Date(props.disableRuleDates[0]) : null
82
+ firstDate?.setHours(0, 0, 0, 0)
83
+ const lastDate = props.disableRuleDates[1] ? new Date(props.disableRuleDates[1]) : null
84
+ lastDate?.setHours(0, 0, 0, 0)
85
+
86
+ return (!firstDate || currentDate >= firstDate) && (!lastDate || currentDate <= lastDate)
87
+ } else {
88
+ const firstDate = new Date(props.disableRuleDates)
89
+ return currentDate >= firstDate
90
+ }
91
+ }
92
+
93
+ const today = new Date()
94
+ const todayDate = new Date(today.getFullYear(), today.getMonth(), today.getDate())
95
+
96
+ return currentDate >= todayDate
97
+ }
98
+
99
+ function getSelectedDate() {
100
+ if (!model.value) return null
101
+
102
+ return model.value.toString().substring(0, 10)
103
+ }
104
+
105
+ function getSelectedHour() {
106
+ if (!model.value) return null
107
+
108
+ const timePart = model.value.toString().split(' ')[1]
109
+ return timePart ? Number(timePart.split(':')[0]) : null
110
+ }
111
+
112
+ function hourOptions(): number[] {
113
+ const today = new Date()
114
+ const selectedDate = getSelectedDate()
115
+ const todayStr = today.toISOString().slice(0, 10)
116
+
117
+ if (selectedDate !== todayStr) {
118
+ return Array.from({ length: 24 }, (_, i) => i)
119
+ }
120
+
121
+ const currentHour = today.getHours()
122
+ return Array.from({ length: 24 - currentHour }, (_, i) => currentHour + i)
123
+ }
124
+
125
+ function minuteOptions(): number[] {
126
+ const today = new Date()
127
+ const selectedDate = getSelectedDate()
128
+ const todayStr = today.toISOString().slice(0, 10)
129
+ const selectedHour = getSelectedHour()
130
+
131
+ if (selectedDate !== todayStr) {
132
+ return Array.from({ length: 60 }, (_, i) => i)
133
+ }
134
+
135
+ if (selectedHour === today.getHours()) {
136
+ const currentMinutes = today.getMinutes()
137
+ return Array.from({ length: 60 - currentMinutes }, (_, i) => currentMinutes + i)
138
+ }
139
+
140
+ return Array.from({ length: 60 }, (_, i) => i)
141
+ }
142
+ </script>
143
+
144
+ <style scoped lang="scss">
145
+ .datepicker {
146
+ :deep(input),
147
+ :deep(.q-field--readonly.q-field--float .q-field__native) {
148
+ cursor: pointer;
149
+ }
150
+
151
+ &__label {
152
+ font-size: 14px;
153
+ font-weight: 700;
154
+ color: #7d8592;
155
+
156
+ .required {
157
+ color: #f65160;
158
+ font-weight: bold;
159
+ }
160
+ }
161
+ }
162
+ </style>
163
+
164
+ <style lang="scss">
165
+ .datepicker {
166
+ &__wrapper {
167
+ display: flex;
168
+
169
+ .q-time,
170
+ .q-date {
171
+ box-shadow: none;
172
+ border-radius: 0;
173
+ }
174
+ }
175
+ }
176
+ </style>
@@ -1,37 +1,37 @@
1
- <template>
2
- <q-btn-dropdown
3
- v-model="model"
4
- :color="color"
5
- :content-style="{ width: width || '200px', minWidth: height || '200px' }"
6
- >
7
- <template #label>
8
- <slot name="label">
9
- {{ label }}
10
- </slot>
11
- </template>
12
- <template #default>
13
- <slot name="content" />
14
- </template>
15
- </q-btn-dropdown>
16
- </template>
17
-
18
- <script setup lang="ts">
19
- interface Props {
20
- label?: string
21
- color?: string
22
- width?: number
23
- height?: number
24
- }
25
-
26
- const props = defineProps<Props>()
27
-
28
- const model = defineModel<boolean>()
29
- </script>
30
-
31
- <style scoped lang="scss">
32
- .q-btn {
33
- &:before {
34
- box-shadow: none;
35
- }
36
- }
37
- </style>
1
+ <template>
2
+ <q-btn-dropdown
3
+ v-model="model"
4
+ :color="color"
5
+ :content-style="{ width: width || '200px', minWidth: height || '200px' }"
6
+ >
7
+ <template #label>
8
+ <slot name="label">
9
+ {{ label }}
10
+ </slot>
11
+ </template>
12
+ <template #default>
13
+ <slot name="content" />
14
+ </template>
15
+ </q-btn-dropdown>
16
+ </template>
17
+
18
+ <script setup lang="ts">
19
+ interface Props {
20
+ label?: string
21
+ color?: string
22
+ width?: number
23
+ height?: number
24
+ }
25
+
26
+ const props = defineProps<Props>()
27
+
28
+ const model = defineModel<boolean>()
29
+ </script>
30
+
31
+ <style scoped lang="scss">
32
+ .q-btn {
33
+ &:before {
34
+ box-shadow: none;
35
+ }
36
+ }
37
+ </style>