wui-components-v2 1.1.70 → 1.1.71
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/api/feishu.ts +20 -20
- package/api/index.ts +4 -4
- package/api/login.ts +51 -51
- package/api/tree.ts +28 -28
- package/components/action-popup/action-popup.vue +116 -116
- package/components/add-address-list/add-address-list.vue +187 -187
- package/components/add-address-page/config.ts +297 -297
- package/components/audio-play/audio-play.vue +220 -220
- package/components/batch-upload-file/batch-upload-file.vue +75 -75
- package/components/card-botom-buttons/card-botom-buttons.vue +279 -279
- package/components/demo-card/demo-card.vue +44 -44
- package/components/fold-card/fold-card.vue +2 -2
- package/components/global-loading/GlobalLoading.md +366 -366
- package/components/global-loading/global-loading.vue +55 -55
- package/components/global-message/GlobalMessage.md +570 -570
- package/components/global-toast/GlobalToast.md +261 -261
- package/components/global-toast/global-toast.vue +56 -56
- package/components/label-value/open-value-more.vue +56 -56
- package/components/loading/loading.vue +5 -5
- package/components/login-form-box/login-form-box.vue +65 -65
- package/components/phone-login-form/phone-login-form.vue +204 -204
- package/components/privacy-popup/privacy-popup.vue +191 -191
- package/components/scan-input/scan-input.vue +406 -406
- package/components/select-col-picker/select-col-picker.vue +168 -168
- package/components/tab-search/tab-search.vue +73 -73
- package/components/tree-select/components/TreeNode.vue +200 -200
- package/components/tree-select/components/index.vue +471 -471
- package/components/tree-select/components/tree-select.vue +56 -56
- package/components/tree-select/index.vue +93 -93
- package/components/user-choose/user-choose.vue +169 -151
- package/components/video-play/video-play.vue +56 -56
- package/components/wui-auto-update-component/wui-auto-update-component.vue +132 -132
- package/components/wui-default/wui-default.vue +49 -49
- package/components/wui-details-page/wui-details-page.vue +147 -147
- package/components/wui-edit-page/wui-edit-page-copy.vue +757 -757
- package/components/wui-edit-page/wui-edit-page.vue +793 -793
- package/components/wui-login/wui-login.vue +43 -43
- package/components/wui-login1/wui-login.vue +41 -41
- package/components/wui-menus/wui-menus-top.vue +137 -137
- package/components/wui-menus/wui-menus-top1.vue +8 -8
- package/components/wui-menus1/components/banner-carousel.vue +320 -320
- package/components/wui-menus1/components/quick-panel.vue +55 -55
- package/components/wui-menus1/components/search-bar.vue +49 -49
- package/components/wui-menus1/components/section-menus.vue +208 -208
- package/components/wui-menus1/wui-menus-top.vue +718 -718
- package/components/wui-menus1/wui-menus-top1.vue +398 -398
- package/components/wui-notify-info/notify-handle.vue +53 -53
- package/components/wui-scan-binding-sensor/wui-scan-binding-sensor.vue +75 -75
- package/components/wui-search-history-babbar/components/SearchBar.vue +70 -70
- package/components/wui-select-popup/wui-select-popup.vue +1 -0
- package/components/wui-tree-page/wui-tree-page.vue +297 -297
- package/components/wui-update-component/wui-update-component.vue +221 -221
- package/composables/types/theme.ts +65 -65
- package/composables/types/user.ts +5 -5
- package/composables/useColorGenerator.ts +221 -221
- package/composables/useEnumes.ts +43 -43
- package/composables/useEventBus.ts +37 -37
- package/composables/useGlobalLoading.ts +47 -47
- package/composables/useGlobalMessage.ts +53 -53
- package/composables/useGlobalToast.ts +63 -63
- package/composables/useLocale.ts +54 -54
- package/composables/useManualTheme.ts +179 -179
- package/composables/useSectionMenus.ts +120 -120
- package/composables/useTabbar.ts +50 -50
- package/composables/useTheme.ts +74 -74
- package/composables/useUser.ts +24 -24
- package/index.d.ts +90 -90
- package/package.json +24 -24
- package/store/manualThemeStore.ts +143 -143
- package/store/persist.ts +41 -41
- package/store/themeStore.ts +74 -74
- package/store/userStore.ts +22 -22
- package/styles/dark-mode.scss +498 -498
- package/type.ts +154 -154
- package/utils/control-tree.ts +353 -353
- package/utils/eventBus.ts +36 -36
- package/utils/idata-scan.ts +99 -99
- package/utils/index.ts +979 -979
- package/utils/rsaEncrypt.ts +10 -10
package/utils/eventBus.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
// 事件总线实现,用于跨组件通信
|
|
2
|
-
class EventBus {
|
|
3
|
-
private events: { [key: string]: Array<(...args: any[]) => void> } = {}
|
|
4
|
-
|
|
5
|
-
on(event: string, callback: (...args: any[]) => void) {
|
|
6
|
-
if (!this.events[event]) {
|
|
7
|
-
this.events[event] = []
|
|
8
|
-
}
|
|
9
|
-
this.events[event].push(callback)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
off(event: string, callback: (...args: any[]) => void) {
|
|
13
|
-
if (this.events[event]) {
|
|
14
|
-
const index = this.events[event].indexOf(callback)
|
|
15
|
-
if (index > -1) {
|
|
16
|
-
this.events[event].splice(index, 1)
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
emit(event: string, ...args: any[]) {
|
|
22
|
-
if (this.events[event]) {
|
|
23
|
-
this.events[event].forEach(callback => callback(...args))
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
once(event: string, callback: (...args: any[]) => void) {
|
|
28
|
-
const onceCallback = (...args: any[]) => {
|
|
29
|
-
callback(...args)
|
|
30
|
-
this.off(event, onceCallback)
|
|
31
|
-
}
|
|
32
|
-
this.on(event, onceCallback)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const eventBus = new EventBus()
|
|
1
|
+
// 事件总线实现,用于跨组件通信
|
|
2
|
+
class EventBus {
|
|
3
|
+
private events: { [key: string]: Array<(...args: any[]) => void> } = {}
|
|
4
|
+
|
|
5
|
+
on(event: string, callback: (...args: any[]) => void) {
|
|
6
|
+
if (!this.events[event]) {
|
|
7
|
+
this.events[event] = []
|
|
8
|
+
}
|
|
9
|
+
this.events[event].push(callback)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
off(event: string, callback: (...args: any[]) => void) {
|
|
13
|
+
if (this.events[event]) {
|
|
14
|
+
const index = this.events[event].indexOf(callback)
|
|
15
|
+
if (index > -1) {
|
|
16
|
+
this.events[event].splice(index, 1)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
emit(event: string, ...args: any[]) {
|
|
22
|
+
if (this.events[event]) {
|
|
23
|
+
this.events[event].forEach(callback => callback(...args))
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
once(event: string, callback: (...args: any[]) => void) {
|
|
28
|
+
const onceCallback = (...args: any[]) => {
|
|
29
|
+
callback(...args)
|
|
30
|
+
this.off(event, onceCallback)
|
|
31
|
+
}
|
|
32
|
+
this.on(event, onceCallback)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const eventBus = new EventBus()
|
package/utils/idata-scan.ts
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
// 注意:需要在插件市场 安装 安卓原生插件“iData条码扫描插件”,https://ext.dcloud.net.cn/plugin?id=3898#
|
|
2
|
-
interface callback {
|
|
3
|
-
(scanData: any): void
|
|
4
|
-
}
|
|
5
|
-
let barcodeModel: { initScan: (arg0: (ret: any) => void) => void, closeScan: (arg0: (ret: any) => void) => void, scanStop: (arg0: (ret: any) => void) => void, scanStart: (arg0: (ret: any) => void) => void } | null = null
|
|
6
|
-
let globalEvent: {
|
|
7
|
-
addEventListener: (arg0: string, arg1: (e: any) => void) => void
|
|
8
|
-
removeEventListener: (arg0: string) => void
|
|
9
|
-
} | null = null
|
|
10
|
-
|
|
11
|
-
// 初始化手持机扫码模块
|
|
12
|
-
function initBarcode(callback: callback) {
|
|
13
|
-
// #ifdef APP-PLUS
|
|
14
|
-
console.log('initBarcode')
|
|
15
|
-
|
|
16
|
-
// 获取手持机扫描module
|
|
17
|
-
barcodeModel = uni.requireNativePlugin('iData-BarcodePlugin-BarcodeModule')
|
|
18
|
-
|
|
19
|
-
if (!barcodeModel) {
|
|
20
|
-
return uni.showToast({
|
|
21
|
-
icon: 'none',
|
|
22
|
-
title: '请在插件市场安装安卓原生插件“iData条码扫描插件”',
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
// 初始化
|
|
26
|
-
barcodeModel.initScan(() => {
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
// 页面监听event事件,建议在页面onLoad方法里调用
|
|
31
|
-
globalEvent = uni.requireNativePlugin('globalEvent')
|
|
32
|
-
|
|
33
|
-
if (globalEvent) {
|
|
34
|
-
globalEvent.addEventListener('iDataBarcodeEvent', (e: any) => {
|
|
35
|
-
console.log(`收到条码:${e.barcode}`)
|
|
36
|
-
// 判断是否登录
|
|
37
|
-
const token = uni.getStorageSync('token')
|
|
38
|
-
if (!token) {
|
|
39
|
-
return uni.showModal({
|
|
40
|
-
title: '提示',
|
|
41
|
-
content: '请登录,才可使用扫码功能',
|
|
42
|
-
success(res) {
|
|
43
|
-
if (res.confirm) {
|
|
44
|
-
console.log('用户点击确定')
|
|
45
|
-
uni.reLaunch({
|
|
46
|
-
url: '/pages/login/login',
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
else if (res.cancel) {
|
|
50
|
-
console.log('用户点击取消')
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
callback(e)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// #endif
|
|
60
|
-
}
|
|
61
|
-
function closeBarcode() {
|
|
62
|
-
// #ifdef APP-PLUS
|
|
63
|
-
// 建议在页面onExit方法里调用
|
|
64
|
-
// 接口closeScan(UniJSCallback callback)
|
|
65
|
-
// 结束扫描
|
|
66
|
-
barcodeModel?.closeScan((ret: any) => {
|
|
67
|
-
console.log(ret)
|
|
68
|
-
})
|
|
69
|
-
// #endif
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function stopBarcode() {
|
|
73
|
-
// #ifdef APP-PLUS
|
|
74
|
-
/// 手动调用
|
|
75
|
-
// 停止扫描
|
|
76
|
-
// 接口scanStop(UniJSCallback callback)
|
|
77
|
-
globalEvent?.removeEventListener('iDataBarcodeEvent')
|
|
78
|
-
barcodeModel?.scanStop((ret) => {
|
|
79
|
-
console.log(ret)
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
// #endif
|
|
83
|
-
}
|
|
84
|
-
function startBarcode() {
|
|
85
|
-
// #ifdef APP-PLUS
|
|
86
|
-
// 手动调用
|
|
87
|
-
// 开始扫描
|
|
88
|
-
// 接口scanStop(UniJSCallback callback)
|
|
89
|
-
barcodeModel?.scanStart((ret) => {
|
|
90
|
-
console.log(ret)
|
|
91
|
-
})
|
|
92
|
-
// #endif
|
|
93
|
-
}
|
|
94
|
-
export default {
|
|
95
|
-
initBarcode,
|
|
96
|
-
closeBarcode,
|
|
97
|
-
stopBarcode,
|
|
98
|
-
startBarcode,
|
|
99
|
-
}
|
|
1
|
+
// 注意:需要在插件市场 安装 安卓原生插件“iData条码扫描插件”,https://ext.dcloud.net.cn/plugin?id=3898#
|
|
2
|
+
interface callback {
|
|
3
|
+
(scanData: any): void
|
|
4
|
+
}
|
|
5
|
+
let barcodeModel: { initScan: (arg0: (ret: any) => void) => void, closeScan: (arg0: (ret: any) => void) => void, scanStop: (arg0: (ret: any) => void) => void, scanStart: (arg0: (ret: any) => void) => void } | null = null
|
|
6
|
+
let globalEvent: {
|
|
7
|
+
addEventListener: (arg0: string, arg1: (e: any) => void) => void
|
|
8
|
+
removeEventListener: (arg0: string) => void
|
|
9
|
+
} | null = null
|
|
10
|
+
|
|
11
|
+
// 初始化手持机扫码模块
|
|
12
|
+
function initBarcode(callback: callback) {
|
|
13
|
+
// #ifdef APP-PLUS
|
|
14
|
+
console.log('initBarcode')
|
|
15
|
+
|
|
16
|
+
// 获取手持机扫描module
|
|
17
|
+
barcodeModel = uni.requireNativePlugin('iData-BarcodePlugin-BarcodeModule')
|
|
18
|
+
|
|
19
|
+
if (!barcodeModel) {
|
|
20
|
+
return uni.showToast({
|
|
21
|
+
icon: 'none',
|
|
22
|
+
title: '请在插件市场安装安卓原生插件“iData条码扫描插件”',
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
// 初始化
|
|
26
|
+
barcodeModel.initScan(() => {
|
|
27
|
+
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
// 页面监听event事件,建议在页面onLoad方法里调用
|
|
31
|
+
globalEvent = uni.requireNativePlugin('globalEvent')
|
|
32
|
+
|
|
33
|
+
if (globalEvent) {
|
|
34
|
+
globalEvent.addEventListener('iDataBarcodeEvent', (e: any) => {
|
|
35
|
+
console.log(`收到条码:${e.barcode}`)
|
|
36
|
+
// 判断是否登录
|
|
37
|
+
const token = uni.getStorageSync('token')
|
|
38
|
+
if (!token) {
|
|
39
|
+
return uni.showModal({
|
|
40
|
+
title: '提示',
|
|
41
|
+
content: '请登录,才可使用扫码功能',
|
|
42
|
+
success(res) {
|
|
43
|
+
if (res.confirm) {
|
|
44
|
+
console.log('用户点击确定')
|
|
45
|
+
uni.reLaunch({
|
|
46
|
+
url: '/pages/login/login',
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
else if (res.cancel) {
|
|
50
|
+
console.log('用户点击取消')
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
callback(e)
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// #endif
|
|
60
|
+
}
|
|
61
|
+
function closeBarcode() {
|
|
62
|
+
// #ifdef APP-PLUS
|
|
63
|
+
// 建议在页面onExit方法里调用
|
|
64
|
+
// 接口closeScan(UniJSCallback callback)
|
|
65
|
+
// 结束扫描
|
|
66
|
+
barcodeModel?.closeScan((ret: any) => {
|
|
67
|
+
console.log(ret)
|
|
68
|
+
})
|
|
69
|
+
// #endif
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function stopBarcode() {
|
|
73
|
+
// #ifdef APP-PLUS
|
|
74
|
+
/// 手动调用
|
|
75
|
+
// 停止扫描
|
|
76
|
+
// 接口scanStop(UniJSCallback callback)
|
|
77
|
+
globalEvent?.removeEventListener('iDataBarcodeEvent')
|
|
78
|
+
barcodeModel?.scanStop((ret) => {
|
|
79
|
+
console.log(ret)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
// #endif
|
|
83
|
+
}
|
|
84
|
+
function startBarcode() {
|
|
85
|
+
// #ifdef APP-PLUS
|
|
86
|
+
// 手动调用
|
|
87
|
+
// 开始扫描
|
|
88
|
+
// 接口scanStop(UniJSCallback callback)
|
|
89
|
+
barcodeModel?.scanStart((ret) => {
|
|
90
|
+
console.log(ret)
|
|
91
|
+
})
|
|
92
|
+
// #endif
|
|
93
|
+
}
|
|
94
|
+
export default {
|
|
95
|
+
initBarcode,
|
|
96
|
+
closeBarcode,
|
|
97
|
+
stopBarcode,
|
|
98
|
+
startBarcode,
|
|
99
|
+
}
|