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.
Files changed (137) hide show
  1. package/.browserslistrc +3 -0
  2. package/.editorconfig +7 -0
  3. package/.env.development +1 -0
  4. package/.env.lib +1 -0
  5. package/.eslintrc.js +14 -0
  6. package/.prettierrc +3 -0
  7. package/README.md +53 -0
  8. package/babel.config.js +3 -0
  9. package/docs/.vuepress/config.js +23 -0
  10. package/docs/.vuepress/styles/index.styl +4 -0
  11. package/docs/AdvQuery.md +26 -0
  12. package/docs/CustomQuery.md +21 -0
  13. package/docs/EditArea.md +16 -0
  14. package/docs/FilterDrop.md +29 -0
  15. package/docs/FullTable.md +68 -0
  16. package/docs/Pagination.md +22 -0
  17. package/docs/QueryForm.md +27 -0
  18. package/docs/README.md +17 -0
  19. package/docs/Table.md +58 -0
  20. package/docs/ToolGroup.md +32 -0
  21. package/examples/App.vue +97 -0
  22. package/examples/image/hb-image-viewer/3k.jpg +0 -0
  23. package/examples/image/hb-image-viewer/a.jpg +0 -0
  24. package/examples/image/hb-image-viewer/b.jpg +0 -0
  25. package/examples/main.js +39 -0
  26. package/examples/mock/authority.js +1108 -0
  27. package/examples/mock/dept.js +4001 -0
  28. package/examples/mock/fulltable.js +407 -0
  29. package/examples/mock/organizeData.js +18965 -0
  30. package/examples/router/index.js +111 -0
  31. package/examples/views/ElementCpTest.vue +299 -0
  32. package/examples/views/Fragment.vue +196 -0
  33. package/examples/views/HBAdvQuery.vue +150 -0
  34. package/examples/views/HBAuthority.vue +339 -0
  35. package/examples/views/HBDialog.vue +39 -0
  36. package/examples/views/HBEditarea.vue +350 -0
  37. package/examples/views/HBFilterDrop.vue +72 -0
  38. package/examples/views/HBFloatFooter.vue +42 -0
  39. package/examples/views/HBFullTable.vue +751 -0
  40. package/examples/views/HBImageViewer.vue +57 -0
  41. package/examples/views/HBNavMenu.vue +37 -0
  42. package/examples/views/HBOrganizeDialog.vue +133 -0
  43. package/examples/views/HBPagination.vue +80 -0
  44. package/examples/views/HBSelectVague.vue +57 -0
  45. package/examples/views/HBToolgroup.vue +29 -0
  46. package/examples/views/HBTopBar.vue +16 -0
  47. package/lib/demo.html +10 -0
  48. package/lib/fonts/iconfont.9e99af35.ttf +0 -0
  49. package/lib/hbte-ui.common.js +38291 -0
  50. package/lib/hbte-ui.css +1 -0
  51. package/lib/hbte-ui.umd.js +38301 -0
  52. package/lib/hbte-ui.umd.min.js +21 -0
  53. package/lib/img/nodata.f87d17c1.png +0 -0
  54. package/lib/img/user-logo--default.a53bd193.png +0 -0
  55. package/package.json +40 -0
  56. package/packages/adv-query/index.js +5 -0
  57. package/packages/adv-query/src/main.vue +294 -0
  58. package/packages/area-select/index.js +7 -0
  59. package/packages/area-select/src/main.vue +37 -0
  60. package/packages/authority/index.js +5 -0
  61. package/packages/authority/src/main.vue +606 -0
  62. package/packages/config.js +3 -0
  63. package/packages/custom-query/index.js +5 -0
  64. package/packages/custom-query/src/main.vue +80 -0
  65. package/packages/dialog/index.js +7 -0
  66. package/packages/dialog/src/main.vue +176 -0
  67. package/packages/edit-area/index.js +13 -0
  68. package/packages/edit-area/src/config.js +3 -0
  69. package/packages/edit-area/src/main.vue +304 -0
  70. package/packages/edit-area/src/simulateEvent.js +219 -0
  71. package/packages/filter-drop/index.js +6 -0
  72. package/packages/filter-drop/src/main.vue +107 -0
  73. package/packages/float-footer/index.js +7 -0
  74. package/packages/float-footer/src/main.vue +40 -0
  75. package/packages/fragment/index.js +7 -0
  76. package/packages/fragment/src/main.vue +74 -0
  77. package/packages/fragment/src/old.vue +144 -0
  78. package/packages/full-table/index.js +6 -0
  79. package/packages/full-table/src/config.js +14 -0
  80. package/packages/full-table/src/main.vue +141 -0
  81. package/packages/image-viewer/index.js +8 -0
  82. package/packages/image-viewer/src/main.js +14 -0
  83. package/packages/image-viewer/src/main.vue +138 -0
  84. package/packages/image-viewer/src/svg/cancel.svg +2 -0
  85. package/packages/image-viewer/src/svg/delete.svg +2 -0
  86. package/packages/image-viewer/src/svg/download.svg +2 -0
  87. package/packages/image-viewer/src/svg/rotate.svg +77 -0
  88. package/packages/image-viewer/src/svg/scaledown.svg +71 -0
  89. package/packages/image-viewer/src/svg/scaleup.svg +72 -0
  90. package/packages/index.js +43 -0
  91. package/packages/nav-menu/index.js +7 -0
  92. package/packages/nav-menu/src/main.vue +277 -0
  93. package/packages/organize-dialog/index.js +5 -0
  94. package/packages/organize-dialog/src/main.vue +427 -0
  95. package/packages/pagination/index.js +6 -0
  96. package/packages/pagination/src/main.vue +145 -0
  97. package/packages/query-form/index.js +5 -0
  98. package/packages/query-form/src/main.vue +142 -0
  99. package/packages/select-vague/index.js +5 -0
  100. package/packages/select-vague/src/main.vue +80 -0
  101. package/packages/table/index.js +5 -0
  102. package/packages/table/src/main.vue +265 -0
  103. package/packages/theme-chalk/adv-query.scss +107 -0
  104. package/packages/theme-chalk/authority.scss +103 -0
  105. package/packages/theme-chalk/common/elementCover.scss +722 -0
  106. package/packages/theme-chalk/common/flex.scss +66 -0
  107. package/packages/theme-chalk/common/global.scss +147 -0
  108. package/packages/theme-chalk/common/reset.scss +92 -0
  109. package/packages/theme-chalk/common/var.scss +46 -0
  110. package/packages/theme-chalk/custom-query.scss +10 -0
  111. package/packages/theme-chalk/dialog.scss +9 -0
  112. package/packages/theme-chalk/edit-area.scss +119 -0
  113. package/packages/theme-chalk/filter-drop.scss +81 -0
  114. package/packages/theme-chalk/float-footer.scss +14 -0
  115. package/packages/theme-chalk/fonts/iconfont.ttf +0 -0
  116. package/packages/theme-chalk/fragment.scss +51 -0
  117. package/packages/theme-chalk/full-table.scss +40 -0
  118. package/packages/theme-chalk/icon.scss +96 -0
  119. package/packages/theme-chalk/image-viewer.scss +94 -0
  120. package/packages/theme-chalk/images/company-logo--default.png +0 -0
  121. package/packages/theme-chalk/images/nodata.png +0 -0
  122. package/packages/theme-chalk/images/user-logo--default.png +0 -0
  123. package/packages/theme-chalk/index.scss +21 -0
  124. package/packages/theme-chalk/nav-menu.scss +205 -0
  125. package/packages/theme-chalk/organize-dialog.scss +170 -0
  126. package/packages/theme-chalk/pagination.scss +91 -0
  127. package/packages/theme-chalk/select.scss +8 -0
  128. package/packages/theme-chalk/table.scss +102 -0
  129. package/packages/theme-chalk/tool-group.scss +105 -0
  130. package/packages/theme-chalk/top-bar.scss +195 -0
  131. package/packages/tool-group/index.js +13 -0
  132. package/packages/tool-group/src/config.js +40 -0
  133. package/packages/tool-group/src/main.vue +93 -0
  134. package/packages/top-bar/index.js +7 -0
  135. package/packages/top-bar/src/main.vue +280 -0
  136. package/public/index.html +20 -0
  137. package/vue.config.js +6 -0
