nbb-component-ui 1.3.2 → 1.3.4

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