This commit is contained in:
yuebenshan committed 2022-08-28 12:07:21 +08:00
1 parent e2c5bb996b
commit 2ecc8a46e9
15 files changed
+18707 -667

No files matched your search

+6 -17
View File
@@ -10,7 +10,7 @@
<v-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-2': isMobile}">
<v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span>
<span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col>
<v-spacer></v-spacer>
@@ -22,7 +22,7 @@
</v-row>
<v-data-table fixed-header
:headers="headers"
:items="tableData"
:items="tableDataFromBackend"
:search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20"
@@ -51,11 +51,11 @@ new Vue({
template: '#app-template',
vuetify: new Vuetify(),
data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据
requireRules: [
v => !!v || 'This is required',
],
currentTableGenderType: 'all',
searchInput: null,
isTableLoading: true,
tableDataFromBackend: [],
@@ -76,17 +76,6 @@ new Vue({
{text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
],
}),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
},
watch: {},
async created() {
await this.doUiAction('refreshTableData');
@@ -94,13 +83,13 @@ new Vue({
mounted() {
},
methods: {
async doUiAction(uiActionId, actionData) {
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'refreshTableData':
await this.refreshTableData(actionData);
await this.refreshTableData(uiActionData);
break;
case 'toTaskHistory':
await this.toTaskHistory(actionData);
await this.toTaskHistory(uiActionData);
break;
default:
console.error("[doUiAction] uiActionId not find", { uiActionId });