@nstc-business/imes 1.0.26 → 1.0.28
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/README.md +87 -87
- package/package.json +71 -71
- package/src/components/calculateDetail/dialog.vue +38 -38
- package/src/components/calculateDetail/index.vue +1888 -1888
- package/src/components/common.js +109 -109
- package/src/components/measureCalc/EvaOfCreditConditionsRewrite.vue +624 -637
- package/src/components/measureCalc/MeasureEvalFlatTable.vue +438 -432
- package/src/components/measureCalc/MeasureGroupBlocks.vue +208 -208
- package/src/components/measureCalc/MeasureQualAnalysis.vue +415 -415
- package/src/components/measureCalc/MeasureStatCell.vue +181 -183
- package/src/components/measureCalc/MeasureStatFlatTable.vue +258 -254
- package/src/components/measureCalc/MeasureStatModelTable.vue +196 -193
- package/src/components/measureCalc/MeasureStatPanel.vue +45 -45
- package/src/components/measureCalc/MeasureSubModelPanel.vue +83 -83
- package/src/components/measureCalc/MeasureTreeTable.vue +817 -797
- package/src/components/measureCalc/api.js +18 -18
- package/src/components/measureCalc/helpers.js +507 -489
- package/src/components/measureCalc/index.vue +1676 -1671
- package/src/components/measureCalc/statModelHelper.js +585 -533
- package/src/components/measureCalc/ui/index.js +10 -10
- package/src/components/model-calculate/index.vue +153 -153
- package/src/components/model-calculate/input-number.vue +294 -294
- package/src/components/model-calculate/modelCalcTest.vue +1242 -1242
- package/src/components/model-calculate/tree.vue +132 -132
- package/src/index.js +28 -28
|
@@ -1,415 +1,415 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="measure-qual-analysis">
|
|
3
|
-
<div
|
|
4
|
-
v-for="(group, index) in displayGroups"
|
|
5
|
-
:key="group._groupKey"
|
|
6
|
-
class="qual-group"
|
|
7
|
-
>
|
|
8
|
-
<div v-if="group.name" class="qual-group-title" @click="toggleGroup(index)">
|
|
9
|
-
<span v-if="showSerial" class="qual-group-index">{{ index + 1 }}.</span>
|
|
10
|
-
<span>{{ group.name }}</span>
|
|
11
|
-
<span
|
|
12
|
-
v-if="modelWrap.showWeight === 1 && group.fullScore"
|
|
13
|
-
class="qual-group-weight"
|
|
14
|
-
>
|
|
15
|
-
总权重:{{ group.fullScore }}
|
|
16
|
-
</span>
|
|
17
|
-
<span
|
|
18
|
-
v-if="group.result || group.result === 0"
|
|
19
|
-
class="qual-group-score"
|
|
20
|
-
>
|
|
21
|
-
得分:{{ group.result }}
|
|
22
|
-
</span>
|
|
23
|
-
<span class="group-toggle">
|
|
24
|
-
{{ isExpanded(index) ? '收起' : '展开' }}
|
|
25
|
-
<i :class="isExpanded(index) ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
|
|
26
|
-
</span>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<vxe-table
|
|
30
|
-
v-show="isExpanded(index)"
|
|
31
|
-
border
|
|
32
|
-
class="qual-table"
|
|
33
|
-
:data="group.children"
|
|
34
|
-
:row-config="{ keyField: '_rowKey' }"
|
|
35
|
-
:scroll-y="{ enabled: false }"
|
|
36
|
-
>
|
|
37
|
-
<vxe-column v-if="showSerial" title="序号" width="72" align="center">
|
|
38
|
-
<template #default="{ rowIndex }">{{ rowIndex + 1 }}</template>
|
|
39
|
-
</vxe-column>
|
|
40
|
-
|
|
41
|
-
<vxe-column field="name" title="指标名称" min-width="180" align="center">
|
|
42
|
-
<template #default="{ row }">
|
|
43
|
-
<span v-title="row.name">{{ row.name }}</span>
|
|
44
|
-
</template>
|
|
45
|
-
</vxe-column>
|
|
46
|
-
|
|
47
|
-
<vxe-column
|
|
48
|
-
v-if="showWeightCol"
|
|
49
|
-
title="指标权重"
|
|
50
|
-
width="100"
|
|
51
|
-
align="center"
|
|
52
|
-
>
|
|
53
|
-
<template #default="{ row }">{{ row.weight || '—' }}</template>
|
|
54
|
-
</vxe-column>
|
|
55
|
-
|
|
56
|
-
<vxe-column
|
|
57
|
-
v-if="showFullScoreCol"
|
|
58
|
-
title="指标满分值"
|
|
59
|
-
width="110"
|
|
60
|
-
align="center"
|
|
61
|
-
>
|
|
62
|
-
<template #default="{ row }">{{ formatFullScore(row) }}</template>
|
|
63
|
-
</vxe-column>
|
|
64
|
-
|
|
65
|
-
<vxe-column title="评价标准" min-width="180" align="center">
|
|
66
|
-
<template #default="{ row }">{{ evalStandardText(row) }}</template>
|
|
67
|
-
</vxe-column>
|
|
68
|
-
|
|
69
|
-
<vxe-column title="指标值" min-width="220" align="center">
|
|
70
|
-
<template #default="{ row }">
|
|
71
|
-
<el-select
|
|
72
|
-
v-if="isQualSelectNode(row)"
|
|
73
|
-
class="qual-select"
|
|
74
|
-
:value="row.scoreMapID"
|
|
75
|
-
:disabled="readonly"
|
|
76
|
-
size="small"
|
|
77
|
-
placeholder="请选择"
|
|
78
|
-
@change="val => onSelectChange(row, val)"
|
|
79
|
-
>
|
|
80
|
-
<el-option
|
|
81
|
-
v-for="option in row.optionList"
|
|
82
|
-
:key="option.scoreMapID"
|
|
83
|
-
:label="option.scoreText"
|
|
84
|
-
:value="option.scoreMapID"
|
|
85
|
-
style="height: auto"
|
|
86
|
-
>
|
|
87
|
-
<div class="select-top">{{ option.scoreText }}</div>
|
|
88
|
-
<div class="select-bottom">{{ option.reason }}</div>
|
|
89
|
-
</el-option>
|
|
90
|
-
</el-select>
|
|
91
|
-
<el-input
|
|
92
|
-
v-else-if="row.sourceType === 3"
|
|
93
|
-
class="qual-manual-input"
|
|
94
|
-
type="number"
|
|
95
|
-
size="small"
|
|
96
|
-
v-model="row.scoreValue"
|
|
97
|
-
:disabled="readonly"
|
|
98
|
-
placeholder="请输入评分"
|
|
99
|
-
/>
|
|
100
|
-
<span v-else>—</span>
|
|
101
|
-
</template>
|
|
102
|
-
</vxe-column>
|
|
103
|
-
|
|
104
|
-
<vxe-column :title="scoreColTitle(group)" width="120" align="center">
|
|
105
|
-
<template #default="{ row }">
|
|
106
|
-
{{ formatIndicatorScore(group, row) }}
|
|
107
|
-
</template>
|
|
108
|
-
</vxe-column>
|
|
109
|
-
|
|
110
|
-
<vxe-column
|
|
111
|
-
v-if="showModelScoreCol"
|
|
112
|
-
title="模型指标得分"
|
|
113
|
-
width="130"
|
|
114
|
-
align="center"
|
|
115
|
-
>
|
|
116
|
-
<template #default="{ row }">{{ formatScore(row.result) }}</template>
|
|
117
|
-
</vxe-column>
|
|
118
|
-
|
|
119
|
-
<vxe-column title="评价理由" min-width="240" align="center">
|
|
120
|
-
<template #default="{ row }">
|
|
121
|
-
<el-input
|
|
122
|
-
v-if="isQualSelectNode(row)"
|
|
123
|
-
class="qual-reason-input"
|
|
124
|
-
type="textarea"
|
|
125
|
-
v-title
|
|
126
|
-
:show-overflow-tooltip="true"
|
|
127
|
-
:maxlength="2000"
|
|
128
|
-
show-word-limit
|
|
129
|
-
v-model="row.reason"
|
|
130
|
-
:disabled="readonly"
|
|
131
|
-
placeholder="请输入具体评价依据,不超过2000字"
|
|
132
|
-
@input="onReasonInput(row)"
|
|
133
|
-
/>
|
|
134
|
-
</template>
|
|
135
|
-
</vxe-column>
|
|
136
|
-
</vxe-table>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
</template>
|
|
140
|
-
|
|
141
|
-
<script>
|
|
142
|
-
import {
|
|
143
|
-
resultByShowStyle,
|
|
144
|
-
indicatorScoreText,
|
|
145
|
-
showLevelSerial,
|
|
146
|
-
isQualIndicator,
|
|
147
|
-
fullScoreText,
|
|
148
|
-
isShowFullScore
|
|
149
|
-
} from './helpers'
|
|
150
|
-
|
|
151
|
-
export default {
|
|
152
|
-
name: 'MeasureQualAnalysis',
|
|
153
|
-
inject: ['measureCtx'],
|
|
154
|
-
props: {
|
|
155
|
-
groups: {
|
|
156
|
-
type: Array,
|
|
157
|
-
default: () => []
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
computed: {
|
|
161
|
-
modelWrap() {
|
|
162
|
-
return this.measureCtx().modelWrap || {}
|
|
163
|
-
},
|
|
164
|
-
readonly() {
|
|
165
|
-
return !!this.measureCtx().readonly
|
|
166
|
-
},
|
|
167
|
-
showSerial() {
|
|
168
|
-
return showLevelSerial(this.modelWrap)
|
|
169
|
-
},
|
|
170
|
-
showWeightCol() {
|
|
171
|
-
return this.modelWrap.showWeight === 1 && !this.measureCtx().calcMode
|
|
172
|
-
},
|
|
173
|
-
showModelScoreCol() {
|
|
174
|
-
return !this.measureCtx().calcMode
|
|
175
|
-
},
|
|
176
|
-
showFullScoreCol() {
|
|
177
|
-
return this.displayGroups.some(group =>
|
|
178
|
-
(group.children || []).some(child => isShowFullScore(child))
|
|
179
|
-
)
|
|
180
|
-
},
|
|
181
|
-
/** 始终绑定 leafList 原始节点,避免 vxe 展开区副本导致 v-model 丢失 */
|
|
182
|
-
displayGroups() {
|
|
183
|
-
const resolve = this.measureCtx().resolveLeafNode
|
|
184
|
-
return this.groups.map((group, index) => ({
|
|
185
|
-
...group,
|
|
186
|
-
_groupKey: group._rowKey || group.name || `qual-group-${index}`,
|
|
187
|
-
children: (group.children || []).map(child =>
|
|
188
|
-
resolve ? resolve(child) || child : child
|
|
189
|
-
)
|
|
190
|
-
}))
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
watch: {
|
|
194
|
-
displayGroups: {
|
|
195
|
-
handler() {
|
|
196
|
-
this.hydrateFromDraft()
|
|
197
|
-
},
|
|
198
|
-
immediate: true,
|
|
199
|
-
deep: true
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
methods: {
|
|
203
|
-
sourceGroup(index) {
|
|
204
|
-
return this.groups[index] || this.displayGroups[index]
|
|
205
|
-
},
|
|
206
|
-
isExpanded(index) {
|
|
207
|
-
const group = this.sourceGroup(index)
|
|
208
|
-
const fn = this.measureCtx().isGroupExpanded
|
|
209
|
-
return fn ? fn(group) : !group || group._groupExpanded !== false
|
|
210
|
-
},
|
|
211
|
-
toggleGroup(index) {
|
|
212
|
-
const group = this.sourceGroup(index)
|
|
213
|
-
const fn = this.measureCtx().toggleGroupExpanded
|
|
214
|
-
if (fn) fn(group)
|
|
215
|
-
else if (group) this.$set(group, '_groupExpanded', group._groupExpanded === false)
|
|
216
|
-
},
|
|
217
|
-
isQualSelectNode(node) {
|
|
218
|
-
return (
|
|
219
|
-
node.sourceType === 0 ||
|
|
220
|
-
(isQualIndicator(node) && node.optionList && node.optionList.length)
|
|
221
|
-
)
|
|
222
|
-
},
|
|
223
|
-
scoreColTitle(group) {
|
|
224
|
-
if (group.itemType === 11) return '系数值'
|
|
225
|
-
return '指标得分'
|
|
226
|
-
},
|
|
227
|
-
formatIndicatorScore(group, node) {
|
|
228
|
-
if (group.itemType === 11) {
|
|
229
|
-
return this.formatScore(node.result)
|
|
230
|
-
}
|
|
231
|
-
return indicatorScoreText(node, this.modelWrap)
|
|
232
|
-
},
|
|
233
|
-
formatScore(val) {
|
|
234
|
-
|
|
235
|
-
return resultByShowStyle({ result: val }, this.modelWrap)
|
|
236
|
-
},
|
|
237
|
-
formatFullScore(node) {
|
|
238
|
-
return fullScoreText(node, this.modelWrap) || '—'
|
|
239
|
-
},
|
|
240
|
-
evalStandardText(node) {
|
|
241
|
-
return node.indicatorRemark || this.selectedOptionReason(node) || '—'
|
|
242
|
-
},
|
|
243
|
-
resolveNode(node) {
|
|
244
|
-
const resolve = this.measureCtx().resolveLeafNode
|
|
245
|
-
return resolve ? resolve(node) || node : node
|
|
246
|
-
},
|
|
247
|
-
applyNodeSelection(node, option) {
|
|
248
|
-
if (!node || !option) return
|
|
249
|
-
this.$set(node, 'value', option)
|
|
250
|
-
this.$set(node, 'scoreMapID', option.scoreMapID)
|
|
251
|
-
this.$set(node, 'scoreText', option.scoreText)
|
|
252
|
-
this.$set(node, 'scoreValue', option.scoreValue)
|
|
253
|
-
this.$set(node, 'picker', option)
|
|
254
|
-
},
|
|
255
|
-
pushQualDraft(node, patch) {
|
|
256
|
-
const sync = this.measureCtx().syncQualSelection
|
|
257
|
-
if (sync && node && node.tid) sync(node.tid, patch)
|
|
258
|
-
},
|
|
259
|
-
onSelectChange(node, scoreMapID) {
|
|
260
|
-
const target = this.resolveNode(node)
|
|
261
|
-
if (scoreMapID == null || scoreMapID === '') {
|
|
262
|
-
this.$set(target, 'scoreMapID', null)
|
|
263
|
-
this.$set(target, 'value', null)
|
|
264
|
-
this.pushQualDraft(target, {
|
|
265
|
-
scoreMapID: null,
|
|
266
|
-
scoreText: '',
|
|
267
|
-
scoreValue: null
|
|
268
|
-
})
|
|
269
|
-
return
|
|
270
|
-
}
|
|
271
|
-
this.$set(target, 'scoreMapID', scoreMapID)
|
|
272
|
-
const option = (target.optionList || []).find(
|
|
273
|
-
item => item.scoreMapID == scoreMapID
|
|
274
|
-
)
|
|
275
|
-
if (!option) return
|
|
276
|
-
this.applyNodeSelection(target, option)
|
|
277
|
-
this.$set(target, 'result', null)
|
|
278
|
-
this.pushQualDraft(target, {
|
|
279
|
-
itemID: target.itemID,
|
|
280
|
-
scoreMapID: option.scoreMapID,
|
|
281
|
-
scoreText: option.scoreText,
|
|
282
|
-
scoreValue: option.scoreValue,
|
|
283
|
-
reason: target.reason
|
|
284
|
-
})
|
|
285
|
-
},
|
|
286
|
-
onReasonInput(node) {
|
|
287
|
-
const target = this.resolveNode(node)
|
|
288
|
-
this.pushQualDraft(target, {
|
|
289
|
-
itemID: target.itemID,
|
|
290
|
-
scoreMapID: target.scoreMapID,
|
|
291
|
-
reason: target.reason
|
|
292
|
-
})
|
|
293
|
-
},
|
|
294
|
-
hydrateFromDraft() {
|
|
295
|
-
const get = this.measureCtx().getQualSelection
|
|
296
|
-
if (!get) return
|
|
297
|
-
this.displayGroups.forEach(group => {
|
|
298
|
-
;(group.children || []).forEach(node => {
|
|
299
|
-
if (!this.isQualSelectNode(node)) return
|
|
300
|
-
const draft = get(node.tid)
|
|
301
|
-
if (!draft) return
|
|
302
|
-
if (draft.scoreMapID != null && draft.scoreMapID !== '') {
|
|
303
|
-
if (node.scoreMapID != draft.scoreMapID) {
|
|
304
|
-
this.$set(node, 'scoreMapID', draft.scoreMapID)
|
|
305
|
-
}
|
|
306
|
-
const option = (node.optionList || []).find(
|
|
307
|
-
o => o.scoreMapID == draft.scoreMapID
|
|
308
|
-
)
|
|
309
|
-
if (option) this.applyNodeSelection(node, option)
|
|
310
|
-
}
|
|
311
|
-
if (draft.reason != null && draft.reason !== node.reason) {
|
|
312
|
-
this.$set(node, 'reason', draft.reason)
|
|
313
|
-
}
|
|
314
|
-
})
|
|
315
|
-
})
|
|
316
|
-
},
|
|
317
|
-
selectedOptionReason(node) {
|
|
318
|
-
if (node.picker && node.picker.reason) return node.picker.reason
|
|
319
|
-
if (
|
|
320
|
-
node.optionList &&
|
|
321
|
-
node.scoreMapID != null &&
|
|
322
|
-
node.scoreMapID !== ''
|
|
323
|
-
) {
|
|
324
|
-
const option = node.optionList.find(
|
|
325
|
-
opt => opt.scoreMapID == node.scoreMapID
|
|
326
|
-
)
|
|
327
|
-
return option ? option.reason : ''
|
|
328
|
-
}
|
|
329
|
-
return ''
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
</script>
|
|
334
|
-
|
|
335
|
-
<style lang="less" scoped>
|
|
336
|
-
.measure-qual-analysis {
|
|
337
|
-
margin-bottom: 12px;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.qual-group + .qual-group {
|
|
341
|
-
margin-top: 16px;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.qual-group-title {
|
|
345
|
-
display: flex;
|
|
346
|
-
align-items: center;
|
|
347
|
-
gap: 8px;
|
|
348
|
-
min-height: 30px;
|
|
349
|
-
margin-bottom: 8px;
|
|
350
|
-
font-size: 15px;
|
|
351
|
-
color: #303133;
|
|
352
|
-
cursor: pointer;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.qual-group-index {
|
|
356
|
-
color: #606266;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.qual-group-weight,
|
|
360
|
-
.qual-group-score {
|
|
361
|
-
margin-left: 8px;
|
|
362
|
-
color: #606266;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.group-toggle {
|
|
366
|
-
margin-left: auto;
|
|
367
|
-
font-size: 13px;
|
|
368
|
-
font-weight: 400;
|
|
369
|
-
color: #409eff;
|
|
370
|
-
white-space: nowrap;
|
|
371
|
-
user-select: none;
|
|
372
|
-
}
|
|
373
|
-
.group-toggle i {
|
|
374
|
-
margin-left: 2px;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
.qual-table {
|
|
378
|
-
width: 100%;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.qual-select,
|
|
382
|
-
.qual-reason-input,
|
|
383
|
-
.qual-manual-input {
|
|
384
|
-
width: 100%;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.select-top {
|
|
388
|
-
margin-top: 2px;
|
|
389
|
-
height: 14px;
|
|
390
|
-
line-height: 16px;
|
|
391
|
-
font-size: 14px;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.select-bottom {
|
|
395
|
-
margin-top: 1px;
|
|
396
|
-
min-height: 14px;
|
|
397
|
-
line-height: 16px;
|
|
398
|
-
color: #999999;
|
|
399
|
-
font-size: 14px;
|
|
400
|
-
max-width: 100%;
|
|
401
|
-
white-space: normal;
|
|
402
|
-
word-wrap: break-word;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/deep/ .el-select .el-input__inner {
|
|
406
|
-
text-align: center;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/deep/ .vxe-body--column {
|
|
410
|
-
padding-top: 6px;
|
|
411
|
-
padding-bottom: 6px;
|
|
412
|
-
height: auto !important;
|
|
413
|
-
max-height: unset !important;
|
|
414
|
-
}
|
|
415
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="measure-qual-analysis">
|
|
3
|
+
<div
|
|
4
|
+
v-for="(group, index) in displayGroups"
|
|
5
|
+
:key="group._groupKey"
|
|
6
|
+
class="qual-group"
|
|
7
|
+
>
|
|
8
|
+
<div v-if="group.name" class="qual-group-title" @click="toggleGroup(index)">
|
|
9
|
+
<span v-if="showSerial" class="qual-group-index">{{ index + 1 }}.</span>
|
|
10
|
+
<span>{{ group.name }}</span>
|
|
11
|
+
<span
|
|
12
|
+
v-if="modelWrap.showWeight === 1 && group.fullScore"
|
|
13
|
+
class="qual-group-weight"
|
|
14
|
+
>
|
|
15
|
+
总权重:{{ group.fullScore }}
|
|
16
|
+
</span>
|
|
17
|
+
<span
|
|
18
|
+
v-if="group.result || group.result === 0"
|
|
19
|
+
class="qual-group-score"
|
|
20
|
+
>
|
|
21
|
+
得分:{{ group.result }}
|
|
22
|
+
</span>
|
|
23
|
+
<span class="group-toggle">
|
|
24
|
+
{{ isExpanded(index) ? '收起' : '展开' }}
|
|
25
|
+
<i :class="isExpanded(index) ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
|
|
26
|
+
</span>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<vxe-table
|
|
30
|
+
v-show="isExpanded(index)"
|
|
31
|
+
border
|
|
32
|
+
class="qual-table"
|
|
33
|
+
:data="group.children"
|
|
34
|
+
:row-config="{ keyField: '_rowKey' }"
|
|
35
|
+
:scroll-y="{ enabled: false }"
|
|
36
|
+
>
|
|
37
|
+
<vxe-column v-if="showSerial" title="序号" width="72" align="center">
|
|
38
|
+
<template #default="{ rowIndex }">{{ rowIndex + 1 }}</template>
|
|
39
|
+
</vxe-column>
|
|
40
|
+
|
|
41
|
+
<vxe-column field="name" title="指标名称" min-width="180" align="center">
|
|
42
|
+
<template #default="{ row }">
|
|
43
|
+
<span v-title="row.name">{{ row.name }}</span>
|
|
44
|
+
</template>
|
|
45
|
+
</vxe-column>
|
|
46
|
+
|
|
47
|
+
<vxe-column
|
|
48
|
+
v-if="showWeightCol"
|
|
49
|
+
title="指标权重"
|
|
50
|
+
width="100"
|
|
51
|
+
align="center"
|
|
52
|
+
>
|
|
53
|
+
<template #default="{ row }">{{ row.weight || '—' }}</template>
|
|
54
|
+
</vxe-column>
|
|
55
|
+
|
|
56
|
+
<vxe-column
|
|
57
|
+
v-if="showFullScoreCol"
|
|
58
|
+
title="指标满分值"
|
|
59
|
+
width="110"
|
|
60
|
+
align="center"
|
|
61
|
+
>
|
|
62
|
+
<template #default="{ row }">{{ formatFullScore(row) }}</template>
|
|
63
|
+
</vxe-column>
|
|
64
|
+
|
|
65
|
+
<vxe-column title="评价标准" min-width="180" align="center">
|
|
66
|
+
<template #default="{ row }">{{ evalStandardText(row) }}</template>
|
|
67
|
+
</vxe-column>
|
|
68
|
+
|
|
69
|
+
<vxe-column title="指标值" min-width="220" align="center">
|
|
70
|
+
<template #default="{ row }">
|
|
71
|
+
<el-select
|
|
72
|
+
v-if="isQualSelectNode(row)"
|
|
73
|
+
class="qual-select"
|
|
74
|
+
:value="row.scoreMapID"
|
|
75
|
+
:disabled="readonly"
|
|
76
|
+
size="small"
|
|
77
|
+
placeholder="请选择"
|
|
78
|
+
@change="val => onSelectChange(row, val)"
|
|
79
|
+
>
|
|
80
|
+
<el-option
|
|
81
|
+
v-for="option in row.optionList"
|
|
82
|
+
:key="option.scoreMapID"
|
|
83
|
+
:label="option.scoreText"
|
|
84
|
+
:value="option.scoreMapID"
|
|
85
|
+
style="height: auto"
|
|
86
|
+
>
|
|
87
|
+
<div class="select-top">{{ option.scoreText }}</div>
|
|
88
|
+
<div class="select-bottom">{{ option.reason }}</div>
|
|
89
|
+
</el-option>
|
|
90
|
+
</el-select>
|
|
91
|
+
<el-input
|
|
92
|
+
v-else-if="row.sourceType === 3"
|
|
93
|
+
class="qual-manual-input"
|
|
94
|
+
type="number"
|
|
95
|
+
size="small"
|
|
96
|
+
v-model="row.scoreValue"
|
|
97
|
+
:disabled="readonly"
|
|
98
|
+
placeholder="请输入评分"
|
|
99
|
+
/>
|
|
100
|
+
<span v-else>—</span>
|
|
101
|
+
</template>
|
|
102
|
+
</vxe-column>
|
|
103
|
+
|
|
104
|
+
<vxe-column :title="scoreColTitle(group)" width="120" align="center">
|
|
105
|
+
<template #default="{ row }">
|
|
106
|
+
{{ formatIndicatorScore(group, row) }}
|
|
107
|
+
</template>
|
|
108
|
+
</vxe-column>
|
|
109
|
+
|
|
110
|
+
<vxe-column
|
|
111
|
+
v-if="showModelScoreCol"
|
|
112
|
+
title="模型指标得分"
|
|
113
|
+
width="130"
|
|
114
|
+
align="center"
|
|
115
|
+
>
|
|
116
|
+
<template #default="{ row }">{{ formatScore(row.result) }}</template>
|
|
117
|
+
</vxe-column>
|
|
118
|
+
|
|
119
|
+
<vxe-column title="评价理由" min-width="240" align="center">
|
|
120
|
+
<template #default="{ row }">
|
|
121
|
+
<el-input
|
|
122
|
+
v-if="isQualSelectNode(row)"
|
|
123
|
+
class="qual-reason-input"
|
|
124
|
+
type="textarea"
|
|
125
|
+
v-title
|
|
126
|
+
:show-overflow-tooltip="true"
|
|
127
|
+
:maxlength="2000"
|
|
128
|
+
show-word-limit
|
|
129
|
+
v-model="row.reason"
|
|
130
|
+
:disabled="readonly"
|
|
131
|
+
placeholder="请输入具体评价依据,不超过2000字"
|
|
132
|
+
@input="onReasonInput(row)"
|
|
133
|
+
/>
|
|
134
|
+
</template>
|
|
135
|
+
</vxe-column>
|
|
136
|
+
</vxe-table>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
141
|
+
<script>
|
|
142
|
+
import {
|
|
143
|
+
resultByShowStyle,
|
|
144
|
+
indicatorScoreText,
|
|
145
|
+
showLevelSerial,
|
|
146
|
+
isQualIndicator,
|
|
147
|
+
fullScoreText,
|
|
148
|
+
isShowFullScore
|
|
149
|
+
} from './helpers'
|
|
150
|
+
|
|
151
|
+
export default {
|
|
152
|
+
name: 'MeasureQualAnalysis',
|
|
153
|
+
inject: ['measureCtx'],
|
|
154
|
+
props: {
|
|
155
|
+
groups: {
|
|
156
|
+
type: Array,
|
|
157
|
+
default: () => []
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
computed: {
|
|
161
|
+
modelWrap() {
|
|
162
|
+
return this.measureCtx().modelWrap || {}
|
|
163
|
+
},
|
|
164
|
+
readonly() {
|
|
165
|
+
return !!this.measureCtx().readonly
|
|
166
|
+
},
|
|
167
|
+
showSerial() {
|
|
168
|
+
return showLevelSerial(this.modelWrap)
|
|
169
|
+
},
|
|
170
|
+
showWeightCol() {
|
|
171
|
+
return this.modelWrap.showWeight === 1 && !this.measureCtx().calcMode
|
|
172
|
+
},
|
|
173
|
+
showModelScoreCol() {
|
|
174
|
+
return !this.measureCtx().calcMode
|
|
175
|
+
},
|
|
176
|
+
showFullScoreCol() {
|
|
177
|
+
return this.displayGroups.some(group =>
|
|
178
|
+
(group.children || []).some(child => isShowFullScore(child))
|
|
179
|
+
)
|
|
180
|
+
},
|
|
181
|
+
/** 始终绑定 leafList 原始节点,避免 vxe 展开区副本导致 v-model 丢失 */
|
|
182
|
+
displayGroups() {
|
|
183
|
+
const resolve = this.measureCtx().resolveLeafNode
|
|
184
|
+
return this.groups.map((group, index) => ({
|
|
185
|
+
...group,
|
|
186
|
+
_groupKey: group._rowKey || group.name || `qual-group-${index}`,
|
|
187
|
+
children: (group.children || []).map(child =>
|
|
188
|
+
resolve ? resolve(child) || child : child
|
|
189
|
+
)
|
|
190
|
+
}))
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
watch: {
|
|
194
|
+
displayGroups: {
|
|
195
|
+
handler() {
|
|
196
|
+
this.hydrateFromDraft()
|
|
197
|
+
},
|
|
198
|
+
immediate: true,
|
|
199
|
+
deep: true
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
methods: {
|
|
203
|
+
sourceGroup(index) {
|
|
204
|
+
return this.groups[index] || this.displayGroups[index]
|
|
205
|
+
},
|
|
206
|
+
isExpanded(index) {
|
|
207
|
+
const group = this.sourceGroup(index)
|
|
208
|
+
const fn = this.measureCtx().isGroupExpanded
|
|
209
|
+
return fn ? fn(group) : !group || group._groupExpanded !== false
|
|
210
|
+
},
|
|
211
|
+
toggleGroup(index) {
|
|
212
|
+
const group = this.sourceGroup(index)
|
|
213
|
+
const fn = this.measureCtx().toggleGroupExpanded
|
|
214
|
+
if (fn) fn(group)
|
|
215
|
+
else if (group) this.$set(group, '_groupExpanded', group._groupExpanded === false)
|
|
216
|
+
},
|
|
217
|
+
isQualSelectNode(node) {
|
|
218
|
+
return (
|
|
219
|
+
node.sourceType === 0 ||
|
|
220
|
+
(isQualIndicator(node) && node.optionList && node.optionList.length)
|
|
221
|
+
)
|
|
222
|
+
},
|
|
223
|
+
scoreColTitle(group) {
|
|
224
|
+
if (group.itemType === 11) return '系数值'
|
|
225
|
+
return '指标得分'
|
|
226
|
+
},
|
|
227
|
+
formatIndicatorScore(group, node) {
|
|
228
|
+
if (group.itemType === 11) {
|
|
229
|
+
return this.formatScore(node.result)
|
|
230
|
+
}
|
|
231
|
+
return indicatorScoreText(node, this.modelWrap)
|
|
232
|
+
},
|
|
233
|
+
formatScore(val) {
|
|
234
|
+
// resultByShowStyle 已固定得分 2 位四舍五入
|
|
235
|
+
return resultByShowStyle({ result: val }, this.modelWrap)
|
|
236
|
+
},
|
|
237
|
+
formatFullScore(node) {
|
|
238
|
+
return fullScoreText(node, this.modelWrap) || '—'
|
|
239
|
+
},
|
|
240
|
+
evalStandardText(node) {
|
|
241
|
+
return node.indicatorRemark || this.selectedOptionReason(node) || '—'
|
|
242
|
+
},
|
|
243
|
+
resolveNode(node) {
|
|
244
|
+
const resolve = this.measureCtx().resolveLeafNode
|
|
245
|
+
return resolve ? resolve(node) || node : node
|
|
246
|
+
},
|
|
247
|
+
applyNodeSelection(node, option) {
|
|
248
|
+
if (!node || !option) return
|
|
249
|
+
this.$set(node, 'value', option)
|
|
250
|
+
this.$set(node, 'scoreMapID', option.scoreMapID)
|
|
251
|
+
this.$set(node, 'scoreText', option.scoreText)
|
|
252
|
+
this.$set(node, 'scoreValue', option.scoreValue)
|
|
253
|
+
this.$set(node, 'picker', option)
|
|
254
|
+
},
|
|
255
|
+
pushQualDraft(node, patch) {
|
|
256
|
+
const sync = this.measureCtx().syncQualSelection
|
|
257
|
+
if (sync && node && node.tid) sync(node.tid, patch)
|
|
258
|
+
},
|
|
259
|
+
onSelectChange(node, scoreMapID) {
|
|
260
|
+
const target = this.resolveNode(node)
|
|
261
|
+
if (scoreMapID == null || scoreMapID === '') {
|
|
262
|
+
this.$set(target, 'scoreMapID', null)
|
|
263
|
+
this.$set(target, 'value', null)
|
|
264
|
+
this.pushQualDraft(target, {
|
|
265
|
+
scoreMapID: null,
|
|
266
|
+
scoreText: '',
|
|
267
|
+
scoreValue: null
|
|
268
|
+
})
|
|
269
|
+
return
|
|
270
|
+
}
|
|
271
|
+
this.$set(target, 'scoreMapID', scoreMapID)
|
|
272
|
+
const option = (target.optionList || []).find(
|
|
273
|
+
item => item.scoreMapID == scoreMapID
|
|
274
|
+
)
|
|
275
|
+
if (!option) return
|
|
276
|
+
this.applyNodeSelection(target, option)
|
|
277
|
+
this.$set(target, 'result', null)
|
|
278
|
+
this.pushQualDraft(target, {
|
|
279
|
+
itemID: target.itemID,
|
|
280
|
+
scoreMapID: option.scoreMapID,
|
|
281
|
+
scoreText: option.scoreText,
|
|
282
|
+
scoreValue: option.scoreValue,
|
|
283
|
+
reason: target.reason
|
|
284
|
+
})
|
|
285
|
+
},
|
|
286
|
+
onReasonInput(node) {
|
|
287
|
+
const target = this.resolveNode(node)
|
|
288
|
+
this.pushQualDraft(target, {
|
|
289
|
+
itemID: target.itemID,
|
|
290
|
+
scoreMapID: target.scoreMapID,
|
|
291
|
+
reason: target.reason
|
|
292
|
+
})
|
|
293
|
+
},
|
|
294
|
+
hydrateFromDraft() {
|
|
295
|
+
const get = this.measureCtx().getQualSelection
|
|
296
|
+
if (!get) return
|
|
297
|
+
this.displayGroups.forEach(group => {
|
|
298
|
+
;(group.children || []).forEach(node => {
|
|
299
|
+
if (!this.isQualSelectNode(node)) return
|
|
300
|
+
const draft = get(node.tid)
|
|
301
|
+
if (!draft) return
|
|
302
|
+
if (draft.scoreMapID != null && draft.scoreMapID !== '') {
|
|
303
|
+
if (node.scoreMapID != draft.scoreMapID) {
|
|
304
|
+
this.$set(node, 'scoreMapID', draft.scoreMapID)
|
|
305
|
+
}
|
|
306
|
+
const option = (node.optionList || []).find(
|
|
307
|
+
o => o.scoreMapID == draft.scoreMapID
|
|
308
|
+
)
|
|
309
|
+
if (option) this.applyNodeSelection(node, option)
|
|
310
|
+
}
|
|
311
|
+
if (draft.reason != null && draft.reason !== node.reason) {
|
|
312
|
+
this.$set(node, 'reason', draft.reason)
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
})
|
|
316
|
+
},
|
|
317
|
+
selectedOptionReason(node) {
|
|
318
|
+
if (node.picker && node.picker.reason) return node.picker.reason
|
|
319
|
+
if (
|
|
320
|
+
node.optionList &&
|
|
321
|
+
node.scoreMapID != null &&
|
|
322
|
+
node.scoreMapID !== ''
|
|
323
|
+
) {
|
|
324
|
+
const option = node.optionList.find(
|
|
325
|
+
opt => opt.scoreMapID == node.scoreMapID
|
|
326
|
+
)
|
|
327
|
+
return option ? option.reason : ''
|
|
328
|
+
}
|
|
329
|
+
return ''
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
</script>
|
|
334
|
+
|
|
335
|
+
<style lang="less" scoped>
|
|
336
|
+
.measure-qual-analysis {
|
|
337
|
+
margin-bottom: 12px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.qual-group + .qual-group {
|
|
341
|
+
margin-top: 16px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.qual-group-title {
|
|
345
|
+
display: flex;
|
|
346
|
+
align-items: center;
|
|
347
|
+
gap: 8px;
|
|
348
|
+
min-height: 30px;
|
|
349
|
+
margin-bottom: 8px;
|
|
350
|
+
font-size: 15px;
|
|
351
|
+
color: #303133;
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.qual-group-index {
|
|
356
|
+
color: #606266;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.qual-group-weight,
|
|
360
|
+
.qual-group-score {
|
|
361
|
+
margin-left: 8px;
|
|
362
|
+
color: #606266;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.group-toggle {
|
|
366
|
+
margin-left: auto;
|
|
367
|
+
font-size: 13px;
|
|
368
|
+
font-weight: 400;
|
|
369
|
+
color: #409eff;
|
|
370
|
+
white-space: nowrap;
|
|
371
|
+
user-select: none;
|
|
372
|
+
}
|
|
373
|
+
.group-toggle i {
|
|
374
|
+
margin-left: 2px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.qual-table {
|
|
378
|
+
width: 100%;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.qual-select,
|
|
382
|
+
.qual-reason-input,
|
|
383
|
+
.qual-manual-input {
|
|
384
|
+
width: 100%;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.select-top {
|
|
388
|
+
margin-top: 2px;
|
|
389
|
+
height: 14px;
|
|
390
|
+
line-height: 16px;
|
|
391
|
+
font-size: 14px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.select-bottom {
|
|
395
|
+
margin-top: 1px;
|
|
396
|
+
min-height: 14px;
|
|
397
|
+
line-height: 16px;
|
|
398
|
+
color: #999999;
|
|
399
|
+
font-size: 14px;
|
|
400
|
+
max-width: 100%;
|
|
401
|
+
white-space: normal;
|
|
402
|
+
word-wrap: break-word;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/deep/ .el-select .el-input__inner {
|
|
406
|
+
text-align: center;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/deep/ .vxe-body--column {
|
|
410
|
+
padding-top: 6px;
|
|
411
|
+
padding-bottom: 6px;
|
|
412
|
+
height: auto !important;
|
|
413
|
+
max-height: unset !important;
|
|
414
|
+
}
|
|
415
|
+
</style>
|