From 4fdfacbe067d10cc1adfe5a9a3f9ea4495ba5f4d Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期四, 01 八月 2024 19:09:43 +0800
Subject: [PATCH] 解析块和解析方法的页面开发和功能开发
---
src/views/dmx/knowledgeLib/test.vue | 2
src/views/dmx/knowledgeLib/tool.vue | 353 ++++++++++++++++++++++++++++++++++---------
src/views/dmx/knowledgeLib/index.vue | 84 ++++-----
3 files changed, 313 insertions(+), 126 deletions(-)
diff --git a/src/views/dmx/knowledgeLib/index.vue b/src/views/dmx/knowledgeLib/index.vue
index 2fa72fd..cffd016 100644
--- a/src/views/dmx/knowledgeLib/index.vue
+++ b/src/views/dmx/knowledgeLib/index.vue
@@ -251,45 +251,45 @@
</div>
</a-tab-pane>
</a-tabs>
- <div v-if="detailsShow" class="details">
- <div class="details-header">
- <div style="display: flex;align-items: center">
- <span><icon-arrow-left size="20px" style="cursor: pointer;color: #0960bd;margin: 10px" @click="goBackClick" /></span>
- <icon-file style="color: #0960bd;margin-right: 4px;" />
- <span style="">123.docx</span>
- </div>
- <div style="display: flex; align-items: center;">
- <a-radio-group v-model="position" type="button" style="margin-right: 10px">
- <a-radio value="top">{{'dmx.list.EntireArticle'}}</a-radio>
- <a-radio value="right">{{'dmx.list.omit'}}</a-radio>
- </a-radio-group>
- <a-popover position="bottom">
- <a-button type="outline" class="button" style="margin-right: 10px">{{'dmx.list.batch'}} <icon-down style="margin-left: 4px" /></a-button>
- <template #content>
- <p>Here is the text content</p>
- <p>Here is the text content</p>
- </template>
- </a-popover>
- <a-button type="outline" class="button" style="margin-right: 10px">
- <template #icon>
- <icon-search />
- </template>
- </a-button>
- <a-popover position="bottom">
- <a-button type="outline" class="button" style="margin-right: 10px"><icon-sort /></a-button>
- <template #content>
- <p>Here is the text content</p>
- <p>Here is the text content</p>
- </template>
- </a-popover>
- <addDetails></addDetails>
- </div>
- </div>
- <a-divider style="margin-top: 10px" />
- </div>
+<!-- <div v-if="detailsShow" class="details">-->
+<!-- <div class="details-header">-->
+<!-- <div style="display: flex;align-items: center">-->
+<!-- <span><icon-arrow-left size="20px" style="cursor: pointer;color: #0960bd;margin: 10px" @click="goBackClick" /></span>-->
+<!-- <icon-file style="color: #0960bd;margin-right: 4px;" />-->
+<!-- <span style="">123.docx</span>-->
+<!-- </div>-->
+<!-- <div style="display: flex; align-items: center;">-->
+<!-- <a-radio-group v-model="position" type="button" style="margin-right: 10px">-->
+<!-- <a-radio value="top">{{'dmx.list.EntireArticle'}}</a-radio>-->
+<!-- <a-radio value="right">{{'dmx.list.omit'}}</a-radio>-->
+<!-- </a-radio-group>-->
+<!-- <a-popover position="bottom">-->
+<!-- <a-button type="outline" class="button" style="margin-right: 10px">{{'dmx.list.batch'}} <icon-down style="margin-left: 4px" /></a-button>-->
+<!-- <template #content>-->
+<!-- <p>Here is the text content</p>-->
+<!-- <p>Here is the text content</p>-->
+<!-- </template>-->
+<!-- </a-popover>-->
+<!-- <a-button type="outline" class="button" style="margin-right: 10px">-->
+<!-- <template #icon>-->
+<!-- <icon-search />-->
+<!-- </template>-->
+<!-- </a-button>-->
+<!-- <a-popover position="bottom">-->
+<!-- <a-button type="outline" class="button" style="margin-right: 10px"><icon-sort /></a-button>-->
+<!-- <template #content>-->
+<!-- <p>Here is the text content</p>-->
+<!-- <p>Here is the text content</p>-->
+<!-- </template>-->
+<!-- </a-popover>-->
+<!-- <addDetails></addDetails>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <a-divider style="margin-top: 10px" />-->
+<!-- </div>-->
</div>
</div>
- <a-modal v-model:visible="visible" :footer="false" fullscreen>
+ <a-modal title=" " v-model:visible="visible" :footer="false" fullscreen>
<!-- <docx v-if="documenttype=='docx'" previewSrc="http://192.168.20.116:1080/v1/document/get/405c3efa4d8c11ef97560242ac120006"></docx>-->
<docx v-if="documenttype=='docx'" :previewSrc="previewSrc"></docx>
<excel v-if="documenttype=='excel'" :previewSrc="previewSrc"></excel>
@@ -322,14 +322,11 @@
import config from '@/views/dmx/knowledgeLib/config.vue'
import test from '@/views/dmx/knowledgeLib/test.vue'
import tool from '@/views/dmx/knowledgeLib/tool.vue'
- import addDetails from '@/views/dmx/knowledgeLib/addDetails.vue'
import docx from '@/views/dmx/knowledgeLib/components/docx.vue'
import excel from '@/views/dmx/knowledgeLib/components/excel.vue'
import txtPdf from '@/views/dmx/knowledgeLib/components/txtPdf.vue'
import { Message } from "@arco-design/web-vue";
import { parseTime } from "@/utils";
- import { usePinia } from "@/store";
- const store = usePinia();
type SizeProps = 'mini' | 'small' | 'medium' | 'large';
type Column = TableColumnData & { checked?: true };
const account = ref(null)
@@ -522,9 +519,6 @@
kb_id:params.kb_id,
});
-
-
-
}
} catch (err) {
// you can report use errorHandler or other
@@ -687,8 +681,8 @@
}
const seeload = async (row)=>{
Object.assign(seeObj, row)
- console.log(seeObj.name, 'seeObj');
- let type = seeObj.name.split('.')[1];
+ // console.log(seeObj.name, 'seeObj');
+ let type = row.name.split('.')[1];
console.log(type);
if(type=='pdf'){
documenttype.value = 'txtPdf'
diff --git a/src/views/dmx/knowledgeLib/test.vue b/src/views/dmx/knowledgeLib/test.vue
index fbeab3e..ba702dc 100644
--- a/src/views/dmx/knowledgeLib/test.vue
+++ b/src/views/dmx/knowledgeLib/test.vue
@@ -66,8 +66,6 @@
import { onMounted, onBeforeMount, reactive, ref, watch } from "vue";
import { Message } from '@arco-design/web-vue';
import { kbretrievalTest, queryModelList } from "@/api/kbList";
-// import { usePinia } from "../../../store";
-// const store = usePinia();
// const props = defineProps(['kbId'])
// watch(() => props.kbId, (newValue, oldValue) => {
diff --git a/src/views/dmx/knowledgeLib/tool.vue b/src/views/dmx/knowledgeLib/tool.vue
index f055f2d..e7532a8 100644
--- a/src/views/dmx/knowledgeLib/tool.vue
+++ b/src/views/dmx/knowledgeLib/tool.vue
@@ -7,71 +7,183 @@
</a-button>
<a-modal
v-model:visible="visible"
- title="瑙f瀽鏂规硶"
+ title=" "
@before-open="handleOpened"
@cancel="handleCancel"
- @opened="handleOpened"
:footer="false"
title-align="start"
- width="700px"
+ width="900px"
>
- <div style="display: flex;align-items: center;">
- <div>
- 瑙f瀽鏂规硶:
- </div>
- <div style="margin-left: 10px">
- <a-select v-model="form.parser_id" placeholder="璇烽�夋嫨" >
- <a-option v-for="item in parser_ids" :key="item.value" :label="item.name" :value="item.value"></a-option>
- </a-select>
- </div>
- </div>
- <a-form ref="formRef" :rules="rules" :model="form" auto-label-width @submit="handleSubmit" >
- <a-divider style="margin-top: 10px" />
- <a-form-item field="slider" label="鍧梩oken鏁�"
- :rules="[{type:'number', min:1,message:'slider is min than 1'}]">
- <a-slider v-model="form.chunk_token_num" :max="1000" 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-form-item>
- <div v-if="form.use_raptor">
- <a-form-item field="prompt" label="鎻愮ず璇�">
- <a-textarea
- v-model="form.prompt"
- style="height: 10rem;border: 1px solid var(--color-fill-3);border-radius: 4px" placeholder="璇峰~鍐欐彁绀鸿瘝" />
- </a-form-item>
- <a-form-item field="slider" label="鏈�澶oken鏁�"
- :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
- <a-slider v-model="form.max_token" :min="1" :max="1000" show-input/>
- </a-form-item>
- <a-form-item field="slider" label="闃堝��" :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
- <a-slider v-model="form.threshold" show-tooltip show-input/>
- </a-form-item>
- <a-form-item field="slider" label="鏈�澶ц仛绫绘暟"
- :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
- <a-slider v-model="form.max_cluster" :max="1000" show-input/>
- </a-form-item>
- <a-form-item field="slider" label="闅忔満绉嶅瓙" v-model="form.random_seed"
- :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
- <a-input-number v-model="form.random_seed" :style="{width:'300px',marginRight:'1rem',borderRadius:'4px'}"
- placeholder="璇疯緭鍏�" class="input-demo" :min="10" :max="100" />
- <a-button type="primary" @click="randomNumber">
- <icon-plus />
- </a-button>
+ <a-tabs default-active-key="1">
+ <a-tab-pane key="1">
+ <template #title>
+ <icon-calendar/> 瑙f瀽鏂规硶
+ </template>
+ <div style="width: 100%">
+ <div style="display: flex;align-items: center;">
+ <div>
+ 瑙f瀽鏂规硶:
+ </div>
+ <div style="margin-left: 10px">
+ <a-select v-model="form.parser_id" placeholder="璇烽�夋嫨" >
+ <a-option v-for="item in parser_ids" :key="item.value" :label="item.name" :value="item.value"></a-option>
+ </a-select>
+ </div>
+ </div>
+ <div class="parser">
+ <a-form ref="formRef" :rules="rules" :model="form" auto-label-width @submit="handleSubmit" >
+ <a-divider style="margin-top: 10px" />
+ <a-form-item field="slider" label="鍧梩oken鏁�"
+ :rules="[{type:'number', min:1,message:'slider is min than 1'}]">
+ <a-slider v-model="form.chunk_token_num" :max="1000" 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-form-item>
+ <div v-if="form.use_raptor">
+ <a-form-item field="prompt" label="鎻愮ず璇�">
+ <a-textarea
+ v-model="form.prompt"
+ style="height: 10rem;border: 1px solid var(--color-fill-3);border-radius: 4px" placeholder="璇峰~鍐欐彁绀鸿瘝" />
+ </a-form-item>
+ <a-form-item field="slider" label="鏈�澶oken鏁�"
+ :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
+ <a-slider v-model="form.max_token" :min="1" :max="1000" show-input/>
+ </a-form-item>
+ <a-form-item field="slider" label="闃堝��" :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
+ <a-slider v-model="form.threshold" show-tooltip show-input/>
+ </a-form-item>
+ <a-form-item field="slider" label="鏈�澶ц仛绫绘暟"
+ :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
+ <a-slider v-model="form.max_cluster" :max="1000" show-input/>
+ </a-form-item>
+ <a-form-item field="slider" label="闅忔満绉嶅瓙" v-model="form.random_seed"
+ :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
+ <a-input-number v-model="form.random_seed" :style="{width:'300px',marginRight:'1rem',borderRadius:'4px'}"
+ placeholder="璇疯緭鍏�" class="input-demo" :min="10" :max="100" />
+ <a-button type="primary" @click="randomNumber">
+ <icon-plus />
+ </a-button>
- </a-form-item>
+ </a-form-item>
- </div>
- <a-form-item>
- <div style="width: 100%;text-align: right">
- <a-button @click="visible = false">鍙栨秷</a-button>
- <a-button style="margin-left: 10px" type="primary" html-type="submit">纭畾</a-button>
- </div>
- </a-form-item>
- </a-form>
+ </div>
+ <a-form-item>
+ <div style="width: 100%;text-align: right">
+ <a-button @click="visible = false">鍙栨秷</a-button>
+ <a-button style="margin-left: 10px" type="primary" html-type="submit">纭畾</a-button>
+ </div>
+ </a-form-item>
+ </a-form>
+ </div>
+ </div>
+ </a-tab-pane>
+ <a-tab-pane key="2">
+ <template #title>
+ <icon-clock-circle/> 鍒涘缓瑙f瀽鍧�
+ </template>
+ <div class="details">
+ <div class="details-header">
+ <div style="display: flex; align-items: center;justify-content: flex-end;">
+ <a-radio-group v-model="radio" type="button" style="margin-right: 10px" @change="onRadioChange">
+ <a-radio value="1">鍏ㄦ枃</a-radio>
+ <a-radio value="2">鐪佺暐</a-radio>
+ </a-radio-group>
+ <a-popover position="bottom">
+ <a-button type="outline" class="button" style="margin-right: 10px;">鎵归噺<icon-down style="margin-left: 4px" /></a-button>
+ <template #content>
+ <a-space direction="vertical">
+ <a-checkbox :model-value="checkedAll" :indeterminate="indeterminate" @change="handleChangeAll" style="margin-left: 10px">
+ 閫夋嫨鎵�鏈�
+ </a-checkbox>
+ </a-space>
+ <a-divider style="margin: 10px 0" />
+ <p>
+ <a-button type="text" class="button" style="color: #2a2a2b">
+ <template #icon>
+ <icon-check-circle />
+ </template>
+ 鍚敤閫夊畾鐨�
+ </a-button>
+ </p>
+ <p>
+ <a-button type="text" class="button" style="color: #2a2a2b">
+ <template #icon>
+ <icon-close-circle />
+ </template>
+ 绂佺敤閫夊畾鐨�
+ </a-button>
+ </p>
+ <a-divider style="margin: 10px 0" />
+ <p>
+ <a-button type="text" class="button" style="color: #2a2a2b">
+ <template #icon>
+ <icon-delete />
+ </template>
+ 鍒犻櫎閫夊畾鐨�
+ </a-button>
+ </p>
+ </template>
+ </a-popover>
+ <a-button type="outline" class="button" style="margin-right: 10px">
+ <template #icon>
+ <icon-search />
+ </template>
+ </a-button>
+ <a-popover position="bottom">
+ <a-button type="outline" class="button" style="margin-right: 10px"><icon-sort /></a-button>
+ <template #content>
+ <a-radio-group v-model="available_int" direction="vertical" size="large" @change="onChangeavailable">
+ <a-radio value="">鎵�鏈�</a-radio>
+ <a-radio value="1">鍚敤</a-radio>
+ <a-radio value="0">绂佺敤</a-radio>
+ </a-radio-group>
+ </template>
+ </a-popover>
+ <addDetails></addDetails>
+ </div>
+ </div>
+ <a-divider style="margin-top: 10px" />
+ <div class="groupMain">
+ <a-checkbox-group v-model="data" @change="handleChange" >
+ <div class="groupList" :style="{background:keyBg=='1'?'#eff8ff':'white'}">
+ <a-checkbox value="1"></a-checkbox>
+ <div class="groupList-content" @click="groupListContentClick('1')">
+ 鑰� stable version 鏄渶鏂扮ǔ瀹氱増锛岀粡杩囧厖鍒嗘祴璇曞拰楠岃瘉锛宐ug 杈冨皯锛�
+ 閫傚悎鐢ㄤ簬鐢熶骇鐜銆傚叾鐗堟湰鍙烽�氬父涓哄弻鏁帮紝濡� 1.26銆俵egacy versions
+ 鍒欐槸涔嬪墠鍙戝竷鐨勭ǔ瀹氱増锛屽浜庨渶瑕�
+ 鐗瑰畾鏃х増鏈殑鍏煎鎬ф垨瀹夊叏鎬ф敮鎸佺殑鐢ㄦ埛鏈夌敤锛屼絾涓�鑸笉
+ 鎺ㄨ崘鐢ㄤ簬鏂伴」鐩紝闄ら潪鏈夌壒娈婇渶姹傘�傚湪瀹為檯浣跨敤涓紝濡傛灉杩芥眰鏈�鏂板姛鑳�
+ 涓旀効鎰忛潰瀵瑰彲鑳藉瓨鍦ㄧ殑涓�浜涗笉绋冲畾鍥犵礌锛屽彲浠ュ皾璇曚娇鐢ㄤ富绾跨増鏈繘琛屾祴璇曞拰鐮旂┒锛涘鏋滄槸鐢ㄤ簬鐢熶骇鐜
+ </div>
+ <div class="groupList-right">
+ <a-switch v-model="switchType" checked-value="1" unchecked-value="0" @change="handleChangeStatus()"/>
+ </div>
+ </div>
+
+ <div class="groupList" :style="{background:keyBg=='2'?'#eff8ff':'white'}">
+ <a-checkbox value="1"></a-checkbox>
+ <div class="groupList-content" @click="groupListContentClick('2')">
+ 鑰� stable version 鏄渶鏂扮ǔ瀹氱増锛岀粡杩囧厖鍒嗘祴璇曞拰楠岃瘉锛宐ug 杈冨皯锛�
+ 閫傚悎鐢ㄤ簬鐢熶骇鐜銆傚叾鐗堟湰鍙烽�氬父涓哄弻鏁帮紝濡� 1.26銆俵egacy versions
+ 鍒欐槸涔嬪墠鍙戝竷鐨勭ǔ瀹氱増锛屽浜庨渶瑕�
+ </div>
+ <div class="groupList-right">
+ <a-switch v-model="switchType" checked-value="1" unchecked-value="0" @change="handleChangeStatus()"/>
+ </div>
+ </div>
+
+ </a-checkbox-group>
+ </div>
+ </div>
+ </a-tab-pane>
+ </a-tabs>
+
+
+
</a-modal>
</template>
@@ -79,8 +191,11 @@
import { onMounted, onBeforeMount, reactive, ref, computed } from "vue";
import { Message } from "@arco-design/web-vue";
import {kbdocumentchangeparser} from "@/api/kbList";
+import addDetails from '@/views/dmx/knowledgeLib/addDetails.vue'
const visible = ref(false);
const loading = ref(false);
+const radio = ref('1');
+const keyBg = ref('');
const props = defineProps(['kbtenantInfo','item','kbdetail'])
// const emit = defineEmits(['upTabdateItem'])
@@ -165,25 +280,14 @@
const handleClick = () => {
visible.value = true;
};
-const handleBeforeOk = (done) => {
- formRef.value.validate().then(res => {
- console.log('form:', form)
- if (!form.name) {
- done(false)
- }else {
- console.log('璇锋眰鏁版嵁');
-
- }
- })
-};
const handleCancel = () => {
visible.value = false;
}
const handleOpened =(el) => {
- console.log('props',props.kbtenantInfo);
- console.log('props',props.item);
- console.log('props',props.kbdetail);
+ // console.log('props',props.kbtenantInfo);
+ // console.log('props',props.item);
+ // console.log('props',props.kbdetail);
console.log(parser_ids, 'parser_ids');
// Object.assign(form,{
// name: '',// 鐢ㄦ埛鍚�
@@ -194,9 +298,66 @@
// formRef.value.resetFields();
}
+
const onChangeRAPTOR = () => {
};
+
+
+
+
+
+
+
+
+const indeterminate = ref(false)
+const checkedAll = ref(false)
+const data = ref([])
+const switchType = ref(false)
+const available_int = ref('')
+const onRadioChange = () => {
+ console.log(radio.value);
+
+
+
+};
+const handleChangeAll = (value) => {
+ indeterminate.value = false;
+ if (value) {
+ checkedAll.value = true;
+ data.value = ['1', '2', '3']
+ } else {
+ checkedAll.value = false;
+ data.value = []
+ }
+}
+
+const handleChange = (values) => {
+ if (values.length === 3) {
+ checkedAll.value = true
+ indeterminate.value = false;
+ } else if (values.length === 0) {
+ checkedAll.value = false
+ indeterminate.value = false;
+ } else {
+ checkedAll.value = false
+ indeterminate.value = true;
+ }
+}
+
+
+const groupListContentClick = (value) => {
+ keyBg.value = value;
+}
+
+
+const onChangeavailable = ()=>{
+ console.log(available_int.value);
+}
+
+const handleChangeStatus = ()=>{
+ console.log(switchType.value);
+}
onBeforeMount(()=>{
@@ -207,11 +368,45 @@
})
</script>
-<script lang="ts">
-export default {
- name: 'add',
- methods: {
-
+<style scoped lang="less">
+.parser{
+ width: 100%;
+ ::v-deep .arco-btn-outline:hover, .arco-btn-outline, .arco-btn-outline[type='button']{
+ color: #2a2a2b;
+ border: 1px solid #2a2a2b;
}
-};
-</script>
\ No newline at end of file
+ .button{
+ //color: #2a2a2b!important;
+ }
+}
+.groupMain{
+ width: 100%;
+ height: 500px;
+ overflow: auto;
+ display: flex;
+ justify-content: center;
+ .groupList{
+ display: flex;
+ padding: 24px;
+ border-radius: 8px;
+ //background: #eff8ff;
+ border: 1px solid #f0f0f0;
+ margin-bottom: 20px;
+ overflow: auto;
+ .groupList-content{
+ width: 700px;
+ //height: 100px;
+ overflow: auto;
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+ color: rgba(0, 0, 0, 0.88);
+ font-size: 14px;
+ font-family: Inter;
+ position: relative;
+
+
+ }
+ }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0