|
@@ -28,7 +28,8 @@
|
|
:knowList="knowList"
|
|
:knowList="knowList"
|
|
:ref="'item' + item.i"
|
|
:ref="'item' + item.i"
|
|
:canDelete="canDelete"
|
|
:canDelete="canDelete"
|
|
- @deleteKnowledge="deleteKnowledge($event,item)">
|
|
|
|
|
|
+ @deleteKnowledge="deleteKnowledge($event,item)"
|
|
|
|
+ @deleteKnowledgeType="deleteKnowledgeType($event,item)">
|
|
<template v-slot:drag>
|
|
<template v-slot:drag>
|
|
<img
|
|
<img
|
|
v-if="canDrag"
|
|
v-if="canDrag"
|
|
@@ -198,6 +199,24 @@ export default {
|
|
KnowledgeResourceList:[]
|
|
KnowledgeResourceList:[]
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ async deleteKnowledgeType(item,v){
|
|
|
|
+ let { type } = item;
|
|
|
|
+ let knowList = this.knowList.filter(_=>_.ResourceType != type);
|
|
|
|
+ let res = await apiBiBoard.saveKnowledge({
|
|
|
|
+ BiDashboardDetailId:v ? (/^selfId_\d+$/.test(v.BiDashboardDetailId) ? 0 : v.BiDashboardDetailId) : 0,
|
|
|
|
+ KnowledgeResourceList:knowList.map(_=>({
|
|
|
|
+ ResourceType:_.ResourceType,
|
|
|
|
+ KnowledgeResourceId:_.KnowledgeResourceId
|
|
|
|
+ }))
|
|
|
|
+ });
|
|
|
|
+ if(res.Ret != 200) return this.$message.warning('删除失败,请重试');
|
|
|
|
+ this.knowList = knowList;
|
|
|
|
+ if(!this.knowList.length){ //清空掉知识资源
|
|
|
|
+ this.dataList = this.dataList.filter(_=>_.Type != 3);
|
|
|
|
+ this.$emit('input',this.dataList)
|
|
|
|
+ }
|
|
|
|
+ this.setFirstKnow();
|
|
|
|
+ },
|
|
async deleteKnowledge(item,v){
|
|
async deleteKnowledge(item,v){
|
|
let index = this.knowList.findIndex(_=>_.KnowledgeResourceId == item.KnowledgeResourceId && _.ResourceType == item.ResourceType)
|
|
let index = this.knowList.findIndex(_=>_.KnowledgeResourceId == item.KnowledgeResourceId && _.ResourceType == item.ResourceType)
|
|
if(index >= 0){
|
|
if(index >= 0){
|