nbb-component-ui 1.3.5 → 1.3.7
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 +4 -1
- package/dist/index.es.js +37 -35
- package/dist/index.umd.js +1 -1
- package/index.ts +16 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
2
|
import { CmcProcessFlow } from './src/ProcessFlow';
|
|
3
|
-
|
|
3
|
+
export interface NbbComponentUiOptions {
|
|
4
|
+
request: any;
|
|
5
|
+
}
|
|
6
|
+
declare const plugin: Plugin<NbbComponentUiOptions>;
|
|
4
7
|
export { CmcProcessFlow };
|
|
5
8
|
export declare function getRequest(): any;
|
|
6
9
|
export default plugin;
|
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as w, ref as n, watch as I, resolveComponent as k, openBlock as q, createBlock as C, withCtx as b, createTextVNode as x } from "vue";
|
|
2
2
|
import { ElMessage as i } from "element-plus";
|
|
3
|
-
const
|
|
3
|
+
const P = _(), T = async (s) => await P.get({
|
|
4
4
|
url: "/system/bpm/process-instance/get-approval-detail",
|
|
5
5
|
params: {
|
|
6
6
|
processInstanceId: s
|
|
7
7
|
}
|
|
8
|
-
}),
|
|
8
|
+
}), F = _(), h = async (s) => await F.get({
|
|
9
9
|
url: "/system/bpm/task/list-by-process-instance-id",
|
|
10
10
|
params: {
|
|
11
11
|
processInstanceId: s
|
|
12
12
|
}
|
|
13
|
-
}),
|
|
13
|
+
}), B = /* @__PURE__ */ w({
|
|
14
14
|
__name: "CmcProcessFlow",
|
|
15
15
|
props: {
|
|
16
16
|
processInstanceId: {},
|
|
17
17
|
request: {}
|
|
18
18
|
},
|
|
19
19
|
setup(s) {
|
|
20
|
-
const
|
|
21
|
-
a.value =
|
|
22
|
-
},
|
|
23
|
-
var
|
|
20
|
+
const t = s, r = n(!1), u = n({}), p = n({}), f = n(""), m = n([]), a = n(""), v = (o) => {
|
|
21
|
+
a.value = o, g(), d();
|
|
22
|
+
}, g = async () => {
|
|
23
|
+
var o, c;
|
|
24
24
|
try {
|
|
25
25
|
r.value = !0;
|
|
26
|
-
const e = await
|
|
26
|
+
const e = await T(a.value);
|
|
27
27
|
if (!e) {
|
|
28
28
|
i.error("查询不到审批详情信息!");
|
|
29
29
|
return;
|
|
@@ -32,53 +32,55 @@ const b = m(), F = async (s) => await b.get({
|
|
|
32
32
|
i.error("查询不到流程信息!");
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
u.value = e == null ? void 0 : e.processInstance, f.value = (c = (o = e == null ? void 0 : e.processInstance) == null ? void 0 : o.formVariables) == null ? void 0 : c.applicationPrefix, p.value = e == null ? void 0 : e.todoTask;
|
|
36
36
|
} finally {
|
|
37
37
|
r.value = !1;
|
|
38
38
|
}
|
|
39
|
-
},
|
|
40
|
-
|
|
39
|
+
}, d = async () => {
|
|
40
|
+
m.value = await h(a.value);
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
() =>
|
|
44
|
-
(
|
|
45
|
-
|
|
42
|
+
I(
|
|
43
|
+
() => t.processInstanceId,
|
|
44
|
+
(o) => {
|
|
45
|
+
o && o !== a.value && v(o);
|
|
46
46
|
},
|
|
47
47
|
{ immediate: !0, deep: !0 }
|
|
48
48
|
);
|
|
49
49
|
const y = () => {
|
|
50
50
|
i.success("aaa!");
|
|
51
51
|
};
|
|
52
|
-
return (
|
|
52
|
+
return (o, c) => {
|
|
53
53
|
const e = k("el-button");
|
|
54
|
-
return
|
|
55
|
-
default:
|
|
56
|
-
|
|
54
|
+
return q(), C(e, { onClick: y }, {
|
|
55
|
+
default: b(() => [...c[0] || (c[0] = [
|
|
56
|
+
x("测试按钮3", -1)
|
|
57
57
|
])]),
|
|
58
58
|
_: 1
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
const
|
|
63
|
+
const D = (s, t) => {
|
|
64
64
|
const r = s.__vccOpts || s;
|
|
65
|
-
for (const [
|
|
66
|
-
r[
|
|
65
|
+
for (const [u, p] of t)
|
|
66
|
+
r[u] = p;
|
|
67
67
|
return r;
|
|
68
|
-
},
|
|
69
|
-
let
|
|
70
|
-
const
|
|
71
|
-
install(s,
|
|
72
|
-
|
|
68
|
+
}, E = /* @__PURE__ */ D(B, [["__scopeId", "data-v-e422ef37"]]);
|
|
69
|
+
let l = null;
|
|
70
|
+
const N = {
|
|
71
|
+
install(s, t) {
|
|
72
|
+
if (console.log(t), !(t != null && t.request))
|
|
73
|
+
throw new Error("请在 app.use(NbbComponentUi) 时传入 { request }");
|
|
74
|
+
l = t.request, s.component("CmcProcessFlow", E);
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
|
-
function
|
|
76
|
-
if (!
|
|
77
|
-
throw new Error("
|
|
78
|
-
return
|
|
77
|
+
function _() {
|
|
78
|
+
if (console.log("getRequest", l), !l)
|
|
79
|
+
throw new Error("没有_request对象");
|
|
80
|
+
return l;
|
|
79
81
|
}
|
|
80
82
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
E as CmcProcessFlow,
|
|
84
|
+
N as default,
|
|
85
|
+
_ as getRequest
|
|
84
86
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,u){"use strict";const m=p(),g=async n=>await m.get({url:"/system/bpm/process-instance/get-approval-detail",params:{processInstanceId:n}}),y=p(),q=async n=>await y.get({url:"/system/bpm/task/list-by-process-instance-id",params:{processInstanceId:n}}),w=e.defineComponent({__name:"CmcProcessFlow",props:{processInstanceId:{},request:{}},setup(n){const o=n,c=e.ref(!1),f=e.ref({}),_=e.ref({}),b=e.ref(""),v=e.ref([]),i=e.ref(""),C=r=>{i.value=r,k(),x()},k=async()=>{var r,a;try{c.value=!0;const s=await g(i.value);if(!s){u.ElMessage.error("查询不到审批详情信息!");return}if(!s.processDefinition||!s.processInstance){u.ElMessage.error("查询不到流程信息!");return}f.value=s==null?void 0:s.processInstance,b.value=(a=(r=s==null?void 0:s.processInstance)==null?void 0:r.formVariables)==null?void 0:a.applicationPrefix,_.value=s==null?void 0:s.todoTask}finally{c.value=!1}},x=async()=>{v.value=await q(i.value)};e.watch(()=>o.processInstanceId,r=>{r&&r!==i.value&&C(r)},{immediate:!0,deep:!0});const P=()=>{u.ElMessage.success("aaa!")};return(r,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,o)=>{const c=n.__vccOpts||n;for(const[f,_]of o)c[f]=_;return c})(w,[["__scopeId","data-v-e422ef37"]]);let l=null;const I={install(n,o){if(console.log(o),!(o!=null&&o.request))throw new Error("请在 app.use(NbbComponentUi) 时传入 { request }");l=o.request,n.component("CmcProcessFlow",d)}};function p(){if(console.log("getRequest",l),!l)throw new Error("没有_request对象");return l}t.CmcProcessFlow=d,t.default=I,t.getRequest=p,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/index.ts
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import type { App, Plugin } from 'vue'
|
|
2
|
+
|
|
3
|
+
// 插件配置类型
|
|
4
|
+
export interface NbbComponentUiOptions {
|
|
5
|
+
request: any
|
|
6
|
+
}
|
|
7
|
+
|
|
2
8
|
import {CmcProcessFlow} from "./src/ProcessFlow";
|
|
3
9
|
|
|
4
10
|
let _request: any = null;
|
|
5
11
|
|
|
6
12
|
// 定义插件对象,严格标注类型
|
|
7
|
-
const plugin: Plugin<
|
|
8
|
-
install(app: App, options
|
|
9
|
-
|
|
13
|
+
const plugin: Plugin<NbbComponentUiOptions> = {
|
|
14
|
+
install(app: App, options: NbbComponentUiOptions) {
|
|
15
|
+
console.log(options)
|
|
16
|
+
if (!options?.request) {
|
|
17
|
+
throw new Error('请在 app.use(NbbComponentUi) 时传入 { request }')
|
|
18
|
+
}
|
|
19
|
+
_request = options.request
|
|
20
|
+
|
|
10
21
|
app.component('CmcProcessFlow', CmcProcessFlow)
|
|
11
22
|
}
|
|
12
23
|
}
|
|
@@ -14,8 +25,9 @@ const plugin: Plugin<[]> = {
|
|
|
14
25
|
export {CmcProcessFlow }
|
|
15
26
|
|
|
16
27
|
export function getRequest() {
|
|
28
|
+
console.log('getRequest', _request)
|
|
17
29
|
if (!_request) {
|
|
18
|
-
throw new Error('
|
|
30
|
+
throw new Error('没有_request对象')
|
|
19
31
|
}
|
|
20
32
|
return _request
|
|
21
33
|
}
|