fix: 修复表格列设置弹窗出现警告问题
This commit is contained in:
@@ -51,7 +51,7 @@ const confirm = () => {
|
|||||||
const newColumns = cloneDeep(unref(settingColumns))?.map((item) => {
|
const newColumns = cloneDeep(unref(settingColumns))?.map((item) => {
|
||||||
const fixed = unref(settingColumns)?.find((col) => col.field === item.field)?.fixed
|
const fixed = unref(settingColumns)?.find((col) => col.field === item.field)?.fixed
|
||||||
item.hidden = !unref(checkColumns)?.includes(item.field)
|
item.hidden = !unref(checkColumns)?.includes(item.field)
|
||||||
item.fixed = fixed ? fixed : undefined
|
item.fixed = fixed ? fixed : false
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
emit('confirm', [...unref(hiddenColumns), ...(newColumns || [])])
|
emit('confirm', [...unref(hiddenColumns), ...(newColumns || [])])
|
||||||
@@ -65,7 +65,7 @@ const restore = () => {
|
|||||||
const initColumns = (columns: TableColumn[], isReStore = false) => {
|
const initColumns = (columns: TableColumn[], isReStore = false) => {
|
||||||
const newColumns = columns?.filter((item) => {
|
const newColumns = columns?.filter((item) => {
|
||||||
if (!isReStore) {
|
if (!isReStore) {
|
||||||
item.fixed = item.fixed !== void 0 ? item.fixed : undefined
|
item.fixed = item.fixed !== void 0 ? item.fixed : false
|
||||||
}
|
}
|
||||||
return (item.type && !DEFAULT_FILTER_COLUMN.includes(item.type)) || !item.type
|
return (item.type && !DEFAULT_FILTER_COLUMN.includes(item.type)) || !item.type
|
||||||
})
|
})
|
||||||
@@ -133,18 +133,18 @@ watch(
|
|||||||
:key="item.field"
|
:key="item.field"
|
||||||
class="flex items-center justify-between mt-12px"
|
class="flex items-center justify-between mt-12px"
|
||||||
>
|
>
|
||||||
<ElCheckbox :label="item.field">
|
<ElCheckbox :value="item.field">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</ElCheckbox>
|
</ElCheckbox>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<ElRadioGroup size="small" v-model="item.fixed">
|
<ElRadioGroup size="small" v-model="item.fixed">
|
||||||
<ElRadioButton label="left">
|
<ElRadioButton value="left">
|
||||||
<Icon icon="vi-ep:arrow-left" />
|
<Icon icon="vi-ep:arrow-left" />
|
||||||
</ElRadioButton>
|
</ElRadioButton>
|
||||||
<ElRadioButton :label="undefined">
|
<ElRadioButton :value="false">
|
||||||
<Icon icon="vi-ep:close" />
|
<Icon icon="vi-ep:close" />
|
||||||
</ElRadioButton>
|
</ElRadioButton>
|
||||||
<ElRadioButton label="right">
|
<ElRadioButton value="right">
|
||||||
<Icon icon="vi-ep:arrow-right" />
|
<Icon icon="vi-ep:arrow-right" />
|
||||||
</ElRadioButton>
|
</ElRadioButton>
|
||||||
</ElRadioGroup>
|
</ElRadioGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user