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,86 @@
|
|
|
1
|
+
import * as config from '../utils/config-center'
|
|
2
|
+
|
|
3
|
+
import ColumnTooltip from './column-tooltip/index.js'
|
|
4
|
+
import Description from './description/index.js'
|
|
5
|
+
import DialogSelect from './dialog-select/index.js'
|
|
6
|
+
import Display from './display/index.js'
|
|
7
|
+
import Enums from './enums/index.js'
|
|
8
|
+
import Export from './export/index.js'
|
|
9
|
+
import FixedButtonGroup from './fixed-button-group/index.js'
|
|
10
|
+
import Form from './form/index.js'
|
|
11
|
+
import FormCollapse from './form-collapse/index.js'
|
|
12
|
+
import LinkGroup from './link-group/index.js'
|
|
13
|
+
import PageDetail from './page-detail/index.js'
|
|
14
|
+
import PageModule from './page-module/index.js'
|
|
15
|
+
import Preview from './preview/index.js'
|
|
16
|
+
import Request from './request/index.js'
|
|
17
|
+
import SearchTable from './search-table/index.js'
|
|
18
|
+
import SearchTableInnerTabs from './search-table-inner-tabs/index.js'
|
|
19
|
+
import SearchTableOuterTabs from './search-table-outer-tabs/index.js'
|
|
20
|
+
import Space from './space/index.js'
|
|
21
|
+
import SubTitle from './sub-title/index.js'
|
|
22
|
+
import SubmitModule from './submit-module/index.js'
|
|
23
|
+
import Table from './table/index.js'
|
|
24
|
+
import Toolbar from './toolbar/index.js'
|
|
25
|
+
|
|
26
|
+
import './theme/index.scss'
|
|
27
|
+
|
|
28
|
+
const components = [
|
|
29
|
+
ColumnTooltip,
|
|
30
|
+
Description,
|
|
31
|
+
DialogSelect,
|
|
32
|
+
Display,
|
|
33
|
+
Enums,
|
|
34
|
+
Export,
|
|
35
|
+
FixedButtonGroup,
|
|
36
|
+
Form,
|
|
37
|
+
FormCollapse,
|
|
38
|
+
LinkGroup,
|
|
39
|
+
PageDetail,
|
|
40
|
+
PageModule,
|
|
41
|
+
Preview,
|
|
42
|
+
Request,
|
|
43
|
+
SearchTable,
|
|
44
|
+
SearchTableInnerTabs,
|
|
45
|
+
SearchTableOuterTabs,
|
|
46
|
+
Space,
|
|
47
|
+
SubTitle,
|
|
48
|
+
SubmitModule,
|
|
49
|
+
Table,
|
|
50
|
+
Toolbar
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
const install = function(Vue, componentConfig) {
|
|
54
|
+
components.forEach(component => {
|
|
55
|
+
Vue.component(component.name, component)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
config.init(Vue, componentConfig)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
install,
|
|
63
|
+
version: '0.1.0',
|
|
64
|
+
ColumnTooltip,
|
|
65
|
+
Description,
|
|
66
|
+
DialogSelect,
|
|
67
|
+
Display,
|
|
68
|
+
Enums,
|
|
69
|
+
Export,
|
|
70
|
+
FixedButtonGroup,
|
|
71
|
+
Form,
|
|
72
|
+
FormCollapse,
|
|
73
|
+
LinkGroup,
|
|
74
|
+
PageDetail,
|
|
75
|
+
PageModule,
|
|
76
|
+
Preview,
|
|
77
|
+
Request,
|
|
78
|
+
SearchTable,
|
|
79
|
+
SearchTableInnerTabs,
|
|
80
|
+
SearchTableOuterTabs,
|
|
81
|
+
Space,
|
|
82
|
+
SubTitle,
|
|
83
|
+
SubmitModule,
|
|
84
|
+
Table,
|
|
85
|
+
Toolbar
|
|
86
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Space from '@/packages/space'
|
|
3
|
+
import { getComponentName } from '@/utils/config-center'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'IovProLinkGroup',
|
|
7
|
+
props: {
|
|
8
|
+
max: {
|
|
9
|
+
type: [Number, String],
|
|
10
|
+
default: 2
|
|
11
|
+
},
|
|
12
|
+
space: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
default: 12
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
render() {
|
|
18
|
+
// 默认插槽
|
|
19
|
+
const defaultSlots = this.$slots.default.filter(slot => slot.tag)
|
|
20
|
+
// 如果小于等于最大数量,直接喧嚷
|
|
21
|
+
if (defaultSlots.length <= this.max) {
|
|
22
|
+
return (
|
|
23
|
+
<div class='iov-pro-link-group'>
|
|
24
|
+
<Space space={this.space} direction='horizontal'>{defaultSlots}</Space>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
// 获取对应ui库的组件名
|
|
29
|
+
const Dropdown = getComponentName('dropdown')
|
|
30
|
+
const DropdownMenu = getComponentName('dropdown-menu')
|
|
31
|
+
const DropdownItem = getComponentName('dropdown-item')
|
|
32
|
+
// 只渲染前2个
|
|
33
|
+
return (
|
|
34
|
+
<div class='iov-pro-link-group'>
|
|
35
|
+
<Space space={this.space} direction='horizontal'>
|
|
36
|
+
{defaultSlots.slice(0, this.max)}
|
|
37
|
+
<Dropdown>
|
|
38
|
+
<i class='iov-pro-link-group__more iov-icon-vertical-more' />
|
|
39
|
+
<DropdownMenu slot='dropdown' class='iov-pro-link-group__dropdown-menu'>
|
|
40
|
+
{
|
|
41
|
+
defaultSlots
|
|
42
|
+
.slice(this.max)
|
|
43
|
+
.map(slot => <DropdownItem>{slot}</DropdownItem>)
|
|
44
|
+
}
|
|
45
|
+
</DropdownMenu>
|
|
46
|
+
</Dropdown>
|
|
47
|
+
</Space>
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="iov-pro-page-detail">
|
|
3
|
+
<div class="iov-pro-page-detail__head">
|
|
4
|
+
<i
|
|
5
|
+
v-if="$slots.icon"
|
|
6
|
+
class="iov-pro-page-detail__icon"
|
|
7
|
+
>
|
|
8
|
+
<slot name="icon" />
|
|
9
|
+
</i>
|
|
10
|
+
<i
|
|
11
|
+
v-else-if="icon"
|
|
12
|
+
class="iov-pro-page-detail__icon"
|
|
13
|
+
:style="iconStyle"
|
|
14
|
+
/>
|
|
15
|
+
<div class="iov-pro-page-detail__head-info">
|
|
16
|
+
<div class="iov-pro-page-detail__name">
|
|
17
|
+
<span class="name">{{ name }}</span>
|
|
18
|
+
<el-tag
|
|
19
|
+
v-if="statusText"
|
|
20
|
+
:type="statusType"
|
|
21
|
+
hit
|
|
22
|
+
size="mini"
|
|
23
|
+
>{{ statusText }}</el-tag>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="iov-pro-page-detail__desc">
|
|
26
|
+
<template v-if="desc && descList.length > 0">
|
|
27
|
+
<span
|
|
28
|
+
v-for="(item, index) in descList"
|
|
29
|
+
:key="index"
|
|
30
|
+
class="desc-item"
|
|
31
|
+
>{{ item }}</span>
|
|
32
|
+
</template>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="iov-pro-page-detail__help">
|
|
36
|
+
<template v-if="help && help.length > 0">
|
|
37
|
+
<span
|
|
38
|
+
v-for="(item, index) in help"
|
|
39
|
+
:key="index"
|
|
40
|
+
class="help-item"
|
|
41
|
+
>{{ item }}</span>
|
|
42
|
+
</template>
|
|
43
|
+
<slot
|
|
44
|
+
v-else-if="$slots.help"
|
|
45
|
+
name="help"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="iov-pro-page-detail__body">
|
|
50
|
+
<slot />
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import { isUrl, isBase64Image } from '@/utils'
|
|
57
|
+
|
|
58
|
+
// 当前icon
|
|
59
|
+
const ICONS = {
|
|
60
|
+
1: 'https://prod-common-public.obs-helf.cucloud.cn/user/60741000000000128483327',
|
|
61
|
+
2: 'https://prod-common-public.obs-helf.cucloud.cn/user/6dff1000000000128483405'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'IovProPageDetail',
|
|
66
|
+
props: {
|
|
67
|
+
// 名称
|
|
68
|
+
name: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ''
|
|
71
|
+
},
|
|
72
|
+
// icon
|
|
73
|
+
icon: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: ''
|
|
76
|
+
},
|
|
77
|
+
// 描述文本
|
|
78
|
+
desc: {
|
|
79
|
+
type: [String, Array],
|
|
80
|
+
default: ''
|
|
81
|
+
},
|
|
82
|
+
// 状态文本
|
|
83
|
+
statusText: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: ''
|
|
86
|
+
},
|
|
87
|
+
// 状态颜色 success|info|warning|danger
|
|
88
|
+
statusType: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: ''
|
|
91
|
+
},
|
|
92
|
+
// 右上角文本
|
|
93
|
+
help: {
|
|
94
|
+
type: Array,
|
|
95
|
+
default: () => { [] }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
computed: {
|
|
99
|
+
iconStyle() {
|
|
100
|
+
if (!this.icon) {
|
|
101
|
+
return {}
|
|
102
|
+
}
|
|
103
|
+
// 如果传入的是链接
|
|
104
|
+
if (isUrl(this.icon)) {
|
|
105
|
+
return { backgroundImage: `url(${this.icon})` }
|
|
106
|
+
}
|
|
107
|
+
// 如果传入的是图片
|
|
108
|
+
if (isBase64Image(this.icon)) {
|
|
109
|
+
return { backgroundImage: `url(${this.icon})` }
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
backgroundImage: `url(${ICONS[this.icon]})`
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
descList() {
|
|
116
|
+
if (typeof this.desc === 'string') {
|
|
117
|
+
return [this.desc]
|
|
118
|
+
}
|
|
119
|
+
return this.desc
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{ 'is-sub': isSub }"
|
|
4
|
+
class="iov-pro-page-module"
|
|
5
|
+
>
|
|
6
|
+
<div class="iov-pro-page-module__head">
|
|
7
|
+
<div
|
|
8
|
+
v-if="name"
|
|
9
|
+
class="iov-pro-page-module__name"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="showBack"
|
|
13
|
+
class="iov-pro-page-module__back iov-icon-left"
|
|
14
|
+
@click="$emit('back')"
|
|
15
|
+
/>
|
|
16
|
+
<span class="iov-pro-page-module__name-text">{{ name }}</span>
|
|
17
|
+
<div
|
|
18
|
+
v-if="$slots.suffix"
|
|
19
|
+
class="iov-pro-page-module__suffix"
|
|
20
|
+
>
|
|
21
|
+
<slot name="suffix" />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
v-if="$slots.help"
|
|
26
|
+
class="iov-pro-page-module__help"
|
|
27
|
+
>
|
|
28
|
+
<slot name="help" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="iov-pro-page-module__body">
|
|
32
|
+
<slot />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
// 新UI页面模块
|
|
39
|
+
export default {
|
|
40
|
+
name: 'IovProPageModule',
|
|
41
|
+
props: {
|
|
42
|
+
name: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ''
|
|
45
|
+
},
|
|
46
|
+
isSub: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
showBack: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import ImageViewer from './image-viewer.vue'
|
|
3
|
+
|
|
4
|
+
const ImageViewerConstructor = Vue.extend(ImageViewer)
|
|
5
|
+
|
|
6
|
+
export default function(propsData) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
/**
|
|
9
|
+
* 关闭方法
|
|
10
|
+
* @time 2025-02-28 11:30:51
|
|
11
|
+
*/
|
|
12
|
+
const onClose = () => {
|
|
13
|
+
// 销毁组件
|
|
14
|
+
imageViewerVm.$destroy()
|
|
15
|
+
// 展示全屏
|
|
16
|
+
if (window.hooks) {
|
|
17
|
+
window.hooks.tap(window.hooks.FULL_SCREEN, false)
|
|
18
|
+
}
|
|
19
|
+
// 标记当前已经关闭
|
|
20
|
+
resolve()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 先创建组件
|
|
24
|
+
const imageViewerVm = new ImageViewerConstructor({
|
|
25
|
+
propsData: {
|
|
26
|
+
...propsData,
|
|
27
|
+
onClose
|
|
28
|
+
}
|
|
29
|
+
}).$mount()
|
|
30
|
+
|
|
31
|
+
// 如果有自定义样式
|
|
32
|
+
if (propsData.style) {
|
|
33
|
+
// 遍历自定义的样式
|
|
34
|
+
Object.keys(propsData.style).forEach(key => {
|
|
35
|
+
imageViewerVm.$el.style[key] = propsData.style[key]
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 如果有自定义的样式
|
|
40
|
+
if (propsData.className) {
|
|
41
|
+
imageViewerVm.$el.className.push(propsData.className)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 展示全屏
|
|
45
|
+
if (window.hooks) {
|
|
46
|
+
window.hooks.tap(window.hooks.FULL_SCREEN, true)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|