ap-dev 1.1.14 → 1.1.18

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.
@@ -10,7 +10,7 @@
10
10
  :props="defaultProps"
11
11
  default-expand-all
12
12
  :filter-node-method="filterNode"
13
- @node-click="handleNodeClick"
13
+ @node-click="handleNodeClick"
14
14
  />
15
15
  </div>
16
16
  </ap-aside>
@@ -23,6 +23,7 @@
23
23
 
24
24
  <script>
25
25
  import menus from './menus'
26
+ import ApiIconList from './modules/ApiIconList'
26
27
 
27
28
  // 批量导入modules下的组件
28
29
  const allComponents = require.context('./modules', false, /\.vue$/)
@@ -32,6 +33,8 @@ allComponents.keys().forEach(fileName => {
32
33
  apiComponents[fileName.replace(/^\.\/(.*)\.\w+$/, '$1')] = comp.default
33
34
  })
34
35
 
36
+ apiComponents.ApiIconList = ApiIconList
37
+
35
38
  export default {
36
39
  name: 'ApiPanel',
37
40
  components: apiComponents,
@@ -65,4 +68,4 @@ export default {
65
68
 
66
69
  <style scoped>
67
70
 
68
- </style>
71
+ </style>
@@ -66,9 +66,12 @@ const menus = [
66
66
  }, {
67
67
  id: 'ApiIconList',
68
68
  label: '4.3 Icon 图标'
69
+ }, {
70
+ id: 'ApiVueUtils',
71
+ label: '4.4 常用工具类'
69
72
  }, {
70
73
  id: 'ApiOtherVue',
71
- label: '4.4 其他'
74
+ label: '4.5 其他'
72
75
  }]
73
76
  }, {
74
77
  id: 'ApiDefault',
@@ -0,0 +1,433 @@
1
+ const iconGroup = [
2
+ {
3
+ name: "报表类",
4
+ icons: [
5
+ 'search',
6
+ 'fenlei',
7
+ 'fenlei2',
8
+ 'bottom-left',
9
+
10
+ 's-marketing',
11
+ 's-data',
12
+ 'pie-chart',
13
+ 'chart-radar',
14
+ 'chart-gauge',
15
+ 'chart-pie',
16
+ 'chart-line',
17
+ 'dashboard',
18
+ 'chart-bar',
19
+
20
+ 'monitor',
21
+ 'data-line',
22
+ 'data-analysis',
23
+ 'data-board',
24
+ 'pc',
25
+ ]
26
+ }, {
27
+ name: "模块类",
28
+ icons: [
29
+ 's-grid',
30
+ 'menu',
31
+ 'mokuai2',
32
+ 'mokuai1',
33
+ 'fenlei3',
34
+ 'mokuai5',
35
+ 'mokuai4',
36
+ 'mokuai3',
37
+ 'mokuai',
38
+ 'component',
39
+ 'group2',
40
+ 'example',
41
+ 'yingyongmokuai',
42
+ 'group',
43
+ 'zhongxin1',
44
+
45
+ 'coin',
46
+ 'pic-part',
47
+ 'part',
48
+ 'share',
49
+ 'list',
50
+ ]
51
+ }, {
52
+ name: "配置类",
53
+ icons: [
54
+ 's-tools',
55
+ 'setting',
56
+ 'canshupeizhi',
57
+ 'peizhi2',
58
+ 'peizhi3',
59
+ 'kaifapeizhi',
60
+
61
+
62
+ 'set-up',
63
+ 'key',
64
+ 'key',
65
+ 'auth',
66
+
67
+ 's-operation',
68
+ 'peizhi4',
69
+ 'peizhi1',
70
+ 'close-notification',
71
+ ]
72
+ }, {
73
+ name: "人员类",
74
+ icons: [
75
+ 'bumenguanli',
76
+ 'org',
77
+ 'tree',
78
+ 'tree-table',
79
+
80
+ 'delete-location',
81
+ 'users',
82
+ 'users2',
83
+ 'peoples',
84
+ 'users3',
85
+
86
+ 'user-solid',
87
+ 'user',
88
+ 's-custom',
89
+ 'wode',
90
+ 'user-setting',
91
+ 'user2',
92
+ 'role',
93
+ 'user-auth',
94
+ 'user-key',
95
+ 'my',
96
+ 'service',
97
+ 'idcard',
98
+ ]
99
+ }, {
100
+ name: "信息类",
101
+ icons: [
102
+ 's-promotion',
103
+ 'guide',
104
+ 'position',
105
+ 's-flag',
106
+ 'collection-tag',
107
+ 'price-tag',
108
+ 'discount',
109
+
110
+ 'warning',
111
+ 'warning-outline',
112
+ 'question',
113
+ 'info',
114
+
115
+
116
+ 's-help',
117
+ 'help',
118
+ 'bangzhu',
119
+ 'loading',
120
+ 'time',
121
+ 'workTime',
122
+
123
+ 'news',
124
+ 'youjian',
125
+ 'email',
126
+ 's-comment',
127
+ 'chat-round',
128
+ 'chat-line-round',
129
+ 'chat-square',
130
+ 'chat-dot-square',
131
+ 'chat-line-square',
132
+ 'message',
133
+ 'duanxin',
134
+ 'xiaoxi',
135
+ 'xiaoxi1',
136
+ 'message',
137
+ 'tooltip',
138
+ 'chat-dot-round',
139
+ ]
140
+ }, {
141
+ name: "操作类",
142
+ icons: [
143
+ 'refresh',
144
+ 'refresh-right',
145
+ 'refresh-left',
146
+ 'transfer',
147
+ 'exchange',
148
+ 'mail-forward',
149
+ 'mail-reply',
150
+ 'history',
151
+ 'switch-button',
152
+ 'close2',
153
+ 'out',
154
+ 'upload2',
155
+ 'download',
156
+ 'upload',
157
+ 'copy-document',
158
+ 'copy',
159
+ 'copy2',
160
+ 'edit',
161
+ 'edit-outline',
162
+ 'floppy-o',
163
+ 'delete-solid',
164
+ 'delete',
165
+ 'trash-o',
166
+
167
+ // 增删改查
168
+ 'remove',
169
+ 'circle-plus',
170
+ 'success',
171
+ 'error',
172
+ 'zoom-in',
173
+ 'zoom-out',
174
+ 'remove-outline',
175
+ 'circle-plus-outline',
176
+ 'circle-check',
177
+ 'circle-close',
178
+ 'finished',
179
+ 'minus',
180
+ 'plus',
181
+ 'check',
182
+ 'close',
183
+
184
+ // 方向
185
+ 'd-caret',
186
+ 'caret-left',
187
+ 'caret-right',
188
+ 'ap-caret-right',
189
+ 'ap-caret-left',
190
+ 'caret-bottom',
191
+ 'caret-top',
192
+ 'title-flag',
193
+ 'arrow-down',
194
+ 'arrow-up',
195
+ 'd-arrow-left',
196
+ 'd-arrow-right',
197
+ 'sort',
198
+ 'sort-up',
199
+ 'sort-down',
200
+ 'bottom-right',
201
+ 'back',
202
+ 'right',
203
+ 'bottom',
204
+ 'top',
205
+ 'top-left',
206
+ 'top-right',
207
+ 'arrow-left',
208
+ 'arrow-right',
209
+
210
+ 'video-pause',
211
+ 'video-play',
212
+ 'star-on',
213
+ 'star-off',
214
+ 'more-outline',
215
+ 'more',
216
+
217
+ 's-fold',
218
+ 's-unfold',
219
+ 'aim',
220
+ 'lock',
221
+ 'unlock',
222
+ 'password',
223
+ 'rank',
224
+ 'full-screen',
225
+ 'drag',
226
+ 'crop',
227
+
228
+ 'eye-slash',
229
+ 'eye',
230
+ 'view',
231
+ 'eye-open',
232
+ 'exit-fullscreen',
233
+ 'fullscreen',
234
+
235
+
236
+ 'female',
237
+ 'male',
238
+ 'link',
239
+ 'connection',
240
+
241
+ 'model',
242
+ 'place',
243
+ 'location',
244
+ 'location-information',
245
+ 'location-outline',
246
+ 'add-location',
247
+ 'map-location',
248
+
249
+
250
+
251
+ // 富文本
252
+ 'button',
253
+ 'check-square-o',
254
+ 'open',
255
+ 'turn-off',
256
+ 'input-number',
257
+ 'nested',
258
+ 'textarea',
259
+ 'select',
260
+ 'switch',
261
+ 'fixed-left',
262
+ 'fixed-right',
263
+ 'layout-sx',
264
+ 'icon',
265
+ 'input',
266
+ 'tab',
267
+ 'container-row',
268
+ 'date',
269
+ 'language',
270
+ 'size',
271
+ 'radio',
272
+ 'date-time',
273
+ 'table',
274
+ 'code',
275
+ 'c-scale-to-original',
276
+
277
+ 'thumb',
278
+ 'zhipai',
279
+ '404',
280
+ ]
281
+ }, {
282
+ name: "文档类",
283
+ icons: [
284
+ 'folder',
285
+ 'folder-opened',
286
+ 'files',
287
+ 'receiving',
288
+ 'folder-add',
289
+ 'folder-remove',
290
+ 'folder-delete',
291
+ 'folder-checked',
292
+
293
+
294
+ 'skill',
295
+ 'wendangpeizhi',
296
+ 'form',
297
+
298
+ 's-order',
299
+ 's-release',
300
+ 's-claim',
301
+ 'tickets',
302
+ 'document-add',
303
+ 'document-remove',
304
+ 'document-delete',
305
+ 'document-checked',
306
+ 'document',
307
+ 'postcard',
308
+ 'file-o',
309
+ 'documentation',
310
+ 'file-text-o',
311
+
312
+ 'message-box',
313
+ 'document-copy',
314
+ 'clipboard',
315
+
316
+ 'dictionary',
317
+ 's-management',
318
+ 'notebook-2',
319
+ 'notebook-1',
320
+ 'collection',
321
+
322
+ 'reading',
323
+ 'education',
324
+
325
+ 'excel',
326
+ 'pdf',
327
+ 'zip',
328
+ 'printer',
329
+ ]
330
+ }, {
331
+ name: "财务类",
332
+ icons: [
333
+ 'wallet',
334
+ 'money',
335
+ 'bank-card',
336
+
337
+ ]
338
+ }, {
339
+ name: "物品类",
340
+ icons: [
341
+ 's-goods',
342
+ 'goods',
343
+ 'picture',
344
+ 'picture-outline',
345
+ 'picture-outline-round',
346
+ 'camera-solid',
347
+ 'camera',
348
+ 'video-camera-solid',
349
+ 'video-camera',
350
+ 'message-solid',
351
+ 'bell',
352
+ 's-cooperation',
353
+ 's-platform',
354
+ 's-open',
355
+ 's-finance',
356
+ 'brush',
357
+ 'scissors',
358
+ 'umbrella',
359
+ 'headset',
360
+ 'mouse',
361
+ 'coordinate',
362
+ 'suitcase',
363
+ 'suitcase-1',
364
+ 'toilet-paper',
365
+ 'table-lamp',
366
+ 'phone',
367
+ 'phone-outline',
368
+ 's-check',
369
+ 's-ticket',
370
+ 's-opportunity',
371
+ 'paperclip',
372
+ 'takeaway-box',
373
+ 'attract',
374
+ 'mobile',
375
+ 'magic-stick',
376
+ 'film',
377
+ 'no-smoking',
378
+ 'shopping',
379
+ 'shopping-cart-full',
380
+ 'shopping-cart-1',
381
+ 'shopping-cart-2',
382
+ 'shopping-bag-1',
383
+ 'shopping-bag-2',
384
+ 'sold-out',
385
+ 'sell',
386
+ 'present',
387
+ 'box',
388
+ 'cpu',
389
+ 'odometer',
390
+ 'microphone',
391
+ 'turn-off-microphone',
392
+ 'first-aid-kit',
393
+ 'stopwatch',
394
+ 'discover',
395
+ 'medal-1',
396
+ 'medal',
397
+ 'trophy',
398
+ 'trophy-1',
399
+ 'alarm-clock',
400
+ 'timer',
401
+ 'watch-1',
402
+ 'watch',
403
+ 'bug',
404
+ 'international',
405
+
406
+ 'smoking',
407
+ 'mic',
408
+ 'theme',
409
+ 'xin',
410
+ 'star',
411
+
412
+ 'home',
413
+ 's-shop',
414
+ 'office-building',
415
+ 'school',
416
+ 'house',
417
+ 's-home',
418
+
419
+ 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round',
420
+
421
+ 'vue',
422
+ 'java',
423
+ 'qq',
424
+ 'wechat',
425
+ 'dingding',
426
+ 'qiyeweixin',
427
+ 'sems',
428
+
429
+ ]
430
+ }
431
+ ]
432
+
433
+ export default iconGroup
@@ -1,21 +1,40 @@
1
1
  <template>
2
2
  <ap-container>
3
3
  <ap-header margin="1101">
4
+ <el-radio v-model="showType" :label="0">分类显示</el-radio>
4
5
  <el-radio v-model="showType" :label="1">自定义</el-radio>
5
6
  <el-radio v-model="showType" :label="2">Element默认</el-radio>
6
7
  <el-radio v-model="showType" :label="3">图片</el-radio>
7
8
  <div class="ap-split-line"/>
8
9
  </ap-header>
9
10
  <ap-main margin="0111" class="icons-container">
11
+ <template v-if="showType == 0">
12
+ <template v-for="group of iconGroup">
13
+ <el-collapse v-model="activeNames">
14
+ <el-collapse-item :title="group.name" :name="group.name">
15
+ <div v-for="item of group.icons" class="icon-ctn">
16
+ <div class="icon-item-ctn">
17
+ <span class="icon-item">
18
+ <i :class="getIconClass(item) " @click="copyIconCode(item,$event)"/>
19
+ </span>
20
+ </div>
21
+ <div class="icon-text-ctn">
22
+ <span class="icon-text" @click="copyIconClass(item,$event)">{{ getIconClass(item) }}</span>
23
+ </div>
24
+ </div>
25
+ </el-collapse-item>
26
+ </el-collapse>
27
+
28
+ </template>
29
+
30
+ </template>
31
+
10
32
  <template v-if="showType == 1">
11
33
  <div v-for="item of myIcons" :key="item.icon_id" class="icon-ctn">
12
34
  <div class="icon-item-ctn">
13
- <span class="icon-item">
14
- <i
15
- :class="getIconClass(item.font_class) "
16
- @click="copyIconCode(item.font_class,$event)"
17
- />
18
- </span>
35
+ <span class="icon-item">
36
+ <i :class="getIconClass(item.font_class) " @click="copyIconCode(item.font_class,$event)"/>
37
+ </span>
19
38
  </div>
20
39
  <div class="icon-text-ctn">
21
40
  <span class="icon-text"
@@ -56,6 +75,7 @@
56
75
  import clipboard from 'ap-util/util/ClipboardUtil'
57
76
  import icons from 'ap-frame/frame/assets/icon/iconfont.json'
58
77
  import elementIcons from './element-icons'
78
+ import iconGroup from './iconGroup'
59
79
 
60
80
  // 批量导入modules下的组件
61
81
  const allImg = require.context('ap-frame/frame/assets/images/icon', false)
@@ -67,14 +87,24 @@ allImg.keys().forEach(fileName => {
67
87
  export default {
68
88
  name: 'Icons',
69
89
  data() {
70
- const myIcons = icons.glyphs
90
+ const myIcons = icons.glyphs;
91
+ let activeNames = ["未分组"];
92
+ for (let i = 0; i < iconGroup.length; i++) {
93
+ activeNames.push(iconGroup[i].name)
94
+ }
71
95
  return {
72
96
  myIcons,
73
97
  elementIcons,
74
- showType: 1,
75
- iconImgs: iconImgs
98
+ showType: 0,
99
+ iconImgs: iconImgs,
100
+ iconGroup,
101
+ activeNames: activeNames
76
102
  }
77
103
  },
104
+ mounted() {
105
+ // 未分组处理
106
+ this.initUnGroup();
107
+ },
78
108
  methods: {
79
109
  getIconCode(value) {
80
110
  return `<i class="el-icon-${value}" />`
@@ -97,6 +127,40 @@ export default {
97
127
  copyIconImgName(value, event) {
98
128
  clipboard(value, event)
99
129
  },
130
+ initUnGroup(){
131
+ // 已分组
132
+ let addedArr = [];
133
+ for (let i = 0; i < this.iconGroup.length; i++) {
134
+ let icons = this.iconGroup[i].icons;
135
+ for (let j = 0; j < icons.length; j++) {
136
+ addedArr.push(icons[j]);
137
+ }
138
+ }
139
+
140
+ let unAddedArr = [];
141
+ // element自带
142
+ for (let i = 0; i < this.elementIcons.length; i++) {
143
+ let item = this.elementIcons[i];
144
+ if (addedArr.indexOf(item) < 0){
145
+ unAddedArr.push(item);
146
+ }
147
+ }
148
+
149
+ // 自定义
150
+ for (let i = 0; i < this.myIcons.length; i++) {
151
+ let name = this.myIcons[i].font_class;
152
+ if (addedArr.indexOf(name) < 0){
153
+ unAddedArr.push(name);
154
+ }
155
+ }
156
+ if (unAddedArr.length > 0) {
157
+ let unGroup = {
158
+ name: "未分组",
159
+ icons: unAddedArr
160
+ };
161
+ iconGroup.unshift(unGroup);
162
+ }
163
+ }
100
164
  }
101
165
  }
102
166
  </script>
@@ -154,5 +218,7 @@ export default {
154
218
  color: #1890FF;
155
219
  }
156
220
 
157
-
221
+ .icons-container .el-divider--horizontal {
222
+ float: left;
223
+ }
158
224
  </style>
@@ -10,7 +10,8 @@
10
10
 
11
11
  <script>
12
12
  import ApiArrayUtil from './../tabs/ApiArrayUtil'
13
- import ApiCacheUtil from './../tabs/ApiCacheUtil'
13
+ import ApiDictionaryUtil from './../tabs/ApiDictionaryUtil'
14
+ import ApiOrgUtil from './../tabs/ApiOrgUtil'
14
15
  import ApiDateUtil from './../tabs/ApiDateUtil'
15
16
  import ApiEMailUtil from './../tabs/ApiEMailUtil'
16
17
  import ApiExcelUtil from './../tabs/ApiExcelUtil'
@@ -21,12 +22,14 @@ import ApiListUtil from './../tabs/ApiListUtil'
21
22
  import ApiStringUtil from './../tabs/ApiStringUtil'
22
23
  import ApiQyWxUtil from './../tabs/ApiQyWxUtil'
23
24
  import ApiJavaCommonUtil from './../tabs/ApiJavaCommonUtil'
25
+ import ApiWebSocketUtil from './../tabs/ApiWebSocketUtil'
24
26
 
25
27
  export default {
26
28
  name: "ApiJavaUtils",
27
29
  components: {
28
30
  ApiArrayUtil,
29
- ApiCacheUtil,
31
+ ApiDictionaryUtil,
32
+ ApiOrgUtil,
30
33
  ApiDateUtil,
31
34
  ApiEMailUtil,
32
35
  ApiExcelUtil,
@@ -37,6 +40,7 @@ export default {
37
40
  ApiStringUtil,
38
41
  ApiQyWxUtil,
39
42
  ApiJavaCommonUtil,
43
+ ApiWebSocketUtil
40
44
  },
41
45
  data() {
42
46
  let opts = [
@@ -74,8 +78,14 @@ export default {
74
78
  label: 'QyWxUtil',
75
79
  component: 'ApiQyWxUtil',
76
80
  }, {
77
- label: 'CacheUtil',
78
- component: 'ApiCacheUtil',
81
+ label: 'DictionaryUtil',
82
+ component: 'ApiDictionaryUtil',
83
+ }, {
84
+ label: 'OrgUtil',
85
+ component: 'ApiOrgUtil',
86
+ },{
87
+ label: 'WebSocketUtil',
88
+ component: 'ApiWebSocketUtil',
79
89
  },
80
90
  ];
81
91
  return {
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <el-tabs v-model="activeName" tabPosition="left" class="api-tabs">
3
+ <template v-for="(item,index) in opts">
4
+ <el-tab-pane :label="item.label" :name="'tab' + index" class="api-tab">
5
+ <component :is="item.component"></component>
6
+ </el-tab-pane>
7
+ </template>
8
+ </el-tabs>
9
+ </template>
10
+
11
+ <script>
12
+ import ApiVueDateUtil from './../tabs/ApiVueDateUtil'
13
+ import ApiVueWebSocketUtil from './../tabs/ApiVueWebSocketUtil'
14
+
15
+ export default {
16
+ name: "ApiJavaUtils",
17
+ components: {
18
+ ApiVueDateUtil,
19
+ ApiVueWebSocketUtil,
20
+ },
21
+ data() {
22
+ let opts = [
23
+ {
24
+ label: "DateUtil",
25
+ component: "ApiVueDateUtil"
26
+ }, {
27
+ label: "WebSocketUtil",
28
+ component: "ApiVueWebSocketUtil"
29
+ }
30
+ ];
31
+ return {
32
+ activeName: 'tab0',
33
+ opts: opts
34
+ }
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <style scoped>
40
+ .api-tabs {
41
+ display: flex;
42
+ height: 100%;
43
+ }
44
+ .api-tabs /deep/ .el-tabs__content {
45
+ flex: 1;
46
+ overflow: scroll;
47
+ }
48
+ </style>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <api-tittle-2>数据字典工具类(缓存) - DictionaryUtil</api-tittle-2>
4
+ <api-table :data="methodData" :columns="methodCols"/>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
10
+
11
+ export default {
12
+ name: 'ApiDictionaryUtil',
13
+ components: {
14
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
15
+ },
16
+ data() {
17
+ const methodCols = [
18
+ {label: '方法名', prop: 'name', width: '220px'},
19
+ {label: '说明', prop: 'memo', width: '400px'},
20
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
21
+ const methodData = [
22
+ {
23
+ name: 'getOne',
24
+ memo: `获取数据字典:单项 (String)`,
25
+ code: `<span class="api-code">// 获取编码为"xxx"的字符串
26
+ String str = DictionaryUtil.getOne("xxx");</span>`
27
+ }, {
28
+ name: 'getOneForInteger',
29
+ memo: `获取数据字典:单项 (Integer)`,
30
+ code: `<span class="api-code">// 获取编码为"xxx"的数字
31
+ Integer str = DictionaryUtil.getOneForInteger("xxx");</span>`
32
+ }, {
33
+ name: 'getList',
34
+ memo: `获取数据字典:List (String)`,
35
+ code: `<span class="api-code">// 获取编码为"xxx"的list (String)
36
+ List&lt;String> a = DictionaryUtil.getList("xxx")</span>`
37
+ }, {
38
+ name: 'getListForInteger',
39
+ memo: `获取数据字典:List (Integer)`,
40
+ code: `<span class="api-code">// 获取编码为"xxx"的list (Integer)
41
+ List&lt;Integer> a = DictionaryUtil.getListForInteger("xxx")</span>`,
42
+ }
43
+ ]
44
+
45
+ return {
46
+ methodData,
47
+ methodCols
48
+ }
49
+ },
50
+ methods: {}
51
+ }
52
+ </script>
53
+
54
+ <style scoped>
55
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <api-tittle-2>组织部门/人员工具类(缓存) - OrgUtil</api-tittle-2>
4
+ <api-table :data="methodData" :columns="methodCols"/>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
10
+
11
+ export default {
12
+ name: 'ApiOrgUtil',
13
+ components: {
14
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
15
+ },
16
+ data() {
17
+ const methodCols = [
18
+ {label: '方法名', prop: 'name', width: '220px'},
19
+ {label: '说明', prop: 'memo', width: '400px'},
20
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
21
+ const methodData = [
22
+ {
23
+ name: 'getOrgGroup',
24
+ memo: `获取组织分组:公司别和用户权限过滤`,
25
+ code: `<span class="api-code">// 获取编码为"xxx"的组织分组:根据登录用户的权限和公司别,自动过滤数据
26
+ List&lt;OrgGroup> a = OrgUtil.getOrgGroup("xxx")</span>`
27
+ }, {
28
+ name: 'getOrgGroupByAll',
29
+ memo: `获取组织分组:不过滤`,
30
+ code: `<span class="api-code">// 不进行任何过滤
31
+ List&lt;OrgGroup> a = OrgUtil.getOrgGroupByAll("xxx")
32
+ </span>`
33
+ }, {
34
+ name: 'getOrgGroupByCompany',
35
+ memo: `获取组织分组:公司别过滤`,
36
+ code: `<span class="api-code">// 根据登录用户的公司别,自动过滤数据
37
+ List&lt;OrgGroup> a = OrgUtil.getOrgGroupByCompany("xxx")</span>`
38
+ }, {
39
+ name: 'getOrgGroupByCompany',
40
+ memo: `获取组织分组:公司别过滤<br>
41
+ getOrgGroupByCompany(code, companyId)<br>
42
+ 参数:<br>
43
+ 【String】code - 分组编码<br>
44
+ 【String】companyId - 公司别`,
45
+ code: `<span class="api-code">// 根据指定公司别,自动过滤数据
46
+ List&lt;OrgGroup> a = OrgUtil.getOrgGroupByCompany("xxx", "Xx")</span>`
47
+ }
48
+ ]
49
+
50
+ return {
51
+ methodData,
52
+ methodCols
53
+ }
54
+ },
55
+ methods: {}
56
+ }
57
+ </script>
58
+
59
+ <style scoped>
60
+ </style>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <h3>日期工具类 - DateUtil</h3>
4
+ <api-table :data="methodData" :columns="methodCols"/>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
10
+
11
+ export default {
12
+ name: 'ApiStringUtil',
13
+ components: {
14
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
15
+ },
16
+ data() {
17
+ const methodCols = [
18
+ {label: '方法名', prop: 'name', width: '220px'},
19
+ {label: '说明', prop: 'memo', width: '300px'},
20
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
21
+ const methodData = [
22
+ {
23
+ name: 'formatDate',
24
+ memo: `格式化日期<br><span class="api-memo">格式:yyyy-MM-dd hh:mm:ss。</span>`,
25
+ code: `<span class="api-code">// 1、导入方法
26
+ import {formatDate} from 'ap-util/util/DateUtil';
27
+
28
+ // 2、调用
29
+ let str = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss');
30
+ </span>`
31
+ }
32
+ ]
33
+
34
+ return {
35
+ methodData,
36
+ methodCols
37
+ }
38
+ },
39
+ methods: {}
40
+ }
41
+ </script>
42
+
43
+ <style scoped>
44
+ </style>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <h3>WebSocket工具类 - WebSocketUtil</h3>
4
+ <api-tittle-2>1、导入方法:</api-tittle-2>
5
+ <api-content>
6
+ <api-code>import {initWebSocket, sendMessage, sendMessageByPrefix,closeWebSocket} from "ap-util/util/WebSocketUtil";</api-code>
7
+ </api-content>
8
+
9
+ <api-tittle-2>2、初始化WebSocket:</api-tittle-2>
10
+ <api-content>
11
+ <b>初始化:</b><span class="api-code">initWebSocket(options)</span><br>
12
+ 【参数】id - [必填][唯一] 连接id<br>
13
+ 【参数】onmessage - 接收后端消息回调函数<br>
14
+ 【参数】onopen - 连接成功回调函数<br>
15
+ 【参数】onclose - 连接关闭回调函数<br>
16
+ 【参数】onerror - 连接错误回调函数<br>
17
+ 【参数】reconnect - 断开自动重连,默认true<br>
18
+
19
+ <api-code>{{js1}}</api-code>
20
+ </api-content>
21
+
22
+ <api-tittle-2>3、发送消息:两种方式,根据具体需求选择</api-tittle-2>
23
+ <api-tittle-2>3.1 前端方式发送消息:</api-tittle-2>
24
+ <api-content>
25
+ <b>单消息发送:</b><span class="api-code">sendMessage(id, message)</span><br>
26
+ 【参数】id - 连接id,同初始化时的id<br>
27
+ 【参数】message - 消息内容<br>
28
+ <api-code>// 例:给id为"demo123"的连接发消息<br>
29
+ sendMessage("demo123", "这是推给你的消息");</api-code><br>
30
+
31
+ <b>群发消息:</b><span class="api-code">sendMessageByPrefix(prefix, message)</span><br>
32
+ 【参数】prefix - 连接id的前缀<br>
33
+ 【参数】message - 消息内容<br>
34
+ <api-code>// 例:给以"demo"为开头的连接,群发消息<br>
35
+ sendMessageByPrefix("demo", "这是群发的消息");</api-code>
36
+ </api-content>
37
+ <api-tittle-2>3.2 后端方式发送消息:</api-tittle-2>
38
+ <api-content>
39
+ 参考后端工具类【WebSocketUtil】
40
+ </api-content>
41
+
42
+ <api-tittle-2>4、关闭WebSocket:</api-tittle-2>
43
+ <api-content>
44
+ 在页面Destroy前关闭连接,如下
45
+ <api-code>{{js2}}</api-code>
46
+ </api-content>
47
+
48
+ <api-tittle-2>5、完整示例:</api-tittle-2>
49
+ <api-content>
50
+ <api-code>{{js3}}</api-code>
51
+ </api-content>
52
+
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
58
+
59
+ export default {
60
+ name: 'ApiVueWebSocketUtil',
61
+ components: {
62
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
63
+ },
64
+ data() {
65
+ const js1 = `// 初始化:通常只需要配置id和onmessage即可
66
+ initWebSocket({
67
+ id: this.id,
68
+ onmessage: (event) => {
69
+ console.log("前端接收到消息啦!" + event.data);
70
+ }
71
+ })`
72
+ const js2 = `beforeDestroy() {
73
+ closeWebSocket(this.id);
74
+ },`
75
+ const js3 = `<template>
76
+ <ap-container>
77
+ <ap-main margin="1111">
78
+ <div>
79
+ <el-button type="primary" @click="sendMsg">单个发消息</el-button>
80
+ <el-button type="primary" @click="sendMessageByPrefix">群发消息</el-button>
81
+ </div>
82
+ </ap-main>
83
+ </ap-container>
84
+ </template>
85
+
86
+ <script>
87
+
88
+ import {closeWebSocket, initWebSocket, sendMessage, sendMessageByPrefix} from "ap-util/util/WebSocketUtil";
89
+
90
+ export default {
91
+ name: "DemoSocket",
92
+ mounted() {
93
+ initWebSocket({
94
+ id: this.id,
95
+ onmessage: (event) => {
96
+ console.log("前端接收到消息:" + event.data);
97
+ },
98
+ })
99
+ },
100
+ beforeDestroy() {
101
+ closeWebSocket(this.id);
102
+ },
103
+ data() {
104
+ return {
105
+ id: "demo" + new Date().getTime()
106
+ }
107
+ },
108
+ methods: {
109
+ sendMsg() {
110
+ sendMessage(this.id, "这是单一消息");
111
+ },
112
+ sendMessageByPrefix() {
113
+ sendMessageByPrefix("demo", "这是群发消息");
114
+ }
115
+ }
116
+ }
117
+ < /script>`
118
+
119
+ return {
120
+ js1,js2,js3
121
+ }
122
+ },
123
+ methods: {}
124
+ }
125
+ </script>
126
+
127
+ <style scoped>
128
+ </style>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <h3>WebSocket工具类 - WebSocketUtil</h3>
4
+ <api-table :data="methodData" :columns="methodCols"/>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
10
+
11
+ export default {
12
+ name: 'ApiWebSocketUtil',
13
+ components: {
14
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
15
+ },
16
+ data() {
17
+ const methodCols = [
18
+ {label: '方法名', prop: 'name', width: '220px'},
19
+ {label: '说明', prop: 'memo', width: '300px'},
20
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
21
+ const methodData = [
22
+ {
23
+ name: 'sendMessage',
24
+ memo: `单点消息:推送给指定的连接<br>`,
25
+ code: `<span class="api-code">// 给id为"demo123"的连接发消息
26
+ WebSocketUtil.sendMessage("demo123", "消息内容");
27
+ </span>`
28
+ },{
29
+ name: 'sendMessageByPrefix',
30
+ memo: `广播消息:推送给指定前缀的连接<br>`,
31
+ code: `<span class="api-code">// 给以"demo"为开头的连接,群发消息
32
+ WebSocketUtil.sendMessageByPrefix("demo", "消息内容");
33
+ </span>`
34
+ }
35
+ ]
36
+
37
+ return {
38
+ methodData,
39
+ methodCols
40
+ }
41
+ },
42
+ methods: {}
43
+ }
44
+ </script>
45
+
46
+ <style scoped>
47
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ap-dev",
3
- "version": "1.1.14",
3
+ "version": "1.1.18",
4
4
  "description": "===== ap-dev =====",
5
5
  "author": "xiexinbin",
6
6
  "email": "876818817@qq.com",
@@ -1,121 +0,0 @@
1
- <template>
2
- <div style="height: 100%">
3
- <api-tittle-2>Redis缓存工具类 - CacheUtil</api-tittle-2>
4
- <api-table :data="methodData" :columns="methodCols"/>
5
- </div>
6
- </template>
7
-
8
- <script>
9
- import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
10
-
11
- export default {
12
- name: 'ApiCacheUtil',
13
- components: {
14
- ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
15
- },
16
- data() {
17
- const methodCols = [
18
- {label: '方法名', prop: 'name', width: '220px'},
19
- {label: '说明', prop: 'memo', width: '400px'},
20
- {label: '示例代码', prop: 'code', minWidth: '100px'}]
21
- const methodData = [
22
- {
23
- name: 'getDictionary',
24
- memo: `获取数据字典:单项 Value默认String<br>
25
- getDictionary(key)<br>
26
- 参数:<br>
27
- 【String】key - 字典编码`,
28
- code: `<span class="api-code">// 1、controller或service中注入CacheUtil
29
- @Resource
30
- private CacheUtil cacheUtil;
31
- // 2、调用方法
32
- String str = cacheUtil.getDictionary("xxx");</span>`
33
- }, {
34
- name: 'getDictionary',
35
- memo: `获取数据字典:单项 Value<br>
36
- getDictionary(key, isInteger)<br>
37
- 参数:<br>
38
- 【String】key - 字典编码<br>
39
- 【boolean】isInteger - value类型:true->Integer; false->String
40
- `,
41
- code: `<span class="api-code">// 1、value为Integer <br>Integer a = cacheUtil.getDictionary("xxx", true);</span>`
42
- }, {
43
- name: 'getDictionaryList',
44
- memo: `获取数据字典:List Value默认String<br>
45
- getDictionaryList(key)<br>
46
- 参数:<br>
47
- 【String】key - 字典编码`,
48
- code: `<span class="api-code">List&lt;String> a = cacheUtil.getDictionaryList("xxx")</span>`
49
- }, {
50
- name: 'getDictionaryList',
51
- memo: `获取数据字典:List<br>
52
- getDictionaryList(key, isInteger)<br>
53
- 参数:<br>
54
- 【String】key - 字典编码<br>
55
- 【boolean】isInteger - value类型:true->Integer; false->String`,
56
- code: `<span class="api-code">List&lt;Integer> a = cacheUtil.getDictionaryList("xxx", true)</span>`,
57
- }, {
58
- name: 'getAuthOrgGroup',
59
- memo: `获取组织分组:公司别和用户权限过滤
60
- getAuthOrgGroup(code)<br>
61
- 参数:<br>
62
- 【String】code - 分组编码`,
63
- code: `<span class="api-code">// 根据登录用户的权限和公司别,自动过滤数据
64
- // 1、controller或service中注入CacheUtil
65
- @Resource
66
- private CacheUtil cacheUtil;
67
- // 2、调用方法
68
- List&lt;OrgGroup> a = cacheUtil.getAuthOrgGroup("xxx")</span>`
69
- }, {
70
- name: 'getCompanyOrgGroup',
71
- memo: `获取组织分组:公司别过滤
72
- getCompanyOrgGroup(code)<br>
73
- 参数:<br>
74
- 【String】code - 分组编码`,
75
- code: `<span class="api-code">// 根据登录用户的公司别,自动过滤数据
76
- ...
77
- List&lt;OrgGroup> a = cacheUtil.getCompanyOrgGroup("xxx")</span>`
78
- }, {
79
- name: 'getCompanyOrgGroup',
80
- memo: `获取组织分组:公司别过滤
81
- getCompanyOrgGroup(code, companyId)<br>
82
- 参数:<br>
83
- 【String】code - 分组编码<br>
84
- 【String】companyId - 公司别`,
85
- code: `<span class="api-code">// 根据公司别,自动过滤数据
86
- ...
87
- List&lt;OrgGroup> a = cacheUtil.getCompanyOrgGroup("xxx", "Xx")</span>`
88
- }, {
89
- name: 'getOrgGroup',
90
- memo: `获取组织分组
91
- getOrgGroup(code, user, companyId)<br>
92
- 参数:<br>
93
- 【String】code - 分组编码<br>
94
- 【LoginUser】user - 登录用户<br>
95
- 【String】companyId - 公司别`,
96
- code: `<span class="api-code">// 登录用户:不为空过滤权限;公司别:不为空过滤公司别
97
- ...
98
- List&lt;OrgGroup> a = cacheUtil.getOrgGroup("xxx", user, "Xx")</span>`
99
- }, {
100
- name: 'getAllOrgGroup',
101
- memo: `获取组织分组
102
- getAllOrgGroup(code)<br>
103
- 参数:<br>
104
- 【String】code - 分组编码`,
105
- code:`<span class="api-code">// 不进行任何过滤
106
- List&lt;OrgGroup> a = cacheUtil.getAllOrgGroup("xxx")
107
- </span>`
108
- }
109
- ]
110
-
111
- return {
112
- methodData,
113
- methodCols
114
- }
115
- },
116
- methods: {}
117
- }
118
- </script>
119
-
120
- <style scoped>
121
- </style>