nbb-component-ui 1.3.3 → 1.3.5
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.d.ts +1 -0
- package/dist/index.es.js +52 -49
- package/dist/index.umd.js +1 -1
- package/dist/src/api/processInstance.d.ts +1 -3
- package/dist/src/api/task.d.ts +1 -3
- package/dist/style.css +1 -1
- package/index.ts +11 -1
- package/package.json +1 -1
- package/src/ProcessFlow/src/CmcProcessFlow.vue +3 -5
- package/src/api/processInstance.ts +25 -10
- package/src/api/task.ts +12 -10
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,81 +1,84 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
processInstanceId: t
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
}), B = /* @__PURE__ */ y({
|
|
1
|
+
import { defineComponent as I, ref as n, watch as w, resolveComponent as k, openBlock as C, createBlock as x, withCtx as q, createTextVNode as P } from "vue";
|
|
2
|
+
import { ElMessage as i } from "element-plus";
|
|
3
|
+
const b = m(), F = async (s) => await b.get({
|
|
4
|
+
url: "/system/bpm/process-instance/get-approval-detail",
|
|
5
|
+
params: {
|
|
6
|
+
processInstanceId: s
|
|
7
|
+
}
|
|
8
|
+
}), T = m(), B = async (s) => await T.get({
|
|
9
|
+
url: "/system/bpm/task/list-by-process-instance-id",
|
|
10
|
+
params: {
|
|
11
|
+
processInstanceId: s
|
|
12
|
+
}
|
|
13
|
+
}), D = /* @__PURE__ */ I({
|
|
18
14
|
__name: "CmcProcessFlow",
|
|
19
15
|
props: {
|
|
20
16
|
processInstanceId: {},
|
|
21
17
|
request: {}
|
|
22
18
|
},
|
|
23
19
|
setup(s) {
|
|
24
|
-
const
|
|
25
|
-
|
|
20
|
+
const o = s, r = n(!1), l = n({}), p = n({}), _ = n(""), f = n([]), a = n(""), v = (t) => {
|
|
21
|
+
a.value = t, d(), g();
|
|
26
22
|
}, d = async () => {
|
|
27
|
-
var
|
|
23
|
+
var t, c;
|
|
28
24
|
try {
|
|
29
|
-
|
|
30
|
-
const e = await
|
|
25
|
+
r.value = !0;
|
|
26
|
+
const e = await F(a.value);
|
|
31
27
|
if (!e) {
|
|
32
|
-
|
|
28
|
+
i.error("查询不到审批详情信息!");
|
|
33
29
|
return;
|
|
34
30
|
}
|
|
35
31
|
if (!e.processDefinition || !e.processInstance) {
|
|
36
|
-
|
|
32
|
+
i.error("查询不到流程信息!");
|
|
37
33
|
return;
|
|
38
34
|
}
|
|
39
|
-
|
|
35
|
+
l.value = e == null ? void 0 : e.processInstance, _.value = (c = (t = e == null ? void 0 : e.processInstance) == null ? void 0 : t.formVariables) == null ? void 0 : c.applicationPrefix, p.value = e == null ? void 0 : e.todoTask;
|
|
40
36
|
} finally {
|
|
41
|
-
|
|
37
|
+
r.value = !1;
|
|
42
38
|
}
|
|
43
39
|
}, g = async () => {
|
|
44
|
-
|
|
40
|
+
f.value = await B(a.value);
|
|
45
41
|
};
|
|
46
|
-
|
|
47
|
-
() =>
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
o && o !== r.value && v(o);
|
|
42
|
+
w(
|
|
43
|
+
() => o.processInstanceId,
|
|
44
|
+
(t) => {
|
|
45
|
+
t && t !== a.value && v(t);
|
|
51
46
|
},
|
|
52
47
|
{ immediate: !0, deep: !0 }
|
|
53
48
|
);
|
|
54
|
-
const
|
|
55
|
-
|
|
49
|
+
const y = () => {
|
|
50
|
+
i.success("aaa!");
|
|
56
51
|
};
|
|
57
|
-
return (
|
|
58
|
-
const e =
|
|
59
|
-
return
|
|
60
|
-
default:
|
|
61
|
-
|
|
52
|
+
return (t, c) => {
|
|
53
|
+
const e = k("el-button");
|
|
54
|
+
return C(), x(e, { onClick: y }, {
|
|
55
|
+
default: q(() => [...c[0] || (c[0] = [
|
|
56
|
+
P("测试按钮3", -1)
|
|
62
57
|
])]),
|
|
63
58
|
_: 1
|
|
64
59
|
});
|
|
65
60
|
};
|
|
66
61
|
}
|
|
67
62
|
});
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
for (const [
|
|
71
|
-
|
|
72
|
-
return
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
const L = (s, o) => {
|
|
64
|
+
const r = s.__vccOpts || s;
|
|
65
|
+
for (const [l, p] of o)
|
|
66
|
+
r[l] = p;
|
|
67
|
+
return r;
|
|
68
|
+
}, h = /* @__PURE__ */ L(D, [["__scopeId", "data-v-e422ef37"]]);
|
|
69
|
+
let u = null;
|
|
70
|
+
const $ = {
|
|
71
|
+
install(s, o) {
|
|
72
|
+
u = o == null ? void 0 : o.request, s.component("CmcProcessFlow", h);
|
|
76
73
|
}
|
|
77
74
|
};
|
|
75
|
+
function m() {
|
|
76
|
+
if (!u)
|
|
77
|
+
throw new Error("请在外部项目 app.use(CmcFlowCore) 传入 request");
|
|
78
|
+
return u;
|
|
79
|
+
}
|
|
78
80
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
h as CmcProcessFlow,
|
|
82
|
+
$ as default,
|
|
83
|
+
m as getRequest
|
|
81
84
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,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):(t=typeof globalThis<"u"?globalThis:t||self,e(t.NbbComponentUi={},t.Vue,t.ElementPlus))})(this,function(t,e,l){"use strict";const m=u(),g=async n=>await m.get({url:"/system/bpm/process-instance/get-approval-detail",params:{processInstanceId:n}}),y=u(),w=async n=>await y.get({url:"/system/bpm/task/list-by-process-instance-id",params:{processInstanceId:n}}),C=e.defineComponent({__name:"CmcProcessFlow",props:{processInstanceId:{},request:{}},setup(n){const r=n,c=e.ref(!1),f=e.ref({}),_=e.ref({}),v=e.ref(""),k=e.ref([]),i=e.ref(""),q=o=>{i.value=o,b(),x()},b=async()=>{var o,a;try{c.value=!0;const s=await g(i.value);if(!s){l.ElMessage.error("查询不到审批详情信息!");return}if(!s.processDefinition||!s.processInstance){l.ElMessage.error("查询不到流程信息!");return}f.value=s==null?void 0:s.processInstance,v.value=(a=(o=s==null?void 0:s.processInstance)==null?void 0:o.formVariables)==null?void 0:a.applicationPrefix,_.value=s==null?void 0:s.todoTask}finally{c.value=!1}},x=async()=>{k.value=await w(i.value)};e.watch(()=>r.processInstanceId,o=>{o&&o!==i.value&&q(o)},{immediate:!0,deep:!0});const P=()=>{l.ElMessage.success("aaa!")};return(o,a)=>{const s=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(s,{onClick:P},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode("测试按钮3",-1)])]),_:1})}}}),T="",d=((n,r)=>{const c=n.__vccOpts||n;for(const[f,_]of r)c[f]=_;return c})(C,[["__scopeId","data-v-e422ef37"]]);let p=null;const I={install(n,r){p=r==null?void 0:r.request,n.component("CmcProcessFlow",d)}};function u(){if(!p)throw new Error("请在外部项目 app.use(CmcFlowCore) 传入 request");return p}t.CmcProcessFlow=d,t.default=I,t.getRequest=u,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/src/api/task.d.ts
CHANGED
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.process-container[data-v-
|
|
1
|
+
@charset "UTF-8";.process-container[data-v-e422ef37]{height:100%;box-sizing:border-box}.process-container[data-v-e422ef37]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-e422ef37]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-e422ef37]{margin:20px 0}.approval-actions .action-buttons[data-v-e422ef37]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-e422ef37]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-e422ef37]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-e422ef37]{display:contents}
|
package/index.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import type { App, Plugin } from 'vue'
|
|
2
2
|
import {CmcProcessFlow} from "./src/ProcessFlow";
|
|
3
3
|
|
|
4
|
+
let _request: any = null;
|
|
5
|
+
|
|
4
6
|
// 定义插件对象,严格标注类型
|
|
5
7
|
const plugin: Plugin<[]> = {
|
|
6
|
-
install(app: App) {
|
|
8
|
+
install(app: App, options?: {request: any}) {
|
|
9
|
+
_request = options?.request
|
|
7
10
|
app.component('CmcProcessFlow', CmcProcessFlow)
|
|
8
11
|
}
|
|
9
12
|
}
|
|
10
13
|
// 支持按需引入
|
|
11
14
|
export {CmcProcessFlow }
|
|
12
15
|
|
|
16
|
+
export function getRequest() {
|
|
17
|
+
if (!_request) {
|
|
18
|
+
throw new Error('请在外部项目 app.use(CmcFlowCore) 传入 request')
|
|
19
|
+
}
|
|
20
|
+
return _request
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
// 默认导出插件(必须是Plugin类型)
|
|
14
24
|
export default plugin
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
12
|
import { ElMessage } from 'element-plus'
|
|
13
13
|
import {ref, watch} from "vue";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import * as processInstanceApi from "@/api/processInstance";
|
|
15
|
+
import * as taskApi from "@/api/task";
|
|
16
16
|
|
|
17
17
|
// import ProcessInstanceTaskList from './CmcFlowList.vue'
|
|
18
18
|
|
|
@@ -32,8 +32,6 @@ const applicationPrefix = ref('')
|
|
|
32
32
|
const tasks = ref<any[]>([])
|
|
33
33
|
|
|
34
34
|
const id = ref<string>('')
|
|
35
|
-
const processInstanceApi = createProcessInstanceApi(props.request)
|
|
36
|
-
const taskApi = createTaskApi(props.request)
|
|
37
35
|
|
|
38
36
|
|
|
39
37
|
|
|
@@ -48,6 +46,7 @@ const init = (processInstanceId: string) => {
|
|
|
48
46
|
const getApprovalDetail = async () => {
|
|
49
47
|
try {
|
|
50
48
|
processInstanceLoading.value = true
|
|
49
|
+
|
|
51
50
|
const data = await processInstanceApi.getApprovalDetail(id.value)
|
|
52
51
|
if (!data) {
|
|
53
52
|
ElMessage.error('查询不到审批详情信息!')
|
|
@@ -73,7 +72,6 @@ const getTaskList = async () => {
|
|
|
73
72
|
watch(
|
|
74
73
|
() => props.processInstanceId,
|
|
75
74
|
(newValue) => {
|
|
76
|
-
debugger
|
|
77
75
|
if (newValue && newValue !== id.value) {
|
|
78
76
|
init(newValue)
|
|
79
77
|
}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import {getRequest} from "../../index";
|
|
2
|
+
|
|
3
|
+
const request = getRequest()
|
|
4
|
+
|
|
5
|
+
export const getApprovalDetail = async (processInstanceId: string) => {
|
|
6
|
+
return await request.get({
|
|
7
|
+
url: `/system/bpm/process-instance/get-approval-detail`,
|
|
8
|
+
params: {
|
|
9
|
+
processInstanceId
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// export const createProcessInstanceApi = (request: any) => ({
|
|
17
|
+
// getApprovalDetail: async (processInstanceId: any) => {
|
|
18
|
+
// return await request.get({
|
|
19
|
+
// url: `/system/bpm/process-instance/get-approval-detail`,
|
|
20
|
+
// params: {
|
|
21
|
+
// processInstanceId
|
|
22
|
+
// }
|
|
23
|
+
// })
|
|
24
|
+
// }
|
|
25
|
+
// })
|
|
11
26
|
|
|
12
27
|
|
package/src/api/task.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import {getRequest} from "../../index";
|
|
2
|
+
|
|
3
|
+
const request = getRequest()
|
|
4
|
+
|
|
5
|
+
export const getTaskListByProcessInstanceId = async (processInstanceId: string) => {
|
|
6
|
+
return await request.get({
|
|
7
|
+
url: `/system/bpm/task/list-by-process-instance-id`,
|
|
8
|
+
params: {
|
|
9
|
+
processInstanceId
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
}
|
|
11
13
|
|
|
12
14
|
|