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,258 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{...computed_style, cursor: 'move', visibility: drag_state? 'hidden': 'visible', position: freeDrag? 'absolute': '', left: `${move_pos.x}px`, top: `${move_pos.y}px`}"
|
|
3
|
+
:draggable="!freeDrag"
|
|
4
|
+
@mousedown = "$_act_target" @touchstart = "$_act_target">
|
|
5
|
+
<div :style="{pointerEvents: `${drag_state? 'auto': 'none'}`}">
|
|
6
|
+
<slot/>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
let desc = ["该组件用于包裹元素以实现拖拽效果。"],
|
|
14
|
+
extend = ["b-style"],
|
|
15
|
+
dependent = [],
|
|
16
|
+
api = {
|
|
17
|
+
event: [
|
|
18
|
+
{
|
|
19
|
+
name: "on_drag_start",
|
|
20
|
+
ef: "开始拖拽",
|
|
21
|
+
params: "event"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "on_drag_move",
|
|
25
|
+
ef: "拖拽移动",
|
|
26
|
+
params: "event"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "on_drag_end",
|
|
30
|
+
ef: "结束拖拽",
|
|
31
|
+
params: "event"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "on_drag_over",
|
|
35
|
+
ef: "拖拽预备放入",
|
|
36
|
+
params: "event"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "on_drag_leave",
|
|
40
|
+
ef: "拖拽离开容器",
|
|
41
|
+
params: "event"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "on_drop",
|
|
45
|
+
ef: "完成放入",
|
|
46
|
+
params: "{you, me}, event"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "on_move",
|
|
50
|
+
ef: "拖动位移",
|
|
51
|
+
params: "move_pos, move_area"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
init_data = `{
|
|
56
|
+
/* styles: "(参照:b-style 组件入参)" */,
|
|
57
|
+
/* dataInfo: "绑定数据,缺省则传递元素自身" */,
|
|
58
|
+
/* dragStart: "拖拽起始状态样式值" */,
|
|
59
|
+
/* dragOver: "拖拽预备放入状态样式值" */,
|
|
60
|
+
/* freeDrag: "自由拖动,默认为 false" */,
|
|
61
|
+
}`;
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
name: "b-drag",
|
|
65
|
+
introduce: { desc, extend, dependent, api, init_data },
|
|
66
|
+
props: {
|
|
67
|
+
dataInfo: {
|
|
68
|
+
type: Object,
|
|
69
|
+
required: false,
|
|
70
|
+
default: ()=>{
|
|
71
|
+
return {}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
dragStart: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: false,
|
|
77
|
+
default: ""
|
|
78
|
+
},
|
|
79
|
+
dragOver: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: false,
|
|
82
|
+
default: "bg-color-neutral color-rgba(20,20,20,.7) round-sm"
|
|
83
|
+
},
|
|
84
|
+
freeDrag: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
data(){
|
|
90
|
+
return {
|
|
91
|
+
|
|
92
|
+
//拖拽状态
|
|
93
|
+
drag_state: false,
|
|
94
|
+
|
|
95
|
+
//拖动状态
|
|
96
|
+
move_state: false,
|
|
97
|
+
|
|
98
|
+
//自由拖动当前位置
|
|
99
|
+
move_cur_pos: null,
|
|
100
|
+
|
|
101
|
+
//自由拖动显示位置
|
|
102
|
+
move_pos: {
|
|
103
|
+
x: "auto",
|
|
104
|
+
y: "auto"
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
//自由拖动起始点位置
|
|
108
|
+
move_start_point_pos: {
|
|
109
|
+
x: 0,
|
|
110
|
+
y: 0
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
//自由拖动区域限制
|
|
114
|
+
move_area: null
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
|
|
120
|
+
//事件绑定
|
|
121
|
+
$_bind_event(){
|
|
122
|
+
const $el = this.$el;
|
|
123
|
+
if(this.freeDrag){ //自由拖动
|
|
124
|
+
$el.ontouchmove = this.$_free_move;
|
|
125
|
+
$el.onmouseup = this.$_free_move_end;
|
|
126
|
+
$el.ontouchend = this.$_free_move_end;
|
|
127
|
+
}else { //拖拽事件
|
|
128
|
+
$el.ondragstart = this.$_drag_start;
|
|
129
|
+
$el.ondrag = this.$_drag_move;
|
|
130
|
+
$el.ondragend = this.$_drag_end;
|
|
131
|
+
$el.ondragover = this.$_drag_over;
|
|
132
|
+
$el.ondragleave = this.$_drag_leave;
|
|
133
|
+
$el.ondrop = this.$_drop;
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
//按下(激活)拖拽目标
|
|
138
|
+
$_act_target(e){
|
|
139
|
+
this.toggle_style('drag_start');
|
|
140
|
+
if(this.freeDrag){
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
const $el = this.$el,
|
|
143
|
+
$offset_parent = $el.offsetParent;
|
|
144
|
+
if(!this.move_cur_pos) {
|
|
145
|
+
this.move_pos = this.move_cur_pos = {
|
|
146
|
+
x: $el.offsetLeft,
|
|
147
|
+
y: $el.offsetTop
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if(!this.move_area) this.move_area = {
|
|
151
|
+
x: $offset_parent.clientWidth - $el.offsetWidth,
|
|
152
|
+
y: $offset_parent.clientHeight - $el.offsetHeight
|
|
153
|
+
}
|
|
154
|
+
this.move_start_point_pos = {
|
|
155
|
+
x: e.screenX,
|
|
156
|
+
y: e.screenY
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
//动态事件绑定
|
|
160
|
+
if(!$offset_parent.onmousemove) $offset_parent.onmousemove = this.$_free_move;
|
|
161
|
+
if(!$offset_parent.onmouseleave) $offset_parent.onmouseleave = this.$_free_move_end;
|
|
162
|
+
|
|
163
|
+
this.move_state = true;
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
//拖拽开始
|
|
168
|
+
$_drag_start(e){
|
|
169
|
+
this.$emit("on_drag_start", e);
|
|
170
|
+
e.dataTransfer.setData("info", e.target.dataset.info);
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
//拖拽移动
|
|
174
|
+
$_drag_move(e){
|
|
175
|
+
e.preventDefault();
|
|
176
|
+
this.drag_state = true;
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
//拖拽结束
|
|
180
|
+
$_drag_end(e){
|
|
181
|
+
this.drag_state = false;
|
|
182
|
+
this.$emit("on_drag_end", e);
|
|
183
|
+
this.reset_style();
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
//拖拽预备放入
|
|
187
|
+
$_drag_over(e){
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
this.$emit("on_drag_over", e);
|
|
190
|
+
this.toggle_style("drag_over");
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
//拖拽离开容器
|
|
194
|
+
$_drag_leave(e){
|
|
195
|
+
this.$emit("on_drag_leave", e);
|
|
196
|
+
this.reset_style();
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
//完成放入
|
|
200
|
+
$_drop(e){
|
|
201
|
+
this.$emit("on_drop", {
|
|
202
|
+
you: JSON.parse(e.dataTransfer.getData("info")),
|
|
203
|
+
me: JSON.parse(this.$el.dataset.info)
|
|
204
|
+
}, e);
|
|
205
|
+
this.reset_style();
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
//自由拖动
|
|
209
|
+
$_free_move(e){
|
|
210
|
+
if(this.move_state){
|
|
211
|
+
const orig_pos = this.move_start_point_pos,
|
|
212
|
+
cur_pos = this.move_cur_pos,
|
|
213
|
+
rel_x = e.screenX - orig_pos.x,
|
|
214
|
+
rel_y = e.screenY - orig_pos.y,
|
|
215
|
+
move_area = this.move_area;
|
|
216
|
+
let move_pos_x = cur_pos.x + rel_x,
|
|
217
|
+
move_pos_y = cur_pos.y + rel_y;
|
|
218
|
+
|
|
219
|
+
//区域限制
|
|
220
|
+
if(move_pos_x < 0) move_pos_x = 0;
|
|
221
|
+
if(move_pos_y < 0) move_pos_y = 0;
|
|
222
|
+
if(move_pos_x > move_area.x) move_pos_x = move_area.x;
|
|
223
|
+
if(move_pos_y > move_area.y) move_pos_y = move_area.y;
|
|
224
|
+
|
|
225
|
+
this.move_pos = {
|
|
226
|
+
x: move_pos_x,
|
|
227
|
+
y: move_pos_y,
|
|
228
|
+
}
|
|
229
|
+
this.$emit("on_move", this.move_pos, move_area);
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
//自由拖动结束
|
|
234
|
+
$_free_move_end(){
|
|
235
|
+
if(this.move_state){
|
|
236
|
+
this.reset_style();
|
|
237
|
+
this.move_state = false;
|
|
238
|
+
this.move_cur_pos = this.move_pos;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
},
|
|
243
|
+
watch: {
|
|
244
|
+
|
|
245
|
+
//数据更新
|
|
246
|
+
dataInfo(){
|
|
247
|
+
this.$el.dataset.info = JSON.stringify(this.dataInfo);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
},
|
|
251
|
+
mounted(){
|
|
252
|
+
this.append_state(this.dragStart, "drag_start");
|
|
253
|
+
this.append_state(this.dragOver, "drag_over");
|
|
254
|
+
this.$el.dataset.info = JSON.stringify(this.dataInfo);
|
|
255
|
+
this.$_bind_event();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
</script>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<b-view :styles="`${styles} rel`">
|
|
3
|
+
<!--容器描边-->
|
|
4
|
+
<b-view styles="abs max bg-none z1 t-0 l-0"
|
|
5
|
+
:states="{
|
|
6
|
+
line: {
|
|
7
|
+
style: `line line-${outlineColor} thick-${line[1] + 1}`,
|
|
8
|
+
state: outlineColor
|
|
9
|
+
}
|
|
10
|
+
}">
|
|
11
|
+
</b-view>
|
|
12
|
+
|
|
13
|
+
<!--网格-->
|
|
14
|
+
<b-view styles="grid">
|
|
15
|
+
<b-view v-for="(item,i) of colData.items" :key="i"
|
|
16
|
+
:class="colData.common_plan || item.plan"
|
|
17
|
+
:styles="`rel line-b line-r line-${line[0]} thick-${line[1]} h-${gridHeight} pad-${gap}`">
|
|
18
|
+
<slot :name="item.id || item.Id" />
|
|
19
|
+
</b-view>
|
|
20
|
+
</b-view>
|
|
21
|
+
</b-view>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import BView from "./b-view";
|
|
26
|
+
|
|
27
|
+
let desc = ["该组件可用于实现响应式栅格布局。"],
|
|
28
|
+
extend = [],
|
|
29
|
+
dependent = ["b-view"],
|
|
30
|
+
api = null,
|
|
31
|
+
init_data = `{
|
|
32
|
+
colData: {
|
|
33
|
+
items: [
|
|
34
|
+
{
|
|
35
|
+
id|Id: "单元格 id",
|
|
36
|
+
plan: "局部栅格方案,可参考栅格系统全局样式 .col-*",
|
|
37
|
+
....
|
|
38
|
+
},...
|
|
39
|
+
],
|
|
40
|
+
common_plan: "公共栅格方案,可参考栅格系统全局样式 .col-*"
|
|
41
|
+
},
|
|
42
|
+
/* styles: "(参照:b-style 组件入参)" */,
|
|
43
|
+
/* gridHeight: "栅格固定高度" */,
|
|
44
|
+
/* gap: "栅格内边距,默认为 0" */,
|
|
45
|
+
/* line: ["网格描边颜色", "网格描边粗细"] */,
|
|
46
|
+
/* outlineColor: "容器描边色" */,
|
|
47
|
+
}`;
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
name: "b-grid",
|
|
51
|
+
introduce: { desc, extend, dependent, api, init_data },
|
|
52
|
+
components: {
|
|
53
|
+
BView
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
colData: {
|
|
57
|
+
type: Object,
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
styles: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
gap: {
|
|
65
|
+
type: [Number, String],
|
|
66
|
+
required: false,
|
|
67
|
+
default: 0
|
|
68
|
+
},
|
|
69
|
+
gridHeight: {
|
|
70
|
+
type: [Number, String],
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
line: {
|
|
74
|
+
type: Array,
|
|
75
|
+
required: false,
|
|
76
|
+
default: () => ["none", 0]
|
|
77
|
+
},
|
|
78
|
+
outlineColor: {
|
|
79
|
+
type: String,
|
|
80
|
+
required: false
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a @click="$_click" @dblclick="$_dblclick"
|
|
3
|
+
@touchstart="$_enter" @touchend="$_leave"
|
|
4
|
+
@mousemove="$emit('on_move', $event)"
|
|
5
|
+
:href="url"
|
|
6
|
+
:target="target"
|
|
7
|
+
:download="download"
|
|
8
|
+
:style="computed_style" >
|
|
9
|
+
<slot />
|
|
10
|
+
</a>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import ChapterLink from "./lib/ChapterLink"
|
|
15
|
+
|
|
16
|
+
let desc = ["该组件用于实现热点交互操作。"],
|
|
17
|
+
extend = ["b-style"],
|
|
18
|
+
dependent = ["ChapterLink"],
|
|
19
|
+
api = {
|
|
20
|
+
event: [
|
|
21
|
+
{
|
|
22
|
+
name: "on_click",
|
|
23
|
+
ef: "左键单击",
|
|
24
|
+
params: "event",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "on_dblclick",
|
|
28
|
+
ef: "左键双击",
|
|
29
|
+
params: "event",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "on_enter",
|
|
33
|
+
ef: "鼠标移入或手指按下(悬停)",
|
|
34
|
+
params: "event",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "on_leave",
|
|
38
|
+
ef: "鼠标移出或手指抬起",
|
|
39
|
+
params: "event",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "on_move",
|
|
43
|
+
ef: "鼠标移动",
|
|
44
|
+
params: "event",
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
init_data = `{
|
|
49
|
+
/* styles: "(参照:b-style 组件入参)" */,
|
|
50
|
+
/* link: "外部链接 | 组件路由 | 手机拨号 | {
|
|
51
|
+
chapter_id: "内部链接元素 id",
|
|
52
|
+
chapter_link_data: "(参照:ChapterLink 类构造函数)"
|
|
53
|
+
} | {
|
|
54
|
+
download: "下载文件名",
|
|
55
|
+
res: "下载资源地址"
|
|
56
|
+
}" */,
|
|
57
|
+
/* hover: "悬停样式值" */,
|
|
58
|
+
/* forbid: "鼠标点击事件及链接禁用,默认 false,不禁用" */,
|
|
59
|
+
/* newFrame: "强制开启新窗口,默认 false" */,
|
|
60
|
+
}`;
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
name: "b-hot",
|
|
64
|
+
introduce: { desc, extend, dependent, api, init_data },
|
|
65
|
+
props: {
|
|
66
|
+
link: {
|
|
67
|
+
type: [String, Object],
|
|
68
|
+
required: false
|
|
69
|
+
},
|
|
70
|
+
hover: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
74
|
+
forbid: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
required: false
|
|
77
|
+
},
|
|
78
|
+
newFrame: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
required: false
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
data(){
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
//链接开启方式
|
|
87
|
+
target: this.newFrame? "_blank": null,
|
|
88
|
+
|
|
89
|
+
//下载地址
|
|
90
|
+
download: null,
|
|
91
|
+
|
|
92
|
+
//内链控制器
|
|
93
|
+
chapter_link: this.$_init_chapter_link(),
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
computed: {
|
|
98
|
+
|
|
99
|
+
//链接地址
|
|
100
|
+
url(){
|
|
101
|
+
if(this.forbid) return false; //禁用效果
|
|
102
|
+
let link = this.link;
|
|
103
|
+
if(!link) return "javascript:;"
|
|
104
|
+
if(typeof(link) === "string"){
|
|
105
|
+
if(link.search("http") === 0){ //外部链接
|
|
106
|
+
this.target = "_blank";
|
|
107
|
+
return link;
|
|
108
|
+
}else if(link.search("/") === 0){ //组件路由
|
|
109
|
+
return (this.$router.mode === "history"? "": "#") + link;
|
|
110
|
+
}else if(link.search(/^(tel|mailto):/) === 0){ //手机拨号 | 邮件
|
|
111
|
+
return link;
|
|
112
|
+
}
|
|
113
|
+
} else{
|
|
114
|
+
if(link.download){ //文件下载
|
|
115
|
+
this.download = link.download;
|
|
116
|
+
return link.res;
|
|
117
|
+
}else { //内部链接
|
|
118
|
+
return `#${this.$route.path}`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
|
|
126
|
+
//初始化内链控制器
|
|
127
|
+
$_init_chapter_link(){
|
|
128
|
+
if(this.link && this.link.chapter_id){
|
|
129
|
+
let {ani_speed, offset, callback} = this.link.chapter_link_data || {};
|
|
130
|
+
return new ChapterLink(ani_speed, offset, callback);
|
|
131
|
+
}else {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
//执行点击
|
|
137
|
+
$_click(e){
|
|
138
|
+
e.stopPropagation();
|
|
139
|
+
!this.forbid && this.$emit("on_click", e);
|
|
140
|
+
this.chapter_link && this.chapter_link.go_chapter(this.link.chapter_id); //内部链接
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
//执行双击
|
|
144
|
+
$_dblclick(e){
|
|
145
|
+
e.stopPropagation();
|
|
146
|
+
!this.forbid && this.$emit("on_dblclick", e);
|
|
147
|
+
this.target && this.reset_style();
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
//鼠标移入|触控开始
|
|
151
|
+
$_enter(e){
|
|
152
|
+
!this.cur_states.length && this.toggle_style("hover"); //仅限默认状态下
|
|
153
|
+
this.$emit("on_enter", e);
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
//鼠标移出|触控结束
|
|
157
|
+
$_leave(e){
|
|
158
|
+
this.cur_states[0] === "hover" && this.reset_style(); //仅限 hover 状态下
|
|
159
|
+
this.$emit("on_leave", e);
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
},
|
|
163
|
+
mounted(){
|
|
164
|
+
if(document.createElement("div").ontouchstart !== null) {
|
|
165
|
+
this.$el.onmouseenter = this.$_enter;
|
|
166
|
+
this.$el.onmouseleave = this.$_leave;
|
|
167
|
+
}
|
|
168
|
+
this.append_state(this.hover, "hover");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
</script>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: btxstudio btxstudio@163.com
|
|
3
|
+
* @Date: 2023-10-28 13:53:44
|
|
4
|
+
* @LastEditors: btxstudio btxstudio@163.com
|
|
5
|
+
* @LastEditTime: 2023-11-22 15:44:47
|
|
6
|
+
* @FilePath: \BTXUI\components\BTXUI\core\b-icon.vue
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<!--动态图标-->
|
|
11
|
+
<b-view v-if="icon && icon.search('ani_') === 0" :style="computed_style">
|
|
12
|
+
<!--success-->
|
|
13
|
+
<ani-success v-if="icon === 'ani_success'" key="success" />
|
|
14
|
+
|
|
15
|
+
<!--fail-->
|
|
16
|
+
<ani-fail v-if="icon === 'ani_fail'" key="fail" />
|
|
17
|
+
|
|
18
|
+
<!--notic-->
|
|
19
|
+
<ani-notic v-if="icon === 'ani_notic'" key="notic" />
|
|
20
|
+
|
|
21
|
+
<!--loading-->
|
|
22
|
+
<ani-loading v-if="icon === 'ani_loading'" key="loading" />
|
|
23
|
+
</b-view>
|
|
24
|
+
|
|
25
|
+
<!--字体图标-->
|
|
26
|
+
<i v-else-if="icon" :class="`ico-${icon}`" :style="computed_style"></i>
|
|
27
|
+
|
|
28
|
+
<!--图片图标-->
|
|
29
|
+
<b-view v-else-if="bgImg" :bg-img="bgImg" :style="computed_style" />
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import BView from "./b-view";
|
|
34
|
+
import BText from "./b-text";
|
|
35
|
+
import AniSuccess from "./anis/ani-success";
|
|
36
|
+
import AniFail from "./anis/ani-fail";
|
|
37
|
+
import AniNotic from "./anis/ani-notic";
|
|
38
|
+
import AniLoading from "./anis/ani-loading";
|
|
39
|
+
|
|
40
|
+
let desc = ["该组件用于显示图标,包括 “字体图标”、“图片图标”、“css 动画图标”。"],
|
|
41
|
+
extend = ["b-style"],
|
|
42
|
+
dependent = ["b-view", "b-text", "ani-success", "ani-fail", "ani-notic", "ani-loading"],
|
|
43
|
+
api = null,
|
|
44
|
+
init_data = `{
|
|
45
|
+
/* styles: "(参照:b-style 组件入参)" */,
|
|
46
|
+
/* icon: "字体图标名(无需 ico 前缀)| 动态图标(ani_success、ani_fail、ani_notic)" */,
|
|
47
|
+
/* bgImg: "图片地址" */,
|
|
48
|
+
}`;
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: "b-icon",
|
|
52
|
+
introduce: { desc, extend, dependent, api, init_data },
|
|
53
|
+
components: {
|
|
54
|
+
BView,
|
|
55
|
+
BText,
|
|
56
|
+
AniSuccess,
|
|
57
|
+
AniFail,
|
|
58
|
+
AniNotic,
|
|
59
|
+
AniLoading
|
|
60
|
+
},
|
|
61
|
+
props: {
|
|
62
|
+
icon: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false
|
|
65
|
+
},
|
|
66
|
+
imgData: {
|
|
67
|
+
type: Object,
|
|
68
|
+
required: false
|
|
69
|
+
},
|
|
70
|
+
bgImg: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: false
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img :src="src" :style="{...computed_style, objectFit: objFit}" :alt="alt">
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
|
|
7
|
+
let desc = ["该组件用于实现图片显示。"],
|
|
8
|
+
extend = ["b-style"],
|
|
9
|
+
dependent = [],
|
|
10
|
+
api = {
|
|
11
|
+
event: [
|
|
12
|
+
{
|
|
13
|
+
name: "on_load",
|
|
14
|
+
ef: "图片加载完成",
|
|
15
|
+
params: "-",
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
init_data = `{
|
|
20
|
+
img: "图像资源",
|
|
21
|
+
/* styles: "(参照:b-style 组件入参)" */,
|
|
22
|
+
/* objFit: "object-fit 样式值,默认:cover" */,
|
|
23
|
+
/* defaultSrc: "默认图,加载失败或初始加载时显示" */,
|
|
24
|
+
/* alt: "图片说明提示" */
|
|
25
|
+
}`;
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: "b-img",
|
|
29
|
+
introduce: { desc, extend, dependent, api, init_data },
|
|
30
|
+
props: {
|
|
31
|
+
img: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
objFit: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false,
|
|
38
|
+
default: "cover"
|
|
39
|
+
},
|
|
40
|
+
defaultSrc: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: false
|
|
43
|
+
},
|
|
44
|
+
alt: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
data(){
|
|
50
|
+
return {
|
|
51
|
+
|
|
52
|
+
//图像显示地址
|
|
53
|
+
src: this.defaultSrc,
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
|
|
59
|
+
//监听图像源
|
|
60
|
+
img(){
|
|
61
|
+
this.$_load();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
|
|
67
|
+
//图像源加载
|
|
68
|
+
$_load(){
|
|
69
|
+
if(this.img && (this.img.match(/\.(jpg|png|gif|jpeg)/) || this.img.search("data:image/png;base64") === 0)){
|
|
70
|
+
const img = new Image();
|
|
71
|
+
img.onload = ()=>{
|
|
72
|
+
this.src = this.img;
|
|
73
|
+
this.$emit("on_load");
|
|
74
|
+
}
|
|
75
|
+
img.src = this.img;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
mounted(){
|
|
81
|
+
this.$_load();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|