chore: update StdDesign

This commit is contained in:
0xJacky 2022-11-28 22:12:42 +08:00
parent 5186f47b75
commit 133a0e9501
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
9 changed files with 59 additions and 36 deletions

View file

@ -33,7 +33,6 @@ declare module '@vue/runtime-core' {
APagination: typeof import('ant-design-vue/es')['Pagination'] APagination: typeof import('ant-design-vue/es')['Pagination']
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
AProgress: typeof import('ant-design-vue/es')['Progress'] AProgress: typeof import('ant-design-vue/es')['Progress']
AreaChart: typeof import('./src/components/Chart/AreaChart.vue')['default']
AResult: typeof import('ant-design-vue/es')['Result'] AResult: typeof import('ant-design-vue/es')['Result']
ARow: typeof import('ant-design-vue/es')['Row'] ARow: typeof import('ant-design-vue/es')['Row']
ASelect: typeof import('ant-design-vue/es')['Select'] ASelect: typeof import('ant-design-vue/es')['Select']
@ -49,21 +48,25 @@ declare module '@vue/runtime-core' {
ATabs: typeof import('ant-design-vue/es')['Tabs'] ATabs: typeof import('ant-design-vue/es')['Tabs']
ATag: typeof import('ant-design-vue/es')['Tag'] ATag: typeof import('ant-design-vue/es')['Tag']
ATextarea: typeof import('ant-design-vue/es')['Textarea'] ATextarea: typeof import('ant-design-vue/es')['Textarea']
Breadcrumb: typeof import('./src/components/Breadcrumb/Breadcrumb.vue')['default'] BreadcrumbBreadcrumb: typeof import('./src/components/Breadcrumb/Breadcrumb.vue')['default']
CodeEditor: typeof import('./src/components/CodeEditor/CodeEditor.vue')['default'] ChartAreaChart: typeof import('./src/components/Chart/AreaChart.vue')['default']
FooterToolBar: typeof import('./src/components/FooterToolbar/FooterToolBar.vue')['default'] ChartRadialBarChart: typeof import('./src/components/Chart/RadialBarChart.vue')['default']
Logo: typeof import('./src/components/Logo/Logo.vue')['default'] CodeEditorCodeEditor: typeof import('./src/components/CodeEditor/CodeEditor.vue')['default']
PageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default'] FooterToolbarFooterToolBar: typeof import('./src/components/FooterToolbar/FooterToolBar.vue')['default']
RadialBarChart: typeof import('./src/components/Chart/RadialBarChart.vue')['default'] LogoLogo: typeof import('./src/components/Logo/Logo.vue')['default']
PageHeaderPageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
SetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default'] SetLanguageSetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default']
StdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default'] StdDataDisplayStdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default']
StdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default'] StdDataDisplayStdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default']
StdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default'] StdDataDisplayStdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default']
StdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default'] StdDataDisplayStdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default']
StdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default'] StdDataEntryComponentsStdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default']
StdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default'] StdDataEntryComponentsStdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default']
StdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default'] StdDataEntryComponentsStdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default']
StdDataEntryCompontentsStdPassword: typeof import('./src/components/StdDataEntry/compontents/StdPassword.vue')['default']
StdDataEntryCompontentsStdSelect: typeof import('./src/components/StdDataEntry/compontents/StdSelect.vue')['default']
StdDataEntryCompontentsStdSelector: typeof import('./src/components/StdDataEntry/compontents/StdSelector.vue')['default']
} }
} }

View file

@ -1,7 +1,7 @@
{ {
"name": "nginx-ui-frontend-next", "name": "nginx-ui-frontend-next",
"private": true, "private": true,
"version": "1.6.6", "version": "1.6.7",
"type": "commonjs", "type": "commonjs",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View file

@ -40,7 +40,7 @@ async function ok() {
message.success($gettext('Save successfully')) message.success($gettext('Save successfully'))
emit('onSave') emit('onSave')
}).catch((e: any) => { }).catch((e: any) => {
message.error(e?.message ?? $gettext('Server error')) message.error($gettext(e?.message) ?? $gettext('Server error'))
}).finally(() => { }).finally(() => {
loading.value = false loading.value = false
}) })

View file

