Browse Source

智能报表重新给单元格赋值功能,清空单元格数据功能

luckysheet_xiaowang
mk 1 year ago
parent
commit
9486dbd13d
  1. 2
      public/luckysheet/luckysheet.umd.js
  2. 4
      public/luckysheet/luckysheet.umd.js.map
  3. 52
      src/views/modules/base/smartExcel/cpts/export-view.vue

2
public/luckysheet/luckysheet.umd.js

File diff suppressed because one or more lines are too long

4
public/luckysheet/luckysheet.umd.js.map

File diff suppressed because one or more lines are too long

52
src/views/modules/base/smartExcel/cpts/export-view.vue

@ -19,7 +19,7 @@
<el-dialog title="数据列表导出" v-if="showUploadData" :visible.sync="showUploadData" width="60%"
:close-on-click-modal="false">
<excelUploadData @handleUploadDataHide="handleUploadDataHide" :currentTable="currentTable"
:btnLoading="btnLoading" :pageType='`report`' :workBookId="workBookId" @saveLuckysheetHead="saveLuckysheetHead">
:btnLoading="btnLoading" :pageType='`report`' :workBookId="dataForm.workbookId" @saveLuckysheetHead="saveLuckysheetHead">
</excelUploadData>
</el-dialog>
<el-dialog title="数据统计条件" v-if="showCondition" :visible.sync="showCondition" width="60%"
@ -34,7 +34,7 @@
</el-form-item>
<el-form-item label="上传模板">
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" :action="uploadUlr"
v-if="!dataForm.moduleUrl" :limit="1" :accept="'.xlsx'" :with-credentials="true" :show-file-list="false"
v-if="!moduleUrl" :limit="1" :accept="'.xlsx'" :with-credentials="true" :show-file-list="false"
:auto-upload="true" :on-success="handleExcelSuccess" :before-upload="beforeExcelUpload">
<template #trigger>
<el-button type="primary" v-loading.fullscreen.lock="fullscreenLoading">上传报表模板</el-button>
@ -456,6 +456,8 @@ export default {
myLabelList:[],
showConditionDetailsDialog:false,
luckysheetLoading:false,
reportId:'',
moduleUrl:''
};
},
props: {
@ -477,6 +479,7 @@ export default {
created() { },
watch: {},
async mounted() {
this.reportId = this.infoIds.id
await this.getLabelList();
this.$nextTick(async () => {
if (this.pageType === 'info') {
@ -489,7 +492,7 @@ export default {
for (let i in heading) {
luckysheet.setCellValue(0, i, heading[i].label)
}
let list = await this.getListData(this.infoIds.id);
let list = await this.getListData(this.reportId);
let newArrar = luckysheet.getAllSheets();
this.currentTable = newArrar.filter(item => item.status == '1');
if(this.currentTable[0].data.length < list.length){
@ -537,7 +540,7 @@ export default {
},
async allReportValue() {
let url = '/actual/base/intellgentizeReport/calculateStatsResult4Report'
const { data, code, msg } = await requestGet(url, { reportId: this.infoIds.id })
const { data, code, msg } = await requestGet(url, { reportId: this.reportId })
if (code === 0) {
for (let key in data) {
const [col, row] = key.match(/^([A-Z]+)(\d+)$/).slice(1);
@ -609,7 +612,6 @@ export default {
};
this.searchList = await this.fetchData(url1, params1);
this.myLabelList = await this.fetchData(url2, params2);
},
@ -648,14 +650,11 @@ export default {
let url = '/actual/base/intellgentizeReport/removeConditions4Cell'
const parm = {
axis: this.selectedCell,
reportId: this.infoIds.id
reportId: this.reportId
}
const { code } = await requestPost(url, parm)
if (code === 0) {
luckysheet.setCellValue(this.selectedCellNumberType[0], this.selectedCellNumberType[1], '0')
}else{
luckysheet.setCellValue(this.selectedCellNumberType[0], this.selectedCellNumberType[1], '0')
$('#luckysheet-rich-text-editor').text(' ');
}
},
async addSubmit() {
@ -681,13 +680,13 @@ export default {
let parm = {
axis: this.selectedCell,
tagId: this.tagForm.tagId,
reportId: this.infoIds.id
reportId: this.reportId
}
const { data, code, msg } = await requestPost(url, parm)
if (code === 0) {
this.statisticsLoading = false;
luckysheet.setCellValue(this.selectedCellNumberType[0], this.selectedCellNumberType[1], data)
this.drawer = false;
$('#luckysheet-rich-text-editor').text(data);
}else{
this.statisticsLoading = false;
this.$message.error(msg)
@ -698,7 +697,7 @@ export default {
let url = '/actual/base/intellgentizeReport/getConditions4Cell';
let parm = {
axis: this.selectedCell,
reportId: this.infoIds.id
reportId: this.reportId
}
const { data, code, msg } = await requestGet(url, parm)
if (code === 0) {
@ -786,7 +785,6 @@ export default {
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.$set(this.tableData[index], "itemIdOpction", data);
console.log(this.tableData[index].itemIdOpction, "see");
} else {
this.$message.error(msg);
}
@ -917,7 +915,7 @@ export default {
},
handleExcelSuccess(e) {
if (e.code === 0) {
// this.moduleUrl = e.data.url;
this.moduleUrl = e.data.url;
// this.urlToFile(e.data.url)
this.showTemplate = false;
this.urlToFile('http://localhost:9001/epmet-work-pc/test1.xlsx')
@ -992,7 +990,7 @@ export default {
async getFrequentlyTags() {
let url = '/actual/base/intellgentizeReport/listFrequentlyTags';
let parm = {
reportId: this.infoIds.id
reportId: this.reportId
};
const { data, msg, code } = await requestGet(url, parm);
if (code === 0) {
@ -1007,17 +1005,6 @@ export default {
this.drawer = false;
this.selectedCell = "";
},
handleCellUpdated(r, c, oldValue, newValue, isRefresh) {
// console.log(r, c, oldValue, newValue,isRefresh);
// newValue.v 0
if (oldValue.v === '0'){
luckysheet.setCellValue(r, c, oldValue.v);
}else{
if (oldValue.m && (newValue.v == null || newValue.v === '')) {
luckysheet.setCellValue(r, c, oldValue.v);
}
}
},
beforeExcelUpload(file) {
@ -1041,14 +1028,14 @@ export default {
this.showCondition = true;
},
async getSheetList() {
const { data, code } = await requestGet('/actual/base/intellgentizeReport/detail', { id: this.infoIds.id })
const { data, code } = await requestGet('/actual/base/intellgentizeReport/detail', { id: this.reportId })
if (code === 0) {
this.infoObj = data;
}
},
async handleClickExport() {
exportSheetExcel(luckysheet.getAllSheets(), '导出文件')
const {code} = await requestPost('/actual/base/intellgentizeReport/createExportRecord',{reportId:this.infoIds.id})
const {code} = await requestPost('/actual/base/intellgentizeReport/createExportRecord',{reportId:this.reportId})
if(code === 0){
this.$message.success('导出成功')
}
@ -1100,12 +1087,11 @@ export default {
console.log(msg);
}
},
//
async createdReport() {
const url = '/actual/base/intellgentizeReport/create'
let { data, code, msg } = await requestPost(url, this.dataForm)
if (code === 0) {
console.log(data);
this.reportId = data;
} else {
console.log(msg);
}
@ -1137,8 +1123,6 @@ export default {
hook: {
cellEditBefore: that.handleCellEditBefore,
cellUpdateBefore: that.handleCellUpdateBefore,
// cellUpdated: that.handleCellUpdated
}
});
},

Loading…
Cancel
Save