ui-process-h5 0.1.15 → 0.1.22

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.
@@ -0,0 +1,467 @@
1
+ <template>
2
+ <div class="tops-tab">
3
+ <div class="tops-tab-header">
4
+ <template v-for="(item, i) of isTapList">
5
+ <div
6
+ class="tops-tab-header-items"
7
+ :class="[item.key === active ? 'active' : '']"
8
+ @click="handleActive(item.key, i)"
9
+ ref="label"
10
+ >
11
+ {{ item.label }}
12
+ </div>
13
+ </template>
14
+ <div class="bottom-line" v-if="isTapList.length"></div>
15
+ </div>
16
+ <div class="tops-tab-body">
17
+ <div
18
+ v-for="item in isTapList"
19
+ :key="item.key"
20
+ v-show="active === item.key"
21
+ style="height: calc(100% - 45px);"
22
+ >
23
+ <!-- :taskNode="getTaskNode()" -->
24
+ <slot
25
+ v-if="item.key === 'a' && item.type === 'default'"
26
+ name="default"
27
+ ></slot>
28
+ <slot
29
+ v-if="item.key === 'b' && item.type === 'default'"
30
+ :name="item.slot"
31
+ >
32
+ <iframe
33
+ v-if="trackUrl"
34
+ :src="trackUrl"
35
+ style="width: 100%; min-height: 500px; border: none;"
36
+ scrolling="no"
37
+ frameborder="0"
38
+ ></iframe>
39
+ <div v-else class="textnone">
40
+ 暂无流程图
41
+ </div>
42
+ </slot>
43
+ <slot
44
+ v-if="item.key === 'c' && item.type === 'default'"
45
+ :name="item.slot"
46
+ >
47
+ <div
48
+ v-if="taskCommentList?.length > 0"
49
+ v-for="(item, index) in taskCommentList"
50
+ :key="item.id"
51
+ class="seal-list__item"
52
+ >
53
+ <!-- <div v-for="item in list" :key="item.id" class="seal-list__item"> -->
54
+ <div>
55
+ <div class="seal-list__item--option">
56
+ <span>节点名称</span>
57
+ <span>{{ item.activityName }}</span>
58
+ </div>
59
+ <div class="seal-list__item--option">
60
+ <span>审批人</span>
61
+ <span>{{ item.createUserName }}</span>
62
+ </div>
63
+ <div class="seal-list__item--option">
64
+ <span>审批操作</span>
65
+ <span>{{ item.actionName }}</span>
66
+ </div>
67
+ <div class="seal-list__item--option">
68
+ <span>审批意见</span>
69
+ <span v-html="item.msg"></span>
70
+ </div>
71
+ <div class="seal-list__item--option">
72
+ <span>审批时间</span>
73
+ <span>{{ item.createDate }}</span>
74
+ </div>
75
+ <div
76
+ v-if="
77
+ item.metaAnnexList &&
78
+ item.metaAnnexList.length
79
+ "
80
+ class="seal-list__item--attch"
81
+ >
82
+ <!-- @click="linkUrl(item.metaAnnexList, index)" -->
83
+ <span>查看附件</span>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ <div v-else class="textnone">暂无数据</div>
88
+ </slot>
89
+ <slot v-if="item.type == 'slot'" :name="item.slot"></slot>
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </template>
94
+
95
+ <script lang="ts">
96
+ import { defineComponent, ref, watch, onMounted, computed } from "vue-demi";
97
+ // import { getProcessStatus } from "../../utils/request/api";
98
+
99
+ export default defineComponent({
100
+ name: "TopTab",
101
+ props: {
102
+ /**
103
+ * 根据参数插入自定义tab
104
+ * label:选项卡title
105
+ * key:选项卡ID 请勿重复defaultTabList内已拥有的默认key
106
+ * type:插槽类型 "slot" "default"
107
+ * sort:排序参数,无参数默认插入末尾
108
+ * slot:插槽name
109
+ */
110
+ tapList: {
111
+ type: Array,
112
+ default: () => [],
113
+ },
114
+ // 自定义tab (传入后 默认tab,tapList,失效)
115
+ selfTapList: {
116
+ type: Array,
117
+ default: () => [],
118
+ },
119
+ },
120
+ setup(props: any) {
121
+ // 流程图
122
+ const trackUrl = ref<string>(
123
+ "http://59.53.91.231:8088/portal/r/w?sid=6f714ec1-7570-4525-ac51-b092402d8295&cmd=CLIENT_BPM_FORM_TRACK_OPEN&processInstId=1f6e7196-e1ea-428e-b295-aa23a54a2402&supportCanvas=true&formInfo="
124
+ );
125
+
126
+ // 审批信息
127
+ const taskCommentList = ref<any>([
128
+ {
129
+ actionName: "提交",
130
+ activityName: "部门负责人",
131
+ createDate: "2023-04-20 14:47:35",
132
+ createUser: "18ccbf63229f0c79f39940ae284c111e",
133
+ createUserName: "朱鸿飞",
134
+ customUniqueId: "",
135
+ departmentName: "测试部",
136
+ id: "88df38c8-9756-4b4a-a9b0-dcb0ec1b57d5",
137
+ metaAnnexList: null,
138
+ msg: "同意",
139
+ positionName: "测试部119147",
140
+ processInstId: "1f6e7196-e1ea-428e-b295-aa23a54a2402",
141
+ taskInstId: "38bbef1c-efbb-456d-bd79-08ed9d96b4b3",
142
+ },
143
+ ]);
144
+
145
+ // 选中
146
+ const active = ref<string>("");
147
+
148
+ // tab 渲染
149
+ const defaultTabList = ref<any>([
150
+ {
151
+ label: "基本信息",
152
+ key: "a",
153
+ type: "default",
154
+ slot: "default",
155
+ },
156
+ {
157
+ label: "流程图",
158
+ key: "b",
159
+ type: "default",
160
+ slot: "tab2",
161
+ },
162
+ {
163
+ label: "审批记录",
164
+ key: "c",
165
+ type: "default",
166
+ slot: "tab3",
167
+ },
168
+ ]);
169
+
170
+ const isTapList = ref<any>([
171
+ {
172
+ label: "基本信息",
173
+ key: "a",
174
+ type: "default",
175
+ slot: "default",
176
+ },
177
+ {
178
+ label: "流程图",
179
+ key: "b",
180
+ type: "default",
181
+ slot: "tab2",
182
+ },
183
+ {
184
+ label: "审批记录",
185
+ key: "c",
186
+ type: "default",
187
+ slot: "tab3",
188
+ },
189
+ ]);
190
+
191
+ const label = ref<any>();
192
+
193
+ // taskNode taskObj
194
+
195
+ /* method */
196
+ // 选中方法
197
+ const handleActive = (e: string, i: number) => {
198
+ if (e === active.value) {
199
+ return;
200
+ }
201
+
202
+ active.value = e;
203
+ tabAnimation(i);
204
+ };
205
+
206
+ const tabAnimation = (i: number) => {
207
+ if (label.value.length) {
208
+ let doc = <any>(
209
+ document.getElementsByClassName("bottom-line")[0]
210
+ );
211
+ let left;
212
+ if (doc.offsetWidth < label.value[i].offsetWidth - 10) {
213
+ let num =
214
+ (label.value[i].offsetWidth - doc.offsetWidth - 10) / 2;
215
+ left = `${label.value[i].offsetLeft + num}px`;
216
+ } else if (doc.offsetWidth > label.value[i].offsetWidth - 10) {
217
+ let num =
218
+ (doc.offsetWidth - label.value[i].offsetWidth + 10) / 2;
219
+ left = `${label.value[i].offsetLeft - num}px`;
220
+ } else {
221
+ left = `${label.value[i].offsetLeft}px`;
222
+ }
223
+ doc.style.transition = ".3s";
224
+ doc.style.transform = `translateX(${left})`;
225
+ }
226
+ };
227
+
228
+ /* watch */
229
+ watch(
230
+ () => props.selfTapList,
231
+ (val, preVal) => {
232
+ if (val.length) {
233
+ isTapList.value = [].concat(val);
234
+ active.value = isTapList.value[0].key;
235
+ }
236
+ },
237
+ {
238
+ //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
239
+ //那么首次执行,val为默认值,preVal为undefined
240
+ immediate: true,
241
+ //这个参数代表监听对象时,可以监听深度嵌套的对象属性
242
+ deep: true,
243
+ }
244
+ );
245
+
246
+ watch(
247
+ () => props.tapList,
248
+ (val, preVal) => {
249
+ if (!props.selfTapList.length) {
250
+ isTapList.value = [].concat(defaultTabList.value);
251
+ if (val.length > 0) {
252
+ /* return [] */
253
+ val.forEach((v: any, i: number) => {
254
+ if (v.sort && v.sort > 1) {
255
+ isTapList.value.splice(v.sort - 1, 0, v);
256
+ } else if (v.sort == 1) {
257
+ isTapList.value.unshift(v);
258
+ } else {
259
+ isTapList.value.push(v);
260
+ }
261
+ });
262
+ }
263
+ active.value = isTapList.value[0].key;
264
+ }
265
+ },
266
+ {
267
+ //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
268
+ //那么首次执行,val为默认值,preVal为undefined
269
+ immediate: true,
270
+ //这个参数代表监听对象时,可以监听深度嵌套的对象属性
271
+ deep: true,
272
+ }
273
+ );
274
+
275
+ /* mounted */
276
+ onMounted(() => {
277
+ // 渲染后初始化为第一个位置
278
+ tabAnimation(0);
279
+ });
280
+
281
+ return {
282
+ isTapList,
283
+ active,
284
+ handleActive,
285
+ label,
286
+ taskCommentList,
287
+ trackUrl,
288
+ };
289
+ },
290
+ });
291
+ </script>
292
+
293
+ <style scoped>
294
+ .tops-tab {
295
+ height: 100%;
296
+ }
297
+ .tops-tab-header {
298
+ display: flex;
299
+ width: 100%;
300
+ height: 45px;
301
+ font-size: 14px;
302
+ color: #333;
303
+ padding: 10px 17px;
304
+ font-weight: 500;
305
+ box-sizing: border-box;
306
+ overflow-x: auto;
307
+ white-space: nowrap;
308
+ flex-wrap: nowrap;
309
+ flex-shrink: 0;
310
+ -ms-overflow-style: none;
311
+ position: relative;
312
+ background-color: #fff;
313
+ }
314
+
315
+ .tops-tab-header::after {
316
+ content: "";
317
+ position: absolute;
318
+ width: 100%;
319
+ height: 1px;
320
+ background-color: #f2f2f2;
321
+ left: 0;
322
+ bottom: 0;
323
+ z-index: 10;
324
+ }
325
+
326
+ .tops-tab-header::-webkit-scrollbar {
327
+ display: none;
328
+ }
329
+
330
+ .tops-tab-header-items {
331
+ white-space: nowrap;
332
+ padding-right: 10px;
333
+ box-sizing: border-box;
334
+ display: inline-block;
335
+ height: 100%;
336
+ text-align: center;
337
+ margin-right: 32px;
338
+ font-weight: 400;
339
+ font-size: 15px;
340
+ text-align: left;
341
+ color: #333;
342
+ display: flex;
343
+ align-items: center;
344
+ }
345
+
346
+ .tops-tab-header-items:last-child {
347
+ padding-right: 0;
348
+ margin-right: 0;
349
+ }
350
+
351
+ .tops-tab-header .active {
352
+ position: relative;
353
+ color: #1389ff;
354
+ font-family: "PingFang SC Bold";
355
+ font-weight: 700;
356
+ font-size: 15px;
357
+ text-align: left;
358
+ }
359
+
360
+ .tops-tab-header .bottom-line {
361
+ width: 30px;
362
+ height: 3px;
363
+ border-radius: 1.5px;
364
+ background-color: #1389ff;
365
+ position: absolute;
366
+ bottom: 1px;
367
+ left: 0;
368
+ z-index: 12;
369
+ }
370
+ .tops-tab-body {
371
+ height: 100%;
372
+ }
373
+
374
+ .seal-list__item {
375
+ padding: 6px 10px;
376
+ margin: 10px;
377
+ margin-bottom: 0px;
378
+ padding-bottom: 0px;
379
+ background-color: #ffffff;
380
+ border-radius: 10px;
381
+ box-sizing: border-box;
382
+ }
383
+
384
+ .seal-list__item:last-child {
385
+ margin-bottom: 70px;
386
+ }
387
+
388
+ .seal-list__item .seal-list__item--header {
389
+ margin-bottom: 6px;
390
+ display: flex;
391
+ align-items: center;
392
+ }
393
+
394
+ .seal-list__item .seal-list__item--header span:first-of-type {
395
+ font-size: 15px;
396
+ margin-right: 6px;
397
+ font-weight: bold;
398
+ }
399
+
400
+ .seal-list__item .seal-list__item--option {
401
+ display: flex;
402
+ justify-content: space-between;
403
+ align-items: center;
404
+ font-size: 14px;
405
+ padding: 10px 0;
406
+ color: #333;
407
+ }
408
+
409
+ .seal-list__item .seal-list__item--option {
410
+ }
411
+
412
+ .seal-list__item .seal-list__item--option span:last-child {
413
+ max-width: 144px;
414
+ overflow: hidden;
415
+ white-space: nowrap;
416
+ text-overflow: ellipsis;
417
+ color: #888;
418
+ }
419
+
420
+ .seal-list__item .seal-list__item--option :last-child {
421
+ /* padding-bottom: 14px; */
422
+ }
423
+ .seal-list__item .seal-list__item--attch {
424
+ font-size: 14px;
425
+ padding: 10px 0;
426
+ color: #333;
427
+ text-align: right;
428
+ color: #1389ff;
429
+ }
430
+
431
+ .seal-list__item .seal-list__item--actions {
432
+ margin-top: 12px;
433
+ position: relative;
434
+ display: flex;
435
+ justify-content: space-around;
436
+ align-items: center;
437
+ }
438
+
439
+ .seal-list__item .seal-list__item--actions ::before {
440
+ content: "";
441
+ top: 0;
442
+ width: 100%;
443
+ transform: scaleY(0.5);
444
+ transform-origin: top;
445
+ border-top: 1px #e8e8e8 solid;
446
+ position: absolute;
447
+ }
448
+
449
+ .seal-list__item .seal-list__item--actions .van-button {
450
+ width: 50%;
451
+ }
452
+
453
+ .seal-list__item .seal-list__item--actions .van-button ::after {
454
+ content: "";
455
+ height: 60%;
456
+ border-left: 1px #e8e8e8 solid;
457
+ position: absolute;
458
+ left: 100%;
459
+ top: 50%;
460
+ transform: translate(-50%, -50%) scaleX(0.5);
461
+ transform-origin: left;
462
+ }
463
+
464
+ .seal-list__item .seal-list__item--actions .van-button:last-child ::after {
465
+ content: none;
466
+ }
467
+ </style>
@@ -2,7 +2,7 @@ import request from "./request";
2
2
 
