@xilonglab/vue-main 1.3.5 → 1.3.7

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": "@xilonglab/vue-main",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "xilong vue main",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -112,10 +112,65 @@ const { refs, api, params, obj, chartOptions, total } = inject('injections')
112
112
  </xl-tool-bar>
113
113
  <xl-query-page-table v-show="params.view != 'chart'" :ref="refs.table" :api="api" :params="params"
114
114
  v-bind="$props" :summary-method="summaryMethod?summaryMethod:()=>({0:total})" :sort-change="(data) => api.sort(data)">
115
- <xl-table-columns :columns="columns"/>
115
+ <template v-for="col in columns" :key="col.prop">
116
+ <template v-if="!col.hidden">
117
+ <!-- 支持通过 slot 属性使用插槽 -->
118
+ <slot
119
+ v-if="col.slot"
120
+ :name="col.slot"
121
+ />
122
+ <!-- 支持直接指定组件引用 -->
123
+ <component
124
+ v-else-if="col.component"
125
+ :is="col.component"
126
+ />
127
+ <!-- 内置类型组件 -->
128
+ <xl-datetime-col
129
+ v-else-if="col.type === 'datetime'"
130
+ :l="col.label"
131
+ :p="col.prop"
132
+ />
133
+ <xl-map-col
134
+ v-else-if="col.type === 'map'"
135
+ :l="col.label"
136
+ :p="col.prop"
137
+ :width="col.width"
138
+ :map="col.map"
139
+ />
140
+ <xl-status-col
141
+ v-else-if="col.type === 'status'"
142
+ :l="col.label"
143
+ :p="col.prop"
144
+ :map="col.map"
145
+ />
146
+ <xl-review-col
147
+ v-else-if="col.type === 'review'"
148
+ :l="col.label"
149
+ :p="col.prop"
150
+ />
151
+ <xl-clamp-col
152
+ v-else-if="col.type === 'clamp'"
153
+ :l="col.label"
154
+ :p="col.prop"
155
+ :width="col.width"
156
+ />
157
+ <xl-bool-col
158
+ v-else-if="col.type === 'bool'"
159
+ :l="col.label"
160
+ :p="col.prop"
161
+ :width="col.width"
162
+ />
163
+ <!-- 默认列组件 -->
164
+ <xl-col
165
+ v-else
166
+ :l="col.label"
167
+ :p="col.prop"
168
+ :width="col.width"
169
+ />
170
+ </template>
171
+ </template>
116
172
  <slot name="columns" />
117
173
  </xl-query-page-table>
118
- <!-- <xl-chart v-show="params.view == 'chart'" :options="chartOptions" /> -->
119
174
  <xl-data-form-dialog
120
175
  :ref="refs.editDialog"
121
176
  :chinese="chinese"
@@ -12,8 +12,19 @@ const props = defineProps({
12
12
  <template>
13
13
  <template v-for="col in columns" :key="col.prop">
14
14
  <template v-if="!col.hidden">
15
+ <!-- 支持通过 slot 属性使用插槽 -->
16
+ <slot
17
+ v-if="col.slot"
18
+ :name="col.slot"
19
+ />
20
+ <!-- 支持直接指定组件引用 -->
21
+ <component
22
+ v-else-if="col.component"
23
+ :is="col.component"
24
+ />
25
+ <!-- 内置类型组件 -->
15
26
  <xl-datetime-col
16
- v-if="col.type === 'datetime'"
27
+ v-else-if="col.type === 'datetime'"
17
28
  :l="col.label"
18
29
  :p="col.prop"
19
30
  />
@@ -47,6 +58,7 @@ const props = defineProps({
47
58
  :p="col.prop"
48
59
  :width="col.width"
49
60
  />
61
+ <!-- 默认列组件 -->
50
62
  <xl-col
51
63
  v-else
52
64
  :l="col.label"