ol-base-components 1.5.4 → 2.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.
- package/README.md +14 -13
- package/package.json +1 -3
- package/src/App.vue +158 -8
- package/src/main.js +4 -4
- package/src/package/formSearch/src/index.vue +78 -12
- package/src/package/index.js +12 -15
- package/src/package/table/src/index.vue +6 -14
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://192.168.xxx.xxx: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
|
|
|
@@ -135,7 +134,9 @@ export default {
|
|
|
135
134
|
|
|
136
135
|
### 表格组件
|
|
137
136
|
|
|
138
|
-
|
|
137
|
+
##### 1. 您可以在您的组件中使用表格组件组件
|
|
138
|
+
##### 2. 您可以在ol-table添加url参数接收完整的swagger地址,会自动帮您生成tableData.columns。您也可以在columns中添加,当prop相同时候,会自动合并,且columns权限大。
|
|
139
|
+
例如:
|
|
139
140
|
|
|
140
141
|
```vue
|
|
141
142
|
<template>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ol-base-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "src/package/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
"lint": "vue-cli-service lint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@swagger-api/apidom-json-pointer": "^1.0.0-beta.44",
|
|
13
|
-
"@swagger-api/apidom-reference": "^1.0.0-beta.44",
|
|
14
12
|
"core-js": "^3.8.3",
|
|
15
13
|
"element-ui": "^2.15.14",
|
|
16
14
|
"eslint": "^8.57.1",
|
package/src/App.vue
CHANGED
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
<!-- url="/api/app/admission-info/paged-result" -->
|
|
14
14
|
|
|
15
15
|
<div>table组件案例</div>
|
|
16
|
-
<ol-
|
|
16
|
+
<ol-search
|
|
17
|
+
:form-search-data="formSearchData"
|
|
18
|
+
@handleSearch="handleSearch"
|
|
19
|
+
@handleReset="handleReset"
|
|
20
|
+
url="/api/app/admission-info/paged-result"
|
|
21
|
+
/>
|
|
22
|
+
<!-- <ol-table
|
|
17
23
|
:paginations="paginations"
|
|
18
24
|
:empty-img="tableData.emptyImg"
|
|
19
25
|
:btnlist="[]"
|
|
@@ -23,17 +29,17 @@
|
|
|
23
29
|
@SelectionChange="SelectionChange"
|
|
24
30
|
@handleSizeChange="handleSizeChange"
|
|
25
31
|
@handleindexChange="handleindexChange"
|
|
26
|
-
></ol-table>
|
|
32
|
+
></ol-table> -->
|
|
27
33
|
<el-button @click="handlePrint">接口</el-button>
|
|
28
34
|
</div>
|
|
29
35
|
</template>
|
|
30
36
|
|
|
31
37
|
<script>
|
|
32
|
-
import MyTable from "@/package/table/src/index.vue";
|
|
38
|
+
// import MyTable from "@/package/table/src/index.vue";
|
|
33
39
|
export default {
|
|
34
40
|
name: "App",
|
|
35
41
|
components: {
|
|
36
|
-
MyTable,
|
|
42
|
+
// MyTable,
|
|
37
43
|
},
|
|
38
44
|
data() {
|
|
39
45
|
return {
|
|
@@ -177,6 +183,137 @@ export default {
|
|
|
177
183
|
limit: 30, // 一页显示多少条
|
|
178
184
|
pagetionShow: true,
|
|
179
185
|
},
|
|
186
|
+
|
|
187
|
+
formSearchData: {
|
|
188
|
+
reset: true, // 重置
|
|
189
|
+
expendShow: true, // 展开
|
|
190
|
+
tableSearchSlice: 5,
|
|
191
|
+
value: {
|
|
192
|
+
DocNo: null, // 对应输入框的value字段
|
|
193
|
+
QualityCheckStateType: null,
|
|
194
|
+
QualityCheckState: null,
|
|
195
|
+
timer: []
|
|
196
|
+
},
|
|
197
|
+
tableSearch: [
|
|
198
|
+
// {
|
|
199
|
+
// label: "标签号",
|
|
200
|
+
// value: "carBodyTagNumber",
|
|
201
|
+
// inputType: "text"
|
|
202
|
+
// },
|
|
203
|
+
// {
|
|
204
|
+
// label: "车架号",
|
|
205
|
+
// value: "frameNumber",
|
|
206
|
+
// inputType: "text"
|
|
207
|
+
// // value: "QualityCheckStateType",
|
|
208
|
+
// // inputType: "select",
|
|
209
|
+
// // children: this.SET_enumsSelect({
|
|
210
|
+
// // keyword: "qualityCheckTypeEnum",
|
|
211
|
+
// // }),
|
|
212
|
+
// },
|
|
213
|
+
// {
|
|
214
|
+
// label: "项目号",
|
|
215
|
+
// value: "projectCode",
|
|
216
|
+
// inputType: "text"
|
|
217
|
+
// },
|
|
218
|
+
// {
|
|
219
|
+
// label: "状态描述",
|
|
220
|
+
// value: "statusDescription",
|
|
221
|
+
// inputType: "select",
|
|
222
|
+
// // 0整车/1白车身/2碰撞加固车身/3爆破切割车身/4侧面切割下车身
|
|
223
|
+
// children: [
|
|
224
|
+
// {
|
|
225
|
+
// key: 0,
|
|
226
|
+
// value: "整车"
|
|
227
|
+
// },
|
|
228
|
+
// {
|
|
229
|
+
// key: 1,
|
|
230
|
+
// value: "白车身"
|
|
231
|
+
// },
|
|
232
|
+
// {
|
|
233
|
+
// key: 2,
|
|
234
|
+
// value: "碰撞加固车身"
|
|
235
|
+
// },
|
|
236
|
+
// {
|
|
237
|
+
// key: 3,
|
|
238
|
+
// value: "爆破切割车身"
|
|
239
|
+
// },
|
|
240
|
+
// {
|
|
241
|
+
// key: 4,
|
|
242
|
+
// value: "侧面切割下车身"
|
|
243
|
+
// }
|
|
244
|
+
// ]
|
|
245
|
+
// },
|
|
246
|
+
// {
|
|
247
|
+
// label: "实验状态",
|
|
248
|
+
// value: "experimentStatus",
|
|
249
|
+
// inputType: "select",
|
|
250
|
+
// // 0实验前 1实验中 2实验后
|
|
251
|
+
// children: [
|
|
252
|
+
// {
|
|
253
|
+
// key: 0,
|
|
254
|
+
// value: "实验前"
|
|
255
|
+
// },
|
|
256
|
+
// {
|
|
257
|
+
// key: 1,
|
|
258
|
+
// value: "实验中"
|
|
259
|
+
// },
|
|
260
|
+
// {
|
|
261
|
+
// key: 2,
|
|
262
|
+
// value: "实验后"
|
|
263
|
+
// }
|
|
264
|
+
// ]
|
|
265
|
+
// },
|
|
266
|
+
// {
|
|
267
|
+
// label: "状态",
|
|
268
|
+
// value: "tagStatus",
|
|
269
|
+
// inputType: "select",
|
|
270
|
+
// children: []
|
|
271
|
+
// },
|
|
272
|
+
// {
|
|
273
|
+
// label: "车身类型",
|
|
274
|
+
// value: "bodyWorkType",
|
|
275
|
+
// inputType: "select",
|
|
276
|
+
// children: []
|
|
277
|
+
// },
|
|
278
|
+
// {
|
|
279
|
+
// label: "项目名称",
|
|
280
|
+
// value: "projectName",
|
|
281
|
+
// inputType: "text"
|
|
282
|
+
// },
|
|
283
|
+
// {
|
|
284
|
+
// label: "入场日期",
|
|
285
|
+
// inputType: "picker",
|
|
286
|
+
// value: "admissionDate",
|
|
287
|
+
// props: {
|
|
288
|
+
// valueFormat: "yyyy-MM-dd",
|
|
289
|
+
// format: "yyyy/MM/dd"
|
|
290
|
+
// }
|
|
291
|
+
// },
|
|
292
|
+
// {
|
|
293
|
+
// label: "打印次数",
|
|
294
|
+
// value: "tagPrintNumber",
|
|
295
|
+
// inputType: "number"
|
|
296
|
+
// },
|
|
297
|
+
// {
|
|
298
|
+
// label: "创建时间",
|
|
299
|
+
// value: "createdTime",
|
|
300
|
+
// inputType: "picker",
|
|
301
|
+
// props: {
|
|
302
|
+
// type: "datetimerange",
|
|
303
|
+
// startPlaceholder: "开始时间",
|
|
304
|
+
// endPlaceholder: "结束时间",
|
|
305
|
+
// placeholder: "选择时间范围",
|
|
306
|
+
// valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
307
|
+
// format: "yyyy/MM/dd HH:mm:ss"
|
|
308
|
+
// }
|
|
309
|
+
// },
|
|
310
|
+
// {
|
|
311
|
+
// label: "虚拟项目",
|
|
312
|
+
// value: "tempProject",
|
|
313
|
+
// inputType: "text"
|
|
314
|
+
// }
|
|
315
|
+
]
|
|
316
|
+
},
|
|
180
317
|
};
|
|
181
318
|
},
|
|
182
319
|
methods: {
|
|
@@ -184,9 +321,8 @@ export default {
|
|
|
184
321
|
this.multipleSelection = row;
|
|
185
322
|
},
|
|
186
323
|
handleSearch(from) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
self.paginations.page = 1;
|
|
324
|
+
this.formSearchData.value = { ...from };
|
|
325
|
+
this.paginations.page = 1;
|
|
190
326
|
this.getTable();
|
|
191
327
|
},
|
|
192
328
|
handleReset() { },
|
|
@@ -203,7 +339,21 @@ export default {
|
|
|
203
339
|
// console.log(this);
|
|
204
340
|
// const aaa = this.$api.getApi("Stock.get_api_app_stock_stock_pages")
|
|
205
341
|
// console.log(6666, aaa);
|
|
206
|
-
}
|
|
342
|
+
},
|
|
343
|
+
// ================
|
|
344
|
+
getTable() { },
|
|
345
|
+
handleSearch(from) {
|
|
346
|
+
|
|
347
|
+
this.formSearchData.value = { ...from };
|
|
348
|
+
this.paginations.page = 1;
|
|
349
|
+
this.getTable();
|
|
350
|
+
},
|
|
351
|
+
handleReset() {
|
|
352
|
+
for (let key in this.formSearchData.value) {
|
|
353
|
+
this.formSearchData.value[key] = null;
|
|
354
|
+
}
|
|
355
|
+
this.paginations.page = 1;
|
|
356
|
+
},
|
|
207
357
|
},
|
|
208
358
|
};
|
|
209
359
|
</script>
|
package/src/main.js
CHANGED
|
@@ -6,10 +6,10 @@ import OlCom from "@/package/index.js";
|
|
|
6
6
|
|
|
7
7
|
Vue.use(ElementUI);
|
|
8
8
|
|
|
9
|
-
Vue.use(OlCom
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
9
|
+
Vue.use(OlCom);
|
|
10
|
+
// swaggerInstall("http://220.179.249.140:20019/swagger/v1/swagger.json").then(
|
|
11
|
+
// () => {}
|
|
12
|
+
// );
|
|
13
13
|
new Vue({
|
|
14
14
|
render: (h) => h(App),
|
|
15
15
|
}).$mount("#app");
|
|
@@ -149,15 +149,14 @@
|
|
|
149
149
|
size="small"
|
|
150
150
|
type="primary"
|
|
151
151
|
@click="handleSearch('formSearch')"
|
|
152
|
-
|
|
152
|
+
>查询
|
|
153
153
|
</el-button>
|
|
154
154
|
<el-button
|
|
155
155
|
v-if="formSearchData.reset"
|
|
156
156
|
plain
|
|
157
157
|
size="small"
|
|
158
158
|
@click="handleReset('formSearch')"
|
|
159
|
-
|
|
160
|
-
>
|
|
159
|
+
>重置</el-button>
|
|
161
160
|
<el-button
|
|
162
161
|
v-if="formSearchData.expendShow"
|
|
163
162
|
plain
|
|
@@ -165,8 +164,7 @@
|
|
|
165
164
|
:icon="expend ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
|
166
165
|
@click="handleExpend('formSearch')"
|
|
167
166
|
>
|
|
168
|
-
{{ expend ? "收起" : "展开" }}</el-button
|
|
169
|
-
>
|
|
167
|
+
{{ expend ? "收起" : "展开" }}</el-button>
|
|
170
168
|
</el-form-item>
|
|
171
169
|
</el-form>
|
|
172
170
|
</div>
|
|
@@ -189,6 +187,8 @@
|
|
|
189
187
|
</template>
|
|
190
188
|
|
|
191
189
|
<script>
|
|
190
|
+
import { getData } from '../../index.js'
|
|
191
|
+
|
|
192
192
|
export default {
|
|
193
193
|
name: "search",
|
|
194
194
|
directives: {
|
|
@@ -250,6 +250,10 @@ export default {
|
|
|
250
250
|
},
|
|
251
251
|
},
|
|
252
252
|
props: {
|
|
253
|
+
url: {
|
|
254
|
+
type: String,
|
|
255
|
+
default: '',
|
|
256
|
+
},
|
|
253
257
|
formSearchData: {
|
|
254
258
|
type: Object,
|
|
255
259
|
default: () => {
|
|
@@ -298,11 +302,13 @@ export default {
|
|
|
298
302
|
optionBox: [],
|
|
299
303
|
};
|
|
300
304
|
},
|
|
305
|
+
async created() {
|
|
306
|
+
this.init()
|
|
307
|
+
},
|
|
301
308
|
watch: {
|
|
302
309
|
"formSearchData.value": {
|
|
303
310
|
handler: function (newVal, OldVal) {
|
|
304
311
|
if (newVal) {
|
|
305
|
-
console.log(newVal, "newVal");
|
|
306
312
|
return (this.formSearch = {
|
|
307
313
|
...newVal,
|
|
308
314
|
});
|
|
@@ -313,20 +319,80 @@ export default {
|
|
|
313
319
|
},
|
|
314
320
|
},
|
|
315
321
|
methods: {
|
|
322
|
+
async init() {
|
|
323
|
+
const swaggerData = await getData()
|
|
324
|
+
const swaggersearchColumns = swaggerData.paths[this.url].get.parameters || []
|
|
325
|
+
swaggersearchColumns.forEach((item) => {
|
|
326
|
+
let tempItem = this.formSearchData.tableSearch.find(e => e.value.toLowerCase() === item.name.toLowerCase())
|
|
327
|
+
if (tempItem) {
|
|
328
|
+
// 匹配到
|
|
329
|
+
tempItem = { ...item, ...tempItem }
|
|
330
|
+
} else if (item.description) {
|
|
331
|
+
// 未匹配到
|
|
332
|
+
const pushItem = {
|
|
333
|
+
value: item.name,
|
|
334
|
+
label: item.description,
|
|
335
|
+
inputType: 'text',
|
|
336
|
+
props: {}
|
|
337
|
+
}
|
|
338
|
+
if (item.schema.enum && Array.isArray(item.schema.enum)) {
|
|
339
|
+
//枚举值
|
|
340
|
+
pushItem.inputType = 'select'
|
|
341
|
+
pushItem.children = item.schema.enum.map(e => ({ key: e, value: e }))
|
|
342
|
+
} else if (item.schema.format === 'date-time') {
|
|
343
|
+
//日期
|
|
344
|
+
pushItem.inputType = 'picker'
|
|
345
|
+
pushItem.props.valueFormat = 'yyyy-MM-dd'
|
|
346
|
+
pushItem.props.format = 'yyyy/MM/dd'
|
|
347
|
+
} else if (item.schema && item.schema.type === 'string') {
|
|
348
|
+
pushItem.inputType = 'text'
|
|
349
|
+
}
|
|
350
|
+
this.formSearchData.tableSearch.push(pushItem)
|
|
351
|
+
}
|
|
352
|
+
})
|
|
353
|
+
|
|
354
|
+
// 单独处理创建时间 就是BeginTime,EndTime
|
|
355
|
+
const requiredNames = ['BeginTime', 'EndTime'];
|
|
356
|
+
const hseCreatedTime = requiredNames.every(name =>
|
|
357
|
+
swaggersearchColumns.some(item => item.name === name)
|
|
358
|
+
);
|
|
359
|
+
if (hseCreatedTime) {
|
|
360
|
+
this.formSearchData.tableSearch.push({
|
|
361
|
+
label: "创建时间",
|
|
362
|
+
value: "createdTime",
|
|
363
|
+
inputType: "picker",
|
|
364
|
+
props: {
|
|
365
|
+
type: "datetimerange",
|
|
366
|
+
startPlaceholder: "开始时间",
|
|
367
|
+
endPlaceholder: "结束时间",
|
|
368
|
+
placeholder: "选择时间范围",
|
|
369
|
+
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
370
|
+
format: "yyyy/MM/dd HH:mm:ss"
|
|
371
|
+
}
|
|
372
|
+
})
|
|
373
|
+
}
|
|
374
|
+
console.log(`\x1b[36m\x1b[4mol插件-搜索框渲染`, this.formSearchData.tableSearch)
|
|
375
|
+
},
|
|
316
376
|
// 树形下拉
|
|
317
377
|
getValue(val) {
|
|
318
378
|
this.$emit("getTreeSelectValue", val);
|
|
319
379
|
},
|
|
320
380
|
// 搜索查询按钮
|
|
321
381
|
handleSearch(formName, item) {
|
|
382
|
+
if (this.formSearch.createdTime) {
|
|
383
|
+
this.formSearch.BeginTime = this.formSearch.createdTime[0];
|
|
384
|
+
this.formSearch.EndTime = this.formSearch.createdTime[1];
|
|
385
|
+
}
|
|
386
|
+
const tempFormSearch = Object.assign({}, this.formSearch)
|
|
322
387
|
if (this.formSearchData.rules) {
|
|
323
388
|
return this.$refs[formName].validate((valid) => {
|
|
324
389
|
if (!valid) return false;
|
|
325
|
-
|
|
326
|
-
this.$emit("handleSearch", Object.assign({}, this.formSearch), item);
|
|
390
|
+
this.$emit("handleSearch", tempFormSearch, item);
|
|
327
391
|
});
|
|
328
392
|
}
|
|
329
|
-
this.$emit("handleSearch",
|
|
393
|
+
this.$emit("handleSearch", tempFormSearch, item);
|
|
394
|
+
console.log(`\x1b[36m\x1b[4mol插件-搜索框查询`, tempFormSearch)
|
|
395
|
+
|
|
330
396
|
},
|
|
331
397
|
loadmore(obj) {
|
|
332
398
|
this.$emit("loadmore", obj);
|
|
@@ -374,9 +440,9 @@ export default {
|
|
|
374
440
|
this.expend = !this.expend; // 展开和收起
|
|
375
441
|
this.findTableSearch = this.expend
|
|
376
442
|
? this.formSearchData.tableSearch.slice(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
443
|
+
0,
|
|
444
|
+
this.formSearchData.tableSearch.length
|
|
445
|
+
)
|
|
380
446
|
: this.formSearchData.tableSearch.slice(0, this.tableSearchSlice);
|
|
381
447
|
|
|
382
448
|
this.$emit("btnHandleExpend", this.expend);
|
package/src/package/index.js
CHANGED
|
@@ -97,25 +97,25 @@ function clearData() {
|
|
|
97
97
|
const swaggerInstall = async (swaggerUrl) => {
|
|
98
98
|
if (!swaggerUrl) return Promise.reject(new Error("Swagger URL is required.")); // 检查 Swagger URL
|
|
99
99
|
|
|
100
|
-
//
|
|
100
|
+
// IndexedDB 获取 Swagger 数据
|
|
101
101
|
const cachedData = await getData();
|
|
102
102
|
if (cachedData) {
|
|
103
103
|
consoleTooltip();
|
|
104
|
-
return Promise.resolve(cachedData);
|
|
104
|
+
return Promise.resolve(cachedData);
|
|
105
105
|
} else {
|
|
106
106
|
// 如果没有缓存数据,重新请求 Swagger 数据
|
|
107
107
|
try {
|
|
108
108
|
showLoading();
|
|
109
109
|
const client = await SwaggerClient(swaggerUrl);
|
|
110
|
-
const swaggerData = client.spec;
|
|
111
|
-
await storeData(swaggerData);
|
|
110
|
+
const swaggerData = client.spec;
|
|
111
|
+
await storeData(swaggerData);
|
|
112
112
|
hideLoading();
|
|
113
113
|
consoleTooltip();
|
|
114
|
-
return Promise.resolve(swaggerData);
|
|
114
|
+
return Promise.resolve(swaggerData);
|
|
115
115
|
} catch (error) {
|
|
116
116
|
hideLoading();
|
|
117
117
|
console.error("获取 Swagger 数据失败:", error);
|
|
118
|
-
return Promise.reject(error);
|
|
118
|
+
return Promise.reject(error);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
};
|
|
@@ -128,7 +128,6 @@ const components = [OlTable, OlSearch, Dialog];
|
|
|
128
128
|
|
|
129
129
|
// 自定义加载指示器
|
|
130
130
|
function showLoading() {
|
|
131
|
-
// 创建样式
|
|
132
131
|
const style = document.createElement("style");
|
|
133
132
|
style.innerHTML = `
|
|
134
133
|
@keyframes spin {
|
|
@@ -160,10 +159,10 @@ function showLoading() {
|
|
|
160
159
|
loadingDiv.style.left = "0";
|
|
161
160
|
loadingDiv.style.width = "100%";
|
|
162
161
|
loadingDiv.style.height = "100%";
|
|
163
|
-
loadingDiv.style.display = "flex";
|
|
164
|
-
loadingDiv.style.flexDirection = "column";
|
|
165
|
-
loadingDiv.style.justifyContent = "center";
|
|
166
|
-
loadingDiv.style.alignItems = "center";
|
|
162
|
+
loadingDiv.style.display = "flex";
|
|
163
|
+
loadingDiv.style.flexDirection = "column";
|
|
164
|
+
loadingDiv.style.justifyContent = "center";
|
|
165
|
+
loadingDiv.style.alignItems = "center";
|
|
167
166
|
|
|
168
167
|
// 创建旋转的加载图标
|
|
169
168
|
const spinner = document.createElement("div");
|
|
@@ -186,14 +185,12 @@ function hideLoading() {
|
|
|
186
185
|
}
|
|
187
186
|
|
|
188
187
|
const install = async function (Vue) {
|
|
189
|
-
// 遍历所有组件
|
|
190
188
|
components.map((item) => {
|
|
191
189
|
Vue.component(`ol-${item.name}`, item);
|
|
192
190
|
});
|
|
193
191
|
consoleTooltip();
|
|
194
192
|
};
|
|
195
193
|
|
|
196
|
-
|
|
197
|
-
export
|
|
198
|
-
export { OlTable, OlSearch, Dialog }; //按需导入
|
|
194
|
+
export default install;
|
|
195
|
+
export { OlTable, OlSearch, Dialog };
|
|
199
196
|
export { swaggerInstall, swaggerUnload };
|
|
@@ -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"
|
|
@@ -315,10 +318,6 @@ export default {
|
|
|
315
318
|
type: Boolean,
|
|
316
319
|
default: true,
|
|
317
320
|
},
|
|
318
|
-
displayDetail: {
|
|
319
|
-
type: Boolean,
|
|
320
|
-
default: true,
|
|
321
|
-
},
|
|
322
321
|
pageSizes: {
|
|
323
322
|
type: Array,
|
|
324
323
|
default: () => {
|
|
@@ -396,17 +395,10 @@ export default {
|
|
|
396
395
|
this.$set(column, "show", false);
|
|
397
396
|
}
|
|
398
397
|
});
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
watch: {
|
|
403
|
-
displayDetail: {
|
|
404
|
-
handler() {
|
|
405
398
|
this.$nextTick(() => {
|
|
406
|
-
this.$refs
|
|
407
|
-
})
|
|
399
|
+
this.$refs.tableRef.doLayout()
|
|
400
|
+
})
|
|
408
401
|
},
|
|
409
|
-
deep: true,
|
|
410
402
|
},
|
|
411
403
|
},
|
|
412
404
|
methods: {
|