|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="testBox">
|
|
|
<div class="test_right">
|
|
|
- <div class="test_input_box" :class="{focus: isFocused}">
|
|
|
+ <div class="test_input_box" :class="{ focus: isFocused }">
|
|
|
<div class="setting">
|
|
|
<el-tooltip :content=lang.knowSearchConfig placement="bottom" effect="dark">
|
|
|
<!-- content to trigger tooltip here -->
|
|
@@ -13,11 +13,11 @@
|
|
|
resize="none" @focus="isFocused = true" @blur="isFocused = false">
|
|
|
</el-input>
|
|
|
<el-button class="btn" type="primary" size="mini" @click="testCheck"
|
|
|
- v-loading="isLoading">{{lang.test}}</el-button>
|
|
|
+ v-loading="isLoading">{{ lang.test }}</el-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="test_history" v-loading="isLoading2">
|
|
|
- <div class="title">{{lang.testRecord}}</div>
|
|
|
+ <div class="title">{{ lang.testRecord }}</div>
|
|
|
<div class="test_history_box" v-for="(item, index) in ragArray" :key="index" @click="checkRag(item)"
|
|
|
:class="{ acitve: item.id == ragJson.id }">
|
|
|
<div class="typeIcon" :class="{
|
|
@@ -35,11 +35,11 @@
|
|
|
</div>
|
|
|
<div class="test_left">
|
|
|
<div class="test_check" v-if="Object.keys(ragJson).length">
|
|
|
- <div class="title">{{lang.testParameters}}</div>
|
|
|
+ <div class="title">{{ lang.testParameters }}</div>
|
|
|
<div class="can_box">
|
|
|
<div class="can_one" v-if="ragJson.setting">
|
|
|
<div class="one_box">
|
|
|
- <span>{{lang.searchWay}}</span>
|
|
|
+ <span>{{ lang.searchWay }}</span>
|
|
|
<span class="typeIcon" :class="{
|
|
|
type1: ragJson.setting.useType == 1,
|
|
|
type2: ragJson.setting.useType == 2,
|
|
@@ -47,24 +47,24 @@
|
|
|
}">{{ getUseType(ragJson.setting.useType) }}</span>
|
|
|
</div>
|
|
|
<div class="one_box">
|
|
|
- <span>{{lang.citations}}</span>
|
|
|
+ <span>{{ lang.citations }}</span>
|
|
|
<span>{{ ragJson.setting.tokens }}</span>
|
|
|
</div>
|
|
|
<div class="one_box">
|
|
|
- <span>{{lang.minRelevance}}</span>
|
|
|
+ <span>{{ lang.minRelevance }}</span>
|
|
|
<span>{{ ragJson.setting.temperature }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="can_one" v-if="ragJson.setting" style="margin-top: 10px">
|
|
|
<div class="one_box">
|
|
|
- <span>{{lang.testText}}</span>
|
|
|
+ <span>{{ lang.testText }}</span>
|
|
|
<span>{{ ragJson.setting.query }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="test_result" v-if="Object.keys(ragJson).length">
|
|
|
- <div class="title">{{lang.testResult}}</div>
|
|
|
+ <div class="title">{{ lang.testResult }}</div>
|
|
|
<div v-if="ragJson.json && ragJson.json.chunkSearchResults" class="result_box">
|
|
|
<div v-for="(item, index) in ragJson.json.chunkSearchResults" :key="index" class="result">
|
|
|
<el-tooltip :content=lang.distance placement="bottom" effect="dark">
|
|
@@ -87,28 +87,71 @@
|
|
|
<div style="height: 50px; line-height: 50px; width: 47.4px">
|
|
|
<img style="width: 100%" src="../../../../assets/flieKong.svg" alt="" />
|
|
|
</div>
|
|
|
- <div style="margin-top: 10px">{{lang.teResultArea}}</div>
|
|
|
+ <div style="margin-top: 10px">{{ lang.teResultArea }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-dialog title="新建文件夹" :visible.sync="moveBox" width="650px" style="border-radius: 8px"
|
|
|
@close="moveBox = false" class="canEditCss">
|
|
|
<div class="canEditTit" slot="title">
|
|
|
<img src="../../../../assets/icon/testC/dialog_setting.svg" alt="" />
|
|
|
- <span>{{lang.knowSearchConfig}}</span>
|
|
|
+ <span>{{ lang.knowSearchConfig }}</span>
|
|
|
</div>
|
|
|
<div style="width: 100%; padding: 10px 40px; box-sizing: border-box;">
|
|
|
<div class="setting_nav">
|
|
|
- <div class="setting_nav_box searchIcon active">
|
|
|
- <span>{{lang.searchFiltration}}</span>
|
|
|
+ <div class="setting_nav_box settingIcon" :class="{ active: searchType == 1 }"
|
|
|
+ @click="searchType = 1">
|
|
|
+ <span>{{ lang.searchType }}</span>
|
|
|
</div>
|
|
|
+ <div class="setting_nav_box searchIcon" :class="{ active: searchType == 2 }"
|
|
|
+ @click="searchType = 2">
|
|
|
+ <span>{{ lang.searchFiltration }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="setting_serach" v-if="searchType == 1">
|
|
|
+ <div class="setting_type_box" @click="json.useType = 1" :class="{ active: json.useType == 1 }">
|
|
|
+ <div class="checkBox">
|
|
|
+ <el-radio v-model="json.useType" :label="1" fill="#3370ff"></el-radio>
|
|
|
+ </div>
|
|
|
+ <div class="setting_type_detail">
|
|
|
+ <div class="title">{{ lang.semanticRetrieval }}</div>
|
|
|
+ <div class="detail">{{ lang.semanticRetrievalD }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="setting_type_box" @click="json.useType = 2" :class="{ active: json.useType == 2 }">
|
|
|
+ <div class="checkBox">
|
|
|
+ <el-radio v-model="json.useType" :label="2" fill="#3370ff"></el-radio>
|
|
|
+ </div>
|
|
|
+ <div class="setting_type_detail">
|
|
|
+ <div class="title">{{ lang.fullTextSearch }}</div>
|
|
|
+ <div class="detail">{{lang.fullTextSearchD }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="setting_type_box" @click="json.useType = 3" :class="{ active: json.useType == 3 }">
|
|
|
+ <div class="checkBox">
|
|
|
+ <el-radio v-model="json.useType" :label="3" fill="#3370ff"></el-radio>
|
|
|
+ </div>
|
|
|
+ <div class="setting_type_detail">
|
|
|
+ <div class="title">{{ lang.mixSearch }}</div>
|
|
|
+ <div class="detail">{{ lang.mixSearchD }}</div>
|
|
|
+ <div class="slider" v-show="json.useType == 3">
|
|
|
+ <div style="display: flex; justify-content: space-between;">
|
|
|
+ <span>{{ lang.fullTextSearch }}: {{ 10 - json.mixSearchRatio }}</span>
|
|
|
+ <span>{{ lang.semanticRetrieval }}: {{ json.mixSearchRatio }}</span>
|
|
|
+ </div>
|
|
|
+ <el-slider v-model="json.mixSearchRatio" :min="1" :max="9" :step="1" :label-step="1"></el-slider>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
- <div class="setting_serach">
|
|
|
+ <div class="setting_serach" v-if="searchType == 2">
|
|
|
<div class="setting_serach_box">
|
|
|
- <span class="title">{{lang.citations}}
|
|
|
+ <span class="title">{{ lang.citations }}
|
|
|
<el-tooltip :content=lang.token placement="bottom" effect="dark" popper-class="maxWidth">
|
|
|
- <!-- content to trigger tooltip here -->
|
|
|
- <i class="tips"></i>
|
|
|
- </el-tooltip>
|
|
|
+ <!-- content to trigger tooltip here -->
|
|
|
+ <i class="tips"></i>
|
|
|
+ </el-tooltip>
|
|
|
</span>
|
|
|
<el-slider class="slider" v-model="json.tokens" :min="100" :max="20000" :step="1"
|
|
|
:vertical="false"></el-slider>
|
|
@@ -116,22 +159,23 @@
|
|
|
min="100" max="20000" step="1"></el-input-number>
|
|
|
</div>
|
|
|
<div class="setting_serach_box">
|
|
|
- <span class="title">{{this.lang.minRelevance}}
|
|
|
- <el-tooltip :content=lang.refiltering placement="bottom" effect="dark" popper-class="maxWidth">
|
|
|
- <!-- content to trigger tooltip here -->
|
|
|
- <i class="tips"></i>
|
|
|
- </el-tooltip>
|
|
|
+ <span class="title">{{ lang.minRelevance }}
|
|
|
+ <el-tooltip :content=lang.refiltering placement="bottom" effect="dark"
|
|
|
+ popper-class="maxWidth">
|
|
|
+ <!-- content to trigger tooltip here -->
|
|
|
+ <i class="tips"></i>
|
|
|
+ </el-tooltip>
|
|
|
</span>
|
|
|
<el-slider class="slider" v-model="json.temperature" :min="0" :max="1" :step="0.01"
|
|
|
:vertical="false"></el-slider>
|
|
|
- <el-input-number class="number" controls-position="right" v-model="json.temperature" size="small"
|
|
|
- min="0" max="1" step="0.01"></el-input-number>
|
|
|
+ <el-input-number class="number" controls-position="right" v-model="json.temperature"
|
|
|
+ size="small" min="0" max="1" step="0.01"></el-input-number>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<span slot="footer">
|
|
|
- <el-button @click="moveBox = false">{{lang.cancel}}</el-button>
|
|
|
- <el-button type="primary" @click="confirmSetting">{{this.lang.confirm}}</el-button>
|
|
|
+ <el-button @click="moveBox = false">{{ lang.cancel }}</el-button>
|
|
|
+ <el-button type="primary" @click="confirmSetting">{{ lang.confirm }}</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -154,7 +198,10 @@ export default {
|
|
|
json: {
|
|
|
temperature: 0,
|
|
|
tokens: 1500,
|
|
|
- }
|
|
|
+ },
|
|
|
+ searchType: 1,
|
|
|
+ useType: 1,
|
|
|
+ mixSearchRatio: 5
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -182,40 +229,56 @@ export default {
|
|
|
return this.lang.semanticRetrieval;
|
|
|
} else if (e == 2) {
|
|
|
return this.lang.fullTextSearch;
|
|
|
- } else if (e == 2) {
|
|
|
+ } else if (e == 3) {
|
|
|
return this.lang.mixSearch;
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ folderid(newValue, oldValue) {
|
|
|
+ this.getRagData();
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
testCheck() {
|
|
|
this.isLoading = true;
|
|
|
+ let mixSearchRatio = 1
|
|
|
+ if (this.useType == 1) {
|
|
|
+ mixSearchRatio = 10
|
|
|
+ } else if (this.useType == 2) {
|
|
|
+ mixSearchRatio = 0
|
|
|
+ } else {
|
|
|
+ mixSearchRatio = this.mixSearchRatio
|
|
|
+ }
|
|
|
+
|
|
|
+ // let params = {
|
|
|
+ // userid: this.userid,
|
|
|
+ // ids: this.folderid,
|
|
|
+ // query: this.value,
|
|
|
+ // type: 2,
|
|
|
+ // useType: this.useType,
|
|
|
+ // fullTextWeight: 10 - mixSearchRatio,
|
|
|
+ // semanticWeight: mixSearchRatio,
|
|
|
+ // limit: 10,
|
|
|
+ // temperature: this.temperature,
|
|
|
+ // tokens: this.tokens,
|
|
|
+ // };
|
|
|
let params = {
|
|
|
userid: this.userid,
|
|
|
- ids: this.folderid,
|
|
|
+ documentids: "",
|
|
|
+ folderids: this.folderid,
|
|
|
query: this.value,
|
|
|
- type: 2,
|
|
|
- useType: 1,
|
|
|
- fullTextWeight: 1,
|
|
|
- semanticWeight: 5,
|
|
|
+ useType: this.useType,
|
|
|
+ fullTextWeight: 10 - mixSearchRatio,
|
|
|
+ semanticWeight: mixSearchRatio,
|
|
|
limit: 10,
|
|
|
temperature: this.temperature,
|
|
|
tokens: this.tokens,
|
|
|
};
|
|
|
- // let params = {
|
|
|
- // documentids: "",
|
|
|
- // folderids: this.folderid,
|
|
|
- // query: this.value,
|
|
|
- // useType: 1,
|
|
|
- // fullTextWeight: 1,
|
|
|
- // semanticWeight: 5,
|
|
|
- // limit: 10,
|
|
|
- // temperature: this.temperature,
|
|
|
- // tokens: this.tokens,
|
|
|
- // };
|
|
|
this.ajax
|
|
|
- .post(this.$store.state.fileApi + "ragFolder", [params])
|
|
|
+ .post(this.$store.state.fileApi + "searchFolder3", [params])
|
|
|
// .post(this.$store.state.fileApi + "searchFolder", [params])
|
|
|
.then((res) => {
|
|
|
this.isLoading = false;
|
|
@@ -247,6 +310,8 @@ export default {
|
|
|
this.ragJson = this.ragArray[0];
|
|
|
this.ragJson.setting = this.ragJson.setting;
|
|
|
this.ragJson.json = this.ragJson.json;
|
|
|
+ } else {
|
|
|
+ this.ragJson = {};
|
|
|
}
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -319,13 +384,18 @@ export default {
|
|
|
openSetting() {
|
|
|
this.json = JSON.parse(JSON.stringify({
|
|
|
tokens: this.tokens,
|
|
|
- temperature: this.temperature
|
|
|
+ temperature: this.temperature,
|
|
|
+ useType: this.useType,
|
|
|
+ mixSearchRatio: 5
|
|
|
}));
|
|
|
+ this.searchType = 1
|
|
|
this.moveBox = true;
|
|
|
},
|
|
|
confirmSetting() {
|
|
|
this.tokens = this.json.tokens
|
|
|
this.temperature = this.json.temperature
|
|
|
+ this.useType = this.json.useType
|
|
|
+ this.mixSearchRatio = this.json.mixSearchRatio
|
|
|
this.moveBox = false;
|
|
|
}
|
|
|
},
|
|
@@ -595,6 +665,24 @@ export default {
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
|
|
|
+.type2:before {
|
|
|
+ content: "";
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ margin-right: 5px;
|
|
|
+ background-image: url(../../../../assets/icon/testC/m_icon2.svg);
|
|
|
+ background-size: 100% 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.type3:before {
|
|
|
+ content: "";
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ margin-right: 5px;
|
|
|
+ background-image: url(../../../../assets/icon/testC/m_icon3.svg);
|
|
|
+ background-size: 100% 100%;
|
|
|
+}
|
|
|
+
|
|
|
.result_box {
|
|
|
width: 100%;
|
|
|
}
|
|
@@ -679,7 +767,7 @@ export default {
|
|
|
.setting_nav_box {
|
|
|
display: flex;
|
|
|
height: 100%;
|
|
|
- width: calc(100% / 3);
|
|
|
+ width: calc(100% / 2);
|
|
|
align-items: center;
|
|
|
/* flex: 1; */
|
|
|
color: #485264;
|
|
@@ -713,6 +801,16 @@ export default {
|
|
|
background-image: url(../../../../assets/icon/testC/search2.svg);
|
|
|
}
|
|
|
|
|
|
+.settingIcon::before {
|
|
|
+ background-image: url(../../../../assets/icon/testC/setting.svg);
|
|
|
+}
|
|
|
+
|
|
|
+.setting_nav_box:hover.settingIcon::before,
|
|
|
+.setting_nav_box.active.settingIcon::before {
|
|
|
+ background-image: url(../../../../assets/icon/testC/setting2.svg);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
.setting_serach {
|
|
|
width: 100%;
|
|
|
}
|
|
@@ -727,7 +825,7 @@ export default {
|
|
|
|
|
|
.setting_serach_box .title {
|
|
|
display: flex;
|
|
|
- flex: 0 0 120px;
|
|
|
+ flex: 0 0 140px;
|
|
|
-webkit-box-align: center;
|
|
|
align-items: center;
|
|
|
}
|
|
@@ -735,12 +833,15 @@ export default {
|
|
|
.setting_serach_box .slider {
|
|
|
flex: 1;
|
|
|
}
|
|
|
-.setting_serach_box .slider >>> .el-slider__bar{
|
|
|
+
|
|
|
+.setting_serach_box .slider>>>.el-slider__bar {
|
|
|
background: unset;
|
|
|
}
|
|
|
-.setting_serach_box .slider >>> .el-slider__button {
|
|
|
+
|
|
|
+.setting_serach_box .slider>>>.el-slider__button {
|
|
|
border-color: #3370ff;
|
|
|
}
|
|
|
+
|
|
|
.setting_serach_box .number {
|
|
|
flex: 0 0 120px;
|
|
|
}
|
|
@@ -749,7 +850,7 @@ export default {
|
|
|
margin-top: 30px;
|
|
|
}
|
|
|
|
|
|
-.tips{
|
|
|
+.tips {
|
|
|
display: block;
|
|
|
background-image: url(../../../../assets/icon/testC/test_tips.svg);
|
|
|
background-size: 100% 100%;
|
|
@@ -759,28 +860,90 @@ export default {
|
|
|
}
|
|
|
|
|
|
@media screen and (max-width: 1300px) {
|
|
|
- .testBox {
|
|
|
- flex-direction: column;
|
|
|
- }
|
|
|
+ .testBox {
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .testBox .test_right {
|
|
|
+ flex-direction: row;
|
|
|
+ width: 100%;
|
|
|
+ height: 250px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .testBox .test_right .test_input_box {
|
|
|
+ flex: 0 0 250px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .testBox .test_right .test_history {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box>>>.el-radio__input.is-checked .el-radio__inner {
|
|
|
+ border-color: #3370ff;
|
|
|
+ background: #3370ff;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box>>>.el-radio__label {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box .slider {
|
|
|
+ margin-top: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box .slider>>>.el-slider__bar {
|
|
|
+ background: #3370ff;
|
|
|
+}
|
|
|
|
|
|
- .testBox .test_right{
|
|
|
- flex-direction: row;
|
|
|
+.setting_type_box .slider>>>.el-slider__runway {
|
|
|
+ background: #f9518e;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box .slider>>>.el-slider__button {
|
|
|
+ border-color: #3370ff;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box {
|
|
|
+ display: flex;
|
|
|
+ background: #f7f8fa;
|
|
|
+ padding: 12px;
|
|
|
+ box-sizing: border-box;
|
|
|
width: 100%;
|
|
|
- height: 250px;
|
|
|
- }
|
|
|
-
|
|
|
- .testBox .test_right .test_input_box{
|
|
|
- flex: 0 0 250px;
|
|
|
- }
|
|
|
- .testBox .test_right .test_history{
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
+ border: 1px solid #eaedf1;
|
|
|
+ border-radius: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all .3s;
|
|
|
}
|
|
|
|
|
|
+.setting_type_box.active,
|
|
|
+.setting_type_box:hover {
|
|
|
+ border: 1px solid #3370ff;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box+.setting_type_box {
|
|
|
+ margin-top: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box .checkBox {
|
|
|
+ margin-right: 12px;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box .setting_type_detail {}
|
|
|
+
|
|
|
+.setting_type_box .setting_type_detail>.title {
|
|
|
+ color: #111824;
|
|
|
+ margin-bottom: 3px;
|
|
|
+}
|
|
|
+
|
|
|
+.setting_type_box .setting_type_detail>.detail {
|
|
|
+ color: #667085;
|
|
|
+ word-break: break-word;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
-.maxWidth{
|
|
|
+.maxWidth {
|
|
|
max-width: 240px;
|
|
|
word-break: break-all;
|
|
|
}
|