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,235 +1,235 @@
1
- <script lang="ts" setup>
2
- import { defineOptions, defineProps, onMounted, onUnmounted, ref } from 'vue'
3
- import { onLoad } from '@dcloudio/uni-app'
4
- import { listData, pageConfig, pageKey } from '../../api/page'
5
- import foldCard from '../fold-card/fold-card.vue'
6
- import type { Config, Entities } from '../../type'
7
- import Search from '../search/search.vue'
8
- import ListTopButtons from '../list-top-buttons/list-top-buttons.vue'
9
- import CardBotomButtons from '../card-botom-buttons/card-botom-buttons.vue'
10
- import { generateHighResolutionID } from '../../utils/index'
11
- import productCard from '../product-card/product-card.vue'
12
- import tabSearch from '../tab-search/tab-search.vue'
13
- import { useEnums } from '../../composables/useEnumes'
14
-
15
- defineOptions({
16
- name: 'WuiList',
17
- })
18
- defineProps<{
19
- detailButtonHandle?: (data: Entities) => void
20
- }>()
21
-
22
- const Zpaging = ref<any>(null)
23
- const config = ref<Config>({
24
- buttons: [],
25
- columns: [],
26
- primaryColumn: {
27
- sourceId: '',
28
- controlType: '',
29
- mstrucId: '',
30
- extControlType: '',
31
- },
32
- primaryCriteria: {
33
- hidden: false,
34
- disabled: false,
35
- defaultValue: '',
36
- transDefaultValue: '',
37
- required: false,
38
- controlType: '',
39
- sourceId: '',
40
- mstrucId: '',
41
- extControlType: '',
42
- },
43
- secondColumn: {
44
- sourceId: '',
45
- controlType: '',
46
- mstrucId: '',
47
- extControlType: '',
48
- },
49
- criterias: [],
50
- id: '',
51
- fields: [],
52
- title: '',
53
- type: '',
54
- pointSourceId: '',
55
- mstrucId: '',
56
- relationNames: [],
57
- readOnly: false,
58
- displayConfig: [],
59
- showType: 'table',
60
- })
61
- const { getEnums, enumColumn } = useEnums({ config })
62
- const sourceId = ref('')
63
- const datas = ref<Entities[]>([])
64
- const pageTitle = ref('')
65
- const searchData = ref('')
66
- const tabSearchData = ref('')
67
- const pageType = ref('')
68
- const mainCode = ref('')
69
- const addEvent = generateHighResolutionID()// 全局事件名称
70
- onLoad((option: any) => {
71
- console.log(option)
72
- sourceId.value = option.sourceId
73
- pageTitle.value = option.title
74
- pageType.value = option.pageType
75
- mainCode.value = option.mainCode || ''
76
- uni.setNavigationBarTitle({
77
- title: option.title,
78
- })
79
- getPageConfig()
80
- })
81
- onMounted(async () => {
82
- console.log('mounted')
83
- // 监听添加成功的事件
84
- uni.$on(addEvent, async () => {
85
- Zpaging.value.reload()
86
- })
87
- })
88
- // 在组件卸载时解绑全局事件
89
- onUnmounted(() => {
90
- console.log(`${pageTitle.value}页面卸载`)
91
- uni.$off(addEvent)
92
- })
93
- async function getPageConfig() {
94
- try {
95
- const res = await pageConfig(sourceId.value)
96
- if (res.ltmplConfig) {
97
- config.value = res.ltmplConfig
98
- console.log('config', config.value)
99
- getEnums()
100
- }
101
- }
102
- catch (error) {
103
- console.log(error)
104
- }
105
- }
106
-
107
- // @query所绑定的方法不要自己调用!!需要刷新列表数据时,只需要调用this.$refs.paging.reload()即可
108
- async function queryList(pageNo: number, pageSize: number) {
109
- // 此处请求仅为演示,请替换为自己项目中的请求
110
- // request.queryList({ pageNo,pageSize }).then(res => {
111
- // 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
112
- // paging.value.complete(res.data.list);
113
- // }).catch(res => {
114
- // 如果请求失败写paging.value.complete(false);
115
- // 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
116
- // 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
117
- // paging.value.complete(false);
118
- // paging.value.reload() // 手动触发加载
119
- // })
120
- let qre = tabSearchData.value || searchData.value
121
- if (config.value.defaultCriteriaValue) {
122
- for (const key in config.value.defaultCriteriaValue) {
123
- if (Object.prototype.hasOwnProperty.call(config.value.defaultCriteriaValue, key)) {
124
- const element = config.value.defaultCriteriaValue[key]
125
- if (!qre.includes(key)) {
126
- qre = `${qre}&${key}=${element}`
127
- }
128
- }
129
- }
130
- }
131
-
132
- try {
133
- const res = await pageKey(sourceId.value, mainCode.value, qre)// 获取key
134
- const data = await listData(res.key, pageNo, pageSize)// 获取数据
135
- // const count = await getPageTotal(key.data?.key)// 获取总数
136
- Zpaging.value.complete(data.entities)
137
-
138
- // emits('loadData', data.data.entities)
139
- }
140
- catch (error) {
141
- if (Zpaging.value) {
142
- Zpaging.value.complete(false)
143
- }
144
- console.error(error)
145
- }
146
- }
147
-
148
- function submitSearch(data: any) {
149
- searchData.value = data
150
- // for (const key in data) {
151
- // if (Object.prototype.hasOwnProperty.call(data, key)) {
152
- // const element = data[key]
153
- // searchData.value = `${searchData.value}&c_${key}=${element}`
154
- // }
155
- // }
156
- Zpaging.value.reload()
157
- }
158
-
159
- // tabSearch点击事件
160
- function tabSearchClick(data: any) {
161
- if (searchData.value) {
162
- tabSearchData.value = `${searchData.value}&${data}`
163
- }
164
- else {
165
- tabSearchData.value = data
166
- }
167
-
168
- Zpaging.value.reload()
169
- }
170
- </script>
171
-
172
- <template>
173
- <z-paging
174
- ref="Zpaging" v-model="datas" :default-page-size="5" :show-loading-more-when-reload="true"
175
- @query="queryList"
176
- >
177
- <template #top>
178
- <slot name="top" />
179
- <Search
180
- :main-code="mainCode" :enum-column="enumColumn" :criterias="config.criterias"
181
- :primary-criteria="config.primaryCriteria" :split2-tab-criterias="config.split2TabCriterias"
182
- @submit="submitSearch"
183
- />
184
- <view>
185
- <ListTopButtons
186
- :add-event="addEvent" :main-code="mainCode" :buttons="config.buttons" :source-id="sourceId"
187
- :page-title="pageTitle" :page-type="pageType"
188
- :config="config"
189
- />
190
- </view>
191
- <!-- 自定义tab搜索 -->
192
- <view v-if="config.split2TabCriterias">
193
- <tabSearch :split2-tab-criterias="config.split2TabCriterias" :enums="enumColumn" @click="tabSearchClick" />
194
- </view>
195
- </template>
196
- <view v-if="config.showType === 'cardList'">
197
- <productCard
198
- v-for="(item, index) in datas" :key="item.code" :index="index" :enum-column="enumColumn"
199
- :collapse-num="5" :source-id="sourceId" :groups="config" :data="item" :columns="config.columns"
200
- :primary-column="config.primaryColumn" :second-column="config.secondColumn" :label-column="config.labelColumn"
201
- model="complex" :card-show-cols="config.cardShowCols" :main-picture="config.mainPicture"
202
- >
203
- <template #buttons>
204
- <slot name="cardBotomButtons" :data="item" />
205
- <CardBotomButtons
206
- :primary-column="config.primaryColumn" :add-event="addEvent" :detail-button-handle="detailButtonHandle" :zpaging="Zpaging"
207
- :enum-column="enumColumn" :actions="config.actions" :row-actions="config.rowActions" :ractions="config.ractions" :source-id="sourceId"
208
- :item="config" :code="item.code" :page-type="pageType" :data="item"
209
- />
210
- </template>
211
- </productCard>
212
- </view>
213
- <view v-else>
214
- <foldCard
215
- v-for="(item, index) in datas" :key="item.code" :index="index" :enum-column="enumColumn"
216
- :collapse-num="5" :source-id="sourceId" :groups="config" :data="item" :columns="config.columns"
217
- :primary-column="config.primaryColumn" :second-column="config.secondColumn" :label-column="config.labelColumn"
218
- model="complex"
219
- >
220
- <template #buttons>
221
- <slot name="cardBotomButtons" :data="item" />
222
- <CardBotomButtons
223
- :primary-column="config.primaryColumn" :add-event="addEvent" :detail-button-handle="detailButtonHandle" :zpaging="Zpaging"
224
- :enum-column="enumColumn" :actions="config.actions" :row-actions="config.rowActions" :ractions="config.ractions" :source-id="sourceId"
225
- :item="config" :code="item.code" :page-type="pageType" :data="item"
226
- />
227
- </template>
228
- </foldCard>
229
- </view>
230
-
231
- <template #bottom>
232
- <slot name="bottom" />
233
- </template>
234
- </z-paging>
235
- </template>
1
+ <script lang="ts" setup>
2
+ import { defineOptions, defineProps, onMounted, onUnmounted, ref } from 'vue'
3
+ import { onLoad } from '@dcloudio/uni-app'
4
+ import { listData, pageConfig, pageKey } from '../../api/page'
5
+ import foldCard from '../fold-card/fold-card.vue'
6
+ import type { Config, Entities } from '../../type'
7
+ import Search from '../search/search.vue'
8
+ import ListTopButtons from '../list-top-buttons/list-top-buttons.vue'
9
+ import CardBotomButtons from '../card-botom-buttons/card-botom-buttons.vue'
10
+ import { generateHighResolutionID } from '../../utils/index'
11
+ import productCard from '../product-card/product-card.vue'
12
+ import tabSearch from '../tab-search/tab-search.vue'
13
+ import { useEnums } from '../../composables/useEnumes'
14
+
15
+ defineOptions({
16
+ name: 'WuiList',
17
+ })
18
+ defineProps<{
19
+ detailButtonHandle?: (data: Entities) => void
20
+ }>()
21
+
22
+ const Zpaging = ref<any>(null)
23
+ const config = ref<Config>({
24
+ buttons: [],
25
+ columns: [],
26
+ primaryColumn: {
27
+ sourceId: '',
28
+ controlType: '',
29
+ mstrucId: '',
30
+ extControlType: '',
31
+ },
32
+ primaryCriterion: {
33
+ hidden: false,
34
+ disabled: false,
35
+ defaultValue: '',
36
+ transDefaultValue: '',
37
+ required: false,
38
+ controlType: '',
39
+ sourceId: '',
40
+ mstrucId: '',
41
+ extControlType: '',
42
+ },
43
+ secondColumn: {
44
+ sourceId: '',
45
+ controlType: '',
46
+ mstrucId: '',
47
+ extControlType: '',
48
+ },
49
+ criteria: [],
50
+ id: '',
51
+ fields: [],
52
+ title: '',
53
+ type: '',
54
+ pointSourceId: '',
55
+ mstrucId: '',
56
+ relationNames: [],
57
+ readOnly: false,
58
+ displayConfig: [],
59
+ showType: 'table',
60
+ })
61
+ const { getEnums, enumColumn } = useEnums({ config })
62
+ const sourceId = ref('')
63
+ const datas = ref<Entities[]>([])
64
+ const pageTitle = ref('')
65
+ const searchData = ref('')
66
+ const tabSearchData = ref('')
67
+ const pageType = ref('')
68
+ const mainCode = ref('')
69
+ const addEvent = generateHighResolutionID()// 全局事件名称
70
+ onLoad((option: any) => {
71
+ console.log(option)
72
+ sourceId.value = option.sourceId
73
+ pageTitle.value = option.title
74
+ pageType.value = option.pageType
75
+ mainCode.value = option.mainCode || ''
76
+ uni.setNavigationBarTitle({
77
+ title: option.title,
78
+ })
79
+ getPageConfig()
80
+ })
81
+ onMounted(async () => {
82
+ console.log('mounted')
83
+ // 监听添加成功的事件
84
+ uni.$on(addEvent, async () => {
85
+ Zpaging.value.reload()
86
+ })
87
+ })
88
+ // 在组件卸载时解绑全局事件
89
+ onUnmounted(() => {
90
+ console.log(`${pageTitle.value}页面卸载`)
91
+ uni.$off(addEvent)
92
+ })
93
+ async function getPageConfig() {
94
+ try {
95
+ const res = await pageConfig(sourceId.value)
96
+ if (res.ltmplConfig) {
97
+ config.value = res.ltmplConfig
98
+ console.log('config', config.value)
99
+ getEnums()
100
+ }
101
+ }
102
+ catch (error) {
103
+ console.log(error)
104
+ }
105
+ }
106
+
107
+ // @query所绑定的方法不要自己调用!!需要刷新列表数据时,只需要调用this.$refs.paging.reload()即可
108
+ async function queryList(pageNo: number, pageSize: number) {
109
+ // 此处请求仅为演示,请替换为自己项目中的请求
110
+ // request.queryList({ pageNo,pageSize }).then(res => {
111
+ // 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
112
+ // paging.value.complete(res.data.list);
113
+ // }).catch(res => {
114
+ // 如果请求失败写paging.value.complete(false);
115
+ // 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
116
+ // 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
117
+ // paging.value.complete(false);
118
+ // paging.value.reload() // 手动触发加载
119
+ // })
120
+ let qre = tabSearchData.value || searchData.value
121
+ if (config.value.defaultCriteriaValue) {
122
+ for (const key in config.value.defaultCriteriaValue) {
123
+ if (Object.prototype.hasOwnProperty.call(config.value.defaultCriteriaValue, key)) {
124
+ const element = config.value.defaultCriteriaValue[key]
125
+ if (!qre.includes(key)) {
126
+ qre = `${qre}&${key}=${element}`
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ try {
133
+ const res = await pageKey(sourceId.value, mainCode.value, qre)// 获取key
134
+ const data = await listData(res.key, pageNo, pageSize)// 获取数据
135
+ // const count = await getPageTotal(key.data?.key)// 获取总数
136
+ Zpaging.value.complete(data.entities)
137
+
138
+ // emits('loadData', data.data.entities)
139
+ }
140
+ catch (error) {
141
+ if (Zpaging.value) {
142
+ Zpaging.value.complete(false)
143
+ }
144
+ console.error(error)
145
+ }
146
+ }
147
+
148
+ function submitSearch(data: any) {
149
+ searchData.value = data
150
+ // for (const key in data) {
151
+ // if (Object.prototype.hasOwnProperty.call(data, key)) {
152
+ // const element = data[key]
153
+ // searchData.value = `${searchData.value}&c_${key}=${element}`
154
+ // }
155
+ // }
156
+ Zpaging.value.reload()
157
+ }
158
+
159
+ // tabSearch点击事件
160
+ function tabSearchClick(data: any) {
161
+ if (searchData.value) {
162
+ tabSearchData.value = `${searchData.value}&${data}`
163
+ }
164
+ else {
165
+ tabSearchData.value = data
166
+ }
167
+
168
+ Zpaging.value.reload()
169
+ }
170
+ </script>
171
+
172
+ <template>
173
+ <z-paging
174
+ ref="Zpaging" v-model="datas" :default-page-size="5" :show-loading-more-when-reload="true"
175
+ @query="queryList"
176
+ >
177
+ <template #top>
178
+ <slot name="top" />
179
+ <Search
180
+ :main-code="mainCode" :enum-column="enumColumn" :criteria="config.criteria"
181
+ :primary-criterion="config.primaryCriterion" :split2-tab-criterias="config.split2TabCriterias"
182
+ @submit="submitSearch"
183
+ />
184
+ <view>
185
+ <ListTopButtons
186
+ :add-event="addEvent" :main-code="mainCode" :buttons="config.buttons" :source-id="sourceId"
187
+ :page-title="pageTitle" :page-type="pageType"
188
+ :config="config"
189
+ />
190
+ </view>
191
+ <!-- 自定义tab搜索 -->
192
+ <view v-if="config.split2TabCriterias">
193
+ <tabSearch :split2-tab-criterias="config.split2TabCriterias" :enums="enumColumn" @click="tabSearchClick" />
194
+ </view>
195
+ </template>
196
+ <view v-if="config.showType === 'cardList'">
197
+ <productCard
198
+ v-for="(item, index) in datas" :key="item.code" :index="index" :enum-column="enumColumn"
199
+ :collapse-num="5" :source-id="sourceId" :groups="config" :data="item" :columns="config.columns"
200
+ :primary-column="config.primaryColumn" :second-column="config.secondColumn" :label-column="config.labelColumn"
201
+ model="complex" :card-show-cols="config.cardShowCols" :main-picture="config.mainPicture"
202
+ >
203
+ <template #buttons>
204
+ <slot name="cardBotomButtons" :data="item" />
205
+ <CardBotomButtons
206
+ :primary-column="config.primaryColumn" :add-event="addEvent" :detail-button-handle="detailButtonHandle" :zpaging="Zpaging"
207
+ :enum-column="enumColumn" :actions="config.actions" :row-actions="config.rowActions" :ractions="config.ractions" :source-id="sourceId"
208
+ :item="config" :code="item.code" :page-type="pageType" :data="item"
209
+ />
210
+ </template>
211
+ </productCard>
212
+ </view>
213
+ <view v-else>
214
+ <foldCard
215
+ v-for="(item, index) in datas" :key="item.code" :index="index" :enum-column="enumColumn"
216
+ :collapse-num="5" :source-id="sourceId" :groups="config" :data="item" :columns="config.columns"
217
+ :primary-column="config.primaryColumn" :second-column="config.secondColumn" :label-column="config.labelColumn"
218
+ model="complex"
219
+ >
220
+ <template #buttons>
221
+ <slot name="cardBotomButtons" :data="item" />
222
+ <CardBotomButtons
223
+ :primary-column="config.primaryColumn" :add-event="addEvent" :detail-button-handle="detailButtonHandle" :zpaging="Zpaging"
224
+ :enum-column="enumColumn" :actions="config.actions" :row-actions="config.rowActions" :ractions="config.ractions" :source-id="sourceId"
225
+ :item="config" :code="item.code" :page-type="pageType" :data="item"
226
+ />
227
+ </template>
228
+ </foldCard>
229
+ </view>
230
+
231
+ <template #bottom>
232
+ <slot name="bottom" />
233
+ </template>
234
+ </z-paging>
235
+ </template>