byt-ui 0.0.15 → 0.0.17
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/README.md +172 -74
- package/jsconfig.json +19 -19
- package/lib/byt-ui.common.js +239 -165
- package/lib/byt-ui.css +1 -1
- package/lib/byt-ui.umd.js +239 -165
- package/lib/byt-ui.umd.min.js +2 -2
- package/package.json +2 -2
- package/packages/common/modules/cookie.js +4 -4
- package/packages/components/basic-view/demo.vue +74 -4
- package/packages/components/basic-view/index.vue +12 -18
- package/packages/components/form-view/index.vue +36 -11
- package/yarn-error.log +108 -0
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: 王国火
|
|
4
4
|
* @Date: 2022-10-18 12:37:03
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-11-16 20:11:01
|
|
6
6
|
* @LastEditors: 王国火
|
|
7
7
|
*/
|
|
8
8
|
import Cookie from 'js-cookie'
|
|
9
9
|
import website from './website'
|
|
10
10
|
export const getCookie = (key, context) => {
|
|
11
|
-
const searchKey = `${website.key}
|
|
11
|
+
const searchKey = `${website.key}-${key}`
|
|
12
12
|
if (context && context.req) {
|
|
13
13
|
if (context.req.headers.cookie) {
|
|
14
14
|
const arr = context.req.headers.cookie.split(';')
|
|
@@ -25,9 +25,9 @@ export const getCookie = (key, context) => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const setCookie = (key, value, expires = 7, path = '/') => {
|
|
28
|
-
return Cookie.set(`${website.key}
|
|
28
|
+
return Cookie.set(`${website.key}-${key}`, value, { expires, path })
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export const removeCookie = (key, path = '/') => {
|
|
32
|
-
return Cookie.remove(key
|
|
32
|
+
return Cookie.remove(`${website.key}-${key}`, { path })
|
|
33
33
|
}
|
|
@@ -29,16 +29,83 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
+
import moment from "moment"
|
|
32
33
|
export default {
|
|
33
|
-
name: 'demo',
|
|
34
|
+
name: 'default-demo',
|
|
34
35
|
components: {},
|
|
35
36
|
data() {
|
|
36
37
|
return {
|
|
37
38
|
searchList: [
|
|
38
39
|
{
|
|
39
|
-
label: '
|
|
40
|
-
key: '
|
|
41
|
-
type: 'input'
|
|
40
|
+
label: '输入框',
|
|
41
|
+
key: 'input',
|
|
42
|
+
type: 'input',
|
|
43
|
+
default:"abc"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: '下拉框',
|
|
47
|
+
key: 'select',
|
|
48
|
+
type: 'select',
|
|
49
|
+
default:1,
|
|
50
|
+
options:[
|
|
51
|
+
{label:"a",value:1},
|
|
52
|
+
{label:"b",value:2},
|
|
53
|
+
{label:"c",value:3},
|
|
54
|
+
{label:"d",value:4}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: '级联选择',
|
|
59
|
+
key: 'cascader',
|
|
60
|
+
type: 'cascader',
|
|
61
|
+
default:"yizhi",
|
|
62
|
+
options:[{
|
|
63
|
+
value: 'zhinan',
|
|
64
|
+
label: '指南',
|
|
65
|
+
children: [{
|
|
66
|
+
value: 'shejiyuanze',
|
|
67
|
+
label: '设计原则',
|
|
68
|
+
children: [{
|
|
69
|
+
value: 'yizhi',
|
|
70
|
+
label: '一致'
|
|
71
|
+
}, {
|
|
72
|
+
value: 'fankui',
|
|
73
|
+
label: '反馈'
|
|
74
|
+
}, {
|
|
75
|
+
value: 'xiaolv',
|
|
76
|
+
label: '效率'
|
|
77
|
+
}, {
|
|
78
|
+
value: 'kekong',
|
|
79
|
+
label: '可控'
|
|
80
|
+
}]
|
|
81
|
+
}]
|
|
82
|
+
}]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: '年月日',
|
|
86
|
+
key: 'date',
|
|
87
|
+
type: 'datepicker',
|
|
88
|
+
default:moment().format("YYYY-MM-DD")
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: '年月',
|
|
92
|
+
key: 'month',
|
|
93
|
+
type: 'datepicker',
|
|
94
|
+
fields:"month",
|
|
95
|
+
default:moment().format("YYYY-MM")
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: '年',
|
|
99
|
+
key: 'year',
|
|
100
|
+
type: 'datepicker',
|
|
101
|
+
fields:"year",
|
|
102
|
+
default:moment().format("YYYY")
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: '日期区间',
|
|
106
|
+
key: 'daterange',
|
|
107
|
+
type: 'daterange',
|
|
108
|
+
default:["2023-06-05","2023-06-07"]
|
|
42
109
|
}
|
|
43
110
|
],
|
|
44
111
|
tableData: [],
|
|
@@ -79,6 +146,9 @@ export default {
|
|
|
79
146
|
},
|
|
80
147
|
refreshChange() {
|
|
81
148
|
this.$refs.baseView.refresh();
|
|
149
|
+
},
|
|
150
|
+
onClear(){
|
|
151
|
+
this.$refs.baseView.clear();
|
|
82
152
|
}
|
|
83
153
|
}
|
|
84
154
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: 王国火
|
|
4
4
|
* @Date: 2022-07-12 17:47:20
|
|
5
|
-
* @LastEditTime:
|
|
6
|
-
* @LastEditors:
|
|
5
|
+
* @LastEditTime: 2023-06-07 08:31:20
|
|
6
|
+
* @LastEditors: 王国火
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<template>
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
:search-list="searchList"
|
|
18
18
|
@search="onSearch"
|
|
19
19
|
@reset="onReset"
|
|
20
|
+
@init="init"
|
|
20
21
|
v-model="searchForm"
|
|
21
22
|
></FormView>
|
|
22
23
|
</div>
|
|
@@ -196,10 +197,14 @@ export default {
|
|
|
196
197
|
}
|
|
197
198
|
},
|
|
198
199
|
mounted() {
|
|
199
|
-
|
|
200
|
-
if (this.autoLoad) this.fetchData();
|
|
200
|
+
|
|
201
201
|
},
|
|
202
202
|
methods: {
|
|
203
|
+
init(form){
|
|
204
|
+
this.searchForm=Object.assign({},this.searchForm,form);
|
|
205
|
+
// 有些特殊情况需要手动请求列表数据
|
|
206
|
+
if (this.autoLoad) this.fetchData();
|
|
207
|
+
},
|
|
203
208
|
onSelectAllEvent(list) {
|
|
204
209
|
/** 多选框全选触发
|
|
205
210
|
* @event checkbox-all
|
|
@@ -259,6 +264,9 @@ export default {
|
|
|
259
264
|
this.searchForm = {};
|
|
260
265
|
this.fetchData();
|
|
261
266
|
},
|
|
267
|
+
clear(){
|
|
268
|
+
this.$refs.search.init();
|
|
269
|
+
},
|
|
262
270
|
onSizeChange(size) {
|
|
263
271
|
this.pageOpt.pageSize = size;
|
|
264
272
|
this.pageOpt.page = 1;
|
|
@@ -271,13 +279,6 @@ export default {
|
|
|
271
279
|
this.$nextTick(() => {
|
|
272
280
|
this.fetchData();
|
|
273
281
|
})
|
|
274
|
-
},
|
|
275
|
-
initForm(list) {
|
|
276
|
-
list.map(v => {
|
|
277
|
-
if (v.value || v.value == 0) {
|
|
278
|
-
this.$set(this.searchForm, v.key, v.value)
|
|
279
|
-
}
|
|
280
|
-
})
|
|
281
282
|
}
|
|
282
283
|
},
|
|
283
284
|
watch: {
|
|
@@ -289,13 +290,6 @@ export default {
|
|
|
289
290
|
},
|
|
290
291
|
immediate: true,
|
|
291
292
|
deep: true
|
|
292
|
-
},
|
|
293
|
-
searchList: {
|
|
294
|
-
handler(val) {
|
|
295
|
-
this.initForm(val)
|
|
296
|
-
},
|
|
297
|
-
immediate: true,
|
|
298
|
-
deep: true
|
|
299
293
|
}
|
|
300
294
|
}
|
|
301
295
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: 王国火
|
|
4
4
|
* @Date: 2022-07-13 08:46:34
|
|
5
|
-
* @LastEditTime:
|
|
6
|
-
* @LastEditors:
|
|
5
|
+
* @LastEditTime: 2023-06-07 08:53:12
|
|
6
|
+
* @LastEditors: 王国火
|
|
7
7
|
-->
|
|
8
8
|
<!-- -->
|
|
9
9
|
<template>
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
:picker-options="pickerOptions"
|
|
59
59
|
>
|
|
60
60
|
</el-date-picker>
|
|
61
|
-
<!-- fields可选值:date、month、year -->
|
|
62
61
|
</template>
|
|
63
62
|
</el-form-item>
|
|
64
63
|
|
|
@@ -131,7 +130,9 @@ export default {
|
|
|
131
130
|
},
|
|
132
131
|
components: {},
|
|
133
132
|
computed: {},
|
|
134
|
-
mounted() {
|
|
133
|
+
mounted() {
|
|
134
|
+
|
|
135
|
+
},
|
|
135
136
|
methods: {
|
|
136
137
|
formateDate(type) {
|
|
137
138
|
// date、week 、month、year
|
|
@@ -169,17 +170,41 @@ export default {
|
|
|
169
170
|
if (v)resolve(v)
|
|
170
171
|
})
|
|
171
172
|
})
|
|
173
|
+
},
|
|
174
|
+
setDefaultVal(el) {
|
|
175
|
+
// 处理默认值,可拓展
|
|
176
|
+
const dval = el.default;// 默认值
|
|
177
|
+
switch (el.type) {
|
|
178
|
+
case 'input':
|
|
179
|
+
case 'select':
|
|
180
|
+
return (dval === 0 || dval === '0') ? dval : (dval || '')
|
|
181
|
+
case 'inputNumber':
|
|
182
|
+
return dval === 0 ? dval : (dval || null)
|
|
183
|
+
case 'treeSelect':
|
|
184
|
+
return [];
|
|
185
|
+
default:
|
|
186
|
+
return (dval === 0 || dval === '0') ? dval : (dval || '')
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
formatForm(list) {
|
|
190
|
+
//有些查询条件初始携带默认值,需要处理;
|
|
191
|
+
this.form = Object.assign({}, this.form, list.reduce((obj, el) => {
|
|
192
|
+
obj[el.key] = this.setDefaultVal(el)
|
|
193
|
+
return obj
|
|
194
|
+
}, {}))
|
|
195
|
+
},
|
|
196
|
+
init(){
|
|
197
|
+
this.formatForm(this.searchList);
|
|
198
|
+
this.$emit('init', this.form)
|
|
172
199
|
}
|
|
173
200
|
},
|
|
174
201
|
watch: {
|
|
175
|
-
|
|
176
|
-
handler(
|
|
177
|
-
|
|
178
|
-
this.form = Object.assign({}, this.form, val);
|
|
179
|
-
}
|
|
202
|
+
searchList:{
|
|
203
|
+
handler(){
|
|
204
|
+
this.init();
|
|
180
205
|
},
|
|
181
|
-
immediate:
|
|
182
|
-
deep:
|
|
206
|
+
immediate:true,
|
|
207
|
+
deep:true
|
|
183
208
|
},
|
|
184
209
|
form: {
|
|
185
210
|
handler(val) {
|
package/yarn-error.log
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Arguments:
|
|
2
|
+
C:\Program Files\nodejs\node.exe C:\Users\byt\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js login
|
|
3
|
+
|
|
4
|
+
PATH:
|
|
5
|
+
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\微信web开发者工具\dll;C:\Pro;ram Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\byt\AppData\Local\Microsoft\WindowsApps;;c:\program files\esafenet\cobra docguard client;C:\Users\byt\AppData\Local\Programs\Fiddler;F:\Microsoft VS Code\bin;C:\Users\byt\AppData\Roaming\npm
|
|
6
|
+
|
|
7
|
+
Yarn version:
|
|
8
|
+
1.22.19
|
|
9
|
+
|
|
10
|
+
Node version:
|
|
11
|
+
14.18.3
|
|
12
|
+
|
|
13
|
+
Platform:
|
|
14
|
+
win32 x64
|
|
15
|
+
|
|
16
|
+
Trace:
|
|
17
|
+
Error: canceled
|
|
18
|
+
at Interface.<anonymous> (C:\Users\byt\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:137150:13)
|
|
19
|
+
at Interface.emit (events.js:400:28)
|
|
20
|
+
at Interface._ttyWrite (readline.js:1001:16)
|
|
21
|
+
at ReadStream.onkeypress (readline.js:265:10)
|
|
22
|
+
at ReadStream.emit (events.js:400:28)
|
|
23
|
+
at emitKeys (internal/readline/utils.js:358:14)
|
|
24
|
+
at emitKeys.next (<anonymous>)
|
|
25
|
+
at ReadStream.onData (readline.js:1270:36)
|
|
26
|
+
at ReadStream.emit (events.js:400:28)
|
|
27
|
+
at addChunk (internal/streams/readable.js:293:12)
|
|
28
|
+
|
|
29
|
+
npm manifest:
|
|
30
|
+
{
|
|
31
|
+
"name": "byt-ui",
|
|
32
|
+
"version": "0.0.16",
|
|
33
|
+
"private": false,
|
|
34
|
+
"description": "byt组件库",
|
|
35
|
+
"author": {
|
|
36
|
+
"name": "wgh"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "vue-cli-service serve",
|
|
40
|
+
"build": "vue-cli-service build",
|
|
41
|
+
"lint": "vue-cli-service lint",
|
|
42
|
+
"lib": "vue-cli-service build --target lib --name byt-ui --dest lib packages/index.js",
|
|
43
|
+
"styleguide": "vue-cli-service styleguidist",
|
|
44
|
+
"styleguide:build": "vue-cli-service styleguidist:build"
|
|
45
|
+
},
|
|
46
|
+
"main": "lib/byt-ui.umd.min.js",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"core-js": "^3.8.3",
|
|
49
|
+
"element-ui": "^2.15.10",
|
|
50
|
+
"js-cookie": "^3.0.1",
|
|
51
|
+
"moment": "^2.29.4",
|
|
52
|
+
"vue": "^2.6.14",
|
|
53
|
+
"vxe-table": "^3.6.6",
|
|
54
|
+
"xe-utils": "^3.5.6"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@babel/core": "^7.12.16",
|
|
58
|
+
"@babel/eslint-parser": "^7.12.16",
|
|
59
|
+
"@babel/preset-env": "^7.19.4",
|
|
60
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
|
61
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
62
|
+
"@vue/cli-service": "~5.0.0",
|
|
63
|
+
"babel-plugin-component": "^1.1.1",
|
|
64
|
+
"babel-preset-env": "^1.7.0",
|
|
65
|
+
"eslint": "^7.32.0",
|
|
66
|
+
"eslint-plugin-vue": "^8.0.3",
|
|
67
|
+
"node-sass": "4.14.1",
|
|
68
|
+
"sass-loader": "10.0.4",
|
|
69
|
+
"vue-cli-plugin-styleguidist": "~4.45.1",
|
|
70
|
+
"vue-template-compiler": "^2.6.14"
|
|
71
|
+
},
|
|
72
|
+
"eslintConfig": {
|
|
73
|
+
"root": true,
|
|
74
|
+
"env": {
|
|
75
|
+
"node": true
|
|
76
|
+
},
|
|
77
|
+
"extends": [
|
|
78
|
+
"plugin:vue/essential",
|
|
79
|
+
"eslint:recommended"
|
|
80
|
+
],
|
|
81
|
+
"parserOptions": {
|
|
82
|
+
"parser": "@babel/eslint-parser"
|
|
83
|
+
},
|
|
84
|
+
"rules": {}
|
|
85
|
+
},
|
|
86
|
+
"browserslist": [
|
|
87
|
+
"> 1%",
|
|
88
|
+
"last 2 versions",
|
|
89
|
+
"not dead"
|
|
90
|
+
],
|
|
91
|
+
"keywords": [
|
|
92
|
+
"byt",
|
|
93
|
+
"byt-ui",
|
|
94
|
+
"@byt",
|
|
95
|
+
"@byt/base"
|
|
96
|
+
],
|
|
97
|
+
"license": "MIT",
|
|
98
|
+
"publishConfig": {
|
|
99
|
+
"access": "public",
|
|
100
|
+
"registry": "https://registry.npmjs.org/"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
yarn manifest:
|
|
105
|
+
No manifest
|
|
106
|
+
|
|
107
|
+
Lockfile:
|
|
108
|
+
No lockfile
|