nbb-component-ui 1.4.4 → 1.4.8

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,59 +1,58 @@
1
- import { defineComponent as y, ref as n, watch as b, resolveComponent as k, openBlock as w, createBlock as C, withCtx as q, createTextVNode as x } from "vue";
2
- import { ElMessage as P } from "element-plus";
3
- import { useMessage as T } from "host@/hooks/web/useMessage";
4
- const F = (s) => i().get({
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
+ import { ElMessage as i } from "element-plus";
3
+ const P = (s) => _().get({
5
4
  url: "/system/bpm/process-instance/get-approval-detail",
6
5
  params: {
7
6
  processInstanceId: s
8
7
  }
9
- }), h = (s) => i().get({
8
+ }), T = (s) => _().get({
10
9
  url: "/system/bpm/task/list-by-process-instance-id",
11
10
  params: {
12
11
  processInstanceId: s
13
12
  }
14
- }), B = /* @__PURE__ */ y({
13
+ }), F = /* @__PURE__ */ y({
15
14
  __name: "CmcProcessFlow",
16
15
  props: {
17
16
  processInstanceId: {},
18
17
  request: {}
19
18
  },
20
19
  setup(s) {
21
- const t = T(), c = s, a = n(!1), u = n({}), m = n({}), f = n(""), _ = n([]), l = n(""), g = (o) => {
22
- l.value = o, v(), d();
23
- }, v = async () => {
24
- var o, r;
20
+ const t = s, r = n(!1), p = n({}), u = n({}), m = n(""), f = n([]), a = n(""), v = (o) => {
21
+ a.value = o, d(), g();
22
+ }, d = async () => {
23
+ var o, c;
25
24
  try {
26
- a.value = !0;
27
- const e = await F(l.value);
25
+ r.value = !0;
26
+ const e = await P(a.value);
28
27
  if (!e) {
29
- console.log("查询不到审批详情信息!"), t.error("查询不到审批详情信息!");
28
+ i.error("查询不到审批详情信息!");
30
29
  return;
31
30
  }
32
31
  if (!e.processDefinition || !e.processInstance) {
33
- console.log("查询不到流程信息!"), t.error("查询不到流程信息!");
32
+ i.error("查询不到流程信息!");
34
33
  return;
35
34
  }
36
- u.value = e == null ? void 0 : e.processInstance, f.value = (r = (o = e == null ? void 0 : e.processInstance) == null ? void 0 : o.formVariables) == null ? void 0 : r.applicationPrefix, m.value = e == null ? void 0 : e.todoTask;
35
+ p.value = e == null ? void 0 : e.processInstance, m.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;
37
36
  } finally {
38
- a.value = !1;
37
+ r.value = !1;
39
38
  }
40
- }, d = async () => {
41
- _.value = await h(l.value);
39
+ }, g = async () => {
40
+ f.value = await T(a.value);
42
41
  };
43
- b(
44
- () => c.processInstanceId,
42
+ k(
43
+ () => t.processInstanceId,
45
44
  (o) => {
46
- o && o !== l.value && g(o);
45
+ o && o !== a.value && v(o);
47
46
  },
48
47
  { immediate: !0, deep: !0 }
49
48
  );
50
49
  const I = () => {
51
- P.success("aaa!");
50
+ i.success("aaa!");
52
51
  };
53
- return (o, r) => {
54
- const e = k("el-button");
55
- return w(), C(e, { onClick: I }, {
56
- default: q(() => [...r[0] || (r[0] = [
52
+ return (o, c) => {
53
+ const e = w("el-button");
54
+ return C(), b(e, { onClick: I }, {
55
+ default: q(() => [...c[0] || (c[0] = [
57
56
  x("测试按钮3", -1)
58
57
  ])]),
59
58
  _: 1
@@ -61,27 +60,27 @@ const F = (s) => i().get({
61
60
  };
62
61
  }
63
62
  });
64
- const D = (s, t) => {
65
- const c = s.__vccOpts || s;
66
- for (const [a, u] of t)
67
- c[a] = u;
68
- return c;
69
- }, E = /* @__PURE__ */ D(B, [["__scopeId", "data-v-b7f4910d"]]);
70
- let p = null;
71
- const N = {
63
+ const h = (s, t) => {
64
+ const r = s.__vccOpts || s;
65
+ for (const [p, u] of t)
66
+ r[p] = u;
67
+ return r;
68
+ }, B = /* @__PURE__ */ h(F, [["__scopeId", "data-v-caaead34"]]);
69
+ let l = null;
70
+ const L = {
72
71
  install(s, t) {
73
72
  if (console.log("插件install执行,options:", t), !(t != null && t.request))
74
73
  throw new Error("请在 app.use(NbbComponentUi) 时传入 { request }");
75
- p = t.request, s.component("CmcProcessFlow", E);
74
+ l = t.request, s.component("CmcProcessFlow", B);
76
75
  }
77
76
  };
78
- function i() {
79
- if (console.log("getRequest", p), !p)
77
+ function _() {
78
+ if (console.log("getRequest", l), !l)
80
79
  throw new Error("没有_request对象");
81
- return p;
80
+ return l;
82
81
  }
83
82
  export {
84
- E as CmcProcessFlow,
85
- N as default,
86
- i as getRequest
83
+ B as CmcProcessFlow,
84
+ L as default,
85
+ _ as getRequest
87
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"),require("host@/hooks/web/useMessage")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","host@/hooks/web/useMessage"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.NbbComponentUi={},t.Vue,t.ElementPlus,t.useMessage))})(this,function(t,e,_,d){"use strict";const g=o=>p().get({url:"/system/bpm/process-instance/get-approval-detail",params:{processInstanceId:o}}),b=o=>p().get({url:"/system/bpm/task/list-by-process-instance-id",params:{processInstanceId:o}}),y=e.defineComponent({__name:"CmcProcessFlow",props:{processInstanceId:{},request:{}},setup(o){const n=d.useMessage(),l=o,i=e.ref(!1),f=e.ref({}),k=e.ref({}),q=e.ref(""),I=e.ref([]),u=e.ref(""),v=r=>{u.value=r,C(),h()},C=async()=>{var r,c;try{i.value=!0;const s=await g(u.value);if(!s){console.log("查询不到审批详情信息!"),n.error("查询不到审批详情信息!");return}if(!s.processDefinition||!s.processInstance){console.log("查询不到流程信息!"),n.error("查询不到流程信息!");return}f.value=s==null?void 0:s.processInstance,q.value=(c=(r=s==null?void 0:s.processInstance)==null?void 0:r.formVariables)==null?void 0:c.applicationPrefix,k.value=s==null?void 0:s.todoTask}finally{i.value=!1}},h=async()=>{I.value=await b(u.value)};e.watch(()=>l.processInstanceId,r=>{r&&r!==u.value&&v(r)},{immediate:!0,deep:!0});const P=()=>{_.ElMessage.success("aaa!")};return(r,c)=>{const s=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(s,{onClick:P},{default:e.withCtx(()=>[...c[0]||(c[0]=[e.createTextVNode("测试按钮3",-1)])]),_:1})}}}),x="",m=((o,n)=>{const l=o.__vccOpts||o;for(const[i,f]of n)l[i]=f;return l})(y,[["__scopeId","data-v-b7f4910d"]]);let a=null;const w={install(o,n){if(console.log("插件install执行,options:",n),!(n!=null&&n.request))throw new Error("请在 app.use(NbbComponentUi) 时传入 { request }");a=n.request,o.component("CmcProcessFlow",m)}};function p(){if(console.log("getRequest",a),!a)throw new Error("没有_request对象");return a}t.CmcProcessFlow=m,t.default=w,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-caaead34"]]);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"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.process-container[data-v-b7f4910d]{height:100%;box-sizing:border-box}.process-container[data-v-b7f4910d]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-b7f4910d]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-b7f4910d]{margin:20px 0}.approval-actions .action-buttons[data-v-b7f4910d]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-b7f4910d]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-b7f4910d]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-b7f4910d]{display:contents}
1
+ @charset "UTF-8";.process-container[data-v-caaead34]{height:100%;box-sizing:border-box}.process-container[data-v-caaead34]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-caaead34]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-caaead34]{margin:20px 0}.approval-actions .action-buttons[data-v-caaead34]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-caaead34]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-caaead34]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-caaead34]{display:contents}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nbb-component-ui",
3
- "version": "1.4.4",
3
+ "version": "1.4.8",
4
4
  "main": "./dist/index.umd.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,11 +13,8 @@ import { ElMessage } from 'element-plus'
13
13
  import {ref, watch} from "vue";
14
14
  import * as processInstanceApi from "@/api/processInstance";
15
15
  import * as taskApi from "@/api/task";
16
- // @ts-expect-error 运行时由宿主应用提供
17
- import { useMessage } from 'host@/hooks/web/useMessage'
18
16
  // import ProcessInstanceTaskList from './CmcFlowList.vue'
19
17
 
20
- const message = useMessage()
21
18
 
22
19
  const props = defineProps<{
23
20
  processInstanceId: string
@@ -49,13 +46,11 @@ const getApprovalDetail = async () => {
49
46
 
50
47
  const data = await processInstanceApi.getApprovalDetail(id.value)
51
48
  if (!data) {
52
- console.log('查询不到审批详情信息!')
53
- message.error('查询不到审批详情信息!')
49
+ ElMessage.error('查询不到审批详情信息!')
54
50
  return
55
51
  }
56
52
  if (!data.processDefinition || !data.processInstance) {
57
- console.log('查询不到流程信息!')
58
- message.error('查询不到流程信息!')
53
+ ElMessage.error('查询不到流程信息!')
59
54
  return
60
55
  }
61
56
  processInstance.value = data?.processInstance
@@ -1,5 +1,5 @@
1
- declare module 'host@/*' {
2
- const value: any;
3
- export default value;
4
- export * from 'host@/*';
5
- }
1
+ // declare module 'host@/*' {
2
+ // const value: any;
3
+ // export default value;
4
+ // export * from 'host@/*';
5
+ // }
package/tsconfig.json CHANGED
@@ -16,8 +16,7 @@
16
16
  "declaration": true,
17
17
  "declarationDir": "dist",
18
18
  "paths": {
19
- "@/*": ["src/*"],
20
- "host@/*": ["./types/host-globals.d.ts"] // 👈 就这一行,通吃所有 @/xxx
19
+ "@/*": ["src/*"]
21
20
  }
22
21
  },
23
22
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "index.ts"]
package/vite.config.js CHANGED
@@ -33,7 +33,7 @@ export default defineConfig({
33
33
  '@/utils/formatTime',
34
34
  'vue',
35
35
  'element-plus',
36
- /^host@\/.*/ // 所有 host@/ 开头的都外部化
36
+ '@/hooks/web/useMessage'
37
37
  ],
38
38
  output: {
39
39
  // UMD模式下的全局变量名