shared-ritm 1.3.96 → 1.3.98
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/README.md +103 -103
- package/dist/index.css +1 -1
- package/dist/shared-ritm.es.js +24 -23
- package/dist/shared-ritm.umd.js +3 -3
- package/dist/types/api/services/InstrumentsService.d.ts +5 -1
- package/dist/types/api/types/Api_Instruments.d.ts +4 -0
- package/package.json +1 -1
- package/src/api/services/BrigadesService.ts +32 -32
- package/src/api/services/CommentsService.ts +24 -24
- package/src/api/services/FileService.ts +17 -17
- package/src/api/services/GanttService.ts +47 -47
- package/src/api/services/InstrumentsService.ts +72 -68
- package/src/api/services/ModulesService.ts +27 -27
- package/src/api/services/ProjectsService.ts +83 -83
- package/src/api/services/ScheduleService.ts +69 -69
- package/src/api/services/SearchService.ts +22 -22
- package/src/api/services/TasksService.ts +157 -157
- package/src/api/settings/ApiService.ts +184 -185
- package/src/api/types/Api_Brigades.ts +36 -36
- package/src/api/types/Api_Comment.ts +40 -40
- package/src/api/types/Api_Files.ts +7 -7
- package/src/api/types/Api_Instruments.ts +161 -156
- package/src/api/types/Api_Modules.ts +21 -21
- package/src/api/types/Api_Projects.ts +62 -62
- package/src/api/types/Api_Schedule.ts +64 -64
- package/src/api/types/Api_Service.ts +9 -9
- package/src/common/app-button/AppButton.vue +173 -173
- package/src/common/app-date-picker/AppDatePicker.vue +81 -81
- package/src/common/app-datepicker/AppDatepicker.vue +218 -218
- package/src/common/app-dropdown/AppDropdown.vue +37 -37
- package/src/common/app-file/AppFile.vue +80 -80
- package/src/common/app-input/AppInput.vue +150 -150
- package/src/common/app-input-search/AppInputSearch.vue +174 -174
- package/src/common/app-layout/AppLayout.vue +84 -84
- package/src/common/app-layout/components/AppLayoutPage.vue +16 -16
- package/src/common/app-loader/index.vue +43 -43
- package/src/common/app-page-layout/AppPageLayout.vue +122 -122
- package/src/common/app-sheet/AppSheet.vue +120 -120
- package/src/common/app-sheet-new/AppSheetNew.vue +244 -244
- package/src/common/app-sidebar/components/SidebarMenu.vue +37 -37
- package/src/common/app-sidebar/components/SidebarMenuItem.vue +149 -149
- package/src/common/app-table/AppTableLayout.vue +137 -137
- package/src/common/app-table/components/TablePagination.vue +152 -152
- package/src/common/app-table/components/TableSearch.vue +76 -76
- package/src/common/app-table/controllers/useBaseTable.ts +45 -45
- package/src/global.d.ts +1 -1
- package/src/icons/components/arrow-down-icon.vue +25 -25
- package/src/icons/components/arrow-frame-icon.vue +19 -19
- package/src/icons/components/arrow-square.vue +22 -22
- package/src/icons/components/table-filter-icon.vue +30 -30
- package/src/icons/dialogs/RemoveIcon.vue +12 -12
- package/src/icons/dialogs/SafetyIcon.vue +12 -12
- package/src/icons/header/NotificationIcon.vue +18 -18
- package/src/icons/header/PersonIcon.vue +11 -11
- package/src/icons/header/SettingIcon.vue +14 -14
- package/src/icons/header/flashIcon.vue +24 -24
- package/src/icons/header/searchStatusIcon.vue +24 -24
- package/src/icons/header/smallCapsIcon.vue +34 -34
- package/src/icons/sidebar/assign-module-icon.vue +36 -36
- package/src/icons/sidebar/instrument-history-icon.vue +32 -32
- package/src/icons/sidebar/instrument-order-icon.vue +38 -38
- package/src/icons/sidebar/instrument-work-zone-icon.vue +18 -18
- package/src/icons/sidebar/instruments-icon.vue +45 -45
- package/src/icons/sidebar/logo-icon.vue +15 -15
- package/src/icons/sidebar/logout-icon.vue +13 -13
- package/src/icons/sidebar/modules-icon.vue +16 -16
- package/src/icons/sidebar/notifications-icon.vue +24 -24
- package/src/icons/sidebar/order-icon.vue +44 -44
- package/src/icons/sidebar/pass-icon.vue +38 -38
- package/src/icons/sidebar/positions-icon.vue +42 -42
- package/src/icons/sidebar/preorder-icon.vue +19 -19
- package/src/icons/sidebar/projects-icon.vue +31 -31
- package/src/icons/sidebar/repair-object-icon.vue +18 -18
- package/src/icons/sidebar/repairs-icon.vue +20 -20
- package/src/icons/sidebar/roles-icon.vue +26 -26
- package/src/icons/sidebar/status-history-icon.vue +24 -24
- package/src/icons/sidebar/tasks-icon.vue +28 -28
- package/src/icons/sidebar/tasks_tasks-icon.vue +39 -39
- package/src/icons/sidebar/tasks_today-icon.vue +27 -27
- package/src/icons/sidebar/teams-icon.vue +32 -32
- package/src/icons/sidebar/user-icon.vue +18 -18
- package/src/icons/sidebar/users-icon.vue +46 -46
- package/src/icons/sidebar/videosources-icon.vue +19 -19
- package/src/icons/sidebar/videowall-icon.vue +13 -13
- package/src/icons/sidebar/videozones-icon.vue +21 -21
- package/src/icons/sidebar/warehouses-icon.vue +43 -43
- package/src/icons/sidebar/workshop-icon.vue +100 -100
- package/src/icons/sidebar/workzones-icon.vue +22 -22
- package/src/icons/task/attention-icon.vue +13 -13
- package/src/icons/task/clock-icon.vue +10 -10
- package/src/icons/task/delete-icon.vue +10 -10
- package/src/icons/task/fire-icon.vue +16 -16
- package/src/main.ts +28 -28
- package/src/quasar-user-options.ts +17 -17
- package/src/router/index.ts +10 -10
- package/src/shims-vue.d.ts +5 -5
- package/src/utils/confirm.ts +12 -12
- package/src/utils/faceApiHelper.ts +132 -132
- package/src/utils/notification.ts +9 -9
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="table-pagination">
|
|
3
|
-
<button class="arrow-button" :disabled="modelValue <= 1" @click="prevPage">
|
|
4
|
-
<q-icon name="mdi-chevron-left" :color="modelValue <= 1 ? 'grey-4' : 'primary'" />
|
|
5
|
-
</button>
|
|
6
|
-
|
|
7
|
-
<div class="pages">
|
|
8
|
-
<button
|
|
9
|
-
v-for="page in pageArray"
|
|
10
|
-
:key="page"
|
|
11
|
-
class="page-button"
|
|
12
|
-
:class="{ selected: page === modelValue, ellipsis: page === '...' }"
|
|
13
|
-
:disabled="page === modelValue || page === '...'"
|
|
14
|
-
@click="changePage(page)"
|
|
15
|
-
>
|
|
16
|
-
{{ page }}
|
|
17
|
-
</button>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<button class="arrow-button" :disabled="modelValue >= totalPages" @click="nextPage">
|
|
21
|
-
<q-icon name="mdi-chevron-right" :color="modelValue >= totalPages ? 'grey-4' : 'primary'" />
|
|
22
|
-
</button>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
<script setup lang="ts">
|
|
26
|
-
import { computed } from 'vue'
|
|
27
|
-
import { defineProps, defineEmits } from 'vue'
|
|
28
|
-
|
|
29
|
-
const props = defineProps<{
|
|
30
|
-
modelValue: number
|
|
31
|
-
totalPages: number
|
|
32
|
-
}>()
|
|
33
|
-
|
|
34
|
-
const emit = defineEmits<{
|
|
35
|
-
(e: 'update:modelValue', value: number): void
|
|
36
|
-
(e: 'page-change', value: number): void
|
|
37
|
-
}>()
|
|
38
|
-
|
|
39
|
-
const currentPage = computed({
|
|
40
|
-
get: () => props.modelValue,
|
|
41
|
-
set: (val: number) => {
|
|
42
|
-
emit('update:modelValue', val)
|
|
43
|
-
emit('page-change', val)
|
|
44
|
-
},
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
const pageArray = computed(() => {
|
|
48
|
-
const maxPagesToShow = 5
|
|
49
|
-
let startPage = 1
|
|
50
|
-
let endPage = props.totalPages
|
|
51
|
-
const pages: (number | string)[] = []
|
|
52
|
-
|
|
53
|
-
if (props.totalPages <= maxPagesToShow) {
|
|
54
|
-
for (let i = 1; i <= props.totalPages; i++) pages.push(i)
|
|
55
|
-
} else {
|
|
56
|
-
if (props.modelValue <= 3) {
|
|
57
|
-
startPage = 1
|
|
58
|
-
endPage = maxPagesToShow - 1
|
|
59
|
-
} else if (props.modelValue + 2 >= props.totalPages) {
|
|
60
|
-
startPage = props.totalPages - (maxPagesToShow - 2)
|
|
61
|
-
endPage = props.totalPages
|
|
62
|
-
} else {
|
|
63
|
-
startPage = props.modelValue - 2
|
|
64
|
-
endPage = props.modelValue + 2
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
for (let i = startPage; i <= endPage; i++) pages.push(i)
|
|
68
|
-
|
|
69
|
-
if (startPage > 1) {
|
|
70
|
-
pages.unshift('...')
|
|
71
|
-
pages.unshift(1)
|
|
72
|
-
}
|
|
73
|
-
if (endPage < props.totalPages) {
|
|
74
|
-
pages.push('...')
|
|
75
|
-
pages.push(props.totalPages)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return pages
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
function changePage(page: number | string) {
|
|
83
|
-
if (typeof page === 'number' && page !== props.modelValue) {
|
|
84
|
-
currentPage.value = page
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function prevPage() {
|
|
89
|
-
if (props.modelValue > 1) currentPage.value = props.modelValue - 1
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function nextPage() {
|
|
93
|
-
if (props.modelValue < props.totalPages) currentPage.value = props.modelValue + 1
|
|
94
|
-
}
|
|
95
|
-
</script>
|
|
96
|
-
|
|
97
|
-
<style scoped lang="scss">
|
|
98
|
-
.pages {
|
|
99
|
-
display: flex;
|
|
100
|
-
gap: 20px;
|
|
101
|
-
}
|
|
102
|
-
.table-pagination {
|
|
103
|
-
display: flex;
|
|
104
|
-
justify-content: start;
|
|
105
|
-
align-items: center;
|
|
106
|
-
gap: 20px;
|
|
107
|
-
flex-wrap: wrap;
|
|
108
|
-
|
|
109
|
-
.arrow-button,
|
|
110
|
-
.page-button {
|
|
111
|
-
display: flex;
|
|
112
|
-
justify-content: center;
|
|
113
|
-
align-items: center;
|
|
114
|
-
width: 34px;
|
|
115
|
-
height: 34px;
|
|
116
|
-
border-radius: 4px;
|
|
117
|
-
background: white;
|
|
118
|
-
border: none;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
font-weight: 500;
|
|
121
|
-
color: #3f8cff;
|
|
122
|
-
font-size: 16px;
|
|
123
|
-
transition: all 0.2s ease;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.page-button.selected {
|
|
127
|
-
background: #3f8cff;
|
|
128
|
-
color: white;
|
|
129
|
-
cursor: not-allowed;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.page-button.ellipsis {
|
|
133
|
-
cursor: default;
|
|
134
|
-
color: #aab2c8;
|
|
135
|
-
font-weight: 400;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.arrow-button:disabled {
|
|
139
|
-
cursor: not-allowed;
|
|
140
|
-
background: white;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@media (max-width: 768px) {
|
|
144
|
-
.arrow-button,
|
|
145
|
-
.page-button {
|
|
146
|
-
width: 32px;
|
|
147
|
-
height: 32px;
|
|
148
|
-
font-size: 14px;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-pagination">
|
|
3
|
+
<button class="arrow-button" :disabled="modelValue <= 1" @click="prevPage">
|
|
4
|
+
<q-icon name="mdi-chevron-left" :color="modelValue <= 1 ? 'grey-4' : 'primary'" />
|
|
5
|
+
</button>
|
|
6
|
+
|
|
7
|
+
<div class="pages">
|
|
8
|
+
<button
|
|
9
|
+
v-for="page in pageArray"
|
|
10
|
+
:key="page"
|
|
11
|
+
class="page-button"
|
|
12
|
+
:class="{ selected: page === modelValue, ellipsis: page === '...' }"
|
|
13
|
+
:disabled="page === modelValue || page === '...'"
|
|
14
|
+
@click="changePage(page)"
|
|
15
|
+
>
|
|
16
|
+
{{ page }}
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<button class="arrow-button" :disabled="modelValue >= totalPages" @click="nextPage">
|
|
21
|
+
<q-icon name="mdi-chevron-right" :color="modelValue >= totalPages ? 'grey-4' : 'primary'" />
|
|
22
|
+
</button>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { computed } from 'vue'
|
|
27
|
+
import { defineProps, defineEmits } from 'vue'
|
|
28
|
+
|
|
29
|
+
const props = defineProps<{
|
|
30
|
+
modelValue: number
|
|
31
|
+
totalPages: number
|
|
32
|
+
}>()
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<{
|
|
35
|
+
(e: 'update:modelValue', value: number): void
|
|
36
|
+
(e: 'page-change', value: number): void
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const currentPage = computed({
|
|
40
|
+
get: () => props.modelValue,
|
|
41
|
+
set: (val: number) => {
|
|
42
|
+
emit('update:modelValue', val)
|
|
43
|
+
emit('page-change', val)
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const pageArray = computed(() => {
|
|
48
|
+
const maxPagesToShow = 5
|
|
49
|
+
let startPage = 1
|
|
50
|
+
let endPage = props.totalPages
|
|
51
|
+
const pages: (number | string)[] = []
|
|
52
|
+
|
|
53
|
+
if (props.totalPages <= maxPagesToShow) {
|
|
54
|
+
for (let i = 1; i <= props.totalPages; i++) pages.push(i)
|
|
55
|
+
} else {
|
|
56
|
+
if (props.modelValue <= 3) {
|
|
57
|
+
startPage = 1
|
|
58
|
+
endPage = maxPagesToShow - 1
|
|
59
|
+
} else if (props.modelValue + 2 >= props.totalPages) {
|
|
60
|
+
startPage = props.totalPages - (maxPagesToShow - 2)
|
|
61
|
+
endPage = props.totalPages
|
|
62
|
+
} else {
|
|
63
|
+
startPage = props.modelValue - 2
|
|
64
|
+
endPage = props.modelValue + 2
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for (let i = startPage; i <= endPage; i++) pages.push(i)
|
|
68
|
+
|
|
69
|
+
if (startPage > 1) {
|
|
70
|
+
pages.unshift('...')
|
|
71
|
+
pages.unshift(1)
|
|
72
|
+
}
|
|
73
|
+
if (endPage < props.totalPages) {
|
|
74
|
+
pages.push('...')
|
|
75
|
+
pages.push(props.totalPages)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return pages
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
function changePage(page: number | string) {
|
|
83
|
+
if (typeof page === 'number' && page !== props.modelValue) {
|
|
84
|
+
currentPage.value = page
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function prevPage() {
|
|
89
|
+
if (props.modelValue > 1) currentPage.value = props.modelValue - 1
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function nextPage() {
|
|
93
|
+
if (props.modelValue < props.totalPages) currentPage.value = props.modelValue + 1
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style scoped lang="scss">
|
|
98
|
+
.pages {
|
|
99
|
+
display: flex;
|
|
100
|
+
gap: 20px;
|
|
101
|
+
}
|
|
102
|
+
.table-pagination {
|
|
103
|
+
display: flex;
|
|
104
|
+
justify-content: start;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: 20px;
|
|
107
|
+
flex-wrap: wrap;
|
|
108
|
+
|
|
109
|
+
.arrow-button,
|
|
110
|
+
.page-button {
|
|
111
|
+
display: flex;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
align-items: center;
|
|
114
|
+
width: 34px;
|
|
115
|
+
height: 34px;
|
|
116
|
+
border-radius: 4px;
|
|
117
|
+
background: white;
|
|
118
|
+
border: none;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
font-weight: 500;
|
|
121
|
+
color: #3f8cff;
|
|
122
|
+
font-size: 16px;
|
|
123
|
+
transition: all 0.2s ease;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.page-button.selected {
|
|
127
|
+
background: #3f8cff;
|
|
128
|
+
color: white;
|
|
129
|
+
cursor: not-allowed;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.page-button.ellipsis {
|
|
133
|
+
cursor: default;
|
|
134
|
+
color: #aab2c8;
|
|
135
|
+
font-weight: 400;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.arrow-button:disabled {
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
background: white;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (max-width: 768px) {
|
|
144
|
+
.arrow-button,
|
|
145
|
+
.page-button {
|
|
146
|
+
width: 32px;
|
|
147
|
+
height: 32px;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</style>
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-input v-model="input" :placeholder="placeholder" dense outlined>
|
|
3
|
-
<template v-if="input" #append>
|
|
4
|
-
<q-icon name="✕" class="cursor-pointer" @click.stop="clearInput" />
|
|
5
|
-
</template>
|
|
6
|
-
</q-input>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
import { defineProps, defineEmits, ref, watch } from 'vue'
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
modelValue: string
|
|
14
|
-
placeholder: string
|
|
15
|
-
}>()
|
|
16
|
-
|
|
17
|
-
const emit = defineEmits<{
|
|
18
|
-
(e: 'update:modelValue', value: string): void
|
|
19
|
-
(e: 'search', value: string): void
|
|
20
|
-
}>()
|
|
21
|
-
|
|
22
|
-
const input = ref(props.modelValue)
|
|
23
|
-
let debounceTimer: ReturnType<typeof setTimeout>
|
|
24
|
-
const clearInput = () => {
|
|
25
|
-
input.value = ''
|
|
26
|
-
emit('search', '')
|
|
27
|
-
}
|
|
28
|
-
watch(
|
|
29
|
-
() => props.modelValue,
|
|
30
|
-
val => {
|
|
31
|
-
input.value = val
|
|
32
|
-
},
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
watch(input, val => {
|
|
36
|
-
emit('update:modelValue', val)
|
|
37
|
-
clearTimeout(debounceTimer)
|
|
38
|
-
debounceTimer = setTimeout(() => {
|
|
39
|
-
emit('search', val)
|
|
40
|
-
}, 400)
|
|
41
|
-
})
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<style scoped lang="scss">
|
|
45
|
-
.q-field {
|
|
46
|
-
background: #fff;
|
|
47
|
-
border-radius: 4px;
|
|
48
|
-
outline: none;
|
|
49
|
-
border-color: #f2f7fb;
|
|
50
|
-
|
|
51
|
-
::v-deep(.q-field__control) {
|
|
52
|
-
height: 52px;
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
::v-deep(.q-field__native) {
|
|
58
|
-
font-family: NunitoSansFont, sans-serif;
|
|
59
|
-
color: #1d425d;
|
|
60
|
-
padding-left: 8px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
::v-deep(.q-field__native::placeholder) {
|
|
64
|
-
color: rgba(184, 184, 184, 0.87);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
::v-deep(.q-icon.cursor-pointer) {
|
|
68
|
-
color: #1d425d;
|
|
69
|
-
font-size: 20px;
|
|
70
|
-
line-height: 15px;
|
|
71
|
-
}
|
|
72
|
-
::v-deep(.q-field__control:hover:before) {
|
|
73
|
-
border-color: #3f8cff;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<q-input v-model="input" :placeholder="placeholder" dense outlined>
|
|
3
|
+
<template v-if="input" #append>
|
|
4
|
+
<q-icon name="✕" class="cursor-pointer" @click.stop="clearInput" />
|
|
5
|
+
</template>
|
|
6
|
+
</q-input>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { defineProps, defineEmits, ref, watch } from 'vue'
|
|
11
|
+
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
modelValue: string
|
|
14
|
+
placeholder: string
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits<{
|
|
18
|
+
(e: 'update:modelValue', value: string): void
|
|
19
|
+
(e: 'search', value: string): void
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const input = ref(props.modelValue)
|
|
23
|
+
let debounceTimer: ReturnType<typeof setTimeout>
|
|
24
|
+
const clearInput = () => {
|
|
25
|
+
input.value = ''
|
|
26
|
+
emit('search', '')
|
|
27
|
+
}
|
|
28
|
+
watch(
|
|
29
|
+
() => props.modelValue,
|
|
30
|
+
val => {
|
|
31
|
+
input.value = val
|
|
32
|
+
},
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
watch(input, val => {
|
|
36
|
+
emit('update:modelValue', val)
|
|
37
|
+
clearTimeout(debounceTimer)
|
|
38
|
+
debounceTimer = setTimeout(() => {
|
|
39
|
+
emit('search', val)
|
|
40
|
+
}, 400)
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped lang="scss">
|
|
45
|
+
.q-field {
|
|
46
|
+
background: #fff;
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
outline: none;
|
|
49
|
+
border-color: #f2f7fb;
|
|
50
|
+
|
|
51
|
+
::v-deep(.q-field__control) {
|
|
52
|
+
height: 52px;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
::v-deep(.q-field__native) {
|
|
58
|
+
font-family: NunitoSansFont, sans-serif;
|
|
59
|
+
color: #1d425d;
|
|
60
|
+
padding-left: 8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
::v-deep(.q-field__native::placeholder) {
|
|
64
|
+
color: rgba(184, 184, 184, 0.87);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
::v-deep(.q-icon.cursor-pointer) {
|
|
68
|
+
color: #1d425d;
|
|
69
|
+
font-size: 20px;
|
|
70
|
+
line-height: 15px;
|
|
71
|
+
}
|
|
72
|
+
::v-deep(.q-field__control:hover:before) {
|
|
73
|
+
border-color: #3f8cff;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { ref, watch, onMounted, Ref } from 'vue'
|
|
2
|
-
|
|
3
|
-
export function useBaseTable(model: {
|
|
4
|
-
initialize: (params: { search: string; page: number }) => Promise<void>
|
|
5
|
-
loading: Ref<boolean>
|
|
6
|
-
columnFilters: Ref<Record<string, any>>
|
|
7
|
-
}) {
|
|
8
|
-
const search = ref('')
|
|
9
|
-
const currentPage = ref(1)
|
|
10
|
-
|
|
11
|
-
const loadTable = async (searchVal = '', pageVal = 1) => {
|
|
12
|
-
await model.initialize({ search: searchVal, page: pageVal })
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const handleSearch = async (val: string) => {
|
|
16
|
-
search.value = val
|
|
17
|
-
currentPage.value = 1
|
|
18
|
-
await loadTable(val, currentPage.value)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const handlePageChange = async (page: number) => {
|
|
22
|
-
currentPage.value = page
|
|
23
|
-
await loadTable(search.value, page)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
watch(
|
|
27
|
-
() => model.columnFilters.value,
|
|
28
|
-
async () => {
|
|
29
|
-
currentPage.value = 1
|
|
30
|
-
await loadTable(search.value, currentPage.value)
|
|
31
|
-
},
|
|
32
|
-
{ deep: true },
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
onMounted(() => loadTable(search.value, currentPage.value))
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
search,
|
|
39
|
-
currentPage,
|
|
40
|
-
loading: model.loading,
|
|
41
|
-
handleSearch,
|
|
42
|
-
handlePageChange,
|
|
43
|
-
loadTable,
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
import { ref, watch, onMounted, Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
export function useBaseTable(model: {
|
|
4
|
+
initialize: (params: { search: string; page: number }) => Promise<void>
|
|
5
|
+
loading: Ref<boolean>
|
|
6
|
+
columnFilters: Ref<Record<string, any>>
|
|
7
|
+
}) {
|
|
8
|
+
const search = ref('')
|
|
9
|
+
const currentPage = ref(1)
|
|
10
|
+
|
|
11
|
+
const loadTable = async (searchVal = '', pageVal = 1) => {
|
|
12
|
+
await model.initialize({ search: searchVal, page: pageVal })
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const handleSearch = async (val: string) => {
|
|
16
|
+
search.value = val
|
|
17
|
+
currentPage.value = 1
|
|
18
|
+
await loadTable(val, currentPage.value)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const handlePageChange = async (page: number) => {
|
|
22
|
+
currentPage.value = page
|
|
23
|
+
await loadTable(search.value, page)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
watch(
|
|
27
|
+
() => model.columnFilters.value,
|
|
28
|
+
async () => {
|
|
29
|
+
currentPage.value = 1
|
|
30
|
+
await loadTable(search.value, currentPage.value)
|
|
31
|
+
},
|
|
32
|
+
{ deep: true },
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
onMounted(() => loadTable(search.value, currentPage.value))
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
search,
|
|
39
|
+
currentPage,
|
|
40
|
+
loading: model.loading,
|
|
41
|
+
handleSearch,
|
|
42
|
+
handlePageChange,
|
|
43
|
+
loadTable,
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/global.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
declare module 'shared-ritm'
|
|
1
|
+
declare module 'shared-ritm'
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'ArrowDownIcon',
|
|
4
|
-
}
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
9
|
-
<path
|
|
10
|
-
d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z"
|
|
11
|
-
stroke="#3F8CFF"
|
|
12
|
-
stroke-width="1.5"
|
|
13
|
-
stroke-miterlimit="10"
|
|
14
|
-
stroke-linecap="round"
|
|
15
|
-
stroke-linejoin="round"
|
|
16
|
-
/>
|
|
17
|
-
<path
|
|
18
|
-
d="M15.53 10.74L12 14.26L8.47003 10.74"
|
|
19
|
-
stroke="#3F8CFF"
|
|
20
|
-
stroke-width="1.5"
|
|
21
|
-
stroke-linecap="round"
|
|
22
|
-
stroke-linejoin="round"
|
|
23
|
-
/>
|
|
24
|
-
</svg>
|
|
25
|
-
</template>
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'ArrowDownIcon',
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
9
|
+
<path
|
|
10
|
+
d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z"
|
|
11
|
+
stroke="#3F8CFF"
|
|
12
|
+
stroke-width="1.5"
|
|
13
|
+
stroke-miterlimit="10"
|
|
14
|
+
stroke-linecap="round"
|
|
15
|
+
stroke-linejoin="round"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
d="M15.53 10.74L12 14.26L8.47003 10.74"
|
|
19
|
+
stroke="#3F8CFF"
|
|
20
|
+
stroke-width="1.5"
|
|
21
|
+
stroke-linecap="round"
|
|
22
|
+
stroke-linejoin="round"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
</template>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
3
|
-
<path
|
|
4
|
-
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
|
|
5
|
-
stroke="currentStroke"
|
|
6
|
-
stroke-width="1.5"
|
|
7
|
-
stroke-miterlimit="10"
|
|
8
|
-
stroke-linecap="round"
|
|
9
|
-
stroke-linejoin="round"
|
|
10
|
-
/>
|
|
11
|
-
<path
|
|
12
|
-
d="M8.46997 13.26L12 9.73999L15.53 13.26"
|
|
13
|
-
stroke="currentStroke"
|
|
14
|
-
stroke-width="1.5"
|
|
15
|
-
stroke-linecap="round"
|
|
16
|
-
stroke-linejoin="round"
|
|
17
|
-
/>
|
|
18
|
-
</svg>
|
|
19
|
-
</template>
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
3
|
+
<path
|
|
4
|
+
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
|
|
5
|
+
stroke="currentStroke"
|
|
6
|
+
stroke-width="1.5"
|
|
7
|
+
stroke-miterlimit="10"
|
|
8
|
+
stroke-linecap="round"
|
|
9
|
+
stroke-linejoin="round"
|
|
10
|
+
/>
|
|
11
|
+
<path
|
|
12
|
+
d="M8.46997 13.26L12 9.73999L15.53 13.26"
|
|
13
|
+
stroke="currentStroke"
|
|
14
|
+
stroke-width="1.5"
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
stroke-linejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
</template>
|