flx:修改学习园地 新增点击数

This commit is contained in:
X_Rian 2024-09-12 18:24:40 +08:00
parent 974f48730e
commit 63260ca0fc
2 changed files with 134 additions and 16 deletions

View File

@ -14,6 +14,8 @@ export const editPartyBuildingGuidanceInfo = data => post('xmgl/partyBuildingGui
export const deletePartyBuildingGuidanceInfo = data => post('xmgl/partyBuildingGuidance/delete', data);
// 通过id查询党建引领信息
export const getPartyBuildingGuidanceInfoById = data => get('xmgl/partyBuildingGuidance/queryById', data);
// 分页列表查询党建引领点击用户信息
export const getPartyBuildingGuidanceClickUserPage = data => get('xmgl/partyBuildingGuidanceClickUser/page', data);
// 组织建设
// 树形列表查询组织建设组织信息

View File

@ -33,7 +33,13 @@
{{ scope.row.isRead == 1 ? "已读" : "未读" }}
</template>
</el-table-column>
<el-table-column prop="clickRate" align="center" label="点击率"></el-table-column>
<el-table-column prop="clickRate" align="center" label="点击次数">
<template slot-scope="scope">
<div class="download" @click="previewDetail(scope.row, 1)">
{{ scope.row.clickRate }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<div class="tableBtns">
@ -53,9 +59,9 @@
</template>
</el-table-column>
</el-table>
<el-pagination class="pagerBox" @size-change="SizeChange" @current-change="CurrentChange"
:current-page="pagInfo.pageNo" :page-sizes="$store.state.PAGESIZRS" :page-size="pagInfo.pageSize"
layout="total, sizes, prev, pager, next" :total="Number(pagInfo.total)" background></el-pagination>
<el-pagination class="pagerBox" @size-change="SizeChange($event, 1)" @current-change="CurrentChange($event,1)"
:current-page="pageInfo.pageNo" :page-sizes="$store.state.PAGESIZRS" :page-size="pageInfo.pageSize"
layout="total, sizes, prev, pager, next" :total="Number(pageInfo.total)" background></el-pagination>
</div>
<!-- 新增 -->
<el-dialog :modal-append-to-body="false" :title="title" :visible.sync="dialogShow" @close="close" width="1200px">
@ -111,9 +117,45 @@
</div>
</div>
</el-dialog>
<!-- 详情 -->
<el-dialog :modal-append-to-body="false" title="详情" :visible.sync="dialogContent1" width="1200px">
<div class="dialog_content">
<el-table class="tables" :data="pageInfo1.List">
<el-table-column type="index" label="序号" align="center"></el-table-column>
<el-table-column prop="realName" align="center" label="姓名"></el-table-column>
<el-table-column prop="createDate" align="center" label="时间"></el-table-column>
</el-table-column>
<el-table-column prop="clickNum" align="center" label="学习次数">
<template slot-scope="scope">
<div class="download" @click="previewDetail(scope.row, 2)">
{{ scope.row.clickNum }}
</div>
</template>
</el-table-column>
</el-table>
<el-pagination class="pagerBox" @size-change="SizeChange($event, 2)" @current-change="CurrentChange($event,2)"
:current-page="pageInfo1.pageNo" :page-sizes="$store.state.PAGESIZRS" :page-size="pageInfo1.pageSize"
layout="total, sizes, prev, pager, next" :total="Number(pageInfo1.total)" background></el-pagination>
</div>
</el-dialog>
<!-- 详情 -->
<el-dialog :modal-append-to-body="false" title="详情" :visible.sync="dialogContent2" width="1200px">
<div class="dialog_content">
<el-table class="tables" :data="pageInfo2.List">
<el-table-column type="index" label="序号" align="center"></el-table-column>
<el-table-column prop="realName" align="center" label="姓名"></el-table-column>
<el-table-column prop="createDate" align="center" label="学习时间"></el-table-column>
</el-table-column>
</el-table>
<el-pagination class="pagerBox" @size-change="SizeChange($event, 2)" @current-change="CurrentChange($event,2)"
:current-page="pageInfo2.pageNo" :page-sizes="$store.state.PAGESIZRS" :page-size="pageInfo2.pageSize"
layout="total, sizes, prev, pager, next" :total="Number(pageInfo2.total)" background></el-pagination>
</div>
</el-dialog>
</div>
</template>
<script>
import dayjs from "dayjs";
import VueQuillEditor from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
@ -124,6 +166,7 @@ import {
editPartyBuildingGuidanceInfo,
deletePartyBuildingGuidanceInfo,
isReadPartyBuildingGuidanceApi,
getPartyBuildingGuidanceClickUserPage,
} from "@/assets/js/api/guidancePartyBuilding";
import {
@ -139,7 +182,7 @@ export default {
},
data() {
return {
pagInfo: {
pageInfo: {
pageNo: 1, //
pageSize: 10, //
total: 0, //
@ -209,9 +252,39 @@ export default {
theme: "snow",
},
cooperatorList: [],
detailData1: {},
dialogContent1: false,
pageInfo1: {
pageNo: 1, //
pageSize: 10, //
total: 0, //
List: [],
},
detailData2: {},
dialogContent2: false,
pageInfo2: {
pageNo: 1, //
pageSize: 10, //
total: 0, //
List: [],
},
};
},
methods: {
previewDetail(row, type) {
if(type == 1) {
this.detailData1 = row;
this.pageInfo1.pageNo = 1;
this.getPartyBuildingGuidanceClickUser(1);
this.dialogContent1 = true;
} else if(type == 2) {
this.pageInfo2.pageNo = 1;
this.detailData2 = row;
this.getPartyBuildingGuidanceClickUser(2);
this.dialogContent2 = true;
}
},
//
getCooperatorList() {
let data = {
@ -272,8 +345,8 @@ export default {
getPartyBuildingGuidanceInfo({
projectSn: this.$store.state.projectSn,
title: this.searchForm.title,
pageNo: this.pagInfo.pageNo,
pageSize: this.pagInfo.pageSize,
pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize,
type: 3,
}).then((result) => {
if (result.success) {
@ -300,7 +373,7 @@ export default {
}
});
this.List = result.result.records;
this.pagInfo.total = result.result.total;
this.pageInfo.total = result.result.total;
console.log(" this.List", this.List);
}
});
@ -390,24 +463,67 @@ export default {
this.$refs.addEditForm.clearValidate();
});
},
SizeChange(val) {
this.pagInfo.pageSize = val;
this.getList();
//
getPartyBuildingGuidanceClickUser(type) {
const obj = {
1: "pageInfo1",
2: "pageInfo2",
}
getPartyBuildingGuidanceClickUserPage({
projectSn: this.$store.state.projectSn,
pageNo: this[obj[type]].pageNo,
pageSize: this[obj[type]].pageSize,
groupby: type == 1 ? "user" : "",
partyBuildingGuidanceId: this.detailData1.id,
userId: type == 2 ? this.detailData2.userId : "",
createDate_begin: dayjs(this.chooseMonth).startOf('month').format('YYYY-MM-DD'),
createDate_end: dayjs(this.chooseMonth).endOf('month').format('YYYY-MM-DD'),
}).then((result) => {
if (result.success) {
this[obj[type]].List = result.result.records;
this[obj[type]].total = result.result.total;
console.log(" this.List", this[obj[type]].List);
}
});
},
CurrentChange(val) {
this.pagInfo.pageNo = val;
this.getList();
SizeChange(val, type) {
const obj = {
1: "pageInfo",
2: "pageInfo1",
}
this[obj[type]].pageSize = val;
if(type == 1){
this.getList();
} else if (type == 2) {
this.getPartyBuildingGuidanceClickUser(1);
}
},
CurrentChange(val, type) {
const obj = {
1: "pageInfo",
2: "pageInfo1",
}
this[obj[type]].pageNo = val;
if(type == 1){
this.getList();
} else if (type == 2) {
this.getPartyBuildingGuidanceClickUser(1);
}
},
refresh() {
this.searchForm = {};
this.pagInfo.pageNo = 1; //
this.pagInfo.pageSize = 10; //
this.pageInfo.pageNo = 1; //
this.pageInfo.pageSize = 10; //
this.getList();
},
},
};
</script>
<style lang="less" scoped>
.download {
color: #1684FC;
cursor: pointer;
}
.detailContent {
/deep/ img {
width: 100%;