cnhis-design-vue 2.1.43 → 2.1.45

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 (39) hide show
  1. package/CHANGELOG.md +22 -7
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +149 -89
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +2 -2
  6. package/es/captcha/index.js +3 -3
  7. package/es/checkbox/index.js +1 -1
  8. package/es/color-picker/index.js +1 -1
  9. package/es/drag-layout/index.js +3 -3
  10. package/es/editor/index.js +1 -1
  11. package/es/fabric-chart/index.js +49 -35
  12. package/es/form-table/index.js +17 -17
  13. package/es/index/index.js +338 -259
  14. package/es/index/style.css +1 -1
  15. package/es/input/index.js +1 -1
  16. package/es/map/index.js +1 -1
  17. package/es/multi-chat/index.js +24 -24
  18. package/es/multi-chat-client/index.js +18 -18
  19. package/es/multi-chat-history/index.js +4 -4
  20. package/es/multi-chat-record/index.js +4 -4
  21. package/es/multi-chat-setting/index.js +20 -20
  22. package/es/multi-chat-sip/index.js +1 -1
  23. package/es/radio/index.js +1 -1
  24. package/es/scale-view/index.js +24 -24
  25. package/es/select/index.js +4 -4
  26. package/es/select-label/index.js +3 -3
  27. package/es/select-person/index.js +2 -2
  28. package/es/shortcut-setter/index.js +28 -9
  29. package/es/table-filter/index.js +21 -21
  30. package/es/tag/index.js +1 -1
  31. package/es/verification-code/index.js +2 -2
  32. package/lib/cui.common.js +359 -286
  33. package/lib/cui.umd.js +359 -286
  34. package/lib/cui.umd.min.js +9 -9
  35. package/package.json +1 -1
  36. package/packages/big-table/src/BigTable.vue +5 -5
  37. package/packages/big-table/src/utils/tableParse.js +41 -0
  38. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +23 -16
  39. package/packages/shortcut-setter/src/utils/index.js +5 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.43",
3
+ "version": "2.1.45",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -144,7 +144,7 @@ import TextOverTooltip from './components/TextOverTooltip.vue';
144
144
  import AutoLayoutButton from './components/AutoLayoutButton.vue';
145
145
  import { Icon, Tooltip, Progress, Switch, Popover, Button, Dropdown, Menu, Checkbox, Input, Popconfirm } from 'ant-design-vue';
146
146
  import format from './utils/format';
147
- import { parseDurationValue, parseCombinationValue, formatFieldText, imgs2imgArr } from './utils/tableParse';
147
+ import { parseDurationValue, parseCombinationValue, formatFieldText, imgs2imgArr, parseNumberField } from './utils/tableParse';
148
148
  import passwordCom from './components/password-com.vue';
149
149
  import NoData from './components/NoData.vue';
150
150
  import VideoList from './components/player-vod/video-list';
