fit2cloud-ui-plus 0.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +16 -0
- package/lib/favicon.bmp +0 -0
- package/lib/fit2cloud-ui-plus.es.js +3796 -0
- package/lib/fit2cloud-ui-plus.umd.js +1 -0
- package/package.json +48 -0
- package/src/components/filter-bar/FuFilter.vue +175 -0
- package/src/components/filter-bar/FuFilterBar.vue +75 -0
- package/src/components/filter-bar/FuFilterConditions.vue +29 -0
- package/src/components/filter-bar/FuSearchInput.vue +31 -0
- package/src/components/filter-bar/filter-components/FuFilterDate.vue +62 -0
- package/src/components/filter-bar/filter-components/FuFilterDateTime.vue +65 -0
- package/src/components/filter-bar/filter-components/FuFilterOption.vue +38 -0
- package/src/components/filter-bar/filter-components/FuFilterSelect.vue +143 -0
- package/src/components/filter-bar/index.ts +19 -0
- package/src/components/filter-bar/types.ts +31 -0
- package/src/components/read-write-switch/FuInputRwSwitch.vue +44 -0
- package/src/components/read-write-switch/FuReadWriteSwitch.vue +91 -0
- package/src/components/read-write-switch/FuSelectRwSwitch.vue +53 -0
- package/src/components/read-write-switch/index.ts +13 -0
- package/src/components/search-bar/FuComplexSearch.vue +108 -0
- package/src/components/search-bar/FuQuickSearch.vue +43 -0
- package/src/components/search-bar/FuSearchBar.vue +165 -0
- package/src/components/search-bar/FuSearchBarButton.vue +14 -0
- package/src/components/search-bar/FuSearchContions.vue +24 -0
- package/src/components/search-bar/index.ts +13 -0
- package/src/components/search-bar/store.ts +25 -0
- package/src/components/speed-dial/FuSpeedDial.vue +280 -0
- package/src/components/speed-dial/FuSpeedDialActionButton.vue +88 -0
- package/src/components/speed-dial/FuSpeedDialButton.vue +42 -0
- package/src/components/speed-dial/FuSpeedDialItem.vue +88 -0
- package/src/components/speed-dial/index.ts +11 -0
- package/src/components/split-pane/FuSplitPane.vue +228 -0
- package/src/components/split-pane/index.ts +8 -0
- package/src/components/steps/FuHorizontalNavigation.vue +18 -0
- package/src/components/steps/FuHorizontalSteps.vue +94 -0
- package/src/components/steps/FuStep.vue +13 -0
- package/src/components/steps/FuSteps.vue +22 -0
- package/src/components/steps/FuStepsFooter.ts +79 -0
- package/src/components/steps/FuVerticalNavigation.vue +35 -0
- package/src/components/steps/FuVerticalSteps.vue +79 -0
- package/src/components/steps/Stepper.ts +188 -0
- package/src/components/steps/index.ts +11 -0
- package/src/components/table/FuTable.vue +145 -0
- package/src/components/table/FuTableBody.ts +40 -0
- package/src/components/table/FuTablePagination.vue +42 -0
- package/src/components/table/index.ts +15 -0
- package/src/components/table/table-column-dropdown/FuTableColumnDropdown.vue +102 -0
- package/src/components/table/table-column-dropdown/index.ts +7 -0
- package/src/components/table/table-column-select/FuTableColumnSelect.vue +22 -0
- package/src/components/table/table-column-select/FuTableColumnSelectDialog.vue +99 -0
- package/src/components/table/table-column-select/FuTableColumnSelectPopover.vue +80 -0
- package/src/components/table/table-column-select/index.ts +8 -0
- package/src/components/table/table-column-select/utils.ts +59 -0
- package/src/components/table/table-operations/FuTableButton.vue +19 -0
- package/src/components/table/table-operations/FuTableMoreButton.vue +52 -0
- package/src/components/table/table-operations/FuTableOperations.vue +88 -0
- package/src/components/table/table-operations/index.ts +12 -0
- package/src/components/tabs/FuTabs.vue +84 -0
- package/src/components/tabs/index.ts +8 -0
- package/src/components/virtual-scroller/FuVirtualHorizontalScroll.js +96 -0
- package/src/components/virtual-scroller/FuVirtualScroll.js +15 -0
- package/src/components/virtual-scroller/FuVirtualVerticalScroll.js +95 -0
- package/src/components/virtual-scroller/index.js +10 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use-global-config/index.ts +32 -0
- package/src/hooks/use-locale/index.ts +47 -0
- package/src/index.ts +19 -0
- package/src/locale/index.ts +12 -0
- package/src/locale/lang/en.ts +58 -0
- package/src/locale/lang/zh-cn.ts +58 -0
- package/src/locale/lang/zh-tw.ts +58 -0
- package/src/styles/common/config.scss +5 -0
- package/src/styles/common/function.scss +81 -0
- package/src/styles/common/mixins.scss +85 -0
- package/src/styles/common/variables.scss +28 -0
- package/src/styles/components/filter-bar.scss +227 -0
- package/src/styles/components/read-write-switch.scss +6 -0
- package/src/styles/components/search-bar.scss +285 -0
- package/src/styles/components/speed-dial.scss +107 -0
- package/src/styles/components/split-pane.scss +111 -0
- package/src/styles/components/steps.scss +110 -0
- package/src/styles/components/table.scss +105 -0
- package/src/styles/components/tabs.scss +10 -0
- package/src/styles/components/virtual-scroller.scss +24 -0
- package/src/styles/index.scss +11 -0
- package/src/tools/theme.ts +23 -0
- package/src/tools/time.ts +30 -0
- package/src/tools/utils.ts +60 -0
|
@@ -0,0 +1,3796 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, mergeProps, getCurrentInstance, inject, computed, unref, isRef, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, createVNode, withCtx, provide, onMounted, createTextVNode, createCommentVNode, renderSlot, resolveDynamicComponent, toHandlers, nextTick, normalizeClass, withModifiers, h, withDirectives, vModelText, useSlots, normalizeStyle, Transition, reactive, onUpdated, vShow, normalizeProps, guardReactiveProps } from "vue";
|
|
25
|
+
var _export_sfc = (sfc, props) => {
|
|
26
|
+
const target = sfc.__vccOpts || sfc;
|
|
27
|
+
for (const [key, val] of props) {
|
|
28
|
+
target[key] = val;
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
const __default__$i = { name: "FuSearchInput" };
|
|
33
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$i), {
|
|
34
|
+
props: {
|
|
35
|
+
value: String
|
|
36
|
+
},
|
|
37
|
+
emits: ["input", "change"],
|
|
38
|
+
setup(__props, { emit }) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const quick = ref("");
|
|
41
|
+
watch(() => props.value, (val) => {
|
|
42
|
+
quick.value = val;
|
|
43
|
+
});
|
|
44
|
+
function input(e) {
|
|
45
|
+
emit("input", quick.value, e);
|
|
46
|
+
}
|
|
47
|
+
function blur(e) {
|
|
48
|
+
emit("change", quick.value, e);
|
|
49
|
+
}
|
|
50
|
+
function keydown(e) {
|
|
51
|
+
const event = e;
|
|
52
|
+
if (event.key === "Enter") {
|
|
53
|
+
emit("change", quick.value, e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
const _component_el_input = resolveComponent("el-input");
|
|
58
|
+
return openBlock(), createBlock(_component_el_input, mergeProps({
|
|
59
|
+
class: "fu-search-input",
|
|
60
|
+
"prefix-icon": "Search",
|
|
61
|
+
modelValue: quick.value,
|
|
62
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => quick.value = $event),
|
|
63
|
+
onInput: input,
|
|
64
|
+
onBlur: blur,
|
|
65
|
+
onKeydown: keydown
|
|
66
|
+
}, _ctx.$attrs, { clearable: "" }), null, 16, ["modelValue"]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
var FuSearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/FuSearchInput.vue"]]);
|
|
71
|
+
const globalConfig = ref();
|
|
72
|
+
function useGlobalConfig(key, defaultValue = void 0) {
|
|
73
|
+
const config = getCurrentInstance() ? inject(Symbol(), globalConfig) : globalConfig;
|
|
74
|
+
if (key) {
|
|
75
|
+
return computed(() => {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
return config;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
84
|
+
var freeGlobal$1 = freeGlobal;
|
|
85
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
86
|
+
var root = freeGlobal$1 || freeSelf || Function("return this")();
|
|
87
|
+
var root$1 = root;
|
|
88
|
+
var Symbol$1 = root$1.Symbol;
|
|
89
|
+
var Symbol$2 = Symbol$1;
|
|
90
|
+
var objectProto$4 = Object.prototype;
|
|
91
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
92
|
+
var nativeObjectToString$1 = objectProto$4.toString;
|
|
93
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
94
|
+
function getRawTag(value) {
|
|
95
|
+
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
96
|
+
try {
|
|
97
|
+
value[symToStringTag$1] = void 0;
|
|
98
|
+
var unmasked = true;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
}
|
|
101
|
+
var result = nativeObjectToString$1.call(value);
|
|
102
|
+
if (unmasked) {
|
|
103
|
+
if (isOwn) {
|
|
104
|
+
value[symToStringTag$1] = tag;
|
|
105
|
+
} else {
|
|
106
|
+
delete value[symToStringTag$1];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
var objectProto$3 = Object.prototype;
|
|
112
|
+
var nativeObjectToString = objectProto$3.toString;
|
|
113
|
+
function objectToString(value) {
|
|
114
|
+
return nativeObjectToString.call(value);
|
|
115
|
+
}
|
|
116
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
117
|
+
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
118
|
+
function baseGetTag(value) {
|
|
119
|
+
if (value == null) {
|
|
120
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
121
|
+
}
|
|
122
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
123
|
+
}
|
|
124
|
+
function isObjectLike(value) {
|
|
125
|
+
return value != null && typeof value == "object";
|
|
126
|
+
}
|
|
127
|
+
var symbolTag = "[object Symbol]";
|
|
128
|
+
function isSymbol(value) {
|
|
129
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
130
|
+
}
|
|
131
|
+
function arrayMap(array, iteratee) {
|
|
132
|
+
var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
133
|
+
while (++index2 < length) {
|
|
134
|
+
result[index2] = iteratee(array[index2], index2, array);
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
var isArray = Array.isArray;
|
|
139
|
+
var isArray$1 = isArray;
|
|
140
|
+
var INFINITY$1 = 1 / 0;
|
|
141
|
+
var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
142
|
+
function baseToString(value) {
|
|
143
|
+
if (typeof value == "string") {
|
|
144
|
+
return value;
|
|
145
|
+
}
|
|
146
|
+
if (isArray$1(value)) {
|
|
147
|
+
return arrayMap(value, baseToString) + "";
|
|
148
|
+
}
|
|
149
|
+
if (isSymbol(value)) {
|
|
150
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
151
|
+
}
|
|
152
|
+
var result = value + "";
|
|
153
|
+
return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
|
|
154
|
+
}
|
|
155
|
+
function isObject(value) {
|
|
156
|
+
var type = typeof value;
|
|
157
|
+
return value != null && (type == "object" || type == "function");
|
|
158
|
+
}
|
|
159
|
+
var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
160
|
+
function isFunction(value) {
|
|
161
|
+
if (!isObject(value)) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
var tag = baseGetTag(value);
|
|
165
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
166
|
+
}
|
|
167
|
+
var coreJsData = root$1["__core-js_shared__"];
|
|
168
|
+
var coreJsData$1 = coreJsData;
|
|
169
|
+
var maskSrcKey = function() {
|
|
170
|
+
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
|
|
171
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
172
|
+
}();
|
|
173
|
+
function isMasked(func) {
|
|
174
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
175
|
+
}
|
|
176
|
+
var funcProto$1 = Function.prototype;
|
|
177
|
+
var funcToString$1 = funcProto$1.toString;
|
|
178
|
+
function toSource(func) {
|
|
179
|
+
if (func != null) {
|
|
180
|
+
try {
|
|
181
|
+
return funcToString$1.call(func);
|
|
182
|
+
} catch (e) {
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
return func + "";
|
|
186
|
+
} catch (e) {
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return "";
|
|
190
|
+
}
|
|
191
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
192
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
193
|
+
var funcProto = Function.prototype, objectProto$2 = Object.prototype;
|
|
194
|
+
var funcToString = funcProto.toString;
|
|
195
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
196
|
+
var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
197
|
+
function baseIsNative(value) {
|
|
198
|
+
if (!isObject(value) || isMasked(value)) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
202
|
+
return pattern.test(toSource(value));
|
|
203
|
+
}
|
|
204
|
+
function getValue(object, key) {
|
|
205
|
+
return object == null ? void 0 : object[key];
|
|
206
|
+
}
|
|
207
|
+
function getNative(object, key) {
|
|
208
|
+
var value = getValue(object, key);
|
|
209
|
+
return baseIsNative(value) ? value : void 0;
|
|
210
|
+
}
|
|
211
|
+
function eq(value, other) {
|
|
212
|
+
return value === other || value !== value && other !== other;
|
|
213
|
+
}
|
|
214
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
|
|
215
|
+
function isKey(value, object) {
|
|
216
|
+
if (isArray$1(value)) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
var type = typeof value;
|
|
220
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
224
|
+
}
|
|
225
|
+
var nativeCreate = getNative(Object, "create");
|
|
226
|
+
var nativeCreate$1 = nativeCreate;
|
|
227
|
+
function hashClear() {
|
|
228
|
+
this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
|
|
229
|
+
this.size = 0;
|
|
230
|
+
}
|
|
231
|
+
function hashDelete(key) {
|
|
232
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
233
|
+
this.size -= result ? 1 : 0;
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
237
|
+
var objectProto$1 = Object.prototype;
|
|
238
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
239
|
+
function hashGet(key) {
|
|
240
|
+
var data = this.__data__;
|
|
241
|
+
if (nativeCreate$1) {
|
|
242
|
+
var result = data[key];
|
|
243
|
+
return result === HASH_UNDEFINED$1 ? void 0 : result;
|
|
244
|
+
}
|
|
245
|
+
return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
|
|
246
|
+
}
|
|
247
|
+
var objectProto = Object.prototype;
|
|
248
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
249
|
+
function hashHas(key) {
|
|
250
|
+
var data = this.__data__;
|
|
251
|
+
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
252
|
+
}
|
|
253
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
254
|
+
function hashSet(key, value) {
|
|
255
|
+
var data = this.__data__;
|
|
256
|
+
this.size += this.has(key) ? 0 : 1;
|
|
257
|
+
data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED : value;
|
|
258
|
+
return this;
|
|
259
|
+
}
|
|
260
|
+
function Hash(entries) {
|
|
261
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
262
|
+
this.clear();
|
|
263
|
+
while (++index2 < length) {
|
|
264
|
+
var entry = entries[index2];
|
|
265
|
+
this.set(entry[0], entry[1]);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
Hash.prototype.clear = hashClear;
|
|
269
|
+
Hash.prototype["delete"] = hashDelete;
|
|
270
|
+
Hash.prototype.get = hashGet;
|
|
271
|
+
Hash.prototype.has = hashHas;
|
|
272
|
+
Hash.prototype.set = hashSet;
|
|
273
|
+
function listCacheClear() {
|
|
274
|
+
this.__data__ = [];
|
|
275
|
+
this.size = 0;
|
|
276
|
+
}
|
|
277
|
+
function assocIndexOf(array, key) {
|
|
278
|
+
var length = array.length;
|
|
279
|
+
while (length--) {
|
|
280
|
+
if (eq(array[length][0], key)) {
|
|
281
|
+
return length;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return -1;
|
|
285
|
+
}
|
|
286
|
+
var arrayProto = Array.prototype;
|
|
287
|
+
var splice = arrayProto.splice;
|
|
288
|
+
function listCacheDelete(key) {
|
|
289
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
290
|
+
if (index2 < 0) {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
var lastIndex = data.length - 1;
|
|
294
|
+
if (index2 == lastIndex) {
|
|
295
|
+
data.pop();
|
|
296
|
+
} else {
|
|
297
|
+
splice.call(data, index2, 1);
|
|
298
|
+
}
|
|
299
|
+
--this.size;
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
function listCacheGet(key) {
|
|
303
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
304
|
+
return index2 < 0 ? void 0 : data[index2][1];
|
|
305
|
+
}
|
|
306
|
+
function listCacheHas(key) {
|
|
307
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
308
|
+
}
|
|
309
|
+
function listCacheSet(key, value) {
|
|
310
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
311
|
+
if (index2 < 0) {
|
|
312
|
+
++this.size;
|
|
313
|
+
data.push([key, value]);
|
|
314
|
+
} else {
|
|
315
|
+
data[index2][1] = value;
|
|
316
|
+
}
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
319
|
+
function ListCache(entries) {
|
|
320
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
321
|
+
this.clear();
|
|
322
|
+
while (++index2 < length) {
|
|
323
|
+
var entry = entries[index2];
|
|
324
|
+
this.set(entry[0], entry[1]);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
ListCache.prototype.clear = listCacheClear;
|
|
328
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
329
|
+
ListCache.prototype.get = listCacheGet;
|
|
330
|
+
ListCache.prototype.has = listCacheHas;
|
|
331
|
+
ListCache.prototype.set = listCacheSet;
|
|
332
|
+
var Map$1 = getNative(root$1, "Map");
|
|
333
|
+
var Map$2 = Map$1;
|
|
334
|
+
function mapCacheClear() {
|
|
335
|
+
this.size = 0;
|
|
336
|
+
this.__data__ = {
|
|
337
|
+
"hash": new Hash(),
|
|
338
|
+
"map": new (Map$2 || ListCache)(),
|
|
339
|
+
"string": new Hash()
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
function isKeyable(value) {
|
|
343
|
+
var type = typeof value;
|
|
344
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
345
|
+
}
|
|
346
|
+
function getMapData(map, key) {
|
|
347
|
+
var data = map.__data__;
|
|
348
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
349
|
+
}
|
|
350
|
+
function mapCacheDelete(key) {
|
|
351
|
+
var result = getMapData(this, key)["delete"](key);
|
|
352
|
+
this.size -= result ? 1 : 0;
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
355
|
+
function mapCacheGet(key) {
|
|
356
|
+
return getMapData(this, key).get(key);
|
|
357
|
+
}
|
|
358
|
+
function mapCacheHas(key) {
|
|
359
|
+
return getMapData(this, key).has(key);
|
|
360
|
+
}
|
|
361
|
+
function mapCacheSet(key, value) {
|
|
362
|
+
var data = getMapData(this, key), size = data.size;
|
|
363
|
+
data.set(key, value);
|
|
364
|
+
this.size += data.size == size ? 0 : 1;
|
|
365
|
+
return this;
|
|
366
|
+
}
|
|
367
|
+
function MapCache(entries) {
|
|
368
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
369
|
+
this.clear();
|
|
370
|
+
while (++index2 < length) {
|
|
371
|
+
var entry = entries[index2];
|
|
372
|
+
this.set(entry[0], entry[1]);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
376
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
377
|
+
MapCache.prototype.get = mapCacheGet;
|
|
378
|
+
MapCache.prototype.has = mapCacheHas;
|
|
379
|
+
MapCache.prototype.set = mapCacheSet;
|
|
380
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
381
|
+
function memoize(func, resolver) {
|
|
382
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
383
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
384
|
+
}
|
|
385
|
+
var memoized = function() {
|
|
386
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
387
|
+
if (cache.has(key)) {
|
|
388
|
+
return cache.get(key);
|
|
389
|
+
}
|
|
390
|
+
var result = func.apply(this, args);
|
|
391
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
392
|
+
return result;
|
|
393
|
+
};
|
|
394
|
+
memoized.cache = new (memoize.Cache || MapCache)();
|
|
395
|
+
return memoized;
|
|
396
|
+
}
|
|
397
|
+
memoize.Cache = MapCache;
|
|
398
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
399
|
+
function memoizeCapped(func) {
|
|
400
|
+
var result = memoize(func, function(key) {
|
|
401
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
402
|
+
cache.clear();
|
|
403
|
+
}
|
|
404
|
+
return key;
|
|
405
|
+
});
|
|
406
|
+
var cache = result.cache;
|
|
407
|
+
return result;
|
|
408
|
+
}
|
|
409
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
410
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
411
|
+
var stringToPath = memoizeCapped(function(string) {
|
|
412
|
+
var result = [];
|
|
413
|
+
if (string.charCodeAt(0) === 46) {
|
|
414
|
+
result.push("");
|
|
415
|
+
}
|
|
416
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
417
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
418
|
+
});
|
|
419
|
+
return result;
|
|
420
|
+
});
|
|
421
|
+
var stringToPath$1 = stringToPath;
|
|
422
|
+
function toString(value) {
|
|
423
|
+
return value == null ? "" : baseToString(value);
|
|
424
|
+
}
|
|
425
|
+
function castPath(value, object) {
|
|
426
|
+
if (isArray$1(value)) {
|
|
427
|
+
return value;
|
|
428
|
+
}
|
|
429
|
+
return isKey(value, object) ? [value] : stringToPath$1(toString(value));
|
|
430
|
+
}
|
|
431
|
+
var INFINITY = 1 / 0;
|
|
432
|
+
function toKey(value) {
|
|
433
|
+
if (typeof value == "string" || isSymbol(value)) {
|
|
434
|
+
return value;
|
|
435
|
+
}
|
|
436
|
+
var result = value + "";
|
|
437
|
+
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
438
|
+
}
|
|
439
|
+
function baseGet(object, path) {
|
|
440
|
+
path = castPath(path, object);
|
|
441
|
+
var index2 = 0, length = path.length;
|
|
442
|
+
while (object != null && index2 < length) {
|
|
443
|
+
object = object[toKey(path[index2++])];
|
|
444
|
+
}
|
|
445
|
+
return index2 && index2 == length ? object : void 0;
|
|
446
|
+
}
|
|
447
|
+
function get(object, path, defaultValue) {
|
|
448
|
+
var result = object == null ? void 0 : baseGet(object, path);
|
|
449
|
+
return result === void 0 ? defaultValue : result;
|
|
450
|
+
}
|
|
451
|
+
var Chinese = {
|
|
452
|
+
name: "zh-cn",
|
|
453
|
+
fu: {
|
|
454
|
+
filter_bar: {
|
|
455
|
+
filter: "\u7B5B\u9009",
|
|
456
|
+
results: "\u4E2A\u7ED3\u679C",
|
|
457
|
+
clear: "\u6E05\u7A7A\u6761\u4EF6",
|
|
458
|
+
drawer_title: "\u7B5B\u9009\u6761\u4EF6",
|
|
459
|
+
cancel: "\u53D6\u6D88",
|
|
460
|
+
search: "\u67E5\u8BE2",
|
|
461
|
+
select_all: "\u5168\u9009",
|
|
462
|
+
more: "\u66F4\u591A"
|
|
463
|
+
},
|
|
464
|
+
search_bar: {
|
|
465
|
+
search: "\u641C\u7D22",
|
|
466
|
+
adv_search: "\u9AD8\u7EA7\u641C\u7D22",
|
|
467
|
+
ok: "\u786E\u5B9A",
|
|
468
|
+
cancel: "\u53D6\u6D88",
|
|
469
|
+
please_select: "\u8BF7\u9009\u62E9",
|
|
470
|
+
please_input: "\u8BF7\u8F93\u5165",
|
|
471
|
+
like: "\u5305\u542B",
|
|
472
|
+
not_like: "\u4E0D\u5305\u542B",
|
|
473
|
+
in: "\u5C5E\u4E8E",
|
|
474
|
+
not_in: "\u4E0D\u5C5E\u4E8E",
|
|
475
|
+
gt: "\u5927\u4E8E",
|
|
476
|
+
ge: "\u5927\u4E8E\u7B49\u4E8E",
|
|
477
|
+
lt: "\u5C0F\u4E8E",
|
|
478
|
+
le: "\u5C0F\u4E8E\u7B49\u4E8E",
|
|
479
|
+
eq: "\u7B49\u4E8E",
|
|
480
|
+
ne: "\u4E0D\u7B49\u4E8E",
|
|
481
|
+
between: "\u4E4B\u95F4",
|
|
482
|
+
select_date: "\u9009\u62E9\u65E5\u671F",
|
|
483
|
+
start_date: "\u5F00\u59CB\u65E5\u671F",
|
|
484
|
+
end_date: "\u7ED3\u675F\u65E5\u671F",
|
|
485
|
+
select_date_time: "\u9009\u62E9\u65E5\u671F\u65F6\u95F4",
|
|
486
|
+
start_date_time: "\u5F00\u59CB\u65E5\u671F\u65F6\u95F4",
|
|
487
|
+
end_date_time: "\u7ED3\u675F\u65E5\u671F\u65F6\u95F4",
|
|
488
|
+
range_separator: "\u81F3",
|
|
489
|
+
data_time_error: "\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65E5\u671F",
|
|
490
|
+
clean: "\u6E05\u7A7A",
|
|
491
|
+
refresh: "\u5237\u65B0"
|
|
492
|
+
},
|
|
493
|
+
table: {
|
|
494
|
+
ok: "\u786E\u5B9A",
|
|
495
|
+
reset: "\u91CD\u7F6E",
|
|
496
|
+
custom_table_fields: "\u81EA\u5B9A\u4E49\u8868\u683C\u5B57\u6BB5",
|
|
497
|
+
custom_table_fields_desc: "\u56FA\u5B9A\u5B57\u6BB5\u4E0D\u5728\u9009\u62E9\u8303\u56F4\uFF0C\u53EF\u62D6\u62FD\u81EA\u5B9A\u4E49\u987A\u5E8F",
|
|
498
|
+
custom_table_rows: "\u9009\u9879\u5217",
|
|
499
|
+
more: "\u66F4\u591A"
|
|
500
|
+
},
|
|
501
|
+
steps: {
|
|
502
|
+
cancel: "\u53D6\u6D88",
|
|
503
|
+
next: "\u4E0B\u4E00\u6B65",
|
|
504
|
+
prev: "\u4E0A\u4E00\u6B65",
|
|
505
|
+
finish: "\u5B8C\u6210"
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
|
|
510
|
+
const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
|
|
511
|
+
var _a;
|
|
512
|
+
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
|
|
513
|
+
});
|
|
514
|
+
const buildLocaleContext = (locale) => {
|
|
515
|
+
const lang = computed(() => unref(locale).name);
|
|
516
|
+
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
517
|
+
return {
|
|
518
|
+
lang,
|
|
519
|
+
locale: localeRef,
|
|
520
|
+
t: buildTranslator(locale)
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
const useLocale = () => {
|
|
524
|
+
const locale = useGlobalConfig("locale");
|
|
525
|
+
return buildLocaleContext(computed(() => locale.value || Chinese));
|
|
526
|
+
};
|
|
527
|
+
const _hoisted_1$g = { class: "fu-filter-conditions" };
|
|
528
|
+
const _hoisted_2$c = { class: "condition-text" };
|
|
529
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
530
|
+
props: {
|
|
531
|
+
conditions: Array
|
|
532
|
+
},
|
|
533
|
+
emits: ["change"],
|
|
534
|
+
setup(__props, { emit }) {
|
|
535
|
+
const props = __props;
|
|
536
|
+
function remove(index2) {
|
|
537
|
+
var _a;
|
|
538
|
+
(_a = props.conditions) == null ? void 0 : _a.splice(index2, 1);
|
|
539
|
+
emit("change", props.conditions);
|
|
540
|
+
}
|
|
541
|
+
function text(condition) {
|
|
542
|
+
return condition.label + " " + condition.valueLabel || condition.value;
|
|
543
|
+
}
|
|
544
|
+
return (_ctx, _cache) => {
|
|
545
|
+
const _component_CloseBold = resolveComponent("CloseBold");
|
|
546
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
547
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
548
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.conditions, (condition, index2) => {
|
|
549
|
+
return openBlock(), createElementBlock("div", {
|
|
550
|
+
class: "fu-filter-conditions__item",
|
|
551
|
+
key: index2
|
|
552
|
+
}, [
|
|
553
|
+
createElementVNode("div", _hoisted_2$c, toDisplayString(text(condition)), 1),
|
|
554
|
+
createVNode(_component_el_icon, {
|
|
555
|
+
class: "fu-scale-click",
|
|
556
|
+
onClick: ($event) => remove(index2)
|
|
557
|
+
}, {
|
|
558
|
+
default: withCtx(() => [
|
|
559
|
+
createVNode(_component_CloseBold)
|
|
560
|
+
]),
|
|
561
|
+
_: 2
|
|
562
|
+
}, 1032, ["onClick"])
|
|
563
|
+
]);
|
|
564
|
+
}), 128))
|
|
565
|
+
]);
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
var FuFilterConditions = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/FuFilterConditions.vue"]]);
|
|
570
|
+
const selectKey = Symbol("SelectKey");
|
|
571
|
+
const referenceKey = Symbol("ReferenceKey");
|
|
572
|
+
const _hoisted_1$f = { class: "fu-filter__result" };
|
|
573
|
+
const _hoisted_2$b = { style: { "opacity": "0.6" } };
|
|
574
|
+
const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("div", { class: "fu-filter__split" }, null, -1);
|
|
575
|
+
const _hoisted_4$3 = { class: "drawer-body" };
|
|
576
|
+
const _hoisted_5$2 = { class: "drawer-footer" };
|
|
577
|
+
const __default__$h = { name: "FuFilter" };
|
|
578
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$h), {
|
|
579
|
+
props: {
|
|
580
|
+
count: {
|
|
581
|
+
type: Number,
|
|
582
|
+
default: 0
|
|
583
|
+
},
|
|
584
|
+
components: Array,
|
|
585
|
+
drawerWidth: {
|
|
586
|
+
type: [Number, String],
|
|
587
|
+
default: "680px"
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
emits: ["filter"],
|
|
591
|
+
setup(__props, { expose, emit }) {
|
|
592
|
+
const { t } = useLocale();
|
|
593
|
+
const filterRef = ref(null);
|
|
594
|
+
const conditionsRef = ref(null);
|
|
595
|
+
const drawer = ref(true);
|
|
596
|
+
const scroll = ref(false);
|
|
597
|
+
const conditions = ref([]);
|
|
598
|
+
const references = ref([]);
|
|
599
|
+
let leftTimer, rightTimer;
|
|
600
|
+
function mouseup() {
|
|
601
|
+
clearInterval(leftTimer);
|
|
602
|
+
clearInterval(rightTimer);
|
|
603
|
+
}
|
|
604
|
+
function left() {
|
|
605
|
+
var _a;
|
|
606
|
+
let el = (_a = conditionsRef.value) == null ? void 0 : _a.$el;
|
|
607
|
+
leftTimer = setInterval(() => {
|
|
608
|
+
if (el)
|
|
609
|
+
el.scrollLeft -= 15;
|
|
610
|
+
}, 50);
|
|
611
|
+
}
|
|
612
|
+
function right() {
|
|
613
|
+
var _a;
|
|
614
|
+
let el = (_a = conditionsRef.value) == null ? void 0 : _a.$el;
|
|
615
|
+
rightTimer = setInterval(() => {
|
|
616
|
+
if (el)
|
|
617
|
+
el.scrollLeft += 15;
|
|
618
|
+
}, 50);
|
|
619
|
+
}
|
|
620
|
+
function change() {
|
|
621
|
+
nextTick(() => {
|
|
622
|
+
var _a;
|
|
623
|
+
let el = (_a = conditionsRef.value) == null ? void 0 : _a.$el;
|
|
624
|
+
scroll.value = el != null && (el == null ? void 0 : el.getBoundingClientRect().width) >= scrollWidth.value;
|
|
625
|
+
});
|
|
626
|
+
emit("filter", conditions.value);
|
|
627
|
+
}
|
|
628
|
+
function setConditions(conditionObj) {
|
|
629
|
+
conditions.value = [];
|
|
630
|
+
if (conditionObj) {
|
|
631
|
+
Object.keys(conditionObj).forEach((key) => {
|
|
632
|
+
let value = conditionObj[key].value;
|
|
633
|
+
references.value.forEach((r) => {
|
|
634
|
+
if (r.field === key) {
|
|
635
|
+
r.init(value);
|
|
636
|
+
const condition = r.getCondition();
|
|
637
|
+
if (condition) {
|
|
638
|
+
conditions.value.push(condition);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
change();
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
function filter() {
|
|
647
|
+
conditions.value = [];
|
|
648
|
+
references.value.forEach((r) => {
|
|
649
|
+
let condition;
|
|
650
|
+
condition = r.getCondition();
|
|
651
|
+
if (condition) {
|
|
652
|
+
conditions.value.push(condition);
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
drawer.value = false;
|
|
656
|
+
change();
|
|
657
|
+
}
|
|
658
|
+
function open() {
|
|
659
|
+
drawer.value = true;
|
|
660
|
+
}
|
|
661
|
+
function initComponents() {
|
|
662
|
+
references.value.forEach((r) => {
|
|
663
|
+
let condition = conditions.value.find((c) => c.field === r.field);
|
|
664
|
+
r.init(condition == null ? void 0 : condition.value);
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
function clear() {
|
|
668
|
+
conditions.value = [];
|
|
669
|
+
initComponents();
|
|
670
|
+
change();
|
|
671
|
+
}
|
|
672
|
+
const scrollWidth = computed(() => {
|
|
673
|
+
const el = filterRef.value;
|
|
674
|
+
return el === null ? 0 : el.getBoundingClientRect().width - 210;
|
|
675
|
+
});
|
|
676
|
+
provide(referenceKey, references);
|
|
677
|
+
onMounted(() => {
|
|
678
|
+
drawer.value = false;
|
|
679
|
+
});
|
|
680
|
+
expose({
|
|
681
|
+
open,
|
|
682
|
+
setConditions
|
|
683
|
+
});
|
|
684
|
+
return (_ctx, _cache) => {
|
|
685
|
+
const _component_ArrowLeftBold = resolveComponent("ArrowLeftBold");
|
|
686
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
687
|
+
const _component_ArrowRightBold = resolveComponent("ArrowRightBold");
|
|
688
|
+
const _component_Delete = resolveComponent("Delete");
|
|
689
|
+
const _component_el_button = resolveComponent("el-button");
|
|
690
|
+
const _component_el_drawer = resolveComponent("el-drawer");
|
|
691
|
+
return openBlock(), createElementBlock("div", {
|
|
692
|
+
class: "fu-filter",
|
|
693
|
+
ref_key: "filterRef",
|
|
694
|
+
ref: filterRef
|
|
695
|
+
}, [
|
|
696
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
697
|
+
createTextVNode(toDisplayString(__props.count) + " ", 1),
|
|
698
|
+
createElementVNode("span", _hoisted_2$b, toDisplayString(unref(t)("fu.filter_bar.results")), 1)
|
|
699
|
+
]),
|
|
700
|
+
_hoisted_3$7,
|
|
701
|
+
scroll.value ? (openBlock(), createElementBlock("div", {
|
|
702
|
+
key: 0,
|
|
703
|
+
class: "fu-filter__scroll",
|
|
704
|
+
onMousedown: left,
|
|
705
|
+
onMouseup: mouseup
|
|
706
|
+
}, [
|
|
707
|
+
createVNode(_component_el_icon, null, {
|
|
708
|
+
default: withCtx(() => [
|
|
709
|
+
createVNode(_component_ArrowLeftBold)
|
|
710
|
+
]),
|
|
711
|
+
_: 1
|
|
712
|
+
})
|
|
713
|
+
], 32)) : createCommentVNode("v-if", true),
|
|
714
|
+
createVNode(FuFilterConditions, {
|
|
715
|
+
conditions: conditions.value,
|
|
716
|
+
onChange: change,
|
|
717
|
+
ref_key: "conditionsRef",
|
|
718
|
+
ref: conditionsRef
|
|
719
|
+
}, null, 8, ["conditions"]),
|
|
720
|
+
scroll.value ? (openBlock(), createElementBlock("div", {
|
|
721
|
+
key: 1,
|
|
722
|
+
class: "fu-filter__scroll",
|
|
723
|
+
onMousedown: right,
|
|
724
|
+
onMouseup: mouseup
|
|
725
|
+
}, [
|
|
726
|
+
createVNode(_component_el_icon, null, {
|
|
727
|
+
default: withCtx(() => [
|
|
728
|
+
createVNode(_component_ArrowRightBold)
|
|
729
|
+
]),
|
|
730
|
+
_: 1
|
|
731
|
+
})
|
|
732
|
+
], 32)) : createCommentVNode("v-if", true),
|
|
733
|
+
conditions.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
734
|
+
key: 2,
|
|
735
|
+
class: "fu-filter__clear fu-scale-click",
|
|
736
|
+
onClick: clear
|
|
737
|
+
}, [
|
|
738
|
+
createVNode(_component_el_icon, null, {
|
|
739
|
+
default: withCtx(() => [
|
|
740
|
+
createVNode(_component_Delete)
|
|
741
|
+
]),
|
|
742
|
+
_: 1
|
|
743
|
+
}),
|
|
744
|
+
createTextVNode(" " + toDisplayString(unref(t)("fu.filter_bar.clear")), 1)
|
|
745
|
+
])) : createCommentVNode("v-if", true),
|
|
746
|
+
createVNode(_component_el_drawer, {
|
|
747
|
+
size: __props.drawerWidth,
|
|
748
|
+
"custom-class": "fu-filter__drawer",
|
|
749
|
+
title: unref(t)("fu.filter_bar.drawer_title"),
|
|
750
|
+
modelValue: drawer.value,
|
|
751
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => drawer.value = $event),
|
|
752
|
+
onOpen: initComponents
|
|
753
|
+
}, {
|
|
754
|
+
default: withCtx(() => [
|
|
755
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
756
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
757
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.components, (c, i) => {
|
|
758
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), mergeProps({ key: i }, c, {
|
|
759
|
+
ref_for: true,
|
|
760
|
+
ref: c.field
|
|
761
|
+
}, toHandlers(c)), null, 16);
|
|
762
|
+
}), 128))
|
|
763
|
+
])
|
|
764
|
+
]),
|
|
765
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
766
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
767
|
+
createVNode(_component_el_button, {
|
|
768
|
+
onClick: _cache[0] || (_cache[0] = ($event) => drawer.value = false)
|
|
769
|
+
}, {
|
|
770
|
+
default: withCtx(() => [
|
|
771
|
+
createTextVNode(toDisplayString(unref(t)("fu.filter_bar.cancel")), 1)
|
|
772
|
+
]),
|
|
773
|
+
_: 1
|
|
774
|
+
}),
|
|
775
|
+
createVNode(_component_el_button, {
|
|
776
|
+
type: "primary",
|
|
777
|
+
onClick: filter
|
|
778
|
+
}, {
|
|
779
|
+
default: withCtx(() => [
|
|
780
|
+
createTextVNode(toDisplayString(unref(t)("fu.filter_bar.search")), 1)
|
|
781
|
+
]),
|
|
782
|
+
_: 1
|
|
783
|
+
})
|
|
784
|
+
])
|
|
785
|
+
])
|
|
786
|
+
]),
|
|
787
|
+
_: 3
|
|
788
|
+
}, 8, ["size", "title", "modelValue"])
|
|
789
|
+
], 512);
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
}));
|
|
793
|
+
var FuFilter = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/FuFilter.vue"]]);
|
|
794
|
+
const _hoisted_1$e = { class: "fu-filter-bar" };
|
|
795
|
+
const _hoisted_2$a = { class: "fu-filter-bar__top" };
|
|
796
|
+
const _hoisted_3$6 = { class: "top_left" };
|
|
797
|
+
const _hoisted_4$2 = { class: "top_right" };
|
|
798
|
+
const _hoisted_5$1 = { key: 0 };
|
|
799
|
+
const _hoisted_6 = { class: "fu-filter-bar__bottom" };
|
|
800
|
+
const __default__$g = { name: "FuFilterBar" };
|
|
801
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$g), {
|
|
802
|
+
props: {
|
|
803
|
+
resultCount: Number,
|
|
804
|
+
quickPlaceholder: String,
|
|
805
|
+
components: Array
|
|
806
|
+
},
|
|
807
|
+
emits: ["exec"],
|
|
808
|
+
setup(__props, { expose, emit }) {
|
|
809
|
+
const { t } = useLocale();
|
|
810
|
+
const quick = ref("");
|
|
811
|
+
const conditions = ref([]);
|
|
812
|
+
const filterRef = ref();
|
|
813
|
+
function open() {
|
|
814
|
+
var _a;
|
|
815
|
+
(_a = filterRef.value) == null ? void 0 : _a.open();
|
|
816
|
+
}
|
|
817
|
+
function change() {
|
|
818
|
+
emit("exec", conditionObj.value);
|
|
819
|
+
}
|
|
820
|
+
function filter(c) {
|
|
821
|
+
conditions.value = c;
|
|
822
|
+
emit("exec", conditionObj.value);
|
|
823
|
+
}
|
|
824
|
+
function setConditions(conditionObj2) {
|
|
825
|
+
var _a;
|
|
826
|
+
(_a = filterRef.value) == null ? void 0 : _a.setConditions(conditionObj2);
|
|
827
|
+
}
|
|
828
|
+
const conditionObj = computed(() => {
|
|
829
|
+
let obj = { quick: quick.value };
|
|
830
|
+
conditions.value.forEach((c) => {
|
|
831
|
+
obj[c.field] = c;
|
|
832
|
+
});
|
|
833
|
+
return obj;
|
|
834
|
+
});
|
|
835
|
+
expose({
|
|
836
|
+
setConditions
|
|
837
|
+
});
|
|
838
|
+
return (_ctx, _cache) => {
|
|
839
|
+
const _component_el_button = resolveComponent("el-button");
|
|
840
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
841
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
842
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
843
|
+
renderSlot(_ctx.$slots, "tl")
|
|
844
|
+
]),
|
|
845
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
846
|
+
renderSlot(_ctx.$slots, "tr", {}, () => [
|
|
847
|
+
createCommentVNode(' :size="configSize" '),
|
|
848
|
+
createVNode(FuSearchInput, {
|
|
849
|
+
modelValue: quick.value,
|
|
850
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => quick.value = $event),
|
|
851
|
+
placeholder: __props.quickPlaceholder,
|
|
852
|
+
onChange: change
|
|
853
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
854
|
+
createVNode(_component_el_button, {
|
|
855
|
+
onClick: open,
|
|
856
|
+
icon: "Filter"
|
|
857
|
+
}, {
|
|
858
|
+
default: withCtx(() => [
|
|
859
|
+
createTextVNode(toDisplayString(unref(t)("fu.filter_bar.filter")) + " ", 1),
|
|
860
|
+
conditions.value.length > 0 ? (openBlock(), createElementBlock("span", _hoisted_5$1, "(" + toDisplayString(conditions.value.length) + ")", 1)) : createCommentVNode("v-if", true)
|
|
861
|
+
]),
|
|
862
|
+
_: 1
|
|
863
|
+
})
|
|
864
|
+
]),
|
|
865
|
+
renderSlot(_ctx.$slots, "buttons")
|
|
866
|
+
])
|
|
867
|
+
]),
|
|
868
|
+
createElementVNode("div", _hoisted_6, [
|
|
869
|
+
createVNode(FuFilter, {
|
|
870
|
+
ref_key: "filterRef",
|
|
871
|
+
ref: filterRef,
|
|
872
|
+
onFilter: filter,
|
|
873
|
+
count: __props.resultCount,
|
|
874
|
+
components: __props.components
|
|
875
|
+
}, {
|
|
876
|
+
default: withCtx(() => [
|
|
877
|
+
renderSlot(_ctx.$slots, "default")
|
|
878
|
+
]),
|
|
879
|
+
_: 3
|
|
880
|
+
}, 8, ["count", "components"])
|
|
881
|
+
])
|
|
882
|
+
]);
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
}));
|
|
886
|
+
var FuFilterBar = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/FuFilterBar.vue"]]);
|
|
887
|
+
const _hoisted_1$d = ["onClick"];
|
|
888
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
889
|
+
props: {
|
|
890
|
+
value: {
|
|
891
|
+
type: [String, Number],
|
|
892
|
+
required: true
|
|
893
|
+
},
|
|
894
|
+
label: [String, Number],
|
|
895
|
+
disabled: {
|
|
896
|
+
type: Boolean,
|
|
897
|
+
default: false
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
setup(__props) {
|
|
901
|
+
const props = __props;
|
|
902
|
+
const select = inject(selectKey);
|
|
903
|
+
const selected = computed(() => {
|
|
904
|
+
if (!select)
|
|
905
|
+
return false;
|
|
906
|
+
if (Array.isArray(select.selection.value)) {
|
|
907
|
+
return select.selection.value.includes(props.value);
|
|
908
|
+
} else {
|
|
909
|
+
return select.selection.value === props.value;
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
function click() {
|
|
913
|
+
select == null ? void 0 : select.setSelected(props.value, selected.value);
|
|
914
|
+
}
|
|
915
|
+
return (_ctx, _cache) => {
|
|
916
|
+
return openBlock(), createElementBlock("div", {
|
|
917
|
+
class: normalizeClass(["fu-filter-option", { "is-selected": unref(selected), "is-disabled": __props.disabled }]),
|
|
918
|
+
onClick: withModifiers(click, ["stop"])
|
|
919
|
+
}, toDisplayString(__props.label || __props.value), 11, _hoisted_1$d);
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
var FuFilterOption = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterOption.vue"]]);
|
|
924
|
+
const _hoisted_1$c = { class: "fu-filter-component" };
|
|
925
|
+
const _hoisted_2$9 = { class: "fu-filter-component__label" };
|
|
926
|
+
const _hoisted_3$5 = { class: "fu-filter-component__content" };
|
|
927
|
+
const _hoisted_4$1 = { class: "fu-filter-option" };
|
|
928
|
+
const __default__$f = { name: "FuFilterSelect" };
|
|
929
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$f), {
|
|
930
|
+
props: {
|
|
931
|
+
multiple: {
|
|
932
|
+
type: Boolean,
|
|
933
|
+
default: false
|
|
934
|
+
},
|
|
935
|
+
showLimit: {
|
|
936
|
+
type: Number,
|
|
937
|
+
default: 3
|
|
938
|
+
},
|
|
939
|
+
useSelectAll: {
|
|
940
|
+
type: Boolean,
|
|
941
|
+
default: false
|
|
942
|
+
},
|
|
943
|
+
label: String,
|
|
944
|
+
field: {
|
|
945
|
+
type: String,
|
|
946
|
+
required: true
|
|
947
|
+
},
|
|
948
|
+
options: {
|
|
949
|
+
type: Array,
|
|
950
|
+
default: []
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
emits: ["change"],
|
|
954
|
+
setup(__props, { expose, emit }) {
|
|
955
|
+
const props = __props;
|
|
956
|
+
const { t } = useLocale();
|
|
957
|
+
const selection = ref(props.multiple ? [] : "");
|
|
958
|
+
const showOptions = computed(() => {
|
|
959
|
+
return props.options.filter((o, i) => {
|
|
960
|
+
let show = props.showLimit < 0 ? true : i < props.showLimit;
|
|
961
|
+
if (Array.isArray(selection.value)) {
|
|
962
|
+
return show || selection.value.includes(o.value);
|
|
963
|
+
} else {
|
|
964
|
+
return show || selection.value === o.value;
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
});
|
|
968
|
+
const valueLabel = computed(() => {
|
|
969
|
+
if (Array.isArray(selection.value)) {
|
|
970
|
+
let values = [];
|
|
971
|
+
selection.value.forEach((v) => {
|
|
972
|
+
values.push(getValueLabel(v));
|
|
973
|
+
});
|
|
974
|
+
return values.join(", ");
|
|
975
|
+
}
|
|
976
|
+
return getValueLabel(selection.value);
|
|
977
|
+
});
|
|
978
|
+
function change(v) {
|
|
979
|
+
if (v.includes("")) {
|
|
980
|
+
selection.value = props.options.map((o) => o.value);
|
|
981
|
+
}
|
|
982
|
+
emit("change", selection.value);
|
|
983
|
+
}
|
|
984
|
+
function setSelected(value, selected) {
|
|
985
|
+
if (!Array.isArray(selection.value)) {
|
|
986
|
+
selection.value = selected ? "" : value;
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
if (selected) {
|
|
990
|
+
let index2 = selection.value.indexOf(value);
|
|
991
|
+
selection.value.splice(index2, 1);
|
|
992
|
+
} else {
|
|
993
|
+
selection.value.push(value);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
function selectAll() {
|
|
997
|
+
selection.value = props.options.map((o) => o.value);
|
|
998
|
+
}
|
|
999
|
+
function getValueLabel(value) {
|
|
1000
|
+
for (let o of props.options) {
|
|
1001
|
+
if (o.value === value) {
|
|
1002
|
+
return o.label;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
return value;
|
|
1006
|
+
}
|
|
1007
|
+
function getCondition() {
|
|
1008
|
+
if (!selection.value || Array.isArray(selection.value) && selection.value.length === 0)
|
|
1009
|
+
return;
|
|
1010
|
+
let { field: field2, label } = props;
|
|
1011
|
+
return { field: field2, label, value: selection.value, valueLabel: valueLabel.value };
|
|
1012
|
+
}
|
|
1013
|
+
function init(v) {
|
|
1014
|
+
selection.value = v !== void 0 ? v : props.multiple ? [] : "";
|
|
1015
|
+
}
|
|
1016
|
+
provide(selectKey, {
|
|
1017
|
+
setSelected,
|
|
1018
|
+
selection
|
|
1019
|
+
});
|
|
1020
|
+
const references = inject(referenceKey);
|
|
1021
|
+
const field = props.field;
|
|
1022
|
+
const reference = { field, init, getCondition };
|
|
1023
|
+
references == null ? void 0 : references.value.push(reference);
|
|
1024
|
+
expose({
|
|
1025
|
+
getCondition,
|
|
1026
|
+
init
|
|
1027
|
+
});
|
|
1028
|
+
return (_ctx, _cache) => {
|
|
1029
|
+
const _component_el_option = resolveComponent("el-option");
|
|
1030
|
+
const _component_el_select = resolveComponent("el-select");
|
|
1031
|
+
const _component_Plus = resolveComponent("Plus");
|
|
1032
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
1033
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
1034
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1035
|
+
createElementVNode("div", _hoisted_2$9, toDisplayString(__props.label), 1),
|
|
1036
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
1037
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(showOptions), (o) => {
|
|
1038
|
+
return openBlock(), createBlock(FuFilterOption, {
|
|
1039
|
+
label: o.label,
|
|
1040
|
+
value: o.value,
|
|
1041
|
+
key: o.value
|
|
1042
|
+
}, null, 8, ["label", "value"]);
|
|
1043
|
+
}), 128)),
|
|
1044
|
+
createVNode(_component_el_popover, {
|
|
1045
|
+
"popper-class": "fu-filter-component-popover",
|
|
1046
|
+
"show-arrow": false,
|
|
1047
|
+
placement: "bottom-start",
|
|
1048
|
+
trigger: "click",
|
|
1049
|
+
width: "240"
|
|
1050
|
+
}, {
|
|
1051
|
+
reference: withCtx(() => [
|
|
1052
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
1053
|
+
createVNode(_component_el_icon, null, {
|
|
1054
|
+
default: withCtx(() => [
|
|
1055
|
+
createVNode(_component_Plus)
|
|
1056
|
+
]),
|
|
1057
|
+
_: 1
|
|
1058
|
+
}),
|
|
1059
|
+
createTextVNode(" " + toDisplayString(unref(t)("fu.filter_bar.more")), 1)
|
|
1060
|
+
])
|
|
1061
|
+
]),
|
|
1062
|
+
default: withCtx(() => [
|
|
1063
|
+
createVNode(_component_el_select, mergeProps({
|
|
1064
|
+
modelValue: selection.value,
|
|
1065
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selection.value = $event)
|
|
1066
|
+
}, _ctx.$attrs, {
|
|
1067
|
+
multiple: __props.multiple,
|
|
1068
|
+
onChange: change,
|
|
1069
|
+
teleported: false,
|
|
1070
|
+
placeholder: unref(t)("fu.search_bar.please_select")
|
|
1071
|
+
}), {
|
|
1072
|
+
default: withCtx(() => [
|
|
1073
|
+
__props.useSelectAll && __props.multiple ? (openBlock(), createBlock(_component_el_option, {
|
|
1074
|
+
key: 0,
|
|
1075
|
+
value: ""
|
|
1076
|
+
}, {
|
|
1077
|
+
default: withCtx(() => [
|
|
1078
|
+
createElementVNode("div", { onClick: selectAll }, toDisplayString(unref(t)("fu.filter_bar.select_all")), 1)
|
|
1079
|
+
]),
|
|
1080
|
+
_: 1
|
|
1081
|
+
})) : createCommentVNode("v-if", true),
|
|
1082
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (o) => {
|
|
1083
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
1084
|
+
label: o.label,
|
|
1085
|
+
value: o.value,
|
|
1086
|
+
key: o.value
|
|
1087
|
+
}, null, 8, ["label", "value"]);
|
|
1088
|
+
}), 128))
|
|
1089
|
+
]),
|
|
1090
|
+
_: 1
|
|
1091
|
+
}, 16, ["modelValue", "multiple", "placeholder"])
|
|
1092
|
+
]),
|
|
1093
|
+
_: 1
|
|
1094
|
+
})
|
|
1095
|
+
])
|
|
1096
|
+
]);
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
}));
|
|
1100
|
+
var FuFilterSelect = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterSelect.vue"]]);
|
|
1101
|
+
const getCheckDate = (timestamp) => {
|
|
1102
|
+
if (!timestamp)
|
|
1103
|
+
return false;
|
|
1104
|
+
const dt = new Date(timestamp);
|
|
1105
|
+
if (isNaN(dt.getTime()))
|
|
1106
|
+
return false;
|
|
1107
|
+
return dt;
|
|
1108
|
+
};
|
|
1109
|
+
const datetimeFormat = (timestamp) => {
|
|
1110
|
+
const dt = getCheckDate(timestamp);
|
|
1111
|
+
if (!dt)
|
|
1112
|
+
return timestamp;
|
|
1113
|
+
const y = dt.getFullYear();
|
|
1114
|
+
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
|
1115
|
+
const d = (dt.getDate() + "").padStart(2, "0");
|
|
1116
|
+
const hh = (dt.getHours() + "").padStart(2, "0");
|
|
1117
|
+
const mm = (dt.getMinutes() + "").padStart(2, "0");
|
|
1118
|
+
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
|
1119
|
+
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
|
|
1120
|
+
};
|
|
1121
|
+
const dateFormat = (timestamp) => {
|
|
1122
|
+
const dt = getCheckDate(timestamp);
|
|
1123
|
+
if (!dt)
|
|
1124
|
+
return timestamp;
|
|
1125
|
+
const y = dt.getFullYear();
|
|
1126
|
+
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
|
1127
|
+
const d = (dt.getDate() + "").padStart(2, "0");
|
|
1128
|
+
return `${y}-${m}-${d}`;
|
|
1129
|
+
};
|
|
1130
|
+
const _hoisted_1$b = { class: "fu-filter-component" };
|
|
1131
|
+
const _hoisted_2$8 = { class: "fu-filter-component__label" };
|
|
1132
|
+
const _hoisted_3$4 = { class: "fu-filter-component__content" };
|
|
1133
|
+
const __default__$e = { name: "FuFilterDate" };
|
|
1134
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$e), {
|
|
1135
|
+
props: {
|
|
1136
|
+
label: String,
|
|
1137
|
+
field: {
|
|
1138
|
+
type: String,
|
|
1139
|
+
required: true
|
|
1140
|
+
},
|
|
1141
|
+
valueFormat: {
|
|
1142
|
+
type: String,
|
|
1143
|
+
default: "x"
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
setup(__props, { expose }) {
|
|
1147
|
+
const props = __props;
|
|
1148
|
+
const { t } = useLocale();
|
|
1149
|
+
const value = ref("");
|
|
1150
|
+
const valueLabel = computed(() => {
|
|
1151
|
+
return dateFormat(value.value[0]) + " - " + dateFormat(value.value[1]);
|
|
1152
|
+
});
|
|
1153
|
+
function getCondition() {
|
|
1154
|
+
if (!String(value.value))
|
|
1155
|
+
return;
|
|
1156
|
+
let { field: field2, label } = props;
|
|
1157
|
+
return { field: field2, label, value: value.value, valueLabel: valueLabel.value };
|
|
1158
|
+
}
|
|
1159
|
+
function init(v) {
|
|
1160
|
+
value.value = v !== void 0 ? v : "";
|
|
1161
|
+
}
|
|
1162
|
+
const references = inject(referenceKey);
|
|
1163
|
+
const field = props.field;
|
|
1164
|
+
const reference = { field, init, getCondition };
|
|
1165
|
+
references == null ? void 0 : references.value.push(reference);
|
|
1166
|
+
expose({
|
|
1167
|
+
getCondition,
|
|
1168
|
+
init
|
|
1169
|
+
});
|
|
1170
|
+
return (_ctx, _cache) => {
|
|
1171
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
1172
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1173
|
+
createElementVNode("div", _hoisted_2$8, toDisplayString(__props.label), 1),
|
|
1174
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
1175
|
+
createCommentVNode(' :size="configSize" '),
|
|
1176
|
+
createVNode(_component_el_date_picker, mergeProps({
|
|
1177
|
+
class: "fu-filter-date",
|
|
1178
|
+
modelValue: value.value,
|
|
1179
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
1180
|
+
}, _ctx.$attrs, {
|
|
1181
|
+
placeholder: unref(t)("fu.search_bar.select_date"),
|
|
1182
|
+
type: "daterange",
|
|
1183
|
+
"value-format": __props.valueFormat,
|
|
1184
|
+
"start-placeholder": unref(t)("fu.search_bar.start_date"),
|
|
1185
|
+
"end-placeholder": unref(t)("fu.search_bar.end_date")
|
|
1186
|
+
}), null, 16, ["modelValue", "placeholder", "value-format", "start-placeholder", "end-placeholder"])
|
|
1187
|
+
])
|
|
1188
|
+
]);
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
}));
|
|
1192
|
+
var FuFilterDate = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterDate.vue"]]);
|
|
1193
|
+
const _hoisted_1$a = { class: "fu-filter-component" };
|
|
1194
|
+
const _hoisted_2$7 = { class: "fu-filter-component__label" };
|
|
1195
|
+
const _hoisted_3$3 = { class: "fu-filter-component__content" };
|
|
1196
|
+
const __default__$d = { name: "FuFilterDateTime" };
|
|
1197
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$d), {
|
|
1198
|
+
props: {
|
|
1199
|
+
label: String,
|
|
1200
|
+
field: {
|
|
1201
|
+
type: String,
|
|
1202
|
+
required: true
|
|
1203
|
+
},
|
|
1204
|
+
valueFormat: {
|
|
1205
|
+
type: String,
|
|
1206
|
+
default: "x"
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
setup(__props, { expose }) {
|
|
1210
|
+
const props = __props;
|
|
1211
|
+
const { t } = useLocale();
|
|
1212
|
+
const value = ref("");
|
|
1213
|
+
const valueLabel = computed(() => {
|
|
1214
|
+
return datetimeFormat(value.value[0]) + " - " + datetimeFormat(value.value[1]);
|
|
1215
|
+
});
|
|
1216
|
+
function getCondition() {
|
|
1217
|
+
if (!String(value.value))
|
|
1218
|
+
return;
|
|
1219
|
+
let { field: field2, label } = props;
|
|
1220
|
+
return { field: field2, label, value: value.value, valueLabel: valueLabel.value };
|
|
1221
|
+
}
|
|
1222
|
+
function init(v) {
|
|
1223
|
+
value.value = v !== void 0 ? v : "";
|
|
1224
|
+
}
|
|
1225
|
+
const references = inject(referenceKey);
|
|
1226
|
+
const field = props.field;
|
|
1227
|
+
const reference = { field, init, getCondition };
|
|
1228
|
+
references == null ? void 0 : references.value.push(reference);
|
|
1229
|
+
expose({
|
|
1230
|
+
getCondition,
|
|
1231
|
+
init
|
|
1232
|
+
});
|
|
1233
|
+
return (_ctx, _cache) => {
|
|
1234
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
1235
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1236
|
+
createElementVNode("div", _hoisted_2$7, toDisplayString(__props.label), 1),
|
|
1237
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
1238
|
+
createCommentVNode(' :size="configSize" '),
|
|
1239
|
+
createVNode(_component_el_date_picker, mergeProps({
|
|
1240
|
+
class: "fu-filter-date",
|
|
1241
|
+
modelValue: value.value,
|
|
1242
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
1243
|
+
}, _ctx.$attrs, {
|
|
1244
|
+
placeholder: unref(t)("fu.search_bar.select_date_time"),
|
|
1245
|
+
type: "datetimerange",
|
|
1246
|
+
"value-format": __props.valueFormat,
|
|
1247
|
+
"start-placeholder": unref(t)("fu.search_bar.start_date_time"),
|
|
1248
|
+
"end-placeholder": unref(t)("fu.search_bar.end_date_time")
|
|
1249
|
+
}), null, 16, ["modelValue", "placeholder", "value-format", "start-placeholder", "end-placeholder"])
|
|
1250
|
+
])
|
|
1251
|
+
]);
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
}));
|
|
1255
|
+
var FuFilterDateTime = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterDateTime.vue"]]);
|
|
1256
|
+
var index$1 = {
|
|
1257
|
+
install: (app) => {
|
|
1258
|
+
app.component(FuFilterBar.name, FuFilterBar);
|
|
1259
|
+
app.component(FuFilter.name, FuFilter);
|
|
1260
|
+
app.component(FuSearchInput.name, FuSearchInput);
|
|
1261
|
+
app.component(FuFilterSelect.name, FuFilterSelect);
|
|
1262
|
+
app.component(FuFilterDate.name, FuFilterDate);
|
|
1263
|
+
app.component(FuFilterDateTime.name, FuFilterDateTime);
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
var __glob_1_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1267
|
+
__proto__: null,
|
|
1268
|
+
"default": index$1
|
|
1269
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1270
|
+
const uuid = function() {
|
|
1271
|
+
let d = new Date().getTime();
|
|
1272
|
+
let d2 = performance && performance.now && performance.now() * 1e3 || 0;
|
|
1273
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
1274
|
+
let r = Math.random() * 16;
|
|
1275
|
+
if (d > 0) {
|
|
1276
|
+
r = (d + r) % 16 | 0;
|
|
1277
|
+
d = Math.floor(d / 16);
|
|
1278
|
+
} else {
|
|
1279
|
+
r = (d2 + r) % 16 | 0;
|
|
1280
|
+
d2 = Math.floor(d2 / 16);
|
|
1281
|
+
}
|
|
1282
|
+
return (c === "x" ? r : r & 3 | 8).toString(16);
|
|
1283
|
+
});
|
|
1284
|
+
};
|
|
1285
|
+
const TRIGGERS = ["manual", "click", "dblclick"];
|
|
1286
|
+
const _sfc_main$m = defineComponent({
|
|
1287
|
+
name: "FuReadWriteSwitch",
|
|
1288
|
+
props: {
|
|
1289
|
+
value: Boolean,
|
|
1290
|
+
data: [String, Number, Boolean],
|
|
1291
|
+
writeTrigger: {
|
|
1292
|
+
type: String,
|
|
1293
|
+
default: "click",
|
|
1294
|
+
validator: (value) => {
|
|
1295
|
+
return TRIGGERS.includes(value);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1299
|
+
setup(props, { slots, emit }) {
|
|
1300
|
+
const id = ref(uuid());
|
|
1301
|
+
const write = ref(props.value === void 0 ? false : props.value);
|
|
1302
|
+
watch(() => props.value, (v) => {
|
|
1303
|
+
console.log(v);
|
|
1304
|
+
if (v === write.value)
|
|
1305
|
+
return;
|
|
1306
|
+
if (v) {
|
|
1307
|
+
switchWrite();
|
|
1308
|
+
} else {
|
|
1309
|
+
switchRead();
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
function change() {
|
|
1313
|
+
emit("input", write.value);
|
|
1314
|
+
emit("change", [props.data, write.value]);
|
|
1315
|
+
}
|
|
1316
|
+
function switchWrite() {
|
|
1317
|
+
write.value = true;
|
|
1318
|
+
nextTick(() => {
|
|
1319
|
+
const nid = document.getElementById(id.value);
|
|
1320
|
+
const input = nid == null ? void 0 : nid.querySelector("input");
|
|
1321
|
+
input == null ? void 0 : input.click();
|
|
1322
|
+
input == null ? void 0 : input.focus();
|
|
1323
|
+
const textarea = nid == null ? void 0 : nid.querySelector("textarea");
|
|
1324
|
+
textarea == null ? void 0 : textarea.focus();
|
|
1325
|
+
change();
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
function switchRead() {
|
|
1329
|
+
write.value = false;
|
|
1330
|
+
change();
|
|
1331
|
+
}
|
|
1332
|
+
const context = {
|
|
1333
|
+
class: "fu-read-write-switch",
|
|
1334
|
+
attrs: { id: id.value },
|
|
1335
|
+
on: {}
|
|
1336
|
+
};
|
|
1337
|
+
if (!write.value && props.writeTrigger !== TRIGGERS[0]) {
|
|
1338
|
+
context.on[props.writeTrigger] = switchWrite;
|
|
1339
|
+
}
|
|
1340
|
+
let children = props.data;
|
|
1341
|
+
if (!write.value && slots.read) {
|
|
1342
|
+
children = slots.read({
|
|
1343
|
+
write: switchWrite
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
if (write.value && slots.default) {
|
|
1347
|
+
children = slots.default({
|
|
1348
|
+
read: switchRead
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
return () => h("div", context, children);
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
var FuReadWriteSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/read-write-switch/FuReadWriteSwitch.vue"]]);
|
|
1355
|
+
const __default__$c = { name: "FuInputRwSwitch" };
|
|
1356
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$c), {
|
|
1357
|
+
props: {
|
|
1358
|
+
value: [String, Number],
|
|
1359
|
+
writeTrigger: {
|
|
1360
|
+
type: String,
|
|
1361
|
+
default: "click",
|
|
1362
|
+
validator: (value) => {
|
|
1363
|
+
return ["click", "dblclick"].includes(value);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
emits: ["input", "blur"],
|
|
1368
|
+
setup(__props, { emit }) {
|
|
1369
|
+
const props = __props;
|
|
1370
|
+
const data = ref(props.value);
|
|
1371
|
+
watch(() => props.value, (v) => {
|
|
1372
|
+
data.value = v;
|
|
1373
|
+
});
|
|
1374
|
+
function input(e) {
|
|
1375
|
+
emit("input", data.value, e);
|
|
1376
|
+
}
|
|
1377
|
+
function blur(read, e) {
|
|
1378
|
+
emit("blur", data.value, e);
|
|
1379
|
+
read();
|
|
1380
|
+
}
|
|
1381
|
+
function keydown(read, e) {
|
|
1382
|
+
if (e.key === "Enter") {
|
|
1383
|
+
read();
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return (_ctx, _cache) => {
|
|
1387
|
+
const _component_el_input = resolveComponent("el-input");
|
|
1388
|
+
const _component_fu_read_write_switch = resolveComponent("fu-read-write-switch");
|
|
1389
|
+
return openBlock(), createBlock(_component_fu_read_write_switch, {
|
|
1390
|
+
"write-trigger": __props.writeTrigger,
|
|
1391
|
+
data: data.value
|
|
1392
|
+
}, {
|
|
1393
|
+
default: withCtx(({ read }) => [
|
|
1394
|
+
createVNode(_component_el_input, mergeProps({
|
|
1395
|
+
modelValue: data.value,
|
|
1396
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value = $event)
|
|
1397
|
+
}, _ctx.$attrs, {
|
|
1398
|
+
onInput: input,
|
|
1399
|
+
onBlur: ($event) => blur(read, $event),
|
|
1400
|
+
onKeydown: ($event) => keydown(read, $event)
|
|
1401
|
+
}), null, 16, ["modelValue", "onBlur", "onKeydown"])
|
|
1402
|
+
]),
|
|
1403
|
+
_: 1
|
|
1404
|
+
}, 8, ["write-trigger", "data"]);
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
}));
|
|
1408
|
+
var FuInputRwSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/read-write-switch/FuInputRwSwitch.vue"]]);
|
|
1409
|
+
const __default__$b = { name: "FuSelectRwSwitch" };
|
|
1410
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$b), {
|
|
1411
|
+
props: {
|
|
1412
|
+
value: [String, Number],
|
|
1413
|
+
options: Array,
|
|
1414
|
+
writeTrigger: {
|
|
1415
|
+
type: String,
|
|
1416
|
+
default: "click",
|
|
1417
|
+
validator: (value) => {
|
|
1418
|
+
return ["click", "dblclick"].includes(value);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
},
|
|
1422
|
+
emits: ["input", "blur", "change"],
|
|
1423
|
+
setup(__props, { emit }) {
|
|
1424
|
+
const props = __props;
|
|
1425
|
+
const data = ref(props.value);
|
|
1426
|
+
watch(() => props.value, (v) => {
|
|
1427
|
+
data.value = v;
|
|
1428
|
+
});
|
|
1429
|
+
function input(e) {
|
|
1430
|
+
emit("input", data.value, e);
|
|
1431
|
+
}
|
|
1432
|
+
function blur(read, e) {
|
|
1433
|
+
setTimeout(() => {
|
|
1434
|
+
read();
|
|
1435
|
+
}, 100);
|
|
1436
|
+
emit("blur", data.value, e);
|
|
1437
|
+
}
|
|
1438
|
+
function change(read, e) {
|
|
1439
|
+
emit("change", data.value, e);
|
|
1440
|
+
read();
|
|
1441
|
+
}
|
|
1442
|
+
return (_ctx, _cache) => {
|
|
1443
|
+
const _component_el_option = resolveComponent("el-option");
|
|
1444
|
+
const _component_el_select = resolveComponent("el-select");
|
|
1445
|
+
const _component_fu_read_write_switch = resolveComponent("fu-read-write-switch");
|
|
1446
|
+
return openBlock(), createBlock(_component_fu_read_write_switch, {
|
|
1447
|
+
"write-trigger": __props.writeTrigger,
|
|
1448
|
+
data: data.value
|
|
1449
|
+
}, {
|
|
1450
|
+
read: withCtx(() => [
|
|
1451
|
+
renderSlot(_ctx.$slots, "read", {}, () => [
|
|
1452
|
+
createTextVNode(toDisplayString(data.value), 1)
|
|
1453
|
+
])
|
|
1454
|
+
]),
|
|
1455
|
+
default: withCtx(({ read }) => [
|
|
1456
|
+
createVNode(_component_el_select, mergeProps({
|
|
1457
|
+
modelValue: data.value,
|
|
1458
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value = $event)
|
|
1459
|
+
}, _ctx.$attrs, {
|
|
1460
|
+
onInput: input,
|
|
1461
|
+
onBlur: ($event) => blur(read, $event),
|
|
1462
|
+
onChange: ($event) => change(read, $event)
|
|
1463
|
+
}), {
|
|
1464
|
+
default: withCtx(() => [
|
|
1465
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1466
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item) => {
|
|
1467
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
1468
|
+
key: item.value,
|
|
1469
|
+
label: item.label,
|
|
1470
|
+
value: item.value
|
|
1471
|
+
}, null, 8, ["label", "value"]);
|
|
1472
|
+
}), 128))
|
|
1473
|
+
])
|
|
1474
|
+
]),
|
|
1475
|
+
_: 2
|
|
1476
|
+
}, 1040, ["modelValue", "onBlur", "onChange"])
|
|
1477
|
+
]),
|
|
1478
|
+
_: 3
|
|
1479
|
+
}, 8, ["write-trigger", "data"]);
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
}));
|
|
1483
|
+
var FuSelectRwSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/read-write-switch/FuSelectRwSwitch.vue"]]);
|
|
1484
|
+
FuReadWriteSwitch.install = (app) => {
|
|
1485
|
+
app.component(FuReadWriteSwitch.name, FuReadWriteSwitch);
|
|
1486
|
+
app.component(FuInputRwSwitch.name, FuInputRwSwitch);
|
|
1487
|
+
app.component(FuSelectRwSwitch.name, FuSelectRwSwitch);
|
|
1488
|
+
};
|
|
1489
|
+
var __glob_1_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1490
|
+
__proto__: null,
|
|
1491
|
+
"default": FuReadWriteSwitch
|
|
1492
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1493
|
+
const _hoisted_1$9 = {
|
|
1494
|
+
class: /* @__PURE__ */ normalizeClass(["fu-quick-search"])
|
|
1495
|
+
};
|
|
1496
|
+
const _hoisted_2$6 = ["placeholder"];
|
|
1497
|
+
const __default__$a = { name: "FuQuickSearch" };
|
|
1498
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$a), {
|
|
1499
|
+
props: {
|
|
1500
|
+
value: String,
|
|
1501
|
+
placeholder: String,
|
|
1502
|
+
useIcon: {
|
|
1503
|
+
type: Boolean,
|
|
1504
|
+
default: true
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1507
|
+
emits: ["input", "change"],
|
|
1508
|
+
setup(__props, { emit }) {
|
|
1509
|
+
const props = __props;
|
|
1510
|
+
const quick = ref("");
|
|
1511
|
+
watch(() => props.value, (val) => {
|
|
1512
|
+
quick.value = val;
|
|
1513
|
+
});
|
|
1514
|
+
function input(e) {
|
|
1515
|
+
emit("input", quick.value, e);
|
|
1516
|
+
}
|
|
1517
|
+
function blur(e) {
|
|
1518
|
+
emit("change", quick.value, e);
|
|
1519
|
+
}
|
|
1520
|
+
function keydown(e) {
|
|
1521
|
+
const event = e;
|
|
1522
|
+
if (event.key === "Enter") {
|
|
1523
|
+
emit("change", quick.value, e);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
return (_ctx, _cache) => {
|
|
1527
|
+
const _component_Search = resolveComponent("Search");
|
|
1528
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
1529
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1530
|
+
createCommentVNode(" , 'fu-quick-search--' + configSize "),
|
|
1531
|
+
createElementVNode("div", _hoisted_1$9, [
|
|
1532
|
+
__props.useIcon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
1533
|
+
default: withCtx(() => [
|
|
1534
|
+
createVNode(_component_Search)
|
|
1535
|
+
]),
|
|
1536
|
+
_: 1
|
|
1537
|
+
})) : createCommentVNode("v-if", true),
|
|
1538
|
+
createElementVNode("label", null, [
|
|
1539
|
+
withDirectives(createElementVNode("input", {
|
|
1540
|
+
placeholder: __props.placeholder,
|
|
1541
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => quick.value = $event),
|
|
1542
|
+
onInput: input,
|
|
1543
|
+
onBlur: blur,
|
|
1544
|
+
onKeydown: keydown
|
|
1545
|
+
}, null, 40, _hoisted_2$6), [
|
|
1546
|
+
[vModelText, quick.value]
|
|
1547
|
+
])
|
|
1548
|
+
])
|
|
1549
|
+
])
|
|
1550
|
+
], 2112);
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
}));
|
|
1554
|
+
var FuQuickSearch = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/search-bar/FuQuickSearch.vue"]]);
|
|
1555
|
+
const __default__$9 = { name: "FuSearchBarButton" };
|
|
1556
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$9), {
|
|
1557
|
+
props: {
|
|
1558
|
+
tooltip: String
|
|
1559
|
+
},
|
|
1560
|
+
setup(__props) {
|
|
1561
|
+
return (_ctx, _cache) => {
|
|
1562
|
+
const _component_el_button = resolveComponent("el-button");
|
|
1563
|
+
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
1564
|
+
return openBlock(), createBlock(_component_el_tooltip, {
|
|
1565
|
+
content: __props.tooltip,
|
|
1566
|
+
disabled: !__props.tooltip
|
|
1567
|
+
}, {
|
|
1568
|
+
default: withCtx(() => [
|
|
1569
|
+
createCommentVNode(' :size="configSize" '),
|
|
1570
|
+
createVNode(_component_el_button, mergeProps({
|
|
1571
|
+
class: "fu-search-bar-button",
|
|
1572
|
+
circle: ""
|
|
1573
|
+
}, _ctx.$attrs), null, 16),
|
|
1574
|
+
createCommentVNode(" <slot></slot> "),
|
|
1575
|
+
createCommentVNode(" *****element\u95EE\u9898 \u52A0\u4E0A\u63D2\u69FD \u7A7A\u7684\u60C5\u51B5\u4E0B\u6E32\u67D3\u591A\u51FA\u4E00\u4E2Aspan\u6807\u7B7E\u95EE\u9898 \u5F85\u8003\u8651 ")
|
|
1576
|
+
]),
|
|
1577
|
+
_: 1
|
|
1578
|
+
}, 8, ["content", "disabled"]);
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
}));
|
|
1582
|
+
var FuSearchBarButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/search-bar/FuSearchBarButton.vue"]]);
|
|
1583
|
+
const _hoisted_1$8 = { class: "fu-complex-search" };
|
|
1584
|
+
const _hoisted_2$5 = { class: "fu-complex-components__body" };
|
|
1585
|
+
const _hoisted_3$2 = { class: "fu-complex-components__footer" };
|
|
1586
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1587
|
+
props: {
|
|
1588
|
+
components: Array
|
|
1589
|
+
},
|
|
1590
|
+
emits: ["close", "change"],
|
|
1591
|
+
setup(__props, { emit }) {
|
|
1592
|
+
const props = __props;
|
|
1593
|
+
const slots = useSlots();
|
|
1594
|
+
const instance = getCurrentInstance();
|
|
1595
|
+
const { t } = useLocale();
|
|
1596
|
+
const active = ref(false);
|
|
1597
|
+
function closePopover() {
|
|
1598
|
+
emit("close");
|
|
1599
|
+
}
|
|
1600
|
+
function toggle() {
|
|
1601
|
+
active.value = !active.value;
|
|
1602
|
+
refs.value.forEach((r) => {
|
|
1603
|
+
if (r == null ? void 0 : r.init) {
|
|
1604
|
+
r.init();
|
|
1605
|
+
} else {
|
|
1606
|
+
console.warn("init undefined", r);
|
|
1607
|
+
}
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
function ok() {
|
|
1611
|
+
active.value = false;
|
|
1612
|
+
let conditions = [];
|
|
1613
|
+
refs.value.forEach((r) => {
|
|
1614
|
+
let condition;
|
|
1615
|
+
if (r.getCondition) {
|
|
1616
|
+
condition = r.getCondition();
|
|
1617
|
+
} else {
|
|
1618
|
+
console.warn("getCondition undefined", r);
|
|
1619
|
+
}
|
|
1620
|
+
if (condition && condition.value !== void 0) {
|
|
1621
|
+
conditions.push(condition);
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
emit("change", conditions);
|
|
1625
|
+
}
|
|
1626
|
+
const refs = computed(() => {
|
|
1627
|
+
var _a, _b;
|
|
1628
|
+
let refs2 = [];
|
|
1629
|
+
if ((_a = slots.default) == null ? void 0 : _a.call(slots)[0].children.length) {
|
|
1630
|
+
(_b = slots.default) == null ? void 0 : _b.call(slots).forEach((component) => {
|
|
1631
|
+
refs2.push(component.componentInstance);
|
|
1632
|
+
});
|
|
1633
|
+
} else {
|
|
1634
|
+
props.components.forEach((c) => {
|
|
1635
|
+
refs2.push(instance.refs[c.field][0]);
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
return refs2;
|
|
1639
|
+
});
|
|
1640
|
+
return (_ctx, _cache) => {
|
|
1641
|
+
const _component_el_button = resolveComponent("el-button");
|
|
1642
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
1643
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1644
|
+
createVNode(_component_el_popover, {
|
|
1645
|
+
trigger: "manual",
|
|
1646
|
+
modelValue: active.value,
|
|
1647
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => active.value = $event),
|
|
1648
|
+
"show-arrow": false,
|
|
1649
|
+
onHide: closePopover,
|
|
1650
|
+
"popper-class": "fu-complex-components"
|
|
1651
|
+
}, {
|
|
1652
|
+
reference: withCtx(() => [
|
|
1653
|
+
createCommentVNode(' :size="configSize" '),
|
|
1654
|
+
createVNode(FuSearchBarButton, {
|
|
1655
|
+
icon: "ArrowRight",
|
|
1656
|
+
onClick: toggle,
|
|
1657
|
+
class: normalizeClass(["fu-complex-search__trigger", { "is-active": active.value }]),
|
|
1658
|
+
tooltip: unref(t)("fu.search_bar.adv_search")
|
|
1659
|
+
}, null, 8, ["class", "tooltip"])
|
|
1660
|
+
]),
|
|
1661
|
+
default: withCtx(() => [
|
|
1662
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1663
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1664
|
+
createCommentVNode(' :size="configSize" '),
|
|
1665
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.components, (c, i) => {
|
|
1666
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), mergeProps({ key: i }, c, {
|
|
1667
|
+
ref_for: true,
|
|
1668
|
+
ref: c.field
|
|
1669
|
+
}, toHandlers(c)), null, 16);
|
|
1670
|
+
}), 128))
|
|
1671
|
+
])
|
|
1672
|
+
]),
|
|
1673
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
1674
|
+
createCommentVNode(' :size="configSize" '),
|
|
1675
|
+
createVNode(_component_el_button, {
|
|
1676
|
+
onClick: _cache[0] || (_cache[0] = ($event) => active.value = false)
|
|
1677
|
+
}, {
|
|
1678
|
+
default: withCtx(() => [
|
|
1679
|
+
createTextVNode(toDisplayString(unref(t)("fu.search_bar.cancel")), 1)
|
|
1680
|
+
]),
|
|
1681
|
+
_: 1
|
|
1682
|
+
}),
|
|
1683
|
+
createVNode(_component_el_button, {
|
|
1684
|
+
type: "primary",
|
|
1685
|
+
onClick: ok
|
|
1686
|
+
}, {
|
|
1687
|
+
default: withCtx(() => [
|
|
1688
|
+
createTextVNode(toDisplayString(unref(t)("fu.search_bar.ok")), 1)
|
|
1689
|
+
]),
|
|
1690
|
+
_: 1
|
|
1691
|
+
})
|
|
1692
|
+
])
|
|
1693
|
+
]),
|
|
1694
|
+
_: 3
|
|
1695
|
+
}, 8, ["modelValue"])
|
|
1696
|
+
]);
|
|
1697
|
+
};
|
|
1698
|
+
}
|
|
1699
|
+
});
|
|
1700
|
+
var FuComplexSearch = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/search-bar/FuComplexSearch.vue"]]);
|
|
1701
|
+
const _hoisted_1$7 = {
|
|
1702
|
+
class: /* @__PURE__ */ normalizeClass(["fu-search-conditions"])
|
|
1703
|
+
};
|
|
1704
|
+
const _hoisted_2$4 = { key: 0 };
|
|
1705
|
+
const _hoisted_3$1 = { key: 1 };
|
|
1706
|
+
const _hoisted_4 = { class: "condition-value" };
|
|
1707
|
+
const _hoisted_5 = ["onClick"];
|
|
1708
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1709
|
+
props: {
|
|
1710
|
+
conditions: Array
|
|
1711
|
+
},
|
|
1712
|
+
emits: ["change"],
|
|
1713
|
+
setup(__props, { emit }) {
|
|
1714
|
+
const props = __props;
|
|
1715
|
+
function remove(index2) {
|
|
1716
|
+
props.conditions.splice(index2, 1);
|
|
1717
|
+
emit("change", props.conditions);
|
|
1718
|
+
}
|
|
1719
|
+
return (_ctx, _cache) => {
|
|
1720
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1721
|
+
createCommentVNode(" , 'fu-search-conditions--' + configSize "),
|
|
1722
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
1723
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.conditions, (condition, index2) => {
|
|
1724
|
+
return openBlock(), createElementBlock("div", {
|
|
1725
|
+
class: "fu-search-conditions__item",
|
|
1726
|
+
key: index2
|
|
1727
|
+
}, [
|
|
1728
|
+
condition.label ? (openBlock(), createElementBlock("div", _hoisted_2$4, toDisplayString(condition.label), 1)) : createCommentVNode("v-if", true),
|
|
1729
|
+
condition.operatorLabel ? (openBlock(), createElementBlock("div", _hoisted_3$1, toDisplayString(condition.operatorLabel), 1)) : createCommentVNode("v-if", true),
|
|
1730
|
+
createElementVNode("div", _hoisted_4, toDisplayString(condition.valueLabel), 1),
|
|
1731
|
+
createElementVNode("i", {
|
|
1732
|
+
class: "el-icon-close condition-remove",
|
|
1733
|
+
onClick: ($event) => remove(index2)
|
|
1734
|
+
}, null, 8, _hoisted_5)
|
|
1735
|
+
]);
|
|
1736
|
+
}), 128))
|
|
1737
|
+
])
|
|
1738
|
+
], 2112);
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
var FuSearchConditions = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/search-bar/FuSearchContions.vue"]]);
|
|
1743
|
+
class ComplexCondition {
|
|
1744
|
+
constructor(options) {
|
|
1745
|
+
__publicField(this, "field");
|
|
1746
|
+
__publicField(this, "label");
|
|
1747
|
+
__publicField(this, "operator");
|
|
1748
|
+
__publicField(this, "operatorLabel");
|
|
1749
|
+
__publicField(this, "value");
|
|
1750
|
+
__publicField(this, "valueLabel");
|
|
1751
|
+
this.field = options.field;
|
|
1752
|
+
this.label = options.label;
|
|
1753
|
+
this.operator = options.operator;
|
|
1754
|
+
this.operatorLabel = options.operatorLabel;
|
|
1755
|
+
this.value = options.value;
|
|
1756
|
+
this.valueLabel = options.valueLabel || options.value;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
const _hoisted_1$6 = { class: "fu-search-bar" };
|
|
1760
|
+
const _hoisted_2$3 = { class: "fu-search-bar__content" };
|
|
1761
|
+
const _hoisted_3 = { class: "fu-search-bar__buttons" };
|
|
1762
|
+
const __default__$8 = { name: "FuSearchBar" };
|
|
1763
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$8), {
|
|
1764
|
+
props: {
|
|
1765
|
+
quickKey: {
|
|
1766
|
+
type: String,
|
|
1767
|
+
default: "quick"
|
|
1768
|
+
},
|
|
1769
|
+
quickPlaceholder: String,
|
|
1770
|
+
useCleanButton: {
|
|
1771
|
+
type: Boolean,
|
|
1772
|
+
default: true
|
|
1773
|
+
},
|
|
1774
|
+
useRefreshButton: {
|
|
1775
|
+
type: Boolean,
|
|
1776
|
+
default: false
|
|
1777
|
+
},
|
|
1778
|
+
useQuickSearch: {
|
|
1779
|
+
type: Boolean,
|
|
1780
|
+
default: true
|
|
1781
|
+
},
|
|
1782
|
+
components: Array
|
|
1783
|
+
},
|
|
1784
|
+
emits: ["close", "exec"],
|
|
1785
|
+
setup(__props, { emit }) {
|
|
1786
|
+
const props = __props;
|
|
1787
|
+
const { t } = useLocale();
|
|
1788
|
+
const slots = useSlots();
|
|
1789
|
+
const quick = ref("");
|
|
1790
|
+
const conditions = ref([]);
|
|
1791
|
+
const complex = ref();
|
|
1792
|
+
function merge(source, target) {
|
|
1793
|
+
let conditions2 = source.concat(target);
|
|
1794
|
+
let conditionMap = /* @__PURE__ */ new Map();
|
|
1795
|
+
for (let condition2 of conditions2) {
|
|
1796
|
+
conditionMap.set(condition2.field, condition2);
|
|
1797
|
+
}
|
|
1798
|
+
let result = [];
|
|
1799
|
+
conditionMap.forEach((c) => {
|
|
1800
|
+
result.push(c);
|
|
1801
|
+
});
|
|
1802
|
+
return result;
|
|
1803
|
+
}
|
|
1804
|
+
function closePopover() {
|
|
1805
|
+
emit("close");
|
|
1806
|
+
}
|
|
1807
|
+
function quickChange(value, e) {
|
|
1808
|
+
if (value) {
|
|
1809
|
+
const field = props.quickKey;
|
|
1810
|
+
const valueLabel = value;
|
|
1811
|
+
conditions.value = merge(conditions.value, [new ComplexCondition({ field, value, valueLabel })]);
|
|
1812
|
+
exec();
|
|
1813
|
+
quick.value = "";
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
function change(conditions2) {
|
|
1817
|
+
conditions2.value = merge(conditions2.value, conditions2);
|
|
1818
|
+
exec();
|
|
1819
|
+
}
|
|
1820
|
+
function clean() {
|
|
1821
|
+
quick.value = "";
|
|
1822
|
+
conditions.value = [];
|
|
1823
|
+
emit("exec", conditions.value);
|
|
1824
|
+
}
|
|
1825
|
+
function refresh() {
|
|
1826
|
+
complex.value.close();
|
|
1827
|
+
exec();
|
|
1828
|
+
}
|
|
1829
|
+
function exec() {
|
|
1830
|
+
if (!showComplex) {
|
|
1831
|
+
emit("exec", quick.value);
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
emit("exec", condition.value);
|
|
1835
|
+
}
|
|
1836
|
+
const placeholder = computed(() => {
|
|
1837
|
+
return props.quickPlaceholder ? props.quickPlaceholder : t("fu.search_bar.search");
|
|
1838
|
+
});
|
|
1839
|
+
const showComplex = computed(() => {
|
|
1840
|
+
var _a;
|
|
1841
|
+
if (slots == null ? void 0 : slots.complex)
|
|
1842
|
+
return true;
|
|
1843
|
+
return ((_a = props.components) == null ? void 0 : _a.length) > 0;
|
|
1844
|
+
});
|
|
1845
|
+
const showClean = computed(() => {
|
|
1846
|
+
return props.useCleanButton && showComplex && (conditions.value.length > 0 || quick.value);
|
|
1847
|
+
});
|
|
1848
|
+
const showRefresh = computed(() => {
|
|
1849
|
+
return props.useRefreshButton && showComplex;
|
|
1850
|
+
});
|
|
1851
|
+
const condition = computed(() => {
|
|
1852
|
+
const condition2 = {};
|
|
1853
|
+
if (conditions.value.length > 0) {
|
|
1854
|
+
conditions.value.forEach((c) => {
|
|
1855
|
+
const { field, operator, value } = c;
|
|
1856
|
+
condition2[c.field] = { field, operator, value };
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
return condition2;
|
|
1860
|
+
});
|
|
1861
|
+
return (_ctx, _cache) => {
|
|
1862
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
1863
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
1864
|
+
createCommentVNode(' :size="configSize" '),
|
|
1865
|
+
unref(showComplex) ? (openBlock(), createBlock(FuComplexSearch, {
|
|
1866
|
+
key: 0,
|
|
1867
|
+
ref_key: "complex",
|
|
1868
|
+
ref: complex,
|
|
1869
|
+
components: __props.components,
|
|
1870
|
+
onChange: change,
|
|
1871
|
+
onClose: closePopover
|
|
1872
|
+
}, {
|
|
1873
|
+
default: withCtx(() => [
|
|
1874
|
+
renderSlot(_ctx.$slots, "complex")
|
|
1875
|
+
]),
|
|
1876
|
+
_: 3
|
|
1877
|
+
}, 8, ["components"])) : createCommentVNode("v-if", true),
|
|
1878
|
+
createCommentVNode(' :size="configSize" '),
|
|
1879
|
+
unref(showComplex) ? (openBlock(), createBlock(FuSearchConditions, {
|
|
1880
|
+
key: 1,
|
|
1881
|
+
conditions: conditions.value,
|
|
1882
|
+
onChange: change
|
|
1883
|
+
}, null, 8, ["conditions"])) : createCommentVNode("v-if", true),
|
|
1884
|
+
createCommentVNode(' :size="configSize" '),
|
|
1885
|
+
__props.useQuickSearch ? (openBlock(), createBlock(FuQuickSearch, {
|
|
1886
|
+
key: 2,
|
|
1887
|
+
"use-icon": !unref(showComplex),
|
|
1888
|
+
placeholder: unref(placeholder),
|
|
1889
|
+
modelValue: quick.value,
|
|
1890
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => quick.value = $event),
|
|
1891
|
+
onChange: quickChange
|
|
1892
|
+
}, null, 8, ["use-icon", "placeholder", "modelValue"])) : createCommentVNode("v-if", true)
|
|
1893
|
+
]),
|
|
1894
|
+
createElementVNode("div", _hoisted_3, [
|
|
1895
|
+
renderSlot(_ctx.$slots, "buttons", {}, () => [
|
|
1896
|
+
createCommentVNode(' :size="configSize" '),
|
|
1897
|
+
unref(showClean) ? (openBlock(), createBlock(FuSearchBarButton, {
|
|
1898
|
+
key: 0,
|
|
1899
|
+
icon: "Close",
|
|
1900
|
+
onClick: clean,
|
|
1901
|
+
tooltip: unref(t)("fu.search_bar.clean")
|
|
1902
|
+
}, null, 8, ["tooltip"])) : createCommentVNode("v-if", true),
|
|
1903
|
+
createCommentVNode(' :size="configSize" '),
|
|
1904
|
+
unref(showRefresh) ? (openBlock(), createBlock(FuSearchBarButton, {
|
|
1905
|
+
key: 1,
|
|
1906
|
+
icon: "Refresh",
|
|
1907
|
+
onClick: refresh,
|
|
1908
|
+
tooltip: unref(t)("fu.search_bar.refresh")
|
|
1909
|
+
}, null, 8, ["tooltip"])) : createCommentVNode("v-if", true),
|
|
1910
|
+
renderSlot(_ctx.$slots, "default")
|
|
1911
|
+
])
|
|
1912
|
+
])
|
|
1913
|
+
]);
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
}));
|
|
1917
|
+
var FuSearchBar = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/search-bar/FuSearchBar.vue"]]);
|
|
1918
|
+
FuSearchBar.install = (app) => {
|
|
1919
|
+
app.component(FuSearchBar.name, FuSearchBar);
|
|
1920
|
+
app.component(FuSearchBarButton.name, FuSearchBarButton);
|
|
1921
|
+
app.component(FuQuickSearch.name, FuQuickSearch);
|
|
1922
|
+
};
|
|
1923
|
+
var __glob_1_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1924
|
+
__proto__: null,
|
|
1925
|
+
"default": FuSearchBar
|
|
1926
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1927
|
+
const COMPONENTS_TYPE = ["default", "primary", "success", "warning", "danger", "info"];
|
|
1928
|
+
const validateType = (value) => {
|
|
1929
|
+
if (!value)
|
|
1930
|
+
return true;
|
|
1931
|
+
if (COMPONENTS_TYPE.includes(value)) {
|
|
1932
|
+
return true;
|
|
1933
|
+
}
|
|
1934
|
+
console.error("types is not contains " + value);
|
|
1935
|
+
return false;
|
|
1936
|
+
};
|
|
1937
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1938
|
+
props: {
|
|
1939
|
+
type: {
|
|
1940
|
+
type: String,
|
|
1941
|
+
default: "default",
|
|
1942
|
+
validator: validateType
|
|
1943
|
+
},
|
|
1944
|
+
rotate: Boolean,
|
|
1945
|
+
disabled: Boolean,
|
|
1946
|
+
active: Boolean,
|
|
1947
|
+
icon: String,
|
|
1948
|
+
size: {
|
|
1949
|
+
type: String,
|
|
1950
|
+
default: "32px"
|
|
1951
|
+
},
|
|
1952
|
+
backgroundColor: String,
|
|
1953
|
+
color: String,
|
|
1954
|
+
fontSize: String
|
|
1955
|
+
},
|
|
1956
|
+
setup(__props) {
|
|
1957
|
+
return (_ctx, _cache) => {
|
|
1958
|
+
return openBlock(), createElementBlock("div", {
|
|
1959
|
+
class: normalizeClass([
|
|
1960
|
+
"fu-speed-dial-button",
|
|
1961
|
+
"fu-speed-dial-button--" + __props.type,
|
|
1962
|
+
{
|
|
1963
|
+
"fu-speed-dial-button--rotate": __props.rotate,
|
|
1964
|
+
"is-disabled": __props.disabled,
|
|
1965
|
+
"is-active": __props.active
|
|
1966
|
+
}
|
|
1967
|
+
]),
|
|
1968
|
+
style: normalizeStyle({
|
|
1969
|
+
width: __props.size,
|
|
1970
|
+
height: __props.size,
|
|
1971
|
+
backgroundColor: __props.backgroundColor,
|
|
1972
|
+
color: __props.color,
|
|
1973
|
+
fontSize: __props.fontSize
|
|
1974
|
+
})
|
|
1975
|
+
}, [
|
|
1976
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1977
|
+
createElementVNode("i", {
|
|
1978
|
+
class: normalizeClass(__props.icon)
|
|
1979
|
+
}, null, 2)
|
|
1980
|
+
])
|
|
1981
|
+
], 6);
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
});
|
|
1985
|
+
var FuSpeedDialButton = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/speed-dial/FuSpeedDialButton.vue"]]);
|
|
1986
|
+
const _hoisted_1$5 = { class: "fu-speed-dial-action-button" };
|
|
1987
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1988
|
+
props: {
|
|
1989
|
+
index: Number,
|
|
1990
|
+
icon: {
|
|
1991
|
+
type: String,
|
|
1992
|
+
default: "el-icon-plus"
|
|
1993
|
+
},
|
|
1994
|
+
titleClass: String,
|
|
1995
|
+
titleBgColor: String,
|
|
1996
|
+
titleColor: String,
|
|
1997
|
+
buttonClass: String,
|
|
1998
|
+
bgColor: String,
|
|
1999
|
+
color: String,
|
|
2000
|
+
title: [String, Number]
|
|
2001
|
+
},
|
|
2002
|
+
emits: ["click"],
|
|
2003
|
+
setup(__props, { emit }) {
|
|
2004
|
+
const props = __props;
|
|
2005
|
+
const FuSpeedDial2 = inject("FuSpeedDial");
|
|
2006
|
+
const config = computed(() => {
|
|
2007
|
+
return FuSpeedDial2.config;
|
|
2008
|
+
});
|
|
2009
|
+
const direction = computed(() => {
|
|
2010
|
+
return FuSpeedDial2.direction;
|
|
2011
|
+
});
|
|
2012
|
+
computed(() => {
|
|
2013
|
+
return FuSpeedDial2.clickClose;
|
|
2014
|
+
});
|
|
2015
|
+
const titleSize = computed(() => {
|
|
2016
|
+
let size = config.value.fab.size + "px";
|
|
2017
|
+
let style2 = { position: "absolute", height: size };
|
|
2018
|
+
if (["top", "bottom"].includes(direction.value)) {
|
|
2019
|
+
style2["text-align"] = "right";
|
|
2020
|
+
style2["right"] = size;
|
|
2021
|
+
} else {
|
|
2022
|
+
style2["text-align"] = "center";
|
|
2023
|
+
style2["min-width"] = size;
|
|
2024
|
+
if (props.index % 2 === 0) {
|
|
2025
|
+
style2.top = size;
|
|
2026
|
+
} else {
|
|
2027
|
+
style2.top = "-" + size;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
return style2;
|
|
2031
|
+
});
|
|
2032
|
+
const titleStyle = computed(() => {
|
|
2033
|
+
let backgroundColor = props.titleBgColor;
|
|
2034
|
+
let color = props.titleColor;
|
|
2035
|
+
let fontSize = config.value.item.titleFontSize;
|
|
2036
|
+
return { backgroundColor, color, fontSize };
|
|
2037
|
+
});
|
|
2038
|
+
const buttonProps = computed(() => {
|
|
2039
|
+
let backgroundColor = props.bgColor;
|
|
2040
|
+
let color = props.color;
|
|
2041
|
+
let fontSize = config.value.item.buttonFontSize;
|
|
2042
|
+
let size = config.value.item.size + "px";
|
|
2043
|
+
return { backgroundColor, color, fontSize, size };
|
|
2044
|
+
});
|
|
2045
|
+
function click(e) {
|
|
2046
|
+
const { index: index2, title } = props;
|
|
2047
|
+
emit("click", { index: index2, title }, e);
|
|
2048
|
+
FuSpeedDial2.close();
|
|
2049
|
+
}
|
|
2050
|
+
return (_ctx, _cache) => {
|
|
2051
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2052
|
+
__props.title ? (openBlock(), createElementBlock("div", {
|
|
2053
|
+
key: 0,
|
|
2054
|
+
class: "fu-speed-dial-action-button__title",
|
|
2055
|
+
style: normalizeStyle(unref(titleSize))
|
|
2056
|
+
}, [
|
|
2057
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
2058
|
+
createElementVNode("div", {
|
|
2059
|
+
class: normalizeClass(["fu-speed-dial-action-button__text", __props.titleClass]),
|
|
2060
|
+
style: normalizeStyle(unref(titleStyle)),
|
|
2061
|
+
onClick: click
|
|
2062
|
+
}, toDisplayString(__props.title), 7)
|
|
2063
|
+
])
|
|
2064
|
+
], 4)) : createCommentVNode("v-if", true),
|
|
2065
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2066
|
+
createVNode(FuSpeedDialButton, mergeProps({ class: __props.buttonClass }, unref(buttonProps), {
|
|
2067
|
+
icon: __props.icon,
|
|
2068
|
+
onClick: click
|
|
2069
|
+
}), null, 16, ["class", "icon"])
|
|
2070
|
+
])
|
|
2071
|
+
]);
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
});
|
|
2075
|
+
var FuSpeedDialActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/speed-dial/FuSpeedDialActionButton.vue"]]);
|
|
2076
|
+
const __default__$7 = { name: "FuSpeedDialItem" };
|
|
2077
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$7), {
|
|
2078
|
+
props: {
|
|
2079
|
+
index: {
|
|
2080
|
+
type: Number,
|
|
2081
|
+
required: true
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
setup(__props) {
|
|
2085
|
+
const props = __props;
|
|
2086
|
+
const FuSpeedDial2 = inject("FuSpeedDial");
|
|
2087
|
+
const config = computed(() => {
|
|
2088
|
+
return FuSpeedDial2.config;
|
|
2089
|
+
});
|
|
2090
|
+
const direction = computed(() => {
|
|
2091
|
+
return FuSpeedDial2.direction;
|
|
2092
|
+
});
|
|
2093
|
+
const isActive = computed(() => {
|
|
2094
|
+
return FuSpeedDial2.active;
|
|
2095
|
+
});
|
|
2096
|
+
computed(() => {
|
|
2097
|
+
return FuSpeedDial2.size;
|
|
2098
|
+
});
|
|
2099
|
+
const spacing = computed(() => {
|
|
2100
|
+
return config.value.item.spacing || 0;
|
|
2101
|
+
});
|
|
2102
|
+
const directionPosition = computed(() => {
|
|
2103
|
+
if (["top", "left"].includes(direction.value)) {
|
|
2104
|
+
return -config.value.fab.size - spacing.value;
|
|
2105
|
+
}
|
|
2106
|
+
return config.value.fab.size + spacing.value;
|
|
2107
|
+
});
|
|
2108
|
+
const itemSize = computed(() => {
|
|
2109
|
+
let size2 = config.value.fab.size + "px";
|
|
2110
|
+
return {
|
|
2111
|
+
width: size2,
|
|
2112
|
+
height: size2
|
|
2113
|
+
};
|
|
2114
|
+
});
|
|
2115
|
+
function setPosition(el, position) {
|
|
2116
|
+
if (["top", "bottom"].includes(direction.value)) {
|
|
2117
|
+
el.style.transform = "translateY(" + position + ")";
|
|
2118
|
+
} else {
|
|
2119
|
+
el.style.transform = "translateX(" + position + ")";
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
function beforeEnter(el) {
|
|
2123
|
+
el.style.transition = "all 0.3s";
|
|
2124
|
+
el.style.position = "absolute";
|
|
2125
|
+
setPosition(el, 0);
|
|
2126
|
+
el.style.opacity = "0";
|
|
2127
|
+
}
|
|
2128
|
+
function enter(el, done) {
|
|
2129
|
+
let position = props.index * directionPosition.value + "px";
|
|
2130
|
+
setTimeout(() => {
|
|
2131
|
+
setPosition(el, position);
|
|
2132
|
+
el.style.opacity = "1";
|
|
2133
|
+
done();
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
function leave(el, done) {
|
|
2137
|
+
setPosition(el, 0);
|
|
2138
|
+
el.style.opacity = "0";
|
|
2139
|
+
setTimeout(() => {
|
|
2140
|
+
done();
|
|
2141
|
+
}, 200);
|
|
2142
|
+
}
|
|
2143
|
+
return (_ctx, _cache) => {
|
|
2144
|
+
return openBlock(), createBlock(Transition, {
|
|
2145
|
+
css: false,
|
|
2146
|
+
onBeforeEnter: beforeEnter,
|
|
2147
|
+
onEnter: enter,
|
|
2148
|
+
onLeave: leave
|
|
2149
|
+
}, {
|
|
2150
|
+
default: withCtx(() => [
|
|
2151
|
+
unref(isActive) ? (openBlock(), createElementBlock("div", {
|
|
2152
|
+
key: 0,
|
|
2153
|
+
class: "fu-speed-dial-item",
|
|
2154
|
+
style: normalizeStyle(unref(itemSize))
|
|
2155
|
+
}, [
|
|
2156
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2157
|
+
createVNode(FuSpeedDialActionButton, mergeProps({ index: __props.index }, _ctx.$attrs), null, 16, ["index"])
|
|
2158
|
+
])
|
|
2159
|
+
], 4)) : createCommentVNode("v-if", true)
|
|
2160
|
+
]),
|
|
2161
|
+
_: 3
|
|
2162
|
+
});
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
}));
|
|
2166
|
+
var FuSpeedDialItem = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/speed-dial/FuSpeedDialItem.vue"]]);
|
|
2167
|
+
const _hoisted_1$4 = { class: "fu-speed-dial__content" };
|
|
2168
|
+
const __default__$6 = { name: "FuSpeedDial" };
|
|
2169
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$6), {
|
|
2170
|
+
props: {
|
|
2171
|
+
id: String,
|
|
2172
|
+
value: Boolean,
|
|
2173
|
+
type: {
|
|
2174
|
+
type: String,
|
|
2175
|
+
default: "primary"
|
|
2176
|
+
},
|
|
2177
|
+
items: Array,
|
|
2178
|
+
size: {
|
|
2179
|
+
type: String,
|
|
2180
|
+
default: "default",
|
|
2181
|
+
validator: (value) => ["big", "default", "medium", "small"].includes(value)
|
|
2182
|
+
},
|
|
2183
|
+
direction: {
|
|
2184
|
+
type: String,
|
|
2185
|
+
default: "top",
|
|
2186
|
+
validator: (value) => ["top", "bottom", "left", "right"].includes(value)
|
|
2187
|
+
},
|
|
2188
|
+
icon: {
|
|
2189
|
+
type: String,
|
|
2190
|
+
default: "el-icon-plus"
|
|
2191
|
+
},
|
|
2192
|
+
activeIcon: {
|
|
2193
|
+
type: String,
|
|
2194
|
+
default: "el-icon-close"
|
|
2195
|
+
},
|
|
2196
|
+
movable: {
|
|
2197
|
+
type: Boolean,
|
|
2198
|
+
default: false
|
|
2199
|
+
},
|
|
2200
|
+
position: {
|
|
2201
|
+
type: String,
|
|
2202
|
+
validator: (value) => ["absolute", "fixed"].includes(value)
|
|
2203
|
+
},
|
|
2204
|
+
left: String,
|
|
2205
|
+
top: String,
|
|
2206
|
+
right: String,
|
|
2207
|
+
bottom: String,
|
|
2208
|
+
zIndex: {
|
|
2209
|
+
type: [String, Number],
|
|
2210
|
+
default: 99
|
|
2211
|
+
},
|
|
2212
|
+
itemClickClose: {
|
|
2213
|
+
type: Boolean,
|
|
2214
|
+
default: true
|
|
2215
|
+
},
|
|
2216
|
+
outsideClose: {
|
|
2217
|
+
type: Boolean,
|
|
2218
|
+
default: true
|
|
2219
|
+
},
|
|
2220
|
+
manual: {
|
|
2221
|
+
type: Boolean,
|
|
2222
|
+
default: false
|
|
2223
|
+
},
|
|
2224
|
+
localKey: String,
|
|
2225
|
+
sizeOptions: {
|
|
2226
|
+
type: Object,
|
|
2227
|
+
default: () => {
|
|
2228
|
+
return {
|
|
2229
|
+
big: {
|
|
2230
|
+
fab: { size: 56, fontSize: "18px" },
|
|
2231
|
+
item: { size: 40, spacing: 0, titleFontSize: "14px", buttonFontSize: "18px" }
|
|
2232
|
+
},
|
|
2233
|
+
default: {
|
|
2234
|
+
fab: { size: 40, fontSize: "16px" },
|
|
2235
|
+
item: { size: 32, spacing: 0, titleFontSize: "14px", buttonFontSize: "16px" }
|
|
2236
|
+
},
|
|
2237
|
+
medium: {
|
|
2238
|
+
fab: { size: 36, fontSize: "14px" },
|
|
2239
|
+
item: { size: 28, spacing: 0, titleFontSize: "12px", buttonFontSize: "14px" }
|
|
2240
|
+
},
|
|
2241
|
+
small: {
|
|
2242
|
+
fab: { size: 32, fontSize: "12px" },
|
|
2243
|
+
item: { size: 24, spacing: 0, titleFontSize: "12px", buttonFontSize: "12px" }
|
|
2244
|
+
}
|
|
2245
|
+
};
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
},
|
|
2249
|
+
emits: ["close", "outside-click", "click"],
|
|
2250
|
+
setup(__props, { expose, emit }) {
|
|
2251
|
+
const props = __props;
|
|
2252
|
+
const slots = useSlots();
|
|
2253
|
+
const instance = getCurrentInstance();
|
|
2254
|
+
const { zIndex, position, left, top, right, bottom } = props;
|
|
2255
|
+
const active = ref(false);
|
|
2256
|
+
const moving = ref(false);
|
|
2257
|
+
const style2 = reactive({ zIndex, position, left, top, right, bottom });
|
|
2258
|
+
const updateStyle = function() {
|
|
2259
|
+
style2.value = { zIndex, position, left, top, right, bottom };
|
|
2260
|
+
};
|
|
2261
|
+
provide("FuSpeedDial", instance);
|
|
2262
|
+
watch(() => props.value, (v) => {
|
|
2263
|
+
active.value = v;
|
|
2264
|
+
});
|
|
2265
|
+
watch(() => props.position, updateStyle);
|
|
2266
|
+
watch(() => props.zIndex, updateStyle);
|
|
2267
|
+
watch(() => props.left, updateStyle);
|
|
2268
|
+
watch(() => props.right, updateStyle);
|
|
2269
|
+
watch(() => props.top, updateStyle);
|
|
2270
|
+
watch(() => props.bottom, updateStyle);
|
|
2271
|
+
const saveKey = computed(() => {
|
|
2272
|
+
return "Fu-SD-" + props.localKey;
|
|
2273
|
+
});
|
|
2274
|
+
const hashChildren = computed(() => {
|
|
2275
|
+
if (props.items && props.items.length > 0) {
|
|
2276
|
+
return true;
|
|
2277
|
+
}
|
|
2278
|
+
return slots && slots.default;
|
|
2279
|
+
});
|
|
2280
|
+
const config = computed(() => {
|
|
2281
|
+
return props.sizeOptions[props.size] || props.sizeOptions["default"];
|
|
2282
|
+
});
|
|
2283
|
+
const buttonProps = computed(() => {
|
|
2284
|
+
let type = props.type;
|
|
2285
|
+
let rotate = true;
|
|
2286
|
+
let activeValue = active.value;
|
|
2287
|
+
let size = config.value.fab.size + "px";
|
|
2288
|
+
let fontSize = config.value.fab.fontSize;
|
|
2289
|
+
let icon = props.activeIcon === props.icon ? props.icon : active.value ? props.activeIcon : props.icon;
|
|
2290
|
+
return { type, rotate, active: activeValue, size, fontSize, icon };
|
|
2291
|
+
});
|
|
2292
|
+
const spacing = computed(() => {
|
|
2293
|
+
let spacing2 = config.value.item.spacing || 0;
|
|
2294
|
+
spacing2 += (config.value.fab.size - config.value.item.size) / 2;
|
|
2295
|
+
return spacing2;
|
|
2296
|
+
});
|
|
2297
|
+
const contentPosition = computed(() => {
|
|
2298
|
+
let position2 = config.value.fab.size + spacing.value;
|
|
2299
|
+
if (["top", "left"].includes(props.direction)) {
|
|
2300
|
+
position2 = -config.value.fab.size - spacing.value;
|
|
2301
|
+
}
|
|
2302
|
+
let style22 = { position: "absolute", zIndex: props.zIndex };
|
|
2303
|
+
if (["top", "bottom"].includes(props.direction)) {
|
|
2304
|
+
style22.top = position2 + "px";
|
|
2305
|
+
} else {
|
|
2306
|
+
style22.top = 0;
|
|
2307
|
+
style22.left = position2 + "px";
|
|
2308
|
+
}
|
|
2309
|
+
return style22;
|
|
2310
|
+
});
|
|
2311
|
+
function toggle(active2) {
|
|
2312
|
+
if (!moving.value && hashChildren.value) {
|
|
2313
|
+
active2.value = active2 === void 0 ? !active2.value : active2;
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
function click(e) {
|
|
2317
|
+
if (!props.manual) {
|
|
2318
|
+
toggle();
|
|
2319
|
+
}
|
|
2320
|
+
emit("click", [props.id, active.value], e);
|
|
2321
|
+
}
|
|
2322
|
+
function mousedown() {
|
|
2323
|
+
if (moving.value) {
|
|
2324
|
+
document.addEventListener("mousemove", mousemove);
|
|
2325
|
+
document.addEventListener("mouseup", mouseup);
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
function mousemove(e) {
|
|
2329
|
+
moving.value = true;
|
|
2330
|
+
if (props.position === "fixed") {
|
|
2331
|
+
const el = instance.vnode.el;
|
|
2332
|
+
const rect = el.getBoundingClientRect();
|
|
2333
|
+
let left2 = e.clientX - rect.width / 2;
|
|
2334
|
+
let top2 = e.clientY - rect.height / 2;
|
|
2335
|
+
style2.value.left = left2 + "px";
|
|
2336
|
+
style2.value.top = top2 + "px";
|
|
2337
|
+
delete style2.value.right;
|
|
2338
|
+
delete style2.value.bottom;
|
|
2339
|
+
}
|
|
2340
|
+
if (props.position === "absolute") {
|
|
2341
|
+
const { offsetLeft, offsetTop, clientWidth, clientHeight, offsetParent } = this.$el;
|
|
2342
|
+
const maxWidth = offsetParent.clientWidth - clientWidth;
|
|
2343
|
+
const maxHeight = offsetParent.clientHeight - clientHeight;
|
|
2344
|
+
let left2 = offsetLeft + e.movementX;
|
|
2345
|
+
let top2 = offsetTop + e.movementY;
|
|
2346
|
+
if (left2 > 0 && left2 < maxWidth) {
|
|
2347
|
+
style2.value.left = left2 + "px";
|
|
2348
|
+
delete style2.value.right;
|
|
2349
|
+
}
|
|
2350
|
+
if (top2 > 0 && top2 < maxHeight) {
|
|
2351
|
+
style2.value.top = top2 + "px";
|
|
2352
|
+
delete style2.value.bottom;
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
function mouseup() {
|
|
2357
|
+
writePosition();
|
|
2358
|
+
document.removeEventListener("mousemove", mousemove);
|
|
2359
|
+
document.removeEventListener("mouseup", mouseup);
|
|
2360
|
+
setTimeout(() => moving.value = false);
|
|
2361
|
+
}
|
|
2362
|
+
function writePosition() {
|
|
2363
|
+
if (props.localKey) {
|
|
2364
|
+
localStorage.setItem(saveKey.value, JSON.stringify(style2.value));
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
function readPosition() {
|
|
2368
|
+
let position2 = localStorage.getItem(saveKey.value);
|
|
2369
|
+
try {
|
|
2370
|
+
localStorage.getItem(saveKey.value);
|
|
2371
|
+
if (position2) {
|
|
2372
|
+
style2.value = JSON.parse(position2);
|
|
2373
|
+
}
|
|
2374
|
+
} catch (e) {
|
|
2375
|
+
console.warn(saveKey.value + " error", e);
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
function itemClick(arg, e) {
|
|
2379
|
+
console.log(arg);
|
|
2380
|
+
const { index: index2 } = arg;
|
|
2381
|
+
if (index2 !== void 0) {
|
|
2382
|
+
const item = props.items[index2];
|
|
2383
|
+
if (item.click && typeof item.click === "function")
|
|
2384
|
+
return item.click(arg, e);
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
function close() {
|
|
2388
|
+
if (props.itemClickClose && !props.manual) {
|
|
2389
|
+
toggle(false);
|
|
2390
|
+
}
|
|
2391
|
+
emit("close", [props.id, active.value]);
|
|
2392
|
+
}
|
|
2393
|
+
onMounted(() => {
|
|
2394
|
+
readPosition();
|
|
2395
|
+
});
|
|
2396
|
+
expose({
|
|
2397
|
+
close
|
|
2398
|
+
});
|
|
2399
|
+
return (_ctx, _cache) => {
|
|
2400
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
2401
|
+
createCommentVNode(' v-outside-click="outsideClickClose" '),
|
|
2402
|
+
createElementVNode("div", {
|
|
2403
|
+
class: "fu-speed-dial",
|
|
2404
|
+
style: normalizeStyle(unref(style2))
|
|
2405
|
+
}, [
|
|
2406
|
+
createElementVNode("div", _hoisted_1$4, [
|
|
2407
|
+
renderSlot(_ctx.$slots, "fab", {}, () => [
|
|
2408
|
+
createVNode(FuSpeedDialButton, mergeProps(unref(buttonProps), {
|
|
2409
|
+
onClick: click,
|
|
2410
|
+
onMousedown: mousedown
|
|
2411
|
+
}), null, 16)
|
|
2412
|
+
]),
|
|
2413
|
+
createElementVNode("div", {
|
|
2414
|
+
style: normalizeStyle(unref(contentPosition))
|
|
2415
|
+
}, [
|
|
2416
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2417
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index2) => {
|
|
2418
|
+
return openBlock(), createBlock(FuSpeedDialItem, mergeProps({
|
|
2419
|
+
index: index2,
|
|
2420
|
+
key: index2
|
|
2421
|
+
}, item, { onClick: itemClick }), null, 16, ["index"]);
|
|
2422
|
+
}), 128))
|
|
2423
|
+
])
|
|
2424
|
+
], 4)
|
|
2425
|
+
])
|
|
2426
|
+
], 4)
|
|
2427
|
+
], 2112);
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
}));
|
|
2431
|
+
var FuSpeedDial = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/speed-dial/FuSpeedDial.vue"]]);
|
|
2432
|
+
FuSpeedDial.install = (app) => {
|
|
2433
|
+
app.component(FuSpeedDial.name, FuSpeedDial);
|
|
2434
|
+
app.component(FuSpeedDialItem.name, FuSpeedDialItem);
|
|
2435
|
+
};
|
|
2436
|
+
var __glob_1_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2437
|
+
__proto__: null,
|
|
2438
|
+
"default": FuSpeedDial
|
|
2439
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2440
|
+
const _hoisted_1$3 = {
|
|
2441
|
+
key: 0,
|
|
2442
|
+
class: "icon"
|
|
2443
|
+
};
|
|
2444
|
+
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("i", { class: "el-icon-more" }, null, -1);
|
|
2445
|
+
const __default__$5 = { name: "FuSplitPane" };
|
|
2446
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
|
|
2447
|
+
props: {
|
|
2448
|
+
min: {
|
|
2449
|
+
type: [Number, String],
|
|
2450
|
+
default: "10px"
|
|
2451
|
+
},
|
|
2452
|
+
left: [Number, String],
|
|
2453
|
+
right: [Number, String],
|
|
2454
|
+
top: [Number, String],
|
|
2455
|
+
bottom: [Number, String],
|
|
2456
|
+
direction: {
|
|
2457
|
+
validator: (val) => ["vertical", "horizontal"].includes(val),
|
|
2458
|
+
default: "horizontal"
|
|
2459
|
+
},
|
|
2460
|
+
localKey: String,
|
|
2461
|
+
resizable: {
|
|
2462
|
+
type: Boolean,
|
|
2463
|
+
default: true
|
|
2464
|
+
},
|
|
2465
|
+
resizerType: {
|
|
2466
|
+
validator: (val) => ["resizer", "line"].includes(val),
|
|
2467
|
+
default: "resizer"
|
|
2468
|
+
},
|
|
2469
|
+
resizerClass: String,
|
|
2470
|
+
resizerStyle: Object,
|
|
2471
|
+
resizerHoverClass: String
|
|
2472
|
+
},
|
|
2473
|
+
emits: ["changeSplit"],
|
|
2474
|
+
setup(__props, { emit }) {
|
|
2475
|
+
const props = __props;
|
|
2476
|
+
const instance = getCurrentInstance();
|
|
2477
|
+
const active = ref(false);
|
|
2478
|
+
const usedValue = ref(0);
|
|
2479
|
+
const oldValue = ref(0);
|
|
2480
|
+
const initOffset = ref(0);
|
|
2481
|
+
const hover = ref(false);
|
|
2482
|
+
watch(() => props.left, (newValue, oldValue2) => {
|
|
2483
|
+
if (newValue !== oldValue2) {
|
|
2484
|
+
nextTick(() => {
|
|
2485
|
+
usedValue.value = defaultValue.value;
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
}, { immediate: true });
|
|
2489
|
+
watch(() => props.bottom, (newValue, oldValue2) => {
|
|
2490
|
+
if (newValue !== oldValue2) {
|
|
2491
|
+
nextTick(() => {
|
|
2492
|
+
usedValue.value = defaultValue.value;
|
|
2493
|
+
});
|
|
2494
|
+
}
|
|
2495
|
+
}, { immediate: true });
|
|
2496
|
+
const isReverse = computed(() => {
|
|
2497
|
+
return props.right || props.bottom;
|
|
2498
|
+
});
|
|
2499
|
+
const isHorizontal = computed(() => {
|
|
2500
|
+
return props.direction === "horizontal";
|
|
2501
|
+
});
|
|
2502
|
+
const userSelect = computed(() => {
|
|
2503
|
+
return active.value ? "none" : "";
|
|
2504
|
+
});
|
|
2505
|
+
const cursor = computed(() => {
|
|
2506
|
+
return active.value && props.resizable ? isHorizontal.value ? "col-resize" : "row-resize" : "";
|
|
2507
|
+
});
|
|
2508
|
+
const outerWrapperSize = computed(() => {
|
|
2509
|
+
return instance.refs.outerWrapper[offsetSize.value];
|
|
2510
|
+
});
|
|
2511
|
+
const offsetSize = computed(() => {
|
|
2512
|
+
return isHorizontal.value ? "offsetWidth" : "offsetHeight";
|
|
2513
|
+
});
|
|
2514
|
+
const defaultValue = computed(() => {
|
|
2515
|
+
if (isHorizontal.value) {
|
|
2516
|
+
return props.left ? getMin(percentToValue(props.left)) : props.right && getMin(percentToValue(props.right)) || outerWrapperSize.value / 2;
|
|
2517
|
+
} else {
|
|
2518
|
+
return props.top ? getMin(percentToValue(props.top)) : props.bottom && getMin(percentToValue(props.bottom)) || outerWrapperSize.value / 2;
|
|
2519
|
+
}
|
|
2520
|
+
});
|
|
2521
|
+
const valueAnother = computed(() => {
|
|
2522
|
+
return `calc(100% - ${usedValue.value}px)`;
|
|
2523
|
+
});
|
|
2524
|
+
const attr = computed(() => {
|
|
2525
|
+
return isHorizontal.value ? "width" : "height";
|
|
2526
|
+
});
|
|
2527
|
+
const resizerAttr = computed(() => {
|
|
2528
|
+
return isHorizontal.value ? isReverse.value ? "right" : "left" : isReverse.value ? "bottom" : "top";
|
|
2529
|
+
});
|
|
2530
|
+
const saveKey = computed(() => {
|
|
2531
|
+
return "Fu-SP-" + props.localKey;
|
|
2532
|
+
});
|
|
2533
|
+
const resizerClasses = computed(() => {
|
|
2534
|
+
const classes = [
|
|
2535
|
+
`fu-split-pane__${props.resizerType}`,
|
|
2536
|
+
`is-${props.direction}`,
|
|
2537
|
+
props.resizable && "is-resizable",
|
|
2538
|
+
props.resizerClass,
|
|
2539
|
+
hover.value && (props.resizerHoverClass || "hover")
|
|
2540
|
+
];
|
|
2541
|
+
return classes;
|
|
2542
|
+
});
|
|
2543
|
+
const padding = computed(() => {
|
|
2544
|
+
return props.resizerType === "resizer" && isHorizontal.value && "3px";
|
|
2545
|
+
});
|
|
2546
|
+
function onMouseDown(e) {
|
|
2547
|
+
initOffset.value = isHorizontal.value ? e.pageX : e.pageY;
|
|
2548
|
+
oldValue.value = usedValue.value;
|
|
2549
|
+
active.value = true;
|
|
2550
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
2551
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
2552
|
+
}
|
|
2553
|
+
function onMouseUp() {
|
|
2554
|
+
active.value = false;
|
|
2555
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
2556
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
2557
|
+
emit("changeSplit", usedValue.value);
|
|
2558
|
+
}
|
|
2559
|
+
function onMouseMove(e) {
|
|
2560
|
+
if (!props.resizable)
|
|
2561
|
+
return;
|
|
2562
|
+
if (active.value) {
|
|
2563
|
+
const currentPage = isHorizontal.value ? e.pageX : e.pageY;
|
|
2564
|
+
const offset = currentPage - initOffset.value;
|
|
2565
|
+
const value = isReverse.value ? oldValue.value - offset : oldValue.value + offset;
|
|
2566
|
+
if (value > percentToValue(props.min) && value < outerWrapperSize.value - percentToValue(props.min)) {
|
|
2567
|
+
usedValue.value = value;
|
|
2568
|
+
writeValue();
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
function percentToValue(val) {
|
|
2573
|
+
const size = instance.refs.outerWrapper[offsetSize.value];
|
|
2574
|
+
if (typeof val === "string" && val.includes("%")) {
|
|
2575
|
+
return parseInt(val) / 100 * size;
|
|
2576
|
+
} else {
|
|
2577
|
+
return parseInt(val);
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
function getMin(val) {
|
|
2581
|
+
return val < percentToValue(props.min) ? percentToValue(props.min) : val;
|
|
2582
|
+
}
|
|
2583
|
+
function writeValue() {
|
|
2584
|
+
const obj = {
|
|
2585
|
+
[resizerAttr.value]: usedValue.value
|
|
2586
|
+
};
|
|
2587
|
+
if (props.localKey) {
|
|
2588
|
+
localStorage.setItem(saveKey.value, JSON.stringify(obj));
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
function readValue() {
|
|
2592
|
+
if (props.localKey) {
|
|
2593
|
+
const local = localStorage.getItem(saveKey.value);
|
|
2594
|
+
if (local && local[resizerAttr.value]) {
|
|
2595
|
+
usedValue.value = parseInt(local) || defaultValue.value;
|
|
2596
|
+
} else {
|
|
2597
|
+
usedValue.value = defaultValue.value;
|
|
2598
|
+
}
|
|
2599
|
+
} else {
|
|
2600
|
+
usedValue.value = defaultValue.value;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
onMounted(() => {
|
|
2604
|
+
readValue();
|
|
2605
|
+
});
|
|
2606
|
+
return (_ctx, _cache) => {
|
|
2607
|
+
return openBlock(), createElementBlock("div", {
|
|
2608
|
+
style: normalizeStyle({ cursor: unref(cursor), userSelect: unref(userSelect) }),
|
|
2609
|
+
class: "fu-split-pane",
|
|
2610
|
+
ref: "outerWrapper"
|
|
2611
|
+
}, [
|
|
2612
|
+
createElementVNode("div", {
|
|
2613
|
+
class: normalizeClass([`is-${__props.direction}`, "fu-split-pane__left"]),
|
|
2614
|
+
style: normalizeStyle({ [unref(attr)]: unref(isReverse) ? unref(valueAnother) : `${usedValue.value}px`, "padding-right": unref(padding) })
|
|
2615
|
+
}, [
|
|
2616
|
+
renderSlot(_ctx.$slots, unref(isHorizontal) ? "left" : "top")
|
|
2617
|
+
], 6),
|
|
2618
|
+
createElementVNode("div", {
|
|
2619
|
+
class: normalizeClass(unref(resizerClasses)),
|
|
2620
|
+
style: normalizeStyle(__spreadValues({ [unref(resizerAttr)]: `${usedValue.value}px` }, __props.resizerStyle)),
|
|
2621
|
+
onMousedown: onMouseDown,
|
|
2622
|
+
onMouseover: _cache[0] || (_cache[0] = ($event) => hover.value = true),
|
|
2623
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => hover.value = false)
|
|
2624
|
+
}, [
|
|
2625
|
+
__props.resizerType === "resizer" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2626
|
+
renderSlot(_ctx.$slots, "resizer", {}, () => [
|
|
2627
|
+
_hoisted_2$2
|
|
2628
|
+
])
|
|
2629
|
+
])) : createCommentVNode("v-if", true)
|
|
2630
|
+
], 38),
|
|
2631
|
+
createElementVNode("div", {
|
|
2632
|
+
class: normalizeClass([`is-${__props.direction}`, "fu-split-pane__right"]),
|
|
2633
|
+
style: normalizeStyle({ [unref(attr)]: unref(isReverse) ? `${usedValue.value}px` : unref(valueAnother), "padding-left": unref(padding) })
|
|
2634
|
+
}, [
|
|
2635
|
+
renderSlot(_ctx.$slots, unref(isHorizontal) ? "right" : "bottom")
|
|
2636
|
+
], 6)
|
|
2637
|
+
], 4);
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
}));
|
|
2641
|
+
var FuSplitPane = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/split-pane/FuSplitPane.vue"]]);
|
|
2642
|
+
FuSplitPane.install = (app) => {
|
|
2643
|
+
app.component(FuSplitPane.name, FuSplitPane);
|
|
2644
|
+
};
|
|
2645
|
+
var __glob_1_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2646
|
+
__proto__: null,
|
|
2647
|
+
"default": FuSplitPane
|
|
2648
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2649
|
+
var index = {
|
|
2650
|
+
install: (app) => {
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
var __glob_1_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2654
|
+
__proto__: null,
|
|
2655
|
+
"default": index
|
|
2656
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2657
|
+
const isFix = (node) => {
|
|
2658
|
+
const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
|
|
2659
|
+
const { fix } = node.props;
|
|
2660
|
+
let { type } = node.props;
|
|
2661
|
+
return fix !== void 0 && fix !== false || ["selection", "index", "expand"].includes(type) || includeTag;
|
|
2662
|
+
};
|
|
2663
|
+
const getLabel = (node) => {
|
|
2664
|
+
if (node.props.label)
|
|
2665
|
+
return node.props.label;
|
|
2666
|
+
const prefix = "FU-T-";
|
|
2667
|
+
const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
|
|
2668
|
+
let { label, type } = node.props;
|
|
2669
|
+
if (includeTag)
|
|
2670
|
+
label = prefix + "dropdown";
|
|
2671
|
+
label != null ? label : label = node.props.label;
|
|
2672
|
+
label != null ? label : label = prefix + type;
|
|
2673
|
+
return label;
|
|
2674
|
+
};
|
|
2675
|
+
const FuTableBody = (props, context) => {
|
|
2676
|
+
const slots = context.slots.default();
|
|
2677
|
+
const nodes = [];
|
|
2678
|
+
let { columns } = props;
|
|
2679
|
+
const children = slots[0].children.filter((c) => c.type.name !== void 0);
|
|
2680
|
+
if (!children)
|
|
2681
|
+
return nodes;
|
|
2682
|
+
if (!columns || (columns == null ? void 0 : columns.length) === 0)
|
|
2683
|
+
return children;
|
|
2684
|
+
columns.forEach((col) => {
|
|
2685
|
+
let node = children.find((child) => {
|
|
2686
|
+
return col.label === getLabel(child);
|
|
2687
|
+
});
|
|
2688
|
+
if (node && (isFix(node) || col.show !== false)) {
|
|
2689
|
+
nodes.push(node);
|
|
2690
|
+
}
|
|
2691
|
+
});
|
|
2692
|
+
return nodes;
|
|
2693
|
+
};
|
|
2694
|
+
const __default__$4 = { name: "FuTable" };
|
|
2695
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
|
|
2696
|
+
props: {
|
|
2697
|
+
columns: Array,
|
|
2698
|
+
refresh: {
|
|
2699
|
+
type: Boolean,
|
|
2700
|
+
default: true
|
|
2701
|
+
},
|
|
2702
|
+
localKey: String
|
|
2703
|
+
},
|
|
2704
|
+
setup(__props) {
|
|
2705
|
+
var _a;
|
|
2706
|
+
const props = __props;
|
|
2707
|
+
const slots = useSlots();
|
|
2708
|
+
const key = ref(0);
|
|
2709
|
+
const prefix = "FU-T-";
|
|
2710
|
+
const isFix2 = (node) => {
|
|
2711
|
+
const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
|
|
2712
|
+
const { fix } = node.props;
|
|
2713
|
+
let { type } = node.props;
|
|
2714
|
+
return fix !== void 0 && fix !== false || ["selection", "index", "expand"].includes(type) || includeTag;
|
|
2715
|
+
};
|
|
2716
|
+
const getLabel2 = (node) => {
|
|
2717
|
+
if (node.props.label)
|
|
2718
|
+
return node.props.label;
|
|
2719
|
+
const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
|
|
2720
|
+
let { label, type } = node.props;
|
|
2721
|
+
if (includeTag)
|
|
2722
|
+
label = prefix + "dropdown";
|
|
2723
|
+
label != null ? label : label = node.props.label;
|
|
2724
|
+
label != null ? label : label = prefix + type;
|
|
2725
|
+
return label;
|
|
2726
|
+
};
|
|
2727
|
+
const cleanColumns = (columns) => {
|
|
2728
|
+
columns.splice(0, columns.length);
|
|
2729
|
+
};
|
|
2730
|
+
const updateNodes = (nodes) => {
|
|
2731
|
+
nodes.forEach((node) => {
|
|
2732
|
+
if (!node.type.key) {
|
|
2733
|
+
node.type.key = getLabel2(node);
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
};
|
|
2737
|
+
const initColumns = (nodes, columns) => {
|
|
2738
|
+
nodes.forEach((node) => {
|
|
2739
|
+
const label = getLabel2(node);
|
|
2740
|
+
const fix = isFix2(node);
|
|
2741
|
+
const { show } = node.props;
|
|
2742
|
+
if (!label && !fix) {
|
|
2743
|
+
throw new Error("unfixed column's label is required.");
|
|
2744
|
+
}
|
|
2745
|
+
columns.push({ label, show, fix });
|
|
2746
|
+
});
|
|
2747
|
+
};
|
|
2748
|
+
const copyColumns = (source, target) => {
|
|
2749
|
+
source.forEach((col) => {
|
|
2750
|
+
target.push(col);
|
|
2751
|
+
});
|
|
2752
|
+
};
|
|
2753
|
+
const updateColumns = (nodes, columns) => {
|
|
2754
|
+
if (columns === void 0)
|
|
2755
|
+
return;
|
|
2756
|
+
if (nodes.length !== columns.length) {
|
|
2757
|
+
cleanColumns(columns);
|
|
2758
|
+
initColumns(nodes, columns);
|
|
2759
|
+
}
|
|
2760
|
+
if (columns.some((col) => col.label === void 0)) {
|
|
2761
|
+
columns.forEach((col, i) => {
|
|
2762
|
+
var _a2;
|
|
2763
|
+
(_a2 = col.label) != null ? _a2 : col.label = getLabel2(nodes[i]);
|
|
2764
|
+
});
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
const columnsKey = computed(() => {
|
|
2768
|
+
return prefix + props.localKey;
|
|
2769
|
+
});
|
|
2770
|
+
const children = (_a = slots.default) == null ? void 0 : _a.call(slots).filter((c) => c.type.name !== void 0);
|
|
2771
|
+
watch(() => props.columns, () => {
|
|
2772
|
+
if (props.refresh) {
|
|
2773
|
+
key.value++;
|
|
2774
|
+
}
|
|
2775
|
+
if (props.localKey) {
|
|
2776
|
+
localStorage.setItem(columnsKey.value, JSON.stringify(props.columns));
|
|
2777
|
+
}
|
|
2778
|
+
}, { deep: true });
|
|
2779
|
+
onMounted(() => {
|
|
2780
|
+
updateNodes(children);
|
|
2781
|
+
if (!children || !props.columns)
|
|
2782
|
+
return;
|
|
2783
|
+
if (props.localKey) {
|
|
2784
|
+
let str = localStorage.getItem(columnsKey.value);
|
|
2785
|
+
if (str) {
|
|
2786
|
+
try {
|
|
2787
|
+
const columns = JSON.parse(str);
|
|
2788
|
+
cleanColumns(props.columns);
|
|
2789
|
+
copyColumns(columns, props.columns);
|
|
2790
|
+
updateColumns(children, props.columns);
|
|
2791
|
+
return;
|
|
2792
|
+
} catch (e) {
|
|
2793
|
+
console.error("get columns error", e);
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
if (props.columns.length === 0) {
|
|
2798
|
+
initColumns(children, props.columns);
|
|
2799
|
+
}
|
|
2800
|
+
});
|
|
2801
|
+
provide("localKey", props.localKey);
|
|
2802
|
+
onUpdated(() => {
|
|
2803
|
+
updateNodes(children);
|
|
2804
|
+
updateColumns(children, props.columns);
|
|
2805
|
+
});
|
|
2806
|
+
return (_ctx, _cache) => {
|
|
2807
|
+
const _component_el_table = resolveComponent("el-table");
|
|
2808
|
+
return openBlock(), createBlock(_component_el_table, mergeProps({ class: "fu-table" }, _ctx.$attrs, {
|
|
2809
|
+
key: key.value,
|
|
2810
|
+
"header-row-class-name": "fu-table-header"
|
|
2811
|
+
}), {
|
|
2812
|
+
default: withCtx(() => [
|
|
2813
|
+
createVNode(unref(FuTableBody), {
|
|
2814
|
+
name: "table-body",
|
|
2815
|
+
columns: __props.columns
|
|
2816
|
+
}, {
|
|
2817
|
+
default: withCtx(() => [
|
|
2818
|
+
renderSlot(_ctx.$slots, "default")
|
|
2819
|
+
]),
|
|
2820
|
+
_: 3
|
|
2821
|
+
}, 8, ["columns"])
|
|
2822
|
+
]),
|
|
2823
|
+
_: 3
|
|
2824
|
+
}, 16);
|
|
2825
|
+
};
|
|
2826
|
+
}
|
|
2827
|
+
}));
|
|
2828
|
+
var FuTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/FuTable.vue"]]);
|
|
2829
|
+
const tableColumnSelect = (localKey) => {
|
|
2830
|
+
const columnsKey = computed(() => {
|
|
2831
|
+
return localKey ? "FU-T-" + localKey : "";
|
|
2832
|
+
});
|
|
2833
|
+
function dragstart(event, index2) {
|
|
2834
|
+
if (event.dataTransfer) {
|
|
2835
|
+
event.dataTransfer.effectAllowed = "move";
|
|
2836
|
+
event.dataTransfer.setData("source_index", index2);
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
function dragenter(event) {
|
|
2840
|
+
event.preventDefault();
|
|
2841
|
+
if (event.target) {
|
|
2842
|
+
event.target.style.opacity = 0.2;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
function dragleave(event) {
|
|
2846
|
+
event.preventDefault();
|
|
2847
|
+
if (event.target) {
|
|
2848
|
+
event.target.style.opacity = "";
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
function dragend(event) {
|
|
2852
|
+
if (event.dataTransfer) {
|
|
2853
|
+
event.dataTransfer.clearData();
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
function drop(event, list, index2) {
|
|
2857
|
+
var _a;
|
|
2858
|
+
let source_index = Number((_a = event.dataTransfer) == null ? void 0 : _a.getData("source_index"));
|
|
2859
|
+
let target_index = index2;
|
|
2860
|
+
if (target_index > source_index) {
|
|
2861
|
+
list.splice(target_index + 1, 0, list[source_index]);
|
|
2862
|
+
list.splice(source_index, 1);
|
|
2863
|
+
} else {
|
|
2864
|
+
list.splice(target_index, 0, list[source_index]);
|
|
2865
|
+
list.splice(source_index + 1, 1);
|
|
2866
|
+
}
|
|
2867
|
+
if (event.target) {
|
|
2868
|
+
event.target.style.opacity = "";
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
return {
|
|
2872
|
+
columnsKey,
|
|
2873
|
+
dragstart,
|
|
2874
|
+
dragenter,
|
|
2875
|
+
dragleave,
|
|
2876
|
+
dragend,
|
|
2877
|
+
drop
|
|
2878
|
+
};
|
|
2879
|
+
};
|
|
2880
|
+
const _hoisted_1$2 = { class: "fu-table-column-select-popper__body" };
|
|
2881
|
+
const _hoisted_2$1 = { class: "fu-table-column-select-popper__footer" };
|
|
2882
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2883
|
+
props: {
|
|
2884
|
+
icon: {
|
|
2885
|
+
type: String,
|
|
2886
|
+
default: "Setting"
|
|
2887
|
+
},
|
|
2888
|
+
trigger: {
|
|
2889
|
+
type: String,
|
|
2890
|
+
default: "click",
|
|
2891
|
+
validator: (value) => ["click", "hover"].includes(value)
|
|
2892
|
+
},
|
|
2893
|
+
columns: {
|
|
2894
|
+
type: Array,
|
|
2895
|
+
default: () => []
|
|
2896
|
+
}
|
|
2897
|
+
},
|
|
2898
|
+
setup(__props) {
|
|
2899
|
+
const props = __props;
|
|
2900
|
+
const { t } = useLocale();
|
|
2901
|
+
const localKey = inject("localKey");
|
|
2902
|
+
const {
|
|
2903
|
+
columnsKey,
|
|
2904
|
+
dragstart,
|
|
2905
|
+
dragenter,
|
|
2906
|
+
dragleave,
|
|
2907
|
+
dragend,
|
|
2908
|
+
drop
|
|
2909
|
+
} = tableColumnSelect(localKey);
|
|
2910
|
+
const isFixAll = computed(() => {
|
|
2911
|
+
var _a;
|
|
2912
|
+
return (_a = props.columns) == null ? void 0 : _a.every((c) => {
|
|
2913
|
+
return c.fix;
|
|
2914
|
+
});
|
|
2915
|
+
});
|
|
2916
|
+
const hasSelect = computed(() => {
|
|
2917
|
+
var _a;
|
|
2918
|
+
return ((_a = props.columns) == null ? void 0 : _a.length) > 0 && !isFixAll.value;
|
|
2919
|
+
});
|
|
2920
|
+
function reset() {
|
|
2921
|
+
if (columnsKey) {
|
|
2922
|
+
localStorage.removeItem(columnsKey.value);
|
|
2923
|
+
}
|
|
2924
|
+
props.columns.splice(0, props.columns.length);
|
|
2925
|
+
}
|
|
2926
|
+
return (_ctx, _cache) => {
|
|
2927
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
2928
|
+
const _component_el_button = resolveComponent("el-button");
|
|
2929
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
2930
|
+
return withDirectives((openBlock(), createBlock(_component_el_popover, {
|
|
2931
|
+
class: "fu-table-column-select",
|
|
2932
|
+
"popper-class": "fu-table-column-select-popper",
|
|
2933
|
+
trigger: __props.trigger,
|
|
2934
|
+
"show-arrow": false
|
|
2935
|
+
}, {
|
|
2936
|
+
reference: withCtx(() => [
|
|
2937
|
+
createVNode(_component_el_button, {
|
|
2938
|
+
class: "fu-search-bar-button",
|
|
2939
|
+
icon: __props.icon
|
|
2940
|
+
}, {
|
|
2941
|
+
default: withCtx(() => [
|
|
2942
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.custom_table_rows")), 1)
|
|
2943
|
+
]),
|
|
2944
|
+
_: 1
|
|
2945
|
+
}, 8, ["icon"])
|
|
2946
|
+
]),
|
|
2947
|
+
default: withCtx(() => [
|
|
2948
|
+
createElementVNode("h3", null, toDisplayString(unref(t)("fu.table.custom_table_fields")), 1),
|
|
2949
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
2950
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (c, i) => {
|
|
2951
|
+
return openBlock(), createElementBlock("div", {
|
|
2952
|
+
key: i,
|
|
2953
|
+
class: "fu-table-column-select-popper__item"
|
|
2954
|
+
}, [
|
|
2955
|
+
withDirectives(createVNode(_component_el_checkbox, {
|
|
2956
|
+
modelValue: c.show,
|
|
2957
|
+
"onUpdate:modelValue": ($event) => c.show = $event,
|
|
2958
|
+
checked: c.show !== false,
|
|
2959
|
+
draggable: "true",
|
|
2960
|
+
onDragstart: ($event) => unref(dragstart)($event, i),
|
|
2961
|
+
onDragenter: unref(dragenter),
|
|
2962
|
+
onDragleave: unref(dragleave),
|
|
2963
|
+
onDragover: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
2964
|
+
}, ["prevent"])),
|
|
2965
|
+
onDragend: unref(dragend),
|
|
2966
|
+
onDrop: ($event) => unref(drop)($event, __props.columns, i)
|
|
2967
|
+
}, {
|
|
2968
|
+
default: withCtx(() => [
|
|
2969
|
+
createTextVNode(toDisplayString(c.label), 1)
|
|
2970
|
+
]),
|
|
2971
|
+
_: 2
|
|
2972
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "checked", "onDragstart", "onDragenter", "onDragleave", "onDragend", "onDrop"]), [
|
|
2973
|
+
[vShow, !c.fix]
|
|
2974
|
+
])
|
|
2975
|
+
]);
|
|
2976
|
+
}), 128))
|
|
2977
|
+
]),
|
|
2978
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
2979
|
+
unref(columnsKey) ? (openBlock(), createBlock(_component_el_button, {
|
|
2980
|
+
key: 0,
|
|
2981
|
+
onClick: reset
|
|
2982
|
+
}, {
|
|
2983
|
+
default: withCtx(() => [
|
|
2984
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.reset")), 1)
|
|
2985
|
+
]),
|
|
2986
|
+
_: 1
|
|
2987
|
+
})) : createCommentVNode("v-if", true)
|
|
2988
|
+
])
|
|
2989
|
+
]),
|
|
2990
|
+
_: 1
|
|
2991
|
+
}, 8, ["trigger"])), [
|
|
2992
|
+
[vShow, unref(hasSelect)]
|
|
2993
|
+
]);
|
|
2994
|
+
};
|
|
2995
|
+
}
|
|
2996
|
+
});
|
|
2997
|
+
var FuTableColumnSelectPopover = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-column-select/FuTableColumnSelectPopover.vue"]]);
|
|
2998
|
+
const _hoisted_1$1 = { style: { "display": "inline-block" } };
|
|
2999
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
3000
|
+
props: {
|
|
3001
|
+
icon: {
|
|
3002
|
+
type: String,
|
|
3003
|
+
default: "Setting"
|
|
3004
|
+
},
|
|
3005
|
+
trigger: {
|
|
3006
|
+
type: String,
|
|
3007
|
+
default: "hover",
|
|
3008
|
+
validator: (value) => ["click", "hover"].includes(value)
|
|
3009
|
+
},
|
|
3010
|
+
columns: {
|
|
3011
|
+
type: Array,
|
|
3012
|
+
default: () => []
|
|
3013
|
+
}
|
|
3014
|
+
},
|
|
3015
|
+
setup(__props) {
|
|
3016
|
+
const props = __props;
|
|
3017
|
+
const localKey = inject("localKey");
|
|
3018
|
+
const { t } = useLocale();
|
|
3019
|
+
const cloneColumn = (source, target) => {
|
|
3020
|
+
source.forEach((col) => {
|
|
3021
|
+
target.push(Object.assign({}, col));
|
|
3022
|
+
});
|
|
3023
|
+
return target;
|
|
3024
|
+
};
|
|
3025
|
+
const {
|
|
3026
|
+
columnsKey,
|
|
3027
|
+
dragstart,
|
|
3028
|
+
dragenter,
|
|
3029
|
+
dragleave,
|
|
3030
|
+
dragend,
|
|
3031
|
+
drop
|
|
3032
|
+
} = tableColumnSelect(localKey);
|
|
3033
|
+
const cloneColumns = ref([]);
|
|
3034
|
+
const visible = ref(false);
|
|
3035
|
+
function open() {
|
|
3036
|
+
cloneColumns.value = [];
|
|
3037
|
+
cloneColumn(props.columns, cloneColumns.value);
|
|
3038
|
+
}
|
|
3039
|
+
function ok() {
|
|
3040
|
+
props.columns.splice(0, props.columns.length);
|
|
3041
|
+
cloneColumns.value.forEach((c) => {
|
|
3042
|
+
props.columns.push(c);
|
|
3043
|
+
});
|
|
3044
|
+
visible.value = false;
|
|
3045
|
+
}
|
|
3046
|
+
function reset() {
|
|
3047
|
+
if (columnsKey) {
|
|
3048
|
+
localStorage.removeItem(columnsKey.value);
|
|
3049
|
+
}
|
|
3050
|
+
props.columns.splice(0, props.columns.length);
|
|
3051
|
+
visible.value = false;
|
|
3052
|
+
}
|
|
3053
|
+
return (_ctx, _cache) => {
|
|
3054
|
+
const _component_el_button = resolveComponent("el-button");
|
|
3055
|
+
const _component_el_alert = resolveComponent("el-alert");
|
|
3056
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
3057
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
3058
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
3059
|
+
createCommentVNode(' :size="configSize" '),
|
|
3060
|
+
createVNode(_component_el_button, {
|
|
3061
|
+
class: "fu-search-bar-button",
|
|
3062
|
+
icon: __props.icon,
|
|
3063
|
+
onClick: _cache[0] || (_cache[0] = ($event) => visible.value = true)
|
|
3064
|
+
}, {
|
|
3065
|
+
default: withCtx(() => [
|
|
3066
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.custom_table_rows")), 1)
|
|
3067
|
+
]),
|
|
3068
|
+
_: 1
|
|
3069
|
+
}, 8, ["icon"]),
|
|
3070
|
+
createVNode(_component_el_dialog, {
|
|
3071
|
+
"custom-class": "fu-table-column-select-dialog",
|
|
3072
|
+
modelValue: visible.value,
|
|
3073
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => visible.value = $event),
|
|
3074
|
+
onOpen: open,
|
|
3075
|
+
"append-to-body": ""
|
|
3076
|
+
}, {
|
|
3077
|
+
title: withCtx(() => [
|
|
3078
|
+
createElementVNode("h3", null, toDisplayString(unref(t)("fu.table.custom_table_fields")), 1),
|
|
3079
|
+
createVNode(_component_el_alert, {
|
|
3080
|
+
title: unref(t)("fu.table.custom_table_fields_desc"),
|
|
3081
|
+
type: "info",
|
|
3082
|
+
closable: false
|
|
3083
|
+
}, null, 8, ["title"])
|
|
3084
|
+
]),
|
|
3085
|
+
footer: withCtx(() => [
|
|
3086
|
+
unref(columnsKey) ? (openBlock(), createBlock(_component_el_button, {
|
|
3087
|
+
key: 0,
|
|
3088
|
+
onClick: reset
|
|
3089
|
+
}, {
|
|
3090
|
+
default: withCtx(() => [
|
|
3091
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.reset")), 1)
|
|
3092
|
+
]),
|
|
3093
|
+
_: 1
|
|
3094
|
+
})) : createCommentVNode("v-if", true),
|
|
3095
|
+
createVNode(_component_el_button, {
|
|
3096
|
+
type: "primary",
|
|
3097
|
+
onClick: ok
|
|
3098
|
+
}, {
|
|
3099
|
+
default: withCtx(() => [
|
|
3100
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.ok")), 1)
|
|
3101
|
+
]),
|
|
3102
|
+
_: 1
|
|
3103
|
+
})
|
|
3104
|
+
]),
|
|
3105
|
+
default: withCtx(() => [
|
|
3106
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cloneColumns.value, (c, i) => {
|
|
3107
|
+
return withDirectives((openBlock(), createBlock(_component_el_checkbox, {
|
|
3108
|
+
key: i,
|
|
3109
|
+
modelValue: c.show,
|
|
3110
|
+
"onUpdate:modelValue": ($event) => c.show = $event,
|
|
3111
|
+
checked: c.show !== false,
|
|
3112
|
+
draggable: "true",
|
|
3113
|
+
onDragstart: ($event) => unref(dragstart)($event, i),
|
|
3114
|
+
onDragenter: unref(dragenter),
|
|
3115
|
+
onDragleave: unref(dragleave),
|
|
3116
|
+
onDragover: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
3117
|
+
}, ["prevent"])),
|
|
3118
|
+
onDragend: unref(dragend),
|
|
3119
|
+
onDrop: ($event) => unref(drop)($event, cloneColumns.value, i)
|
|
3120
|
+
}, {
|
|
3121
|
+
default: withCtx(() => [
|
|
3122
|
+
createTextVNode(toDisplayString(c.label), 1)
|
|
3123
|
+
]),
|
|
3124
|
+
_: 2
|
|
3125
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "checked", "onDragstart", "onDragenter", "onDragleave", "onDragend", "onDrop"])), [
|
|
3126
|
+
[vShow, !c.fix]
|
|
3127
|
+
]);
|
|
3128
|
+
}), 128))
|
|
3129
|
+
]),
|
|
3130
|
+
_: 1
|
|
3131
|
+
}, 8, ["modelValue"])
|
|
3132
|
+
]);
|
|
3133
|
+
};
|
|
3134
|
+
}
|
|
3135
|
+
});
|
|
3136
|
+
var FuTableColumnSelectDialog = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-column-select/FuTableColumnSelectDialog.vue"]]);
|
|
3137
|
+
const _sfc_main$6 = defineComponent({
|
|
3138
|
+
name: "FuTableColumnSelect",
|
|
3139
|
+
props: ["type"],
|
|
3140
|
+
setup(props, context) {
|
|
3141
|
+
const { type } = props;
|
|
3142
|
+
return () => {
|
|
3143
|
+
if (type === "dialog") {
|
|
3144
|
+
return h(FuTableColumnSelectDialog, context.attrs, context.slots);
|
|
3145
|
+
} else {
|
|
3146
|
+
return h(FuTableColumnSelectPopover, context.attrs, context.slots);
|
|
3147
|
+
}
|
|
3148
|
+
};
|
|
3149
|
+
}
|
|
3150
|
+
});
|
|
3151
|
+
var FuTableColumnSelect = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-column-select/FuTableColumnSelect.vue"]]);
|
|
3152
|
+
FuTableColumnSelect.install = (app) => {
|
|
3153
|
+
app.component(FuTableColumnSelect.name, FuTableColumnSelect);
|
|
3154
|
+
};
|
|
3155
|
+
const __default__$3 = { name: "FuTablePagination" };
|
|
3156
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
|
|
3157
|
+
props: {
|
|
3158
|
+
currentPage: {
|
|
3159
|
+
type: Number,
|
|
3160
|
+
default: 1
|
|
3161
|
+
},
|
|
3162
|
+
pageSize: {
|
|
3163
|
+
type: Number,
|
|
3164
|
+
default: 5
|
|
3165
|
+
},
|
|
3166
|
+
pageSizes: {
|
|
3167
|
+
type: Array,
|
|
3168
|
+
default: function() {
|
|
3169
|
+
return [5, 10, 20, 50, 100];
|
|
3170
|
+
}
|
|
3171
|
+
},
|
|
3172
|
+
total: {
|
|
3173
|
+
type: Number,
|
|
3174
|
+
default: 0
|
|
3175
|
+
}
|
|
3176
|
+
},
|
|
3177
|
+
emits: ["size-change", "current-change", "change", "update:pageSize", "update:currentPage"],
|
|
3178
|
+
setup(__props, { emit }) {
|
|
3179
|
+
function handleSizeChange(size) {
|
|
3180
|
+
emit("update:pageSize", size);
|
|
3181
|
+
emit("size-change");
|
|
3182
|
+
emit("change");
|
|
3183
|
+
}
|
|
3184
|
+
function handleCurrentChange(current) {
|
|
3185
|
+
emit("update:currentPage", current);
|
|
3186
|
+
emit("current-change");
|
|
3187
|
+
emit("change");
|
|
3188
|
+
}
|
|
3189
|
+
return (_ctx, _cache) => {
|
|
3190
|
+
const _component_el_pagination = resolveComponent("el-pagination");
|
|
3191
|
+
return openBlock(), createBlock(_component_el_pagination, {
|
|
3192
|
+
onSizeChange: handleSizeChange,
|
|
3193
|
+
onCurrentChange: handleCurrentChange,
|
|
3194
|
+
"current-page": __props.currentPage,
|
|
3195
|
+
"page-sizes": __props.pageSizes,
|
|
3196
|
+
"page-size": __props.pageSize,
|
|
3197
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
3198
|
+
total: __props.total
|
|
3199
|
+
}, null, 8, ["current-page", "page-sizes", "page-size", "total"]);
|
|
3200
|
+
};
|
|
3201
|
+
}
|
|
3202
|
+
}));
|
|
3203
|
+
var FuTablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/FuTablePagination.vue"]]);
|
|
3204
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
3205
|
+
props: {
|
|
3206
|
+
size: {
|
|
3207
|
+
type: String,
|
|
3208
|
+
default: "default"
|
|
3209
|
+
},
|
|
3210
|
+
label: String,
|
|
3211
|
+
disabled: Boolean,
|
|
3212
|
+
icon: Boolean
|
|
3213
|
+
},
|
|
3214
|
+
setup(__props) {
|
|
3215
|
+
return (_ctx, _cache) => {
|
|
3216
|
+
const _component_el_button = resolveComponent("el-button");
|
|
3217
|
+
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
3218
|
+
return openBlock(), createBlock(_component_el_tooltip, {
|
|
3219
|
+
content: __props.label,
|
|
3220
|
+
disabled: !__props.icon
|
|
3221
|
+
}, {
|
|
3222
|
+
default: withCtx(() => [
|
|
3223
|
+
createVNode(_component_el_button, mergeProps({ link: "" }, _ctx.$attrs, { disabled: __props.disabled }), {
|
|
3224
|
+
default: withCtx(() => [
|
|
3225
|
+
renderSlot(_ctx.$slots, "default")
|
|
3226
|
+
]),
|
|
3227
|
+
_: 3
|
|
3228
|
+
}, 16, ["disabled"])
|
|
3229
|
+
]),
|
|
3230
|
+
_: 3
|
|
3231
|
+
}, 8, ["content", "disabled"]);
|
|
3232
|
+
};
|
|
3233
|
+
}
|
|
3234
|
+
});
|
|
3235
|
+
var FuTableButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-operations/FuTableButton.vue"]]);
|
|
3236
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3237
|
+
props: {
|
|
3238
|
+
row: Object,
|
|
3239
|
+
buttons: {
|
|
3240
|
+
type: Array,
|
|
3241
|
+
required: true
|
|
3242
|
+
},
|
|
3243
|
+
size: {
|
|
3244
|
+
type: String,
|
|
3245
|
+
default: "default"
|
|
3246
|
+
},
|
|
3247
|
+
type: {
|
|
3248
|
+
type: String,
|
|
3249
|
+
default: "label",
|
|
3250
|
+
validator: (value) => ["icon", "label"].includes(value)
|
|
3251
|
+
}
|
|
3252
|
+
},
|
|
3253
|
+
setup(__props) {
|
|
3254
|
+
const props = __props;
|
|
3255
|
+
const { t } = useLocale();
|
|
3256
|
+
const disabled = computed(() => {
|
|
3257
|
+
return function(btn) {
|
|
3258
|
+
return typeof btn.disabled === "function" ? btn.disabled(props.row) : btn.disabled;
|
|
3259
|
+
};
|
|
3260
|
+
});
|
|
3261
|
+
function handleCommand(btn) {
|
|
3262
|
+
btn.click(props.row);
|
|
3263
|
+
}
|
|
3264
|
+
return (_ctx, _cache) => {
|
|
3265
|
+
const _component_MoreFilled = resolveComponent("MoreFilled");
|
|
3266
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
3267
|
+
const _component_el_button = resolveComponent("el-button");
|
|
3268
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
3269
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
3270
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
3271
|
+
return openBlock(), createBlock(_component_el_dropdown, {
|
|
3272
|
+
onCommand: handleCommand,
|
|
3273
|
+
class: "fu-table-more-button"
|
|
3274
|
+
}, {
|
|
3275
|
+
dropdown: withCtx(() => [
|
|
3276
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
3277
|
+
default: withCtx(() => [
|
|
3278
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.buttons, (btn, i) => {
|
|
3279
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
3280
|
+
key: i,
|
|
3281
|
+
icon: __props.type === "icon" && btn.icon,
|
|
3282
|
+
disabled: unref(disabled)(btn),
|
|
3283
|
+
command: btn
|
|
3284
|
+
}, {
|
|
3285
|
+
default: withCtx(() => [
|
|
3286
|
+
createTextVNode(toDisplayString(btn.label), 1)
|
|
3287
|
+
]),
|
|
3288
|
+
_: 2
|
|
3289
|
+
}, 1032, ["icon", "disabled", "command"]);
|
|
3290
|
+
}), 128))
|
|
3291
|
+
]),
|
|
3292
|
+
_: 1
|
|
3293
|
+
})
|
|
3294
|
+
]),
|
|
3295
|
+
default: withCtx(() => [
|
|
3296
|
+
createVNode(_component_el_button, {
|
|
3297
|
+
link: "",
|
|
3298
|
+
type: "primary",
|
|
3299
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
3300
|
+
}, ["stop"]))
|
|
3301
|
+
}, {
|
|
3302
|
+
default: withCtx(() => [
|
|
3303
|
+
__props.type === "icon" ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
3304
|
+
default: withCtx(() => [
|
|
3305
|
+
createVNode(_component_MoreFilled)
|
|
3306
|
+
]),
|
|
3307
|
+
_: 1
|
|
3308
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3309
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.more")), 1)
|
|
3310
|
+
], 2112))
|
|
3311
|
+
]),
|
|
3312
|
+
_: 1
|
|
3313
|
+
})
|
|
3314
|
+
]),
|
|
3315
|
+
_: 1
|
|
3316
|
+
});
|
|
3317
|
+
};
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
var FuTableMoreButton = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-operations/FuTableMoreButton.vue"]]);
|
|
3321
|
+
const __default__$2 = { name: "FuTableOperations" };
|
|
3322
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
3323
|
+
props: {
|
|
3324
|
+
align: {
|
|
3325
|
+
type: String,
|
|
3326
|
+
default: "center"
|
|
3327
|
+
},
|
|
3328
|
+
width: [String, Number],
|
|
3329
|
+
minWidth: [String, Number],
|
|
3330
|
+
ellipsis: {
|
|
3331
|
+
type: Number,
|
|
3332
|
+
default: 3
|
|
3333
|
+
},
|
|
3334
|
+
buttons: {
|
|
3335
|
+
type: Array,
|
|
3336
|
+
required: true
|
|
3337
|
+
},
|
|
3338
|
+
type: {
|
|
3339
|
+
type: String,
|
|
3340
|
+
default: "label",
|
|
3341
|
+
validator: (value) => ["icon", "label"].includes(value)
|
|
3342
|
+
}
|
|
3343
|
+
},
|
|
3344
|
+
setup(__props) {
|
|
3345
|
+
const props = __props;
|
|
3346
|
+
const hasShowFunc = computed(() => {
|
|
3347
|
+
return props.buttons.some((btn) => typeof btn.show === "function");
|
|
3348
|
+
});
|
|
3349
|
+
const defaultButtons = computed(() => {
|
|
3350
|
+
return function(row) {
|
|
3351
|
+
return hasMore(row) ? showButtons(row).slice(0, props.ellipsis) : showButtons(row);
|
|
3352
|
+
};
|
|
3353
|
+
});
|
|
3354
|
+
const moreButtons = computed(() => {
|
|
3355
|
+
return function(row) {
|
|
3356
|
+
return hasMore(row) ? showButtons(row).slice(props.ellipsis) : [];
|
|
3357
|
+
};
|
|
3358
|
+
});
|
|
3359
|
+
const computeWidth = computed(() => {
|
|
3360
|
+
let length = hasShowFunc.value ? props.ellipsis : defaultButtons.value.length;
|
|
3361
|
+
let buttonsWidth = 35 + length * 58 + 58;
|
|
3362
|
+
if (props.minWidth) {
|
|
3363
|
+
buttonsWidth = buttonsWidth < props.minWidth ? props.minWidth : buttonsWidth;
|
|
3364
|
+
}
|
|
3365
|
+
return props.width ? props.width : buttonsWidth;
|
|
3366
|
+
});
|
|
3367
|
+
const disableButton = computed(() => {
|
|
3368
|
+
return function(btn, row) {
|
|
3369
|
+
return typeof btn.disabled === "function" ? btn.disabled(row) : btn.disabled;
|
|
3370
|
+
};
|
|
3371
|
+
});
|
|
3372
|
+
function showButtons(row) {
|
|
3373
|
+
var _a;
|
|
3374
|
+
return (_a = props.buttons) == null ? void 0 : _a.filter((btn) => typeof btn.show === "function" ? btn.show(row) !== false : btn.show !== false);
|
|
3375
|
+
}
|
|
3376
|
+
function hasMore(row) {
|
|
3377
|
+
var _a;
|
|
3378
|
+
return ((_a = showButtons(row)) == null ? void 0 : _a.length) > props.ellipsis + 1;
|
|
3379
|
+
}
|
|
3380
|
+
return (_ctx, _cache) => {
|
|
3381
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
3382
|
+
const _component_el_table_column = resolveComponent("el-table-column");
|
|
3383
|
+
return openBlock(), createBlock(_component_el_table_column, mergeProps({
|
|
3384
|
+
"class-name": "fu-table-operations",
|
|
3385
|
+
align: __props.align,
|
|
3386
|
+
width: unref(computeWidth)
|
|
3387
|
+
}, _ctx.$attrs), {
|
|
3388
|
+
header: withCtx(() => [
|
|
3389
|
+
createTextVNode(toDisplayString(_ctx.$attrs.label), 1)
|
|
3390
|
+
]),
|
|
3391
|
+
default: withCtx(({ row }) => [
|
|
3392
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(defaultButtons)(row), (btn, i) => {
|
|
3393
|
+
return openBlock(), createBlock(FuTableButton, {
|
|
3394
|
+
icon: __props.type === "icon",
|
|
3395
|
+
key: i,
|
|
3396
|
+
onClick: withModifiers(($event) => btn.click(row), ["stop"]),
|
|
3397
|
+
disabled: unref(disableButton)(btn, row),
|
|
3398
|
+
label: btn.label,
|
|
3399
|
+
type: btn.type || "primary",
|
|
3400
|
+
link: ""
|
|
3401
|
+
}, {
|
|
3402
|
+
default: withCtx(() => [
|
|
3403
|
+
__props.type === "icon" ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
3404
|
+
default: withCtx(() => [
|
|
3405
|
+
(openBlock(), createBlock(resolveDynamicComponent(btn.icon)))
|
|
3406
|
+
]),
|
|
3407
|
+
_: 2
|
|
3408
|
+
}, 1024)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3409
|
+
createTextVNode(toDisplayString(btn.label), 1)
|
|
3410
|
+
], 2112))
|
|
3411
|
+
]),
|
|
3412
|
+
_: 2
|
|
3413
|
+
}, 1032, ["icon", "onClick", "disabled", "label", "type"]);
|
|
3414
|
+
}), 128)),
|
|
3415
|
+
unref(moreButtons)(row).length > 0 ? (openBlock(), createBlock(FuTableMoreButton, {
|
|
3416
|
+
key: 0,
|
|
3417
|
+
type: __props.type,
|
|
3418
|
+
buttons: unref(moreButtons)(row),
|
|
3419
|
+
row
|
|
3420
|
+
}, null, 8, ["type", "buttons", "row"])) : createCommentVNode("v-if", true)
|
|
3421
|
+
]),
|
|
3422
|
+
_: 1
|
|
3423
|
+
}, 16, ["align", "width"]);
|
|
3424
|
+
};
|
|
3425
|
+
}
|
|
3426
|
+
}));
|
|
3427
|
+
var FuTableOperations = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-operations/FuTableOperations.vue"]]);
|
|
3428
|
+
FuTableOperations.install = (app) => {
|
|
3429
|
+
app.component(FuTableOperations.name, FuTableOperations);
|
|
3430
|
+
app.component(FuTableButton.name, FuTableButton);
|
|
3431
|
+
app.component(FuTableMoreButton.name, FuTableMoreButton);
|
|
3432
|
+
};
|
|
3433
|
+
const _hoisted_1 = { class: "fu-dropdown-link" };
|
|
3434
|
+
const _hoisted_2 = {
|
|
3435
|
+
key: 0,
|
|
3436
|
+
class: "fu-table-column-dropdown__title"
|
|
3437
|
+
};
|
|
3438
|
+
const __default__$1 = { name: "FuTableColumnDropdown" };
|
|
3439
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
3440
|
+
props: {
|
|
3441
|
+
showType: {
|
|
3442
|
+
type: String,
|
|
3443
|
+
default: "always",
|
|
3444
|
+
validator: (value) => ["always", "hover", "selected"].includes(value)
|
|
3445
|
+
},
|
|
3446
|
+
menus: {
|
|
3447
|
+
type: Array,
|
|
3448
|
+
default: () => []
|
|
3449
|
+
},
|
|
3450
|
+
title: String,
|
|
3451
|
+
trigger: {
|
|
3452
|
+
type: String,
|
|
3453
|
+
default: "click"
|
|
3454
|
+
},
|
|
3455
|
+
width: {
|
|
3456
|
+
type: String,
|
|
3457
|
+
default: "40"
|
|
3458
|
+
}
|
|
3459
|
+
},
|
|
3460
|
+
setup(__props, { expose }) {
|
|
3461
|
+
const props = __props;
|
|
3462
|
+
const instance = getCurrentInstance();
|
|
3463
|
+
const isShow = computed(() => {
|
|
3464
|
+
return function(row) {
|
|
3465
|
+
var _a, _b, _c;
|
|
3466
|
+
if (props.showType === "selected") {
|
|
3467
|
+
const selection = (_c = (_b = (_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.store) == null ? void 0 : _c.getSelectionRows();
|
|
3468
|
+
return selection.includes(row) && true;
|
|
3469
|
+
} else {
|
|
3470
|
+
return true;
|
|
3471
|
+
}
|
|
3472
|
+
};
|
|
3473
|
+
});
|
|
3474
|
+
const disabled = computed(() => {
|
|
3475
|
+
return function(item, row) {
|
|
3476
|
+
return typeof item.disabled === "function" ? item.disabled(row) : item.disabled;
|
|
3477
|
+
};
|
|
3478
|
+
});
|
|
3479
|
+
function handleCommand({ item, row }) {
|
|
3480
|
+
item.click(row);
|
|
3481
|
+
}
|
|
3482
|
+
function composeValue(item, row) {
|
|
3483
|
+
return {
|
|
3484
|
+
item,
|
|
3485
|
+
row
|
|
3486
|
+
};
|
|
3487
|
+
}
|
|
3488
|
+
function show(index2) {
|
|
3489
|
+
instance.refs[`dropdown${index2}`].handleOpen();
|
|
3490
|
+
}
|
|
3491
|
+
function hide(index2) {
|
|
3492
|
+
instance.refs[`dropdown${index2}`].handleClose();
|
|
3493
|
+
}
|
|
3494
|
+
expose({
|
|
3495
|
+
show,
|
|
3496
|
+
hide
|
|
3497
|
+
});
|
|
3498
|
+
return (_ctx, _cache) => {
|
|
3499
|
+
const _component_MoreFilled = resolveComponent("MoreFilled");
|
|
3500
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
3501
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
3502
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
3503
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
3504
|
+
const _component_el_table_column = resolveComponent("el-table-column");
|
|
3505
|
+
return openBlock(), createBlock(_component_el_table_column, mergeProps({
|
|
3506
|
+
"class-name": "fu-table-column-dropdown",
|
|
3507
|
+
width: __props.width,
|
|
3508
|
+
resizable: false,
|
|
3509
|
+
align: "center"
|
|
3510
|
+
}, _ctx.$attrs), {
|
|
3511
|
+
default: withCtx((scope) => [
|
|
3512
|
+
unref(isShow)(scope.row) ? (openBlock(), createBlock(_component_el_dropdown, {
|
|
3513
|
+
key: 0,
|
|
3514
|
+
onCommand: handleCommand,
|
|
3515
|
+
trigger: __props.trigger,
|
|
3516
|
+
class: normalizeClass(__props.showType === "hover" ? "fu-show-icon" : ""),
|
|
3517
|
+
placement: "bottom",
|
|
3518
|
+
ref: `dropdown${scope.$index}`
|
|
3519
|
+
}, {
|
|
3520
|
+
dropdown: withCtx(() => [
|
|
3521
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
3522
|
+
default: withCtx(() => [
|
|
3523
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
3524
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.title), 1)) : createCommentVNode("v-if", true)
|
|
3525
|
+
]),
|
|
3526
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)), () => [
|
|
3527
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.menus, (item, i) => {
|
|
3528
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
3529
|
+
key: i,
|
|
3530
|
+
icon: item.icon,
|
|
3531
|
+
disabled: unref(disabled)(item, scope.row),
|
|
3532
|
+
divided: item.divided,
|
|
3533
|
+
command: composeValue(item, scope.row)
|
|
3534
|
+
}, {
|
|
3535
|
+
default: withCtx(() => [
|
|
3536
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
3537
|
+
]),
|
|
3538
|
+
_: 2
|
|
3539
|
+
}, 1032, ["icon", "disabled", "divided", "command"]);
|
|
3540
|
+
}), 128))
|
|
3541
|
+
])
|
|
3542
|
+
]),
|
|
3543
|
+
_: 2
|
|
3544
|
+
}, 1024)
|
|
3545
|
+
]),
|
|
3546
|
+
default: withCtx(() => [
|
|
3547
|
+
createElementVNode("span", _hoisted_1, [
|
|
3548
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
3549
|
+
createVNode(_component_el_icon, { class: "fu-icon-more" }, {
|
|
3550
|
+
default: withCtx(() => [
|
|
3551
|
+
createVNode(_component_MoreFilled)
|
|
3552
|
+
]),
|
|
3553
|
+
_: 1
|
|
3554
|
+
})
|
|
3555
|
+
])
|
|
3556
|
+
])
|
|
3557
|
+
]),
|
|
3558
|
+
_: 2
|
|
3559
|
+
}, 1032, ["trigger", "class"])) : createCommentVNode("v-if", true)
|
|
3560
|
+
]),
|
|
3561
|
+
_: 3
|
|
3562
|
+
}, 16, ["width"]);
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
}));
|
|
3566
|
+
var FuTableColumnDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/table/table-column-dropdown/FuTableColumnDropdown.vue"]]);
|
|
3567
|
+
FuTableColumnDropdown.install = (app) => {
|
|
3568
|
+
app.component(FuTableColumnDropdown.name, FuTableColumnDropdown);
|
|
3569
|
+
};
|
|
3570
|
+
FuTable.install = (app) => {
|
|
3571
|
+
app.component(FuTable.name, FuTable);
|
|
3572
|
+
app.component(FuTablePagination.name, FuTablePagination);
|
|
3573
|
+
app.use(FuTableOperations.install);
|
|
3574
|
+
app.use(FuTableColumnSelect.install);
|
|
3575
|
+
app.use(FuTableColumnDropdown.install);
|
|
3576
|
+
};
|
|
3577
|
+
var __glob_1_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3578
|
+
__proto__: null,
|
|
3579
|
+
"default": FuTable
|
|
3580
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3581
|
+
const __default__ = { name: "FuTabs" };
|
|
3582
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
3583
|
+
props: {
|
|
3584
|
+
addType: {
|
|
3585
|
+
type: String,
|
|
3586
|
+
default: "default",
|
|
3587
|
+
validator: (val) => ["default", "dropdown"].includes(val)
|
|
3588
|
+
},
|
|
3589
|
+
dropdownMenus: {
|
|
3590
|
+
type: Array,
|
|
3591
|
+
default: () => []
|
|
3592
|
+
},
|
|
3593
|
+
addTrigger: {
|
|
3594
|
+
type: String,
|
|
3595
|
+
default: "hover",
|
|
3596
|
+
validator: (val) => ["hover", "click"].includes(val)
|
|
3597
|
+
},
|
|
3598
|
+
addIcon: {
|
|
3599
|
+
type: String,
|
|
3600
|
+
default: "Plus"
|
|
3601
|
+
},
|
|
3602
|
+
addButtonLabel: String,
|
|
3603
|
+
addable: Boolean
|
|
3604
|
+
},
|
|
3605
|
+
emits: ["command"],
|
|
3606
|
+
setup(__props, { emit }) {
|
|
3607
|
+
const props = __props;
|
|
3608
|
+
function handleCommand(e) {
|
|
3609
|
+
const name2 = uuid();
|
|
3610
|
+
let obj = null;
|
|
3611
|
+
if (e) {
|
|
3612
|
+
obj = props.dropdownMenus.find((item) => item.command === e);
|
|
3613
|
+
}
|
|
3614
|
+
emit("command", name2, obj);
|
|
3615
|
+
}
|
|
3616
|
+
function beforeLeave(currentName, oldName) {
|
|
3617
|
+
if (currentName === "add") {
|
|
3618
|
+
return false;
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
return (_ctx, _cache) => {
|
|
3622
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
3623
|
+
const _component_el_button = resolveComponent("el-button");
|
|
3624
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
3625
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
3626
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
3627
|
+
const _component_el_tab_pane = resolveComponent("el-tab-pane");
|
|
3628
|
+
const _component_el_tabs = resolveComponent("el-tabs");
|
|
3629
|
+
return openBlock(), createBlock(_component_el_tabs, mergeProps({
|
|
3630
|
+
class: "fu-tabs",
|
|
3631
|
+
"before-leave": beforeLeave,
|
|
3632
|
+
editable: false,
|
|
3633
|
+
addable: false
|
|
3634
|
+
}, _ctx.$attrs), {
|
|
3635
|
+
default: withCtx(() => [
|
|
3636
|
+
renderSlot(_ctx.$slots, "default"),
|
|
3637
|
+
__props.addable ? (openBlock(), createBlock(_component_el_tab_pane, {
|
|
3638
|
+
name: "add",
|
|
3639
|
+
key: "add"
|
|
3640
|
+
}, {
|
|
3641
|
+
label: withCtx(() => [
|
|
3642
|
+
renderSlot(_ctx.$slots, "add", {}, () => [
|
|
3643
|
+
createCommentVNode(" \u4E0B\u62C9\u65B9\u5F0F "),
|
|
3644
|
+
__props.addType === "dropdown" ? (openBlock(), createBlock(_component_el_dropdown, {
|
|
3645
|
+
key: 0,
|
|
3646
|
+
onCommand: handleCommand,
|
|
3647
|
+
trigger: __props.addTrigger
|
|
3648
|
+
}, {
|
|
3649
|
+
dropdown: withCtx(() => [
|
|
3650
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
3651
|
+
default: withCtx(() => [
|
|
3652
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dropdownMenus, (item, i) => {
|
|
3653
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
3654
|
+
key: i,
|
|
3655
|
+
icon: item.icon,
|
|
3656
|
+
disabled: item.disabled,
|
|
3657
|
+
divided: item.divided,
|
|
3658
|
+
command: item.command
|
|
3659
|
+
}, {
|
|
3660
|
+
default: withCtx(() => [
|
|
3661
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
3662
|
+
]),
|
|
3663
|
+
_: 2
|
|
3664
|
+
}, 1032, ["icon", "disabled", "divided", "command"]);
|
|
3665
|
+
}), 128))
|
|
3666
|
+
]),
|
|
3667
|
+
_: 1
|
|
3668
|
+
})
|
|
3669
|
+
]),
|
|
3670
|
+
default: withCtx(() => [
|
|
3671
|
+
renderSlot(_ctx.$slots, "dropdownButton", {}, () => [
|
|
3672
|
+
createVNode(_component_el_button, {
|
|
3673
|
+
type: "primary",
|
|
3674
|
+
plain: ""
|
|
3675
|
+
}, {
|
|
3676
|
+
default: withCtx(() => [
|
|
3677
|
+
createVNode(_component_el_icon, null, {
|
|
3678
|
+
default: withCtx(() => [
|
|
3679
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.addIcon)))
|
|
3680
|
+
]),
|
|
3681
|
+
_: 1
|
|
3682
|
+
}),
|
|
3683
|
+
__props.addButtonLabel ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3684
|
+
createTextVNode(toDisplayString(__props.addButtonLabel), 1)
|
|
3685
|
+
], 2112)) : createCommentVNode("v-if", true)
|
|
3686
|
+
]),
|
|
3687
|
+
_: 1
|
|
3688
|
+
})
|
|
3689
|
+
])
|
|
3690
|
+
]),
|
|
3691
|
+
_: 3
|
|
3692
|
+
}, 8, ["trigger"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3693
|
+
createCommentVNode(" \u9ED8\u8BA4 "),
|
|
3694
|
+
createVNode(_component_el_button, {
|
|
3695
|
+
onClick: handleCommand,
|
|
3696
|
+
type: "primary",
|
|
3697
|
+
plain: ""
|
|
3698
|
+
}, {
|
|
3699
|
+
default: withCtx(() => [
|
|
3700
|
+
createVNode(_component_el_icon, null, {
|
|
3701
|
+
default: withCtx(() => [
|
|
3702
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.addIcon)))
|
|
3703
|
+
]),
|
|
3704
|
+
_: 1
|
|
3705
|
+
}),
|
|
3706
|
+
__props.addButtonLabel ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3707
|
+
createTextVNode(toDisplayString(__props.addButtonLabel), 1)
|
|
3708
|
+
], 2112)) : createCommentVNode("v-if", true)
|
|
3709
|
+
]),
|
|
3710
|
+
_: 1
|
|
3711
|
+
})
|
|
3712
|
+
], 2112))
|
|
3713
|
+
])
|
|
3714
|
+
]),
|
|
3715
|
+
_: 3
|
|
3716
|
+
})) : createCommentVNode("v-if", true)
|
|
3717
|
+
]),
|
|
3718
|
+
_: 3
|
|
3719
|
+
}, 16);
|
|
3720
|
+
};
|
|
3721
|
+
}
|
|
3722
|
+
}));
|
|
3723
|
+
var FuTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/q4speed/fit2cloud2.0/fit2cloud-ui-plus/src/components/tabs/FuTabs.vue"]]);
|
|
3724
|
+
FuTabs.install = (app) => {
|
|
3725
|
+
app.component(FuTabs.name, FuTabs);
|
|
3726
|
+
};
|
|
3727
|
+
var __glob_1_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3728
|
+
__proto__: null,
|
|
3729
|
+
"default": FuTabs
|
|
3730
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3731
|
+
const name = "fit2cloud-ui-plus";
|
|
3732
|
+
const version = "1.0.0-beta.0";
|
|
3733
|
+
const main = "lib/fit2cloud-ui-plus.common.js";
|
|
3734
|
+
const style = "lib/fit2cloud-ui-plus.css";
|
|
3735
|
+
const files = [
|
|
3736
|
+
"lib",
|
|
3737
|
+
"src"
|
|
3738
|
+
];
|
|
3739
|
+
const author = "fit2cloud";
|
|
3740
|
+
const license = "GPL-3.0 License";
|
|
3741
|
+
const repository = {
|
|
3742
|
+
type: "git",
|
|
3743
|
+
url: "git+https://github.com/fit2cloud-ui/fit2cloud-ui-plus.git"
|
|
3744
|
+
};
|
|
3745
|
+
const scripts = {
|
|
3746
|
+
dev: "vite",
|
|
3747
|
+
build: "vite build",
|
|
3748
|
+
"build-lib": "vite build --mode lib",
|
|
3749
|
+
preview: "vite preview"
|
|
3750
|
+
};
|
|
3751
|
+
const dependencies = {
|
|
3752
|
+
"@element-plus/icons-vue": "^1.1.4",
|
|
3753
|
+
"element-plus": "^2.2.2",
|
|
3754
|
+
"github-markdown-css": "^5.1.0",
|
|
3755
|
+
prismjs: "^1.28.0",
|
|
3756
|
+
"vite-plugin-markdown": "^2.0.2",
|
|
3757
|
+
vue: "^3.2.25",
|
|
3758
|
+
"vue-router": "^4.0.14"
|
|
3759
|
+
};
|
|
3760
|
+
const devDependencies = {
|
|
3761
|
+
"@types/node": "^17.0.29",
|
|
3762
|
+
"@vitejs/plugin-vue": "^2.3.1",
|
|
3763
|
+
sass: "^1.51.0",
|
|
3764
|
+
"sass-loader": "^12.6.0",
|
|
3765
|
+
typescript: "^4.5.4",
|
|
3766
|
+
"unplugin-vue-define-options": "^0.6.1",
|
|
3767
|
+
vite: "^2.9.5",
|
|
3768
|
+
"vue-tsc": "^0.34.7"
|
|
3769
|
+
};
|
|
3770
|
+
var PackageJSON = {
|
|
3771
|
+
name,
|
|
3772
|
+
version,
|
|
3773
|
+
"private": false,
|
|
3774
|
+
main,
|
|
3775
|
+
style,
|
|
3776
|
+
files,
|
|
3777
|
+
author,
|
|
3778
|
+
license,
|
|
3779
|
+
repository,
|
|
3780
|
+
scripts,
|
|
3781
|
+
dependencies,
|
|
3782
|
+
devDependencies
|
|
3783
|
+
};
|
|
3784
|
+
const components = { "./components/filter-bar/index.ts": __glob_1_0, "./components/read-write-switch/index.ts": __glob_1_1, "./components/search-bar/index.ts": __glob_1_2, "./components/speed-dial/index.ts": __glob_1_3, "./components/split-pane/index.ts": __glob_1_4, "./components/steps/index.ts": __glob_1_5, "./components/table/index.ts": __glob_1_6, "./components/tabs/index.ts": __glob_1_7 };
|
|
3785
|
+
const install = (app) => {
|
|
3786
|
+
Object.keys(components).forEach((key) => {
|
|
3787
|
+
let component = components[key].default;
|
|
3788
|
+
app.use(component);
|
|
3789
|
+
});
|
|
3790
|
+
};
|
|
3791
|
+
const plugin = {
|
|
3792
|
+
name: "Fit2CloudUIPlus",
|
|
3793
|
+
version: PackageJSON.version,
|
|
3794
|
+
install
|
|
3795
|
+
};
|
|
3796
|
+
export { plugin as default };
|