@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.
- package/package.json +68 -0
- package/src/JztBackTop/index.vue +255 -0
- package/src/JztButtonList/index.vue +88 -0
- package/src/JztChart/index.vue +95 -0
- package/src/JztCharts/index.vue +317 -0
- package/src/JztClassTabs/index.vue +156 -0
- package/src/JztDateSelect/dateSelect.vue +186 -0
- package/src/JztDateSelect/dateType.vue +54 -0
- package/src/JztDateSelect/index.ts +135 -0
- package/src/JztDateSelect/interface/index.ts +13 -0
- package/src/JztDialog/index.vue +249 -0
- package/src/JztEllipsisTooltip/index.vue +61 -0
- package/src/JztEmpty/index.vue +45 -0
- package/src/JztErrorPage/403.vue +30 -0
- package/src/JztErrorPage/404.vue +19 -0
- package/src/JztErrorPage/500.vue +18 -0
- package/src/JztErrorPage/assets/401.png +0 -0
- package/src/JztErrorPage/assets/403.png +0 -0
- package/src/JztErrorPage/assets/404.png +0 -0
- package/src/JztErrorPage/assets/500.png +0 -0
- package/src/JztErrorPage/index.scss +35 -0
- package/src/JztErrorPage/index.vue +35 -0
- package/src/JztFilePreview/components/pdfViewer.vue +221 -0
- package/src/JztFilePreview/hooks/useImageMethod.ts +256 -0
- package/src/JztFilePreview/index.scss +171 -0
- package/src/JztFilePreview/index.vue +68 -0
- package/src/JztFilePreview/interface/index.ts +18 -0
- package/src/JztFilePreview/previewFile.vue +371 -0
- package/src/JztFormGrid/README.md +520 -0
- package/src/JztFormGrid/components/formItem.vue +209 -0
- package/src/JztFormGrid/components/formItemValue.vue +384 -0
- package/src/JztFormGrid/components/showDetailForm.vue +172 -0
- package/src/JztFormGrid/index.scss +60 -0
- package/src/JztFormGrid/index.vue +513 -0
- package/src/JztFormGrid/interface/index.ts +106 -0
- package/src/JztGrid/components/GridItem.vue +68 -0
- package/src/JztGrid/index.vue +179 -0
- package/src/JztGrid/interface/index.ts +6 -0
- package/src/JztImportExcel/assets/delete.png +0 -0
- package/src/JztImportExcel/index.scss +46 -0
- package/src/JztImportExcel/index.vue +430 -0
- package/src/JztImportExcel/interface/index.ts +25 -0
- package/src/JztLabelTitle/index.vue +65 -0
- package/src/JztLeftRightMode/components/CollapseButton.vue +80 -0
- package/src/JztLeftRightMode/components/LeftCard.vue +203 -0
- package/src/JztLeftRightMode/components/LeftLayout.vue +173 -0
- package/src/JztLeftRightMode/components/RightHeader.vue +186 -0
- package/src/JztLeftRightMode/components/RightLayout.vue +235 -0
- package/src/JztLeftRightMode/components/RightTableHeader.vue +43 -0
- package/src/JztLeftRightMode/hooks/useCollapse.ts +17 -0
- package/src/JztLeftRightMode/hooks/useDefaultProps.ts +19 -0
- package/src/JztLeftRightMode/hooks/useLeftLayout.ts +201 -0
- package/src/JztLeftRightMode/hooks/useMode.ts +20 -0
- package/src/JztLeftRightMode/hooks/usePrevNext.ts +60 -0
- package/src/JztLeftRightMode/hooks/useRightLayout.ts +215 -0
- package/src/JztLeftRightMode/hooks/useSlots.ts +15 -0
- package/src/JztLeftRightMode/index.ts +3 -0
- package/src/JztLeftRightMode/index.vue +494 -0
- package/src/JztLeftRightMode/types/index.ts +457 -0
- package/src/JztLoading/fullScreen.ts +45 -0
- package/src/JztLoading/index.scss +67 -0
- package/src/JztLoading/index.vue +18 -0
- package/src/JztLogin/components/LoginFooter.vue +17 -0
- package/src/JztLogin/components/LoginForm.vue +99 -0
- package/src/JztLogin/hooks/useLogin.ts +186 -0
- package/src/JztLogin/index.scss +142 -0
- package/src/JztLogin/index.vue +31 -0
- package/src/JztLogin/interface/index.ts +47 -0
- package/src/JztNumericalRange/index.vue +81 -0
- package/src/JztPageCard/comm/datePicker.vue +151 -0
- package/src/JztPageCard/comm/details.vue +60 -0
- package/src/JztPageCard/comm/export.vue +24 -0
- package/src/JztPageCard/comm/tabs.vue +94 -0
- package/src/JztPageCard/comm/tooltip.vue +31 -0
- package/src/JztPageCard/index.vue +287 -0
- package/src/JztPagination/index.vue +70 -0
- package/src/JztProductInfo/components/imagePreview.vue +275 -0
- package/src/JztProductInfo/components/qxUnique.vue +101 -0
- package/src/JztProductInfo/components/records.vue +265 -0
- package/src/JztProductInfo/hooks/useParams.ts +143 -0
- package/src/JztProductInfo/hooks/useQxUnique.tsx +466 -0
- package/src/JztProductInfo/images/defaultProduct.png +0 -0
- package/src/JztProductInfo/index.ts +116 -0
- package/src/JztProductInfo/index.vue +108 -0
- package/src/JztProductInfo/interface/index.ts +15 -0
- package/src/JztQueryDetailTable/index.scss +100 -0
- package/src/JztQueryDetailTable/index.vue +400 -0
- package/src/JztQueryDetailTable/interface/index.ts +10 -0
- package/src/JztQueryTable/QueryTable /345/212/237/350/203/275.md" +1580 -0
- package/src/JztQueryTable/README.md +567 -0
- package/src/JztQueryTable/components/ColSetting.vue +67 -0
- package/src/JztQueryTable/components/ColumnsSetting.vue +404 -0
- package/src/JztQueryTable/components/ColumnsSetting1.vue +220 -0
- package/src/JztQueryTable/components/DeployToAccountLevelSetting.vue +351 -0
- package/src/JztQueryTable/components/Pagination.vue +54 -0
- package/src/JztQueryTable/components/TableColumn.vue +109 -0
- package/src/JztQueryTable/const.ts +1 -0
- package/src/JztQueryTable/hooks/useQueryTable.ts +194 -0
- package/src/JztQueryTable/hooks/useSelection.ts +47 -0
- package/src/JztQueryTable/hooks/useTableSetting.ts +197 -0
- package/src/JztQueryTable/hooks/useTemplate.ts +127 -0
- package/src/JztQueryTable/index.scss +91 -0
- package/src/JztQueryTable/index.vue +1445 -0
- package/src/JztQueryTable/interface/index.ts +185 -0
- package/src/JztRegionSelect/index.vue +134 -0
- package/src/JztSearchForm/components/SearchFormItem.vue +473 -0
- package/src/JztSearchForm/index.vue +530 -0
- package/src/JztSearchForm/interface/index.ts +100 -0
- package/src/JztSelectFilter/index.scss +63 -0
- package/src/JztSelectFilter/index.vue +110 -0
- package/src/JztSelectTable/index.vue +257 -0
- package/src/JztTable/index.scss +72 -0
- package/src/JztTable/index.vue +353 -0
- package/src/JztTable/interface/index.ts +1 -0
- package/src/JztTime/comm/agencySelect.vue +112 -0
- package/src/JztTime/comm/collapseRow.vue +132 -0
- package/src/JztTime/comm/dateSelect.vue +292 -0
- package/src/JztTime/comm/deptSelect.vue +193 -0
- package/src/JztTime/comm/typeSelect.vue +97 -0
- package/src/JztTime/index.ts +216 -0
- package/src/JztTime/index.vue +303 -0
- package/src/JztTime/interface/index.ts +23 -0
- package/src/JztTreeFilter/index.scss +44 -0
- package/src/JztTreeFilter/index.vue +177 -0
- package/src/JztUploadFile/interface/index.ts +21 -0
- package/src/JztUploadFile/multiple.scss +215 -0
- package/src/JztUploadFile/multiple.vue +318 -0
- package/src/JztUploadFile/single.scss +226 -0
- package/src/JztUploadFile/single.vue +274 -0
- package/src/JztUploadImg/Img.vue +294 -0
- package/src/JztUploadImg/Imgs.vue +411 -0
- package/src/JztUploadImg/index.scss +138 -0
- package/src/JztUploadImg/interface/index.ts +22 -0
- package/src/SelectIcon/index.scss +39 -0
- package/src/SelectIcon/index.vue +106 -0
- package/src/SvgIcon/index.vue +22 -0
- package/src/hooks/useAuthButtons.ts +58 -0
- package/src/hooks/useFormByUserType.ts +90 -0
- package/src/hooks/useTableEvents.ts +30 -0
- package/src/hooks/useUploadFileHook.ts +262 -0
- package/src/index.ts +91 -0
- package/src/typings/global.d.ts +101 -0
- package/src/utils/index.ts +107 -0
- package/src/utils/tree.ts +57 -0
- package/tsconfig.json +45 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import dayjs from 'dayjs'
|
|
2
|
+
import { DateType, DateTypeProps, IDateOptions } from './interface/index'
|
|
3
|
+
|
|
4
|
+
export const dateOptions: IDateOptions<DateTypeProps>[] = [
|
|
5
|
+
{
|
|
6
|
+
name: '年',
|
|
7
|
+
value: 'year',
|
|
8
|
+
type: 'year'
|
|
9
|
+
// disableInfo: {
|
|
10
|
+
// unit: 'month'
|
|
11
|
+
// maxValue: 4 * 12 //(5年) 需要-1
|
|
12
|
+
// }
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: '季度',
|
|
16
|
+
value: 'quarter',
|
|
17
|
+
type: 'year'
|
|
18
|
+
// disableInfo: {
|
|
19
|
+
// unit: 'month'
|
|
20
|
+
// maxValue: 1 * 12 // (2年) 需要-1
|
|
21
|
+
// }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: '半年',
|
|
25
|
+
value: 'halfYear',
|
|
26
|
+
type: 'year'
|
|
27
|
+
// disableInfo: {
|
|
28
|
+
// unit: 'month'
|
|
29
|
+
// maxValue: 1 * 12 // (2年) 需要-1
|
|
30
|
+
// }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: '月',
|
|
34
|
+
value: 'month',
|
|
35
|
+
type: 'month'
|
|
36
|
+
// disableInfo: {
|
|
37
|
+
// unit: 'month'
|
|
38
|
+
// maxValue: 12
|
|
39
|
+
// }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: '日',
|
|
43
|
+
value: 'custom',
|
|
44
|
+
type: 'daterange',
|
|
45
|
+
disableInfo: {
|
|
46
|
+
unit: 'month',
|
|
47
|
+
maxValue: 24
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
export function getChangeDateType(type: DateType) {
|
|
53
|
+
let dateRange: string | Array<string> = ''
|
|
54
|
+
switch (type) {
|
|
55
|
+
case 'month':
|
|
56
|
+
dateRange = dayjs().format('YYYY-MM')
|
|
57
|
+
break
|
|
58
|
+
case 'year':
|
|
59
|
+
dateRange = dayjs().format('YYYY')
|
|
60
|
+
break
|
|
61
|
+
case 'halfYear':
|
|
62
|
+
dateRange = dayjs().format('YYYY')
|
|
63
|
+
break
|
|
64
|
+
case 'custom':
|
|
65
|
+
const start = dayjs().startOf('day').format('YYYY-MM-DD')
|
|
66
|
+
const end = dayjs().endOf('day').format('YYYY-MM-DD')
|
|
67
|
+
dateRange = [start, end]
|
|
68
|
+
break
|
|
69
|
+
case 'quarter':
|
|
70
|
+
dateRange = dayjs().format('YYYY')
|
|
71
|
+
break
|
|
72
|
+
default:
|
|
73
|
+
break
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return dateRange
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 季度级别
|
|
80
|
+
export const allQuarters = [
|
|
81
|
+
{ label: '第一季度', value: 1 },
|
|
82
|
+
{ label: '第二季度', value: 2 },
|
|
83
|
+
{ label: '第三季度', value: 3 },
|
|
84
|
+
{ label: '第四季度', value: 4 }
|
|
85
|
+
]
|
|
86
|
+
// 半年度级别
|
|
87
|
+
export const allHalfYear = [
|
|
88
|
+
{ label: '上半年', value: 1 },
|
|
89
|
+
{ label: '下半年', value: 2 }
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
export const getDataRangeByType = params => {
|
|
93
|
+
const { timeMode, typeNum, value } = params
|
|
94
|
+
let startTime = ''
|
|
95
|
+
let endTime = ''
|
|
96
|
+
let timeValue
|
|
97
|
+
|
|
98
|
+
if (timeMode == 'month') {
|
|
99
|
+
startTime = dayjs(value).startOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
100
|
+
endTime = dayjs(value).endOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
101
|
+
timeValue = dayjs(value).format('YYYY-MM')
|
|
102
|
+
// console.log('获取的开始时间是:', startTime, endTime)
|
|
103
|
+
} else if (timeMode == 'year') {
|
|
104
|
+
// 返回选择年的第一天和最后一天
|
|
105
|
+
startTime = dayjs(value).startOf('year').format('YYYY-MM-DD HH:mm:ss')
|
|
106
|
+
endTime = dayjs(value).endOf('year').format('YYYY-MM-DD HH:mm:ss')
|
|
107
|
+
timeValue = dayjs(value).format('YYYY')
|
|
108
|
+
// console.log(startTime, endTime)
|
|
109
|
+
} else if (timeMode == 'halfYear') {
|
|
110
|
+
// typeNum: 1 上半年, 2 下半年
|
|
111
|
+
if (typeNum === 1) {
|
|
112
|
+
startTime = dayjs(value).month(0).startOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
113
|
+
endTime = dayjs(value).month(5).endOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
114
|
+
} else {
|
|
115
|
+
startTime = dayjs(value).month(6).startOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
116
|
+
endTime = dayjs(value).month(11).endOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
117
|
+
}
|
|
118
|
+
timeValue = dayjs(value).format('YYYY')
|
|
119
|
+
} else if (timeMode == 'quarter') {
|
|
120
|
+
// typeNum: 1-4 对应第一到第四季度
|
|
121
|
+
startTime = dayjs(value).quarter(typeNum).startOf('quarter').format('YYYY-MM-DD HH:mm:ss')
|
|
122
|
+
endTime = dayjs(value).quarter(typeNum).endOf('quarter').format('YYYY-MM-DD HH:mm:ss')
|
|
123
|
+
timeValue = dayjs(value).format('YYYY')
|
|
124
|
+
} else {
|
|
125
|
+
// 返回指定数组的开始时间和结束时间
|
|
126
|
+
const start = value[0] || ''
|
|
127
|
+
const end = value[1] || ''
|
|
128
|
+
console.log(start, end);
|
|
129
|
+
|
|
130
|
+
startTime = dayjs(start).startOf('day').format('YYYY-MM-DD HH:mm:ss')
|
|
131
|
+
endTime = dayjs(end).endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
|
132
|
+
timeValue = [dayjs(start).format('YYYY-MM-DD'), dayjs(end).format('YYYY-MM-DD')]
|
|
133
|
+
}
|
|
134
|
+
return { startTime, endTime,timeValue }
|
|
135
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type DateType = 'year' | 'month' | 'quarter' | 'custom' | 'halfYear'
|
|
2
|
+
export type DateTypeProps = 'year' | 'month' | 'date' | 'daterange'
|
|
3
|
+
import { UnitType } from '@jzt-spd/utils'
|
|
4
|
+
export interface IDateOptions<T = any> {
|
|
5
|
+
name: string
|
|
6
|
+
value: string
|
|
7
|
+
type: T
|
|
8
|
+
disableInfo?: {
|
|
9
|
+
// 禁用信息
|
|
10
|
+
unit?: UnitType // 时间单位
|
|
11
|
+
maxValue?: number // 最大值
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<script lang="ts" setup name="Dialog">
|
|
2
|
+
import { Close } from '@element-plus/icons-vue'
|
|
3
|
+
import { debounce } from 'lodash-es'
|
|
4
|
+
import { computed, ref, unref, useAttrs, useSlots, nextTick } from 'vue'
|
|
5
|
+
const slots = useSlots()
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: true
|
|
10
|
+
},
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '标题'
|
|
14
|
+
},
|
|
15
|
+
appendToBody: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true
|
|
18
|
+
},
|
|
19
|
+
// 宽度
|
|
20
|
+
width: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: '50%'
|
|
23
|
+
},
|
|
24
|
+
// 全屏
|
|
25
|
+
fullscreen: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
// 拖拽功能
|
|
30
|
+
draggable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
// 是否显示全屏功能
|
|
35
|
+
isShowFullscreen: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
// 确定按钮
|
|
40
|
+
confirmText: {
|
|
41
|
+
type: [String, Boolean],
|
|
42
|
+
default: '确定'
|
|
43
|
+
},
|
|
44
|
+
// 确定按钮 是否禁用
|
|
45
|
+
disabled: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
// 取消按钮
|
|
50
|
+
cancelText: {
|
|
51
|
+
type: [String, Boolean],
|
|
52
|
+
default: '取消'
|
|
53
|
+
},
|
|
54
|
+
// 是否显示footer
|
|
55
|
+
showFooter: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
dialogClass: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
// 是否弹框全屏高度自适应
|
|
64
|
+
fullContent: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
// 按钮是否在中间
|
|
69
|
+
footerCenter: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
height: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '75vh'
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const emit = defineEmits(['close', 'confirm', 'changeFullscreen'])
|
|
80
|
+
// const slot = defineSlots()
|
|
81
|
+
const getBindValue = computed(() => {
|
|
82
|
+
const delArr: string[] = ['fullscreen', 'title', 'appendToBody']
|
|
83
|
+
const attrs = useAttrs()
|
|
84
|
+
const obj: { [key: string]: any } = { ...attrs, ...props }
|
|
85
|
+
for (const key in obj) {
|
|
86
|
+
if (delArr.indexOf(key) !== -1) {
|
|
87
|
+
delete obj[key]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return obj
|
|
91
|
+
})
|
|
92
|
+
const isFullscreen = ref(props.fullscreen)
|
|
93
|
+
const toggleFull = () => {
|
|
94
|
+
isFullscreen.value = !unref(isFullscreen)
|
|
95
|
+
emit('changeFullscreen', isFullscreen.value)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 取消
|
|
99
|
+
const onClose = async () => {
|
|
100
|
+
emit('close')
|
|
101
|
+
}
|
|
102
|
+
// 确定
|
|
103
|
+
const onConfirm = debounce(
|
|
104
|
+
async () => {
|
|
105
|
+
emit('confirm')
|
|
106
|
+
},
|
|
107
|
+
1000,
|
|
108
|
+
{
|
|
109
|
+
leading: true
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
const getClassName = computed(() => {
|
|
113
|
+
return 't-dialog' + ' ' + props.dialogClass
|
|
114
|
+
})
|
|
115
|
+
const handleClick = event => {
|
|
116
|
+
event.stopPropagation()
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// 获取头部高度的方法
|
|
120
|
+
const getHeaderHeight = () => {
|
|
121
|
+
const headerElement: any = document.querySelector('.getHeaderHeight')
|
|
122
|
+
const contentPadding: any = document.querySelector('.el-dialog__body')
|
|
123
|
+
if (contentPadding && headerElement) {
|
|
124
|
+
const computedStyle = window.getComputedStyle(contentPadding)
|
|
125
|
+
// console.log(parseInt(headerElement.offsetHeight), parseInt(computedStyle.paddingTop), parseInt(computedStyle.paddingBottom))
|
|
126
|
+
return (
|
|
127
|
+
parseInt(headerElement.offsetHeight) + parseInt(computedStyle.paddingTop) + parseInt(computedStyle.paddingBottom)
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
return 0
|
|
131
|
+
}
|
|
132
|
+
const headerHeight = ref<any>()
|
|
133
|
+
// 在组件挂载后获取头部高度
|
|
134
|
+
const opened = () => {
|
|
135
|
+
headerHeight.value = getHeaderHeight() + 'px'
|
|
136
|
+
}
|
|
137
|
+
// footer高度
|
|
138
|
+
const footerHeight = computed(() => {
|
|
139
|
+
return props.showFooter || slots.footer ? '58px' : '0px'
|
|
140
|
+
})
|
|
141
|
+
defineExpose({
|
|
142
|
+
isFullscreen
|
|
143
|
+
})
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<template>
|
|
147
|
+
<el-dialog
|
|
148
|
+
v-bind="getBindValue"
|
|
149
|
+
:fullscreen="isFullscreen"
|
|
150
|
+
:width="width"
|
|
151
|
+
destroy-on-close
|
|
152
|
+
:append-to-body="appendToBody"
|
|
153
|
+
:show-close="false"
|
|
154
|
+
:draggable="draggable"
|
|
155
|
+
:close-on-click-modal="false"
|
|
156
|
+
class="t-dialog"
|
|
157
|
+
:before-close="onClose"
|
|
158
|
+
header-class="getHeaderHeight"
|
|
159
|
+
:class="getClassName"
|
|
160
|
+
@close="onClose"
|
|
161
|
+
@opened="opened"
|
|
162
|
+
@click.native.stop="handleClick"
|
|
163
|
+
>
|
|
164
|
+
<template #header>
|
|
165
|
+
<div class="header flx-between-center">
|
|
166
|
+
<slot name="title">
|
|
167
|
+
<span class="title">{{ title }}</span>
|
|
168
|
+
</slot>
|
|
169
|
+
<div class="cursor-pointer flx-between-center pl15">
|
|
170
|
+
<div v-if="isShowFullscreen" class="is-hover mr15 cursor-pointer screen flx-center" @click="toggleFull">
|
|
171
|
+
<i :class="['iconfont', isFullscreen ? 'icon-shiyingchuangkou fontS-22' : 'icon-manping fontS-20']"></i>
|
|
172
|
+
</div>
|
|
173
|
+
<el-icon class="is-hover cursor-pointer" hover-color="#377dff" style="font-size: 24px" @click="onClose">
|
|
174
|
+
<Close />
|
|
175
|
+
</el-icon>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</template>
|
|
179
|
+
<div
|
|
180
|
+
class="jzt-dialog-body"
|
|
181
|
+
:style="{
|
|
182
|
+
height: fullContent
|
|
183
|
+
? isFullscreen
|
|
184
|
+
? `calc(100vh - ${headerHeight} - ${footerHeight})`
|
|
185
|
+
: `calc(${height} - ${headerHeight} - ${footerHeight})`
|
|
186
|
+
: undefined
|
|
187
|
+
}"
|
|
188
|
+
>
|
|
189
|
+
<slot></slot>
|
|
190
|
+
</div>
|
|
191
|
+
<template v-if="showFooter || slots.footer" #footer>
|
|
192
|
+
<div v-if="showFooter" :class="[footerCenter ? 'flx-center' : 'flx-between-center']">
|
|
193
|
+
<div>
|
|
194
|
+
<slot name="footer_left"></slot>
|
|
195
|
+
</div>
|
|
196
|
+
<div class="dialog-footer">
|
|
197
|
+
<slot name="button_left"></slot>
|
|
198
|
+
<el-button v-if="cancelText" plain @click="onClose">
|
|
199
|
+
{{ cancelText }}
|
|
200
|
+
</el-button>
|
|
201
|
+
<el-button v-if="confirmText" :disabled="disabled" type="primary" @click="onConfirm">
|
|
202
|
+
{{ confirmText }}
|
|
203
|
+
</el-button>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
<slot v-else-if="slots.footer" name="footer"></slot>
|
|
207
|
+
</template>
|
|
208
|
+
</el-dialog>
|
|
209
|
+
</template>
|
|
210
|
+
|
|
211
|
+
<style lang="scss" scoped>
|
|
212
|
+
.title {
|
|
213
|
+
cursor: default;
|
|
214
|
+
user-select: text;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.jzt-dialog-body {
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-direction: column;
|
|
220
|
+
justify-content: flex-start;
|
|
221
|
+
height: 100%;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:deep(.el-dialog__footer) {
|
|
225
|
+
display: flex !important;
|
|
226
|
+
flex-direction: row !important;
|
|
227
|
+
justify-content: center !important;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.dialog-footer {
|
|
231
|
+
.el-button {
|
|
232
|
+
margin-left: 10px;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
</style>
|
|
236
|
+
<style lang="scss">
|
|
237
|
+
.t-dialog.is-fullscreen {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
.el-dialog__body {
|
|
241
|
+
flex: 1;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
.t-dialog {
|
|
245
|
+
.el-dialog__body {
|
|
246
|
+
padding: 8px 12px 12px !important;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-tooltip :disabled="!isEllipsis" :content="content" :placement="placement" :popper-style="{ maxWidth: '60vw'}">
|
|
3
|
+
<span ref="textRef" class="ellipsis-text" :style="{ maxWidth: maxWidth, ...style }" @mouseenter="checkEllipsis">
|
|
4
|
+
<slot>{{ content }}</slot>
|
|
5
|
+
</span>
|
|
6
|
+
</el-tooltip>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { ref, onMounted, nextTick } from 'vue'
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
content?: string
|
|
14
|
+
placement?:
|
|
15
|
+
| 'top'
|
|
16
|
+
| 'top-start'
|
|
17
|
+
| 'top-end'
|
|
18
|
+
| 'bottom'
|
|
19
|
+
| 'bottom-start'
|
|
20
|
+
| 'bottom-end'
|
|
21
|
+
| 'left'
|
|
22
|
+
| 'left-start'
|
|
23
|
+
| 'left-end'
|
|
24
|
+
| 'right'
|
|
25
|
+
| 'right-start'
|
|
26
|
+
| 'right-end'
|
|
27
|
+
maxWidth?: number | string
|
|
28
|
+
style?: any,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
+
placement: 'top-start',
|
|
33
|
+
maxWidth: '100%'
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const textRef = ref<HTMLElement>()
|
|
37
|
+
const isEllipsis = ref(false)
|
|
38
|
+
|
|
39
|
+
const checkEllipsis = () => {
|
|
40
|
+
nextTick(() => {
|
|
41
|
+
if (textRef.value) {
|
|
42
|
+
isEllipsis.value = textRef.value.scrollWidth > textRef.value.clientWidth
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onMounted(() => {
|
|
48
|
+
checkEllipsis()
|
|
49
|
+
})
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style scoped>
|
|
53
|
+
.ellipsis-text {
|
|
54
|
+
display: inline-block;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
cursor: default;
|
|
59
|
+
vertical-align: bottom;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="empty">
|
|
3
|
+
<slot name="empty">
|
|
4
|
+
<img :src="notData" class="notData" alt="notData" />
|
|
5
|
+
<div class="empty-text">{{ emptyText }}</div>
|
|
6
|
+
<slot name="empty-button"></slot>
|
|
7
|
+
</slot>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts" name="ProTable">
|
|
12
|
+
import { notData } from '@jzt-spd/styles/assets'
|
|
13
|
+
interface ProTableProps {
|
|
14
|
+
emptyText?: string
|
|
15
|
+
fontSize?: string
|
|
16
|
+
subTitle?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 默认值
|
|
20
|
+
const props = withDefaults(defineProps<ProTableProps>(), {
|
|
21
|
+
emptyText: '暂无内容',
|
|
22
|
+
fontSize: '14px',
|
|
23
|
+
isLabel: true,
|
|
24
|
+
subTitle: ''
|
|
25
|
+
})
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style lang="scss" scoped>
|
|
29
|
+
.empty {
|
|
30
|
+
width: 100%;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
img {
|
|
36
|
+
width: 100px;
|
|
37
|
+
object-fit: contain;
|
|
38
|
+
}
|
|
39
|
+
.empty-text {
|
|
40
|
+
color: #333333;
|
|
41
|
+
line-height: 30px;
|
|
42
|
+
margin-top: 16px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="errorPage">
|
|
3
|
+
<img src="./assets/403.png" class="not-img" alt="403" />
|
|
4
|
+
<div class="not-detail">
|
|
5
|
+
<div class="typeText">暂无{{ text }}权限</div>
|
|
6
|
+
<div class="descText">请联系相关运营人员</div>
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts" name="403">
|
|
13
|
+
import { useRoute } from 'vue-router'
|
|
14
|
+
import { computed } from 'vue'
|
|
15
|
+
const route = useRoute()
|
|
16
|
+
// 接受父组件参数,配置默认值
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
type?: string
|
|
20
|
+
}>(),
|
|
21
|
+
{
|
|
22
|
+
type: ''
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
const text = computed(() => route.query?.type || '')
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style scoped lang="scss">
|
|
29
|
+
@use './index';
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="errorPage">
|
|
3
|
+
<img src="./assets/404.png" class="not-img" alt="404" />
|
|
4
|
+
<div class="not-detail">
|
|
5
|
+
<div class="typeText">您访问的页面不存在</div>
|
|
6
|
+
<div class="descText">错误码:404</div>
|
|
7
|
+
<!-- <el-button type="primary" @click="router.back">返回上一页</el-button> -->
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts" name="404">
|
|
13
|
+
import { useRouter } from 'vue-router'
|
|
14
|
+
const router = useRouter()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style scoped lang="scss">
|
|
18
|
+
@use './index';
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="errorPage">
|
|
3
|
+
<img src="./assets/500.png" class="not-img" alt="500" />
|
|
4
|
+
<div class="not-detail">
|
|
5
|
+
<div class="typeText">网络不佳,请检查网络设置</div>
|
|
6
|
+
<!-- <el-button type="primary" @click="router.back">重新加载</el-button> -->
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts" name="500">
|
|
12
|
+
import { useRouter } from 'vue-router'
|
|
13
|
+
const router = useRouter()
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped lang="scss">
|
|
17
|
+
@use './index';
|
|
18
|
+
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.errorPage {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
width: 300px;
|
|
7
|
+
height: 100%;
|
|
8
|
+
.not-img {
|
|
9
|
+
width: 150px;
|
|
10
|
+
height: 150px;
|
|
11
|
+
}
|
|
12
|
+
.not-detail {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
width: 100%;
|
|
18
|
+
|
|
19
|
+
.typeText {
|
|
20
|
+
text-align: center;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
color: #333333;
|
|
23
|
+
margin-top: 16px;
|
|
24
|
+
}
|
|
25
|
+
.descText {
|
|
26
|
+
text-align: center;
|
|
27
|
+
color: #999999;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
margin-top: 12px;
|
|
30
|
+
}
|
|
31
|
+
.el-button {
|
|
32
|
+
margin-top: 16px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="error flx-center">
|
|
3
|
+
<page403 v-if="code == 403" :type="type" />
|
|
4
|
+
<page404 v-else-if="code == 404" />
|
|
5
|
+
<page500 v-else-if="code == 500" />
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="403">
|
|
10
|
+
import { useRouter } from 'vue-router'
|
|
11
|
+
import page403 from './403.vue'
|
|
12
|
+
import page404 from './404.vue'
|
|
13
|
+
import page500 from './500.vue'
|
|
14
|
+
|
|
15
|
+
const router = useRouter()
|
|
16
|
+
|
|
17
|
+
// 接受父组件参数,配置默认值
|
|
18
|
+
const props = withDefaults(
|
|
19
|
+
defineProps<{
|
|
20
|
+
code: 401 | 403 | 404 | 500
|
|
21
|
+
type?: string
|
|
22
|
+
}>(),
|
|
23
|
+
{
|
|
24
|
+
code: 404,
|
|
25
|
+
type: ''
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped lang="scss">
|
|
31
|
+
.error {
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
</style>
|