hbte-saas-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/.browserslistrc +3 -0
- package/.editorconfig +7 -0
- package/.env.development +1 -0
- package/.env.lib +1 -0
- package/.eslintrc.js +14 -0
- package/.prettierrc +3 -0
- package/README.md +53 -0
- package/babel.config.js +3 -0
- package/docs/.vuepress/config.js +23 -0
- package/docs/.vuepress/styles/index.styl +4 -0
- package/docs/AdvQuery.md +26 -0
- package/docs/CustomQuery.md +21 -0
- package/docs/EditArea.md +16 -0
- package/docs/FilterDrop.md +29 -0
- package/docs/FullTable.md +68 -0
- package/docs/Pagination.md +22 -0
- package/docs/QueryForm.md +27 -0
- package/docs/README.md +17 -0
- package/docs/Table.md +58 -0
- package/docs/ToolGroup.md +32 -0
- package/examples/App.vue +97 -0
- package/examples/image/hb-image-viewer/3k.jpg +0 -0
- package/examples/image/hb-image-viewer/a.jpg +0 -0
- package/examples/image/hb-image-viewer/b.jpg +0 -0
- package/examples/main.js +39 -0
- package/examples/mock/authority.js +1108 -0
- package/examples/mock/dept.js +4001 -0
- package/examples/mock/fulltable.js +407 -0
- package/examples/mock/organizeData.js +18965 -0
- package/examples/router/index.js +111 -0
- package/examples/views/ElementCpTest.vue +299 -0
- package/examples/views/Fragment.vue +196 -0
- package/examples/views/HBAdvQuery.vue +150 -0
- package/examples/views/HBAuthority.vue +339 -0
- package/examples/views/HBDialog.vue +39 -0
- package/examples/views/HBEditarea.vue +350 -0
- package/examples/views/HBFilterDrop.vue +72 -0
- package/examples/views/HBFloatFooter.vue +42 -0
- package/examples/views/HBFullTable.vue +751 -0
- package/examples/views/HBImageViewer.vue +57 -0
- package/examples/views/HBNavMenu.vue +37 -0
- package/examples/views/HBOrganizeDialog.vue +133 -0
- package/examples/views/HBPagination.vue +80 -0
- package/examples/views/HBSelectVague.vue +57 -0
- package/examples/views/HBToolgroup.vue +29 -0
- package/examples/views/HBTopBar.vue +16 -0
- package/lib/demo.html +10 -0
- package/lib/fonts/iconfont.9e99af35.ttf +0 -0
- package/lib/hbte-ui.common.js +38291 -0
- package/lib/hbte-ui.css +1 -0
- package/lib/hbte-ui.umd.js +38301 -0
- package/lib/hbte-ui.umd.min.js +21 -0
- package/lib/img/nodata.f87d17c1.png +0 -0
- package/lib/img/user-logo--default.a53bd193.png +0 -0
- package/package.json +40 -0
- package/packages/adv-query/index.js +5 -0
- package/packages/adv-query/src/main.vue +294 -0
- package/packages/area-select/index.js +7 -0
- package/packages/area-select/src/main.vue +37 -0
- package/packages/authority/index.js +5 -0
- package/packages/authority/src/main.vue +606 -0
- package/packages/config.js +3 -0
- package/packages/custom-query/index.js +5 -0
- package/packages/custom-query/src/main.vue +80 -0
- package/packages/dialog/index.js +7 -0
- package/packages/dialog/src/main.vue +176 -0
- package/packages/edit-area/index.js +13 -0
- package/packages/edit-area/src/config.js +3 -0
- package/packages/edit-area/src/main.vue +304 -0
- package/packages/edit-area/src/simulateEvent.js +219 -0
- package/packages/filter-drop/index.js +6 -0
- package/packages/filter-drop/src/main.vue +107 -0
- package/packages/float-footer/index.js +7 -0
- package/packages/float-footer/src/main.vue +40 -0
- package/packages/fragment/index.js +7 -0
- package/packages/fragment/src/main.vue +74 -0
- package/packages/fragment/src/old.vue +144 -0
- package/packages/full-table/index.js +6 -0
- package/packages/full-table/src/config.js +14 -0
- package/packages/full-table/src/main.vue +141 -0
- package/packages/image-viewer/index.js +8 -0
- package/packages/image-viewer/src/main.js +14 -0
- package/packages/image-viewer/src/main.vue +138 -0
- package/packages/image-viewer/src/svg/cancel.svg +2 -0
- package/packages/image-viewer/src/svg/delete.svg +2 -0
- package/packages/image-viewer/src/svg/download.svg +2 -0
- package/packages/image-viewer/src/svg/rotate.svg +77 -0
- package/packages/image-viewer/src/svg/scaledown.svg +71 -0
- package/packages/image-viewer/src/svg/scaleup.svg +72 -0
- package/packages/index.js +43 -0
- package/packages/nav-menu/index.js +7 -0
- package/packages/nav-menu/src/main.vue +277 -0
- package/packages/organize-dialog/index.js +5 -0
- package/packages/organize-dialog/src/main.vue +427 -0
- package/packages/pagination/index.js +6 -0
- package/packages/pagination/src/main.vue +145 -0
- package/packages/query-form/index.js +5 -0
- package/packages/query-form/src/main.vue +142 -0
- package/packages/select-vague/index.js +5 -0
- package/packages/select-vague/src/main.vue +80 -0
- package/packages/table/index.js +5 -0
- package/packages/table/src/main.vue +265 -0
- package/packages/theme-chalk/adv-query.scss +107 -0
- package/packages/theme-chalk/authority.scss +103 -0
- package/packages/theme-chalk/common/elementCover.scss +722 -0
- package/packages/theme-chalk/common/flex.scss +66 -0
- package/packages/theme-chalk/common/global.scss +147 -0
- package/packages/theme-chalk/common/reset.scss +92 -0
- package/packages/theme-chalk/common/var.scss +46 -0
- package/packages/theme-chalk/custom-query.scss +10 -0
- package/packages/theme-chalk/dialog.scss +9 -0
- package/packages/theme-chalk/edit-area.scss +119 -0
- package/packages/theme-chalk/filter-drop.scss +81 -0
- package/packages/theme-chalk/float-footer.scss +14 -0
- package/packages/theme-chalk/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/fragment.scss +51 -0
- package/packages/theme-chalk/full-table.scss +40 -0
- package/packages/theme-chalk/icon.scss +96 -0
- package/packages/theme-chalk/image-viewer.scss +94 -0
- package/packages/theme-chalk/images/company-logo--default.png +0 -0
- package/packages/theme-chalk/images/nodata.png +0 -0
- package/packages/theme-chalk/images/user-logo--default.png +0 -0
- package/packages/theme-chalk/index.scss +21 -0
- package/packages/theme-chalk/nav-menu.scss +205 -0
- package/packages/theme-chalk/organize-dialog.scss +170 -0
- package/packages/theme-chalk/pagination.scss +91 -0
- package/packages/theme-chalk/select.scss +8 -0
- package/packages/theme-chalk/table.scss +102 -0
- package/packages/theme-chalk/tool-group.scss +105 -0
- package/packages/theme-chalk/top-bar.scss +195 -0
- package/packages/tool-group/index.js +13 -0
- package/packages/tool-group/src/config.js +40 -0
- package/packages/tool-group/src/main.vue +93 -0
- package/packages/top-bar/index.js +7 -0
- package/packages/top-bar/src/main.vue +280 -0
- package/public/index.html +20 -0
- package/vue.config.js +6 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hb-topbar">
|
|
3
|
+
<div class="hb-topbar__top">
|
|
4
|
+
<div class="hb-topbar__wrap">
|
|
5
|
+
<div class="hb-topbar__block">
|
|
6
|
+
<img
|
|
7
|
+
:src="userInfo.companyLogo || defaultAvatar.companyLogo"
|
|
8
|
+
alt=""
|
|
9
|
+
class="hb-topbar-logo"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="hb-topbar__text">
|
|
13
|
+
{{ userInfo.companyName || "杭州永谐科技有限公司" }}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="hb-topbar__right">
|
|
17
|
+
<el-dropdown trigger="click" @command="tabMicroApp">
|
|
18
|
+
<span class="pointer">
|
|
19
|
+
{{ activeAppLabel }}
|
|
20
|
+
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
21
|
+
</span>
|
|
22
|
+
<el-dropdown-menu slot="dropdown" class="el-dropdown-choose-system">
|
|
23
|
+
<el-dropdown-item
|
|
24
|
+
v-for="item in microApps"
|
|
25
|
+
:key="item.name"
|
|
26
|
+
:command="item.path"
|
|
27
|
+
:disabled="item.disabled"
|
|
28
|
+
>
|
|
29
|
+
<div class="wrapper">
|
|
30
|
+
<i :class="item.icon"></i>{{ item.label }}
|
|
31
|
+
</div>
|
|
32
|
+
</el-dropdown-item>
|
|
33
|
+
</el-dropdown-menu>
|
|
34
|
+
</el-dropdown>
|
|
35
|
+
<div class="hb-topbar-icon">
|
|
36
|
+
<i
|
|
37
|
+
v-for="item in activeTools"
|
|
38
|
+
:key="item.name"
|
|
39
|
+
:class="item.icon"
|
|
40
|
+
:title="item.label"
|
|
41
|
+
class="hb-topbar-icon__item"
|
|
42
|
+
@click="chooseTool(item)"
|
|
43
|
+
></i>
|
|
44
|
+
<slot name="spTools"></slot>
|
|
45
|
+
<!-- <el-dropdown trigger="click" @command="chooseRoute()">
|
|
46
|
+
<i class="el-icon-files hb-topbar-icon__item"></i>
|
|
47
|
+
<el-dropdown-menu slot="dropdown">
|
|
48
|
+
<el-dropdown-item
|
|
49
|
+
v-for="route in microRoutes"
|
|
50
|
+
:key="route.fullPath"
|
|
51
|
+
:command="route.fullPath"
|
|
52
|
+
:class="[
|
|
53
|
+
route.fullPath === $route.fullPath
|
|
54
|
+
? 'hb-topbar-icon--active'
|
|
55
|
+
: '',
|
|
56
|
+
]"
|
|
57
|
+
>
|
|
58
|
+
{{ route.label + route.labelName }}
|
|
59
|
+
</el-dropdown-item>
|
|
60
|
+
<el-dropdown-item command="closeAll">关闭全部</el-dropdown-item>
|
|
61
|
+
</el-dropdown-menu>
|
|
62
|
+
</el-dropdown> -->
|
|
63
|
+
</div>
|
|
64
|
+
<el-dropdown trigger="click" @command="userSetting">
|
|
65
|
+
<span class="pointer">
|
|
66
|
+
{{ userInfo.name }}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
67
|
+
</span>
|
|
68
|
+
<el-dropdown-menu slot="dropdown">
|
|
69
|
+
<el-dropdown-item
|
|
70
|
+
class="hb-topbar__right--dropdown-item"
|
|
71
|
+
v-for="item in activeSettings"
|
|
72
|
+
:key="item.name"
|
|
73
|
+
:command="item"
|
|
74
|
+
>{{ item.label }}</el-dropdown-item
|
|
75
|
+
>
|
|
76
|
+
</el-dropdown-menu>
|
|
77
|
+
</el-dropdown>
|
|
78
|
+
<div class="hb-topbar-avatar">
|
|
79
|
+
<img :src="userInfo.logo || defaultAvatar.userLogo" alt="" />
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="hb-topbar__bottom">
|
|
84
|
+
<div
|
|
85
|
+
class="hb-topbar-routetab"
|
|
86
|
+
:class="{
|
|
87
|
+
'hb-topbar-routetab--active': item.active,
|
|
88
|
+
}"
|
|
89
|
+
v-for="item in microRoutes"
|
|
90
|
+
:key="item.fullPath"
|
|
91
|
+
:title="item.label + item.labelName"
|
|
92
|
+
@contextmenu.prevent.stop="awakeContextMenu(item, $event)"
|
|
93
|
+
@click="activeRoute(item)"
|
|
94
|
+
>
|
|
95
|
+
<div class="hb-topbar-routetab__line"></div>
|
|
96
|
+
<i
|
|
97
|
+
class="icon-i-yiruku home"
|
|
98
|
+
v-if="item.fullPath === '/micro-platform'"
|
|
99
|
+
></i>
|
|
100
|
+
<div class="hb-topbar-routetab__title">
|
|
101
|
+
{{ item.label + item.labelName }}
|
|
102
|
+
</div>
|
|
103
|
+
<i
|
|
104
|
+
class="el-icon-close hb-topbar-routetab__close"
|
|
105
|
+
v-if="item.fullPath !== '/micro-platform'"
|
|
106
|
+
:class="{
|
|
107
|
+
active: item.active,
|
|
108
|
+
}"
|
|
109
|
+
@click.stop="closeRoute(item)"
|
|
110
|
+
></i>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div
|
|
114
|
+
:style="{ top: currentTop, left: currentLeft, zIndex: 10000 }"
|
|
115
|
+
class="hb-topbar__event"
|
|
116
|
+
v-if="contextMenuFlag && contextMenu"
|
|
117
|
+
>
|
|
118
|
+
<div
|
|
119
|
+
class="hb-topbar-routetab__event"
|
|
120
|
+
v-show="contextMenuRightTab"
|
|
121
|
+
@click="closeRightTabs"
|
|
122
|
+
>
|
|
123
|
+
关闭右侧标签页
|
|
124
|
+
</div>
|
|
125
|
+
<div
|
|
126
|
+
class="hb-topbar-routetab__event"
|
|
127
|
+
v-show="contextMenuLeftTab"
|
|
128
|
+
@click="closeLeftTabs"
|
|
129
|
+
>
|
|
130
|
+
关闭左侧标签页
|
|
131
|
+
</div>
|
|
132
|
+
<div
|
|
133
|
+
class="hb-topbar-routetab__event"
|
|
134
|
+
v-show="contextMenuOtherTab"
|
|
135
|
+
@click="closeOtherTabs"
|
|
136
|
+
>
|
|
137
|
+
关闭其他标签页
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
<script>
|
|
143
|
+
import { mapState, mapGetters, mapMutations } from "vuex";
|
|
144
|
+
import companyLogo from "../../theme-chalk/images/company-logo--default.png";
|
|
145
|
+
import userlogo from "../../theme-chalk/images/user-logo--default.png";
|
|
146
|
+
|
|
147
|
+
export default {
|
|
148
|
+
name: "HbTopBar", // 使用时 <hb-topbar> </hb-topbar>
|
|
149
|
+
componentName: "HbTopBar", // Vue.use() 的时候传入的名称
|
|
150
|
+
data() {
|
|
151
|
+
return {
|
|
152
|
+
base: this.$router.options.base,
|
|
153
|
+
rightClickRoute: null,
|
|
154
|
+
currentTop: "",
|
|
155
|
+
currentLeft: "",
|
|
156
|
+
contextMenuFlag: false,
|
|
157
|
+
defaultAvatar: {
|
|
158
|
+
userlogo,
|
|
159
|
+
companyLogo,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
computed: {
|
|
164
|
+
...mapState(["activeApp", "microRoutes", "microApps", "userInfo"]),
|
|
165
|
+
...mapGetters(["activeTools", "activeSettings", "activeAppLabel"]),
|
|
166
|
+
contextMenuRightTab() {
|
|
167
|
+
let index = this.microRoutes.findIndex(
|
|
168
|
+
(item) => item === this.rightClickRoute
|
|
169
|
+
);
|
|
170
|
+
return index + 1 < this.microRoutes.length;
|
|
171
|
+
},
|
|
172
|
+
contextMenuLeftTab() {
|
|
173
|
+
let index = this.microRoutes.findIndex(
|
|
174
|
+
(item) => item === this.rightClickRoute
|
|
175
|
+
);
|
|
176
|
+
if (this.microRoutes.length <= 2) {
|
|
177
|
+
return false;
|
|
178
|
+
} else if (this.rightClickRoute.fullPath === "/micro-platform") {
|
|
179
|
+
return false;
|
|
180
|
+
} else if (index === 1) {
|
|
181
|
+
return false;
|
|
182
|
+
} else {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
contextMenuOtherTab() {
|
|
187
|
+
if (this.microRoutes.length <= 1) {
|
|
188
|
+
return false;
|
|
189
|
+
} else if (
|
|
190
|
+
this.microRoutes.length === 2 &&
|
|
191
|
+
this.rightClickRoute.fullPath !== "/micro-platform"
|
|
192
|
+
) {
|
|
193
|
+
return false;
|
|
194
|
+
} else {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
contextMenu() {
|
|
199
|
+
return (
|
|
200
|
+
this.contextMenuRightTab ||
|
|
201
|
+
this.contextMenuLeftTab ||
|
|
202
|
+
this.contextMenuOtherTab
|
|
203
|
+
);
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
methods: {
|
|
207
|
+
...mapMutations(["removeRoutes"]),
|
|
208
|
+
//切换微应用
|
|
209
|
+
tabMicroApp(path) {
|
|
210
|
+
this.$router.push(path);
|
|
211
|
+
this.$emit("tabMicroApp", path);
|
|
212
|
+
},
|
|
213
|
+
//路由选项卡集合下拉选项操作
|
|
214
|
+
chooseRoute(fullPath) {
|
|
215
|
+
if (fullPath !== "closeAll") {
|
|
216
|
+
this.$router.push(fullPath);
|
|
217
|
+
} else {
|
|
218
|
+
this.removeRoutes({ type: "all" });
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
//点击操作图标抛出事件
|
|
222
|
+
chooseTool(tool) {
|
|
223
|
+
window.dispatchEvent(tool.event);
|
|
224
|
+
},
|
|
225
|
+
//选择不同的用户相关操作
|
|
226
|
+
userSetting(setting) {
|
|
227
|
+
window.dispatchEvent(setting.event);
|
|
228
|
+
},
|
|
229
|
+
//唤醒右键菜单
|
|
230
|
+
awakeContextMenu(route, e) {
|
|
231
|
+
this.rightClickRoute = route;
|
|
232
|
+
if (this.contextMenu) {
|
|
233
|
+
let totalWidth = document.documentElement.clientWidth;
|
|
234
|
+
document.addEventListener("click", this.closeContestMenu, true);
|
|
235
|
+
this.currentTop = e.clientY + "px";
|
|
236
|
+
if (e.clientX + 136 <= totalWidth) {
|
|
237
|
+
this.currentLeft = e.clientX + "px";
|
|
238
|
+
} else {
|
|
239
|
+
this.currentLeft = e.clientX - 126 + "px";
|
|
240
|
+
}
|
|
241
|
+
this.contextMenuFlag = true;
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
closeContestMenu(e) {
|
|
245
|
+
this.contextMenuFlag = false;
|
|
246
|
+
document.removeEventListener("click", this.closeContestMenu, true);
|
|
247
|
+
e.preventDefault();
|
|
248
|
+
},
|
|
249
|
+
//关闭右侧标签页
|
|
250
|
+
closeRightTabs() {
|
|
251
|
+
this.removeRoutes({
|
|
252
|
+
route: this.rightClickRoute,
|
|
253
|
+
type: "right",
|
|
254
|
+
});
|
|
255
|
+
},
|
|
256
|
+
//关闭左侧标签页
|
|
257
|
+
closeLeftTabs() {
|
|
258
|
+
this.removeRoutes({
|
|
259
|
+
route: this.rightClickRoute,
|
|
260
|
+
type: "left",
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
//关闭其他标签页
|
|
264
|
+
closeOtherTabs() {
|
|
265
|
+
this.removeRoutes({
|
|
266
|
+
route: this.rightClickRoute,
|
|
267
|
+
type: "other",
|
|
268
|
+
});
|
|
269
|
+
},
|
|
270
|
+
//点击小叉关闭标签页
|
|
271
|
+
closeRoute(item) {
|
|
272
|
+
this.removeRoutes({ route: item });
|
|
273
|
+
},
|
|
274
|
+
//激活标签页路由
|
|
275
|
+
activeRoute(item) {
|
|
276
|
+
!item.active && this.$router.push(item.fullPath);
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<noscript>
|
|
13
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
|
|
14
|
+
Please enable it to continue.</strong>
|
|
15
|
+
</noscript>
|
|
16
|
+
<div id="app"></div>
|
|
17
|
+
<!-- built files will be auto injected -->
|
|
18
|
+
</body>
|
|
19
|
+
|
|
20
|
+
</html>
|