|
|
@@ -75,6 +75,12 @@ const curRow = ref<any>(null)
|
|
|
const handleRowClick = (row: any) => {
|
|
|
curRow.value = row
|
|
|
}
|
|
|
+const rowClassName = ({ row }: { row: any }) => {
|
|
|
+ if (row.id === curRow.value.id) {
|
|
|
+ return 'active'
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const itemTableRef = ref<any>(null)
|
|
|
watch(curRow, () => {
|
|
|
itemTableRef.value?.refresh()
|
|
|
@@ -114,7 +120,7 @@ const dictItemFormConfig = reactive<BasicForm>({
|
|
|
<template>
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="12">
|
|
|
- <pro-table :crud="CRUD" :formConfig="dictFormConfig" @row-click="handleRowClick">
|
|
|
+ <pro-table :crud="CRUD" :formConfig="dictFormConfig" :row-class-name="rowClassName" @row-click="handleRowClick">
|
|
|
<el-table-column prop="description" label="字典名称"></el-table-column>
|
|
|
<el-table-column prop="type" label="字典值"></el-table-column>
|
|
|
</pro-table>
|
|
|
@@ -132,4 +138,11 @@ const dictItemFormConfig = reactive<BasicForm>({
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+:deep(.active) {
|
|
|
+ background-color: #f5f7fa !important;
|
|
|
+ .el-table-fixed-column--right {
|
|
|
+ background-color: #f5f7fa !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|