提交 96d7237c 编写于 作者: View Design's avatar View Design

1

上级 c45aeb38
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</template> </template>
<script setup> <script setup>
const { $isLibraryCreateOpen } = storeToRefs(useLibraryStore()) const { $isLibraryCreateOpen } = storeToRefs(useLibraryStore())
const { $closeLibraryCreate } = useLibraryStore() const { $closeLibraryCreate, $getCollection } = useLibraryStore()
const { setOrUpdateCollection } = useCollectionRequest() const { setOrUpdateCollection } = useCollectionRequest()
const title = ref('') const title = ref('')
const description = ref('') const description = ref('')
...@@ -70,5 +70,6 @@ async function handleCreate () { ...@@ -70,5 +70,6 @@ async function handleCreate () {
loading.value = false loading.value = false
if (error.value) return if (error.value) return
$closeLibraryCreate() $closeLibraryCreate()
$getCollection()
} }
</script> </script>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</template> </template>
<script setup> <script setup>
const { $isLibrarySelectOpen, $selectCollectionId, $selectThreadId, $collection } = storeToRefs(useLibraryStore()) const { $isLibrarySelectOpen, $selectCollectionId, $selectThreadId, $collection } = storeToRefs(useLibraryStore())
const { $openLibrarySelect, $closeLibrarySelect, $openLibraryCreate, $setSelectCollectionId, $getCollection } = useLibraryStore() const { $closeLibrarySelect, $openLibraryCreate, $setSelectCollectionId, $getCollection } = useLibraryStore()
const { saveCollection, deleteCollectionRecord } = useCollectionRequest() const { saveCollection, deleteCollectionRecord } = useCollectionRequest()
// 合集列表 // 合集列表
const selected = ref([]) const selected = ref([])
...@@ -58,9 +58,6 @@ const loading = ref(false) ...@@ -58,9 +58,6 @@ const loading = ref(false)
function handleClose () { function handleClose () {
$closeLibrarySelect() $closeLibrarySelect()
} }
function handleOpen (id) {
$openLibrarySelect()
}
function handleOpenCreate () { function handleOpenCreate () {
handleClose() handleClose()
$openLibraryCreate() $openLibraryCreate()
...@@ -85,9 +82,12 @@ async function handleSave() { ...@@ -85,9 +82,12 @@ async function handleSave() {
} }
loading.value = false loading.value = false
handleClose() handleClose()
$getCollection()
} }
watch(() => $isLibrarySelectOpen.value, () => { watch(() => $isLibrarySelectOpen.value, () => {
selected.value = [...$selectCollectionId.value] selected.value = [...$selectCollectionId.value]
$getCollection() if (!$collection.value.length) {
$getCollection()
}
}) })
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册