nbb-component-ui 1.3.2 → 1.3.4
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/dist/index.es.js +40 -33
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/ProcessFlow/src/CmcProcessFlow.vue +15 -4
package/dist/index.es.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as k, ref as n, watch as _, resolveComponent as b, openBlock as P, createBlock as x, withCtx as C, createTextVNode as A } from "vue";
|
|
2
2
|
import { ElMessage as l } from "element-plus";
|
|
3
|
-
const
|
|
4
|
-
getApprovalDetail: async (
|
|
3
|
+
const T = (t) => ({
|
|
4
|
+
getApprovalDetail: async (o) => await t.get({
|
|
5
5
|
url: "/system/bpm/process-instance/get-approval-detail",
|
|
6
6
|
params: {
|
|
7
|
-
processInstanceId:
|
|
7
|
+
processInstanceId: o
|
|
8
8
|
}
|
|
9
9
|
})
|
|
10
|
-
}),
|
|
11
|
-
getTaskListByProcessInstanceId: async (
|
|
10
|
+
}), w = (t) => ({
|
|
11
|
+
getTaskListByProcessInstanceId: async (o) => await t.get({
|
|
12
12
|
url: "/system/bpm/task/list-by-process-instance-id",
|
|
13
13
|
params: {
|
|
14
|
-
processInstanceId:
|
|
14
|
+
processInstanceId: o
|
|
15
15
|
}
|
|
16
16
|
})
|
|
17
|
-
}), B = /* @__PURE__ */
|
|
17
|
+
}), B = /* @__PURE__ */ k({
|
|
18
18
|
__name: "CmcProcessFlow",
|
|
19
19
|
props: {
|
|
20
20
|
processInstanceId: {},
|
|
21
21
|
request: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
setup(t) {
|
|
24
|
+
const o = t, c = n(!1), p = n({}), i = n({}), f = n(""), v = n([]), r = n("");
|
|
25
|
+
let u, m;
|
|
26
|
+
const d = (s) => {
|
|
27
|
+
r.value = s, I(), g();
|
|
28
|
+
}, I = async () => {
|
|
29
|
+
var s, a;
|
|
28
30
|
try {
|
|
29
31
|
c.value = !0;
|
|
30
|
-
const e = await
|
|
32
|
+
const e = await u.getApprovalDetail(r.value);
|
|
31
33
|
if (!e) {
|
|
32
34
|
l.error("查询不到审批详情信息!");
|
|
33
35
|
return;
|
|
@@ -36,46 +38,51 @@ const A = (s) => ({
|
|
|
36
38
|
l.error("查询不到流程信息!");
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
p.value = e == null ? void 0 : e.processInstance,
|
|
41
|
+
p.value = e == null ? void 0 : e.processInstance, f.value = (a = (s = e == null ? void 0 : e.processInstance) == null ? void 0 : s.formVariables) == null ? void 0 : a.applicationPrefix, i.value = e == null ? void 0 : e.todoTask;
|
|
40
42
|
} finally {
|
|
41
43
|
c.value = !1;
|
|
42
44
|
}
|
|
43
45
|
}, g = async () => {
|
|
44
|
-
|
|
46
|
+
v.value = await m.getTaskListByProcessInstanceId(r.value);
|
|
45
47
|
};
|
|
46
|
-
|
|
47
|
-
() =>
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
o && o !== r.value && v(o);
|
|
48
|
+
_(
|
|
49
|
+
() => o.processInstanceId,
|
|
50
|
+
(s) => {
|
|
51
|
+
s && s !== r.value && d(s);
|
|
51
52
|
},
|
|
52
53
|
{ immediate: !0, deep: !0 }
|
|
54
|
+
), _(
|
|
55
|
+
() => o.request,
|
|
56
|
+
(s) => {
|
|
57
|
+
s && (u = T(s), m = w(s));
|
|
58
|
+
},
|
|
59
|
+
{ immediate: !0 }
|
|
53
60
|
);
|
|
54
|
-
const
|
|
61
|
+
const y = () => {
|
|
55
62
|
l.success("aaa!");
|
|
56
63
|
};
|
|
57
|
-
return (
|
|
64
|
+
return (s, a) => {
|
|
58
65
|
const e = b("el-button");
|
|
59
|
-
return P(),
|
|
60
|
-
default:
|
|
61
|
-
|
|
66
|
+
return P(), x(e, { onClick: y }, {
|
|
67
|
+
default: C(() => [...a[0] || (a[0] = [
|
|
68
|
+
A("测试按钮3", -1)
|
|
62
69
|
])]),
|
|
63
70
|
_: 1
|
|
64
71
|
});
|
|
65
72
|
};
|
|
66
73
|
}
|
|
67
74
|
});
|
|
68
|
-
const D = (
|
|
69
|
-
const c =
|
|
70
|
-
for (const [p, i] of
|
|
75
|
+
const D = (t, o) => {
|
|
76
|
+
const c = t.__vccOpts || t;
|
|
77
|
+
for (const [p, i] of o)
|
|
71
78
|
c[p] = i;
|
|
72
79
|
return c;
|
|
73
|
-
}, F = /* @__PURE__ */ D(B, [["__scopeId", "data-v-
|
|
74
|
-
install(
|
|
75
|
-
|
|
80
|
+
}, F = /* @__PURE__ */ D(B, [["__scopeId", "data-v-35e1b83b"]]), E = {
|
|
81
|
+
install(t) {
|
|
82
|
+
t.component("CmcProcessFlow", F);
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
85
|
export {
|
|
79
86
|
F as CmcProcessFlow,
|
|
80
|
-
|
|
87
|
+
E as default
|
|
81
88
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.NbbComponentUi={},o.Vue,o.ElementPlus))})(this,function(o,e,p){"use strict";const _=n=>({getApprovalDetail:async c=>await n.get({url:"/system/bpm/process-instance/get-approval-detail",params:{processInstanceId:c}})}),y=n=>({getTaskListByProcessInstanceId:async c=>await n.get({url:"/system/bpm/task/list-by-process-instance-id",params:{processInstanceId:c}})}),g=e.defineComponent({__name:"CmcProcessFlow",props:{processInstanceId:{},request:{}},setup(n){const c=n,r=e.ref(!1),l=e.ref({}),f=e.ref({}),b=e.ref(""),k=e.ref([]),i=e.ref("");let d,m;const v=t=>{i.value=t,C(),P()},C=async()=>{var t,a;try{r.value=!0;const s=await d.getApprovalDetail(i.value);if(!s){p.ElMessage.error("查询不到审批详情信息!");return}if(!s.processDefinition||!s.processInstance){p.ElMessage.error("查询不到流程信息!");return}l.value=s==null?void 0:s.processInstance,b.value=(a=(t=s==null?void 0:s.processInstance)==null?void 0:t.formVariables)==null?void 0:a.applicationPrefix,f.value=s==null?void 0:s.todoTask}finally{r.value=!1}},P=async()=>{k.value=await m.getTaskListByProcessInstanceId(i.value)};e.watch(()=>c.processInstanceId,t=>{t&&t!==i.value&&v(t)},{immediate:!0,deep:!0}),e.watch(()=>c.request,t=>{t&&(d=_(t),m=y(t))},{immediate:!0});const T=()=>{p.ElMessage.success("aaa!")};return(t,a)=>{const s=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(s,{onClick:T},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode("测试按钮3",-1)])]),_:1})}}}),x="",u=((n,c)=>{const r=n.__vccOpts||n;for(const[l,f]of c)r[l]=f;return r})(g,[["__scopeId","data-v-35e1b83b"]]),I={install(n){n.component("CmcProcessFlow",u)}};o.CmcProcessFlow=u,o.default=I,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.process-container[data-v-
|
|
1
|
+
@charset "UTF-8";.process-container[data-v-35e1b83b]{height:100%;box-sizing:border-box}.process-container[data-v-35e1b83b]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-35e1b83b]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-35e1b83b]{margin:20px 0}.approval-actions .action-buttons[data-v-35e1b83b]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-35e1b83b]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-35e1b83b]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-35e1b83b]{display:contents}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-button @click="open">测试按钮
|
|
2
|
+
<el-button @click="open">测试按钮3</el-button>
|
|
3
3
|
<!-- 审批记录列表 -->
|
|
4
4
|
<!-- <ProcessInstanceTaskList-->
|
|
5
5
|
<!-- :process-instance="processInstance"-->
|
|
@@ -32,8 +32,8 @@ const applicationPrefix = ref('')
|
|
|
32
32
|
const tasks = ref<any[]>([])
|
|
33
33
|
|
|
34
34
|
const id = ref<string>('')
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
let processInstanceApi: any;
|
|
36
|
+
let taskApi: any;
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
@@ -48,6 +48,7 @@ const init = (processInstanceId: string) => {
|
|
|
48
48
|
const getApprovalDetail = async () => {
|
|
49
49
|
try {
|
|
50
50
|
processInstanceLoading.value = true
|
|
51
|
+
|
|
51
52
|
const data = await processInstanceApi.getApprovalDetail(id.value)
|
|
52
53
|
if (!data) {
|
|
53
54
|
ElMessage.error('查询不到审批详情信息!')
|
|
@@ -73,13 +74,23 @@ const getTaskList = async () => {
|
|
|
73
74
|
watch(
|
|
74
75
|
() => props.processInstanceId,
|
|
75
76
|
(newValue) => {
|
|
76
|
-
debugger
|
|
77
77
|
if (newValue && newValue !== id.value) {
|
|
78
78
|
init(newValue)
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
{ immediate: true, deep: true }
|
|
82
82
|
)
|
|
83
|
+
// 监听 props 变化 → 有值了再创建 API
|
|
84
|
+
watch(
|
|
85
|
+
() => props.request,
|
|
86
|
+
(newRequest) => {
|
|
87
|
+
if (newRequest) {
|
|
88
|
+
processInstanceApi = createProcessInstanceApi(newRequest)
|
|
89
|
+
taskApi = createTaskApi(newRequest)
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{ immediate: true }
|
|
93
|
+
)
|
|
83
94
|
|
|
84
95
|
|
|
85
96
|
const open = () => {
|