@cloudbase/weda-ui-mp 3.11.11 → 3.12.1

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.
@@ -31,6 +31,10 @@ Component({
31
31
  type: null,
32
32
  value: {},
33
33
  },
34
+ mode: {
35
+ type: String,
36
+ value: 'obj',
37
+ },
34
38
  },
35
39
  data: {
36
40
  status: 'edit',
@@ -1,5 +1,5 @@
1
1
  <block wx:if="{{visible}}">
2
- <wd-form-item-obj id="{{id}}" className="{{className}}" style="{{style}}" label="{{label}}" labelVisible="{{labelVisible}}" labelTips="{{labelTips}}" labelWidth="{{labelWidth}}" labelAlign="{{labelAlign}}" labelWrap="{{labelWrap}}" extra="{{extra}}" classRoot="{{classRoot}}" layout="{{_layout}}">
2
+ <wd-form-item-obj id="{{id}}" mode="{{mode}}" className="{{className}}" style="{{style}}" label="{{label}}" labelVisible="{{labelVisible}}" labelTips="{{labelTips}}" labelWidth="{{labelWidth}}" labelAlign="{{labelAlign}}" labelWrap="{{labelWrap}}" extra="{{extra}}" classRoot="{{classRoot}}" layout="{{_layout}}">
3
3
  <slot></slot>
4
4
  </wd-form-item-obj>
5
5
  </block>
@@ -12,6 +12,15 @@
12
12
  width: fit-content;
13
13
  width: 100%;
14
14
  }
15
+ .wd-form-obj-root .wd-form-obj .wd-form-item.size-width-sm {
16
+ width: 100%;
17
+ }
18
+ .wd-form-obj-root .wd-form-obj .wd-form-item.size-width-md {
19
+ width: 100%;
20
+ }
21
+ .wd-form-obj-root .wd-form-obj .wd-form-item.size-width-lg {
22
+ width: 100%;
23
+ }
15
24
  .wd-form-obj-root.size-width-sm {
16
25
  width: 100%;
17
26
  }
@@ -25,7 +34,7 @@
25
34
  width: 100%;
26
35
  }
27
36
  .wd-form-obj-root .wd-form-item-wrap .wd-form-item-wrap__control {
28
- overflow: hidden;
37
+ overflow: unset;
29
38
  }
