@nstc-business/imes 1.0.16 → 1.0.17
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.
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
v-else
|
|
6
6
|
border
|
|
7
7
|
:data="rows"
|
|
8
|
+
:merge-cells="mergeCells"
|
|
8
9
|
:row-config="{ keyField: '_rowKey' }"
|
|
9
10
|
:scroll-y="{ enabled: false }"
|
|
10
11
|
>
|
|
@@ -118,6 +119,7 @@
|
|
|
118
119
|
|
|
119
120
|
<script>
|
|
120
121
|
import { InputNumber } from './ui'
|
|
122
|
+
import { setMergeCells } from '../common'
|
|
121
123
|
import {
|
|
122
124
|
isQualIndicator,
|
|
123
125
|
digitsCalc,
|
|
@@ -125,6 +127,16 @@ import {
|
|
|
125
127
|
indicatorResultText
|
|
126
128
|
} from './helpers'
|
|
127
129
|
|
|
130
|
+
/** 与表格列顺序一致,供 setMergeCells 计算列索引 */
|
|
131
|
+
const STAT_FLAT_COLUMNS = [
|
|
132
|
+
{ prop: 'pName' },
|
|
133
|
+
{ prop: 'statsName' },
|
|
134
|
+
{ prop: 'name' },
|
|
135
|
+
{ prop: 'indicatorResult' },
|
|
136
|
+
{ prop: 'result' },
|
|
137
|
+
{ prop: 'indicatorValText' }
|
|
138
|
+
]
|
|
139
|
+
|
|
128
140
|
export default {
|
|
129
141
|
name: 'MeasureStatFlatTable',
|
|
130
142
|
components: { InputNumber },
|
|
@@ -138,6 +150,16 @@ export default {
|
|
|
138
150
|
computed: {
|
|
139
151
|
ctx() {
|
|
140
152
|
return this.measureCtx()
|
|
153
|
+
},
|
|
154
|
+
/** 同目录(pid)下的「指标项」列合并,对齐旧版 modelCalcTest */
|
|
155
|
+
mergeCells() {
|
|
156
|
+
return setMergeCells({
|
|
157
|
+
list: this.rows,
|
|
158
|
+
columns: STAT_FLAT_COLUMNS,
|
|
159
|
+
merges: ['pName'],
|
|
160
|
+
condition: ['pid'],
|
|
161
|
+
field: 'prop'
|
|
162
|
+
})
|
|
141
163
|
}
|
|
142
164
|
},
|
|
143
165
|
methods: {
|
|
@@ -287,9 +287,12 @@ export function collectStatFlatRows(modelWrap, statNode) {
|
|
|
287
287
|
const rows = []
|
|
288
288
|
|
|
289
289
|
const pushIndicators = (groupNode, pName) => {
|
|
290
|
+
const groupPid = groupNode.itemID || groupNode.tid || groupNode.pid
|
|
290
291
|
statItemChildren(groupNode).forEach(ind => {
|
|
291
292
|
if (ind.itemType == 21 || ind.itemType == 22 || ind.isLeaf == 1) {
|
|
292
293
|
if (!ind.pName) ind.pName = pName
|
|
294
|
+
// 合并单元格按 pid 分组;缺省时回落到目录节点 id
|
|
295
|
+
if (ind.pid == null || ind.pid === '') ind.pid = groupPid
|
|
293
296
|
rows.push(ind)
|
|
294
297
|
}
|
|
295
298
|
})
|