| | |
| | | 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> |
| | |
| | | kbdocumentchangeStatus, |
| | | downloadFile, |
| | | chunkSwitch, |
| | | changeStatus, |
| | | } from '@/api/kbList'; |
| | | import { Pagination } from '@/types/global'; |
| | | import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface'; |
| | |
| | | |
| | | const selectTab = (index, item) => { |
| | | selectedTab.value = index; |
| | | checkedArr.value = []; |
| | | // console.log(item.id); |
| | | kbobj = item; |
| | | kbId = kbobj.id; |
| | |
| | | }; |
| | | |
| | | const onPageChange = (current: number) => { |
| | | fetchData({ ...basePagination, current }); |
| | | fetchData({ ...basePagination, current, kb_id: kbobj.id }); |
| | | }; |
| | | |
| | | const selectTabAll = (val) => { |
| | |
| | | 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) { |
| | |
| | | } |
| | | }); |
| | | }); |
| | | 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('解析失败'); |
| | | // row.run = '1'; |
| | |
| | | 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: () => {}, |
| | |
| | | } |
| | | }; |
| | | |
| | | 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, |