cnhis-design-vue 0.2.65-beta → 0.2.68-beta

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.
Files changed (131) hide show
  1. package/es/affix/index.js +8 -8
  2. package/es/age/index.js +10 -10
  3. package/es/alert/index.js +8 -8
  4. package/es/anchor/index.js +8 -8
  5. package/es/auto-complete/index.js +8 -8
  6. package/es/avatar/index.js +8 -8
  7. package/es/back-top/index.js +8 -8
  8. package/es/badge/index.js +8 -8
  9. package/es/base/index.js +8 -8
  10. package/es/big-table/index.js +1852 -1352
  11. package/es/big-table/style.css +1 -1
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +28 -28
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +1 -1
  32. package/es/empty/index.js +8 -8
  33. package/es/fabric-chart/index.js +9 -9
  34. package/es/form/index.js +8 -8
  35. package/es/form-model/index.js +8 -8
  36. package/es/form-table/index.js +62 -62
  37. package/es/index/index.js +3310 -2125
  38. package/es/index/style.css +1 -1
  39. package/es/input/index.js +9 -9
  40. package/es/input-number/index.js +8 -8
  41. package/es/layout/index.js +8 -8
  42. package/es/list/index.js +8 -8
  43. package/es/locale-provider/index.js +8 -8
  44. package/es/map/index.js +9 -9
  45. package/es/mentions/index.js +8 -8
  46. package/es/menu/index.js +8 -8
  47. package/es/message/index.js +8 -8
  48. package/es/multi-chat/index.js +75 -75
  49. package/es/multi-chat-client/index.js +69 -69
  50. package/es/multi-chat-history/index.js +4 -4
  51. package/es/multi-chat-record/index.js +14 -14
  52. package/es/multi-chat-setting/index.js +22 -22
  53. package/es/multi-chat-sip/index.js +1 -1
  54. package/es/notification/index.js +8 -8
  55. package/es/page-header/index.js +8 -8
  56. package/es/pagination/index.js +8 -8
  57. package/es/popconfirm/index.js +8 -8
  58. package/es/popover/index.js +8 -8
  59. package/es/progress/index.js +8 -8
  60. package/es/radio/index.js +9 -9
  61. package/es/rate/index.js +8 -8
  62. package/es/result/index.js +8 -8
  63. package/es/row/index.js +8 -8
  64. package/es/scale-view/index.js +1127 -408
  65. package/es/scale-view/style.css +1 -1
  66. package/es/select/index.js +11 -11
  67. package/es/select-label/index.js +11 -11
  68. package/es/select-person/index.js +2 -2
  69. package/es/skeleton/index.js +8 -8
  70. package/es/slider/index.js +8 -8
  71. package/es/space/index.js +8 -8
  72. package/es/spin/index.js +8 -8
  73. package/es/statistic/index.js +8 -8
  74. package/es/steps/index.js +8 -8
  75. package/es/switch/index.js +8 -8
  76. package/es/table-filter/index.js +199 -177
  77. package/es/table-filter/style.css +1 -1
  78. package/es/tabs/index.js +8 -8
  79. package/es/tag/index.js +9 -9
  80. package/es/time-picker/index.js +8 -8
  81. package/es/timeline/index.js +8 -8
  82. package/es/tooltip/index.js +8 -8
  83. package/es/transfer/index.js +8 -8
  84. package/es/tree/index.js +8 -8
  85. package/es/tree-select/index.js +8 -8
  86. package/es/upload/index.js +8 -8
  87. package/es/utils/utils-map.js +33 -0
  88. package/es/utils/vexutils.js +21 -0
  89. package/es/verification-code/index.js +2 -2
  90. package/lib/cui.common.js +5759 -4597
  91. package/lib/cui.umd.js +5759 -4597
  92. package/lib/cui.umd.min.js +81 -81
  93. package/package.json +1 -1
  94. package/packages/big-table/src/BigTable.vue +100 -221
  95. package/packages/big-table/src/assets/style/table-base.less +16 -0
  96. package/packages/big-table/src/components/TextOverTooltip.vue +1 -1
  97. package/packages/big-table/src/components/edit-form/EditForm.vue +27 -9
  98. package/packages/big-table/src/components/edit-form/edit-component/config-data/index.js +2 -1
  99. package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +2 -3
  100. package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +2 -2
  101. package/packages/big-table/src/components/edit-form/edit-component/edit-select/edit-select.vue +1 -1
  102. package/packages/big-table/src/components/edit-form/edit-component/edit-select-multiple/edit-select-multiple.vue +1 -1
  103. package/packages/big-table/src/components/edit-form/edit-component/edit-switch/edit-switch.vue +43 -0
  104. package/packages/big-table/src/components/edit-form/edit-component/mixins/dateType.js +5 -4
  105. package/packages/big-table/src/components/edit-form/edit-component/mixins/item-default.js +50 -5
  106. package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +202 -153
  107. package/packages/big-table/src/components/edit-form/edit-item/form-event.js +3 -2
  108. package/packages/big-table/src/components/edit-form/edit-item/validate-rules.js +6 -6
  109. package/packages/big-table/src/components/edit-form/edit-mixins/form-commom.js +25 -20
  110. package/packages/big-table/src/components/player-vod/video-list.vue +3 -2
  111. package/packages/big-table/src/utils/batchEditing.js +144 -75
  112. package/packages/big-table/src/utils/bigTableProps.js +9 -13
  113. package/packages/scale-view/NoData.vue +81 -0
  114. package/packages/scale-view/answerParse.vue +10 -1
  115. package/packages/scale-view/assets/img/failure.png +0 -0
  116. package/packages/scale-view/assets/img/no-permission.png +0 -0
  117. package/packages/scale-view/assets/img/nodata.png +0 -0
  118. package/packages/scale-view/assets/img/notfound.png +0 -0
  119. package/packages/scale-view/formitem/r-choice.vue +319 -99
  120. package/packages/scale-view/formitem/r-input.vue +10 -14
  121. package/packages/scale-view/mixin/NoData.js +16 -2
  122. package/packages/scale-view/mixin/evaluate.js +1 -1
  123. package/packages/scale-view/scaleView.vue +334 -139
  124. package/packages/table-filter/src/base-search-com/BaseSearch.vue +45 -47
  125. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +3 -0
  126. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +9 -4
  127. package/packages/table-filter/src/components/search-filter/SearchFilter.vue +11 -3
  128. package/src/utils/utils-map.js +34 -0
  129. package/src/utils/vexutils.js +96 -77
  130. package/packages/big-table/src/components/edit-form/edit-component/global-props.js +0 -33
  131. package/packages/big-table/src/components/edit-form/edit-component/index.js +0 -8