3
3
  const proxyStr = "/aws";
4
4
 
5
- export function getProcessStatus(query:any) {
5
+ export function getProcessStatus(query: any) {
6
6
  return request({
7
7
  url: proxyStr + "/pis/getProcessStatus",
8
8
  method: "get",
@@ -7,6 +7,7 @@ import axios, {
7
7
  import { ACCESS_TOKEN, loadStorage } from "./cache";
8
8
 
9
9
  const host = process.env.VUE_APP_BASE_URL;
10
+ // const host = "http://59.53.91.231:2100";
10
11
 
11
12
  axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
12
13
 
@@ -28,11 +29,13 @@ const opts = {
28
29
 
29
30
  const service = axios.create(opts);
30
31
 
31
- service.interceptors.request.use((config) => {
32
+ service.interceptors.request.use((config)=> {
32
33
  const isToken = (config.headers || {}).isToken === false;
33
34
  if (loadStorage("token", "") && !isToken) {
34
- config.headers["Authorization"] = "Bearer " + loadStorage("token", ""); // 让每个请求携带自定义token 请根据实际情况自行修改
35
+ config.headers["Authorization"] = "Bearer " + loadStorage("token", ""); // 让每个请求携带自定义token 请根据实际情况自行修改 15c572f2-1fff-4ef2-94dc-728fc8d6fe14
35
36
  }
37
+ /* config.headers["Authorization"] =
38
+ "Bearer " + "15c572f2-1fff-4ef2-94dc-728fc8d6fe14"; */
36
39
  return config;
37
40
  });
38
41
 
@@ -0,0 +1,15 @@
1
+ import { App } from "vue";
2
+ import components from "./component";
3
+
4
+ // 完整引入组件
5
+ const install = function (app: App) {
6
+ components.forEach((component) => {
7
+ app.use((component as unknown) as { install: () => any });
8
+ });
9
+ };
10
+
11
+ // 所有组件
12
+ export * from "./component";
13
+ export default {
14
+ install,
15
+ };
@@ -1,2 +0,0 @@
1
- import Tab from "./src/tab.vue";
2
- export default Tab;
@@ -1,28 +0,0 @@
1
- declare const _default: {
2
- name: string;
3
- props: {
4
- /**
5
- * 根据参数插入自定义tab
6
- * label:选项卡title
7
- * key:选项卡ID 请勿重复defaultTabList内已拥有的默认key
8
- * type:插槽类型 "slot" "default"
9
- * sort:排序参数,无参数默认插入末尾
10
- * slot:插槽name
11
- */
12
- tapList: {
13
- type: ArrayConstructor;
14
- default: () => never[];
15
- };
16
- selfTapList: {
17
- type: ArrayConstructor;
18
- default: () => never[];
19
- };
20
- };
21
- setup(props: any): {
22
- isTapList: any;
23
- active: import("vue").Ref<string>;
24
- handleActive: (e: string, i: number) => void;
25
- label: import("vue").Ref<any>;
26
- };
27
- };
28
- export default _default;