@tager/admin-export 1.0.1 → 1.0.3

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,4 +1,4 @@
1
- import { type ColumnDefinition } from "@tager/admin-ui";
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, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
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, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
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.1",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",
@@ -32,10 +32,10 @@
32
32
  "@babel/core": "^7.17.9",
33
33
  "@babel/eslint-parser": "^7.17.0",
34
34
  "@rushstack/eslint-patch": "^1.1.2",
35
- "@tager/admin-dynamic-field": "^1.0.0",
36
- "@tager/admin-layout": "^1.0.0",
37
- "@tager/admin-services": "^1.0.0",
38
- "@tager/admin-ui": "^1.0.1",
35
+ "@tager/admin-dynamic-field": "^1.1.4",
36
+ "@tager/admin-layout": "^1.0.23",
37
+ "@tager/admin-services": "^1.1.17",
38
+ "@tager/admin-ui": "^1.0.122",
39
39
  "@types/lodash.isequal": "^4.5.6",
40
40
  "@types/lodash.pick": "^4.4.7",
41
41
  "@types/node": "16.x",
@@ -54,11 +54,12 @@
54
54
  "eslint-plugin-import": "^2.26.0",
55
55
  "eslint-plugin-prettier": "^4.0.0",
56
56
  "eslint-plugin-vue": "^8.7.1",
57
+ "pinia": "^2.1.7",
57
58
  "sass": "^1.51.0",
58
59
  "sass-loader": "^12.6.0",
59
60
  "typescript": "^4.6.3",
60
61
  "vite": "^2.9.6",
61
- "vue": "^3.2.31",
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
@@ -16,7 +16,6 @@ export const OZITAG_CONFIG: AppConfigType = {
16
16
  subtitle: '',
17
17
  },
18
18
  SPLASH_SCREEN: {
19
- enabled: true,
20
19
  logo: 'logo-white.svg',
21
20
  background: '#1e1e1e',
22
21
  },
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
@@ -4,6 +4,7 @@ export const EN = {
4
4
  exportList: 'Export List',
5
5
  exportForm: 'Export Form',
6
6
  type: 'Type',
7
+ params: 'Params',
7
8
  exportType: 'Export type',
8
9
  status: 'status',
9
10
  message: 'Message',
package/src/locales/ru.ts CHANGED
@@ -6,6 +6,7 @@ export const RU: typeof EN = {
6
6
  exportList: 'Список экспортов',
7
7
  exportForm: 'Форма экспорта',
8
8
  type: 'Тип',
9
+ params: 'Параметры',
9
10
  exportType: 'Тип экспорта',
10
11
  status: 'Статус',
11
12
  message: 'Сообщение',
@@ -17,6 +17,7 @@ export interface ExportType {
17
17
  readonly message: string | null;
18
18
  readonly history: Array<HistoryType>;
19
19
  readonly file: FileType | null;
20
+ readonly params: Record<string, string>;
20
21
  }
21
22
 
22
23
  export interface StrategyType {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <Page
3
- :title="$i18n.t('export:export')"
4
- :header-buttons="[
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
- :column-defs="columnDefs"
13
- :row-data="rowData"
14
- :loading="isRowDataLoading"
15
- :error-message="errorMessage"
16
- :pagination="{
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
- :use-search="false"
23
- @change="handleChange"
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 "vue";
34
- import {useI18n} from '@tager/admin-services';
35
- import {Page} from "@tager/admin-layout";
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 "@tager/admin-ui";
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, CellHistory,
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
- getExportList({
70
- pageNumber: params.pageNumber,
71
- pageSize: params.pageSize,
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,59 @@ export default defineComponent({
84
86
  id: 1,
85
87
  name: 'ID',
86
88
  field: 'id',
87
- style: {width: '50px', textAlign: 'center'},
88
- headStyle: {width: '50px', textAlign: 'center'},
89
+ width: '50px',
89
90
  },
90
91
  {
91
92
  id: 2,
92
- name: t('export:type'),
93
- field: 'strategy',
94
- style: {width: '15%'},
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:status'),
100
- field: 'status',
101
- style: {width: '15%'},
102
- headStyle: {width: '15%'},
99
+ name: t('export:type'),
100
+ field: 'strategy',
101
+ width: '200px',
102
+ options: {
103
+ maxLength: 24,
104
+ },
103
105
  },
104
106
  {
105
107
  id: 4,
108
+ name: t('export:params'),
109
+ field: 'params',
110
+ type: 'key-value',
111
+ format: ({ row }) => {
112
+ const result: any[] = [];
113
+
114
+ Object.keys(row.params).forEach((param) => {
115
+ result.push({
116
+ key: param,
117
+ value: row.params[param],
118
+ });
119
+ });
120
+
121
+ return result;
122
+ },
123
+ },
124
+ {
125
+ id: 5,
106
126
  name: t('export:message'),
107
127
  field: 'message',
128
+ width: '200px',
108
129
  },
109
-
110
130
  {
111
- id: 5,
131
+ id: 6,
112
132
  name: t('export:log'),
113
133
  field: 'history',
114
- style: {width: '25%', whiteSpace: 'nowrap'},
115
- headStyle: {width: '25%'},
134
+ width: '300px',
116
135
  },
117
136
  {
118
- id: 6,
137
+ id: 7,
119
138
  name: t('export:file'),
120
139
  field: 'file',
121
140
  type: 'file',
122
- style: {width: '150px', textAlign: 'center'},
123
- headStyle: {width: '150px', textAlign: 'center'},
141
+ width: '100px',
124
142
  },
125
143
  ];
126
144