@jzt-packages/components 1.0.0

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.
Files changed (145) hide show
  1. package/package.json +68 -0
  2. package/src/JztBackTop/index.vue +255 -0
  3. package/src/JztButtonList/index.vue +88 -0
  4. package/src/JztChart/index.vue +95 -0
  5. package/src/JztCharts/index.vue +317 -0
  6. package/src/JztClassTabs/index.vue +156 -0
  7. package/src/JztDateSelect/dateSelect.vue +186 -0
  8. package/src/JztDateSelect/dateType.vue +54 -0
  9. package/src/JztDateSelect/index.ts +135 -0
  10. package/src/JztDateSelect/interface/index.ts +13 -0
  11. package/src/JztDialog/index.vue +249 -0
  12. package/src/JztEllipsisTooltip/index.vue +61 -0
  13. package/src/JztEmpty/index.vue +45 -0
  14. package/src/JztErrorPage/403.vue +30 -0
  15. package/src/JztErrorPage/404.vue +19 -0
  16. package/src/JztErrorPage/500.vue +18 -0
  17. package/src/JztErrorPage/assets/401.png +0 -0
  18. package/src/JztErrorPage/assets/403.png +0 -0
  19. package/src/JztErrorPage/assets/404.png +0 -0
  20. package/src/JztErrorPage/assets/500.png +0 -0
  21. package/src/JztErrorPage/index.scss +35 -0
  22. package/src/JztErrorPage/index.vue +35 -0
  23. package/src/JztFilePreview/components/pdfViewer.vue +221 -0
  24. package/src/JztFilePreview/hooks/useImageMethod.ts +256 -0
  25. package/src/JztFilePreview/index.scss +171 -0
  26. package/src/JztFilePreview/index.vue +68 -0
  27. package/src/JztFilePreview/interface/index.ts +18 -0
  28. package/src/JztFilePreview/previewFile.vue +371 -0
  29. package/src/JztFormGrid/README.md +520 -0
  30. package/src/JztFormGrid/components/formItem.vue +209 -0
  31. package/src/JztFormGrid/components/formItemValue.vue +384 -0
  32. package/src/JztFormGrid/components/showDetailForm.vue +172 -0
  33. package/src/JztFormGrid/index.scss +60 -0
  34. package/src/JztFormGrid/index.vue +513 -0
  35. package/src/JztFormGrid/interface/index.ts +106 -0
  36. package/src/JztGrid/components/GridItem.vue +68 -0
  37. package/src/JztGrid/index.vue +179 -0
  38. package/src/JztGrid/interface/index.ts +6 -0
  39. package/src/JztImportExcel/assets/delete.png +0 -0
  40. package/src/JztImportExcel/index.scss +46 -0
  41. package/src/JztImportExcel/index.vue +430 -0
  42. package/src/JztImportExcel/interface/index.ts +25 -0
  43. package/src/JztLabelTitle/index.vue +65 -0
  44. package/src/JztLeftRightMode/components/CollapseButton.vue +80 -0
  45. package/src/JztLeftRightMode/components/LeftCard.vue +203 -0
  46. package/src/JztLeftRightMode/components/LeftLayout.vue +173 -0
  47. package/src/JztLeftRightMode/components/RightHeader.vue +186 -0
  48. package/src/JztLeftRightMode/components/RightLayout.vue +235 -0
  49. package/src/JztLeftRightMode/components/RightTableHeader.vue +43 -0
  50. package/src/JztLeftRightMode/hooks/useCollapse.ts +17 -0
  51. package/src/JztLeftRightMode/hooks/useDefaultProps.ts +19 -0
  52. package/src/JztLeftRightMode/hooks/useLeftLayout.ts +201 -0
  53. package/src/JztLeftRightMode/hooks/useMode.ts +20 -0
  54. package/src/JztLeftRightMode/hooks/usePrevNext.ts +60 -0
  55. package/src/JztLeftRightMode/hooks/useRightLayout.ts +215 -0
  56. package/src/JztLeftRightMode/hooks/useSlots.ts +15 -0
  57. package/src/JztLeftRightMode/index.ts +3 -0
  58. package/src/JztLeftRightMode/index.vue +494 -0
  59. package/src/JztLeftRightMode/types/index.ts +457 -0
  60. package/src/JztLoading/fullScreen.ts +45 -0
  61. package/src/JztLoading/index.scss +67 -0
  62. package/src/JztLoading/index.vue +18 -0
  63. package/src/JztLogin/components/LoginFooter.vue +17 -0
  64. package/src/JztLogin/components/LoginForm.vue +99 -0
  65. package/src/JztLogin/hooks/useLogin.ts +186 -0
  66. package/src/JztLogin/index.scss +142 -0
  67. package/src/JztLogin/index.vue +31 -0
  68. package/src/JztLogin/interface/index.ts +47 -0
  69. package/src/JztNumericalRange/index.vue +81 -0
  70. package/src/JztPageCard/comm/datePicker.vue +151 -0
  71. package/src/JztPageCard/comm/details.vue +60 -0
  72. package/src/JztPageCard/comm/export.vue +24 -0
  73. package/src/JztPageCard/comm/tabs.vue +94 -0
  74. package/src/JztPageCard/comm/tooltip.vue +31 -0
  75. package/src/JztPageCard/index.vue +287 -0
  76. package/src/JztPagination/index.vue +70 -0
  77. package/src/JztProductInfo/components/imagePreview.vue +275 -0
  78. package/src/JztProductInfo/components/qxUnique.vue +101 -0
  79. package/src/JztProductInfo/components/records.vue +265 -0
  80. package/src/JztProductInfo/hooks/useParams.ts +143 -0
  81. package/src/JztProductInfo/hooks/useQxUnique.tsx +466 -0
  82. package/src/JztProductInfo/images/defaultProduct.png +0 -0
  83. package/src/JztProductInfo/index.ts +116 -0
  84. package/src/JztProductInfo/index.vue +108 -0
  85. package/src/JztProductInfo/interface/index.ts +15 -0
  86. package/src/JztQueryDetailTable/index.scss +100 -0
  87. package/src/JztQueryDetailTable/index.vue +400 -0
  88. package/src/JztQueryDetailTable/interface/index.ts +10 -0
  89. package/src/JztQueryTable/QueryTable /345/212/237/350/203/275.md" +1580 -0
  90. package/src/JztQueryTable/README.md +567 -0
  91. package/src/JztQueryTable/components/ColSetting.vue +67 -0
  92. package/src/JztQueryTable/components/ColumnsSetting.vue +404 -0
  93. package/src/JztQueryTable/components/ColumnsSetting1.vue +220 -0
  94. package/src/JztQueryTable/components/DeployToAccountLevelSetting.vue +351 -0
  95. package/src/JztQueryTable/components/Pagination.vue +54 -0
  96. package/src/JztQueryTable/components/TableColumn.vue +109 -0
  97. package/src/JztQueryTable/const.ts +1 -0
  98. package/src/JztQueryTable/hooks/useQueryTable.ts +194 -0
  99. package/src/JztQueryTable/hooks/useSelection.ts +47 -0
  100. package/src/JztQueryTable/hooks/useTableSetting.ts +197 -0
  101. package/src/JztQueryTable/hooks/useTemplate.ts +127 -0
  102. package/src/JztQueryTable/index.scss +91 -0
  103. package/src/JztQueryTable/index.vue +1445 -0
  104. package/src/JztQueryTable/interface/index.ts +185 -0
  105. package/src/JztRegionSelect/index.vue +134 -0
  106. package/src/JztSearchForm/components/SearchFormItem.vue +473 -0
  107. package/src/JztSearchForm/index.vue +530 -0
  108. package/src/JztSearchForm/interface/index.ts +100 -0
  109. package/src/JztSelectFilter/index.scss +63 -0
  110. package/src/JztSelectFilter/index.vue +110 -0
  111. package/src/JztSelectTable/index.vue +257 -0
  112. package/src/JztTable/index.scss +72 -0
  113. package/src/JztTable/index.vue +353 -0
  114. package/src/JztTable/interface/index.ts +1 -0
  115. package/src/JztTime/comm/agencySelect.vue +112 -0
  116. package/src/JztTime/comm/collapseRow.vue +132 -0
  117. package/src/JztTime/comm/dateSelect.vue +292 -0
  118. package/src/JztTime/comm/deptSelect.vue +193 -0
  119. package/src/JztTime/comm/typeSelect.vue +97 -0
  120. package/src/JztTime/index.ts +216 -0
  121. package/src/JztTime/index.vue +303 -0
  122. package/src/JztTime/interface/index.ts +23 -0
  123. package/src/JztTreeFilter/index.scss +44 -0
  124. package/src/JztTreeFilter/index.vue +177 -0
  125. package/src/JztUploadFile/interface/index.ts +21 -0
  126. package/src/JztUploadFile/multiple.scss +215 -0
  127. package/src/JztUploadFile/multiple.vue +318 -0
  128. package/src/JztUploadFile/single.scss +226 -0
  129. package/src/JztUploadFile/single.vue +274 -0
  130. package/src/JztUploadImg/Img.vue +294 -0
  131. package/src/JztUploadImg/Imgs.vue +411 -0
  132. package/src/JztUploadImg/index.scss +138 -0
  133. package/src/JztUploadImg/interface/index.ts +22 -0
  134. package/src/SelectIcon/index.scss +39 -0
  135. package/src/SelectIcon/index.vue +106 -0
  136. package/src/SvgIcon/index.vue +22 -0
  137. package/src/hooks/useAuthButtons.ts +58 -0
  138. package/src/hooks/useFormByUserType.ts +90 -0
  139. package/src/hooks/useTableEvents.ts +30 -0
  140. package/src/hooks/useUploadFileHook.ts +262 -0
  141. package/src/index.ts +91 -0
  142. package/src/typings/global.d.ts +101 -0
  143. package/src/utils/index.ts +107 -0
  144. package/src/utils/tree.ts +57 -0
  145. package/tsconfig.json +45 -0
