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