From eeba916b840d8851bc38586fd162358f7ed1941e Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期一, 29 七月 2024 18:10:38 +0800
Subject: [PATCH] 权限用户资源

---
 src/views/dmx/knowledgeLib/index.vue |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/views/dmx/knowledgeLib/index.vue b/src/views/dmx/knowledgeLib/index.vue
index 04e8c58..b04c3f4 100644
--- a/src/views/dmx/knowledgeLib/index.vue
+++ b/src/views/dmx/knowledgeLib/index.vue
@@ -167,7 +167,7 @@
                     <span>{{parseTime(record.create_time)}}</span>
                   </template>
                   <template #status="{ record }">
-                    <a-switch v-model="record.status"  checked-value="0" unchecked-value="1"/>
+                    <a-switch v-model="record.status"  checked-value="1" unchecked-value="0" @change="handleChangeStatus(record)"/>
                   </template>
                   <template #run="{ record }">
                     <div style="display: flex;align-items: center;">
@@ -178,13 +178,13 @@
                             <p>Here is the text content</p>
                           </template>
                         </a-popover>
-                        <a-popover title="Title" v-if="record.run == '2'">
+                        <a-popover title="Title" v-if="record.run == '1'">
                           <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-popover title="Title" v-if="record.run == '2'">
                           <a-tag :loading="record.loading"  :color="'gold'" border>{{$t('dmx.list.cancel')}}</a-tag>
                           <template #content>
                             <p>Here is the text content</p>
@@ -292,7 +292,7 @@
   queryKbDocumentList,
   deleteKnow,
   queryKbdetail,
-  queryKbtenantInfo, kbdocumentrm, kbdocumentchangeparser, kbdocumentrun
+  queryKbtenantInfo, kbdocumentrm, kbdocumentchangeparser, kbdocumentrun, kbdocumentchangeStatus
 } from "@/api/kbList";
   import { Pagination } from '@/types/global';
   import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
@@ -306,7 +306,6 @@
   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 { deleteAccount } from "@/api/account";
 import { Message } from "@arco-design/web-vue";
 import { parseTime } from "@/utils";
   type SizeProps = 'mini' | 'small' | 'medium' | 'large';
@@ -396,7 +395,6 @@
     {
       title: t('鍚敤'),
       dataIndex: 'status',
-      slotName: 'status',
       slotName: 'status',
     },
     {
@@ -623,12 +621,30 @@
     }
   }
 
+const   handleChangeStatus =  async (row)=>{
+  console.log(row);
+  let data = await kbdocumentchangeStatus({
+    doc_id: row.id,
+    status: row.status
+  })
+  if(data.code == 0){
+    Message.success('鎿嶄綔鎴愬姛');
+  }
+}
+
+
 const   run =  async (row)=>{
   console.log(row);
   row.loading = true;
+  let run = '1'
+  if(row.run!='2'){
+    run = '1'
+  }else {
+    run = '2'
+  }
   let data = await kbdocumentrun({
     doc_ids: [row.id],
-    run: '1'
+    run: run
   })
   // let data = await kbdocumentchangeparser({
   //   parser_id: row.parser_id,

--
Gitblit v1.8.0