@@ -2001,8 +2001,8 @@ export default create({
2001
2001
  // 用rowIndex替换$rowIndex, 如果开启了虚拟滚动$rowIndex 下标会有问题
2002
2002
  let { row, column, rowIndex } = params;
2003
2003
  let own = column?._own || column?.own || col;
2004
- let attrType = own?.attrType || '';
2005
- let fieldType = own?.fieldType || '';
2004
+
2005
+ let {attrType, fieldType, extraField} = own || {};
2006
2006
  // 批量行编辑
2007
2007
  let formUnionItem = this.showEditForm(row, column, rowIndex);
2008
2008
  if (formUnionItem) {
@@ -2074,8 +2074,8 @@ export default create({
2074
2074
  return this.getOrCode(row, own, attrType);
2075
2075
  }
2076
2076
  let value = row[own.columnName];
2077
- if (attrType === 'MONEY' && fieldType == 'NUMBER' && vexutils.isNumber(value)) {
2078
- return value.toFixed(2);
2077
+ if (["MONEY", "NUMBER"].includes(attrType) || extraField && fieldType === "NUMBER") {
2078
+ return parseNumberField(value, own);
2079
2079
  }
2080
2080
 
2081
2081
  if (column.property === 'operatorColumn') {
@@ -191,3 +191,44 @@ export function imgs2imgArr(imgs) {
191
191
  })
192
192
  .split('|');
193
193
  }
194
+
195
+ const getLen = value => {
196
+ const len = value.toString().split('.')?.[1]?.length || 0;
197
+ return len;
198
+ };
199
+
200
+ const myToFixed = (num, decimals) => {
201
+ if (!num) return num;
202
+ if (typeof num !== 'number') return num;
203
+ return num.toLocaleString('en-US', {
204
+ minimumFractionDigits: decimals,
205
+ maximumFractionDigits: decimals
206
+ });
207
+ };
208
+
209
+ export function parseNumberField(val, own) {
210
+ let attrType = own?.attrType || '';
211
+ let fieldType = own?.fieldType || '';
212
+ let { numShowType, numScale } = own.settingObj || {};
213
+ if (!numShowType || (!numScale && numScale !== 0)) {
214
+ return val;
215
+ }
216
+ let rVal = val;
217
+ if (vexutils.isPlainObject(val)) {
218
+ rVal = val.value;
219
+ }
220
+ if (!rVal) return rVal;
221
+ if (isNaN(+rVal)) return rVal;
222
+ rVal = +rVal;
223
+ numScale = +numScale;
224
+ numScale = numScale > 6 ? 6 : numScale < 0 ? 0 : numScale;
225
+ if (numShowType === 'fixed') {
226
+ return myToFixed(rVal, numScale);
227
+ }
228
+ let len = getLen(rVal);
229
+ if (numShowType === 'must') {
230
+ rVal = parseFloat(rVal);
231
+ }
232
+ if (len <= numScale) return rVal;
233
+ return myToFixed(rVal, numScale);
234
+ }
@@ -203,23 +203,14 @@ export default {
203
203
 
204
204
  const minTime = Math.min(...xScaleList);
205
205
  const maxTime = Math.max(...xScaleList);
206
+
206
207
  this.polyline.forEach((item, index) => {
207
208
  item.dataList.forEach((v, i) => {
209
+ const point = v.list.find(k => isEffectiveNode(k) && new Date(k.time).getTime() >= minTime && new Date(k.time).getTime() <= maxTime);
210
+ const firstPointLeft = point ? this.cumputedX(point.time) : 0;
211
+ const rightLimit = point ? firstPointLeft - this.spaceWidth : '';
208
212
  // 配置是否可拖动标题图标批量增加-
209
- const isAdd = v.list.length
210
- ? !v.list.some(k => {
211
- return isEffectiveNode(k) && new Date(k.time).getTime() >= minTime && new Date(k.time).getTime() < xScaleCellList[1].time;
212
- })
213
- : true;
214
- let rightLimit = endX;
215
- const point = v.list.find(k => isEffectiveNode(k) && new Date(k.time).getTime() >= xScaleCellList[1].time && new Date(k.time).getTime() <= maxTime);
216
- const limitObj =
217
- point &&
218
- JSON.parse(JSON.stringify(xScaleCellList))
219
- .reverse()
220
- .find(k => new Date(point.time).getTime() > k.time);
221
- limitObj && (rightLimit = limitObj.x);
222
- point && !limitObj && new Date(point.time).getTime() === maxTime && (rightLimit = xScaleCellList[xScaleCellList.length - 1].x);
213
+ const isAdd = (firstPointLeft || endX) - this.spaceWidth >= originX;
223
214
  leftTitleList.push({
224
215
  title: v.title,
225
216
  type: v.type,
@@ -326,6 +317,7 @@ export default {
326
317
  });
327
318
  // 标题折线点停止拖拽后 更新
328
319
  icon.on('moved', () => {
320
+ this.setLeft(icon);
329
321
  icon.set({
330
322
  id: icon.id.replace('_isTitle', '')
331
323
  });
@@ -362,11 +354,26 @@ export default {
362
354
  // this.canvas.requestRenderAll();
363
355
  });
364
356
  },
357
+ // 限制节点新增位置与右侧节点间隔的spaceWidth格子树必须为整数
358
+ setLeft(icon) {
359
+ const { originX } = this.propItems;
360
+ let tempLeft = icon.rightLimit;
361
+
362
+ if (!tempLeft) return;
363
+ const leftLimit = icon.left + this.spaceWidth;
364
+ let i = 0;
365
+ while (tempLeft >= leftLimit) {
366
+ tempLeft = icon.rightLimit - i * this.spaceWidth;
367
+ i++;
368
+ }
369
+ icon.left = tempLeft < originX ? originX : tempLeft;
370
+ },
365
371
  // 点移动限制
366
372
  moveLimit(point) {
367
373
  point.setCoords();
368
- const leftLimit = this.propItems.treeTableminCellWidth;
369
- const rightLimit = point.rightLimit;
374
+ const { treeTableminCellWidth, endX } = this.propItems;
375
+ const leftLimit = treeTableminCellWidth;
376
+ const rightLimit = point.rightLimit || endX;
370
377
  if (point.top < this.propItems.originY) {
371
378
  point.set('top', this.propItems.originY);
372
379
  }
@@ -1,12 +1,10 @@
1
1
  import { isString } from 'xe-utils';
2
2
 
3
3
  export function isKeyboardEvent(event) {
4
- return Reflect.get(event, 'view') === window && Reflect.get(event, 'shiftKey') != undefined;
4
+ return Reflect.get(event, 'view') === window && Reflect.get(event, 'shiftKey') !== undefined;
5
5
  }
6
6
 
7
- export function normalizeSignatureInfo(
8
- info
9
- ) {
7
+ export function normalizeSignatureInfo(info) {
10
8
  let ctrl, shift, alt;
11
9
  const key = info.key?.toUpperCase() ?? '';
12
10
 
@@ -31,13 +29,13 @@ export function inKeyBlackList(key) {
31
29
  }
32
30
 
33
31
  export function isInvalidSignature(info) {
34
- const { ctrl, shift, alt, key } = normalizeSignatureInfo(info);
35
- if (!ctrl && !shift && !alt) return !/F\d/.test(key);
32
+ const { /* ctrl, shift, alt,*/ key } = normalizeSignatureInfo(info);
33
+ // if (!ctrl && !shift && !alt) return !/F\d/.test(key);
36
34
  return inKeyBlackList(key);
37
35
  }
38
36
 
39
37
  export function getDisplaySignature(info) {
40
38
  const { ctrl, shift, alt, key } = normalizeSignatureInfo(info);
41
39
 
42
- return `${ctrl ? 'Ctrl+ ' : ''}${alt ? 'Alt + ' : ''}${shift ? 'Shift + ' : ''}${inKeyBlackList(key) ? '' : key}`;
40
+ return `${ctrl ? 'Ctrl + ' : ''}${alt ? 'Alt + ' : ''}${shift ? 'Shift + ' : ''}${inKeyBlackList(key) ? '' : key.replace(' ', 'SPACE')}`;
43
41
  }