From 31a48e3a3c7d4e37a05ef43fa4b65c84989cc353 Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期四, 29 八月 2024 09:26:25 +0800
Subject: [PATCH] select role
---
src/views/dmx/knowledgeLib/tool.vue | 153 ++++++++++++++++++++++++++++++++++++--------------
1 files changed, 109 insertions(+), 44 deletions(-)
diff --git a/src/views/dmx/knowledgeLib/tool.vue b/src/views/dmx/knowledgeLib/tool.vue
index 883e668..e8bcf6e 100644
--- a/src/views/dmx/knowledgeLib/tool.vue
+++ b/src/views/dmx/knowledgeLib/tool.vue
@@ -1,9 +1,4 @@
<template>
- <a-button type="text" @click="handleClick" size="small">
- <template #icon>
- <icon-tool />
- </template>
- </a-button>
<a-modal
v-model:visible="visible"
title=" "
@@ -15,10 +10,13 @@
>
<a-tabs default-active-key="1">
<a-tab-pane key="1">
- <template #title> <icon-calendar /> 瑙f瀽鏂规硶 </template>
+ <template #title>
+ <icon-calendar />
+ 瑙f瀽鏂规硶
+ </template>
<div style="width: 100%">
<div style="display: flex; align-items: center">
- <div> 瑙f瀽鏂规硶: </div>
+ <div> 瑙f瀽鏂规硶:</div>
<div style="margin-left: 10px">
<a-select v-model="form.parser_id" placeholder="璇烽�夋嫨">
<a-option
@@ -38,8 +36,15 @@
auto-label-width
@submit="handleSubmit"
>
- <a-divider style="margin-top: 10px" />
- <a-form-item field="slider" label="鍧桾oken鏁�">
+ <a-divider
+ style="margin-top: 10px"
+ v-if="form.parser_id === 'naive'"
+ />
+ <a-form-item
+ field="slider"
+ label="鍧桾oken鏁�"
+ v-if="form.parser_id === 'naive'"
+ >
<a-slider
v-model="form.chunk_token_num"
:min="0"
@@ -47,14 +52,32 @@
show-input
/>
</a-form-item>
- <a-divider style="margin-top: 10px" />
- <a-form-item field="raptor" label="浣跨敤鍙洖澧炲己RAPTOR绛栫暐">
- <a-space direction="vertical" size="large">
- <a-switch
- v-model="form.use_raptor"
- @change="onChangeRAPTOR"
- />
- </a-space>
+ <a-divider
+ style="margin-top: 10px"
+ v-if="
+ form.parser_id === 'naive' ||
+ form.parser_id === 'qa' ||
+ form.parser_id === 'manual' ||
+ form.parser_id === 'laws' ||
+ form.parser_id === 'book'
+ "
+ />
+ <a-form-item
+ field="raptor"
+ label="浣跨敤鍙洖澧炲己RAPTOR绛栫暐"
+ v-if="
+ form.parser_id === 'naive' ||
+ form.parser_id === 'qa' ||
+ form.parser_id === 'manual' ||
+ form.parser_id === 'laws' ||
+ form.parser_id === 'book'
+ "
+ >
+ <a-switch
+ v-model="form.use_raptor"
+ @change="onChangeRAPTOR"
+ size="small"
+ />
</a-form-item>
<div v-if="form.use_raptor">
<a-form-item field="prompt" label="鎻愮ず璇�">
@@ -125,8 +148,8 @@
style="margin-left: 10px"
type="primary"
html-type="submit"
- >纭畾</a-button
- >
+ >纭畾
+ </a-button>
</div>
</a-form-item>
</a-form>
@@ -134,7 +157,10 @@
</div>
</a-tab-pane>
<a-tab-pane key="2">
- <template #title> <icon-clock-circle /> 鍒涘缓瑙f瀽鍧� </template>
+ <template #title>
+ <icon-clock-circle />
+ 鍒涘缓瑙f瀽鍧�
+ </template>
<div class="details">
<div class="details-header">
<div
@@ -158,8 +184,9 @@
type="outline"
class="button"
style="margin-right: 10px"
- >鎵归噺<icon-down style="margin-left: 4px"
- /></a-button>
+ >鎵归噺
+ <icon-down style="margin-left: 4px" />
+ </a-button>
<template #content>
<a-space direction="vertical">
<a-checkbox
@@ -246,8 +273,9 @@
type="outline"
class="button"
style="margin-right: 10px"
- ><icon-sort
- /></a-button>
+ >
+ <icon-sort />
+ </a-button>
<template #content>
<a-radio-group
v-model="available_int"
@@ -294,6 +322,7 @@
:checked-value="1"
:unchecked-value="0"
@change="handleChangeStatus(item)"
+ size="small"
/>
</div>
</div>
@@ -328,9 +357,11 @@
queryChunkList,
chunkSwitch,
chunkRm,
+ achunkGet,
} from '@/api/kbList';
import addDetails from '@/views/dmx/knowledgeLib/addDetails.vue';
import eidtDetails from '@/views/dmx/knowledgeLib/eidtDetails.vue';
+
const visible = ref(false);
const loading = ref(false);
const radio = ref('1');
@@ -356,6 +387,18 @@
};
});
+ // 杩囨护瑙f瀽鏂规硶
+
+ const filterParserArr = [
+ 'naive',
+ 'qa',
+ 'resume',
+ 'manual',
+ 'book',
+ 'laws',
+ 'one',
+ ];
+
const isBtn = ref(true);
const closeSlelct = () => {
@@ -374,7 +417,7 @@
});
const form = reactive({
- parser_id: props.item.parser_id,
+ parser_id: '',
doc_id: props.item.id,
max_token: 698,
threshold: 0.3,
@@ -404,6 +447,7 @@
const formatter = (value) => {
return value / 100;
};
+
function randomNumber() {
// 鐢熸垚涓�涓粙浜巑in鍜宮ax涔嬮棿鐨勯殢鏈烘暣鏁帮紙鍖呭惈min鍜宮ax锛�
const min = 1; // 鏈�灏忓��
@@ -415,7 +459,7 @@
if (!errors) {
let data = await kbdocumentchangeparser({
parser_id: form.parser_id,
- doc_id: form.doc_id,
+ doc_id: props.item.id,
parser_config: {
raptor: {
use_raptor: form.use_raptor,
@@ -445,23 +489,30 @@
visible.value = false;
};
- const contentClick = (item) => {
- Object.assign(eidtDilinfo, item);
- eidtDilVisible.value = true;
+ const contentClick = async (item) => {
+ try {
+ const data = await achunkGet({
+ chunk_id: item.chunk_id,
+ });
+ // console.log(data.data);
+ Object.assign(eidtDilinfo, data.data);
+ eidtDilVisible.value = true;
+ } catch (error) {
+ Message.error('鑾峰彇澶辫触');
+ }
};
const handleOpened = (el) => {
- // console.log('props',props.kbtenantInfo);
- // console.log('props',props.item);
- // console.log('props',props.kbdetail);
+ console.log('kbtenantInfo',props.kbtenantInfo);
+ console.log('item', props.item);
+ console.log('kbdetail',props.kbdetail);
console.log(parser_ids, 'parser_ids');
- // Object.assign(form,{
- // name: '',// 鐢ㄦ埛鍚�
- // nameJoin: '',// 鏄电О
- // post: '',// 宀椾綅
- // txt: '',// 澶囨敞
- // });
- // formRef.value.resetFields();
- console.log(props.item.id);
+ let parser_id = props.item.parser_id;
+ parser_ids.forEach((item) => {
+ if (item.name == parser_id) {
+ form.parser_id = item.value;
+ }
+ });
+ getList();
};
const onChangeRAPTOR = () => {};
@@ -595,34 +646,45 @@
});
};
- onBeforeMount(() => {});
- onMounted(() => {
- getList();
+ onBeforeMount(() => {
+
});
+ onMounted(() => {});
+
+ defineExpose({
+ handleClick
+ })
+
+
</script>
<style scoped lang="less">
.parser {
width: 100%;
- ::v-deep .arco-btn-outline:hover,
+
+ .arco-btn-outline:hover,
.arco-btn-outline,
.arco-btn-outline[type='button'] {
color: #2a2a2b;
border: 1px solid #2a2a2b;
}
+
.button {
//color: #2a2a2b!important;
}
}
+
::-webkit-scrollbar {
display: none;
}
+
.groupMain {
width: 100%;
height: 500px;
overflow: auto;
display: flex;
justify-content: center;
+
.groupList {
display: flex;
padding: 24px;
@@ -631,6 +693,7 @@
border: 1px solid #f0f0f0;
margin-bottom: 20px;
overflow: auto;
+
.groupList-content {
width: 700px;
//height: 100px;
@@ -645,6 +708,7 @@
}
}
}
+
:deep(.emphaRed em) {
color: red !important;
}
@@ -652,6 +716,7 @@
.groupActive {
background: #eff8ff;
}
+
.groupNoActive {
background: var(--color-bg-1);
color: var(--color-text-1);
--
Gitblit v1.8.0