@ -123,7 +123,11 @@ function cancel() {
} }
function edit(id: any) { function edit(id: any) {
props.api!.get(id).then((r: any) => { props.api!.get(id).then(async (r: any) => {
Object.keys(data).forEach(k => {
delete data[k]
})
data.id = null
Object.assign(data, r) Object.assign(data, r)
visible.value = true visible.value = true
}).catch((e: any) => { }).catch((e: any) => {

View file

@ -1,20 +1,31 @@
<script setup lang="ts"> <script setup lang="ts">
import {useGettext} from 'vue3-gettext' import {useGettext} from 'vue3-gettext'
import {computed} from 'vue'
const {pagination, size} = defineProps(['pagination', 'size']) const props = defineProps(['pagination', 'size'])
const emit = defineEmits(['change']) const emit = defineEmits(['change', 'changePageSize'])
const {$gettext} = useGettext() const {$gettext} = useGettext()
function change(num: number, pageSize: number) { function change(num: number, pageSize: number) {
emit('change', num, pageSize) emit('change', num, pageSize)
} }
const pageSize = computed({
get() {
return props.pagination.per_page
},
set(v) {
emit('changePageSize', v)
props.pagination.per_page = v
}
})
</script> </script>
<template> <template>
<div class="pagination-container" v-if="pagination.total>pagination.per_page"> <div class="pagination-container" v-if="pagination.total>pagination.per_page">
<a-pagination <a-pagination
:current="pagination.current_page" :current="pagination.current_page"
:pageSize="pagination.per_page" v-model:pageSize="pageSize"
:size="size" :size="size"
:total="pagination.total" :total="pagination.total"
@change="change" @change="change"

View file

@ -171,6 +171,7 @@ function get_list(page_num = null, page_size = 20) {
function stdChange(pagination: any, filters: any, sorter: any) { function stdChange(pagination: any, filters: any, sorter: any) {
if (sorter) { if (sorter) {
selectedRowKeysBuffer.value = []
params['order_by'] = sorter.field params['order_by'] = sorter.field
params['sort'] = sorter.order === 'ascend' ? 'asc' : 'desc' params['sort'] = sorter.order === 'ascend' ? 'asc' : 'desc'
switch (sorter.order) { switch (sorter.order) {
@ -185,6 +186,9 @@ function stdChange(pagination: any, filters: any, sorter: any) {
break break
} }
} }
if (pagination) {
selectedRowKeysBuffer.value = []
}
} }
function expandedTable(keys: any) { function expandedTable(keys: any) {
@ -526,7 +530,7 @@ function initSortable() {
</template> </template>
</template> </template>
</a-table> </a-table>
<std-pagination :size="size" :pagination="pagination" @change="get_list"/> <std-pagination :size="size" :pagination="pagination" @change="get_list" @changePageSize="stdChange"/>
</div> </div>
</template> </template>

View file

@ -1 +1 @@
{"version":"1.6.5","build_id":53,"total_build":123} {"version":"1.6.7","build_id":56,"total_build":126}

View file

@ -1 +1 @@
{"version":"1.6.5","build_id":53,"total_build":123} {"version":"1.6.7","build_id":56,"total_build":126}

View file

@ -11,7 +11,7 @@ import vitePluginBuildId from 'vite-plugin-build-id'
export default defineConfig({ export default defineConfig({
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url))
}, },
extensions: [ extensions: [
'.mjs', '.mjs',
@ -26,7 +26,8 @@ export default defineConfig({
}, },
plugins: [vue(), vueJsx(), vitePluginBuildId(), plugins: [vue(), vueJsx(), vitePluginBuildId(),
Components({ Components({
resolvers: [AntDesignVueResolver({importStyle: false})] resolvers: [AntDesignVueResolver({importStyle: false})],
directoryAsNamespace: true
}), }),
createHtmlPlugin({ createHtmlPlugin({
minify: true, minify: true,
@ -46,20 +47,20 @@ export default defineConfig({
*/ */
inject: { inject: {
data: { data: {
title: 'Nginx UI', title: 'Nginx UI'
}, }
}, }
}), })
], ],
css: { css: {
preprocessorOptions: { preprocessorOptions: {
less: { less: {
modifyVars: { modifyVars: {
'border-radius-base': '4px', 'border-radius-base': '4px'
}, },
javascriptEnabled: true, javascriptEnabled: true
}
} }
},
}, },
server: { server: {
proxy: { proxy: {
@ -67,9 +68,9 @@ export default defineConfig({
target: 'https://nginx.jackyu.cn/', target: 'https://nginx.jackyu.cn/',
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,
ws: true, ws: true
}, }
}, }
}, },
build: { build: {
chunkSizeWarningLimit: 600 chunkSizeWarningLimit: 600