新增 vue vue-element 组件,用户开发操作复杂页面

新增散料,修改盘料入库逻辑
This commit is contained in:
zgf committed 2023-08-21 23:41:26 +08:00
1 parent eeafb20012
commit 630e33a27a
726 files changed
+281372 -151

No files matched your search

@@ -0,0 +1,18 @@
import normalizeWheel from 'normalize-wheel';
const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
const mousewheel = function(element, callback) {
if (element && element.addEventListener) {
element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function(event) {
const normalized = normalizeWheel(event);
callback && callback.apply(this, [event, normalized]);
});
}
};
export default {
bind(el, binding) {
mousewheel(el, binding.value);
}
};
@@ -0,0 +1,26 @@
import { once, on } from 'element-ui/src/utils/dom';
import { isMac } from 'element-ui/src/utils/util';
export default {
bind(el, binding, vnode) {
let interval = null;
let startTime;
const maxIntervals = isMac() ? 100 : 200;
const handler = () => vnode.context[binding.expression].apply();
const clear = () => {
if (Date.now() - startTime < maxIntervals) {
handler();
}
clearInterval(interval);
interval = null;
};
on(el, 'mousedown', (e) => {
if (e.button !== 0) return;
startTime = Date.now();
once(document, 'mouseup', clear);
clearInterval(interval);
interval = setInterval(handler, maxIntervals);
});
}
};