Skip to content

Commit 133a0e9

Browse files
committed
chore: update StdDesign
1 parent 5186f47 commit 133a0e9

File tree

9 files changed

+59
-36
lines changed

9 files changed

+59
-36
lines changed

frontend/components.d.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ declare module '@vue/runtime-core' {
3333
APagination: typeof import('ant-design-vue/es')['Pagination']
3434
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
3535
AProgress: typeof import('ant-design-vue/es')['Progress']
36-
AreaChart: typeof import('./src/components/Chart/AreaChart.vue')['default']
3736
AResult: typeof import('ant-design-vue/es')['Result']
3837
ARow: typeof import('ant-design-vue/es')['Row']
3938
ASelect: typeof import('ant-design-vue/es')['Select']
@@ -49,21 +48,25 @@ declare module '@vue/runtime-core' {
4948
ATabs: typeof import('ant-design-vue/es')['Tabs']
5049
ATag: typeof import('ant-design-vue/es')['Tag']
5150
ATextarea: typeof import('ant-design-vue/es')['Textarea']
52-
Breadcrumb: typeof import('./src/components/Breadcrumb/Breadcrumb.vue')['default']
53-
CodeEditor: typeof import('./src/components/CodeEditor/CodeEditor.vue')['default']
54-
FooterToolBar: typeof import('./src/components/FooterToolbar/FooterToolBar.vue')['default']
55-
Logo: typeof import('./src/components/Logo/Logo.vue')['default']
56-
PageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default']
57-
RadialBarChart: typeof import('./src/components/Chart/RadialBarChart.vue')['default']
51+
BreadcrumbBreadcrumb: typeof import('./src/components/Breadcrumb/Breadcrumb.vue')['default']
52+
ChartAreaChart: typeof import('./src/components/Chart/AreaChart.vue')['default']
53+
ChartRadialBarChart: typeof import('./src/components/Chart/RadialBarChart.vue')['default']
54+
CodeEditorCodeEditor: typeof import('./src/components/CodeEditor/CodeEditor.vue')['default']
55+
FooterToolbarFooterToolBar: typeof import('./src/components/FooterToolbar/FooterToolBar.vue')['default']
56+
LogoLogo: typeof import('./src/components/Logo/Logo.vue')['default']
57+
PageHeaderPageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default']
5858
RouterLink: typeof import('vue-router')['RouterLink']
5959
RouterView: typeof import('vue-router')['RouterView']
60-
SetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default']
61-
StdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default']
62-
StdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default']
63-
StdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default']
64-
StdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default']
65-
StdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default']
66-
StdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default']
67-
StdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default']
60+
SetLanguageSetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default']
61+
StdDataDisplayStdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default']
62+
StdDataDisplayStdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default']
63+
StdDataDisplayStdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default']
64+
StdDataDisplayStdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default']
65+
StdDataEntryComponentsStdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default']
66+
StdDataEntryComponentsStdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default']
67+
StdDataEntryComponentsStdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default']
68+
StdDataEntryCompontentsStdPassword: typeof import('./src/components/StdDataEntry/compontents/StdPassword.vue')['default']
69+
StdDataEntryCompontentsStdSelect: typeof import('./src/components/StdDataEntry/compontents/StdSelect.vue')['default']
70+
StdDataEntryCompontentsStdSelector: typeof import('./src/components/StdDataEntry/compontents/StdSelector.vue')['default']
6871
}
6972
}

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nginx-ui-frontend-next",
33
"private": true,
4-
"version": "1.6.6",
4+
"version": "1.6.7",
55
"type": "commonjs",
66
"scripts": {
77
"dev": "vite",

frontend/src/components/StdDataDisplay/StdBatchEdit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function ok() {
4040
message.success($gettext('Save successfully'))
4141
emit('onSave')
4242
}).catch((e: any) => {
43-
message.error(e?.message ?? $gettext('Server error'))
43+
message.error($gettext(e?.message) ?? $gettext('Server error'))
4444
}).finally(() => {
4545
loading.value = false
4646
})

