Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/Report/ReportManager.vue
This commit is contained in:
zer0Black
2023-02-28 22:43:30 +08:00
+224 -196
View File
@@ -341,10 +341,16 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="权限:" required> <el-form-item label="权限:" required>
<el-select v-model="reportF.reportUserIdList" class="icon-auth" multiple collapse-tags <el-select v-model="reportF.reportUserIdList"
class="icon-auth"
multiple
collapse-tags
@change="changeSelect"
@visible-change="changeSelect"
placeholder="请选择"> placeholder="请选择">
<el-checkbox class="check-all" v-model="checked" @change="selectAll">全选</el-checkbox>
<template v-for="item in userList"> <template v-for="item in userList">
<el-option :label="item.ACCOUNT" :value="item.USID" :key="item.USID"></el-option> <el-option :label="item.USNAME" :value="item.USID" :key="item.USID"></el-option>
</template> </template>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -378,11 +384,11 @@
<script> <script>
import {fileType} from '@/utils/fileType' import {fileType} from '@/utils/fileType'
import { downloadFile } from '../../utils/downloadFile' import {downloadFile} from "../../utils/downloadFile";
import {formatDate} from '@/utils/date' import {formatDate} from '@/utils/date'
export default { export default {
name: 'ReportManager', name: "ReportManager",
data() { data() {
return { return {
watermarkText: '', // 水印 watermarkText: '', // 水印
@@ -395,7 +401,7 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
reportName: '', // 报告名称 reportName: '', // 报告名称
startDate: '' // 开始时间 startDate: '', // 开始时间
}, },
qLogTotal: 0, qLogTotal: 0,
qLogDateRange: '', // 开始结束时间 qLogDateRange: '', // 开始结束时间
@@ -430,7 +436,7 @@ export default {
childList: [ childList: [
// {name: '无', type: '3', id: '', parentId: ''}, // {name: '无', type: '3', id: '', parentId: ''},
] ]
} },
}, },
/* =============================================== 报告上传 =============================================== */ /* =============================================== 报告上传 =============================================== */
dialogReport: false, // 报告上传 dialogReport: false, // 报告上传
@@ -448,7 +454,7 @@ export default {
labelTwoName: '', // 标签2 labelTwoName: '', // 标签2
labelThreeId: '', // 标签3 labelThreeId: '', // 标签3
labelThreeName: '', // 标签3 labelThreeName: '', // 标签3
reportUserIdList: [] // 权限 reportUserIdList: [], // 权限
}, },
labelOne: {}, labelOne: {},
labelTwo: {}, labelTwo: {},
@@ -457,8 +463,8 @@ export default {
userList: [], userList: [],
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getFullYear() > new Date().getFullYear() + 1 || time.getFullYear() < new Date().getFullYear() - 10 return time.getFullYear() > new Date().getFullYear() + 1 || time.getFullYear() < new Date().getFullYear() - 10;
} },
}, },
/* =============================================== 列表展示 =============================================== */ /* =============================================== 列表展示 =============================================== */
q: { q: {
@@ -468,100 +474,117 @@ export default {
labelTwoId: [], labelTwoId: [],
labelThreeId: [], labelThreeId: [],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
}, },
total: 0, total: 0,
tableData: [], tableData: [],
yearList: [], yearList: [],
dialogPreview: false, dialogPreview: false,
content: '' content: '',
/* 权限全选 */
checked: false,
mulSelecteds: [], // 已选中选项
} }
}, },
methods: { methods: {
/* 权限全选 */
selectAll() {
this.reportF.reportUserIdList = [];
if (this.checked) {
this.userList.forEach((item) => { this.reportF.reportUserIdList.push(item.USID )});
} else {
this.reportF.reportUserIdList = [];
}
// this.$emit('update:updateMultipleSelect',this.reportF.reportUserIdList);
},
changeSelect(val) {
this.checked = (val.length || this.reportF.reportUserIdList.length) === this.userList.length;
// this.$emit('update:updateMultipleSelect',this.reportF.reportUserIdList);
},
init() { init() {
this.labelList() this.labelList();
this.reset() this.reset();
this.reportDateList() this.reportDateList();
this.sysUserList() this.sysUserList();
}, },
/* =============================================== 操作日志 =============================================== */ /* =============================================== 操作日志 =============================================== */
// 操作日志 // 操作日志
openLog() { openLog() {
this.dialogLog = true this.dialogLog = true;
this.logReset() this.logReset();
}, },
// 日志重置搜索 // 日志重置搜索
logReset() { logReset() {
this.qLogDateRange = '' this.qLogDateRange = '';
this.qLog = { this.qLog = {
doName: '', // 操作类型 doName: '', // 操作类型
endDate: '', // 结束时间 endDate: '', // 结束时间
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
reportName: '', // 报告名称 reportName: '', // 报告名称
startDate: '' // 开始时间 startDate: '', // 开始时间
} };
this.qLogTotal = 0 this.qLogTotal = 0;
this.qLogDateRange = '' // 开始结束时间 this.qLogDateRange = ''; // 开始结束时间
this.logTableData = [] this.logTableData = [];
this.doNames = [] this.doNames = [];
this.reportLogList() this.reportLogList();
}, },
// 搜索 // 搜索
searchLog() { searchLog() {
this.qLog.pageNo = 1 this.qLog.pageNo = 1;
this.reportLogList() this.reportLogList();
}, },
// 报告列表 // 报告列表
reportLogList() { reportLogList() {
this.$api.report.reportLogList(this.qLog) this.$api.report.reportLogList(this.qLog)
.then(({data}) => { .then(({data}) => {
this.logTableData = data.records this.logTableData = data.records;
this.qLogTotal = data.total this.qLogTotal = data.total;
this.qLog.pageNo = data.current this.qLog.pageNo = data.current;
this.qLog.pageSize = data.size this.qLog.pageSize = data.size;
if (!data.records.length && this.qLog.pageNo !== 1) { if (!data.records.length && this.qLog.pageNo !== 1) {
this.qLog.pageNo = 1 this.qLog.pageNo = 1;
this.reportLogList() this.reportLogList();
} }
}) })
}, },
// 单页数据量 // 单页数据量
handleLogSizeChange(val) { handleLogSizeChange(val) {
this.qLog.pageSize = val this.qLog.pageSize = val;
this.qLog.pageNo = 1 this.qLog.pageNo = 1;
this.reportLogList() this.reportLogList();
}, },
// 第几页 // 第几页
handleLogCurrentChange(val) { handleLogCurrentChange(val) {
this.qLog.pageNo = val this.qLog.pageNo = val;
this.reportLogList() this.reportLogList();
}, },
// 日期 // 日期
handleLogDate(val) { handleLogDate(val) {
if (val) { if (val) {
this.qLog.startDate = val[0] this.qLog.startDate = val[0];
this.qLog.endDate = val[1] this.qLog.endDate = val[1];
} else { } else {
this.qLog.startDate = '' this.qLog.startDate = '';
this.qLog.endDate = '' this.qLog.endDate = '';
} }
}, },
handleTyleChange(val){ handleTyleChange(val){
this.qLog.doName = val.join(',') this.qLog.doName = val.join(',');
}, },
/* =============================================== 标签维护 =============================================== */ /* =============================================== 标签维护 =============================================== */
// 标签维护 新增 // 标签维护 新增
addTag(index, type) { addTag(index, type) {
if (this.tagsForm['tags0' + type].childList.length >= 20) { if (this.tagsForm['tags0' + type].childList.length >= 20) {
return this.$message.warning('最多添加20个标签') return this.$message.warning("最多添加20个标签");
} }
const itemData = { name: '', id: '', parentId: this.tagsForm['tags0' + type].id, type: String(type) } let itemData = {name: '', id: "", parentId: this.tagsForm['tags0' + type].id, type: String(type)};
this.tagsForm['tags0' + type].childList.splice(index + 1, 0, itemData) this.tagsForm['tags0' + type].childList.splice(index + 1, 0, itemData);
}, },
// 标签维护 删除 // 标签维护 删除
delTag(index, type) { delTag(index, type) {
const { id, status } = this.tagsForm['tags0' + type].childList[index] let {id, status} = this.tagsForm['tags0' + type].childList[index];
if(status === '1'){ if(status === '1'){
this.$confirm('此标签已应用于报告, 是否删除?', '提示', { this.$confirm('此标签已应用于报告, 是否删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -570,23 +593,23 @@ export default {
}).then(() => { }).then(() => {
if (id) { if (id) {
this.$api.report.labelDeleteId({id}).then(_ => { this.$api.report.labelDeleteId({id}).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.labelList() this.labelList();
}) })
} else { } else {
this.tagsForm['tags0' + type].childList.splice(index, 1) this.tagsForm['tags0' + type].childList.splice(index, 1);
this.$message.success('操作成功') this.$message.success('操作成功');
} }
}) })
}else{ }else{
if (id) { if (id) {
this.$api.report.labelDeleteId({id}).then(_ => { this.$api.report.labelDeleteId({id}).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.labelList() this.labelList();
}) })
} else { } else {
this.tagsForm['tags0' + type].childList.splice(index, 1) this.tagsForm['tags0' + type].childList.splice(index, 1);
this.$message.success('操作成功') this.$message.success('操作成功');
} }
} }
}, },
@@ -597,7 +620,7 @@ export default {
moveType: 'up', moveType: 'up',
type: String(type) type: String(type)
}).then(_=>{ }).then(_=>{
this.labelList() this.labelList();
}) })
}, },
// 下移 // 下移
@@ -607,32 +630,32 @@ export default {
moveType: 'down', moveType: 'down',
type: String(type) type: String(type)
}).then(_=>{ }).then(_=>{
this.labelList() this.labelList();
}) })
}, },
// 标签维护 // 标签维护
openTags() { openTags() {
this.dialogTags = true this.dialogTags = true;
this.labelList() this.labelList();
}, },
// 单个标签保存 // 单个标签保存
handleSaveTag(val, item, type) { handleSaveTag(val, item, type) {
if(val === ''){ if(val === ''){
this.$message.warning('标签名称不能为空') this.$message.warning('标签名称不能为空');
this.labelList() this.labelList();
return return;
} }
if(val === '-'){ if(val === '-'){
this.$message.warning('标签名称不能为-') this.$message.warning('标签名称不能为-');
this.labelList() this.labelList();
return return;
} }
if(this.tagsForm['tags0' + type].childList.filter(item => item.name === val).length > 1){ if(this.tagsForm['tags0' + type].childList.filter(item => item.name === val).length > 1){
this.$message.warning('标签名称不能重复') this.$message.warning('标签名称不能重复');
this.labelList() this.labelList();
return return;
} }
const params = { name: val, parentId: this.tagsForm['tags0' + type].id, type: String(type), id: item.id || '' } let params = {name: val, parentId: this.tagsForm['tags0' + type].id, type: String(type), id: item.id || ''}
if(item.status === '1'){ if(item.status === '1'){
this.$confirm('此标签已应用于报告, 是否编辑?', '提示', { this.$confirm('此标签已应用于报告, 是否编辑?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -640,56 +663,56 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$api.report.labelAdd(params).then(_ => { this.$api.report.labelAdd(params).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.labelList() this.labelList();
}).catch(_ => { }).catch(_ => {
this.labelList() this.labelList();
}) })
}).catch(_=>{ }).catch(_=>{
this.labelList() this.labelList();
}) })
}else{ }else{
this.$api.report.labelAdd(params).then(_ => { this.$api.report.labelAdd(params).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.labelList() this.labelList();
}).catch(_ => { }).catch(_ => {
this.labelList() this.labelList();
}) })
} }
}, },
// 单个顶级标签保存 // 单个顶级标签保存
handleSaveTopTag(val, type) { handleSaveTopTag(val, type) {
if(val === ''){ if(val === ''){
this.$message.warning('标签名称不能为空') this.$message.warning('标签名称不能为空');
this.labelList() this.labelList();
return return;
} }
if(val === '-'){ if(val === '-'){
this.$message.warning('标签名称不能为-') this.$message.warning('标签名称不能为-');
this.labelList() this.labelList();
return return;
} }
if(type === 1 && (val === this.tagsForm.tags02.name || val === this.tagsForm.tags03.name)){ if(type === 1 && (val === this.tagsForm.tags02.name || val === this.tagsForm.tags03.name)){
this.$message.warning('标签名称不能重复') this.$message.warning('标签名称不能重复');
this.labelList() this.labelList();
return return;
} }
if(type === 2 && (val === this.tagsForm.tags01.name || val === this.tagsForm.tags03.name)){ if(type === 2 && (val === this.tagsForm.tags01.name || val === this.tagsForm.tags03.name)){
this.$message.warning('标签名称不能重复') this.$message.warning('标签名称不能重复');
this.labelList() this.labelList();
return return;
} }
if(type === 3 && (val === this.tagsForm.tags01.name || val === this.tagsForm.tags02.name)){ if(type === 3 && (val === this.tagsForm.tags01.name || val === this.tagsForm.tags02.name)){
this.$message.warning('标签名称不能重复') this.$message.warning('标签名称不能重复');
this.labelList() this.labelList();
return return;
} }
const params = { name: val, id: this.tagsForm['tags0' + type].id, parentId: '0', type: String(type) } let params = {name: val, id: this.tagsForm['tags0' + type].id, parentId: '0', type: String(type)};
this.$api.report.labelAdd(params).then(_ => { this.$api.report.labelAdd(params).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.labelList() this.labelList();
}).catch(_ => { }).catch(_ => {
this.labelList() this.labelList();
}) })
}, },
// 标签列表 // 标签列表
@@ -704,52 +727,53 @@ export default {
if(!data.labelThree.childList.length){ if(!data.labelThree.childList.length){
data.labelThree.childList = [{name: '', id: '', parentId: this.tagsForm.tags03.id, type: '3'}] data.labelThree.childList = [{name: '', id: '', parentId: this.tagsForm.tags03.id, type: '3'}]
} }
this.tagsForm.tags01 = data.labelOne this.tagsForm.tags01 = data.labelOne;
this.tagsForm.tags02 = data.labelTwo this.tagsForm.tags02 = data.labelTwo;
this.tagsForm.tags03 = data.labelThree this.tagsForm.tags03 = data.labelThree;
}) })
}, },
handleTagsClose(){ handleTagsClose(){
this.dialogTags = false this.dialogTags = false;
this.labelList() this.labelList();
this.reset() this.reset();
}, },
// 保存标签 // 保存标签
saveTags() { saveTags() {
const tagsForm = JSON.parse(JSON.stringify(this.tagsForm)) let tagsForm = JSON.parse(JSON.stringify(this.tagsForm));
const params = { let params = {
labelList: [ labelList: [
tagsForm.tags01, tagsForm.tags01,
tagsForm.tags02, tagsForm.tags02,
tagsForm.tags03 tagsForm.tags03
] ]
} }
let isSave = true let isSave = true;
params.labelList.forEach(item => { params.labelList.forEach(item => {
if(!item.name || item.name === '-'){ if(!item.name || item.name === '-'){
isSave = false isSave = false;
return return
} }
item.childList.forEach(ele => { item.childList.forEach(ele => {
if(!ele.name || item.name === '-'){ if(!ele.name || item.name === '-'){
isSave = false isSave = false;
return
} }
}) })
}) })
if(!isSave){ if(!isSave){
return this.$message.warning('标签名称不能为空') return this.$message.warning('标签名称不能为空');
} }
this.$api.report.labelSave(params).then(_ => { this.$api.report.labelSave(params).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.dialogTags = false this.dialogTags = false;
this.labelList() this.labelList();
this.reset() this.reset();
}) })
}, },
/* =============================================== 报告上传 =============================================== */ /* =============================================== 报告上传 =============================================== */
// 打开报告上传 // 打开报告上传
openReportAdd() { openReportAdd() {
this.mode = 'add' this.mode = 'add';
this.reportF = { this.reportF = {
name: '', // 报告名称 name: '', // 报告名称
keyContent: '', // 关键词 keyContent: '', // 关键词
@@ -764,122 +788,122 @@ export default {
labelTwoName: '', // 标签2 labelTwoName: '', // 标签2
labelThreeId: '', // 标签3 labelThreeId: '', // 标签3
labelThreeName: '', // 标签3 labelThreeName: '', // 标签3
reportUserIdList: [] // 权限 reportUserIdList: [], // 权限
} };
this.labelOne = {} this.labelOne = {};
this.labelTwo = {} this.labelTwo = {};
this.labelThree = {} this.labelThree = {};
this.labelList() this.labelList();
this.dialogReport = true this.dialogReport = true;
}, },
// 选择标签 // 选择标签
handleSelectTag(val, type) { handleSelectTag(val, type) {
switch (type) { switch (type) {
case 1: case 1:
this.reportF.labelOneId = val.id this.reportF.labelOneId = val.id;
this.reportF.labelOneName = val.name this.reportF.labelOneName = val.name;
break break;
case 2: case 2:
this.reportF.labelTwoId = val.id this.reportF.labelTwoId = val.id;
this.reportF.labelTwoName = val.name this.reportF.labelTwoName = val.name;
break break;
case 3: case 3:
this.reportF.labelThreeId = val.id this.reportF.labelThreeId = val.id;
this.reportF.labelThreeName = val.name this.reportF.labelThreeName = val.name;
break break;
} }
}, },
// 必填项 // 必填项
checkReportF() { checkReportF() {
if (!this.reportF.name) { if (!this.reportF.name) {
return this.$message.warning('请检查报告名称') && false return this.$message.warning('请检查报告名称') && false;
} }
if (!this.reportF.fileId || !this.reportF.fileName) { if (!this.reportF.fileId || !this.reportF.fileName) {
return this.$message.warning('请检查上传文件') && false return this.$message.warning('请检查上传文件') && false;
} }
if (!this.reportF.year) { if (!this.reportF.year) {
return this.$message.warning('请检查报告年份') && false return this.$message.warning('请检查报告年份') && false;
} }
if (!this.reportF.labelOneId || !this.reportF.labelOneName || this.reportF.labelOneName === '-' ) { if (!this.reportF.labelOneId || !this.reportF.labelOneName || this.reportF.labelOneName === '-' ) {
return this.$message.warning(`请检查${this.tagsForm.tags01.name}`) && false return this.$message.warning(`请检查${this.tagsForm.tags01.name}`) && false;
} }
if (!this.reportF.labelTwoId || !this.reportF.labelTwoName || this.reportF.labelTwoName === '-') { if (!this.reportF.labelTwoId || !this.reportF.labelTwoName || this.reportF.labelTwoName === '-') {
return this.$message.warning(`请检查${this.tagsForm.tags02.name}`) && false return this.$message.warning(`请检查${this.tagsForm.tags02.name}`) && false;
} }
if (!this.reportF.labelThreeId || !this.reportF.labelThreeName || this.reportF.labelThreeName === '-') { if (!this.reportF.labelThreeId || !this.reportF.labelThreeName || this.reportF.labelThreeName === '-') {
return this.$message.warning(`请检查${this.tagsForm.tags03.name}`) && false return this.$message.warning(`请检查${this.tagsForm.tags03.name}`) && false;
} }
if (!this.reportF.reportUserIdList || !this.reportF.reportUserIdList.length) { if (!this.reportF.reportUserIdList || !this.reportF.reportUserIdList.length) {
return this.$message.warning('请检查权限') && false return this.$message.warning('请检查权限') && false;
} }
return true return true;
}, },
// 新增或编辑报告 // 新增或编辑报告
reportAdd() { reportAdd() {
if (!this.checkReportF()) return if (!this.checkReportF()) return;
this.$api.report.reportAdd(this.reportF).then(_ => { this.$api.report.reportAdd(this.reportF).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.dialogReport = false this.dialogReport = false;
this.reset() this.reset();
}) })
}, },
// 上传文件 // 上传文件
uploadFile(params) { uploadFile(params) {
const fd = new FormData() let fd = new FormData();
fd.append('file', params.file) fd.append('file', params.file);
this.$api.report.reportUploadFile(fd).then(({data}) => { this.$api.report.reportUploadFile(fd).then(({data}) => {
this.reportF.fileName = data.name this.reportF.fileName = data.name;
this.reportF.fileId = data.key this.reportF.fileId = data.key;
}) })
}, },
// 上传文件前 // 上传文件前
beforeUploadFile(file) { beforeUploadFile(file) {
const realFileType = file.name.split('.')[file.name.split('.').length - 1] let realFileType = file.name.split('.')[file.name.split('.').length - 1];
const isType = ( const isType = (
file.type === fileType.pdf || file.type === fileType.xls || file.type === fileType.xlsx || file.type === fileType.doc || file.type === fileType.docx || file.type === fileType.ppt || file.type === fileType.pptx || file.type === fileType.pdf || file.type === fileType.xls || file.type === fileType.xlsx || file.type === fileType.doc || file.type === fileType.docx || file.type === fileType.ppt || file.type === fileType.pptx
realFileType === 'pdf' || realFileType === 'xls' || realFileType === 'xlsx' || realFileType === 'doc' || realFileType === 'docx' || realFileType === 'ppt' || realFileType === 'pptx' || realFileType === 'pdf' || realFileType === 'xls' || realFileType === 'xlsx' || realFileType === 'doc' || realFileType === 'docx' || realFileType === 'ppt' || realFileType === 'pptx'
) );
const isSize = file.size / 1024 / 1024 < 200 const isSize = file.size / 1024 / 1024 < 200;
if (!isType) { if (!isType) {
this.$message.error('仅能上传 pdfxlsxlsxdocdocxpptpptx 格式文件') this.$message.error('仅能上传 pdfxlsxlsxdocdocxpptpptx 格式文件');
} }
if (!isSize) { if (!isSize) {
this.$message.error('您最大可上传200M文件') this.$message.error('您最大可上传200M文件');
} }
return isType && isSize return isType && isSize;
}, },
// 重置 // 重置
resetUploadFile() { resetUploadFile() {
this.reportF.fileId = '' this.reportF.fileId = '';
this.reportF.fileName = '' this.reportF.fileName = '';
}, },
// 打开报告上传 // 打开报告上传
openReportModify(mode, row) { openReportModify(mode, row) {
this.mode = mode this.mode = mode;
this.labelList() this.labelList();
const rowData = JSON.parse(JSON.stringify(row)) let rowData = JSON.parse(JSON.stringify(row));
if(rowData.labelOneName !== '-'){ if(rowData.labelOneName !== '-'){
this.labelOne = { id: rowData.labelOneId, rowData: rowData.labelOneName } this.labelOne = {id: rowData.labelOneId, rowData: rowData.labelOneName};
}else{ }else{
this.labelOne = {} this.labelOne = {};
} }
if(rowData.labelTwoName !== '-'){ if(rowData.labelTwoName !== '-'){
this.labelTwo = { id: rowData.labelTwoId, name: rowData.labelTwoName } this.labelTwo = {id: rowData.labelTwoId, name: rowData.labelTwoName};
}else{ }else{
this.labelTwo = {} this.labelTwo = {};
} }
if(rowData.labelThreeName !== '-'){ if(rowData.labelThreeName !== '-'){
this.labelThree = { id: rowData.labelThreeId, name: rowData.labelThreeName } this.labelThree = {id: rowData.labelThreeId, name: rowData.labelThreeName};
}else{ }else{
this.labelThree = {} this.labelThree = {};
} }
this.reportF = rowData this.reportF = rowData;
this.dialogReport = true this.dialogReport = true;
}, },
// 获取所有用户 // 获取所有用户
sysUserList() { sysUserList() {
this.$api.user.sysUserList({pageNo: 1, pageSize: 999999}).then(({data}) => { this.$api.user.sysUserList({pageNo: 1, pageSize: 999999}).then(({data}) => {
this.userList = data.records this.userList = data.records;
}) })
}, },
/* =============================================== 列表展示 =============================================== */ /* =============================================== 列表展示 =============================================== */
@@ -892,12 +916,12 @@ export default {
labelTwoId: [], labelTwoId: [],
labelThreeId: [], labelThreeId: [],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
} };
this.total = 0 this.total = 0;
this.tableData = [] this.tableData = [];
this.reportList() this.reportList();
this.reportDateList() this.reportDateList();
}, },
// 报告删除 // 报告删除
reportDelete(ids) { reportDelete(ids) {
@@ -907,54 +931,54 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$api.report.reportDelete({ids}).then(_ => { this.$api.report.reportDelete({ids}).then(_ => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reportList() this.reportList();
this.reportDateList() this.reportDateList();
}) })
}) })
}, },
search() { search() {
this.q.pageNo = 1 this.q.pageNo = 1;
this.reportList() this.reportList();
}, },
// 列表 // 列表
reportList() { reportList() {
this.$api.report.reportList(this.q).then(({data}) => { this.$api.report.reportList(this.q).then(({data}) => {
this.tableData = data.records this.tableData = data.records;
this.total = data.total this.total = data.total;
this.q.pageNo = data.current this.q.pageNo = data.current;
this.q.pageSize = data.size this.q.pageSize = data.size;
if (!data.records.length && this.q.pageNo !== 1) { if (!data.records.length && this.q.pageNo !== 1) {
this.q.pageNo = 1 this.q.pageNo = 1;
this.reportList() this.reportList();
} }
}) })
}, },
// 日期列表 // 日期列表
reportDateList() { reportDateList() {
this.$api.report.reportDateList().then(({data}) => { this.$api.report.reportDateList().then(({data}) => {
this.yearList = data.list this.yearList = data.list;
}) })
}, },
// 单页数据量 // 单页数据量
handleSizeChange(val) { handleSizeChange(val) {
this.q.pageSize = val this.q.pageSize = val;
this.q.pageNo = 1 this.q.pageNo = 1;
this.reportList() this.reportList();
}, },
// 第几页 // 第几页
handleCurrentChange(val) { handleCurrentChange(val) {
this.q.pageNo = val this.q.pageNo = val;
this.reportList() this.reportList();
}, },
// 预览 // 预览
previewRow(row) { previewRow(row) {
this.fullscreen = false this.fullscreen = false;
// 更新预览水印的时间戳 // 更新预览水印的时间戳
this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}` this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}`;
this.$api.report.reportGetReportHtmlId({id: row.id}).then(({data}) => { this.$api.report.reportGetReportHtmlId({id: row.id}).then(({data}) => {
this.content = data.content this.content = data.content;
this.dialogPreview = true this.dialogPreview = true;
}) })
}, },
// 下载 // 下载
@@ -965,18 +989,22 @@ export default {
// type: 'warning' // type: 'warning'
// }).then(() => { // }).then(() => {
this.$api.report.reportDownload({fileId: row.fileId}).then(res => { this.$api.report.reportDownload({fileId: row.fileId}).then(res => {
downloadFile(res) downloadFile(res);
}) })
// }) // })
} },
}, },
created() { created() {
this.init() this.init();
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.check-all {
text-align: right;
width: 95%;
}
.report-manager { .report-manager {
.title { .title {
border-bottom: 1px solid #EBEEF5; border-bottom: 1px solid #EBEEF5;