- 产物替换为 funjiaui.es.js / funjiaui.cjs.js / funjiaui.umd.js - style.css 更新,新增 index.d.ts 与各组件类型声明目录 - 移除旧产物 um_table.es.js(1.0.0 的 ES 包,历史与 v1.0.0 标签仍可回溯) - package.json 补齐 module / types / unpkg / jsdelivr / files 字段, 并将 vue、element-plus、@element-plus/icons-vue 声明为 peerDependencies - 新增 README 说明产物清单与用法
5633 lines
192 KiB
JavaScript
5633 lines
192 KiB
JavaScript
var __accessCheck = (obj, member, msg) => {
|
|
if (!member.has(obj))
|
|
throw TypeError("Cannot " + msg);
|
|
};
|
|
var __privateGet = (obj, member, getter) => {
|
|
__accessCheck(obj, member, "read from private field");
|
|
return getter ? getter.call(obj) : member.get(obj);
|
|
};
|
|
var __privateAdd = (obj, member, value) => {
|
|
if (member.has(obj))
|
|
throw TypeError("Cannot add the same private member more than once");
|
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
};
|
|
var _historyInfo;
|
|
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, ref, createVNode, createElementVNode, h, Fragment, withCtx, renderSlot, createBlock, resolveDynamicComponent, useCssVars, isRef, createSlots, toDisplayString, createTextVNode, renderList, withKeys, pushScopeId, popScopeId, onBeforeMount, watch, resolveComponent, normalizeProps, mergeProps, withModifiers, createCommentVNode, getCurrentInstance, nextTick } from "vue";
|
|
import { ElTable, ElTableColumn, ElDialog, ElButton, ElFormItem, ElInput, ElSwitch, ElDatePicker, ElSelect, ElForm, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElMessage, ElTree } from "element-plus";
|
|
import { CaretTop, CaretBottom, ArrowLeft, ArrowRight, Plus, Search } from "@element-plus/icons-vue";
|
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
/*! *****************************************************************************
|
|
Copyright (C) Microsoft. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */
|
|
var Reflect$1;
|
|
(function(Reflect2) {
|
|
(function(factory) {
|
|
var root2 = typeof commonjsGlobal === "object" ? commonjsGlobal : typeof self === "object" ? self : typeof this === "object" ? this : Function("return this;")();
|
|
var exporter = makeExporter(Reflect2);
|
|
if (typeof root2.Reflect === "undefined") {
|
|
root2.Reflect = Reflect2;
|
|
} else {
|
|
exporter = makeExporter(root2.Reflect, exporter);
|
|
}
|
|
factory(exporter);
|
|
function makeExporter(target, previous) {
|
|
return function(key, value) {
|
|
if (typeof target[key] !== "function") {
|
|
Object.defineProperty(target, key, { configurable: true, writable: true, value });
|
|
}
|
|
if (previous)
|
|
previous(key, value);
|
|
};
|
|
}
|
|
})(function(exporter) {
|
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
var supportsSymbol = typeof Symbol === "function";
|
|
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
var supportsCreate = typeof Object.create === "function";
|
|
var supportsProto = { __proto__: [] } instanceof Array;
|
|
var downLevel = !supportsCreate && !supportsProto;
|
|
var HashMap = {
|
|
create: supportsCreate ? function() {
|
|
return MakeDictionary(/* @__PURE__ */ Object.create(null));
|
|
} : supportsProto ? function() {
|
|
return MakeDictionary({ __proto__: null });
|
|
} : function() {
|
|
return MakeDictionary({});
|
|
},
|
|
has: downLevel ? function(map, key) {
|
|
return hasOwn.call(map, key);
|
|
} : function(map, key) {
|
|
return key in map;
|
|
},
|
|
get: downLevel ? function(map, key) {
|
|
return hasOwn.call(map, key) ? map[key] : void 0;
|
|
} : function(map, key) {
|
|
return map[key];
|
|
}
|
|
};
|
|
var functionPrototype = Object.getPrototypeOf(Function);
|
|
var usePolyfill = typeof process === "object" && process["env"] && process["env"]["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
|
|
var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
var Metadata = new _WeakMap();
|
|
function decorate(decorators, target, propertyKey, attributes) {
|
|
if (!IsUndefined(propertyKey)) {
|
|
if (!IsArray(decorators))
|
|
throw new TypeError();
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
throw new TypeError();
|
|
if (IsNull(attributes))
|
|
attributes = void 0;
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
} else {
|
|
if (!IsArray(decorators))
|
|
throw new TypeError();
|
|
if (!IsConstructor(target))
|
|
throw new TypeError();
|
|
return DecorateConstructor(decorators, target);
|
|
}
|
|
}
|
|
exporter("decorate", decorate);
|
|
function metadata(metadataKey, metadataValue) {
|
|
function decorator(target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
throw new TypeError();
|
|
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
}
|
|
return decorator;
|
|
}
|
|
exporter("metadata", metadata);
|
|
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
}
|
|
exporter("defineMetadata", defineMetadata);
|
|
function hasMetadata(metadataKey, target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
}
|
|
exporter("hasMetadata", hasMetadata);
|
|
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
}
|
|
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
function getMetadata(metadataKey, target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
}
|
|
exporter("getMetadata", getMetadata);
|
|
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
}
|
|
exporter("getOwnMetadata", getOwnMetadata);
|
|
function getMetadataKeys(target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryMetadataKeys(target, propertyKey);
|
|
}
|
|
exporter("getMetadataKeys", getMetadataKeys);
|
|
function getOwnMetadataKeys(target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
}
|
|
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
if (!IsObject(target))
|
|
throw new TypeError();
|
|
if (!IsUndefined(propertyKey))
|
|
propertyKey = ToPropertyKey(propertyKey);
|
|
var metadataMap = GetOrCreateMetadataMap(target, propertyKey, false);
|
|
if (IsUndefined(metadataMap))
|
|
return false;
|
|
if (!metadataMap.delete(metadataKey))
|
|
return false;
|
|
if (metadataMap.size > 0)
|
|
return true;
|
|
var targetMetadata = Metadata.get(target);
|
|
targetMetadata.delete(propertyKey);
|
|
if (targetMetadata.size > 0)
|
|
return true;
|
|
Metadata.delete(target);
|
|
return true;
|
|
}
|
|
exporter("deleteMetadata", deleteMetadata);
|
|
function DecorateConstructor(decorators, target) {
|
|
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
var decorator = decorators[i];
|
|
var decorated = decorator(target);
|
|
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
if (!IsConstructor(decorated))
|
|
throw new TypeError();
|
|
target = decorated;
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
var decorator = decorators[i];
|
|
var decorated = decorator(target, propertyKey, descriptor);
|
|
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
if (!IsObject(decorated))
|
|
throw new TypeError();
|
|
descriptor = decorated;
|
|
}
|
|
}
|
|
return descriptor;
|
|
}
|
|
function GetOrCreateMetadataMap(O, P, Create) {
|
|
var targetMetadata = Metadata.get(O);
|
|
if (IsUndefined(targetMetadata)) {
|
|
if (!Create)
|
|
return void 0;
|
|
targetMetadata = new _Map();
|
|
Metadata.set(O, targetMetadata);
|
|
}
|
|
var metadataMap = targetMetadata.get(P);
|
|
if (IsUndefined(metadataMap)) {
|
|
if (!Create)
|
|
return void 0;
|
|
metadataMap = new _Map();
|
|
targetMetadata.set(P, metadataMap);
|
|
}
|
|
return metadataMap;
|
|
}
|
|
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
if (hasOwn2)
|
|
return true;
|
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
if (!IsNull(parent))
|
|
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
return false;
|
|
}
|
|
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
if (IsUndefined(metadataMap))
|
|
return false;
|
|
return ToBoolean(metadataMap.has(MetadataKey));
|
|
}
|
|
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
if (hasOwn2)
|
|
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
if (!IsNull(parent))
|
|
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
return void 0;
|
|
}
|
|
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
if (IsUndefined(metadataMap))
|
|
return void 0;
|
|
return metadataMap.get(MetadataKey);
|
|
}
|
|
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
var metadataMap = GetOrCreateMetadataMap(O, P, true);
|
|
metadataMap.set(MetadataKey, MetadataValue);
|
|
}
|
|
function OrdinaryMetadataKeys(O, P) {
|
|
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
if (parent === null)
|
|
return ownKeys;
|
|
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
if (parentKeys.length <= 0)
|
|
return ownKeys;
|
|
if (ownKeys.length <= 0)
|
|
return parentKeys;
|
|
var set = new _Set();
|
|
var keys2 = [];
|
|
for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
|
|
var key = ownKeys_1[_i];
|
|
var hasKey = set.has(key);
|
|
if (!hasKey) {
|
|
set.add(key);
|
|
keys2.push(key);
|
|
}
|
|
}
|
|
for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
|
|
var key = parentKeys_1[_a];
|
|
var hasKey = set.has(key);
|
|
if (!hasKey) {
|
|
set.add(key);
|
|
keys2.push(key);
|
|
}
|
|
}
|
|
return keys2;
|
|
}
|
|
function OrdinaryOwnMetadataKeys(O, P) {
|
|
var keys2 = [];
|
|
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
if (IsUndefined(metadataMap))
|
|
return keys2;
|
|
var keysObj = metadataMap.keys();
|
|
var iterator = GetIterator(keysObj);
|
|
var k = 0;
|
|
while (true) {
|
|
var next = IteratorStep(iterator);
|
|
if (!next) {
|
|
keys2.length = k;
|
|
return keys2;
|
|
}
|
|
var nextValue = IteratorValue(next);
|
|
try {
|
|
keys2[k] = nextValue;
|
|
} catch (e) {
|
|
try {
|
|
IteratorClose(iterator);
|
|
} finally {
|
|
throw e;
|
|
}
|
|
}
|
|
k++;
|
|
}
|
|
}
|
|
function Type(x) {
|
|
if (x === null)
|
|
return 1;
|
|
switch (typeof x) {
|
|
case "undefined":
|
|
return 0;
|
|
case "boolean":
|
|
return 2;
|
|
case "string":
|
|
return 3;
|
|
case "symbol":
|
|
return 4;
|
|
case "number":
|
|
return 5;
|
|
case "object":
|
|
return x === null ? 1 : 6;
|
|
default:
|
|
return 6;
|
|
}
|
|
}
|
|
function IsUndefined(x) {
|
|
return x === void 0;
|
|
}
|
|
function IsNull(x) {
|
|
return x === null;
|
|
}
|
|
function IsSymbol(x) {
|
|
return typeof x === "symbol";
|
|
}
|
|
function IsObject(x) {
|
|
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
}
|
|
function ToPrimitive(input, PreferredType) {
|
|
switch (Type(input)) {
|
|
case 0:
|
|
return input;
|
|
case 1:
|
|
return input;
|
|
case 2:
|
|
return input;
|
|
case 3:
|
|
return input;
|
|
case 4:
|
|
return input;
|
|
case 5:
|
|
return input;
|
|
}
|
|
var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
|
|
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
if (exoticToPrim !== void 0) {
|
|
var result = exoticToPrim.call(input, hint);
|
|
if (IsObject(result))
|
|
throw new TypeError();
|
|
return result;
|
|
}
|
|
return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
|
|
}
|
|
function OrdinaryToPrimitive(O, hint) {
|
|
if (hint === "string") {
|
|
var toString_1 = O.toString;
|
|
if (IsCallable(toString_1)) {
|
|
var result = toString_1.call(O);
|
|
if (!IsObject(result))
|
|
return result;
|
|
}
|
|
var valueOf = O.valueOf;
|
|
if (IsCallable(valueOf)) {
|
|
var result = valueOf.call(O);
|
|
if (!IsObject(result))
|
|
return result;
|
|
}
|
|
} else {
|
|
var valueOf = O.valueOf;
|
|
if (IsCallable(valueOf)) {
|
|
var result = valueOf.call(O);
|
|
if (!IsObject(result))
|
|
return result;
|
|
}
|
|
var toString_2 = O.toString;
|
|
if (IsCallable(toString_2)) {
|
|
var result = toString_2.call(O);
|
|
if (!IsObject(result))
|
|
return result;
|
|
}
|
|
}
|
|
throw new TypeError();
|
|
}
|
|
function ToBoolean(argument) {
|
|
return !!argument;
|
|
}
|
|
function ToString(argument) {
|
|
return "" + argument;
|
|
}
|
|
function ToPropertyKey(argument) {
|
|
var key = ToPrimitive(argument, 3);
|
|
if (IsSymbol(key))
|
|
return key;
|
|
return ToString(key);
|
|
}
|
|
function IsArray(argument) {
|
|
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
}
|
|
function IsCallable(argument) {
|
|
return typeof argument === "function";
|
|
}
|
|
function IsConstructor(argument) {
|
|
return typeof argument === "function";
|
|
}
|
|
function IsPropertyKey(argument) {
|
|
switch (Type(argument)) {
|
|
case 3:
|
|
return true;
|
|
case 4:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function GetMethod(V, P) {
|
|
var func = V[P];
|
|
if (func === void 0 || func === null)
|
|
return void 0;
|
|
if (!IsCallable(func))
|
|
throw new TypeError();
|
|
return func;
|
|
}
|
|
function GetIterator(obj) {
|
|
var method = GetMethod(obj, iteratorSymbol);
|
|
if (!IsCallable(method))
|
|
throw new TypeError();
|
|
var iterator = method.call(obj);
|
|
if (!IsObject(iterator))
|
|
throw new TypeError();
|
|
return iterator;
|
|
}
|
|
function IteratorValue(iterResult) {
|
|
return iterResult.value;
|
|
}
|
|
function IteratorStep(iterator) {
|
|
var result = iterator.next();
|
|
return result.done ? false : result;
|
|
}
|
|
function IteratorClose(iterator) {
|
|
var f = iterator["return"];
|
|
if (f)
|
|
f.call(iterator);
|
|
}
|
|
function OrdinaryGetPrototypeOf(O) {
|
|
var proto = Object.getPrototypeOf(O);
|
|
if (typeof O !== "function" || O === functionPrototype)
|
|
return proto;
|
|
if (proto !== functionPrototype)
|
|
return proto;
|
|
var prototype = O.prototype;
|
|
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
return proto;
|
|
var constructor = prototypeProto.constructor;
|
|
if (typeof constructor !== "function")
|
|
return proto;
|
|
if (constructor === O)
|
|
return proto;
|
|
return constructor;
|
|
}
|
|
function CreateMapPolyfill() {
|
|
var cacheSentinel = {};
|
|
var arraySentinel = [];
|
|
var MapIterator = function() {
|
|
function MapIterator2(keys2, values, selector) {
|
|
this._index = 0;
|
|
this._keys = keys2;
|
|
this._values = values;
|
|
this._selector = selector;
|
|
}
|
|
MapIterator2.prototype["@@iterator"] = function() {
|
|
return this;
|
|
};
|
|
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
return this;
|
|
};
|
|
MapIterator2.prototype.next = function() {
|
|
var index = this._index;
|
|
if (index >= 0 && index < this._keys.length) {
|
|
var result = this._selector(this._keys[index], this._values[index]);
|
|
if (index + 1 >= this._keys.length) {
|
|
this._index = -1;
|
|
this._keys = arraySentinel;
|
|
this._values = arraySentinel;
|
|
} else {
|
|
this._index++;
|
|
}
|
|
return { value: result, done: false };
|
|
}
|
|
return { value: void 0, done: true };
|
|
};
|
|
MapIterator2.prototype.throw = function(error) {
|
|
if (this._index >= 0) {
|
|
this._index = -1;
|
|
this._keys = arraySentinel;
|
|
this._values = arraySentinel;
|
|
}
|
|
throw error;
|
|
};
|
|
MapIterator2.prototype.return = function(value) {
|
|
if (this._index >= 0) {
|
|
this._index = -1;
|
|
this._keys = arraySentinel;
|
|
this._values = arraySentinel;
|
|
}
|
|
return { value, done: true };
|
|
};
|
|
return MapIterator2;
|
|
}();
|
|
return function() {
|
|
function Map2() {
|
|
this._keys = [];
|
|
this._values = [];
|
|
this._cacheKey = cacheSentinel;
|
|
this._cacheIndex = -2;
|
|
}
|
|
Object.defineProperty(Map2.prototype, "size", {
|
|
get: function() {
|
|
return this._keys.length;
|
|
},
|
|
enumerable: true,
|
|
configurable: true
|
|
});
|
|
Map2.prototype.has = function(key) {
|
|
return this._find(key, false) >= 0;
|
|
};
|
|
Map2.prototype.get = function(key) {
|
|
var index = this._find(key, false);
|
|
return index >= 0 ? this._values[index] : void 0;
|
|
};
|
|
Map2.prototype.set = function(key, value) {
|
|
var index = this._find(key, true);
|
|
this._values[index] = value;
|
|
return this;
|
|
};
|
|
Map2.prototype.delete = function(key) {
|
|
var index = this._find(key, false);
|
|
if (index >= 0) {
|
|
var size = this._keys.length;
|
|
for (var i = index + 1; i < size; i++) {
|
|
this._keys[i - 1] = this._keys[i];
|
|
this._values[i - 1] = this._values[i];
|
|
}
|
|
this._keys.length--;
|
|
this._values.length--;
|
|
if (key === this._cacheKey) {
|
|
this._cacheKey = cacheSentinel;
|
|
this._cacheIndex = -2;
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
Map2.prototype.clear = function() {
|
|
this._keys.length = 0;
|
|
this._values.length = 0;
|
|
this._cacheKey = cacheSentinel;
|
|
this._cacheIndex = -2;
|
|
};
|
|
Map2.prototype.keys = function() {
|
|
return new MapIterator(this._keys, this._values, getKey);
|
|
};
|
|
Map2.prototype.values = function() {
|
|
return new MapIterator(this._keys, this._values, getValue2);
|
|
};
|
|
Map2.prototype.entries = function() {
|
|
return new MapIterator(this._keys, this._values, getEntry);
|
|
};
|
|
Map2.prototype["@@iterator"] = function() {
|
|
return this.entries();
|
|
};
|
|
Map2.prototype[iteratorSymbol] = function() {
|
|
return this.entries();
|
|
};
|
|
Map2.prototype._find = function(key, insert) {
|
|
if (this._cacheKey !== key) {
|
|
this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
|
|
}
|
|
if (this._cacheIndex < 0 && insert) {
|
|
this._cacheIndex = this._keys.length;
|
|
this._keys.push(key);
|
|
this._values.push(void 0);
|
|
}
|
|
return this._cacheIndex;
|
|
};
|
|
return Map2;
|
|
}();
|
|
function getKey(key, _) {
|
|
return key;
|
|
}
|
|
function getValue2(_, value) {
|
|
return value;
|
|
}
|
|
function getEntry(key, value) {
|
|
return [key, value];
|
|
}
|
|
}
|
|
function CreateSetPolyfill() {
|
|
return function() {
|
|
function Set2() {
|
|
this._map = new _Map();
|
|
}
|
|
Object.defineProperty(Set2.prototype, "size", {
|
|
get: function() {
|
|
return this._map.size;
|
|
},
|
|
enumerable: true,
|
|
configurable: true
|
|
});
|
|
Set2.prototype.has = function(value) {
|
|
return this._map.has(value);
|
|
};
|
|
Set2.prototype.add = function(value) {
|
|
return this._map.set(value, value), this;
|
|
};
|
|
Set2.prototype.delete = function(value) {
|
|
return this._map.delete(value);
|
|
};
|
|
Set2.prototype.clear = function() {
|
|
this._map.clear();
|
|
};
|
|
Set2.prototype.keys = function() {
|
|
return this._map.keys();
|
|
};
|
|
Set2.prototype.values = function() {
|
|
return this._map.values();
|
|
};
|
|
Set2.prototype.entries = function() {
|
|
return this._map.entries();
|
|
};
|
|
Set2.prototype["@@iterator"] = function() {
|
|
return this.keys();
|
|
};
|
|
Set2.prototype[iteratorSymbol] = function() {
|
|
return this.keys();
|
|
};
|
|
return Set2;
|
|
}();
|
|
}
|
|
function CreateWeakMapPolyfill() {
|
|
var UUID_SIZE = 16;
|
|
var keys2 = HashMap.create();
|
|
var rootKey = CreateUniqueKey();
|
|
return function() {
|
|
function WeakMap2() {
|
|
this._key = CreateUniqueKey();
|
|
}
|
|
WeakMap2.prototype.has = function(target) {
|
|
var table = GetOrCreateWeakMapTable(target, false);
|
|
return table !== void 0 ? HashMap.has(table, this._key) : false;
|
|
};
|
|
WeakMap2.prototype.get = function(target) {
|
|
var table = GetOrCreateWeakMapTable(target, false);
|
|
return table !== void 0 ? HashMap.get(table, this._key) : void 0;
|
|
};
|
|
WeakMap2.prototype.set = function(target, value) {
|
|
var table = GetOrCreateWeakMapTable(target, true);
|
|
table[this._key] = value;
|
|
return this;
|
|
};
|
|
WeakMap2.prototype.delete = function(target) {
|
|
var table = GetOrCreateWeakMapTable(target, false);
|
|
return table !== void 0 ? delete table[this._key] : false;
|
|
};
|
|
WeakMap2.prototype.clear = function() {
|
|
this._key = CreateUniqueKey();
|
|
};
|
|
return WeakMap2;
|
|
}();
|
|
function CreateUniqueKey() {
|
|
var key;
|
|
do
|
|
key = "@@WeakMap@@" + CreateUUID();
|
|
while (HashMap.has(keys2, key));
|
|
keys2[key] = true;
|
|
return key;
|
|
}
|
|
function GetOrCreateWeakMapTable(target, create) {
|
|
if (!hasOwn.call(target, rootKey)) {
|
|
if (!create)
|
|
return void 0;
|
|
Object.defineProperty(target, rootKey, { value: HashMap.create() });
|
|
}
|
|
return target[rootKey];
|
|
}
|
|
function FillRandomBytes(buffer, size) {
|
|
for (var i = 0; i < size; ++i)
|
|
buffer[i] = Math.random() * 255 | 0;
|
|
return buffer;
|
|
}
|
|
function GenRandomBytes(size) {
|
|
if (typeof Uint8Array === "function") {
|
|
if (typeof crypto !== "undefined")
|
|
return crypto.getRandomValues(new Uint8Array(size));
|
|
if (typeof msCrypto !== "undefined")
|
|
return msCrypto.getRandomValues(new Uint8Array(size));
|
|
return FillRandomBytes(new Uint8Array(size), size);
|
|
}
|
|
return FillRandomBytes(new Array(size), size);
|
|
}
|
|
function CreateUUID() {
|
|
var data = GenRandomBytes(UUID_SIZE);
|
|
data[6] = data[6] & 79 | 64;
|
|
data[8] = data[8] & 191 | 128;
|
|
var result = "";
|
|
for (var offset = 0; offset < UUID_SIZE; ++offset) {
|
|
var byte = data[offset];
|
|
if (offset === 4 || offset === 6 || offset === 8)
|
|
result += "-";
|
|
if (byte < 16)
|
|
result += "0";
|
|
result += byte.toString(16).toLowerCase();
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
function MakeDictionary(obj) {
|
|
obj.__ = void 0;
|
|
delete obj.__;
|
|
return obj;
|
|
}
|
|
});
|
|
})(Reflect$1 || (Reflect$1 = {}));
|
|
const __default__$6 = {
|
|
name: "iconfont",
|
|
inheritAttrs: false
|
|
};
|
|
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
...__default__$6,
|
|
props: {
|
|
class: null,
|
|
style: null,
|
|
type: null
|
|
},
|
|
emits: ["click"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const iconClass = computed(() => {
|
|
return ["iconfont"].concat([props.type], props.class ? [props.class] : []).join(" ");
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createElementBlock("span", {
|
|
class: normalizeClass(unref(iconClass)),
|
|
style: normalizeStyle(__props.style),
|
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("click"))
|
|
}, null, 6);
|
|
};
|
|
}
|
|
});
|
|
var style0$6 = {
|
|
"um-import": "_um-import_19xyw_1"
|
|
};
|
|
var _export_sfc = (sfc, props) => {
|
|
const target = sfc.__vccOpts || sfc;
|
|
for (const [key, val] of props) {
|
|
target[key] = val;
|
|
}
|
|
return target;
|
|
};
|
|
const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u5165", -1);
|
|
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
emits: ["click"],
|
|
setup(__props, { emit }) {
|
|
const fileInput = ref();
|
|
const onClick = () => {
|
|
fileInput.value.click();
|
|
};
|
|
const onFileChange = (e) => {
|
|
emit("click", e);
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createElementBlock("div", {
|
|
class: normalizeClass(_ctx.$style["um-import"]),
|
|
onClick
|
|
}, [
|
|
createVNode(_sfc_main$k, { type: "icon-daoru" }),
|
|
_hoisted_1$7,
|
|
createElementVNode("input", {
|
|
ref_key: "fileInput",
|
|
ref: fileInput,
|
|
type: "file",
|
|
onChange: onFileChange
|
|
}, null, 544)
|
|
], 2);
|
|
};
|
|
}
|
|
});
|
|
const cssModules$6 = {
|
|
"$style": style0$6
|
|
};
|
|
var UmImport = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__cssModules", cssModules$6]]);
|
|
var UmTableToolbar_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
const _sfc_main$i = defineComponent({
|
|
inheritAttrs: false,
|
|
render() {
|
|
var _a, _b;
|
|
const that = this;
|
|
const data = that.$attrs.data || [];
|
|
const otherParams = ((_a = that.$attrs) == null ? void 0 : _a["other-params"]) || {};
|
|
const searchParams = ((_b = that.$attrs) == null ? void 0 : _b["search-params"]) || {};
|
|
const events = that.$attrs.events || [];
|
|
const selection = that.$attrs.selection || [];
|
|
const list = data.map((item, index) => {
|
|
const event = () => events == null ? void 0 : events[index](selection);
|
|
switch (item.type) {
|
|
case "\u6DFB\u52A0":
|
|
return h("div", { "class": "item add", "onclick": event }, [h(_sfc_main$k, {
|
|
type: "icon-tianjia"
|
|
}), h("a", {}, item.title || "\u6DFB\u52A0")]);
|
|
case "\u5BFC\u5165\u6A21\u677F":
|
|
return h("div", { "class": "item", "onclick": event }, h("a", {}, "\u5BFC\u5165\u6A21\u677F"));
|
|
case "\u5BFC\u5165":
|
|
return h(UmImport, {
|
|
"class": "item",
|
|
"onClick": (data2) => {
|
|
events == null ? void 0 : events[index](data2);
|
|
}
|
|
});
|
|
case "\u5BFC\u51FA":
|
|
return h("div", {
|
|
"class": "item",
|
|
"onclick": (e) => {
|
|
events == null ? void 0 : events[index]({ ...otherParams || {}, ...searchParams || {} });
|
|
}
|
|
}, [h(_sfc_main$k, {
|
|
type: "icon-daochu"
|
|
}), h("a", {}, "\u5BFC\u51FA")]);
|
|
case "\u6279\u91CF\u5220\u9664":
|
|
return h("div", {
|
|
"class": "item " + ((selection == null ? void 0 : selection.length) > 0 ? "" : "disabled"),
|
|
"onclick": (e) => {
|
|
if ((selection == null ? void 0 : selection.length) == 0) {
|
|
return;
|
|
}
|
|
return event();
|
|
}
|
|
}, [h(_sfc_main$k, {
|
|
type: "icon-shanchu-"
|
|
}), h("a", {}, "\u6279\u91CF\u5220\u9664")]);
|
|
case "\u81EA\u5B9A\u4E49":
|
|
return h("div", {
|
|
"class": "item",
|
|
"onclick": (e) => {
|
|
events == null ? void 0 : events[index]({ ...otherParams || {}, ...searchParams || {} });
|
|
}
|
|
}, [h(_sfc_main$k, {
|
|
type: "icon-daochu"
|
|
}), h("a", {}, item.title || "\u81EA\u5B9A\u4E49")]);
|
|
default:
|
|
return h("div", {}, "error");
|
|
}
|
|
});
|
|
return h("div", { "class": "toolbar" }, list);
|
|
}
|
|
});
|
|
var UmTableToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-4e3c97de"]]);
|
|
var UmTable_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
props: {
|
|
style: null,
|
|
width: { default: "100%" },
|
|
data: null,
|
|
toolbarOptions: { default: () => [] },
|
|
toolbarEvents: { default: () => [] },
|
|
otherParams: { default: () => ({}) },
|
|
searchParams: { default: () => ({}) },
|
|
rowKey: { default: "id" },
|
|
defaultExpandAll: { type: Boolean, default: false },
|
|
treeProps: null
|
|
},
|
|
setup(__props) {
|
|
const props = __props;
|
|
const selection = ref([]);
|
|
const onSelect = (rows) => {
|
|
selection.value = rows;
|
|
};
|
|
const onSelectAll = (rows) => {
|
|
selection.value = rows;
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
createVNode(UmTableToolbar, {
|
|
data: __props.toolbarOptions,
|
|
"other-params": __props.otherParams,
|
|
"search-params": __props.searchParams,
|
|
events: __props.toolbarEvents,
|
|
selection: selection.value
|
|
}, null, 8, ["data", "other-params", "search-params", "events", "selection"]),
|
|
createVNode(unref(ElTable), {
|
|
class: "um-table",
|
|
data: __props.data,
|
|
"row-key": __props.rowKey,
|
|
"default-expand-all": __props.defaultExpandAll,
|
|
"tree-props": __props.treeProps,
|
|
style: normalizeStyle({ ...props.style || {}, width: __props.width }),
|
|
onSelect,
|
|
onSelectAll
|
|
}, {
|
|
default: withCtx(() => [
|
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
]),
|
|
_: 3
|
|
}, 8, ["data", "row-key", "default-expand-all", "tree-props", "style"])
|
|
], 64);
|
|
};
|
|
}
|
|
});
|
|
var UmTable = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-1fc1c360"]]);
|
|
var dayjs_min = { exports: {} };
|
|
(function(module2, exports2) {
|
|
!function(t, e) {
|
|
module2.exports = e();
|
|
}(commonjsGlobal, function() {
|
|
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h2 = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
} }, m = function(t2, e2, n2) {
|
|
var r2 = String(t2);
|
|
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
}, v = { s: m, z: function(t2) {
|
|
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
}, m: function t2(e2, n2) {
|
|
if (e2.date() < n2.date())
|
|
return -t2(n2, e2);
|
|
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
}, a: function(t2) {
|
|
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
}, p: function(t2) {
|
|
return { M: c, y: h2, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
}, u: function(t2) {
|
|
return void 0 === t2;
|
|
} }, g = "en", D = {};
|
|
D[g] = M;
|
|
var p = "$isDayjsObject", S = function(t2) {
|
|
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
}, w = function t2(e2, n2, r2) {
|
|
var i2;
|
|
if (!e2)
|
|
return g;
|
|
if ("string" == typeof e2) {
|
|
var s2 = e2.toLowerCase();
|
|
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
var u2 = e2.split("-");
|
|
if (!i2 && u2.length > 1)
|
|
return t2(u2[0]);
|
|
} else {
|
|
var a2 = e2.name;
|
|
D[a2] = e2, i2 = a2;
|
|
}
|
|
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
}, O = function(t2, e2) {
|
|
if (S(t2))
|
|
return t2.clone();
|
|
var n2 = "object" == typeof e2 ? e2 : {};
|
|
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
}, b = v;
|
|
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
};
|
|
var _ = function() {
|
|
function M2(t2) {
|
|
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
}
|
|
var m2 = M2.prototype;
|
|
return m2.parse = function(t2) {
|
|
this.$d = function(t3) {
|
|
var e2 = t3.date, n2 = t3.utc;
|
|
if (null === e2)
|
|
return new Date(NaN);
|
|
if (b.u(e2))
|
|
return new Date();
|
|
if (e2 instanceof Date)
|
|
return new Date(e2);
|
|
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
var r2 = e2.match($);
|
|
if (r2) {
|
|
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
}
|
|
}
|
|
return new Date(e2);
|
|
}(t2), this.init();
|
|
}, m2.init = function() {
|
|
var t2 = this.$d;
|
|
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
}, m2.$utils = function() {
|
|
return b;
|
|
}, m2.isValid = function() {
|
|
return !(this.$d.toString() === l);
|
|
}, m2.isSame = function(t2, e2) {
|
|
var n2 = O(t2);
|
|
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
}, m2.isAfter = function(t2, e2) {
|
|
return O(t2) < this.startOf(e2);
|
|
}, m2.isBefore = function(t2, e2) {
|
|
return this.endOf(e2) < O(t2);
|
|
}, m2.$g = function(t2, e2, n2) {
|
|
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
}, m2.unix = function() {
|
|
return Math.floor(this.valueOf() / 1e3);
|
|
}, m2.valueOf = function() {
|
|
return this.$d.getTime();
|
|
}, m2.startOf = function(t2, e2) {
|
|
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
return r2 ? i2 : i2.endOf(a);
|
|
}, $2 = function(t3, e3) {
|
|
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
switch (f2) {
|
|
case h2:
|
|
return r2 ? l2(1, 0) : l2(31, 11);
|
|
case c:
|
|
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
case o:
|
|
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
case a:
|
|
case d:
|
|
return $2(v2 + "Hours", 0);
|
|
case u:
|
|
return $2(v2 + "Minutes", 1);
|
|
case s:
|
|
return $2(v2 + "Seconds", 2);
|
|
case i:
|
|
return $2(v2 + "Milliseconds", 3);
|
|
default:
|
|
return this.clone();
|
|
}
|
|
}, m2.endOf = function(t2) {
|
|
return this.startOf(t2, false);
|
|
}, m2.$set = function(t2, e2) {
|
|
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h2] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
if (o2 === c || o2 === h2) {
|
|
var y2 = this.clone().set(d, 1);
|
|
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
} else
|
|
l2 && this.$d[l2]($2);
|
|
return this.init(), this;
|
|
}, m2.set = function(t2, e2) {
|
|
return this.clone().$set(t2, e2);
|
|
}, m2.get = function(t2) {
|
|
return this[b.p(t2)]();
|
|
}, m2.add = function(r2, f2) {
|
|
var d2, l2 = this;
|
|
r2 = Number(r2);
|
|
var $2 = b.p(f2), y2 = function(t2) {
|
|
var e2 = O(l2);
|
|
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
};
|
|
if ($2 === c)
|
|
return this.set(c, this.$M + r2);
|
|
if ($2 === h2)
|
|
return this.set(h2, this.$y + r2);
|
|
if ($2 === a)
|
|
return y2(1);
|
|
if ($2 === o)
|
|
return y2(7);
|
|
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
return b.w(m3, this);
|
|
}, m2.subtract = function(t2, e2) {
|
|
return this.add(-1 * t2, e2);
|
|
}, m2.format = function(t2) {
|
|
var e2 = this, n2 = this.$locale();
|
|
if (!this.isValid())
|
|
return n2.invalidDate || l;
|
|
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h3 = function(t3, n3, i3, s3) {
|
|
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
}, d2 = function(t3) {
|
|
return b.s(s2 % 12 || 12, t3, "0");
|
|
}, $2 = f2 || function(t3, e3, n3) {
|
|
var r3 = t3 < 12 ? "AM" : "PM";
|
|
return n3 ? r3.toLowerCase() : r3;
|
|
};
|
|
return r2.replace(y, function(t3, r3) {
|
|
return r3 || function(t4) {
|
|
switch (t4) {
|
|
case "YY":
|
|
return String(e2.$y).slice(-2);
|
|
case "YYYY":
|
|
return b.s(e2.$y, 4, "0");
|
|
case "M":
|
|
return a2 + 1;
|
|
case "MM":
|
|
return b.s(a2 + 1, 2, "0");
|
|
case "MMM":
|
|
return h3(n2.monthsShort, a2, c2, 3);
|
|
case "MMMM":
|
|
return h3(c2, a2);
|
|
case "D":
|
|
return e2.$D;
|
|
case "DD":
|
|
return b.s(e2.$D, 2, "0");
|
|
case "d":
|
|
return String(e2.$W);
|
|
case "dd":
|
|
return h3(n2.weekdaysMin, e2.$W, o2, 2);
|
|
case "ddd":
|
|
return h3(n2.weekdaysShort, e2.$W, o2, 3);
|
|
case "dddd":
|
|
return o2[e2.$W];
|
|
case "H":
|
|
return String(s2);
|
|
case "HH":
|
|
return b.s(s2, 2, "0");
|
|
case "h":
|
|
return d2(1);
|
|
case "hh":
|
|
return d2(2);
|
|
case "a":
|
|
return $2(s2, u2, true);
|
|
case "A":
|
|
return $2(s2, u2, false);
|
|
case "m":
|
|
return String(u2);
|
|
case "mm":
|
|
return b.s(u2, 2, "0");
|
|
case "s":
|
|
return String(e2.$s);
|
|
case "ss":
|
|
return b.s(e2.$s, 2, "0");
|
|
case "SSS":
|
|
return b.s(e2.$ms, 3, "0");
|
|
case "Z":
|
|
return i2;
|
|
}
|
|
return null;
|
|
}(t3) || i2.replace(":", "");
|
|
});
|
|
}, m2.utcOffset = function() {
|
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
}, m2.diff = function(r2, d2, l2) {
|
|
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
return b.m(y2, m3);
|
|
};
|
|
switch (M3) {
|
|
case h2:
|
|
$2 = D2() / 12;
|
|
break;
|
|
case c:
|
|
$2 = D2();
|
|
break;
|
|
case f:
|
|
$2 = D2() / 3;
|
|
break;
|
|
case o:
|
|
$2 = (g2 - v2) / 6048e5;
|
|
break;
|
|
case a:
|
|
$2 = (g2 - v2) / 864e5;
|
|
break;
|
|
case u:
|
|
$2 = g2 / n;
|
|
break;
|
|
case s:
|
|
$2 = g2 / e;
|
|
break;
|
|
case i:
|
|
$2 = g2 / t;
|
|
break;
|
|
default:
|
|
$2 = g2;
|
|
}
|
|
return l2 ? $2 : b.a($2);
|
|
}, m2.daysInMonth = function() {
|
|
return this.endOf(c).$D;
|
|
}, m2.$locale = function() {
|
|
return D[this.$L];
|
|
}, m2.locale = function(t2, e2) {
|
|
if (!t2)
|
|
return this.$L;
|
|
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
return r2 && (n2.$L = r2), n2;
|
|
}, m2.clone = function() {
|
|
return b.w(this.$d, this);
|
|
}, m2.toDate = function() {
|
|
return new Date(this.valueOf());
|
|
}, m2.toJSON = function() {
|
|
return this.isValid() ? this.toISOString() : null;
|
|
}, m2.toISOString = function() {
|
|
return this.$d.toISOString();
|
|
}, m2.toString = function() {
|
|
return this.$d.toUTCString();
|
|
}, M2;
|
|
}(), Y = _.prototype;
|
|
return O.prototype = Y, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h2], ["$D", d]].forEach(function(t2) {
|
|
Y[t2[1]] = function(e2) {
|
|
return this.$g(e2, t2[0], t2[1]);
|
|
};
|
|
}), O.extend = function(t2, e2) {
|
|
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
return O(1e3 * t2);
|
|
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
});
|
|
})(dayjs_min);
|
|
var dayjs = dayjs_min.exports;
|
|
const isEmpty = (obj) => {
|
|
if (typeof obj !== "number" && (obj === null || obj === "" || obj === void 0)) {
|
|
return true;
|
|
}
|
|
return typeof obj === "number" && Number.isNaN(obj);
|
|
};
|
|
const formatDateTime = (time, template = "YYYY-MM-DD HH:mm:ss") => {
|
|
if (time === null || time === void 0 || time === "")
|
|
return "";
|
|
try {
|
|
const parsed = dayjs(time);
|
|
return parsed.isValid() ? parsed.format(template) : "";
|
|
} catch {
|
|
return "";
|
|
}
|
|
};
|
|
let measureCanvas = null;
|
|
const measureTextWidth = (text = "", font = "400 14px Microsoft YaHei") => {
|
|
if (typeof document === "undefined")
|
|
return text.length * 14;
|
|
if (!measureCanvas)
|
|
measureCanvas = document.createElement("canvas");
|
|
const context = measureCanvas.getContext("2d");
|
|
if (!context)
|
|
return text.length * 14;
|
|
context.font = font;
|
|
return context.measureText(text).width;
|
|
};
|
|
const filterTreeByNodeIds = (tree, ids) => {
|
|
const pool = [...ids != null ? ids : []];
|
|
const result = [];
|
|
const walk = (nodes) => {
|
|
for (const node of nodes != null ? nodes : []) {
|
|
const idx = pool.findIndex((fId) => fId == (node == null ? void 0 : node.id));
|
|
if (idx !== -1) {
|
|
result.push(pool[idx]);
|
|
pool.splice(idx, 1);
|
|
} else if (Array.isArray(node == null ? void 0 : node.children)) {
|
|
walk(node.children);
|
|
}
|
|
if (pool.length === 0)
|
|
return;
|
|
}
|
|
};
|
|
walk(tree != null ? tree : []);
|
|
return result;
|
|
};
|
|
const hasEmitListener = (instance, event) => {
|
|
var _a, _b, _c;
|
|
const key = "on" + event.charAt(0).toUpperCase() + event.slice(1);
|
|
const props = ((_b = (_a = instance == null ? void 0 : instance.$) == null ? void 0 : _a.vnode) == null ? void 0 : _b.props) || ((_c = instance == null ? void 0 : instance.vnode) == null ? void 0 : _c.props) || {};
|
|
return typeof props[key] === "function";
|
|
};
|
|
var style0$5 = {
|
|
"table-column-img": "_table-column-img_citx0_1"
|
|
};
|
|
const _sfc_main$g = defineComponent({
|
|
name: "UmColumnRender",
|
|
inheritAttrs: false,
|
|
props: {
|
|
fieldType: {
|
|
type: String,
|
|
default: "default"
|
|
},
|
|
data: {
|
|
type: Object,
|
|
default: () => ({})
|
|
},
|
|
prop: {
|
|
type: String,
|
|
default: ""
|
|
},
|
|
render: {
|
|
type: Function,
|
|
default: void 0
|
|
},
|
|
dateFormat: {
|
|
type: String,
|
|
default: void 0
|
|
},
|
|
isShow: {
|
|
type: Function,
|
|
default: void 0
|
|
}
|
|
},
|
|
data() {
|
|
return { visible: true };
|
|
},
|
|
created() {
|
|
this.refreshVisible();
|
|
},
|
|
watch: {
|
|
data() {
|
|
this.refreshVisible();
|
|
},
|
|
isShow() {
|
|
this.refreshVisible();
|
|
}
|
|
},
|
|
methods: {
|
|
async refreshVisible() {
|
|
if (!this.isShow) {
|
|
this.visible = true;
|
|
return;
|
|
}
|
|
this.visible = !!await this.isShow(this.data);
|
|
}
|
|
},
|
|
render() {
|
|
if (!this.visible)
|
|
return null;
|
|
const { data, prop, render, fieldType, dateFormat } = this;
|
|
if (fieldType === "date") {
|
|
return formatDateTime(data == null ? void 0 : data[prop], dateFormat || "YYYY-MM-DD HH:mm:ss");
|
|
}
|
|
if (fieldType === "img") {
|
|
const style = this.$style;
|
|
return h("img", { class: style == null ? void 0 : style["table-column-img"], src: data == null ? void 0 : data[prop] });
|
|
}
|
|
if (render) {
|
|
return render(data == null ? void 0 : data[prop], prop, data);
|
|
}
|
|
return data == null ? void 0 : data[prop];
|
|
}
|
|
});
|
|
const cssModules$5 = {
|
|
"$style": style0$5
|
|
};
|
|
var UmColumnRender = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__cssModules", cssModules$5]]);
|
|
var UmTableOperate_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
const DEFAULT_TEXT = {
|
|
edit: "\u7F16\u8F91",
|
|
del: "\u5220\u9664",
|
|
copy: "\u590D\u5236"
|
|
};
|
|
const BUTTON_CLASS = {
|
|
edit: "edit",
|
|
copy: "copy",
|
|
del: "del",
|
|
customOperateEvent: "custom-operate"
|
|
};
|
|
const _sfc_main$f = defineComponent({
|
|
name: "UmTableOperate",
|
|
inheritAttrs: false,
|
|
props: {
|
|
items: {
|
|
type: Array,
|
|
default: () => []
|
|
},
|
|
rowId: {
|
|
type: [String, Number],
|
|
default: ""
|
|
},
|
|
rowData: {
|
|
type: Object,
|
|
default: () => ({})
|
|
}
|
|
},
|
|
render() {
|
|
const buttons = this.items.filter((item) => !item.isShow || item.isShow(this.rowData)).map(
|
|
(item) => {
|
|
var _a, _b, _c;
|
|
return h(
|
|
"a",
|
|
{
|
|
class: (_a = BUTTON_CLASS[item.type]) != null ? _a : "custom-operate",
|
|
onClick: () => item.onClick(this.rowId, this.rowData)
|
|
},
|
|
(_c = (_b = item.title) != null ? _b : DEFAULT_TEXT[item.type]) != null ? _c : "\u64CD\u4F5C"
|
|
);
|
|
}
|
|
);
|
|
return h(
|
|
"div",
|
|
{
|
|
class: "operate-group " + (this.items.length > 2 ? "total-more" : "total-2")
|
|
},
|
|
buttons
|
|
);
|
|
}
|
|
});
|
|
var UmTableOperate = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-10c2977a"]]);
|
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
props: {
|
|
type: null,
|
|
fieldType: { default: "default" },
|
|
prop: { default: "" },
|
|
label: null,
|
|
width: { default: 180 },
|
|
minWidth: null,
|
|
showOverflowTooltip: { type: Boolean },
|
|
operateItems: { default: () => [] },
|
|
expandTemplate: null,
|
|
columnRender: null,
|
|
dateFormat: null,
|
|
isShow: null
|
|
},
|
|
setup(__props) {
|
|
const props = __props;
|
|
const resolvedLabel = computed(
|
|
() => props.label || (props.type === "operate" ? "\u64CD\u4F5C" : void 0)
|
|
);
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createBlock(unref(ElTableColumn), {
|
|
type: __props.type,
|
|
prop: __props.prop,
|
|
width: __props.minWidth ? void 0 : __props.width,
|
|
"min-width": __props.minWidth,
|
|
label: unref(resolvedLabel),
|
|
"show-overflow-tooltip": __props.showOverflowTooltip
|
|
}, {
|
|
default: withCtx((scope) => {
|
|
var _a, _b;
|
|
return [
|
|
__props.type === "operate" ? (openBlock(), createBlock(UmTableOperate, {
|
|
key: 0,
|
|
items: __props.operateItems,
|
|
"row-id": (_a = scope.row) == null ? void 0 : _a.id,
|
|
"row-data": scope.row
|
|
}, null, 8, ["items", "row-id", "row-data"])) : __props.type === "expand" ? (openBlock(), createBlock(resolveDynamicComponent(__props.expandTemplate), {
|
|
key: 1,
|
|
props: scope
|
|
}, null, 8, ["props"])) : (openBlock(), createBlock(UmColumnRender, {
|
|
key: (_b = scope.row) == null ? void 0 : _b.id,
|
|
"field-type": __props.fieldType,
|
|
prop: __props.prop,
|
|
data: scope.row,
|
|
"is-show": __props.isShow,
|
|
render: __props.columnRender,
|
|
"date-format": __props.dateFormat
|
|
}, null, 8, ["field-type", "prop", "data", "is-show", "render", "date-format"]))
|
|
];
|
|
}),
|
|
_: 1
|
|
}, 8, ["type", "prop", "width", "min-width", "label", "show-overflow-tooltip"]);
|
|
};
|
|
}
|
|
});
|
|
const normalizeFieldName = (key) => key.startsWith("_") ? key.slice(1) : key;
|
|
const createTargetInstance = (target) => {
|
|
if (!target)
|
|
return {};
|
|
if (typeof target !== "function")
|
|
return target;
|
|
return Reflect.construct(target, []);
|
|
};
|
|
const collectClassMembers = (target) => {
|
|
const instance = createTargetInstance(target);
|
|
const keys2 = /* @__PURE__ */ new Set();
|
|
for (const key in instance)
|
|
keys2.add(key);
|
|
let proto = Object.getPrototypeOf(instance);
|
|
while (proto && proto !== Object.prototype) {
|
|
for (const key of Object.getOwnPropertyNames(proto)) {
|
|
if (key !== "constructor")
|
|
keys2.add(key);
|
|
}
|
|
proto = Object.getPrototypeOf(proto);
|
|
}
|
|
const members = [];
|
|
for (const key of keys2) {
|
|
let value = instance[key];
|
|
if (value === void 0) {
|
|
let p = Object.getPrototypeOf(instance);
|
|
while (p && p !== Object.prototype && value === void 0) {
|
|
value = p[key];
|
|
p = Object.getPrototypeOf(p);
|
|
}
|
|
}
|
|
members.push({
|
|
key,
|
|
fieldName: normalizeFieldName(key),
|
|
value,
|
|
isMethod: typeof value === "function"
|
|
});
|
|
}
|
|
return members;
|
|
};
|
|
const getMemberMeta = (target, decoratorKey, member) => {
|
|
var _a;
|
|
const instance = createTargetInstance(target);
|
|
return (_a = Reflect.getMetadata(decoratorKey, instance, member.fieldName)) != null ? _a : Reflect.getMetadata(decoratorKey, instance, member.key);
|
|
};
|
|
const scanDecoratedMembers = (target, decoratorKey, options = {}) => {
|
|
const wantMethods = options.methods === true;
|
|
const result = [];
|
|
for (const member of collectClassMembers(target)) {
|
|
if (member.isMethod !== wantMethods)
|
|
continue;
|
|
const meta = getMemberMeta(target, decoratorKey, member);
|
|
if (meta)
|
|
result.push({ ...member, meta });
|
|
}
|
|
return result;
|
|
};
|
|
const transformFields = (target, data, direction) => {
|
|
if (!data)
|
|
return data;
|
|
const instance = createTargetInstance(target);
|
|
for (const member of collectClassMembers(target)) {
|
|
if (member.isMethod || !member.key.startsWith("_"))
|
|
continue;
|
|
const { key, fieldName } = member;
|
|
if (direction === "in") {
|
|
instance[fieldName] = data[fieldName];
|
|
data[fieldName] = instance[fieldName];
|
|
} else {
|
|
instance[fieldName] = data[fieldName];
|
|
data[fieldName] = instance[key];
|
|
}
|
|
}
|
|
return data;
|
|
};
|
|
const findMethodMeta = (target, decoratorKey, type) => {
|
|
var _a;
|
|
for (const member of scanDecoratedMembers(target, decoratorKey, {
|
|
methods: true
|
|
})) {
|
|
if (((_a = member.meta) == null ? void 0 : _a.type) === type)
|
|
return { meta: member.meta, member };
|
|
}
|
|
return null;
|
|
};
|
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
var freeGlobal$1 = freeGlobal;
|
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
var root = freeGlobal$1 || freeSelf || Function("return this")();
|
|
var root$1 = root;
|
|
var Symbol$1 = root$1.Symbol;
|
|
var Symbol$2 = Symbol$1;
|
|
var objectProto$f = Object.prototype;
|
|
var hasOwnProperty$c = objectProto$f.hasOwnProperty;
|
|
var nativeObjectToString$1 = objectProto$f.toString;
|
|
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
function getRawTag(value) {
|
|
var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
try {
|
|
value[symToStringTag$1] = void 0;
|
|
var unmasked = true;
|
|
} catch (e) {
|
|
}
|
|
var result = nativeObjectToString$1.call(value);
|
|
if (unmasked) {
|
|
if (isOwn) {
|
|
value[symToStringTag$1] = tag;
|
|
} else {
|
|
delete value[symToStringTag$1];
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
var objectProto$e = Object.prototype;
|
|
var nativeObjectToString = objectProto$e.toString;
|
|
function objectToString(value) {
|
|
return nativeObjectToString.call(value);
|
|
}
|
|
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
function baseGetTag(value) {
|
|
if (value == null) {
|
|
return value === void 0 ? undefinedTag : nullTag;
|
|
}
|
|
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
}
|
|
function isObjectLike(value) {
|
|
return value != null && typeof value == "object";
|
|
}
|
|
var symbolTag$3 = "[object Symbol]";
|
|
function isSymbol(value) {
|
|
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
|
|
}
|
|
function arrayMap(array, iteratee) {
|
|
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
while (++index < length) {
|
|
result[index] = iteratee(array[index], index, array);
|
|
}
|
|
return result;
|
|
}
|
|
var isArray = Array.isArray;
|
|
var isArray$1 = isArray;
|
|
var INFINITY$1 = 1 / 0;
|
|
var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
|
|
function baseToString(value) {
|
|
if (typeof value == "string") {
|
|
return value;
|
|
}
|
|
if (isArray$1(value)) {
|
|
return arrayMap(value, baseToString) + "";
|
|
}
|
|
if (isSymbol(value)) {
|
|
return symbolToString ? symbolToString.call(value) : "";
|
|
}
|
|
var result = value + "";
|
|
return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
|
|
}
|
|
var reWhitespace = /\s/;
|
|
function trimmedEndIndex(string) {
|
|
var index = string.length;
|
|
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
}
|
|
return index;
|
|
}
|
|
var reTrimStart = /^\s+/;
|
|
function baseTrim(string) {
|
|
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
}
|
|
function isObject(value) {
|
|
var type = typeof value;
|
|
return value != null && (type == "object" || type == "function");
|
|
}
|
|
var NAN = 0 / 0;
|
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
var reIsBinary = /^0b[01]+$/i;
|
|
var reIsOctal = /^0o[0-7]+$/i;
|
|
var freeParseInt = parseInt;
|
|
function toNumber(value) {
|
|
if (typeof value == "number") {
|
|
return value;
|
|
}
|
|
if (isSymbol(value)) {
|
|
return NAN;
|
|
}
|
|
if (isObject(value)) {
|
|
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
value = isObject(other) ? other + "" : other;
|
|
}
|
|
if (typeof value != "string") {
|
|
return value === 0 ? value : +value;
|
|
}
|
|
value = baseTrim(value);
|
|
var isBinary = reIsBinary.test(value);
|
|
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
}
|
|
function identity(value) {
|
|
return value;
|
|
}
|
|
var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
function isFunction(value) {
|
|
if (!isObject(value)) {
|
|
return false;
|
|
}
|
|
var tag = baseGetTag(value);
|
|
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
}
|
|
var coreJsData = root$1["__core-js_shared__"];
|
|
var coreJsData$1 = coreJsData;
|
|
var maskSrcKey = function() {
|
|
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
|
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
}();
|
|
function isMasked(func) {
|
|
return !!maskSrcKey && maskSrcKey in func;
|
|
}
|
|
var funcProto$1 = Function.prototype;
|
|
var funcToString$1 = funcProto$1.toString;
|
|
function toSource(func) {
|
|
if (func != null) {
|
|
try {
|
|
return funcToString$1.call(func);
|
|
} catch (e) {
|
|
}
|
|
try {
|
|
return func + "";
|
|
} catch (e) {
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
var funcProto = Function.prototype, objectProto$d = Object.prototype;
|
|
var funcToString = funcProto.toString;
|
|
var hasOwnProperty$b = objectProto$d.hasOwnProperty;
|
|
var reIsNative = RegExp(
|
|
"^" + funcToString.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
);
|
|
function baseIsNative(value) {
|
|
if (!isObject(value) || isMasked(value)) {
|
|
return false;
|
|
}
|
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
return pattern.test(toSource(value));
|
|
}
|
|
function getValue(object, key) {
|
|
return object == null ? void 0 : object[key];
|
|
}
|
|
function getNative(object, key) {
|
|
var value = getValue(object, key);
|
|
return baseIsNative(value) ? value : void 0;
|
|
}
|
|
var WeakMap$1 = getNative(root$1, "WeakMap");
|
|
var WeakMap$2 = WeakMap$1;
|
|
var objectCreate = Object.create;
|
|
var baseCreate = function() {
|
|
function object() {
|
|
}
|
|
return function(proto) {
|
|
if (!isObject(proto)) {
|
|
return {};
|
|
}
|
|
if (objectCreate) {
|
|
return objectCreate(proto);
|
|
}
|
|
object.prototype = proto;
|
|
var result = new object();
|
|
object.prototype = void 0;
|
|
return result;
|
|
};
|
|
}();
|
|
var baseCreate$1 = baseCreate;
|
|
function copyArray(source, array) {
|
|
var index = -1, length = source.length;
|
|
array || (array = Array(length));
|
|
while (++index < length) {
|
|
array[index] = source[index];
|
|
}
|
|
return array;
|
|
}
|
|
var defineProperty = function() {
|
|
try {
|
|
var func = getNative(Object, "defineProperty");
|
|
func({}, "", {});
|
|
return func;
|
|
} catch (e) {
|
|
}
|
|
}();
|
|
var defineProperty$1 = defineProperty;
|
|
function arrayEach(array, iteratee) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (iteratee(array[index], index, array) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
function isIndex(value, length) {
|
|
var type = typeof value;
|
|
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
}
|
|
function baseAssignValue(object, key, value) {
|
|
if (key == "__proto__" && defineProperty$1) {
|
|
defineProperty$1(object, key, {
|
|
"configurable": true,
|
|
"enumerable": true,
|
|
"value": value,
|
|
"writable": true
|
|
});
|
|
} else {
|
|
object[key] = value;
|
|
}
|
|
}
|
|
function eq(value, other) {
|
|
return value === other || value !== value && other !== other;
|
|
}
|
|
var objectProto$c = Object.prototype;
|
|
var hasOwnProperty$a = objectProto$c.hasOwnProperty;
|
|
function assignValue(object, key, value) {
|
|
var objValue = object[key];
|
|
if (!(hasOwnProperty$a.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
baseAssignValue(object, key, value);
|
|
}
|
|
}
|
|
function copyObject(source, props, object, customizer) {
|
|
var isNew = !object;
|
|
object || (object = {});
|
|
var index = -1, length = props.length;
|
|
while (++index < length) {
|
|
var key = props[index];
|
|
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
|
|
if (newValue === void 0) {
|
|
newValue = source[key];
|
|
}
|
|
if (isNew) {
|
|
baseAssignValue(object, key, newValue);
|
|
} else {
|
|
assignValue(object, key, newValue);
|
|
}
|
|
}
|
|
return object;
|
|
}
|
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
function isLength(value) {
|
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
}
|
|
function isArrayLike(value) {
|
|
return value != null && isLength(value.length) && !isFunction(value);
|
|
}
|
|
var objectProto$b = Object.prototype;
|
|
function isPrototype(value) {
|
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$b;
|
|
return value === proto;
|
|
}
|
|
function baseTimes(n, iteratee) {
|
|
var index = -1, result = Array(n);
|
|
while (++index < n) {
|
|
result[index] = iteratee(index);
|
|
}
|
|
return result;
|
|
}
|
|
var argsTag$3 = "[object Arguments]";
|
|
function baseIsArguments(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == argsTag$3;
|
|
}
|
|
var objectProto$a = Object.prototype;
|
|
var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
|
|
var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
|
|
var isArguments = baseIsArguments(function() {
|
|
return arguments;
|
|
}()) ? baseIsArguments : function(value) {
|
|
return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
};
|
|
var isArguments$1 = isArguments;
|
|
function stubFalse() {
|
|
return false;
|
|
}
|
|
var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
|
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0;
|
|
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
|
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
var isBuffer$1 = isBuffer;
|
|
var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
|
|
var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
|
|
var typedArrayTags = {};
|
|
typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
|
|
typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;
|
|
function baseIsTypedArray(value) {
|
|
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
}
|
|
function baseUnary(func) {
|
|
return function(value) {
|
|
return func(value);
|
|
};
|
|
}
|
|
var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
var freeProcess = moduleExports$1 && freeGlobal$1.process;
|
|
var nodeUtil = function() {
|
|
try {
|
|
var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
|
|
if (types) {
|
|
return types;
|
|
}
|
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
} catch (e) {
|
|
}
|
|
}();
|
|
var nodeUtil$1 = nodeUtil;
|
|
var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
|
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
var isTypedArray$1 = isTypedArray;
|
|
var objectProto$9 = Object.prototype;
|
|
var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
function arrayLikeKeys(value, inherited) {
|
|
var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
for (var key in value) {
|
|
if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
|
|
result.push(key);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function overArg(func, transform) {
|
|
return function(arg) {
|
|
return func(transform(arg));
|
|
};
|
|
}
|
|
var nativeKeys = overArg(Object.keys, Object);
|
|
var nativeKeys$1 = nativeKeys;
|
|
var objectProto$8 = Object.prototype;
|
|
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
function baseKeys(object) {
|
|
if (!isPrototype(object)) {
|
|
return nativeKeys$1(object);
|
|
}
|
|
var result = [];
|
|
for (var key in Object(object)) {
|
|
if (hasOwnProperty$7.call(object, key) && key != "constructor") {
|
|
result.push(key);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function keys(object) {
|
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
}
|
|
function nativeKeysIn(object) {
|
|
var result = [];
|
|
if (object != null) {
|
|
for (var key in Object(object)) {
|
|
result.push(key);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
var objectProto$7 = Object.prototype;
|
|
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
function baseKeysIn(object) {
|
|
if (!isObject(object)) {
|
|
return nativeKeysIn(object);
|
|
}
|
|
var isProto = isPrototype(object), result = [];
|
|
for (var key in object) {
|
|
if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object, key)))) {
|
|
result.push(key);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function keysIn(object) {
|
|
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
}
|
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
|
|
function isKey(value, object) {
|
|
if (isArray$1(value)) {
|
|
return false;
|
|
}
|
|
var type = typeof value;
|
|
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
return true;
|
|
}
|
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
}
|
|
var nativeCreate = getNative(Object, "create");
|
|
var nativeCreate$1 = nativeCreate;
|
|
function hashClear() {
|
|
this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
|
|
this.size = 0;
|
|
}
|
|
function hashDelete(key) {
|
|
var result = this.has(key) && delete this.__data__[key];
|
|
this.size -= result ? 1 : 0;
|
|
return result;
|
|
}
|
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
var objectProto$6 = Object.prototype;
|
|
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
function hashGet(key) {
|
|
var data = this.__data__;
|
|
if (nativeCreate$1) {
|
|
var result = data[key];
|
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
}
|
|
return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
|
|
}
|
|
var objectProto$5 = Object.prototype;
|
|
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
function hashHas(key) {
|
|
var data = this.__data__;
|
|
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
|
|
}
|
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
function hashSet(key, value) {
|
|
var data = this.__data__;
|
|
this.size += this.has(key) ? 0 : 1;
|
|
data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
|
|
return this;
|
|
}
|
|
function Hash(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
Hash.prototype.clear = hashClear;
|
|
Hash.prototype["delete"] = hashDelete;
|
|
Hash.prototype.get = hashGet;
|
|
Hash.prototype.has = hashHas;
|
|
Hash.prototype.set = hashSet;
|
|
function listCacheClear() {
|
|
this.__data__ = [];
|
|
this.size = 0;
|
|
}
|
|
function assocIndexOf(array, key) {
|
|
var length = array.length;
|
|
while (length--) {
|
|
if (eq(array[length][0], key)) {
|
|
return length;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
var arrayProto = Array.prototype;
|
|
var splice = arrayProto.splice;
|
|
function listCacheDelete(key) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
if (index < 0) {
|
|
return false;
|
|
}
|
|
var lastIndex = data.length - 1;
|
|
if (index == lastIndex) {
|
|
data.pop();
|
|
} else {
|
|
splice.call(data, index, 1);
|
|
}
|
|
--this.size;
|
|
return true;
|
|
}
|
|
function listCacheGet(key) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
return index < 0 ? void 0 : data[index][1];
|
|
}
|
|
function listCacheHas(key) {
|
|
return assocIndexOf(this.__data__, key) > -1;
|
|
}
|
|
function listCacheSet(key, value) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
if (index < 0) {
|
|
++this.size;
|
|
data.push([key, value]);
|
|
} else {
|
|
data[index][1] = value;
|
|
}
|
|
return this;
|
|
}
|
|
function ListCache(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
ListCache.prototype.clear = listCacheClear;
|
|
ListCache.prototype["delete"] = listCacheDelete;
|
|
ListCache.prototype.get = listCacheGet;
|
|
ListCache.prototype.has = listCacheHas;
|
|
ListCache.prototype.set = listCacheSet;
|
|
var Map$1 = getNative(root$1, "Map");
|
|
var Map$2 = Map$1;
|
|
function mapCacheClear() {
|
|
this.size = 0;
|
|
this.__data__ = {
|
|
"hash": new Hash(),
|
|
"map": new (Map$2 || ListCache)(),
|
|
"string": new Hash()
|
|
};
|
|
}
|
|
function isKeyable(value) {
|
|
var type = typeof value;
|
|
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
}
|
|
function getMapData(map, key) {
|
|
var data = map.__data__;
|
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
}
|
|
function mapCacheDelete(key) {
|
|
var result = getMapData(this, key)["delete"](key);
|
|
this.size -= result ? 1 : 0;
|
|
return result;
|
|
}
|
|
function mapCacheGet(key) {
|
|
return getMapData(this, key).get(key);
|
|
}
|
|
function mapCacheHas(key) {
|
|
return getMapData(this, key).has(key);
|
|
}
|
|
function mapCacheSet(key, value) {
|
|
var data = getMapData(this, key), size = data.size;
|
|
data.set(key, value);
|
|
this.size += data.size == size ? 0 : 1;
|
|
return this;
|
|
}
|
|
function MapCache(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
MapCache.prototype.clear = mapCacheClear;
|
|
MapCache.prototype["delete"] = mapCacheDelete;
|
|
MapCache.prototype.get = mapCacheGet;
|
|
MapCache.prototype.has = mapCacheHas;
|
|
MapCache.prototype.set = mapCacheSet;
|
|
var FUNC_ERROR_TEXT$2 = "Expected a function";
|
|
function memoize(func, resolver) {
|
|
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
throw new TypeError(FUNC_ERROR_TEXT$2);
|
|
}
|
|
var memoized = function() {
|
|
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
if (cache.has(key)) {
|
|
return cache.get(key);
|
|
}
|
|
var result = func.apply(this, args);
|
|
memoized.cache = cache.set(key, result) || cache;
|
|
return result;
|
|
};
|
|
memoized.cache = new (memoize.Cache || MapCache)();
|
|
return memoized;
|
|
}
|
|
memoize.Cache = MapCache;
|
|
var MAX_MEMOIZE_SIZE = 500;
|
|
function memoizeCapped(func) {
|
|
var result = memoize(func, function(key) {
|
|
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
cache.clear();
|
|
}
|
|
return key;
|
|
});
|
|
var cache = result.cache;
|
|
return result;
|
|
}
|
|
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
var reEscapeChar = /\\(\\)?/g;
|
|
var stringToPath = memoizeCapped(function(string) {
|
|
var result = [];
|
|
if (string.charCodeAt(0) === 46) {
|
|
result.push("");
|
|
}
|
|
string.replace(rePropName, function(match, number, quote, subString) {
|
|
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
});
|
|
return result;
|
|
});
|
|
var stringToPath$1 = stringToPath;
|
|
function toString(value) {
|
|
return value == null ? "" : baseToString(value);
|
|
}
|
|
function castPath(value, object) {
|
|
if (isArray$1(value)) {
|
|
return value;
|
|
}
|
|
return isKey(value, object) ? [value] : stringToPath$1(toString(value));
|
|
}
|
|
var INFINITY = 1 / 0;
|
|
function toKey(value) {
|
|
if (typeof value == "string" || isSymbol(value)) {
|
|
return value;
|
|
}
|
|
var result = value + "";
|
|
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
}
|
|
function baseGet(object, path) {
|
|
path = castPath(path, object);
|
|
var index = 0, length = path.length;
|
|
while (object != null && index < length) {
|
|
object = object[toKey(path[index++])];
|
|
}
|
|
return index && index == length ? object : void 0;
|
|
}
|
|
function get(object, path, defaultValue) {
|
|
var result = object == null ? void 0 : baseGet(object, path);
|
|
return result === void 0 ? defaultValue : result;
|
|
}
|
|
function arrayPush(array, values) {
|
|
var index = -1, length = values.length, offset = array.length;
|
|
while (++index < length) {
|
|
array[offset + index] = values[index];
|
|
}
|
|
return array;
|
|
}
|
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
var getPrototype$1 = getPrototype;
|
|
function stackClear() {
|
|
this.__data__ = new ListCache();
|
|
this.size = 0;
|
|
}
|
|
function stackDelete(key) {
|
|
var data = this.__data__, result = data["delete"](key);
|
|
this.size = data.size;
|
|
return result;
|
|
}
|
|
function stackGet(key) {
|
|
return this.__data__.get(key);
|
|
}
|
|
function stackHas(key) {
|
|
return this.__data__.has(key);
|
|
}
|
|
var LARGE_ARRAY_SIZE = 200;
|
|
function stackSet(key, value) {
|
|
var data = this.__data__;
|
|
if (data instanceof ListCache) {
|
|
var pairs = data.__data__;
|
|
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
pairs.push([key, value]);
|
|
this.size = ++data.size;
|
|
return this;
|
|
}
|
|
data = this.__data__ = new MapCache(pairs);
|
|
}
|
|
data.set(key, value);
|
|
this.size = data.size;
|
|
return this;
|
|
}
|
|
function Stack(entries) {
|
|
var data = this.__data__ = new ListCache(entries);
|
|
this.size = data.size;
|
|
}
|
|
Stack.prototype.clear = stackClear;
|
|
Stack.prototype["delete"] = stackDelete;
|
|
Stack.prototype.get = stackGet;
|
|
Stack.prototype.has = stackHas;
|
|
Stack.prototype.set = stackSet;
|
|
function baseAssign(object, source) {
|
|
return object && copyObject(source, keys(source), object);
|
|
}
|
|
function baseAssignIn(object, source) {
|
|
return object && copyObject(source, keysIn(source), object);
|
|
}
|
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
var Buffer2 = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
|
|
function cloneBuffer(buffer, isDeep) {
|
|
if (isDeep) {
|
|
return buffer.slice();
|
|
}
|
|
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
buffer.copy(result);
|
|
return result;
|
|
}
|
|
function arrayFilter(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (predicate(value, index, array)) {
|
|
result[resIndex++] = value;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function stubArray() {
|
|
return [];
|
|
}
|
|
var objectProto$4 = Object.prototype;
|
|
var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
|
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
|
|
if (object == null) {
|
|
return [];
|
|
}
|
|
object = Object(object);
|
|
return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
|
|
return propertyIsEnumerable.call(object, symbol);
|
|
});
|
|
};
|
|
var getSymbols$1 = getSymbols;
|
|
function copySymbols(source, object) {
|
|
return copyObject(source, getSymbols$1(source), object);
|
|
}
|
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
|
var result = [];
|
|
while (object) {
|
|
arrayPush(result, getSymbols$1(object));
|
|
object = getPrototype$1(object);
|
|
}
|
|
return result;
|
|
};
|
|
var getSymbolsIn$1 = getSymbolsIn;
|
|
function copySymbolsIn(source, object) {
|
|
return copyObject(source, getSymbolsIn$1(source), object);
|
|
}
|
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
var result = keysFunc(object);
|
|
return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
}
|
|
function getAllKeys(object) {
|
|
return baseGetAllKeys(object, keys, getSymbols$1);
|
|
}
|
|
function getAllKeysIn(object) {
|
|
return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
|
|
}
|
|
var DataView = getNative(root$1, "DataView");
|
|
var DataView$1 = DataView;
|
|
var Promise$1 = getNative(root$1, "Promise");
|
|
var Promise$2 = Promise$1;
|
|
var Set$1 = getNative(root$1, "Set");
|
|
var Set$2 = Set$1;
|
|
var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
|
|
var dataViewTag$3 = "[object DataView]";
|
|
var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$2), weakMapCtorString = toSource(WeakMap$2);
|
|
var getTag = baseGetTag;
|
|
if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3 || Map$2 && getTag(new Map$2()) != mapTag$4 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$2 && getTag(new Set$2()) != setTag$4 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag$1) {
|
|
getTag = function(value) {
|
|
var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
if (ctorString) {
|
|
switch (ctorString) {
|
|
case dataViewCtorString:
|
|
return dataViewTag$3;
|
|
case mapCtorString:
|
|
return mapTag$4;
|
|
case promiseCtorString:
|
|
return promiseTag;
|
|
case setCtorString:
|
|
return setTag$4;
|
|
case weakMapCtorString:
|
|
return weakMapTag$1;
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
var getTag$1 = getTag;
|
|
var objectProto$3 = Object.prototype;
|
|
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
function initCloneArray(array) {
|
|
var length = array.length, result = new array.constructor(length);
|
|
if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
|
|
result.index = array.index;
|
|
result.input = array.input;
|
|
}
|
|
return result;
|
|
}
|
|
var Uint8Array$1 = root$1.Uint8Array;
|
|
var Uint8Array$2 = Uint8Array$1;
|
|
function cloneArrayBuffer(arrayBuffer) {
|
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
new Uint8Array$2(result).set(new Uint8Array$2(arrayBuffer));
|
|
return result;
|
|
}
|
|
function cloneDataView(dataView, isDeep) {
|
|
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
}
|
|
var reFlags = /\w*$/;
|
|
function cloneRegExp(regexp) {
|
|
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
result.lastIndex = regexp.lastIndex;
|
|
return result;
|
|
}
|
|
var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
|
|
function cloneSymbol(symbol) {
|
|
return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
|
|
}
|
|
function cloneTypedArray(typedArray, isDeep) {
|
|
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
}
|
|
var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
|
|
var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
|
|
function initCloneByTag(object, tag, isDeep) {
|
|
var Ctor = object.constructor;
|
|
switch (tag) {
|
|
case arrayBufferTag$2:
|
|
return cloneArrayBuffer(object);
|
|
case boolTag$2:
|
|
case dateTag$2:
|
|
return new Ctor(+object);
|
|
case dataViewTag$2:
|
|
return cloneDataView(object, isDeep);
|
|
case float32Tag$1:
|
|
case float64Tag$1:
|
|
case int8Tag$1:
|
|
case int16Tag$1:
|
|
case int32Tag$1:
|
|
case uint8Tag$1:
|
|
case uint8ClampedTag$1:
|
|
case uint16Tag$1:
|
|
case uint32Tag$1:
|
|
return cloneTypedArray(object, isDeep);
|
|
case mapTag$3:
|
|
return new Ctor();
|
|
case numberTag$2:
|
|
case stringTag$2:
|
|
return new Ctor(object);
|
|
case regexpTag$2:
|
|
return cloneRegExp(object);
|
|
case setTag$3:
|
|
return new Ctor();
|
|
case symbolTag$2:
|
|
return cloneSymbol(object);
|
|
}
|
|
}
|
|
function initCloneObject(object) {
|
|
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {};
|
|
}
|
|
var mapTag$2 = "[object Map]";
|
|
function baseIsMap(value) {
|
|
return isObjectLike(value) && getTag$1(value) == mapTag$2;
|
|
}
|
|
var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
|
|
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
var isMap$1 = isMap;
|
|
var setTag$2 = "[object Set]";
|
|
function baseIsSet(value) {
|
|
return isObjectLike(value) && getTag$1(value) == setTag$2;
|
|
}
|
|
var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
|
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
var isSet$1 = isSet;
|
|
var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
|
|
var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
var cloneableTags = {};
|
|
cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
|
|
if (customizer) {
|
|
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
}
|
|
if (result !== void 0) {
|
|
return result;
|
|
}
|
|
if (!isObject(value)) {
|
|
return value;
|
|
}
|
|
var isArr = isArray$1(value);
|
|
if (isArr) {
|
|
result = initCloneArray(value);
|
|
if (!isDeep) {
|
|
return copyArray(value, result);
|
|
}
|
|
} else {
|
|
var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag;
|
|
if (isBuffer$1(value)) {
|
|
return cloneBuffer(value, isDeep);
|
|
}
|
|
if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
|
|
result = isFlat || isFunc ? {} : initCloneObject(value);
|
|
if (!isDeep) {
|
|
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
|
|
}
|
|
} else {
|
|
if (!cloneableTags[tag]) {
|
|
return object ? value : {};
|
|
}
|
|
result = initCloneByTag(value, tag, isDeep);
|
|
}
|
|
}
|
|
stack || (stack = new Stack());
|
|
var stacked = stack.get(value);
|
|
if (stacked) {
|
|
return stacked;
|
|
}
|
|
stack.set(value, result);
|
|
if (isSet$1(value)) {
|
|
value.forEach(function(subValue) {
|
|
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
|
});
|
|
} else if (isMap$1(value)) {
|
|
value.forEach(function(subValue, key2) {
|
|
result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
});
|
|
}
|
|
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
var props = isArr ? void 0 : keysFunc(value);
|
|
arrayEach(props || value, function(subValue, key2) {
|
|
if (props) {
|
|
key2 = subValue;
|
|
subValue = value[key2];
|
|
}
|
|
assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
});
|
|
return result;
|
|
}
|
|
var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
|
|
function cloneDeep(value) {
|
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
}
|
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
function setCacheAdd(value) {
|
|
this.__data__.set(value, HASH_UNDEFINED);
|
|
return this;
|
|
}
|
|
function setCacheHas(value) {
|
|
return this.__data__.has(value);
|
|
}
|
|
function SetCache(values) {
|
|
var index = -1, length = values == null ? 0 : values.length;
|
|
this.__data__ = new MapCache();
|
|
while (++index < length) {
|
|
this.add(values[index]);
|
|
}
|
|
}
|
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
SetCache.prototype.has = setCacheHas;
|
|
function arraySome(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (predicate(array[index], index, array)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function cacheHas(cache, key) {
|
|
return cache.has(key);
|
|
}
|
|
var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
|
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
|
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
return false;
|
|
}
|
|
var arrStacked = stack.get(array);
|
|
var othStacked = stack.get(other);
|
|
if (arrStacked && othStacked) {
|
|
return arrStacked == other && othStacked == array;
|
|
}
|
|
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
|
|
stack.set(array, other);
|
|
stack.set(other, array);
|
|
while (++index < arrLength) {
|
|
var arrValue = array[index], othValue = other[index];
|
|
if (customizer) {
|
|
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
}
|
|
if (compared !== void 0) {
|
|
if (compared) {
|
|
continue;
|
|
}
|
|
result = false;
|
|
break;
|
|
}
|
|
if (seen) {
|
|
if (!arraySome(other, function(othValue2, othIndex) {
|
|
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
return seen.push(othIndex);
|
|
}
|
|
})) {
|
|
result = false;
|
|
break;
|
|
}
|
|
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
result = false;
|
|
break;
|
|
}
|
|
}
|
|
stack["delete"](array);
|
|
stack["delete"](other);
|
|
return result;
|
|
}
|
|
function mapToArray(map) {
|
|
var index = -1, result = Array(map.size);
|
|
map.forEach(function(value, key) {
|
|
result[++index] = [key, value];
|
|
});
|
|
return result;
|
|
}
|
|
function setToArray(set) {
|
|
var index = -1, result = Array(set.size);
|
|
set.forEach(function(value) {
|
|
result[++index] = value;
|
|
});
|
|
return result;
|
|
}
|
|
var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
|
|
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
|
|
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
|
|
var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
switch (tag) {
|
|
case dataViewTag:
|
|
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
return false;
|
|
}
|
|
object = object.buffer;
|
|
other = other.buffer;
|
|
case arrayBufferTag:
|
|
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object), new Uint8Array$2(other))) {
|
|
return false;
|
|
}
|
|
return true;
|
|
case boolTag:
|
|
case dateTag:
|
|
case numberTag:
|
|
return eq(+object, +other);
|
|
case errorTag:
|
|
return object.name == other.name && object.message == other.message;
|
|
case regexpTag:
|
|
case stringTag:
|
|
return object == other + "";
|
|
case mapTag:
|
|
var convert = mapToArray;
|
|
case setTag:
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
|
|
convert || (convert = setToArray);
|
|
if (object.size != other.size && !isPartial) {
|
|
return false;
|
|
}
|
|
var stacked = stack.get(object);
|
|
if (stacked) {
|
|
return stacked == other;
|
|
}
|
|
bitmask |= COMPARE_UNORDERED_FLAG$2;
|
|
stack.set(object, other);
|
|
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
stack["delete"](object);
|
|
return result;
|
|
case symbolTag:
|
|
if (symbolValueOf) {
|
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
var objectProto$2 = Object.prototype;
|
|
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
if (objLength != othLength && !isPartial) {
|
|
return false;
|
|
}
|
|
var index = objLength;
|
|
while (index--) {
|
|
var key = objProps[index];
|
|
if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
|
|
return false;
|
|
}
|
|
}
|
|
var objStacked = stack.get(object);
|
|
var othStacked = stack.get(other);
|
|
if (objStacked && othStacked) {
|
|
return objStacked == other && othStacked == object;
|
|
}
|
|
var result = true;
|
|
stack.set(object, other);
|
|
stack.set(other, object);
|
|
var skipCtor = isPartial;
|
|
while (++index < objLength) {
|
|
key = objProps[index];
|
|
var objValue = object[key], othValue = other[key];
|
|
if (customizer) {
|
|
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
}
|
|
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
result = false;
|
|
break;
|
|
}
|
|
skipCtor || (skipCtor = key == "constructor");
|
|
}
|
|
if (result && !skipCtor) {
|
|
var objCtor = object.constructor, othCtor = other.constructor;
|
|
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
result = false;
|
|
}
|
|
}
|
|
stack["delete"](object);
|
|
stack["delete"](other);
|
|
return result;
|
|
}
|
|
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
var objectProto$1 = Object.prototype;
|
|
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
if (isSameTag && isBuffer$1(object)) {
|
|
if (!isBuffer$1(other)) {
|
|
return false;
|
|
}
|
|
objIsArr = true;
|
|
objIsObj = false;
|
|
}
|
|
if (isSameTag && !objIsObj) {
|
|
stack || (stack = new Stack());
|
|
return objIsArr || isTypedArray$1(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
}
|
|
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
|
|
if (objIsWrapped || othIsWrapped) {
|
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
stack || (stack = new Stack());
|
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
}
|
|
}
|
|
if (!isSameTag) {
|
|
return false;
|
|
}
|
|
stack || (stack = new Stack());
|
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
}
|
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
if (value === other) {
|
|
return true;
|
|
}
|
|
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
return value !== value && other !== other;
|
|
}
|
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
}
|
|
var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
|
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
if (object == null) {
|
|
return !length;
|
|
}
|
|
object = Object(object);
|
|
while (index--) {
|
|
var data = matchData[index];
|
|
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
return false;
|
|
}
|
|
}
|
|
while (++index < length) {
|
|
data = matchData[index];
|
|
var key = data[0], objValue = object[key], srcValue = data[1];
|
|
if (noCustomizer && data[2]) {
|
|
if (objValue === void 0 && !(key in object)) {
|
|
return false;
|
|
}
|
|
} else {
|
|
var stack = new Stack();
|
|
if (customizer) {
|
|
var result = customizer(objValue, srcValue, key, object, source, stack);
|
|
}
|
|
if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function isStrictComparable(value) {
|
|
return value === value && !isObject(value);
|
|
}
|
|
function getMatchData(object) {
|
|
var result = keys(object), length = result.length;
|
|
while (length--) {
|
|
var key = result[length], value = object[key];
|
|
result[length] = [key, value, isStrictComparable(value)];
|
|
}
|
|
return result;
|
|
}
|
|
function matchesStrictComparable(key, srcValue) {
|
|
return function(object) {
|
|
if (object == null) {
|
|
return false;
|
|
}
|
|
return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
|
|
};
|
|
}
|
|
function baseMatches(source) {
|
|
var matchData = getMatchData(source);
|
|
if (matchData.length == 1 && matchData[0][2]) {
|
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
}
|
|
return function(object) {
|
|
return object === source || baseIsMatch(object, source, matchData);
|
|
};
|
|
}
|
|
function baseHasIn(object, key) {
|
|
return object != null && key in Object(object);
|
|
}
|
|
function hasPath(object, path, hasFunc) {
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length, result = false;
|
|
while (++index < length) {
|
|
var key = toKey(path[index]);
|
|
if (!(result = object != null && hasFunc(object, key))) {
|
|
break;
|
|
}
|
|
object = object[key];
|
|
}
|
|
if (result || ++index != length) {
|
|
return result;
|
|
}
|
|
length = object == null ? 0 : object.length;
|
|
return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments$1(object));
|
|
}
|
|
function hasIn(object, path) {
|
|
return object != null && hasPath(object, path, baseHasIn);
|
|
}
|
|
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
function baseMatchesProperty(path, srcValue) {
|
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
}
|
|
return function(object) {
|
|
var objValue = get(object, path);
|
|
return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
};
|
|
}
|
|
function baseProperty(key) {
|
|
return function(object) {
|
|
return object == null ? void 0 : object[key];
|
|
};
|
|
}
|
|
function basePropertyDeep(path) {
|
|
return function(object) {
|
|
return baseGet(object, path);
|
|
};
|
|
}
|
|
function property(path) {
|
|
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
|
|
}
|
|
function baseIteratee(value) {
|
|
if (typeof value == "function") {
|
|
return value;
|
|
}
|
|
if (value == null) {
|
|
return identity;
|
|
}
|
|
if (typeof value == "object") {
|
|
return isArray$1(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
}
|
|
return property(value);
|
|
}
|
|
function arrayAggregator(array, setter, iteratee, accumulator) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
setter(accumulator, value, iteratee(value), array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function createBaseFor(fromRight) {
|
|
return function(object, iteratee, keysFunc) {
|
|
var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
|
|
while (length--) {
|
|
var key = props[fromRight ? length : ++index];
|
|
if (iteratee(iterable[key], key, iterable) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return object;
|
|
};
|
|
}
|
|
var baseFor = createBaseFor();
|
|
var baseFor$1 = baseFor;
|
|
function baseForOwn(object, iteratee) {
|
|
return object && baseFor$1(object, iteratee, keys);
|
|
}
|
|
function createBaseEach(eachFunc, fromRight) {
|
|
return function(collection, iteratee) {
|
|
if (collection == null) {
|
|
return collection;
|
|
}
|
|
if (!isArrayLike(collection)) {
|
|
return eachFunc(collection, iteratee);
|
|
}
|
|
var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
|
|
while (fromRight ? index-- : ++index < length) {
|
|
if (iteratee(iterable[index], index, iterable) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return collection;
|
|
};
|
|
}
|
|
var baseEach = createBaseEach(baseForOwn);
|
|
var baseEach$1 = baseEach;
|
|
function baseAggregator(collection, setter, iteratee, accumulator) {
|
|
baseEach$1(collection, function(value, key, collection2) {
|
|
setter(accumulator, value, iteratee(value), collection2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function createAggregator(setter, initializer) {
|
|
return function(collection, iteratee) {
|
|
var func = isArray$1(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
|
|
return func(collection, setter, baseIteratee(iteratee), accumulator);
|
|
};
|
|
}
|
|
var now = function() {
|
|
return root$1.Date.now();
|
|
};
|
|
var now$1 = now;
|
|
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
var nativeMax = Math.max, nativeMin = Math.min;
|
|
function debounce(func, wait, options) {
|
|
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
if (typeof func != "function") {
|
|
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
}
|
|
wait = toNumber(wait) || 0;
|
|
if (isObject(options)) {
|
|
leading = !!options.leading;
|
|
maxing = "maxWait" in options;
|
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
}
|
|
function invokeFunc(time) {
|
|
var args = lastArgs, thisArg = lastThis;
|
|
lastArgs = lastThis = void 0;
|
|
lastInvokeTime = time;
|
|
result = func.apply(thisArg, args);
|
|
return result;
|
|
}
|
|
function leadingEdge(time) {
|
|
lastInvokeTime = time;
|
|
timerId = setTimeout(timerExpired, wait);
|
|
return leading ? invokeFunc(time) : result;
|
|
}
|
|
function remainingWait(time) {
|
|
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
}
|
|
function shouldInvoke(time) {
|
|
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
}
|
|
function timerExpired() {
|
|
var time = now$1();
|
|
if (shouldInvoke(time)) {
|
|
return trailingEdge(time);
|
|
}
|
|
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
}
|
|
function trailingEdge(time) {
|
|
timerId = void 0;
|
|
if (trailing && lastArgs) {
|
|
return invokeFunc(time);
|
|
}
|
|
lastArgs = lastThis = void 0;
|
|
return result;
|
|
}
|
|
function cancel2() {
|
|
if (timerId !== void 0) {
|
|
clearTimeout(timerId);
|
|
}
|
|
lastInvokeTime = 0;
|
|
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
}
|
|
function flush() {
|
|
return timerId === void 0 ? result : trailingEdge(now$1());
|
|
}
|
|
function debounced() {
|
|
var time = now$1(), isInvoking = shouldInvoke(time);
|
|
lastArgs = arguments;
|
|
lastThis = this;
|
|
lastCallTime = time;
|
|
if (isInvoking) {
|
|
if (timerId === void 0) {
|
|
return leadingEdge(lastCallTime);
|
|
}
|
|
if (maxing) {
|
|
clearTimeout(timerId);
|
|
timerId = setTimeout(timerExpired, wait);
|
|
return invokeFunc(lastCallTime);
|
|
}
|
|
}
|
|
if (timerId === void 0) {
|
|
timerId = setTimeout(timerExpired, wait);
|
|
}
|
|
return result;
|
|
}
|
|
debounced.cancel = cancel2;
|
|
debounced.flush = flush;
|
|
return debounced;
|
|
}
|
|
var objectProto = Object.prototype;
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
var groupBy = createAggregator(function(result, value, key) {
|
|
if (hasOwnProperty.call(result, key)) {
|
|
result[key].push(value);
|
|
} else {
|
|
baseAssignValue(result, key, [value]);
|
|
}
|
|
});
|
|
var groupBy$1 = groupBy;
|
|
function isEqual(value, other) {
|
|
return baseIsEqual(value, other);
|
|
}
|
|
var FUNC_ERROR_TEXT = "Expected a function";
|
|
function throttle(func, wait, options) {
|
|
var leading = true, trailing = true;
|
|
if (typeof func != "function") {
|
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
}
|
|
if (isObject(options)) {
|
|
leading = "leading" in options ? !!options.leading : leading;
|
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
}
|
|
return debounce(func, wait, {
|
|
"leading": leading,
|
|
"maxWait": wait,
|
|
"trailing": trailing
|
|
});
|
|
}
|
|
const EVENT_PHASES = [
|
|
"onBefore",
|
|
"onNow",
|
|
"onAfter"
|
|
];
|
|
const sortTasksByPriority = (tasks) => [...tasks].sort((a, b) => {
|
|
var _a, _b;
|
|
return (((_a = b.meta) == null ? void 0 : _a.priority) || 0) - (((_b = a.meta) == null ? void 0 : _b.priority) || 0);
|
|
});
|
|
async function runEventPipeline(options) {
|
|
var _a, _b, _c;
|
|
const {
|
|
tasks,
|
|
rowId,
|
|
type,
|
|
fire,
|
|
initial,
|
|
extra = [],
|
|
phases = EVENT_PHASES,
|
|
rerunOnAfterFalsy = false,
|
|
maxRerun = 10
|
|
} = options;
|
|
const grouped = groupBy$1(
|
|
sortTasksByPriority(tasks),
|
|
(task) => {
|
|
var _a2, _b2;
|
|
return (_b2 = (_a2 = task.meta) == null ? void 0 : _a2.es) != null ? _b2 : "onNow";
|
|
}
|
|
);
|
|
let current = initial !== void 0 ? initial : rowId;
|
|
let rerun = 0;
|
|
for (let i = 0; i < phases.length; i++) {
|
|
const phase = phases[i];
|
|
const phaseTasks = (_a = grouped[phase]) != null ? _a : [];
|
|
for (const task of phaseTasks) {
|
|
current = await ((_b = task.event) == null ? void 0 : _b.call(task, rowId, current, task.meta, ...extra));
|
|
}
|
|
current = await fire(current, type, phase, (_c = phaseTasks[0]) == null ? void 0 : _c.meta);
|
|
if (rerunOnAfterFalsy && phase === "onAfter" && !current) {
|
|
if (++rerun > maxRerun) {
|
|
console.warn(
|
|
`[funjiaui] \u4E8B\u4EF6\u94FE\u5728 onAfter \u9636\u6BB5\u8FDE\u7EED ${maxRerun} \u6B21\u8FD4\u56DE\u7A7A\u503C\uFF0C\u5DF2\u4E2D\u6B62\u4EE5\u907F\u514D\u6B7B\u5FAA\u73AF`
|
|
);
|
|
break;
|
|
}
|
|
i = -1;
|
|
}
|
|
}
|
|
return current;
|
|
}
|
|
const collectDataColumns = (target) => scanDecoratedMembers(target, "table:field").map((member) => ({
|
|
sort: member.meta.sort || 1,
|
|
vnode: h(_sfc_main$e, {
|
|
prop: member.fieldName,
|
|
label: member.meta.def,
|
|
fieldType: member.meta.fieldType,
|
|
width: member.meta.width,
|
|
minWidth: member.meta.minWidth,
|
|
columnRender: member.meta.columnRender,
|
|
isShow: member.meta.isShow,
|
|
showOverflowTooltip: member.meta.showOverflowTooltip,
|
|
dateFormat: member.meta.dateFormat
|
|
})
|
|
})).sort((a, b) => a.sort - b.sort).map((item) => item.vnode);
|
|
const collectOperateGroups = (target) => {
|
|
var _a;
|
|
const groups = /* @__PURE__ */ new Map();
|
|
for (const member of scanDecoratedMembers(target, "table:operate", {
|
|
methods: true
|
|
})) {
|
|
const meta = member.meta;
|
|
const key = String((_a = meta.id) != null ? _a : meta.type);
|
|
let group = groups.get(key);
|
|
if (!group) {
|
|
group = { type: meta.type, tasks: [] };
|
|
groups.set(key, group);
|
|
}
|
|
group.tasks.push({ event: member.value, meta });
|
|
if (group.sort === void 0 && !isEmpty(meta.sort)) {
|
|
group.sort = meta.sort;
|
|
}
|
|
if (group.title === void 0 && meta.title !== void 0) {
|
|
group.title = meta.title;
|
|
}
|
|
if (group.isShow === void 0 && meta.isShow !== void 0) {
|
|
group.isShow = meta.isShow;
|
|
}
|
|
}
|
|
return [...groups.values()].map((group) => {
|
|
var _a2;
|
|
return {
|
|
type: group.type,
|
|
sort: (_a2 = group.sort) != null ? _a2 : 0,
|
|
title: group.title,
|
|
isShow: group.isShow,
|
|
tasks: group.tasks
|
|
};
|
|
});
|
|
};
|
|
const resolveShowOperate = (target, hasOperate) => {
|
|
var _a;
|
|
if (!hasOperate)
|
|
return false;
|
|
const instance = createTargetInstance(target);
|
|
const flag = (_a = instance.isShowOperate) != null ? _a : target == null ? void 0 : target.isShowOperate;
|
|
if (flag === void 0 || flag === null)
|
|
return true;
|
|
return typeof flag === "function" ? !!flag.call(instance) : !!flag;
|
|
};
|
|
const resolveOperateWidth = (target, fallback = "120px") => {
|
|
var _a, _b;
|
|
const instance = createTargetInstance(target);
|
|
return (_b = (_a = instance.operateWidth) != null ? _a : target == null ? void 0 : target.operateWidth) != null ? _b : fallback;
|
|
};
|
|
const isDeferredAfter = (type, deferred) => !!(deferred == null ? void 0 : deferred.some((item) => item === type));
|
|
const withoutDeferredAfter = (tasks, deferred) => tasks.filter(
|
|
(task) => {
|
|
var _a, _b;
|
|
return !(((_a = task.meta) == null ? void 0 : _a.es) === "onAfter" && isDeferredAfter(String((_b = task.meta) == null ? void 0 : _b.type), deferred));
|
|
}
|
|
);
|
|
const DEFERRED_PHASES = ["onBefore", "onNow"];
|
|
const DEFAULT_DEFER_TYPES = [
|
|
"\u6DFB\u52A0",
|
|
"edit",
|
|
"del",
|
|
"\u6279\u91CF\u5220\u9664"
|
|
];
|
|
const buildOperateColumn = (groups, options) => {
|
|
if (!groups.length)
|
|
return null;
|
|
const {
|
|
fire,
|
|
tableData = [],
|
|
width = "120px",
|
|
deferAfterTypes
|
|
} = options;
|
|
const operateItems = [...groups].sort((a, b) => a.sort - b.sort).map((group) => ({
|
|
type: group.type,
|
|
title: group.title,
|
|
isShow: group.isShow,
|
|
onClick: (rowId, rowData) => runEventPipeline({
|
|
tasks: withoutDeferredAfter(group.tasks, deferAfterTypes),
|
|
rowId,
|
|
type: group.type,
|
|
fire,
|
|
initial: rowData,
|
|
extra: [tableData],
|
|
phases: isDeferredAfter(String(group.type), deferAfterTypes) ? DEFERRED_PHASES : void 0
|
|
})
|
|
}));
|
|
return h(_sfc_main$e, {
|
|
type: "operate",
|
|
label: "\u64CD\u4F5C",
|
|
operateItems,
|
|
width
|
|
});
|
|
};
|
|
const collectTypedTasks = (target, decoratorKey, type) => sortTasksByPriority(
|
|
scanDecoratedMembers(target, decoratorKey, {
|
|
methods: true
|
|
}).filter((member) => member.meta.type === type).map((member) => ({ event: member.value, meta: member.meta }))
|
|
);
|
|
const collectToolbar = (target, fire, options = {}) => {
|
|
var _a;
|
|
const groups = /* @__PURE__ */ new Map();
|
|
for (const member of scanDecoratedMembers(target, "table:toolbar", {
|
|
methods: true
|
|
})) {
|
|
const meta = member.meta;
|
|
if (meta.isShow && !meta.isShow(void 0))
|
|
continue;
|
|
const type = meta.type;
|
|
const tasks = (_a = groups.get(type)) != null ? _a : [];
|
|
tasks.push({ event: member.value, meta });
|
|
groups.set(type, tasks);
|
|
}
|
|
const toolbars = [];
|
|
const events = [];
|
|
groups.forEach((tasks, type) => {
|
|
var _a2, _b, _c, _d;
|
|
toolbars.push({
|
|
type,
|
|
icon: (_b = (_a2 = tasks[0]) == null ? void 0 : _a2.meta) == null ? void 0 : _b.icon,
|
|
title: (_d = (_c = tasks[0]) == null ? void 0 : _c.meta) == null ? void 0 : _d.title
|
|
});
|
|
const pipelineTasks = withoutDeferredAfter(tasks, options.deferAfterTypes);
|
|
events.push(
|
|
(rowId) => runEventPipeline({
|
|
tasks: pipelineTasks,
|
|
rowId: rowId != null ? rowId : "",
|
|
type,
|
|
fire,
|
|
phases: isDeferredAfter(String(type), options.deferAfterTypes) ? DEFERRED_PHASES : void 0
|
|
})
|
|
);
|
|
});
|
|
return { toolbars, events };
|
|
};
|
|
const TOOLBAR_TYPE_SET = {
|
|
\u6DFB\u52A0: true,
|
|
"\u5BFC\u5165\u6A21\u677F": true,
|
|
\u5BFC\u5165: true,
|
|
\u5BFC\u51FA: true,
|
|
"\u6279\u91CF\u5220\u9664": true,
|
|
\u81EA\u5B9A\u4E49: true
|
|
};
|
|
const OPERATE_TYPE_SET = {
|
|
edit: true,
|
|
del: true,
|
|
copy: true,
|
|
customOperateEvent: true
|
|
};
|
|
const FIELD_TYPE_SET = {
|
|
date: true,
|
|
default: true,
|
|
upload: true,
|
|
primaryKey: true,
|
|
treeSelect: true,
|
|
areaTreeSelect: true,
|
|
select: true,
|
|
switch: true,
|
|
boolean: true,
|
|
img: true,
|
|
pickerMapGps: true,
|
|
pickerMapGpsRange: true,
|
|
ip: true,
|
|
port: true,
|
|
string: true,
|
|
textarea: true,
|
|
input: true,
|
|
password: true,
|
|
custom: true,
|
|
number: true,
|
|
dateRange: true
|
|
};
|
|
const FORM_UNIMPLEMENTED = /* @__PURE__ */ new Set([
|
|
"img",
|
|
"pickerMapGps",
|
|
"pickerMapGpsRange",
|
|
"areaTreeSelect",
|
|
"custom"
|
|
]);
|
|
const SEARCH_SUPPORTED = /* @__PURE__ */ new Set([
|
|
"select",
|
|
"dateRange",
|
|
"date-picker",
|
|
"dateTime-picker",
|
|
"switch",
|
|
"textarea",
|
|
"input"
|
|
]);
|
|
const SEARCH_TEXT_OK = /* @__PURE__ */ new Set(["input", "textarea", "string", "ip", "port"]);
|
|
const has = (set, value) => typeof value === "string" && Object.prototype.hasOwnProperty.call(set, value);
|
|
const METHOD_KEYS = [
|
|
"table:operate",
|
|
"table:toolbar",
|
|
"table:searchFormMethod"
|
|
];
|
|
const FIELD_KEYS = [
|
|
"table:field",
|
|
"table:formField",
|
|
"table:searchFormField"
|
|
];
|
|
const readMemberMetas = (target) => collectClassMembers(target).map((member) => {
|
|
const entry = { member, methods: {}, fields: {} };
|
|
const keys2 = member.isMethod ? METHOD_KEYS : FIELD_KEYS;
|
|
for (const key of keys2) {
|
|
if (member.isMethod) {
|
|
const meta = getMemberMeta(target, key, member);
|
|
if (meta)
|
|
entry.methods[key] = meta;
|
|
} else {
|
|
const meta = getMemberMeta(target, key, member);
|
|
if (meta)
|
|
entry.fields[key] = meta;
|
|
}
|
|
}
|
|
return entry;
|
|
});
|
|
const diagnoseTarget = (target, options = {}) => {
|
|
var _a, _b;
|
|
const list = [];
|
|
const push = (d) => list.push(d);
|
|
if (!target) {
|
|
push({
|
|
level: "error",
|
|
code: "target-missing",
|
|
message: "\u6CA1\u6709\u62FF\u5230\u914D\u7F6E\u7C7B\uFF08target \u4E3A\u7A7A\uFF09",
|
|
hint: '\u7ED9 <um-by-class> / <um-by-class-enhance> \u4F20 :target="YourViewModel"'
|
|
});
|
|
return list;
|
|
}
|
|
const entries = readMemberMetas(target);
|
|
const deferTypes = new Set((_a = options.deferAfterTypes) != null ? _a : DEFAULT_DEFER_TYPES);
|
|
const byType = /* @__PURE__ */ new Map();
|
|
for (const entry of entries) {
|
|
for (const [dKey, meta] of Object.entries(entry.methods)) {
|
|
const member = entry.member.key;
|
|
const type = String(meta.type);
|
|
if (!EVENT_PHASES.includes(meta.es)) {
|
|
push({
|
|
level: "error",
|
|
code: "invalid-execution-sequence",
|
|
member,
|
|
message: `es: ${JSON.stringify(meta.es)} \u4E0D\u662F\u5408\u6CD5\u7684\u6267\u884C\u9636\u6BB5`,
|
|
hint: `\u53EA\u80FD\u662F ${EVENT_PHASES.map((p) => `"${p}"`).join(" / ")}\uFF1B\u5199\u9519\u7684\u65B9\u6CD5\u4E0D\u4F1A\u88AB\u6267\u884C`
|
|
});
|
|
}
|
|
if (dKey === "table:searchFormMethod") {
|
|
if (type !== "getList") {
|
|
push({
|
|
level: "error",
|
|
code: "unknown-method-type",
|
|
member,
|
|
message: `\u67E5\u8BE2\u65B9\u6CD5\u7684 type \u5FC5\u987B\u662F "getList"\uFF0C\u5F53\u524D\u662F ${JSON.stringify(meta.type)}`,
|
|
hint: '\u67E5\u5217\u8868\u53EA\u8BA4 type: "getList"\uFF0C\u4E14\u88C5\u9970\u5668\u7684 key \u5FC5\u987B\u662F "table:searchFormMethod"'
|
|
});
|
|
}
|
|
} else if (dKey === "table:toolbar") {
|
|
if (!has(TOOLBAR_TYPE_SET, type)) {
|
|
push(
|
|
has(OPERATE_TYPE_SET, type) ? {
|
|
level: "error",
|
|
code: "operate-type-in-toolbar",
|
|
member,
|
|
message: `"${type}" \u662F\u64CD\u4F5C\u5217\u6309\u94AE\u7C7B\u578B\uFF0C\u5374\u58F0\u660E\u5728\u4E86\u5DE5\u5177\u680F\u4E0A`,
|
|
hint: '\u5DE5\u5177\u680F\u6309\u94AE\u7528 type: "\u6DFB\u52A0" / "\u5BFC\u51FA" / "\u6279\u91CF\u5220\u9664" / "\u81EA\u5B9A\u4E49" \u7B49'
|
|
} : {
|
|
level: "error",
|
|
code: "unknown-method-type",
|
|
member,
|
|
message: `\u5DE5\u5177\u680F\u4E0A\u6CA1\u6709 ${JSON.stringify(meta.type)} \u8FD9\u79CD\u6309\u94AE`,
|
|
hint: `\u53EF\u7528\uFF1A${Object.keys(TOOLBAR_TYPE_SET).join(" / ")}`
|
|
}
|
|
);
|
|
}
|
|
} else {
|
|
if (!has(OPERATE_TYPE_SET, type)) {
|
|
push(
|
|
has(TOOLBAR_TYPE_SET, type) ? {
|
|
level: "error",
|
|
code: "toolbar-type-in-operate",
|
|
member,
|
|
message: `"${type}" \u662F\u5DE5\u5177\u680F\u6309\u94AE\u7C7B\u578B\uFF0C\u4F46\u6CA1\u6709\u6307\u5B9A key\uFF0C\u4E8E\u662F\u88AB\u5F53\u6210\u4E86\u64CD\u4F5C\u5217\u6309\u94AE`,
|
|
hint: `\u8865\u4E0A key: "table:toolbar"\uFF0C\u5426\u5219\u5B83\u4F1A\u5728\u6BCF\u4E00\u884C\u672B\u5C3E\u591A\u51FA\u4E00\u4E2A\u6309\u94AE\uFF0C\u800C\u5DE5\u5177\u680F\u662F\u7A7A\u7684`
|
|
} : {
|
|
level: "error",
|
|
code: "unknown-method-type",
|
|
member,
|
|
message: `\u64CD\u4F5C\u5217\u4E0A\u6CA1\u6709 ${JSON.stringify(meta.type)} \u8FD9\u79CD\u6309\u94AE`,
|
|
hint: `\u53EF\u7528\uFF1A${Object.keys(OPERATE_TYPE_SET).join(" / ")}`
|
|
}
|
|
);
|
|
}
|
|
}
|
|
if (dKey !== "table:searchFormMethod") {
|
|
const bucket = (_b = byType.get(type)) != null ? _b : [];
|
|
bucket.push(meta);
|
|
byType.set(type, bucket);
|
|
}
|
|
}
|
|
}
|
|
byType.forEach((metas, type) => {
|
|
const declaresDialog = metas.some(
|
|
(meta) => meta.dialogContent !== void 0 || meta.dialogTitle !== void 0
|
|
);
|
|
if (!declaresDialog && !deferTypes.has(type))
|
|
return;
|
|
if (metas.some((meta) => meta.es === "onAfter"))
|
|
return;
|
|
push({
|
|
level: declaresDialog ? "error" : "warn",
|
|
code: "dialog-without-submit",
|
|
member: `type "${type}"`,
|
|
message: `\u300C${type}\u300D\u4F1A\u5F39\u7A97\uFF0C\u4F46\u6CA1\u6709\u4EFB\u4F55 es: "onAfter" \u7684\u65B9\u6CD5\uFF0C\u7528\u6237\u5728\u5F39\u7A97\u4E0A\u70B9\u786E\u5B9A\u540E\u4EC0\u4E48\u90FD\u4E0D\u4F1A\u53D1\u751F`,
|
|
hint: '\u628A\u771F\u6B63\u8C03\u63A5\u53E3\u7684\u90A3\u4E2A\u65B9\u6CD5\u6807\u4E0A es: "onAfter"'
|
|
});
|
|
});
|
|
const columns = [];
|
|
const formFields = /* @__PURE__ */ new Map();
|
|
const searchFields = [];
|
|
for (const entry of entries) {
|
|
const columnMeta = entry.fields["table:field"];
|
|
if (columnMeta) {
|
|
columns.push({
|
|
key: entry.member.key,
|
|
fieldName: entry.member.fieldName,
|
|
meta: columnMeta
|
|
});
|
|
}
|
|
const formMeta = entry.fields["table:formField"];
|
|
if (formMeta)
|
|
formFields.set(entry.member.fieldName, formMeta);
|
|
const searchMeta = entry.fields["table:searchFormField"];
|
|
if (searchMeta)
|
|
searchFields.push({ key: entry.member.key, meta: searchMeta });
|
|
for (const [dKey, meta] of Object.entries(entry.fields)) {
|
|
if (meta.fieldType && !has(FIELD_TYPE_SET, meta.fieldType)) {
|
|
push({
|
|
level: "warn",
|
|
code: "unknown-field-type",
|
|
member: `${entry.member.key}\uFF08${dKey}\uFF09`,
|
|
message: `fieldType: ${JSON.stringify(meta.fieldType)} \u4E0D\u662F\u5408\u6CD5\u7684\u5B57\u6BB5\u7C7B\u578B\uFF0C\u4F1A\u88AB\u5F53\u6210\u9ED8\u8BA4\u7C7B\u578B\u5904\u7406`,
|
|
hint: `\u5408\u6CD5\u503C\uFF1A${Object.keys(FIELD_TYPE_SET).join(" / ")}`
|
|
});
|
|
}
|
|
}
|
|
if ((formMeta == null ? void 0 : formMeta.fieldType) && FORM_UNIMPLEMENTED.has(formMeta.fieldType) && !formMeta.component) {
|
|
push({
|
|
level: "warn",
|
|
code: "form-field-type-unimplemented",
|
|
member: entry.member.key,
|
|
message: `\u8868\u5355\u6CA1\u6709\u4E3A fieldType: "${formMeta.fieldType}" \u5B9E\u73B0\u63A7\u4EF6\uFF0C\u5B83\u4F1A\u9000\u5316\u6210\u6587\u672C\u6846`,
|
|
hint: "\u6539\u7528 input / select / date \u7B49\u5DF2\u5B9E\u73B0\u7684\u7C7B\u578B\uFF0C\u6216\u4F20 component \u6307\u5B9A\u81EA\u5B9A\u4E49\u7EC4\u4EF6"
|
|
});
|
|
}
|
|
}
|
|
const columnDefs = /* @__PURE__ */ new Map();
|
|
for (const column of columns) {
|
|
const def = column.meta.def;
|
|
if (!def) {
|
|
push({
|
|
level: "warn",
|
|
code: "column-def-missing",
|
|
member: column.key,
|
|
message: "\u6570\u636E\u5217\u7F3A\u5C11 def\uFF0C\u5217\u5934\u4F1A\u662F\u7A7A\u7684",
|
|
hint: "def \u662F\u5217\u5934\u6587\u6848\uFF0C\u5FC5\u586B"
|
|
});
|
|
} else if (columnDefs.has(def)) {
|
|
push({
|
|
level: "warn",
|
|
code: "column-def-duplicated",
|
|
member: column.key,
|
|
message: `\u5217\u5934"${def}"\u548C ${columnDefs.get(def)} \u91CD\u590D`,
|
|
hint: "\u591A\u4E3A\u590D\u5236\u7C98\u8D34\u540E\u5FD8\u4E86\u6539 def\uFF0C\u4E24\u5217\u90FD\u4F1A\u9876\u7740\u540C\u4E00\u4E2A\u8868\u5934"
|
|
});
|
|
} else {
|
|
columnDefs.set(def, column.key);
|
|
}
|
|
}
|
|
if (columns.length === 0) {
|
|
push({
|
|
level: "warn",
|
|
code: "no-data-column",
|
|
message: "\u6CA1\u6709\u4EFB\u4F55\u6570\u636E\u5217",
|
|
hint: "\u68C0\u67E5 @TableColumnPropertyDecorator \u662F\u5426\u6302\u5728\u4E86\u7C7B\u7684\u5C5E\u6027\u4E0A\uFF08\u800C\u4E0D\u662F\u9759\u6001\u5C5E\u6027 / \u6784\u9020\u51FD\u6570\u91CC\uFF09"
|
|
});
|
|
}
|
|
const hasFormSubmit = byType.has("edit") || byType.has("\u6DFB\u52A0");
|
|
const primaryKeys = columns.filter(
|
|
(column) => column.meta.fieldType === "primaryKey"
|
|
);
|
|
if (hasFormSubmit) {
|
|
for (const primaryKey of primaryKeys) {
|
|
if (formFields.has(primaryKey.fieldName))
|
|
continue;
|
|
push({
|
|
level: "warn",
|
|
code: "primary-key-not-in-form",
|
|
member: primaryKey.key,
|
|
message: `\u4E3B\u952E"${primaryKey.meta.def || primaryKey.fieldName}"\u6CA1\u6709\u6302\u8868\u5355\u88C5\u9970\u5668\uFF0C\u63D0\u4EA4\u8F7D\u8377\u91CC\u4E0D\u4F1A\u6709\u5B83`,
|
|
hint: `\u8865 @TableFormColumnPropertyDecorator({ def: "ID", fieldType: "primaryKey" })\uFF1B\u5426\u5219\u66F4\u65B0\u63A5\u53E3\u6309\u4E3B\u952E\u67E5\u4E0D\u5230\u8BB0\u5F55`
|
|
});
|
|
}
|
|
if (primaryKeys.length === 0) {
|
|
push({
|
|
level: "warn",
|
|
code: "edit-without-primary-key",
|
|
message: '\u7C7B\u91CC\u6709"\u7F16\u8F91"\u6216"\u6DFB\u52A0"\u6309\u94AE\uFF0C\u4F46\u627E\u4E0D\u5230\u4EFB\u4F55 fieldType: "primaryKey" \u7684\u5217',
|
|
hint: "\u8868\u5355\u63D0\u4EA4\u9700\u8981\u4E3B\u952E\u624D\u80FD\u5B9A\u4F4D\u8BB0\u5F55\uFF08\u65B0\u589E\u65E0\u9700\u4E3B\u952E\u5219\u5E94\u663E\u5F0F\u58F0\u660E\u4E00\u4E2A\uFF09"
|
|
});
|
|
}
|
|
}
|
|
for (const { key, meta } of searchFields) {
|
|
const control = meta.$um_component || meta.fieldType;
|
|
if (!control)
|
|
continue;
|
|
if (SEARCH_SUPPORTED.has(control) || SEARCH_TEXT_OK.has(control))
|
|
continue;
|
|
push({
|
|
level: "warn",
|
|
code: "unsupported-search-control",
|
|
member: key,
|
|
message: `\u67E5\u8BE2\u8868\u5355\u6CA1\u6709\u5B9E\u73B0 ${JSON.stringify(control)} \u63A7\u4EF6\uFF0C\u5B83\u4F1A\u6E32\u67D3\u6210\u4E00\u4E2A\u666E\u901A\u8F93\u5165\u6846`,
|
|
hint: `\u76EE\u524D\u53EF\u7528\uFF1A${[...SEARCH_SUPPORTED].join(" / ")}`
|
|
});
|
|
}
|
|
if (options.requireGetList && !entries.some((entry) => entry.methods["table:searchFormMethod"])) {
|
|
push({
|
|
level: "warn",
|
|
code: "missing-get-list",
|
|
message: "\u627E\u4E0D\u5230\u5217\u8868\u67E5\u8BE2\u65B9\u6CD5\uFF0C\u8868\u683C\u4E0D\u4F1A\u6709\u6570\u636E",
|
|
hint: '@TableColumnMethodDecorator({ key: "table:searchFormMethod", value: { type: "getList" } })'
|
|
});
|
|
}
|
|
const weight = { error: 0, warn: 1 };
|
|
return list.sort(
|
|
(a, b) => {
|
|
var _a2, _b2;
|
|
return weight[a.level] - weight[b.level] || String((_a2 = a.member) != null ? _a2 : "").localeCompare(String((_b2 = b.member) != null ? _b2 : ""));
|
|
}
|
|
);
|
|
};
|
|
let diagnosticsEnabled = true;
|
|
const setDiagnosticsEnabled = (enabled) => {
|
|
diagnosticsEnabled = enabled;
|
|
};
|
|
const isDiagnosticsEnabled = () => diagnosticsEnabled;
|
|
const reportDiagnostics = (target, options = {}) => {
|
|
const list = diagnoseTarget(target, options);
|
|
if (!list.length)
|
|
return list;
|
|
const errors = list.filter((item) => item.level === "error");
|
|
const warns = list.filter((item) => item.level === "warn");
|
|
const name = (target == null ? void 0 : target.name) || "\u914D\u7F6E\u7C7B";
|
|
console.groupCollapsed(
|
|
`[funjiaui] \u914D\u7F6E\u4F53\u68C0 \xB7 ${name} \xB7 ${errors.length} \u4E2A\u9519\u8BEF / ${warns.length} \u4E2A\u8B66\u544A`
|
|
);
|
|
for (const item of list) {
|
|
const text = `[${item.code}] ${item.member ? item.member + " \u2014 " : ""}${item.message}${item.hint ? "\n \u2192 " + item.hint : ""}`;
|
|
if (item.level === "error")
|
|
console.error(text);
|
|
else
|
|
console.warn(text);
|
|
}
|
|
console.groupEnd();
|
|
return list;
|
|
};
|
|
const reportedTargets = /* @__PURE__ */ new WeakSet();
|
|
const reportDiagnosticsOnce = (target, options = {}) => {
|
|
if (!diagnosticsEnabled || options.enabled === false)
|
|
return [];
|
|
if (!target)
|
|
return [];
|
|
if (typeof target !== "function" && typeof target !== "object")
|
|
return [];
|
|
if (reportedTargets.has(target))
|
|
return [];
|
|
reportedTargets.add(target);
|
|
return reportDiagnostics(target, options);
|
|
};
|
|
const _sfc_main$d = defineComponent({
|
|
name: "UmByClass",
|
|
inheritAttrs: false,
|
|
emits: ["fire", "fire:onBefore", "fire:onNow", "fire:onAfter"],
|
|
mounted() {
|
|
reportDiagnosticsOnce(this.$attrs.target, {
|
|
deferAfterTypes: this.$attrs["defer-after-types"],
|
|
enabled: this.$attrs.diagnose !== false
|
|
});
|
|
},
|
|
render() {
|
|
const target = this.$attrs.target;
|
|
const otherParams = this.$attrs["other-params"] || {};
|
|
const searchParams = this.$attrs["search-params"] || {};
|
|
const data = this.$attrs.data || [];
|
|
const fire = (payload, type, phase, meta) => new Promise((resolve) => {
|
|
if (!hasEmitListener(this, "fire")) {
|
|
resolve(payload);
|
|
return;
|
|
}
|
|
this.$emit("fire", payload, type, phase, resolve, meta);
|
|
});
|
|
let columnList = collectDataColumns(target);
|
|
const deferAfterTypes = this.$attrs["defer-after-types"];
|
|
const operateGroups = collectOperateGroups(target);
|
|
if (resolveShowOperate(target, operateGroups.length > 0)) {
|
|
const operateColumn = buildOperateColumn(operateGroups, {
|
|
fire,
|
|
tableData: data,
|
|
width: resolveOperateWidth(target),
|
|
deferAfterTypes
|
|
});
|
|
if (operateColumn)
|
|
columnList.push(operateColumn);
|
|
}
|
|
const { toolbars, events: toolbarEvents } = collectToolbar(target, fire, {
|
|
deferAfterTypes
|
|
});
|
|
if (this.$attrs["is-expand"]) {
|
|
columnList = [
|
|
h(_sfc_main$e, {
|
|
type: "expand",
|
|
expandTemplate: this.$attrs["expand-template"]
|
|
})
|
|
].concat(columnList);
|
|
}
|
|
const hasIndex = this.$attrs["show-index"] !== false;
|
|
if (hasIndex) {
|
|
columnList = [
|
|
h(ElTableColumn, { type: "index", label: "\u5E8F\u53F7", width: 56 })
|
|
].concat(columnList);
|
|
}
|
|
const enableSelection = toolbars.some((item) => item.type === "\u6279\u91CF\u5220\u9664");
|
|
if (enableSelection) {
|
|
columnList = [h(ElTableColumn, { type: "selection" })].concat(columnList);
|
|
}
|
|
return h(
|
|
UmTable,
|
|
{
|
|
data,
|
|
otherParams,
|
|
searchParams,
|
|
toolbarOptions: toolbars,
|
|
toolbarEvents,
|
|
width: "100%",
|
|
rowKey: this.$attrs["row-key"] || "id",
|
|
defaultExpandAll: !!this.$attrs["default-expand-all"],
|
|
treeProps: this.$attrs["tree-props"]
|
|
},
|
|
() => columnList
|
|
);
|
|
}
|
|
});
|
|
var index_vue_vue_type_style_index_0_lang = "";
|
|
const _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { class: "header-bg header-bg-l" }, null, -1);
|
|
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("div", { class: "header-bg header-bg-r" }, null, -1);
|
|
const _hoisted_3$1 = {
|
|
key: 1,
|
|
class: "el-dialog__title"
|
|
};
|
|
const _hoisted_4$1 = {
|
|
key: 1,
|
|
class: "dialog-footer"
|
|
};
|
|
const _hoisted_5$1 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
const __default__$5 = {
|
|
name: "um-dialog",
|
|
inheritAttrs: false
|
|
};
|
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
...__default__$5,
|
|
props: {
|
|
appendToBody: { type: Boolean, default: true },
|
|
center: { type: Boolean },
|
|
closeOnClickModal: { type: Boolean, default: false },
|
|
closeOnPressEscape: { type: Boolean, default: true },
|
|
confirmLoading: { type: Boolean },
|
|
customClass: null,
|
|
destroyOnClose: { type: Boolean, default: true },
|
|
footer: { type: Boolean, default: true },
|
|
modal: { type: Boolean, default: true },
|
|
modelValue: { type: Boolean },
|
|
showClose: { type: Boolean, default: true },
|
|
title: null,
|
|
width: null,
|
|
top: { default: "15vh" }
|
|
},
|
|
emits: ["update:modelValue", "onOk"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
useCssVars((_ctx) => ({
|
|
"3f29a002": unref(dialogWidth)
|
|
}));
|
|
const dialogClass = computed(() => {
|
|
const bottomShadow = props.footer ? "footer-shadow" : "body-shadow";
|
|
return (props.customClass ? [props.customClass] : []).concat(["um-dialog", bottomShadow]).join(" ");
|
|
});
|
|
const visible = computed({
|
|
get: () => props.modelValue,
|
|
set: (v) => emit("update:modelValue", v)
|
|
});
|
|
const onCancel = () => {
|
|
visible.value = false;
|
|
};
|
|
const dialogWidth = computed(() => {
|
|
const value = props.width;
|
|
if (!value)
|
|
return "500px";
|
|
const num = parseFloat(value);
|
|
return Number.isFinite(num) ? `${num}px` : value;
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createBlock(unref(ElDialog), {
|
|
modelValue: unref(visible),
|
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(visible) ? visible.value = $event : null),
|
|
top: __props.top,
|
|
"append-to-body": __props.appendToBody,
|
|
center: __props.center,
|
|
"close-on-click-modal": __props.closeOnClickModal,
|
|
"close-on-press-escape": __props.closeOnPressEscape,
|
|
"custom-class": unref(dialogClass),
|
|
"destroy-on-close": __props.destroyOnClose,
|
|
modal: __props.modal,
|
|
"show-close": __props.showClose,
|
|
width: unref(dialogWidth)
|
|
}, createSlots({
|
|
title: withCtx(() => [
|
|
_hoisted_1$6,
|
|
_hoisted_2$2,
|
|
_ctx.$slots.title ? renderSlot(_ctx.$slots, "title", { key: 0 }) : (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(__props.title), 1))
|
|
]),
|
|
default: withCtx(() => [
|
|
renderSlot(_ctx.$slots, "default")
|
|
]),
|
|
_: 2
|
|
}, [
|
|
__props.footer ? {
|
|
name: "footer",
|
|
fn: withCtx(() => [
|
|
_ctx.$slots.footer ? renderSlot(_ctx.$slots, "footer", { key: 0 }) : (openBlock(), createElementBlock("span", _hoisted_4$1, [
|
|
createVNode(unref(ElButton), {
|
|
class: "el-button--ghost",
|
|
type: "primary",
|
|
onClick: onCancel
|
|
}, {
|
|
default: withCtx(() => [
|
|
_hoisted_5$1
|
|
]),
|
|
_: 1
|
|
}),
|
|
createVNode(unref(ElButton), {
|
|
type: "primary",
|
|
loading: __props.confirmLoading,
|
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("onOk"))
|
|
}, {
|
|
default: withCtx(() => [
|
|
_hoisted_6
|
|
]),
|
|
_: 1
|
|
}, 8, ["loading"])
|
|
]))
|
|
])
|
|
} : void 0
|
|
]), 1032, ["modelValue", "top", "append-to-body", "center", "close-on-click-modal", "close-on-press-escape", "custom-class", "destroy-on-close", "modal", "show-close", "width"]);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_main$b = defineComponent({
|
|
name: "UmTableDialog",
|
|
inheritAttrs: false,
|
|
props: {
|
|
modelValue: { type: Boolean, default: false },
|
|
title: { type: String, default: "\u63D0\u793A" },
|
|
content: {
|
|
type: [Object, String, Function],
|
|
default: null
|
|
},
|
|
width: { type: [Number, String], default: 500 },
|
|
footer: { type: Boolean, default: false }
|
|
},
|
|
emits: ["ok", "update:modelValue"],
|
|
render() {
|
|
return h(
|
|
_sfc_main$c,
|
|
{
|
|
title: this.title,
|
|
modelValue: this.modelValue,
|
|
"onUpdate:modelValue": (value) => this.$emit("update:modelValue", value),
|
|
closeOnClickModal: false,
|
|
width: typeof this.width === "number" ? `${this.width}px` : this.width,
|
|
footer: this.footer,
|
|
onOnOk: () => this.$emit("ok")
|
|
},
|
|
() => {
|
|
var _a, _b, _c;
|
|
return (_c = (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)) != null ? _c : this.content ? [this.content] : [];
|
|
}
|
|
);
|
|
}
|
|
});
|
|
const reset = "_reset_123e3_4";
|
|
const submit$1 = "_submit_123e3_5";
|
|
var style0$4 = {
|
|
"search-form": "_search-form_123e3_1",
|
|
reset,
|
|
submit: submit$1
|
|
};
|
|
const _sfc_main$a = defineComponent({
|
|
name: "UmSearchForm",
|
|
inheritAttrs: false,
|
|
props: {
|
|
target: {
|
|
type: [Object, Function],
|
|
required: true
|
|
}
|
|
},
|
|
emits: ["change"],
|
|
data() {
|
|
return {
|
|
formFields: [],
|
|
formModel: {},
|
|
fieldOption: /* @__PURE__ */ new Map()
|
|
};
|
|
},
|
|
methods: {
|
|
async buildFields() {
|
|
const fields = [];
|
|
const model = {};
|
|
for (const member of scanDecoratedMembers(
|
|
this.target,
|
|
"table:searchFormField"
|
|
)) {
|
|
const meta = member.meta;
|
|
const prop = member.fieldName;
|
|
fields.push({
|
|
label: meta.def,
|
|
fieldType: meta.fieldType,
|
|
component: meta.$um_component,
|
|
prop,
|
|
placeholder: meta.placeholder,
|
|
style: meta.style
|
|
});
|
|
model[prop] = member.value || void 0;
|
|
if ((meta.fieldType === "select" || meta.$um_component === "select") && meta.getData) {
|
|
this.fieldOption.set(prop, await meta.getData());
|
|
}
|
|
}
|
|
this.formFields = fields;
|
|
this.formModel = model;
|
|
},
|
|
onSubmit() {
|
|
this.$emit("change", { ...this.formModel });
|
|
},
|
|
onReset() {
|
|
const next = {};
|
|
for (const field of this.formFields)
|
|
next[field.prop] = void 0;
|
|
this.formModel = next;
|
|
this.$emit("change", {});
|
|
}
|
|
},
|
|
async beforeMount() {
|
|
await this.buildFields();
|
|
},
|
|
render() {
|
|
const style = this.$style;
|
|
const formItems = this.formFields.map((item) => {
|
|
var _a, _b;
|
|
const modelValue = this.formModel[item.prop];
|
|
const onUpdate = (value) => {
|
|
this.formModel[item.prop] = value;
|
|
};
|
|
const formItemProps = {
|
|
label: item.label,
|
|
prop: item.prop,
|
|
style: item.style
|
|
};
|
|
const control = item.component || item.fieldType;
|
|
const width = ((_a = item.style) == null ? void 0 : _a.width) || "180px";
|
|
switch (control) {
|
|
case "select": {
|
|
const options = (((_b = this.fieldOption.get(item.prop)) == null ? void 0 : _b.data) || []).map(
|
|
(option) => h(ElSelect.Option, {
|
|
key: option.value,
|
|
label: option.label,
|
|
value: option.value
|
|
})
|
|
);
|
|
return h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(
|
|
ElSelect,
|
|
{
|
|
modelValue,
|
|
"onUpdate:modelValue": onUpdate,
|
|
placeholder: item.placeholder || "\u8BF7\u9009\u62E9" + item.label,
|
|
clearable: true,
|
|
style: { width }
|
|
},
|
|
() => options
|
|
)
|
|
);
|
|
}
|
|
case "dateRange":
|
|
case "date-picker":
|
|
return h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => {
|
|
var _a2;
|
|
return h(ElDatePicker, {
|
|
modelValue,
|
|
"onUpdate:modelValue": onUpdate,
|
|
type: "daterange",
|
|
valueFormat: "YYYY-MM-DD",
|
|
startPlaceholder: item.placeholder || "\u5F00\u59CB\u65E5\u671F",
|
|
endPlaceholder: "\u7ED3\u675F\u65E5\u671F",
|
|
style: { width: ((_a2 = item.style) == null ? void 0 : _a2.width) || "240px" }
|
|
});
|
|
}
|
|
);
|
|
case "dateTime-picker":
|
|
return h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(ElDatePicker, {
|
|
modelValue,
|
|
"onUpdate:modelValue": onUpdate,
|
|
type: "datetime",
|
|
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
placeholder: item.placeholder || "\u8BF7\u9009\u62E9" + item.label,
|
|
style: { width }
|
|
})
|
|
);
|
|
case "switch":
|
|
return h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(ElSwitch, { modelValue, "onUpdate:modelValue": onUpdate })
|
|
);
|
|
case "textarea":
|
|
return h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(ElInput, {
|
|
modelValue,
|
|
"onUpdate:modelValue": onUpdate,
|
|
type: "textarea",
|
|
placeholder: item.placeholder || "\u8BF7\u8F93\u5165" + item.label,
|
|
style: { width }
|
|
})
|
|
);
|
|
default:
|
|
return h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(ElInput, {
|
|
modelValue,
|
|
"onUpdate:modelValue": onUpdate,
|
|
placeholder: item.placeholder || "\u8BF7\u8F93\u5165" + item.label,
|
|
clearable: true,
|
|
autocomplete: "off",
|
|
style: { width },
|
|
onKeyup: (e) => {
|
|
if (e.key === "Enter")
|
|
this.onSubmit();
|
|
}
|
|
})
|
|
);
|
|
}
|
|
});
|
|
if (formItems.length === 0)
|
|
return null;
|
|
formItems.push(
|
|
h(ElFormItem, {}, () => [
|
|
h(
|
|
ElButton,
|
|
{ class: style["submit"], onClick: this.onSubmit },
|
|
() => "\u67E5\u8BE2"
|
|
),
|
|
h(
|
|
ElButton,
|
|
{ class: style["reset"], onClick: this.onReset },
|
|
() => "\u91CD\u7F6E"
|
|
)
|
|
])
|
|
);
|
|
return h(
|
|
ElForm,
|
|
{
|
|
inline: true,
|
|
class: style["search-form"],
|
|
model: this.formModel,
|
|
onSubmit: (e) => e.preventDefault()
|
|
},
|
|
() => formItems
|
|
);
|
|
}
|
|
});
|
|
const cssModules$4 = {
|
|
"$style": style0$4
|
|
};
|
|
var UmSearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__cssModules", cssModules$4]]);
|
|
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
const _withScopeId = (n) => (pushScopeId("data-v-0bda02d2"), n = n(), popScopeId(), n);
|
|
const _hoisted_1$5 = { class: "um-pagination" };
|
|
const _hoisted_2$1 = { class: "pages" };
|
|
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("li", null, "\u8DF3\u8F6C\u81F3", -1));
|
|
const _hoisted_4 = { class: "el-input el-input--mini el-pagination__editor is-in-pagination" };
|
|
const _hoisted_5 = ["value", "max", "onKeyup"];
|
|
const __default__$4 = {
|
|
name: "um-pagination"
|
|
};
|
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
...__default__$4,
|
|
props: {
|
|
page: { default: 1 },
|
|
pages: { default: () => [10, 20, 50, 100] },
|
|
size: { default: 10 },
|
|
total: { default: 0 }
|
|
},
|
|
emits: ["onChange"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const visible = ref(false);
|
|
const value = ref();
|
|
const pageTotal = computed(() => Math.ceil(props.total / props.size));
|
|
const disablePrev = computed(() => props.page <= 1);
|
|
const disableNext = computed(() => props.page >= pageTotal.value);
|
|
const onChange = (v) => {
|
|
visible.value = v;
|
|
};
|
|
const onPageChange = (v) => {
|
|
if (v !== props.size) {
|
|
emit("onChange", 1, v);
|
|
}
|
|
};
|
|
const onPrev = () => {
|
|
if (disablePrev.value) {
|
|
return;
|
|
}
|
|
emit("onChange", props.page - 1, props.size);
|
|
};
|
|
const onNext = () => {
|
|
if (disableNext.value) {
|
|
return;
|
|
}
|
|
emit("onChange", props.page + 1, props.size);
|
|
};
|
|
const onInput = (e) => {
|
|
const val = e.target.value;
|
|
value.value = val.replace(/\D/g, "");
|
|
};
|
|
const onSubmit = () => {
|
|
const p = Number(value.value);
|
|
if (!p || isNaN(p)) {
|
|
return;
|
|
}
|
|
let v = p;
|
|
if (p < 1) {
|
|
v = 1;
|
|
} else if (p > pageTotal.value) {
|
|
v = pageTotal.value;
|
|
}
|
|
if (v !== props.page) {
|
|
emit("onChange", v, props.size);
|
|
value.value = "";
|
|
}
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
createElementVNode("ul", null, [
|
|
createElementVNode("li", null, "\u5171" + toDisplayString(__props.total) + "\u9879", 1),
|
|
createElementVNode("li", null, [
|
|
createVNode(unref(ElDropdown), { onVisibleChange: onChange }, {
|
|
dropdown: withCtx(() => [
|
|
createVNode(unref(ElDropdownMenu), null, {
|
|
default: withCtx(() => [
|
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.pages, (item) => {
|
|
return openBlock(), createBlock(unref(ElDropdownItem), {
|
|
key: item,
|
|
onClick: ($event) => onPageChange(item)
|
|
}, {
|
|
default: withCtx(() => [
|
|
createTextVNode(toDisplayString(item), 1)
|
|
]),
|
|
_: 2
|
|
}, 1032, ["onClick"]);
|
|
}), 128))
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
default: withCtx(() => [
|
|
createElementVNode("div", _hoisted_2$1, [
|
|
createElementVNode("span", null, "\u6BCF\u9875" + toDisplayString(__props.size) + "\u9879", 1),
|
|
createVNode(unref(ElIcon), null, {
|
|
default: withCtx(() => [
|
|
visible.value ? (openBlock(), createBlock(unref(CaretTop), { key: 0 })) : (openBlock(), createBlock(unref(CaretBottom), { key: 1 }))
|
|
]),
|
|
_: 1
|
|
})
|
|
])
|
|
]),
|
|
_: 1
|
|
})
|
|
]),
|
|
createElementVNode("li", {
|
|
title: "\u4E0A\u4E00\u9875",
|
|
class: normalizeClass(["btn-arrow", {
|
|
disabled: unref(disablePrev)
|
|
}]),
|
|
onClick: onPrev
|
|
}, [
|
|
createVNode(unref(ElIcon), {
|
|
style: normalizeStyle({
|
|
color: unref(disablePrev) ? "#666" : void 0
|
|
})
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(unref(ArrowLeft))
|
|
]),
|
|
_: 1
|
|
}, 8, ["style"])
|
|
], 2),
|
|
createElementVNode("li", null, toDisplayString(__props.page) + "/" + toDisplayString(unref(pageTotal)), 1),
|
|
createElementVNode("li", {
|
|
title: "\u4E0B\u4E00\u9875",
|
|
class: normalizeClass(["btn-arrow", {
|
|
disabled: unref(disableNext)
|
|
}]),
|
|
onClick: onNext
|
|
}, [
|
|
createVNode(unref(ElIcon), {
|
|
style: normalizeStyle({
|
|
color: unref(disableNext) ? "#666" : void 0
|
|
})
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(unref(ArrowRight))
|
|
]),
|
|
_: 1
|
|
}, 8, ["style"])
|
|
], 2),
|
|
_hoisted_3,
|
|
createElementVNode("li", null, [
|
|
createElementVNode("div", _hoisted_4, [
|
|
createElementVNode("input", {
|
|
class: "el-input__inner",
|
|
value: value.value,
|
|
type: "number",
|
|
min: 1,
|
|
max: unref(pageTotal),
|
|
autocomplete: "off",
|
|
onInput,
|
|
onBlur: onSubmit,
|
|
onKeyup: withKeys(onSubmit, ["enter"])
|
|
}, null, 40, _hoisted_5)
|
|
])
|
|
])
|
|
])
|
|
]);
|
|
};
|
|
}
|
|
});
|
|
var UmPagination = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-0bda02d2"]]);
|
|
var UmByClassEnhance_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
const _sfc_main$8 = defineComponent({
|
|
name: "UmByClassEnhance",
|
|
inheritAttrs: false,
|
|
emits: [
|
|
"fire",
|
|
"fire:onBefore",
|
|
"fire:onNow",
|
|
"fire:onAfter",
|
|
"dataChange",
|
|
"command"
|
|
],
|
|
expose: ["getList"],
|
|
data() {
|
|
return {
|
|
dialogVisible: false,
|
|
currentPage: 1,
|
|
currentPageSize: 10,
|
|
confirmCb: null,
|
|
dialogTitle: "\u63D0\u793A",
|
|
dialogContent: null,
|
|
dialogWidth: 500,
|
|
dialogShowFooter: false,
|
|
searchFormModel: {},
|
|
currentId: null,
|
|
editingRow: null,
|
|
data: [],
|
|
total: 0,
|
|
pendingResolve: null
|
|
};
|
|
},
|
|
watch: {
|
|
"$attrs.other-params"() {
|
|
this.currentPage = 1;
|
|
this.dialogVisible = false;
|
|
this.getList();
|
|
},
|
|
data(v) {
|
|
this.$emit("dataChange", v);
|
|
}
|
|
},
|
|
methods: {
|
|
settle(result) {
|
|
const resolve = this.pendingResolve;
|
|
this.pendingResolve = null;
|
|
resolve == null ? void 0 : resolve(result);
|
|
},
|
|
onDialogVisibility(value) {
|
|
this.dialogVisible = value;
|
|
if (!value)
|
|
this.settle(false);
|
|
},
|
|
getMetaDataByKey(key, dKey) {
|
|
var _a, _b;
|
|
return (_b = (_a = findMethodMeta(this.$attrs.target, dKey, key)) == null ? void 0 : _a.meta) != null ? _b : null;
|
|
},
|
|
async handleFire(data, key, es, cb, metaValue = {}) {
|
|
var _a, _b;
|
|
const target = this.$attrs.target;
|
|
let dKey;
|
|
switch (key) {
|
|
case "\u6DFB\u52A0":
|
|
case "edit": {
|
|
dKey = key === "\u6DFB\u52A0" ? "table:toolbar" : "table:operate";
|
|
if (es === "onBefore") {
|
|
this.dialogShowFooter = false;
|
|
} else if (es === "onNow") {
|
|
const metaData = this.getMetaDataByKey(key, dKey);
|
|
this.dialogWidth = (metaData == null ? void 0 : metaData.dialogWidth) || this.dialogWidth || 500;
|
|
let addEditData = data;
|
|
if (key === "\u6DFB\u52A0") {
|
|
addEditData = { ...this.$attrs["form-data"] || {} };
|
|
this.editingRow = null;
|
|
} else {
|
|
const row = data && typeof data === "object" ? data : {};
|
|
addEditData = transformFields(target, { ...row }, "in");
|
|
this.editingRow = transformFields(target, { ...addEditData }, "out");
|
|
}
|
|
const depData = await ((_a = metaData == null ? void 0 : metaData.getData) == null ? void 0 : _a.call(metaData)) || {};
|
|
const dialogContent = metaData == null ? void 0 : metaData.dialogContent;
|
|
this.dialogContent = dialogContent ? h(dialogContent, {
|
|
target: (metaData == null ? void 0 : metaData.dialogTarget) || target,
|
|
data: addEditData,
|
|
depData,
|
|
onCancel: () => {
|
|
this.dialogVisible = false;
|
|
this.settle(false);
|
|
},
|
|
onOk: (formData) => {
|
|
var _a2;
|
|
const next = transformFields(target, { ...formData || {} }, "out");
|
|
const payload = key === "\u6DFB\u52A0" ? next : { ...this.editingRow || {}, ...next };
|
|
(_a2 = this.confirmCb) == null ? void 0 : _a2.call(this, payload);
|
|
}
|
|
}) : null;
|
|
this.dialogTitle = (metaData == null ? void 0 : metaData.dialogTitle) || this.dialogTitle;
|
|
this.dialogVisible = true;
|
|
this.setConfirmCb(key, dKey);
|
|
this.pendingResolve = cb;
|
|
return;
|
|
} else if (es === "onAfter") {
|
|
if (data === false)
|
|
break;
|
|
if ((data == null ? void 0 : data.code) === 0) {
|
|
if (key === "\u6DFB\u52A0")
|
|
this.currentPage = 1;
|
|
this.dialogVisible = false;
|
|
this.getList();
|
|
ElMessage.success("\u64CD\u4F5C\u6210\u529F");
|
|
} else {
|
|
ElMessage.error((data == null ? void 0 : data.message) || "\u64CD\u4F5C\u5931\u8D25");
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case "del":
|
|
case "\u6279\u91CF\u5220\u9664": {
|
|
dKey = key === "\u6279\u91CF\u5220\u9664" ? "table:toolbar" : "table:operate";
|
|
if (es === "onBefore") {
|
|
this.dialogShowFooter = true;
|
|
} else if (es === "onNow") {
|
|
const metaData = this.getMetaDataByKey(key, dKey);
|
|
this.dialogTitle = (metaData == null ? void 0 : metaData.dialogTitle) || this.dialogTitle;
|
|
this.dialogWidth = (metaData == null ? void 0 : metaData.dialogWidth) || this.dialogWidth || 500;
|
|
const dialogContent = metaData == null ? void 0 : metaData.dialogContent;
|
|
this.dialogContent = typeof dialogContent === "string" ? h("div", dialogContent) : dialogContent ? h(dialogContent) : h("div", "\u786E\u8BA4\u6267\u884C\u8BE5\u64CD\u4F5C\uFF1F");
|
|
this.dialogVisible = true;
|
|
this.currentId = key === "\u6279\u91CF\u5220\u9664" ? (data != null ? data : []).map((item) => {
|
|
var _a2;
|
|
return (_a2 = item == null ? void 0 : item.id) != null ? _a2 : item;
|
|
}) : (_b = data == null ? void 0 : data.id) != null ? _b : data;
|
|
this.setConfirmCb(key, dKey);
|
|
this.pendingResolve = cb;
|
|
return;
|
|
} else if (es === "onAfter") {
|
|
if (data === false)
|
|
break;
|
|
if (data && data.code === 0) {
|
|
this.currentPage = 1;
|
|
this.dialogVisible = false;
|
|
this.currentId = null;
|
|
this.getList();
|
|
ElMessage.success("\u5220\u9664\u6210\u529F");
|
|
} else {
|
|
ElMessage.error((data == null ? void 0 : data.message) || "\u5220\u9664\u5931\u8D25");
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case "customOperateEvent": {
|
|
if (es === "onNow") {
|
|
this.$emit("fire", key, data, metaValue, this.data);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
if (es === "onAfter")
|
|
this.$emit("command", key, data);
|
|
return cb(data);
|
|
},
|
|
setConfirmCb(key, dKey) {
|
|
const tasks = collectTypedTasks(
|
|
this.$attrs.target,
|
|
dKey,
|
|
key
|
|
);
|
|
this.confirmCb = async (rowId) => {
|
|
const result = await runEventPipeline({
|
|
tasks,
|
|
rowId,
|
|
type: key,
|
|
phases: ["onAfter"],
|
|
fire: (payload, type, phase, meta) => this.handleFire(payload, type, phase, (v) => v, meta)
|
|
});
|
|
this.settle(result);
|
|
};
|
|
},
|
|
handleSizeChange(size) {
|
|
this.currentPageSize = size;
|
|
},
|
|
handleCurrentChange(p, s) {
|
|
this.currentPage = p;
|
|
this.currentPageSize = s;
|
|
this.getList();
|
|
},
|
|
async getList() {
|
|
const target = this.$attrs.target;
|
|
if (!target)
|
|
return;
|
|
const found = findMethodMeta(target, "table:searchFormMethod", "getList");
|
|
if (!found)
|
|
return;
|
|
const instance = createTargetInstance(target);
|
|
const otherParams = this.$attrs["other-params"] || {};
|
|
const { data, total } = await instance.getList({
|
|
...this.searchFormModel,
|
|
page: this.currentPage,
|
|
pageSize: this.currentPageSize,
|
|
...otherParams
|
|
});
|
|
this.data = data != null ? data : [];
|
|
this.total = total != null ? total : 0;
|
|
},
|
|
onSearchFormChange(params) {
|
|
this.searchFormModel = params;
|
|
this.currentPage = 1;
|
|
this.getList();
|
|
}
|
|
},
|
|
beforeMount() {
|
|
reportDiagnosticsOnce(this.$attrs.target, {
|
|
deferAfterTypes: DEFAULT_DEFER_TYPES,
|
|
requireGetList: true,
|
|
enabled: this.$attrs.diagnose !== false
|
|
});
|
|
this.getList();
|
|
},
|
|
render() {
|
|
const attrs = this.$attrs;
|
|
return h("div", { class: attrs.class }, [
|
|
h(UmSearchForm, {
|
|
target: attrs.target,
|
|
onChange: this.onSearchFormChange
|
|
}),
|
|
h(_sfc_main$d, {
|
|
target: attrs.target,
|
|
data: this.data,
|
|
onFire: this.handleFire,
|
|
"other-params": attrs["other-params"] || {},
|
|
"search-params": this.searchFormModel || {},
|
|
"is-expand": attrs["is-expand"],
|
|
"expand-template": attrs["expand-template"],
|
|
"row-key": attrs["row-key"],
|
|
"default-expand-all": attrs["default-expand-all"],
|
|
"defer-after-types": DEFAULT_DEFER_TYPES
|
|
}),
|
|
h(UmPagination, {
|
|
page: this.currentPage,
|
|
size: this.currentPageSize,
|
|
total: this.total,
|
|
class: "page",
|
|
onOnChange: this.handleCurrentChange
|
|
}),
|
|
h(_sfc_main$b, {
|
|
modelValue: this.dialogVisible,
|
|
"onUpdate:modelValue": this.onDialogVisibility,
|
|
title: this.dialogTitle,
|
|
content: this.dialogContent,
|
|
width: this.dialogWidth,
|
|
footer: this.dialogShowFooter,
|
|
onOk: () => {
|
|
var _a;
|
|
(_a = this.confirmCb) == null ? void 0 : _a.call(this, this.currentId);
|
|
}
|
|
})
|
|
]);
|
|
}
|
|
});
|
|
var UmByClassEnhance = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-67bf522d"]]);
|
|
var style0$3 = {
|
|
"avatar-uploader": "_avatar-uploader_ykbb1_1"
|
|
};
|
|
const _hoisted_1$4 = ["src"];
|
|
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", null, "\u8BF7\u4E0A\u4F20\u56FE\u7247", -1);
|
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
props: {
|
|
modelValue: null,
|
|
accept: { default: "image/png, image/jpeg" }
|
|
},
|
|
emits: ["update:modelValue"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const imageUrl = ref();
|
|
onBeforeMount(() => {
|
|
imageUrl.value = props.modelValue;
|
|
});
|
|
watch(
|
|
() => props.modelValue,
|
|
(v) => {
|
|
imageUrl.value = props.modelValue;
|
|
}
|
|
);
|
|
const handleAvatarSuccess = (res, file) => {
|
|
var _a;
|
|
imageUrl.value = URL.createObjectURL(file.raw);
|
|
emit("update:modelValue", ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.url) || "");
|
|
};
|
|
const beforeAvatarUpload = (file) => {
|
|
return true;
|
|
};
|
|
const onHttpRequest = async (option) => {
|
|
};
|
|
return (_ctx, _cache) => {
|
|
const _component_el_icon = resolveComponent("el-icon");
|
|
const _component_el_upload = resolveComponent("el-upload");
|
|
return openBlock(), createBlock(_component_el_upload, {
|
|
class: normalizeClass(_ctx.$style["avatar-uploader"]),
|
|
action: "/api/management/file/upload/image",
|
|
"show-file-list": false,
|
|
"on-success": handleAvatarSuccess,
|
|
"before-upload": beforeAvatarUpload,
|
|
accept: __props.accept,
|
|
"http-request": onHttpRequest
|
|
}, {
|
|
default: withCtx(() => [
|
|
imageUrl.value ? (openBlock(), createElementBlock("img", {
|
|
key: 0,
|
|
src: imageUrl.value,
|
|
class: "avatar"
|
|
}, null, 8, _hoisted_1$4)) : (openBlock(), createBlock(_component_el_icon, {
|
|
key: 1,
|
|
class: "avatar-uploader-icon"
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(unref(Plus)),
|
|
_hoisted_2
|
|
]),
|
|
_: 1
|
|
}))
|
|
]),
|
|
_: 1
|
|
}, 8, ["class", "accept"]);
|
|
};
|
|
}
|
|
});
|
|
const cssModules$3 = {
|
|
"$style": style0$3
|
|
};
|
|
var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__cssModules", cssModules$3]]);
|
|
const _hoisted_1$3 = ["title"];
|
|
const __default__$3 = {
|
|
name: "um-tree",
|
|
inheritAttrs: false
|
|
};
|
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
...__default__$3,
|
|
props: {
|
|
checkbox: { type: Boolean, default: false },
|
|
defaultExpandAll: { type: Boolean, default: false },
|
|
keyword: null,
|
|
strategy: { default: "child" },
|
|
treeData: null,
|
|
props: null,
|
|
class: null
|
|
},
|
|
emits: ["onSelect", "onCheck"],
|
|
setup(__props, { expose, emit }) {
|
|
const props = __props;
|
|
const treeRef = ref();
|
|
const selectKey = ref();
|
|
const expandKeys = ref([]);
|
|
const treeProps = computed(() => {
|
|
return Object.assign(
|
|
{},
|
|
{
|
|
label: "label",
|
|
children: "children",
|
|
disabled: "disabled"
|
|
},
|
|
props.props || {}
|
|
);
|
|
});
|
|
const nodeKey = computed(() => {
|
|
var _a;
|
|
return ((_a = props.props) == null ? void 0 : _a.value) || "id";
|
|
});
|
|
watch(
|
|
() => props.keyword,
|
|
(v) => {
|
|
var _a;
|
|
(_a = treeRef.value) == null ? void 0 : _a.filter(v);
|
|
}
|
|
);
|
|
const onFilter = (value, record) => {
|
|
var _a;
|
|
if (!value)
|
|
return true;
|
|
const label = record[((_a = props.props) == null ? void 0 : _a.label) || "label"];
|
|
return typeof label === "string" ? label.indexOf(value) !== -1 : true;
|
|
};
|
|
const onHandleCheck = () => {
|
|
var _a, _b;
|
|
let keys2 = [];
|
|
if (props.strategy === "child") {
|
|
keys2 = ((_a = treeRef.value) == null ? void 0 : _a.getCheckedKeys(true)) || [];
|
|
} else if (props.strategy === "all") {
|
|
keys2 = ((_b = treeRef.value) == null ? void 0 : _b.getCheckedKeys(false)) || [];
|
|
}
|
|
emit("onCheck", keys2);
|
|
};
|
|
const onHandleSelect = (record) => {
|
|
var _a;
|
|
if (props.checkbox) {
|
|
onHandleCheck();
|
|
} else {
|
|
let key = record[nodeKey.value];
|
|
if (key === selectKey.value) {
|
|
key = void 0;
|
|
}
|
|
selectKey.value = key;
|
|
emit("onSelect", key, record);
|
|
(_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(key);
|
|
}
|
|
};
|
|
const onHandleCollapse = (record) => {
|
|
const key = record[nodeKey.value];
|
|
const keys2 = [].concat(expandKeys.value);
|
|
const idx = keys2.indexOf(key);
|
|
if (idx !== -1) {
|
|
keys2.splice(idx, 1);
|
|
expandKeys.value = keys2;
|
|
}
|
|
};
|
|
const onHandleExpand = (record) => {
|
|
const key = record[nodeKey.value];
|
|
const idx = expandKeys.value.indexOf(key);
|
|
if (idx === -1) {
|
|
expandKeys.value = expandKeys.value.concat(key);
|
|
}
|
|
};
|
|
expose({
|
|
setSelectKey: (v) => {
|
|
var _a, _b;
|
|
if (props.checkbox) {
|
|
v = v && Array.isArray(v) ? v : [];
|
|
(_a = treeRef.value) == null ? void 0 : _a.setCheckedKeys(v, false);
|
|
} else {
|
|
selectKey.value = v;
|
|
(_b = treeRef.value) == null ? void 0 : _b.setCurrentKey(v);
|
|
}
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createBlock(unref(ElTree), {
|
|
ref_key: "treeRef",
|
|
ref: treeRef,
|
|
class: normalizeClass(props.class),
|
|
"check-on-click-node": __props.checkbox,
|
|
data: __props.treeData,
|
|
"default-expand-all": __props.defaultExpandAll,
|
|
"default-expanded-keys": expandKeys.value,
|
|
props: unref(treeProps),
|
|
"expand-on-click-node": false,
|
|
"filter-node-method": onFilter,
|
|
"highlight-current": __props.checkbox ? false : true,
|
|
"node-key": unref(nodeKey),
|
|
"show-checkbox": __props.checkbox,
|
|
onChange: onHandleCheck,
|
|
onNodeCollapse: onHandleCollapse,
|
|
onNodeClick: onHandleSelect,
|
|
onNodeExpand: onHandleExpand
|
|
}, {
|
|
default: withCtx((slotProps) => [
|
|
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 0 }, slotProps))) : (openBlock(), createElementBlock("span", {
|
|
key: 1,
|
|
class: "el-tree-node__label",
|
|
title: slotProps.node.label
|
|
}, toDisplayString(slotProps.node.label), 9, _hoisted_1$3))
|
|
]),
|
|
_: 3
|
|
}, 8, ["class", "check-on-click-node", "data", "default-expand-all", "default-expanded-keys", "props", "highlight-current", "node-key", "show-checkbox"]);
|
|
};
|
|
}
|
|
});
|
|
var UmTreeSelect_vue_vue_type_style_index_0_lang = "";
|
|
const _hoisted_1$2 = {
|
|
key: 1,
|
|
class: "el-tree-node__label"
|
|
};
|
|
const __default__$2 = {
|
|
name: "um-tree-select",
|
|
inheritAttrs: false
|
|
};
|
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
...__default__$2,
|
|
props: {
|
|
checkbox: { type: Boolean },
|
|
class: null,
|
|
clearable: { type: Boolean },
|
|
defaultExpandAll: { type: Boolean, default: true },
|
|
modelValue: { default: "" },
|
|
placeholder: null,
|
|
search: { type: Boolean },
|
|
size: null,
|
|
strategy: null,
|
|
style: null,
|
|
treeData: null,
|
|
props: null
|
|
},
|
|
emits: ["update:modelValue"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const selectRef = ref();
|
|
const treeRef = ref();
|
|
const keyword = ref();
|
|
const treeProps = computed(() => {
|
|
return Object.assign(
|
|
{},
|
|
{
|
|
label: "label",
|
|
value: "id",
|
|
children: "children",
|
|
disabled: "disabled"
|
|
},
|
|
props.props || {}
|
|
);
|
|
});
|
|
const labelName = computed({
|
|
get: () => {
|
|
const v = props.modelValue;
|
|
if (props.checkbox) {
|
|
if (v && Array.isArray(v)) {
|
|
return getFields(v, treeProps.value.value, treeProps.value.label);
|
|
} else {
|
|
return void 0;
|
|
}
|
|
} else {
|
|
if (v || v === 0) {
|
|
return getFields(
|
|
[v],
|
|
treeProps.value.value,
|
|
treeProps.value.label
|
|
).join(",");
|
|
} else {
|
|
return void 0;
|
|
}
|
|
}
|
|
},
|
|
set: (labels) => {
|
|
if (props.checkbox) {
|
|
const ids = getFields(
|
|
labels,
|
|
treeProps.value.label,
|
|
treeProps.value.value
|
|
);
|
|
emit("update:modelValue", ids);
|
|
if (treeRef.value) {
|
|
treeRef.value.setSelectKey(ids);
|
|
}
|
|
} else {
|
|
if (!labels) {
|
|
emit("update:modelValue", void 0);
|
|
if (treeRef.value) {
|
|
treeRef.value.setSelectKey(void 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
const umClass = computed(() => {
|
|
return (props.class ? [props.class] : []).concat(["um-tree-select"]).join(" ");
|
|
});
|
|
const getField = (v, arrs, v1Key, v2Key) => {
|
|
let text = "";
|
|
for (let i = 0; i < (arrs == null ? void 0 : arrs.length) || 0; i++) {
|
|
const record = arrs[i];
|
|
const childKey = treeProps.value.children || "";
|
|
const child = record[childKey] || [];
|
|
if (record[v1Key] === v) {
|
|
text = record[v2Key];
|
|
break;
|
|
} else if (!!child.length) {
|
|
text = getField(v, child, v1Key, v2Key);
|
|
if (text) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return text;
|
|
};
|
|
const getFields = (vals, v1Key = "", v2Key = "") => {
|
|
let texts = [];
|
|
vals.forEach((v) => {
|
|
const text = getField(v, props.treeData, v1Key, v2Key);
|
|
texts.push(text || `${v}`);
|
|
});
|
|
return texts;
|
|
};
|
|
const onCheck = (keys2) => {
|
|
emit("update:modelValue", keys2);
|
|
};
|
|
const onSelect = (v) => {
|
|
emit("update:modelValue", v);
|
|
selectRef.value.blur();
|
|
};
|
|
const onVisibleChange = (v) => {
|
|
if (v) {
|
|
treeRef.value.setSelectKey(props.modelValue);
|
|
}
|
|
};
|
|
return (_ctx, _cache) => {
|
|
const _component_el_input = resolveComponent("el-input");
|
|
const _component_el_option = resolveComponent("el-option");
|
|
const _component_el_select = resolveComponent("el-select");
|
|
return openBlock(), createBlock(_component_el_select, {
|
|
ref_key: "selectRef",
|
|
ref: selectRef,
|
|
modelValue: unref(labelName),
|
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(labelName) ? labelName.value = $event : null),
|
|
class: normalizeClass(unref(umClass)),
|
|
clearable: __props.clearable,
|
|
"collapse-tags": "",
|
|
multiple: __props.checkbox,
|
|
size: __props.size,
|
|
placeholder: __props.placeholder,
|
|
"popper-class": "um-tree-select-popper",
|
|
style: normalizeStyle(__props.style),
|
|
onVisibleChange
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(_component_el_option, {
|
|
value: "1",
|
|
style: { "height": "auto", "padding": "0", "min-height": "200!important" }
|
|
}, {
|
|
default: withCtx(() => [
|
|
__props.search ? (openBlock(), createBlock(_component_el_input, {
|
|
key: 0,
|
|
modelValue: keyword.value,
|
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => keyword.value = $event),
|
|
size: "small",
|
|
placeholder: "\u5173\u952E\u5B57\u68C0\u7D22",
|
|
"suffix-icon": unref(Search),
|
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
}, ["stop", "prevent"]))
|
|
}, null, 8, ["modelValue", "suffix-icon"])) : createCommentVNode("", true),
|
|
createVNode(_sfc_main$6, {
|
|
ref_key: "treeRef",
|
|
ref: treeRef,
|
|
"tree-data": __props.treeData,
|
|
props: unref(treeProps),
|
|
checkbox: __props.checkbox,
|
|
"default-expand-all": __props.defaultExpandAll,
|
|
keyword: keyword.value,
|
|
strategy: __props.strategy,
|
|
onOnCheck: onCheck,
|
|
onOnSelect: onSelect
|
|
}, {
|
|
default: withCtx((slotProps) => [
|
|
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 0 }, slotProps))) : (openBlock(), createElementBlock("span", _hoisted_1$2, toDisplayString(slotProps.node.label), 1))
|
|
]),
|
|
_: 3
|
|
}, 8, ["tree-data", "props", "checkbox", "default-expand-all", "keyword", "strategy"])
|
|
]),
|
|
_: 3
|
|
})
|
|
]),
|
|
_: 3
|
|
}, 8, ["modelValue", "class", "clearable", "multiple", "size", "placeholder", "style"]);
|
|
};
|
|
}
|
|
});
|
|
const cancel = "_cancel_omswa_6";
|
|
const submit = "_submit_omswa_7";
|
|
var style0$2 = {
|
|
"form-operate": "_form-operate_omswa_1",
|
|
cancel,
|
|
submit
|
|
};
|
|
const _sfc_main$4 = defineComponent({
|
|
name: "UmTableForm",
|
|
inheritAttrs: false,
|
|
emits: ["ok", "cancel", "formModelChange"],
|
|
setup(_props, { expose }) {
|
|
const formModel = ref({});
|
|
const instance = getCurrentInstance();
|
|
const setFormModel = (models) => {
|
|
const list = Array.isArray(models) ? models : [models];
|
|
const data = {};
|
|
for (const model of list) {
|
|
if (!model)
|
|
continue;
|
|
for (const field in formModel.value) {
|
|
if (Object.prototype.hasOwnProperty.call(model, field) || Object.prototype.hasOwnProperty.call(model, "_" + field)) {
|
|
data[field] = model[field];
|
|
}
|
|
}
|
|
}
|
|
formModel.value = data;
|
|
};
|
|
expose({
|
|
setFormModel,
|
|
getFormModel: () => unref(formModel),
|
|
onSubmit: () => {
|
|
var _a, _b;
|
|
return (_b = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.onSubmit) == null ? void 0 : _b.call(_a);
|
|
}
|
|
});
|
|
return { formModel, setFormModel };
|
|
},
|
|
data() {
|
|
return {
|
|
rules: {},
|
|
formItems: [],
|
|
fieldOption: /* @__PURE__ */ new Map(),
|
|
maxLabelWidth: 50,
|
|
showList: [],
|
|
cascadeMap: /* @__PURE__ */ new Map(),
|
|
throttleRefreshForm: throttle(
|
|
async function(v, oldV, needFreshCascadeField) {
|
|
await this.initShowFieldList(v, oldV);
|
|
await this.initCascadeData(needFreshCascadeField);
|
|
this.initFormItem();
|
|
},
|
|
100,
|
|
{ leading: false, trailing: true }
|
|
)
|
|
};
|
|
},
|
|
methods: {
|
|
async refreshForm(v, oldV, needFreshCascadeField) {
|
|
return this.throttleRefreshForm(v, oldV, needFreshCascadeField);
|
|
},
|
|
async onSubmit() {
|
|
var _a, _b;
|
|
const refs = this.$refs;
|
|
let valid = false;
|
|
try {
|
|
valid = await ((_b = (_a = refs.formRef) == null ? void 0 : _a.validate) == null ? void 0 : _b.call(_a));
|
|
} catch {
|
|
return;
|
|
}
|
|
if (valid)
|
|
this.$emit("ok", cloneDeep(this.formModel));
|
|
},
|
|
getRule(rule) {
|
|
const that = this;
|
|
switch (rule.type) {
|
|
case "require":
|
|
case "requireString":
|
|
return { required: true, message: rule.message };
|
|
case "ip":
|
|
return {
|
|
pattern: /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/,
|
|
message: rule.message || "ip\u683C\u5F0F\u4E0D\u6B63\u786E"
|
|
};
|
|
case "port":
|
|
return {
|
|
pattern: /^([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
|
|
message: rule.message || "\u7AEF\u53E3\u683C\u5F0F\u4E0D\u6B63\u786E"
|
|
};
|
|
case "len":
|
|
if (!isEmpty(rule.max) && !isEmpty(rule.min)) {
|
|
return {
|
|
min: rule.min,
|
|
max: rule.max,
|
|
message: "\u957F\u5EA6\u4E3A" + rule.min + "\u548C" + rule.max + "\u4E4B\u95F4"
|
|
};
|
|
} else if (!isEmpty(rule.max)) {
|
|
return { max: rule.max, message: "\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7" + rule.max };
|
|
} else if (!isEmpty(rule.min)) {
|
|
return { min: rule.min, message: "\u6700\u5C0F\u957F\u5EA6\u4E3A" + rule.min };
|
|
}
|
|
break;
|
|
case "phone":
|
|
return {
|
|
pattern: /^1[3456789]\d{9}$/,
|
|
message: rule.message || "\u683C\u5F0F\u4E0D\u6B63\u786E"
|
|
};
|
|
case "idNumber":
|
|
return {
|
|
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
|
message: rule.message || "\u683C\u5F0F\u4E0D\u6B63\u786E"
|
|
};
|
|
case "validator":
|
|
return {
|
|
validator: rule.validator.bind({ formData: that.formModel })
|
|
};
|
|
default:
|
|
return {};
|
|
}
|
|
},
|
|
async updateFieldOption(fieldName, metaData, isBeforeMount = true) {
|
|
const type = metaData.fieldType;
|
|
if (type !== "treeSelect" && type !== "string" && type !== "select" && type !== "pickerMapGps") {
|
|
return;
|
|
}
|
|
let data;
|
|
if (metaData.getData) {
|
|
data = await metaData.getData(this.formModel);
|
|
this.fieldOption.set(fieldName, data);
|
|
}
|
|
if (!metaData.isCascade)
|
|
return;
|
|
if (type === "treeSelect") {
|
|
if (!isBeforeMount) {
|
|
this.formModel[fieldName] = filterTreeByNodeIds(
|
|
(data == null ? void 0 : data.data) || [],
|
|
this.formModel[fieldName] || []
|
|
);
|
|
}
|
|
return;
|
|
}
|
|
if (Array.isArray(data == null ? void 0 : data.data)) {
|
|
const stillExists = data.data.some(
|
|
(item) => item.value == this.formModel[fieldName]
|
|
);
|
|
if (!stillExists) {
|
|
if (type === "string") {
|
|
this.formModel[fieldName] = data;
|
|
} else if (Array.isArray(this.formModel[fieldName])) {
|
|
this.formModel[fieldName] = [];
|
|
} else {
|
|
this.formModel[fieldName] = void 0;
|
|
}
|
|
}
|
|
}
|
|
},
|
|
async initShowFieldList(v, oldV) {
|
|
const fieldList = [];
|
|
const that = this;
|
|
for (const member of scanDecoratedMembers(
|
|
this.$attrs.target,
|
|
"table:formField"
|
|
)) {
|
|
const { fieldName, meta } = member;
|
|
const visible = meta.isShow ? await meta.isShow(v) : true;
|
|
if (!visible) {
|
|
if ((oldV == null ? void 0 : oldV[fieldName]) !== null && (oldV == null ? void 0 : oldV[fieldName]) !== void 0) {
|
|
that.formModel["$ref:" + fieldName] = oldV[fieldName];
|
|
}
|
|
that.formModel[fieldName] = null;
|
|
continue;
|
|
}
|
|
const cached = that.formModel["$ref:" + fieldName];
|
|
if (cached !== void 0 && that.formModel[fieldName] == null) {
|
|
that.formModel[fieldName] = cached;
|
|
}
|
|
fieldList.push(fieldName);
|
|
}
|
|
this.showList = fieldList;
|
|
},
|
|
async initCascadeData(needFreshCascadeField) {
|
|
for (const member of scanDecoratedMembers(
|
|
this.$attrs.target,
|
|
"table:formField"
|
|
)) {
|
|
const { fieldName, meta } = member;
|
|
if (meta.isCascade && needFreshCascadeField.includes(fieldName)) {
|
|
await this.updateFieldOption(fieldName, meta, false);
|
|
}
|
|
}
|
|
},
|
|
async initData() {
|
|
for (const member of scanDecoratedMembers(
|
|
this.$attrs.target,
|
|
"table:formField"
|
|
)) {
|
|
await this.updateFieldOption(member.fieldName, member.meta);
|
|
}
|
|
},
|
|
initFormItem() {
|
|
let formItems = [];
|
|
const that = this;
|
|
const target = this.$attrs.target;
|
|
const isShowDefaultSubmit = isEmpty(
|
|
this.$attrs["is-show-default-submit"]
|
|
) ? true : !!this.$attrs["is-show-default-submit"];
|
|
const metaMap = /* @__PURE__ */ new Map();
|
|
for (const member of scanDecoratedMembers(
|
|
target,
|
|
"table:formField"
|
|
)) {
|
|
metaMap.set(member.fieldName, member.meta);
|
|
}
|
|
for (const fieldName of this.showList) {
|
|
const metaData = metaMap.get(fieldName);
|
|
if (!metaData)
|
|
continue;
|
|
const currentValue = that.formModel[fieldName];
|
|
const formItemProps = { label: metaData.def, prop: fieldName };
|
|
switch (metaData.fieldType) {
|
|
case "primaryKey":
|
|
break;
|
|
case "upload":
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(Upload, {
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => that.initForm(fieldName, value)
|
|
})
|
|
)
|
|
);
|
|
break;
|
|
case "treeSelect":
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(_sfc_main$5, {
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => that.initForm(fieldName, value),
|
|
size: "default",
|
|
search: true,
|
|
placeholder: "\u8BF7\u9009\u62E9" + metaData.def,
|
|
style: { width: "100%" },
|
|
props: { label: "name" },
|
|
...this.fieldOption.get(fieldName) || {}
|
|
})
|
|
)
|
|
);
|
|
break;
|
|
case "select": {
|
|
const selectData = this.fieldOption.get(fieldName);
|
|
const options = ((selectData == null ? void 0 : selectData.data) || []).map(
|
|
(option) => h(ElSelect.Option, {
|
|
key: option.value,
|
|
label: option.label,
|
|
value: option.value
|
|
})
|
|
);
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(
|
|
ElSelect,
|
|
{
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => {
|
|
that.initForm(fieldName, value);
|
|
this.$emit("formModelChange", that.formModel, fieldName);
|
|
},
|
|
size: "default",
|
|
multiple: !!(selectData == null ? void 0 : selectData.multiple),
|
|
collapseTags: true,
|
|
placeholder: "\u8BF7\u9009\u62E9" + metaData.def,
|
|
style: { width: "100%" }
|
|
},
|
|
() => options
|
|
)
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case "boolean":
|
|
case "switch":
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(ElSwitch, {
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => that.initForm(fieldName, value),
|
|
size: "default"
|
|
})
|
|
)
|
|
);
|
|
break;
|
|
case "date":
|
|
case "dateRange":
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(ElDatePicker, {
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => that.initForm(fieldName, value),
|
|
type: metaData.fieldType === "dateRange" ? "daterange" : "date",
|
|
valueFormat: "YYYY-MM-DD",
|
|
placeholder: metaData.placeholder || "\u8BF7\u9009\u62E9" + metaData.def,
|
|
style: { width: "100%" }
|
|
})
|
|
)
|
|
);
|
|
break;
|
|
case "input":
|
|
case "password":
|
|
case "textarea":
|
|
case "number":
|
|
default: {
|
|
if (metaData.component) {
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => h(metaData.component, {
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => that.initForm(fieldName, value)
|
|
})
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
const inputType = metaData.fieldType === "password" ? "password" : metaData.fieldType === "textarea" ? "textarea" : metaData.fieldType === "number" ? "number" : "text";
|
|
formItems.push(
|
|
h(
|
|
ElFormItem,
|
|
formItemProps,
|
|
() => {
|
|
var _a;
|
|
return h(ElInput, {
|
|
modelValue: currentValue,
|
|
"onUpdate:modelValue": (value) => that.initForm(fieldName, value),
|
|
type: inputType,
|
|
size: "default",
|
|
placeholder: metaData.placeholder || "\u8BF7\u8F93\u5165" + metaData.def,
|
|
maxlength: metaData.maxlength,
|
|
minlength: metaData.minlength,
|
|
showWordLimit: !!metaData.maxlength,
|
|
disabled: metaData.disabled || ((_a = metaData.isDisabled) == null ? void 0 : _a.call(metaData, that.formModel)) || false
|
|
});
|
|
}
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (isShowDefaultSubmit) {
|
|
formItems = formItems.concat(
|
|
h(
|
|
ElFormItem,
|
|
() => h("div", { class: that.$style["form-operate"] }, [
|
|
h(
|
|
ElButton,
|
|
{
|
|
class: that.$style["cancel"],
|
|
onClick: () => that.$emit("cancel")
|
|
},
|
|
() => "\u53D6\u6D88"
|
|
),
|
|
h(
|
|
ElButton,
|
|
{
|
|
class: that.$style["submit"],
|
|
onClick: this.onSubmit
|
|
},
|
|
() => "\u786E\u5B9A"
|
|
)
|
|
])
|
|
)
|
|
);
|
|
}
|
|
this.formItems = formItems;
|
|
},
|
|
initRule(isBeforeMount = true) {
|
|
var _a;
|
|
const detail = ((_a = this.$attrs) == null ? void 0 : _a.data) || {};
|
|
const that = this;
|
|
let maxLabelWidth = that.maxLabelWidth;
|
|
for (const member of scanDecoratedMembers(
|
|
this.$attrs.target,
|
|
"table:formField"
|
|
)) {
|
|
const { fieldName, meta } = member;
|
|
if (meta.cascadeFiled) {
|
|
this.cascadeMap.set(fieldName, meta.cascadeFiled);
|
|
}
|
|
if (isBeforeMount) {
|
|
if (detail.id !== void 0 && detail.id !== null) {
|
|
that.formModel[fieldName] = detail[fieldName];
|
|
} else {
|
|
that.formModel[fieldName] = detail && Object.keys(detail).length > 0 ? detail[fieldName] : member.value;
|
|
}
|
|
}
|
|
if (meta.fieldType === "ip") {
|
|
this.rules[fieldName] = [this.getRule({ type: "ip" })];
|
|
} else if (meta.fieldType === "port") {
|
|
this.rules[fieldName] = [this.getRule({ type: "port" })];
|
|
}
|
|
if (meta.rule) {
|
|
this.rules[fieldName] = Array.isArray(meta.rule) ? meta.rule.map((item) => this.getRule(item)) : [this.getRule(meta.rule)];
|
|
}
|
|
const isRequired = (this.rules[fieldName] || []).some(
|
|
(rule) => rule.required
|
|
);
|
|
const labelWidth = measureTextWidth(meta.def) + (isRequired ? 16 : 0);
|
|
if (labelWidth > maxLabelWidth)
|
|
maxLabelWidth = labelWidth;
|
|
}
|
|
this.maxLabelWidth = maxLabelWidth;
|
|
},
|
|
async init() {
|
|
await this.initData();
|
|
await this.initShowFieldList(this.formModel);
|
|
this.initFormItem();
|
|
},
|
|
initForm(fieldName, value) {
|
|
this.formModel = { ...this.formModel, [fieldName]: value };
|
|
}
|
|
},
|
|
watch: {
|
|
formModel: {
|
|
async handler(v, oldV) {
|
|
var _a, _b;
|
|
this.initRule(false);
|
|
const refs = this.$refs;
|
|
let needFreshCascadeField = [];
|
|
const editingField = [];
|
|
for (const key in v) {
|
|
if (!isEqual(v[key], oldV == null ? void 0 : oldV[key])) {
|
|
needFreshCascadeField = this.cascadeMap.get(key) || [];
|
|
editingField.push(key);
|
|
}
|
|
}
|
|
await this.refreshForm(v, oldV, needFreshCascadeField);
|
|
await nextTick();
|
|
for (const item of editingField) {
|
|
try {
|
|
await ((_b = (_a = refs == null ? void 0 : refs.formRef) == null ? void 0 : _a.validateField) == null ? void 0 : _b.call(_a, item));
|
|
} catch {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
formCom() {
|
|
if (!this.formItems)
|
|
return null;
|
|
return h(
|
|
ElForm,
|
|
{
|
|
ref: "formRef",
|
|
key: this.formItems.length,
|
|
model: this.formModel,
|
|
rules: this.rules,
|
|
validateOnRuleChange: false,
|
|
labelPosition: "right",
|
|
labelWidth: this.maxLabelWidth + 20 + "px"
|
|
},
|
|
() => this.formItems
|
|
);
|
|
}
|
|
},
|
|
beforeMount() {
|
|
this.rules = {};
|
|
this.initRule();
|
|
this.init();
|
|
},
|
|
render() {
|
|
return this.formCom;
|
|
}
|
|
});
|
|
const cssModules$2 = {
|
|
"$style": style0$2
|
|
};
|
|
var UmTableForm = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__cssModules", cssModules$2]]);
|
|
const __default__$1 = {
|
|
name: "UmSyncNodeForm",
|
|
inheritAttrs: false
|
|
};
|
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
...__default__$1,
|
|
props: {
|
|
data: null,
|
|
depData: null
|
|
},
|
|
emits: ["cancel"],
|
|
setup(__props) {
|
|
const props = __props;
|
|
class SyncNode {
|
|
}
|
|
const tableForm = ref();
|
|
const formId = ref(-99);
|
|
const moduleFieldName = ref("moduleId");
|
|
const moduleFieldTitle = ref("\u6A21\u5757\u540D\u79F0");
|
|
const formModel = ref({});
|
|
const target = computed(() => {
|
|
var _a, _b, _c, _d, _e;
|
|
const modules = (_b = (_a = props.depData) == null ? void 0 : _a.data) != null ? _b : [];
|
|
const field = unref(moduleFieldName);
|
|
if (Array.isArray(modules)) {
|
|
SyncNode.prototype[field] = (_d = formModel.value[field]) != null ? _d : (_c = modules[0]) == null ? void 0 : _c.id;
|
|
Reflect.defineMetadata(
|
|
"table:formField",
|
|
{
|
|
lang: "",
|
|
def: moduleFieldTitle.value,
|
|
fieldType: "select",
|
|
getData: () => ({ data: modules })
|
|
},
|
|
SyncNode.prototype,
|
|
field
|
|
);
|
|
}
|
|
const current = (_e = modules.find) == null ? void 0 : _e.call(
|
|
modules,
|
|
(item) => item.id == formModel.value[field]
|
|
);
|
|
if (Array.isArray(current == null ? void 0 : current.configList)) {
|
|
current.configList.forEach((item) => {
|
|
const rules = [];
|
|
if (item.required)
|
|
rules.push({ type: "require", message: "\u4E0D\u80FD\u4E3A\u7A7A" });
|
|
if (item.max || item.min) {
|
|
rules.push({ type: "len", max: item.max, min: item.min });
|
|
}
|
|
SyncNode.prototype[item.code] = "";
|
|
Reflect.defineMetadata(
|
|
"table:formField",
|
|
{
|
|
lang: "",
|
|
def: item.name,
|
|
fieldType: item.styleName,
|
|
rule: rules,
|
|
getData: () => {
|
|
var _a2;
|
|
return { data: (_a2 = item.data) != null ? _a2 : [] };
|
|
}
|
|
},
|
|
SyncNode.prototype,
|
|
item.code
|
|
);
|
|
});
|
|
}
|
|
return SyncNode;
|
|
});
|
|
let lastApplied = null;
|
|
watch([formModel, tableForm], ([model, instance]) => {
|
|
var _a;
|
|
if (!instance || model === lastApplied)
|
|
return;
|
|
lastApplied = model;
|
|
(_a = instance.setFormModel) == null ? void 0 : _a.call(instance, model);
|
|
});
|
|
onBeforeMount(() => {
|
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
moduleFieldName.value = ((_a = props.depData) == null ? void 0 : _a.moduleId) || "moduleId";
|
|
moduleFieldTitle.value = ((_b = props.depData) == null ? void 0 : _b.moduleName) || "\u6A21\u5757\u540D\u79F0";
|
|
const modules = (_d = (_c = props.depData) == null ? void 0 : _c.data) != null ? _d : [];
|
|
formModel.value = {
|
|
...props.data || {},
|
|
[moduleFieldName.value]: (_g = (_e = props.data) == null ? void 0 : _e[moduleFieldName.value]) != null ? _g : (_f = modules[0]) == null ? void 0 : _f.id
|
|
};
|
|
});
|
|
const onFormModelChange = (v) => {
|
|
formId.value = v == null ? void 0 : v[moduleFieldName.value];
|
|
formModel.value = { ...formModel.value, [moduleFieldName.value]: formId.value };
|
|
};
|
|
const onOk = (_data) => {
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createBlock(UmTableForm, {
|
|
key: formId.value,
|
|
ref_key: "tableForm",
|
|
ref: tableForm,
|
|
target: unref(target),
|
|
onFormModelChange,
|
|
onCancel: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("cancel")),
|
|
onOk
|
|
}, null, 8, ["target"]);
|
|
};
|
|
}
|
|
});
|
|
const TableColumnPropertyDecorator = (value) => (target, propertyKey) => {
|
|
Reflect.defineMetadata(
|
|
"table:field",
|
|
{
|
|
width: 100,
|
|
sort: 1,
|
|
...value
|
|
},
|
|
target,
|
|
propertyKey
|
|
);
|
|
};
|
|
const TableFormColumnPropertyDecorator = (value) => (target, propertyKey) => {
|
|
Reflect.defineMetadata(
|
|
"table:formField",
|
|
value,
|
|
target,
|
|
propertyKey
|
|
);
|
|
};
|
|
const TableSearchFormPropertyDecorator = (value) => (target, propertyKey) => {
|
|
Reflect.defineMetadata(
|
|
"table:searchFormField",
|
|
value,
|
|
target,
|
|
propertyKey
|
|
);
|
|
};
|
|
const TableColumnMethodDecorator = ({
|
|
key = "table:operate",
|
|
value
|
|
}) => (target, propertyKey) => {
|
|
Reflect.defineMetadata(
|
|
key,
|
|
{
|
|
priority: 1,
|
|
...value,
|
|
es: (value == null ? void 0 : value.es) || "onNow"
|
|
},
|
|
target,
|
|
propertyKey
|
|
);
|
|
};
|
|
class Cache {
|
|
static get(key) {
|
|
if (isEmpty(key))
|
|
return null;
|
|
return __privateGet(this, _historyInfo).get(key);
|
|
}
|
|
static set(key, value) {
|
|
if (isEmpty(key))
|
|
return;
|
|
__privateGet(this, _historyInfo).set(key, value);
|
|
}
|
|
}
|
|
_historyInfo = new WeakMap();
|
|
__privateAdd(Cache, _historyInfo, /* @__PURE__ */ new Map());
|
|
const title = "_title_1qin3_9";
|
|
var style0$1 = {
|
|
"um-district-tree-node": "_um-district-tree-node_1qin3_1",
|
|
title
|
|
};
|
|
const _hoisted_1$1 = ["title"];
|
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
props: {
|
|
title: null,
|
|
id: null,
|
|
officeLevel: null,
|
|
officeLevelData: null,
|
|
dictTypes: null
|
|
},
|
|
setup(__props) {
|
|
const props = __props;
|
|
const DISTRICT = "icon-a-gonganjubeifen5";
|
|
const OFFICE = "icon-gonganju";
|
|
const DISTRICTAREA = "icon-a-bianzu171";
|
|
const dict = computed(() => {
|
|
var _a, _b, _c, _d;
|
|
return {
|
|
district: (_b = (_a = props.dictTypes) == null ? void 0 : _a.district) != null ? _b : "DISTRICTNODE",
|
|
office: (_d = (_c = props.dictTypes) == null ? void 0 : _c.office) != null ? _d : "DISTRICTOFFICE"
|
|
};
|
|
});
|
|
const iconClass = computed(() => {
|
|
var _a, _b;
|
|
const level = props.officeLevel;
|
|
const typeName = (_b = (_a = props.officeLevelData) == null ? void 0 : _a.find(
|
|
(item) => item.id == level
|
|
)) == null ? void 0 : _b.typeName;
|
|
if (Cache.get(level) === DISTRICT || typeName === dict.value.district) {
|
|
Cache.set(level, DISTRICT);
|
|
return DISTRICT;
|
|
}
|
|
if (Cache.get(level) === OFFICE || typeName === dict.value.office) {
|
|
Cache.set(level, OFFICE);
|
|
return OFFICE;
|
|
}
|
|
return DISTRICTAREA;
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createElementBlock("div", {
|
|
class: normalizeClass(_ctx.$style["um-district-tree-node"]),
|
|
title: __props.title
|
|
}, [
|
|
createVNode(_sfc_main$k, { type: unref(iconClass) }, null, 8, ["type"]),
|
|
createElementVNode("span", {
|
|
class: normalizeClass(_ctx.$style["title"])
|
|
}, toDisplayString(__props.title), 3)
|
|
], 10, _hoisted_1$1);
|
|
};
|
|
}
|
|
});
|
|
const cssModules$1 = {
|
|
"$style": style0$1
|
|
};
|
|
var UmDistrictTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__cssModules", cssModules$1]]);
|
|
var style0 = {
|
|
"um-tree": "_um-tree_8ig8y_1"
|
|
};
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
props: {
|
|
treeData: null,
|
|
keyword: null,
|
|
nodeId: null,
|
|
officeLevelData: null,
|
|
fetchOfficeLevelData: null,
|
|
dictTypes: { default: () => ({
|
|
district: "DISTRICTNODE",
|
|
office: "DISTRICTOFFICE"
|
|
}) }
|
|
},
|
|
emits: ["onSelect"],
|
|
setup(__props, { expose, emit }) {
|
|
const props = __props;
|
|
const districtTreeRef = ref();
|
|
const treeProps = ref({
|
|
label: "name",
|
|
children: "children",
|
|
disabled: "disabled"
|
|
});
|
|
const innerOfficeLevelData = ref([]);
|
|
const resolvedOfficeLevelData = computed(
|
|
() => {
|
|
var _a;
|
|
return (_a = props.officeLevelData) != null ? _a : innerOfficeLevelData.value;
|
|
}
|
|
);
|
|
async function loadOfficeLevelData() {
|
|
if (props.officeLevelData || !props.fetchOfficeLevelData)
|
|
return;
|
|
const { code, data } = await props.fetchOfficeLevelData();
|
|
innerOfficeLevelData.value = code === 0 ? data : [];
|
|
}
|
|
loadOfficeLevelData();
|
|
watch([() => props.nodeId, districtTreeRef], ([nodeId, tree]) => {
|
|
if (tree)
|
|
tree.setSelectKey(nodeId);
|
|
});
|
|
expose({
|
|
setSelectKey: (v) => {
|
|
var _a;
|
|
return (_a = districtTreeRef.value) == null ? void 0 : _a.setSelectKey(v);
|
|
},
|
|
refresh: loadOfficeLevelData
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return unref(resolvedOfficeLevelData) && unref(resolvedOfficeLevelData).length > 0 ? (openBlock(), createBlock(_sfc_main$6, {
|
|
key: 0,
|
|
ref_key: "districtTreeRef",
|
|
ref: districtTreeRef,
|
|
keyword: __props.keyword,
|
|
class: normalizeClass(_ctx.$style["um-tree"]),
|
|
"tree-data": __props.treeData,
|
|
props: treeProps.value,
|
|
"default-expand-all": true,
|
|
onOnSelect: _cache[0] || (_cache[0] = (key, record) => _ctx.$emit("onSelect", key, record))
|
|
}, {
|
|
default: withCtx(({ node, data }) => [
|
|
createVNode(UmDistrictTreeNode, {
|
|
title: node.label,
|
|
id: node.id,
|
|
"office-level": data.officeLevel,
|
|
"office-level-data": unref(resolvedOfficeLevelData),
|
|
"dict-types": __props.dictTypes
|
|
}, null, 8, ["title", "id", "office-level", "office-level-data", "dict-types"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["keyword", "class", "tree-data", "props"])) : createCommentVNode("", true);
|
|
};
|
|
}
|
|
});
|
|
const cssModules = {
|
|
"$style": style0
|
|
};
|
|
var UmDistrictTree = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules]]);
|
|
const _hoisted_1 = { class: "el-tree-node__label" };
|
|
const __default__ = {
|
|
name: "area-tree",
|
|
inheritAttrs: false
|
|
};
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
...__default__,
|
|
props: {
|
|
treeData: null,
|
|
props: null,
|
|
defaultExpandAll: { type: Boolean, default: false },
|
|
keyword: null,
|
|
nodeKey: { default: "id" }
|
|
},
|
|
emits: ["onSelect"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const treeRef = ref();
|
|
watch(
|
|
() => props.keyword,
|
|
(v) => {
|
|
treeRef.value.filter(v);
|
|
}
|
|
);
|
|
const onFilter = (value, record) => {
|
|
if (!value)
|
|
return true;
|
|
return record.label.indexOf(value) !== -1;
|
|
};
|
|
const onSelect = (data, node, currentNode) => {
|
|
emit("onSelect", data, node, currentNode);
|
|
};
|
|
return (_ctx, _cache) => {
|
|
const _component_el_tree = resolveComponent("el-tree");
|
|
return openBlock(), createBlock(_component_el_tree, {
|
|
ref_key: "treeRef",
|
|
ref: treeRef,
|
|
data: __props.treeData,
|
|
props: props.props,
|
|
"default-expand-all": __props.defaultExpandAll,
|
|
"expand-on-click-node": false,
|
|
"filter-node-method": onFilter,
|
|
"highlight-current": "",
|
|
"node-key": __props.nodeKey,
|
|
onNodeClick: onSelect
|
|
}, {
|
|
default: withCtx(({ node }) => [
|
|
createElementVNode("span", _hoisted_1, toDisplayString(node.label), 1)
|
|
]),
|
|
_: 1
|
|
}, 8, ["data", "props", "default-expand-all", "node-key"]);
|
|
};
|
|
}
|
|
});
|
|
export { _sfc_main as AreaTree, DEFAULT_DEFER_TYPES, EVENT_PHASES, _sfc_main$k as Iconfont, TableColumnMethodDecorator, TableColumnPropertyDecorator, TableFormColumnPropertyDecorator, TableSearchFormPropertyDecorator, _sfc_main$d as UmByClass, UmByClassEnhance, UmColumnRender, _sfc_main$c as UmDialog, UmDistrictTree, UmDistrictTreeNode, UmPagination, UmSearchForm, _sfc_main$3 as UmSyncNodeForm, UmTable, _sfc_main$e as UmTableColumn, _sfc_main$b as UmTableDialog, UmTableForm, UmTableOperate, UmTableToolbar, _sfc_main$6 as UmTree, _sfc_main$5 as UmTreeSelect, buildOperateColumn, collectClassMembers, collectDataColumns, collectOperateGroups, collectToolbar, collectTypedTasks, createTargetInstance, diagnoseTarget, findMethodMeta, getMemberMeta, isDiagnosticsEnabled, normalizeFieldName, reportDiagnostics, reportDiagnosticsOnce, resolveOperateWidth, resolveShowOperate, runEventPipeline, scanDecoratedMembers, setDiagnosticsEnabled, sortTasksByPriority, transformFields };
|