diff --git a/src/assets/css/main.css b/src/assets/css/main.css
index 40bc1ac..cb71802 100644
--- a/src/assets/css/main.css
+++ b/src/assets/css/main.css
@@ -56,6 +56,10 @@ a {
margin: 10px 0;
}
+.el-table th {
+ background-color: #f5f7fa !important;
+}
+
.pagination {
margin: 20px 0;
text-align: right;
@@ -170,4 +174,4 @@ a {
.v-note-wrapper .v-note-panel {
min-height: 500px;
-}
+}
\ No newline at end of file
diff --git a/src/components/page/BaseTable.vue b/src/components/page/BaseTable.vue
index 6046fc9..eddf97c 100644
--- a/src/components/page/BaseTable.vue
+++ b/src/components/page/BaseTable.vue
@@ -27,12 +27,34 @@
border
class="table"
ref="multipleTable"
+ header-cell-class-name="table-header"
@selection-change="handleSelectionChange"
>
-
-
-
+
+
+
+ ¥{{scope.row.money}}
+
+
+
+
+
+
+
+
+
+ {{scope.row.state}}
+
+
+
+
@@ -107,13 +113,12 @@ export default {
select_cate: '',
select_word: '',
del_list: [],
- is_search: false,
editVisible: false,
- delVisible: false,
- form: {
- name: '',
- date: '',
- address: ''
+ form: {},
+ page: {
+ index: 1,
+ size: 10,
+ total: 50
},
idx: -1,
id: -1
@@ -157,30 +162,32 @@ export default {
this.tableData = res.list;
});
},
- search() {
- this.is_search = true;
- },
- formatter(row, column) {
- return row.address;
- },
- filterTag(value, row) {
- return row.tag === value;
- },
+ search() {},
handleEdit(index, row) {
this.idx = index;
this.id = row.id;
- this.form = {
- id: row.id,
- name: row.name,
- date: row.date,
- address: row.address
- };
+ this.form = row;
this.editVisible = true;
},
handleDelete(index, row) {
- this.idx = index;
- this.id = row.id;
- this.delVisible = true;
+ // 二次确认删除
+ this.$confirm('确定要删除吗?', '提示', {
+ type: 'warning'
+ })
+ .then(() => {
+ this.$message.success('删除成功');
+ if (this.tableData[index].id === row.id) {
+ this.tableData.splice(index, 1);
+ } else {
+ for (let i = 0; i < this.tableData.length; i++) {
+ if (this.tableData[i].id === row.id) {
+ this.tableData.splice(i, 1);
+ return;
+ }
+ }
+ }
+ })
+ .catch(() => {});
},
delAll() {
const length = this.multipleSelection.length;
@@ -209,21 +216,6 @@ export default {
}
}
}
- },
- // 确定删除
- deleteRow() {
- this.$message.success('删除成功');
- this.delVisible = false;
- if (this.tableData[this.idx].id === this.id) {
- this.tableData.splice(this.idx, 1);
- } else {
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].id === this.id) {
- this.tableData.splice(i, 1);
- return;
- }
- }
- }
}
}
};
@@ -256,4 +248,10 @@ export default {
.mr10 {
margin-right: 10px;
}
+.table-td-thumb {
+ display: block;
+ margin: auto;
+ width: 40px;
+ height: 40px;
+}