fix: 2574 【AI一键查重--自定义筛选】右侧筛选条件模块点击清空按钮后,点击取消按钮关闭弹窗,再次打开后右侧筛选条件已被清空

pull/1/head
lizijiee 2 years ago
parent ba1934bcc8
commit a1822a104c

@ -17,6 +17,18 @@ const selectIds = ref<string[]>([])
function showModal() { function showModal() {
show.value = true show.value = true
//
const config = configStore.getConfig
const customConfig = configStore.getCustomConfig
if (config == null || customConfig == null)
return
const { showList, hideList } = generatList(config, customConfig)
onList.value = showList
offList.value = hideList
//
checkAll.value = hideList.every(item => item.checked);
} }
function closeModal() { function closeModal() {
@ -83,8 +95,9 @@ function generatList(config, customConfig) {
fix: isDefaultFilter, fix: isDefaultFilter,
checked: isChecked, checked: isChecked,
}) })
if (isChecked && selectIds.value.indexOf(key) === -1) {
isChecked && selectIds.value.push(key) isChecked && selectIds.value.push(key)
}
} }
} }
@ -156,7 +169,9 @@ function onCheckChange(checked: any, item: any) {
if (index === -1 && checked) if (index === -1 && checked)
selectIds.value.push(item.id) selectIds.value.push(item.id)
else else
selectIds.value.splice(index, 1) index !== -1 && selectIds.value.splice(index, 1)
checkAll.value = offList.value.every(item => item.checked);
} }
const showIds = computed(() => { const showIds = computed(() => {
@ -180,11 +195,13 @@ watch(
if (action === 'add') { if (action === 'add') {
for (const item of offList.value) { for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) { if (!item.fix && diff.includes(item.id)) {
onList.value.push({ if (item.checked) {
id: item.id, onList.value.push({
name: item.name || '未配置', id: item.id,
fix: item.fix || false, name: item.name || '未配置',
}) fix: item.fix || false,
})
}
} }
} }
} }
@ -248,15 +265,15 @@ const rightInputHandler = debounce((keyword) => {
onKeyword.value = keyword onKeyword.value = keyword
}, 300) }, 300)
async function getfield(){ async function getfield() {
let res; let res;
res = await getAllfieldList(3) res = await getAllfieldList(3)
const userStore = useUser(); const userStore = useUser();
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo;
res = await getfieldList(3,userInfo.id) res = await getfieldList(3, userInfo.id)
} }
onMounted(()=>{ onMounted(() => {
getfield(); getfield();
}) })

Loading…
Cancel
Save