wui-components-v2 1.1.68 → 1.1.70

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.
Files changed (47) hide show
  1. package/api/core/index.ts +74 -74
  2. package/api/menu.ts +45 -45
  3. package/api/page.ts +114 -114
  4. package/api/sys.ts +12 -12
  5. package/components/action-popup/action-popup.vue +46 -17
  6. package/components/add-address-page/add-address-page.vue +77 -77
  7. package/components/custom-date-picker/custom-date-picker.vue +106 -106
  8. package/components/custom-select-picker/custom-select-picker.vue +95 -95
  9. package/components/demo-block/demo-block.vue +63 -63
  10. package/components/detail-popup/detail-popup.vue +99 -99
  11. package/components/evaluation-page/evaluation-page.vue +196 -192
  12. package/components/fold-card/fold-card.vue +171 -171
  13. package/components/form-control/form-control.vue +661 -661
  14. package/components/global-message/global-message.vue +68 -68
  15. package/components/label-value/label-value.vue +144 -144
  16. package/components/list-top-buttons/list-top-buttons.vue +19 -19
  17. package/components/login-form/login-form.vue +126 -126
  18. package/components/mulselect-picker/mulselect-picker.vue +86 -86
  19. package/components/product-card/product-card.vue +201 -201
  20. package/components/search/search.vue +128 -128
  21. package/components/user-choose/user-choose.vue +1 -1
  22. package/components/wui-enume-select-control/wui-enume-select-control.vue +92 -92
  23. package/components/wui-list/wui-list.vue +235 -235
  24. package/components/wui-menus/wui-menus.vue +247 -247
  25. package/components/wui-menus1/components/navbar.vue +43 -43
  26. package/components/wui-menus1/wui-menus.vue +564 -564
  27. package/components/wui-notify-info/wui-notify-info.vue +280 -280
  28. package/components/wui-search-history-babbar/wui-search-history-babbar.vue +204 -204
  29. package/components/wui-select-list/wui-select-list.vue +310 -310
  30. package/components/wui-select-popup/wui-select-popup.vue +612 -612
  31. package/components/wui-system-settings/wui-system-settings.vue +144 -144
  32. package/components/wui-tabbar/wui-tabbar.vue +106 -106
  33. package/components/wui-tree-page/components/tree-item.vue +238 -238
  34. package/components/wui-user/wui-user.vue +202 -197
  35. package/composables/useCompanyFieldFilter.ts +91 -91
  36. package/composables/useEnumes.ts +2 -2
  37. package/composables/useMenus.ts +193 -193
  38. package/index.ts +83 -83
  39. package/package.json +1 -1
  40. package/static/iconfont/iconfont.css +63 -63
  41. package/store/language.ts +151 -151
  42. package/styles/dark-mode.css +523 -485
  43. package/styles/dark-mode.min.css +1 -1
  44. package/styles/dark-mode.scss +28 -0
  45. package/type.ts +2 -2
  46. package/utils/control-tree.ts +2 -2
  47. package/utils/control-type-supportor.ts +148 -148
