nbb-component-ui 1.2.4 → 1.2.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.es.js +26 -26
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/ProcessFlow/src/CmcFlowList.vue +3 -5
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as N,
|
|
1
|
+
import { defineComponent as N, resolveComponent as f, openBlock as r, createElementBlock as i, createElementVNode as l, toDisplayString as s, unref as c, createCommentVNode as u, createVNode as v, withCtx as m, Fragment as H, renderList as z, createBlock as A, createTextVNode as I, ref as k, watch as E } from "vue";
|
|
2
2
|
import { ElMessage as V } from "element-plus";
|
|
3
3
|
import { formatDate as T, formatPast2 as B } from "@/utils/formatTime";
|
|
4
4
|
const j = (t) => ({
|
|
@@ -59,10 +59,10 @@ const j = (t) => ({
|
|
|
59
59
|
// 拒绝
|
|
60
60
|
4: "svg-icon:approvalCanceled"
|
|
61
61
|
// 取消
|
|
62
|
-
},
|
|
63
|
-
return
|
|
62
|
+
}, y = (p) => [0, 1, 6, 7].includes(p.status) ? "primary" : p.status === 2 ? "success" : p.status === 3 ? "danger" : p.status === 4 ? "info" : p.status === 5 ? "warning" : "";
|
|
63
|
+
return (p, M) => {
|
|
64
64
|
var b;
|
|
65
|
-
const x =
|
|
65
|
+
const x = f("Icon"), h = f("dict-tag"), g = f("el-tag"), F = f("el-card"), P = f("el-timeline-item"), C = f("el-timeline");
|
|
66
66
|
return r(), i("div", S, [
|
|
67
67
|
l("div", O, [
|
|
68
68
|
l("div", $, [
|
|
@@ -79,19 +79,19 @@ const j = (t) => ({
|
|
|
79
79
|
l("p", null, s(c(n)("processFlow.endTime")) + s(c(T)(t.processInstance.endTime)), 1),
|
|
80
80
|
t.processInstance.durationInMillis ? (r(), i("p", Q, s(c(n)("processFlow.duration")) + s(c(B)((b = t.processInstance) == null ? void 0 : b.durationInMillis)), 1)) : u("", !0)
|
|
81
81
|
]),
|
|
82
|
-
|
|
82
|
+
v(x, {
|
|
83
83
|
size: 100,
|
|
84
84
|
icon: d[t.processInstance.status] || "svg-icon:approvalPending"
|
|
85
85
|
}, null, 8, ["icon"])
|
|
86
86
|
]),
|
|
87
87
|
l("div", W, [
|
|
88
|
-
|
|
89
|
-
default:
|
|
88
|
+
v(C, null, {
|
|
89
|
+
default: m(() => [
|
|
90
90
|
(r(!0), i(H, null, z(t.tasks, (e, w) => (r(), A(P, {
|
|
91
91
|
key: w,
|
|
92
|
-
type:
|
|
92
|
+
type: y(e) || "info"
|
|
93
93
|
}, {
|
|
94
|
-
dot:
|
|
94
|
+
dot: m(() => {
|
|
95
95
|
var a;
|
|
96
96
|
return [
|
|
97
97
|
l("img", {
|
|
@@ -100,7 +100,7 @@ const j = (t) => ({
|
|
|
100
100
|
}, null, 8, X)
|
|
101
101
|
];
|
|
102
102
|
}),
|
|
103
|
-
default:
|
|
103
|
+
default: m(() => [
|
|
104
104
|
l("p", Y, [
|
|
105
105
|
I(s(e.name) + " ", 1),
|
|
106
106
|
e.status ? (r(), A(h, {
|
|
@@ -109,18 +109,18 @@ const j = (t) => ({
|
|
|
109
109
|
value: e.status || ""
|
|
110
110
|
}, null, 8, ["value"])) : u("", !0)
|
|
111
111
|
]),
|
|
112
|
-
|
|
113
|
-
default:
|
|
112
|
+
v(F, { "body-style": { padding: "10px" } }, {
|
|
113
|
+
default: m(() => {
|
|
114
114
|
var a, _, o, D;
|
|
115
115
|
return [
|
|
116
116
|
w === 0 ? (r(), i("label", Z, [
|
|
117
117
|
I(s(((a = e.assigneeUser) == null ? void 0 : a.nickname) || ((_ = e.ownerUser) == null ? void 0 : _.nickname)) + " ", 1),
|
|
118
|
-
|
|
118
|
+
v(g, {
|
|
119
119
|
size: "small",
|
|
120
120
|
type: "info",
|
|
121
121
|
style: { "vertical-align": "1px" }
|
|
122
122
|
}, {
|
|
123
|
-
default:
|
|
123
|
+
default: m(() => {
|
|
124
124
|
var L, U;
|
|
125
125
|
return [
|
|
126
126
|
I(s((U = (L = t.processInstance) == null ? void 0 : L.startUser) == null ? void 0 : U.deptName), 1)
|
|
@@ -131,12 +131,12 @@ const j = (t) => ({
|
|
|
131
131
|
])) : u("", !0),
|
|
132
132
|
e.assigneeUser ? (r(), i("label", ee, [
|
|
133
133
|
I(s(c(n)("processFlow.approver")) + s(((o = e.assigneeUser) == null ? void 0 : o.nickname) || ((D = e.ownerUser) == null ? void 0 : D.nickname)) + " ", 1),
|
|
134
|
-
|
|
134
|
+
v(g, {
|
|
135
135
|
size: "small",
|
|
136
136
|
type: "info",
|
|
137
137
|
style: { "vertical-align": "1px" }
|
|
138
138
|
}, {
|
|
139
|
-
default:
|
|
139
|
+
default: m(() => [
|
|
140
140
|
I(s(e.assigneeUser.deptName), 1)
|
|
141
141
|
]),
|
|
142
142
|
_: 2
|
|
@@ -168,24 +168,24 @@ const j = (t) => ({
|
|
|
168
168
|
});
|
|
169
169
|
const q = (t, n) => {
|
|
170
170
|
const d = t.__vccOpts || t;
|
|
171
|
-
for (const [
|
|
172
|
-
d[
|
|
171
|
+
for (const [y, p] of n)
|
|
172
|
+
d[y] = p;
|
|
173
173
|
return d;
|
|
174
|
-
}, ie = /* @__PURE__ */ q(le, [["__scopeId", "data-v-
|
|
174
|
+
}, ie = /* @__PURE__ */ q(le, [["__scopeId", "data-v-85fc6a7b"]]), pe = /* @__PURE__ */ N({
|
|
175
175
|
__name: "CmcProcessFlow",
|
|
176
176
|
props: {
|
|
177
177
|
processInstanceId: {},
|
|
178
178
|
request: {}
|
|
179
179
|
},
|
|
180
180
|
setup(t) {
|
|
181
|
-
const n = useMessage(), d = t,
|
|
181
|
+
const n = useMessage(), d = t, y = k(!1), p = k({}), M = k({}), x = k(""), h = k([]), g = k(""), F = j(d.request), P = R(d.request), C = () => {
|
|
182
182
|
V.success("aaa!");
|
|
183
183
|
}, b = (a) => {
|
|
184
184
|
g.value = a, e(), w();
|
|
185
185
|
}, e = async () => {
|
|
186
186
|
var a, _;
|
|
187
187
|
try {
|
|
188
|
-
|
|
188
|
+
y.value = !0;
|
|
189
189
|
const o = await F.getApprovalDetail(g.value);
|
|
190
190
|
if (!o) {
|
|
191
191
|
n.error("查询不到审批详情信息!");
|
|
@@ -197,7 +197,7 @@ const q = (t, n) => {
|
|
|
197
197
|
}
|
|
198
198
|
p.value = o == null ? void 0 : o.processInstance, x.value = (_ = (a = o == null ? void 0 : o.processInstance) == null ? void 0 : a.formVariables) == null ? void 0 : _.applicationPrefix, M.value = o == null ? void 0 : o.todoTask;
|
|
199
199
|
} finally {
|
|
200
|
-
|
|
200
|
+
y.value = !1;
|
|
201
201
|
}
|
|
202
202
|
}, w = async () => {
|
|
203
203
|
h.value = await P.getTaskListByProcessInstanceId(g.value);
|
|
@@ -210,15 +210,15 @@ const q = (t, n) => {
|
|
|
210
210
|
},
|
|
211
211
|
{ immediate: !0, deep: !0 }
|
|
212
212
|
), (a, _) => {
|
|
213
|
-
const o =
|
|
213
|
+
const o = f("el-button");
|
|
214
214
|
return r(), i(H, null, [
|
|
215
|
-
|
|
216
|
-
default:
|
|
215
|
+
v(o, { onClick: C }, {
|
|
216
|
+
default: m(() => [..._[0] || (_[0] = [
|
|
217
217
|
I("测试按钮", -1)
|
|
218
218
|
])]),
|
|
219
219
|
_: 1
|
|
220
220
|
}),
|
|
221
|
-
|
|
221
|
+
v(ie, {
|
|
222
222
|
"process-instance": p.value,
|
|
223
223
|
tasks: h.value,
|
|
224
224
|
onRefresh: w
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("@/utils/formatTime")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@/utils/formatTime"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.NbbComponentUi={},r.Vue,r.ElementPlus,r.formatTime))})(this,function(r,e,B,d){"use strict";const T=n=>({getApprovalDetail:async o=>await n.get({url:"/system/bpm/process-instance/get-approval-detail",params:{processInstanceId:o}})}),b=n=>({getTaskListByProcessInstanceId:async o=>await n.get({url:"/system/bpm/task/list-by-process-instance-id",params:{processInstanceId:o}})}),E={class:"scroll-area"},S={class:"flow-header flex justify-between"},P={class:"text-18px font-bold"},F={class:"text-14px font-bold",style:{color:"#005aae"}},M={class:"flex items-center"},u={class:"flow-start"},L={key:0},U={class:"mt-30px block"},A=["src"],q={style:{"font-weight":"700"}},j={key:0,style:{"margin-right":"30px","font-weight":"normal"}},H={key:1,style:{"margin-right":"30px","font-weight":"normal"}},z={key:0,style:{"font-weight":"normal"}},O={key:1,style:{"font-weight":"normal",color:"#8a909c"}},R={key:2,style:{"font-weight":"normal"}},$={key:3,style:{"font-weight":"normal",color:"#8a909c"}},G={key:4,style:{"margin-left":"30px","font-weight":"normal"}},J={key:5,style:{"font-weight":"normal",color:"#8a909c"}},K={key:2},Q=e.defineComponent({name:"BpmProcessInstanceTaskList",__name:"CmcFlowList",props:{processInstance:{},tasks:{}},setup(n){const{t:o}=useI18n(),l={1:"svg-icon:approvalPending",2:"svg-icon:approvalPass",3:"svg-icon:approvalRejected",4:"svg-icon:approvalCanceled"},m=c=>[0,1,6,7].includes(c.status)?"primary":c.status===2?"success":c.status===3?"danger":c.status===4?"info":c.status===5?"warning":"";return(c,V)=>{var g;const y=e.resolveComponent("Icon"),_=e.resolveComponent("dict-tag"),p=e.resolveComponent("el-tag"),k=e.resolveComponent("el-card"),h=e.resolveComponent("el-timeline-item"),w=e.resolveComponent("el-timeline");return e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("div",S,[e.createElementVNode("div",P,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("processFlow.flow")),1),e.createElementVNode("span",null,e.toDisplayString(n.processInstance.id),1)]),e.createElementVNode("div",F,[e.createElementVNode("span",null,e.toDisplayString(n.processInstance.name),1)])]),e.createElementVNode("div",M,[e.createElementVNode("div",u,[e.createElementVNode("p",null,e.toDisplayString(e.unref(o)("processFlow.startTime"))+e.toDisplayString(e.unref(d.formatDate)(n.processInstance.startTime)),1),e.createElementVNode("p",null,e.toDisplayString(e.unref(o)("processFlow.endTime"))+e.toDisplayString(e.unref(d.formatDate)(n.processInstance.endTime)),1),n.processInstance.durationInMillis?(e.openBlock(),e.createElementBlock("p",L,e.toDisplayString(e.unref(o)("processFlow.duration"))+e.toDisplayString(e.unref(d.formatPast2)((g=n.processInstance)==null?void 0:g.durationInMillis)),1)):e.createCommentVNode("",!0)]),e.createVNode(y,{size:100,icon:l[n.processInstance.status]||"svg-icon:approvalPending"},null,8,["icon"])]),e.createElementVNode("div",U,[e.createVNode(w,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tasks,(t,f)=>(e.openBlock(),e.createBlock(h,{key:f,type:m(t)||"info"},{dot:e.withCtx(()=>{var a;return[e.createElementVNode("img",{src:((a=t==null?void 0:t.assigneeUser)==null?void 0:a.avatar)||"https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",class:"avatar-wrap"},null,8,A)]}),default:e.withCtx(()=>[e.createElementVNode("p",q,[e.createTextVNode(e.toDisplayString(t.name)+" ",1),t.status?(e.openBlock(),e.createBlock(_,{key:0,type:"bpm_task_status",value:t.status||""},null,8,["value"])):e.createCommentVNode("",!0)]),e.createVNode(k,{"body-style":{padding:"10px"}},{default:e.withCtx(()=>{var a,i,s,C;return[f===0?(e.openBlock(),e.createElementBlock("label",j,[e.createTextVNode(e.toDisplayString(((a=t.assigneeUser)==null?void 0:a.nickname)||((i=t.ownerUser)==null?void 0:i.nickname))+" ",1),e.createVNode(p,{size:"small",type:"info",style:{"vertical-align":"1px"}},{default:e.withCtx(()=>{var D,x;return[e.createTextVNode(e.toDisplayString((x=(D=n.processInstance)==null?void 0:D.startUser)==null?void 0:x.deptName),1)]}),_:1})])):e.createCommentVNode("",!0),t.assigneeUser?(e.openBlock(),e.createElementBlock("label",H,[e.createTextVNode(e.toDisplayString(e.unref(o)("processFlow.approver"))+e.toDisplayString(((s=t.assigneeUser)==null?void 0:s.nickname)||((C=t.ownerUser)==null?void 0:C.nickname))+" ",1),e.createVNode(p,{size:"small",type:"info",style:{"vertical-align":"1px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.assigneeUser.deptName),1)]),_:2},1024)])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[t.createTime&&!t.endTime?(e.openBlock(),e.createElementBlock("label",z,e.toDisplayString(e.unref(o)("processFlow.createTime")),1)):e.createCommentVNode("",!0),t.createTime&&!t.endTime?(e.openBlock(),e.createElementBlock("label",O,e.toDisplayString(e.unref(d.formatDate)(t==null?void 0:t.createTime,"MM-DD HH:mm")),1)):e.createCommentVNode("",!0),t.endTime?(e.openBlock(),e.createElementBlock("label",R,e.toDisplayString(e.unref(o)("processFlow.approvalTime")),1)):e.createCommentVNode("",!0),t.endTime?(e.openBlock(),e.createElementBlock("label",$,e.toDisplayString(e.unref(d.formatDate)(t==null?void 0:t.endTime,"MM-DD HH:mm")),1)):e.createCommentVNode("",!0),t.durationInMillis?(e.openBlock(),e.createElementBlock("label",G,e.toDisplayString(e.unref(o)("processFlow.duration")),1)):e.createCommentVNode("",!0),t.durationInMillis?(e.openBlock(),e.createElementBlock("label",J,e.toDisplayString(e.unref(d.formatPast2)(t==null?void 0:t.durationInMillis)),1)):e.createCommentVNode("",!0)]),t.reason?(e.openBlock(),e.createElementBlock("div",K,e.toDisplayString(e.unref(o)("processFlow.approvalSuggestion"))+e.toDisplayString(t.reason),1)):e.createCommentVNode("",!0)]}),_:2},1024)]),_:2},1032,["type"]))),128))]),_:1})])])}}}),Z="",N=(n,o)=>{const l=n.__vccOpts||n;for(const[m,c]of o)l[m]=c;return l},W=N(Q,[["__scopeId","data-v-85fc6a7b"]]),X=e.defineComponent({__name:"CmcProcessFlow",props:{processInstanceId:{},request:{}},setup(n){const o=useMessage(),l=n,m=e.ref(!1),c=e.ref({}),V=e.ref({}),y=e.ref(""),_=e.ref([]),p=e.ref(""),k=T(l.request),h=b(l.request),w=()=>{B.ElMessage.success("aaa!")},g=a=>{p.value=a,t(),f()},t=async()=>{var a,i;try{m.value=!0;const s=await k.getApprovalDetail(p.value);if(!s){o.error("查询不到审批详情信息!");return}if(!s.processDefinition||!s.processInstance){o.error("查询不到流程信息!");return}c.value=s==null?void 0:s.processInstance,y.value=(i=(a=s==null?void 0:s.processInstance)==null?void 0:a.formVariables)==null?void 0:i.applicationPrefix,V.value=s==null?void 0:s.todoTask}finally{m.value=!1}},f=async()=>{_.value=await h.getTaskListByProcessInstanceId(p.value)};return e.watch(()=>l.processInstanceId,a=>{debugger;a&&a!==p.value&&g(a)},{immediate:!0,deep:!0}),(a,i)=>{const s=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{onClick:w},{default:e.withCtx(()=>[...i[0]||(i[0]=[e.createTextVNode("测试按钮",-1)])]),_:1}),e.createVNode(W,{"process-instance":c.value,tasks:_.value,onRefresh:f},null,8,["process-instance","tasks"])],64)}}}),v="",I=N(X,[["__scopeId","data-v-618a45b7"]]),Y={install(n){n.component("CmcProcessFlow",I)}};r.CmcProcessFlow=I,r.default=Y,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.avatar-wrap[data-v-
|
|
1
|
+
@charset "UTF-8";.avatar-wrap[data-v-85fc6a7b]{width:40px;height:40px}.flow-start[data-v-85fc6a7b]{width:70%;margin:10px auto;padding:0 10px 10px;background:rgb(245,247,253)}.flow-start p[data-v-85fc6a7b]{margin:0;padding-top:10px;font-size:14px}[data-v-85fc6a7b] .el-timeline-item__dot{left:-15px;top:-15px}.scroll-area[data-v-85fc6a7b]{flex:1;min-height:0;overflow-y:auto}.process-container[data-v-618a45b7]{height:100%;box-sizing:border-box}.process-container[data-v-618a45b7]>.el-card__body{height:100%;padding-bottom:0}.process-container[data-v-618a45b7]>.el-card__body>div{height:100%;display:flex;flex-direction:column}.approval-actions[data-v-618a45b7]{margin:20px 0}.approval-actions .action-buttons[data-v-618a45b7]{display:flex;flex-direction:column;gap:12px}.approval-actions .action-buttons .basic-actions[data-v-618a45b7]{display:flex;gap:12px}.approval-actions .action-buttons .extended-actions[data-v-618a45b7]{display:flex;gap:12px;flex-wrap:wrap}.approval-dialogs[data-v-618a45b7]{display:contents}
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<Icon
|
|
21
21
|
:size="100"
|
|
22
|
-
:icon="statusIconMapping[processInstance.status] || 'svg-icon:approvalPending'"
|
|
22
|
+
:icon="statusIconMapping[processInstance.status as any as 1|2|3|4] || 'svg-icon:approvalPending'"
|
|
23
23
|
/>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
@@ -92,9 +92,8 @@
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
<script lang="ts" setup>
|
|
95
|
-
// @ts-expect-error
|
|
95
|
+
// @ts-expect-error
|
|
96
96
|
import { formatDate, formatPast2 } from '@/utils/formatTime'
|
|
97
|
-
import {ref} from "vue";
|
|
98
97
|
|
|
99
98
|
defineOptions({ name: 'BpmProcessInstanceTaskList' })
|
|
100
99
|
// @ts-expect-error 运行时由宿主应用提供
|
|
@@ -106,7 +105,7 @@ const statusIconMapping = {
|
|
|
106
105
|
4: 'svg-icon:approvalCanceled' // 取消
|
|
107
106
|
}
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
defineProps<{
|
|
110
109
|
processInstance: any
|
|
111
110
|
tasks: any[]
|
|
112
111
|
}>()
|
|
@@ -133,7 +132,6 @@ const getTaskTimelineItemType = (item: any) => {
|
|
|
133
132
|
return ''
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
const taskFormVisible = ref(false)
|
|
137
135
|
</script>
|
|
138
136
|
|
|
139
137
|
|