|
@@ -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>
|
|
@@ -61,6 +61,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="VideoTagEdit">
|
|
|
+import { addVideoTag, getVideoTagInfo } from '@/api/videoMonitor';
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
modelValue: Boolean,
|
|
|
id: String
|
|
@@ -75,11 +77,17 @@ 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 +116,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>
|