nbb-component-ui 1.3.0 → 1.3.1

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,81 @@
1
- import { defineComponent as c, resolveComponent as _, openBlock as r, createBlock as l, withCtx as p, createTextVNode as a } from "vue";
2
- import { ElMessage as m } from "element-plus";
3
- const u = /* @__PURE__ */ c({
1
+ import { defineComponent as y, ref as c, watch as k, resolveComponent as P, openBlock as w, createBlock as x, withCtx as C, createTextVNode as b } from "vue";
2
+ import { ElMessage as A } from "element-plus";
3
+ const T = (s) => ({
4
+ getApprovalDetail: async (o) => await s.get({
5
+ url: "/system/bpm/process-instance/get-approval-detail",
6
+ params: {
7
+ processInstanceId: o
8
+ }
9
+ })
10
+ }), B = (s) => ({
11
+ getTaskListByProcessInstanceId: async (o) => await s.get({
12
+ url: "/system/bpm/task/list-by-process-instance-id",
13
+ params: {
14
+ processInstanceId: o
15
+ }
16
+ })
17
+ }), D = /* @__PURE__ */ y({
4
18
  __name: "CmcProcessFlow",
5
- setup(o) {
6
- const t = () => {
7
- m.success("aaa!");
19
+ props: {
20
+ processInstanceId: {},
21
+ request: {}
22
+ },
23
+ setup(s) {
24
+ const o = useMessage(), n = s, r = c(!1), i = c({}), l = c({}), u = c(""), m = c([]), p = c(""), _ = T(n.request), v = B(n.request), f = (t) => {
25
+ p.value = t, g(), d();
26
+ }, g = async () => {
27
+ var t, a;
28
+ try {
29
+ r.value = !0;
30
+ const e = await _.getApprovalDetail(p.value);
31
+ if (!e) {
32
+ o.error("查询不到审批详情信息!");
33
+ return;
34
+ }
35
+ if (!e.processDefinition || !e.processInstance) {
36
+ o.error("查询不到流程信息!");
37
+ return;
38
+ }
39
+ i.value = e == null ? void 0 : e.processInstance, u.value = (a = (t = e == null ? void 0 : e.processInstance) == null ? void 0 : t.formVariables) == null ? void 0 : a.applicationPrefix, l.value = e == null ? void 0 : e.todoTask;
40
+ } finally {
41
+ r.value = !1;
42
+ }
43
+ }, d = async () => {
44
+ m.value = await v.getTaskListByProcessInstanceId(p.value);
8
45
  };
9
- return (n, e) => {
10
- const s = _("el-button");
11
- return r(), l(s, { onClick: t }, {
12
- default: p(() => [...e[0] || (e[0] = [
13
- a("测试按钮", -1)
46
+ k(
47
+ () => n.processInstanceId,
48
+ (t) => {
49
+ debugger;
50
+ t && t !== p.value && f(t);
51
+ },
52
+ { immediate: !0, deep: !0 }
53
+ );
54
+ const I = () => {
55
+ A.success("aaa!");
56
+ };
57
+ return (t, a) => {
58
+ const e = P("el-button");
59
+ return w(), x(e, { onClick: I }, {
60
+ default: C(() => [...a[0] || (a[0] = [
61
+ b("测试按钮2", -1)
14
62
  ])]),
15
63
  _: 1
16
64
  });
17
65
  };
18
66
  }
19
67
  });
20
- const i = (o, t) => {
21
- const n = o.__vccOpts || o;
22
- for (const [e, s] of t)
23
- n[e] = s;
68
+ const F = (s, o) => {
69
+ const n = s.__vccOpts || s;
70
+ for (const [r, i] of o)
71
+ n[r] = i;
24
72
  return n;
25
- }, d = /* @__PURE__ */ i(u, [["__scopeId", "data-v-30bb0e46"]]), b = {
26
- install(o) {
27
- o.component("CmcProcessFlow", d);
73
+ }, L = /* @__PURE__ */ F(D, [["__scopeId", "data-v-c412a081"]]), h = {
74
+ install(s) {
75
+ s.component("CmcProcessFlow", L);
28
76
  }
29
77
  };
30
78
  export {
31
- d as CmcProcessFlow,
32
- b as default
79
+ L as CmcProcessFlow,
80
+ h as default
33
81
  };
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,r){"use strict";const u=e.defineComponent({__name:"CmcProcessFlow",setup(o){const s=()=>{r.ElMessage.success("aaa!")};return(c,n)=>{const l=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(l,{onClick:s},{default:e.withCtx(()=>[...n[0]||(n[0]=[e.createTextVNode("测试按钮",-1)])]),_:1})}}}),p="",_=((o,s)=>{const c=o.__vccOpts||o;for(const[n,l]of s)c[n]=l;return c})(u,[["__scopeId","data-v-30bb0e46"]]),i={install(o){o.component("CmcProcessFlow",_)}};t.CmcProcessFlow=_,t.default=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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,f){"use strict";const d=t=>({getApprovalDetail:async c=>await t.get({url:"/system/bpm/process-instance/get-approval-detail",params:{processInstanceId:c}})}),m=t=>({getTaskListByProcessInstanceId:async c=>await t.get({url:"/system/bpm/task/list-by-process-instance-id",params:{processInstanceId:c}})}),_=e.defineComponent({__name:"CmcProcessFlow",props:{processInstanceId:{},request:{}},setup(t){const c=useMessage(),r=t,i=e.ref(!1),l=e.ref({}),y=e.ref({}),I=e.ref(""),k=e.ref([]),p=e.ref(""),v=d(r.request),P=m(r.request),b=o=>{p.value=o,C(),T()},C=async()=>{var o,a;try{i.value=!0;const s=await v.getApprovalDetail(p.value);if(!s){c.error("查询不到审批详情信息!");return}if(!s.processDefinition||!s.processInstance){c.error("查询不到流程信息!");return}l.value=s==null?void 0:s.processInstance,I.value=(a=(o=s==null?void 0:s.processInstance)==null?void 0:o.formVariables)==null?void 0:a.applicationPrefix,y.value=s==null?void 0:s.todoTask}finally{i.value=!1}},T=async()=>{k.value=await P.getTaskListByProcessInstanceId(p.value)};e.watch(()=>r.processInstanceId,o=>{debugger;o&&o!==p.value&&b(o)},{immediate:!0,deep:!0});const w=()=>{f.ElMessage.success("aaa!")};return(o,a)=>{const s=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(s,{onClick:w},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode("测试按钮2",-1)])]),_:1})}}}),x="",u=((t,c)=>{const r=t.__vccOpts||t;for(const[i,l]of c)r[i]=l;return r})(_,[["__scopeId","data-v-c412a081"]]),g={install(t){t.component("CmcProcessFlow",u)}};n.CmcProcessFlow=u,n.default=g,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,2 +1,6 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ type __VLS_Props = {
2
+ processInstanceId: string;
3
+ request: any;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
2
6
  export default _default;
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.process-container[data-v-30bb0e46]{height:100%;box-sizing:border-box}.process-container[data-v-30bb0e46]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-30bb0e46]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-30bb0e46]{margin:20px 0}.approval-actions .action-buttons[data-v-30bb0e46]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-30bb0e46]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-30bb0e46]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-30bb0e46]{display:contents}
1
+ @charset "UTF-8";.process-container[data-v-c412a081]{height:100%;box-sizing:border-box}.process-container[data-v-c412a081]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-c412a081]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-c412a081]{margin:20px 0}.approval-actions .action-buttons[data-v-c412a081]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-c412a081]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-c412a081]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-c412a081]{display:contents}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nbb-component-ui",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
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">测试按钮</el-button>
2
+ <el-button @click="open">测试按钮2</el-button>
3
3
  <!-- 审批记录列表 -->
