@nstc-business/imes 1.0.17 → 1.0.19

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.17",
3
+ "version": "1.0.19",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -351,9 +351,11 @@
351
351
  </vxe-column>
352
352
  </table-pro>
353
353
  </div>
354
+ <!-- 子模型:按模型树文件夹顺序(定量→定性→调整项)展开,不按类型分块 -->
355
+ <template v-for="(item, index) in typeObj.orderedSubModels">
354
356
  <!-- 评价模型 -->
355
357
  <div
356
- v-for="(item, index) in typeObj.assessModelArray"
358
+ v-if="item._subModelKind === 'assess'"
357
359
  :key="'assessModelArray' + index"
358
360
  class="m-t-m"
359
361
  >
@@ -580,7 +582,7 @@
580
582
  </div>
581
583
  <!-- 计算模型 -->
582
584
  <div
583
- v-for="(item, index) in typeObj.evalModelArray"
585
+ v-else-if="item._subModelKind === 'eval'"
584
586
  :key="'evalModelArray' + index"
585
587
  class="m-t-m"
586
588
  >
@@ -797,7 +799,7 @@
797
799
 
798
800
  <!-- 统计模型 (暂不考虑子模型的情况) -->
799
801
  <div
800
- v-for="(item, index) in typeObj.statisticsArray"
802
+ v-else-if="item._subModelKind === 'stat'"
801
803
  :key="'statisticsArray' + index"
802
804
  class="m-t-m"
803
805
  >
@@ -999,6 +1001,7 @@
999
1001
  </table-pro>
1000
1002
  </div>
1001
1003
  </div>
1004
+ </template>
1002
1005
  </div>
1003
1006
  </expandable-pane>
1004
1007
  </Page>
@@ -1083,7 +1086,9 @@ export default {
1083
1086
  // 计算模型数组
1084
1087
  evalModelArray: [],
1085
1088
  // 评价模型数组
1086
- assessModelArray: []
1089
+ assessModelArray: [],
1090
+ // 子模型按模型树文件夹顺序(定量→定性→调整项)展开
1091
+ orderedSubModels: []
1087
1092
  },
