mirror of https://github.com/halo-dev/halo-admin
feat: support show comments in sheet list.
parent
1ba18f764d
commit
0d4298dfe1
|
@ -161,7 +161,7 @@
|
||||||
<a-icon type="eye" />
|
<a-icon type="eye" />
|
||||||
{{ item.visits }}
|
{{ item.visits }}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span @click="handleShowSheetComments(item)">
|
||||||
<a-icon type="message" />
|
<a-icon type="message" />
|
||||||
{{ item.commentCount }}
|
{{ item.commentCount }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -358,10 +358,12 @@
|
||||||
|
|
||||||
<span
|
<span
|
||||||
slot="commentCount"
|
slot="commentCount"
|
||||||
slot-scope="commentCount"
|
slot-scope="text,record"
|
||||||
|
@click="handleShowSheetComments(record)"
|
||||||
|
style="cursor: pointer;"
|
||||||
>
|
>
|
||||||
<a-badge
|
<a-badge
|
||||||
:count="commentCount"
|
:count="record.commentCount"
|
||||||
:numberStyle="{backgroundColor: '#f38181'} "
|
:numberStyle="{backgroundColor: '#f38181'} "
|
||||||
:showZero="true"
|
:showZero="true"
|
||||||
:overflowCount="999"
|
:overflowCount="999"
|
||||||
|
@ -474,6 +476,14 @@
|
||||||
@onRefreshSheet="onRefreshSheetFromSetting"
|
@onRefreshSheet="onRefreshSheetFromSetting"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TargetCommentDrawer
|
||||||
|
:visible="sheetCommentVisible"
|
||||||
|
:title="selectedSheet.title"
|
||||||
|
:description="selectedSheet.summary"
|
||||||
|
:target="`sheets`"
|
||||||
|
:id="selectedSheet.id"
|
||||||
|
@close="onSheetCommentsClose"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -481,6 +491,7 @@
|
||||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import SheetSettingDrawer from './components/SheetSettingDrawer'
|
import SheetSettingDrawer from './components/SheetSettingDrawer'
|
||||||
|
import TargetCommentDrawer from '../comment/components/TargetCommentDrawer'
|
||||||
import sheetApi from '@/api/sheet'
|
import sheetApi from '@/api/sheet'
|
||||||
import menuApi from '@/api/menu'
|
import menuApi from '@/api/menu'
|
||||||
|
|
||||||
|
@ -541,7 +552,8 @@ const customColumns = [
|
||||||
export default {
|
export default {
|
||||||
mixins: [mixin, mixinDevice],
|
mixins: [mixin, mixinDevice],
|
||||||
components: {
|
components: {
|
||||||
SheetSettingDrawer
|
SheetSettingDrawer,
|
||||||
|
TargetCommentDrawer
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -551,9 +563,11 @@ export default {
|
||||||
customColumns,
|
customColumns,
|
||||||
selectedSheet: {},
|
selectedSheet: {},
|
||||||
sheetSettingVisible: false,
|
sheetSettingVisible: false,
|
||||||
|
sheetCommentVisible: false,
|
||||||
internalSheets: [],
|
internalSheets: [],
|
||||||
sheets: [],
|
sheets: [],
|
||||||
menu: {}
|
menu: {},
|
||||||
|
sheetComments: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -622,6 +636,12 @@ export default {
|
||||||
this.sheetSettingVisible = true
|
this.sheetSettingVisible = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleShowSheetComments(sheet) {
|
||||||
|
sheetApi.get(sheet.id).then(response => {
|
||||||
|
this.selectedSheet = response.data.data
|
||||||
|
this.sheetCommentVisible = true
|
||||||
|
})
|
||||||
|
},
|
||||||
handlePreview(sheetId) {
|
handlePreview(sheetId) {
|
||||||
sheetApi.preview(sheetId).then(response => {
|
sheetApi.preview(sheetId).then(response => {
|
||||||
window.open(response.data, '_blank')
|
window.open(response.data, '_blank')
|
||||||
|
@ -634,6 +654,13 @@ export default {
|
||||||
this.loadSheets()
|
this.loadSheets()
|
||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
|
onSheetCommentsClose() {
|
||||||
|
this.sheetCommentVisible = false
|
||||||
|
this.selectedSheet = {}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loadSheets()
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
onRefreshSheetFromSetting(sheet) {
|
onRefreshSheetFromSetting(sheet) {
|
||||||
this.selectedSheet = sheet
|
this.selectedSheet = sheet
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue