wui-components-v2 1.1.93 → 1.1.94

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.
@@ -30,6 +30,11 @@ const props = defineProps<{
30
30
  detailButtonHandle?: (data: Entities) => void
31
31
  buttonDeleteAction?: { [key: string]: any }
32
32
  buttonEditAction?: { [key: string]: any }
33
+ /**
34
+ * 是否显示操作按钮区域(morebutns / 编辑 / 删除)。
35
+ * 不传或为 true 时显示;传 false 时整段隐藏。
36
+ */
37
+ isShowAction?: boolean
33
38
  }>()
34
39
  const toast = useGlobalToast()
35
40
  const message = useGlobalMessage()
@@ -43,20 +48,20 @@ const router = useRouter()
43
48
  // rowActions按钮
44
49
  const anctions = computed(() => {
45
50
  const rowActions = props.rowActions || []
46
- console.log([...rowActions.filter(isShowAction)], 1111111111111111)
47
- return [...rowActions.filter(isShowAction)]
51
+ console.log([...rowActions.filter(isActionVisible)], 1111111111111111)
52
+ return [...rowActions.filter(isActionVisible)]
48
53
  })
49
54
 
50
55
  // raction按钮
51
56
  const ractions = computed(() => {
52
57
  const list = props.ractions || []
53
- return list.filter(isShowAction)
58
+ return list.filter(isActionVisible)
54
59
  })
55
60
 
56
61
  // actions按钮
57
62
  const actions = computed(() => {
58
63
  const actions = props.actions || []
59
- return [...actions.filter(isShowAction)]
64
+ return [...actions.filter(isActionVisible)]
60
65
  })
61
66
 
62
67
  // 跳转编辑页面
@@ -115,7 +120,7 @@ function detail() {
115
120
  }
116
121
 
117
122
  // 判断按钮是否满足条件显示
118
- function isShowAction(item?: { preposes?: Fields[] }) {
123
+ function isActionVisible(item?: { preposes?: Fields[] }) {
119
124
  if (item?.preposes?.length) {
120
125
  return item.preposes.every((prepose: Fields) => {
121
126
  // 判断字段值是否满足要求
@@ -252,23 +257,25 @@ console.log(props, '3333333333333')
252
257
  </wd-button>
253
258
  </view> -->
254
259
 
255
- <template v-for="subitem in morebutns" :key="subitem.id">
256
- <wd-button
257
- v-if="isShowAction(subitem)"
258
- plain
259
- size="small"
260
- @click="
261
- () => {
262
- select({ item: subitem })
263
- }
264
- "
265
- >
266
- {{ subitem.title }}
267
- </wd-button>
260
+ <template v-if="isShowAction !== false">
261
+ <template v-for="subitem in morebutns" :key="subitem.id">
262
+ <wd-button
263
+ v-if="isActionVisible(subitem)"
264
+ plain
265
+ size="small"
266
+ @click="
267
+ () => {
268
+ select({ item: subitem })
269
+ }
270
+ "
271
+ >
272
+ {{ subitem.title }}
273
+ </wd-button>
274
+ </template>
268
275
  </template>
269
276
 
270
277
  <wd-button
271
- v-if="props.item.buttons.includes('dtmplEdit') && isShowAction(props.buttonEditAction)"
278
+ v-if="isShowAction !== false && props.item.buttons.includes('dtmplEdit') && isActionVisible(props.buttonEditAction)"
272
279
  size="small"
273
280
  @click="edit()"
274
281
  >
@@ -276,7 +283,7 @@ console.log(props, '3333333333333')
276
283
  </wd-button>
277
284
  <wd-button v-if="props.item.buttons.includes('detail')" size="small" type="info" @click="detail()">详情</wd-button>
278
285
  <wd-button
279
- v-if="props.item.buttons.includes('singleDelete') && isShowAction(props.buttonDeleteAction)"
286
+ v-if="isShowAction !== false && props.item.buttons.includes('singleDelete') && isActionVisible(props.buttonDeleteAction)"
280
287
  size="small"
281
288
  type="danger"
282
289
  @click="del()"
@@ -16,6 +16,7 @@ defineOptions({
16
16
  name: 'WuiList',
17
17
  })
18
18
  defineProps<{
19
+ isShowAction?: boolean
19
20
  detailButtonHandle?: (data: Entities) => void
20
21
  /**
21
22
  * 折叠前展示的数据条数,透传给 foldCard。
@@ -241,6 +242,7 @@ function tabSearchClick(data: any) {
241
242
  :code="item.code"
242
243
  :page-type="pageType"
243
244
  :data="item"
245
+ :is-show-action="isShowAction"
244
246
  />
245
247
  </template>
246
248
  </productCard>
@@ -279,6 +281,7 @@ function tabSearchClick(data: any) {
279
281
  :data="item"
280
282
  :button-delete-action="config.buttonDeleteAction"
281
283
  :button-edit-action="config.buttonEditAction"
284
+ :is-show-action="isShowAction"
282
285
  />
283
286
  </template>
284
287
  </foldCard2>
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
3
3
  import { enums, listData, pageConfig, pageKey } from '../../api/page'
4
- import foldCard2 from '../fold-card2/fold-card2.vue'
4
+ import foldCard from '../fold-card/fold-card.vue'
5
5
  import Search from '../search/search.vue'
6
6
  import type { Config, Entities, Enums, FoldCardModel } from '../../type'
7
7
  import { useGlobalToast } from '../../composables/useGlobalToast'
@@ -475,7 +475,7 @@ console.log(props, 'props')
475
475
  <slot name="top" />
476
476
  </template>
477
477
 
478
- <foldCard2
478
+ <foldCard
479
479
  v-for="(item, index) in datas"
480
480
  :key="item.code"
481
481
  :index="index"
@@ -496,7 +496,7 @@ console.log(props, 'props')
496
496
  :type="checkboxType"
497
497
  />
498
498
  </template>
499
- </foldCard2>
499
+ </foldCard>
500
500
 
501
501
  <template #bottom>
502
502
  <view class="popup-footer flex justify-center gap-4 p-4 border-t border-gray-200">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.93",
3
+ "version": "1.1.94",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",