30
39
  .wd-form-obj-root .wd-form-item-wrap .wd-card-root {
31
40
  width: 100%;
@@ -12,6 +12,12 @@ import {
12
12
  Component({
13
13
  options: { virtualHost: true, styleIsolation: 'shared' },
14
14
  behaviors: [itemBehavior],
15
+ properties: {
16
+ mode: {
17
+ type: String,
18
+ value: 'obj',
19
+ },
20
+ },
15
21
  data: {
16
22
  item: `${WD_PREFIX}-form-item`,
17
23
  itemWrap: `${WD_PREFIX}-form-item-wrap`,
@@ -1,5 +1,23 @@
1
1
  <view class="{{cls}}" id="{{id}}" style="{{style}}">
2
2
  <view class="{{itemWrap}}">
3
+
4
+ <block wx:if="{{mode==='table'||mode==='custom'}}">
5
+ <view class="{{itemWrap}}__control">
6
+ <view class="{{controlWrapCls}} wd-form-obj-item-wrap__control-wrap">
7
+ <block wx:if="{{readOnly}}">
8
+ <view class="{{item}}__readonly">
9
+ <text class="{{item}}__readonly-before" wx:if="{{_before}}">{{_before}}</text>
10
+ <text class="{{item}}__readonly-value">{{_readValue}}</text>
11
+ <text class="{{item}}__readonly-after" wx:if="{{_after}}">{{_after}}</text>
12
+ </view>
13
+ </block>
14
+ <block wx:else>
15
+ <slot></slot>
16
+ </block>
17
+ </view>
18
+ </view>
19
+ </block>
20
+ <block wx:else>
3
21
  <wd-card className="{{iconName === 'chevrondown' ? 'wd-card-content__hidden' : ''}}" showContent="{{true}}">
4
22
  <view slot="headerSlot" class="wd-form-obj-card-header">
5
23
  <wd-icon name="{{iconName}}" bind:tap="setIconName"></wd-icon>
@@ -35,6 +53,7 @@
35
53
  </view>
36
54
  </view>
37
55
  </wd-card>
56
+ </block>
38
57
  </view>
39
58
  <!-- Message -->
40
59
  <block wx:if="{{validateErrorMsg}}">
@@ -26,6 +26,10 @@ Component({
26
26
  type: String,
27
27
  value: 'form-obj',
28
28
  },
29
+ mode: {
30
+ type: String,
31
+ value: 'obj',
32
+ },
29
33
  },
30
34
  data: {
31
35
  status: 'edit',
@@ -1,5 +1,5 @@
1
1
  <block wx:if="{{visible}}">
2
- <wd-form-item-obj id="{{id}}" className="{{className}}" style="{{style}}" label="{{label}}" labelVisible="{{labelVisible}}" labelTips="{{labelTips}}" labelWidth="{{labelWidth}}" labelAlign="{{labelAlign}}" labelWrap="{{labelWrap}}" extra="{{extra}}" classRoot="{{classRoot}}" layout="{{_layout}}">
2
+ <wd-form-item-obj id="{{id}}" mode="{{mode}}" className="{{className}}" style="{{style}}" label="{{label}}" labelVisible="{{labelVisible}}" labelTips="{{labelTips}}" labelWidth="{{labelWidth}}" labelAlign="{{labelAlign}}" labelWrap="{{labelWrap}}" extra="{{extra}}" classRoot="{{classRoot}}" layout="{{_layout}}">
3
3
  <slot></slot>
4
4
  </wd-form-item-obj>
5
5
  </block>
@@ -12,6 +12,15 @@
12
12
  width: fit-content;
13
13
  width: 100%;
14
14
  }
15
+ .wd-form-obj-root .wd-form-obj .wd-form-item.size-width-sm {
16
+ width: 100%;
17
+ }
18
+ .wd-form-obj-root .wd-form-obj .wd-form-item.size-width-md {
19
+ width: 100%;
20
+ }
21
+ .wd-form-obj-root .wd-form-obj .wd-form-item.size-width-lg {
22
+ width: 100%;
23
+ }
15
24
  .wd-form-obj-root.size-width-sm {
16
25
  width: 100%;
17
26
  }
@@ -25,7 +34,7 @@
25
34
  width: 100%;
26
35
  }
27
36
  .wd-form-obj-root .wd-form-item-wrap .wd-form-item-wrap__control {
28
- overflow: hidden;
37
+ overflow: unset;
29
38
  }
30
39
  .wd-form-obj-root .wd-form-item-wrap .wd-card-root {
31
40
  width: 100%;
@@ -31,6 +31,8 @@
31
31
  right: 0;
32
32
  top: 0;
33
33
  bottom: 0;
34
+ width: 80%;
35
+ margin: 0 auto;
34
36
  }
35
37
 
36
38
  .wd-image-mask {
@@ -83,4 +85,31 @@
83
85
  top: 0;
84
86
  width: 100%;
85
87
  height: 100%;
88
+ }
89
+
90
+ .wd-image__zoom-in {
91
+ cursor: zoom-in;
92
+ }
93
+
94
+ .wd-image-preview-toolbar {
95
+ position: absolute;
96
+ bottom: 40px;
97
+ left: 50%;
98
+ transform: translateX(-50%);
99
+ z-index: 1002;
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: space-around;
103
+ width: 150px;
104
+ color: #fff;
105
+ }
106
+ .wd-image-preview-toolbar .wd-icon-wrap {
107
+ height: 30px;
108
+ width: 30px;
109
+ border-radius: 50%;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ background: var(--wd-font-gray-2);
114
+ cursor: pointer;
86
115
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.11.11",
6
+ "version": "3.12.1",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -353,7 +353,7 @@ page[theme-mode=light],
353
353
  --wd-color-success-focus: var(--wd-color-success-2);
354
354
  --wd-color-success-active: var(--wd-color-success-6);
355
355
  --wd-color-success-disabled: var(--wd-color-success-3);
356
- --wd-bg-mask: rgba(var(--wd-black-rgb), 80%);
356
+ --wd-bg-mask: rgba(var(--wd-black-rgb), 50%);
357
357
  --wd-bg-mask-inverse: rgba(var(--wd-white-rgb), 60%);
358
358
  --wd-color-bg-page: var(--wd-color-gray-1);
359
359
  --wd-color-bg-container: var(--wd-white);
@@ -71,9 +71,7 @@ const getSelectFields = async (props) => {
71
71
  select[name] = true;
72
72
  });
73
73
  } else if (props.selectFieldType === 'custom') {
74
- const _selectFields = Array.isArray(props.selectFields)
75
- ? props.selectFields
76
- : [];
74
+ const _selectFields = Array.isArray(props.selectFields) ? props.selectFields : [];
77
75
  _selectFields.forEach((name) => {
78
76
  select[name] = true;
79
77
  });
@@ -98,6 +96,12 @@ export const getModelParams = async (props) => {
98
96
  // 支持多关联查询,需要将查询条件转换为filter
99
97
  if (props?.queryCondition?.constructor === Object) {
100
98
  params['filter'] = getFilter(props.queryCondition);
99
+ } else if (Array.isArray(props?.queryCondition)) {
100
+ params['filter'] = {
101
+ where: {
102
+ $and: props?.queryCondition,
103
+ },
104
+ };
101
105
  }
102
106
  params.select = await getSelectFields(props);
103
107
  // 处理排序字段