@@ -0,0 +1,177 @@
1
+ <template>
2
+ <div class="spd-card filter">
3
+ <h4 v-if="title" class="title sle">
4
+ {{ title }}
5
+ </h4>
6
+ <div class="search">
7
+ <el-input
8
+ v-model="filterText"
9
+ placeholder="输入关键字进行过滤"
10
+ clearable
11
+ />
12
+ <el-dropdown trigger="click">
13
+ <el-icon size="20"><More /></el-icon>
14
+ <template #dropdown>
15
+ <el-dropdown-menu>
16
+ <el-dropdown-item @click="toggleTreeNodes(true)"
17
+ >展开全部</el-dropdown-item
18
+ >
19
+ <el-dropdown-item @click="toggleTreeNodes(false)"
20
+ >折叠全部</el-dropdown-item
21
+ >
22
+ </el-dropdown-menu>
23
+ </template>
24
+ </el-dropdown>
25
+ </div>
26
+ <el-scrollbar
27
+ :style="{ height: title ? `calc(100% - 95px)` : `calc(100% - 56px)` }"
28
+ >
29
+ <el-tree
30
+ ref="treeRef"
31
+ default-expand-all
32
+ :node-key="id"
33
+ :data="multiple ? treeData : treeAllData"
34
+ :show-checkbox="multiple"
35
+ :check-strictly="false"
36
+ :current-node-key="!multiple ? selected : ''"
37
+ :highlight-current="!multiple"
38
+ :expand-on-click-node="false"
39
+ :check-on-click-node="multiple"
40
+ :props="defaultProps"
41
+ :filter-node-method="filterNode"
42
+ :default-checked-keys="multiple ? selected : []"
43
+ @node-click="handleNodeClick"
44
+ @check="handleCheckChange"
45
+ >
46
+ <template #default="scope">
47
+ <span class="el-tree-node__label">
48
+ <slot :row="scope">
49
+ {{ scope.node.label }}
50
+ </slot>
51
+ </span>
52
+ </template>
53
+ </el-tree>
54
+ </el-scrollbar>
55
+ </div>
56
+ </template>
57
+
58
+ <script setup lang="ts" name="TreeFilter">
59
+ import { ref, watch, onBeforeMount, nextTick } from "vue";
60
+ import { ElTree } from "element-plus";
61
+
62
+ // 接收父组件参数并设置默认值
63
+ interface TreeFilterProps {
64
+ requestApi?: (data?: any) => Promise<any>; // 请求分类数据的 api ==> 非必传
65
+ data?: { [key: string]: any }[]; // 分类数据,如果有分类数据,则不会执行 api 请求 ==> 非必传
66
+ title?: string; // treeFilter 标题 ==> 非必传
67
+ id?: string; // 选择的id ==> 非必传,默认为 “id”
68
+ label?: string; // 显示的label ==> 非必传,默认为 “label”
69
+ multiple?: boolean; // 是否为多选 ==> 非必传,默认为 false
70
+ defaultValue?: any; // 默认选中的值 ==> 非必传
71
+ }
72
+ const props = withDefaults(defineProps<TreeFilterProps>(), {
73
+ id: "id",
74
+ label: "label",
75
+ multiple: false,
76
+ });
77
+
78
+ const defaultProps = {
79
+ children: "children",
80
+ label: props.label,
81
+ };
82
+
83
+ const treeRef = ref<InstanceType<typeof ElTree>>();
84
+ const treeData = ref<{ [key: string]: any }[]>([]);
85
+ const treeAllData = ref<{ [key: string]: any }[]>([]);
86
+
87
+ const selected = ref();
88
+ const setSelected = () => {
89
+ if (props.multiple)
90
+ selected.value = Array.isArray(props.defaultValue)
91
+ ? props.defaultValue
92
+ : [props.defaultValue];
93
+ else
94
+ selected.value =
95
+ typeof props.defaultValue === "string" ? props.defaultValue : "";
96
+ };
97
+
98
+ onBeforeMount(async () => {
99
+ setSelected();
100
+ if (props.requestApi) {
101
+ const { data } = await props.requestApi!();
102
+ treeData.value = data;
103
+ treeAllData.value = [{ id: "", [props.label]: "全部" }, ...data];
104
+ }
105
+ });
106
+
107
+ // 使用 nextTick 防止打包后赋值不生效,开发环境是正常的
108
+ watch(
109
+ () => props.defaultValue,
110
+ () => nextTick(() => setSelected()),
111
+ { deep: true, immediate: true }
112
+ );
113
+
114
+ watch(
115
+ () => props.data,
116
+ () => {
117
+ if (props.data?.length) {
118
+ treeData.value = props.data;
119
+ treeAllData.value = [{ id: "", [props.label]: "全部" }, ...props.data];
120
+ }
121
+ },
122
+ { deep: true, immediate: true }
123
+ );
124
+
125
+ const filterText = ref("");
126
+ watch(filterText, (val) => {
127
+ treeRef.value!.filter(val);
128
+ });
129
+
130
+ // 过滤
131
+ const filterNode = (value: string, data: { [key: string]: any }, node: any) => {
132
+ if (!value) return true;
133
+ let parentNode = node.parent,
134
+ labels = [node.label],
135
+ level = 1;
136
+ while (level < node.level) {
137
+ labels = [...labels, parentNode.label];
138
+ parentNode = parentNode.parent;
139
+ level++;
140
+ }
141
+ return labels.some((label) => label.indexOf(value) !== -1);
142
+ };
143
+
144
+ // 切换树节点的展开或折叠状态
145
+ const toggleTreeNodes = (isExpand: boolean) => {
146
+ let nodes = treeRef.value?.store.nodesMap;
147
+ if (!nodes) return;
148
+ for (const node in nodes) {
149
+ if (nodes.hasOwnProperty(node)) {
150
+ nodes[node].expanded = isExpand;
151
+ }
152
+ }
153
+ };
154
+
155
+ // emit
156
+ const emit = defineEmits<{
157
+ change: [value: any];
158
+ }>();
159
+
160
+ // 单选
161
+ const handleNodeClick = (data: { [key: string]: any }) => {
162
+ if (props.multiple) return;
163
+ emit("change", data[props.id]);
164
+ };
165
+
166
+ // 多选
167
+ const handleCheckChange = () => {
168
+ emit("change", treeRef.value?.getCheckedKeys());
169
+ };
170
+
171
+ // 暴露给父组件使用
172
+ defineExpose({ treeData, treeAllData, treeRef });
173
+ </script>
174
+
175
+ <style scoped lang="scss">
176
+ @use "./index";
177
+ </style>
@@ -0,0 +1,21 @@
1
+ // // /* FileType */
2
+ // declare namespace File {
3
+ // type ImageMimeType =
4
+ // | 'image/apng'
5
+ // | 'image/bmp'
6
+ // | 'image/gif'
7
+ // | 'image/jpeg'
8
+ // | 'image/pjpeg'
9
+ // | 'image/png'
10
+ // | 'image/svg+xml'
11
+ // | 'image/tiff'
12
+ // | 'image/webp'
13
+ // | 'image/x-icon'
14
+
15
+ // type ExcelMimeType = 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
16
+
17
+ // type FileMimeType = 'image/jpeg' | 'image/pjpeg' | 'image/png' | 'image/webp' | 'image/x-icon' | 'application/pdf'
18
+
19
+ // type FilePostfixType = '.jpeg' | '.png' | '.jpg' | '.pdf'
20
+ // type ImagePostfixType = '.jpeg' | '.png' | '.jpg'
21
+ // }
@@ -0,0 +1,215 @@
1
+ // 公共样式
2
+ .no-upload {
3
+ :deep(.el-upload) {
4
+ display: none;
5
+ }
6
+ }
7
+ .is-error {
8
+ .upload {
9
+ :deep(.el-upload--picture-card),
10
+ :deep(.el-upload-dragger) {
11
+ border: 1px dashed var(--el-color-danger) !important;
12
+ &:hover {
13
+ border-color: var(--el-color-primary) !important;
14
+ }
15
+ }
16
+ }
17
+ }
18
+ :deep(.disabled) {
19
+ .el-upload--picture-card,
20
+ .el-upload-dragger {
21
+ cursor: not-allowed;
22
+ background: var(--el-disabled-bg-color) !important;
23
+ border: 1px dashed var(--el-border-color-darker);
24
+ &:hover {
25
+ border-color: var(--el-border-color-darker) !important;
26
+ }
27
+ }
28
+ }
29
+ :deep(.el-upload.el-upload--picture-card:not(.disabled)) {
30
+ background: #fff;
31
+ }
32
+
33
+ .el-upload__tip {
34
+ line-height: 15px;
35
+ text-align: left;
36
+ }
37
+ .upload-empty {
38
+ display: flex;
39
+ flex-direction: column;
40
+ align-items: center;
41
+ font-size: 12px;
42
+ line-height: 30px;
43
+ color: var(--el-color-info);
44
+ .el-icon {
45
+ font-size: 28px;
46
+ color: var(--el-text-color-secondary);
47
+ }
48
+ }
49
+ //文件上传
50
+ .file_upload_box {
51
+ .upload-btn {
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: flex-start;
55
+ .el-button {
56
+ margin-right: 10px;
57
+ }
58
+ }
59
+ }
60
+ //图片上传
61
+ .img_upload_box {
62
+ .no-border {
63
+ :deep(.el-upload--picture-card) {
64
+ border: none !important;
65
+ }
66
+ }
67
+ :deep(.upload) {
68
+ .el-upload-dragger {
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ width: 100%;
73
+ height: 100%;
74
+ padding: 0;
75
+ overflow: hidden;
76
+ border: 1px dashed var(--el-border-color-darker);
77
+ // border-radius: v-bind(borderRadius);
78
+ background-color: #fff !important;
79
+ &:hover {
80
+ border: 1px dashed var(--el-color-primary);
81
+ }
82
+ }
83
+ .el-upload-dragger.is-dragover {
84
+ background-color: var(--el-color-primary-light-9);
85
+ border: 2px dashed var(--el-color-primary) !important;
86
+ }
87
+ // .el-upload-list__item,
88
+ // .el-upload--picture-card {
89
+ // width: v-bind(width);
90
+ // height: v-bind(height);
91
+ // // background-color: transparent;
92
+ // border-radius: v-bind(borderRadius);
93
+ // }
94
+ .upload-image {
95
+ width: 100%;
96
+ height: 100%;
97
+ // object-fit: contain;
98
+ object-fit: cover;
99
+ }
100
+ .upload-handle {
101
+ position: absolute;
102
+ top: 0;
103
+ right: 0;
104
+ box-sizing: border-box;
105
+ display: flex;
106
+ align-items: center;
107
+ justify-content: center;
108
+ width: 100%;
109
+ height: 100%;
110
+ cursor: pointer;
111
+ background: rgb(0 0 0 / 60%);
112
+ opacity: 0;
113
+ transition: var(--el-transition-duration-fast);
114
+ .handle-icon {
115
+ display: flex;
116
+ flex-direction: column;
117
+ align-items: center;
118
+ justify-content: center;
119
+ padding: 0 6%;
120
+ color: aliceblue;
121
+ .el-icon {
122
+ margin-bottom: 15%;
123
+ font-size: 140%;
124
+ }
125
+ span {
126
+ font-size: 100%;
127
+ }
128
+ }
129
+ }
130
+ .el-upload-list__item {
131
+ &:hover {
132
+ .upload-handle {
133
+ opacity: 1;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ .el-upload__tip {
139
+ line-height: 15px;
140
+ text-align: left;
141
+ }
142
+ }
143
+
144
+ // 文件列表显示样式
145
+ .el-upload-list__item {
146
+ width: 100%;
147
+ border-radius: 4px;
148
+ box-sizing: border-box;
149
+ color: var(--el-text-color-regular);
150
+ font-size: 14px;
151
+ margin-bottom: 5px;
152
+ position: relative;
153
+ transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
154
+
155
+ &:hover {
156
+ background-color: var(--el-fill-color-light);
157
+ .result .delete {
158
+ display: block !important;
159
+ }
160
+ .result .success {
161
+ display: none !important;
162
+ }
163
+ }
164
+ .result {
165
+ padding: 0 10px;
166
+ .success {
167
+ display: inline-block !important;
168
+ }
169
+ .delete {
170
+ display: none !important;
171
+ }
172
+ }
173
+
174
+ .el-upload-list__item-name {
175
+ color: var(--el-text-color-regular);
176
+ display: inline-flex;
177
+ font-size: var(--el-font-size-base);
178
+ padding: 0 4px;
179
+ text-align: center;
180
+ transition: color var(--el-transition-duration);
181
+ overflow: hidden;
182
+ &:hover {
183
+ color: var(--el-color-primary);
184
+ cursor: pointer;
185
+ }
186
+ }
187
+ .fileName {
188
+ flex: 1;
189
+ }
190
+ }
191
+
192
+ .jzt-upload-loading {
193
+ position: absolute;
194
+ top: 0;
195
+ right: 0;
196
+ display: flex;
197
+ align-items: center;
198
+ justify-content: center;
199
+ width: 100%;
200
+ height: 100%;
201
+ background: rgb(0 0 0 / 50%);
202
+ .loading-icon {
203
+ font-size: 24px;
204
+ color: #fff;
205
+ animation: rotate 1.5s linear infinite;
206
+ }
207
+ }
208
+ @keyframes rotate {
209
+ from {
210
+ transform: rotate(0deg);
211
+ }
212
+ to {
213
+ transform: rotate(360deg);
214
+ }
215
+ }