Commit 3a7c97ed authored by 张俊's avatar 张俊

搜索引擎优化

parent f98e00da
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</el-input> </el-input>
</div> </div>
</div> </div>
<div class="table_container"> <div class="table_container" v-if="tableData.length">
<el-table <el-table
:data="tableData" :data="tableData"
height="100%" height="100%"
...@@ -37,10 +37,12 @@ ...@@ -37,10 +37,12 @@
width="190"> width="190">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="_source"
align="left" align="left"
header-align="center" header-align="center"
label="内容"> label="内容">
<template slot-scope="scope">
<span v-html="scope.row._source"></span>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -51,6 +53,7 @@ ...@@ -51,6 +53,7 @@
:current-page="currentPage" :current-page="currentPage"
@current-change="changeCurrentPage" @current-change="changeCurrentPage"
@size-change="changeCurrentSize" @size-change="changeCurrentSize"
v-if="tableData.length"
></list-pagination> ></list-pagination>
</div> </div>
</div> </div>
...@@ -79,22 +82,33 @@ export default { ...@@ -79,22 +82,33 @@ export default {
}, },
created() { created() {
this.search_list() // this.search_list()
}, },
mounted() { mounted() {
}, },
methods: { methods: {
search_list(){ search_list(){
if(!this.input2){
return
}
this.$http this.$http
.get(`/apaas/service/v3/service/manager/searchES?search=${this.input2}&limit=${this.pageSize}&page=${this.currentPage}`) .get(`/apaas/service/v3/service/manager/searchES?search=${this.input2}&limit=${this.pageSize}&page=${this.currentPage}`)
.then(response => { .then(response => {
if(response.data.success){ if(response.data.success){
console.log(response.data); console.log(response.data);
debugger
this.listTotal = response.data.data.total this.listTotal = response.data.data.total
var temp = [] var temp = []
response.data.data.data.forEach((e,idx) => { response.data.data.data.forEach((e,idx) => {
temp.push({...e._source,_source:JSON.stringify(e._source),index:idx+1+(this.currentPage-1)*10}) var temp_str = ''
let replaceReg = new RegExp(this.input2, 'g')
let replaceString ='<span class="search-text">' + this.input2 + '</span>'
temp_str = (JSON.stringify(e._source)).replace(
replaceReg,
replaceString
)
temp.push({...e._source,_source:temp_str,index:idx+1+(this.currentPage-1)*10})
}); });
this.tableData = temp this.tableData = temp
} }
...@@ -182,4 +196,7 @@ export default { ...@@ -182,4 +196,7 @@ export default {
height: calc(100% - 130px); height: calc(100% - 130px);
margin-top: 30px; margin-top: 30px;
} }
.table_container>>>.search-text{
background-color: #fac266;
}
</style> </style>
...@@ -144,16 +144,17 @@ ...@@ -144,16 +144,17 @@
></div> ></div>
</el-form-item> </el-form-item>
<el-form-item :label="item.text" v-if="item.type == 'storage'"> <el-form-item :label="item.text" v-if="item.type == 'storage'">
<div <div style="overflow:hidden;margin-bottom:5px;">
:class="{ <div class="storage_type" @click="change_appset(item, 'check_type', 0)" :style="item.check_type==0?{backgroundColor:'#515fe7',color:'#f8f9fd'}:''">临时存储</div>
select_box: true, <div class="storage_type" @click="change_appset(item, 'check_type', 1)" :style="item.check_type==1?{backgroundColor:'#515fe7',color:'#f8f9fd'}:''">云存储</div>
is_select: item.storage == save, </div>
}"
v-for="save in save_arr[item.dwtype]" <div class="cloud_save_box" v-if="item.check_type==1">
:key="save" <el-radio-group v-model="item.value">
@click="change_appset(item, 'storage', save)" <p v-for="(it,idx) in pvc_list" :key="idx+589000">
> <el-radio :label="it.disk_serial_number+';'+it.id">{{it.disk_serial_number}}&nbsp;({{'用量:'+it.disk_cap+'Gi'+' '+' ' +'类型:'+it.store_type}})</el-radio>
{{ save }} </p>
</el-radio-group>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label="item.text" v-if="item.type == 'volume'"> <el-form-item :label="item.text" v-if="item.type == 'volume'">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment