@kyfe/hroa-ui 0.0.1
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/README.md +50 -0
- package/dist/demo.html +8 -0
- package/dist/hrui.common.js +3892 -0
- package/dist/hrui.common.js.map +1 -0
- package/dist/hrui.umd.js +3902 -0
- package/dist/hrui.umd.js.map +1 -0
- package/dist/hrui.umd.min.js +2 -0
- package/dist/hrui.umd.min.js.map +1 -0
- package/lib/hr-bottom-button/index.css +1 -0
- package/lib/hr-bottom-button/index.js +1 -0
- package/lib/hr-button/index.css +1 -0
- package/lib/hr-button/index.js +1 -0
- package/lib/hr-clipboard/index.css +1 -0
- package/lib/hr-clipboard/index.js +1 -0
- package/lib/hr-condition-filtrate/index.css +1 -0
- package/lib/hr-condition-filtrate/index.js +1 -0
- package/lib/hr-emotional-picture/index.css +1 -0
- package/lib/hr-emotional-picture/index.js +1 -0
- package/lib/hr-module-card/index.css +1 -0
- package/lib/hr-module-card/index.js +1 -0
- package/lib/hr-notice-bar/index.js +1 -0
- package/lib/hr-open-ks/index.css +1 -0
- package/lib/hr-open-ks/index.js +1 -0
- package/lib/hr-pager/index.css +1 -0
- package/lib/hr-pager/index.js +1 -0
- package/lib/hr-search-input/index.css +1 -0
- package/lib/hr-search-input/index.js +1 -0
- package/lib/hr-select/index.js +1 -0
- package/lib/hr-slide-pager/index.css +1 -0
- package/lib/hr-slide-pager/index.js +1 -0
- package/lib/hr-stack-image/index.css +1 -0
- package/lib/hr-stack-image/index.js +1 -0
- package/lib/hr-tab-nav/index.css +1 -0
- package/lib/hr-tab-nav/index.js +1 -0
- package/lib/hr-view-item/index.css +1 -0
- package/lib/hr-view-item/index.js +1 -0
- package/lib/index/index.css +1 -0
- package/lib/index/index.js +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +66 -0
- package/packages/hr-bottom-button/index.js +7 -0
- package/packages/hr-bottom-button/src/index.vue +85 -0
- package/packages/hr-button/index.js +13 -0
- package/packages/hr-button/src/hr-button.vue +39 -0
- package/packages/hr-clipboard/index.js +3 -0
- package/packages/hr-clipboard/src/icon.png +0 -0
- package/packages/hr-clipboard/src/main.vue +64 -0
- package/packages/hr-clipboard/src/util.js +9 -0
- package/packages/hr-condition-filtrate/enum/index.js +11 -0
- package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
- package/packages/hr-condition-filtrate/index.js +7 -0
- package/packages/hr-condition-filtrate/src/employee-choose/index.vue +101 -0
- package/packages/hr-condition-filtrate/src/index.vue +246 -0
- package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +167 -0
- package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +102 -0
- package/packages/hr-condition-filtrate/src/single-choose/index.vue +144 -0
- package/packages/hr-condition-filtrate/src/text-input/index.vue +60 -0
- package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +154 -0
- package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
- package/packages/hr-condition-filtrate/src/time-selector/index.vue +380 -0
- package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +30 -0
- package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +213 -0
- package/packages/hr-emotional-picture/index.js +7 -0
- package/packages/hr-emotional-picture/src/index.vue +66 -0
- 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-module-card/index.js +13 -0
- package/packages/hr-module-card/src/index.vue +132 -0
- package/packages/hr-module-card//346/250/241/345/235/227/345/215/241/347/211/207/347/273/204/344/273/266.md +29 -0
- package/packages/hr-notice-bar/index.js +7 -0
- package/packages/hr-notice-bar/src/bem.js +38 -0
- package/packages/hr-notice-bar/src/index.js +52 -0
- package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +3 -0
- package/packages/hr-open-ks/index.js +3 -0
- package/packages/hr-open-ks/src/icon.png +0 -0
- package/packages/hr-open-ks/src/main.vue +85 -0
- package/packages/hr-open-ks/src/util.js +31 -0
- 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 +7 -0
- package/packages/hr-pager/src/index.vue +95 -0
- 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-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 +8 -0
- package/packages/hr-search-input/src/index.vue +144 -0
- package/packages/hr-select/index.js +3 -0
- package/packages/hr-select/src/main.vue +62 -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 +59 -0
- 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 +7 -0
- package/packages/hr-slide-pager/src/index.vue +371 -0
- 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-stack-image/index.js +3 -0
- package/packages/hr-stack-image/src/main.vue +77 -0
- 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 +8 -0
- package/packages/hr-tab-nav/src/index.vue +96 -0
- package/packages/hr-view-item/index.js +13 -0
- package/packages/hr-view-item/src/index.vue +89 -0
- 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 +53 -0
- package/packages/utils/directive.js +58 -0
- package/packages/utils/index.js +73 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : HR-OA-KTS 黄强 670604@ky-tech.com.cn
|
|
3
|
+
* @Date : 2024-02-28 19:11:32
|
|
4
|
+
* @Description :
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import hrViewItem from './src/index.vue'
|
|
8
|
+
|
|
9
|
+
hrViewItem.install = function (Vue) {
|
|
10
|
+
Vue.component(hrViewItem.name, hrViewItem);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default hrViewItem;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author : HR-OA-KTS 黄强 670604@ky-tech.com.cn
|
|
3
|
+
* @Date : 2023-08-23 19:07:30
|
|
4
|
+
* @Description :
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div class="hr-view-info-item">
|
|
8
|
+
<div class="label">
|
|
9
|
+
<slot name="prefix"></slot>
|
|
10
|
+
<span>{{ label }}</span>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="content">
|
|
13
|
+
<template v-if="hasValue()">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else-if="showDefaultValue">
|
|
17
|
+
<span> - </span>
|
|
18
|
+
</template>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'hr-view-item',
|
|
26
|
+
props: {
|
|
27
|
+
label: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
value: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ''
|
|
34
|
+
},
|
|
35
|
+
// 是否显示默认值 -
|
|
36
|
+
showDefaultValue: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data () {
|
|
42
|
+
return {
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
created () {
|
|
46
|
+
},
|
|
47
|
+
mounted () {
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
// 是否传递有效插槽值
|
|
51
|
+
hasValue () {
|
|
52
|
+
const defaultSlots = this.$slots.default
|
|
53
|
+
if (!defaultSlots) return false
|
|
54
|
+
// 插槽是否传递文本
|
|
55
|
+
let soltText = defaultSlots[0].text
|
|
56
|
+
if (soltText) {
|
|
57
|
+
// 处理自动转义的 /n 换行字符
|
|
58
|
+
soltText = soltText.trim()
|
|
59
|
+
}
|
|
60
|
+
// 插槽是否传递dom
|
|
61
|
+
const soltTag = defaultSlots[0].tag
|
|
62
|
+
|
|
63
|
+
return soltText || soltTag
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
computed: {
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style lang="less" scoped>
|
|
72
|
+
.hr-view-info-item {
|
|
73
|
+
display: flex;
|
|
74
|
+
line-height: 28px;
|
|
75
|
+
.label,
|
|
76
|
+
.content {
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
font-weight: normal;
|
|
79
|
+
}
|
|
80
|
+
.label {
|
|
81
|
+
min-width: 86px;
|
|
82
|
+
color: #6e6d72;
|
|
83
|
+
}
|
|
84
|
+
.content {
|
|
85
|
+
color: #03050d;
|
|
86
|
+
word-break: break-word;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : HR-OA-KTS 黄强 670604@ky-tech.com.cn
|
|
3
|
+
* @Date : 2023-11-07 16:54:33
|
|
4
|
+
* @Description :
|
|
5
|
+
*/
|
|
6
|
+
// 引入组件
|
|
7
|
+
import hrButton from "./hr-button";
|
|
8
|
+
import hrModuleCard from "./hr-module-card";
|
|
9
|
+
import hrViewItem from "./hr-view-item";
|
|
10
|
+
import hrStackImage from './hr-stack-image'
|
|
11
|
+
import HrOpenKS from './hr-open-ks/index'
|
|
12
|
+
import HrClipboard from './hr-clipboard/index'
|
|
13
|
+
import HrSelect from './hr-select/index'
|
|
14
|
+
|
|
15
|
+
// 存储组件列表
|
|
16
|
+
const components = [
|
|
17
|
+
hrButton,
|
|
18
|
+
hrModuleCard,
|
|
19
|
+
hrViewItem,
|
|
20
|
+
hrStackImage,
|
|
21
|
+
HrOpenKS,
|
|
22
|
+
HrClipboard,
|
|
23
|
+
HrSelect
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
// 定义install方法,接受vue作为参数
|
|
27
|
+
const install = function (Vue) {
|
|
28
|
+
|
|
29
|
+
// 判断是否安装过了
|
|
30
|
+
if (install.installed) return;
|
|
31
|
+
|
|
32
|
+
// 遍历注册全局组件
|
|
33
|
+
components.forEach((component) => {
|
|
34
|
+
Vue.component(component.name, component);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// 判断是否直接引入文件
|
|
39
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
40
|
+
install(window.Vue);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default install
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
hrButton,
|
|
47
|
+
hrModuleCard,
|
|
48
|
+
hrViewItem,
|
|
49
|
+
hrStackImage,
|
|
50
|
+
HrOpenKS,
|
|
51
|
+
HrClipboard,
|
|
52
|
+
HrSelect
|
|
53
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自定义指令工具
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// 拖拽元素自定义指令
|
|
6
|
+
export const draggable = {
|
|
7
|
+
bind (el) {
|
|
8
|
+
let isDragging = false
|
|
9
|
+
|
|
10
|
+
let offset = { x: 0, y: 0 }
|
|
11
|
+
let start = { x: 0, y: 0 }
|
|
12
|
+
|
|
13
|
+
el.addEventListener('touchstart', touchstart, false)
|
|
14
|
+
el.addEventListener('touchmove', touchmove, false)
|
|
15
|
+
el.addEventListener('touchend', touchend, false)
|
|
16
|
+
|
|
17
|
+
function touchstart (event) {
|
|
18
|
+
isDragging = true
|
|
19
|
+
|
|
20
|
+
start.x = event.touches[0].clientX
|
|
21
|
+
start.y = event.touches[0].clientY
|
|
22
|
+
|
|
23
|
+
offset.x = el.offsetLeft
|
|
24
|
+
offset.y = el.offsetTop
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function touchmove (event) {
|
|
28
|
+
if (!isDragging) return
|
|
29
|
+
|
|
30
|
+
let x = offset.x + (event.touches[0].clientX - start.x)
|
|
31
|
+
let y = offset.y + (event.touches[0].clientY - start.y)
|
|
32
|
+
|
|
33
|
+
// 边界判断
|
|
34
|
+
if (x < 0) {
|
|
35
|
+
x = 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (x > document.documentElement.clientWidth - el.offsetWidth) {
|
|
39
|
+
x = document.documentElement.clientWidth - el.offsetWidth
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (y < 0) {
|
|
43
|
+
y = 0
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (y > document.documentElement.clientHeight - el.offsetHeight) {
|
|
47
|
+
y = document.documentElement.clientHeight - el.offsetHeight
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
el.style.left = x + 'px'
|
|
51
|
+
el.style.top = y + 'px'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function touchend () {
|
|
55
|
+
isDragging = false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 使用原生APP提供的localStorage
|
|
3
|
+
* @returns {Promise} 与浏览器localStorage的区别,这里返回的是promise
|
|
4
|
+
*/
|
|
5
|
+
export const ksStorage = {
|
|
6
|
+
setItem: (key, value) => {
|
|
7
|
+
if (window.$__ENV_WEB__) {
|
|
8
|
+
return sessionStorage.setItem(key, value)
|
|
9
|
+
}
|
|
10
|
+
return (
|
|
11
|
+
window.ks.callFunc &&
|
|
12
|
+
window.ks.callFunc({
|
|
13
|
+
method: 'storageSetItem',
|
|
14
|
+
params: {
|
|
15
|
+
key,
|
|
16
|
+
value
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
},
|
|
21
|
+
getItem: key => {
|
|
22
|
+
if (window.$__ENV_WEB__) {
|
|
23
|
+
return sessionStorage.getItem(key)
|
|
24
|
+
}
|
|
25
|
+
return (
|
|
26
|
+
window.ks.callFunc &&
|
|
27
|
+
window.ks.callFunc({
|
|
28
|
+
method: 'storageGetItem',
|
|
29
|
+
params: {
|
|
30
|
+
key
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
)
|
|
34
|
+
},
|
|
35
|
+
removeItem: key => {
|
|
36
|
+
return (
|
|
37
|
+
window.ks.callFunc &&
|
|
38
|
+
window.ks.callFunc({
|
|
39
|
+
method: 'storageSetItem',
|
|
40
|
+
params: {
|
|
41
|
+
key,
|
|
42
|
+
value: ''
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @desc 函数防抖---“立即执行版本” 和 “非立即执行版本” 的组合版本
|
|
51
|
+
* @param fu 需要执行的函数
|
|
52
|
+
* @param wait 延迟执行时间(毫秒)
|
|
53
|
+
* @param immediate---true 表立即执行,false 表非立即执行
|
|
54
|
+
**/
|
|
55
|
+
export const debounce = (fn, wait, immediate) => {
|
|
56
|
+
let timer = null
|
|
57
|
+
return function () {
|
|
58
|
+
const context = this
|
|
59
|
+
const args = arguments
|
|
60
|
+
if (timer) {
|
|
61
|
+
clearTimeout(timer)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (immediate) {
|
|
65
|
+
var callNow = !timer
|
|
66
|
+
timer = setTimeout(() => { timer = null }, wait)
|
|
67
|
+
if (callNow) fn.apply(context, args)
|
|
68
|
+
} else {
|
|
69
|
+
timer = setTimeout(() => fn.apply(context, args), wait)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|