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,7 +52,7 @@ | ||
| 52 | <div class="eagle-scheme"> | 52 | <div class="eagle-scheme"> |
| 53 | <div v-if="option.showSearch !== false" class="eagle-scheme__card"> | 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 | <template v-for="item in _searchList"> | 57 | <template v-for="item in _searchList"> |
| 58 | <slot v-if="$scopedSlots[`search-${item.key}`] || $slots[`search-${item.key}`]" :name="`search-${item.key}`" :slot="item.key" :model="searchModel"></slot> | 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,6 +165,11 @@ export default { | ||
| 165 | tableList: Array, | 165 | tableList: Array, |
| 166 | // 详情配置 | 166 | // 详情配置 |
| 167 | detailList: Array, | 167 | detailList: Array, |
| 168 | + // 搜索表单参数 | ||
| 169 | + searchProps: { | ||
| 170 | + type: Object, | ||
| 171 | + default() { return {} } | ||
| 172 | + }, | ||
| 168 | // 表格参数 | 173 | // 表格参数 |
| 169 | tableProps: { | 174 | tableProps: { |
| 170 | type: Object, | 175 | type: Object, |
| @@ -388,7 +393,7 @@ export default { | @@ -388,7 +393,7 @@ export default { | ||
| 388 | }, | 393 | }, |
| 389 | // 查询单项数据 | 394 | // 查询单项数据 |
| 390 | async doGet(param) { | 395 | async doGet(param) { |
| 391 | - const { primaryKey = 'id', getPrimaryKey } = this.option || {}; | 396 | + const { primaryKey = 'id', getPrimaryKey, getRow = false } = this.option || {}; |
| 392 | if (this.option.getAPI) { // 配置了自定义查询API的情况 | 397 | if (this.option.getAPI) { // 配置了自定义查询API的情况 |
| 393 | console.log('getAPI'); | 398 | console.log('getAPI'); |
| 394 | this.dialogLoading = true; | 399 | this.dialogLoading = true; |
| @@ -400,7 +405,7 @@ export default { | @@ -400,7 +405,7 @@ export default { | ||
| 400 | } finally { | 405 | } finally { |
| 401 | this.dialogLoading = false; | 406 | this.dialogLoading = false; |
| 402 | } | 407 | } |
| 403 | - } else if (_$http && this.option.url) { // 给定了http的情况 | 408 | + } else if (_$http && this.option.url && !getRow) { // 给定了http的情况 |
| 404 | console.log('_$http get'); | 409 | console.log('_$http get'); |
| 405 | this.dialogLoading = true; | 410 | this.dialogLoading = true; |
| 406 | const defaultGetMethod = `get/${getPrimaryKey || primaryKey}/${param[getPrimaryKey] || param[primaryKey]}`; | 411 | const defaultGetMethod = `get/${getPrimaryKey || primaryKey}/${param[getPrimaryKey] || param[primaryKey]}`; |