w-ui-v1 1.1.5 → 1.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/w-card/w-card.vue CHANGED
@@ -42,6 +42,18 @@ const props = defineProps({
42
42
  enumMap:{
43
43
  type:Object,
44
44
  default:{}
45
+ },
46
+ visible:{
47
+ type:Number,
48
+ default:null
49
+ },
50
+
51
+ editButtonConfig:{
52
+ type:Object,
53
+ default:{
54
+ label:"",
55
+ show:null
56
+ }
45
57
  }
46
58
  })
47
59
  console.log(props.enumMap)
@@ -107,7 +119,7 @@ const items = computed(() => {
107
119
  const wFormMessageBoxRef = ref()
108
120
  const showMoreButns = ref(false)
109
121
  const isExpanded = ref(false)
110
- const defaultVisible = 4 // 默认显示行数量
122
+ const defaultVisible =props.visible|| 4 // 默认显示行数量
111
123
 
112
124
  const visibleItems = computed(() => {
113
125
  return isExpanded.value ? items.value : items.value.slice(0, defaultVisible)
@@ -237,6 +249,15 @@ const getTitleValue = (value: any, title: string) => {
237
249
  return data
238
250
  }
239
251
 
252
+ //判断编辑按钮是否显示
253
+ function isShowEditButton(){
254
+ if(props.editButtonConfig.show){
255
+ return props.editButtonConfig.show()
256
+ }else{
257
+ return props.page.buttons.includes('dtmplEdit')
258
+ }
259
+
260
+ }
240
261
 
241
262
  </script>
242
263
 
@@ -322,9 +343,9 @@ const getTitleValue = (value: any, title: string) => {
322
343
  <wd-button :round="false" size="small" class="btn" v-if="props.page.buttons.includes('detail')" @click="goto('detail')">
323
344
  详情
324
345
  </wd-button>
325
- <wd-button :round="false" type="warning" size="small" class="btn" v-if="props.page.buttons.includes('dtmplEdit')"
346
+ <wd-button :round="false" type="warning" size="small" class="btn" v-if="isShowEditButton(visibleItems)"
326
347
  @click="goto('edit')">
327
- 编辑
348
+ {{props.editButtonConfig.label||"编辑"}}
328
349
  </wd-button>
329
350
  <!-- //假删除按钮,在新增、编辑页面才会出现 -->
330
351
  <wd-button :round="false" size="small" class="btn" type="error" @click="delerelation"
@@ -36,6 +36,18 @@ const props = defineProps({
36
36
  showSearch:{
37
37
  type:Boolean,
38
38
  default:true
39
+ },
40
+ visible:{
41
+ type:Number,
42
+ default:null
43
+ },
44
+
45
+ editButtonConfig:{
46
+ type:Object,
47
+ default:{
48
+ label:"",
49
+ show:null
50
+ }
39
51
  }
40
52
  })
41
53
  const emits=defineEmits(['loadData'])
@@ -154,7 +166,7 @@ defineExpose({
154
166
  </template>
155
167
  <!-- 卡片 -->
156
168
  <view class="card-list" v-if="dataList.length > 0">
157
- <w-card :enumMap="Enumcolumn" v-for="(item, index) in dataList" :key="index" :car-index="index" :page="pageData" :item-data="item"
169
+ <w-card :visible="props.visible" :editButtonConfig="props.editButtonConfig" :enumMap="Enumcolumn" v-for="(item, index) in dataList" :key="index" :car-index="index" :page="pageData" :item-data="item"
158
170
  :source-id="sourceId" @refresh="paging.reload()"/>
159
171
  </view>
160
172
  <template #bottom>