frontend/src/components/StdDataDisplay/StdCurd.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ function cancel() {
123123
}
124124
125125
function edit(id: any) {
126-
props.api!.get(id).then((r: any) => {
126+
props.api!.get(id).then(async (r: any) => {
127+
Object.keys(data).forEach(k => {
128+
delete data[k]
129+
})
130+
data.id = null
127131
Object.assign(data, r)
128132
visible.value = true
129133
}).catch((e: any) => {

frontend/src/components/StdDataDisplay/StdPagination.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
<script setup lang="ts">
22
import {useGettext} from 'vue3-gettext'
3+
import {computed} from 'vue'
34
4-
const {pagination, size} = defineProps(['pagination', 'size'])
5-
const emit = defineEmits(['change'])
5+
const props = defineProps(['pagination', 'size'])
6+
const emit = defineEmits(['change', 'changePageSize'])
67
const {$gettext} = useGettext()
78
89
function change(num: number, pageSize: number) {
910
emit('change', num, pageSize)
1011
}
12+
13+
const pageSize = computed({
14+
get() {
15+
return props.pagination.per_page
16+
},
17+
set(v) {
18+
emit('changePageSize', v)
19+
props.pagination.per_page = v
20+
}
21+
})
1122
</script>
1223

1324
<template>
1425
<div class="pagination-container" v-if="pagination.total>pagination.per_page">
1526
<a-pagination
1627
:current="pagination.current_page"
17-
:pageSize="pagination.per_page"
28+
v-model:pageSize="pageSize"
1829
:size="size"
1930
:total="pagination.total"
2031
@change="change"

frontend/src/components/StdDataDisplay/StdTable.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ function get_list(page_num = null, page_size = 20) {
171171
172172
function stdChange(pagination: any, filters: any, sorter: any) {
173173
if (sorter) {
174+
selectedRowKeysBuffer.value = []
174175
params['order_by'] = sorter.field
175176
params['sort'] = sorter.order === 'ascend' ? 'asc' : 'desc'
176177
switch (sorter.order) {
@@ -185,6 +186,9 @@ function stdChange(pagination: any, filters: any, sorter: any) {
185186
break
186187
}
187188
}
189+
if (pagination) {
190+
selectedRowKeysBuffer.value = []
191+
}
188192
}
189193
190194
function expandedTable(keys: any) {
@@ -526,7 +530,7 @@ function initSortable() {
526530
</template>
527531
</template>
528532
</a-table>
529-
<std-pagination :size="size" :pagination="pagination" @change="get_list"/>
533+
<std-pagination :size="size" :pagination="pagination" @change="get_list" @changePageSize="stdChange"/>
530534
</div>
531535
</template>
532536

frontend/src/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"1.6.5","build_id":53,"total_build":123}
1+
{"version":"1.6.7","build_id":56,"total_build":126}

frontend/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"1.6.5","build_id":53,"total_build":123}
1+
{"version":"1.6.7","build_id":56,"total_build":126}

frontend/vite.config.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import vitePluginBuildId from 'vite-plugin-build-id'
1111
export default defineConfig({
1212
resolve: {
1313
alias: {
14-
'@': fileURLToPath(new URL('./src', import.meta.url)),
14+
'@': fileURLToPath(new URL('./src', import.meta.url))
1515
},
1616
extensions: [
1717
'.mjs',
@@ -26,7 +26,8 @@ export default defineConfig({
2626
},
2727
plugins: [vue(), vueJsx(), vitePluginBuildId(),
2828
Components({
29-
resolvers: [AntDesignVueResolver({importStyle: false})]
29+
resolvers: [AntDesignVueResolver({importStyle: false})],
30+
directoryAsNamespace: true
3031
}),
3132
createHtmlPlugin({
3233
minify: true,
@@ -46,30 +47,30 @@ export default defineConfig({
4647
*/
4748
inject: {
4849
data: {
49-
title: 'Nginx UI',
50-
},
51-
},
52-
}),
50+
title: 'Nginx UI'
51+
}
52+
}
53+
})
5354
],
5455
css: {
5556
preprocessorOptions: {
5657
less: {
5758
modifyVars: {
58-
'border-radius-base': '4px',
59+
'border-radius-base': '4px'
5960
},
60-
javascriptEnabled: true,
61+
javascriptEnabled: true
6162
}
62-
},
63+
}
6364
},
6465
server: {
6566
proxy: {
6667
'/api': {
6768
target: 'https://nginx.jackyu.cn/',
6869
changeOrigin: true,
6970
secure: false,
70-
ws: true,
71-
},
72-
},
71+
ws: true
72+
}
73+
}
7374
},
7475
build: {
7576
chunkSizeWarningLimit: 600

0 commit comments

Comments
 (0)