tsv2-library 1.0.64 → 1.0.66
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/dist/loading-table-fa-8b779ca8.js +4 -0
- package/dist/src/build-entry.d.ts +5 -3
- package/dist/src/components/v2/Animation/Animation.vue.d.ts +40 -0
- package/dist/src/components/v2/AssetAttribute/UrlFormat.vue.d.ts +22 -0
- package/dist/src/components/v2/CustomColumn/ColumnList.vue.d.ts +4 -0
- package/dist/src/components/v2/CustomColumn/CustomColumn.vue.d.ts +23 -1
- package/dist/src/components/v2/CustomColumn/DialogColumnSetup.vue.d.ts +4 -0
- package/dist/src/components/v2/DataTable/DataTable.vue.d.ts +16 -6
- package/dist/src/components/v2/Dialog/Dialog.vue.d.ts +1 -0
- package/dist/src/components/v2/DialogConfirm/DialogConfirm.vue.d.ts +5 -0
- package/dist/src/components/v2/DialogCoordinate/AssetList.vue.d.ts +4 -0
- package/dist/src/components/v2/DialogCoordinate/AssetListFilter.vue.d.ts +4 -0
- package/dist/src/components/v2/DialogCoordinate/CoordinateHeader.vue.d.ts +4 -0
- package/dist/src/components/v2/DialogCoordinate/DialogCoordinate.vue.d.ts +24 -0
- package/dist/src/components/v2/DialogCoordinate/MapSearch.vue.d.ts +4 -2
- package/dist/src/components/v2/DialogCoordinate/Marker.vue.d.ts +13 -0
- package/dist/src/components/v2/DialogCoordinate/PopupDetail.vue.d.ts +13 -0
- package/dist/src/components/v2/DialogForm/DialogForm.vue.d.ts +11 -0
- package/dist/src/components/v2/FailedLoad/FailedLoad.vue.d.ts +26 -0
- package/dist/src/components/v2/FilterAssetValue/FilterAssetValue.vue.d.ts +20 -0
- package/dist/src/components/v2/FilterCustomField/FilterCustomField.vue.d.ts +17 -0
- package/dist/src/components/v2/Icon/Icon.vue.d.ts +10 -0
- package/dist/src/components/v2/ImageCompressor/ImageCompressor.vue.d.ts +1 -1
- package/dist/src/components/v2/InputCoordinate/InputCoordinate.vue.d.ts +9 -3
- package/dist/src/components/v2/InputPhoneNumber/InputPhoneNumber.vue.d.ts +1 -0
- package/dist/src/components/v2/InputText/InputText.vue.d.ts +1 -1
- package/dist/src/components/v2/InputURL/InputURL.vue.d.ts +1 -0
- package/dist/src/components/v2/LazyLoadTrigger/LazyLoadTrigger.vue.d.ts +4 -0
- package/dist/src/components/v2/Textarea/Textarea.vue.d.ts +1 -0
- package/dist/src/components/v2/TransactionRoles/TransactionRoles.vue.d.ts +2 -0
- package/dist/src/components/v2/index.d.ts +6 -1
- package/dist/src/dto/assets.dto.d.ts +15 -0
- package/dist/src/event-bus/index.d.ts +8 -0
- package/dist/src/event-bus/mitt.d.ts +26 -0
- package/dist/src/presets/datatable/index.js +1 -1
- package/dist/src/services/assetName.service.d.ts +1 -2
- package/dist/src/services/assets.service.d.ts +6 -2
- package/dist/src/services/column.service.d.ts +13 -0
- package/dist/src/services/settingsAttribute.service.d.ts +8 -0
- package/dist/src/store/assetAttribute.store.d.ts +12 -0
- package/dist/src/store/index.d.ts +1 -0
- package/dist/src/types/assets.type.d.ts +24 -6
- package/dist/src/types/filterField.type.d.ts +35 -0
- package/dist/src/types/settingsAttribute.type.d.ts +28 -0
- package/dist/src/utils/customMarker.util.d.ts +64 -0
- package/dist/src/utils/debounce.util.d.ts +1 -0
- package/dist/src/utils/googleMapLoader.util.d.ts +1 -0
- package/dist/src/utils/index.d.ts +3 -2
- package/dist/src/utils/role.util.d.ts +1 -1
- package/dist/src/utils/textFormater.util.d.ts +5 -0
- package/dist/src/utils/toast.util.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tsv2-library.es.js +14206 -9773
- package/dist/tsv2-library.umd.js +7 -7
- package/package.json +3 -1
- package/src/components/v2/Animation/Animation.vue.d.ts +40 -0
- package/src/components/v2/CustomColumn/CustomColumn.vue.d.ts +23 -1
- package/src/components/v2/DataTable/DataTable.vue.d.ts +16 -6
- package/src/components/v2/Dialog/Dialog.vue.d.ts +1 -0
- package/src/components/v2/DialogConfirm/DialogConfirm.vue.d.ts +5 -0
- package/src/components/v2/DialogCoordinate/DialogCoordinate.vue.d.ts +24 -0
- package/src/components/v2/DialogForm/DialogForm.vue.d.ts +11 -0
- package/src/components/v2/FailedLoad/FailedLoad.vue.d.ts +26 -0
- package/src/components/v2/FilterAssetValue/FilterAssetValue.vue.d.ts +20 -0
- package/src/components/v2/FilterCustomField/FilterCustomField.vue.d.ts +17 -0
- package/src/components/v2/Icon/Icon.vue.d.ts +10 -0
- package/src/components/v2/ImageCompressor/ImageCompressor.vue.d.ts +1 -1
- package/src/components/v2/InputCoordinate/InputCoordinate.vue.d.ts +9 -3
- package/src/components/v2/InputPhoneNumber/InputPhoneNumber.vue.d.ts +1 -0
- package/src/components/v2/InputText/InputText.vue.d.ts +1 -1
- package/src/components/v2/InputURL/InputURL.vue.d.ts +1 -0
- package/src/components/v2/Textarea/Textarea.vue.d.ts +1 -0
- package/src/components/v2/TransactionRoles/TransactionRoles.vue.d.ts +2 -0
- package/src/module.d.ts +3 -0
- package/src/presets/datatable/index.js +1 -1
- package/src/services/assets.service.ts +40 -1
- package/src/services/column.service.ts +42 -0
- package/src/services/settingsAttribute.service.ts +41 -0
- package/dist/src/components/v2/DataTable/store/dataTable.store.d.ts +0 -22
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsv2-library",
|
|
3
3
|
"author": "fixedassetv2-fe",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.66",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"homepage": "https://github.com/fixedassetv2-fe/tsv2-library#readme",
|
|
7
7
|
"repository": {
|
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@googlemaps/js-api-loader": "^2.0.2",
|
|
42
|
+
"@googlemaps/markerclusterer": "^2.6.2",
|
|
43
|
+
"@lottiefiles/dotlottie-web": "^0.61.0",
|
|
42
44
|
"@types/google.maps": "^3.58.1",
|
|
43
45
|
"@types/lodash": "^4.17.7",
|
|
44
46
|
"@vueuse/core": "^10.7.2",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Config } from '@lottiefiles/dotlottie-web';
|
|
2
|
+
|
|
3
|
+
import { ClassComponent } from '../ts-helpers';
|
|
4
|
+
|
|
5
|
+
export interface AnimationDefaultConfig {
|
|
6
|
+
libPath: 'supplyasset' | 'workspace' | 'admin';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AnimationProps {
|
|
10
|
+
animation: 'loading-table-fa';
|
|
11
|
+
/**
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
autoplay?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
loop?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Custom configurations for the animation
|
|
21
|
+
* Reference: https://developers.lottiefiles.com/docs/dotlottie-player/dotlottie-web/api/config/
|
|
22
|
+
*/
|
|
23
|
+
customConfig?: Partial<Config>;
|
|
24
|
+
canvasStyle?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* **Animation**
|
|
29
|
+
*
|
|
30
|
+
* _Animation is a lottie animation wrapper._
|
|
31
|
+
*
|
|
32
|
+
* @group Component
|
|
33
|
+
*/
|
|
34
|
+
declare class Animation extends ClassComponent<
|
|
35
|
+
AnimationProps,
|
|
36
|
+
unknown,
|
|
37
|
+
unknown
|
|
38
|
+
> {}
|
|
39
|
+
|
|
40
|
+
export default Animation;
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
import { TableColumn } from '../DataTable/DataTable.vue.d';
|
|
1
2
|
import { ClassComponent } from '../ts-helpers';
|
|
2
3
|
|
|
4
|
+
export type DragableColumn = TableColumn & { order?: number };
|
|
5
|
+
|
|
6
|
+
export interface DataTableColumnConfig {
|
|
7
|
+
field: string;
|
|
8
|
+
pinned: boolean;
|
|
9
|
+
width: number | string;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type CustomColumnEmits = {
|
|
14
|
+
'update:visibleColumns': [columns: TableColumn[]];
|
|
15
|
+
'update:reorderColumns': [columns: TableColumn[]];
|
|
16
|
+
};
|
|
17
|
+
|
|
3
18
|
export interface CustomColumnProps {
|
|
4
19
|
tableId: string;
|
|
20
|
+
tableKey?: string;
|
|
21
|
+
tableName?: string;
|
|
22
|
+
tableData?: Data[];
|
|
5
23
|
defaultColumns: TableColumn[];
|
|
24
|
+
defaultReorderColumns?: TableColumn[];
|
|
6
25
|
visibleColumns: TableColumn[];
|
|
7
26
|
/**
|
|
8
27
|
* The maximum column count allowed
|
|
@@ -12,7 +31,10 @@ export interface CustomColumnProps {
|
|
|
12
31
|
type?: 'menu' | 'flat';
|
|
13
32
|
}
|
|
14
33
|
|
|
15
|
-
declare class CustomColumn extends ClassComponent<
|
|
34
|
+
declare class CustomColumn extends ClassComponent<
|
|
35
|
+
CustomColumnProps,
|
|
36
|
+
CustomColumnEmits
|
|
37
|
+
> {
|
|
16
38
|
/**
|
|
17
39
|
* Method to show custom column menu.
|
|
18
40
|
*/
|
|
@@ -5,15 +5,23 @@ import { ClassComponent } from '../ts-helpers';
|
|
|
5
5
|
|
|
6
6
|
type Data = Record<string, any>;
|
|
7
7
|
|
|
8
|
-
export type QueryParams =
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
};
|
|
8
|
+
export type QueryParams = Partial<Record<string, unknown>>;
|
|
11
9
|
|
|
12
|
-
export type FetchResponse = {
|
|
13
|
-
data:
|
|
10
|
+
export type FetchResponse<T = Data> = {
|
|
11
|
+
data: T[];
|
|
14
12
|
totalRecords: number;
|
|
15
13
|
};
|
|
16
14
|
|
|
15
|
+
export type TableFetchResponse<T = Data> = {
|
|
16
|
+
message: string;
|
|
17
|
+
data: FetchResponse<T>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ShortFetchResponse<T = Data> = {
|
|
21
|
+
message: string;
|
|
22
|
+
data: T;
|
|
23
|
+
};
|
|
24
|
+
|
|
17
25
|
export type TableCellComponent = {
|
|
18
26
|
component: string | Component;
|
|
19
27
|
props?: object;
|
|
@@ -149,6 +157,8 @@ export type TableColumn = {
|
|
|
149
157
|
reorderable?: boolean;
|
|
150
158
|
/**
|
|
151
159
|
* Make the column cannot reordered by disabled dragability.
|
|
160
|
+
* Unlike `reorderable`, the column will still appear in the column visibility
|
|
161
|
+
* overlay if this is set to false.
|
|
152
162
|
*/
|
|
153
163
|
dragable?: boolean;
|
|
154
164
|
/**
|
|
@@ -158,7 +168,7 @@ export type TableColumn = {
|
|
|
158
168
|
fixed?: boolean;
|
|
159
169
|
visible?: boolean;
|
|
160
170
|
/**
|
|
161
|
-
*
|
|
171
|
+
* Whether the column is checked by default
|
|
162
172
|
* @default true
|
|
163
173
|
*/
|
|
164
174
|
checkedByDefault?: boolean;
|
|
@@ -30,6 +30,11 @@ export interface DialogConfirmProps {
|
|
|
30
30
|
* @default 'Yes, Continue'
|
|
31
31
|
*/
|
|
32
32
|
confirmLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The label of the cancel button.
|
|
35
|
+
* @default 'Cancel' | 'Close'
|
|
36
|
+
*/
|
|
37
|
+
cancelLabel?: string;
|
|
33
38
|
/**
|
|
34
39
|
* Pass true to disabled button confirm
|
|
35
40
|
*/
|
|
@@ -39,6 +39,10 @@ export interface LatLngValue {
|
|
|
39
39
|
lng: number | null;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export interface CoordinateValue extends LatLngValue {
|
|
43
|
+
address?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
export type InputMapMode = 'click' | 'drag' | 'center';
|
|
43
47
|
|
|
44
48
|
export type MarkerConfig =
|
|
@@ -74,3 +78,23 @@ export interface MapFocusConfig {
|
|
|
74
78
|
featureType: google.maps.FeatureType;
|
|
75
79
|
featureStyleOptions: google.maps.FeatureStyleOptions;
|
|
76
80
|
}
|
|
81
|
+
|
|
82
|
+
export interface DialogCoordinateProps {
|
|
83
|
+
value?: LatLngValue & { _id?: string };
|
|
84
|
+
center?: [number, number];
|
|
85
|
+
zoom?: number;
|
|
86
|
+
mode?: InputMapMode;
|
|
87
|
+
colorScheme?: 'LIGHT' | 'DARK';
|
|
88
|
+
mapOptions?: google.maps.MapOptions;
|
|
89
|
+
customMarkers?: CustomMarker[];
|
|
90
|
+
inputMarkerConfig?: MarkerConfig;
|
|
91
|
+
type: 'input' | 'detail';
|
|
92
|
+
card?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface CustomMarker {
|
|
96
|
+
lat: number;
|
|
97
|
+
lng: number;
|
|
98
|
+
title?: string;
|
|
99
|
+
desc?: string;
|
|
100
|
+
}
|
|
@@ -122,6 +122,17 @@ export interface DialogFormProps extends FormProps {
|
|
|
122
122
|
* The severity will determine the dialog icons and color scheme.
|
|
123
123
|
*/
|
|
124
124
|
severity?: 'success' | 'danger' | 'primary';
|
|
125
|
+
maskClass?: string | string[];
|
|
126
|
+
/**
|
|
127
|
+
* Whether to automatically manage layering.
|
|
128
|
+
* @defaultValue true
|
|
129
|
+
*/
|
|
130
|
+
autoZIndex?: boolean | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Base zIndex value to use in layering.
|
|
133
|
+
* @defaultValue 0
|
|
134
|
+
*/
|
|
135
|
+
baseZIndex?: number | undefined;
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
export interface ConfirmSlots {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ClassComponent } from '../ts-helpers';
|
|
2
|
+
|
|
3
|
+
export interface FailedLoadEmits {
|
|
4
|
+
/**
|
|
5
|
+
* Emitted when the "Try again" button is clicked.
|
|
6
|
+
*/
|
|
7
|
+
retry: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* **TSVue v2 - FailedLoad**
|
|
12
|
+
*
|
|
13
|
+
* _FailedLoad is a component used to display a standardized error message when data loading fails, providing a retry mechanism._
|
|
14
|
+
*
|
|
15
|
+
* --- ---
|
|
16
|
+
* 
|
|
17
|
+
*
|
|
18
|
+
* @group components
|
|
19
|
+
*/
|
|
20
|
+
declare class FailedLoad extends ClassComponent<
|
|
21
|
+
unknown,
|
|
22
|
+
unknown,
|
|
23
|
+
FailedLoadEmits
|
|
24
|
+
> {}
|
|
25
|
+
|
|
26
|
+
export default FailedLoad;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
import { QueryParams } from '../DataTable/DataTable.vue.d';
|
|
3
|
+
|
|
4
|
+
export interface FilterAssetAttributeProps {
|
|
5
|
+
/**
|
|
6
|
+
* The filter object.
|
|
7
|
+
*/
|
|
8
|
+
filter: QueryParams;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type FilterAssetAttributeEmits = {
|
|
12
|
+
updateFields: [];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
declare const FilterAssetValue: DefineComponent<
|
|
16
|
+
FilterAssetAttributeProps,
|
|
17
|
+
FilterAssetAttributeEmits
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export default FilterAssetValue;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
import {
|
|
3
|
+
FilterAssetAttributeProps,
|
|
4
|
+
FilterAssetAttributeEmits,
|
|
5
|
+
} from '../FilterAssetValue/FilterAssetValue.vue.d';
|
|
6
|
+
import { FilterField } from '@/types/filterField.type';
|
|
7
|
+
|
|
8
|
+
export interface FilterCustomFieldProps extends FilterAssetAttributeProps {
|
|
9
|
+
customFieldFetchOptionFn: FilterField<QueryParams>['fetchOptionFn'];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const FilterCustomField: DefineComponent<
|
|
13
|
+
FilterCustomFieldProps,
|
|
14
|
+
FilterAssetAttributeEmits
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export default FilterCustomField;
|
|
@@ -20,10 +20,12 @@ export type TSVueIcons =
|
|
|
20
20
|
| 'arrow-left-right'
|
|
21
21
|
| 'arrow-right'
|
|
22
22
|
| 'arrow-right-fill'
|
|
23
|
+
| 'asset'
|
|
23
24
|
| 'asset-view'
|
|
24
25
|
| 'asset-name-view'
|
|
25
26
|
| 'assignment'
|
|
26
27
|
| 'audit'
|
|
28
|
+
| 'award-fill'
|
|
27
29
|
| 'bell'
|
|
28
30
|
| 'bell-alert'
|
|
29
31
|
| 'borrow'
|
|
@@ -79,8 +81,12 @@ export type TSVueIcons =
|
|
|
79
81
|
| 'image-add'
|
|
80
82
|
| 'indeterminate-circle-fill'
|
|
81
83
|
| 'info'
|
|
84
|
+
| 'infrared-thermometer'
|
|
85
|
+
| 'layout-grid-line'
|
|
82
86
|
| 'link-unlink-m'
|
|
83
87
|
| 'list-settings-line'
|
|
88
|
+
| 'list-check'
|
|
89
|
+
| 'list-check-2'
|
|
84
90
|
| 'loader-4'
|
|
85
91
|
| 'logout-box-r-line'
|
|
86
92
|
| 'mail-open-line'
|
|
@@ -88,6 +94,7 @@ export type TSVueIcons =
|
|
|
88
94
|
| 'map-2-line'
|
|
89
95
|
| 'map-pin-line'
|
|
90
96
|
| 'menu-line'
|
|
97
|
+
| 'menu-fold'
|
|
91
98
|
| 'menu-unfold'
|
|
92
99
|
| 'more'
|
|
93
100
|
| 'move-to'
|
|
@@ -105,10 +112,12 @@ export type TSVueIcons =
|
|
|
105
112
|
| 'qr-scan-line'
|
|
106
113
|
| 'recycle-bin'
|
|
107
114
|
| 'refresh'
|
|
115
|
+
| 'reload'
|
|
108
116
|
| 'replace-tag'
|
|
109
117
|
| 'report-tag'
|
|
110
118
|
| 'repair-ticketing'
|
|
111
119
|
| 'rfid'
|
|
120
|
+
| 'save-line'
|
|
112
121
|
| 'search'
|
|
113
122
|
| 'search-eye'
|
|
114
123
|
| 'settings'
|
|
@@ -129,6 +138,7 @@ export type TSVueIcons =
|
|
|
129
138
|
| 'user'
|
|
130
139
|
| 'user-add-line'
|
|
131
140
|
| 'user-follow-line'
|
|
141
|
+
| 'user-unfollow-line'
|
|
132
142
|
| 'user-search'
|
|
133
143
|
| 'user-settings'
|
|
134
144
|
| 'verification';
|
|
@@ -132,7 +132,7 @@ export type ImageCompressorEmits = {
|
|
|
132
132
|
/**
|
|
133
133
|
* On apply the image cropper.
|
|
134
134
|
*/
|
|
135
|
-
'apply': [value: ImageCompressorPayload];
|
|
135
|
+
'apply': [value: ImageCompressorPayload, index?: number];
|
|
136
136
|
'update:defaultImage': [index?: number];
|
|
137
137
|
/**
|
|
138
138
|
* Emits on every changes in `field.value`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DefineComponent } from 'vue';
|
|
2
2
|
import { Nullable } from '../ts-helpers';
|
|
3
|
-
import {
|
|
3
|
+
import { CoordinateValue } from '../DialogCoordinate/DialogCoordinate.vue.d';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* InputCoordinate component props
|
|
7
7
|
*/
|
|
8
8
|
export interface InputCoordinateProps {
|
|
9
|
-
modelValue?: Nullable<
|
|
9
|
+
modelValue?: Nullable<CoordinateValue>;
|
|
10
10
|
/**
|
|
11
11
|
* Disabled state for both input fields.
|
|
12
12
|
*/
|
|
@@ -37,13 +37,19 @@ export interface InputCoordinateProps {
|
|
|
37
37
|
* It is rarely use, this component has handled the validator message.
|
|
38
38
|
*/
|
|
39
39
|
validatorMessage?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Wether to show the input or not.
|
|
42
|
+
*
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
showInput?: boolean;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
/**
|
|
43
49
|
* InputCoordinate component emits
|
|
44
50
|
*/
|
|
45
51
|
export type InputCoordinateEmits = {
|
|
46
|
-
'update:modelValue': [payload?: Nullable<
|
|
52
|
+
'update:modelValue': [payload?: Nullable<CoordinateValue>];
|
|
47
53
|
};
|
|
48
54
|
|
|
49
55
|
/**
|
|
@@ -3,11 +3,13 @@ export type TransactionRoles = Addon & {
|
|
|
3
3
|
assignment: boolean;
|
|
4
4
|
transfer: boolean;
|
|
5
5
|
disposal: boolean;
|
|
6
|
+
registration: boolean;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
export type Addon = {
|
|
9
10
|
repairTicketing: boolean;
|
|
10
11
|
maintenance: boolean;
|
|
12
|
+
map: boolean;
|
|
11
13
|
tracking: boolean;
|
|
12
14
|
audit: boolean;
|
|
13
15
|
assetControl: boolean;
|
package/src/module.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
tbody: ({ instance, context }) => ({
|
|
85
85
|
class: [
|
|
86
86
|
// 'border-t border-surface-300 dark:border-surface-600',
|
|
87
|
-
'[&_tr:last-of-type>td]:!border-b-0',
|
|
87
|
+
// '[&_tr:last-of-type>td]:!border-b-0',
|
|
88
88
|
'[&_tr:last-of-type>td:last-child]:!rounded-br-lg',
|
|
89
89
|
'[&_tr:last-of-type>td:first-child]:!rounded-bl-lg',
|
|
90
90
|
{
|
|
@@ -2,6 +2,8 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
2
2
|
import {
|
|
3
3
|
GetAllAssetsQueryParams,
|
|
4
4
|
GetAssetDetailParams,
|
|
5
|
+
GetAssetMapParams,
|
|
6
|
+
GetAssetMapResponse,
|
|
5
7
|
GetAvailableAssetsQueryParams,
|
|
6
8
|
GetLinkedAssetFamiliesResponse,
|
|
7
9
|
} from '@/dto/assets.dto';
|
|
@@ -11,17 +13,19 @@ import { buildBodyParams } from '@/utils';
|
|
|
11
13
|
export interface ServiceOptions {
|
|
12
14
|
headers?: Record<string, unknown>;
|
|
13
15
|
params?: Record<string, unknown>;
|
|
16
|
+
usePrefix?: boolean;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export const API = ({
|
|
17
20
|
headers = {},
|
|
18
21
|
params = {},
|
|
22
|
+
usePrefix = true,
|
|
19
23
|
}: ServiceOptions = {}): AxiosInstance => {
|
|
20
24
|
const user = JSON.parse(localStorage.getItem('user') ?? '{}');
|
|
21
25
|
const BASE_URL = import.meta.env.VITE_APP_TAGSAMURAI_API;
|
|
22
26
|
|
|
23
27
|
const instance = axios.create({
|
|
24
|
-
baseURL: `${BASE_URL}/assets/v2/assets`,
|
|
28
|
+
baseURL: `${BASE_URL}/assets/v2${usePrefix ? '/assets' : ''}`,
|
|
25
29
|
headers: {
|
|
26
30
|
'Content-type': 'application/json',
|
|
27
31
|
'Authorization': `Bearer ${user.token}`,
|
|
@@ -33,6 +37,20 @@ export const API = ({
|
|
|
33
37
|
return instance;
|
|
34
38
|
};
|
|
35
39
|
|
|
40
|
+
const postAssetList = (
|
|
41
|
+
params?: GetAllAssetsQueryParams,
|
|
42
|
+
): Promise<AxiosResponse> => {
|
|
43
|
+
const body = buildBodyParams(params);
|
|
44
|
+
return API().post('/list', body);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const postAssetOption = (
|
|
48
|
+
params?: GetAllAssetsQueryParams,
|
|
49
|
+
): Promise<AxiosResponse> => {
|
|
50
|
+
const body = buildBodyParams(params);
|
|
51
|
+
return API().post('/list/options', body);
|
|
52
|
+
};
|
|
53
|
+
|
|
36
54
|
const getAllAssets = (
|
|
37
55
|
params: GetAllAssetsQueryParams,
|
|
38
56
|
): Promise<AxiosResponse> => {
|
|
@@ -104,8 +122,28 @@ const matchAssetWithTag = (
|
|
|
104
122
|
return API({ params }).get('/by-id');
|
|
105
123
|
};
|
|
106
124
|
|
|
125
|
+
const getAssetMaps = (
|
|
126
|
+
params?: GetAssetMapParams,
|
|
127
|
+
): Promise<AxiosResponse<GetAssetMapResponse>> => {
|
|
128
|
+
let abortController: AbortController | null = null;
|
|
129
|
+
|
|
130
|
+
// Cancel previous request
|
|
131
|
+
if (abortController) {
|
|
132
|
+
(abortController as AbortController).abort();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
abortController = new AbortController();
|
|
136
|
+
|
|
137
|
+
return API({
|
|
138
|
+
usePrefix: false,
|
|
139
|
+
params: params as Record<string, unknown>,
|
|
140
|
+
}).get('/asset-maps', { signal: abortController.signal });
|
|
141
|
+
};
|
|
142
|
+
|
|
107
143
|
export default {
|
|
108
144
|
getAllAssets,
|
|
145
|
+
postAssetList,
|
|
146
|
+
postAssetOption,
|
|
109
147
|
getAvailableAssets,
|
|
110
148
|
postAssetAvailableList,
|
|
111
149
|
getAssetsById,
|
|
@@ -115,4 +153,5 @@ export default {
|
|
|
115
153
|
getUnlinkedAssets,
|
|
116
154
|
getOptions,
|
|
117
155
|
scanAsset,
|
|
156
|
+
getAssetMaps,
|
|
118
157
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DataTableColumnConfig } from '@/components/v2/CustomColumn/CustomColumn.vue.d';
|
|
2
|
+
import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
const getUser = (): Record<string, string> =>
|
|
5
|
+
JSON.parse(localStorage.getItem('user') ?? '{}');
|
|
6
|
+
|
|
7
|
+
export const API = ({ headers = {}, params = {} } = {}): AxiosInstance => {
|
|
8
|
+
const user = getUser();
|
|
9
|
+
|
|
10
|
+
const BASE_URL = import.meta.env.VITE_APP_GLOBAL_SETTINGS_API;
|
|
11
|
+
|
|
12
|
+
const instance = axios.create({
|
|
13
|
+
baseURL: `${BASE_URL}/v1/global-settings`,
|
|
14
|
+
headers: {
|
|
15
|
+
'Content-type': 'application/json',
|
|
16
|
+
'Authorization': `Bearer ${user.token}`,
|
|
17
|
+
...headers,
|
|
18
|
+
},
|
|
19
|
+
params,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return instance;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const ColumnServices = {
|
|
26
|
+
getColumnSetup: (
|
|
27
|
+
tableId: string,
|
|
28
|
+
): Promise<AxiosResponse<{ data: DataTableColumnConfig[] }>> => {
|
|
29
|
+
const user = getUser();
|
|
30
|
+
return API().get(`/columns/${user._id}/${tableId}`);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
editColumnSetup: (
|
|
34
|
+
tableId: string,
|
|
35
|
+
body: DataTableColumnConfig[],
|
|
36
|
+
): Promise<AxiosResponse> => {
|
|
37
|
+
const user = getUser();
|
|
38
|
+
return API().put(`/columns/${user._id}/${tableId}`, { data: body });
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default ColumnServices;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ShortFetchResponse } from '@/components/v2/DataTable/DataTable.vue.d';
|
|
2
|
+
import {
|
|
3
|
+
CustomField,
|
|
4
|
+
DepreciationCategory,
|
|
5
|
+
} from '@/types/settingsAttribute.type';
|
|
6
|
+
import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
7
|
+
|
|
8
|
+
const API = ({ headers = {}, params = {} } = {}): AxiosInstance => {
|
|
9
|
+
const user = JSON.parse(localStorage.getItem('user') ?? '{}');
|
|
10
|
+
const BASE_URL = import.meta.env.VITE_APP_TAGSAMURAI_API;
|
|
11
|
+
|
|
12
|
+
const instance = axios.create({
|
|
13
|
+
baseURL: `${BASE_URL}/settings-attribute/v2`,
|
|
14
|
+
headers: {
|
|
15
|
+
'Content-type': 'application/json',
|
|
16
|
+
'Authorization': `Bearer ${user.token}`,
|
|
17
|
+
...headers,
|
|
18
|
+
},
|
|
19
|
+
params,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return instance;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const SettingsAttributeServices = {
|
|
26
|
+
getGeneralCustomFields: (): Promise<
|
|
27
|
+
AxiosResponse<ShortFetchResponse<CustomField[]>>
|
|
28
|
+
> => {
|
|
29
|
+
return API({ params: { type: 'General Information' } }).get(
|
|
30
|
+
'/custom-field/used-by-assets',
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
getDepreciationCategory: (): Promise<
|
|
35
|
+
AxiosResponse<ShortFetchResponse<DepreciationCategory[]>>
|
|
36
|
+
> => {
|
|
37
|
+
return API().get('/depreciation-category');
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default SettingsAttributeServices;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface DataTableStore {
|
|
2
|
-
/**
|
|
3
|
-
* Get the config object from the store.
|
|
4
|
-
*/
|
|
5
|
-
config: DataTableConfig;
|
|
6
|
-
/**
|
|
7
|
-
* Update config for specific Table.
|
|
8
|
-
*
|
|
9
|
-
* @param id The table ID
|
|
10
|
-
* @param columnsConfig The columns configuration
|
|
11
|
-
*/
|
|
12
|
-
setConfig: (id: string, columnsConfig: DataTableColumnConfig[]) => Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export type DataTableConfig = Record<string, DataTableColumnConfig[]>;
|
|
15
|
-
export interface DataTableColumnConfig {
|
|
16
|
-
field: string;
|
|
17
|
-
width: number | string;
|
|
18
|
-
fixed: boolean;
|
|
19
|
-
visible: boolean;
|
|
20
|
-
}
|
|
21
|
-
declare const useDataTableStore: () => Promise<DataTableStore>;
|
|
22
|
-
export default useDataTableStore;
|