Browse Source

视频标签

Hwf 6 months ago
parent
commit
b56c01ce64

+ 18 - 0
src/api/videoMonitor/index.ts

@@ -46,3 +46,21 @@ export function updateUserVideoPoints(data) {
     data: data
   });
 }
+
+// 获取视频标签
+export function getVideoTagInfo(params) {
+  return request({
+    url: '/api/videoResource/videoinfo/get_video_tag_info',
+    method: 'get',
+    params: params
+  });
+}
+
+// 视频点位标签信息-添加
+export function addVideoTag(data) {
+  return request({
+    url: '/api/videoResource/videoinfo/add_video_tag',
+    method: 'post',
+    data: data
+  });
+}

+ 1 - 1
src/components/Dialog/index.vue

@@ -5,7 +5,7 @@
         {{ title ? title : '弹窗' }}
       </div>
       <div v-if="!!getTagId" class="tags">
-        <div v-for="(item, index) in tags" :key="index" class="tag">{{ item.name }}</div>
+        <div v-for="(item, index) in tags" :key="index" class="tag">{{ item.dict_label }}</div>
         <div class="add-tag" @click="handleShowAddTag">+添加标签</div>
       </div>
       <i class="decoration" />

+ 17 - 3
src/components/VideoTagEdit/index.vue

@@ -9,7 +9,7 @@
         <div class="title">当前标签</div>
       </div>
       <div class="tags">
-        <div v-for="(item, index) in currentTags" :key="index" class="tag">{{ item.name }}</div>
+        <div v-for="(item, index) in currentTags" :key="index" class="tag">{{ item.dict_label }}</div>
       </div>
       <div class="title-box">
         <div class="title">新建标签</div>
@@ -75,11 +75,18 @@ let typeOptions = ref([]);
 let industry = ref('');
 let industryTags = ref([]);
 let industryOptions = ref([]);
+
+const getData = () => {
+  getVideoTagInfo({ video_code: props.id }).then((res) => {
+    currentTags.value = res.data;
+  });
+};
+
 watch(
   () => props.id,
   () => {
     if (!!props.id) {
-      currentTags.value = [{ name: '河坝' }, { name: '水库' }];
+      getData();
       recentTags.value = [{ name: '河坝' }, { name: '水库' }, { name: '山塘' }];
       typeTags.value = [{ name: '河坝' }, { name: '水库' }, { name: '山塘' }];
       industryTags.value = [{ name: '河坝' }, { name: '水库' }, { name: '山塘' }];
@@ -108,8 +115,15 @@ const handleClose = () => {
   emits('update:modelValue', false);
 };
 const handleAdd = () => {
+  addVideoTag({
+    video_code: props.id,
+    dict_value: addTag.value,
+    dict_type: 'video_type'
+  }).then(() => {
+    getData();
+  });
   addTag.value = '';
-}
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 2
src/views/globalMap/LeftMenu.vue

@@ -61,8 +61,7 @@
               >
                 <div class="text1" :title="item.name" @click="handleShowDialog(item)">{{ item.name }}</div>
                 <div class="tags">
-                  <div class="tag">{{ item.dict_label }}</div>
-<!--                  <div v-for="(item2, index2) in item.tags" :key="index2" class="tag">{{ item2.name }}</div>-->
+                  <div v-for="(item2, index2) in item.tag_info" :key="index2" class="tag">{{ item2.name }}</div>
                 </div>
               </div>
               <div v-show="searchState.showList && searchState.videoList.length === 0" style="text-align: center">无数据</div>