123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <a-card>
- <a-tabs default-active-key="1">
- <a-tab-pane key="1" tab="推荐给我">
- <sd-data-table
- data-url="api/xcoa-mobile/v1/kmknowledge/knowledge_recommend_accountlist"
- :columns="columns1"
- :row-key="'id'"
- :search-fields="['title']"
- >
- <a slot="bt" slot-scope="text, record" :title="text" @click="click(record)"
- >{{ text }}
- </a>
- </sd-data-table>
- </a-tab-pane>
- <a-tab-pane key="2" tab="我的推荐" force-render>
- <sd-data-table
- data-url="api/xcoa-mobile/v1/kmknowledge/knowledge_recommendlist"
- :columns="columns2"
- :row-key="'id'"
- :search-fields="['title']"
- >
- <a slot="bt" slot-scope="text, record" :title="text" @click="click(record)"
- >{{ text }}
- </a>
- </sd-data-table>
- </a-tab-pane>
- </a-tabs>
- </a-card>
- </template>
- <script>
- import TableColumnTypes from '@/common/services/table-column-types'
- import components from './_import-components/km-my-recommend-import'
- const columns1 = [
- {
- title: '序号',
- width: '100px',
- align: 'center',
- customRender: (text, record, index) => `${index + 1}`,
- },
- {
- title: '标题',
- dataIndex: 'title',
- sdClickable: true,
- width: '260px',
- align: 'center',
- scopedSlots: { customRender: 'bt' },
- },
- {
- title: '版本号',
- dataIndex: 'versionNum',
- width: '100px',
- align: 'center',
- },
- {
- title: '所属分类',
- align: 'center',
- dataIndex: 'category',
- },
- {
- title: '创建时间',
- align: 'center',
- dataIndex: 'creationTime',
- sorter: (a, b) => a.creationTime - b.creationTime,
- sdRender: TableColumnTypes.dateTime, // 特殊处理的数据类型,时间戳会自动调用sdDateFormat处理
- },
- {
- title: '阅读次数',
- align: 'center',
- dataIndex: 'readTimes',
- sorter: (a, b) => a.readTimes - b.readTimes,
- width: '150px',
- },
- {
- title: '推荐次数',
- align: 'center',
- dataIndex: 'recommendTimes',
- sorter: (a, b) => a.recommendTimes - b.recommendTimes,
- width: '150px',
- },
- {
- title: '点评次数',
- align: 'center',
- dataIndex: 'commentTimes',
- sorter: (a, b) => a.commentTimes - b.commentTimes,
- width: '150px',
- },
- ]
- const columns2 = [
- {
- title: '序号',
- align: 'center',
- width: '100px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- {
- title: '标题',
- dataIndex: 'title',
- sdClickable: true,
- width: '260px',
- align: 'center',
- scopedSlots: { customRender: 'bt' },
- },
- {
- title: '版本号',
- dataIndex: 'versionNum',
- width: '100px',
- align: 'center',
- },
- {
- title: '所属分类',
- align: 'center',
- dataIndex: 'category',
- },
- {
- title: '创建时间',
- dataIndex: 'creationTime',
- align: 'center',
- sorter: (a, b) => a.creationTime - b.creationTime,
- sdRender: TableColumnTypes.dateTime, // 特殊处理的数据类型,时间戳会自动调用sdDateFormat处理
- },
- {
- title: '阅读次数',
- dataIndex: 'readTimes',
- align: 'center',
- sorter: (a, b) => a.readTimes - b.readTimes,
- width: '150px',
- },
- {
- title: '推荐次数',
- align: 'center',
- dataIndex: 'recommendTimes',
- sorter: (a, b) => a.recommendTimes - b.recommendTimes,
- },
- {
- title: '点评次数',
- align: 'center',
- dataIndex: 'commentTimes',
- sorter: (a, b) => a.commentTimes - b.commentTimes,
- width: '150px',
- },
- ]
- export default {
- name: 'KmMyRecommend',
- metaInfo: {
- title: '推荐知识',
- },
- components,
- data() {
- return {
- columns1,
- columns2,
- }
- },
- created() {},
- methods: {
- click(record) {
- window.open(`#/km-knowledage-view?id=${record.id}&title=${record.title}`, '_blank')
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- </style>
|