fit2cloud-ui-plus 0.0.1-beta.6 → 0.0.1-beta.9
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/lib/favicon.bmp +0 -0
- package/lib/fit2cloud-ui-plus.es.js +2892 -0
- package/lib/fit2cloud-ui-plus.umd.js +1 -0
- package/package.json +4 -2
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/filter-bar/FuFilter.vue +18 -13
- package/src/components/filter-bar/FuFilterBar.vue +14 -11
- package/src/components/filter-bar/FuSearchInput.vue +8 -2
- package/src/components/filter-bar/filter-components/FuFilterDate.vue +17 -13
- package/src/components/filter-bar/filter-components/FuFilterDateTime.vue +16 -13
- package/src/components/filter-bar/filter-components/FuFilterSelect.vue +17 -12
- package/src/components/filter-bar/index.ts +11 -12
- package/src/components/split-pane/FuSplitPane.vue +2 -2
- package/src/components/table/FuTable.vue +16 -25
- package/src/components/table/FuTableBody.ts +17 -19
- package/src/components/table/{table-column-dropdown/FuTableColumnDropdown.vue → FuTableColumnDropdown.vue} +0 -0
- package/src/components/table/index.ts +11 -7
- package/src/components/table/table-column-select/FuTableColumnSelectDialog.vue +3 -9
- package/src/components/table/table-column-select/FuTableColumnSelectPopover.vue +27 -24
- package/src/components/table/table-operations/FuTableButton.vue +1 -4
- package/src/components/table/table-operations/FuTableMoreButton.vue +1 -1
- package/src/components/table/table-operations/FuTableOperations.vue +1 -2
- package/src/components/table/types.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-global-config/index.ts +0 -15
- package/src/hooks/use-size/index.ts +29 -0
- package/src/styles/common/variables.scss +3 -1
- package/src/styles/components/filter-bar.scss +3 -3
- package/src/styles/components/split-pane.scss +1 -1
- package/src/styles/components/steps.scss +2 -2
- package/src/styles/components/table.scss +3 -5
- package/src/styles/index.scss +0 -1
- package/src/tools/size.ts +6 -0
- package/src/tools/theme.ts +0 -12
- package/src/tools/vnode.ts +47 -0
- package/src/components/search-bar/FuComplexSearch.vue +0 -108
- package/src/components/search-bar/FuQuickSearch.vue +0 -43
- package/src/components/search-bar/FuSearchBar.vue +0 -165
- package/src/components/search-bar/FuSearchBarButton.vue +0 -14
- package/src/components/search-bar/FuSearchContions.vue +0 -24
- package/src/components/search-bar/index.ts +0 -13
- package/src/components/search-bar/store.ts +0 -25
- package/src/components/speed-dial/FuSpeedDial.vue +0 -280
- package/src/components/speed-dial/FuSpeedDialActionButton.vue +0 -88
- package/src/components/speed-dial/FuSpeedDialButton.vue +0 -42
- package/src/components/speed-dial/FuSpeedDialItem.vue +0 -88
- package/src/components/speed-dial/index.ts +0 -11
- package/src/components/steps/FuHorizontalNavigation.vue +0 -18
- package/src/components/steps/FuHorizontalSteps.vue +0 -94
- package/src/components/steps/FuStep.vue +0 -13
- package/src/components/steps/FuSteps.vue +0 -22
- package/src/components/steps/FuStepsFooter.ts +0 -79
- package/src/components/steps/FuVerticalNavigation.vue +0 -35
- package/src/components/steps/FuVerticalSteps.vue +0 -79
- package/src/components/steps/Stepper.ts +0 -188
- package/src/components/steps/index.ts +0 -11
- package/src/components/table/table-column-dropdown/index.ts +0 -7
- package/src/components/table/table-column-select/index.ts +0 -8
- package/src/components/table/table-operations/index.ts +0 -12
- package/src/components/virtual-scroller/FuVirtualHorizontalScroll.js +0 -96
- package/src/components/virtual-scroller/FuVirtualScroll.js +0 -15
- package/src/components/virtual-scroller/FuVirtualVerticalScroll.js +0 -95
- package/src/components/virtual-scroller/index.js +0 -10
- package/src/styles/components/search-bar.scss +0 -285
|
@@ -0,0 +1,2892 @@
|
|
|
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
|
+
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, normalizeStyle, isVNode, Comment, useSlots, onUpdated, withDirectives, vShow, normalizeProps, guardReactiveProps } from "vue";
|
|
21
|
+
const COMPONENTS_SIZE = ["", "default", "small", "large"];
|
|
22
|
+
const validateSize = (val) => ["", ...COMPONENTS_SIZE].includes(val);
|
|
23
|
+
var _export_sfc = (sfc, props) => {
|
|
24
|
+
const target = sfc.__vccOpts || sfc;
|
|
25
|
+
for (const [key, val] of props) {
|
|
26
|
+
target[key] = val;
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
};
|
|
30
|
+
const __default__$f = { name: "FuSearchInput" };
|
|
31
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$f), {
|
|
32
|
+
props: {
|
|
33
|
+
size: {
|
|
34
|
+
type: String,
|
|
35
|
+
validator: validateSize
|
|
36
|
+
},
|
|
37
|
+
value: String
|
|
38
|
+
},
|
|
39
|
+
emits: ["input", "change"],
|
|
40
|
+
setup(__props, { emit }) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const quick = ref("");
|
|
43
|
+
watch(() => props.value, (val) => {
|
|
44
|
+
quick.value = val;
|
|
45
|
+
});
|
|
46
|
+
function input(e) {
|
|
47
|
+
emit("input", quick.value, e);
|
|
48
|
+
}
|
|
49
|
+
function blur(e) {
|
|
50
|
+
emit("change", quick.value, e);
|
|
51
|
+
}
|
|
52
|
+
function keydown(e) {
|
|
53
|
+
const event = e;
|
|
54
|
+
if (event.key === "Enter") {
|
|
55
|
+
emit("change", quick.value, e);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
const _component_el_input = resolveComponent("el-input");
|
|
60
|
+
return openBlock(), createBlock(_component_el_input, mergeProps({
|
|
61
|
+
class: "fu-search-input",
|
|
62
|
+
"prefix-icon": "Search",
|
|
63
|
+
modelValue: quick.value,
|
|
64
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => quick.value = $event),
|
|
65
|
+
onInput: input,
|
|
66
|
+
onBlur: blur,
|
|
67
|
+
onKeydown: keydown
|
|
68
|
+
}, _ctx.$attrs, {
|
|
69
|
+
clearable: "",
|
|
70
|
+
size: __props.size
|
|
71
|
+
}), null, 16, ["modelValue", "size"]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
var FuSearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/FuSearchInput.vue"]]);
|
|
76
|
+
const globalConfig = ref();
|
|
77
|
+
function useGlobalConfig(key, defaultValue = void 0) {
|
|
78
|
+
const config = getCurrentInstance() ? inject(Symbol(), globalConfig) : globalConfig;
|
|
79
|
+
if (key) {
|
|
80
|
+
return computed(() => {
|
|
81
|
+
var _a, _b;
|
|
82
|
+
return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
return config;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
89
|
+
var freeGlobal$1 = freeGlobal;
|
|
90
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
91
|
+
var root = freeGlobal$1 || freeSelf || Function("return this")();
|
|
92
|
+
var root$1 = root;
|
|
93
|
+
var Symbol$1 = root$1.Symbol;
|
|
94
|
+
var Symbol$2 = Symbol$1;
|
|
95
|
+
var objectProto$4 = Object.prototype;
|
|
96
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
97
|
+
var nativeObjectToString$1 = objectProto$4.toString;
|
|
98
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
99
|
+
function getRawTag(value) {
|
|
100
|
+
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
101
|
+
try {
|
|
102
|
+
value[symToStringTag$1] = void 0;
|
|
103
|
+
var unmasked = true;
|
|
104
|
+
} catch (e) {
|
|
105
|
+
}
|
|
106
|
+
var result = nativeObjectToString$1.call(value);
|
|
107
|
+
if (unmasked) {
|
|
108
|
+
if (isOwn) {
|
|
109
|
+
value[symToStringTag$1] = tag;
|
|
110
|
+
} else {
|
|
111
|
+
delete value[symToStringTag$1];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
var objectProto$3 = Object.prototype;
|
|
117
|
+
var nativeObjectToString = objectProto$3.toString;
|
|
118
|
+
function objectToString(value) {
|
|
119
|
+
return nativeObjectToString.call(value);
|
|
120
|
+
}
|
|
121
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
122
|
+
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
123
|
+
function baseGetTag(value) {
|
|
124
|
+
if (value == null) {
|
|
125
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
126
|
+
}
|
|
127
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
128
|
+
}
|
|
129
|
+
function isObjectLike(value) {
|
|
130
|
+
return value != null && typeof value == "object";
|
|
131
|
+
}
|
|
132
|
+
var symbolTag = "[object Symbol]";
|
|
133
|
+
function isSymbol(value) {
|
|
134
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
135
|
+
}
|
|
136
|
+
function arrayMap(array, iteratee) {
|
|
137
|
+
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
138
|
+
while (++index < length) {
|
|
139
|
+
result[index] = iteratee(array[index], index, array);
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
var isArray$1 = Array.isArray;
|
|
144
|
+
var isArray$2 = isArray$1;
|
|
145
|
+
var INFINITY$1 = 1 / 0;
|
|
146
|
+
var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
147
|
+
function baseToString(value) {
|
|
148
|
+
if (typeof value == "string") {
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
if (isArray$2(value)) {
|
|
152
|
+
return arrayMap(value, baseToString) + "";
|
|
153
|
+
}
|
|
154
|
+
if (isSymbol(value)) {
|
|
155
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
156
|
+
}
|
|
157
|
+
var result = value + "";
|
|
158
|
+
return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
|
|
159
|
+
}
|
|
160
|
+
function isObject(value) {
|
|
161
|
+
var type = typeof value;
|
|
162
|
+
return value != null && (type == "object" || type == "function");
|
|
163
|
+
}
|
|
164
|
+
var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
165
|
+
function isFunction(value) {
|
|
166
|
+
if (!isObject(value)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
var tag = baseGetTag(value);
|
|
170
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
171
|
+
}
|
|
172
|
+
var coreJsData = root$1["__core-js_shared__"];
|
|
173
|
+
var coreJsData$1 = coreJsData;
|
|
174
|
+
var maskSrcKey = function() {
|
|
175
|
+
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
|
|
176
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
177
|
+
}();
|
|
178
|
+
function isMasked(func) {
|
|
179
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
180
|
+
}
|
|
181
|
+
var funcProto$1 = Function.prototype;
|
|
182
|
+
var funcToString$1 = funcProto$1.toString;
|
|
183
|
+
function toSource(func) {
|
|
184
|
+
if (func != null) {
|
|
185
|
+
try {
|
|
186
|
+
return funcToString$1.call(func);
|
|
187
|
+
} catch (e) {
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
return func + "";
|
|
191
|
+
} catch (e) {
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return "";
|
|
195
|
+
}
|
|
196
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
197
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
198
|
+
var funcProto = Function.prototype, objectProto$2 = Object.prototype;
|
|
199
|
+
var funcToString = funcProto.toString;
|
|
200
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
201
|
+
var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
202
|
+
function baseIsNative(value) {
|
|
203
|
+
if (!isObject(value) || isMasked(value)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
207
|
+
return pattern.test(toSource(value));
|
|
208
|
+
}
|
|
209
|
+
function getValue(object, key) {
|
|
210
|
+
return object == null ? void 0 : object[key];
|
|
211
|
+
}
|
|
212
|
+
function getNative(object, key) {
|
|
213
|
+
var value = getValue(object, key);
|
|
214
|
+
return baseIsNative(value) ? value : void 0;
|
|
215
|
+
}
|
|
216
|
+
function eq(value, other) {
|
|
217
|
+
return value === other || value !== value && other !== other;
|
|
218
|
+
}
|
|
219
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
|
|
220
|
+
function isKey(value, object) {
|
|
221
|
+
if (isArray$2(value)) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
var type = typeof value;
|
|
225
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
229
|
+
}
|
|
230
|
+
var nativeCreate = getNative(Object, "create");
|
|
231
|
+
var nativeCreate$1 = nativeCreate;
|
|
232
|
+
function hashClear() {
|
|
233
|
+
this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
|
|
234
|
+
this.size = 0;
|
|
235
|
+
}
|
|
236
|
+
function hashDelete(key) {
|
|
237
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
238
|
+
this.size -= result ? 1 : 0;
|
|
239
|
+
return result;
|
|
240
|
+
}
|
|
241
|
+
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
242
|
+
var objectProto$1 = Object.prototype;
|
|
243
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
244
|
+
function hashGet(key) {
|
|
245
|
+
var data = this.__data__;
|
|
246
|
+
if (nativeCreate$1) {
|
|
247
|
+
var result = data[key];
|
|
248
|
+
return result === HASH_UNDEFINED$1 ? void 0 : result;
|
|
249
|
+
}
|
|
250
|
+
return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
|
|
251
|
+
}
|
|
252
|
+
var objectProto = Object.prototype;
|
|
253
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
254
|
+
function hashHas(key) {
|
|
255
|
+
var data = this.__data__;
|
|
256
|
+
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
257
|
+
}
|
|
258
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
259
|
+
function hashSet(key, value) {
|
|
260
|
+
var data = this.__data__;
|
|
261
|
+
this.size += this.has(key) ? 0 : 1;
|
|
262
|
+
data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED : value;
|
|
263
|
+
return this;
|
|
264
|
+
}
|
|
265
|
+
function Hash(entries) {
|
|
266
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
267
|
+
this.clear();
|
|
268
|
+
while (++index < length) {
|
|
269
|
+
var entry = entries[index];
|
|
270
|
+
this.set(entry[0], entry[1]);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
Hash.prototype.clear = hashClear;
|
|
274
|
+
Hash.prototype["delete"] = hashDelete;
|
|
275
|
+
Hash.prototype.get = hashGet;
|
|
276
|
+
Hash.prototype.has = hashHas;
|
|
277
|
+
Hash.prototype.set = hashSet;
|
|
278
|
+
function listCacheClear() {
|
|
279
|
+
this.__data__ = [];
|
|
280
|
+
this.size = 0;
|
|
281
|
+
}
|
|
282
|
+
function assocIndexOf(array, key) {
|
|
283
|
+
var length = array.length;
|
|
284
|
+
while (length--) {
|
|
285
|
+
if (eq(array[length][0], key)) {
|
|
286
|
+
return length;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return -1;
|
|
290
|
+
}
|
|
291
|
+
var arrayProto = Array.prototype;
|
|
292
|
+
var splice = arrayProto.splice;
|
|
293
|
+
function listCacheDelete(key) {
|
|
294
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
295
|
+
if (index < 0) {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
var lastIndex = data.length - 1;
|
|
299
|
+
if (index == lastIndex) {
|
|
300
|
+
data.pop();
|
|
301
|
+
} else {
|
|
302
|
+
splice.call(data, index, 1);
|
|
303
|
+
}
|
|
304
|
+
--this.size;
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
function listCacheGet(key) {
|
|
308
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
309
|
+
return index < 0 ? void 0 : data[index][1];
|
|
310
|
+
}
|
|
311
|
+
function listCacheHas(key) {
|
|
312
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
313
|
+
}
|
|
314
|
+
function listCacheSet(key, value) {
|
|
315
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
316
|
+
if (index < 0) {
|
|
317
|
+
++this.size;
|
|
318
|
+
data.push([key, value]);
|
|
319
|
+
} else {
|
|
320
|
+
data[index][1] = value;
|
|
321
|
+
}
|
|
322
|
+
return this;
|
|
323
|
+
}
|
|
324
|
+
function ListCache(entries) {
|
|
325
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
326
|
+
this.clear();
|
|
327
|
+
while (++index < length) {
|
|
328
|
+
var entry = entries[index];
|
|
329
|
+
this.set(entry[0], entry[1]);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
ListCache.prototype.clear = listCacheClear;
|
|
333
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
334
|
+
ListCache.prototype.get = listCacheGet;
|
|
335
|
+
ListCache.prototype.has = listCacheHas;
|
|
336
|
+
ListCache.prototype.set = listCacheSet;
|
|
337
|
+
var Map = getNative(root$1, "Map");
|
|
338
|
+
var Map$1 = Map;
|
|
339
|
+
function mapCacheClear() {
|
|
340
|
+
this.size = 0;
|
|
341
|
+
this.__data__ = {
|
|
342
|
+
"hash": new Hash(),
|
|
343
|
+
"map": new (Map$1 || ListCache)(),
|
|
344
|
+
"string": new Hash()
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function isKeyable(value) {
|
|
348
|
+
var type = typeof value;
|
|
349
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
350
|
+
}
|
|
351
|
+
function getMapData(map, key) {
|
|
352
|
+
var data = map.__data__;
|
|
353
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
354
|
+
}
|
|
355
|
+
function mapCacheDelete(key) {
|
|
356
|
+
var result = getMapData(this, key)["delete"](key);
|
|
357
|
+
this.size -= result ? 1 : 0;
|
|
358
|
+
return result;
|
|
359
|
+
}
|
|
360
|
+
function mapCacheGet(key) {
|
|
361
|
+
return getMapData(this, key).get(key);
|
|
362
|
+
}
|
|
363
|
+
function mapCacheHas(key) {
|
|
364
|
+
return getMapData(this, key).has(key);
|
|
365
|
+
}
|
|
366
|
+
function mapCacheSet(key, value) {
|
|
367
|
+
var data = getMapData(this, key), size = data.size;
|
|
368
|
+
data.set(key, value);
|
|
369
|
+
this.size += data.size == size ? 0 : 1;
|
|
370
|
+
return this;
|
|
371
|
+
}
|
|
372
|
+
function MapCache(entries) {
|
|
373
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
374
|
+
this.clear();
|
|
375
|
+
while (++index < length) {
|
|
376
|
+
var entry = entries[index];
|
|
377
|
+
this.set(entry[0], entry[1]);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
381
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
382
|
+
MapCache.prototype.get = mapCacheGet;
|
|
383
|
+
MapCache.prototype.has = mapCacheHas;
|
|
384
|
+
MapCache.prototype.set = mapCacheSet;
|
|
385
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
386
|
+
function memoize(func, resolver) {
|
|
387
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
388
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
389
|
+
}
|
|
390
|
+
var memoized = function() {
|
|
391
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
392
|
+
if (cache.has(key)) {
|
|
393
|
+
return cache.get(key);
|
|
394
|
+
}
|
|
395
|
+
var result = func.apply(this, args);
|
|
396
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
397
|
+
return result;
|
|
398
|
+
};
|
|
399
|
+
memoized.cache = new (memoize.Cache || MapCache)();
|
|
400
|
+
return memoized;
|
|
401
|
+
}
|
|
402
|
+
memoize.Cache = MapCache;
|
|
403
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
404
|
+
function memoizeCapped(func) {
|
|
405
|
+
var result = memoize(func, function(key) {
|
|
406
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
407
|
+
cache.clear();
|
|
408
|
+
}
|
|
409
|
+
return key;
|
|
410
|
+
});
|
|
411
|
+
var cache = result.cache;
|
|
412
|
+
return result;
|
|
413
|
+
}
|
|
414
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
415
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
416
|
+
var stringToPath = memoizeCapped(function(string) {
|
|
417
|
+
var result = [];
|
|
418
|
+
if (string.charCodeAt(0) === 46) {
|
|
419
|
+
result.push("");
|
|
420
|
+
}
|
|
421
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
422
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
423
|
+
});
|
|
424
|
+
return result;
|
|
425
|
+
});
|
|
426
|
+
var stringToPath$1 = stringToPath;
|
|
427
|
+
function toString(value) {
|
|
428
|
+
return value == null ? "" : baseToString(value);
|
|
429
|
+
}
|
|
430
|
+
function castPath(value, object) {
|
|
431
|
+
if (isArray$2(value)) {
|
|
432
|
+
return value;
|
|
433
|
+
}
|
|
434
|
+
return isKey(value, object) ? [value] : stringToPath$1(toString(value));
|
|
435
|
+
}
|
|
436
|
+
var INFINITY = 1 / 0;
|
|
437
|
+
function toKey(value) {
|
|
438
|
+
if (typeof value == "string" || isSymbol(value)) {
|
|
439
|
+
return value;
|
|
440
|
+
}
|
|
441
|
+
var result = value + "";
|
|
442
|
+
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
443
|
+
}
|
|
444
|
+
function baseGet(object, path) {
|
|
445
|
+
path = castPath(path, object);
|
|
446
|
+
var index = 0, length = path.length;
|
|
447
|
+
while (object != null && index < length) {
|
|
448
|
+
object = object[toKey(path[index++])];
|
|
449
|
+
}
|
|
450
|
+
return index && index == length ? object : void 0;
|
|
451
|
+
}
|
|
452
|
+
function get(object, path, defaultValue) {
|
|
453
|
+
var result = object == null ? void 0 : baseGet(object, path);
|
|
454
|
+
return result === void 0 ? defaultValue : result;
|
|
455
|
+
}
|
|
456
|
+
var Chinese = {
|
|
457
|
+
name: "zh-cn",
|
|
458
|
+
fu: {
|
|
459
|
+
filter_bar: {
|
|
460
|
+
filter: "\u7B5B\u9009",
|
|
461
|
+
results: "\u4E2A\u7ED3\u679C",
|
|
462
|
+
clear: "\u6E05\u7A7A\u6761\u4EF6",
|
|
463
|
+
drawer_title: "\u7B5B\u9009\u6761\u4EF6",
|
|
464
|
+
cancel: "\u53D6\u6D88",
|
|
465
|
+
search: "\u67E5\u8BE2",
|
|
466
|
+
select_all: "\u5168\u9009",
|
|
467
|
+
more: "\u66F4\u591A"
|
|
468
|
+
},
|
|
469
|
+
search_bar: {
|
|
470
|
+
search: "\u641C\u7D22",
|
|
471
|
+
adv_search: "\u9AD8\u7EA7\u641C\u7D22",
|
|
472
|
+
ok: "\u786E\u5B9A",
|
|
473
|
+
cancel: "\u53D6\u6D88",
|
|
474
|
+
please_select: "\u8BF7\u9009\u62E9",
|
|
475
|
+
please_input: "\u8BF7\u8F93\u5165",
|
|
476
|
+
like: "\u5305\u542B",
|
|
477
|
+
not_like: "\u4E0D\u5305\u542B",
|
|
478
|
+
in: "\u5C5E\u4E8E",
|
|
479
|
+
not_in: "\u4E0D\u5C5E\u4E8E",
|
|
480
|
+
gt: "\u5927\u4E8E",
|
|
481
|
+
ge: "\u5927\u4E8E\u7B49\u4E8E",
|
|
482
|
+
lt: "\u5C0F\u4E8E",
|
|
483
|
+
le: "\u5C0F\u4E8E\u7B49\u4E8E",
|
|
484
|
+
eq: "\u7B49\u4E8E",
|
|
485
|
+
ne: "\u4E0D\u7B49\u4E8E",
|
|
486
|
+
between: "\u4E4B\u95F4",
|
|
487
|
+
select_date: "\u9009\u62E9\u65E5\u671F",
|
|
488
|
+
start_date: "\u5F00\u59CB\u65E5\u671F",
|
|
489
|
+
end_date: "\u7ED3\u675F\u65E5\u671F",
|
|
490
|
+
select_date_time: "\u9009\u62E9\u65E5\u671F\u65F6\u95F4",
|
|
491
|
+
start_date_time: "\u5F00\u59CB\u65E5\u671F\u65F6\u95F4",
|
|
492
|
+
end_date_time: "\u7ED3\u675F\u65E5\u671F\u65F6\u95F4",
|
|
493
|
+
range_separator: "\u81F3",
|
|
494
|
+
data_time_error: "\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65E5\u671F",
|
|
495
|
+
clean: "\u6E05\u7A7A",
|
|
496
|
+
refresh: "\u5237\u65B0"
|
|
497
|
+
},
|
|
498
|
+
table: {
|
|
499
|
+
ok: "\u786E\u5B9A",
|
|
500
|
+
reset: "\u91CD\u7F6E",
|
|
501
|
+
custom_table_fields: "\u81EA\u5B9A\u4E49\u8868\u683C\u5B57\u6BB5",
|
|
502
|
+
custom_table_fields_desc: "\u56FA\u5B9A\u5B57\u6BB5\u4E0D\u5728\u9009\u62E9\u8303\u56F4\uFF0C\u53EF\u62D6\u62FD\u81EA\u5B9A\u4E49\u987A\u5E8F",
|
|
503
|
+
custom_table_rows: "\u9009\u9879\u5217",
|
|
504
|
+
more: "\u66F4\u591A"
|
|
505
|
+
},
|
|
506
|
+
steps: {
|
|
507
|
+
cancel: "\u53D6\u6D88",
|
|
508
|
+
next: "\u4E0B\u4E00\u6B65",
|
|
509
|
+
prev: "\u4E0A\u4E00\u6B65",
|
|
510
|
+
finish: "\u5B8C\u6210"
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
|
|
515
|
+
const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
|
|
516
|
+
var _a;
|
|
517
|
+
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
|
|
518
|
+
});
|
|
519
|
+
const buildLocaleContext = (locale) => {
|
|
520
|
+
const lang = computed(() => unref(locale).name);
|
|
521
|
+
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
522
|
+
return {
|
|
523
|
+
lang,
|
|
524
|
+
locale: localeRef,
|
|
525
|
+
t: buildTranslator(locale)
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
const useLocale = () => {
|
|
529
|
+
const locale = useGlobalConfig("locale");
|
|
530
|
+
return buildLocaleContext(computed(() => locale.value || Chinese));
|
|
531
|
+
};
|
|
532
|
+
const _hoisted_1$a = { class: "fu-filter-conditions" };
|
|
533
|
+
const _hoisted_2$7 = { class: "condition-text" };
|
|
534
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
535
|
+
__name: "FuFilterConditions",
|
|
536
|
+
props: {
|
|
537
|
+
conditions: Array
|
|
538
|
+
},
|
|
539
|
+
emits: ["change"],
|
|
540
|
+
setup(__props, { emit }) {
|
|
541
|
+
const props = __props;
|
|
542
|
+
function remove(index) {
|
|
543
|
+
var _a;
|
|
544
|
+
(_a = props.conditions) == null ? void 0 : _a.splice(index, 1);
|
|
545
|
+
emit("change", props.conditions);
|
|
546
|
+
}
|
|
547
|
+
function text(condition) {
|
|
548
|
+
return condition.label + " " + condition.valueLabel || condition.value;
|
|
549
|
+
}
|
|
550
|
+
return (_ctx, _cache) => {
|
|
551
|
+
const _component_CloseBold = resolveComponent("CloseBold");
|
|
552
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
553
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
554
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.conditions, (condition, index) => {
|
|
555
|
+
return openBlock(), createElementBlock("div", {
|
|
556
|
+
class: "fu-filter-conditions__item",
|
|
557
|
+
key: index
|
|
558
|
+
}, [
|
|
559
|
+
createElementVNode("div", _hoisted_2$7, toDisplayString(text(condition)), 1),
|
|
560
|
+
createVNode(_component_el_icon, {
|
|
561
|
+
class: "fu-scale-click",
|
|
562
|
+
onClick: ($event) => remove(index)
|
|
563
|
+
}, {
|
|
564
|
+
default: withCtx(() => [
|
|
565
|
+
createVNode(_component_CloseBold)
|
|
566
|
+
]),
|
|
567
|
+
_: 2
|
|
568
|
+
}, 1032, ["onClick"])
|
|
569
|
+
]);
|
|
570
|
+
}), 128))
|
|
571
|
+
]);
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
var FuFilterConditions = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/FuFilterConditions.vue"]]);
|
|
576
|
+
const selectKey = Symbol("SelectKey");
|
|
577
|
+
const referenceKey = Symbol("ReferenceKey");
|
|
578
|
+
const _hoisted_1$9 = { class: "fu-filter__result" };
|
|
579
|
+
const _hoisted_2$6 = { style: { "opacity": "0.6" } };
|
|
580
|
+
const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "fu-filter__split" }, null, -1);
|
|
581
|
+
const _hoisted_4$2 = { class: "drawer-body" };
|
|
582
|
+
const _hoisted_5$1 = { class: "drawer-footer" };
|
|
583
|
+
const __default__$e = { name: "FuFilter" };
|
|
584
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$e), {
|
|
585
|
+
props: {
|
|
586
|
+
size: {
|
|
587
|
+
type: String,
|
|
588
|
+
validator: validateSize
|
|
589
|
+
},
|
|
590
|
+
count: {
|
|
591
|
+
type: Number,
|
|
592
|
+
default: 0
|
|
593
|
+
},
|
|
594
|
+
components: Array,
|
|
595
|
+
drawerWidth: {
|
|
596
|
+
type: [Number, String],
|
|
597
|
+
default: "680px"
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
emits: ["filter"],
|
|
601
|
+
setup(__props, { expose, emit }) {
|
|
602
|
+
const { t } = useLocale();
|
|
603
|
+
const filterRef = ref(null);
|
|
604
|
+
const conditionsRef = ref(null);
|
|
605
|
+
const drawer = ref(true);
|
|
606
|
+
const scroll = ref(false);
|
|
607
|
+
const conditions = ref([]);
|
|
608
|
+
const references = ref([]);
|
|
609
|
+
let leftTimer, rightTimer;
|
|
610
|
+
function mouseup() {
|
|
611
|
+
clearInterval(leftTimer);
|
|
612
|
+
clearInterval(rightTimer);
|
|
613
|
+
}
|
|
614
|
+
function left() {
|
|
615
|
+
var _a;
|
|
616
|
+
let el = (_a = conditionsRef.value) == null ? void 0 : _a.$el;
|
|
617
|
+
leftTimer = setInterval(() => {
|
|
618
|
+
if (el)
|
|
619
|
+
el.scrollLeft -= 15;
|
|
620
|
+
}, 50);
|
|
621
|
+
}
|
|
622
|
+
function right() {
|
|
623
|
+
var _a;
|
|
624
|
+
let el = (_a = conditionsRef.value) == null ? void 0 : _a.$el;
|
|
625
|
+
rightTimer = setInterval(() => {
|
|
626
|
+
if (el)
|
|
627
|
+
el.scrollLeft += 15;
|
|
628
|
+
}, 50);
|
|
629
|
+
}
|
|
630
|
+
function change() {
|
|
631
|
+
nextTick(() => {
|
|
632
|
+
var _a;
|
|
633
|
+
let el = (_a = conditionsRef.value) == null ? void 0 : _a.$el;
|
|
634
|
+
scroll.value = el != null && (el == null ? void 0 : el.getBoundingClientRect().width) >= scrollWidth.value;
|
|
635
|
+
});
|
|
636
|
+
emit("filter", conditions.value);
|
|
637
|
+
}
|
|
638
|
+
function setConditions(conditionObj) {
|
|
639
|
+
conditions.value = [];
|
|
640
|
+
if (conditionObj) {
|
|
641
|
+
Object.keys(conditionObj).forEach((key) => {
|
|
642
|
+
let value = conditionObj[key].value;
|
|
643
|
+
references.value.forEach((r) => {
|
|
644
|
+
if (r.field === key) {
|
|
645
|
+
r.init(value);
|
|
646
|
+
const condition = r.getCondition();
|
|
647
|
+
if (condition) {
|
|
648
|
+
conditions.value.push(condition);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
});
|
|
653
|
+
change();
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
function filter() {
|
|
657
|
+
conditions.value = [];
|
|
658
|
+
references.value.forEach((r) => {
|
|
659
|
+
let condition;
|
|
660
|
+
condition = r.getCondition();
|
|
661
|
+
if (condition) {
|
|
662
|
+
conditions.value.push(condition);
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
drawer.value = false;
|
|
666
|
+
change();
|
|
667
|
+
}
|
|
668
|
+
function open() {
|
|
669
|
+
drawer.value = true;
|
|
670
|
+
}
|
|
671
|
+
function initComponents() {
|
|
672
|
+
references.value.forEach((r) => {
|
|
673
|
+
let condition = conditions.value.find((c) => c.field === r.field);
|
|
674
|
+
r.init(condition == null ? void 0 : condition.value);
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
function clear() {
|
|
678
|
+
conditions.value = [];
|
|
679
|
+
initComponents();
|
|
680
|
+
change();
|
|
681
|
+
}
|
|
682
|
+
const scrollWidth = computed(() => {
|
|
683
|
+
const el = filterRef.value;
|
|
684
|
+
return el === null ? 0 : el.getBoundingClientRect().width - 210;
|
|
685
|
+
});
|
|
686
|
+
provide(referenceKey, references);
|
|
687
|
+
onMounted(() => {
|
|
688
|
+
drawer.value = false;
|
|
689
|
+
});
|
|
690
|
+
expose({
|
|
691
|
+
open,
|
|
692
|
+
setConditions
|
|
693
|
+
});
|
|
694
|
+
return (_ctx, _cache) => {
|
|
695
|
+
const _component_ArrowLeftBold = resolveComponent("ArrowLeftBold");
|
|
696
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
697
|
+
const _component_ArrowRightBold = resolveComponent("ArrowRightBold");
|
|
698
|
+
const _component_Delete = resolveComponent("Delete");
|
|
699
|
+
const _component_el_button = resolveComponent("el-button");
|
|
700
|
+
const _component_el_drawer = resolveComponent("el-drawer");
|
|
701
|
+
return openBlock(), createElementBlock("div", {
|
|
702
|
+
class: "fu-filter",
|
|
703
|
+
ref_key: "filterRef",
|
|
704
|
+
ref: filterRef
|
|
705
|
+
}, [
|
|
706
|
+
createElementVNode("div", _hoisted_1$9, [
|
|
707
|
+
createTextVNode(toDisplayString(__props.count) + " ", 1),
|
|
708
|
+
createElementVNode("span", _hoisted_2$6, toDisplayString(unref(t)("fu.filter_bar.results")), 1)
|
|
709
|
+
]),
|
|
710
|
+
_hoisted_3$5,
|
|
711
|
+
scroll.value ? (openBlock(), createElementBlock("div", {
|
|
712
|
+
key: 0,
|
|
713
|
+
class: "fu-filter__scroll",
|
|
714
|
+
onMousedown: left,
|
|
715
|
+
onMouseup: mouseup
|
|
716
|
+
}, [
|
|
717
|
+
createVNode(_component_el_icon, null, {
|
|
718
|
+
default: withCtx(() => [
|
|
719
|
+
createVNode(_component_ArrowLeftBold)
|
|
720
|
+
]),
|
|
721
|
+
_: 1
|
|
722
|
+
})
|
|
723
|
+
], 32)) : createCommentVNode("v-if", true),
|
|
724
|
+
createVNode(FuFilterConditions, {
|
|
725
|
+
conditions: conditions.value,
|
|
726
|
+
onChange: change,
|
|
727
|
+
ref_key: "conditionsRef",
|
|
728
|
+
ref: conditionsRef
|
|
729
|
+
}, null, 8, ["conditions"]),
|
|
730
|
+
scroll.value ? (openBlock(), createElementBlock("div", {
|
|
731
|
+
key: 1,
|
|
732
|
+
class: "fu-filter__scroll",
|
|
733
|
+
onMousedown: right,
|
|
734
|
+
onMouseup: mouseup
|
|
735
|
+
}, [
|
|
736
|
+
createVNode(_component_el_icon, null, {
|
|
737
|
+
default: withCtx(() => [
|
|
738
|
+
createVNode(_component_ArrowRightBold)
|
|
739
|
+
]),
|
|
740
|
+
_: 1
|
|
741
|
+
})
|
|
742
|
+
], 32)) : createCommentVNode("v-if", true),
|
|
743
|
+
conditions.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
744
|
+
key: 2,
|
|
745
|
+
class: "fu-filter__clear fu-scale-click",
|
|
746
|
+
onClick: clear
|
|
747
|
+
}, [
|
|
748
|
+
createVNode(_component_el_icon, null, {
|
|
749
|
+
default: withCtx(() => [
|
|
750
|
+
createVNode(_component_Delete)
|
|
751
|
+
]),
|
|
752
|
+
_: 1
|
|
753
|
+
}),
|
|
754
|
+
createTextVNode(" " + toDisplayString(unref(t)("fu.filter_bar.clear")), 1)
|
|
755
|
+
])) : createCommentVNode("v-if", true),
|
|
756
|
+
createVNode(_component_el_drawer, {
|
|
757
|
+
size: __props.drawerWidth,
|
|
758
|
+
"custom-class": "fu-filter__drawer",
|
|
759
|
+
title: unref(t)("fu.filter_bar.drawer_title"),
|
|
760
|
+
modelValue: drawer.value,
|
|
761
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => drawer.value = $event),
|
|
762
|
+
onOpen: initComponents
|
|
763
|
+
}, {
|
|
764
|
+
default: withCtx(() => [
|
|
765
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
766
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
767
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.components, (c, i) => {
|
|
768
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), mergeProps({ key: i }, c, {
|
|
769
|
+
ref_for: true,
|
|
770
|
+
ref: c.field
|
|
771
|
+
}, toHandlers(c), { size: __props.size }), null, 16, ["size"]);
|
|
772
|
+
}), 128))
|
|
773
|
+
])
|
|
774
|
+
]),
|
|
775
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
776
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
777
|
+
createVNode(_component_el_button, {
|
|
778
|
+
size: __props.size,
|
|
779
|
+
onClick: _cache[0] || (_cache[0] = ($event) => drawer.value = false)
|
|
780
|
+
}, {
|
|
781
|
+
default: withCtx(() => [
|
|
782
|
+
createTextVNode(toDisplayString(unref(t)("fu.filter_bar.cancel")), 1)
|
|
783
|
+
]),
|
|
784
|
+
_: 1
|
|
785
|
+
}, 8, ["size"]),
|
|
786
|
+
createVNode(_component_el_button, {
|
|
787
|
+
size: __props.size,
|
|
788
|
+
type: "primary",
|
|
789
|
+
onClick: filter
|
|
790
|
+
}, {
|
|
791
|
+
default: withCtx(() => [
|
|
792
|
+
createTextVNode(toDisplayString(unref(t)("fu.filter_bar.search")), 1)
|
|
793
|
+
]),
|
|
794
|
+
_: 1
|
|
795
|
+
}, 8, ["size"])
|
|
796
|
+
])
|
|
797
|
+
])
|
|
798
|
+
]),
|
|
799
|
+
_: 3
|
|
800
|
+
}, 8, ["size", "title", "modelValue"])
|
|
801
|
+
], 512);
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
}));
|
|
805
|
+
var FuFilter = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/FuFilter.vue"]]);
|
|
806
|
+
const _hoisted_1$8 = { class: "fu-filter-bar" };
|
|
807
|
+
const _hoisted_2$5 = { class: "fu-filter-bar__top" };
|
|
808
|
+
const _hoisted_3$4 = { class: "top_left" };
|
|
809
|
+
const _hoisted_4$1 = { class: "top_right" };
|
|
810
|
+
const _hoisted_5 = { key: 0 };
|
|
811
|
+
const _hoisted_6 = { class: "fu-filter-bar__bottom" };
|
|
812
|
+
const __default__$d = { name: "FuFilterBar" };
|
|
813
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$d), {
|
|
814
|
+
props: {
|
|
815
|
+
size: {
|
|
816
|
+
type: String,
|
|
817
|
+
validator: validateSize
|
|
818
|
+
},
|
|
819
|
+
resultCount: Number,
|
|
820
|
+
quickPlaceholder: String,
|
|
821
|
+
components: Array
|
|
822
|
+
},
|
|
823
|
+
emits: ["exec"],
|
|
824
|
+
setup(__props, { expose, emit }) {
|
|
825
|
+
const { t } = useLocale();
|
|
826
|
+
const quick = ref("");
|
|
827
|
+
const conditions = ref([]);
|
|
828
|
+
const filterRef = ref();
|
|
829
|
+
function open() {
|
|
830
|
+
var _a;
|
|
831
|
+
(_a = filterRef.value) == null ? void 0 : _a.open();
|
|
832
|
+
}
|
|
833
|
+
function change() {
|
|
834
|
+
emit("exec", conditionObj.value);
|
|
835
|
+
}
|
|
836
|
+
function filter(c) {
|
|
837
|
+
conditions.value = c;
|
|
838
|
+
emit("exec", conditionObj.value);
|
|
839
|
+
}
|
|
840
|
+
function setConditions(conditionObj2) {
|
|
841
|
+
var _a;
|
|
842
|
+
(_a = filterRef.value) == null ? void 0 : _a.setConditions(conditionObj2);
|
|
843
|
+
}
|
|
844
|
+
const conditionObj = computed(() => {
|
|
845
|
+
let obj = { quick: quick.value };
|
|
846
|
+
conditions.value.forEach((c) => {
|
|
847
|
+
obj[c.field] = c;
|
|
848
|
+
});
|
|
849
|
+
return obj;
|
|
850
|
+
});
|
|
851
|
+
expose({
|
|
852
|
+
setConditions
|
|
853
|
+
});
|
|
854
|
+
return (_ctx, _cache) => {
|
|
855
|
+
const _component_el_button = resolveComponent("el-button");
|
|
856
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
857
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
858
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
859
|
+
renderSlot(_ctx.$slots, "tl")
|
|
860
|
+
]),
|
|
861
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
862
|
+
renderSlot(_ctx.$slots, "tr", {}, () => [
|
|
863
|
+
createVNode(FuSearchInput, {
|
|
864
|
+
size: __props.size,
|
|
865
|
+
modelValue: quick.value,
|
|
866
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => quick.value = $event),
|
|
867
|
+
placeholder: __props.quickPlaceholder,
|
|
868
|
+
onChange: change
|
|
869
|
+
}, null, 8, ["size", "modelValue", "placeholder"]),
|
|
870
|
+
createVNode(_component_el_button, {
|
|
871
|
+
onClick: open,
|
|
872
|
+
icon: "Filter",
|
|
873
|
+
size: __props.size
|
|
874
|
+
}, {
|
|
875
|
+
default: withCtx(() => [
|
|
876
|
+
createTextVNode(toDisplayString(unref(t)("fu.filter_bar.filter")) + " ", 1),
|
|
877
|
+
conditions.value.length > 0 ? (openBlock(), createElementBlock("span", _hoisted_5, "(" + toDisplayString(conditions.value.length) + ")", 1)) : createCommentVNode("v-if", true)
|
|
878
|
+
]),
|
|
879
|
+
_: 1
|
|
880
|
+
}, 8, ["size"])
|
|
881
|
+
]),
|
|
882
|
+
renderSlot(_ctx.$slots, "buttons")
|
|
883
|
+
])
|
|
884
|
+
]),
|
|
885
|
+
createElementVNode("div", _hoisted_6, [
|
|
886
|
+
createVNode(FuFilter, {
|
|
887
|
+
ref_key: "filterRef",
|
|
888
|
+
ref: filterRef,
|
|
889
|
+
onFilter: filter,
|
|
890
|
+
count: __props.resultCount,
|
|
891
|
+
components: __props.components,
|
|
892
|
+
size: __props.size
|
|
893
|
+
}, {
|
|
894
|
+
default: withCtx(() => [
|
|
895
|
+
renderSlot(_ctx.$slots, "default")
|
|
896
|
+
]),
|
|
897
|
+
_: 3
|
|
898
|
+
}, 8, ["count", "components", "size"])
|
|
899
|
+
])
|
|
900
|
+
]);
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
}));
|
|
904
|
+
var FuFilterBar = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/FuFilterBar.vue"]]);
|
|
905
|
+
const _hoisted_1$7 = ["onClick"];
|
|
906
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
907
|
+
__name: "FuFilterOption",
|
|
908
|
+
props: {
|
|
909
|
+
value: {
|
|
910
|
+
type: [String, Number],
|
|
911
|
+
required: true
|
|
912
|
+
},
|
|
913
|
+
label: [String, Number],
|
|
914
|
+
disabled: {
|
|
915
|
+
type: Boolean,
|
|
916
|
+
default: false
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
setup(__props) {
|
|
920
|
+
const props = __props;
|
|
921
|
+
const select = inject(selectKey);
|
|
922
|
+
const selected = computed(() => {
|
|
923
|
+
if (!select)
|
|
924
|
+
return false;
|
|
925
|
+
if (Array.isArray(select.selection.value)) {
|
|
926
|
+
return select.selection.value.includes(props.value);
|
|
927
|
+
} else {
|
|
928
|
+
return select.selection.value === props.value;
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
function click() {
|
|
932
|
+
select == null ? void 0 : select.setSelected(props.value, selected.value);
|
|
933
|
+
}
|
|
934
|
+
return (_ctx, _cache) => {
|
|
935
|
+
return openBlock(), createElementBlock("div", {
|
|
936
|
+
class: normalizeClass(["fu-filter-option", { "is-selected": unref(selected), "is-disabled": __props.disabled }]),
|
|
937
|
+
onClick: withModifiers(click, ["stop"])
|
|
938
|
+
}, toDisplayString(__props.label || __props.value), 11, _hoisted_1$7);
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
var FuFilterOption = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterOption.vue"]]);
|
|
943
|
+
const _hoisted_1$6 = { class: "fu-filter-component" };
|
|
944
|
+
const _hoisted_2$4 = { class: "fu-filter-component__label" };
|
|
945
|
+
const _hoisted_3$3 = { class: "fu-filter-component__content" };
|
|
946
|
+
const _hoisted_4 = { class: "fu-filter-option" };
|
|
947
|
+
const __default__$c = { name: "FuFilterSelect" };
|
|
948
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$c), {
|
|
949
|
+
props: {
|
|
950
|
+
size: {
|
|
951
|
+
type: String,
|
|
952
|
+
validator: validateSize
|
|
953
|
+
},
|
|
954
|
+
multiple: {
|
|
955
|
+
type: Boolean,
|
|
956
|
+
default: false
|
|
957
|
+
},
|
|
958
|
+
showLimit: {
|
|
959
|
+
type: Number,
|
|
960
|
+
default: 3
|
|
961
|
+
},
|
|
962
|
+
useSelectAll: {
|
|
963
|
+
type: Boolean,
|
|
964
|
+
default: false
|
|
965
|
+
},
|
|
966
|
+
label: String,
|
|
967
|
+
field: {
|
|
968
|
+
type: String,
|
|
969
|
+
required: true
|
|
970
|
+
},
|
|
971
|
+
options: {
|
|
972
|
+
type: Array,
|
|
973
|
+
default: []
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
emits: ["change"],
|
|
977
|
+
setup(__props, { expose, emit }) {
|
|
978
|
+
const props = __props;
|
|
979
|
+
const { t } = useLocale();
|
|
980
|
+
const selection = ref(props.multiple ? [] : "");
|
|
981
|
+
const showOptions = computed(() => {
|
|
982
|
+
return props.options.filter((o, i) => {
|
|
983
|
+
let show = props.showLimit < 0 ? true : i < props.showLimit;
|
|
984
|
+
if (Array.isArray(selection.value)) {
|
|
985
|
+
return show || selection.value.includes(o.value);
|
|
986
|
+
} else {
|
|
987
|
+
return show || selection.value === o.value;
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
});
|
|
991
|
+
const valueLabel = computed(() => {
|
|
992
|
+
if (Array.isArray(selection.value)) {
|
|
993
|
+
let values = [];
|
|
994
|
+
selection.value.forEach((v) => {
|
|
995
|
+
values.push(getValueLabel(v));
|
|
996
|
+
});
|
|
997
|
+
return values.join(", ");
|
|
998
|
+
}
|
|
999
|
+
return getValueLabel(selection.value);
|
|
1000
|
+
});
|
|
1001
|
+
function change(v) {
|
|
1002
|
+
if (v.includes("")) {
|
|
1003
|
+
selection.value = props.options.map((o) => o.value);
|
|
1004
|
+
}
|
|
1005
|
+
emit("change", selection.value);
|
|
1006
|
+
}
|
|
1007
|
+
function setSelected(value, selected) {
|
|
1008
|
+
if (!Array.isArray(selection.value)) {
|
|
1009
|
+
selection.value = selected ? "" : value;
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
if (selected) {
|
|
1013
|
+
let index = selection.value.indexOf(value);
|
|
1014
|
+
selection.value.splice(index, 1);
|
|
1015
|
+
} else {
|
|
1016
|
+
selection.value.push(value);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
function selectAll() {
|
|
1020
|
+
selection.value = props.options.map((o) => o.value);
|
|
1021
|
+
}
|
|
1022
|
+
function getValueLabel(value) {
|
|
1023
|
+
for (let o of props.options) {
|
|
1024
|
+
if (o.value === value) {
|
|
1025
|
+
return o.label;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
return value;
|
|
1029
|
+
}
|
|
1030
|
+
function getCondition() {
|
|
1031
|
+
if (!selection.value || Array.isArray(selection.value) && selection.value.length === 0)
|
|
1032
|
+
return;
|
|
1033
|
+
let { field: field2, label } = props;
|
|
1034
|
+
return { field: field2, label, value: selection.value, valueLabel: valueLabel.value };
|
|
1035
|
+
}
|
|
1036
|
+
function init(v) {
|
|
1037
|
+
selection.value = v !== void 0 ? v : props.multiple ? [] : "";
|
|
1038
|
+
}
|
|
1039
|
+
provide(selectKey, {
|
|
1040
|
+
setSelected,
|
|
1041
|
+
selection
|
|
1042
|
+
});
|
|
1043
|
+
const references = inject(referenceKey);
|
|
1044
|
+
const field = props.field;
|
|
1045
|
+
const reference = { field, init, getCondition };
|
|
1046
|
+
references == null ? void 0 : references.value.push(reference);
|
|
1047
|
+
expose({
|
|
1048
|
+
getCondition,
|
|
1049
|
+
init
|
|
1050
|
+
});
|
|
1051
|
+
return (_ctx, _cache) => {
|
|
1052
|
+
const _component_el_option = resolveComponent("el-option");
|
|
1053
|
+
const _component_el_select = resolveComponent("el-select");
|
|
1054
|
+
const _component_Plus = resolveComponent("Plus");
|
|
1055
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
1056
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
1057
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
1058
|
+
createElementVNode("div", _hoisted_2$4, toDisplayString(__props.label), 1),
|
|
1059
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
1060
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(showOptions), (o) => {
|
|
1061
|
+
return openBlock(), createBlock(FuFilterOption, {
|
|
1062
|
+
label: o.label,
|
|
1063
|
+
value: o.value,
|
|
1064
|
+
key: o.value
|
|
1065
|
+
}, null, 8, ["label", "value"]);
|
|
1066
|
+
}), 128)),
|
|
1067
|
+
createVNode(_component_el_popover, {
|
|
1068
|
+
"popper-class": "fu-filter-component-popover",
|
|
1069
|
+
"show-arrow": false,
|
|
1070
|
+
placement: "bottom-start",
|
|
1071
|
+
trigger: "click",
|
|
1072
|
+
width: "240"
|
|
1073
|
+
}, {
|
|
1074
|
+
reference: withCtx(() => [
|
|
1075
|
+
createElementVNode("div", _hoisted_4, [
|
|
1076
|
+
createVNode(_component_el_icon, null, {
|
|
1077
|
+
default: withCtx(() => [
|
|
1078
|
+
createVNode(_component_Plus)
|
|
1079
|
+
]),
|
|
1080
|
+
_: 1
|
|
1081
|
+
}),
|
|
1082
|
+
createTextVNode(" " + toDisplayString(unref(t)("fu.filter_bar.more")), 1)
|
|
1083
|
+
])
|
|
1084
|
+
]),
|
|
1085
|
+
default: withCtx(() => [
|
|
1086
|
+
createVNode(_component_el_select, mergeProps({
|
|
1087
|
+
modelValue: selection.value,
|
|
1088
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selection.value = $event)
|
|
1089
|
+
}, _ctx.$attrs, {
|
|
1090
|
+
multiple: __props.multiple,
|
|
1091
|
+
onChange: change,
|
|
1092
|
+
teleported: false,
|
|
1093
|
+
size: __props.size,
|
|
1094
|
+
placeholder: unref(t)("fu.search_bar.please_select")
|
|
1095
|
+
}), {
|
|
1096
|
+
default: withCtx(() => [
|
|
1097
|
+
__props.useSelectAll && __props.multiple ? (openBlock(), createBlock(_component_el_option, {
|
|
1098
|
+
key: 0,
|
|
1099
|
+
value: ""
|
|
1100
|
+
}, {
|
|
1101
|
+
default: withCtx(() => [
|
|
1102
|
+
createElementVNode("div", { onClick: selectAll }, toDisplayString(unref(t)("fu.filter_bar.select_all")), 1)
|
|
1103
|
+
]),
|
|
1104
|
+
_: 1
|
|
1105
|
+
})) : createCommentVNode("v-if", true),
|
|
1106
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (o) => {
|
|
1107
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
1108
|
+
label: o.label,
|
|
1109
|
+
value: o.value,
|
|
1110
|
+
key: o.value
|
|
1111
|
+
}, null, 8, ["label", "value"]);
|
|
1112
|
+
}), 128))
|
|
1113
|
+
]),
|
|
1114
|
+
_: 1
|
|
1115
|
+
}, 16, ["modelValue", "multiple", "size", "placeholder"])
|
|
1116
|
+
]),
|
|
1117
|
+
_: 1
|
|
1118
|
+
})
|
|
1119
|
+
])
|
|
1120
|
+
]);
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
}));
|
|
1124
|
+
var FuFilterSelect = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterSelect.vue"]]);
|
|
1125
|
+
const getCheckDate = (timestamp) => {
|
|
1126
|
+
if (!timestamp)
|
|
1127
|
+
return false;
|
|
1128
|
+
const dt = new Date(timestamp);
|
|
1129
|
+
if (isNaN(dt.getTime()))
|
|
1130
|
+
return false;
|
|
1131
|
+
return dt;
|
|
1132
|
+
};
|
|
1133
|
+
const datetimeFormat = (timestamp) => {
|
|
1134
|
+
const dt = getCheckDate(timestamp);
|
|
1135
|
+
if (!dt)
|
|
1136
|
+
return timestamp;
|
|
1137
|
+
const y = dt.getFullYear();
|
|
1138
|
+
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
|
1139
|
+
const d = (dt.getDate() + "").padStart(2, "0");
|
|
1140
|
+
const hh = (dt.getHours() + "").padStart(2, "0");
|
|
1141
|
+
const mm = (dt.getMinutes() + "").padStart(2, "0");
|
|
1142
|
+
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
|
1143
|
+
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
|
|
1144
|
+
};
|
|
1145
|
+
const dateFormat = (timestamp) => {
|
|
1146
|
+
const dt = getCheckDate(timestamp);
|
|
1147
|
+
if (!dt)
|
|
1148
|
+
return timestamp;
|
|
1149
|
+
const y = dt.getFullYear();
|
|
1150
|
+
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
|
1151
|
+
const d = (dt.getDate() + "").padStart(2, "0");
|
|
1152
|
+
return `${y}-${m}-${d}`;
|
|
1153
|
+
};
|
|
1154
|
+
const _hoisted_1$5 = { class: "fu-filter-component" };
|
|
1155
|
+
const _hoisted_2$3 = { class: "fu-filter-component__label" };
|
|
1156
|
+
const _hoisted_3$2 = { class: "fu-filter-component__content" };
|
|
1157
|
+
const __default__$b = { name: "FuFilterDate" };
|
|
1158
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$b), {
|
|
1159
|
+
props: {
|
|
1160
|
+
size: {
|
|
1161
|
+
type: String,
|
|
1162
|
+
validator: validateSize
|
|
1163
|
+
},
|
|
1164
|
+
label: String,
|
|
1165
|
+
field: {
|
|
1166
|
+
type: String,
|
|
1167
|
+
required: true
|
|
1168
|
+
},
|
|
1169
|
+
valueFormat: {
|
|
1170
|
+
type: String,
|
|
1171
|
+
default: "x"
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
setup(__props, { expose }) {
|
|
1175
|
+
const props = __props;
|
|
1176
|
+
const { t } = useLocale();
|
|
1177
|
+
const value = ref("");
|
|
1178
|
+
const valueLabel = computed(() => {
|
|
1179
|
+
return dateFormat(value.value[0]) + " - " + dateFormat(value.value[1]);
|
|
1180
|
+
});
|
|
1181
|
+
function getCondition() {
|
|
1182
|
+
if (!String(value.value))
|
|
1183
|
+
return;
|
|
1184
|
+
let { field: field2, label } = props;
|
|
1185
|
+
return { field: field2, label, value: value.value, valueLabel: valueLabel.value };
|
|
1186
|
+
}
|
|
1187
|
+
function init(v) {
|
|
1188
|
+
value.value = v !== void 0 ? v : "";
|
|
1189
|
+
}
|
|
1190
|
+
const references = inject(referenceKey);
|
|
1191
|
+
const field = props.field;
|
|
1192
|
+
const reference = { field, init, getCondition };
|
|
1193
|
+
references == null ? void 0 : references.value.push(reference);
|
|
1194
|
+
expose({
|
|
1195
|
+
getCondition,
|
|
1196
|
+
init
|
|
1197
|
+
});
|
|
1198
|
+
return (_ctx, _cache) => {
|
|
1199
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
1200
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1201
|
+
createElementVNode("div", _hoisted_2$3, toDisplayString(__props.label), 1),
|
|
1202
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
1203
|
+
createCommentVNode("configSize"),
|
|
1204
|
+
createVNode(_component_el_date_picker, mergeProps({
|
|
1205
|
+
class: "fu-filter-date",
|
|
1206
|
+
modelValue: value.value,
|
|
1207
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
1208
|
+
}, _ctx.$attrs, {
|
|
1209
|
+
size: __props.size,
|
|
1210
|
+
placeholder: unref(t)("fu.search_bar.select_date"),
|
|
1211
|
+
type: "daterange",
|
|
1212
|
+
"value-format": __props.valueFormat,
|
|
1213
|
+
"start-placeholder": unref(t)("fu.search_bar.start_date"),
|
|
1214
|
+
"end-placeholder": unref(t)("fu.search_bar.end_date")
|
|
1215
|
+
}), null, 16, ["modelValue", "size", "placeholder", "value-format", "start-placeholder", "end-placeholder"])
|
|
1216
|
+
])
|
|
1217
|
+
]);
|
|
1218
|
+
};
|
|
1219
|
+
}
|
|
1220
|
+
}));
|
|
1221
|
+
var FuFilterDate = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterDate.vue"]]);
|
|
1222
|
+
const _hoisted_1$4 = { class: "fu-filter-component" };
|
|
1223
|
+
const _hoisted_2$2 = { class: "fu-filter-component__label" };
|
|
1224
|
+
const _hoisted_3$1 = { class: "fu-filter-component__content" };
|
|
1225
|
+
const __default__$a = { name: "FuFilterDateTime" };
|
|
1226
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$a), {
|
|
1227
|
+
props: {
|
|
1228
|
+
size: {
|
|
1229
|
+
type: String,
|
|
1230
|
+
validator: validateSize
|
|
1231
|
+
},
|
|
1232
|
+
label: String,
|
|
1233
|
+
field: {
|
|
1234
|
+
type: String,
|
|
1235
|
+
required: true
|
|
1236
|
+
},
|
|
1237
|
+
valueFormat: {
|
|
1238
|
+
type: String,
|
|
1239
|
+
default: "x"
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
setup(__props, { expose }) {
|
|
1243
|
+
const props = __props;
|
|
1244
|
+
const { t } = useLocale();
|
|
1245
|
+
const value = ref("");
|
|
1246
|
+
const valueLabel = computed(() => {
|
|
1247
|
+
return datetimeFormat(value.value[0]) + " - " + datetimeFormat(value.value[1]);
|
|
1248
|
+
});
|
|
1249
|
+
function getCondition() {
|
|
1250
|
+
if (!String(value.value))
|
|
1251
|
+
return;
|
|
1252
|
+
let { field: field2, label } = props;
|
|
1253
|
+
return { field: field2, label, value: value.value, valueLabel: valueLabel.value };
|
|
1254
|
+
}
|
|
1255
|
+
function init(v) {
|
|
1256
|
+
value.value = v !== void 0 ? v : "";
|
|
1257
|
+
}
|
|
1258
|
+
const references = inject(referenceKey);
|
|
1259
|
+
const field = props.field;
|
|
1260
|
+
const reference = { field, init, getCondition };
|
|
1261
|
+
references == null ? void 0 : references.value.push(reference);
|
|
1262
|
+
expose({
|
|
1263
|
+
getCondition,
|
|
1264
|
+
init
|
|
1265
|
+
});
|
|
1266
|
+
return (_ctx, _cache) => {
|
|
1267
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
1268
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1269
|
+
createElementVNode("div", _hoisted_2$2, toDisplayString(__props.label), 1),
|
|
1270
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
1271
|
+
createCommentVNode(' :size="configSize" '),
|
|
1272
|
+
createVNode(_component_el_date_picker, mergeProps({
|
|
1273
|
+
class: "fu-filter-date",
|
|
1274
|
+
modelValue: value.value,
|
|
1275
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
1276
|
+
}, _ctx.$attrs, {
|
|
1277
|
+
size: __props.size,
|
|
1278
|
+
placeholder: unref(t)("fu.search_bar.select_date_time"),
|
|
1279
|
+
type: "datetimerange",
|
|
1280
|
+
"value-format": __props.valueFormat,
|
|
1281
|
+
"start-placeholder": unref(t)("fu.search_bar.start_date_time"),
|
|
1282
|
+
"end-placeholder": unref(t)("fu.search_bar.end_date_time")
|
|
1283
|
+
}), null, 16, ["modelValue", "size", "placeholder", "value-format", "start-placeholder", "end-placeholder"])
|
|
1284
|
+
])
|
|
1285
|
+
]);
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
}));
|
|
1289
|
+
var FuFilterDateTime = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/filter-bar/filter-components/FuFilterDateTime.vue"]]);
|
|
1290
|
+
FuSearchInput.install = (app) => {
|
|
1291
|
+
app.component(FuFilterBar.name, FuFilterBar);
|
|
1292
|
+
app.component(FuFilter.name, FuFilter);
|
|
1293
|
+
app.component(FuSearchInput.name, FuSearchInput);
|
|
1294
|
+
app.component(FuFilterSelect.name, FuFilterSelect);
|
|
1295
|
+
app.component(FuFilterDate.name, FuFilterDate);
|
|
1296
|
+
app.component(FuFilterDateTime.name, FuFilterDateTime);
|
|
1297
|
+
};
|
|
1298
|
+
var __glob_1_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1299
|
+
__proto__: null,
|
|
1300
|
+
"default": FuSearchInput
|
|
1301
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1302
|
+
const uuid = function() {
|
|
1303
|
+
let d = new Date().getTime();
|
|
1304
|
+
let d2 = performance && performance.now && performance.now() * 1e3 || 0;
|
|
1305
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
1306
|
+
let r = Math.random() * 16;
|
|
1307
|
+
if (d > 0) {
|
|
1308
|
+
r = (d + r) % 16 | 0;
|
|
1309
|
+
d = Math.floor(d / 16);
|
|
1310
|
+
} else {
|
|
1311
|
+
r = (d2 + r) % 16 | 0;
|
|
1312
|
+
d2 = Math.floor(d2 / 16);
|
|
1313
|
+
}
|
|
1314
|
+
return (c === "x" ? r : r & 3 | 8).toString(16);
|
|
1315
|
+
});
|
|
1316
|
+
};
|
|
1317
|
+
const TRIGGERS = ["manual", "onClick", "onDblclick"];
|
|
1318
|
+
const _sfc_main$d = defineComponent({
|
|
1319
|
+
name: "FuReadWriteSwitch",
|
|
1320
|
+
props: {
|
|
1321
|
+
modelValue: Boolean,
|
|
1322
|
+
data: [String, Number, Boolean],
|
|
1323
|
+
writeTrigger: {
|
|
1324
|
+
type: String,
|
|
1325
|
+
default: "onClick",
|
|
1326
|
+
validator: (value) => {
|
|
1327
|
+
return TRIGGERS.includes(value);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
setup(props, { slots, emit }) {
|
|
1332
|
+
const id = ref(uuid());
|
|
1333
|
+
const write = ref(props.modelValue === void 0 ? false : props.modelValue);
|
|
1334
|
+
watch(() => props.modelValue, (v) => {
|
|
1335
|
+
if (v === write.value)
|
|
1336
|
+
return;
|
|
1337
|
+
if (v) {
|
|
1338
|
+
switchWrite();
|
|
1339
|
+
} else {
|
|
1340
|
+
switchRead();
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
function change() {
|
|
1344
|
+
emit("update:modelValue", write.value);
|
|
1345
|
+
emit("change", [props.data, write.value]);
|
|
1346
|
+
}
|
|
1347
|
+
function switchWrite() {
|
|
1348
|
+
write.value = true;
|
|
1349
|
+
nextTick(() => {
|
|
1350
|
+
const nid = document.getElementById(id.value);
|
|
1351
|
+
const input = nid == null ? void 0 : nid.querySelector("input");
|
|
1352
|
+
input == null ? void 0 : input.click();
|
|
1353
|
+
input == null ? void 0 : input.focus();
|
|
1354
|
+
const textarea = nid == null ? void 0 : nid.querySelector("textarea");
|
|
1355
|
+
textarea == null ? void 0 : textarea.focus();
|
|
1356
|
+
change();
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
function switchRead() {
|
|
1360
|
+
write.value = false;
|
|
1361
|
+
change();
|
|
1362
|
+
}
|
|
1363
|
+
return () => {
|
|
1364
|
+
const context = {
|
|
1365
|
+
class: "fu-read-write-switch",
|
|
1366
|
+
id: id.value
|
|
1367
|
+
};
|
|
1368
|
+
if (!write.value && props.writeTrigger !== TRIGGERS[0]) {
|
|
1369
|
+
context[props.writeTrigger] = switchWrite;
|
|
1370
|
+
}
|
|
1371
|
+
let children = props.data;
|
|
1372
|
+
if (!write.value && slots.read) {
|
|
1373
|
+
children = slots.read({
|
|
1374
|
+
write: switchWrite
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
if (write.value && slots.default) {
|
|
1378
|
+
children = slots.default({
|
|
1379
|
+
read: switchRead
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
return h("div", context, children);
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
var FuReadWriteSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/read-write-switch/FuReadWriteSwitch.vue"]]);
|
|
1387
|
+
const __default__$9 = { name: "FuInputRwSwitch" };
|
|
1388
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$9), {
|
|
1389
|
+
props: {
|
|
1390
|
+
modelValue: [String, Number],
|
|
1391
|
+
writeTrigger: {
|
|
1392
|
+
type: String,
|
|
1393
|
+
default: "onClick",
|
|
1394
|
+
validator: (value) => {
|
|
1395
|
+
return ["onClick", "onDblclick"].includes(value);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
emits: ["input", "blur"],
|
|
1400
|
+
setup(__props, { emit }) {
|
|
1401
|
+
const props = __props;
|
|
1402
|
+
const data = ref(props.modelValue);
|
|
1403
|
+
watch(() => props.modelValue, (v) => {
|
|
1404
|
+
data.value = v;
|
|
1405
|
+
});
|
|
1406
|
+
function input(e) {
|
|
1407
|
+
emit("input", data.value, e);
|
|
1408
|
+
}
|
|
1409
|
+
function blur(read, e) {
|
|
1410
|
+
emit("blur", data.value, e);
|
|
1411
|
+
read();
|
|
1412
|
+
}
|
|
1413
|
+
function keydown(read, e) {
|
|
1414
|
+
if (e.key === "Enter") {
|
|
1415
|
+
read();
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
return (_ctx, _cache) => {
|
|
1419
|
+
const _component_el_input = resolveComponent("el-input");
|
|
1420
|
+
return openBlock(), createBlock(FuReadWriteSwitch, {
|
|
1421
|
+
"write-trigger": __props.writeTrigger,
|
|
1422
|
+
data: data.value
|
|
1423
|
+
}, {
|
|
1424
|
+
default: withCtx(({ read }) => [
|
|
1425
|
+
createVNode(_component_el_input, mergeProps({
|
|
1426
|
+
modelValue: data.value,
|
|
1427
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value = $event)
|
|
1428
|
+
}, _ctx.$attrs, {
|
|
1429
|
+
onInput: input,
|
|
1430
|
+
onBlur: ($event) => blur(read, $event),
|
|
1431
|
+
onKeydown: ($event) => keydown(read, $event)
|
|
1432
|
+
}), null, 16, ["modelValue", "onBlur", "onKeydown"])
|
|
1433
|
+
]),
|
|
1434
|
+
_: 1
|
|
1435
|
+
}, 8, ["write-trigger", "data"]);
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
}));
|
|
1439
|
+
var FuInputRwSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/read-write-switch/FuInputRwSwitch.vue"]]);
|
|
1440
|
+
const __default__$8 = { name: "FuSelectRwSwitch" };
|
|
1441
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$8), {
|
|
1442
|
+
props: {
|
|
1443
|
+
modelValue: [String, Number],
|
|
1444
|
+
options: {
|
|
1445
|
+
type: Array,
|
|
1446
|
+
default: []
|
|
1447
|
+
},
|
|
1448
|
+
writeTrigger: {
|
|
1449
|
+
type: String,
|
|
1450
|
+
default: "onClick",
|
|
1451
|
+
validator: (value) => {
|
|
1452
|
+
return ["onClick", "onDblclick"].includes(value);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
emits: ["input", "blur", "change"],
|
|
1457
|
+
setup(__props, { emit }) {
|
|
1458
|
+
const props = __props;
|
|
1459
|
+
const data = ref(props.modelValue);
|
|
1460
|
+
watch(() => props.modelValue, (v) => {
|
|
1461
|
+
data.value = v;
|
|
1462
|
+
});
|
|
1463
|
+
function input(e) {
|
|
1464
|
+
emit("input", data.value, e);
|
|
1465
|
+
}
|
|
1466
|
+
function blur(read, e) {
|
|
1467
|
+
setTimeout(() => {
|
|
1468
|
+
read();
|
|
1469
|
+
}, 100);
|
|
1470
|
+
emit("blur", data.value, e);
|
|
1471
|
+
}
|
|
1472
|
+
function change(read, e) {
|
|
1473
|
+
emit("change", data.value, e);
|
|
1474
|
+
read();
|
|
1475
|
+
}
|
|
1476
|
+
return (_ctx, _cache) => {
|
|
1477
|
+
const _component_el_option = resolveComponent("el-option");
|
|
1478
|
+
const _component_el_select = resolveComponent("el-select");
|
|
1479
|
+
const _component_fu_read_write_switch = resolveComponent("fu-read-write-switch");
|
|
1480
|
+
return openBlock(), createBlock(_component_fu_read_write_switch, {
|
|
1481
|
+
"write-trigger": __props.writeTrigger,
|
|
1482
|
+
data: data.value
|
|
1483
|
+
}, {
|
|
1484
|
+
read: withCtx(() => [
|
|
1485
|
+
renderSlot(_ctx.$slots, "read", {}, () => [
|
|
1486
|
+
createTextVNode(toDisplayString(data.value), 1)
|
|
1487
|
+
])
|
|
1488
|
+
]),
|
|
1489
|
+
default: withCtx(({ read }) => [
|
|
1490
|
+
createVNode(_component_el_select, mergeProps({
|
|
1491
|
+
modelValue: data.value,
|
|
1492
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value = $event)
|
|
1493
|
+
}, _ctx.$attrs, {
|
|
1494
|
+
onInput: input,
|
|
1495
|
+
onBlur: ($event) => blur(read, $event),
|
|
1496
|
+
onChange: ($event) => change(read, $event)
|
|
1497
|
+
}), {
|
|
1498
|
+
default: withCtx(() => [
|
|
1499
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1500
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item) => {
|
|
1501
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
1502
|
+
key: item.value,
|
|
1503
|
+
label: item.label,
|
|
1504
|
+
value: item.value
|
|
1505
|
+
}, null, 8, ["label", "value"]);
|
|
1506
|
+
}), 128))
|
|
1507
|
+
])
|
|
1508
|
+
]),
|
|
1509
|
+
_: 2
|
|
1510
|
+
}, 1040, ["modelValue", "onBlur", "onChange"])
|
|
1511
|
+
]),
|
|
1512
|
+
_: 3
|
|
1513
|
+
}, 8, ["write-trigger", "data"]);
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
}));
|
|
1517
|
+
var FuSelectRwSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/read-write-switch/FuSelectRwSwitch.vue"]]);
|
|
1518
|
+
FuReadWriteSwitch.install = (app) => {
|
|
1519
|
+
app.component(FuReadWriteSwitch.name, FuReadWriteSwitch);
|
|
1520
|
+
app.component(FuInputRwSwitch.name, FuInputRwSwitch);
|
|
1521
|
+
app.component(FuSelectRwSwitch.name, FuSelectRwSwitch);
|
|
1522
|
+
};
|
|
1523
|
+
var __glob_1_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1524
|
+
__proto__: null,
|
|
1525
|
+
"default": FuReadWriteSwitch
|
|
1526
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1527
|
+
const _hoisted_1$3 = {
|
|
1528
|
+
key: 0,
|
|
1529
|
+
class: "icon"
|
|
1530
|
+
};
|
|
1531
|
+
const __default__$7 = { name: "FuSplitPane" };
|
|
1532
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$7), {
|
|
1533
|
+
props: {
|
|
1534
|
+
min: {
|
|
1535
|
+
type: [Number, String],
|
|
1536
|
+
default: "10px"
|
|
1537
|
+
},
|
|
1538
|
+
left: [Number, String],
|
|
1539
|
+
right: [Number, String],
|
|
1540
|
+
top: [Number, String],
|
|
1541
|
+
bottom: [Number, String],
|
|
1542
|
+
direction: {
|
|
1543
|
+
validator: (val) => ["vertical", "horizontal"].includes(val),
|
|
1544
|
+
default: "horizontal"
|
|
1545
|
+
},
|
|
1546
|
+
localKey: String,
|
|
1547
|
+
resizable: {
|
|
1548
|
+
type: Boolean,
|
|
1549
|
+
default: true
|
|
1550
|
+
},
|
|
1551
|
+
resizerType: {
|
|
1552
|
+
validator: (val) => ["resizer", "line"].includes(val),
|
|
1553
|
+
default: "resizer"
|
|
1554
|
+
},
|
|
1555
|
+
resizerClass: String,
|
|
1556
|
+
resizerStyle: Object,
|
|
1557
|
+
resizerHoverClass: String
|
|
1558
|
+
},
|
|
1559
|
+
emits: ["changeSplit"],
|
|
1560
|
+
setup(__props, { emit }) {
|
|
1561
|
+
const props = __props;
|
|
1562
|
+
const instance = getCurrentInstance();
|
|
1563
|
+
const active = ref(false);
|
|
1564
|
+
const usedValue = ref(0);
|
|
1565
|
+
const oldValue = ref(0);
|
|
1566
|
+
const initOffset = ref(0);
|
|
1567
|
+
const hover = ref(false);
|
|
1568
|
+
watch(() => props.left, (newValue, oldValue2) => {
|
|
1569
|
+
if (newValue !== oldValue2) {
|
|
1570
|
+
nextTick(() => {
|
|
1571
|
+
usedValue.value = defaultValue.value;
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
}, { immediate: true });
|
|
1575
|
+
watch(() => props.bottom, (newValue, oldValue2) => {
|
|
1576
|
+
if (newValue !== oldValue2) {
|
|
1577
|
+
nextTick(() => {
|
|
1578
|
+
usedValue.value = defaultValue.value;
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
}, { immediate: true });
|
|
1582
|
+
const isReverse = computed(() => {
|
|
1583
|
+
return props.right || props.bottom;
|
|
1584
|
+
});
|
|
1585
|
+
const isHorizontal = computed(() => {
|
|
1586
|
+
return props.direction === "horizontal";
|
|
1587
|
+
});
|
|
1588
|
+
const userSelect = computed(() => {
|
|
1589
|
+
return active.value ? "none" : "";
|
|
1590
|
+
});
|
|
1591
|
+
const cursor = computed(() => {
|
|
1592
|
+
return active.value && props.resizable ? isHorizontal.value ? "col-resize" : "row-resize" : "";
|
|
1593
|
+
});
|
|
1594
|
+
const outerWrapperSize = computed(() => {
|
|
1595
|
+
return instance.refs.outerWrapper[offsetSize.value];
|
|
1596
|
+
});
|
|
1597
|
+
const offsetSize = computed(() => {
|
|
1598
|
+
return isHorizontal.value ? "offsetWidth" : "offsetHeight";
|
|
1599
|
+
});
|
|
1600
|
+
const defaultValue = computed(() => {
|
|
1601
|
+
if (isHorizontal.value) {
|
|
1602
|
+
return props.left ? getMin(percentToValue(props.left)) : props.right && getMin(percentToValue(props.right)) || outerWrapperSize.value / 2;
|
|
1603
|
+
} else {
|
|
1604
|
+
return props.top ? getMin(percentToValue(props.top)) : props.bottom && getMin(percentToValue(props.bottom)) || outerWrapperSize.value / 2;
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
const valueAnother = computed(() => {
|
|
1608
|
+
return `calc(100% - ${usedValue.value}px)`;
|
|
1609
|
+
});
|
|
1610
|
+
const attr = computed(() => {
|
|
1611
|
+
return isHorizontal.value ? "width" : "height";
|
|
1612
|
+
});
|
|
1613
|
+
const resizerAttr = computed(() => {
|
|
1614
|
+
return isHorizontal.value ? isReverse.value ? "right" : "left" : isReverse.value ? "bottom" : "top";
|
|
1615
|
+
});
|
|
1616
|
+
const saveKey = computed(() => {
|
|
1617
|
+
return "Fu-SP-" + props.localKey;
|
|
1618
|
+
});
|
|
1619
|
+
const resizerClasses = computed(() => {
|
|
1620
|
+
const classes = [
|
|
1621
|
+
`fu-split-pane__${props.resizerType}`,
|
|
1622
|
+
`is-${props.direction}`,
|
|
1623
|
+
props.resizable && "is-resizable",
|
|
1624
|
+
props.resizerClass,
|
|
1625
|
+
hover.value && (props.resizerHoverClass || "hover")
|
|
1626
|
+
];
|
|
1627
|
+
return classes;
|
|
1628
|
+
});
|
|
1629
|
+
const padding = computed(() => {
|
|
1630
|
+
return props.resizerType === "resizer" && isHorizontal.value && "3px";
|
|
1631
|
+
});
|
|
1632
|
+
function onMouseDown(e) {
|
|
1633
|
+
initOffset.value = isHorizontal.value ? e.pageX : e.pageY;
|
|
1634
|
+
oldValue.value = usedValue.value;
|
|
1635
|
+
active.value = true;
|
|
1636
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
1637
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
1638
|
+
}
|
|
1639
|
+
function onMouseUp() {
|
|
1640
|
+
active.value = false;
|
|
1641
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
1642
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
1643
|
+
emit("changeSplit", usedValue.value);
|
|
1644
|
+
}
|
|
1645
|
+
function onMouseMove(e) {
|
|
1646
|
+
if (!props.resizable)
|
|
1647
|
+
return;
|
|
1648
|
+
if (active.value) {
|
|
1649
|
+
const currentPage = isHorizontal.value ? e.pageX : e.pageY;
|
|
1650
|
+
const offset = currentPage - initOffset.value;
|
|
1651
|
+
const value = isReverse.value ? oldValue.value - offset : oldValue.value + offset;
|
|
1652
|
+
if (value > percentToValue(props.min) && value < outerWrapperSize.value - percentToValue(props.min)) {
|
|
1653
|
+
usedValue.value = value;
|
|
1654
|
+
writeValue();
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
function percentToValue(val) {
|
|
1659
|
+
const size = instance.refs.outerWrapper[offsetSize.value];
|
|
1660
|
+
if (typeof val === "string" && val.includes("%")) {
|
|
1661
|
+
return parseInt(val) / 100 * size;
|
|
1662
|
+
} else {
|
|
1663
|
+
return parseInt(val);
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
function getMin(val) {
|
|
1667
|
+
return val < percentToValue(props.min) ? percentToValue(props.min) : val;
|
|
1668
|
+
}
|
|
1669
|
+
function writeValue() {
|
|
1670
|
+
const obj = {
|
|
1671
|
+
[resizerAttr.value]: usedValue.value
|
|
1672
|
+
};
|
|
1673
|
+
if (props.localKey) {
|
|
1674
|
+
localStorage.setItem(saveKey.value, JSON.stringify(obj));
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
function readValue() {
|
|
1678
|
+
if (props.localKey) {
|
|
1679
|
+
const local = localStorage.getItem(saveKey.value);
|
|
1680
|
+
if (local && local[resizerAttr.value]) {
|
|
1681
|
+
usedValue.value = parseInt(local) || defaultValue.value;
|
|
1682
|
+
} else {
|
|
1683
|
+
usedValue.value = defaultValue.value;
|
|
1684
|
+
}
|
|
1685
|
+
} else {
|
|
1686
|
+
usedValue.value = defaultValue.value;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
onMounted(() => {
|
|
1690
|
+
readValue();
|
|
1691
|
+
});
|
|
1692
|
+
return (_ctx, _cache) => {
|
|
1693
|
+
const _component_MoreFilled = resolveComponent("MoreFilled");
|
|
1694
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
1695
|
+
return openBlock(), createElementBlock("div", {
|
|
1696
|
+
style: normalizeStyle({ cursor: unref(cursor), userSelect: unref(userSelect) }),
|
|
1697
|
+
class: "fu-split-pane",
|
|
1698
|
+
ref: "outerWrapper"
|
|
1699
|
+
}, [
|
|
1700
|
+
createElementVNode("div", {
|
|
1701
|
+
class: normalizeClass([`is-${__props.direction}`, "fu-split-pane__left"]),
|
|
1702
|
+
style: normalizeStyle({ [unref(attr)]: unref(isReverse) ? unref(valueAnother) : `${usedValue.value}px`, "padding-right": unref(padding) })
|
|
1703
|
+
}, [
|
|
1704
|
+
renderSlot(_ctx.$slots, unref(isHorizontal) ? "left" : "top")
|
|
1705
|
+
], 6),
|
|
1706
|
+
createElementVNode("div", {
|
|
1707
|
+
class: normalizeClass(unref(resizerClasses)),
|
|
1708
|
+
style: normalizeStyle(__spreadValues({ [unref(resizerAttr)]: `${usedValue.value}px` }, __props.resizerStyle)),
|
|
1709
|
+
onMousedown: onMouseDown,
|
|
1710
|
+
onMouseover: _cache[0] || (_cache[0] = ($event) => hover.value = true),
|
|
1711
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => hover.value = false)
|
|
1712
|
+
}, [
|
|
1713
|
+
__props.resizerType === "resizer" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1714
|
+
renderSlot(_ctx.$slots, "resizer", {}, () => [
|
|
1715
|
+
createVNode(_component_el_icon, { size: 10 }, {
|
|
1716
|
+
default: withCtx(() => [
|
|
1717
|
+
createVNode(_component_MoreFilled)
|
|
1718
|
+
]),
|
|
1719
|
+
_: 1
|
|
1720
|
+
})
|
|
1721
|
+
])
|
|
1722
|
+
])) : createCommentVNode("v-if", true)
|
|
1723
|
+
], 38),
|
|
1724
|
+
createElementVNode("div", {
|
|
1725
|
+
class: normalizeClass([`is-${__props.direction}`, "fu-split-pane__right"]),
|
|
1726
|
+
style: normalizeStyle({ [unref(attr)]: unref(isReverse) ? `${usedValue.value}px` : unref(valueAnother), "padding-left": unref(padding) })
|
|
1727
|
+
}, [
|
|
1728
|
+
renderSlot(_ctx.$slots, unref(isHorizontal) ? "right" : "bottom")
|
|
1729
|
+
], 6)
|
|
1730
|
+
], 4);
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
}));
|
|
1734
|
+
var FuSplitPane = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/split-pane/FuSplitPane.vue"]]);
|
|
1735
|
+
FuSplitPane.install = (app) => {
|
|
1736
|
+
app.component(FuSplitPane.name, FuSplitPane);
|
|
1737
|
+
};
|
|
1738
|
+
var __glob_1_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1739
|
+
__proto__: null,
|
|
1740
|
+
"default": FuSplitPane
|
|
1741
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1742
|
+
Object.freeze({});
|
|
1743
|
+
Object.freeze([]);
|
|
1744
|
+
const isArray = Array.isArray;
|
|
1745
|
+
function isFragment(node) {
|
|
1746
|
+
return isVNode(node) && node.type === Fragment;
|
|
1747
|
+
}
|
|
1748
|
+
function isComment(node) {
|
|
1749
|
+
return isVNode(node) && node.type === Comment;
|
|
1750
|
+
}
|
|
1751
|
+
function isValidElementNode(node) {
|
|
1752
|
+
return isVNode(node) && !isFragment(node) && !isComment(node);
|
|
1753
|
+
}
|
|
1754
|
+
function isValidChildren(children) {
|
|
1755
|
+
return Array.isArray(children) ? isValidElementNode(children[0]) : false;
|
|
1756
|
+
}
|
|
1757
|
+
function getChildren(nodes, depth = 5) {
|
|
1758
|
+
let node = isArray(nodes) ? nodes[0] : nodes;
|
|
1759
|
+
if (isFragment(node)) {
|
|
1760
|
+
if (isValidChildren(node.children))
|
|
1761
|
+
return node.children;
|
|
1762
|
+
if (depth > 0) {
|
|
1763
|
+
return getChildren(node.children[0], depth - 1);
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
if (isValidChildren(nodes))
|
|
1767
|
+
return nodes;
|
|
1768
|
+
return [];
|
|
1769
|
+
}
|
|
1770
|
+
const isFix = (node) => {
|
|
1771
|
+
const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
|
|
1772
|
+
const { fix } = node.props;
|
|
1773
|
+
let { type } = node.props;
|
|
1774
|
+
return fix !== void 0 && fix !== false || ["selection", "index", "expand"].includes(type) || includeTag;
|
|
1775
|
+
};
|
|
1776
|
+
const getLabel = (node) => {
|
|
1777
|
+
if (node.props.label)
|
|
1778
|
+
return node.props.label;
|
|
1779
|
+
const prefix = "FU-T-";
|
|
1780
|
+
const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
|
|
1781
|
+
let { label, type } = node.props;
|
|
1782
|
+
if (includeTag)
|
|
1783
|
+
label = prefix + "dropdown";
|
|
1784
|
+
label != null ? label : label = node.props.label;
|
|
1785
|
+
label != null ? label : label = prefix + type;
|
|
1786
|
+
return label;
|
|
1787
|
+
};
|
|
1788
|
+
const FuTableBody = (props, context) => {
|
|
1789
|
+
let slots = context.slots.default();
|
|
1790
|
+
const nodes = [];
|
|
1791
|
+
let { columns } = props;
|
|
1792
|
+
let children = getChildren(slots);
|
|
1793
|
+
if (!children)
|
|
1794
|
+
return nodes;
|
|
1795
|
+
if (!columns || (columns == null ? void 0 : columns.length) === 0)
|
|
1796
|
+
return children;
|
|
1797
|
+
columns.forEach((col) => {
|
|
1798
|
+
if (isArray(children)) {
|
|
1799
|
+
let node = children.find((child) => {
|
|
1800
|
+
return col.label === getLabel(child) && child.type.name !== void 0;
|
|
1801
|
+
});
|
|
1802
|
+
if (node && (isFix(node) || col.show !== false)) {
|
|
1803
|
+
nodes.push(node);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
return nodes;
|
|
1808
|
+
};
|
|
1809
|
+
const LocalKey = Symbol("LocalKey");
|
|
1810
|
+
const __default__$6 = { name: "FuTable" };
|
|
1811
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$6), {
|
|
1812
|
+
props: {
|
|
1813
|
+
columns: Array,
|
|
1814
|
+
refresh: {
|
|
1815
|
+
type: Boolean,
|
|
1816
|
+
default: true
|
|
1817
|
+
},
|
|
1818
|
+
localKey: String
|
|
1819
|
+
},
|
|
1820
|
+
setup(__props) {
|
|
1821
|
+
var _a, _b;
|
|
1822
|
+
const props = __props;
|
|
1823
|
+
const slots = (_b = (_a = useSlots()).default) == null ? void 0 : _b.call(_a);
|
|
1824
|
+
const key = ref(0);
|
|
1825
|
+
const prefix = "FU-T-";
|
|
1826
|
+
const cleanColumns = (columns) => {
|
|
1827
|
+
columns.splice(0, columns.length);
|
|
1828
|
+
};
|
|
1829
|
+
const updateNodes = (nodes) => {
|
|
1830
|
+
nodes.forEach((node) => {
|
|
1831
|
+
if (!node.type.key) {
|
|
1832
|
+
node.type.key = getLabel(node);
|
|
1833
|
+
}
|
|
1834
|
+
});
|
|
1835
|
+
};
|
|
1836
|
+
const initColumns = (nodes, columns) => {
|
|
1837
|
+
nodes.forEach((node) => {
|
|
1838
|
+
const label = getLabel(node);
|
|
1839
|
+
const fix = isFix(node);
|
|
1840
|
+
const { show } = node.props;
|
|
1841
|
+
if (!label && !fix) {
|
|
1842
|
+
throw new Error("unfixed column's label is required.");
|
|
1843
|
+
}
|
|
1844
|
+
columns.push({ label, show, fix });
|
|
1845
|
+
});
|
|
1846
|
+
};
|
|
1847
|
+
const copyColumns = (source, target) => {
|
|
1848
|
+
source.forEach((col) => {
|
|
1849
|
+
target.push(col);
|
|
1850
|
+
});
|
|
1851
|
+
};
|
|
1852
|
+
const updateColumns = (nodes, columns) => {
|
|
1853
|
+
if (columns === void 0)
|
|
1854
|
+
return;
|
|
1855
|
+
if (nodes.length !== columns.length) {
|
|
1856
|
+
cleanColumns(columns);
|
|
1857
|
+
initColumns(nodes, columns);
|
|
1858
|
+
}
|
|
1859
|
+
if (columns.some((col) => col.label === void 0)) {
|
|
1860
|
+
columns.forEach((col, i) => {
|
|
1861
|
+
var _a2;
|
|
1862
|
+
(_a2 = col.label) != null ? _a2 : col.label = getLabel(nodes[i]);
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
const columnsKey = computed(() => {
|
|
1867
|
+
return prefix + props.localKey;
|
|
1868
|
+
});
|
|
1869
|
+
let children;
|
|
1870
|
+
if (slots) {
|
|
1871
|
+
if (isValidChildren(slots)) {
|
|
1872
|
+
children = slots;
|
|
1873
|
+
}
|
|
1874
|
+
children = getChildren(slots);
|
|
1875
|
+
}
|
|
1876
|
+
watch(() => props.columns, () => {
|
|
1877
|
+
if (props.refresh) {
|
|
1878
|
+
key.value++;
|
|
1879
|
+
}
|
|
1880
|
+
if (props.localKey) {
|
|
1881
|
+
localStorage.setItem(columnsKey.value, JSON.stringify(props.columns));
|
|
1882
|
+
}
|
|
1883
|
+
}, { deep: true });
|
|
1884
|
+
onMounted(() => {
|
|
1885
|
+
updateNodes(children);
|
|
1886
|
+
if (!children || !props.columns)
|
|
1887
|
+
return;
|
|
1888
|
+
if (props.localKey) {
|
|
1889
|
+
let str = localStorage.getItem(columnsKey.value);
|
|
1890
|
+
if (str) {
|
|
1891
|
+
try {
|
|
1892
|
+
const columns = JSON.parse(str);
|
|
1893
|
+
cleanColumns(props.columns);
|
|
1894
|
+
copyColumns(columns, props.columns);
|
|
1895
|
+
updateColumns(children, props.columns);
|
|
1896
|
+
return;
|
|
1897
|
+
} catch (e) {
|
|
1898
|
+
console.error("get columns error", e);
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
if (props.columns.length === 0) {
|
|
1903
|
+
initColumns(children, props.columns);
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
provide(LocalKey, props.localKey);
|
|
1907
|
+
onUpdated(() => {
|
|
1908
|
+
updateNodes(children);
|
|
1909
|
+
updateColumns(children, props.columns);
|
|
1910
|
+
});
|
|
1911
|
+
return (_ctx, _cache) => {
|
|
1912
|
+
const _component_el_table = resolveComponent("el-table");
|
|
1913
|
+
return openBlock(), createBlock(_component_el_table, mergeProps({ class: "fu-table" }, _ctx.$attrs, {
|
|
1914
|
+
key: key.value,
|
|
1915
|
+
"header-row-class-name": "fu-table-header"
|
|
1916
|
+
}), {
|
|
1917
|
+
default: withCtx(() => [
|
|
1918
|
+
createVNode(unref(FuTableBody), {
|
|
1919
|
+
name: "table-body",
|
|
1920
|
+
columns: __props.columns
|
|
1921
|
+
}, {
|
|
1922
|
+
default: withCtx(() => [
|
|
1923
|
+
renderSlot(_ctx.$slots, "default")
|
|
1924
|
+
]),
|
|
1925
|
+
_: 3
|
|
1926
|
+
}, 8, ["columns"])
|
|
1927
|
+
]),
|
|
1928
|
+
_: 3
|
|
1929
|
+
}, 16);
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
}));
|
|
1933
|
+
var FuTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/FuTable.vue"]]);
|
|
1934
|
+
const tableColumnSelect = (localKey) => {
|
|
1935
|
+
const columnsKey = computed(() => {
|
|
1936
|
+
return localKey ? "FU-T-" + localKey : "";
|
|
1937
|
+
});
|
|
1938
|
+
function dragstart(event, index) {
|
|
1939
|
+
if (event.dataTransfer) {
|
|
1940
|
+
event.dataTransfer.effectAllowed = "move";
|
|
1941
|
+
event.dataTransfer.setData("source_index", index);
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
function dragenter(event) {
|
|
1945
|
+
event.preventDefault();
|
|
1946
|
+
let target = event.target;
|
|
1947
|
+
if (target) {
|
|
1948
|
+
target.style.opacity = ".2";
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
function dragleave(event) {
|
|
1952
|
+
event.preventDefault();
|
|
1953
|
+
let target = event.target;
|
|
1954
|
+
if (target) {
|
|
1955
|
+
target.style.opacity = "";
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
function dragend(event) {
|
|
1959
|
+
if (event.dataTransfer) {
|
|
1960
|
+
event.dataTransfer.clearData();
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
function drop(event, list, index) {
|
|
1964
|
+
var _a;
|
|
1965
|
+
let target = event.target;
|
|
1966
|
+
let source_index = Number((_a = event.dataTransfer) == null ? void 0 : _a.getData("source_index"));
|
|
1967
|
+
let target_index = index;
|
|
1968
|
+
if (target_index > source_index) {
|
|
1969
|
+
list.splice(target_index + 1, 0, list[source_index]);
|
|
1970
|
+
list.splice(source_index, 1);
|
|
1971
|
+
} else {
|
|
1972
|
+
list.splice(target_index, 0, list[source_index]);
|
|
1973
|
+
list.splice(source_index + 1, 1);
|
|
1974
|
+
}
|
|
1975
|
+
if (target) {
|
|
1976
|
+
target.style.opacity = "";
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
return {
|
|
1980
|
+
columnsKey,
|
|
1981
|
+
dragstart,
|
|
1982
|
+
dragenter,
|
|
1983
|
+
dragleave,
|
|
1984
|
+
dragend,
|
|
1985
|
+
drop
|
|
1986
|
+
};
|
|
1987
|
+
};
|
|
1988
|
+
const _hoisted_1$2 = { style: { "display": "inline-block" } };
|
|
1989
|
+
const _hoisted_2$1 = { class: "fu-table-column-select-popper__body" };
|
|
1990
|
+
const _hoisted_3 = { class: "fu-table-column-select-popper__footer" };
|
|
1991
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1992
|
+
__name: "FuTableColumnSelectPopover",
|
|
1993
|
+
props: {
|
|
1994
|
+
icon: {
|
|
1995
|
+
type: String,
|
|
1996
|
+
default: "Setting"
|
|
1997
|
+
},
|
|
1998
|
+
trigger: {
|
|
1999
|
+
type: String,
|
|
2000
|
+
default: "click",
|
|
2001
|
+
validator: (value) => ["click", "hover"].includes(value)
|
|
2002
|
+
},
|
|
2003
|
+
columns: {
|
|
2004
|
+
type: Array,
|
|
2005
|
+
default: () => []
|
|
2006
|
+
}
|
|
2007
|
+
},
|
|
2008
|
+
setup(__props) {
|
|
2009
|
+
const props = __props;
|
|
2010
|
+
const { t } = useLocale();
|
|
2011
|
+
const localKey = inject(LocalKey, void 0);
|
|
2012
|
+
const {
|
|
2013
|
+
columnsKey,
|
|
2014
|
+
dragstart,
|
|
2015
|
+
dragenter,
|
|
2016
|
+
dragleave,
|
|
2017
|
+
dragend,
|
|
2018
|
+
drop
|
|
2019
|
+
} = tableColumnSelect(localKey);
|
|
2020
|
+
const isFixAll = computed(() => {
|
|
2021
|
+
var _a;
|
|
2022
|
+
return (_a = props.columns) == null ? void 0 : _a.every((c) => {
|
|
2023
|
+
return c.fix;
|
|
2024
|
+
});
|
|
2025
|
+
});
|
|
2026
|
+
const hasSelect = computed(() => {
|
|
2027
|
+
var _a;
|
|
2028
|
+
return ((_a = props.columns) == null ? void 0 : _a.length) > 0 && !isFixAll.value;
|
|
2029
|
+
});
|
|
2030
|
+
function reset() {
|
|
2031
|
+
if (columnsKey) {
|
|
2032
|
+
localStorage.removeItem(columnsKey.value);
|
|
2033
|
+
}
|
|
2034
|
+
props.columns.splice(0, props.columns.length);
|
|
2035
|
+
}
|
|
2036
|
+
return (_ctx, _cache) => {
|
|
2037
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
2038
|
+
const _component_el_button = resolveComponent("el-button");
|
|
2039
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
2040
|
+
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
2041
|
+
createVNode(_component_el_popover, {
|
|
2042
|
+
class: "fu-table-column-select",
|
|
2043
|
+
"popper-class": "fu-table-column-select-popper",
|
|
2044
|
+
trigger: __props.trigger,
|
|
2045
|
+
"show-arrow": false
|
|
2046
|
+
}, {
|
|
2047
|
+
reference: withCtx(() => [
|
|
2048
|
+
createVNode(_component_el_button, {
|
|
2049
|
+
class: "fu-search-bar-button",
|
|
2050
|
+
icon: __props.icon
|
|
2051
|
+
}, {
|
|
2052
|
+
default: withCtx(() => [
|
|
2053
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.custom_table_rows")), 1)
|
|
2054
|
+
]),
|
|
2055
|
+
_: 1
|
|
2056
|
+
}, 8, ["icon"])
|
|
2057
|
+
]),
|
|
2058
|
+
default: withCtx(() => [
|
|
2059
|
+
createElementVNode("h3", null, toDisplayString(unref(t)("fu.table.custom_table_fields")), 1),
|
|
2060
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
2061
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (c, i) => {
|
|
2062
|
+
return openBlock(), createElementBlock("div", {
|
|
2063
|
+
key: i,
|
|
2064
|
+
class: "fu-table-column-select-popper__item"
|
|
2065
|
+
}, [
|
|
2066
|
+
withDirectives(createVNode(_component_el_checkbox, {
|
|
2067
|
+
modelValue: c.show,
|
|
2068
|
+
"onUpdate:modelValue": ($event) => c.show = $event,
|
|
2069
|
+
checked: c.show !== false,
|
|
2070
|
+
draggable: "true",
|
|
2071
|
+
onDragstart: ($event) => unref(dragstart)($event, i),
|
|
2072
|
+
onDragenter: unref(dragenter),
|
|
2073
|
+
onDragleave: unref(dragleave),
|
|
2074
|
+
onDragover: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
2075
|
+
}, ["prevent"])),
|
|
2076
|
+
onDragend: unref(dragend),
|
|
2077
|
+
onDrop: ($event) => unref(drop)($event, __props.columns, i)
|
|
2078
|
+
}, {
|
|
2079
|
+
default: withCtx(() => [
|
|
2080
|
+
createTextVNode(toDisplayString(c.label), 1)
|
|
2081
|
+
]),
|
|
2082
|
+
_: 2
|
|
2083
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "checked", "onDragstart", "onDragenter", "onDragleave", "onDragend", "onDrop"]), [
|
|
2084
|
+
[vShow, !c.fix]
|
|
2085
|
+
])
|
|
2086
|
+
]);
|
|
2087
|
+
}), 128))
|
|
2088
|
+
]),
|
|
2089
|
+
createElementVNode("div", _hoisted_3, [
|
|
2090
|
+
unref(columnsKey) ? (openBlock(), createBlock(_component_el_button, {
|
|
2091
|
+
key: 0,
|
|
2092
|
+
onClick: reset
|
|
2093
|
+
}, {
|
|
2094
|
+
default: withCtx(() => [
|
|
2095
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.reset")), 1)
|
|
2096
|
+
]),
|
|
2097
|
+
_: 1
|
|
2098
|
+
})) : createCommentVNode("v-if", true)
|
|
2099
|
+
])
|
|
2100
|
+
]),
|
|
2101
|
+
_: 1
|
|
2102
|
+
}, 8, ["trigger"])
|
|
2103
|
+
], 512)), [
|
|
2104
|
+
[vShow, unref(hasSelect)]
|
|
2105
|
+
]);
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
var FuTableColumnSelectPopover = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/table-column-select/FuTableColumnSelectPopover.vue"]]);
|
|
2110
|
+
const _hoisted_1$1 = { style: { "display": "inline-block" } };
|
|
2111
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2112
|
+
__name: "FuTableColumnSelectDialog",
|
|
2113
|
+
props: {
|
|
2114
|
+
icon: {
|
|
2115
|
+
type: String,
|
|
2116
|
+
default: "Setting"
|
|
2117
|
+
},
|
|
2118
|
+
columns: {
|
|
2119
|
+
type: Array,
|
|
2120
|
+
default: () => []
|
|
2121
|
+
}
|
|
2122
|
+
},
|
|
2123
|
+
setup(__props) {
|
|
2124
|
+
const props = __props;
|
|
2125
|
+
const localKey = inject(LocalKey, void 0);
|
|
2126
|
+
const { t } = useLocale();
|
|
2127
|
+
const cloneColumn = (source, target) => {
|
|
2128
|
+
source.forEach((col) => {
|
|
2129
|
+
target.push(Object.assign({}, col));
|
|
2130
|
+
});
|
|
2131
|
+
return target;
|
|
2132
|
+
};
|
|
2133
|
+
const {
|
|
2134
|
+
columnsKey,
|
|
2135
|
+
dragstart,
|
|
2136
|
+
dragenter,
|
|
2137
|
+
dragleave,
|
|
2138
|
+
dragend,
|
|
2139
|
+
drop
|
|
2140
|
+
} = tableColumnSelect(localKey);
|
|
2141
|
+
const cloneColumns = ref([]);
|
|
2142
|
+
const visible = ref(false);
|
|
2143
|
+
function open() {
|
|
2144
|
+
cloneColumns.value = [];
|
|
2145
|
+
cloneColumn(props.columns, cloneColumns.value);
|
|
2146
|
+
}
|
|
2147
|
+
function ok() {
|
|
2148
|
+
props.columns.splice(0, props.columns.length);
|
|
2149
|
+
cloneColumns.value.forEach((c) => {
|
|
2150
|
+
props.columns.push(c);
|
|
2151
|
+
});
|
|
2152
|
+
visible.value = false;
|
|
2153
|
+
}
|
|
2154
|
+
function reset() {
|
|
2155
|
+
if (columnsKey.value) {
|
|
2156
|
+
localStorage.removeItem(columnsKey.value);
|
|
2157
|
+
}
|
|
2158
|
+
props.columns.splice(0, props.columns.length);
|
|
2159
|
+
visible.value = false;
|
|
2160
|
+
}
|
|
2161
|
+
return (_ctx, _cache) => {
|
|
2162
|
+
const _component_el_button = resolveComponent("el-button");
|
|
2163
|
+
const _component_el_alert = resolveComponent("el-alert");
|
|
2164
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
2165
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
2166
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
2167
|
+
createVNode(_component_el_button, {
|
|
2168
|
+
class: "fu-search-bar-button",
|
|
2169
|
+
icon: __props.icon,
|
|
2170
|
+
onClick: _cache[0] || (_cache[0] = ($event) => visible.value = true)
|
|
2171
|
+
}, {
|
|
2172
|
+
default: withCtx(() => [
|
|
2173
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.custom_table_rows")), 1)
|
|
2174
|
+
]),
|
|
2175
|
+
_: 1
|
|
2176
|
+
}, 8, ["icon"]),
|
|
2177
|
+
createVNode(_component_el_dialog, {
|
|
2178
|
+
"custom-class": "fu-table-column-select-dialog",
|
|
2179
|
+
modelValue: visible.value,
|
|
2180
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => visible.value = $event),
|
|
2181
|
+
onOpen: open,
|
|
2182
|
+
"append-to-body": ""
|
|
2183
|
+
}, {
|
|
2184
|
+
header: withCtx(() => [
|
|
2185
|
+
createElementVNode("h3", null, toDisplayString(unref(t)("fu.table.custom_table_fields")), 1),
|
|
2186
|
+
createVNode(_component_el_alert, {
|
|
2187
|
+
title: unref(t)("fu.table.custom_table_fields_desc"),
|
|
2188
|
+
type: "info",
|
|
2189
|
+
closable: false
|
|
2190
|
+
}, null, 8, ["title"])
|
|
2191
|
+
]),
|
|
2192
|
+
footer: withCtx(() => [
|
|
2193
|
+
unref(columnsKey) ? (openBlock(), createBlock(_component_el_button, {
|
|
2194
|
+
key: 0,
|
|
2195
|
+
onClick: reset
|
|
2196
|
+
}, {
|
|
2197
|
+
default: withCtx(() => [
|
|
2198
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.reset")), 1)
|
|
2199
|
+
]),
|
|
2200
|
+
_: 1
|
|
2201
|
+
})) : createCommentVNode("v-if", true),
|
|
2202
|
+
createVNode(_component_el_button, {
|
|
2203
|
+
type: "primary",
|
|
2204
|
+
onClick: ok
|
|
2205
|
+
}, {
|
|
2206
|
+
default: withCtx(() => [
|
|
2207
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.ok")), 1)
|
|
2208
|
+
]),
|
|
2209
|
+
_: 1
|
|
2210
|
+
})
|
|
2211
|
+
]),
|
|
2212
|
+
default: withCtx(() => [
|
|
2213
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(cloneColumns), (c, i) => {
|
|
2214
|
+
return withDirectives((openBlock(), createBlock(_component_el_checkbox, {
|
|
2215
|
+
key: i,
|
|
2216
|
+
modelValue: c.show,
|
|
2217
|
+
"onUpdate:modelValue": ($event) => c.show = $event,
|
|
2218
|
+
checked: c.show !== false,
|
|
2219
|
+
draggable: "true",
|
|
2220
|
+
onDragstart: ($event) => unref(dragstart)($event, i),
|
|
2221
|
+
onDragenter: unref(dragenter),
|
|
2222
|
+
onDragleave: unref(dragleave),
|
|
2223
|
+
onDragover: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
2224
|
+
}, ["prevent"])),
|
|
2225
|
+
onDragend: unref(dragend),
|
|
2226
|
+
onDrop: ($event) => unref(drop)($event, unref(cloneColumns), i)
|
|
2227
|
+
}, {
|
|
2228
|
+
default: withCtx(() => [
|
|
2229
|
+
createTextVNode(toDisplayString(c.label), 1)
|
|
2230
|
+
]),
|
|
2231
|
+
_: 2
|
|
2232
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "checked", "onDragstart", "onDragenter", "onDragleave", "onDragend", "onDrop"])), [
|
|
2233
|
+
[vShow, !c.fix]
|
|
2234
|
+
]);
|
|
2235
|
+
}), 128))
|
|
2236
|
+
]),
|
|
2237
|
+
_: 1
|
|
2238
|
+
}, 8, ["modelValue"])
|
|
2239
|
+
]);
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
});
|
|
2243
|
+
var FuTableColumnSelectDialog = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/table-column-select/FuTableColumnSelectDialog.vue"]]);
|
|
2244
|
+
const _sfc_main$6 = defineComponent({
|
|
2245
|
+
name: "FuTableColumnSelect",
|
|
2246
|
+
props: ["type"],
|
|
2247
|
+
setup(props, context) {
|
|
2248
|
+
const { type } = props;
|
|
2249
|
+
return () => {
|
|
2250
|
+
if (type === "dialog") {
|
|
2251
|
+
return h(FuTableColumnSelectDialog, context.attrs, context.slots);
|
|
2252
|
+
} else {
|
|
2253
|
+
return h(FuTableColumnSelectPopover, context.attrs, context.slots);
|
|
2254
|
+
}
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
});
|
|
2258
|
+
var FuTableColumnSelect = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/table-column-select/FuTableColumnSelect.vue"]]);
|
|
2259
|
+
const __default__$5 = { name: "FuTablePagination" };
|
|
2260
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
|
|
2261
|
+
props: {
|
|
2262
|
+
currentPage: {
|
|
2263
|
+
type: Number,
|
|
2264
|
+
default: 1
|
|
2265
|
+
},
|
|
2266
|
+
pageSize: {
|
|
2267
|
+
type: Number,
|
|
2268
|
+
default: 5
|
|
2269
|
+
},
|
|
2270
|
+
pageSizes: {
|
|
2271
|
+
type: Array,
|
|
2272
|
+
default: function() {
|
|
2273
|
+
return [5, 10, 20, 50, 100];
|
|
2274
|
+
}
|
|
2275
|
+
},
|
|
2276
|
+
total: {
|
|
2277
|
+
type: Number,
|
|
2278
|
+
default: 0
|
|
2279
|
+
}
|
|
2280
|
+
},
|
|
2281
|
+
emits: ["size-change", "current-change", "change", "update:pageSize", "update:currentPage"],
|
|
2282
|
+
setup(__props, { emit }) {
|
|
2283
|
+
function handleSizeChange(size) {
|
|
2284
|
+
emit("update:pageSize", size);
|
|
2285
|
+
emit("size-change");
|
|
2286
|
+
emit("change");
|
|
2287
|
+
}
|
|
2288
|
+
function handleCurrentChange(current) {
|
|
2289
|
+
emit("update:currentPage", current);
|
|
2290
|
+
emit("current-change");
|
|
2291
|
+
emit("change");
|
|
2292
|
+
}
|
|
2293
|
+
return (_ctx, _cache) => {
|
|
2294
|
+
const _component_el_pagination = resolveComponent("el-pagination");
|
|
2295
|
+
return openBlock(), createBlock(_component_el_pagination, {
|
|
2296
|
+
onSizeChange: handleSizeChange,
|
|
2297
|
+
onCurrentChange: handleCurrentChange,
|
|
2298
|
+
"current-page": __props.currentPage,
|
|
2299
|
+
"page-sizes": __props.pageSizes,
|
|
2300
|
+
"page-size": __props.pageSize,
|
|
2301
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
2302
|
+
total: __props.total
|
|
2303
|
+
}, null, 8, ["current-page", "page-sizes", "page-size", "total"]);
|
|
2304
|
+
};
|
|
2305
|
+
}
|
|
2306
|
+
}));
|
|
2307
|
+
var FuTablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/FuTablePagination.vue"]]);
|
|
2308
|
+
const __default__$4 = { name: "FuTableButton" };
|
|
2309
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
|
|
2310
|
+
props: {
|
|
2311
|
+
label: String,
|
|
2312
|
+
disabled: Boolean,
|
|
2313
|
+
icon: Boolean
|
|
2314
|
+
},
|
|
2315
|
+
setup(__props) {
|
|
2316
|
+
return (_ctx, _cache) => {
|
|
2317
|
+
const _component_el_button = resolveComponent("el-button");
|
|
2318
|
+
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
2319
|
+
return openBlock(), createBlock(_component_el_tooltip, {
|
|
2320
|
+
content: __props.label,
|
|
2321
|
+
disabled: !__props.icon
|
|
2322
|
+
}, {
|
|
2323
|
+
default: withCtx(() => [
|
|
2324
|
+
createVNode(_component_el_button, mergeProps({ link: "" }, _ctx.$attrs, { disabled: __props.disabled }), {
|
|
2325
|
+
default: withCtx(() => [
|
|
2326
|
+
renderSlot(_ctx.$slots, "default")
|
|
2327
|
+
]),
|
|
2328
|
+
_: 3
|
|
2329
|
+
}, 16, ["disabled"])
|
|
2330
|
+
]),
|
|
2331
|
+
_: 3
|
|
2332
|
+
}, 8, ["content", "disabled"]);
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2335
|
+
}));
|
|
2336
|
+
var FuTableButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/table-operations/FuTableButton.vue"]]);
|
|
2337
|
+
const __default__$3 = { name: "FuTableMoreButton" };
|
|
2338
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
|
|
2339
|
+
props: {
|
|
2340
|
+
row: Object,
|
|
2341
|
+
buttons: {
|
|
2342
|
+
type: Array,
|
|
2343
|
+
required: true
|
|
2344
|
+
},
|
|
2345
|
+
size: {
|
|
2346
|
+
type: String,
|
|
2347
|
+
default: "default"
|
|
2348
|
+
},
|
|
2349
|
+
type: {
|
|
2350
|
+
type: String,
|
|
2351
|
+
default: "label",
|
|
2352
|
+
validator: (value) => ["icon", "label"].includes(value)
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
setup(__props) {
|
|
2356
|
+
const props = __props;
|
|
2357
|
+
const { t } = useLocale();
|
|
2358
|
+
const disabled = computed(() => {
|
|
2359
|
+
return function(btn) {
|
|
2360
|
+
return typeof btn.disabled === "function" ? btn.disabled(props.row) : btn.disabled;
|
|
2361
|
+
};
|
|
2362
|
+
});
|
|
2363
|
+
function handleCommand(btn) {
|
|
2364
|
+
btn.click(props.row);
|
|
2365
|
+
}
|
|
2366
|
+
return (_ctx, _cache) => {
|
|
2367
|
+
const _component_MoreFilled = resolveComponent("MoreFilled");
|
|
2368
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
2369
|
+
const _component_el_button = resolveComponent("el-button");
|
|
2370
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
2371
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
2372
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
2373
|
+
return openBlock(), createBlock(_component_el_dropdown, {
|
|
2374
|
+
onCommand: handleCommand,
|
|
2375
|
+
class: "fu-table-more-button"
|
|
2376
|
+
}, {
|
|
2377
|
+
dropdown: withCtx(() => [
|
|
2378
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
2379
|
+
default: withCtx(() => [
|
|
2380
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.buttons, (btn, i) => {
|
|
2381
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
2382
|
+
key: i,
|
|
2383
|
+
icon: __props.type === "icon" ? btn.icon : "",
|
|
2384
|
+
disabled: unref(disabled)(btn),
|
|
2385
|
+
command: btn
|
|
2386
|
+
}, {
|
|
2387
|
+
default: withCtx(() => [
|
|
2388
|
+
createTextVNode(toDisplayString(btn.label), 1)
|
|
2389
|
+
]),
|
|
2390
|
+
_: 2
|
|
2391
|
+
}, 1032, ["icon", "disabled", "command"]);
|
|
2392
|
+
}), 128))
|
|
2393
|
+
]),
|
|
2394
|
+
_: 1
|
|
2395
|
+
})
|
|
2396
|
+
]),
|
|
2397
|
+
default: withCtx(() => [
|
|
2398
|
+
createVNode(_component_el_button, {
|
|
2399
|
+
link: "",
|
|
2400
|
+
type: "primary",
|
|
2401
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
2402
|
+
}, ["stop"]))
|
|
2403
|
+
}, {
|
|
2404
|
+
default: withCtx(() => [
|
|
2405
|
+
__props.type === "icon" ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
2406
|
+
default: withCtx(() => [
|
|
2407
|
+
createVNode(_component_MoreFilled)
|
|
2408
|
+
]),
|
|
2409
|
+
_: 1
|
|
2410
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2411
|
+
createTextVNode(toDisplayString(unref(t)("fu.table.more")), 1)
|
|
2412
|
+
], 64))
|
|
2413
|
+
]),
|
|
2414
|
+
_: 1
|
|
2415
|
+
})
|
|
2416
|
+
]),
|
|
2417
|
+
_: 1
|
|
2418
|
+
});
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
}));
|
|
2422
|
+
var FuTableMoreButton = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/table-operations/FuTableMoreButton.vue"]]);
|
|
2423
|
+
const __default__$2 = { name: "FuTableOperations" };
|
|
2424
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
2425
|
+
props: {
|
|
2426
|
+
align: {
|
|
2427
|
+
type: String,
|
|
2428
|
+
default: "center"
|
|
2429
|
+
},
|
|
2430
|
+
width: [String, Number],
|
|
2431
|
+
minWidth: [String, Number],
|
|
2432
|
+
ellipsis: {
|
|
2433
|
+
type: Number,
|
|
2434
|
+
default: 2
|
|
2435
|
+
},
|
|
2436
|
+
buttons: {
|
|
2437
|
+
type: Array,
|
|
2438
|
+
required: true
|
|
2439
|
+
},
|
|
2440
|
+
type: {
|
|
2441
|
+
type: String,
|
|
2442
|
+
default: "label",
|
|
2443
|
+
validator: (value) => ["icon", "label"].includes(value)
|
|
2444
|
+
}
|
|
2445
|
+
},
|
|
2446
|
+
setup(__props) {
|
|
2447
|
+
const props = __props;
|
|
2448
|
+
const hasShowFunc = computed(() => {
|
|
2449
|
+
return props.buttons.some((btn) => typeof btn.show === "function");
|
|
2450
|
+
});
|
|
2451
|
+
const defaultButtons = computed(() => {
|
|
2452
|
+
return function(row) {
|
|
2453
|
+
return hasMore(row) ? showButtons(row).slice(0, props.ellipsis) : showButtons(row);
|
|
2454
|
+
};
|
|
2455
|
+
});
|
|
2456
|
+
const moreButtons = computed(() => {
|
|
2457
|
+
return function(row) {
|
|
2458
|
+
return hasMore(row) ? showButtons(row).slice(props.ellipsis) : [];
|
|
2459
|
+
};
|
|
2460
|
+
});
|
|
2461
|
+
const computeWidth = computed(() => {
|
|
2462
|
+
let length = hasShowFunc.value ? props.ellipsis : defaultButtons.value.length;
|
|
2463
|
+
let buttonsWidth = 35 + length * 58 + 58;
|
|
2464
|
+
if (props.minWidth) {
|
|
2465
|
+
buttonsWidth = buttonsWidth < props.minWidth ? props.minWidth : buttonsWidth;
|
|
2466
|
+
}
|
|
2467
|
+
return props.width ? props.width : buttonsWidth;
|
|
2468
|
+
});
|
|
2469
|
+
const disableButton = computed(() => {
|
|
2470
|
+
return function(btn, row) {
|
|
2471
|
+
return typeof btn.disabled === "function" ? btn.disabled(row) : btn.disabled;
|
|
2472
|
+
};
|
|
2473
|
+
});
|
|
2474
|
+
function showButtons(row) {
|
|
2475
|
+
var _a;
|
|
2476
|
+
return (_a = props.buttons) == null ? void 0 : _a.filter((btn) => typeof btn.show === "function" ? btn.show(row) !== false : btn.show !== false);
|
|
2477
|
+
}
|
|
2478
|
+
function hasMore(row) {
|
|
2479
|
+
var _a;
|
|
2480
|
+
return ((_a = showButtons(row)) == null ? void 0 : _a.length) > props.ellipsis + 1;
|
|
2481
|
+
}
|
|
2482
|
+
return (_ctx, _cache) => {
|
|
2483
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
2484
|
+
const _component_el_table_column = resolveComponent("el-table-column");
|
|
2485
|
+
return openBlock(), createBlock(_component_el_table_column, mergeProps({
|
|
2486
|
+
"class-name": "fu-table-operations",
|
|
2487
|
+
align: __props.align,
|
|
2488
|
+
width: unref(computeWidth)
|
|
2489
|
+
}, _ctx.$attrs), {
|
|
2490
|
+
header: withCtx(() => [
|
|
2491
|
+
createTextVNode(toDisplayString(_ctx.$attrs.label), 1)
|
|
2492
|
+
]),
|
|
2493
|
+
default: withCtx(({ row }) => [
|
|
2494
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(defaultButtons)(row), (btn, i) => {
|
|
2495
|
+
return openBlock(), createBlock(FuTableButton, {
|
|
2496
|
+
icon: __props.type === "icon",
|
|
2497
|
+
key: i,
|
|
2498
|
+
onClick: withModifiers(($event) => btn.click(row), ["stop"]),
|
|
2499
|
+
disabled: unref(disableButton)(btn, row),
|
|
2500
|
+
label: btn.label,
|
|
2501
|
+
type: btn.type || "primary",
|
|
2502
|
+
link: ""
|
|
2503
|
+
}, {
|
|
2504
|
+
default: withCtx(() => [
|
|
2505
|
+
__props.type === "icon" ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
2506
|
+
default: withCtx(() => [
|
|
2507
|
+
(openBlock(), createBlock(resolveDynamicComponent(btn.icon)))
|
|
2508
|
+
]),
|
|
2509
|
+
_: 2
|
|
2510
|
+
}, 1024)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2511
|
+
createTextVNode(toDisplayString(btn.label), 1)
|
|
2512
|
+
], 64))
|
|
2513
|
+
]),
|
|
2514
|
+
_: 2
|
|
2515
|
+
}, 1032, ["icon", "onClick", "disabled", "label", "type"]);
|
|
2516
|
+
}), 128)),
|
|
2517
|
+
unref(moreButtons)(row).length > 0 ? (openBlock(), createBlock(FuTableMoreButton, {
|
|
2518
|
+
key: 0,
|
|
2519
|
+
type: __props.type,
|
|
2520
|
+
buttons: unref(moreButtons)(row),
|
|
2521
|
+
row
|
|
2522
|
+
}, null, 8, ["type", "buttons", "row"])) : createCommentVNode("v-if", true)
|
|
2523
|
+
]),
|
|
2524
|
+
_: 1
|
|
2525
|
+
}, 16, ["align", "width"]);
|
|
2526
|
+
};
|
|
2527
|
+
}
|
|
2528
|
+
}));
|
|
2529
|
+
var FuTableOperations = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/table-operations/FuTableOperations.vue"]]);
|
|
2530
|
+
const _hoisted_1 = { class: "fu-dropdown-link" };
|
|
2531
|
+
const _hoisted_2 = {
|
|
2532
|
+
key: 0,
|
|
2533
|
+
class: "fu-table-column-dropdown__title"
|
|
2534
|
+
};
|
|
2535
|
+
const __default__$1 = { name: "FuTableColumnDropdown" };
|
|
2536
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
2537
|
+
props: {
|
|
2538
|
+
showType: {
|
|
2539
|
+
type: String,
|
|
2540
|
+
default: "always",
|
|
2541
|
+
validator: (value) => ["always", "hover", "selected"].includes(value)
|
|
2542
|
+
},
|
|
2543
|
+
menus: {
|
|
2544
|
+
type: Array,
|
|
2545
|
+
default: () => []
|
|
2546
|
+
},
|
|
2547
|
+
title: String,
|
|
2548
|
+
trigger: {
|
|
2549
|
+
type: String,
|
|
2550
|
+
default: "click"
|
|
2551
|
+
},
|
|
2552
|
+
width: {
|
|
2553
|
+
type: String,
|
|
2554
|
+
default: "40"
|
|
2555
|
+
}
|
|
2556
|
+
},
|
|
2557
|
+
setup(__props, { expose }) {
|
|
2558
|
+
const props = __props;
|
|
2559
|
+
const instance = getCurrentInstance();
|
|
2560
|
+
const isShow = computed(() => {
|
|
2561
|
+
return function(row) {
|
|
2562
|
+
var _a, _b, _c;
|
|
2563
|
+
if (props.showType === "selected") {
|
|
2564
|
+
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();
|
|
2565
|
+
return selection.includes(row) && true;
|
|
2566
|
+
} else {
|
|
2567
|
+
return true;
|
|
2568
|
+
}
|
|
2569
|
+
};
|
|
2570
|
+
});
|
|
2571
|
+
const disabled = computed(() => {
|
|
2572
|
+
return function(item, row) {
|
|
2573
|
+
return typeof item.disabled === "function" ? item.disabled(row) : item.disabled;
|
|
2574
|
+
};
|
|
2575
|
+
});
|
|
2576
|
+
function handleCommand({ item, row }) {
|
|
2577
|
+
item.click(row);
|
|
2578
|
+
}
|
|
2579
|
+
function composeValue(item, row) {
|
|
2580
|
+
return {
|
|
2581
|
+
item,
|
|
2582
|
+
row
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
function show(index) {
|
|
2586
|
+
instance.refs[`dropdown${index}`].handleOpen();
|
|
2587
|
+
}
|
|
2588
|
+
function hide(index) {
|
|
2589
|
+
instance.refs[`dropdown${index}`].handleClose();
|
|
2590
|
+
}
|
|
2591
|
+
expose({
|
|
2592
|
+
show,
|
|
2593
|
+
hide
|
|
2594
|
+
});
|
|
2595
|
+
return (_ctx, _cache) => {
|
|
2596
|
+
const _component_MoreFilled = resolveComponent("MoreFilled");
|
|
2597
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
2598
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
2599
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
2600
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
2601
|
+
const _component_el_table_column = resolveComponent("el-table-column");
|
|
2602
|
+
return openBlock(), createBlock(_component_el_table_column, mergeProps({
|
|
2603
|
+
"class-name": "fu-table-column-dropdown",
|
|
2604
|
+
width: __props.width,
|
|
2605
|
+
resizable: false,
|
|
2606
|
+
align: "center"
|
|
2607
|
+
}, _ctx.$attrs), {
|
|
2608
|
+
default: withCtx((scope) => [
|
|
2609
|
+
unref(isShow)(scope.row) ? (openBlock(), createBlock(_component_el_dropdown, {
|
|
2610
|
+
key: 0,
|
|
2611
|
+
onCommand: handleCommand,
|
|
2612
|
+
trigger: __props.trigger,
|
|
2613
|
+
class: normalizeClass(__props.showType === "hover" ? "fu-show-icon" : ""),
|
|
2614
|
+
placement: "bottom",
|
|
2615
|
+
ref: `dropdown${scope.$index}`
|
|
2616
|
+
}, {
|
|
2617
|
+
dropdown: withCtx(() => [
|
|
2618
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
2619
|
+
default: withCtx(() => [
|
|
2620
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
2621
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.title), 1)) : createCommentVNode("v-if", true)
|
|
2622
|
+
]),
|
|
2623
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)), () => [
|
|
2624
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.menus, (item, i) => {
|
|
2625
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
2626
|
+
key: i,
|
|
2627
|
+
icon: item.icon,
|
|
2628
|
+
disabled: unref(disabled)(item, scope.row),
|
|
2629
|
+
divided: item.divided,
|
|
2630
|
+
command: composeValue(item, scope.row)
|
|
2631
|
+
}, {
|
|
2632
|
+
default: withCtx(() => [
|
|
2633
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
2634
|
+
]),
|
|
2635
|
+
_: 2
|
|
2636
|
+
}, 1032, ["icon", "disabled", "divided", "command"]);
|
|
2637
|
+
}), 128))
|
|
2638
|
+
])
|
|
2639
|
+
]),
|
|
2640
|
+
_: 2
|
|
2641
|
+
}, 1024)
|
|
2642
|
+
]),
|
|
2643
|
+
default: withCtx(() => [
|
|
2644
|
+
createElementVNode("span", _hoisted_1, [
|
|
2645
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
2646
|
+
createVNode(_component_el_icon, { class: "fu-icon-more" }, {
|
|
2647
|
+
default: withCtx(() => [
|
|
2648
|
+
createVNode(_component_MoreFilled)
|
|
2649
|
+
]),
|
|
2650
|
+
_: 1
|
|
2651
|
+
})
|
|
2652
|
+
])
|
|
2653
|
+
])
|
|
2654
|
+
]),
|
|
2655
|
+
_: 2
|
|
2656
|
+
}, 1032, ["trigger", "class"])) : createCommentVNode("v-if", true)
|
|
2657
|
+
]),
|
|
2658
|
+
_: 3
|
|
2659
|
+
}, 16, ["width"]);
|
|
2660
|
+
};
|
|
2661
|
+
}
|
|
2662
|
+
}));
|
|
2663
|
+
var FuTableColumnDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/table/FuTableColumnDropdown.vue"]]);
|
|
2664
|
+
FuTable.install = (app) => {
|
|
2665
|
+
app.component(FuTable.name, FuTable);
|
|
2666
|
+
app.component(FuTablePagination.name, FuTablePagination);
|
|
2667
|
+
app.component(FuTableColumnSelect.name, FuTableColumnSelect);
|
|
2668
|
+
app.component(FuTableColumnDropdown.name, FuTableColumnDropdown);
|
|
2669
|
+
app.component(FuTableOperations.name, FuTableOperations);
|
|
2670
|
+
app.component(FuTableButton.name, FuTableButton);
|
|
2671
|
+
app.component(FuTableMoreButton.name, FuTableMoreButton);
|
|
2672
|
+
};
|
|
2673
|
+
var __glob_1_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2674
|
+
__proto__: null,
|
|
2675
|
+
"default": FuTable
|
|
2676
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2677
|
+
const __default__ = { name: "FuTabs" };
|
|
2678
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
2679
|
+
props: {
|
|
2680
|
+
addType: {
|
|
2681
|
+
type: String,
|
|
2682
|
+
default: "default",
|
|
2683
|
+
validator: (val) => ["default", "dropdown"].includes(val)
|
|
2684
|
+
},
|
|
2685
|
+
dropdownMenus: {
|
|
2686
|
+
type: Array,
|
|
2687
|
+
default: () => []
|
|
2688
|
+
},
|
|
2689
|
+
addTrigger: {
|
|
2690
|
+
type: String,
|
|
2691
|
+
default: "hover",
|
|
2692
|
+
validator: (val) => ["hover", "click"].includes(val)
|
|
2693
|
+
},
|
|
2694
|
+
addIcon: {
|
|
2695
|
+
type: String,
|
|
2696
|
+
default: "Plus"
|
|
2697
|
+
},
|
|
2698
|
+
addButtonLabel: String,
|
|
2699
|
+
addable: Boolean
|
|
2700
|
+
},
|
|
2701
|
+
emits: ["command"],
|
|
2702
|
+
setup(__props, { emit }) {
|
|
2703
|
+
const props = __props;
|
|
2704
|
+
function handleCommand(e) {
|
|
2705
|
+
const name2 = uuid();
|
|
2706
|
+
let obj = null;
|
|
2707
|
+
if (e) {
|
|
2708
|
+
obj = props.dropdownMenus.find((item) => item.command === e);
|
|
2709
|
+
}
|
|
2710
|
+
emit("command", name2, obj);
|
|
2711
|
+
}
|
|
2712
|
+
function beforeLeave(currentName, oldName) {
|
|
2713
|
+
if (currentName === "add") {
|
|
2714
|
+
return false;
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
return (_ctx, _cache) => {
|
|
2718
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
2719
|
+
const _component_el_button = resolveComponent("el-button");
|
|
2720
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
2721
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
2722
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
2723
|
+
const _component_el_tab_pane = resolveComponent("el-tab-pane");
|
|
2724
|
+
const _component_el_tabs = resolveComponent("el-tabs");
|
|
2725
|
+
return openBlock(), createBlock(_component_el_tabs, mergeProps({
|
|
2726
|
+
class: "fu-tabs",
|
|
2727
|
+
"before-leave": beforeLeave,
|
|
2728
|
+
editable: false,
|
|
2729
|
+
addable: false
|
|
2730
|
+
}, _ctx.$attrs), {
|
|
2731
|
+
default: withCtx(() => [
|
|
2732
|
+
renderSlot(_ctx.$slots, "default"),
|
|
2733
|
+
__props.addable ? (openBlock(), createBlock(_component_el_tab_pane, {
|
|
2734
|
+
name: "add",
|
|
2735
|
+
key: "add"
|
|
2736
|
+
}, {
|
|
2737
|
+
label: withCtx(() => [
|
|
2738
|
+
renderSlot(_ctx.$slots, "add", {}, () => [
|
|
2739
|
+
createCommentVNode(" \u4E0B\u62C9\u65B9\u5F0F "),
|
|
2740
|
+
__props.addType === "dropdown" ? (openBlock(), createBlock(_component_el_dropdown, {
|
|
2741
|
+
key: 0,
|
|
2742
|
+
onCommand: handleCommand,
|
|
2743
|
+
trigger: __props.addTrigger
|
|
2744
|
+
}, {
|
|
2745
|
+
dropdown: withCtx(() => [
|
|
2746
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
2747
|
+
default: withCtx(() => [
|
|
2748
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dropdownMenus, (item, i) => {
|
|
2749
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
2750
|
+
key: i,
|
|
2751
|
+
icon: item.icon,
|
|
2752
|
+
disabled: item.disabled,
|
|
2753
|
+
divided: item.divided,
|
|
2754
|
+
command: item.command
|
|
2755
|
+
}, {
|
|
2756
|
+
default: withCtx(() => [
|
|
2757
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
2758
|
+
]),
|
|
2759
|
+
_: 2
|
|
2760
|
+
}, 1032, ["icon", "disabled", "divided", "command"]);
|
|
2761
|
+
}), 128))
|
|
2762
|
+
]),
|
|
2763
|
+
_: 1
|
|
2764
|
+
})
|
|
2765
|
+
]),
|
|
2766
|
+
default: withCtx(() => [
|
|
2767
|
+
renderSlot(_ctx.$slots, "dropdownButton", {}, () => [
|
|
2768
|
+
createVNode(_component_el_button, {
|
|
2769
|
+
type: "primary",
|
|
2770
|
+
plain: ""
|
|
2771
|
+
}, {
|
|
2772
|
+
default: withCtx(() => [
|
|
2773
|
+
createVNode(_component_el_icon, null, {
|
|
2774
|
+
default: withCtx(() => [
|
|
2775
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.addIcon)))
|
|
2776
|
+
]),
|
|
2777
|
+
_: 1
|
|
2778
|
+
}),
|
|
2779
|
+
__props.addButtonLabel ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2780
|
+
createTextVNode(toDisplayString(__props.addButtonLabel), 1)
|
|
2781
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
2782
|
+
]),
|
|
2783
|
+
_: 1
|
|
2784
|
+
})
|
|
2785
|
+
])
|
|
2786
|
+
]),
|
|
2787
|
+
_: 3
|
|
2788
|
+
}, 8, ["trigger"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2789
|
+
createCommentVNode(" \u9ED8\u8BA4 "),
|
|
2790
|
+
createVNode(_component_el_button, {
|
|
2791
|
+
onClick: handleCommand,
|
|
2792
|
+
type: "primary",
|
|
2793
|
+
plain: ""
|
|
2794
|
+
}, {
|
|
2795
|
+
default: withCtx(() => [
|
|
2796
|
+
createVNode(_component_el_icon, null, {
|
|
2797
|
+
default: withCtx(() => [
|
|
2798
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.addIcon)))
|
|
2799
|
+
]),
|
|
2800
|
+
_: 1
|
|
2801
|
+
}),
|
|
2802
|
+
__props.addButtonLabel ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2803
|
+
createTextVNode(toDisplayString(__props.addButtonLabel), 1)
|
|
2804
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
2805
|
+
]),
|
|
2806
|
+
_: 1
|
|
2807
|
+
})
|
|
2808
|
+
], 2112))
|
|
2809
|
+
])
|
|
2810
|
+
]),
|
|
2811
|
+
_: 3
|
|
2812
|
+
})) : createCommentVNode("v-if", true)
|
|
2813
|
+
]),
|
|
2814
|
+
_: 3
|
|
2815
|
+
}, 16);
|
|
2816
|
+
};
|
|
2817
|
+
}
|
|
2818
|
+
}));
|
|
2819
|
+
var FuTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/wangdan/\u5DE5\u4F5C/fit2cloud-ui-plus/src/components/tabs/FuTabs.vue"]]);
|
|
2820
|
+
FuTabs.install = (app) => {
|
|
2821
|
+
app.component(FuTabs.name, FuTabs);
|
|
2822
|
+
};
|
|
2823
|
+
var __glob_1_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2824
|
+
__proto__: null,
|
|
2825
|
+
"default": FuTabs
|
|
2826
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2827
|
+
const name = "fit2cloud-ui-plus";
|
|
2828
|
+
const version = "0.0.1-beta.9";
|
|
2829
|
+
const main = "./lib/fit2cloud-ui-plus.es.js";
|
|
2830
|
+
const files = [
|
|
2831
|
+
"lib",
|
|
2832
|
+
"src"
|
|
2833
|
+
];
|
|
2834
|
+
const author = "fit2cloud";
|
|
2835
|
+
const license = "GPL-3.0 License";
|
|
2836
|
+
const repository = {
|
|
2837
|
+
type: "git",
|
|
2838
|
+
url: "git+https://github.com/fit2cloud-ui/fit2cloud-ui-plus.git"
|
|
2839
|
+
};
|
|
2840
|
+
const scripts = {
|
|
2841
|
+
dev: "vite",
|
|
2842
|
+
build: "vite build",
|
|
2843
|
+
"build-lib": "vite build --mode lib",
|
|
2844
|
+
preview: "vite preview"
|
|
2845
|
+
};
|
|
2846
|
+
const dependencies = {
|
|
2847
|
+
"@element-plus/icons-vue": "^1.1.4",
|
|
2848
|
+
"element-plus": "^2.2.2",
|
|
2849
|
+
"github-markdown-css": "^5.1.0",
|
|
2850
|
+
"prism-theme-vars": "^0.2.3",
|
|
2851
|
+
prismjs: "^1.28.0",
|
|
2852
|
+
"vite-plugin-markdown": "^2.0.2",
|
|
2853
|
+
vue: "^3.2.37",
|
|
2854
|
+
"vue-clipboard3": "^2.0.0",
|
|
2855
|
+
"vue-router": "^4.0.14"
|
|
2856
|
+
};
|
|
2857
|
+
const devDependencies = {
|
|
2858
|
+
"@types/node": "^17.0.29",
|
|
2859
|
+
"@vitejs/plugin-vue": "^2.3.1",
|
|
2860
|
+
sass: "^1.51.0",
|
|
2861
|
+
"sass-loader": "^12.6.0",
|
|
2862
|
+
typescript: "^4.5.4",
|
|
2863
|
+
"unplugin-vue-define-options": "^0.6.1",
|
|
2864
|
+
vite: "^2.9.5",
|
|
2865
|
+
"vue-tsc": "^0.34.7"
|
|
2866
|
+
};
|
|
2867
|
+
var PackageJSON = {
|
|
2868
|
+
name,
|
|
2869
|
+
version,
|
|
2870
|
+
"private": false,
|
|
2871
|
+
main,
|
|
2872
|
+
files,
|
|
2873
|
+
author,
|
|
2874
|
+
license,
|
|
2875
|
+
repository,
|
|
2876
|
+
scripts,
|
|
2877
|
+
dependencies,
|
|
2878
|
+
devDependencies
|
|
2879
|
+
};
|
|
2880
|
+
const components = { "./components/filter-bar/index.ts": __glob_1_0, "./components/read-write-switch/index.ts": __glob_1_1, "./components/split-pane/index.ts": __glob_1_2, "./components/table/index.ts": __glob_1_3, "./components/tabs/index.ts": __glob_1_4 };
|
|
2881
|
+
const install = (app) => {
|
|
2882
|
+
Object.keys(components).forEach((key) => {
|
|
2883
|
+
let component = components[key].default;
|
|
2884
|
+
app.use(component);
|
|
2885
|
+
});
|
|
2886
|
+
};
|
|
2887
|
+
const plugin = {
|
|
2888
|
+
name: "Fit2CloudUIPlus",
|
|
2889
|
+
version: PackageJSON.version,
|
|
2890
|
+
install
|
|
2891
|
+
};
|
|
2892
|
+
export { plugin as default };
|