lambo-design-bi 0.0.197 → 0.0.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -80,10 +80,14 @@ export default {
|
|
|
80
80
|
for (let i = 1; i < columns.length; i++) {
|
|
81
81
|
let col = columns[i]
|
|
82
82
|
let colKey = col.key
|
|
83
|
-
if (Object.prototype.hasOwnProperty.call(allSumObj, colKey)) {
|
|
83
|
+
if (Object.prototype.hasOwnProperty.call(col, "hasSum") && (col["hasSum"] === "true" || col["hasSum"] === true) && Object.prototype.hasOwnProperty.call(allSumObj, colKey)) {
|
|
84
|
+
let sumVal = allSumObj[colKey]
|
|
85
|
+
if (sumVal === null || sumVal === undefined) {
|
|
86
|
+
sumVal = ''
|
|
87
|
+
}
|
|
84
88
|
sums[colKey] = {
|
|
85
89
|
key: colKey,
|
|
86
|
-
value:
|
|
90
|
+
value: sumVal
|
|
87
91
|
}
|
|
88
92
|
} else {
|
|
89
93
|
sums[colKey] = {
|
|
@@ -99,7 +103,8 @@ export default {
|
|
|
99
103
|
const key = column.key
|
|
100
104
|
if (index > 0) {
|
|
101
105
|
const values = data.map(item => Number(item[key]))
|
|
102
|
-
if (
|
|
106
|
+
if (Object.prototype.hasOwnProperty.call(column, "hasSum") && (column["hasSum"] === "true" || column["hasSum"] === true)
|
|
107
|
+
&& values && values.length > 0 && !values.every(value => isNaN(value))) {
|
|
103
108
|
const v = values.reduce((prev, curr) => {
|
|
104
109
|
const value = Number(curr)
|
|
105
110
|
if (!isNaN(value)) {
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable -->
|
|
1
2
|
<template>
|
|
2
3
|
<div class="export-data">
|
|
3
4
|
<Row type="flex" justify="center">
|
|
@@ -36,12 +37,12 @@
|
|
|
36
37
|
</div>
|
|
37
38
|
</template>
|
|
38
39
|
<script>
|
|
39
|
-
|
|
40
|
+
/* eslint-disable */
|
|
41
|
+
import ajax from '@lambo-design/shared/utils/ajax';
|
|
40
42
|
import excel from '@lambo-design/shared/utils/excel'
|
|
41
|
-
import { deepCopy } from
|
|
43
|
+
import { deepCopy } from "@lambo-design/shared/utils/assist";
|
|
42
44
|
import LamboPercentProgress from '@lambo-design/percent-progress'
|
|
43
|
-
import ExportDrawer from "./export-drawer
|
|
44
|
-
|
|
45
|
+
import ExportDrawer from "./export-drawer";
|
|
45
46
|
export default {
|
|
46
47
|
name: 'export-data',
|
|
47
48
|
components: {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
<!-- eslint-disable -->
|
|
1
2
|
<template>
|
|
2
|
-
<Drawer title="导出列表" width="400" v-
|
|
3
|
-
<LamboFileList class="demo-drawer-body" v-if="value" :files="fileList" @on-file-remove="handleRemove"
|
|
3
|
+
<Drawer title="导出列表" width="400" v-model="value" :mask-closable="false">
|
|
4
|
+
<LamboFileList class="demo-drawer-body" v-if="value" :files="fileList" @on-file-remove="handleRemove"
|
|
5
|
+
@on-file-preview="exportFile"></LamboFileList>
|
|
4
6
|
<div class="demo-drawer-footer">
|
|
5
7
|
<Button style="margin-right: 8px" @click="onCancel">关闭</Button>
|
|
6
8
|
<Button type="primary" :loading="exportLoading" @click="exportIndex(0)">开始导出</Button>
|
|
7
9
|
</div>
|
|
8
10
|
</Drawer>
|
|
9
11
|
</template>
|
|
10
|
-
|
|
11
12
|
<script>
|
|
13
|
+
/* eslint-disable */
|
|
12
14
|
import ajax from '@lambo-design/shared/utils/ajax';
|
|
13
15
|
import excel from '@lambo-design/shared/utils/excel'
|
|
14
16
|
import { deepCopy, isJson } from "@lambo-design/shared/utils/assist";
|