新增 vue vue-element 组件,用户开发操作复杂页面
新增散料,修改盘料入库逻辑
This commit is contained in:
1 parent
eeafb20012
commit
630e33a27a
726 files changed
+281372
-151
No files matched your search
@@ -0,0 +1,33 @@
|
||||
function broadcast(componentName, eventName, params) {
|
||||
this.$children.forEach(child => {
|
||||
var name = child.$options.componentName;
|
||||
|
||||
if (name === componentName) {
|
||||
child.$emit.apply(child, [eventName].concat(params));
|
||||
} else {
|
||||
broadcast.apply(child, [componentName, eventName].concat([params]));
|
||||
}
|
||||
});
|
||||
}
|
||||
export default {
|
||||
methods: {
|
||||
dispatch(componentName, eventName, params) {
|
||||
var parent = this.$parent || this.$root;
|
||||
var name = parent.$options.componentName;
|
||||
|
||||
while (parent && (!name || name !== componentName)) {
|
||||
parent = parent.$parent;
|
||||
|
||||
if (parent) {
|
||||
name = parent.$options.componentName;
|
||||
}
|
||||
}
|
||||
if (parent) {
|
||||
parent.$emit.apply(parent, [eventName].concat(params));
|
||||
}
|
||||
},
|
||||
broadcast(componentName, eventName, params) {
|
||||
broadcast.call(this, componentName, eventName, params);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function(ref) {
|
||||
return {
|
||||
methods: {
|
||||
focus() {
|
||||
this.$refs[ref].focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { t } from 'element-ui/src/locale';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
t(...args) {
|
||||
return t.apply(this, args);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
import { kebabCase } from 'element-ui/src/utils/util';
|
||||
/**
|
||||
* Show migrating guide in browser console.
|
||||
*
|
||||
* Usage:
|
||||
* import Migrating from 'element-ui/src/mixins/migrating';
|
||||
*
|
||||
* mixins: [Migrating]
|
||||
*
|
||||
* add getMigratingConfig method for your component.
|
||||
* getMigratingConfig() {
|
||||
* return {
|
||||
* props: {
|
||||
* 'allow-no-selection': 'allow-no-selection is removed.',
|
||||
* 'selection-mode': 'selection-mode is removed.'
|
||||
* },
|
||||
* events: {
|
||||
* selectionchange: 'selectionchange is renamed to selection-change.'
|
||||
* }
|
||||
* };
|
||||
* },
|
||||
*/
|
||||
export default {
|
||||
mounted() {
|
||||
if (process.env.NODE_ENV === 'production') return;
|
||||
if (!this.$vnode) return;
|
||||
const { props = {}, events = {} } = this.getMigratingConfig();
|
||||
const { data, componentOptions } = this.$vnode;
|
||||
const definedProps = data.attrs || {};
|
||||
const definedEvents = componentOptions.listeners || {};
|
||||
|
||||
for (let propName in definedProps) {
|
||||
propName = kebabCase(propName); // compatible with camel case
|
||||
if (props[propName]) {
|
||||
console.warn(`[Element Migrating][${this.$options.name}][Attribute]: ${props[propName]}`);
|
||||
}
|
||||
}
|
||||
|
||||
for (let eventName in definedEvents) {
|
||||
eventName = kebabCase(eventName); // compatible with camel case
|
||||
if (events[eventName]) {
|
||||
console.warn(`[Element Migrating][${this.$options.name}][Event]: ${events[eventName]}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {},
|
||||
events: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user