@kyfe/hroa-ui 1.0.6 → 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 +133 -2576
- package/dist/hroa-ui.css +1 -1
- package/dist/hroa-ui.umd.js +133 -2576
- package/dist/hroa-ui.umd.min.js +2 -2
- 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.js +1 -1
- package/lib/hr-checkbox-group/index.js +1 -1
- 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 -1
- package/lib/hr-date-filter/index.js +1 -1
- 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.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.js +1 -1
- package/lib/hr-open-ks/index.js +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.js +1 -1
- package/lib/hr-radiobox-group/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-search-tips/index.js +1 -1
- 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.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.js +1 -1
- package/lib/hr-view-item/index.js +1 -1
- package/lib/hr-virtual-list/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 +12 -9
- 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-checkbox/index.js +0 -8
- package/packages/hr-checkbox/src/active-icon.png +0 -0
- package/packages/hr-checkbox/src/checkbox-group.vue +0 -74
- package/packages/hr-checkbox/src/checkbox.vue +0 -226
- package/packages/hr-checkbox/src/data.js +0 -46
- package/packages/hr-checkbox//345/244/215/351/200/211/346/241/206-/345/215/225/351/200/211/346/241/206.md +0 -0
- package/packages/hr-checkbox-group/index.js +0 -8
- 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-date-filter/index.js +0 -7
- package/packages/hr-date-filter/src/date-select.vue +0 -153
- package/packages/hr-date-filter/src/index.vue +0 -243
- package/packages/hr-date-filter/src/style.less +0 -130
- package/packages/hr-date-filter/src/utils.js +0 -109
- 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 -224
- 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-notification-dialog/images/header.png +0 -0
- package/packages/hr-notification-dialog/index.js +0 -7
- package/packages/hr-notification-dialog/src/index.vue +0 -293
- package/packages/hr-notification-dialog//345/274/271/347/252/227/346/217/220/347/244/272/347/273/204/344/273/266.md +0 -0
- 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 -120
- 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-radiobox/index.js +0 -8
- package/packages/hr-radiobox/src/data.js +0 -46
- package/packages/hr-radiobox/src/radiobox-group.vue +0 -64
- package/packages/hr-radiobox/src/radiobox.vue +0 -191
- package/packages/hr-radiobox-group/index.js +0 -8
- 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-search-tips/index.js +0 -3
- package/packages/hr-search-tips/src/index.vue +0 -213
- package/packages/hr-search-tips//350/277/234/347/250/213/346/250/241/347/263/212/346/220/234/347/264/242.md +0 -0
- 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 -195
- 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 -374
- 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-time-picker/index.js +0 -3
- package/packages/hr-time-picker/src/index.vue +0 -85
- package/packages/hr-time-picker//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +0 -0
- 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/hr-virtual-list/index.js +0 -7
- package/packages/hr-virtual-list/src/cc-item.vue +0 -105
- package/packages/hr-virtual-list/src/index.vue +0 -227
- package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.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,58 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
3
|
-
isObjectEmpty,
|
|
4
|
-
createMap
|
|
5
|
-
} from './util.js'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
name: 'HrPreviewFile',
|
|
9
|
-
props: {
|
|
10
|
-
file: {
|
|
11
|
-
type: Object,
|
|
12
|
-
default: () => ({
|
|
13
|
-
extendName: '',
|
|
14
|
-
url: '',
|
|
15
|
-
name: '',
|
|
16
|
-
size: ''
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
methods: {
|
|
21
|
-
preview (file) {
|
|
22
|
-
try {
|
|
23
|
-
|
|
24
|
-
if (isObjectEmpty(file) || !file.url) return window.vant.Toast('暂无附件,请检查')
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
extendName = '',
|
|
28
|
-
url = '',
|
|
29
|
-
name = '',
|
|
30
|
-
size = ''
|
|
31
|
-
} = file || {}
|
|
32
|
-
|
|
33
|
-
const find = [...createMap()].find(([key]) => key.test(extendName))
|
|
34
|
-
|
|
35
|
-
if (find === void 0) return window.vant.Toast(`暂不支持${extendName}类型文件的预览`)
|
|
36
|
-
|
|
37
|
-
const [, fn] = find
|
|
38
|
-
|
|
39
|
-
fn({ url, name, size })
|
|
40
|
-
|
|
41
|
-
this.$emit('preview', file)
|
|
42
|
-
} catch (err) {
|
|
43
|
-
console.log(`🚀 ~ preview ~ err:`, err)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
render () {
|
|
48
|
-
return (<div class="hr-preview-file" onClick={() => this.preview(this.file)}>{this.$slots.default ? this.$slots.default : null}</div>)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
</script>
|
|
52
|
-
<style lang="less" scoped>
|
|
53
|
-
.hr-preview-file {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const ImagePreview = window.vant && window.vant.ImagePreview
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description: 空对象
|
|
5
|
-
*/
|
|
6
|
-
export function isObjectEmpty (obj) {
|
|
7
|
-
return JSON.stringify(obj) === '{}'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function createMap () {
|
|
11
|
-
//
|
|
12
|
-
const IMG_REG = /png|jpe?g|gif|svg|bmp/ig
|
|
13
|
-
// 可根据 ks.previewFile 的支持情况进行补充
|
|
14
|
-
const PDF_REG = /pdf|docx/ig
|
|
15
|
-
|
|
16
|
-
return new Map([
|
|
17
|
-
//
|
|
18
|
-
[IMG_REG, imgPre],
|
|
19
|
-
//
|
|
20
|
-
[PDF_REG, pdfPre]
|
|
21
|
-
])
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @description: 图片类型
|
|
26
|
-
* @param {String} url 路径
|
|
27
|
-
*/
|
|
28
|
-
function imgPre ({ url }) {
|
|
29
|
-
ImagePreview({
|
|
30
|
-
images: [url],
|
|
31
|
-
startPosition: 0
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @description: 文件类型
|
|
37
|
-
* @param {String} url 文件路径
|
|
38
|
-
* @param {String} name 文件名称
|
|
39
|
-
* @param {String} size 文件大小
|
|
40
|
-
*/
|
|
41
|
-
function pdfPre ({ url, name, size }) {
|
|
42
|
-
window.ks.callFunc({
|
|
43
|
-
method: 'previewFile',
|
|
44
|
-
params: {
|
|
45
|
-
filePath: url,
|
|
46
|
-
fileName: name,
|
|
47
|
-
fileSize: String(size)
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export default class RadioboxItem {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.value = ''
|
|
4
|
-
this.label = ''
|
|
5
|
-
this.selfAdaption = ''
|
|
6
|
-
this.divideeQually = ''
|
|
7
|
-
this.margin = ''
|
|
8
|
-
this.bottom = ''
|
|
9
|
-
this.index = ''
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
init (params = {}) {
|
|
13
|
-
this.initState(params)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
initState (params) {
|
|
17
|
-
const { value, label, selfAdaption, divideeQually, margin, marginBottom, index } = params
|
|
18
|
-
this.value = value
|
|
19
|
-
this.label = label
|
|
20
|
-
this.selfAdaption = selfAdaption
|
|
21
|
-
this.divideeQually = divideeQually
|
|
22
|
-
this.margin = margin
|
|
23
|
-
this.bottom = marginBottom
|
|
24
|
-
this.index = index
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
getIndex () { }
|
|
28
|
-
|
|
29
|
-
get width () {
|
|
30
|
-
return this.selfAdaption ? null : `calc((100% - ${this.margin * (this.divideeQually - 1)}px) / ${this.divideeQually})`
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get marginRight () {
|
|
34
|
-
return this.selfAdaption ? `${this.margin}px` : `${(this.index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get marginBottom () {
|
|
38
|
-
return `${this.bottom}px`
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const CHOOSE_TYPE = {
|
|
44
|
-
SINGLE: 'single', // 单选
|
|
45
|
-
MULTIPLE: 'multiple' // 多选
|
|
46
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'HrRadioboxGroup',
|
|
4
|
-
provide () {
|
|
5
|
-
return {
|
|
6
|
-
divideeQually: this.divideeQually,
|
|
7
|
-
margin: this.margin,
|
|
8
|
-
marginBottom: this.marginBottom,
|
|
9
|
-
selfAdaption: this.selfAdaption,
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
props: {
|
|
13
|
-
divideeQually: {
|
|
14
|
-
type: Number,
|
|
15
|
-
default () {
|
|
16
|
-
return 3
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
margin: {
|
|
20
|
-
type: Number,
|
|
21
|
-
default () {
|
|
22
|
-
return 12
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
selfAdaption: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default () {
|
|
28
|
-
return false
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
value: {
|
|
32
|
-
type: String || Number,
|
|
33
|
-
default () {
|
|
34
|
-
return []
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
marginBottom: {
|
|
38
|
-
type: Number,
|
|
39
|
-
default () {
|
|
40
|
-
return this.margin
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
data () {
|
|
45
|
-
return {}
|
|
46
|
-
},
|
|
47
|
-
methods: {},
|
|
48
|
-
render () {
|
|
49
|
-
return <div class="hr-radiobox-group">
|
|
50
|
-
{
|
|
51
|
-
this.$slots.default
|
|
52
|
-
}
|
|
53
|
-
</div>
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
<style scoped lang="less">
|
|
59
|
-
.hr-radiobox-group {
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-wrap: wrap;
|
|
62
|
-
justify-content: flex-start;
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import RadioboxItem from './data'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
name: 'HrRadiobox',
|
|
6
|
-
inject: {
|
|
7
|
-
selfAdaption: {
|
|
8
|
-
from: 'selfAdaption',
|
|
9
|
-
default () {
|
|
10
|
-
return false
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
divideeQually: {
|
|
14
|
-
from: 'divideeQually',
|
|
15
|
-
default () {
|
|
16
|
-
return 3
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
margin: {
|
|
20
|
-
from: 'margin',
|
|
21
|
-
default () {
|
|
22
|
-
return 12
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
marginBottom: {
|
|
26
|
-
from: 'marginBottom',
|
|
27
|
-
default () {
|
|
28
|
-
return this.margin
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
props: {
|
|
33
|
-
index: {
|
|
34
|
-
type: Number,
|
|
35
|
-
default () {
|
|
36
|
-
return 0
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
value: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default () {
|
|
42
|
-
return false
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
label: {
|
|
46
|
-
type: String,
|
|
47
|
-
default () {
|
|
48
|
-
return '暂无'
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
disabled: { // 禁用
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default () {
|
|
54
|
-
return false
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
data () {
|
|
59
|
-
return {
|
|
60
|
-
radioboxItem: new RadioboxItem(),
|
|
61
|
-
selfModel: false
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
computed: {
|
|
65
|
-
// 中间层
|
|
66
|
-
model: {
|
|
67
|
-
get () {
|
|
68
|
-
return this.isGroup ? this._radioboxGroup.value : this.value
|
|
69
|
-
},
|
|
70
|
-
set (val) {
|
|
71
|
-
if (this.isGroup) {
|
|
72
|
-
this.dispatch('HrRadioboxGroup', 'input', [val])
|
|
73
|
-
} else {
|
|
74
|
-
this.$emit('input', val)
|
|
75
|
-
this.selfModel = val
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
//是否有group
|
|
80
|
-
isGroup () {
|
|
81
|
-
let parent = this.$parent
|
|
82
|
-
while (parent) {
|
|
83
|
-
if (parent.$options.name !== 'HrRadioboxGroup') {
|
|
84
|
-
parent = parent.$parent
|
|
85
|
-
} else {
|
|
86
|
-
this._radioboxGroup = parent
|
|
87
|
-
return true
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return false
|
|
91
|
-
},
|
|
92
|
-
isChecked () {
|
|
93
|
-
return this.model === this.label
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
methods: {
|
|
97
|
-
// 修改父组件数组
|
|
98
|
-
dispatch (componentName, eventName, params) {
|
|
99
|
-
let parent = this.$parent || this.$root
|
|
100
|
-
let name = parent.$options.name
|
|
101
|
-
|
|
102
|
-
while (parent && (!name || name !== componentName)) {
|
|
103
|
-
(parent = parent.$parent) && (name = parent.$options.name)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
parent && parent.$emit.apply(parent, [eventName].concat(params))
|
|
107
|
-
},
|
|
108
|
-
handleChange () {
|
|
109
|
-
this.setModel()
|
|
110
|
-
this.$emit('change', this.model)
|
|
111
|
-
this.$nextTick(() => {
|
|
112
|
-
this.dispatch('HrRadioboxGroup', 'change', this._radioboxGroup.value)
|
|
113
|
-
})
|
|
114
|
-
},
|
|
115
|
-
setModel () {
|
|
116
|
-
this.model = this.isChecked ? null : this.label
|
|
117
|
-
},
|
|
118
|
-
getIndex () {
|
|
119
|
-
return this.$parent.$children.indexOf(this)
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
render () {
|
|
123
|
-
const { value, label, selfAdaption, divideeQually, margin, marginBottom } = this
|
|
124
|
-
const index = this.getIndex()
|
|
125
|
-
this.radioboxItem.init({
|
|
126
|
-
value,
|
|
127
|
-
label,
|
|
128
|
-
selfAdaption,
|
|
129
|
-
divideeQually,
|
|
130
|
-
margin,
|
|
131
|
-
marginBottom,
|
|
132
|
-
index,
|
|
133
|
-
vm: this,
|
|
134
|
-
})
|
|
135
|
-
return <div
|
|
136
|
-
onClick={this.handleChange}
|
|
137
|
-
index={index}
|
|
138
|
-
style={{
|
|
139
|
-
width: this.radioboxItem.width,
|
|
140
|
-
marginRight: this.radioboxItem.marginRight,
|
|
141
|
-
marginBottom: this.radioboxItem.marginBottom,
|
|
142
|
-
}}
|
|
143
|
-
class={[
|
|
144
|
-
'hr-radiobox',
|
|
145
|
-
'ellipsis',
|
|
146
|
-
this.isChecked && 'checked',
|
|
147
|
-
]}>
|
|
148
|
-
{label}
|
|
149
|
-
</div>
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
</script>
|
|
153
|
-
|
|
154
|
-
<style scoped lang="less">
|
|
155
|
-
.ellipsis {
|
|
156
|
-
overflow: hidden;
|
|
157
|
-
white-space: nowrap;
|
|
158
|
-
text-overflow: ellipsis;
|
|
159
|
-
}
|
|
160
|
-
.hr-radiobox {
|
|
161
|
-
height: 28px;
|
|
162
|
-
border-radius: 8px;
|
|
163
|
-
box-sizing: border-box;
|
|
164
|
-
background: #f7f8fa;
|
|
165
|
-
text-align: center;
|
|
166
|
-
line-height: 27px;
|
|
167
|
-
color: #03050d;
|
|
168
|
-
font-size: 12px;
|
|
169
|
-
padding: 0 8px;
|
|
170
|
-
position: relative;
|
|
171
|
-
&.checked {
|
|
172
|
-
background: rgba(121, 114, 254, 0.08);
|
|
173
|
-
color: #7972fe;
|
|
174
|
-
&::after {
|
|
175
|
-
content: " ";
|
|
176
|
-
position: absolute;
|
|
177
|
-
left: 0;
|
|
178
|
-
top: 0;
|
|
179
|
-
width: calc(200% - 2px);
|
|
180
|
-
height: calc(200% - 2px);
|
|
181
|
-
border: 1px solid #7972fe;
|
|
182
|
-
border-radius: 16px;
|
|
183
|
-
box-sizing: border-box;
|
|
184
|
-
-webkit-transform-origin: 0 0;
|
|
185
|
-
transform-origin: 0 0;
|
|
186
|
-
-webkit-transform: scale(0.5);
|
|
187
|
-
transform: scale(0.5);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
</style>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="hr-rate">
|
|
3
|
-
<van-rate v-bind="$attrs"
|
|
4
|
-
v-on="$listeners" />
|
|
5
|
-
<span class="score-tips"
|
|
6
|
-
v-if="showText">{{ getScoreLabel($attrs.value) }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
// 二次封装van-rate组件 支持showText功能
|
|
13
|
-
name: 'HrRate',
|
|
14
|
-
props: {
|
|
15
|
-
showText: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: false
|
|
18
|
-
},
|
|
19
|
-
texts: {
|
|
20
|
-
type: Array,
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
methods: {
|
|
24
|
-
getScoreLabel (score) {
|
|
25
|
-
let index = Math.round(score)
|
|
26
|
-
return this.texts[index - 1] || ''
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<style lang="less" scoped>
|
|
33
|
-
.hr-rate {
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
.score-tips {
|
|
37
|
-
font-size: 12px;
|
|
38
|
-
color: #b0b3bf;
|
|
39
|
-
margin-left: 12px;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
File without changes
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'HrReasonTextarea',
|
|
4
|
-
props: {
|
|
5
|
-
ruleForm: {
|
|
6
|
-
type: Object,
|
|
7
|
-
default () {
|
|
8
|
-
return {
|
|
9
|
-
reason: {
|
|
10
|
-
value: '',
|
|
11
|
-
rules: [{ required: true, message: `请填写申请理由` }],
|
|
12
|
-
placeholder: '112',
|
|
13
|
-
key: '加班原因',
|
|
14
|
-
maxlength: 500,
|
|
15
|
-
maxHeight: 240
|
|
16
|
-
},
|
|
17
|
-
output: {
|
|
18
|
-
value: '',
|
|
19
|
-
rules: [{ required: true, message: `请填写申请理由` }],
|
|
20
|
-
placeholder: '11',
|
|
21
|
-
key: '加班产出',
|
|
22
|
-
maxlength: 500,
|
|
23
|
-
maxHeight: 240
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
readonly: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default () {
|
|
31
|
-
return false
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
data () {
|
|
36
|
-
return {
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
created () {
|
|
40
|
-
},
|
|
41
|
-
methods: {
|
|
42
|
-
userInput (item, name, index) {
|
|
43
|
-
this.$emit('input', item, name, index)
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
render () {
|
|
47
|
-
const renderReasonTextarea = (item, name, index) => {
|
|
48
|
-
const {
|
|
49
|
-
rules = [],
|
|
50
|
-
placeholder = '请输入',
|
|
51
|
-
key = '原因',
|
|
52
|
-
maxlength = 500,
|
|
53
|
-
maxHeight = 240
|
|
54
|
-
} = item
|
|
55
|
-
|
|
56
|
-
return <div class="reason-textarea">
|
|
57
|
-
<div class="reason-textarea-title">
|
|
58
|
-
<span class="reason-textarea-title-order">{index + 1}</span>
|
|
59
|
-
<span class="reason-textarea-title-text">{key}</span>
|
|
60
|
-
</div>
|
|
61
|
-
<van-field
|
|
62
|
-
value={item.value}
|
|
63
|
-
onInput={(value) => {
|
|
64
|
-
item.value = value
|
|
65
|
-
this.userInput(name, item)
|
|
66
|
-
}}
|
|
67
|
-
rules={rules}
|
|
68
|
-
readonly={this.readonly}
|
|
69
|
-
error-message-align="right"
|
|
70
|
-
placeholder={placeholder}
|
|
71
|
-
class="input-textarea"
|
|
72
|
-
maxlength={maxlength}
|
|
73
|
-
type="textarea"
|
|
74
|
-
autosize={{ maxHeight }}
|
|
75
|
-
rows="2"
|
|
76
|
-
required />
|
|
77
|
-
</div>
|
|
78
|
-
}
|
|
79
|
-
return <div class="hr-reason-textarea">
|
|
80
|
-
{
|
|
81
|
-
Object.keys(this.ruleForm || {}).map((name, index) => {
|
|
82
|
-
return renderReasonTextarea(this.ruleForm[name], name, index)
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
</div>
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
</script>
|
|
89
|
-
|
|
90
|
-
<style scoped lang="less">
|
|
91
|
-
.hr-reason-textarea {
|
|
92
|
-
padding: 11px 16px;
|
|
93
|
-
.reason-textarea {
|
|
94
|
-
.reason-textarea-title {
|
|
95
|
-
display: flex;
|
|
96
|
-
.reason-textarea-title-order {
|
|
97
|
-
flex: 0 0 18px;
|
|
98
|
-
margin-top: 2px;
|
|
99
|
-
margin-right: 5px;
|
|
100
|
-
width: 18px;
|
|
101
|
-
height: 18px;
|
|
102
|
-
line-height: 18px;
|
|
103
|
-
text-align: center;
|
|
104
|
-
border-radius: 50%;
|
|
105
|
-
background: #f3f4f6;
|
|
106
|
-
border: 1px solid #9da4bb;
|
|
107
|
-
font-size: 12px;
|
|
108
|
-
color: #9da4bb;
|
|
109
|
-
}
|
|
110
|
-
.reason-textarea-title-text {
|
|
111
|
-
font-size: 15px;
|
|
112
|
-
font-weight: normal;
|
|
113
|
-
line-height: 22px;
|
|
114
|
-
color: #03050d;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/deep/ .input-textarea {
|
|
118
|
-
padding: 0 !important;
|
|
119
|
-
.van-cell__value {
|
|
120
|
-
background: none;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/deep/ .van-cell::after {
|
|
124
|
-
border-bottom: none;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
</style>
|
|
Binary file
|
|
Binary file
|