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.
- package/CHANGELOG.md +22 -7
- package/es/age/index.js +2 -2
- package/es/big-table/index.js +149 -89
- package/es/big-table/style.css +1 -1
- package/es/button/index.js +2 -2
- package/es/captcha/index.js +3 -3
- package/es/checkbox/index.js +1 -1
- package/es/color-picker/index.js +1 -1
- package/es/drag-layout/index.js +3 -3
- package/es/editor/index.js +1 -1
- package/es/fabric-chart/index.js +49 -35
- package/es/form-table/index.js +17 -17
- package/es/index/index.js +338 -259
- package/es/index/style.css +1 -1
- package/es/input/index.js +1 -1
- package/es/map/index.js +1 -1
- package/es/multi-chat/index.js +24 -24
- package/es/multi-chat-client/index.js +18 -18
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +4 -4
- package/es/multi-chat-setting/index.js +20 -20
- package/es/multi-chat-sip/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/scale-view/index.js +24 -24
- package/es/select/index.js +4 -4
- package/es/select-label/index.js +3 -3
- package/es/select-person/index.js +2 -2
- package/es/shortcut-setter/index.js +28 -9
- package/es/table-filter/index.js +21 -21
- package/es/tag/index.js +1 -1
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +359 -286
- package/lib/cui.umd.js +359 -286
- package/lib/cui.umd.min.js +9 -9
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +5 -5
- package/packages/big-table/src/utils/tableParse.js +41 -0
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +23 -16
- package/packages/shortcut-setter/src/utils/index.js +5 -7
package/package.json
CHANGED
|
@@ -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
|
-
|
|
2005
|
-
let fieldType = own
|
|
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
|
|
2078
|
-
return value
|
|
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 =
|
|
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
|
|
369
|
-
const
|
|
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')
|
|
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
|
|
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
|
}
|