cnhis-design-vue 2.1.150 → 2.1.151
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 +63 -55
- package/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +71 -71
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +33 -33
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/card-reader-sdk/index.js +1 -1
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/direct/index.js +16 -16
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +9 -9
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +74 -74
- package/es/full-calendar/index.js +4 -4
- package/es/index/index.js +708 -553
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +76 -76
- package/es/multi-chat-client/index.js +70 -70
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-container/index.js +9 -9
- package/es/scale-view/index.js +299 -144
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +12 -12
- package/es/select-label/index.js +11 -11
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +10 -10
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/slider-tree/index.js +9 -9
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +75 -75
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/utils/time-domain.js +15 -0
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +703 -533
- package/lib/cui.umd.js +703 -533
- package/lib/cui.umd.min.js +22 -22
- package/package.json +1 -1
- package/packages/scale-view/directive/drag-move.js +132 -0
- package/packages/scale-view/evaluateCountdown.vue +28 -26
- package/packages/scale-view/evaluatePage.vue +2 -1
- package/packages/scale-view/scaleView.vue +1 -1
- package/src/utils/time-domain.js +21 -0
package/package.json
CHANGED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const findparent = (el, name) => {
|
|
2
|
+
let parent = el.parentElement;
|
|
3
|
+
let pcname = parent.className || '';
|
|
4
|
+
while (parent && !pcname.includes(name)) {
|
|
5
|
+
parent = parent.parentElement;
|
|
6
|
+
if (parent) pcname = parent.className || '';
|
|
7
|
+
}
|
|
8
|
+
return parent;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const initSetDom = (dragDom, pDom) => {
|
|
12
|
+
const screenWidth = pDom?.clientWidth || document.body.clientWidth; // body当前宽度
|
|
13
|
+
|
|
14
|
+
const dragDomWidth = dragDom.offsetWidth; // 对话框宽度
|
|
15
|
+
|
|
16
|
+
const iL = screenWidth - dragDomWidth;
|
|
17
|
+
|
|
18
|
+
dragDom.style.cssText += `position: absolute;left:${iL}px;top:0 px;right:unset;`;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
|
22
|
+
const sty = (function() {
|
|
23
|
+
if (document.body.currentStyle) {
|
|
24
|
+
// 在ie下兼容写法
|
|
25
|
+
return (dom, attr) => dom.currentStyle[attr];
|
|
26
|
+
}
|
|
27
|
+
return (dom, attr) => getComputedStyle(dom, null)[attr];
|
|
28
|
+
})();
|
|
29
|
+
|
|
30
|
+
const maskStyle = 'position: absolute;top: 0;left: 0;right: 0;bottom: 0;z-index: 2999;width: 100%;height: 100%;';
|
|
31
|
+
|
|
32
|
+
const mouseMove = (e, config) => {
|
|
33
|
+
const { dragDom, minDragDomLeft, maxDragDomLeft, disX, disY, minDragDomTop, maxDragDomTop, styL, styT } = config || {};
|
|
34
|
+
// 通过事件委托,计算移动的距离
|
|
35
|
+
let left = e.clientX - disX;
|
|
36
|
+
let top = e.clientY - disY;
|
|
37
|
+
// 边界处理
|
|
38
|
+
if (-left > minDragDomLeft) {
|
|
39
|
+
left = -minDragDomLeft;
|
|
40
|
+
} else if (left > maxDragDomLeft) {
|
|
41
|
+
left = maxDragDomLeft;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (-top > minDragDomTop) {
|
|
45
|
+
top = -minDragDomTop;
|
|
46
|
+
} else if (top > maxDragDomTop) {
|
|
47
|
+
top = maxDragDomTop;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 移动当前元素
|
|
51
|
+
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const mouseUp = () => {
|
|
55
|
+
const iframeFix = document.getElementsByClassName('scale-countdown-iframeFix')[0];
|
|
56
|
+
iframeFix && document.body.removeChild(iframeFix);
|
|
57
|
+
document.onmousemove = null;
|
|
58
|
+
document.onmouseup = null;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const dragMethod = obj => {
|
|
62
|
+
const { el, containerName, targetName, contentName } = obj;
|
|
63
|
+
const pDom = findparent(el, containerName);
|
|
64
|
+
|
|
65
|
+
const dialogHeaderEl = pDom.querySelector(`.${targetName}`);
|
|
66
|
+
const dragDom = pDom.querySelector(`.${contentName}`);
|
|
67
|
+
// 初始化定位
|
|
68
|
+
initSetDom(dragDom, pDom);
|
|
69
|
+
|
|
70
|
+
dialogHeaderEl.style.cssText += ';cursor:move;';
|
|
71
|
+
|
|
72
|
+
dialogHeaderEl.onmousedown = e => {
|
|
73
|
+
const dialogMask = document.createElement('div');
|
|
74
|
+
dialogMask.className = 'scale-countdown-iframeFix';
|
|
75
|
+
dialogMask.setAttribute('style', maskStyle);
|
|
76
|
+
document.body.appendChild(dialogMask);
|
|
77
|
+
|
|
78
|
+
// 鼠标按下,计算当前元素距离可视区的距离
|
|
79
|
+
const disX = e.clientX - dialogHeaderEl.offsetLeft;
|
|
80
|
+
const disY = e.clientY - dialogHeaderEl.offsetTop;
|
|
81
|
+
const screenWidth = pDom?.clientWidth || document.body.clientWidth; // body当前宽度
|
|
82
|
+
const screenHeight = pDom?.clientHeight || document.documentElement.clientHeight; // 可见区域高度(应为body高度,可某些环境下无法获取)
|
|
83
|
+
|
|
84
|
+
const dragDomWidth = dragDom.offsetWidth; // 对话框宽度
|
|
85
|
+
const dragDomheight = dragDom.offsetHeight; // 对话框高度
|
|
86
|
+
|
|
87
|
+
const minDragDomLeft = dragDom.offsetLeft;
|
|
88
|
+
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
|
|
89
|
+
|
|
90
|
+
const minDragDomTop = dragDom.offsetTop;
|
|
91
|
+
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
|
|
92
|
+
|
|
93
|
+
// 获取到的值带px 正则匹配替换
|
|
94
|
+
let styL = sty(dragDom, 'left');
|
|
95
|
+
// 为兼容ie
|
|
96
|
+
if (styL === 'auto') styL = '0px';
|
|
97
|
+
let styT = sty(dragDom, 'top');
|
|
98
|
+
|
|
99
|
+
// console.log(styL)
|
|
100
|
+
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
|
|
101
|
+
if (styL.includes('%')) {
|
|
102
|
+
styL = +screenWidth * (+styL.replace(/%/g, '') / 100);
|
|
103
|
+
styT = +screenHeight * (+styT.replace(/%/g, '') / 100);
|
|
104
|
+
} else {
|
|
105
|
+
styL = +styL.replace(/px/g, '');
|
|
106
|
+
styT = +styT.replace(/px/g, '');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
document.onmousemove = e => mouseMove(e, { dragDom, minDragDomLeft, maxDragDomLeft, disX, disY, minDragDomTop, maxDragDomTop, styL, styT });
|
|
110
|
+
|
|
111
|
+
document.onmouseup = mouseUp;
|
|
112
|
+
return false;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// 拖拽的指令
|
|
117
|
+
export default {
|
|
118
|
+
bind: function(el, binding, vnode) {
|
|
119
|
+
// 自定义属性,判断是否可拖拽
|
|
120
|
+
if (!binding.value) return;
|
|
121
|
+
const { target, container, content, isDrag } = binding.value || {};
|
|
122
|
+
if (!isDrag) return;
|
|
123
|
+
|
|
124
|
+
const containerName = container || 'r-scale-v3'; // 容器dom
|
|
125
|
+
const targetName = target || 'evaluateCountdown-wrap'; // 触发dom
|
|
126
|
+
const contentName = content || 'c-evaluateCountdown-v2'; // 移动dom
|
|
127
|
+
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
dragMethod({ el, containerName, targetName, contentName });
|
|
130
|
+
}, 50);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="
|
|
8
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="evaluateCountdown c-evaluateCountdown-v2"
|
|
4
|
+
v-drag-move="dragSetting"
|
|
5
|
+
:class="{ 'evaluateCountdown-hasTime': showEvaluateCountdown }"
|
|
6
|
+
>
|
|
7
|
+
<div class="evaluateCountdown-wrap">
|
|
8
|
+
<div v-if="showEvaluateCountdown" class="countdown" :class="{ 'countdown-red': countdownRed }">
|
|
9
|
+
<span>{{ countdownStr }}</span>
|
|
10
|
+
<svg-icon icon-class="zhongtai-zujianliebiao-gongzuoshijian"></svg-icon>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="answered-wrap">
|
|
13
|
+
答题情况: {{ setAnswered }}/<span>{{ totalLen }}</span>
|
|
14
|
+
</div>
|
|
9
15
|
</div>
|
|
10
16
|
</div>
|
|
11
17
|
</template>
|
|
12
18
|
<script>
|
|
13
19
|
import evaluate from "./mixin/evaluate";
|
|
14
20
|
import moment from 'moment';
|
|
21
|
+
import dragMove from './directive/drag-move'
|
|
15
22
|
export default {
|
|
16
23
|
name: "evaluateCountdown",
|
|
17
24
|
mixins: [evaluate],
|
|
18
25
|
components: {},
|
|
26
|
+
directives: { dragMove },
|
|
19
27
|
props: [
|
|
20
28
|
"formArray",
|
|
21
29
|
"evaluateResultConfig",
|
|
@@ -27,7 +35,8 @@ export default {
|
|
|
27
35
|
data() {
|
|
28
36
|
return {
|
|
29
37
|
source: "countdown",
|
|
30
|
-
setAnswered: 0
|
|
38
|
+
setAnswered: 0,
|
|
39
|
+
dragSetting: { isDrag: true }
|
|
31
40
|
};
|
|
32
41
|
},
|
|
33
42
|
|
|
@@ -103,30 +112,23 @@ export default {
|
|
|
103
112
|
background: #f2f2f4;
|
|
104
113
|
border-radius: 8px;
|
|
105
114
|
color: #212121;
|
|
106
|
-
z-index:
|
|
115
|
+
z-index: 2;
|
|
107
116
|
text-align: center;
|
|
117
|
+
user-select: none;
|
|
108
118
|
&.evaluateCountdown-hasTime {
|
|
109
119
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
line-height: unset;
|
|
118
|
-
}
|
|
119
|
-
svg {
|
|
120
|
-
display: none;
|
|
121
|
-
}
|
|
120
|
+
padding: 8px 32px;
|
|
121
|
+
background: #f1f1f4;
|
|
122
|
+
.countdown {
|
|
123
|
+
line-height: 40px;
|
|
124
|
+
font-size: 26px;
|
|
125
|
+
span {
|
|
126
|
+
line-height: unset;
|
|
122
127
|
}
|
|
123
|
-
|
|
124
|
-
display:
|
|
128
|
+
svg {
|
|
129
|
+
display: none;
|
|
125
130
|
}
|
|
126
131
|
}
|
|
127
|
-
.answered-wrap {
|
|
128
|
-
display: none;
|
|
129
|
-
}
|
|
130
132
|
}
|
|
131
133
|
.countdown {
|
|
132
134
|
display: flex;
|
|
@@ -39,12 +39,13 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
</template>
|
|
41
41
|
<script>
|
|
42
|
+
import { Button } from 'ant-design-vue'
|
|
42
43
|
import evaluate from "./mixin/evaluate";
|
|
43
44
|
import moment from 'moment';
|
|
44
45
|
export default {
|
|
45
46
|
name: "evaluatePage",
|
|
46
47
|
mixins: [evaluate],
|
|
47
|
-
components: {},
|
|
48
|
+
components: {[Button.name]: Button,},
|
|
48
49
|
props: ["formArray", "evaluateResultConfig", "evaluateResultSetting", "isFinished", "maxScore"],
|
|
49
50
|
data() {
|
|
50
51
|
return {
|
package/src/utils/time-domain.js
CHANGED
|
@@ -89,6 +89,27 @@ const timeDomain = {
|
|
|
89
89
|
.endOf('week');
|
|
90
90
|
return [start, end];
|
|
91
91
|
},
|
|
92
|
+
PAST_WEEK() {
|
|
93
|
+
const start = moment()
|
|
94
|
+
.add(-7, 'days')
|
|
95
|
+
.startOf('days');
|
|
96
|
+
const end = moment().endOf('days');
|
|
97
|
+
return [start, end];
|
|
98
|
+
},
|
|
99
|
+
PAST_MONTH() {
|
|
100
|
+
const start = moment()
|
|
101
|
+
.add(-30, 'days')
|
|
102
|
+
.startOf('days');
|
|
103
|
+
const end = moment().endOf('days');
|
|
104
|
+
return [start, end];
|
|
105
|
+
},
|
|
106
|
+
PAST_HALF_YEAR() {
|
|
107
|
+
const start = moment()
|
|
108
|
+
.add(-182, 'days')
|
|
109
|
+
.startOf('days');
|
|
110
|
+
const end = moment().endOf('days');
|
|
111
|
+
return [start, end];
|
|
112
|
+
},
|
|
92
113
|
|
|
93
114
|
THIS_QUARTER() {
|
|
94
115
|
const start = moment().startOf('quarter');
|