mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
fix: 修复RePureTableBar
组件初始化时列设置勾选项未根据hide
属性正确初始化
This commit is contained in:
parent
b8200125dc
commit
bf67e36731
@ -1,6 +1,12 @@
|
|||||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import { delay, getKeyList, cloneDeep } from "@pureadmin/utils";
|
|
||||||
import { defineComponent, ref, computed, type PropType, nextTick } from "vue";
|
import { defineComponent, ref, computed, type PropType, nextTick } from "vue";
|
||||||
|
import {
|
||||||
|
delay,
|
||||||
|
cloneDeep,
|
||||||
|
isBoolean,
|
||||||
|
isFunction,
|
||||||
|
getKeyList
|
||||||
|
} from "@pureadmin/utils";
|
||||||
|
|
||||||
import Sortable from "sortablejs";
|
import Sortable from "sortablejs";
|
||||||
import DragIcon from "./svg/drag.svg?component";
|
import DragIcon from "./svg/drag.svg?component";
|
||||||
@ -37,8 +43,13 @@ export default defineComponent({
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const checkAll = ref(true);
|
const checkAll = ref(true);
|
||||||
const isIndeterminate = ref(false);
|
const isIndeterminate = ref(false);
|
||||||
|
const filterColumns = cloneDeep(props?.columns).filter(column =>
|
||||||
|
isBoolean(column?.hide)
|
||||||
|
? !column.hide
|
||||||
|
: !(isFunction(column?.hide) && column?.hide())
|
||||||
|
);
|
||||||
let checkColumnList = getKeyList(cloneDeep(props?.columns), "label");
|
let checkColumnList = getKeyList(cloneDeep(props?.columns), "label");
|
||||||
const checkedColumns = ref(checkColumnList);
|
const checkedColumns = ref(getKeyList(cloneDeep(filterColumns), "label"));
|
||||||
const dynamicColumns = ref(cloneDeep(props?.columns));
|
const dynamicColumns = ref(cloneDeep(props?.columns));
|
||||||
|
|
||||||
const getDropdownItemStyle = computed(() => {
|
const getDropdownItemStyle = computed(() => {
|
||||||
@ -120,7 +131,7 @@ export default defineComponent({
|
|||||||
dynamicColumns.value = cloneDeep(props?.columns);
|
dynamicColumns.value = cloneDeep(props?.columns);
|
||||||
checkColumnList = [];
|
checkColumnList = [];
|
||||||
checkColumnList = await getKeyList(cloneDeep(props?.columns), "label");
|
checkColumnList = await getKeyList(cloneDeep(props?.columns), "label");
|
||||||
checkedColumns.value = checkColumnList;
|
checkedColumns.value = getKeyList(cloneDeep(filterColumns), "label");
|
||||||
}
|
}
|
||||||
|
|
||||||
const dropdown = {
|
const dropdown = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user