doway-coms 1.0.1
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/.browserslistrc +2 -0
- package/.eslintrc.js +23 -0
- package/README.md +24 -0
- package/babel.config.js +8 -0
- package/package.json +39 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +33 -0
- package/src/components/_base-input.vue +120 -0
- package/src/components/index.js +63 -0
- package/src/main.js +11 -0
- package/vue.config.js +14 -0
package/.browserslistrc
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true
|
|
5
|
+
},
|
|
6
|
+
'extends': [
|
|
7
|
+
'plugin:vue/essential',
|
|
8
|
+
'eslint:recommended'
|
|
9
|
+
],
|
|
10
|
+
parserOptions: {
|
|
11
|
+
parser: 'babel-eslint'
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
15
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
16
|
+
'no-undef':'off',
|
|
17
|
+
'no-unused-vars':'off',
|
|
18
|
+
'no-constant-condition':'off',
|
|
19
|
+
'no-unexpected-multiline':'off',
|
|
20
|
+
'no-console':'off',
|
|
21
|
+
'no-case-declarations':'off'
|
|
22
|
+
}
|
|
23
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# doway-coms
|
|
2
|
+
|
|
3
|
+
## Project setup
|
|
4
|
+
```
|
|
5
|
+
npm install
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
### Compiles and hot-reloads for development
|
|
9
|
+
```
|
|
10
|
+
npm run serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Compiles and minifies for production
|
|
14
|
+
```
|
|
15
|
+
npm run build
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Lints and fixes files
|
|
19
|
+
```
|
|
20
|
+
npm run lint
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Customize configuration
|
|
24
|
+
See [Configuration Reference](https://cli.vuejs.org/config/).
|
package/babel.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "doway-coms",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "doway组件库",
|
|
5
|
+
"author": "dowaysoft",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "vue-cli-service serve",
|
|
9
|
+
"build": "vue-cli-service build",
|
|
10
|
+
"lint": "vue-cli-service lint",
|
|
11
|
+
"lib": "vue-cli-service build --target lib --name doway-coms -dest lib src/components/index.js"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"ant-design-vue": "1.7.8",
|
|
15
|
+
"vue": "2.7.14",
|
|
16
|
+
"vue-router": "3.6.5",
|
|
17
|
+
"vee-validate": "3.4.14"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@vue/cli-plugin-babel": "~4.2.0",
|
|
21
|
+
"@vue/cli-plugin-eslint": "~4.2.0",
|
|
22
|
+
"@vue/cli-plugin-vuex": "~4.2.0",
|
|
23
|
+
"@vue/cli-service": "~4.2.0",
|
|
24
|
+
"babel-eslint": "^10.0.3",
|
|
25
|
+
"babel-plugin-import": "^1.13.6",
|
|
26
|
+
"eslint": "^6.7.2",
|
|
27
|
+
"eslint-plugin-vue": "^6.1.2",
|
|
28
|
+
"less-loader": "^6.0.0",
|
|
29
|
+
"node-sass": "^4.14.0",
|
|
30
|
+
"sass-loader": "^8.0.2",
|
|
31
|
+
"vue-template-compiler": "^2.6.11"
|
|
32
|
+
},
|
|
33
|
+
"main": ".eslintrc.js",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "http://coding.dowaycn.com/doway/doway-coms.git"
|
|
37
|
+
},
|
|
38
|
+
"keywords": []
|
|
39
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
13
|
+
</noscript>
|
|
14
|
+
<div id="app"></div>
|
|
15
|
+
<!-- built files will be auto injected -->
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="app">
|
|
3
|
+
davis
|
|
4
|
+
<base-input :label="'ceshi'" :edit="true"/>
|
|
5
|
+
<!-- <img alt="Vue logo" src="./assets/logo.png" />
|
|
6
|
+
|
|
7
|
+
<base-time/>
|
|
8
|
+
<base-checkbox :edit="true"/>
|
|
9
|
+
<base-input></base-input>
|
|
10
|
+
<base-date-time :edit="true"/>
|
|
11
|
+
<base-date-week :edit="true"/>
|
|
12
|
+
<base-date :edit="true"/>
|
|
13
|
+
<base-form/>
|
|
14
|
+
<base-grid-view/> -->
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: "App",
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style>
|
|
25
|
+
#app {
|
|
26
|
+
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
27
|
+
-webkit-font-smoothing: antialiased;
|
|
28
|
+
-moz-osx-font-smoothing: grayscale;
|
|
29
|
+
text-align: center;
|
|
30
|
+
color: #2c3e50;
|
|
31
|
+
margin-top: 60px;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-control-container">
|
|
3
|
+
<div class="d-control-label">
|
|
4
|
+
{{ label
|
|
5
|
+
}}<span v-if="rules && rules['required']" class="d-control-label-required"
|
|
6
|
+
>*
|
|
7
|
+
</span>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="d-control">
|
|
10
|
+
<ValidationProvider
|
|
11
|
+
:name="label"
|
|
12
|
+
v-slot="v"
|
|
13
|
+
:rules="rules"
|
|
14
|
+
v-if="edit === true"
|
|
15
|
+
>
|
|
16
|
+
<Input
|
|
17
|
+
:size="'small'"
|
|
18
|
+
v-model="currentValue"
|
|
19
|
+
:placeholder="placeholder"
|
|
20
|
+
@change="change"
|
|
21
|
+
@blur="blur"
|
|
22
|
+
style="width: 100%"
|
|
23
|
+
:class="{ 'd-error-input': v.errors.length > 0 }"
|
|
24
|
+
/>
|
|
25
|
+
<div class="d-error-msg">
|
|
26
|
+
{{ v.errors[0] }}
|
|
27
|
+
</div>
|
|
28
|
+
</ValidationProvider>
|
|
29
|
+
<span v-else>{{ currentValue }}</span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
|
|
36
|
+
import { Input } from 'ant-design-vue'
|
|
37
|
+
import { ValidationProvider } from 'vee-validate'
|
|
38
|
+
export default {
|
|
39
|
+
name: 'baseInput',
|
|
40
|
+
components:{
|
|
41
|
+
Input,
|
|
42
|
+
ValidationProvider
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
filterValue: '',
|
|
47
|
+
isInputChanged: false,
|
|
48
|
+
inputTimeout: null,
|
|
49
|
+
searchRows: [],
|
|
50
|
+
filterCols: [],
|
|
51
|
+
gridLoading: false,
|
|
52
|
+
gridPagerConfig: {
|
|
53
|
+
total: 0,
|
|
54
|
+
currentPage: 1,
|
|
55
|
+
pageSize: 10
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
currentValue: {
|
|
61
|
+
// 动态计算currentValue的值
|
|
62
|
+
get: function() {
|
|
63
|
+
return this.value // 将props中的value赋值给currentValue
|
|
64
|
+
},
|
|
65
|
+
set: function(val) {
|
|
66
|
+
this.$emit('input', val) // 通过$emit触发父组件
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
props: {
|
|
71
|
+
rules: {
|
|
72
|
+
type: Object,
|
|
73
|
+
default: function() {
|
|
74
|
+
return null
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
value: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: function() {
|
|
80
|
+
return ''
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
edit: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: function() {
|
|
86
|
+
return false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
name: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: function() {
|
|
92
|
+
return ''
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
label: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: function() {
|
|
98
|
+
return ''
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
placeholder: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: function() {
|
|
104
|
+
return ''
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
created() {},
|
|
109
|
+
methods: {
|
|
110
|
+
change() {
|
|
111
|
+
this.$emit('change')
|
|
112
|
+
},
|
|
113
|
+
blur() {
|
|
114
|
+
this.$emit('blur')
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//组件
|
|
2
|
+
// import BaseAdjustGridView from "./_base-adjust-grid-view.vue"
|
|
3
|
+
// import BaseAttachViewer from "./_base-attach-viewer.vue"
|
|
4
|
+
// import BaseCheckbox from "./_base-checkbox"
|
|
5
|
+
// import BaseDateTime from "./_base-date-time.vue"
|
|
6
|
+
// import BaseDateWeek from "./_base-date-week.vue"
|
|
7
|
+
// import BaseDate from "./_base-date.vue"
|
|
8
|
+
// import BaseForm from "./_base-form.vue"
|
|
9
|
+
// import BaseGanttView from "./_base-gantt-view.vue"
|
|
10
|
+
// import BaseGridView from "./_base-grid-view.vue";
|
|
11
|
+
// import BaseImageList from "./_base-image-list.vue";
|
|
12
|
+
import BaseInput from "./_base-input.vue";
|
|
13
|
+
// import BaseInervalInput from "./_base-interval-input.vue";
|
|
14
|
+
// import BaseKanbanEmpty from "./_base-kanban-empty.vue";
|
|
15
|
+
// import BaseKanban from "./_base-kanban.vue";
|
|
16
|
+
// import BaseNumberInput from "./_base-number-input.vue";
|
|
17
|
+
// import BasePaginationView from "./_base-pagination-view.vue";
|
|
18
|
+
// import BasePulldown from "./_base-pulldown.vue";
|
|
19
|
+
// import BaseSearch from "./_base-search.vue";
|
|
20
|
+
// import BaseSelectMulti from "./_base-select-multi.vue";
|
|
21
|
+
// import BaseSelect from "./_base-select.vue";
|
|
22
|
+
// import BaseTextarea from "./_base-textarea.vue";
|
|
23
|
+
// import BaseTimeRange from "./_base-time-range.vue";
|
|
24
|
+
// import BaseTime from "./_base-time.vue";
|
|
25
|
+
// import BaseToolStatus from "./_base-tool-status.vue";
|
|
26
|
+
// import BaseTool from "./_base-tool.vue";
|
|
27
|
+
|
|
28
|
+
//所有组件列表
|
|
29
|
+
const components = [
|
|
30
|
+
BaseInput
|
|
31
|
+
// BaseAdjustGridView, BaseAttachViewer,
|
|
32
|
+
// BaseCheckbox,
|
|
33
|
+
// BaseDateTime, BaseDateWeek, BaseDate,
|
|
34
|
+
// BaseForm, BaseGanttView,
|
|
35
|
+
// BaseGridView, BaseImageList, BaseInput, BaseInervalInput, BaseKanbanEmpty,
|
|
36
|
+
// BaseKanban, BaseNumberInput,
|
|
37
|
+
// BasePaginationView
|
|
38
|
+
// , BasePulldown
|
|
39
|
+
// , BaseSearch, BaseSelectMulti,
|
|
40
|
+
// BaseSelect, BaseTextarea,
|
|
41
|
+
// BaseTimeRange, BaseTime, BaseToolStatus, BaseTool
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
//定义install方法,Vue作为参数
|
|
46
|
+
const install = Vue => {
|
|
47
|
+
//判断是否安装,安装过就不用继续执行
|
|
48
|
+
if (install.installed) return;
|
|
49
|
+
install.installed = true;
|
|
50
|
+
//遍历注册所有组件
|
|
51
|
+
components.map(component => Vue.component(component.name, component));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//检测到Vue再执行
|
|
55
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
56
|
+
install(window.Vue);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
install,
|
|
61
|
+
//所有组件,必须具有install方法才能使用Vue.use()
|
|
62
|
+
...components
|
|
63
|
+
};
|
package/src/main.js
ADDED