1088
1093
  tabelHeadersAssessModel: [
1089
1094
  {
@@ -1402,6 +1407,7 @@ export default {
1402
1407
  this.processingData(this.model, 'targetArray')
1403
1408
  await this.queryCalcResultDetail()
1404
1409
  this.processingData(this.modelData)
1410
+ this.alignSubModelsWithTargetOrder()
1405
1411
  this.comFn(this.modelData)
1406
1412
  }
1407
1413
  break
@@ -1414,7 +1420,9 @@ export default {
1414
1420
  modelTreeVO.itemID = modelTreeVO.modelID
1415
1421
  modelTreeVO.tableData = []
1416
1422
  modelTreeVO.children = []
1417
- this.typeObj.statisticsArray.push({...modelTreeVO})
1423
+ const statRow = {...modelTreeVO, _subModelKind: 'stat'}
1424
+ this.typeObj.statisticsArray.push(statRow)
1425
+ this.typeObj.orderedSubModels.push(statRow)
1418
1426
  this.comFn(this.modelData)
1419
1427
  let showFullScore = 0
1420
1428
  let showIndicatorValText = 0
@@ -1706,6 +1714,21 @@ export default {
1706
1714
  // 统计模型table : isLeaf=2 itemType = 13
1707
1715
  // 计算模型table : isLeaf=0 itemType = 11
1708
1716
  // 评价模型table: isLeaf=0 itemType = 12
1717
+ /** 子模型展开顺序与主表指标(定量→定性→调整项)保持一致 */
1718
+ alignSubModelsWithTargetOrder() {
1719
+ const orderIds = this.typeObj.targetArray
1720
+ .filter(i => [11, 12, 13].includes(Number(i.itemType)))
1721
+ .map(i => i.itemID)
1722
+ if (!orderIds.length || !this.typeObj.orderedSubModels.length) {
1723
+ return
1724
+ }
1725
+ this.typeObj.orderedSubModels.sort((a, b) => {
1726
+ const ia = orderIds.indexOf(a.itemID)
1727
+ const ib = orderIds.indexOf(b.itemID)
1728
+ return (ia < 0 ? Number.MAX_SAFE_INTEGER : ia) -
1729
+ (ib < 0 ? Number.MAX_SAFE_INTEGER : ib)
1730
+ })
1731
+ },
1709
1732
  processingData(modelData, type) {
1710
1733
  const modelTreeVO = JSON.parse(JSON.stringify(modelData.modelTreeVO))
1711
1734
  const digui = data => {
@@ -1750,7 +1773,9 @@ export default {
1750
1773
  } else {
1751
1774
  item.children = []
1752
1775
  item.tableData = []
1753
- this.typeObj.evalModelArray.push({...item})
1776
+ const row = {...item, _subModelKind: 'eval'}
1777
+ this.typeObj.evalModelArray.push(row)
1778
+ this.typeObj.orderedSubModels.push(row)
1754
1779
  }
1755
1780
  }
1756
1781
  break
@@ -1766,7 +1791,9 @@ export default {
1766
1791
  } else {
1767
1792
  item.children = []
1768
1793
  item.tableData = []
1769
- this.typeObj.assessModelArray.push({...item})
1794
+ const row = {...item, _subModelKind: 'assess'}
1795
+ this.typeObj.assessModelArray.push(row)
1796
+ this.typeObj.orderedSubModels.push(row)
1770
1797
  }
1771
1798
  }
1772
1799
 
@@ -1783,7 +1810,9 @@ export default {
1783
1810
  } else {
1784
1811
  item.children = []
1785
1812
  item.tableData = []
1786
- this.typeObj.statisticsArray.push({...item})
1813
+ const row = {...item, _subModelKind: 'stat'}
1814
+ this.typeObj.statisticsArray.push(row)
1815
+ this.typeObj.orderedSubModels.push(row)
1787
1816
  }
1788
1817
  // this.typeObj.targetArray[this.typeObj.targetArray.length - 1] = await this.itemDataFn(item, data)
1789
1818
  }
@@ -191,6 +191,12 @@
191
191
  <span v-if="section.remark" class="section-remark">
192
192
  备注:<span class="remark-html" v-html="section.remark"></span>
193
193
  </span>
194
+ <span
195
+ v-if="sectionWeightText(section)"
196
+ class="section-weight-pill"
197
+ >
198
+ {{ sectionWeightText(section) }}
199
+ </span>
194
200
  <span
195
201
  v-if="sectionScoreText(section)"
196
202
  class="section-score-pill"
@@ -644,11 +650,11 @@ export default {
644
650
  this.leafList = leafList
645
651
  this.qualList = qualList
646
652
  this.subModelList = subModelList
653
+ // 仅以模型级测算结果 / 日志为准;分组节点 result 默认 0 不能当作已测算
647
654
  this.parentCalced = !!(
648
655
  this.logId ||
649
656
  this.model.logId ||
650
- (this.model.result !== '' && this.model.result != null) ||
651
- (root.result !== '' && root.result != null)
657
+ (this.model.result !== '' && this.model.result != null)
652
658
  )
653
659
  this.qualSelectionDraft = {}
654
660
  this.resultText = this.model.resultText || root.resultText || ''
@@ -1309,11 +1315,74 @@ export default {
1309
1315
  return `总得分: ${totalText} = ${parts.join(' + ')}`
1310
1316
  },
1311
1317
 
1312
- /** 分区标题旁得分(评价模型测算后) */
1318
+ /**
1319
+ * 收集参与总权重计算的叶子:指标 / 子模型(文件夹只下钻,不参与)
1320
+ * 公式:满分值 * 占模型权重%
1321
+ */
1322
+ collectWeightContributors(nodes, bucket = []) {
1323
+ if (!Array.isArray(nodes)) return bucket
1324
+ nodes.forEach(n => {
1325
+ if (!n) return
1326
+ if (this.isSubModel(n) || isIndicator(n)) {
1327
+ if (
1328
+ (n.fullScore === 0 || n.fullScore) &&
1329
+ (n.weight === 0 || n.weight)
1330
+ ) {
1331
+ bucket.push(n)
1332
+ }
1333
+ return
1334
+ }
1335
+ if (n.children && n.children.length) {
1336
+ this.collectWeightContributors(n.children, bucket)
1337
+ }
1338
+ })
1339
+ return bucket
1340
+ },
1341
+
1342
+ /**
1343
+ * 大分组总权重文案:总权重: 75.00(不展示计算过程)
1344
+ */
1345
+ buildGroupWeightText(groupNode, children) {
1346
+ if (!groupNode) return ''
1347
+ const contributors = this.collectWeightContributors(
1348
+ children || groupNode.children || []
1349
+ )
1350
+ let total = null
1351
+ if (contributors.length) {
1352
+ total = contributors.reduce((sum, n) => {
1353
+ const full = Number(n.fullScore)
1354
+ const weight = Number(n.weight)
1355
+ return (
1356
+ sum +
1357
+ ((Number.isNaN(full) ? 0 : full) *
1358
+ (Number.isNaN(weight) ? 0 : weight)) /
1359
+ 100
1360
+ )
1361
+ }, 0)
1362
+ } else if (groupNode.fullScore === 0 || groupNode.fullScore) {
1363
+ total = groupNode.fullScore
1364
+ }
1365
+ if (total === null) return ''
1366
+ return `总权重: ${this.formatScoreNum(total)}`
1367
+ },
1368
+
1369
+ /** 分区标题旁总权重(评价模型且开启显示权重) */
1370
+ sectionWeightText(section) {
1371
+ if (!this.evalRootModel || !section) return ''
1372
+ if (this.model.showWeight !== 1) return ''
1373
+ if (!section.container || this.isSubModel(section.container)) return ''
1374
+ return this.buildGroupWeightText(section.container, section.nodes)
1375
+ },
1376
+
1377
+ /** 分区标题旁得分(评价模型:未测算显示 --) */
1313
1378
  sectionScoreText(section) {
1314
- if (!this.evalRootModel || !this.parentCalced || !section) return ''
1379
+ if (!this.evalRootModel || !section) return ''
1315
1380
  if (!section.container || this.isSubModel(section.container)) return ''
1316
- return this.buildGroupScoreText(section.container, section.nodes)
1381
+ if (!this.parentCalced) return '总得分: --'
1382
+ return (
1383
+ this.buildGroupScoreText(section.container, section.nodes) ||
1384
+ '总得分: --'
1385
+ )
1317
1386
  },
1318
1387
 
1319
1388
  /**
@@ -1514,6 +1583,7 @@ export default {
1514
1583
  padding-left: 8px;
1515
1584
  border-left: 3px solid #409eff;
1516
1585
  }
1586
+ .section-weight-pill,
1517
1587
  .section-score-pill {
1518
1588
  display: inline-block;
1519
1589
  margin-left: 4px;