iov-pro-components 0.0.3
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/.eslintignore +5 -0
- package/.eslintrc.js +192 -0
- package/.gitignore +3 -0
- package/README.md +4 -0
- package/babel.config.js +5 -0
- package/docs/.vuepress/config.js +169 -0
- package/docs/.vuepress/styles/index.styl +62 -0
- package/docs/.vuepress/styles/palette.styl +20 -0
- package/docs/.vuepress/theme/enhanceApp.js +100 -0
- package/docs/.vuepress/theme/index.js +3 -0
- package/docs/README.md +13 -0
- package/docs/components/description.md +519 -0
- package/docs/components/dialog-select.md +91 -0
- package/docs/components/display.md +36 -0
- package/docs/components/enums.md +33 -0
- package/docs/components/icon.md +406 -0
- package/docs/components/link-group.md +39 -0
- package/docs/components/page-detail.md +48 -0
- package/docs/components/page-module.md +51 -0
- package/docs/components/pro-form.md +958 -0
- package/docs/components/pro-table.md +683 -0
- package/docs/components/request.md +44 -0
- package/docs/components/search-table.md +963 -0
- package/docs/components/space.md +35 -0
- package/docs/components/sub-title.md +24 -0
- package/docs/components/submit-module.md +24 -0
- package/docs/template/add.md +124 -0
- package/docs/template/confirm.md +28 -0
- package/docs/template/detail.md +240 -0
- package/docs/template/dialog.md +339 -0
- package/docs/template/list.md +464 -0
- package/docs/template/tabs-mini.md +32 -0
- package/docs/template/tabs.md +32 -0
- package/jsconfig.json +19 -0
- package/lib/iov-pro-components.css +1 -0
- package/lib/iov-pro-components.min.js +7 -0
- package/lib/postcss.config.js +8 -0
- package/package.json +75 -0
- package/patches/vue-server-renderer+2.7.16.patch +13 -0
- package/rollup.config.mjs +79 -0
- package/src/App.vue +103 -0
- package/src/main.js +33 -0
- package/src/packages/column-tooltip/index.js +7 -0
- package/src/packages/column-tooltip/src/main.vue +127 -0
- package/src/packages/description/index.js +7 -0
- package/src/packages/description/src/main.vue +375 -0
- package/src/packages/description/src/text.vue +103 -0
- package/src/packages/dialog-select/index.js +7 -0
- package/src/packages/dialog-select/src/main.vue +308 -0
- package/src/packages/display/index.js +7 -0
- package/src/packages/display/src/main.vue +44 -0
- package/src/packages/enums/index.js +7 -0
- package/src/packages/enums/src/main.vue +23 -0
- package/src/packages/export/index.js +7 -0
- package/src/packages/export/src/main.vue +316 -0
- package/src/packages/fixed-button-group/index.js +7 -0
- package/src/packages/fixed-button-group/src/main.vue +104 -0
- package/src/packages/form/index.js +7 -0
- package/src/packages/form/src/collapse.vue +149 -0
- package/src/packages/form/src/main.vue +1190 -0
- package/src/packages/form-collapse/index.js +7 -0
- package/src/packages/index.js +86 -0
- package/src/packages/link-group/index.js +7 -0
- package/src/packages/link-group/src/main.vue +52 -0
- package/src/packages/page-detail/index.js +7 -0
- package/src/packages/page-detail/src/main.vue +123 -0
- package/src/packages/page-module/index.js +7 -0
- package/src/packages/page-module/src/main.vue +56 -0
- package/src/packages/preview/index.js +7 -0
- package/src/packages/preview/src/eval-image-viewer.js +50 -0
- package/src/packages/preview/src/image-viewer.vue +366 -0
- package/src/packages/preview/src/main.vue +97 -0
- package/src/packages/request/index.js +7 -0
- package/src/packages/request/src/main.vue +125 -0
- package/src/packages/search-table/index.js +7 -0
- package/src/packages/search-table/src/inner-tabs.vue +237 -0
- package/src/packages/search-table/src/main.vue +472 -0
- package/src/packages/search-table/src/outer-tabs.vue +45 -0
- package/src/packages/search-table-inner-tabs/index.js +7 -0
- package/src/packages/search-table-outer-tabs/index.js +7 -0
- package/src/packages/space/index.js +7 -0
- package/src/packages/space/src/main.vue +74 -0
- package/src/packages/sub-title/index.js +7 -0
- package/src/packages/sub-title/src/main.vue +70 -0
- package/src/packages/submit-module/index.js +7 -0
- package/src/packages/submit-module/src/main.vue +67 -0
- package/src/packages/table/index.js +7 -0
- package/src/packages/table/src/filter.vue +89 -0
- package/src/packages/table/src/main.vue +668 -0
- package/src/packages/table/src/search.vue +90 -0
- package/src/packages/table/src/sort.vue +118 -0
- package/src/packages/theme/index.scss +15 -0
- package/src/packages/theme/src/column-tooltip.scss +23 -0
- package/src/packages/theme/src/common/color.scss +134 -0
- package/src/packages/theme/src/description.scss +56 -0
- package/src/packages/theme/src/dialog-select.scss +32 -0
- package/src/packages/theme/src/fixed-button-group.scss +25 -0
- package/src/packages/theme/src/form.scss +11 -0
- package/src/packages/theme/src/link-group.scss +43 -0
- package/src/packages/theme/src/page-detail.scss +61 -0
- package/src/packages/theme/src/page-module.scss +46 -0
- package/src/packages/theme/src/preview.scss +67 -0
- package/src/packages/theme/src/search-table.scss +185 -0
- package/src/packages/theme/src/space.scss +12 -0
- package/src/packages/theme/src/sub-title.scss +47 -0
- package/src/packages/theme/src/submit-module.scss +13 -0
- package/src/packages/theme/src/table.scss +129 -0
- package/src/packages/theme/src/toolbar.scss +109 -0
- package/src/packages/toolbar/index.js +7 -0
- package/src/packages/toolbar/src/main.vue +126 -0
- package/src/packages/toolbar/src/setting.vue +217 -0
- package/src/packages/toolbar/src/style.vue +68 -0
- package/src/packages/toolbar/src/zoom.vue +65 -0
- package/src/router.js +83 -0
- package/src/utils/config-center.js +218 -0
- package/src/utils/function-eval.js +84 -0
- package/src/utils/index.js +104 -0
- package/src/views/column-tooltip.vue +37 -0
- package/src/views/components/OtherSelect.vue +18 -0
- package/src/views/description.vue +60 -0
- package/src/views/detail.vue +146 -0
- package/src/views/directive/number.js +82 -0
- package/src/views/enums.vue +22 -0
- package/src/views/export.vue +9 -0
- package/src/views/form-collapse.vue +185 -0
- package/src/views/form.vue +402 -0
- package/src/views/link-group.vue +16 -0
- package/src/views/preview.vue +33 -0
- package/src/views/request.vue +56 -0
- package/src/views/search-table.vue +297 -0
- package/src/views/table.vue +145 -0
- package/src/views/toolbar.vue +30 -0
- package/vue.config.js +22 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { getComponentNames } from '@/utils/config-center'
|
|
3
|
+
import Display from '@/packages/display'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'IovProSearchTableOuterTabs',
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
tabName: 'tab-0'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
render() {
|
|
13
|
+
const [
|
|
14
|
+
Tabs,
|
|
15
|
+
TabPane
|
|
16
|
+
] = getComponentNames(['tabs', 'tab-pane'])
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div class='outer-tabs'>
|
|
20
|
+
<Tabs
|
|
21
|
+
value={this.tabName}
|
|
22
|
+
onInput={val => (this.tabName = val)}
|
|
23
|
+
class='outer-tabs__tabs'
|
|
24
|
+
>
|
|
25
|
+
{ // 遍历插槽的值
|
|
26
|
+
this.$slots.default
|
|
27
|
+
.filter(comp => !!comp.tag)
|
|
28
|
+
.map((comp, index) => {
|
|
29
|
+
const label = comp.componentOptions.propsData.title
|
|
30
|
+
return (
|
|
31
|
+
<TabPane
|
|
32
|
+
label={label}
|
|
33
|
+
name={`tab-${index}`}
|
|
34
|
+
>
|
|
35
|
+
<Display visible={this.tabName === `tab-${index}`}>{comp}</Display>
|
|
36
|
+
</TabPane>
|
|
37
|
+
)
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
</Tabs>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'IovProSpace',
|
|
4
|
+
props: {
|
|
5
|
+
// 互相间隔大小
|
|
6
|
+
space: {
|
|
7
|
+
type: [Number, String],
|
|
8
|
+
default: 0
|
|
9
|
+
},
|
|
10
|
+
// 间距方向 vertical: 垂直 horizontal: 水平
|
|
11
|
+
direction: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'vertical'
|
|
14
|
+
},
|
|
15
|
+
// 对其方式 如果水平对其,则值为align-items属性值,如果垂直对其,则值为justify-content属性值
|
|
16
|
+
align: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'start'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
/**
|
|
23
|
+
* 每个item的padding间隔
|
|
24
|
+
* @time 2024-11-01 14:10:17
|
|
25
|
+
*/
|
|
26
|
+
paddingSpace() {
|
|
27
|
+
// padding的间隔
|
|
28
|
+
const PADDING_SPACE = `${this.space}`
|
|
29
|
+
.toLowerCase()
|
|
30
|
+
.replace('px', '')
|
|
31
|
+
return `${PADDING_SPACE / 2}px`
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* space组件的样式
|
|
36
|
+
* @time 2024-11-01 14:20:48
|
|
37
|
+
*/
|
|
38
|
+
spaceStyle() {
|
|
39
|
+
return this.direction === 'horizontal'
|
|
40
|
+
? { 'align-items': this.align, margin: `0 -${this.paddingSpace}` }
|
|
41
|
+
: { 'justify-content': this.align, margin: `-${this.paddingSpace} 0` }
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* space每一项的样式
|
|
46
|
+
* @param {Number} index 当前索引
|
|
47
|
+
* @time 2024-11-01 14:16:00
|
|
48
|
+
*/
|
|
49
|
+
spaceItemStyle() {
|
|
50
|
+
// 根据水平或者竖设置样式
|
|
51
|
+
return this.direction === 'horizontal'
|
|
52
|
+
? { padding: `0 ${this.paddingSpace}` }
|
|
53
|
+
: { padding: `${this.paddingSpace} 0` }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
render() {
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
class={['iov-pro-space', this.direction].join(' ')}
|
|
60
|
+
style={this.spaceStyle}
|
|
61
|
+
>
|
|
62
|
+
{ // 遍历数据
|
|
63
|
+
this.$slots.default && this.$slots.default.filter(item => ![undefined].includes(item.tag)).map(item => (
|
|
64
|
+
<div
|
|
65
|
+
class='iov-pro-space__item'
|
|
66
|
+
style={this.spaceItemStyle}
|
|
67
|
+
>{item}</div>
|
|
68
|
+
))
|
|
69
|
+
}
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="iov-pro-sub-title">
|
|
3
|
+
<i
|
|
4
|
+
v-if="icon"
|
|
5
|
+
class="iov-pro-sub-title__icon"
|
|
6
|
+
:style="iconStyle"
|
|
7
|
+
/>
|
|
8
|
+
<div class="iov-pro-sub-title__name">{{ name }}</div>
|
|
9
|
+
<div
|
|
10
|
+
v-if="desc"
|
|
11
|
+
class="iov-pro-sub-title__desc"
|
|
12
|
+
>{{ desc }}</div>
|
|
13
|
+
<div class="iov-pro-sub-title__help">
|
|
14
|
+
<slot
|
|
15
|
+
v-if="$slots.help"
|
|
16
|
+
name="help"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { isUrl, isBase64Image } from '@/utils'
|
|
24
|
+
|
|
25
|
+
// icon
|
|
26
|
+
const ICONS = {
|
|
27
|
+
1: 'https://prod-common-public.obs-helf.cucloud.cn/user/c72a1000000000128483477',
|
|
28
|
+
2: 'https://prod-common-public.obs-helf.cucloud.cn/user/d9d41000000000128477129',
|
|
29
|
+
3: 'https://prod-common-public.obs-helf.cucloud.cn/user/aec71000000000128477151',
|
|
30
|
+
4: 'https://prod-common-public.obs-helf.cucloud.cn/user/48311000000000128477185',
|
|
31
|
+
5: 'https://prod-common-public.obs-helf.cucloud.cn/user/66dc1000000000128483607',
|
|
32
|
+
6: 'https://prod-common-public.obs-helf.cucloud.cn/user/0a3c1000000000128477284'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'IovProSubTitle',
|
|
37
|
+
props: {
|
|
38
|
+
name: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ''
|
|
41
|
+
},
|
|
42
|
+
icon: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ''
|
|
45
|
+
},
|
|
46
|
+
desc: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ''
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
iconStyle() {
|
|
53
|
+
if (!this.icon) {
|
|
54
|
+
return {}
|
|
55
|
+
}
|
|
56
|
+
// 如果传入的是链接
|
|
57
|
+
if (isUrl(this.icon)) {
|
|
58
|
+
return { backgroundImage: `url(${this.icon})` }
|
|
59
|
+
}
|
|
60
|
+
// 如果传入的是图片
|
|
61
|
+
if (isBase64Image(this.icon)) {
|
|
62
|
+
return { backgroundImage: `url(${this.icon})` }
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
backgroundImage: `url(${ICONS[this.icon]})`
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'IovProSubmitModule',
|
|
4
|
+
props: {
|
|
5
|
+
left: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: 228
|
|
8
|
+
},
|
|
9
|
+
right: {
|
|
10
|
+
type: [String, Number],
|
|
11
|
+
default: 20
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
computed: {
|
|
15
|
+
offsetStyle() {
|
|
16
|
+
return {
|
|
17
|
+
left: this.left + 'px',
|
|
18
|
+
right: this.right + 'px'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
mounted() {
|
|
23
|
+
this.setPreviousSiblingStyle()
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
/**
|
|
27
|
+
* 设置上一个相邻元素margin-bttom
|
|
28
|
+
* @time 2024-12-15 13:28:03
|
|
29
|
+
*/
|
|
30
|
+
setPreviousSiblingStyle() {
|
|
31
|
+
const containerElement = document.querySelector('.app-container')
|
|
32
|
+
const containerElementStyle = window.getComputedStyle(containerElement)
|
|
33
|
+
// 容器元素padding-bottom margin-bottom
|
|
34
|
+
const containerElementPaddingBottom = +containerElementStyle.paddingBottom.replace('px', '')
|
|
35
|
+
const containerElementMarginBottom = +containerElementStyle.marginBottom.replace('px', '')
|
|
36
|
+
|
|
37
|
+
// 获取当前组件的 DOM 元素
|
|
38
|
+
const currentElement = this.$el
|
|
39
|
+
const height = currentElement.offsetHeight - containerElementPaddingBottom - containerElementMarginBottom
|
|
40
|
+
// 获取当前组件的前一个兄弟元素
|
|
41
|
+
const previousSibling = currentElement.previousElementSibling
|
|
42
|
+
if (previousSibling) {
|
|
43
|
+
previousSibling.style.marginBottom = height + 'px'
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 如果当前组件的前一个兄弟元素不存在, 则获取当前组件的父元素
|
|
48
|
+
const parentElement = currentElement.parentElement
|
|
49
|
+
// 获取父元素的前一个兄弟元素
|
|
50
|
+
const previousParentSibling = parentElement ? parentElement.previousElementSibling : null
|
|
51
|
+
// 如果父元素的前一个兄弟元素存在
|
|
52
|
+
if (previousParentSibling) {
|
|
53
|
+
previousParentSibling.style.marginBottom = height + 'px'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
render() {
|
|
58
|
+
return (
|
|
59
|
+
<div class='iov-pro-submit-module' style={this.offsetStyle}>
|
|
60
|
+
{
|
|
61
|
+
this.$slots.default
|
|
62
|
+
}
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { getComponentNames } from '@/utils/config-center'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'IovProTableFilter',
|
|
6
|
+
props: {
|
|
7
|
+
column: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: () => ({})
|
|
10
|
+
},
|
|
11
|
+
placement: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'bottom-start'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
visible: false,
|
|
19
|
+
value: [],
|
|
20
|
+
isActived: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
/**
|
|
25
|
+
* 点击重置方法
|
|
26
|
+
* @time 2024-11-21 20:17:46
|
|
27
|
+
*/
|
|
28
|
+
onReset() {
|
|
29
|
+
// 先清空数据
|
|
30
|
+
this.value = []
|
|
31
|
+
// 标记当前不需要激活状态
|
|
32
|
+
this.isActived = false
|
|
33
|
+
// 抛出去重置方法
|
|
34
|
+
this.$emit('reset')
|
|
35
|
+
// 关闭popover
|
|
36
|
+
this.visible = false
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 点击搜索方法
|
|
41
|
+
* @time 2024-11-21 20:18:49
|
|
42
|
+
*/
|
|
43
|
+
onConfirm() {
|
|
44
|
+
// 如果啥都没输入,就不搜索
|
|
45
|
+
if (this.value.length === 0) return
|
|
46
|
+
// 标记当前需要激活状态
|
|
47
|
+
this.isActived = true
|
|
48
|
+
// 抛出去搜索方法
|
|
49
|
+
this.$emit('confirm', this.value)
|
|
50
|
+
// 关闭popover
|
|
51
|
+
this.visible = false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
render() {
|
|
55
|
+
const [Popover, CheckboxGroup, Checkbox, Button] = getComponentNames(['popover', 'checkbox-group', 'checkbox', 'button'])
|
|
56
|
+
return (
|
|
57
|
+
<Popover
|
|
58
|
+
value={this.visible}
|
|
59
|
+
placement={this.placement}
|
|
60
|
+
width='120'
|
|
61
|
+
trigger='click'
|
|
62
|
+
popper-class='iov-pro-table-filter__popper'
|
|
63
|
+
onInput={val => (this.visible = val)}
|
|
64
|
+
>
|
|
65
|
+
<i
|
|
66
|
+
slot='reference'
|
|
67
|
+
class={{
|
|
68
|
+
'iov-pro-table-filter__icon': true,
|
|
69
|
+
'is-actived': this.isActived,
|
|
70
|
+
'iov-icon-filter': true
|
|
71
|
+
}}
|
|
72
|
+
size='12px'
|
|
73
|
+
/>
|
|
74
|
+
<CheckboxGroup class='iov-pro-table-filter__checkbox-group' value={this.value} onInput={val => (this.value = val)}>
|
|
75
|
+
{ // 遍历数据
|
|
76
|
+
this.column.filters && this.column.filters.map(item => (
|
|
77
|
+
<Checkbox class='iov-pro-table-filter__checkbox' label={item.value} disabled={item.disabled}>{item.label}</Checkbox>
|
|
78
|
+
))
|
|
79
|
+
}
|
|
80
|
+
</CheckboxGroup>
|
|
81
|
+
<div class='iov-pro-table-filter__operation'>
|
|
82
|
+
<Button size='mini' onClick={this.onReset}>重置</Button>
|
|
83
|
+
<Button type='info' size='mini' onClick={this.onConfirm}>确定</Button>
|
|
84
|
+
</div>
|
|
85
|
+
</Popover>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</script>
|