@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,24 @@
1
+ <template>
2
+ <div class="flx-right-center item export">
3
+ <el-button @click="exportHandler">导出</el-button>
4
+ <!-- <el-icon :size="18" color="#409EFF"><Upload /></el-icon>
5
+ <el-button type="primary" link>导出</el-button> -->
6
+ </div>
7
+ </template>
8
+
9
+ <script setup lang="ts" name="JztPageCard_Export">
10
+ /**
11
+ * @component 导出组件
12
+ */
13
+ const emit = defineEmits(['export'])
14
+
15
+ const exportHandler = () => {
16
+ emit('export')
17
+ }
18
+ </script>
19
+ <style lang="scss" scoped>
20
+ .export {
21
+ cursor: pointer;
22
+ margin: 0 4px 0 10px;
23
+ }
24
+ </style>
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <div class="flx-left-center tabs" v-if="isShow && list.length && list.length > 0">
3
+ <div
4
+ v-for="(item, idx) in list"
5
+ class="tabs-box"
6
+ :key="`tabs-${idx}`"
7
+ :class="item[fieldNames.value] == activeValue ? 'is-active' : ''"
8
+ @click="handleTabClick(item)"
9
+ @keydown.enter="handleTabClick(item)"
10
+ >
11
+ <div class="label">{{ item[fieldNames.label] }}</div>
12
+ </div>
13
+ <!-- <el-radio-group v-model="activeValue">
14
+ <el-radio-button
15
+ v-for="(item, idx) in list"
16
+ :key="'radio' + idx"
17
+ :label="item[fieldNames.label]"
18
+ :value="item[fieldNames.value]"
19
+ />
20
+ </el-radio-group> -->
21
+ </div>
22
+ </template>
23
+
24
+ <script setup lang="ts" name="JztPageCard_Tabs">
25
+ /**
26
+ * @component tab切换组件
27
+ */
28
+ import { computed } from 'vue'
29
+ interface ProTableProps {
30
+ isShow?: boolean
31
+ list?: any[]
32
+ names?: {
33
+ label: string // label字段名称
34
+ value: string // value字段名称
35
+ }
36
+ activeValue?: string | number // 选中项
37
+ }
38
+ const props = withDefaults(defineProps<ProTableProps>(), {
39
+ isShow: false,
40
+ list: () => [],
41
+ activeValue: ''
42
+ })
43
+ const emits = defineEmits(['update:activeValue', 'tabClick'])
44
+ const activeValue = computed({
45
+ get() {
46
+ return props.activeValue
47
+ },
48
+ set(val) {
49
+ emits('update:activeValue', val)
50
+ }
51
+ })
52
+ const fieldNames = computed(() => {
53
+ return {
54
+ label: props.names?.label ?? 'label',
55
+ value: props.names?.value ?? 'value'
56
+ }
57
+ })
58
+ // 切换tab
59
+ const handleTabClick = tab => {
60
+ activeValue.value = tab[fieldNames.value.value]
61
+ emits('tabClick', tab)
62
+ }
63
+ </script>
64
+ <style lang="scss" scoped>
65
+ .tabs {
66
+ height: 34px;
67
+ padding: 0 4px;
68
+ border-radius: 4px;
69
+ background: #fafafa;
70
+
71
+ :deep(.el-radio-button__inner) {
72
+ padding: 6px 8px;
73
+ }
74
+ &-box {
75
+ // height: 28px;
76
+ padding: 0 8px;
77
+ opacity: 1;
78
+ color: #00000066;
79
+ cursor: pointer;
80
+ .label {
81
+ line-height: 28px;
82
+ text-align: center;
83
+ font-size: 14px;
84
+ font-weight: 500;
85
+ }
86
+
87
+ &.is-active {
88
+ background: var(--el-color-primary);
89
+ color: #ffffff;
90
+ border-radius: 4px;
91
+ }
92
+ }
93
+ }
94
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div class="flx-left-center" v-if="isShow">
3
+ <el-tooltip class="box-item" effect="dark" :content="iconText" :disabled="iconText == ''" :raw-content="true">
4
+ <el-icon class="title-icon" :size="15" :color="iconColor"><Warning /></el-icon>
5
+ </el-tooltip>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup lang="ts" name="JztPageCard_Tooltip">
10
+ /**
11
+ * @component tip提示组件
12
+ */
13
+ interface ProTableProps {
14
+ isShow?: boolean
15
+ iconText?: string // tip文案
16
+ iconColor?: string //标题图标颜色
17
+ }
18
+ // 默认值
19
+ const props = withDefaults(defineProps<ProTableProps>(), {
20
+ isShow: false,
21
+ iconText: '更多详情',
22
+ iconColor: '#666666'
23
+ })
24
+ </script>
25
+ <style lang="scss" scoped>
26
+ .title-icon {
27
+ font-weight: bold;
28
+ margin-left: 5px;
29
+ margin-top: 2px;
30
+ }
31
+ </style>
@@ -0,0 +1,287 @@
1
+ <template>
2
+ <div
3
+ v-if="hasPerm"
4
+ v-loading="loading"
5
+ :class="[showHeader ? 'header_card' : 'content_card', 'card', cardClassName]"
6
+ :style="cardStyle"
7
+ >
8
+ <JztLabelTitle
9
+ :title="title"
10
+ v-if="showHeader"
11
+ :is-label="headerProps?.isLabel"
12
+ :fontSize="headerProps?.titleSize"
13
+ :className="'flx-between-center header_title'"
14
+ >
15
+ <template #icon>
16
+ <slot name="titleLeft"></slot>
17
+ <Tooltip
18
+ :isShow="showToolButton('show-icon')"
19
+ :icon-color="headerProps?.iconColor"
20
+ :icon-text="headerProps?.iconText"
21
+ />
22
+ </template>
23
+ <template #titleRight>
24
+ <div class="flx-right-center">
25
+ <slot name="titleRight-left"></slot>
26
+ <Details
27
+ v-show="showToolButton('show-details')"
28
+ :title="headerProps?.detailsText"
29
+ :is-radius="headerProps?.isRadius"
30
+ @goDetails="goDetails"
31
+ />
32
+ <DatePicker
33
+ :is-show="showToolButton('show-date-picker')"
34
+ :time-list="timeList"
35
+ :date-type="dateType"
36
+ :value-format="valueFormat"
37
+ v-model:time-info="timeData"
38
+ @changeTime="changeTime"
39
+ />
40
+ <Export v-if="showToolButton('show-export')" :timeData="timeData" @export="onExport" />
41
+ <Tabs
42
+ :is-show="showToolButton('show-tabs')"
43
+ v-model:active-value="activeValue"
44
+ :list="tabsList"
45
+ :names="tabNames"
46
+ @tabClick="tabClick"
47
+ />
48
+ <slot name="titleRight-right"></slot>
49
+ </div>
50
+ </template>
51
+ </JztLabelTitle>
52
+
53
+ <div
54
+ :class="[contentClassName, 'card_content', isCardContent ? 'spd-content-card' : 'content-card1']"
55
+ :style="contentStyle"
56
+ >
57
+ <slot></slot>
58
+ </div>
59
+ </div>
60
+ <div v-else class="error_card card" :style="cardStyle">
61
+ <JztErrorPage :code="403" />
62
+ </div>
63
+ </template>
64
+
65
+ <script setup lang="ts" name="JztPageCard">
66
+ // import { hasPermission } from '../hooks/useAuthButtons'
67
+ import { hasPermission } from '@jzt-spd/utils'
68
+ import JztLabelTitle from '../JztLabelTitle/index.vue'
69
+ import Details from './comm/details.vue'
70
+ import DatePicker from './comm/datePicker.vue'
71
+ import Export from './comm/export.vue'
72
+ import Tooltip from './comm/tooltip.vue'
73
+ import Tabs from './comm/tabs.vue'
74
+ import JztErrorPage from '../JztErrorPage/index.vue'
75
+ import { ref, CSSProperties, onBeforeMount, computed } from 'vue'
76
+ /**
77
+ *show-icon 显示标题图标
78
+ *show-tabs 显示tabs
79
+ *show-details 显示【更多详情】
80
+ *show-export 显示导出按钮
81
+ *show-date-picker 显示日期选择器
82
+ */
83
+ export type ToolTypeProps = 'show-tabs' | 'show-export' | 'show-icon' | 'show-details' | 'show-date-picker'
84
+
85
+ interface ProTableProps {
86
+ title?: string //卡片标题
87
+ loading?: boolean // 是否加载
88
+ // iconColor?: string //标题图标颜色
89
+ // iconText?: string //标题图标内容
90
+ showHeader?: boolean // 是否显示表头
91
+ cardStyle?: CSSProperties // 卡片整体样式
92
+ cardClassName?: string // 卡片样式类名
93
+ contentClassName?: string // 卡片内容样式类名
94
+ contentStyle?: CSSProperties // 卡片内容样式
95
+ // detailsText?: string // 详情文字
96
+ // showDatePicker?: boolean // 是否显示时间选择器
97
+ timeList?: string | string[] // 时间选择器初始时间
98
+ dateType?: 'year' | 'monthRange' // 时间选择器类型
99
+ tabsList?: any[] // tabs 数据
100
+ tabNames?: {
101
+ label: string // label字段名称
102
+ value: string // value字段名称
103
+ }
104
+ tabActiveValue?: string | number // tabs 默认选中项
105
+ toolButton?: ToolTypeProps[] | boolean // 工具按钮
106
+ requestApi?: any // 接口请求函数(用于判断权限,无权限不请求数据)
107
+ hasPerm?: string //权限字符串 为空则无需判断权限
108
+ valueFormat?: string //时间需要返回的格式
109
+ isCardContent?: boolean
110
+ headerProps?: {
111
+ iconText?: string //标题图标内容
112
+ iconColor?: '#666666' //标题图标颜色
113
+ detailsText?: string // 详情文字
114
+ isRadius?: boolean // 是否圆角类型
115
+ isLabel?: boolean // JztLabelTitle 是否需要label
116
+ titleSize?: string // 详情文字大小
117
+ // value: string // value字段名称
118
+ }
119
+ }
120
+ const props = withDefaults(defineProps<ProTableProps>(), {
121
+ title: '',
122
+ // iconText: '',
123
+ // detailsText: '查看更多',
124
+ timeList: '',
125
+ showHeader: true,
126
+ className: '',
127
+ // iconColor: '#666666',
128
+ cardStyle: () => ({}),
129
+ contentStyle: () => ({}),
130
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
131
+ loading: false,
132
+ isCardContent: true,
133
+ tabNames: () => ({
134
+ label: 'label', // label字段名称
135
+ value: 'value' // value字段名称
136
+ })
137
+ })
138
+ const headerProps = computed(() => {
139
+ return {
140
+ iconText: props.headerProps?.iconText || '',
141
+ iconColor: props.headerProps?.iconColor || '#666666',
142
+ detailsText: props.headerProps?.detailsText || '查看更多',
143
+ isRadius: props.headerProps?.isRadius ?? true,
144
+ isLabel: props.headerProps?.isLabel ?? true,
145
+ titleSize: props.headerProps?.titleSize ?? '16px'
146
+ }
147
+ })
148
+ const emit = defineEmits(['changeTime', 'export', 'goDetails', 'tabClick', 'update:tabActiveValue'])
149
+ // 最终的时间数据
150
+ const timeData = ref(['', ''])
151
+ // tab 选中值
152
+ const activeValue = computed({
153
+ get() {
154
+ return props.tabActiveValue
155
+ },
156
+ set(val) {
157
+ emit('update:tabActiveValue', val)
158
+ }
159
+ })
160
+
161
+ // 控制 ToolButton 显示
162
+ const showToolButton = (key: ToolTypeProps) => {
163
+ return Array.isArray(props.toolButton) ? props.toolButton.includes(key) : props.toolButton
164
+ }
165
+ // 更多详情
166
+ const goDetails = () => {
167
+ emit('goDetails')
168
+ }
169
+ // 导出
170
+ const onExport = () => {
171
+ emit('export')
172
+ }
173
+ // 时间选择变动
174
+ const changeTime = timeInfo => {
175
+ emit('changeTime', timeInfo)
176
+ }
177
+ // tabs切换
178
+ const tabClick = val => {
179
+ emit('tabClick', val, activeValue.value)
180
+ }
181
+ //。当前模块是否有权限访问
182
+ const hasPerm = ref(false)
183
+
184
+ // 获取当前模块数据根据权限控制
185
+ const getChatDataByAuth = () => {
186
+ if (hasPerm.value) {
187
+ props.requestApi && props.requestApi()
188
+ } else {
189
+ console.log('暂无访问权限----->')
190
+ }
191
+ }
192
+ // 获取当前模块的模块权限
193
+ const getPagePermission = () => {
194
+ if (props.hasPerm) {
195
+ hasPerm.value = hasPermission(props.hasPerm)
196
+ } else {
197
+ hasPerm.value = true
198
+ }
199
+ // console.log('访问权限:', hasPerm.value)
200
+ }
201
+ onBeforeMount(() => {
202
+ getPagePermission()
203
+ function fun() {
204
+ var count = 1
205
+ function fun2() {
206
+ //条件1:函数嵌套
207
+ //形成条件2:内部函数引用外部函数
208
+ // console.log(77777, count)
209
+ }
210
+ }
211
+ fun()
212
+ })
213
+
214
+ defineExpose({
215
+ getChatDataByAuth
216
+ })
217
+ </script>
218
+ <style lang="scss" scoped>
219
+ .header_title {
220
+ height: 45px;
221
+ // ::deep(.group-header) {
222
+ padding-bottom: 0px;
223
+ // }
224
+ }
225
+ .header_card {
226
+ background-color: #f3f7fa;
227
+ overflow: hidden;
228
+
229
+ & > .card_content {
230
+ margin: 12px;
231
+ height: 100%;
232
+ flex: 1;
233
+ height: calc(100% - 66px);
234
+ box-sizing: border-box;
235
+ border-radius: 6px;
236
+ }
237
+ :deep(.label-tittle) {
238
+ margin-bottom: 0;
239
+ width: auto;
240
+ .labelLine {
241
+ height: 24px;
242
+ border-radius: 0;
243
+ }
244
+ }
245
+ .header {
246
+ display: flex;
247
+ justify-content: space-between;
248
+ border-bottom: 1px solid #e4e7ed;
249
+ box-sizing: border-box;
250
+ padding: 0px 16px;
251
+ height: 50px;
252
+ line-height: 50px;
253
+ }
254
+ }
255
+ .content_card {
256
+ height: 100%;
257
+ & > .card_content {
258
+ // padding: 12px;
259
+ height: 100%;
260
+ box-sizing: border-box;
261
+ border-radius: 6px;
262
+ }
263
+ }
264
+ .error_card {
265
+ height: 100%;
266
+ background-color: #fff;
267
+ }
268
+ .card {
269
+ height: 100%;
270
+ overflow: hidden;
271
+ border-radius: 8px;
272
+ // margin-top: 8px;
273
+ border: 1px solid #fff;
274
+ // background-color: #fff;
275
+ // padding: 10px;
276
+ }
277
+
278
+ .spd-content-card {
279
+ box-sizing: border-box;
280
+ padding: 12px;
281
+ // overflow: hidden;
282
+ background-color: var(--el-bg-color) !important;
283
+ border-radius: 8px;
284
+ // box-shadow: 0 0 12px rgb(0 0 0 / 5%);
285
+ border: none;
286
+ }
287
+ </style>
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <!-- 分页组件 -->
3
+ <el-pagination
4
+ :background="true"
5
+ :current-page="pageQuery.pageIndex"
6
+ :page-size="pageQuery.pageSize"
7
+ :page-sizes="[10, 25, 50, 100]"
8
+ :total="pageQuery.total"
9
+ layout="total, prev, pager, next,sizes, jumper"
10
+ @size-change="handleSizeChange"
11
+ @current-change="handleCurrentChange"
12
+ ></el-pagination>
13
+ </template>
14
+
15
+ <script setup lang="ts" name="JztPagination">
16
+ import { computed } from 'vue'
17
+ import { PageableProps } from '../JztQueryTable/interface/index'
18
+ export interface ProTableProps {
19
+ pageable?: PageableProps // 分页数据
20
+ }
21
+ const props = withDefaults(defineProps<ProTableProps>(), {
22
+ pageable: () => {
23
+ return {
24
+ pageIndex: 1, // 当前页
25
+ pageSize: 10, // 每页显示条数
26
+ total: 0 // 总条数
27
+ }
28
+ }
29
+ })
30
+
31
+ const pageQuery = computed({
32
+ get() {
33
+ return props.pageable
34
+ },
35
+ set(val) {
36
+ emit('update:pageable', val)
37
+ }
38
+ })
39
+
40
+ const emit = defineEmits(['update:pageable', 'changePageable'])
41
+ /**
42
+ * @description 每页条数改变
43
+ * @param {Number} val 当前条数
44
+ * @return void
45
+ * */
46
+ const handleSizeChange = (val: number) => {
47
+ const pagination = {
48
+ pageIndex: 1,
49
+ pageSize: val,
50
+ total: props.pageable.total
51
+ }
52
+ emit('update:pageable', pagination)
53
+ emit('changePageable', pagination)
54
+ }
55
+
56
+ /**
57
+ * @description 当前页改变
58
+ * @param {Number} val 当前页
59
+ * @return void
60
+ * */
61
+ const handleCurrentChange = (val: number) => {
62
+ const pagination = {
63
+ pageIndex: val,
64
+ pageSize: props.pageable.pageSize,
65
+ total: props.pageable.total
66
+ }
67
+ emit('update:pageable', pagination)
68
+ emit('changePageable', pagination)
69
+ }
70
+ </script>