w-ui-v1 1.1.6 → 1.1.8

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.6",
3
+ "version": "1.1.8",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/w-card/w-card.vue CHANGED
@@ -48,9 +48,12 @@ const props = defineProps({
48
48
  default:null
49
49
  },
50
50
 
51
- editButtonName:{
52
- type:String,
53
- default:''
51
+ editButtonConfig:{
52
+ type:Object,
53
+ default:{
54
+ label:"",
55
+ show:null
56
+ }
54
57
  }
55
58
  })
56
59
  console.log(props.enumMap)
@@ -246,6 +249,15 @@ const getTitleValue = (value: any, title: string) => {
246
249
  return data
247
250
  }
248
251
 
252
+ //判断编辑按钮是否显示
253
+ function isShowEditButton(visibleItems:any){
254
+ if(props.editButtonConfig.show){
255
+ return props.editButtonConfig.show(visibleItems)
256
+ }else{
257
+ return props.page.buttons.includes('dtmplEdit')
258
+ }
259
+
260
+ }
249
261
 
250
262
  </script>
251
263
 
@@ -331,9 +343,9 @@ const getTitleValue = (value: any, title: string) => {
331
343
  <wd-button :round="false" size="small" class="btn" v-if="props.page.buttons.includes('detail')" @click="goto('detail')">
332
344
  详情
333
345
  </wd-button>
334
- <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)"
335
347
  @click="goto('edit')">
336
- {{props.editButtonName||"编辑"}}
348
+ {{props.editButtonConfig.label||"编辑"}}
337
349
  </wd-button>
338
350
  <!-- //假删除按钮,在新增、编辑页面才会出现 -->
339
351
  <wd-button :round="false" size="small" class="btn" type="error" @click="delerelation"
@@ -42,9 +42,12 @@ const props = defineProps({
42
42
  default:null
43
43
  },
44
44
 
45
- editButtonName:{
46
- type:String,
47
- default:''
45
+ editButtonConfig:{
46
+ type:Object,
47
+ default:{
48
+ label:"",
49
+ show:null
50
+ }
48
51
  }
49
52
  })
50
53
  const emits=defineEmits(['loadData'])
@@ -163,7 +166,7 @@ defineExpose({
163
166
  </template>
164
167
  <!-- 卡片 -->
165
168
  <view class="card-list" v-if="dataList.length > 0">
166
- <w-card :visible="props.visible" :editButtonName="props.editButtonName" :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"
167
170
  :source-id="sourceId" @refresh="paging.reload()"/>
168
171
  </view>
169
172
  <template #bottom>