ui-process-h5 0.1.36 → 1.0.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.
Files changed (92) hide show
  1. package/build/configure/README.md +212 -0
  2. package/build/configure/package.json +28 -0
  3. package/build/scripts/postinstall.mjs +14 -0
  4. package/build/scripts/switch-cli.mjs +4 -0
  5. package/build/scripts/utils.mjs +60 -0
  6. package/index.html +12 -0
  7. package/package.json +51 -20
  8. package/src/App.vue +222 -0
  9. package/src/assets/font-icon/iconfont.scss +57 -0
  10. package/src/assets/font-icon/iconfont.ttf +0 -0
  11. package/src/assets/img/arrow-right.png +0 -0
  12. package/src/assets/img/arrow.png +0 -0
  13. package/src/assets/img/check.png +0 -0
  14. package/src/assets/js/auth.js +65 -0
  15. package/src/assets/js/errorCode.js +6 -0
  16. package/src/assets/js/message.js +352 -0
  17. package/src/assets/js/request.js +99 -0
  18. package/src/assets/js/toast.js +239 -0
  19. package/src/assets/js/top.js +229 -0
  20. package/src/assets/js/utils.js +83 -0
  21. package/src/assets/js/vuePopper.js +123 -0
  22. package/src/assets/query.png +0 -0
  23. package/src/assets/status/check.png +0 -0
  24. package/src/assets/status/del.png +0 -0
  25. package/src/main.js +17 -0
  26. package/src/packages/attchUpload/index.js +374 -0
  27. package/src/packages/attchUpload/index.scss +143 -0
  28. package/src/packages/attchUpload/index.vue +173 -0
  29. package/src/packages/downSelect/index.js +99 -0
  30. package/src/packages/downSelect/index.scss +86 -0
  31. package/src/packages/downSelect/index.vue +57 -0
  32. package/src/packages/index.js +6 -0
  33. package/src/packages/popup/index.js +73 -0
  34. package/src/packages/popup/index.scss +173 -0
  35. package/src/packages/popup/index.vue +80 -0
  36. package/src/packages/preview/index.js +36 -0
  37. package/src/packages/preview/index.vue +15 -0
  38. package/src/packages/previewImage/index.js +281 -0
  39. package/src/packages/previewImage/index.scss +76 -0
  40. package/src/packages/previewImage/index.vue +53 -0
  41. package/src/packages/process/index.js +923 -0
  42. package/src/packages/process/index.scss +175 -0
  43. package/src/packages/process/index.vue +263 -0
  44. package/src/packages/process/operation/backNode.vue +485 -0
  45. package/src/packages/process/operation/cancel.vue +518 -0
  46. package/src/packages/process/operation/ccTask.vue +473 -0
  47. package/src/packages/process/operation/complete.vue +1126 -0
  48. package/src/packages/process/operation/counterSign.vue +590 -0
  49. package/src/packages/process/operation/delegateTask.vue +587 -0
  50. package/src/packages/process/operation/msgList.vue +174 -0
  51. package/src/packages/process/operation/restart.vue +316 -0
  52. package/src/packages/submitPopup/index.js +644 -0
  53. package/src/packages/submitPopup/index.scss +88 -0
  54. package/src/packages/submitPopup/index.vue +154 -0
  55. package/src/packages/tab/index.js +236 -0
  56. package/src/packages/tab/index.scss +177 -0
  57. package/src/packages/tab/index.vue +155 -0
  58. package/src/packages/tip/index.js +80 -0
  59. package/src/packages/tip/index.scss +121 -0
  60. package/src/packages/tip/index.vue +57 -0
  61. package/src/packages/viewAttchList/index.js +134 -0
  62. package/src/packages/viewAttchList/index.scss +76 -0
  63. package/src/packages/viewAttchList/index.vue +112 -0
  64. package/src/style.css +80 -0
  65. package/vite.config.ts +107 -0
  66. package/packages/components/approval/index.js +0 -0
  67. package/packages/components/process/index.js +0 -8
  68. package/packages/components/process/src/attchlist-upload.vue +0 -585
  69. package/packages/components/process/src/operation/backNode.vue +0 -141
  70. package/packages/components/process/src/operation/cancel.vue +0 -170
  71. package/packages/components/process/src/operation/ccTask.vue +0 -170
  72. package/packages/components/process/src/operation/complete.vue +0 -224
  73. package/packages/components/process/src/operation/counterSign.vue +0 -178
  74. package/packages/components/process/src/operation/delegateTask.vue +0 -168
  75. package/packages/components/process/src/operation/restart.vue +0 -172
  76. package/packages/components/process/src/popup.vue +0 -230
  77. package/packages/components/process/src/process.vue +0 -900
  78. package/packages/components/process/src/tab.vue +0 -459
  79. package/packages/components/process/src/tip.vue +0 -207
  80. package/packages/index.js +0 -4
  81. /package/{packages/components/process/theme → src/assets}/img/add-file.png +0 -0
  82. /package/{packages/components/process/theme → src/assets}/img/del.png +0 -0
  83. /package/{packages/components/process/theme → src/assets}/img/doc.png +0 -0
  84. /package/{packages/components/process/theme → src/assets}/img/file.png +0 -0
  85. /package/{packages/components/process/theme → src/assets}/img/image.png +0 -0
  86. /package/{packages/components/process/theme → src/assets}/img/pdf.png +0 -0
  87. /package/{packages/components/process/theme → src/assets}/img/xls.png +0 -0
  88. /package/{packages/components/process/theme → src/assets}/img/zip.png +0 -0
  89. /package/{packages/components/process/theme → src/assets}/status/error.png +0 -0
  90. /package/{packages/components/process/theme → src/assets}/status/loading.png +0 -0
  91. /package/{packages/components/process/theme → src/assets}/status/success.png +0 -0
  92. /package/{packages/components/process/src → src/packages/process}/operation/index.js +0 -0
