ol-base-components 3.3.7 → 3.3.8
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/package.json
CHANGED
package/src/App.vue
CHANGED
package/src/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import OlCom, { swaggerInstall, Hiprint } from "@/package/index.js";
|
|
|
6
6
|
Vue.use(ElementUI);
|
|
7
7
|
Vue.use(Hiprint);
|
|
8
8
|
|
|
9
|
-
Vue.use(OlCom);
|
|
9
|
+
Vue.use(OlCom, { method: "post" });
|
|
10
10
|
swaggerInstall("http://220.179.249.140:20025/swagger/v1/swagger.json").then(() => {});
|
|
11
11
|
new Vue({
|
|
12
12
|
render: h => h(App),
|
|
@@ -288,7 +288,9 @@ export default {
|
|
|
288
288
|
// 请求方式 post get
|
|
289
289
|
method: {
|
|
290
290
|
type: String,
|
|
291
|
-
default:
|
|
291
|
+
default: () => {
|
|
292
|
+
return this.$olBaseConfig.method || "get";
|
|
293
|
+
},
|
|
292
294
|
},
|
|
293
295
|
},
|
|
294
296
|
data() {
|
|
@@ -332,7 +334,7 @@ export default {
|
|
|
332
334
|
},
|
|
333
335
|
methods: {
|
|
334
336
|
async init() {
|
|
335
|
-
if (!this.isCustoms) {
|
|
337
|
+
if (!this.isCustoms && this.url) {
|
|
336
338
|
const swaggerData = await getData();
|
|
337
339
|
let swaggersearchColumns = swaggerData.paths[this.url][this.method].parameters || [];
|
|
338
340
|
if (typeof this.onSwagger === "function") {
|
package/src/package/index.js
CHANGED
|
@@ -219,11 +219,12 @@ const components = [
|
|
|
219
219
|
OlPrint,
|
|
220
220
|
OlPrintModel,
|
|
221
221
|
];
|
|
222
|
-
const install = async function (Vue) {
|
|
222
|
+
const install = async function (Vue, options) {
|
|
223
223
|
// 设置全局数据
|
|
224
224
|
components.map(item => {
|
|
225
225
|
Vue.component(`ol-${item.name}`, item);
|
|
226
226
|
});
|
|
227
|
+
Vue.prototype.$olBaseConfig = options || {};
|
|
227
228
|
consoleTooltip();
|
|
228
229
|
};
|
|
229
230
|
|
|
@@ -443,7 +443,9 @@ export default {
|
|
|
443
443
|
// 请求方式 post get
|
|
444
444
|
method: {
|
|
445
445
|
type: String,
|
|
446
|
-
default:
|
|
446
|
+
default: () => {
|
|
447
|
+
return this.$olBaseConfig.method || "get";
|
|
448
|
+
},
|
|
447
449
|
},
|
|
448
450
|
},
|
|
449
451
|
|
|
@@ -490,7 +492,7 @@ export default {
|
|
|
490
492
|
},
|
|
491
493
|
created() {
|
|
492
494
|
// 通过swagger完善columns
|
|
493
|
-
this.init();
|
|
495
|
+
if (this.url) this.init();
|
|
494
496
|
},
|
|
495
497
|
// 组件销毁时清理监听器
|
|
496
498
|
beforeDestroy() {
|