Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
fix: parent category cannot be selected in post settings #365 (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby authored Oct 29, 2021
1 parent 403443e commit b59dd62
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 138 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"axios": "^0.21.4",
"dayjs": "^1.10.7",
"enquire.js": "^2.1.6",
"filepond": "^4.29.1",
"filepond": "^4.30.3",
"filepond-plugin-file-validate-type": "^1.2.6",
"filepond-plugin-image-preview": "^4.6.10",
"flv.js": "^1.6.2",
Expand All @@ -44,17 +44,17 @@
"vue-dplayer": "0.0.10",
"vue-filepond": "^6.0.3",
"vue-ls": "^3.2.2",
"vue-router": "^3.5.2",
"vue-router": "^3.5.3",
"vuedraggable": "^2.24.3",
"vuejs-logger": "^1.10.2",
"vuex": "^3.6.2"
},
"devDependencies": {
"@babel/polyfill": "^7.12.1",
"@vue/cli-plugin-babel": "^3.12.1",
"@vue/cli-plugin-eslint": "^4.5.13",
"@vue/cli-plugin-unit-jest": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/cli-plugin-eslint": "^4.5.15",
"@vue/cli-plugin-unit-jest": "^4.5.15",
"@vue/cli-service": "^4.5.15",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/test-utils": "^1.2.2",
"babel-core": "7.0.0-bridge.0",
Expand Down
97 changes: 49 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/styles/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,6 @@ body {
}
}

.post-thumb-remove,
.sheet-thumb-remove {
margin-top: 16px;
}

.ant-calendar-picker {
width: 100% !important;
}
Expand Down
12 changes: 6 additions & 6 deletions src/views/post/PostEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<template slot="extra">
<a-space>
<ReactiveButton
:errored="draftSavedErrored"
:errored="draftSaveErrored"
:loading="draftSaving"
erroredText="保存失败"
loadedText="保存成功"
text="保存草稿"
type="danger"
@callback="draftSavedErrored = false"
@callback="draftSaveErrored = false"
@click="handleSaveDraft(false)"
></ReactiveButton>
<a-button :loading="previewSaving" @click="handlePreview">预览</a-button>
Expand Down Expand Up @@ -80,7 +80,7 @@ export default {
contentChanges: 0,
draftSaving: false,
previewSaving: false,
draftSavedErrored: false
draftSaveErrored: false
}
},
beforeRouteEnter(to, from, next) {
Expand Down Expand Up @@ -158,7 +158,7 @@ export default {
this.handleRestoreSavedStatus()
})
.catch(() => {
this.draftSavedErrored = true
this.draftSaveErrored = true
})
.finally(() => {
setTimeout(() => {
Expand All @@ -173,7 +173,7 @@ export default {
this.handleRestoreSavedStatus()
})
.catch(() => {
this.draftSavedErrored = true
this.draftSaveErrored = true
})
.finally(() => {
setTimeout(() => {
Expand All @@ -190,7 +190,7 @@ export default {
this.handleRestoreSavedStatus()
})
.catch(() => {
this.draftSavedErrored = true
this.draftSaveErrored = true
})
.finally(() => {
setTimeout(() => {
Expand Down
11 changes: 2 additions & 9 deletions src/views/post/components/CategoryTree.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<a-tree checkable :treeData="categoryTree" :defaultExpandAll="true" :checkedKeys="categoryIds" @check="onCheck">
<a-tree checkable :treeData="categoryTree" defaultExpandAll checkStrictly :checkedKeys="categoryIds" @check="onCheck">
</a-tree>
</template>

Expand Down Expand Up @@ -33,15 +33,8 @@ export default {
onCheck(checkedKeys, e) {
this.$log.debug('Chekced keys', checkedKeys)
this.$log.debug('e', e)
const categoryIds = e.checkedNodes
.filter(node => {
return node.data.props.isLeaf
})
.map(node => node.key)
this.$log.debug('Effectively selected category ids', categoryIds)
this.$emit('check', categoryIds)
this.$emit('check', checkedKeys.checked)
}
}
}
Expand Down
Loading

0 comments on commit b59dd62

Please sign in to comment.