From 32b99103581f2d13776673e5c189835e676f7b58 Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期日, 18 八月 2024 18:42:43 +0800
Subject: [PATCH] tip
---
src/views/dmx/knowledgeLib/index.vue | 149 ++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 133 insertions(+), 16 deletions(-)
diff --git a/src/views/dmx/knowledgeLib/index.vue b/src/views/dmx/knowledgeLib/index.vue
index dcf6bcd..9224eeb 100644
--- a/src/views/dmx/knowledgeLib/index.vue
+++ b/src/views/dmx/knowledgeLib/index.vue
@@ -88,6 +88,32 @@
type="text"
class="button"
style="color: #2a2a2b"
+ @click="enableDisable(1)"
+ >
+ <template #icon>
+ <icon-play-circle />
+ </template>
+ 鍚敤
+ </a-button>
+ </p>
+ <p>
+ <a-button
+ type="text"
+ class="button"
+ style="color: #2a2a2b"
+ @click="enableDisable(0)"
+ >
+ <template #icon>
+ <icon-record color="" />
+ </template>
+ 绂佺敤
+ </a-button>
+ </p>
+ <p>
+ <a-button
+ type="text"
+ class="button"
+ style="color: #2a2a2b"
@click="addBlock(1)"
>
<template #icon>
@@ -289,7 +315,21 @@
>{{ $t('dmx.list.complete') }}</a-tag
>
<template #content>
- <p></p>
+ <p>娴佺▼寮�濮嬩簬锛歿{ record.process_begin_at }}</p>
+ <p
+ >杩囩▼鎸佺画鏃堕棿:{{
+ record.process_duation.toFixed(2)
+ }}</p
+ >
+ <div>
+ <p
+ >杩涘害娑堟伅锛�<span
+ v-html="
+ record.progress_msg.replace(/\n/g, '<br/>')
+ "
+ ></span
+ ></p>
+ </div>
</template>
</a-popover>
<a-popover title="" v-if="record.run == '3'">
@@ -300,7 +340,21 @@
>{{ $t('dmx.list.complete') }}</a-tag
>
<template #content>
- <p></p>
+ <p>娴佺▼寮�濮嬩簬锛歿{ record.process_begin_at }}</p>
+ <p
+ >杩囩▼鎸佺画鏃堕棿:{{
+ record.process_duation.toFixed(2)
+ }}</p
+ >
+ <div>
+ <p
+ >杩涘害娑堟伅锛�<span
+ v-html="
+ record.progress_msg.replace(/\n/g, '<br/>')
+ "
+ ></span
+ ></p>
+ </div>
</template>
</a-popover>
<a-popover title="" v-if="record.run == '1'">
@@ -311,7 +365,21 @@
>瑙f瀽涓�...</a-tag
>
<template #content>
- <p></p>
+ <p>娴佺▼寮�濮嬩簬锛歿{ record.process_begin_at }}</p>
+ <p
+ >杩囩▼鎸佺画鏃堕棿:{{
+ record.process_duation.toFixed(2)
+ }}</p
+ >
+ <div>
+ <p
+ >杩涘害娑堟伅锛�<span
+ v-html="
+ record.progress_msg.replace(/\n/g, '<br/>')
+ "
+ ></span
+ ></p>
+ </div>
</template>
</a-popover>
<a-popover title="" v-if="record.run == '2'">
@@ -322,7 +390,21 @@
>{{ $t('dmx.list.cancel') }}</a-tag
>
<template #content>
- <p></p>
+ <p>娴佺▼寮�濮嬩簬锛歿{ record.process_begin_at }}</p>
+ <p
+ >杩囩▼鎸佺画鏃堕棿:{{
+ record.process_duation.toFixed(2)
+ }}</p
+ >
+ <div>
+ <p
+ >杩涘害娑堟伅锛�<span
+ v-html="
+ record.progress_msg.replace(/\n/g, '<br/>')
+ "
+ ></span
+ ></p>
+ </div>
</template>
</a-popover>
<a-popover title="" v-if="record.run == '0'">
@@ -333,7 +415,21 @@
>{{ $t('dmx.list.NotStarted') }}
</a-tag>
<template #content>
- <p></p>
+ <p>娴佺▼寮�濮嬩簬锛歿{ record.process_begin_at }}</p>
+ <p
+ >杩囩▼鎸佺画鏃堕棿锛歿{
+ record.process_duation.toFixed(2)
+ }}</p
+ >
+ <div>
+ <p
+ >杩涘害娑堟伅锛�<span
+ v-html="
+ record.progress_msg.replace(/\n/g, '<br/>')
+ "
+ ></span
+ ></p>
+ </div>
</template>
</a-popover>
</div>
@@ -513,6 +609,7 @@
kbdocumentchangeStatus,
downloadFile,
chunkSwitch,
+ changeStatus,
} from '@/api/kbList';
import { Pagination } from '@/types/global';
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
@@ -590,6 +687,7 @@
const selectTab = (index, item) => {
selectedTab.value = index;
+ checkedArr.value = [];
// console.log(item.id);
kbobj = item;
kbId = kbobj.id;
@@ -745,7 +843,7 @@
};
const onPageChange = (current: number) => {
- fetchData({ ...basePagination, current });
+ fetchData({ ...basePagination, current, kb_id: kbobj.id });
};
const selectTabAll = (val) => {
@@ -875,6 +973,20 @@
getKbdetail(id); // 鑾峰彇璇︽儏
};
+ const enableDisable = async (type) => {
+ Promise.all(
+ checkedArr.value.map(async (item) => {
+ await changeStatus({
+ doc_id: item,
+ status: type,
+ });
+ })
+ ).then(() => {
+ Message.success('鏇存柊鎴愬姛');
+ getKbList();
+ });
+ };
+
//鎵归噺鍚敤鍒犻櫎绂佺敤
const addBlock = async (type) => {
if (type != 3) {
@@ -891,11 +1003,12 @@
}
});
});
- fetchData({
- kb_id: tabs.value[selectedTab.value].id,
- page: 1,
- page_size: 20,
- });
+ // fetchData({
+ // kb_id: tabs.value[selectedTab.value].id,
+ // page: 1,
+ // page_size: 20,
+ // });
+ getKbList();
} else {
// Message.error('瑙f瀽澶辫触');
// row.run = '1';
@@ -912,11 +1025,7 @@
let data = await kbdocumentrm({ doc_id: checkedArr.value });
if (data.code == 0) {
Message.success('鍒犻櫎鎴愬姛');
- fetchData({
- kb_id: tabs.value[selectedTab.value].id,
- page: 1,
- page_size: 20,
- });
+ getKbList();
}
},
onCancel: () => {},
@@ -924,6 +1033,14 @@
}
};
+ const getKbList = async () => {
+ await fetchData({
+ kb_id: tabs.value[selectedTab.value].id,
+ page: 1,
+ page_size: 20,
+ });
+ };
+
const exchangeArray = <T extends Array<any>>(
array: T,
beforeIdx: number,
--
Gitblit v1.8.0