mali-applet-ui 1.1.64 → 1.1.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.
@@ -3,7 +3,7 @@
3
3
  <view class="ml-list-select-page-warpper">
4
4
  <view v-if="hasEmpty" class="ml-list-select-page-placeholder">{{ readonly ? '' : placeholder }}</view>
5
5
  <view v-else>
6
- <slot :items="selectRows">
6
+ <slot :items="selectRowList">
7
7
  <view>{{ selectLabel }}</view>
8
8
  </slot>
9
9
  </view>
@@ -27,6 +27,7 @@ export default {
27
27
  name: 'MlListSelectPage',
28
28
  props: {
29
29
  value: [Array, Number, String],
30
+ selectRows: Array,
30
31
  defaultOptions: Array,
31
32
  options: Array,
32
33
  optionProps: Object,
@@ -72,11 +73,11 @@ export default {
72
73
  }
73
74
  return XEUtils.eqNull(this.value) || this.value === ''
74
75
  },
75
- selectRows () {
76
+ selectRowList () {
76
77
  return this.getSelectRows(this.value)
77
78
  },
78
79
  selectLabel () {
79
- return this.selectRows.map(item => item[this.optLabelField]).join(',')
80
+ return this.selectRowList.map(item => item[this.optLabelField]).join(',')
80
81
  }
81
82
  },
82
83
  watch: {
@@ -115,6 +116,7 @@ export default {
115
116
  value = this.value.filter(key => key !== item[this.optValueField])
116
117
  }
117
118
  this.$emit('input', value)
119
+ this.$emit('update:selectRows', this.getSelectRows(value))
118
120
  },
119
121
  tapEvent () {
120
122
  if (this.showAddBtn || this.disabled) {
@@ -144,6 +146,7 @@ export default {
144
146
  // 点击确认事件
145
147
  confirm: (params) => {
146
148
  this.$emit('input', params.value)
149
+ this.$emit('update:selectRows', params.selectRows)
147
150
  this.$emit('change', params)
148
151
  }
149
152
  }
@@ -1,20 +1,31 @@
1
1
  <template>
2
2
  <view class="ml-progress-bar" :class="className">
3
- <view class="progress-bar-header">
3
+ <view v-if="showHeader || title" class="progress-bar-header">
4
4
  <slot name="header">
5
5
  <view v-if="title" class="progress-header-title" :class="{'is-underline': titleUnderline}">{{ title }}</view>
6
- <view v-if="title && showNum" class="progress-header-num">{{ value || 0 }}{{ unit || '' }}</view>
6
+ <view v-if="showTitleNum" class="progress-header-num">{{ titleNum || (`${value || 0}${unit || ''}`) }}</view>
7
7
  </slot>
8
8
  </view>
9
- <view class="progress-bar-chart" :class="{'show-num': !title && showNum}" @click="barClick">
10
- <progress
9
+ <view class="progress-bar-chart" @click="barClick">
10
+ <view v-if="showBarTitle" class="progress-bar-left" :style="barLeftStyle">
11
+ <slot name="bar_title">
12
+ <text>{{ barTitle || '' }}</text>
13
+ </slot>
14
+ </view>
15
+ <view class="progress-bar-content">
16
+ <progress
11
17
  :percent="percNum"
12
18
  :activeColor="activeColor || '#1890FF'"
13
19
  :backgroundColor="backgroundColor"
14
20
  :strokeWidth="strokeWidth"
15
21
  :fontSize="fontSize"
16
22
  :border-radius="borderRadius" />
17
- <view v-if="!title && showNum" class="progress-bar-num">{{ value || 0 }}{{ unit || '' }}</view>
23
+ </view>
24
+ <view v-if="showBarNum" class="progress-bar-right">
25
+ <slot name="bar_num">
26
+ <text>{{ barNum || (`${value || 0}${unit || ''}`) }}</text>
27
+ </slot>
28
+ </view>
18
29
  </view>
19
30
  <view class="progress-bar-footer">
20
31
  <slot name="footer"></slot>
@@ -38,9 +49,13 @@ export default {
38
49
  },
39
50
  title: String,
40
51
  titleUnderline: Boolean,
52
+ showHeader: Boolean,
53
+ showBarTitle: Boolean,
54
+ barTitle: String,
55
+ barTitleWidth: [Number, String],
41
56
  strokeWidth: {
42
57
  type: [Number, String],
43
- default: 12
58
+ default: 14
44
59
  },
45
60
  activeColor: String,
46
61
  fontSize: {
@@ -52,11 +67,21 @@ export default {
52
67
  default: '4rpx'
53
68
  },
54
69
  backgroundColor: String,
55
- showNum: Boolean,
70
+ showTitleNum: Boolean,
71
+ titleNum: [Number, String],
72
+ showBarNum: Boolean,
73
+ barNum: Boolean,
56
74
  unit: String,
57
75
  className: String
58
76
  },
59
77
  computed: {
78
+ barLeftStyle () {
79
+ let stys = ''
80
+ if (this.barTitleWidth) {
81
+ stys = `width: ${XEUtils.isString(this.barTitleWidth) ? this.barTitleWidth : `${this.barTitleWidth}rpx`}`
82
+ }
83
+ return stys
84
+ },
60
85
  percNum () {
61
86
  return Math.ceil(XEUtils.toNumber(this.value) / (Math.max(1, XEUtils.toNumber(this.max)) / 100))
62
87
  },
@@ -81,19 +106,28 @@ export default {
81
106
  text-align: left;
82
107
  }
83
108
  .progress-bar-chart {
84
- height: 24rpx;
109
+ display: flex;
110
+ flex-direction: row;
85
111
  position: relative;
86
112
  margin: 12rpx 0;
87
- &.show-num {
88
- padding-right: 80rpx;
113
+ .progress-bar-left,
114
+ .progress-bar-right {
115
+ flex-shrink: 0;
116
+ font-size: 24rpx;
117
+ padding: 0 4rpx;
118
+ overflow: hidden;
119
+ text-overflow: ellipsis;
120
+ white-space: nowrap;
89
121
  }
90
- .progress-bar-num {
91
- position: absolute;
92
- right: 0;
93
- top: 0;
94
- line-height: 24rpx;
95
- min-width: 38rpx;
96
- text-align: left;
122
+ .progress-bar-left {
123
+ width: 80rpx;
124
+ }
125
+ .progress-bar-right {
126
+ width: 120rpx;
127
+ }
128
+ .progress-bar-content {
129
+ flex-grow: 1;
130
+ overflow: hidden;
97
131
  }
98
132
  }
99
133
  .progress-header-title {
@@ -107,9 +141,7 @@ export default {
107
141
  }
108
142
  }
109
143
  .progress-header-num {
110
- flex-grow: 1;
111
- min-width: 60rpx;
112
- text-align: right;
144
+ flex-shrink: 0;
113
145
  }
114
146
  }
115
147
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.1.64",
3
+ "version": "1.1.66",
4
4
  "description": "码里UI-小程序组件库(vue2)",
5
5
  "files": [
6
6
  "lib",