CzRger hace 2 semanas
padre
commit
7d50428673

+ 0 - 6
src/api/modules/knowledge/tags.ts

@@ -8,9 +8,3 @@ export const tagsAdd = (params) => post(`/tags`, params, {})
 export const tagsEdit = (params) => put(`/tags`, params, {})
 export const tagsEdit = (params) => put(`/tags`, params, {})
 // 标签删除
 // 标签删除
 export const tagsDel = (id) => del(`/tags/${id}`, {}, {})
 export const tagsDel = (id) => del(`/tags/${id}`, {}, {})
-// 知识库绑定标签
-export const tagsDatasetBanding = (params) =>
-  put(`/tags/dataset/banding`, params, {})
-// 取消知识库绑定标签
-export const tagsDatasetBandingCancel = (params) =>
-  put(`/tags/dataset/banding/cancel`, params, {})

+ 13 - 8
src/views/manage/knowledge/index.vue

@@ -105,19 +105,24 @@
                 <div
                 <div
                   class="flex flex-1 flex-col justify-around overflow-hidden"
                   class="flex flex-1 flex-col justify-around overflow-hidden"
                 >
                 >
-                  <div class="text-[1.25rem] font-bold text-[#2E3238]" v-title>
-                    {{ row.name }}
+                  <div class="flex items-center">
+                    <div
+                      class="flex-1 text-[1.25rem] font-bold text-[#2E3238]"
+                      v-title
+                    >
+                      {{ row.name }}
+                    </div>
+                    <div class="ml-auto">
+                      <tagsSelect
+                        :value="row.datasetTags"
+                        @onChange="(tags) => onChangeTag(row, tags)"
+                      />
+                    </div>
                   </div>
                   </div>
                   <div class="text-[0.75rem] text-[#6F7889]">
                   <div class="text-[0.75rem] text-[#6F7889]">
                     创建者:{{ row.userName }}
                     创建者:{{ row.userName }}
                   </div>
                   </div>
                 </div>
                 </div>
-                <div class="mt-[0.25rem] ml-auto">
-                  <tagsSelect
-                    :value="row.tags"
-                    @onChange="(tags) => onChangeTag(row, tags)"
-                  />
-                </div>
               </div>
               </div>
               <div
               <div
                 class="mt-[var(--czr-gap)] mb-auto text-[0.88rem] text-[#606266]"
                 class="mt-[var(--czr-gap)] mb-auto text-[0.88rem] text-[#606266]"

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

@@ -17,12 +17,13 @@
           :class="{
           :class="{
             'bg-[#c8ceda33]': state.show,
             'bg-[#c8ceda33]': state.show,
           }"
           }"
+          :title="value?.length > 0 ? value.map((v) => v.name).join(',') : ''"
         >
         >
           <SvgIcon name="tag" size="14" class="mr-1" />
           <SvgIcon name="tag" size="14" class="mr-1" />
           <span class="max-w-[5rem]" v-title>{{
           <span class="max-w-[5rem]" v-title>{{
             value?.length > 0
             value?.length > 0
               ? value
               ? value
-                  .map((v) => DictionaryStore.knowledgeTags.map.get(v) || v)
+                  .map((v) => DictionaryStore.knowledgeTags.map.get(v.id))
                   .join(',')
                   .join(',')
               : '添加标签'
               : '添加标签'
           }}</span>
           }}</span>
@@ -184,7 +185,6 @@ const DictionaryStore = useDictionaryStore()
 const DialogStore = useDialogStore()
 const DialogStore = useDialogStore()
 const emit = defineEmits(['onChange'])
 const emit = defineEmits(['onChange'])
 const props = defineProps({
 const props = defineProps({
-  options: { default: <any>[] },
   value: { default: '' },
   value: { default: '' },
   popoverWidth: { default: 0 },
   popoverWidth: { default: 0 },
 })
 })
@@ -291,7 +291,7 @@ watch(
     const map = new Map()
     const map = new Map()
     if (n) {
     if (n) {
       n?.forEach((v) => {
       n?.forEach((v) => {
-        map.set(v, v)
+        map.set(v.id, v.id)
       })
       })
     }
     }
     state.valueMap = map
     state.valueMap = map