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

搜索引擎优化

parent f98e00da
......@@ -12,7 +12,7 @@
</el-input>
</div>
</div>
<div class="table_container">
<div class="table_container" v-if="tableData.length">
<el-table
:data="tableData"
height="100%"
......@@ -37,10 +37,12 @@
width="190">
</el-table-column>
<el-table-column
prop="_source"
align="left"
header-align="center"
label="内容">
<template slot-scope="scope">
<span v-html="scope.row._source"></span>
</template>
</el-table-column>
</el-table>
</div>
......@@ -51,6 +53,7 @@
:current-page="currentPage"
@current-change="changeCurrentPage"
@size-change="changeCurrentSize"
v-if="tableData.length"
></list-pagination>
</div>
</div>
......@@ -79,22 +82,33 @@ export default {
},
created() {
this.search_list()
// this.search_list()
},
mounted() {
},
methods: {
search_list(){
if(!this.input2){
return
}
this.$http
.get(`/apaas/service/v3/service/manager/searchES?search=${this.input2}&limit=${this.pageSize}&page=${this.currentPage}`)
.then(response => {
if(response.data.success){
console.log(response.data);
debugger
this.listTotal = response.data.data.total
var temp = []
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
}
......@@ -182,4 +196,7 @@ export default {
height: calc(100% - 130px);
margin-top: 30px;
}
.table_container>>>.search-text{
background-color: #fac266;
}
</style>
......@@ -144,16 +144,17 @@
></div>
</el-form-item>
<el-form-item :label="item.text" v-if="item.type == 'storage'">
<div
:class="{
select_box: true,
is_select: item.storage == save,
}"
v-for="save in save_arr[item.dwtype]"
:key="save"
@click="change_appset(item, 'storage', save)"
>
{{ save }}
<div style="overflow:hidden;margin-bottom:5px;">
<div class="storage_type" @click="change_appset(item, 'check_type', 0)" :style="item.check_type==0?{backgroundColor:'#515fe7',color:'#f8f9fd'}:''">临时存储</div>
<div class="storage_type" @click="change_appset(item, 'check_type', 1)" :style="item.check_type==1?{backgroundColor:'#515fe7',color:'#f8f9fd'}:''">云存储</div>
</div>
<div class="cloud_save_box" v-if="item.check_type==1">
<el-radio-group v-model="item.value">
<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>
</p>
</el-radio-group>
</div>
</el-form-item>
<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