Commit 65421d091771518d19fac7b79112dad693377165
1 parent
0912e8e3
Exists in
master
and in
1 other branch
Scheme 新增搜索表单配置参数,支持get表格行数据
Showing
1 changed file
with
8 additions
and
3 deletions
Show diff stats
packages/scheme/index.vue
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | <div class="eagle-scheme"> |
| 53 | 53 | <div v-if="option.showSearch !== false" class="eagle-scheme__card"> |
| 54 | 54 | <!-- 搜索表单 --> |
| 55 | - <eagle-search :list="_searchList" v-model="searchModel" @search="handleSearch" :searching="tableLoading"> | |
| 55 | + <eagle-search :list="_searchList" v-model="searchModel" :span="searchProps.span || 6" :formProps="searchProps" @search="handleSearch" :searching="tableLoading"> | |
| 56 | 56 | <!-- 搜索表单项具名插槽 --> |
| 57 | 57 | <template v-for="item in _searchList"> |
| 58 | 58 | <slot v-if="$scopedSlots[`search-${item.key}`] || $slots[`search-${item.key}`]" :name="`search-${item.key}`" :slot="item.key" :model="searchModel"></slot> |
| ... | ... | @@ -165,6 +165,11 @@ export default { |
| 165 | 165 | tableList: Array, |
| 166 | 166 | // 详情配置 |
| 167 | 167 | detailList: Array, |
| 168 | + // 搜索表单参数 | |
| 169 | + searchProps: { | |
| 170 | + type: Object, | |
| 171 | + default() { return {} } | |
| 172 | + }, | |
| 168 | 173 | // 表格参数 |
| 169 | 174 | tableProps: { |
| 170 | 175 | type: Object, |
| ... | ... | @@ -388,7 +393,7 @@ export default { |
| 388 | 393 | }, |
| 389 | 394 | // 查询单项数据 |
| 390 | 395 | async doGet(param) { |
| 391 | - const { primaryKey = 'id', getPrimaryKey } = this.option || {}; | |
| 396 | + const { primaryKey = 'id', getPrimaryKey, getRow = false } = this.option || {}; | |
| 392 | 397 | if (this.option.getAPI) { // 配置了自定义查询API的情况 |
| 393 | 398 | console.log('getAPI'); |
| 394 | 399 | this.dialogLoading = true; |
| ... | ... | @@ -400,7 +405,7 @@ export default { |
| 400 | 405 | } finally { |
| 401 | 406 | this.dialogLoading = false; |
| 402 | 407 | } |
| 403 | - } else if (_$http && this.option.url) { // 给定了http的情况 | |
| 408 | + } else if (_$http && this.option.url && !getRow) { // 给定了http的情况 | |
| 404 | 409 | console.log('_$http get'); |
| 405 | 410 | this.dialogLoading = true; |
| 406 | 411 | const defaultGetMethod = `get/${getPrimaryKey || primaryKey}/${param[getPrimaryKey] || param[primaryKey]}`; | ... | ... |