uni-oaview 1.1.9 → 1.1.11
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/components/oa-select/oa-select.vue +6 -6
- package/dist/index.d.ts +24 -3
- package/dist/index.esm.js +3026 -5
- package/package.json +6 -1
- package/src/composables/index.ts +1 -0
- package/src/composables/use-cookie-tempurl.ts +36 -0
- package/src/index.ts +1 -0
- package/src/utils/app-version.ts +8 -4
- package/src/utils/cookie-image.ts +20 -0
- package/src/utils/index.ts +1 -0
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
:modelValue="modelValue"
|
|
17
17
|
@update:model-value="($event) => emit('update:modelValue', $event)"
|
|
18
18
|
:options="options"
|
|
19
|
-
@change="changeHandler"
|
|
20
19
|
@select-change="($event) => emit('change', $event)"
|
|
21
20
|
>
|
|
22
21
|
<!-- 透传作用域插槽内容到孙子组件 -->
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
</oa-select-popup>
|
|
27
26
|
</template>
|
|
28
27
|
<script lang="ts" setup>
|
|
29
|
-
import { ref } from 'vue';
|
|
28
|
+
import { ref, computed } from 'vue';
|
|
30
29
|
import OaSelectPopup from '../oa-select-popup/oa-select-popup.vue';
|
|
31
30
|
const props = defineProps<{
|
|
32
31
|
title?: string;
|
|
@@ -36,11 +35,12 @@
|
|
|
36
35
|
valueKey?: string;
|
|
37
36
|
}>();
|
|
38
37
|
const popupShow = ref(false);
|
|
39
|
-
const currentLabel = ref('');
|
|
40
38
|
const emit = defineEmits(['change', 'close', 'update:modelValue']);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const currentLabel = computed(() => {
|
|
40
|
+
return props.options.find((item) => item[props.valueKey ?? 'value'] === props.modelValue)?.[
|
|
41
|
+
props.labelKey ?? 'label'
|
|
42
|
+
];
|
|
43
|
+
});
|
|
44
44
|
</script>
|
|
45
45
|
<style lang="scss" scoped>
|
|
46
46
|
.oa-select {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _mp_rt1_vue___Ref from 'vue';
|
|
1
2
|
import { App } from 'vue';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -15,12 +16,13 @@ declare function getAppVersion(): string;
|
|
|
15
16
|
* 比较两个版本号
|
|
16
17
|
* @param versionA
|
|
17
18
|
* @param versionB
|
|
18
|
-
* @returns
|
|
19
|
+
* @returns 1: versionA > versionB, -1: versionA < versionB, 0: versionA == versionB, -2: 无效的版本格式
|
|
19
20
|
*/
|
|
20
21
|
declare function compareVersions(versionA: string, versionB: string): number;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
* 判断当前版本是否高于或等于传入版本,如果低于,则弹出提示框
|
|
23
24
|
* @param version
|
|
25
|
+
* @param warningText 提示文本,如果为空,则使用默认文本
|
|
24
26
|
* @returns
|
|
25
27
|
*/
|
|
26
28
|
declare function isCurrentVersionHigher(appVersion: string, warningText?: string): boolean;
|
|
@@ -64,6 +66,25 @@ declare const Message: {
|
|
|
64
66
|
*/
|
|
65
67
|
declare function createDebounceFn(callback: (...params: any[]) => void, time: number): (...params: any[]) => void;
|
|
66
68
|
|
|
69
|
+
/**
|
|
70
|
+
* 根据cookie获取临时文件路径,其中cookie默认为uni.getStorageSync('cookie')
|
|
71
|
+
* @param url 例如:'/api/bizhub/visitor/getVisitorQRCode'
|
|
72
|
+
* @param cookie 默认为uni.getStorageSync('cookie')
|
|
73
|
+
* @returns 临时文件路径
|
|
74
|
+
*/
|
|
75
|
+
declare function getTempFilePathForCookie(url: string, cookie?: string): Promise<string>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 通过cookie获取临时文件url
|
|
79
|
+
* @param url 文件url,例如:'/api/bizhub/visitor/getVisitorQRCode'
|
|
80
|
+
*/
|
|
81
|
+
declare function useCookieTempFileUrl(url: string): {
|
|
82
|
+
/**
|
|
83
|
+
* 临时文件url
|
|
84
|
+
*/
|
|
85
|
+
tempUrl: _mp_rt1_vue___Ref<string>;
|
|
86
|
+
};
|
|
87
|
+
|
|
67
88
|
declare const _default: {
|
|
68
89
|
install: (app: App<Element>) => void;
|
|
69
90
|
};
|
|
@@ -76,4 +97,4 @@ declare const _default: {
|
|
|
76
97
|
*/
|
|
77
98
|
declare function getDataByApp(eventName: string, params: Record<string, any>, immediate?: boolean): Promise<any>;
|
|
78
99
|
|
|
79
|
-
export { Message, compareVersions, createDebounceFn, _default as default, getAppVersion, getDataByApp, isCurrentVersionHigher, sendLaunchAppParamsLog };
|
|
100
|
+
export { Message, compareVersions, createDebounceFn, _default as default, getAppVersion, getDataByApp, getTempFilePathForCookie, isCurrentVersionHigher, sendLaunchAppParamsLog, useCookieTempFileUrl };
|