shared-ritm 1.2.68 → 1.2.70

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.
@@ -1,5 +1,6 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService';
1
+ import ApiService from '@/api/settings/ApiService';
2
2
  import { Api_ControlLogs_Dto, Api_ControlZones_Dto } from '@/api/types/Api_Controls';
3
+ import { ResponseApi } from '@/api/types/Api_Service';
3
4
  declare class ControlsService extends ApiService {
4
5
  fetchControlZones(params: Record<string, any>): Promise<ResponseApi<Api_ControlZones_Dto[]>>;
5
6
  fetchControlZone(id: string): Promise<ResponseApi<Api_ControlZones_Dto>>;
@@ -1,4 +1,5 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService';
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { ResponseApi } from '@/api/types/Api_Service';
2
3
  import { Api_Files_Responsible_Dto } from '@/api/types/Api_Files';
3
4
  declare class FileService extends ApiService {
4
5
  uploadFile(data: FormData): Promise<ResponseApi<Api_Files_Responsible_Dto>>;
@@ -1,4 +1,5 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService';
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { ResponseApi } from '@/api/types/Api_Service';
2
3
  declare class MetricsService extends ApiService {
3
4
  fetchPieProjects(queryString: string): Promise<ResponseApi<any>>;
4
5
  fetchPieTasks(queryString: string): Promise<ResponseApi<any>>;
@@ -1,6 +1,5 @@
1
1
  import * as faceapi from 'face-api.js';
2
- import ApiService from '@/api/settings/ApiService';
3
- declare class PhotoService extends ApiService {
2
+ declare class PhotoService {
4
3
  getVideoStreamConfig(width: number, height: number): {
5
4
  audio: boolean;
6
5
  video: {
@@ -1,4 +1,5 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService';
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { ResponseApi } from '@/api/types/Api_Service';
2
3
  import { Api_Project_Dto } from '@/api/types/Api_Projects';
3
4
  declare class ProjectsService extends ApiService {
4
5
  fetchProjectById(id: string): Promise<ResponseApi<Api_Project_Dto>>;
@@ -1,4 +1,5 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService';
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { ResponseApi } from '@/api/types/Api_Service';
2
3
  import { Api_Create_Repair_With_Equipments, Api_Equipment_Full_Dto, Api_Repair_Dto, Api_Update_Repair, OptionFilters } from '@/api/types/Api_Repairs';
3
4
  declare class RepairsService extends ApiService {
4
5
  fetchFilters(fullParams: string): Promise<OptionFilters>;
@@ -0,0 +1,8 @@
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { ResponseApi } from '@/api/types/Api_Service';
3
+ import { Api_Search_User } from '@/api/types/Api_Search';
4
+ declare class SearchService extends ApiService {
5
+ fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User>>;
6
+ }
7
+ export default function useSearchService(): SearchService;
8
+ export {};
@@ -1,4 +1,5 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService';
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { ResponseApi } from '@/api/types/Api_Service';
2
3
  import { Api_Task_Close_Reason, Api_Task_Instrument_Dto, Api_Task_Instrument_From_Warehouse, Api_Task_Module_Instrument_Condition, Api_Tasks_Dto, Api_Tasks_Task_Dto } from '@/api/types/Api_Tasks';
3
4
  import { Api_Equipment_Full_Dto, Api_Task_Video_Source, Api_Task_Video_Source_Stream } from '@/api/types/Api_Repairs';
4
5
  declare class TasksService extends ApiService {
@@ -2,14 +2,6 @@ import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
2
  export declare enum ApiServiceType {
3
3
  SERVICE_AUTH = "SERVICE_AUTH"
4
4
  }
5
- export type ResponseApi<T> = {
6
- count: number;
7
- current_page: number;
8
- data: T;
9
- per_page: number;
10
- total: number;
11
- total_pages: number;
12
- };
13
5
  export default class ApiService {
14
6
  private axiosInstance;
15
7
  constructor();
@@ -67,6 +67,8 @@ export type Api_Create_Repair_With_Equipments = {
67
67
  power_output_MWh?: number;
68
68
  cost_per_MWh?: number;
69
69
  category?: string;
70
+ user_id_list?: string[];
71
+ team_id_list?: string[];
70
72
  };
71
73
  export type Api_Update_Repair = {
72
74
  name?: string;
@@ -75,6 +77,8 @@ export type Api_Update_Repair = {
75
77
  power_output_MWh?: number;
76
78
  cost_per_MWh?: number;
77
79
  category?: string;
80
+ user_id_list?: string[];
81
+ team_id_list?: string[];
78
82
  };
79
83
  export type Api_Repair_Dto = {
80
84
  id: string;
@@ -0,0 +1,43 @@
1
+ export type Api_Search_User_Passes = {
2
+ id: string;
3
+ type: string;
4
+ uuid: string;
5
+ };
6
+ export type Api_Search_User_Positions = {
7
+ id: string;
8
+ name: string;
9
+ display_name: string;
10
+ description: string;
11
+ };
12
+ export type Api_Search_User_Roles = {
13
+ id: string;
14
+ name: string;
15
+ display_name: string;
16
+ };
17
+ export type Api_Search_User_Teams = {
18
+ id: string;
19
+ name: string;
20
+ display_name: string;
21
+ roles: Api_Search_User_Roles[];
22
+ };
23
+ export type Api_Search_User_Photos = {
24
+ id: string;
25
+ name: string;
26
+ path: string;
27
+ type: string;
28
+ };
29
+ export type Api_Search_User = {
30
+ id: string;
31
+ full_name: string;
32
+ last_name: string;
33
+ first_name: string;
34
+ patronymic: string;
35
+ email: string;
36
+ phone: string;
37
+ divisions: string;
38
+ personnel_number: string;
39
+ passes: Api_Search_User_Passes[];
40
+ positions: Api_Search_User_Positions[];
41
+ teams: Api_Search_User_Teams[];
42
+ photos: Api_Search_User_Photos[];
43
+ };
@@ -0,0 +1,9 @@
1
+ export type ResponseApi<T> = {
2
+ count: number;
3
+ current_page: number;
4
+ data: T;
5
+ per_page: number;
6
+ total: number;
7
+ total_pages: number;
8
+ filter_value?: string;
9
+ };
@@ -3,6 +3,7 @@ import AppButton from '@/common/app-button/AppButton.vue';
3
3
  import AppCheckbox from '@/common/app-checkbox/AppCheckbox.vue';
4
4
  import AppDatePicker from '@/common/app-date-picker/AppDatePicker.vue';
5
5
  import AppInput from '@/common/app-input/AppInput.vue';
6
+ import AppInputNew from '@/common/app-input-new/AppInputNew.vue';
6
7
  import AppInputSearch from '@/common/app-input-search/AppInputSearch.vue';
7
8
  import AppLayout from '@/common/app-layout/AppLayout.vue';
8
9
  import AppLayoutHeader from '@/common/app-layout/components/AppLayoutHeader.vue';
@@ -21,6 +22,7 @@ import AppTableModal from '@/common/app-table/components/TableModal.vue';
21
22
  import AppTable from '@/common/app-table/AppTable.vue';
22
23
  import AppTableLayout from '@/common/app-table/AppTableLayout.vue';
23
24
  import AppModalSelect from '@/common/app-table/components/ModalSelect.vue';
25
+ import ApiService from '@/api/settings/ApiService';
24
26
  import useGanttService from '@/api/services/GanttService';
25
27
  import useMetricsService from '@/api/services/MetricsService';
26
28
  import useProjectsService from '@/api/services/ProjectsService';
@@ -32,10 +34,10 @@ import useVideoService from '@/api/services/VideoService';
32
34
  import useUserService from '@/api/services/UserService';
33
35
  import usePhotoService from '@/api/services/PhotoService';
34
36
  import useInstrumentsService from '@/api/services/InstrumentsService';
35
- import ApiService from '@/api/settings/ApiService';
36
37
  import useControlsService from '@/api/services/ControlsService';
37
- export { AppButton, AppCheckbox, AppDatePicker, AppInput, AppInputSearch, AppLayout, AppLayoutHeader, AppLayoutPage, AppLoader, AppSelect, AppSheet, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, AppDropdown, AppTablePagination, AppTableSearch, AppTableModal, AppTable, AppTableLayout, AppModalSelect, };
38
- export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useUserService, usePhotoService, useInstrumentsService, };
38
+ import useSearchService from '@/api/services/SearchService';
39
+ export { AppButton, AppCheckbox, AppDatePicker, AppInput, AppInputNew, AppInputSearch, AppLayout, AppLayoutHeader, AppLayoutPage, AppLoader, AppSelect, AppSheet, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, AppDropdown, AppTablePagination, AppTableSearch, AppTableModal, AppTable, AppTableLayout, AppModalSelect, };
40
+ export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useUserService, usePhotoService, useInstrumentsService, useSearchService, };
39
41
  export { useBaseTable } from './common/app-table/controllers/useBaseTable';
40
42
  export { useTableModel } from './common/app-table/controllers/useTableModel';
41
43
  export { useColumnSelector } from './common/app-table/controllers/useColumnSelector';
@@ -43,9 +45,11 @@ export type { FilterOption, TableModel, TableColumn } from './common/app-table/c
43
45
  export type { NotificationType } from './utils/notification';
44
46
  export { notificationSettings } from './utils/notification';
45
47
  export * from './utils/helpers';
48
+ export * from './api/types/Api_Service';
46
49
  export * from './api/types/Api_Tasks';
47
50
  export * from './api/types/Api_Repairs';
48
51
  export * from './api/types/Api_Projects';
49
52
  export * from './api/types/Api_Controls';
50
53
  export * from './api/types/Api_Instruments';
54
+ export * from './api/types/Api_Search';
51
55
  export * from './api/types/Api_User';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.68",
3
+ "version": "1.2.70",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -70,6 +70,8 @@ export type Api_Create_Repair_With_Equipments = {
70
70
  power_output_MWh?: number
71
71
  cost_per_MWh?: number
72
72
  category?: string
73
+ user_id_list?: string[]
74
+ team_id_list?: string[]
73
75
  }
74
76
 
75
77
  export type Api_Update_Repair = {
@@ -79,6 +81,8 @@ export type Api_Update_Repair = {
79
81
  power_output_MWh?: number
80
82
  cost_per_MWh?: number
81
83
  category?: string
84
+ user_id_list?: string[]
85
+ team_id_list?: string[]
82
86
  }
83
87
 
84
88
  export type Api_Repair_Dto = {
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <div class="app-input-new">
3
+ <label v-if="label" class="app-input-new__label">
4
+ {{ label }}
5
+ <span v-if="required" class="required">*</span>
6
+ </label>
7
+
8
+ <q-input v-model="model" filled :type="type" :rules="rules" :placeholder="placeholder" :disable="disable">
9
+ <template #append>
10
+ <q-icon
11
+ v-if="clearable && model?.length"
12
+ name="close"
13
+ class="cursor-pointer clear-input"
14
+ @click="model = null"
15
+ />
16
+ <q-btn v-if="uuid" flat no-caps label="UUID" size="sm" class="q-ml-sm uuid-btn" @click="model = uuidv4()" />
17
+ <q-icon
18
+ v-if="copyable"
19
+ name="content_copy"
20
+ class="cursor-pointer q-ml-sm copy-icon"
21
+ color="primary"
22
+ :disable="!model"
23
+ @click="copyToClipboard"
24
+ />
25
+ </template>
26
+ </q-input>
27
+ </div>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import { defineEmits, defineProps, defineModel } from 'vue'
32
+ import { uuidv4 } from '@/utils/helpers'
33
+ import { notificationSettings } from '@/utils/notification'
34
+ import { QInputProps, useQuasar } from 'quasar'
35
+
36
+ defineProps<
37
+ QInputProps & {
38
+ modelValue?: string | number | null
39
+ label?: string
40
+ placeholder?: string
41
+ rules?: ((val: string | number | null | undefined) => boolean | string)[]
42
+ required?: boolean
43
+ disable?: boolean
44
+ uuid?: boolean
45
+ clearable?: boolean
46
+ copyable?: boolean
47
+ }
48
+ >()
49
+
50
+ defineEmits<{
51
+ (e: 'update:modelValue', val: boolean): void
52
+ }>()
53
+
54
+ const model = defineModel<string | null>()
55
+
56
+ const $q = useQuasar()
57
+
58
+ const copyToClipboard = () => {
59
+ if (!model.value) return
60
+
61
+ navigator.clipboard.writeText(model.value).then(() => {
62
+ $q.notify(notificationSettings('success', 'Данные скопированы'))
63
+ })
64
+ }
65
+ </script>
66
+
67
+ <style scoped lang="scss">
68
+ .app-input-new {
69
+ display: flex;
70
+ flex-direction: column;
71
+ margin-bottom: 15px;
72
+
73
+ &__label {
74
+ font-size: 14px;
75
+ font-weight: 700;
76
+ color: #7d8592;
77
+ }
78
+
79
+ .required {
80
+ color: #f65160;
81
+ font-weight: bold;
82
+ }
83
+
84
+ .clear-input {
85
+ color: #d8e0f0;
86
+ }
87
+
88
+ .uuid-btn {
89
+ height: 32px;
90
+ padding: 0 10px;
91
+ border: 1px solid #3f8cff;
92
+ color: #3f8cff;
93
+ font-weight: 700;
94
+ font-size: 14px;
95
+ background: white;
96
+ border-radius: 6px;
97
+
98
+ :deep(.block) {
99
+ line-height: normal;
100
+ }
101
+ }
102
+
103
+ :deep(.q-placeholder) {
104
+ color: #7d8592;
105
+ }
106
+
107
+ :deep(.q-field__control) {
108
+ border-radius: 8px;
109
+ border: 1px solid #d8e0f0;
110
+ background: #fff;
111
+ box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
112
+ }
113
+
114
+ :deep(.q-field--filled .q-field__control:before) {
115
+ background: #fff !important;
116
+ border: none;
117
+ }
118
+
119
+ :deep(.q-field--with-bottom) {
120
+ padding-bottom: 0;
121
+ }
122
+
123
+ :deep(.q-field__bottom) {
124
+ padding: 0;
125
+ }
126
+ }
127
+ </style>
@@ -11,7 +11,7 @@
11
11
  :disable="isDisabled"
12
12
  :multiple="multiple"
13
13
  :popup-content-class="'custom-select-menu'"
14
- :hide-selected="!showChip"
14
+ :hide-selected="!showChip && !simple"
15
15
  :placeholder="placeholder"
16
16
  :loading="loading"
17
17
  :option-value="optionValue || 'value'"
@@ -20,8 +20,9 @@
20
20
  filled
21
21
  map-options
22
22
  stack-label
23
- use-input
24
- use-chips
23
+ :use-input="!selected || !simple"
24
+ :use-chips="!simple"
25
+ :hide-bottom-space="hideBottomSpace"
25
26
  input-debounce="100"
26
27
  autocomplete=""
27
28
  :rules="rules"
@@ -44,7 +45,7 @@
44
45
 
45
46
  <template #append>
46
47
  <q-icon
47
- v-if="!isDisabled && selected && selected.length"
48
+ v-if="!isDisabled && selected && (selected.length || selected > 0)"
48
49
  name="close"
49
50
  class="cursor-pointer clear-input"
50
51
  @click.stop="handleClear"
@@ -55,7 +56,7 @@
55
56
  <div class="q-pa-sm">
56
57
  <q-item>
57
58
  <q-item-section class="wrapper-empty-text">
58
- {{ emptyText }}
59
+ {{ emptyText || 'Ничего не найдено' }}
59
60
  <button
60
61
  v-if="allowCreate && internalSearch && internalSearch.trim()"
61
62
  class="add-new-items"
@@ -86,8 +87,8 @@ type Option = Record<string, any>
86
87
  interface AppQSelectProps {
87
88
  modelValue: any
88
89
  options: Option[]
89
- placeholder: string | undefined
90
- emptyText: string
90
+ placeholder?: string | undefined
91
+ emptyText?: string
91
92
  optionLabel?: string
92
93
  optionValue?: string
93
94
  label?: string
@@ -98,6 +99,8 @@ interface AppQSelectProps {
98
99
  allowCreate?: boolean
99
100
  isSearch?: boolean
100
101
  showChip?: boolean
102
+ simple?: boolean
103
+ hideBottomSpace?: boolean
101
104
  chipColor?: string
102
105
  height?: string
103
106
  borderColor?: string
@@ -123,9 +126,10 @@ const selected = computed({
123
126
  })
124
127
 
125
128
  function handleClear() {
126
- selected.value = props.multiple ? [] : null
129
+ const emptyValue = props.multiple ? [] : null
130
+ selected.value = emptyValue
127
131
  lcText.value = ''
128
- emit('update:modelValue', selected.value)
132
+ emit('update:modelValue', emptyValue)
129
133
  emit('clear')
130
134
  }
131
135
 
@@ -231,10 +235,9 @@ function debounce<T>(fn: T, ms) {
231
235
  border-radius: 8px;
232
236
  border: 1px solid #d8e0f0;
233
237
  background: #fff;
234
- box-shadow: 0px 1px 2px 0px rgba(184, 200, 224, 0.22);
238
+ box-shadow: 0 1px 2px 0 rgba(184, 200, 224, 0.22);
235
239
  }
236
- ::v-deep(.q-field--filled.q-field--highlighted .q-field__control:before),
237
- ::v-deep(.q-field--filled .q-field__control:before) {
240
+ :global(.q-field--filled.q-field--highlighted .q-field__control:before) {
238
241
  background: #fff !important;
239
242
  border: none;
240
243
  }
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ import AppButton from '@/common/app-button/AppButton.vue'
3
3
  import AppCheckbox from '@/common/app-checkbox/AppCheckbox.vue'
4
4
  import AppDatePicker from '@/common/app-date-picker/AppDatePicker.vue'
5
5
  import AppInput from '@/common/app-input/AppInput.vue'
6
+ import AppInputNew from '@/common/app-input-new/AppInputNew.vue'
6
7
  import AppInputSearch from '@/common/app-input-search/AppInputSearch.vue'
7
8
  import AppLayout from '@/common/app-layout/AppLayout.vue'
8
9
  import AppLayoutHeader from '@/common/app-layout/components/AppLayoutHeader.vue'
@@ -42,6 +43,7 @@ export {
42
43
  AppCheckbox,
43
44
  AppDatePicker,
44
45
  AppInput,
46
+ AppInputNew,
45
47
  AppInputSearch,
46
48
  AppLayout,
47
49
  AppLayoutHeader,