btxui 1.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 +42 -0
- package/app.vue +162 -0
- package/assets/css/_main.js +73 -0
- package/assets/css/btx.min.css +1 -0
- package/assets/css/btx.mob.min.css +1 -0
- package/assets/css/btx.pad.min.css +1 -0
- package/assets/css/btx.webapp.min.css +1 -0
- package/assets/css/custom_fonts/iconfont.css +37 -0
- package/assets/css/custom_fonts/iconfont.eot +0 -0
- package/assets/css/custom_fonts/iconfont.svg +47 -0
- package/assets/css/custom_fonts/iconfont.ttf +0 -0
- package/assets/css/custom_fonts/iconfont.woff +0 -0
- package/assets/css/custom_fonts/iconfont.woff2 +0 -0
- package/assets/css/res-l.css +47 -0
- package/assets/css/res-m.css +47 -0
- package/assets/css/res-s.css +61 -0
- package/assets/custom_fonts/iconfont.css +37 -0
- package/assets/custom_fonts/iconfont.eot +0 -0
- package/assets/custom_fonts/iconfont.svg +47 -0
- package/assets/custom_fonts/iconfont.ttf +0 -0
- package/assets/custom_fonts/iconfont.woff +0 -0
- package/assets/custom_fonts/iconfont.woff2 +0 -0
- package/assets/js/Btx.js +196 -0
- package/assets/js/Utils.js +421 -0
- package/assets/js/fastclick.js +802 -0
- package/assets/js/lazy.min.js +2 -0
- package/assets/js/touchwipe.js +111 -0
- package/assets/server.js +8 -0
- package/assets/start_site_code_str.js +119 -0
- package/cdn/css/btx.min.css +1 -0
- package/cdn/css/btx.min.css.map +1 -0
- package/cdn/fonts/iconfont.ttf +0 -0
- package/cdn/fonts/iconfont.woff +0 -0
- package/cdn/fonts/iconfont.woff2 +0 -0
- package/components/BTXUI/app/app-wid.vue +182 -0
- package/components/BTXUI/btn/btn-wid.vue +128 -0
- package/components/BTXUI/carousel/carousel-wid.vue +138 -0
- package/components/BTXUI/checkbox/checkbox-wid.vue +72 -0
- package/components/BTXUI/confirm/confirm-wid.vue +279 -0
- package/components/BTXUI/content/content-checkbox-wid.vue +44 -0
- package/components/BTXUI/content/content-node-wid.vue +114 -0
- package/components/BTXUI/content/content-tag-wid.vue +25 -0
- package/components/BTXUI/content/content-wid.vue +254 -0
- package/components/BTXUI/core/anis/ani-fail.vue +46 -0
- package/components/BTXUI/core/anis/ani-loading.vue +32 -0
- package/components/BTXUI/core/anis/ani-notic.vue +47 -0
- package/components/BTXUI/core/anis/ani-success.vue +48 -0
- package/components/BTXUI/core/b-drag.vue +258 -0
- package/components/BTXUI/core/b-grid.vue +84 -0
- package/components/BTXUI/core/b-hot.vue +171 -0
- package/components/BTXUI/core/b-icon.vue +76 -0
- package/components/BTXUI/core/b-img.vue +84 -0
- package/components/BTXUI/core/b-input.vue +198 -0
- package/components/BTXUI/core/b-list.vue +276 -0
- package/components/BTXUI/core/b-text/doc.ts +9 -0
- package/components/BTXUI/core/b-text/index.vue +16 -0
- package/components/BTXUI/core/b-textarea.vue +58 -0
- package/components/BTXUI/core/b-video.vue +35 -0
- package/components/BTXUI/core/b-view/doc.ts +10 -0
- package/components/BTXUI/core/b-view/index.vue +20 -0
- package/components/BTXUI/core/b-webview.vue +20 -0
- package/components/BTXUI/core/lib/ChapterLink.js +49 -0
- package/components/BTXUI/core/lib/Search.vue +60 -0
- package/components/BTXUI/core/styles/doc.ts +55 -0
- package/components/BTXUI/core/styles/index.vue +98 -0
- package/components/BTXUI/core/styles/prestyles.ts +471 -0
- package/components/BTXUI/core/styles/theme.ts +29 -0
- package/components/BTXUI/drawer/drawer-wid.vue +165 -0
- package/components/BTXUI/drawer/title-tag-wid.vue +114 -0
- package/components/BTXUI/form/form-select-wid.vue +57 -0
- package/components/BTXUI/form/form-wid.vue +324 -0
- package/components/BTXUI/formPannel/form-pannel-wid.vue +133 -0
- package/components/BTXUI/imgsUpload/imgs-upload-wid.vue +149 -0
- package/components/BTXUI/index.js +83 -0
- package/components/BTXUI/pageFlip/page-flip-wid.vue +206 -0
- package/components/BTXUI/pannel/pannel-wid.vue +167 -0
- package/components/BTXUI/range/range-wid.vue +134 -0
- package/components/BTXUI/search/search-wid.vue +80 -0
- package/components/BTXUI/select/select-wid.vue +186 -0
- package/components/BTXUI/slider/slider-wid.vue +444 -0
- package/components/BTXUI/tab/tab-wid.vue +109 -0
- package/components/BTXUI/table/table-wid.vue +324 -0
- package/components/BTXUI/tag/tag-wid.vue +183 -0
- package/components/BTXUI/tags/tags-wid.vue +121 -0
- package/components/BTXUI/tooltip/tooltip-wid.vue +146 -0
- package/components/BTXUI/upload/upload-wid.vue +215 -0
- package/components/BTXUI/waterfall/waterfall-wid.vue +166 -0
- package/components/header-info.vue +167 -0
- package/composables/@types.ts +4 -0
- package/composables/api.ts +18 -0
- package/env.d.ts +5 -0
- package/main.js +6 -0
- package/nuxt.config.ts +51 -0
- package/package.json +23 -0
- package/pages/article.vue +16 -0
- package/pages/download.vue +50 -0
- package/pages/example/app_wid/app/data_demo.vue +9 -0
- package/pages/example/app_wid/app/download_demo.vue +9 -0
- package/pages/example/app_wid/app/list_demo.vue +11 -0
- package/pages/example/app_wid/app/system_demo.vue +9 -0
- package/pages/example/app_wid/app_wid_demo.vue +198 -0
- package/pages/example/app_wid/btn_wid_demo.vue +179 -0
- package/pages/example/app_wid/carousel_wid_demo.vue +152 -0
- package/pages/example/app_wid/checkbox_wid_demo.vue +65 -0
- package/pages/example/app_wid/confirm_wid_demo.vue +197 -0
- package/pages/example/app_wid/content_wid_demo.vue +369 -0
- package/pages/example/app_wid/drawer_wid_demo.vue +155 -0
- package/pages/example/app_wid/form_pannel_wid_demo.vue +338 -0
- package/pages/example/app_wid/form_wid_demo.vue +550 -0
- package/pages/example/app_wid/imgs_upload_wid_demo.vue +159 -0
- package/pages/example/app_wid/index.js +158 -0
- package/pages/example/app_wid/page_flip_wid_demo.vue +99 -0
- package/pages/example/app_wid/pannel_wid_demo.vue +177 -0
- package/pages/example/app_wid/range_wid_demo.vue +101 -0
- package/pages/example/app_wid/search_wid_demo.vue +75 -0
- package/pages/example/app_wid/select_wid_demo.vue +217 -0
- package/pages/example/app_wid/slider_wid_demo.vue +143 -0
- package/pages/example/app_wid/tab_wid_demo.vue +170 -0
- package/pages/example/app_wid/table_wid_demo.vue +377 -0
- package/pages/example/app_wid/tag_wid_demo.vue +133 -0
- package/pages/example/app_wid/tags_wid_demo.vue +143 -0
- package/pages/example/app_wid/tooltip_wid_demo.vue +117 -0
- package/pages/example/app_wid/upload_wid_demo.vue +123 -0
- package/pages/example/base_wid/b_drag_demo.vue +159 -0
- package/pages/example/base_wid/b_grid_demo.vue +225 -0
- package/pages/example/base_wid/b_hot_demo.vue +135 -0
- package/pages/example/base_wid/b_icon_demo.vue +80 -0
- package/pages/example/base_wid/b_img_demo.vue +95 -0
- package/pages/example/base_wid/b_input_demo.vue +171 -0
- package/pages/example/base_wid/b_list_demo.vue +241 -0
- package/pages/example/base_wid/b_style_demo.vue +928 -0
- package/pages/example/base_wid/b_text_demo.vue +36 -0
- package/pages/example/base_wid/b_textarea_demo.vue +64 -0
- package/pages/example/base_wid/b_video_demo.vue +42 -0
- package/pages/example/base_wid/b_view_demo.vue +36 -0
- package/pages/example/base_wid/index.js +76 -0
- package/pages/example/content.js +49 -0
- package/pages/example/global_style/animation.vue +197 -0
- package/pages/example/global_style/color.vue +134 -0
- package/pages/example/global_style/decoration.vue +546 -0
- package/pages/example/global_style/icon.vue +345 -0
- package/pages/example/global_style/index.js +52 -0
- package/pages/example/global_style/layout.vue +846 -0
- package/pages/example/global_style/special.vue +37 -0
- package/pages/example/global_style/table.vue +298 -0
- package/pages/example/global_style/text.vue +159 -0
- package/pages/index.vue +29 -0
- package/pages/level_widget.vue +11 -0
- package/pages/start.vue +200 -0
- package/plugins/index.ts +2 -0
- package/public/favicon.gif +0 -0
- package/public/fonts/iconfont.ttf +0 -0
- package/public/fonts/iconfont.woff +0 -0
- package/public/fonts/iconfont.woff2 +0 -0
- package/public/img/banner.jpg +0 -0
- package/public/img/banner2.jpg +0 -0
- package/public/img/bg_pattern.png +0 -0
- package/public/img/btx.jpg +0 -0
- package/public/img/btx_ui.jpg +0 -0
- package/public/img/dir.png +0 -0
- package/public/img/f.png +0 -0
- package/public/img/head.jpg +0 -0
- package/public/img/head2.jpg +0 -0
- package/public/img/home_ico.png +0 -0
- package/public/img/icons.svg +164 -0
- package/public/img/mechanism/b-style.png +0 -0
- package/public/img/mechanism/slider-wid.png +0 -0
- package/public/img/mechanism/upload-wid.png +0 -0
- package/public/img/transform_origin.png +0 -0
- package/sass/animation.scss +400 -0
- package/sass/btx.mob.scss +10 -0
- package/sass/btx.pad.scss +3 -0
- package/sass/btx.scss +22 -0
- package/sass/btx.webapp.scss +22 -0
- package/sass/colors.scss +65 -0
- package/sass/decoration.scss +220 -0
- package/sass/flex.scss +29 -0
- package/sass/icons.scss +100 -0
- package/sass/layout.scss +88 -0
- package/sass/reset.scss +111 -0
- package/sass/response/flex_mixin.scss +91 -0
- package/sass/response/layout_mixin.scss +227 -0
- package/sass/response/main.scss +59 -0
- package/sass/response/text_mixin.scss +65 -0
- package/sass/scroll.scss +100 -0
- package/sass/special.scss +13 -0
- package/sass/table.scss +103 -0
- package/sass/text.scss +86 -0
- package/sass/webpack.config.js +31 -0
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view styles="flex-column">
|
|
3
|
+
<template v-for="item of treeData">
|
|
4
|
+
<!--子级-->
|
|
5
|
+
<b-view v-if="item.sub_data" styles="mrg-b-2px">
|
|
6
|
+
<drawer-wid :ref="`drawer_${item.index_data.tag_data.id}`"
|
|
7
|
+
:tag-data="item.index_data.tag_data"
|
|
8
|
+
:spread="item.spread"
|
|
9
|
+
:arrow-fixed="false"
|
|
10
|
+
@on_title_enter="item.tooltip && $_show_tooltip(item.tooltip, $event)"
|
|
11
|
+
@on_title_move="item.tooltip && $_move_tooltip($event)"
|
|
12
|
+
@on_title_leave="item.tooltip && $_hide_tooltip()"
|
|
13
|
+
@on_toggle="$_content_toggle">
|
|
14
|
+
<b-view styles="pad-l-3 pad-t-4px">
|
|
15
|
+
<!-- <content-node-wid :tree-data="item.sub_data"
|
|
16
|
+
:content-id="item.index_data.tag_data.id"
|
|
17
|
+
@on_tooltip_show="$_show_tooltip"
|
|
18
|
+
@on_tooltip_move="$_move_tooltip"
|
|
19
|
+
@on_tooltip_hide="$_hide_tooltip"
|
|
20
|
+
@on_select="$_item_select"
|
|
21
|
+
@on_toggle="$_drawer_resize" /> -->
|
|
22
|
+
</b-view>
|
|
23
|
+
</drawer-wid>
|
|
24
|
+
</b-view>
|
|
25
|
+
|
|
26
|
+
<!--选项-->
|
|
27
|
+
<b-view v-else styles="mrg-b-2px" :key="item.index_data.tag_data.id">
|
|
28
|
+
<!--单选-->
|
|
29
|
+
<content-tag-wid v-if="item.index_data.tag_data.mode === 'radio'"
|
|
30
|
+
v-bind="item.index_data.tag_data"
|
|
31
|
+
v-model="item.index_data.selected"
|
|
32
|
+
@on_click="$_item_select"
|
|
33
|
+
@on_enter="item.tooltip && $_show_tooltip(item.tooltip, $event)"
|
|
34
|
+
@on_move="item.tooltip && $_move_tooltip($event)"
|
|
35
|
+
@on_leave="item.tooltip && $_hide_tooltip()" />
|
|
36
|
+
|
|
37
|
+
<!--多选-->
|
|
38
|
+
<content-checkbox-wid v-else-if="item.index_data.tag_data.mode === 'checkbox' && item.checkbox"
|
|
39
|
+
v-bind="item.index_data.tag_data"
|
|
40
|
+
v-model="item.index_data.selected"
|
|
41
|
+
@on_click="$_item_select"
|
|
42
|
+
@on_enter="item.tooltip && $_show_tooltip(item.tooltip, $event)"
|
|
43
|
+
@on_move="item.tooltip && $_move_tooltip($event)"
|
|
44
|
+
@on_leave="item.tooltip && $_hide_tooltip()" />
|
|
45
|
+
<b-view v-else
|
|
46
|
+
:styles="`flex max-w pad-h-1.4 pad-v-.5 round-sm color-${item.index_data.tag_data.colors.normal.text} bg-color-${item.index_data.tag_data.colors.normal.bg}`">
|
|
47
|
+
{{item.index_data.tag_data.text}}
|
|
48
|
+
</b-view>
|
|
49
|
+
</b-view>
|
|
50
|
+
</template>
|
|
51
|
+
</b-view>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
import BView from "@/components/BTXUI/core/b-view";
|
|
56
|
+
import DrawerWid from "@/components/BTXUI/drawer/drawer-wid"
|
|
57
|
+
import ContentTagWid from "./content-tag-wid"
|
|
58
|
+
import ContentCheckboxWid from "./content-checkbox-wid"
|
|
59
|
+
// import ContentNodeWid from "./content-node-wid";
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
name: "content-node-wid",
|
|
63
|
+
components: {
|
|
64
|
+
DrawerWid,
|
|
65
|
+
ContentTagWid,
|
|
66
|
+
ContentCheckboxWid,
|
|
67
|
+
// ContentNodeWid,
|
|
68
|
+
BView,
|
|
69
|
+
},
|
|
70
|
+
props: {
|
|
71
|
+
treeData: {
|
|
72
|
+
required: true,
|
|
73
|
+
type: Array
|
|
74
|
+
},
|
|
75
|
+
contentId: {
|
|
76
|
+
required: false,
|
|
77
|
+
type: [String, Number]
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
|
|
82
|
+
//透传数据选择
|
|
83
|
+
$_item_select(id, state){
|
|
84
|
+
this.$emit("on_select", id, state);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
//透传子级展开状态
|
|
88
|
+
$_content_toggle(state){
|
|
89
|
+
this.$emit("on_toggle", state, this.contentId);
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
//重置下级内容高度
|
|
93
|
+
$_drawer_resize(state, content_id){
|
|
94
|
+
this.$refs[`drawer_${content_id}`][0].comp_height();
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
//显示浮框
|
|
98
|
+
$_show_tooltip(text){
|
|
99
|
+
this.$emit("on_tooltip_show", text);
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
//移动浮框
|
|
103
|
+
$_move_tooltip(e){
|
|
104
|
+
this.$emit("on_tooltip_move", e);
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
//隐藏浮框
|
|
108
|
+
$_hide_tooltip(){
|
|
109
|
+
this.$emit("on_tooltip_hide");
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-hot @on_click="$_click"
|
|
3
|
+
@on_move="$emit('on_move', $event)"
|
|
4
|
+
@on_enter="$emit('on_enter', $event)"
|
|
5
|
+
@on_leave="$emit('on_leave', $event)"
|
|
6
|
+
:styles="`flex max-w pad-h-1.4 pad-v-.5 round-sm color-${tag_colors.normal.text} bg-color-${tag_colors.normal.bg}`"
|
|
7
|
+
:states="{
|
|
8
|
+
act: {
|
|
9
|
+
style: `bg-color-${tag_colors.act.bg} color-${tag_colors.act.text}`,
|
|
10
|
+
state: selected
|
|
11
|
+
}
|
|
12
|
+
}"
|
|
13
|
+
:hover="`bg-color-${tag_colors.hover.bg} color-${tag_colors.hover.text}`">
|
|
14
|
+
<b-text v-html="tag_text" />
|
|
15
|
+
</b-hot>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import TagWid from "@/components/BTXUI/tag/tag-wid"
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
extends: TagWid,
|
|
23
|
+
name: "content-tag-wid"
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view>
|
|
3
|
+
<!--提示框组件-->
|
|
4
|
+
<tooltip-wid ref="tooltip" v-bind="tooltipData" />
|
|
5
|
+
|
|
6
|
+
<!--目录结构组件-->
|
|
7
|
+
<content-node-wid :tree-data="tree_data"
|
|
8
|
+
@on_select="$_select"
|
|
9
|
+
@on_tooltip_show="$_show_tooltip"
|
|
10
|
+
@on_tooltip_move="$_move_tooltip"
|
|
11
|
+
@on_tooltip_hide="$_hide_tooltip" />
|
|
12
|
+
</b-view>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import BView from "@/components/BTXUI/core/b-view"
|
|
17
|
+
import TooltipWid from "@/components/BTXUI/tooltip/tooltip-wid"
|
|
18
|
+
import ContentNodeWid from "./content-node-wid"
|
|
19
|
+
|
|
20
|
+
const desc = ["该组件用于处理树形结构数据的可视化及交互操作。"],
|
|
21
|
+
extend = [],
|
|
22
|
+
dependent = ["tooltip-wid", "content-node-wid", "b-view"],
|
|
23
|
+
api = {
|
|
24
|
+
methods: [
|
|
25
|
+
{
|
|
26
|
+
name: "clear_selected",
|
|
27
|
+
ef: "清空所选数据",
|
|
28
|
+
params: "-",
|
|
29
|
+
return: "-"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
event: [
|
|
33
|
+
{
|
|
34
|
+
name: "on_select",
|
|
35
|
+
ef: "执行数据项点选",
|
|
36
|
+
params: "selected_data_id"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
init_data = `{
|
|
41
|
+
dataTree: [
|
|
42
|
+
{
|
|
43
|
+
id: "数据标识",
|
|
44
|
+
text: "数据标题",
|
|
45
|
+
tooltip: "悬停提示文本(支持超文本),缺省无提示",
|
|
46
|
+
checkbox: "是否显示复选框,缺省仅显示文字",
|
|
47
|
+
selected: "是否选中,缺省不选中",
|
|
48
|
+
children: "嵌套结构,可缺省",
|
|
49
|
+
spread: "是否展开子级,缺省关闭",
|
|
50
|
+
spread_fixed: "展开固定,禁止层级塌陷,缺省关闭",
|
|
51
|
+
},...
|
|
52
|
+
],
|
|
53
|
+
/* mode: "选择模式(默认"radio":单选、"checkbox":复选)" */,
|
|
54
|
+
/* colors: "(参照:tag-wid 组件 colors 入参)" */,
|
|
55
|
+
/* tooltipData: "(参照:tooltip-wid 组件入参)" */,
|
|
56
|
+
}`;
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: "content-wid",
|
|
60
|
+
introduce: { desc, extend, dependent, api, init_data },
|
|
61
|
+
components: {
|
|
62
|
+
BView,
|
|
63
|
+
ContentNodeWid,
|
|
64
|
+
TooltipWid
|
|
65
|
+
},
|
|
66
|
+
props: {
|
|
67
|
+
dataTree: {
|
|
68
|
+
required: true,
|
|
69
|
+
type: Array
|
|
70
|
+
},
|
|
71
|
+
mode: {
|
|
72
|
+
required: false,
|
|
73
|
+
type: String,
|
|
74
|
+
default: "radio"
|
|
75
|
+
},
|
|
76
|
+
colors: {
|
|
77
|
+
required: false,
|
|
78
|
+
type: Object,
|
|
79
|
+
default: ()=>{
|
|
80
|
+
return {
|
|
81
|
+
normal: {
|
|
82
|
+
text: "dgray",
|
|
83
|
+
bg: "none",
|
|
84
|
+
line: "none",
|
|
85
|
+
},
|
|
86
|
+
act: {
|
|
87
|
+
text: "blue",
|
|
88
|
+
bg: "none",
|
|
89
|
+
line: "none",
|
|
90
|
+
},
|
|
91
|
+
hover: {
|
|
92
|
+
text: "blue",
|
|
93
|
+
bg: "none",
|
|
94
|
+
line: "none",
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
tooltipData: {
|
|
100
|
+
required: false,
|
|
101
|
+
type: Object
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
data(){
|
|
105
|
+
return {
|
|
106
|
+
|
|
107
|
+
//单选数据
|
|
108
|
+
selected_data: "",
|
|
109
|
+
|
|
110
|
+
//多选数据
|
|
111
|
+
selected_datas: [],
|
|
112
|
+
|
|
113
|
+
//树形数据(视图渲染)
|
|
114
|
+
tree_data: [],
|
|
115
|
+
|
|
116
|
+
//展开数据(多级关联选择)
|
|
117
|
+
spread_data: [],
|
|
118
|
+
|
|
119
|
+
//索引数据(操作数据)
|
|
120
|
+
index_data: {}
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
computed: {
|
|
125
|
+
|
|
126
|
+
//悬浮提示框
|
|
127
|
+
tooltip(){
|
|
128
|
+
return this.$refs.tooltip;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
},
|
|
132
|
+
methods: {
|
|
133
|
+
|
|
134
|
+
//清空所选数据
|
|
135
|
+
clear_selected(){
|
|
136
|
+
const reset_ids = [];
|
|
137
|
+
if(this.mode === "radio") { //单选模式
|
|
138
|
+
this.selected_data && reset_ids.push(this.selected_data);
|
|
139
|
+
this.selected_data = "";
|
|
140
|
+
}else { //多选模式
|
|
141
|
+
this.selected_datas.forEach(id => {
|
|
142
|
+
reset_ids.push(id);
|
|
143
|
+
})
|
|
144
|
+
this.selected_datas = [];
|
|
145
|
+
}
|
|
146
|
+
reset_ids.forEach(id => {
|
|
147
|
+
this.index_data[id].selected = false;
|
|
148
|
+
})
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
//初始化数据
|
|
152
|
+
$_init_data(){
|
|
153
|
+
this.tree_data = this.$_gen_data(this.dataTree);
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
//构造数据
|
|
157
|
+
$_gen_data(tree_data, id_prefix=""){
|
|
158
|
+
return tree_data.map((data, i)=>{
|
|
159
|
+
let {id, text, tooltip, checkbox, children, selected, spread, spread_fixed} = data,
|
|
160
|
+
mode = this.mode,
|
|
161
|
+
colors = {...this.colors},
|
|
162
|
+
_id = id_prefix? `${id_prefix}_${i}`: i,
|
|
163
|
+
sub_data;
|
|
164
|
+
|
|
165
|
+
//初始化数据
|
|
166
|
+
if(selected){
|
|
167
|
+
if(mode === "checkbox" && checkbox){ //复选模式
|
|
168
|
+
this.selected_datas.push(id)
|
|
169
|
+
}else if(mode === "radio"){
|
|
170
|
+
this.selected_data = id;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
//下级折叠处理
|
|
175
|
+
if(children){
|
|
176
|
+
colors.act = {
|
|
177
|
+
text: colors.normal.text,
|
|
178
|
+
bg: colors.normal.bg,
|
|
179
|
+
line: colors.normal.line
|
|
180
|
+
}
|
|
181
|
+
if(spread_fixed){ //强制展开
|
|
182
|
+
spread = true;
|
|
183
|
+
mode = "radio"
|
|
184
|
+
}else{
|
|
185
|
+
mode = "checkbox"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const tag_data = {
|
|
190
|
+
...data,
|
|
191
|
+
mode,
|
|
192
|
+
colors
|
|
193
|
+
}, index_data = {
|
|
194
|
+
_id,
|
|
195
|
+
tag_data,
|
|
196
|
+
selected,
|
|
197
|
+
};
|
|
198
|
+
this.index_data[id] = index_data;
|
|
199
|
+
this.spread_data.push(index_data);
|
|
200
|
+
|
|
201
|
+
//下级递归数据处理
|
|
202
|
+
if(children) sub_data = this.$_gen_data(children, _id);
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
index_data,
|
|
206
|
+
spread,
|
|
207
|
+
tooltip,
|
|
208
|
+
checkbox,
|
|
209
|
+
sub_data
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
//执行选择
|
|
215
|
+
$_select(id, state){
|
|
216
|
+
if(this.mode === "radio"){ //单选数据
|
|
217
|
+
if(this.selected_data){
|
|
218
|
+
this.index_data[this.selected_data].selected = false;
|
|
219
|
+
}
|
|
220
|
+
this.selected_data = id;
|
|
221
|
+
this.$emit("on_select", this.selected_data);
|
|
222
|
+
}else if(this.mode === "checkbox"){ //多选数据
|
|
223
|
+
if(state){ //添加
|
|
224
|
+
this.selected_datas.push(id);
|
|
225
|
+
}else{ //移除
|
|
226
|
+
this.selected_datas.splice(this.selected_datas.findIndex((val)=>{
|
|
227
|
+
return val === id;
|
|
228
|
+
}), 1);
|
|
229
|
+
}
|
|
230
|
+
this.$emit("on_select", this.selected_datas);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
//显示浮框
|
|
235
|
+
$_show_tooltip(text){
|
|
236
|
+
this.tooltip.show(text);
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
//移动浮框
|
|
240
|
+
$_move_tooltip(e){
|
|
241
|
+
this.tooltip.set_pos(e.pageX, e.pageY);
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
//隐藏浮框
|
|
245
|
+
$_hide_tooltip(){
|
|
246
|
+
this.tooltip.hide();
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
},
|
|
250
|
+
mounted(){
|
|
251
|
+
this.$_init_data();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view styles="flex-5 t-f3">
|
|
3
|
+
<b-text class="ani-fail-part1" styles="w-3px h-1.7 rel l-2px bg-color-red round-sm"></b-text>
|
|
4
|
+
<b-text class="ani-fail-part2" styles="w-3px h-1.7 rel r-1px bg-color-red round-sm"></b-text>
|
|
5
|
+
</b-view>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import BView from "../b-view";
|
|
10
|
+
import BText from "../b-text";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: "ani-fail",
|
|
14
|
+
components: {
|
|
15
|
+
BView,
|
|
16
|
+
BText,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.ani-fail-part1{
|
|
23
|
+
animation: ani_fail_part1 .3s .7s;
|
|
24
|
+
animation-fill-mode: both;
|
|
25
|
+
}
|
|
26
|
+
.ani-fail-part2{
|
|
27
|
+
animation: ani_fail_part2 .5s 1s;
|
|
28
|
+
animation-fill-mode: both;
|
|
29
|
+
}
|
|
30
|
+
@keyframes ani_fail_part1 {
|
|
31
|
+
from {
|
|
32
|
+
transform: scale(0) rotate(45deg);
|
|
33
|
+
}
|
|
34
|
+
to {
|
|
35
|
+
transform: scale(1) rotate(45deg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
@keyframes ani_fail_part2 {
|
|
39
|
+
from {
|
|
40
|
+
transform: scale(0) rotate(-45deg);
|
|
41
|
+
}
|
|
42
|
+
to {
|
|
43
|
+
transform: scale(1) rotate(-45deg);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view styles="flex-5 t-f3">
|
|
3
|
+
<b-view class="ani-loading" styles="rel w-2.2 h-2.2 round"></b-view>
|
|
4
|
+
</b-view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import BView from "../b-view";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: "ani-loading",
|
|
12
|
+
components: {
|
|
13
|
+
BView,
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
.ani-loading {
|
|
20
|
+
animation: ani_rotate 1s linear infinite;
|
|
21
|
+
border: 3px solid #ddd;
|
|
22
|
+
border-left-color: #4085f3;
|
|
23
|
+
}
|
|
24
|
+
@keyframes ani_rotate {
|
|
25
|
+
from {
|
|
26
|
+
transform: rotate(0deg);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
transform: rotate(360deg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view styles="flex-5 t-f3 rotate-90">
|
|
3
|
+
<b-text class="ani-notic-part1" styles="w-3px h-3px bg-color-blue round"></b-text>
|
|
4
|
+
<b-text class="ani-notic-part2" styles="w-1.3 h-3px mrg-l-4px bg-color-blue round-sm"></b-text>
|
|
5
|
+
</b-view>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import BView from "../b-view";
|
|
10
|
+
import BText from "../b-text";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: "ani-notic",
|
|
14
|
+
components: {
|
|
15
|
+
BView,
|
|
16
|
+
BText,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.ani-notic-part1{
|
|
23
|
+
animation: ani_notic_part1 .3s .7s;
|
|
24
|
+
animation-fill-mode: both;
|
|
25
|
+
}
|
|
26
|
+
.ani-notic-part2{
|
|
27
|
+
animation: ani_notic_part2 .5s 1s;
|
|
28
|
+
animation-fill-mode: both;
|
|
29
|
+
transform-origin: left;
|
|
30
|
+
}
|
|
31
|
+
@keyframes ani_notic_part1 {
|
|
32
|
+
from {
|
|
33
|
+
transform: scale(0);
|
|
34
|
+
}
|
|
35
|
+
to {
|
|
36
|
+
transform: scale(1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
@keyframes ani_notic_part2 {
|
|
40
|
+
from {
|
|
41
|
+
transform: scaleX(0);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
transform: scaleX(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view styles="flex-5 transform-translateY(.9rem)rotate(45deg)">
|
|
3
|
+
<b-text class="ani-success-part1" styles="w-1 h-3px bg-color-green round-sm"></b-text>
|
|
4
|
+
<b-text class="ani-success-part2" styles="w-1.7 h-3px bg-color-green round-sm rel t-1px l-f1px"></b-text>
|
|
5
|
+
</b-view>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import BView from "../b-view";
|
|
10
|
+
import BText from "../b-text";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: "ani-success",
|
|
14
|
+
components: {
|
|
15
|
+
BView,
|
|
16
|
+
BText,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.ani-success-part1{
|
|
23
|
+
animation: ani_success_part1 .3s .7s;
|
|
24
|
+
animation-fill-mode: both;
|
|
25
|
+
transform-origin: left;
|
|
26
|
+
}
|
|
27
|
+
.ani-success-part2{
|
|
28
|
+
animation: ani_success_part2 .5s 1s;
|
|
29
|
+
animation-fill-mode: both;
|
|
30
|
+
transform-origin: left;
|
|
31
|
+
}
|
|
32
|
+
@keyframes ani_success_part1 {
|
|
33
|
+
from {
|
|
34
|
+
transform: scaleX(0);
|
|
35
|
+
}
|
|
36
|
+
to {
|
|
37
|
+
transform: scaleX(1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
@keyframes ani_success_part2 {
|
|
41
|
+
from {
|
|
42
|
+
transform: scaleY(0) rotate(-90deg);
|
|
43
|
+
}
|
|
44
|
+
to {
|
|
45
|
+
transform: scaleY(1) rotate(-90deg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</style>
|