wui-components-v2 1.0.72 → 1.0.74

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.
@@ -61,7 +61,7 @@ async function action() {
61
61
  <formControl v-if="props.fieldGroup" ref="formControlRef" :field-group="props.fieldGroup" />
62
62
  <view class="h-44px .dark:bg-gray-900 .light:bg-white" />
63
63
  <view class="fixed bottom-0 left-0 right-0 box-border w-100% flex p-2 .dark:bg-gray-900 .light:bg-white">
64
- <wd-button :loading="btnLoading" class="flex-1" @click="() => { action() }">
64
+ <wd-button :loading="btnLoading" custom-class="flex-1" @click="() => { action() }">
65
65
  提交
66
66
  </wd-button>
67
67
  </view>
@@ -1,6 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { computed, defineOptions, defineProps, onBeforeMount, ref } from 'vue'
3
- import { useManualTheme } from '../../composables/useManualTheme'
2
+ import { computed, defineOptions, defineProps, ref } from 'vue'
4
3
  import type { Columns, Entities, Enums, FoldCardModel, Groups } from '../../type'
5
4
  import { formatItemData } from '../../utils'
6
5
  import LabelValue from '../label-value/label-value.vue'
@@ -85,7 +85,7 @@ function handleSubmit() {
85
85
  <formControl ref="formControlRef" :field-group="{ fields: filterCriterias, readOnly: false, displayConfig: [], id: '', buttons: [], title: '', type: '', pointSourceId: '', mstrucId: '', relationNames: [] }" :entity="entity" :enum-column="enumColumn" />
86
86
  <view class="h-12" />
87
87
  <view class="fixed bottom-0 left-0 right-0 box-border w-100% flex p-2 .dark:bg-gray-900 .light:bg-white">
88
- <wd-button block class="flex-1" @click="handleSubmit">
88
+ <wd-button block custom-class="flex-1" @click="handleSubmit">
89
89
  确定
90
90
  </wd-button>
91
91
  </view>
@@ -374,7 +374,7 @@ function handleConfirm() {
374
374
  <!-- 底部按钮 -->
375
375
  <view class="fixed bottom-0 left-0 right-0 box-border w-100% flex p-2 .dark:bg-gray-900 .light:bg-white">
376
376
  <wd-button
377
- class="flex-1"
377
+ custom-class="flex-1"
378
378
  type="primary"
379
379
  @click="handleConfirm"
380
380
  >
@@ -2,9 +2,9 @@
2
2
  import { computed, defineOptions, onMounted, onUnmounted, ref } from 'vue'
3
3
  import { onLoad } from '@dcloudio/uni-app'
4
4
  import { useRouter } from 'uni-mini-router'
5
- import { listData, pageConfig, pageKey } from '../../api/page'
5
+ import { enums, listData, pageConfig, pageKey } from '../../api/page'
6
6
  import foldCard from '../fold-card/fold-card.vue'
7
- import type { Config, Entities, FoldCardModel } from '../../type'
7
+ import type { Config, Entities, Enums, FoldCardModel } from '../../type'
8
8
  import { useGlobalToast } from '../../composables/useGlobalToast'
9
9
  import Search from '../search/search.vue'
10
10
 
@@ -58,6 +58,7 @@ const sendSelectEvent = ref('')
58
58
  const extControlType = ref('relselect')// 选择模式,例如:单选:relselect、多选
59
59
  const model = ref<FoldCardModel>('simple')
60
60
  const searchData = ref('')
61
+ const enumColumn = ref<Enums>({})
61
62
  onLoad((option: any) => {
62
63
  sourceId.value = option.sourceId
63
64
  pageTitle.value = option.title
@@ -103,11 +104,13 @@ uni.$once(sendSelectEvent.value, async (data: string | string[]) => {
103
104
  uni.$off(sendSelectEvent.value)
104
105
  })
105
106
 
107
+ // 获取页面配置
106
108
  async function getPageConfig() {
107
109
  try {
108
110
  const res = await pageConfig(sourceId.value)
109
111
  if (res.ltmplConfig) {
110
112
  config.value = res.ltmplConfig
113
+ getEnums()
111
114
  }
112
115
  }
113
116
  catch (error) {
@@ -115,6 +118,26 @@ async function getPageConfig() {
115
118
  }
116
119
  }
117
120
 
121
+ // 获取枚举
122
+ async function getEnums() {
123
+ try {
124
+ const params: string[] = []
125
+ config.value.columns?.forEach((item: any) => {
126
+ if (item.controlType === 'select' || item.controlType === 'multiselect') {
127
+ params.push(`mstrucIds=${item.mstrucId}`)
128
+ }
129
+ })
130
+ console.log('获取枚举', config.value.columns, params.length)
131
+ if (!params.length)
132
+ return
133
+ const res = await enums(params.join('&'))
134
+ enumColumn.value = res.enumMap || {}
135
+ }
136
+ catch (error) {
137
+ console.log('error:', error)
138
+ }
139
+ }
140
+
118
141
  // @query所绑定的方法不要自己调用!!需要刷新列表数据时,只需要调用this.$refs.paging.reload()即可
119
142
  async function queryList(pageNo: number, pageSize: number) {
120
143
  // 此处请求仅为演示,请替换为自己项目中的请求
@@ -190,13 +213,13 @@ onUnmounted(() => {
190
213
  })
191
214
 
192
215
  function submitSearch(data: any) {
193
- searchData.value = ''
194
- for (const key in data) {
195
- if (Object.prototype.hasOwnProperty.call(data, key)) {
196
- const element = data[key]
197
- searchData.value = `${searchData.value}&c_${key}=${element}`
198
- }
199
- }
216
+ searchData.value = data
217
+ // for (const key in data) {
218
+ // if (Object.prototype.hasOwnProperty.call(data, key)) {
219
+ // const element = data[key]
220
+ // searchData.value = `${searchData.value}&c_${key}=${element}`
221
+ // }
222
+ // }
200
223
  Zpaging.value.reload()
201
224
  }
202
225
  </script>
@@ -204,7 +227,7 @@ function submitSearch(data: any) {
204
227
  <template>
205
228
  <z-paging ref="Zpaging" v-model="datas" :show-loading-more-when-reload="true" @query="queryList">
206
229
  <template #top>
207
- <Search :criterias="config.criterias" :primary-criteria="config.primaryCriteria" @submit="submitSearch" />
230
+ <Search :enum-column="enumColumn" :criterias="config.criterias" :primary-criteria="config.primaryCriteria" @submit="submitSearch" />
208
231
  <!-- <view>
209
232
  <ListTopButtons :buttons="config.buttons" :source-id="sourceId" :page-title="pageTitle" />
210
233
  </view> -->
@@ -226,7 +249,7 @@ function submitSearch(data: any) {
226
249
  <!-- <wd-button class="flex-1" type="info" @click="cancel">
227
250
  取消
228
251
  </wd-button> -->
229
- <wd-button class="flex-1" @click="confirm">
252
+ <wd-button custom-class="flex-1" @click="confirm">
230
253
  确定
231
254
  </wd-button>
232
255
  </view>
@@ -24,7 +24,7 @@ function quit() {
24
24
  title: '退出登录',
25
25
  })
26
26
  .then(() => {
27
- uni.removeStorageSync('token')
27
+ uni.removeStorageSync('TOKEN')
28
28
  uni.reLaunch({
29
29
  url: '/pages/login/index',
30
30
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",