@tager/admin-export 1.0.0 → 1.0.2
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/dev/App.vue.d.ts +1 -1
- package/dist/index.mjs +39 -19
- package/dist/locales/en.d.ts +1 -0
- package/dist/typings/model.d.ts +1 -0
- package/dist/views/ExportForm/ExportForm.vue.d.ts +2503 -729
- package/dist/views/ExportList/ExportList.vue.d.ts +2 -2
- package/dist/views/ExportList/components/CellHistory/CellHistory.vue.d.ts +2 -2
- package/package.json +7 -6
- package/src/dev/config.ts +0 -1
- package/src/dev/main.ts +3 -0
- package/src/locales/en.ts +1 -0
- package/src/locales/ru.ts +1 -0
- package/src/typings/model.ts +1 -0
- package/src/views/ExportList/ExportList.vue +56 -41
- package/src/views/ExportList/components/CellHistory/CellHistory.helpers.ts +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ColumnDefinition } from
|
|
1
|
+
import { type ColumnDefinition } from '@tager/admin-ui';
|
|
2
2
|
import { ExportType } from '../../typings/model';
|
|
3
3
|
import { getExportFormUrl } from '../../utils/paths';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
@@ -12,5 +12,5 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
12
12
|
pageSize: import("vue").Ref<number>;
|
|
13
13
|
pageCount: import("vue").ComputedRef<number>;
|
|
14
14
|
pageNumber: import("vue").Ref<number>;
|
|
15
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
15
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
16
16
|
export default _default;
|
|
@@ -8,12 +8,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
};
|
|
9
9
|
}, {
|
|
10
10
|
dateTimeFormat: typeof dateTimeFormat;
|
|
11
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
11
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
12
|
history: {
|
|
13
13
|
type: PropType<HistoryType[]>;
|
|
14
14
|
default: () => never[];
|
|
15
15
|
};
|
|
16
16
|
}>>, {
|
|
17
17
|
history: HistoryType[];
|
|
18
|
-
}>;
|
|
18
|
+
}, {}>;
|
|
19
19
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tager/admin-export",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"path-to-regexp": "^6.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"pinia": "^2.1.7",
|
|
32
33
|
"@babel/core": "^7.17.9",
|
|
33
34
|
"@babel/eslint-parser": "^7.17.0",
|
|
34
35
|
"@rushstack/eslint-patch": "^1.1.2",
|
|
35
|
-
"@tager/admin-dynamic-field": "^1.
|
|
36
|
-
"@tager/admin-layout": "^1.0.
|
|
37
|
-
"@tager/admin-services": "^1.
|
|
38
|
-
"@tager/admin-ui": "^1.0.
|
|
36
|
+
"@tager/admin-dynamic-field": "^1.1.4",
|
|
37
|
+
"@tager/admin-layout": "^1.0.23",
|
|
38
|
+
"@tager/admin-services": "^1.1.17",
|
|
39
|
+
"@tager/admin-ui": "^1.0.120",
|
|
39
40
|
"@types/lodash.isequal": "^4.5.6",
|
|
40
41
|
"@types/lodash.pick": "^4.4.7",
|
|
41
42
|
"@types/node": "16.x",
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"sass-loader": "^12.6.0",
|
|
59
60
|
"typescript": "^4.6.3",
|
|
60
61
|
"vite": "^2.9.6",
|
|
61
|
-
"vue": "^3.
|
|
62
|
+
"vue": "^3.3.0",
|
|
62
63
|
"vue-router": "^4.0.14",
|
|
63
64
|
"vue-tsc": "^0.34.10"
|
|
64
65
|
},
|
package/src/dev/config.ts
CHANGED
package/src/dev/main.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createApp } from 'vue';
|
|
2
|
+
import { createPinia } from 'pinia';
|
|
2
3
|
|
|
3
4
|
import { configStore, i18n, i18nPlugin } from '@tager/admin-services';
|
|
4
5
|
import { createRouter } from '@tager/admin-layout';
|
|
@@ -25,9 +26,11 @@ const router = createRouter(
|
|
|
25
26
|
);
|
|
26
27
|
|
|
27
28
|
const app = createApp(App);
|
|
29
|
+
const pinia = createPinia();
|
|
28
30
|
|
|
29
31
|
app.use(router);
|
|
30
32
|
app.use(i18nPlugin);
|
|
33
|
+
app.use(pinia);
|
|
31
34
|
|
|
32
35
|
applyTranslations();
|
|
33
36
|
|
package/src/locales/en.ts
CHANGED
package/src/locales/ru.ts
CHANGED
package/src/typings/model.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Page
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
:title="$i18n.t('export:export')"
|
|
4
|
+
:header-buttons="[
|
|
5
5
|
{
|
|
6
6
|
text: $i18n.t('export:newExport'),
|
|
7
7
|
href: getExportFormUrl({ exportId: 'create' }),
|
|
@@ -9,50 +9,52 @@
|
|
|
9
9
|
]"
|
|
10
10
|
>
|
|
11
11
|
<DataTable
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
:column-defs="columnDefs"
|
|
13
|
+
:row-data="rowData"
|
|
14
|
+
:loading="isRowDataLoading"
|
|
15
|
+
:error-message="errorMessage"
|
|
16
|
+
:pagination="{
|
|
17
17
|
pageSize,
|
|
18
18
|
pageCount,
|
|
19
19
|
pageNumber,
|
|
20
20
|
disabled: isRowDataLoading,
|
|
21
21
|
}"
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
:use-search="false"
|
|
23
|
+
@change="handleChange"
|
|
24
24
|
>
|
|
25
25
|
<template #cell(history)="{ row }">
|
|
26
|
-
<CellHistory :history="row.history"/>
|
|
26
|
+
<CellHistory :history="row.history" />
|
|
27
27
|
</template>
|
|
28
28
|
</DataTable>
|
|
29
29
|
</Page>
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script lang="ts">
|
|
33
|
-
import {defineComponent, onMounted} from
|
|
34
|
-
|
|
35
|
-
import {
|
|
33
|
+
import { defineComponent, onMounted } from 'vue';
|
|
34
|
+
|
|
35
|
+
import { useI18n } from '@tager/admin-services';
|
|
36
|
+
import { Page } from '@tager/admin-layout';
|
|
36
37
|
import {
|
|
37
38
|
type ColumnDefinition,
|
|
38
39
|
DataTable,
|
|
39
40
|
useDataTable,
|
|
40
|
-
} from
|
|
41
|
+
} from '@tager/admin-ui';
|
|
41
42
|
|
|
42
|
-
import {getExportList} from '../../services/requests';
|
|
43
|
-
import {ExportType} from '../../typings/model';
|
|
44
|
-
import {getExportFormUrl} from '../../utils/paths';
|
|
43
|
+
import { getExportList } from '../../services/requests';
|
|
44
|
+
import { ExportType } from '../../typings/model';
|
|
45
|
+
import { getExportFormUrl } from '../../utils/paths';
|
|
45
46
|
|
|
46
|
-
import {CellHistory} from './components/CellHistory';
|
|
47
|
+
import { CellHistory } from './components/CellHistory';
|
|
47
48
|
|
|
48
49
|
export default defineComponent({
|
|
49
50
|
name: 'ExportList',
|
|
50
51
|
components: {
|
|
51
|
-
Page,
|
|
52
|
+
Page,
|
|
53
|
+
CellHistory,
|
|
52
54
|
DataTable,
|
|
53
55
|
},
|
|
54
56
|
setup() {
|
|
55
|
-
const {t} = useI18n();
|
|
57
|
+
const { t } = useI18n();
|
|
56
58
|
|
|
57
59
|
const {
|
|
58
60
|
fetchEntityList: fetchExportList,
|
|
@@ -66,10 +68,10 @@ export default defineComponent({
|
|
|
66
68
|
pageNumber,
|
|
67
69
|
} = useDataTable<ExportType>({
|
|
68
70
|
fetchEntityList: (params) =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
getExportList({
|
|
72
|
+
pageNumber: params.pageNumber,
|
|
73
|
+
pageSize: params.pageSize,
|
|
74
|
+
}),
|
|
73
75
|
initialValue: [],
|
|
74
76
|
resourceName: 'Export list',
|
|
75
77
|
pageSize: 100,
|
|
@@ -84,43 +86,56 @@ export default defineComponent({
|
|
|
84
86
|
id: 1,
|
|
85
87
|
name: 'ID',
|
|
86
88
|
field: 'id',
|
|
87
|
-
|
|
88
|
-
headStyle: {width: '50px', textAlign: 'center'},
|
|
89
|
+
width: '50px',
|
|
89
90
|
},
|
|
90
91
|
{
|
|
91
92
|
id: 2,
|
|
92
|
-
name: t('export:
|
|
93
|
-
field: '
|
|
94
|
-
|
|
95
|
-
headStyle: {width: '15%'},
|
|
93
|
+
name: t('export:status'),
|
|
94
|
+
field: 'status',
|
|
95
|
+
width: '120px',
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
id: 3,
|
|
99
|
-
name: t('export:
|
|
100
|
-
field: '
|
|
101
|
-
|
|
102
|
-
headStyle: {width: '15%'},
|
|
99
|
+
name: t('export:type'),
|
|
100
|
+
field: 'strategy',
|
|
101
|
+
width: '150px',
|
|
103
102
|
},
|
|
104
103
|
{
|
|
105
104
|
id: 4,
|
|
105
|
+
name: t('export:params'),
|
|
106
|
+
field: 'params',
|
|
107
|
+
type: 'key-value',
|
|
108
|
+
format: ({ row }) => {
|
|
109
|
+
const result: any[] = [];
|
|
110
|
+
|
|
111
|
+
Object.keys(row.params).forEach((param) => {
|
|
112
|
+
result.push({
|
|
113
|
+
key: param,
|
|
114
|
+
value: row.params[param],
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return result;
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 5,
|
|
106
123
|
name: t('export:message'),
|
|
107
124
|
field: 'message',
|
|
125
|
+
width: '200px',
|
|
108
126
|
},
|
|
109
|
-
|
|
110
127
|
{
|
|
111
|
-
id:
|
|
128
|
+
id: 6,
|
|
112
129
|
name: t('export:log'),
|
|
113
130
|
field: 'history',
|
|
114
|
-
|
|
115
|
-
headStyle: {width: '25%'},
|
|
131
|
+
width: '300px',
|
|
116
132
|
},
|
|
117
133
|
{
|
|
118
|
-
id:
|
|
134
|
+
id: 7,
|
|
119
135
|
name: t('export:file'),
|
|
120
136
|
field: 'file',
|
|
121
137
|
type: 'file',
|
|
122
|
-
|
|
123
|
-
headStyle: {width: '150px', textAlign: 'center'},
|
|
138
|
+
width: '100px',
|
|
124
139
|
},
|
|
125
140
|
];
|
|
126
141
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export function dateTimeFormat(value: number | string | Date): string {
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const date = new Date(value);
|
|
3
|
+
|
|
4
|
+
return new Intl.DateTimeFormat('ru-RU', {
|
|
5
|
+
year: 'numeric',
|
|
4
6
|
month: 'numeric',
|
|
5
7
|
day: 'numeric',
|
|
6
8
|
hour: 'numeric',
|
|
7
9
|
minute: 'numeric',
|
|
8
|
-
second: 'numeric'
|
|
9
|
-
};
|
|
10
|
-
const date = new Date(value);
|
|
11
|
-
return new Intl.DateTimeFormat('ru-RU', options).format(date);
|
|
10
|
+
second: 'numeric',
|
|
11
|
+
}).format(date);
|
|
12
12
|
}
|