Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-18
@@ -28,7 +28,7 @@ import java.util.Date;
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="onl_cgform_collection对象", description="我的收藏")
|
||||
public class OnlCgformCollection extends BussDocumentLibraryEO implements Serializable {
|
||||
public class OnlCgformCollection implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@@ -60,21 +60,4 @@ public class OnlCgformCollection extends BussDocumentLibraryEO implements Serial
|
||||
@Excel(name = "文档库id", width = 15, dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
private String documentId;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
private String state;
|
||||
|
||||
/**编号*/
|
||||
@Excel(name = "编号", width = 15, dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
private String serialNumber;
|
||||
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15, dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
}
|
||||
|
||||
+41
-2
@@ -691,9 +691,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
//下拉选处理数据字典
|
||||
List records = infoPage.getRecords();
|
||||
for (Object record : records) {
|
||||
List<Map> records = infoPage.getRecords();
|
||||
List<String> idList = new ArrayList<>();
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
idList.add((String) record1.get("id"));
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
List<OnlCgformField> collect = fieldList.stream()
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()))
|
||||
@@ -702,8 +704,45 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
dictItem(sysDictItems, entry, collect);
|
||||
}
|
||||
}
|
||||
//收藏和订阅
|
||||
collectAndSubscribe(records, idList);
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 收藏和订阅
|
||||
* @param records
|
||||
* @param idList
|
||||
*/
|
||||
private void collectAndSubscribe(List<Map> records, List<String> idList) {
|
||||
//收藏
|
||||
LambdaQueryWrapper<OnlCgformCollection> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(OnlCgformCollection::getDocumentId,idList);
|
||||
List<OnlCgformCollection> collectList = iOnlCgformCollectionService.list(wrapper);
|
||||
List<String> collectIdList = collectList.stream().map(OnlCgformCollection::getDocumentId).collect(Collectors.toList());
|
||||
//订阅
|
||||
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId,idList);
|
||||
List<OnlCgformSubscribe> subscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
|
||||
List<String> subscribeIdList = subscribeList.stream().map(OnlCgformSubscribe::getDocumentId).collect(Collectors.toList());
|
||||
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
String id = (String) record1.get("id");
|
||||
//收藏标识(0-->未收藏 1-->已收藏)
|
||||
if(collectIdList.contains(id)){
|
||||
record1.put("collectFlag","1");
|
||||
}else{
|
||||
record1.put("collectFlag","0");
|
||||
}
|
||||
//订阅标识
|
||||
if(subscribeIdList.contains(id)){
|
||||
record1.put("subscribeFlag","1");
|
||||
}else{
|
||||
record1.put("subscribeFlag","0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-23
@@ -63,27 +63,4 @@ public class OnlCgformSubscribe implements Serializable {
|
||||
@Excel(name = "文档库id", width = 15, dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
private String documentId;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
private String state;
|
||||
|
||||
/**编号*/
|
||||
@Excel(name = "编号", width = 15, dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
private String serialNumber;
|
||||
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15, dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**技术领域*/
|
||||
@Excel(name = "技术领域", width = 15)
|
||||
@Dict(dicCode = "technology_territory")
|
||||
@ApiModelProperty(value = "技术领域")
|
||||
private String technologyTerritory;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,17 @@
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">{{ ol.text instanceof Array ? ol.text[record.collectFlag || 0] : ol.text}}</a>
|
||||
@click="OperationClick(ol,record)">
|
||||
<span v-if="ol.text == '收藏'">
|
||||
{{!record.collectFlag || record.collectFlag == 0 ? '收藏' :'取消收藏'}}
|
||||
</span>
|
||||
<span v-else-if="ol.text == '订阅'">
|
||||
{{!record.subscribeFlag || record.subscribeFlag == 0 ? '订阅' :'取消订阅'}}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ol.text}}
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
<span slot="detailClick" slot-scope="text,record">
|
||||
<a class="text" @click="detailClick(record)">{{text}}</a>
|
||||
@@ -88,10 +98,12 @@
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
@@ -119,9 +131,11 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
let width
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
width = this.OperationList.length * 55
|
||||
this.OperationList.forEach((res) => {
|
||||
width += res.text.length * 8 + width
|
||||
})
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
@@ -174,9 +188,9 @@
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item){
|
||||
this.$emit('detailClick',item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick',item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -65,11 +65,11 @@
|
||||
return {
|
||||
OperationList: [
|
||||
{
|
||||
text: ['收藏','取消收藏'],
|
||||
text: '收藏',
|
||||
ClickEvent: 'Collection'
|
||||
},
|
||||
{
|
||||
text: ['订阅','取消订阅'],
|
||||
text: '订阅',
|
||||
ClickEvent: 'subscribe'
|
||||
},
|
||||
{
|
||||
@@ -171,12 +171,12 @@
|
||||
Collection(val) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: val.collectFlag == 0 || !val.collectFlag ? '确认收藏?':'确定取消收藏',
|
||||
content: val.collectFlag == 0 || !val.collectFlag ? '确认收藏?' : '确定取消收藏?',
|
||||
onOk() {
|
||||
let url = ''
|
||||
if (val.collectFlag == 0 || !val.collectFlag){
|
||||
if (val.collectFlag == 0 || !val.collectFlag) {
|
||||
url = 'document/bussDocumentLibraryEO/addCollect'
|
||||
}else{
|
||||
} else {
|
||||
url = 'document/bussDocumentLibraryEO/cancelCollect'
|
||||
}
|
||||
getAction(url, { id: val.id }).then((res) => {
|
||||
@@ -192,17 +192,38 @@
|
||||
},
|
||||
//订阅按钮
|
||||
subscribe(val) {
|
||||
console.log('val222', val)
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: val.subscribeFlag == 0 || !val.subscribeFlag ? '确认订阅?' : '确定取消订阅?',
|
||||
onOk() {
|
||||
let url = ''
|
||||
if (val.subscribeFlag == 0 || !val.subscribeFlag) {
|
||||
url = 'document/bussDocumentLibraryEO/addSubscribe'
|
||||
} else {
|
||||
url = 'document/bussDocumentLibraryEO/cancelSubscribe'
|
||||
}
|
||||
getAction(url, { id: val.id }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(res.message)
|
||||
eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
_this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onSelectChange(value) {
|
||||
this.idList = value
|
||||
},
|
||||
|
||||
detailClick(item) {
|
||||
this.$router.push({
|
||||
path: '/docManage/library/detail',
|
||||
query: item
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user