mali-applet-ui 0.2.64 → 0.2.66

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.
@@ -4,17 +4,19 @@
4
4
  <view class="ml-approval-select-header-title">审批流程</view>
5
5
  </view>
6
6
  <view class="ml-approval-select-body">
7
- <view class="ml-approval-select-list" v-for="(group, gIndex) in flowOptions" :key="gIndex">
7
+ <view class="ml-approval-select-list" v-for="(group, gIndex) in flowItems" :key="gIndex">
8
8
  <view class="ml-approval-select-flow-line"></view>
9
9
  <view class="ml-approval-select-item">
10
10
  <view class="ml-approval-select-item-title">{{ group.name }}</view>
11
11
  </view>
12
12
  <view class="ml-approval-select-users">
13
13
  <view class="ml-approval-select-user-item" v-for="(item, uIndex) in group.users" :key="uIndex">
14
- <image class="ml-approval-select-user-picture" :src="item.picture" mode="scaleToFill"></image>
15
- <view class="ml-approval-select-user-name">{{ item.name }}</view>
14
+ <ml-checkbox>
15
+ <image class="ml-approval-select-user-picture" src="https://img.ddscan.cn/saas/avatar.png" mode="scaleToFill"></image>
16
+ <view class="ml-approval-select-user-name">{{ item.name }}</view>
17
+ </ml-checkbox>
16
18
  </view>
17
- <view class="ml-approval-select-user-add" @click="openAddUser">
19
+ <view class="ml-approval-select-user-add" @click="openAddUser(group)">
18
20
  <view class="ml-approval-select-user-add-icon">
19
21
  <ml-icon name="add"></ml-icon>
20
22
  </view>
@@ -22,6 +24,19 @@
22
24
  </view>
23
25
  </view>
24
26
  </view>
27
+
28
+ <ml-picker-drawer v-model="showPopup" height="600rpx" showFooter @confirm="confirmEvent">
29
+ <ml-list-menu-group v-for="(group, gIndex) in selectRoleGroups" :key="gIndex" :title="group.name">
30
+ <ml-list-menu-item v-for="(item, cIndex) in group.userList" :key="cIndex" :padding="false" disabled suffixIcon="none">
31
+ <ml-row>
32
+ <ml-col width="80rpx" shrink>
33
+ <image class="ml-approval-picker-drawer-user-picture" src="https://img.ddscan.cn/saas/avatar.png" mode="scaleToFill"></image>
34
+ </ml-col>
35
+ <ml-col verticalAlign="center">{{ item.name }}</ml-col>
36
+ </ml-row>
37
+ </ml-list-menu-item>
38
+ </ml-list-menu-group>
39
+ </ml-picker-drawer>
25
40
  </view>
26
41
  </template>
27
42
 
@@ -37,31 +52,51 @@ export default {
37
52
  },
38
53
  data () {
39
54
  return {
40
- flowOptions: [],
55
+ flowItems: [],
41
56
  approvalData: {
42
57
  flowHandlers: [],
43
58
  module: null,
44
59
  flowSettingCode: null,
45
60
  enableFlag: false
61
+ },
62
+ showPopup: false,
63
+ isAllChecked: false,
64
+ isAllIndeterminate: false,
65
+ checkList: [],
66
+ dataList: [],
67
+ selectFlowItem: null
68
+ }
69
+ },
70
+ computed: {
71
+ selectRoleGroups () {
72
+ if (this.selectFlowItem) {
73
+ return this.selectFlowItem.roleList || []
46
74
  }
75
+ return []
47
76
  }
48
77
  },
49
78
  watch: {
50
79
  code () {
51
- this.load()
80
+ this.loadFlow()
52
81
  }
53
82
  },
54
83
  created () {
55
- this.flowOptions = this.options || []
56
84
  this.approvalData.module = this.code
57
85
  this.approvalData.flowSettingCode = this.code
58
- this.load()
86
+ this.updateFlowItems(this.options)
87
+ this.loadFlow()
59
88
  },
