@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.
@@ -1,432 +1,438 @@
1
- <template>
2
- <div class="measure-eval-flat">
3
- <vxe-table
4
- border
5
- :data="rows"
6
- :row-config="{ keyField: '_rowKey' }"
7
- :scroll-y="{ enabled: false }"
8
- >
9
- <vxe-column v-if="showSerial" title="序号" width="72" align="center">
10
- <template #default="{ rowIndex }">{{ rowIndex + 1 }}</template>
11
- </vxe-column>
12
-
13
- <vxe-column
14
- v-if="hasGroupName"
15
- field="_groupName"
16
- title="分组"
17
- min-width="140"
18
- align="center"
19
- />
20
-
21
- <vxe-column field="name" title="指标名称" min-width="200" align="center">
22
- <template #default="{ row }">
23
- <span>{{ row.name }}</span>
24
- <el-tooltip
25
- v-if="row.indicatorRemark"
26
- placement="top"
27
- effect="dark"
28
- popper-class="indicator-remark-tooltip"
29
- >
30
- <template #content>
31
- <div class="remark-content">{{ row.indicatorRemark }}</div>
32
- </template>
33
- <i
34
- class="n20-icon-xinxitishi cur-point color-secondary remark-icon"
35
- ></i>
36
- </el-tooltip>
37
- </template>
38
- </vxe-column>
39
-
40
- <vxe-column field="code" title="指标编码" width="130" align="center">
41
- <template #default="{ row }">{{ row.code || '—' }}</template>
42
- </vxe-column>
43
-
44
- <vxe-column
45
- v-if="ctx.modelWrap.showWeight === 1"
46
- title="权重"
47
- width="80"
48
- align="center"
49
- >
50
- <template #default="{ row }">
51
- <template v-if="row.isLeaf === 0">—</template>
52
- <template v-else>{{ row.weight || '—' }}</template>
53
- </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 }">{{ fullScoreFn(row) }}</template>
63
- </vxe-column>
64
-
65
- <vxe-column
66
- v-if="showFormulaCol"
67
- field="displayFormula"
68
- title="计算公式"
69
- width="130"
70
- align="center"
71
- >
72
- <template #default="{ row }">{{ row.displayFormula || '—' }}</template>
73
- </vxe-column>
74
- <vxe-column
75
- v-if="showRemarkCol"
76
- field="indicatorRemark"
77
- title="评价标准"
78
- width="130"
79
- align="center"
80
- >
81
- <template #default="{ row }">{{ row.indicatorRemark || '—' }}</template>
82
- </vxe-column>
83
-
84
- <vxe-column title="指标值" min-width="260" align="center">
85
- <template #default="{ row }">
86
- <template v-if="isQualFn(row)">
87
- <el-select
88
- class="full-w"
89
- :value="resolveRow(row).scoreMapID"
90
- :disabled="ctx.readonly"
91
- size="small"
92
- placeholder="请选择"
93
- @change="val => onQualChange(row, val)"
94
- >
95
- <el-option
96
- v-for="option in resolveRow(row).optionList"
97
- :key="option.scoreMapID || option.scoreText"
98
- :label="option.scoreText"
99
- :value="option.scoreMapID"
100
- style="height: auto"
101
- >
102
- <div class="select-top">{{ option.scoreText }}</div>
103
- <div class="select-bottom">{{ option.reason }}</div>
104
- </el-option>
105
- </el-select>
106
- </template>
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>
120
- <InputNumber
121
- v-if="row.sourceType === 3 && row.itemType === 21"
122
- class="full-w"
123
- size="small"
124
- :type="row.displayStyle === 1 ? 'rate' : 'money'"
125
- :d-num="digitsFn(row)"
126
- :disabled="ctx.readonly"
127
- v-model="resolveRow(row).value"
128
- />
129
- <InputNumber
130
- v-else-if="
131
- row.modifyRank === 2 &&
132
- row.indicatorResult !== '' &&
133
- row.indicatorResult !== null
134
- "
135
- class="full-w"
136
- size="small"
137
- :type="row.displayStyle === 1 ? 'rate' : 'money'"
138
- :d-num="digitsFn(row)"
139
- :disabled="ctx.readonly"
140
- v-model="resolveRow(row).value"
141
- placeholder="请输入"
142
- />
143
- </div>
144
- </template>
145
- </vxe-column>
146
-
147
- <vxe-column title="指标得分" width="140" align="center">
148
- <template #default="{ row }">
149
- <div>{{ indicatorScoreFn(row) }}</div>
150
- </template>
151
- </vxe-column>
152
- <vxe-column title="模型指标得分" width="140" align="center">
153
- <template #default="{ row }">
154
- <div>{{ resultFn(row) }}</div>
155
- <InputNumber
156
- v-if="
157
- !isQualFn(row) &&
158
- row.result !== '' &&
159
- row.result !== null &&
160
- row.modifyRank === 1
161
- "
162
- class="full-w"
163
- :d-num="ctx.modelWrap.digits"
164
- :max="row.fullScore"
165
- :disabled="ctx.readonly"
166
- v-model="row.modifiedResult"
167
- placeholder="修改模型指标得分"
168
- />
169
- </template>
170
- </vxe-column>
171
- <vxe-column
172
- v-if="showModifyReasonCol"
173
- min-width="260"
174
- align="center"
175
- >
176
- <template #header>
177
- <div>
178
- <span>填报/调整理由</span>
179
- <span
180
- v-title="'填写调整后的指标值、调整理由后,需再次点击整体测算'"
181
- class="n20-icon-xinxitishi m-l-s cur-point"
182
- ></span>
183
- </div>
184
- </template>
185
- <template #default="{ row }">
186
- <el-input
187
- v-if="showManualReason(row)"
188
- type="textarea"
189
- v-title
190
- :class="{ reasonRequireRed: manualReasonRed(row) }"
191
- :show-overflow-tooltip="true"
192
- :maxlength="1000"
193
- :disabled="ctx.readonly"
194
- show-word-limit
195
- v-model="resolveRow(row).modifiedReason"
196
- :placeholder="reasonPlaceholder(row, 'manual')"
197
- />
198
- <el-input
199
- v-if="isQualFn(row)"
200
- type="textarea"
201
- v-title
202
- :show-overflow-tooltip="true"
203
- :maxlength="2000"
204
- :disabled="ctx.readonly"
205
- show-word-limit
206
- v-model="resolveRow(row).reason"
207
- placeholder="请输入具体评价依据,不超过2000字"
208
- @input="onQualReasonInput(row)"
209
- />
210
- <el-input
211
- v-else-if="showAdjustReason(row)"
212
- type="textarea"
213
- v-title
214
- :class="{ reasonRequireRed: adjustReasonRed(row) }"
215
- :show-overflow-tooltip="true"
216
- :maxlength="1000"
217
- :disabled="ctx.readonly"
218
- show-word-limit
219
- v-model="resolveRow(row).modifiedReason"
220
- :placeholder="reasonPlaceholder(row, 'adjust')"
221
- />
222
- </template>
223
- </vxe-column>
224
- </vxe-table>
225
- </div>
226
- </template>
227
-
228
- <script>
229
- import { InputNumber } from './ui'
230
- import {
231
- isQualIndicator,
232
- digitsCalc,
233
- resultByShowStyle,
234
- indicatorScoreText,
235
- indicatorResultText,
236
- fullScoreText,
237
- showLevelSerial,
238
- isShowFullScore
239
- } from './helpers'
240
-
241
- export default {
242
- name: 'MeasureEvalFlatTable',
243
- components: { InputNumber },
244
- inject: ['measureCtx'],
245
- props: {
246
- section: {
247
- type: Object,
248
- default: {}
249
- },
250
- rows: {
251
- type: Array,
252
- default: () => []
253
- }
254
- },
255
- computed: {
256
- ctx() {
257
- return this.measureCtx()
258
- },
259
- hasGroupName() {
260
- return this.rows.some(r => r._groupName)
261
- },
262
- showSerial() {
263
- return showLevelSerial(this.ctx.modelWrap)
264
- },
265
- /** 列显隐以根模型配置为准(后端写在 modelWrap 上) */
266
- showFormulaCol() {
267
- return this.resolveShowFlag('showFormula')
268
- },
269
- showRemarkCol() {
270
- return this.resolveShowFlag('showRemark')
271
- },
272
- showFullScoreCol() {
273
- return (this.rows || []).some(row => isShowFullScore(row))
274
- },
275
- showModifyReasonCol() {
276
- return this.resolveShowFlag('showModifyReason')
277
- }
278
- },
279
- methods: {
280
- resolveShowFlag(key) {
281
- const sectionVal = this.section && this.section[key]
282
- if (sectionVal === 0 || sectionVal === 1) return sectionVal === 1
283
- const wrap = this.ctx && this.ctx.modelWrap
284
- return !!(wrap && wrap[key] === 1)
285
- },
286
- resolveRow(row) {
287
- const resolve = this.ctx.resolveLeafNode
288
- return resolve ? resolve(row) || row : row
289
- },
290
- isQualFn(row) {
291
- return isQualIndicator(row)
292
- },
293
- digitsFn(row) {
294
- return digitsCalc(row, this.ctx.modelWrap)
295
- },
296
- resultFn(row) {
297
- return resultByShowStyle(row, this.ctx.modelWrap)
298
- },
299
- indicatorScoreFn(row) {
300
- return indicatorScoreText(row, this.ctx.modelWrap)
301
- },
302
- indicatorTextFn(row) {
303
- return indicatorResultText(row, this.ctx.modelWrap)
304
- },
305
- fullScoreFn(row) {
306
- return fullScoreText(row, this.ctx.modelWrap)
307
- },
308
- onQualChange(row, scoreMapID) {
309
- const target = this.resolveRow(row)
310
- if (scoreMapID == null || scoreMapID === '') {
311
- this.$set(target, 'scoreMapID', null)
312
- this.$set(target, 'value', null)
313
- this.syncQual(target, {
314
- scoreMapID: null,
315
- scoreText: '',
316
- scoreValue: null
317
- })
318
- return
319
- }
320
- this.$set(target, 'scoreMapID', scoreMapID)
321
- const option = (target.optionList || []).find(
322
- o => o.scoreMapID == scoreMapID
323
- )
324
- if (!option) return
325
- this.$set(target, 'value', option)
326
- this.$set(target, 'scoreText', option.scoreText)
327
- this.$set(target, 'scoreValue', option.scoreValue)
328
- target.picker = option
329
- this.syncQual(target, {
330
- itemID: target.itemID,
331
- scoreMapID: option.scoreMapID,
332
- scoreText: option.scoreText,
333
- scoreValue: option.scoreValue,
334
- reason: target.reason
335
- })
336
- },
337
- onQualReasonInput(row) {
338
- const target = this.resolveRow(row)
339
- this.syncQual(target, {
340
- itemID: target.itemID,
341
- scoreMapID: target.scoreMapID,
342
- reason: target.reason
343
- })
344
- },
345
- syncQual(node, patch) {
346
- const sync = this.ctx.syncQualSelection
347
- if (sync && node && node.tid) sync(node.tid, patch)
348
- },
349
- showManualReason(row) {
350
- return !this.isQualFn(row) && row.sourceType === 3
351
- },
352
- showAdjustReason(row) {
353
- if (this.isQualFn(row) || row.sourceType === 3) return false
354
- const val = row.modifiedVal != null ? row.modifiedVal : row.value
355
- return (
356
- (row.modifyRank === 2 && val !== '' && val !== null) ||
357
- (row.result !== '' && row.result !== null && row.modifyRank === 1)
358
- )
359
- },
360
- manualReasonRed(row) {
361
- return (
362
- row.reasonRequire === 1 && row.modifyRank === 2 && !row.modifiedReason
363
- )
364
- },
365
- adjustReasonRed(row) {
366
- const val = row.modifiedVal != null ? row.modifiedVal : row.value
367
- return (
368
- row.reasonRequire === 1 &&
369
- row.modifyRank === 2 &&
370
- val != row.indicatorResult
371
- )
372
- },
373
- reasonPlaceholder(row, type) {
374
- const required =
375
- type === 'manual'
376
- ? this.manualReasonRed(row)
377
- : this.adjustReasonRed(row)
378
- return required
379
- ? '请输入具体评价依据,不超过1000字(必填)'
380
- : '请输入具体评价依据,不超过1000字'
381
- }
382
- }
383
- }
384
- </script>
385
-
386
- <style lang="less">
387
- .indicator-remark-tooltip {
388
- max-width: 360px;
389
- .remark-content {
390
- white-space: pre-wrap;
391
- word-break: break-word;
392
- line-height: 1.6;
393
- font-size: 14px;
394
- }
395
- }
396
- </style>
397
-
398
- <style lang="less" scoped>
399
- .measure-eval-flat {
400
- width: 100%;
401
- }
402
- .remark-icon {
403
- margin-left: 4px;
404
- }
405
- .full-w {
406
- width: 100%;
407
- }
408
- .select-top {
409
- margin-top: 2px;
410
- height: 14px;
411
- line-height: 16px;
412
- font-size: 14px;
413
- }
414
- .select-bottom {
415
- margin-top: 1px;
416
- min-height: 14px;
417
- line-height: 16px;
418
- color: #999999;
419
- font-size: 14px;
420
- max-width: 500px;
421
- white-space: normal;
422
- word-wrap: break-word;
423
- }
424
- .reasonRequireRed {
425
- ::v-deep .el-textarea__inner::placeholder {
426
- color: #ff3b30 !important;
427
- }
428
- }
429
- /deep/ .el-select .el-input__inner {
430
- text-align: center;
431
- }
432
- </style>
1
+ <template>
2
+ <div class="measure-eval-flat">
3
+ <vxe-table
4
+ border
5
+ :data="rows"
6
+ :row-config="{ keyField: '_rowKey' }"
7
+ :scroll-y="{ enabled: false }"
8
+ >
9
+ <vxe-column v-if="showSerial" title="序号" width="72" align="center">
10
+ <template #default="{ rowIndex }">{{ rowIndex + 1 }}</template>
11
+ </vxe-column>
12
+
13
+ <vxe-column
14
+ v-if="hasGroupName"
15
+ field="_groupName"
16
+ title="分组"
17
+ min-width="140"
18
+ align="center"
19
+ />
20
+
21
+ <vxe-column field="name" title="指标名称" min-width="200" align="center">
22
+ <template #default="{ row }">
23
+ <span>{{ row.name }}</span>
24
+ <el-tooltip
25
+ v-if="row.indicatorRemark"
26
+ placement="top"
27
+ effect="dark"
28
+ popper-class="indicator-remark-tooltip"
29
+ >
30
+ <template #content>
31
+ <div class="remark-content">{{ row.indicatorRemark }}</div>
32
+ </template>
33
+ <i
34
+ class="n20-icon-xinxitishi cur-point color-secondary remark-icon"
35
+ ></i>
36
+ </el-tooltip>
37
+ </template>
38
+ </vxe-column>
39
+
40
+ <vxe-column field="code" title="指标编码" width="130" align="center">
41
+ <template #default="{ row }">{{ row.code || '—' }}</template>
42
+ </vxe-column>
43
+
44
+ <vxe-column
45
+ v-if="ctx.modelWrap.showWeight === 1"
46
+ title="权重"
47
+ width="80"
48
+ align="center"
49
+ >
50
+ <template #default="{ row }">
51
+ <template v-if="row.isLeaf === 0">—</template>
52
+ <template v-else>{{ row.weight || '—' }}</template>
53
+ </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 }">{{ fullScoreFn(row) }}</template>
63
+ </vxe-column>
64
+
65
+ <vxe-column
66
+ v-if="showFormulaCol"
67
+ field="displayFormula"
68
+ title="计算公式"
69
+ width="130"
70
+ align="center"
71
+ >
72
+ <template #default="{ row }">{{ row.displayFormula || '—' }}</template>
73
+ </vxe-column>
74
+ <vxe-column
75
+ v-if="showRemarkCol"
76
+ field="indicatorRemark"
77
+ title="评价标准"
78
+ width="130"
79
+ align="center"
80
+ >
81
+ <template #default="{ row }">{{ row.indicatorRemark || '—' }}</template>
82
+ </vxe-column>
83
+
84
+ <vxe-column title="指标值" min-width="260" align="center">
85
+ <template #default="{ row }">
86
+ <template v-if="isQualFn(row)">
87
+ <el-select
88
+ class="full-w"
89
+ :value="resolveRow(row).scoreMapID"
90
+ :disabled="ctx.readonly"
91
+ size="small"
92
+ placeholder="请选择"
93
+ @change="val => onQualChange(row, val)"
94
+ >
95
+ <el-option
96
+ v-for="option in resolveRow(row).optionList"
97
+ :key="option.scoreMapID || option.scoreText"
98
+ :label="option.scoreText"
99
+ :value="option.scoreMapID"
100
+ style="height: auto"
101
+ >
102
+ <div class="select-top">{{ option.scoreText }}</div>
103
+ <div class="select-bottom">{{ option.reason }}</div>
104
+ </el-option>
105
+ </el-select>
106
+ </template>
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
+ <div slot="content">
115
+ {{ row.displayFormula }}:
116
+ <br />
117
+ {{ row.relFormula }}
118
+ </div>
119
+ <span>{{ indicatorTextFn(row) }}</span>
120
+ </el-tooltip>
121
+ <span v-else-if="row.sourceType !== 3">{{ indicatorTextFn(row) }}</span>
122
+ <InputNumber
123
+ v-if="row.sourceType === 3 && row.itemType === 21"
124
+ class="full-w"
125
+ size="small"
126
+ :type="row.displayStyle === 1 ? 'rate' : 'money'"
127
+ :d-num="digitsFn(row)"
128
+ :disabled="ctx.readonly"
129
+ v-model="resolveRow(row).value"
130
+ />
131
+ <InputNumber
132
+ v-else-if="
133
+ row.modifyRank === 2 &&
134
+ row.indicatorResult !== '' &&
135
+ row.indicatorResult !== null
136
+ "
137
+ class="full-w"
138
+ size="small"
139
+ :type="row.displayStyle === 1 ? 'rate' : 'money'"
140
+ :d-num="digitsFn(row)"
141
+ :disabled="ctx.readonly"
142
+ v-model="resolveRow(row).value"
143
+ placeholder="请输入"
144
+ />
145
+ </div>
146
+ </template>
147
+ </vxe-column>
148
+
149
+ <vxe-column title="指标得分" width="140" align="center">
150
+ <template #default="{ row }">
151
+ <div>{{ indicatorScoreFn(row) }}</div>
152
+ </template>
153
+ </vxe-column>
154
+ <vxe-column title="模型指标得分" width="140" align="center">
155
+ <template #default="{ row }">
156
+ <div>{{ resultFn(row) }}</div>
157
+ <InputNumber
158
+ v-if="
159
+ !isQualFn(row) &&
160
+ row.result !== '' &&
161
+ row.result !== null &&
162
+ row.modifyRank === 1
163
+ "
164
+ class="full-w"
165
+ :d-num="SCORE_DIGITS"
166
+ :max="row.fullScore"
167
+ :disabled="ctx.readonly"
168
+ v-model="row.modifiedResult"
169
+ placeholder="修改模型指标得分"
170
+ />
171
+ </template>
172
+ </vxe-column>
173
+ <vxe-column
174
+ v-if="showModifyReasonCol"
175
+ min-width="260"
176
+ align="center"
177
+ >
178
+ <template #header>
179
+ <div>
180
+ <span>填报/调整理由</span>
181
+ <span
182
+ v-title="'填写调整后的指标值、调整理由后,需再次点击整体测算'"
183
+ class="n20-icon-xinxitishi m-l-s cur-point"
184
+ ></span>
185
+ </div>
186
+ </template>
187
+ <template #default="{ row }">
188
+ <el-input
189
+ v-if="showManualReason(row)"
190
+ type="textarea"
191
+ v-title
192
+ :class="{ reasonRequireRed: manualReasonRed(row) }"
193
+ :show-overflow-tooltip="true"
194
+ :maxlength="1000"
195
+ :disabled="ctx.readonly"
196
+ show-word-limit
197
+ v-model="resolveRow(row).modifiedReason"
198
+ :placeholder="reasonPlaceholder(row, 'manual')"
199
+ />
200
+ <el-input
201
+ v-if="isQualFn(row)"
202
+ type="textarea"
203
+ v-title
204
+ :show-overflow-tooltip="true"
205
+ :maxlength="2000"
206
+ :disabled="ctx.readonly"
207
+ show-word-limit
208
+ v-model="resolveRow(row).reason"
209
+ placeholder="请输入具体评价依据,不超过2000字"
210
+ @input="onQualReasonInput(row)"
211
+ />
212
+ <el-input
213
+ v-else-if="showAdjustReason(row)"
214
+ type="textarea"
215
+ v-title
216
+ :class="{ reasonRequireRed: adjustReasonRed(row) }"
217
+ :show-overflow-tooltip="true"
218
+ :maxlength="1000"
219
+ :disabled="ctx.readonly"
220
+ show-word-limit
221
+ v-model="resolveRow(row).modifiedReason"
222
+ :placeholder="reasonPlaceholder(row, 'adjust')"
223
+ />
224
+ </template>
225
+ </vxe-column>
226
+ </vxe-table>
227
+ </div>
228
+ </template>
229
+
230
+ <script>
231
+ import { InputNumber } from './ui'
232
+ import {
233
+ isQualIndicator,
234
+ digitsCalc,
235
+ SCORE_DIGITS,
236
+ resultByShowStyle,
237
+ indicatorScoreText,
238
+ indicatorResultText,
239
+ fullScoreText,
240
+ showLevelSerial,
241
+ isShowFullScore
242
+ } from './helpers'
243
+
244
+ export default {
245
+ name: 'MeasureEvalFlatTable',
246
+ components: { InputNumber },
247
+ inject: ['measureCtx'],
248
+ data() {
249
+ return { SCORE_DIGITS }
250
+ },
251
+ props: {
252
+ section: {
253
+ type: Object,
254
+ default: {}
255
+ },
256
+ rows: {
257
+ type: Array,
258
+ default: () => []
259
+ }
260
+ },
261
+ computed: {
262
+ ctx() {
263
+ return this.measureCtx()
264
+ },
265
+ hasGroupName() {
266
+ return this.rows.some(r => r._groupName)
267
+ },
268
+ showSerial() {
269
+ return showLevelSerial(this.ctx.modelWrap)
270
+ },
271
+ /** 列显隐以根模型配置为准(后端写在 modelWrap 上) */
272
+ showFormulaCol() {
273
+ return this.resolveShowFlag('showFormula')
274
+ },
275
+ showRemarkCol() {
276
+ return this.resolveShowFlag('showRemark')
277
+ },
278
+ showFullScoreCol() {
279
+ return (this.rows || []).some(row => isShowFullScore(row))
280
+ },
281
+ showModifyReasonCol() {
282
+ return this.resolveShowFlag('showModifyReason')
283
+ }
284
+ },
285
+ methods: {
286
+ resolveShowFlag(key) {
287
+ const sectionVal = this.section && this.section[key]
288
+ if (sectionVal === 0 || sectionVal === 1) return sectionVal === 1
289
+ const wrap = this.ctx && this.ctx.modelWrap
290
+ return !!(wrap && wrap[key] === 1)
291
+ },
292
+ resolveRow(row) {
293
+ const resolve = this.ctx.resolveLeafNode
294
+ return resolve ? resolve(row) || row : row
295
+ },
296
+ isQualFn(row) {
297
+ return isQualIndicator(row)
298
+ },
299
+ digitsFn(row) {
300
+ return digitsCalc(row, this.ctx.modelWrap)
301
+ },
302
+ resultFn(row) {
303
+ return resultByShowStyle(row, this.ctx.modelWrap)
304
+ },
305
+ indicatorScoreFn(row) {
306
+ return indicatorScoreText(row, this.ctx.modelWrap)
307
+ },
308
+ indicatorTextFn(row) {
309
+ return indicatorResultText(row, this.ctx.modelWrap)
310
+ },
311
+ fullScoreFn(row) {
312
+ return fullScoreText(row, this.ctx.modelWrap)
313
+ },
314
+ onQualChange(row, scoreMapID) {
315
+ const target = this.resolveRow(row)
316
+ if (scoreMapID == null || scoreMapID === '') {
317
+ this.$set(target, 'scoreMapID', null)
318
+ this.$set(target, 'value', null)
319
+ this.syncQual(target, {
320
+ scoreMapID: null,
321
+ scoreText: '',
322
+ scoreValue: null
323
+ })
324
+ return
325
+ }
326
+ this.$set(target, 'scoreMapID', scoreMapID)
327
+ const option = (target.optionList || []).find(
328
+ o => o.scoreMapID == scoreMapID
329
+ )
330
+ if (!option) return
331
+ this.$set(target, 'value', option)
332
+ this.$set(target, 'scoreText', option.scoreText)
333
+ this.$set(target, 'scoreValue', option.scoreValue)
334
+ target.picker = option
335
+ this.syncQual(target, {
336
+ itemID: target.itemID,
337
+ scoreMapID: option.scoreMapID,
338
+ scoreText: option.scoreText,
339
+ scoreValue: option.scoreValue,
340
+ reason: target.reason
341
+ })
342
+ },
343
+ onQualReasonInput(row) {
344
+ const target = this.resolveRow(row)
345
+ this.syncQual(target, {
346
+ itemID: target.itemID,
347
+ scoreMapID: target.scoreMapID,
348
+ reason: target.reason
349
+ })
350
+ },
351
+ syncQual(node, patch) {
352
+ const sync = this.ctx.syncQualSelection
353
+ if (sync && node && node.tid) sync(node.tid, patch)
354
+ },
355
+ showManualReason(row) {
356
+ return !this.isQualFn(row) && row.sourceType === 3
357
+ },
358
+ showAdjustReason(row) {
359
+ if (this.isQualFn(row) || row.sourceType === 3) return false
360
+ const val = row.modifiedVal != null ? row.modifiedVal : row.value
361
+ return (
362
+ (row.modifyRank === 2 && val !== '' && val !== null) ||
363
+ (row.result !== '' && row.result !== null && row.modifyRank === 1)
364
+ )
365
+ },
366
+ manualReasonRed(row) {
367
+ return (
368
+ row.reasonRequire === 1 && row.modifyRank === 2 && !row.modifiedReason
369
+ )
370
+ },
371
+ adjustReasonRed(row) {
372
+ const val = row.modifiedVal != null ? row.modifiedVal : row.value
373
+ return (
374
+ row.reasonRequire === 1 &&
375
+ row.modifyRank === 2 &&
376
+ val != row.indicatorResult
377
+ )
378
+ },
379
+ reasonPlaceholder(row, type) {
380
+ const required =
381
+ type === 'manual'
382
+ ? this.manualReasonRed(row)
383
+ : this.adjustReasonRed(row)
384
+ return required
385
+ ? '请输入具体评价依据,不超过1000字(必填)'
386
+ : '请输入具体评价依据,不超过1000字'
387
+ }
388
+ }
389
+ }
390
+ </script>
391
+
392
+ <style lang="less">
393
+ .indicator-remark-tooltip {
394
+ max-width: 360px;
395
+ .remark-content {
396
+ white-space: pre-wrap;
397
+ word-break: break-word;
398
+ line-height: 1.6;
399
+ font-size: 14px;
400
+ }
401
+ }
402
+ </style>
403
+
404
+ <style lang="less" scoped>
405
+ .measure-eval-flat {
406
+ width: 100%;
407
+ }
408
+ .remark-icon {
409
+ margin-left: 4px;
410
+ }
411
+ .full-w {
412
+ width: 100%;
413
+ }
414
+ .select-top {
415
+ margin-top: 2px;
416
+ height: 14px;
417
+ line-height: 16px;
418
+ font-size: 14px;
419
+ }
420
+ .select-bottom {
421
+ margin-top: 1px;
422
+ min-height: 14px;
423
+ line-height: 16px;
424
+ color: #999999;
425
+ font-size: 14px;
426
+ max-width: 500px;
427
+ white-space: normal;
428
+ word-wrap: break-word;
429
+ }
430
+ .reasonRequireRed {
431
+ ::v-deep .el-textarea__inner::placeholder {
432
+ color: #ff3b30 !important;
433
+ }
434
+ }
435
+ /deep/ .el-select .el-input__inner {
436
+ text-align: center;
437
+ }
438
+ </style>