nbb-component-ui 1.3.5 → 1.3.6

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