@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,254 +1,258 @@
1
- <template>
2
- <div class="measure-stat-flat">
3
- <div v-if="!rows.length" class="stat-empty">暂无统计数据</div>
4
- <vxe-table
5
- v-else
6
- border
7
- :data="rows"
8
- :merge-cells="mergeCells"
9
- :row-config="{ keyField: '_rowKey' }"
10
- :scroll-y="{ enabled: false }"
11
- >
12
- <vxe-column field="pName" title="指标项" min-width="150" align="center" />
13
- <vxe-column field="statsName" title="统计项名称" min-width="150" align="center" />
14
- <vxe-column field="name" title="指标名称" min-width="150" align="center">
15
- <template #default="{ row }">
16
- <span>{{ row.name }}</span>
17
- <el-tooltip
18
- v-if="row.indicatorRemark"
19
- placement="top"
20
- effect="dark"
21
- popper-class="indicator-remark-tooltip"
22
- >
23
- <template #content>
24
- <div class="remark-content">{{ row.indicatorRemark }}</div>
25
- </template>
26
- <i class="n20-icon-xinxitishi cur-point color-secondary remark-icon"></i>
27
- </el-tooltip>
28
- </template>
29
- </vxe-column>
30
-
31
- <vxe-column title="指标模拟数据输入" min-width="280" align="center">
32
- <template #default="{ row }">
33
- <template v-if="isQualFn(row)">
34
- <el-select
35
- class="full-w"
36
- v-model="row.value"
37
- :disabled="ctx.readonly"
38
- size="small"
39
- placeholder="请选择"
40
- value-key="scoreMapID"
41
- @change="onQualChange(row)"
42
- >
43
- <el-option
44
- v-for="option in row.optionList"
45
- :key="option.scoreMapID || option.scoreText"
46
- :label="option.scoreText"
47
- :value="option"
48
- style="height: auto"
49
- >
50
- <div class="select-top">{{ option.scoreText }}</div>
51
- <div class="select-bottom">{{ option.reason }}</div>
52
- </el-option>
53
- </el-select>
54
- </template>
55
- <template v-else>
56
- <el-tooltip
57
- v-if="
58
- row.sourceType !== 3 &&
59
- (!row.optionList || !row.optionList.length) &&
60
- hasFormulaFn(row)
61
- "
62
- placement="top"
63
- effect="dark"
64
- >
65
- <div slot="content">
66
- {{ row.displayFormula }}:
67
- <br />
68
- {{ row.relFormula }}
69
- </div>
70
- <span>{{ indicatorTextFn(row) }}</span>
71
- </el-tooltip>
72
- <span
73
- v-else-if="
74
- row.sourceType !== 3 &&
75
- (!row.optionList || !row.optionList.length)
76
- "
77
- >
78
- {{ indicatorTextFn(row) }}
79
- </span>
80
- <InputNumber
81
- v-if="row.sourceType === 3 && row.itemType == 21"
82
- class="full-w"
83
- size="small"
84
- :type="row.displayStyle === 1 ? 'rate' : 'money'"
85
- :d-num="digitsFn(row)"
86
- :disabled="ctx.readonly"
87
- v-model="row.value"
88
- placeholder="请输入"
89
- />
90
- <InputNumber
91
- v-else-if="
92
- row.modifyRank === 2 &&
93
- row.indicatorResult !== '' &&
94
- row.indicatorResult !== null
95
- "
96
- class="full-w"
97
- size="small"
98
- :type="row.displayStyle === 1 ? 'rate' : 'money'"
99
- :d-num="digitsFn(row)"
100
- :disabled="ctx.readonly"
101
- v-model="row.value"
102
- placeholder="请输入"
103
- />
104
- </template>
105
- </template>
106
- </vxe-column>
107
-
108
- <vxe-column title="指标得分" width="140" align="center">
109
- <template #default="{ row }">
110
- <div>{{ resultFn(row) }}</div>
111
- <InputNumber
112
- v-if="
113
- row.result !== '' &&
114
- row.result !== null &&
115
- row.modifyRank === 1
116
- "
117
- class="full-w"
118
- :d-num="ctx.modelWrap.digits"
119
- :max="row.fullScore"
120
- :disabled="ctx.readonly"
121
- v-model="row.modifiedResult"
122
- placeholder="修改指标得分"
123
- />
124
- </template>
125
- </vxe-column>
126
-
127
- <vxe-column title="指标值显示" min-width="140" align="center">
128
- <template #default="{ row }">
129
- {{ row.indicatorValText || '—' }}
130
- </template>
131
- </vxe-column>
132
- </vxe-table>
133
- </div>
134
- </template>
135
-
136
- <script>
137
- import { InputNumber } from './ui'
138
- import { setMergeCells } from '../common'
139
- import {
140
- isQualIndicator,
141
- digitsCalc,
142
- resultByShowStyle,
143
- indicatorResultText
144
- } from './helpers'
145
-
146
- /** 与表格列顺序一致,供 setMergeCells 计算列索引 */
147
- const STAT_FLAT_COLUMNS = [
148
- { prop: 'pName' },
149
- { prop: 'statsName' },
150
- { prop: 'name' },
151
- { prop: 'indicatorResult' },
152
- { prop: 'result' },
153
- { prop: 'indicatorValText' }
154
- ]
155
-
156
- export default {
157
- name: 'MeasureStatFlatTable',
158
- components: { InputNumber },
159
- inject: ['measureCtx'],
160
- props: {
161
- rows: {
162
- type: Array,
163
- default: () => []
164
- }
165
- },
166
- computed: {
167
- ctx() {
168
- return this.measureCtx()
169
- },
170
- /** 同目录(pid)下的「指标项」列合并,对齐旧版 modelCalcTest */
171
- mergeCells() {
172
- return setMergeCells({
173
- list: this.rows,
174
- columns: STAT_FLAT_COLUMNS,
175
- merges: ['pName'],
176
- condition: ['pid'],
177
- field: 'prop'
178
- })
179
- }
180
- },
181
- methods: {
182
- isQualFn(row) {
183
- return isQualIndicator(row)
184
- },
185
- digitsFn(row) {
186
- return digitsCalc(row, this.ctx.modelWrap)
187
- },
188
- resultFn(row) {
189
- return resultByShowStyle(row, this.ctx.modelWrap)
190
- },
191
- indicatorTextFn(row) {
192
- return indicatorResultText(row, this.ctx.modelWrap)
193
- },
194
- hasFormulaFn(row) {
195
- return !!(row && (row.displayFormula || row.relFormula))
196
- },
197
- onQualChange(row) {
198
- const option = row.value
199
- if (!option || !option.scoreMapID) return
200
- this.$set(row, 'scoreMapID', option.scoreMapID)
201
- this.$set(row, 'scoreText', option.scoreText)
202
- this.$set(row, 'scoreValue', option.scoreValue)
203
- }
204
- }
205
- }
206
- </script>
207
-
208
- <style lang="less">
209
- .indicator-remark-tooltip {
210
- max-width: 360px;
211
- .remark-content {
212
- white-space: pre-wrap;
213
- word-break: break-word;
214
- line-height: 1.6;
215
- font-size: 14px;
216
- }
217
- }
218
- </style>
219
-
220
- <style lang="less" scoped>
221
- .measure-stat-flat {
222
- width: 100%;
223
- }
224
- .remark-icon {
225
- margin-left: 4px;
226
- }
227
- .full-w {
228
- width: 100%;
229
- }
230
- .stat-empty {
231
- padding: 12px;
232
- color: #909399;
233
- text-align: center;
234
- }
235
- .select-top {
236
- margin-top: 2px;
237
- height: 14px;
238
- line-height: 16px;
239
- font-size: 14px;
240
- }
241
- .select-bottom {
242
- margin-top: 1px;
243
- min-height: 14px;
244
- line-height: 16px;
245
- color: #999999;
246
- font-size: 14px;
247
- max-width: 500px;
248
- white-space: normal;
249
- word-wrap: break-word;
250
- }
251
- /deep/ .el-select .el-input__inner {
252
- text-align: center;
253
- }
254
- </style>
1
+ <template>
2
+ <div class="measure-stat-flat">
3
+ <div v-if="!rows.length" class="stat-empty">暂无统计数据</div>
4
+ <vxe-table
5
+ v-else
6
+ border
7
+ :data="rows"
8
+ :merge-cells="mergeCells"
9
+ :row-config="{ keyField: '_rowKey' }"
10
+ :scroll-y="{ enabled: false }"
11
+ >
12
+ <vxe-column field="pName" title="指标项" min-width="150" align="center" />
13
+ <vxe-column field="statsName" title="统计项名称" min-width="150" align="center" />
14
+ <vxe-column field="name" title="指标名称" min-width="150" align="center">
15
+ <template #default="{ row }">
16
+ <span>{{ row.name }}</span>
17
+ <el-tooltip
18
+ v-if="row.indicatorRemark"
19
+ placement="top"
20
+ effect="dark"
21
+ popper-class="indicator-remark-tooltip"
22
+ >
23
+ <template #content>
24
+ <div class="remark-content">{{ row.indicatorRemark }}</div>
25
+ </template>
26
+ <i class="n20-icon-xinxitishi cur-point color-secondary remark-icon"></i>
27
+ </el-tooltip>
28
+ </template>
29
+ </vxe-column>
30
+
31
+ <vxe-column title="指标模拟数据输入" min-width="280" align="center">
32
+ <template #default="{ row }">
33
+ <template v-if="isQualFn(row)">
34
+ <el-select
35
+ class="full-w"
36
+ v-model="row.value"
37
+ :disabled="ctx.readonly"
38
+ size="small"
39
+ placeholder="请选择"
40
+ value-key="scoreMapID"
41
+ @change="onQualChange(row)"
42
+ >
43
+ <el-option
44
+ v-for="option in row.optionList"
45
+ :key="option.scoreMapID || option.scoreText"
46
+ :label="option.scoreText"
47
+ :value="option"
48
+ style="height: auto"
49
+ >
50
+ <div class="select-top">{{ option.scoreText }}</div>
51
+ <div class="select-bottom">{{ option.reason }}</div>
52
+ </el-option>
53
+ </el-select>
54
+ </template>
55
+ <template v-else>
56
+ <el-tooltip
57
+ v-if="
58
+ row.sourceType !== 3 &&
59
+ (!row.optionList || !row.optionList.length) &&
60
+ hasFormulaFn(row)
61
+ "
62
+ placement="top"
63
+ effect="dark"
64
+ >
65
+ <div slot="content">
66
+ {{ row.displayFormula }}:
67
+ <br />
68
+ {{ row.relFormula }}
69
+ </div>
70
+ <span>{{ indicatorTextFn(row) }}</span>
71
+ </el-tooltip>
72
+ <span
73
+ v-else-if="
74
+ row.sourceType !== 3 &&
75
+ (!row.optionList || !row.optionList.length)
76
+ "
77
+ >
78
+ {{ indicatorTextFn(row) }}
79
+ </span>
80
+ <InputNumber
81
+ v-if="row.sourceType === 3 && row.itemType == 21"
82
+ class="full-w"
83
+ size="small"
84
+ :type="row.displayStyle === 1 ? 'rate' : 'money'"
85
+ :d-num="digitsFn(row)"
86
+ :disabled="ctx.readonly"
87
+ v-model="row.value"
88
+ placeholder="请输入"
89
+ />
90
+ <InputNumber
91
+ v-else-if="
92
+ row.modifyRank === 2 &&
93
+ row.indicatorResult !== '' &&
94
+ row.indicatorResult !== null
95
+ "
96
+ class="full-w"
97
+ size="small"
98
+ :type="row.displayStyle === 1 ? 'rate' : 'money'"
99
+ :d-num="digitsFn(row)"
100
+ :disabled="ctx.readonly"
101
+ v-model="row.value"
102
+ placeholder="请输入"
103
+ />
104
+ </template>
105
+ </template>
106
+ </vxe-column>
107
+
108
+ <vxe-column title="指标得分" width="140" align="center">
109
+ <template #default="{ row }">
110
+ <div>{{ resultFn(row) }}</div>
111
+ <InputNumber
112
+ v-if="
113
+ row.result !== '' &&
114
+ row.result !== null &&
115
+ row.modifyRank === 1
116
+ "
117
+ class="full-w"
118
+ :d-num="SCORE_DIGITS"
119
+ :max="row.fullScore"
120
+ :disabled="ctx.readonly"
121
+ v-model="row.modifiedResult"
122
+ placeholder="修改指标得分"
123
+ />
124
+ </template>
125
+ </vxe-column>
126
+
127
+ <vxe-column title="指标值显示" min-width="140" align="center">
128
+ <template #default="{ row }">
129
+ {{ row.indicatorValText || '—' }}
130
+ </template>
131
+ </vxe-column>
132
+ </vxe-table>
133
+ </div>
134
+ </template>
135
+
136
+ <script>
137
+ import { InputNumber } from './ui'
138
+ import { setMergeCells } from '../common'
139
+ import {
140
+ isQualIndicator,
141
+ digitsCalc,
142
+ SCORE_DIGITS,
143
+ resultByShowStyle,
144
+ indicatorResultText
145
+ } from './helpers'
146
+
147
+ /** 与表格列顺序一致,供 setMergeCells 计算列索引 */
148
+ const STAT_FLAT_COLUMNS = [
149
+ { prop: 'pName' },
150
+ { prop: 'statsName' },
151
+ { prop: 'name' },
152
+ { prop: 'indicatorResult' },
153
+ { prop: 'result' },
154
+ { prop: 'indicatorValText' }
155
+ ]
156
+
157
+ export default {
158
+ name: 'MeasureStatFlatTable',
159
+ components: { InputNumber },
160
+ inject: ['measureCtx'],
161
+ data() {
162
+ return { SCORE_DIGITS }
163
+ },
164
+ props: {
165
+ rows: {
166
+ type: Array,
167
+ default: () => []
168
+ }
169
+ },
170
+ computed: {
171
+ ctx() {
172
+ return this.measureCtx()
173
+ },
174
+ /** 同目录(pid)下的「指标项」列合并,对齐旧版 modelCalcTest */
175
+ mergeCells() {
176
+ return setMergeCells({
177
+ list: this.rows,
178
+ columns: STAT_FLAT_COLUMNS,
179
+ merges: ['pName'],
180
+ condition: ['pid'],
181
+ field: 'prop'
182
+ })
183
+ }
184
+ },
185
+ methods: {
186
+ isQualFn(row) {
187
+ return isQualIndicator(row)
188
+ },
189
+ digitsFn(row) {
190
+ return digitsCalc(row, this.ctx.modelWrap)
191
+ },
192
+ resultFn(row) {
193
+ return resultByShowStyle(row, this.ctx.modelWrap)
194
+ },
195
+ indicatorTextFn(row) {
196
+ return indicatorResultText(row, this.ctx.modelWrap)
197
+ },
198
+ hasFormulaFn(row) {
199
+ return !!(row && (row.displayFormula || row.relFormula))
200
+ },
201
+ onQualChange(row) {
202
+ const option = row.value
203
+ if (!option || !option.scoreMapID) return
204
+ this.$set(row, 'scoreMapID', option.scoreMapID)
205
+ this.$set(row, 'scoreText', option.scoreText)
206
+ this.$set(row, 'scoreValue', option.scoreValue)
207
+ }
208
+ }
209
+ }
210
+ </script>
211
+
212
+ <style lang="less">
213
+ .indicator-remark-tooltip {
214
+ max-width: 360px;
215
+ .remark-content {
216
+ white-space: pre-wrap;
217
+ word-break: break-word;
218
+ line-height: 1.6;
219
+ font-size: 14px;
220
+ }
221
+ }
222
+ </style>
223
+
224
+ <style lang="less" scoped>
225
+ .measure-stat-flat {
226
+ width: 100%;
227
+ }
228
+ .remark-icon {
229
+ margin-left: 4px;
230
+ }
231
+ .full-w {
232
+ width: 100%;
233
+ }
234
+ .stat-empty {
235
+ padding: 12px;
236
+ color: #909399;
237
+ text-align: center;
238
+ }
239
+ .select-top {
240
+ margin-top: 2px;
241
+ height: 14px;
242
+ line-height: 16px;
243
+ font-size: 14px;
244
+ }
245
+ .select-bottom {
246
+ margin-top: 1px;
247
+ min-height: 14px;
248
+ line-height: 16px;
249
+ color: #999999;
250
+ font-size: 14px;
251
+ max-width: 500px;
252
+ white-space: normal;
253
+ word-wrap: break-word;
254
+ }
255
+ /deep/ .el-select .el-input__inner {
256
+ text-align: center;
257
+ }
258
+ </style>