ol-base-components 2.9.3 → 3.0.0

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.
@@ -0,0 +1,342 @@
1
+ @font-face {
2
+ font-family: "iconfont"; /* Project id 3559670 */
3
+ src: url("iconfont.woff2?t=1667531544868") format("woff2"),
4
+ url("iconfont.woff?t=1667531544868") format("woff"),
5
+ url("iconfont.ttf?t=1667531544868") format("truetype");
6
+ }
7
+
8
+ .iconfont {
9
+ font-family: "iconfont" !important;
10
+ font-size: 16px;
11
+ font-style: normal;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ .sv-edit-data:before {
17
+ content: "\e655";
18
+ }
19
+
20
+ .sv-shimmer:before {
21
+ content: "\e6d6";
22
+ }
23
+
24
+ .sv-origin:before {
25
+ content: "\e6ac";
26
+ }
27
+
28
+ .sv-zIndex:before {
29
+ content: "\e603";
30
+ }
31
+
32
+ .sv-structure:before {
33
+ content: "\ec6f";
34
+ }
35
+
36
+ .sv-list:before {
37
+ content: "\e742";
38
+ }
39
+
40
+ .sv-grid:before {
41
+ content: "\e849";
42
+ }
43
+
44
+ .sv-flow:before {
45
+ content: "\e611";
46
+ }
47
+
48
+ .sv-switch:before {
49
+ content: "\e6f6";
50
+ }
51
+
52
+ .sv-theme:before {
53
+ content: "\e644";
54
+ }
55
+
56
+ .sv-element:before {
57
+ content: "\e615";
58
+ }
59
+
60
+ .sv-pdf:before {
61
+ content: "\e67a";
62
+ }
63
+
64
+ .sv-browser:before {
65
+ content: "\e726";
66
+ }
67
+
68
+ .sv-font-big:before {
69
+ content: "\eb04";
70
+ }
71
+
72
+ .sv-font-small:before {
73
+ content: "\eb05";
74
+ }
75
+
76
+ .sv-font-bold:before {
77
+ content: "\ec83";
78
+ }
79
+
80
+ .sv-font-tiny:before {
81
+ content: "\e6c1";
82
+ }
83
+
84
+ .sv-options:before {
85
+ content: "\e607";
86
+ }
87
+
88
+ .sv-close:before {
89
+ content: "\e646";
90
+ }
91
+
92
+ .sv-clone:before {
93
+ content: "\ec7a";
94
+ }
95
+
96
+ .sv-cut:before {
97
+ content: "\e643";
98
+ }
99
+
100
+ .sv-preview:before {
101
+ content: "\e61c";
102
+ }
103
+
104
+ .sv-zoom-in:before {
105
+ content: "\e60f";
106
+ }
107
+
108
+ .sv-zoom-out:before {
109
+ content: "\e610";
110
+ }
111
+
112
+ .sv-edit:before {
113
+ content: "\e6b9";
114
+ }
115
+
116
+ .sv-paste:before {
117
+ content: "\e6c0";
118
+ }
119
+
120
+ .sv-copy:before {
121
+ content: "\e6c2";
122
+ }
123
+
124
+ .sv-unlock:before {
125
+ content: "\e6e7";
126
+ }
127
+
128
+ .sv-lock:before {
129
+ content: "\e6e8";
130
+ }
131
+
132
+ .sv-zIndex-plus:before {
133
+ content: "\e715";
134
+ }
135
+
136
+ .sv-zIndex-minus:before {
137
+ content: "\e716";
138
+ }
139
+
140
+ .sv-zIndex-top:before {
141
+ content: "\e71f";
142
+ }
143
+
144
+ .sv-sigh:before {
145
+ content: "\e724";
146
+ }
147
+
148
+ .sv-ask:before {
149
+ content: "\e725";
150
+ }
151
+
152
+ .sv-dev-code:before {
153
+ content: "\e733";
154
+ }
155
+
156
+ .sv-bug:before {
157
+ content: "\e73f";
158
+ }
159
+
160
+ .sv-zIndex-bottom:before {
161
+ content: "\e71d";
162
+ }
163
+
164
+ .sv-new:before {
165
+ content: "\e64d";
166
+ }
167
+
168
+ .sv-clear:before {
169
+ content: "\e62d";
170
+ }
171
+
172
+ .sv-base:before {
173
+ content: "\e7d0";
174
+ }
175
+
176
+ .sv-export:before {
177
+ content: "\eabf";
178
+ }
179
+
180
+ .sv-import:before {
181
+ content: "\eac0";
182
+ }
183
+
184
+ .sv-add:before {
185
+ content: "\eaf3";
186
+ }
187
+
188
+ .sv-printer:before {
189
+ content: "\eabe";
190
+ }
191
+
192
+ .sv-save:before {
193
+ content: "\eabd";
194
+ }
195
+
196
+ .sv-more:before {
197
+ content: "\e625";
198
+ }
199
+
200
+ .sv-menu:before {
201
+ content: "\e628";
202
+ }
203
+
204
+ .sv-nav-right:before {
205
+ content: "\e629";
206
+ }
207
+
208
+ .sv-nav-up:before {
209
+ content: "\e62a";
210
+ }
211
+
212
+ .sv-nav-left:before {
213
+ content: "\e62b";
214
+ }
215
+
216
+ .sv-nav-down:before {
217
+ content: "\e62c";
218
+ }
219
+
220
+ .sv-setting:before {
221
+ content: "\e62e";
222
+ }
223
+
224
+ .sv-delete:before {
225
+ content: "\e630";
226
+ }
227
+
228
+ .sv-undo:before {
229
+ content: "\e631";
230
+ }
231
+
232
+ .sv-redo:before {
233
+ content: "\e632";
234
+ }
235
+
236
+ .sv-refresh:before {
237
+ content: "\e634";
238
+ }
239
+
240
+ .sv-history:before {
241
+ content: "\e635";
242
+ }
243
+
244
+ .sv-html:before {
245
+ content: "\e633";
246
+ }
247
+
248
+ .sv-longText:before {
249
+ content: "\e64c";
250
+ }
251
+
252
+ .sv-table:before {
253
+ content: "\ec15";
254
+ }
255
+
256
+ .sv-qrcode:before {
257
+ content: "\e642";
258
+ }
259
+
260
+ .sv-image:before {
261
+ content: "\e8ba";
262
+ }
263
+
264
+ .sv-barcode:before {
265
+ content: "\eb64";
266
+ }
267
+
268
+ .sv-text:before {
269
+ content: "\e60b";
270
+ }
271
+
272
+ .sv-vline:before {
273
+ content: "\e63a";
274
+ }
275
+
276
+ .sv-oval:before {
277
+ content: "\eb99";
278
+ }
279
+
280
+ .sv-rect:before {
281
+ content: "\e620";
282
+ }
283
+
284
+ .sv-hline:before {
285
+ content: "\e60a";
286
+ }
287
+
288
+ .sv-print-c:before {
289
+ content: "\e602";
290
+ }
291
+
292
+ .sv-print:before {
293
+ content: "\e601";
294
+ }
295
+
296
+ .sv-c:before {
297
+ content: "\e600";
298
+ }
299
+
300
+ .sv-vertical:before {
301
+ content: "\e706";
302
+ }
303
+
304
+ .sv-distributeHor:before {
305
+ content: "\e707";
306
+ }
307
+
308
+ .sv-right:before {
309
+ content: "\e708";
310
+ }
311
+
312
+ .sv-left:before {
313
+ content: "\e709";
314
+ }
315
+
316
+ .sv-distributeVer:before {
317
+ content: "\e70f";
318
+ }
319
+
320
+ .sv-bottom:before {
321
+ content: "\e710";
322
+ }
323
+
324
+ .sv-top:before {
325
+ content: "\e711";
326
+ }
327
+
328
+ .sv-horizontal:before {
329
+ content: "\e712";
330
+ }
331
+
332
+ .sv-rotate:before {
333
+ content: "\e66f";
334
+ }
335
+
336
+ .sv-butongbu:before {
337
+ content: "\e636";
338
+ }
339
+
340
+ .sv-synchronization:before {
341
+ content: "\e676";
342
+ }
package/src/main.js CHANGED
@@ -2,13 +2,12 @@ import Vue from "vue";
2
2
  import ElementUI from "element-ui";
3
3
  import "element-ui/lib/theme-chalk/index.css";
4
4
  import App from "./App.vue";
5
- import OlCom, { swaggerInstall } from "@/package/index.js";
5
+ import OlCom, { swaggerInstall, Hiprint } from "@/package/index.js";
6
6
  Vue.use(ElementUI);
7
+ Vue.use(Hiprint);
7
8
 
8
9
  Vue.use(OlCom);
9
- swaggerInstall("http://220.179.249.140:20019/swagger/v1/swagger.json").then(
10
- () => {}
11
- );
10
+ swaggerInstall("http://220.179.249.140:20025/swagger/v1/swagger.json").then(() => {});
12
11
  new Vue({
13
- render: (h) => h(App),
12
+ render: h => h(App),
14
13
  }).$mount("#app");
@@ -188,7 +188,6 @@
188
188
  import { getData } from "../../index.js";
189
189
  import { getEnum } from "../../../utils/getEnum.js";
190
190
  import OlNumberRange from "../../numberRange/index.js";
191
- import { camelCaseToChinese } from "./index.js";
192
191
 
193
192
  export default {
194
193
  name: "search",
@@ -279,7 +278,7 @@ export default {
279
278
  type: Boolean,
280
279
  },
281
280
  //获取swagger后的钩子,返回swagger结构数据。用于处理swagger数据
282
- swaggerColumnsProcessor: {
281
+ onSwagger: {
283
282
  type: Function,
284
283
  default: null,
285
284
  },
@@ -321,10 +320,10 @@ export default {
321
320
  async init() {
322
321
  const swaggerData = await getData();
323
322
  let swaggersearchColumns = swaggerData.paths[this.url].get.parameters || [];
324
- if (typeof this.swaggerColumnsProcessor === "function") {
323
+ if (typeof this.onSwagger === "function") {
325
324
  try {
326
- const res = await this.swaggerColumnsProcessor({ swaggersearchColumns });
327
- swaggersearchColumns = res;
325
+ const res = await this.onSwagger({ columns: swaggersearchColumns });
326
+ if (res) swaggersearchColumns = res;
328
327
  } catch (err) {}
329
328
  }
330
329
  swaggersearchColumns.forEach(item => {
@@ -3,6 +3,7 @@ import OlSearch from "./formSearch";
3
3
  import Dialog from "./dialog";
4
4
  import OlForm from "./form";
5
5
  import OlNumberRange from "./numberRange";
6
+ import OlPrint, { Hiprint } from "./print";
6
7
 
7
8
  import SwaggerClient from "swagger-client";
8
9
 
@@ -204,7 +205,7 @@ function hideLoading() {
204
205
  }
205
206
  }
206
207
 
207
- const components = [OlTable, OlSearch, Dialog, OlForm, OlNumberRange];
208
+ const components = [OlTable, OlSearch, Dialog, OlForm, OlNumberRange, OlPrint];
208
209
  const install = async function (Vue) {
209
210
  // 设置全局数据
210
211
  components.map(item => {
@@ -214,5 +215,5 @@ const install = async function (Vue) {
214
215
  };
215
216
 
216
217
  export default install;
217
- export { OlTable, OlSearch, Dialog, OlForm, OlNumberRange };
218
- export { swaggerInstall, swaggerUnload };
218
+ export { OlTable, OlSearch, Dialog, OlForm, OlNumberRange, OlPrint };
219
+ export { swaggerInstall, swaggerUnload, Hiprint };
@@ -0,0 +1,56 @@
1
+ import OlPrint from "./src/index.vue";
2
+
3
+ // 方式1:组件方式注册
4
+ OlPrint.install = function (Vue) {
5
+ Vue.component("ol-print", OlPrint);
6
+ };
7
+
8
+ // 方式2:插件方式注册(全局方法)
9
+ let printInstance = null;
10
+ let container = null;
11
+
12
+ const Hiprint = {
13
+ install(Vue) {
14
+ Vue.prototype.$hiprint = function (data, template) {
15
+ // 销毁旧实例
16
+ if (printInstance) {
17
+ printInstance.$destroy();
18
+ if (container && container.parentNode) {
19
+ container.parentNode.removeChild(container);
20
+ }
21
+ printInstance = null;
22
+ container = null;
23
+ }
24
+
25
+ // 创建新实例
26
+ container = document.createElement("div");
27
+ document.body.appendChild(container);
28
+
29
+ const PrintComponent = Vue.extend(OlPrint);
30
+ printInstance = new PrintComponent({
31
+ propsData: {
32
+ printData: data || {},
33
+ onTemplate: template,
34
+ },
35
+ });
36
+
37
+ printInstance.$mount(container);
38
+ };
39
+
40
+ // 提供销毁方法(可选)
41
+ Vue.prototype.$hiprint.destroy = function () {
42
+ if (printInstance) {
43
+ printInstance.$destroy();
44
+ if (container && container.parentNode) {
45
+ container.parentNode.removeChild(container);
46
+ }
47
+ printInstance = null;
48
+ container = null;
49
+ }
50
+ };
51
+ },
52
+ };
53
+
54
+ // 导出组件和插件
55
+ export { OlPrint, Hiprint };
56
+ export default OlPrint;