Skip to content

Commit 813b94b

Browse files
committed
chore: update dependencies
1 parent 3306469 commit 813b94b

File tree

13 files changed

+1162
-313
lines changed

13 files changed

+1162
-313
lines changed

frontend/components.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ declare module '@vue/runtime-core' {
5858
RouterLink: typeof import('vue-router')['RouterLink']
5959
RouterView: typeof import('vue-router')['RouterView']
6060
SetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default']
61+
StdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default']
6162
StdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default']
6263
StdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default']
63-
StdPassword: typeof import('./src/components/StdDataEntry/compontents/StdPassword.vue')['default']
64-
StdSelect: typeof import('./src/components/StdDataEntry/compontents/StdSelect.vue')['default']
65-
StdSelector: typeof import('./src/components/StdDataEntry/compontents/StdSelector.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']
6667
StdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default']
6768
}
6869
}

frontend/package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,35 @@
1212
},
1313
"dependencies": {
1414
"@ant-design/icons-vue": "^6.1.0",
15-
"ant-design-vue": "^3.2.13",
16-
"apexcharts": "^3.35.4",
17-
"axios": "^0.27.2",
18-
"dayjs": "^1.11.4",
19-
"lodash": "^4.17.21",
15+
"ant-design-vue": "^3.2.15",
16+
"apexcharts": "^3.36.3",
17+
"axios": "^1.1.3",
18+
"dayjs": "^1.11.6",
2019
"pinia": "^2.0.23",
21-
"pinia-plugin-persistedstate": "^1.6.3",
20+
"pinia-plugin-persistedstate": "^2.3.0",
2221
"reconnecting-websocket": "^4.4.0",
2322
"vite-plugin-build-id": "^0.2.2",
24-
"vue": "^3.2.41",
23+
"vue": "^3.2.45",
2524
"vue-router": "4",
2625
"vue3-ace-editor": "^2.2.2",
2726
"vue3-apexcharts": "^1.4.1",
2827
"vue3-gettext": "^2.3.4",
29-
"xterm": "^4.19.0",
30-
"xterm-addon-attach": "^0.6.0",
31-
"xterm-addon-fit": "^0.5.0"
28+
"xterm": "^5.0.0",
29+
"xterm-addon-attach": "^0.7.0",
30+
"xterm-addon-fit": "^0.6.0",
31+
"@types/lodash": "^4.14.188",
32+
"vuedraggable": "^4.1.0",
33+
"@types/sortablejs": "^1.15.0"
3234
},
3335
"devDependencies": {
34-
"@types/lodash": "^4.14.182",
35-
"@vitejs/plugin-vue": "^3.0.0",
36-
"@vitejs/plugin-vue-jsx": "^2.0.0",
36+
"@vitejs/plugin-vue": "^3.2.0",
37+
"@vitejs/plugin-vue-jsx": "^2.1.1",
3738
"@zougt/vite-plugin-theme-preprocessor": "^1.4.5",
3839
"less": "^4.1.3",
3940
"typescript": "^4.6.4",
40-
"unplugin-vue-components": "^0.21.2",
41-
"vite": "^3.0.0",
41+
"unplugin-vue-components": "^0.22.9",
42+
"vite": "^3.2.3",
4243
"vite-plugin-html": "^3.2.0",
43-
"vue-tsc": "^0.38.4"
44+
"vue-tsc": "^1.0.9"
4445
}
4546
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<script setup lang="ts">
2+
import {reactive, ref} from 'vue'
3+
import gettext from '@/gettext'
4+
5+
const {$gettext} = gettext
6+
7+
import StdDataEntry from '@/components/StdDataEntry'
8+
import {message} from 'ant-design-vue'
9+
10+
const emit = defineEmits(['onSave'])
11+
12+
const props = defineProps(['api', 'beforeSave'])
13+
14+
const batchColumns = ref([])
15+
16+
const visible = ref(false)
17+
18+
const selectedRowKeys = ref([])
19+
20+
function showModal(c: any, rowKeys: any) {
21+
visible.value = true
22+
selectedRowKeys.value = rowKeys
23+
batchColumns.value = c
24+
}
25+
26+
defineExpose({
27+
showModal
28+
})
29+
30+
const data = reactive({})
31+
const error = reactive({})
32+
const loading = ref(false)
33+
34+
async function ok() {
35+
loading.value = true
36+
37+
await props.beforeSave?.()
38+
39+
await props.api(selectedRowKeys.value, data).then(async () => {
40+
message.success($gettext('Save successfully'))
41+
emit('onSave')
42+
}).catch((e: any) => {
43+
message.error(e?.message ?? $gettext('Server error'))
44+
}).finally(() => {
45+
loading.value = false
46+
})
47+
}
48+
</script>
49+
50+
<template>
51+
<a-modal
52+
class="std-curd-edit-modal"
53+
:mask="false"
54+
:title="$gettext('Batch Modify')"
55+
v-model:visible="visible"
56+
:cancel-text="$gettext('Cancel')"
57+
:ok-text="$gettext('OK')"
58+
@ok="ok"
59+
:confirm-loading="loading"
60+
:width="600"
61+
destroyOnClose
62+
>
63+
64+
<std-data-entry
65+
ref="std_data_entry"
66+
:data-list="batchColumns"
67+
v-model:data-source="data"
68+
:error="error"
69+
/>
70+
71+
<slot name="extra"/>
72+
</a-modal>
73+
</template>
74+
75+
<style scoped>
76+
77+
</style>

