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

+9 -23
View File
@@ -9,7 +9,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>
@@ -21,7 +21,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"
@@ -52,6 +52,7 @@ new Vue({
template: '#app-template',
vuetify: new Vuetify(),
data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据
isFormValid: true,
requireRules: [
@@ -63,7 +64,6 @@ new Vue({
studentId: null,
classId: null
},
currentTableGenderType: 'all',
isEditDrawerShow: false,
searchInput: null,
isTableLoading: true,
@@ -92,20 +92,6 @@ new Vue({
],
dialogSaveInfoAction: ''
}),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {},
async created() {
await this.doUiAction('refreshTableData');
@@ -113,18 +99,18 @@ 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 'deleteItem':
await this.confirmDeleteItemDialog(actionData);
await this.doDeleteItem(actionData);
await this.refreshTableData(actionData);
await this.confirmDeleteItemDialog(uiActionData);
await this.doDeleteItem(uiActionData);
await this.refreshTableData(uiActionData);
break;
case 'toTaskHistory':
await this.toTaskHistory(actionData);
await this.toTaskHistory(uiActionData);
break;
default:
console.error("[doUiAction] uiActionId not find", { uiActionId });