ui-process-h5 0.1.40 → 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 (58) hide show
  1. package/build/configure/README.md +83 -42
  2. package/build/configure/package.json +3 -2
  3. package/package.json +5 -2
  4. package/src/App.vue +87 -16
  5. package/src/assets/js/auth.js +36 -12
  6. package/src/assets/js/request.js +80 -71
  7. package/src/assets/js/utils.js +2 -1
  8. package/src/assets/status/check.png +0 -0
  9. package/src/assets/status/del.png +0 -0
  10. package/src/main.js +14 -12
  11. package/src/packages/attchUpload/index.js +19 -16
  12. package/src/packages/attchUpload/index.scss +10 -3
  13. package/src/packages/downSelect/index.js +25 -7
  14. package/src/packages/downSelect/index.scss +4 -0
  15. package/src/packages/downSelect/index.vue +6 -3
  16. package/src/packages/popup/index.js +17 -5
  17. package/src/packages/popup/index.scss +0 -1
  18. package/src/packages/popup/index.vue +1 -0
  19. package/src/packages/preview/index.vue +1 -1
  20. package/src/packages/previewImage/index.js +125 -2
  21. package/src/packages/previewImage/index.scss +19 -2
  22. package/src/packages/previewImage/index.vue +25 -4
  23. package/src/packages/process/index.js +299 -55
  24. package/src/packages/process/index.scss +12 -1
  25. package/src/packages/process/index.vue +114 -40
  26. package/src/packages/process/operation/backNode.vue +117 -25
  27. package/src/packages/process/operation/cancel.vue +133 -14
  28. package/src/packages/process/operation/ccTask.vue +46 -34
  29. package/src/packages/process/operation/complete.vue +729 -91
  30. package/src/packages/process/operation/counterSign.vue +130 -25
  31. package/src/packages/process/operation/delegateTask.vue +130 -23
  32. package/src/packages/process/operation/msgList.vue +174 -0
  33. package/src/packages/process/operation/restart.vue +15 -4
  34. package/src/packages/submitPopup/index.js +407 -59
  35. package/src/packages/submitPopup/index.scss +51 -46
  36. package/src/packages/submitPopup/index.vue +21 -5
  37. package/src/packages/tab/index.js +34 -5
  38. package/src/packages/tab/index.scss +2 -1
  39. package/src/packages/tab/index.vue +7 -7
  40. package/src/packages/tip/index.js +8 -2
  41. package/src/packages/tip/index.scss +39 -0
  42. package/src/packages/tip/index.vue +1 -1
  43. package/src/packages/viewAttchList/index.js +16 -14
  44. package/vite.config.ts +101 -72
  45. package/ui-process-h5/README.md +0 -171
  46. package/ui-process-h5/package.json +0 -27
  47. package/ui-process-h5/scripts/postinstall.mjs +0 -14
  48. package/ui-process-h5/scripts/switch-cli.mjs +0 -4
  49. package/ui-process-h5/scripts/utils.mjs +0 -60
  50. package/ui-process-h5/v2/style.css +0 -1
  51. package/ui-process-h5/v2/ui-process-h5.js +0 -13467
  52. package/ui-process-h5/v2/ui-process-h5.umd.cjs +0 -67
  53. package/ui-process-h5/v2.7/style.css +0 -1
  54. package/ui-process-h5/v2.7/ui-process-h5.js +0 -12844
  55. package/ui-process-h5/v2.7/ui-process-h5.umd.cjs +0 -67
  56. package/ui-process-h5/v3/style.css +0 -1
  57. package/ui-process-h5/v3/ui-process-h5.js +0 -10336
  58. package/ui-process-h5/v3/ui-process-h5.umd.cjs +0 -55
