ol-base-components 2.8.8 → 2.8.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol-base-components",
3
- "version": "2.8.8",
3
+ "version": "2.8.10",
4
4
  "private": false,
5
5
  "main": "src/package/index.js",
6
6
  "bin": {
@@ -48,7 +48,7 @@
48
48
  "name": "vue-page-generator",
49
49
  "displayName": "Vue 页面生成器",
50
50
  "description": "配合ol-base-components组件使用, 无需联调的CRUD页面",
51
- "version": "0.0.4",
51
+ "version": "0.0.4",
52
52
  "engines": {
53
53
  "vscode": "^1.60.0"
54
54
  },
@@ -168,7 +168,7 @@
168
168
  <template v-for="(item, index) in this.tableData.columns">
169
169
  <TableColumn
170
170
  :column="item"
171
- :key="`${item.prop || item.label}-${item.show}-${key}`"
171
+ :key="`${item.prop || item.label}-${item.show}-${index}`"
172
172
  :id="`${item.prop}-${item.show}-${index}`"
173
173
  >
174
174
  <template v-for="(slotFn, name) in $scopedSlots" v-slot:[name]="slotProps">
@@ -422,6 +422,11 @@ export default {
422
422
  type: Boolean,
423
423
  default: true,
424
424
  },
425
+ //获取swagger后的钩子,返回swagger结构数据
426
+ swaggerColumnsProcessor: {
427
+ type: Function,
428
+ default: null,
429
+ },
425
430
  },
426
431
 
427
432
  data() {
@@ -513,11 +518,16 @@ export default {
513
518
  init() {
514
519
  // 从 IndexedDB 中获取 Swagger 数据
515
520
  getData()
516
- .then(swaggerData => {
517
- const swaggerColumns =
521
+ .then(async swaggerData => {
522
+ let swaggerColumns =
518
523
  swaggerData.paths[this.url].get.responses["200"].content["application/json"].schema
519
524
  .properties.items.items.properties;
520
525
 
526
+ try {
527
+ const res = await this.swaggerColumnsProcessor(swaggerColumns);
528
+ swaggerColumns = res;
529
+ } catch (err) {}
530
+
521
531
  // 递归映射函数
522
532
  const mapSwaggerToColumns = columns => {
523
533
  columns.forEach(column => {