wui-components-v2 1.0.37 → 1.0.39

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.
@@ -536,7 +536,7 @@ function remove(group: Groups, field: Entities) {
536
536
  <wd-loading />
537
537
  </view>
538
538
  <view v-else>
539
- <view class="flex justify-center">
539
+ <view v-if="!group.readOnly" class="flex justify-center">
540
540
  <wd-button v-if="group.buttons.includes('selectAdd')" :disabled="canClick(group)" type="info" size="small" @click="gotoSlect(group)">
541
541
  选择
542
542
  </wd-button>
@@ -549,7 +549,7 @@ function remove(group: Groups, field: Entities) {
549
549
  </view>
550
550
  <view v-for="field in pageConfig?.entity?.arrayMap[group.id]" :key="field.code">
551
551
  <foldCard :enum-column="{}" :groups="group" :source-id="sourceId" :columns="group.fields" model="complex" :data="field">
552
- <template #buttons>
552
+ <template v-if="!group.readOnly" #buttons>
553
553
  <wd-button v-if="group.buttons.includes('dtmplEdit')" size="small" @click="edit(group, field)">
554
554
  编辑
555
555
  </wd-button>
@@ -29,6 +29,14 @@ const exhibitData = computed(() => {
29
29
  const columns = props.columns.length >= num ? props.columns.slice(0, num) : props.columns
30
30
  return columns.filter(item => item.title !== '操作')
31
31
  })
32
+
33
+ // 是否展示折叠按钮
34
+ const showCollapse = computed(() => {
35
+ const { collapseNum } = props
36
+ const num = collapseNum || 2
37
+ return props.columns.length > num
38
+ })
39
+
32
40
  // 折叠内容
33
41
  const collapseData = ref<Columns[]>([])
34
42
 
@@ -85,7 +93,7 @@ function toggleCollapse(contentId: string) {
85
93
  v-if="props.labelColumn"
86
94
  class="rounded px-1 py-1 text-sm text-white"
87
95
  :style="{
88
- color: labelColumns.find(
96
+ color: labelColumns?.find(
89
97
  item => props.labelColumn && item.value === data.fieldMap[props.labelColumn.sourceId],
90
98
  )?.css?.color,
91
99
  }"
@@ -115,7 +123,7 @@ function toggleCollapse(contentId: string) {
115
123
  <view class="flex items-center justify-between border-t border-gray-100">
116
124
  <view>
117
125
  <wd-button
118
-
126
+ v-if="showCollapse"
119
127
  id="toggle-btn-2"
120
128
  type="icon"
121
129
  :icon="collapseIcon"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",
package/type.ts CHANGED
@@ -58,6 +58,7 @@ export interface Groups {
58
58
  relationNames: string[]
59
59
  max?: number
60
60
  classEditConfigs?: ClassEditConfigs[]
61
+ readOnly: boolean
61
62
  }
62
63
 
63
64
  export interface Entity extends Entities {