Compare commits

...

13 Commits

Author SHA1 Message Date
qiaopengfei 9dbb3debe1 合并冲突 2024-07-01 14:30:28 +08:00
qiaopengfei c489660d1d fei 2024-07-01 14:27:49 +08:00
baileijun f4e4b3fb5d Merge pull request 'leijun' (#3) from leijun into master
Reviewed-on: #3
2024-07-01 14:24:39 +08:00
baileijun cb04369abd 0.1.6 2024-06-29 20:17:49 +08:00
baileijun 41ec7df198 0.1.5 2024-06-29 20:16:59 +08:00
baileijun 648aa48f08 1 2024-06-29 20:16:49 +08:00
baileijun 0732434efc 1 2024-06-29 20:14:44 +08:00
baileijun 90d1a983e0 1 2024-06-29 19:36:35 +08:00
baileijun 3bbc6814af 0.1.4 2024-06-29 19:31:53 +08:00
baileijun a2f77bd3fe 1 2024-06-29 19:31:28 +08:00
baileijun b4b57f0424 Merge pull request '万丈高楼平地起' (#2) from qiaopengfei into master
Reviewed-on: #2
2024-06-28 17:20:58 +08:00
baileijun 793d410450 Merge pull request '0.1.3' (#1) from leijun into master
Reviewed-on: #1
2024-06-28 17:20:25 +08:00
baileijun 4cedf010e6 0.1.3 2024-06-28 15:44:23 +08:00
13 changed files with 166 additions and 109 deletions

View File

@ -7,7 +7,7 @@ npm install
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
npm run serve npm run dev
``` ```
### Compiles and minifies for production ### Compiles and minifies for production

View File

@ -1,5 +1,16 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/cli-plugin-babel/preset' '@vue/cli-plugin-babel/preset',
] ["@babel/preset-env", { "modules": false }]
],
plugins: [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
} }

View File