package/src/main.js CHANGED
@@ -1,15 +1,17 @@
1
- import { version } from 'vue-demi'
2
- import App from './App.vue'
3
- import { createApp } from 'vue3'
4
- import Vue2 from 'vue2'
5
- import Vue27 from 'vue2.7'
6
- if (version.startsWith('2.7.')) {
7
- new Vue2({ render: (h) => h(App) }).$mount('#app')
8
- }
9
- else if (version.startsWith('2.')) {
10
- new Vue27({ render: (h) => h(App) }).$mount('#app')
1
+ import { version } from "vue-demi";
2
+ import App from "./App.vue";
3
+ import { createApp } from "vue3";
4
+ import Vue2 from "vue2";
5
+ import Vue27 from "vue2.7";
6
+ import Vconsole from "vconsole";
7
+ if (version.startsWith("2.7.")) {
8
+ new Vue2({ render: (h) => h(App) }).$mount("#app");
9
+ } else if (version.startsWith("2.")) {
10
+ new Vue27({ render: (h) => h(App) }).$mount("#app");
11
11
  } else {
12
- const app = createApp(App)
13
- app.mount('#app')
12
+ const app = createApp(App);
13
+ app.mount("#app");
14
14
  }
15
15
 
16
+ /* let vConsole = new Vconsole();
17
+ export default vConsole */
@@ -165,30 +165,30 @@ export default defineComponent({
165
165
  },
166
166
 
167
167
  mounted() {
168
- // 兼容uni(uni编译会修改input属性,在点击上传时创建dom) upload-header-upload--item
168
+ // 兼容uni(uni编译会修改input属性,渲染完成后创建dom) upload-header-upload--item 兼容ios低版本,外部点击触发input事件
169
169
 
170
170
  this.$nextTick(() => {
171
171
  let input = document.createElement("input");
172
172
  input.type = "file";
173
173
  input.className = "upload-input";
174
- input.style = "opacity: 0;position: absolute;";
174
+ input.style = "opacity: 0;position: absolute;width:100%;height:100%;visibility: hidden;";
175
175
  input.multiple = true;
176
+ input.id = "fileUp";
176
177
  input.addEventListener("change", this.handleSelect);
177
178
  document.getElementById("inputfile").appendChild(input);
179
+ });
180
+ },
178
181
 
182
+ methods: {
183
+ // 拦截
184
+ handleClick() {
185
+ // console.log("拦截", this.haveCount, this.limit);
179
186
  if (
180
187
  "undefined" != typeof nativeMethod &&
181
188
  nativeMethod.vueSelectFile
182
189
  ) {
183
190
  nativeMethod.vueSelectFile(2, "*", this.limit || 1);
184
191
  }
185
- });
186
- },
187
-
188
- methods: {
189
- // 拦截
190
- handleClick() {
191
- console.log("拦截", this.haveCount, this.limit);
192
192
  if (this.haveCount <= 0) {
193
193
  this.handleTips(
194
194
  `最多上传${props.limit}个文件`,
@@ -197,12 +197,16 @@ export default defineComponent({
197
197
  );
198
198
  return;
199
199
  }
200
+
201
+ document.getElementById("fileUp").click();
202
+ /* console.log("click:::",document.getElementById("fileUp")) */
200
203
  },
201
204
  // 上传选择
202
205
  async handleSelect(value, items) {
203
206
  this.handleTips("上传中", true, "loading");
204
- console.log("formData", value.target.files);
207
+ // console.log("formData", value.target.files);
205
208
  const files = Array.from(value.target.files);
209
+ document.getElementById("fileUp").value = "";
206
210
  let num = 0;
207
211
  let numLength =
208
212
  this.haveCount > files.length ? files.length : this.haveCount;
@@ -283,7 +287,7 @@ export default defineComponent({
283
287
  }
284
288
  this.handleTips("上传成功", true, "success");
285
289
  this.viewImage();
286
- console.log("当前已上传", this.filesArr);
290
+ // console.log("当前已上传", this.filesArr);
287
291
  this.emitView();
288
292
  } catch (err) {
289
293
  this.handleTips("上传失败", true, "error");
@@ -308,18 +312,18 @@ export default defineComponent({
308
312
  },
309
313
  // 预览
310
314
  viewFile(data, index) {
311
- console.log("data", data);
315
+ // console.log("data", data);
312
316
  if (
313
317
  this.imgIcon.includes(
314
318
  data.name.substring(data.name.lastIndexOf(".") + 1)
315
319
  )
316
320
  ) {
317
- this.visible = true;
318
321
  this.indexd = this.lists.indexOf(data.url);
322
+ this.visible = true;
319
323
  } else {
320
324
  if (data.url) {
321
- this.visibleS = true;
322
325
  this.fileUrl = data.url;
326
+ this.visibleS = true;
323
327
  }
324
328
  }
325
329
  },
@@ -346,13 +350,12 @@ export default defineComponent({
346
350
  },
347
351
  // 发送数据
348
352
  emitView() {
349
- console.log("已发送数据:", this.filesArr);
350
353
  this.$emit("getValue", this.filesArr);
351
354
  },
352
355
  // clear node
353
356
  clearData() {
354
357
  this.filesArr = [];
355
- console.log("clear!!!!!");
358
+ // console.log("clear!!!!!");
356
359
  },
357
360
 
358
361
  // tips
@@ -10,7 +10,6 @@
10
10
  }
11
11
  .attch-upload-body {
12
12
  width: 100%;
13
- position: relative;
14
13
  }
15
14
  .upload-close {
16
15
  box-sizing: border-box;
@@ -40,13 +39,19 @@
40
39
  color: #ee0000;
41
40
  }
42
41
 
42
+ .upload-header-title {
43
+ height: 100%;
44
+ display: flex;
45
+ align-items: center;
46
+ }
47
+
43
48
  .upload-header-close {
44
49
  width: 18px;
45
50
  height: 18px;
46
51
  }
47
52
 
48
53
  .upload-header-upload {
49
- height: 18px;
54
+ height: 100%;
50
55
 
51
56
  font-size: 14px;
52
57
  color: #1389ff;
@@ -59,6 +64,8 @@
59
64
  .upload-header-upload--item {
60
65
  display: flex;
61
66
  align-items: center;
67
+ height: 100%;
68
+ position: relative;
62
69
  }
63
70
 
64
71
  .upload-header-upload--item img {
@@ -133,4 +140,4 @@
133
140
  height: 100dvh;
134
141
  display: flex;
135
142
  flex-direction: column;
136
- }
143
+ }
@@ -25,6 +25,16 @@ export default defineComponent({
25
25
  type: Boolean,
26
26
  default: false,
27
27
  },
28
+ // 默认选择
29
+ defaultValue: {
30
+ type: String,
31
+ default: "",
32
+ },
33
+ // 提示
34
+ placeholder: {
35
+ type: String,
36
+ default: "请选择",
37
+ },
28
38
  },
29
39
  data() {
30
40
  return {
@@ -44,15 +54,22 @@ export default defineComponent({
44
54
  handler(val, preVal) {
45
55
  if (val && val.length) {
46
56
  this.lists = val;
47
- this.activeItem = val[0];
48
- this.active = this.activeItem.id;
49
- this.$emit("change", this.activeItem);
50
- console.log("接受下拉:::", val, this.lists);
57
+ console.log("select::::",val,this.lists)
51
58
  }
52
59
  },
53
60
  immediate: true,
54
61
  deep: true,
55
62
  },
63
+ defaultValue: {
64
+ handler(val, preVal) {
65
+ this.active = val;
66
+ let data = this.lists.filter((v, i) => {
67
+ return v.id == val;
68
+ });
69
+ this.activeItem = data[0];
70
+ this.$emit("change", this.activeItem);
71
+ },
72
+ },
56
73
  },
57
74
  computed: {
58
75
  arrow() {
@@ -66,16 +83,17 @@ export default defineComponent({
66
83
  // 展开当前下拉
67
84
  handleExpand() {
68
85
  this.expand ? (this.expand = false) : (this.expand = true);
69
- console.log("handleExpand", this.expand);
86
+ // console.log("handleExpand", this.expand);
70
87
  },
71
88
 
72
89
  // 点击选择
73
90
  handleClick(item, index) {
74
- console.log("当前选择:::", item, index);
91
+ // console.log("当前选择:::", item, index);
92
+ if (this.active == item.id) return;
75
93
  this.active = item.id;
76
94
  this.activeItem = item;
77
95
  this.expand = false;
78
- this.$emit("change", this.activeItem);
96
+ this.$emit("change", this.activeItem, this.lists);
79
97
  },
80
98
  },
81
99
  });
@@ -19,6 +19,10 @@
19
19
  box-shadow: none;
20
20
  }
21
21
 
22
+ &-placeholder {
23
+ color: #888;
24
+ }
25
+
22
26
  &--arrow {
23
27
  width: 10px;
24
28
  height: 10px;
@@ -3,9 +3,12 @@
3
3
  <div
4
4
  class="top-select-menu"
5
5
  @click="handleExpand"
6
- :class="[border && 'top-select-menu-border']"
6
+ :class="[
7
+ border && 'top-select-menu-border',
8
+ !activeItem.name && 'top-select-menu-placeholder',
9
+ ]"
7
10
  >
8
- {{ activeItem.name }}
11
+ {{ activeItem.name ? activeItem.name : placeholder }}
9
12
  <img
10
13
  class="top-select-menu--arrow"
11
14
  :src="arrow"
@@ -28,7 +31,7 @@
28
31
  :style="`${
29
32
  expand
30
33
  ? 'transform: translateY(2%);visibility: visible; opacity: 1;'
31
- : 'transform: translateY(-100%);visibility: hidden; opacity: 0'
34
+ : 'transform: translateY(-50%);visibility: hidden; opacity: 0'
32
35
  };${optionStyle ? optionStyle : ''}`"
33
36
  >
34
37
  <div
@@ -16,10 +16,12 @@ export default defineComponent({
16
16
  visible: { default: false, type: Boolean }, // 展示
17
17
  isIndex: { type: Number }, // 层级
18
18
  width: { type: String, default: "95vw" },
19
+ className: { type: String, default: "" },
19
20
  },
20
21
  data() {
21
22
  return {
22
23
  show: false,
24
+ top: 0,
23
25
  };
24
26
  },
25
27
  watch: {
@@ -34,10 +36,18 @@ export default defineComponent({
34
36
  methods: {
35
37
  handleOpen() {
36
38
  this.show = true;
39
+ this.top = window.scrollY;
40
+ document.body.position = "fixed";
41
+ document.body.top = -this.top + "px";
37
42
  },
38
43
  handleClose() {
44
+ document.body.position = "";
45
+ document.body.top = "";
46
+ window.scrollTo(0, this.top);
39
47
  this.show = false;
40
48
  this.$emit("update:visible", false);
49
+
50
+ // this.$destroy();
41
51
  },
42
52
  handleCancel() {
43
53
  typeof this.cancel === "function" && this.cancel();
@@ -50,11 +60,13 @@ export default defineComponent({
50
60
  mounted() {
51
61
  // 渲染组件到body
52
62
  this.$nextTick(() => {
53
- const body = document.querySelector("body");
54
- if (body.append) {
55
- body.append(this.$el);
56
- } else {
57
- body.appendChild(this.$el);
63
+ if (document.getElementsByClassName("process-warp")[0]) {
64
+ const body = document.getElementsByClassName("process-warp")[0];
65
+ if (body.append) {
66
+ body.append(this.$el);
67
+ } else {
68
+ body.appendChild(this.$el);
69
+ }
58
70
  }
59
71
  });
60
72
  },
@@ -31,7 +31,6 @@
31
31
  font-size: 15px;
32
32
  background-color: #fff;
33
33
  position: relative;
34
- z-index: 209;
35
34
  }
36
35
 
37
36
  .top-popup-header .header-title {
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  class="top-popup-zindex"
4
4
  :style="`${isIndex ? `z-index:${isIndex}` : ''}`"
5
+ :class="className"
5
6
  >
6
7
  <div
7
8
  class="top-popup-mask"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div style="width: 100%; height: calc(100% - 40px);">
2
+ <div style="width: 100%; height: calc(100% - 40px);" v-if="url">
3
3
  <video style="height: 100%; width: 100vw;" controls v-if="videoShow">
4
4
  <source :src="url" type="video/mp4" />
5
5
  </video>
@@ -40,8 +40,10 @@ export default defineComponent({
40
40
  flag: false,
41
41
  // 当前屏幕宽度
42
42
  windowWidth: 0,
43
+ windowHeight: 0,
43
44
  // 初始获取当前触摸位置
44
45
  startX: 0,
46
+ startY: 0,
45
47
  // 移动计数
46
48
  move: 0,
47
49
  startMove: 0,
@@ -51,6 +53,13 @@ export default defineComponent({
51
53
  "transition-duration: 0.2s;transition-timing-function:ease;",
52
54
  isIndex: 1,
53
55
  show: false,
56
+ displacement: {
57
+ scale: 1,
58
+ },
59
+ styleZoom: "",
60
+ styleOrigin: "",
61
+ moveX: "-50%",
62
+ moveY: "-50%",
54
63
  };
55
64
  },
56
65
 
@@ -58,7 +67,7 @@ export default defineComponent({
58
67
  images: {
59
68
  handler(val, preVal) {
60
69
  this.imagesList = val;
61
- console.log("打印图片列表:::", this.imagesList);
70
+ // console.log("打印图片列表:::", this.imagesList);
62
71
  },
63
72
  //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
64
73
  //那么首次执行,val为默认值,preVal为undefined
@@ -69,7 +78,7 @@ export default defineComponent({
69
78
  visible: {
70
79
  handler(val, preVal) {
71
80
  this.show = val;
72
- console.log("打印:::", val);
81
+ // console.log("打印:::", val);
73
82
  },
74
83
  immediate: true,
75
84
  },
@@ -85,6 +94,120 @@ export default defineComponent({
85
94
  },
86
95
 
87
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
+
88
211
  touchstartView(e) {
89
212
  if (this.isOne) return;
90
213
  // 获取元素
@@ -26,7 +26,11 @@
26
26
  }
27
27
 
28
28
  .preview-image-view--img .img-view {
29
- width: 100%;
29
+ width: 80%;
30
+ box-sizing: border-box;
31
+ margin: 0 10%;
32
+ z-index: 2;
33
+ position: relative;
30
34
  }
31
35
 
32
36
  .preview-image-mask {
@@ -56,4 +60,17 @@
56
60
  background-color: rgba(0, 0, 0, 0.5);
57
61
  padding: 1px 9px;
58
62
  border-radius: 11px;
59
- }
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
+ }
@@ -3,23 +3,44 @@
3
3
  <div class="preview-image-mask" @click="handleClose"></div>
4
4
 
5
5
  <div
6
+ v-if="!isOne"
6
7
  class="preview-image-view--img"
7
- :style="`transform: translate(${move}%,-50%);${duration}${
8
- isOne ? 'justify-content: center;width:auto;' : ''
9
- }`"
8
+ :style="`transform: translate(${move}%,-50%);${duration}`"
10
9
  @touchstart="touchstartView"
11
10
  @touchmove="touchmoveView"
12
11
  @touchend="touchendView"
13
12
  >
13
+ <div
14
+ class="preview-image-mask"
15
+ @click="handleClose"
16
+ style="opacity: 0; z-index: 1;"
17
+ ></div>
14
18
  <img
15
19
  class="img-view"
16
20
  v-for="(v, i) in imagesList"
17
21
  :key="i"
18
22
  :src="v"
19
- :style="isOne ? isStyle : ''"
20
23
  />
21
24
  <!-- :style="`transform: translateX(${i * 100}%);`" -->
22
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>
23
44
  <div class="preview-image-view--page" v-if="!isOne">
24
45
  <span class="page-item">{{ isIndex }}/{{ imagesList.length }}</span>
25
46
  </div>