@@ -0,0 +1,281 @@
1
+ import { defineComponent } from "vue-demi";
2
+
3
+ export default defineComponent({
4
+ name: "preview-image",
5
+ props: {
6
+ // 图片列表
7
+ images: {
8
+ type: Array,
9
+ defalut: () => [],
10
+ },
11
+ startPosition: {
12
+ type: Number,
13
+ defalut: 0,
14
+ },
15
+ // 展示
16
+ visible: {
17
+ type: Boolean,
18
+ defalut: false,
19
+ },
20
+ // 当前位置
21
+ indexd: {
22
+ type: Number,
23
+ defalut: 0,
24
+ },
25
+ // 单一展示
26
+ isOne: {
27
+ type: Boolean,
28
+ defalut: false,
29
+ },
30
+ isStyle: {
31
+ type: String,
32
+ defalut: "",
33
+ },
34
+ },
35
+ data() {
36
+ return {
37
+ imagesList: [],
38
+
39
+ moveNum: 0,
40
+ flag: false,
41
+ // 当前屏幕宽度
42
+ windowWidth: 0,
43
+ windowHeight: 0,
44
+ // 初始获取当前触摸位置
45
+ startX: 0,
46
+ startY: 0,
47
+ // 移动计数
48
+ move: 0,
49
+ startMove: 0,
50
+ // 阈值
51
+ maxX: 0,
52
+ duration:
53
+ "transition-duration: 0.2s;transition-timing-function:ease;",
54
+ isIndex: 1,
55
+ show: false,
56
+ displacement: {
57
+ scale: 1,
58
+ },
59
+ styleZoom: "",
60
+ styleOrigin: "",
61
+ moveX: "-50%",
62
+ moveY: "-50%",
63
+ };
64
+ },
65
+
66
+ watch: {
67
+ images: {
68
+ handler(val, preVal) {
69
+ this.imagesList = val;
70
+ // console.log("打印图片列表:::", this.imagesList);
71
+ },
72
+ //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
73
+ //那么首次执行,val为默认值,preVal为undefined
74
+ immediate: true,
75
+ //这个参数代表监听对象时,可以监听深度嵌套的对象属性
76
+ deep: true,
77
+ },
78
+ visible: {
79
+ handler(val, preVal) {
80
+ this.show = val;
81
+ // console.log("打印:::", val);
82
+ },
83
+ immediate: true,
84
+ },
85
+ indexd: {
86
+ handler(val, preVal) {
87
+ if (val >= 0) {
88
+ this.isIndex = val + 1;
89
+ this.move = val * 100 * -1;
90
+ }
91
+ },
92
+ immediate: true,
93
+ },
94
+ },
95
+
96
+ methods: {
97
+ handelTouchstart(e) {
98
+ let touches = e.touches;
99
+ let events1 = touches[0];
100
+ let events2 = touches[1];
101
+
102
+ this.displacement.pageX = events1.pageX;
103
+ this.displacement.pageY = events1.pageY;
104
+
105
+ this.displacement.moveable = true;
106
+
107
+ if (events2) {
108
+ this.displacement.pageX2 = events2.pageX;
109
+ this.displacement.pageY2 = events2.pageY;
110
+ } else {
111
+ /* this.touchstartView(); */
112
+ this.duration =
113
+ "transition-duration: 0.05s;transition-timing-function:linear";
114
+ this.windowWidth =
115
+ (document.documentElement.clientWidth ||
116
+ document.body.clientWidth) / 100;
117
+ this.windowHeight =
118
+ (document.documentElement.clientHeight ||
119
+ document.body.clientHeight) / 100;
120
+ this.startX = e.touches[0].clientX;
121
+ this.startY = e.touches[0].clientY;
122
+ this.startMove = this.move;
123
+ }
124
+
125
+ /* console.log("touches", this.touches, this.events1, this.events2); */
126
+ this.displacement.originScale = this.displacement.scale || 1;
127
+ },
128
+
129
+ handelTouchmove(e) {
130
+ if (!this.displacement.moveable) {
131
+ return;
132
+ }
133
+
134
+ e.preventDefault();
135
+
136
+ let touches = e.touches;
137
+ let events = touches[0];
138
+ let events2 = touches[1];
139
+
140
+ if (events2) {
141
+ if (!this.displacement.pageX2) {
142
+ this.displacement.pageX2 = events2.pageX;
143
+ }
144
+ if (!this.displacement.pageY2) {
145
+ this.displacement.pageY2 = events2.pageY;
146
+ }
147
+
148
+ let zoom =
149
+ this.getDistance(
150
+ {
151
+ x: events.pageX,
152
+ y: events.pageY,
153
+ },
154
+ {
155
+ x: events2.pageX,
156
+ y: events2.pageY,
157
+ }
158
+ ) /
159
+ this.getDistance(
160
+ {
161
+ x: this.displacement.pageX,
162
+ y: this.displacement.pageY,
163
+ },
164
+ {
165
+ x: this.displacement.pageX2,
166
+ y: this.displacement.pageY2,
167
+ }
168
+ );
169
+
170
+ let newScale = this.displacement.originScale * zoom;
171
+ /* if (newScale > 1) {
172
+ newScale = 1;
173
+ } */
174
+
175
+ if (newScale < 0.5) {
176
+ newScale = 0.5;
177
+ } else if (newScale > 3) {
178
+ newScale = 3;
179
+ }
180
+
181
+ this.displacement.scale = newScale;
182
+
183
+ this.styleZoom = `scale(${newScale})`;
184
+ this.styleOrigin = `0 0`;
185
+
186
+ console.log("styleZoom", newScale);
187
+ } else {
188
+ console.log(
189
+ "移动",
190
+ e.touches[0].clientX - this.startX,
191
+ e.touches[0].clientY - this.startY
192
+ );
193
+
194
+ this.moveX = `calc(${
195
+ (e.touches[0].clientX - this.startX) /
196
+ this.displacement.scale
197
+ }px - 50%)`;
198
+
199
+ this.moveY = `calc(${
200
+ (e.touches[0].clientY - this.startY) /
201
+ this.displacement.scale
202
+ }px - 50%)`;
203
+ }
204
+ },
205
+
206
+ getDistance(start, stop) {
207
+ // Math.hypot()计算参数的平方根
208
+ return Math.hypot(stop.x - start.x, stop.y - start.y);
209
+ },
210
+
211
+ touchstartView(e) {
212
+ if (this.isOne) return;
213
+ // 获取元素
214
+ this.duration =
215
+ "transition-duration: 0.05s;transition-timing-function:linear";
216
+ this.flag = true;
217
+ this.windowWidth =
218
+ (document.documentElement.clientWidth ||
219
+ document.body.clientWidth) / 100;
220
+ this.startX = e.touches[0].clientX;
221
+ this.startMove = this.move;
222
+ },
223
+ touchmoveView(e) {
224
+ if (this.isOne) return;
225
+ // 判断当前操作方向
226
+ if (this.startX > e.touches[0].clientX) {
227
+ if (this.move <= -((this.imagesList.length - 1) * 100)) {
228
+ this.move = -((this.imagesList.length - 1) * 100);
229
+ } else {
230
+ this.move =
231
+ this.startMove +
232
+ Math.ceil(
233
+ (e.touches[0].clientX - this.startX) /
234
+ this.windowWidth
235
+ );
236
+ }
237
+ } else if (this.startX < e.touches[0].clientX && this.move < 0) {
238
+ if (this.move >= 0) {
239
+ this.move = 0;
240
+ } else {
241
+ this.move =
242
+ this.startMove +
243
+ Math.ceil(
244
+ (e.touches[0].clientX - this.startX) /
245
+ this.windowWidth
246
+ );
247
+ }
248
+ }
249
+ },
250
+ touchendView() {
251
+ if (this.isOne) return;
252
+ this.duration =
253
+ "transition-duration: 0.2s;transition-timing-function:ease";
254
+ let paint = Math.floor(Math.abs(this.move / 100));
255
+ let num = Math.abs((this.move / 100) % 1);
256
+ if (num > 0.5) {
257
+ this.isIndex = paint + 2;
258
+ this.move = (paint + 1) * 100 * -1;
259
+ } else {
260
+ this.isIndex = paint + 1;
261
+ this.move = paint * 100 * -1;
262
+ }
263
+ this.flag = false;
264
+ },
265
+ handleClose() {
266
+ this.$emit("update:visible", false);
267
+ },
268
+ },
269
+
270
+ mounted() {
271
+ // 渲染组件到body
272
+ this.$nextTick(() => {
273
+ const body = document.querySelector("body");
274
+ if (body.append) {
275
+ body.append(this.$el);
276
+ } else {
277
+ body.appendChild(this.$el);
278
+ }
279
+ });
280
+ },
281
+ });
@@ -0,0 +1,76 @@
1
+ .preview-image {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100vw;
6
+ height: 100vh;
7
+ z-index: 3999;
8
+ }
9
+
10
+ .preview-image-view {
11
+ width: 100%;
12
+ height: 100%;
13
+
14
+ position: relative;
15
+ }
16
+
17
+ .preview-image-view--img {
18
+ min-width: 100%;
19
+ position: fixed;
20
+ top: 50%;
21
+ display: inline-flex;
22
+ flex-wrap: nowrap;
23
+ justify-content: flex-start;
24
+ align-items: center;
25
+ z-index: 2999;
26
+ }
27
+
28
+ .preview-image-view--img .img-view {
29
+ width: 80%;
30
+ box-sizing: border-box;
31
+ margin: 0 10%;
32
+ z-index: 2;
33
+ position: relative;
34
+ }
35
+
36
+ .preview-image-mask {
37
+ position: fixed;
38
+ width: 100vw;
39
+ height: 100vh;
40
+ background-color: #000;
41
+ opacity: 0.7;
42
+ top: 0;
43
+ left: 0;
44
+ z-index: 1999;
45
+ transition: all 0.2s ease;
46
+ }
47
+
48
+ .preview-image-view--page {
49
+ position: absolute;
50
+ width: 100%;
51
+ bottom: 11px;
52
+ z-index: 2999;
53
+ display: flex;
54
+ justify-content: center;
55
+ }
56
+
57
+ .preview-image-view--page .page-item {
58
+ color: #fff;
59
+ font-size: 15px;
60
+ background-color: rgba(0, 0, 0, 0.5);
61
+ padding: 1px 9px;
62
+ border-radius: 11px;
63
+ }
64
+
65
+ .preview-image-view--one {
66
+ position: absolute;
67
+ z-index: 10000;
68
+ width: 50%;
69
+ left: 50%;
70
+ top: 50%;
71
+ transform: translate(-50%, -50%);
72
+ }
73
+
74
+ .preview-image-view--one .img-view {
75
+ width: 100%;
76
+ }
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div class="preview-image" v-if="visible">
3
+ <div class="preview-image-mask" @click="handleClose"></div>
4
+
5
+ <div
6
+ v-if="!isOne"
7
+ class="preview-image-view--img"
8
+ :style="`transform: translate(${move}%,-50%);${duration}`"
9
+ @touchstart="touchstartView"
10
+ @touchmove="touchmoveView"
11
+ @touchend="touchendView"
12
+ >
13
+ <div
14
+ class="preview-image-mask"
15
+ @click="handleClose"
16
+ style="opacity: 0; z-index: 1;"
17
+ ></div>
18
+ <img
19
+ class="img-view"
20
+ v-for="(v, i) in imagesList"
21
+ :key="i"
22
+ :src="v"
23
+ />
24
+ <!-- :style="`transform: translateX(${i * 100}%);`" -->
25
+ </div>
26
+ <div
27
+ v-else
28
+ class="preview-image-view--one"
29
+ @touchstart="handelTouchstart"
30
+ @touchmove="handelTouchmove"
31
+ :style="`transform:${styleZoom} translate(${moveX},${moveY});${duration};${
32
+ styleOrigin ? `transformOrigin:${styleOrigin}` : ''
33
+ };`"
34
+ >
35
+ <img
36
+ class="img-view"
37
+ v-for="(v, i) in imagesList"
38
+ :key="i"
39
+ :src="v"
40
+ />
41
+
42
+ <!-- :style="`transform: translateX(${i * 100}%);`" -->
43
+ </div>
44
+ <div class="preview-image-view--page" v-if="!isOne">
45
+ <span class="page-item">{{ isIndex }}/{{ imagesList.length }}</span>
46
+ </div>
47
+ <div class="preview-image-view--close"></div>
48
+ </div>
49
+ </template>
50
+ <script src="./index.js"></script>
51
+ <style lang="scss" scoped>
52
+ @import "./index.scss";
53
+ </style>