Browse Source

智能报表查看

luckysheet_xiaowang
mk 1 year ago
parent
commit
adfe91b569
  1. 34
      src/views/modules/base/smartExcel/cpts/export-view.vue

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

@ -23,7 +23,7 @@
</el-dialog>
<el-dialog title="数据统计条件" v-if="showCondition" :visible.sync="showCondition" width="60%"
:close-on-click-modal="false">
<resi-search ref="resi_form" :infoObj="infoObj"></resi-search>
<resi-search ref="resi_form" :infoObj="infoObj.searchForm"></resi-search>
</el-dialog>
</div>
@ -75,9 +75,30 @@ export default {
watch: {},
async mounted() {
await this.loadWorkBook()
if (this.pageType === 'info') {
this.$nextTick( async ()=>{
if (this.pageType === 'info') {
await this.getSheetList()
let heading = this.infoObj.columnsJson[0].children.map(item=>({label:item.label}))
for(let i in heading){
luckysheet.setCellValue(0,i,heading[i].label)
}
let list = await this.getListData(this.infoIds.id);
let newArrar = luckysheet.getAllSheets();
this.currentTable = newArrar.filter(item => item.status == '1');
luckysheet.insertRow(this.currentTable[0].data.length, 1)
luckysheet.insertRow(this.currentTable[0].data.length, { number: list.length });
await nextTick(500)
let newArray = list.map(obj => {
return Object.keys(obj).map(key => {
return { m: obj[key], "ct": { "fa": "General", "t": "g" }, v: obj[key] };
});
});
let bottomRightCorner = this.numberToLetter(Object.keys(list[0]).length)//
luckysheet.setRangeValue(newArray, {
range: `A2:${bottomRightCorner}${2 + list.length}`,
})
}
})
},
methods: {
onClickShowCondition(){
@ -86,7 +107,7 @@ export default {
async getSheetList() {
const { data, code } = await requestGet('/actual/base/intellgentizeReport/detail', { id: this.infoIds.id })
if (code === 0) {
this.infoObj = data.searchForm
this.infoObj = data;
}
},
handleClickCurrencyEvent() {
@ -157,12 +178,7 @@ export default {
options.allowUpdate = true;
options.container = 'luckysheet'
options.gridKey = this.pageType === 'info' ? this.infoIds.workbookId : null;
if (this.pageType === 'info') {
options.loadUrl = `${process.env.VUE_APP_API_SERVER}/actual/base/luckySheet/workbook/load?workbookId=${this.infoIds.workbookId}`
}else{
options.loadUrl = null
}
// options.updateUrl = `${process.env.VUE_APP_SOCKET_SERVER}/actual/base/ws/luckysheet/${this.currentId}/${id}`
options.loadUrl = null
window.luckysheet.create({
...options,
});

Loading…
Cancel
Save