iv-npm 1.0.46 → 1.0.49

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,803 +1,4 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@IVNPM/ui"] = {}, global.vue));
5
- })(this, (function (exports, vue) { 'use strict';
6
-
7
- var _hoisted_1$1 = /*#__PURE__*/vue.createTextVNode("npm包");
8
- /**
9
- * show:Boolean 是否显示弹窗 v-model:show="Visible"
10
- *
11
- * remove-padding:Boolean 是否需要弹窗内边距(defult:true)
12
- * 内边距 padding: 100px 0 100px 100px;
13
- *
14
- * @cancelHandle:Function 关闭时触发事件
15
- *
16
- * v-slot:title 弹窗头部
17
- *
18
- * v-slot:body 弹窗主体
19
- *
20
- * */
21
-
22
- var script$1 = /*#__PURE__*/vue.defineComponent({
23
- __name: 'IVMrpModal',
24
- props: {
25
- show: {
26
- type: Boolean,
27
- "default": false
28
- },
29
- removePadding: {
30
- type: Boolean,
31
- "default": true
32
- }
33
- },
34
- emits: ["update:show", "cancelHandle"],
35
- setup: function setup(__props, _ref) {
36
- var emit = _ref.emit;
37
- var props = __props;
38
- var isShow = vue.ref(props.show);
39
-
40
- function cancel() {
41
- emit("update:show", false);
42
- emit("cancelHandle", false);
43
- }
44
-
45
- return function (_ctx, _cache) {
46
- var _component_close_circle_outlined = vue.resolveComponent("close-circle-outlined");
47
-
48
- var _component_a_modal = vue.resolveComponent("a-modal");
49
-
50
- return vue.openBlock(), vue.createBlock(_component_a_modal, {
51
- wrapClassName: [__props.removePadding ? '' : 'not-padding', 'module-class modal-components'],
52
- visible: isShow.value,
53
- "onUpdate:visible": _cache[0] || (_cache[0] = function ($event) {
54
- return isShow.value = $event;
55
- }),
56
- onCancel: cancel,
57
- destroyOnClose: "",
58
- footer: null
59
- }, {
60
- title: vue.withCtx(function () {
61
- return [vue.renderSlot(_ctx.$slots, "title", {}, function () {
62
- return [_hoisted_1$1];
63
- })];
64
- }),
65
- closeIcon: vue.withCtx(function () {
66
- return [vue.createVNode(_component_close_circle_outlined, {
67
- "class": "text-[#006ab2] text-[30px]"
68
- })];
69
- }),
70
- "default": vue.withCtx(function () {
71
- return [vue.renderSlot(_ctx.$slots, "body")];
72
- }),
73
- _: 3
74
- /* FORWARDED */
75
-
76
- }, 8
77
- /* PROPS */
78
- , ["wrapClassName", "visible"]);
79
- };
80
- }
81
- });
82
-
83
- script$1.__file = "src/function-ui/component/IVMrpModal.vue";
84
-
85
- function ownKeys(object, enumerableOnly) {
86
- var keys = Object.keys(object);
87
-
88
- if (Object.getOwnPropertySymbols) {
89
- var symbols = Object.getOwnPropertySymbols(object);
90
- enumerableOnly && (symbols = symbols.filter(function (sym) {
91
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
92
- })), keys.push.apply(keys, symbols);
93
- }
94
-
95
- return keys;
96
- }
97
-
98
- function _objectSpread2(target) {
99
- for (var i = 1; i < arguments.length; i++) {
100
- var source = null != arguments[i] ? arguments[i] : {};
101
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
102
- _defineProperty(target, key, source[key]);
103
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
104
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
105
- });
106
- }
107
-
108
- return target;
109
- }
110
-
111
- function _regeneratorRuntime() {
112
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
113
-
114
- _regeneratorRuntime = function () {
115
- return exports;
116
- };
117
-
118
- var exports = {},
119
- Op = Object.prototype,
120
- hasOwn = Op.hasOwnProperty,
121
- $Symbol = "function" == typeof Symbol ? Symbol : {},
122
- iteratorSymbol = $Symbol.iterator || "@@iterator",
123
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
124
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
125
-
126
- function define(obj, key, value) {
127
- return Object.defineProperty(obj, key, {
128
- value: value,
129
- enumerable: !0,
130
- configurable: !0,
131
- writable: !0
132
- }), obj[key];
133
- }
134
-
135
- try {
136
- define({}, "");
137
- } catch (err) {
138
- define = function (obj, key, value) {
139
- return obj[key] = value;
140
- };
141
- }
142
-
143
- function wrap(innerFn, outerFn, self, tryLocsList) {
144
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
145
- generator = Object.create(protoGenerator.prototype),
146
- context = new Context(tryLocsList || []);
147
- return generator._invoke = function (innerFn, self, context) {
148
- var state = "suspendedStart";
149
- return function (method, arg) {
150
- if ("executing" === state) throw new Error("Generator is already running");
151
-
152
- if ("completed" === state) {
153
- if ("throw" === method) throw arg;
154
- return doneResult();
155
- }
156
-
157
- for (context.method = method, context.arg = arg;;) {
158
- var delegate = context.delegate;
159
-
160
- if (delegate) {
161
- var delegateResult = maybeInvokeDelegate(delegate, context);
162
-
163
- if (delegateResult) {
164
- if (delegateResult === ContinueSentinel) continue;
165
- return delegateResult;
166
- }
167
- }
168
-
169
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
170
- if ("suspendedStart" === state) throw state = "completed", context.arg;
171
- context.dispatchException(context.arg);
172
- } else "return" === context.method && context.abrupt("return", context.arg);
173
- state = "executing";
174
- var record = tryCatch(innerFn, self, context);
175
-
176
- if ("normal" === record.type) {
177
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
178
- return {
179
- value: record.arg,
180
- done: context.done
181
- };
182
- }
183
-
184
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
185
- }
186
- };
187
- }(innerFn, self, context), generator;
188
- }
189
-
190
- function tryCatch(fn, obj, arg) {
191
- try {
192
- return {
193
- type: "normal",
194
- arg: fn.call(obj, arg)
195
- };
196
- } catch (err) {
197
- return {
198
- type: "throw",
199
- arg: err
200
- };
201
- }
202
- }
203
-
204
- exports.wrap = wrap;
205
- var ContinueSentinel = {};
206
-
207
- function Generator() {}
208
-
209
- function GeneratorFunction() {}
210
-
211
- function GeneratorFunctionPrototype() {}
212
-
213
- var IteratorPrototype = {};
214
- define(IteratorPrototype, iteratorSymbol, function () {
215
- return this;
216
- });
217
- var getProto = Object.getPrototypeOf,
218
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
219
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
220
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
221
-
222
- function defineIteratorMethods(prototype) {
223
- ["next", "throw", "return"].forEach(function (method) {
224
- define(prototype, method, function (arg) {
225
- return this._invoke(method, arg);
226
- });
227
- });
228
- }
229
-
230
- function AsyncIterator(generator, PromiseImpl) {
231
- function invoke(method, arg, resolve, reject) {
232
- var record = tryCatch(generator[method], generator, arg);
233
-
234
- if ("throw" !== record.type) {
235
- var result = record.arg,
236
- value = result.value;
237
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
238
- invoke("next", value, resolve, reject);
239
- }, function (err) {
240
- invoke("throw", err, resolve, reject);
241
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
242
- result.value = unwrapped, resolve(result);
243
- }, function (error) {
244
- return invoke("throw", error, resolve, reject);
245
- });
246
- }
247
-
248
- reject(record.arg);
249
- }
250
-
251
- var previousPromise;
252
-
253
- this._invoke = function (method, arg) {
254
- function callInvokeWithMethodAndArg() {
255
- return new PromiseImpl(function (resolve, reject) {
256
- invoke(method, arg, resolve, reject);
257
- });
258
- }
259
-
260
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
261
- };
262
- }
263
-
264
- function maybeInvokeDelegate(delegate, context) {
265
- var method = delegate.iterator[context.method];
266
-
267
- if (undefined === method) {
268
- if (context.delegate = null, "throw" === context.method) {
269
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
270
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
271
- }
272
-
273
- return ContinueSentinel;
274
- }
275
-
276
- var record = tryCatch(method, delegate.iterator, context.arg);
277
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
278
- var info = record.arg;
279
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
280
- }
281
-
282
- function pushTryEntry(locs) {
283
- var entry = {
284
- tryLoc: locs[0]
285
- };
286
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
287
- }
288
-
289
- function resetTryEntry(entry) {
290
- var record = entry.completion || {};
291
- record.type = "normal", delete record.arg, entry.completion = record;
292
- }
293
-
294
- function Context(tryLocsList) {
295
- this.tryEntries = [{
296
- tryLoc: "root"
297
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
298
- }
299
-
300
- function values(iterable) {
301
- if (iterable) {
302
- var iteratorMethod = iterable[iteratorSymbol];
303
- if (iteratorMethod) return iteratorMethod.call(iterable);
304
- if ("function" == typeof iterable.next) return iterable;
305
-
306
- if (!isNaN(iterable.length)) {
307
- var i = -1,
308
- next = function next() {
309
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
310
-
311
- return next.value = undefined, next.done = !0, next;
312
- };
313
-
314
- return next.next = next;
315
- }
316
- }
317
-
318
- return {
319
- next: doneResult
320
- };
321
- }
322
-
323
- function doneResult() {
324
- return {
325
- value: undefined,
326
- done: !0
327
- };
328
- }
329
-
330
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
331
- var ctor = "function" == typeof genFun && genFun.constructor;
332
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
333
- }, exports.mark = function (genFun) {
334
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
335
- }, exports.awrap = function (arg) {
336
- return {
337
- __await: arg
338
- };
339
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
340
- return this;
341
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
342
- void 0 === PromiseImpl && (PromiseImpl = Promise);
343
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
344
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
345
- return result.done ? result.value : iter.next();
346
- });
347
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
348
- return this;
349
- }), define(Gp, "toString", function () {
350
- return "[object Generator]";
351
- }), exports.keys = function (object) {
352
- var keys = [];
353
-
354
- for (var key in object) keys.push(key);
355
-
356
- return keys.reverse(), function next() {
357
- for (; keys.length;) {
358
- var key = keys.pop();
359
- if (key in object) return next.value = key, next.done = !1, next;
360
- }
361
-
362
- return next.done = !0, next;
363
- };
364
- }, exports.values = values, Context.prototype = {
365
- constructor: Context,
366
- reset: function (skipTempReset) {
367
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
368
- },
369
- stop: function () {
370
- this.done = !0;
371
- var rootRecord = this.tryEntries[0].completion;
372
- if ("throw" === rootRecord.type) throw rootRecord.arg;
373
- return this.rval;
374
- },
375
- dispatchException: function (exception) {
376
- if (this.done) throw exception;
377
- var context = this;
378
-
379
- function handle(loc, caught) {
380
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
381
- }
382
-
383
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
384
- var entry = this.tryEntries[i],
385
- record = entry.completion;
386
- if ("root" === entry.tryLoc) return handle("end");
387
-
388
- if (entry.tryLoc <= this.prev) {
389
- var hasCatch = hasOwn.call(entry, "catchLoc"),
390
- hasFinally = hasOwn.call(entry, "finallyLoc");
391
-
392
- if (hasCatch && hasFinally) {
393
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
394
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
395
- } else if (hasCatch) {
396
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
397
- } else {
398
- if (!hasFinally) throw new Error("try statement without catch or finally");
399
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
400
- }
401
- }
402
- }
403
- },
404
- abrupt: function (type, arg) {
405
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
406
- var entry = this.tryEntries[i];
407
-
408
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
409
- var finallyEntry = entry;
410
- break;
411
- }
412
- }
413
-
414
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
415
- var record = finallyEntry ? finallyEntry.completion : {};
416
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
417
- },
418
- complete: function (record, afterLoc) {
419
- if ("throw" === record.type) throw record.arg;
420
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
421
- },
422
- finish: function (finallyLoc) {
423
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
424
- var entry = this.tryEntries[i];
425
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
426
- }
427
- },
428
- catch: function (tryLoc) {
429
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
430
- var entry = this.tryEntries[i];
431
-
432
- if (entry.tryLoc === tryLoc) {
433
- var record = entry.completion;
434
-
435
- if ("throw" === record.type) {
436
- var thrown = record.arg;
437
- resetTryEntry(entry);
438
- }
439
-
440
- return thrown;
441
- }
442
- }
443
-
444
- throw new Error("illegal catch attempt");
445
- },
446
- delegateYield: function (iterable, resultName, nextLoc) {
447
- return this.delegate = {
448
- iterator: values(iterable),
449
- resultName: resultName,
450
- nextLoc: nextLoc
451
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
452
- }
453
- }, exports;
454
- }
455
-
456
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
457
- try {
458
- var info = gen[key](arg);
459
- var value = info.value;
460
- } catch (error) {
461
- reject(error);
462
- return;
463
- }
464
-
465
- if (info.done) {
466
- resolve(value);
467
- } else {
468
- Promise.resolve(value).then(_next, _throw);
469
- }
470
- }
471
-
472
- function _asyncToGenerator(fn) {
473
- return function () {
474
- var self = this,
475
- args = arguments;
476
- return new Promise(function (resolve, reject) {
477
- var gen = fn.apply(self, args);
478
-
479
- function _next(value) {
480
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
481
- }
482
-
483
- function _throw(err) {
484
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
485
- }
486
-
487
- _next(undefined);
488
- });
489
- };
490
- }
491
-
492
- function _defineProperty(obj, key, value) {
493
- if (key in obj) {
494
- Object.defineProperty(obj, key, {
495
- value: value,
496
- enumerable: true,
497
- configurable: true,
498
- writable: true
499
- });
500
- } else {
501
- obj[key] = value;
502
- }
503
-
504
- return obj;
505
- }
506
-
507
- /*
508
- * @Author: Mr.Cong Wei
509
- * @Date: 2022-08-10 10:13:38
510
- * @LastEditTime: 2022-08-10 11:34:28
511
- */
512
- var BASE_URL = "https://basis.nacho.cn";
513
- var DEFIND_OPTION = {
514
- headers: {
515
- "Content-Type": "application/json;charset=UTF-8",
516
- "Accept-Language": "zh-Hans",
517
- authorization: localStorage.getItem("token") ? "Bearer " + localStorage.getItem("token") : null
518
- },
519
- cache: "no-cache",
520
- credentials: "include",
521
- responseType: "JSON",
522
- mode: "cors"
523
- };
524
- var API_OPTION = {
525
- getIVMrpOrgDropdown: {
526
- url: "/api/identity/users/allOrganizationByUser",
527
- option: _objectSpread2({
528
- method: "GET"
529
- }, DEFIND_OPTION)
530
- }
531
- };
532
- var formatHTTP = function formatHTTP(fetch) {
533
- return new Promise(function (resolve, reject) {
534
- fetch.then(function (data) {
535
- data.json().then(function (data) {
536
- return resolve(data);
537
- })["catch"](function (err) {
538
- return reject(err);
539
- });
540
- })["catch"](function (err) {
541
- return reject(err);
542
- });
543
- });
544
- };
545
- var formatUrl = function formatUrl(base, api, params) {
546
- if (Object.keys(params).length === 0) return base + api;
547
- var urlTemparr = [];
548
-
549
- for (var k in params) {
550
- urlTemparr.push("".concat(k, "=").concat(params[k]));
551
- }
552
-
553
- return base + api + "?" + urlTemparr.join("&");
554
- };
555
-
556
- // utils/arr/tree.ts
557
-
558
- function _loadChildren(obj, list) {
559
- var arr = list.filter(function (x) {
560
- return x.parentId == obj.id;
561
- });
562
- if (!arr.length) return;
563
- obj.children = arr;
564
- obj.children.forEach(function (x) {
565
- _loadChildren(x, list);
566
- });
567
- return obj;
568
- }
569
-
570
- function tranListToTreeData(list) {
571
- var results = list.filter(function (x) {
572
- return x.parentId == null;
573
- });
574
- results.forEach(function (x) {
575
- return _loadChildren(x, list);
576
- });
577
- return results;
578
- }
579
-
580
-
581
- var assign = Object.assign;
582
-
583
- var _hoisted_1 = /*#__PURE__*/vue.createElementVNode("div", {
584
- "class": "text-[#0000006D] text-[14px]"
585
- }, "所属组织", -1
586
- /* HOISTED */
587
- );
588
- /**
589
- * 组件定义-------------------------------------
590
- * */
591
-
592
- var script = /*#__PURE__*/vue.defineComponent({
593
- __name: 'IVMrpOrgDropdown',
594
- props: {
595
- value: {
596
- type: null,
597
- required: true
598
- },
599
- params: {
600
- type: Object,
601
- required: false
602
- },
603
- replaceFields: {
604
- type: Object,
605
- required: false
606
- }
607
- },
608
- emits: ["update:value"],
609
- setup: function setup(__props, _ref) {
610
- var emit = _ref.emit;
611
-
612
- var _a;
613
-
614
- var props = __props;
615
- /**
616
- * 生命周期-------------------------------------
617
- * */
618
-
619
- vue.onBeforeMount(function () {// getData();
620
- });
621
- /**
622
- * 侦听器-------------------------------------
623
- * */
624
-
625
- vue.watchEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
626
- var _a;
627
-
628
- return _regeneratorRuntime().wrap(function _callee$(_context) {
629
- while (1) {
630
- switch (_context.prev = _context.next) {
631
- case 0:
632
- console.log(props.params, "props11111111111111111111111122222222222222222222");
633
- getData({
634
- params: assign((_a = props.params) !== null && _a !== void 0 ? _a : {}, {
635
- type: 1
636
- })
637
- });
638
-
639
- case 2:
640
- case "end":
641
- return _context.stop();
642
- }
643
- }
644
- }, _callee);
645
- }))); // watch(props, () => {
646
- // console.log(
647
- // props.params,
648
- // "props11111111111111111111111122222222222222222222"
649
- // );
650
- // });
651
- // watch(
652
- // () => props.params,
653
- // () => {
654
- // console.log(
655
- // props.params,
656
- // "props.params11111111111111111111111122222222222222222222"
657
- // );
658
- // },
659
- // {
660
- // deep: true,
661
- // }
662
- // );
663
-
664
- /**
665
- * 获取数据-------------------------------------
666
- * */
667
-
668
- var dataV = vue.ref();
669
-
670
- var getData = /*#__PURE__*/function () {
671
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
672
- var _option,
673
- _a,
674
- _yield$formatHTTP,
675
- items,
676
- _args2 = arguments;
677
-
678
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
679
- while (1) {
680
- switch (_context2.prev = _context2.next) {
681
- case 0:
682
- _option = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
683
- _context2.next = 3;
684
- return formatHTTP(fetch(formatUrl(BASE_URL, API_OPTION.getIVMrpOrgDropdown.url, _option.params), assign({
685
- data: (_a = _option.data) !== null && _a !== void 0 ? _a : null
686
- }, API_OPTION.getIVMrpOrgDropdown.option)));
687
-
688
- case 3:
689
- _yield$formatHTTP = _context2.sent;
690
- items = _yield$formatHTTP.items;
691
- dataV.value = tranListToTreeData(items);
692
-
693
- case 6:
694
- case "end":
695
- return _context2.stop();
696
- }
697
- }
698
- }, _callee2);
699
- }));
700
-
701
- return function getData() {
702
- return _ref3.apply(this, arguments);
703
- };
704
- }();
705
- /**
706
- * 默认参数-------------------------------------
707
- * */
708
-
709
-
710
- var replaceFields = vue.ref((_a = props.replaceFields) !== null && _a !== void 0 ? _a : {
711
- children: "children",
712
- label: "displayName",
713
- key: "id",
714
- value: "id"
715
- });
716
- var inputV = vue.computed({
717
- get: function get() {
718
- return props.value;
719
- },
720
- set: function set(value) {
721
- emit("update:value", value);
722
- }
723
- });
724
- return function (_ctx, _cache) {
725
- var _component_a_tree_select = vue.resolveComponent("a-tree-select");
726
-
727
- var _component_a_form_item = vue.resolveComponent("a-form-item");
728
-
729
- return vue.openBlock(), vue.createBlock(_component_a_form_item, {
730
- name: "organizationId",
731
- rules: [{
732
- required: true,
733
- message: '请选择所属组织'
734
- }]
735
- }, {
736
- label: vue.withCtx(function () {
737
- return [_hoisted_1];
738
- }),
739
- "default": vue.withCtx(function () {
740
- return [vue.createVNode(_component_a_tree_select, {
741
- value: vue.unref(inputV),
742
- "onUpdate:value": _cache[0] || (_cache[0] = function ($event) {
743
- return vue.isRef(inputV) ? inputV.value = $event : null;
744
- }),
745
- "tree-data": dataV.value,
746
- getPopupContainer: function getPopupContainer(triggerNode) {
747
- return triggerNode.parentNode;
748
- },
749
- placeholder: "请选择",
750
- showArrow: "",
751
- treeDefaultExpandAll: "",
752
- style: {
753
- "width": "300px"
754
- },
755
- replaceFields: replaceFields.value
756
- }, null, 8
757
- /* PROPS */
758
- , ["value", "tree-data", "getPopupContainer", "replaceFields"])];
759
- }),
760
- _: 1
761
- /* STABLE */
762
-
763
- });
764
- };
765
- }
766
- });
767
-
768
- script.__file = "src/business-ui/component/IVMrpOrgDropdown.vue";
769
-
770
- /*
771
- * @Author: Mr.Cong Wei
772
- * @Date: 2022-08-08 18:47:06
773
- * @LastEditTime: 2022-08-09 18:12:36
774
- */
775
- var components = [script$1, script];
776
- installComponents(); // 单独引用
777
-
778
- function installComponents() {
779
- components.forEach(function (component) {
780
- component.install = function (app) {
781
- app.component(component.name, component);
782
- };
783
- });
784
- } // 全局引用
785
-
786
-
787
- var install = function install(app) {
788
- components.forEach(function (component) {
789
- app.component(component.name, component);
790
- });
791
- };
792
-
793
- var cAll = {
794
- install: install
795
- };
796
-
797
- exports.IVMrpModal = script$1;
798
- exports.IVMrpOrgDropdown = script;
799
- exports["default"] = cAll;
800
-
801
- Object.defineProperty(exports, '__esModule', { value: true });
802
-
803
- }));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@IVNPM/ui"]={},t.vue)}(this,(function(t,e){"use strict";var r=e.createTextVNode("npm包"),n=e.defineComponent({__name:"IVMrpModal",props:{show:{type:Boolean,default:!1},removePadding:{type:Boolean,default:!0}},emits:["update:show","cancelHandle"],setup:function(t,n){var o=n.emit,i=t,a=e.ref(i.show);function c(){o("update:show",!1),o("cancelHandle",!1)}return function(n,o){var i=e.resolveComponent("close-circle-outlined"),u=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(u,{wrapClassName:[t.removePadding?"":"not-padding","module-class modal-components"],visible:a.value,"onUpdate:visible":o[0]||(o[0]=function(t){return a.value=t}),onCancel:c,destroyOnClose:"",footer:null},{title:e.withCtx((function(){return[e.renderSlot(n.$slots,"title",{},(function(){return[r]}))]})),closeIcon:e.withCtx((function(){return[e.createVNode(i,{class:"text-[#006ab2] text-[30px]"})]})),default:e.withCtx((function(){return[e.renderSlot(n.$slots,"body")]})),_:3},8,["wrapClassName","visible"])}}});function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
+ i=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function p(){}function h(){}function d(){}var v={};u(v,o,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(L([])));m&&m!==e&&r.call(m,o)&&(v=m);var g=d.prototype=p.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return h.prototype=d,u(g,"constructor",d),u(d,"constructor",h),h.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(g),u(g,c,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function a(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function c(t){a(i,n,o,c,u,"next",t)}function u(t){a(i,n,o,c,u,"throw",t)}c(void 0)}))}}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n.__file="src/function-ui/component/IVMrpModal.vue";var l="https://basis.nacho.cn",s={getIVMrpOrgDropdown:{url:"/api/identity/users/allOrganizationByUser",option:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({method:"GET"},{headers:{"Content-Type":"application/json;charset=UTF-8","Accept-Language":"zh-Hans",authorization:localStorage.getItem("token")?"Bearer "+localStorage.getItem("token"):null},cache:"no-cache",credentials:"include",responseType:"JSON",mode:"cors"})}},f=function(t){return new Promise((function(e,r){t.then((function(t){t.json().then((function(t){return e(t)})).catch((function(t){return r(t)}))})).catch((function(t){return r(t)}))}))},p=function(t,e,r){if(0===Object.keys(r).length)return t+e;var n=[];for(var o in r)n.push("".concat(o,"=").concat(r[o]));return t+e+"?"+n.join("&")};function h(t,e){var r=e.filter((function(e){return e.parentId==t.id}));if(r.length)return t.children=r,t.children.forEach((function(t){h(t,e)})),t}function d(t){var e=t.filter((function(t){return null==t.parentId}));return e.forEach((function(e){return h(e,t)})),e}var v=Object.assign,y=e.createElementVNode("div",{class:"text-[#0000006D] text-[14px]"},"所属组织",-1),m=e.defineComponent({__name:"IVMrpOrgDropdown",props:{value:{type:null,required:!0},params:{type:Object,required:!1},replaceFields:{type:Object,required:!1}},emits:["update:value"],setup:function(t,r){var n,o=r.emit,a=t,u=e.ref(),h=function(){var t=c(i().mark((function t(){var e,r,n,o,a=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:{},t.next=3,f(fetch(p(l,s.getIVMrpOrgDropdown.url,e.params),v({data:null!==(r=e.data)&&void 0!==r?r:null},s.getIVMrpOrgDropdown.option)));case 3:n=t.sent,o=n.items,u.value=d(o);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),m=e.ref(null!==(n=a.replaceFields)&&void 0!==n?n:{children:"children",label:"displayName",key:"id",value:"id"}),g=e.computed({get:function(){return a.value},set:function(t){o("update:value",t)}});return e.watchEffect(c(i().mark((function t(){var e;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h({params:v(null!==(e=a.params)&&void 0!==e?e:{},{type:1})});case 1:case"end":return t.stop()}}),t)})))),function(t,r){var n=e.resolveComponent("a-tree-select"),o=e.resolveComponent("a-form-item");return e.openBlock(),e.createBlock(o,{name:"organizationId",rules:[{required:!0,message:"请选择所属组织"}]},{label:e.withCtx((function(){return[y]})),default:e.withCtx((function(){return[e.createVNode(n,{value:e.unref(g),"onUpdate:value":r[0]||(r[0]=function(t){return e.isRef(g)?g.value=t:null}),"tree-data":u.value,getPopupContainer:function(t){return t.parentNode},placeholder:"请选择",showArrow:"",treeDefaultExpandAll:"",style:{width:"300px"},replaceFields:m.value},null,8,["value","tree-data","getPopupContainer","replaceFields"])]})),_:1})}}});m.__file="src/business-ui/component/IVMrpOrgDropdown.vue";var g=[n,m];g.forEach((function(t){t.install=function(e){e.component(t.name,t)}}));var w={install:function(t){g.forEach((function(e){t.component(e.name,e)}))}};t.IVMrpModal=n,t.IVMrpOrgDropdown=m,t.default=w,Object.defineProperty(t,"__esModule",{value:!0})}));
4
+ //# sourceMappingURL=index.umd.js.map