widget.qw 1.1.1 → 1.1.2
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/build/style.css +19 -19
- package/build/widget.qw.es.js +77 -12
- package/build/widget.qw.umd.js +76 -11
- package/package.json +1 -1
- package/src/components/CascaderPop.vue +41 -8
- package/src/util/array_util.js +30 -8
package/build/style.css
CHANGED
|
@@ -675,25 +675,25 @@
|
|
|
675
675
|
margin:3px;
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
.cascader-pop[data-v-
|
|
678
|
+
.cascader-pop[data-v-36e65e12] {
|
|
679
679
|
width: 100%;
|
|
680
680
|
overflow: hidden;
|
|
681
681
|
}
|
|
682
|
-
.cascader-selector[data-v-
|
|
682
|
+
.cascader-selector[data-v-36e65e12] {
|
|
683
683
|
padding: 10px;
|
|
684
684
|
}
|
|
685
|
-
.search-buttons[data-v-
|
|
685
|
+
.search-buttons[data-v-36e65e12] {
|
|
686
686
|
display: flex;
|
|
687
687
|
gap: 10px;
|
|
688
688
|
}
|
|
689
|
-
.clear-btn[data-v-
|
|
689
|
+
.clear-btn[data-v-36e65e12] {
|
|
690
690
|
background-color: #f2f3f5;
|
|
691
691
|
border: none;
|
|
692
692
|
border-radius: 4px;
|
|
693
693
|
padding: 4px 8px;
|
|
694
694
|
font-size: 14px;
|
|
695
695
|
}
|
|
696
|
-
.confirm-btn[data-v-
|
|
696
|
+
.confirm-btn[data-v-36e65e12] {
|
|
697
697
|
background-color: #1989fa;
|
|
698
698
|
color: white;
|
|
699
699
|
border: none;
|
|
@@ -701,19 +701,19 @@
|
|
|
701
701
|
padding: 4px 8px;
|
|
702
702
|
font-size: 14px;
|
|
703
703
|
}
|
|
704
|
-
.no-results[data-v-
|
|
704
|
+
.no-results[data-v-36e65e12] {
|
|
705
705
|
text-align: center;
|
|
706
706
|
padding: 20px;
|
|
707
707
|
color: #969799;
|
|
708
708
|
}
|
|
709
|
-
.cascader-header[data-v-
|
|
709
|
+
.cascader-header[data-v-36e65e12] {
|
|
710
710
|
padding: 10px;
|
|
711
711
|
border-bottom: 1px solid #ebedf0;
|
|
712
712
|
display: flex;
|
|
713
713
|
justify-content: space-between;
|
|
714
714
|
align-items: center;
|
|
715
715
|
}
|
|
716
|
-
.current-path[data-v-
|
|
716
|
+
.current-path[data-v-36e65e12] {
|
|
717
717
|
flex: 1;
|
|
718
718
|
font-size: 14px;
|
|
719
719
|
margin-left: 5px;
|
|
@@ -722,25 +722,25 @@
|
|
|
722
722
|
overflow: hidden;
|
|
723
723
|
text-overflow: ellipsis;
|
|
724
724
|
}
|
|
725
|
-
.header-right[data-v-
|
|
725
|
+
.header-right[data-v-36e65e12] {
|
|
726
726
|
display: flex;
|
|
727
727
|
gap: 8px;
|
|
728
728
|
margin-left: auto;
|
|
729
729
|
}
|
|
730
|
-
.cancel-btn[data-v-
|
|
730
|
+
.cancel-btn[data-v-36e65e12] {
|
|
731
731
|
color: #969799;
|
|
732
732
|
margin-right: 5px;
|
|
733
733
|
}
|
|
734
|
-
.scroll-container[data-v-
|
|
734
|
+
.scroll-container[data-v-36e65e12] {
|
|
735
735
|
height: calc(80vh - 150px);
|
|
736
736
|
overflow-y: auto;
|
|
737
737
|
}
|
|
738
|
-
.cell-content[data-v-
|
|
738
|
+
.cell-content[data-v-36e65e12] {
|
|
739
739
|
display: flex;
|
|
740
740
|
align-items: center;
|
|
741
741
|
gap: 12px;
|
|
742
742
|
}
|
|
743
|
-
.circle-selector[data-v-
|
|
743
|
+
.circle-selector[data-v-36e65e12] {
|
|
744
744
|
width: 20px;
|
|
745
745
|
height: 20px;
|
|
746
746
|
border-radius: 50%;
|
|
@@ -750,29 +750,29 @@
|
|
|
750
750
|
transition: all 0.2s;
|
|
751
751
|
flex-shrink: 0;
|
|
752
752
|
}
|
|
753
|
-
.circle-selector.selected[data-v-
|
|
753
|
+
.circle-selector.selected[data-v-36e65e12] {
|
|
754
754
|
background-color: #1989fa;
|
|
755
755
|
border-color: #1989fa;
|
|
756
756
|
}
|
|
757
|
-
.circle-selector.selected .van-icon[data-v-
|
|
757
|
+
.circle-selector.selected .van-icon[data-v-36e65e12] {
|
|
758
758
|
color: white;
|
|
759
759
|
font-size: 14px;
|
|
760
760
|
}
|
|
761
|
-
.van-cell__right-icon[data-v-
|
|
761
|
+
.van-cell__right-icon[data-v-36e65e12] {
|
|
762
762
|
color: #969799;
|
|
763
763
|
font-size: 16px;
|
|
764
764
|
margin-left: 8px;
|
|
765
765
|
}
|
|
766
|
-
.name[data-v-
|
|
766
|
+
.name[data-v-36e65e12] {
|
|
767
767
|
flex: 1;
|
|
768
768
|
overflow: hidden;
|
|
769
769
|
text-overflow: ellipsis;
|
|
770
770
|
white-space: nowrap;
|
|
771
771
|
}
|
|
772
|
-
.cancel-btn[data-v-
|
|
772
|
+
.cancel-btn[data-v-36e65e12] {
|
|
773
773
|
color: #969799;
|
|
774
774
|
}
|
|
775
|
-
.search-field[data-v-
|
|
775
|
+
.search-field[data-v-36e65e12] {
|
|
776
776
|
background: #fff;
|
|
777
777
|
padding: 10px 16px;
|
|
778
778
|
border-bottom: 1px solid #ebedf0;
|
package/build/widget.qw.es.js
CHANGED
|
@@ -38,7 +38,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
38
38
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
-
import { computed, resolveComponent, openBlock, createElementBlock, unref, createVNode, createCommentVNode, createElementVNode, toDisplayString, onUnmounted, onDeactivated, isRef, watch, onMounted, nextTick, onActivated, ref, reactive, getCurrentInstance, provide, inject, isVNode, defineComponent, onBeforeUnmount, watchEffect, mergeProps, Transition, Teleport, withDirectives, vShow, Fragment, createApp, resolveDirective, createBlock, withCtx, renderList, createTextVNode, createSlots, withModifiers, onBeforeUpdate, normalizeClass, renderSlot } from "vue";
|
|
41
|
+
import { computed, resolveComponent, openBlock, createElementBlock, unref, createVNode, createCommentVNode, createElementVNode, toDisplayString, onUnmounted, onDeactivated, isRef, watch, onMounted, nextTick, onActivated, ref, reactive, getCurrentInstance, provide, inject, isVNode, defineComponent, onBeforeUnmount, watchEffect, mergeProps, Transition, Teleport, withDirectives, vShow, Fragment, createApp, resolveDirective, createBlock, withCtx, renderList, createTextVNode, createSlots, withModifiers, onBeforeUpdate, normalizeClass, renderSlot, pushScopeId, popScopeId } from "vue";
|
|
42
42
|
var vm = {};
|
|
43
43
|
var HeadBar_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.enterprise-header[data-v-435ecee6] {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 48px;\r\n background-color: #2d8cf0; /* \u4F01\u4E1A\u5FAE\u4FE1\u98CE\u683C\u84DD\u8272 */\r\n background-color: #fff;\r\n color: white;\r\n color: #000;\r\n position: relative;\r\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);\r\n margin-bottom: 4px;\n}\n.header-title[data-v-435ecee6] {\r\n font-size: 14px;\r\n font-weight: 500;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n max-width: 70%;\n}\n.header-btn[data-v-435ecee6] {\r\n position: absolute;\r\n width: 48px;\r\n height: 48px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background: transparent;\r\n border: none;\r\n color: white;\r\n color: #000;\r\n font-size: 20px;\r\n cursor: pointer;\r\n padding: 0;\n}\n.header-btn[data-v-435ecee6]:disabled {\r\n opacity: 0.5;\r\n cursor: not-allowed;\n}\n.back-btn[data-v-435ecee6] {\r\n left: 0;\n}\n.home-btn[data-v-435ecee6] {\r\n right: 0;\n}\r\n \r\n \r\n ")();
|
|
44
44
|
var _export_sfc = (sfc, props2) => {
|
|
@@ -6255,12 +6255,32 @@ function uniqCode(arr) {
|
|
|
6255
6255
|
}
|
|
6256
6256
|
return Array.from(uniqueMap.values());
|
|
6257
6257
|
}
|
|
6258
|
+
function uniqMerge(arr1, arr2) {
|
|
6259
|
+
let totalArr = [...arr1, ...arr2];
|
|
6260
|
+
return uniq(totalArr);
|
|
6261
|
+
}
|
|
6262
|
+
function substractAry(arr1, arr2) {
|
|
6263
|
+
if (!Array.isArray(arr2) || !arr2 || arr2.length < 1)
|
|
6264
|
+
return arr1;
|
|
6265
|
+
return arr1.filter((item) => !arr2.includes(item));
|
|
6266
|
+
}
|
|
6267
|
+
function isContainAry(arr1, arr2) {
|
|
6268
|
+
if (!Array.isArray(arr1) || !Array.isArray(arr2))
|
|
6269
|
+
return false;
|
|
6270
|
+
if (arr2.length === 0)
|
|
6271
|
+
return true;
|
|
6272
|
+
const set2 = new Set(arr1);
|
|
6273
|
+
return arr2.every((item) => set2.has(item));
|
|
6274
|
+
}
|
|
6258
6275
|
var ArrayUtil = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6259
6276
|
__proto__: null,
|
|
6260
6277
|
arySwapPrev,
|
|
6261
6278
|
arySwapNext,
|
|
6262
6279
|
uniq,
|
|
6263
|
-
uniqCode
|
|
6280
|
+
uniqCode,
|
|
6281
|
+
uniqMerge,
|
|
6282
|
+
substractAry,
|
|
6283
|
+
isContainAry
|
|
6264
6284
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6265
6285
|
function fittingString(str, maxWidth, fontSize) {
|
|
6266
6286
|
var fontWidth = fontSize * 1.3;
|
|
@@ -19521,8 +19541,8 @@ const _hoisted_10$1 = /* @__PURE__ */ createTextVNode(" \u5168\u9009 ");
|
|
|
19521
19541
|
const _hoisted_11$1 = {
|
|
19522
19542
|
class: "search-container"
|
|
19523
19543
|
};
|
|
19524
|
-
const _hoisted_12 = /* @__PURE__ */ createTextVNode("\u641C\u7D22");
|
|
19525
|
-
const _hoisted_13 = {
|
|
19544
|
+
const _hoisted_12$1 = /* @__PURE__ */ createTextVNode("\u641C\u7D22");
|
|
19545
|
+
const _hoisted_13$1 = {
|
|
19526
19546
|
class: "scroll-container"
|
|
19527
19547
|
};
|
|
19528
19548
|
const _sfc_main$h = {
|
|
@@ -19938,9 +19958,9 @@ const _sfc_main$h = {
|
|
|
19938
19958
|
onClick: searchUserById,
|
|
19939
19959
|
class: "search-btn"
|
|
19940
19960
|
}, {
|
|
19941
|
-
default: withCtx(() => [_hoisted_12]),
|
|
19961
|
+
default: withCtx(() => [_hoisted_12$1]),
|
|
19942
19962
|
_: 1
|
|
19943
|
-
})]), createElementVNode("div", _hoisted_13, [!searchUserId.value && currentDepartments.value.length > 0 ? (openBlock(), createBlock(_component_van_cell_group, {
|
|
19963
|
+
})]), createElementVNode("div", _hoisted_13$1, [!searchUserId.value && currentDepartments.value.length > 0 ? (openBlock(), createBlock(_component_van_cell_group, {
|
|
19944
19964
|
key: 0
|
|
19945
19965
|
}, {
|
|
19946
19966
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(currentDepartments.value, (dept) => {
|
|
@@ -21615,7 +21635,8 @@ const _sfc_main$4 = {
|
|
|
21615
21635
|
}
|
|
21616
21636
|
};
|
|
21617
21637
|
var TreePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ebc14630"]]);
|
|
21618
|
-
var CascaderPop_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.cascader-pop[data-v-
|
|
21638
|
+
var CascaderPop_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.cascader-pop[data-v-36e65e12] {\r\n width: 100%;\r\n overflow: hidden;\n}\n.cascader-selector[data-v-36e65e12] {\r\n padding: 10px;\n}\n.search-buttons[data-v-36e65e12] {\r\n display: flex;\r\n gap: 10px;\n}\n.clear-btn[data-v-36e65e12] {\r\n background-color: #f2f3f5;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.confirm-btn[data-v-36e65e12] {\r\n background-color: #1989fa;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.no-results[data-v-36e65e12] {\r\n text-align: center;\r\n padding: 20px;\r\n color: #969799;\n}\n.cascader-header[data-v-36e65e12] {\r\n padding: 10px;\r\n border-bottom: 1px solid #ebedf0;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.current-path[data-v-36e65e12] {\r\n flex: 1;\r\n font-size: 14px;\r\n margin-left: 5px;\r\n color: #323233;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\n}\n.header-right[data-v-36e65e12] {\r\n display: flex;\r\n gap: 8px;\r\n margin-left: auto;\n}\n.cancel-btn[data-v-36e65e12] {\r\n color: #969799;\r\n margin-right: 5px;\n}\n.scroll-container[data-v-36e65e12] {\r\n height: calc(80vh - 150px);\r\n overflow-y: auto;\n}\n.cell-content[data-v-36e65e12] {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\n}\n.circle-selector[data-v-36e65e12] {\r\n width: 20px;\r\n height: 20px;\r\n border-radius: 50%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n transition: all 0.2s;\r\n flex-shrink: 0;\n}\n.circle-selector.selected[data-v-36e65e12] {\r\n background-color: #1989fa;\r\n border-color: #1989fa;\n}\n.circle-selector.selected .van-icon[data-v-36e65e12] {\r\n color: white;\r\n font-size: 14px;\n}\n.van-cell__right-icon[data-v-36e65e12] {\r\n color: #969799;\r\n font-size: 16px;\r\n margin-left: 8px;\n}\n.name[data-v-36e65e12] {\r\n flex: 1;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\n}\n.cancel-btn[data-v-36e65e12] {\r\n color: #969799;\n}\n.search-field[data-v-36e65e12] {\r\n background: #fff;\r\n padding: 10px 16px;\r\n border-bottom: 1px solid #ebedf0;\r\n position: sticky;\r\n top: 0;\r\n z-index: 999;\r\n margin-bottom: 10px;\r\n flex-shrink: 0;\r\n /* \u9632\u6B62\u538B\u7F29 */\n}\r\n")();
|
|
21639
|
+
const _withScopeId = (n) => (pushScopeId("data-v-36e65e12"), n = n(), popScopeId(), n);
|
|
21619
21640
|
const _hoisted_1$3 = {
|
|
21620
21641
|
class: "cascader-selector"
|
|
21621
21642
|
};
|
|
@@ -21640,7 +21661,14 @@ const _hoisted_9$1 = {
|
|
|
21640
21661
|
class: "cell-content"
|
|
21641
21662
|
};
|
|
21642
21663
|
const _hoisted_10 = ["onClick"];
|
|
21643
|
-
const _hoisted_11 = {
|
|
21664
|
+
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", {
|
|
21665
|
+
class: "name"
|
|
21666
|
+
}, "\u5168\u9009", -1));
|
|
21667
|
+
const _hoisted_12 = {
|
|
21668
|
+
class: "cell-content"
|
|
21669
|
+
};
|
|
21670
|
+
const _hoisted_13 = ["onClick"];
|
|
21671
|
+
const _hoisted_14 = {
|
|
21644
21672
|
class: "name"
|
|
21645
21673
|
};
|
|
21646
21674
|
const _sfc_main$3 = {
|
|
@@ -21685,6 +21713,25 @@ const _sfc_main$3 = {
|
|
|
21685
21713
|
keyword: "",
|
|
21686
21714
|
selectedNodeIds: []
|
|
21687
21715
|
});
|
|
21716
|
+
const isSelectAll = computed({
|
|
21717
|
+
get() {
|
|
21718
|
+
let optionIds = optionNodes.value.filter((item) => item.canCheck).map((item) => item.id);
|
|
21719
|
+
if (optionIds.length < 1)
|
|
21720
|
+
return false;
|
|
21721
|
+
return util.isContainAry(data2.selectedNodeIds, optionIds);
|
|
21722
|
+
},
|
|
21723
|
+
set(val) {
|
|
21724
|
+
let optionIds = optionNodes.value.filter((item) => item.canCheck).map((item) => item.id);
|
|
21725
|
+
if (val) {
|
|
21726
|
+
data2.selectedNodeIds = util.uniqMerge(data2.selectedNodeIds, optionIds);
|
|
21727
|
+
} else {
|
|
21728
|
+
data2.selectedNodeIds = util.substractAry(data2.selectedNodeIds, optionIds);
|
|
21729
|
+
}
|
|
21730
|
+
}
|
|
21731
|
+
});
|
|
21732
|
+
const onToggleAll = () => {
|
|
21733
|
+
isSelectAll.value = !isSelectAll.value;
|
|
21734
|
+
};
|
|
21688
21735
|
onMounted(() => {
|
|
21689
21736
|
});
|
|
21690
21737
|
const optionNodes = computed(() => {
|
|
@@ -21859,11 +21906,29 @@ const _sfc_main$3 = {
|
|
|
21859
21906
|
}, "\u641C\u7D22")]),
|
|
21860
21907
|
_: 1
|
|
21861
21908
|
}, 8, ["modelValue", "placeholder"]), createElementVNode("div", _hoisted_8$1, [createVNode(_component_van_cell_group, null, {
|
|
21862
|
-
default: withCtx(() => [
|
|
21909
|
+
default: withCtx(() => [props2.multiple ? (openBlock(), createBlock(_component_van_cell, {
|
|
21910
|
+
key: 0
|
|
21911
|
+
}, {
|
|
21912
|
+
title: withCtx(() => [createElementVNode("div", _hoisted_9$1, [createElementVNode("div", {
|
|
21913
|
+
class: "circle-selector",
|
|
21914
|
+
onClick: withModifiers(onToggleAll, ["stop"])
|
|
21915
|
+
}, [unref(isSelectAll) ? (openBlock(), createBlock(_component_van_icon, {
|
|
21916
|
+
key: 0,
|
|
21917
|
+
name: "success",
|
|
21918
|
+
size: "20",
|
|
21919
|
+
color: "#409eff"
|
|
21920
|
+
})) : createCommentVNode("", true), !unref(isSelectAll) ? (openBlock(), createBlock(_component_van_icon, {
|
|
21921
|
+
key: 1,
|
|
21922
|
+
name: "circle",
|
|
21923
|
+
size: "20",
|
|
21924
|
+
color: "#e0e0e0"
|
|
21925
|
+
})) : createCommentVNode("", true)], 8, _hoisted_10), _hoisted_11])]),
|
|
21926
|
+
_: 1
|
|
21927
|
+
})) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(optionNodes), (item, i) => {
|
|
21863
21928
|
return openBlock(), createBlock(_component_van_cell, {
|
|
21864
21929
|
key: i
|
|
21865
21930
|
}, createSlots({
|
|
21866
|
-
title: withCtx(() => [createElementVNode("div",
|
|
21931
|
+
title: withCtx(() => [createElementVNode("div", _hoisted_12, [item.canCheck ? (openBlock(), createElementBlock("div", {
|
|
21867
21932
|
key: 0,
|
|
21868
21933
|
class: "circle-selector",
|
|
21869
21934
|
onClick: withModifiers(($event) => onToggle(item), ["stop"])
|
|
@@ -21877,7 +21942,7 @@ const _sfc_main$3 = {
|
|
|
21877
21942
|
name: "circle",
|
|
21878
21943
|
size: "20",
|
|
21879
21944
|
color: "#e0e0e0"
|
|
21880
|
-
})) : createCommentVNode("", true)], 8,
|
|
21945
|
+
})) : createCommentVNode("", true)], 8, _hoisted_13)) : createCommentVNode("", true), createElementVNode("span", _hoisted_14, toDisplayString(item.label), 1)])]),
|
|
21881
21946
|
_: 2
|
|
21882
21947
|
}, [item.canExpand ? {
|
|
21883
21948
|
name: "right-icon",
|
|
@@ -21894,7 +21959,7 @@ const _sfc_main$3 = {
|
|
|
21894
21959
|
};
|
|
21895
21960
|
}
|
|
21896
21961
|
};
|
|
21897
|
-
var CascaderPop = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
21962
|
+
var CascaderPop = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-36e65e12"]]);
|
|
21898
21963
|
const _hoisted_1$2 = {
|
|
21899
21964
|
style: {
|
|
21900
21965
|
"display": "flex",
|
package/build/widget.qw.umd.js
CHANGED
|
@@ -6258,12 +6258,32 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6258
6258
|
}
|
|
6259
6259
|
return Array.from(uniqueMap.values());
|
|
6260
6260
|
}
|
|
6261
|
+
function uniqMerge(arr1, arr2) {
|
|
6262
|
+
let totalArr = [...arr1, ...arr2];
|
|
6263
|
+
return uniq(totalArr);
|
|
6264
|
+
}
|
|
6265
|
+
function substractAry(arr1, arr2) {
|
|
6266
|
+
if (!Array.isArray(arr2) || !arr2 || arr2.length < 1)
|
|
6267
|
+
return arr1;
|
|
6268
|
+
return arr1.filter((item) => !arr2.includes(item));
|
|
6269
|
+
}
|
|
6270
|
+
function isContainAry(arr1, arr2) {
|
|
6271
|
+
if (!Array.isArray(arr1) || !Array.isArray(arr2))
|
|
6272
|
+
return false;
|
|
6273
|
+
if (arr2.length === 0)
|
|
6274
|
+
return true;
|
|
6275
|
+
const set2 = new Set(arr1);
|
|
6276
|
+
return arr2.every((item) => set2.has(item));
|
|
6277
|
+
}
|
|
6261
6278
|
var ArrayUtil = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6262
6279
|
__proto__: null,
|
|
6263
6280
|
arySwapPrev,
|
|
6264
6281
|
arySwapNext,
|
|
6265
6282
|
uniq,
|
|
6266
|
-
uniqCode
|
|
6283
|
+
uniqCode,
|
|
6284
|
+
uniqMerge,
|
|
6285
|
+
substractAry,
|
|
6286
|
+
isContainAry
|
|
6267
6287
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6268
6288
|
function fittingString(str, maxWidth, fontSize) {
|
|
6269
6289
|
var fontWidth = fontSize * 1.3;
|
|
@@ -19524,8 +19544,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19524
19544
|
const _hoisted_11$1 = {
|
|
19525
19545
|
class: "search-container"
|
|
19526
19546
|
};
|
|
19527
|
-
const _hoisted_12 = /* @__PURE__ */ vue.createTextVNode("\u641C\u7D22");
|
|
19528
|
-
const _hoisted_13 = {
|
|
19547
|
+
const _hoisted_12$1 = /* @__PURE__ */ vue.createTextVNode("\u641C\u7D22");
|
|
19548
|
+
const _hoisted_13$1 = {
|
|
19529
19549
|
class: "scroll-container"
|
|
19530
19550
|
};
|
|
19531
19551
|
const _sfc_main$h = {
|
|
@@ -19941,9 +19961,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19941
19961
|
onClick: searchUserById,
|
|
19942
19962
|
class: "search-btn"
|
|
19943
19963
|
}, {
|
|
19944
|
-
default: vue.withCtx(() => [_hoisted_12]),
|
|
19964
|
+
default: vue.withCtx(() => [_hoisted_12$1]),
|
|
19945
19965
|
_: 1
|
|
19946
|
-
})]), vue.createElementVNode("div", _hoisted_13, [!searchUserId.value && currentDepartments.value.length > 0 ? (vue.openBlock(), vue.createBlock(_component_van_cell_group, {
|
|
19966
|
+
})]), vue.createElementVNode("div", _hoisted_13$1, [!searchUserId.value && currentDepartments.value.length > 0 ? (vue.openBlock(), vue.createBlock(_component_van_cell_group, {
|
|
19947
19967
|
key: 0
|
|
19948
19968
|
}, {
|
|
19949
19969
|
default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentDepartments.value, (dept) => {
|
|
@@ -21618,7 +21638,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21618
21638
|
}
|
|
21619
21639
|
};
|
|
21620
21640
|
var TreePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ebc14630"]]);
|
|
21621
|
-
var CascaderPop_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.cascader-pop[data-v-
|
|
21641
|
+
var CascaderPop_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.cascader-pop[data-v-36e65e12] {\r\n width: 100%;\r\n overflow: hidden;\n}\n.cascader-selector[data-v-36e65e12] {\r\n padding: 10px;\n}\n.search-buttons[data-v-36e65e12] {\r\n display: flex;\r\n gap: 10px;\n}\n.clear-btn[data-v-36e65e12] {\r\n background-color: #f2f3f5;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.confirm-btn[data-v-36e65e12] {\r\n background-color: #1989fa;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.no-results[data-v-36e65e12] {\r\n text-align: center;\r\n padding: 20px;\r\n color: #969799;\n}\n.cascader-header[data-v-36e65e12] {\r\n padding: 10px;\r\n border-bottom: 1px solid #ebedf0;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.current-path[data-v-36e65e12] {\r\n flex: 1;\r\n font-size: 14px;\r\n margin-left: 5px;\r\n color: #323233;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\n}\n.header-right[data-v-36e65e12] {\r\n display: flex;\r\n gap: 8px;\r\n margin-left: auto;\n}\n.cancel-btn[data-v-36e65e12] {\r\n color: #969799;\r\n margin-right: 5px;\n}\n.scroll-container[data-v-36e65e12] {\r\n height: calc(80vh - 150px);\r\n overflow-y: auto;\n}\n.cell-content[data-v-36e65e12] {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\n}\n.circle-selector[data-v-36e65e12] {\r\n width: 20px;\r\n height: 20px;\r\n border-radius: 50%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n transition: all 0.2s;\r\n flex-shrink: 0;\n}\n.circle-selector.selected[data-v-36e65e12] {\r\n background-color: #1989fa;\r\n border-color: #1989fa;\n}\n.circle-selector.selected .van-icon[data-v-36e65e12] {\r\n color: white;\r\n font-size: 14px;\n}\n.van-cell__right-icon[data-v-36e65e12] {\r\n color: #969799;\r\n font-size: 16px;\r\n margin-left: 8px;\n}\n.name[data-v-36e65e12] {\r\n flex: 1;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\n}\n.cancel-btn[data-v-36e65e12] {\r\n color: #969799;\n}\n.search-field[data-v-36e65e12] {\r\n background: #fff;\r\n padding: 10px 16px;\r\n border-bottom: 1px solid #ebedf0;\r\n position: sticky;\r\n top: 0;\r\n z-index: 999;\r\n margin-bottom: 10px;\r\n flex-shrink: 0;\r\n /* \u9632\u6B62\u538B\u7F29 */\n}\r\n")();
|
|
21642
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-36e65e12"), n = n(), vue.popScopeId(), n);
|
|
21622
21643
|
const _hoisted_1$3 = {
|
|
21623
21644
|
class: "cascader-selector"
|
|
21624
21645
|
};
|
|
@@ -21643,7 +21664,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21643
21664
|
class: "cell-content"
|
|
21644
21665
|
};
|
|
21645
21666
|
const _hoisted_10 = ["onClick"];
|
|
21646
|
-
const _hoisted_11 = {
|
|
21667
|
+
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", {
|
|
21668
|
+
class: "name"
|
|
21669
|
+
}, "\u5168\u9009", -1));
|
|
21670
|
+
const _hoisted_12 = {
|
|
21671
|
+
class: "cell-content"
|
|
21672
|
+
};
|
|
21673
|
+
const _hoisted_13 = ["onClick"];
|
|
21674
|
+
const _hoisted_14 = {
|
|
21647
21675
|
class: "name"
|
|
21648
21676
|
};
|
|
21649
21677
|
const _sfc_main$3 = {
|
|
@@ -21688,6 +21716,25 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21688
21716
|
keyword: "",
|
|
21689
21717
|
selectedNodeIds: []
|
|
21690
21718
|
});
|
|
21719
|
+
const isSelectAll = vue.computed({
|
|
21720
|
+
get() {
|
|
21721
|
+
let optionIds = optionNodes.value.filter((item) => item.canCheck).map((item) => item.id);
|
|
21722
|
+
if (optionIds.length < 1)
|
|
21723
|
+
return false;
|
|
21724
|
+
return util.isContainAry(data2.selectedNodeIds, optionIds);
|
|
21725
|
+
},
|
|
21726
|
+
set(val) {
|
|
21727
|
+
let optionIds = optionNodes.value.filter((item) => item.canCheck).map((item) => item.id);
|
|
21728
|
+
if (val) {
|
|
21729
|
+
data2.selectedNodeIds = util.uniqMerge(data2.selectedNodeIds, optionIds);
|
|
21730
|
+
} else {
|
|
21731
|
+
data2.selectedNodeIds = util.substractAry(data2.selectedNodeIds, optionIds);
|
|
21732
|
+
}
|
|
21733
|
+
}
|
|
21734
|
+
});
|
|
21735
|
+
const onToggleAll = () => {
|
|
21736
|
+
isSelectAll.value = !isSelectAll.value;
|
|
21737
|
+
};
|
|
21691
21738
|
vue.onMounted(() => {
|
|
21692
21739
|
});
|
|
21693
21740
|
const optionNodes = vue.computed(() => {
|
|
@@ -21862,11 +21909,29 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21862
21909
|
}, "\u641C\u7D22")]),
|
|
21863
21910
|
_: 1
|
|
21864
21911
|
}, 8, ["modelValue", "placeholder"]), vue.createElementVNode("div", _hoisted_8$1, [vue.createVNode(_component_van_cell_group, null, {
|
|
21865
|
-
default: vue.withCtx(() => [(vue.openBlock(
|
|
21912
|
+
default: vue.withCtx(() => [props2.multiple ? (vue.openBlock(), vue.createBlock(_component_van_cell, {
|
|
21913
|
+
key: 0
|
|
21914
|
+
}, {
|
|
21915
|
+
title: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_9$1, [vue.createElementVNode("div", {
|
|
21916
|
+
class: "circle-selector",
|
|
21917
|
+
onClick: vue.withModifiers(onToggleAll, ["stop"])
|
|
21918
|
+
}, [vue.unref(isSelectAll) ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
|
|
21919
|
+
key: 0,
|
|
21920
|
+
name: "success",
|
|
21921
|
+
size: "20",
|
|
21922
|
+
color: "#409eff"
|
|
21923
|
+
})) : vue.createCommentVNode("", true), !vue.unref(isSelectAll) ? (vue.openBlock(), vue.createBlock(_component_van_icon, {
|
|
21924
|
+
key: 1,
|
|
21925
|
+
name: "circle",
|
|
21926
|
+
size: "20",
|
|
21927
|
+
color: "#e0e0e0"
|
|
21928
|
+
})) : vue.createCommentVNode("", true)], 8, _hoisted_10), _hoisted_11])]),
|
|
21929
|
+
_: 1
|
|
21930
|
+
})) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(optionNodes), (item, i) => {
|
|
21866
21931
|
return vue.openBlock(), vue.createBlock(_component_van_cell, {
|
|
21867
21932
|
key: i
|
|
21868
21933
|
}, vue.createSlots({
|
|
21869
|
-
title: vue.withCtx(() => [vue.createElementVNode("div",
|
|
21934
|
+
title: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_12, [item.canCheck ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
21870
21935
|
key: 0,
|
|
21871
21936
|
class: "circle-selector",
|
|
21872
21937
|
onClick: vue.withModifiers(($event) => onToggle(item), ["stop"])
|
|
@@ -21880,7 +21945,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21880
21945
|
name: "circle",
|
|
21881
21946
|
size: "20",
|
|
21882
21947
|
color: "#e0e0e0"
|
|
21883
|
-
})) : vue.createCommentVNode("", true)], 8,
|
|
21948
|
+
})) : vue.createCommentVNode("", true)], 8, _hoisted_13)) : vue.createCommentVNode("", true), vue.createElementVNode("span", _hoisted_14, vue.toDisplayString(item.label), 1)])]),
|
|
21884
21949
|
_: 2
|
|
21885
21950
|
}, [item.canExpand ? {
|
|
21886
21951
|
name: "right-icon",
|
|
@@ -21897,7 +21962,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21897
21962
|
};
|
|
21898
21963
|
}
|
|
21899
21964
|
};
|
|
21900
|
-
var CascaderPop = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
21965
|
+
var CascaderPop = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-36e65e12"]]);
|
|
21901
21966
|
const _hoisted_1$2 = {
|
|
21902
21967
|
style: {
|
|
21903
21968
|
"display": "flex",
|
package/package.json
CHANGED
|
@@ -27,6 +27,17 @@
|
|
|
27
27
|
<div class="scroll-container">
|
|
28
28
|
<!-- 遍历子节点列表 -->
|
|
29
29
|
<van-cell-group>
|
|
30
|
+
<van-cell v-if="props.multiple">
|
|
31
|
+
<template #title>
|
|
32
|
+
<div class="cell-content">
|
|
33
|
+
<div class="circle-selector" @click.stop="onToggleAll">
|
|
34
|
+
<van-icon v-if="isSelectAll" name="success" size="20" color="#409eff" />
|
|
35
|
+
<van-icon v-if="!isSelectAll" name="circle" size="20" color="#e0e0e0" />
|
|
36
|
+
</div>
|
|
37
|
+
<span class="name">全选</span>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
</van-cell>
|
|
30
41
|
<van-cell v-for="(item, i) in optionNodes" :key="i">
|
|
31
42
|
<template #title>
|
|
32
43
|
<div class="cell-content">
|
|
@@ -94,6 +105,28 @@ const data = reactive({
|
|
|
94
105
|
selectedNodeIds: []
|
|
95
106
|
})
|
|
96
107
|
|
|
108
|
+
const isSelectAll = computed({
|
|
109
|
+
get() {
|
|
110
|
+
let optionIds = optionNodes.value.filter(item => item.canCheck).map(item => item.id)
|
|
111
|
+
if (optionIds.length < 1)
|
|
112
|
+
return false
|
|
113
|
+
|
|
114
|
+
return util.isContainAry(data.selectedNodeIds, optionIds)
|
|
115
|
+
},
|
|
116
|
+
set(val) {
|
|
117
|
+
let optionIds = optionNodes.value.filter(item => item.canCheck).map(item => item.id)
|
|
118
|
+
if (val) {
|
|
119
|
+
data.selectedNodeIds = util.uniqMerge(data.selectedNodeIds, optionIds)
|
|
120
|
+
} else {
|
|
121
|
+
data.selectedNodeIds = util.substractAry(data.selectedNodeIds, optionIds)
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const onToggleAll = () => {
|
|
127
|
+
isSelectAll.value = !isSelectAll.value
|
|
128
|
+
}
|
|
129
|
+
|
|
97
130
|
onMounted(() => {
|
|
98
131
|
})
|
|
99
132
|
|
|
@@ -148,11 +181,11 @@ const reset = () => {
|
|
|
148
181
|
data.selectedNodeIds = []
|
|
149
182
|
}
|
|
150
183
|
|
|
151
|
-
const ids2nodes = async() => {
|
|
152
|
-
if(!data.selectedNodeIds || data.selectedNodeIds.length<1)
|
|
184
|
+
const ids2nodes = async () => {
|
|
185
|
+
if (!data.selectedNodeIds || data.selectedNodeIds.length < 1)
|
|
153
186
|
return []
|
|
154
187
|
|
|
155
|
-
let promises = data.selectedNodeIds.map(async(nodeId) => {
|
|
188
|
+
let promises = data.selectedNodeIds.map(async (nodeId) => {
|
|
156
189
|
let params = {}
|
|
157
190
|
params.id = nodeId
|
|
158
191
|
params.isReturnParent = true
|
|
@@ -166,14 +199,14 @@ const ids2nodes = async() => {
|
|
|
166
199
|
})
|
|
167
200
|
return selectNode
|
|
168
201
|
})
|
|
169
|
-
|
|
202
|
+
|
|
170
203
|
let selectNodes = await Promise.all(promises)
|
|
171
204
|
|
|
172
205
|
return selectNodes
|
|
173
206
|
}
|
|
174
207
|
|
|
175
208
|
// 确认按钮
|
|
176
|
-
const onSubmit = async() => {
|
|
209
|
+
const onSubmit = async () => {
|
|
177
210
|
if (!data.selectedNodeIds || data.selectedNodeIds.length < 1) {
|
|
178
211
|
util.warnToast("请选择")
|
|
179
212
|
return
|
|
@@ -203,8 +236,8 @@ const onCancel = () => {
|
|
|
203
236
|
const onToggle = (node) => {
|
|
204
237
|
if (data.selectedNodeIds.includes(node.id))
|
|
205
238
|
data.selectedNodeIds = data.selectedNodeIds.filter(item => item != node.id)
|
|
206
|
-
else{
|
|
207
|
-
if(props.multiple)
|
|
239
|
+
else {
|
|
240
|
+
if (props.multiple)
|
|
208
241
|
data.selectedNodeIds.push(node.id)
|
|
209
242
|
else
|
|
210
243
|
data.selectedNodeIds = [node.id]
|
|
@@ -232,7 +265,7 @@ const query = async () => {
|
|
|
232
265
|
|
|
233
266
|
//根据id查询详情对象
|
|
234
267
|
watch(() => [props.show], async (n, o) => {
|
|
235
|
-
if(!props.show)
|
|
268
|
+
if (!props.show)
|
|
236
269
|
return
|
|
237
270
|
|
|
238
271
|
if (!props.multiple) {
|
package/src/util/array_util.js
CHANGED
|
@@ -12,21 +12,43 @@ export function arySwapNext(arr, index) {
|
|
|
12
12
|
return arr;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function uniq(ary){
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export function uniq(ary) {
|
|
16
|
+
// 去重
|
|
17
|
+
let newAry = [...new Set(ary)]
|
|
18
|
+
return newAry
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function uniqCode(arr) {
|
|
22
22
|
const uniqueMap = new Map();
|
|
23
23
|
for (const item of arr) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const key = item.code
|
|
25
|
+
if (!uniqueMap.has(key)) {
|
|
26
|
+
uniqueMap.set(key, item);
|
|
27
|
+
}
|
|
28
28
|
}
|
|
29
29
|
return Array.from(uniqueMap.values());
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
//合并两个数组,合并后的数组去重
|
|
33
|
+
export function uniqMerge(arr1, arr2) {
|
|
34
|
+
let totalArr = [...arr1, ...arr2]
|
|
35
|
+
return uniq(totalArr)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//数组1减去数组2
|
|
39
|
+
export function substractAry(arr1, arr2) {
|
|
40
|
+
if (!Array.isArray(arr2) || !arr2 || arr2.length<1)
|
|
41
|
+
return arr1
|
|
32
42
|
|
|
43
|
+
return arr1.filter(item => !arr2.includes(item))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//判断数组1是否包含数组2
|
|
47
|
+
export function isContainAry(arr1, arr2){
|
|
48
|
+
// 非数组直接返回false
|
|
49
|
+
if (!Array.isArray(arr1) || !Array.isArray(arr2)) return false
|
|
50
|
+
// 空数组2默认视为被包含
|
|
51
|
+
if (arr2.length === 0) return true
|
|
52
|
+
const set = new Set(arr1)
|
|
53
|
+
return arr2.every(item => set.has(item))
|
|
54
|
+
}
|