@kyfe/hroa-ui 1.0.3 → 1.0.5
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 +3447 -472
- package/dist/hroa-ui.css +1 -1
- package/dist/hroa-ui.umd.js +3447 -472
- package/dist/hroa-ui.umd.min.js +2 -2
- package/lib/getJsModule/index.css +1 -1
- package/lib/getJsModule/index.js +2 -2
- package/lib/hr-add-list/index.js +1 -1
- package/lib/hr-bottom-button/index.css +1 -1
- package/lib/hr-bottom-button/index.js +1 -1
- package/lib/hr-breadcrumb/index.css +1 -1
- package/lib/hr-breadcrumb/index.js +2 -2
- package/lib/hr-button/index.js +1 -1
- package/lib/hr-clipboard/index.js +1 -1
- package/lib/hr-collapse-card/index.css +1 -0
- package/lib/hr-collapse-card/index.js +1 -0
- package/lib/hr-condition-filtrate/index.js +1 -1
- package/lib/hr-condition-filtrate-popup/index.js +1 -1
- package/lib/hr-dropdown-date/index.css +1 -0
- package/lib/hr-dropdown-date/index.js +1 -0
- 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 -0
- package/lib/hr-file-list/index.js +1 -0
- package/lib/hr-full-screen/index.css +1 -0
- package/lib/hr-full-screen/index.js +1 -0
- package/lib/hr-img-list/index.js +1 -1
- package/lib/hr-info-card/index.js +1 -1
- package/lib/hr-information/index.css +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.js +1 -1
- package/lib/hr-no-data/index.js +1 -1
- package/lib/hr-notice-bar/index.js +1 -1
- 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-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-select/index.js +1 -1
- package/lib/hr-select-list/index.css +1 -1
- package/lib/hr-select-list/index.js +2 -2
- package/lib/hr-single-choose/index.js +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.css +1 -1
- package/lib/hr-tab-nav/index.js +1 -1
- package/lib/hr-view-item/index.js +1 -1
- package/lib/index/index.css +1 -1
- package/lib/index/index.js +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +2 -2
- package/packages/hr-bottom-button/src/index.vue +32 -13
- package/packages/hr-breadcrumb/src/index.vue +2 -2
- package/packages/hr-collapse-card/index.js +3 -0
- package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
- package/packages/hr-collapse-card/src/index.vue +151 -0
- package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
- package/packages/hr-dropdown-date/index.js +7 -0
- package/packages/hr-dropdown-date/src/calendar/calendar.js +128 -0
- package/packages/hr-dropdown-date/src/calendar/calendar.vue +485 -0
- package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
- package/packages/hr-dropdown-date/src/calendar/index.js +5 -0
- package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +92 -0
- package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +128 -0
- package/packages/hr-dropdown-date/src/date-picker/month-select.vue +98 -0
- package/packages/hr-dropdown-date/src/date-picker/style.less +120 -0
- package/packages/hr-dropdown-date/src/date-picker/utils.js +109 -0
- package/packages/hr-dropdown-date/src/index.vue +482 -0
- package/packages/hr-dropdown-date/src/week.js +194 -0
- package/packages/hr-file-list/index.js +3 -0
- package/packages/hr-file-list/src/file-type/other.vue +45 -0
- package/packages/hr-file-list/src/file-type/picture.vue +38 -0
- package/packages/hr-file-list/src/file-type/video.vue +60 -0
- package/packages/hr-file-list/src/index.vue +246 -0
- package/packages/hr-file-list/src/utils/enum.js +95 -0
- package/packages/hr-file-list/src/utils/fun.js +16 -0
- 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 +7 -0
- package/packages/hr-full-screen/src/index.vue +117 -0
- package/packages/hr-information/src/index.vue +1 -0
- package/packages/hr-pager/index.js +1 -1
- package/packages/hr-pager/src/index.vue +6 -5
- package/packages/hr-select-list/src/index.vue +23 -11
- package/packages/hr-tab-nav/src/index.vue +83 -7
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defaultIcon, noFormatIcon, FILE_FORMAT_DATA } from '../utils/enum.js'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
fileData: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
render () {
|
|
12
|
+
const { url } = this.fileData
|
|
13
|
+
const fileIcon = this.getFileIcon(this.fileData)
|
|
14
|
+
return (url && <div class="hr-file-list-other">
|
|
15
|
+
<img src={fileIcon} />
|
|
16
|
+
</div>)
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
getFileIcon (fileData) {
|
|
20
|
+
const { extendName } = fileData || {}
|
|
21
|
+
if (!extendName) return noFormatIcon
|
|
22
|
+
const { formatIcon } = (FILE_FORMAT_DATA || []).find(i => i.format && i.format.includes(extendName.toLowerCase())) || {}
|
|
23
|
+
return formatIcon || defaultIcon
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="less" scoped>
|
|
30
|
+
.hr-file-list-other {
|
|
31
|
+
position: relative;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
background: #f7f8fa;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
border-radius: 8px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
img {
|
|
41
|
+
width: 36px;
|
|
42
|
+
height: 36px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
props: {
|
|
4
|
+
fileData: {
|
|
5
|
+
type: Object,
|
|
6
|
+
default: () => ({})
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
data () {
|
|
10
|
+
return {
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
render () {
|
|
15
|
+
const { url } = this.fileData
|
|
16
|
+
return (url && <div class="hr-file-list-img">
|
|
17
|
+
<img src={url} />
|
|
18
|
+
</div>)
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style lang="less" scoped>
|
|
27
|
+
.hr-file-list-img {
|
|
28
|
+
position: relative;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
border-radius: 8px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
img {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { videoIcon } from '../utils/enum.js'
|
|
3
|
+
|
|
4
|
+
const playBtnIcon = 'https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/hr-fe-together-build/play-btn.svg'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
props: {
|
|
8
|
+
fileData: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => ({})
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
render () {
|
|
14
|
+
const { url, coverUrl } = this.fileData
|
|
15
|
+
return (url && <div class="hr-file-list-video">
|
|
16
|
+
<img src={coverUrl ? coverUrl : videoIcon}
|
|
17
|
+
class={coverUrl && 'cover-img'} />
|
|
18
|
+
{
|
|
19
|
+
coverUrl && <div class="play-btn">
|
|
20
|
+
<img src={playBtnIcon} />
|
|
21
|
+
</div>
|
|
22
|
+
}
|
|
23
|
+
</div>)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style lang="less" scoped>
|
|
29
|
+
.hr-file-list-video {
|
|
30
|
+
position: relative;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
background: #f7f8fa;
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
img {
|
|
40
|
+
width: 36px;
|
|
41
|
+
height: 36px;
|
|
42
|
+
}
|
|
43
|
+
.cover-img {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
.play-btn {
|
|
48
|
+
position: absolute;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
img {
|
|
55
|
+
width: 24px;
|
|
56
|
+
height: 24px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,246 @@
|
|
|
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>
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,117 @@
|
|
|
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>
|
|
@@ -77,19 +77,20 @@
|
|
|
77
77
|
user-select: none;
|
|
78
78
|
position: fixed;
|
|
79
79
|
top: 45%;
|
|
80
|
+
left: 0;
|
|
80
81
|
width: 100%;
|
|
81
82
|
box-sizing: border-box;
|
|
82
|
-
padding: 0
|
|
83
|
+
padding: 0 30px;
|
|
83
84
|
> img {
|
|
84
85
|
position: absolute;
|
|
85
|
-
width:
|
|
86
|
-
height:
|
|
86
|
+
width: 48px;
|
|
87
|
+
height: 48px;
|
|
87
88
|
}
|
|
88
89
|
.prev {
|
|
89
|
-
left:
|
|
90
|
+
left: 14px;
|
|
90
91
|
}
|
|
91
92
|
.next {
|
|
92
|
-
right:
|
|
93
|
+
right: 14px;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
</style>
|