@94ai/nf-search-form 6.1.6 → 6.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +2927 -0
- package/lib/nf-search-form-item.vue.d.ts +0 -6
- package/lib/nf-search-form.cjs.js +160 -403
- package/lib/nf-search-form.esm-bundler.js +162 -405
- package/lib/nf-search-form.vue.d.ts +666 -0
- package/lib/types.d.ts +0 -9
- package/package/nf-column-check-dialog.vue +1 -0
- package/package/nf-search-form-item.vue +4 -15
- package/package/nf-search-form.vue +155 -418
- package/package/types.ts +0 -9
- package/package.json +18 -20
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { defineComponent, ref, getCurrentInstance, computed, watch, onBeforeMount, onMounted, nextTick, onBeforeUnmount } from "vue-demi";
|
|
2
2
|
import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
|
|
3
|
-
import { createUniqueString, CachedManager, deepClone
|
|
3
|
+
import { createUniqueString, CachedManager, deepClone } from "@94ai/common-utils";
|
|
4
4
|
import ResizeObserver from "resize-observer-polyfill";
|
|
5
|
-
import {
|
|
5
|
+
import { set } from "vue";
|
|
6
6
|
import { throttle as throttle$1 } from "lodash-es";
|
|
7
|
-
import { ELEMENT_LABEL_TYPE_DEFAULT_VALUE, EXCHANGE_KEY_TYPE } from "@94ai/common-constants";
|
|
8
7
|
import NfMessage from "@94ai/nf-message";
|
|
9
8
|
const __sfc_main$5 = defineComponent({
|
|
10
9
|
name: "NfNumberRange"
|
|
@@ -323,14 +322,6 @@ __sfc_main$3.props = {
|
|
|
323
322
|
required: false,
|
|
324
323
|
type: Number,
|
|
325
324
|
default: 227
|
|
326
|
-
},
|
|
327
|
-
nfSearchFormModel: {
|
|
328
|
-
key: "nfSearchFormModel",
|
|
329
|
-
required: false,
|
|
330
|
-
type: Object,
|
|
331
|
-
default: () => {
|
|
332
|
-
return {};
|
|
333
|
-
}
|
|
334
325
|
}
|
|
335
326
|
};
|
|
336
327
|
__sfc_main$3.setup = (__props, __ctx) => {
|
|
@@ -545,12 +536,9 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
545
536
|
return props.itemOptions.element === "nf-transfer-select";
|
|
546
537
|
});
|
|
547
538
|
const handleChange = (event) => {
|
|
548
|
-
var _a2, _b
|
|
539
|
+
var _a2, _b;
|
|
549
540
|
if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.change) {
|
|
550
|
-
props.itemOptions.events.change(event, instance
|
|
551
|
-
}
|
|
552
|
-
if ((_c = props.itemOptions) == null ? void 0 : _c.changeProps) {
|
|
553
|
-
emit("handleChangeProps", props.itemOptions.changeProps);
|
|
541
|
+
props.itemOptions.events.change(event, instance);
|
|
554
542
|
}
|
|
555
543
|
};
|
|
556
544
|
const handleInput = (event) => {
|
|
@@ -613,7 +601,10 @@ var _sfc_render$3 = function render3() {
|
|
|
613
601
|
style: {
|
|
614
602
|
width: _vm.width
|
|
615
603
|
}
|
|
616
|
-
}, [_vm.slotName ? [_vm._t(_vm.slotName)] : [_vm.isInput ? _c("
|
|
604
|
+
}, [_vm.slotName ? [_vm._t(_vm.slotName)] : [_vm.isInput ? _c("el-input", _vm._g(_vm._b({
|
|
605
|
+
attrs: {
|
|
606
|
+
"placeholder": _vm.itemOptions.placeholder
|
|
607
|
+
},
|
|
617
608
|
on: {
|
|
618
609
|
"input": _vm.handleInput
|
|
619
610
|
},
|
|
@@ -624,7 +615,7 @@ var _sfc_render$3 = function render3() {
|
|
|
624
615
|
},
|
|
625
616
|
expression: "currentVal"
|
|
626
617
|
}
|
|
627
|
-
}, "
|
|
618
|
+
}, "el-input", _vm.bindProps, false), _vm.bindEvents), [_vm._t(_vm.inputSlotPrepend, null, {
|
|
628
619
|
"slot": _vm.inputSlotPrepend
|
|
629
620
|
}), _vm._t(_vm.inputSlotAppend, null, {
|
|
630
621
|
"slot": _vm.inputSlotAppend
|
|
@@ -6695,50 +6686,10 @@ var _sfc_render$1 = function render5() {
|
|
|
6695
6686
|
var _sfc_staticRenderFns$1 = [];
|
|
6696
6687
|
var __component__$1 = /* @__PURE__ */ normalizeComponent(__sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
|
|
6697
6688
|
const ColumnCheckDrawer = __component__$1.exports;
|
|
6698
|
-
/*!
|
|
6699
|
-
* vue-router v3.6.4
|
|
6700
|
-
* (c) 2022 Evan You
|
|
6701
|
-
* @license MIT
|
|
6702
|
-
*/
|
|
6703
|
-
function throwNoCurrentInstance(method) {
|
|
6704
|
-
if (!getCurrentInstance$1()) {
|
|
6705
|
-
throw new Error("[vue-router]: Missing current instance. " + method + "() must be called inside <script setup> or setup().");
|
|
6706
|
-
}
|
|
6707
|
-
}
|
|
6708
|
-
function useRoute() {
|
|
6709
|
-
if (process.env.NODE_ENV !== "production") {
|
|
6710
|
-
throwNoCurrentInstance("useRoute");
|
|
6711
|
-
}
|
|
6712
|
-
var root = getCurrentInstance$1().proxy.$root;
|
|
6713
|
-
if (!root._$route) {
|
|
6714
|
-
var route = effectScope(true).run(function() {
|
|
6715
|
-
return shallowReactive(Object.assign({}, root.$router.currentRoute));
|
|
6716
|
-
});
|
|
6717
|
-
root._$route = route;
|
|
6718
|
-
root.$router.afterEach(function(to) {
|
|
6719
|
-
Object.assign(route, to);
|
|
6720
|
-
});
|
|
6721
|
-
}
|
|
6722
|
-
return root._$route;
|
|
6723
|
-
}
|
|
6724
6689
|
const __sfc_main = defineComponent({
|
|
6725
6690
|
name: "nf-search-form"
|
|
6726
6691
|
});
|
|
6727
6692
|
__sfc_main.props = {
|
|
6728
|
-
isMvc: {
|
|
6729
|
-
key: "isMvc",
|
|
6730
|
-
required: false,
|
|
6731
|
-
type: Boolean,
|
|
6732
|
-
default: false
|
|
6733
|
-
},
|
|
6734
|
-
defaultFormData: {
|
|
6735
|
-
key: "defaultFormData",
|
|
6736
|
-
required: false,
|
|
6737
|
-
type: Object,
|
|
6738
|
-
default: () => {
|
|
6739
|
-
return {};
|
|
6740
|
-
}
|
|
6741
|
-
},
|
|
6742
6693
|
upIcon: {
|
|
6743
6694
|
key: "upIcon",
|
|
6744
6695
|
required: false,
|
|
@@ -6914,7 +6865,7 @@ __sfc_main.props = {
|
|
|
6914
6865
|
labelWidth: {
|
|
6915
6866
|
key: "labelWidth",
|
|
6916
6867
|
required: false,
|
|
6917
|
-
type:
|
|
6868
|
+
type: Number,
|
|
6918
6869
|
default: 150
|
|
6919
6870
|
},
|
|
6920
6871
|
formOptions: {
|
|
@@ -6951,7 +6902,7 @@ __sfc_main.props = {
|
|
|
6951
6902
|
key: "storageKey",
|
|
6952
6903
|
required: false,
|
|
6953
6904
|
type: String,
|
|
6954
|
-
default: ""
|
|
6905
|
+
default: "nf-search-form-columns-cached-key"
|
|
6955
6906
|
},
|
|
6956
6907
|
checkMode: {
|
|
6957
6908
|
key: "checkMode",
|
|
@@ -7372,98 +7323,13 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7372
7323
|
var _a;
|
|
7373
7324
|
const props = __props;
|
|
7374
7325
|
const emit = __ctx.emit;
|
|
7375
|
-
const routeName = computed(() => useRoute().name);
|
|
7376
7326
|
const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
7377
7327
|
const defaultButtonSlot = ref();
|
|
7378
7328
|
const nfSearchFormRef = ref();
|
|
7379
7329
|
const columnCheckNfDrawer = ref();
|
|
7380
7330
|
const columnCheckDrawer = ref();
|
|
7381
7331
|
const columnCheckDialog = ref();
|
|
7382
|
-
const
|
|
7383
|
-
const changeUpdateKeys = ref([]);
|
|
7384
|
-
const cBtnItems = ref([]);
|
|
7385
|
-
const cStorageKey = ref(props.storageKey || `nf-search-form-columns-cached-key-${routeName.value}`);
|
|
7386
|
-
const nfSearchFormModel = ref(deepClone(props.defaultFormData));
|
|
7387
|
-
const setValue = (item, val) => {
|
|
7388
|
-
mapDispose.setValue(nfSearchFormModel.value, item.prop, val);
|
|
7389
|
-
};
|
|
7390
|
-
const setDefaultVal = (item, init = true) => {
|
|
7391
|
-
if (init) {
|
|
7392
|
-
if (mapDispose.hasKey(nfSearchFormModel.value, item.prop)) {
|
|
7393
|
-
return;
|
|
7394
|
-
}
|
|
7395
|
-
}
|
|
7396
|
-
const {
|
|
7397
|
-
element = "",
|
|
7398
|
-
multiple = false
|
|
7399
|
-
} = item;
|
|
7400
|
-
let initValue = null;
|
|
7401
|
-
if (item.hasOwnProperty("initValue")) {
|
|
7402
|
-
initValue = item.initValue;
|
|
7403
|
-
} else if (multiple) {
|
|
7404
|
-
initValue = [];
|
|
7405
|
-
} else if (ELEMENT_LABEL_TYPE_DEFAULT_VALUE.hasOwnProperty(element)) {
|
|
7406
|
-
initValue = ELEMENT_LABEL_TYPE_DEFAULT_VALUE[element];
|
|
7407
|
-
}
|
|
7408
|
-
setValue(item, deepClone(initValue));
|
|
7409
|
-
};
|
|
7410
|
-
const getChangePropKeys = () => {
|
|
7411
|
-
let list = [];
|
|
7412
|
-
props.formOptions.forEach((item) => {
|
|
7413
|
-
list = list.concat(item.changeProps || []);
|
|
7414
|
-
});
|
|
7415
|
-
changeUpdateKeys.value = list;
|
|
7416
|
-
};
|
|
7417
|
-
const triggerGetOptions = async (item) => {
|
|
7418
|
-
if (item.getOptions) {
|
|
7419
|
-
const canSetParams = changeUpdateKeys.value.includes(item.prop);
|
|
7420
|
-
await nextTick();
|
|
7421
|
-
item["options"] = [];
|
|
7422
|
-
item["loading"] = true;
|
|
7423
|
-
item.getOptions((data) => {
|
|
7424
|
-
nextTick(() => {
|
|
7425
|
-
item.loading = false;
|
|
7426
|
-
item.options = data;
|
|
7427
|
-
});
|
|
7428
|
-
}, canSetParams ? getFormData() : {});
|
|
7429
|
-
}
|
|
7430
|
-
};
|
|
7431
|
-
const btnItemsInit = () => {
|
|
7432
|
-
if (!props.btnItems)
|
|
7433
|
-
return;
|
|
7434
|
-
let list = deepClone(props.btnItems);
|
|
7435
|
-
if (validate.isString(props.btnItems)) {
|
|
7436
|
-
list = [...props.btnItems ? [{
|
|
7437
|
-
btnType: props.btnItems
|
|
7438
|
-
}] : []];
|
|
7439
|
-
}
|
|
7440
|
-
list = list.map((item) => {
|
|
7441
|
-
if (validate.isString(item)) {
|
|
7442
|
-
return {
|
|
7443
|
-
btnType: item
|
|
7444
|
-
};
|
|
7445
|
-
} else {
|
|
7446
|
-
return item;
|
|
7447
|
-
}
|
|
7448
|
-
});
|
|
7449
|
-
cBtnItems.value = list;
|
|
7450
|
-
};
|
|
7451
|
-
const handleChangeProps = (changeProps) => {
|
|
7452
|
-
if (changeProps == null ? void 0 : changeProps.length) {
|
|
7453
|
-
props.formOptions.forEach((item) => {
|
|
7454
|
-
if (!changeProps.includes(item.prop))
|
|
7455
|
-
return;
|
|
7456
|
-
setDefaultVal(item, false);
|
|
7457
|
-
triggerGetOptions(item);
|
|
7458
|
-
const list = (item.changeProps || []).filter((item2) => !changeProps.includes(item2));
|
|
7459
|
-
if (list.length) {
|
|
7460
|
-
nextTick(() => {
|
|
7461
|
-
handleChangeProps(list);
|
|
7462
|
-
});
|
|
7463
|
-
}
|
|
7464
|
-
});
|
|
7465
|
-
}
|
|
7466
|
-
};
|
|
7332
|
+
const nfSearchFormModel = ref({});
|
|
7467
7333
|
const initLocalShow = (init = false) => {
|
|
7468
7334
|
if (!init) {
|
|
7469
7335
|
props.formOptions._skip = true;
|
|
@@ -7486,17 +7352,15 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7486
7352
|
return props.formOptions.map((item) => item.prop);
|
|
7487
7353
|
};
|
|
7488
7354
|
const localShowItems = ref(initLocalShow(true));
|
|
7489
|
-
watch(() =>
|
|
7355
|
+
watch(() => {
|
|
7490
7356
|
var _a2;
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
}
|
|
7357
|
+
return (_a2 = localShowItems.value) == null ? void 0 : _a2.length;
|
|
7358
|
+
}, async () => {
|
|
7359
|
+
emit("update:showItems", localShowItems.value);
|
|
7360
|
+
if (Object.keys(nfSearchFormModel.value).length) {
|
|
7361
|
+
refreshNfSearchFormModel(false);
|
|
7497
7362
|
}
|
|
7498
7363
|
}, {
|
|
7499
|
-
deep: true,
|
|
7500
7364
|
immediate: true
|
|
7501
7365
|
});
|
|
7502
7366
|
const syncLocalShowColumnToCookies = () => {
|
|
@@ -7510,7 +7374,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7510
7374
|
index: index2
|
|
7511
7375
|
};
|
|
7512
7376
|
});
|
|
7513
|
-
CachedManager.syncCachedSet(
|
|
7377
|
+
CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
7514
7378
|
}
|
|
7515
7379
|
};
|
|
7516
7380
|
const syncShowItemToInitHidden = () => {
|
|
@@ -7538,9 +7402,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7538
7402
|
const syncCookiesToLocalShowColumn = async (refreshModel = false) => {
|
|
7539
7403
|
if (props.columnEdit) {
|
|
7540
7404
|
try {
|
|
7541
|
-
let columnState = CachedManager.syncCachedGet(
|
|
7405
|
+
let columnState = CachedManager.syncCachedGet(props.storageKey);
|
|
7542
7406
|
if (!columnState) {
|
|
7543
|
-
columnState = await CachedManager.asyncCachedGet(
|
|
7407
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey);
|
|
7544
7408
|
}
|
|
7545
7409
|
if (columnState) {
|
|
7546
7410
|
if (typeof columnState === "string") {
|
|
@@ -7565,9 +7429,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7565
7429
|
const initCachedData = async () => {
|
|
7566
7430
|
var _a2, _b;
|
|
7567
7431
|
if (props.columnEdit) {
|
|
7568
|
-
let cached = CachedManager.syncCachedGet(
|
|
7432
|
+
let cached = CachedManager.syncCachedGet(props.storageKey);
|
|
7569
7433
|
if (!cached) {
|
|
7570
|
-
cached = await CachedManager.asyncCachedGet(
|
|
7434
|
+
cached = await CachedManager.asyncCachedGet(props.storageKey);
|
|
7571
7435
|
}
|
|
7572
7436
|
const cachedPriority = props.priority === "cached";
|
|
7573
7437
|
if (cachedPriority ? cached : (_a2 = localShowItems.value) == null ? void 0 : _a2.length) {
|
|
@@ -7583,12 +7447,23 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7583
7447
|
const isShowBtnBoxSlot = computed(() => {
|
|
7584
7448
|
return instance == null ? void 0 : instance.$slots.btnBox;
|
|
7585
7449
|
});
|
|
7586
|
-
const
|
|
7587
|
-
|
|
7450
|
+
const renderSearchFormItemOptions = ref([]);
|
|
7451
|
+
let initSearchForm = true;
|
|
7452
|
+
const syncCookiesToSearchFormItemOptions = async (readCached = true) => {
|
|
7453
|
+
props.formOptions._skip = true;
|
|
7454
|
+
const columns = props.formOptions.map((item, index2) => {
|
|
7455
|
+
item.key = item.key || createUniqueString();
|
|
7456
|
+
item._index = index2;
|
|
7457
|
+
item.__index = index2;
|
|
7458
|
+
set(item, "initHidden", !!item.initHidden);
|
|
7459
|
+
set(item, "destory", !!item.destory);
|
|
7460
|
+
return item;
|
|
7461
|
+
});
|
|
7462
|
+
if (readCached && props.columnEdit) {
|
|
7588
7463
|
try {
|
|
7589
|
-
let columnState = CachedManager.syncCachedGet(
|
|
7464
|
+
let columnState = CachedManager.syncCachedGet(props.storageKey);
|
|
7590
7465
|
if (!columnState) {
|
|
7591
|
-
columnState = await CachedManager.asyncCachedGet(
|
|
7466
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey);
|
|
7592
7467
|
}
|
|
7593
7468
|
props.formOptions._skip = true;
|
|
7594
7469
|
if (columnState) {
|
|
@@ -7611,24 +7486,6 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7611
7486
|
console.log(e);
|
|
7612
7487
|
}
|
|
7613
7488
|
}
|
|
7614
|
-
};
|
|
7615
|
-
const renderSearchFormItemOptions = ref([]);
|
|
7616
|
-
let initSearchForm = true;
|
|
7617
|
-
const syncCookiesToSearchFormItemOptions = async (readCached = true) => {
|
|
7618
|
-
props.formOptions._skip = true;
|
|
7619
|
-
const columns = props.formOptions.map((item, index2) => {
|
|
7620
|
-
item.key = item.key || createUniqueString();
|
|
7621
|
-
item._index = index2;
|
|
7622
|
-
item.__index = index2;
|
|
7623
|
-
set(item, "initHidden", !!item.initHidden);
|
|
7624
|
-
set(item, "destory", !!item.destory);
|
|
7625
|
-
if (!item.options)
|
|
7626
|
-
set(item, "options", []);
|
|
7627
|
-
return item;
|
|
7628
|
-
});
|
|
7629
|
-
if (readCached) {
|
|
7630
|
-
await handleColumnsInitHideAndSort(columns);
|
|
7631
|
-
}
|
|
7632
7489
|
renderSearchFormItemOptions.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
|
|
7633
7490
|
nextTick(() => {
|
|
7634
7491
|
if (initSearchForm) {
|
|
@@ -7640,11 +7497,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7640
7497
|
};
|
|
7641
7498
|
syncCookiesToSearchFormItemOptions();
|
|
7642
7499
|
const itemIsShow = (item) => {
|
|
7643
|
-
|
|
7644
|
-
return !item.initHidden && !item.destory && (validate.isFunction(item.show) ? (_a2 = item == null ? void 0 : item.show) == null ? void 0 : _a2.call(item, nfSearchFormModel.value) : true);
|
|
7645
|
-
};
|
|
7646
|
-
const btnIsShow = (item) => {
|
|
7647
|
-
return item.show ? item.show(nfSearchFormModel.value) : true;
|
|
7500
|
+
return !item.initHidden && !item.destory;
|
|
7648
7501
|
};
|
|
7649
7502
|
watch(() => nfSearchFormModel.value, () => {
|
|
7650
7503
|
emit("onChange", nfSearchFormModel.value);
|
|
@@ -7671,26 +7524,30 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7671
7524
|
}, {
|
|
7672
7525
|
deep: true
|
|
7673
7526
|
});
|
|
7674
|
-
|
|
7675
|
-
formsInit();
|
|
7527
|
+
refreshNfSearchFormModel(false, true);
|
|
7676
7528
|
});
|
|
7677
|
-
const refreshNfSearchFormModel = () => {
|
|
7529
|
+
const refreshNfSearchFormModel = (outEmit = true, init = false) => {
|
|
7530
|
+
const obj = {};
|
|
7678
7531
|
props.formOptions.filter((item) => !item.destory).forEach((v) => {
|
|
7679
|
-
if (
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7532
|
+
if (localShowItems.value.includes(v.prop)) {
|
|
7533
|
+
if (init) {
|
|
7534
|
+
if (v.initValue !== void 0) {
|
|
7535
|
+
obj[v.prop] = v.initValue;
|
|
7536
|
+
} else {
|
|
7537
|
+
obj[v.prop] = null;
|
|
7538
|
+
}
|
|
7539
|
+
} else {
|
|
7540
|
+
const value = nfSearchFormModel.value[v.prop];
|
|
7541
|
+
obj[v.prop] = typeof value === "undefined" ? null : value;
|
|
7542
|
+
}
|
|
7683
7543
|
}
|
|
7684
7544
|
});
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
setDefaultVal(item, true);
|
|
7692
|
-
triggerGetOptions(item);
|
|
7693
|
-
});
|
|
7545
|
+
if (JSON.stringify(nfSearchFormModel.value) !== JSON.stringify(obj)) {
|
|
7546
|
+
nfSearchFormModel.value = obj;
|
|
7547
|
+
if (outEmit) {
|
|
7548
|
+
emit("itemsChange", localShowItems.value);
|
|
7549
|
+
}
|
|
7550
|
+
}
|
|
7694
7551
|
};
|
|
7695
7552
|
const isCollapseChange = async (val) => {
|
|
7696
7553
|
emit("isCollapseChange", val);
|
|
@@ -7768,25 +7625,14 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7768
7625
|
};
|
|
7769
7626
|
const onNfSearchFormSearch = () => {
|
|
7770
7627
|
onNfSearchFormValidate(() => {
|
|
7771
|
-
emit("onSearch",
|
|
7628
|
+
emit("onSearch", nfSearchFormModel.value);
|
|
7772
7629
|
});
|
|
7773
7630
|
};
|
|
7774
7631
|
const onNfSearchFormExport = () => {
|
|
7775
7632
|
onNfSearchFormValidate(() => {
|
|
7776
|
-
emit("onExport",
|
|
7633
|
+
emit("onExport", nfSearchFormModel.value);
|
|
7777
7634
|
});
|
|
7778
7635
|
};
|
|
7779
|
-
const onNfSearchFormClick = (item) => {
|
|
7780
|
-
var _a2;
|
|
7781
|
-
if (item.validate) {
|
|
7782
|
-
onNfSearchFormValidate(() => {
|
|
7783
|
-
var _a3;
|
|
7784
|
-
(_a3 = item.onClick) == null ? void 0 : _a3.call(item, getFormData());
|
|
7785
|
-
});
|
|
7786
|
-
} else {
|
|
7787
|
-
(_a2 = item.onClick) == null ? void 0 : _a2.call(item, getFormData());
|
|
7788
|
-
}
|
|
7789
|
-
};
|
|
7790
7636
|
const hiddenNfSearchFormItemOptionField = async (prop) => {
|
|
7791
7637
|
prop.formOptions._skip = true;
|
|
7792
7638
|
prop.formOptions.every((item) => {
|
|
@@ -7834,10 +7680,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7834
7680
|
}
|
|
7835
7681
|
};
|
|
7836
7682
|
async function clearDragCached() {
|
|
7837
|
-
await CachedManager.asyncCachedSet(`${
|
|
7683
|
+
await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, null);
|
|
7838
7684
|
}
|
|
7839
7685
|
async function clearColumnEditCached() {
|
|
7840
|
-
await CachedManager.asyncCachedSet(
|
|
7686
|
+
await CachedManager.asyncCachedSet(props.storageKey, null);
|
|
7841
7687
|
}
|
|
7842
7688
|
const nfSearchFormItemOptionFieldsSave = async (value) => {
|
|
7843
7689
|
columnCheckConfirmFeedback(value);
|
|
@@ -7846,64 +7692,28 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7846
7692
|
await nextTick();
|
|
7847
7693
|
refreshLabel();
|
|
7848
7694
|
};
|
|
7849
|
-
const handleExchangeKey = (data) => {
|
|
7850
|
-
props.formOptions.forEach((item) => {
|
|
7851
|
-
var _a2, _b, _c, _d;
|
|
7852
|
-
if (!item.exchangeKey)
|
|
7853
|
-
return;
|
|
7854
|
-
const {
|
|
7855
|
-
type,
|
|
7856
|
-
value
|
|
7857
|
-
} = item.exchangeKey;
|
|
7858
|
-
const key = item.prop;
|
|
7859
|
-
if (type === EXCHANGE_KEY_TYPE.range) {
|
|
7860
|
-
(_a2 = value == null ? void 0 : value.forEach) == null ? void 0 : _a2.call(value, (k, i) => {
|
|
7861
|
-
var _a3;
|
|
7862
|
-
data[k] = ((_a3 = data == null ? void 0 : data[key]) == null ? void 0 : _a3[i]) || null;
|
|
7863
|
-
});
|
|
7864
|
-
delete data[key];
|
|
7865
|
-
} else if (type === EXCHANGE_KEY_TYPE.multiple) {
|
|
7866
|
-
data[key] = (_d = (_c = (_b = data[key]) == null ? void 0 : _b.trim()) == null ? void 0 : _c.split(value || ",")) == null ? void 0 : _d.filter((s) => s !== "");
|
|
7867
|
-
}
|
|
7868
|
-
});
|
|
7869
|
-
};
|
|
7870
|
-
const getFormData = () => {
|
|
7871
|
-
const data = deepClone(nfSearchFormModel.value);
|
|
7872
|
-
handleExchangeKey(data);
|
|
7873
|
-
return data;
|
|
7874
|
-
};
|
|
7875
7695
|
return Object.assign({
|
|
7876
7696
|
defaultButtonSlot,
|
|
7877
7697
|
nfSearchFormRef,
|
|
7878
7698
|
columnCheckNfDrawer,
|
|
7879
7699
|
columnCheckDrawer,
|
|
7880
7700
|
columnCheckDialog,
|
|
7881
|
-
useLabelWidth,
|
|
7882
|
-
cBtnItems,
|
|
7883
|
-
cStorageKey,
|
|
7884
7701
|
nfSearchFormModel,
|
|
7885
|
-
handleChangeProps,
|
|
7886
7702
|
configNfSearchItemVisibleDialog,
|
|
7887
7703
|
newColumns,
|
|
7888
7704
|
isShowBtnBoxSlot,
|
|
7889
7705
|
renderSearchFormItemOptions,
|
|
7890
7706
|
itemIsShow,
|
|
7891
|
-
btnIsShow,
|
|
7892
7707
|
showBtnBoxLabel,
|
|
7893
7708
|
isCollapseChange,
|
|
7894
7709
|
topDom,
|
|
7895
7710
|
resetNfSearchFormModel,
|
|
7896
7711
|
onNfSearchFormSearch,
|
|
7897
7712
|
onNfSearchFormExport,
|
|
7898
|
-
onNfSearchFormClick,
|
|
7899
7713
|
hiddenNfSearchFormItemOptionField,
|
|
7900
7714
|
columnCheckConfirm,
|
|
7901
7715
|
nfSearchFormItemOptionFieldsSave
|
|
7902
7716
|
}, {
|
|
7903
|
-
/**
|
|
7904
|
-
* 获取表单实时数据(已深拷贝)
|
|
7905
|
-
*/
|
|
7906
|
-
getFormData,
|
|
7907
7717
|
/**
|
|
7908
7718
|
* 列编辑显示的列prop
|
|
7909
7719
|
*/
|
|
@@ -7999,9 +7809,6 @@ var _sfc_render = function render6() {
|
|
|
7999
7809
|
"model": _vm.nfSearchFormModel,
|
|
8000
7810
|
"inline": _vm.inline,
|
|
8001
7811
|
"label-position": _vm.labelPosition,
|
|
8002
|
-
"label-width": _vm.useLabelWidth,
|
|
8003
|
-
"size": _vm.size,
|
|
8004
|
-
"disabled": _vm.disabled,
|
|
8005
7812
|
"rules": _vm.rules,
|
|
8006
7813
|
"label-suffix": _vm.labelSuffix,
|
|
8007
7814
|
"hide-required-asterisk": _vm.hideRequiredAsterisk,
|
|
@@ -8009,6 +7816,9 @@ var _sfc_render = function render6() {
|
|
|
8009
7816
|
"inline-message": _vm.inlineMessage,
|
|
8010
7817
|
"status-icon": _vm.statusIcon,
|
|
8011
7818
|
"validate-on-rule-change": _vm.validateOnRuleChange,
|
|
7819
|
+
"size": _vm.size,
|
|
7820
|
+
"disabled": _vm.disabled,
|
|
7821
|
+
"label-width": _vm.labelWidth + "px",
|
|
8012
7822
|
"expand-btn-type": _vm.expandBtnType,
|
|
8013
7823
|
"expand-btn-icon": _vm.expandBtnIcon,
|
|
8014
7824
|
"expand-btn-plain": _vm.expandBtnPlain,
|
|
@@ -8051,11 +7861,7 @@ var _sfc_render = function render6() {
|
|
|
8051
7861
|
key: item.key,
|
|
8052
7862
|
attrs: {
|
|
8053
7863
|
"item-width": _vm.itemWidth,
|
|
8054
|
-
"item-options": item
|
|
8055
|
-
"nfSearchFormModel": _vm.nfSearchFormModel
|
|
8056
|
-
},
|
|
8057
|
-
on: {
|
|
8058
|
-
"handleChangeProps": _vm.handleChangeProps
|
|
7864
|
+
"item-options": item
|
|
8059
7865
|
},
|
|
8060
7866
|
model: {
|
|
8061
7867
|
value: _vm.nfSearchFormModel[item.prop],
|
|
@@ -8067,8 +7873,7 @@ var _sfc_render = function render6() {
|
|
|
8067
7873
|
}, [item.tooltip ? _vm._t(item.tooltip.slot, null, {
|
|
8068
7874
|
"slot": item.tooltip.slot
|
|
8069
7875
|
}) : _vm._e(), item.slot ? _vm._t(item.slot, null, {
|
|
8070
|
-
"slot": item.slot
|
|
8071
|
-
"formData": _vm.nfSearchFormModel
|
|
7876
|
+
"slot": item.slot
|
|
8072
7877
|
}) : _vm._e(), ((_a = item.inputSlot) == null ? void 0 : _a.prepend) ? _vm._t((_b = item.inputSlot) == null ? void 0 : _b.prepend, null, {
|
|
8073
7878
|
"slot": (_c2 = item.inputSlot) == null ? void 0 : _c2.prepend
|
|
8074
7879
|
}) : _vm._e(), ((_d = item.inputSlot) == null ? void 0 : _d.append) ? _vm._t((_e = item.inputSlot) == null ? void 0 : _e.append, null, {
|
|
@@ -8105,76 +7910,52 @@ var _sfc_render = function render6() {
|
|
|
8105
7910
|
}
|
|
8106
7911
|
}, [_c("div", {
|
|
8107
7912
|
staticClass: "nf-flex nf-flex-align-items-start"
|
|
8108
|
-
}, [_vm.isShowBtnBoxSlot && !_vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e(), _vm.
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
},
|
|
8155
|
-
on: {
|
|
8156
|
-
"click": _vm.resetNfSearchFormModel
|
|
8157
|
-
}
|
|
8158
|
-
}, [_vm._v(_vm._s(_vm.resetBtnText) + " ")]) : _vm.btnIsShow(item) ? _c("nf-button", {
|
|
8159
|
-
key: "btn-" + idx,
|
|
8160
|
-
class: item.class,
|
|
8161
|
-
attrs: {
|
|
8162
|
-
"type": item.type || _vm.queryBtnType,
|
|
8163
|
-
"icon": item.icon || _vm.queryBtnIcon,
|
|
8164
|
-
"plain": item.plain || _vm.queryBtnPlain,
|
|
8165
|
-
"size": item.size || _vm.size,
|
|
8166
|
-
"round": item.round || _vm.queryBtnRound,
|
|
8167
|
-
"circle": item.circle || _vm.queryBtnCircle,
|
|
8168
|
-
"loading": item.loading || _vm.queryBtnLoading,
|
|
8169
|
-
"disabled": item.disabled || _vm.queryBtnDisabled
|
|
8170
|
-
},
|
|
8171
|
-
on: {
|
|
8172
|
-
"click": function($event) {
|
|
8173
|
-
return _vm.onNfSearchFormClick(item);
|
|
8174
|
-
}
|
|
8175
|
-
}
|
|
8176
|
-
}, [_vm._v(_vm._s(item.name) + " ")]) : _vm._e()];
|
|
8177
|
-
}), _vm.columnEdit ? _c("nf-button", {
|
|
7913
|
+
}, [_vm.isShowBtnBoxSlot && !_vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e(), _vm.btnItems.includes("search") ? _c("nf-button", {
|
|
7914
|
+
class: (_vm.queryBtnClass || "") + " nf-btn-search",
|
|
7915
|
+
attrs: {
|
|
7916
|
+
"type": _vm.queryBtnType,
|
|
7917
|
+
"icon": _vm.queryBtnIcon,
|
|
7918
|
+
"plain": _vm.queryBtnPlain,
|
|
7919
|
+
"size": _vm.queryBtnSize,
|
|
7920
|
+
"round": _vm.queryBtnRound,
|
|
7921
|
+
"circle": _vm.queryBtnCircle,
|
|
7922
|
+
"loading": _vm.queryBtnLoading,
|
|
7923
|
+
"disabled": _vm.queryBtnDisabled
|
|
7924
|
+
},
|
|
7925
|
+
on: {
|
|
7926
|
+
"click": _vm.onNfSearchFormSearch
|
|
7927
|
+
}
|
|
7928
|
+
}, [_vm._v(_vm._s(_vm.queryBtnText) + " ")]) : _vm._e(), _vm.btnItems.includes("export") ? _c("nf-button", {
|
|
7929
|
+
class: (_vm.exportBtnClass || "") + " nf-btn-export",
|
|
7930
|
+
attrs: {
|
|
7931
|
+
"type": _vm.exportBtnType,
|
|
7932
|
+
"icon": _vm.exportBtnIcon,
|
|
7933
|
+
"plain": _vm.exportBtnPlain,
|
|
7934
|
+
"size": _vm.exportBtnSize,
|
|
7935
|
+
"round": _vm.exportBtnRound,
|
|
7936
|
+
"circle": _vm.exportBtnCircle,
|
|
7937
|
+
"loading": _vm.exportBtnLoading,
|
|
7938
|
+
"disabled": _vm.exportBtnDisabled
|
|
7939
|
+
},
|
|
7940
|
+
on: {
|
|
7941
|
+
"click": _vm.onNfSearchFormExport
|
|
7942
|
+
}
|
|
7943
|
+
}, [_vm._v(_vm._s(_vm.exportBtnText) + " ")]) : _vm._e(), _vm.btnItems.includes("reset") ? _c("nf-button", {
|
|
7944
|
+
class: (_vm.resetBtnClass || "") + " nf-btn-reset",
|
|
7945
|
+
attrs: {
|
|
7946
|
+
"type": _vm.resetBtnType,
|
|
7947
|
+
"icon": _vm.resetBtnIcon,
|
|
7948
|
+
"plain": _vm.resetBtnPlain,
|
|
7949
|
+
"size": _vm.resetBtnSize,
|
|
7950
|
+
"round": _vm.resetBtnRound,
|
|
7951
|
+
"circle": _vm.resetBtnCircle,
|
|
7952
|
+
"loading": _vm.resetBtnLoading,
|
|
7953
|
+
"disabled": _vm.resetBtnDisabled
|
|
7954
|
+
},
|
|
7955
|
+
on: {
|
|
7956
|
+
"click": _vm.resetNfSearchFormModel
|
|
7957
|
+
}
|
|
7958
|
+
}, [_vm._v(_vm._s(_vm.resetBtnText) + " ")]) : _vm._e(), _vm.columnEdit ? _c("nf-button", {
|
|
8178
7959
|
class: (_vm.checkBtnClass || "") + " nf-btn-check",
|
|
8179
7960
|
attrs: {
|
|
8180
7961
|
"type": _vm.checkBtnType,
|
|
@@ -8201,76 +7982,52 @@ var _sfc_render = function render6() {
|
|
|
8201
7982
|
staticClass: "iconfont icon-shaixuan1 nf-fs12"
|
|
8202
7983
|
})])])], 1) : _vm._e(), _vm.isShowBtnBoxSlot && _vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e()], 2)]) : _vm._e()], 2), _vm.btnModel === "block" ? _c("div", {
|
|
8203
7984
|
staticClass: "nf-flex nf-flex-align-items nf-mt10"
|
|
8204
|
-
}, [_vm.isShowBtnBoxSlot && !_vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e(), _vm.
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
},
|
|
8251
|
-
on: {
|
|
8252
|
-
"click": _vm.resetNfSearchFormModel
|
|
8253
|
-
}
|
|
8254
|
-
}, [_vm._v(_vm._s(_vm.resetBtnText) + " ")]) : _vm.btnIsShow(item) ? _c("nf-button", {
|
|
8255
|
-
key: "btn-" + idx,
|
|
8256
|
-
class: item.class,
|
|
8257
|
-
attrs: {
|
|
8258
|
-
"type": item.type || _vm.queryBtnType,
|
|
8259
|
-
"icon": item.icon || _vm.queryBtnIcon,
|
|
8260
|
-
"plain": item.plain || _vm.queryBtnPlain,
|
|
8261
|
-
"size": item.size || _vm.size,
|
|
8262
|
-
"round": item.round || _vm.queryBtnRound,
|
|
8263
|
-
"circle": item.circle || _vm.queryBtnCircle,
|
|
8264
|
-
"loading": item.loading || _vm.queryBtnLoading,
|
|
8265
|
-
"disabled": item.disabled || _vm.queryBtnDisabled
|
|
8266
|
-
},
|
|
8267
|
-
on: {
|
|
8268
|
-
"click": function($event) {
|
|
8269
|
-
return _vm.onNfSearchFormClick(item);
|
|
8270
|
-
}
|
|
8271
|
-
}
|
|
8272
|
-
}, [_vm._v(_vm._s(item.name) + " ")]) : _vm._e()];
|
|
8273
|
-
}), _vm.columnEdit ? _c("nf-button", {
|
|
7985
|
+
}, [_vm.isShowBtnBoxSlot && !_vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e(), _vm.btnItems.includes("search") ? _c("nf-button", {
|
|
7986
|
+
class: (_vm.queryBtnClass || "") + " nf-btn-search",
|
|
7987
|
+
attrs: {
|
|
7988
|
+
"type": _vm.queryBtnType,
|
|
7989
|
+
"icon": _vm.queryBtnIcon,
|
|
7990
|
+
"plain": _vm.queryBtnPlain,
|
|
7991
|
+
"size": _vm.queryBtnSize || _vm.size,
|
|
7992
|
+
"round": _vm.queryBtnRound,
|
|
7993
|
+
"circle": _vm.queryBtnCircle,
|
|
7994
|
+
"loading": _vm.queryBtnLoading,
|
|
7995
|
+
"disabled": _vm.queryBtnDisabled
|
|
7996
|
+
},
|
|
7997
|
+
on: {
|
|
7998
|
+
"click": _vm.onNfSearchFormSearch
|
|
7999
|
+
}
|
|
8000
|
+
}, [_vm._v(_vm._s(_vm.queryBtnText) + " ")]) : _vm._e(), _vm.btnItems.includes("export") ? _c("nf-button", {
|
|
8001
|
+
class: (_vm.exportBtnClass || "") + " nf-btn-export",
|
|
8002
|
+
attrs: {
|
|
8003
|
+
"type": _vm.exportBtnType,
|
|
8004
|
+
"icon": _vm.exportBtnIcon,
|
|
8005
|
+
"plain": _vm.exportBtnPlain,
|
|
8006
|
+
"size": _vm.exportBtnSize || _vm.size,
|
|
8007
|
+
"round": _vm.exportBtnRound,
|
|
8008
|
+
"circle": _vm.exportBtnCircle,
|
|
8009
|
+
"loading": _vm.exportBtnLoading,
|
|
8010
|
+
"disabled": _vm.exportBtnDisabled
|
|
8011
|
+
},
|
|
8012
|
+
on: {
|
|
8013
|
+
"click": _vm.onNfSearchFormExport
|
|
8014
|
+
}
|
|
8015
|
+
}, [_vm._v(_vm._s(_vm.exportBtnText) + " ")]) : _vm._e(), _vm.btnItems.includes("reset") ? _c("nf-button", {
|
|
8016
|
+
class: (_vm.resetBtnClass || "") + " nf-btn-reset",
|
|
8017
|
+
attrs: {
|
|
8018
|
+
"type": _vm.resetBtnType,
|
|
8019
|
+
"icon": _vm.resetBtnIcon,
|
|
8020
|
+
"plain": _vm.resetBtnPlain,
|
|
8021
|
+
"size": _vm.resetBtnSize || _vm.size,
|
|
8022
|
+
"round": _vm.resetBtnRound,
|
|
8023
|
+
"circle": _vm.resetBtnCircle,
|
|
8024
|
+
"loading": _vm.resetBtnLoading,
|
|
8025
|
+
"disabled": _vm.resetBtnDisabled
|
|
8026
|
+
},
|
|
8027
|
+
on: {
|
|
8028
|
+
"click": _vm.resetNfSearchFormModel
|
|
8029
|
+
}
|
|
8030
|
+
}, [_vm._v(_vm._s(_vm.resetBtnText) + " ")]) : _vm._e(), _vm.columnEdit ? _c("nf-button", {
|
|
8274
8031
|
class: (_vm.checkBtnClass || "") + " nf-btn-check",
|
|
8275
8032
|
attrs: {
|
|
8276
8033
|
"type": _vm.checkBtnType,
|
|
@@ -8304,7 +8061,7 @@ var _sfc_render = function render6() {
|
|
|
8304
8061
|
"basic-field-desc": _vm.columnCheckBasicFieldDesc,
|
|
8305
8062
|
"show": _vm.configNfSearchItemVisibleDialog,
|
|
8306
8063
|
"modal-append-to-body": _vm.modalAppendToBody,
|
|
8307
|
-
"storage-key": _vm.
|
|
8064
|
+
"storage-key": _vm.storageKey,
|
|
8308
8065
|
"table-columns": _vm.formOptions,
|
|
8309
8066
|
"width": _vm.moreDialogWidth,
|
|
8310
8067
|
"modal": _vm.modal,
|
|
@@ -8377,7 +8134,7 @@ var _sfc_render = function render6() {
|
|
|
8377
8134
|
"select-empty-warning-tips": _vm.selectEmptyWarningTips,
|
|
8378
8135
|
"get-checked-length-desc": _vm.columnCheckGetCheckedLengthDesc,
|
|
8379
8136
|
"get-all-check-desc": _vm.columnCheckGetAllCheckDesc,
|
|
8380
|
-
"storage-key": _vm.
|
|
8137
|
+
"storage-key": _vm.storageKey,
|
|
8381
8138
|
"table-columns": _vm.formOptions,
|
|
8382
8139
|
"column-edit": _vm.columnEdit
|
|
8383
8140
|
}
|