yc-pro-components 0.0.53 → 0.0.57
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/es/components/breadcrumb/index.d.ts +1 -1
- package/es/components/breadcrumb/src/index.vue.d.ts +1 -1
- package/es/components/check-card/index.d.ts +1 -1
- package/es/components/check-card-group/index.d.ts +2 -1
- package/es/components/check-card-group/src/index.vue.d.ts +1 -1
- package/es/components/descriptions/index.d.ts +2 -1
- package/es/components/dialog-form/index.d.ts +2 -1
- package/es/components/display-item/index.d.ts +2 -1
- package/es/components/drawer-form/index.d.ts +2 -1
- package/es/components/form/index.d.ts +2 -1
- package/es/components/form/src/form-content.vue.d.ts +2 -2
- package/es/components/form-item/index.d.ts +2 -1
- package/es/components/header/index.d.ts +1 -1
- package/es/components/input-tag/index.d.ts +1 -1
- package/es/components/layout/index.d.ts +2 -1
- package/es/components/page/index.d.ts +2 -1
- package/es/components/pagination/index.d.ts +1 -1
- package/es/components/radio/index.d.ts +1 -1
- package/es/components/render/index.d.ts +2 -1
- package/es/components/search/index.d.ts +2 -1
- package/es/components/sidebar/index.d.ts +1 -1
- package/es/components/steps-form/index.d.ts +2 -1
- package/es/components/table/index.d.ts +2 -1
- package/es/components/virtual-table/index.d.ts +2 -1
- package/es/components/yc-drawer/store.d.ts +1 -1
- package/es/components/yc-plus-page/src/filter-strategies.d.ts +22 -0
- package/es/components/yc-plus-page/src/filter-strategies.mjs +189 -0
- package/es/components/yc-plus-page/src/filter-utils.d.ts +37 -0
- package/es/components/yc-plus-page/src/filter-utils.mjs +27 -0
- package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +2 -0
- package/es/components/yc-plus-page/src/header-filter-cell.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/header-filter-cell.vue2.mjs +136 -65
- package/es/components/yc-plus-page/src/index.vue.d.ts +2 -1
- package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/index.vue2.mjs +15 -4
- package/es/components/yc-plus-page/src/type.d.ts +8 -0
- package/es/components/yc-plus-page/src/use-header-filter.mjs +17 -4
- package/es/components/yc-select-v2/src/index.vue2.mjs +4 -2
- package/es/components/yc-select-v2/src/type.d.ts +2 -0
- package/es/directives/dist/fn-perm.mjs +2 -2
- package/es/hooks/useGetOptions.mjs +56 -34
- package/es/hooks/usePlusFormReset.d.ts +2 -1
- package/es/index.css +13 -12
- package/es/index.d.ts +1 -0
- package/es/index.mjs +1 -0
- package/es/types/table.d.ts +2 -3
- package/es/utils/dist/permission.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/yc-components/index.d.ts +1 -0
- package/es/yc-components/version.d.ts +1 -1
- package/index.css +15 -12
- package/index.js +445 -117
- package/index.min.css +3 -2
- package/index.min.js +11 -11
- package/index.min.mjs +11 -11
- package/index.mjs +444 -118
- package/lib/components/breadcrumb/index.d.ts +1 -1
- package/lib/components/breadcrumb/src/index.vue.d.ts +1 -1
- package/lib/components/check-card/index.d.ts +1 -1
- package/lib/components/check-card-group/index.d.ts +2 -1
- package/lib/components/check-card-group/src/index.vue.d.ts +1 -1
- package/lib/components/descriptions/index.d.ts +2 -1
- package/lib/components/dialog-form/index.d.ts +2 -1
- package/lib/components/display-item/index.d.ts +2 -1
- package/lib/components/drawer-form/index.d.ts +2 -1
- package/lib/components/form/index.d.ts +2 -1
- package/lib/components/form/src/form-content.vue.d.ts +2 -2
- package/lib/components/form-item/index.d.ts +2 -1
- package/lib/components/header/index.d.ts +1 -1
- package/lib/components/input-tag/index.d.ts +1 -1
- package/lib/components/layout/index.d.ts +2 -1
- package/lib/components/page/index.d.ts +2 -1
- package/lib/components/pagination/index.d.ts +1 -1
- package/lib/components/radio/index.d.ts +1 -1
- package/lib/components/render/index.d.ts +2 -1
- package/lib/components/search/index.d.ts +2 -1
- package/lib/components/sidebar/index.d.ts +1 -1
- package/lib/components/steps-form/index.d.ts +2 -1
- package/lib/components/table/index.d.ts +2 -1
- package/lib/components/virtual-table/index.d.ts +2 -1
- package/lib/components/yc-drawer/store.d.ts +1 -1
- package/lib/components/yc-plus-page/src/filter-strategies.d.ts +22 -0
- package/lib/components/yc-plus-page/src/filter-strategies.js +193 -0
- package/lib/components/yc-plus-page/src/filter-utils.d.ts +37 -0
- package/lib/components/yc-plus-page/src/filter-utils.js +36 -0
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +2 -0
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.js +1 -1
- package/lib/components/yc-plus-page/src/header-filter-cell.vue2.js +135 -64
- package/lib/components/yc-plus-page/src/index.vue.d.ts +2 -1
- package/lib/components/yc-plus-page/src/index.vue.js +1 -1
- package/lib/components/yc-plus-page/src/index.vue2.js +15 -4
- package/lib/components/yc-plus-page/src/type.d.ts +8 -0
- package/lib/components/yc-plus-page/src/use-header-filter.js +17 -4
- package/lib/components/yc-select-v2/src/index.vue2.js +4 -2
- package/lib/components/yc-select-v2/src/type.d.ts +2 -0
- package/lib/hooks/useGetOptions.js +55 -33
- package/lib/hooks/usePlusFormReset.d.ts +2 -1
- package/lib/index.css +14 -13
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/types/table.d.ts +2 -3
- package/lib/utils/dist/permission.js +3 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/yc-components/index.d.ts +1 -0
- package/lib/yc-components/version.d.ts +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.57 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
|
|
@@ -4833,8 +4833,16 @@
|
|
|
4833
4833
|
const options = vue.ref([]);
|
|
4834
4834
|
const optionsIsReady = vue.ref(false);
|
|
4835
4835
|
const injectedDictStore = vue.inject(DictStoreInjectionKey, null);
|
|
4836
|
-
const hasValidOptions =
|
|
4837
|
-
|
|
4836
|
+
const hasValidOptions = () => {
|
|
4837
|
+
const o = props.options;
|
|
4838
|
+
if (!o) return false;
|
|
4839
|
+
if (vue.isRef(o)) return true;
|
|
4840
|
+
if (isPromise(o)) return true;
|
|
4841
|
+
if (isFunction(o)) return true;
|
|
4842
|
+
if (isArray(o)) return o.length > 0;
|
|
4843
|
+
return false;
|
|
4844
|
+
};
|
|
4845
|
+
if (hasValidOptions()) {
|
|
4838
4846
|
handleOptions();
|
|
4839
4847
|
} else if (props.autoDict) {
|
|
4840
4848
|
handleAutoDict();
|
|
@@ -4842,28 +4850,43 @@
|
|
|
4842
4850
|
options.value = [];
|
|
4843
4851
|
optionsIsReady.value = true;
|
|
4844
4852
|
}
|
|
4853
|
+
function getOptionsResolvedSnapshot() {
|
|
4854
|
+
const o = props.options;
|
|
4855
|
+
if (!o) return [];
|
|
4856
|
+
if (isPromise(o)) return [];
|
|
4857
|
+
if (vue.isRef(o)) {
|
|
4858
|
+
const val = o.value;
|
|
4859
|
+
return val || [];
|
|
4860
|
+
}
|
|
4861
|
+
if (isFunction(o)) {
|
|
4862
|
+
const result = o(props);
|
|
4863
|
+
if (isPromise(result)) return [];
|
|
4864
|
+
return result || [];
|
|
4865
|
+
}
|
|
4866
|
+
if (isArray(o)) return o;
|
|
4867
|
+
if (vue.isReactive(o)) {
|
|
4868
|
+
return o || [];
|
|
4869
|
+
}
|
|
4870
|
+
return [];
|
|
4871
|
+
}
|
|
4845
4872
|
function handleOptions() {
|
|
4846
4873
|
if (!props.options) {
|
|
4847
4874
|
options.value = [];
|
|
4848
4875
|
optionsIsReady.value = true;
|
|
4849
4876
|
return;
|
|
4850
4877
|
}
|
|
4851
|
-
if (
|
|
4852
|
-
|
|
4853
|
-
(
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
);
|
|
4864
|
-
} else if (isFunction(props.options)) {
|
|
4865
|
-
const getValue = props.options;
|
|
4866
|
-
const result = getValue(props);
|
|
4878
|
+
if (isPromise(props.options)) {
|
|
4879
|
+
props.options.then((value) => {
|
|
4880
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
4881
|
+
optionsIsReady.value = true;
|
|
4882
|
+
throwError(options.value);
|
|
4883
|
+
}).catch((err) => {
|
|
4884
|
+
throw err;
|
|
4885
|
+
});
|
|
4886
|
+
return;
|
|
4887
|
+
}
|
|
4888
|
+
if (isFunction(props.options)) {
|
|
4889
|
+
const result = props.options(props);
|
|
4867
4890
|
if (isPromise(result)) {
|
|
4868
4891
|
result.then((value) => {
|
|
4869
4892
|
options.value = getOptionsByOptionsMap(value, props);
|
|
@@ -4872,23 +4895,22 @@
|
|
|
4872
4895
|
}).catch((err) => {
|
|
4873
4896
|
throw err;
|
|
4874
4897
|
});
|
|
4875
|
-
|
|
4876
|
-
options.value = getOptionsByOptionsMap(result, props);
|
|
4877
|
-
optionsIsReady.value = true;
|
|
4898
|
+
return;
|
|
4878
4899
|
}
|
|
4879
|
-
} else if (isPromise(props.options)) {
|
|
4880
|
-
const getValue = props.options;
|
|
4881
|
-
getValue.then((value) => {
|
|
4882
|
-
options.value = getOptionsByOptionsMap(value, props);
|
|
4883
|
-
optionsIsReady.value = true;
|
|
4884
|
-
throwError(options.value);
|
|
4885
|
-
}).catch((err) => {
|
|
4886
|
-
throw err;
|
|
4887
|
-
});
|
|
4888
|
-
} else {
|
|
4889
|
-
optionsIsReady.value = true;
|
|
4890
|
-
throwError(props.options);
|
|
4891
4900
|
}
|
|
4901
|
+
if (vue.isRef(props.options) || vue.isReactive(props.options) || isArray(props.options) || isFunction(props.options)) {
|
|
4902
|
+
vue.watch(
|
|
4903
|
+
() => getOptionsResolvedSnapshot(),
|
|
4904
|
+
(val) => {
|
|
4905
|
+
options.value = getOptionsByOptionsMap(val, props);
|
|
4906
|
+
optionsIsReady.value = true;
|
|
4907
|
+
},
|
|
4908
|
+
{ immediate: true, deep: true }
|
|
4909
|
+
);
|
|
4910
|
+
return;
|
|
4911
|
+
}
|
|
4912
|
+
optionsIsReady.value = true;
|
|
4913
|
+
throwError(props.options);
|
|
4892
4914
|
}
|
|
4893
4915
|
function handleAutoDict() {
|
|
4894
4916
|
if (isFunction(props.autoDict)) {
|
|
@@ -18342,7 +18364,7 @@
|
|
|
18342
18364
|
key: 0,
|
|
18343
18365
|
class: "plus-table-checkbox-handle"
|
|
18344
18366
|
};
|
|
18345
|
-
const _hoisted_8$
|
|
18367
|
+
const _hoisted_8$4 = { key: 1 };
|
|
18346
18368
|
const _hoisted_9$4 = { key: 1 };
|
|
18347
18369
|
var _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
18348
18370
|
...{
|
|
@@ -18725,7 +18747,7 @@
|
|
|
18725
18747
|
/* DYNAMIC */
|
|
18726
18748
|
}, 1032, ["content"])) : (vue.openBlock(), vue.createElementBlock(
|
|
18727
18749
|
"span",
|
|
18728
|
-
_hoisted_8$
|
|
18750
|
+
_hoisted_8$4,
|
|
18729
18751
|
vue.toDisplayString(item.label ? getLabelValue(item.label) : ""),
|
|
18730
18752
|
1
|
|
18731
18753
|
/* TEXT */
|
|
@@ -22030,7 +22052,7 @@
|
|
|
22030
22052
|
const _hoisted_5$8 = { class: "plus-header__right" };
|
|
22031
22053
|
const _hoisted_6$6 = { class: "plus-header__dropdown-area" };
|
|
22032
22054
|
const _hoisted_7$5 = ["src"];
|
|
22033
|
-
const _hoisted_8$
|
|
22055
|
+
const _hoisted_8$3 = { class: "plus-header__username" };
|
|
22034
22056
|
const _hoisted_9$3 = {
|
|
22035
22057
|
key: 0,
|
|
22036
22058
|
class: "plus-header-placeholder"
|
|
@@ -22185,7 +22207,7 @@
|
|
|
22185
22207
|
vue.createCommentVNode(" username "),
|
|
22186
22208
|
vue.createElementVNode(
|
|
22187
22209
|
"p",
|
|
22188
|
-
_hoisted_8$
|
|
22210
|
+
_hoisted_8$3,
|
|
22189
22211
|
vue.toDisplayString(_ctx.userInfo.username || "admin"),
|
|
22190
22212
|
1
|
|
22191
22213
|
/* TEXT */
|
|
@@ -31944,7 +31966,7 @@
|
|
|
31944
31966
|
|
|
31945
31967
|
const l=(n,t)=>{const o=n;return o.install=s=>{const e=n.name||n.__name;s.component(e,n),t&&s.component(t,n);},o};
|
|
31946
31968
|
|
|
31947
|
-
const
|
|
31969
|
+
const i="userPermissions",c=()=>{try{const r=localStorage.getItem(i);if(!r)return new Set;const s=JSON.parse(r);if(!Array.isArray(s))return new Set;const e=new Set;for(const t of s)if(Array.isArray(t.functions))for(const o of t.functions)o.functionCode&&e.add(o.functionCode);return e}catch{return new Set}},n=(r,s="some")=>{if(!r)return !1;const e=c();return e.size===0?!1:typeof r=="string"?e.has(r):Array.isArray(r)&&r.length>0?s==="every"?r.every(t=>e.has(t)):r.some(t=>e.has(t)):!1},a=()=>({hasPermission:(r,s="some")=>n(r,s)});
|
|
31948
31970
|
|
|
31949
31971
|
const YC_CONFIG_KEY = Symbol("ycConfig");
|
|
31950
31972
|
const DEFAULT_CDN_CONFIG = {
|
|
@@ -32202,11 +32224,11 @@
|
|
|
32202
32224
|
const isEnabled = vue.computed(() => {
|
|
32203
32225
|
const hideHeaderFilter = getHideHeaderFilter();
|
|
32204
32226
|
const headerFilterConfig = getHeaderFilterConfig();
|
|
32205
|
-
if (hideHeaderFilter === true) return false;
|
|
32206
|
-
if (typeof headerFilterConfig === "boolean") return headerFilterConfig;
|
|
32207
32227
|
if (headerFilterConfig && typeof headerFilterConfig === "object") {
|
|
32208
32228
|
return headerFilterConfig.enabled !== false;
|
|
32209
32229
|
}
|
|
32230
|
+
if (typeof headerFilterConfig === "boolean") return headerFilterConfig;
|
|
32231
|
+
if (hideHeaderFilter === true) return false;
|
|
32210
32232
|
return false;
|
|
32211
32233
|
});
|
|
32212
32234
|
const operatorCatalogState = vue.computed(() => {
|
|
@@ -32317,21 +32339,34 @@
|
|
|
32317
32339
|
}
|
|
32318
32340
|
};
|
|
32319
32341
|
const getMergedQuery = (baseQuery) => {
|
|
32342
|
+
const normalizeFilters = (filters) => {
|
|
32343
|
+
return filters.map((f) => {
|
|
32344
|
+
if (f.op === "in" && typeof f.value === "string" && f.value) {
|
|
32345
|
+
const arr = f.value.split(",").filter(Boolean).map((s) => {
|
|
32346
|
+
const n = Number(s);
|
|
32347
|
+
return Number.isNaN(n) ? s : n;
|
|
32348
|
+
});
|
|
32349
|
+
return { ...f, value: arr };
|
|
32350
|
+
}
|
|
32351
|
+
return f;
|
|
32352
|
+
});
|
|
32353
|
+
};
|
|
32320
32354
|
let mergedFilters = baseQuery.filters;
|
|
32321
32355
|
if (headerFiltersState.filters.length > 0) {
|
|
32356
|
+
const normalized = normalizeFilters(headerFiltersState.filters);
|
|
32322
32357
|
const baseFilters = baseQuery.filters;
|
|
32323
32358
|
if (baseFilters && typeof baseFilters === "object" && Array.isArray(baseFilters.filters)) {
|
|
32324
32359
|
mergedFilters = {
|
|
32325
32360
|
logic: baseFilters.logic || "and",
|
|
32326
32361
|
filters: [
|
|
32327
32362
|
...baseFilters.filters,
|
|
32328
|
-
...
|
|
32363
|
+
...normalized
|
|
32329
32364
|
]
|
|
32330
32365
|
};
|
|
32331
32366
|
} else {
|
|
32332
32367
|
mergedFilters = {
|
|
32333
32368
|
logic: headerFiltersState.logic,
|
|
32334
|
-
filters: [...
|
|
32369
|
+
filters: [...normalized]
|
|
32335
32370
|
};
|
|
32336
32371
|
}
|
|
32337
32372
|
}
|
|
@@ -32359,10 +32394,219 @@
|
|
|
32359
32394
|
};
|
|
32360
32395
|
}
|
|
32361
32396
|
|
|
32397
|
+
const FILTER_FIELD_STYLE = "margin-top: 4px; width: 100%";
|
|
32398
|
+
const FILTER_INNER_DROPDOWN_CLASS = "yc-header-filter-inner-dropdown";
|
|
32399
|
+
const isRangeType = (type) => type === "daterange" || type === "monthrange" || type === "datetimerange" || type === "yearrange";
|
|
32400
|
+
const toArrayValue = (val) => typeof val === "string" && val ? val.split(",") : void 0;
|
|
32401
|
+
const fromArrayValue = (v) => Array.isArray(v) ? v.join(",") : String(v != null ? v : "");
|
|
32402
|
+
const parseTypedValue = (val, isMultiple) => {
|
|
32403
|
+
if (!val) return isMultiple ? [] : "";
|
|
32404
|
+
if (!isMultiple) return val;
|
|
32405
|
+
return val.split(",").filter(Boolean).map((s) => {
|
|
32406
|
+
const n = Number(s);
|
|
32407
|
+
return Number.isNaN(n) ? s : n;
|
|
32408
|
+
});
|
|
32409
|
+
};
|
|
32410
|
+
const mergePopperClass = (userClass, builtinClass) => {
|
|
32411
|
+
const parts = [FILTER_INNER_DROPDOWN_CLASS];
|
|
32412
|
+
if (builtinClass) parts.push(builtinClass);
|
|
32413
|
+
if (userClass) parts.push(userClass);
|
|
32414
|
+
return parts.join(" ");
|
|
32415
|
+
};
|
|
32416
|
+
const resolveFilterOptions = (resolvedOptions, headerFilterOptions) => {
|
|
32417
|
+
if (resolvedOptions && resolvedOptions.length > 0) return resolvedOptions;
|
|
32418
|
+
if (!headerFilterOptions) return [];
|
|
32419
|
+
const unwrapped = typeof headerFilterOptions.value !== "undefined" ? headerFilterOptions.value : headerFilterOptions;
|
|
32420
|
+
return Array.isArray(unwrapped) ? unwrapped : [];
|
|
32421
|
+
};
|
|
32422
|
+
|
|
32423
|
+
const VALUE_TYPE_MAP = {
|
|
32424
|
+
select: "select",
|
|
32425
|
+
checkbox: "checkbox",
|
|
32426
|
+
radio: "select",
|
|
32427
|
+
"date-picker": "date-picker",
|
|
32428
|
+
"datetime-picker": "date-picker",
|
|
32429
|
+
datetime: "date-picker",
|
|
32430
|
+
"time-picker": "time-picker",
|
|
32431
|
+
"time-select": "time-select",
|
|
32432
|
+
"tree-select": "tree-select",
|
|
32433
|
+
cascader: "cascader"
|
|
32434
|
+
};
|
|
32435
|
+
const resolveInteractionType = (customType, fieldConfig, valueType) => {
|
|
32436
|
+
if (customType) return customType;
|
|
32437
|
+
if (fieldConfig) {
|
|
32438
|
+
if (fieldConfig.type === "date") return "date-picker";
|
|
32439
|
+
if (fieldConfig.dictField === true) return "select";
|
|
32440
|
+
}
|
|
32441
|
+
return VALUE_TYPE_MAP[valueType] || void 0;
|
|
32442
|
+
};
|
|
32443
|
+
const FILTER_COMPONENT_STRATEGIES = {
|
|
32444
|
+
"time-picker": {
|
|
32445
|
+
render: ({ fp, inputVal, setInputVal }) => {
|
|
32446
|
+
var _a, _b;
|
|
32447
|
+
return vue.h(elementPlus.ElTimePicker, {
|
|
32448
|
+
...fp,
|
|
32449
|
+
format: (_a = fp == null ? void 0 : fp.format) != null ? _a : "HH:mm:ss",
|
|
32450
|
+
valueFormat: (_b = fp == null ? void 0 : fp.valueFormat) != null ? _b : "HH:mm:ss",
|
|
32451
|
+
modelValue: inputVal,
|
|
32452
|
+
"onUpdate:modelValue": (v) => setInputVal(String(v != null ? v : "")),
|
|
32453
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32454
|
+
style: FILTER_FIELD_STYLE
|
|
32455
|
+
});
|
|
32456
|
+
}
|
|
32457
|
+
},
|
|
32458
|
+
"time-select": {
|
|
32459
|
+
render: ({ fp, inputVal, setInputVal }) => vue.h(elementPlus.ElTimeSelect, {
|
|
32460
|
+
...fp,
|
|
32461
|
+
modelValue: inputVal,
|
|
32462
|
+
"onUpdate:modelValue": (v) => {
|
|
32463
|
+
const raw = String(v != null ? v : "");
|
|
32464
|
+
setInputVal(raw && /^\d{2}:\d{2}$/.test(raw) ? `${raw}:00` : raw);
|
|
32465
|
+
},
|
|
32466
|
+
style: FILTER_FIELD_STYLE
|
|
32467
|
+
})
|
|
32468
|
+
},
|
|
32469
|
+
"date-picker": {
|
|
32470
|
+
render: ({ fp, inputVal, setInputVal }) => {
|
|
32471
|
+
var _a;
|
|
32472
|
+
const range = isRangeType(fp.type);
|
|
32473
|
+
return vue.h(elementPlus.ElDatePicker, {
|
|
32474
|
+
...fp,
|
|
32475
|
+
valueFormat: (_a = fp == null ? void 0 : fp.valueFormat) != null ? _a : "YYYY-MM-DD HH:mm:ss",
|
|
32476
|
+
modelValue: range ? toArrayValue(inputVal) : inputVal,
|
|
32477
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32478
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32479
|
+
style: FILTER_FIELD_STYLE
|
|
32480
|
+
});
|
|
32481
|
+
}
|
|
32482
|
+
},
|
|
32483
|
+
checkbox: {
|
|
32484
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32485
|
+
const parsedValue = toArrayValue(inputVal) || [];
|
|
32486
|
+
const allVals = options.map((o) => o.value);
|
|
32487
|
+
const selectedSet = new Set(parsedValue);
|
|
32488
|
+
const checkAll = options.length > 0 && parsedValue.length === options.length;
|
|
32489
|
+
const isIndeterminate = parsedValue.length > 0 && parsedValue.length < options.length;
|
|
32490
|
+
const handleCheckAllChange = (val) => {
|
|
32491
|
+
setInputVal(val ? options.map((opt) => opt.value).join(",") : "");
|
|
32492
|
+
};
|
|
32493
|
+
const handleInvert = () => {
|
|
32494
|
+
if (!options.length) return;
|
|
32495
|
+
const inverted = allVals.filter((v) => !selectedSet.has(v));
|
|
32496
|
+
setInputVal(inverted.join(","));
|
|
32497
|
+
};
|
|
32498
|
+
const showCheckAll = fp.showCheckAll !== false;
|
|
32499
|
+
const showInvert = fp.showInvert !== false;
|
|
32500
|
+
const checkAllText = fp.checkAllText || "\u5168\u9009";
|
|
32501
|
+
return vue.h("div", { class: "header-filter-checkbox-group", style: "max-height: 250px; overflow-y: auto; padding: 4px;" }, [
|
|
32502
|
+
showCheckAll && options.length > 0 ? vue.h("div", { style: "display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--el-border-color-lighter);" }, [
|
|
32503
|
+
vue.h(elementPlus.ElCheckbox, {
|
|
32504
|
+
modelValue: checkAll,
|
|
32505
|
+
indeterminate: isIndeterminate,
|
|
32506
|
+
"onUpdate:modelValue": handleCheckAllChange,
|
|
32507
|
+
style: "font-weight: bold; flex: 1; min-width: 0;"
|
|
32508
|
+
}, () => checkAllText),
|
|
32509
|
+
showInvert ? vue.h(
|
|
32510
|
+
elementPlus.ElButton,
|
|
32511
|
+
{
|
|
32512
|
+
link: true,
|
|
32513
|
+
type: "primary",
|
|
32514
|
+
size: "small",
|
|
32515
|
+
onClick: handleInvert
|
|
32516
|
+
},
|
|
32517
|
+
() => "\u53CD\u9009"
|
|
32518
|
+
) : null
|
|
32519
|
+
]) : null,
|
|
32520
|
+
vue.h(elementPlus.ElCheckboxGroup, {
|
|
32521
|
+
...fp,
|
|
32522
|
+
modelValue: parsedValue,
|
|
32523
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32524
|
+
style: "display: flex; flex-direction: column;"
|
|
32525
|
+
}, {
|
|
32526
|
+
default: () => options.map(
|
|
32527
|
+
(opt) => vue.h(
|
|
32528
|
+
elementPlus.ElCheckbox,
|
|
32529
|
+
{
|
|
32530
|
+
value: opt.value,
|
|
32531
|
+
label: opt.value,
|
|
32532
|
+
style: "margin-bottom: 4px; height: auto;"
|
|
32533
|
+
},
|
|
32534
|
+
() => opt.label
|
|
32535
|
+
)
|
|
32536
|
+
)
|
|
32537
|
+
})
|
|
32538
|
+
]);
|
|
32539
|
+
}
|
|
32540
|
+
},
|
|
32541
|
+
"tree-select": {
|
|
32542
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32543
|
+
const isMultiple = !!fp.multiple;
|
|
32544
|
+
const treeData = options && options.length > 0 ? options : fp.data || [];
|
|
32545
|
+
return vue.h(elementPlus.ElTreeSelect, {
|
|
32546
|
+
...fp,
|
|
32547
|
+
modelValue: parseTypedValue(inputVal, isMultiple),
|
|
32548
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32549
|
+
data: treeData,
|
|
32550
|
+
popperClass: mergePopperClass(fp.popperClass, "yc-header-filter-tree-popper"),
|
|
32551
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
32552
|
+
style: FILTER_FIELD_STYLE
|
|
32553
|
+
});
|
|
32554
|
+
}
|
|
32555
|
+
},
|
|
32556
|
+
cascader: {
|
|
32557
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32558
|
+
const cascaderProps = fp.props || {};
|
|
32559
|
+
const isMultiple = !!cascaderProps.multiple;
|
|
32560
|
+
let parsedValue = inputVal;
|
|
32561
|
+
if (isMultiple && typeof inputVal === "string" && inputVal && !cascaderProps.emitPath) {
|
|
32562
|
+
parsedValue = inputVal.split(",");
|
|
32563
|
+
}
|
|
32564
|
+
return vue.h(elementPlus.ElCascader, {
|
|
32565
|
+
...fp,
|
|
32566
|
+
modelValue: parsedValue,
|
|
32567
|
+
"onUpdate:modelValue": (v) => {
|
|
32568
|
+
let flat = v;
|
|
32569
|
+
if (Array.isArray(v) && v.length && Array.isArray(v[0])) {
|
|
32570
|
+
flat = v.map((arr) => Array.isArray(arr) ? arr[arr.length - 1] : arr);
|
|
32571
|
+
}
|
|
32572
|
+
setInputVal(fromArrayValue(flat));
|
|
32573
|
+
},
|
|
32574
|
+
options,
|
|
32575
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32576
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
32577
|
+
style: FILTER_FIELD_STYLE
|
|
32578
|
+
});
|
|
32579
|
+
}
|
|
32580
|
+
},
|
|
32581
|
+
select: {
|
|
32582
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32583
|
+
const isMultiple = !!fp.multiple;
|
|
32584
|
+
return vue.h(
|
|
32585
|
+
elementPlus.ElSelect,
|
|
32586
|
+
{
|
|
32587
|
+
...fp,
|
|
32588
|
+
modelValue: parseTypedValue(inputVal, isMultiple),
|
|
32589
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32590
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32591
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
32592
|
+
style: FILTER_FIELD_STYLE
|
|
32593
|
+
},
|
|
32594
|
+
{
|
|
32595
|
+
default: () => options.map(
|
|
32596
|
+
(opt) => vue.h(elementPlus.ElOption, {
|
|
32597
|
+
label: opt.label,
|
|
32598
|
+
value: opt.value
|
|
32599
|
+
})
|
|
32600
|
+
)
|
|
32601
|
+
}
|
|
32602
|
+
);
|
|
32603
|
+
}
|
|
32604
|
+
}
|
|
32605
|
+
};
|
|
32606
|
+
|
|
32362
32607
|
const _hoisted_1$9 = { class: "yc-header-filter-cell__label-text" };
|
|
32363
32608
|
const _hoisted_2$8 = { class: "yc-header-filter-cell__label-text" };
|
|
32364
|
-
const _hoisted_3$8 = {
|
|
32365
|
-
const _hoisted_4$6 = {
|
|
32609
|
+
const _hoisted_3$8 = {
|
|
32366
32610
|
class: "yc-header-filter-cell__content",
|
|
32367
32611
|
style: {
|
|
32368
32612
|
display: "flex",
|
|
@@ -32372,10 +32616,13 @@
|
|
|
32372
32616
|
gap: "4px"
|
|
32373
32617
|
}
|
|
32374
32618
|
};
|
|
32375
|
-
const
|
|
32376
|
-
|
|
32377
|
-
|
|
32378
|
-
|
|
32619
|
+
const _hoisted_4$6 = {
|
|
32620
|
+
key: 0,
|
|
32621
|
+
class: "yc-header-filter-cell__operators"
|
|
32622
|
+
};
|
|
32623
|
+
const _hoisted_5$6 = ["onClick"];
|
|
32624
|
+
const _hoisted_6$5 = { key: 0 };
|
|
32625
|
+
const _hoisted_7$4 = {
|
|
32379
32626
|
class: "yc-header-filter-cell__actions",
|
|
32380
32627
|
style: {
|
|
32381
32628
|
display: "flex",
|
|
@@ -32395,6 +32642,7 @@
|
|
|
32395
32642
|
filters: { default: () => [] },
|
|
32396
32643
|
orderBy: { default: () => [] },
|
|
32397
32644
|
disableFilter: { type: Boolean, default: false },
|
|
32645
|
+
fieldConfig: {},
|
|
32398
32646
|
referenceRenderer: { type: Function, default: void 0 }
|
|
32399
32647
|
},
|
|
32400
32648
|
emits: ["confirm", "reset", "sortChange"],
|
|
@@ -32426,6 +32674,12 @@
|
|
|
32426
32674
|
var _a;
|
|
32427
32675
|
return String(((_a = props.column) == null ? void 0 : _a.prop) || "");
|
|
32428
32676
|
});
|
|
32677
|
+
const getHeaderFilterObject = () => {
|
|
32678
|
+
var _a;
|
|
32679
|
+
const hf = (_a = props.column) == null ? void 0 : _a.headerFilter;
|
|
32680
|
+
if (hf && typeof hf === "object") return hf;
|
|
32681
|
+
return {};
|
|
32682
|
+
};
|
|
32429
32683
|
const isActive = vue.computed(() => {
|
|
32430
32684
|
var _a, _b;
|
|
32431
32685
|
const field = fieldRef.value;
|
|
@@ -32443,35 +32697,48 @@
|
|
|
32443
32697
|
return (_a = props.orderBy) == null ? void 0 : _a.some((i) => i.field === fieldRef.value && i.direction === "desc");
|
|
32444
32698
|
}
|
|
32445
32699
|
);
|
|
32446
|
-
const
|
|
32700
|
+
const onDocPointerDown = (e) => {
|
|
32701
|
+
var _a;
|
|
32447
32702
|
if (!popVisible.value) return;
|
|
32448
32703
|
const target = e.target;
|
|
32449
|
-
|
|
32450
|
-
if (
|
|
32704
|
+
if (!target) return;
|
|
32705
|
+
if ((_a = wrapperElRef.value) == null ? void 0 : _a.contains(target)) return;
|
|
32706
|
+
if (target.closest(".yc-header-filter-pop")) return;
|
|
32707
|
+
const popoverTrigger = target.closest("[aria-describedby]");
|
|
32708
|
+
if (popoverTrigger) return;
|
|
32709
|
+
if (target.closest(`.${FILTER_INNER_DROPDOWN_CLASS}`)) return;
|
|
32451
32710
|
popVisible.value = false;
|
|
32452
32711
|
};
|
|
32453
32712
|
vue.onMounted(() => {
|
|
32454
|
-
window.addEventListener("pointerdown",
|
|
32455
|
-
window.addEventListener("click", onDocPointerOrClick, true);
|
|
32713
|
+
window.addEventListener("pointerdown", onDocPointerDown, true);
|
|
32456
32714
|
});
|
|
32457
32715
|
vue.onBeforeUnmount(() => {
|
|
32458
|
-
window.removeEventListener("pointerdown",
|
|
32459
|
-
window.removeEventListener("click", onDocPointerOrClick, true);
|
|
32716
|
+
window.removeEventListener("pointerdown", onDocPointerDown, true);
|
|
32460
32717
|
});
|
|
32461
32718
|
const handleSelect = (op) => {
|
|
32462
32719
|
state.selectedOp = op.code;
|
|
32463
32720
|
};
|
|
32464
32721
|
const handleReset = () => {
|
|
32465
32722
|
state.inputVal = "";
|
|
32466
|
-
|
|
32723
|
+
const payload = { column: props.column, op: state.selectedOp };
|
|
32724
|
+
const customConfig = getHeaderFilterObject();
|
|
32725
|
+
if (customConfig.onReset) {
|
|
32726
|
+
customConfig.onReset(payload);
|
|
32727
|
+
}
|
|
32728
|
+
emit("reset", payload);
|
|
32467
32729
|
popVisible.value = false;
|
|
32468
32730
|
};
|
|
32469
32731
|
const handleConfirm = () => {
|
|
32470
|
-
|
|
32732
|
+
const payload = {
|
|
32471
32733
|
column: props.column,
|
|
32472
32734
|
op: state.selectedOp,
|
|
32473
32735
|
value: state.inputVal
|
|
32474
|
-
}
|
|
32736
|
+
};
|
|
32737
|
+
const customConfig = getHeaderFilterObject();
|
|
32738
|
+
if (customConfig.onConfirm) {
|
|
32739
|
+
customConfig.onConfirm(payload);
|
|
32740
|
+
}
|
|
32741
|
+
emit("confirm", payload);
|
|
32475
32742
|
popVisible.value = false;
|
|
32476
32743
|
};
|
|
32477
32744
|
const cycleSort = () => {
|
|
@@ -32503,51 +32770,95 @@
|
|
|
32503
32770
|
var _a;
|
|
32504
32771
|
return (_a = props.column) == null ? void 0 : _a.tooltip;
|
|
32505
32772
|
});
|
|
32506
|
-
const
|
|
32507
|
-
|
|
32508
|
-
|
|
32773
|
+
const optionsSourceProps = vue.computed(() => {
|
|
32774
|
+
const config = getHeaderFilterObject();
|
|
32775
|
+
const col = props.column;
|
|
32776
|
+
return {
|
|
32777
|
+
options: config.options !== void 0 ? config.options : col.options,
|
|
32778
|
+
autoDict: col.autoDict,
|
|
32779
|
+
optionsMap: col.optionsMap,
|
|
32780
|
+
prop: col.prop,
|
|
32781
|
+
valueType: col.valueType
|
|
32782
|
+
};
|
|
32783
|
+
});
|
|
32784
|
+
const { customOptions: resolvedOptions } = useGetOptions(optionsSourceProps);
|
|
32785
|
+
const fieldPropsForFilter = vue.computed(
|
|
32786
|
+
() => {
|
|
32787
|
+
var _a;
|
|
32788
|
+
return ((_a = props.column) == null ? void 0 : _a.fieldProps) || {};
|
|
32789
|
+
}
|
|
32790
|
+
);
|
|
32791
|
+
const resolvedInteractionType = vue.computed(() => {
|
|
32792
|
+
var _a;
|
|
32793
|
+
const customConfig = getHeaderFilterObject();
|
|
32509
32794
|
const vt = String(((_a = props.column) == null ? void 0 : _a.valueType) || "").toLowerCase();
|
|
32510
|
-
|
|
32511
|
-
|
|
32512
|
-
|
|
32513
|
-
|
|
32514
|
-
|
|
32515
|
-
|
|
32516
|
-
|
|
32517
|
-
|
|
32518
|
-
|
|
32519
|
-
|
|
32795
|
+
return resolveInteractionType(customConfig.type, props.fieldConfig, vt);
|
|
32796
|
+
});
|
|
32797
|
+
const hideOperatorList = vue.computed(() => {
|
|
32798
|
+
var _a;
|
|
32799
|
+
const t = resolvedInteractionType.value;
|
|
32800
|
+
const customConfig = getHeaderFilterObject();
|
|
32801
|
+
const mult = (_a = customConfig.props) == null ? void 0 : _a.multiple;
|
|
32802
|
+
if (t === "checkbox") return true;
|
|
32803
|
+
if (t === "date-picker") return true;
|
|
32804
|
+
if (t === "select" && mult) return true;
|
|
32805
|
+
if (t === "tree-select" && mult) return true;
|
|
32806
|
+
return false;
|
|
32807
|
+
});
|
|
32808
|
+
const popoverWidth = vue.computed(() => hideOperatorList.value ? 320 : 220);
|
|
32809
|
+
vue.watch(popVisible, (visible) => {
|
|
32810
|
+
var _a, _b;
|
|
32811
|
+
if (!visible) return;
|
|
32812
|
+
const t = resolvedInteractionType.value;
|
|
32813
|
+
const customConfig = getHeaderFilterObject();
|
|
32814
|
+
const fp = {
|
|
32815
|
+
...fieldPropsForFilter.value,
|
|
32816
|
+
...customConfig.props || {}
|
|
32817
|
+
};
|
|
32818
|
+
if (t === "date-picker" && isRangeType(fp.type)) {
|
|
32819
|
+
if (state.selectedOp !== "between") state.selectedOp = "between";
|
|
32820
|
+
if (!state.inputVal) {
|
|
32821
|
+
const now = /* @__PURE__ */ new Date();
|
|
32822
|
+
const y = now.getFullYear();
|
|
32823
|
+
const m = String(now.getMonth() + 1).padStart(2, "0");
|
|
32824
|
+
state.inputVal = `${y}-${m},${y}-${m}`;
|
|
32825
|
+
}
|
|
32826
|
+
} else if (t === "checkbox" || t === "select" && ((_a = customConfig.props) == null ? void 0 : _a.multiple) || t === "tree-select" && ((_b = customConfig.props) == null ? void 0 : _b.multiple)) {
|
|
32827
|
+
if (state.selectedOp !== "in") state.selectedOp = "in";
|
|
32520
32828
|
}
|
|
32521
|
-
|
|
32522
|
-
|
|
32523
|
-
|
|
32524
|
-
|
|
32525
|
-
|
|
32526
|
-
|
|
32527
|
-
|
|
32528
|
-
|
|
32529
|
-
|
|
32530
|
-
style: "margin-top: 4px; width: 100%"
|
|
32829
|
+
});
|
|
32830
|
+
const renderValueField = () => {
|
|
32831
|
+
var _a;
|
|
32832
|
+
if (!needValueInput.value) return null;
|
|
32833
|
+
const customConfig = getHeaderFilterObject();
|
|
32834
|
+
const customProps = customConfig.props || {};
|
|
32835
|
+
if (customConfig.renderField && typeof customConfig.renderField === "function") {
|
|
32836
|
+
return customConfig.renderField(state.inputVal, (v) => {
|
|
32837
|
+
state.inputVal = Array.isArray(v) ? v.join(",") : String(v != null ? v : "");
|
|
32531
32838
|
});
|
|
32532
32839
|
}
|
|
32533
|
-
|
|
32534
|
-
|
|
32535
|
-
|
|
32536
|
-
|
|
32537
|
-
|
|
32538
|
-
|
|
32539
|
-
|
|
32540
|
-
|
|
32541
|
-
|
|
32542
|
-
|
|
32840
|
+
const interactionType = resolvedInteractionType.value;
|
|
32841
|
+
const fp = {
|
|
32842
|
+
...((_a = props.column) == null ? void 0 : _a.fieldProps) || {},
|
|
32843
|
+
...customProps
|
|
32844
|
+
};
|
|
32845
|
+
const strategy = interactionType ? FILTER_COMPONENT_STRATEGIES[interactionType] : void 0;
|
|
32846
|
+
if (strategy) {
|
|
32847
|
+
const finalOptions = resolveFilterOptions(resolvedOptions.value, customConfig.options);
|
|
32848
|
+
return strategy.render({
|
|
32849
|
+
fp,
|
|
32850
|
+
inputVal: state.inputVal,
|
|
32851
|
+
setInputVal: (v) => state.inputVal = v,
|
|
32852
|
+
options: finalOptions
|
|
32543
32853
|
});
|
|
32544
32854
|
}
|
|
32545
32855
|
return vue.h(elementPlus.ElInput, {
|
|
32856
|
+
...fp,
|
|
32546
32857
|
modelValue: state.inputVal,
|
|
32547
32858
|
"onUpdate:modelValue": (v) => state.inputVal = v,
|
|
32548
|
-
placeholder: "",
|
|
32859
|
+
placeholder: fp.placeholder || "\u8BF7\u8F93\u5165",
|
|
32549
32860
|
maxlength: 50,
|
|
32550
|
-
style:
|
|
32861
|
+
style: FILTER_FIELD_STYLE
|
|
32551
32862
|
});
|
|
32552
32863
|
};
|
|
32553
32864
|
return (_ctx, _cache) => {
|
|
@@ -32709,16 +33020,18 @@
|
|
|
32709
33020
|
vue.createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
|
|
32710
33021
|
!_ctx.disableFilter ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElPopover), {
|
|
32711
33022
|
key: 1,
|
|
33023
|
+
visible: popVisible.value,
|
|
32712
33024
|
trigger: "click",
|
|
32713
33025
|
placement: "bottom-start",
|
|
32714
|
-
width:
|
|
32715
|
-
visible: popVisible.value,
|
|
32716
|
-
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => popVisible.value = $event),
|
|
33026
|
+
width: popoverWidth.value,
|
|
32717
33027
|
"popper-class": "yc-header-filter-pop",
|
|
32718
33028
|
"popper-style": { zIndex: 4e3 }
|
|
32719
33029
|
}, {
|
|
32720
33030
|
reference: vue.withCtx(() => [
|
|
32721
|
-
vue.createElementVNode("span",
|
|
33031
|
+
vue.createElementVNode("span", {
|
|
33032
|
+
style: { cursor: "pointer", display: "inline-flex", alignItems: "center" },
|
|
33033
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => popVisible.value = !popVisible.value, ["stop"]))
|
|
33034
|
+
}, [
|
|
32722
33035
|
vue.createVNode(vue.unref(YcSvgIcon), {
|
|
32723
33036
|
src: filterIconUrl.value,
|
|
32724
33037
|
size: 14,
|
|
@@ -32728,9 +33041,9 @@
|
|
|
32728
33041
|
])
|
|
32729
33042
|
]),
|
|
32730
33043
|
default: vue.withCtx(() => [
|
|
32731
|
-
vue.createElementVNode("div",
|
|
32732
|
-
vue.createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868 "),
|
|
32733
|
-
vue.
|
|
33044
|
+
vue.createElementVNode("div", _hoisted_3$8, [
|
|
33045
|
+
vue.createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868\uFF08\u591A\u9009/\u65E5\u671F\u533A\u95F4\u7B49\u7531 hideOperatorList \u9690\u85CF\uFF0C\u9ED8\u8BA4 in / between\uFF09 "),
|
|
33046
|
+
!hideOperatorList.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$6, [
|
|
32734
33047
|
(vue.openBlock(true), vue.createElementBlock(
|
|
32735
33048
|
vue.Fragment,
|
|
32736
33049
|
null,
|
|
@@ -32757,17 +33070,17 @@
|
|
|
32757
33070
|
1
|
|
32758
33071
|
/* TEXT */
|
|
32759
33072
|
),
|
|
32760
|
-
state.selectedOp === op.code ? (vue.openBlock(), vue.createElementBlock("span",
|
|
32761
|
-
], 12,
|
|
33073
|
+
state.selectedOp === op.code ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$5, "\u2713")) : vue.createCommentVNode("v-if", true)
|
|
33074
|
+
], 12, _hoisted_5$6);
|
|
32762
33075
|
}),
|
|
32763
33076
|
128
|
|
32764
33077
|
/* KEYED_FRAGMENT */
|
|
32765
33078
|
))
|
|
32766
|
-
]),
|
|
33079
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
32767
33080
|
vue.createCommentVNode(" \u503C\u8F93\u5165 "),
|
|
32768
|
-
needValueInput.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderValueField), { key:
|
|
33081
|
+
needValueInput.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderValueField), { key: 1 })) : vue.createCommentVNode("v-if", true),
|
|
32769
33082
|
vue.createCommentVNode(" \u64CD\u4F5C\u6309\u94AE "),
|
|
32770
|
-
vue.createElementVNode("div",
|
|
33083
|
+
vue.createElementVNode("div", _hoisted_7$4, [
|
|
32771
33084
|
vue.createVNode(vue.unref(elementPlus.ElButton), { onClick: handleReset }, {
|
|
32772
33085
|
default: vue.withCtx(() => [
|
|
32773
33086
|
vue.createTextVNode("\u91CD\u7F6E")
|
|
@@ -32790,7 +33103,7 @@
|
|
|
32790
33103
|
]),
|
|
32791
33104
|
_: 1
|
|
32792
33105
|
/* STABLE */
|
|
32793
|
-
}, 8, ["visible"])) : vue.createCommentVNode("v-if", true)
|
|
33106
|
+
}, 8, ["visible", "width"])) : vue.createCommentVNode("v-if", true)
|
|
32794
33107
|
],
|
|
32795
33108
|
544
|
|
32796
33109
|
/* NEED_HYDRATION, NEED_PATCH */
|
|
@@ -32799,7 +33112,7 @@
|
|
|
32799
33112
|
}
|
|
32800
33113
|
});
|
|
32801
33114
|
|
|
32802
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
33115
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-1b4d52f7"], ["__file", "header-filter-cell.vue"]]);
|
|
32803
33116
|
|
|
32804
33117
|
const DEFAULT_PAGE_SIZE = 20;
|
|
32805
33118
|
const COLUMN_CACHE_PREFIX = "yc-column-settings:";
|
|
@@ -32918,11 +33231,17 @@
|
|
|
32918
33231
|
);
|
|
32919
33232
|
return (fieldConfig == null ? void 0 : fieldConfig.nullable) !== false;
|
|
32920
33233
|
}) : cols;
|
|
32921
|
-
if (!isEnabled)
|
|
33234
|
+
if (!isEnabled) {
|
|
33235
|
+
return visibleCols;
|
|
33236
|
+
}
|
|
32922
33237
|
return visibleCols.map((col) => {
|
|
32923
33238
|
const colHideFilter = col.hideHeaderFilter === true;
|
|
32924
|
-
const
|
|
32925
|
-
|
|
33239
|
+
const hasExplicitHeaderFilter = col.headerFilter && typeof col.headerFilter === "object" || col.headerFilter === true;
|
|
33240
|
+
const fieldFilterable = hasExplicitHeaderFilter || isFieldFilterable(col.prop);
|
|
33241
|
+
if (colHideFilter) {
|
|
33242
|
+
return col;
|
|
33243
|
+
}
|
|
33244
|
+
if (!hasExplicitHeaderFilter && !fieldFilterable) {
|
|
32926
33245
|
return col;
|
|
32927
33246
|
}
|
|
32928
33247
|
const operators = getOpsByProp(col.prop);
|
|
@@ -32936,9 +33255,13 @@
|
|
|
32936
33255
|
} else if (typeof originalWidth === "string") {
|
|
32937
33256
|
const numWidth = parseInt(originalWidth, 10);
|
|
32938
33257
|
if (!isNaN(numWidth)) {
|
|
32939
|
-
adjustedWidth = numWidth + EXTRA_WIDTH;
|
|
33258
|
+
adjustedWidth = String(numWidth + EXTRA_WIDTH);
|
|
32940
33259
|
}
|
|
32941
33260
|
}
|
|
33261
|
+
const propStr = String(col.prop || "");
|
|
33262
|
+
const fieldConfig = catalog ? Object.values(catalog).find(
|
|
33263
|
+
(val) => String((val == null ? void 0 : val.allowedField) || "") === propStr
|
|
33264
|
+
) : void 0;
|
|
32942
33265
|
const userRenderHeader = col.renderHeader;
|
|
32943
33266
|
return {
|
|
32944
33267
|
...col,
|
|
@@ -32954,6 +33277,7 @@
|
|
|
32954
33277
|
onConfirm: handleFilterConfirm,
|
|
32955
33278
|
onReset: handleFilterReset,
|
|
32956
33279
|
onSortChange: handleSortChange,
|
|
33280
|
+
fieldConfig,
|
|
32957
33281
|
// 如果用户定义了 renderHeader,传递给 referenceRenderer
|
|
32958
33282
|
...userRenderHeader && typeof userRenderHeader === "function" ? { referenceRenderer: () => userRenderHeader(label, col) } : {}
|
|
32959
33283
|
});
|
|
@@ -33319,7 +33643,7 @@
|
|
|
33319
33643
|
}
|
|
33320
33644
|
});
|
|
33321
33645
|
|
|
33322
|
-
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
33646
|
+
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-f0c3f2a9"], ["__file", "index.vue"]]);
|
|
33323
33647
|
|
|
33324
33648
|
function compareValues(a, b) {
|
|
33325
33649
|
if (a == null && b == null) return 0;
|
|
@@ -33588,7 +33912,8 @@
|
|
|
33588
33912
|
collapseTags: { type: Boolean, default: false },
|
|
33589
33913
|
maxCollapseTags: { default: 1 },
|
|
33590
33914
|
initialOptions: { default: () => [] },
|
|
33591
|
-
allSelect: { type: Boolean, default: false }
|
|
33915
|
+
allSelect: { type: Boolean, default: false },
|
|
33916
|
+
popperClass: {}
|
|
33592
33917
|
},
|
|
33593
33918
|
emits: ["update:modelValue", "change"],
|
|
33594
33919
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -33918,6 +34243,7 @@
|
|
|
33918
34243
|
multiple: _ctx.multiple,
|
|
33919
34244
|
"collapse-tags": _ctx.collapseTags,
|
|
33920
34245
|
"max-collapse-tags": _ctx.maxCollapseTags,
|
|
34246
|
+
"popper-class": _ctx.popperClass,
|
|
33921
34247
|
onVisibleChange: handleVisibleChange,
|
|
33922
34248
|
onChange: handleChange,
|
|
33923
34249
|
onClear: handleClear,
|
|
@@ -33942,7 +34268,7 @@
|
|
|
33942
34268
|
]),
|
|
33943
34269
|
_: 1
|
|
33944
34270
|
/* STABLE */
|
|
33945
|
-
}, 8, ["modelValue", "filterable", "remote", "reserve-keyword", "placeholder", "clearable", "disabled", "loading", "filter-method", "allow-create", "default-first-option", "multiple", "collapse-tags", "max-collapse-tags"])), [
|
|
34271
|
+
}, 8, ["modelValue", "filterable", "remote", "reserve-keyword", "placeholder", "clearable", "disabled", "loading", "filter-method", "allow-create", "default-first-option", "multiple", "collapse-tags", "max-collapse-tags", "popper-class"])), [
|
|
33946
34272
|
[_directive_load_more, handleLoadMore]
|
|
33947
34273
|
]);
|
|
33948
34274
|
};
|
|
@@ -62129,7 +62455,7 @@
|
|
|
62129
62455
|
YcTabsWithFilter
|
|
62130
62456
|
];
|
|
62131
62457
|
|
|
62132
|
-
const m={mounted(e,r){const{value:o,modifiers:n}=r;if(!o)throw new Error(`[Directive: fn-perm]: \u9700\u8981\u4F20\u5165 functionCode\uFF01\u5982 v-fn-perm="'fn_editTaxRate'"`);const t=n.every?"every":"some";
|
|
62458
|
+
const m={mounted(e,r){const{value:o,modifiers:n$1}=r;if(!o)throw new Error(`[Directive: fn-perm]: \u9700\u8981\u4F20\u5165 functionCode\uFF01\u5982 v-fn-perm="'fn_editTaxRate'"`);const t=n$1.every?"every":"some";n(o,t)||e.parentNode?.removeChild(e);}};
|
|
62133
62459
|
|
|
62134
62460
|
var installer = makeInstaller([...plugins], {
|
|
62135
62461
|
"fn-perm": m
|
|
@@ -63828,7 +64154,7 @@
|
|
|
63828
64154
|
});
|
|
63829
64155
|
}
|
|
63830
64156
|
|
|
63831
|
-
const version = "0.0.
|
|
64157
|
+
const version = "0.0.56";
|
|
63832
64158
|
|
|
63833
64159
|
const install = installer.install;
|
|
63834
64160
|
|
|
@@ -63946,6 +64272,7 @@
|
|
|
63946
64272
|
exports.findNodeByPath = findNodeByPath;
|
|
63947
64273
|
exports.findNodePosition = findNodePosition;
|
|
63948
64274
|
exports.fnPerm = m;
|
|
64275
|
+
exports.hasFunctionPermission = n;
|
|
63949
64276
|
exports.insertAsChild = insertAsChild;
|
|
63950
64277
|
exports.insertAsSibling = insertAsSibling;
|
|
63951
64278
|
exports.insertNodeAtPosition = insertNodeAtPosition;
|
|
@@ -63960,6 +64287,7 @@
|
|
|
63960
64287
|
exports.useDialogFormConfig = useDialogFormConfig;
|
|
63961
64288
|
exports.useDictInjection = useDictInjection;
|
|
63962
64289
|
exports.useDrawerFormConfig = useDrawerFormConfig;
|
|
64290
|
+
exports.useFunctionPermission = a;
|
|
63963
64291
|
exports.useGetOptions = useGetOptions;
|
|
63964
64292
|
exports.useHeaderFilter = useHeaderFilter;
|
|
63965
64293
|
exports.useLocalHeaderFilter = useLocalHeaderFilter;
|