|
@@ -1,27 +1,29 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div class="btn_box">
|
|
|
- <div><slot name="left_btn" /></div>
|
|
|
- <div class="btn_box_right_box">
|
|
|
- <slot name="right_btn" />
|
|
|
- <el-button
|
|
|
- v-if="comLength"
|
|
|
- :type="btnOptions.type"
|
|
|
- :size="btnOptions.size"
|
|
|
- :icon="btnOptions.icon"
|
|
|
- :plain="btnOptions.plain"
|
|
|
- :round="btnOptions.round"
|
|
|
- :circle="btnOptions.circle"
|
|
|
- :loading="btnOptions.loading"
|
|
|
- :disabled="btnOptions.disabled"
|
|
|
- @click="handleCollapse"
|
|
|
- >{{ (isGlobal ? vIsCollapse : isCollapse) ? '展开' : '折叠' }}</el-button
|
|
|
- >
|
|
|
+ <el-form @keydown.enter.native.prevent="handleScreen">
|
|
|
+ <div class="btn_box">
|
|
|
+ <div><slot name="left_btn" /></div>
|
|
|
+ <div class="btn_box_right_box">
|
|
|
+ <slot name="right_btn" />
|
|
|
+ <el-button
|
|
|
+ v-if="comLength"
|
|
|
+ :type="btnOptions.type"
|
|
|
+ :size="btnOptions.size"
|
|
|
+ :icon="btnOptions.icon"
|
|
|
+ :plain="btnOptions.plain"
|
|
|
+ :round="btnOptions.round"
|
|
|
+ :circle="btnOptions.circle"
|
|
|
+ :loading="btnOptions.loading"
|
|
|
+ :disabled="btnOptions.disabled"
|
|
|
+ @click="handleCollapse"
|
|
|
+ >{{ (isGlobal ? vIsCollapse : isCollapse) ? '展开' : '折叠' }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div :class="(isGlobal ? vIsCollapse : isCollapse) ? 'search_box' : ''">
|
|
|
- <slot name="search"></slot>
|
|
|
- </div>
|
|
|
+ <div :class="(isGlobal ? vIsCollapse : isCollapse) ? 'search_box' : ''">
|
|
|
+ <slot name="search"></slot>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -48,7 +50,11 @@ export default {
|
|
|
screenForm: {
|
|
|
type: Object,
|
|
|
required: true,
|
|
|
- defaults: {}
|
|
|
+ default: {}
|
|
|
+ },
|
|
|
+ screenFnName: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
},
|
|
|
btnOptions: {
|
|
|
type: Object,
|
|
@@ -81,6 +87,16 @@ export default {
|
|
|
} else {
|
|
|
this.$store.dispatch('user/setStatus', this.isCollapse)
|
|
|
}
|
|
|
+ },
|
|
|
+ handleScreen() {
|
|
|
+ const parent = this.$parent
|
|
|
+ const { searchFn, submitScreenForm } = parent
|
|
|
+ if (this.screenFnName) {
|
|
|
+ parent[this.screenFnName]()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ searchFn && searchFn()
|
|
|
+ submitScreenForm && submitScreenForm()
|
|
|
}
|
|
|
}
|
|
|
}
|