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