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

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

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

Loading…
Cancel
Save