@@ -1,126 +1,126 @@
1
- <script setup lang="ts">
2
- import { defineOptions, defineProps, reactive, ref } from 'vue'
3
- import { useRouter } from 'uni-mini-router'
4
- import { useGlobalToast } from '../../composables/useGlobalToast'
5
- import { getUserConfig, login } from '../../api/login'
6
- import { useUser } from '../../composables/useUser'
7
- import { useTabbar } from '../../composables/useTabbar'
8
- import type { TabbarItem } from '../../composables/useTabbar'
9
-
10
- defineOptions({
11
- name: 'LoginForm',
12
- })
13
-
14
- const props = defineProps<Props>()
15
- // 定义 Props 类型
16
- interface Props {
17
- tabbarItems: TabbarItem[]
18
- }
19
- const subloading = ref(false)
20
- const router = useRouter()
21
- const toast = useGlobalToast()
22
- const { setUserInfo } = useUser()
23
- const model = reactive<{
24
- name: string
25
- password: string
26
- remember: boolean
27
- }>({
28
- name: uni.getStorageSync('USER_NAME') || '',
29
- password: uni.getStorageSync('USER_PASSWORD') || '',
30
- remember: uni.getStorageSync('REMEMBER') || false,
31
- })
32
- const { setTabbarItemActive } = useTabbar(props.tabbarItems)
33
- const form = ref()
34
-
35
- // 提交登录表单
36
- function handleSubmit() {
37
- form.value
38
- .validate()
39
- .then(async ({ valid, errors }: any) => {
40
- if (valid) {
41
- try {
42
- subloading.value = true
43
- // 登录
44
- const res = await login(model.name, model.password)
45
-
46
- if (res.token) {
47
- // 保存token
48
- uni.setStorageSync('TOKEN', res.token)
49
- // 获取用户配置
50
- const res1 = await getUserConfig()
51
- if (res1.status === 'success') {
52
- // 保存用户信息
53
- setUserInfo(res1.user)
54
-
55
- // 记住账号密码
56
- if (model.remember) {
57
- uni.setStorageSync('USER_NAME', model.name)
58
- uni.setStorageSync('USER_PASSWORD', model.password)
59
- uni.setStorageSync('REMEMBER', model.remember)
60
- } else {
61
- // 删除账号密码
62
- uni.removeStorageSync('USER_NAME')
63
- uni.removeStorageSync('USER_PASSWORD')
64
- uni.removeStorageSync('REMEMBER')
65
- }
66
-
67
- // 跳转首页
68
- router.pushTab('/pages/index/index')
69
- setTabbarItemActive('index')
70
- toast.success({ msg: '登录成功!' })
71
- }
72
- } else {
73
- toast.error({ msg: res.message })
74
- }
75
- } catch (error: any) {
76
- console.log(error, 'error')
77
- }
78
- } else {
79
- toast.error({ msg: '请填写登录信息' })
80
- console.log(errors, 'errors')
81
- }
82
- subloading.value = false
83
- })
84
- .catch((error: any) => {
85
- toast.error({ msg: error })
86
- console.log(error, 'error')
87
- })
88
- }
89
- </script>
90
-
91
- <template>
92
- <view class="bg-white pa-3 dark:bg-[var(--wot-dark-background2)]">
93
- <!-- //账号登录 -->
94
- <wd-form ref="form" :model="model">
95
- <view class="rounded-2 overflow-hidden">
96
- <wd-cell-group border>
97
- <wd-input
98
- v-model="model.name"
99
- label="用户名"
100
- label-width="100px"
101
- prop="name"
102
- clearable
103
- placeholder="请输入用户名"
104
- :rules="[{ required: true, message: '请填写用户名' }]"
105
- />
106
- <wd-input
107
- v-model="model.password"
108
- label="密码"
109
- label-width="100px"
110
- prop="password"
111
- clearable
112
- show-password
113
- placeholder="请输入密码"
114
- :rules="[{ required: true, message: '请填写密码' }]"
115
- />
116
- <view class="p-4 pb-0 pt-0 dark:bg-[#1b1b1e]">
117
- <wd-checkbox v-model="model.remember" shape="square">记住密码</wd-checkbox>
118
- </view>
119
- </wd-cell-group>
120
- </view>
121
- <view class="p-4">
122
- <wd-button block :loading="subloading" :round="false" @click="handleSubmit">登录</wd-button>
123
- </view>
124
- </wd-form>
125
- </view>
126
- </template>
1
+ <script setup lang="ts">
2
+ import { defineOptions, defineProps, reactive, ref } from 'vue'
3
+ import { useRouter } from 'uni-mini-router'
4
+ import { useGlobalToast } from '../../composables/useGlobalToast'
5
+ import { getUserConfig, login } from '../../api/login'
6
+ import { useUser } from '../../composables/useUser'
7
+ import { useTabbar } from '../../composables/useTabbar'
8
+ import type { TabbarItem } from '../../composables/useTabbar'
9
+
10
+ defineOptions({
11
+ name: 'LoginForm',
12
+ })
13
+
14
+ const props = defineProps<Props>()
15
+ // 定义 Props 类型
16
+ interface Props {
17
+ tabbarItems: TabbarItem[]
18
+ }
19
+ const subloading = ref(false)
20
+ const router = useRouter()
21
+ const toast = useGlobalToast()
22
+ const { setUserInfo } = useUser()
23
+ const model = reactive<{
24
+ name: string
25
+ password: string
26
+ remember: boolean
27
+ }>({
28
+ name: uni.getStorageSync('USER_NAME') || '',
29
+ password: uni.getStorageSync('USER_PASSWORD') || '',
30
+ remember: uni.getStorageSync('REMEMBER') || false,
31
+ })
32
+ const { setTabbarItemActive } = useTabbar(props.tabbarItems)
33
+ const form = ref()
34
+
35
+ // 提交登录表单
36
+ function handleSubmit() {
37
+ form.value
38
+ .validate()
39
+ .then(async ({ valid, errors }: any) => {
40
+ if (valid) {
41
+ try {
42
+ subloading.value = true
43
+ // 登录
44
+ const res = await login(model.name, model.password)
45
+
46
+ if (res.token) {
47
+ // 保存token
48
+ uni.setStorageSync('TOKEN', res.token)
49
+ // 获取用户配置
50
+ const res1 = await getUserConfig()
51
+ if (res1.status === 'success') {
52
+ // 保存用户信息
53
+ setUserInfo(res1.user)
54
+
55
+ // 记住账号密码
56
+ if (model.remember) {
57
+ uni.setStorageSync('USER_NAME', model.name)
58
+ uni.setStorageSync('USER_PASSWORD', model.password)
59
+ uni.setStorageSync('REMEMBER', model.remember)
60
+ } else {
61
+ // 删除账号密码
62
+ uni.removeStorageSync('USER_NAME')
63
+ uni.removeStorageSync('USER_PASSWORD')
64
+ uni.removeStorageSync('REMEMBER')
65
+ }
66
+
67
+ // 跳转首页
68
+ router.pushTab('/pages/index/index')
69
+ setTabbarItemActive('index')
70
+ toast.success({ msg: '登录成功!' })
71
+ }
72
+ } else {
73
+ toast.error({ msg: res.message })
74
+ }
75
+ } catch (error: any) {
76
+ console.log(error, 'error')
77
+ }
78
+ } else {
79
+ toast.error({ msg: '请填写登录信息' })
80
+ console.log(errors, 'errors')
81
+ }
82
+ subloading.value = false
83
+ })
84
+ .catch((error: any) => {
85
+ toast.error({ msg: error })
86
+ console.log(error, 'error')
87
+ })
88
+ }
89
+ </script>
90
+
91
+ <template>
92
+ <view class="bg-white pa-3 dark:bg-[var(--wot-dark-background2)]">
93
+ <!-- //账号登录 -->
94
+ <wd-form ref="form" :model="model">
95
+ <view class="rounded-2 overflow-hidden">
96
+ <wd-cell-group border>
97
+ <wd-input
98
+ v-model="model.name"
99
+ label="用户名"
100
+ label-width="100px"
101
+ prop="name"
102
+ clearable
103
+ placeholder="请输入用户名"
104
+ :rules="[{ required: true, message: '请填写用户名' }]"
105
+ />
106
+ <wd-input
107
+ v-model="model.password"
108
+ label="密码"
109
+ label-width="100px"
110
+ prop="password"
111
+ clearable
112
+ show-password
113
+ placeholder="请输入密码"
114
+ :rules="[{ required: true, message: '请填写密码' }]"
115
+ />
116
+ <view class="p-4 pb-0 pt-0 dark:bg-[#1b1b1e]">
117
+ <wd-checkbox v-model="model.remember" shape="square">记住密码</wd-checkbox>
118
+ </view>
119
+ </wd-cell-group>
120
+ </view>
121
+ <view class="p-4">
122
+ <wd-button block :loading="subloading" :round="false" @click="handleSubmit">登录</wd-button>
123
+ </view>
124
+ </wd-form>
125
+ </view>
126
+ </template>
@@ -1,86 +1,86 @@
1
- <script setup lang="ts">
2
- import { computed, defineOptions, defineProps, ref, toRaw } from 'vue'
3
- import { useRouter } from 'uni-mini-router'
4
- import { generateHighResolutionID } from '../../utils/index'
5
- import type { FoldCardModel } from '../../type'
6
-
7
- defineOptions({
8
- name: 'MulselectPicker',
9
- })
10
-
11
- const props = defineProps<{
12
- extControlType: string // 选择模式,例如:单选:relselect、多选
13
- sourceId: string
14
- title?: string
15
- modelValue: string | Array<string>
16
- readonly: boolean
17
- clearable: boolean
18
- foldCardModel?: FoldCardModel // 折叠面板模式
19
- }>()
20
- const emits = defineEmits<{
21
- (e: 'update:modelValue', value: string | string[]): void
22
- }>()
23
- const selectData = ref<string | string[]>(props.modelValue)
24
- const selectformatData = computed(() => {
25
- if (Array.isArray(selectData.value)) {
26
- return selectData.value.map(item => item.split('@R@')[1]).join(',')
27
- }
28
- return selectData.value?.split('@R@')[1] || ''
29
- })
30
- const router = useRouter()
31
- // 全局事件名称
32
- const SELECTEVENT = generateHighResolutionID()
33
- const SENDSELECTEVENT = generateHighResolutionID()
34
- function gotoSlect() {
35
- if (props.readonly) return
36
- router.push(
37
- `/pages/select-list/index?sourceId=${props.sourceId}&title=${props.title}&selectEvent=${SELECTEVENT}&sendSelectEvent=${SENDSELECTEVENT}&extControlType=${props.extControlType}&foldCardModel=${props.foldCardModel}`
38
- )
39
- // 发送数据给选择页面,延迟发送防止页面不刷新
40
- setTimeout(() => {
41
- uni.$emit(SENDSELECTEVENT, toRaw(selectData.value))
42
- }, 100)
43
-
44
- // 接收勾选页面发送过来的数据
45
- uni.$once(SELECTEVENT, (data: any) => {
46
- selectData.value = data
47
- emits('update:modelValue', data)
48
- })
49
- }
50
-
51
- // 清空勾选
52
- function clearSelect() {
53
- // 清空单选
54
- if (props.extControlType === 'relselect') {
55
- selectData.value = ''
56
- emits('update:modelValue', '')
57
- } else {
58
- selectData.value = []
59
- emits('update:modelValue', [])
60
- }
61
- }
62
- </script>
63
-
64
- <template>
65
- <view class="relative" @click="gotoSlect">
66
- <view class="flex justify-between text-left">
67
- <view class="flex-1">
68
- <text v-if="selectformatData">
69
- {{ selectformatData }}
70
- </text>
71
- <text v-else class="text-gray-400">请选择{{ title }}</text>
72
- </view>
73
- <view class="h-3px w-17px" />
74
- </view>
75
- <view v-if="clearable" class="absolute bottom-0 right-0 top-0">
76
- <wd-icon v-if="selectformatData" name="close-circle" size="17px" @click.stop="clearSelect" />
77
- <wd-icon v-else name="right" size="17px" />
78
- </view>
79
- </view>
80
- </template>
81
-
82
- <style scoped>
83
- :deep(.wd-tag__close) {
84
- line-height: 0.6;
85
- }
86
- </style>
1
+ <script setup lang="ts">
2
+ import { computed, defineOptions, defineProps, ref, toRaw } from 'vue'
3
+ import { useRouter } from 'uni-mini-router'
4
+ import { generateHighResolutionID } from '../../utils/index'
5
+ import type { FoldCardModel } from '../../type'
6
+
7
+ defineOptions({
8
+ name: 'MulselectPicker',
9
+ })
10
+
11
+ const props = defineProps<{
12
+ extControlType: string // 选择模式,例如:单选:relselect、多选
13
+ sourceId: string
14
+ title?: string
15
+ modelValue: string | Array<string>
16
+ readonly: boolean
17
+ clearable: boolean
18
+ foldCardModel?: FoldCardModel // 折叠面板模式
19
+ }>()
20
+ const emits = defineEmits<{
21
+ (e: 'update:modelValue', value: string | string[]): void
22
+ }>()
23
+ const selectData = ref<string | string[]>(props.modelValue)
24
+ const selectformatData = computed(() => {
25
+ if (Array.isArray(selectData.value)) {
26
+ return selectData.value.map(item => item.split('@R@')[1]).join(',')
27
+ }
28
+ return selectData.value?.split('@R@')[1] || ''
29
+ })
30
+ const router = useRouter()
31
+ // 全局事件名称
32
+ const SELECTEVENT = generateHighResolutionID()
33
+ const SENDSELECTEVENT = generateHighResolutionID()
34
+ function gotoSlect() {
35
+ if (props.readonly) return
36
+ router.push(
37
+ `/pages/select-list/index?sourceId=${props.sourceId}&title=${props.title}&selectEvent=${SELECTEVENT}&sendSelectEvent=${SENDSELECTEVENT}&extControlType=${props.extControlType}&foldCardModel=${props.foldCardModel}`
38
+ )
39
+ // 发送数据给选择页面,延迟发送防止页面不刷新
40
+ setTimeout(() => {
41
+ uni.$emit(SENDSELECTEVENT, toRaw(selectData.value))
42
+ }, 100)
43
+
44
+ // 接收勾选页面发送过来的数据
45
+ uni.$once(SELECTEVENT, (data: any) => {
46
+ selectData.value = data
47
+ emits('update:modelValue', data)
48
+ })
49
+ }
50
+
51
+ // 清空勾选
52
+ function clearSelect() {
53
+ // 清空单选
54
+ if (props.extControlType === 'relselect') {
55
+ selectData.value = ''
56
+ emits('update:modelValue', '')
57
+ } else {
58
+ selectData.value = []
59
+ emits('update:modelValue', [])
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <template>
65
+ <view class="relative" @click="gotoSlect">
66
+ <view class="flex justify-between text-left">
67
+ <view class="flex-1">
68
+ <text v-if="selectformatData">
69
+ {{ selectformatData }}
70
+ </text>
71
+ <text v-else class="text-gray-400">请选择{{ title }}</text>
72
+ </view>
73
+ <view class="h-3px w-17px" />
74
+ </view>
75
+ <view v-if="clearable" class="absolute bottom-0 right-0 top-0">
76
+ <wd-icon v-if="selectformatData" name="close-circle" size="17px" @click.stop="clearSelect" />
77
+ <wd-icon v-else name="right" size="17px" />
78
+ </view>
79
+ </view>
80
+ </template>
81
+
82
+ <style scoped>
83
+ :deep(.wd-tag__close) {
84
+ line-height: 0.6;
85
+ }
86
+ </style>