feat: 增加语料的搜索
This commit is contained in:
parent
d53fbef178
commit
e71ff4ad95
@ -22,6 +22,27 @@
|
||||
</el-table>
|
||||
|
||||
<el-dialog title="选择语料" v-model="open" width="700px">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="语料名称" prop="corpusName">
|
||||
<el-input
|
||||
v-model="queryParams.corpusName"
|
||||
placeholder="请输入语料名称"
|
||||
clearable
|
||||
@keyup.enter="getList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="getList"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="corpusList"
|
||||
@ -117,41 +138,48 @@ const selectable = (row) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
if (props.type === "1") {
|
||||
listCorpus({
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 100000,
|
||||
type: "TEST",
|
||||
continuous: 1,
|
||||
})
|
||||
corpusName: '',
|
||||
continuous: 1
|
||||
})
|
||||
const getList = () => {
|
||||
if (props.type === "1") {
|
||||
queryParams.value.continuous = 1
|
||||
listCorpus(queryParams.value)
|
||||
.then((response) => {
|
||||
corpusList.value = response.rows;
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
getBatchCorpus({
|
||||
pageNum: 1,
|
||||
pageSize: 100000,
|
||||
type: "TEST",
|
||||
continuous: 0,
|
||||
})
|
||||
queryParams.value.continuous = 0
|
||||
getBatchCorpus(queryParams.value)
|
||||
.then((response) => {
|
||||
corpusList.value = response.rows;
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
queryParams.value.corpusName = ''
|
||||
getList()
|
||||
}
|
||||
|
||||
const tableRef = ref();
|
||||
const submitForm = () => {
|
||||
const rows = tableRef.value.getSelectionRows();
|
||||
selectList.value = rows;
|
||||
open.value = false;
|
||||
emits("updateSelectRows", rows);
|
||||
resetForm()
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
open.value = false;
|
||||
resetForm()
|
||||
};
|
||||
|
||||
const getSelectList = (corpusIds) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user