nbb-component-ui 1.3.7 → 1.3.9

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