4
4
  <!-- <ProcessInstanceTaskList-->
5
5
  <!-- :process-instance="processInstance"-->
@@ -10,76 +10,76 @@
10
10
 
11
11
  <script setup lang="ts">
12
12
  import { ElMessage } from 'element-plus'
13
- // import {ref, watch} from "vue";
14
- // import {createProcessInstanceApi} from "@/api/processInstance";
15
- // import {createTaskApi} from "@/api/task";
13
+ import {ref, watch} from "vue";
14
+ import {createProcessInstanceApi} from "@/api/processInstance";
15
+ import {createTaskApi} from "@/api/task";
16
16
 
17
17
  // import ProcessInstanceTaskList from './CmcFlowList.vue'
18
18
 
19
- // // @ts-expect-error 运行时由宿主应用提供
20
- // const message = useMessage() // 消息弹窗
21
- //
22
- // const props = defineProps<{
23
- // processInstanceId: string
24
- // request: any
25
- // }>()
26
- //
27
- //
28
- // const processInstanceLoading = ref(false)
29
- // const processInstance = ref<any>({})
30
- // const todoTask = ref<any>({})
31
- // const applicationPrefix = ref('')
32
- // const tasks = ref<any[]>([])
33
- //
34
- // const id = ref<string>('')
35
- // const processInstanceApi = createProcessInstanceApi(props.request)
36
- // const taskApi = createTaskApi(props.request)
37
- //
38
- //
39
- //
40
- //
41
- // const init = (processInstanceId: string) => {
42
- // id.value = processInstanceId
43
- // getApprovalDetail()
44
- // getTaskList()
45
- // }
46
- //
47
- // // 获取审批详情数据
48
- // const getApprovalDetail = async () => {
49
- // try {
50
- // processInstanceLoading.value = true
51
- // const data = await processInstanceApi.getApprovalDetail(id.value)
52
- // if (!data) {
53
- // message.error('查询不到审批详情信息!')
54
- // return
55
- // }
56
- // if (!data.processDefinition || !data.processInstance) {
57
- // message.error('查询不到流程信息!')
58
- // return
59
- // }
60
- // processInstance.value = data?.processInstance
61
- // applicationPrefix.value = data?.processInstance?.formVariables?.applicationPrefix
62
- // todoTask.value = data?.todoTask
63
- // } finally {
64
- // processInstanceLoading.value = false
65
- // }
66
- // }
67
- //
68
- // // 获取任务列表
69
- // const getTaskList = async () => {
70
- // tasks.value = await taskApi.getTaskListByProcessInstanceId(id.value)
71
- // }
72
- //
73
- // watch(
74
- // () => props.processInstanceId,
75
- // (newValue) => {
76
- // debugger
77
- // if (newValue && newValue !== id.value) {
78
- // init(newValue)
79
- // }
80
- // },
81
- // { immediate: true, deep: true }
82
- // )
19
+ // @ts-expect-error 运行时由宿主应用提供
20
+ const message = useMessage() // 消息弹窗
21
+
22
+ const props = defineProps<{
23
+ processInstanceId: string
24
+ request: any
25
+ }>()
26
+
27
+
28
+ const processInstanceLoading = ref(false)
29
+ const processInstance = ref<any>({})
30
+ const todoTask = ref<any>({})
31
+ const applicationPrefix = ref('')
32
+ const tasks = ref<any[]>([])
33
+
34
+ const id = ref<string>('')
35
+ const processInstanceApi = createProcessInstanceApi(props.request)
36
+ const taskApi = createTaskApi(props.request)
37
+
38
+
39
+
40
+
41
+ const init = (processInstanceId: string) => {
42
+ id.value = processInstanceId
43
+ getApprovalDetail()
44
+ getTaskList()
45
+ }
46
+
47
+ // 获取审批详情数据
48
+ const getApprovalDetail = async () => {
49
+ try {
50
+ processInstanceLoading.value = true
51
+ const data = await processInstanceApi.getApprovalDetail(id.value)
52
+ if (!data) {
53
+ message.error('查询不到审批详情信息!')
54
+ return
55
+ }
56
+ if (!data.processDefinition || !data.processInstance) {
57
+ message.error('查询不到流程信息!')
58
+ return
59
+ }
60
+ processInstance.value = data?.processInstance
61
+ applicationPrefix.value = data?.processInstance?.formVariables?.applicationPrefix
62
+ todoTask.value = data?.todoTask
63
+ } finally {
64
+ processInstanceLoading.value = false
65
+ }
66
+ }
67
+
68
+ // 获取任务列表
69
+ const getTaskList = async () => {
70
+ tasks.value = await taskApi.getTaskListByProcessInstanceId(id.value)
71
+ }
72
+
73
+ watch(
74
+ () => props.processInstanceId,
75
+ (newValue) => {
76
+ debugger
77
+ if (newValue && newValue !== id.value) {
78
+ init(newValue)
79
+ }
80
+ },
81
+ { immediate: true, deep: true }
82
+ )
83
83
 
84
84
 
85
85
  const open = () => {