meixioacomponent 0.1.81 → 0.1.82

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": "meixioacomponent",
3
- "version": "0.1.81",
3
+ "version": "0.1.82",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -0,0 +1,256 @@
1
+ <template>
2
+ <div
3
+ class="base-mover-verifi-bar-wrap"
4
+ ref="baseMoveVerifiBarWrap"
5
+ @mousemove.stop="mousemove"
6
+ @mouseleave="mouseleave"
7
+ :class="{ complate: statusComplate, 'box-leave': !moveStatus }"
8
+ >
9
+ <div
10
+ ref="moverBox"
11
+ class="mover-box"
12
+ :style="moverBoxStyle"
13
+ @mouseup.stop="mouseup"
14
+ @mousedown.stop="mousedown"
15
+ >
16
+ <base-icon
17
+ :plain="false"
18
+ :name="iconClass"
19
+ class="right-icon"
20
+ :active="statusComplate"
21
+ ></base-icon>
22
+ </div>
23
+ <div class="base-notice-text" :class="{ 'box-moveing': moveStatus == 1 }">
24
+ <span>{{ statusComplate ? complateText : noticText }}</span>
25
+ </div>
26
+
27
+ <div class="progress-bar" :style="progressBarStyle"></div>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ export default {
33
+ name: "baseMoverVerifiBar",
34
+ data() {
35
+ return {
36
+ // 记录移动的距离
37
+ moveX: 0,
38
+ // 最大可滑动的距离
39
+ maxLeft: 0,
40
+ // box与style关联的值
41
+ moveLeft: 0,
42
+ // 是否处于加载状态
43
+ loading: true,
44
+ // 0为移动 1代表开始移动 2代表完成
45
+ moveStatus: 0,
46
+ };
47
+ },
48
+ mounted() {
49
+ this.init();
50
+ },
51
+ props: {
52
+ noticText: {
53
+ type: String,
54
+ default: "请按住滑块,滑动至最右边完成校验",
55
+ },
56
+
57
+ complateText: {
58
+ type: String,
59
+ default: "已完成校验",
60
+ },
61
+
62
+ value: {
63
+ type: Boolean,
64
+ require: true,
65
+ },
66
+ },
67
+ computed: {
68
+ module: {
69
+ set(val) {
70
+ this.$emit("input", val);
71
+ },
72
+ get() {
73
+ return this.$props.value;
74
+ },
75
+ },
76
+ moverBoxStyle() {
77
+ return {
78
+ left: `${this.moveLeft}px`,
79
+ };
80
+ },
81
+ progressBarStyle() {
82
+ return {
83
+ width: `${this.moveLeft}px`,
84
+ };
85
+ },
86
+ statusComplate() {
87
+ return this.moveStatus == 2;
88
+ },
89
+
90
+ iconClass() {
91
+ if (this.statusComplate) {
92
+ return "icon-zhengque";
93
+ } else {
94
+ return "icon-icon-arrow-right";
95
+ }
96
+ },
97
+ },
98
+ methods: {
99
+ init() {
100
+ this.$nextTick(() => {
101
+ this.maxLeft =
102
+ this.$refs.baseMoveVerifiBarWrap.clientWidth -
103
+ this.$refs.moverBox.clientWidth;
104
+ this.loading = false;
105
+ this.moveX = 0;
106
+ this.moveLeft = 0;
107
+ });
108
+ },
109
+
110
+ mousedown(e) {
111
+ if (this.moveStatus == 2) return;
112
+ this.moveStatus = 1;
113
+ this.moveX = e.pageX;
114
+ },
115
+ mousemove(e) {
116
+ if (!this.moveStatus) return;
117
+ if (this.moveLeft >= this.maxLeft) {
118
+ this.mouseleave();
119
+ return;
120
+ } else {
121
+ this.moveLeft += e.pageX - this.moveX;
122
+ this.moveX = e.pageX;
123
+ }
124
+ },
125
+ mouseleave() {
126
+ if (this.moveLeft < this.maxLeft) {
127
+ this.moveStatus = 0;
128
+ this.module = false;
129
+ this.init();
130
+ } else {
131
+ this.setComplate();
132
+ }
133
+ },
134
+
135
+ mouseup() {
136
+ this.mouseleave();
137
+ },
138
+
139
+ setComplate() {
140
+ this.moveStatus = 2;
141
+ this.module = true;
142
+ this.moveLeft = this.maxLeft;
143
+ this.$emit("verifiComplate");
144
+ },
145
+ },
146
+ };
147
+ </script>
148
+
149
+ <style lang="less" scoped>
150
+ .base-mover-verifi-bar-wrap {
151
+ width: 100%;
152
+ height: 40px;
153
+ overflow: hidden;
154
+ user-select: none;
155
+ position: relative;
156
+ border-radius: var(--radius);
157
+ background: var(--color-gray-m);
158
+ border: 1px solid var(--color-gray-d);
159
+ .mover-box {
160
+ z-index: 3;
161
+ width: 40px;
162
+ height: 100%;
163
+ cursor: move;
164
+ display: flex;
165
+ position: absolute;
166
+ align-items: center;
167
+ flex-flow: row nowrap;
168
+ justify-content: center;
169
+ background: var(--bg-white);
170
+
171
+ box-shadow: var(--shadow-fixed);
172
+
173
+ .right-icon {
174
+ cursor: move;
175
+ }
176
+ }
177
+
178
+ .box-moveing {
179
+ -webkit-text-fill-color: var(--text-white) !important;
180
+ span {
181
+ color: var(--text-white) !important;
182
+ }
183
+ }
184
+
185
+ .base-notice-text {
186
+ top: 0px;
187
+ left: 0px;
188
+ z-index: 2;
189
+ width: 100%;
190
+ height: 100%;
191
+ display: flex;
192
+ position: absolute;
193
+ align-items: center;
194
+ flex-flow: row nowrap;
195
+ justify-content: center;
196
+ background: -webkit-gradient(
197
+ linear,
198
+ left top,
199
+ right top,
200
+ color-stop(0, #4d4d4d),
201
+ color-stop(0.4, #4d4d4d),
202
+ color-stop(0.5, #fff),
203
+ color-stop(0.6, #4d4d4d),
204
+ color-stop(1, #4d4d4d)
205
+ );
206
+ background-clip: text;
207
+ -webkit-text-fill-color: transparent;
208
+ animation: slidetounlock 3s infinite;
209
+ text-size-adjust: none;
210
+ span {
211
+ color: var(--font-color-m);
212
+ font-size: var(--font-size-s);
213
+ }
214
+ }
215
+ .progress-bar {
216
+ top: 0px;
217
+ left: 0px;
218
+ z-index: 1;
219
+ height: 100%;
220
+ position: absolute;
221
+ background: var(--color-primary);
222
+ }
223
+ }
224
+
225
+ .complate {
226
+ .mover-box {
227
+ cursor: default;
228
+ .right-icon {
229
+ cursor: default;
230
+ }
231
+ }
232
+ .base-notice-text {
233
+ -webkit-text-fill-color: var(--text-white) !important;
234
+ span {
235
+ color: var(--text-white);
236
+ }
237
+ }
238
+ }
239
+
240
+ @keyframes slidetounlock {
241
+ 0% {
242
+ background-position: -200px 0px;
243
+ }
244
+
245
+ 100% {
246
+ background-position: 200px 0px;
247
+ }
248
+ }
249
+
250
+ .box-leave {
251
+ .progress-bar,
252
+ .mover-box {
253
+ transition: all 0.3s var(--ease-in);
254
+ }
255
+ }
256
+ </style>
@@ -0,0 +1,6 @@
1
+ import baseMoverVerifiBar from "./baseMoverVerifiBar.vue";
2
+
3
+ baseMoverVerifiBar.install = function (Vue) {
4
+ Vue.component(baseMoverVerifiBar.name, baseMoverVerifiBar);
5
+ };
6
+ export default baseMoverVerifiBar;
@@ -30,6 +30,7 @@ import baseDialogForm from "./proForm/dialogForm/dialogFormIndex";
30
30
  import baseForm from "./proForm/proForm/index";
31
31
  import baseFormWrap from "./proForm/proFormWrap/index";
32
32
  import baseProTable from "./proPageTable/index";
33
+ import baseMoverVerifiBar from "./base/baseMoverVerifiBar";
33
34
  // js 文件相关
34
35
  import DynamicMount from "./dynamicmount/index.js";
35
36
  import componentConfig from "../config/componentConfig";
@@ -72,6 +73,7 @@ const meixicomponents = [
72
73
  baseForm,
73
74
  baseFormWrap,
74
75
  baseProTable,
76
+ baseMoverVerifiBar,
75
77
  ];
76
78
 
77
79
  const install = (Vue) => {
@@ -124,5 +126,5 @@ export default {
124
126
  SelectStore,
125
127
  useImg,
126
128
  useFixedHeader,
127
- DynamicMountClass
129
+ DynamicMountClass,
128
130
  };
package/vue.config.js CHANGED
@@ -7,4 +7,8 @@ module.exports = {
7
7
  css: {
8
8
  extract: false,
9
9
  },
10
+
11
+ productionSourceMap: false,
12
+
13
+
10
14
  };