@@ -5,7 +5,7 @@
5
5
  <svg-icon :iconClass="answerIcon"></svg-icon>
6
6
  {{ answerResText }}
7
7
  </div>
8
- <div v-if="answerSuccess"> 本题得分:{{ questionScore }}分 </div>
8
+ <div v-if="answerSuccess"> {{ scoreText }}得分:{{ questionScore }}分 </div>
9
9
  </div>
10
10
  <div class="correct-answer" v-if="correctAnswer">
11
11
  <p>正确答案:</p>
@@ -37,8 +37,17 @@ export default {
37
37
  return this.answerSuccess ? "xitongtubiaodui" : "xitongtubiaocuo";
38
38
  },
39
39
  answerResText() {
40
+ if ("questionPartScore" in this.item) {
41
+ return "部分正确";
42
+ }
40
43
  return this.answerSuccess ? "回答正确" : "回答错误";
41
44
  },
45
+ scoreText() {
46
+ if ("questionPartScore" in this.item) {
47
+ return "部分";
48
+ }
49
+ return "本题";
50
+ },
42
51
  correctAnswer() {
43
52
  let { correctAnswer } = this.item?.scoreConfigs || {};
44
53
  return correctAnswer;
@@ -10,30 +10,42 @@
10
10
  <a-radio
11
11
  v-for="(o, i) in curOptions"
12
12
  class="choice-radio"
13
- :value="o.value"
14
- :key="o.value + i"
13
+ :value="o[choiceUseKey]"
14
+ :key="o.key + i"
15
15
  :class="{ 'block-radio': !item.setting.isHorizontal }"
16
16
  :disabled="isLock"
17
17
  :style="{ color: choiceColor(o) }"
18
18
  >
19
- <!-- <text-over-tooltip
20
- :refName="'chooseValue' + curIndex + i"
21
- class="choose-value"
22
- :content="o.label"
23
- :textColor="choiceColor(o)"
24
- ></text-over-tooltip> -->
25
- <!-- <a-tooltip :title="o.label">
26
- {{ o.label }}
27
- </a-tooltip> -->
28
- {{ o.label }}
29
-
30
- <a-input
31
- v-model="othersText"
32
- :disabled="isLock"
33
- v-if="o.importability"
34
- @change="inputChange"
35
- :style="{ color: choiceColor(o) }"
36
- />
19
+ <template v-if="showImgWrap(o)">
20
+ <span class="scale-choice-img-wrap">
21
+ <img class="show-picture" :src="o.imageUrl" />
22
+ <div class="scale-preview-wrap">
23
+ <a-icon type="zoom-in" @click.stop.prevent="handlePreview(o.imageUrl, i)" />
24
+ </div>
25
+ </span>
26
+ </template>
27
+ <template>
28
+ <template v-if="isRadioItem && showPreSuffix(o)">
29
+ <span v-if="o.prefix" class="prefix-span" :style="{ color: choiceColor(o) }">{{ o.prefix }}</span>
30
+ <a-input
31
+ v-model="optionsPreSuffixObj[o.key]"
32
+ :disabled="isLock || inputLock"
33
+ @change="inputPreSuffixChange(o, i)"
34
+ :style="{ color: choiceColor(o) }"
35
+ placeholder="请输入"
36
+ />
37
+ <span v-if="o.suffix" class="suffix-span" :style="{ color: choiceColor(o) }">{{ o.suffix }}</span>
38
+ </template>
39
+ <span v-else :style="{ color: choiceColor(o) }">{{ o.label }}</span>
40
+ <a-input
41
+ v-if="o.importability"
42
+ v-model="othersText"
43
+ :disabled="isLock || inputLock"
44
+ :style="{ color: choiceColor(o) }"
45
+ placeholder="请输入"
46
+ @change="inputChange"
47
+ />
48
+ </template>
37
49
  </a-radio>
38
50
  </a-radio-group>
39
51
  <a-checkbox-group
@@ -45,29 +57,45 @@
45
57
  >
46
58
  <a-checkbox
47
59
  class="choice-checkbox"
48
- v-for="(o) in curOptions"
49
- :key="o.value"
50
- :value="o.value"
60
+ v-for="(o, i) in curOptions"
61
+ :key="o.key + i"
62
+ :value="o[choiceUseKey]"
51
63
  :class="{ 'block-checkbox': !item.setting.isHorizontal }"
52
64
  :disabled="isLock"
65
+ :style="{ color: choiceColor(o) }"
53
66
  >
54
- <!-- <a-tooltip :title="o.label">
55
- {{ o.label }}
56
- </a-tooltip> -->
57
- <span style="white-space: initial;">
58
- {{ o.label }}
59
- </span>
60
- <!-- <text-over-tooltip
61
- :refName="'chooseValue' + curIndex + i"
62
- class="choose-value"
63
- :content="o.label"
64
- ></text-over-tooltip> -->
65
- <a-input
66
- v-model="othersText"
67
- :disabled="isLock"
68
- v-if="o.importability"
69
- @change="inputCheckboxChange"
70
- />
67
+ <template v-if="showImgWrap(o)">
68
+ <span class="scale-choice-img-wrap">
69
+ <img class="show-picture" :src="o.imageUrl" />
70
+ <div class="scale-preview-wrap">
71
+ <a-icon type="zoom-in" @click.stop.prevent="handlePreview(o.imageUrl, i)" />
72
+ </div>
73
+ </span>
74
+ </template>
75
+ <template>
76
+ <template v-if="isCheckboxItem && showPreSuffix(o)">
77
+ <span v-if="o.prefix" class="prefix-span" :style="{ color: choiceColor(o) }">{{ o.prefix }}</span>
78
+ <a-input
79
+ v-model="optionsPreSuffixObj[o.key]"
80
+ :disabled="isLock || inputLock"
81
+ @change="inputPreSuffixCheckboxChange(o, i)"
82
+ :style="{ color: choiceColor(o) }"
83
+ placeholder="请输入"
84
+ />
85
+ <span v-if="o.suffix" class="suffix-span" :style="{ color: choiceColor(o) }">{{ o.suffix }}</span>
86
+ </template>
87
+ <span v-else style="white-space: initial;" :style="{ color: choiceColor(o) }">
88
+ {{ o.label }}
89
+ </span>
90
+ <a-input
91
+ v-if="o.importability"
92
+ v-model="othersText"
93
+ :disabled="isLock || inputLock"
94
+ :style="{ color: choiceColor(o) }"
95
+ @change="inputCheckboxChange"
96
+ placeholder="请输入"
97
+ />
98
+ </template>
71
99
  </a-checkbox>
72
100
  </a-checkbox-group>
73
101
  <a-select
@@ -97,6 +125,19 @@
97
125
  :disabled="isLock"
98
126
  change-on-select
99
127
  />
128
+
129
+ <!-- 图片预览 -->
130
+ <viewer
131
+ class="viewer"
132
+ ref="viewer"
133
+ :images="previewImages"
134
+ @inited="inited"
135
+ style="display: none"
136
+ >
137
+ <template slot-scope="scope">
138
+ <img v-for="src in scope.images" :src="src" :key="src" />
139
+ </template>
140
+ </viewer>
100
141
  </div>
101
142
  </template>
102
143
 
@@ -112,12 +153,15 @@ import { judgeTypes } from "../mixin/judgeTypes";
112
153
  // import TextOverTooltip from "./text-over-tooltip/TextOverTooltip.vue";
113
154
  import utils from "@/utils/utils-map";
114
155
  import axios from 'axios';
156
+ import 'viewerjs/dist/viewer.css';
157
+ import { component as Viewer } from "v-viewer";
115
158
  export default {
116
159
  mixins: [judgeTypes],
117
160
  props: {
118
161
  value: { default: undefined, type: [String, Array, Number] },
119
162
  item: { type: Object, default: () => {} },
120
163
  isLock: { type: Boolean, default: false },
164
+ inputLock: { type: Boolean, default: false },
121
165
  curIndex: Number,
122
166
  getSelectOptions: {
123
167
  type: Function,
@@ -134,7 +178,7 @@ export default {
134
178
  openType: { type: String, default: "" }
135
179
  },
136
180
  components: {
137
- // TextOverTooltip,
181
+ Viewer,
138
182
  [Input.name]: Input,
139
183
  [Cascader.name]: Cascader,
140
184
  [Checkbox.name]: Checkbox,
@@ -153,10 +197,30 @@ export default {
153
197
  this.$emit("input", val);
154
198
  }
155
199
  },
200
+ choiceUseKey() {
201
+ if (this.item.type === "RADIO_BLOCK" || this.item.type === "CHECKBOX_BLOCK") return "key";
202
+ return "value";
203
+ },
156
204
  choiceColor() {
157
205
  return function(p) {
158
- if (this.item.type != "RADIO_BLOCK") return "rgba(0, 0, 0, 0.65)";
159
- return p.color || "rgba(0, 0, 0, 0.65)";
206
+ let color = p.color || "rgba(0, 0, 0, 0.65)";
207
+ return `${color} !important`;
208
+ };
209
+ },
210
+ showImgWrap() {
211
+ return function(o) {
212
+ return !o.prefix && !o.suffix && o.imageUrl;
213
+ };
214
+ },
215
+ isRadioItem() {
216
+ return this.item.type === "RADIO_BLOCK";
217
+ },
218
+ isCheckboxItem() {
219
+ return this.item.type === "CHECKBOX_BLOCK";
220
+ },
221
+ showPreSuffix() {
222
+ return function(o) {
223
+ return o.prefix || o.suffix;
160
224
  };
161
225
  }
162
226
  },
@@ -171,7 +235,7 @@ export default {
171
235
  options = value.scoreConfigs?.scoreRules || [];
172
236
  }
173
237
  if (value.type === "RADIO_BLOCK" || value.type === "EVALUATE_RADIO_BLOCK") {
174
- const defVal = value.dbValue || value.setting.defaultValue;
238
+ const defVal = value.dbValue || value.setting.defaultValue || this.value;
175
239
  this.handleRadioDef(value, defVal, options);
176
240
  return;
177
241
  }
@@ -179,6 +243,8 @@ export default {
179
243
  let defVal = [];
180
244
  if (utils.isJSON(value.setting.defaultValue)) {
181
245
  defVal = JSON.parse(value.setting.defaultValue);
246
+ } else {
247
+ defVal = this.value;
182
248
  }
183
249
  this.handleCheckboxDef(value, value.dbValue || defVal, options);
184
250
  return;
@@ -213,61 +279,171 @@ export default {
213
279
  fieldList: [],
214
280
  buttonList: [],
215
281
  source: "guageChoice",
216
- fetching: false
282
+ fetching: false,
283
+ previewImages: [],
284
+ optionsPreSuffixObj: {}
217
285
  };
218
286
  },
219
287
  methods: {
220
288
  handleRadioDef(item, curValue, options) {
221
- this.curOptions = options.filter(v => v.label);
289
+ this.curOptions = this.handleOptions(options, item.type);
222
290
  if (!options.length || !curValue) return;
223
- this.curvalue = curValue;
291
+ // 测评单选回显
292
+ if (item.type === "EVALUATE_RADIO_BLOCK") {
293
+ this.curvalue = curValue;
294
+ this.radioChange();
295
+ return;
296
+ }
297
+ // 普通单选回显 普通选项/其它/前后缀 所以用key标识
224
298
  let hasOther = options.find(v => v.value === curValue);
225
- if (!hasOther) {
299
+ if (hasOther) {
300
+ this.curvalue = hasOther.key;
301
+ this.radioChange();
302
+ return;
303
+ }
304
+ let preSuffixItem = options.find((v, i) => {
305
+ let res = this.handleDefPreSuffix(v, i, curValue);
306
+ if (res) {
307
+ this.curvalue = res;
308
+ }
309
+ return !!res || false;
310
+ });
311
+ if (!preSuffixItem) {
226
312
  this.othersText = curValue;
227
- this.curvalue = "其他";
313
+ this.curvalue = "other";
314
+ }
315
+ this.radioChange();
316
+ },
317
+ handleDefPreSuffix(v, i, curValue, isCheckbox, hasOther) {
318
+ if (v.prefix || v.suffix) {
319
+ let value = v.value;
320
+ // 有前后缀的option input为必填, 如果直接相等则为other
321
+ if (value === curValue) return false;
322
+ if (v.prefix) {
323
+ if (curValue.indexOf(v.prefix) === 0) {
324
+ let inputValue = curValue.substring(v.prefix.length);
325
+ this.$set(this.optionsPreSuffixObj, v.key, inputValue);
326
+ return v.key;
327
+ }
328
+ }
329
+ if (v.suffix) {
330
+ let lastIndexOf = curValue.lastIndexOf(v.suffix);
331
+ lastIndexOf + v.suffix.length;
332
+ if (curValue.length === lastIndexOf + v.suffix.length) {
333
+ let index = curValue.lastIndexOf(v.suffix);
334
+ let inputValue = curValue.substring(0, index);
335
+ this.$set(this.optionsPreSuffixObj, v.key, inputValue);
336
+ return v.key;
337
+ }
338
+ }
339
+ }
340
+ if (curValue === v.value) return v.key;
341
+ if (isCheckbox && hasOther) {
342
+ this.othersText = curValue;
343
+ return "other";
228
344
  }
229
345
  },
230
346
  async handleCheckboxDef(item, curValue, options) {
231
- this.curOptions = options.filter(v => v.label);
347
+ this.curOptions = this.handleOptions(options, item.type);
232
348
  if (!options.length || !curValue || !curValue.length) return;
233
- this.curCheckboxValue = curValue;
234
- let op = options.map(v => v.value);
235
- let minus = curValue.filter(x => op.indexOf(x) == -1) || [];
236
- if (minus.length) {
237
- let tempValue = minus[0];
238
- let valueIndex = curValue.findIndex(v => v === tempValue);
239
- this.othersText = tempValue;
240
- this.curCheckboxValue[valueIndex] = "其他";
349
+ // 测评多选回显
350
+ if (item.type === "EVALUATE_CHECKBOX_BLOCK") {
351
+ this.curCheckboxValue = curValue;
352
+ this.handleCheckboxOther();
353
+ return;
354
+ }
355
+ // 普通多选回显 普通选项/其它/前后缀 所以用key标识
356
+ let resArr = [],
357
+ i = 0,
358
+ x,
359
+ len = curValue.length;
360
+ let hasOther = options.some(v => v.importability || v.key === "other");
361
+ for (; i < len; i++) {
362
+ x = curValue[i];
363
+ if (x === "其他") {
364
+ this.othersText = x;
365
+ this.curvalue = "other";
366
+ !resArr.includes("other") && resArr.push("other");
367
+ continue;
368
+ }
369
+ let matchIndex = options.findIndex(v => v.value === x);
370
+ if (matchIndex > 0) {
371
+ let res = options[matchIndex]?.key;
372
+ !resArr.includes(res) && resArr.push(res);
373
+ continue;
374
+ }
375
+ options.map(v => {
376
+ let res = this.handleDefPreSuffix(v, i, x, true, hasOther);
377
+ res && !resArr.includes(res) && resArr.push(res);
378
+ });
241
379
  }
380
+ this.curCheckboxValue = resArr;
381
+ this.handleCheckboxOther();
382
+ },
383
+ handleOptions(options, type) {
384
+ return (
385
+ options
386
+ .map((v, i) => {
387
+ if (v.prefix || v.suffix) {
388
+ this.$set(this.optionsPreSuffixObj, v.key, undefined);
389
+ return v;
390
+ }
391
+ if (v.label) return v;
392
+ return null;
393
+ })
394
+ .filter(Boolean) || []
395
+ );
242
396
  },
243
397
  radioChange() {
244
- if (this.curvalue === "其他") {
245
- this.$emit("radioChange", this.othersText || this.curvalue, this.item);
246
- } else {
247
- this.$emit("radioChange", this.curvalue, this.item);
248
- }
398
+ let choiceObj = {
399
+ othersText: this.othersText,
400
+ optionsPreSuffixObj: this.optionsPreSuffixObj
401
+ };
402
+ this.$emit("radioChange", this.curvalue, this.item, choiceObj);
249
403
  },
250
404
  checkboxChange() {
251
- this.handleCheckboxOther(true);
405
+ this.handleCheckboxOther();
252
406
  },
253
407
  inputChange() {
254
- if (this.curvalue === "其他") {
255
- this.$emit("radioChange", this.othersText || "其他", this.item);
408
+ let choiceObj = {
409
+ othersText: this.othersText,
410
+ optionsPreSuffixObj: this.optionsPreSuffixObj
411
+ };
412
+ this.curvalue = "other";
413
+ this.$emit("radioChange", "other", this.item, choiceObj);
414
+ },
415
+ inputPreSuffixChange(o, i) {
416
+ this.curvalue = o.key;
417
+ let choiceObj = {
418
+ othersText: this.othersText,
419
+ optionsPreSuffixObj: this.optionsPreSuffixObj
420
+ };
421
+ this.$emit("radioChange", this.curvalue, this.item, choiceObj);
422
+ },
423
+ inputPreSuffixCheckboxChange(o, i) {
424
+ let choiceObj = {
425
+ othersText: this.othersText,
426
+ optionsPreSuffixObj: this.optionsPreSuffixObj
427
+ };
428
+ if (!this.curCheckboxValue.includes(o.key)) {
429
+ this.curCheckboxValue.push(o.key);
256
430
  }
431
+ let curCheckboxValue = JSON.parse(JSON.stringify(this.curCheckboxValue));
432
+ this.$emit("checkboxChange", curCheckboxValue, this.item, choiceObj);
257
433
  },
258
434
  inputCheckboxChange() {
259
- this.handleCheckboxOther();
435
+ this.handleCheckboxOther(true);
260
436
  },
261
- handleCheckboxOther(isContinue = false) {
262
- let hasOther = this.curCheckboxValue?.some(v => v === "其他") || false;
263
- if (hasOther) {
264
- let otherIndex = this.curCheckboxValue.findIndex(v => v === "其他");
265
- let temp = JSON.parse(JSON.stringify(this.curCheckboxValue));
266
- temp[otherIndex] = this.othersText || "其他";
267
- this.$emit("checkboxChange", temp, this.item);
268
- } else {
269
- isContinue && this.$emit("checkboxChange", this.curCheckboxValue, this.item);
437
+ handleCheckboxOther(isOtherInput) {
438
+ let choiceObj = {
439
+ othersText: this.othersText,
440
+ optionsPreSuffixObj: this.optionsPreSuffixObj
441
+ };
442
+ if (isOtherInput && !this.curCheckboxValue.includes("other")) {
443
+ this.curCheckboxValue.push("other");
270
444
  }
445
+ let curCheckboxValue = JSON.parse(JSON.stringify(this.curCheckboxValue));
446
+ this.$emit("checkboxChange", curCheckboxValue, this.item, choiceObj);
271
447
  },
272
448
  async initSelectOptions() {
273
449
  // 分享链接的量表用 optionType 1:静态,2:动态,3:动态转静态
@@ -435,6 +611,16 @@ export default {
435
611
  return document.body;
436
612
  }
437
613
  return triggerNode.parentNode;
614
+ },
615
+ inited(viewer) {
616
+ this.$viewer = viewer;
617
+ },
618
+ handlePreview(url, i) {
619
+ let imgs = this.curOptions.map(v => v.imageUrl);
620
+ if (!imgs.length) return;
621
+ this.previewImages = imgs;
622
+ this.$viewer.index = i;
623
+ this.$viewer.show();
438
624
  }
439
625
  }
440
626
  };
@@ -448,26 +634,29 @@ export default {
448
634
  /deep/ .choice-radio,
449
635
  /deep/ .choice-checkbox {
450
636
  display: inline-flex;
451
- align-items: flex-start;
637
+ align-items: center;
452
638
  margin-bottom: 5px;
453
639
  margin-right: 8px;
454
640
  margin-left: 0px;
455
- span {
456
- text-overflow: ellipsis;
457
- white-space: nowrap;
458
- overflow: hidden;
459
- vertical-align: middle;
460
- }
461
- span:last-child {
641
+ > span:last-child {
462
642
  flex: 1;
463
643
  display: inline-flex;
464
644
  align-items: center;
465
645
  word-break: break-all;
466
- input {
467
- margin-left: 4px;
468
- width: 300px;
469
- max-width: calc(100% - 40px);
470
- }
646
+ }
647
+ input {
648
+ height: 100%;
649
+ flex: 1;
650
+ background: transparent;
651
+ border-radius: 0;
652
+ border-color: transparent !important;
653
+ border-bottom: 1px solid #d9d9d9 !important;
654
+ }
655
+ .prefix-span {
656
+ padding-right: 8px;
657
+ }
658
+ .suffix-span {
659
+ padding-left: 8px;
471
660
  }
472
661
  }
473
662
 
@@ -489,12 +678,49 @@ export default {
489
678
  .choice-wrap {
490
679
  display: flex;
491
680
  flex-wrap: wrap;
681
+ .scale-choice-img-wrap {
682
+ position: relative;
683
+ width: 74px;
684
+ min-width: 74px;
685
+ height: 62px;
686
+ background: #ffffff;
687
+ border-radius: 4px;
688
+ border: 1px solid #d5d5d5;
689
+ margin-right: 16px;
690
+ &:hover {
691
+ .scale-preview-wrap {
692
+ display: flex;
693
+ }
694
+ }
695
+ > img {
696
+ width: 100%;
697
+ height: 100%;
698
+ object-fit: cover;
699
+ }
700
+ .scale-preview-wrap {
701
+ position: absolute;
702
+ top: 0;
703
+ left: 0;
704
+ right: 0;
705
+ bottom: 0;
706
+ display: none;
707
+ justify-content: center;
708
+ align-items: center;
709
+ background: rgba(0, 0, 0, 0.75);
710
+ border-radius: 8px;
711
+ font-size: 20px;
712
+ i.anticon {
713
+ color: #fff;
714
+ margin: 0px;
715
+ }
716
+ }
717
+ }
492
718
  /deep/ .choose-value .el-tooltip.ellipsis {
493
719
  color: rgba(0, 0, 0, 0.65);
494
720
  font-size: 14px;
495
721
  }
496
722
  label {
497
- margin: 0;
723
+ margin: 4px 0;
498
724
  }
499
725
  /deep/.ant-radio-wrapper span.ant-radio + * {
500
726
  display: inline-flex;
@@ -503,6 +729,9 @@ export default {
503
729
  }
504
730
  &.choice-wrap-1 label {
505
731
  width: 100%;
732
+ /deep/ input {
733
+ max-width: 300px;
734
+ }
506
735
  }
507
736
  &.choice-wrap-2 label {
508
737
  width: 50%;
@@ -521,14 +750,5 @@ export default {
521
750
  vertical-align: top;
522
751
  }
523
752
  }
524
- /deep/.choice-radio span,
525
- /deep/.choice-checkbox span {
526
- &:last-child {
527
- display: inline-block;
528
- text-overflow: ellipsis;
529
- word-break: break-all;
530
- max-width: 100%;
531
- }
532
- }
533
753
  }
534
754
  </style>
@@ -1,17 +1,5 @@
1
1
  <template>
2
2
  <div class="my-input">
3
- <!-- <a-input
4
- :type="type"
5
- :disabled="isLock"
6
- placeholder="请输入"
7
- v-if="eleType == 'INPUT'"
8
- v-model="inputValue"
9
- @keydown="keydown"
10
- :rows="row"
11
- style="resize: none;"
12
- autocomplete="off"
13
- /> -->
14
- <!-- inputmode="numeric" -->
15
3
  <a-textarea
16
4
  :disabled="isLock"
17
5
  :placeholder="defaultPlaceHolder"
@@ -19,7 +7,7 @@
19
7
  v-model="inputValue"
20
8
  @input="changeTextarea"
21
9
  @keydown="keydown"
22
- :rows="row"
10
+ :autoSize="setTextareaRow"
23
11
  style="resize: none;"
24
12
  autocomplete="off"
25
13
  />
@@ -50,7 +38,7 @@ export default {
50
38
  type: { default: "" },
51
39
  eleType: { default: "INPUT", type: String },
52
40
  isLock: { type: Boolean, default: false },
53
- row: { type: Number, default: 1 },
41
+ row: { type: [Number, String], default: 1 },
54
42
  defaultPlaceHolder: String
55
43
  },
56
44
  computed: {
@@ -61,6 +49,14 @@ export default {
61
49
  set(val) {
62
50
  this.$emit("input", val);
63
51
  }
52
+ },
53
+ setTextareaRow() {
54
+ if (!this.row || this.row == "auto") {
55
+ return {
56
+ minRows: 1
57
+ };
58
+ }
59
+ return { minRows: this.row || 1, maxRows: this.row || 1 };
64
60
  }
65
61
  },
66
62
  methods: {
@@ -1,5 +1,4 @@
1
1
  /** 无数据 */
2
-
3
2
  export default {
4
3
  data() {
5
4
  return {
@@ -13,12 +12,27 @@ export default {
13
12
  setNoData(noData, noDataTip = "1.1.6.11", noDataImg = "nodata") {
14
13
  this.noData = noData;
15
14
  this.noDataTip = noDataTip || "1.1.6.11";
16
- this.noDataImg = this.$utils.errResult(noDataImg) || "nodata";
15
+ this.noDataImg = this.errResult(noDataImg) || "nodata";
17
16
  },
18
17
  resetNodata() {
19
18
  this.noData = false;
20
19
  this.noDataTip = "1.1.6.11";
21
20
  this.noDataImg = "nodata";
21
+ },
22
+ errResult(result) {
23
+ let res = "nodata";
24
+ switch (result) {
25
+ case "10000":
26
+ res = "no-permission";
27
+ break;
28
+ case "Failure":
29
+ res = "failure";
30
+ break;
31
+ default:
32
+ res = "nodata";
33
+ break;
34
+ }
35
+ return res;
22
36
  }
23
37
  }
24
38
  };