|
|
|
@ -107,29 +107,25 @@ function parseStringToArray(str: string) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function editModeInitValue(){ |
|
|
|
|
|
|
|
if(props.modelValue){ |
|
|
|
const initialValue = parseStringToArray(props.modelValue) |
|
|
|
value.value = initialValue; |
|
|
|
if (initialValue.length > 0 && !multiSelect.value) { |
|
|
|
lastSelectedValue.value = initialValue[initialValue.length - 1]; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
setTimeout(()=>{ |
|
|
|
editModeInitValue() |
|
|
|
},100) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
onBeforeMount(() => { |
|
|
|
setTimeout(()=>{ |
|
|
|
if(props.modelValue){ |
|
|
|
const initialValue = parseStringToArray(props.modelValue) |
|
|
|
value.value = initialValue; |
|
|
|
if (initialValue.length > 0 && !multiSelect.value) { |
|
|
|
lastSelectedValue.value = initialValue[initialValue.length - 1]; |
|
|
|
} |
|
|
|
} |
|
|
|
},1500) |
|
|
|
|
|
|
|
editModeInitValue() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
onUnmounted(()=>{ |
|
|
|
console.log("onUnmounted") |
|
|
|
}) |
|
|
|
|
|
|
|
// 递归处理树节点,将部门节点设置为禁用 |
|
|
|
const processTreeData = (data: any[]) => { |
|
|
|
return data.map(node => { |
|
|
|
|