|
@@ -102,10 +102,11 @@
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<el-table
|
|
<el-table
|
|
|
|
+ ref="table"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
:data="list"
|
|
:data="list"
|
|
- @selection-change="handleSelectionChange"
|
|
|
|
- class="el-table"
|
|
|
|
|
|
+ @select="handleSelect"
|
|
|
|
+ class="ticket-table"
|
|
>
|
|
>
|
|
<el-table-column
|
|
<el-table-column
|
|
type="selection"
|
|
type="selection"
|
|
@@ -276,10 +277,15 @@ export default {
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.$router.push({ name: "TicketCreate" });
|
|
this.$router.push({ name: "TicketCreate" });
|
|
},
|
|
},
|
|
-
|
|
|
|
- // 多选框选中数据
|
|
|
|
- handleSelectionChange(selection) {
|
|
|
|
- this.ids = selection.map(item => item.boxId);
|
|
|
|
|
|
+ handleSelect(selection, row) {
|
|
|
|
+ const isSelect = selection.find(item => item.boxId === row.boxId)
|
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
|
+ if (isSelect) {
|
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
|
+ this.ids = row.boxId
|
|
|
|
+ } else {
|
|
|
|
+ this.ids = ''
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
handleDetail() {},
|
|
handleDetail() {},
|
|
@@ -313,5 +319,13 @@ export default {
|
|
destroyed() {},
|
|
destroyed() {},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-<style lang="scss" scoped>
|
|
|
|
|
|
+<style lang="scss">
|
|
|
|
+.ticket-table {
|
|
|
|
+ thead {
|
|
|
|
+ .el-checkbox {
|
|
|
|
+ display: none !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
</style>
|
|
</style>
|