|
|
|
|
@ -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();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|