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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.57 */
|
|
2
2
|
import { unref, isRef, ref, inject, isReactive, watch, computed, shallowRef, provide, onMounted, nextTick, onBeforeUnmount, defineComponent, useAttrs, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, getCurrentInstance, resolveComponent, toRefs, useSlots, onUnmounted, resolveDirective, pushScopeId, popScopeId, onBeforeMount, getCurrentScope, onScopeDispose, toRef, mergeModels, useModel, vShow, createStaticVNode, hasInjectionContext, markRaw, effectScope, toRaw } from 'vue';
|
|
3
3
|
import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElTooltip, ElPopconfirm, ElLink, ElMessageBox, useFormDisabled, ElDatePicker, ClickOutside, ElTag, ElInput, ElAutocomplete, ElCascader, ElCheckboxGroup, ElCheckbox, ElColorPicker, ElInputNumber, ElRate, ElSelect, ElOption, ElSlider, ElSwitch, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElSelectV2, ElText, ElDivider, ElFormItem, ElOptionGroup, ElRow, ElCol, ElForm, ElCard, ElMessage, ElImage, ElProgress, ElAvatar, ElPopover, ElTable, vLoading, ElDescriptions, ElDescriptionsItem, ElDrawer, TableV2FixedDir, ElAutoResizer, ElTableV2, ElSteps, ElStep, ElBreadcrumb, ElBreadcrumbItem, ElMenuItem, ElSubMenu, ElMenu, ElScrollbar, ElHeader, ElContainer, ElMain, ElBacktop, ElUpload } from 'element-plus';
|
|
4
4
|
|
|
@@ -4830,8 +4830,16 @@ const useGetOptions = (props) => {
|
|
|
4830
4830
|
const options = ref([]);
|
|
4831
4831
|
const optionsIsReady = ref(false);
|
|
4832
4832
|
const injectedDictStore = inject(DictStoreInjectionKey, null);
|
|
4833
|
-
const hasValidOptions =
|
|
4834
|
-
|
|
4833
|
+
const hasValidOptions = () => {
|
|
4834
|
+
const o = props.options;
|
|
4835
|
+
if (!o) return false;
|
|
4836
|
+
if (isRef(o)) return true;
|
|
4837
|
+
if (isPromise(o)) return true;
|
|
4838
|
+
if (isFunction(o)) return true;
|
|
4839
|
+
if (isArray(o)) return o.length > 0;
|
|
4840
|
+
return false;
|
|
4841
|
+
};
|
|
4842
|
+
if (hasValidOptions()) {
|
|
4835
4843
|
handleOptions();
|
|
4836
4844
|
} else if (props.autoDict) {
|
|
4837
4845
|
handleAutoDict();
|
|
@@ -4839,28 +4847,43 @@ const useGetOptions = (props) => {
|
|
|
4839
4847
|
options.value = [];
|
|
4840
4848
|
optionsIsReady.value = true;
|
|
4841
4849
|
}
|
|
4850
|
+
function getOptionsResolvedSnapshot() {
|
|
4851
|
+
const o = props.options;
|
|
4852
|
+
if (!o) return [];
|
|
4853
|
+
if (isPromise(o)) return [];
|
|
4854
|
+
if (isRef(o)) {
|
|
4855
|
+
const val = o.value;
|
|
4856
|
+
return val || [];
|
|
4857
|
+
}
|
|
4858
|
+
if (isFunction(o)) {
|
|
4859
|
+
const result = o(props);
|
|
4860
|
+
if (isPromise(result)) return [];
|
|
4861
|
+
return result || [];
|
|
4862
|
+
}
|
|
4863
|
+
if (isArray(o)) return o;
|
|
4864
|
+
if (isReactive(o)) {
|
|
4865
|
+
return o || [];
|
|
4866
|
+
}
|
|
4867
|
+
return [];
|
|
4868
|
+
}
|
|
4842
4869
|
function handleOptions() {
|
|
4843
4870
|
if (!props.options) {
|
|
4844
4871
|
options.value = [];
|
|
4845
4872
|
optionsIsReady.value = true;
|
|
4846
4873
|
return;
|
|
4847
4874
|
}
|
|
4848
|
-
if (
|
|
4849
|
-
|
|
4850
|
-
(
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
);
|
|
4861
|
-
} else if (isFunction(props.options)) {
|
|
4862
|
-
const getValue = props.options;
|
|
4863
|
-
const result = getValue(props);
|
|
4875
|
+
if (isPromise(props.options)) {
|
|
4876
|
+
props.options.then((value) => {
|
|
4877
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
4878
|
+
optionsIsReady.value = true;
|
|
4879
|
+
throwError(options.value);
|
|
4880
|
+
}).catch((err) => {
|
|
4881
|
+
throw err;
|
|
4882
|
+
});
|
|
4883
|
+
return;
|
|
4884
|
+
}
|
|
4885
|
+
if (isFunction(props.options)) {
|
|
4886
|
+
const result = props.options(props);
|
|
4864
4887
|
if (isPromise(result)) {
|
|
4865
4888
|
result.then((value) => {
|
|
4866
4889
|
options.value = getOptionsByOptionsMap(value, props);
|
|
@@ -4869,23 +4892,22 @@ const useGetOptions = (props) => {
|
|
|
4869
4892
|
}).catch((err) => {
|
|
4870
4893
|
throw err;
|
|
4871
4894
|
});
|
|
4872
|
-
|
|
4873
|
-
options.value = getOptionsByOptionsMap(result, props);
|
|
4874
|
-
optionsIsReady.value = true;
|
|
4895
|
+
return;
|
|
4875
4896
|
}
|
|
4876
|
-
} else if (isPromise(props.options)) {
|
|
4877
|
-
const getValue = props.options;
|
|
4878
|
-
getValue.then((value) => {
|
|
4879
|
-
options.value = getOptionsByOptionsMap(value, props);
|
|
4880
|
-
optionsIsReady.value = true;
|
|
4881
|
-
throwError(options.value);
|
|
4882
|
-
}).catch((err) => {
|
|
4883
|
-
throw err;
|
|
4884
|
-
});
|
|
4885
|
-
} else {
|
|
4886
|
-
optionsIsReady.value = true;
|
|
4887
|
-
throwError(props.options);
|
|
4888
4897
|
}
|
|
4898
|
+
if (isRef(props.options) || isReactive(props.options) || isArray(props.options) || isFunction(props.options)) {
|
|
4899
|
+
watch(
|
|
4900
|
+
() => getOptionsResolvedSnapshot(),
|
|
4901
|
+
(val) => {
|
|
4902
|
+
options.value = getOptionsByOptionsMap(val, props);
|
|
4903
|
+
optionsIsReady.value = true;
|
|
4904
|
+
},
|
|
4905
|
+
{ immediate: true, deep: true }
|
|
4906
|
+
);
|
|
4907
|
+
return;
|
|
4908
|
+
}
|
|
4909
|
+
optionsIsReady.value = true;
|
|
4910
|
+
throwError(props.options);
|
|
4889
4911
|
}
|
|
4890
4912
|
function handleAutoDict() {
|
|
4891
4913
|
if (isFunction(props.autoDict)) {
|
|
@@ -18339,7 +18361,7 @@ const _hoisted_7$6 = {
|
|
|
18339
18361
|
key: 0,
|
|
18340
18362
|
class: "plus-table-checkbox-handle"
|
|
18341
18363
|
};
|
|
18342
|
-
const _hoisted_8$
|
|
18364
|
+
const _hoisted_8$4 = { key: 1 };
|
|
18343
18365
|
const _hoisted_9$4 = { key: 1 };
|
|
18344
18366
|
var _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
18345
18367
|
...{
|
|
@@ -18722,7 +18744,7 @@ var _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
18722
18744
|
/* DYNAMIC */
|
|
18723
18745
|
}, 1032, ["content"])) : (openBlock(), createElementBlock(
|
|
18724
18746
|
"span",
|
|
18725
|
-
_hoisted_8$
|
|
18747
|
+
_hoisted_8$4,
|
|
18726
18748
|
toDisplayString(item.label ? getLabelValue(item.label) : ""),
|
|
18727
18749
|
1
|
|
18728
18750
|
/* TEXT */
|
|
@@ -22027,7 +22049,7 @@ const _hoisted_4$8 = /* @__PURE__ */ createElementVNode(
|
|
|
22027
22049
|
const _hoisted_5$8 = { class: "plus-header__right" };
|
|
22028
22050
|
const _hoisted_6$6 = { class: "plus-header__dropdown-area" };
|
|
22029
22051
|
const _hoisted_7$5 = ["src"];
|
|
22030
|
-
const _hoisted_8$
|
|
22052
|
+
const _hoisted_8$3 = { class: "plus-header__username" };
|
|
22031
22053
|
const _hoisted_9$3 = {
|
|
22032
22054
|
key: 0,
|
|
22033
22055
|
class: "plus-header-placeholder"
|
|
@@ -22182,7 +22204,7 @@ var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
22182
22204
|
createCommentVNode(" username "),
|
|
22183
22205
|
createElementVNode(
|
|
22184
22206
|
"p",
|
|
22185
|
-
_hoisted_8$
|
|
22207
|
+
_hoisted_8$3,
|
|
22186
22208
|
toDisplayString(_ctx.userInfo.username || "admin"),
|
|
22187
22209
|
1
|
|
22188
22210
|
/* TEXT */
|
|
@@ -31941,7 +31963,7 @@ callBound('Map.prototype.has', true);
|
|
|
31941
31963
|
|
|
31942
31964
|
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};
|
|
31943
31965
|
|
|
31944
|
-
const
|
|
31966
|
+
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)});
|
|
31945
31967
|
|
|
31946
31968
|
const YC_CONFIG_KEY = Symbol("ycConfig");
|
|
31947
31969
|
const DEFAULT_CDN_CONFIG = {
|
|
@@ -32199,11 +32221,11 @@ function useHeaderFilter(options = {}) {
|
|
|
32199
32221
|
const isEnabled = computed(() => {
|
|
32200
32222
|
const hideHeaderFilter = getHideHeaderFilter();
|
|
32201
32223
|
const headerFilterConfig = getHeaderFilterConfig();
|
|
32202
|
-
if (hideHeaderFilter === true) return false;
|
|
32203
|
-
if (typeof headerFilterConfig === "boolean") return headerFilterConfig;
|
|
32204
32224
|
if (headerFilterConfig && typeof headerFilterConfig === "object") {
|
|
32205
32225
|
return headerFilterConfig.enabled !== false;
|
|
32206
32226
|
}
|
|
32227
|
+
if (typeof headerFilterConfig === "boolean") return headerFilterConfig;
|
|
32228
|
+
if (hideHeaderFilter === true) return false;
|
|
32207
32229
|
return false;
|
|
32208
32230
|
});
|
|
32209
32231
|
const operatorCatalogState = computed(() => {
|
|
@@ -32314,21 +32336,34 @@ function useHeaderFilter(options = {}) {
|
|
|
32314
32336
|
}
|
|
32315
32337
|
};
|
|
32316
32338
|
const getMergedQuery = (baseQuery) => {
|
|
32339
|
+
const normalizeFilters = (filters) => {
|
|
32340
|
+
return filters.map((f) => {
|
|
32341
|
+
if (f.op === "in" && typeof f.value === "string" && f.value) {
|
|
32342
|
+
const arr = f.value.split(",").filter(Boolean).map((s) => {
|
|
32343
|
+
const n = Number(s);
|
|
32344
|
+
return Number.isNaN(n) ? s : n;
|
|
32345
|
+
});
|
|
32346
|
+
return { ...f, value: arr };
|
|
32347
|
+
}
|
|
32348
|
+
return f;
|
|
32349
|
+
});
|
|
32350
|
+
};
|
|
32317
32351
|
let mergedFilters = baseQuery.filters;
|
|
32318
32352
|
if (headerFiltersState.filters.length > 0) {
|
|
32353
|
+
const normalized = normalizeFilters(headerFiltersState.filters);
|
|
32319
32354
|
const baseFilters = baseQuery.filters;
|
|
32320
32355
|
if (baseFilters && typeof baseFilters === "object" && Array.isArray(baseFilters.filters)) {
|
|
32321
32356
|
mergedFilters = {
|
|
32322
32357
|
logic: baseFilters.logic || "and",
|
|
32323
32358
|
filters: [
|
|
32324
32359
|
...baseFilters.filters,
|
|
32325
|
-
...
|
|
32360
|
+
...normalized
|
|
32326
32361
|
]
|
|
32327
32362
|
};
|
|
32328
32363
|
} else {
|
|
32329
32364
|
mergedFilters = {
|
|
32330
32365
|
logic: headerFiltersState.logic,
|
|
32331
|
-
filters: [...
|
|
32366
|
+
filters: [...normalized]
|
|
32332
32367
|
};
|
|
32333
32368
|
}
|
|
32334
32369
|
}
|
|
@@ -32356,10 +32391,219 @@ function useHeaderFilter(options = {}) {
|
|
|
32356
32391
|
};
|
|
32357
32392
|
}
|
|
32358
32393
|
|
|
32394
|
+
const FILTER_FIELD_STYLE = "margin-top: 4px; width: 100%";
|
|
32395
|
+
const FILTER_INNER_DROPDOWN_CLASS = "yc-header-filter-inner-dropdown";
|
|
32396
|
+
const isRangeType = (type) => type === "daterange" || type === "monthrange" || type === "datetimerange" || type === "yearrange";
|
|
32397
|
+
const toArrayValue = (val) => typeof val === "string" && val ? val.split(",") : void 0;
|
|
32398
|
+
const fromArrayValue = (v) => Array.isArray(v) ? v.join(",") : String(v != null ? v : "");
|
|
32399
|
+
const parseTypedValue = (val, isMultiple) => {
|
|
32400
|
+
if (!val) return isMultiple ? [] : "";
|
|
32401
|
+
if (!isMultiple) return val;
|
|
32402
|
+
return val.split(",").filter(Boolean).map((s) => {
|
|
32403
|
+
const n = Number(s);
|
|
32404
|
+
return Number.isNaN(n) ? s : n;
|
|
32405
|
+
});
|
|
32406
|
+
};
|
|
32407
|
+
const mergePopperClass = (userClass, builtinClass) => {
|
|
32408
|
+
const parts = [FILTER_INNER_DROPDOWN_CLASS];
|
|
32409
|
+
if (builtinClass) parts.push(builtinClass);
|
|
32410
|
+
if (userClass) parts.push(userClass);
|
|
32411
|
+
return parts.join(" ");
|
|
32412
|
+
};
|
|
32413
|
+
const resolveFilterOptions = (resolvedOptions, headerFilterOptions) => {
|
|
32414
|
+
if (resolvedOptions && resolvedOptions.length > 0) return resolvedOptions;
|
|
32415
|
+
if (!headerFilterOptions) return [];
|
|
32416
|
+
const unwrapped = typeof headerFilterOptions.value !== "undefined" ? headerFilterOptions.value : headerFilterOptions;
|
|
32417
|
+
return Array.isArray(unwrapped) ? unwrapped : [];
|
|
32418
|
+
};
|
|
32419
|
+
|
|
32420
|
+
const VALUE_TYPE_MAP = {
|
|
32421
|
+
select: "select",
|
|
32422
|
+
checkbox: "checkbox",
|
|
32423
|
+
radio: "select",
|
|
32424
|
+
"date-picker": "date-picker",
|
|
32425
|
+
"datetime-picker": "date-picker",
|
|
32426
|
+
datetime: "date-picker",
|
|
32427
|
+
"time-picker": "time-picker",
|
|
32428
|
+
"time-select": "time-select",
|
|
32429
|
+
"tree-select": "tree-select",
|
|
32430
|
+
cascader: "cascader"
|
|
32431
|
+
};
|
|
32432
|
+
const resolveInteractionType = (customType, fieldConfig, valueType) => {
|
|
32433
|
+
if (customType) return customType;
|
|
32434
|
+
if (fieldConfig) {
|
|
32435
|
+
if (fieldConfig.type === "date") return "date-picker";
|
|
32436
|
+
if (fieldConfig.dictField === true) return "select";
|
|
32437
|
+
}
|
|
32438
|
+
return VALUE_TYPE_MAP[valueType] || void 0;
|
|
32439
|
+
};
|
|
32440
|
+
const FILTER_COMPONENT_STRATEGIES = {
|
|
32441
|
+
"time-picker": {
|
|
32442
|
+
render: ({ fp, inputVal, setInputVal }) => {
|
|
32443
|
+
var _a, _b;
|
|
32444
|
+
return h(ElTimePicker, {
|
|
32445
|
+
...fp,
|
|
32446
|
+
format: (_a = fp == null ? void 0 : fp.format) != null ? _a : "HH:mm:ss",
|
|
32447
|
+
valueFormat: (_b = fp == null ? void 0 : fp.valueFormat) != null ? _b : "HH:mm:ss",
|
|
32448
|
+
modelValue: inputVal,
|
|
32449
|
+
"onUpdate:modelValue": (v) => setInputVal(String(v != null ? v : "")),
|
|
32450
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32451
|
+
style: FILTER_FIELD_STYLE
|
|
32452
|
+
});
|
|
32453
|
+
}
|
|
32454
|
+
},
|
|
32455
|
+
"time-select": {
|
|
32456
|
+
render: ({ fp, inputVal, setInputVal }) => h(ElTimeSelect, {
|
|
32457
|
+
...fp,
|
|
32458
|
+
modelValue: inputVal,
|
|
32459
|
+
"onUpdate:modelValue": (v) => {
|
|
32460
|
+
const raw = String(v != null ? v : "");
|
|
32461
|
+
setInputVal(raw && /^\d{2}:\d{2}$/.test(raw) ? `${raw}:00` : raw);
|
|
32462
|
+
},
|
|
32463
|
+
style: FILTER_FIELD_STYLE
|
|
32464
|
+
})
|
|
32465
|
+
},
|
|
32466
|
+
"date-picker": {
|
|
32467
|
+
render: ({ fp, inputVal, setInputVal }) => {
|
|
32468
|
+
var _a;
|
|
32469
|
+
const range = isRangeType(fp.type);
|
|
32470
|
+
return h(ElDatePicker, {
|
|
32471
|
+
...fp,
|
|
32472
|
+
valueFormat: (_a = fp == null ? void 0 : fp.valueFormat) != null ? _a : "YYYY-MM-DD HH:mm:ss",
|
|
32473
|
+
modelValue: range ? toArrayValue(inputVal) : inputVal,
|
|
32474
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32475
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32476
|
+
style: FILTER_FIELD_STYLE
|
|
32477
|
+
});
|
|
32478
|
+
}
|
|
32479
|
+
},
|
|
32480
|
+
checkbox: {
|
|
32481
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32482
|
+
const parsedValue = toArrayValue(inputVal) || [];
|
|
32483
|
+
const allVals = options.map((o) => o.value);
|
|
32484
|
+
const selectedSet = new Set(parsedValue);
|
|
32485
|
+
const checkAll = options.length > 0 && parsedValue.length === options.length;
|
|
32486
|
+
const isIndeterminate = parsedValue.length > 0 && parsedValue.length < options.length;
|
|
32487
|
+
const handleCheckAllChange = (val) => {
|
|
32488
|
+
setInputVal(val ? options.map((opt) => opt.value).join(",") : "");
|
|
32489
|
+
};
|
|
32490
|
+
const handleInvert = () => {
|
|
32491
|
+
if (!options.length) return;
|
|
32492
|
+
const inverted = allVals.filter((v) => !selectedSet.has(v));
|
|
32493
|
+
setInputVal(inverted.join(","));
|
|
32494
|
+
};
|
|
32495
|
+
const showCheckAll = fp.showCheckAll !== false;
|
|
32496
|
+
const showInvert = fp.showInvert !== false;
|
|
32497
|
+
const checkAllText = fp.checkAllText || "\u5168\u9009";
|
|
32498
|
+
return h("div", { class: "header-filter-checkbox-group", style: "max-height: 250px; overflow-y: auto; padding: 4px;" }, [
|
|
32499
|
+
showCheckAll && options.length > 0 ? 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);" }, [
|
|
32500
|
+
h(ElCheckbox, {
|
|
32501
|
+
modelValue: checkAll,
|
|
32502
|
+
indeterminate: isIndeterminate,
|
|
32503
|
+
"onUpdate:modelValue": handleCheckAllChange,
|
|
32504
|
+
style: "font-weight: bold; flex: 1; min-width: 0;"
|
|
32505
|
+
}, () => checkAllText),
|
|
32506
|
+
showInvert ? h(
|
|
32507
|
+
ElButton,
|
|
32508
|
+
{
|
|
32509
|
+
link: true,
|
|
32510
|
+
type: "primary",
|
|
32511
|
+
size: "small",
|
|
32512
|
+
onClick: handleInvert
|
|
32513
|
+
},
|
|
32514
|
+
() => "\u53CD\u9009"
|
|
32515
|
+
) : null
|
|
32516
|
+
]) : null,
|
|
32517
|
+
h(ElCheckboxGroup, {
|
|
32518
|
+
...fp,
|
|
32519
|
+
modelValue: parsedValue,
|
|
32520
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32521
|
+
style: "display: flex; flex-direction: column;"
|
|
32522
|
+
}, {
|
|
32523
|
+
default: () => options.map(
|
|
32524
|
+
(opt) => h(
|
|
32525
|
+
ElCheckbox,
|
|
32526
|
+
{
|
|
32527
|
+
value: opt.value,
|
|
32528
|
+
label: opt.value,
|
|
32529
|
+
style: "margin-bottom: 4px; height: auto;"
|
|
32530
|
+
},
|
|
32531
|
+
() => opt.label
|
|
32532
|
+
)
|
|
32533
|
+
)
|
|
32534
|
+
})
|
|
32535
|
+
]);
|
|
32536
|
+
}
|
|
32537
|
+
},
|
|
32538
|
+
"tree-select": {
|
|
32539
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32540
|
+
const isMultiple = !!fp.multiple;
|
|
32541
|
+
const treeData = options && options.length > 0 ? options : fp.data || [];
|
|
32542
|
+
return h(ElTreeSelect, {
|
|
32543
|
+
...fp,
|
|
32544
|
+
modelValue: parseTypedValue(inputVal, isMultiple),
|
|
32545
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32546
|
+
data: treeData,
|
|
32547
|
+
popperClass: mergePopperClass(fp.popperClass, "yc-header-filter-tree-popper"),
|
|
32548
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
32549
|
+
style: FILTER_FIELD_STYLE
|
|
32550
|
+
});
|
|
32551
|
+
}
|
|
32552
|
+
},
|
|
32553
|
+
cascader: {
|
|
32554
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32555
|
+
const cascaderProps = fp.props || {};
|
|
32556
|
+
const isMultiple = !!cascaderProps.multiple;
|
|
32557
|
+
let parsedValue = inputVal;
|
|
32558
|
+
if (isMultiple && typeof inputVal === "string" && inputVal && !cascaderProps.emitPath) {
|
|
32559
|
+
parsedValue = inputVal.split(",");
|
|
32560
|
+
}
|
|
32561
|
+
return h(ElCascader, {
|
|
32562
|
+
...fp,
|
|
32563
|
+
modelValue: parsedValue,
|
|
32564
|
+
"onUpdate:modelValue": (v) => {
|
|
32565
|
+
let flat = v;
|
|
32566
|
+
if (Array.isArray(v) && v.length && Array.isArray(v[0])) {
|
|
32567
|
+
flat = v.map((arr) => Array.isArray(arr) ? arr[arr.length - 1] : arr);
|
|
32568
|
+
}
|
|
32569
|
+
setInputVal(fromArrayValue(flat));
|
|
32570
|
+
},
|
|
32571
|
+
options,
|
|
32572
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32573
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
32574
|
+
style: FILTER_FIELD_STYLE
|
|
32575
|
+
});
|
|
32576
|
+
}
|
|
32577
|
+
},
|
|
32578
|
+
select: {
|
|
32579
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
32580
|
+
const isMultiple = !!fp.multiple;
|
|
32581
|
+
return h(
|
|
32582
|
+
ElSelect,
|
|
32583
|
+
{
|
|
32584
|
+
...fp,
|
|
32585
|
+
modelValue: parseTypedValue(inputVal, isMultiple),
|
|
32586
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
32587
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
32588
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
32589
|
+
style: FILTER_FIELD_STYLE
|
|
32590
|
+
},
|
|
32591
|
+
{
|
|
32592
|
+
default: () => options.map(
|
|
32593
|
+
(opt) => h(ElOption, {
|
|
32594
|
+
label: opt.label,
|
|
32595
|
+
value: opt.value
|
|
32596
|
+
})
|
|
32597
|
+
)
|
|
32598
|
+
}
|
|
32599
|
+
);
|
|
32600
|
+
}
|
|
32601
|
+
}
|
|
32602
|
+
};
|
|
32603
|
+
|
|
32359
32604
|
const _hoisted_1$9 = { class: "yc-header-filter-cell__label-text" };
|
|
32360
32605
|
const _hoisted_2$8 = { class: "yc-header-filter-cell__label-text" };
|
|
32361
|
-
const _hoisted_3$8 = {
|
|
32362
|
-
const _hoisted_4$6 = {
|
|
32606
|
+
const _hoisted_3$8 = {
|
|
32363
32607
|
class: "yc-header-filter-cell__content",
|
|
32364
32608
|
style: {
|
|
32365
32609
|
display: "flex",
|
|
@@ -32369,10 +32613,13 @@ const _hoisted_4$6 = {
|
|
|
32369
32613
|
gap: "4px"
|
|
32370
32614
|
}
|
|
32371
32615
|
};
|
|
32372
|
-
const
|
|
32373
|
-
|
|
32374
|
-
|
|
32375
|
-
|
|
32616
|
+
const _hoisted_4$6 = {
|
|
32617
|
+
key: 0,
|
|
32618
|
+
class: "yc-header-filter-cell__operators"
|
|
32619
|
+
};
|
|
32620
|
+
const _hoisted_5$6 = ["onClick"];
|
|
32621
|
+
const _hoisted_6$5 = { key: 0 };
|
|
32622
|
+
const _hoisted_7$4 = {
|
|
32376
32623
|
class: "yc-header-filter-cell__actions",
|
|
32377
32624
|
style: {
|
|
32378
32625
|
display: "flex",
|
|
@@ -32392,6 +32639,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32392
32639
|
filters: { default: () => [] },
|
|
32393
32640
|
orderBy: { default: () => [] },
|
|
32394
32641
|
disableFilter: { type: Boolean, default: false },
|
|
32642
|
+
fieldConfig: {},
|
|
32395
32643
|
referenceRenderer: { type: Function, default: void 0 }
|
|
32396
32644
|
},
|
|
32397
32645
|
emits: ["confirm", "reset", "sortChange"],
|
|
@@ -32423,6 +32671,12 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32423
32671
|
var _a;
|
|
32424
32672
|
return String(((_a = props.column) == null ? void 0 : _a.prop) || "");
|
|
32425
32673
|
});
|
|
32674
|
+
const getHeaderFilterObject = () => {
|
|
32675
|
+
var _a;
|
|
32676
|
+
const hf = (_a = props.column) == null ? void 0 : _a.headerFilter;
|
|
32677
|
+
if (hf && typeof hf === "object") return hf;
|
|
32678
|
+
return {};
|
|
32679
|
+
};
|
|
32426
32680
|
const isActive = computed(() => {
|
|
32427
32681
|
var _a, _b;
|
|
32428
32682
|
const field = fieldRef.value;
|
|
@@ -32440,35 +32694,48 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32440
32694
|
return (_a = props.orderBy) == null ? void 0 : _a.some((i) => i.field === fieldRef.value && i.direction === "desc");
|
|
32441
32695
|
}
|
|
32442
32696
|
);
|
|
32443
|
-
const
|
|
32697
|
+
const onDocPointerDown = (e) => {
|
|
32698
|
+
var _a;
|
|
32444
32699
|
if (!popVisible.value) return;
|
|
32445
32700
|
const target = e.target;
|
|
32446
|
-
|
|
32447
|
-
if (
|
|
32701
|
+
if (!target) return;
|
|
32702
|
+
if ((_a = wrapperElRef.value) == null ? void 0 : _a.contains(target)) return;
|
|
32703
|
+
if (target.closest(".yc-header-filter-pop")) return;
|
|
32704
|
+
const popoverTrigger = target.closest("[aria-describedby]");
|
|
32705
|
+
if (popoverTrigger) return;
|
|
32706
|
+
if (target.closest(`.${FILTER_INNER_DROPDOWN_CLASS}`)) return;
|
|
32448
32707
|
popVisible.value = false;
|
|
32449
32708
|
};
|
|
32450
32709
|
onMounted(() => {
|
|
32451
|
-
window.addEventListener("pointerdown",
|
|
32452
|
-
window.addEventListener("click", onDocPointerOrClick, true);
|
|
32710
|
+
window.addEventListener("pointerdown", onDocPointerDown, true);
|
|
32453
32711
|
});
|
|
32454
32712
|
onBeforeUnmount(() => {
|
|
32455
|
-
window.removeEventListener("pointerdown",
|
|
32456
|
-
window.removeEventListener("click", onDocPointerOrClick, true);
|
|
32713
|
+
window.removeEventListener("pointerdown", onDocPointerDown, true);
|
|
32457
32714
|
});
|
|
32458
32715
|
const handleSelect = (op) => {
|
|
32459
32716
|
state.selectedOp = op.code;
|
|
32460
32717
|
};
|
|
32461
32718
|
const handleReset = () => {
|
|
32462
32719
|
state.inputVal = "";
|
|
32463
|
-
|
|
32720
|
+
const payload = { column: props.column, op: state.selectedOp };
|
|
32721
|
+
const customConfig = getHeaderFilterObject();
|
|
32722
|
+
if (customConfig.onReset) {
|
|
32723
|
+
customConfig.onReset(payload);
|
|
32724
|
+
}
|
|
32725
|
+
emit("reset", payload);
|
|
32464
32726
|
popVisible.value = false;
|
|
32465
32727
|
};
|
|
32466
32728
|
const handleConfirm = () => {
|
|
32467
|
-
|
|
32729
|
+
const payload = {
|
|
32468
32730
|
column: props.column,
|
|
32469
32731
|
op: state.selectedOp,
|
|
32470
32732
|
value: state.inputVal
|
|
32471
|
-
}
|
|
32733
|
+
};
|
|
32734
|
+
const customConfig = getHeaderFilterObject();
|
|
32735
|
+
if (customConfig.onConfirm) {
|
|
32736
|
+
customConfig.onConfirm(payload);
|
|
32737
|
+
}
|
|
32738
|
+
emit("confirm", payload);
|
|
32472
32739
|
popVisible.value = false;
|
|
32473
32740
|
};
|
|
32474
32741
|
const cycleSort = () => {
|
|
@@ -32500,51 +32767,95 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32500
32767
|
var _a;
|
|
32501
32768
|
return (_a = props.column) == null ? void 0 : _a.tooltip;
|
|
32502
32769
|
});
|
|
32503
|
-
const
|
|
32504
|
-
|
|
32505
|
-
|
|
32770
|
+
const optionsSourceProps = computed(() => {
|
|
32771
|
+
const config = getHeaderFilterObject();
|
|
32772
|
+
const col = props.column;
|
|
32773
|
+
return {
|
|
32774
|
+
options: config.options !== void 0 ? config.options : col.options,
|
|
32775
|
+
autoDict: col.autoDict,
|
|
32776
|
+
optionsMap: col.optionsMap,
|
|
32777
|
+
prop: col.prop,
|
|
32778
|
+
valueType: col.valueType
|
|
32779
|
+
};
|
|
32780
|
+
});
|
|
32781
|
+
const { customOptions: resolvedOptions } = useGetOptions(optionsSourceProps);
|
|
32782
|
+
const fieldPropsForFilter = computed(
|
|
32783
|
+
() => {
|
|
32784
|
+
var _a;
|
|
32785
|
+
return ((_a = props.column) == null ? void 0 : _a.fieldProps) || {};
|
|
32786
|
+
}
|
|
32787
|
+
);
|
|
32788
|
+
const resolvedInteractionType = computed(() => {
|
|
32789
|
+
var _a;
|
|
32790
|
+
const customConfig = getHeaderFilterObject();
|
|
32506
32791
|
const vt = String(((_a = props.column) == null ? void 0 : _a.valueType) || "").toLowerCase();
|
|
32507
|
-
|
|
32508
|
-
|
|
32509
|
-
|
|
32510
|
-
|
|
32511
|
-
|
|
32512
|
-
|
|
32513
|
-
|
|
32514
|
-
|
|
32515
|
-
|
|
32516
|
-
|
|
32792
|
+
return resolveInteractionType(customConfig.type, props.fieldConfig, vt);
|
|
32793
|
+
});
|
|
32794
|
+
const hideOperatorList = computed(() => {
|
|
32795
|
+
var _a;
|
|
32796
|
+
const t = resolvedInteractionType.value;
|
|
32797
|
+
const customConfig = getHeaderFilterObject();
|
|
32798
|
+
const mult = (_a = customConfig.props) == null ? void 0 : _a.multiple;
|
|
32799
|
+
if (t === "checkbox") return true;
|
|
32800
|
+
if (t === "date-picker") return true;
|
|
32801
|
+
if (t === "select" && mult) return true;
|
|
32802
|
+
if (t === "tree-select" && mult) return true;
|
|
32803
|
+
return false;
|
|
32804
|
+
});
|
|
32805
|
+
const popoverWidth = computed(() => hideOperatorList.value ? 320 : 220);
|
|
32806
|
+
watch(popVisible, (visible) => {
|
|
32807
|
+
var _a, _b;
|
|
32808
|
+
if (!visible) return;
|
|
32809
|
+
const t = resolvedInteractionType.value;
|
|
32810
|
+
const customConfig = getHeaderFilterObject();
|
|
32811
|
+
const fp = {
|
|
32812
|
+
...fieldPropsForFilter.value,
|
|
32813
|
+
...customConfig.props || {}
|
|
32814
|
+
};
|
|
32815
|
+
if (t === "date-picker" && isRangeType(fp.type)) {
|
|
32816
|
+
if (state.selectedOp !== "between") state.selectedOp = "between";
|
|
32817
|
+
if (!state.inputVal) {
|
|
32818
|
+
const now = /* @__PURE__ */ new Date();
|
|
32819
|
+
const y = now.getFullYear();
|
|
32820
|
+
const m = String(now.getMonth() + 1).padStart(2, "0");
|
|
32821
|
+
state.inputVal = `${y}-${m},${y}-${m}`;
|
|
32822
|
+
}
|
|
32823
|
+
} 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)) {
|
|
32824
|
+
if (state.selectedOp !== "in") state.selectedOp = "in";
|
|
32517
32825
|
}
|
|
32518
|
-
|
|
32519
|
-
|
|
32520
|
-
|
|
32521
|
-
|
|
32522
|
-
|
|
32523
|
-
|
|
32524
|
-
|
|
32525
|
-
|
|
32526
|
-
|
|
32527
|
-
style: "margin-top: 4px; width: 100%"
|
|
32826
|
+
});
|
|
32827
|
+
const renderValueField = () => {
|
|
32828
|
+
var _a;
|
|
32829
|
+
if (!needValueInput.value) return null;
|
|
32830
|
+
const customConfig = getHeaderFilterObject();
|
|
32831
|
+
const customProps = customConfig.props || {};
|
|
32832
|
+
if (customConfig.renderField && typeof customConfig.renderField === "function") {
|
|
32833
|
+
return customConfig.renderField(state.inputVal, (v) => {
|
|
32834
|
+
state.inputVal = Array.isArray(v) ? v.join(",") : String(v != null ? v : "");
|
|
32528
32835
|
});
|
|
32529
32836
|
}
|
|
32530
|
-
|
|
32531
|
-
|
|
32532
|
-
|
|
32533
|
-
|
|
32534
|
-
|
|
32535
|
-
|
|
32536
|
-
|
|
32537
|
-
|
|
32538
|
-
|
|
32539
|
-
|
|
32837
|
+
const interactionType = resolvedInteractionType.value;
|
|
32838
|
+
const fp = {
|
|
32839
|
+
...((_a = props.column) == null ? void 0 : _a.fieldProps) || {},
|
|
32840
|
+
...customProps
|
|
32841
|
+
};
|
|
32842
|
+
const strategy = interactionType ? FILTER_COMPONENT_STRATEGIES[interactionType] : void 0;
|
|
32843
|
+
if (strategy) {
|
|
32844
|
+
const finalOptions = resolveFilterOptions(resolvedOptions.value, customConfig.options);
|
|
32845
|
+
return strategy.render({
|
|
32846
|
+
fp,
|
|
32847
|
+
inputVal: state.inputVal,
|
|
32848
|
+
setInputVal: (v) => state.inputVal = v,
|
|
32849
|
+
options: finalOptions
|
|
32540
32850
|
});
|
|
32541
32851
|
}
|
|
32542
32852
|
return h(ElInput, {
|
|
32853
|
+
...fp,
|
|
32543
32854
|
modelValue: state.inputVal,
|
|
32544
32855
|
"onUpdate:modelValue": (v) => state.inputVal = v,
|
|
32545
|
-
placeholder: "",
|
|
32856
|
+
placeholder: fp.placeholder || "\u8BF7\u8F93\u5165",
|
|
32546
32857
|
maxlength: 50,
|
|
32547
|
-
style:
|
|
32858
|
+
style: FILTER_FIELD_STYLE
|
|
32548
32859
|
});
|
|
32549
32860
|
};
|
|
32550
32861
|
return (_ctx, _cache) => {
|
|
@@ -32706,16 +33017,18 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32706
33017
|
createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
|
|
32707
33018
|
!_ctx.disableFilter ? (openBlock(), createBlock(unref(ElPopover), {
|
|
32708
33019
|
key: 1,
|
|
33020
|
+
visible: popVisible.value,
|
|
32709
33021
|
trigger: "click",
|
|
32710
33022
|
placement: "bottom-start",
|
|
32711
|
-
width:
|
|
32712
|
-
visible: popVisible.value,
|
|
32713
|
-
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => popVisible.value = $event),
|
|
33023
|
+
width: popoverWidth.value,
|
|
32714
33024
|
"popper-class": "yc-header-filter-pop",
|
|
32715
33025
|
"popper-style": { zIndex: 4e3 }
|
|
32716
33026
|
}, {
|
|
32717
33027
|
reference: withCtx(() => [
|
|
32718
|
-
createElementVNode("span",
|
|
33028
|
+
createElementVNode("span", {
|
|
33029
|
+
style: { cursor: "pointer", display: "inline-flex", alignItems: "center" },
|
|
33030
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => popVisible.value = !popVisible.value, ["stop"]))
|
|
33031
|
+
}, [
|
|
32719
33032
|
createVNode(unref(YcSvgIcon), {
|
|
32720
33033
|
src: filterIconUrl.value,
|
|
32721
33034
|
size: 14,
|
|
@@ -32725,9 +33038,9 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32725
33038
|
])
|
|
32726
33039
|
]),
|
|
32727
33040
|
default: withCtx(() => [
|
|
32728
|
-
createElementVNode("div",
|
|
32729
|
-
createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868 "),
|
|
32730
|
-
|
|
33041
|
+
createElementVNode("div", _hoisted_3$8, [
|
|
33042
|
+
createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868\uFF08\u591A\u9009/\u65E5\u671F\u533A\u95F4\u7B49\u7531 hideOperatorList \u9690\u85CF\uFF0C\u9ED8\u8BA4 in / between\uFF09 "),
|
|
33043
|
+
!hideOperatorList.value ? (openBlock(), createElementBlock("div", _hoisted_4$6, [
|
|
32731
33044
|
(openBlock(true), createElementBlock(
|
|
32732
33045
|
Fragment,
|
|
32733
33046
|
null,
|
|
@@ -32754,17 +33067,17 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32754
33067
|
1
|
|
32755
33068
|
/* TEXT */
|
|
32756
33069
|
),
|
|
32757
|
-
state.selectedOp === op.code ? (openBlock(), createElementBlock("span",
|
|
32758
|
-
], 12,
|
|
33070
|
+
state.selectedOp === op.code ? (openBlock(), createElementBlock("span", _hoisted_6$5, "\u2713")) : createCommentVNode("v-if", true)
|
|
33071
|
+
], 12, _hoisted_5$6);
|
|
32759
33072
|
}),
|
|
32760
33073
|
128
|
|
32761
33074
|
/* KEYED_FRAGMENT */
|
|
32762
33075
|
))
|
|
32763
|
-
]),
|
|
33076
|
+
])) : createCommentVNode("v-if", true),
|
|
32764
33077
|
createCommentVNode(" \u503C\u8F93\u5165 "),
|
|
32765
|
-
needValueInput.value ? (openBlock(), createBlock(resolveDynamicComponent(renderValueField), { key:
|
|
33078
|
+
needValueInput.value ? (openBlock(), createBlock(resolveDynamicComponent(renderValueField), { key: 1 })) : createCommentVNode("v-if", true),
|
|
32766
33079
|
createCommentVNode(" \u64CD\u4F5C\u6309\u94AE "),
|
|
32767
|
-
createElementVNode("div",
|
|
33080
|
+
createElementVNode("div", _hoisted_7$4, [
|
|
32768
33081
|
createVNode(unref(ElButton), { onClick: handleReset }, {
|
|
32769
33082
|
default: withCtx(() => [
|
|
32770
33083
|
createTextVNode("\u91CD\u7F6E")
|
|
@@ -32787,7 +33100,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32787
33100
|
]),
|
|
32788
33101
|
_: 1
|
|
32789
33102
|
/* STABLE */
|
|
32790
|
-
}, 8, ["visible"])) : createCommentVNode("v-if", true)
|
|
33103
|
+
}, 8, ["visible", "width"])) : createCommentVNode("v-if", true)
|
|
32791
33104
|
],
|
|
32792
33105
|
544
|
|
32793
33106
|
/* NEED_HYDRATION, NEED_PATCH */
|
|
@@ -32796,7 +33109,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32796
33109
|
}
|
|
32797
33110
|
});
|
|
32798
33111
|
|
|
32799
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
33112
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-1b4d52f7"], ["__file", "header-filter-cell.vue"]]);
|
|
32800
33113
|
|
|
32801
33114
|
const DEFAULT_PAGE_SIZE = 20;
|
|
32802
33115
|
const COLUMN_CACHE_PREFIX = "yc-column-settings:";
|
|
@@ -32915,11 +33228,17 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
32915
33228
|
);
|
|
32916
33229
|
return (fieldConfig == null ? void 0 : fieldConfig.nullable) !== false;
|
|
32917
33230
|
}) : cols;
|
|
32918
|
-
if (!isEnabled)
|
|
33231
|
+
if (!isEnabled) {
|
|
33232
|
+
return visibleCols;
|
|
33233
|
+
}
|
|
32919
33234
|
return visibleCols.map((col) => {
|
|
32920
33235
|
const colHideFilter = col.hideHeaderFilter === true;
|
|
32921
|
-
const
|
|
32922
|
-
|
|
33236
|
+
const hasExplicitHeaderFilter = col.headerFilter && typeof col.headerFilter === "object" || col.headerFilter === true;
|
|
33237
|
+
const fieldFilterable = hasExplicitHeaderFilter || isFieldFilterable(col.prop);
|
|
33238
|
+
if (colHideFilter) {
|
|
33239
|
+
return col;
|
|
33240
|
+
}
|
|
33241
|
+
if (!hasExplicitHeaderFilter && !fieldFilterable) {
|
|
32923
33242
|
return col;
|
|
32924
33243
|
}
|
|
32925
33244
|
const operators = getOpsByProp(col.prop);
|
|
@@ -32933,9 +33252,13 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
32933
33252
|
} else if (typeof originalWidth === "string") {
|
|
32934
33253
|
const numWidth = parseInt(originalWidth, 10);
|
|
32935
33254
|
if (!isNaN(numWidth)) {
|
|
32936
|
-
adjustedWidth = numWidth + EXTRA_WIDTH;
|
|
33255
|
+
adjustedWidth = String(numWidth + EXTRA_WIDTH);
|
|
32937
33256
|
}
|
|
32938
33257
|
}
|
|
33258
|
+
const propStr = String(col.prop || "");
|
|
33259
|
+
const fieldConfig = catalog ? Object.values(catalog).find(
|
|
33260
|
+
(val) => String((val == null ? void 0 : val.allowedField) || "") === propStr
|
|
33261
|
+
) : void 0;
|
|
32939
33262
|
const userRenderHeader = col.renderHeader;
|
|
32940
33263
|
return {
|
|
32941
33264
|
...col,
|
|
@@ -32951,6 +33274,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
32951
33274
|
onConfirm: handleFilterConfirm,
|
|
32952
33275
|
onReset: handleFilterReset,
|
|
32953
33276
|
onSortChange: handleSortChange,
|
|
33277
|
+
fieldConfig,
|
|
32954
33278
|
// 如果用户定义了 renderHeader,传递给 referenceRenderer
|
|
32955
33279
|
...userRenderHeader && typeof userRenderHeader === "function" ? { referenceRenderer: () => userRenderHeader(label, col) } : {}
|
|
32956
33280
|
});
|
|
@@ -33316,7 +33640,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
33316
33640
|
}
|
|
33317
33641
|
});
|
|
33318
33642
|
|
|
33319
|
-
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
33643
|
+
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-f0c3f2a9"], ["__file", "index.vue"]]);
|
|
33320
33644
|
|
|
33321
33645
|
function compareValues(a, b) {
|
|
33322
33646
|
if (a == null && b == null) return 0;
|
|
@@ -33585,7 +33909,8 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
33585
33909
|
collapseTags: { type: Boolean, default: false },
|
|
33586
33910
|
maxCollapseTags: { default: 1 },
|
|
33587
33911
|
initialOptions: { default: () => [] },
|
|
33588
|
-
allSelect: { type: Boolean, default: false }
|
|
33912
|
+
allSelect: { type: Boolean, default: false },
|
|
33913
|
+
popperClass: {}
|
|
33589
33914
|
},
|
|
33590
33915
|
emits: ["update:modelValue", "change"],
|
|
33591
33916
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -33915,6 +34240,7 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
33915
34240
|
multiple: _ctx.multiple,
|
|
33916
34241
|
"collapse-tags": _ctx.collapseTags,
|
|
33917
34242
|
"max-collapse-tags": _ctx.maxCollapseTags,
|
|
34243
|
+
"popper-class": _ctx.popperClass,
|
|
33918
34244
|
onVisibleChange: handleVisibleChange,
|
|
33919
34245
|
onChange: handleChange,
|
|
33920
34246
|
onClear: handleClear,
|
|
@@ -33939,7 +34265,7 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
33939
34265
|
]),
|
|
33940
34266
|
_: 1
|
|
33941
34267
|
/* STABLE */
|
|
33942
|
-
}, 8, ["modelValue", "filterable", "remote", "reserve-keyword", "placeholder", "clearable", "disabled", "loading", "filter-method", "allow-create", "default-first-option", "multiple", "collapse-tags", "max-collapse-tags"])), [
|
|
34268
|
+
}, 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"])), [
|
|
33943
34269
|
[_directive_load_more, handleLoadMore]
|
|
33944
34270
|
]);
|
|
33945
34271
|
};
|
|
@@ -62126,7 +62452,7 @@ const plugins = [
|
|
|
62126
62452
|
YcTabsWithFilter
|
|
62127
62453
|
];
|
|
62128
62454
|
|
|
62129
|
-
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";
|
|
62455
|
+
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);}};
|
|
62130
62456
|
|
|
62131
62457
|
var installer = makeInstaller([...plugins], {
|
|
62132
62458
|
"fn-perm": m
|
|
@@ -63825,8 +64151,8 @@ function createDictStore(config) {
|
|
|
63825
64151
|
});
|
|
63826
64152
|
}
|
|
63827
64153
|
|
|
63828
|
-
const version = "0.0.
|
|
64154
|
+
const version = "0.0.56";
|
|
63829
64155
|
|
|
63830
64156
|
const install = installer.install;
|
|
63831
64157
|
|
|
63832
|
-
export { DEFAULT_CDN_CONFIG, DEFAULT_OPERATORS, DEFAULT_YC_CONFIG, DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, DictStoreInjectionKey, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusVirtualTable, YcAnimateSelector as ReAnimateSelector, YcAuth as ReAuth, YcBatchImportDialog as ReBatchImportDialog, YcCard as ReCard, YcCol as ReCol, YcConfigProvider as ReConfigProvider, ReDialog, YcDownloadDialog as ReDownloadDialog, ReDrawer, ReFormContainerHeader, YcLineTree as ReLineTree, ReMoreActions, YcCountTo as ReNormalCountTo, YcPerms as RePerms, RePlusPage, RePlusTree, YcSegmented as ReSegmented, YcSelectV2 as ReSelectV2, YcStatusDialog as ReStatusDialog, YcSvgIcon as ReSvgIcon, YcTabsWithFilter as ReTabsWithFilter, YcText as ReText, YcReboundCountTo as ReboundCountTo, SIZE_MAP, STATUS_CONFIG_MAP, TableColumnsEmptyTextInjectionKey, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, YC_CONFIG_KEY, YcAnimateSelector, YcAnimateSelectorWithInstall, YcAuth, YcAuthWithInstall, YcBatchImportDialog, YcBatchImportDialogWithInstall, YcCard, YcCardWithInstall, YcCol, YcConfigProvider, YcCountTo, YcDialog, YcDownloadDialog, YcDownloadDialogWithInstall, YcDrawer, YcFlicker, YcFormContainerHeader, YcLineTree, YcLineTreeWithInstall, YcMoreActions, YcPerms, YcPermsWithInstall, YcPlusPage, YcPlusTree, YcReboundCountTo, YcReboundCountToWithInstall, YcSegmented, YcSegmentedWithInstall, YcSelectV2, YcStatusDialog, YcSvgIcon, YcTableHeaderFilterCell, YcTabsWithFilter, YcTabsWithFilterWithInstall, YcText, YcTextWithInstall, addDrawer, animates, closeAllDrawer, closeDrawer, createDictStore, installer as default, drawerStore, findNodeById, findNodeByPath, findNodePosition, m as fnPerm, insertAsChild, insertAsSibling, insertNodeAtPosition, install, providePlusProConfig, removeNode, reorderNodeChildren, reorderSiblingNodes, selectValueTypeList, updateDrawer, useColumnAdapter, useDialogFormConfig, useDictInjection, useDrawerFormConfig, useGetOptions, useHeaderFilter, useLocalHeaderFilter, useLocale, usePlusFormReset, usePlusProConfig, useRenderFlicker, useRenderFlicker as useRenderReFlicker, useSelectWithMapping, useSelectWithPagination, useSortableDrag$1 as useSortableDrag, useTable, useVirtualScroll, useVirtualSelection, useYcAuth, useYcCdn, useYcCdnUrl, useYcComponentConfig, useYcConfig, useYcPerms, useYcShowPageSearch, useYcTranslate, version };
|
|
64158
|
+
export { DEFAULT_CDN_CONFIG, DEFAULT_OPERATORS, DEFAULT_YC_CONFIG, DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, DictStoreInjectionKey, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusVirtualTable, YcAnimateSelector as ReAnimateSelector, YcAuth as ReAuth, YcBatchImportDialog as ReBatchImportDialog, YcCard as ReCard, YcCol as ReCol, YcConfigProvider as ReConfigProvider, ReDialog, YcDownloadDialog as ReDownloadDialog, ReDrawer, ReFormContainerHeader, YcLineTree as ReLineTree, ReMoreActions, YcCountTo as ReNormalCountTo, YcPerms as RePerms, RePlusPage, RePlusTree, YcSegmented as ReSegmented, YcSelectV2 as ReSelectV2, YcStatusDialog as ReStatusDialog, YcSvgIcon as ReSvgIcon, YcTabsWithFilter as ReTabsWithFilter, YcText as ReText, YcReboundCountTo as ReboundCountTo, SIZE_MAP, STATUS_CONFIG_MAP, TableColumnsEmptyTextInjectionKey, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, YC_CONFIG_KEY, YcAnimateSelector, YcAnimateSelectorWithInstall, YcAuth, YcAuthWithInstall, YcBatchImportDialog, YcBatchImportDialogWithInstall, YcCard, YcCardWithInstall, YcCol, YcConfigProvider, YcCountTo, YcDialog, YcDownloadDialog, YcDownloadDialogWithInstall, YcDrawer, YcFlicker, YcFormContainerHeader, YcLineTree, YcLineTreeWithInstall, YcMoreActions, YcPerms, YcPermsWithInstall, YcPlusPage, YcPlusTree, YcReboundCountTo, YcReboundCountToWithInstall, YcSegmented, YcSegmentedWithInstall, YcSelectV2, YcStatusDialog, YcSvgIcon, YcTableHeaderFilterCell, YcTabsWithFilter, YcTabsWithFilterWithInstall, YcText, YcTextWithInstall, addDrawer, animates, closeAllDrawer, closeDrawer, createDictStore, installer as default, drawerStore, findNodeById, findNodeByPath, findNodePosition, m as fnPerm, n as hasFunctionPermission, insertAsChild, insertAsSibling, insertNodeAtPosition, install, providePlusProConfig, removeNode, reorderNodeChildren, reorderSiblingNodes, selectValueTypeList, updateDrawer, useColumnAdapter, useDialogFormConfig, useDictInjection, useDrawerFormConfig, a as useFunctionPermission, useGetOptions, useHeaderFilter, useLocalHeaderFilter, useLocale, usePlusFormReset, usePlusProConfig, useRenderFlicker, useRenderFlicker as useRenderReFlicker, useSelectWithMapping, useSelectWithPagination, useSortableDrag$1 as useSortableDrag, useTable, useVirtualScroll, useVirtualSelection, useYcAuth, useYcCdn, useYcCdnUrl, useYcComponentConfig, useYcConfig, useYcPerms, useYcShowPageSearch, useYcTranslate, version };
|