| | |
| | | <template #run="{ record }"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <div style="width: 100px"> |
| | | <a-popover title="Title" v-if="record.run == '3'"> |
| | | <a-tag :loading="record.loading" :color="'blue'" border>{{$t('dmx.list.complete')}}</a-tag> |
| | | <template #content> |
| | | <p>Here is the text content</p> |
| | | </template> |
| | | </a-popover> |
| | | <a-popover title="Title" v-if="record.run == '2'"> |
| | | <a-tag :color="'blue'" border>{{$t('dmx.list.complete')}}</a-tag> |
| | | <a-tag :loading="record.loading" :color="'blue'" border>{{$t('dmx.list.complete')}}</a-tag> |
| | | <template #content> |
| | | <p>Here is the text content</p> |
| | | </template> |
| | | </a-popover> |
| | | <a-popover title="Title" v-if="record.run == '1'"> |
| | | <a-tag :color="'gold'" border>{{$t('dmx.list.cancel')}}</a-tag> |
| | | <a-tag :loading="record.loading" :color="'gold'" border>{{$t('dmx.list.cancel')}}</a-tag> |
| | | <template #content> |
| | | <p>Here is the text content</p> |
| | | </template> |
| | | </a-popover> |
| | | <a-popover title="Title" v-if="record.run == '0'"> |
| | | <a-tag :color="'green'" border>{{$t('dmx.list.NotStarted')}}</a-tag> |
| | | <a-tag :loading="record.loading" :color="'green'" border>{{$t('dmx.list.NotStarted')}}</a-tag> |
| | | <template #content> |
| | | <p>Here is the text content</p> |
| | | </template> |
| | | </a-popover> |
| | | </div> |
| | | <div> |
| | | <a-button type="text" size="large" v-if="record.run == '2'"> |
| | | <div > |
| | | <a-button type="text" size="large" @click="run(record)" :loading="record.loading"> |
| | | <template #icon> |
| | | <icon-sync /> |
| | | </template> |
| | | </a-button> |
| | | <a-button type="text" size="large" v-if="record.run == '1'"> |
| | | <template #icon> |
| | | <icon-sync style="color: green" /> |
| | | </template> |
| | | </a-button> |
| | | <a-button type="text" size="large" v-if="record.run == '0'"> |
| | | <template #icon> |
| | | <icon-play-circle style="color: green" /> |
| | | <icon-sync v-if="record.run == '3'"/> |
| | | <icon-sync v-if="record.run == '2'"/> |
| | | <icon-sync style="color: green" v-if="record.run == '1'"/> |
| | | <icon-play-circle style="color: green" v-if="record.run == '0'"/> |
| | | </template> |
| | | </a-button> |
| | | </div> |
| | |
| | | </template> |
| | | <template #action="{ record }" > |
| | | <tool/> |
| | | <edit/> |
| | | <edit :item="record" @upTabdateItem="upTabdateItem"/> |
| | | <a-popconfirm :content="t('确定删除吗')" type="warning" @ok="deleteItem(record)"> |
| | | <a-button type="text" size="small"> |
| | | <template #icon> |
| | |
| | | queryKbDocumentList, |
| | | deleteKnow, |
| | | queryKbdetail, |
| | | queryKbtenantInfo |
| | | queryKbtenantInfo, kbdocumentrm, kbdocumentchangeparser |
| | | } from "@/api/kbList"; |
| | | import { Pagination } from '@/types/global'; |
| | | import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface'; |
| | |
| | | console.log(data, 'data'); |
| | | if(data.code=='0'){ |
| | | renderData.value = data.data.docs||[]; |
| | | renderData.value = renderData.value.map((item) => { |
| | | return { |
| | | ...item, |
| | | loading: false, |
| | | }; |
| | | }); |
| | | console.log(renderData.value, 'renderData.value'); |
| | | |
| | | pagination.current = params.page; |
| | | pagination.total = data.data.total; |
| | | // 查询知识库详情 |
| | |
| | | detailsShow.value = false |
| | | |
| | | } |
| | | |
| | | const deleteItem = async (row)=>{ |
| | | console.log(row); |
| | | // let data = await deleteAccount({id: row.number}) |
| | | account.value.$messageSuccess('删除成功') |
| | | // |
| | | // if(data.code == 200){ |
| | | // this.$messageSuccess('删除成功') |
| | | // } |
| | | function upTabdateItem(id, newName) { |
| | | console.log(id, newName); |
| | | const itemToUpdate = renderData.value.find(item => item.id === id); |
| | | if (itemToUpdate) { |
| | | itemToUpdate.name = newName; |
| | | } |
| | | } |
| | | |
| | | const deleteItem = async (row)=>{ |
| | | console.log(row); |
| | | let data = await kbdocumentrm({doc_id: row.id}) |
| | | if(data.code == 0){ |
| | | Message.success('删除成功'); |
| | | knowledgeData() |
| | | } |
| | | } |
| | | |
| | | const run = async (row)=>{ |
| | | console.log(row); |
| | | row.loading = true; |
| | | let data = await kbdocumentchangeparser({ |
| | | parser_id: row.parser_id, |
| | | doc_id: row.id, |
| | | parser_config: row.parser_config, |
| | | }) |
| | | if(data.code == 0){ |
| | | Message.success('解析成功'); |
| | | row.run = '3'; |
| | | }else{ |
| | | Message.error('解析失败'); |
| | | row.run = '1'; |
| | | } |
| | | row.loading = false; |
| | | } |
| | | |
| | | |
| | | watch( |
| | | () => columns.value, |
| | | (val) => { |