china-mobile-international-custom-components 0.0.26 → 0.0.27
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { w as B } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
-
import { ref as d, computed as _, createBlock as
|
|
2
|
+
import { ref as d, computed as _, createBlock as C, openBlock as g, unref as c, withCtx as V, createElementVNode as N, createVNode as h, createElementBlock as w, createCommentVNode as x, Fragment as U, renderList as M, createTextVNode as D, toDisplayString as O, watch as k, onMounted as F } from "vue";
|
|
3
3
|
import { emitsMap as t } from "color-star-custom-methods";
|
|
4
|
-
import { R
|
|
4
|
+
import { R, u as G, r as $, T as j, A as Y } from "./chunks/index.39AUVSwV.js";
|
|
5
5
|
import { ElDialog as q, ElRadioGroup as z, ElRadio as H, ElButton as P } from "element-plus";
|
|
6
6
|
import { TreeShowSelect as J } from "color-star-custom-components";
|
|
7
7
|
const K = { class: "dialog-content" }, Q = {
|
|
@@ -18,7 +18,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
18
18
|
// 当前选择的范围类型(是否全部可见)
|
|
19
19
|
allVisible: {
|
|
20
20
|
type: Boolean,
|
|
21
|
-
default:
|
|
21
|
+
default: R.ALL
|
|
22
22
|
},
|
|
23
23
|
// 选中的项目列表
|
|
24
24
|
modelValue: {
|
|
@@ -36,8 +36,8 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
36
36
|
t.save,
|
|
37
37
|
t.cancel
|
|
38
38
|
],
|
|
39
|
-
setup(A, { emit:
|
|
40
|
-
const y = A, a =
|
|
39
|
+
setup(A, { emit: I }) {
|
|
40
|
+
const y = A, a = I, p = d(!0), o = d(y.allVisible), r = d([...y.modelValue]), f = d(), { selectedMembers: m, selectedDepartments: s } = G(
|
|
41
41
|
r,
|
|
42
42
|
_(() => y.treeList),
|
|
43
43
|
!1
|
|
@@ -57,11 +57,11 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
57
57
|
});
|
|
58
58
|
}), i;
|
|
59
59
|
}), L = (i) => {
|
|
60
|
-
o.value = i, i ===
|
|
61
|
-
},
|
|
60
|
+
o.value = i, i === R.ALL && (r.value = []);
|
|
61
|
+
}, T = (i) => {
|
|
62
62
|
const { selectedNode: e } = i;
|
|
63
63
|
r.value = e || [];
|
|
64
|
-
},
|
|
64
|
+
}, S = () => {
|
|
65
65
|
a(t.cancel), a(t.updateVisible, !1);
|
|
66
66
|
}, E = () => {
|
|
67
67
|
a(t.save, {
|
|
@@ -69,18 +69,19 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
69
69
|
selectedItems: [...r.value]
|
|
70
70
|
}), a(t.updateVisible, !1);
|
|
71
71
|
};
|
|
72
|
-
return (i, e) => (g(),
|
|
72
|
+
return (i, e) => (g(), C(c(q), {
|
|
73
73
|
modelValue: p.value,
|
|
74
74
|
"onUpdate:modelValue": e[2] || (e[2] = (n) => p.value = n),
|
|
75
75
|
title: "可用范围设置",
|
|
76
76
|
"close-on-click-modal": !1,
|
|
77
77
|
"close-on-press-escape": !1,
|
|
78
|
-
"append-to-body": ""
|
|
78
|
+
"append-to-body": "",
|
|
79
|
+
onClose: S
|
|
79
80
|
}, {
|
|
80
81
|
footer: V(() => [
|
|
81
82
|
N("div", W, [
|
|
82
83
|
h(c(P), {
|
|
83
|
-
onClick:
|
|
84
|
+
onClick: S,
|
|
84
85
|
plain: ""
|
|
85
86
|
}, {
|
|
86
87
|
default: V(() => [...e[3] || (e[3] = [
|
|
@@ -108,7 +109,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
108
109
|
onChange: L
|
|
109
110
|
}, {
|
|
110
111
|
default: V(() => [
|
|
111
|
-
(g(!0),
|
|
112
|
+
(g(!0), w(U, null, M(c($), (n) => (g(), C(c(H), {
|
|
112
113
|
key: n.value,
|
|
113
114
|
value: n.value
|
|
114
115
|
}, {
|
|
@@ -120,7 +121,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
120
121
|
]),
|
|
121
122
|
_: 1
|
|
122
123
|
}, 8, ["modelValue"]),
|
|
123
|
-
o.value === c(
|
|
124
|
+
o.value === c(R).PARTIAL ? (g(), w("div", Q, [
|
|
124
125
|
h(c(J), {
|
|
125
126
|
modelValue: r.value,
|
|
126
127
|
"onUpdate:modelValue": e[1] || (e[1] = (n) => r.value = n),
|
|
@@ -131,7 +132,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
131
132
|
hasFilter: !0,
|
|
132
133
|
rightTreeList: b.value,
|
|
133
134
|
style: { height: "500px" },
|
|
134
|
-
onGetCheckedNode:
|
|
135
|
+
onGetCheckedNode: T
|
|
135
136
|
}, null, 8, ["modelValue", "treeProps", "treeList", "rightTreeList"])
|
|
136
137
|
])) : x("", !0)
|
|
137
138
|
])
|
|
@@ -147,7 +148,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
147
148
|
// 当前选择的范围类型(是否全部可见)
|
|
148
149
|
allVisible: {
|
|
149
150
|
type: Boolean,
|
|
150
|
-
default:
|
|
151
|
+
default: R.ALL
|
|
151
152
|
},
|
|
152
153
|
// 选中的项目列表
|
|
153
154
|
modelValue: {
|
|
@@ -165,7 +166,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
165
166
|
t.updateModelValue,
|
|
166
167
|
t.change
|
|
167
168
|
],
|
|
168
|
-
setup(A, { expose:
|
|
169
|
+
setup(A, { expose: I, emit: y }) {
|
|
169
170
|
const a = A, p = y, o = d(!1), r = d(!1), f = d([]), m = d(a.allVisible), s = d(a.modelValue), b = d(
|
|
170
171
|
new Set(s.value?.map((l) => l.memberId))
|
|
171
172
|
), L = () => {
|
|
@@ -174,9 +175,9 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
174
175
|
}).finally(() => {
|
|
175
176
|
r.value = !1;
|
|
176
177
|
})) : f.value = [];
|
|
177
|
-
},
|
|
178
|
+
}, T = () => {
|
|
178
179
|
o.value = !0;
|
|
179
|
-
},
|
|
180
|
+
}, S = (l) => {
|
|
180
181
|
m.value = l.type, s.value = l.selectedItems, b.value.clear(), s.value.forEach((u) => {
|
|
181
182
|
b.value.add(u.memberId);
|
|
182
183
|
}), p(t.updateAllVisible, m.value), p(t.updateModelValue, s.value), i();
|
|
@@ -222,18 +223,18 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
222
223
|
{ immediate: !1 }
|
|
223
224
|
), F(() => {
|
|
224
225
|
L();
|
|
225
|
-
}),
|
|
226
|
+
}), I({
|
|
226
227
|
getSelectedItems: n
|
|
227
|
-
}), (l, u) => (g(),
|
|
228
|
+
}), (l, u) => (g(), w("div", Z, [
|
|
228
229
|
h(c(Y), {
|
|
229
230
|
allVisible: m.value,
|
|
230
231
|
"model-value": s.value,
|
|
231
232
|
"tree-list": f.value,
|
|
232
|
-
onEdit:
|
|
233
|
+
onEdit: T,
|
|
233
234
|
ref_key: "previewRef",
|
|
234
235
|
ref: e
|
|
235
236
|
}, null, 8, ["allVisible", "model-value", "tree-list"]),
|
|
236
|
-
o.value ? (g(),
|
|
237
|
+
o.value ? (g(), C(X, {
|
|
237
238
|
key: 0,
|
|
238
239
|
visible: o.value,
|
|
239
240
|
"onUpdate:visible": u[0] || (u[0] = (v) => o.value = v),
|
|
@@ -243,7 +244,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
243
244
|
"onUpdate:modelValue": u[2] || (u[2] = (v) => s.value = v),
|
|
244
245
|
"tree-list": f.value,
|
|
245
246
|
loading: r.value,
|
|
246
|
-
onSave:
|
|
247
|
+
onSave: S,
|
|
247
248
|
onCancel: E
|
|
248
249
|
}, null, 8, ["visible", "allVisible", "modelValue", "tree-list", "loading"])) : x("", !0)
|
|
249
250
|
]));
|
|
@@ -251,7 +252,7 @@ const K = { class: "dialog-content" }, Q = {
|
|
|
251
252
|
}), ne = B(ee);
|
|
252
253
|
export {
|
|
253
254
|
ne as AvailableRangeSetting,
|
|
254
|
-
|
|
255
|
+
R as RANGE_TYPES,
|
|
255
256
|
ne as default,
|
|
256
257
|
$ as rangeOptions
|
|
257
258
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./chunks/index.CkihWzK6.js"),e=require("vue"),o=require("color-star-custom-methods"),p=require("./chunks/index.DsmgWFv8.js"),g=require("element-plus"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./chunks/index.CkihWzK6.js"),e=require("vue"),o=require("color-star-custom-methods"),p=require("./chunks/index.DsmgWFv8.js"),g=require("element-plus"),C=require("color-star-custom-components"),N={class:"dialog-content"},M={key:0,class:"selection-area overflow-hidden"},w={class:"dialog-footer"},L={__name:"Dialog",props:{visible:{type:Boolean,default:!1},allVisible:{type:Boolean,default:p.RANGE_TYPES.ALL},modelValue:{type:Array,default:()=>[]},treeList:{type:Array,default:()=>[]}},emits:[o.emitsMap.updateVisible,o.emitsMap.save,o.emitsMap.cancel],setup(h,{emit:S}){const b=h,a=S,v=e.ref(!0),i=e.ref(b.allVisible),d=e.ref([...b.modelValue]),f=e.ref(),{selectedMembers:c,selectedDepartments:s}=p.useSelectionDisplay(d,e.computed(()=>b.treeList),!1),V=e.computed(()=>{const n=[];return s.value.forEach(l=>{n.push({...l,children:void 0})}),c.value.forEach(l=>{n.push({...l,children:void 0})}),n}),y=n=>{i.value=n,n===p.RANGE_TYPES.ALL&&(d.value=[])},A=n=>{const{selectedNode:l}=n;d.value=l||[]},E=()=>{a(o.emitsMap.cancel),a(o.emitsMap.updateVisible,!1)},R=()=>{a(o.emitsMap.save,{type:i.value,selectedItems:[...d.value]}),a(o.emitsMap.updateVisible,!1)};return(n,l)=>(e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:v.value,"onUpdate:modelValue":l[2]||(l[2]=r=>v.value=r),title:"可用范围设置","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":"",onClose:E},{footer:e.withCtx(()=>[e.createElementVNode("div",w,[e.createVNode(e.unref(g.ElButton),{onClick:E,plain:""},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:R},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("保存",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",N,[e.createVNode(e.unref(g.ElRadioGroup),{class:"pd-b-16",modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=r=>i.value=r),onChange:y},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p.rangeOptions),r=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:r.value,value:r.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),i.value===e.unref(p.RANGE_TYPES).PARTIAL?(e.openBlock(),e.createElementBlock("div",M,[e.createVNode(e.unref(C.TreeShowSelect),{modelValue:d.value,"onUpdate:modelValue":l[1]||(l[1]=r=>d.value=r),ref_key:"treeRef",ref:f,treeProps:e.unref(p.TREE_PROPS),treeList:h.treeList,hasFilter:!0,rightTreeList:V.value,style:{height:"500px"},onGetCheckedNode:A},null,8,["modelValue","treeProps","treeList","rightTreeList"])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}},_={class:"available-range-setting w-full"},B=Object.assign({name:"AvailableRangeSetting"},{__name:"layout",props:{allVisible:{type:Boolean,default:p.RANGE_TYPES.ALL},modelValue:{type:Array,default:()=>[]},loadDataApi:{type:Function,default:()=>()=>[]}},emits:[o.emitsMap.updateAllVisible,o.emitsMap.updateModelValue,o.emitsMap.change],setup(h,{expose:S,emit:b}){const a=h,v=b,i=e.ref(!1),d=e.ref(!1),f=e.ref([]),c=e.ref(a.allVisible),s=e.ref(a.modelValue),V=e.ref(new Set(s.value?.map(t=>t.memberId))),y=()=>{a.loadDataApi&&typeof a.loadDataApi=="function"?(d.value=!0,a.loadDataApi().then(t=>{f.value=t?.data?.orgOptionSoList||[]}).finally(()=>{d.value=!1})):f.value=[]},A=()=>{i.value=!0},E=t=>{c.value=t.type,s.value=t.selectedItems,V.value.clear(),s.value.forEach(u=>{V.value.add(u.memberId)}),v(o.emitsMap.updateAllVisible,c.value),v(o.emitsMap.updateModelValue,s.value),n()},R=()=>{i.value=!1},n=()=>{const t={allVisible:c.value,selectedItems:s.value};v(o.emitsMap.change,t)},l=e.ref(null),r=()=>{const t=l.value?.allSelectedItems||[];return{allVisible:c.value,visibleScope:t.map(m=>({memberId:m.memberId,memberName:m.memberName,memberType:m.memberType,bnid:m.bnid}))}};return e.watch(()=>a.allVisible,t=>{c.value=t},{immediate:!0}),e.watch(()=>a.modelValue,t=>{s.value=t||[],V.value.clear(),s.value.forEach(u=>{V.value.add(u.memberId)})},{immediate:!0}),e.watch(()=>a.loadDataApi,()=>{y()},{immediate:!1}),e.onMounted(()=>{y()}),S({getSelectedItems:r}),(t,u)=>(e.openBlock(),e.createElementBlock("div",_,[e.createVNode(e.unref(p.AvailableRangePreview),{allVisible:c.value,"model-value":s.value,"tree-list":f.value,onEdit:A,ref_key:"previewRef",ref:l},null,8,["allVisible","model-value","tree-list"]),i.value?(e.openBlock(),e.createBlock(L,{key:0,visible:i.value,"onUpdate:visible":u[0]||(u[0]=m=>i.value=m),allVisible:c.value,"onUpdate:allVisible":u[1]||(u[1]=m=>c.value=m),modelValue:s.value,"onUpdate:modelValue":u[2]||(u[2]=m=>s.value=m),"tree-list":f.value,loading:d.value,onSave:E,onCancel:R},null,8,["visible","allVisible","modelValue","tree-list","loading"])):e.createCommentVNode("",!0)]))}}),T=k.withInstall(B);exports.RANGE_TYPES=p.RANGE_TYPES;exports.rangeOptions=p.rangeOptions;exports.AvailableRangeSetting=T;exports.default=T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "china-mobile-international-custom-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"components",
|
|
6
6
|
"vue",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"axios": "^1.8.2",
|
|
107
107
|
"vue": "^3.5.26",
|
|
108
|
-
"color-message-lingyun-vue": "0.0.30",
|
|
109
108
|
"color-star-atom-style": "0.0.2",
|
|
109
|
+
"color-message-lingyun-vue": "0.0.30",
|
|
110
110
|
"color-message-aibox-vue": "0.0.80",
|
|
111
111
|
"color-star-custom-methods": "0.0.17",
|
|
112
112
|
"color-star-custom-components": "0.0.18"
|