@@ -0,0 +1,350 @@
1
+ <template>
2
+ <div>
3
+ <ul class="editarea-ul">
4
+ <li class="editarea-li">
5
+ <h3>文本输入(无提交)</h3>
6
+ <p>
7
+ <hb-editarea type="input" :value.sync="baseData.code"></hb-editarea>
8
+ </p>
9
+ </li>
10
+ <li class="editarea-li">
11
+ <h3>文本输入(无提交,有异步校验)</h3>
12
+ <hb-editarea
13
+ type="input"
14
+ :value.sync="baseData.code"
15
+ :validate="validate.asyncCode"
16
+ ></hb-editarea>
17
+ </li>
18
+ <li class="editarea-li">
19
+ <h3>文本输入(无提交,有同步校验)</h3>
20
+ <hb-editarea
21
+ type="input"
22
+ :value.sync="baseData.code"
23
+ :validate="validate.code"
24
+ ></hb-editarea>
25
+ </li>
26
+ <li class="editarea-li">
27
+ <h3>文本输入(有提交)</h3>
28
+ <hb-editarea
29
+ type="input"
30
+ :value.sync="baseData.code"
31
+ :change="changeEdit('code')"
32
+ ></hb-editarea>
33
+ </li>
34
+ <li class="editarea-li">
35
+ <h3>单选下拉(无提交)</h3>
36
+ <hb-editarea
37
+ type="select"
38
+ :insert="(value) => value"
39
+ :value.sync="baseData.name"
40
+ :optList="optList.nameText"
41
+ >
42
+ </hb-editarea>
43
+ </li>
44
+ <li class="editarea-li">
45
+ <h3>单选下拉(有提交)</h3>
46
+ <hb-editarea
47
+ type="select"
48
+ :value.sync="baseData.name"
49
+ :insert="insertEdit('name')"
50
+ :change="changeEdit('name')"
51
+ :optList="optList.name"
52
+ >
53
+ </hb-editarea>
54
+ </li>
55
+ <li class="editarea-li">
56
+ <h3>多选下拉(有提交)</h3>
57
+ <hb-editarea
58
+ type="select"
59
+ :multiple="true"
60
+ :value.sync="baseData.word"
61
+ :insert="insertEdit('word')"
62
+ :change="changeEdit('word')"
63
+ :optList="optList.word"
64
+ >
65
+ </hb-editarea>
66
+ </li>
67
+ <li class="editarea-li">
68
+ <h3>开关(无提交)</h3>
69
+ <hb-editarea
70
+ type="switch"
71
+ :value.sync="baseData.open"
72
+ :optList="optList.open"
73
+ >
74
+ </hb-editarea>
75
+ </li>
76
+ <li class="editarea-li">
77
+ <h3>单选(无提交)</h3>
78
+ <hb-editarea
79
+ type="radio"
80
+ :value.sync="baseData.size"
81
+ :optList="optList.size"
82
+ :insert="insertEdit('size')"
83
+ :change="changeEdit('size')"
84
+ >
85
+ </hb-editarea>
86
+ </li>
87
+ <li class="editarea-li">
88
+ <h3>多选(无提交)</h3>
89
+ <hb-editarea
90
+ type="checkbox"
91
+ :value.sync="baseData.color"
92
+ :optList="optList.color"
93
+ :insert="insertEdit('color')"
94
+ :change="changeEdit('color')"
95
+ >
96
+ </hb-editarea>
97
+ </li>
98
+ <li class="editarea-li">
99
+ <h3>时间(无提交)</h3>
100
+ <hb-editarea type="date" :value.sync="baseData.date"> </hb-editarea>
101
+ </li>
102
+ <li class="editarea-li">
103
+ <h3>时间范围(无提交)</h3>
104
+ <hb-editarea
105
+ type="daterange"
106
+ :value.sync="baseData.dateRange"
107
+ :insert="insertEdit('dateRange')"
108
+ :change="changeEdit('dateRange')"
109
+ >
110
+ </hb-editarea>
111
+ </li>
112
+ </ul>
113
+ </div>
114
+ </template>
115
+
116
+ <script>
117
+ export default {
118
+ data() {
119
+ return {
120
+ // 基本数据
121
+ baseData: {
122
+ code: "123456",
123
+ name: "小红",
124
+ word: "A,B,C",
125
+ open: true,
126
+ size: "小",
127
+ color: "红,绿",
128
+ date: "2020-10-10",
129
+ dateRange: "2020-10-10,2021-12-01",
130
+ },
131
+ // insert配置
132
+ // 注意,以下示例代码都是label无重复的情况下的演示,如果存在重复的label,需要另外去find/filter对应数据
133
+ insertConfig: {
134
+ // 从list找到当前name的value填充而非label
135
+ name: (value) => {
136
+ const currentName = this.optList.name.find(
137
+ (item) => item.label === value
138
+ ); //
139
+ return currentName ? currentName.value : "";
140
+ },
141
+ // 填充多个value而非label
142
+ word: (value) => {
143
+ const currentWords = this.optList.word.filter(
144
+ (item) => value.split(",").indexOf(item.label) !== -1
145
+ );
146
+ return currentWords.length
147
+ ? currentWords.map((item) => item.value)
148
+ : [];
149
+ },
150
+ // 从list找到当前size的value传入
151
+ size: (value) => {
152
+ const currentSize = this.optList.size.find(
153
+ (item) => item.label === value
154
+ );
155
+ return currentSize ? currentSize.value : "";
156
+ },
157
+ // 从list找到当前color的value传入
158
+ color: (value) => {
159
+ const currentColor = this.optList.color.filter(
160
+ (item) => value.split(",").indexOf(item.label) !== -1
161
+ );
162
+ return currentColor ? currentColor.map((item) => item.value) : [];
163
+ },
164
+ //
165
+ dateRange: (value) => {
166
+ return value ? value.split(",") : [];
167
+ },
168
+ },
169
+ // change配置
170
+ changeConfig: {
171
+ // 模拟提交code修改
172
+ code: (next, value) => {
173
+ console.log("code", value);
174
+ setTimeout(() => {
175
+ this.$set(this.baseData, "code", value);
176
+ next();
177
+ }, 800);
178
+ },
179
+ // 模拟提交name的id
180
+ name: (next, value) => {
181
+ const currentName = this.optList.name.find(
182
+ (item) => item.value === value
183
+ ); // 从list找到当前name
184
+ setTimeout(() => {
185
+ if (currentName) {
186
+ this.$set(this.baseData, "name", currentName.label);
187
+ }
188
+ next();
189
+ }, 800);
190
+ },
191
+ // 模拟提交word的多个id
192
+ word: (next, value) => {
193
+ console.log("value", value);
194
+ const currentWords = this.optList.word.filter(
195
+ (item) => value.indexOf(item.value) !== -1
196
+ );
197
+ setTimeout(() => {
198
+ if (value.length) {
199
+ this.$set(
200
+ this.baseData,
201
+ "word",
202
+ currentWords.map((item) => item.label).join(",")
203
+ );
204
+ }
205
+ next();
206
+ }, 800);
207
+ },
208
+ // 切换大小
209
+ size: (next, value) => {
210
+ const currentSize = this.optList.size.find(
211
+ (item) => item.value === value
212
+ ); // 从list找到当前size
213
+ this.$set(this.baseData, "size", currentSize.label);
214
+ next();
215
+ },
216
+ // 切换颜色
217
+ color: (next, value) => {
218
+ const currentColor = this.optList.color.filter(
219
+ (item) => value.indexOf(item.value) !== -1
220
+ );
221
+ this.$set(
222
+ this.baseData,
223
+ "color",
224
+ currentColor.map((item) => item.label).join(",")
225
+ );
226
+ next();
227
+ },
228
+ dateRange: (next, value) => {
229
+ this.$set(this.baseData, "dateRange", value ? value.join(",") : "");
230
+ next();
231
+ },
232
+ },
233
+ // 校验
234
+ validate: {
235
+ asyncCode: (next, value) => {
236
+ setTimeout(() => {
237
+ next(value.length < 5 ? null : new Error("最多不能超过4个字"));
238
+ }, 500);
239
+ },
240
+ code: (next, value) => {
241
+ next(value.length < 5 ? null : new Error("最多不能超过4个字"));
242
+ },
243
+ },
244
+ // 数据依赖
245
+ optList: {
246
+ nameText: [
247
+ {
248
+ label: "小红",
249
+ value: "小红",
250
+ },
251
+ {
252
+ label: "小白",
253
+ value: "小白",
254
+ },
255
+ {
256
+ label: "小黑",
257
+ value: "小黑",
258
+ },
259
+ ],
260
+ name: [
261
+ {
262
+ label: "小红",
263
+ value: "1",
264
+ },
265
+ {
266
+ label: "小白",
267
+ value: "2",
268
+ },
269
+ {
270
+ label: "小黑",
271
+ value: "3",
272
+ },
273
+ ],
274
+ word: [
275
+ {
276
+ label: "A",
277
+ value: "a",
278
+ },
279
+ {
280
+ label: "B",
281
+ value: "b",
282
+ },
283
+ {
284
+ label: "C",
285
+ value: "c",
286
+ },
287
+ ],
288
+ open: ["开", "关"],
289
+ size: [
290
+ { value: "small", label: "小" },
291
+ { value: "middle", label: "中" },
292
+ { value: "big", label: "大" },
293
+ ],
294
+ color: [
295
+ {
296
+ label: "红",
297
+ value: "red",
298
+ },
299
+ {
300
+ label: "蓝",
301
+ value: "blue",
302
+ },
303
+ {
304
+ label: "绿",
305
+ value: "green",
306
+ },
307
+ ],
308
+ },
309
+ };
310
+ },
311
+ methods: {
312
+ /**
313
+ * @function insertEdit 手动填充编辑区域
314
+ * @param {String} key 关键字
315
+ */
316
+ insertEdit(key) {
317
+ return this.insertConfig[key];
318
+ },
319
+ /**
320
+ * @function insertEdit 手动处理编辑结果
321
+ * @param {String} key 关键字
322
+ */
323
+ changeEdit(key) {
324
+ return this.changeConfig[key];
325
+ },
326
+ },
327
+ mounted() {},
328
+ };
329
+ </script>
330
+
331
+ <style lang="scss">
332
+ .editarea-ul {
333
+ .editarea-li {
334
+ float: left;
335
+ box-sizing: border-box;
336
+ margin-right: 10%;
337
+ padding: 12px 24px 0 24px;
338
+ width: 15%;
339
+ h3 {
340
+ height: 24px;
341
+ line-height: 24px;
342
+ }
343
+ p {
344
+ height: 28px;
345
+ line-height: 28px;
346
+ // background-color: #e6e6e6;
347
+ }
348
+ }
349
+ }
350
+ </style>
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <div>
3
+ <hb-filterdrop :columns="columns" @changeColumn="handleChangeColumn">
4
+ <i slot="dropdown" class="fd-icon el-icon-s-operation"></i>
5
+ </hb-filterdrop>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ data() {
12
+ return {
13
+ columns: [
14
+ {
15
+ prop: "name",
16
+ label: "名称",
17
+ currentSelect: true,
18
+ },
19
+ {
20
+ prop: "code",
21
+ label: "编码",
22
+ currentSelect: true,
23
+ },
24
+ {
25
+ prop: "company",
26
+ label: "公司",
27
+ currentSelect: true,
28
+ },
29
+ {
30
+ prop: "addr",
31
+ label: "地址",
32
+ currentSelect: true,
33
+ },
34
+ {
35
+ prop: "desc",
36
+ label: "简介",
37
+ currentSelect: true,
38
+ },
39
+ {
40
+ prop: "remark",
41
+ label: "说明",
42
+ currentSelect: true,
43
+ },
44
+ ],
45
+ };
46
+ },
47
+ methods: {
48
+ /**
49
+ * @function handleChangeColumn 列改变
50
+ */
51
+ handleChangeColumn(newColumns) {
52
+ this.$message.success("列改变");
53
+ this.columns = newColumns;
54
+ console.log(newColumns);
55
+ },
56
+ },
57
+ mounted() {},
58
+ };
59
+ </script>
60
+
61
+ <style lang="scss">
62
+ .fd-icon {
63
+ width: 24px;
64
+ min-width: 24px;
65
+ height: 24px;
66
+ border: 1px solid #dbdbdb;
67
+ border-radius: 4px;
68
+ line-height: 24px !important;
69
+ text-align: center;
70
+ background: #fff;
71
+ }
72
+ </style>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div class="wrapper">
3
+ <hb-float-footer
4
+ @confirm="confirm"
5
+ @exist="exist"
6
+ :label="label"
7
+ :zIndex="zIndex"
8
+ ></hb-float-footer>
9
+ </div>
10
+ </template>
11
+ <script>
12
+ export default {
13
+ data() {
14
+ return {
15
+ zIndex: 200, //组件内默认100
16
+ label: {
17
+ confirm: "保存",
18
+ exist: "重置",
19
+ },
20
+ };
21
+ },
22
+ methods: {
23
+ confirm() {
24
+ console.log("点击了确定按钮");
25
+ },
26
+ exist() {
27
+ console.log("点击了取消按钮");
28
+ },
29
+ },
30
+ };
31
+ </script>
32
+
33
+ <style lang="scss" scoped>
34
+ .wrapper {
35
+ background: #999;
36
+ width: 800px;
37
+ height: 300px;
38
+ position: relative;
39
+ margin: auto;
40
+ top: 100px;
41
+ }
42
+ </style>