kso-sel-org 1.0.10 → 1.0.12

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/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as ksoSelOrg } from './src/org-selector/index.vue';
package/index.js ADDED
@@ -0,0 +1,372 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("[data-v-20277761] .org-list-box{display:flex;padding:10px;box-sizing:border-box;justify-content:space-between}[data-v-20277761] .org-list-box .left-tree-box{width:50%;overflow:hidden;border:1px solid #ebeef5}[data-v-20277761] .org-list-box .left-tree-box .search-box{display:flex;height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;align-items:center}[data-v-20277761] .org-list-box .left-tree-box .search-box label{font-weight:700;color:#303133;white-space:nowrap}[data-v-20277761] .org-list-box .left-tree-box .search-box .el-input{width:100%;margin-left:10px}[data-v-20277761] .org-list-box .right-selected-list{width:48%;border:1px solid #ebeef5}[data-v-20277761] .org-list-box .right-selected-list .selected-box{display:flex;height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;align-items:center;justify-content:space-between}[data-v-20277761] .org-list-box .right-selected-list .selected-box span{font-weight:700;color:#303133}[data-v-20277761] .org-list-box .right-selected-list .selected-box .delete-btn{display:inline-block;width:17px;height:17px;cursor:pointer;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADkSURBVDiN7ZOxccJAEEXfwiX2EFCCSnAHhkoM+V4NtKAZRCw6kVwCHUAHDixImPsOPJ5BMrKsGYd+4d79d/+CNTqc3SvBojv/wqB+LIrl7Sxc3FuBBPM+AYBg3s2EBNVPoTs8dTNBZmuTMmCD2V7wOmQxeEZamVme4GAAF/dFgkpm69l2ux+SvMe4MqmcwPKhKOrJyK/cpVfSuKuJsQRoYiwbd42W/EmTf8l3DGqkE4BSOhjUfXdD38Htks12uxzIRzcZQ6uJwebs/jIUktTa9E9JCEeu1zekTJD96nmzI9PpEeADOClObZiMikMAAAAASUVORK5CYII=) no-repeat;block-size:100% 100%}[data-v-20277761] .org-list-box .right-selected-list .el-icon svg{width:1.5em;height:1.5em}[data-v-20277761] .org-list-box .tree-content-box{height:420px;padding:5px 15px;overflow:auto;box-sizing:border-box}[data-v-20277761] .org-list-box ul li{display:flex;width:100%;padding:0 20px;margin-bottom:8px;line-height:40px;border:solid 1px #d7dde4;border-radius:4px;box-sizing:border-box;align-items:center;justify-content:space-between}[data-v-20277761] .org-list-box ul .org-name{width:92%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-v-20277761] .org-list-box ul .el-icon{cursor:pointer}[data-v-20277761] .org-list-box .org-del .img-box{margin:7px 0 0;cursor:pointer}[data-v-20277761] .org-list-box .flow-modal-title{width:100%;height:40px;line-height:40px;color:#fff;text-indent:1em;background:#2b5fda}.selector-footer[data-v-20277761]{display:flex;padding:10px;border-top:solid 1px #dcdfe6;justify-content:flex-end}[data-v-20277761] .tree-folder-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAIvSURBVFiF7ZaxaxRBFMZ/73JFhBQWlhIDXmGRIoKFxR1OYboIFloKu7cBAyLEykpIYSFYi4W32QQFiwTyDwhOsaJgm+KKNFpdYRkkYJJncZO7SW7vdu+SgMH74Ir5bt77vn3v7czCGP87JG+DSfQtytIZajb5Q80+ll8ApdztZysOcIMJ7h4tykME7iCkI8sqFaAKgDA5vAEhtaGEo+qbWAPEGfCQ34JzRvEKKHOmobN2UbZ92sSaADBBagOJAcyaRhy0n9ZGg6s2TAXmKPHdrOqDY6wQIASoV16l2uFzMNCAeae3T1CTwIZJ9Hlh2zno2wLT0PsI7z1qG5gFQHllEp3hB09tXXrOEjeshQY2swIm1mWEDYQpR63zk5vAQ2DPmVhimi3zRqeychTFsQqYFS1zjdcoyx3ykBd2UV661aaJtYWwBVwBFrjEZ5PoPRtKy3uAKsJ1AFuX9UEGOhUwK1pmmo+e+D7wyBMHwEaSItSAHUfdQvlqGlrxskbAmvsNRLcFV1kAjiZ8F2He1uVDVpANpYlQQ/jmqBlKjDSYXQPCZY9/ZkOxgwJtKC1+M+/Fd9t5SIwSovmDmP0WKPt5gQD2ieyaVe3lI0mh2L1xMY5ik2iCtk+1rPf+NPsvRgWGhvIl/1vrHA3YujSARpG9/2gLhMjEeqez9q7azv1/Ekq173/tnJUsumtA2fP6Vs36fHKJgj4SlX4iPVB3oeG34IBPQLNQgtOh6bTGGAOAv4Uio5lixzLEAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-20277761] .tree-file-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAJxSURBVFiF7Za/a1NRFMc/5zWFCh07ZBBF6NDBoUOhFjpchw5iCwpdHARfWiEigotTl4CjiyBSi315gRa6VByiOEjoFYQ6dHToUBBbh/wBoS0YehzeTWh+vDRJ0xahXwiEc8893+89P+598D/DLOmQWdKh08TwuibP6iz97NHPnsnq7LkKMIGmUdaAAWAAZc0Emj4XASarCwiLCImqUUggLJqsLnQaT9omzmiC67xCee5MZeCJ+78ITpDwmt+8sBkp90yAyWiCa6wBlVqXAN+mZB1cP0AIDLr1dXZ50I6IEwWYtzrIFfKAqZIrd+ycfK/xC3QS4csxEZYDZuxTKXUtwISaRMkDY85URLhtfdmO8R9B2QCSzrSFMGN9KcZxxDahWdZhF6xCvo0wEUcOYH3ZRpgAKj5jKBtmWYfj9jTNgFnWm3h8rZ5E+AHcb3WSmv2hJoGPKLecqcgRU3Zeftb7NmTA1XKzSq4U2GeqXXIA60uRfaZQCs6URNg0gU7W+9ZkwHXzCtEFE2GX/nZHqh5uev4eMx0CDyvTUyPA3WRvai4YwKakeZmyOo1wFwDls03Jpxg/rTEoZeCZnZN34EpgQh3BYxyPVYQcsNPyZFl9CeRR0ihpIG8CzbTaA+wg5PBYxWPchDoCcU0YaojyCBozYN7rVTx+1WcKpcwRN+xj+VMnNsqAkLO++PVcnT9GfYw2kEcECfoY7TRc5wKU+GlotdYrAXZOtoBvTcgLbu1sBQBwwDRKQPQolVACDrnXTajGWrYB98DMu9+p0PUnWa9wKeDCBZzYhCbQ8EIFINGVfFZoXgLlA9GM9wolF/MSl2jAP+MZ1PXRPKaQAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-20277761] .el-input{height:32px}[data-v-20277761] .node-text-box{display:flex;align-items:center}[data-v-20277761] .node-text-box .el-radio{margin-right:5px}[data-v-20277761] .node-text-box .el-radio .el-radio__label{display:none}[data-v-20277761] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f0f5ff}[data-v-20277761] .el-input__icon{color:#a8abb2}[data-v-20277761]::-webkit-scrollbar{width:5px}[data-v-20277761]::-webkit-scrollbar-thumb{background:#b7c7dd;border-radius:3px}[data-v-20277761]::-webkit-scrollbar-track{background:#ededed;border-radius:3px}.close[data-v-20277761]{position:absolute;right:55px;display:none;padding:2px;cursor:pointer;border-radius:50%}.org-selector:hover .close[data-v-20277761]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { defineComponent as q, useAttrs as ne, inject as P, ref as c, watch as R, onMounted as ae, resolveComponent as f, openBlock as k, createElementBlock as I, createVNode as n, unref as _, renderSlot as ue, createBlock as M, isRef as U, withCtx as m, createCommentVNode as de, createTextVNode as v, toDisplayString as re, createElementVNode as se } from "vue";
3
+ import { CircleCloseFilled as ie } from "@element-plus/icons-vue";
4
+ const ce = {
5
+ key: 0,
6
+ class: "org-selector"
7
+ }, fe = {
8
+ key: 1,
9
+ class: "org-selector"
10
+ }, pe = {
11
+ class: "selector-footer"
12
+ }, ve = /* @__PURE__ */ q({
13
+ __name: "index",
14
+ props: {
15
+ notDialog: {
16
+ type: Boolean
17
+ },
18
+ modelValue: {
19
+ default: ""
20
+ },
21
+ rootOrgId: {
22
+ default: ""
23
+ },
24
+ orgType: {
25
+ default: ""
26
+ },
27
+ inputText: {
28
+ default: ""
29
+ },
30
+ returnValue: {
31
+ default: ""
32
+ },
33
+ readonly: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ isClear: {
38
+ type: Boolean,
39
+ default: !0
40
+ },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ buttonText: {
46
+ default: "选择"
47
+ },
48
+ multiple: {
49
+ type: Boolean,
50
+ default: !0
51
+ },
52
+ bindEvent: {
53
+ type: Boolean,
54
+ default: !0
55
+ },
56
+ defaultText: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ expandKeys: {
61
+ default: () => []
62
+ },
63
+ reqParams: {
64
+ default: void 0
65
+ }
66
+ },
67
+ emits: ["onCancel", "onSelect", "update:modelValue", "onClear"],
68
+ setup(C, {
69
+ expose: E,
70
+ emit: b
71
+ }) {
72
+ const o = C;
73
+ let N = ne();
74
+ const h = b, S = P("req"), {
75
+ warningMsgBox: z
76
+ } = P("msgBox"), $ = {
77
+ children: "childrenList",
78
+ label: "orgName"
79
+ }, d = c(null);
80
+ let s = c(""), j = c(!1), p = c(!1), B = c(!1), y = c(""), V = c(""), r = c([]), D = c([]), g = c([]);
81
+ R(() => o.modelValue, () => {
82
+ o.defaultText && !B.value && F();
83
+ }), R(() => o.inputText, (e) => {
84
+ s.value = e;
85
+ });
86
+ const A = /* @__PURE__ */ q({
87
+ render() {
88
+ return n("div", {
89
+ class: "org-list-box"
90
+ }, [n("div", {
91
+ class: "left-tree-box"
92
+ }, [n("div", {
93
+ class: "search-box"
94
+ }, [n("label", null, [v("单位列表")]), n(f("el-input"), {
95
+ modelValue: V.value,
96
+ "onUpdate:modelValue": (e) => V.value = e,
97
+ "suffix-icon": f("Search"),
98
+ onInput: X,
99
+ placeholder: "请输入单位名称查询"
100
+ }, null)]), n("div", {
101
+ class: "tree-content-box"
102
+ }, [n(f("el-tree"), {
103
+ ref: (e) => d.value = e,
104
+ data: D.value,
105
+ "node-key": "id",
106
+ props: $,
107
+ "expand-on-click-node": !1,
108
+ "show-checkbox": o.multiple,
109
+ "check-strictly": !0,
110
+ "highlight-current": !0,
111
+ accordion: !0,
112
+ "check-on-click-node": !0,
113
+ "filter-node-method": W,
114
+ indent: 26,
115
+ onCheck: Z,
116
+ "render-content": Q,
117
+ "default-expanded-keys": o.expandKeys,
118
+ "icon-class": "el-icon-arrow-right"
119
+ }, null)])]), n("div", {
120
+ class: "right-selected-list"
121
+ }, [n("div", {
122
+ class: "selected-box"
123
+ }, [n("span", null, [v("已选单位")]), n("div", {
124
+ title: "删除全部"
125
+ }, [n("i", {
126
+ onClick: K,
127
+ class: "delete-btn"
128
+ }, null)])]), n("div", null, [n("div", {
129
+ class: "tree-content-box"
130
+ }, [n("ul", null, [r.value.map((e, l) => n("li", {
131
+ title: e.orgName + "(" + e.id + ")"
132
+ }, [n("span", {
133
+ class: "org-name"
134
+ }, [e.orgName, v("("), e.id, v(")")]), n(f("el-icon"), {
135
+ onClick: () => ee(e, l),
136
+ color: "#909399",
137
+ size: "16"
138
+ }, {
139
+ default: () => [n(ie, null, null)]
140
+ })]))])])])])]);
141
+ }
142
+ });
143
+ function T() {
144
+ if (o.modelValue ? g.value = o.modelValue.split(",") : g.value = [], p.value = !0, j.value && d.value) {
145
+ d.value.setCheckedKeys(g.value), r.value = d.value.getCheckedNodes();
146
+ return;
147
+ }
148
+ H();
149
+ }
150
+ function G() {
151
+ o.bindEvent && T();
152
+ }
153
+ function H() {
154
+ let e = {
155
+ pid: o.rootOrgId,
156
+ orgType: o.orgType
157
+ };
158
+ o.reqParams && (e = Object.assign(e, o.reqParams)), S.post({
159
+ url: getKsoRoot("/sys/org/list-by-condition"),
160
+ params: e
161
+ }).then(({
162
+ data: l
163
+ }) => {
164
+ let t = J(l);
165
+ t && t.length > 0 && t.forEach((a) => {
166
+ a.expanded = !0;
167
+ }), D.value = t, d.value.setCheckedKeys(g.value), j.value = !0;
168
+ });
169
+ }
170
+ function F() {
171
+ if (!o.modelValue)
172
+ return;
173
+ B.value = !0;
174
+ let e = {
175
+ ids: o.modelValue
176
+ };
177
+ S.post({
178
+ url: getKsoRoot("/sys/org/find-by-ids"),
179
+ params: e
180
+ }).then(({
181
+ data: l
182
+ }) => {
183
+ if (l && l.length > 0) {
184
+ let t = [];
185
+ l.forEach((a) => {
186
+ t.push(a.orgName);
187
+ }), s.value = t.join(",");
188
+ }
189
+ });
190
+ }
191
+ function J(e) {
192
+ return e.forEach((l) => {
193
+ l.name = l.orgName, g.value.length > 0 && g.value.includes(l.id) && r.value.push(l);
194
+ let t = [];
195
+ e.forEach((a) => {
196
+ a.pid == l.id && t.push(a);
197
+ }), l.childrenList = t;
198
+ }), e = e.filter((l) => l.pid == ""), e;
199
+ }
200
+ function Q(e, {
201
+ node: l,
202
+ data: t
203
+ }) {
204
+ t.expanded && (l.expanded = !0);
205
+ let a = "tree-file-node-icon";
206
+ l.childNodes && l.childNodes.length > 0 && (a = "tree-folder-node-icon");
207
+ let u = [];
208
+ if (!o.multiple) {
209
+ let i = "";
210
+ t.id === y.value && (i = t.id), u.push(e(f("el-radio"), {
211
+ modelValue: i,
212
+ label: t.id,
213
+ size: "large"
214
+ }));
215
+ }
216
+ return u.push(e("i", {
217
+ class: a,
218
+ style: {
219
+ marginRight: "5px"
220
+ }
221
+ })), u.push(e("span", {
222
+ attrs: {
223
+ title: t.name
224
+ }
225
+ }, t.name)), e("span", {
226
+ class: "node-text-box"
227
+ }, u);
228
+ }
229
+ function W(e, l) {
230
+ return e ? l.name.indexOf(e) !== -1 || l.id.indexOf(e) !== -1 : !0;
231
+ }
232
+ function X() {
233
+ d.value.filter(V.value), V.value || Y(D.value[0].id, !1);
234
+ }
235
+ function Y(e, l) {
236
+ var t = d.value.store.nodesMap;
237
+ for (let a in t)
238
+ e === a ? t[a].expanded = !0 : t[a].expanded = l;
239
+ }
240
+ function Z(e) {
241
+ o.multiple || (d.value.setCheckedNodes([e]), y.value = e.id), r.value = d.value.getCheckedNodes();
242
+ }
243
+ function ee(e, l) {
244
+ r.value.splice(l, 1), y.value = "", d.value.setCheckedNodes(r.value);
245
+ }
246
+ function K() {
247
+ r.value = [], y.value = "", d.value && d.value.setCheckedNodes(r.value);
248
+ }
249
+ function w() {
250
+ p.value = !1, h("onCancel", "");
251
+ }
252
+ function le() {
253
+ if (r.value.length == 0)
254
+ return z("请选择数据"), !1;
255
+ let e = L(r.value);
256
+ te(e), p.value = !1, h("onSelect", e);
257
+ }
258
+ function L(e) {
259
+ let l = [];
260
+ return e.forEach((t) => {
261
+ let a = {
262
+ id: t.id,
263
+ orgName: t.orgName,
264
+ orgType: t.orgType,
265
+ sname: t.sname,
266
+ fname: t.fname,
267
+ regId: t.regId,
268
+ regName: t.regName,
269
+ cityId: t.cityId,
270
+ cityName: t.cityName
271
+ };
272
+ l.push(a);
273
+ }), l;
274
+ }
275
+ function te(e) {
276
+ let l = {};
277
+ Object.keys(e[0]).forEach((a) => {
278
+ l[a] = [];
279
+ }), e.forEach((a) => {
280
+ var u;
281
+ for (let i in a)
282
+ (u = l[i]) == null || u.push(a[i]);
283
+ }), s.value = l.orgName.join(","), h("update:modelValue", l.id.join(","));
284
+ let t = o.returnValue.split("|");
285
+ t && t.length > 0 && t.forEach((a) => {
286
+ let u = a.split(":");
287
+ if (u && u.length > 1) {
288
+ let i = l[u[1]], O = i ? i.join(",") : "";
289
+ N.sync[u[0]] = O;
290
+ }
291
+ });
292
+ }
293
+ function oe() {
294
+ if (s.value = "", h("update:modelValue", ""), o.returnValue) {
295
+ let e = o.returnValue.split("|");
296
+ e && e.length > 0 && e.forEach((l) => {
297
+ let t = l.split(":");
298
+ t && t.length > 1 && (N.sync[t[0]] = "");
299
+ });
300
+ }
301
+ K(), h("onClear", "");
302
+ }
303
+ return ae(() => {
304
+ o.notDialog && T(), o.defaultText && !B.value ? F() : s.value = o.inputText, o.multiple || (y.value = o.modelValue);
305
+ }), E({
306
+ /** 获取选中的数据 */
307
+ getSelectData: () => L(r.value),
308
+ openDialogEvent: T
309
+ }), (e, l) => {
310
+ const t = f("CircleClose"), a = f("el-icon"), u = f("el-button"), i = f("el-input"), O = f("el-dialog");
311
+ return e.notDialog ? (k(), I("div", ce, [n(_(A))])) : (k(), I("div", fe, [e.$slots.func ? (k(), I("div", {
312
+ key: 0,
313
+ class: "slot-box",
314
+ onClick: G
315
+ }, [ue(e.$slots, "func", {}, void 0, !0)])) : (k(), M(i, {
316
+ key: 1,
317
+ modelValue: _(s),
318
+ "onUpdate:modelValue": l[0] || (l[0] = (x) => U(s) ? s.value = x : s = x),
319
+ disabled: e.disabled,
320
+ readonly: e.readonly
321
+ }, {
322
+ append: m(() => [_(s) && e.isClear ? (k(), M(a, {
323
+ key: 0,
324
+ class: "close",
325
+ onClick: oe
326
+ }, {
327
+ default: m(() => [n(t, {
328
+ color: "#868484"
329
+ })]),
330
+ _: 1
331
+ })) : de("", !0), n(u, {
332
+ type: "primary",
333
+ disabled: e.disabled,
334
+ onClick: T
335
+ }, {
336
+ default: m(() => [v(re(e.buttonText), 1)]),
337
+ _: 1
338
+ }, 8, ["disabled"])]),
339
+ _: 1
340
+ }, 8, ["modelValue", "disabled", "readonly"])), n(O, {
341
+ title: "单位选择",
342
+ modelValue: _(p),
343
+ "onUpdate:modelValue": l[1] || (l[1] = (x) => U(p) ? p.value = x : p = x),
344
+ onClose: w,
345
+ width: 1e3
346
+ }, {
347
+ default: m(() => [n(_(A)), se("div", pe, [n(u, {
348
+ onClick: w
349
+ }, {
350
+ default: m(() => [v("取消")]),
351
+ _: 1
352
+ }), n(u, {
353
+ type: "primary",
354
+ onClick: le
355
+ }, {
356
+ default: m(() => [v("确认")]),
357
+ _: 1
358
+ })])]),
359
+ _: 1
360
+ }, 8, ["modelValue"])]));
361
+ };
362
+ }
363
+ });
364
+ const ge = (C, E) => {
365
+ const b = C.__vccOpts || C;
366
+ for (const [o, N] of E)
367
+ b[o] = N;
368
+ return b;
369
+ }, ye = /* @__PURE__ */ ge(ve, [["__scopeId", "data-v-20277761"]]);
370
+ export {
371
+ ye as ksoSelOrg
372
+ };
package/package.json CHANGED
@@ -1,55 +1,13 @@
1
1
  {
2
2
  "name": "kso-sel-org",
3
- "version": "1.0.10",
4
- "description": "机构选择",
5
- "private": false,
6
- "main": "dist/index.umd.js",
7
- "module": "dist/index.es.js",
8
- "types": "dist/index.d.ts",
9
- "files": [
10
- "dist"
11
- ],
3
+ "version": "1.0.12",
4
+ "description": "",
5
+ "main": "index.js",
12
6
  "scripts": {
13
- "dev": "vite",
14
- "build": "vue-tsc --noEmit && vite build",
15
- "build:no-vue-tsc": "vite build",
16
- "preview": "vite preview"
7
+ "test": "echo \"Error: no test specified\" && exit 1"
17
8
  },
18
- "dependencies": {
19
- "axios": "^1.6.2",
20
- "element-plus": "^2.3.8",
21
- "element-resize-detector": "^1.2.4",
22
- "kso-dic": "^1.0.0",
23
- "kso-sel-org": "^1.0.9",
24
- "kso-sel-reg": "^1.0.1",
25
- "less": "^4.1.3",
26
- "less-loader": "^11.1.3",
27
- "qs": "^6.11.2",
28
- "template_js": "^3.1.4",
29
- "unplugin-auto-import": "^0.17.2",
30
- "vite-plugin-dts": "3.4.0",
31
- "vue": "3.3.4",
32
- "vue-router": "^4.2.4",
33
- "vue-types": "^5.1.0",
34
- "vue-virtual-list-xg": "^0.0.9"
35
- },
36
- "devDependencies": {
37
- "@types/node": "^20.3.3",
38
- "@vitejs/plugin-vue": "^4.1.0",
39
- "css-loader": "^6.8.1",
40
- "sass": "^1.69.5",
41
- "typescript": "^5.0.2",
42
- "vite": "^4.3.9",
43
- "vite-plugin-eslint": "^1.8.1",
44
- "vue-loader": "^17.3.1",
45
- "vue-style-loader": "^4.1.3",
46
- "vue-tsc": "^1.4.2"
47
- },
48
- "keywords": [
49
- "kso-sel-org",
50
- "kso",
51
- "vue3"
52
- ],
53
- "author": "kusafe",
54
- "license": "MIT"
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "types": "./index.d.ts"
55
13
  }
@@ -0,0 +1,148 @@
1
+ declare function openDialogEvent(): void;
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ /** 没有对话框 */
4
+ notDialog?: boolean | undefined;
5
+ /** 默认选中code值 */
6
+ modelValue: string;
7
+ /** 根机构ID(根机构ID,如果不设置,则返回所有机构树,传入则只显示该机构下的所有单位树) */
8
+ rootOrgId?: string | undefined;
9
+ /** 单位类型(如果不设置,则返回所有单位类型,否则传值(01:隶属局单位,02:直属局单位,03:总署单位))*/
10
+ orgType?: string | undefined;
11
+ /** 文本框显示内容 */
12
+ inputText?: string | undefined;
13
+ /** 返回内容处理 */
14
+ returnValue?: string | undefined;
15
+ /** 是否只读 */
16
+ readonly?: boolean | undefined;
17
+ /** 是否清除 */
18
+ isClear?: boolean | undefined;
19
+ /** 是否禁用 */
20
+ disabled?: boolean | undefined;
21
+ /** 按钮文本内容 */
22
+ buttonText?: string | undefined;
23
+ /** 开启复选 */
24
+ multiple?: boolean | undefined;
25
+ /** 事件绑定 */
26
+ bindEvent?: boolean | undefined;
27
+ /** 根据传进来的code查对应的name,覆盖inputText值 */
28
+ defaultText?: boolean | undefined;
29
+ /** 需展开的节点 */
30
+ expandKeys?: any[] | undefined;
31
+ /** 扩展查询参数 */
32
+ reqParams?: object | undefined;
33
+ }>, {
34
+ modelValue: string;
35
+ rootOrgId: string;
36
+ orgType: string;
37
+ inputText: string;
38
+ returnValue: string;
39
+ readonly: boolean;
40
+ isClear: boolean;
41
+ disabled: boolean;
42
+ buttonText: string;
43
+ multiple: boolean;
44
+ bindEvent: boolean;
45
+ defaultText: boolean;
46
+ expandKeys: () => never[];
47
+ reqParams: undefined;
48
+ }>, {
49
+ /** 获取选中的数据 */
50
+ getSelectData: () => object[];
51
+ openDialogEvent: typeof openDialogEvent;
52
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
+ onCancel: (...args: any[]) => void;
54
+ onSelect: (...args: any[]) => void;
55
+ "update:modelValue": (...args: any[]) => void;
56
+ onClear: (...args: any[]) => void;
57
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
58
+ /** 没有对话框 */
59
+ notDialog?: boolean | undefined;
60
+ /** 默认选中code值 */
61
+ modelValue: string;
62
+ /** 根机构ID(根机构ID,如果不设置,则返回所有机构树,传入则只显示该机构下的所有单位树) */
63
+ rootOrgId?: string | undefined;
64
+ /** 单位类型(如果不设置,则返回所有单位类型,否则传值(01:隶属局单位,02:直属局单位,03:总署单位))*/
65
+ orgType?: string | undefined;
66
+ /** 文本框显示内容 */
67
+ inputText?: string | undefined;
68
+ /** 返回内容处理 */
69
+ returnValue?: string | undefined;
70
+ /** 是否只读 */
71
+ readonly?: boolean | undefined;
72
+ /** 是否清除 */
73
+ isClear?: boolean | undefined;
74
+ /** 是否禁用 */
75
+ disabled?: boolean | undefined;
76
+ /** 按钮文本内容 */
77
+ buttonText?: string | undefined;
78
+ /** 开启复选 */
79
+ multiple?: boolean | undefined;
80
+ /** 事件绑定 */
81
+ bindEvent?: boolean | undefined;
82
+ /** 根据传进来的code查对应的name,覆盖inputText值 */
83
+ defaultText?: boolean | undefined;
84
+ /** 需展开的节点 */
85
+ expandKeys?: any[] | undefined;
86
+ /** 扩展查询参数 */
87
+ reqParams?: object | undefined;
88
+ }>, {
89
+ modelValue: string;
90
+ rootOrgId: string;
91
+ orgType: string;
92
+ inputText: string;
93
+ returnValue: string;
94
+ readonly: boolean;
95
+ isClear: boolean;
96
+ disabled: boolean;
97
+ buttonText: string;
98
+ multiple: boolean;
99
+ bindEvent: boolean;
100
+ defaultText: boolean;
101
+ expandKeys: () => never[];
102
+ reqParams: undefined;
103
+ }>>> & {
104
+ onOnCancel?: ((...args: any[]) => any) | undefined;
105
+ onOnSelect?: ((...args: any[]) => any) | undefined;
106
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
107
+ onOnClear?: ((...args: any[]) => any) | undefined;
108
+ }, {
109
+ modelValue: string;
110
+ inputText: string;
111
+ returnValue: string;
112
+ readonly: boolean;
113
+ isClear: boolean;
114
+ disabled: boolean;
115
+ buttonText: string;
116
+ multiple: boolean;
117
+ bindEvent: boolean;
118
+ defaultText: boolean;
119
+ expandKeys: any[];
120
+ reqParams: object;
121
+ rootOrgId: string;
122
+ orgType: string;
123
+ }, {}>, {
124
+ func?(_: {}): any;
125
+ }>;
126
+ export default _default;
127
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
128
+ type __VLS_TypePropsToRuntimeProps<T> = {
129
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
130
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
131
+ } : {
132
+ type: import('vue').PropType<T[K]>;
133
+ required: true;
134
+ };
135
+ };
136
+ type __VLS_WithDefaults<P, D> = {
137
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
138
+ default: D[K];
139
+ }> : P[K];
140
+ };
141
+ type __VLS_Prettify<T> = {
142
+ [K in keyof T]: T[K];
143
+ } & {};
144
+ type __VLS_WithTemplateSlots<T, S> = T & {
145
+ new (): {
146
+ $slots: S;
147
+ };
148
+ };
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import ksoSelOrg from "./components/Selector/src/org-selector/index.vue";
2
- declare const Plugin: {
3
- install(Vue: any, option?: {}): void;
4
- };
5
- export { ksoSelOrg as ksoSelOrg };
6
- export default Plugin;
package/dist/index.es.js DELETED
@@ -1,349 +0,0 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".org-list-box[data-v-7f6c2b96]{padding:10px;display:flex;justify-content:space-between;box-sizing:border-box}.org-list-box .left-tree-box[data-v-7f6c2b96]{border:1px solid #ebeef5;width:50%;overflow:hidden}.org-list-box .left-tree-box .search-box[data-v-7f6c2b96]{height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;display:flex;align-items:center}.org-list-box .left-tree-box .search-box label[data-v-7f6c2b96]{color:#303133;font-weight:700}.org-list-box .left-tree-box .search-box[data-v-7f6c2b96] .el-input{width:calc(100% - 100px);margin-left:10px}.org-list-box .right-selected-list[data-v-7f6c2b96]{border:1px solid #ebeef5;width:48%}.org-list-box .right-selected-list .selected-box[data-v-7f6c2b96]{height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.org-list-box .right-selected-list .selected-box span[data-v-7f6c2b96]{color:#303133;font-weight:700}.org-list-box .right-selected-list .selected-box .delete-btn[data-v-7f6c2b96]{display:inline-block;width:17px;height:17px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADkSURBVDiN7ZOxccJAEEXfwiX2EFCCSnAHhkoM+V4NtKAZRCw6kVwCHUAHDixImPsOPJ5BMrKsGYd+4d79d/+CNTqc3SvBojv/wqB+LIrl7Sxc3FuBBPM+AYBg3s2EBNVPoTs8dTNBZmuTMmCD2V7wOmQxeEZamVme4GAAF/dFgkpm69l2ux+SvMe4MqmcwPKhKOrJyK/cpVfSuKuJsQRoYiwbd42W/EmTf8l3DGqkE4BSOhjUfXdD38Htks12uxzIRzcZQ6uJwebs/jIUktTa9E9JCEeu1zekTJD96nmzI9PpEeADOClObZiMikMAAAAASUVORK5CYII=) no-repeat;block-size:100% 100%}.org-list-box .right-selected-list[data-v-7f6c2b96] .el-icon svg{width:1.5em;height:1.5em}.org-list-box .tree-content-box[data-v-7f6c2b96]{height:420px;padding:5px 15px;box-sizing:border-box;overflow:auto}.org-list-box ul li[data-v-7f6c2b96]{width:100%;line-height:40px;display:flex;align-items:center;justify-content:space-between;border:solid 1px #d7dde4;border-radius:4px;margin-bottom:8px;padding:0 20px;box-sizing:border-box}.org-list-box ul .org-name[data-v-7f6c2b96]{width:92%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.org-list-box ul[data-v-7f6c2b96] .el-icon{cursor:pointer}.org-list-box .org-del .img-box[data-v-7f6c2b96]{margin:7px 0 0;cursor:pointer}.org-list-box .flow-modal-title[data-v-7f6c2b96]{height:40px;background:#2b5fda;width:100%;text-indent:1em;color:#fff;line-height:40px}.selector-footer[data-v-7f6c2b96]{padding:10px;display:flex;justify-content:flex-end;border-top:solid 1px #dcdfe6}[data-v-7f6c2b96] .tree-folder-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAIvSURBVFiF7ZaxaxRBFMZ/73JFhBQWlhIDXmGRIoKFxR1OYboIFloKu7cBAyLEykpIYSFYi4W32QQFiwTyDwhOsaJgm+KKNFpdYRkkYJJncZO7SW7vdu+SgMH74Ir5bt77vn3v7czCGP87JG+DSfQtytIZajb5Q80+ll8ApdztZysOcIMJ7h4tykME7iCkI8sqFaAKgDA5vAEhtaGEo+qbWAPEGfCQ34JzRvEKKHOmobN2UbZ92sSaADBBagOJAcyaRhy0n9ZGg6s2TAXmKPHdrOqDY6wQIASoV16l2uFzMNCAeae3T1CTwIZJ9Hlh2zno2wLT0PsI7z1qG5gFQHllEp3hB09tXXrOEjeshQY2swIm1mWEDYQpR63zk5vAQ2DPmVhimi3zRqeychTFsQqYFS1zjdcoyx3ykBd2UV661aaJtYWwBVwBFrjEZ5PoPRtKy3uAKsJ1AFuX9UEGOhUwK1pmmo+e+D7wyBMHwEaSItSAHUfdQvlqGlrxskbAmvsNRLcFV1kAjiZ8F2He1uVDVpANpYlQQ/jmqBlKjDSYXQPCZY9/ZkOxgwJtKC1+M+/Fd9t5SIwSovmDmP0WKPt5gQD2ieyaVe3lI0mh2L1xMY5ik2iCtk+1rPf+NPsvRgWGhvIl/1vrHA3YujSARpG9/2gLhMjEeqez9q7azv1/Ekq173/tnJUsumtA2fP6Vs36fHKJgj4SlX4iPVB3oeG34IBPQLNQgtOh6bTGGAOAv4Uio5lixzLEAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-7f6c2b96] .tree-file-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAJxSURBVFiF7Za/a1NRFMc/5zWFCh07ZBBF6NDBoUOhFjpchw5iCwpdHARfWiEigotTl4CjiyBSi315gRa6VByiOEjoFYQ6dHToUBBbh/wBoS0YehzeTWh+vDRJ0xahXwiEc8893+89P+598D/DLOmQWdKh08TwuibP6iz97NHPnsnq7LkKMIGmUdaAAWAAZc0Emj4XASarCwiLCImqUUggLJqsLnQaT9omzmiC67xCee5MZeCJ+78ITpDwmt+8sBkp90yAyWiCa6wBlVqXAN+mZB1cP0AIDLr1dXZ50I6IEwWYtzrIFfKAqZIrd+ycfK/xC3QS4csxEZYDZuxTKXUtwISaRMkDY85URLhtfdmO8R9B2QCSzrSFMGN9KcZxxDahWdZhF6xCvo0wEUcOYH3ZRpgAKj5jKBtmWYfj9jTNgFnWm3h8rZ5E+AHcb3WSmv2hJoGPKLecqcgRU3Zeftb7NmTA1XKzSq4U2GeqXXIA60uRfaZQCs6URNg0gU7W+9ZkwHXzCtEFE2GX/nZHqh5uev4eMx0CDyvTUyPA3WRvai4YwKakeZmyOo1wFwDls03Jpxg/rTEoZeCZnZN34EpgQh3BYxyPVYQcsNPyZFl9CeRR0ihpIG8CzbTaA+wg5PBYxWPchDoCcU0YaojyCBozYN7rVTx+1WcKpcwRN+xj+VMnNsqAkLO++PVcnT9GfYw2kEcECfoY7TRc5wKU+GlotdYrAXZOtoBvTcgLbu1sBQBwwDRKQPQolVACDrnXTajGWrYB98DMu9+p0PUnWa9wKeDCBZzYhCbQ8EIFINGVfFZoXgLlA9GM9wolF/MSl2jAP+MZ1PXRPKaQAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-7f6c2b96] .el-input{height:32px}[data-v-7f6c2b96] .node-text-box{display:flex;align-items:center}[data-v-7f6c2b96] .node-text-box .el-radio{margin-right:5px}[data-v-7f6c2b96] .node-text-box .el-radio .el-radio__label{display:none}[data-v-7f6c2b96] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f0f5ff}[data-v-7f6c2b96] .el-input__icon{color:#a8abb2}[data-v-7f6c2b96]::-webkit-scrollbar{width:5px}[data-v-7f6c2b96]::-webkit-scrollbar-thumb{border-radius:3px;background:#b7c7dd}[data-v-7f6c2b96]::-webkit-scrollbar-track{border-radius:3px;background:#ededed}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { defineComponent as se, useAttrs as de, inject as R, ref as p, watch as F, onMounted as re, resolveComponent as g, openBlock as C, createElementBlock as T, renderSlot as ie, createBlock as M, unref as b, isRef as S, withCtx as _, createVNode as h, createCommentVNode as ue, createTextVNode as O, toDisplayString as j, createElementVNode as s, Fragment as ce, renderList as fe, pushScopeId as pe, popScopeId as he } from "vue";
3
- const U = (u) => (pe("data-v-7f6c2b96"), u = u(), he(), u), ve = { class: "org-selector" }, ge = { class: "org-list-box" }, me = { class: "left-tree-box" }, _e = { class: "search-box" }, ye = /* @__PURE__ */ U(() => /* @__PURE__ */ s("label", null, "单位列表", -1)), ke = { class: "tree-content-box" }, Ce = { class: "right-selected-list" }, be = /* @__PURE__ */ U(() => /* @__PURE__ */ s("span", null, "已选单位", -1)), xe = { class: "tree-content-box" }, Ne = ["title"], Ve = { class: "org-name" }, Te = { class: "selector-footer" }, Ee = /* @__PURE__ */ se({
4
- __name: "index",
5
- props: {
6
- modelValue: { default: "" },
7
- rootOrgId: { default: "" },
8
- orgType: { default: "" },
9
- inputText: { default: "" },
10
- returnValue: { default: "" },
11
- readonly: { type: Boolean, default: !0 },
12
- isClear: { type: Boolean, default: !0 },
13
- disabled: { type: Boolean, default: !1 },
14
- buttonText: { default: "选择" },
15
- multiple: { type: Boolean, default: !0 },
16
- bindEvent: { type: Boolean, default: !0 },
17
- defaultText: { type: Boolean, default: !1 },
18
- reqParams: { default: void 0 }
19
- },
20
- emits: ["onCancel", "onSelect", "update:modelValue", "onClear"],
21
- setup(u, { emit: v }) {
22
- const n = u;
23
- let N = de();
24
- const V = R("req"), { warningMsgBox: z } = R("msgBox"), $ = {
25
- children: "childrenList",
26
- label: "orgName"
27
- }, r = p(null);
28
- let c = p(""), w = p(!1), m = p(!1), E = p(!1), x = p(""), y = p(""), f = p([]), B = p([]), k = p([]);
29
- F(
30
- () => n.modelValue,
31
- () => {
32
- n.defaultText && !E.value && D();
33
- }
34
- ), F(
35
- () => n.inputText,
36
- (e) => {
37
- c.value = e;
38
- }
39
- );
40
- function A() {
41
- if (n.modelValue ? k.value = n.modelValue.split(",") : k.value = [], m.value = !0, w.value && r.value) {
42
- r.value.setCheckedKeys(k.value), f.value = r.value.getCheckedNodes();
43
- return;
44
- }
45
- H();
46
- }
47
- function G() {
48
- n.bindEvent && A();
49
- }
50
- function H() {
51
- let e = {
52
- pid: n.rootOrgId,
53
- orgType: n.orgType
54
- };
55
- n.reqParams && (e = Object.assign(e, n.reqParams)), V.post({ url: getKsoRoot("/sys/org/list-by-condition"), params: e }).then(({ data: l }) => {
56
- let t = J(l);
57
- t && t.length > 0 && t.forEach((o) => {
58
- o.expanded = !0;
59
- }), B.value = t, r.value.setCheckedKeys(k.value), w.value = !0;
60
- });
61
- }
62
- function D() {
63
- if (!n.modelValue)
64
- return;
65
- E.value = !0;
66
- let e = { ids: n.modelValue };
67
- V.post({ url: getKsoRoot("/sys/org/find-by-ids"), params: e }).then(({ data: l }) => {
68
- if (l && l.length > 0) {
69
- let t = [];
70
- l.forEach((o) => {
71
- t.push(o.orgName);
72
- }), c.value = t.join(",");
73
- }
74
- });
75
- }
76
- function J(e) {
77
- return e.forEach((l) => {
78
- l.name = l.orgName, k.value.length > 0 && k.value.includes(l.id) && f.value.push(l);
79
- let t = [];
80
- e.forEach((o) => {
81
- o.pid == l.id && t.push(o);
82
- }), l.childrenList = t;
83
- }), e = e.filter((l) => l.pid == ""), e;
84
- }
85
- function Q(e, { node: l, data: t }) {
86
- t.expanded && (l.expanded = !0);
87
- let o = "tree-file-node-icon";
88
- l.childNodes && l.childNodes.length > 0 && (o = "tree-folder-node-icon");
89
- let a = [];
90
- if (!n.multiple) {
91
- let i = "";
92
- t.id === x.value && (i = t.id), a.push(
93
- e(g("el-radio"), {
94
- modelValue: i,
95
- label: t.id,
96
- size: "large"
97
- })
98
- );
99
- }
100
- return a.push(
101
- e("i", {
102
- class: o,
103
- style: {
104
- marginRight: "5px"
105
- }
106
- })
107
- ), a.push(
108
- e(
109
- "span",
110
- {
111
- attrs: {
112
- title: t.name
113
- }
114
- },
115
- t.name
116
- )
117
- ), e("span", { class: "node-text-box" }, a);
118
- }
119
- function W(e, l) {
120
- return e ? l.name.indexOf(e) !== -1 || l.id.indexOf(e) !== -1 : !0;
121
- }
122
- function X() {
123
- r.value.filter(y.value), y.value || Y(B.value[0].id, !1);
124
- }
125
- function Y(e, l) {
126
- var t = r.value.store.nodesMap;
127
- for (let o in t)
128
- e === o ? t[o].expanded = !0 : t[o].expanded = l;
129
- }
130
- function Z(e) {
131
- n.multiple || (r.value.setCheckedNodes([e]), x.value = e.id), f.value = r.value.getCheckedNodes();
132
- }
133
- function ee(e, l) {
134
- f.value.splice(l, 1), x.value = "", r.value.setCheckedNodes(f.value);
135
- }
136
- function L() {
137
- f.value = [], x.value = "", r.value && r.value.setCheckedNodes(f.value);
138
- }
139
- function P() {
140
- m.value = !1, v("onCancel", "");
141
- }
142
- function le() {
143
- if (f.value.length == 0)
144
- return z("请选择数据"), !1;
145
- let e = te(f.value);
146
- oe(e), m.value = !1, v("onSelect", e);
147
- }
148
- function te(e) {
149
- let l = [];
150
- return e.forEach((t) => {
151
- let o = {
152
- id: t.id,
153
- orgName: t.orgName,
154
- orgType: t.orgType,
155
- sname: t.sname,
156
- fname: t.fname,
157
- regId: t.regId,
158
- regName: t.regName,
159
- cityId: t.cityId,
160
- cityName: t.cityName
161
- };
162
- l.push(o);
163
- }), l;
164
- }
165
- function oe(e) {
166
- let l = {};
167
- Object.keys(e[0]).forEach((o) => {
168
- l[o] = [];
169
- }), e.forEach((o) => {
170
- var a;
171
- for (let i in o)
172
- (a = l[i]) == null || a.push(o[i]);
173
- }), c.value = l.orgName.join(","), v("update:modelValue", l.id.join(","));
174
- let t = n.returnValue.split("|");
175
- t && t.length > 0 && t.forEach((o) => {
176
- let a = o.split(":");
177
- if (a && a.length > 1) {
178
- let i = l[a[1]], I = i ? i.join(",") : "";
179
- N.sync[a[0]] = I;
180
- }
181
- });
182
- }
183
- function q() {
184
- if (c.value = "", v("update:modelValue", ""), n.returnValue) {
185
- let e = n.returnValue.split("|");
186
- e && e.length > 0 && e.forEach((l) => {
187
- let t = l.split(":");
188
- t && t.length > 1 && (N.sync[t[0]] = "");
189
- });
190
- }
191
- L(), v("onClear", "");
192
- }
193
- return re(() => {
194
- n.defaultText && !E.value ? D() : c.value = n.inputText, n.multiple || (x.value = n.modelValue);
195
- }), (e, l) => {
196
- const t = g("CircleClose"), o = g("el-icon"), a = g("el-button"), i = g("el-input"), I = g("el-tree"), ne = g("CircleCloseFilled"), ae = g("el-dialog");
197
- return C(), T("div", ve, [
198
- e.$slots.func ? (C(), T("div", {
199
- key: 0,
200
- class: "slot-box",
201
- onClick: G
202
- }, [
203
- ie(e.$slots, "func", {}, void 0, !0)
204
- ])) : (C(), M(i, {
205
- key: 1,
206
- modelValue: b(c),
207
- "onUpdate:modelValue": l[0] || (l[0] = (d) => S(c) ? c.value = d : c = d),
208
- disabled: e.disabled,
209
- readonly: e.readonly,
210
- clearable: "",
211
- onClear: q,
212
- placeholder: ""
213
- }, {
214
- append: _(() => [
215
- b(c) && e.isClear && e.readonly ? (C(), M(o, {
216
- key: 0,
217
- onClickCapture: q
218
- }, {
219
- default: _(() => [
220
- h(t)
221
- ]),
222
- _: 1
223
- })) : ue("", !0),
224
- h(a, {
225
- type: "primary",
226
- disabled: e.disabled,
227
- onClick: A
228
- }, {
229
- default: _(() => [
230
- O(j(e.buttonText), 1)
231
- ]),
232
- _: 1
233
- }, 8, ["disabled"])
234
- ]),
235
- _: 1
236
- }, 8, ["modelValue", "disabled", "readonly"])),
237
- h(ae, {
238
- title: "单位选择",
239
- modelValue: b(m),
240
- "onUpdate:modelValue": l[2] || (l[2] = (d) => S(m) ? m.value = d : m = d),
241
- onClose: P,
242
- width: 1e3
243
- }, {
244
- default: _(() => [
245
- s("div", ge, [
246
- s("div", me, [
247
- s("div", _e, [
248
- ye,
249
- h(i, {
250
- modelValue: b(y),
251
- "onUpdate:modelValue": l[1] || (l[1] = (d) => S(y) ? y.value = d : y = d),
252
- "suffix-icon": "Search",
253
- onInput: X,
254
- placeholder: "请输入单位名称查询"
255
- }, null, 8, ["modelValue"])
256
- ]),
257
- s("div", ke, [
258
- h(I, {
259
- data: b(B),
260
- ref_key: "orgTree",
261
- ref: r,
262
- "node-key": "id",
263
- props: $,
264
- "expand-on-click-node": !1,
265
- "show-checkbox": e.multiple,
266
- "check-strictly": !0,
267
- "highlight-current": !0,
268
- accordion: !0,
269
- "check-on-click-node": !0,
270
- "filter-node-method": W,
271
- indent: 26,
272
- onCheck: Z,
273
- "render-content": Q,
274
- "icon-class": "el-icon-arrow-right"
275
- }, null, 8, ["data", "show-checkbox"])
276
- ])
277
- ]),
278
- s("div", Ce, [
279
- s("div", { class: "selected-box" }, [
280
- be,
281
- s("div", { title: "删除全部" }, [
282
- s("i", {
283
- onClick: L,
284
- class: "delete-btn"
285
- })
286
- ])
287
- ]),
288
- s("div", null, [
289
- s("div", xe, [
290
- s("ul", null, [
291
- (C(!0), T(ce, null, fe(b(f), (d, K) => (C(), T("li", {
292
- key: K + "s",
293
- title: d.orgName + "(" + d.id + ")"
294
- }, [
295
- s("span", Ve, j(d.orgName) + "(" + j(d.id) + ") ", 1),
296
- h(o, {
297
- onClick: (Se) => ee(d, K),
298
- color: "#909399",
299
- size: "16"
300
- }, {
301
- default: _(() => [
302
- h(ne)
303
- ]),
304
- _: 2
305
- }, 1032, ["onClick"])
306
- ], 8, Ne))), 128))
307
- ])
308
- ])
309
- ])
310
- ])
311
- ]),
312
- s("div", Te, [
313
- h(a, { onClick: P }, {
314
- default: _(() => [
315
- O("取消")
316
- ]),
317
- _: 1
318
- }),
319
- h(a, {
320
- type: "primary",
321
- onClick: le
322
- }, {
323
- default: _(() => [
324
- O("确认")
325
- ]),
326
- _: 1
327
- })
328
- ])
329
- ]),
330
- _: 1
331
- }, 8, ["modelValue"])
332
- ]);
333
- };
334
- }
335
- });
336
- const Be = (u, v) => {
337
- const n = u.__vccOpts || u;
338
- for (const [N, V] of v)
339
- n[N] = V;
340
- return n;
341
- }, Ie = /* @__PURE__ */ Be(Ee, [["__scopeId", "data-v-7f6c2b96"]]), je = {
342
- install(u, v = {}) {
343
- u.component("ksoSelOrg", Ie);
344
- }
345
- };
346
- export {
347
- je as default,
348
- Ie as ksoSelOrg
349
- };
package/dist/index.umd.js DELETED
@@ -1,2 +0,0 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".org-list-box[data-v-7f6c2b96]{padding:10px;display:flex;justify-content:space-between;box-sizing:border-box}.org-list-box .left-tree-box[data-v-7f6c2b96]{border:1px solid #ebeef5;width:50%;overflow:hidden}.org-list-box .left-tree-box .search-box[data-v-7f6c2b96]{height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;display:flex;align-items:center}.org-list-box .left-tree-box .search-box label[data-v-7f6c2b96]{color:#303133;font-weight:700}.org-list-box .left-tree-box .search-box[data-v-7f6c2b96] .el-input{width:calc(100% - 100px);margin-left:10px}.org-list-box .right-selected-list[data-v-7f6c2b96]{border:1px solid #ebeef5;width:48%}.org-list-box .right-selected-list .selected-box[data-v-7f6c2b96]{height:52px;padding:5px 12px;background:#f0f2f5;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.org-list-box .right-selected-list .selected-box span[data-v-7f6c2b96]{color:#303133;font-weight:700}.org-list-box .right-selected-list .selected-box .delete-btn[data-v-7f6c2b96]{display:inline-block;width:17px;height:17px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADkSURBVDiN7ZOxccJAEEXfwiX2EFCCSnAHhkoM+V4NtKAZRCw6kVwCHUAHDixImPsOPJ5BMrKsGYd+4d79d/+CNTqc3SvBojv/wqB+LIrl7Sxc3FuBBPM+AYBg3s2EBNVPoTs8dTNBZmuTMmCD2V7wOmQxeEZamVme4GAAF/dFgkpm69l2ux+SvMe4MqmcwPKhKOrJyK/cpVfSuKuJsQRoYiwbd42W/EmTf8l3DGqkE4BSOhjUfXdD38Htks12uxzIRzcZQ6uJwebs/jIUktTa9E9JCEeu1zekTJD96nmzI9PpEeADOClObZiMikMAAAAASUVORK5CYII=) no-repeat;block-size:100% 100%}.org-list-box .right-selected-list[data-v-7f6c2b96] .el-icon svg{width:1.5em;height:1.5em}.org-list-box .tree-content-box[data-v-7f6c2b96]{height:420px;padding:5px 15px;box-sizing:border-box;overflow:auto}.org-list-box ul li[data-v-7f6c2b96]{width:100%;line-height:40px;display:flex;align-items:center;justify-content:space-between;border:solid 1px #d7dde4;border-radius:4px;margin-bottom:8px;padding:0 20px;box-sizing:border-box}.org-list-box ul .org-name[data-v-7f6c2b96]{width:92%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.org-list-box ul[data-v-7f6c2b96] .el-icon{cursor:pointer}.org-list-box .org-del .img-box[data-v-7f6c2b96]{margin:7px 0 0;cursor:pointer}.org-list-box .flow-modal-title[data-v-7f6c2b96]{height:40px;background:#2b5fda;width:100%;text-indent:1em;color:#fff;line-height:40px}.selector-footer[data-v-7f6c2b96]{padding:10px;display:flex;justify-content:flex-end;border-top:solid 1px #dcdfe6}[data-v-7f6c2b96] .tree-folder-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAIvSURBVFiF7ZaxaxRBFMZ/73JFhBQWlhIDXmGRIoKFxR1OYboIFloKu7cBAyLEykpIYSFYi4W32QQFiwTyDwhOsaJgm+KKNFpdYRkkYJJncZO7SW7vdu+SgMH74Ir5bt77vn3v7czCGP87JG+DSfQtytIZajb5Q80+ll8ApdztZysOcIMJ7h4tykME7iCkI8sqFaAKgDA5vAEhtaGEo+qbWAPEGfCQ34JzRvEKKHOmobN2UbZ92sSaADBBagOJAcyaRhy0n9ZGg6s2TAXmKPHdrOqDY6wQIASoV16l2uFzMNCAeae3T1CTwIZJ9Hlh2zno2wLT0PsI7z1qG5gFQHllEp3hB09tXXrOEjeshQY2swIm1mWEDYQpR63zk5vAQ2DPmVhimi3zRqeychTFsQqYFS1zjdcoyx3ykBd2UV661aaJtYWwBVwBFrjEZ5PoPRtKy3uAKsJ1AFuX9UEGOhUwK1pmmo+e+D7wyBMHwEaSItSAHUfdQvlqGlrxskbAmvsNRLcFV1kAjiZ8F2He1uVDVpANpYlQQ/jmqBlKjDSYXQPCZY9/ZkOxgwJtKC1+M+/Fd9t5SIwSovmDmP0WKPt5gQD2ieyaVe3lI0mh2L1xMY5ik2iCtk+1rPf+NPsvRgWGhvIl/1vrHA3YujSARpG9/2gLhMjEeqez9q7azv1/Ekq173/tnJUsumtA2fP6Vs36fHKJgj4SlX4iPVB3oeG34IBPQLNQgtOh6bTGGAOAv4Uio5lixzLEAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-7f6c2b96] .tree-file-node-icon{display:inline-block;width:18px;height:18px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAJxSURBVFiF7Za/a1NRFMc/5zWFCh07ZBBF6NDBoUOhFjpchw5iCwpdHARfWiEigotTl4CjiyBSi315gRa6VByiOEjoFYQ6dHToUBBbh/wBoS0YehzeTWh+vDRJ0xahXwiEc8893+89P+598D/DLOmQWdKh08TwuibP6iz97NHPnsnq7LkKMIGmUdaAAWAAZc0Emj4XASarCwiLCImqUUggLJqsLnQaT9omzmiC67xCee5MZeCJ+78ITpDwmt+8sBkp90yAyWiCa6wBlVqXAN+mZB1cP0AIDLr1dXZ50I6IEwWYtzrIFfKAqZIrd+ycfK/xC3QS4csxEZYDZuxTKXUtwISaRMkDY85URLhtfdmO8R9B2QCSzrSFMGN9KcZxxDahWdZhF6xCvo0wEUcOYH3ZRpgAKj5jKBtmWYfj9jTNgFnWm3h8rZ5E+AHcb3WSmv2hJoGPKLecqcgRU3Zeftb7NmTA1XKzSq4U2GeqXXIA60uRfaZQCs6URNg0gU7W+9ZkwHXzCtEFE2GX/nZHqh5uev4eMx0CDyvTUyPA3WRvai4YwKakeZmyOo1wFwDls03Jpxg/rTEoZeCZnZN34EpgQh3BYxyPVYQcsNPyZFl9CeRR0ihpIG8CzbTaA+wg5PBYxWPchDoCcU0YaojyCBozYN7rVTx+1WcKpcwRN+xj+VMnNsqAkLO++PVcnT9GfYw2kEcECfoY7TRc5wKU+GlotdYrAXZOtoBvTcgLbu1sBQBwwDRKQPQolVACDrnXTajGWrYB98DMu9+p0PUnWa9wKeDCBZzYhCbQ8EIFINGVfFZoXgLlA9GM9wolF/MSl2jAP+MZ1PXRPKaQAAAAAElFTkSuQmCC) no-repeat;background-size:100% 100%}[data-v-7f6c2b96] .el-input{height:32px}[data-v-7f6c2b96] .node-text-box{display:flex;align-items:center}[data-v-7f6c2b96] .node-text-box .el-radio{margin-right:5px}[data-v-7f6c2b96] .node-text-box .el-radio .el-radio__label{display:none}[data-v-7f6c2b96] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f0f5ff}[data-v-7f6c2b96] .el-input__icon{color:#a8abb2}[data-v-7f6c2b96]::-webkit-scrollbar{width:5px}[data-v-7f6c2b96]::-webkit-scrollbar-thumb{border-radius:3px;background:#b7c7dd}[data-v-7f6c2b96]::-webkit-scrollbar-track{border-radius:3px;background:#ededed}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p["kso-sel-org"]={},p.vue))})(this,function(p,e){"use strict";const b=c=>(e.pushScopeId("data-v-7f6c2b96"),c=c(),e.popScopeId(),c),D={class:"org-selector"},A={class:"org-list-box"},L={class:"left-tree-box"},P={class:"search-box"},q=b(()=>e.createElementVNode("label",null,"单位列表",-1)),R={class:"tree-content-box"},K={class:"right-selected-list"},M=b(()=>e.createElementVNode("span",null,"已选单位",-1)),F={class:"tree-content-box"},U=["title"],z={class:"org-name"},$={class:"selector-footer"},G=e.defineComponent({__name:"index",props:{modelValue:{default:""},rootOrgId:{default:""},orgType:{default:""},inputText:{default:""},returnValue:{default:""},readonly:{type:Boolean,default:!0},isClear:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},buttonText:{default:"选择"},multiple:{type:Boolean,default:!0},bindEvent:{type:Boolean,default:!0},defaultText:{type:Boolean,default:!1},reqParams:{default:void 0}},emits:["onCancel","onSelect","update:modelValue","onClear"],setup(c,{emit:h}){const a=c;let y=e.useAttrs();const C=e.inject("req"),{warningMsgBox:J}=e.inject("msgBox"),Q={children:"childrenList",label:"orgName"},s=e.ref(null);let f=e.ref(""),T=e.ref(!1),m=e.ref(!1),V=e.ref(!1),N=e.ref(""),g=e.ref(""),u=e.ref([]),k=e.ref([]),_=e.ref([]);e.watch(()=>a.modelValue,()=>{a.defaultText&&!V.value&&S()}),e.watch(()=>a.inputText,t=>{f.value=t});function B(){if(a.modelValue?_.value=a.modelValue.split(","):_.value=[],m.value=!0,T.value&&s.value){s.value.setCheckedKeys(_.value),u.value=s.value.getCheckedNodes();return}X()}function W(){a.bindEvent&&B()}function X(){let t={pid:a.rootOrgId,orgType:a.orgType};a.reqParams&&(t=Object.assign(t,a.reqParams)),C.post({url:getKsoRoot("/sys/org/list-by-condition"),params:t}).then(({data:l})=>{let o=Y(l);o&&o.length>0&&o.forEach(n=>{n.expanded=!0}),k.value=o,s.value.setCheckedKeys(_.value),T.value=!0})}function S(){if(!a.modelValue)return;V.value=!0;let t={ids:a.modelValue};C.post({url:getKsoRoot("/sys/org/find-by-ids"),params:t}).then(({data:l})=>{if(l&&l.length>0){let o=[];l.forEach(n=>{o.push(n.orgName)}),f.value=o.join(",")}})}function Y(t){return t.forEach(l=>{l.name=l.orgName,_.value.length>0&&_.value.includes(l.id)&&u.value.push(l);let o=[];t.forEach(n=>{n.pid==l.id&&o.push(n)}),l.childrenList=o}),t=t.filter(l=>l.pid==""),t}function Z(t,{node:l,data:o}){o.expanded&&(l.expanded=!0);let n="tree-file-node-icon";l.childNodes&&l.childNodes.length>0&&(n="tree-folder-node-icon");let r=[];if(!a.multiple){let i="";o.id===N.value&&(i=o.id),r.push(t(e.resolveComponent("el-radio"),{modelValue:i,label:o.id,size:"large"}))}return r.push(t("i",{class:n,style:{marginRight:"5px"}})),r.push(t("span",{attrs:{title:o.name}},o.name)),t("span",{class:"node-text-box"},r)}function v(t,l){return t?l.name.indexOf(t)!==-1||l.id.indexOf(t)!==-1:!0}function ee(){s.value.filter(g.value),g.value||te(k.value[0].id,!1)}function te(t,l){var o=s.value.store.nodesMap;for(let n in o)t===n?o[n].expanded=!0:o[n].expanded=l}function le(t){a.multiple||(s.value.setCheckedNodes([t]),N.value=t.id),u.value=s.value.getCheckedNodes()}function oe(t,l){u.value.splice(l,1),N.value="",s.value.setCheckedNodes(u.value)}function w(){u.value=[],N.value="",s.value&&s.value.setCheckedNodes(u.value)}function O(){m.value=!1,h("onCancel","")}function ne(){if(u.value.length==0)return J("请选择数据"),!1;let t=ae(u.value);re(t),m.value=!1,h("onSelect",t)}function ae(t){let l=[];return t.forEach(o=>{let n={id:o.id,orgName:o.orgName,orgType:o.orgType,sname:o.sname,fname:o.fname,regId:o.regId,regName:o.regName,cityId:o.cityId,cityName:o.cityName};l.push(n)}),l}function re(t){let l={};Object.keys(t[0]).forEach(n=>{l[n]=[]}),t.forEach(n=>{var r;for(let i in n)(r=l[i])==null||r.push(n[i])}),f.value=l.orgName.join(","),h("update:modelValue",l.id.join(","));let o=a.returnValue.split("|");o&&o.length>0&&o.forEach(n=>{let r=n.split(":");if(r&&r.length>1){let i=l[r[1]],x=i?i.join(","):"";y.sync[r[0]]=x}})}function I(){if(f.value="",h("update:modelValue",""),a.returnValue){let t=a.returnValue.split("|");t&&t.length>0&&t.forEach(l=>{let o=l.split(":");o&&o.length>1&&(y.sync[o[0]]="")})}w(),h("onClear","")}return e.onMounted(()=>{a.defaultText&&!V.value?S():f.value=a.inputText,a.multiple||(N.value=a.modelValue)}),(t,l)=>{const o=e.resolveComponent("CircleClose"),n=e.resolveComponent("el-icon"),r=e.resolveComponent("el-button"),i=e.resolveComponent("el-input"),x=e.resolveComponent("el-tree"),de=e.resolveComponent("CircleCloseFilled"),se=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",D,[t.$slots.func?(e.openBlock(),e.createElementBlock("div",{key:0,class:"slot-box",onClick:W},[e.renderSlot(t.$slots,"func",{},void 0,!0)])):(e.openBlock(),e.createBlock(i,{key:1,modelValue:e.unref(f),"onUpdate:modelValue":l[0]||(l[0]=d=>e.isRef(f)?f.value=d:f=d),disabled:t.disabled,readonly:t.readonly,clearable:"",onClear:I,placeholder:""},{append:e.withCtx(()=>[e.unref(f)&&t.isClear&&t.readonly?(e.openBlock(),e.createBlock(n,{key:0,onClickCapture:I},{default:e.withCtx(()=>[e.createVNode(o)]),_:1})):e.createCommentVNode("",!0),e.createVNode(r,{type:"primary",disabled:t.disabled,onClick:B},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.buttonText),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled","readonly"])),e.createVNode(se,{title:"单位选择",modelValue:e.unref(m),"onUpdate:modelValue":l[2]||(l[2]=d=>e.isRef(m)?m.value=d:m=d),onClose:O,width:1e3},{default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createElementVNode("div",L,[e.createElementVNode("div",P,[q,e.createVNode(i,{modelValue:e.unref(g),"onUpdate:modelValue":l[1]||(l[1]=d=>e.isRef(g)?g.value=d:g=d),"suffix-icon":"Search",onInput:ee,placeholder:"请输入单位名称查询"},null,8,["modelValue"])]),e.createElementVNode("div",R,[e.createVNode(x,{data:e.unref(k),ref_key:"orgTree",ref:s,"node-key":"id",props:Q,"expand-on-click-node":!1,"show-checkbox":t.multiple,"check-strictly":!0,"highlight-current":!0,accordion:!0,"check-on-click-node":!0,"filter-node-method":v,indent:26,onCheck:le,"render-content":Z,"icon-class":"el-icon-arrow-right"},null,8,["data","show-checkbox"])])]),e.createElementVNode("div",K,[e.createElementVNode("div",{class:"selected-box"},[M,e.createElementVNode("div",{title:"删除全部"},[e.createElementVNode("i",{onClick:w,class:"delete-btn"})])]),e.createElementVNode("div",null,[e.createElementVNode("div",F,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),(d,j)=>(e.openBlock(),e.createElementBlock("li",{key:j+"s",title:d.orgName+"("+d.id+")"},[e.createElementVNode("span",z,e.toDisplayString(d.orgName)+"("+e.toDisplayString(d.id)+") ",1),e.createVNode(n,{onClick:fe=>oe(d,j),color:"#909399",size:"16"},{default:e.withCtx(()=>[e.createVNode(de)]),_:2},1032,["onClick"])],8,U))),128))])])])])]),e.createElementVNode("div",$,[e.createVNode(r,{onClick:O},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(r,{type:"primary",onClick:ne},{default:e.withCtx(()=>[e.createTextVNode("确认")]),_:1})])]),_:1},8,["modelValue"])])}}}),ie="",E=((c,h)=>{const a=c.__vccOpts||c;for(const[y,C]of h)a[y]=C;return a})(G,[["__scopeId","data-v-7f6c2b96"]]),H={install(c,h={}){c.component("ksoSelOrg",E)}};p.default=H,p.ksoSelOrg=E,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});