frontend/src/components/StdDataDisplay/StdCurd.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,18 @@ const props = defineProps({
5555
modalWidth: {
5656
type: Number,
5757
default: 600
58-
}
58+
},
59+
useSortable: Boolean
5960
})
6061
6162
const visible = ref(false)
6263
const update = ref(0)
6364
const data: any = reactive({id: null})
6465
const error: any = reactive({})
65-
const selected = reactive([])
66+
const selected = ref([])
6667
6768
function onSelect(keys: any) {
68-
selected.concat(...keys)
69+
selected.value = keys
6970
}
7071
7172
function editableColumns() {
@@ -83,6 +84,11 @@ function add() {
8384
visible.value = true
8485
}
8586
87+
defineExpose({
88+
add,
89+
data
90+
})
91+
8692
const table = ref(null)
8793
8894
interface Table {
@@ -125,6 +131,7 @@ function edit(id: any) {
125131
})
126132
}
127133
134+
const selectedRowKeys = ref([])
128135
</script>
129136

130137
<template>
@@ -136,12 +143,11 @@ function edit(id: any) {
136143

137144
<std-table
138145
ref="table"
146+
v-model:selected-row-keys="selectedRowKeys"
139147
v-bind="props"
140148
@clickEdit="edit"
141149
@selected="onSelect"
142150
:key="update"
143-
:get_params="get_params"
144-
:exportCsv="exportCsv"
145151
>
146152
<template v-slot:actions="slotProps">
147153
<slot name="actions" :actions="slotProps.record"/>

frontend/src/components/StdDataDisplay/StdPagination.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import {useGettext} from 'vue3-gettext'
33
44
const {pagination, size} = defineProps(['pagination', 'size'])
5-
const emit = defineEmits(['changePage'])
5+
const emit = defineEmits(['change'])
66
const {$gettext} = useGettext()
77
8-
function changePage(num: number) {
9-
emit('changePage', num)
8+
function change(num: number, pageSize: number) {
9+
emit('change', num, pageSize)
1010
}
1111
</script>
1212

@@ -17,7 +17,7 @@ function changePage(num: number) {
1717
:pageSize="pagination.per_page"
1818
:size="size"
1919
:total="pagination.total"
20-
@change="changePage"
20+
@change="change"
2121
/>
2222
</div>
2323
</template>

0 commit comments

Comments
 (0)