CzRger 2 meses atrás
pai
commit
62e868c4f4

+ 10 - 2
src/views/manage/knowledge/documents/index.vue

@@ -4,17 +4,25 @@
 
 <script setup lang="ts">
 import {getCurrentInstance, onMounted, reactive, ref} from "vue";
-import {useRoute} from "vue-router";
+import {useRoute, useRouter} from "vue-router";
 
 const route = useRoute();
+const router = useRouter();
 const emits = defineEmits([])
 const props = defineProps({})
 const {proxy}: any = getCurrentInstance()
 const state: any = reactive({
   ID: route.params.id
 })
+const initDetail = () => {
+  if (state.ID) {
+
+  } else {
+    router.push({name: '4342bfff-1ea8-4f4c-b562-3cdc1fde116f'})
+  }
+}
 onMounted(() => {
-  console.log(state.ID)
+  initDetail()
 })
 </script>
 

+ 9 - 4
src/views/manage/knowledge/index.vue

@@ -52,7 +52,7 @@
         @handlePage="onPage"
         :col="4"
       >
-        <template #model="{ row }">
+        <template #model="{ row, index }">
           <template v-if="row.empty">
             <div class="knowledge flex justify-center items-center __hover" @click="onAdd">
               <img src="@/assets/images/knowledge-item-add.png"/>
@@ -60,7 +60,12 @@
             </div>
           </template>
           <template v-else>
-            <div class="knowledge flex flex-col">
+            <div class="__hover knowledge flex flex-col" @click="$router.push({
+              name: '78430247-a531-4c8f-8a08-c88e93a836e2',
+              params: {
+                id: index
+              }
+            })">
               <div class="flex">
                 <img src="@/assets/images/knowledge-item-icon.png" class="mr-[var(--czr-gap)]"/>
                 <div class="flex flex-1 flex-col justify-around overflow-hidden">
@@ -79,10 +84,10 @@
                 <div>|</div>
                 <div>关联应用:{{row.p6}}</div>
                 <el-tooltip content="编辑" effect="light" placement="top">
-                  <SvgIcon name="czr_edit" size="14" class="__hover ml-auto" @click="onEdit(row)"/>
+                  <SvgIcon name="czr_edit" size="14" class="__hover ml-auto" @click.stop="onEdit(row)"/>
                 </el-tooltip>
                 <el-tooltip content="删除" effect="light" placement="top">
-                  <SvgIcon name="czr_del" size="16" class="__hover" @click="onDel(row)"/>
+                  <SvgIcon name="czr_del" size="16" class="__hover" @click.stop="onDel(row)"/>
                 </el-tooltip>
                 <el-tooltip :content="row.p7 ? '取消收藏' : '收藏'" effect="light" placement="top">
                   <SvgIcon name="star" size="15" class="__hover" :active="!!row.p7"/>

+ 1 - 1
src/views/manage/knowledge/tags-select.vue

@@ -11,7 +11,7 @@
       }"
     >
       <template #reference>
-        <div @click="state.show = !state.show" class="flex items-center text-[0.88rem] text-[#98a2b2] rounded py-[0.3rem] px-[0.5rem] cursor-pointer hover:bg-[#c8ceda33]" :class="{
+        <div @click.stop="state.show = !state.show" class="flex items-center text-[0.88rem] text-[#98a2b2] rounded py-[0.3rem] px-[0.5rem] cursor-pointer hover:bg-[#c8ceda33]" :class="{
           'bg-[#c8ceda33]': state.show
         }">
           <SvgIcon name="tag" size="14" class="mr-1"/>

+ 8 - 1
src/views/manage/knowledge/upload/index.vue

@@ -13,8 +13,15 @@ const {proxy}: any = getCurrentInstance()
 const state: any = reactive({
   ID: route.params.id
 })
+const initDetail = () => {
+  if (state.ID) {
+
+  } else {
+    router.push({name: '4342bfff-1ea8-4f4c-b562-3cdc1fde116f'})
+  }
+}
 onMounted(() => {
-  console.log(state.ID)
+  initDetail()
 })
 </script>