From 8b6d79d198707624b1aa3ee004bed3991ac454f3 Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期四, 08 八月 2024 20:13:41 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/web/flow_web
---
src/views/dmx/IntelligentAgent/components/agentConfig.vue | 2
src/api/kbList.ts | 8
src/views/dmx/knowledgeLib/eidtDetails.vue | 66 ++--
yarn.lock | 5
src/views/dmx/knowledgeLib/tool.vue | 718 ++++++++++++++++++++++++++++----------------------
src/views/authority/resource/index.vue | 1
6 files changed, 449 insertions(+), 351 deletions(-)
diff --git a/src/api/kbList.ts b/src/api/kbList.ts
index 79be0bb..7c0589b 100644
--- a/src/api/kbList.ts
+++ b/src/api/kbList.ts
@@ -205,10 +205,14 @@
+export function achunkSet(params) {
+ return axios.post('/api/v1/chunk/set', params);
+}
-
-
+export function achunkGet(params) {
+ return axios.get('/api/v1/chunk/get', {params});
+}
diff --git a/src/views/authority/resource/index.vue b/src/views/authority/resource/index.vue
index 9c7a161..8cea64a 100644
--- a/src/views/authority/resource/index.vue
+++ b/src/views/authority/resource/index.vue
@@ -8,7 +8,6 @@
:bordered="false"
style=" 'width': '100%'; height: calc(100vh - 250px); 'overflow-y': 'auto' "
>
- <a-button @click="() => onIconClick(null)">鏂板鐖剁骇鑿滃崟</a-button>
<a-tree
class="tree-demo"
draggable
diff --git a/src/views/dmx/IntelligentAgent/components/agentConfig.vue b/src/views/dmx/IntelligentAgent/components/agentConfig.vue
index 427dcf9..c05f1ef 100644
--- a/src/views/dmx/IntelligentAgent/components/agentConfig.vue
+++ b/src/views/dmx/IntelligentAgent/components/agentConfig.vue
@@ -283,7 +283,7 @@
empty_response: "",
prologue: "浣犲ソ锛� 鎴戞槸浣犵殑鍔╃悊锛屾湁浠�涔堝彲浠ュ府鍒颁綘鐨勫悧锛�",
quote: true,
- self_rag: true,
+ self_rag: false,
system: "浣犳槸涓�涓櫤鑳藉姪鎵嬶紝璇锋�荤粨鐭ヨ瘑搴撶殑鍐呭鏉ュ洖绛旈棶棰橈紝璇峰垪涓剧煡璇嗗簱涓殑鏁版嵁璇︾粏鍥炵瓟銆傚綋鎵�鏈夌煡璇嗗簱鍐呭閮戒笌闂鏃犲叧鏃讹紝浣犵殑鍥炵瓟蹇呴』鍖呮嫭鈥滅煡璇嗗簱涓湭鎵惧埌鎮ㄨ鐨勭瓟妗堬紒鈥濊繖鍙ヨ瘽銆�" +
"鍥炵瓟闇�瑕佽�冭檻鑱婂ぉ鍘嗗彶銆俓n 浠ヤ笅鏄煡璇嗗簱锛歕n {knowledge}\n 浠ヤ笂鏄煡璇嗗簱銆�",
parameters: [
diff --git a/src/views/dmx/knowledgeLib/eidtDetails.vue b/src/views/dmx/knowledgeLib/eidtDetails.vue
index 68facfa..ba242bb 100644
--- a/src/views/dmx/knowledgeLib/eidtDetails.vue
+++ b/src/views/dmx/knowledgeLib/eidtDetails.vue
@@ -18,7 +18,7 @@
<a-textarea
v-model="form.content_with_weight"
placeholder=""
- style="height: 100px"
+ style="height: 100px;overflow: auto;"
auto-size
/>
</a-form-item>
@@ -26,10 +26,10 @@
<div style="width: auto">
<a-tag
v-for="(item, index) in form.important_kwd"
- :key="index"
+ :key="item"
closable
bordered
- @close="form.important_kwd.splice(index, 1)"
+ @close="deleteKey(item)"
style="margin-right: 10px"
>
{{ item }}
@@ -49,17 +49,17 @@
</div>
</a-form-item>
- <div>
- <a-divider style="margin: 10px 0" />
- <a-switch size="small" />
- <span style="color: var(--color-text-2)">鍚敤</span>
- <a-button type="text" style="color: var(--color-text-2)">
- <template #icon>
- <icon-delete />
- </template>
- 鍒犻櫎
- </a-button>
- </div>
+<!-- <div>-->
+<!-- <a-divider style="margin: 10px 0" />-->
+<!-- <a-switch size="small" />-->
+<!-- <span style="color: var(--color-text-2)">鍚敤</span>-->
+<!-- <a-button type="text" style="color: var(--color-text-2)">-->
+<!-- <template #icon>-->
+<!-- <icon-delete />-->
+<!-- </template>-->
+<!-- 鍒犻櫎-->
+<!-- </a-button>-->
+<!-- </div>-->
<a-form-item>
<div style="width: 100%; text-align: right">
<a-button @click="visible = false">鍙栨秷</a-button>
@@ -73,12 +73,12 @@
</template>
<script lang="ts" setup>
- import { onMounted, onBeforeMount, reactive, ref } from 'vue';
- import { achunkCreate } from '@/api/kbList';
+import { onMounted, onBeforeMount, reactive, ref, nextTick } from "vue";
+import { achunkCreate, achunkSet } from "@/api/kbList";
const props = defineProps(['item']);
-
- const visible = ref(false);
+ const visible =defineModel('eidtDilVisible');
+ const emit = defineEmits(['canplaythrough']);
const keyVisible = ref(false);
const loading = ref(false);
const form = reactive({
@@ -98,13 +98,17 @@
};
const handleSubmit = async ({ values, errors }) => {
- console.log(props.item.id);
if (!errors) {
- const res = await achunkCreate({
+ const res = await achunkSet({
content_with_weight: values.content_with_weight,
important_kwd: values.important_kwd,
- doc_id: props.item.id,
+ doc_id: props.item.doc_id,
+ chunk_id: props.item.chunk_id,
});
+ if (res.code === 0) {
+ visible.value = false;
+ emit('canplaythrough');
+ }
}
};
@@ -112,9 +116,6 @@
visible.value = true;
};
- defineExpose({
- handleClick,
- });
const handleBeforeOk = (done) => {
formRef.value.validate().then((res) => {
console.log('form:', form);
@@ -125,15 +126,22 @@
};
const handleOpened = (el) => {
- Object.assign(form, {
- content_with_weight: '',
- important_kwd: [],
- important_kwd_key: '',
- });
+ console.log(props.item);
+ nextTick(()=>{
+ Object.assign(form, props.item);
+ console.log(form.important_kwd);
+ })
formRef.value.resetFields();
keyVisible.value = false;
};
+ const deleteKey = (row) => {
+ console.log(form.important_kwd);
+ console.log(row);
+ // form.important_kwd.splice(index, 1);
+ form.important_kwd = form.important_kwd.filter((item) => item !== row);
+ };
+
const addKey = () => {
form.important_kwd_key = '';
formInput.value.focus();
diff --git a/src/views/dmx/knowledgeLib/tool.vue b/src/views/dmx/knowledgeLib/tool.vue
index 6ea4b28..9fc3e64 100644
--- a/src/views/dmx/knowledgeLib/tool.vue
+++ b/src/views/dmx/knowledgeLib/tool.vue
@@ -15,10 +15,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 +41,14 @@
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,8 +56,18 @@
show-input
/>
</a-form-item>
- <a-divider style="margin-top: 10px" />
- <a-form-item field="raptor" label="浣跨敤鍙洖澧炲己RAPTOR绛栫暐">
+ <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-space direction="vertical" size="large">
<a-switch
v-model="form.use_raptor"
@@ -125,7 +144,8 @@
style="margin-left: 10px"
type="primary"
html-type="submit"
- >纭畾</a-button
+ >纭畾
+ </a-button
>
</div>
</a-form-item>
@@ -134,7 +154,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 +181,10 @@
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 +271,10 @@
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"
@@ -274,8 +301,8 @@
<div
class="groupList"
:class="{
- groupActive: keyBg == '1',
- groupNoActive: keyBg != '1',
+ groupActive: keyBg == index,
+ groupNoActive: keyBg != index,
}"
v-for="(item, index) in listData"
:key="index"
@@ -283,8 +310,8 @@
<a-checkbox :value="item.chunk_id"></a-checkbox>
<div
class="groupList-content emphaRed"
- @click="groupListContentClick('1')"
- @dblclick="contentClick(1)"
+ @click="groupListContentClick(index)"
+ @dblclick="contentClick(item)"
v-html="item.content_with_weight"
>
</div>
@@ -301,351 +328,406 @@
</a-spin>
</div>
</div>
- <eidtDetails ref="eidtDil"></eidtDetails>
+ <eidtDetails
+ ref="eidtDil"
+ :item="eidtDilinfo"
+ v-model:eidtDilVisible="eidtDilVisible"
+ @canplaythrough="canplaythrough"
+ ></eidtDetails>
</a-tab-pane>
</a-tabs>
</a-modal>
</template>
<script lang="ts" setup>
- import {
- onMounted,
- onBeforeMount,
- reactive,
- ref,
- computed,
- watch,
- } from 'vue';
- import { Message } from '@arco-design/web-vue';
- import {
- kbdocumentchangeparser,
- achunkCreate,
- queryChunkList,
- chunkSwitch,
- chunkRm,
- } 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');
- const keyBg = ref('');
- const eidtDil = ref();
+import {
+ onMounted,
+ onBeforeMount,
+ reactive,
+ ref,
+ computed,
+ watch
+} from "vue";
+import { Message } from "@arco-design/web-vue";
+import {
+ kbdocumentchangeparser,
+ achunkCreate,
+ queryChunkList,
+ chunkSwitch,
+ chunkRm, achunkGet
+} from "@/api/kbList";
+import addDetails from "@/views/dmx/knowledgeLib/addDetails.vue";
+import eidtDetails from "@/views/dmx/knowledgeLib/eidtDetails.vue";
- const props = defineProps(['kbtenantInfo', 'item', 'kbdetail']);
- // const emit = defineEmits(['upTabdateItem'])
+const visible = ref(false);
+const loading = ref(false);
+const radio = ref("1");
+const keyBg = ref("");
+const eidtDil = ref();
+const eidtDilVisible = ref(false);
+const eidtDilinfo = reactive({});
- let threshold = computed(() => {
- return form.threshold / 100;
- });
+const props = defineProps(["kbtenantInfo", "item", "kbdetail"]);
+// const emit = defineEmits(['upTabdateItem'])
- const kbtenantInfo = props.kbtenantInfo;
+let threshold = computed(() => {
+ return form.threshold / 100;
+});
- let parser_ids = kbtenantInfo.parser_ids.split(',').map((item) => {
- const [value1, value2] = item.split(':');
- return {
- name: value2,
- value: value1,
- };
- });
+const kbtenantInfo = props.kbtenantInfo;
- const isBtn = ref(true);
-
- const closeSlelct = () => {
- window.addEventListener('click', (event) => {
- if (!event.target.closest('.space_search') && !isBtn.value) {
- isBtn.value = true;
- // form.keywords = '';
- }
- });
+let parser_ids = kbtenantInfo.parser_ids.split(",").map((item) => {
+ const [value1, value2] = item.split(":");
+ return {
+ name: value2,
+ value: value1
};
+});
- watch(isBtn, (val) => {
- if (!val) {
- closeSlelct();
+// 杩囨护瑙f瀽鏂规硶
+
+const filterParserArr = [
+ 'naive',
+ 'qa',
+ 'resume',
+ 'manual',
+ 'book',
+ 'laws',
+ 'one',
+]
+
+
+
+
+
+const isBtn = ref(true);
+
+const closeSlelct = () => {
+ window.addEventListener("click", (event) => {
+ if (!event.target.closest(".space_search") && !isBtn.value) {
+ isBtn.value = true;
+ // form.keywords = '';
}
});
+};
- const form = reactive({
- parser_id: props.item.parser_id,
- doc_id: props.item.id,
- max_token: 698,
- threshold: 0.3,
- max_cluster: 233,
- random_seed: 1500,
- chunk_token_num: 128,
- use_raptor: false,
- keywords: '',
- pages: {},
- prompt:
- '璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n' +
- ' {cluster_content}\n' +
- '浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��',
- });
- const formRef = ref(null);
- const rules = {
- prompt: [
- {
- required: true,
- message: '鎻愮ず璇嶄笉鍏佽涓虹┖',
- },
- ],
- };
+watch(isBtn, (val) => {
+ if (!val) {
+ closeSlelct();
+ }
+});
- const listData = ref([]);
+const form = reactive({
+ parser_id: '',
+ doc_id: props.item.id,
+ max_token: 698,
+ threshold: 0.3,
+ max_cluster: 233,
+ random_seed: 1500,
+ chunk_token_num: 128,
+ use_raptor: false,
+ keywords: "",
+ pages: {},
+ prompt:
+ "璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n" +
+ " {cluster_content}\n" +
+ "浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��"
+});
+const formRef = ref(null);
+const rules = {
+ prompt: [
+ {
+ required: true,
+ message: "鎻愮ず璇嶄笉鍏佽涓虹┖"
+ }
+ ]
+};
- const formatter = (value) => {
- return value / 100;
- };
- function randomNumber() {
- // 鐢熸垚涓�涓粙浜巑in鍜宮ax涔嬮棿鐨勯殢鏈烘暣鏁帮紙鍖呭惈min鍜宮ax锛�
- const min = 1; // 鏈�灏忓��
- const max = 10000; // 鏈�澶у��
- form.random_seed = Math.floor(Math.random() * (max - min + 1)) + min;
+const listData = ref([]);
+
+const formatter = (value) => {
+ return value / 100;
+};
+
+function randomNumber() {
+ // 鐢熸垚涓�涓粙浜巑in鍜宮ax涔嬮棿鐨勯殢鏈烘暣鏁帮紙鍖呭惈min鍜宮ax锛�
+ const min = 1; // 鏈�灏忓��
+ const max = 10000; // 鏈�澶у��
+ form.random_seed = Math.floor(Math.random() * (max - min + 1)) + min;
+}
+
+const handleSubmit = async ({ values, errors }) => {
+ if (!errors) {
+ let data = await kbdocumentchangeparser({
+ parser_id: form.parser_id,
+ doc_id: form.doc_id,
+ parser_config: {
+ raptor: {
+ use_raptor: form.use_raptor,
+ prompt: form.prompt,
+ max_token: form.max_token,
+ threshold: form.threshold,
+ max_cluster: form.max_cluster,
+ random_seed: form.random_seed
+ },
+ chunk_token_num: form.chunk_token_num,
+ pages: []
+ }
+ });
+ if (data.code == 0) {
+ Message.success("閰嶇疆鎴愬姛");
+ } else {
+ Message.error("閰嶇疆澶辫触");
+ }
+ visible.value = false;
+ }
+};
+
+const handleClick = () => {
+ visible.value = true;
+};
+const handleCancel = () => {
+ visible.value = false;
+};
+
+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 handleSubmit = async ({ values, errors }) => {
- if (!errors) {
- let data = await kbdocumentchangeparser({
- parser_id: form.parser_id,
- doc_id: form.doc_id,
- parser_config: {
- raptor: {
- use_raptor: form.use_raptor,
- prompt: form.prompt,
- max_token: form.max_token,
- threshold: form.threshold,
- max_cluster: form.max_cluster,
- random_seed: form.random_seed,
- },
- chunk_token_num: form.chunk_token_num,
- pages: [],
- },
- });
- if (data.code == 0) {
- Message.success('閰嶇疆鎴愬姛');
- } else {
- Message.error('閰嶇疆澶辫触');
- }
- visible.value = false;
+
+};
+const handleOpened = (el) => {
+ // console.log('props',props.kbtenantInfo);
+ console.log('props',props.item);
+ // console.log('props',props.kbdetail);
+ console.log(parser_ids, "parser_ids");
+ let parser_id = props.item.parser_id;
+ parser_ids.forEach((item) => {
+ if (item.name == parser_id) {
+ form.parser_id = item.value;
}
- };
+ });
- const handleClick = () => {
- visible.value = true;
- };
- const handleCancel = () => {
- visible.value = false;
- };
- const contentClick = (done) => {
- eidtDil.value.handleClick();
- };
- const handleOpened = (el) => {
- // 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: '',// 鐢ㄦ埛鍚�
- // nameJoin: '',// 鏄电О
- // post: '',// 宀椾綅
- // txt: '',// 澶囨敞
- // });
- // formRef.value.resetFields();
- console.log(props.item.id);
- };
+ // Object.assign(form,{
+ // name: '',// 鐢ㄦ埛鍚�
+ // nameJoin: '',// 鏄电О
+ // post: '',// 宀椾綅
+ // txt: '',// 澶囨敞
+ // });
+ // formRef.value.resetFields();
+ console.log(props.item.id);
+};
- const onChangeRAPTOR = () => {};
+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;
- listData.value.forEach((item) => {
- data.value.push(item.chunk_id);
- });
- } else {
- checkedAll.value = false;
- data.value = [];
- }
- };
-
- const handleChange = (values) => {
- data.value = values;
- };
-
- //鎵归噺鍚敤鍒犻櫎绂佺敤
- const addBlock = (type) => {
- if (data.value.length == 0) {
- Message.error('璇烽�夋嫨瑕佹搷浣滅殑鏁版嵁');
- return;
- }
- if (type == 3) {
- deleteChunk();
- } else {
- let params = {
- chunk_ids: data.value,
- available_int: type,
- doc_id: props.item.id,
- };
- chunkSwitch(params).then((res) => {
- if (res.code == 0) {
- Message.success('鎿嶄綔鎴愬姛');
- getList();
- checkedAll.value = false;
- data.value = [];
- } else {
- Message.error('鎿嶄綔澶辫触');
- }
- });
- }
- };
-
- const groupListContentClick = (value) => {
- keyBg.value = value;
- };
-
- const onChangeavailable = () => {
- getList();
- };
-
- const handleChangeStatus = (val) => {
- updateChunkStatus(val);
- };
- const isLoading = ref(true);
- // 鑷畾涔夊姞杞芥彁绀烘枃鏈�
- const tip = '鍔犺浇涓紝璇风◢鍊�...';
- //鑾峰彇鍒楄〃
- const getList = async () => {
- let params = {
- doc_id: props.item.id,
- keywords: form.keywords,
- page: 1,
- size: 10000,
- };
- if (available_int.value !== '') {
- params.available_int = available_int.value;
- }
- await queryChunkList(params).then((res) => {
- if (res.code == 0) {
- listData.value = res.data.chunks;
- isLoading.value = false;
- listData.value = listData.value.map((item) => {
- item.available_int = parseInt(item.available_int);
- return item;
- });
- }
+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;
+ listData.value.forEach((item) => {
+ data.value.push(item.chunk_id);
});
- };
- //鏇存柊鍒楄〃
- const canplaythrough = () => {
- getList();
- };
+ } else {
+ checkedAll.value = false;
+ data.value = [];
+ }
+};
- //鍚敤绂佺敤
- const updateChunkStatus = (val) => {
- let params = {
- chunk_ids: [val.chunk_id],
- available_int: val.available_int,
- doc_id: props.item.id,
- };
- chunkSwitch(params).then((res) => {
- console.log(res);
- if (res.code == 0) {
- Message.success('鏇存柊鎴愬姛');
- getList();
- } else {
- Message.error('鏇存柊澶辫触');
- }
- });
- };
+const handleChange = (values) => {
+ data.value = values;
+};
- //鍒犻櫎
- const deleteChunk = () => {
+//鎵归噺鍚敤鍒犻櫎绂佺敤
+const addBlock = (type) => {
+ if (data.value.length == 0) {
+ Message.error("璇烽�夋嫨瑕佹搷浣滅殑鏁版嵁");
+ return;
+ }
+ if (type == 3) {
+ deleteChunk();
+ } else {
let params = {
chunk_ids: data.value,
- doc_id: props.item.id,
+ available_int: type,
+ doc_id: props.item.id
};
- chunkRm(params).then((res) => {
- console.log(res);
+ chunkSwitch(params).then((res) => {
if (res.code == 0) {
- Message.success('鍒犻櫎鎴愬姛');
+ Message.success("鎿嶄綔鎴愬姛");
getList();
+ checkedAll.value = false;
+ data.value = [];
} else {
- Message.error('鍒犻櫎澶辫触');
+ Message.error("鎿嶄綔澶辫触");
}
});
- };
+ }
+};
- onBeforeMount(() => {});
- onMounted(() => {
- getList();
+const groupListContentClick = (value) => {
+ keyBg.value = value;
+};
+
+const onChangeavailable = () => {
+ getList();
+};
+
+const handleChangeStatus = (val) => {
+ updateChunkStatus(val);
+};
+const isLoading = ref(true);
+// 鑷畾涔夊姞杞芥彁绀烘枃鏈�
+const tip = "鍔犺浇涓紝璇风◢鍊�...";
+//鑾峰彇鍒楄〃
+const getList = async () => {
+ let params = {
+ doc_id: props.item.id,
+ keywords: form.keywords,
+ page: 1,
+ size: 10000
+ };
+ if (available_int.value !== "") {
+ params.available_int = available_int.value;
+ }
+ await queryChunkList(params).then((res) => {
+ if (res.code == 0) {
+ listData.value = res.data.chunks;
+ isLoading.value = false;
+ listData.value = listData.value.map((item) => {
+ item.available_int = parseInt(item.available_int);
+ return item;
+ });
+ }
});
+};
+//鏇存柊鍒楄〃
+const canplaythrough = () => {
+ getList();
+};
+
+//鍚敤绂佺敤
+const updateChunkStatus = (val) => {
+ let params = {
+ chunk_ids: [val.chunk_id],
+ available_int: val.available_int,
+ doc_id: props.item.id
+ };
+ chunkSwitch(params).then((res) => {
+ console.log(res);
+ if (res.code == 0) {
+ Message.success("鏇存柊鎴愬姛");
+ getList();
+ } else {
+ Message.error("鏇存柊澶辫触");
+ }
+ });
+};
+
+//鍒犻櫎
+const deleteChunk = () => {
+ let params = {
+ chunk_ids: data.value,
+ doc_id: props.item.id
+ };
+ chunkRm(params).then((res) => {
+ console.log(res);
+ if (res.code == 0) {
+ Message.success("鍒犻櫎鎴愬姛");
+ getList();
+ } else {
+ Message.error("鍒犻櫎澶辫触");
+ }
+ });
+};
+
+onBeforeMount(() => {
+ getList();
+});
+onMounted(() => {
+
+});
</script>
<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;
- }
- .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;
- 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: #2a2a2b;
- font-size: 14px;
- font-family: Inter;
- position: relative;
- }
- }
- }
- :deep(.emphaRed em) {
- color: red !important;
+.parser {
+ width: 100%;
+
+ ::v-deep .arco-btn-outline:hover,
+ .arco-btn-outline,
+ .arco-btn-outline[type='button'] {
+ color: #2a2a2b;
+ border: 1px solid #2a2a2b;
}
- .groupActive {
- background: #eff8ff;
+ .button {
+ //color: #2a2a2b!important;
}
- .groupNoActive {
- background: var(--color-bg-1);
- color: var(--color-text-1);
+}
+
+::-webkit-scrollbar {
+ display: none;
+}
+
+.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: #2a2a2b;
+ font-size: 14px;
+ font-family: Inter;
+ position: relative;
+ }
}
+}
+
+:deep(.emphaRed em) {
+ color: red !important;
+}
+
+.groupActive {
+ background: #eff8ff;
+}
+
+.groupNoActive {
+ background: var(--color-bg-1);
+ color: var(--color-text-1);
+}
</style>
diff --git a/yarn.lock b/yarn.lock
index 6cb148f..d3fdd50 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -621,6 +621,11 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
+"@microsoft/fetch-event-source@^2.0.1":
+ version "2.0.1"
+ resolved "https://registry.npmmirror.com/@microsoft/fetch-event-source/-/fetch-event-source-2.0.1.tgz#9ceecc94b49fbaa15666e38ae8587f64acce007d"
+ integrity sha512-W6CLUJ2eBMw3Rec70qrsEW0jOm/3twwJv21mrmj2yORiaVmVYGS4sSS5yUwvQc1ZlDLYGPnClVWmUUMagKNsfA==
+
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.npmmirror.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz"
--
Gitblit v1.8.0