mali-applet-ui 0.2.62 → 0.2.64
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/components/ml-approval-record/ml-approval-record.vue +3 -3
- package/components/ml-approval-select/ml-approval-select.vue +23 -8
- package/components/ml-list-group/ml-list-group.vue +14 -9
- package/components/ml-list-item/ml-list-item.vue +24 -3
- package/components/ml-list-menu-group/ml-list-menu-group.vue +14 -9
- package/components/ml-list-menu-item/ml-list-menu-item.vue +27 -6
- package/package.json +1 -1
- package/utils/applet.js +0 -8
|
@@ -66,9 +66,9 @@ export default {
|
|
|
66
66
|
return
|
|
67
67
|
}
|
|
68
68
|
if (globalStore.approval && globalStore.approval.record) {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
Promise.resolve(
|
|
69
|
+
const loadOptionMethod = globalStore.approval.record.loadOption
|
|
70
|
+
if (loadOptionMethod) {
|
|
71
|
+
Promise.resolve(loadOptionMethod({
|
|
72
72
|
value: this.value,
|
|
73
73
|
code: this.code
|
|
74
74
|
})).then(options => {
|
|
@@ -37,7 +37,13 @@ export default {
|
|
|
37
37
|
},
|
|
38
38
|
data () {
|
|
39
39
|
return {
|
|
40
|
-
flowOptions: []
|
|
40
|
+
flowOptions: [],
|
|
41
|
+
approvalData: {
|
|
42
|
+
flowHandlers: [],
|
|
43
|
+
module: null,
|
|
44
|
+
flowSettingCode: null,
|
|
45
|
+
enableFlag: false
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
48
|
},
|
|
43
49
|
watch: {
|
|
@@ -47,21 +53,30 @@ export default {
|
|
|
47
53
|
},
|
|
48
54
|
created () {
|
|
49
55
|
this.flowOptions = this.options || []
|
|
56
|
+
this.approvalData.module = this.code
|
|
57
|
+
this.approvalData.flowSettingCode = this.code
|
|
50
58
|
this.load()
|
|
51
59
|
},
|
|
52
60
|
methods: {
|
|
53
|
-
|
|
61
|
+
updateModel () {
|
|
62
|
+
this.$emit('input', this.approvalData)
|
|
63
|
+
},
|
|
64
|
+
async load () {
|
|
65
|
+
await this.$nextTick()
|
|
54
66
|
if (!this.code) {
|
|
55
67
|
return
|
|
56
68
|
}
|
|
57
69
|
if (globalStore.approval && globalStore.approval.select) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
Promise.resolve(
|
|
61
|
-
value: this.value,
|
|
70
|
+
const loadFlowMethod = globalStore.approval.select.loadFlow
|
|
71
|
+
if (loadFlowMethod) {
|
|
72
|
+
Promise.resolve(loadFlowMethod({
|
|
62
73
|
code: this.code
|
|
63
|
-
})).then(
|
|
64
|
-
this.
|
|
74
|
+
})).then(res => {
|
|
75
|
+
this.approvalData.enableFlag = res.enableFlag
|
|
76
|
+
this.approvalData.flowSettingCode = res.flowSettingCode
|
|
77
|
+
this.approvalData.module = res.module
|
|
78
|
+
this.flowOptions = res.flowItems
|
|
79
|
+
this.updateModel()
|
|
65
80
|
})
|
|
66
81
|
}
|
|
67
82
|
}
|
|
@@ -180,7 +180,9 @@ export default {
|
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
182
|
updateStatus () {
|
|
183
|
-
const
|
|
183
|
+
const disableItems = this.itemList.filter(item => item.disabled)
|
|
184
|
+
const allSelectSize = this.selection.length + disableItems.length
|
|
185
|
+
const isAllChecked = allSelectSize > 0 && allSelectSize >= this.itemList.length
|
|
184
186
|
const isAllIndeterminate = this.selection.length > 0 && this.selection.length < this.itemList.length
|
|
185
187
|
this.$emit('update:isAllChecked', isAllChecked)
|
|
186
188
|
this.$emit('update:isAllIndeterminate', isAllIndeterminate)
|
|
@@ -213,14 +215,17 @@ export default {
|
|
|
213
215
|
labels = [label]
|
|
214
216
|
}
|
|
215
217
|
labels.forEach(val => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
this.selection.
|
|
218
|
+
const item = this.itemList.find(item => item.value === val)
|
|
219
|
+
if (item && !item.disabled) {
|
|
220
|
+
if (checked) {
|
|
221
|
+
if (!this.selection.includes(val)) {
|
|
222
|
+
this.selection.push(val)
|
|
223
|
+
}
|
|
224
|
+
} else {
|
|
225
|
+
const index = this.selection.indexOf(val)
|
|
226
|
+
if (index > -1) {
|
|
227
|
+
this.selection.splice(index, 1)
|
|
228
|
+
}
|
|
224
229
|
}
|
|
225
230
|
}
|
|
226
231
|
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-list-item" :class="[className || '', itemType ? `type-${itemType}` : '', {'is-padding': padding, 'is-vertical': itemVertical}]" :style="styles" @click="clickEvent" @tap="tapEvent">
|
|
3
3
|
<view v-if="itemType === 'checkbox'" class="ml-list-checkbox-icon">
|
|
4
|
-
<ml-checkbox :value="hasCheckedChecked"></ml-checkbox>
|
|
4
|
+
<ml-checkbox :value="hasCheckedChecked" :disabled="disabled"></ml-checkbox>
|
|
5
5
|
</view>
|
|
6
6
|
<view v-else-if="itemType === 'radio'" class="ml-list-radio-icon">
|
|
7
|
-
<ml-radio :value="hasRadioChecked" :label="value"></ml-radio>
|
|
7
|
+
<ml-radio :value="hasRadioChecked" :label="value" :disabled="disabled"></ml-radio>
|
|
8
8
|
</view>
|
|
9
9
|
<view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-item-left-icon">
|
|
10
10
|
<ml-icon :className="prefixIcon"></ml-icon>
|
|
@@ -34,8 +34,9 @@ export default {
|
|
|
34
34
|
default: null
|
|
35
35
|
},
|
|
36
36
|
content: String,
|
|
37
|
-
prefixIcon: String,
|
|
38
37
|
vertical: Boolean,
|
|
38
|
+
disabled: Boolean,
|
|
39
|
+
prefixIcon: String,
|
|
39
40
|
suffixIcon: {
|
|
40
41
|
type: String,
|
|
41
42
|
default: 'mlicon-arrow-right'
|
|
@@ -86,12 +87,21 @@ export default {
|
|
|
86
87
|
return this.listGroup ? this.listGroup.type : ''
|
|
87
88
|
}
|
|
88
89
|
},
|
|
90
|
+
watch: {
|
|
91
|
+
value () {
|
|
92
|
+
this.updateProp('value')
|
|
93
|
+
},
|
|
94
|
+
disabled () {
|
|
95
|
+
this.updateProp('disabled')
|
|
96
|
+
}
|
|
97
|
+
},
|
|
89
98
|
mounted () {
|
|
90
99
|
this.$nextTick(() => {
|
|
91
100
|
if (this.listGroup) {
|
|
92
101
|
this.listGroup.itemList.push({
|
|
93
102
|
mId: this.mId,
|
|
94
103
|
value: this.value,
|
|
104
|
+
disabled: this.disabled
|
|
95
105
|
})
|
|
96
106
|
}
|
|
97
107
|
})
|
|
@@ -102,9 +112,20 @@ export default {
|
|
|
102
112
|
}
|
|
103
113
|
},
|
|
104
114
|
methods: {
|
|
115
|
+
updateProp (prop) {
|
|
116
|
+
if (this.listGroup) {
|
|
117
|
+
const item = this.listGroup.itemList.find(item => item.mId === this.mId)
|
|
118
|
+
if (item) {
|
|
119
|
+
item[prop] = this[prop]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
105
123
|
clickEvent () {
|
|
106
124
|
},
|
|
107
125
|
tapEvent () {
|
|
126
|
+
if (this.disabled) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
108
129
|
if (this.listGroup) {
|
|
109
130
|
this.listGroup.triggerItemEvent({ value: this.value })
|
|
110
131
|
}
|
|
@@ -77,7 +77,9 @@ export default {
|
|
|
77
77
|
},
|
|
78
78
|
methods: {
|
|
79
79
|
updateStatus () {
|
|
80
|
-
const
|
|
80
|
+
const disableItems = this.itemList.filter(item => item.disabled)
|
|
81
|
+
const allSelectSize = this.selection.length + disableItems.length
|
|
82
|
+
const isAllChecked = allSelectSize > 0 && allSelectSize >= this.itemList.length
|
|
81
83
|
const isAllIndeterminate = this.selection.length > 0 && this.selection.length < this.itemList.length
|
|
82
84
|
this.$emit('update:isAllChecked', isAllChecked)
|
|
83
85
|
this.$emit('update:isAllIndeterminate', isAllIndeterminate)
|
|
@@ -110,14 +112,17 @@ export default {
|
|
|
110
112
|
labels = [label]
|
|
111
113
|
}
|
|
112
114
|
labels.forEach(val => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.selection.
|
|
115
|
+
const item = this.itemList.find(item => item.value === val)
|
|
116
|
+
if (item && !item.disabled) {
|
|
117
|
+
if (checked) {
|
|
118
|
+
if (!this.selection.includes(val)) {
|
|
119
|
+
this.selection.push(val)
|
|
120
|
+
}
|
|
121
|
+
} else {
|
|
122
|
+
const index = this.selection.indexOf(val)
|
|
123
|
+
if (index > -1) {
|
|
124
|
+
this.selection.splice(index, 1)
|
|
125
|
+
}
|
|
121
126
|
}
|
|
122
127
|
}
|
|
123
128
|
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-list-menu-item" :class="[className || '', itemType ? `type-${itemType}` : '', {'is-vertical': itemVertical}]" @click="clickEvent" @tap="tapEvent">
|
|
3
3
|
<view v-if="itemType === 'checkbox'" class="ml-list-menu-checkbox-icon">
|
|
4
|
-
<ml-checkbox :value="hasCheckedChecked"></ml-checkbox>
|
|
4
|
+
<ml-checkbox :value="hasCheckedChecked" :disabled="disabled"></ml-checkbox>
|
|
5
5
|
</view>
|
|
6
6
|
<view v-else-if="itemType === 'radio'" class="ml-list-menu-radio-icon">
|
|
7
|
-
<ml-radio :value="hasRadioChecked" :label="value"></ml-radio>
|
|
7
|
+
<ml-radio :value="hasRadioChecked" :label="value" :disabled="disabled"></ml-radio>
|
|
8
8
|
</view>
|
|
9
9
|
<view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-menu-item-left-icon">
|
|
10
10
|
<ml-icon :className="prefixIcon"></ml-icon>
|
|
@@ -39,6 +39,7 @@ export default {
|
|
|
39
39
|
name: String,
|
|
40
40
|
content: String,
|
|
41
41
|
vertical: Boolean,
|
|
42
|
+
disabled: Boolean,
|
|
42
43
|
prefixIcon: String,
|
|
43
44
|
suffixIcon: {
|
|
44
45
|
type: String,
|
|
@@ -82,22 +83,39 @@ export default {
|
|
|
82
83
|
return this.listMenuGroup ? this.listMenuGroup.type : ''
|
|
83
84
|
}
|
|
84
85
|
},
|
|
86
|
+
watch: {
|
|
87
|
+
value () {
|
|
88
|
+
this.updateProp('value')
|
|
89
|
+
},
|
|
90
|
+
disabled () {
|
|
91
|
+
this.updateProp('disabled')
|
|
92
|
+
}
|
|
93
|
+
},
|
|
85
94
|
mounted () {
|
|
86
95
|
this.$nextTick(() => {
|
|
87
|
-
if (this.
|
|
88
|
-
this.
|
|
96
|
+
if (this.listMenuGroup) {
|
|
97
|
+
this.listMenuGroup.itemList.push({
|
|
89
98
|
mId: this.mId,
|
|
90
99
|
value: this.value,
|
|
100
|
+
disabled: this.disabled
|
|
91
101
|
})
|
|
92
102
|
}
|
|
93
103
|
})
|
|
94
104
|
},
|
|
95
105
|
beforeDestroy () {
|
|
96
|
-
if (this.
|
|
97
|
-
XEUtils.remove(this.
|
|
106
|
+
if (this.listMenuGroup) {
|
|
107
|
+
XEUtils.remove(this.listMenuGroup.itemList, item => item.mId === this.mId)
|
|
98
108
|
}
|
|
99
109
|
},
|
|
100
110
|
methods: {
|
|
111
|
+
updateProp (prop) {
|
|
112
|
+
if (this.listMenuGroup) {
|
|
113
|
+
const item = this.listMenuGroup.itemList.find(item => item.mId === this.mId)
|
|
114
|
+
if (item) {
|
|
115
|
+
item[prop] = this[prop]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
101
119
|
getDotNum (num) {
|
|
102
120
|
return num > 99 ? '99+' : num
|
|
103
121
|
},
|
|
@@ -105,6 +123,9 @@ export default {
|
|
|
105
123
|
// this.$emit('click', {})
|
|
106
124
|
},
|
|
107
125
|
tapEvent () {
|
|
126
|
+
if (this.disabled) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
108
129
|
if (this.listMenuGroup) {
|
|
109
130
|
this.listMenuGroup.triggerItemEvent({ value: this.value })
|
|
110
131
|
}
|
package/package.json
CHANGED
package/utils/applet.js
CHANGED
|
@@ -7,8 +7,6 @@ export function getPlatformEnv () {
|
|
|
7
7
|
const platform = {
|
|
8
8
|
// H5
|
|
9
9
|
isH5: false,
|
|
10
|
-
isQWH5: false,
|
|
11
|
-
isDDH5: false,
|
|
12
10
|
// 微信
|
|
13
11
|
isWXMP: false,
|
|
14
12
|
// 企业微信
|
|
@@ -20,20 +18,14 @@ export function getPlatformEnv () {
|
|
|
20
18
|
}
|
|
21
19
|
if (/web/.test(sysRes.uniPlatform)) {
|
|
22
20
|
platform.isH5 = true
|
|
23
|
-
platform.isQWH5 = true
|
|
24
|
-
platform.isDDH5 = true
|
|
25
21
|
} else {
|
|
26
22
|
if (/WeChat/i.test(hostName)) {
|
|
27
|
-
platform.isWX = true
|
|
28
23
|
platform.isWXMP = true
|
|
29
24
|
} else if (/wxwork/i.test(hostName)) {
|
|
30
|
-
platform.isQW = true
|
|
31
25
|
platform.isQWMP = true
|
|
32
26
|
} else if (/DingTalk/i.test(hostName)) {
|
|
33
|
-
platform.isDD = true
|
|
34
27
|
platform.isDDMP = true
|
|
35
28
|
} else if (/alipay/i.test(hostName)) {
|
|
36
|
-
platform.isZFB = true
|
|
37
29
|
platform.isZFBMP = true
|
|
38
30
|
}
|
|
39
31
|
}
|