123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <div style="margin: 20px 0;">
- <div v-for="(item, index) in contents" :key="index">
- <div class="inside">
- <template v-if="item.type == 1">
- <div>{{ item.outerSystemName }}</div>
- </template>
- <template v-else>
- <div>{{ item.titles }}</div>
- <div class="classify">{{ item.category.join(" ") }}</div>
- <div>
- {{ item.summary }}
- </div>
- </template>
- <div class="flex-ac" :class="item.type == 2 && 'userinfo'">
- <div class="flex-ac" style="width: 50%;">
- <template v-if="item.type == 1">
- 位于: {{ item.outerContentName }}
- </template>
- <template v-else>
- <div><img style="width:24px;height:24px;" :src="item.authorHead ? ('/api/api-system/system/core/sysFile/previewFile?fileId='+item.authorHead) : header0"/></div>
- <div>{{ item.author }}</div>
- <div>{{ item.createTime }}</div>
- </template>
- </div>
- <div class="flex-ac" style="width: 50%;justify-content: flex-end;">
- <div class="button-style" @click="handleDelDataClick(index)">
- <span>移除</span>
- </div>
- <div v-if="index != (contents.length - 1)" class="button-style" @click="handleActionDataClick(index, 'down')">
- <span>下降</span>
- </div>
- <div v-if="index != 0" class="button-style" @click="handleActionDataClick(index, 'up')">
- <span>上升</span>
- </div>
- <div class="button-style" @click="handleLookDataClick(item)">
- <span>查看</span>
- </div>
- </div>
- </div>
- <template v-if="item.type == 2">
- <div class="other flex-ac">
- <div class="flex-ac">
- <img :src="lookTime"/>
- <span>{{ item.views }}</span>
- </div>
- <template v-if="item.attachmentType">
- <div class="flex-ac">
- <img :src="computedFile(item.attachmentType)"/>
- <span>{{ item.attachmentType }}</span>
- </div>
- </template>
- </div>
- </template>
- </div>
- <a-divider />
- </div>
- </div>
- </template>
- <script>
- import header0 from '@/assets/img/header0.png'
- import header1 from '@/assets/img/header1.png'
- import fileType0 from '@/assets/img/fileType0.png'
- import fileType1 from '@/assets/img/fileType1.png'
- import fileType2 from '@/assets/img/fileType2.png'
- import fileType3 from '@/assets/img/fileType3.png'
- import fileType4 from '@/assets/img/fileType4.png'
- import lookTime from '@/assets/img/lookTime.png'
- import {mapState} from "vuex";
- export default {
- props: {
- contents: {
- type: Array,
- default: () => []
- }
- },
- created() {
- },
- computed: {
- ...mapState({
- user: (state) => state.appSetting.user,
- }),
- computedFile() {
- return function(type) {
- if(type.indexOf("pdf")>-1) {
- return this.fileType1
- } else if (type.indexOf("doc")>-1) {
- return this.fileType2
- } else if (type.indexOf("xls")>-1) {
- return this.fileType3
- } else if (type.indexOf("ppt")>-1) {
- return this.fileType4
- } else {
- return this.fileType0
- }
- }
- }
- },
- data() {
- return {
- header0,
- header1,
- lookTime,
- fileType0,
- fileType1,
- fileType2,
- fileType3,
- fileType4,
- typeArr:['pdf','word','excel','ppt','其他']
- }
- },
- created() {
- },
- methods: {
- // 移除
- handleDelDataClick(index){
- let that = this
- this.$confirm({
- title: '确认要移除这个学习内容吗?',
- content: '删除后将无法恢复数据,请慎重选择',
- centered: true,
- icon: 'info-circle',
- okText:'确定',
- cancelText: '取消',
- onOk() {
- that.$emit('delItem', index)
- },
- });
- },
- // 上升
- handleActionDataClick(index, action) {
- this.$emit('actionItem',{index, action})
- },
- // 查看
- handleLookDataClick(item) {
- if(item.type == 1) {
- window.open(item.outerAccessUrl)
- } else {
- // this.jump(item.knowledgeId)
- window.open(`knowledgeAddUpdate?pkId=${item.knowledgeId}&show=true`)
- }
- },
- jump(pkId){
- this.$router.push({
- path: '/knowledge/knowledgeAddUpdate',
- query: { pkId, show: true }
- })
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .inside {
- >div {
- margin-bottom: 8px;
- }
- .classify {
- color: #aaa;
- }
- .userinfo {
- color: #aaa;
- >div:first-child {
- div {
- margin-right: 20px;
- }
- }
- }
- .other {
- color: #aaa;
- >div {
- margin-right: 20px;
- img {
- width:16px;
- height:16px;
- margin-right: 6px;
- }
- }
- }
- }
- .flex-ac {
- display: flex;
- align-items: center;
- }
- .button-style {
- color: #3294F7;
- margin-right: 30px;
- cursor: pointer;
- }
- </style>
|