修改搜索中心

This commit is contained in:
qq787203167
2022-03-15 15:27:46 +08:00
parent 1a2190f12d
commit a4744b0f39
2 changed files with 401 additions and 370 deletions
@@ -5,12 +5,11 @@
<div class="search-detail">
<div class="search-detail-wrap">
<a-input-group class="input-group" compact v-if="active === $t('DocumentLibrary')">
<a-select default-value="Option1">
<a-select-option value="Option1">
标题
</a-select-option>
<a-select-option value="Option2">
Option2
<a-select v-model="selectModel">
<a-select-option :value="item.db_field_name"
@change="selectChange"
v-for="(item,index) in searchOption" :key="index">
{{item.db_field_txt}}
</a-select-option>
</a-select>
<a-input-search
@@ -42,8 +41,8 @@
</a-tabs>
</div>
</div>
<whole v-if="active === $t('whole')"/>
<DocumentLibrary v-else-if="active === $t('DocumentLibrary')"/>
<whole :url="url" v-if="active === $t('whole')"/>
<DocumentLibrary ref="DocumentLibraryRef" v-else-if="active === $t('DocumentLibrary')"/>
</div>
</div>
</div>
@@ -53,6 +52,7 @@
<script>
import whole from './components/whole'
import DocumentLibrary from './components/DocumentLibrary'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
export default {
name: 'searchCenter',
@@ -63,16 +63,45 @@
data() {
return {
active: this.$t('whole'),
showList: false
showList: false,
url: {
queryCondition: 'search/document/queryCondition'
},
selectModel: '',
queryParam: {}
}
},
mounted() {
this.getCondition()
},
methods: {
callback(key) {
this.active = key
},
onSearch() {
onSearch(event) {
this.queryParam[this.selectModel] = event
if (this.$refs.DocumentLibraryRef){
this.$refs.DocumentLibraryRef.searchData(this.queryParam)
}
},
selectChange(event) {
console.log(event)
},
getCondition() {
let query = {
flag: 1,
searchFlag: 1
}
getAction(this.url.queryCondition, query).then((res) => {
if (res.success) {
this.searchOption = res.result || []
if (this.searchOption.length > 0) {
this.selectModel = this.searchOption[0].db_field_name
}
} else {
this.searchOption = []
}
})
}
}
}
@@ -139,24 +168,29 @@
height: 40px;
line-height: 40px;
}
.input-group .ant-select-selection{
.input-group .ant-select-selection {
width: 88px;
height: 40px;
line-height: 40px;
padding: 0 0 0 6px;
}
.input-group .ant-select-selection__rendered{
.input-group .ant-select-selection__rendered {
height: 40px;
line-height: 40px;
}
.input-group .ant-input{
.input-group .ant-input {
height: 40px;
line-height: 40px;
}
.input-group .ant-select-arrow{
.input-group .ant-select-arrow {
right: 15px;
}
.input-group .ant-select{
.input-group .ant-select {
background: #F6F7FA;
}
</style>