1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
const multipleTableRef = ref() const ids = ref([]) const multiple = ref(true)
const data = reactive({ selectCheckList: [], queryParams: { pageNum: 1, pageSize: 10, title: undefined, level: undefined, orderByColumn: undefined, isAsc: undefined, }, rules: { deptId: [{ required: true, message: '请选择组织机构', trigger: ['blur', 'change'] }], }, })
const { selectCheckList, queryParams, rules } = toRefs(data)
function rowClickHandle(row) { const selectData = data.selectCheckList multipleTableRef.value.clearSelection() if (selectData.length == 1) { const [item] = selectData const shouldSelect = item !== row multipleTableRef.value.toggleRowSelection(row, shouldSelect) } else { multipleTableRef.value.toggleRowSelection(row, true) } }
function handlerSelect(selection, row) { multipleTableRef.value.clearSelection() if (selection.length == 0) return multipleTableRef.value.toggleRowSelection(row, true) }
function handleSelectionChange(selection) { console.log('表格的选中 可以获得当前选中的数据', selection) data.selectCheckList = selection ids.value = selection.map((item) => item.userId) multiple.value = !selection.length }
:deep(.el-table th.el-table__cell:nth-child(1) .cell) { visibility: hidden; }
.circle{ content: ''; display: block; width: 4px; height: 4px; background-color: #b82c22; border-radius: 50%; }
:deep(.el-table .cell .el-table__column-filter-trigger) { background: url('@/assets/icons/svg/filter.svg') no-repeat center; background-size: contain; width: 20px; height: 20px; }
.el-table .cell .el-table__column-filter-trigger.active { background-image: url('path/to/your/custom-icon-active.png'); }
|