giime 0.7.17 → 0.7.19
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 +88 -88
- package/es/components/src/composite/searchForm/SearchForm.vue.d.ts +4 -1
- package/es/components/src/composite/searchForm/SearchForm.vue.mjs +1 -1
- package/es/components/src/composite/searchForm/SearchForm.vue2.mjs +6 -1
- package/es/components/src/composite/searchForm/SearchForm.vue2.mjs.map +1 -1
- package/es/components/src/composite/searchForm/index.d.ts +12 -3
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/hooks/base/useDictionary/index.mjs +6 -5
- package/es/hooks/base/useDictionary/index.mjs.map +1 -1
- package/es/index.css +88 -88
- package/lib/components/src/composite/searchForm/SearchForm.vue.d.ts +4 -1
- package/lib/components/src/composite/searchForm/SearchForm.vue.js +1 -1
- package/lib/components/src/composite/searchForm/SearchForm.vue2.js +6 -1
- package/lib/components/src/composite/searchForm/SearchForm.vue2.js.map +1 -1
- package/lib/components/src/composite/searchForm/index.d.ts +12 -3
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/hooks/base/useDictionary/index.js +5 -4
- package/lib/hooks/base/useDictionary/index.js.map +1 -1
- package/lib/index.css +88 -88
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -886,6 +886,37 @@ video {
|
|
|
886
886
|
width: auto;
|
|
887
887
|
height: auto;
|
|
888
888
|
}
|
|
889
|
+
.circular[data-v-d7b04fae] {
|
|
890
|
+
animation: loading-rotate-d7b04fae 2s linear infinite;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.path[data-v-d7b04fae] {
|
|
894
|
+
animation: loading-dash-d7b04fae 1.5s ease-in-out infinite;
|
|
895
|
+
stroke-dasharray: 90, 150;
|
|
896
|
+
stroke-dashoffset: 0;
|
|
897
|
+
stroke: var(--el-color-primary);
|
|
898
|
+
stroke-linecap: round;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
@keyframes loading-rotate-d7b04fae {
|
|
902
|
+
to {
|
|
903
|
+
transform: rotate(360deg);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
@keyframes loading-dash-d7b04fae {
|
|
907
|
+
0% {
|
|
908
|
+
stroke-dasharray: 1, 200;
|
|
909
|
+
stroke-dashoffset: 0;
|
|
910
|
+
}
|
|
911
|
+
50% {
|
|
912
|
+
stroke-dasharray: 90, 150;
|
|
913
|
+
stroke-dashoffset: -40px;
|
|
914
|
+
}
|
|
915
|
+
100% {
|
|
916
|
+
stroke-dasharray: 90, 150;
|
|
917
|
+
stroke-dashoffset: -120px;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
889
920
|
.gm-upload-pro-file {
|
|
890
921
|
line-height: normal;
|
|
891
922
|
}
|
|
@@ -924,41 +955,6 @@ video {
|
|
|
924
955
|
.gm-upload-pro-file-disabled .el-upload-list__item-status-label {
|
|
925
956
|
display: none;
|
|
926
957
|
}
|
|
927
|
-
.circular[data-v-d7b04fae] {
|
|
928
|
-
animation: loading-rotate-d7b04fae 2s linear infinite;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
.path[data-v-d7b04fae] {
|
|
932
|
-
animation: loading-dash-d7b04fae 1.5s ease-in-out infinite;
|
|
933
|
-
stroke-dasharray: 90, 150;
|
|
934
|
-
stroke-dashoffset: 0;
|
|
935
|
-
stroke: var(--el-color-primary);
|
|
936
|
-
stroke-linecap: round;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
@keyframes loading-rotate-d7b04fae {
|
|
940
|
-
to {
|
|
941
|
-
transform: rotate(360deg);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
@keyframes loading-dash-d7b04fae {
|
|
945
|
-
0% {
|
|
946
|
-
stroke-dasharray: 1, 200;
|
|
947
|
-
stroke-dashoffset: 0;
|
|
948
|
-
}
|
|
949
|
-
50% {
|
|
950
|
-
stroke-dasharray: 90, 150;
|
|
951
|
-
stroke-dashoffset: -40px;
|
|
952
|
-
}
|
|
953
|
-
100% {
|
|
954
|
-
stroke-dasharray: 90, 150;
|
|
955
|
-
stroke-dashoffset: -120px;
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
[data-v-488ca110] .gmSearchForm .el-form-item {
|
|
959
|
-
margin-right: 0;
|
|
960
|
-
margin-bottom: 4px;
|
|
961
|
-
}
|
|
962
958
|
.gm-flex-center[data-v-c17deec9] {
|
|
963
959
|
align-items: center;
|
|
964
960
|
}
|
|
@@ -984,27 +980,31 @@ video {
|
|
|
984
980
|
.gm-number-interval-single[data-v-4e6f4d6f]:hover .gm-number-interval-close[data-v-4e6f4d6f] {
|
|
985
981
|
display: flex;
|
|
986
982
|
}
|
|
987
|
-
[data-v-
|
|
983
|
+
[data-v-d3111183] .gmSearchForm .el-form-item {
|
|
984
|
+
margin-right: 0;
|
|
985
|
+
margin-bottom: 4px;
|
|
986
|
+
}
|
|
987
|
+
[data-v-98c2e804] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
988
988
|
border-right: none;
|
|
989
989
|
}
|
|
990
990
|
|
|
991
|
-
[data-v-
|
|
991
|
+
[data-v-98c2e804] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
992
992
|
height: 0;
|
|
993
993
|
}
|
|
994
994
|
|
|
995
|
-
[data-v-
|
|
995
|
+
[data-v-98c2e804] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
996
996
|
height: 0;
|
|
997
997
|
}
|
|
998
998
|
|
|
999
|
-
[data-v-
|
|
999
|
+
[data-v-98c2e804] .gmTableNoBorder.el-table--border:after {
|
|
1000
1000
|
height: 0;
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
|
-
[data-v-
|
|
1003
|
+
[data-v-98c2e804] .gmTableNoBorder.el-table--border:before {
|
|
1004
1004
|
height: 0;
|
|
1005
1005
|
}
|
|
1006
1006
|
|
|
1007
|
-
[data-v-
|
|
1007
|
+
[data-v-98c2e804] .gmTableNoBorder .el-table__border-left-patch {
|
|
1008
1008
|
height: 0;
|
|
1009
1009
|
}
|
|
1010
1010
|
.gm-upload-preview-dialog[data-v-312f9322] [data-v-312f9322] .el-dialog__body {
|
|
@@ -1015,6 +1015,29 @@ video {
|
|
|
1015
1015
|
width: auto;
|
|
1016
1016
|
height: auto;
|
|
1017
1017
|
}
|
|
1018
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
1019
|
+
border-right: none;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
1023
|
+
height: 0;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
1027
|
+
height: 0;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:after {
|
|
1031
|
+
height: 0;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:before {
|
|
1035
|
+
height: 0;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__border-left-patch {
|
|
1039
|
+
height: 0;
|
|
1040
|
+
}
|
|
1018
1041
|
.gm-upload-file {
|
|
1019
1042
|
line-height: normal;
|
|
1020
1043
|
}
|
|
@@ -1050,29 +1073,6 @@ video {
|
|
|
1050
1073
|
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
1051
1074
|
display: none;
|
|
1052
1075
|
}
|
|
1053
|
-
[data-v-98c2e804] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
1054
|
-
border-right: none;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
[data-v-98c2e804] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
1058
|
-
height: 0;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
[data-v-98c2e804] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
1062
|
-
height: 0;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
[data-v-98c2e804] .gmTableNoBorder.el-table--border:after {
|
|
1066
|
-
height: 0;
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
[data-v-98c2e804] .gmTableNoBorder.el-table--border:before {
|
|
1070
|
-
height: 0;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
[data-v-98c2e804] .gmTableNoBorder .el-table__border-left-patch {
|
|
1074
|
-
height: 0;
|
|
1075
|
-
}
|
|
1076
1076
|
|
|
1077
1077
|
.pagination-container[data-v-47d35e7b] {
|
|
1078
1078
|
background: #fff;
|
|
@@ -1083,112 +1083,112 @@ video {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
|
|
1085
1085
|
@charset "UTF-8";
|
|
1086
|
-
.custom-
|
|
1086
|
+
.table-custom-header-drawer .el-drawer__header {
|
|
1087
1087
|
padding: 10px 15px;
|
|
1088
1088
|
margin: 0;
|
|
1089
1089
|
border-bottom: 1px solid #ebeef5;
|
|
1090
1090
|
}
|
|
1091
|
-
.custom-
|
|
1091
|
+
.table-custom-header-drawer .el-drawer__title {
|
|
1092
1092
|
font-size: 14px;
|
|
1093
1093
|
color: #333;
|
|
1094
1094
|
}
|
|
1095
|
-
.custom-
|
|
1095
|
+
.table-custom-header-drawer .el-drawer__body {
|
|
1096
1096
|
padding: 15px;
|
|
1097
1097
|
}
|
|
1098
|
-
.custom-
|
|
1098
|
+
.table-custom-header-drawer .el-drawer__footer {
|
|
1099
1099
|
padding: 10px 15px;
|
|
1100
1100
|
border-top: 1px solid #ebeef5;
|
|
1101
1101
|
}
|
|
1102
|
-
.custom-
|
|
1102
|
+
.table-custom-header-drawer .el-checkbox {
|
|
1103
1103
|
display: flex;
|
|
1104
1104
|
align-items: center;
|
|
1105
1105
|
}
|
|
1106
|
-
.custom-
|
|
1106
|
+
.table-custom-header-drawer .el-input__inner {
|
|
1107
1107
|
text-align: center;
|
|
1108
1108
|
}
|
|
1109
|
-
.custom-
|
|
1109
|
+
.table-custom-header-drawer .el-input__suffix {
|
|
1110
1110
|
position: absolute;
|
|
1111
1111
|
right: 10px;
|
|
1112
1112
|
}
|
|
1113
|
-
.custom-
|
|
1113
|
+
.table-custom-header-drawer .custom-content li {
|
|
1114
1114
|
display: flex;
|
|
1115
1115
|
align-items: center;
|
|
1116
1116
|
justify-content: center;
|
|
1117
1117
|
height: 44px;
|
|
1118
1118
|
}
|
|
1119
|
-
.custom-
|
|
1119
|
+
.table-custom-header-drawer .custom-group {
|
|
1120
1120
|
max-height: calc(100vh - 226px);
|
|
1121
1121
|
overflow-y: auto;
|
|
1122
1122
|
}
|
|
1123
|
-
.custom-
|
|
1123
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar {
|
|
1124
1124
|
/*滚动条整体样式*/
|
|
1125
1125
|
width: 4px;
|
|
1126
1126
|
/*高宽分别对应横竖滚动条的尺寸*/
|
|
1127
1127
|
height: 1px;
|
|
1128
1128
|
}
|
|
1129
|
-
.custom-
|
|
1129
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar-thumb {
|
|
1130
1130
|
/*滚动条里面小方块*/
|
|
1131
1131
|
border-radius: 10px;
|
|
1132
1132
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
|
|
1133
1133
|
background: #999;
|
|
1134
1134
|
}
|
|
1135
|
-
.custom-
|
|
1135
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar-track {
|
|
1136
1136
|
/*滚动条里面轨道*/
|
|
1137
1137
|
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
1138
1138
|
border-radius: 10px;
|
|
1139
1139
|
background: #eee;
|
|
1140
1140
|
}
|
|
1141
1141
|
@charset "UTF-8";
|
|
1142
|
-
.
|
|
1142
|
+
.custom-operate-drawer .el-drawer__header {
|
|
1143
1143
|
padding: 10px 15px;
|
|
1144
1144
|
margin: 0;
|
|
1145
1145
|
border-bottom: 1px solid #ebeef5;
|
|
1146
1146
|
}
|
|
1147
|
-
.
|
|
1147
|
+
.custom-operate-drawer .el-drawer__title {
|
|
1148
1148
|
font-size: 14px;
|
|
1149
1149
|
color: #333;
|
|
1150
1150
|
}
|
|
1151
|
-
.
|
|
1151
|
+
.custom-operate-drawer .el-drawer__body {
|
|
1152
1152
|
padding: 15px;
|
|
1153
1153
|
}
|
|
1154
|
-
.
|
|
1154
|
+
.custom-operate-drawer .el-drawer__footer {
|
|
1155
1155
|
padding: 10px 15px;
|
|
1156
1156
|
border-top: 1px solid #ebeef5;
|
|
1157
1157
|
}
|
|
1158
|
-
.
|
|
1158
|
+
.custom-operate-drawer .el-checkbox {
|
|
1159
1159
|
display: flex;
|
|
1160
1160
|
align-items: center;
|
|
1161
1161
|
}
|
|
1162
|
-
.
|
|
1162
|
+
.custom-operate-drawer .el-input__inner {
|
|
1163
1163
|
text-align: center;
|
|
1164
1164
|
}
|
|
1165
|
-
.
|
|
1165
|
+
.custom-operate-drawer .el-input__suffix {
|
|
1166
1166
|
position: absolute;
|
|
1167
1167
|
right: 10px;
|
|
1168
1168
|
}
|
|
1169
|
-
.
|
|
1169
|
+
.custom-operate-drawer .custom-content li {
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
align-items: center;
|
|
1172
1172
|
justify-content: center;
|
|
1173
1173
|
height: 44px;
|
|
1174
1174
|
}
|
|
1175
|
-
.
|
|
1175
|
+
.custom-operate-drawer .custom-group {
|
|
1176
1176
|
max-height: calc(100vh - 226px);
|
|
1177
1177
|
overflow-y: auto;
|
|
1178
1178
|
}
|
|
1179
|
-
.
|
|
1179
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar {
|
|
1180
1180
|
/*滚动条整体样式*/
|
|
1181
1181
|
width: 4px;
|
|
1182
1182
|
/*高宽分别对应横竖滚动条的尺寸*/
|
|
1183
1183
|
height: 1px;
|
|
1184
1184
|
}
|
|
1185
|
-
.
|
|
1185
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar-thumb {
|
|
1186
1186
|
/*滚动条里面小方块*/
|
|
1187
1187
|
border-radius: 10px;
|
|
1188
1188
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
|
|
1189
1189
|
background: #999;
|
|
1190
1190
|
}
|
|
1191
|
-
.
|
|
1191
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar-track {
|
|
1192
1192
|
/*滚动条里面轨道*/
|
|
1193
1193
|
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
1194
1194
|
border-radius: 10px;
|
|
@@ -12,7 +12,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
12
12
|
type: BooleanConstructor;
|
|
13
13
|
default: boolean;
|
|
14
14
|
};
|
|
15
|
-
}, {
|
|
15
|
+
}, {
|
|
16
|
+
handleQuery: (...args: any[]) => void;
|
|
17
|
+
resetQuery: () => void;
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
19
|
"update:showSearch": (showSearch: boolean) => void;
|
|
17
20
|
"update:queryParams": (queryParams: Record<string, any>) => void;
|
|
18
21
|
handleQuery: (...args: any[]) => void;
|
|
@@ -2,7 +2,7 @@ import _sfc_main from './SearchForm.vue2.mjs';
|
|
|
2
2
|
import './SearchForm.vue3.mjs';
|
|
3
3
|
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
4
|
|
|
5
|
-
var SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
var SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d3111183"]]);
|
|
6
6
|
|
|
7
7
|
export { SearchForm as default };
|
|
8
8
|
//# sourceMappingURL=SearchForm.vue.mjs.map
|
|
@@ -18,7 +18,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
"queryParamsModifiers": {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ mergeModels(searchFormEmits, ["update:showSearch", "update:queryParams"]),
|
|
21
|
-
setup(__props, { emit: __emit }) {
|
|
21
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
22
22
|
const tableCtx = inject(TableCtxKey, {});
|
|
23
23
|
const showSearch = useModel(__props, "showSearch");
|
|
24
24
|
const queryParams = useModel(__props, "queryParams");
|
|
@@ -69,6 +69,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
69
|
tableCtx?.tableRef?.value?.scrollTo({ top: 0, behavior: "smooth" });
|
|
70
70
|
tableCtx.tableV2Ref?.value?.scrollTo({ scrollLeft: 0, scrollTop: 0 });
|
|
71
71
|
};
|
|
72
|
+
__expose({
|
|
73
|
+
// queryRef,
|
|
74
|
+
handleQuery,
|
|
75
|
+
resetQuery
|
|
76
|
+
});
|
|
72
77
|
return (_ctx, _cache) => {
|
|
73
78
|
const _component_gm_button = resolveComponent("gm-button");
|
|
74
79
|
const _component_gm_icon = resolveComponent("gm-icon");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchForm.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/searchForm/SearchForm.vue"],"sourcesContent":["<script lang=\"ts\">\nconst itemGap = 8\n</script>\n<template>\n <div ref=\"queryDivRef\" class=\"gm-mb-5\">\n <gm-form v-show=\"showSearch\" ref=\"queryRef\" :model=\"queryParams\" :inline=\"true\" class=\"gmSearchForm\">\n <div :class=\"showMore ? '' : 'gm-h-[36px] gm-overflow-hidden'\">\n <div class=\"gm-relative gm-grid gm-w-full\" :style=\"{ gridTemplateColumns: `repeat(${colsCount}, minmax(0, 1fr))`, gap: itemGap + 'px' }\">\n <template v-for=\"(item, index) in optionsList\" :key=\"index\">\n <component :is=\"item.component\" v-bind=\"item.props\" v-model=\"queryParams[item.props.prop]\" />\n </template>\n <slot />\n <gm-form-item :style=\"searchButtonItemStyle\">\n <div class=\"gm-flex gm-w-full\" :class=\"notShowShowMore ? '' : ' gm-justify-end'\">\n <gm-button type=\"primary\" :icon=\"Search\" class=\"\" @click=\"handleQuery\">搜索</gm-button>\n <gm-button :icon=\"Refresh\" @click=\"resetQuery\">重置</gm-button>\n <gm-button v-show=\"!notShowShowMore\" type=\"primary\" text @click=\"handleShowMoreChange\">\n {{ showMore ? '缩起' : '展开' }} <gm-icon class=\"el-icon--right\" :class=\"showMore ? 'gm-rotate-180' : ''\"><ArrowDown /></gm-icon>\n </gm-button>\n </div>\n </gm-form-item>\n <div ref=\"visibilityMarkRef\" class=\"gm-absolute gm-bottom-3 gm-right-0 -gm-z-10 gm-h-1 gm-w-1\" />\n </div>\n </div>\n </gm-form>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject, nextTick, provide, ref } from 'vue';\nimport { useElementSize } from '@vueuse/core';\nimport { TableCtxKey } from '@giime/constants/table';\nimport { ArrowDown, Refresh, Search } from '@element-plus/icons-vue';\nimport { searchFormEmits, searchFormItemList, searchFormProps } from './searchForm';\nimport { queryParamsKey, searchFormHandleQueryKey } from './constants';\nimport type { CSSProperties } from 'vue';\nimport type { FormInstance } from '../../base/form';\ndefineOptions({\n name: 'GmSearchForm',\n});\nconst tableCtx = inject(TableCtxKey, {});\n\nconst showSearch = defineModel<boolean>('showSearch', { default: true });\n\nconst queryParams = defineModel<Record<string, any>>('queryParams', { required: true });\n\nprovide(queryParamsKey, queryParams);\n\nconst props = defineProps(searchFormProps);\nconst emit = defineEmits(searchFormEmits);\n\nconst queryDivRef = ref<HTMLDivElement>();\nconst visibilityMarkRef = ref<HTMLDivElement>();\n// const markIsVisibility = useElementVisibility(visibilityMarkRef);\n\nconst { width: queryDivWidth, height: queryDivHeight } = useElementSize(queryDivRef);\n// 列个数\nconst colsCount = computed(() => Math.floor(queryDivWidth.value / 269));\nconst showMore = ref(props.defaultShowMore);\n// 当 showMore展开 且高度为60时,不显示展开按钮\nconst notShowShowMore = computed(() => showMore.value === true && queryDivHeight.value <= 70);\n\n/**搜索重置按钮组样式 */\nconst searchButtonItemStyle = computed<CSSProperties>(() => {\n if (notShowShowMore.value) {\n return {};\n }\n return {\n gridColumn: colsCount.value,\n gridRow: showMore.value ? undefined : 1,\n };\n});\nconst handleShowMoreChange = async () => {\n showMore.value = !showMore.value;\n // 手动触发 scroll 事件\n const scrollEvent = new Event('resize');\n await nextTick();\n // 手动触发事件\n window.dispatchEvent(scrollEvent);\n};\n\n// 通过json渲染组件\nconst optionsList = computed(() => {\n return props.options.map(it => {\n const findComponent = searchFormItemList.find(item => item.type === it.type);\n if (findComponent) {\n it.component = findComponent.component;\n }\n return it;\n });\n});\n\nconst queryRef = ref<FormInstance>();\n// 上下文添加queryRef\ntableCtx.queryRef = queryRef;\nconst handleQuery = (...args: any[]) => {\n emit('handleQuery', ...args);\n tableCtx?.tableRef?.value?.scrollTo({ top: 0, behavior: 'smooth' });\n tableCtx.tableV2Ref?.value?.scrollTo({ scrollLeft: 0, scrollTop: 0 });\n};\nprovide(searchFormHandleQueryKey, handleQuery);\n\nconst resetQuery = () => {\n queryRef.value?.resetFields();\n emit('resetQuery');\n tableCtx?.tableRef?.value?.scrollTo({ top: 0, behavior: 'smooth' });\n tableCtx.tableV2Ref?.value?.scrollTo({ scrollLeft: 0, scrollTop: 0 });\n};\n</script>\n<style lang=\"scss\" scoped>\n:deep(.gmSearchForm .el-form-item) {\n margin-right: 0;\n margin-bottom: 4px;\n}\n</style>\n"],"names":["_useModel"],"mappings":";;;;;;;AACA,MAAM,OAAU,GAAA,CAAA,CAAA;;;;;;;;;;;;;;AAsChB,IAAA,MAAM,QAAW,GAAA,MAAA,CAAO,WAAa,EAAA,EAAE,CAAA,CAAA;AAEvC,IAAM,MAAA,UAAA,GAAaA,QAAoB,CAAA,OAAA,EAAC,YAA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,EAAA,SAAA,EAAW,GAAG,CAAA,CAAA;AAAA,KACtE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"SearchForm.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/searchForm/SearchForm.vue"],"sourcesContent":["<script lang=\"ts\">\nconst itemGap = 8\n</script>\n<template>\n <div ref=\"queryDivRef\" class=\"gm-mb-5\">\n <gm-form v-show=\"showSearch\" ref=\"queryRef\" :model=\"queryParams\" :inline=\"true\" class=\"gmSearchForm\">\n <div :class=\"showMore ? '' : 'gm-h-[36px] gm-overflow-hidden'\">\n <div class=\"gm-relative gm-grid gm-w-full\" :style=\"{ gridTemplateColumns: `repeat(${colsCount}, minmax(0, 1fr))`, gap: itemGap + 'px' }\">\n <template v-for=\"(item, index) in optionsList\" :key=\"index\">\n <component :is=\"item.component\" v-bind=\"item.props\" v-model=\"queryParams[item.props.prop]\" />\n </template>\n <slot />\n <gm-form-item :style=\"searchButtonItemStyle\">\n <div class=\"gm-flex gm-w-full\" :class=\"notShowShowMore ? '' : ' gm-justify-end'\">\n <gm-button type=\"primary\" :icon=\"Search\" class=\"\" @click=\"handleQuery\">搜索</gm-button>\n <gm-button :icon=\"Refresh\" @click=\"resetQuery\">重置</gm-button>\n <gm-button v-show=\"!notShowShowMore\" type=\"primary\" text @click=\"handleShowMoreChange\">\n {{ showMore ? '缩起' : '展开' }} <gm-icon class=\"el-icon--right\" :class=\"showMore ? 'gm-rotate-180' : ''\"><ArrowDown /></gm-icon>\n </gm-button>\n </div>\n </gm-form-item>\n <div ref=\"visibilityMarkRef\" class=\"gm-absolute gm-bottom-3 gm-right-0 -gm-z-10 gm-h-1 gm-w-1\" />\n </div>\n </div>\n </gm-form>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject, nextTick, provide, ref } from 'vue';\nimport { useElementSize } from '@vueuse/core';\nimport { TableCtxKey } from '@giime/constants/table';\nimport { ArrowDown, Refresh, Search } from '@element-plus/icons-vue';\nimport { searchFormEmits, searchFormItemList, searchFormProps } from './searchForm';\nimport { queryParamsKey, searchFormHandleQueryKey } from './constants';\nimport type { CSSProperties } from 'vue';\nimport type { FormInstance } from '../../base/form';\ndefineOptions({\n name: 'GmSearchForm',\n});\nconst tableCtx = inject(TableCtxKey, {});\n\nconst showSearch = defineModel<boolean>('showSearch', { default: true });\n\nconst queryParams = defineModel<Record<string, any>>('queryParams', { required: true });\n\nprovide(queryParamsKey, queryParams);\n\nconst props = defineProps(searchFormProps);\nconst emit = defineEmits(searchFormEmits);\n\nconst queryDivRef = ref<HTMLDivElement>();\nconst visibilityMarkRef = ref<HTMLDivElement>();\n// const markIsVisibility = useElementVisibility(visibilityMarkRef);\n\nconst { width: queryDivWidth, height: queryDivHeight } = useElementSize(queryDivRef);\n// 列个数\nconst colsCount = computed(() => Math.floor(queryDivWidth.value / 269));\nconst showMore = ref(props.defaultShowMore);\n// 当 showMore展开 且高度为60时,不显示展开按钮\nconst notShowShowMore = computed(() => showMore.value === true && queryDivHeight.value <= 70);\n\n/**搜索重置按钮组样式 */\nconst searchButtonItemStyle = computed<CSSProperties>(() => {\n if (notShowShowMore.value) {\n return {};\n }\n return {\n gridColumn: colsCount.value,\n gridRow: showMore.value ? undefined : 1,\n };\n});\nconst handleShowMoreChange = async () => {\n showMore.value = !showMore.value;\n // 手动触发 scroll 事件\n const scrollEvent = new Event('resize');\n await nextTick();\n // 手动触发事件\n window.dispatchEvent(scrollEvent);\n};\n\n// 通过json渲染组件\nconst optionsList = computed(() => {\n return props.options.map(it => {\n const findComponent = searchFormItemList.find(item => item.type === it.type);\n if (findComponent) {\n it.component = findComponent.component;\n }\n return it;\n });\n});\n\nconst queryRef = ref<FormInstance>();\n// 上下文添加queryRef\ntableCtx.queryRef = queryRef;\nconst handleQuery = (...args: any[]) => {\n emit('handleQuery', ...args);\n tableCtx?.tableRef?.value?.scrollTo({ top: 0, behavior: 'smooth' });\n tableCtx.tableV2Ref?.value?.scrollTo({ scrollLeft: 0, scrollTop: 0 });\n};\nprovide(searchFormHandleQueryKey, handleQuery);\n\nconst resetQuery = () => {\n queryRef.value?.resetFields();\n emit('resetQuery');\n tableCtx?.tableRef?.value?.scrollTo({ top: 0, behavior: 'smooth' });\n tableCtx.tableV2Ref?.value?.scrollTo({ scrollLeft: 0, scrollTop: 0 });\n};\n\ndefineExpose({\n // queryRef,\n handleQuery,\n resetQuery,\n});\n</script>\n<style lang=\"scss\" scoped>\n:deep(.gmSearchForm .el-form-item) {\n margin-right: 0;\n margin-bottom: 4px;\n}\n</style>\n"],"names":["_useModel"],"mappings":";;;;;;;AACA,MAAM,OAAU,GAAA,CAAA,CAAA;;;;;;;;;;;;;;AAsChB,IAAA,MAAM,QAAW,GAAA,MAAA,CAAO,WAAa,EAAA,EAAE,CAAA,CAAA;AAEvC,IAAM,MAAA,UAAA,GAAaA,QAAoB,CAAA,OAAA,EAAC,YAA+B,CAAA,CAAA;AAEvE,IAAM,MAAA,WAAA,GAAcA,QAAiC,CAAA,OAAA,EAAA,aAAiC,CAAA,CAAA;AAEtF,IAAA,OAAA,CAAQ,gBAAgB,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAA,MAAM,cAAc,GAAoB,EAAA,CAAA;AACxC,IAAA,MAAM,oBAAoB,GAAoB,EAAA,CAAA;AAG9C,IAAA,MAAM,EAAE,KAAO,EAAA,aAAA,EAAe,QAAQ,cAAe,EAAA,GAAI,eAAe,WAAW,CAAA,CAAA;AAEnF,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,IAAA,CAAK,MAAM,aAAc,CAAA,KAAA,GAAQ,GAAG,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AAW,GAAA,QAAA,CAAA;AACpB,IAAM,MAAA,WAAA,GAAc,IAAI,IAAgB,KAAA;AACtC,MAAK,IAAA,CAAA,aAAA,EAAe,GAAG,IAAI,CAAA,CAAA;AAC3B,MAAU,QAAA,EAAA,QAAA,EAAU,OAAO,QAAS,CAAA,EAAE,KAAK,CAAG,EAAA,QAAA,EAAU,UAAU,CAAA,CAAA;AAClE,MAAS,QAAA,CAAA,UAAA,EAAY,OAAO,QAAS,CAAA,EAAE,YAAY,CAAG,EAAA,SAAA,EAAW,GAAG,CAAA,CAAA;AAAA,KACtE,CAAA;AACA,IAAA,OAAA,CAAQ,0BAA0B,WAAW,CAAA,CAAA;AAE7C,IAAA,MAAM,aAAa,MAAM;AACvB,MAAA,QAAA,CAAS,OAAO,WAAY,EAAA,CAAA;AAC5B,MAAA,IAAA,CAAK,YAAY,CAAA,CAAA;AACjB,MAAU,QAAA,EAAA,QAAA,EAAU,OAAO,QAAS,CAAA,EAAE,KAAK,CAAG,EAAA,QAAA,EAAU,UAAU,CAAA,CAAA;AAClE,MAAS,QAAA,CAAA,UAAA,EAAY,OAAO,QAAS,CAAA,EAAE,YAAY,CAAG,EAAA,SAAA,EAAW,GAAG,CAAA,CAAA;AAAA,KACtE,CAAA;AAEA,IAAa,QAAA,CAAA;AAAA;AAAA,MAEX,WAAA;AAAA,MACA,UAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,7 +19,10 @@ export declare const GmSearchForm: import("../../../../utils").SFCWithInstall<{
|
|
|
19
19
|
"onUpdate:queryParams"?: ((queryParams: Record<string, any>) => any) | undefined;
|
|
20
20
|
onHandleQuery?: ((...args: any[]) => any) | undefined;
|
|
21
21
|
onResetQuery?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
}, {
|
|
22
|
+
}, {
|
|
23
|
+
handleQuery: (...args: any[]) => void;
|
|
24
|
+
resetQuery: () => void;
|
|
25
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
26
|
"update:showSearch": (showSearch: boolean) => void;
|
|
24
27
|
"update:queryParams": (queryParams: Record<string, any>) => void;
|
|
25
28
|
handleQuery: (...args: any[]) => void;
|
|
@@ -72,7 +75,10 @@ export declare const GmSearchForm: import("../../../../utils").SFCWithInstall<{
|
|
|
72
75
|
"onUpdate:queryParams"?: ((queryParams: Record<string, any>) => any) | undefined;
|
|
73
76
|
onHandleQuery?: ((...args: any[]) => any) | undefined;
|
|
74
77
|
onResetQuery?: ((...args: any[]) => any) | undefined;
|
|
75
|
-
}, {
|
|
78
|
+
}, {
|
|
79
|
+
handleQuery: (...args: any[]) => void;
|
|
80
|
+
resetQuery: () => void;
|
|
81
|
+
}, {}, {}, {}, {
|
|
76
82
|
options: import("./searchForm").SearchFormPropsOption[];
|
|
77
83
|
defaultShowMore: boolean;
|
|
78
84
|
}>;
|
|
@@ -98,7 +104,10 @@ export declare const GmSearchForm: import("../../../../utils").SFCWithInstall<{
|
|
|
98
104
|
"onUpdate:queryParams"?: ((queryParams: Record<string, any>) => any) | undefined;
|
|
99
105
|
onHandleQuery?: ((...args: any[]) => any) | undefined;
|
|
100
106
|
onResetQuery?: ((...args: any[]) => any) | undefined;
|
|
101
|
-
}, {
|
|
107
|
+
}, {
|
|
108
|
+
handleQuery: (...args: any[]) => void;
|
|
109
|
+
resetQuery: () => void;
|
|
110
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
102
111
|
"update:showSearch": (showSearch: boolean) => void;
|
|
103
112
|
"update:queryParams": (queryParams: Record<string, any>) => void;
|
|
104
113
|
handleQuery: (...args: any[]) => void;
|
package/es/giime/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.7.
|
|
1
|
+
export declare const version = "0.7.19";
|
package/es/giime/version.mjs
CHANGED
package/es/giime/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.7.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.7.18';\n"],"names":[],"mappings":"AAAO,MAAM,OAAU,GAAA;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../../../api/guardBasic/controller/index.mjs';
|
|
2
|
-
import { ref, computed
|
|
2
|
+
import { ref, computed } from 'vue';
|
|
3
|
+
import { tryOnMounted } from '@vueuse/core';
|
|
3
4
|
import { usePostBasicV1DataDictionaryBatchDetailByCode } from '../../../api/guardBasic/controller/JiChuFuWu/ShuJuZiDianGuanLi/usePostBasicV1DataDictionaryBatchDetailByCode.mjs';
|
|
4
5
|
|
|
5
6
|
const useDictionary = (fieldCodes, options) => {
|
|
@@ -29,11 +30,11 @@ const useDictionary = (fieldCodes, options) => {
|
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
const immediate = options?.immediate ?? true;
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
tryOnMounted(() => {
|
|
34
|
+
if (immediate) {
|
|
34
35
|
getDictionary();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
37
38
|
return {
|
|
38
39
|
dictionaryList,
|
|
39
40
|
dictionary,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/hooks/base/useDictionary/index.ts"],"sourcesContent":["import type { DataDictVo } from '@giime/api/guardBasic/interface';\nimport { usePostBasicV1DataDictionaryBatchDetailByCode } from '@giime/api/guardBasic/controller';\nimport { ref, computed
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/hooks/base/useDictionary/index.ts"],"sourcesContent":["import type { DataDictVo } from '@giime/api/guardBasic/interface';\nimport { usePostBasicV1DataDictionaryBatchDetailByCode } from '@giime/api/guardBasic/controller';\nimport { ref, computed } from 'vue';\nimport { tryOnMounted } from '@vueuse/core';\n\nexport interface DictionaryOption {\n label: string;\n value: any;\n tagType?: 'success' | 'warning' | 'info' | 'primary' | 'danger';\n}\n/**字典 */\nexport const useDictionary = <T extends string>(fieldCodes: T[], options?: { immediate?: boolean }) => {\n const { exec: getDictionaryExec } = usePostBasicV1DataDictionaryBatchDetailByCode();\n const isLoading = ref(false);\n const dictionaryList = ref<DataDictVo[]>([]);\n const dictionary = computed(() => {\n return dictionaryList.value.reduce(\n (acc, item) => {\n acc[item.fieldCode as T] =\n item?.values?.map(it => ({\n label: it.valueName,\n value: it.valueCode,\n tagType: it.tagType as DictionaryOption['tagType'],\n })) || [];\n\n return acc;\n },\n {} as Record<T, DictionaryOption[]>,\n );\n });\n const getDictionary = async () => {\n isLoading.value = true;\n try {\n const { data } = await getDictionaryExec({ fieldCodes });\n\n dictionaryList.value = data.value?.data || [];\n } finally {\n isLoading.value = false;\n }\n };\n const immediate = options?.immediate ?? true;\n tryOnMounted(() => {\n if (immediate) {\n getDictionary();\n }\n });\n\n return {\n dictionaryList,\n dictionary,\n isLoading,\n getDictionary,\n };\n};\n"],"names":[],"mappings":";;;;;AAWa,MAAA,aAAA,GAAgB,CAAmB,UAAA,EAAiB,OAAsC,KAAA;AACrG,EAAA,MAAM,EAAE,IAAA,EAAM,iBAAkB,EAAA,GAAI,6CAA8C,EAAA,CAAA;AAClF,EAAM,MAAA,SAAA,GAAY,IAAI,KAAK,CAAA,CAAA;AAC3B,EAAM,MAAA,cAAA,GAAiB,GAAkB,CAAA,EAAE,CAAA,CAAA;AAC3C,EAAM,MAAA,UAAA,GAAa,SAAS,MAAM;AAChC,IAAA,OAAO,eAAe,KAAM,CAAA,MAAA;AAAA,M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