@ -1,12 +1,15 @@
import Vue from 'vue' import Vue from 'vue'
import App from '../src/App.vue' import App from '../src/App.vue'
//基于element组件封装引入element组件库
import { Input } from 'element-ui';
Vue.use(Input);
// 导入组件库 // 导入组件库
import myui from '../packages' import erp_element_ui from '../packages'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(erp_element_ui)
Vue.use(myui)
new Vue({ new Vue({
render: h => h(App), render: h => h(App),

View File

@ -1,25 +1,27 @@
{ {
"name": "myErpElement", "name": "myErpElement",
"version": "0.1.2", "version": "0.1.6",
"private": false, "private": false,
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"lib": "vue-cli-service build --target lib packages/index.js" "lib": "vue-cli-service build --target lib --dest lib packages/index.js"
}, },
"main": "./lib/myErpElement.umd.min.js", "main": "./lib/myErpElement.umd.min.js",
"dependencies": { "dependencies": {
"core-js": "^3.6.5", "core-js": "^3.6.5"
"vue": "^2.6.11"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.19", "@vue/cli-plugin-babel": "~4.5.19",
"@vue/cli-plugin-eslint": "~4.5.19", "@vue/cli-plugin-eslint": "~4.5.19",
"@vue/cli-service": "~4.5.19", "@vue/cli-service": "~4.5.19",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"element-ui": "^2.15.14",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11"
}, },
"eslintConfig": { "eslintConfig": {

View File

@ -1,9 +0,0 @@
import mButton from './src'
// 为组件提供 install 安装方法,供按需引入
mButton.install = function (Vue) {
Vue.component(mButton.name, mButton)
}
// 导出组件
export default mButton

View File

@ -1,38 +0,0 @@
<template>
<div class="button">
<slot name="default" :datas="datas">{{ datas.a }}</slot>
</div>
</template>
<script>
export default {
name: 'mButton',
props: {
type: String
},
data() {
return {
datas:{
a:'666',
b:'successs'
}
}
},
}
</script>
<style scoped>
.button {
width: 100px;
border: 1px solid #000;
padding: .5rem;
margin: 0 auto;
}
.button:hover {
color: aliceblue;
background-color: orange;
}
</style>

View File

@ -1,9 +0,0 @@
import mButton1 from './src'
// 为组件提供 install 安装方法,供按需引入
mButton1.install = function (Vue) {
Vue.component(mButton1.name, mButton1)
}
// 导出组件
export default mButton1

View File

@ -1,33 +0,0 @@
<template>
<div class="button">
<slot v-bind:data="name">{{ name.a }}</slot>
</div>
</template>
<script>
export default {
name: 'mButton1',
props: {
type: String
},
data() {
return {
name: { a: '777', b: '888' }
}
},
}
</script>
<style scoped>
.button {
width: 100px;
border: 1px solid #000;
padding: .5rem;
margin: 0 auto;
}
.button:hover {
color: aliceblue;
background-color: #000000;
}
</style>

View File

@ -1,10 +1,9 @@
// 导入button组件 // 导入button组件
import mButton from './Button/src/index.vue' import pedestal from './pedestal/src/index.vue'
import mButton1 from './Button1/src/index.vue'
// 组件列表 // 组件列表
const components = [ const components = [
mButton,mButton1 pedestal,
] ]
// 定义 install 方法,接收 Vue 作为参数(使用 use 注册插件,那么所有的组件都会被注册) // 定义 install 方法,接收 Vue 作为参数(使用 use 注册插件,那么所有的组件都会被注册)
@ -23,7 +22,9 @@ if (typeof window !== 'undefined' && window.Vue) {
export default { export default {
// 导出的对象必须具有 install才能被 Vue.use() 方法安装 // 导出的对象必须具有 install才能被 Vue.use() 方法安装
install, install,
// 以下是具体的组件列表
mButton,
mButton1,
} }
export {
install,
// 以下是具体的组件列表
pedestal,
}

View File

@ -0,0 +1,9 @@
import pedestal from './src'
// 为组件提供 install 安装方法,供按需引入
pedestal.install = function (Vue) {
Vue.component(pedestal.name, pedestal)
}
// 导出组件
export default pedestal

View File

@ -0,0 +1,77 @@
<template>
<el-input
class="w-input"
:style="{ width }"
:value="value"
:size="size"
v-on="inputListeners"
v-bind="[$attrs]"
>
<slot name="append" slot="append" />
<slot name="prefix" slot="prefix" />
<slot name="suffix" slot="suffix" />
<slot name="prepend" slot="prepend" />
</el-input>
</template>
<script>
/**
* WInput
* @desc 处理输入的输入框(转大写不能有中文空格等)
*/
export default {
name: "WInput",
props: {
width: {
type: String,
default: "180px",
},
size: {
type: String,
default: "small",
},
value: {
type: String,
default: "",
},
toUpperCase: {
type: Boolean,
default: true,
},
},
computed: {
//
inputListeners() {
return Object.assign(
{},
//
this.$listeners,
//
//
{
// `v-model`
input: (value) => {
this.$emit("input", this.toUpperCase ? value.toUpperCase() : value);
},
blur: (e) => {
let value = e.target.value
.trim()
.replace(/\s/g, (match) =>
match.charCodeAt(0) === 12288 ? String.fromCharCode(32) : match
);
//
this.$emit("input", value);
},
}
);
},
},
mounted() {
// console.warn(this.$route.name);
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -1,15 +1,45 @@
<template> <template>
<div> <div>
<moduleName></moduleName> <Pedestal ref="ref_Pedestal" :options="options">
<!-- <template #operate="">
<el-button
class="excel"
type="success"
icon="el-icon-download"
size="small"
plain
@click="excel()"
>导出</el-button
>
</template> -->
</Pedestal>
</div> </div>
</template> </template>
<script> <script>
import moduleName from "../packages/Button/src/index.vue"; import Pedestal from "../packages/pedestal/src/index.vue";
export default { export default {
components: { moduleName }, components: { Pedestal },
data() { data() {
return {}; return {
options: {
fnSearch: this.fnSearch,
formItemAttrs: {
order_sn: {
type: "input",
label: "订单号",
placeholder: "请输入订单号",
},
product_category_id: {
type: "select",
label: "商品分类",
multiple: false,
selectOpts: [{ label: "全部", value: "" }],
placeholder: "选择商品分类",
},
},
},
};
}, },
methods: {}, methods: {},
}; };

13
src/utils/cloneDeep.js Normal file
View File

@ -0,0 +1,13 @@
export default function cloneDeep(obj, hash = new WeakMap()) {
if (obj == null || typeof obj !== 'object') return obj
if (obj instanceof Date) return new Date(obj)
if (obj instanceof RegExp) return new RegExp(obj.source, obj.flags)
if (hash.has(obj)) return hash.get(obj)
let deepObj = Array.isArray(obj) ? [] : Object.create(Object.getPrototypeOf(obj))
hash.set(obj, deepObj)
for (const key in obj) {
deepObj[key] = cloneDeep(obj[key], hash)
}
return deepObj
}