60
89
  methods: {
61
90
  updateModel () {
62
91
  this.$emit('input', this.approvalData)
63
92
  },
64
- async load () {
93
+ updateFlowItems (list) {
94
+ this.flowItems = (list || []).map(item => {
95
+ item.f = []
96
+ return item
97
+ })
98
+ },
99
+ async loadFlow () {
65
100
  await this.$nextTick()
66
101
  if (!this.code) {
67
102
  return
@@ -75,13 +110,19 @@ export default {
75
110
  this.approvalData.enableFlag = res.enableFlag
76
111
  this.approvalData.flowSettingCode = res.flowSettingCode
77
112
  this.approvalData.module = res.module
78
- this.flowOptions = res.flowItems
113
+ this.updateFlowItems(res.flowItems)
79
114
  this.updateModel()
80
115
  })
81
116
  }
82
117
  }
83
118
  },
84
- openAddUser () {}
119
+ openAddUser (group) {
120
+ this.selectFlowItem = group
121
+ this.showPopup = true
122
+ },
123
+ confirmEvent () {
124
+
125
+ }
85
126
  }
86
127
  }
87
128
  </script>
@@ -92,93 +133,99 @@ export default {
92
133
  padding: 20rpx;
93
134
  border-radius: $ml-border-radius;
94
135
  font-size: 30rpx;
95
- }
96
- .ml-approval-select-header-title {
97
- font-weight: 700;
98
- line-height: 60rpx;
99
- }
100
- .ml-approval-select-list {
101
- position: relative;
102
- padding-bottom: $ml-border-radius;
103
- .ml-approval-select-flow-line {
104
- position: absolute;
105
- top: 0;
106
- left: 0;
107
- height: 100%;
108
- width: 4rpx;
109
- background: #D9D9D9;
110
- &::before {
111
- content: "";
112
- position: absolute;
113
- top: 12rpx;
114
- left: -10rpx;
115
- width: 24rpx;
116
- height: 24rpx;
117
- border-radius: 50%;
118
- background: #D9D9D9;
119
- }
136
+ .ml-approval-select-header-title {
137
+ font-weight: 700;
138
+ line-height: 60rpx;
120
139
  }
121
- &:first-child {
140
+ .ml-approval-select-list {
141
+ position: relative;
142
+ padding-bottom: $ml-border-radius;
122
143
  .ml-approval-select-flow-line {
123
- top: 12rpx;
144
+ position: absolute;
145
+ top: 0;
146
+ left: 0;
147
+ height: 100%;
148
+ width: 4rpx;
149
+ background: #D9D9D9;
124
150
  &::before {
125
- top: 0;
151
+ content: "";
152
+ position: absolute;
153
+ top: 12rpx;
154
+ left: -10rpx;
155
+ width: 24rpx;
156
+ height: 24rpx;
157
+ border-radius: 50%;
158
+ background: #D9D9D9;
126
159
  }
127
160
  }
128
- }
129
- &:last-child {
130
- .ml-approval-select-flow-line {
131
- height: 30rpx;
161
+ &:first-child {
162
+ .ml-approval-select-flow-line {
163
+ top: 12rpx;
164
+ &::before {
165
+ top: 0;
166
+ }
167
+ }
168
+ }
169
+ &:last-child {
170
+ .ml-approval-select-flow-line {
171
+ height: 30rpx;
172
+ }
132
173
  }
133
174
  }
134
- }
135
- .ml-approval-select-item-title {
136
- padding-left: 40rpx;
137
- line-height: 50rpx;
138
- }
139
- .ml-approval-select-users {
140
- display: flex;
141
- flex-direction: row;
142
- padding-left: 40rpx;
143
- }
144
- .ml-approval-select-user-item {
145
- display: flex;
146
- flex-direction: column;
147
- padding: 10rpx;
148
- text-align: center;
149
- width: 140rpx;
150
- .ml-approval-select-user-picture {
151
- width: 100rpx;
152
- height: 100rpx;
153
- border-radius: 50%;
154
- margin: 0 auto;
175
+ .ml-approval-select-item-title {
176
+ padding-left: 40rpx;
177
+ line-height: 60rpx;
178
+ font-size: 28rpx;
155
179
  }
156
- .ml-approval-select-user-name {
157
- display: inline-block;
158
- vertical-align: middle;
159
- max-width: 150rpx;
160
- overflow: hidden;
161
- text-overflow: ellipsis;
162
- white-space: nowrap;
163
- margin-right: 10rpx;
164
- font-size: 24rpx;
165
- color: rgba(0, 0, 0, 0.85);
180
+ .ml-approval-select-users {
181
+ display: flex;
182
+ flex-direction: row;
183
+ padding-left: 40rpx;
166
184
  }
167
- }
168
- .ml-approval-select-user-add {
169
- display: flex;
170
- flex-direction: column;
171
- padding: 10rpx;
172
- text-align: center;
173
- .ml-approval-select-user-add-icon {
174
- width: 100rpx;
175
- height: 100rpx;
176
- line-height: 100rpx;
177
- border-radius: 50%;
178
- font-size: 50rpx;
179
- color: $uni-color-primary;
180
- background: #DAE6FF;
181
- overflow: hidden;
185
+ .ml-approval-select-user-item {
186
+ display: flex;
187
+ flex-direction: column;
188
+ padding: 10rpx;
189
+ text-align: center;
190
+ width: 140rpx;
191
+ .ml-approval-select-user-picture {
192
+ width: 80rpx;
193
+ height: 80rpx;
194
+ border-radius: 50%;
195
+ margin: 0 auto;
196
+ }
197
+ .ml-approval-select-user-name {
198
+ display: inline-block;
199
+ vertical-align: middle;
200
+ max-width: 150rpx;
201
+ overflow: hidden;
202
+ text-overflow: ellipsis;
203
+ white-space: nowrap;
204
+ margin-right: 10rpx;
205
+ font-size: 24rpx;
206
+ color: rgba(0, 0, 0, 0.85);
207
+ }
182
208
  }
209
+ .ml-approval-select-user-add {
210
+ display: flex;
211
+ flex-direction: column;
212
+ padding: 10rpx;
213
+ text-align: center;
214
+ .ml-approval-select-user-add-icon {
215
+ width: 80rpx;
216
+ height: 80rpx;
217
+ line-height: 80rpx;
218
+ border-radius: 50%;
219
+ font-size: 40rpx;
220
+ color: $uni-color-primary;
221
+ background: #DAE6FF;
222
+ overflow: hidden;
223
+ }
224
+ }
225
+ }
226
+ .ml-approval-picker-drawer-user-picture {
227
+ width: 50rpx;
228
+ height: 50rpx;
229
+ border-radius: 50%;
183
230
  }
184
231
  </style>
@@ -2,10 +2,12 @@
2
2
  <view class="ml-chunk-group" :class="[className || '', status ? `ss-${status}` : '', align ? `align-${align}` : '', {'is-status': !!status, 'is-vertical': vertical, 'is-header': title || $slots.title}]">
3
3
  <view v-if="title || $slots.title" class="ml-chunk-group-title">
4
4
  <slot name="title">
5
- <view v-if="prefixIcon" class="ml-chunk-group-left-icon">
6
- <ml-icon :className="prefixIcon" :status="status"></ml-icon>
5
+ <view class="ml-chunk-group-title-warpper">
6
+ <view v-if="prefixIcon" class="ml-chunk-group-left-icon">
7
+ <ml-icon :className="prefixIcon" :status="status"></ml-icon>
8
+ </view>
9
+ <view class="ml-chunk-group-title-content">{{ title }}</view>
7
10
  </view>
8
- <text class="ml-chunk-group-title-content">{{ title }}</text>
9
11
  </slot>
10
12
  </view>
11
13
  <view class="ml-chunk-group-body">
@@ -51,11 +53,24 @@ export default {
51
53
  height: 80rpx;
52
54
  padding: 0 20rpx ;
53
55
  }
56
+ .ml-chunk-group-title-warpper {
57
+ display: flex;
58
+ flex-direction: row;
59
+ align-items: center;
60
+ overflow: hidden;
61
+ }
54
62
  .ml-chunk-group-left-icon {
63
+ flex-shrink: 0;
55
64
  font-size: 38rpx;
56
65
  flex-shrink: 0;
57
66
  padding-right: 10rpx;
58
67
  }
68
+ .ml-chunk-group-title-content {
69
+ flex-grow: 1;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ white-space: nowrap;
73
+ }
59
74
  .ml-chunk-group-content {
60
75
  display: flex;
61
76
  flex-direction: row;
@@ -1,9 +1,15 @@
1
1
  <template>
2
2
  <view class="ml-list-group" :class="[className || '', type ? `type-${type}` : '']">
3
+ <view v-if="title || $slots.title" class="ml-list-group-title">
4
+ <view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-group-left-icon">
5
+ <ml-icon :className="prefixIcon"></ml-icon>
6
+ </view>
7
+ <slot name="title">
8
+ <text class="ml-list-group-title-content">{{ title }}</text>
9
+ </slot>
10
+ </view>
3
11
  <view class="ml-list-group-content" :style="contentStyle">
4
- <scroll-view scroll-y>
5
- <slot></slot>
6
- </scroll-view>
12
+ <slot></slot>
7
13
  <view v-if="showPage" class="load-more">
8
14
  <view v-if="loadStatus === 'more'" class="more">上拉显示更多</view>
9
15
  <view v-if="loadStatus === 'noMore'" class="no-more">没有更多数据了</view>
@@ -30,6 +36,7 @@ export default {
30
36
  vertical: Boolean,
31
37
  showPage: Boolean,
32
38
  autoload: Boolean,
39
+ prefixIcon: String,
33
40
  height: String,
34
41
  pageProps: Object,
35
42
  requestMethod: Function,
@@ -265,13 +272,29 @@ export default {
265
272
  display: flex;
266
273
  flex-direction: column;
267
274
  }
268
- }
269
- .load-more {
270
- text-align: center;
271
- .more,
272
- .no-more {
273
- padding: 20rpx;
274
- color: rgb(119, 119, 119);
275
+ .ml-list-group-title {
276
+ display: flex;
277
+ flex-direction: row;
278
+ flex-shrink: 0;
279
+ align-items: center;
280
+ height: 70rpx;
281
+ }
282
+ .ml-list-group-title-icon {
283
+ width: 60rpx;
284
+ text-align: center;
285
+ font-size: 38rpx;
286
+ flex-shrink: 0;
287
+ }
288
+ .ml-list-group-title-content {
289
+ padding: 0 10rpx
290
+ }
291
+ .load-more {
292
+ text-align: center;
293
+ .more,
294
+ .no-more {
295
+ padding: 20rpx;
296
+ color: rgb(119, 119, 119);
297
+ }
275
298
  }
276
299
  }
277
300
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <view class="ml-list-menu-group" :class="[className || '', type ? `type-${type}` : '']">
3
3
  <view v-if="title || $slots.title" class="ml-list-menu-group-title">
4
- <view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-menu-group-left-icon">
4
+ <view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-menu-group-title-icon">
5
5
  <ml-icon :className="prefixIcon"></ml-icon>
6
6
  </view>
7
7
  <slot name="title">
@@ -9,9 +9,7 @@
9
9
  </slot>
10
10
  </view>
11
11
  <view class="ml-list-menu-group-content" :style="contentStyle">
12
- <scroll-view scroll-y>
13
- <slot></slot>
14
- </scroll-view>
12
+ <slot></slot>
15
13
  </view>
16
14
  </view>
17
15
  </template>
@@ -167,20 +165,20 @@ export default {
167
165
  align-items: center;
168
166
  height: 70rpx;
169
167
  }
170
- .ml-list-menu-group-left-icon {
168
+ .ml-list-menu-group-title-icon {
171
169
  width: 60rpx;
172
170
  text-align: center;
173
171
  font-size: 38rpx;
174
172
  flex-shrink: 0;
175
173
  }
174
+ .ml-list-menu-group-title-content {
175
+ padding: 0 10rpx
176
+ }
176
177
  .ml-list-menu-group-content {
177
178
  display: flex;
178
179
  flex-direction: column;
179
180
  overflow-y: auto;
180
181
  overflow-x: hidden;
181
182
  }
182
- .ml-list-menu-group-title-content {
183
- padding: 0 10rpx
184
- }
185
183
  }
186
184
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.2.64",
3
+ "version": "0.2.66",
4
4
  "description": "码里云小程序组件库",
5
5
  "scripts": {
6
6
  "release": "node script/release.js && npm publish"