giime 0.6.1 → 0.6.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/dist/index.css +44 -44
- package/es/components/src/base/checkbox/Checkbox.vue.d.ts +3 -3
- package/es/components/src/base/checkbox/index.d.ts +9 -9
- package/es/components/src/base/checkboxButton/CheckboxButton.vue.d.ts +3 -3
- package/es/components/src/base/checkboxButton/index.d.ts +9 -9
- package/es/components/src/base/radio/Radio.vue.d.ts +1 -1
- package/es/components/src/base/radio/index.d.ts +3 -3
- package/es/components/src/base/radioButton/RadioButton.vue.d.ts +1 -1
- package/es/components/src/base/radioButton/index.d.ts +3 -3
- package/es/components/src/base/tabPane/TabPane.vue.d.ts +3 -3
- package/es/components/src/base/tabPane/index.d.ts +9 -9
- package/es/components/src/base/tabs/Tabs.vue.d.ts +2 -2
- package/es/components/src/base/tabs/index.d.ts +6 -6
- package/es/components/src/base/tabs/tabs.d.ts +1 -1
- package/es/components/src/business/loginDialog/loginDialog.mjs +1 -1
- package/es/components/src/business/loginDialog/loginDialog.mjs.map +1 -1
- package/es/components/src/composite/operateButton/OperateButton.vue.d.ts +1 -1
- package/es/components/src/composite/operateButton/index.d.ts +1 -1
- package/es/components/src/composite/searchForm/searchFormItems/select/SearchFormSelect.vue.d.ts +1 -1
- package/es/components/src/composite/searchForm/searchFormItems/select/index.d.ts +1 -1
- package/es/components/src/composite/tablePro/TablePro.vue.d.ts +1 -1
- package/es/components/src/composite/tablePro/index.d.ts +3 -3
- package/es/giime/index.mjs +3 -1
- package/es/giime/index.mjs.map +1 -1
- package/es/giime/version.d.ts +1 -1
- package/es/hooks/store/useOrgUserList/index.d.ts +4 -3
- package/es/hooks/store/useOrgUserList/index.mjs +8 -6
- package/es/hooks/store/useOrgUserList/index.mjs.map +1 -1
- package/es/index.css +44 -44
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.mjs +4 -1
- package/es/utils/index.mjs.map +1 -1
- package/es/utils/src/number.d.ts +7 -0
- package/es/utils/src/number.mjs +11 -0
- package/es/utils/src/number.mjs.map +1 -0
- package/es/utils/src/tree/filterTreeByName.d.ts +14 -0
- package/es/utils/src/tree/filterTreeByName.mjs +18 -0
- package/es/utils/src/tree/filterTreeByName.mjs.map +1 -0
- package/es/utils/src/tree/findChildrenItem.d.ts +7 -0
- package/es/utils/src/tree/findChildrenItem.mjs +20 -0
- package/es/utils/src/tree/findChildrenItem.mjs.map +1 -0
- package/es/utils/src/tree/index.d.ts +2 -0
- package/es/utils/src/tree/index.mjs +3 -0
- package/es/utils/src/tree/index.mjs.map +1 -0
- package/lib/components/src/base/checkbox/Checkbox.vue.d.ts +3 -3
- package/lib/components/src/base/checkbox/index.d.ts +9 -9
- package/lib/components/src/base/checkboxButton/CheckboxButton.vue.d.ts +3 -3
- package/lib/components/src/base/checkboxButton/index.d.ts +9 -9
- package/lib/components/src/base/radio/Radio.vue.d.ts +1 -1
- package/lib/components/src/base/radio/index.d.ts +3 -3
- package/lib/components/src/base/radioButton/RadioButton.vue.d.ts +1 -1
- package/lib/components/src/base/radioButton/index.d.ts +3 -3
- package/lib/components/src/base/tabPane/TabPane.vue.d.ts +3 -3
- package/lib/components/src/base/tabPane/index.d.ts +9 -9
- package/lib/components/src/base/tabs/Tabs.vue.d.ts +2 -2
- package/lib/components/src/base/tabs/index.d.ts +6 -6
- package/lib/components/src/base/tabs/tabs.d.ts +1 -1
- package/lib/components/src/business/loginDialog/loginDialog.js +1 -1
- package/lib/components/src/business/loginDialog/loginDialog.js.map +1 -1
- package/lib/components/src/composite/operateButton/OperateButton.vue.d.ts +1 -1
- package/lib/components/src/composite/operateButton/index.d.ts +1 -1
- package/lib/components/src/composite/searchForm/searchFormItems/select/SearchFormSelect.vue.d.ts +1 -1
- package/lib/components/src/composite/searchForm/searchFormItems/select/index.d.ts +1 -1
- package/lib/components/src/composite/tablePro/TablePro.vue.d.ts +1 -1
- package/lib/components/src/composite/tablePro/index.d.ts +3 -3
- package/lib/giime/index.js +10 -6
- package/lib/giime/index.js.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/hooks/store/useOrgUserList/index.d.ts +4 -3
- package/lib/hooks/store/useOrgUserList/index.js +8 -6
- package/lib/hooks/store/useOrgUserList/index.js.map +1 -1
- package/lib/index.css +44 -44
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +7 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/src/number.d.ts +7 -0
- package/lib/utils/src/number.js +13 -0
- package/lib/utils/src/number.js.map +1 -0
- package/lib/utils/src/tree/filterTreeByName.d.ts +14 -0
- package/lib/utils/src/tree/filterTreeByName.js +20 -0
- package/lib/utils/src/tree/filterTreeByName.js.map +1 -0
- package/lib/utils/src/tree/findChildrenItem.d.ts +7 -0
- package/lib/utils/src/tree/findChildrenItem.js +22 -0
- package/lib/utils/src/tree/findChildrenItem.js.map +1 -0
- package/lib/utils/src/tree/index.d.ts +2 -0
- package/lib/utils/src/tree/index.js +10 -0
- package/lib/utils/src/tree/index.js.map +1 -0
- package/package.json +1 -1
- package/es/utils/src/tree.d.ts +0 -12
- package/es/utils/src/tree.mjs +0 -19
- package/es/utils/src/tree.mjs.map +0 -1
- package/lib/utils/src/tree.d.ts +0 -12
- package/lib/utils/src/tree.js +0 -21
- package/lib/utils/src/tree.js.map +0 -1
|
@@ -6,7 +6,7 @@ var lodashEs = require('lodash-es');
|
|
|
6
6
|
require('../../../api/guardBasic/controller/index.js');
|
|
7
7
|
var usePostBasicV1UserListUserOrg = require('../../../api/guardBasic/controller/JiChuFuWu/YongHuGuanLi/usePostBasicV1UserListUserOrg.js');
|
|
8
8
|
|
|
9
|
-
const useOrgUserListStore = pinia.defineStore("gmOrgUserList", () => {
|
|
9
|
+
const useOrgUserListStore = pinia.defineStore("gmOrgUserList", (options = { disabledInitList: false }) => {
|
|
10
10
|
const { isLoading, exec, data: userListData } = usePostBasicV1UserListUserOrg.usePostBasicV1UserListUserOrg();
|
|
11
11
|
const userList = vue.computed(() => userListData.value?.data || []);
|
|
12
12
|
const orgUserList = vue.computed(() => {
|
|
@@ -19,15 +19,17 @@ const useOrgUserListStore = pinia.defineStore("gmOrgUserList", () => {
|
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
const getOrgUserList = async () => {
|
|
22
|
+
const getOrgUserList = async (input) => {
|
|
23
23
|
if (userList.value.length !== 0 || isLoading.value) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
return exec();
|
|
26
|
+
return exec(input);
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (!options.disabledInitList) {
|
|
29
|
+
vue.onMounted(() => {
|
|
30
|
+
getOrgUserList({ user_status: 1 });
|
|
31
|
+
});
|
|
32
|
+
}
|
|
31
33
|
return {
|
|
32
34
|
userList,
|
|
33
35
|
isLoading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../packages/hooks/store/useOrgUserList/index.ts"],"sourcesContent":["import { computed, onMounted } from 'vue';\nimport { defineStore } from 'pinia';\nimport { groupBy } from 'lodash-es';\nimport { usePostBasicV1UserListUserOrg } from '@giime/api/guardBasic/controller';\n\n/**用户-家族列表 */\nexport const useOrgUserListStore = defineStore('gmOrgUserList', () => {\n const { isLoading, exec, data: userListData } = usePostBasicV1UserListUserOrg();\n const userList = computed(() => userListData.value?.data || []);\n const orgUserList = computed(() => {\n const familyGroup = groupBy(userList.value, 'family_code');\n return Object.keys(familyGroup).map(familyCode => {\n return {\n label: familyGroup[familyCode][0].family_name,\n value: familyCode,\n children: familyGroup[familyCode].map(it => ({ label: it.user_name, value: it.user_id })),\n };\n });\n });\n const getOrgUserList = async () => {\n if (userList.value.length !== 0 || isLoading.value) {\n return;\n }\n return exec();\n };\n onMounted(() => {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../packages/hooks/store/useOrgUserList/index.ts"],"sourcesContent":["import { computed, onMounted } from 'vue';\nimport { defineStore } from 'pinia';\nimport { groupBy } from 'lodash-es';\nimport { usePostBasicV1UserListUserOrg } from '@giime/api/guardBasic/controller';\nimport type { UserOrgReq } from '@giime/api/guardBasic/interface';\n\n/**用户-家族列表 */\nexport const useOrgUserListStore = defineStore('gmOrgUserList', (options = { disabledInitList: false }) => {\n const { isLoading, exec, data: userListData } = usePostBasicV1UserListUserOrg();\n const userList = computed(() => userListData.value?.data || []);\n const orgUserList = computed(() => {\n const familyGroup = groupBy(userList.value, 'family_code');\n return Object.keys(familyGroup).map(familyCode => {\n return {\n label: familyGroup[familyCode][0].family_name,\n value: familyCode,\n children: familyGroup[familyCode].map(it => ({ label: it.user_name, value: it.user_id })),\n };\n });\n });\n const getOrgUserList = async (input?: UserOrgReq) => {\n if (userList.value.length !== 0 || isLoading.value) {\n return;\n }\n return exec(input);\n };\n if (!options.disabledInitList) {\n onMounted(() => {\n getOrgUserList({ user_status: 1 });\n });\n }\n\n return {\n userList,\n isLoading,\n orgUserList,\n getOrgUserList,\n };\n});\n"],"names":["defineStore","usePostBasicV1UserListUserOrg","computed","groupBy","onMounted"],"mappings":";;;;;;;;AAOa,MAAA,mBAAA,GAAsBA,kBAAY,eAAiB,EAAA,CAAC,UAAU,EAAE,gBAAA,EAAkB,OAAY,KAAA;AACzG,EAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,IAAM,EAAA,YAAA,KAAiBC,2DAA8B,EAAA,CAAA;AAC9E,EAAA,MAAM,WAAWC,YAAS,CAAA,MAAM,aAAa,KAAO,EAAA,IAAA,IAAQ,EAAE,CAAA,CAAA;AAC9D,EAAM,MAAA,WAAA,GAAcA,aAAS,MAAM;AACjC,IAAA,MAAM,WAAc,GAAAC,gBAAA,CAAQ,QAAS,CAAA,KAAA,EAAO,aAAa,CAAA,CAAA;AACzD,IAAA,OAAO,MAAO,CAAA,IAAA,CAAK,WAAW,CAAA,CAAE,IAAI,CAAc,UAAA,KAAA;AAChD,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,WAAA,CAAY,UAAU,CAAA,CAAE,CAAC,CAAE,CAAA,WAAA;AAAA,QAClC,KAAO,EAAA,UAAA;AAAA,QACP,QAAU,EAAA,WAAA,CAAY,UAAU,CAAA,CAAE,GAAI,CAAA,CAAA,EAAA,MAAO,EAAE,KAAA,EAAO,EAAG,CAAA,SAAA,EAAW,KAAO,EAAA,EAAA,CAAG,SAAU,CAAA,CAAA;AAAA,OAC1F,CAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACF,CAAA,CAAA;AACD,EAAM,MAAA,cAAA,GAAiB,OAAO,KAAuB,KAAA;AACnD,IAAA,IAAI,QAAS,CAAA,KAAA,CAAM,MAAW,KAAA,CAAA,IAAK,UAAU,KAAO,EAAA;AAClD,MAAA,OAAA;AAAA,KACF;AACA,IAAA,OAAO,KAAK,KAAK,CAAA,CAAA;AAAA,GACnB,CAAA;AACA,EAAI,IAAA,CAAC,QAAQ,gBAAkB,EAAA;AAC7B,IAAAC,aAAA,CAAU,MAAM;AACd,MAAe,cAAA,CAAA,EAAE,WAAa,EAAA,CAAA,EAAG,CAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAAA,GACH;AAEA,EAAO,OAAA;AAAA,IACL,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,GACF,CAAA;AACF,CAAC;;;;"}
|
package/lib/index.css
CHANGED
|
@@ -813,24 +813,6 @@ video {
|
|
|
813
813
|
.gm-flex-justify-between[data-v-2a79bac9] {
|
|
814
814
|
justify-content: space-between;
|
|
815
815
|
}
|
|
816
|
-
.gm-number-interval-single[data-v-47a13fd0] {
|
|
817
|
-
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
818
|
-
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
819
|
-
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
820
|
-
}
|
|
821
|
-
.gm-number-interval-single[data-v-47a13fd0] [data-v-47a13fd0] .el-input__wrapper {
|
|
822
|
-
box-shadow: none;
|
|
823
|
-
background: none;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
.gm-number-interval-close[data-v-47a13fd0] {
|
|
827
|
-
display: none;
|
|
828
|
-
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
.gm-number-interval-single[data-v-47a13fd0]:hover .gm-number-interval-close[data-v-47a13fd0] {
|
|
832
|
-
display: flex;
|
|
833
|
-
}
|
|
834
816
|
.circular[data-v-b391445c] {
|
|
835
817
|
animation: loading-rotate-b391445c 2s linear infinite;
|
|
836
818
|
}
|
|
@@ -862,6 +844,24 @@ video {
|
|
|
862
844
|
stroke-dashoffset: -120px;
|
|
863
845
|
}
|
|
864
846
|
}
|
|
847
|
+
.gm-number-interval-single[data-v-47a13fd0] {
|
|
848
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
849
|
+
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
850
|
+
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
851
|
+
}
|
|
852
|
+
.gm-number-interval-single[data-v-47a13fd0] [data-v-47a13fd0] .el-input__wrapper {
|
|
853
|
+
box-shadow: none;
|
|
854
|
+
background: none;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.gm-number-interval-close[data-v-47a13fd0] {
|
|
858
|
+
display: none;
|
|
859
|
+
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.gm-number-interval-single[data-v-47a13fd0]:hover .gm-number-interval-close[data-v-47a13fd0] {
|
|
863
|
+
display: flex;
|
|
864
|
+
}
|
|
865
865
|
.gm-upload-preview-dialog[data-v-142ef678] [data-v-142ef678] .el-dialog__body {
|
|
866
866
|
padding: 0;
|
|
867
867
|
}
|
|
@@ -873,32 +873,6 @@ video {
|
|
|
873
873
|
align-items: center;
|
|
874
874
|
justify-content: center;
|
|
875
875
|
}
|
|
876
|
-
.gm-upload-file {
|
|
877
|
-
line-height: normal;
|
|
878
|
-
}
|
|
879
|
-
.gm-upload-file .el-checkbox {
|
|
880
|
-
position: absolute;
|
|
881
|
-
left: 10px;
|
|
882
|
-
top: 0;
|
|
883
|
-
z-index: 9;
|
|
884
|
-
}
|
|
885
|
-
.gm-upload-file .el-upload-list__item-file-name {
|
|
886
|
-
line-height: normal;
|
|
887
|
-
}
|
|
888
|
-
.gm-upload-file .el-upload-dragger {
|
|
889
|
-
padding: 0;
|
|
890
|
-
border: none;
|
|
891
|
-
width: 100%;
|
|
892
|
-
height: 100%;
|
|
893
|
-
display: flex;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
.gm-upload-file-disabled .el-upload--picture-card {
|
|
897
|
-
display: none;
|
|
898
|
-
}
|
|
899
|
-
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
900
|
-
display: none;
|
|
901
|
-
}
|
|
902
876
|
[data-v-7b6755e2] .gmSearchForm .el-form-item {
|
|
903
877
|
margin-right: 0;
|
|
904
878
|
margin-bottom: 4px;
|
|
@@ -926,6 +900,32 @@ video {
|
|
|
926
900
|
[data-v-668dc408] .gmTableNoBorder .el-table__border-left-patch {
|
|
927
901
|
height: 0;
|
|
928
902
|
}
|
|
903
|
+
.gm-upload-file {
|
|
904
|
+
line-height: normal;
|
|
905
|
+
}
|
|
906
|
+
.gm-upload-file .el-checkbox {
|
|
907
|
+
position: absolute;
|
|
908
|
+
left: 10px;
|
|
909
|
+
top: 0;
|
|
910
|
+
z-index: 9;
|
|
911
|
+
}
|
|
912
|
+
.gm-upload-file .el-upload-list__item-file-name {
|
|
913
|
+
line-height: normal;
|
|
914
|
+
}
|
|
915
|
+
.gm-upload-file .el-upload-dragger {
|
|
916
|
+
padding: 0;
|
|
917
|
+
border: none;
|
|
918
|
+
width: 100%;
|
|
919
|
+
height: 100%;
|
|
920
|
+
display: flex;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.gm-upload-file-disabled .el-upload--picture-card {
|
|
924
|
+
display: none;
|
|
925
|
+
}
|
|
926
|
+
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
927
|
+
display: none;
|
|
928
|
+
}
|
|
929
929
|
|
|
930
930
|
.pagination-container[data-v-19230954] {
|
|
931
931
|
background: #fff;
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -10,7 +10,8 @@ require('./src/date/index.js');
|
|
|
10
10
|
var file = require('./src/file.js');
|
|
11
11
|
var general = require('./src/general.js');
|
|
12
12
|
require('./src/crypto/index.js');
|
|
13
|
-
var
|
|
13
|
+
var number = require('./src/number.js');
|
|
14
|
+
require('./src/tree/index.js');
|
|
14
15
|
var install = require('./src/vue/install.js');
|
|
15
16
|
var resolver = require('./src/vue/resolver.js');
|
|
16
17
|
var event = require('./src/elementPlus/event.js');
|
|
@@ -23,6 +24,8 @@ var url = require('./src/http/url.js');
|
|
|
23
24
|
var dateShortcuts = require('./src/date/dateShortcuts.js');
|
|
24
25
|
var md5 = require('./src/crypto/md5.js');
|
|
25
26
|
var sha1 = require('./src/crypto/sha1.js');
|
|
27
|
+
var filterTreeByName = require('./src/tree/filterTreeByName.js');
|
|
28
|
+
var findChildrenItem = require('./src/tree/findChildrenItem.js');
|
|
26
29
|
|
|
27
30
|
|
|
28
31
|
|
|
@@ -70,7 +73,7 @@ exports.compareVersions = general.compareVersions;
|
|
|
70
73
|
exports.isVersionGreaterOrEqual = general.isVersionGreaterOrEqual;
|
|
71
74
|
exports.omitOnEvents = general.omitOnEvents;
|
|
72
75
|
exports.remove = general.remove;
|
|
73
|
-
exports.
|
|
76
|
+
exports.formatNumberWithCommas = number.formatNumberWithCommas;
|
|
74
77
|
exports.withInstall = install.withInstall;
|
|
75
78
|
exports.withInstallDirective = install.withInstallDirective;
|
|
76
79
|
exports.withInstallFunction = install.withInstallFunction;
|
|
@@ -101,4 +104,6 @@ exports.b64_hmac_sha1 = sha1.b64_hmac_sha1;
|
|
|
101
104
|
exports.b64_sha1 = sha1.b64_sha1;
|
|
102
105
|
exports.hex_hmac_sha1 = sha1.hex_hmac_sha1;
|
|
103
106
|
exports.hex_sha1 = sha1.hex_sha1;
|
|
107
|
+
exports.filterTreeByName = filterTreeByName.filterTreeByName;
|
|
108
|
+
exports.findChildrenItem = findChildrenItem.findChildrenItem;
|
|
104
109
|
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var is = require('./is.js');
|
|
4
|
+
|
|
5
|
+
function formatNumberWithCommas(number) {
|
|
6
|
+
if (is.isNil(number) || Number.isNaN(Number(number))) {
|
|
7
|
+
return number;
|
|
8
|
+
}
|
|
9
|
+
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.formatNumberWithCommas = formatNumberWithCommas;
|
|
13
|
+
//# sourceMappingURL=number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.js","sources":["../../../../../packages/utils/src/number.ts"],"sourcesContent":["import { isNil } from './is';\n\n/**\n *\n * @example const number = 1234567890;\n console.log(formatNumberWithCommas(number)); // 输出: \"1,234,567,890\"\n * @returns\n */\nexport function formatNumberWithCommas(number?: number | string) {\n if (isNil(number) || Number.isNaN(Number(number))) {\n return number;\n }\n\n return number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n}\n"],"names":["isNil"],"mappings":";;;;AAQO,SAAS,uBAAuB,MAA0B,EAAA;AAC/D,EAAI,IAAAA,QAAA,CAAM,MAAM,CAAK,IAAA,MAAA,CAAO,MAAM,MAAO,CAAA,MAAM,CAAC,CAAG,EAAA;AACjD,IAAO,OAAA,MAAA,CAAA;AAAA,GACT;AAEA,EAAA,OAAO,MAAO,CAAA,QAAA,EAAW,CAAA,OAAA,CAAQ,yBAAyB,GAAG,CAAA,CAAA;AAC/D;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FilterTreeByNameNode {
|
|
2
|
+
/** 分类名称 */
|
|
3
|
+
name?: string;
|
|
4
|
+
/** 子分类列表 */
|
|
5
|
+
children?: FilterTreeByNameNode[];
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 过滤树
|
|
10
|
+
*/
|
|
11
|
+
export declare function filterTreeByName<T extends FilterTreeByNameNode>(nodes: T[], searchName: string, options?: {
|
|
12
|
+
nameKey: string;
|
|
13
|
+
childrenKey: string;
|
|
14
|
+
}): T[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function filterTreeByName(nodes, searchName, options = { nameKey: "name", childrenKey: "children" }) {
|
|
4
|
+
const { nameKey, childrenKey } = options;
|
|
5
|
+
return nodes.map((node) => {
|
|
6
|
+
const matches = node[nameKey].includes(searchName);
|
|
7
|
+
const filteredChildren = node[childrenKey] ? filterTreeByName(node[childrenKey], searchName) : [];
|
|
8
|
+
if (matches || filteredChildren.length > 0) {
|
|
9
|
+
return {
|
|
10
|
+
...node,
|
|
11
|
+
[childrenKey]: filteredChildren
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}).filter((node) => node !== null);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.filterTreeByName = filterTreeByName;
|
|
20
|
+
//# sourceMappingURL=filterTreeByName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterTreeByName.js","sources":["../../../../../../packages/utils/src/tree/filterTreeByName.ts"],"sourcesContent":["export interface FilterTreeByNameNode {\n /** 分类名称 */\n name?: string;\n /** 子分类列表 */\n children?: FilterTreeByNameNode[];\n [key: string]: any;\n}\n\n/**\n * 过滤树\n */\nexport function filterTreeByName<T extends FilterTreeByNameNode>(\n nodes: T[],\n searchName: string,\n options = { nameKey: 'name', childrenKey: 'children' },\n): T[] {\n const { nameKey, childrenKey } = options;\n\n return nodes\n .map(node => {\n // Check if the current node matches the search name\n const matches = node[nameKey].includes(searchName);\n\n // Recursively filter the children\n const filteredChildren = node[childrenKey] ? filterTreeByName(node[childrenKey], searchName) : [];\n\n // If the node matches or has matching children, include it in the results\n if (matches || filteredChildren.length > 0) {\n return {\n ...node,\n [childrenKey]: filteredChildren,\n };\n } else {\n return null;\n }\n })\n .filter(node => node !== null) as T[];\n}\n"],"names":[],"mappings":";;AAWgB,SAAA,gBAAA,CACd,OACA,UACA,EAAA,OAAA,GAAU,EAAE,OAAS,EAAA,MAAA,EAAQ,WAAa,EAAA,UAAA,EACrC,EAAA;AACL,EAAM,MAAA,EAAE,OAAS,EAAA,WAAA,EAAgB,GAAA,OAAA,CAAA;AAEjC,EAAO,OAAA,KAAA,CACJ,IAAI,CAAQ,IAAA,KAAA;AAEX,IAAA,MAAM,OAAU,GAAA,IAAA,CAAK,OAAO,CAAA,CAAE,SAAS,UAAU,CAAA,CAAA;AAGjD,IAAM,MAAA,gBAAA,GAAmB,IAAK,CAAA,WAAW,CAAI,GAAA,gBAAA,CAAiB,KAAK,WAAW,CAAA,EAAG,UAAU,CAAA,GAAI,EAAC,CAAA;AAGhG,IAAI,IAAA,OAAA,IAAW,gBAAiB,CAAA,MAAA,GAAS,CAAG,EAAA;AAC1C,MAAO,OAAA;AAAA,QACL,GAAG,IAAA;AAAA,QACH,CAAC,WAAW,GAAG,gBAAA;AAAA,OACjB,CAAA;AAAA,KACK,MAAA;AACL,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAAA,GACD,CAAA,CACA,MAAO,CAAA,CAAA,IAAA,KAAQ,SAAS,IAAI,CAAA,CAAA;AACjC;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function findChildrenItem(nodes, targetValue, options = { valueKey: "value", childrenKey: "children" }) {
|
|
4
|
+
const valueField = options?.valueKey;
|
|
5
|
+
const childrenField = options?.childrenKey;
|
|
6
|
+
for (const nodeItem of nodes) {
|
|
7
|
+
const currentNode = nodeItem;
|
|
8
|
+
if (currentNode[valueField] === targetValue) {
|
|
9
|
+
return nodeItem;
|
|
10
|
+
}
|
|
11
|
+
if (currentNode[childrenField]) {
|
|
12
|
+
const found = findChildrenItem(currentNode[childrenField], targetValue);
|
|
13
|
+
if (found) {
|
|
14
|
+
return found;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.findChildrenItem = findChildrenItem;
|
|
22
|
+
//# sourceMappingURL=findChildrenItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findChildrenItem.js","sources":["../../../../../../packages/utils/src/tree/findChildrenItem.ts"],"sourcesContent":["/**\n * 获取子节点\n */\nexport function findChildrenItem<T = any>(nodes: T[], targetValue: any, options = { valueKey: 'value', childrenKey: 'children' }): T | undefined {\n const valueField = options?.valueKey;\n const childrenField = options?.childrenKey;\n\n for (const nodeItem of nodes) {\n // 将 option 强制转换为 Record<string, any>,表示它是一个具有字符串键的对象\n const currentNode = nodeItem as Record<string, any>;\n\n if (currentNode[valueField] === targetValue) {\n return nodeItem;\n }\n if (currentNode[childrenField]) {\n const found = findChildrenItem<T>(currentNode[childrenField], targetValue);\n\n if (found) {\n return found;\n }\n }\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,gBAAA,CAA0B,OAAY,WAAkB,EAAA,OAAA,GAAU,EAAE,QAAU,EAAA,OAAA,EAAS,WAAa,EAAA,UAAA,EAA6B,EAAA;AAC/I,EAAA,MAAM,aAAa,OAAS,EAAA,QAAA,CAAA;AAC5B,EAAA,MAAM,gBAAgB,OAAS,EAAA,WAAA,CAAA;AAE/B,EAAA,KAAA,MAAW,YAAY,KAAO,EAAA;AAE5B,IAAA,MAAM,WAAc,GAAA,QAAA,CAAA;AAEpB,IAAI,IAAA,WAAA,CAAY,UAAU,CAAA,KAAM,WAAa,EAAA;AAC3C,MAAO,OAAA,QAAA,CAAA;AAAA,KACT;AACA,IAAI,IAAA,WAAA,CAAY,aAAa,CAAG,EAAA;AAC9B,MAAA,MAAM,KAAQ,GAAA,gBAAA,CAAoB,WAAY,CAAA,aAAa,GAAG,WAAW,CAAA,CAAA;AAEzE,MAAA,IAAI,KAAO,EAAA;AACT,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var filterTreeByName = require('./filterTreeByName.js');
|
|
4
|
+
var findChildrenItem = require('./findChildrenItem.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.filterTreeByName = filterTreeByName.filterTreeByName;
|
|
9
|
+
exports.findChildrenItem = findChildrenItem.findChildrenItem;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/package.json
CHANGED
package/es/utils/src/tree.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface FindChildrenItem extends Record<string, any> {
|
|
2
|
-
label?: any;
|
|
3
|
-
value?: any;
|
|
4
|
-
children?: FindChildrenItem[];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* 获取子节点
|
|
8
|
-
*/
|
|
9
|
-
export declare function findChildrenItem(options: FindChildrenItem[], targetValue: any, option?: {
|
|
10
|
-
value?: string;
|
|
11
|
-
children?: string;
|
|
12
|
-
}): FindChildrenItem | undefined;
|
package/es/utils/src/tree.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function findChildrenItem(options, targetValue, option) {
|
|
2
|
-
const valueField = option?.value || "value";
|
|
3
|
-
const childrenField = option?.children || "children";
|
|
4
|
-
for (const option2 of options) {
|
|
5
|
-
if (option2[valueField] === targetValue) {
|
|
6
|
-
return option2;
|
|
7
|
-
}
|
|
8
|
-
if (option2[childrenField]) {
|
|
9
|
-
const found = findChildrenItem(option2[childrenField], targetValue);
|
|
10
|
-
if (found) {
|
|
11
|
-
return found;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return void 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { findChildrenItem };
|
|
19
|
-
//# sourceMappingURL=tree.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree.mjs","sources":["../../../../../packages/utils/src/tree.ts"],"sourcesContent":["export interface FindChildrenItem extends Record<string, any> {\n label?: any;\n value?: any;\n children?: FindChildrenItem[];\n}\n/**\n * 获取子节点\n */\nexport function findChildrenItem(\n options: FindChildrenItem[],\n targetValue: any,\n option?: { value?: string; children?: string },\n): FindChildrenItem | undefined {\n const valueField = option?.value || 'value';\n const childrenField = option?.children || 'children';\n\n for (const option of options) {\n if (option[valueField] === targetValue) {\n return option;\n }\n if (option[childrenField]) {\n const found = findChildrenItem(option[childrenField], targetValue);\n\n if (found) {\n return found;\n }\n }\n }\n\n return undefined;\n}\n"],"names":["option"],"mappings":"AAQgB,SAAA,gBAAA,CACd,OACA,EAAA,WAAA,EACA,MAC8B,EAAA;AAC9B,EAAM,MAAA,UAAA,GAAa,QAAQ,KAAS,IAAA,OAAA,CAAA;AACpC,EAAM,MAAA,aAAA,GAAgB,QAAQ,QAAY,IAAA,UAAA,CAAA;AAE1C,EAAA,KAAA,MAAWA,WAAU,OAAS,EAAA;AAC5B,IAAIA,IAAAA,OAAAA,CAAO,UAAU,CAAA,KAAM,WAAa,EAAA;AACtC,MAAOA,OAAAA,OAAAA,CAAAA;AAAA,KACT;AACA,IAAIA,IAAAA,OAAAA,CAAO,aAAa,CAAG,EAAA;AACzB,MAAA,MAAM,KAAQ,GAAA,gBAAA,CAAiBA,OAAO,CAAA,aAAa,GAAG,WAAW,CAAA,CAAA;AAEjE,MAAA,IAAI,KAAO,EAAA;AACT,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT;;;;"}
|
package/lib/utils/src/tree.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface FindChildrenItem extends Record<string, any> {
|
|
2
|
-
label?: any;
|
|
3
|
-
value?: any;
|
|
4
|
-
children?: FindChildrenItem[];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* 获取子节点
|
|
8
|
-
*/
|
|
9
|
-
export declare function findChildrenItem(options: FindChildrenItem[], targetValue: any, option?: {
|
|
10
|
-
value?: string;
|
|
11
|
-
children?: string;
|
|
12
|
-
}): FindChildrenItem | undefined;
|
package/lib/utils/src/tree.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function findChildrenItem(options, targetValue, option) {
|
|
4
|
-
const valueField = option?.value || "value";
|
|
5
|
-
const childrenField = option?.children || "children";
|
|
6
|
-
for (const option2 of options) {
|
|
7
|
-
if (option2[valueField] === targetValue) {
|
|
8
|
-
return option2;
|
|
9
|
-
}
|
|
10
|
-
if (option2[childrenField]) {
|
|
11
|
-
const found = findChildrenItem(option2[childrenField], targetValue);
|
|
12
|
-
if (found) {
|
|
13
|
-
return found;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return void 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
exports.findChildrenItem = findChildrenItem;
|
|
21
|
-
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sources":["../../../../../packages/utils/src/tree.ts"],"sourcesContent":["export interface FindChildrenItem extends Record<string, any> {\n label?: any;\n value?: any;\n children?: FindChildrenItem[];\n}\n/**\n * 获取子节点\n */\nexport function findChildrenItem(\n options: FindChildrenItem[],\n targetValue: any,\n option?: { value?: string; children?: string },\n): FindChildrenItem | undefined {\n const valueField = option?.value || 'value';\n const childrenField = option?.children || 'children';\n\n for (const option of options) {\n if (option[valueField] === targetValue) {\n return option;\n }\n if (option[childrenField]) {\n const found = findChildrenItem(option[childrenField], targetValue);\n\n if (found) {\n return found;\n }\n }\n }\n\n return undefined;\n}\n"],"names":["option"],"mappings":";;AAQgB,SAAA,gBAAA,CACd,OACA,EAAA,WAAA,EACA,MAC8B,EAAA;AAC9B,EAAM,MAAA,UAAA,GAAa,QAAQ,KAAS,IAAA,OAAA,CAAA;AACpC,EAAM,MAAA,aAAA,GAAgB,QAAQ,QAAY,IAAA,UAAA,CAAA;AAE1C,EAAA,KAAA,MAAWA,WAAU,OAAS,EAAA;AAC5B,IAAIA,IAAAA,OAAAA,CAAO,UAAU,CAAA,KAAM,WAAa,EAAA;AACtC,MAAOA,OAAAA,OAAAA,CAAAA;AAAA,KACT;AACA,IAAIA,IAAAA,OAAAA,CAAO,aAAa,CAAG,EAAA;AACzB,MAAA,MAAM,KAAQ,GAAA,gBAAA,CAAiBA,OAAO,CAAA,aAAa,GAAG,WAAW,CAAA,CAAA;AAEjE,MAAA,IAAI,KAAO,EAAA;AACT,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT;;;;"}
|