br-dionysus 0.7.10 → 0.7.12

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 CHANGED
@@ -271,6 +271,7 @@ const test = ref<number>(0)
271
271
 
272
272
  <script setup lang="ts">
273
273
  import { ref } from 'vue'
274
+ import { Page } from '../../../docs/packages/typings/class'
274
275
 
275
276
  const code = ref<string>('')
276
277
  const options = ref<Option[]>()
@@ -310,7 +311,8 @@ const mockData = [{
310
311
  createdTimeStr: '2024-05-06'
311
312
  }]
312
313
 
313
- const remoteMethod = async (query: string = '') => {
314
+ const remoteMethod = async (query: string = '', page: Page) => {
315
+ console.log('page', page)
314
316
  options.value = mockData.map(item => ({
315
317
  label: item.fileName,
316
318
  value: item.sn,
@@ -486,7 +488,9 @@ sole 必须传递在表格数据内为唯一的值 如id key 等不会发生重
486
488
  :minWidth="item.minWidth"
487
489
  v-model:filtersValue="filtersValue"
488
490
  showOverflowTooltip
489
- />
491
+ :children="item.children||[]"
492
+ >
493
+ </MTableColumn>
490
494
  </el-table>
491
495
  </div>
492
496
  </template>
@@ -542,8 +546,30 @@ const tableTitle = [
542
546
  },
543
547
  {
544
548
  label: '地址',
545
- prop: 'address',
546
- minWidth: '134px'
549
+ children: [
550
+ {
551
+ label: '123', children: [
552
+ {
553
+ label: '222222222222',
554
+ prop: 'address',
555
+ minWidth: '134px'
556
+
557
+ },
558
+ {
559
+ label: 'qqqqqq',
560
+ prop: 'address',
561
+ minWidth: '134px'
562
+
563
+ }
564
+ ]
565
+ },
566
+ {
567
+ label: '2222',
568
+ prop: 'address',
569
+ minWidth: '134px'
570
+ },
571
+ ]
572
+
547
573
  },
548
574
  {
549
575
  label: '标签',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "br-dionysus",
3
- "version": "0.7.10",
3
+ "version": "0.7.12",
4
4
  "scripts": {
5
5
  "dev": "vite --config ./build/base.config.ts",
6
6
  "build:doc": "vue-tsc --noEmit && vite build --config ./build/doc.config.ts && node script/copyDir.js",
@@ -13,6 +13,7 @@
13
13
 
14
14
  <script setup lang="ts">
15
15
  import { ref } from 'vue'
16
+ import { Page } from '../../../docs/packages/typings/class'
16
17
 
17
18
  const code = ref<string>('')
18
19
  const options = ref<Option[]>()
@@ -52,7 +53,8 @@ const mockData = [{
52
53
  createdTimeStr: '2024-05-06'
53
54
  }]
54
55
 
55
- const remoteMethod = async (query: string = '') => {
56
+ const remoteMethod = async (query: string = '', page: Page) => {
57
+ console.log('page', page)
56
58
  options.value = mockData.map(item => ({
57
59
  label: item.fileName,
58
60
  value: item.sn,
@@ -6,7 +6,7 @@
6
6
  :class="_this.inputClass"
7
7
  :size="props.size"
8
8
  :placeholder="props.placeholder"
9
- @input="remoteMethod($event);_this.showPanel = true"
9
+ @input="props.remoteMethod($event, page);_this.showPanel = true"
10
10
  @focus="focus"
11
11
  @keyup.enter="addRowData"
12
12
  :disabled="props.disabled"
@@ -40,7 +40,7 @@
40
40
  :ref="mTableRef"
41
41
  class="m-table s-table"
42
42
  :data="optionsMap"
43
- size="small"
43
+ :size="props.size"
44
44
  @currentChange="handleCurrentChange"
45
45
  :rowClassName="tableRowClassName"
46
46
  @selectionChange="handleSelectionChange"
@@ -76,7 +76,7 @@
76
76
  v-model:currentPage="page.currentPage"
77
77
  v-model:pageSize="page.pageSize"
78
78
  hideOnSinglePage
79
- small
79
+ :small="props.size === 'small'"
80
80
  :pageSizes="page.pageSizesOptions"
81
81
  layout="total, prev, pager, next, sizes"
82
82
  :total="page.total"
@@ -176,7 +176,7 @@ const optionsMap = computed(() => {
176
176
 
177
177
  // 分页
178
178
  const page = reactive<Page>(new Page({
179
- total: 0,
179
+ total: props.total,
180
180
  pageSize: 5,
181
181
  currentPage: 1,
182
182
  pageSizesOptions: [5, 10, 20]
@@ -9,7 +9,9 @@
9
9
  :minWidth="item.minWidth"
10
10
  v-model:filtersValue="filtersValue"
11
11
  showOverflowTooltip
12
- />
12
+ :children="item.children||[]"
13
+ >
14
+ </MTableColumn>
13
15
  </el-table>
14
16
  </div>
15
17
  </template>
@@ -65,8 +67,30 @@ const tableTitle = [
65
67
  },
66
68
  {
67
69
  label: '地址',
68
- prop: 'address',
69
- minWidth: '134px'
70
+ children: [
71
+ {
72
+ label: '123', children: [
73
+ {
74
+ label: '222222222222',
75
+ prop: 'address',
76
+ minWidth: '134px'
77
+
78
+ },
79
+ {
80
+ label: 'qqqqqq',
81
+ prop: 'address',
82
+ minWidth: '134px'
83
+
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ label: '2222',
89
+ prop: 'address',
90
+ minWidth: '134px'
91
+ },
92
+ ]
93
+
70
94
  },
71
95
  {
72
96
  label: '标签',
@@ -11,6 +11,17 @@
11
11
  :index="scope.$index"
12
12
  ></slot>
13
13
  </template>
14
+ <template v-if="props.children && props.children.length">
15
+ <index
16
+ v-for="child in props.children"
17
+ :key="child.prop"
18
+ :prop="child.prop"
19
+ :label="child.label"
20
+ :minWidth="child.minWidth"
21
+ showOverflowTooltip
22
+ :children="child.children || []"
23
+ ></index>
24
+ </template>
14
25
  <template #header="scope">
15
26
  <span>
16
27
  <slot
@@ -95,14 +106,21 @@ interface FilterValue {
95
106
  [key: string]: Array<string | number>
96
107
  }
97
108
 
109
+ interface PropChildren {
110
+ [prop: string]: any,
111
+ children?: PropChildren[]
112
+ }
113
+
98
114
  const props = withDefaults(defineProps<{
99
115
  filtersValue?: FilterValue,
100
116
  filters?: Array<{ text: string | number, value: string | number }>,
101
- filterMethod?: Function
117
+ filterMethod?: Function,
118
+ children?: Array<PropChildren>
102
119
  }>(), {
103
120
  filtersValue: () => ({}),
104
121
  filters: () => [],
105
- filterMethod: () => {}
122
+ filterMethod: () => {},
123
+ children: () => []
106
124
  })
107
125
 
108
126
  const slots = useSlots()