@nstc-business/imes 1.0.24 → 1.0.25

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nstc-business/imes",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -372,6 +372,25 @@ export default {
372
372
  item1.children[0].children &&
373
373
  item1.children[0].children.map(item => {
374
374
  const obj = item1.statsResultList.find(stats => stats.name == item.statsName)
375
+ // 指标取数:任一行开启「是否展示满分值」则插入满分值列
376
+ const showFullScoreCol =
377
+ obj &&
378
+ obj.calType == 0 &&
379
+ item1.children.some(row => {
380
+ const child = (row.children || []).find(c => c.statsName === item.statsName)
381
+ return child && child.showFullScore !== 0
382
+ })
383
+ if (showFullScoreCol) {
384
+ columns.push({
385
+ label: item.statsName + '满分值',
386
+ prop: item.statsName + '满分值',
387
+ slotName: item.statsName + '满分值',
388
+ disabled: true,
389
+ isFullScore: true,
390
+ width: '200px',
391
+ align: 'center'
392
+ })
393
+ }
375
394
  const label = obj.calType == 0 ? item.statsName + '指标值' : item.statsName
376
395
  const columnsItem = {
377
396
  label: label,
@@ -443,6 +462,18 @@ export default {
443
462
  value = obj
444
463
  }
445
464
  }
465
+ if ([0].includes(obj.calType) && item.showFullScore !== 0) {
466
+ const fullScore =
467
+ item.fullScore === 0 || item.fullScore ? item.fullScore : ''
468
+ listItem[item.statsName + '满分值'] = {
469
+ ...item,
470
+ value: fullScore,
471
+ result: fullScore,
472
+ sourceType: '',
473
+ displayStyle: 0,
474
+ calcState: false
475
+ }
476
+ }
446
477
  if ([0].includes(obj.calType)) {
447
478
  // 得分列清空 sourceType 得分列用result
448
479
  listItem[item.statsName + '指标得分'] = {
@@ -53,7 +53,12 @@
53
53
  </template>
54
54
  </vxe-column>
55
55
 
56
- <vxe-column title="指标满分值" width="110" align="center">
56
+ <vxe-column
57
+ v-if="showFullScoreCol"
58
+ title="指标满分值"
59
+ width="110"
60
+ align="center"
61
+ >
57
62
  <template #default="{ row }">{{ fullScoreFn(row) }}</template>
58
63
  </vxe-column>
59
64
 
@@ -99,7 +104,19 @@
99
104
  </el-option>
100
105
  </el-select>
101
106
  </template>
102
- <template v-else>
107
+ <div v-else>
108
+ <!-- 原指标值:非手工填报始终展示;可调整时输入框在下方 -->
109
+ <el-tooltip
110
+ v-if="row.sourceType !== 3 && (row.displayFormula || row.relFormula)"
111
+ placement="top"
112
+ effect="dark"
113
+ >
114
+ <template #content>
115
+ <div>{{ row.displayFormula }}</div>
116
+ </template>
117
+ <span>{{ indicatorTextFn(row) }}</span>
118
+ </el-tooltip>
119
+ <span v-else-if="row.sourceType !== 3">{{ indicatorTextFn(row) }}</span>
103
120
  <InputNumber
104
121
  v-if="row.sourceType === 3 && row.itemType === 21"
105
122
  class="full-w"
@@ -121,19 +138,9 @@
121
138
  :d-num="digitsFn(row)"
122
139
  :disabled="ctx.readonly"
123
140
  v-model="resolveRow(row).value"
141
+ placeholder="请输入"
124
142
  />
125
- <el-tooltip
126
- v-else-if="row.displayFormula || row.relFormula"
127
- placement="top"
128
- effect="dark"
129
- >
130
- <template #content>
131
- <div>{{ row.displayFormula }}</div>
132
- </template>
133
- <span>{{ indicatorTextFn(row) }}</span>
134
- </el-tooltip>
135
- <span v-else>{{ indicatorTextFn(row) }}</span>
136
- </template>
143
+ </div>
137
144
  </template>
138
145
  </vxe-column>
139
146
 
@@ -227,7 +234,8 @@ import {
227
234
  indicatorScoreText,
228
235
  indicatorResultText,
229
236
  fullScoreText,
230
- showLevelSerial
237
+ showLevelSerial,
238
+ isShowFullScore
231
239
  } from './helpers'
232
240
 
233
241
  export default {
@@ -261,6 +269,9 @@ export default {
261
269
  showRemarkCol() {
262
270
  return this.resolveShowFlag('showRemark')
263
271
  },
272
+ showFullScoreCol() {
273
+ return (this.rows || []).some(row => isShowFullScore(row))
274
+ },
264
275
  showModifyReasonCol() {
265
276
  return this.resolveShowFlag('showModifyReason')
266
277
  }
@@ -49,6 +49,7 @@
49
49
 
50
50
  <script>
51
51
  import MeasureQualAnalysis from './MeasureQualAnalysis.vue'
52
+ import MeasureTreeTable from './MeasureTreeTable.vue'
52
53
  import {
53
54
  splitGroupNodes,
54
55
  isQualIndicator,
@@ -60,7 +61,7 @@ export default {
60
61
  name: 'MeasureGroupBlocks',
61
62
  components: {
62
63
  MeasureQualAnalysis,
63
- MeasureTreeTable: () => import('./MeasureTreeTable.vue')
64
+ MeasureTreeTable
64
65
  },
65
66
  inject: ['measureCtx'],
66
67
  props: {
@@ -53,7 +53,12 @@
53
53
  <template #default="{ row }">{{ row.weight || '—' }}</template>
54
54
  </vxe-column>
55
55
 
56
- <vxe-column title="指标满分值" width="110" align="center">
56
+ <vxe-column
57
+ v-if="showFullScoreCol"
58
+ title="指标满分值"
59
+ width="110"
60
+ align="center"
61
+ >
57
62
  <template #default="{ row }">{{ formatFullScore(row) }}</template>
58
63
  </vxe-column>
59
64
 
@@ -139,7 +144,8 @@ import {
139
144
  indicatorScoreText,
140
145
  showLevelSerial,
141
146
  isQualIndicator,
142
- fullScoreText
147
+ fullScoreText,
148
+ isShowFullScore
143
149
  } from './helpers'
144
150
 
145
151
  export default {
@@ -167,6 +173,11 @@ export default {
167
173
  showModelScoreCol() {
168
174
  return !this.measureCtx().calcMode
169
175
  },
176
+ showFullScoreCol() {
177
+ return this.displayGroups.some(group =>
178
+ (group.children || []).some(child => isShowFullScore(child))
179
+ )
180
+ },
170
181
  /** 始终绑定 leafList 原始节点,避免 vxe 展开区副本导致 v-model 丢失 */
171
182
  displayGroups() {
172
183
  const resolve = this.measureCtx().resolveLeafNode
@@ -37,20 +37,33 @@
37
37
  </el-option>
38
38
  </el-select>
39
39
  </template>
40
- <!-- 其余:只读或调整 -->
40
+ <!-- 其余:只读或调整(可调整时原值与输入框同时展示) -->
41
41
  <template v-else>
42
+ <el-tooltip
43
+ v-if="showOriginalWhenAdjust && showFormulaTip"
44
+ placement="top"
45
+ effect="dark"
46
+ >
47
+ <div slot="content">
48
+ {{ cell.displayFormula }}:
49
+ <br />
50
+ {{ cell.relFormula }}
51
+ </div>
52
+ <span>{{ originalValue(cell) }}</span>
53
+ </el-tooltip>
54
+ <span v-else-if="showOriginalWhenAdjust">{{ originalValue(cell) }}</span>
42
55
  <InputNumber
43
56
  v-if="
44
57
  cell.modifyRank === 2 &&
45
58
  cell.value !== '' &&
46
59
  cell.value !== null &&
47
60
  !column.disabled
48
- && !readonly
49
61
  "
50
62
  class="full-w"
51
63
  size="small"
52
64
  :type="cell.displayStyle === 1 ? 'rate' : 'money'"
53
65
  :d-num="digits"
66
+ :disabled="readonly"
54
67
  v-model="cell.value"
55
68
  />
56
69
  <el-tooltip
@@ -65,7 +78,7 @@
65
78
  </div>
66
79
  <span>{{ displayValue(cell) }}</span>
67
80
  </el-tooltip>
68
- <span v-else>{{ displayValue(cell) }}</span>
81
+ <span v-else-if="!showOriginalWhenAdjust">{{ displayValue(cell) }}</span>
69
82
  </template>
70
83
  </div>
71
84
  </template>
@@ -91,9 +104,27 @@ export default {
91
104
  showFormulaTip() {
92
105
  if (!this.cell || this.column.disabled) return false
93
106
  return !!(this.cell.displayFormula || this.cell.relFormula)
107
+ },
108
+ showOriginalWhenAdjust() {
109
+ return (
110
+ this.cell &&
111
+ this.cell.modifyRank === 2 &&
112
+ this.cell.indicatorResult !== '' &&
113
+ this.cell.indicatorResult !== null
114
+ )
94
115
  }
95
116
  },
96
117
  methods: {
118
+ originalValue(cell) {
119
+ const val = cell.indicatorResult
120
+ if (val === '' || val == null) return ''
121
+ let text = Number(val).toFixed(this.digits)
122
+ if (cell.showStyle === 2) {
123
+ text = addThousands(toFixedTrunc(val, this.digits))
124
+ }
125
+ const suffix = cell.displayStyle === 1 && (val || val === 0) ? '%' : ''
126
+ return text + suffix
127
+ },
97
128
  displayValue(cell) {
98
129
  if (this.column.disabled) {
99
130
  const val =
@@ -128,7 +128,9 @@
128
128
  <template v-if="tableCalcMode">
129
129
  <vxe-column title="指标值" min-width="200" align="center">
130
130
  <template #default="{ row }">
131
- <template>
131
+ <div>
132
+ <!-- 原指标值:非手工填报始终展示;可调整时输入框在下方 -->
133
+ <span v-if="row.sourceType !== 3">{{ indicatorTextFn(row) }}</span>
132
134
  <InputNumber
133
135
  v-if="row.sourceType === 3 && row.itemType === 21"
134
136
  class="full-w"
@@ -153,8 +155,7 @@
153
155
  v-model="row.value"
154
156
  placeholder="请输入"
155
157
  />
156
- <span v-else>{{ indicatorTextFn(row) }}</span>
157
- </template>
158
+ </div>
158
159
  </template>
159
160
  </vxe-column>
160
161
 
@@ -231,7 +232,12 @@
231
232
 
232
233
  <!-- 默认列:满分值 / 计算公式 / 评价标准 / 指标值 / 指标得分 / 模型指标得分 / 理由 -->
233
234
  <template v-else>
234
- <vxe-column title="指标满分值" width="110" align="center">
235
+ <vxe-column
236
+ v-if="showFullScoreCol"
237
+ title="指标满分值"
238
+ width="110"
239
+ align="center"
240
+ >
235
241
  <template #default="{ row }">
236
242
  <span v-if="row.isLeaf === 1">{{ fullScoreFn(row) }}</span>
237
243
  <span v-else class="color-placeholder">—</span>
@@ -259,7 +265,20 @@
259
265
 
260
266
  <vxe-column title="指标值" min-width="260" align="center">
261
267
  <template #default="{ row }">
262
- <template v-if="isQuantIndicatorFn(row)">
268
+ <div v-if="isQuantIndicatorFn(row)">
269
+ <!-- 原指标值:非手工填报始终展示;可调整时输入框在下方 -->
270
+ <el-tooltip
271
+ v-if="row.sourceType !== 3 && (row.displayFormula || row.relFormula)"
272
+ placement="top"
273
+ effect="dark"
274
+ >
275
+ <template #content>
276
+ <div>{{ row.displayFormula }}</div>
277
+ </template>
278
+ <span>{{ indicatorTextFn(row) }}</span>
279
+ </el-tooltip>
280
+ <span v-else-if="row.sourceType !== 3">{{ indicatorTextFn(row) }}</span>
281
+
263
282
  <!-- 可量化 + 手工填报:数字录入 -->
264
283
  <InputNumber
265
284
  v-if="row.sourceType === 3 && row.itemType === 21"
@@ -271,7 +290,7 @@
271
290
  v-model="row.value"
272
291
  />
273
292
 
274
- <!-- 调整项=指标值:允许修改 -->
293
+ <!-- 调整项=指标值:在原值后允许修改 -->
275
294
  <InputNumber
276
295
  v-else-if="
277
296
  row.modifyRank === 2 &&
@@ -284,21 +303,9 @@
284
303
  :d-num="digitsFn(row)"
285
304
  :disabled="ctx.readonly"
286
305
  v-model="row.value"
306
+ placeholder="请输入"
287
307
  />
288
-
289
- <!-- 其余只读展示指标值 -->
290
- <el-tooltip
291
- v-else-if="row.displayFormula || row.relFormula"
292
- placement="top"
293
- effect="dark"
294
- >
295
- <template #content>
296
- <div>{{ row.displayFormula }}</div>
297
- </template>
298
- <span>{{ indicatorTextFn(row) }}</span>
299
- </el-tooltip>
300
- <span v-else>{{ indicatorTextFn(row) }}</span>
301
- </template>
308
+ </div>
302
309
  <template v-else-if="isSubModelFn(row)">
303
310
  <el-tooltip
304
311
  v-if="subModelFormulaFn(row)"
@@ -420,7 +427,8 @@ import {
420
427
  indicatorResultText,
421
428
  fullScoreText,
422
429
  hierarchySerial,
423
- hierarchySerialPrefix
430
+ hierarchySerialPrefix,
431
+ isShowFullScore
424
432
  } from './helpers'
425
433
 
426
434
  export default {
@@ -496,6 +504,12 @@ export default {
496
504
  showRemarkCol() {
497
505
  return this.resolveShowFlag('showRemark')
498
506
  },
507
+ /** 当前层是否存在需要展示满分值的叶子指标 */
508
+ showFullScoreCol() {
509
+ return (this.nodes || []).some(
510
+ row => row && row.isLeaf === 1 && isShowFullScore(row)
511
+ )
512
+ },
499
513
  showModifyReasonCol() {
500
514
  return this.resolveShowFlag('showModifyReason')
501
515
  }
@@ -248,8 +248,14 @@ export function indicatorScoreText(row, modelWrap) {
248
248
  return N.div(N.mul(row.result, 100, digits + 2), row.weight, digits)
249
249
  }
250
250
 
251
+ /** 是否展示满分值(showFullScore:1 展示;0 不展示;空值兼容旧数据按展示处理) */
252
+ export function isShowFullScore(row) {
253
+ return !row || row.showFullScore !== 0
254
+ }
255
+
251
256
  /** 指标满分值展示 */
252
257
  export function fullScoreText(row, modelWrap) {
258
+ if (!isShowFullScore(row)) return ''
253
259
  if (!row || (row.fullScore !== 0 && !row.fullScore)) return ''
254
260
  const digits = digitsCalc(row, modelWrap)
255
261
  let val = Number(row.fullScore).toFixed(digits)
@@ -257,6 +257,32 @@ function resolveTableBlockMeta(treeData, pid, indicatorItems, modelWrap) {
257
257
  }
258
258
  }
259
259
 
260
+ /** 节点是否展示满分值(0 不展示;空值兼容旧数据按展示) */
261
+ function isShowFullScoreNode(row) {
262
+ return !!(row && row.showFullScore !== 0)
263
+ }
264
+
265
+ /** 某一统计项列是否需要「满分值」列(任一行开启则展示) */
266
+ function shouldShowFullScoreCol(indicatorItems, statsName) {
267
+ return (indicatorItems || []).some(ind => {
268
+ const child = statItemChildren(ind).find(c => c.statsName === statsName)
269
+ return isShowFullScoreNode(child)
270
+ })
271
+ }
272
+
273
+ /** 构建只读满分值单元格 */
274
+ function buildFullScoreCell(item) {
275
+ const score = item && (item.fullScore === 0 || item.fullScore) ? item.fullScore : ''
276
+ return {
277
+ ...item,
278
+ result: score,
279
+ value: score,
280
+ sourceType: '',
281
+ displayStyle: 0,
282
+ calcState: false
283
+ }
284
+ }
285
+
260
286
  function groupIsLeaf2ByPid(nodes) {
261
287
  const map = new Map()
262
288
  nodes.forEach(n => {
@@ -297,6 +323,21 @@ export async function buildStatModelTables(treeData, fetchScoreMap, modelWrap) {
297
323
  firstStatChildren.forEach(item => {
298
324
  const statMeta = resolveStatMeta(statsResultList, item)
299
325
  if (!statMeta || !item.statsName) return
326
+ // 指标取数:按开关在指标值前插入满分值列
327
+ if (
328
+ statMeta.calType == 0 &&
329
+ shouldShowFullScoreCol(indicatorItems, item.statsName)
330
+ ) {
331
+ columns.push({
332
+ label: item.statsName + '满分值',
333
+ prop: item.statsName + '满分值',
334
+ slotName: item.statsName + '满分值',
335
+ disabled: true,
336
+ isFullScore: true,
337
+ minWidth: 120,
338
+ align: 'center'
339
+ })
340
+ }
300
341
  const label =
301
342
  statMeta.calType == 0 ? item.statsName + '指标值' : item.statsName
302
343
  columns.push({
@@ -347,6 +388,9 @@ export async function buildStatModelTables(treeData, fetchScoreMap, modelWrap) {
347
388
  } else {
348
389
  item.value = resolveCellValue(item, optionList)
349
390
  }
391
+ if (statMeta.calType == 0 && isShowFullScoreNode(item)) {
392
+ listItem[item.statsName + '满分值'] = buildFullScoreCell(item)
393
+ }
350
394
  listItem[label] = item
351
395
  if (statMeta.calType == 0) {
352
396
  const scoreVal =