ol-base-components 1.5.3 → 1.5.6
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/README.md +11 -12
- package/package.json +1 -1
- package/src/package/index.js +2 -8
- package/src/package/table/src/index.vue +11 -15
package/README.md
CHANGED
|
@@ -45,18 +45,17 @@ import App from "./App.vue";
|
|
|
45
45
|
import OlBaseComponents from "ol-base-components"; // 导入组件库
|
|
46
46
|
|
|
47
47
|
// 使用组件库
|
|
48
|
-
Vue.use(OlBaseComponents
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
48
|
+
Vue.use(OlBaseComponents);
|
|
49
|
+
|
|
50
|
+
//安装,可以在登录
|
|
51
|
+
import {swaggerInstall} from "ol-base-components";
|
|
52
|
+
swaggerInstall("http://220.179.249.140:20019/swagger/v1/swagger.json").then(() => {
|
|
53
|
+
// 成功获取swagger数据后加载页面, 这里可以写登录接口成功后执行的逻辑
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// 卸载
|
|
57
|
+
import { swaggerUnload } from "ol-base-components";
|
|
58
|
+
swaggerUnload()
|
|
60
59
|
```
|
|
61
60
|
|
|
62
61
|
|
package/package.json
CHANGED
package/src/package/index.js
CHANGED
|
@@ -147,6 +147,7 @@ function showLoading() {
|
|
|
147
147
|
#loading {
|
|
148
148
|
background: linear-gradient(135deg, #a8c8e0, #f0f4f8); /* 更柔和的渐变背景 */
|
|
149
149
|
color: #333; /* 文本颜色 */
|
|
150
|
+
z-index:9999999;
|
|
150
151
|
}
|
|
151
152
|
`;
|
|
152
153
|
document.head.appendChild(style);
|
|
@@ -184,18 +185,11 @@ function hideLoading() {
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
const install = async function (
|
|
188
|
-
Vue,
|
|
189
|
-
options = {
|
|
190
|
-
swaggerUrl: "",
|
|
191
|
-
successSwaggerCallback: null,
|
|
192
|
-
}
|
|
193
|
-
) {
|
|
188
|
+
const install = async function (Vue) {
|
|
194
189
|
// 遍历所有组件
|
|
195
190
|
components.map((item) => {
|
|
196
191
|
Vue.component(`ol-${item.name}`, item);
|
|
197
192
|
});
|
|
198
|
-
await swaggerInstall(Vue, options);
|
|
199
193
|
consoleTooltip();
|
|
200
194
|
};
|
|
201
195
|
|
|
@@ -82,7 +82,10 @@
|
|
|
82
82
|
</template>
|
|
83
83
|
|
|
84
84
|
<!-- 表格 -->
|
|
85
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
class="tablebox"
|
|
87
|
+
:key="tableData.columns.length"
|
|
88
|
+
>
|
|
86
89
|
<el-table
|
|
87
90
|
:ref="tableRef"
|
|
88
91
|
v-loading="tableData.loading"
|
|
@@ -106,6 +109,13 @@
|
|
|
106
109
|
:index="computeTableIndex"
|
|
107
110
|
label="序号"
|
|
108
111
|
/>
|
|
112
|
+
<el-table-column
|
|
113
|
+
v-if="tableData.options && tableData.options.selection"
|
|
114
|
+
width="60"
|
|
115
|
+
align="center"
|
|
116
|
+
type="selection"
|
|
117
|
+
label=""
|
|
118
|
+
/>
|
|
109
119
|
<template v-for="(item, index) in bindTableColumns">
|
|
110
120
|
<el-table-column
|
|
111
121
|
:key="index"
|
|
@@ -423,20 +433,6 @@ export default {
|
|
|
423
433
|
});
|
|
424
434
|
}
|
|
425
435
|
});
|
|
426
|
-
|
|
427
|
-
// 一定加上selection,通过show显示隐藏
|
|
428
|
-
const itemSelection = this.tableData.columns.find((item) => item.type == "selection");
|
|
429
|
-
const hasSelection = this.tableData.options.selection;
|
|
430
|
-
if (itemSelection) {
|
|
431
|
-
itemSelection.show = !!hasSelection;
|
|
432
|
-
} else {
|
|
433
|
-
this.tableData.columns.unshift({
|
|
434
|
-
label: "",
|
|
435
|
-
minWidth: "",
|
|
436
|
-
type: "selection",
|
|
437
|
-
show: !!hasSelection,
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
436
|
}).catch((error) => {
|
|
441
437
|
console.error("获取 Swagger 数据失败:", error);
|
|
442
438
|
});
|