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