|
@@ -9,19 +9,8 @@
|
|
@onSearch="onSearch"
|
|
@onSearch="onSearch"
|
|
clearable
|
|
clearable
|
|
>
|
|
>
|
|
- <div
|
|
|
|
- slot="suffix"
|
|
|
|
- class="filter-button no-select"
|
|
|
|
- @click="changeFilterState"
|
|
|
|
- >
|
|
|
|
- <span class="filter-button-text">筛选</span>
|
|
|
|
- <span
|
|
|
|
- class="el-icon-arrow-up"
|
|
|
|
- :class="filterShow ? '' : 'rotate180'"
|
|
|
|
- ></span>
|
|
|
|
- </div>
|
|
|
|
</SearchInput>
|
|
</SearchInput>
|
|
- <slot name="input-suffix"></slot>
|
|
|
|
|
|
+ <slot></slot>
|
|
<div
|
|
<div
|
|
class="search-right-wx"
|
|
class="search-right-wx"
|
|
@mouseover="rightQrShow = true"
|
|
@mouseover="rightQrShow = true"
|
|
@@ -39,16 +28,6 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="search-header-bottom" style="display: none">
|
|
|
|
- <el-tabs v-model="tabActive">
|
|
|
|
- <el-tab-pane
|
|
|
|
- v-for="pane in tabPaneList.filter((i) => i.show)"
|
|
|
|
- :key="pane.name"
|
|
|
|
- :label="pane.label"
|
|
|
|
- :name="pane.name"
|
|
|
|
- ></el-tab-pane>
|
|
|
|
- </el-tabs>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -66,13 +45,14 @@ export default {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
- perSearchEnabled: {
|
|
|
|
- type: Boolean,
|
|
|
|
- default: false
|
|
|
|
- },
|
|
|
|
|
|
+ // 立即搜索
|
|
immediateSearch: {
|
|
immediateSearch: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: true
|
|
default: true
|
|
|
|
+ },
|
|
|
|
+ placeholder: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
model: {
|
|
model: {
|
|
@@ -81,145 +61,27 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- tabActive: '',
|
|
|
|
- placeholder: '',
|
|
|
|
- tabActivePane: {},
|
|
|
|
- filterShow: true,
|
|
|
|
- tabPaneList: [
|
|
|
|
- {
|
|
|
|
- label: '招标采购搜索',
|
|
|
|
- name: 'zb',
|
|
|
|
- routerName: '',
|
|
|
|
- placeholder: '',
|
|
|
|
- show: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '企业搜索',
|
|
|
|
- name: 'qy',
|
|
|
|
- routerName: '',
|
|
|
|
- placeholder: '',
|
|
|
|
- show: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '采购单位搜索',
|
|
|
|
- name: 'cgdw',
|
|
|
|
- routerName: '',
|
|
|
|
- placeholder: '',
|
|
|
|
- show: false
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '供应搜索',
|
|
|
|
- name: 'issue',
|
|
|
|
- routerName: 'search-issued',
|
|
|
|
- placeholder: '输入您想要查询的供应信息,多个关键词用空格隔开',
|
|
|
|
- show: true
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
searchQuery: {
|
|
searchQuery: {
|
|
keywords: ''
|
|
keywords: ''
|
|
},
|
|
},
|
|
- rightQrShow: false,
|
|
|
|
- preSearch: {
|
|
|
|
- hover: false,
|
|
|
|
- focus: false,
|
|
|
|
- list: []
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- preSearchListShow: function () {
|
|
|
|
- return (
|
|
|
|
- this.searchContent.trim().length >= 2 &&
|
|
|
|
- this.preSearch.list.length &&
|
|
|
|
- (this.preSearch.focus || this.preSearch.hover)
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- watch: {
|
|
|
|
- '$route.path': function () {
|
|
|
|
- this.getDefaultActivePane()
|
|
|
|
- },
|
|
|
|
- tabActive: function (newVal, oldVal) {
|
|
|
|
- let result = ''
|
|
|
|
- if (newVal === 'zb') {
|
|
|
|
- if (this.searchContent) {
|
|
|
|
- result =
|
|
|
|
- '/jylab/supsearch/index.html?keywords=' +
|
|
|
|
- this.searchContent +
|
|
|
|
- '&publishtime=thisyear'
|
|
|
|
- } else {
|
|
|
|
- result = '/jylab/supsearch/index.html'
|
|
|
|
- }
|
|
|
|
- } else if (newVal === 'cgdw') {
|
|
|
|
- if (this.searchContent) {
|
|
|
|
- result = '/jylab/purSearch/index.html?keywords=' + this.searchContent
|
|
|
|
- } else {
|
|
|
|
- result = '/jylab/purSearch/index.html'
|
|
|
|
- }
|
|
|
|
- } else if (newVal === 'qy') {
|
|
|
|
- if (this.searchContent) {
|
|
|
|
- result = '/jylab/entSearch/index.html?keywords=' + this.searchContent
|
|
|
|
- } else {
|
|
|
|
- result = '/jylab/entSearch/index.html'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!result) return
|
|
|
|
- tryCallHooks(
|
|
|
|
- {
|
|
|
|
- fn: (result) => {
|
|
|
|
- this.$BRACE.methods.open({
|
|
|
|
- route: {
|
|
|
|
- link: result,
|
|
|
|
- appType: 'iframe'
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- spareFn: (result) => {
|
|
|
|
- location.href = result
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- result
|
|
|
|
- )
|
|
|
|
|
|
+ rightQrShow: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.initSearchType()
|
|
|
|
this.getParams()
|
|
this.getParams()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- initSearchType() {
|
|
|
|
- this.getDefaultActivePane()
|
|
|
|
- this.checkPureShow()
|
|
|
|
- },
|
|
|
|
getParams() {
|
|
getParams() {
|
|
let { keywords } = this.$route.query
|
|
let { keywords } = this.$route.query
|
|
if (keywords === 'undefined') {
|
|
if (keywords === 'undefined') {
|
|
keywords = ''
|
|
keywords = ''
|
|
}
|
|
}
|
|
this.searchQuery.keywords = keywords
|
|
this.searchQuery.keywords = keywords
|
|
- this.onInput(keywords) // 触发v-model
|
|
|
|
|
|
+ this.onInput(keywords)
|
|
if (this.immediateSearch) {
|
|
if (this.immediateSearch) {
|
|
this.onSearch()
|
|
this.onSearch()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getDefaultActivePane() {
|
|
|
|
- const { name } = this.$route
|
|
|
|
- const activePane = this.tabPaneList.find((pane) => {
|
|
|
|
- return pane.routerName === name
|
|
|
|
- })
|
|
|
|
- if (activePane) {
|
|
|
|
- this.tabActivePane = activePane
|
|
|
|
- this.tabActive = activePane.name
|
|
|
|
- this.placeholder = activePane.placeholder
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async checkPureShow() {
|
|
|
|
- // const { data } = await entNicheWhetherbuy()
|
|
|
|
- // if (data && data.isNew) {
|
|
|
|
- // const index = this.tabPaneList.findIndex((pane) => pane.name === 'cgdw')
|
|
|
|
- // this.tabPaneList[index].show = true
|
|
|
|
- // }
|
|
|
|
- },
|
|
|
|
onInput(e) {
|
|
onInput(e) {
|
|
this.$emit('input', e)
|
|
this.$emit('input', e)
|
|
},
|
|
},
|
|
@@ -237,10 +99,6 @@ export default {
|
|
path: this.$route.path,
|
|
path: this.$route.path,
|
|
query: this.searchQuery
|
|
query: this.searchQuery
|
|
})
|
|
})
|
|
- },
|
|
|
|
- changeFilterState: function () {
|
|
|
|
- this.filterShow = !this.filterShow
|
|
|
|
- this.$emit('onFilterChange', this.filterShow)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -252,7 +110,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.search-header {
|
|
.search-header {
|
|
- padding: 24px 32px;
|
|
|
|
|
|
+ padding: 16px;
|
|
|
|
+ padding-left: 32px;
|
|
// background-color: #f5f5fb;
|
|
// background-color: #f5f5fb;
|
|
}
|
|
}
|
|
.in-app {
|
|
.in-app {
|
|
@@ -368,7 +227,7 @@ export default {
|
|
|
|
|
|
.search-right-wx {
|
|
.search-right-wx {
|
|
position: absolute;
|
|
position: absolute;
|
|
- right: 64px;
|
|
|
|
|
|
+ right: 0;
|
|
top: 0;
|
|
top: 0;
|
|
font-size: 17px;
|
|
font-size: 17px;
|
|
> .icon-erweima {
|
|
> .icon-erweima {
|