@kyfe/hroa-ui 1.0.5 → 1.0.7
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/hroa-ui.common.js +2927 -2545
- package/dist/hroa-ui.css +1 -1
- package/dist/hroa-ui.umd.js +2927 -2545
- package/dist/hroa-ui.umd.min.js +2 -2
- package/dist/img/header.7e31b1d5.png +0 -0
- package/lib/hr-add-list/index.js +1 -1
- package/lib/hr-bottom-button/index.js +1 -1
- package/lib/hr-breadcrumb/index.js +1 -1
- package/lib/hr-button/index.js +1 -1
- package/lib/hr-checkbox/index.css +1 -0
- package/lib/hr-checkbox/index.js +1 -0
- package/lib/hr-checkbox-group/index.css +1 -0
- package/lib/hr-checkbox-group/index.js +1 -0
- package/lib/hr-clipboard/index.js +1 -1
- package/lib/hr-collapse-card/index.js +1 -1
- package/lib/hr-condition-filtrate/index.js +1 -1
- package/lib/hr-condition-filtrate-popup/index.js +1 -1
- package/lib/hr-date-filter/index.css +1 -0
- package/lib/hr-date-filter/index.js +1 -0
- package/lib/hr-dropdown-date/index.css +1 -1
- package/lib/hr-dropdown-date/index.js +1 -1
- package/lib/hr-elasticity-box/index.js +1 -1
- package/lib/hr-elasticity-box-item/index.js +1 -1
- package/lib/hr-emotional-picture/index.js +1 -1
- package/lib/hr-employee-choose/index.js +1 -1
- package/lib/hr-file-list/index.css +1 -1
- package/lib/hr-file-list/index.js +1 -1
- package/lib/hr-full-screen/index.js +1 -1
- package/lib/hr-img-list/index.css +1 -1
- package/lib/hr-img-list/index.js +1 -1
- package/lib/hr-info-card/index.js +1 -1
- package/lib/hr-information/index.js +1 -1
- package/lib/hr-license-plate-number/index.js +1 -1
- package/lib/hr-module-card/index.js +1 -1
- package/lib/hr-multiterm-choose/index.css +1 -1
- package/lib/hr-multiterm-choose/index.js +1 -1
- package/lib/hr-no-data/index.js +1 -1
- package/lib/hr-notice-bar/index.js +1 -1
- package/lib/hr-notification-dialog/index.css +1 -0
- package/lib/hr-notification-dialog/index.js +1 -0
- package/lib/hr-open-ks/index.js +1 -1
- package/lib/hr-pager/index.css +1 -1
- package/lib/hr-pager/index.js +1 -1
- package/lib/hr-popup/index.js +1 -1
- package/lib/hr-preview-file/index.js +1 -1
- package/lib/hr-radiobox/index.css +1 -0
- package/lib/hr-radiobox/index.js +1 -0
- package/lib/hr-radiobox-group/index.css +1 -0
- package/lib/hr-radiobox-group/index.js +1 -0
- package/lib/hr-rate/index.js +1 -1
- package/lib/hr-reason-textarea/index.js +1 -1
- package/lib/hr-search-input/index.js +1 -1
- package/lib/hr-search-tips/index.css +1 -0
- package/lib/hr-search-tips/index.js +9 -0
- package/lib/hr-select/index.js +1 -1
- package/lib/hr-select-list/index.js +1 -1
- package/lib/hr-single-choose/index.css +1 -1
- package/lib/hr-single-choose/index.js +1 -1
- package/lib/hr-slide-pager/index.css +1 -1
- package/lib/hr-slide-pager/index.js +1 -1
- package/lib/hr-sort/index.js +1 -1
- package/lib/hr-stack-image/index.js +1 -1
- package/lib/hr-tab-nav/index.js +1 -1
- package/lib/hr-time-picker/index.css +1 -0
- package/lib/hr-time-picker/index.js +1 -0
- package/lib/hr-view-item/index.js +1 -1
- package/lib/hr-virtual-list/index.css +1 -0
- package/lib/hr-virtual-list/index.js +1 -0
- package/lib/img/header.7e31b1d5.png +0 -0
- package/lib/index/index.css +1 -1
- package/lib/index/index.js +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +17 -10
- package/lib/getJsModule/index.css +0 -1
- package/lib/getJsModule/index.js +0 -9
- package/packages/getJsModule.js +0 -11
- package/packages/hr-add-list/image/add.svg +0 -1
- package/packages/hr-add-list/image/close.svg +0 -1
- package/packages/hr-add-list/index.js +0 -7
- package/packages/hr-add-list/src/index.vue +0 -125
- package/packages/hr-add-list//346/226/260/345/242/236/345/244/232/347/254/224/346/225/260/346/215/256.md +0 -0
- package/packages/hr-bottom-button/index.js +0 -7
- package/packages/hr-bottom-button/src/index.vue +0 -128
- package/packages/hr-breadcrumb/index.js +0 -3
- package/packages/hr-breadcrumb/src/index.vue +0 -87
- package/packages/hr-breadcrumb//351/235/242/345/214/205/345/261/221.md +0 -0
- package/packages/hr-button/index.js +0 -13
- package/packages/hr-button/src/hr-button.vue +0 -39
- package/packages/hr-clipboard/index.js +0 -8
- package/packages/hr-clipboard/src/index.vue +0 -46
- package/packages/hr-clipboard/src/util.js +0 -9
- package/packages/hr-collapse-card/index.js +0 -3
- package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
- package/packages/hr-collapse-card/src/index.vue +0 -151
- package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
- package/packages/hr-condition-filtrate/enum/index.js +0 -11
- package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
- package/packages/hr-condition-filtrate/index.js +0 -7
- package/packages/hr-condition-filtrate/src/employee-choose/index.vue +0 -101
- package/packages/hr-condition-filtrate/src/index.vue +0 -246
- package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +0 -167
- package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +0 -102
- package/packages/hr-condition-filtrate/src/single-choose/index.vue +0 -144
- package/packages/hr-condition-filtrate/src/text-input/index.vue +0 -60
- package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +0 -154
- package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
- package/packages/hr-condition-filtrate/src/time-selector/index.vue +0 -380
- package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +0 -30
- package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +0 -213
- package/packages/hr-condition-filtrate-popup/index.js +0 -7
- package/packages/hr-condition-filtrate-popup/src/index.vue +0 -236
- package/packages/hr-dropdown-date/index.js +0 -7
- package/packages/hr-dropdown-date/src/calendar/calendar.js +0 -128
- package/packages/hr-dropdown-date/src/calendar/calendar.vue +0 -485
- package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
- package/packages/hr-dropdown-date/src/calendar/index.js +0 -5
- package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +0 -92
- package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +0 -128
- package/packages/hr-dropdown-date/src/date-picker/month-select.vue +0 -98
- package/packages/hr-dropdown-date/src/date-picker/style.less +0 -120
- package/packages/hr-dropdown-date/src/date-picker/utils.js +0 -109
- package/packages/hr-dropdown-date/src/index.vue +0 -482
- package/packages/hr-dropdown-date/src/week.js +0 -194
- package/packages/hr-elasticity-box/index.js +0 -7
- package/packages/hr-elasticity-box/src/elasticity-box-item.vue +0 -61
- package/packages/hr-elasticity-box/src/index.vue +0 -52
- package/packages/hr-elasticity-box-item/index.js +0 -7
- package/packages/hr-emotional-picture/index.js +0 -7
- package/packages/hr-emotional-picture/src/index.vue +0 -66
- package/packages/hr-emotional-picture//346/203/205/346/204/237/345/233/276/347/273/204/344/273/266.md +0 -0
- package/packages/hr-employee-choose/index.js +0 -7
- package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
- package/packages/hr-employee-choose/src/index.vue +0 -119
- package/packages/hr-file-list/index.js +0 -3
- package/packages/hr-file-list/src/file-type/other.vue +0 -45
- package/packages/hr-file-list/src/file-type/picture.vue +0 -38
- package/packages/hr-file-list/src/file-type/video.vue +0 -60
- package/packages/hr-file-list/src/index.vue +0 -246
- package/packages/hr-file-list/src/utils/enum.js +0 -95
- package/packages/hr-file-list/src/utils/fun.js +0 -16
- package/packages/hr-file-list//346/226/207/344/273/266/345/210/227/350/241/250.md +0 -0
- package/packages/hr-full-screen/index.js +0 -7
- package/packages/hr-full-screen/src/index.vue +0 -117
- package/packages/hr-img-list/index.js +0 -3
- package/packages/hr-img-list/src/index.vue +0 -144
- package/packages/hr-img-list//345/244/232/345/233/276/345/210/227/350/241/250.md +0 -0
- package/packages/hr-info-card/index.js +0 -7
- package/packages/hr-info-card/src/index.vue +0 -67
- package/packages/hr-information/index.js +0 -7
- package/packages/hr-information/src/index.vue +0 -72
- package/packages/hr-license-plate-number/index.js +0 -8
- package/packages/hr-license-plate-number/src/enum.js +0 -44
- package/packages/hr-license-plate-number/src/index.vue +0 -164
- package/packages/hr-license-plate-number/src/vnp-keyboard.vue +0 -182
- package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
- package/packages/hr-module-card/index.js +0 -13
- package/packages/hr-module-card/src/index.vue +0 -132
- package/packages/hr-module-card//346/250/241/345/235/227/345/215/241/347/211/207/347/273/204/344/273/266.md +0 -29
- package/packages/hr-multiterm-choose/index.js +0 -8
- package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
- package/packages/hr-multiterm-choose/src/index.vue +0 -225
- package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
- package/packages/hr-no-data/index.js +0 -7
- package/packages/hr-no-data/src/index.vue +0 -48
- package/packages/hr-notice-bar/index.js +0 -7
- package/packages/hr-notice-bar/src/bem.js +0 -38
- package/packages/hr-notice-bar/src/index.js +0 -52
- package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +0 -3
- package/packages/hr-open-ks/index.js +0 -7
- package/packages/hr-open-ks/src/icon.png +0 -0
- package/packages/hr-open-ks/src/index.vue +0 -97
- package/packages/hr-open-ks/src/util.js +0 -31
- package/packages/hr-pager/images/next-page.png +0 -0
- package/packages/hr-pager/images/prev-page.png +0 -0
- package/packages/hr-pager/index.js +0 -7
- package/packages/hr-pager/src/index.vue +0 -96
- package/packages/hr-pager//346/214/211/351/222/256/347/277/273/351/241/265/347/273/204/344/273/266.md +0 -0
- package/packages/hr-popup/index.js +0 -3
- package/packages/hr-popup/src/index.vue +0 -64
- package/packages/hr-popup//345/274/271/345/207/272/345/261/202.md +0 -0
- package/packages/hr-preview-file/index.js +0 -7
- package/packages/hr-preview-file/src/index.vue +0 -58
- package/packages/hr-preview-file/src/util.js +0 -50
- package/packages/hr-rate/index.js +0 -7
- package/packages/hr-rate/src/index.vue +0 -42
- package/packages/hr-rate//350/257/204/345/210/206/347/273/204/344/273/266/357/274/210/345/270/246/346/226/207/346/241/210/357/274/211.md +0 -0
- package/packages/hr-reason-textarea/index.js +0 -7
- package/packages/hr-reason-textarea/src/index.vue +0 -128
- package/packages/hr-search-input/image/input-close-icon.png +0 -0
- package/packages/hr-search-input/image/search-icon.png +0 -0
- package/packages/hr-search-input/index.js +0 -8
- package/packages/hr-search-input/src/index.vue +0 -144
- package/packages/hr-select/index.js +0 -7
- package/packages/hr-select/src/index.vue +0 -41
- package/packages/hr-select-list/index.js +0 -3
- package/packages/hr-select-list/src/index.vue +0 -214
- package/packages/hr-select-list//344/270/213/346/213/211/351/200/211/346/213/251(/351/273/230/350/256/244/345/244/232/351/200/211).md +0 -0
- package/packages/hr-single-choose/index.js +0 -8
- package/packages/hr-single-choose/src/index.vue +0 -196
- package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
- package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
- package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
- package/packages/hr-slide-pager/guide/index.vue +0 -59
- package/packages/hr-slide-pager/guide//346/226/260/346/211/213/346/214/207/345/274/225.md +0 -0
- package/packages/hr-slide-pager/index.js +0 -7
- package/packages/hr-slide-pager/src/index.vue +0 -381
- package/packages/hr-slide-pager//346/273/221/345/212/250/347/277/273/351/241/265/347/273/204/344/273/266.md +0 -0
- package/packages/hr-sort/index.js +0 -3
- package/packages/hr-sort/src/main.vue +0 -133
- package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
- package/packages/hr-stack-image/index.js +0 -3
- package/packages/hr-stack-image/src/main.vue +0 -77
- package/packages/hr-stack-image//345/261/202/345/217/240/345/233/276/347/211/207/347/273/204/344/273/266.md +0 -0
- package/packages/hr-tab-nav/index.js +0 -8
- package/packages/hr-tab-nav/src/index.vue +0 -190
- package/packages/hr-view-item/index.js +0 -13
- package/packages/hr-view-item/src/index.vue +0 -89
- package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md +0 -0
- package/packages/index.js +0 -23
- package/packages/utils/directive/common.js +0 -0
- package/packages/utils/directive/index.js +0 -2
- package/packages/utils/directive/specific.js +0 -54
- package/packages/utils/index.js +0 -7
- package/packages/utils/tool/common.js +0 -65
- package/packages/utils/tool/index.js +0 -2
- package/packages/utils/tool/specific.js +0 -0
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { IMG_FORMAT, VIDEO_FORMAT, FILE_TYPE, PREVIEW_FORMAT } from './utils/enum.js'
|
|
3
|
-
import { getFileTypeByExtendName } from './utils/fun.js'
|
|
4
|
-
// 图片类型
|
|
5
|
-
import ImgType from './file-type/picture.vue'
|
|
6
|
-
// 视频类型
|
|
7
|
-
import VideoType from './file-type/video.vue'
|
|
8
|
-
// 其它类型
|
|
9
|
-
import OtherType from './file-type/other.vue'
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
name: 'HrFileList',
|
|
13
|
-
components: {
|
|
14
|
-
ImgType,
|
|
15
|
-
VideoType,
|
|
16
|
-
OtherType,
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
fileList: {
|
|
20
|
-
type: Array,
|
|
21
|
-
default: () => ([])
|
|
22
|
-
},
|
|
23
|
-
// 是否需要删除
|
|
24
|
-
canRemove: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false
|
|
27
|
-
},
|
|
28
|
-
// 是否可预览
|
|
29
|
-
canPreview: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: true
|
|
32
|
-
},
|
|
33
|
-
// 展示文件名
|
|
34
|
-
showFileName: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
data () {
|
|
40
|
-
return {
|
|
41
|
-
curFileList: []
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
watch: {
|
|
45
|
-
fileList: {
|
|
46
|
-
handler (val) {
|
|
47
|
-
this.setFileData(val)
|
|
48
|
-
},
|
|
49
|
-
immediate: true,
|
|
50
|
-
deep: true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
render () {
|
|
54
|
-
const delDom = (item, index) => {
|
|
55
|
-
return <div class="del-icon" onClick={(e) => {
|
|
56
|
-
e.stopPropagation()
|
|
57
|
-
this.removeFileHandler(item, index, this.curFileList)
|
|
58
|
-
}}>
|
|
59
|
-
<ks-icon name="clear" class="icon-cls" />
|
|
60
|
-
</div>
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const imgDom = (item) => {
|
|
64
|
-
return (this.getFileType(item) === FILE_TYPE.IMG ? <ImgType fileData={item}></ImgType> : '')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const videoDom = (item) => {
|
|
68
|
-
return (this.getFileType(item) === FILE_TYPE.VIDEO ? <VideoType fileData={item}></VideoType> : '')
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const otherDom = (item) => {
|
|
72
|
-
return (![FILE_TYPE.IMG, FILE_TYPE.VIDEO].includes(this.getFileType(item)) ? <OtherType fileData={item}></OtherType> : '')
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const fileNameDom = (item) => {
|
|
76
|
-
const { name } = item || {}
|
|
77
|
-
return (name && <div class="file-name">{name}</div>)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return (<div class="hr-file-list">
|
|
81
|
-
{
|
|
82
|
-
this.curFileList.map((item, index) => {
|
|
83
|
-
return item.url ? <div class="file-item"
|
|
84
|
-
onClick={() => this.fileItemClick(item, index, this.curFileList)}>
|
|
85
|
-
{(this.canRemove || item.canRemove) ? delDom(item, index) : ''}
|
|
86
|
-
{imgDom(item)}
|
|
87
|
-
{videoDom(item)}
|
|
88
|
-
{otherDom(item)}
|
|
89
|
-
{this.showFileName && fileNameDom(item)}
|
|
90
|
-
</div> : ''
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
</div>)
|
|
94
|
-
},
|
|
95
|
-
methods: {
|
|
96
|
-
// 判断文件类型
|
|
97
|
-
getFileType (item) {
|
|
98
|
-
const { extendName } = item || {}
|
|
99
|
-
return getFileTypeByExtendName(extendName)
|
|
100
|
-
},
|
|
101
|
-
// 设置文件数据
|
|
102
|
-
setFileData (file) {
|
|
103
|
-
this.curFileList = file || []
|
|
104
|
-
},
|
|
105
|
-
// 过滤出指定格式文件
|
|
106
|
-
getSpecifyFormatFile (fileFormat) {
|
|
107
|
-
return (this.curFileList || []).filter(i => fileFormat.includes(i.extendName ? i.extendName.toLowerCase() : i.extendName))
|
|
108
|
-
},
|
|
109
|
-
// 选项点击事件
|
|
110
|
-
fileItemClick (item, index, fileList) {
|
|
111
|
-
this.$emit('fileItemClick', item, index, fileList)
|
|
112
|
-
if (!this.canPreview) return
|
|
113
|
-
if (!(window.ks && window.ks.callFunc)) {
|
|
114
|
-
window.vant.Toast('当前环境不支持跨声原生能力')
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
const { url, name, size, extendName } = item || {}
|
|
118
|
-
const newExtendName = extendName ? extendName.toLowerCase() : extendName
|
|
119
|
-
const isCanPreviewFormat = PREVIEW_FORMAT.includes(newExtendName)
|
|
120
|
-
if (!isCanPreviewFormat) {
|
|
121
|
-
window.vant.Toast('该文件暂不支持预览')
|
|
122
|
-
return
|
|
123
|
-
}
|
|
124
|
-
// 点击图片类型,预览图片
|
|
125
|
-
if (IMG_FORMAT.includes(newExtendName)) {
|
|
126
|
-
const urls = this.getSpecifyFormatFile(IMG_FORMAT).map(i => i.url)
|
|
127
|
-
this.previewPicture({
|
|
128
|
-
filePaths: urls,
|
|
129
|
-
index
|
|
130
|
-
})
|
|
131
|
-
} else if (VIDEO_FORMAT.includes(newExtendName)) {
|
|
132
|
-
const httpType = (url && (url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1))
|
|
133
|
-
this.previewVideo({
|
|
134
|
-
url,
|
|
135
|
-
type: httpType ? 0 : 1
|
|
136
|
-
})
|
|
137
|
-
} else {
|
|
138
|
-
this.previewFile({
|
|
139
|
-
filePath: url,
|
|
140
|
-
fileName: name,
|
|
141
|
-
fileSize: size
|
|
142
|
-
})
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
// 移除附件事件
|
|
146
|
-
removeFileHandler (item, index, fileList) {
|
|
147
|
-
this.$emit('removeFileItem', item, index, fileList)
|
|
148
|
-
},
|
|
149
|
-
/**
|
|
150
|
-
* @description: 预览图片
|
|
151
|
-
* @param {Array} filePaths 图片路径集合
|
|
152
|
-
* @param {Number} index 图片索引
|
|
153
|
-
* @param {Boolean} forbidMore 允许图片下载
|
|
154
|
-
* @param {Boolean} forbidDownload 显示三个点更多控件,可以拉起工具栏
|
|
155
|
-
* @return {void}
|
|
156
|
-
*/
|
|
157
|
-
previewPicture ({ filePaths = [], index = 0, forbidMore = false, forbidDownload = false }) {
|
|
158
|
-
window.ks.callFunc({
|
|
159
|
-
method: 'previewAssets',
|
|
160
|
-
params: {
|
|
161
|
-
filePaths,
|
|
162
|
-
index,
|
|
163
|
-
forbidMore,
|
|
164
|
-
forbidDownload
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
},
|
|
168
|
-
/**
|
|
169
|
-
* @description: 预览视频
|
|
170
|
-
* @param {String} url 视频路径
|
|
171
|
-
* @param {Number} type 路径类型(0-在线链接 1-本地路径 3-813司庆)
|
|
172
|
-
* @return {void}
|
|
173
|
-
*/
|
|
174
|
-
previewVideo ({ url, type }) {
|
|
175
|
-
window.ks.callFunc({
|
|
176
|
-
method: 'playVideo',
|
|
177
|
-
params: {
|
|
178
|
-
url,
|
|
179
|
-
type
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
},
|
|
183
|
-
/**
|
|
184
|
-
* @description: 预览文件
|
|
185
|
-
* @param {String} filePath 文件路径
|
|
186
|
-
* @param {String} fileName 文件名称
|
|
187
|
-
* @param {String} fileSize 文件大小(注:跨声原生方法预览文件,fileSize必须string类型,否则iPhone预览不了)
|
|
188
|
-
* @return {void}
|
|
189
|
-
*/
|
|
190
|
-
previewFile ({ filePath, fileName, fileSize }) {
|
|
191
|
-
window.ks.callFunc({
|
|
192
|
-
method: 'previewFile',
|
|
193
|
-
params: {
|
|
194
|
-
filePath,
|
|
195
|
-
fileName,
|
|
196
|
-
fileSize: (fileSize || fileSize === 0) ? String(fileSize) : fileSize
|
|
197
|
-
}
|
|
198
|
-
})
|
|
199
|
-
},
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
</script>
|
|
203
|
-
|
|
204
|
-
<style lang="less" scoped>
|
|
205
|
-
.hr-file-list {
|
|
206
|
-
// width: 100%;
|
|
207
|
-
display: inline-block;
|
|
208
|
-
.file-item {
|
|
209
|
-
position: relative;
|
|
210
|
-
width: 70px;
|
|
211
|
-
height: 70px;
|
|
212
|
-
margin-bottom: 8px;
|
|
213
|
-
margin-right: 10px;
|
|
214
|
-
float: left;
|
|
215
|
-
.del-icon {
|
|
216
|
-
position: absolute;
|
|
217
|
-
top: -7px;
|
|
218
|
-
right: -7px;
|
|
219
|
-
z-index: 99;
|
|
220
|
-
width: 14px;
|
|
221
|
-
height: 14px;
|
|
222
|
-
color: #b0b3bf;
|
|
223
|
-
background: #ffffff;
|
|
224
|
-
border-radius: 50%;
|
|
225
|
-
display: flex;
|
|
226
|
-
justify-content: center;
|
|
227
|
-
align-items: center;
|
|
228
|
-
.icon-cls {
|
|
229
|
-
font-size: 14px;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
.file-name {
|
|
233
|
-
position: absolute;
|
|
234
|
-
left: 0;
|
|
235
|
-
bottom: 0;
|
|
236
|
-
width: 100%;
|
|
237
|
-
height: 16px;
|
|
238
|
-
line-height: 16px;
|
|
239
|
-
font-size: 11px;
|
|
240
|
-
text-align: center;
|
|
241
|
-
color: #ffffff;
|
|
242
|
-
background: rgba(0, 0, 0, 0.5);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
</style>
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
const imgIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/img.svg'
|
|
2
|
-
export const videoIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/video.svg'
|
|
3
|
-
const pdfIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/pdf.svg'
|
|
4
|
-
const pptIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/ppt.svg'
|
|
5
|
-
const wordIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/word.svg'
|
|
6
|
-
const xlsIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/word.svg'
|
|
7
|
-
const txtIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/txt.svg'
|
|
8
|
-
const zipIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/zip.svg'
|
|
9
|
-
export const defaultIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/default.svg'
|
|
10
|
-
export const noFormatIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/file-type/no-format.svg'
|
|
11
|
-
|
|
12
|
-
export const FILE_TYPE = {
|
|
13
|
-
IMG: 'img',
|
|
14
|
-
VIDEO: 'video',
|
|
15
|
-
OTHER: 'other',
|
|
16
|
-
UNKNOWN: 'unknown'
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 图片格式
|
|
20
|
-
export const IMG_FORMAT = ['png', 'jpg', 'jpeg', 'bmp', 'webp', 'gif']
|
|
21
|
-
|
|
22
|
-
// 视频格式
|
|
23
|
-
export const VIDEO_FORMAT = ['mp4', 'avi', 'mkv', 'mov', 'wmv', 'flv', 'mpeg', 'webm']
|
|
24
|
-
|
|
25
|
-
// PDF格式
|
|
26
|
-
export const PDF_FORMAT = ['pdf']
|
|
27
|
-
|
|
28
|
-
// PPT格式
|
|
29
|
-
export const PPT_FORMAT = ['ppt', 'pptx', 'pps', 'ppsx']
|
|
30
|
-
|
|
31
|
-
// WORD格式
|
|
32
|
-
export const WORD_FORMAT = ['doc', 'docx']
|
|
33
|
-
|
|
34
|
-
// XLS格式
|
|
35
|
-
export const XLS_FORMAT = ['xls', 'xlsx']
|
|
36
|
-
|
|
37
|
-
// TXT格式
|
|
38
|
-
export const TXT_FORMAT = ['txt']
|
|
39
|
-
|
|
40
|
-
// ZIP格式
|
|
41
|
-
export const ZIP_FORMAT = ['zip', 'rar', '7z', 'tar', 'gz']
|
|
42
|
-
|
|
43
|
-
// 可预览格式
|
|
44
|
-
export const PREVIEW_FORMAT = [
|
|
45
|
-
...IMG_FORMAT,
|
|
46
|
-
...VIDEO_FORMAT,
|
|
47
|
-
...PDF_FORMAT,
|
|
48
|
-
...PPT_FORMAT,
|
|
49
|
-
...WORD_FORMAT,
|
|
50
|
-
...XLS_FORMAT
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
// 文件格式数据
|
|
54
|
-
export const FILE_FORMAT_DATA = [
|
|
55
|
-
{
|
|
56
|
-
type: 'IMG',
|
|
57
|
-
format: IMG_FORMAT,
|
|
58
|
-
formatIcon: imgIcon
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: 'VIDEO',
|
|
62
|
-
format: VIDEO_FORMAT,
|
|
63
|
-
formatIcon: videoIcon
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'PDF',
|
|
67
|
-
format: PDF_FORMAT,
|
|
68
|
-
formatIcon: pdfIcon
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
type: 'PPT',
|
|
72
|
-
format: PPT_FORMAT,
|
|
73
|
-
formatIcon: pptIcon
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
type: 'WORD',
|
|
77
|
-
format: WORD_FORMAT,
|
|
78
|
-
formatIcon: wordIcon
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
type: 'XLS',
|
|
82
|
-
format: XLS_FORMAT,
|
|
83
|
-
formatIcon: xlsIcon
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: 'TXT',
|
|
87
|
-
format: TXT_FORMAT,
|
|
88
|
-
formatIcon: txtIcon
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
type: 'ZIP',
|
|
92
|
-
format: ZIP_FORMAT,
|
|
93
|
-
formatIcon: zipIcon
|
|
94
|
-
}
|
|
95
|
-
]
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FILE_TYPE, IMG_FORMAT, VIDEO_FORMAT } from './enum.js'
|
|
2
|
-
|
|
3
|
-
// 根据文件拓展名获取文件类型
|
|
4
|
-
export const getFileTypeByExtendName = (extendName) => {
|
|
5
|
-
if (!extendName) {
|
|
6
|
-
return FILE_TYPE.UNKNOWN
|
|
7
|
-
}
|
|
8
|
-
const newExtendName = extendName.toLowerCase()
|
|
9
|
-
const isImgType = IMG_FORMAT.includes(newExtendName)
|
|
10
|
-
const isVideoType = VIDEO_FORMAT.includes(newExtendName)
|
|
11
|
-
return (
|
|
12
|
-
(isImgType && FILE_TYPE.IMG) ||
|
|
13
|
-
(isVideoType && FILE_TYPE.VIDEO) ||
|
|
14
|
-
FILE_TYPE.OTHER
|
|
15
|
-
)
|
|
16
|
-
}
|
|
File without changes
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'HrFullScreen',
|
|
4
|
-
props: {
|
|
5
|
-
show: {
|
|
6
|
-
type: Boolean,
|
|
7
|
-
default: false
|
|
8
|
-
},
|
|
9
|
-
title: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: '标题'
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
computed: {
|
|
15
|
-
showPop: {
|
|
16
|
-
get () {
|
|
17
|
-
return this.show
|
|
18
|
-
},
|
|
19
|
-
set (val) {
|
|
20
|
-
this.$emit('update:show', val)
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
changePopup (val) {
|
|
26
|
-
this.showPop = val
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
render () {
|
|
30
|
-
const myHeader = () => {
|
|
31
|
-
return (
|
|
32
|
-
<div class="screen-title">
|
|
33
|
-
<div onClick={() => this.showPop = false} class="title-left">
|
|
34
|
-
<div class="title-back">
|
|
35
|
-
<ks-icon name="arrow-left" />
|
|
36
|
-
</div>
|
|
37
|
-
<div class="title-text">{this.title}</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
const popupAttrs = {
|
|
43
|
-
props: {
|
|
44
|
-
value: this.showPop,
|
|
45
|
-
overlay: false,
|
|
46
|
-
duration: 0,
|
|
47
|
-
getContainer: 'body'
|
|
48
|
-
},
|
|
49
|
-
style: {
|
|
50
|
-
width: '100%',
|
|
51
|
-
height: '100%'
|
|
52
|
-
},
|
|
53
|
-
on: {
|
|
54
|
-
input: this.changePopup,
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
return (
|
|
58
|
-
<van-popup {...popupAttrs}>
|
|
59
|
-
<div class="hr-full-screen">
|
|
60
|
-
{myHeader()}
|
|
61
|
-
<div class="page">{this.$slots.default}</div>
|
|
62
|
-
</div>
|
|
63
|
-
</van-popup>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
</script>
|
|
68
|
-
<style lang="less" scoped>
|
|
69
|
-
.hr-full-screen {
|
|
70
|
-
width: 100%;
|
|
71
|
-
height: 100%;
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
background: #7972fe;
|
|
76
|
-
.screen-title {
|
|
77
|
-
padding-left: 16px;
|
|
78
|
-
padding-bottom: 8px;
|
|
79
|
-
box-sizing: content-box;
|
|
80
|
-
display: flex;
|
|
81
|
-
background: #7972fe;
|
|
82
|
-
height: 44px;
|
|
83
|
-
line-height: 44px;
|
|
84
|
-
color: #fff;
|
|
85
|
-
.title-left {
|
|
86
|
-
display: flex;
|
|
87
|
-
.title-back {
|
|
88
|
-
font-size: 22px;
|
|
89
|
-
font-weight: 500;
|
|
90
|
-
display: flex;
|
|
91
|
-
align-items: center;
|
|
92
|
-
}
|
|
93
|
-
.title-text {
|
|
94
|
-
margin-left: 4px;
|
|
95
|
-
font-size: 16px;
|
|
96
|
-
font-weight: 500;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
.page {
|
|
101
|
-
flex: 1;
|
|
102
|
-
display: flex;
|
|
103
|
-
flex-direction: column;
|
|
104
|
-
background-color: #ffffff;
|
|
105
|
-
color: #03050d;
|
|
106
|
-
min-height: calc(100% - 52px);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
.ios .hr-full-screen .screen-title,
|
|
110
|
-
.ipx .hr-full-screen .screen-title {
|
|
111
|
-
padding-top: 44px !important;
|
|
112
|
-
}
|
|
113
|
-
.ios .hr-full-screen .page,
|
|
114
|
-
.ipx .hr-full-screen .page {
|
|
115
|
-
min-height: calc(100% - 96px) !important;
|
|
116
|
-
}
|
|
117
|
-
</style>
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<HrPopup :show="isShowPopup"
|
|
3
|
-
closeable
|
|
4
|
-
position="bottom"
|
|
5
|
-
safe-area-inset-bottom
|
|
6
|
-
v-bind="$attrs"
|
|
7
|
-
:title="title"
|
|
8
|
-
@close="close">
|
|
9
|
-
<div ref="hrImgListRef"
|
|
10
|
-
class="hr-img-list">
|
|
11
|
-
<HrElasticityBox v-if="showImgList.length > 1"
|
|
12
|
-
:lineNumber="2"
|
|
13
|
-
:margin="6">
|
|
14
|
-
<HrElasticityBoxItem v-for="(item, index) in showImgList"
|
|
15
|
-
:key="index"
|
|
16
|
-
:index="index">
|
|
17
|
-
<div class="img-item"
|
|
18
|
-
:class="{'item-single': showImgList.length === 1, 'active': checksIndex.includes(index)}"
|
|
19
|
-
@click="() => preview(index)">
|
|
20
|
-
<img :src="item.url"
|
|
21
|
-
alt="" />
|
|
22
|
-
<slot :item="item"
|
|
23
|
-
:index="index"></slot>
|
|
24
|
-
</div>
|
|
25
|
-
</HrElasticityBoxItem>
|
|
26
|
-
</HrElasticityBox>
|
|
27
|
-
<template v-else>
|
|
28
|
-
<div v-for="(item, index) in showImgList"
|
|
29
|
-
:key="index"
|
|
30
|
-
class="img-item"
|
|
31
|
-
:class="{'item-single': showImgList.length === 1, 'active': checksIndex.includes(index)}"
|
|
32
|
-
@click="() => preview(index)">
|
|
33
|
-
<img :src="item.url"
|
|
34
|
-
alt="" />
|
|
35
|
-
<slot :item="item"
|
|
36
|
-
:index="index"></slot>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
<slot v-if="!showImgList.length"
|
|
40
|
-
name="no-data"></slot>
|
|
41
|
-
</div>
|
|
42
|
-
<slot name="list-footer"></slot>
|
|
43
|
-
</HrPopup>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script>
|
|
47
|
-
import HrPopup from '../../hr-popup'
|
|
48
|
-
import HrElasticityBox from '../../hr-elasticity-box'
|
|
49
|
-
import HrElasticityBoxItem from '../../hr-elasticity-box/src/elasticity-box-item.vue'
|
|
50
|
-
|
|
51
|
-
export default {
|
|
52
|
-
name: 'HrImgList',
|
|
53
|
-
components: {
|
|
54
|
-
HrPopup,
|
|
55
|
-
HrElasticityBox,
|
|
56
|
-
HrElasticityBoxItem
|
|
57
|
-
},
|
|
58
|
-
props: {
|
|
59
|
-
show: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: false
|
|
62
|
-
},
|
|
63
|
-
// 标题
|
|
64
|
-
title: String,
|
|
65
|
-
// 图片列表
|
|
66
|
-
imgList: {
|
|
67
|
-
type: Array,
|
|
68
|
-
default: () => ([])
|
|
69
|
-
},
|
|
70
|
-
// 需要添加选中效果的索引集合
|
|
71
|
-
checksIndex: {
|
|
72
|
-
type: Array,
|
|
73
|
-
default: () => ([])
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
data () {
|
|
77
|
-
return {
|
|
78
|
-
isShowPopup: false,
|
|
79
|
-
showImgList: [],
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
watch: {
|
|
83
|
-
show: {
|
|
84
|
-
handler (val) {
|
|
85
|
-
this.isShowPopup = val
|
|
86
|
-
},
|
|
87
|
-
immediate: true
|
|
88
|
-
},
|
|
89
|
-
imgList: {
|
|
90
|
-
handler (val) {
|
|
91
|
-
this.showImgList = val || []
|
|
92
|
-
},
|
|
93
|
-
deep: true,
|
|
94
|
-
immediate: true
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
methods: {
|
|
98
|
-
preview (index) {
|
|
99
|
-
const images = this.showImgList.map(item => item.url)
|
|
100
|
-
vant.ImagePreview({
|
|
101
|
-
images,
|
|
102
|
-
startPosition: index
|
|
103
|
-
})
|
|
104
|
-
},
|
|
105
|
-
close () {
|
|
106
|
-
this.isShowPopup = false
|
|
107
|
-
this.$emit('close')
|
|
108
|
-
},
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
</script>
|
|
112
|
-
|
|
113
|
-
<style lang="less" scoped>
|
|
114
|
-
.hr-img-list {
|
|
115
|
-
max-height: 70vh;
|
|
116
|
-
overflow: auto;
|
|
117
|
-
display: flex;
|
|
118
|
-
flex-wrap: wrap;
|
|
119
|
-
padding: 10px;
|
|
120
|
-
.img-item {
|
|
121
|
-
position: relative;
|
|
122
|
-
width: 100%;
|
|
123
|
-
height: 100%;
|
|
124
|
-
// width: calc(50% - 16px);
|
|
125
|
-
// height: 200px;
|
|
126
|
-
// height: calc(50vw - 16px - 20px);
|
|
127
|
-
margin: 6px;
|
|
128
|
-
overflow: hidden;
|
|
129
|
-
border-radius: 8px;
|
|
130
|
-
border: 2px solid transparent;
|
|
131
|
-
&.item-single {
|
|
132
|
-
width: 100%;
|
|
133
|
-
height: auto;
|
|
134
|
-
}
|
|
135
|
-
&.active {
|
|
136
|
-
border: 2px solid #7972fe;
|
|
137
|
-
}
|
|
138
|
-
img {
|
|
139
|
-
width: 100%;
|
|
140
|
-
min-height: 100%;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
</style>
|
|
File without changes
|