ui-process-h5 0.1.20 → 0.1.23
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/lib/index.js +596 -0
- package/lib/index.umd.cjs +1 -0
- package/lib/style.css +1 -1
- package/package.json +19 -13
- package/packages/component.ts +3 -3
- package/packages/components/button/index.ts +9 -0
- package/packages/components/button/src/index.vue +55 -0
- package/packages/components/popup/index.ts +11 -0
- package/packages/components/popup/src/index.vue +128 -0
- package/packages/components/process/index.ts +9 -0
- package/packages/components/process/src/index.vue +439 -0
- package/packages/components/tab/src/index.vue +192 -21
- package/packages/components/{theme → utils}/request/api.ts +1 -3
- package/packages/components/{theme → utils}/request/request.ts +3 -3
- package/lib/design.js +0 -163
- package/lib/design.umd.cjs +0 -1
- /package/packages/components/{theme → utils}/request/cache.d.ts +0 -0
- /package/packages/components/{theme → utils}/request/cache.js +0 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
v-for="item in isTapList"
|
|
19
19
|
:key="item.key"
|
|
20
20
|
v-show="active === item.key"
|
|
21
|
-
style="height: 100
|
|
21
|
+
style="height: calc(100% - 45px);"
|
|
22
22
|
>
|
|
23
23
|
<!-- :taskNode="getTaskNode()" -->
|
|
24
24
|
<slot
|
|
@@ -26,13 +26,66 @@
|
|
|
26
26
|
name="default"
|
|
27
27
|
></slot>
|
|
28
28
|
<slot
|
|
29
|
-
v-if="item.key === '
|
|
30
|
-
name="
|
|
31
|
-
|
|
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>
|
|
32
43
|
<slot
|
|
33
|
-
v-if="item.key === '
|
|
34
|
-
name="
|
|
35
|
-
|
|
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>
|
|
36
89
|
<slot v-if="item.type == 'slot'" :name="item.slot"></slot>
|
|
37
90
|
</div>
|
|
38
91
|
</div>
|
|
@@ -40,7 +93,9 @@
|
|
|
40
93
|
</template>
|
|
41
94
|
|
|
42
95
|
<script lang="ts">
|
|
43
|
-
import { defineComponent, ref, watch, onMounted } from "vue";
|
|
96
|
+
import { defineComponent, ref, watch, onMounted, computed } from "vue-demi";
|
|
97
|
+
// import { getProcessStatus } from "../../utils/request/api";
|
|
98
|
+
|
|
44
99
|
export default defineComponent({
|
|
45
100
|
name: "TopTab",
|
|
46
101
|
props: {
|
|
@@ -63,6 +118,30 @@ export default defineComponent({
|
|
|
63
118
|
},
|
|
64
119
|
},
|
|
65
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
|
+
|
|
66
145
|
// 选中
|
|
67
146
|
const active = ref<string>("");
|
|
68
147
|
|
|
@@ -113,6 +192,7 @@ export default defineComponent({
|
|
|
113
192
|
|
|
114
193
|
// taskNode taskObj
|
|
115
194
|
|
|
195
|
+
/* method */
|
|
116
196
|
// 选中方法
|
|
117
197
|
const handleActive = (e: string, i: number) => {
|
|
118
198
|
if (e === active.value) {
|
|
@@ -145,11 +225,7 @@ export default defineComponent({
|
|
|
145
225
|
}
|
|
146
226
|
};
|
|
147
227
|
|
|
148
|
-
/*
|
|
149
|
-
return taskNode.value.filter((o) => {
|
|
150
|
-
return o.nodeId == taskObj.value.id;
|
|
151
|
-
});
|
|
152
|
-
}; */
|
|
228
|
+
/* watch */
|
|
153
229
|
watch(
|
|
154
230
|
() => props.selfTapList,
|
|
155
231
|
(val, preVal) => {
|
|
@@ -196,6 +272,7 @@ export default defineComponent({
|
|
|
196
272
|
}
|
|
197
273
|
);
|
|
198
274
|
|
|
275
|
+
/* mounted */
|
|
199
276
|
onMounted(() => {
|
|
200
277
|
// 渲染后初始化为第一个位置
|
|
201
278
|
tabAnimation(0);
|
|
@@ -206,6 +283,8 @@ export default defineComponent({
|
|
|
206
283
|
active,
|
|
207
284
|
handleActive,
|
|
208
285
|
label,
|
|
286
|
+
taskCommentList,
|
|
287
|
+
trackUrl,
|
|
209
288
|
};
|
|
210
289
|
},
|
|
211
290
|
});
|
|
@@ -219,10 +298,9 @@ export default defineComponent({
|
|
|
219
298
|
display: flex;
|
|
220
299
|
width: 100%;
|
|
221
300
|
height: 45px;
|
|
222
|
-
justify-content: space-between;
|
|
223
301
|
font-size: 14px;
|
|
224
302
|
color: #333;
|
|
225
|
-
padding:
|
|
303
|
+
padding: 10px 17px;
|
|
226
304
|
font-weight: 500;
|
|
227
305
|
box-sizing: border-box;
|
|
228
306
|
overflow-x: auto;
|
|
@@ -231,6 +309,7 @@ export default defineComponent({
|
|
|
231
309
|
flex-shrink: 0;
|
|
232
310
|
-ms-overflow-style: none;
|
|
233
311
|
position: relative;
|
|
312
|
+
background-color: #fff;
|
|
234
313
|
}
|
|
235
314
|
|
|
236
315
|
.tops-tab-header::after {
|
|
@@ -241,6 +320,7 @@ export default defineComponent({
|
|
|
241
320
|
background-color: #f2f2f2;
|
|
242
321
|
left: 0;
|
|
243
322
|
bottom: 0;
|
|
323
|
+
z-index: 10;
|
|
244
324
|
}
|
|
245
325
|
|
|
246
326
|
.tops-tab-header::-webkit-scrollbar {
|
|
@@ -263,13 +343,10 @@ export default defineComponent({
|
|
|
263
343
|
align-items: center;
|
|
264
344
|
}
|
|
265
345
|
|
|
266
|
-
.tops-tab-header-items
|
|
346
|
+
.tops-tab-header-items:last-child {
|
|
267
347
|
padding-right: 0;
|
|
268
348
|
margin-right: 0;
|
|
269
349
|
}
|
|
270
|
-
.tops-tab-header-items :last-child::after {
|
|
271
|
-
left: calc(50% - 17px);
|
|
272
|
-
}
|
|
273
350
|
|
|
274
351
|
.tops-tab-header .active {
|
|
275
352
|
position: relative;
|
|
@@ -286,11 +363,105 @@ export default defineComponent({
|
|
|
286
363
|
border-radius: 1.5px;
|
|
287
364
|
background-color: #1389ff;
|
|
288
365
|
position: absolute;
|
|
289
|
-
bottom:
|
|
366
|
+
bottom: 1px;
|
|
290
367
|
left: 0;
|
|
368
|
+
z-index: 12;
|
|
291
369
|
}
|
|
292
370
|
.tops-tab-body {
|
|
293
371
|
height: 100%;
|
|
294
|
-
|
|
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;
|
|
295
466
|
}
|
|
296
467
|
</style>
|
|
@@ -2,12 +2,10 @@ import request from "./request";
|
|
|
2
2
|
|
|
3
3
|
const proxyStr = "/aws";
|
|
4
4
|
|
|
5
|
-
function getProcessStatus(query: any) {
|
|
5
|
+
export function getProcessStatus(query: any) {
|
|
6
6
|
return request({
|
|
7
7
|
url: proxyStr + "/pis/getProcessStatus",
|
|
8
8
|
method: "get",
|
|
9
9
|
params: query,
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
export default { getProcessStatus };
|
|
@@ -7,7 +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.
|
|
10
|
+
// const host = "http://59.53.91.231:2100";
|
|
11
11
|
|
|
12
12
|
axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
|
|
13
13
|
|
|
@@ -34,8 +34,8 @@ service.interceptors.request.use((config)=> {
|
|
|
34
34
|
if (loadStorage("token", "") && !isToken) {
|
|
35
35
|
config.headers["Authorization"] = "Bearer " + loadStorage("token", ""); // 让每个请求携带自定义token 请根据实际情况自行修改 15c572f2-1fff-4ef2-94dc-728fc8d6fe14
|
|
36
36
|
}
|
|
37
|
-
config.headers["Authorization"] =
|
|
38
|
-
"Bearer " + "15c572f2-1fff-4ef2-94dc-728fc8d6fe14";
|
|
37
|
+
/* config.headers["Authorization"] =
|
|
38
|
+
"Bearer " + "15c572f2-1fff-4ef2-94dc-728fc8d6fe14"; */
|
|
39
39
|
return config;
|
|
40
40
|
});
|
|
41
41
|
|
package/lib/design.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, ref as p, watch as b, onMounted as $, openBlock as f, createElementBlock as r, createElementVNode as k, Fragment as _, renderList as m, normalizeClass as T, toDisplayString as g, createCommentVNode as d, withDirectives as W, renderSlot as y, vShow as C } from "vue";
|
|
2
|
-
const A = L({
|
|
3
|
-
name: "TopTab",
|
|
4
|
-
props: {
|
|
5
|
-
/**
|
|
6
|
-
* 根据参数插入自定义tab
|
|
7
|
-
* label:选项卡title
|
|
8
|
-
* key:选项卡ID 请勿重复defaultTabList内已拥有的默认key
|
|
9
|
-
* type:插槽类型 "slot" "default"
|
|
10
|
-
* sort:排序参数,无参数默认插入末尾
|
|
11
|
-
* slot:插槽name
|
|
12
|
-
*/
|
|
13
|
-
tapList: {
|
|
14
|
-
type: Array,
|
|
15
|
-
default: () => []
|
|
16
|
-
},
|
|
17
|
-
// 自定义tab (传入后 默认tab,tapList,失效)
|
|
18
|
-
selfTapList: {
|
|
19
|
-
type: Array,
|
|
20
|
-
default: () => []
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
setup(e) {
|
|
24
|
-
const u = p(""), i = p([
|
|
25
|
-
{
|
|
26
|
-
label: "基本信息",
|
|
27
|
-
key: "a",
|
|
28
|
-
type: "default",
|
|
29
|
-
slot: "default"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: "流程图",
|
|
33
|
-
key: "b",
|
|
34
|
-
type: "default",
|
|
35
|
-
slot: "tab2"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: "审批记录",
|
|
39
|
-
key: "c",
|
|
40
|
-
type: "default",
|
|
41
|
-
slot: "tab3"
|
|
42
|
-
}
|
|
43
|
-
]), o = p([
|
|
44
|
-
{
|
|
45
|
-
label: "基本信息",
|
|
46
|
-
key: "a",
|
|
47
|
-
type: "default",
|
|
48
|
-
slot: "default"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: "流程图",
|
|
52
|
-
key: "b",
|
|
53
|
-
type: "default",
|
|
54
|
-
slot: "tab2"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
label: "审批记录",
|
|
58
|
-
key: "c",
|
|
59
|
-
type: "default",
|
|
60
|
-
slot: "tab3"
|
|
61
|
-
}
|
|
62
|
-
]), s = p(), h = (t, n) => {
|
|
63
|
-
t !== u.value && (u.value = t, a(n));
|
|
64
|
-
}, a = (t) => {
|
|
65
|
-
if (s.value.length) {
|
|
66
|
-
let n = document.getElementsByClassName("bottom-line")[0], l;
|
|
67
|
-
if (n.offsetWidth < s.value[t].offsetWidth - 10) {
|
|
68
|
-
let c = (s.value[t].offsetWidth - n.offsetWidth - 10) / 2;
|
|
69
|
-
l = `${s.value[t].offsetLeft + c}px`;
|
|
70
|
-
} else if (n.offsetWidth > s.value[t].offsetWidth - 10) {
|
|
71
|
-
let c = (n.offsetWidth - s.value[t].offsetWidth + 10) / 2;
|
|
72
|
-
l = `${s.value[t].offsetLeft - c}px`;
|
|
73
|
-
} else
|
|
74
|
-
l = `${s.value[t].offsetLeft}px`;
|
|
75
|
-
n.style.transition = ".3s", n.style.transform = `translateX(${l})`;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
return b(
|
|
79
|
-
() => e.selfTapList,
|
|
80
|
-
(t, n) => {
|
|
81
|
-
t.length && (o.value = [].concat(t), u.value = o.value[0].key);
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
//如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
|
|
85
|
-
//那么首次执行,val为默认值,preVal为undefined
|
|
86
|
-
immediate: !0,
|
|
87
|
-
//这个参数代表监听对象时,可以监听深度嵌套的对象属性
|
|
88
|
-
deep: !0
|
|
89
|
-
}
|
|
90
|
-
), b(
|
|
91
|
-
() => e.tapList,
|
|
92
|
-
(t, n) => {
|
|
93
|
-
e.selfTapList.length || (o.value = [].concat(i.value), t.length > 0 && t.forEach((l, c) => {
|
|
94
|
-
l.sort && l.sort > 1 ? o.value.splice(l.sort - 1, 0, l) : l.sort == 1 ? o.value.unshift(l) : o.value.push(l);
|
|
95
|
-
}), u.value = o.value[0].key);
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
//如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
|
|
99
|
-
//那么首次执行,val为默认值,preVal为undefined
|
|
100
|
-
immediate: !0,
|
|
101
|
-
//这个参数代表监听对象时,可以监听深度嵌套的对象属性
|
|
102
|
-
deep: !0
|
|
103
|
-
}
|
|
104
|
-
), $(() => {
|
|
105
|
-
a(0);
|
|
106
|
-
}), {
|
|
107
|
-
isTapList: o,
|
|
108
|
-
active: u,
|
|
109
|
-
handleActive: h,
|
|
110
|
-
label: s
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
const E = (e, u) => {
|
|
115
|
-
const i = e.__vccOpts || e;
|
|
116
|
-
for (const [o, s] of u)
|
|
117
|
-
i[o] = s;
|
|
118
|
-
return i;
|
|
119
|
-
}, V = { class: "tops-tab" }, w = { class: "tops-tab-header" }, B = ["onClick"], N = {
|
|
120
|
-
key: 0,
|
|
121
|
-
class: "bottom-line"
|
|
122
|
-
}, S = { class: "tops-tab-body" };
|
|
123
|
-
function D(e, u, i, o, s, h) {
|
|
124
|
-
return f(), r("div", V, [
|
|
125
|
-
k("div", w, [
|
|
126
|
-
(f(!0), r(_, null, m(e.isTapList, (a, t) => (f(), r("div", {
|
|
127
|
-
class: T(["tops-tab-header-items", [a.key === e.active ? "active" : ""]]),
|
|
128
|
-
onClick: (n) => e.handleActive(a.key, t),
|
|
129
|
-
ref_for: !0,
|
|
130
|
-
ref: "label"
|
|
131
|
-
}, g(a.label), 11, B))), 256)),
|
|
132
|
-
e.isTapList.length ? (f(), r("div", N)) : d("", !0)
|
|
133
|
-
]),
|
|
134
|
-
k("div", S, [
|
|
135
|
-
(f(!0), r(_, null, m(e.isTapList, (a) => W((f(), r("div", {
|
|
136
|
-
key: a.key,
|
|
137
|
-
style: { height: "100%" }
|
|
138
|
-
}, [
|
|
139
|
-
a.key === "a" && a.type === "default" ? y(e.$slots, "default", { key: 0 }, void 0, !0) : d("", !0),
|
|
140
|
-
a.key === "tab2" && a.type === "default" ? y(e.$slots, "default", { key: 1 }, void 0, !0) : d("", !0),
|
|
141
|
-
a.key === "tab3" && a.type === "default" ? y(e.$slots, "default", { key: 2 }, void 0, !0) : d("", !0),
|
|
142
|
-
a.type == "slot" ? y(e.$slots, a.slot, { key: 3 }, void 0, !0) : d("", !0)
|
|
143
|
-
])), [
|
|
144
|
-
[C, e.active === a.key]
|
|
145
|
-
])), 128))
|
|
146
|
-
])
|
|
147
|
-
]);
|
|
148
|
-
}
|
|
149
|
-
const v = /* @__PURE__ */ E(A, [["render", D], ["__scopeId", "data-v-a3457e59"]]);
|
|
150
|
-
v.install = function(e) {
|
|
151
|
-
return e.component(v.name, v), e;
|
|
152
|
-
};
|
|
153
|
-
const z = [v], F = function(e) {
|
|
154
|
-
z.forEach((u) => {
|
|
155
|
-
e.use(u);
|
|
156
|
-
});
|
|
157
|
-
}, M = {
|
|
158
|
-
install: F
|
|
159
|
-
};
|
|
160
|
-
export {
|
|
161
|
-
v as TopTab,
|
|
162
|
-
M as default
|
|
163
|
-
};
|
package/lib/design.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.Design={},d.Vue))})(this,function(d,e){"use strict";const y=e.defineComponent({name:"TopTab",props:{tapList:{type:Array,default:()=>[]},selfTapList:{type:Array,default:()=>[]}},setup(t){const i=e.ref(""),c=e.ref([{label:"基本信息",key:"a",type:"default",slot:"default"},{label:"流程图",key:"b",type:"default",slot:"tab2"},{label:"审批记录",key:"c",type:"default",slot:"tab3"}]),n=e.ref([{label:"基本信息",key:"a",type:"default",slot:"default"},{label:"流程图",key:"b",type:"default",slot:"tab2"},{label:"审批记录",key:"c",type:"default",slot:"tab3"}]),a=e.ref(),u=(l,r)=>{l!==i.value&&(i.value=l,o(r))},o=l=>{if(a.value.length){let r=document.getElementsByClassName("bottom-line")[0],s;if(r.offsetWidth<a.value[l].offsetWidth-10){let p=(a.value[l].offsetWidth-r.offsetWidth-10)/2;s=`${a.value[l].offsetLeft+p}px`}else if(r.offsetWidth>a.value[l].offsetWidth-10){let p=(r.offsetWidth-a.value[l].offsetWidth+10)/2;s=`${a.value[l].offsetLeft-p}px`}else s=`${a.value[l].offsetLeft}px`;r.style.transition=".3s",r.style.transform=`translateX(${s})`}};return e.watch(()=>t.selfTapList,(l,r)=>{l.length&&(n.value=[].concat(l),i.value=n.value[0].key)},{immediate:!0,deep:!0}),e.watch(()=>t.tapList,(l,r)=>{t.selfTapList.length||(n.value=[].concat(c.value),l.length>0&&l.forEach((s,p)=>{s.sort&&s.sort>1?n.value.splice(s.sort-1,0,s):s.sort==1?n.value.unshift(s):n.value.push(s)}),i.value=n.value[0].key)},{immediate:!0,deep:!0}),e.onMounted(()=>{o(0)}),{isTapList:n,active:i,handleActive:u,label:a}}}),$="",h=(t,i)=>{const c=t.__vccOpts||t;for(const[n,a]of i)c[n]=a;return c},k={class:"tops-tab"},m={class:"tops-tab-header"},b=["onClick"],_={key:0,class:"bottom-line"},T={class:"tops-tab-body"};function L(t,i,c,n,a,u){return e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.isTapList,(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tops-tab-header-items",[o.key===t.active?"active":""]]),onClick:r=>t.handleActive(o.key,l),ref_for:!0,ref:"label"},e.toDisplayString(o.label),11,b))),256)),t.isTapList.length?(e.openBlock(),e.createElementBlock("div",_)):e.createCommentVNode("",!0)]),e.createElementVNode("div",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.isTapList,o=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:o.key,style:{height:"100%"}},[o.key==="a"&&o.type==="default"?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):e.createCommentVNode("",!0),o.key==="tab2"&&o.type==="default"?e.renderSlot(t.$slots,"default",{key:1},void 0,!0):e.createCommentVNode("",!0),o.key==="tab3"&&o.type==="default"?e.renderSlot(t.$slots,"default",{key:2},void 0,!0):e.createCommentVNode("",!0),o.type=="slot"?e.renderSlot(t.$slots,o.slot,{key:3},void 0,!0):e.createCommentVNode("",!0)])),[[e.vShow,t.active===o.key]])),128))])])}const f=h(y,[["render",L],["__scopeId","data-v-a3457e59"]]);f.install=function(t){return t.component(f.name,f),t};const g=[f],B={install:function(t){g.forEach(i=>{t.use(i)})}};d.TopTab=f,d.default=B,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
File without changes
|
|
File without changes
|