@mythpe/quasar-ui-qui 0.1.12 → 0.1.13
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
|
@@ -282,12 +282,17 @@ const resetDialogs = () => {
|
|
|
282
282
|
/** Table */
|
|
283
283
|
|
|
284
284
|
/** --- */
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
const getHeaders = computed<any[]>(() => parseHeaders(toValue(props.headers), { noSort: props.imageColumns }) || [])
|
|
286
|
+
const visibleHeaders = ref<string[]>([])
|
|
287
|
+
watch([
|
|
288
|
+
() => toValue(props.visibleColumns),
|
|
289
|
+
() => toValue(props.headers)
|
|
290
|
+
], ([v]) => {
|
|
291
|
+
if (!v) {
|
|
292
|
+
v = toValue(getHeaders)
|
|
293
|
+
}
|
|
289
294
|
visibleHeaders.value = v ? parseHeaders(v).map(e => e.name) : []
|
|
290
|
-
}, { deep: !0 })
|
|
295
|
+
}, { deep: !0, immediate: !0 })
|
|
291
296
|
/** --- */
|
|
292
297
|
|
|
293
298
|
const selected = ref<MDtItem[]>([])
|
|
@@ -300,10 +305,18 @@ const onUpdateSelectedItems = () => {
|
|
|
300
305
|
const meta = ref<MDatatableMetaServer>({ ...initMetaServer })
|
|
301
306
|
const pagination = ref<MDatatablePagination>({ ...initPaginationOptions })
|
|
302
307
|
const search = ref<string | null>(null)
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
const searchColumnsRef = ref<string[]>([])
|
|
309
|
+
watch([
|
|
310
|
+
() => toValue(props.searchColumns),
|
|
311
|
+
() => toValue(props.headers)
|
|
312
|
+
], ([v]) => {
|
|
313
|
+
if (!v) {
|
|
314
|
+
v = toValue(getHeaders) as any
|
|
315
|
+
}
|
|
316
|
+
searchColumnsRef.value = parseHeaders(v as any)
|
|
317
|
+
.filter(e => e?.field !== props.controlKey)
|
|
318
|
+
.map(e => e.name)
|
|
319
|
+
}, { deep: !0, immediate: !0 })
|
|
307
320
|
const searchPlaceholder = computed<string>(() => {
|
|
308
321
|
if (searchColumnsRef.value.length > 0) {
|
|
309
322
|
return __('myth.datatable.searchInputPlaceholder',
|
|
@@ -478,12 +491,10 @@ const getDatatableParams = ({
|
|
|
478
491
|
pagination,
|
|
479
492
|
filter
|
|
480
493
|
}: FetchRowsArgs = {}, merge: Partial<ApiServiceParams> = {}): ApiServiceParams => {
|
|
494
|
+
const headerItems = getHeaders.value.map((e: any) => e.name).join(',')
|
|
495
|
+
// console.log(headerItems)
|
|
481
496
|
let params: ApiServiceParams = {
|
|
482
|
-
|
|
483
|
-
// search: filter || undefined,
|
|
484
|
-
headerItems: getHeaders.value.map((e: any) => e.name).join(','),
|
|
485
|
-
// headers: ['name'],
|
|
486
|
-
// ids: tableOptions.selected.map((e: any) => e.id),
|
|
497
|
+
headerItems,
|
|
487
498
|
indexType: 'index',
|
|
488
499
|
fdt: 'i',
|
|
489
500
|
itemsPerPage: pagination?.rowsPerPage === 0 ? -1 : (pagination?.rowsPerPage !== undefined ? pagination?.rowsPerPage : 0),
|
|
@@ -589,6 +600,7 @@ const exportData = (type: MDtExportOptions) => {
|
|
|
589
600
|
const ex = async () => {
|
|
590
601
|
loading.value = !0
|
|
591
602
|
const toBLob = exportToBlob.value === !0 || exportToBlob.value === type
|
|
603
|
+
const headerItems = getHeaders.value.filter(e => e?.field !== props.controlKey && visibleHeaders.value.indexOf(e.name) !== -1)
|
|
592
604
|
const data = getDatatableParams({
|
|
593
605
|
pagination: tableOptions.pagination,
|
|
594
606
|
filter: tableOptions.search
|
|
@@ -596,7 +608,7 @@ const exportData = (type: MDtExportOptions) => {
|
|
|
596
608
|
indexType: type,
|
|
597
609
|
fdt: 'e',
|
|
598
610
|
toUrl: toBLob === !0 ? !1 : exportToBlob.value !== type,
|
|
599
|
-
headerItems
|
|
611
|
+
headerItems
|
|
600
612
|
})
|
|
601
613
|
if (tableOptions.selected.length > 0) {
|
|
602
614
|
data.ids = tableOptions.selected.map((e: any) => e.id)
|